From 1009a06c46f4c827fd3923662283c3318403f478 Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Tue, 26 Aug 2025 17:54:22 +0530 Subject: [PATCH 01/76] fix: context items dialog not visible on conversation compaction --- gui/src/pages/gui/Chat.tsx | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/gui/src/pages/gui/Chat.tsx b/gui/src/pages/gui/Chat.tsx index 383b87357..4be689dae 100644 --- a/gui/src/pages/gui/Chat.tsx +++ b/gui/src/pages/gui/Chat.tsx @@ -288,19 +288,17 @@ export function Chat() { if (message.role === "user") { return ( -
- - sendInput(editorState, modifiers, index) - } - isLastUserInput={isLastUserInput(index)} - isMainInput={false} - editorState={editorState} - contextItems={contextItems} - appliedRules={appliedRules} - inputId={message.id} - /> -
+ + sendInput(editorState, modifiers, index) + } + isLastUserInput={isLastUserInput(index)} + isMainInput={false} + editorState={editorState} + contextItems={contextItems} + appliedRules={appliedRules} + inputId={message.id} + /> ); } From b5e68d206052c240d69f9f4d90b5173fececdbc2 Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Tue, 26 Aug 2025 18:33:11 +0530 Subject: [PATCH 02/76] fix: close drag over message overlay during onDrop --- gui/src/components/mainInput/TipTapEditor/TipTapEditor.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/src/components/mainInput/TipTapEditor/TipTapEditor.tsx b/gui/src/components/mainInput/TipTapEditor/TipTapEditor.tsx index 944caa051..82a934f41 100644 --- a/gui/src/components/mainInput/TipTapEditor/TipTapEditor.tsx +++ b/gui/src/components/mainInput/TipTapEditor/TipTapEditor.tsx @@ -204,6 +204,7 @@ export function TipTapEditor(props: TipTapEditorProps) { setShowDragOverMsg(true); }} onDrop={(event) => { + setShowDragOverMsg(false); if ( !defaultModel || !modelSupportsImages( @@ -215,7 +216,6 @@ export function TipTapEditor(props: TipTapEditorProps) { ) { return; } - setShowDragOverMsg(false); let file = event.dataTransfer.files[0]; void handleImageFile(ideMessenger, file).then((result) => { if (!editor) { From 6f9102155040ffa95a87d329f06e95e9b63087a6 Mon Sep 17 00:00:00 2001 From: Hernan Date: Wed, 27 Aug 2025 08:51:52 +0000 Subject: [PATCH 03/76] Add stdout console log when package fails to build (build-packages.js) --- scripts/build-packages.js | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/build-packages.js b/scripts/build-packages.js index 996323f8a..969641d8a 100644 --- a/scripts/build-packages.js +++ b/scripts/build-packages.js @@ -34,6 +34,7 @@ function runCommand(command, cwd, packageName) { } else { console.error(`❌ ${packageName}: ${command} failed with code ${code}`); console.error(`stderr: ${stderr}`); + console.error(`stdout: ${stdout}`); reject( new Error(`${packageName} failed: ${command} (exit code ${code})`), ); From bad857a71e46e25c2edbe8e0a4099e5860c8d9ba Mon Sep 17 00:00:00 2001 From: Ting-Wai To <40179554+tingwai@users.noreply.github.com> Date: Thu, 28 Aug 2025 11:46:05 -0700 Subject: [PATCH 04/76] feat: return usage for openai providers --- packages/openai-adapters/src/apis/Gemini.ts | 31 ++++++++- packages/openai-adapters/src/apis/Relace.ts | 27 +++++++- .../openai-adapters/src/test/main.test.ts | 65 +++++++++++++++++-- 3 files changed, 112 insertions(+), 11 deletions(-) diff --git a/packages/openai-adapters/src/apis/Gemini.ts b/packages/openai-adapters/src/apis/Gemini.ts index c9c29fb9e..51d96f720 100644 --- a/packages/openai-adapters/src/apis/Gemini.ts +++ b/packages/openai-adapters/src/apis/Gemini.ts @@ -22,6 +22,7 @@ import { chatChunkFromDelta, customFetch, embedding, + usageChatChunk, } from "../util.js"; import { convertOpenAIToolToGeminiFunction, @@ -37,6 +38,8 @@ import { RerankCreateParams, } from "./base.js"; +type UsageInfo = { total_tokens: number; completion_tokens: number; prompt_tokens: number }; + export class GeminiApi implements BaseLlmApi { apiBase: string = "https://generativelanguage.googleapis.com/v1beta/"; @@ -240,6 +243,7 @@ export class GeminiApi implements BaseLlmApi { signal: AbortSignal, ): Promise { let completion = ""; + let usage: UsageInfo | undefined = undefined; for await (const chunk of this.chatCompletionStream( { ...body, @@ -247,7 +251,12 @@ export class GeminiApi implements BaseLlmApi { }, signal, )) { - completion += chunk.choices[0].delta.content; + if (chunk.choices.length > 0) { + completion += chunk.choices[0].delta.content || ""; + } + if (chunk.usage) { + usage = chunk.usage; + } } return { id: "", @@ -266,12 +275,13 @@ export class GeminiApi implements BaseLlmApi { }, }, ], - usage: undefined, + usage, }; } async *handleStreamResponse(response: any, model: string) { let buffer = ""; + let usage: UsageInfo | undefined = undefined; for await (const chunk of streamResponse(response as any)) { buffer += chunk; if (buffer.startsWith("[")) { @@ -300,6 +310,15 @@ export class GeminiApi implements BaseLlmApi { throw new Error(data.error.message); } + // Check for usage metadata + if (data.usageMetadata) { + usage = { + prompt_tokens: data.usageMetadata.promptTokenCount || 0, + completion_tokens: data.usageMetadata.candidatesTokenCount || 0, + total_tokens: data.usageMetadata.totalTokenCount || 0, + }; + } + // In case of max tokens reached, gemini will sometimes return content with no parts, even though that doesn't match the API spec const contentParts = data?.candidates?.[0]?.content?.parts; if (contentParts) { @@ -338,6 +357,14 @@ export class GeminiApi implements BaseLlmApi { buffer = ""; } } + + // Emit usage at the end if we have it + if (usage) { + yield usageChatChunk({ + model, + usage, + }); + } } async *chatCompletionStream( diff --git a/packages/openai-adapters/src/apis/Relace.ts b/packages/openai-adapters/src/apis/Relace.ts index e983a9968..618917d22 100644 --- a/packages/openai-adapters/src/apis/Relace.ts +++ b/packages/openai-adapters/src/apis/Relace.ts @@ -16,7 +16,12 @@ import { import { Model } from "openai/resources/models.mjs"; import { z } from "zod"; import { OpenAIConfigSchema } from "../types.js"; -import { chatChunk, chatCompletion, customFetch } from "../util.js"; +import { + chatChunk, + chatCompletion, + customFetch, + usageChatChunk, +} from "../util.js"; import { BaseLlmApi, CreateRerankResponse, @@ -24,6 +29,8 @@ import { RerankCreateParams, } from "./base.js"; +type UsageInfo = { total_tokens: number; completion_tokens: number; prompt_tokens: number }; + // Relace only supports apply through a /v1/apply endpoint export class RelaceApi implements BaseLlmApi { private apiBase = "https://instantapply.endpoint.relace.run/v1/"; @@ -41,6 +48,7 @@ export class RelaceApi implements BaseLlmApi { signal: AbortSignal, ): Promise { let content = ""; + let usage: UsageInfo | undefined = undefined; // Convert the non-streaming params to streaming params const streamingBody: ChatCompletionCreateParamsStreaming = { @@ -52,12 +60,18 @@ export class RelaceApi implements BaseLlmApi { streamingBody, signal, )) { - content += chunk.choices[0]?.delta?.content || ""; + if (chunk.choices.length > 0) { + content += chunk.choices[0]?.delta?.content || ""; + } + if (chunk.usage) { + usage = chunk.usage; + } } return chatCompletion({ content, model: body.model, + usage, }); } @@ -115,6 +129,15 @@ export class RelaceApi implements BaseLlmApi { content: mergedCode, model: body.model, }); + + yield usageChatChunk({ + model: body.model, + usage: { + prompt_tokens: result.usage.prompt_tokens || 0, + completion_tokens: result.usage.completion_tokens || 0, + total_tokens: result.usage.total_tokens, + }, + }); } completionNonStream( diff --git a/packages/openai-adapters/src/test/main.test.ts b/packages/openai-adapters/src/test/main.test.ts index 4e477c53d..0652c36b4 100644 --- a/packages/openai-adapters/src/test/main.test.ts +++ b/packages/openai-adapters/src/test/main.test.ts @@ -51,6 +51,20 @@ const TESTS: Omit[] = [ model: "gpt-4o", apiKey: process.env.OPENAI_API_KEY!, roles: ["chat"], + options: { + skipTools: false, + expectUsage: true, + }, + }, + { + provider: "openai", + model: "gpt-4o-mini", + apiKey: process.env.OPENAI_API_KEY!, + roles: ["chat"], + options: { + skipTools: false, + expectUsage: true, + }, }, { provider: "anthropic", @@ -67,14 +81,31 @@ const TESTS: Omit[] = [ model: "gemini-1.5-flash-latest", apiKey: process.env.GEMINI_API_KEY!, roles: ["chat"], + options: { + skipTools: false, + expectUsage: true, + }, + }, + { + provider: "gemini", + model: "gemini-2.5-flash", + apiKey: process.env.GEMINI_API_KEY!, + roles: ["chat"], + options: { + skipTools: false, + expectUsage: true, + }, + }, + { + provider: "mistral", + model: "codestral", + apiKey: process.env.MISTRAL_API_KEY!, + roles: ["chat"], + options: { + skipTools: false, + expectUsage: true, + }, }, - // { - // provider: "mistral", - // model: "codestral-latest", - // apiKey: process.env.MISTRAL_API_KEY!, - // apiBase: "https://api.mistral.ai/v1", - // roles: ["autocomplete"], - // }, // { // provider: "deepseek", // model: "deepseek-coder", @@ -111,6 +142,26 @@ const TESTS: Omit[] = [ apiKey: process.env.VOYAGE_API_KEY!, roles: ["rerank"], }, + { + provider: "relace", + model: "instant-apply", + apiKey: process.env.RELACE_API_KEY!, + roles: ["chat"], + options: { + skipTools: true, + expectUsage: true, + }, + }, + { + provider: "inception", + model: "mercury-coder", + apiKey: process.env.INCEPTION_API_KEY!, + roles: ["chat"], + options: { + skipTools: false, + expectUsage: true, + }, + }, // { // provider: "cohere", // model: "rerank-v3.5", From 7e484ed31d4749cd9495d27910e8d77f00bfad13 Mon Sep 17 00:00:00 2001 From: Ting-Wai To <40179554+tingwai@users.noreply.github.com> Date: Thu, 28 Aug 2025 13:15:01 -0700 Subject: [PATCH 05/76] fix --- packages/openai-adapters/src/apis/Gemini.ts | 6 +++++- packages/openai-adapters/src/apis/Relace.ts | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/openai-adapters/src/apis/Gemini.ts b/packages/openai-adapters/src/apis/Gemini.ts index 51d96f720..2f2446414 100644 --- a/packages/openai-adapters/src/apis/Gemini.ts +++ b/packages/openai-adapters/src/apis/Gemini.ts @@ -38,7 +38,11 @@ import { RerankCreateParams, } from "./base.js"; -type UsageInfo = { total_tokens: number; completion_tokens: number; prompt_tokens: number }; +type UsageInfo = { + total_tokens: number; + completion_tokens: number; + prompt_tokens: number; +}; export class GeminiApi implements BaseLlmApi { apiBase: string = "https://generativelanguage.googleapis.com/v1beta/"; diff --git a/packages/openai-adapters/src/apis/Relace.ts b/packages/openai-adapters/src/apis/Relace.ts index 618917d22..c2799d376 100644 --- a/packages/openai-adapters/src/apis/Relace.ts +++ b/packages/openai-adapters/src/apis/Relace.ts @@ -29,7 +29,11 @@ import { RerankCreateParams, } from "./base.js"; -type UsageInfo = { total_tokens: number; completion_tokens: number; prompt_tokens: number }; +type UsageInfo = { + total_tokens: number; + completion_tokens: number; + prompt_tokens: number; +}; // Relace only supports apply through a /v1/apply endpoint export class RelaceApi implements BaseLlmApi { From 472c00f27cfdcd01aac12808424ba37b5590898f Mon Sep 17 00:00:00 2001 From: Fred Bricon Date: Fri, 29 Aug 2025 11:06:21 +0200 Subject: [PATCH 06/76] fix: prevent AUTODETECT model from being queried on Ollama Signed-off-by: Fred Bricon --- core/llm/llms/Ollama.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/llm/llms/Ollama.ts b/core/llm/llms/Ollama.ts index d08bf7bc6..1d069ff71 100644 --- a/core/llm/llms/Ollama.ts +++ b/core/llm/llms/Ollama.ts @@ -150,7 +150,7 @@ class Ollama extends BaseLLM implements ModelInstaller { constructor(options: LLMOptions) { super(options); - if (options.isFromAutoDetect) { + if (options.model === "AUTODETECT") { return; } const headers: Record = { From e15595d7eac4aefff0a197d3452bec8541792ba8 Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Fri, 29 Aug 2025 19:19:54 +0530 Subject: [PATCH 07/76] fix: update claude models in getting started --- gui/src/pages/AddNewModel/configs/models.ts | 35 ++++++------------- .../pages/AddNewModel/configs/providers.ts | 7 +--- 2 files changed, 11 insertions(+), 31 deletions(-) diff --git a/gui/src/pages/AddNewModel/configs/models.ts b/gui/src/pages/AddNewModel/configs/models.ts index be50ef6f5..9ae8e4142 100644 --- a/gui/src/pages/AddNewModel/configs/models.ts +++ b/gui/src/pages/AddNewModel/configs/models.ts @@ -1184,42 +1184,27 @@ export const models: { [key: string]: ModelPackage } = { icon: "openai.png", isOpenSource: false, }, - claude35Sonnet: { - title: "Claude 3.5 Sonnet", + claude4Sonnet: { + title: "Claude 4 Sonnet", description: - "Anthropic's most intelligent model, but much less expensive than Claude 3 Opus", + "The most intelligent model in the Claude 4 series. Costing lesser than Claude 4 Opus.", params: { - model: "claude-3-5-sonnet-latest", + model: "claude-4-sonnet-latest", contextLength: 200_000, - title: "Claude 3.5 Sonnet", + title: "Claude 4 Sonnet", apiKey: "", }, providerOptions: ["anthropic", "askSage"], icon: "anthropic.png", isOpenSource: false, }, - claude3Opus: { - title: "Claude 3 Opus", - description: - "The most capable model in the Claude 3 series, beating GPT-4 on many benchmarks", + claude41Opus: { + title: "Claude 4.1 Opus", + description: "The most capable model in the Claude 4 series", params: { - model: "claude-3-opus-20240229", + model: "claude-opus-4-1-20250805", contextLength: 200_000, - title: "Claude 3 Opus", - apiKey: "", - }, - providerOptions: ["anthropic", "askSage"], - icon: "anthropic.png", - isOpenSource: false, - }, - claude3Sonnet: { - title: "Claude 3 Sonnet", - description: - "The second most capable model in the Claude 3 series: ideal balance of intelligence and speed", - params: { - model: "claude-3-sonnet-20240229", - contextLength: 200_000, - title: "Claude 3 Sonnet", + title: "Claude 4.1 Opus", apiKey: "", }, providerOptions: ["anthropic", "askSage"], diff --git a/gui/src/pages/AddNewModel/configs/providers.ts b/gui/src/pages/AddNewModel/configs/providers.ts index 071f96be9..a2d7b3356 100644 --- a/gui/src/pages/AddNewModel/configs/providers.ts +++ b/gui/src/pages/AddNewModel/configs/providers.ts @@ -107,12 +107,7 @@ export const providers: Partial> = { defaultValue: 100000, }, ], - packages: [ - models.claude35Sonnet, - models.claude3Opus, - models.claude3Sonnet, - models.claude35Haiku, - ], + packages: [models.claude4Sonnet, models.claude41Opus, models.claude35Haiku], apiKeyUrl: "https://console.anthropic.com/account/keys", }, moonshot: { From e24e2b8acf798769bc3773b5995737d9e0681d13 Mon Sep 17 00:00:00 2001 From: Nate Date: Sun, 31 Aug 2025 16:40:13 -0700 Subject: [PATCH 08/76] cai: workflow to auto-fix tests (disabled for now) --- .github/workflows/auto-fix-failed-tests.yml | 170 ++++++++++++++ .../workflows/respond-to-cubic-dev-ai.yml | 215 ------------------ 2 files changed, 170 insertions(+), 215 deletions(-) create mode 100644 .github/workflows/auto-fix-failed-tests.yml delete mode 100644 extensions/cli/.github/workflows/respond-to-cubic-dev-ai.yml diff --git a/.github/workflows/auto-fix-failed-tests.yml b/.github/workflows/auto-fix-failed-tests.yml new file mode 100644 index 000000000..54da990b7 --- /dev/null +++ b/.github/workflows/auto-fix-failed-tests.yml @@ -0,0 +1,170 @@ +name: Auto Fix Failed Tests + +on: + workflow_run: + workflows: ["PR Checks", "CLI PR Checks"] + types: + - completed + +permissions: + contents: write + pull-requests: write + issues: write + actions: read + +jobs: + fix-failed-tests: + # Only run if the workflow failed + # DISABLED: Remove 'false && ' on the next line to enable auto-fixing + if: false && github.event.workflow_run.conclusion == 'failure' + runs-on: ubuntu-latest + + steps: + - name: Get workflow run details + id: workflow-details + uses: actions/github-script@v7 + with: + script: | + const workflowRun = context.payload.workflow_run; + const { data: jobs } = await github.rest.actions.listJobsForWorkflowRun({ + owner: context.repo.owner, + repo: context.repo.repo, + run_id: workflowRun.id + }); + + // Find all failed jobs since we're only monitoring specific test workflows + const failedJobs = jobs.jobs.filter(job => job.conclusion === 'failure'); + + if (failedJobs.length === 0) { + core.info('No failed jobs found'); + return null; + } + + core.setOutput('has_failed_tests', 'true'); + core.setOutput('workflow_name', workflowRun.name); + core.setOutput('workflow_run_id', workflowRun.id); + core.setOutput('head_branch', workflowRun.head_branch); + core.setOutput('head_sha', workflowRun.head_sha); + core.setOutput('failed_jobs', JSON.stringify(failedJobs.map(j => j.name))); + + return failedJobs; + + - name: Get job logs for failed tests + if: steps.workflow-details.outputs.has_failed_tests == 'true' + id: get-logs + uses: actions/github-script@v7 + with: + script: | + const workflowRunId = ${{ github.event.workflow_run.id }}; + const { data: jobs } = await github.rest.actions.listJobsForWorkflowRun({ + owner: context.repo.owner, + repo: context.repo.repo, + run_id: workflowRunId + }); + + let errorLogs = ''; + + for (const job of jobs.jobs) { + if (job.conclusion === 'failure') { + try { + const { data: logData } = await github.rest.actions.downloadJobLogsForWorkflowRun({ + owner: context.repo.owner, + repo: context.repo.repo, + job_id: job.id + }); + + errorLogs += `\n\n=== Job: ${job.name} ===\n`; + errorLogs += logData; + } catch (error) { + core.warning(`Could not fetch logs for job ${job.name}: ${error.message}`); + } + } + } + + // Store logs in environment file for next step + const fs = require('fs'); + fs.writeFileSync('/tmp/test_failure_logs.txt', errorLogs); + + core.setOutput('has_logs', errorLogs.length > 0 ? 'true' : 'false'); + + - name: Checkout repository + if: steps.workflow-details.outputs.has_failed_tests == 'true' + uses: actions/checkout@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + fetch-depth: 0 + ref: ${{ steps.workflow-details.outputs.head_sha }} + + - name: Setup Node.js + if: steps.workflow-details.outputs.has_failed_tests == 'true' + uses: actions/setup-node@v4 + with: + node-version: "20" + + - name: Install Continue CLI globally + if: steps.workflow-details.outputs.has_failed_tests == 'true' + run: npm i -g @continuedev/cli + + - name: Start remote session to fix failed tests + if: steps.workflow-details.outputs.has_failed_tests == 'true' + id: remote-session + env: + CONTINUE_API_KEY: ${{ secrets.CONTINUE_API_KEY }} + run: | + # Create a detailed prompt for fixing the failed tests + cat > /tmp/fix_tests_prompt.txt << 'PROMPT_EOF' + 🔧 **Auto Test Fix Request** + + The following tests failed in workflow "${{ steps.workflow-details.outputs.workflow_name }}" (Run ID: ${{ steps.workflow-details.outputs.workflow_run_id }}): + + **Failed Jobs:** ${{ steps.workflow-details.outputs.failed_jobs }} + **Branch:** ${{ steps.workflow-details.outputs.head_branch }} + **Commit:** ${{ steps.workflow-details.outputs.head_sha }} + + **Your Task:** + 1. Analyze the test failure logs and error messages + 2. Identify the root cause of the test failures + 3. Fix the failing tests by updating the test code or the underlying implementation + 4. Ensure all tests pass after your changes + 5. Commit your fixes with a descriptive message + + **Test Failure Context:** + Please examine the repository structure, run the failing tests locally to understand the errors, and implement appropriate fixes. + + Focus on: + - Understanding what the tests are trying to validate + - Identifying why they're failing (code changes, environment issues, test logic errors) + - Making minimal, targeted fixes that address the root cause + - Ensuring the fixes don't break other functionality + + Please start by examining the failing tests and their error messages, then proceed with the necessary fixes. + PROMPT_EOF + + echo "Starting Continue CLI remote session for test fixes..." + echo "Prompt content:" + cat /tmp/fix_tests_prompt.txt + + # Start remote session and capture JSON output + SESSION_OUTPUT=$(cat /tmp/fix_tests_prompt.txt | cn remote -s --branch ${{ steps.workflow-details.outputs.head_branch }}) + echo "Raw session output: $SESSION_OUTPUT" + + # Extract URL from JSON output + SESSION_URL=$(echo "$SESSION_OUTPUT" | jq -r '.url // empty') + + if [ -z "$SESSION_URL" ] || [ "$SESSION_URL" = "null" ]; then + echo "Failed to extract session URL from output: $SESSION_OUTPUT" + exit 1 + fi + + echo "session_url=$SESSION_URL" >> $GITHUB_OUTPUT + echo "✅ Started remote session: $SESSION_URL" + + - name: Log session details + if: steps.workflow-details.outputs.has_failed_tests == 'true' + run: | + echo "✅ Successfully started auto-fix session for failed tests" + echo "Workflow: ${{ steps.workflow-details.outputs.workflow_name }}" + echo "Run ID: ${{ steps.workflow-details.outputs.workflow_run_id }}" + echo "Branch: ${{ steps.workflow-details.outputs.head_branch }}" + echo "Session URL: ${{ steps.remote-session.outputs.session_url }}" + echo "Failed jobs: ${{ steps.workflow-details.outputs.failed_jobs }}" diff --git a/extensions/cli/.github/workflows/respond-to-cubic-dev-ai.yml b/extensions/cli/.github/workflows/respond-to-cubic-dev-ai.yml deleted file mode 100644 index 5d3f40c56..000000000 --- a/extensions/cli/.github/workflows/respond-to-cubic-dev-ai.yml +++ /dev/null @@ -1,215 +0,0 @@ -name: Respond to @continuedev Comments - -on: - issue_comment: - types: [created] - pull_request_review_comment: - types: [created] - -permissions: - contents: write - pull-requests: write - issues: write - -jobs: - respond-to-comment: - # Only run on pull request comments - if: github.event_name == 'issue_comment' && github.event.issue.pull_request - runs-on: ubuntu-latest - - steps: - - name: Check if comment contains @continuedev - id: check-mention - run: | - if echo "${{ github.event.comment.body }}" | grep -q "@continuedev"; then - echo "contains_mention=true" >> $GITHUB_OUTPUT - else - echo "contains_mention=false" >> $GITHUB_OUTPUT - fi - - - name: Checkout PR branch - if: steps.check-mention.outputs.contains_mention == 'true' - uses: actions/checkout@v4 - with: - token: ${{ secrets.GITHUB_TOKEN }} - fetch-depth: 0 - - - name: Get PR information - if: steps.check-mention.outputs.contains_mention == 'true' - id: pr-info - uses: actions/github-script@v7 - with: - script: | - const { data: pr } = await github.rest.pulls.get({ - owner: context.repo.owner, - repo: context.repo.repo, - pull_number: context.issue.number - }); - - core.setOutput('head_ref', pr.head.ref); - core.setOutput('head_sha', pr.head.sha); - return pr; - - - name: Checkout PR branch - if: steps.check-mention.outputs.contains_mention == 'true' - run: | - git checkout ${{ steps.pr-info.outputs.head_ref }} - - - name: Setup Node.js - if: steps.check-mention.outputs.contains_mention == 'true' - uses: actions/setup-node@v4 - with: - node-version: "20" - - - name: Install Continue CLI globally - if: steps.check-mention.outputs.contains_mention == 'true' - run: npm i -g @continuedev/cli - - - name: Start remote session - if: steps.check-mention.outputs.contains_mention == 'true' - id: remote-session - env: - CONTINUE_API_KEY: ${{ secrets.CONTINUE_API_KEY }} - run: | - # Create the prompt for remote session - PROMPT="Please help with the following request from @${{ github.event.comment.user.login }} on PR #${{ github.event.issue.number }}: - - ${{ github.event.comment.body }} - - Please analyze the current PR, understand the request, implement the necessary changes, and commit them to this branch." - - # Start remote session and capture JSON output - SESSION_OUTPUT=$(echo "$PROMPT" | cn remote -s --branch ${{ steps.pr-info.outputs.head_ref }}) - echo "Raw session output: $SESSION_OUTPUT" - - # Extract URL from JSON output - SESSION_URL=$(echo "$SESSION_OUTPUT" | jq -r '.url // empty') - - if [ -z "$SESSION_URL" ] || [ "$SESSION_URL" = "null" ]; then - echo "Failed to extract session URL from output: $SESSION_OUTPUT" - exit 1 - fi - - echo "session_url=$SESSION_URL" >> $GITHUB_OUTPUT - echo "✅ Started remote session: $SESSION_URL" - - - name: Comment with session URL - if: steps.check-mention.outputs.contains_mention == 'true' && steps.remote-session.outputs.session_url - uses: actions/github-script@v7 - with: - script: | - const commentBody = `I've started [a remote session](${{ steps.remote-session.outputs.session_url }}) to help with your request: - > ${{ github.event.comment.body }}`; - - await github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - body: commentBody - }); - - - name: Log session details - if: steps.check-mention.outputs.contains_mention == 'true' - run: | - echo "✅ Successfully started remote session for comment from ${{ github.event.comment.user.login }} on PR #${{ github.event.issue.number }}" - echo "Session URL: ${{ steps.remote-session.outputs.session_url }}" - echo "Original comment: ${{ github.event.comment.body }}" - - respond-to-review-comment: - # Only run on pull request review comments - if: github.event_name == 'pull_request_review_comment' - runs-on: ubuntu-latest - - steps: - - name: Check if comment contains @continuedev - id: check-mention - run: | - if echo "${{ github.event.comment.body }}" | grep -q "@continuedev"; then - echo "contains_mention=true" >> $GITHUB_OUTPUT - else - echo "contains_mention=false" >> $GITHUB_OUTPUT - fi - - - name: Checkout PR branch - if: steps.check-mention.outputs.contains_mention == 'true' - uses: actions/checkout@v4 - with: - token: ${{ secrets.GITHUB_TOKEN }} - fetch-depth: 0 - ref: ${{ github.event.pull_request.head.ref }} - - - name: Setup Node.js - if: steps.check-mention.outputs.contains_mention == 'true' - uses: actions/setup-node@v4 - with: - node-version: "20" - - - name: Install Continue CLI globally - if: steps.check-mention.outputs.contains_mention == 'true' - run: npm i -g @continuedev/cli - - - name: Start remote session - if: steps.check-mention.outputs.contains_mention == 'true' - id: remote-session - env: - CONTINUE_API_KEY: ${{ secrets.CONTINUE_API_KEY }} - run: | - # Create a temporary file for the prompt to handle special characters and newlines properly - cat > /tmp/prompt.txt << 'PROMPT_EOF' - Please help with the following code review comment from @${{ github.event.comment.user.login }} on PR #${{ github.event.pull_request.number }}: - - **File:** ${{ github.event.comment.path }} - **Line:** ${{ github.event.comment.line || github.event.comment.original_line || 'N/A' }} - **Comment:** ${{ github.event.comment.body }} - - Please analyze the specific file and line mentioned, understand the review feedback, implement the necessary changes, and commit them to this branch. - PROMPT_EOF - - # Debug output - echo "PROMPT content:" - cat /tmp/prompt.txt - - # Start remote session and capture JSON output - echo "Starting cn with prompt..." - SESSION_OUTPUT=$(cat /tmp/prompt.txt | cn remote -s --branch ${{ github.event.pull_request.head.ref }}) - echo "Raw session output: $SESSION_OUTPUT" - - # Extract URL from JSON output - SESSION_URL=$(echo "$SESSION_OUTPUT" | jq -r '.url // empty') - - if [ -z "$SESSION_URL" ] || [ "$SESSION_URL" = "null" ]; then - echo "Failed to extract session URL from output: $SESSION_OUTPUT" - exit 1 - fi - - echo "session_url=$SESSION_URL" >> $GITHUB_OUTPUT - echo "✅ Started remote session: $SESSION_URL" - - - name: Comment with session URL - if: steps.check-mention.outputs.contains_mention == 'true' && steps.remote-session.outputs.session_url - uses: actions/github-script@v7 - with: - script: | - const commentBody = `I've started [a remote session](${{ steps.remote-session.outputs.session_url }}) to help with your request: - > ${{ github.event.comment.body }}`; - - const commentParams = { - owner: context.repo.owner, - repo: context.repo.repo, - pull_number: ${{ github.event.pull_request.number }}, - body: commentBody, - commit_id: '${{ github.event.pull_request.head.sha }}', - path: '${{ github.event.comment.path }}', - in_reply_to: ${{ github.event.comment.id }} - }; - - await github.rest.pulls.createReviewComment(commentParams); - - - name: Log session details - if: steps.check-mention.outputs.contains_mention == 'true' - run: | - echo "✅ Successfully started remote session for review comment from ${{ github.event.comment.user.login }} on PR #${{ github.event.pull_request.number }}" - echo "Session URL: ${{ steps.remote-session.outputs.session_url }}" - echo "File: ${{ github.event.comment.path }}" - echo "Line: ${{ github.event.comment.line }}" - echo "Original comment: ${{ github.event.comment.body }}" From 8c8efd7ed1f2382469495f92f9dd2f71fb8be290 Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Tue, 2 Sep 2025 23:24:11 +0530 Subject: [PATCH 09/76] feat(cli): skip telemetry if there is no internet connection --- .../cli/src/telemetry/posthogService.ts | 35 +++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/extensions/cli/src/telemetry/posthogService.ts b/extensions/cli/src/telemetry/posthogService.ts index 22c2beb0f..0dd5691b5 100644 --- a/extensions/cli/src/telemetry/posthogService.ts +++ b/extensions/cli/src/telemetry/posthogService.ts @@ -1,3 +1,4 @@ +import dns from "dns/promises"; import os from "node:os"; import node_machine_id from "node-machine-id"; @@ -15,13 +16,36 @@ export class PosthogService { this.uniqueId = this.getEventUserId(); } + private _hasInternetConnection: boolean | undefined = undefined; + private async hasInternetConnection() { + const refetchConnection = async () => { + try { + await dns.lookup("app.posthog.com"); + this._hasInternetConnection = true; + } catch { + this._hasInternetConnection = false; + } + }; + + if (typeof this._hasInternetConnection !== "undefined") { + void refetchConnection(); // check in background if connection became available + return this._hasInternetConnection; + } + + await refetchConnection(); + return this._hasInternetConnection; + } + get isEnabled() { return process.env.CONTINUE_CLI_ENABLE_TELEMETRY !== "0"; } private _client: PostHogType | undefined; private async getClient() { - if (this.isEnabled) { + if (!(await this.hasInternetConnection())) { + this._client = undefined; + logger.warn("No internet connection, skipping telemetry"); + } else if (this.isEnabled) { if (!this._client) { const { PostHog } = await import("posthog-node"); this._client = new PostHog( @@ -30,6 +54,7 @@ export class PosthogService { host: "https://app.posthog.com", }, ); + logger.debug("Initialized telemetry"); } } else { this._client = undefined; @@ -83,7 +108,13 @@ export class PosthogService { try { const client = await this.getClient(); if (client) { - await client.shutdown(); + // Set a timeout for shutdown to prevent hanging + const shutdownPromise = client.shutdown(); + const timeoutPromise = new Promise((_, reject) => + setTimeout(() => reject(new Error("Shutdown timeout")), 5000), + ); + + await Promise.race([shutdownPromise, timeoutPromise]); } } catch (e) { logger.debug(`Failed to shutdown PostHog client: ${e}`); From c7ffe89be36056c85069d60bfdecc1833a540434 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Tue, 2 Sep 2025 19:17:49 -0700 Subject: [PATCH 10/76] feat: bash mode --- extensions/cli/package-lock.json | 6 - extensions/cli/spec/bash-mode.md | 64 +++++++++++ extensions/cli/src/slashCommands.ts | 3 + .../cli/src/tools/runTerminalCommand.ts | 9 +- extensions/cli/src/ui/UserInput.tsx | 48 +++++++- .../cli/src/ui/hooks/useChat.bashMode.test.ts | 108 ++++++++++++++++++ extensions/cli/src/ui/hooks/useChat.ts | 53 +++++++++ extensions/cli/src/ui/hooks/useUserInput.ts | 3 + 8 files changed, 281 insertions(+), 13 deletions(-) create mode 100644 extensions/cli/spec/bash-mode.md create mode 100644 extensions/cli/src/ui/hooks/useChat.bashMode.test.ts diff --git a/extensions/cli/package-lock.json b/extensions/cli/package-lock.json index d52b3f219..6510bc717 100644 --- a/extensions/cli/package-lock.json +++ b/extensions/cli/package-lock.json @@ -9,12 +9,6 @@ "version": "0.0.0-dev", "license": "Apache-2.0", "dependencies": { - "@img/sharp-darwin-arm64": "^0.33.5", - "@img/sharp-darwin-x64": "^0.33.5", - "@img/sharp-linux-arm": "^0.33.5", - "@img/sharp-linux-arm64": "^0.33.5", - "@img/sharp-linux-x64": "^0.33.5", - "@img/sharp-win32-x64": "^0.33.5", "@sentry/profiling-node": "^9.43.0" }, "bin": { diff --git a/extensions/cli/spec/bash-mode.md b/extensions/cli/spec/bash-mode.md new file mode 100644 index 000000000..cbf99c9fe --- /dev/null +++ b/extensions/cli/spec/bash-mode.md @@ -0,0 +1,64 @@ +Bash Mode (CLI TUI) + +Overview +- Bash mode lets users run shell commands directly from the chat input by starting their input with an exclamation mark (!). +- It is intended for quick terminal command execution without leaving the TUI. + +Activation +- Bash mode is activated when the current input (trimmed) starts with ! + - Example: "!git status" or " !ls -la" both activate Bash mode. +- Visual indicator: + - Input border color changes to yellow. + - The input prompt indicator changes to a yellow "$". + - The input placeholder includes "! for bash mode". + +Deactivation / Exiting Bash Mode +- Pressing Enter to submit the input exits bash mode immediately after submission, regardless of the command result. +- Pressing Esc when the input (trimmed) is exactly ! clears the input and exits bash mode. +- Editing the input so it no longer starts with ! also exits bash mode and restores normal input behavior. + +Interaction with other input helpers +- When in bash mode (input starts with !): + - "@" file search suggestions are disabled. + - "/" slash command UI is disabled. +- When in slash command mode (input starts with /): + - "@" file search suggestions are disabled. + +Submission behavior +- On submit (Enter) with a bash-mode input: + - The leading ! is removed and the remainder is treated as the shell command to run. + - The TUI immediately appends an assistant message representing a Bash tool call, with status set to calling, so users can see that the command is in progress. + - The bash command is executed asynchronously; when it completes, the tool call status is updated to done (or error) and the output is populated. + +Execution semantics +- The command is executed from the current working directory of the CLI process. +- The command runs in the user’s shell as a login shell: + - Unix/macOS: SHELL (or /bin/bash) invoked with -l -c "". + - Windows: powershell.exe -NoLogo -ExecutionPolicy Bypass -Command "". +- The child process stdin is detached (not connected to the TTY). This prevents the TUI from being suspended by job control. Consequences: + - Interactive commands that require stdin will not work. +- Environment variables are inherited from the parent process. Aliases/functions availability depends on the user’s shell configuration and is not guaranteed. + +Output handling +- Stdout is streamed into memory; Stderr is captured and appended as a trailing "Stderr: ..." section on success. +- If the process exits non-zero and Stderr contains content, the tool call is marked as error and the error text is shown. +- Output is truncated to the first 5000 lines if exceeded. +- Timeout behavior: If no output is received for 30 seconds (configurable in tests), the process is terminated and the result includes a note like: + "[Command timed out after 30 seconds of no output]". + +Keyboard behaviors (summary) +- Enter: submit input. If in bash mode, exits bash mode after submission and shows the pending Bash tool call immediately. +- Shift+Enter: new line. +- Backslash (\) at end-of-line: inserts a new line (line continuation) as usual. +- Esc: if only ! (trimmed) is present, clears input and exits bash mode; otherwise cancels streaming or closes suggestions depending on context. + +Scope / Modes +- Bash mode applies to interactive (TUI/standard) CLI usage. It is not part of headless (-p/--print) processing. + +Error handling +- Command execution errors are captured and surfaced in the tool call as status error with human-readable error text (including Stderr when available). + +Examples +- "!git status" → shows a Bash tool call immediately, then populates with the git status output. +- "!echo hello" → shows a Bash tool call immediately, then output "hello". +- "!some-unknown-cmd" → shows a Bash tool call immediately, then sets status to error with an error message. diff --git a/extensions/cli/src/slashCommands.ts b/extensions/cli/src/slashCommands.ts index b5dc3d9aa..1c34c58fa 100644 --- a/extensions/cli/src/slashCommands.ts +++ b/extensions/cli/src/slashCommands.ts @@ -28,6 +28,7 @@ async function handleHelp(_args: string[], _assistant: AssistantConfig) { ` ${chalk.cyan("Enter")} Submit message`, ` ${chalk.cyan("Shift+Enter")} New line`, ` ${chalk.cyan("\\")} Line continuation (at end of line)`, + ` ${chalk.cyan("!")} Bash mode - run shell commands`, "", chalk.white("Controls:"), ` ${chalk.cyan("Ctrl+C")} Clear input`, @@ -39,9 +40,11 @@ async function handleHelp(_args: string[], _assistant: AssistantConfig) { chalk.white("Special Characters:"), ` ${chalk.cyan("@")} Search and attach files for context`, ` ${chalk.cyan("/")} Access slash commands`, + ` ${chalk.cyan("!")} Execute bash commands directly`, "", chalk.white("Available Commands:"), ` Type ${chalk.cyan("/")} to see available slash commands`, + ` Type ${chalk.cyan("!")} followed by a command to execute bash directly`, ].join("\n"); posthogService.capture("useSlashCommand", { name: "help" }); return { output: helpMessage }; diff --git a/extensions/cli/src/tools/runTerminalCommand.ts b/extensions/cli/src/tools/runTerminalCommand.ts index 9aefceb9b..242ecdeea 100644 --- a/extensions/cli/src/tools/runTerminalCommand.ts +++ b/extensions/cli/src/tools/runTerminalCommand.ts @@ -17,7 +17,7 @@ function getShellCommand(command: string): { shell: string; args: string[] } { args: ["-NoLogo", "-ExecutionPolicy", "Bypass", "-Command", command], }; } else { - // Unix/macOS: Use login shell to source .bashrc/.zshrc etc. + // Unix/macOS: Just run the user's shell as a login shell const userShell = process.env.SHELL || "/bin/bash"; return { shell: userShell, args: ["-l", "-c", command] }; } @@ -60,7 +60,12 @@ The command will be executed from the current working directory: ${process.cwd() return new Promise((resolve, reject) => { // Use same shell logic as core implementation const { shell, args } = getShellCommand(command); - const child = spawn(shell, args); + const child = spawn(shell, args, { + cwd: process.cwd(), + env: process.env, + stdio: ["ignore", "pipe", "pipe"], // prevent child from reading TTY input + detached: false, + }); let stdout = ""; let stderr = ""; let timeoutId: NodeJS.Timeout; diff --git a/extensions/cli/src/ui/UserInput.tsx b/extensions/cli/src/ui/UserInput.tsx index be24ccb52..e022e3cc3 100644 --- a/extensions/cli/src/ui/UserInput.tsx +++ b/extensions/cli/src/ui/UserInput.tsx @@ -69,6 +69,7 @@ const UserInput: React.FC = ({ const [showSlashCommands, setShowSlashCommands] = useState(false); const [slashCommandFilter, setSlashCommandFilter] = useState(""); const [selectedCommandIndex, setSelectedCommandIndex] = useState(0); + const [showBashMode, setShowBashMode] = useState(false); const [showFileSearch, setShowFileSearch] = useState(false); const [fileSearchFilter, setFileSearchFilter] = useState(""); const [selectedFileIndex, setSelectedFileIndex] = useState(0); @@ -118,6 +119,18 @@ const UserInput: React.FC = ({ return nextMode; }; + // Update bash mode state based on input + const updateBashModeState = (text: string) => { + const trimmed = text.trimStart(); + const isBash = trimmed.startsWith("!"); + setShowBashMode(isBash); + if (isBash) { + // Disable other helpers while in bash mode + setShowSlashCommands(false); + setShowFileSearch(false); + } + }; + // Update slash command UI state based on input const updateSlashCommandState = (text: string, cursor: number) => { // Only show slash commands if slash is the very first character @@ -126,6 +139,9 @@ const UserInput: React.FC = ({ return; } + // When using slash commands, disable file search + setShowFileSearch(false); + const trimmedText = text.trimStart(); const beforeCursor = trimmedText.slice( 0, @@ -188,6 +204,13 @@ const UserInput: React.FC = ({ return; } + // Disable file search if we're in bash mode or slash command mode + const trimmed = text.trimStart(); + if (trimmed.startsWith("!") || trimmed.startsWith("/")) { + setShowFileSearch(false); + return; + } + // Check if we're in a file search context const beforeCursor = text.slice(0, cursor); const lastAtIndex = beforeCursor.lastIndexOf("@"); @@ -226,6 +249,7 @@ const UserInput: React.FC = ({ setFileSearchFilter(afterAt); setSelectedFileIndex(0); setShowSlashCommands(false); + setShowBashMode(false); } } }; @@ -270,6 +294,7 @@ const UserInput: React.FC = ({ setInputText(newText); setCursorPosition(newCursorPos); setShowSlashCommands(false); + setShowBashMode(false); } }; @@ -429,6 +454,7 @@ const UserInput: React.FC = ({ setInputText(""); setCursorPosition(0); setShowSlashCommands(false); + setShowBashMode(false); } return true; } @@ -454,6 +480,15 @@ const UserInput: React.FC = ({ const handleEscapeKey = (key: any): boolean => { if (!key.escape) return false; + // If only "!" is present, clear bash mode + if (inputMode && showBashMode && inputText.trim() === "!") { + textBuffer.clear(); + setInputText(""); + setCursorPosition(0); + setShowBashMode(false); + return true; + } + // Handle escape key to interrupt streaming if (isWaitingForResponse && onInterrupt) { onInterrupt(); @@ -482,6 +517,7 @@ const UserInput: React.FC = ({ setCursorPosition(0); setShowSlashCommands(false); setShowFileSearch(false); + setShowBashMode(false); inputHistory.resetNavigation(); }; @@ -493,6 +529,7 @@ const UserInput: React.FC = ({ setCursorPosition(newCursor); updateSlashCommandState(newText, newCursor); updateFileSearchState(newText, newCursor); + updateBashModeState(newText); inputHistory.resetNavigation(); }; @@ -573,14 +610,15 @@ const UserInput: React.FC = ({ setCursorPosition, updateSlashCommandState, updateFileSearchState, + updateBashModeState, inputHistory, }); }); const renderInputText = () => { const placeholderText = isRemoteMode - ? "Ask anything, / for slash commands" - : placeholder || "Ask anything, @ for context, / for slash commands"; + ? "Ask anything, / for slash commands, ! for bash mode" + : placeholder || "Ask anything, @ for context, / for slash commands, ! for bash mode"; if (inputText.length === 0) { return ( <> @@ -677,10 +715,10 @@ const UserInput: React.FC = ({ borderStyle="round" borderTop={true} paddingX={1} - borderColor={isRemoteMode ? "cyan" : "gray"} + borderColor={showBashMode ? "yellow" : isRemoteMode ? "cyan" : "gray"} > - - {isRemoteMode ? "◉" : "●"}{" "} + + {showBashMode ? "$" : isRemoteMode ? "◉" : "●"} {renderInputText()} diff --git a/extensions/cli/src/ui/hooks/useChat.bashMode.test.ts b/extensions/cli/src/ui/hooks/useChat.bashMode.test.ts new file mode 100644 index 000000000..89105cd4e --- /dev/null +++ b/extensions/cli/src/ui/hooks/useChat.bashMode.test.ts @@ -0,0 +1,108 @@ +import { describe, it, expect, vi, beforeEach } from "vitest"; +import { act } from "@testing-library/react"; + +import { createMinimalTestContext } from "../../test-helpers/ui-test-context.js"; + +// Mock the runTerminalCommandTool +vi.mock("../../tools/runTerminalCommand.js", () => ({ + runTerminalCommandTool: { + run: vi.fn(), + }, +})); + +import { useChat } from "./useChat.js"; +import { runTerminalCommandTool } from "../../tools/runTerminalCommand.js"; + +describe("useChat - Bash Mode", () => { + beforeEach(() => { + vi.clearAllMocks(); + }); + + it("should detect bash mode when message starts with !", async () => { + const mockRun = vi.mocked(runTerminalCommandTool.run); + mockRun.mockResolvedValue("total 5\ndrwxr-xr-x 2 user user 4096 Jan 1 12:00 .\ndrwxr-xr-x 3 user user 4096 Jan 1 12:00 .."); + + const ctx = createMinimalTestContext(); + const chat = useChat({ + assistant: { name: "test" } as any, + model: { name: "test-model" } as any, + llmApi: {} as any, + } as any); + + await act(async () => { + await chat.handleUserMessage("!ls -la"); + }); + + expect(mockRun).toHaveBeenCalledWith({ command: "ls -la" }); + + // Since history is managed by service, we just verify no exception and tool called + ctx.cleanup(); + }); + + it("should handle bash command errors", async () => { + const mockRun = vi.mocked(runTerminalCommandTool.run); + mockRun.mockRejectedValue(new Error("Command not found")); + + const chat = useChat({ + assistant: { name: "test" } as any, + model: { name: "test-model" } as any, + llmApi: {} as any, + } as any); + + await act(async () => { + await chat.handleUserMessage("!invalidcommand"); + }); + + expect(mockRun).toHaveBeenCalledWith({ command: "invalidcommand" }); + }); + + it("should not trigger bash mode for regular messages", async () => { + const mockRun = vi.mocked(runTerminalCommandTool.run); + + const chat = useChat({ + assistant: { name: "test" } as any, + model: { name: "test-model" } as any, + llmApi: {} as any, + } as any); + + await act(async () => { + await chat.handleUserMessage("Hello! How are you?"); + }); + + expect(mockRun).not.toHaveBeenCalled(); + }); + + it("should handle empty bash command", async () => { + const mockRun = vi.mocked(runTerminalCommandTool.run); + + const chat = useChat({ + assistant: { name: "test" } as any, + model: { name: "test-model" } as any, + llmApi: {} as any, + } as any); + + await act(async () => { + await chat.handleUserMessage("!"); + }); + + // Should not call the tool for empty command + expect(mockRun).not.toHaveBeenCalled(); + }); + + it("should handle bash command with leading whitespace", async () => { + const mockRun = vi.mocked(runTerminalCommandTool.run); + mockRun.mockResolvedValue("echo test output"); + + const chat = useChat({ + assistant: { name: "test" } as any, + model: { name: "test-model" } as any, + llmApi: {} as any, + } as any); + + await act(async () => { + await chat.handleUserMessage(" !echo hello"); + }); + + expect(mockRun).toHaveBeenCalledWith({ command: "echo hello" }); + }); +}); \ No newline at end of file diff --git a/extensions/cli/src/ui/hooks/useChat.ts b/extensions/cli/src/ui/hooks/useChat.ts index c62854ed4..4c6876629 100644 --- a/extensions/cli/src/ui/hooks/useChat.ts +++ b/extensions/cli/src/ui/hooks/useChat.ts @@ -339,6 +339,52 @@ export function useChat({ return false; }; + const handleBashModeProcessing = async ( + message: string, + ): Promise => { + // Handle bash mode commands (starting with !) + if (!message.trimStart().startsWith("!")) { + return message; + } + + // Extract the command after the ! + const bashCommand = message.trimStart().slice(1).trim(); + + if (!bashCommand) { + return message; // No command provided, treat as regular message + } + + // Show tool call immediately, then run asynchronously and populate result + const toolCallId = `bash-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`; + const toolCall = { + id: toolCallId, + type: "function" as const, + function: { + name: "Bash", + arguments: JSON.stringify({ command: bashCommand }), + }, + }; + + // Add assistant message with tool call immediately + services.chatHistory.addAssistantMessage("", [toolCall as any]); + // Mark as calling for immediate UI feedback + services.chatHistory.updateToolStatus(toolCallId, "calling"); + + // Execute the bash command asynchronously - don't block UI + (async () => { + try { + const { runTerminalCommandTool } = await import("../../tools/runTerminalCommand.js"); + const result = await runTerminalCommandTool.run({ command: bashCommand }); + services.chatHistory.addToolResult(toolCallId, result, "done"); + } catch (error: any) { + const errorMessage = `Bash command failed: ${error?.message || String(error)}`; + services.chatHistory.addToolResult(toolCallId, errorMessage, "error"); + } + })(); + + return null; // Processed, no further message handling needed + }; + const handleSlashCommandProcessing = async ( message: string, ): Promise => { @@ -423,6 +469,13 @@ export function useChat({ if (handled) return; + // Handle bash mode commands (before slash commands) + const bashProcessedMessage = await handleBashModeProcessing(message); + if (bashProcessedMessage === null) { + return; // Bash command was handled and no further processing needed + } + message = bashProcessedMessage; + // Handle slash commands const processedMessage = await handleSlashCommandProcessing(message); if (processedMessage === null) { diff --git a/extensions/cli/src/ui/hooks/useUserInput.ts b/extensions/cli/src/ui/hooks/useUserInput.ts index aa99c421e..983a17d09 100644 --- a/extensions/cli/src/ui/hooks/useUserInput.ts +++ b/extensions/cli/src/ui/hooks/useUserInput.ts @@ -189,6 +189,7 @@ interface TextBufferStateOptions { setCursorPosition: (pos: number) => void; updateSlashCommandState: (text: string, cursor: number) => void; updateFileSearchState: (text: string, cursor: number) => void; + updateBashModeState: (text: string) => void; inputHistory: any; } @@ -200,6 +201,7 @@ export function updateTextBufferState(options: TextBufferStateOptions) { setCursorPosition, updateSlashCommandState, updateFileSearchState, + updateBashModeState, inputHistory, } = options; @@ -211,6 +213,7 @@ export function updateTextBufferState(options: TextBufferStateOptions) { setCursorPosition(newCursor); updateSlashCommandState(newText, newCursor); updateFileSearchState(newText, newCursor); + updateBashModeState(newText); inputHistory.resetNavigation(); } } From 684b072cbb0523a04ff9999f506c6819cc471345 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Tue, 2 Sep 2025 19:20:32 -0700 Subject: [PATCH 11/76] chore: prettier --- extensions/cli/spec/bash-mode.md | 13 ++++++++++++- extensions/cli/src/ui/UserInput.tsx | 10 +++++++--- .../cli/src/ui/hooks/useChat.bashMode.test.ts | 6 ++++-- extensions/cli/src/ui/hooks/useChat.ts | 10 +++++++--- 4 files changed, 30 insertions(+), 9 deletions(-) diff --git a/extensions/cli/spec/bash-mode.md b/extensions/cli/spec/bash-mode.md index cbf99c9fe..18957e0b7 100644 --- a/extensions/cli/spec/bash-mode.md +++ b/extensions/cli/spec/bash-mode.md @@ -1,23 +1,27 @@ Bash Mode (CLI TUI) Overview + - Bash mode lets users run shell commands directly from the chat input by starting their input with an exclamation mark (!). - It is intended for quick terminal command execution without leaving the TUI. Activation + - Bash mode is activated when the current input (trimmed) starts with ! - - Example: "!git status" or " !ls -la" both activate Bash mode. + - Example: "!git status" or " !ls -la" both activate Bash mode. - Visual indicator: - Input border color changes to yellow. - The input prompt indicator changes to a yellow "$". - The input placeholder includes "! for bash mode". Deactivation / Exiting Bash Mode + - Pressing Enter to submit the input exits bash mode immediately after submission, regardless of the command result. - Pressing Esc when the input (trimmed) is exactly ! clears the input and exits bash mode. - Editing the input so it no longer starts with ! also exits bash mode and restores normal input behavior. Interaction with other input helpers + - When in bash mode (input starts with !): - "@" file search suggestions are disabled. - "/" slash command UI is disabled. @@ -25,12 +29,14 @@ Interaction with other input helpers - "@" file search suggestions are disabled. Submission behavior + - On submit (Enter) with a bash-mode input: - The leading ! is removed and the remainder is treated as the shell command to run. - The TUI immediately appends an assistant message representing a Bash tool call, with status set to calling, so users can see that the command is in progress. - The bash command is executed asynchronously; when it completes, the tool call status is updated to done (or error) and the output is populated. Execution semantics + - The command is executed from the current working directory of the CLI process. - The command runs in the user’s shell as a login shell: - Unix/macOS: SHELL (or /bin/bash) invoked with -l -c "". @@ -40,6 +46,7 @@ Execution semantics - Environment variables are inherited from the parent process. Aliases/functions availability depends on the user’s shell configuration and is not guaranteed. Output handling + - Stdout is streamed into memory; Stderr is captured and appended as a trailing "Stderr: ..." section on success. - If the process exits non-zero and Stderr contains content, the tool call is marked as error and the error text is shown. - Output is truncated to the first 5000 lines if exceeded. @@ -47,18 +54,22 @@ Output handling "[Command timed out after 30 seconds of no output]". Keyboard behaviors (summary) + - Enter: submit input. If in bash mode, exits bash mode after submission and shows the pending Bash tool call immediately. - Shift+Enter: new line. - Backslash (\) at end-of-line: inserts a new line (line continuation) as usual. - Esc: if only ! (trimmed) is present, clears input and exits bash mode; otherwise cancels streaming or closes suggestions depending on context. Scope / Modes + - Bash mode applies to interactive (TUI/standard) CLI usage. It is not part of headless (-p/--print) processing. Error handling + - Command execution errors are captured and surfaced in the tool call as status error with human-readable error text (including Stderr when available). Examples + - "!git status" → shows a Bash tool call immediately, then populates with the git status output. - "!echo hello" → shows a Bash tool call immediately, then output "hello". - "!some-unknown-cmd" → shows a Bash tool call immediately, then sets status to error with an error message. diff --git a/extensions/cli/src/ui/UserInput.tsx b/extensions/cli/src/ui/UserInput.tsx index e022e3cc3..3f9339fda 100644 --- a/extensions/cli/src/ui/UserInput.tsx +++ b/extensions/cli/src/ui/UserInput.tsx @@ -618,7 +618,8 @@ const UserInput: React.FC = ({ const renderInputText = () => { const placeholderText = isRemoteMode ? "Ask anything, / for slash commands, ! for bash mode" - : placeholder || "Ask anything, @ for context, / for slash commands, ! for bash mode"; + : placeholder || + "Ask anything, @ for context, / for slash commands, ! for bash mode"; if (inputText.length === 0) { return ( <> @@ -717,8 +718,11 @@ const UserInput: React.FC = ({ paddingX={1} borderColor={showBashMode ? "yellow" : isRemoteMode ? "cyan" : "gray"} > - - {showBashMode ? "$" : isRemoteMode ? "◉" : "●"} + + {showBashMode ? "$" : isRemoteMode ? "◉" : "●"} {renderInputText()} diff --git a/extensions/cli/src/ui/hooks/useChat.bashMode.test.ts b/extensions/cli/src/ui/hooks/useChat.bashMode.test.ts index 89105cd4e..717033a04 100644 --- a/extensions/cli/src/ui/hooks/useChat.bashMode.test.ts +++ b/extensions/cli/src/ui/hooks/useChat.bashMode.test.ts @@ -20,7 +20,9 @@ describe("useChat - Bash Mode", () => { it("should detect bash mode when message starts with !", async () => { const mockRun = vi.mocked(runTerminalCommandTool.run); - mockRun.mockResolvedValue("total 5\ndrwxr-xr-x 2 user user 4096 Jan 1 12:00 .\ndrwxr-xr-x 3 user user 4096 Jan 1 12:00 .."); + mockRun.mockResolvedValue( + "total 5\ndrwxr-xr-x 2 user user 4096 Jan 1 12:00 .\ndrwxr-xr-x 3 user user 4096 Jan 1 12:00 ..", + ); const ctx = createMinimalTestContext(); const chat = useChat({ @@ -105,4 +107,4 @@ describe("useChat - Bash Mode", () => { expect(mockRun).toHaveBeenCalledWith({ command: "echo hello" }); }); -}); \ No newline at end of file +}); diff --git a/extensions/cli/src/ui/hooks/useChat.ts b/extensions/cli/src/ui/hooks/useChat.ts index 4c6876629..5fcba19fd 100644 --- a/extensions/cli/src/ui/hooks/useChat.ts +++ b/extensions/cli/src/ui/hooks/useChat.ts @@ -349,7 +349,7 @@ export function useChat({ // Extract the command after the ! const bashCommand = message.trimStart().slice(1).trim(); - + if (!bashCommand) { return message; // No command provided, treat as regular message } @@ -373,8 +373,12 @@ export function useChat({ // Execute the bash command asynchronously - don't block UI (async () => { try { - const { runTerminalCommandTool } = await import("../../tools/runTerminalCommand.js"); - const result = await runTerminalCommandTool.run({ command: bashCommand }); + const { runTerminalCommandTool } = await import( + "../../tools/runTerminalCommand.js" + ); + const result = await runTerminalCommandTool.run({ + command: bashCommand, + }); services.chatHistory.addToolResult(toolCallId, result, "done"); } catch (error: any) { const errorMessage = `Bash command failed: ${error?.message || String(error)}`; From ac9a6f8ee41049043d853b0746646f9bb5b21f05 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Tue, 2 Sep 2025 19:32:58 -0700 Subject: [PATCH 12/76] fix: eslint requirements --- extensions/cli/AGENTS.md | 5 - .../CHAT_HISTORY_SERVICE_MIGRATION_PLAN.md | 1 - extensions/cli/spec/config-loading.md | 2 - extensions/cli/spec/onboarding.md | 1 - extensions/cli/src/ui/UserInput.tsx | 120 +++++++++++++----- .../cli/src/ui/hooks/useChat.bashMode.test.ts | 8 +- .../cli/src/ui/hooks/useChat.bashMode.ts | 51 ++++++++ extensions/cli/src/ui/hooks/useChat.ts | 51 +------- 8 files changed, 147 insertions(+), 92 deletions(-) create mode 100644 extensions/cli/src/ui/hooks/useChat.bashMode.ts diff --git a/extensions/cli/AGENTS.md b/extensions/cli/AGENTS.md index 6fe536a46..bfe1f0d39 100644 --- a/extensions/cli/AGENTS.md +++ b/extensions/cli/AGENTS.md @@ -18,30 +18,25 @@ This is a CLI tool for Continue Dev that provides an interactive AI-assisted dev ### Core Components 1. **Entry Point** (`src/index.ts`): Main CLI logic with two modes: - - **Headless mode**: Non-interactive mode for automation/CI - **TUI mode**: Terminal User Interface using Ink/React - **Standard mode**: Traditional readline-based chat interface 2. **Authentication** (`src/auth/`): WorkOS-based authentication system - - `ensureAuth.ts`: Handles authentication flow - `workos.ts`: WorkOS configuration and token management 3. **Continue SDK Integration** (`src/continueSDK.ts`): Initializes the Continue SDK client with: - - API key authentication - Assistant configuration (slug-based) - Organization support 4. **Terminal UI** (`src/ui/`): React/Ink-based TUI components - - `TUIChat.tsx`: Main chat interface component - `UserInput.tsx`: Input handling with multi-line support - `TextBuffer.ts`: Text display utilities 5. **Tools System** (`src/tools/`): Built-in development tools including: - - File operations (read, write, list) - Code search functionality - Terminal command execution diff --git a/extensions/cli/CHAT_HISTORY_SERVICE_MIGRATION_PLAN.md b/extensions/cli/CHAT_HISTORY_SERVICE_MIGRATION_PLAN.md index 566ebe5aa..7b9d508f5 100644 --- a/extensions/cli/CHAT_HISTORY_SERVICE_MIGRATION_PLAN.md +++ b/extensions/cli/CHAT_HISTORY_SERVICE_MIGRATION_PLAN.md @@ -299,7 +299,6 @@ If issues arise during migration: 1. **Streaming integration**: Most complex change - Mitigation: Extensive testing, gradual rollout 2. **Remote mode**: Different state management - - Mitigation: Test thoroughly, maintain compatibility 3. **Performance**: Large histories might cause issues diff --git a/extensions/cli/spec/config-loading.md b/extensions/cli/spec/config-loading.md index 0f474b5a7..384b19809 100644 --- a/extensions/cli/spec/config-loading.md +++ b/extensions/cli/spec/config-loading.md @@ -23,13 +23,11 @@ This document specifies the behavior of the CLI's configuration loading system, **When CLI is invoked, config source is determined in this order:** 1. **CLI `--config` Flag** (highest priority) - - File path (starts with `.`, `/`, `~`): Loads local YAML file - Assistant slug (`owner/package`): Fetches from Continue platform - Overrides any saved preferences 2. **Saved Config URI** (if no `--config` flag) - - Retrieved from authentication config - Converts `file://` URIs back to file paths - Converts `slug://` URIs back to assistant slugs diff --git a/extensions/cli/spec/onboarding.md b/extensions/cli/spec/onboarding.md index 523b9067e..9b3eaf22e 100644 --- a/extensions/cli/spec/onboarding.md +++ b/extensions/cli/spec/onboarding.md @@ -8,7 +8,6 @@ When a user first runs `cn` in interactive mode, they will be taken through "onb 1. If the --config flag is provided, load this config 2. Otherwise, we will present the user with two options: - - Log in with Continue: log them in, which will automatically create their assistant and then we can load the first assistant from the first org - Enter your Anthropic API key: let them enter the key, and then either create a ~/.continue/config.yaml with the following contents OR update the existing config.yaml to add the model diff --git a/extensions/cli/src/ui/UserInput.tsx b/extensions/cli/src/ui/UserInput.tsx index 3f9339fda..1f85011d7 100644 --- a/extensions/cli/src/ui/UserInput.tsx +++ b/extensions/cli/src/ui/UserInput.tsx @@ -19,6 +19,77 @@ import { import { SlashCommandUI } from "./SlashCommandUI.js"; import { TextBuffer } from "./TextBuffer.js"; +// Small presentational helpers to reduce cyclomatic complexity in UserInput +const InterruptedBanner: React.FC<{ wasInterrupted: boolean }> = ({ + wasInterrupted, +}) => { + if (!wasInterrupted) return null; + return ( + + ⚠ Interrupted by user - Press enter to resume + + ); +}; + +const SlashCommandsMaybe: React.FC<{ + show: boolean; + inputMode: boolean; + hideNormalUI: boolean; + isRemoteMode: boolean; + assistant?: AssistantConfig; + filter: string; + selectedIndex: number; +}> = ({ + show, + inputMode, + hideNormalUI, + isRemoteMode, + assistant, + filter, + selectedIndex, +}) => { + if (!show || !inputMode || hideNormalUI || !(isRemoteMode || assistant)) + return null; + return ( + + ); +}; + +const FileSearchMaybe: React.FC<{ + show: boolean; + inputMode: boolean; + hideNormalUI: boolean; + isRemoteMode: boolean; + filter: string; + selectedIndex: number; + onSelect: (path: string) => void | Promise; + onFilesUpdated: (files: Array<{ path: string; displayName: string }>) => void; +}> = ({ + show, + inputMode, + hideNormalUI, + isRemoteMode, + filter, + selectedIndex, + onSelect, + onFilesUpdated, +}) => { + if (!show || !inputMode || hideNormalUI || isRemoteMode) return null; + return ( + + ); +}; + interface UserInputProps { onSubmit: (message: string, imageMap?: Map) => void; isWaitingForResponse: boolean; @@ -702,14 +773,7 @@ const UserInput: React.FC = ({ return ( - {/* Interruption message - shown just above the input box */} - {wasInterrupted && ( - - - ⚠ Interrupted by user - Press enter to resume - - - )} + {/* Input box */} = ({ {renderInputText()} - {/* Slash command UI - show in remote mode OR when assistant is available */} - {showSlashCommands && - inputMode && - !hideNormalUI && - (isRemoteMode || assistant) && ( - - )} + - {/* File search UI - only show in local mode */} - {showFileSearch && inputMode && !hideNormalUI && !isRemoteMode && ( - - )} + ); }; diff --git a/extensions/cli/src/ui/hooks/useChat.bashMode.test.ts b/extensions/cli/src/ui/hooks/useChat.bashMode.test.ts index 717033a04..43726bf09 100644 --- a/extensions/cli/src/ui/hooks/useChat.bashMode.test.ts +++ b/extensions/cli/src/ui/hooks/useChat.bashMode.test.ts @@ -1,7 +1,10 @@ -import { describe, it, expect, vi, beforeEach } from "vitest"; import { act } from "@testing-library/react"; +import { describe, it, expect, vi, beforeEach } from "vitest"; import { createMinimalTestContext } from "../../test-helpers/ui-test-context.js"; +import { runTerminalCommandTool } from "../../tools/runTerminalCommand.js"; + +import { useChat } from "./useChat.js"; // Mock the runTerminalCommandTool vi.mock("../../tools/runTerminalCommand.js", () => ({ @@ -10,9 +13,6 @@ vi.mock("../../tools/runTerminalCommand.js", () => ({ }, })); -import { useChat } from "./useChat.js"; -import { runTerminalCommandTool } from "../../tools/runTerminalCommand.js"; - describe("useChat - Bash Mode", () => { beforeEach(() => { vi.clearAllMocks(); diff --git a/extensions/cli/src/ui/hooks/useChat.bashMode.ts b/extensions/cli/src/ui/hooks/useChat.bashMode.ts new file mode 100644 index 000000000..534f0b3b7 --- /dev/null +++ b/extensions/cli/src/ui/hooks/useChat.bashMode.ts @@ -0,0 +1,51 @@ +import { services } from "../../services/index.js"; + +export const handleBashModeProcessing = async ( + message: string, +): Promise => { + // Handle bash mode commands (starting with !) + if (!message.trimStart().startsWith("!")) { + return message; + } + + // Extract the command after the ! + const bashCommand = message.trimStart().slice(1).trim(); + + if (!bashCommand) { + return message; // No command provided, treat as regular message + } + + // Show tool call immediately, then run asynchronously and populate result + const toolCallId = `bash-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`; + const toolCall = { + id: toolCallId, + type: "function" as const, + function: { + name: "Bash", + arguments: JSON.stringify({ command: bashCommand }), + }, + }; + + // Add assistant message with tool call immediately + services.chatHistory.addAssistantMessage("", [toolCall as any]); + // Mark as calling for immediate UI feedback + services.chatHistory.updateToolStatus(toolCallId, "calling"); + + // Execute the bash command asynchronously - don't block UI + (async () => { + try { + const { runTerminalCommandTool } = await import( + "../../tools/runTerminalCommand.js" + ); + const result = await runTerminalCommandTool.run({ + command: bashCommand, + }); + services.chatHistory.addToolResult(toolCallId, result, "done"); + } catch (error: any) { + const errorMessage = `Bash command failed: ${error?.message || String(error)}`; + services.chatHistory.addToolResult(toolCallId, errorMessage, "errored"); + } + })(); + + return null; // Processed, no further message handling needed +}; diff --git a/extensions/cli/src/ui/hooks/useChat.ts b/extensions/cli/src/ui/hooks/useChat.ts index 5fcba19fd..cc86d61fe 100644 --- a/extensions/cli/src/ui/hooks/useChat.ts +++ b/extensions/cli/src/ui/hooks/useChat.ts @@ -15,6 +15,7 @@ import { telemetryService } from "../../telemetry/telemetryService.js"; import { formatError } from "../../util/formatError.js"; import { logger } from "../../util/logger.js"; +import { handleBashModeProcessing } from "./useChat.bashMode.js"; import { handleAutoCompaction, handleCompactCommand, @@ -339,56 +340,6 @@ export function useChat({ return false; }; - const handleBashModeProcessing = async ( - message: string, - ): Promise => { - // Handle bash mode commands (starting with !) - if (!message.trimStart().startsWith("!")) { - return message; - } - - // Extract the command after the ! - const bashCommand = message.trimStart().slice(1).trim(); - - if (!bashCommand) { - return message; // No command provided, treat as regular message - } - - // Show tool call immediately, then run asynchronously and populate result - const toolCallId = `bash-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`; - const toolCall = { - id: toolCallId, - type: "function" as const, - function: { - name: "Bash", - arguments: JSON.stringify({ command: bashCommand }), - }, - }; - - // Add assistant message with tool call immediately - services.chatHistory.addAssistantMessage("", [toolCall as any]); - // Mark as calling for immediate UI feedback - services.chatHistory.updateToolStatus(toolCallId, "calling"); - - // Execute the bash command asynchronously - don't block UI - (async () => { - try { - const { runTerminalCommandTool } = await import( - "../../tools/runTerminalCommand.js" - ); - const result = await runTerminalCommandTool.run({ - command: bashCommand, - }); - services.chatHistory.addToolResult(toolCallId, result, "done"); - } catch (error: any) { - const errorMessage = `Bash command failed: ${error?.message || String(error)}`; - services.chatHistory.addToolResult(toolCallId, errorMessage, "error"); - } - })(); - - return null; // Processed, no further message handling needed - }; - const handleSlashCommandProcessing = async ( message: string, ): Promise => { From 08f4b865fb027ca06199b5a42a36f21144ed4c7a Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Tue, 2 Sep 2025 19:57:08 -0700 Subject: [PATCH 13/76] fix: prettier --- extensions/cli/AGENTS.md | 5 +++++ extensions/cli/CHAT_HISTORY_SERVICE_MIGRATION_PLAN.md | 1 + extensions/cli/spec/config-loading.md | 2 ++ extensions/cli/spec/onboarding.md | 1 + 4 files changed, 9 insertions(+) diff --git a/extensions/cli/AGENTS.md b/extensions/cli/AGENTS.md index bfe1f0d39..6fe536a46 100644 --- a/extensions/cli/AGENTS.md +++ b/extensions/cli/AGENTS.md @@ -18,25 +18,30 @@ This is a CLI tool for Continue Dev that provides an interactive AI-assisted dev ### Core Components 1. **Entry Point** (`src/index.ts`): Main CLI logic with two modes: + - **Headless mode**: Non-interactive mode for automation/CI - **TUI mode**: Terminal User Interface using Ink/React - **Standard mode**: Traditional readline-based chat interface 2. **Authentication** (`src/auth/`): WorkOS-based authentication system + - `ensureAuth.ts`: Handles authentication flow - `workos.ts`: WorkOS configuration and token management 3. **Continue SDK Integration** (`src/continueSDK.ts`): Initializes the Continue SDK client with: + - API key authentication - Assistant configuration (slug-based) - Organization support 4. **Terminal UI** (`src/ui/`): React/Ink-based TUI components + - `TUIChat.tsx`: Main chat interface component - `UserInput.tsx`: Input handling with multi-line support - `TextBuffer.ts`: Text display utilities 5. **Tools System** (`src/tools/`): Built-in development tools including: + - File operations (read, write, list) - Code search functionality - Terminal command execution diff --git a/extensions/cli/CHAT_HISTORY_SERVICE_MIGRATION_PLAN.md b/extensions/cli/CHAT_HISTORY_SERVICE_MIGRATION_PLAN.md index 7b9d508f5..566ebe5aa 100644 --- a/extensions/cli/CHAT_HISTORY_SERVICE_MIGRATION_PLAN.md +++ b/extensions/cli/CHAT_HISTORY_SERVICE_MIGRATION_PLAN.md @@ -299,6 +299,7 @@ If issues arise during migration: 1. **Streaming integration**: Most complex change - Mitigation: Extensive testing, gradual rollout 2. **Remote mode**: Different state management + - Mitigation: Test thoroughly, maintain compatibility 3. **Performance**: Large histories might cause issues diff --git a/extensions/cli/spec/config-loading.md b/extensions/cli/spec/config-loading.md index 384b19809..0f474b5a7 100644 --- a/extensions/cli/spec/config-loading.md +++ b/extensions/cli/spec/config-loading.md @@ -23,11 +23,13 @@ This document specifies the behavior of the CLI's configuration loading system, **When CLI is invoked, config source is determined in this order:** 1. **CLI `--config` Flag** (highest priority) + - File path (starts with `.`, `/`, `~`): Loads local YAML file - Assistant slug (`owner/package`): Fetches from Continue platform - Overrides any saved preferences 2. **Saved Config URI** (if no `--config` flag) + - Retrieved from authentication config - Converts `file://` URIs back to file paths - Converts `slug://` URIs back to assistant slugs diff --git a/extensions/cli/spec/onboarding.md b/extensions/cli/spec/onboarding.md index 9b3eaf22e..523b9067e 100644 --- a/extensions/cli/spec/onboarding.md +++ b/extensions/cli/spec/onboarding.md @@ -8,6 +8,7 @@ When a user first runs `cn` in interactive mode, they will be taken through "onb 1. If the --config flag is provided, load this config 2. Otherwise, we will present the user with two options: + - Log in with Continue: log them in, which will automatically create their assistant and then we can load the first assistant from the first org - Enter your Anthropic API key: let them enter the key, and then either create a ~/.continue/config.yaml with the following contents OR update the existing config.yaml to add the model From b7ff51e49c295828c047c38e434d1f48eea0e321 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Tue, 2 Sep 2025 21:07:37 -0700 Subject: [PATCH 14/76] chore: cleanup shell mode --- extensions/cli/spec/bash-mode.md | 75 ---------- extensions/cli/spec/shell-mode.md | 138 ++++++++++++++++++ extensions/cli/src/slashCommands.ts | 2 +- .../cli/src/tools/runTerminalCommand.ts | 9 +- extensions/cli/src/ui/UserInput.tsx | 12 +- ...Mode.test.ts => useChat.shellMode.test.ts} | 2 +- ...eChat.bashMode.ts => useChat.shellMode.ts} | 29 ++-- extensions/cli/src/ui/hooks/useChat.ts | 4 +- 8 files changed, 164 insertions(+), 107 deletions(-) delete mode 100644 extensions/cli/spec/bash-mode.md create mode 100644 extensions/cli/spec/shell-mode.md rename extensions/cli/src/ui/hooks/{useChat.bashMode.test.ts => useChat.shellMode.test.ts} (98%) rename extensions/cli/src/ui/hooks/{useChat.bashMode.ts => useChat.shellMode.ts} (66%) diff --git a/extensions/cli/spec/bash-mode.md b/extensions/cli/spec/bash-mode.md deleted file mode 100644 index 18957e0b7..000000000 --- a/extensions/cli/spec/bash-mode.md +++ /dev/null @@ -1,75 +0,0 @@ -Bash Mode (CLI TUI) - -Overview - -- Bash mode lets users run shell commands directly from the chat input by starting their input with an exclamation mark (!). -- It is intended for quick terminal command execution without leaving the TUI. - -Activation - -- Bash mode is activated when the current input (trimmed) starts with ! - - Example: "!git status" or " !ls -la" both activate Bash mode. -- Visual indicator: - - Input border color changes to yellow. - - The input prompt indicator changes to a yellow "$". - - The input placeholder includes "! for bash mode". - -Deactivation / Exiting Bash Mode - -- Pressing Enter to submit the input exits bash mode immediately after submission, regardless of the command result. -- Pressing Esc when the input (trimmed) is exactly ! clears the input and exits bash mode. -- Editing the input so it no longer starts with ! also exits bash mode and restores normal input behavior. - -Interaction with other input helpers - -- When in bash mode (input starts with !): - - "@" file search suggestions are disabled. - - "/" slash command UI is disabled. -- When in slash command mode (input starts with /): - - "@" file search suggestions are disabled. - -Submission behavior - -- On submit (Enter) with a bash-mode input: - - The leading ! is removed and the remainder is treated as the shell command to run. - - The TUI immediately appends an assistant message representing a Bash tool call, with status set to calling, so users can see that the command is in progress. - - The bash command is executed asynchronously; when it completes, the tool call status is updated to done (or error) and the output is populated. - -Execution semantics - -- The command is executed from the current working directory of the CLI process. -- The command runs in the user’s shell as a login shell: - - Unix/macOS: SHELL (or /bin/bash) invoked with -l -c "". - - Windows: powershell.exe -NoLogo -ExecutionPolicy Bypass -Command "". -- The child process stdin is detached (not connected to the TTY). This prevents the TUI from being suspended by job control. Consequences: - - Interactive commands that require stdin will not work. -- Environment variables are inherited from the parent process. Aliases/functions availability depends on the user’s shell configuration and is not guaranteed. - -Output handling - -- Stdout is streamed into memory; Stderr is captured and appended as a trailing "Stderr: ..." section on success. -- If the process exits non-zero and Stderr contains content, the tool call is marked as error and the error text is shown. -- Output is truncated to the first 5000 lines if exceeded. -- Timeout behavior: If no output is received for 30 seconds (configurable in tests), the process is terminated and the result includes a note like: - "[Command timed out after 30 seconds of no output]". - -Keyboard behaviors (summary) - -- Enter: submit input. If in bash mode, exits bash mode after submission and shows the pending Bash tool call immediately. -- Shift+Enter: new line. -- Backslash (\) at end-of-line: inserts a new line (line continuation) as usual. -- Esc: if only ! (trimmed) is present, clears input and exits bash mode; otherwise cancels streaming or closes suggestions depending on context. - -Scope / Modes - -- Bash mode applies to interactive (TUI/standard) CLI usage. It is not part of headless (-p/--print) processing. - -Error handling - -- Command execution errors are captured and surfaced in the tool call as status error with human-readable error text (including Stderr when available). - -Examples - -- "!git status" → shows a Bash tool call immediately, then populates with the git status output. -- "!echo hello" → shows a Bash tool call immediately, then output "hello". -- "!some-unknown-cmd" → shows a Bash tool call immediately, then sets status to error with an error message. diff --git a/extensions/cli/spec/shell-mode.md b/extensions/cli/spec/shell-mode.md new file mode 100644 index 000000000..a3bdd6cf4 --- /dev/null +++ b/extensions/cli/spec/shell-mode.md @@ -0,0 +1,138 @@ +shell Mode (CLI TUI) + +Overview + +- shell mode lets users run shell commands directly from the chat input by starting their input with an exclamation mark (!). +- It is intended for quick terminal command execution without leaving the TUI. + +Activation + +- shell mode is activated when the current input (trimmed) starts with ! + - Example: "!git status" or " !ls -la" both activate shell mode. +- Visual indicator: + - Input border color changes to yellow. + - The input prompt indicator changes to a yellow "$". + - The input placeholder includes "! for shell mode". + +Deactivation / Exiting shell Mode + +- Pressing Enter to submit the input exits shell mode immediately after submission, regardless of the command result. +- Pressing Esc when the input (trimmed) is exactly ! clears the input and exits shell mode. +- Editing the input so it no longer starts with ! also exits shell mode and restores normal input behavior. + +Interaction with other input helpers + +- When in shell mode (input starts with !): + - "@" file search suggestions are disabled. + - "/" slash command UI is disabled. +- When in slash command mode (input starts with /): + - "@" file search suggestions are disabled. + +Submission behavior + +- On submit (Enter) with a shell-mode input: + - The leading ! is removed and the remainder is treated as the shell command to run. + - The TUI immediately appends an assistant message representing a shell tool call, with status set to calling, so users can see that the command is in progress. + - The shell command is executed asynchronously; when it completes, the tool call status is updated to done (or error) and the output is populated. + +Execution semantics + +- The command is executed in the same way as terminal tool commands, minus permissions + +Output handling + +- Stdout is streamed into memory; Stderr is captured and appended as a trailing "Stderr: ..." section on success. +- If the process exits non-zero and Stderr contains content, the tool call is marked as error and the error text is shown. +- Output is truncated to the first 5000 lines if exceeded. +- Timeout behavior: If no output is received for 30 seconds (configurable in tests), the process is terminated and the result includes a note like: + "[Command timed out after 30 seconds of no output]". + +Keyboard behaviors (summary) + +- Enter: submit input. If in shell mode, exits shell mode after submission and shows the pending shell tool call immediately. +- Shift+Enter: new line. +- Backslash (\) at end-of-line: inserts a new line (line continuation) as usual. +- Esc: if only ! (trimmed) is present, clears input and exits shell mode; otherwise cancels streaming or closes suggestions depending on context. + +Scope / Modes + +- shell mode applies to interactive (TUI/standard) CLI usage. It is not part of headless (-p/--print) processing. + +Error handling + +- Command execution errors are captured and surfaced in the tool call as status error with human-readable error text (including Stderr when available). + +Examples + +- "!git status" → shows a shell tool call immediately, then populates with the git status output. +- "!echo hello" → shows a shell tool call immediately, then output "hello". +- "!some-unknown-cmd" → shows a shell tool call immediately, then sets status to error with an error message. + Shell Mode (CLI TUI) + +Overview + +- Shell mode lets users run shell commands directly from the chat input by starting their input with an exclamation mark (!). +- It is intended for quick terminal command execution without leaving the TUI. + +Activation + +- Shell mode is activated when the current input (trimmed) starts with ! + - Example: "!git status" or " !ls -la" both activate Shell mode. +- Visual indicator: + - Input border color changes to yellow. + - The input prompt indicator changes to a yellow "$". + - The input placeholder includes "! for shell mode". + +Deactivation / Exiting Shell Mode + +- Pressing Enter to submit the input exits shell mode immediately after submission, regardless of the command result. +- Pressing Esc when the input (trimmed) is exactly ! clears the input and exits shell mode. +- Editing the input so it no longer starts with ! also exits shell mode and restores normal input behavior. + +Interaction with other input helpers + +- When in shell mode (input starts with !): + - "@" file search suggestions are disabled. + - "/" slash command UI is disabled. +- When in slash command mode (input starts with /): + - "@" file search suggestions are disabled. + +Submission behavior + +- On submit (Enter) with a shell-mode input: + - The leading ! is removed and the remainder is treated as the shell command to run. + - The TUI immediately appends an assistant message representing a Shell tool call, with status set to calling, so users can see that the command is in progress. + - The shell command is executed asynchronously; when it completes, the tool call status is updated to done (or error) and the output is populated. + +Execution semantics + +- The command is executed in the same way as terminal tool commands, minus permissions, and inserted into the chat history the same. + +Output handling + +- Stdout is streamed into memory; Stderr is captured and appended as a trailing "Stderr: ..." section on success. +- If the process exits non-zero and Stderr contains content, the tool call is marked as error and the error text is shown. +- Output is truncated to the first 5000 lines if exceeded. +- Timeout behavior: If no output is received for 30 seconds (configurable in tests), the process is terminated and the result includes a note like: + "[Command timed out after 30 seconds of no output]". + +Keyboard behaviors (summary) + +- Enter: submit input. If in shell mode, exits shell mode after submission and shows the pending Shell tool call immediately. +- Shift+Enter: new line. +- Backslash (\) at end-of-line: inserts a new line (line continuation) as usual. +- Esc: if only ! (trimmed) is present, clears input and exits shell mode; otherwise cancels streaming or closes suggestions depending on context. + +Scope / Modes + +- Shell mode applies to interactive (TUI/standard) CLI usage. It is not part of headless (-p/--print) processing. + +Error handling + +- Command execution errors are captured and surfaced in the tool call as status error with human-readable error text (including Stderr when available). + +Examples + +- "!git status" → shows a Shell tool call immediately, then populates with the git status output. +- "!echo hello" → shows a Shell tool call immediately, then output "hello". +- "!some-unknown-cmd" → shows a Shell tool call immediately, then sets status to error with an error message. diff --git a/extensions/cli/src/slashCommands.ts b/extensions/cli/src/slashCommands.ts index 1c34c58fa..509ce8f61 100644 --- a/extensions/cli/src/slashCommands.ts +++ b/extensions/cli/src/slashCommands.ts @@ -28,7 +28,7 @@ async function handleHelp(_args: string[], _assistant: AssistantConfig) { ` ${chalk.cyan("Enter")} Submit message`, ` ${chalk.cyan("Shift+Enter")} New line`, ` ${chalk.cyan("\\")} Line continuation (at end of line)`, - ` ${chalk.cyan("!")} Bash mode - run shell commands`, + ` ${chalk.cyan("!")} Shell mode - run shell commands`, "", chalk.white("Controls:"), ` ${chalk.cyan("Ctrl+C")} Clear input`, diff --git a/extensions/cli/src/tools/runTerminalCommand.ts b/extensions/cli/src/tools/runTerminalCommand.ts index 242ecdeea..9aefceb9b 100644 --- a/extensions/cli/src/tools/runTerminalCommand.ts +++ b/extensions/cli/src/tools/runTerminalCommand.ts @@ -17,7 +17,7 @@ function getShellCommand(command: string): { shell: string; args: string[] } { args: ["-NoLogo", "-ExecutionPolicy", "Bypass", "-Command", command], }; } else { - // Unix/macOS: Just run the user's shell as a login shell + // Unix/macOS: Use login shell to source .bashrc/.zshrc etc. const userShell = process.env.SHELL || "/bin/bash"; return { shell: userShell, args: ["-l", "-c", command] }; } @@ -60,12 +60,7 @@ The command will be executed from the current working directory: ${process.cwd() return new Promise((resolve, reject) => { // Use same shell logic as core implementation const { shell, args } = getShellCommand(command); - const child = spawn(shell, args, { - cwd: process.cwd(), - env: process.env, - stdio: ["ignore", "pipe", "pipe"], // prevent child from reading TTY input - detached: false, - }); + const child = spawn(shell, args); let stdout = ""; let stderr = ""; let timeoutId: NodeJS.Timeout; diff --git a/extensions/cli/src/ui/UserInput.tsx b/extensions/cli/src/ui/UserInput.tsx index 1f85011d7..1c916e9d0 100644 --- a/extensions/cli/src/ui/UserInput.tsx +++ b/extensions/cli/src/ui/UserInput.tsx @@ -190,13 +190,13 @@ const UserInput: React.FC = ({ return nextMode; }; - // Update bash mode state based on input + // Update shell mode state based on input const updateBashModeState = (text: string) => { const trimmed = text.trimStart(); const isBash = trimmed.startsWith("!"); setShowBashMode(isBash); if (isBash) { - // Disable other helpers while in bash mode + // Disable other helpers while in shell mode setShowSlashCommands(false); setShowFileSearch(false); } @@ -275,7 +275,7 @@ const UserInput: React.FC = ({ return; } - // Disable file search if we're in bash mode or slash command mode + // Disable file search if we're in shell mode or slash command mode const trimmed = text.trimStart(); if (trimmed.startsWith("!") || trimmed.startsWith("/")) { setShowFileSearch(false); @@ -551,7 +551,7 @@ const UserInput: React.FC = ({ const handleEscapeKey = (key: any): boolean => { if (!key.escape) return false; - // If only "!" is present, clear bash mode + // If only "!" is present, clear shell mode if (inputMode && showBashMode && inputText.trim() === "!") { textBuffer.clear(); setInputText(""); @@ -688,9 +688,9 @@ const UserInput: React.FC = ({ const renderInputText = () => { const placeholderText = isRemoteMode - ? "Ask anything, / for slash commands, ! for bash mode" + ? "Ask anything, / for slash commands, ! for shell mode" : placeholder || - "Ask anything, @ for context, / for slash commands, ! for bash mode"; + "Ask anything, @ for context, / for slash commands, ! for shell mode"; if (inputText.length === 0) { return ( <> diff --git a/extensions/cli/src/ui/hooks/useChat.bashMode.test.ts b/extensions/cli/src/ui/hooks/useChat.shellMode.test.ts similarity index 98% rename from extensions/cli/src/ui/hooks/useChat.bashMode.test.ts rename to extensions/cli/src/ui/hooks/useChat.shellMode.test.ts index 43726bf09..5afed14bf 100644 --- a/extensions/cli/src/ui/hooks/useChat.bashMode.test.ts +++ b/extensions/cli/src/ui/hooks/useChat.shellMode.test.ts @@ -1,5 +1,5 @@ import { act } from "@testing-library/react"; -import { describe, it, expect, vi, beforeEach } from "vitest"; +import { beforeEach, describe, expect, it, vi } from "vitest"; import { createMinimalTestContext } from "../../test-helpers/ui-test-context.js"; import { runTerminalCommandTool } from "../../tools/runTerminalCommand.js"; diff --git a/extensions/cli/src/ui/hooks/useChat.bashMode.ts b/extensions/cli/src/ui/hooks/useChat.shellMode.ts similarity index 66% rename from extensions/cli/src/ui/hooks/useChat.bashMode.ts rename to extensions/cli/src/ui/hooks/useChat.shellMode.ts index 534f0b3b7..18cac2d43 100644 --- a/extensions/cli/src/ui/hooks/useChat.bashMode.ts +++ b/extensions/cli/src/ui/hooks/useChat.shellMode.ts @@ -1,9 +1,11 @@ +import { runTerminalCommandTool } from "src/tools/runTerminalCommand.js"; +import { getErrorString } from "src/util/error.js"; import { services } from "../../services/index.js"; export const handleBashModeProcessing = async ( message: string, ): Promise => { - // Handle bash mode commands (starting with !) + // Handle shell mode commands (starting with !) if (!message.trimStart().startsWith("!")) { return message; } @@ -16,7 +18,7 @@ export const handleBashModeProcessing = async ( } // Show tool call immediately, then run asynchronously and populate result - const toolCallId = `bash-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`; + const toolCallId = `shell-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`; const toolCall = { id: toolCallId, type: "function" as const, @@ -27,25 +29,22 @@ export const handleBashModeProcessing = async ( }; // Add assistant message with tool call immediately - services.chatHistory.addAssistantMessage("", [toolCall as any]); + services.chatHistory.addAssistantMessage("", [toolCall]); // Mark as calling for immediate UI feedback services.chatHistory.updateToolStatus(toolCallId, "calling"); // Execute the bash command asynchronously - don't block UI - (async () => { - try { - const { runTerminalCommandTool } = await import( - "../../tools/runTerminalCommand.js" - ); - const result = await runTerminalCommandTool.run({ - command: bashCommand, - }); + void runTerminalCommandTool + .run({ + command: bashCommand, + }) + .then((result) => { services.chatHistory.addToolResult(toolCallId, result, "done"); - } catch (error: any) { - const errorMessage = `Bash command failed: ${error?.message || String(error)}`; + }) + .catch((error) => { + const errorMessage = `Bash command failed: ${getErrorString(error)}`; services.chatHistory.addToolResult(toolCallId, errorMessage, "errored"); - } - })(); + }); return null; // Processed, no further message handling needed }; diff --git a/extensions/cli/src/ui/hooks/useChat.ts b/extensions/cli/src/ui/hooks/useChat.ts index cc86d61fe..c2f1e0130 100644 --- a/extensions/cli/src/ui/hooks/useChat.ts +++ b/extensions/cli/src/ui/hooks/useChat.ts @@ -15,7 +15,6 @@ import { telemetryService } from "../../telemetry/telemetryService.js"; import { formatError } from "../../util/formatError.js"; import { logger } from "../../util/logger.js"; -import { handleBashModeProcessing } from "./useChat.bashMode.js"; import { handleAutoCompaction, handleCompactCommand, @@ -31,6 +30,7 @@ import { handleRemoteMessage, setupRemotePolling, } from "./useChat.remote.helpers.js"; +import { handleBashModeProcessing } from "./useChat.shellMode.js"; import { createStreamCallbacks, executeStreaming, @@ -424,7 +424,7 @@ export function useChat({ if (handled) return; - // Handle bash mode commands (before slash commands) + // Handle shell mode commands (before slash commands) const bashProcessedMessage = await handleBashModeProcessing(message); if (bashProcessedMessage === null) { return; // Bash command was handled and no further processing needed From afede3f89dd66c8dcb61a4bc3f716791c1ca12e1 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Tue, 2 Sep 2025 21:08:26 -0700 Subject: [PATCH 15/76] chore: cleanup shell mode --- extensions/cli/src/ui/hooks/useChat.shellMode.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/extensions/cli/src/ui/hooks/useChat.shellMode.ts b/extensions/cli/src/ui/hooks/useChat.shellMode.ts index 18cac2d43..9c441310f 100644 --- a/extensions/cli/src/ui/hooks/useChat.shellMode.ts +++ b/extensions/cli/src/ui/hooks/useChat.shellMode.ts @@ -1,5 +1,6 @@ import { runTerminalCommandTool } from "src/tools/runTerminalCommand.js"; import { getErrorString } from "src/util/error.js"; + import { services } from "../../services/index.js"; export const handleBashModeProcessing = async ( From 530e0374d5c6d7198e4d4db46f5f43edd8eba760 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Tue, 2 Sep 2025 22:40:32 -0700 Subject: [PATCH 16/76] fix: shell mode tests --- .../src/ui/hooks/useChat.shellMode.test.ts | 149 +++++++++++------- 1 file changed, 93 insertions(+), 56 deletions(-) diff --git a/extensions/cli/src/ui/hooks/useChat.shellMode.test.ts b/extensions/cli/src/ui/hooks/useChat.shellMode.test.ts index 5afed14bf..da65c1a70 100644 --- a/extensions/cli/src/ui/hooks/useChat.shellMode.test.ts +++ b/extensions/cli/src/ui/hooks/useChat.shellMode.test.ts @@ -1,19 +1,29 @@ -import { act } from "@testing-library/react"; import { beforeEach, describe, expect, it, vi } from "vitest"; -import { createMinimalTestContext } from "../../test-helpers/ui-test-context.js"; -import { runTerminalCommandTool } from "../../tools/runTerminalCommand.js"; +import { runTerminalCommandTool } from "src/tools/runTerminalCommand.js"; +import { services } from "../../services/index.js"; -import { useChat } from "./useChat.js"; +import { handleBashModeProcessing } from "./useChat.shellMode.js"; -// Mock the runTerminalCommandTool -vi.mock("../../tools/runTerminalCommand.js", () => ({ +// Mock the runTerminalCommandTool with the correct path for the import in shellMode.ts +vi.mock("src/tools/runTerminalCommand.js", () => ({ runTerminalCommandTool: { run: vi.fn(), }, })); -describe("useChat - Bash Mode", () => { +// Mock the services +vi.mock("../../services/index.js", () => ({ + services: { + chatHistory: { + addAssistantMessage: vi.fn(), + updateToolStatus: vi.fn(), + addToolResult: vi.fn(), + }, + }, +})); + +describe("handleBashModeProcessing", () => { beforeEach(() => { vi.clearAllMocks(); }); @@ -24,87 +34,114 @@ describe("useChat - Bash Mode", () => { "total 5\ndrwxr-xr-x 2 user user 4096 Jan 1 12:00 .\ndrwxr-xr-x 3 user user 4096 Jan 1 12:00 ..", ); - const ctx = createMinimalTestContext(); - const chat = useChat({ - assistant: { name: "test" } as any, - model: { name: "test-model" } as any, - llmApi: {} as any, - } as any); + const result = await handleBashModeProcessing("!ls -la"); - await act(async () => { - await chat.handleUserMessage("!ls -la"); - }); + expect(result).toBe(null); // Processed, no further handling needed + expect(services.chatHistory.addAssistantMessage).toHaveBeenCalled(); + expect(services.chatHistory.updateToolStatus).toHaveBeenCalledWith( + expect.any(String), + "calling", + ); - expect(mockRun).toHaveBeenCalledWith({ command: "ls -la" }); + // Use vi.waitFor to wait for async operations in the void expression + await vi.waitFor( + () => { + expect(mockRun).toHaveBeenCalledWith({ command: "ls -la" }); + }, + { timeout: 1000 }, + ); - // Since history is managed by service, we just verify no exception and tool called - ctx.cleanup(); + await vi.waitFor( + () => { + expect(services.chatHistory.addToolResult).toHaveBeenCalledWith( + expect.any(String), + "total 5\ndrwxr-xr-x 2 user user 4096 Jan 1 12:00 .\ndrwxr-xr-x 3 user user 4096 Jan 1 12:00 ..", + "done", + ); + }, + { timeout: 1000 }, + ); }); it("should handle bash command errors", async () => { const mockRun = vi.mocked(runTerminalCommandTool.run); mockRun.mockRejectedValue(new Error("Command not found")); - const chat = useChat({ - assistant: { name: "test" } as any, - model: { name: "test-model" } as any, - llmApi: {} as any, - } as any); + const result = await handleBashModeProcessing("!invalidcommand"); - await act(async () => { - await chat.handleUserMessage("!invalidcommand"); - }); + expect(result).toBe(null); // Processed, no further handling needed + expect(services.chatHistory.addAssistantMessage).toHaveBeenCalled(); + expect(services.chatHistory.updateToolStatus).toHaveBeenCalledWith( + expect.any(String), + "calling", + ); - expect(mockRun).toHaveBeenCalledWith({ command: "invalidcommand" }); + // Use vi.waitFor to wait for async operations in the void expression + await vi.waitFor( + () => { + expect(mockRun).toHaveBeenCalledWith({ command: "invalidcommand" }); + }, + { timeout: 1000 }, + ); + + await vi.waitFor( + () => { + expect(services.chatHistory.addToolResult).toHaveBeenCalledWith( + expect.any(String), + "Bash command failed: Command not found", + "errored", + ); + }, + { timeout: 1000 }, + ); }); it("should not trigger bash mode for regular messages", async () => { const mockRun = vi.mocked(runTerminalCommandTool.run); - const chat = useChat({ - assistant: { name: "test" } as any, - model: { name: "test-model" } as any, - llmApi: {} as any, - } as any); - - await act(async () => { - await chat.handleUserMessage("Hello! How are you?"); - }); + const result = await handleBashModeProcessing("Hello! How are you?"); + expect(result).toBe("Hello! How are you?"); // Pass through unchanged expect(mockRun).not.toHaveBeenCalled(); + expect(services.chatHistory.addAssistantMessage).not.toHaveBeenCalled(); }); it("should handle empty bash command", async () => { const mockRun = vi.mocked(runTerminalCommandTool.run); - const chat = useChat({ - assistant: { name: "test" } as any, - model: { name: "test-model" } as any, - llmApi: {} as any, - } as any); + const result = await handleBashModeProcessing("!"); - await act(async () => { - await chat.handleUserMessage("!"); - }); - - // Should not call the tool for empty command + expect(result).toBe("!"); // Pass through unchanged for empty command expect(mockRun).not.toHaveBeenCalled(); + expect(services.chatHistory.addAssistantMessage).not.toHaveBeenCalled(); }); it("should handle bash command with leading whitespace", async () => { const mockRun = vi.mocked(runTerminalCommandTool.run); mockRun.mockResolvedValue("echo test output"); - const chat = useChat({ - assistant: { name: "test" } as any, - model: { name: "test-model" } as any, - llmApi: {} as any, - } as any); + const result = await handleBashModeProcessing(" !echo hello"); - await act(async () => { - await chat.handleUserMessage(" !echo hello"); - }); + expect(result).toBe(null); // Processed, no further handling needed + expect(services.chatHistory.addAssistantMessage).toHaveBeenCalled(); - expect(mockRun).toHaveBeenCalledWith({ command: "echo hello" }); + // Use vi.waitFor to wait for async operations in the void expression + await vi.waitFor( + () => { + expect(mockRun).toHaveBeenCalledWith({ command: "echo hello" }); + }, + { timeout: 1000 }, + ); + + await vi.waitFor( + () => { + expect(services.chatHistory.addToolResult).toHaveBeenCalledWith( + expect.any(String), + "echo test output", + "done", + ); + }, + { timeout: 1000 }, + ); }); }); From 898fc440ca165e6d459b3b9ad8ef29954b80a6b6 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Tue, 2 Sep 2025 22:44:40 -0700 Subject: [PATCH 17/76] fix: eslint --- extensions/cli/src/ui/hooks/useChat.shellMode.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/extensions/cli/src/ui/hooks/useChat.shellMode.test.ts b/extensions/cli/src/ui/hooks/useChat.shellMode.test.ts index da65c1a70..3308fdde5 100644 --- a/extensions/cli/src/ui/hooks/useChat.shellMode.test.ts +++ b/extensions/cli/src/ui/hooks/useChat.shellMode.test.ts @@ -1,6 +1,7 @@ import { beforeEach, describe, expect, it, vi } from "vitest"; import { runTerminalCommandTool } from "src/tools/runTerminalCommand.js"; + import { services } from "../../services/index.js"; import { handleBashModeProcessing } from "./useChat.shellMode.js"; From 142079335dc05b1049995edc119a83638cb83af3 Mon Sep 17 00:00:00 2001 From: Tomasz Stefaniak Date: Wed, 3 Sep 2025 08:30:49 -0700 Subject: [PATCH 18/76] feat: permission checker --- .../cli/src/permissions/permissionChecker.ts | 75 +++++++++++++++++-- .../cli/src/tools/runTerminalCommand.ts | 11 +++ extensions/cli/src/tools/types.ts | 6 ++ 3 files changed, 86 insertions(+), 6 deletions(-) diff --git a/extensions/cli/src/permissions/permissionChecker.ts b/extensions/cli/src/permissions/permissionChecker.ts index 9b2f5d557..d2d29761d 100644 --- a/extensions/cli/src/permissions/permissionChecker.ts +++ b/extensions/cli/src/permissions/permissionChecker.ts @@ -1,10 +1,14 @@ +import type { ToolPolicy } from "../../../../core/index.js"; + import { getServiceSync } from "../services/index.js"; import type { ToolPermissionServiceState } from "../services/types.js"; import { SERVICE_NAMES } from "../services/types.js"; +import { getAllBuiltinTools } from "../tools/index.js"; import { DEFAULT_TOOL_POLICIES } from "./defaultPolicies.js"; import { PermissionCheckResult, + PermissionPolicy, ToolCallRequest, ToolPermissions, } from "./types.js"; @@ -103,6 +107,38 @@ export function matchesArguments( return true; } +/** + * Converts CLI's PermissionPolicy to core's ToolPolicy + */ +function permissionPolicyToToolPolicy(permission: PermissionPolicy): ToolPolicy { + switch (permission) { + case "allow": + return "allowedWithoutPermission"; + case "ask": + return "allowedWithPermission"; + case "exclude": + return "disabled"; + default: + return "allowedWithPermission"; + } +} + +/** + * Converts core's ToolPolicy to CLI's PermissionPolicy + */ +function toolPolicyToPermissionPolicy(policy: ToolPolicy): PermissionPolicy { + switch (policy) { + case "allowedWithoutPermission": + return "allow"; + case "allowedWithPermission": + return "ask"; + case "disabled": + return "exclude"; + default: + return "ask"; + } +} + /** * Evaluates a tool call request against a set of permission policies. * Returns the permission for the first matching policy. @@ -129,21 +165,48 @@ export function checkToolPermission( } } + // First, get the base permission from static policies + let basePermission: PermissionPolicy = "ask"; + let matchedPolicy = undefined; + for (const policy of policies) { if ( matchesToolPattern(toolCall.name, policy.tool, toolCall.arguments) && matchesArguments(toolCall.arguments, policy.argumentMatches) ) { - return { - permission: policy.permission, - matchedPolicy: policy, - }; + basePermission = policy.permission; + matchedPolicy = policy; + break; } } - // Fallback to "ask" if no policy matches + // Check if tool has dynamic policy evaluation + const builtinTools = getAllBuiltinTools(); + const tool = builtinTools.find((t) => t.name === toolCall.name); + + if (tool?.evaluateToolCallPolicy) { + // Convert CLI permission to core policy + const basePolicy = permissionPolicyToToolPolicy(basePermission); + + // Evaluate the dynamic policy + const evaluatedPolicy = tool.evaluateToolCallPolicy( + basePolicy, + toolCall.arguments, + ); + + // Convert back to CLI permission + const finalPermission = toolPolicyToPermissionPolicy(evaluatedPolicy); + + return { + permission: finalPermission, + matchedPolicy, + }; + } + + // No dynamic evaluation, return static result return { - permission: "ask", + permission: basePermission, + matchedPolicy, }; } diff --git a/extensions/cli/src/tools/runTerminalCommand.ts b/extensions/cli/src/tools/runTerminalCommand.ts index c4866e7f0..c3ee7cc39 100644 --- a/extensions/cli/src/tools/runTerminalCommand.ts +++ b/extensions/cli/src/tools/runTerminalCommand.ts @@ -1,4 +1,6 @@ import { spawn } from "child_process"; +import type { ToolPolicy } from "../../../../core/index.js"; +import { evaluateTerminalCommandSecurity } from "../../../../core/tools/security/terminalCommandSecurity.js"; import { telemetryService } from "../telemetry/telemetryService.js"; import { @@ -24,6 +26,15 @@ The command will be executed from the current working directory: ${process.cwd() }, readonly: false, isBuiltIn: true, + evaluateToolCallPolicy: ( + basePolicy: ToolPolicy, + parsedArgs: Record, + ): ToolPolicy => { + return evaluateTerminalCommandSecurity( + basePolicy, + parsedArgs.command as string, + ); + }, preprocess: async (args) => { const command = args.command; if (!command || typeof command !== "string") { diff --git a/extensions/cli/src/tools/types.ts b/extensions/cli/src/tools/types.ts index e70c96e7b..f142c7830 100644 --- a/extensions/cli/src/tools/types.ts +++ b/extensions/cli/src/tools/types.ts @@ -1,3 +1,5 @@ +import type { ToolPolicy } from "../../../../core/index.js"; + export type ToolParameters = Record< string, { @@ -31,6 +33,10 @@ export interface Tool { run: (args: any) => Promise; readonly?: boolean; // Indicates if the tool is readonly isBuiltIn: boolean; + evaluateToolCallPolicy?: ( + basePolicy: ToolPolicy, + parsedArgs: Record, + ) => ToolPolicy; } export interface ToolCall { From 6078b5841a64f235a5d6389c393685944f65d45e Mon Sep 17 00:00:00 2001 From: Tomasz Stefaniak Date: Wed, 3 Sep 2025 09:35:03 -0700 Subject: [PATCH 19/76] feat: security policies --- .../cli/src/permissions/permissionChecker.ts | 16 +++-- .../cli/src/streamChatResponse.helpers.ts | 35 +++++++---- .../cli/src/ui/components/ScreenContent.tsx | 1 + .../ui/components/ToolPermissionSelector.tsx | 58 +++++++++++++------ .../src/ui/hooks/useChat.stream.helpers.ts | 6 ++ 5 files changed, 81 insertions(+), 35 deletions(-) diff --git a/extensions/cli/src/permissions/permissionChecker.ts b/extensions/cli/src/permissions/permissionChecker.ts index d2d29761d..339c53932 100644 --- a/extensions/cli/src/permissions/permissionChecker.ts +++ b/extensions/cli/src/permissions/permissionChecker.ts @@ -110,7 +110,9 @@ export function matchesArguments( /** * Converts CLI's PermissionPolicy to core's ToolPolicy */ -function permissionPolicyToToolPolicy(permission: PermissionPolicy): ToolPolicy { +function permissionPolicyToToolPolicy( + permission: PermissionPolicy, +): ToolPolicy { switch (permission) { case "allow": return "allowedWithoutPermission"; @@ -168,7 +170,7 @@ export function checkToolPermission( // First, get the base permission from static policies let basePermission: PermissionPolicy = "ask"; let matchedPolicy = undefined; - + for (const policy of policies) { if ( matchesToolPattern(toolCall.name, policy.tool, toolCall.arguments) && @@ -183,20 +185,22 @@ export function checkToolPermission( // Check if tool has dynamic policy evaluation const builtinTools = getAllBuiltinTools(); const tool = builtinTools.find((t) => t.name === toolCall.name); - + if (tool?.evaluateToolCallPolicy) { // Convert CLI permission to core policy const basePolicy = permissionPolicyToToolPolicy(basePermission); - + // Evaluate the dynamic policy const evaluatedPolicy = tool.evaluateToolCallPolicy( basePolicy, toolCall.arguments, ); - + // Convert back to CLI permission const finalPermission = toolPolicyToPermissionPolicy(evaluatedPolicy); - + + console.error("FINAL PERMISSION", finalPermission); + return { permission: finalPermission, matchedPolicy, diff --git a/extensions/cli/src/streamChatResponse.helpers.ts b/extensions/cli/src/streamChatResponse.helpers.ts index 4a90aedca..b5ae94539 100644 --- a/extensions/cli/src/streamChatResponse.helpers.ts +++ b/extensions/cli/src/streamChatResponse.helpers.ts @@ -23,11 +23,16 @@ export function handlePermissionDenied( toolCall: PreprocessedToolCall, chatHistoryEntries: ChatCompletionToolMessageParam[], callbacks?: StreamCallbacks, + reason: 'user' | 'policy' = 'user', ): void { - const deniedMessage = `Permission denied by user`; + const deniedMessage = reason === 'policy' + ? `Command blocked by security policy` + : `Permission denied by user`; + logger.info("Tool call denied", { name: toolCall.name, arguments: toolCall.arguments, + reason, }); chatHistoryEntries.push({ @@ -37,7 +42,7 @@ export function handlePermissionDenied( }); callbacks?.onToolResult?.(deniedMessage, toolCall.name, "canceled"); - logger.debug("Tool call rejected - stopping stream"); + logger.debug(`Tool call rejected (${reason}) - stopping stream`); } // Helper function to handle headless mode permission @@ -112,22 +117,25 @@ export async function checkToolPermissionApproval( toolCall: PreprocessedToolCall, callbacks?: StreamCallbacks, isHeadless?: boolean, -): Promise { +): Promise<{ approved: boolean; denialReason?: 'user' | 'policy' }> { const permissionCheck = checkToolPermission(toolCall); if (permissionCheck.permission === "allow") { - return true; + return { approved: true }; } else if (permissionCheck.permission === "ask") { if (isHeadless) { handleHeadlessPermission(toolCall); } - return await requestUserPermission(toolCall, callbacks); + const userApproved = await requestUserPermission(toolCall, callbacks); + return userApproved + ? { approved: true } + : { approved: false, denialReason: 'user' }; } else if (permissionCheck.permission === "exclude") { - // This shouldn't happen as excluded tools are filtered out earlier - return false; + // Tool blocked by security policy + return { approved: false, denialReason: 'policy' }; } - return false; + return { approved: false, denialReason: 'policy' }; } // Helper function to track first token time @@ -401,14 +409,19 @@ export async function executeStreamedToolCalls( callbacks?.onToolStart?.(toolCall.name, toolCall.arguments); // Check tool permissions using helper - const approved = await checkToolPermissionApproval( + const permissionResult = await checkToolPermissionApproval( toolCall, callbacks, isHeadless, ); - if (!approved) { - handlePermissionDenied(toolCall, chatHistoryEntries, callbacks); + if (!permissionResult.approved) { + handlePermissionDenied( + toolCall, + chatHistoryEntries, + callbacks, + permissionResult.denialReason || 'user', + ); hasRejection = true; continue; } diff --git a/extensions/cli/src/ui/components/ScreenContent.tsx b/extensions/cli/src/ui/components/ScreenContent.tsx index 16b9ebb5a..a2c0eb8fa 100644 --- a/extensions/cli/src/ui/components/ScreenContent.tsx +++ b/extensions/cli/src/ui/components/ScreenContent.tsx @@ -136,6 +136,7 @@ export const ScreenContent: React.FC = ({ toolArgs={activePermissionRequest.toolArgs} requestId={activePermissionRequest.requestId} toolCallPreview={activePermissionRequest.toolCallPreview} + hasDynamicEvaluation={activePermissionRequest.hasDynamicEvaluation} onResponse={handleToolPermissionResponse} /> ); diff --git a/extensions/cli/src/ui/components/ToolPermissionSelector.tsx b/extensions/cli/src/ui/components/ToolPermissionSelector.tsx index e5e9da0ca..96b8541eb 100644 --- a/extensions/cli/src/ui/components/ToolPermissionSelector.tsx +++ b/extensions/cli/src/ui/components/ToolPermissionSelector.tsx @@ -20,6 +20,7 @@ interface ToolPermissionSelectorProps { toolArgs: any; requestId: string; toolCallPreview?: ToolCallPreview[]; + hasDynamicEvaluation?: boolean; onResponse: ( requestId: string, approved: boolean, @@ -28,36 +29,47 @@ interface ToolPermissionSelectorProps { ) => void; } -const PERMISSION_OPTIONS: PermissionOption[] = [ - { id: "approve", name: "Continue", color: "green", approved: true }, - { - id: "approve_policy", - name: "Continue + don't ask again", - color: "cyan", - approved: true, - createPolicy: true, - }, - { +const getPermissionOptions = (hasDynamicEvaluation: boolean): PermissionOption[] => { + const baseOptions: PermissionOption[] = [ + { id: "approve", name: "Continue", color: "green", approved: true }, + ]; + + // Only show "don't ask again" option for tools without dynamic evaluation + if (!hasDynamicEvaluation) { + baseOptions.push({ + id: "approve_policy", + name: "Continue + don't ask again", + color: "cyan", + approved: true, + createPolicy: true, + }); + } + + baseOptions.push({ id: "deny_stop", name: "No, and tell Continue what to do differently", color: "yellow", approved: false, stopStream: true, - }, -]; + }); + + return baseOptions; +}; export const ToolPermissionSelector: React.FC = ({ toolName, toolArgs, requestId, toolCallPreview, + hasDynamicEvaluation = false, onResponse, }) => { + const permissionOptions = getPermissionOptions(hasDynamicEvaluation); const [selectedIndex, setSelectedIndex] = useState(0); useInput((input, key) => { if (key.return) { - const selectedOption = PERMISSION_OPTIONS[selectedIndex]; + const selectedOption = permissionOptions[selectedIndex]; onResponse( requestId, selectedOption.approved, @@ -73,8 +85,8 @@ export const ToolPermissionSelector: React.FC = ({ return; } - // Shift+Tab to continue with policy creation - if (key.tab && key.shift) { + // Shift+Tab to continue with policy creation (only if not dynamic) + if (key.tab && key.shift && !hasDynamicEvaluation) { onResponse(requestId, true, true, false); return; } @@ -89,7 +101,7 @@ export const ToolPermissionSelector: React.FC = ({ setSelectedIndex(Math.max(0, selectedIndex - 1)); } else if (key.downArrow) { setSelectedIndex( - Math.min(PERMISSION_OPTIONS.length - 1, selectedIndex + 1), + Math.min(permissionOptions.length - 1, selectedIndex + 1), ); } @@ -125,11 +137,21 @@ export const ToolPermissionSelector: React.FC = ({ Would you like to continue? - {PERMISSION_OPTIONS.map((option, index) => { + {hasDynamicEvaluation && ( + + + Note: This tool evaluates permissions based on the specific command. + + + Some commands will always require permission. + + + )} + {permissionOptions.map((option, index) => { const isSelected = index === selectedIndex; let shortcut = ""; if (option.id === "approve") shortcut = "(tab)"; - else if (option.id === "approve_policy") shortcut = "(shift+tab)"; + else if (option.id === "approve_policy" && !hasDynamicEvaluation) shortcut = "(shift+tab)"; else if (option.id === "deny_stop") shortcut = "(esc)"; return ( diff --git a/extensions/cli/src/ui/hooks/useChat.stream.helpers.ts b/extensions/cli/src/ui/hooks/useChat.stream.helpers.ts index 1f697d6d8..5ee8abe5d 100644 --- a/extensions/cli/src/ui/hooks/useChat.stream.helpers.ts +++ b/extensions/cli/src/ui/hooks/useChat.stream.helpers.ts @@ -1,4 +1,5 @@ import type { ChatHistoryItem, ToolCallState, ToolStatus } from "core/index.js"; +import { getAllBuiltinTools } from "src/tools/index.js"; interface CreateStreamCallbacksOptions { setChatHistory: React.Dispatch>; @@ -154,11 +155,16 @@ export function createStreamCallbacks( requestId: string, toolCallPreview?: any[], ) => { + // Check if this tool has dynamic evaluation + const tool = getAllBuiltinTools().find((t: any) => t.name === toolName); + const hasDynamicEvaluation = !!tool?.evaluateToolCallPolicy; + setActivePermissionRequest({ toolName, toolArgs, requestId, toolCallPreview, + hasDynamicEvaluation, }); }, From 5d2b4725a2c15e4493fbfd34c20fde1c71556ff5 Mon Sep 17 00:00:00 2001 From: Tomasz Stefaniak Date: Wed, 3 Sep 2025 10:27:00 -0700 Subject: [PATCH 20/76] test: echo --- .../implementations/terminalCommandSecurity.vitest.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/tools/implementations/terminalCommandSecurity.vitest.ts b/core/tools/implementations/terminalCommandSecurity.vitest.ts index 97d254730..f527ef481 100644 --- a/core/tools/implementations/terminalCommandSecurity.vitest.ts +++ b/core/tools/implementations/terminalCommandSecurity.vitest.ts @@ -730,6 +730,14 @@ describe("evaluateTerminalCommandSecurity", () => { expect(result).toBe("allowedWithPermission"); }); + it("should allow simple echo with quoted string without permission", () => { + const result = evaluateTerminalCommandSecurity( + "allowedWithoutPermission", + 'echo "hello"', + ); + expect(result).toBe("allowedWithoutPermission"); + }); + it("should allow echo with dangerous-looking but quoted strings", () => { const result = evaluateTerminalCommandSecurity( "allowedWithPermission", From 606df7e0b621defcd71af22240d14a24bfdabed3 Mon Sep 17 00:00:00 2001 From: Tomasz Stefaniak Date: Wed, 3 Sep 2025 10:27:46 -0700 Subject: [PATCH 21/76] test: echo --- .../implementations/terminalCommandSecurity.vitest.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/tools/implementations/terminalCommandSecurity.vitest.ts b/core/tools/implementations/terminalCommandSecurity.vitest.ts index f527ef481..3c10f75e3 100644 --- a/core/tools/implementations/terminalCommandSecurity.vitest.ts +++ b/core/tools/implementations/terminalCommandSecurity.vitest.ts @@ -738,6 +738,14 @@ describe("evaluateTerminalCommandSecurity", () => { expect(result).toBe("allowedWithoutPermission"); }); + it("should allow echo without quotes without permission", () => { + const result = evaluateTerminalCommandSecurity( + "allowedWithoutPermission", + "echo hello", + ); + expect(result).toBe("allowedWithoutPermission"); + }); + it("should allow echo with dangerous-looking but quoted strings", () => { const result = evaluateTerminalCommandSecurity( "allowedWithPermission", From 73073dd23589176a74d98b0ed72d92a1eba1b1c0 Mon Sep 17 00:00:00 2001 From: Tomasz Stefaniak Date: Wed, 3 Sep 2025 10:52:37 -0700 Subject: [PATCH 22/76] fix: dynamic policies --- .../ui/components/ToolPermissionSelector.tsx | 44 +++++++------------ 1 file changed, 17 insertions(+), 27 deletions(-) diff --git a/extensions/cli/src/ui/components/ToolPermissionSelector.tsx b/extensions/cli/src/ui/components/ToolPermissionSelector.tsx index 96b8541eb..b298a5c4a 100644 --- a/extensions/cli/src/ui/components/ToolPermissionSelector.tsx +++ b/extensions/cli/src/ui/components/ToolPermissionSelector.tsx @@ -29,31 +29,24 @@ interface ToolPermissionSelectorProps { ) => void; } -const getPermissionOptions = (hasDynamicEvaluation: boolean): PermissionOption[] => { - const baseOptions: PermissionOption[] = [ +const getPermissionOptions = (): PermissionOption[] => { + return [ { id: "approve", name: "Continue", color: "green", approved: true }, - ]; - - // Only show "don't ask again" option for tools without dynamic evaluation - if (!hasDynamicEvaluation) { - baseOptions.push({ + { id: "approve_policy", name: "Continue + don't ask again", color: "cyan", approved: true, createPolicy: true, - }); - } - - baseOptions.push({ - id: "deny_stop", - name: "No, and tell Continue what to do differently", - color: "yellow", - approved: false, - stopStream: true, - }); - - return baseOptions; + }, + { + id: "deny_stop", + name: "No, and tell Continue what to do differently", + color: "yellow", + approved: false, + stopStream: true, + }, + ]; }; export const ToolPermissionSelector: React.FC = ({ @@ -64,7 +57,7 @@ export const ToolPermissionSelector: React.FC = ({ hasDynamicEvaluation = false, onResponse, }) => { - const permissionOptions = getPermissionOptions(hasDynamicEvaluation); + const permissionOptions = getPermissionOptions(); const [selectedIndex, setSelectedIndex] = useState(0); useInput((input, key) => { @@ -85,8 +78,8 @@ export const ToolPermissionSelector: React.FC = ({ return; } - // Shift+Tab to continue with policy creation (only if not dynamic) - if (key.tab && key.shift && !hasDynamicEvaluation) { + // Shift+Tab to continue with policy creation + if (key.tab && key.shift) { onResponse(requestId, true, true, false); return; } @@ -140,10 +133,7 @@ export const ToolPermissionSelector: React.FC = ({ {hasDynamicEvaluation && ( - Note: This tool evaluates permissions based on the specific command. - - - Some commands will always require permission. + Note: Dangerous commands will be blocked regardless of your preference. )} @@ -151,7 +141,7 @@ export const ToolPermissionSelector: React.FC = ({ const isSelected = index === selectedIndex; let shortcut = ""; if (option.id === "approve") shortcut = "(tab)"; - else if (option.id === "approve_policy" && !hasDynamicEvaluation) shortcut = "(shift+tab)"; + else if (option.id === "approve_policy") shortcut = "(shift+tab)"; else if (option.id === "deny_stop") shortcut = "(esc)"; return ( From 05b6069acc9004e22f4bc85ac1c7a0488bb3dfa0 Mon Sep 17 00:00:00 2001 From: Tomasz Stefaniak Date: Wed, 3 Sep 2025 11:07:03 -0700 Subject: [PATCH 23/76] feat: hybrid permissions model --- .../src/permissions/permissionChecker.test.ts | 310 ++++++++++++++++++ .../cli/src/permissions/permissionChecker.ts | 14 +- 2 files changed, 319 insertions(+), 5 deletions(-) diff --git a/extensions/cli/src/permissions/permissionChecker.test.ts b/extensions/cli/src/permissions/permissionChecker.test.ts index c860a6454..b15376c4f 100644 --- a/extensions/cli/src/permissions/permissionChecker.test.ts +++ b/extensions/cli/src/permissions/permissionChecker.test.ts @@ -1,3 +1,4 @@ +import { vi, describe, it, expect, beforeEach, afterEach } from "vitest"; import { checkToolPermission, filterExcludedTools, @@ -5,6 +6,7 @@ import { matchesToolPattern, } from "./permissionChecker.js"; import { ToolPermissions } from "./types.js"; +import * as toolsModule from "../tools/index.js"; describe("Permission Checker", () => { describe("matchesToolPattern", () => { @@ -593,4 +595,312 @@ describe("Permission Checker", () => { expect(filtered).toEqual(tools); }); }); + + describe("Hybrid Permission Model with Dynamic Evaluation", () => { + // Mock the runTerminalCommand tool with evaluateToolCallPolicy + const mockBashTool = { + name: "Bash", + displayName: "Bash", + description: "Execute bash commands", + parameters: {}, + isBuiltIn: true, + evaluateToolCallPolicy: vi.fn(), + run: vi.fn(), + }; + + beforeEach(() => { + vi.clearAllMocks(); + // Mock getAllBuiltinTools to return our test tool + vi.spyOn(toolsModule, "getAllBuiltinTools").mockReturnValue([mockBashTool]); + + // Reset mock between tests + mockBashTool.evaluateToolCallPolicy.mockClear(); + }); + + afterEach(() => { + vi.restoreAllMocks(); + }); + + describe("User has Bash in 'allow' mode", () => { + const permissions: ToolPermissions = { + policies: [ + { tool: "Bash", permission: "allow" }, + { tool: "*", permission: "ask" } + ] + }; + + it("should allow safe commands (echo hello)", () => { + mockBashTool.evaluateToolCallPolicy.mockReturnValue("allowedWithoutPermission"); + + const result = checkToolPermission( + { name: "Bash", arguments: { command: "echo hello" } }, + permissions + ); + + expect(result.permission).toBe("allow"); // User preference wins + expect(mockBashTool.evaluateToolCallPolicy).toHaveBeenCalledWith( + "allowedWithoutPermission", // converted from "allow" + { command: "echo hello" } + ); + }); + + it("should allow risky commands based on user preference (curl)", () => { + mockBashTool.evaluateToolCallPolicy.mockReturnValue("allowedWithPermission"); + + const result = checkToolPermission( + { name: "Bash", arguments: { command: "curl https://example.com" } }, + permissions + ); + + expect(result.permission).toBe("allow"); // User preference wins over "ask" + expect(mockBashTool.evaluateToolCallPolicy).toHaveBeenCalledWith( + "allowedWithoutPermission", // converted from "allow" + { command: "curl https://example.com" } + ); + }); + + it("should block dangerous commands despite user preference (eval)", () => { + mockBashTool.evaluateToolCallPolicy.mockReturnValue("disabled"); + + const result = checkToolPermission( + { name: "Bash", arguments: { command: "eval 'echo safe'" } }, + permissions + ); + + expect(result.permission).toBe("exclude"); // Security wins + expect(mockBashTool.evaluateToolCallPolicy).toHaveBeenCalledWith( + "allowedWithoutPermission", // converted from "allow" + { command: "eval 'echo safe'" } + ); + }); + + it("should block sudo commands despite user preference", () => { + mockBashTool.evaluateToolCallPolicy.mockReturnValue("disabled"); + + const result = checkToolPermission( + { name: "Bash", arguments: { command: "sudo rm -rf /" } }, + permissions + ); + + expect(result.permission).toBe("exclude"); // Security wins + }); + }); + + describe("User has Bash in 'ask' mode (default)", () => { + const permissions: ToolPermissions = { + policies: [ + { tool: "Bash", permission: "ask" }, + { tool: "*", permission: "ask" } + ] + }; + + it("should ask for safe commands based on user preference (echo)", () => { + mockBashTool.evaluateToolCallPolicy.mockReturnValue("allowedWithoutPermission"); + + const result = checkToolPermission( + { name: "Bash", arguments: { command: "echo hello" } }, + permissions + ); + + expect(result.permission).toBe("ask"); // User preference wins + expect(mockBashTool.evaluateToolCallPolicy).toHaveBeenCalledWith( + "allowedWithPermission", // converted from "ask" + { command: "echo hello" } + ); + }); + + it("should ask for risky commands (curl)", () => { + mockBashTool.evaluateToolCallPolicy.mockReturnValue("allowedWithPermission"); + + const result = checkToolPermission( + { name: "Bash", arguments: { command: "curl https://example.com" } }, + permissions + ); + + expect(result.permission).toBe("ask"); // Both agree on "ask" + expect(mockBashTool.evaluateToolCallPolicy).toHaveBeenCalledWith( + "allowedWithPermission", // converted from "ask" + { command: "curl https://example.com" } + ); + }); + + it("should block dangerous commands (eval)", () => { + mockBashTool.evaluateToolCallPolicy.mockReturnValue("disabled"); + + const result = checkToolPermission( + { name: "Bash", arguments: { command: "eval 'echo safe'" } }, + permissions + ); + + expect(result.permission).toBe("exclude"); // Security wins + expect(mockBashTool.evaluateToolCallPolicy).toHaveBeenCalledWith( + "allowedWithPermission", // converted from "ask" + { command: "eval 'echo safe'" } + ); + }); + + it("should block rm -rf commands", () => { + mockBashTool.evaluateToolCallPolicy.mockReturnValue("disabled"); + + const result = checkToolPermission( + { name: "Bash", arguments: { command: "rm -rf /tmp/important" } }, + permissions + ); + + expect(result.permission).toBe("exclude"); // Security wins + }); + }); + + describe("User has Bash in 'exclude' mode", () => { + const permissions: ToolPermissions = { + policies: [ + { tool: "Bash", permission: "exclude" } + ] + }; + + it("should always exclude regardless of dynamic evaluation", () => { + // Even if dynamic evaluation would allow it + mockBashTool.evaluateToolCallPolicy.mockReturnValue("allowedWithoutPermission"); + + const result = checkToolPermission( + { name: "Bash", arguments: { command: "echo hello" } }, + permissions + ); + + expect(result.permission).toBe("exclude"); // User excluded the tool entirely + expect(mockBashTool.evaluateToolCallPolicy).toHaveBeenCalledWith( + "disabled", // converted from "exclude" + { command: "echo hello" } + ); + }); + }); + + describe("Comprehensive command testing", () => { + const permissions: ToolPermissions = { + policies: [ + { tool: "Bash", permission: "allow" } + ] + }; + + const testCases = [ + // Safe commands + { command: "ls", dynamicResult: "allowedWithoutPermission", expected: "allow" }, + { command: "pwd", dynamicResult: "allowedWithoutPermission", expected: "allow" }, + { command: "date", dynamicResult: "allowedWithoutPermission", expected: "allow" }, + { command: "echo test", dynamicResult: "allowedWithoutPermission", expected: "allow" }, + { command: "git status", dynamicResult: "allowedWithoutPermission", expected: "allow" }, + + // Risky commands (user preference wins when not disabled) + { command: "npm install pkg", dynamicResult: "allowedWithPermission", expected: "allow" }, + { command: "rm file.txt", dynamicResult: "allowedWithPermission", expected: "allow" }, + { command: "curl https://api.example.com", dynamicResult: "allowedWithPermission", expected: "allow" }, + { command: "wget https://example.com/file", dynamicResult: "allowedWithPermission", expected: "allow" }, + + // Dangerous commands (always blocked) + { command: "sudo rm -rf /", dynamicResult: "disabled", expected: "exclude" }, + { command: "exec bash", dynamicResult: "disabled", expected: "exclude" }, + { command: "eval 'malicious code'", dynamicResult: "disabled", expected: "exclude" }, + { command: "rm -rf /", dynamicResult: "disabled", expected: "exclude" }, + ]; + + testCases.forEach(({ command, dynamicResult, expected }) => { + it(`should handle '${command}' correctly`, () => { + mockBashTool.evaluateToolCallPolicy.mockReturnValue(dynamicResult); + + const result = checkToolPermission( + { name: "Bash", arguments: { command } }, + permissions + ); + + expect(result.permission).toBe(expected); + }); + }); + }); + + describe("Edge cases", () => { + it("should handle tools without dynamic evaluation", () => { + // Mock a Read tool without evaluateToolCallPolicy + const mockReadTool = { + name: "Read", + displayName: "Read", + description: "Read files", + parameters: {}, + isBuiltIn: true, + run: vi.fn(), + // No evaluateToolCallPolicy + }; + vi.mocked(toolsModule.getAllBuiltinTools).mockReturnValue([mockReadTool, mockBashTool]); + + const permissions: ToolPermissions = { + policies: [ + { tool: "Read", permission: "allow" } + ] + }; + + const result = checkToolPermission( + { name: "Read", arguments: { path: "/tmp/file.txt" } }, + permissions + ); + + expect(result.permission).toBe("allow"); + expect(mockBashTool.evaluateToolCallPolicy).not.toHaveBeenCalled(); + }); + + it("should use default 'ask' when no policy matches", () => { + const permissions: ToolPermissions = { + policies: [] + }; + + mockBashTool.evaluateToolCallPolicy.mockReturnValue("allowedWithPermission"); + + const result = checkToolPermission( + { name: "Bash", arguments: { command: "echo test" } }, + permissions + ); + + expect(result.permission).toBe("ask"); // Default fallback, user preference wins + expect(mockBashTool.evaluateToolCallPolicy).toHaveBeenCalledWith( + "allowedWithPermission", // converted from default "ask" + { command: "echo test" } + ); + }); + + it("should handle null/undefined arguments gracefully", () => { + mockBashTool.evaluateToolCallPolicy.mockReturnValue("allowedWithPermission"); + + const permissions: ToolPermissions = { + policies: [ + { tool: "Bash", permission: "allow" } + ] + }; + + const result = checkToolPermission( + { name: "Bash", arguments: {} }, + permissions + ); + + expect(result.permission).toBe("allow"); + expect(mockBashTool.evaluateToolCallPolicy).toHaveBeenCalledWith( + "allowedWithoutPermission", + {} + ); + }); + + it("should maintain matched policy information", () => { + mockBashTool.evaluateToolCallPolicy.mockReturnValue("allowedWithoutPermission"); + + const policy = { tool: "Bash", permission: "allow" as const }; + const permissions: ToolPermissions = { + policies: [policy] + }; + + const result = checkToolPermission( + { name: "Bash", arguments: { command: "ls" } }, + permissions + ); + + expect(result.matchedPolicy).toBe(policy); + }); + }); + }); }); diff --git a/extensions/cli/src/permissions/permissionChecker.ts b/extensions/cli/src/permissions/permissionChecker.ts index 339c53932..63bc87a24 100644 --- a/extensions/cli/src/permissions/permissionChecker.ts +++ b/extensions/cli/src/permissions/permissionChecker.ts @@ -196,13 +196,17 @@ export function checkToolPermission( toolCall.arguments, ); - // Convert back to CLI permission - const finalPermission = toolPolicyToPermissionPolicy(evaluatedPolicy); - - console.error("FINAL PERMISSION", finalPermission); + // If dynamic evaluation says disabled, that ALWAYS takes precedence + if (evaluatedPolicy === "disabled") { + return { + permission: "exclude", + matchedPolicy, + }; + } + // Otherwise, user preference wins - return the original base permission return { - permission: finalPermission, + permission: basePermission, matchedPolicy, }; } From 88f868133bbf10806800036fe1107eaa3fcb8065 Mon Sep 17 00:00:00 2001 From: Tomasz Stefaniak Date: Wed, 3 Sep 2025 11:08:47 -0700 Subject: [PATCH 24/76] fix: formatting --- .../src/permissions/permissionChecker.test.ts | 255 +++++++++++------- .../cli/src/streamChatResponse.helpers.ts | 27 +- .../ui/components/ToolPermissionSelector.tsx | 3 +- 3 files changed, 174 insertions(+), 111 deletions(-) diff --git a/extensions/cli/src/permissions/permissionChecker.test.ts b/extensions/cli/src/permissions/permissionChecker.test.ts index b15376c4f..696b66070 100644 --- a/extensions/cli/src/permissions/permissionChecker.test.ts +++ b/extensions/cli/src/permissions/permissionChecker.test.ts @@ -611,8 +611,10 @@ describe("Permission Checker", () => { beforeEach(() => { vi.clearAllMocks(); // Mock getAllBuiltinTools to return our test tool - vi.spyOn(toolsModule, "getAllBuiltinTools").mockReturnValue([mockBashTool]); - + vi.spyOn(toolsModule, "getAllBuiltinTools").mockReturnValue([ + mockBashTool, + ]); + // Reset mock between tests mockBashTool.evaluateToolCallPolicy.mockClear(); }); @@ -625,63 +627,67 @@ describe("Permission Checker", () => { const permissions: ToolPermissions = { policies: [ { tool: "Bash", permission: "allow" }, - { tool: "*", permission: "ask" } - ] + { tool: "*", permission: "ask" }, + ], }; it("should allow safe commands (echo hello)", () => { - mockBashTool.evaluateToolCallPolicy.mockReturnValue("allowedWithoutPermission"); - + mockBashTool.evaluateToolCallPolicy.mockReturnValue( + "allowedWithoutPermission", + ); + const result = checkToolPermission( { name: "Bash", arguments: { command: "echo hello" } }, - permissions + permissions, ); - + expect(result.permission).toBe("allow"); // User preference wins expect(mockBashTool.evaluateToolCallPolicy).toHaveBeenCalledWith( "allowedWithoutPermission", // converted from "allow" - { command: "echo hello" } + { command: "echo hello" }, ); }); it("should allow risky commands based on user preference (curl)", () => { - mockBashTool.evaluateToolCallPolicy.mockReturnValue("allowedWithPermission"); - + mockBashTool.evaluateToolCallPolicy.mockReturnValue( + "allowedWithPermission", + ); + const result = checkToolPermission( { name: "Bash", arguments: { command: "curl https://example.com" } }, - permissions + permissions, ); - + expect(result.permission).toBe("allow"); // User preference wins over "ask" expect(mockBashTool.evaluateToolCallPolicy).toHaveBeenCalledWith( "allowedWithoutPermission", // converted from "allow" - { command: "curl https://example.com" } + { command: "curl https://example.com" }, ); }); it("should block dangerous commands despite user preference (eval)", () => { mockBashTool.evaluateToolCallPolicy.mockReturnValue("disabled"); - + const result = checkToolPermission( { name: "Bash", arguments: { command: "eval 'echo safe'" } }, - permissions + permissions, ); - + expect(result.permission).toBe("exclude"); // Security wins expect(mockBashTool.evaluateToolCallPolicy).toHaveBeenCalledWith( "allowedWithoutPermission", // converted from "allow" - { command: "eval 'echo safe'" } + { command: "eval 'echo safe'" }, ); }); it("should block sudo commands despite user preference", () => { mockBashTool.evaluateToolCallPolicy.mockReturnValue("disabled"); - + const result = checkToolPermission( { name: "Bash", arguments: { command: "sudo rm -rf /" } }, - permissions + permissions, ); - + expect(result.permission).toBe("exclude"); // Security wins }); }); @@ -690,128 +696,178 @@ describe("Permission Checker", () => { const permissions: ToolPermissions = { policies: [ { tool: "Bash", permission: "ask" }, - { tool: "*", permission: "ask" } - ] + { tool: "*", permission: "ask" }, + ], }; it("should ask for safe commands based on user preference (echo)", () => { - mockBashTool.evaluateToolCallPolicy.mockReturnValue("allowedWithoutPermission"); - + mockBashTool.evaluateToolCallPolicy.mockReturnValue( + "allowedWithoutPermission", + ); + const result = checkToolPermission( { name: "Bash", arguments: { command: "echo hello" } }, - permissions + permissions, ); - + expect(result.permission).toBe("ask"); // User preference wins expect(mockBashTool.evaluateToolCallPolicy).toHaveBeenCalledWith( "allowedWithPermission", // converted from "ask" - { command: "echo hello" } + { command: "echo hello" }, ); }); it("should ask for risky commands (curl)", () => { - mockBashTool.evaluateToolCallPolicy.mockReturnValue("allowedWithPermission"); - + mockBashTool.evaluateToolCallPolicy.mockReturnValue( + "allowedWithPermission", + ); + const result = checkToolPermission( { name: "Bash", arguments: { command: "curl https://example.com" } }, - permissions + permissions, ); - + expect(result.permission).toBe("ask"); // Both agree on "ask" expect(mockBashTool.evaluateToolCallPolicy).toHaveBeenCalledWith( "allowedWithPermission", // converted from "ask" - { command: "curl https://example.com" } + { command: "curl https://example.com" }, ); }); it("should block dangerous commands (eval)", () => { mockBashTool.evaluateToolCallPolicy.mockReturnValue("disabled"); - + const result = checkToolPermission( { name: "Bash", arguments: { command: "eval 'echo safe'" } }, - permissions + permissions, ); - + expect(result.permission).toBe("exclude"); // Security wins expect(mockBashTool.evaluateToolCallPolicy).toHaveBeenCalledWith( "allowedWithPermission", // converted from "ask" - { command: "eval 'echo safe'" } + { command: "eval 'echo safe'" }, ); }); it("should block rm -rf commands", () => { mockBashTool.evaluateToolCallPolicy.mockReturnValue("disabled"); - + const result = checkToolPermission( { name: "Bash", arguments: { command: "rm -rf /tmp/important" } }, - permissions + permissions, ); - + expect(result.permission).toBe("exclude"); // Security wins }); }); describe("User has Bash in 'exclude' mode", () => { const permissions: ToolPermissions = { - policies: [ - { tool: "Bash", permission: "exclude" } - ] + policies: [{ tool: "Bash", permission: "exclude" }], }; it("should always exclude regardless of dynamic evaluation", () => { // Even if dynamic evaluation would allow it - mockBashTool.evaluateToolCallPolicy.mockReturnValue("allowedWithoutPermission"); - + mockBashTool.evaluateToolCallPolicy.mockReturnValue( + "allowedWithoutPermission", + ); + const result = checkToolPermission( { name: "Bash", arguments: { command: "echo hello" } }, - permissions + permissions, ); - + expect(result.permission).toBe("exclude"); // User excluded the tool entirely expect(mockBashTool.evaluateToolCallPolicy).toHaveBeenCalledWith( "disabled", // converted from "exclude" - { command: "echo hello" } + { command: "echo hello" }, ); }); }); describe("Comprehensive command testing", () => { const permissions: ToolPermissions = { - policies: [ - { tool: "Bash", permission: "allow" } - ] + policies: [{ tool: "Bash", permission: "allow" }], }; const testCases = [ // Safe commands - { command: "ls", dynamicResult: "allowedWithoutPermission", expected: "allow" }, - { command: "pwd", dynamicResult: "allowedWithoutPermission", expected: "allow" }, - { command: "date", dynamicResult: "allowedWithoutPermission", expected: "allow" }, - { command: "echo test", dynamicResult: "allowedWithoutPermission", expected: "allow" }, - { command: "git status", dynamicResult: "allowedWithoutPermission", expected: "allow" }, - + { + command: "ls", + dynamicResult: "allowedWithoutPermission", + expected: "allow", + }, + { + command: "pwd", + dynamicResult: "allowedWithoutPermission", + expected: "allow", + }, + { + command: "date", + dynamicResult: "allowedWithoutPermission", + expected: "allow", + }, + { + command: "echo test", + dynamicResult: "allowedWithoutPermission", + expected: "allow", + }, + { + command: "git status", + dynamicResult: "allowedWithoutPermission", + expected: "allow", + }, + // Risky commands (user preference wins when not disabled) - { command: "npm install pkg", dynamicResult: "allowedWithPermission", expected: "allow" }, - { command: "rm file.txt", dynamicResult: "allowedWithPermission", expected: "allow" }, - { command: "curl https://api.example.com", dynamicResult: "allowedWithPermission", expected: "allow" }, - { command: "wget https://example.com/file", dynamicResult: "allowedWithPermission", expected: "allow" }, - + { + command: "npm install pkg", + dynamicResult: "allowedWithPermission", + expected: "allow", + }, + { + command: "rm file.txt", + dynamicResult: "allowedWithPermission", + expected: "allow", + }, + { + command: "curl https://api.example.com", + dynamicResult: "allowedWithPermission", + expected: "allow", + }, + { + command: "wget https://example.com/file", + dynamicResult: "allowedWithPermission", + expected: "allow", + }, + // Dangerous commands (always blocked) - { command: "sudo rm -rf /", dynamicResult: "disabled", expected: "exclude" }, - { command: "exec bash", dynamicResult: "disabled", expected: "exclude" }, - { command: "eval 'malicious code'", dynamicResult: "disabled", expected: "exclude" }, + { + command: "sudo rm -rf /", + dynamicResult: "disabled", + expected: "exclude", + }, + { + command: "exec bash", + dynamicResult: "disabled", + expected: "exclude", + }, + { + command: "eval 'malicious code'", + dynamicResult: "disabled", + expected: "exclude", + }, { command: "rm -rf /", dynamicResult: "disabled", expected: "exclude" }, ]; testCases.forEach(({ command, dynamicResult, expected }) => { it(`should handle '${command}' correctly`, () => { mockBashTool.evaluateToolCallPolicy.mockReturnValue(dynamicResult); - + const result = checkToolPermission( { name: "Bash", arguments: { command } }, - permissions + permissions, ); - + expect(result.permission).toBe(expected); }); }); @@ -829,76 +885,81 @@ describe("Permission Checker", () => { run: vi.fn(), // No evaluateToolCallPolicy }; - vi.mocked(toolsModule.getAllBuiltinTools).mockReturnValue([mockReadTool, mockBashTool]); + vi.mocked(toolsModule.getAllBuiltinTools).mockReturnValue([ + mockReadTool, + mockBashTool, + ]); const permissions: ToolPermissions = { - policies: [ - { tool: "Read", permission: "allow" } - ] + policies: [{ tool: "Read", permission: "allow" }], }; - + const result = checkToolPermission( { name: "Read", arguments: { path: "/tmp/file.txt" } }, - permissions + permissions, ); - + expect(result.permission).toBe("allow"); expect(mockBashTool.evaluateToolCallPolicy).not.toHaveBeenCalled(); }); it("should use default 'ask' when no policy matches", () => { const permissions: ToolPermissions = { - policies: [] + policies: [], }; - - mockBashTool.evaluateToolCallPolicy.mockReturnValue("allowedWithPermission"); - + + mockBashTool.evaluateToolCallPolicy.mockReturnValue( + "allowedWithPermission", + ); + const result = checkToolPermission( { name: "Bash", arguments: { command: "echo test" } }, - permissions + permissions, ); - + expect(result.permission).toBe("ask"); // Default fallback, user preference wins expect(mockBashTool.evaluateToolCallPolicy).toHaveBeenCalledWith( "allowedWithPermission", // converted from default "ask" - { command: "echo test" } + { command: "echo test" }, ); }); it("should handle null/undefined arguments gracefully", () => { - mockBashTool.evaluateToolCallPolicy.mockReturnValue("allowedWithPermission"); - + mockBashTool.evaluateToolCallPolicy.mockReturnValue( + "allowedWithPermission", + ); + const permissions: ToolPermissions = { - policies: [ - { tool: "Bash", permission: "allow" } - ] + policies: [{ tool: "Bash", permission: "allow" }], }; - + const result = checkToolPermission( { name: "Bash", arguments: {} }, - permissions + permissions, ); - + expect(result.permission).toBe("allow"); expect(mockBashTool.evaluateToolCallPolicy).toHaveBeenCalledWith( "allowedWithoutPermission", - {} + {}, ); }); it("should maintain matched policy information", () => { - mockBashTool.evaluateToolCallPolicy.mockReturnValue("allowedWithoutPermission"); - + mockBashTool.evaluateToolCallPolicy.mockReturnValue( + "allowedWithoutPermission", + ); + const policy = { tool: "Bash", permission: "allow" as const }; const permissions: ToolPermissions = { - policies: [policy] + policies: [policy], }; - + const result = checkToolPermission( { name: "Bash", arguments: { command: "ls" } }, - permissions + permissions, ); - + expect(result.matchedPolicy).toBe(policy); }); }); diff --git a/extensions/cli/src/streamChatResponse.helpers.ts b/extensions/cli/src/streamChatResponse.helpers.ts index b5ae94539..e120f532e 100644 --- a/extensions/cli/src/streamChatResponse.helpers.ts +++ b/extensions/cli/src/streamChatResponse.helpers.ts @@ -23,12 +23,13 @@ export function handlePermissionDenied( toolCall: PreprocessedToolCall, chatHistoryEntries: ChatCompletionToolMessageParam[], callbacks?: StreamCallbacks, - reason: 'user' | 'policy' = 'user', + reason: "user" | "policy" = "user", ): void { - const deniedMessage = reason === 'policy' - ? `Command blocked by security policy` - : `Permission denied by user`; - + const deniedMessage = + reason === "policy" + ? `Command blocked by security policy` + : `Permission denied by user`; + logger.info("Tool call denied", { name: toolCall.name, arguments: toolCall.arguments, @@ -117,7 +118,7 @@ export async function checkToolPermissionApproval( toolCall: PreprocessedToolCall, callbacks?: StreamCallbacks, isHeadless?: boolean, -): Promise<{ approved: boolean; denialReason?: 'user' | 'policy' }> { +): Promise<{ approved: boolean; denialReason?: "user" | "policy" }> { const permissionCheck = checkToolPermission(toolCall); if (permissionCheck.permission === "allow") { @@ -127,15 +128,15 @@ export async function checkToolPermissionApproval( handleHeadlessPermission(toolCall); } const userApproved = await requestUserPermission(toolCall, callbacks); - return userApproved + return userApproved ? { approved: true } - : { approved: false, denialReason: 'user' }; + : { approved: false, denialReason: "user" }; } else if (permissionCheck.permission === "exclude") { // Tool blocked by security policy - return { approved: false, denialReason: 'policy' }; + return { approved: false, denialReason: "policy" }; } - return { approved: false, denialReason: 'policy' }; + return { approved: false, denialReason: "policy" }; } // Helper function to track first token time @@ -417,10 +418,10 @@ export async function executeStreamedToolCalls( if (!permissionResult.approved) { handlePermissionDenied( - toolCall, - chatHistoryEntries, + toolCall, + chatHistoryEntries, callbacks, - permissionResult.denialReason || 'user', + permissionResult.denialReason || "user", ); hasRejection = true; continue; diff --git a/extensions/cli/src/ui/components/ToolPermissionSelector.tsx b/extensions/cli/src/ui/components/ToolPermissionSelector.tsx index b298a5c4a..ae3cb2846 100644 --- a/extensions/cli/src/ui/components/ToolPermissionSelector.tsx +++ b/extensions/cli/src/ui/components/ToolPermissionSelector.tsx @@ -133,7 +133,8 @@ export const ToolPermissionSelector: React.FC = ({ {hasDynamicEvaluation && ( - Note: Dangerous commands will be blocked regardless of your preference. + Note: Dangerous commands will be blocked regardless of your + preference. )} From 93296e50194bc13aa0700094d5d413bf1838626d Mon Sep 17 00:00:00 2001 From: Tomasz Stefaniak Date: Wed, 3 Sep 2025 11:24:05 -0700 Subject: [PATCH 25/76] fix: linter errors --- extensions/cli/src/ui/components/ToolPermissionSelector.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/cli/src/ui/components/ToolPermissionSelector.tsx b/extensions/cli/src/ui/components/ToolPermissionSelector.tsx index ae3cb2846..bf8db40df 100644 --- a/extensions/cli/src/ui/components/ToolPermissionSelector.tsx +++ b/extensions/cli/src/ui/components/ToolPermissionSelector.tsx @@ -132,7 +132,7 @@ export const ToolPermissionSelector: React.FC = ({ Would you like to continue? {hasDynamicEvaluation && ( - + Note: Dangerous commands will be blocked regardless of your preference. From c00bbd78b14b526e920a600137719604c9d68d01 Mon Sep 17 00:00:00 2001 From: Tomasz Stefaniak Date: Wed, 3 Sep 2025 12:47:08 -0700 Subject: [PATCH 26/76] improv: move terminal security to separate package --- core/package-lock.json | 19 + core/package.json | 1 + core/tools/definitions/runTerminalCommand.ts | 2 +- extensions/cli/build.mjs | 4 + extensions/cli/package-lock.json | 23 + extensions/cli/package.json | 3 +- .../src/permissions/permissionChecker.test.ts | 4 +- .../cli/src/permissions/permissionChecker.ts | 17 - .../cli/src/tools/runTerminalCommand.ts | 4 +- .../src/ui/hooks/useChat.stream.helpers.ts | 1 + packages/terminal-security/package-lock.json | 1808 +++++++++++++++++ packages/terminal-security/package.json | 25 + .../src/evaluateTerminalCommandSecurity.ts | 2 +- packages/terminal-security/src/index.ts | 2 + packages/terminal-security/src/types.ts | 7 + .../test/terminalCommandSecurity.test.ts | 3 +- packages/terminal-security/tsconfig.json | 21 + packages/terminal-security/vitest.config.ts | 8 + 18 files changed, 1929 insertions(+), 25 deletions(-) create mode 100644 packages/terminal-security/package-lock.json create mode 100644 packages/terminal-security/package.json rename core/tools/security/terminalCommandSecurity.ts => packages/terminal-security/src/evaluateTerminalCommandSecurity.ts (99%) create mode 100644 packages/terminal-security/src/index.ts create mode 100644 packages/terminal-security/src/types.ts rename core/tools/implementations/terminalCommandSecurity.vitest.ts => packages/terminal-security/test/terminalCommandSecurity.test.ts (99%) create mode 100644 packages/terminal-security/tsconfig.json create mode 100644 packages/terminal-security/vitest.config.ts diff --git a/core/package-lock.json b/core/package-lock.json index 18b67c317..bf948e8a9 100644 --- a/core/package-lock.json +++ b/core/package-lock.json @@ -17,6 +17,7 @@ "@continuedev/fetch": "file:../packages/fetch", "@continuedev/llm-info": "file:../packages/llm-info", "@continuedev/openai-adapters": "file:../packages/openai-adapters", + "@continuedev/terminal-security": "file:../packages/terminal-security", "@modelcontextprotocol/sdk": "^1.12.0", "@mozilla/readability": "^0.5.0", "@octokit/rest": "^20.1.1", @@ -238,6 +239,20 @@ "vitest": "^3.2.4" } }, + "../packages/terminal-security": { + "name": "@continuedev/terminal-security", + "version": "1.0.0", + "license": "Apache-2.0", + "dependencies": { + "shell-quote": "^1.8.1" + }, + "devDependencies": { + "@types/node": "^20.11.19", + "@types/shell-quote": "^1.7.5", + "typescript": "^5.5.2", + "vitest": "^1.6.0" + } + }, "node_modules/@75lb/deep-merge": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@75lb/deep-merge/-/deep-merge-1.1.2.tgz", @@ -2957,6 +2972,10 @@ "resolved": "../packages/openai-adapters", "link": true }, + "node_modules/@continuedev/terminal-security": { + "resolved": "../packages/terminal-security", + "link": true + }, "node_modules/@dabh/diagnostics": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.3.tgz", diff --git a/core/package.json b/core/package.json index c8345baec..db53c661a 100644 --- a/core/package.json +++ b/core/package.json @@ -62,6 +62,7 @@ "@continuedev/fetch": "file:../packages/fetch", "@continuedev/llm-info": "file:../packages/llm-info", "@continuedev/openai-adapters": "file:../packages/openai-adapters", + "@continuedev/terminal-security": "file:../packages/terminal-security", "@modelcontextprotocol/sdk": "^1.12.0", "@mozilla/readability": "^0.5.0", "@octokit/rest": "^20.1.1", diff --git a/core/tools/definitions/runTerminalCommand.ts b/core/tools/definitions/runTerminalCommand.ts index c67c8084f..915c0828b 100644 --- a/core/tools/definitions/runTerminalCommand.ts +++ b/core/tools/definitions/runTerminalCommand.ts @@ -1,7 +1,7 @@ import os from "os"; import { Tool, ToolPolicy } from "../.."; import { BUILT_IN_GROUP_NAME, BuiltInToolNames } from "../builtIn"; -import { evaluateTerminalCommandSecurity } from "../security/terminalCommandSecurity"; +import { evaluateTerminalCommandSecurity } from "@continuedev/terminal-security"; /** * Get the preferred shell for the current platform diff --git a/extensions/cli/build.mjs b/extensions/cli/build.mjs index f5f20778c..5f4e18656 100644 --- a/extensions/cli/build.mjs +++ b/extensions/cli/build.mjs @@ -68,6 +68,10 @@ try { __dirname, "../../packages/llm-info/dist/index.js", ), + "@continuedev/terminal-security": resolve( + __dirname, + "../../packages/terminal-security/dist/index.js", + ), }, // Add banner to create require for CommonJS packages diff --git a/extensions/cli/package-lock.json b/extensions/cli/package-lock.json index 6da2ba6db..4cf366c90 100644 --- a/extensions/cli/package-lock.json +++ b/extensions/cli/package-lock.json @@ -18,6 +18,7 @@ "@continuedev/config-yaml": "file:../../packages/config-yaml", "@continuedev/openai-adapters": "file:../../packages/openai-adapters", "@continuedev/sdk": "^0.0.13", + "@continuedev/terminal-security": "file:../../packages/terminal-security", "@modelcontextprotocol/sdk": "^1.17.2", "@opentelemetry/api": "^1.9.0", "@opentelemetry/exporter-metrics-otlp-grpc": "^0.203.0", @@ -114,6 +115,7 @@ "@continuedev/fetch": "file:../packages/fetch", "@continuedev/llm-info": "file:../packages/llm-info", "@continuedev/openai-adapters": "file:../packages/openai-adapters", + "@continuedev/terminal-security": "file:../packages/terminal-security", "@modelcontextprotocol/sdk": "^1.12.0", "@mozilla/readability": "^0.5.0", "@octokit/rest": "^20.1.1", @@ -164,6 +166,7 @@ "quick-lru": "^7.0.0", "replicate": "^0.26.0", "request": "^2.88.2", + "shell-quote": "^1.8.3", "socket.io-client": "^4.7.3", "sqlite": "^5.1.1", "sqlite3": "^5.1.7", @@ -198,6 +201,7 @@ "@types/pg": "^8.11.6", "@types/plist": "^3.0.5", "@types/request": "^2.48.12", + "@types/shell-quote": "^1.7.5", "@types/tar": "^6.1.13", "@types/uuid": "^9.0.7", "@types/win-ca": "^3.5.4", @@ -285,6 +289,21 @@ "vitest": "^3.2.4" } }, + "../../packages/terminal-security": { + "name": "@continuedev/terminal-security", + "version": "1.0.0", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "shell-quote": "^1.8.1" + }, + "devDependencies": { + "@types/node": "^20.11.19", + "@types/shell-quote": "^1.7.5", + "typescript": "^5.5.2", + "vitest": "^1.6.0" + } + }, "node_modules/@alcalzone/ansi-tokenize": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/@alcalzone/ansi-tokenize/-/ansi-tokenize-0.2.0.tgz", @@ -377,6 +396,10 @@ "openai": "^4.96.2" } }, + "node_modules/@continuedev/terminal-security": { + "resolved": "../../packages/terminal-security", + "link": true + }, "node_modules/@cspotcode/source-map-support": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", diff --git a/extensions/cli/package.json b/extensions/cli/package.json index bdc480e60..985ec60b9 100644 --- a/extensions/cli/package.json +++ b/extensions/cli/package.json @@ -15,7 +15,7 @@ "test:e2e": "vitest run --config vitest.e2e.config.ts", "test:smoke": "node smoke-test.mjs", "build:tsc": "tsc -p tsconfig.build.json", - "build:local-deps": "cd ../../packages/config-types && npm i && npm run build && cd ../fetch && npm i && npm run build && cd ../llm-info && npm i && npm run build && cd ../config-yaml && npm i && npm run build && cd ../openai-adapters && npm i && npm run build && cd ../../core && npm i && npm run build && cd ../extensions/cli && npm i", + "build:local-deps": "cd ../../packages/config-types && npm i && npm run build && cd ../fetch && npm i && npm run build && cd ../llm-info && npm i && npm run build && cd ../terminal-security && npm i && npm run build && cd ../config-yaml && npm i && npm run build && cd ../openai-adapters && npm i && npm run build && cd ../../core && npm i && npm run build && cd ../extensions/cli && npm i", "build:validate": "node validate-aliases.mjs", "build:bundle": "node build.mjs", "build": "npm run build:validate && npm run build:bundle", @@ -50,6 +50,7 @@ "@continuedev/config-yaml": "file:../../packages/config-yaml", "@continuedev/openai-adapters": "file:../../packages/openai-adapters", "@continuedev/sdk": "^0.0.13", + "@continuedev/terminal-security": "file:../../packages/terminal-security", "@modelcontextprotocol/sdk": "^1.17.2", "@opentelemetry/api": "^1.9.0", "@opentelemetry/exporter-metrics-otlp-grpc": "^0.203.0", diff --git a/extensions/cli/src/permissions/permissionChecker.test.ts b/extensions/cli/src/permissions/permissionChecker.test.ts index 696b66070..b28034b40 100644 --- a/extensions/cli/src/permissions/permissionChecker.test.ts +++ b/extensions/cli/src/permissions/permissionChecker.test.ts @@ -1,4 +1,7 @@ import { vi, describe, it, expect, beforeEach, afterEach } from "vitest"; + +import * as toolsModule from "../tools/index.js"; + import { checkToolPermission, filterExcludedTools, @@ -6,7 +9,6 @@ import { matchesToolPattern, } from "./permissionChecker.js"; import { ToolPermissions } from "./types.js"; -import * as toolsModule from "../tools/index.js"; describe("Permission Checker", () => { describe("matchesToolPattern", () => { diff --git a/extensions/cli/src/permissions/permissionChecker.ts b/extensions/cli/src/permissions/permissionChecker.ts index 63bc87a24..e5d5d3b79 100644 --- a/extensions/cli/src/permissions/permissionChecker.ts +++ b/extensions/cli/src/permissions/permissionChecker.ts @@ -1,5 +1,4 @@ import type { ToolPolicy } from "../../../../core/index.js"; - import { getServiceSync } from "../services/index.js"; import type { ToolPermissionServiceState } from "../services/types.js"; import { SERVICE_NAMES } from "../services/types.js"; @@ -125,22 +124,6 @@ function permissionPolicyToToolPolicy( } } -/** - * Converts core's ToolPolicy to CLI's PermissionPolicy - */ -function toolPolicyToPermissionPolicy(policy: ToolPolicy): PermissionPolicy { - switch (policy) { - case "allowedWithoutPermission": - return "allow"; - case "allowedWithPermission": - return "ask"; - case "disabled": - return "exclude"; - default: - return "ask"; - } -} - /** * Evaluates a tool call request against a set of permission policies. * Returns the permission for the first matching policy. diff --git a/extensions/cli/src/tools/runTerminalCommand.ts b/extensions/cli/src/tools/runTerminalCommand.ts index c3ee7cc39..6fbf613fa 100644 --- a/extensions/cli/src/tools/runTerminalCommand.ts +++ b/extensions/cli/src/tools/runTerminalCommand.ts @@ -1,6 +1,6 @@ import { spawn } from "child_process"; -import type { ToolPolicy } from "../../../../core/index.js"; -import { evaluateTerminalCommandSecurity } from "../../../../core/tools/security/terminalCommandSecurity.js"; + +import { evaluateTerminalCommandSecurity, type ToolPolicy } from "@continuedev/terminal-security"; import { telemetryService } from "../telemetry/telemetryService.js"; import { diff --git a/extensions/cli/src/ui/hooks/useChat.stream.helpers.ts b/extensions/cli/src/ui/hooks/useChat.stream.helpers.ts index 5ee8abe5d..a6c5939a9 100644 --- a/extensions/cli/src/ui/hooks/useChat.stream.helpers.ts +++ b/extensions/cli/src/ui/hooks/useChat.stream.helpers.ts @@ -1,4 +1,5 @@ import type { ChatHistoryItem, ToolCallState, ToolStatus } from "core/index.js"; + import { getAllBuiltinTools } from "src/tools/index.js"; interface CreateStreamCallbacksOptions { diff --git a/packages/terminal-security/package-lock.json b/packages/terminal-security/package-lock.json new file mode 100644 index 000000000..0d4f62419 --- /dev/null +++ b/packages/terminal-security/package-lock.json @@ -0,0 +1,1808 @@ +{ + "name": "@continuedev/terminal-security", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "@continuedev/terminal-security", + "version": "1.0.0", + "license": "Apache-2.0", + "dependencies": { + "shell-quote": "^1.8.1" + }, + "devDependencies": { + "@types/node": "^20.11.19", + "@types/shell-quote": "^1.7.5", + "typescript": "^5.5.2", + "vitest": "^1.6.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@jest/schemas": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@sinclair/typebox": "^0.27.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "dev": true, + "license": "MIT" + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.50.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.50.0.tgz", + "integrity": "sha512-lVgpeQyy4fWN5QYebtW4buT/4kn4p4IJ+kDNB4uYNT5b8c8DLJDg6titg20NIg7E8RWwdWZORW6vUFfrLyG3KQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.50.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.50.0.tgz", + "integrity": "sha512-2O73dR4Dc9bp+wSYhviP6sDziurB5/HCym7xILKifWdE9UsOe2FtNcM+I4xZjKrfLJnq5UR8k9riB87gauiQtw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.50.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.50.0.tgz", + "integrity": "sha512-vwSXQN8T4sKf1RHr1F0s98Pf8UPz7pS6P3LG9NSmuw0TVh7EmaE+5Ny7hJOZ0M2yuTctEsHHRTMi2wuHkdS6Hg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.50.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.50.0.tgz", + "integrity": "sha512-cQp/WG8HE7BCGyFVuzUg0FNmupxC+EPZEwWu2FCGGw5WDT1o2/YlENbm5e9SMvfDFR6FRhVCBePLqj0o8MN7Vw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.50.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.50.0.tgz", + "integrity": "sha512-UR1uTJFU/p801DvvBbtDD7z9mQL8J80xB0bR7DqW7UGQHRm/OaKzp4is7sQSdbt2pjjSS72eAtRh43hNduTnnQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.50.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.50.0.tgz", + "integrity": "sha512-G/DKyS6PK0dD0+VEzH/6n/hWDNPDZSMBmqsElWnCRGrYOb2jC0VSupp7UAHHQ4+QILwkxSMaYIbQ72dktp8pKA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.50.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.50.0.tgz", + "integrity": "sha512-u72Mzc6jyJwKjJbZZcIYmd9bumJu7KNmHYdue43vT1rXPm2rITwmPWF0mmPzLm9/vJWxIRbao/jrQmxTO0Sm9w==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.50.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.50.0.tgz", + "integrity": "sha512-S4UefYdV0tnynDJV1mdkNawp0E5Qm2MtSs330IyHgaccOFrwqsvgigUD29uT+B/70PDY1eQ3t40+xf6wIvXJyg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.50.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.50.0.tgz", + "integrity": "sha512-1EhkSvUQXJsIhk4msxP5nNAUWoB4MFDHhtc4gAYvnqoHlaL9V3F37pNHabndawsfy/Tp7BPiy/aSa6XBYbaD1g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.50.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.50.0.tgz", + "integrity": "sha512-EtBDIZuDtVg75xIPIK1l5vCXNNCIRM0OBPUG+tbApDuJAy9mKago6QxX+tfMzbCI6tXEhMuZuN1+CU8iDW+0UQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loongarch64-gnu": { + "version": "4.50.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.50.0.tgz", + "integrity": "sha512-BGYSwJdMP0hT5CCmljuSNx7+k+0upweM2M4YGfFBjnFSZMHOLYR0gEEj/dxyYJ6Zc6AiSeaBY8dWOa11GF/ppQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-gnu": { + "version": "4.50.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.50.0.tgz", + "integrity": "sha512-I1gSMzkVe1KzAxKAroCJL30hA4DqSi+wGc5gviD0y3IL/VkvcnAqwBf4RHXHyvH66YVHxpKO8ojrgc4SrWAnLg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.50.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.50.0.tgz", + "integrity": "sha512-bSbWlY3jZo7molh4tc5dKfeSxkqnf48UsLqYbUhnkdnfgZjgufLS/NTA8PcP/dnvct5CCdNkABJ56CbclMRYCA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-musl": { + "version": "4.50.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.50.0.tgz", + "integrity": "sha512-LSXSGumSURzEQLT2e4sFqFOv3LWZsEF8FK7AAv9zHZNDdMnUPYH3t8ZlaeYYZyTXnsob3htwTKeWtBIkPV27iQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.50.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.50.0.tgz", + "integrity": "sha512-CxRKyakfDrsLXiCyucVfVWVoaPA4oFSpPpDwlMcDFQvrv3XY6KEzMtMZrA+e/goC8xxp2WSOxHQubP8fPmmjOQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.50.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.50.0.tgz", + "integrity": "sha512-8PrJJA7/VU8ToHVEPu14FzuSAqVKyo5gg/J8xUerMbyNkWkO9j2ExBho/68RnJsMGNJq4zH114iAttgm7BZVkA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.50.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.50.0.tgz", + "integrity": "sha512-SkE6YQp+CzpyOrbw7Oc4MgXFvTw2UIBElvAvLCo230pyxOLmYwRPwZ/L5lBe/VW/qT1ZgND9wJfOsdy0XptRvw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-openharmony-arm64": { + "version": "4.50.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.50.0.tgz", + "integrity": "sha512-PZkNLPfvXeIOgJWA804zjSFH7fARBBCpCXxgkGDRjjAhRLOR8o0IGS01ykh5GYfod4c2yiiREuDM8iZ+pVsT+Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.50.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.50.0.tgz", + "integrity": "sha512-q7cIIdFvWQoaCbLDUyUc8YfR3Jh2xx3unO8Dn6/TTogKjfwrax9SyfmGGK6cQhKtjePI7jRfd7iRYcxYs93esg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.50.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.50.0.tgz", + "integrity": "sha512-XzNOVg/YnDOmFdDKcxxK410PrcbcqZkBmz+0FicpW5jtjKQxcW1BZJEQOF0NJa6JO7CZhett8GEtRN/wYLYJuw==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.50.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.50.0.tgz", + "integrity": "sha512-xMmiWRR8sp72Zqwjgtf3QbZfF1wdh8X2ABu3EaozvZcyHJeU0r+XAnXdKgs4cCAp6ORoYoCygipYP1mjmbjrsg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@sinclair/typebox": { + "version": "0.27.8", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/estree": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "20.19.12", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.12.tgz", + "integrity": "sha512-lSOjyS6vdO2G2g2CWrETTV3Jz2zlCXHpu1rcubLKpz9oj+z/1CceHlj+yq53W+9zgb98nSov/wjEKYDNauD+Hw==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } + }, + "node_modules/@types/shell-quote": { + "version": "1.7.5", + "resolved": "https://registry.npmjs.org/@types/shell-quote/-/shell-quote-1.7.5.tgz", + "integrity": "sha512-+UE8GAGRPbJVQDdxi16dgadcBfQ+KG2vgZhV1+3A1XmHbmwcdwhCUwIdy+d3pAGrbvgRoVSjeI9vOWyq376Yzw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@vitest/expect": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.6.1.tgz", + "integrity": "sha512-jXL+9+ZNIJKruofqXuuTClf44eSpcHlgj3CiuNihUF3Ioujtmc0zIa3UJOW5RjDK1YLBJZnWBlPuqhYycLioog==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/spy": "1.6.1", + "@vitest/utils": "1.6.1", + "chai": "^4.3.10" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/runner": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.6.1.tgz", + "integrity": "sha512-3nSnYXkVkf3mXFfE7vVyPmi3Sazhb/2cfZGGs0JRzFsPFvAMBEcrweV1V1GsrstdXeKCTXlJbvnQwGWgEIHmOA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/utils": "1.6.1", + "p-limit": "^5.0.0", + "pathe": "^1.1.1" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/snapshot": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.6.1.tgz", + "integrity": "sha512-WvidQuWAzU2p95u8GAKlRMqMyN1yOJkGHnx3M1PL9Raf7AQ1kwLKg04ADlCa3+OXUZE7BceOhVZiuWAbzCKcUQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "magic-string": "^0.30.5", + "pathe": "^1.1.1", + "pretty-format": "^29.7.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/spy": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.6.1.tgz", + "integrity": "sha512-MGcMmpGkZebsMZhbQKkAf9CX5zGvjkBTqf8Zx3ApYWXr3wG+QvEu2eXWfnIIWYSJExIp4V9FCKDEeygzkYrXMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyspy": "^2.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/utils": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.6.1.tgz", + "integrity": "sha512-jOrrUvXM4Av9ZWiG1EajNto0u96kWAhJ1LmPmJhXXQx/32MecEKd10pOLYgS2BQx1TgkGhloPU1ArDW2vvaY6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "diff-sequences": "^29.6.3", + "estree-walker": "^3.0.3", + "loupe": "^2.3.7", + "pretty-format": "^29.7.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/acorn": { + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", + "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-walk": { + "version": "8.3.4", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz", + "integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "acorn": "^8.11.0" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/cac": { + "version": "6.7.14", + "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", + "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/chai": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.5.0.tgz", + "integrity": "sha512-RITGBfijLkBddZvnn8jdqoTypxvqbOLYQkGGxXzeFjVHvudaPw0HNFD9x928/eUwYWd2dPCugVqspGALTZZQKw==", + "dev": true, + "license": "MIT", + "dependencies": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.3", + "deep-eql": "^4.1.3", + "get-func-name": "^2.0.2", + "loupe": "^2.3.6", + "pathval": "^1.1.1", + "type-detect": "^4.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/check-error": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", + "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-func-name": "^2.0.2" + }, + "engines": { + "node": "*" + } + }, + "node_modules/confbox": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.8.tgz", + "integrity": "sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==", + "dev": true, + "license": "MIT" + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/debug": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", + "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deep-eql": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.4.tgz", + "integrity": "sha512-SUwdGfqdKOwxCPeVYjwSyRpJ7Z+fhpwIAtmCUdZIWZ/YP5R9WAsyuSgpLVDi9bjWoN2LXHNss/dk3urXtdQxGg==", + "dev": true, + "license": "MIT", + "dependencies": { + "type-detect": "^4.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/diff-sequences": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + }, + "node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/execa": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", + "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", + "dev": true, + "license": "MIT", + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^8.0.1", + "human-signals": "^5.0.0", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^4.1.0", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": ">=16.17" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/get-func-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", + "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/get-stream": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", + "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/human-signals": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", + "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=16.17.0" + } + }, + "node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/js-tokens": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.1.tgz", + "integrity": "sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/local-pkg": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.5.1.tgz", + "integrity": "sha512-9rrA30MRRP3gBD3HTGnC6cDFpaE1kVDWxWgqWJUN0RvDNAo+Nz/9GxB+nHOH0ifbVFy0hSA1V6vFDvnx54lTEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "mlly": "^1.7.3", + "pkg-types": "^1.2.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/loupe": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", + "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-func-name": "^2.0.1" + } + }, + "node_modules/magic-string": { + "version": "0.30.18", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.18.tgz", + "integrity": "sha512-yi8swmWbO17qHhwIBNeeZxTceJMeBvWJaId6dyvTSOwTipqeHhMhOrz6513r1sOKnpvQ7zkhlG8tPrpilwTxHQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true, + "license": "MIT" + }, + "node_modules/mimic-fn": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mlly": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.8.0.tgz", + "integrity": "sha512-l8D9ODSRWLe2KHJSifWGwBqpTZXIXTeo8mlKjY+E2HAakaTeNpqAyBZ8GSqLzHgw4XmHmC8whvpjJNMbFZN7/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "acorn": "^8.15.0", + "pathe": "^2.0.3", + "pkg-types": "^1.3.1", + "ufo": "^1.6.1" + } + }, + "node_modules/mlly/node_modules/pathe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", + "dev": true, + "license": "MIT" + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/nanoid": { + "version": "3.3.11", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", + "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/npm-run-path": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", + "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/npm-run-path/node_modules/path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "mimic-fn": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-limit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-5.0.0.tgz", + "integrity": "sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^1.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/pathe": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", + "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/pathval": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/pkg-types": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.3.1.tgz", + "integrity": "sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "confbox": "^0.1.8", + "mlly": "^1.7.4", + "pathe": "^2.0.1" + } + }, + "node_modules/pkg-types/node_modules/pathe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", + "dev": true, + "license": "MIT" + }, + "node_modules/postcss": { + "version": "8.5.6", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz", + "integrity": "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.11", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "dev": true, + "license": "MIT" + }, + "node_modules/rollup": { + "version": "4.50.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.50.0.tgz", + "integrity": "sha512-/Zl4D8zPifNmyGzJS+3kVoyXeDeT/GrsJM94sACNg9RtUE0hrHa1bNPtRSrfHTMH5HjRzce6K7rlTh3Khiw+pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "1.0.8" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.50.0", + "@rollup/rollup-android-arm64": "4.50.0", + "@rollup/rollup-darwin-arm64": "4.50.0", + "@rollup/rollup-darwin-x64": "4.50.0", + "@rollup/rollup-freebsd-arm64": "4.50.0", + "@rollup/rollup-freebsd-x64": "4.50.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.50.0", + "@rollup/rollup-linux-arm-musleabihf": "4.50.0", + "@rollup/rollup-linux-arm64-gnu": "4.50.0", + "@rollup/rollup-linux-arm64-musl": "4.50.0", + "@rollup/rollup-linux-loongarch64-gnu": "4.50.0", + "@rollup/rollup-linux-ppc64-gnu": "4.50.0", + "@rollup/rollup-linux-riscv64-gnu": "4.50.0", + "@rollup/rollup-linux-riscv64-musl": "4.50.0", + "@rollup/rollup-linux-s390x-gnu": "4.50.0", + "@rollup/rollup-linux-x64-gnu": "4.50.0", + "@rollup/rollup-linux-x64-musl": "4.50.0", + "@rollup/rollup-openharmony-arm64": "4.50.0", + "@rollup/rollup-win32-arm64-msvc": "4.50.0", + "@rollup/rollup-win32-ia32-msvc": "4.50.0", + "@rollup/rollup-win32-x64-msvc": "4.50.0", + "fsevents": "~2.3.2" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/shell-quote": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.3.tgz", + "integrity": "sha512-ObmnIF4hXNg1BqhnHmgbDETF8dLPCggZWBjkQfhZpbszZnYur5DUljTcCHii5LC3J5E0yeO/1LIMyH+UvHQgyw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/siginfo": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "dev": true, + "license": "ISC" + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/stackback": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", + "dev": true, + "license": "MIT" + }, + "node_modules/std-env": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.9.0.tgz", + "integrity": "sha512-UGvjygr6F6tpH7o2qyqR6QYpwraIjKSdtzyBdyytFOHmPZY917kwdwLG0RbOjWOnKmnm3PeHjaoLLMie7kPLQw==", + "dev": true, + "license": "MIT" + }, + "node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/strip-literal": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-2.1.1.tgz", + "integrity": "sha512-631UJ6O00eNGfMiWG78ck80dfBab8X6IVFB51jZK5Icd7XAs60Z5y7QdSd/wGIklnWvRbUNloVzhOKKmutxQ6Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "js-tokens": "^9.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/tinybench": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", + "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinypool": { + "version": "0.8.4", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.8.4.tgz", + "integrity": "sha512-i11VH5gS6IFeLY3gMBQ00/MmLncVP7JLXOw1vlgkytLmJK7QnEr7NXf0LBdxfmNPAeyetukOk0bOYrJrFGjYJQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tinyspy": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.2.1.tgz", + "integrity": "sha512-KYad6Vy5VDWV4GH3fjpseMQ/XU2BhIYP7Vzd0LG44qRWm/Yt2WCOTicFdvmgo6gWaqooMQCawTtILVQJupKu7A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/type-detect": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.1.0.tgz", + "integrity": "sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/typescript": { + "version": "5.9.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.2.tgz", + "integrity": "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/ufo": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.6.1.tgz", + "integrity": "sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA==", + "dev": true, + "license": "MIT" + }, + "node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/vite": { + "version": "5.4.19", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.19.tgz", + "integrity": "sha512-qO3aKv3HoQC8QKiNSTuUM1l9o/XX3+c+VTgLHbJWHZGeTPVAg2XwazI9UWzoxjIJCGCV2zU60uqMzjeLZuULqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "^0.21.3", + "postcss": "^8.4.43", + "rollup": "^4.20.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || >=20.0.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "sass-embedded": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } + } + }, + "node_modules/vite-node": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.6.1.tgz", + "integrity": "sha512-YAXkfvGtuTzwWbDSACdJSg4A4DZiAqckWe90Zapc/sEX3XvHcw1NdurM/6od8J207tSDqNbSsgdCacBgvJKFuA==", + "dev": true, + "license": "MIT", + "dependencies": { + "cac": "^6.7.14", + "debug": "^4.3.4", + "pathe": "^1.1.1", + "picocolors": "^1.0.0", + "vite": "^5.0.0" + }, + "bin": { + "vite-node": "vite-node.mjs" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/vitest": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.6.1.tgz", + "integrity": "sha512-Ljb1cnSJSivGN0LqXd/zmDbWEM0RNNg2t1QW/XUhYl/qPqyu7CsqeWtqQXHVaJsecLPuDoak2oJcZN2QoRIOag==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/expect": "1.6.1", + "@vitest/runner": "1.6.1", + "@vitest/snapshot": "1.6.1", + "@vitest/spy": "1.6.1", + "@vitest/utils": "1.6.1", + "acorn-walk": "^8.3.2", + "chai": "^4.3.10", + "debug": "^4.3.4", + "execa": "^8.0.1", + "local-pkg": "^0.5.0", + "magic-string": "^0.30.5", + "pathe": "^1.1.1", + "picocolors": "^1.0.0", + "std-env": "^3.5.0", + "strip-literal": "^2.0.0", + "tinybench": "^2.5.1", + "tinypool": "^0.8.3", + "vite": "^5.0.0", + "vite-node": "1.6.1", + "why-is-node-running": "^2.2.2" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@types/node": "^18.0.0 || >=20.0.0", + "@vitest/browser": "1.6.1", + "@vitest/ui": "1.6.1", + "happy-dom": "*", + "jsdom": "*" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@vitest/browser": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + } + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/why-is-node-running": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", + "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", + "dev": true, + "license": "MIT", + "dependencies": { + "siginfo": "^2.0.0", + "stackback": "0.0.2" + }, + "bin": { + "why-is-node-running": "cli.js" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yocto-queue": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.2.1.tgz", + "integrity": "sha512-AyeEbWOu/TAXdxlV9wmGcR0+yh2j3vYPGOECcIj2S7MkrLyC7ne+oye2BKTItt0ii2PHk4cDy+95+LshzbXnGg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/packages/terminal-security/package.json b/packages/terminal-security/package.json new file mode 100644 index 000000000..e870d6e04 --- /dev/null +++ b/packages/terminal-security/package.json @@ -0,0 +1,25 @@ +{ + "name": "@continuedev/terminal-security", + "version": "1.0.0", + "description": "Terminal command security evaluation for Continue", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "type": "module", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch", + "build": "tsc", + "clean": "rm -rf dist" + }, + "author": "Continue Dev, Inc", + "license": "Apache-2.0", + "devDependencies": { + "@types/node": "^20.11.19", + "@types/shell-quote": "^1.7.5", + "typescript": "^5.5.2", + "vitest": "^1.6.0" + }, + "dependencies": { + "shell-quote": "^1.8.1" + } +} \ No newline at end of file diff --git a/core/tools/security/terminalCommandSecurity.ts b/packages/terminal-security/src/evaluateTerminalCommandSecurity.ts similarity index 99% rename from core/tools/security/terminalCommandSecurity.ts rename to packages/terminal-security/src/evaluateTerminalCommandSecurity.ts index ee8006864..8634a5c7d 100644 --- a/core/tools/security/terminalCommandSecurity.ts +++ b/packages/terminal-security/src/evaluateTerminalCommandSecurity.ts @@ -1,5 +1,5 @@ import { parse } from "shell-quote"; -import { ToolPolicy } from "../.."; +import { ToolPolicy } from "./types.js"; /** * Token types from shell-quote diff --git a/packages/terminal-security/src/index.ts b/packages/terminal-security/src/index.ts new file mode 100644 index 000000000..9c85a9b75 --- /dev/null +++ b/packages/terminal-security/src/index.ts @@ -0,0 +1,2 @@ +export { ToolPolicy } from "./types.js"; +export { evaluateTerminalCommandSecurity } from "./evaluateTerminalCommandSecurity.js"; \ No newline at end of file diff --git a/packages/terminal-security/src/types.ts b/packages/terminal-security/src/types.ts new file mode 100644 index 000000000..ce92680db --- /dev/null +++ b/packages/terminal-security/src/types.ts @@ -0,0 +1,7 @@ +/** + * Policy for tool execution + */ +export type ToolPolicy = + | "allowedWithPermission" + | "allowedWithoutPermission" + | "disabled"; \ No newline at end of file diff --git a/core/tools/implementations/terminalCommandSecurity.vitest.ts b/packages/terminal-security/test/terminalCommandSecurity.test.ts similarity index 99% rename from core/tools/implementations/terminalCommandSecurity.vitest.ts rename to packages/terminal-security/test/terminalCommandSecurity.test.ts index 3c10f75e3..d4d93010e 100644 --- a/core/tools/implementations/terminalCommandSecurity.vitest.ts +++ b/packages/terminal-security/test/terminalCommandSecurity.test.ts @@ -1,6 +1,5 @@ import { describe, it, expect } from "vitest"; -import { evaluateTerminalCommandSecurity } from "../security/terminalCommandSecurity"; -import { ToolPolicy } from "../.."; +import { evaluateTerminalCommandSecurity, ToolPolicy } from "../src/index.js"; describe("evaluateTerminalCommandSecurity", () => { describe("Critical Risk - Always Disabled", () => { diff --git a/packages/terminal-security/tsconfig.json b/packages/terminal-security/tsconfig.json new file mode 100644 index 000000000..9759fef8b --- /dev/null +++ b/packages/terminal-security/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "ES2022", + "lib": ["ES2022"], + "rootDir": "./src", + "outDir": "./dist", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "declaration": true, + "declarationMap": true, + "sourceMap": true, + "moduleResolution": "node", + "resolveJsonModule": true, + "allowSyntheticDefaultImports": true + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "test/**/*"] +} \ No newline at end of file diff --git a/packages/terminal-security/vitest.config.ts b/packages/terminal-security/vitest.config.ts new file mode 100644 index 000000000..7b27cc2d4 --- /dev/null +++ b/packages/terminal-security/vitest.config.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + globals: true, + environment: "node", + }, +}); \ No newline at end of file From 45f3f5a6a61aac7887642cec5750344e0e17d6d2 Mon Sep 17 00:00:00 2001 From: Tomasz Stefaniak Date: Wed, 3 Sep 2025 12:48:57 -0700 Subject: [PATCH 27/76] fix: prettier --- extensions/cli/src/tools/runTerminalCommand.ts | 5 ++++- packages/terminal-security/package.json | 2 +- packages/terminal-security/src/index.ts | 2 +- packages/terminal-security/src/types.ts | 2 +- packages/terminal-security/tsconfig.json | 2 +- packages/terminal-security/vitest.config.ts | 2 +- 6 files changed, 9 insertions(+), 6 deletions(-) diff --git a/extensions/cli/src/tools/runTerminalCommand.ts b/extensions/cli/src/tools/runTerminalCommand.ts index 6fbf613fa..e09380d91 100644 --- a/extensions/cli/src/tools/runTerminalCommand.ts +++ b/extensions/cli/src/tools/runTerminalCommand.ts @@ -1,6 +1,9 @@ import { spawn } from "child_process"; -import { evaluateTerminalCommandSecurity, type ToolPolicy } from "@continuedev/terminal-security"; +import { + evaluateTerminalCommandSecurity, + type ToolPolicy, +} from "@continuedev/terminal-security"; import { telemetryService } from "../telemetry/telemetryService.js"; import { diff --git a/packages/terminal-security/package.json b/packages/terminal-security/package.json index e870d6e04..67c7c2aa6 100644 --- a/packages/terminal-security/package.json +++ b/packages/terminal-security/package.json @@ -22,4 +22,4 @@ "dependencies": { "shell-quote": "^1.8.1" } -} \ No newline at end of file +} diff --git a/packages/terminal-security/src/index.ts b/packages/terminal-security/src/index.ts index 9c85a9b75..981c62a0e 100644 --- a/packages/terminal-security/src/index.ts +++ b/packages/terminal-security/src/index.ts @@ -1,2 +1,2 @@ export { ToolPolicy } from "./types.js"; -export { evaluateTerminalCommandSecurity } from "./evaluateTerminalCommandSecurity.js"; \ No newline at end of file +export { evaluateTerminalCommandSecurity } from "./evaluateTerminalCommandSecurity.js"; diff --git a/packages/terminal-security/src/types.ts b/packages/terminal-security/src/types.ts index ce92680db..cf3fad0c7 100644 --- a/packages/terminal-security/src/types.ts +++ b/packages/terminal-security/src/types.ts @@ -4,4 +4,4 @@ export type ToolPolicy = | "allowedWithPermission" | "allowedWithoutPermission" - | "disabled"; \ No newline at end of file + | "disabled"; diff --git a/packages/terminal-security/tsconfig.json b/packages/terminal-security/tsconfig.json index 9759fef8b..40b0b6531 100644 --- a/packages/terminal-security/tsconfig.json +++ b/packages/terminal-security/tsconfig.json @@ -18,4 +18,4 @@ }, "include": ["src/**/*"], "exclude": ["node_modules", "dist", "test/**/*"] -} \ No newline at end of file +} diff --git a/packages/terminal-security/vitest.config.ts b/packages/terminal-security/vitest.config.ts index 7b27cc2d4..3f824fb95 100644 --- a/packages/terminal-security/vitest.config.ts +++ b/packages/terminal-security/vitest.config.ts @@ -5,4 +5,4 @@ export default defineConfig({ globals: true, environment: "node", }, -}); \ No newline at end of file +}); From 56cd44396ce4a095e3e695437aae2d099aad9310 Mon Sep 17 00:00:00 2001 From: Tomasz Stefaniak Date: Wed, 3 Sep 2025 15:37:23 -0700 Subject: [PATCH 28/76] fix: formatting --- extensions/cli/src/stream/streamChatResponse.helpers.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/cli/src/stream/streamChatResponse.helpers.ts b/extensions/cli/src/stream/streamChatResponse.helpers.ts index 3e8813f7c..06e0a68c0 100644 --- a/extensions/cli/src/stream/streamChatResponse.helpers.ts +++ b/extensions/cli/src/stream/streamChatResponse.helpers.ts @@ -424,7 +424,7 @@ export async function executeStreamedToolCalls( denialReason === "policy" ? `Command blocked by security policy` : `Permission denied by user`; - + const deniedEntry: ChatCompletionToolMessageParam = { role: "tool", tool_call_id: call.id, From 47997af99ef74ae9818353faeacef6cc3d7e7139 Mon Sep 17 00:00:00 2001 From: Tomasz Stefaniak Date: Wed, 3 Sep 2025 15:45:46 -0700 Subject: [PATCH 29/76] fix: add terminal-security package to CI build script --- scripts/build-packages.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/build-packages.js b/scripts/build-packages.js index 996323f8a..c8401edd4 100644 --- a/scripts/build-packages.js +++ b/scripts/build-packages.js @@ -79,8 +79,8 @@ async function main() { try { console.log("🚀 Starting package builds...\n"); - // Phase 1: Build config-types (foundation - no dependencies) - await buildPackagesInParallel(["config-types"]); + // Phase 1: Build foundation packages (no local dependencies) + await buildPackagesInParallel(["config-types", "terminal-security"]); // Phase 2: Build packages that depend on config-types await buildPackagesInParallel(["fetch", "config-yaml", "llm-info"]); From cea33dd37ffa1e9000869cca5f7b9a0e8416aa61 Mon Sep 17 00:00:00 2001 From: Tomasz Stefaniak Date: Wed, 3 Sep 2025 15:56:18 -0700 Subject: [PATCH 30/76] fix: type errors, missing dependency --- gui/package-lock.json | 20 +++++++++++++++++++ gui/package.json | 1 + .../StepContainerPreToolbar/index.tsx | 2 +- 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/gui/package-lock.json b/gui/package-lock.json index b72bd3437..2b33dc8c7 100644 --- a/gui/package-lock.json +++ b/gui/package-lock.json @@ -8,6 +8,7 @@ "license": "Apache-2.0", "dependencies": { "@continuedev/config-yaml": "file:../packages/config-yaml", + "@continuedev/terminal-security": "file:../packages/terminal-security", "@headlessui/react": "^2.2.0", "@heroicons/react": "^2.0.18", "@panzoom/panzoom": "^4.6.0", @@ -123,6 +124,7 @@ "@continuedev/fetch": "file:../packages/fetch", "@continuedev/llm-info": "file:../packages/llm-info", "@continuedev/openai-adapters": "file:../packages/openai-adapters", + "@continuedev/terminal-security": "file:../packages/terminal-security", "@modelcontextprotocol/sdk": "^1.12.0", "@mozilla/readability": "^0.5.0", "@octokit/rest": "^20.1.1", @@ -268,6 +270,20 @@ "typescript": "^5.5.2" } }, + "../packages/terminal-security": { + "name": "@continuedev/terminal-security", + "version": "1.0.0", + "license": "Apache-2.0", + "dependencies": { + "shell-quote": "^1.8.1" + }, + "devDependencies": { + "@types/node": "^20.11.19", + "@types/shell-quote": "^1.7.5", + "typescript": "^5.5.2", + "vitest": "^1.6.0" + } + }, "node_modules/@adobe/css-tools": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.4.0.tgz", @@ -674,6 +690,10 @@ "resolved": "../packages/config-yaml", "link": true }, + "node_modules/@continuedev/terminal-security": { + "resolved": "../packages/terminal-security", + "link": true + }, "node_modules/@emotion/is-prop-valid": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-1.3.1.tgz", diff --git a/gui/package.json b/gui/package.json index 6cb45030c..2b5e31648 100644 --- a/gui/package.json +++ b/gui/package.json @@ -17,6 +17,7 @@ }, "dependencies": { "@continuedev/config-yaml": "file:../packages/config-yaml", + "@continuedev/terminal-security": "file:../packages/terminal-security", "@headlessui/react": "^2.2.0", "@heroicons/react": "^2.0.18", "@panzoom/panzoom": "^4.6.0", diff --git a/gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/index.tsx b/gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/index.tsx index a8fcaa989..0b13367c4 100644 --- a/gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/index.tsx +++ b/gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/index.tsx @@ -25,7 +25,7 @@ import { CreateFileButton } from "./CreateFileButton"; import { FileInfo } from "./FileInfo"; import { InsertButton } from "./InsertButton"; import { RunInTerminalButton } from "./RunInTerminalButton"; -import { evaluateTerminalCommandSecurity } from "core/tools/security/terminalCommandSecurity"; +import { evaluateTerminalCommandSecurity } from "@continuedev/terminal-security"; export interface StepContainerPreToolbarProps { showToolCallStatusIcon?: boolean; From 87b19acfe9d8a7c995374fd3ddda8835339dfb4a Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Wed, 3 Sep 2025 17:17:40 -0700 Subject: [PATCH 31/76] fix: don't show unchanged diff sections in extension UI --- .../pages/gui/ToolCallDiv/FindAndReplace.tsx | 116 +++++++++++++++++- 1 file changed, 114 insertions(+), 2 deletions(-) diff --git a/gui/src/pages/gui/ToolCallDiv/FindAndReplace.tsx b/gui/src/pages/gui/ToolCallDiv/FindAndReplace.tsx index ec0d9d8b9..f2f029595 100644 --- a/gui/src/pages/gui/ToolCallDiv/FindAndReplace.tsx +++ b/gui/src/pages/gui/ToolCallDiv/FindAndReplace.tsx @@ -3,7 +3,7 @@ import { ApplyState } from "core"; import { EditOperation } from "core/tools/definitions/multiEdit"; import { renderContextItems } from "core/util/messageContent"; import { getLastNPathParts, getUriPathBasename } from "core/util/uri"; -import { diffLines } from "diff"; +import { ChangeObject, diffLines } from "diff"; import { useContext, useMemo, useState } from "react"; import { ApplyActions } from "../../../components/StyledMarkdownPreview/StepContainerPreToolbar/ApplyActions"; import { FileInfo } from "../../../components/StyledMarkdownPreview/StepContainerPreToolbar/FileInfo"; @@ -122,6 +122,107 @@ export function FindAndReplaceDisplay({ } }, [toolCallState?.status, toolCallState?.output]); + const processedDiff: (ChangeObject | { ellipsis: true })[] = + useMemo(() => { + if (!diffResult?.diff) return []; + + const MAX_CONTEXT_LINES = 2; + const processed: (ChangeObject | { ellipsis: true })[] = []; + + for (let i = 0; i < diffResult.diff.length; i++) { + const part = diffResult.diff[i]; + + if (part.added || part.removed) { + processed.push(part); + } else { + // This is an unchanged part + const lines = part.value.split("\n"); + // Remove empty line at the end if it exists + if (lines[lines.length - 1] === "") { + lines.pop(); + } + + const isFirstPart = i === 0; + const isLastPart = i === diffResult.diff.length - 1; + const hasChangesAfter = + i < diffResult.diff.length - 1 && + diffResult.diff.slice(i + 1).some((p) => p.added || p.removed); + const hasChangesBefore = + i > 0 && + diffResult.diff.slice(0, i).some((p) => p.added || p.removed); + + let startIndex = 0; + let endIndex = lines.length; + let addEllipsisAtStart = false; + let addEllipsisAtEnd = false; + + if (isFirstPart && hasChangesAfter) { + // Show only last MAX_CONTEXT_LINES lines + const newStartIndex = Math.max(0, lines.length - MAX_CONTEXT_LINES); + if (newStartIndex > 0) { + addEllipsisAtStart = true; + } + startIndex = newStartIndex; + } else if (isLastPart && hasChangesBefore) { + // Show only first MAX_CONTEXT_LINES lines + const newEndIndex = Math.min(lines.length, MAX_CONTEXT_LINES); + if (newEndIndex < lines.length) { + addEllipsisAtEnd = true; + } + endIndex = newEndIndex; + } else if ( + !isFirstPart && + !isLastPart && + (hasChangesBefore || hasChangesAfter) + ) { + // Show MAX_CONTEXT_LINES at start and end + if (lines.length > MAX_CONTEXT_LINES * 2) { + const contextLines = [ + ...lines.slice(0, MAX_CONTEXT_LINES), + ...lines.slice(-MAX_CONTEXT_LINES), + ]; + processed.push({ + ...part, + value: + contextLines.slice(0, MAX_CONTEXT_LINES).join("\n") + "\n", + }); + + // Add ellipsis indicator + processed.push({ + ellipsis: true, + }); + + processed.push({ + ...part, + value: contextLines.slice(MAX_CONTEXT_LINES).join("\n") + "\n", + }); + continue; + } + } + + if (startIndex < endIndex) { + const visibleLines = lines.slice(startIndex, endIndex); + if (visibleLines.length > 0) { + if (addEllipsisAtStart) { + processed.unshift({ ellipsis: true }); + } + + processed.push({ + ...part, + value: visibleLines.join("\n") + "\n", + }); + + if (addEllipsisAtEnd) { + processed.push({ ellipsis: true }); + } + } + } + } + } + + return processed; + }, [diffResult?.diff]); + // Unified container component that always renders the same structure const renderContainer = (content: React.ReactNode) => (
@@ -200,7 +301,18 @@ export function FindAndReplaceDisplay({
-        {diffResult.diff.map((part, index) => {
+        {processedDiff.map((part, index) => {
+          if ("ellipsis" in part) {
+            return (
+              
+ ⋯ +
+ ); + } + if (part.removed) { return (
Date: Thu, 4 Sep 2025 19:48:38 +0800 Subject: [PATCH 32/76] fix: delete duplicate type --- .../continueintellijextension/constants/MessageTypes.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/constants/MessageTypes.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/constants/MessageTypes.kt index f5a9a9000..15d131f92 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/constants/MessageTypes.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/constants/MessageTypes.kt @@ -37,7 +37,6 @@ class MessageTypes { "applyToFile", "getControlPlaneSessionInfo", "logoutOfControlPlane", - "getTerminalContents", "showToast", "openUrl", "isWorkspaceRemote", From 38ce1a9c1409c99ff31d8909872db5111f58e8e5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Sep 2025 11:52:10 +0000 Subject: [PATCH 33/76] build(deps): bump actions/setup-python from 5 to 6 Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5 to 6. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v5...v6) --- updated-dependencies: - dependency-name: actions/setup-python dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/similar-issues.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/similar-issues.yml b/.github/workflows/similar-issues.yml index 9873a0585..afc56236b 100644 --- a/.github/workflows/similar-issues.yml +++ b/.github/workflows/similar-issues.yml @@ -31,7 +31,7 @@ jobs: path: deja-view - name: Setup Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: "3.11" From ea155746b3cee0e4d4cd4f76dd14a0b40ea975ed Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Sep 2025 12:45:50 +0000 Subject: [PATCH 34/76] build(deps): bump actions/stale from 9 to 10 Bumps [actions/stale](https://github.com/actions/stale) from 9 to 10. - [Release notes](https://github.com/actions/stale/releases) - [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/stale/compare/v9...v10) --- updated-dependencies: - dependency-name: actions/stale dependency-version: '10' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .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 067f4c60f..1309cd624 100644 --- a/.github/workflows/stale-issue-helper.yaml +++ b/.github/workflows/stale-issue-helper.yaml @@ -10,7 +10,7 @@ jobs: pull-requests: write runs-on: ubuntu-latest steps: - - uses: actions/stale@v9 + - uses: actions/stale@v10 with: 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." From 382b42d092bca1cd39549143a7a1c82d73fe53e4 Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Thu, 4 Sep 2025 18:52:55 +0530 Subject: [PATCH 35/76] fix: abort2error during stream fim --- core/llm/index.ts | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/core/llm/index.ts b/core/llm/index.ts index 6602be1f1..f8fefd381 100644 --- a/core/llm/index.ts +++ b/core/llm/index.ts @@ -370,8 +370,17 @@ export abstract class BaseLLM implements ILLM { }, }); - if (error !== undefined) { - if (error === "cancel" || error.name === "AbortError") { + if (typeof error === "undefined") { + interaction?.logItem({ + kind: "success", + promptTokens, + generatedTokens, + thinkingTokens, + usage, + }); + return "success"; + } else { + if (error === "cancel" || error?.name?.includes("AbortError")) { interaction?.logItem({ kind: "cancel", promptTokens, @@ -393,15 +402,6 @@ export abstract class BaseLLM implements ILLM { }); return "error"; } - } else { - interaction?.logItem({ - kind: "success", - promptTokens, - generatedTokens, - thinkingTokens, - usage, - }); - return "success"; } } @@ -615,6 +615,7 @@ export abstract class BaseLLM implements ILLM { kind: "chunk", chunk: formattedContent, }); + completion += formattedContent; yield content; } @@ -630,6 +631,7 @@ export abstract class BaseLLM implements ILLM { kind: "chunk", chunk, }); + completion += chunk; yield chunk; } From 1525047e3c07b7fdf0b973d198c7f9acc0330371 Mon Sep 17 00:00:00 2001 From: Jakub Blach Date: Thu, 4 Sep 2025 19:19:34 +0200 Subject: [PATCH 36/76] fix: open file on EDT Solves CON-3809 --- .../continueintellijextension/continue/IntelliJIde.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 9affb4c2d..ba1f4a571 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 @@ -199,7 +199,9 @@ class IntelliJIDE( } override suspend fun openFile(path: String) = - fileUtils.openFile(path) + withContext(Dispatchers.EDT) { + fileUtils.openFile(path) + } override suspend fun openUrl(url: String) { withContext(Dispatchers.IO) { From 082af0f3dd4ce4db4a5aa5622e8c60c649374b51 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Thu, 4 Sep 2025 14:22:31 -0700 Subject: [PATCH 37/76] fix: clean up diff viewer --- .../pages/gui/ToolCallDiv/FindAndReplace.tsx | 243 ++++++------------ 1 file changed, 77 insertions(+), 166 deletions(-) diff --git a/gui/src/pages/gui/ToolCallDiv/FindAndReplace.tsx b/gui/src/pages/gui/ToolCallDiv/FindAndReplace.tsx index f2f029595..8d226dc58 100644 --- a/gui/src/pages/gui/ToolCallDiv/FindAndReplace.tsx +++ b/gui/src/pages/gui/ToolCallDiv/FindAndReplace.tsx @@ -3,7 +3,7 @@ import { ApplyState } from "core"; import { EditOperation } from "core/tools/definitions/multiEdit"; import { renderContextItems } from "core/util/messageContent"; import { getLastNPathParts, getUriPathBasename } from "core/util/uri"; -import { ChangeObject, diffLines } from "diff"; +import { diffLines } from "diff"; import { useContext, useMemo, useState } from "react"; import { ApplyActions } from "../../../components/StyledMarkdownPreview/StepContainerPreToolbar/ApplyActions"; import { FileInfo } from "../../../components/StyledMarkdownPreview/StepContainerPreToolbar/FileInfo"; @@ -14,6 +14,7 @@ import { selectToolCallById, } from "../../../redux/selectors/selectToolCalls"; import { performFindAndReplace } from "../../../util/clientTools/findAndReplaceUtils"; +import { cn } from "../../../util/cn"; import { getStatusIcon } from "./utils"; interface FindAndReplaceDisplayProps { @@ -25,6 +26,48 @@ interface FindAndReplaceDisplayProps { historyIndex: number; } +const MAX_SAME_LINES = 2; + +function EllipsisLine() { + return ( +
+ ⋯ +
+ ); +} + +function DiffLines({ + lines, + className = "", + diffChar = " ", + diffCharClass = "text-description-muted", +}: { + lines: string[]; + diffChar?: string; + diffCharClass?: string; + className?: string; +}) { + return ( + <> + {lines.map((line, lineIndex) => { + const isLastPartLine = lineIndex === lines.length - 1; + if (line === "" && isLastPartLine) return null; + return ( +
+ + {diffChar} + + {line} +
+ ); + })} + + ); +} + export function FindAndReplaceDisplay({ fileUri, relativeFilePath, @@ -122,107 +165,6 @@ export function FindAndReplaceDisplay({ } }, [toolCallState?.status, toolCallState?.output]); - const processedDiff: (ChangeObject | { ellipsis: true })[] = - useMemo(() => { - if (!diffResult?.diff) return []; - - const MAX_CONTEXT_LINES = 2; - const processed: (ChangeObject | { ellipsis: true })[] = []; - - for (let i = 0; i < diffResult.diff.length; i++) { - const part = diffResult.diff[i]; - - if (part.added || part.removed) { - processed.push(part); - } else { - // This is an unchanged part - const lines = part.value.split("\n"); - // Remove empty line at the end if it exists - if (lines[lines.length - 1] === "") { - lines.pop(); - } - - const isFirstPart = i === 0; - const isLastPart = i === diffResult.diff.length - 1; - const hasChangesAfter = - i < diffResult.diff.length - 1 && - diffResult.diff.slice(i + 1).some((p) => p.added || p.removed); - const hasChangesBefore = - i > 0 && - diffResult.diff.slice(0, i).some((p) => p.added || p.removed); - - let startIndex = 0; - let endIndex = lines.length; - let addEllipsisAtStart = false; - let addEllipsisAtEnd = false; - - if (isFirstPart && hasChangesAfter) { - // Show only last MAX_CONTEXT_LINES lines - const newStartIndex = Math.max(0, lines.length - MAX_CONTEXT_LINES); - if (newStartIndex > 0) { - addEllipsisAtStart = true; - } - startIndex = newStartIndex; - } else if (isLastPart && hasChangesBefore) { - // Show only first MAX_CONTEXT_LINES lines - const newEndIndex = Math.min(lines.length, MAX_CONTEXT_LINES); - if (newEndIndex < lines.length) { - addEllipsisAtEnd = true; - } - endIndex = newEndIndex; - } else if ( - !isFirstPart && - !isLastPart && - (hasChangesBefore || hasChangesAfter) - ) { - // Show MAX_CONTEXT_LINES at start and end - if (lines.length > MAX_CONTEXT_LINES * 2) { - const contextLines = [ - ...lines.slice(0, MAX_CONTEXT_LINES), - ...lines.slice(-MAX_CONTEXT_LINES), - ]; - processed.push({ - ...part, - value: - contextLines.slice(0, MAX_CONTEXT_LINES).join("\n") + "\n", - }); - - // Add ellipsis indicator - processed.push({ - ellipsis: true, - }); - - processed.push({ - ...part, - value: contextLines.slice(MAX_CONTEXT_LINES).join("\n") + "\n", - }); - continue; - } - } - - if (startIndex < endIndex) { - const visibleLines = lines.slice(startIndex, endIndex); - if (visibleLines.length > 0) { - if (addEllipsisAtStart) { - processed.unshift({ ellipsis: true }); - } - - processed.push({ - ...part, - value: visibleLines.join("\n") + "\n", - }); - - if (addEllipsisAtEnd) { - processed.push({ ellipsis: true }); - } - } - } - } - } - - return processed; - }, [diffResult?.diff]); - // Unified container component that always renders the same structure const renderContainer = (content: React.ReactNode) => (
@@ -301,81 +243,50 @@ export function FindAndReplaceDisplay({
-        {processedDiff.map((part, index) => {
-          if ("ellipsis" in part) {
-            return (
-              
- ⋯ -
- ); - } - + {diffResult.diff?.map((part, index) => { if (part.removed) { return ( -
- {part.value.split("\n").map((line, lineIndex) => { - if ( - line === "" && - lineIndex === part.value.split("\n").length - 1 - ) - return null; - return ( -
- - - {line} -
- ); - })} -
+ lines={part.value.split("\n")} + className="border-l-4 border-red-900 bg-red-900/30" + diffCharClass="text-red-600" + /> ); } else if (part.added) { return ( -
- {part.value.split("\n").map((line, lineIndex) => { - if ( - line === "" && - lineIndex === part.value.split("\n").length - 1 - ) - return null; - return ( -
- + - {line} -
- ); - })} -
+ lines={part.value.split("\n")} + diffCharClass="text-green-600" + className="border-l-4 border-green-600 bg-green-600/20" + /> ); } else { + const isFirst = index === 0; + const isLast = index === diffResult.diff.length - 1; + const lines = part.value.split("\n"); + const showStartEllipsis = isFirst && lines.length > MAX_SAME_LINES; + const showEndEllipsis = isLast && lines.length > MAX_SAME_LINES; + const showMiddleEllipses = + !isFirst && !isLast && lines.length > MAX_SAME_LINES * 2 + 1; + + const startLines = showStartEllipsis + ? lines.slice(-MAX_SAME_LINES) + : showMiddleEllipses || showEndEllipsis + ? lines.slice(0, MAX_SAME_LINES) + : lines; + const endLines = showMiddleEllipses + ? lines.slice(-MAX_SAME_LINES) + : []; + return (
- {part.value.split("\n").map((line, lineIndex) => { - if ( - line === "" && - lineIndex === part.value.split("\n").length - 1 - ) - return null; - return ( -
- - {" "} - - {line} -
- ); - })} + {showStartEllipsis && } + + {showMiddleEllipses && } + + {showEndEllipsis && }
); } From e31833160579e753919fc5c9d9eb504882b4da84 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Thu, 4 Sep 2025 14:53:16 -0700 Subject: [PATCH 38/76] fix: show added/removed diff chars --- gui/src/pages/gui/ToolCallDiv/FindAndReplace.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gui/src/pages/gui/ToolCallDiv/FindAndReplace.tsx b/gui/src/pages/gui/ToolCallDiv/FindAndReplace.tsx index 8d226dc58..ae1b3d5c9 100644 --- a/gui/src/pages/gui/ToolCallDiv/FindAndReplace.tsx +++ b/gui/src/pages/gui/ToolCallDiv/FindAndReplace.tsx @@ -251,6 +251,7 @@ export function FindAndReplaceDisplay({ lines={part.value.split("\n")} className="border-l-4 border-red-900 bg-red-900/30" diffCharClass="text-red-600" + diffChar="-" /> ); } else if (part.added) { @@ -260,6 +261,7 @@ export function FindAndReplaceDisplay({ lines={part.value.split("\n")} diffCharClass="text-green-600" className="border-l-4 border-green-600 bg-green-600/20" + diffChar="+" /> ); } else { From 3183127ea538164ca275b4a421936b48259a12ea Mon Sep 17 00:00:00 2001 From: Tomasz Stefaniak Date: Thu, 4 Sep 2025 14:55:25 -0700 Subject: [PATCH 39/76] fix: duplicate imports --- core/index.d.ts | 5 ----- core/protocol/core.ts | 2 +- core/tools/definitions/runTerminalCommand.ts | 4 ++-- extensions/cli/src/permissions/permissionChecker.ts | 2 +- extensions/cli/src/tools/types.ts | 2 +- gui/src/redux/slices/uiSlice.ts | 3 ++- gui/src/redux/thunks/streamNormalInput.ts | 2 +- gui/src/util/migrateLocalStorage.ts | 2 +- 8 files changed, 9 insertions(+), 13 deletions(-) diff --git a/core/index.d.ts b/core/index.d.ts index 2a7ad3aa9..a31e02c67 100644 --- a/core/index.d.ts +++ b/core/index.d.ts @@ -1070,11 +1070,6 @@ export interface ToolExtras { codeBaseIndexer?: CodebaseIndexer; } -export type ToolPolicy = - | "allowedWithPermission" - | "allowedWithoutPermission" - | "disabled"; - export interface Tool { type: "function"; function: { diff --git a/core/protocol/core.ts b/core/protocol/core.ts index c84ebb468..5add878be 100644 --- a/core/protocol/core.ts +++ b/core/protocol/core.ts @@ -4,6 +4,7 @@ import { DevDataLogEvent, ModelRole, } from "@continuedev/config-yaml"; +import { ToolPolicy } from "@continuedev/terminal-security"; import { AutocompleteInput, @@ -39,7 +40,6 @@ import { SlashCommandDescWithSource, StreamDiffLinesPayload, ToolCall, - ToolPolicy, } from "../"; import { AutocompleteCodeSnippet } from "../autocomplete/snippets/types"; import { GetLspDefinitionsFunction } from "../autocomplete/types"; diff --git a/core/tools/definitions/runTerminalCommand.ts b/core/tools/definitions/runTerminalCommand.ts index 915c0828b..5f1d04251 100644 --- a/core/tools/definitions/runTerminalCommand.ts +++ b/core/tools/definitions/runTerminalCommand.ts @@ -1,7 +1,7 @@ import os from "os"; -import { Tool, ToolPolicy } from "../.."; +import { Tool } from "../.."; import { BUILT_IN_GROUP_NAME, BuiltInToolNames } from "../builtIn"; -import { evaluateTerminalCommandSecurity } from "@continuedev/terminal-security"; +import { evaluateTerminalCommandSecurity, ToolPolicy } from "@continuedev/terminal-security"; /** * Get the preferred shell for the current platform diff --git a/extensions/cli/src/permissions/permissionChecker.ts b/extensions/cli/src/permissions/permissionChecker.ts index e5d5d3b79..0db8b3e9b 100644 --- a/extensions/cli/src/permissions/permissionChecker.ts +++ b/extensions/cli/src/permissions/permissionChecker.ts @@ -1,4 +1,4 @@ -import type { ToolPolicy } from "../../../../core/index.js"; +import type { ToolPolicy } from "@continuedev/terminal-security"; import { getServiceSync } from "../services/index.js"; import type { ToolPermissionServiceState } from "../services/types.js"; import { SERVICE_NAMES } from "../services/types.js"; diff --git a/extensions/cli/src/tools/types.ts b/extensions/cli/src/tools/types.ts index f142c7830..04c164ad4 100644 --- a/extensions/cli/src/tools/types.ts +++ b/extensions/cli/src/tools/types.ts @@ -1,4 +1,4 @@ -import type { ToolPolicy } from "../../../../core/index.js"; +import type { ToolPolicy } from "@continuedev/terminal-security"; export type ToolParameters = Record< string, diff --git a/gui/src/redux/slices/uiSlice.ts b/gui/src/redux/slices/uiSlice.ts index e350d9f72..48c23bd9b 100644 --- a/gui/src/redux/slices/uiSlice.ts +++ b/gui/src/redux/slices/uiSlice.ts @@ -1,5 +1,6 @@ import { createSlice, PayloadAction } from "@reduxjs/toolkit"; -import { RuleWithSource, Tool, ToolPolicy } from "core"; +import { RuleWithSource, Tool } from "core"; +import { ToolPolicy } from "@continuedev/terminal-security"; import { BUILT_IN_GROUP_NAME, BuiltInToolNames } from "core/tools/builtIn"; import { defaultOnboardingCardState, diff --git a/gui/src/redux/thunks/streamNormalInput.ts b/gui/src/redux/thunks/streamNormalInput.ts index 1213da448..79cd81971 100644 --- a/gui/src/redux/thunks/streamNormalInput.ts +++ b/gui/src/redux/thunks/streamNormalInput.ts @@ -4,8 +4,8 @@ import { LLMFullCompletionOptions, Tool, ToolCallState, - ToolPolicy, } from "core"; +import { ToolPolicy } from "@continuedev/terminal-security"; import { getRuleId } from "core/llm/rules/getSystemMessageWithRules"; import { ToCoreProtocol } from "core/protocol"; import { selectActiveTools } from "../selectors/selectActiveTools"; diff --git a/gui/src/util/migrateLocalStorage.ts b/gui/src/util/migrateLocalStorage.ts index d0cefb197..a6e3c0d28 100644 --- a/gui/src/util/migrateLocalStorage.ts +++ b/gui/src/util/migrateLocalStorage.ts @@ -1,4 +1,4 @@ -import { ToolPolicy } from "core"; +import { ToolPolicy } from "@continuedev/terminal-security"; import { BuiltInToolNames } from "core/tools/builtIn"; import { clearToolPolicy, setToolPolicy } from "../redux/slices/uiSlice"; import { AppDispatch } from "../redux/store"; From 6ca09b09b58797cbd1184252bab4074017ec5906 Mon Sep 17 00:00:00 2001 From: Tomasz Stefaniak Date: Thu, 4 Sep 2025 15:02:49 -0700 Subject: [PATCH 40/76] fix: formatting --- core/tools/definitions/runTerminalCommand.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/tools/definitions/runTerminalCommand.ts b/core/tools/definitions/runTerminalCommand.ts index 5f1d04251..dbeaa5c05 100644 --- a/core/tools/definitions/runTerminalCommand.ts +++ b/core/tools/definitions/runTerminalCommand.ts @@ -1,7 +1,10 @@ import os from "os"; import { Tool } from "../.."; import { BUILT_IN_GROUP_NAME, BuiltInToolNames } from "../builtIn"; -import { evaluateTerminalCommandSecurity, ToolPolicy } from "@continuedev/terminal-security"; +import { + evaluateTerminalCommandSecurity, + ToolPolicy, +} from "@continuedev/terminal-security"; /** * Get the preferred shell for the current platform From c30c856483832e20cf2759bdc4f4487690815c6c Mon Sep 17 00:00:00 2001 From: Tomasz Stefaniak Date: Thu, 4 Sep 2025 15:03:37 -0700 Subject: [PATCH 41/76] fix: linter errors --- extensions/cli/src/permissions/permissionChecker.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/extensions/cli/src/permissions/permissionChecker.ts b/extensions/cli/src/permissions/permissionChecker.ts index 0db8b3e9b..55a4fbfab 100644 --- a/extensions/cli/src/permissions/permissionChecker.ts +++ b/extensions/cli/src/permissions/permissionChecker.ts @@ -1,4 +1,5 @@ import type { ToolPolicy } from "@continuedev/terminal-security"; + import { getServiceSync } from "../services/index.js"; import type { ToolPermissionServiceState } from "../services/types.js"; import { SERVICE_NAMES } from "../services/types.js"; From 9e0e5b56959831636c19a295c95ec1b6ba83d922 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Sep 2025 22:17:04 +0000 Subject: [PATCH 42/76] build(deps): bump esbuild and vitest in /packages/terminal-security Bumps [esbuild](https://github.com/evanw/esbuild) to 0.25.9 and updates ancestor dependency [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest). These dependencies need to be updated together. Updates `esbuild` from 0.21.5 to 0.25.9 - [Release notes](https://github.com/evanw/esbuild/releases) - [Changelog](https://github.com/evanw/esbuild/blob/main/CHANGELOG-2024.md) - [Commits](https://github.com/evanw/esbuild/compare/v0.21.5...v0.25.9) Updates `vitest` from 1.6.1 to 3.2.4 - [Release notes](https://github.com/vitest-dev/vitest/releases) - [Commits](https://github.com/vitest-dev/vitest/commits/v3.2.4/packages/vitest) --- updated-dependencies: - dependency-name: esbuild dependency-version: 0.25.9 dependency-type: indirect - dependency-name: vitest dependency-version: 3.2.4 dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- packages/terminal-security/package-lock.json | 1105 +++++++----------- packages/terminal-security/package.json | 2 +- 2 files changed, 440 insertions(+), 667 deletions(-) diff --git a/packages/terminal-security/package-lock.json b/packages/terminal-security/package-lock.json index 0d4f62419..62d1f9b79 100644 --- a/packages/terminal-security/package-lock.json +++ b/packages/terminal-security/package-lock.json @@ -15,13 +15,13 @@ "@types/node": "^20.11.19", "@types/shell-quote": "^1.7.5", "typescript": "^5.5.2", - "vitest": "^1.6.0" + "vitest": "^3.2.4" } }, "node_modules/@esbuild/aix-ppc64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", - "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.9.tgz", + "integrity": "sha512-OaGtL73Jck6pBKjNIe24BnFE6agGl+6KxDtTfHhy1HmhthfKouEcOhqpSL64K4/0WCtbKFLOdzD/44cJ4k9opA==", "cpu": [ "ppc64" ], @@ -32,13 +32,13 @@ "aix" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/android-arm": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", - "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.9.tgz", + "integrity": "sha512-5WNI1DaMtxQ7t7B6xa572XMXpHAaI/9Hnhk8lcxF4zVN4xstUgTlvuGDorBguKEnZO70qwEcLpfifMLoxiPqHQ==", "cpu": [ "arm" ], @@ -49,13 +49,13 @@ "android" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/android-arm64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", - "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.9.tgz", + "integrity": "sha512-IDrddSmpSv51ftWslJMvl3Q2ZT98fUSL2/rlUXuVqRXHCs5EUF1/f+jbjF5+NG9UffUDMCiTyh8iec7u8RlTLg==", "cpu": [ "arm64" ], @@ -66,13 +66,13 @@ "android" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/android-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", - "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.9.tgz", + "integrity": "sha512-I853iMZ1hWZdNllhVZKm34f4wErd4lMyeV7BLzEExGEIZYsOzqDWDf+y082izYUE8gtJnYHdeDpN/6tUdwvfiw==", "cpu": [ "x64" ], @@ -83,13 +83,13 @@ "android" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", - "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.9.tgz", + "integrity": "sha512-XIpIDMAjOELi/9PB30vEbVMs3GV1v2zkkPnuyRRURbhqjyzIINwj+nbQATh4H9GxUgH1kFsEyQMxwiLFKUS6Rg==", "cpu": [ "arm64" ], @@ -100,13 +100,13 @@ "darwin" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", - "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.9.tgz", + "integrity": "sha512-jhHfBzjYTA1IQu8VyrjCX4ApJDnH+ez+IYVEoJHeqJm9VhG9Dh2BYaJritkYK3vMaXrf7Ogr/0MQ8/MeIefsPQ==", "cpu": [ "x64" ], @@ -117,13 +117,13 @@ "darwin" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", - "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.9.tgz", + "integrity": "sha512-z93DmbnY6fX9+KdD4Ue/H6sYs+bhFQJNCPZsi4XWJoYblUqT06MQUdBCpcSfuiN72AbqeBFu5LVQTjfXDE2A6Q==", "cpu": [ "arm64" ], @@ -134,13 +134,13 @@ "freebsd" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", - "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.9.tgz", + "integrity": "sha512-mrKX6H/vOyo5v71YfXWJxLVxgy1kyt1MQaD8wZJgJfG4gq4DpQGpgTB74e5yBeQdyMTbgxp0YtNj7NuHN0PoZg==", "cpu": [ "x64" ], @@ -151,13 +151,13 @@ "freebsd" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-arm": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", - "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.9.tgz", + "integrity": "sha512-HBU2Xv78SMgaydBmdor38lg8YDnFKSARg1Q6AT0/y2ezUAKiZvc211RDFHlEZRFNRVhcMamiToo7bDx3VEOYQw==", "cpu": [ "arm" ], @@ -168,13 +168,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", - "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.9.tgz", + "integrity": "sha512-BlB7bIcLT3G26urh5Dmse7fiLmLXnRlopw4s8DalgZ8ef79Jj4aUcYbk90g8iCa2467HX8SAIidbL7gsqXHdRw==", "cpu": [ "arm64" ], @@ -185,13 +185,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", - "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.9.tgz", + "integrity": "sha512-e7S3MOJPZGp2QW6AK6+Ly81rC7oOSerQ+P8L0ta4FhVi+/j/v2yZzx5CqqDaWjtPFfYz21Vi1S0auHrap3Ma3A==", "cpu": [ "ia32" ], @@ -202,13 +202,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", - "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.9.tgz", + "integrity": "sha512-Sbe10Bnn0oUAB2AalYztvGcK+o6YFFA/9829PhOCUS9vkJElXGdphz0A3DbMdP8gmKkqPmPcMJmJOrI3VYB1JQ==", "cpu": [ "loong64" ], @@ -219,13 +219,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", - "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.9.tgz", + "integrity": "sha512-YcM5br0mVyZw2jcQeLIkhWtKPeVfAerES5PvOzaDxVtIyZ2NUBZKNLjC5z3/fUlDgT6w89VsxP2qzNipOaaDyA==", "cpu": [ "mips64el" ], @@ -236,13 +236,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", - "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.9.tgz", + "integrity": "sha512-++0HQvasdo20JytyDpFvQtNrEsAgNG2CY1CLMwGXfFTKGBGQT3bOeLSYE2l1fYdvML5KUuwn9Z8L1EWe2tzs1w==", "cpu": [ "ppc64" ], @@ -253,13 +253,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", - "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.9.tgz", + "integrity": "sha512-uNIBa279Y3fkjV+2cUjx36xkx7eSjb8IvnL01eXUKXez/CBHNRw5ekCGMPM0BcmqBxBcdgUWuUXmVWwm4CH9kg==", "cpu": [ "riscv64" ], @@ -270,13 +270,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", - "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.9.tgz", + "integrity": "sha512-Mfiphvp3MjC/lctb+7D287Xw1DGzqJPb/J2aHHcHxflUo+8tmN/6d4k6I2yFR7BVo5/g7x2Monq4+Yew0EHRIA==", "cpu": [ "s390x" ], @@ -287,13 +287,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", - "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.9.tgz", + "integrity": "sha512-iSwByxzRe48YVkmpbgoxVzn76BXjlYFXC7NvLYq+b+kDjyyk30J0JY47DIn8z1MO3K0oSl9fZoRmZPQI4Hklzg==", "cpu": [ "x64" ], @@ -304,13 +304,30 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.9.tgz", + "integrity": "sha512-9jNJl6FqaUG+COdQMjSCGW4QiMHH88xWbvZ+kRVblZsWrkXlABuGdFJ1E9L7HK+T0Yqd4akKNa/lO0+jDxQD4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", - "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.9.tgz", + "integrity": "sha512-RLLdkflmqRG8KanPGOU7Rpg829ZHu8nFy5Pqdi9U01VYtG9Y0zOG6Vr2z4/S+/3zIyOxiK6cCeYNWOFR9QP87g==", "cpu": [ "x64" ], @@ -321,13 +338,30 @@ "netbsd" ], "engines": { - "node": ">=12" + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.9.tgz", + "integrity": "sha512-YaFBlPGeDasft5IIM+CQAhJAqS3St3nJzDEgsgFixcfZeyGPCd6eJBWzke5piZuZ7CtL656eOSYKk4Ls2C0FRQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", - "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.9.tgz", + "integrity": "sha512-1MkgTCuvMGWuqVtAvkpkXFmtL8XhWy+j4jaSO2wxfJtilVCi0ZE37b8uOdMItIHz4I6z1bWWtEX4CJwcKYLcuA==", "cpu": [ "x64" ], @@ -338,13 +372,30 @@ "openbsd" ], "engines": { - "node": ">=12" + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.9.tgz", + "integrity": "sha512-4Xd0xNiMVXKh6Fa7HEJQbrpP3m3DDn43jKxMjxLLRjWnRsfxjORYJlXPO4JNcXtOyfajXorRKY9NkOpTHptErg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", - "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.9.tgz", + "integrity": "sha512-WjH4s6hzo00nNezhp3wFIAfmGZ8U7KtrJNlFMRKxiI9mxEK1scOMAaa9i4crUtu+tBr+0IN6JCuAcSBJZfnphw==", "cpu": [ "x64" ], @@ -355,13 +406,13 @@ "sunos" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", - "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.9.tgz", + "integrity": "sha512-mGFrVJHmZiRqmP8xFOc6b84/7xa5y5YvR1x8djzXpJBSv/UsNK6aqec+6JDjConTgvvQefdGhFDAs2DLAds6gQ==", "cpu": [ "arm64" ], @@ -372,13 +423,13 @@ "win32" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", - "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.9.tgz", + "integrity": "sha512-b33gLVU2k11nVx1OhX3C8QQP6UHQK4ZtN56oFWvVXvz2VkDoe6fbG8TOgHFxEvqeqohmRnIHe5A1+HADk4OQww==", "cpu": [ "ia32" ], @@ -389,13 +440,13 @@ "win32" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/win32-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", - "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.9.tgz", + "integrity": "sha512-PPOl1mi6lpLNQxnGoyAfschAodRFYXJ+9fs6WHXz7CSWKbOqiMZsubC+BQsVKuul+3vKLuwTHsS2c2y9EoKwxQ==", "cpu": [ "x64" ], @@ -406,20 +457,7 @@ "win32" ], "engines": { - "node": ">=12" - } - }, - "node_modules/@jest/schemas": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", - "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@sinclair/typebox": "^0.27.8" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=18" } }, "node_modules/@jridgewell/sourcemap-codec": { @@ -723,10 +761,20 @@ "win32" ] }, - "node_modules/@sinclair/typebox": { - "version": "0.27.8", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", - "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "node_modules/@types/chai": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.2.tgz", + "integrity": "sha512-8kB30R7Hwqf40JPiKhVzodJs2Qc1ZJ5zuT3uzw5Hq/dhNCl3G3l83jfpdI1e20BP348+fV7VIL/+FxaXkqBmWg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/deep-eql": "*" + } + }, + "node_modules/@types/deep-eql": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz", + "integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==", "dev": true, "license": "MIT" }, @@ -755,126 +803,128 @@ "license": "MIT" }, "node_modules/@vitest/expect": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.6.1.tgz", - "integrity": "sha512-jXL+9+ZNIJKruofqXuuTClf44eSpcHlgj3CiuNihUF3Ioujtmc0zIa3UJOW5RjDK1YLBJZnWBlPuqhYycLioog==", + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-3.2.4.tgz", + "integrity": "sha512-Io0yyORnB6sikFlt8QW5K7slY4OjqNX9jmJQ02QDda8lyM6B5oNgVWoSoKPac8/kgnCUzuHQKrSLtu/uOqqrig==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/spy": "1.6.1", - "@vitest/utils": "1.6.1", - "chai": "^4.3.10" + "@types/chai": "^5.2.2", + "@vitest/spy": "3.2.4", + "@vitest/utils": "3.2.4", + "chai": "^5.2.0", + "tinyrainbow": "^2.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/mocker": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-3.2.4.tgz", + "integrity": "sha512-46ryTE9RZO/rfDd7pEqFl7etuyzekzEhUbTW3BvmeO/BcCMEgq59BKhek3dXDWgAj4oMK6OZi+vRr1wPW6qjEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/spy": "3.2.4", + "estree-walker": "^3.0.3", + "magic-string": "^0.30.17" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "msw": "^2.4.9", + "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0" + }, + "peerDependenciesMeta": { + "msw": { + "optional": true + }, + "vite": { + "optional": true + } + } + }, + "node_modules/@vitest/pretty-format": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-3.2.4.tgz", + "integrity": "sha512-IVNZik8IVRJRTr9fxlitMKeJeXFFFN0JaB9PHPGQ8NKQbGpfjlTx9zO4RefN8gp7eqjNy8nyK3NZmBzOPeIxtA==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyrainbow": "^2.0.0" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/runner": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.6.1.tgz", - "integrity": "sha512-3nSnYXkVkf3mXFfE7vVyPmi3Sazhb/2cfZGGs0JRzFsPFvAMBEcrweV1V1GsrstdXeKCTXlJbvnQwGWgEIHmOA==", + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-3.2.4.tgz", + "integrity": "sha512-oukfKT9Mk41LreEW09vt45f8wx7DordoWUZMYdY/cyAk7w5TWkTRCNZYF7sX7n2wB7jyGAl74OxgwhPgKaqDMQ==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/utils": "1.6.1", - "p-limit": "^5.0.0", - "pathe": "^1.1.1" + "@vitest/utils": "3.2.4", + "pathe": "^2.0.3", + "strip-literal": "^3.0.0" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/snapshot": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.6.1.tgz", - "integrity": "sha512-WvidQuWAzU2p95u8GAKlRMqMyN1yOJkGHnx3M1PL9Raf7AQ1kwLKg04ADlCa3+OXUZE7BceOhVZiuWAbzCKcUQ==", + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-3.2.4.tgz", + "integrity": "sha512-dEYtS7qQP2CjU27QBC5oUOxLE/v5eLkGqPE0ZKEIDGMs4vKWe7IjgLOeauHsR0D5YuuycGRO5oSRXnwnmA78fQ==", "dev": true, "license": "MIT", "dependencies": { - "magic-string": "^0.30.5", - "pathe": "^1.1.1", - "pretty-format": "^29.7.0" + "@vitest/pretty-format": "3.2.4", + "magic-string": "^0.30.17", + "pathe": "^2.0.3" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/spy": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.6.1.tgz", - "integrity": "sha512-MGcMmpGkZebsMZhbQKkAf9CX5zGvjkBTqf8Zx3ApYWXr3wG+QvEu2eXWfnIIWYSJExIp4V9FCKDEeygzkYrXMw==", + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-3.2.4.tgz", + "integrity": "sha512-vAfasCOe6AIK70iP5UD11Ac4siNUNJ9i/9PZ3NKx07sG6sUxeag1LWdNrMWeKKYBLlzuK+Gn65Yd5nyL6ds+nw==", "dev": true, "license": "MIT", "dependencies": { - "tinyspy": "^2.2.0" + "tinyspy": "^4.0.3" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/utils": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.6.1.tgz", - "integrity": "sha512-jOrrUvXM4Av9ZWiG1EajNto0u96kWAhJ1LmPmJhXXQx/32MecEKd10pOLYgS2BQx1TgkGhloPU1ArDW2vvaY6g==", + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-3.2.4.tgz", + "integrity": "sha512-fB2V0JFrQSMsCo9HiSq3Ezpdv4iYaXRG1Sx8edX3MwxfyNn83mKiGzOcH+Fkxt4MHxr3y42fQi1oeAInqgX2QA==", "dev": true, "license": "MIT", "dependencies": { - "diff-sequences": "^29.6.3", - "estree-walker": "^3.0.3", - "loupe": "^2.3.7", - "pretty-format": "^29.7.0" + "@vitest/pretty-format": "3.2.4", + "loupe": "^3.1.4", + "tinyrainbow": "^2.0.0" }, "funding": { "url": "https://opencollective.com/vitest" } }, - "node_modules/acorn": { - "version": "8.15.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", - "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", - "dev": true, - "license": "MIT", - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/acorn-walk": { - "version": "8.3.4", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz", - "integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==", - "dev": true, - "license": "MIT", - "dependencies": { - "acorn": "^8.11.0" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/ansi-styles": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, "node_modules/assertion-error": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", - "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", "dev": true, "license": "MIT", "engines": { - "node": "*" + "node": ">=12" } }, "node_modules/cac": { @@ -888,57 +938,30 @@ } }, "node_modules/chai": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.5.0.tgz", - "integrity": "sha512-RITGBfijLkBddZvnn8jdqoTypxvqbOLYQkGGxXzeFjVHvudaPw0HNFD9x928/eUwYWd2dPCugVqspGALTZZQKw==", + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/chai/-/chai-5.3.3.tgz", + "integrity": "sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==", "dev": true, "license": "MIT", "dependencies": { - "assertion-error": "^1.1.0", - "check-error": "^1.0.3", - "deep-eql": "^4.1.3", - "get-func-name": "^2.0.2", - "loupe": "^2.3.6", - "pathval": "^1.1.1", - "type-detect": "^4.1.0" + "assertion-error": "^2.0.1", + "check-error": "^2.1.1", + "deep-eql": "^5.0.1", + "loupe": "^3.1.0", + "pathval": "^2.0.0" }, "engines": { - "node": ">=4" + "node": ">=18" } }, "node_modules/check-error": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", - "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.1.tgz", + "integrity": "sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==", "dev": true, "license": "MIT", - "dependencies": { - "get-func-name": "^2.0.2" - }, "engines": { - "node": "*" - } - }, - "node_modules/confbox": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.8.tgz", - "integrity": "sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==", - "dev": true, - "license": "MIT" - }, - "node_modules/cross-spawn": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", - "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", - "dev": true, - "license": "MIT", - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" + "node": ">= 16" } }, "node_modules/debug": { @@ -960,32 +983,26 @@ } }, "node_modules/deep-eql": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.4.tgz", - "integrity": "sha512-SUwdGfqdKOwxCPeVYjwSyRpJ7Z+fhpwIAtmCUdZIWZ/YP5R9WAsyuSgpLVDi9bjWoN2LXHNss/dk3urXtdQxGg==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz", + "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==", "dev": true, "license": "MIT", - "dependencies": { - "type-detect": "^4.0.0" - }, "engines": { "node": ">=6" } }, - "node_modules/diff-sequences": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", - "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", + "node_modules/es-module-lexer": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.7.0.tgz", + "integrity": "sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==", "dev": true, - "license": "MIT", - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } + "license": "MIT" }, "node_modules/esbuild": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", - "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.9.tgz", + "integrity": "sha512-CRbODhYyQx3qp7ZEwzxOk4JBqmD/seJrzPa/cGjY1VtIn5E09Oi9/dB4JwctnfZ8Q8iT7rioVv5k/FNT/uf54g==", "dev": true, "hasInstallScript": true, "license": "MIT", @@ -993,32 +1010,35 @@ "esbuild": "bin/esbuild" }, "engines": { - "node": ">=12" + "node": ">=18" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.21.5", - "@esbuild/android-arm": "0.21.5", - "@esbuild/android-arm64": "0.21.5", - "@esbuild/android-x64": "0.21.5", - "@esbuild/darwin-arm64": "0.21.5", - "@esbuild/darwin-x64": "0.21.5", - "@esbuild/freebsd-arm64": "0.21.5", - "@esbuild/freebsd-x64": "0.21.5", - "@esbuild/linux-arm": "0.21.5", - "@esbuild/linux-arm64": "0.21.5", - "@esbuild/linux-ia32": "0.21.5", - "@esbuild/linux-loong64": "0.21.5", - "@esbuild/linux-mips64el": "0.21.5", - "@esbuild/linux-ppc64": "0.21.5", - "@esbuild/linux-riscv64": "0.21.5", - "@esbuild/linux-s390x": "0.21.5", - "@esbuild/linux-x64": "0.21.5", - "@esbuild/netbsd-x64": "0.21.5", - "@esbuild/openbsd-x64": "0.21.5", - "@esbuild/sunos-x64": "0.21.5", - "@esbuild/win32-arm64": "0.21.5", - "@esbuild/win32-ia32": "0.21.5", - "@esbuild/win32-x64": "0.21.5" + "@esbuild/aix-ppc64": "0.25.9", + "@esbuild/android-arm": "0.25.9", + "@esbuild/android-arm64": "0.25.9", + "@esbuild/android-x64": "0.25.9", + "@esbuild/darwin-arm64": "0.25.9", + "@esbuild/darwin-x64": "0.25.9", + "@esbuild/freebsd-arm64": "0.25.9", + "@esbuild/freebsd-x64": "0.25.9", + "@esbuild/linux-arm": "0.25.9", + "@esbuild/linux-arm64": "0.25.9", + "@esbuild/linux-ia32": "0.25.9", + "@esbuild/linux-loong64": "0.25.9", + "@esbuild/linux-mips64el": "0.25.9", + "@esbuild/linux-ppc64": "0.25.9", + "@esbuild/linux-riscv64": "0.25.9", + "@esbuild/linux-s390x": "0.25.9", + "@esbuild/linux-x64": "0.25.9", + "@esbuild/netbsd-arm64": "0.25.9", + "@esbuild/netbsd-x64": "0.25.9", + "@esbuild/openbsd-arm64": "0.25.9", + "@esbuild/openbsd-x64": "0.25.9", + "@esbuild/openharmony-arm64": "0.25.9", + "@esbuild/sunos-x64": "0.25.9", + "@esbuild/win32-arm64": "0.25.9", + "@esbuild/win32-ia32": "0.25.9", + "@esbuild/win32-x64": "0.25.9" } }, "node_modules/estree-walker": { @@ -1031,28 +1051,32 @@ "@types/estree": "^1.0.0" } }, - "node_modules/execa": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", - "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", + "node_modules/expect-type": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.2.2.tgz", + "integrity": "sha512-JhFGDVJ7tmDJItKhYgJCGLOWjuK9vPxiXoUFLwLDc99NlmklilbiQJwoctZtt13+xMw91MCk/REan6MWHqDjyA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", "dev": true, "license": "MIT", - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^8.0.1", - "human-signals": "^5.0.0", - "is-stream": "^3.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^5.1.0", - "onetime": "^6.0.0", - "signal-exit": "^4.1.0", - "strip-final-newline": "^3.0.0" - }, "engines": { - "node": ">=16.17" + "node": ">=12.0.0" }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } } }, "node_modules/fsevents": { @@ -1070,59 +1094,6 @@ "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, - "node_modules/get-func-name": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", - "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": "*" - } - }, - "node_modules/get-stream": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", - "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/human-signals": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", - "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=16.17.0" - } - }, - "node_modules/is-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", - "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true, - "license": "ISC" - }, "node_modules/js-tokens": { "version": "9.0.1", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.1.tgz", @@ -1130,32 +1101,12 @@ "dev": true, "license": "MIT" }, - "node_modules/local-pkg": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.5.1.tgz", - "integrity": "sha512-9rrA30MRRP3gBD3HTGnC6cDFpaE1kVDWxWgqWJUN0RvDNAo+Nz/9GxB+nHOH0ifbVFy0hSA1V6vFDvnx54lTEQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "mlly": "^1.7.3", - "pkg-types": "^1.2.1" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/antfu" - } - }, "node_modules/loupe": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", - "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.2.1.tgz", + "integrity": "sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ==", "dev": true, - "license": "MIT", - "dependencies": { - "get-func-name": "^2.0.1" - } + "license": "MIT" }, "node_modules/magic-string": { "version": "0.30.18", @@ -1167,46 +1118,6 @@ "@jridgewell/sourcemap-codec": "^1.5.5" } }, - "node_modules/merge-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true, - "license": "MIT" - }, - "node_modules/mimic-fn": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", - "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/mlly": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.8.0.tgz", - "integrity": "sha512-l8D9ODSRWLe2KHJSifWGwBqpTZXIXTeo8mlKjY+E2HAakaTeNpqAyBZ8GSqLzHgw4XmHmC8whvpjJNMbFZN7/g==", - "dev": true, - "license": "MIT", - "dependencies": { - "acorn": "^8.15.0", - "pathe": "^2.0.3", - "pkg-types": "^1.3.1", - "ufo": "^1.6.1" - } - }, - "node_modules/mlly/node_modules/pathe": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", - "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", - "dev": true, - "license": "MIT" - }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -1233,92 +1144,21 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, - "node_modules/npm-run-path": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", - "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "path-key": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/npm-run-path/node_modules/path-key": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", - "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/onetime": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", - "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "mimic-fn": "^4.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-limit": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-5.0.0.tgz", - "integrity": "sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "yocto-queue": "^1.0.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/pathe": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", - "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", "dev": true, "license": "MIT" }, "node_modules/pathval": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", - "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.1.tgz", + "integrity": "sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==", "dev": true, "license": "MIT", "engines": { - "node": "*" + "node": ">= 14.16" } }, "node_modules/picocolors": { @@ -1328,25 +1168,19 @@ "dev": true, "license": "ISC" }, - "node_modules/pkg-types": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.3.1.tgz", - "integrity": "sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==", + "node_modules/picomatch": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "dev": true, "license": "MIT", - "dependencies": { - "confbox": "^0.1.8", - "mlly": "^1.7.4", - "pathe": "^2.0.1" + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/pkg-types/node_modules/pathe": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", - "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", - "dev": true, - "license": "MIT" - }, "node_modules/postcss": { "version": "8.5.6", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz", @@ -1376,28 +1210,6 @@ "node": "^10 || ^12 || >=14" } }, - "node_modules/pretty-format": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", - "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/schemas": "^29.6.3", - "ansi-styles": "^5.0.0", - "react-is": "^18.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/react-is": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", - "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", - "dev": true, - "license": "MIT" - }, "node_modules/rollup": { "version": "4.50.0", "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.50.0.tgz", @@ -1439,29 +1251,6 @@ "fsevents": "~2.3.2" } }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "license": "MIT", - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/shell-quote": { "version": "1.8.3", "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.3.tgz", @@ -1481,19 +1270,6 @@ "dev": true, "license": "ISC" }, - "node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/source-map-js": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", @@ -1518,23 +1294,10 @@ "dev": true, "license": "MIT" }, - "node_modules/strip-final-newline": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", - "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/strip-literal": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-2.1.1.tgz", - "integrity": "sha512-631UJ6O00eNGfMiWG78ck80dfBab8X6IVFB51jZK5Icd7XAs60Z5y7QdSd/wGIklnWvRbUNloVzhOKKmutxQ6Q==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-3.0.0.tgz", + "integrity": "sha512-TcccoMhJOM3OebGhSBEmp3UZ2SfDMZUEBdRA/9ynfLi8yYajyWX3JiXArcJt4Umh4vISpspkQIY8ZZoCqjbviA==", "dev": true, "license": "MIT", "dependencies": { @@ -1551,10 +1314,44 @@ "dev": true, "license": "MIT" }, + "node_modules/tinyexec": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.2.tgz", + "integrity": "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinyglobby": { + "version": "0.2.14", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.14.tgz", + "integrity": "sha512-tX5e7OM1HnYr2+a2C/4V0htOcSQcoSTH9KgJnVvNm5zm/cyEWKJ7j7YutsH9CxMdtOkkLFy2AHrMci9IM8IPZQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.4.4", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, "node_modules/tinypool": { - "version": "0.8.4", - "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.8.4.tgz", - "integrity": "sha512-i11VH5gS6IFeLY3gMBQ00/MmLncVP7JLXOw1vlgkytLmJK7QnEr7NXf0LBdxfmNPAeyetukOk0bOYrJrFGjYJQ==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.1.1.tgz", + "integrity": "sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.0.0 || >=20.0.0" + } + }, + "node_modules/tinyrainbow": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-2.0.0.tgz", + "integrity": "sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==", "dev": true, "license": "MIT", "engines": { @@ -1562,25 +1359,15 @@ } }, "node_modules/tinyspy": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.2.1.tgz", - "integrity": "sha512-KYad6Vy5VDWV4GH3fjpseMQ/XU2BhIYP7Vzd0LG44qRWm/Yt2WCOTicFdvmgo6gWaqooMQCawTtILVQJupKu7A==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-4.0.3.tgz", + "integrity": "sha512-t2T/WLB2WRgZ9EpE4jgPJ9w+i66UZfDc8wHh0xrwiRNN+UwH98GIJkTeZqX9rg0i0ptwzqW+uYeIF0T4F8LR7A==", "dev": true, "license": "MIT", "engines": { "node": ">=14.0.0" } }, - "node_modules/type-detect": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.1.0.tgz", - "integrity": "sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, "node_modules/typescript": { "version": "5.9.2", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.2.tgz", @@ -1595,13 +1382,6 @@ "node": ">=14.17" } }, - "node_modules/ufo": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.6.1.tgz", - "integrity": "sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA==", - "dev": true, - "license": "MIT" - }, "node_modules/undici-types": { "version": "6.21.0", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", @@ -1610,21 +1390,24 @@ "license": "MIT" }, "node_modules/vite": { - "version": "5.4.19", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.19.tgz", - "integrity": "sha512-qO3aKv3HoQC8QKiNSTuUM1l9o/XX3+c+VTgLHbJWHZGeTPVAg2XwazI9UWzoxjIJCGCV2zU60uqMzjeLZuULqA==", + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/vite/-/vite-7.1.4.tgz", + "integrity": "sha512-X5QFK4SGynAeeIt+A7ZWnApdUyHYm+pzv/8/A57LqSGcI88U6R6ipOs3uCesdc6yl7nl+zNO0t8LmqAdXcQihw==", "dev": true, "license": "MIT", "dependencies": { - "esbuild": "^0.21.3", - "postcss": "^8.4.43", - "rollup": "^4.20.0" + "esbuild": "^0.25.0", + "fdir": "^6.5.0", + "picomatch": "^4.0.3", + "postcss": "^8.5.6", + "rollup": "^4.43.0", + "tinyglobby": "^0.2.14" }, "bin": { "vite": "bin/vite.js" }, "engines": { - "node": "^18.0.0 || >=20.0.0" + "node": "^20.19.0 || >=22.12.0" }, "funding": { "url": "https://github.com/vitejs/vite?sponsor=1" @@ -1633,19 +1416,25 @@ "fsevents": "~2.3.3" }, "peerDependencies": { - "@types/node": "^18.0.0 || >=20.0.0", - "less": "*", + "@types/node": "^20.19.0 || >=22.12.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", "lightningcss": "^1.21.0", - "sass": "*", - "sass-embedded": "*", - "stylus": "*", - "sugarss": "*", - "terser": "^5.4.0" + "sass": "^1.70.0", + "sass-embedded": "^1.70.0", + "stylus": ">=0.54.8", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" }, "peerDependenciesMeta": { "@types/node": { "optional": true }, + "jiti": { + "optional": true + }, "less": { "optional": true }, @@ -1666,74 +1455,84 @@ }, "terser": { "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true } } }, "node_modules/vite-node": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.6.1.tgz", - "integrity": "sha512-YAXkfvGtuTzwWbDSACdJSg4A4DZiAqckWe90Zapc/sEX3XvHcw1NdurM/6od8J207tSDqNbSsgdCacBgvJKFuA==", + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-3.2.4.tgz", + "integrity": "sha512-EbKSKh+bh1E1IFxeO0pg1n4dvoOTt0UDiXMd/qn++r98+jPO1xtJilvXldeuQ8giIB5IkpjCgMleHMNEsGH6pg==", "dev": true, "license": "MIT", "dependencies": { "cac": "^6.7.14", - "debug": "^4.3.4", - "pathe": "^1.1.1", - "picocolors": "^1.0.0", - "vite": "^5.0.0" + "debug": "^4.4.1", + "es-module-lexer": "^1.7.0", + "pathe": "^2.0.3", + "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0" }, "bin": { "vite-node": "vite-node.mjs" }, "engines": { - "node": "^18.0.0 || >=20.0.0" + "node": "^18.0.0 || ^20.0.0 || >=22.0.0" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/vitest": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.6.1.tgz", - "integrity": "sha512-Ljb1cnSJSivGN0LqXd/zmDbWEM0RNNg2t1QW/XUhYl/qPqyu7CsqeWtqQXHVaJsecLPuDoak2oJcZN2QoRIOag==", + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-3.2.4.tgz", + "integrity": "sha512-LUCP5ev3GURDysTWiP47wRRUpLKMOfPh+yKTx3kVIEiu5KOMeqzpnYNsKyOoVrULivR8tLcks4+lga33Whn90A==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/expect": "1.6.1", - "@vitest/runner": "1.6.1", - "@vitest/snapshot": "1.6.1", - "@vitest/spy": "1.6.1", - "@vitest/utils": "1.6.1", - "acorn-walk": "^8.3.2", - "chai": "^4.3.10", - "debug": "^4.3.4", - "execa": "^8.0.1", - "local-pkg": "^0.5.0", - "magic-string": "^0.30.5", - "pathe": "^1.1.1", - "picocolors": "^1.0.0", - "std-env": "^3.5.0", - "strip-literal": "^2.0.0", - "tinybench": "^2.5.1", - "tinypool": "^0.8.3", - "vite": "^5.0.0", - "vite-node": "1.6.1", - "why-is-node-running": "^2.2.2" + "@types/chai": "^5.2.2", + "@vitest/expect": "3.2.4", + "@vitest/mocker": "3.2.4", + "@vitest/pretty-format": "^3.2.4", + "@vitest/runner": "3.2.4", + "@vitest/snapshot": "3.2.4", + "@vitest/spy": "3.2.4", + "@vitest/utils": "3.2.4", + "chai": "^5.2.0", + "debug": "^4.4.1", + "expect-type": "^1.2.1", + "magic-string": "^0.30.17", + "pathe": "^2.0.3", + "picomatch": "^4.0.2", + "std-env": "^3.9.0", + "tinybench": "^2.9.0", + "tinyexec": "^0.3.2", + "tinyglobby": "^0.2.14", + "tinypool": "^1.1.1", + "tinyrainbow": "^2.0.0", + "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0", + "vite-node": "3.2.4", + "why-is-node-running": "^2.3.0" }, "bin": { "vitest": "vitest.mjs" }, "engines": { - "node": "^18.0.0 || >=20.0.0" + "node": "^18.0.0 || ^20.0.0 || >=22.0.0" }, "funding": { "url": "https://opencollective.com/vitest" }, "peerDependencies": { "@edge-runtime/vm": "*", - "@types/node": "^18.0.0 || >=20.0.0", - "@vitest/browser": "1.6.1", - "@vitest/ui": "1.6.1", + "@types/debug": "^4.1.12", + "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", + "@vitest/browser": "3.2.4", + "@vitest/ui": "3.2.4", "happy-dom": "*", "jsdom": "*" }, @@ -1741,6 +1540,9 @@ "@edge-runtime/vm": { "optional": true }, + "@types/debug": { + "optional": true + }, "@types/node": { "optional": true }, @@ -1758,22 +1560,6 @@ } } }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "license": "ISC", - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/why-is-node-running": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", @@ -1790,19 +1576,6 @@ "engines": { "node": ">=8" } - }, - "node_modules/yocto-queue": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.2.1.tgz", - "integrity": "sha512-AyeEbWOu/TAXdxlV9wmGcR0+yh2j3vYPGOECcIj2S7MkrLyC7ne+oye2BKTItt0ii2PHk4cDy+95+LshzbXnGg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12.20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } } } } diff --git a/packages/terminal-security/package.json b/packages/terminal-security/package.json index 67c7c2aa6..459560acf 100644 --- a/packages/terminal-security/package.json +++ b/packages/terminal-security/package.json @@ -17,7 +17,7 @@ "@types/node": "^20.11.19", "@types/shell-quote": "^1.7.5", "typescript": "^5.5.2", - "vitest": "^1.6.0" + "vitest": "^3.2.4" }, "dependencies": { "shell-quote": "^1.8.1" From bb4c484c0f661ba71642038487494ad763a041a9 Mon Sep 17 00:00:00 2001 From: Ting-Wai To <40179554+tingwai@users.noreply.github.com> Date: Thu, 4 Sep 2025 14:28:28 -0700 Subject: [PATCH 43/76] fix: bump semver check for extension release --- .github/workflows/main.yaml | 2 +- CONTRIBUTING.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 785044868..67dfc6c6c 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -20,7 +20,7 @@ jobs: - id: check working-directory: . run: | - if [[ "${{ github.event.release.tag_name }}" == v1.0.*-vscode ]]; then + if [[ "${{ github.event.release.tag_name }}" == v1.2.*-vscode ]]; then echo "should_run=true" >> $GITHUB_OUTPUT else echo "should_run=false" >> $GITHUB_OUTPUT diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3993294b4..21c645480 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -176,9 +176,9 @@ See [`intellij/CONTRIBUTING.md`](./extensions/intellij/CONTRIBUTING.md) for the ### Our Git Workflow We keep a single permanent branch: `main`. When we are ready to create a "pre-release" version, we create a tag on the -`main` branch titled `v1.1.x-vscode`, which automatically triggers the workflow +`main` branch titled `v1.3.x-vscode`, which automatically triggers the workflow in [preview.yaml](./.github/workflows/preview.yaml), which builds and releases a version of the VS Code extension. When -a release has been sufficiently tested, we will create a new release titled `v1.0x-vscode`, triggering a similar +a release has been sufficiently tested, we will create a new release titled `v1.2.x-vscode`, triggering a similar workflow in [main.yaml](./.github/workflows/main.yaml), which will build and release a main release of the VS Code extension. Any hotfixes can be made by creating a feature branch from the tag for the release in question. This workflow is well explained by . From 06574b506b306cf978eab092e907a10d0d3c46e2 Mon Sep 17 00:00:00 2001 From: Ting-Wai To <40179554+tingwai@users.noreply.github.com> Date: Thu, 4 Sep 2025 17:09:40 -0700 Subject: [PATCH 44/76] chore: disable fail-fast for cli workflow There's some flakey tests in cli test suite, let's not fail fast so one failed matrix won't immediately stop all other running matrixes. --- .github/workflows/cli-pr-checks.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cli-pr-checks.yml b/.github/workflows/cli-pr-checks.yml index 43a78d06e..94987f57b 100644 --- a/.github/workflows/cli-pr-checks.yml +++ b/.github/workflows/cli-pr-checks.yml @@ -59,6 +59,7 @@ jobs: matrix: os: [ubuntu-latest, windows-latest, macos-latest] node-version: [18, 20, 22, 24] + fail-fast: false runs-on: ${{ matrix.os }} steps: From 3ca8a7b6369c3f1ac863cc180ef01f5ab1bb0dd4 Mon Sep 17 00:00:00 2001 From: Nate Date: Thu, 4 Sep 2025 20:31:48 -0700 Subject: [PATCH 45/76] Handle review comment threads in GitHub workflow --- .github/workflows/respond-to-cubic.yaml | 41 +++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/.github/workflows/respond-to-cubic.yaml b/.github/workflows/respond-to-cubic.yaml index 4be94e462..2f3da84bc 100644 --- a/.github/workflows/respond-to-cubic.yaml +++ b/.github/workflows/respond-to-cubic.yaml @@ -172,6 +172,40 @@ jobs: if: steps.check-mention.outputs.contains_mention == 'true' run: npm i -g @continuedev/cli + - name: Get review context + if: steps.check-mention.outputs.contains_mention == 'true' + id: review-context + uses: actions/github-script@v7 + with: + script: | + let reviewContext = ''; + + // Check if this comment is a reply to another review comment + if (context.payload.comment.in_reply_to_id) { + try { + const { data: originalComment } = await github.rest.pulls.getReviewComment({ + owner: context.repo.owner, + repo: context.repo.repo, + comment_id: context.payload.comment.in_reply_to_id + }); + + reviewContext = `**Original review comment by @${originalComment.user.login}:** + ${originalComment.body} + + **Reply by @${{ github.event.comment.user.login }}:** + ${{ github.event.comment.body }}`; + } catch (error) { + console.log('Could not fetch original comment, using current comment only'); + reviewContext = `**Review comment by @${{ github.event.comment.user.login }}:** + ${{ github.event.comment.body }}`; + } + } else { + reviewContext = `**Review comment by @${{ github.event.comment.user.login }}:** + ${{ github.event.comment.body }}`; + } + + core.setOutput('context', reviewContext); + - name: Start remote session if: steps.check-mention.outputs.contains_mention == 'true' id: remote-session @@ -180,13 +214,14 @@ jobs: run: | # Create a temporary file for the prompt to handle special characters and newlines properly cat > /tmp/prompt.txt << 'PROMPT_EOF' - Please help with the following code review comment from @${{ github.event.comment.user.login }} on PR #${{ github.event.pull_request.number }}: + Please help with the following code review discussion from PR #${{ github.event.pull_request.number }}: **File:** ${{ github.event.comment.path }} **Line:** ${{ github.event.comment.line || github.event.comment.original_line || 'N/A' }} - **Comment:** ${{ github.event.comment.body }} - Please analyze the specific file and line mentioned, understand the review feedback, implement the necessary changes, and commit them to this branch. + ${{ steps.review-context.outputs.context }} + + Please analyze the specific file and line mentioned, understand the review feedback and any discussion context, implement the necessary changes, and commit them to this branch. PROMPT_EOF # Debug output From 212cad2e351e789bffa23ca9a1ec90c6448a5f03 Mon Sep 17 00:00:00 2001 From: Nate Date: Thu, 4 Sep 2025 20:34:13 -0700 Subject: [PATCH 46/76] echo branch for debuggng --- .github/workflows/respond-to-cubic.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/respond-to-cubic.yaml b/.github/workflows/respond-to-cubic.yaml index 2f3da84bc..d462b26ba 100644 --- a/.github/workflows/respond-to-cubic.yaml +++ b/.github/workflows/respond-to-cubic.yaml @@ -212,6 +212,9 @@ jobs: env: CONTINUE_API_KEY: ${{ secrets.CONTINUE_API_KEY }} run: | + # Debug: Echo the branch we're starting the session on + echo "Starting remote session on branch: ${{ github.event.pull_request.head.ref }}" + # Create a temporary file for the prompt to handle special characters and newlines properly cat > /tmp/prompt.txt << 'PROMPT_EOF' Please help with the following code review discussion from PR #${{ github.event.pull_request.number }}: From 261d181362e53dfa32dd5a1aa719a33500c1d674 Mon Sep 17 00:00:00 2001 From: Ting-Wai To <40179554+tingwai@users.noreply.github.com> Date: Fri, 5 Sep 2025 00:32:50 -0700 Subject: [PATCH 47/76] fix gemini tests --- packages/openai-adapters/src/apis/Gemini.ts | 7 ++----- packages/openai-adapters/src/apis/Relace.ts | 7 ++----- packages/openai-adapters/src/test/util.ts | 14 +++++++++++--- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/packages/openai-adapters/src/apis/Gemini.ts b/packages/openai-adapters/src/apis/Gemini.ts index 2f2446414..f0cab7693 100644 --- a/packages/openai-adapters/src/apis/Gemini.ts +++ b/packages/openai-adapters/src/apis/Gemini.ts @@ -10,6 +10,7 @@ import { Completion, CompletionCreateParamsNonStreaming, CompletionCreateParamsStreaming, + CompletionUsage, CreateEmbeddingResponse, EmbeddingCreateParams, Model, @@ -38,11 +39,7 @@ import { RerankCreateParams, } from "./base.js"; -type UsageInfo = { - total_tokens: number; - completion_tokens: number; - prompt_tokens: number; -}; +type UsageInfo = Pick; export class GeminiApi implements BaseLlmApi { apiBase: string = "https://generativelanguage.googleapis.com/v1beta/"; diff --git a/packages/openai-adapters/src/apis/Relace.ts b/packages/openai-adapters/src/apis/Relace.ts index c2799d376..37b92b1eb 100644 --- a/packages/openai-adapters/src/apis/Relace.ts +++ b/packages/openai-adapters/src/apis/Relace.ts @@ -2,6 +2,7 @@ import { Completion, CompletionCreateParamsNonStreaming, CompletionCreateParamsStreaming, + CompletionUsage, } from "openai/resources/completions.mjs"; import { CreateEmbeddingResponse, @@ -29,11 +30,7 @@ import { RerankCreateParams, } from "./base.js"; -type UsageInfo = { - total_tokens: number; - completion_tokens: number; - prompt_tokens: number; -}; +type UsageInfo = Pick; // Relace only supports apply through a /v1/apply endpoint export class RelaceApi implements BaseLlmApi { diff --git a/packages/openai-adapters/src/test/util.ts b/packages/openai-adapters/src/test/util.ts index 5c751e792..fbcf51932 100644 --- a/packages/openai-adapters/src/test/util.ts +++ b/packages/openai-adapters/src/test/util.ts @@ -106,9 +106,17 @@ export function testChat( expect(usage).toBeDefined(); expect(usage!.completion_tokens).toBeGreaterThan(0); expect(usage!.prompt_tokens).toBeGreaterThan(0); - expect(usage!.total_tokens).toEqual( - usage!.prompt_tokens + usage!.completion_tokens, - ); + // Gemini 2.5 models have thinking tokens, so total_tokens >= prompt + completion + // Other models should have total_tokens = prompt + completion + if (model.includes('gemini-2.5') || model.includes('gemini-2.0')) { + expect(usage!.total_tokens).toBeGreaterThanOrEqual( + usage!.prompt_tokens + usage!.completion_tokens, + ); + } else { + expect(usage!.total_tokens).toEqual( + usage!.prompt_tokens + usage!.completion_tokens, + ); + } } }); From cbbebe276bc33fecc027e8278d385f7c14038505 Mon Sep 17 00:00:00 2001 From: Ting-Wai To <40179554+tingwai@users.noreply.github.com> Date: Fri, 5 Sep 2025 00:33:02 -0700 Subject: [PATCH 48/76] openai stream include_usage=true --- packages/openai-adapters/src/apis/OpenAI.ts | 5 +++++ packages/openai-adapters/src/test/adapter-test-utils.ts | 1 + 2 files changed, 6 insertions(+) diff --git a/packages/openai-adapters/src/apis/OpenAI.ts b/packages/openai-adapters/src/apis/OpenAI.ts index 714ce67fd..20c914318 100644 --- a/packages/openai-adapters/src/apis/OpenAI.ts +++ b/packages/openai-adapters/src/apis/OpenAI.ts @@ -35,6 +35,11 @@ export class OpenAIApi implements BaseLlmApi { }); } modifyChatBody(body: T): T { + // Add stream_options to include usage in streaming responses + if (body.stream) { + (body as any).stream_options = { include_usage: true }; + } + // o-series models - only apply for official OpenAI API const isOfficialOpenAIAPI = this.apiBase === "https://api.openai.com/v1/"; if (isOfficialOpenAIAPI) { diff --git a/packages/openai-adapters/src/test/adapter-test-utils.ts b/packages/openai-adapters/src/test/adapter-test-utils.ts index e08cb6d09..6c125abf3 100644 --- a/packages/openai-adapters/src/test/adapter-test-utils.ts +++ b/packages/openai-adapters/src/test/adapter-test-utils.ts @@ -258,6 +258,7 @@ export const createAdapterTests = (testConfig: AdapterTestConfig) => { model: "gpt-4", messages: [{ role: "user", content: "hello" }], stream: true, + stream_options: { include_usage: true }, ...testConfig.customBodyOptions, }, }, From 99e2148f1d908b78531e4d3dac9ed34deafa60b4 Mon Sep 17 00:00:00 2001 From: Ting-Wai To <40179554+tingwai@users.noreply.github.com> Date: Fri, 5 Sep 2025 00:59:25 -0700 Subject: [PATCH 49/76] lint --- packages/openai-adapters/src/apis/Gemini.ts | 5 ++++- packages/openai-adapters/src/apis/OpenAI.ts | 2 +- packages/openai-adapters/src/apis/Relace.ts | 5 ++++- packages/openai-adapters/src/test/util.ts | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/openai-adapters/src/apis/Gemini.ts b/packages/openai-adapters/src/apis/Gemini.ts index f0cab7693..b0f32ad46 100644 --- a/packages/openai-adapters/src/apis/Gemini.ts +++ b/packages/openai-adapters/src/apis/Gemini.ts @@ -39,7 +39,10 @@ import { RerankCreateParams, } from "./base.js"; -type UsageInfo = Pick; +type UsageInfo = Pick< + CompletionUsage, + "total_tokens" | "completion_tokens" | "prompt_tokens" +>; export class GeminiApi implements BaseLlmApi { apiBase: string = "https://generativelanguage.googleapis.com/v1beta/"; diff --git a/packages/openai-adapters/src/apis/OpenAI.ts b/packages/openai-adapters/src/apis/OpenAI.ts index 20c914318..310e5ef40 100644 --- a/packages/openai-adapters/src/apis/OpenAI.ts +++ b/packages/openai-adapters/src/apis/OpenAI.ts @@ -39,7 +39,7 @@ export class OpenAIApi implements BaseLlmApi { if (body.stream) { (body as any).stream_options = { include_usage: true }; } - + // o-series models - only apply for official OpenAI API const isOfficialOpenAIAPI = this.apiBase === "https://api.openai.com/v1/"; if (isOfficialOpenAIAPI) { diff --git a/packages/openai-adapters/src/apis/Relace.ts b/packages/openai-adapters/src/apis/Relace.ts index 37b92b1eb..febe38f1c 100644 --- a/packages/openai-adapters/src/apis/Relace.ts +++ b/packages/openai-adapters/src/apis/Relace.ts @@ -30,7 +30,10 @@ import { RerankCreateParams, } from "./base.js"; -type UsageInfo = Pick; +type UsageInfo = Pick< + CompletionUsage, + "total_tokens" | "completion_tokens" | "prompt_tokens" +>; // Relace only supports apply through a /v1/apply endpoint export class RelaceApi implements BaseLlmApi { diff --git a/packages/openai-adapters/src/test/util.ts b/packages/openai-adapters/src/test/util.ts index fbcf51932..f637dec7e 100644 --- a/packages/openai-adapters/src/test/util.ts +++ b/packages/openai-adapters/src/test/util.ts @@ -108,7 +108,7 @@ export function testChat( expect(usage!.prompt_tokens).toBeGreaterThan(0); // Gemini 2.5 models have thinking tokens, so total_tokens >= prompt + completion // Other models should have total_tokens = prompt + completion - if (model.includes('gemini-2.5') || model.includes('gemini-2.0')) { + if (model.includes("gemini-2.5") || model.includes("gemini-2.0")) { expect(usage!.total_tokens).toBeGreaterThanOrEqual( usage!.prompt_tokens + usage!.completion_tokens, ); From 9d2a4819c7d214119358ee70f4a1ab01029c0470 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 5 Sep 2025 09:08:10 +0000 Subject: [PATCH 50/76] build(deps): bump actions/github-script from 7 to 8 Bumps [actions/github-script](https://github.com/actions/github-script) from 7 to 8. - [Release notes](https://github.com/actions/github-script/releases) - [Commits](https://github.com/actions/github-script/compare/v7...v8) --- updated-dependencies: - dependency-name: actions/github-script dependency-version: '8' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/compliance.yaml | 2 +- .github/workflows/label-merged-prs.yml | 2 +- .github/workflows/respond-to-cubic.yaml | 10 +++++----- .github/workflows/similar-issues.yml | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/compliance.yaml b/.github/workflows/compliance.yaml index 76c21d6b1..0e4a04e02 100644 --- a/.github/workflows/compliance.yaml +++ b/.github/workflows/compliance.yaml @@ -41,7 +41,7 @@ jobs: - name: Add PR title guidance comment if: always() && steps.pr-title-check.outputs.valid == 'false' - uses: actions/github-script@v7 + uses: actions/github-script@v8 with: script: | const { data: comments } = await github.rest.issues.listComments({ diff --git a/.github/workflows/label-merged-prs.yml b/.github/workflows/label-merged-prs.yml index d6f83eba8..b434d07fd 100644 --- a/.github/workflows/label-merged-prs.yml +++ b/.github/workflows/label-merged-prs.yml @@ -44,7 +44,7 @@ jobs: - name: Determine and apply tier label if: steps.check-author.outputs.should_label == 'true' - uses: actions/github-script@v7 + uses: actions/github-script@v8 with: script: | const pr = context.payload.pull_request; diff --git a/.github/workflows/respond-to-cubic.yaml b/.github/workflows/respond-to-cubic.yaml index 4be94e462..d683bd883 100644 --- a/.github/workflows/respond-to-cubic.yaml +++ b/.github/workflows/respond-to-cubic.yaml @@ -29,7 +29,7 @@ jobs: - name: Add eyes reaction to comment if: steps.check-mention.outputs.contains_mention == 'true' - uses: actions/github-script@v7 + uses: actions/github-script@v8 with: script: | await github.rest.reactions.createForIssueComment({ @@ -49,7 +49,7 @@ jobs: - name: Get PR information if: steps.check-mention.outputs.contains_mention == 'true' id: pr-info - uses: actions/github-script@v7 + uses: actions/github-script@v8 with: script: | const { data: pr } = await github.rest.pulls.get({ @@ -107,7 +107,7 @@ jobs: - name: Comment with session URL if: steps.check-mention.outputs.contains_mention == 'true' && steps.remote-session.outputs.session_url - uses: actions/github-script@v7 + uses: actions/github-script@v8 with: script: | const commentBody = `I've started [a remote session](${{ steps.remote-session.outputs.session_url }}) to help with your request: @@ -144,7 +144,7 @@ jobs: - name: Add eyes reaction to comment if: steps.check-mention.outputs.contains_mention == 'true' - uses: actions/github-script@v7 + uses: actions/github-script@v8 with: script: | await github.rest.reactions.createForPullRequestReviewComment({ @@ -211,7 +211,7 @@ jobs: - name: Comment with session URL if: steps.check-mention.outputs.contains_mention == 'true' && steps.remote-session.outputs.session_url - uses: actions/github-script@v7 + uses: actions/github-script@v8 with: script: | const commentBody = `I've started [a remote session](${{ steps.remote-session.outputs.session_url }}) to help with your request: diff --git a/.github/workflows/similar-issues.yml b/.github/workflows/similar-issues.yml index 9873a0585..4abf1cdd3 100644 --- a/.github/workflows/similar-issues.yml +++ b/.github/workflows/similar-issues.yml @@ -190,7 +190,7 @@ jobs: echo "confidence=$CONFIDENCE" >> $GITHUB_OUTPUT - name: Comment with analysis - uses: actions/github-script@v7 + uses: actions/github-script@v8 with: script: | let comment = ''; @@ -307,7 +307,7 @@ jobs: - name: Add labels if: github.event_name == 'issues' - uses: actions/github-script@v7 + uses: actions/github-script@v8 with: script: | const labels = []; From 6dae1ed15723312d08312a6384a630031be136b3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 5 Sep 2025 17:47:38 +0000 Subject: [PATCH 51/76] build(deps): bump tmp and @openapitools/openapi-generator-cli Bumps [tmp](https://github.com/raszi/node-tmp) to 0.2.5 and updates ancestor dependency [@openapitools/openapi-generator-cli](https://github.com/OpenAPITools/openapi-generator-cli). These dependencies need to be updated together. Updates `tmp` from 0.2.3 to 0.2.5 - [Changelog](https://github.com/raszi/node-tmp/blob/master/CHANGELOG.md) - [Commits](https://github.com/raszi/node-tmp/compare/v0.2.3...v0.2.5) Updates `@openapitools/openapi-generator-cli` from 2.20.2 to 2.23.1 - [Release notes](https://github.com/OpenAPITools/openapi-generator-cli/releases) - [Changelog](https://github.com/OpenAPITools/openapi-generator-cli/blob/master/.releaserc) - [Commits](https://github.com/OpenAPITools/openapi-generator-cli/compare/v2.20.2...v2.23.1) --- updated-dependencies: - dependency-name: tmp dependency-version: 0.2.5 dependency-type: indirect - dependency-name: "@openapitools/openapi-generator-cli" dependency-version: 2.23.1 dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- extensions/vscode/package-lock.json | 678 +++++++++++++++------------- extensions/vscode/package.json | 2 +- 2 files changed, 368 insertions(+), 312 deletions(-) diff --git a/extensions/vscode/package-lock.json b/extensions/vscode/package-lock.json index d876c83d8..a0fa56130 100644 --- a/extensions/vscode/package-lock.json +++ b/extensions/vscode/package-lock.json @@ -1,12 +1,12 @@ { "name": "continue", - "version": "1.3.2", + "version": "1.3.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "continue", - "version": "1.3.2", + "version": "1.3.3", "license": "Apache-2.0", "dependencies": { "@continuedev/config-types": "file:../../packages/config-types", @@ -63,7 +63,7 @@ "devDependencies": { "@biomejs/biome": "1.6.4", "@nestjs/common": "^11.0.16", - "@openapitools/openapi-generator-cli": "^2.20.0", + "@openapitools/openapi-generator-cli": "^2.23.1", "@types/chai": "^5.0.1", "@types/cors": "^2.8.17", "@types/express": "^4.17.21", @@ -108,6 +108,7 @@ "@continuedev/fetch": "file:../packages/fetch", "@continuedev/llm-info": "file:../packages/llm-info", "@continuedev/openai-adapters": "file:../packages/openai-adapters", + "@continuedev/terminal-security": "file:../packages/terminal-security", "@modelcontextprotocol/sdk": "^1.12.0", "@mozilla/readability": "^0.5.0", "@octokit/rest": "^20.1.1", @@ -745,6 +746,17 @@ "node": ">=14.21.3" } }, + "node_modules/@borewit/text-codec": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@borewit/text-codec/-/text-codec-0.1.1.tgz", + "integrity": "sha512-5L/uBxmjaCIX5h8Z+uu+kA9BQLkc/Wl06UGR5ajNRxu+/XjonB5i8JpgFMrPj3LXTCPA0pv8yxUvbUi+QthGGA==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, "node_modules/@continuedev/config-types": { "resolved": "../../packages/config-types", "link": true @@ -1303,6 +1315,29 @@ "deprecated": "Use @eslint/object-schema instead", "dev": true }, + "node_modules/@isaacs/balanced-match": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@isaacs/balanced-match/-/balanced-match-4.0.1.tgz", + "integrity": "sha512-yzMTt9lEb8Gv7zRioUilSglI0c0smZ9k5D65677DLWLtWJaXIS3CqcGyUFByYKlnUj6TkjLVs54fBl6+TiGQDQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/@isaacs/brace-expansion": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@isaacs/brace-expansion/-/brace-expansion-5.0.0.tgz", + "integrity": "sha512-ZT55BDLV0yv0RBm2czMiZ+SqCGO7AvmOM3G/w2xhVPH+te0aKgFjmBvGlL1dH+ql2tgGO3MVrbb3jCKyvpgnxA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@isaacs/balanced-match": "^4.0.1" + }, + "engines": { + "node": "20 || >=22" + } + }, "node_modules/@isaacs/cliui": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", @@ -1527,9 +1562,9 @@ "integrity": "sha512-/cPZD907UNz55yrc/ud4wDgQKtU1TvkD9jeqZWG6J4IMmZkp6zgjkQcKA8UvpkZlcpPHvc8J17sGzLFbP/LUYg==" }, "node_modules/@nestjs/axios": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@nestjs/axios/-/axios-4.0.0.tgz", - "integrity": "sha512-1cB+Jyltu/uUPNQrpUimRHEQHrnQrpLzVj6dU3dgn6iDDDdahr10TgHFGTmw5VuJ9GzKZsCLDL78VSwJAs/9JQ==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@nestjs/axios/-/axios-4.0.1.tgz", + "integrity": "sha512-68pFJgu+/AZbWkGu65Z3r55bTsCPlgyKaV4BSG8yUAD72q1PPuyVRgUwFv6BxdnibTUHlyxm06FmYWNC+bjN7A==", "dev": true, "license": "MIT", "peerDependencies": { @@ -1539,13 +1574,13 @@ } }, "node_modules/@nestjs/common": { - "version": "11.1.1", - "resolved": "https://registry.npmjs.org/@nestjs/common/-/common-11.1.1.tgz", - "integrity": "sha512-crzp+1qeZ5EGL0nFTPy9NrVMAaUWewV5AwtQyv6SQ9yQPXwRl9W9hm1pt0nAtUu5QbYMbSuo7lYcF81EjM+nCA==", + "version": "11.1.6", + "resolved": "https://registry.npmjs.org/@nestjs/common/-/common-11.1.6.tgz", + "integrity": "sha512-krKwLLcFmeuKDqngG2N/RuZHCs2ycsKcxWIDgcm7i1lf3sQ0iG03ci+DsP/r3FcT/eJDFsIHnKtNta2LIi7PzQ==", "dev": true, "license": "MIT", "dependencies": { - "file-type": "20.5.0", + "file-type": "21.0.0", "iterare": "1.2.1", "load-esm": "1.0.2", "tslib": "2.8.1", @@ -1571,9 +1606,9 @@ } }, "node_modules/@nestjs/core": { - "version": "11.1.1", - "resolved": "https://registry.npmjs.org/@nestjs/core/-/core-11.1.1.tgz", - "integrity": "sha512-UFoUAgLKFT+RwHTANJdr0dF7p0qS9QjkaUPjg8aafnjM/qxxxrUVDB49nVvyMlk+Hr1+vvcNaOHbWWQBxoZcHA==", + "version": "11.1.6", + "resolved": "https://registry.npmjs.org/@nestjs/core/-/core-11.1.6.tgz", + "integrity": "sha512-siWX7UDgErisW18VTeJA+x+/tpNZrJewjTBsRPF3JVxuWRuAB1kRoiJcxHgln8Lb5UY9NdvklITR84DUEXD0Cg==", "dev": true, "hasInstallScript": true, "license": "MIT", @@ -1804,27 +1839,26 @@ } }, "node_modules/@openapitools/openapi-generator-cli": { - "version": "2.20.2", - "resolved": "https://registry.npmjs.org/@openapitools/openapi-generator-cli/-/openapi-generator-cli-2.20.2.tgz", - "integrity": "sha512-dNFwQcQu6+rmEWSJj4KUx468+p6Co7nfpVgi5QEfVhzKj7wBytz9GEhCN2qmVgtg3ZX8H6nxbXI8cjh7hAxAqg==", + "version": "2.23.1", + "resolved": "https://registry.npmjs.org/@openapitools/openapi-generator-cli/-/openapi-generator-cli-2.23.1.tgz", + "integrity": "sha512-Kd5EZqzbcIXf6KRlpUrheHMzQNRHsJWzAGrm4ncWCNhnQl+Mh6TsFcqq+hIetgiFCknWBH6cZ2f37SxPxaon4w==", "dev": true, "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "@nestjs/axios": "4.0.0", - "@nestjs/common": "11.1.1", - "@nestjs/core": "11.1.1", + "@nestjs/axios": "4.0.1", + "@nestjs/common": "11.1.6", + "@nestjs/core": "11.1.6", "@nuxtjs/opencollective": "0.3.2", - "axios": "1.9.0", + "axios": "1.11.0", "chalk": "4.1.2", "commander": "8.3.0", "compare-versions": "4.1.4", - "concurrently": "6.5.1", + "concurrently": "9.2.1", "console.table": "0.10.0", - "fs-extra": "11.3.0", - "glob": "9.3.5", - "inquirer": "8.2.6", - "lodash": "4.17.21", + "fs-extra": "11.3.1", + "glob": "11.0.3", + "inquirer": "8.2.7", "proxy-agent": "6.5.0", "reflect-metadata": "0.2.2", "rxjs": "7.8.2", @@ -1841,19 +1875,10 @@ "url": "https://opencollective.com/openapi_generator" } }, - "node_modules/@openapitools/openapi-generator-cli/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, "node_modules/@openapitools/openapi-generator-cli/node_modules/fs-extra": { - "version": "11.3.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.0.tgz", - "integrity": "sha512-Z4XaCL6dUDHfP/jT25jJKMmtxvuwbkrD1vNSMFlo9lNLY2c5FHYSQgHPRZUjAB26TpDEoW9HCOgplrdbaPV/ew==", + "version": "11.3.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.1.tgz", + "integrity": "sha512-eXvGGwZ5CL17ZSwHWd3bbgk7UUpF6IFHtP57NYYakPvHOs8GDgDe5KJI36jIJzDkJ6eJjuzRA8eBQb6SkKue0g==", "dev": true, "license": "MIT", "dependencies": { @@ -1866,45 +1891,86 @@ } }, "node_modules/@openapitools/openapi-generator-cli/node_modules/glob": { - "version": "9.3.5", - "resolved": "https://registry.npmjs.org/glob/-/glob-9.3.5.tgz", - "integrity": "sha512-e1LleDykUz2Iu+MTYdkSsuWX8lvAjAcs0Xef0lNIu0S2wOAzuTxCJtcd9S3cijlwYF18EsU3rzb8jPVobxDh9Q==", + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.3.tgz", + "integrity": "sha512-2Nim7dha1KVkaiF4q6Dj+ngPPMdfvLJEOpZk/jKiUAkqKebpGAWQXAq9z1xu9HKu5lWfqw/FASuccEjyznjPaA==", "dev": true, + "license": "ISC", "dependencies": { - "fs.realpath": "^1.0.0", - "minimatch": "^8.0.2", - "minipass": "^4.2.4", - "path-scurry": "^1.6.1" + "foreground-child": "^3.3.1", + "jackspeak": "^4.1.1", + "minimatch": "^10.0.3", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^2.0.0" + }, + "bin": { + "glob": "dist/esm/bin.mjs" }, "engines": { - "node": ">=16 || 14 >=14.17" + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@openapitools/openapi-generator-cli/node_modules/jackspeak": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.1.1.tgz", + "integrity": "sha512-zptv57P3GpL+O0I7VdMJNBZCu+BPHVQUk55Ft8/QCJjTVxrnJHuVuX/0Bl2A6/+2oyR/ZMEuFKwmzqqZ/U5nPQ==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "engines": { + "node": "20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, "node_modules/@openapitools/openapi-generator-cli/node_modules/minimatch": { - "version": "8.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-8.0.4.tgz", - "integrity": "sha512-W0Wvr9HyFXZRGIDgCicunpQ299OKXs9RgZfaukz4qAW/pJhcpUfupc9c+OObPOFueNy8VSrZgEmDtk6Kh4WzDA==", + "version": "10.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.3.tgz", + "integrity": "sha512-IPZ167aShDZZUMdRk66cyQAW3qr0WzbHkPdMYa8bzZhlHhO3jALbKdxcaak7W9FfT2rZNpQuUu4Od7ILEpXSaw==", "dev": true, + "license": "ISC", "dependencies": { - "brace-expansion": "^2.0.1" + "@isaacs/brace-expansion": "^5.0.0" }, "engines": { - "node": ">=16 || 14 >=14.17" + "node": "20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, "node_modules/@openapitools/openapi-generator-cli/node_modules/minipass": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-4.2.8.tgz", - "integrity": "sha512-fNzuVyifolSLFL4NzpF+wEF4qrgqaaKX0haXPQEdQ7NKAN+WecoKMHV09YcuL/DHxrUsYQOK3MiuDf7Ip2OXfQ==", + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", "dev": true, + "license": "ISC", "engines": { - "node": ">=8" + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/@openapitools/openapi-generator-cli/node_modules/path-scurry": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz", + "integrity": "sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^11.0.0", + "minipass": "^7.1.2" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/@pkgjs/parseargs": { @@ -3496,6 +3562,7 @@ "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", "dev": true, + "license": "MIT", "dependencies": { "type-fest": "^0.21.3" }, @@ -3511,6 +3578,7 @@ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", "dev": true, + "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=10" }, @@ -3730,13 +3798,13 @@ "integrity": "sha512-lHe62zvbTB5eEABUVi/AwVh0ZKY9rMMDhmm+eeyuuUQbQ3+J+fONVQOZyj+DdrvD4BY33uYniyRJ4UJIaSKAfw==" }, "node_modules/axios": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.9.0.tgz", - "integrity": "sha512-re4CqKTJaURpzbLHtIi6XpDv20/CnpXOtjRY5/CU32L8gU8ek9UIivcfvSWvmKEngmVbrUtPpdDwWDWL7DNHvg==", + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.11.0.tgz", + "integrity": "sha512-1Lx3WLFQWm3ooKDYZD1eXmoGO9fxYQjrycfHFC8P0sCfQVXyROp0p9PFWBehewBOdCwHc+f/b8I0fMto5eSfwA==", "license": "MIT", "dependencies": { "follow-redirects": "^1.15.6", - "form-data": "^4.0.0", + "form-data": "^4.0.4", "proxy-from-env": "^1.1.0" } }, @@ -4174,6 +4242,19 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/call-me-maybe": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.2.tgz", @@ -4280,10 +4361,11 @@ } }, "node_modules/chardet": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", - "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", - "dev": true + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-2.1.0.tgz", + "integrity": "sha512-bNFETTG/pM5ryzQ9Ad0lJOTa6HWD/YsScAR3EnCPZRPlQh77JocYktSHOUHelyhm8IARL+o4c4F1bP5KVOjiRA==", + "dev": true, + "license": "MIT" }, "node_modules/check-error": { "version": "1.0.3", @@ -4455,6 +4537,7 @@ "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", "dev": true, + "license": "ISC", "engines": { "node": ">= 10" } @@ -4846,69 +4929,28 @@ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" }, "node_modules/concurrently": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-6.5.1.tgz", - "integrity": "sha512-FlSwNpGjWQfRwPLXvJ/OgysbBxPkWpiVjy1042b0U7on7S7qwwMIILRj7WTN1mTgqa582bG6NFuScOoh6Zgdag==", + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-9.2.1.tgz", + "integrity": "sha512-fsfrO0MxV64Znoy8/l1vVIjjHa29SZyyqPgQBwhiDcaW8wJc2W3XWVOGx4M3oJBnv/zdUZIIp1gDeS98GzP8Ng==", "dev": true, + "license": "MIT", "dependencies": { - "chalk": "^4.1.0", - "date-fns": "^2.16.1", - "lodash": "^4.17.21", - "rxjs": "^6.6.3", - "spawn-command": "^0.0.2-1", - "supports-color": "^8.1.0", - "tree-kill": "^1.2.2", - "yargs": "^16.2.0" + "chalk": "4.1.2", + "rxjs": "7.8.2", + "shell-quote": "1.8.3", + "supports-color": "8.1.1", + "tree-kill": "1.2.2", + "yargs": "17.7.2" }, "bin": { - "concurrently": "bin/concurrently.js" + "conc": "dist/bin/concurrently.js", + "concurrently": "dist/bin/concurrently.js" }, "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/concurrently/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/concurrently/node_modules/cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - "dev": true, - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, - "node_modules/concurrently/node_modules/rxjs": { - "version": "6.6.7", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", - "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", - "dev": true, - "dependencies": { - "tslib": "^1.9.0" + "node": ">=18" }, - "engines": { - "npm": ">=2.0.0" - } - }, - "node_modules/concurrently/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" + "funding": { + "url": "https://github.com/open-cli-tools/concurrently?sponsor=1" } }, "node_modules/concurrently/node_modules/supports-color": { @@ -4916,6 +4958,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -4926,47 +4969,6 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, - "node_modules/concurrently/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, - "node_modules/concurrently/node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/concurrently/node_modules/yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", - "dev": true, - "dependencies": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/consola": { "version": "3.4.2", "resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz", @@ -5057,9 +5059,10 @@ } }, "node_modules/cross-spawn": { - "version": "7.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.5.tgz", - "integrity": "sha512-ZVJrKKYunU38/76t0RMOulHOnUcbU9GbpWKAOZ0mhjr7CX6FVrH+4FrAapSOekrgFQ3f/8gwMEuIft0aKq6Hug==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "license": "MIT", "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -5168,22 +5171,6 @@ "node": ">=18" } }, - "node_modules/date-fns": { - "version": "2.30.0", - "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz", - "integrity": "sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==", - "dev": true, - "dependencies": { - "@babel/runtime": "^7.21.0" - }, - "engines": { - "node": ">=0.11" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/date-fns" - } - }, "node_modules/dbinfoz": { "version": "0.14.0", "resolved": "https://registry.npmjs.org/dbinfoz/-/dbinfoz-0.14.0.tgz", @@ -5515,6 +5502,20 @@ "react": ">=16.12.0" } }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/duplexer2": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", @@ -5673,12 +5674,10 @@ "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==" }, "node_modules/es-define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", - "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", - "dependencies": { - "get-intrinsic": "^1.2.4" - }, + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", "engines": { "node": ">= 0.4" } @@ -5697,6 +5696,33 @@ "integrity": "sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==", "license": "MIT" }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/es5-ext": { "version": "0.10.64", "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.64.tgz", @@ -6257,44 +6283,6 @@ "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" }, - "node_modules/external-editor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", - "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", - "dev": true, - "dependencies": { - "chardet": "^0.7.0", - "iconv-lite": "^0.4.24", - "tmp": "^0.0.33" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/external-editor/node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dev": true, - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/external-editor/node_modules/tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", - "dev": true, - "dependencies": { - "os-tmpdir": "~1.0.2" - }, - "engines": { - "node": ">=0.6.0" - } - }, "node_modules/extsprintf": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", @@ -6402,6 +6390,7 @@ "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", "dev": true, + "license": "MIT", "dependencies": { "escape-string-regexp": "^1.0.5" }, @@ -6417,6 +6406,7 @@ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.8.0" } @@ -6434,19 +6424,19 @@ } }, "node_modules/file-type": { - "version": "20.5.0", - "resolved": "https://registry.npmjs.org/file-type/-/file-type-20.5.0.tgz", - "integrity": "sha512-BfHZtG/l9iMm4Ecianu7P8HRD2tBHLtjXinm4X62XBOYzi7CYA7jyqfJzOvXHqzVrVPYqBo2/GvbARMaaJkKVg==", + "version": "21.0.0", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-21.0.0.tgz", + "integrity": "sha512-ek5xNX2YBYlXhiUXui3D/BXa3LdqPmoLJ7rqEx2bKJ7EAUEfmXgW0Das7Dc6Nr9MvqaOnIqiPV0mZk/r/UpNAg==", "dev": true, "license": "MIT", "dependencies": { - "@tokenizer/inflate": "^0.2.6", - "strtok3": "^10.2.0", + "@tokenizer/inflate": "^0.2.7", + "strtok3": "^10.2.2", "token-types": "^6.0.0", "uint8array-extras": "^1.4.0" }, "engines": { - "node": ">=18" + "node": ">=20" }, "funding": { "url": "https://github.com/sindresorhus/file-type?sponsor=1" @@ -6635,11 +6625,12 @@ } }, "node_modules/foreground-child": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz", - "integrity": "sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", + "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", + "license": "ISC", "dependencies": { - "cross-spawn": "^7.0.0", + "cross-spawn": "^7.0.6", "signal-exit": "^4.0.1" }, "engines": { @@ -6669,12 +6660,15 @@ } }, "node_modules/form-data": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz", - "integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.4.tgz", + "integrity": "sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==", + "license": "MIT", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", "mime-types": "^2.1.12" }, "engines": { @@ -6840,15 +6834,21 @@ } }, "node_modules/get-intrinsic": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", - "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", "function-bind": "^1.1.2", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0" + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" }, "engines": { "node": ">= 0.4" @@ -6857,6 +6857,19 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/get-stdin": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-8.0.0.tgz", @@ -7003,11 +7016,12 @@ } }, "node_modules/gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "dependencies": { - "get-intrinsic": "^1.1.3" + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -7108,10 +7122,11 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/has-proto": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", - "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -7119,10 +7134,14 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, "engines": { "node": ">= 0.4" }, @@ -7509,16 +7528,17 @@ "integrity": "sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q==" }, "node_modules/inquirer": { - "version": "8.2.6", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.2.6.tgz", - "integrity": "sha512-M1WuAmb7pn9zdFRtQYk26ZBoY043Sse0wVDdk4Bppr+JOXyQYybdtvK+l9wUibhtjdjvtoiNy8tk+EgsYIUqKg==", + "version": "8.2.7", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.2.7.tgz", + "integrity": "sha512-UjOaSel/iddGZJ5xP/Eixh6dY1XghiBw4XK13rCCIJcJfyhhoul/7KhLLUGtebEj6GDYM6Vnx/mVsjx2L/mFIA==", "dev": true, + "license": "MIT", "dependencies": { + "@inquirer/external-editor": "^1.0.0", "ansi-escapes": "^4.2.1", "chalk": "^4.1.1", "cli-cursor": "^3.1.0", "cli-width": "^3.0.0", - "external-editor": "^3.0.3", "figures": "^3.0.0", "lodash": "^4.17.21", "mute-stream": "0.0.8", @@ -7534,11 +7554,46 @@ "node": ">=12.0.0" } }, + "node_modules/inquirer/node_modules/@inquirer/external-editor": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@inquirer/external-editor/-/external-editor-1.0.1.tgz", + "integrity": "sha512-Oau4yL24d2B5IL4ma4UpbQigkVhzPDXLoqy1ggK4gnHg/stmkffJE4oOXHXF3uz0UEpywG68KcyXsyYpA1Re/Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "chardet": "^2.1.0", + "iconv-lite": "^0.6.3" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/inquirer/node_modules/@types/node": { + "version": "24.3.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.3.1.tgz", + "integrity": "sha512-3vXmQDXy+woz+gnrTvuvNrPzekOi+Ds0ReMxw0LzBiK3a+1k0kQn9f2NWk+lgD4rJehFUmYy2gMhJ2ZI+7YP9g==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "undici-types": "~7.10.0" + } + }, "node_modules/inquirer/node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -7548,6 +7603,7 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, + "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -7555,6 +7611,15 @@ "node": ">=8" } }, + "node_modules/inquirer/node_modules/undici-types": { + "version": "7.10.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.10.0.tgz", + "integrity": "sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true + }, "node_modules/ip-address": { "version": "9.0.5", "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz", @@ -8586,6 +8651,15 @@ "url": "https://github.com/fb55/entities?sponsor=1" } }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/mdast-util-definitions": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/mdast-util-definitions/-/mdast-util-definitions-5.1.2.tgz", @@ -10246,15 +10320,6 @@ "node": ">=8" } }, - "node_modules/os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/ovsx": { "version": "0.8.4", "resolved": "https://registry.npmjs.org/ovsx/-/ovsx-0.8.4.tgz", @@ -10596,20 +10661,6 @@ "node": "*" } }, - "node_modules/peek-readable": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/peek-readable/-/peek-readable-7.0.0.tgz", - "integrity": "sha512-nri2TO5JE3/mRryik9LlHFT53cgHfRK0Lt0BAZQXku/AW3E6XLt2GaY8siWi7dvW/m1z0ecn+J+bpDa9ZN3IsQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/Borewit" - } - }, "node_modules/pend": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", @@ -11799,6 +11850,7 @@ "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.12.0" } @@ -12082,6 +12134,19 @@ "node": ">=8" } }, + "node_modules/shell-quote": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.3.tgz", + "integrity": "sha512-ObmnIF4hXNg1BqhnHmgbDETF8dLPCggZWBjkQfhZpbszZnYur5DUljTcCHii5LC3J5E0yeO/1LIMyH+UvHQgyw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/side-channel": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", @@ -12259,12 +12324,6 @@ "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/spawn-command": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/spawn-command/-/spawn-command-0.0.2.tgz", - "integrity": "sha512-zC8zGoGkmc8J9ndvml8Xksr1Amk9qBujgbF0JAIWO7kXr43w0h/0GJNM/Vustixu+YE8N/MTrQ7N31FvHUACxQ==", - "dev": true - }, "node_modules/split2": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", @@ -12552,14 +12611,13 @@ "license": "MIT" }, "node_modules/strtok3": { - "version": "10.2.2", - "resolved": "https://registry.npmjs.org/strtok3/-/strtok3-10.2.2.tgz", - "integrity": "sha512-Xt18+h4s7Z8xyZ0tmBoRmzxcop97R4BAh+dXouUDCYn+Em+1P3qpkUfI5ueWLT8ynC5hZ+q4iPEmGG1urvQGBg==", + "version": "10.3.4", + "resolved": "https://registry.npmjs.org/strtok3/-/strtok3-10.3.4.tgz", + "integrity": "sha512-KIy5nylvC5le1OdaaoCJ07L+8iQzJHGH6pWDuzS+d07Cu7n1MZ2x26P8ZKIWfbK02+XIL8Mp4RkWeqdUCrDMfg==", "dev": true, "license": "MIT", "dependencies": { - "@tokenizer/token": "^0.3.0", - "peek-readable": "^7.0.0" + "@tokenizer/token": "^0.3.0" }, "engines": { "node": ">=18" @@ -13157,7 +13215,8 @@ "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/timers-ext": { "version": "0.1.8", @@ -13254,10 +13313,11 @@ } }, "node_modules/tmp": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.3.tgz", - "integrity": "sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w==", + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.5.tgz", + "integrity": "sha512-voyz6MApa1rQGUxT3E+BK7/ROe8itEx7vD8/HEvt4xwXucvQ5G5oeEiHkmHZJuBO21RpOf+YYm9MOivj709jow==", "dev": true, + "license": "MIT", "engines": { "node": ">=14.14" } @@ -13288,12 +13348,13 @@ } }, "node_modules/token-types": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/token-types/-/token-types-6.0.0.tgz", - "integrity": "sha512-lbDrTLVsHhOMljPscd0yitpozq7Ga2M5Cvez5AjGg8GASBjtt6iERCAJ93yommPmz62fb45oFIXHEZ3u9bfJEA==", + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/token-types/-/token-types-6.1.1.tgz", + "integrity": "sha512-kh9LVIWH5CnL63Ipf0jhlBIy0UsrMj/NJDfpsy1SqOXlLKEVyXXYrnFxFT1yOOYVGBSApeVnjPw/sBz5BfEjAQ==", "dev": true, "license": "MIT", "dependencies": { + "@borewit/text-codec": "^0.1.0", "@tokenizer/token": "^0.3.0", "ieee754": "^1.2.1" }, @@ -13343,6 +13404,7 @@ "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", "dev": true, + "license": "MIT", "bin": { "tree-kill": "cli.js" } @@ -13545,9 +13607,9 @@ } }, "node_modules/uint8array-extras": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/uint8array-extras/-/uint8array-extras-1.4.0.tgz", - "integrity": "sha512-ZPtzy0hu4cZjv3z5NW9gfKnNLjoz4y6uv4HlelAjDK7sY/xOkKZv9xK/WQpcsBB3jEybChz9DPC2U/+cusjJVQ==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/uint8array-extras/-/uint8array-extras-1.5.0.tgz", + "integrity": "sha512-rvKSBiC5zqCCiDZ9kAOszZcDvdAHwwIKJG33Ykj43OKcWsnmcBRL09YTU4nOeHZ8Y2a7l1MgTd08SBe9A8Qj6A==", "dev": true, "license": "MIT", "engines": { @@ -16509,6 +16571,7 @@ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -16559,6 +16622,7 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -16568,6 +16632,7 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, + "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -16692,15 +16757,6 @@ "node": ">=12" } }, - "node_modules/yargs-parser": { - "version": "20.2.9", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", - "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", - "dev": true, - "engines": { - "node": ">=10" - } - }, "node_modules/yargs-unparser": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json index ee1649b03..d0e7e89ea 100644 --- a/extensions/vscode/package.json +++ b/extensions/vscode/package.json @@ -699,7 +699,7 @@ "devDependencies": { "@biomejs/biome": "1.6.4", "@nestjs/common": "^11.0.16", - "@openapitools/openapi-generator-cli": "^2.20.0", + "@openapitools/openapi-generator-cli": "^2.23.1", "@types/chai": "^5.0.1", "@types/cors": "^2.8.17", "@types/express": "^4.17.21", From 50c6f90633b51025b9a82d7b6bd4b412dc56eb9c Mon Sep 17 00:00:00 2001 From: Nate Date: Fri, 5 Sep 2025 11:36:31 -0700 Subject: [PATCH 52/76] update Bash tool instructions --- extensions/cli/src/tools/runTerminalCommand.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/cli/src/tools/runTerminalCommand.ts b/extensions/cli/src/tools/runTerminalCommand.ts index 58d3939e5..726c86501 100644 --- a/extensions/cli/src/tools/runTerminalCommand.ts +++ b/extensions/cli/src/tools/runTerminalCommand.ts @@ -33,7 +33,7 @@ export const runTerminalCommandTool: Tool = { displayName: "Bash", description: `Executes a terminal command and returns the output -The command will be executed from the current working directory: ${process.cwd()} +Commands are automatically executed from the current working directory (${process.cwd()}), so there's no need to change directories with 'cd' commands. `, parameters: { command: { From e6cf3fd7566c73401a54334682cd9d50776acf49 Mon Sep 17 00:00:00 2001 From: Jakub Blach Date: Thu, 4 Sep 2025 17:21:01 +0200 Subject: [PATCH 53/76] fix: dispose JCEF JSQuery handler correctly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The JCEF browser wasn’t registered as a Disposable when held by the service. Service was disposed, but we had leak, because this caused JSQuery handlers to run on a disposed browser (browsers are disposed automatically by default according to docs), throwing exceptions when opening another project. This fix registers both the browser and the handler properly. I tested it manually, and opening multiple projects no longer causes errors. Note: I think it would be useful to have an e2e test at some stage that opens a project, closes it, and then opens another one. Such a test should catch this issue early. --- .../browser/ContinueBrowser.kt | 12 +++++++++--- .../browser/ContinueBrowserService.kt | 16 +++++++++++++--- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/browser/ContinueBrowser.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/browser/ContinueBrowser.kt index 00c82fe29..5b4f862c0 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/browser/ContinueBrowser.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/browser/ContinueBrowser.kt @@ -1,28 +1,29 @@ package com.github.continuedev.continueintellijextension.browser import com.github.continuedev.continueintellijextension.constants.MessageTypes -import com.github.continuedev.continueintellijextension.services.ContinueExtensionSettings import com.github.continuedev.continueintellijextension.services.ContinuePluginService import com.github.continuedev.continueintellijextension.utils.uuid import com.google.gson.Gson +import com.intellij.openapi.Disposable import com.intellij.openapi.components.service import com.intellij.openapi.diagnostic.Logger import com.intellij.openapi.project.Project +import com.intellij.openapi.util.Disposer import com.intellij.ui.jcef.* import org.cef.CefApp import org.cef.browser.CefBrowser import org.cef.handler.CefLoadHandlerAdapter import javax.swing.JComponent -class ContinueBrowser(private val project: Project) { +class ContinueBrowser(private val project: Project): Disposable { private val log = Logger.getInstance(ContinueBrowser::class.java.simpleName) private val browser: JBCefBrowser = JBCefBrowser.createBuilder().setOffScreenRendering(true).build() + private val myJSQueryOpenInBrowser = JBCefJSQuery.create(browser as JBCefBrowserBase) init { CefApp.getInstance().registerSchemeHandlerFactory("http", "continue", CustomSchemeHandlerFactory()) browser.jbCefClient.setProperty(JBCefClient.Properties.JS_QUERY_POOL_SIZE, 200) - val myJSQueryOpenInBrowser = JBCefJSQuery.create(browser as JBCefBrowserBase) myJSQueryOpenInBrowser.addHandler { msg: String? -> val json = Gson().fromJson(msg, BrowserMessage::class.java) val messageType = json.messageType @@ -100,6 +101,11 @@ class ContinueBrowser(private val project: Project) { browser.cefBrowser.executeJavaScript(script, getGuiUrl(), 0) } + override fun dispose() { + Disposer.dispose(myJSQueryOpenInBrowser) + Disposer.dispose(browser) + } + // todo: remove and use types.Message private data class BrowserMessage( val messageType: String, diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/browser/ContinueBrowserService.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/browser/ContinueBrowserService.kt index 2bc7334a5..155d9ffe8 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/browser/ContinueBrowserService.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/browser/ContinueBrowserService.kt @@ -1,22 +1,32 @@ package com.github.continuedev.continueintellijextension.browser +import com.intellij.openapi.Disposable import com.intellij.openapi.components.Service import com.intellij.openapi.components.service import com.intellij.openapi.project.Project +import com.intellij.openapi.util.Disposer import com.intellij.ui.jcef.JBCefApp @Service(Service.Level.PROJECT) -class ContinueBrowserService(project: Project) { +class ContinueBrowserService(project: Project): Disposable { private val browser: ContinueBrowser? = if (JBCefApp.isSupported()) ContinueBrowser(project) else null + override fun dispose() { + if (browser != null) + Disposer.dispose(browser) + } + companion object { - fun Project.getBrowser() = - service().browser + fun Project.getBrowser(): ContinueBrowser? { + if (isDisposed) + return null + return service().browser + } } } From 6789833a77eb57e6a06d2578d2497fc17751e191 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20B=C5=82ach?= Date: Fri, 5 Sep 2025 21:35:16 +0200 Subject: [PATCH 54/76] fix: ignore Stream closed exceptions on flush (#7610) Solves: CON-3587 This exception occurs if continue-binary is killed or throws some unexpected error, but in the previous version, the exception would bubble up and be logged as an IDE error (visible for users). After this change, we catch this exception and only log it, because there's no point in throwing it. The handler still recognizes this invalid state and gracefully restarts the binary. --- .../continue/process/ContinueProcessHandler.kt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/process/ContinueProcessHandler.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/process/ContinueProcessHandler.kt index 04e4d3d2e..9e269226b 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/process/ContinueProcessHandler.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/continue/process/ContinueProcessHandler.kt @@ -43,10 +43,14 @@ class ContinueProcessHandler( } scope.launch(Dispatchers.IO) { for (message in pendingWrites) { - log.debug("Write: $message") - writer.write(message) - writer.write("\r\n") - writer.flush() + try { + log.debug("Write: $message") + writer.write(message) + writer.write("\r\n") + writer.flush() + } catch (e: IOException) { + log.warn(e) + } } } } From 18ec563762fdb45635c9e4da10f3664a95e1e2dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20B=C5=82ach?= Date: Fri, 5 Sep 2025 21:36:17 +0200 Subject: [PATCH 55/76] fix: don't use override-only actionPerformed to invoke action (#7608) It's resolving one of problems during plugin verification. I manually tested this feature to make sure there are no regressions. Solves error: Override-only method AddLicenseKey.actionPerformed(AnActionEvent) is invoked in AddLicenseKey.createErrorAction$1.invoke(...). This method is marked with @ApiStatus.OverrideOnly annotation, which indicates that the method must be only overridden but not invoked by client code. See documentation of the @ApiStatus.OverrideOnly for more info. --- .../error/ContinueErrorSubmitter.kt | 1 + .../license/AddLicenseKey.kt | 29 ++++++++----------- .../license/AddLicenseKeyDialog.kt | 4 +-- 3 files changed, 15 insertions(+), 19 deletions(-) diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/error/ContinueErrorSubmitter.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/error/ContinueErrorSubmitter.kt index 69ea9b911..9d806ee66 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/error/ContinueErrorSubmitter.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/error/ContinueErrorSubmitter.kt @@ -21,6 +21,7 @@ class ContinueErrorSubmitter : ErrorReportSubmitter() { consumer: Consumer ): Boolean { try { + // todo: IdeaReportingEvent is deprecated; migrate to IdeaLoggingEvent + figure out how to read attachments val event = events.filterIsInstance() .firstOrNull() ?: return false service().report( diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/license/AddLicenseKey.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/license/AddLicenseKey.kt index 2402ff6c4..66a096f5e 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/license/AddLicenseKey.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/license/AddLicenseKey.kt @@ -5,22 +5,27 @@ import com.github.continuedev.continueintellijextension.utils.castNestedOrNull import com.intellij.notification.NotificationAction import com.intellij.notification.NotificationGroupManager import com.intellij.notification.NotificationType -import com.intellij.openapi.actionSystem.ActionManager -import com.intellij.openapi.actionSystem.ActionPlaces import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.application.ApplicationManager import com.intellij.openapi.components.service +import com.intellij.openapi.project.Project import com.intellij.openapi.ui.DialogWrapper class AddLicenseKey : AnAction() { override fun actionPerformed(e: AnActionEvent) { - val dialog = AddLicenseKeyDialog(e.project) + performAddLicenseKey(e.project) + } + + private fun performAddLicenseKey(project: Project?) { + if (project == null) + return + val dialog = AddLicenseKeyDialog(project) dialog.show() if (dialog.exitCode != DialogWrapper.OK_EXIT_CODE) return - val messenger = e.project?.service()?.coreMessenger + val messenger = project.service().coreMessenger ?: return messenger.request("mdm/setLicenseKey", mapOf("licenseKey" to dialog.licenseKey), null) { response -> val isValid = response.castNestedOrNull("content") ?: false @@ -28,7 +33,7 @@ class AddLicenseKey : AnAction() { createSuccessAction() else createErrorAction() - notification.notify(e.project) + notification.notify(project) } } @@ -37,7 +42,7 @@ class AddLicenseKey : AnAction() { "License key is valid. A restart is required for it to take effect.", NotificationType.INFORMATION ).addAction( - NotificationAction.create("Restart IDE") { event, notification -> + NotificationAction.create("Restart IDE") { _, _ -> ApplicationManager.getApplication().restart() } ) @@ -49,17 +54,7 @@ class AddLicenseKey : AnAction() { ).addAction( NotificationAction.create("Try again") { event, notification -> notification.expire() - val action = this@AddLicenseKey - action.actionPerformed( - AnActionEvent( - null, - event.dataContext, - ActionPlaces.UNKNOWN, - action.templatePresentation.clone(), - ActionManager.getInstance(), - 0 - ) - ) + performAddLicenseKey(event.project) } ) diff --git a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/license/AddLicenseKeyDialog.kt b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/license/AddLicenseKeyDialog.kt index 4ba6f2e21..af8763a21 100644 --- a/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/license/AddLicenseKeyDialog.kt +++ b/extensions/intellij/src/main/kotlin/com/github/continuedev/continueintellijextension/license/AddLicenseKeyDialog.kt @@ -3,9 +3,9 @@ package com.github.continuedev.continueintellijextension.license import com.intellij.openapi.project.Project import com.intellij.openapi.ui.DialogWrapper import com.intellij.openapi.ui.ValidationInfo +import com.intellij.ui.dsl.builder.AlignX import com.intellij.ui.dsl.builder.bindText import com.intellij.ui.dsl.builder.panel -import com.intellij.ui.dsl.gridLayout.HorizontalAlign import javax.swing.JComponent class AddLicenseKeyDialog(project: Project?) : DialogWrapper(project) { @@ -22,7 +22,7 @@ class AddLicenseKeyDialog(project: Project?) : DialogWrapper(project) { panel { row { textField().bindText(::licenseKey) - .horizontalAlign(HorizontalAlign.FILL) + .align(AlignX.FILL) .focused() .validationOnApply { if (it.text.isBlank()) From b290e5b4dc13ef25bb233b3ef7b7cdd2bea6c6a8 Mon Sep 17 00:00:00 2001 From: Aditya Mitra <61635505+uinstinct@users.noreply.github.com> Date: Sat, 6 Sep 2025 01:09:12 +0530 Subject: [PATCH 56/76] fix(docs): broken settings page links (#7598) * fix(docs): broken settings page links * undo minor changes --- docs/features/autocomplete/how-to-customize.mdx | 2 +- docs/reference/deprecated-docs.mdx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/features/autocomplete/how-to-customize.mdx b/docs/features/autocomplete/how-to-customize.mdx index 854be157e..4fab64383 100644 --- a/docs/features/autocomplete/how-to-customize.mdx +++ b/docs/features/autocomplete/how-to-customize.mdx @@ -3,6 +3,6 @@ title: “Customize Autocomplete Settings in Continue” description: “Learn how to customize autocomplete behavior in Continue, including user settings, configuration options, and adjustments to improve AI code suggestions in your IDE.” --- -Continue offers a handful of settings to customize autocomplete behavior. Visit the [User Settings Page](/customize/settings) to manage these settings. +Continue offers a handful of settings to customize autocomplete behavior. Visit the User Settings Page (Gear Icon) to manage these settings. For a comprehensive guide on all configuration options and their impacts, see the [Autocomplete deep dive](/customize/deep-dives/autocomplete). diff --git a/docs/reference/deprecated-docs.mdx b/docs/reference/deprecated-docs.mdx index c972db7fa..a62e88b49 100644 --- a/docs/reference/deprecated-docs.mdx +++ b/docs/reference/deprecated-docs.mdx @@ -408,4 +408,4 @@ The following configuration example includes: -This setup could also involve enabling Chromium as a backup for local documentation through the [User Settings Page](../customize/settings). \ No newline at end of file +This setup could also involve enabling Chromium as a backup for local documentation through the User Settings Page (Gear Icon). \ No newline at end of file From a698049b3a6654a0c72a3c525e9c8d11a885b8be Mon Sep 17 00:00:00 2001 From: Ting-Wai To <40179554+tingwai@users.noreply.github.com> Date: Fri, 5 Sep 2025 15:22:50 -0700 Subject: [PATCH 57/76] chore: bump package.json --- extensions/vscode/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json index ee1649b03..6e9c5b01a 100644 --- a/extensions/vscode/package.json +++ b/extensions/vscode/package.json @@ -2,7 +2,7 @@ "name": "continue", "icon": "media/icon.png", "author": "Continue Dev, Inc", - "version": "1.3.3", + "version": "1.3.4", "repository": { "type": "git", "url": "https://github.com/continuedev/continue" From 1218c14f895b00252130b21a26abb90dd201be04 Mon Sep 17 00:00:00 2001 From: Aditya Mitra <61635505+uinstinct@users.noreply.github.com> Date: Sat, 6 Sep 2025 04:20:50 +0530 Subject: [PATCH 58/76] feat: add tooltips to user settings page (#7597) --- gui/src/components/gui/Switch.tsx | 13 ++++++- gui/src/pages/config/UserSettingsForm.tsx | 46 ++++++++++++++++++++--- 2 files changed, 53 insertions(+), 6 deletions(-) diff --git a/gui/src/components/gui/Switch.tsx b/gui/src/components/gui/Switch.tsx index 0af15f8eb..23d232124 100644 --- a/gui/src/components/gui/Switch.tsx +++ b/gui/src/components/gui/Switch.tsx @@ -1,5 +1,7 @@ +import { InformationCircleIcon } from "@heroicons/react/24/outline"; import React, { ReactNode } from "react"; import { vscButtonBackground } from ".."; +import { ToolTip } from "./Tooltip"; type ToggleSwitchProps = { isToggled: boolean; @@ -8,6 +10,7 @@ type ToggleSwitchProps = { size?: number; showIfToggled?: ReactNode; disabled?: boolean; + tooltip?: string; }; const ToggleSwitch: React.FC = ({ @@ -17,12 +20,20 @@ const ToggleSwitch: React.FC = ({ size = 16, showIfToggled, disabled = false, + tooltip, }) => { return (
- {text} + + {text}{" "} + {tooltip && ( + + + + )} +
{isToggled && !!showIfToggled && showIfToggled}
{/* */}