diff --git a/.github/workflows/jetbrains-release.yaml b/.github/workflows/jetbrains-release.yaml index 54b3c7812..38413cf0c 100644 --- a/.github/workflows/jetbrains-release.yaml +++ b/.github/workflows/jetbrains-release.yaml @@ -491,7 +491,7 @@ jobs: # Run Qodana inspections - name: Qodana - Code Inspection - uses: JetBrains/qodana-action@v2025.2.2 + uses: JetBrains/qodana-action@v2025.2.3 with: cache-default-branch-only: true diff --git a/.github/workflows/runloop-blueprint-template.json b/.github/workflows/runloop-blueprint-template.json index d0fcf57c1..7613e2e89 100644 --- a/.github/workflows/runloop-blueprint-template.json +++ b/.github/workflows/runloop-blueprint-template.json @@ -1,8 +1,24 @@ { "name": "cn", + "dockerfile": "FROM runloop:runloop/universal-ubuntu-24.04-x86_64-dnd", "system_setup_commands": [ "npm i -g @continuedev/cli@latest", "sudo apt update", - "sudo apt install -y ripgrep" - ] + "printf '#!/bin/sh\\nexit 101\\n' | sudo tee /usr/sbin/policy-rc.d > /dev/null && sudo chmod +x /usr/sbin/policy-rc.d", + "sudo apt install -y --no-install-recommends ripgrep chromium chromium-driver xvfb", + "sudo rm /usr/sbin/policy-rc.d", + "sudo mkdir -p /opt/google/chrome", + "sudo ln -s /usr/bin/chromium /opt/google/chrome/chrome", + "curl -1sLf 'https://artifacts-cli.infisical.com/setup.deb.sh' | sudo -E bash", + "sudo apt-get install -y infisical" + ], + "launch_parameters": { + "launch_commands": [ + "export DISPLAY=:99", + "nohup Xvfb :99 -screen 0 1920x1080x24 > /tmp/xvfb.log 2>&1 &", + "sleep 2", + "sudo mkdir -p /home/user", + "for dir in /root/*; do [ -d \"$dir\" ] && [ -d \"$dir/.git\" ] && sudo ln -sf \"$dir\" \"/home/user/$(basename \"$dir\")\"; done" + ] + } } diff --git a/.github/workflows/upload-runloop-blueprint.yml b/.github/workflows/upload-runloop-blueprint.yml new file mode 100644 index 000000000..e88aa5cea --- /dev/null +++ b/.github/workflows/upload-runloop-blueprint.yml @@ -0,0 +1,59 @@ +name: Upload Runloop Blueprint + +on: + workflow_dispatch: + push: + branches: + - main + paths: + - '.github/workflows/runloop-blueprint-template.json' + +permissions: + contents: read + +jobs: + upload-blueprint: + name: Upload Blueprint to Runloop + runs-on: ubuntu-latest + # Only run this workflow on the main repository (continuedev/continue) + if: github.repository == 'continuedev/continue' + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Publish Blueprint to Runloop + env: + RUNLOOP_API_KEY: ${{ secrets.RUNLOOP_API_KEY }} + run: | + echo "Publishing blueprint 'cn' to Runloop API" + + # Use blueprint configuration from template file + cp .github/workflows/runloop-blueprint-template.json blueprint.json + + # Publish to Runloop API + response=$(curl -X POST "https://api.runloop.ai/v1/blueprints" \ + -H "Authorization: Bearer $RUNLOOP_API_KEY" \ + -H "Content-Type: application/json" \ + -d @blueprint.json \ + -w "%{http_code}" \ + -s) + + http_code=$(echo "$response" | tail -c 4) + response_body=$(echo "$response" | head -c -4) + + if [[ "$http_code" == "200" ]] || [[ "$http_code" == "201" ]]; then + echo "✅ Successfully published blueprint to Runloop API" + echo "Response: $response_body" + + # Extract blueprint ID if available + blueprint_id=$(echo "$response_body" | jq -r '.id // empty') + if [[ -n "$blueprint_id" ]]; then + echo "Blueprint ID: $blueprint_id" + echo "blueprint_id=$blueprint_id" >> $GITHUB_OUTPUT + fi + else + echo "❌ Failed to publish blueprint to Runloop API" + echo "HTTP Code: $http_code" + echo "Response: $response_body" + exit 1 + fi diff --git a/core/index.d.ts b/core/index.d.ts index f31b62ed7..792a12533 100644 --- a/core/index.d.ts +++ b/core/index.d.ts @@ -267,6 +267,11 @@ export interface IContextProvider { get deprecationMessage(): string | null; } +export interface SessionUsage extends Usage { + /** Total cumulative cost in USD for all LLM API calls in this session */ + totalCost: number; +} + export interface Session { sessionId: string; title: string; @@ -276,6 +281,8 @@ export interface Session { mode?: MessageModes; /** Optional: title of the selected chat model for this session */ chatModelTitle?: string | null; + /** Optional: cumulative usage and cost for all LLM API calls in this session */ + usage?: SessionUsage; } export interface BaseSessionMetadata { diff --git a/core/llm/utils/calculateRequestCost.ts b/core/llm/utils/calculateRequestCost.ts index d8706c29e..0d6259657 100644 --- a/core/llm/utils/calculateRequestCost.ts +++ b/core/llm/utils/calculateRequestCost.ts @@ -12,19 +12,21 @@ function calculateAnthropicCost( // Normalize model name to handle various formats const normalizedModel = model.toLowerCase(); - // Define pricing per million tokens (MTok) + // Define pricing per million tokens (MTok) by model family prefix const pricing: Record< string, { input: number; output: number; cacheWrite: number; cacheRead: number } > = { - // Claude Opus 4 (most intelligent model) - "claude-3-opus": { - input: 15, - output: 75, - cacheWrite: 18.75, - cacheRead: 1.5, + // Claude Opus 4.5 (most intelligent model) + "claude-opus-4-5": { + input: 5, + output: 25, + cacheWrite: 6.25, + cacheRead: 0.5, }, - "claude-3-opus-20240229": { + + // Claude Opus 4 (legacy) + "claude-3-opus": { input: 15, output: 75, cacheWrite: 18.75, @@ -38,18 +40,6 @@ function calculateAnthropicCost( cacheWrite: 3.75, cacheRead: 0.3, }, - "claude-3-5-sonnet-20241022": { - input: 3, - output: 15, - cacheWrite: 3.75, - cacheRead: 0.3, - }, - "claude-3-5-sonnet-20240620": { - input: 3, - output: 15, - cacheWrite: 3.75, - cacheRead: 0.3, - }, // Claude Haiku 3.5 (fastest, most cost-effective) "claude-3-5-haiku": { @@ -58,12 +48,6 @@ function calculateAnthropicCost( cacheWrite: 1, cacheRead: 0.08, }, - "claude-3-5-haiku-20241022": { - input: 0.8, - output: 4, - cacheWrite: 1, - cacheRead: 0.08, - }, // Legacy Claude 3 Haiku "claude-3-haiku": { @@ -72,35 +56,16 @@ function calculateAnthropicCost( cacheWrite: 0.3, cacheRead: 0.03, }, - "claude-3-haiku-20240307": { - input: 0.25, - output: 1.25, - cacheWrite: 0.3, - cacheRead: 0.03, - }, }; - // Find matching pricing model - let modelPricing = pricing[normalizedModel]; + // Sort keys by length (longest first) to match most specific patterns first + const sortedKeys = Object.keys(pricing).sort((a, b) => b.length - a.length); - // If exact match not found, try to find by partial match - if (!modelPricing) { - for (const [key, value] of Object.entries(pricing)) { - if (normalizedModel.includes(key) || key.includes(normalizedModel)) { - modelPricing = value; - break; - } - } - } - - // If still no match, try common patterns - if (!modelPricing) { - if (normalizedModel.includes("opus")) { - modelPricing = pricing["claude-3-opus"]; - } else if (normalizedModel.includes("sonnet")) { - modelPricing = pricing["claude-3-5-sonnet"]; - } else if (normalizedModel.includes("haiku")) { - modelPricing = pricing["claude-3-5-haiku"]; + let modelPricing = null; + for (const prefix of sortedKeys) { + if (normalizedModel.startsWith(prefix)) { + modelPricing = pricing[prefix]; + break; } } @@ -167,14 +132,90 @@ function calculateAnthropicCost( }; } +function calculateOpenAICost( + model: string, + usage: Usage, +): CostBreakdown | null { + // Normalize model name + const normalizedModel = model.toLowerCase(); + + // Define pricing per million tokens (MTok) by model family prefix + const pricing: Record = { + // GPT-4o models (most specific first) + "gpt-4o-mini": { input: 0.15, output: 0.6 }, + "gpt-4o": { input: 2.5, output: 10 }, + + // GPT-4 Turbo models + "gpt-4-turbo": { input: 10, output: 30 }, + + // GPT-3.5 Turbo models (most specific first) + "gpt-3.5-turbo-0125": { input: 0.5, output: 1.5 }, + "gpt-3.5-turbo-1106": { input: 1, output: 2 }, + "gpt-3.5-turbo": { input: 1.5, output: 2 }, + + // Base GPT-4 (fallback for other gpt-4 variants) + "gpt-4": { input: 30, output: 60 }, + }; + + // Sort keys by length (longest first) to match most specific patterns first + const sortedKeys = Object.keys(pricing).sort((a, b) => b.length - a.length); + + let modelPricing = null; + for (const prefix of sortedKeys) { + if (normalizedModel.startsWith(prefix)) { + modelPricing = pricing[prefix]; + break; + } + } + + if (!modelPricing) { + return null; // Unknown model + } + + // Calculate costs + const inputCost = (usage.promptTokens / 1_000_000) * modelPricing.input; + const outputCost = (usage.completionTokens / 1_000_000) * modelPricing.output; + + // Build breakdown components + const breakdownParts: string[] = []; + + if (usage.promptTokens > 0) { + breakdownParts.push( + `Input: ${usage.promptTokens.toLocaleString()} tokens × $${modelPricing.input}/MTok = $${inputCost.toFixed(6)}`, + ); + } + + if (usage.completionTokens > 0) { + breakdownParts.push( + `Output: ${usage.completionTokens.toLocaleString()} tokens × $${modelPricing.output}/MTok = $${outputCost.toFixed(6)}`, + ); + } + + const totalCost = inputCost + outputCost; + + // Build final breakdown string + let breakdown = `Model: ${model}\n`; + breakdown += breakdownParts.join("\n"); + if (breakdownParts.length > 1) { + breakdown += `\nTotal: $${totalCost.toFixed(6)}`; + } + + return { + cost: totalCost, + breakdown, + }; +} + export function calculateRequestCost( provider: string, model: string, usage: Usage, ): CostBreakdown | null { - switch (provider) { + switch (provider.toLowerCase()) { case "anthropic": return calculateAnthropicCost(model, usage); + case "openai": + return calculateOpenAICost(model, usage); default: return null; } diff --git a/core/llm/utils/calculateRequestCost.vitest.ts b/core/llm/utils/calculateRequestCost.vitest.ts new file mode 100644 index 000000000..32183ca1b --- /dev/null +++ b/core/llm/utils/calculateRequestCost.vitest.ts @@ -0,0 +1,256 @@ +import { describe, expect, it } from "vitest"; + +import type { Usage } from "../.."; + +import { calculateRequestCost, CostBreakdown } from "./calculateRequestCost"; + +interface TestCase { + provider: string; + model: string; + promptTokens: number; + completionTokens: number; + cachedTokens?: number; + cacheWriteTokens?: number; + expectedCost: number | null; + description?: string; +} + +describe("calculateRequestCost", () => { + const testCases: TestCase[] = [ + // Anthropic Claude 3.5 Sonnet + { + provider: "anthropic", + model: "claude-3-5-sonnet-20241022", + promptTokens: 1000, + completionTokens: 500, + expectedCost: 0.0105, + description: "Claude 3.5 Sonnet basic usage", + }, + { + provider: "anthropic", + model: "claude-3-5-sonnet-20241022", + promptTokens: 1000, + completionTokens: 500, + cachedTokens: 2000, + expectedCost: 0.0111, + description: "Claude 3.5 Sonnet with cache reads", + }, + { + provider: "anthropic", + model: "claude-3-5-sonnet-20241022", + promptTokens: 1000, + completionTokens: 500, + cacheWriteTokens: 300, + expectedCost: 0.011625, + description: "Claude 3.5 Sonnet with cache writes", + }, + { + provider: "anthropic", + model: "claude-3-5-sonnet-20240620", + promptTokens: 1000, + completionTokens: 500, + expectedCost: 0.0105, + description: "Claude 3.5 Sonnet (older version)", + }, + + // Anthropic Claude 3.5 Haiku + { + provider: "anthropic", + model: "claude-3-5-haiku-20241022", + promptTokens: 1000, + completionTokens: 500, + expectedCost: 0.0028, + description: "Claude 3.5 Haiku", + }, + + // Anthropic Claude 3 Haiku (legacy) + { + provider: "anthropic", + model: "claude-3-haiku-20240307", + promptTokens: 1000, + completionTokens: 500, + expectedCost: 0.000875, + description: "Claude 3 Haiku legacy", + }, + + // Anthropic Claude 3 Opus + { + provider: "anthropic", + model: "claude-3-opus-20240229", + promptTokens: 1000, + completionTokens: 500, + expectedCost: 0.0525, + description: "Claude 3 Opus", + }, + + // Anthropic Claude Opus 4.5 + { + provider: "anthropic", + model: "claude-opus-4-5-20251101", + promptTokens: 1000, + completionTokens: 500, + expectedCost: 0.0175, + description: "Claude Opus 4.5 basic usage", + }, + { + provider: "anthropic", + model: "claude-opus-4-5-latest", + promptTokens: 1000, + completionTokens: 500, + expectedCost: 0.0175, + description: "Claude Opus 4.5 latest (partial match)", + }, + { + provider: "anthropic", + model: "claude-opus-4-5-20251101", + promptTokens: 1000, + completionTokens: 500, + cachedTokens: 2000, + expectedCost: 0.0185, + description: "Claude Opus 4.5 with cache reads", + }, + { + provider: "anthropic", + model: "claude-opus-4-5-20251101", + promptTokens: 1000, + completionTokens: 500, + cacheWriteTokens: 300, + expectedCost: 0.019375, + description: "Claude Opus 4.5 with cache writes", + }, + + // OpenAI GPT-4 + { + provider: "openai", + model: "gpt-4", + promptTokens: 1000, + completionTokens: 500, + expectedCost: 0.06, + description: "GPT-4 basic usage", + }, + { + provider: "openai", + model: "gpt-4-turbo", + promptTokens: 1000, + completionTokens: 500, + expectedCost: 0.025, + description: "GPT-4 Turbo", + }, + { + provider: "openai", + model: "gpt-4o", + promptTokens: 1000, + completionTokens: 500, + expectedCost: 0.0075, + description: "GPT-4o", + }, + { + provider: "openai", + model: "gpt-4o-mini", + promptTokens: 1000, + completionTokens: 500, + expectedCost: 0.00045, + description: "GPT-4o-mini", + }, + + // OpenAI GPT-3.5 + { + provider: "openai", + model: "gpt-3.5-turbo-0125", + promptTokens: 1000, + completionTokens: 500, + expectedCost: 0.00125, + description: "GPT-3.5 Turbo", + }, + + // Edge cases + { + provider: "anthropic", + model: "claude-3-5-sonnet-20241022", + promptTokens: 0, + completionTokens: 0, + expectedCost: 0, + description: "Zero tokens", + }, + { + provider: "anthropic", + model: "claude-3-5-sonnet-20241022", + promptTokens: 1000, + completionTokens: 0, + expectedCost: 0.003, + description: "Only input tokens", + }, + { + provider: "anthropic", + model: "claude-3-5-sonnet-20241022", + promptTokens: 0, + completionTokens: 500, + expectedCost: 0.0075, + description: "Only output tokens", + }, + + // Case insensitivity + { + provider: "ANTHROPIC", + model: "claude-3-5-sonnet-20241022", + promptTokens: 1000, + completionTokens: 500, + expectedCost: 0.0105, + description: "Provider name case insensitive", + }, + + // Unknown models/providers + { + provider: "anthropic", + model: "claude-unknown-model", + promptTokens: 1000, + completionTokens: 500, + expectedCost: null, + description: "Unknown Anthropic model", + }, + { + provider: "google", + model: "gemini-pro", + promptTokens: 1000, + completionTokens: 500, + expectedCost: null, + description: "Unknown provider", + }, + ]; + + testCases.forEach( + ({ + provider, + model, + promptTokens, + completionTokens, + cachedTokens, + cacheWriteTokens, + expectedCost, + description, + }) => { + it(description || `${provider}/${model}`, () => { + const usage: Usage = { + promptTokens, + completionTokens, + promptTokensDetails: + cachedTokens || cacheWriteTokens + ? { + cachedTokens, + cacheWriteTokens, + } + : undefined, + }; + + const result = calculateRequestCost(provider, model, usage); + + if (expectedCost === null) { + expect(result).toBeNull(); + } else { + expect(result).not.toBeNull(); + expect(result!.cost).toBeCloseTo(expectedCost, 6); + } + }); + }, + ); +}); diff --git a/core/package-lock.json b/core/package-lock.json index ab34c0b74..00b799d20 100644 --- a/core/package-lock.json +++ b/core/package-lock.json @@ -271,7 +271,6 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/@75lb/deep-merge/-/deep-merge-1.1.2.tgz", "integrity": "sha512-08K9ou5VNbheZFxM5tDWoqjA3ImC50DiuuJ2tj1yEPRfkp8lLLg6XAaJ4On+a0yAXor/8ay5gHnAIshRM44Kpw==", - "peer": true, "dependencies": { "lodash": "^4.17.21", "typical": "^7.1.1" @@ -284,7 +283,6 @@ "version": "7.3.0", "resolved": "https://registry.npmjs.org/typical/-/typical-7.3.0.tgz", "integrity": "sha512-ya4mg/30vm+DOWfBg4YK3j2WD6TWtRkCbasOJr40CseYENzCUby/7rIvXA99JGsQHeNxLbnXdyLLxKSv3tauFw==", - "peer": true, "engines": { "node": ">=12.17" } @@ -3022,6 +3020,7 @@ "version": "7.26.0", "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.26.0.tgz", "integrity": "sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg==", + "peer": true, "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.26.0", @@ -6200,6 +6199,7 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/@octokit/core/-/core-5.2.0.tgz", "integrity": "sha512-1LFfa/qnMQvEOAdzlQymH0ulepxbxnCYAKJZfMci/5XJyIHWgEYnDmgnKakbTh7CH2tFQ5O60oYDvns4i9RAIg==", + "peer": true, "dependencies": { "@octokit/auth-token": "^4.0.0", "@octokit/graphql": "^7.1.0", @@ -6344,6 +6344,7 @@ "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.9.0.tgz", "integrity": "sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg==", "license": "Apache-2.0", + "peer": true, "engines": { "node": ">=8.0.0" } @@ -6365,6 +6366,7 @@ "resolved": "https://registry.npmjs.org/@opentelemetry/context-async-hooks/-/context-async-hooks-1.30.1.tgz", "integrity": "sha512-s5vvxXPVdjqS3kTLKMeBMvop9hbWkwzBpu+mUO2M7sZtlkyDJGwFe33wRKnbaYDo8ExRVBIIdwIGrqpxHuKttA==", "license": "Apache-2.0", + "peer": true, "engines": { "node": ">=14" }, @@ -6377,6 +6379,7 @@ "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.30.1.tgz", "integrity": "sha512-OOCM2C/QIURhJMuKaekP3TRBxBKxG/TWWA0TL2J6nXUtDnuCtccy49LUJF8xPFXMX+0LMcxFpCo8M9cGY1W6rQ==", "license": "Apache-2.0", + "peer": true, "dependencies": { "@opentelemetry/semantic-conventions": "1.28.0" }, @@ -6896,6 +6899,7 @@ "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.30.1.tgz", "integrity": "sha512-5UxZqiAgLYGFjS4s9qm5mBVo433u+dSPUFWVWXmLAD4wB65oMCoXaJP1KJa9DIYYMeHu3z4BZcStG3LC593cWA==", "license": "Apache-2.0", + "peer": true, "dependencies": { "@opentelemetry/core": "1.30.1", "@opentelemetry/semantic-conventions": "1.28.0" @@ -6921,6 +6925,7 @@ "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.30.1.tgz", "integrity": "sha512-jVPgBbH1gCy2Lb7X0AVQ8XAfgg0pJ4nvl8/IiQA6nxOsPvS+0zMJaFSs2ltXe0J6C8dqjcnpyqINDJmU30+uOg==", "license": "Apache-2.0", + "peer": true, "dependencies": { "@opentelemetry/core": "1.30.1", "@opentelemetry/resources": "1.30.1", @@ -6947,6 +6952,7 @@ "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.36.0.tgz", "integrity": "sha512-TtxJSRD8Ohxp6bKkhrm27JRHAxPczQA7idtcTOMYI+wQRRrfgqxHv1cFbCApcSnNjtXkmzFozn6jQtFrOmbjPQ==", "license": "Apache-2.0", + "peer": true, "engines": { "node": ">=14" } @@ -7357,8 +7363,7 @@ "node_modules/@rtsao/scc": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz", - "integrity": "sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==", - "peer": true + "integrity": "sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==" }, "node_modules/@sentry/babel-plugin-component-annotate": { "version": "4.0.2", @@ -8632,14 +8637,12 @@ "node_modules/@types/command-line-args": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/@types/command-line-args/-/command-line-args-5.2.0.tgz", - "integrity": "sha512-UuKzKpJJ/Ief6ufIaIzr3A/0XnluX7RvFgwkV89Yzvm77wCh1kFaFmqN8XEnGcN62EuHdedQjEMb8mYxFLGPyA==", - "peer": true + "integrity": "sha512-UuKzKpJJ/Ief6ufIaIzr3A/0XnluX7RvFgwkV89Yzvm77wCh1kFaFmqN8XEnGcN62EuHdedQjEMb8mYxFLGPyA==" }, "node_modules/@types/command-line-usage": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/@types/command-line-usage/-/command-line-usage-5.0.2.tgz", - "integrity": "sha512-n7RlEEJ+4x4TS7ZQddTmNSxP+zziEG0TNsMfiRIxcIVXt71ENJ9ojeXmGO3wPoTdn7pJcU2xc3CJYMktNT6DPg==", - "peer": true + "integrity": "sha512-n7RlEEJ+4x4TS7ZQddTmNSxP+zziEG0TNsMfiRIxcIVXt71ENJ9ojeXmGO3wPoTdn7pJcU2xc3CJYMktNT6DPg==" }, "node_modules/@types/connect": { "version": "3.4.38", @@ -8755,8 +8758,7 @@ "node_modules/@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", - "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", - "peer": true + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==" }, "node_modules/@types/long": { "version": "4.0.2", @@ -8821,8 +8823,7 @@ "node_modules/@types/pad-left": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/@types/pad-left/-/pad-left-2.1.1.tgz", - "integrity": "sha512-Xd22WCRBydkGSApl5Bw0PhAOHKSVjNL3E3AwzKaps96IMraPqy5BvZIsBVK6JLwdybUzjHnuWVwpDd0JjTfHXA==", - "peer": true + "integrity": "sha512-Xd22WCRBydkGSApl5Bw0PhAOHKSVjNL3E3AwzKaps96IMraPqy5BvZIsBVK6JLwdybUzjHnuWVwpDd0JjTfHXA==" }, "node_modules/@types/pg": { "version": "8.11.10", @@ -9032,6 +9033,7 @@ "integrity": "sha512-jCNyAuXx8dr5KJMkecGmZ8KI61KBUhkCob+SD+C+I5+Y1FWI2Y3QmY4/cxMCC5WAsZqoEtEETVhUiUMIGCf6Bw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "8.40.0", "@typescript-eslint/types": "8.40.0", @@ -9455,6 +9457,7 @@ "version": "8.14.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", + "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -9708,7 +9711,6 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz", "integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==", - "peer": true, "engines": { "node": ">=6" } @@ -9717,7 +9719,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", - "peer": true, "dependencies": { "call-bind": "^1.0.5", "is-array-buffer": "^3.0.4" @@ -9733,7 +9734,6 @@ "version": "3.1.8", "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.8.tgz", "integrity": "sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ==", - "peer": true, "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", @@ -9758,7 +9758,6 @@ "version": "1.2.5", "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.5.tgz", "integrity": "sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ==", - "peer": true, "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", @@ -9778,7 +9777,6 @@ "version": "1.3.2", "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz", "integrity": "sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==", - "peer": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", @@ -9796,7 +9794,6 @@ "version": "1.3.2", "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.2.tgz", "integrity": "sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ==", - "peer": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", @@ -9814,7 +9811,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.3.tgz", "integrity": "sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==", - "peer": true, "dependencies": { "array-buffer-byte-length": "^1.0.1", "call-bind": "^1.0.5", @@ -9891,7 +9887,6 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", - "peer": true, "dependencies": { "possible-typed-array-names": "^1.0.0" }, @@ -10347,6 +10342,7 @@ "url": "https://github.com/sponsors/ai" } ], + "peer": true, "dependencies": { "caniuse-lite": "^1.0.30001669", "electron-to-chromium": "^1.5.41", @@ -10415,7 +10411,8 @@ "node_modules/buffer-equal-constant-time": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", - "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==" + "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==", + "license": "BSD-3-Clause" }, "node_modules/buffer-from": { "version": "1.1.2", @@ -10652,7 +10649,6 @@ "version": "0.4.0", "resolved": "https://registry.npmjs.org/chalk-template/-/chalk-template-0.4.0.tgz", "integrity": "sha512-/ghrgmhfY8RaSdeo43hNXxpoHAtxdbskUHjPpfqUWGttFgycUhYPGx3YZBCnUCvOa7Doivn1IZec3DEGFoMgLg==", - "peer": true, "dependencies": { "chalk": "^4.1.2" }, @@ -10961,7 +10957,6 @@ "version": "5.2.1", "resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-5.2.1.tgz", "integrity": "sha512-H4UfQhZyakIjC74I9d34fGYDwk3XpSr17QhEd0Q3I9Xq1CETHo4Hcuo87WyWHpAF1aSLjLRf5lD9ZGX2qStUvg==", - "peer": true, "dependencies": { "array-back": "^3.1.0", "find-replace": "^3.0.0", @@ -10976,7 +10971,6 @@ "version": "7.0.1", "resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-7.0.1.tgz", "integrity": "sha512-NCyznE//MuTjwi3y84QVUGEOT+P5oto1e1Pk/jFPVdPPfsG03qpTIl3yw6etR+v73d0lXsoojRpvbru2sqePxQ==", - "peer": true, "dependencies": { "array-back": "^6.2.2", "chalk-template": "^0.4.0", @@ -10991,7 +10985,6 @@ "version": "6.2.2", "resolved": "https://registry.npmjs.org/array-back/-/array-back-6.2.2.tgz", "integrity": "sha512-gUAZ7HPyb4SJczXAMUXMGAvI976JoK3qEx9v1FTmeYuJj0IBiaKttG1ydtGKdkfqWkIkouke7nG8ufGy77+Cvw==", - "peer": true, "engines": { "node": ">=12.17" } @@ -11000,7 +10993,6 @@ "version": "7.3.0", "resolved": "https://registry.npmjs.org/typical/-/typical-7.3.0.tgz", "integrity": "sha512-ya4mg/30vm+DOWfBg4YK3j2WD6TWtRkCbasOJr40CseYENzCUby/7rIvXA99JGsQHeNxLbnXdyLLxKSv3tauFw==", - "peer": true, "engines": { "node": ">=12.17" } @@ -11268,7 +11260,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz", "integrity": "sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==", - "peer": true, "dependencies": { "call-bind": "^1.0.6", "es-errors": "^1.3.0", @@ -11285,7 +11276,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz", "integrity": "sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==", - "peer": true, "dependencies": { "call-bind": "^1.0.7", "es-errors": "^1.3.0", @@ -11302,7 +11292,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz", "integrity": "sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==", - "peer": true, "dependencies": { "call-bind": "^1.0.6", "es-errors": "^1.3.0", @@ -11541,7 +11530,8 @@ "version": "0.0.1521046", "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1521046.tgz", "integrity": "sha512-vhE6eymDQSKWUXwwA37NtTTVEzjtGVfDr3pRbsWEQ5onH/Snp2c+2xZHWJJawG/0hCCJLRGt4xVtEVUVILol4w==", - "license": "BSD-3-Clause" + "license": "BSD-3-Clause", + "peer": true }, "node_modules/diff": { "version": "7.0.0", @@ -11859,7 +11849,6 @@ "version": "1.23.5", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.5.tgz", "integrity": "sha512-vlmniQ0WNPwXqA0BnmwV3Ng7HxiGlh6r5U6JcTMNx8OilcAGqVJBHJcPjqOMaczU9fRuRK5Px2BdVyPRnKMMVQ==", - "peer": true, "dependencies": { "array-buffer-byte-length": "^1.0.1", "arraybuffer.prototype.slice": "^1.0.3", @@ -11968,7 +11957,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.2.tgz", "integrity": "sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==", - "peer": true, "dependencies": { "hasown": "^2.0.0" } @@ -11977,7 +11965,6 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.3.0.tgz", "integrity": "sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==", - "peer": true, "dependencies": { "is-callable": "^1.2.7", "is-date-object": "^1.0.5", @@ -12433,6 +12420,7 @@ "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz", "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", + "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", @@ -12517,7 +12505,6 @@ "version": "0.3.9", "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==", - "peer": true, "dependencies": { "debug": "^3.2.7", "is-core-module": "^2.13.0", @@ -12528,7 +12515,6 @@ "version": "3.2.7", "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "peer": true, "dependencies": { "ms": "^2.1.1" } @@ -12537,7 +12523,6 @@ "version": "2.12.0", "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.12.0.tgz", "integrity": "sha512-wALZ0HFoytlyh/1+4wuZ9FJCD/leWHQzzrxJ8+rebyReSLk7LApMyd3WJaLVoN+D5+WIdJyDK1c6JnE65V4Zyg==", - "peer": true, "dependencies": { "debug": "^3.2.7" }, @@ -12554,7 +12539,6 @@ "version": "3.2.7", "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "peer": true, "dependencies": { "ms": "^2.1.1" } @@ -12563,7 +12547,6 @@ "version": "2.31.0", "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.31.0.tgz", "integrity": "sha512-ixmkI62Rbc2/w8Vfxyh1jQRTdRTF52VxwRVHl/ykPAmqG+Nb7/kNn+byLP0LxPgI7zWA16Jt82SybJInmMia3A==", - "peer": true, "dependencies": { "@rtsao/scc": "^1.1.0", "array-includes": "^3.1.8", @@ -12597,7 +12580,6 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "license": "MIT", - "peer": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -12607,7 +12589,6 @@ "version": "3.2.7", "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "peer": true, "dependencies": { "ms": "^2.1.1" } @@ -12616,7 +12597,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", - "peer": true, "dependencies": { "esutils": "^2.0.2" }, @@ -12628,7 +12608,6 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "peer": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -13256,7 +13235,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/find-replace/-/find-replace-3.0.0.tgz", "integrity": "sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ==", - "peer": true, "dependencies": { "array-back": "^3.0.1" }, @@ -13295,8 +13273,7 @@ "node_modules/flatbuffers": { "version": "23.5.26", "resolved": "https://registry.npmjs.org/flatbuffers/-/flatbuffers-23.5.26.tgz", - "integrity": "sha512-vE+SI9vrJDwi1oETtTIFldC/o9GsVKRM+s6EL0nQgxXlYV1Vc4Tk30hj4xGICftInKQKj1F3up2n8UbIVobISQ==", - "peer": true + "integrity": "sha512-vE+SI9vrJDwi1oETtTIFldC/o9GsVKRM+s6EL0nQgxXlYV1Vc4Tk30hj4xGICftInKQKj1F3up2n8UbIVobISQ==" }, "node_modules/flatted": { "version": "3.3.2", @@ -13331,7 +13308,6 @@ "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", - "peer": true, "dependencies": { "is-callable": "^1.1.3" } @@ -13476,7 +13452,6 @@ "version": "1.1.6", "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", - "peer": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", @@ -13494,7 +13469,6 @@ "version": "1.2.3", "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", - "peer": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -13686,7 +13660,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz", "integrity": "sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==", - "peer": true, "dependencies": { "call-bind": "^1.0.5", "es-errors": "^1.3.0", @@ -13797,7 +13770,6 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", - "peer": true, "dependencies": { "define-properties": "^1.2.1", "gopd": "^1.0.1" @@ -13986,7 +13958,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", - "peer": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -14022,7 +13993,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.2.0.tgz", "integrity": "sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ==", - "peer": true, "dependencies": { "dunder-proto": "^1.0.0" }, @@ -14380,7 +14350,6 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", - "peer": true, "dependencies": { "es-errors": "^1.3.0", "hasown": "^2.0.0", @@ -14414,7 +14383,6 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", - "peer": true, "dependencies": { "call-bind": "^1.0.2", "get-intrinsic": "^1.2.1" @@ -14435,7 +14403,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.0.0.tgz", "integrity": "sha512-Y1JXKrfykRJGdlDwdKlLpLyMIiWqWvuSd17TvZk68PLAOGOoF4Xyav1z0Xhoi+gCYjZVeC5SI+hYFOfvXmGRCA==", - "peer": true, "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -14450,7 +14417,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.1.0.tgz", "integrity": "sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==", - "peer": true, "dependencies": { "has-bigints": "^1.0.2" }, @@ -14477,7 +14443,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.2.0.tgz", "integrity": "sha512-kR5g0+dXf/+kXnqI+lu0URKYPKgICtHGGNCDSB10AaUFj3o/HkB3u7WfpRBJGFopxxY0oH3ux7ZsDjLtK7xqvw==", - "peer": true, "dependencies": { "call-bind": "^1.0.7", "has-tostringtag": "^1.0.2" @@ -14493,7 +14458,6 @@ "version": "1.2.7", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", - "peer": true, "engines": { "node": ">= 0.4" }, @@ -14519,7 +14483,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.1.tgz", "integrity": "sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==", - "peer": true, "dependencies": { "is-typed-array": "^1.1.13" }, @@ -14534,7 +14497,6 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", - "peer": true, "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -14576,7 +14538,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.1.0.tgz", "integrity": "sha512-qfMdqbAQEwBw78ZyReKnlA8ezmPdb9BemzIIip/JkjaZUhitfXDkkr+3QTboW0JrSXT1QWyYShpvnNHGZ4c4yA==", - "peer": true, "dependencies": { "call-bind": "^1.0.7" }, @@ -14608,7 +14569,6 @@ "version": "1.0.10", "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", - "peer": true, "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -14649,7 +14609,6 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz", "integrity": "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==", - "peer": true, "engines": { "node": ">= 0.4" }, @@ -14661,7 +14620,6 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", - "peer": true, "engines": { "node": ">= 0.4" }, @@ -14681,7 +14639,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.1.0.tgz", "integrity": "sha512-KVSZV0Dunv9DTPkhXwcZ3Q+tUc9TsaE1ZwX5J2WMvsSGS6Md8TFPun5uwh0yRdrNerI6vf/tbJxqSx4c1ZI1Lw==", - "peer": true, "dependencies": { "call-bind": "^1.0.7", "has-tostringtag": "^1.0.2" @@ -14720,7 +14677,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.0.tgz", "integrity": "sha512-B6ohK4ZmoftlUe+uvenXSbPJFo6U37BH7oO1B3nQH8f/7h27N56s85MhUtbFJAziz5dcmuR3i8ovUl35zp8pFA==", - "peer": true, "dependencies": { "call-bind": "^1.0.7", "gopd": "^1.1.0", @@ -14738,7 +14694,6 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz", "integrity": "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==", - "peer": true, "engines": { "node": ">= 0.4" }, @@ -14750,7 +14705,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", - "peer": true, "dependencies": { "call-bind": "^1.0.7" }, @@ -14776,7 +14730,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.1.0.tgz", "integrity": "sha512-PlfzajuF9vSo5wErv3MJAKD/nqf9ngAs1NFQYm16nUYFO2IzxJ2hcm+IOCg+EEopdykNNUhVq5cz35cAUxU8+g==", - "peer": true, "dependencies": { "call-bind": "^1.0.7", "has-tostringtag": "^1.0.2" @@ -14792,7 +14745,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.1.0.tgz", "integrity": "sha512-qS8KkNNXUZ/I+nX6QT8ZS1/Yx0A444yhzdTKxCzKkNjQ9sHErBxJnJAgh+f5YhusYECEcjo4XcyH87hn6+ks0A==", - "peer": true, "dependencies": { "call-bind": "^1.0.7", "has-symbols": "^1.0.3", @@ -14809,7 +14761,6 @@ "version": "1.1.13", "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", - "peer": true, "dependencies": { "which-typed-array": "^1.1.14" }, @@ -14829,7 +14780,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz", "integrity": "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==", - "peer": true, "engines": { "node": ">= 0.4" }, @@ -14841,7 +14791,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", - "peer": true, "dependencies": { "call-bind": "^1.0.2" }, @@ -14853,7 +14802,6 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.3.tgz", "integrity": "sha512-LvIm3/KWzS9oRFHugab7d+M/GcBXuXX5xZkzPmN+NxihdQlZUQ4dWuSV1xR/sq6upL1TJEDrfBgRepHFdBtSNQ==", - "peer": true, "dependencies": { "call-bind": "^1.0.7", "get-intrinsic": "^1.2.4" @@ -14879,8 +14827,7 @@ "node_modules/isarray": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", - "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", - "peer": true + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==" }, "node_modules/isexe": { "version": "2.0.0", @@ -15030,6 +14977,7 @@ "resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz", "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==", "dev": true, + "peer": true, "dependencies": { "@jest/core": "^29.7.0", "@jest/types": "^29.6.3", @@ -15961,6 +15909,7 @@ "version": "24.1.3", "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-24.1.3.tgz", "integrity": "sha512-MyL55p3Ut3cXbeBEG7Hcv0mVM8pp8PBNWxRqchZnSfAiES1v1mRnMeFfaHWIPULpwsYfvO+ZmMZz5tGCnjzDUQ==", + "peer": true, "dependencies": { "cssstyle": "^4.0.1", "data-urls": "^5.0.0", @@ -16020,7 +15969,6 @@ "version": "0.0.3", "resolved": "https://registry.npmjs.org/json-bignum/-/json-bignum-0.0.3.tgz", "integrity": "sha512-2WHyXj3OfHSgNyuzDbSxI1w2jgw5gkWSWhS7Qg4bWXx1nLk3jnbwfUeS0PSba3IzpTUWdHxBieELUzXRjQB2zg==", - "peer": true, "engines": { "node": ">=0.8" } @@ -16088,21 +16036,23 @@ } }, "node_modules/jsonwebtoken/node_modules/jwa": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", - "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.2.tgz", + "integrity": "sha512-eeH5JO+21J78qMvTIDdBXidBd6nG2kZjg5Ohz/1fpa28Z4CcsWUzJ1ZZyFq/3z3N17aZy+ZuBoHljASbL1WfOw==", + "license": "MIT", "dependencies": { - "buffer-equal-constant-time": "1.0.1", + "buffer-equal-constant-time": "^1.0.1", "ecdsa-sig-formatter": "1.0.11", "safe-buffer": "^5.0.1" } }, "node_modules/jsonwebtoken/node_modules/jws": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", - "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.3.tgz", + "integrity": "sha512-byiJ0FLRdLdSVSReO/U4E7RoEyOCKnEnEPMjq3HxWtvzLsV08/i5RQKsFVNkCldrCaPr2vDNAOMsfs8T/Hze7g==", + "license": "MIT", "dependencies": { - "jwa": "^1.4.1", + "jwa": "^1.4.2", "safe-buffer": "^5.0.1" } }, @@ -16132,21 +16082,23 @@ } }, "node_modules/jwa": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz", - "integrity": "sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.1.tgz", + "integrity": "sha512-hRF04fqJIP8Abbkq5NKGN0Bbr3JxlQ+qhZufXVr0DvujKy93ZCbXZMHDL4EOtodSbCWxOqR8MS1tXA5hwqCXDg==", + "license": "MIT", "dependencies": { - "buffer-equal-constant-time": "1.0.1", + "buffer-equal-constant-time": "^1.0.1", "ecdsa-sig-formatter": "1.0.11", "safe-buffer": "^5.0.1" } }, "node_modules/jws": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz", - "integrity": "sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.1.tgz", + "integrity": "sha512-EKI/M/yqPncGUUh44xz0PxSidXFr/+r0pA70+gIYhjv+et7yxM+s29Y+VGDkovRofQem0fs7Uvf4+YmAdyRduA==", + "license": "MIT", "dependencies": { - "jwa": "^2.0.0", + "jwa": "^2.0.1", "safe-buffer": "^5.0.1" } }, @@ -16276,8 +16228,7 @@ "node_modules/lodash.camelcase": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", - "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", - "peer": true + "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==" }, "node_modules/lodash.debounce": { "version": "4.0.8", @@ -17475,7 +17426,6 @@ "version": "2.0.8", "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.8.tgz", "integrity": "sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==", - "peer": true, "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", @@ -17493,7 +17443,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.3.tgz", "integrity": "sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==", - "peer": true, "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", @@ -17507,7 +17456,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.0.tgz", "integrity": "sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ==", - "peer": true, "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", @@ -17817,7 +17765,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/pad-left/-/pad-left-2.1.0.tgz", "integrity": "sha512-HJxs9K9AztdIQIAIa/OIazRAUW/L6B9hbQDxO4X07roW3eo9XqZc2ur9bn1StH9CnbbI9EgvejHQX7CBpCF1QA==", - "peer": true, "dependencies": { "repeat-string": "^1.5.4" }, @@ -17996,6 +17943,7 @@ "version": "8.13.1", "resolved": "https://registry.npmjs.org/pg/-/pg-8.13.1.tgz", "integrity": "sha512-OUir1A0rPNZlX//c7ksiu7crsGZTKSOXJPgtNiHGIlC9H0lO+NC6ZDYksSgBYY/thSWhnSRBv8w1lieNNGATNQ==", + "peer": true, "dependencies": { "pg-connection-string": "^2.7.0", "pg-pool": "^3.7.0", @@ -18260,7 +18208,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", - "peer": true, "engines": { "node": ">= 0.4" } @@ -18713,7 +18660,8 @@ "node_modules/puppeteer-chromium-resolver/node_modules/devtools-protocol": { "version": "0.0.1367902", "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1367902.tgz", - "integrity": "sha512-XxtPuC3PGakY6PD7dG66/o8KwJ/LkH2/EKe19Dcw58w53dv4/vSQEkn/SzuyhHE2q4zPgCkxQBxus3VV4ql+Pg==" + "integrity": "sha512-XxtPuC3PGakY6PD7dG66/o8KwJ/LkH2/EKe19Dcw58w53dv4/vSQEkn/SzuyhHE2q4zPgCkxQBxus3VV4ql+Pg==", + "peer": true }, "node_modules/puppeteer-chromium-resolver/node_modules/puppeteer-core": { "version": "23.10.2", @@ -18930,7 +18878,6 @@ "version": "1.0.8", "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.8.tgz", "integrity": "sha512-B5dj6usc5dkk8uFliwjwDHM8To5/QwdKz9JcBZ8Ic4G1f0YmeeJTtE/ZTdgRFPAfxZFiUaPhZ1Jcs4qeagItGQ==", - "peer": true, "dependencies": { "call-bind": "^1.0.8", "define-properties": "^1.2.1", @@ -19012,7 +18959,6 @@ "version": "1.5.3", "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.3.tgz", "integrity": "sha512-vqlC04+RQoFalODCbCumG2xIOvapzVMHwsyIGM/SIE8fRhFFsXeH8/QQ+s0T0kDAhKc4k30s73/0ydkHQz6HlQ==", - "peer": true, "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", @@ -19367,7 +19313,6 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz", "integrity": "sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==", - "peer": true, "dependencies": { "call-bind": "^1.0.7", "get-intrinsic": "^1.2.4", @@ -19404,7 +19349,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.3.tgz", "integrity": "sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==", - "peer": true, "dependencies": { "call-bind": "^1.0.6", "es-errors": "^1.3.0", @@ -19534,7 +19478,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", - "peer": true, "dependencies": { "define-data-property": "^1.1.4", "es-errors": "^1.3.0", @@ -20136,7 +20079,6 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/stream-read-all/-/stream-read-all-3.0.1.tgz", "integrity": "sha512-EWZT9XOceBPlVJRrYcykW8jyRSZYbkb/0ZK36uLEmoWVO5gxBOnntNTseNzfREsqxqdfEGQrD8SXQ3QWbBmq8A==", - "peer": true, "engines": { "node": ">=10" } @@ -20206,7 +20148,6 @@ "version": "1.2.9", "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz", "integrity": "sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==", - "peer": true, "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", @@ -20224,7 +20165,6 @@ "version": "1.0.8", "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz", "integrity": "sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==", - "peer": true, "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", @@ -20238,7 +20178,6 @@ "version": "1.0.8", "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", - "peer": true, "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", @@ -20363,7 +20302,6 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/table-layout/-/table-layout-3.0.2.tgz", "integrity": "sha512-rpyNZYRw+/C+dYkcQ3Pr+rLxW4CfHpXjPDnG7lYhdRoUcZTUt+KEsX+94RGp/aVp/MQU35JCITv2T/beY4m+hw==", - "peer": true, "dependencies": { "@75lb/deep-merge": "^1.1.1", "array-back": "^6.2.2", @@ -20384,7 +20322,6 @@ "version": "6.2.2", "resolved": "https://registry.npmjs.org/array-back/-/array-back-6.2.2.tgz", "integrity": "sha512-gUAZ7HPyb4SJczXAMUXMGAvI976JoK3qEx9v1FTmeYuJj0IBiaKttG1ydtGKdkfqWkIkouke7nG8ufGy77+Cvw==", - "peer": true, "engines": { "node": ">=12.17" } @@ -20393,7 +20330,6 @@ "version": "7.3.0", "resolved": "https://registry.npmjs.org/typical/-/typical-7.3.0.tgz", "integrity": "sha512-ya4mg/30vm+DOWfBg4YK3j2WD6TWtRkCbasOJr40CseYENzCUby/7rIvXA99JGsQHeNxLbnXdyLLxKSv3tauFw==", - "peer": true, "engines": { "node": ">=12.17" } @@ -20661,6 +20597,7 @@ "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=12" }, @@ -20852,7 +20789,6 @@ "version": "3.15.0", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", - "peer": true, "dependencies": { "@types/json5": "^0.0.29", "json5": "^1.0.2", @@ -20864,7 +20800,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", - "peer": true, "dependencies": { "minimist": "^1.2.0" }, @@ -20876,7 +20811,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", - "peer": true, "engines": { "node": ">=4" } @@ -20970,7 +20904,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz", "integrity": "sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==", - "peer": true, "dependencies": { "call-bind": "^1.0.7", "es-errors": "^1.3.0", @@ -20984,7 +20917,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz", "integrity": "sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==", - "peer": true, "dependencies": { "call-bind": "^1.0.7", "for-each": "^0.3.3", @@ -21003,7 +20935,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.3.tgz", "integrity": "sha512-GsvTyUHTriq6o/bHcTd0vM7OQ9JEdlvluu9YISaA7+KzDzPaIzEeDFNkTfhdE3MYcNhNi0vq/LlegYgIs5yPAw==", - "peer": true, "dependencies": { "available-typed-arrays": "^1.0.7", "call-bind": "^1.0.7", @@ -21024,7 +20955,6 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.7.tgz", "integrity": "sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==", - "peer": true, "dependencies": { "call-bind": "^1.0.7", "for-each": "^0.3.3", @@ -21050,6 +20980,7 @@ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz", "integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==", "devOptional": true, + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -21062,7 +20993,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/typical/-/typical-4.0.0.tgz", "integrity": "sha512-VAH4IvQ7BDFYglMd7BPRDfLgxZZX4O4TFcRDA6EN5X7erNJJq+McIEp8np9aVtxrCJ6qx4GTYVfOWNjcqwZgRw==", - "peer": true, "engines": { "node": ">=8" } @@ -21083,7 +21013,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", - "peer": true, "dependencies": { "call-bind": "^1.0.2", "has-bigints": "^1.0.2", @@ -21483,6 +21412,7 @@ "integrity": "sha512-0msEVHJEScQbhkbVTb/4iHZdJ6SXp/AvxL2sjwYQFfBqleHtnCqv1J3sa9zbWz/6kW1m9Tfzn92vW+kZ1WV6QA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.4.4", @@ -21654,6 +21584,7 @@ "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=12" }, @@ -21848,7 +21779,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.1.0.tgz", "integrity": "sha512-Ei7Miu/AXe2JJ4iNF5j/UphAgRoma4trE6PtisM09bPygb3egMH3YLW/befsWb1A1AxvNSFidOFTB18XtnIIng==", - "peer": true, "dependencies": { "is-bigint": "^1.1.0", "is-boolean-object": "^1.2.0", @@ -21867,7 +21797,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/which-builtin-type/-/which-builtin-type-1.2.0.tgz", "integrity": "sha512-I+qLGQ/vucCby4tf5HsLmGueEla4ZhwTBSqaooS+Y0BuxN4Cp+okmGuV+8mXZ84KDI9BA+oklo+RzKg0ONdSUA==", - "peer": true, "dependencies": { "call-bind": "^1.0.7", "function.prototype.name": "^1.1.6", @@ -21894,7 +21823,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.2.tgz", "integrity": "sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==", - "peer": true, "dependencies": { "is-map": "^2.0.3", "is-set": "^2.0.3", @@ -21912,7 +21840,6 @@ "version": "1.1.16", "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.16.tgz", "integrity": "sha512-g+N+GAWiRj66DngFwHvISJd+ITsyphZvD1vChfVg6cEdnzy53GzB3oy0fUNlvhz7H7+MiqhYr26qxQShCpKTTQ==", - "peer": true, "dependencies": { "available-typed-arrays": "^1.0.7", "call-bind": "^1.0.7", @@ -22138,7 +22065,6 @@ "version": "5.1.0", "resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-5.1.0.tgz", "integrity": "sha512-JNjcULU2e4KJwUNv6CHgI46UvDGitb6dGryHajXTDiLgg1/RiGoPSDw4kZfYnwGtEXf2ZMeIewDQgFGzkCB2Sg==", - "peer": true, "engines": { "node": ">=12.17" } @@ -22204,6 +22130,7 @@ "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.3.tgz", "integrity": "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==", "license": "MIT", + "peer": true, "engines": { "node": ">=10.0.0" }, @@ -22274,6 +22201,7 @@ "version": "2.6.1", "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.6.1.tgz", "integrity": "sha512-7r0XPzioN/Q9kXBro/XPnA6kznR73DHq+GXh5ON7ZozRO6aMjbmiBuKste2wslTFkC5d1dw0GooOCepZXJ2SAg==", + "peer": true, "bin": { "yaml": "bin.mjs" }, @@ -22331,6 +22259,7 @@ "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", "license": "MIT", + "peer": true, "funding": { "url": "https://github.com/sponsors/colinhacks" } diff --git a/core/tools/implementations/readFileRange.integration.vitest.ts b/core/tools/implementations/readFileRange.integration.vitest.ts index 945d03e41..72f9a13d0 100644 --- a/core/tools/implementations/readFileRange.integration.vitest.ts +++ b/core/tools/implementations/readFileRange.integration.vitest.ts @@ -1,6 +1,6 @@ import { expect, test, vi } from "vitest"; import { ToolExtras } from "../.."; -import { readFileRangeImpl } from "./readFileRange"; +import { MAX_CHAR_POSITION, readFileRangeImpl } from "./readFileRange"; // Mock the dependencies vi.mock("../../util/ideUtils", () => ({ @@ -76,7 +76,7 @@ test("readFileRangeImpl handles out-of-bounds ranges gracefully", async () => { "file:///test.txt", { start: { line: 99, character: 0 }, // 100 - 1 - end: { line: 104, character: Number.MAX_SAFE_INTEGER }, // 105 - 1 + end: { line: 104, character: MAX_CHAR_POSITION }, // 105 - 1 }, ); @@ -84,7 +84,7 @@ test("readFileRangeImpl handles out-of-bounds ranges gracefully", async () => { "file:///test.txt", { start: { line: 4, character: 0 }, // 5 - 1 - end: { line: 99, character: Number.MAX_SAFE_INTEGER }, // 100 - 1 + end: { line: 99, character: MAX_CHAR_POSITION }, // 100 - 1 }, ); }); @@ -199,6 +199,6 @@ test("readFileRangeImpl handles normal ranges correctly", async () => { // Verify correct 0-based conversion expect(mockIde.readRangeInFile).toHaveBeenCalledWith("file:///test.txt", { start: { line: 1, character: 0 }, // 2 - 1 - end: { line: 3, character: Number.MAX_SAFE_INTEGER }, // 4 - 1 + end: { line: 3, character: MAX_CHAR_POSITION }, // 4 - 1 }); }); diff --git a/core/tools/implementations/readFileRange.ts b/core/tools/implementations/readFileRange.ts index 7b5f47338..1facb4573 100644 --- a/core/tools/implementations/readFileRange.ts +++ b/core/tools/implementations/readFileRange.ts @@ -7,6 +7,10 @@ import { getNumberArg, getStringArg } from "../parseArgs"; import { throwIfFileExceedsHalfOfContext } from "./readFileLimit"; import { ContinueError, ContinueErrorReason } from "../../util/errors"; +// Use Int.MAX_VALUE from Java/Kotlin (2^31 - 1) instead of JavaScript's Number.MAX_SAFE_INTEGER +// to ensure compatibility with IntelliJ's Kotlin Position type which uses Int for character field +export const MAX_CHAR_POSITION = 2147483647; + export const readFileRangeImpl: ToolImpl = async (args, extras) => { const filepath = getStringArg(args, "filepath"); const startLine = getNumberArg(args, "startLine"); @@ -52,7 +56,7 @@ export const readFileRangeImpl: ToolImpl = async (args, extras) => { }, end: { line: endLine - 1, // Convert from 1-based to 0-based - character: Number.MAX_SAFE_INTEGER, // Read to end of line + character: MAX_CHAR_POSITION, // Read to end of line }, }); diff --git a/core/util/history.ts b/core/util/history.ts index 65d7d53f0..cc1cf69cb 100644 --- a/core/util/history.ts +++ b/core/util/history.ts @@ -114,6 +114,9 @@ export class HistoryManager { if (session.chatModelTitle !== undefined) { orderedSession.chatModelTitle = session.chatModelTitle; } + if (session.usage !== undefined) { + orderedSession.usage = session.usage; + } fs.writeFileSync( getSessionFilePath(session.sessionId), diff --git a/extensions/cli/package-lock.json b/extensions/cli/package-lock.json index 375235129..7b8d0eb54 100644 --- a/extensions/cli/package-lock.json +++ b/extensions/cli/package-lock.json @@ -273,11 +273,12 @@ "license": "Apache-2.0", "dependencies": { "@anthropic-ai/sdk": "^0.67.0", - "@aws-sdk/client-bedrock-runtime": "^3.925.0", + "@aws-sdk/client-bedrock-runtime": "^3.929.0", "@aws-sdk/credential-providers": "^3.929.0", "@continuedev/config-types": "^1.0.14", "@continuedev/config-yaml": "^1.36.0", "@continuedev/fetch": "^1.6.0", + "@google/genai": "^1.30.0", "dotenv": "^16.5.0", "google-auth-library": "^10.4.1", "json-schema": "^0.4.0", @@ -16535,9 +16536,9 @@ } }, "node_modules/react": { - "version": "19.1.1", - "resolved": "https://registry.npmjs.org/react/-/react-19.1.1.tgz", - "integrity": "sha512-w8nqGImo45dmMIfljjMwOGtbmC/mk4CMYhWIicdSflH91J9TyCyczcPFXJzrZ/ZXcgGRFeP6BU0BEJTw6tZdfQ==", + "version": "19.2.1", + "resolved": "https://registry.npmjs.org/react/-/react-19.2.1.tgz", + "integrity": "sha512-DGrYcCWK7tvYMnWh79yrPHt+vdx9tY+1gPZa7nJQtO/p8bLTDaHp4dzwEhQB7pZ4Xe3ok4XKuEPrVuc+wlpkmw==", "dev": true, "license": "MIT", "engines": { @@ -16545,19 +16546,27 @@ } }, "node_modules/react-dom": { - "version": "19.1.1", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.1.1.tgz", - "integrity": "sha512-Dlq/5LAZgF0Gaz6yiqZCf6VCcZs1ghAJyrsu84Q/GT0gV+mCxbfmKNoGRKBYMJ8IEdGPqu49YWXD02GCknEDkw==", + "version": "19.2.1", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.1.tgz", + "integrity": "sha512-ibrK8llX2a4eOskq1mXKu/TGZj9qzomO+sNfO98M6d9zIPOEhlBkMkBUBLd1vgS0gQsLDBzA+8jJBVXDnfHmJg==", "dev": true, "license": "MIT", "peer": true, "dependencies": { - "scheduler": "^0.26.0" + "scheduler": "^0.27.0" }, "peerDependencies": { - "react": "^19.1.1" + "react": "^19.2.1" } }, + "node_modules/react-dom/node_modules/scheduler": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.27.0.tgz", + "integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==", + "dev": true, + "license": "MIT", + "peer": true + }, "node_modules/react-is": { "version": "17.0.2", "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", diff --git a/extensions/cli/spec/shell-mode.md b/extensions/cli/spec/shell-mode.md index 2a4693b8a..dd5c2dc18 100644 --- a/extensions/cli/spec/shell-mode.md +++ b/extensions/cli/spec/shell-mode.md @@ -27,6 +27,8 @@ Interaction with other input helpers - "/" slash command UI is disabled. - When in slash command mode (input starts with /): - "@" file search suggestions are disabled. + - Enter submits the highlighted slash command directly (except /title, which requires Tab to select first). + - Tab selects the highlighted command without submitting. Submission behavior diff --git a/extensions/cli/src/commands/devbox-entrypoint.md b/extensions/cli/src/commands/devbox-entrypoint.md new file mode 100644 index 000000000..bd4382058 --- /dev/null +++ b/extensions/cli/src/commands/devbox-entrypoint.md @@ -0,0 +1,12 @@ +# Devbox entrypoint behavior (cn serve) + +Context: runloop resumes a devbox by re-running the same entrypoint script, which invokes `cn serve --id ...`. Because the entrypoint always replays, the CLI must avoid duplicating state on restart. + +- **Session reuse:** `serve` now calls `loadOrCreateSessionById` when `--id` is provided so the same session file is reused instead of generating a new UUID. This keeps chat history intact across suspend/resume. +- **Skip replaying the initial prompt:** `shouldQueueInitialPrompt` checks existing history and only queues the initial prompt when there are no non-system messages. This prevents the first prompt from being resent when a suspended devbox restarts. +- **Environment persistence:** The devbox entrypoint (control-plane) writes all env vars to `~/.continue/devbox-env` and sources it before `cn serve`, so keys survive suspend/resume. The CLI assumes env is already present. + +Operational notes: + +- Changing the entrypoint is expensive; prefer adapting CLI/session behavior as above. +- When testing suspend/resume, confirm a single session file under `~/.continue/sessions` for the agent id and that follow-up messages append normally without replaying the first prompt. diff --git a/extensions/cli/src/commands/serve.initialPrompt.test.ts b/extensions/cli/src/commands/serve.initialPrompt.test.ts new file mode 100644 index 000000000..6e11b4571 --- /dev/null +++ b/extensions/cli/src/commands/serve.initialPrompt.test.ts @@ -0,0 +1,30 @@ +import type { ChatHistoryItem } from "core/index.js"; +import { describe, expect, it } from "vitest"; + +import { shouldQueueInitialPrompt } from "./serve.js"; + +const systemOnly: ChatHistoryItem[] = [ + { message: { role: "system", content: "sys" }, contextItems: [] }, +]; + +const withConversation: ChatHistoryItem[] = [ + ...systemOnly, + { message: { role: "user", content: "hi" }, contextItems: [] }, + { message: { role: "assistant", content: "hello" }, contextItems: [] }, +]; + +describe("shouldQueueInitialPrompt", () => { + it("returns false when no prompt is provided", () => { + expect(shouldQueueInitialPrompt([], undefined)).toBe(false); + expect(shouldQueueInitialPrompt([], null)).toBe(false); + }); + + it("returns true when prompt exists and only system history is present", () => { + expect(shouldQueueInitialPrompt([], "prompt")).toBe(true); + expect(shouldQueueInitialPrompt(systemOnly, "prompt")).toBe(true); + }); + + it("returns false when prompt exists but conversation already has non-system messages", () => { + expect(shouldQueueInitialPrompt(withConversation, "prompt")).toBe(false); + }); +}); diff --git a/extensions/cli/src/commands/serve.ts b/extensions/cli/src/commands/serve.ts index 18fd26748..f77e86f41 100644 --- a/extensions/cli/src/commands/serve.ts +++ b/extensions/cli/src/commands/serve.ts @@ -23,7 +23,11 @@ import { ConfigServiceState, ModelServiceState, } from "../services/types.js"; -import { createSession, getCompleteStateSnapshot } from "../session.js"; +import { + createSession, + getCompleteStateSnapshot, + loadOrCreateSessionById, +} from "../session.js"; import { messageQueue } from "../stream/messageQueue.js"; import { constructSystemMessage } from "../systemMessage.js"; import { telemetryService } from "../telemetry/telemetryService.js"; @@ -47,6 +51,26 @@ interface ServeOptions extends ExtendedCommandOptions { id?: string; } +/** + * Decide whether to enqueue the initial prompt on server startup. + * We only want to send it when starting a brand-new session; if any non-system + * messages already exist (e.g., after resume), skip to avoid replaying. + */ +export function shouldQueueInitialPrompt( + history: ChatHistoryItem[], + prompt?: string | null, +): boolean { + if (!prompt) { + return false; + } + + // If there are any non-system messages, we already have conversation context + const hasConversation = history.some( + (item) => item.message.role !== "system", + ); + return !hasConversation; +} + // eslint-disable-next-line max-statements export async function serve(prompt?: string, options: ServeOptions = {}) { await posthogService.capture("sessionStart", {}); @@ -142,7 +166,11 @@ export async function serve(prompt?: string, options: ServeOptions = {}) { }); } - const session = createSession(initialHistory); + const trimmedId = options.id?.trim(); + const session = + trimmedId && trimmedId.length > 0 + ? loadOrCreateSessionById(trimmedId, initialHistory) + : createSession(initialHistory); // Align ChatHistoryService with server session and enable remote mode try { @@ -411,10 +439,28 @@ export async function serve(prompt?: string, options: ServeOptions = {}) { agentFileState?.agentFile?.prompt, actualPrompt, ); + if (initialPrompt) { - console.log(chalk.dim("\nProcessing initial prompt...")); - await messageQueue.enqueueMessage(initialPrompt); - processMessages(state, llmApi); + const existingHistory = + (() => { + try { + return services.chatHistory.getHistory(); + } catch { + return state.session.history; + } + })() ?? []; + + if (shouldQueueInitialPrompt(existingHistory, initialPrompt)) { + logger.info(chalk.dim("\nProcessing initial prompt...")); + await messageQueue.enqueueMessage(initialPrompt); + processMessages(state, llmApi); + } else { + logger.info( + chalk.dim( + "Skipping initial prompt because existing conversation history was found.", + ), + ); + } } }); diff --git a/extensions/cli/src/session.test.ts b/extensions/cli/src/session.test.ts index 9ca3b4bd5..dc73922bd 100644 --- a/extensions/cli/src/session.test.ts +++ b/extensions/cli/src/session.test.ts @@ -10,6 +10,7 @@ import { createSession, getCurrentSession, hasSession, + loadOrCreateSessionById, loadSession, saveSession, startNewSession, @@ -36,17 +37,24 @@ vi.mock("./util/logger.js", () => ({ error: vi.fn(), }, })); -vi.mock("../../core/util/history.js", () => ({ - default: { - save: vi.fn(), - load: vi.fn(() => ({ - sessionId: "test-session-id", - title: "Test Session", - workspaceDirectory: "/test/workspace", - history: [], - })), - list: vi.fn(() => []), - }, +const mockHistoryManager: any = vi.hoisted(() => ({ + save: vi.fn((session: any) => { + // Mimic writing the session payload to disk so expectations on fs still work + fs.writeFileSync( + `/home/test/.continue/sessions/${session.sessionId}.json`, + JSON.stringify(session), + ); + }), + load: vi.fn(() => ({ + sessionId: "test-session-id", + title: "Test Session", + workspaceDirectory: "/test/workspace", + history: [], + })), + list: vi.fn(() => []), +})); +vi.mock("core/util/history.js", () => ({ + default: mockHistoryManager, })); const mockFs = vi.mocked(fs); @@ -71,6 +79,9 @@ describe("SessionManager", () => { mockFs.readFileSync.mockReturnValue("[]"); mockFs.readdirSync.mockReturnValue([]); mockFs.statSync.mockReturnValue({ mtime: new Date() } as any); + + // Ensure each test starts with a fresh session + clearSession(); }); describe("getCurrentSession", () => { @@ -82,6 +93,15 @@ describe("SessionManager", () => { title: "Untitled Session", workspaceDirectory: process.cwd(), history: [], + usage: { + promptTokens: 0, + completionTokens: 0, + totalCost: 0, + promptTokensDetails: { + cachedTokens: 0, + cacheWriteTokens: 0, + }, + }, }); }); @@ -102,6 +122,15 @@ describe("SessionManager", () => { title: "Untitled Session", workspaceDirectory: process.cwd(), history: [], + usage: { + promptTokens: 0, + completionTokens: 0, + totalCost: 0, + promptTokensDetails: { + cachedTokens: 0, + cacheWriteTokens: 0, + }, + }, }); }); @@ -127,6 +156,13 @@ describe("SessionManager", () => { expect(currentSession).toBe(session); }); + + it("should use provided sessionId when supplied", () => { + const session = createSession([], "custom-session-id"); + + expect(session.sessionId).toBe("custom-session-id"); + expect(uuidv4).not.toHaveBeenCalled(); + }); }); describe("updateSessionHistory", () => { @@ -217,6 +253,42 @@ describe("SessionManager", () => { }); }); + describe("loadOrCreateSessionById", () => { + it("should load an existing session and set it as current", () => { + const existingSession: Session = { + sessionId: "existing-id", + title: "Existing", + workspaceDirectory: "/test/workspace", + history: [ + { + message: { role: "user", content: "hi" }, + contextItems: [], + }, + ], + }; + + mockHistoryManager.load.mockReturnValue(existingSession); + + const session = loadOrCreateSessionById("existing-id"); + + expect(session).toBe(existingSession); + expect(mockHistoryManager.load).toHaveBeenCalledWith("existing-id"); + expect(getCurrentSession()).toBe(existingSession); + }); + + it("should create a new session when none exists for the id", () => { + mockHistoryManager.load.mockImplementation(() => { + throw new Error("not found"); + }); + + const session = loadOrCreateSessionById("new-id"); + + expect(session.sessionId).toBe("new-id"); + expect(session.history).toEqual([]); + expect(getCurrentSession()).toBe(session); + }); + }); + describe("loadSession", () => { it("should return null if session directory doesn't exist", () => { mockFs.existsSync.mockReturnValue(false); diff --git a/extensions/cli/src/session.ts b/extensions/cli/src/session.ts index 94b60d823..8a0173b95 100644 --- a/extensions/cli/src/session.ts +++ b/extensions/cli/src/session.ts @@ -6,6 +6,8 @@ import type { BaseSessionMetadata, ChatHistoryItem, Session, + SessionUsage, + Usage, } from "core/index.js"; import historyManager from "core/util/history.js"; import { v4 as uuidv4 } from "uuid"; @@ -75,6 +77,15 @@ export function getSessionFilePath(): string { class SessionManager { private static instance: SessionManager; private currentSession: Session | null = null; + private sessionUsage: SessionUsage = { + totalCost: 0, + promptTokens: 0, + completionTokens: 0, + promptTokensDetails: { + cachedTokens: 0, + cacheWriteTokens: 0, + }, + }; private constructor() {} @@ -97,6 +108,7 @@ class SessionManager { title: DEFAULT_SESSION_TITLE, workspaceDirectory: process.cwd(), history: [], + usage: { ...this.sessionUsage }, }; } return this.currentSession; @@ -104,6 +116,7 @@ class SessionManager { setSession(session: Session): void { this.currentSession = session; + this.syncUsageFromSession(); } updateHistory(history: ChatHistoryItem[]): void { @@ -120,6 +133,15 @@ class SessionManager { clear(): void { this.currentSession = null; + this.sessionUsage = { + totalCost: 0, + promptTokens: 0, + completionTokens: 0, + promptTokensDetails: { + cachedTokens: 0, + cacheWriteTokens: 0, + }, + }; } hasSession(): boolean { @@ -129,6 +151,63 @@ class SessionManager { getSessionId(): string { return this.getCurrentSession().sessionId; } + + trackUsage(cost: number, usage: Usage): void { + // Accumulate cost + this.sessionUsage.totalCost += cost; + + // Accumulate token counts + this.sessionUsage.promptTokens += usage.promptTokens; + this.sessionUsage.completionTokens += usage.completionTokens; + + // Accumulate cache tokens if present + if (usage.promptTokensDetails?.cachedTokens) { + this.sessionUsage.promptTokensDetails = + this.sessionUsage.promptTokensDetails || {}; + this.sessionUsage.promptTokensDetails.cachedTokens = + (this.sessionUsage.promptTokensDetails.cachedTokens || 0) + + usage.promptTokensDetails.cachedTokens; + } + + if (usage.promptTokensDetails?.cacheWriteTokens) { + this.sessionUsage.promptTokensDetails = + this.sessionUsage.promptTokensDetails || {}; + this.sessionUsage.promptTokensDetails.cacheWriteTokens = + (this.sessionUsage.promptTokensDetails.cacheWriteTokens || 0) + + usage.promptTokensDetails.cacheWriteTokens; + } + + // Update session and persist + const session = this.getCurrentSession(); + session.usage = { ...this.sessionUsage }; + saveSession(); // Persist immediately + } + + getTotalCost(): number { + return this.sessionUsage.totalCost; + } + + getUsage(): SessionUsage { + return { ...this.sessionUsage }; + } + + private syncUsageFromSession(): void { + const session = this.currentSession; + if (session?.usage) { + this.sessionUsage = { ...session.usage }; + } else { + // Migrate old sessions that only had totalCost + this.sessionUsage = { + totalCost: 0, + promptTokens: 0, + completionTokens: 0, + promptTokensDetails: { + cachedTokens: 0, + cacheWriteTokens: 0, + }, + }; + } + } } function getCurrentSessionId(): string { @@ -237,12 +316,24 @@ export function loadSession(): Session | null { /** * Create a new session */ -export function createSession(history: ChatHistoryItem[] = []): Session { +export function createSession( + history: ChatHistoryItem[] = [], + sessionId?: string, +): Session { const session: Session = { - sessionId: uuidv4(), + sessionId: sessionId ?? uuidv4(), title: DEFAULT_SESSION_TITLE, workspaceDirectory: process.cwd(), history, + usage: { + totalCost: 0, + promptTokens: 0, + completionTokens: 0, + promptTokensDetails: { + cachedTokens: 0, + cacheWriteTokens: 0, + }, + }, }; SessionManager.getInstance().setSession(session); return session; @@ -438,6 +529,24 @@ export function loadSessionById(sessionId: string): Session | null { } } +/** + * Load an existing session by ID or create a new one with that ID. + * Useful for long-lived processes (e.g., cn serve) that need to + * preserve chat history across restarts for the same storage/agent id. + */ +export function loadOrCreateSessionById( + sessionId: string, + history: ChatHistoryItem[] = [], +): Session { + const existing = loadSessionById(sessionId); + if (existing) { + SessionManager.getInstance().setSession(existing); + return existing; + } + + return createSession(history, sessionId); +} + /** * Update the current session's history */ @@ -474,8 +583,38 @@ export function startNewSession(history: ChatHistoryItem[] = []): Session { title: DEFAULT_SESSION_TITLE, workspaceDirectory: process.cwd(), history, + usage: { + totalCost: 0, + promptTokens: 0, + completionTokens: 0, + promptTokensDetails: { + cachedTokens: 0, + cacheWriteTokens: 0, + }, + }, }; manager.setSession(newSession); return newSession; } + +/** + * Track cost for the current session + */ +export function trackSessionUsage(cost: number, usage: Usage): void { + SessionManager.getInstance().trackUsage(cost, usage); +} + +/** + * Get the total cost for the current session + */ +export function getTotalSessionCost(): number { + return SessionManager.getInstance().getTotalCost(); +} + +/** + * Get the full usage statistics for the current session + */ +export function getSessionUsage(): SessionUsage { + return SessionManager.getInstance().getUsage(); +} diff --git a/extensions/cli/src/stream/streamChatResponse.autoCompaction.test.ts b/extensions/cli/src/stream/streamChatResponse.autoCompaction.test.ts index e797c683a..1e0b6638a 100644 --- a/extensions/cli/src/stream/streamChatResponse.autoCompaction.test.ts +++ b/extensions/cli/src/stream/streamChatResponse.autoCompaction.test.ts @@ -18,6 +18,7 @@ vi.mock("../session.js", () => ({ })), saveSession: vi.fn(), updateSessionHistory: vi.fn(), + trackSessionUsage: vi.fn(), })); vi.mock("../util/tokenizer.js", () => ({ diff --git a/extensions/cli/src/stream/streamChatResponse.autoContinuation.test.ts b/extensions/cli/src/stream/streamChatResponse.autoContinuation.test.ts index 8803ea987..42a6ec05f 100644 --- a/extensions/cli/src/stream/streamChatResponse.autoContinuation.test.ts +++ b/extensions/cli/src/stream/streamChatResponse.autoContinuation.test.ts @@ -15,6 +15,7 @@ vi.mock("../compaction.js", () => ({ vi.mock("../session.js", () => ({ updateSessionHistory: vi.fn(), + trackSessionUsage: vi.fn(), })); vi.mock("../util/tokenizer.js", () => ({ diff --git a/extensions/cli/src/stream/streamChatResponse.helpers.ts b/extensions/cli/src/stream/streamChatResponse.helpers.ts index e85cc2e7d..a60b10af4 100644 --- a/extensions/cli/src/stream/streamChatResponse.helpers.ts +++ b/extensions/cli/src/stream/streamChatResponse.helpers.ts @@ -1,6 +1,8 @@ // Helper functions extracted from streamChatResponse.ts to reduce file size +/* eslint-disable max-lines */ -import type { ToolStatus } from "core/index.js"; +import type { ToolStatus, Usage } from "core/index.js"; +import { calculateRequestCost } from "core/llm/utils/calculateRequestCost.js"; import { ContinueError, ContinueErrorReason } from "core/util/errors.js"; import { ChatCompletionToolMessageParam } from "openai/resources/chat/completions.mjs"; @@ -14,9 +16,9 @@ import { serviceContainer, services, } from "../services/index.js"; +import { trackSessionUsage } from "../session.js"; import { posthogService } from "../telemetry/posthogService.js"; import { telemetryService } from "../telemetry/telemetryService.js"; -import { calculateTokenCost } from "../telemetry/utils.js"; import { executeToolCall, getAllAvailableTools, @@ -241,6 +243,28 @@ export function processToolCallDelta( } } +// Helper function to detect provider from model name +function detectProvider(modelName: string): string { + const normalized = modelName.toLowerCase(); + if (normalized.includes("gpt") || normalized.includes("openai")) { + return "openai"; + } + if (normalized.includes("claude") || normalized.includes("anthropic")) { + return "anthropic"; + } + // Default to anthropic for backward compatibility + return "anthropic"; +} + +// Simple fallback cost calculation for unknown models +function calculateFallbackCost( + inputTokens: number, + outputTokens: number, +): number { + // Default pricing: $1/MTok input, $2/MTok output + return (inputTokens * 1 + outputTokens * 2) / 1_000_000; +} + // Helper function to record telemetry export function recordStreamTelemetry(options: { requestStartTime: number; @@ -249,6 +273,7 @@ export function recordStreamTelemetry(options: { outputTokens: number; model: any; tools?: any[]; + fullUsage?: any; }): number { const { requestStartTime, @@ -257,13 +282,73 @@ export function recordStreamTelemetry(options: { outputTokens, model, tools, + fullUsage, } = options; const totalDuration = responseEndTime - requestStartTime; - const cost = calculateTokenCost(inputTokens, outputTokens, model.model); - telemetryService.recordTokenUsage(inputTokens, "input", model.model); - telemetryService.recordTokenUsage(outputTokens, "output", model.model); + // Calculate cost using comprehensive pricing that includes caching + let cost: number; + let usage: Usage; + + if (fullUsage) { + // Transform API usage format to Usage interface + usage = { + promptTokens: fullUsage.prompt_tokens, + completionTokens: fullUsage.completion_tokens, + promptTokensDetails: fullUsage.prompt_tokens_details + ? { + cachedTokens: fullUsage.prompt_tokens_details.cache_read_tokens, + cacheWriteTokens: + fullUsage.prompt_tokens_details.cache_write_tokens, + } + : undefined, + }; + + // Detect provider and calculate cost + const provider = detectProvider(model.model); + const costBreakdown = calculateRequestCost(provider, model.model, usage); + + // Use fallback for unknown models + cost = + costBreakdown?.cost ?? + calculateFallbackCost( + fullUsage.prompt_tokens, + fullUsage.completion_tokens, + ); + } else { + // Fallback when fullUsage not available + usage = { + promptTokens: inputTokens, + completionTokens: outputTokens, + }; + cost = calculateFallbackCost(inputTokens, outputTokens); + } + + // Use tokens from fullUsage if available, otherwise use the passed params + const actualInputTokens = fullUsage?.prompt_tokens ?? inputTokens; + const actualOutputTokens = fullUsage?.completion_tokens ?? outputTokens; + + telemetryService.recordTokenUsage(actualInputTokens, "input", model.model); + telemetryService.recordTokenUsage(actualOutputTokens, "output", model.model); + + // Record cache tokens if available + if (fullUsage?.prompt_tokens_details?.cache_read_tokens) { + telemetryService.recordTokenUsage( + fullUsage.prompt_tokens_details.cache_read_tokens, + "cacheRead", + model.model, + ); + } + if (fullUsage?.prompt_tokens_details?.cache_write_tokens) { + telemetryService.recordTokenUsage( + fullUsage.prompt_tokens_details.cache_write_tokens, + "cacheCreation", + model.model, + ); + } + telemetryService.recordCost(cost, model.model); + trackSessionUsage(cost, usage); telemetryService.recordResponseTime( totalDuration, @@ -276,8 +361,8 @@ export function recordStreamTelemetry(options: { model: model.model, durationMs: totalDuration, success: true, - inputTokens, - outputTokens, + inputTokens: actualInputTokens, + outputTokens: actualOutputTokens, costUsd: cost, }); @@ -286,8 +371,8 @@ export function recordStreamTelemetry(options: { posthogService.capture("apiRequest", { model: model.model, durationMs: totalDuration, - inputTokens, - outputTokens, + inputTokens: actualInputTokens, + outputTokens: actualOutputTokens, costUsd: cost, }); } catch {} diff --git a/extensions/cli/src/stream/streamChatResponse.ts b/extensions/cli/src/stream/streamChatResponse.ts index be23f9f7f..098ff5a38 100644 --- a/extensions/cli/src/stream/streamChatResponse.ts +++ b/extensions/cli/src/stream/streamChatResponse.ts @@ -193,7 +193,7 @@ interface ProcessStreamingResponseOptions { } // Process a single streaming response and return whether we need to continue -// eslint-disable-next-line max-statements +// eslint-disable-next-line max-statements, complexity export async function processStreamingResponse( options: ProcessStreamingResponseOptions, ): Promise<{ @@ -284,6 +284,7 @@ export async function processStreamingResponse( let firstTokenTime: number | null = null; let inputTokens = 0; let outputTokens = 0; + let fullUsage: any = null; try { const streamWithBackoff = withExponentialBackoff( @@ -301,6 +302,7 @@ export async function processStreamingResponse( if (chunk.usage) { inputTokens = chunk.usage.prompt_tokens || 0; outputTokens = chunk.usage.completion_tokens || 0; + fullUsage = chunk.usage; // Capture full usage including cache details } // Check if we should abort @@ -338,6 +340,7 @@ export async function processStreamingResponse( outputTokens, model, tools, + fullUsage, }); const totalDuration = responseEndTime - requestStartTime; @@ -347,6 +350,8 @@ export async function processStreamingResponse( toolCallsCount: toolCallsMap.size, inputTokens, outputTokens, + cacheReadTokens: fullUsage?.prompt_tokens_details?.cache_read_tokens, + cacheWriteTokens: fullUsage?.prompt_tokens_details?.cache_write_tokens, cost, duration: totalDuration, }); diff --git a/extensions/cli/src/telemetry/utils.ts b/extensions/cli/src/telemetry/utils.ts index 6f968033a..54fb60f92 100644 --- a/extensions/cli/src/telemetry/utils.ts +++ b/extensions/cli/src/telemetry/utils.ts @@ -112,40 +112,6 @@ export function isPullRequestCommand(command: string): boolean { ); } -/** - * Simple cost calculation based on tokens and model - * This should be updated with actual pricing from model providers - */ -export function calculateTokenCost( - inputTokens: number, - outputTokens: number, - model: string, -): number { - // Pricing per 1K tokens (these are approximate and should be updated) - const pricingMap: Record = { - "gpt-4": { input: 0.03, output: 0.06 }, - "gpt-4-turbo": { input: 0.01, output: 0.03 }, - "gpt-3.5-turbo": { input: 0.0015, output: 0.002 }, - "claude-3-5-sonnet-20241022": { input: 0.003, output: 0.015 }, - "claude-3-sonnet": { input: 0.003, output: 0.015 }, - "claude-3-haiku": { input: 0.00025, output: 0.00125 }, - "claude-3-opus": { input: 0.015, output: 0.075 }, - }; - - // Find pricing for model (case insensitive partial match) - const modelKey = Object.keys(pricingMap).find((key) => - model.toLowerCase().includes(key.toLowerCase()), - ); - - if (!modelKey) { - // Default pricing if model not found - return (inputTokens * 0.001 + outputTokens * 0.002) / 1000; - } - - const pricing = pricingMap[modelKey]; - return (inputTokens * pricing.input + outputTokens * pricing.output) / 1000; -} - /** * Get file type from extension for metrics */ diff --git a/extensions/cli/src/tools/runTerminalCommand.ts b/extensions/cli/src/tools/runTerminalCommand.ts index cfa096655..ed4a2e49b 100644 --- a/extensions/cli/src/tools/runTerminalCommand.ts +++ b/extensions/cli/src/tools/runTerminalCommand.ts @@ -45,6 +45,11 @@ IMPORTANT: To edit files, use Edit/MultiEdit tools instead of bash commands (sed type: "string", description: "The command to execute in the terminal.", }, + timeout: { + type: "number", + description: + "Optional timeout in seconds (max 600). Use this parameter for commands that take longer than the default 180 second timeout.", + }, }, }, readonly: false, @@ -75,7 +80,13 @@ IMPORTANT: To edit files, use Edit/MultiEdit tools instead of bash commands (sed ], }; }, - run: async ({ command }: { command: string }): Promise => { + run: async ({ + command, + timeout, + }: { + command: string; + timeout?: number; + }): Promise => { return new Promise((resolve, reject) => { // Use same shell logic as core implementation const { shell, args } = getShellCommand(command); @@ -85,10 +96,18 @@ IMPORTANT: To edit files, use Edit/MultiEdit tools instead of bash commands (sed let timeoutId: NodeJS.Timeout; let isResolved = false; - const TIMEOUT_MS = - process.env.NODE_ENV === "test" && process.env.TEST_TERMINAL_TIMEOUT - ? parseInt(process.env.TEST_TERMINAL_TIMEOUT, 10) - : 120000; // 120 seconds default, configurable for tests + // Determine timeout: use provided timeout (capped at 600s), test env variable, or default 120s + let TIMEOUT_MS = 180000; // 180 seconds default + if (timeout !== undefined) { + // Cap at 600 seconds (10 minutes) + const cappedTimeout = Math.min(timeout, 600); + TIMEOUT_MS = cappedTimeout * 1000; + } else if ( + process.env.NODE_ENV === "test" && + process.env.TEST_TERMINAL_TIMEOUT + ) { + TIMEOUT_MS = parseInt(process.env.TEST_TERMINAL_TIMEOUT, 10); + } const resetTimeout = () => { if (timeoutId) { diff --git a/extensions/cli/src/ui/TUIChat.tsx b/extensions/cli/src/ui/TUIChat.tsx index dfcd19060..a3fef65b9 100644 --- a/extensions/cli/src/ui/TUIChat.tsx +++ b/extensions/cli/src/ui/TUIChat.tsx @@ -19,6 +19,7 @@ import { ModelServiceState, UpdateServiceState, } from "../services/types.js"; +import { getTotalSessionCost } from "../session.js"; import { logger } from "../util/logger.js"; import { ActionStatus } from "./components/ActionStatus.js"; @@ -442,6 +443,8 @@ const TUIChat: React.FC = ({ closeCurrentScreen={closeCurrentScreen} contextPercentage={contextData?.percentage} hasImageInClipboard={hasImageInClipboard} + isVerboseMode={isVerboseMode} + totalCost={getTotalSessionCost()} /> diff --git a/extensions/cli/src/ui/UserInput.tsx b/extensions/cli/src/ui/UserInput.tsx index fb31e4e5c..470688120 100644 --- a/extensions/cli/src/ui/UserInput.tsx +++ b/extensions/cli/src/ui/UserInput.tsx @@ -463,7 +463,28 @@ const UserInput: React.FC = ({ if ((key.return && !key.shift) || key.tab) { if (filteredCommands.length > 0) { - selectSlashCommand(filteredCommands[selectedCommandIndex].name); + const commandName = filteredCommands[selectedCommandIndex].name; + if (key.return && commandName !== "title") { + // select and submit the command + const commandText = "/" + commandName; + inputHistory.addEntry(commandText); + + // queue up when responding/generating + if (!isRemoteMode && (isWaitingForResponse || isCompacting)) { + void messageQueue.enqueueMessage(commandText); + } else { + onSubmit(commandText); + } + + // reset after submitting command + textBuffer.clear(); + setInputText(""); + setCursorPosition(0); + setShowSlashCommands(false); + setShowBashMode(false); + } else { + selectSlashCommand(commandName); + } } return true; } diff --git a/extensions/cli/src/ui/components/BottomStatusBar.tsx b/extensions/cli/src/ui/components/BottomStatusBar.tsx index 0dc6d2c2c..e323911da 100644 --- a/extensions/cli/src/ui/components/BottomStatusBar.tsx +++ b/extensions/cli/src/ui/components/BottomStatusBar.tsx @@ -21,6 +21,8 @@ export interface BottomStatusBarProps { closeCurrentScreen: () => void; contextPercentage?: number; hasImageInClipboard?: boolean; + isVerboseMode?: boolean; + totalCost?: number; } export const BottomStatusBar: React.FC = ({ @@ -33,6 +35,8 @@ export const BottomStatusBar: React.FC = ({ closeCurrentScreen, contextPercentage, hasImageInClipboard, + isVerboseMode, + totalCost, }) => { const [_refreshTrigger, setRefreshTrigger] = useState(0); @@ -73,6 +77,17 @@ export const BottomStatusBar: React.FC = ({ )} + {isVerboseMode && totalCost !== undefined && totalCost > 0 && ( + + + {" "} + •{" "} + + + Cost: ${totalCost.toFixed(4)} + + + )} {!isRemoteMode && services.model?.model && ( diff --git a/extensions/cli/src/util/exit.ts b/extensions/cli/src/util/exit.ts index ba27b9db2..dcdd44ab5 100644 --- a/extensions/cli/src/util/exit.ts +++ b/extensions/cli/src/util/exit.ts @@ -1,6 +1,7 @@ import type { ChatHistoryItem } from "core/index.js"; import { sentryService } from "../sentry.js"; +import { getSessionUsage } from "../session.js"; import { telemetryService } from "../telemetry/telemetryService.js"; import { getGitDiffSnapshot } from "./git.js"; @@ -60,6 +61,26 @@ export async function updateAgentMetadata( } } + // Extract session usage (cost and token counts) + try { + const usage = getSessionUsage(); + if (usage.totalCost > 0) { + metadata.usage = { + totalCost: parseFloat(usage.totalCost.toFixed(6)), + promptTokens: usage.promptTokens, + completionTokens: usage.completionTokens, + ...(usage.promptTokensDetails?.cachedTokens && { + cachedTokens: usage.promptTokensDetails.cachedTokens, + }), + ...(usage.promptTokensDetails?.cacheWriteTokens && { + cacheWriteTokens: usage.promptTokensDetails.cacheWriteTokens, + }), + }; + } + } catch (err) { + logger.debug("Failed to get session usage (non-critical)", err as any); + } + // Post metadata if we have any if (Object.keys(metadata).length > 0) { await postAgentMetadata(agentId, metadata); @@ -70,11 +91,60 @@ export async function updateAgentMetadata( } } +/** + * Display session usage breakdown in verbose mode + */ +function displaySessionUsage(): void { + const isVerbose = process.argv.includes("--verbose"); + if (!isVerbose) { + return; + } + + try { + const usage = getSessionUsage(); + if (usage.totalCost === 0) { + return; // No usage to display + } + + logger.info("\n" + "=".repeat(60)); + logger.info("Session Usage Summary"); + logger.info("=".repeat(60)); + logger.info(`Total Cost: $${usage.totalCost.toFixed(6)}`); + logger.info(""); + logger.info("Token Usage:"); + logger.info(` Input Tokens: ${usage.promptTokens.toLocaleString()}`); + logger.info( + ` Output Tokens: ${usage.completionTokens.toLocaleString()}`, + ); + + if (usage.promptTokensDetails?.cachedTokens) { + logger.info( + ` Cache Read Tokens: ${usage.promptTokensDetails.cachedTokens.toLocaleString()}`, + ); + } + + if (usage.promptTokensDetails?.cacheWriteTokens) { + logger.info( + ` Cache Write Tokens: ${usage.promptTokensDetails.cacheWriteTokens.toLocaleString()}`, + ); + } + + const totalTokens = usage.promptTokens + usage.completionTokens; + logger.info(` Total Tokens: ${totalTokens.toLocaleString()}`); + logger.info("=".repeat(60) + "\n"); + } catch (err) { + logger.debug("Failed to display session usage (non-critical)", err as any); + } +} + /** * Exit the process after flushing telemetry and error reporting. * Use this instead of process.exit() to avoid losing metrics/logs. */ export async function gracefulExit(code: number = 0): Promise { + // Display session usage breakdown in verbose mode + displaySessionUsage(); + try { // Flush metrics (forceFlush + shutdown inside service) await telemetryService.shutdown(); diff --git a/extensions/cli/src/utils/modelCapability.test.ts b/extensions/cli/src/utils/modelCapability.test.ts index 188f992b2..d3225cda2 100644 --- a/extensions/cli/src/utils/modelCapability.test.ts +++ b/extensions/cli/src/utils/modelCapability.test.ts @@ -53,26 +53,46 @@ describe("isModelCapable", () => { }); describe("Local/Ollama models", () => { - test("should consider larger models as not capable", () => { - expect(isModelCapable("ollama", "llama2-70b")).toBe(false); - expect(isModelCapable("local", "codellama-34b")).toBe(false); + test("should consider Llama models as capable (matches llama pattern)", () => { + expect(isModelCapable("ollama", "llama2-70b")).toBe(true); + expect(isModelCapable("ollama", "llama2-7b")).toBe(true); + expect(isModelCapable("local", "codellama-34b")).toBe(true); }); - test("should consider smaller models as less capable", () => { - expect(isModelCapable("ollama", "llama2-7b")).toBe(false); - expect(isModelCapable("local", "mistral-7b")).toBe(false); + test("should consider Mistral models as capable (matches mistral pattern)", () => { + expect(isModelCapable("local", "mistral-7b")).toBe(true); + expect(isModelCapable("ollama", "mistral-small")).toBe(true); + }); + + test("should consider non-capable local models as not capable", () => { + expect(isModelCapable("ollama", "falcon-7b")).toBe(false); + expect(isModelCapable("local", "starcoder-base")).toBe(false); }); }); describe("Meta/Llama models", () => { - test("should consider large Llama models as not capable", () => { - expect(isModelCapable("llama", "llama-2-70b")).toBe(false); - expect(isModelCapable("meta", "llama-65b")).toBe(false); + test("should consider Llama models as capable", () => { + expect(isModelCapable("openai", "Llama 3.3 70B")).toBe(true); + expect(isModelCapable("openai", "Llama 3.3 Nemotron 49B")).toBe(true); + expect( + isModelCapable( + "nvidia", + "nvidia/Llama-3_3-Nemotron-Super-49B-v1", + "nvidia/Llama-3_3-Nemotron-Super-49B-v1", + ), + ).toBe(true); + expect(isModelCapable("meta", "llama-3.1-70b")).toBe(true); }); - test("should consider small Llama models as less capable", () => { - expect(isModelCapable("llama", "llama-2-7b")).toBe(false); - expect(isModelCapable("meta", "llama-13b")).toBe(false); + test("should consider Nemotron models as capable", () => { + expect(isModelCapable("nvidia", "Llama 3.3 Nemotron 49B")).toBe(true); + expect(isModelCapable("nvidia", "nemotron-4-340b")).toBe(true); + }); + + test("should consider Mistral models as capable", () => { + expect(isModelCapable("mistral", "Mistral Small 24B")).toBe(true); + expect(isModelCapable("mistral", "mistral-large")).toBe(true); + expect(isModelCapable("mistralai", "mistral-small-24b")).toBe(true); }); }); @@ -83,12 +103,13 @@ describe("isModelCapable", () => { }); describe("Hugging Face models", () => { - test("should consider code-specific models as not capable", () => { - expect(isModelCapable("huggingface", "codellama-instruct")).toBe(false); - expect(isModelCapable("huggingface", "starcoder-base")).toBe(false); + test("should consider Llama/Mistral models as capable even on HuggingFace", () => { + expect(isModelCapable("huggingface", "codellama-instruct")).toBe(true); + expect(isModelCapable("huggingface", "mistral-7b-instruct")).toBe(true); }); - test("should consider general chat models as less capable", () => { + test("should consider non-capable models as not capable", () => { + expect(isModelCapable("huggingface", "starcoder-base")).toBe(false); expect(isModelCapable("huggingface", "falcon-7b")).toBe(false); }); }); @@ -145,9 +166,11 @@ describe("isModelCapable", () => { }); test("should consider models not capable when neither name nor model match", () => { - // Case where neither matches - expect(isModelCapable("custom", "llama-7b", "local-model")).toBe(false); + // Case where neither matches capable patterns expect(isModelCapable("custom", "falcon-7b", "random-model")).toBe(false); + expect(isModelCapable("custom", "unknown-model", "local-model")).toBe( + false, + ); }); }); }); diff --git a/extensions/cli/src/utils/modelCapability.ts b/extensions/cli/src/utils/modelCapability.ts index a827da0ce..c3737349a 100644 --- a/extensions/cli/src/utils/modelCapability.ts +++ b/extensions/cli/src/utils/modelCapability.ts @@ -10,7 +10,18 @@ export function isModelCapable( const normalizedName = name.toLowerCase(); const normalizedModel = model ? model.toLowerCase() : ""; - const patterns = [/gemini/, /claude/, /gpt/, /o\d/, /kimi/, /qwen/, /grok/]; + const patterns = [ + /gemini/, + /claude/, + /gpt/, + /o\d/, + /kimi/, + /qwen/, + /llama/, + /nemotron/, + /grok/, + /mistral/, + ]; // If either name OR model matches any of the patterns, consider it capable if (patterns.some((pattern) => pattern.test(normalizedName))) { diff --git a/package-lock.json b/package-lock.json index 88c4caf91..a4b2f9714 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,6 +8,7 @@ "devDependencies": { "@typescript-eslint/parser": "^8.40.0", "concurrently": "^9.1.2", + "eslint": "^8", "eslint-plugin-import": "^2.29.1", "husky": "^9.1.7", "lint-staged": "^15.5.2", @@ -17,12 +18,11 @@ } }, "node_modules/@eslint-community/eslint-utils": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.7.0.tgz", - "integrity": "sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw==", + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.0.tgz", + "integrity": "sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "eslint-visitor-keys": "^3.4.3" }, @@ -36,13 +36,25 @@ "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" } }, + "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/@eslint-community/regexpp": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", - "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", + "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } @@ -53,7 +65,6 @@ "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", @@ -78,7 +89,6 @@ "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -90,7 +100,6 @@ "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "license": "ISC", - "peer": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -104,7 +113,6 @@ "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } @@ -116,7 +124,6 @@ "deprecated": "Use @eslint/config-array instead", "dev": true, "license": "Apache-2.0", - "peer": true, "dependencies": { "@humanwhocodes/object-schema": "^2.0.3", "debug": "^4.3.1", @@ -132,7 +139,6 @@ "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -144,7 +150,6 @@ "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "license": "ISC", - "peer": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -158,7 +163,6 @@ "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", "dev": true, "license": "Apache-2.0", - "peer": true, "engines": { "node": ">=12.22" }, @@ -173,8 +177,7 @@ "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", "deprecated": "Use @eslint/object-schema instead", "dev": true, - "license": "BSD-3-Clause", - "peer": true + "license": "BSD-3-Clause" }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", @@ -364,25 +367,12 @@ "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", - "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", - "dev": true, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, "node_modules/@ungap/structured-clone": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz", "integrity": "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==", "dev": true, - "license": "ISC", - "peer": true + "license": "ISC" }, "node_modules/acorn": { "version": "8.15.0", @@ -404,7 +394,6 @@ "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true, "license": "MIT", - "peer": true, "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } @@ -415,7 +404,6 @@ "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -474,8 +462,7 @@ "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true, - "license": "Python-2.0", - "peer": true + "license": "Python-2.0" }, "node_modules/array-buffer-byte-length": { "version": "1.0.2", @@ -710,7 +697,6 @@ "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=6" } @@ -1009,8 +995,7 @@ "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/define-data-property": { "version": "1.1.4", @@ -1054,7 +1039,6 @@ "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", "dev": true, "license": "Apache-2.0", - "peer": true, "dependencies": { "esutils": "^2.0.2" }, @@ -1262,7 +1246,6 @@ "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=10" }, @@ -1475,7 +1458,6 @@ "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", "dev": true, "license": "BSD-2-Clause", - "peer": true, "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" @@ -1488,14 +1470,13 @@ } }, "node_modules/eslint-visitor-keys": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", - "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", "dev": true, "license": "Apache-2.0", - "peer": true, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" @@ -1507,19 +1488,30 @@ "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, + "node_modules/eslint/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/eslint/node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "license": "ISC", - "peer": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -1533,7 +1525,6 @@ "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", "dev": true, "license": "BSD-2-Clause", - "peer": true, "dependencies": { "acorn": "^8.9.0", "acorn-jsx": "^5.3.2", @@ -1546,13 +1537,25 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/espree/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/esquery": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", "dev": true, "license": "BSD-3-Clause", - "peer": true, "dependencies": { "estraverse": "^5.1.0" }, @@ -1566,7 +1569,6 @@ "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, "license": "BSD-2-Clause", - "peer": true, "dependencies": { "estraverse": "^5.2.0" }, @@ -1580,7 +1582,6 @@ "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, "license": "BSD-2-Clause", - "peer": true, "engines": { "node": ">=4.0" } @@ -1631,8 +1632,7 @@ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/fast-glob": { "version": "3.3.3", @@ -1667,16 +1667,14 @@ "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/fastq": { "version": "1.19.1", @@ -1694,7 +1692,6 @@ "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "flat-cache": "^3.0.4" }, @@ -1721,7 +1718,6 @@ "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" @@ -1739,7 +1735,6 @@ "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "flatted": "^3.2.9", "keyv": "^4.5.3", @@ -1754,8 +1749,7 @@ "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", "dev": true, - "license": "ISC", - "peer": true + "license": "ISC" }, "node_modules/for-each": { "version": "0.3.5", @@ -1778,8 +1772,7 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "dev": true, - "license": "ISC", - "peer": true + "license": "ISC" }, "node_modules/function-bind": { "version": "1.1.2", @@ -1922,7 +1915,6 @@ "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, "license": "ISC", - "peer": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -1944,7 +1936,6 @@ "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, "license": "ISC", - "peer": true, "dependencies": { "is-glob": "^4.0.3" }, @@ -1958,7 +1949,6 @@ "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -1970,7 +1960,6 @@ "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "license": "ISC", - "peer": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -1984,7 +1973,6 @@ "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "type-fest": "^0.20.2" }, @@ -2030,8 +2018,7 @@ "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/has-bigints": { "version": "1.1.0", @@ -2159,7 +2146,6 @@ "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">= 4" } @@ -2170,7 +2156,6 @@ "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" @@ -2188,7 +2173,6 @@ "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=0.8.19" } @@ -2200,7 +2184,6 @@ "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", "dev": true, "license": "ISC", - "peer": true, "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -2211,8 +2194,7 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true, - "license": "ISC", - "peer": true + "license": "ISC" }, "node_modules/internal-slot": { "version": "1.1.0", @@ -2491,7 +2473,6 @@ "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=8" } @@ -2669,12 +2650,11 @@ "license": "ISC" }, "node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", + "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "argparse": "^2.0.1" }, @@ -2687,24 +2667,21 @@ "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/json5": { "version": "1.0.2", @@ -2725,7 +2702,6 @@ "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "json-buffer": "3.0.1" } @@ -2736,7 +2712,6 @@ "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "prelude-ls": "^1.2.1", "type-check": "~0.4.0" @@ -2908,7 +2883,6 @@ "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "p-locate": "^5.0.0" }, @@ -2931,8 +2905,7 @@ "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/log-update": { "version": "6.1.0", @@ -3175,8 +3148,7 @@ "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/npm-run-path": { "version": "5.3.0", @@ -3310,7 +3282,6 @@ "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "dev": true, "license": "ISC", - "peer": true, "dependencies": { "wrappy": "1" } @@ -3337,7 +3308,6 @@ "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", @@ -3374,7 +3344,6 @@ "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "yocto-queue": "^0.1.0" }, @@ -3391,7 +3360,6 @@ "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "p-limit": "^3.0.2" }, @@ -3408,7 +3376,6 @@ "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "callsites": "^3.0.0" }, @@ -3422,7 +3389,6 @@ "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=8" } @@ -3433,7 +3399,6 @@ "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=0.10.0" } @@ -3497,7 +3462,6 @@ "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">= 0.8.0" } @@ -3508,6 +3472,7 @@ "integrity": "sha512-QQtaxnoDJeAkDvDKWCLiwIXkTgRhwYDEQCghU9Z6q03iyek/rxRh/2lC3HB7P8sWT2xC/y5JDctPLBIGzHKbhw==", "dev": true, "license": "MIT", + "peer": true, "bin": { "prettier": "bin/prettier.cjs" }, @@ -3603,7 +3568,6 @@ "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=6" } @@ -3710,7 +3674,6 @@ "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=4" } @@ -3773,7 +3736,6 @@ "deprecated": "Rimraf versions prior to v4 are no longer supported", "dev": true, "license": "ISC", - "peer": true, "dependencies": { "glob": "^7.1.3" }, @@ -4242,7 +4204,6 @@ "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=8" }, @@ -4284,8 +4245,7 @@ "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/to-regex-range": { "version": "5.0.1", @@ -4348,7 +4308,6 @@ "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "prelude-ls": "^1.2.1" }, @@ -4362,7 +4321,6 @@ "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", "dev": true, "license": "(MIT OR CC0-1.0)", - "peer": true, "engines": { "node": ">=10" }, @@ -4454,6 +4412,7 @@ "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", "dev": true, "license": "Apache-2.0", + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -4487,7 +4446,6 @@ "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", "dev": true, "license": "BSD-2-Clause", - "peer": true, "dependencies": { "punycode": "^2.1.0" } @@ -4603,7 +4561,6 @@ "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=0.10.0" } @@ -4631,8 +4588,7 @@ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "dev": true, - "license": "ISC", - "peer": true + "license": "ISC" }, "node_modules/y18n": { "version": "5.0.8", @@ -4692,7 +4648,6 @@ "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=10" }, diff --git a/package.json b/package.json index 8f5aa040e..dd1a5f381 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "devDependencies": { "@typescript-eslint/parser": "^8.40.0", "concurrently": "^9.1.2", + "eslint": "^8", "eslint-plugin-import": "^2.29.1", "husky": "^9.1.7", "lint-staged": "^15.5.2",