Merge branch 'continuedev:main' into init-tool-policy-in-tools-definitions
This commit is contained in:
commit
582d2b5eeb
90 changed files with 2723 additions and 1314 deletions
2
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
2
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
|
|
@ -11,6 +11,8 @@ body:
|
|||
attributes:
|
||||
label: Before submitting your bug report
|
||||
options:
|
||||
- label: I've tried using the "Ask AI" feature on the [Continue docs site](https://docs.continue.dev/) to see if the docs have an answer
|
||||
required: false
|
||||
- label: I believe this is a bug. I'll try to join the [Continue Discord](https://discord.gg/NWtdYexhMs) for questions
|
||||
required: false
|
||||
- label: I'm not able to find an [open issue](https://github.com/continuedev/continue/issues?q=is%3Aopen+is%3Aissue) that reports the same bug
|
||||
|
|
|
|||
204
.github/workflows/build-vscode-extension.yml
vendored
Normal file
204
.github/workflows/build-vscode-extension.yml
vendored
Normal file
|
|
@ -0,0 +1,204 @@
|
|||
name: Build VS Code Extension
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
platforms:
|
||||
description: "JSON array of platform configurations (defaults to all platforms)"
|
||||
required: false
|
||||
type: string
|
||||
default: |
|
||||
[
|
||||
{
|
||||
"os": "windows-latest",
|
||||
"platform": "win32",
|
||||
"arch": "x64",
|
||||
"npm_config_arch": "x64"
|
||||
},
|
||||
{
|
||||
"os": "windows-latest",
|
||||
"platform": "win32",
|
||||
"arch": "arm64",
|
||||
"npm_config_arch": "arm"
|
||||
},
|
||||
{
|
||||
"os": "ubuntu-latest",
|
||||
"platform": "linux",
|
||||
"arch": "x64",
|
||||
"npm_config_arch": "x64"
|
||||
},
|
||||
{
|
||||
"os": "ubuntu-latest",
|
||||
"platform": "linux",
|
||||
"arch": "arm64",
|
||||
"npm_config_arch": "arm64"
|
||||
},
|
||||
{
|
||||
"os": "ubuntu-latest",
|
||||
"platform": "linux",
|
||||
"arch": "armhf",
|
||||
"npm_config_arch": "arm"
|
||||
},
|
||||
{
|
||||
"os": "ubuntu-latest",
|
||||
"platform": "alpine",
|
||||
"arch": "x64",
|
||||
"npm_config_arch": "x64"
|
||||
},
|
||||
{
|
||||
"os": "macos-13",
|
||||
"platform": "darwin",
|
||||
"arch": "x64",
|
||||
"npm_config_arch": "x64"
|
||||
},
|
||||
{
|
||||
"os": "macos-13",
|
||||
"platform": "darwin",
|
||||
"arch": "arm64",
|
||||
"npm_config_arch": "arm64"
|
||||
}
|
||||
]
|
||||
pre-release:
|
||||
description: "Whether to build as pre-release"
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
commit-sha:
|
||||
description: "Commit SHA for version modification (optional, uses first 7 chars)"
|
||||
required: false
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
matrix:
|
||||
include: ${{ fromJson(inputs.platforms) }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
# 1. Check-out repository
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0 # This ensures all tags are fetched
|
||||
|
||||
# 2. Install npm dependencies
|
||||
- name: Use Node.js from .nvmrc
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
|
||||
- name: Cache extension node_modules
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: extensions/vscode/node_modules
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('extensions/vscode/package-lock.json') }}
|
||||
|
||||
- name: Cache core node_modules
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: core/node_modules
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('core/package-lock.json') }}
|
||||
|
||||
- name: Cache gui node_modules
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: gui/node_modules
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('gui/package-lock.json') }}
|
||||
|
||||
# Build all packages using the authoritative build script
|
||||
- name: Build packages (Windows)
|
||||
run: ./scripts/build-packages.ps1
|
||||
if: matrix.os == 'windows-latest'
|
||||
|
||||
- name: Build packages (Linux/macOS)
|
||||
run: ./scripts/build-packages.sh
|
||||
if: matrix.os != 'windows-latest'
|
||||
|
||||
- name: Install extension Dependencies
|
||||
run: |
|
||||
cd extensions/vscode
|
||||
npm ci
|
||||
env:
|
||||
# https://github.com/microsoft/vscode-ripgrep/issues/9#issuecomment-643965333
|
||||
GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }}
|
||||
|
||||
- name: Install gui Dependencies
|
||||
run: |
|
||||
cd gui
|
||||
npm ci
|
||||
|
||||
# npm ci doesn't end up capturing the @lancedb/... dep because it's not in the package-lock.json
|
||||
- name: Install Core Dependencies
|
||||
run: |
|
||||
cd core
|
||||
npm ci
|
||||
npm i vectordb
|
||||
|
||||
# 2.5. Pre package
|
||||
- name: Set var for environment info
|
||||
shell: pwsh
|
||||
run: echo "target=${{ matrix.platform }}-${{ matrix.arch }}" >> $env:GITHUB_ENV
|
||||
|
||||
- name: Prepackage the extension
|
||||
run: |
|
||||
cd extensions/vscode
|
||||
npm run prepackage -- --target ${{ env.target }}
|
||||
|
||||
# 3. Re-install esbuild (for cases that we force installed for another arch in prepackage.js)
|
||||
- name: Re-install esbuild
|
||||
run: |
|
||||
cd extensions/vscode
|
||||
npm install -f esbuild
|
||||
|
||||
# 3.5. Modify version with commit SHA
|
||||
- name: Modify package.json version with commit SHA
|
||||
if: inputs.commit-sha != ''
|
||||
run: |
|
||||
cd extensions/vscode
|
||||
# Get current version from package.json
|
||||
CURRENT_VERSION=$(node -p "require('./package.json').version")
|
||||
|
||||
# Create new version with short commit SHA (first 7 chars)
|
||||
COMMIT_SHORT="${{ inputs.commit-sha }}"
|
||||
NEW_VERSION="${CURRENT_VERSION}-${COMMIT_SHORT:0:7}"
|
||||
|
||||
echo "📝 Updating package.json version from $CURRENT_VERSION to $NEW_VERSION"
|
||||
|
||||
# Update version in package.json
|
||||
sed -i.bak "s/\"version\": \"$CURRENT_VERSION\"/\"version\": \"$NEW_VERSION\"/" package.json
|
||||
|
||||
# Remove backup file
|
||||
rm -f package.json.bak
|
||||
|
||||
# Verify the change
|
||||
echo "✅ New version: $(node -p "require('./package.json').version")"
|
||||
|
||||
# 4. Package the extension
|
||||
- name: Package extension (build artifacts)
|
||||
run: |
|
||||
cd extensions/vscode
|
||||
npm run package
|
||||
|
||||
- name: Package extension (.vsix files)
|
||||
run: |
|
||||
cd extensions/vscode
|
||||
if [ "${{ inputs.pre-release }}" = "true" ]; then
|
||||
npx vsce package --pre-release --no-dependencies --target ${{ env.target }}
|
||||
else
|
||||
npx vsce package --no-dependencies --target ${{ env.target }}
|
||||
fi
|
||||
shell: bash
|
||||
|
||||
# 5. Upload build artifacts (for e2e tests)
|
||||
- name: Upload build artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: vscode-extension-build-${{ runner.os }}
|
||||
path: extensions/vscode/build
|
||||
|
||||
# 6. Upload .vsix artifacts (for releases and downloading)
|
||||
- name: Upload .vsix artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ env.target }}-vsix
|
||||
path: "extensions/vscode/*.vsix"
|
||||
30
.github/workflows/main-build.yaml
vendored
Normal file
30
.github/workflows/main-build.yaml
vendored
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
name: Build Extension on Main
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build:
|
||||
uses: ./.github/workflows/build-vscode-extension.yml
|
||||
with:
|
||||
# Build only for macOS latest and Ubuntu latest
|
||||
platforms: |
|
||||
[
|
||||
{
|
||||
"os": "ubuntu-latest",
|
||||
"platform": "linux",
|
||||
"arch": "x64",
|
||||
"npm_config_arch": "x64"
|
||||
},
|
||||
{
|
||||
"os": "macos-latest",
|
||||
"platform": "darwin",
|
||||
"arch": "arm64",
|
||||
"npm_config_arch": "arm64"
|
||||
}
|
||||
]
|
||||
pre-release: false
|
||||
commit-sha: ${{ github.sha }}
|
||||
secrets: inherit
|
||||
146
.github/workflows/main.yaml
vendored
146
.github/workflows/main.yaml
vendored
|
|
@ -29,44 +29,15 @@ jobs:
|
|||
build:
|
||||
needs: check_release_name
|
||||
if: needs.check_release_name.outputs.should_run == 'true' || github.event_name == 'workflow_dispatch'
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- os: windows-latest
|
||||
platform: win32
|
||||
arch: x64
|
||||
npm_config_arch: x64
|
||||
- os: windows-latest
|
||||
platform: win32
|
||||
arch: arm64
|
||||
npm_config_arch: arm
|
||||
- os: ubuntu-latest
|
||||
platform: linux
|
||||
arch: x64
|
||||
npm_config_arch: x64
|
||||
- os: ubuntu-latest
|
||||
platform: linux
|
||||
arch: arm64
|
||||
npm_config_arch: arm64
|
||||
- os: ubuntu-latest
|
||||
platform: linux
|
||||
arch: armhf
|
||||
npm_config_arch: arm
|
||||
- os: ubuntu-latest
|
||||
platform: alpine
|
||||
arch: x64
|
||||
npm_config_arch: x64
|
||||
- os: macos-13
|
||||
platform: darwin
|
||||
arch: x64
|
||||
npm_config_arch: x64
|
||||
- os: macos-13
|
||||
platform: darwin
|
||||
arch: arm64
|
||||
npm_config_arch: arm64
|
||||
runs-on: ${{ matrix.os }}
|
||||
uses: ./.github/workflows/build-vscode-extension.yml
|
||||
with:
|
||||
# Uses default platforms (all supported platforms)
|
||||
pre-release: false
|
||||
secrets: inherit
|
||||
|
||||
check-version:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# 1. Check-out repository
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
|
|
@ -80,107 +51,6 @@ jobs:
|
|||
cd extensions/vscode
|
||||
node scripts/versionCheck.js
|
||||
|
||||
# 2. Install npm dependencies
|
||||
- name: Use Node.js from .nvmrc
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
|
||||
- name: Cache extension node_modules
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: extensions/vscode/node_modules
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('extensions/vscode/package-lock.json') }}
|
||||
|
||||
- name: Cache core node_modules
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: core/node_modules
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('core/package-lock.json') }}
|
||||
|
||||
- name: Cache gui node_modules
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: gui/node_modules
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('gui/package-lock.json') }}
|
||||
|
||||
- name: Build packages (Windows)
|
||||
run: ./scripts/build-packages.ps1
|
||||
if: matrix.os == 'windows-latest'
|
||||
|
||||
- name: Build packages (Unix)
|
||||
run: ./scripts/build-packages.sh
|
||||
if: matrix.os != 'windows-latest'
|
||||
|
||||
- name: Install extension Dependencies
|
||||
run: |
|
||||
cd extensions/vscode
|
||||
npm ci
|
||||
env:
|
||||
# https://github.com/microsoft/vscode-ripgrep/issues/9#issuecomment-643965333
|
||||
GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }}
|
||||
|
||||
- name: Install gui Dependencies
|
||||
run: |
|
||||
cd gui
|
||||
npm ci
|
||||
|
||||
# npm ci doesn't end up capturing the @lancedb/... dep because it's not in the package-lock.json
|
||||
- name: Install Core Dependencies
|
||||
run: |
|
||||
cd core
|
||||
npm ci
|
||||
npm i vectordb
|
||||
|
||||
# - name: Run core tests
|
||||
# run: |
|
||||
# cd core
|
||||
# npm run test
|
||||
# env:
|
||||
# OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
||||
|
||||
# 2.5. Pre package
|
||||
- name: Set var for environment info
|
||||
shell: pwsh
|
||||
run: echo "target=${{ matrix.platform }}-${{ matrix.arch }}" >> $env:GITHUB_ENV
|
||||
|
||||
- name: Prepackage the extension
|
||||
run: |
|
||||
cd extensions/vscode
|
||||
npm run prepackage -- --target ${{ env.target }}
|
||||
|
||||
# 3. Re-install esbuild (for cases that we force installed for another arch in prepackage.js)
|
||||
- name: Re-install esbuild
|
||||
run: |
|
||||
cd extensions/vscode
|
||||
npm install -f esbuild
|
||||
|
||||
# 4. Run tests for the extension
|
||||
# - name: Install Xvfb for Linux and run tests
|
||||
# run: |
|
||||
# sudo apt-get install -y xvfb # Install Xvfb
|
||||
# Xvfb :99 & # Start Xvfb
|
||||
# export DISPLAY=:99 # Export the display number to the environment
|
||||
# cd extensions/vscode
|
||||
# npm run test
|
||||
# if: matrix.os == 'ubuntu-latest'
|
||||
|
||||
# - name: Run extension tests
|
||||
# run: |
|
||||
# cd extensions/vscode
|
||||
# npm run test
|
||||
# if: matrix.os != 'ubuntu-latest'
|
||||
|
||||
# 5. Package the extension
|
||||
- name: Package the extension
|
||||
run: cd extensions/vscode && npx vsce package --no-dependencies --target ${{ env.target }}
|
||||
|
||||
# 6. Upload the .vsix as an artifact
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ env.target }}-vsix
|
||||
path: "extensions/vscode/*.vsix"
|
||||
|
||||
release:
|
||||
permissions:
|
||||
contents: write
|
||||
|
|
|
|||
537
.github/workflows/pr_checks.yaml
vendored
537
.github/workflows/pr_checks.yaml
vendored
|
|
@ -48,7 +48,7 @@ jobs:
|
|||
- name: Check code formatting with Prettier
|
||||
run: npx prettier --check "**/*.{js,jsx,ts,tsx,json,css,md}" --ignore-path .gitignore --ignore-path .prettierignore
|
||||
|
||||
install-config-yaml:
|
||||
build-packages:
|
||||
needs: install-root
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
|
@ -58,52 +58,11 @@ jobs:
|
|||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
|
||||
- uses: actions/cache@v4
|
||||
with:
|
||||
path: node_modules
|
||||
key: ${{ runner.os }}-root-node-modules-${{ hashFiles('package-lock.json') }}
|
||||
|
||||
- uses: actions/cache@v4
|
||||
id: config-yaml-cache
|
||||
with:
|
||||
path: packages/config-yaml/node_modules
|
||||
key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }}
|
||||
|
||||
- name: Install config-yaml dependencies
|
||||
if: steps.config-yaml-cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
cd packages/config-yaml
|
||||
npm ci
|
||||
|
||||
install-openai-adapters:
|
||||
needs: install-root
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
|
||||
- uses: actions/cache@v4
|
||||
with:
|
||||
path: node_modules
|
||||
key: ${{ runner.os }}-root-node-modules-${{ hashFiles('package-lock.json') }}
|
||||
|
||||
- uses: actions/cache@v4
|
||||
id: openai-adapters-cache
|
||||
with:
|
||||
path: packages/openai-adapters/node_modules
|
||||
key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }}
|
||||
|
||||
- name: Install openai-adapters dependencies
|
||||
if: steps.openai-adapters-cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
cd packages/openai-adapters
|
||||
npm ci
|
||||
- name: Build packages (Unix)
|
||||
run: ./scripts/build-packages.sh
|
||||
|
||||
config-yaml-checks:
|
||||
needs: install-config-yaml
|
||||
needs: build-packages
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
|
@ -117,23 +76,20 @@ jobs:
|
|||
path: node_modules
|
||||
key: ${{ runner.os }}-root-node-modules-${{ hashFiles('package-lock.json') }}
|
||||
|
||||
- uses: actions/cache@v4
|
||||
id: config-yaml-cache
|
||||
with:
|
||||
path: packages/config-yaml/node_modules
|
||||
key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }}
|
||||
|
||||
- name: Build and check config-yaml
|
||||
- name: Build packages and check config-yaml
|
||||
run: |
|
||||
./scripts/build-packages.sh
|
||||
cd packages/config-yaml
|
||||
npx tsc --noEmit
|
||||
# Tests are currently failing, commenting out for now
|
||||
# npm test
|
||||
npm run build
|
||||
# npm test
|
||||
|
||||
install-core:
|
||||
needs: install-root
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
|
|
@ -160,7 +116,7 @@ jobs:
|
|||
npm ci
|
||||
|
||||
core-checks:
|
||||
needs: [install-core, install-config-yaml, install-openai-adapters]
|
||||
needs: install-core
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
|
@ -170,38 +126,21 @@ jobs:
|
|||
node-version-file: ".nvmrc"
|
||||
|
||||
- uses: actions/cache@v4
|
||||
id: root-cache
|
||||
with:
|
||||
path: node_modules
|
||||
key: ${{ runner.os }}-root-node-modules-${{ hashFiles('package-lock.json') }}
|
||||
|
||||
- uses: actions/cache@v4
|
||||
id: core-cache
|
||||
with:
|
||||
path: core/node_modules
|
||||
key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }}
|
||||
|
||||
- uses: actions/cache@v4
|
||||
id: config-yaml-cache
|
||||
with:
|
||||
path: packages/config-yaml/node_modules
|
||||
key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }}
|
||||
|
||||
- uses: actions/cache@v4
|
||||
id: openai-adapters-cache
|
||||
with:
|
||||
path: packages/openai-adapters/node_modules
|
||||
key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }}
|
||||
|
||||
- name: Build config-yaml
|
||||
- name: Build packages and install core dependencies
|
||||
run: |
|
||||
cd packages/config-yaml
|
||||
npm run build
|
||||
./scripts/build-packages.sh
|
||||
cd core
|
||||
npm ci
|
||||
|
||||
- name: Build openai-adapters
|
||||
run: |
|
||||
cd packages/openai-adapters
|
||||
npm run build
|
||||
- name: Type check and lint
|
||||
run: |
|
||||
cd core
|
||||
|
|
@ -211,8 +150,7 @@ jobs:
|
|||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
||||
|
||||
install-gui:
|
||||
needs:
|
||||
[install-root, install-core, install-config-yaml, install-openai-adapters]
|
||||
needs: [install-root, install-core]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
|
@ -237,33 +175,15 @@ jobs:
|
|||
path: gui/node_modules
|
||||
key: ${{ runner.os }}-gui-node-modules-${{ hashFiles('gui/package-lock.json') }}
|
||||
|
||||
- uses: actions/cache@v4
|
||||
id: config-yaml-cache
|
||||
with:
|
||||
path: packages/config-yaml/node_modules
|
||||
key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }}
|
||||
|
||||
- uses: actions/cache@v4
|
||||
id: openai-adapters-cache
|
||||
with:
|
||||
path: packages/openai-adapters/node_modules
|
||||
key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }}
|
||||
|
||||
- name: Build config-yaml
|
||||
- name: Build packages and install dependencies
|
||||
run: |
|
||||
cd packages/config-yaml
|
||||
npm run build
|
||||
|
||||
- name: Build openai-adapters
|
||||
run: |
|
||||
cd packages/openai-adapters
|
||||
npm run build
|
||||
|
||||
- name: Install gui dependencies
|
||||
if: steps.gui-cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
cd gui
|
||||
npm ci
|
||||
./scripts/build-packages.sh
|
||||
if [ "${{ steps.gui-cache.outputs.cache-hit }}" != "true" ]; then
|
||||
cd core
|
||||
npm ci
|
||||
cd ../gui
|
||||
npm ci
|
||||
fi
|
||||
|
||||
gui-checks:
|
||||
needs: install-gui
|
||||
|
|
@ -285,32 +205,17 @@ jobs:
|
|||
key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }}
|
||||
|
||||
- uses: actions/cache@v4
|
||||
id: gui-cache
|
||||
with:
|
||||
path: gui/node_modules
|
||||
key: ${{ runner.os }}-gui-node-modules-${{ hashFiles('gui/package-lock.json') }}
|
||||
|
||||
- uses: actions/cache@v4
|
||||
id: openai-adapters-cache
|
||||
with:
|
||||
path: packages/openai-adapters/node_modules
|
||||
key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }}
|
||||
|
||||
- uses: actions/cache@v4
|
||||
id: config-yaml-cache
|
||||
with:
|
||||
path: packages/config-yaml/node_modules
|
||||
key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }}
|
||||
|
||||
- name: Build config-yaml
|
||||
- name: Build packages and install dependencies
|
||||
run: |
|
||||
cd packages/config-yaml
|
||||
npm run build
|
||||
|
||||
- name: Build openai-adapters
|
||||
run: |
|
||||
cd packages/openai-adapters
|
||||
npm run build
|
||||
./scripts/build-packages.sh
|
||||
cd core
|
||||
npm ci
|
||||
cd ../gui
|
||||
npm ci
|
||||
|
||||
- name: Type check and lint
|
||||
run: |
|
||||
|
|
@ -319,8 +224,7 @@ jobs:
|
|||
npm run lint
|
||||
|
||||
binary-checks:
|
||||
needs:
|
||||
[install-root, install-core, install-config-yaml, install-openai-adapters]
|
||||
needs: [install-root, install-core]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
|
@ -345,33 +249,15 @@ jobs:
|
|||
path: binary/node_modules
|
||||
key: ${{ runner.os }}-binary-node-modules-${{ hashFiles('binary/package-lock.json') }}
|
||||
|
||||
- uses: actions/cache@v4
|
||||
id: config-yaml-cache
|
||||
with:
|
||||
path: packages/config-yaml/node_modules
|
||||
key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }}
|
||||
|
||||
- uses: actions/cache@v4
|
||||
id: openai-adapters-cache
|
||||
with:
|
||||
path: packages/openai-adapters/node_modules
|
||||
key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }}
|
||||
|
||||
- name: Build config-yaml
|
||||
- name: Build packages and install dependencies
|
||||
run: |
|
||||
cd packages/config-yaml
|
||||
npm run build
|
||||
|
||||
- name: Build openai-adapters
|
||||
run: |
|
||||
cd packages/openai-adapters
|
||||
npm run build
|
||||
|
||||
- name: Install binary dependencies
|
||||
if: steps.binary-cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
cd binary
|
||||
npm ci
|
||||
./scripts/build-packages.sh
|
||||
if [ "${{ steps.binary-cache.outputs.cache-hit }}" != "true" ]; then
|
||||
cd core
|
||||
npm ci
|
||||
cd ../binary
|
||||
npm ci
|
||||
fi
|
||||
|
||||
- name: Type check
|
||||
run: |
|
||||
|
|
@ -379,9 +265,11 @@ jobs:
|
|||
npx tsc --noEmit
|
||||
|
||||
install-vscode:
|
||||
needs:
|
||||
[install-root, install-core, install-config-yaml, install-openai-adapters]
|
||||
runs-on: ubuntu-latest
|
||||
needs: [install-root, install-core]
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
|
|
@ -405,33 +293,15 @@ jobs:
|
|||
path: extensions/vscode/node_modules
|
||||
key: ${{ runner.os }}-vscode-node-modules-${{ hashFiles('extensions/vscode/package-lock.json') }}
|
||||
|
||||
- uses: actions/cache@v4
|
||||
id: config-yaml-cache
|
||||
with:
|
||||
path: packages/config-yaml/node_modules
|
||||
key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }}
|
||||
|
||||
- uses: actions/cache@v4
|
||||
id: openai-adapters-cache
|
||||
with:
|
||||
path: packages/openai-adapters/node_modules
|
||||
key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }}
|
||||
|
||||
- name: Build config-yaml
|
||||
- name: Build packages and install dependencies
|
||||
run: |
|
||||
cd packages/config-yaml
|
||||
npm run build
|
||||
|
||||
- name: Build openai-adapters
|
||||
run: |
|
||||
cd packages/openai-adapters
|
||||
npm run build
|
||||
|
||||
- name: Install vscode dependencies
|
||||
if: steps.vscode-cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
cd extensions/vscode
|
||||
npm ci
|
||||
./scripts/build-packages.sh
|
||||
if [ "${{ steps.vscode-cache.outputs.cache-hit }}" != "true" ]; then
|
||||
cd core
|
||||
npm ci
|
||||
cd ../extensions/vscode
|
||||
npm ci
|
||||
fi
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }}
|
||||
|
||||
|
|
@ -461,27 +331,15 @@ jobs:
|
|||
path: extensions/vscode/node_modules
|
||||
key: ${{ runner.os }}-vscode-node-modules-${{ hashFiles('extensions/vscode/package-lock.json') }}
|
||||
|
||||
- uses: actions/cache@v4
|
||||
id: config-yaml-cache
|
||||
with:
|
||||
path: packages/config-yaml/node_modules
|
||||
key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }}
|
||||
|
||||
- uses: actions/cache@v4
|
||||
id: openai-adapters-cache
|
||||
with:
|
||||
path: packages/openai-adapters/node_modules
|
||||
key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }}
|
||||
|
||||
- name: Build config-yaml
|
||||
- name: Build packages and install dependencies
|
||||
run: |
|
||||
cd packages/config-yaml
|
||||
npm run build
|
||||
|
||||
- name: Build openai-adapters
|
||||
run: |
|
||||
cd packages/openai-adapters
|
||||
npm run build
|
||||
./scripts/build-packages.sh
|
||||
cd core
|
||||
npm ci
|
||||
cd ../extensions/vscode
|
||||
npm ci
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }}
|
||||
|
||||
- name: Type check and lint
|
||||
run: |
|
||||
|
|
@ -496,7 +354,7 @@ jobs:
|
|||
npm run vitest
|
||||
|
||||
core-tests:
|
||||
needs: [install-core, install-config-yaml, install-openai-adapters]
|
||||
needs: install-core
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
|
@ -510,27 +368,11 @@ jobs:
|
|||
path: core/node_modules
|
||||
key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }}
|
||||
|
||||
- uses: actions/cache@v4
|
||||
id: config-yaml-cache
|
||||
with:
|
||||
path: packages/config-yaml/node_modules
|
||||
key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }}
|
||||
|
||||
- uses: actions/cache@v4
|
||||
id: openai-adapters-cache
|
||||
with:
|
||||
path: packages/openai-adapters/node_modules
|
||||
key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }}
|
||||
|
||||
- name: Build config-yaml
|
||||
- name: Build packages and install core dependencies
|
||||
run: |
|
||||
cd packages/config-yaml
|
||||
npm run build
|
||||
|
||||
- name: Build openai-adapters
|
||||
run: |
|
||||
cd packages/openai-adapters
|
||||
npm run build
|
||||
./scripts/build-packages.sh
|
||||
cd core
|
||||
npm ci
|
||||
|
||||
- name: Run core tests
|
||||
run: |
|
||||
|
|
@ -557,23 +399,13 @@ jobs:
|
|||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
|
||||
- uses: actions/cache@v4
|
||||
with:
|
||||
path: core/node_modules
|
||||
key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
cd packages/config-yaml
|
||||
npm ci
|
||||
|
||||
- name: Run config-yaml tests
|
||||
- name: Build packages and run tests
|
||||
run: |
|
||||
./scripts/build-packages.sh
|
||||
cd packages/config-yaml
|
||||
npm test
|
||||
|
||||
openai-adapters-tests:
|
||||
needs: install-openai-adapters
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
|
@ -587,14 +419,9 @@ jobs:
|
|||
path: node_modules
|
||||
key: ${{ runner.os }}-root-node-modules-${{ hashFiles('package-lock.json') }}
|
||||
|
||||
- uses: actions/cache@v4
|
||||
id: openai-adapters-cache
|
||||
with:
|
||||
path: packages/openai-adapters/node_modules
|
||||
key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }}
|
||||
|
||||
- name: Run openai-adapters tests
|
||||
- name: Build packages and run tests
|
||||
run: |
|
||||
./scripts/build-packages.sh
|
||||
cd packages/openai-adapters
|
||||
npm test
|
||||
env:
|
||||
|
|
@ -611,7 +438,7 @@ jobs:
|
|||
|
||||
vscode-get-test-file-matrix:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [install-root, install-vscode, install-config-yaml]
|
||||
needs: [install-root, install-vscode]
|
||||
outputs:
|
||||
test_file_matrix: ${{ steps.vscode-get-test-file-matrix.outputs.test_file_matrix }}
|
||||
steps:
|
||||
|
|
@ -623,21 +450,13 @@ jobs:
|
|||
path: extensions/vscode/node_modules
|
||||
key: ${{ runner.os }}-vscode-node-modules-${{ hashFiles('extensions/vscode/package-lock.json') }}
|
||||
|
||||
- uses: actions/cache@v4
|
||||
id: config-yaml-cache
|
||||
with:
|
||||
path: packages/config-yaml/node_modules
|
||||
key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }}
|
||||
|
||||
- name: Build config-yaml
|
||||
run: |
|
||||
cd packages/config-yaml
|
||||
npm run build
|
||||
|
||||
- name: Get test files
|
||||
- name: Build packages and get test files
|
||||
id: vscode-get-test-file-matrix
|
||||
run: |
|
||||
cd extensions/vscode
|
||||
./scripts/build-packages.sh
|
||||
cd core
|
||||
npm ci
|
||||
cd ../extensions/vscode
|
||||
npm ci
|
||||
npm run e2e:compile
|
||||
if [[ "${{ github.event.pull_request.head.repo.fork }}" == "true" || "${{ github.actor }}" == "dependabot[bot]" ]]; then
|
||||
|
|
@ -659,75 +478,32 @@ jobs:
|
|||
echo "Test files: ${{ steps.vscode-get-test-file-matrix.outputs.test_file_matrix }}"
|
||||
|
||||
vscode-package-extension:
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
[
|
||||
install-vscode,
|
||||
install-core,
|
||||
install-config-yaml,
|
||||
install-openai-adapters,
|
||||
]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
|
||||
- uses: actions/cache@v4
|
||||
id: vscode-node-modules-cache
|
||||
with:
|
||||
path: extensions/vscode/node_modules
|
||||
key: ${{ runner.os }}-vscode-node-modules-${{ hashFiles('extensions/vscode/package-lock.json') }}
|
||||
|
||||
- uses: actions/cache@v4
|
||||
id: core-node-modules-cache
|
||||
with:
|
||||
path: core/node_modules
|
||||
key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }}
|
||||
|
||||
- uses: actions/cache@v4
|
||||
id: config-yaml-cache
|
||||
with:
|
||||
path: packages/config-yaml/node_modules
|
||||
key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }}
|
||||
|
||||
- uses: actions/cache@v4
|
||||
id: openai-adapters-cache
|
||||
with:
|
||||
path: packages/openai-adapters/node_modules
|
||||
key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }}
|
||||
|
||||
- name: Build config-yaml
|
||||
run: |
|
||||
cd packages/config-yaml
|
||||
npm run build
|
||||
|
||||
- name: Build openai-adapters
|
||||
run: |
|
||||
cd packages/openai-adapters
|
||||
npm run build
|
||||
|
||||
- name: Package extension
|
||||
run: |
|
||||
cd extensions/vscode
|
||||
npm run package
|
||||
|
||||
- name: Upload build artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: vscode-extension-build
|
||||
path: extensions/vscode/build
|
||||
needs: [install-vscode, install-core]
|
||||
uses: ./.github/workflows/build-vscode-extension.yml
|
||||
with:
|
||||
# Limited platforms for faster PR checks
|
||||
platforms: |
|
||||
[
|
||||
{
|
||||
"os": "ubuntu-latest",
|
||||
"platform": "linux",
|
||||
"arch": "x64",
|
||||
"npm_config_arch": "x64"
|
||||
},
|
||||
{
|
||||
"os": "macos-13",
|
||||
"platform": "darwin",
|
||||
"arch": "x64",
|
||||
"npm_config_arch": "x64"
|
||||
}
|
||||
]
|
||||
pre-release: false
|
||||
commit-sha: ${{ github.sha }}
|
||||
secrets: inherit
|
||||
|
||||
vscode-download-e2e-dependencies:
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
[
|
||||
install-vscode,
|
||||
install-core,
|
||||
install-config-yaml,
|
||||
install-openai-adapters,
|
||||
]
|
||||
needs: [install-vscode, install-core]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
|
|
@ -747,22 +523,15 @@ jobs:
|
|||
path: extensions/vscode/e2e/storage
|
||||
key: ${{ runner.os }}-vscode-storage-${{ hashFiles('extensions/vscode/package-lock.json') }}
|
||||
|
||||
- uses: actions/cache@v4
|
||||
id: config-yaml-cache
|
||||
with:
|
||||
path: packages/config-yaml/node_modules
|
||||
key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }}
|
||||
|
||||
- name: Build config-yaml
|
||||
- name: Build packages and download e2e dependencies
|
||||
run: |
|
||||
cd packages/config-yaml
|
||||
npm run build
|
||||
|
||||
- name: Download Dependencies
|
||||
if: steps.storage-cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
cd extensions/vscode
|
||||
npm run e2e:ci:download
|
||||
./scripts/build-packages.sh
|
||||
if [ "${{ steps.storage-cache.outputs.cache-hit }}" != "true" ]; then
|
||||
cd core
|
||||
npm ci
|
||||
cd ../extensions/vscode
|
||||
npm run e2e:ci:download
|
||||
fi
|
||||
|
||||
- name: Upload e2e dependencies
|
||||
uses: actions/upload-artifact@v4
|
||||
|
|
@ -779,8 +548,6 @@ jobs:
|
|||
vscode-package-extension,
|
||||
install-vscode,
|
||||
install-core,
|
||||
install-config-yaml,
|
||||
install-openai-adapters,
|
||||
]
|
||||
runs-on: ubuntu-latest
|
||||
# Tests requiring secrets need approval from maintainers
|
||||
|
|
@ -812,7 +579,7 @@ jobs:
|
|||
- name: Download build artifact
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: vscode-extension-build
|
||||
name: vscode-extension-build-Linux
|
||||
path: extensions/vscode/build
|
||||
|
||||
- name: Download e2e dependencies
|
||||
|
|
@ -821,27 +588,11 @@ jobs:
|
|||
name: vscode-e2e-dependencies
|
||||
path: extensions/vscode/e2e/storage
|
||||
|
||||
- uses: actions/cache@v4
|
||||
id: config-yaml-cache
|
||||
with:
|
||||
path: packages/config-yaml/node_modules
|
||||
key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }}
|
||||
|
||||
- uses: actions/cache@v4
|
||||
id: openai-adapters-cache
|
||||
with:
|
||||
path: packages/openai-adapters/node_modules
|
||||
key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }}
|
||||
|
||||
- name: Build config-yaml
|
||||
- name: Build packages and install core dependencies
|
||||
run: |
|
||||
cd packages/config-yaml
|
||||
npm run build
|
||||
|
||||
- name: Build openai-adapters
|
||||
run: |
|
||||
cd packages/openai-adapters
|
||||
npm run build
|
||||
./scripts/build-packages.sh
|
||||
cd core
|
||||
npm ci
|
||||
|
||||
- name: Fix VSCode binary permissions
|
||||
run: |
|
||||
|
|
@ -906,8 +657,7 @@ jobs:
|
|||
path: extensions/vscode/e2e.log
|
||||
|
||||
gui-tests:
|
||||
needs:
|
||||
[install-gui, install-core, install-config-yaml, install-openai-adapters]
|
||||
needs: [install-gui, install-core]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
|
@ -917,7 +667,6 @@ jobs:
|
|||
node-version-file: ".nvmrc"
|
||||
|
||||
- uses: actions/cache@v4
|
||||
id: gui-cache
|
||||
with:
|
||||
path: gui/node_modules
|
||||
key: ${{ runner.os }}-gui-node-modules-${{ hashFiles('gui/package-lock.json') }}
|
||||
|
|
@ -927,31 +676,13 @@ jobs:
|
|||
path: core/node_modules
|
||||
key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }}
|
||||
|
||||
- uses: actions/cache@v4
|
||||
id: config-yaml-cache
|
||||
with:
|
||||
path: packages/config-yaml/node_modules
|
||||
key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }}
|
||||
|
||||
- uses: actions/cache@v4
|
||||
id: openai-adapters-cache
|
||||
with:
|
||||
path: packages/openai-adapters/node_modules
|
||||
key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }}
|
||||
|
||||
- name: Build config-yaml
|
||||
- name: Build packages and install dependencies
|
||||
run: |
|
||||
cd packages/config-yaml
|
||||
npm run build
|
||||
|
||||
- name: Build openai-adapters
|
||||
run: |
|
||||
cd packages/openai-adapters
|
||||
npm run build
|
||||
|
||||
- name: Install GUI dependencies
|
||||
if: steps.gui-cache.outputs.cache-hit != 'true'
|
||||
run: cd gui && npm ci
|
||||
./scripts/build-packages.sh
|
||||
cd core
|
||||
npm ci
|
||||
cd ../gui
|
||||
npm ci
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }}
|
||||
|
||||
|
|
@ -961,8 +692,7 @@ jobs:
|
|||
npm test
|
||||
|
||||
jetbrains-tests:
|
||||
needs:
|
||||
[install-root, core-checks, install-config-yaml, install-openai-adapters]
|
||||
needs: [install-root, core-checks]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
|
@ -971,27 +701,11 @@ jobs:
|
|||
path: core/node_modules
|
||||
key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }}
|
||||
|
||||
- uses: actions/cache@v4
|
||||
id: config-yaml-cache
|
||||
with:
|
||||
path: packages/config-yaml/node_modules
|
||||
key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }}
|
||||
|
||||
- uses: actions/cache@v4
|
||||
id: openai-adapters-cache
|
||||
with:
|
||||
path: packages/openai-adapters/node_modules
|
||||
key: ${{ runner.os }}-openai-adapters-node-modules-${{ hashFiles('packages/openai-adapters/package-lock.json') }}
|
||||
|
||||
- name: Build config-yaml
|
||||
- name: Build packages and install core dependencies
|
||||
run: |
|
||||
cd packages/config-yaml
|
||||
npm run build
|
||||
|
||||
- name: Build openai-adapters
|
||||
run: |
|
||||
cd packages/openai-adapters
|
||||
npm run build
|
||||
./scripts/build-packages.sh
|
||||
cd core
|
||||
npm ci
|
||||
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v4.5.0
|
||||
|
|
@ -1106,8 +820,7 @@ jobs:
|
|||
- gui-tests
|
||||
- jetbrains-tests
|
||||
- config-yaml-checks
|
||||
- install-config-yaml
|
||||
- install-openai-adapters
|
||||
- build-packages
|
||||
- openai-adapters-tests
|
||||
|
||||
steps:
|
||||
|
|
|
|||
151
.github/workflows/preview.yaml
vendored
151
.github/workflows/preview.yaml
vendored
|
|
@ -29,152 +29,11 @@ jobs:
|
|||
build:
|
||||
needs: check_release_name
|
||||
if: needs.check_release_name.outputs.should_run == 'true' || github.event_name == 'workflow_dispatch'
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- os: windows-latest
|
||||
platform: win32
|
||||
arch: x64
|
||||
npm_config_arch: x64
|
||||
- os: windows-latest
|
||||
platform: win32
|
||||
arch: arm64
|
||||
npm_config_arch: arm
|
||||
- os: ubuntu-latest
|
||||
platform: linux
|
||||
arch: x64
|
||||
npm_config_arch: x64
|
||||
- os: ubuntu-latest
|
||||
platform: linux
|
||||
arch: arm64
|
||||
npm_config_arch: arm64
|
||||
- os: ubuntu-latest
|
||||
platform: linux
|
||||
arch: armhf
|
||||
npm_config_arch: arm
|
||||
- os: ubuntu-latest
|
||||
platform: alpine
|
||||
arch: x64
|
||||
npm_config_arch: x64
|
||||
- os: macos-13
|
||||
platform: darwin
|
||||
arch: x64
|
||||
npm_config_arch: x64
|
||||
- os: macos-13
|
||||
platform: darwin
|
||||
arch: arm64
|
||||
npm_config_arch: arm64
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
# 1. Check-out repository
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0 # This ensures all tags are fetched
|
||||
|
||||
- name: Checkout tag
|
||||
run: git checkout ${GITHUB_REF#refs/tags/}
|
||||
|
||||
# 2. Install npm dependencies
|
||||
- name: Use Node.js from .nvmrc
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
|
||||
- name: Cache extension node_modules
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: extensions/vscode/node_modules
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('extensions/vscode/package-lock.json') }}
|
||||
|
||||
- name: Cache core node_modules
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: core/node_modules
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('core/package-lock.json') }}
|
||||
|
||||
- name: Cache gui node_modules
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: gui/node_modules
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('gui/package-lock.json') }}
|
||||
|
||||
- name: Build packages (Windows)
|
||||
run: ./scripts/build-packages.ps1
|
||||
if: matrix.os == 'windows-latest'
|
||||
|
||||
- name: Build packages (Unix)
|
||||
run: ./scripts/build-packages.sh
|
||||
if: matrix.os != 'windows-latest'
|
||||
|
||||
- name: Install extension Dependencies
|
||||
run: |
|
||||
cd extensions/vscode
|
||||
npm ci
|
||||
env:
|
||||
# https://github.com/microsoft/vscode-ripgrep/issues/9#issuecomment-643965333
|
||||
GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }}
|
||||
|
||||
- name: Install gui Dependencies
|
||||
run: |
|
||||
cd gui
|
||||
npm ci
|
||||
|
||||
# npm ci doesn't end up capturing the @lancedb/... dep because it's not in the package-lock.json
|
||||
- name: Install Core Dependencies
|
||||
run: |
|
||||
cd core
|
||||
npm ci
|
||||
npm i vectordb
|
||||
|
||||
# - name: Run core tests
|
||||
# run: |
|
||||
# cd core
|
||||
# npm run test
|
||||
# env:
|
||||
# OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
||||
|
||||
# 2.5. Pre package
|
||||
- name: Set var for environment info
|
||||
shell: pwsh
|
||||
run: echo "target=${{ matrix.platform }}-${{ matrix.arch }}" >> $env:GITHUB_ENV
|
||||
|
||||
- name: Prepackage the extension
|
||||
run: |
|
||||
cd extensions/vscode
|
||||
npm run prepackage -- --target ${{ env.target }}
|
||||
|
||||
# 3. Re-install esbuild (for cases that we force installed for another arch in prepackage.js)
|
||||
- name: Re-install esbuild
|
||||
run: |
|
||||
cd extensions/vscode
|
||||
npm install -f esbuild
|
||||
|
||||
# 4. Run tests for the extension
|
||||
# - name: Install Xvfb for Linux and run tests
|
||||
# run: |
|
||||
# sudo apt-get install -y xvfb # Install Xvfb
|
||||
# Xvfb :99 & # Start Xvfb
|
||||
# export DISPLAY=:99 # Export the display number to the environment
|
||||
# cd extensions/vscode
|
||||
# npm run test
|
||||
# if: matrix.os == 'ubuntu-latest'
|
||||
|
||||
# - name: Run extension tests
|
||||
# run: |
|
||||
# cd extensions/vscode
|
||||
# npm run test
|
||||
# if: matrix.os != 'ubuntu-latest'
|
||||
|
||||
# 5. Package the extension
|
||||
- name: Package the extension
|
||||
run: cd extensions/vscode && npx vsce package --pre-release --no-dependencies --target ${{ env.target }}
|
||||
|
||||
# 6. Upload the .vsix as an artifact
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ env.target }}-vsix
|
||||
path: "extensions/vscode/*.vsix"
|
||||
uses: ./.github/workflows/build-vscode-extension.yml
|
||||
with:
|
||||
# Uses default platforms (all supported platforms)
|
||||
pre-release: true
|
||||
secrets: inherit
|
||||
|
||||
release:
|
||||
permissions:
|
||||
|
|
|
|||
2
.idea/gradle.xml
generated
2
.idea/gradle.xml
generated
|
|
@ -5,7 +5,7 @@
|
|||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$/extensions/intellij" />
|
||||
<option name="gradleJvm" value="homebrew-17" />
|
||||
<option name="gradleJvm" value="#JAVA_HOME" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$/extensions/intellij" />
|
||||
|
|
|
|||
6
.vscode/launch.json
vendored
6
.vscode/launch.json
vendored
|
|
@ -12,13 +12,13 @@
|
|||
"cwd": "${workspaceFolder}/extensions/vscode",
|
||||
"args": [
|
||||
// Pass a directory to manually test in
|
||||
"${workspaceFolder}/manual-testing-sandbox",
|
||||
"${workspaceFolder}/manual-testing-sandbox/test.js",
|
||||
"${workspaceFolder}/core",
|
||||
"${workspaceFolder}/package.json",
|
||||
"--extensionDevelopmentPath=${workspaceFolder}/extensions/vscode"
|
||||
],
|
||||
"pauseForSourceMap": false,
|
||||
"outFiles": ["${workspaceFolder}/extensions/vscode/out/extension.js"],
|
||||
"preLaunchTask": "vscode-extension:build",
|
||||
"preLaunchTask": "vscode-extension:build-with-packages",
|
||||
"env": {
|
||||
// "CONTROL_PLANE_ENV": "local",
|
||||
"CONTINUE_GLOBAL_DIR": "${workspaceFolder}/extensions/.continue-debug"
|
||||
|
|
|
|||
17
.vscode/tasks.json
vendored
17
.vscode/tasks.json
vendored
|
|
@ -223,6 +223,23 @@
|
|||
],
|
||||
"type": "shell",
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "build-packages",
|
||||
"type": "shell",
|
||||
"windows": { "command": "./scripts/build-packages.ps1" },
|
||||
"command": "./scripts/build-packages.sh",
|
||||
"problemMatcher": [],
|
||||
"presentation": {
|
||||
"reveal": "silent",
|
||||
"panel": "shared"
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "vscode-extension:build-with-packages",
|
||||
"dependsOn": ["build-packages", "vscode-extension:build"],
|
||||
"type": "shell",
|
||||
"problemMatcher": []
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -438,7 +438,7 @@ export class ConfigHandler {
|
|||
if (!this.currentProfile) {
|
||||
return {
|
||||
config: undefined,
|
||||
errors: [],
|
||||
errors: [{ message: "Current profile not found", fatal: true }],
|
||||
configLoadInterrupted: true,
|
||||
};
|
||||
}
|
||||
|
|
@ -494,7 +494,7 @@ export class ConfigHandler {
|
|||
if (!this.currentProfile) {
|
||||
return {
|
||||
config: undefined,
|
||||
errors: [],
|
||||
errors: [{ message: "Current profile not found", fatal: true }],
|
||||
configLoadInterrupted: true,
|
||||
};
|
||||
}
|
||||
|
|
@ -507,7 +507,7 @@ export class ConfigHandler {
|
|||
if (!this.currentProfile) {
|
||||
return {
|
||||
config: undefined,
|
||||
errors: [],
|
||||
errors: [{ message: "Current profile not found", fatal: true }],
|
||||
configLoadInterrupted: true,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1057,6 +1057,7 @@ declare global {
|
|||
numDiffs?: number;
|
||||
filepath?: string;
|
||||
fileContent?: string;
|
||||
originalFileContent?: string;
|
||||
}
|
||||
|
||||
export interface RangeInFileWithContents {
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ function convertYamlRuleToContinueRule(rule: Rule): RuleWithSource {
|
|||
globs: rule.globs,
|
||||
name: rule.name,
|
||||
ruleFile: rule.sourceFile,
|
||||
alwaysApply: rule.alwaysApply,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
1
core/index.d.ts
vendored
1
core/index.d.ts
vendored
|
|
@ -1366,6 +1366,7 @@ export interface ApplyState {
|
|||
numDiffs?: number;
|
||||
filepath?: string;
|
||||
fileContent?: string;
|
||||
originalFileContent?: string;
|
||||
toolCallId?: string;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
import path from "path";
|
||||
|
||||
import { shouldChunk } from "./chunk";
|
||||
import { Chunk, ChunkWithoutID } from "../../index.js";
|
||||
import { cleanupAsyncEncoders } from "../../llm/countTokens.js";
|
||||
import { chunkDocument, chunkDocumentWithoutId, shouldChunk } from "./chunk";
|
||||
|
||||
describe("shouldChunk", () => {
|
||||
test("should chunk a typescript file", () => {
|
||||
|
|
@ -28,6 +30,126 @@ describe("shouldChunk", () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe("chunkDocument", () => {
|
||||
afterAll(async () => {
|
||||
// Clean up the global async encoders to prevent Jest from hanging
|
||||
await cleanupAsyncEncoders();
|
||||
});
|
||||
|
||||
test("should return multiple chunks for large content with small maxChunkSize", async () => {
|
||||
const filepath = "/test/file.txt";
|
||||
const maxChunkSize = 10; // small limit
|
||||
const digest = "test-digest";
|
||||
|
||||
// Create content with multiple short lines - each line should fit within maxChunkSize
|
||||
const lines = ["short line", "another line", "third line"];
|
||||
const contents = lines.join("\n");
|
||||
|
||||
const chunks: Chunk[] = [];
|
||||
for await (const chunk of chunkDocument({
|
||||
filepath,
|
||||
contents,
|
||||
maxChunkSize,
|
||||
digest,
|
||||
})) {
|
||||
chunks.push(chunk);
|
||||
}
|
||||
|
||||
// Verify chunks have valid content
|
||||
chunks.forEach((chunk) => {
|
||||
expect(chunk.content.length).toBeGreaterThan(0);
|
||||
});
|
||||
});
|
||||
|
||||
test("should filter out chunks that exceed maxChunkSize in tokens", async () => {
|
||||
const filepath = "/test/large.txt";
|
||||
const maxChunkSize = 10; // small limit
|
||||
const digest = "test-digest-2";
|
||||
|
||||
const contents =
|
||||
"This is a much longer line with many words that will likely exceed the maxChunkSize token limit and should be filtered out by the chunkDocument function. This is a much longer line with many words that will likely exceed the maxChunkSize token limit and should be filtered out by the chunkDocument function.";
|
||||
|
||||
const chunks: Chunk[] = [];
|
||||
for await (const chunk of chunkDocument({
|
||||
filepath,
|
||||
contents,
|
||||
maxChunkSize,
|
||||
digest,
|
||||
})) {
|
||||
chunks.push(chunk);
|
||||
}
|
||||
|
||||
// Verify that no chunks were created since the content exceeds maxChunkSize
|
||||
chunks.forEach((chunk) => {
|
||||
expect(chunk.content.length).toBe(0);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("chunkDocumentWithoutId", () => {
|
||||
afterAll(async () => {
|
||||
await cleanupAsyncEncoders();
|
||||
});
|
||||
|
||||
test("should return no chunks for empty content", async () => {
|
||||
const contents = "";
|
||||
const chunks: ChunkWithoutID[] = [];
|
||||
for await (const chunk of chunkDocumentWithoutId(
|
||||
"file.txt",
|
||||
contents,
|
||||
100,
|
||||
)) {
|
||||
chunks.push(chunk);
|
||||
}
|
||||
expect(chunks).toHaveLength(0);
|
||||
});
|
||||
|
||||
test("should chunk text files", async () => {
|
||||
const contents = "Line 1\nLine 2\nLine 3";
|
||||
const chunks: ChunkWithoutID[] = [];
|
||||
for await (const chunk of chunkDocumentWithoutId(
|
||||
"file.txt",
|
||||
contents,
|
||||
100,
|
||||
)) {
|
||||
chunks.push(chunk);
|
||||
}
|
||||
expect(chunks.length).toBeGreaterThan(0);
|
||||
expect(chunks[0].content).toContain("Line 1");
|
||||
});
|
||||
|
||||
test("should chunk for code files", async () => {
|
||||
const contents = "function test() {\n return 42;\n}";
|
||||
const chunks: ChunkWithoutID[] = [];
|
||||
for await (const chunk of chunkDocumentWithoutId(
|
||||
"file.js",
|
||||
contents,
|
||||
100,
|
||||
)) {
|
||||
chunks.push(chunk);
|
||||
}
|
||||
expect(chunks.length).toBeGreaterThan(0);
|
||||
expect(chunks[0].content).toContain("function test");
|
||||
});
|
||||
|
||||
test("should chunk large content", async () => {
|
||||
const contents = Array(100).fill("short line").join("\n"); // Large content with many lines
|
||||
const maxChunkSize = 50;
|
||||
const chunks: ChunkWithoutID[] = [];
|
||||
for await (const chunk of chunkDocumentWithoutId(
|
||||
"file.txt",
|
||||
contents,
|
||||
maxChunkSize,
|
||||
)) {
|
||||
chunks.push(chunk);
|
||||
}
|
||||
expect(chunks.length).toBeGreaterThan(1); // Should create multiple chunks
|
||||
chunks.forEach((chunk) => {
|
||||
expect(chunk.content.length).toBeGreaterThan(0); // Each chunk should have content
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function generateString(length: number) {
|
||||
return "a".repeat(length);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ export type ChunkDocumentParam = {
|
|||
digest: string;
|
||||
};
|
||||
|
||||
async function* chunkDocumentWithoutId(
|
||||
export async function* chunkDocumentWithoutId(
|
||||
fileUri: string,
|
||||
contents: string,
|
||||
maxChunkSize: number,
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ export default {
|
|||
"ts-jest",
|
||||
{
|
||||
useESM: true,
|
||||
useIsolatedModules: true,
|
||||
isolatedModules: true,
|
||||
tsconfig: {
|
||||
experimentalDecorators: true,
|
||||
emitDecoratorMetadata: true,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
const DEFAULT_MAX_TOKENS = 4096;
|
||||
const DEFAULT_CONTEXT_LENGTH = 32_768;
|
||||
const DEFAULT_TEMPERATURE = 0.5;
|
||||
const DEFAULT_PRUNING_LENGTH = 128000;
|
||||
|
||||
const DEFAULT_ARGS = {
|
||||
maxTokens: DEFAULT_MAX_TOKENS,
|
||||
|
|
@ -24,5 +25,6 @@ export {
|
|||
DEFAULT_MAX_BATCH_SIZE,
|
||||
DEFAULT_MAX_CHUNK_SIZE,
|
||||
DEFAULT_MAX_TOKENS,
|
||||
DEFAULT_PRUNING_LENGTH,
|
||||
PROXY_URL,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
// Generated by continue
|
||||
import { ChatMessage, MessagePart, ToolCall } from "../index.js";
|
||||
import {
|
||||
cleanupAsyncEncoders,
|
||||
compileChatMessages,
|
||||
countTokens,
|
||||
countTokensAsync,
|
||||
|
|
@ -27,7 +28,12 @@ describe.skip("countTokens", () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe.skip("countTokensAsync", () => {
|
||||
describe("countTokensAsync", () => {
|
||||
afterAll(async () => {
|
||||
// Clean up the global async encoders to prevent Jest from hanging
|
||||
await cleanupAsyncEncoders();
|
||||
});
|
||||
|
||||
it("should count tokens asynchronously for a simple string", async () => {
|
||||
const content = "Hello world!";
|
||||
const tokenCount = await countTokensAsync(content, "gpt-4");
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ import {
|
|||
|
||||
import { renderChatMessage } from "../util/messageContent.js";
|
||||
import { AsyncEncoder, LlamaAsyncEncoder } from "./asyncEncoder.js";
|
||||
import { DEFAULT_PRUNING_LENGTH } from "./constants.js";
|
||||
import llamaTokenizer from "./llamaTokenizer.js";
|
||||
interface Encoding {
|
||||
encode: Tiktoken["encode"];
|
||||
|
|
@ -409,14 +410,14 @@ function pruneRawPromptFromTop(
|
|||
function compileChatMessages({
|
||||
modelName,
|
||||
msgs,
|
||||
contextLength,
|
||||
knownContextLength,
|
||||
maxTokens,
|
||||
supportsImages,
|
||||
tools,
|
||||
}: {
|
||||
modelName: string;
|
||||
msgs: ChatMessage[];
|
||||
contextLength: number;
|
||||
knownContextLength: number | undefined;
|
||||
maxTokens: number;
|
||||
supportsImages: boolean;
|
||||
tools?: Tool[];
|
||||
|
|
@ -465,6 +466,7 @@ function compileChatMessages({
|
|||
toolTokens = countToolsTokens(tools, modelName);
|
||||
}
|
||||
|
||||
const contextLength = knownContextLength ?? DEFAULT_PRUNING_LENGTH;
|
||||
const countingSafetyBuffer = getTokenCountingBufferSafety(contextLength);
|
||||
const minOutputTokens = Math.min(MIN_RESPONSE_TOKENS, maxTokens);
|
||||
|
||||
|
|
@ -480,12 +482,12 @@ function compileChatMessages({
|
|||
inputTokensAvailable -= lastMessagesTokens;
|
||||
|
||||
// Make sure there's enough context for the non-excludable items
|
||||
if (inputTokensAvailable < 0) {
|
||||
if (knownContextLength !== undefined && inputTokensAvailable < 0) {
|
||||
throw new Error(
|
||||
`Not enough context available to include the system message, last user message, and tools.
|
||||
There must be at least ${minOutputTokens} tokens remaining for output.
|
||||
Request had the following token counts:
|
||||
- contextLength: ${contextLength}
|
||||
- contextLength: ${knownContextLength}
|
||||
- counting safety buffer: ${countingSafetyBuffer}
|
||||
- tools: ~${toolTokens}
|
||||
- system message: ~${systemMsgTokens}
|
||||
|
|
@ -536,7 +538,14 @@ function compileChatMessages({
|
|||
};
|
||||
}
|
||||
|
||||
async function cleanupAsyncEncoders(): Promise<void> {
|
||||
try {
|
||||
await llamaAsyncEncoder.close();
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
export {
|
||||
cleanupAsyncEncoders,
|
||||
compileChatMessages,
|
||||
countTokens,
|
||||
countTokensAsync,
|
||||
|
|
|
|||
|
|
@ -145,7 +145,7 @@ export abstract class BaseLLM implements ILLM {
|
|||
baseChatSystemMessage?: string;
|
||||
basePlanSystemMessage?: string;
|
||||
baseAgentSystemMessage?: string;
|
||||
contextLength: number;
|
||||
_contextLength: number | undefined;
|
||||
maxStopWords?: number | undefined;
|
||||
completionOptions: CompletionOptions;
|
||||
requestOptions?: RequestOptions;
|
||||
|
|
@ -220,8 +220,7 @@ export abstract class BaseLLM implements ILLM {
|
|||
this.baseAgentSystemMessage = options.baseAgentSystemMessage;
|
||||
this.basePlanSystemMessage = options.basePlanSystemMessage;
|
||||
this.baseChatSystemMessage = options.baseChatSystemMessage;
|
||||
this.contextLength =
|
||||
options.contextLength ?? llmInfo?.contextLength ?? DEFAULT_CONTEXT_LENGTH;
|
||||
this._contextLength = options.contextLength ?? llmInfo?.contextLength;
|
||||
this.maxStopWords = options.maxStopWords ?? this.maxStopWords;
|
||||
this.completionOptions = {
|
||||
...options.completionOptions,
|
||||
|
|
@ -296,6 +295,10 @@ export abstract class BaseLLM implements ILLM {
|
|||
this.sourceFile = options.sourceFile;
|
||||
}
|
||||
|
||||
get contextLength() {
|
||||
return this._contextLength ?? DEFAULT_CONTEXT_LENGTH;
|
||||
}
|
||||
|
||||
getConfigurationStatus() {
|
||||
return LLMConfigurationStatuses.VALID;
|
||||
}
|
||||
|
|
@ -899,7 +902,7 @@ export abstract class BaseLLM implements ILLM {
|
|||
return compileChatMessages({
|
||||
modelName: completionOptions.model,
|
||||
msgs: message,
|
||||
contextLength: this.contextLength,
|
||||
knownContextLength: this._contextLength,
|
||||
maxTokens: completionOptions.maxTokens ?? DEFAULT_MAX_TOKENS,
|
||||
supportsImages: this.supportsImages(),
|
||||
tools: options.tools,
|
||||
|
|
@ -948,7 +951,7 @@ export abstract class BaseLLM implements ILLM {
|
|||
const { compiledChatMessages } = compileChatMessages({
|
||||
modelName: completionOptions.model,
|
||||
msgs: _messages,
|
||||
contextLength: this.contextLength,
|
||||
knownContextLength: this._contextLength,
|
||||
maxTokens: completionOptions.maxTokens ?? DEFAULT_MAX_TOKENS,
|
||||
supportsImages: this.supportsImages(),
|
||||
tools: options.tools,
|
||||
|
|
|
|||
|
|
@ -172,52 +172,10 @@ class Anthropic extends BaseLLM {
|
|||
}
|
||||
}
|
||||
|
||||
protected async *_streamChat(
|
||||
messages: ChatMessage[],
|
||||
signal: AbortSignal,
|
||||
options: CompletionOptions,
|
||||
async *handleResponse(
|
||||
response: any,
|
||||
stream: boolean | undefined,
|
||||
): AsyncGenerator<ChatMessage> {
|
||||
if (!this.apiKey || this.apiKey === "") {
|
||||
throw new Error(
|
||||
"Request not sent. You have an Anthropic model configured in your config.json, but the API key is not set.",
|
||||
);
|
||||
}
|
||||
|
||||
const systemMessage = stripImages(
|
||||
messages.filter((m) => m.role === "system")[0]?.content ?? "",
|
||||
);
|
||||
const shouldCacheSystemMessage = !!(
|
||||
this.cacheBehavior?.cacheSystemMessage && systemMessage
|
||||
);
|
||||
|
||||
const msgs = this.convertMessages(messages);
|
||||
const response = await this.fetch(new URL("messages", this.apiBase), {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
Accept: "application/json",
|
||||
"anthropic-version": "2023-06-01",
|
||||
"x-api-key": this.apiKey as string,
|
||||
...(shouldCacheSystemMessage || this.cacheBehavior?.cacheConversation
|
||||
? { "anthropic-beta": "prompt-caching-2024-07-31" }
|
||||
: {}),
|
||||
},
|
||||
body: JSON.stringify({
|
||||
...this.convertArgs(options),
|
||||
messages: msgs,
|
||||
system: shouldCacheSystemMessage
|
||||
? [
|
||||
{
|
||||
type: "text",
|
||||
text: systemMessage,
|
||||
cache_control: { type: "ephemeral" },
|
||||
},
|
||||
]
|
||||
: systemMessage,
|
||||
}),
|
||||
signal,
|
||||
});
|
||||
|
||||
if (response.status === 499) {
|
||||
return; // Aborted by user
|
||||
}
|
||||
|
|
@ -237,7 +195,7 @@ class Anthropic extends BaseLLM {
|
|||
);
|
||||
}
|
||||
|
||||
if (options.stream === false) {
|
||||
if (stream === false) {
|
||||
const data = await response.json();
|
||||
const cost = data.usage
|
||||
? {
|
||||
|
|
@ -348,6 +306,55 @@ class Anthropic extends BaseLLM {
|
|||
usage,
|
||||
};
|
||||
}
|
||||
|
||||
protected async *_streamChat(
|
||||
messages: ChatMessage[],
|
||||
signal: AbortSignal,
|
||||
options: CompletionOptions,
|
||||
): AsyncGenerator<ChatMessage> {
|
||||
if (!this.apiKey || this.apiKey === "") {
|
||||
throw new Error(
|
||||
"Request not sent. You have an Anthropic model configured in your config.json, but the API key is not set.",
|
||||
);
|
||||
}
|
||||
|
||||
const systemMessage = stripImages(
|
||||
messages.filter((m) => m.role === "system")[0]?.content ?? "",
|
||||
);
|
||||
const shouldCacheSystemMessage = !!(
|
||||
this.cacheBehavior?.cacheSystemMessage && systemMessage
|
||||
);
|
||||
|
||||
const msgs = this.convertMessages(messages);
|
||||
const response = await this.fetch(new URL("messages", this.apiBase), {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
Accept: "application/json",
|
||||
"anthropic-version": "2023-06-01",
|
||||
"x-api-key": this.apiKey as string,
|
||||
...(shouldCacheSystemMessage || this.cacheBehavior?.cacheConversation
|
||||
? { "anthropic-beta": "prompt-caching-2024-07-31" }
|
||||
: {}),
|
||||
},
|
||||
body: JSON.stringify({
|
||||
...this.convertArgs(options),
|
||||
messages: msgs,
|
||||
system: shouldCacheSystemMessage
|
||||
? [
|
||||
{
|
||||
type: "text",
|
||||
text: systemMessage,
|
||||
cache_control: { type: "ephemeral" },
|
||||
},
|
||||
]
|
||||
: systemMessage,
|
||||
}),
|
||||
signal,
|
||||
});
|
||||
|
||||
yield* this.handleResponse(response, options.stream);
|
||||
}
|
||||
}
|
||||
|
||||
export default Anthropic;
|
||||
|
|
|
|||
|
|
@ -200,6 +200,7 @@ class Gemini extends BaseLLM {
|
|||
messages: ChatMessage[],
|
||||
options: CompletionOptions,
|
||||
isV1API: boolean,
|
||||
includeToolIds: boolean,
|
||||
): GeminiChatRequestBody {
|
||||
const toolCallIdToNameMap = new Map<string, string>();
|
||||
messages.forEach((msg) => {
|
||||
|
|
@ -231,7 +232,7 @@ class Gemini extends BaseLLM {
|
|||
parts: [
|
||||
{
|
||||
functionResponse: {
|
||||
id: msg.toolCallId,
|
||||
id: includeToolIds ? msg.toolCallId : undefined,
|
||||
name: functionName || "unknown",
|
||||
response: {
|
||||
output: msg.content, // "output" key is opinionated - not all functions will output objects
|
||||
|
|
@ -406,7 +407,7 @@ class Gemini extends BaseLLM {
|
|||
const isV1API = !!this.apiBase?.includes("/v1/");
|
||||
|
||||
// Convert chat messages to contents
|
||||
const body = this.prepareBody(messages, options, isV1API);
|
||||
const body = this.prepareBody(messages, options, isV1API, true);
|
||||
|
||||
const response = await this.fetch(apiURL, {
|
||||
method: "POST",
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ class HuggingFaceTGI extends BaseLLM {
|
|||
}
|
||||
const json = await response.json();
|
||||
this.model = json.model_id;
|
||||
this.contextLength = Number.parseInt(json.max_input_length);
|
||||
this._contextLength = Number.parseInt(json.max_input_length);
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log(`Failed to list models for HuggingFace TGI: ${e.message}`);
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ class Mistral extends OpenAI {
|
|||
return Mistral.modelConversion[model] ?? model;
|
||||
}
|
||||
|
||||
protected _convertArgs(options: any, messages: ChatMessage[]) {
|
||||
_convertArgs(options: any, messages: ChatMessage[]) {
|
||||
const finalOptions = super._convertArgs(options, messages);
|
||||
|
||||
const lastMessage = finalOptions.messages[finalOptions.messages.length - 1];
|
||||
|
|
|
|||
|
|
@ -184,7 +184,7 @@ class Ollama extends BaseLLM implements ModelInstaller {
|
|||
let value = parts[2];
|
||||
switch (key) {
|
||||
case "num_ctx":
|
||||
this.contextLength =
|
||||
this._contextLength =
|
||||
options.contextLength ?? Number.parseInt(value);
|
||||
break;
|
||||
case "stop":
|
||||
|
|
|
|||
|
|
@ -254,24 +254,7 @@ class VertexAI extends BaseLLM {
|
|||
signal,
|
||||
});
|
||||
|
||||
if (response.status === 499) {
|
||||
return; // Aborted by user
|
||||
}
|
||||
|
||||
if (options.stream === false) {
|
||||
const data = await response.json();
|
||||
yield { role: "assistant", content: data.content[0].text };
|
||||
return;
|
||||
}
|
||||
|
||||
for await (const value of streamSse(response)) {
|
||||
if (value.type === "message_start") {
|
||||
console.log(value);
|
||||
}
|
||||
if (value.delta?.text) {
|
||||
yield { role: "assistant", content: value.delta.text };
|
||||
}
|
||||
}
|
||||
yield* this.anthropicInstance.handleResponse(response, options.stream);
|
||||
}
|
||||
|
||||
// Gemini
|
||||
|
|
@ -285,17 +268,19 @@ class VertexAI extends BaseLLM {
|
|||
this.apiBase,
|
||||
);
|
||||
|
||||
const body = this.geminiInstance.prepareBody(messages, options, false);
|
||||
// For some reason gemini through vertex does not support ids in functionResponses yet
|
||||
const body = this.geminiInstance.prepareBody(
|
||||
messages,
|
||||
options,
|
||||
false,
|
||||
false,
|
||||
);
|
||||
const response = await this.fetch(apiURL, {
|
||||
method: "POST",
|
||||
body: JSON.stringify(body),
|
||||
signal,
|
||||
});
|
||||
for await (const message of this.geminiInstance.processGeminiResponse(
|
||||
streamResponse(response),
|
||||
)) {
|
||||
yield message;
|
||||
}
|
||||
yield* this.geminiInstance.processGeminiResponse(streamResponse(response));
|
||||
}
|
||||
|
||||
private async *streamChatBison(
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ class Vllm extends OpenAI {
|
|||
const json = await response.json();
|
||||
const data = json.data[0];
|
||||
this.model = data.id;
|
||||
this.contextLength = Number.parseInt(data.max_model_len);
|
||||
this._contextLength = Number.parseInt(data.max_model_len);
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log(`Failed to list models for vLLM: ${e.message}`);
|
||||
|
|
|
|||
|
|
@ -83,11 +83,12 @@ export const PROVIDER_TOOL_SUPPORT: Record<string, (model: string) => boolean> =
|
|||
return model.toLowerCase().includes("gemini");
|
||||
},
|
||||
vertexai: (model) => {
|
||||
const lowerCaseModel = model.toLowerCase();
|
||||
// All gemini models except flash 2.0 lite support function calling
|
||||
return (
|
||||
model.toLowerCase().includes("gemini") &&
|
||||
!model.toLowerCase().includes("lite")
|
||||
);
|
||||
if (lowerCaseModel.includes("lite")) {
|
||||
return false;
|
||||
}
|
||||
return ["claude", "gemini"].some((val) => lowerCaseModel.includes(val));
|
||||
},
|
||||
bedrock: (model) => {
|
||||
if (
|
||||
|
|
|
|||
|
|
@ -450,8 +450,9 @@ describe("Retry Functionality", () => {
|
|||
|
||||
expect(result).toBe("success");
|
||||
// Should be capped at maxDelay (200ms) not header value (10000ms)
|
||||
expect(delays[0]).toBeGreaterThan(190);
|
||||
expect(delays[0]).toBeLessThan(210);
|
||||
// Jitter is applied before maxDelay cap, so delay should never exceed maxDelay
|
||||
expect(delays[0]).toBeGreaterThanOrEqual(190);
|
||||
expect(delays[0]).toBeLessThanOrEqual(200);
|
||||
});
|
||||
|
||||
it("should handle case-insensitive header names", async () => {
|
||||
|
|
|
|||
|
|
@ -149,10 +149,10 @@ function calculateDelay(
|
|||
delayMs = Number(retryAfter) * 1000;
|
||||
}
|
||||
|
||||
// Respect maxDelay and add small jitter to spread requests
|
||||
const cappedDelay = Math.min(delayMs, maxDelay);
|
||||
// Apply small jitter to spread requests, then respect maxDelay as hard limit
|
||||
const jitterMultiplier = 1 + (Math.random() * 0.1 - 0.05); // Small jitter ±5%
|
||||
return Math.max(0, Math.floor(cappedDelay * jitterMultiplier));
|
||||
const jitteredDelay = delayMs * jitterMultiplier;
|
||||
return Math.max(0, Math.floor(Math.min(jitteredDelay, maxDelay)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
69
core/package-lock.json
generated
69
core/package-lock.json
generated
|
|
@ -14,8 +14,8 @@
|
|||
"@aws-sdk/credential-providers": "^3.778.0",
|
||||
"@continuedev/config-types": "^1.0.13",
|
||||
"@continuedev/config-yaml": "file:../packages/config-yaml",
|
||||
"@continuedev/fetch": "^1.0.14",
|
||||
"@continuedev/llm-info": "^1.0.8",
|
||||
"@continuedev/fetch": "file:../packages/fetch",
|
||||
"@continuedev/llm-info": "file:../packages/llm-info",
|
||||
"@continuedev/openai-adapters": "file:../packages/openai-adapters",
|
||||
"@modelcontextprotocol/sdk": "^1.12.0",
|
||||
"@mozilla/readability": "^0.5.0",
|
||||
|
|
@ -38,6 +38,7 @@
|
|||
"handlebars": "^4.7.8",
|
||||
"http-proxy-agent": "^7.0.1",
|
||||
"https-proxy-agent": "^7.0.3",
|
||||
"iconv-lite": "^0.6.3",
|
||||
"ignore": "^5.3.1",
|
||||
"is-localhost-ip": "^2.0.0",
|
||||
"jinja-js": "0.1.8",
|
||||
|
|
@ -145,7 +146,7 @@
|
|||
"version": "1.0.96",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@continuedev/config-types": "^1.0.14",
|
||||
"@continuedev/config-types": "file:../config-types",
|
||||
"yaml": "^2.6.1",
|
||||
"zod": "^3.24.2"
|
||||
},
|
||||
|
|
@ -167,17 +168,44 @@
|
|||
"zod-to-json-schema": "^3.24.5"
|
||||
}
|
||||
},
|
||||
"../packages/fetch": {
|
||||
"name": "@continuedev/fetch",
|
||||
"version": "1.0.15",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@continuedev/config-types": "file:../config-types",
|
||||
"follow-redirects": "^1.15.6",
|
||||
"http-proxy-agent": "^7.0.2",
|
||||
"https-proxy-agent": "^7.0.5",
|
||||
"node-fetch": "^3.3.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/follow-redirects": "^1.14.4",
|
||||
"typescript": "^5.0.0",
|
||||
"vitest": "^3.2.0"
|
||||
}
|
||||
},
|
||||
"../packages/llm-info": {
|
||||
"name": "@continuedev/llm-info",
|
||||
"version": "1.0.9",
|
||||
"license": "Apache-2.0",
|
||||
"devDependencies": {
|
||||
"@types/node": "^22.15.29",
|
||||
"typescript": "^5.5.2"
|
||||
}
|
||||
},
|
||||
"../packages/openai-adapters": {
|
||||
"name": "@continuedev/openai-adapters",
|
||||
"version": "1.0.45",
|
||||
"version": "1.0.46",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@aws-sdk/client-bedrock-runtime": "^3.842.0",
|
||||
"@aws-sdk/credential-providers": "^3.840.0",
|
||||
"@continuedev/config-types": "^1.0.5",
|
||||
"@continuedev/config-yaml": "^1.0.51",
|
||||
"@continuedev/fetch": "^1.0.15",
|
||||
"@continuedev/config-types": "file:../config-types",
|
||||
"@continuedev/config-yaml": "file:../config-yaml",
|
||||
"@continuedev/fetch": "file:../fetch",
|
||||
"dotenv": "^16.5.0",
|
||||
"google-auth-library": "^10.1.0",
|
||||
"json-schema": "^0.4.0",
|
||||
"node-fetch": "^3.3.2",
|
||||
"openai": "^4.104.0",
|
||||
|
|
@ -185,13 +213,20 @@
|
|||
"zod": "^3.24.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@semantic-release/changelog": "^6.0.3",
|
||||
"@semantic-release/commit-analyzer": "^13.0.1",
|
||||
"@semantic-release/git": "^10.0.1",
|
||||
"@semantic-release/github": "^11.0.3",
|
||||
"@semantic-release/npm": "^12.0.2",
|
||||
"@semantic-release/release-notes-generator": "^14.0.3",
|
||||
"@types/follow-redirects": "^1.14.4",
|
||||
"@types/jest": "^29.5.14",
|
||||
"@types/json-schema": "^7.0.15",
|
||||
"cross-env": "^7.0.3",
|
||||
"semantic-release": "^24.2.7",
|
||||
"ts-jest": "^29.2.3",
|
||||
"ts-node": "^10.9.2",
|
||||
"vitest": "^1.6.1"
|
||||
"vitest": "^3.2.4"
|
||||
}
|
||||
},
|
||||
"node_modules/@75lb/deep-merge": {
|
||||
|
|
@ -2918,22 +2953,12 @@
|
|||
"link": true
|
||||
},
|
||||
"node_modules/@continuedev/fetch": {
|
||||
"version": "1.0.14",
|
||||
"resolved": "https://registry.npmjs.org/@continuedev/fetch/-/fetch-1.0.14.tgz",
|
||||
"integrity": "sha512-r/CUwW0tt7VrjLVNeowA281aq7VQvToE+Ro9+0EhfINBMNre4eU2MbNOgbRmYCr5VkIuSnltPUDI357Kns7uCw==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@continuedev/config-types": "^1.0.5",
|
||||
"follow-redirects": "^1.15.6",
|
||||
"http-proxy-agent": "^7.0.2",
|
||||
"https-proxy-agent": "^7.0.5",
|
||||
"node-fetch": "^3.3.2"
|
||||
}
|
||||
"resolved": "../packages/fetch",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@continuedev/llm-info": {
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/@continuedev/llm-info/-/llm-info-1.0.8.tgz",
|
||||
"integrity": "sha512-/htL7p4li3zQSwn9bXkI23WRpZNklWTPzRSSG3Fd5gvYW8cizjhlf7OzeDdKxBfi1S0lpqMm0VwHlx3KjMKLpw=="
|
||||
"resolved": "../packages/llm-info",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@continuedev/openai-adapters": {
|
||||
"resolved": "../packages/openai-adapters",
|
||||
|
|
|
|||
|
|
@ -54,8 +54,8 @@
|
|||
"@aws-sdk/credential-providers": "^3.778.0",
|
||||
"@continuedev/config-types": "^1.0.13",
|
||||
"@continuedev/config-yaml": "file:../packages/config-yaml",
|
||||
"@continuedev/fetch": "^1.0.14",
|
||||
"@continuedev/llm-info": "^1.0.8",
|
||||
"@continuedev/fetch": "file:../packages/fetch",
|
||||
"@continuedev/llm-info": "file:../packages/llm-info",
|
||||
"@continuedev/openai-adapters": "file:../packages/openai-adapters",
|
||||
"@modelcontextprotocol/sdk": "^1.12.0",
|
||||
"@mozilla/readability": "^0.5.0",
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ describe.skip("generateRepoMap", () => {
|
|||
});
|
||||
|
||||
// Set testLLM properties
|
||||
testLLM.contextLength = 2048;
|
||||
testLLM._contextLength = 2048;
|
||||
testLLM.countTokens = jest.fn().mockReturnValue(10);
|
||||
|
||||
// Act
|
||||
|
|
@ -115,7 +115,7 @@ describe.skip("generateRepoMap", () => {
|
|||
});
|
||||
|
||||
// Set testLLM properties
|
||||
testLLM.contextLength = 2048;
|
||||
testLLM._contextLength = 2048;
|
||||
testLLM.countTokens = jest.fn().mockReturnValue(10);
|
||||
|
||||
// Act
|
||||
|
|
@ -184,7 +184,7 @@ describe.skip("generateRepoMap", () => {
|
|||
.mockImplementation(() => {});
|
||||
|
||||
// Set testLLM properties
|
||||
testLLM.contextLength = 2048;
|
||||
testLLM._contextLength = 2048;
|
||||
testLLM.countTokens = jest.fn().mockReturnValue(10);
|
||||
|
||||
// Act
|
||||
|
|
|
|||
|
|
@ -101,6 +101,15 @@ allow for changes to your `config.json` and other files during development, with
|
|||
|
||||
When using the `Run Continue` task, we automatically tail both prompt logs and IDE logs.
|
||||
|
||||
#### Viewing more IDE logs
|
||||
|
||||
You can selectively increase the log granularity (e.g., debug-level logs) as follows:
|
||||
|
||||
- Navigate to `Help | Diagnostic Tools | Debug Log Settings...`
|
||||
- Add a line in the format: `com.intellij.diagnostic:debug`
|
||||
|
||||
You can find more information about this feature in [official docs](https://youtrack.jetbrains.com/articles/SUPPORT-A-43/How-to-enable-debug-logging-in-IntelliJ-IDEA).
|
||||
|
||||
### Reloading changes
|
||||
|
||||
- `extensions/intellij`: Attempt to reload changed classes by selecting
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ pluginGroup=com.github.continuedev.continueintellijextension
|
|||
pluginName=continue-intellij-extension
|
||||
pluginRepositoryUrl=https://github.com/continuedev/continue
|
||||
# SemVer format -> https://semver.org
|
||||
pluginVersion=1.0.31
|
||||
pluginVersion=1.0.32
|
||||
# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
|
||||
pluginSinceBuild=223
|
||||
# IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import com.intellij.openapi.fileEditor.FileEditorManager
|
|||
class RestartContinueProcess : AnAction() {
|
||||
override fun actionPerformed(e: AnActionEvent) {
|
||||
val pluginService = getContinuePluginService(e.project) ?: return
|
||||
pluginService.coreMessengerManager?.restart()
|
||||
pluginService.coreMessengerManager?.coreMessenger?.restart()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -112,8 +112,10 @@ class ContinueAuthService {
|
|||
val jsonBody = gson.toJson(mapOf("refreshToken" to refreshToken))
|
||||
val url = getControlPlaneUrl() + "/auth/refresh"
|
||||
val response = HttpRequests.post(url, HttpRequests.JSON_CONTENT_TYPE)
|
||||
.connect { connection -> connection.write(jsonBody.toByteArray()) }
|
||||
.toString()
|
||||
.connect {
|
||||
connection -> connection.write(jsonBody.toByteArray())
|
||||
connection.readString()
|
||||
}
|
||||
return gson.fromJson(response, RefreshTokenResponse::class.java)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,6 +29,9 @@ class ApplyToFileHandler(
|
|||
private val diffStreamService: DiffStreamService
|
||||
) {
|
||||
|
||||
// Store the original file content before applying changes
|
||||
private val originalFileContent: String? = editorUtils?.getDocumentText()
|
||||
|
||||
suspend fun handleApplyToFile() {
|
||||
// Notify webview that we're starting to stream
|
||||
notifyStreamStarted()
|
||||
|
|
@ -111,6 +114,7 @@ class ApplyToFileHandler(
|
|||
numDiffs = numDiffs,
|
||||
filepath = params.filepath,
|
||||
fileContent = params.text,
|
||||
originalFileContent = originalFileContent,
|
||||
toolCallId = params.toolCallId.toString()
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -17,11 +17,11 @@ class CoreMessenger(
|
|||
private val project: Project,
|
||||
private val ideProtocolClient: IdeProtocolClient,
|
||||
val coroutineScope: CoroutineScope,
|
||||
private val onExit: () -> Unit
|
||||
private val onUnexpectedExit: () -> Unit
|
||||
) {
|
||||
private val gson = Gson()
|
||||
private val responseListeners = mutableMapOf<String, (Any?) -> Unit>()
|
||||
private val process = startContinueProcess()
|
||||
private var process = startContinueProcess()
|
||||
private val log = Logger.getInstance(CoreMessenger::class.java)
|
||||
|
||||
fun request(messageType: String, data: Any?, messageId: String?, onResponse: (Any?) -> Unit) {
|
||||
|
|
@ -36,7 +36,7 @@ class CoreMessenger(
|
|||
val process = if (isTcp)
|
||||
ContinueSocketProcess()
|
||||
else
|
||||
ContinueBinaryProcess(onExit)
|
||||
ContinueBinaryProcess(onUnexpectedExit)
|
||||
return ContinueProcessHandler(coroutineScope, process, ::handleMessage)
|
||||
}
|
||||
|
||||
|
|
@ -81,7 +81,15 @@ class CoreMessenger(
|
|||
null
|
||||
}
|
||||
|
||||
fun killSubProcess() {
|
||||
fun restart() {
|
||||
log.warn("Restarting Continue process")
|
||||
responseListeners.clear()
|
||||
process.close()
|
||||
process = startContinueProcess()
|
||||
}
|
||||
|
||||
fun close() {
|
||||
log.warn("Closing Continue process")
|
||||
process.close()
|
||||
}
|
||||
}
|
||||
|
|
@ -9,37 +9,34 @@ import com.intellij.openapi.project.Project
|
|||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlin.time.Duration.Companion.seconds
|
||||
|
||||
class CoreMessengerManager(
|
||||
private val project: Project,
|
||||
private val ideProtocolClient: IdeProtocolClient,
|
||||
project: Project,
|
||||
ideProtocolClient: IdeProtocolClient,
|
||||
private val coroutineScope: CoroutineScope
|
||||
) {
|
||||
var coreMessenger: CoreMessenger = createCoreMessenger()
|
||||
private var lastBackoffInterval = 0.5
|
||||
val coreMessenger = CoreMessenger(project, ideProtocolClient, coroutineScope, ::onUnexpectedExit)
|
||||
private var backoffIntervalSeconds = 1
|
||||
private val log = Logger.getInstance(CoreMessengerManager::class.java)
|
||||
|
||||
init {
|
||||
setupAnonymousTelemetry()
|
||||
}
|
||||
|
||||
fun restart() {
|
||||
private fun onUnexpectedExit() {
|
||||
coroutineScope.launch {
|
||||
try {
|
||||
coreMessenger.killSubProcess()
|
||||
lastBackoffInterval *= 2
|
||||
log.warn("Continue process exited, retrying in $lastBackoffInterval seconds")
|
||||
delay((lastBackoffInterval * 1000).toLong())
|
||||
coreMessenger = createCoreMessenger()
|
||||
delay(backoffIntervalSeconds.seconds)
|
||||
backoffIntervalSeconds *= 2
|
||||
log.warn("Continue process terminated externally, retrying in $backoffIntervalSeconds seconds")
|
||||
coreMessenger.restart()
|
||||
} catch (e: Exception) {
|
||||
service<TelemetryService>().capture("jetbrains_core_start_error", mapOf("error" to e))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun createCoreMessenger() =
|
||||
CoreMessenger(project, ideProtocolClient, coroutineScope, ::restart)
|
||||
|
||||
private fun setupAnonymousTelemetry() {
|
||||
coreMessenger.request("config/getSerializedProfileInfo", null, null) { response ->
|
||||
val allowAnonymousTelemetry =
|
||||
|
|
|
|||
|
|
@ -342,9 +342,10 @@ class IntelliJIDE(
|
|||
val buffer = ByteArray(sizeToRead)
|
||||
val bytesRead = fis.read(buffer, 0, sizeToRead)
|
||||
if (bytesRead <= 0) return@use ""
|
||||
String(buffer, 0, bytesRead, Charset.forName("UTF-8"))
|
||||
// `\r` takes up unnecessary tokens
|
||||
.lineSequence().joinToString("\n")
|
||||
val content = String(buffer, 0, bytesRead, Charset.forName("UTF-8"))
|
||||
// Remove `\r` characters but preserve trailing newlines to prevent line count discrepancies
|
||||
val contentWithoutCR = content.replace("\r\n", "\n").replace("\r", "\n")
|
||||
contentWithoutCR
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.github.continuedev.continueintellijextension.`continue`.process
|
||||
|
||||
import com.github.continuedev.continueintellijextension.proxy.ProxySettings
|
||||
import com.github.continuedev.continueintellijextension.error.ContinueErrorService
|
||||
import com.github.continuedev.continueintellijextension.services.TelemetryService
|
||||
import com.github.continuedev.continueintellijextension.utils.OS
|
||||
|
|
@ -15,7 +16,9 @@ import java.nio.file.Files
|
|||
import java.nio.file.Paths
|
||||
import java.nio.file.attribute.PosixFilePermission
|
||||
|
||||
class ContinueBinaryProcess(private val onExit: () -> Unit) : ContinueProcess {
|
||||
class ContinueBinaryProcess(
|
||||
private val onUnexpectedExit: () -> Unit
|
||||
) : ContinueProcess {
|
||||
|
||||
private val process = startBinaryProcess()
|
||||
override val input: InputStream = process.inputStream
|
||||
|
|
@ -29,11 +32,16 @@ class ContinueBinaryProcess(private val onExit: () -> Unit) : ContinueProcess {
|
|||
runBlocking(Dispatchers.IO) {
|
||||
setPermissions()
|
||||
}
|
||||
return ProcessBuilder(path).directory(File(path).parentFile)
|
||||
.start()
|
||||
.apply { onExit().thenRun(onExit).thenRun { reportErrorTelemetry() } }
|
||||
}
|
||||
|
||||
val builder = ProcessBuilder(path)
|
||||
val proxySettings = ProxySettings.getSettings()
|
||||
if (proxySettings.enabled)
|
||||
builder.environment() += "HTTP_PROXY" to proxySettings.proxy
|
||||
return builder
|
||||
.directory(File(path).parentFile)
|
||||
.start()
|
||||
.apply { onExit().thenRun(onUnexpectedExit).thenRun(::reportErrorTelemetry) }
|
||||
}
|
||||
|
||||
private fun reportErrorTelemetry() {
|
||||
var err = process.errorStream?.bufferedReader()?.readText()?.trim()
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.github.continuedev.continueintellijextension.`continue`.process
|
|||
|
||||
import com.github.continuedev.continueintellijextension.error.ContinueErrorService
|
||||
import com.intellij.openapi.components.service
|
||||
import com.intellij.openapi.diagnostic.Logger
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.channels.Channel
|
||||
import java.io.BufferedReader
|
||||
|
|
@ -19,6 +20,7 @@ class ContinueProcessHandler(
|
|||
private val pendingWrites = Channel<String>(Channel.UNLIMITED)
|
||||
private val writer = OutputStreamWriter(process.output)
|
||||
private val reader = BufferedReader(InputStreamReader(process.input))
|
||||
private val log = Logger.getInstance(ContinueProcessHandler::class.java)
|
||||
|
||||
init {
|
||||
scope.launch(Dispatchers.IO) {
|
||||
|
|
@ -27,6 +29,7 @@ class ContinueProcessHandler(
|
|||
val line = reader.readLine()
|
||||
if (line != null && line.isNotEmpty()) {
|
||||
try {
|
||||
log.debug("Handle: $line")
|
||||
handleMessage(line)
|
||||
} catch (e: Exception) {
|
||||
service<ContinueErrorService>().report(e, "Error handling message: $line")
|
||||
|
|
@ -40,6 +43,7 @@ class ContinueProcessHandler(
|
|||
}
|
||||
scope.launch(Dispatchers.IO) {
|
||||
for (message in pendingWrites) {
|
||||
log.debug("Write: $message")
|
||||
writer.write(message)
|
||||
writer.write("\r\n")
|
||||
writer.flush()
|
||||
|
|
|
|||
|
|
@ -0,0 +1,36 @@
|
|||
package com.github.continuedev.continueintellijextension.proxy
|
||||
|
||||
import com.github.continuedev.continueintellijextension.services.ContinuePluginService
|
||||
import com.intellij.openapi.components.service
|
||||
import com.intellij.openapi.diagnostic.Logger
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.openapi.startup.StartupActivity
|
||||
import kotlinx.coroutines.*
|
||||
import kotlin.time.Duration.Companion.seconds
|
||||
|
||||
class ProxyPoolingActivity : StartupActivity {
|
||||
private val scope = CoroutineScope(Dispatchers.Default)
|
||||
private var lastSettings = ProxySettings.getSettings()
|
||||
private val log = Logger.getInstance(ProxyPoolingActivity::class.java)
|
||||
|
||||
override fun runActivity(project: Project) {
|
||||
scope.launch {
|
||||
while (isActive) {
|
||||
val newSettings = ProxySettings.getSettings()
|
||||
if (newSettings != lastSettings) {
|
||||
onSettingsChanged(project)
|
||||
lastSettings = newSettings
|
||||
}
|
||||
delay(2.seconds)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun onSettingsChanged(project: Project) {
|
||||
log.warn("Proxy settings changed, restarting")
|
||||
project.service<ContinuePluginService>().coreMessengerManager?.coreMessenger?.restart()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
package com.github.continuedev.continueintellijextension.proxy
|
||||
|
||||
import com.intellij.util.net.HttpConfigurable
|
||||
|
||||
data class ProxySettings(
|
||||
val enabled: Boolean,
|
||||
val proxy: String,
|
||||
) {
|
||||
|
||||
companion object {
|
||||
fun getSettings(): ProxySettings {
|
||||
val settings = HttpConfigurable.getInstance()
|
||||
return ProxySettings(
|
||||
enabled = settings.USE_HTTP_PROXY,
|
||||
proxy = "${settings.PROXY_HOST}:${settings.PROXY_PORT}"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -33,7 +33,7 @@ class ContinuePluginService : Disposable, DumbAware {
|
|||
coroutineScope.cancel()
|
||||
coreMessenger?.coroutineScope?.let {
|
||||
it.cancel()
|
||||
coreMessenger?.killSubProcess()
|
||||
coreMessenger?.close()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,62 +2,69 @@ package com.github.continuedev.continueintellijextension.toolWindow
|
|||
|
||||
import com.github.continuedev.continueintellijextension.services.ContinuePluginService
|
||||
import com.intellij.openapi.actionSystem.ActionManager
|
||||
import com.intellij.openapi.actionSystem.AnAction
|
||||
import com.intellij.openapi.components.service
|
||||
import com.intellij.openapi.project.DumbAware
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.openapi.wm.ToolWindow
|
||||
import com.intellij.openapi.wm.ToolWindowFactory
|
||||
import com.intellij.ui.content.ContentFactory
|
||||
import com.intellij.ui.dsl.builder.AlignX
|
||||
import com.intellij.ui.dsl.builder.panel
|
||||
import com.intellij.ui.jcef.JBCefApp
|
||||
import com.intellij.util.ui.JBUI.Borders.empty
|
||||
import javax.swing.JComponent
|
||||
import javax.swing.JPanel
|
||||
|
||||
const val JS_QUERY_POOL_SIZE = "200"
|
||||
|
||||
class ContinuePluginToolWindowFactory : ToolWindowFactory, DumbAware {
|
||||
override fun createToolWindowContent(project: Project, toolWindow: ToolWindow) {
|
||||
val continueToolWindow = ContinuePluginWindow(project)
|
||||
val content =
|
||||
ContentFactory.getInstance().createContent(continueToolWindow.content, null, false)
|
||||
toolWindow.contentManager.addContent(content)
|
||||
val titleActions = mutableListOf<AnAction>()
|
||||
createTitleActions(titleActions)
|
||||
|
||||
// Add MaximizeToolWindow action
|
||||
val action = ActionManager.getInstance().getAction("MaximizeToolWindow")
|
||||
if (action != null) {
|
||||
titleActions.add(action)
|
||||
override fun createToolWindowContent(project: Project, toolWindow: ToolWindow) {
|
||||
val inner = if (JBCefApp.isSupported())
|
||||
ContinuePluginWindow(project).content
|
||||
else
|
||||
createNotSupportedPanel()
|
||||
val content = ContentFactory.getInstance().createContent(inner, null, false)
|
||||
toolWindow.contentManager.addContent(content)
|
||||
toolWindow.setTitleActions(
|
||||
listOf(
|
||||
ActionManager.getInstance().getAction("ContinueSidebarActionsGroup"),
|
||||
ActionManager.getInstance().getAction("MaximizeToolWindow")
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
toolWindow.setTitleActions(titleActions)
|
||||
}
|
||||
override fun shouldBeAvailable(project: Project) = true
|
||||
|
||||
private fun createTitleActions(titleActions: MutableList<in AnAction>) {
|
||||
val action = ActionManager.getInstance().getAction("ContinueSidebarActionsGroup")
|
||||
if (action != null) {
|
||||
titleActions.add(action)
|
||||
}
|
||||
}
|
||||
|
||||
override fun shouldBeAvailable(project: Project) = true
|
||||
|
||||
class ContinuePluginWindow(project: Project) {
|
||||
private val defaultGUIUrl = "http://continue/index.html"
|
||||
|
||||
init {
|
||||
System.setProperty("ide.browser.jcef.jsQueryPoolSize", JS_QUERY_POOL_SIZE)
|
||||
System.setProperty("ide.browser.jcef.contextMenu.devTools.enabled", "true")
|
||||
System.setProperty("ide.browser.jcef.out-of-process.enabled", "false")
|
||||
private fun createNotSupportedPanel(): JPanel {
|
||||
val html = ContinuePluginToolWindowFactory::class.java.classLoader
|
||||
.getResourceAsStream("jcef_error.html")
|
||||
.bufferedReader()
|
||||
.readText()
|
||||
return panel {
|
||||
row {
|
||||
text(html)
|
||||
}
|
||||
}.withBorder(empty(10))
|
||||
}
|
||||
|
||||
val browser: ContinueBrowser by lazy {
|
||||
val url = System.getenv("GUI_URL")?.toString() ?: defaultGUIUrl
|
||||
class ContinuePluginWindow(project: Project) {
|
||||
private val defaultGUIUrl = "http://continue/index.html"
|
||||
|
||||
val browser = ContinueBrowser(project, url)
|
||||
project.service<ContinuePluginService>().continuePluginWindow = this
|
||||
browser
|
||||
init {
|
||||
System.setProperty("ide.browser.jcef.jsQueryPoolSize", JS_QUERY_POOL_SIZE)
|
||||
System.setProperty("ide.browser.jcef.contextMenu.devTools.enabled", "true")
|
||||
System.setProperty("ide.browser.jcef.out-of-process.enabled", "false")
|
||||
}
|
||||
|
||||
val browser: ContinueBrowser by lazy {
|
||||
val url = System.getenv("GUI_URL") ?: defaultGUIUrl
|
||||
|
||||
val browser = ContinueBrowser(project, url)
|
||||
project.service<ContinuePluginService>().continuePluginWindow = this
|
||||
browser
|
||||
}
|
||||
|
||||
val content: JComponent
|
||||
get() = browser.browser.component
|
||||
}
|
||||
|
||||
val content: JComponent
|
||||
get() = browser.browser.component
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -290,6 +290,7 @@ data class ApplyState(
|
|||
val numDiffs: Int? = null,
|
||||
val filepath: String? = null,
|
||||
val fileContent: String? = null,
|
||||
val originalFileContent: String? = null,
|
||||
val toolCallId: String? = null
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@
|
|||
<errorHandler implementation="com.github.continuedev.continueintellijextension.error.ContinueErrorSubmitter"/>
|
||||
<postStartupActivity
|
||||
implementation="com.github.continuedev.continueintellijextension.activities.ContinuePluginStartupActivity"/>
|
||||
<postStartupActivity implementation="com.github.continuedev.continueintellijextension.proxy.ProxyPoolingActivity"/>
|
||||
<applicationConfigurable
|
||||
parentId="tools"
|
||||
instance="com.github.continuedev.continueintellijextension.services.ContinueExtensionConfigurable"
|
||||
|
|
|
|||
22
extensions/intellij/src/main/resources/jcef_error.html
Normal file
22
extensions/intellij/src/main/resources/jcef_error.html
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
<!--suppress ALL-->
|
||||
<html>
|
||||
<h2>
|
||||
<center>Continue Chat is Unable to Load</center>
|
||||
</h2>
|
||||
<p>Continue Chat requires a JRE that supports the Java Chromium Embedded Framework (JCEF) to render our webview. You can
|
||||
still use Autocomplete and Edit.</p>
|
||||
<h3>How to Fix It?</h3>
|
||||
<p>You can manually switch to a JRE that supports JCEF:</p>
|
||||
<ol>
|
||||
<li>In the main menu, go to <b>Help | Find Action</b> or press
|
||||
<b>Ctrl + Shift + A</b>.
|
||||
</li>
|
||||
<li>Find and select the <b>Choose Boot Java Runtime for the IDE</b> action.</li>
|
||||
<li>Select the runtime that comes with JCEF support and click <b>OK</b>.</li>
|
||||
<li>Restart with the new runtime.</li>
|
||||
</ol>
|
||||
<p>Runtimes that support JCEF are usually called <b>JetBrains Runtime</b> and have the <code>-jcef</code> suffix,
|
||||
for example <code>21.0.3+13-509.11-jcef</code>.</p>
|
||||
<br>
|
||||
<small>You can find more information in the <a href="https://www.jetbrains.com/help/idea/switching-boot-jdk.html">JetBrains documentation</a>.</small>
|
||||
</html>
|
||||
79
extensions/vscode/package-lock.json
generated
79
extensions/vscode/package-lock.json
generated
|
|
@ -1,16 +1,16 @@
|
|||
{
|
||||
"name": "continue",
|
||||
"version": "1.1.63",
|
||||
"version": "1.1.67",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "continue",
|
||||
"version": "1.1.63",
|
||||
"version": "1.1.67",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@continuedev/config-types": "^1.0.14",
|
||||
"@continuedev/fetch": "^1.0.10",
|
||||
"@continuedev/config-types": "file:../../packages/config-types",
|
||||
"@continuedev/fetch": "file:../../packages/fetch",
|
||||
"@electron/rebuild": "^3.2.10",
|
||||
"@reduxjs/toolkit": "^1.9.3",
|
||||
"@vscode/ripgrep": "^1.15.9",
|
||||
|
|
@ -105,8 +105,8 @@
|
|||
"@aws-sdk/credential-providers": "^3.778.0",
|
||||
"@continuedev/config-types": "^1.0.13",
|
||||
"@continuedev/config-yaml": "file:../packages/config-yaml",
|
||||
"@continuedev/fetch": "^1.0.14",
|
||||
"@continuedev/llm-info": "^1.0.8",
|
||||
"@continuedev/fetch": "file:../packages/fetch",
|
||||
"@continuedev/llm-info": "file:../packages/llm-info",
|
||||
"@continuedev/openai-adapters": "file:../packages/openai-adapters",
|
||||
"@modelcontextprotocol/sdk": "^1.12.0",
|
||||
"@mozilla/readability": "^0.5.0",
|
||||
|
|
@ -129,6 +129,7 @@
|
|||
"handlebars": "^4.7.8",
|
||||
"http-proxy-agent": "^7.0.1",
|
||||
"https-proxy-agent": "^7.0.3",
|
||||
"iconv-lite": "^0.6.3",
|
||||
"ignore": "^5.3.1",
|
||||
"is-localhost-ip": "^2.0.0",
|
||||
"jinja-js": "0.1.8",
|
||||
|
|
@ -142,7 +143,7 @@
|
|||
"node-html-markdown": "^1.3.0",
|
||||
"ollama": "^0.4.6",
|
||||
"onnxruntime-node": "1.14.0",
|
||||
"openai": "^4.76.0",
|
||||
"openai": "^4.104.0",
|
||||
"p-limit": "^6.1.0",
|
||||
"partial-json": "^0.1.7",
|
||||
"pg": "^8.11.3",
|
||||
|
|
@ -207,6 +208,41 @@
|
|||
"node": ">=20.19.0"
|
||||
}
|
||||
},
|
||||
"../../packages/config-types": {
|
||||
"name": "@continuedev/config-types",
|
||||
"version": "1.0.14",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"zod": "^3.24.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.11.19",
|
||||
"typescript": "^5.5.2"
|
||||
}
|
||||
},
|
||||
"../../packages/fetch": {
|
||||
"name": "@continuedev/fetch",
|
||||
"version": "1.0.15",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@continuedev/config-types": "file:../config-types",
|
||||
"follow-redirects": "^1.15.6",
|
||||
"http-proxy-agent": "^7.0.2",
|
||||
"https-proxy-agent": "^7.0.5",
|
||||
"node-fetch": "^3.3.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/follow-redirects": "^1.14.4",
|
||||
"typescript": "^5.0.0",
|
||||
"vitest": "^3.2.0"
|
||||
}
|
||||
},
|
||||
"../packages/config-types": {
|
||||
"extraneous": true
|
||||
},
|
||||
"../packages/fetch": {
|
||||
"extraneous": true
|
||||
},
|
||||
"node_modules/@75lb/deep-merge": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/@75lb/deep-merge/-/deep-merge-1.1.2.tgz",
|
||||
|
|
@ -702,25 +738,12 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@continuedev/config-types": {
|
||||
"version": "1.0.14",
|
||||
"resolved": "https://registry.npmjs.org/@continuedev/config-types/-/config-types-1.0.14.tgz",
|
||||
"integrity": "sha512-PVHyHPyRXd2QsaNgnCpiKYU3uHFTlyuQSkqE8OwrBmQqO6/TXUVIr/2EGtyIZGrml4Y+rGMSH40WU4/0t4SGpQ==",
|
||||
"dependencies": {
|
||||
"zod": "^3.23.8"
|
||||
}
|
||||
"resolved": "../../packages/config-types",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@continuedev/fetch": {
|
||||
"version": "1.0.10",
|
||||
"resolved": "https://registry.npmjs.org/@continuedev/fetch/-/fetch-1.0.10.tgz",
|
||||
"integrity": "sha512-RBUXtm/VDz+9Itgw+CxrHXwVXoHCAedGzPOgA7gS5HZ9lObaeCJgEfzmfbln1ocFsfqSFmn5X5wSE7DHgfxpVA==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@continuedev/config-types": "^1.0.5",
|
||||
"follow-redirects": "^1.15.6",
|
||||
"http-proxy-agent": "^7.0.2",
|
||||
"https-proxy-agent": "^7.0.5",
|
||||
"node-fetch": "^3.3.2"
|
||||
}
|
||||
"resolved": "../../packages/fetch",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@electron/node-gyp": {
|
||||
"version": "10.2.0-electron.1",
|
||||
|
|
@ -16741,14 +16764,6 @@
|
|||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/zod": {
|
||||
"version": "3.23.8",
|
||||
"resolved": "https://registry.npmjs.org/zod/-/zod-3.23.8.tgz",
|
||||
"integrity": "sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/colinhacks"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
"name": "continue",
|
||||
"icon": "media/icon.png",
|
||||
"author": "Continue Dev, Inc",
|
||||
"version": "1.1.67",
|
||||
"version": "1.1.68",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/continuedev/continue"
|
||||
|
|
@ -717,8 +717,8 @@
|
|||
"vscode-extension-tester": "^8.14.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@continuedev/config-types": "^1.0.14",
|
||||
"@continuedev/fetch": "^1.0.10",
|
||||
"@continuedev/config-types": "file:../../packages/config-types",
|
||||
"@continuedev/fetch": "file:../../packages/fetch",
|
||||
"@electron/rebuild": "^3.2.10",
|
||||
"@reduxjs/toolkit": "^1.9.3",
|
||||
"@vscode/ripgrep": "^1.15.9",
|
||||
|
|
|
|||
|
|
@ -29,13 +29,6 @@ export class ApplyManager {
|
|||
toolCallId,
|
||||
isSearchAndReplace,
|
||||
}: ApplyToFilePayload) {
|
||||
await this.webviewProtocol.request("updateApplyState", {
|
||||
streamId,
|
||||
status: "streaming",
|
||||
fileContent: text,
|
||||
toolCallId,
|
||||
});
|
||||
|
||||
if (filepath) {
|
||||
await this.ensureFileOpen(filepath);
|
||||
}
|
||||
|
|
@ -46,6 +39,17 @@ export class ApplyManager {
|
|||
return;
|
||||
}
|
||||
|
||||
// Capture the original file content before applying changes
|
||||
const originalFileContent = activeTextEditor.document.getText();
|
||||
|
||||
await this.webviewProtocol.request("updateApplyState", {
|
||||
streamId,
|
||||
status: "streaming",
|
||||
fileContent: text,
|
||||
originalFileContent,
|
||||
toolCallId,
|
||||
});
|
||||
|
||||
const hasExistingDocument = !!activeTextEditor.document.getText().trim();
|
||||
|
||||
if (hasExistingDocument) {
|
||||
|
|
|
|||
|
|
@ -315,11 +315,12 @@ export class VerticalDiffHandler implements vscode.Disposable {
|
|||
// newline separated, because myersDiff() would consider
|
||||
// ["A"] => "A" and ["A", ""] => "A\n" to be the same single line.
|
||||
// "A\n" and "A\n\n" are unambiguous.
|
||||
const oldFileContent =
|
||||
diffLines
|
||||
.filter((line) => line.type === "same" || line.type === "old")
|
||||
.map((line) => line.line)
|
||||
.join("\n") + "\n";
|
||||
const oldContentWithoutTrailingNewline = diffLines
|
||||
.filter((line) => line.type === "same" || line.type === "old")
|
||||
.map((line) => line.line)
|
||||
.join("\n");
|
||||
|
||||
const oldFileContent = oldContentWithoutTrailingNewline + "\n";
|
||||
|
||||
const newFileContent =
|
||||
diffLines
|
||||
|
|
@ -329,9 +330,16 @@ export class VerticalDiffHandler implements vscode.Disposable {
|
|||
|
||||
const myersDiffs = myersDiff(oldFileContent, newFileContent);
|
||||
|
||||
const replaceContent = myersDiffs
|
||||
.map((diff) => (diff.type === "old" ? "" : diff.line))
|
||||
.join("\n");
|
||||
// Preserve the trailing newline behavior by checking the original document content
|
||||
const originalDocumentContent = this.editor.document.getText(this.range);
|
||||
const originalContentEndsWithNewline =
|
||||
originalDocumentContent.endsWith("\n");
|
||||
|
||||
// Add trailing newline only if the original file had one to prevent line count discrepancies
|
||||
const replaceContent =
|
||||
myersDiffs
|
||||
.map((diff) => (diff.type === "old" ? "" : diff.line))
|
||||
.join("\n") + (originalContentEndsWithNewline ? "\n" : "");
|
||||
|
||||
// Then, we insert our diff lines
|
||||
await this.editor.edit((editBuilder) => {
|
||||
|
|
|
|||
|
|
@ -65,6 +65,7 @@ class EditOutcomeTracker {
|
|||
newCodeLines: pendingEdit.newCodeLines,
|
||||
lineChange: pendingEdit.lineChange,
|
||||
accepted,
|
||||
filepath: pendingEdit.filepath,
|
||||
},
|
||||
});
|
||||
|
||||
|
|
|
|||
9
gui/package-lock.json
generated
9
gui/package-lock.json
generated
|
|
@ -116,8 +116,8 @@
|
|||
"@aws-sdk/credential-providers": "^3.778.0",
|
||||
"@continuedev/config-types": "^1.0.13",
|
||||
"@continuedev/config-yaml": "file:../packages/config-yaml",
|
||||
"@continuedev/fetch": "^1.0.14",
|
||||
"@continuedev/llm-info": "^1.0.8",
|
||||
"@continuedev/fetch": "file:../packages/fetch",
|
||||
"@continuedev/llm-info": "file:../packages/llm-info",
|
||||
"@continuedev/openai-adapters": "file:../packages/openai-adapters",
|
||||
"@modelcontextprotocol/sdk": "^1.12.0",
|
||||
"@mozilla/readability": "^0.5.0",
|
||||
|
|
@ -140,6 +140,7 @@
|
|||
"handlebars": "^4.7.8",
|
||||
"http-proxy-agent": "^7.0.1",
|
||||
"https-proxy-agent": "^7.0.3",
|
||||
"iconv-lite": "^0.6.3",
|
||||
"ignore": "^5.3.1",
|
||||
"is-localhost-ip": "^2.0.0",
|
||||
"jinja-js": "0.1.8",
|
||||
|
|
@ -153,7 +154,7 @@
|
|||
"node-html-markdown": "^1.3.0",
|
||||
"ollama": "^0.4.6",
|
||||
"onnxruntime-node": "1.14.0",
|
||||
"openai": "^4.76.0",
|
||||
"openai": "^4.104.0",
|
||||
"p-limit": "^6.1.0",
|
||||
"partial-json": "^0.1.7",
|
||||
"pg": "^8.11.3",
|
||||
|
|
@ -223,7 +224,7 @@
|
|||
"version": "1.0.96",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@continuedev/config-types": "^1.0.14",
|
||||
"@continuedev/config-types": "file:../config-types",
|
||||
"yaml": "^2.6.1",
|
||||
"zod": "^3.24.2"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -113,6 +113,10 @@ const StyledMarkdown = styled.div<{
|
|||
line-height: 1.5;
|
||||
}
|
||||
|
||||
* {
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
> *:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import {
|
|||
ExclamationCircleIcon,
|
||||
ExclamationTriangleIcon,
|
||||
InformationCircleIcon,
|
||||
} from "@heroicons/react/24/solid";
|
||||
} from "@heroicons/react/16/solid";
|
||||
import { ReactNode } from "react";
|
||||
import { vscBackground } from "..";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
import {
|
||||
AtSymbolIcon,
|
||||
LightBulbIcon,
|
||||
LightBulbIcon as LightBulbIconOutline,
|
||||
PhotoIcon,
|
||||
} from "@heroicons/react/24/outline";
|
||||
import { LightBulbIcon as LightBulbIconSolid } from "@heroicons/react/24/solid";
|
||||
import { InputModifiers } from "core";
|
||||
import { modelSupportsImages, modelSupportsTools } from "core/llm/autodetect";
|
||||
import { useContext, useRef } from "react";
|
||||
|
|
@ -13,7 +14,6 @@ import { selectSelectedChatModel } from "../../redux/slices/configSlice";
|
|||
import { setHasReasoningEnabled } from "../../redux/slices/sessionSlice";
|
||||
import { exitEdit } from "../../redux/thunks/edit";
|
||||
import { getAltKeyLabel, isMetaEquivalentKeyPressed } from "../../util";
|
||||
import { cn } from "../../util/cn";
|
||||
import { ToolTip } from "../gui/Tooltip";
|
||||
import ModelSelect from "../modelSelection/ModelSelect";
|
||||
import { ModeSelect } from "../ModeSelect";
|
||||
|
|
@ -141,19 +141,23 @@ function InputToolbar(props: InputToolbarProps) {
|
|||
</ToolTip>
|
||||
</HoverItem>
|
||||
)}
|
||||
{defaultModel?.provider === "anthropic" && (
|
||||
{defaultModel?.underlyingProviderName === "anthropic" && (
|
||||
<HoverItem
|
||||
onClick={() =>
|
||||
dispatch(setHasReasoningEnabled(!hasReasoningEnabled))
|
||||
}
|
||||
>
|
||||
<LightBulbIcon
|
||||
data-tooltip-id="model-reasoning-tooltip"
|
||||
className={cn(
|
||||
"h-3 w-3 hover:brightness-150",
|
||||
hasReasoningEnabled && "brightness-200",
|
||||
)}
|
||||
/>
|
||||
{hasReasoningEnabled ? (
|
||||
<LightBulbIconSolid
|
||||
data-tooltip-id="model-reasoning-tooltip"
|
||||
className="h-3 w-3 brightness-200 hover:brightness-150"
|
||||
/>
|
||||
) : (
|
||||
<LightBulbIconOutline
|
||||
data-tooltip-id="model-reasoning-tooltip"
|
||||
className="h-3 w-3 hover:brightness-150"
|
||||
/>
|
||||
)}
|
||||
|
||||
<ToolTip id="model-reasoning-tooltip" place="top">
|
||||
{hasReasoningEnabled
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { Tool } from "core";
|
||||
import { MessageModes, Tool } from "core";
|
||||
import { useMemo } from "react";
|
||||
import { useAppDispatch, useAppSelector } from "../../../../../redux/hooks";
|
||||
import { toggleToolGroupSetting } from "../../../../../redux/slices/uiSlice";
|
||||
|
|
@ -43,20 +43,28 @@ export const ToolPoliciesSection = () => {
|
|||
|
||||
const allToolsOff = mode === "chat";
|
||||
|
||||
const message =
|
||||
mode === "chat"
|
||||
? "All tools disabled (Chat)"
|
||||
: mode === "plan"
|
||||
? "Read-only/MCP tools available (Plan)"
|
||||
: "All tools available (Agent)";
|
||||
const getMessage = (mode: MessageModes) => {
|
||||
switch (mode) {
|
||||
case "chat":
|
||||
return "All tools disabled in Chat, switch to Plan or Agent mode to use tools";
|
||||
case "plan":
|
||||
return "Read-only/MCP tools available in Plan mode";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
};
|
||||
|
||||
const message = getMessage(mode);
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="my-1 mb-3">
|
||||
<Alert type="info" size="sm">
|
||||
<span className="text-2xs italic">{message}</span>
|
||||
</Alert>
|
||||
</div>
|
||||
{(mode === "chat" || mode === "plan") && (
|
||||
<div className="my-1 mb-3">
|
||||
<Alert type="info" size="sm">
|
||||
<span className="text-2xs italic">{message}</span>
|
||||
</Alert>
|
||||
</div>
|
||||
)}
|
||||
{toolsByGroup.map(([groupName, tools]) => {
|
||||
const isGroupEnabled =
|
||||
!allToolsOff && toolGroupSettings[groupName] !== "exclude";
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ import { useAuth } from "../../context/Auth";
|
|||
import { IdeMessengerContext } from "../../context/IdeMessenger";
|
||||
import { AddModelForm } from "../../forms/AddModelForm";
|
||||
import { useAppDispatch, useAppSelector } from "../../redux/hooks";
|
||||
import { EMPTY_CONFIG } from "../../redux/slices/configSlice";
|
||||
import { setDialogMessage, setShowDialog } from "../../redux/slices/uiSlice";
|
||||
import { updateSelectedModelByRole } from "../../redux/thunks/updateSelectedModelByRole";
|
||||
import {
|
||||
|
|
@ -94,6 +93,7 @@ function ModelSelect() {
|
|||
|
||||
const isInEdit = useAppSelector((store) => store.session.isInEdit);
|
||||
const config = useAppSelector((state) => state.config.config);
|
||||
const isConfigLoading = useAppSelector((state) => state.config.loading);
|
||||
const ideMessenger = useContext(IdeMessengerContext);
|
||||
const buttonRef = useRef<HTMLButtonElement>(null);
|
||||
const [options, setOptions] = useState<Option[]>([]);
|
||||
|
|
@ -192,7 +192,6 @@ function ModelSelect() {
|
|||
);
|
||||
}
|
||||
|
||||
const isConfigLoading = config === EMPTY_CONFIG;
|
||||
const hasNoModels = allModels?.length === 0;
|
||||
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ import {
|
|||
setDocumentStylesFromTheme,
|
||||
} from "../styles/theme";
|
||||
import { isJetBrains } from "../util";
|
||||
import { logAgentModeEditOutcome } from "../util/editOutcomeLogger";
|
||||
import { setLocalStorage } from "../util/localStorage";
|
||||
import { migrateLocalStorage } from "../util/migrateLocalStorage";
|
||||
import { useWebviewListener } from "./useWebviewListener";
|
||||
|
|
@ -276,17 +277,40 @@ function ParallelListeners() {
|
|||
store.getState().session.history,
|
||||
state.toolCallId,
|
||||
);
|
||||
if (toolCallState && toolCallState.status !== "canceled") {
|
||||
dispatch(
|
||||
acceptToolCall({
|
||||
toolCallId: state.toolCallId,
|
||||
}),
|
||||
);
|
||||
void dispatch(
|
||||
streamResponseAfterToolCall({
|
||||
toolCallId: state.toolCallId,
|
||||
}),
|
||||
);
|
||||
|
||||
if (toolCallState) {
|
||||
const accepted = toolCallState.status !== "canceled";
|
||||
|
||||
logToolUsage(toolCallState, accepted, true, ideMessenger);
|
||||
|
||||
// Log edit outcome for Agent Mode
|
||||
const applyState = store
|
||||
.getState()
|
||||
.session.codeBlockApplyStates.states.find(
|
||||
(s) => s.streamId === state.streamId,
|
||||
);
|
||||
|
||||
if (applyState) {
|
||||
void logAgentModeEditOutcome(
|
||||
toolCallState,
|
||||
applyState,
|
||||
accepted,
|
||||
ideMessenger,
|
||||
);
|
||||
}
|
||||
|
||||
if (accepted) {
|
||||
dispatch(
|
||||
acceptToolCall({
|
||||
toolCallId: state.toolCallId,
|
||||
}),
|
||||
);
|
||||
void dispatch(
|
||||
streamResponseAfterToolCall({
|
||||
toolCallId: state.toolCallId,
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
// const output: ContextItem = {
|
||||
// name: "Edit tool output",
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ export const configSlice = createSlice({
|
|||
} else {
|
||||
state.config = config;
|
||||
}
|
||||
state.loading = false;
|
||||
},
|
||||
updateConfig: (
|
||||
state,
|
||||
|
|
|
|||
|
|
@ -784,6 +784,9 @@ export const sessionSlice = createSlice({
|
|||
applyState.status = payload.status ?? applyState.status;
|
||||
applyState.numDiffs = payload.numDiffs ?? applyState.numDiffs;
|
||||
applyState.filepath = payload.filepath ?? applyState.filepath;
|
||||
applyState.fileContent = payload.fileContent ?? applyState.fileContent;
|
||||
applyState.originalFileContent =
|
||||
payload.originalFileContent ?? applyState.originalFileContent;
|
||||
}
|
||||
|
||||
if (payload.status === "done") {
|
||||
|
|
|
|||
|
|
@ -155,7 +155,8 @@ export const streamNormalInput = createAsyncThunk<
|
|||
completionOptions = {
|
||||
...completionOptions,
|
||||
reasoning: true,
|
||||
reasoningBudgetTokens: completionOptions.reasoningBudgetTokens ?? 2048,
|
||||
reasoningBudgetTokens:
|
||||
selectedChatModel.completionOptions?.reasoningBudgetTokens ?? 2048,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
81
gui/src/util/editOutcomeLogger.test.ts
Normal file
81
gui/src/util/editOutcomeLogger.test.ts
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
import { ApplyState, ToolCallState } from "core";
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import { assembleEditOutcomeData } from "./editOutcomeLogger";
|
||||
|
||||
vi.mock("../redux/store", () => ({
|
||||
store: {
|
||||
getState: vi.fn(() => ({
|
||||
session: { history: [] },
|
||||
config: {
|
||||
config: {
|
||||
selectedModelByRole: {
|
||||
chat: { provider: "test", model: "test-model" },
|
||||
},
|
||||
},
|
||||
},
|
||||
})),
|
||||
},
|
||||
}));
|
||||
|
||||
describe("assembleEditOutcomeData", () => {
|
||||
it("should assemble complete edit outcome data correctly", () => {
|
||||
const toolCallState: ToolCallState = {
|
||||
status: "generating",
|
||||
toolCallId: "test-id",
|
||||
toolCall: {
|
||||
id: "test-id",
|
||||
type: "function",
|
||||
function: { name: "test", arguments: "{}" },
|
||||
},
|
||||
parsedArgs: {},
|
||||
};
|
||||
|
||||
const applyState: ApplyState = {
|
||||
streamId: "stream-123",
|
||||
filepath: "/test/file.ts",
|
||||
originalFileContent: "const old = 1;",
|
||||
fileContent: "const new = 2;\nconst another = 3;",
|
||||
};
|
||||
|
||||
const result = assembleEditOutcomeData(toolCallState, applyState, true);
|
||||
console.log(result);
|
||||
|
||||
expect(result).toMatchObject({
|
||||
streamId: "stream-123",
|
||||
filepath: "/test/file.ts",
|
||||
previousCode: "const old = 1;",
|
||||
newCode: "const new = 2;\nconst another = 3;",
|
||||
previousCodeLines: 1,
|
||||
newCodeLines: 2,
|
||||
lineChange: 1,
|
||||
accepted: true,
|
||||
});
|
||||
});
|
||||
|
||||
it("should handle empty code content", () => {
|
||||
const toolCallState: ToolCallState = {
|
||||
status: "generating",
|
||||
toolCallId: "test-id",
|
||||
toolCall: {
|
||||
id: "test-id",
|
||||
type: "function",
|
||||
function: { name: "test", arguments: "{}" },
|
||||
},
|
||||
parsedArgs: {},
|
||||
};
|
||||
|
||||
const applyState: ApplyState = {
|
||||
streamId: "stream-123",
|
||||
filepath: "/test/empty.ts",
|
||||
originalFileContent: "",
|
||||
fileContent: "",
|
||||
};
|
||||
|
||||
const result = assembleEditOutcomeData(toolCallState, applyState, false);
|
||||
|
||||
expect(result.previousCodeLines).toBe(0);
|
||||
expect(result.newCodeLines).toBe(0);
|
||||
expect(result.lineChange).toBe(0);
|
||||
expect(result.accepted).toBe(false);
|
||||
});
|
||||
});
|
||||
190
gui/src/util/editOutcomeLogger.ts
Normal file
190
gui/src/util/editOutcomeLogger.ts
Normal file
|
|
@ -0,0 +1,190 @@
|
|||
import { ApplyState, ToolCallState } from "core";
|
||||
import { IIdeMessenger } from "../context/IdeMessenger";
|
||||
import { store } from "../redux/store";
|
||||
|
||||
/**
|
||||
* Extract model information from tool call state
|
||||
*/
|
||||
function extractModelInfo(toolCallState: ToolCallState): {
|
||||
modelProvider: string;
|
||||
modelTitle: string;
|
||||
} {
|
||||
// Get the conversation history to find the model info
|
||||
const history = store.getState().session.history;
|
||||
|
||||
// Find the assistant message that contains this tool call
|
||||
const assistantMessage = history.find(
|
||||
(item) =>
|
||||
item.message.role === "assistant" &&
|
||||
item.message.toolCalls?.some((tc) => tc.id === toolCallState.toolCallId),
|
||||
);
|
||||
|
||||
if (
|
||||
assistantMessage?.message.role === "assistant" &&
|
||||
"model" in assistantMessage.message &&
|
||||
assistantMessage.message.model
|
||||
) {
|
||||
// Extract provider from model string (e.g., "anthropic::claude-3-5-sonnet" -> "anthropic")
|
||||
const modelParts = String(assistantMessage.message.model).split("::");
|
||||
return {
|
||||
modelProvider: modelParts[0] || "unknown",
|
||||
modelTitle: modelParts[1] || String(assistantMessage.message.model),
|
||||
};
|
||||
}
|
||||
|
||||
// Fallback to config if not found in message
|
||||
const config = store.getState().config.config;
|
||||
const chatModel = config?.selectedModelByRole?.chat;
|
||||
|
||||
return {
|
||||
modelProvider: chatModel?.provider || "unknown",
|
||||
modelTitle: chatModel?.model || "unknown",
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract prompt and completion from tool call state
|
||||
*/
|
||||
function extractPromptAndCompletion(toolCallState: ToolCallState): {
|
||||
prompt: string;
|
||||
completion: string;
|
||||
} {
|
||||
const history = store.getState().session.history;
|
||||
|
||||
// Find the assistant message with this tool call
|
||||
const assistantMessageIndex = history.findIndex(
|
||||
(item) =>
|
||||
item.message.role === "assistant" &&
|
||||
item.message.toolCalls?.some((tc) => tc.id === toolCallState.toolCallId),
|
||||
);
|
||||
|
||||
if (assistantMessageIndex >= 0) {
|
||||
const assistantMessage = history[assistantMessageIndex];
|
||||
|
||||
// Look for the most recent user message before this assistant message
|
||||
let userMessage = null;
|
||||
for (let i = assistantMessageIndex - 1; i >= 0; i--) {
|
||||
if (history[i].message.role === "user") {
|
||||
userMessage = history[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
const promptContent = userMessage
|
||||
? Array.isArray(userMessage.message.content)
|
||||
? userMessage.message.content
|
||||
.map((part) =>
|
||||
typeof part === "string"
|
||||
? part
|
||||
: part.type === "text"
|
||||
? part.text || ""
|
||||
: "",
|
||||
)
|
||||
.join("")
|
||||
: userMessage.message.content || ""
|
||||
: "";
|
||||
|
||||
const completionContent = Array.isArray(assistantMessage.message.content)
|
||||
? assistantMessage.message.content
|
||||
.map((part) =>
|
||||
typeof part === "string"
|
||||
? part
|
||||
: part.type === "text"
|
||||
? part.text || ""
|
||||
: "",
|
||||
)
|
||||
.join("")
|
||||
: assistantMessage.message.content || "";
|
||||
|
||||
return {
|
||||
prompt: promptContent,
|
||||
completion: completionContent,
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
prompt: "Unknown prompt",
|
||||
completion: "Unknown completion",
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract code changes from apply state
|
||||
*/
|
||||
function extractCodeChanges(applyState: ApplyState): {
|
||||
previousCode: string;
|
||||
newCode: string;
|
||||
previousCodeLines: number;
|
||||
newCodeLines: number;
|
||||
lineChange: number;
|
||||
} {
|
||||
// Use the original file content if provided, otherwise empty string
|
||||
const previousCode = applyState.originalFileContent || "";
|
||||
const newCode = applyState.fileContent || "";
|
||||
|
||||
// Calculate line counts properly - empty string should be 0 lines, not 1
|
||||
const previousCodeLines =
|
||||
previousCode === "" ? 0 : previousCode.split("\n").length;
|
||||
const newCodeLines = newCode === "" ? 0 : newCode.split("\n").length;
|
||||
const lineChange = newCodeLines - previousCodeLines;
|
||||
|
||||
return {
|
||||
previousCode,
|
||||
newCode,
|
||||
previousCodeLines,
|
||||
newCodeLines,
|
||||
lineChange,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Assemble complete edit outcome data from tool call and apply state
|
||||
*/
|
||||
export function assembleEditOutcomeData(
|
||||
toolCallState: ToolCallState,
|
||||
applyState: ApplyState,
|
||||
accepted: boolean,
|
||||
) {
|
||||
const modelInfo = extractModelInfo(toolCallState);
|
||||
const promptAndCompletion = extractPromptAndCompletion(toolCallState);
|
||||
const codeChanges = extractCodeChanges(applyState);
|
||||
|
||||
return {
|
||||
streamId: applyState.streamId,
|
||||
timestamp: new Date().toISOString(),
|
||||
modelProvider: modelInfo.modelProvider,
|
||||
modelTitle: modelInfo.modelTitle,
|
||||
prompt: promptAndCompletion.prompt,
|
||||
completion: promptAndCompletion.completion,
|
||||
previousCode: codeChanges.previousCode,
|
||||
newCode: codeChanges.newCode,
|
||||
filepath: applyState.filepath || "",
|
||||
previousCodeLines: codeChanges.previousCodeLines,
|
||||
newCodeLines: codeChanges.newCodeLines,
|
||||
lineChange: codeChanges.lineChange,
|
||||
accepted,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Log Agent Mode edit outcome to editOutcome.jsonl
|
||||
*/
|
||||
export async function logAgentModeEditOutcome(
|
||||
toolCallState: ToolCallState,
|
||||
applyState: ApplyState,
|
||||
accepted: boolean,
|
||||
ideMessenger: IIdeMessenger,
|
||||
): Promise<void> {
|
||||
// Use the original file content stored in applyState, captured before edits were applied
|
||||
|
||||
const editOutcomeData = assembleEditOutcomeData(
|
||||
toolCallState,
|
||||
applyState,
|
||||
accepted,
|
||||
);
|
||||
|
||||
ideMessenger.post("devdata/log", {
|
||||
name: "editOutcome",
|
||||
data: editOutcomeData,
|
||||
});
|
||||
}
|
||||
2
package-lock.json
generated
2
package-lock.json
generated
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name": "wt-openai-adapters-tests",
|
||||
"name": "continue",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@ export type DevData = z.infer<typeof devDataSchema>;
|
|||
|
||||
export const siteIndexingConfigSchema = z.object({
|
||||
startUrl: z.string(),
|
||||
// rootUrl: z.string(),
|
||||
rootUrl: z.string().optional(),
|
||||
title: z.string(),
|
||||
maxDepth: z.number().optional(),
|
||||
faviconUrl: z.string().optional(),
|
||||
|
|
|
|||
22
packages/config-yaml/package-lock.json
generated
22
packages/config-yaml/package-lock.json
generated
|
|
@ -9,7 +9,7 @@
|
|||
"version": "1.0.96",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@continuedev/config-types": "^1.0.14",
|
||||
"@continuedev/config-types": "file:../config-types",
|
||||
"yaml": "^2.6.1",
|
||||
"zod": "^3.24.2"
|
||||
},
|
||||
|
|
@ -31,6 +31,18 @@
|
|||
"zod-to-json-schema": "^3.24.5"
|
||||
}
|
||||
},
|
||||
"../config-types": {
|
||||
"name": "@continuedev/config-types",
|
||||
"version": "1.0.14",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"zod": "^3.24.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.11.19",
|
||||
"typescript": "^5.5.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@ampproject/remapping": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz",
|
||||
|
|
@ -558,12 +570,8 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@continuedev/config-types": {
|
||||
"version": "1.0.14",
|
||||
"resolved": "https://registry.npmjs.org/@continuedev/config-types/-/config-types-1.0.14.tgz",
|
||||
"integrity": "sha512-PVHyHPyRXd2QsaNgnCpiKYU3uHFTlyuQSkqE8OwrBmQqO6/TXUVIr/2EGtyIZGrml4Y+rGMSH40WU4/0t4SGpQ==",
|
||||
"dependencies": {
|
||||
"zod": "^3.23.8"
|
||||
}
|
||||
"resolved": "../config-types",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@cspotcode/source-map-support": {
|
||||
"version": "0.8.1",
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
"author": "Continue Dev, Inc.",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@continuedev/config-types": "^1.0.14",
|
||||
"@continuedev/config-types": "file:../config-types",
|
||||
"yaml": "^2.6.1",
|
||||
"zod": "^3.24.2"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -12,4 +12,5 @@ export const editOutcomeEventAllSchema = baseDevDataAllSchema.extend({
|
|||
newCodeLines: z.number(),
|
||||
lineChange: z.number(),
|
||||
accepted: z.boolean(),
|
||||
filepath: z.string(),
|
||||
});
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ export const editOutcomeEventSchema_0_2_0 = editOutcomeEventAllSchema.pick({
|
|||
previousCodeLines: true,
|
||||
newCodeLines: true,
|
||||
lineChange: true,
|
||||
filepath: true,
|
||||
});
|
||||
|
||||
export const editOutcomeEventSchema_0_2_0_noCode =
|
||||
|
|
|
|||
9
packages/continue-sdk/package-lock.json
generated
9
packages/continue-sdk/package-lock.json
generated
|
|
@ -20,10 +20,10 @@
|
|||
},
|
||||
"../config-yaml": {
|
||||
"name": "@continuedev/config-yaml",
|
||||
"version": "1.0.88",
|
||||
"version": "1.0.96",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@continuedev/config-types": "^1.0.14",
|
||||
"@continuedev/config-types": "file:../config-types",
|
||||
"yaml": "^2.6.1",
|
||||
"zod": "^3.24.2"
|
||||
},
|
||||
|
|
@ -31,10 +31,15 @@
|
|||
"config-yaml": "dist/cli.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@semantic-release/changelog": "^6.0.3",
|
||||
"@semantic-release/git": "^10.0.1",
|
||||
"@semantic-release/github": "^9.2.6",
|
||||
"@semantic-release/npm": "^10.0.6",
|
||||
"@types/jest": "^29.5.14",
|
||||
"@types/node": "^20.0.0",
|
||||
"cross-env": "^7.0.3",
|
||||
"jest": "^29.7.0",
|
||||
"semantic-release": "^21.1.2",
|
||||
"ts-jest": "^29.2.3",
|
||||
"ts-node": "^10.9.2",
|
||||
"zod-to-json-schema": "^3.24.5"
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
"description": "SDK Generator for Continue.dev",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "echo 'No build step needed'",
|
||||
"generate-client:typescript": "openapi-generator-cli generate -i ./openapi.yaml -g typescript-fetch -o ./typescript/api -c ./openapi-generator-config.json",
|
||||
"generate-client:python": "openapi-generator-cli generate -i ./openapi.yaml -g python -o ./python/api -c ./openapi-generator-config.json",
|
||||
"generate-client:ALL": "npm run generate-client:typescript && npm run generate-client:python",
|
||||
|
|
@ -20,4 +21,4 @@
|
|||
"devDependencies": {
|
||||
"typescript": "^5.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
43
packages/fetch/package-lock.json
generated
43
packages/fetch/package-lock.json
generated
|
|
@ -9,7 +9,7 @@
|
|||
"version": "1.0.15",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@continuedev/config-types": "^1.0.5",
|
||||
"@continuedev/config-types": "file:../config-types",
|
||||
"follow-redirects": "^1.15.6",
|
||||
"http-proxy-agent": "^7.0.2",
|
||||
"https-proxy-agent": "^7.0.5",
|
||||
|
|
@ -17,17 +17,26 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@types/follow-redirects": "^1.14.4",
|
||||
"typescript": "^5.0.0",
|
||||
"vitest": "^3.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@continuedev/config-types": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/@continuedev/config-types/-/config-types-1.0.5.tgz",
|
||||
"integrity": "sha512-Uv3JWKmpgSo9cMhZb2hWoJgR2ezuAn3CenEziWT/5d7mddPLzvuuHgFX6aDjLVVMojS1ul0rpfAd2LGxEb6nDQ==",
|
||||
"../config-types": {
|
||||
"name": "@continuedev/config-types",
|
||||
"version": "1.0.14",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"zod": "^3.23.8"
|
||||
"zod": "^3.24.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.11.19",
|
||||
"typescript": "^5.5.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@continuedev/config-types": {
|
||||
"resolved": "../config-types",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@esbuild/aix-ppc64": {
|
||||
"version": "0.25.5",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.5.tgz",
|
||||
|
|
@ -1350,6 +1359,20 @@
|
|||
"node": ">=14.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/typescript": {
|
||||
"version": "5.8.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz",
|
||||
"integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
"tsserver": "bin/tsserver"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.17"
|
||||
}
|
||||
},
|
||||
"node_modules/undici-types": {
|
||||
"version": "5.26.5",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",
|
||||
|
|
@ -1585,14 +1608,6 @@
|
|||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/zod": {
|
||||
"version": "3.23.8",
|
||||
"resolved": "https://registry.npmjs.org/zod/-/zod-3.23.8.tgz",
|
||||
"integrity": "sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/colinhacks"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
"author": "Nate Sesti and Ty Dunn",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@continuedev/config-types": "^1.0.5",
|
||||
"@continuedev/config-types": "file:../config-types",
|
||||
"follow-redirects": "^1.15.6",
|
||||
"http-proxy-agent": "^7.0.2",
|
||||
"https-proxy-agent": "^7.0.5",
|
||||
|
|
@ -20,6 +20,7 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@types/follow-redirects": "^1.14.4",
|
||||
"typescript": "^5.0.0",
|
||||
"vitest": "^3.2.0"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ export const Gemini: ModelProvider = {
|
|||
contextLength: 1048576,
|
||||
maxCompletionTokens: 8192,
|
||||
mediaTypes: AllMediaTypes,
|
||||
regex: /gemini-2\.0-flash/i,
|
||||
regex: /^gemini-2\.0-flash$/i,
|
||||
recommendedFor: ["chat"],
|
||||
},
|
||||
{
|
||||
|
|
@ -54,7 +54,7 @@ export const Gemini: ModelProvider = {
|
|||
contextLength: 1048576,
|
||||
maxCompletionTokens: 8192,
|
||||
mediaTypes: AllMediaTypes,
|
||||
regex: /gemini-2\.0-flash-lite/i,
|
||||
regex: /^gemini-2\.0-flash-lite$/i,
|
||||
recommendedFor: ["chat"],
|
||||
},
|
||||
{
|
||||
|
|
@ -86,7 +86,7 @@ export const Gemini: ModelProvider = {
|
|||
contextLength: 1048576,
|
||||
maxCompletionTokens: 8192,
|
||||
mediaTypes: AllMediaTypes,
|
||||
regex: /gemini-2\.0-flash-exp/i,
|
||||
regex: /^gemini-2\.0-flash-exp$/i,
|
||||
recommendedFor: ["chat"],
|
||||
},
|
||||
{
|
||||
|
|
|
|||
502
packages/openai-adapters/package-lock.json
generated
502
packages/openai-adapters/package-lock.json
generated
|
|
@ -1,20 +1,21 @@
|
|||
{
|
||||
"name": "@continuedev/openai-adapters",
|
||||
"version": "1.0.46",
|
||||
"version": "1.1.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@continuedev/openai-adapters",
|
||||
"version": "1.0.46",
|
||||
"version": "1.1.1",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@aws-sdk/client-bedrock-runtime": "^3.842.0",
|
||||
"@aws-sdk/credential-providers": "^3.840.0",
|
||||
"@continuedev/config-types": "^1.0.5",
|
||||
"@continuedev/config-yaml": "^1.0.51",
|
||||
"@continuedev/fetch": "^1.0.15",
|
||||
"@continuedev/config-types": "file:../config-types",
|
||||
"@continuedev/config-yaml": "file:../config-yaml",
|
||||
"@continuedev/fetch": "file:../fetch",
|
||||
"dotenv": "^16.5.0",
|
||||
"google-auth-library": "^10.1.0",
|
||||
"json-schema": "^0.4.0",
|
||||
"node-fetch": "^3.3.2",
|
||||
"openai": "^4.104.0",
|
||||
|
|
@ -38,6 +39,65 @@
|
|||
"vitest": "^3.2.4"
|
||||
}
|
||||
},
|
||||
"../config-types": {
|
||||
"name": "@continuedev/config-types",
|
||||
"version": "1.0.14",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"zod": "^3.24.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.11.19",
|
||||
"typescript": "^5.5.2"
|
||||
}
|
||||
},
|
||||
"../config-yaml": {
|
||||
"name": "@continuedev/config-yaml",
|
||||
"version": "1.0.96",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@continuedev/config-types": "file:../config-types",
|
||||
"yaml": "^2.6.1",
|
||||
"zod": "^3.24.2"
|
||||
},
|
||||
"bin": {
|
||||
"config-yaml": "dist/cli.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@semantic-release/changelog": "^6.0.3",
|
||||
"@semantic-release/git": "^10.0.1",
|
||||
"@semantic-release/github": "^9.2.6",
|
||||
"@semantic-release/npm": "^10.0.6",
|
||||
"@types/jest": "^29.5.14",
|
||||
"@types/node": "^20.0.0",
|
||||
"cross-env": "^7.0.3",
|
||||
"jest": "^29.7.0",
|
||||
"semantic-release": "^21.1.2",
|
||||
"ts-jest": "^29.2.3",
|
||||
"ts-node": "^10.9.2",
|
||||
"zod-to-json-schema": "^3.24.5"
|
||||
}
|
||||
},
|
||||
"../fetch": {
|
||||
"name": "@continuedev/fetch",
|
||||
"version": "1.0.15",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@continuedev/config-types": "file:../config-types",
|
||||
"follow-redirects": "^1.15.6",
|
||||
"http-proxy-agent": "^7.0.2",
|
||||
"https-proxy-agent": "^7.0.5",
|
||||
"node-fetch": "^3.3.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/follow-redirects": "^1.14.4",
|
||||
"typescript": "^5.0.0",
|
||||
"vitest": "^3.2.0"
|
||||
}
|
||||
},
|
||||
"../packages/fetch": {
|
||||
"extraneous": true
|
||||
},
|
||||
"node_modules/@ampproject/remapping": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz",
|
||||
|
|
@ -1332,36 +1392,16 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@continuedev/config-types": {
|
||||
"version": "1.0.14",
|
||||
"resolved": "https://registry.npmjs.org/@continuedev/config-types/-/config-types-1.0.14.tgz",
|
||||
"integrity": "sha512-PVHyHPyRXd2QsaNgnCpiKYU3uHFTlyuQSkqE8OwrBmQqO6/TXUVIr/2EGtyIZGrml4Y+rGMSH40WU4/0t4SGpQ==",
|
||||
"dependencies": {
|
||||
"zod": "^3.23.8"
|
||||
}
|
||||
"resolved": "../config-types",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@continuedev/config-yaml": {
|
||||
"version": "1.0.68",
|
||||
"resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.0.68.tgz",
|
||||
"integrity": "sha512-rCegSGkv7Ws7LLnYVVGwXsoVZFpNFJnG6b1dVrj/u+2ZsFdA2leQUNtFGoeE/ixyfhUfBpMlgjEyPrmmy7gLjw==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@continuedev/config-types": "^1.0.14",
|
||||
"yaml": "^2.6.1",
|
||||
"zod": "^3.24.2"
|
||||
}
|
||||
"resolved": "../config-yaml",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@continuedev/fetch": {
|
||||
"version": "1.0.15",
|
||||
"resolved": "https://registry.npmjs.org/@continuedev/fetch/-/fetch-1.0.15.tgz",
|
||||
"integrity": "sha512-49jLwAwAOczcFLfa2Og9+c+qxrq+Z6+p+B5BbXgHENrQIsuST1liKTXEiga5gSVAyHD+m+1Ftl4jqRq2oxMngw==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@continuedev/config-types": "^1.0.5",
|
||||
"follow-redirects": "^1.15.6",
|
||||
"http-proxy-agent": "^7.0.2",
|
||||
"https-proxy-agent": "^7.0.5",
|
||||
"node-fetch": "^3.3.2"
|
||||
}
|
||||
"resolved": "../fetch",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@cspotcode/source-map-support": {
|
||||
"version": "0.8.1",
|
||||
|
|
@ -1386,9 +1426,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@esbuild/aix-ppc64": {
|
||||
"version": "0.25.6",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.6.tgz",
|
||||
"integrity": "sha512-ShbM/3XxwuxjFiuVBHA+d3j5dyac0aEVVq1oluIDf71hUw0aRF59dV/efUsIwFnR6m8JNM2FjZOzmaZ8yG61kw==",
|
||||
"version": "0.25.8",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.8.tgz",
|
||||
"integrity": "sha512-urAvrUedIqEiFR3FYSLTWQgLu5tb+m0qZw0NBEasUeo6wuqatkMDaRT+1uABiGXEu5vqgPd7FGE1BhsAIy9QVA==",
|
||||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
|
|
@ -1403,9 +1443,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@esbuild/android-arm": {
|
||||
"version": "0.25.6",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.6.tgz",
|
||||
"integrity": "sha512-S8ToEOVfg++AU/bHwdksHNnyLyVM+eMVAOf6yRKFitnwnbwwPNqKr3srzFRe7nzV69RQKb5DgchIX5pt3L53xg==",
|
||||
"version": "0.25.8",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.8.tgz",
|
||||
"integrity": "sha512-RONsAvGCz5oWyePVnLdZY/HHwA++nxYWIX1atInlaW6SEkwq6XkP3+cb825EUcRs5Vss/lGh/2YxAb5xqc07Uw==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
|
|
@ -1420,9 +1460,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@esbuild/android-arm64": {
|
||||
"version": "0.25.6",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.6.tgz",
|
||||
"integrity": "sha512-hd5zdUarsK6strW+3Wxi5qWws+rJhCCbMiC9QZyzoxfk5uHRIE8T287giQxzVpEvCwuJ9Qjg6bEjcRJcgfLqoA==",
|
||||
"version": "0.25.8",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.8.tgz",
|
||||
"integrity": "sha512-OD3p7LYzWpLhZEyATcTSJ67qB5D+20vbtr6vHlHWSQYhKtzUYrETuWThmzFpZtFsBIxRvhO07+UgVA9m0i/O1w==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
|
|
@ -1437,9 +1477,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@esbuild/android-x64": {
|
||||
"version": "0.25.6",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.6.tgz",
|
||||
"integrity": "sha512-0Z7KpHSr3VBIO9A/1wcT3NTy7EB4oNC4upJ5ye3R7taCc2GUdeynSLArnon5G8scPwaU866d3H4BCrE5xLW25A==",
|
||||
"version": "0.25.8",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.8.tgz",
|
||||
"integrity": "sha512-yJAVPklM5+4+9dTeKwHOaA+LQkmrKFX96BM0A/2zQrbS6ENCmxc4OVoBs5dPkCCak2roAD+jKCdnmOqKszPkjA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
|
|
@ -1454,9 +1494,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@esbuild/darwin-arm64": {
|
||||
"version": "0.25.6",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.6.tgz",
|
||||
"integrity": "sha512-FFCssz3XBavjxcFxKsGy2DYK5VSvJqa6y5HXljKzhRZ87LvEi13brPrf/wdyl/BbpbMKJNOr1Sd0jtW4Ge1pAA==",
|
||||
"version": "0.25.8",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.8.tgz",
|
||||
"integrity": "sha512-Jw0mxgIaYX6R8ODrdkLLPwBqHTtYHJSmzzd+QeytSugzQ0Vg4c5rDky5VgkoowbZQahCbsv1rT1KW72MPIkevw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
|
|
@ -1471,9 +1511,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@esbuild/darwin-x64": {
|
||||
"version": "0.25.6",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.6.tgz",
|
||||
"integrity": "sha512-GfXs5kry/TkGM2vKqK2oyiLFygJRqKVhawu3+DOCk7OxLy/6jYkWXhlHwOoTb0WqGnWGAS7sooxbZowy+pK9Yg==",
|
||||
"version": "0.25.8",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.8.tgz",
|
||||
"integrity": "sha512-Vh2gLxxHnuoQ+GjPNvDSDRpoBCUzY4Pu0kBqMBDlK4fuWbKgGtmDIeEC081xi26PPjn+1tct+Bh8FjyLlw1Zlg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
|
|
@ -1488,9 +1528,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@esbuild/freebsd-arm64": {
|
||||
"version": "0.25.6",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.6.tgz",
|
||||
"integrity": "sha512-aoLF2c3OvDn2XDTRvn8hN6DRzVVpDlj2B/F66clWd/FHLiHaG3aVZjxQX2DYphA5y/evbdGvC6Us13tvyt4pWg==",
|
||||
"version": "0.25.8",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.8.tgz",
|
||||
"integrity": "sha512-YPJ7hDQ9DnNe5vxOm6jaie9QsTwcKedPvizTVlqWG9GBSq+BuyWEDazlGaDTC5NGU4QJd666V0yqCBL2oWKPfA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
|
|
@ -1505,9 +1545,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@esbuild/freebsd-x64": {
|
||||
"version": "0.25.6",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.6.tgz",
|
||||
"integrity": "sha512-2SkqTjTSo2dYi/jzFbU9Plt1vk0+nNg8YC8rOXXea+iA3hfNJWebKYPs3xnOUf9+ZWhKAaxnQNUf2X9LOpeiMQ==",
|
||||
"version": "0.25.8",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.8.tgz",
|
||||
"integrity": "sha512-MmaEXxQRdXNFsRN/KcIimLnSJrk2r5H8v+WVafRWz5xdSVmWLoITZQXcgehI2ZE6gioE6HirAEToM/RvFBeuhw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
|
|
@ -1522,9 +1562,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-arm": {
|
||||
"version": "0.25.6",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.6.tgz",
|
||||
"integrity": "sha512-SZHQlzvqv4Du5PrKE2faN0qlbsaW/3QQfUUc6yO2EjFcA83xnwm91UbEEVx4ApZ9Z5oG8Bxz4qPE+HFwtVcfyw==",
|
||||
"version": "0.25.8",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.8.tgz",
|
||||
"integrity": "sha512-FuzEP9BixzZohl1kLf76KEVOsxtIBFwCaLupVuk4eFVnOZfU+Wsn+x5Ryam7nILV2pkq2TqQM9EZPsOBuMC+kg==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
|
|
@ -1539,9 +1579,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-arm64": {
|
||||
"version": "0.25.6",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.6.tgz",
|
||||
"integrity": "sha512-b967hU0gqKd9Drsh/UuAm21Khpoh6mPBSgz8mKRq4P5mVK8bpA+hQzmm/ZwGVULSNBzKdZPQBRT3+WuVavcWsQ==",
|
||||
"version": "0.25.8",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.8.tgz",
|
||||
"integrity": "sha512-WIgg00ARWv/uYLU7lsuDK00d/hHSfES5BzdWAdAig1ioV5kaFNrtK8EqGcUBJhYqotlUByUKz5Qo6u8tt7iD/w==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
|
|
@ -1556,9 +1596,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-ia32": {
|
||||
"version": "0.25.6",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.6.tgz",
|
||||
"integrity": "sha512-aHWdQ2AAltRkLPOsKdi3xv0mZ8fUGPdlKEjIEhxCPm5yKEThcUjHpWB1idN74lfXGnZ5SULQSgtr5Qos5B0bPw==",
|
||||
"version": "0.25.8",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.8.tgz",
|
||||
"integrity": "sha512-A1D9YzRX1i+1AJZuFFUMP1E9fMaYY+GnSQil9Tlw05utlE86EKTUA7RjwHDkEitmLYiFsRd9HwKBPEftNdBfjg==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
|
|
@ -1573,9 +1613,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-loong64": {
|
||||
"version": "0.25.6",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.6.tgz",
|
||||
"integrity": "sha512-VgKCsHdXRSQ7E1+QXGdRPlQ/e08bN6WMQb27/TMfV+vPjjTImuT9PmLXupRlC90S1JeNNW5lzkAEO/McKeJ2yg==",
|
||||
"version": "0.25.8",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.8.tgz",
|
||||
"integrity": "sha512-O7k1J/dwHkY1RMVvglFHl1HzutGEFFZ3kNiDMSOyUrB7WcoHGf96Sh+64nTRT26l3GMbCW01Ekh/ThKM5iI7hQ==",
|
||||
"cpu": [
|
||||
"loong64"
|
||||
],
|
||||
|
|
@ -1590,9 +1630,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-mips64el": {
|
||||
"version": "0.25.6",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.6.tgz",
|
||||
"integrity": "sha512-WViNlpivRKT9/py3kCmkHnn44GkGXVdXfdc4drNmRl15zVQ2+D2uFwdlGh6IuK5AAnGTo2qPB1Djppj+t78rzw==",
|
||||
"version": "0.25.8",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.8.tgz",
|
||||
"integrity": "sha512-uv+dqfRazte3BzfMp8PAQXmdGHQt2oC/y2ovwpTteqrMx2lwaksiFZ/bdkXJC19ttTvNXBuWH53zy/aTj1FgGw==",
|
||||
"cpu": [
|
||||
"mips64el"
|
||||
],
|
||||
|
|
@ -1607,9 +1647,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-ppc64": {
|
||||
"version": "0.25.6",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.6.tgz",
|
||||
"integrity": "sha512-wyYKZ9NTdmAMb5730I38lBqVu6cKl4ZfYXIs31Baf8aoOtB4xSGi3THmDYt4BTFHk7/EcVixkOV2uZfwU3Q2Jw==",
|
||||
"version": "0.25.8",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.8.tgz",
|
||||
"integrity": "sha512-GyG0KcMi1GBavP5JgAkkstMGyMholMDybAf8wF5A70CALlDM2p/f7YFE7H92eDeH/VBtFJA5MT4nRPDGg4JuzQ==",
|
||||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
|
|
@ -1624,9 +1664,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-riscv64": {
|
||||
"version": "0.25.6",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.6.tgz",
|
||||
"integrity": "sha512-KZh7bAGGcrinEj4qzilJ4hqTY3Dg2U82c8bv+e1xqNqZCrCyc+TL9AUEn5WGKDzm3CfC5RODE/qc96OcbIe33w==",
|
||||
"version": "0.25.8",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.8.tgz",
|
||||
"integrity": "sha512-rAqDYFv3yzMrq7GIcen3XP7TUEG/4LK86LUPMIz6RT8A6pRIDn0sDcvjudVZBiiTcZCY9y2SgYX2lgK3AF+1eg==",
|
||||
"cpu": [
|
||||
"riscv64"
|
||||
],
|
||||
|
|
@ -1641,9 +1681,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-s390x": {
|
||||
"version": "0.25.6",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.6.tgz",
|
||||
"integrity": "sha512-9N1LsTwAuE9oj6lHMyyAM+ucxGiVnEqUdp4v7IaMmrwb06ZTEVCIs3oPPplVsnjPfyjmxwHxHMF8b6vzUVAUGw==",
|
||||
"version": "0.25.8",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.8.tgz",
|
||||
"integrity": "sha512-Xutvh6VjlbcHpsIIbwY8GVRbwoviWT19tFhgdA7DlenLGC/mbc3lBoVb7jxj9Z+eyGqvcnSyIltYUrkKzWqSvg==",
|
||||
"cpu": [
|
||||
"s390x"
|
||||
],
|
||||
|
|
@ -1658,9 +1698,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-x64": {
|
||||
"version": "0.25.6",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.6.tgz",
|
||||
"integrity": "sha512-A6bJB41b4lKFWRKNrWoP2LHsjVzNiaurf7wyj/XtFNTsnPuxwEBWHLty+ZE0dWBKuSK1fvKgrKaNjBS7qbFKig==",
|
||||
"version": "0.25.8",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.8.tgz",
|
||||
"integrity": "sha512-ASFQhgY4ElXh3nDcOMTkQero4b1lgubskNlhIfJrsH5OKZXDpUAKBlNS0Kx81jwOBp+HCeZqmoJuihTv57/jvQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
|
|
@ -1675,9 +1715,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@esbuild/netbsd-arm64": {
|
||||
"version": "0.25.6",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.6.tgz",
|
||||
"integrity": "sha512-IjA+DcwoVpjEvyxZddDqBY+uJ2Snc6duLpjmkXm/v4xuS3H+3FkLZlDm9ZsAbF9rsfP3zeA0/ArNDORZgrxR/Q==",
|
||||
"version": "0.25.8",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.8.tgz",
|
||||
"integrity": "sha512-d1KfruIeohqAi6SA+gENMuObDbEjn22olAR7egqnkCD9DGBG0wsEARotkLgXDu6c4ncgWTZJtN5vcgxzWRMzcw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
|
|
@ -1692,9 +1732,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@esbuild/netbsd-x64": {
|
||||
"version": "0.25.6",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.6.tgz",
|
||||
"integrity": "sha512-dUXuZr5WenIDlMHdMkvDc1FAu4xdWixTCRgP7RQLBOkkGgwuuzaGSYcOpW4jFxzpzL1ejb8yF620UxAqnBrR9g==",
|
||||
"version": "0.25.8",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.8.tgz",
|
||||
"integrity": "sha512-nVDCkrvx2ua+XQNyfrujIG38+YGyuy2Ru9kKVNyh5jAys6n+l44tTtToqHjino2My8VAY6Lw9H7RI73XFi66Cg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
|
|
@ -1709,9 +1749,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@esbuild/openbsd-arm64": {
|
||||
"version": "0.25.6",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.6.tgz",
|
||||
"integrity": "sha512-l8ZCvXP0tbTJ3iaqdNf3pjaOSd5ex/e6/omLIQCVBLmHTlfXW3zAxQ4fnDmPLOB1x9xrcSi/xtCWFwCZRIaEwg==",
|
||||
"version": "0.25.8",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.8.tgz",
|
||||
"integrity": "sha512-j8HgrDuSJFAujkivSMSfPQSAa5Fxbvk4rgNAS5i3K+r8s1X0p1uOO2Hl2xNsGFppOeHOLAVgYwDVlmxhq5h+SQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
|
|
@ -1726,9 +1766,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@esbuild/openbsd-x64": {
|
||||
"version": "0.25.6",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.6.tgz",
|
||||
"integrity": "sha512-hKrmDa0aOFOr71KQ/19JC7az1P0GWtCN1t2ahYAf4O007DHZt/dW8ym5+CUdJhQ/qkZmI1HAF8KkJbEFtCL7gw==",
|
||||
"version": "0.25.8",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.8.tgz",
|
||||
"integrity": "sha512-1h8MUAwa0VhNCDp6Af0HToI2TJFAn1uqT9Al6DJVzdIBAd21m/G0Yfc77KDM3uF3T/YaOgQq3qTJHPbTOInaIQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
|
|
@ -1743,9 +1783,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@esbuild/openharmony-arm64": {
|
||||
"version": "0.25.6",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.6.tgz",
|
||||
"integrity": "sha512-+SqBcAWoB1fYKmpWoQP4pGtx+pUUC//RNYhFdbcSA16617cchuryuhOCRpPsjCblKukAckWsV+aQ3UKT/RMPcA==",
|
||||
"version": "0.25.8",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.8.tgz",
|
||||
"integrity": "sha512-r2nVa5SIK9tSWd0kJd9HCffnDHKchTGikb//9c7HX+r+wHYCpQrSgxhlY6KWV1nFo1l4KFbsMlHk+L6fekLsUg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
|
|
@ -1760,9 +1800,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@esbuild/sunos-x64": {
|
||||
"version": "0.25.6",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.6.tgz",
|
||||
"integrity": "sha512-dyCGxv1/Br7MiSC42qinGL8KkG4kX0pEsdb0+TKhmJZgCUDBGmyo1/ArCjNGiOLiIAgdbWgmWgib4HoCi5t7kA==",
|
||||
"version": "0.25.8",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.8.tgz",
|
||||
"integrity": "sha512-zUlaP2S12YhQ2UzUfcCuMDHQFJyKABkAjvO5YSndMiIkMimPmxA+BYSBikWgsRpvyxuRnow4nS5NPnf9fpv41w==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
|
|
@ -1777,9 +1817,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@esbuild/win32-arm64": {
|
||||
"version": "0.25.6",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.6.tgz",
|
||||
"integrity": "sha512-42QOgcZeZOvXfsCBJF5Afw73t4veOId//XD3i+/9gSkhSV6Gk3VPlWncctI+JcOyERv85FUo7RxuxGy+z8A43Q==",
|
||||
"version": "0.25.8",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.8.tgz",
|
||||
"integrity": "sha512-YEGFFWESlPva8hGL+zvj2z/SaK+pH0SwOM0Nc/d+rVnW7GSTFlLBGzZkuSU9kFIGIo8q9X3ucpZhu8PDN5A2sQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
|
|
@ -1794,9 +1834,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@esbuild/win32-ia32": {
|
||||
"version": "0.25.6",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.6.tgz",
|
||||
"integrity": "sha512-4AWhgXmDuYN7rJI6ORB+uU9DHLq/erBbuMoAuB4VWJTu5KtCgcKYPynF0YI1VkBNuEfjNlLrFr9KZPJzrtLkrQ==",
|
||||
"version": "0.25.8",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.8.tgz",
|
||||
"integrity": "sha512-hiGgGC6KZ5LZz58OL/+qVVoZiuZlUYlYHNAmczOm7bs2oE1XriPFi5ZHHrS8ACpV5EjySrnoCKmcbQMN+ojnHg==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
|
|
@ -1811,9 +1851,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@esbuild/win32-x64": {
|
||||
"version": "0.25.6",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.6.tgz",
|
||||
"integrity": "sha512-NgJPHHbEpLQgDH2MjQu90pzW/5vvXIZ7KOnPyNBm92A6WgZ/7b6fJyUBjoumLqeOQQGqY2QjQxRo97ah4Sj0cA==",
|
||||
"version": "0.25.8",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.8.tgz",
|
||||
"integrity": "sha512-cn3Yr7+OaaZq1c+2pe+8yxC8E144SReCQjN6/2ynubzYjvyqZjTXfQJpAcQpsdJq3My7XADANiYGHoFC69pLQw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
|
|
@ -3994,9 +4034,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "24.0.14",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.0.14.tgz",
|
||||
"integrity": "sha512-4zXMWD91vBLGRtHK3YbIoFMia+1nqEz72coM42C5ETjnNCa/heoj7NT1G67iAfOqMmcfhuCZ4uNpyz8EjlAejw==",
|
||||
"version": "24.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.1.0.tgz",
|
||||
"integrity": "sha512-ut5FthK5moxFKH2T1CUOC6ctR67rQRvvHdFLCD2Ql6KXmMuCrjsSsRI9UsLCm9M18BMwClv4pn327UvB7eeO1w==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"undici-types": "~7.8.0"
|
||||
|
|
@ -4458,12 +4498,41 @@
|
|||
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/base64-js": {
|
||||
"version": "1.5.1",
|
||||
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
|
||||
"integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/feross"
|
||||
},
|
||||
{
|
||||
"type": "patreon",
|
||||
"url": "https://www.patreon.com/feross"
|
||||
},
|
||||
{
|
||||
"type": "consulting",
|
||||
"url": "https://feross.org/support"
|
||||
}
|
||||
],
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/before-after-hook": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-4.0.0.tgz",
|
||||
"integrity": "sha512-q6tR3RPqIB1pMiTRMFcZwuG5T8vwp+vUvEG0vuI6B+Rikh5BfPp2fQ82c925FOs+b0lcFQ8CFrL+KbilfZFhOQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/bignumber.js": {
|
||||
"version": "9.3.1",
|
||||
"resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.3.1.tgz",
|
||||
"integrity": "sha512-Ko0uX15oIUS7wJ3Rb30Fs6SkVbLmPBAKdlm7q9+ak9bbIeFf0MwuBsQV6z7+X768/cHsfg+WlysDWJcmthjsjQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/bottleneck": {
|
||||
"version": "2.19.5",
|
||||
"resolved": "https://registry.npmjs.org/bottleneck/-/bottleneck-2.19.5.tgz",
|
||||
|
|
@ -4553,6 +4622,12 @@
|
|||
"node-int64": "^0.4.0"
|
||||
}
|
||||
},
|
||||
"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==",
|
||||
"license": "BSD-3-Clause"
|
||||
},
|
||||
"node_modules/buffer-from": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz",
|
||||
|
|
@ -5225,6 +5300,15 @@
|
|||
"readable-stream": "^2.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/ecdsa-sig-formatter": {
|
||||
"version": "1.0.11",
|
||||
"resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz",
|
||||
"integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"safe-buffer": "^5.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/ejs": {
|
||||
"version": "3.1.10",
|
||||
"resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz",
|
||||
|
|
@ -5457,9 +5541,9 @@
|
|||
"license": "MIT"
|
||||
},
|
||||
"node_modules/esbuild": {
|
||||
"version": "0.25.6",
|
||||
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.6.tgz",
|
||||
"integrity": "sha512-GVuzuUwtdsghE3ocJ9Bs8PNoF13HNQ5TXbEi2AhvVb8xU1Iwt9Fos9FEamfoee+u/TOsn7GUWc04lz46n2bbTg==",
|
||||
"version": "0.25.8",
|
||||
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.8.tgz",
|
||||
"integrity": "sha512-vVC0USHGtMi8+R4Kz8rt6JhEWLxsv9Rnu/lGYbPR8u47B+DCBksq9JarW0zOO7bs37hyOK1l2/oqtbciutL5+Q==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
|
|
@ -5470,32 +5554,32 @@
|
|||
"node": ">=18"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@esbuild/aix-ppc64": "0.25.6",
|
||||
"@esbuild/android-arm": "0.25.6",
|
||||
"@esbuild/android-arm64": "0.25.6",
|
||||
"@esbuild/android-x64": "0.25.6",
|
||||
"@esbuild/darwin-arm64": "0.25.6",
|
||||
"@esbuild/darwin-x64": "0.25.6",
|
||||
"@esbuild/freebsd-arm64": "0.25.6",
|
||||
"@esbuild/freebsd-x64": "0.25.6",
|
||||
"@esbuild/linux-arm": "0.25.6",
|
||||
"@esbuild/linux-arm64": "0.25.6",
|
||||
"@esbuild/linux-ia32": "0.25.6",
|
||||
"@esbuild/linux-loong64": "0.25.6",
|
||||
"@esbuild/linux-mips64el": "0.25.6",
|
||||
"@esbuild/linux-ppc64": "0.25.6",
|
||||
"@esbuild/linux-riscv64": "0.25.6",
|
||||
"@esbuild/linux-s390x": "0.25.6",
|
||||
"@esbuild/linux-x64": "0.25.6",
|
||||
"@esbuild/netbsd-arm64": "0.25.6",
|
||||
"@esbuild/netbsd-x64": "0.25.6",
|
||||
"@esbuild/openbsd-arm64": "0.25.6",
|
||||
"@esbuild/openbsd-x64": "0.25.6",
|
||||
"@esbuild/openharmony-arm64": "0.25.6",
|
||||
"@esbuild/sunos-x64": "0.25.6",
|
||||
"@esbuild/win32-arm64": "0.25.6",
|
||||
"@esbuild/win32-ia32": "0.25.6",
|
||||
"@esbuild/win32-x64": "0.25.6"
|
||||
"@esbuild/aix-ppc64": "0.25.8",
|
||||
"@esbuild/android-arm": "0.25.8",
|
||||
"@esbuild/android-arm64": "0.25.8",
|
||||
"@esbuild/android-x64": "0.25.8",
|
||||
"@esbuild/darwin-arm64": "0.25.8",
|
||||
"@esbuild/darwin-x64": "0.25.8",
|
||||
"@esbuild/freebsd-arm64": "0.25.8",
|
||||
"@esbuild/freebsd-x64": "0.25.8",
|
||||
"@esbuild/linux-arm": "0.25.8",
|
||||
"@esbuild/linux-arm64": "0.25.8",
|
||||
"@esbuild/linux-ia32": "0.25.8",
|
||||
"@esbuild/linux-loong64": "0.25.8",
|
||||
"@esbuild/linux-mips64el": "0.25.8",
|
||||
"@esbuild/linux-ppc64": "0.25.8",
|
||||
"@esbuild/linux-riscv64": "0.25.8",
|
||||
"@esbuild/linux-s390x": "0.25.8",
|
||||
"@esbuild/linux-x64": "0.25.8",
|
||||
"@esbuild/netbsd-arm64": "0.25.8",
|
||||
"@esbuild/netbsd-x64": "0.25.8",
|
||||
"@esbuild/openbsd-arm64": "0.25.8",
|
||||
"@esbuild/openbsd-x64": "0.25.8",
|
||||
"@esbuild/openharmony-arm64": "0.25.8",
|
||||
"@esbuild/sunos-x64": "0.25.8",
|
||||
"@esbuild/win32-arm64": "0.25.8",
|
||||
"@esbuild/win32-ia32": "0.25.8",
|
||||
"@esbuild/win32-x64": "0.25.8"
|
||||
}
|
||||
},
|
||||
"node_modules/escalade": {
|
||||
|
|
@ -5607,6 +5691,12 @@
|
|||
"node": ">=12.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/extend": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
|
||||
"integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/fast-content-type-parse": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fast-content-type-parse/-/fast-content-type-parse-3.0.0.tgz",
|
||||
|
|
@ -5807,25 +5897,6 @@
|
|||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/follow-redirects": {
|
||||
"version": "1.15.6",
|
||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz",
|
||||
"integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "individual",
|
||||
"url": "https://github.com/sponsors/RubenVerborgh"
|
||||
}
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=4.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"debug": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/form-data": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
|
||||
|
|
@ -5942,6 +6013,34 @@
|
|||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/gaxios": {
|
||||
"version": "7.1.1",
|
||||
"resolved": "https://registry.npmjs.org/gaxios/-/gaxios-7.1.1.tgz",
|
||||
"integrity": "sha512-Odju3uBUJyVCkW64nLD4wKLhbh93bh6vIg/ZIXkWiLPBrdgtc65+tls/qml+un3pr6JqYVFDZbbmLDQT68rTOQ==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"extend": "^3.0.2",
|
||||
"https-proxy-agent": "^7.0.1",
|
||||
"node-fetch": "^3.3.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/gcp-metadata": {
|
||||
"version": "7.0.1",
|
||||
"resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-7.0.1.tgz",
|
||||
"integrity": "sha512-UcO3kefx6dCcZkgcTGgVOTFb7b1LlQ02hY1omMjjrrBzkajRMCFgYOjs7J71WqnuG1k2b+9ppGL7FsOfhZMQKQ==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"gaxios": "^7.0.0",
|
||||
"google-logging-utils": "^1.0.0",
|
||||
"json-bigint": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/gensync": {
|
||||
"version": "1.0.0-beta.2",
|
||||
"resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz",
|
||||
|
|
@ -6085,12 +6184,52 @@
|
|||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/google-auth-library": {
|
||||
"version": "10.1.0",
|
||||
"resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-10.1.0.tgz",
|
||||
"integrity": "sha512-GspVjZj1RbyRWpQ9FbAXMKjFGzZwDKnUHi66JJ+tcjcu5/xYAP1pdlWotCuIkMwjfVsxxDvsGZXGLzRt72D0sQ==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"base64-js": "^1.3.0",
|
||||
"ecdsa-sig-formatter": "^1.0.11",
|
||||
"gaxios": "^7.0.0",
|
||||
"gcp-metadata": "^7.0.0",
|
||||
"google-logging-utils": "^1.0.0",
|
||||
"gtoken": "^8.0.0",
|
||||
"jws": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/google-logging-utils": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/google-logging-utils/-/google-logging-utils-1.1.1.tgz",
|
||||
"integrity": "sha512-rcX58I7nqpu4mbKztFeOAObbomBbHU2oIb/d3tJfF3dizGSApqtSwYJigGCooHdnMyQBIw8BrWyK96w3YXgr6A==",
|
||||
"license": "Apache-2.0",
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
}
|
||||
},
|
||||
"node_modules/graceful-fs": {
|
||||
"version": "4.2.11",
|
||||
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",
|
||||
"integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/gtoken": {
|
||||
"version": "8.0.0",
|
||||
"resolved": "https://registry.npmjs.org/gtoken/-/gtoken-8.0.0.tgz",
|
||||
"integrity": "sha512-+CqsMbHPiSTdtSO14O51eMNlrp9N79gmeqmXeouJOhfucAedHw9noVe/n5uJk3tbKE6a+6ZCQg3RPhVhHByAIw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"gaxios": "^7.0.0",
|
||||
"jws": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/handlebars": {
|
||||
"version": "4.7.8",
|
||||
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz",
|
||||
|
|
@ -6184,6 +6323,7 @@
|
|||
"version": "7.0.2",
|
||||
"resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz",
|
||||
"integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"agent-base": "^7.1.0",
|
||||
"debug": "^4.3.4"
|
||||
|
|
@ -7248,6 +7388,15 @@
|
|||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/json-bigint": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz",
|
||||
"integrity": "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"bignumber.js": "^9.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/json-parse-better-errors": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz",
|
||||
|
|
@ -7289,6 +7438,27 @@
|
|||
"graceful-fs": "^4.1.6"
|
||||
}
|
||||
},
|
||||
"node_modules/jwa": {
|
||||
"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",
|
||||
"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==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"jwa": "^2.0.0",
|
||||
"safe-buffer": "^5.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/kleur": {
|
||||
"version": "3.0.3",
|
||||
"resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz",
|
||||
|
|
@ -10596,9 +10766,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/openai/node_modules/@types/node": {
|
||||
"version": "18.19.119",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.119.tgz",
|
||||
"integrity": "sha512-d0F6m9itIPaKnrvEMlzE48UjwZaAnFW7Jwibacw9MNdqadjKNpUm9tfJYDwmShJmgqcoqYUX3EMKO1+RWiuuNg==",
|
||||
"version": "18.19.120",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.120.tgz",
|
||||
"integrity": "sha512-WtCGHFXnVI8WHLxDAt5TbnCM4eSE+nI0QN2NJtwzcgMhht2eNz6V9evJrk+lwC8bCY8OWV5Ym8Jz7ZEyGnKnMA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"undici-types": "~5.26.4"
|
||||
|
|
@ -11414,8 +11584,7 @@
|
|||
"node_modules/safe-buffer": {
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
|
||||
"dev": true
|
||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
|
||||
},
|
||||
"node_modules/semantic-release": {
|
||||
"version": "24.2.7",
|
||||
|
|
@ -13062,6 +13231,9 @@
|
|||
"version": "2.7.0",
|
||||
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.0.tgz",
|
||||
"integrity": "sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"peer": true,
|
||||
"bin": {
|
||||
"yaml": "bin.mjs"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@continuedev/openai-adapters",
|
||||
"version": "1.0.46",
|
||||
"version": "1.1.1",
|
||||
"description": "",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
|
|
@ -14,10 +14,11 @@
|
|||
"dependencies": {
|
||||
"@aws-sdk/client-bedrock-runtime": "^3.842.0",
|
||||
"@aws-sdk/credential-providers": "^3.840.0",
|
||||
"@continuedev/config-types": "^1.0.5",
|
||||
"@continuedev/config-yaml": "^1.0.51",
|
||||
"@continuedev/fetch": "^1.0.15",
|
||||
"@continuedev/config-types": "file:../config-types",
|
||||
"@continuedev/config-yaml": "file:../config-yaml",
|
||||
"@continuedev/fetch": "file:../fetch",
|
||||
"dotenv": "^16.5.0",
|
||||
"google-auth-library": "^10.1.0",
|
||||
"json-schema": "^0.4.0",
|
||||
"node-fetch": "^3.3.2",
|
||||
"openai": "^4.104.0",
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ export class AnthropicApi implements BaseLlmApi {
|
|||
return cachingStrategy(cleanBody);
|
||||
}
|
||||
|
||||
private _convertToCleanAnthropicBody(oaiBody: ChatCompletionCreateParams) {
|
||||
public _convertToCleanAnthropicBody(oaiBody: ChatCompletionCreateParams) {
|
||||
let stop = undefined;
|
||||
if (oaiBody.stop && Array.isArray(oaiBody.stop)) {
|
||||
stop = oaiBody.stop.filter((x) => x.trim() !== "");
|
||||
|
|
@ -219,27 +219,9 @@ export class AnthropicApi implements BaseLlmApi {
|
|||
],
|
||||
};
|
||||
}
|
||||
async *chatCompletionStream(
|
||||
body: ChatCompletionCreateParamsStreaming,
|
||||
signal: AbortSignal,
|
||||
): AsyncGenerator<ChatCompletionChunk, any, unknown> {
|
||||
body.messages;
|
||||
const response = await customFetch(this.config.requestOptions)(
|
||||
new URL("messages", this.apiBase),
|
||||
{
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
Accept: "application/json",
|
||||
"anthropic-version": "2023-06-01",
|
||||
"anthropic-beta": "prompt-caching-2024-07-31",
|
||||
"x-api-key": this.config.apiKey,
|
||||
},
|
||||
body: JSON.stringify(this._convertBody(body)),
|
||||
signal,
|
||||
},
|
||||
);
|
||||
|
||||
// This is split off so e.g. VertexAI can use it
|
||||
async *handleStreamResponse(response: any, model: string) {
|
||||
let lastToolUseId: string | undefined;
|
||||
let lastToolUseName: string | undefined;
|
||||
|
||||
|
|
@ -272,7 +254,7 @@ export class AnthropicApi implements BaseLlmApi {
|
|||
case "text_delta":
|
||||
yield chatChunk({
|
||||
content: value.delta.text,
|
||||
model: body.model,
|
||||
model,
|
||||
});
|
||||
break;
|
||||
case "input_json_delta":
|
||||
|
|
@ -280,7 +262,7 @@ export class AnthropicApi implements BaseLlmApi {
|
|||
throw new Error("No tool use found");
|
||||
}
|
||||
yield chatChunkFromDelta({
|
||||
model: body.model,
|
||||
model,
|
||||
delta: {
|
||||
tool_calls: [
|
||||
{
|
||||
|
|
@ -308,13 +290,36 @@ export class AnthropicApi implements BaseLlmApi {
|
|||
}
|
||||
|
||||
yield usageChatChunk({
|
||||
model: body.model,
|
||||
model,
|
||||
usage: {
|
||||
...usage,
|
||||
total_tokens: usage.completion_tokens + usage.prompt_tokens,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
async *chatCompletionStream(
|
||||
body: ChatCompletionCreateParamsStreaming,
|
||||
signal: AbortSignal,
|
||||
): AsyncGenerator<ChatCompletionChunk, any, unknown> {
|
||||
body.messages;
|
||||
const response = await customFetch(this.config.requestOptions)(
|
||||
new URL("messages", this.apiBase),
|
||||
{
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
Accept: "application/json",
|
||||
"anthropic-version": "2023-06-01",
|
||||
"anthropic-beta": "prompt-caching-2024-07-31",
|
||||
"x-api-key": this.config.apiKey,
|
||||
},
|
||||
body: JSON.stringify(this._convertBody(body)),
|
||||
signal,
|
||||
},
|
||||
);
|
||||
yield* this.handleStreamResponse(response, body.model);
|
||||
}
|
||||
async completionNonStream(
|
||||
body: CompletionCreateParamsNonStreaming,
|
||||
signal: AbortSignal,
|
||||
|
|
|
|||
|
|
@ -84,7 +84,12 @@ export class GeminiApi implements BaseLlmApi {
|
|||
}
|
||||
}
|
||||
|
||||
private _convertBody(oaiBody: ChatCompletionCreateParams, url: string) {
|
||||
public _convertBody(
|
||||
oaiBody: ChatCompletionCreateParams,
|
||||
url: string,
|
||||
includeToolCallIds: boolean,
|
||||
overrideIsV1?: boolean,
|
||||
) {
|
||||
const generationConfig: any = {};
|
||||
|
||||
if (oaiBody.top_p) {
|
||||
|
|
@ -101,7 +106,7 @@ export class GeminiApi implements BaseLlmApi {
|
|||
generationConfig.stopSequences = stop.filter((x) => x.trim() !== "");
|
||||
}
|
||||
|
||||
const isV1API = url.includes("/v1/");
|
||||
const isV1API = overrideIsV1 ?? url.includes("/v1/");
|
||||
|
||||
const toolCallIdToNameMap = new Map<string, string>();
|
||||
oaiBody.messages.forEach((msg) => {
|
||||
|
|
@ -127,7 +132,7 @@ export class GeminiApi implements BaseLlmApi {
|
|||
role: "model" as const,
|
||||
parts: msg.tool_calls.map((toolCall) => ({
|
||||
functionCall: {
|
||||
id: toolCall.id,
|
||||
id: includeToolCallIds ? toolCall.id : undefined,
|
||||
name: toolCall.function.name,
|
||||
args: safeParseArgs(
|
||||
toolCall.function.arguments,
|
||||
|
|
@ -145,7 +150,7 @@ export class GeminiApi implements BaseLlmApi {
|
|||
parts: [
|
||||
{
|
||||
functionResponse: {
|
||||
id: msg.tool_call_id,
|
||||
id: includeToolCallIds ? msg.tool_call_id : undefined,
|
||||
name: functionName ?? "unknown",
|
||||
response: {
|
||||
content:
|
||||
|
|
@ -250,23 +255,9 @@ export class GeminiApi implements BaseLlmApi {
|
|||
};
|
||||
}
|
||||
|
||||
async *chatCompletionStream(
|
||||
body: ChatCompletionCreateParamsStreaming,
|
||||
signal: AbortSignal,
|
||||
): AsyncGenerator<ChatCompletionChunk> {
|
||||
const apiURL = new URL(
|
||||
`models/${body.model}:streamGenerateContent?key=${this.config.apiKey}`,
|
||||
this.apiBase,
|
||||
).toString();
|
||||
const convertedBody = this._convertBody(body, apiURL);
|
||||
const resp = await customFetch(this.config.requestOptions)(apiURL, {
|
||||
method: "POST",
|
||||
body: JSON.stringify(convertedBody),
|
||||
signal,
|
||||
});
|
||||
|
||||
async *handleStreamResponse(response: any, model: string) {
|
||||
let buffer = "";
|
||||
for await (const chunk of streamResponse(resp as any)) {
|
||||
for await (const chunk of streamResponse(response as any)) {
|
||||
buffer += chunk;
|
||||
if (buffer.startsWith("[")) {
|
||||
buffer = buffer.slice(1);
|
||||
|
|
@ -301,11 +292,11 @@ export class GeminiApi implements BaseLlmApi {
|
|||
if ("text" in part) {
|
||||
yield chatChunk({
|
||||
content: part.text,
|
||||
model: body.model,
|
||||
model,
|
||||
});
|
||||
} else if ("functionCall" in part) {
|
||||
yield chatChunkFromDelta({
|
||||
model: body.model,
|
||||
model,
|
||||
delta: {
|
||||
tool_calls: [
|
||||
{
|
||||
|
|
@ -333,6 +324,23 @@ export class GeminiApi implements BaseLlmApi {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
async *chatCompletionStream(
|
||||
body: ChatCompletionCreateParamsStreaming,
|
||||
signal: AbortSignal,
|
||||
): AsyncGenerator<ChatCompletionChunk> {
|
||||
const apiURL = new URL(
|
||||
`models/${body.model}:streamGenerateContent?key=${this.config.apiKey}`,
|
||||
this.apiBase,
|
||||
).toString();
|
||||
const convertedBody = this._convertBody(body, apiURL, true);
|
||||
const resp = await customFetch(this.config.requestOptions)(apiURL, {
|
||||
method: "POST",
|
||||
body: JSON.stringify(convertedBody),
|
||||
signal,
|
||||
});
|
||||
yield* this.handleStreamResponse(resp, body.model);
|
||||
}
|
||||
completionNonStream(
|
||||
body: CompletionCreateParamsNonStreaming,
|
||||
): Promise<Completion> {
|
||||
|
|
|
|||
569
packages/openai-adapters/src/apis/VertexAI.ts
Normal file
569
packages/openai-adapters/src/apis/VertexAI.ts
Normal file
|
|
@ -0,0 +1,569 @@
|
|||
import { streamSse } from "@continuedev/fetch";
|
||||
import { AuthClient, GoogleAuth, JWT, auth } from "google-auth-library";
|
||||
import {
|
||||
ChatCompletion,
|
||||
ChatCompletionChunk,
|
||||
ChatCompletionCreateParams,
|
||||
ChatCompletionCreateParamsNonStreaming,
|
||||
ChatCompletionCreateParamsStreaming,
|
||||
Completion,
|
||||
CompletionCreateParamsNonStreaming,
|
||||
CompletionCreateParamsStreaming,
|
||||
CreateEmbeddingResponse,
|
||||
EmbeddingCreateParams,
|
||||
Model,
|
||||
} from "openai/resources/index";
|
||||
import { VertexAIConfig } from "../types.js";
|
||||
import { chatChunk, chatCompletion, customFetch, embedding } from "../util.js";
|
||||
import { AnthropicApi } from "./Anthropic.js";
|
||||
import {
|
||||
BaseLlmApi,
|
||||
CreateRerankResponse,
|
||||
FimCreateParamsStreaming,
|
||||
RerankCreateParams,
|
||||
} from "./base.js";
|
||||
import { GeminiApi } from "./Gemini.js";
|
||||
import { OpenAIApi } from "./OpenAI.js";
|
||||
|
||||
export class VertexAIApi implements BaseLlmApi {
|
||||
anthropicInstance: AnthropicApi;
|
||||
geminiInstance: GeminiApi;
|
||||
mistralInstance: OpenAIApi;
|
||||
private clientPromise?: Promise<AuthClient | void>;
|
||||
static AUTH_SCOPES = "https://www.googleapis.com/auth/cloud-platform";
|
||||
|
||||
constructor(protected config: VertexAIConfig) {
|
||||
this.setupAuthentication();
|
||||
|
||||
// These sub-instances are only used to convert and handle responses,
|
||||
// So do not need apiKey, etc
|
||||
this.anthropicInstance = new AnthropicApi({
|
||||
provider: "anthropic",
|
||||
apiKey: "dud",
|
||||
});
|
||||
this.geminiInstance = new GeminiApi({
|
||||
provider: "gemini",
|
||||
apiKey: "dud",
|
||||
});
|
||||
this.mistralInstance = new OpenAIApi({
|
||||
provider: "mistral",
|
||||
apiKey: "dud",
|
||||
});
|
||||
}
|
||||
|
||||
private setupAuthentication(): void {
|
||||
const { apiKey, env } = this.config;
|
||||
const { region, projectId, keyFile, keyJson } = env || {};
|
||||
|
||||
// Validate authentication configuration
|
||||
if (apiKey) {
|
||||
// Express mode validation
|
||||
if (region || projectId || keyFile || keyJson) {
|
||||
throw new Error(
|
||||
"VertexAI in express mode (apiKey only) cannot be configured with region, projectId, keyFile, or keyJson",
|
||||
);
|
||||
}
|
||||
} else {
|
||||
// Standard mode validation
|
||||
if (!region || !projectId) {
|
||||
throw new Error(
|
||||
"region and projectId are required for VertexAI (when not using express/apiKey mode)",
|
||||
);
|
||||
}
|
||||
if (keyFile && keyJson) {
|
||||
throw new Error(
|
||||
"VertexAI credentials can be configured with either keyFile or keyJson but not both",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Set up authentication client
|
||||
if (keyJson) {
|
||||
try {
|
||||
const parsed = JSON.parse(keyJson);
|
||||
if (!parsed?.private_key) {
|
||||
throw new Error("VertexAI: keyJson must contain a valid private key");
|
||||
}
|
||||
parsed.private_key = parsed.private_key.replace(/\\n/g, "\n");
|
||||
const jsonClient = auth.fromJSON(parsed);
|
||||
if (jsonClient instanceof JWT) {
|
||||
jsonClient.scopes = [VertexAIApi.AUTH_SCOPES];
|
||||
} else {
|
||||
throw new Error("VertexAI: keyJson must be a valid JWT");
|
||||
}
|
||||
this.clientPromise = Promise.resolve(jsonClient);
|
||||
} catch (e) {
|
||||
throw new Error("VertexAI: Failed to parse keyJson");
|
||||
}
|
||||
} else if (keyFile) {
|
||||
if (typeof keyFile !== "string") {
|
||||
throw new Error("VertexAI: keyFile must be a string");
|
||||
}
|
||||
this.clientPromise = new GoogleAuth({
|
||||
scopes: VertexAIApi.AUTH_SCOPES,
|
||||
keyFile,
|
||||
})
|
||||
.getClient()
|
||||
.catch((e: Error) => {
|
||||
console.warn(
|
||||
`Failed to load credentials for Vertex AI: ${e.message}`,
|
||||
);
|
||||
});
|
||||
} else if (!apiKey) {
|
||||
// Application Default Credentials
|
||||
this.clientPromise = new GoogleAuth({
|
||||
scopes: VertexAIApi.AUTH_SCOPES,
|
||||
})
|
||||
.getClient()
|
||||
.catch((e: Error) => {
|
||||
console.warn(
|
||||
`Failed to load credentials for Vertex AI: ${e.message}`,
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private getApiBase(): string {
|
||||
const { apiKey, env } = this.config;
|
||||
|
||||
if (this.config.apiBase) {
|
||||
return this.config.apiBase;
|
||||
}
|
||||
|
||||
if (apiKey) {
|
||||
// Express mode
|
||||
return "https://aiplatform.googleapis.com/v1/";
|
||||
} else {
|
||||
// Standard mode
|
||||
const { region, projectId } = env!;
|
||||
return `https://${region}-aiplatform.googleapis.com/v1/projects/${projectId}/locations/${region}/`;
|
||||
}
|
||||
}
|
||||
|
||||
private determineVertexProvider(
|
||||
model: string,
|
||||
): "mistral" | "anthropic" | "gemini" | "unknown" {
|
||||
if (
|
||||
model.includes("mistral") ||
|
||||
model.includes("codestral") ||
|
||||
model.includes("mixtral")
|
||||
) {
|
||||
return "mistral";
|
||||
} else if (model.includes("claude")) {
|
||||
return "anthropic";
|
||||
} else if (model.includes("gemini")) {
|
||||
return "gemini";
|
||||
}
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
private async getAuthHeaders(): Promise<Record<string, string>> {
|
||||
const headers: Record<string, string> = {
|
||||
"Content-Type": "application/json",
|
||||
// Accept: "application/json"
|
||||
};
|
||||
|
||||
// TODO - support anthropic prompt caching with "anthropic-beta" header
|
||||
|
||||
if (this.config.apiKey) {
|
||||
// Express mode - no Authorization header needed, API key is in URL
|
||||
return headers;
|
||||
} else {
|
||||
// Standard mode - use OAuth token
|
||||
const client = await this.clientPromise;
|
||||
const result = await client?.getAccessToken();
|
||||
if (!result?.token) {
|
||||
throw new Error(
|
||||
"Could not get an access token. Set up your Google Application Default Credentials.",
|
||||
);
|
||||
}
|
||||
headers.Authorization = `Bearer ${result.token}`;
|
||||
return headers;
|
||||
}
|
||||
}
|
||||
|
||||
private buildUrl(endpoint: string, model?: string): URL {
|
||||
const apiBase = this.getApiBase();
|
||||
const url = new URL(endpoint, apiBase);
|
||||
|
||||
if (this.config.apiKey) {
|
||||
url.searchParams.set("key", this.config.apiKey);
|
||||
}
|
||||
|
||||
return url;
|
||||
}
|
||||
|
||||
private convertAnthropicBody(oaiBody: ChatCompletionCreateParams): object {
|
||||
const body = this.anthropicInstance._convertToCleanAnthropicBody(oaiBody);
|
||||
const { model, ...exceptModel } = body;
|
||||
return {
|
||||
...exceptModel,
|
||||
anthropic_version: "vertex-2023-10-16",
|
||||
};
|
||||
}
|
||||
|
||||
private convertGeminiBody(
|
||||
oaiBody: ChatCompletionCreateParams,
|
||||
url: URL,
|
||||
): object {
|
||||
return this.geminiInstance._convertBody(
|
||||
oaiBody,
|
||||
url.toString(),
|
||||
false,
|
||||
false,
|
||||
);
|
||||
}
|
||||
|
||||
async chatCompletionNonStream(
|
||||
body: ChatCompletionCreateParamsNonStreaming,
|
||||
signal: AbortSignal,
|
||||
): Promise<ChatCompletion> {
|
||||
const vertexProvider = this.determineVertexProvider(body.model);
|
||||
|
||||
if (this.config.apiKey && vertexProvider !== "gemini") {
|
||||
throw new Error(
|
||||
"VertexAI: only gemini models are supported in express (apiKey) mode",
|
||||
);
|
||||
}
|
||||
|
||||
const headers = await this.getAuthHeaders();
|
||||
let url: URL;
|
||||
let requestBody: any;
|
||||
|
||||
switch (vertexProvider) {
|
||||
case "anthropic":
|
||||
url = this.buildUrl(
|
||||
`publishers/anthropic/models/${body.model}:rawPredict`,
|
||||
);
|
||||
requestBody = this.convertAnthropicBody(body);
|
||||
break;
|
||||
case "gemini":
|
||||
url = this.buildUrl(
|
||||
`publishers/google/models/${body.model}:generateContent`,
|
||||
);
|
||||
requestBody = this.convertGeminiBody(body, url);
|
||||
break;
|
||||
case "mistral":
|
||||
url = this.buildUrl(
|
||||
`publishers/mistralai/models/${body.model}:rawPredict`,
|
||||
);
|
||||
requestBody = body;
|
||||
break;
|
||||
default:
|
||||
throw new Error(`Unsupported model: ${body.model}`);
|
||||
}
|
||||
|
||||
const response = await customFetch(this.config.requestOptions)(
|
||||
url.toString(),
|
||||
{
|
||||
method: "POST",
|
||||
headers,
|
||||
body: JSON.stringify(requestBody),
|
||||
signal,
|
||||
},
|
||||
);
|
||||
|
||||
const data = await response.json();
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(
|
||||
`VertexAI API error: ${response.status} ${response.statusText}\n${JSON.stringify(data)}`,
|
||||
);
|
||||
}
|
||||
|
||||
// Convert response to OpenAI format
|
||||
switch (vertexProvider) {
|
||||
case "anthropic":
|
||||
return chatCompletion({
|
||||
content: data.content?.[0]?.text || "",
|
||||
model: body.model,
|
||||
});
|
||||
case "gemini":
|
||||
return chatCompletion({
|
||||
content: data.candidates?.[0]?.content?.parts?.[0]?.text || "",
|
||||
model: body.model,
|
||||
});
|
||||
case "mistral":
|
||||
return chatCompletion({
|
||||
content: data.choices?.[0]?.message?.content || "",
|
||||
model: body.model,
|
||||
});
|
||||
default:
|
||||
throw new Error(`Unsupported provider: ${vertexProvider}`);
|
||||
}
|
||||
}
|
||||
|
||||
async *chatCompletionStream(
|
||||
body: ChatCompletionCreateParamsStreaming,
|
||||
signal: AbortSignal,
|
||||
): AsyncGenerator<ChatCompletionChunk> {
|
||||
const vertexProvider = this.determineVertexProvider(body.model);
|
||||
|
||||
if (this.config.apiKey && vertexProvider !== "gemini") {
|
||||
throw new Error(
|
||||
"VertexAI: only gemini models are supported in express (apiKey) mode",
|
||||
);
|
||||
}
|
||||
|
||||
const headers = await this.getAuthHeaders();
|
||||
let url: URL;
|
||||
let requestBody: any;
|
||||
|
||||
switch (vertexProvider) {
|
||||
case "anthropic":
|
||||
url = this.buildUrl(
|
||||
`publishers/anthropic/models/${body.model}:streamRawPredict`,
|
||||
);
|
||||
requestBody = this.convertAnthropicBody(body);
|
||||
break;
|
||||
case "gemini":
|
||||
url = this.buildUrl(
|
||||
`publishers/google/models/${body.model}:streamGenerateContent`,
|
||||
);
|
||||
requestBody = this.convertGeminiBody(body, url);
|
||||
break;
|
||||
case "mistral":
|
||||
url = this.buildUrl(
|
||||
`publishers/mistralai/models/${body.model}:streamRawPredict`,
|
||||
);
|
||||
requestBody = body;
|
||||
break;
|
||||
default:
|
||||
throw new Error(`Unsupported model: ${body.model}`);
|
||||
}
|
||||
|
||||
switch (vertexProvider) {
|
||||
case "mistral":
|
||||
const mistralResponse =
|
||||
await this.mistralInstance.openai.chat.completions.create(
|
||||
this.mistralInstance.modifyChatBody(body),
|
||||
{
|
||||
signal,
|
||||
headers,
|
||||
},
|
||||
);
|
||||
for await (const result of mistralResponse) {
|
||||
yield result;
|
||||
}
|
||||
break;
|
||||
case "anthropic":
|
||||
case "gemini":
|
||||
const response = await customFetch(this.config.requestOptions)(
|
||||
url.toString(),
|
||||
{
|
||||
method: "POST",
|
||||
headers,
|
||||
body: JSON.stringify(requestBody),
|
||||
signal,
|
||||
},
|
||||
);
|
||||
|
||||
if (!response.ok) {
|
||||
const data = await response.json();
|
||||
throw new Error(
|
||||
`VertexAI API error: ${response.status} ${response.statusText}\n${JSON.stringify(data)}`,
|
||||
);
|
||||
}
|
||||
|
||||
if (response.status === 499) {
|
||||
return; // Aborted by user
|
||||
}
|
||||
if (vertexProvider === "gemini") {
|
||||
yield* this.geminiInstance.handleStreamResponse(response, body.model);
|
||||
} else {
|
||||
yield* this.anthropicInstance.handleStreamResponse(
|
||||
response,
|
||||
body.model,
|
||||
);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
async completionNonStream(
|
||||
body: CompletionCreateParamsNonStreaming,
|
||||
signal: AbortSignal,
|
||||
): Promise<Completion> {
|
||||
// Convert completion to chat completion and back
|
||||
const promptText =
|
||||
typeof body.prompt === "string"
|
||||
? body.prompt
|
||||
: Array.isArray(body.prompt)
|
||||
? body.prompt.join("")
|
||||
: "";
|
||||
|
||||
const chatBody: ChatCompletionCreateParamsNonStreaming = {
|
||||
model: body.model,
|
||||
messages: [{ role: "user", content: promptText }],
|
||||
max_tokens: body.max_tokens,
|
||||
temperature: body.temperature,
|
||||
top_p: body.top_p,
|
||||
stop: body.stop,
|
||||
stream: false,
|
||||
};
|
||||
|
||||
const chatResponse = await this.chatCompletionNonStream(chatBody, signal);
|
||||
|
||||
return {
|
||||
id: chatResponse.id,
|
||||
object: "text_completion",
|
||||
created: chatResponse.created,
|
||||
model: chatResponse.model,
|
||||
choices: [
|
||||
{
|
||||
text: chatResponse.choices[0]?.message?.content || "",
|
||||
index: 0,
|
||||
logprobs: null,
|
||||
finish_reason: chatResponse.choices[0]?.finish_reason || null,
|
||||
},
|
||||
],
|
||||
usage: chatResponse.usage,
|
||||
} as Completion;
|
||||
}
|
||||
|
||||
async *completionStream(
|
||||
body: CompletionCreateParamsStreaming,
|
||||
signal: AbortSignal,
|
||||
): AsyncGenerator<Completion> {
|
||||
// Convert completion to chat completion and back
|
||||
const promptText =
|
||||
typeof body.prompt === "string"
|
||||
? body.prompt
|
||||
: Array.isArray(body.prompt)
|
||||
? body.prompt.join("")
|
||||
: "";
|
||||
|
||||
const chatBody: ChatCompletionCreateParamsStreaming = {
|
||||
model: body.model,
|
||||
messages: [{ role: "user", content: promptText }],
|
||||
max_tokens: body.max_tokens,
|
||||
temperature: body.temperature,
|
||||
top_p: body.top_p,
|
||||
stop: body.stop,
|
||||
stream: true,
|
||||
};
|
||||
|
||||
for await (const chatChunk of this.chatCompletionStream(chatBody, signal)) {
|
||||
yield {
|
||||
id: chatChunk.id,
|
||||
object: "text_completion",
|
||||
created: chatChunk.created,
|
||||
model: chatChunk.model,
|
||||
choices: [
|
||||
{
|
||||
text: chatChunk.choices[0]?.delta?.content || "",
|
||||
index: 0,
|
||||
logprobs: null,
|
||||
finish_reason: chatChunk.choices[0]?.finish_reason || null,
|
||||
},
|
||||
],
|
||||
} as Completion;
|
||||
}
|
||||
}
|
||||
|
||||
async *fimStream(
|
||||
body: FimCreateParamsStreaming,
|
||||
signal: AbortSignal,
|
||||
): AsyncGenerator<ChatCompletionChunk> {
|
||||
// Only Codestral (Mistral) supports FIM in VertexAI
|
||||
if (!body.model.includes("codestral")) {
|
||||
throw new Error(
|
||||
`FIM is only supported for Codestral models, got: ${body.model}`,
|
||||
);
|
||||
}
|
||||
|
||||
const headers = await this.getAuthHeaders();
|
||||
const url = this.buildUrl(
|
||||
`publishers/mistralai/models/${body.model}:streamRawPredict`,
|
||||
);
|
||||
|
||||
const requestBody = {
|
||||
model: body.model,
|
||||
max_tokens: body.max_tokens,
|
||||
temperature: body.temperature,
|
||||
top_p: body.top_p,
|
||||
stream: body.stream ?? true,
|
||||
stop: body.stop,
|
||||
prompt: body.prompt,
|
||||
suffix: body.suffix,
|
||||
};
|
||||
|
||||
const response = await customFetch(this.config.requestOptions)(
|
||||
url.toString(),
|
||||
{
|
||||
method: "POST",
|
||||
headers,
|
||||
body: JSON.stringify(requestBody),
|
||||
signal,
|
||||
},
|
||||
);
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(
|
||||
`VertexAI API error: ${response.status} ${response.statusText}`,
|
||||
);
|
||||
}
|
||||
|
||||
for await (const chunk of streamSse(response)) {
|
||||
if (chunk.choices?.[0]?.delta?.content) {
|
||||
yield chatChunk({
|
||||
content: chunk.choices[0].delta.content,
|
||||
model: body.model,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async embed(body: EmbeddingCreateParams): Promise<CreateEmbeddingResponse> {
|
||||
const headers = await this.getAuthHeaders();
|
||||
const url = this.buildUrl(`publishers/google/models/${body.model}:predict`);
|
||||
|
||||
// Convert input to text strings
|
||||
const textInputs = Array.isArray(body.input)
|
||||
? body.input.map((item) =>
|
||||
typeof item === "string" ? item : JSON.stringify(item),
|
||||
)
|
||||
: [
|
||||
typeof body.input === "string"
|
||||
? body.input
|
||||
: JSON.stringify(body.input),
|
||||
];
|
||||
|
||||
const requestBody = {
|
||||
instances: textInputs.map((text) => ({ content: text })),
|
||||
};
|
||||
|
||||
const response = await customFetch(this.config.requestOptions)(
|
||||
url.toString(),
|
||||
{
|
||||
method: "POST",
|
||||
headers,
|
||||
body: JSON.stringify(requestBody),
|
||||
},
|
||||
);
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(
|
||||
`VertexAI API error: ${response.status} ${response.statusText}`,
|
||||
);
|
||||
}
|
||||
|
||||
const data = await response.json();
|
||||
const embeddings = data.predictions.map(
|
||||
(prediction: any) => prediction.embeddings.values,
|
||||
);
|
||||
|
||||
return embedding({
|
||||
data: embeddings,
|
||||
model: body.model,
|
||||
});
|
||||
}
|
||||
|
||||
async rerank(body: RerankCreateParams): Promise<CreateRerankResponse> {
|
||||
throw new Error("Reranking is not supported by VertexAI");
|
||||
}
|
||||
|
||||
async list(): Promise<Model[]> {
|
||||
throw new Error("VertexAI provider does not support model listing.");
|
||||
}
|
||||
}
|
||||
|
|
@ -14,6 +14,7 @@ import { MockApi } from "./apis/Mock.js";
|
|||
import { MoonshotApi } from "./apis/Moonshot.js";
|
||||
import { OpenAIApi } from "./apis/OpenAI.js";
|
||||
import { RelaceApi } from "./apis/Relace.js";
|
||||
import { VertexAIApi } from "./apis/VertexAI.js";
|
||||
import { WatsonXApi } from "./apis/WatsonX.js";
|
||||
import { BaseLlmApi } from "./apis/base.js";
|
||||
import { LLMConfig, OpenAIConfigSchema } from "./types.js";
|
||||
|
|
@ -56,6 +57,8 @@ export function constructLlmApi(config: LLMConfig): BaseLlmApi | undefined {
|
|||
return new InceptionApi(config);
|
||||
case "watsonx":
|
||||
return new WatsonXApi(config);
|
||||
case "vertexai":
|
||||
return new VertexAIApi(config);
|
||||
case "llamastack":
|
||||
return new LlamastackApi(config);
|
||||
case "continue-proxy":
|
||||
|
|
|
|||
|
|
@ -165,6 +165,19 @@ export const InceptionConfigSchema = OpenAIConfigSchema.extend({
|
|||
});
|
||||
export type InceptionConfig = z.infer<typeof InceptionConfigSchema>;
|
||||
|
||||
export const VertexAIConfigSchema = BasePlusConfig.extend({
|
||||
provider: z.literal("vertexai"),
|
||||
env: z
|
||||
.object({
|
||||
region: z.string().optional(),
|
||||
projectId: z.string().optional(),
|
||||
keyFile: z.string().optional(),
|
||||
keyJson: z.string().optional(),
|
||||
})
|
||||
.optional(),
|
||||
});
|
||||
export type VertexAIConfig = z.infer<typeof VertexAIConfigSchema>;
|
||||
|
||||
// Discriminated union
|
||||
export const LLMConfigSchema = z.discriminatedUnion("provider", [
|
||||
OpenAIConfigSchema,
|
||||
|
|
@ -179,6 +192,7 @@ export const LLMConfigSchema = z.discriminatedUnion("provider", [
|
|||
JinaConfigSchema,
|
||||
MockConfigSchema,
|
||||
InceptionConfigSchema,
|
||||
VertexAIConfigSchema,
|
||||
LlamastackConfigSchema,
|
||||
ContinueProxyConfigSchema,
|
||||
]);
|
||||
|
|
|
|||
|
|
@ -1,13 +1,43 @@
|
|||
# Use npm ci in CI, npm install in development
|
||||
if ($env:CI -eq "true") {
|
||||
$npmInstallCmd = "npm ci"
|
||||
} else {
|
||||
$npmInstallCmd = "npm install"
|
||||
}
|
||||
|
||||
Push-Location packages
|
||||
|
||||
Push-Location "openai-adapters"
|
||||
npm ci
|
||||
# Phase 1: Build config-types (foundation - no dependencies)
|
||||
Push-Location "config-types"
|
||||
& cmd /c $npmInstallCmd
|
||||
npm run build
|
||||
Pop-Location
|
||||
|
||||
# Phase 2: Build packages that depend on config-types
|
||||
Push-Location "fetch"
|
||||
& cmd /c $npmInstallCmd
|
||||
npm run build
|
||||
Pop-Location
|
||||
|
||||
Push-Location "config-yaml"
|
||||
npm ci
|
||||
& cmd /c $npmInstallCmd
|
||||
npm run build
|
||||
Pop-Location
|
||||
|
||||
Pop-Location
|
||||
Push-Location "llm-info"
|
||||
& cmd /c $npmInstallCmd
|
||||
npm run build
|
||||
Pop-Location
|
||||
|
||||
# Phase 3: Build packages that depend on other local packages
|
||||
Push-Location "openai-adapters"
|
||||
& cmd /c $npmInstallCmd
|
||||
npm run build
|
||||
Pop-Location
|
||||
|
||||
Push-Location "continue-sdk"
|
||||
& cmd /c $npmInstallCmd
|
||||
npm run build
|
||||
Pop-Location
|
||||
|
||||
Pop-Location
|
||||
|
|
|
|||
|
|
@ -1,13 +1,45 @@
|
|||
# Build @continuedev packages for monorepo style linking
|
||||
|
||||
# Use npm ci in CI, npm install in development
|
||||
if [ "$CI" = "true" ]; then
|
||||
NPM_INSTALL_CMD="npm ci"
|
||||
else
|
||||
NPM_INSTALL_CMD="npm install"
|
||||
fi
|
||||
|
||||
cd packages
|
||||
cd openai-adapters
|
||||
|
||||
npm ci
|
||||
# Phase 1: Build config-types (foundation - no dependencies)
|
||||
cd config-types
|
||||
$NPM_INSTALL_CMD
|
||||
npm run build
|
||||
|
||||
cd ..
|
||||
cd config-yaml
|
||||
|
||||
npm ci
|
||||
# Phase 2: Build packages that depend on config-types
|
||||
cd fetch
|
||||
$NPM_INSTALL_CMD
|
||||
npm run build
|
||||
cd ..
|
||||
|
||||
cd config-yaml
|
||||
$NPM_INSTALL_CMD
|
||||
npm run build
|
||||
cd ..
|
||||
|
||||
cd llm-info
|
||||
$NPM_INSTALL_CMD
|
||||
npm run build
|
||||
cd ..
|
||||
|
||||
# Phase 3: Build packages that depend on other local packages
|
||||
cd openai-adapters
|
||||
rm -rf node_modules
|
||||
$NPM_INSTALL_CMD
|
||||
npm run build
|
||||
cd ..
|
||||
|
||||
cd continue-sdk
|
||||
rm -rf node_modules
|
||||
$NPM_INSTALL_CMD
|
||||
npm run build
|
||||
cd ..
|
||||
|
|
@ -76,41 +76,8 @@ if (($null -eq $node)) {
|
|||
Write-Host "`nInstalling root-level dependencies..." -ForegroundColor White
|
||||
npm install
|
||||
|
||||
Write-Host "`nBuilding config-types..." -ForegroundColor White
|
||||
Push-Location packages/config-types
|
||||
npm install
|
||||
npm run build
|
||||
Pop-Location
|
||||
|
||||
Write-Host "`nBuilding fetch..." -ForegroundColor White
|
||||
Push-Location packages/fetch
|
||||
npm install
|
||||
npm run build
|
||||
Pop-Location
|
||||
|
||||
Write-Host "`nBuilding llm-info..." -ForegroundColor White
|
||||
Push-Location packages/llm-info
|
||||
npm install
|
||||
npm run build
|
||||
Pop-Location
|
||||
|
||||
Write-Host "`nBuilding config-yaml..." -ForegroundColor White
|
||||
Push-Location packages/config-yaml
|
||||
npm install
|
||||
npm run build
|
||||
Pop-Location
|
||||
|
||||
Write-Host "`nBuilding openai-adapters..." -ForegroundColor White
|
||||
Push-Location packages/openai-adapters
|
||||
npm install
|
||||
npm run build
|
||||
Pop-Location
|
||||
|
||||
Write-Host "`nBuilding hub..." -ForegroundColor White
|
||||
Push-Location packages/hub
|
||||
npm install
|
||||
npm run build
|
||||
Pop-Location
|
||||
Write-Host "`nBuilding packages (fetch, openai-adapters, config-yaml)..." -ForegroundColor White
|
||||
& .\scripts\build-packages.ps1
|
||||
|
||||
Write-Host "`nInstalling Core extension dependencies..." -ForegroundColor White
|
||||
Push-Location core
|
||||
|
|
|
|||
|
|
@ -30,41 +30,8 @@ fi
|
|||
echo "Installing root-level dependencies..."
|
||||
npm install
|
||||
|
||||
echo "Building config-types..."
|
||||
pushd packages/config-types
|
||||
npm install
|
||||
npm run build
|
||||
popd
|
||||
|
||||
echo "Building fetch..."
|
||||
pushd packages/fetch
|
||||
npm install
|
||||
npm run build
|
||||
popd
|
||||
|
||||
echo "Building llm-info..."
|
||||
pushd packages/llm-info
|
||||
npm install
|
||||
npm run build
|
||||
popd
|
||||
|
||||
echo "Building config-yaml..."
|
||||
pushd packages/config-yaml
|
||||
npm install
|
||||
npm run build
|
||||
popd
|
||||
|
||||
echo "Building openai-adapters..."
|
||||
pushd packages/openai-adapters
|
||||
npm install
|
||||
npm run build
|
||||
popd
|
||||
|
||||
echo "Building hub..."
|
||||
pushd packages/hub
|
||||
npm install
|
||||
npm run build
|
||||
popd
|
||||
echo "Building packages (fetch, openai-adapters, config-yaml)..."
|
||||
./scripts/build-packages.sh
|
||||
|
||||
echo "Installing Core extension dependencies..."
|
||||
pushd core
|
||||
|
|
|
|||
285
scripts/oneper
Executable file
285
scripts/oneper
Executable file
|
|
@ -0,0 +1,285 @@
|
|||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
# oneper - Install Continue VS Code extension from PR builds or latest pre-release
|
||||
# Usage:
|
||||
# oneper install --pr X - Install VSIX from PR number X
|
||||
# oneper install --latest - Install latest pre-release from marketplace
|
||||
|
||||
REPO="continuedev/continue"
|
||||
ONEPER_DIR="$HOME/.continue/.utils/oneper"
|
||||
|
||||
show_help() {
|
||||
echo "oneper - Install Continue VS Code extension from PR builds or latest pre-release"
|
||||
echo ""
|
||||
echo "Usage: oneper <command> [options]"
|
||||
echo " oneper -h | --help"
|
||||
echo ""
|
||||
echo "Commands:"
|
||||
echo " install --pr <number> [--platform <platform>]"
|
||||
echo " Download and install VSIX from specified PR number"
|
||||
echo " Platform options: macos, linux (auto-detected by default)"
|
||||
echo " install --latest Install latest pre-release from VS Code marketplace"
|
||||
echo " clean Remove all downloaded VSIX files from oneper cache"
|
||||
echo ""
|
||||
echo "Options:"
|
||||
echo " -h, --help Show this help message"
|
||||
echo " --platform <platform> Specify platform for PR builds (macos, linux)"
|
||||
echo ""
|
||||
echo "Examples:"
|
||||
echo " oneper install --pr 123 # Install VSIX from PR #123"
|
||||
echo " oneper install --pr 123 --platform linux # Install Linux VSIX from PR #123"
|
||||
echo " oneper install --latest # Install latest pre-release"
|
||||
echo " oneper clean # Clear cached VSIX files"
|
||||
echo " oneper -h # Show help"
|
||||
echo ""
|
||||
echo "VSIX files are cached in: ~/.continue/.utils/oneper/"
|
||||
}
|
||||
|
||||
detect_os() {
|
||||
case "$(uname -s)" in
|
||||
"Darwin")
|
||||
echo "macos"
|
||||
;;
|
||||
"Linux")
|
||||
echo "linux"
|
||||
;;
|
||||
*)
|
||||
echo "❌ Unsupported operating system: $(uname -s)" >&2
|
||||
echo " Supported platforms: macOS, Linux" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
check_dependencies() {
|
||||
if ! command -v gh &> /dev/null; then
|
||||
echo "❌ GitHub CLI (gh) is required but not installed."
|
||||
echo " Install with: brew install gh"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! command -v code &> /dev/null; then
|
||||
echo "❌ VS Code CLI (code) is required but not installed."
|
||||
echo " Install VS Code and ensure 'code' command is in PATH"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
ensure_oneper_dir() {
|
||||
if [ ! -d "$ONEPER_DIR" ]; then
|
||||
echo "📁 Creating oneper directory: $ONEPER_DIR"
|
||||
mkdir -p "$ONEPER_DIR"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
install_from_pr() {
|
||||
local pr_number=$1
|
||||
local platform=${2:-$(detect_os)} # Auto-detect OS if not specified
|
||||
|
||||
if [ -z "$pr_number" ]; then
|
||||
echo "❌ PR number is required"
|
||||
show_help
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Map platform names to GitHub runner OS names
|
||||
local artifact_suffix
|
||||
case "$platform" in
|
||||
"macos")
|
||||
artifact_suffix="macOS"
|
||||
;;
|
||||
"linux")
|
||||
artifact_suffix="Linux"
|
||||
;;
|
||||
*)
|
||||
echo "❌ Unknown platform: $platform"
|
||||
echo " Supported platforms: macos, linux"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "🔍 Getting branch name for PR #$pr_number..."
|
||||
|
||||
# First get the branch name for the PR
|
||||
local branch_name=$(gh pr view "$pr_number" --repo "$REPO" --json headRefName --jq '.headRefName')
|
||||
|
||||
if [ -z "$branch_name" ]; then
|
||||
echo "❌ Could not find PR #$pr_number"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "🔍 Finding latest workflow run for branch: $branch_name..."
|
||||
|
||||
# Get the latest successful workflow run for the branch
|
||||
local run_id=$(gh run list \
|
||||
--repo "$REPO" \
|
||||
--workflow="pr_checks.yaml" \
|
||||
--branch="$branch_name" \
|
||||
--json databaseId,status,conclusion \
|
||||
--jq ".[] | select(.status == \"completed\" and .conclusion == \"success\") | .databaseId" \
|
||||
| head -1)
|
||||
|
||||
if [ -z "$run_id" ]; then
|
||||
echo "❌ No successful workflow run found for PR #$pr_number"
|
||||
echo " Make sure the PR exists and has a successful CI run"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "✅ Found workflow run: $run_id"
|
||||
echo "📥 Downloading vscode-extension-build-$artifact_suffix artifact..."
|
||||
|
||||
# Create temporary directory for download
|
||||
local temp_dir=$(mktemp -d)
|
||||
|
||||
# Download the artifact
|
||||
if ! gh run download "$run_id" \
|
||||
--repo "$REPO" \
|
||||
--name "vscode-extension-build-$artifact_suffix" \
|
||||
--dir "$temp_dir"; then
|
||||
echo "❌ Failed to download artifact vscode-extension-build-$artifact_suffix"
|
||||
echo " Make sure the workflow run completed successfully for $platform"
|
||||
rm -rf "$temp_dir"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Find the VSIX file in the downloaded artifact
|
||||
local vsix_file=$(find "$temp_dir" -name "*.vsix" | head -1)
|
||||
|
||||
if [ -z "$vsix_file" ]; then
|
||||
echo "❌ No VSIX file found in artifact"
|
||||
rm -rf "$temp_dir"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Extract full version from the original VSIX filename (e.g., continue-1.1.66-a1b2c3d.vsix -> 1.1.66-a1b2c3d)
|
||||
local original_filename=$(basename "$vsix_file")
|
||||
local full_version=$(echo "$original_filename" | sed 's/continue-\(.*\)\.vsix/\1/')
|
||||
|
||||
if [ -z "$full_version" ]; then
|
||||
echo "⚠️ Could not extract version from filename: $original_filename"
|
||||
full_version="unknown-pr${pr_number}"
|
||||
fi
|
||||
|
||||
# Use the full version (which includes commit SHA) for the target filename
|
||||
local target_path="$ONEPER_DIR/continue-${full_version}.vsix"
|
||||
|
||||
# Check if file already exists and notify about overwrite
|
||||
if [ -f "$target_path" ]; then
|
||||
echo "⚠️ Overwriting existing VSIX: $target_path"
|
||||
fi
|
||||
|
||||
echo "📦 Moving VSIX to: $target_path"
|
||||
mv "$vsix_file" "$target_path"
|
||||
|
||||
# Clean up temp directory
|
||||
rm -rf "$temp_dir"
|
||||
|
||||
# Install the extension
|
||||
echo "🚀 Installing VS Code extension..."
|
||||
if code --install-extension "$target_path"; then
|
||||
echo "✅ Successfully installed Continue extension from PR #$pr_number"
|
||||
echo "📄 VSIX file saved to: $target_path"
|
||||
echo "🔖 Extension version: ${full_version} (includes commit SHA)"
|
||||
echo ""
|
||||
echo "💡 To use the new extension version, reload your VS Code window:"
|
||||
echo " • Press Ctrl+Shift+P (Cmd+Shift+P on Mac)"
|
||||
echo " • Type 'Developer: Reload Window' and press Enter"
|
||||
echo " • Or restart VS Code entirely"
|
||||
else
|
||||
echo "❌ Failed to install extension"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
install_latest() {
|
||||
echo "🚀 Installing latest pre-release Continue extension..."
|
||||
if code --install-extension --pre-release Continue.continue; then
|
||||
echo "✅ Successfully installed latest pre-release Continue extension"
|
||||
echo ""
|
||||
echo "💡 To use the new extension version, reload your VS Code window:"
|
||||
echo " • Press Ctrl+Shift+P (Cmd+Shift+P on Mac)"
|
||||
echo " • Type 'Developer: Reload Window' and press Enter"
|
||||
echo " • Or restart VS Code entirely"
|
||||
else
|
||||
echo "❌ Failed to install extension"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
clean_cache() {
|
||||
if [ ! -d "$ONEPER_DIR" ]; then
|
||||
echo "📁 Oneper cache directory doesn't exist: $ONEPER_DIR"
|
||||
return 0
|
||||
fi
|
||||
|
||||
local file_count=$(find "$ONEPER_DIR" -name "*.vsix" | wc -l | tr -d ' ')
|
||||
|
||||
if [ "$file_count" -eq 0 ]; then
|
||||
echo "✨ Oneper cache is already empty"
|
||||
return 0
|
||||
fi
|
||||
|
||||
echo "🧹 Removing $file_count VSIX file(s) from oneper cache..."
|
||||
rm -f "$ONEPER_DIR"/*.vsix
|
||||
|
||||
echo "✅ Oneper cache cleared successfully"
|
||||
echo "📁 Cache directory: $ONEPER_DIR"
|
||||
}
|
||||
|
||||
main() {
|
||||
if [ $# -eq 0 ]; then
|
||||
show_help
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Handle help flags first
|
||||
case "$1" in
|
||||
"-h"|"--help")
|
||||
show_help
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
|
||||
check_dependencies
|
||||
ensure_oneper_dir
|
||||
|
||||
case "$1" in
|
||||
"install")
|
||||
case "$2" in
|
||||
"--pr")
|
||||
# Parse PR number and optional platform
|
||||
local pr_number="$3"
|
||||
local platform=$(detect_os) # auto-detect OS
|
||||
|
||||
# Check if --platform is specified to override auto-detection
|
||||
if [ "$4" = "--platform" ] && [ -n "$5" ]; then
|
||||
platform="$5"
|
||||
fi
|
||||
|
||||
install_from_pr "$pr_number" "$platform"
|
||||
;;
|
||||
"--latest")
|
||||
install_latest
|
||||
;;
|
||||
*)
|
||||
echo "❌ Unknown install option: $2"
|
||||
show_help
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
"clean")
|
||||
clean_cache
|
||||
;;
|
||||
*)
|
||||
echo "❌ Unknown command: $1"
|
||||
show_help
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
main "$@"
|
||||
Loading…
Add table
Reference in a new issue