Merge branch 'main' of github.com:continuedev/continue into jacob/enhancement/next-editable-region
This commit is contained in:
commit
3dc8ca45bb
65 changed files with 2109 additions and 1732 deletions
150
.github/actions/build-vscode-extension/action.yml
vendored
Normal file
150
.github/actions/build-vscode-extension/action.yml
vendored
Normal file
|
|
@ -0,0 +1,150 @@
|
|||
name: 'Build VS Code Extension'
|
||||
description: 'Build VS Code extension for a specific platform'
|
||||
inputs:
|
||||
platform:
|
||||
description: 'Target platform (win32, linux, alpine, darwin)'
|
||||
required: true
|
||||
arch:
|
||||
description: 'Target architecture (x64, arm64, armhf)'
|
||||
required: true
|
||||
npm_config_arch:
|
||||
description: 'npm config arch (x64, arm64, arm)'
|
||||
required: true
|
||||
pre-release:
|
||||
description: 'Whether to build as pre-release'
|
||||
required: false
|
||||
default: 'false'
|
||||
commit-sha:
|
||||
description: 'Commit SHA for version modification (optional, uses first 7 chars)'
|
||||
required: false
|
||||
default: ''
|
||||
outputs:
|
||||
target:
|
||||
description: 'The target string used for the build'
|
||||
value: ${{ steps.set-target.outputs.target }}
|
||||
vsix-path:
|
||||
description: 'Path to the generated VSIX file'
|
||||
value: 'extensions/vscode/*.vsix'
|
||||
build-path:
|
||||
description: 'Path to the build artifacts'
|
||||
value: 'extensions/vscode/build'
|
||||
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
|
||||
- name: Set target variable
|
||||
id: set-target
|
||||
shell: bash
|
||||
run: echo "target=${{ inputs.platform }}-${{ inputs.arch }}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache npm
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-npm-cache-build-${{ hashFiles('**/package-lock.json') }}
|
||||
|
||||
- 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') }}
|
||||
|
||||
- name: Cache packages node_modules
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
packages/*/node_modules
|
||||
key: ${{ runner.os }}-packages-node-modules-${{ hashFiles('packages/*/package-lock.json') }}
|
||||
|
||||
- name: Build packages
|
||||
shell: bash
|
||||
run: node ./scripts/build-packages.js
|
||||
|
||||
- name: Install extension dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
cd extensions/vscode
|
||||
npm ci
|
||||
env:
|
||||
# https://github.com/microsoft/vscode-ripgrep/issues/9#issuecomment-643965333
|
||||
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}
|
||||
|
||||
- name: Install gui dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
cd gui
|
||||
npm ci
|
||||
|
||||
- name: Install core dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
cd core
|
||||
npm ci
|
||||
npm i vectordb
|
||||
|
||||
- name: Prepackage the extension
|
||||
shell: bash
|
||||
run: |
|
||||
cd extensions/vscode
|
||||
npm run prepackage -- --target ${{ steps.set-target.outputs.target }}
|
||||
|
||||
- name: Re-install esbuild
|
||||
shell: bash
|
||||
run: |
|
||||
cd extensions/vscode
|
||||
npm install -f esbuild
|
||||
|
||||
- name: Modify package.json version with commit SHA
|
||||
if: inputs.commit-sha != ''
|
||||
shell: bash
|
||||
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")"
|
||||
|
||||
- name: Package extension (build artifacts)
|
||||
shell: bash
|
||||
run: |
|
||||
cd extensions/vscode
|
||||
npm run package
|
||||
|
||||
- name: Package extension (.vsix files)
|
||||
shell: bash
|
||||
run: |
|
||||
cd extensions/vscode
|
||||
if [ "${{ inputs.pre-release }}" = "true" ]; then
|
||||
npx vsce package --pre-release --no-dependencies --target ${{ steps.set-target.outputs.target }}
|
||||
else
|
||||
npx vsce package --no-dependencies --target ${{ steps.set-target.outputs.target }}
|
||||
fi
|
||||
131
.github/actions/run-jetbrains-tests/action.yml
vendored
Normal file
131
.github/actions/run-jetbrains-tests/action.yml
vendored
Normal file
|
|
@ -0,0 +1,131 @@
|
|||
name: 'Run JetBrains Tests'
|
||||
description: 'Setup and run JetBrains IntelliJ tests with all dependencies'
|
||||
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
|
||||
- uses: actions/cache@v4
|
||||
with:
|
||||
path: core/node_modules
|
||||
key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }}
|
||||
|
||||
- name: Build packages and install core dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
node ./scripts/build-packages.js
|
||||
cd core
|
||||
npm ci
|
||||
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v4.5.0
|
||||
with:
|
||||
distribution: zulu
|
||||
java-version: 17
|
||||
|
||||
- name: Setup FFmpeg
|
||||
uses: AnimMouse/setup-ffmpeg@v1
|
||||
with:
|
||||
token: ${{ env.GITHUB_TOKEN }}
|
||||
|
||||
- name: Setup Gradle
|
||||
uses: gradle/actions/setup-gradle@v3
|
||||
|
||||
- uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-npm-cache-jetbrains-${{ hashFiles('extensions/vscode/package-lock.json') }}
|
||||
|
||||
- uses: actions/cache@v4
|
||||
id: vscode-extension-cache
|
||||
with:
|
||||
path: extensions/vscode/node_modules
|
||||
key: ${{ runner.os }}-vscode-node-modules-${{ hashFiles('extensions/vscode/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') }}
|
||||
|
||||
# Cache prepackaged extension build to share with other jobs
|
||||
- uses: actions/cache@v4
|
||||
id: vscode-prepackage-cache
|
||||
with:
|
||||
path: extensions/vscode/build
|
||||
key: ${{ runner.os }}-vscode-prepackage-${{ hashFiles('extensions/vscode/package-lock.json', 'extensions/vscode/**/*.ts', 'extensions/vscode/**/*.json') }}
|
||||
|
||||
# Only run prepackage if not cached - saves ~1 minute
|
||||
- name: Run prepackage script
|
||||
if: steps.vscode-prepackage-cache.outputs.cache-hit != 'true'
|
||||
shell: bash
|
||||
run: |
|
||||
cd extensions/vscode
|
||||
if [ "${{ steps.vscode-extension-cache.outputs.cache-hit }}" != "true" ]; then
|
||||
npm ci
|
||||
fi
|
||||
npm run prepackage
|
||||
env:
|
||||
# https://github.com/microsoft/vscode-ripgrep/issues/9#issuecomment-643965333
|
||||
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}
|
||||
|
||||
- uses: actions/cache@v4
|
||||
id: binary-cache
|
||||
with:
|
||||
path: binary/node_modules
|
||||
key: ${{ runner.os }}-binary-node-modules-${{ hashFiles('binary/package-lock.json') }}
|
||||
|
||||
- name: Build the binaries
|
||||
shell: bash
|
||||
run: |
|
||||
cd binary
|
||||
npm run build
|
||||
|
||||
- name: Start test IDE
|
||||
shell: bash
|
||||
run: |
|
||||
cd extensions/intellij
|
||||
export DISPLAY=:99.0
|
||||
Xvfb -ac :99 -screen 0 1920x1080x24 &
|
||||
sleep 10
|
||||
mkdir -p build/reports
|
||||
./gradlew runIdeForUiTests &
|
||||
|
||||
- name: Wait for JB connection
|
||||
uses: jtalk/url-health-check-action@v3
|
||||
with:
|
||||
url: http://127.0.0.1:8082
|
||||
max-attempts: 15
|
||||
retry-delay: 30s
|
||||
|
||||
- name: Run tests
|
||||
shell: bash
|
||||
run: |
|
||||
cd extensions/intellij
|
||||
export DISPLAY=:99.0
|
||||
./gradlew test
|
||||
|
||||
- name: Move video
|
||||
if: ${{ failure() }}
|
||||
shell: bash
|
||||
run: |
|
||||
cd extensions/intellij
|
||||
mv video build/reports
|
||||
|
||||
- name: Copy logs
|
||||
if: ${{ failure() }}
|
||||
shell: bash
|
||||
run: |
|
||||
cd extensions/intellij
|
||||
mv build/idea-sandbox/system/log/ build/reports
|
||||
|
||||
- name: Save fails report
|
||||
if: ${{ failure() }}
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: jb-failure-report
|
||||
path: |
|
||||
${{ github.workspace }}/extensions/intellij/build/reports
|
||||
134
.github/actions/run-vscode-e2e-test/action.yml
vendored
Normal file
134
.github/actions/run-vscode-e2e-test/action.yml
vendored
Normal file
|
|
@ -0,0 +1,134 @@
|
|||
name: 'Run VS Code E2E Test'
|
||||
description: 'Run a single VS Code E2E test with all required setup'
|
||||
inputs:
|
||||
test_file:
|
||||
description: 'E2E test file to run'
|
||||
required: true
|
||||
command:
|
||||
description: 'Command to run (e2e:ci:run or e2e:ci:run-yaml)'
|
||||
required: true
|
||||
ssh_key:
|
||||
description: 'SSH private key for testing'
|
||||
required: false
|
||||
ssh_host:
|
||||
description: 'SSH host for testing'
|
||||
required: false
|
||||
is_fork:
|
||||
description: 'Whether this is a fork (affects SSH tests)'
|
||||
required: false
|
||||
default: 'false'
|
||||
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- 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') }}
|
||||
|
||||
# We don't want to cache the Continue extension, so it is deleted at the end of the job
|
||||
- uses: actions/cache@v4
|
||||
id: test-extensions-cache
|
||||
with:
|
||||
path: extensions/vscode/e2e/.test-extensions
|
||||
key: CONSTANT
|
||||
|
||||
- uses: actions/cache@v4
|
||||
id: storage-cache
|
||||
with:
|
||||
path: extensions/vscode/e2e/storage
|
||||
key: ${{ runner.os }}-vscode-storage-${{ hashFiles('extensions/vscode/package-lock.json') }}
|
||||
|
||||
- name: Download build artifact
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: vscode-extension-build-Linux
|
||||
path: extensions/vscode/build
|
||||
|
||||
- name: Build packages and download e2e dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
node ./scripts/build-packages.js
|
||||
if [ "${{ steps.storage-cache.outputs.cache-hit }}" != "true" ]; then
|
||||
cd core
|
||||
npm ci
|
||||
cd ../extensions/vscode
|
||||
npm run e2e:ci:download
|
||||
else
|
||||
cd core
|
||||
npm ci
|
||||
fi
|
||||
|
||||
- name: Fix VSCode binary permissions
|
||||
shell: bash
|
||||
run: |
|
||||
chmod +x extensions/vscode/e2e/storage/VSCode-linux-x64/code
|
||||
chmod +x extensions/vscode/e2e/storage/chromedriver-linux64/chromedriver
|
||||
|
||||
- name: Set up SSH
|
||||
if: ${{ inputs.ssh_key != '' && inputs.ssh_host != '' && inputs.is_fork == 'false' }}
|
||||
shell: bash
|
||||
env:
|
||||
SSH_KEY: ${{ inputs.ssh_key }}
|
||||
SSH_HOST: ${{ inputs.ssh_host }}
|
||||
run: |
|
||||
mkdir -p ~/.ssh
|
||||
echo "$SSH_KEY" > ~/.ssh/id_rsa
|
||||
chmod 600 ~/.ssh/id_rsa
|
||||
ssh-keyscan -H "$SSH_HOST" >> ~/.ssh/known_hosts
|
||||
echo -e "Host ssh-test-container\n\tHostName $SSH_HOST\n\tUser ec2-user\n\tIdentityFile ~/.ssh/id_rsa" >> ~/.ssh/config
|
||||
|
||||
- name: Set up Xvfb
|
||||
shell: bash
|
||||
run: |
|
||||
Xvfb :99 &
|
||||
export DISPLAY=:99
|
||||
|
||||
- name: Run e2e tests
|
||||
shell: bash
|
||||
run: |
|
||||
cd extensions/vscode
|
||||
IGNORE_SSH_TESTS="${{ inputs.is_fork }}" TEST_FILE="${{ inputs.test_file }}" npm run ${{ inputs.command }}
|
||||
env:
|
||||
DISPLAY: :99
|
||||
|
||||
- name: Delete continue from test extensions
|
||||
shell: bash
|
||||
run: |
|
||||
cd extensions/vscode
|
||||
rm -rf e2e/.test-extensions/continue*
|
||||
|
||||
- name: Sanitize test file name
|
||||
id: sanitize_filename
|
||||
if: always()
|
||||
shell: bash
|
||||
run: |
|
||||
FILENAME="${{ inputs.test_file }}"
|
||||
SANITIZED_FILENAME="${FILENAME//\//-}" # Replace / with - using bash parameter expansion
|
||||
echo "sanitized_test_file=${SANITIZED_FILENAME}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Upload e2e test screenshots
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: e2e-failure-screenshots-${{ steps.sanitize_filename.outputs.sanitized_test_file || 'unknown' }}-${{ inputs.command == 'e2e:ci:run-yaml' && 'yaml' || 'json' }}
|
||||
path: extensions/vscode/e2e/storage/screenshots
|
||||
|
||||
- name: Find e2e log file
|
||||
if: always()
|
||||
shell: bash
|
||||
run: |
|
||||
echo "Searching for e2e.log file..."
|
||||
find $GITHUB_WORKSPACE -name "e2e.log" -type f
|
||||
|
||||
- name: Upload e2e logs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: e2e-logs-${{ steps.sanitize_filename.outputs.sanitized_test_file || 'unknown' }}-${{ inputs.command == 'e2e:ci:run-yaml' && 'yaml' || 'json' }}
|
||||
path: extensions/vscode/e2e.log
|
||||
51
.github/actions/setup-component/action.yml
vendored
Normal file
51
.github/actions/setup-component/action.yml
vendored
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
name: 'Setup Component'
|
||||
description: 'Cache and install dependencies for a specific component'
|
||||
inputs:
|
||||
component:
|
||||
description: 'Component name (core, gui, vscode, binary)'
|
||||
required: true
|
||||
include-packages:
|
||||
description: 'Whether to include packages cache (default: true)'
|
||||
required: false
|
||||
default: 'true'
|
||||
include-root:
|
||||
description: 'Whether to include root cache (default: false)'
|
||||
required: false
|
||||
default: 'false'
|
||||
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
- uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-npm-cache-${{ inputs.component }}-${{ hashFiles(inputs.component == 'vscode' && 'extensions/vscode/package-lock.json' || format('{0}/package-lock.json', inputs.component)) }}
|
||||
|
||||
- uses: actions/cache@v4
|
||||
if: inputs.include-packages == 'true'
|
||||
with:
|
||||
path: |
|
||||
packages/*/node_modules
|
||||
key: ${{ runner.os }}-packages-node-modules-${{ hashFiles('packages/*/package-lock.json') }}
|
||||
|
||||
- uses: actions/cache@v4
|
||||
if: inputs.include-root == 'true'
|
||||
with:
|
||||
path: node_modules
|
||||
key: ${{ runner.os }}-root-node-modules-${{ hashFiles('package-lock.json') }}
|
||||
|
||||
- uses: actions/cache@v4
|
||||
id: component-cache
|
||||
with:
|
||||
path: ${{ inputs.component == 'vscode' && 'extensions/vscode/node_modules' || format('{0}/node_modules', inputs.component) }}
|
||||
key: ${{ runner.os }}-${{ inputs.component }}-node-modules-${{ hashFiles(inputs.component == 'vscode' && 'extensions/vscode/package-lock.json' || format('{0}/package-lock.json', inputs.component)) }}
|
||||
|
||||
- name: Install component dependencies
|
||||
if: steps.component-cache.outputs.cache-hit != 'true'
|
||||
shell: bash
|
||||
run: |
|
||||
cd ${{ inputs.component == 'vscode' && 'extensions/vscode' || inputs.component }}
|
||||
npm ci
|
||||
37
.github/actions/setup-packages/action.yml
vendored
Normal file
37
.github/actions/setup-packages/action.yml
vendored
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
name: 'Setup Packages'
|
||||
description: 'Cache and build packages with npm caching'
|
||||
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
- uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-npm-cache-packages-${{ hashFiles('packages/*/package-lock.json') }}
|
||||
|
||||
- uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
packages/*/node_modules
|
||||
key: ${{ runner.os }}-packages-node-modules-${{ hashFiles('packages/*/package-lock.json') }}
|
||||
|
||||
- name: Build packages
|
||||
shell: bash
|
||||
run: node ./scripts/build-packages.js
|
||||
|
||||
- name: Install package dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
for package_dir in packages/*/; do
|
||||
if [ -f "$package_dir/package.json" ] && [ ! -d "$package_dir/node_modules" ]; then
|
||||
echo "Installing dependencies for $package_dir"
|
||||
cd "$package_dir"
|
||||
npm ci
|
||||
cd - > /dev/null
|
||||
elif [ -d "$package_dir/node_modules" ]; then
|
||||
echo "Using cached dependencies for $package_dir"
|
||||
fi
|
||||
done
|
||||
44
.github/workflows/compliance.yaml
vendored
44
.github/workflows/compliance.yaml
vendored
|
|
@ -12,7 +12,7 @@ concurrency:
|
|||
|
||||
jobs:
|
||||
conventional-commits:
|
||||
name: Validate Conventional Commits (Warning Only)
|
||||
name: Validate Conventional Commits
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ !github.event.pull_request.draft }}
|
||||
continue-on-error: true
|
||||
|
|
@ -21,22 +21,26 @@ jobs:
|
|||
issues: write
|
||||
contents: read
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Validate PR title format
|
||||
id: pr-title-check
|
||||
run: |
|
||||
PR_TITLE="${{ github.event.pull_request.title }}"
|
||||
echo "Checking PR title: $PR_TITLE"
|
||||
|
||||
- name: Validate conventional commits
|
||||
id: commitlint
|
||||
uses: wagoid/commitlint-github-action@v6
|
||||
with:
|
||||
configFile: .commitlintrc.warning.json
|
||||
# Only check the last commit instead of all commits in the PR
|
||||
commitDepth: 1
|
||||
continue-on-error: true
|
||||
# Regex pattern for conventional commits
|
||||
PATTERN="^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\(.+\))?!?: .+"
|
||||
|
||||
- name: Add commit message guidance comment
|
||||
if: steps.commitlint.outcome == 'failure'
|
||||
if [[ $PR_TITLE =~ $PATTERN ]]; then
|
||||
echo "✅ PR title follows conventional commit format"
|
||||
echo "valid=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "❌ PR title does not follow conventional commit format"
|
||||
echo "valid=false" >> $GITHUB_OUTPUT
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Add PR title guidance comment
|
||||
if: steps.pr-title-check.outputs.valid == 'false'
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
|
|
@ -48,7 +52,7 @@ jobs:
|
|||
|
||||
const botComment = comments.find(comment =>
|
||||
comment.user.type === 'Bot' &&
|
||||
comment.body.includes('Conventional Commit Format')
|
||||
comment.body.includes('PR Title Format')
|
||||
);
|
||||
|
||||
if (!botComment) {
|
||||
|
|
@ -57,17 +61,13 @@ jobs:
|
|||
repo: context.repo.repo,
|
||||
issue_number: context.issue.number,
|
||||
body: [
|
||||
"## ⚠️ Conventional Commit Format",
|
||||
"## ⚠️ PR Title Format",
|
||||
"",
|
||||
"Your latest commit message doesn't follow the conventional commit format, but **this won't block your PR from being merged**. We recommend downloading [this extension](https://marketplace.visualstudio.com/items?itemName=vivaxy.vscode-conventional-commits) if you are using VS Code.",
|
||||
"Your PR title doesn't follow the conventional commit format, but **this won't block your PR from being merged**. We recommend using this format for better project organization.",
|
||||
"",
|
||||
"### Expected Format:",
|
||||
"```",
|
||||
"<type>[optional scope]: <description>",
|
||||
"",
|
||||
"[optional body]",
|
||||
"",
|
||||
"[optional footer(s)]",
|
||||
"```",
|
||||
"",
|
||||
"### Examples:",
|
||||
|
|
|
|||
6
.github/workflows/jetbrains-release.yaml
vendored
6
.github/workflows/jetbrains-release.yaml
vendored
|
|
@ -87,7 +87,7 @@ jobs:
|
|||
needs: check_release_name
|
||||
if: needs.check_release_name.outputs.should_run == 'true' || github.event_name == 'workflow_dispatch'
|
||||
name: Build Plugin
|
||||
runs-on: macos-latest
|
||||
runs-on: macos-13
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
|
@ -167,7 +167,7 @@ jobs:
|
|||
key: ${{ runner.os }}-node-${{ hashFiles('gui/package-lock.json') }}
|
||||
|
||||
- name: Build packages (Unix)
|
||||
run: cd ../.. && ./scripts/build-packages.sh
|
||||
run: cd ../.. && node ./scripts/build-packages.js
|
||||
|
||||
# npm install core
|
||||
- name: Install core node_modules
|
||||
|
|
@ -325,7 +325,7 @@ jobs:
|
|||
platform: darwin
|
||||
arch: x64
|
||||
npm_config_arch: x64
|
||||
- os: macos-latest
|
||||
- os: macos-13
|
||||
platform: darwin
|
||||
arch: arm64
|
||||
npm_config_arch: arm64
|
||||
|
|
|
|||
121
.github/workflows/label-merged-prs.yml
vendored
Normal file
121
.github/workflows/label-merged-prs.yml
vendored
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
name: Label Merged PRs
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [closed]
|
||||
|
||||
jobs:
|
||||
label-pr:
|
||||
if: github.event.pull_request.merged == true
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
pull-requests: write
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Check if author is in tier list
|
||||
id: check-author
|
||||
run: |
|
||||
USERS=(
|
||||
"TyDunn"
|
||||
"jpoly1219"
|
||||
"bdougie"
|
||||
"uinstinct"
|
||||
"sestinj"
|
||||
"tingwai"
|
||||
"tomasz-stefaniak"
|
||||
"RomneyDa"
|
||||
"Patrick-Erichsen"
|
||||
)
|
||||
|
||||
PR_AUTHOR="${{ github.event.pull_request.user.login }}"
|
||||
SHOULD_LABEL="false"
|
||||
|
||||
for user in "${USERS[@]}"; do
|
||||
if [[ "$PR_AUTHOR" == "$user" ]]; then
|
||||
SHOULD_LABEL="true"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
echo "should_label=$SHOULD_LABEL" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Determine and apply tier label
|
||||
if: steps.check-author.outputs.should_label == 'true'
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const pr = context.payload.pull_request;
|
||||
|
||||
// Check if PR already has a tier label
|
||||
const existingLabels = pr.labels.map(l => l.name);
|
||||
if (existingLabels.some(label => label.match(/^tier [1-3]$/))) {
|
||||
console.log('PR already has a tier label, skipping');
|
||||
return;
|
||||
}
|
||||
|
||||
// Function to extract conventional commit prefix
|
||||
function getConventionalPrefix(title) {
|
||||
const match = title.match(/^([a-z]+)(\s|$|:)/);
|
||||
return match ? match[1] : '';
|
||||
}
|
||||
|
||||
// Function to determine tier
|
||||
function determineTier(pr) {
|
||||
const additions = pr.additions;
|
||||
const deletions = pr.deletions;
|
||||
const changedFiles = pr.changed_files;
|
||||
const title = pr.title;
|
||||
const body = pr.body || '';
|
||||
|
||||
const prefix = getConventionalPrefix(title);
|
||||
|
||||
// If no conventional commit prefix, skip
|
||||
if (!prefix) {
|
||||
console.log('No conventional commit format, skipping');
|
||||
return null;
|
||||
}
|
||||
|
||||
// Tier 4 (unlabeled): fix, test, docs, style, refactor, perf, build, ci, revert, improve
|
||||
const tier4Prefixes = ['fix', 'test', 'docs', 'style', 'refactor', 'perf', 'build', 'ci', 'revert', 'chore', 'improve'];
|
||||
if (tier4Prefixes.includes(prefix)) {
|
||||
console.log('Tier 4 prefix detected, will remain unlabeled');
|
||||
return null;
|
||||
}
|
||||
|
||||
const totalChanges = additions + deletions;
|
||||
|
||||
// Tier 1: Major features (1000+ lines changed, or 20+ files, or feat with large scope)
|
||||
if (totalChanges > 1000 || changedFiles > 20 ||
|
||||
(prefix === 'feat' && totalChanges > 800) ||
|
||||
title.match(/(major|milestone|launch)/)) {
|
||||
return 'tier 1';
|
||||
}
|
||||
|
||||
// Tier 2: Important features (500+ lines changed, or 10+ files, or standard feat)
|
||||
if (totalChanges > 500 || changedFiles > 10 || prefix === 'feat') {
|
||||
return 'tier 2';
|
||||
}
|
||||
|
||||
// Tier 3: Smaller improvements
|
||||
return 'tier 3';
|
||||
}
|
||||
|
||||
const tier = determineTier(pr);
|
||||
|
||||
if (tier) {
|
||||
console.log(`Assigning ${tier} label to PR #${pr.number}`);
|
||||
console.log(`Title: ${pr.title}`);
|
||||
console.log(`Changes: +${pr.additions} -${pr.deletions} (${pr.changed_files} files)`);
|
||||
|
||||
await github.rest.issues.addLabels({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: pr.number,
|
||||
labels: [tier]
|
||||
});
|
||||
|
||||
console.log(`✓ Label '${tier}' added successfully`);
|
||||
}
|
||||
130
.github/workflows/main.yaml
vendored
130
.github/workflows/main.yaml
vendored
|
|
@ -29,6 +29,7 @@ jobs:
|
|||
build:
|
||||
needs: check_release_name
|
||||
if: needs.check_release_name.outputs.should_run == 'true' || github.event_name == 'workflow_dispatch'
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
|
|
@ -64,9 +65,33 @@ jobs:
|
|||
platform: darwin
|
||||
arch: arm64
|
||||
npm_config_arch: arm64
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
# 1. Check-out repository
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
|
||||
- uses: ./.github/actions/build-vscode-extension
|
||||
with:
|
||||
platform: ${{ matrix.platform }}
|
||||
arch: ${{ matrix.arch }}
|
||||
npm_config_arch: ${{ matrix.npm_config_arch }}
|
||||
pre-release: false
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }}
|
||||
|
||||
- name: Upload .vsix artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ matrix.platform }}-${{ matrix.arch }}-vsix
|
||||
path: "extensions/vscode/*.vsix"
|
||||
|
||||
check-version:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
|
|
@ -80,107 +105,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
|
||||
|
|
|
|||
52
.github/workflows/pr-build-upload-vsix.yaml
vendored
Normal file
52
.github/workflows/pr-build-upload-vsix.yaml
vendored
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
name: PR Build And Upload VSIX
|
||||
|
||||
# Builds and uploads VSIX artifacts for the `oneper` script across Linux, Windows, and macOS ARM platforms
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build-and-upload-vsix:
|
||||
runs-on: ${{ matrix.runner }}
|
||||
timeout-minutes: 10
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- platform: linux
|
||||
arch: x64
|
||||
runner: ubuntu-latest
|
||||
- platform: win32
|
||||
arch: x64
|
||||
runner: windows-latest
|
||||
- platform: darwin
|
||||
arch: arm64
|
||||
runner: macos-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Build VS Code extension
|
||||
uses: ./.github/actions/build-vscode-extension
|
||||
with:
|
||||
platform: ${{ matrix.platform }}
|
||||
arch: ${{ matrix.arch }}
|
||||
npm_config_arch: ${{ matrix.arch }}
|
||||
pre-release: false
|
||||
commit-sha: ${{ github.sha }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }}
|
||||
|
||||
- name: Upload build artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: vscode-extension-build-${{ matrix.platform }}-${{ matrix.arch }}
|
||||
path: extensions/vscode/build
|
||||
|
||||
- name: Upload .vsix artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ matrix.platform }}-${{ matrix.arch }}-vsix
|
||||
path: "extensions/vscode/*.vsix"
|
||||
335
.github/workflows/pr-checks.yaml
vendored
Normal file
335
.github/workflows/pr-checks.yaml
vendored
Normal file
|
|
@ -0,0 +1,335 @@
|
|||
name: PR Checks
|
||||
|
||||
# PR Checks run on all PRs to the main branch and must pass before merging.
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
prettier-check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
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') }}
|
||||
|
||||
- name: Install root dependencies
|
||||
if: steps.root-cache.outputs.cache-hit != 'true'
|
||||
run: npm ci
|
||||
|
||||
- name: Check code formatting with Prettier
|
||||
run: npx prettier --check "**/*.{js,jsx,ts,tsx,json,css,md}" --ignore-path .gitignore --ignore-path .prettierignore
|
||||
|
||||
core-checks:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup packages
|
||||
uses: ./.github/actions/setup-packages
|
||||
- name: Setup core component
|
||||
uses: ./.github/actions/setup-component
|
||||
with:
|
||||
component: core
|
||||
include-root: true
|
||||
|
||||
- name: Type check and lint
|
||||
run: |
|
||||
cd core
|
||||
npx tsc --noEmit
|
||||
npm run lint
|
||||
env:
|
||||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
cd core
|
||||
npm test
|
||||
npm run vitest
|
||||
env:
|
||||
IGNORE_API_KEY_TESTS: ${{ github.event.pull_request.head.repo.fork == true || github.actor == 'dependabot[bot]' }}
|
||||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
||||
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
||||
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
|
||||
MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }}
|
||||
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
|
||||
AZURE_FOUNDRY_CODESTRAL_API_KEY: ${{ secrets.AZURE_FOUNDRY_CODESTRAL_API_KEY }}
|
||||
AZURE_FOUNDRY_MISTRAL_SMALL_API_KEY: ${{ secrets.AZURE_FOUNDRY_MISTRAL_SMALL_API_KEY }}
|
||||
AZURE_OPENAI_GPT41_API_KEY: ${{ secrets.AZURE_OPENAI_GPT41_API_KEY }}
|
||||
|
||||
gui-checks:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup packages
|
||||
uses: ./.github/actions/setup-packages
|
||||
- name: Setup core component
|
||||
uses: ./.github/actions/setup-component
|
||||
with:
|
||||
component: core
|
||||
include-root: true
|
||||
- name: Setup gui component
|
||||
uses: ./.github/actions/setup-component
|
||||
with:
|
||||
component: gui
|
||||
include-packages: false
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }}
|
||||
|
||||
- name: Type check and lint
|
||||
run: |
|
||||
cd gui
|
||||
npx tsc --noEmit
|
||||
npm run lint
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
cd gui
|
||||
npm test
|
||||
|
||||
binary-checks:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup packages
|
||||
uses: ./.github/actions/setup-packages
|
||||
- name: Setup core component
|
||||
uses: ./.github/actions/setup-component
|
||||
with:
|
||||
component: core
|
||||
include-root: true
|
||||
- name: Setup binary component
|
||||
uses: ./.github/actions/setup-component
|
||||
with:
|
||||
component: binary
|
||||
include-packages: false
|
||||
|
||||
- name: Type check
|
||||
run: |
|
||||
cd binary
|
||||
npx tsc --noEmit
|
||||
|
||||
vscode-checks:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup packages
|
||||
uses: ./.github/actions/setup-packages
|
||||
- name: Setup core component
|
||||
uses: ./.github/actions/setup-component
|
||||
with:
|
||||
component: core
|
||||
include-root: true
|
||||
- name: Setup vscode component
|
||||
uses: ./.github/actions/setup-component
|
||||
with:
|
||||
component: vscode
|
||||
include-packages: false
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }}
|
||||
|
||||
- name: Type check and lint
|
||||
run: |
|
||||
cd extensions/vscode
|
||||
npm run write-build-timestamp
|
||||
npx tsc --noEmit
|
||||
npm run lint
|
||||
|
||||
- name: Run vitest tests
|
||||
run: |
|
||||
cd extensions/vscode
|
||||
npm run vitest
|
||||
|
||||
get-packages-matrix:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
packages: ${{ steps.get-packages.outputs.packages }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Get package list
|
||||
id: get-packages
|
||||
run: |
|
||||
packages=$(find packages/ -maxdepth 1 -type d -not -path packages/ -exec basename {} \; | sort | jq -R -s -c 'split("\n")[:-1]')
|
||||
echo "packages=$packages" >> $GITHUB_OUTPUT
|
||||
echo "Found packages: $packages"
|
||||
|
||||
packages-checks:
|
||||
needs: get-packages-matrix
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
package: ${{ fromJson(needs.get-packages-matrix.outputs.packages) }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup packages
|
||||
uses: ./.github/actions/setup-packages
|
||||
|
||||
- name: Test and check ${{ matrix.package }}
|
||||
run: |
|
||||
cd packages/${{ matrix.package }}
|
||||
npm test
|
||||
env:
|
||||
IGNORE_API_KEY_TESTS: ${{ github.event.pull_request.head.repo.fork == true || github.actor == 'dependabot[bot]' }}
|
||||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
||||
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
||||
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
|
||||
MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }}
|
||||
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
|
||||
AZURE_FOUNDRY_CODESTRAL_API_KEY: ${{ secrets.AZURE_FOUNDRY_CODESTRAL_API_KEY }}
|
||||
AZURE_FOUNDRY_MISTRAL_SMALL_API_KEY: ${{ secrets.AZURE_FOUNDRY_MISTRAL_SMALL_API_KEY }}
|
||||
AZURE_OPENAI_GPT41_API_KEY: ${{ secrets.AZURE_OPENAI_GPT41_API_KEY }}
|
||||
VOYAGE_API_KEY: ${{ secrets.VOYAGE_API_KEY }}
|
||||
|
||||
vscode-get-test-file-matrix:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
test_file_matrix: ${{ steps.vscode-get-test-file-matrix.outputs.test_file_matrix }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
|
||||
- name: Cache npm
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-npm-cache-matrix-${{ hashFiles('core/package-lock.json', 'extensions/vscode/package-lock.json') }}
|
||||
|
||||
- name: Cache packages node_modules
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
packages/*/node_modules
|
||||
key: ${{ runner.os }}-packages-node-modules-${{ hashFiles('packages/*/package-lock.json') }}
|
||||
|
||||
- name: Cache core node modules
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: core/node_modules
|
||||
key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }}
|
||||
|
||||
- name: Cache vscode extension node modules
|
||||
uses: actions/cache@v4
|
||||
id: vscode-cache
|
||||
with:
|
||||
path: extensions/vscode/node_modules
|
||||
key: ${{ runner.os }}-vscode-node-modules-${{ hashFiles('extensions/vscode/package-lock.json') }}
|
||||
|
||||
- name: Build packages and get test files
|
||||
id: vscode-get-test-file-matrix
|
||||
run: |
|
||||
node ./scripts/build-packages.js
|
||||
cd extensions/vscode
|
||||
npm ci
|
||||
npm run e2e:compile
|
||||
if [[ "${{ github.event.pull_request.head.repo.fork }}" == "true" || "${{ github.actor }}" == "dependabot[bot]" ]]; then
|
||||
# Exclude SSH tests for forks
|
||||
FILES=$(ls -1 e2e/_output/tests/*.test.js | grep -v "SSH" | jq -R . | jq -s .)
|
||||
else
|
||||
# Include all tests for non-forks
|
||||
FILES=$(ls -1 e2e/_output/tests/*.test.js | jq -R . | jq -s .)
|
||||
fi
|
||||
echo "test_file_matrix<<EOF" >> $GITHUB_OUTPUT
|
||||
echo "$FILES" >> $GITHUB_OUTPUT
|
||||
echo "EOF" >> $GITHUB_OUTPUT
|
||||
env:
|
||||
# https://github.com/microsoft/vscode-ripgrep/issues/9#issuecomment-643965333
|
||||
GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }}
|
||||
|
||||
- name: Debug Outputs
|
||||
run: |
|
||||
echo "Test files: ${{ steps.vscode-get-test-file-matrix.outputs.test_file_matrix }}"
|
||||
|
||||
vscode-package-extension-linux:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Build VS Code extension
|
||||
uses: ./.github/actions/build-vscode-extension
|
||||
with:
|
||||
platform: linux
|
||||
arch: x64
|
||||
npm_config_arch: x64
|
||||
pre-release: false
|
||||
commit-sha: ${{ github.sha }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }}
|
||||
|
||||
- name: Upload build artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: vscode-extension-build-Linux
|
||||
path: extensions/vscode/build
|
||||
|
||||
vscode-e2e-tests:
|
||||
name: ${{ matrix.test_file || 'unknown' }} (${{ matrix.command }})
|
||||
needs: [vscode-get-test-file-matrix, vscode-package-extension-linux]
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
# Tests requiring secrets need approval from maintainers
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
test_file: ${{ fromJson(needs.vscode-get-test-file-matrix.outputs.test_file_matrix) }}
|
||||
command: ["e2e:ci:run", "e2e:ci:run-yaml"]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Run VS Code E2E test
|
||||
uses: ./.github/actions/run-vscode-e2e-test
|
||||
with:
|
||||
test_file: ${{ matrix.test_file }}
|
||||
command: ${{ matrix.command }}
|
||||
ssh_key: ${{ secrets.GH_ACTIONS_SSH_TEST_KEY_PEM }}
|
||||
ssh_host: ${{ secrets.GH_ACTIONS_SSH_TEST_DNS_NAME }}
|
||||
is_fork: ${{ github.event.pull_request.head.repo.fork == true || github.actor == 'dependabot[bot]' }}
|
||||
|
||||
jetbrains-tests:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Run JetBrains tests
|
||||
uses: ./.github/actions/run-jetbrains-tests
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }}
|
||||
|
||||
# GitHub does not have a way of requiring that all checks pass (you must manually select each job)
|
||||
# This action at least lets us manage the list of required tests via source control
|
||||
# so that creators of new jobs can add them to this list
|
||||
require-all-checks-to-pass:
|
||||
if: always()
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- prettier-check
|
||||
- core-checks
|
||||
- gui-checks
|
||||
- binary-checks
|
||||
- vscode-checks
|
||||
- get-packages-matrix
|
||||
- packages-checks
|
||||
- vscode-get-test-file-matrix
|
||||
- vscode-package-extension-linux
|
||||
- vscode-e2e-tests
|
||||
- jetbrains-tests
|
||||
|
||||
steps:
|
||||
- name: Decide whether the needed jobs succeeded or failed
|
||||
uses: re-actors/alls-green@release/v1
|
||||
with:
|
||||
jobs: ${{ toJSON(needs) }}
|
||||
1132
.github/workflows/pr_checks.yaml
vendored
1132
.github/workflows/pr_checks.yaml
vendored
File diff suppressed because it is too large
Load diff
111
.github/workflows/preview.yaml
vendored
111
.github/workflows/preview.yaml
vendored
|
|
@ -29,6 +29,7 @@ jobs:
|
|||
build:
|
||||
needs: check_release_name
|
||||
if: needs.check_release_name.outputs.should_run == 'true' || github.event_name == 'workflow_dispatch'
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
|
|
@ -64,116 +65,28 @@ jobs:
|
|||
platform: darwin
|
||||
arch: arm64
|
||||
npm_config_arch: arm64
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
# 1. Check-out repository
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0 # This ensures all tags are fetched
|
||||
fetch-depth: 0
|
||||
|
||||
- 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
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
|
||||
- name: Cache extension node_modules
|
||||
uses: actions/cache@v3
|
||||
- uses: ./.github/actions/build-vscode-extension
|
||||
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
|
||||
platform: ${{ matrix.platform }}
|
||||
arch: ${{ matrix.arch }}
|
||||
npm_config_arch: ${{ matrix.npm_config_arch }}
|
||||
pre-release: true
|
||||
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
|
||||
- name: Upload .vsix artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ env.target }}-vsix
|
||||
name: ${{ matrix.platform }}-${{ matrix.arch }}-vsix
|
||||
path: "extensions/vscode/*.vsix"
|
||||
|
||||
release:
|
||||
|
|
|
|||
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"
|
||||
|
|
|
|||
16
.vscode/tasks.json
vendored
16
.vscode/tasks.json
vendored
|
|
@ -223,6 +223,22 @@
|
|||
],
|
||||
"type": "shell",
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "build-packages",
|
||||
"type": "shell",
|
||||
"command": "node ./scripts/build-packages.js",
|
||||
"problemMatcher": [],
|
||||
"presentation": {
|
||||
"reveal": "silent",
|
||||
"panel": "shared"
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "vscode-extension:build-with-packages",
|
||||
"dependsOn": ["build-packages", "vscode-extension:build"],
|
||||
"type": "shell",
|
||||
"problemMatcher": []
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ and [hub of models, rules, prompts, docs, and other building blocks](https://hub
|
|||
<img src="https://img.shields.io/badge/License-Apache_2.0-blue.svg" style="height: 22px;" />
|
||||
</a>
|
||||
<a target="_blank" href="https://docs.continue.dev" style="background:none">
|
||||
<img src="https://img.shields.io/badge/continue_docs-%23BE1B55" style="height: 22px;" />
|
||||
<img src="https://img.shields.io/badge/Continue-docs-%23BE1B55.svg?logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNiAyNCIgZmlsbD0id2hpdGUiPgogIDxwYXRoIGQ9Ik0yMC41Mjg2IDMuMjY4MTFMMTkuMTUxMiA1LjY1Njk0TDIyLjYzMjggMTEuNjg0OUMyMi42NTgyIDExLjczMDYgMjIuNjczNSAxMS43ODY2IDIyLjY3MzUgMTEuODM3NEMyMi42NzM1IDExLjg4ODIgMjIuNjU4MiAxMS45NDQxIDIyLjYzMjggMTEuOTg5OUwxOS4xNTEyIDE4LjAyMjlMMjAuNTI4NiAyMC40MTE3TDI1LjQ3OTEgMTEuODM3NEwyMC41Mjg2IDMuMjYzMDNWMy4yNjgxMVpNMTguNjE3NiA1LjM0NjlMMTkuOTk1IDIuOTU4MDdIMTcuMjQwMkwxNS44NjI4IDUuMzQ2OUgxOC42MjI3SDE4LjYxNzZaTTE1Ljg1NzcgNS45NjY5N0wxOS4wNzUgMTEuNTMyNEgyMS44Mjk4TDE4LjYxNzYgNS45NjY5N0gxNS44NTc3Wk0xOC42MTc2IDE3LjcxNzlMMjEuODI5OCAxMi4xNDc0SDE5LjA3NUwxNS44NTc3IDE3LjcxNzlIMTguNjE3NlpNMTUuODU3NyAxOC4zMzhMMTcuMjM1MSAyMC43MTY3SDE5Ljk4OTlMMTguNjEyNSAxOC4zMzhIMTUuODUyNkgxNS44NTc3Wk02LjUyMDk4IDIxLjMwNjNDNi40NjUwNyAyMS4zMDYzIDYuNDE0MjQgMjEuMjkxIDYuMzY4NSAyMS4yNjU2QzYuMzIyNzYgMjEuMjQwMiA2LjI4MjA5IDIxLjE5OTUgNi4yNTY2OCAyMS4xNTM4TDIuNzcwMDIgMTUuMTIwN0gwLjAxNTI0ODJMNC45NjU3IDIzLjY5SDE0Ljg2MTVMMTMuNDg0MSAyMS4zMDYzSDYuNTI2MDZINi41MjA5OFpNMTQuMDE3OCAyMC45OTYyTDE1LjM5NTIgMjMuMzhMMTYuNzcyNiAyMC45OTExTDE1LjM5NTIgMTguNjAyM0wxNC4wMTc4IDIwLjk5MTFWMjAuOTk2MlpNMTQuODYxNSAxOC4yOTc0SDguNDM3MTJMNy4wNTk3MyAyMC42ODYySDEzLjQ4NDFMMTQuODYxNSAxOC4yOTc0Wk03Ljg5ODM2IDE3Ljk5MjRMNC42ODEwOCAxMi40MjE5TDMuMzAzNjkgMTQuODEwN0w2LjUyMDk4IDIwLjM4MTJMNy44OTgzNiAxNy45OTI0Wk0wLjAxMDE2NTQgMTQuNTAwN0gyLjc2NDk0TDQuMTQyMzIgMTIuMTExOEgxLjM5MjYzTDAuMDEwMTY1NCAxNC41MDA3Wk02LjI0MTQzIDIuNTQxM0M2LjI2Njg1IDIuNDk1NTYgNi4zMDc1MSAyLjQ1NDkgNi4zNTMyNSAyLjQyOTQ4QzYuMzk5IDIuNDA0MDcgNi40NTQ5IDIuMzg4ODIgNi41MDU3MyAyLjM4ODgySDEzLjQ3NEwxNC44NTE0IDBINC45NTA0NUwwIDguNTc0MzVIMi43NTQ3N0w2LjIzMTI3IDIuNTQ2MzhMNi4yNDE0MyAyLjU0MTNaTTQuMTQyMzIgMTEuNTc4MkwyLjc2NDk0IDkuMTg5MzRIMC4wMTAxNjU0TDEuMzg3NTUgMTEuNTc4Mkg0LjE0MjMyWk02LjUxMDgxIDMuMzEzODZMMy4yOTg2MSA4Ljg3OTNMNC42NzU5OSAxMS4yNjgxTDcuODg4MiA1LjcwMjY4TDYuNTEwODEgMy4zMTM4NlpNMTMuNDc5MSAzLjAwMzgySDcuMDQ0NDhMOC40MjE4NyA1LjM5MjY0SDE0Ljg1NjRMMTMuNDc5MSAzLjAwMzgyWk0xNS4zOTUyIDUuMDgyNkwxNi43Njc1IDIuNjk4ODZMMTUuMzk1MiAwLjMxMDAzOEwxNC4wMTc4IDIuNjkzNzhMMTUuMzk1MiA1LjA4MjZaIi8+Cjwvc3ZnPg==" style="height: 22px;" />
|
||||
</a>
|
||||
<a target="_blank" href="https://changelog.continue.dev" style="background:none">
|
||||
<img src="https://img.shields.io/badge/changelog-%96EFF3" style="height: 22px;" />
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@ import { BracketMatchingService } from "./filtering/BracketMatchingService.js";
|
|||
import { CompletionStreamer } from "./generation/CompletionStreamer.js";
|
||||
import { postprocessCompletion } from "./postprocessing/index.js";
|
||||
import { shouldPrefilter } from "./prefiltering/index.js";
|
||||
import { renderPromptWithTokenLimit } from "./templating/index.js";
|
||||
import { getAllSnippetsWithoutRace } from "./snippets/index.js";
|
||||
import { renderPrompt } from "./templating/index.js";
|
||||
import { GetLspDefinitionsFunction } from "./types.js";
|
||||
import { AutocompleteDebouncer } from "./util/AutocompleteDebouncer.js";
|
||||
import { AutocompleteLoggingService } from "./util/AutocompleteLoggingService.js";
|
||||
|
|
@ -186,11 +186,13 @@ export class CompletionProvider {
|
|||
this.ide.getWorkspaceDirs(),
|
||||
]);
|
||||
|
||||
const { prompt, prefix, suffix, completionOptions } = renderPrompt({
|
||||
snippetPayload,
|
||||
workspaceDirs,
|
||||
helper,
|
||||
});
|
||||
const { prompt, prefix, suffix, completionOptions } =
|
||||
renderPromptWithTokenLimit({
|
||||
snippetPayload,
|
||||
workspaceDirs,
|
||||
helper,
|
||||
llm,
|
||||
});
|
||||
|
||||
// Completion
|
||||
let completion: string | undefined = "";
|
||||
|
|
@ -208,6 +210,12 @@ export class CompletionProvider {
|
|||
const multiline =
|
||||
!helper.options.transform || shouldCompleteMultiline(helper);
|
||||
|
||||
const rawGeneration = await llm.complete(
|
||||
prompt,
|
||||
token,
|
||||
completionOptions,
|
||||
);
|
||||
|
||||
const completionStream =
|
||||
this.completionStreamer.streamCompletionWithFilters(
|
||||
token,
|
||||
|
|
|
|||
275
core/autocomplete/templating/__tests__/renderPrompt.vitest.ts
Normal file
275
core/autocomplete/templating/__tests__/renderPrompt.vitest.ts
Normal file
|
|
@ -0,0 +1,275 @@
|
|||
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
// ---------- Module mocks ----------
|
||||
|
||||
// Simple Handlebars mock that does naive placeholder substitution
|
||||
vi.mock("handlebars", () => {
|
||||
return {
|
||||
default: {
|
||||
compile: (template: string) => (ctx: Record<string, string>) => {
|
||||
return template
|
||||
.replace(/{{prefix}}/g, ctx.prefix)
|
||||
.replace(/{{suffix}}/g, ctx.suffix)
|
||||
.replace(/{{filename}}/g, ctx.filename ?? "")
|
||||
.replace(/{{reponame}}/g, ctx.reponame ?? "")
|
||||
.replace(/{{language}}/g, ctx.language ?? "");
|
||||
},
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
// Token utilities – we map 1 char = 1 token for simplicity
|
||||
vi.mock("../../../llm/countTokens", () => {
|
||||
const countTokens = (str: string) => str.length;
|
||||
const pruneLinesFromTop = (str: string, allowed: number) =>
|
||||
str.slice(Math.max(0, str.length - allowed));
|
||||
const pruneLinesFromBottom = (str: string, allowed: number) =>
|
||||
str.slice(0, allowed);
|
||||
const getTokenCountingBufferSafety = () => 0;
|
||||
|
||||
return {
|
||||
countTokens,
|
||||
pruneLinesFromTop,
|
||||
pruneLinesFromBottom,
|
||||
getTokenCountingBufferSafety,
|
||||
};
|
||||
});
|
||||
|
||||
// Snippet selection – configurable via constant return value
|
||||
vi.mock("../filtering", () => ({
|
||||
getSnippets: () => [],
|
||||
}));
|
||||
|
||||
// Snippet formatting
|
||||
const FORMATTED_SNIPPETS = "[FORMATTED_SNIPPETS]";
|
||||
vi.mock("../formatting", () => ({
|
||||
formatSnippets: () => FORMATTED_SNIPPETS,
|
||||
}));
|
||||
|
||||
// Stop tokens helper – we expose a variable so each test can override it
|
||||
let stopTokenReturn: string[] = ["<STOP>"];
|
||||
vi.mock("../getStopTokens", () => ({
|
||||
getStopTokens: () => stopTokenReturn,
|
||||
}));
|
||||
|
||||
// AutocompleteTemplate – provide overridable template + compiler + completionOptions
|
||||
let templateOverride: any = "{{prefix}}|{{suffix}}";
|
||||
let compileFnOverride: ((...args: any[]) => [string, string]) | undefined;
|
||||
let completionOptionsOverride: Record<string, any> | undefined;
|
||||
vi.mock("../AutocompleteTemplate", () => ({
|
||||
getTemplateForModel: () => ({
|
||||
template: templateOverride,
|
||||
compilePrefixSuffix: compileFnOverride,
|
||||
completionOptions: completionOptionsOverride ?? {},
|
||||
}),
|
||||
}));
|
||||
|
||||
// ---------- Imports after mocks ----------
|
||||
import { renderPrompt, renderPromptWithTokenLimit } from "..";
|
||||
import { AutocompleteLanguageInfo } from "../../constants/AutocompleteLanguageInfo";
|
||||
import { SnippetPayload } from "../../snippets";
|
||||
import { HelperVars } from "../../util/HelperVars";
|
||||
|
||||
// ---------- Helper builders ----------
|
||||
|
||||
const tsLang: AutocompleteLanguageInfo = {
|
||||
name: "TypeScript",
|
||||
topLevelKeywords: [],
|
||||
singleLineComment: "//",
|
||||
endOfLine: [";"],
|
||||
};
|
||||
|
||||
const emptySnippetPayload: SnippetPayload = {
|
||||
rootPathSnippets: [],
|
||||
importDefinitionSnippets: [],
|
||||
ideSnippets: [],
|
||||
recentlyEditedRangeSnippets: [],
|
||||
recentlyVisitedRangesSnippets: [],
|
||||
diffSnippets: [],
|
||||
clipboardSnippets: [],
|
||||
recentlyOpenedFileSnippets: [],
|
||||
staticSnippet: [],
|
||||
};
|
||||
|
||||
function makeHelper(overrides: any = {}) {
|
||||
return {
|
||||
input: {
|
||||
filepath: "file:///test.ts",
|
||||
pos: { line: 0, character: 0 },
|
||||
recentlyEditedRanges: [],
|
||||
recentlyVisitedRanges: [],
|
||||
...overrides.input,
|
||||
},
|
||||
prunedPrefix: "PRUNED_PREFIX",
|
||||
prunedSuffix: "PRUNED_SUFFIX",
|
||||
lang: tsLang,
|
||||
modelName: "test-model",
|
||||
filepath: "file:///test.ts",
|
||||
workspaceUris: [],
|
||||
options: {
|
||||
// Default template can be overridden per test
|
||||
template: "{{prefix}}|{{suffix}}",
|
||||
maxPromptTokens: 2048,
|
||||
prefixPercentage: 0.5,
|
||||
maxSuffixPercentage: 0.5,
|
||||
experimental_includeClipboard: false,
|
||||
useRecentlyOpened: false,
|
||||
experimental_includeRecentlyVisitedRanges: false,
|
||||
experimental_includeRecentlyEditedRanges: false,
|
||||
experimental_includeDiff: false,
|
||||
onlyMyCode: false,
|
||||
...overrides.options,
|
||||
},
|
||||
...overrides,
|
||||
} as unknown as HelperVars;
|
||||
}
|
||||
|
||||
afterEach(() => {
|
||||
// reset overridable mocks
|
||||
templateOverride = "{{prefix}}|{{suffix}}";
|
||||
compileFnOverride = undefined;
|
||||
completionOptionsOverride = undefined;
|
||||
stopTokenReturn = ["<STOP>"];
|
||||
vi.restoreAllMocks();
|
||||
});
|
||||
|
||||
// ---------- Test suite ----------
|
||||
|
||||
describe("renderPrompt prefix/suffix selection", () => {
|
||||
it("uses manuallyPassPrefix when provided", () => {
|
||||
const helper = makeHelper({
|
||||
input: { manuallyPassPrefix: "MANUAL" },
|
||||
});
|
||||
|
||||
const { prefix, suffix } = renderPrompt({
|
||||
snippetPayload: emptySnippetPayload,
|
||||
workspaceDirs: ["file:///workspace"],
|
||||
helper,
|
||||
});
|
||||
|
||||
expect(suffix).toBe("\n");
|
||||
expect(prefix.endsWith("MANUAL")).toBe(true);
|
||||
});
|
||||
|
||||
it("falls back to prunedPrefix when no manual prefix", () => {
|
||||
const helper = makeHelper({});
|
||||
|
||||
const { prefix } = renderPrompt({
|
||||
snippetPayload: emptySnippetPayload,
|
||||
workspaceDirs: ["file:///workspace"],
|
||||
helper,
|
||||
});
|
||||
|
||||
expect(prefix.includes("PRUNED_PREFIX")).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe("template rendering paths", () => {
|
||||
it("handles function template", () => {
|
||||
templateOverride = (
|
||||
p: string,
|
||||
s: string,
|
||||
_filepath: string,
|
||||
_reponame: string,
|
||||
) => `FUNC:${p}|${s}`;
|
||||
|
||||
const helper = makeHelper({ options: { template: undefined } });
|
||||
|
||||
const { prompt } = renderPrompt({
|
||||
snippetPayload: emptySnippetPayload,
|
||||
workspaceDirs: ["file:///workspace"],
|
||||
helper,
|
||||
});
|
||||
|
||||
expect(prompt.startsWith("FUNC:")).toBe(true);
|
||||
expect(prompt.includes("PRUNED_PREFIX")).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe("compilePrefixSuffix vs snippet formatting", () => {
|
||||
it("applies compilePrefixSuffix when provided", () => {
|
||||
compileFnOverride = (p: string, s: string) => [`COMP_${p}`, `COMP_${s}`];
|
||||
templateOverride = "{{prefix}}|{{suffix}}";
|
||||
const helper = makeHelper({ options: { template: undefined } });
|
||||
|
||||
const { prefix: compiledPrefix } = renderPrompt({
|
||||
snippetPayload: emptySnippetPayload,
|
||||
workspaceDirs: ["file:///workspace"],
|
||||
helper,
|
||||
});
|
||||
|
||||
expect(compiledPrefix.startsWith("COMP_PRUNED_PREFIX")).toBe(true);
|
||||
});
|
||||
|
||||
it("prepends formatted snippets when no compiler present", () => {
|
||||
const helper = makeHelper({});
|
||||
|
||||
const { prefix: compiledPrefix } = renderPrompt({
|
||||
snippetPayload: emptySnippetPayload,
|
||||
workspaceDirs: ["file:///workspace"],
|
||||
helper,
|
||||
});
|
||||
|
||||
expect(compiledPrefix.startsWith(`${FORMATTED_SNIPPETS}\n`)).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe("renderPromptWithTokenLimit parity & pruning", () => {
|
||||
it("matches renderPrompt when llm is undefined", () => {
|
||||
const helper = makeHelper({});
|
||||
|
||||
const res1 = renderPrompt({
|
||||
snippetPayload: emptySnippetPayload,
|
||||
workspaceDirs: ["file:///workspace"],
|
||||
helper,
|
||||
});
|
||||
|
||||
const res2 = renderPromptWithTokenLimit({
|
||||
snippetPayload: emptySnippetPayload,
|
||||
workspaceDirs: ["file:///workspace"],
|
||||
helper,
|
||||
llm: undefined,
|
||||
});
|
||||
|
||||
expect(res2).toEqual(res1);
|
||||
});
|
||||
|
||||
it("prunes prefix/suffix to respect small context length", () => {
|
||||
const longPrefix = "A".repeat(300);
|
||||
|
||||
const helper = makeHelper({ prunedPrefix: longPrefix });
|
||||
|
||||
const llmStub = {
|
||||
contextLength: 120,
|
||||
completionOptions: { maxTokens: 10 },
|
||||
model: "test-model",
|
||||
} as any;
|
||||
|
||||
const { prefix: compiledPrefix } = renderPromptWithTokenLimit({
|
||||
snippetPayload: emptySnippetPayload,
|
||||
workspaceDirs: ["file:///workspace"],
|
||||
helper,
|
||||
llm: llmStub,
|
||||
});
|
||||
|
||||
expect(compiledPrefix.length).toBeLessThan(120);
|
||||
});
|
||||
});
|
||||
|
||||
describe("stop-token merging", () => {
|
||||
it("returns stop tokens from getStopTokens", () => {
|
||||
stopTokenReturn = ["LANG_STOP", "TEMPLATE_STOP"];
|
||||
completionOptionsOverride = { stop: ["TEMPLATE_STOP"] };
|
||||
templateOverride = "{{prefix}}|{{suffix}}";
|
||||
|
||||
const helper = makeHelper({ options: { template: undefined } });
|
||||
|
||||
const { completionOptions } = renderPrompt({
|
||||
snippetPayload: emptySnippetPayload,
|
||||
workspaceDirs: ["file:///workspace"],
|
||||
helper,
|
||||
});
|
||||
|
||||
expect(completionOptions?.stop).toEqual(stopTokenReturn);
|
||||
});
|
||||
});
|
||||
|
|
@ -4,8 +4,17 @@ import { CompletionOptions } from "../..";
|
|||
import { AutocompleteLanguageInfo } from "../constants/AutocompleteLanguageInfo";
|
||||
import { HelperVars } from "../util/HelperVars";
|
||||
|
||||
import { ILLM } from "../../index.js";
|
||||
import { DEFAULT_MAX_TOKENS } from "../../llm/constants.js";
|
||||
import {
|
||||
countTokens,
|
||||
getTokenCountingBufferSafety,
|
||||
pruneLinesFromBottom,
|
||||
pruneLinesFromTop,
|
||||
} from "../../llm/countTokens";
|
||||
import { getUriPathBasename } from "../../util/uri";
|
||||
import { SnippetPayload } from "../snippets";
|
||||
import { AutocompleteSnippet } from "../snippets/types";
|
||||
import {
|
||||
AutocompleteTemplate,
|
||||
getTemplateForModel,
|
||||
|
|
@ -45,6 +54,49 @@ function renderStringTemplate(
|
|||
});
|
||||
}
|
||||
|
||||
/** Consolidates shared setup between renderPrompt and renderPromptWithTokenLimit. */
|
||||
function preparePromptContext({
|
||||
snippetPayload,
|
||||
workspaceDirs,
|
||||
helper,
|
||||
}: {
|
||||
snippetPayload: SnippetPayload;
|
||||
workspaceDirs: string[];
|
||||
helper: HelperVars;
|
||||
}): {
|
||||
prefix: string;
|
||||
suffix: string;
|
||||
reponame: string;
|
||||
template: AutocompleteTemplate["template"];
|
||||
compilePrefixSuffix: AutocompleteTemplate["compilePrefixSuffix"] | undefined;
|
||||
completionOptions: Partial<CompletionOptions> | undefined;
|
||||
snippets: AutocompleteSnippet[];
|
||||
} {
|
||||
// Determine base prefix/suffix, accounting for any manually supplied prefix.
|
||||
let prefix = helper.input.manuallyPassPrefix || helper.prunedPrefix;
|
||||
let suffix = helper.input.manuallyPassPrefix ? "" : helper.prunedSuffix;
|
||||
if (suffix === "") {
|
||||
suffix = "\n";
|
||||
}
|
||||
|
||||
const reponame = getUriPathBasename(workspaceDirs[0] ?? "myproject");
|
||||
|
||||
const { template, compilePrefixSuffix, completionOptions } =
|
||||
getTemplate(helper);
|
||||
|
||||
const snippets = getSnippets(helper, snippetPayload);
|
||||
|
||||
return {
|
||||
prefix,
|
||||
suffix,
|
||||
reponame,
|
||||
template,
|
||||
compilePrefixSuffix,
|
||||
completionOptions,
|
||||
snippets,
|
||||
};
|
||||
}
|
||||
|
||||
export function renderPrompt({
|
||||
snippetPayload,
|
||||
workspaceDirs,
|
||||
|
|
@ -59,22 +111,60 @@ export function renderPrompt({
|
|||
suffix: string;
|
||||
completionOptions: Partial<CompletionOptions> | undefined;
|
||||
} {
|
||||
// If prefix is manually passed
|
||||
let prefix = helper.input.manuallyPassPrefix || helper.prunedPrefix;
|
||||
let suffix = helper.input.manuallyPassPrefix ? "" : helper.prunedSuffix;
|
||||
if (suffix === "") {
|
||||
suffix = "\n";
|
||||
}
|
||||
const {
|
||||
prefix,
|
||||
suffix,
|
||||
reponame,
|
||||
template,
|
||||
compilePrefixSuffix,
|
||||
completionOptions,
|
||||
snippets,
|
||||
} = preparePromptContext({ snippetPayload, workspaceDirs, helper });
|
||||
|
||||
const reponame = getUriPathBasename(workspaceDirs[0] ?? "myproject");
|
||||
// Delegate prompt construction to buildPrompt to avoid duplication.
|
||||
const {
|
||||
prompt,
|
||||
prefix: compiledPrefix,
|
||||
suffix: compiledSuffix,
|
||||
} = buildPrompt(
|
||||
template,
|
||||
compilePrefixSuffix,
|
||||
prefix,
|
||||
suffix,
|
||||
helper,
|
||||
snippets,
|
||||
workspaceDirs,
|
||||
reponame,
|
||||
);
|
||||
|
||||
const { template, compilePrefixSuffix, completionOptions } =
|
||||
getTemplate(helper);
|
||||
const stopTokens = getStopTokens(
|
||||
completionOptions,
|
||||
helper.lang,
|
||||
helper.modelName,
|
||||
);
|
||||
|
||||
const snippets = getSnippets(helper, snippetPayload);
|
||||
return {
|
||||
prompt,
|
||||
prefix: compiledPrefix,
|
||||
suffix: compiledSuffix,
|
||||
completionOptions: {
|
||||
...completionOptions,
|
||||
stop: stopTokens,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
// Some models have prompts that need two passes. This lets us pass the compiled prefix/suffix
|
||||
// into either the 2nd template to generate a raw string, or to pass prefix, suffix to a FIM endpoint
|
||||
/** Builds the final prompt by applying prefix/suffix compilation or snippet formatting, then rendering the template. */
|
||||
function buildPrompt(
|
||||
template: AutocompleteTemplate["template"],
|
||||
compilePrefixSuffix: AutocompleteTemplate["compilePrefixSuffix"] | undefined,
|
||||
prefix: string,
|
||||
suffix: string,
|
||||
helper: HelperVars,
|
||||
snippets: AutocompleteSnippet[],
|
||||
workspaceDirs: string[],
|
||||
reponame: string,
|
||||
): { prompt: string; prefix: string; suffix: string } {
|
||||
if (compilePrefixSuffix) {
|
||||
[prefix, suffix] = compilePrefixSuffix(
|
||||
prefix,
|
||||
|
|
@ -85,12 +175,10 @@ export function renderPrompt({
|
|||
helper.workspaceUris,
|
||||
);
|
||||
} else {
|
||||
const formattedSnippets = formatSnippets(helper, snippets, workspaceDirs);
|
||||
prefix = [formattedSnippets, prefix].join("\n");
|
||||
const formatted = formatSnippets(helper, snippets, workspaceDirs);
|
||||
prefix = [formatted, prefix].join("\n");
|
||||
}
|
||||
|
||||
const prompt =
|
||||
// Templates can be passed as a Handlebars template string or a function
|
||||
typeof template === "string"
|
||||
? renderStringTemplate(
|
||||
template,
|
||||
|
|
@ -109,6 +197,105 @@ export function renderPrompt({
|
|||
snippets,
|
||||
helper.workspaceUris,
|
||||
);
|
||||
return { prompt, prefix, suffix };
|
||||
}
|
||||
|
||||
function pruneLength(llm: ILLM, prompt: string): number {
|
||||
const contextLength = llm.contextLength;
|
||||
const reservedTokens = llm.completionOptions.maxTokens ?? DEFAULT_MAX_TOKENS;
|
||||
const safetyBuffer = getTokenCountingBufferSafety(contextLength);
|
||||
const maxAllowedPromptTokens = contextLength - reservedTokens - safetyBuffer;
|
||||
const promptTokenCount = countTokens(prompt, llm.model);
|
||||
return promptTokenCount - maxAllowedPromptTokens;
|
||||
}
|
||||
|
||||
export function renderPromptWithTokenLimit({
|
||||
snippetPayload,
|
||||
workspaceDirs,
|
||||
helper,
|
||||
llm,
|
||||
}: {
|
||||
snippetPayload: SnippetPayload;
|
||||
workspaceDirs: string[];
|
||||
helper: HelperVars;
|
||||
llm: ILLM | undefined;
|
||||
}): {
|
||||
prompt: string;
|
||||
prefix: string;
|
||||
suffix: string;
|
||||
completionOptions: Partial<CompletionOptions> | undefined;
|
||||
} {
|
||||
const {
|
||||
prefix: initialPrefix,
|
||||
suffix: initialSuffix,
|
||||
reponame,
|
||||
template,
|
||||
compilePrefixSuffix,
|
||||
completionOptions,
|
||||
snippets,
|
||||
} = preparePromptContext({ snippetPayload, workspaceDirs, helper });
|
||||
|
||||
// We'll mutate prefix/suffix during pruning, so copy them.
|
||||
let prefix = initialPrefix;
|
||||
let suffix = initialSuffix;
|
||||
|
||||
let {
|
||||
prompt,
|
||||
prefix: compiledPrefix,
|
||||
suffix: compiledSuffix,
|
||||
} = buildPrompt(
|
||||
template,
|
||||
compilePrefixSuffix,
|
||||
prefix,
|
||||
suffix,
|
||||
helper,
|
||||
snippets,
|
||||
workspaceDirs,
|
||||
reponame,
|
||||
);
|
||||
|
||||
// Truncate prefix and suffix if prompt tokens exceed maxAllowedPromptTokens
|
||||
if (llm) {
|
||||
const prune = pruneLength(llm, prompt);
|
||||
if (prune > 0) {
|
||||
const tokensToDrop = prune;
|
||||
const prefixTokenCount = countTokens(prefix, helper.modelName);
|
||||
const suffixTokenCount = countTokens(suffix, helper.modelName);
|
||||
const totalContextTokens = prefixTokenCount + suffixTokenCount;
|
||||
if (totalContextTokens > 0) {
|
||||
const dropPrefix = Math.ceil(
|
||||
tokensToDrop * (prefixTokenCount / totalContextTokens),
|
||||
);
|
||||
const dropSuffix = Math.ceil(tokensToDrop - dropPrefix);
|
||||
const allowedPrefixTokens = Math.max(0, prefixTokenCount - dropPrefix);
|
||||
const allowedSuffixTokens = Math.max(0, suffixTokenCount - dropSuffix);
|
||||
prefix = pruneLinesFromTop(
|
||||
prefix,
|
||||
allowedPrefixTokens,
|
||||
helper.modelName,
|
||||
);
|
||||
suffix = pruneLinesFromBottom(
|
||||
suffix,
|
||||
allowedSuffixTokens,
|
||||
helper.modelName,
|
||||
);
|
||||
}
|
||||
({
|
||||
prompt,
|
||||
prefix: compiledPrefix,
|
||||
suffix: compiledSuffix,
|
||||
} = buildPrompt(
|
||||
template,
|
||||
compilePrefixSuffix,
|
||||
prefix,
|
||||
suffix,
|
||||
helper,
|
||||
snippets,
|
||||
workspaceDirs,
|
||||
reponame,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
const stopTokens = getStopTokens(
|
||||
completionOptions,
|
||||
|
|
@ -118,8 +305,8 @@ export function renderPrompt({
|
|||
|
||||
return {
|
||||
prompt,
|
||||
prefix,
|
||||
suffix,
|
||||
prefix: compiledPrefix,
|
||||
suffix: compiledSuffix,
|
||||
completionOptions: {
|
||||
...completionOptions,
|
||||
stop: stopTokens,
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ export class ControlPlaneClient {
|
|||
}));
|
||||
}
|
||||
|
||||
const resp = await this.request("ide/sync-secrets", {
|
||||
const resp = await this.requestAndHandleError("ide/sync-secrets", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({ fqsns, orgScopeId }),
|
||||
});
|
||||
|
|
@ -101,6 +101,15 @@ export class ControlPlaneClient {
|
|||
},
|
||||
});
|
||||
|
||||
return resp;
|
||||
}
|
||||
|
||||
private async requestAndHandleError(
|
||||
path: string,
|
||||
init: RequestInit,
|
||||
): Promise<Response> {
|
||||
const resp = await this.request(path, init);
|
||||
|
||||
if (!resp.ok) {
|
||||
throw new Error(
|
||||
`Control plane request failed: ${resp.status} ${await resp.text()}`,
|
||||
|
|
@ -128,7 +137,7 @@ export class ControlPlaneClient {
|
|||
? `ide/list-assistants?organizationId=${organizationId}`
|
||||
: "ide/list-assistants";
|
||||
|
||||
const resp = await this.request(url, {
|
||||
const resp = await this.requestAndHandleError(url, {
|
||||
method: "GET",
|
||||
});
|
||||
return (await resp.json()) as any;
|
||||
|
|
@ -142,15 +151,48 @@ export class ControlPlaneClient {
|
|||
return [];
|
||||
}
|
||||
|
||||
try {
|
||||
// We try again here because when users sign up with an email domain that is
|
||||
// captured by an org, we need to wait for the user account creation webhook to
|
||||
// take effect. Otherwise the organization(s) won't show up.
|
||||
// This error manifests as a 404 (user not found)
|
||||
let retries = 0;
|
||||
const maxRetries = 10;
|
||||
const maxWaitTime = 20000; // 20 seconds in milliseconds
|
||||
|
||||
while (retries < maxRetries) {
|
||||
const resp = await this.request("ide/list-organizations", {
|
||||
method: "GET",
|
||||
});
|
||||
|
||||
if (resp.status === 404) {
|
||||
retries++;
|
||||
if (retries >= maxRetries) {
|
||||
console.warn(
|
||||
`Failed to list organizations after ${maxRetries} retries: user not found`,
|
||||
);
|
||||
return [];
|
||||
}
|
||||
const waitTime = Math.min(
|
||||
Math.pow(2, retries) * 100,
|
||||
maxWaitTime / maxRetries,
|
||||
);
|
||||
await new Promise((resolve) => setTimeout(resolve, waitTime));
|
||||
continue;
|
||||
} else if (!resp.ok) {
|
||||
console.warn(
|
||||
`Failed to list organizations (${resp.status}): ${await resp.text()}`,
|
||||
);
|
||||
return [];
|
||||
}
|
||||
const { organizations } = (await resp.json()) as any;
|
||||
return organizations;
|
||||
} catch (e) {
|
||||
return [];
|
||||
}
|
||||
|
||||
// This should never be reached due to the while condition, but adding for safety
|
||||
console.warn(
|
||||
`Failed to list organizations after ${maxRetries} retries: maximum attempts exceeded`,
|
||||
);
|
||||
return [];
|
||||
}
|
||||
|
||||
public async listAssistantFullSlugs(
|
||||
|
|
@ -165,7 +207,7 @@ export class ControlPlaneClient {
|
|||
: "ide/list-assistant-full-slugs";
|
||||
|
||||
try {
|
||||
const resp = await this.request(url, {
|
||||
const resp = await this.requestAndHandleError(url, {
|
||||
method: "GET",
|
||||
});
|
||||
const { fullSlugs } = (await resp.json()) as any;
|
||||
|
|
@ -181,7 +223,7 @@ export class ControlPlaneClient {
|
|||
}
|
||||
|
||||
try {
|
||||
const resp = await this.request("ide/free-trial-status", {
|
||||
const resp = await this.requestAndHandleError("ide/free-trial-status", {
|
||||
method: "GET",
|
||||
});
|
||||
return (await resp.json()) as FreeTrialStatus;
|
||||
|
|
@ -212,7 +254,7 @@ export class ControlPlaneClient {
|
|||
params.set("vscode_uri_scheme", vsCodeUriScheme);
|
||||
}
|
||||
|
||||
const resp = await this.request(
|
||||
const resp = await this.requestAndHandleError(
|
||||
`ide/get-models-add-on-checkout-url?${params.toString()}`,
|
||||
{
|
||||
method: "GET",
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ export default {
|
|||
"ts-jest",
|
||||
{
|
||||
useESM: true,
|
||||
useIsolatedModules: true,
|
||||
isolatedModules: true,
|
||||
tsconfig: {
|
||||
experimentalDecorators: true,
|
||||
emitDecoratorMetadata: true,
|
||||
|
|
|
|||
|
|
@ -355,7 +355,7 @@ function pruneStringFromTop(
|
|||
|
||||
const MAX_TOKEN_SAFETY_BUFFER = 1000;
|
||||
const TOKEN_SAFETY_PROPORTION = 0.02;
|
||||
function getTokenCountingBufferSafety(contextLength: number) {
|
||||
export function getTokenCountingBufferSafety(contextLength: number) {
|
||||
return Math.min(
|
||||
MAX_TOKEN_SAFETY_BUFFER,
|
||||
contextLength * TOKEN_SAFETY_PROPORTION,
|
||||
|
|
|
|||
|
|
@ -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)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
58
core/package-lock.json
generated
58
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",
|
||||
|
|
@ -146,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"
|
||||
},
|
||||
|
|
@ -168,16 +168,42 @@
|
|||
"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.1.1",
|
||||
"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.16",
|
||||
"@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",
|
||||
|
|
@ -2927,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",
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ function getPreferredShell(): string {
|
|||
const platform = os.platform();
|
||||
|
||||
if (platform === "win32") {
|
||||
return process.env.COMSPEC || "cmd.exe";
|
||||
return "powershell.exe";
|
||||
} else if (platform === "darwin") {
|
||||
return process.env.SHELL || "/bin/zsh";
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -16,6 +16,19 @@ function getDecodedOutput(data: Buffer): string {
|
|||
} else {
|
||||
return data.toString();
|
||||
}
|
||||
} // Simple helper function to use login shell on Unix/macOS and PowerShell on Windows
|
||||
function getShellCommand(command: string): { shell: string; args: string[] } {
|
||||
if (process.platform === "win32") {
|
||||
// Windows: Use PowerShell
|
||||
return {
|
||||
shell: "powershell.exe",
|
||||
args: ["-NoLogo", "-ExecutionPolicy", "Bypass", "-Command", command],
|
||||
};
|
||||
} else {
|
||||
// Unix/macOS: Use login shell to source .bashrc/.zshrc etc.
|
||||
const userShell = process.env.SHELL || "/bin/bash";
|
||||
return { shell: userShell, args: ["-l", "-c", command] };
|
||||
}
|
||||
}
|
||||
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
|
@ -88,9 +101,9 @@ export const runTerminalCommandImpl: ToolImpl = async (args, extras) => {
|
|||
}
|
||||
|
||||
// Use spawn with color environment
|
||||
const childProc = childProcess.spawn(command, {
|
||||
const { shell, args } = getShellCommand(command);
|
||||
const childProc = childProcess.spawn(shell, args, {
|
||||
cwd,
|
||||
shell: true,
|
||||
env: getColorEnv(), // Add enhanced environment for colors
|
||||
});
|
||||
|
||||
|
|
@ -232,11 +245,49 @@ export const runTerminalCommandImpl: ToolImpl = async (args, extras) => {
|
|||
if (waitForCompletion) {
|
||||
// Standard execution, waiting for completion
|
||||
try {
|
||||
// Use color environment for exec as well
|
||||
const output = await asyncExec(command, {
|
||||
cwd,
|
||||
env: getColorEnv(),
|
||||
});
|
||||
// Use spawn approach for consistency with streaming version
|
||||
const { shell: nonStreamingShell, args: nonStreamingArgs } =
|
||||
getShellCommand(command);
|
||||
const output = await new Promise<{ stdout: string; stderr: string }>(
|
||||
(resolve, reject) => {
|
||||
const childProc = childProcess.spawn(
|
||||
nonStreamingShell,
|
||||
nonStreamingArgs,
|
||||
{
|
||||
cwd,
|
||||
env: getColorEnv(),
|
||||
},
|
||||
);
|
||||
|
||||
let stdout = "";
|
||||
let stderr = "";
|
||||
|
||||
childProc.stdout?.on("data", (data) => {
|
||||
stdout += getDecodedOutput(data);
|
||||
});
|
||||
|
||||
childProc.stderr?.on("data", (data) => {
|
||||
stderr += getDecodedOutput(data);
|
||||
});
|
||||
|
||||
childProc.on("close", (code) => {
|
||||
if (code === 0) {
|
||||
resolve({ stdout, stderr });
|
||||
} else {
|
||||
const error = new Error(
|
||||
`Command failed with exit code ${code}`,
|
||||
);
|
||||
(error as any).stderr = stderr;
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
|
||||
childProc.on("error", (error) => {
|
||||
reject(error);
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
const status = "Command completed";
|
||||
return [
|
||||
{
|
||||
|
|
@ -262,9 +313,10 @@ export const runTerminalCommandImpl: ToolImpl = async (args, extras) => {
|
|||
// but don't attach any listeners other than error
|
||||
try {
|
||||
// Use spawn with color environment
|
||||
const childProc = childProcess.spawn(command, {
|
||||
const { shell: detachedShell, args: detachedArgs } =
|
||||
getShellCommand(command);
|
||||
const childProc = childProcess.spawn(detachedShell, detachedArgs, {
|
||||
cwd,
|
||||
shell: true,
|
||||
env: getColorEnv(), // Add color environment
|
||||
// Detach the process so it's not tied to the parent
|
||||
detached: true,
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@ title: "Overview"
|
|||
description: "Continue can be deeply customized. For example you might:"
|
||||
---
|
||||
|
||||
- **Change your Model Provider**. Continue allows you to choose your favorite or even add multiple model providers. This allows you to use different models for different tasks, or to try another model if you're not happy with the results from your current model. Continue supports all of the popular model providers, including OpenAI, Anthropic, Microsoft/Azure, Mistral, and more. You can even self host your own model provider if you'd like. Learn more about [model providers](/customization/models#openai).
|
||||
- **Change your Model Provider**. Continue allows you to choose your favorite or even add multiple model providers. This allows you to use different models for different tasks, or to try another model if you're not happy with the results from your current model. Continue supports all of the popular model providers, including OpenAI, Anthropic, Microsoft/Azure, Mistral, and more. You can even self host your own model provider if you'd like. Learn more about [model providers](/customize/model-providers/top-level/openai).
|
||||
- **Select different models for specific tasks**. Different Continue features can use different models. We call these _model roles_. For example, you can use a different model for chat than you do for autocomplete. Learn more about [model roles](/customize/model-roles).
|
||||
- **Add a Context Provider**. Context providers allow you to add information to your prompts, giving your LLM additional context to work with. Context providers allow you to reference snippets from your codebase, or lookup relevant documentation, or use a search engine to find information and much more. Learn more about [context providers](/customize/custom-providers).
|
||||
- **Create a Slash Command**. Slash commands allow you to easily add custom functionality to Continue. You can use a slash command that allows you to generate a shell command from natural language, or perhaps generate a commit message, or create your own custom command to do whatever you want. Learn more about [slash commands](/customization/overview#slash-commands).
|
||||
- **Create a Slash Command**. Slash commands allow you to easily add custom functionality to Continue. You can use a slash command that allows you to generate a shell command from natural language, or perhaps generate a commit message, or create your own custom command to do whatever you want. Learn more about [slash commands](/customize/deep-dives/slash-commands).
|
||||
- **Call external tools and functions**. Unchain your LLM with the power of tools using [Agent](/features/agent/quick-start). Add custom tools using [MCP Servers](/customization/mcp-tools)
|
||||
|
||||
Whatever you choose, you'll probably start by editing your Assistant.
|
||||
|
|
@ -18,4 +18,4 @@ You can easily access your assistant configuration from the Continue Chat sideba
|
|||

|
||||
|
||||
- See [Editing Hub Assistants](/hub/assistants/edit-an-assistant) for more details on managing your hub assistant
|
||||
- See the [Config Deep Dive](/customization/overview#configuration) for more details on configuring local assistants.
|
||||
- See the [Config Deep Dive](/reference) for more details on configuring local assistants.
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ Documentation sources may be suggested based on package files in your repo. This
|
|||
- Packages with partial information (with a pen icon) can be clicked to fill the form with the available information
|
||||
- Note that you can hover over the information icon to see where the package suggestion was found.
|
||||
|
||||

|
||||

|
||||
|
||||
### In a configuration file
|
||||
|
||||
|
|
@ -212,8 +212,9 @@ If your documentation is private, you can skip the default crawler and use a loc
|
|||
</Tabs>
|
||||
|
||||
<Info>
|
||||
Chromium crawling has been deprecated
|
||||
{/* The default local crawler is a lightweight tool that cannot render sites that are dynamically generated using JavaScript. If your sites need to be rendered, you can enable the experimental `Use Chromium for Docs Crawling` feature from your [User Settings Page](../deep-dives/settings.md) This will download and install Chromium to `~/.continue/.utils`, and use it as the local crawler. */}
|
||||
The default local crawler is a lightweight tool that cannot render sites that are dynamically generated using JavaScript. If your sites need to be rendered, you can enable the experimental `Use Chromium for Docs Crawling` feature from your [User Settings Page](../settings) This will download and install Chromium to `~/.continue/.utils`, and use it as the local crawler.
|
||||
|
||||
**Note:** Chromium crawling support is being deprecated and may be removed in future versions.
|
||||
</Info>
|
||||
|
||||
Further notes:
|
||||
|
|
@ -230,11 +231,11 @@ You can view indexing statuses and manage your documentation sites from the `@do
|
|||
- Failed indexing attempts will show an error status bar and icon
|
||||
- Delete a documentation site from your configuration using the trash icon
|
||||
|
||||

|
||||

|
||||
|
||||
You can also view the overall status of currently indexing docs from a hideable progress bar at the bottom of the chat page
|
||||
|
||||

|
||||

|
||||
|
||||
You can also use the following IDE command to force a re-index of all docs: `Continue: Docs Force Re-Index`.
|
||||
|
||||
|
|
@ -400,4 +401,4 @@ The following configuration example includes:
|
|||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
{/* This could also involve enabling Chromium as a backup for local documentation the [User Settings Page](../deep-dives/settings.md). */}
|
||||
This setup could also involve enabling Chromium as a backup for local documentation through the [User Settings Page](../settings).
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ These roles can be specified for a `config.yaml` model block using `roles`. See
|
|||
|
||||
You can control which of the models in your assistant for a given role will be currently used for that role. Above the main input, click the 3 dots and then the cube icon to expand the `Models` section. Then you can use the dropdowns to select an active model for each role.
|
||||
|
||||

|
||||

|
||||
|
||||
<Info>
|
||||
`roles` are not explicitly defined within `config.json` (deprecated) - they
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ Learn more about context providers [here](/reference#context), and check out [th
|
|||
|
||||
Docs are blocks that point to documentation sites, which will be indexed locally and then can be referenced as context using @Docs in Chat. [Explore docs](https://hub.continue.dev/explore/docs) on the hub.
|
||||
|
||||
Learn more in the [@Docs deep dive](/customization/overview#documentation-context), and view [`docs`](/reference#docs) in the YAML Reference for more details.
|
||||
Learn more in the [@Docs context provider documentation](/customize/context/documentation), and view [`docs`](/reference#docs) in the YAML Reference for more details.
|
||||
|
||||
## MCP Servers
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
<div align="center">
|
||||
|
||||
[**Continue**](https://docs.continue.dev) enables developers to create, share, and use custom AI code assistants with our open-source [JetBrains](https://plugins.jetbrains.com/plugin/22707-continue-extension) extension and [hub of models, rules, prompts, docs, and other building blocks](https://hub.continue.dev).
|
||||
[**Continue**](https://docs.continue.dev) enables developers to create, share, and use custom AI code assistants with our open-source [JetBrains extension](https://plugins.jetbrains.com/plugin/22707-continue-extension) and [hub of models, rules, prompts, docs, and other building blocks](https://hub.continue.dev).
|
||||
|
||||
</div>
|
||||
|
||||
|
|
@ -38,6 +38,6 @@ Agent equips the Chat model with the tools needed to handle a wide range of codi
|
|||
|
||||
## License
|
||||
|
||||
[Apache 2.0 © 2023-2024 Continue Dev, Inc.](./LICENSE)
|
||||
[Apache 2.0 © 2023-2025 Continue Dev, Inc.](./LICENSE)
|
||||
|
||||
<!-- Plugin description end -->
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
<div align="center">
|
||||
|
||||
**[Continue](https://docs.continue.dev) enables to developers create, share, and use custom AI code assistants with our open-source [VS Code](https://marketplace.visualstudio.com/items?itemName=Continue.continue) extension and [hub of models, rules, prompts, docs, and other building blocks](https://hub.continue.dev)**
|
||||
**[Continue](https://docs.continue.dev) enables developers to create, share, and use custom AI code assistants with our open-source [VS Code extension](https://marketplace.visualstudio.com/items?itemName=Continue.continue) and [hub of models, rules, prompts, docs, and other building blocks](https://hub.continue.dev)**
|
||||
|
||||
</div>
|
||||
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
<img src="https://img.shields.io/badge/License-Apache_2.0-blue.svg" style="height: 22px;" />
|
||||
</a>
|
||||
<a target="_blank" href="https://docs.continue.dev" style="background:none">
|
||||
<img src="https://img.shields.io/badge/continue_docs-%23BE1B55" style="height: 22px;" />
|
||||
<img src="https://img.shields.io/badge/Continue-docs-%23BE1B55.svg?logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNiAyNCIgZmlsbD0id2hpdGUiPgogIDxwYXRoIGQ9Ik0yMC41Mjg2IDMuMjY4MTFMMTkuMTUxMiA1LjY1Njk0TDIyLjYzMjggMTEuNjg0OUMyMi42NTgyIDExLjczMDYgMjIuNjczNSAxMS43ODY2IDIyLjY3MzUgMTEuODM3NEMyMi42NzM1IDExLjg4ODIgMjIuNjU4MiAxMS45NDQxIDIyLjYzMjggMTEuOTg5OUwxOS4xNTEyIDE4LjAyMjlMMjAuNTI4NiAyMC40MTE3TDI1LjQ3OTEgMTEuODM3NEwyMC41Mjg2IDMuMjYzMDNWMy4yNjgxMVpNMTguNjE3NiA1LjM0NjlMMTkuOTk1IDIuOTU4MDdIMTcuMjQwMkwxNS44NjI4IDUuMzQ2OUgxOC42MjI3SDE4LjYxNzZaTTE1Ljg1NzcgNS45NjY5N0wxOS4wNzUgMTEuNTMyNEgyMS44Mjk4TDE4LjYxNzYgNS45NjY5N0gxNS44NTc3Wk0xOC42MTc2IDE3LjcxNzlMMjEuODI5OCAxMi4xNDc0SDE5LjA3NUwxNS44NTc3IDE3LjcxNzlIMTguNjE3NlpNMTUuODU3NyAxOC4zMzhMMTcuMjM1MSAyMC43MTY3SDE5Ljk4OTlMMTguNjEyNSAxOC4zMzhIMTUuODUyNkgxNS44NTc3Wk02LjUyMDk4IDIxLjMwNjNDNi40NjUwNyAyMS4zMDYzIDYuNDE0MjQgMjEuMjkxIDYuMzY4NSAyMS4yNjU2QzYuMzIyNzYgMjEuMjQwMiA2LjI4MjA5IDIxLjE5OTUgNi4yNTY2OCAyMS4xNTM4TDIuNzcwMDIgMTUuMTIwN0gwLjAxNTI0ODJMNC45NjU3IDIzLjY5SDE0Ljg2MTVMMTMuNDg0MSAyMS4zMDYzSDYuNTI2MDZINi41MjA5OFpNMTQuMDE3OCAyMC45OTYyTDE1LjM5NTIgMjMuMzhMMTYuNzcyNiAyMC45OTExTDE1LjM5NTIgMTguNjAyM0wxNC4wMTc4IDIwLjk5MTFWMjAuOTk2MlpNMTQuODYxNSAxOC4yOTc0SDguNDM3MTJMNy4wNTk3MyAyMC42ODYySDEzLjQ4NDFMMTQuODYxNSAxOC4yOTc0Wk03Ljg5ODM2IDE3Ljk5MjRMNC42ODEwOCAxMi40MjE5TDMuMzAzNjkgMTQuODEwN0w2LjUyMDk4IDIwLjM4MTJMNy44OTgzNiAxNy45OTI0Wk0wLjAxMDE2NTQgMTQuNTAwN0gyLjc2NDk0TDQuMTQyMzIgMTIuMTExOEgxLjM5MjYzTDAuMDEwMTY1NCAxNC41MDA3Wk02LjI0MTQzIDIuNTQxM0M2LjI2Njg1IDIuNDk1NTYgNi4zMDc1MSAyLjQ1NDkgNi4zNTMyNSAyLjQyOTQ4QzYuMzk5IDIuNDA0MDcgNi40NTQ5IDIuMzg4ODIgNi41MDU3MyAyLjM4ODgySDEzLjQ3NEwxNC44NTE0IDBINC45NTA0NUwwIDguNTc0MzVIMi43NTQ3N0w2LjIzMTI3IDIuNTQ2MzhMNi4yNDE0MyAyLjU0MTNaTTQuMTQyMzIgMTEuNTc4MkwyLjc2NDk0IDkuMTg5MzRIMC4wMTAxNjU0TDEuMzg3NTUgMTEuNTc4Mkg0LjE0MjMyWk02LjUxMDgxIDMuMzEzODZMMy4yOTg2MSA4Ljg3OTNMNC42NzU5OSAxMS4yNjgxTDcuODg4MiA1LjcwMjY4TDYuNTEwODEgMy4zMTM4NlpNMTMuNDc5MSAzLjAwMzgySDcuMDQ0NDhMOC40MjE4NyA1LjM5MjY0SDE0Ljg1NjRMMTMuNDc5MSAzLjAwMzgyWk0xNS4zOTUyIDUuMDgyNkwxNi43Njc1IDIuNjk4ODZMMTUuMzk1MiAwLjMxMDAzOEwxNC4wMTc4IDIuNjkzNzhMMTUuMzk1MiA1LjA4MjZaIi8+Cjwvc3ZnPg==" style="height: 22px;" />
|
||||
</a>
|
||||
<a target="_blank" href="https://discord.gg/vapESyrFmJ" style="background:none">
|
||||
<img src="https://img.shields.io/badge/discord-join-continue.svg?labelColor=191937&color=6F6FF7&logo=discord" style="height: 22px;" />
|
||||
|
|
@ -30,30 +30,30 @@
|
|||
|
||||
[Agent](https://continue.dev/docs/agent/how-to-use-it) enables you to make more substantial changes to your codebase
|
||||
|
||||

|
||||

|
||||
|
||||
## Chat
|
||||
|
||||
[Chat](https://continue.dev/docs/chat/how-to-use-it) makes it easy to ask for help from an LLM without needing to leave
|
||||
the IDE
|
||||
|
||||

|
||||

|
||||
|
||||
## Autocomplete
|
||||
|
||||
[Autocomplete](https://continue.dev/docs/autocomplete/how-to-use-it) provides inline code suggestions as you type
|
||||
|
||||

|
||||

|
||||
|
||||
## Edit
|
||||
|
||||
[Edit](https://continue.dev/docs/edit/how-to-use-it) is a convenient way to modify code without leaving your current
|
||||
file
|
||||
|
||||

|
||||

|
||||
|
||||
</div>
|
||||
|
||||
## License
|
||||
|
||||
[Apache 2.0 © 2023-2024 Continue Dev, Inc.](./LICENSE)
|
||||
[Apache 2.0 © 2023-2025 Continue Dev, Inc.](./LICENSE)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import { expect } from "chai";
|
||||
import * as fs from "fs/promises";
|
||||
|
||||
import { expect } from "chai";
|
||||
import { EditorView, TextEditor } from "vscode-extension-tester";
|
||||
|
||||
import { GlobalActions } from "../actions/Global.actions";
|
||||
|
|
|
|||
|
|
@ -1,47 +0,0 @@
|
|||
import { expect } from "chai";
|
||||
import { EditorView, TextEditor } from "vscode-extension-tester";
|
||||
|
||||
import { GlobalActions } from "../actions/Global.actions";
|
||||
import { NextEditActions } from "../actions/NextEdit.actions";
|
||||
import { DEFAULT_TIMEOUT } from "../constants";
|
||||
|
||||
describe("Next Edit", () => {
|
||||
let editor: TextEditor;
|
||||
|
||||
before(async function () {
|
||||
process.env.NEXT_EDIT_TEST_ENABLED = "true";
|
||||
});
|
||||
|
||||
beforeEach(async function () {
|
||||
this.timeout(DEFAULT_TIMEOUT.XL);
|
||||
|
||||
await GlobalActions.openTestWorkspace();
|
||||
({ editor } = await GlobalActions.createAndOpenNewTextFile());
|
||||
});
|
||||
|
||||
afterEach(async function () {
|
||||
this.timeout(DEFAULT_TIMEOUT.XL);
|
||||
|
||||
await editor.clearText();
|
||||
await new EditorView().closeAllEditors();
|
||||
});
|
||||
|
||||
after(async function () {
|
||||
process.env.NEXT_EDIT_TEST_ENABLED = "false";
|
||||
});
|
||||
|
||||
it("Should force a Next Edit", async () => {
|
||||
const hasDecoration = await NextEditActions.forceNextEdit(editor);
|
||||
expect(hasDecoration).to.be.true;
|
||||
}).timeout(DEFAULT_TIMEOUT.XL);
|
||||
|
||||
it("Should accept Next Edit suggestion with Tab", async () => {
|
||||
const accepted = await NextEditActions.acceptNextEditSuggestion(editor);
|
||||
expect(accepted).to.be.true;
|
||||
}).timeout(DEFAULT_TIMEOUT.XL);
|
||||
|
||||
it("Should reject Next Edit suggestion with Esc", async () => {
|
||||
const rejected = await NextEditActions.rejectNextEditSuggestion(editor);
|
||||
expect(rejected).to.be.true;
|
||||
}).timeout(DEFAULT_TIMEOUT.XL);
|
||||
});
|
||||
BIN
extensions/vscode/media/agent.gif
Normal file
BIN
extensions/vscode/media/agent.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.7 MiB |
BIN
extensions/vscode/media/autocomplete.gif
Normal file
BIN
extensions/vscode/media/autocomplete.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.9 MiB |
BIN
extensions/vscode/media/chat.gif
Normal file
BIN
extensions/vscode/media/chat.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.8 MiB |
BIN
extensions/vscode/media/edit.gif
Normal file
BIN
extensions/vscode/media/edit.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.6 MiB |
76
extensions/vscode/package-lock.json
generated
76
extensions/vscode/package-lock.json
generated
|
|
@ -1,16 +1,16 @@
|
|||
{
|
||||
"name": "continue",
|
||||
"version": "1.1.69",
|
||||
"version": "1.1.67",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "continue",
|
||||
"version": "1.1.69",
|
||||
"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",
|
||||
|
|
@ -208,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",
|
||||
|
|
@ -703,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",
|
||||
|
|
@ -16742,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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -737,8 +737,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",
|
||||
|
|
|
|||
|
|
@ -67,19 +67,32 @@ const isLinuxTarget = target?.startsWith("linux");
|
|||
const isMacTarget = target?.startsWith("darwin");
|
||||
|
||||
void (async () => {
|
||||
console.log("[info] Packaging extension for target ", target);
|
||||
const startTime = Date.now();
|
||||
console.log(
|
||||
`[info] Packaging extension for target ${target} - started at ${new Date().toISOString()}`,
|
||||
);
|
||||
|
||||
// Make sure we have an initial timestamp file
|
||||
writeBuildTimestamp();
|
||||
|
||||
if (!skipInstalls) {
|
||||
const installStart = Date.now();
|
||||
console.log(`[timer] Starting npm installs at ${new Date().toISOString()}`);
|
||||
await Promise.all([generateAndCopyConfigYamlSchema(), npmInstall()]);
|
||||
console.log(
|
||||
`[timer] npm installs completed in ${Date.now() - installStart}ms`,
|
||||
);
|
||||
}
|
||||
|
||||
process.chdir(path.join(continueDir, "gui"));
|
||||
|
||||
if (isInGitHubAction) {
|
||||
const guiBuildStart = Date.now();
|
||||
console.log(`[timer] Starting GUI build at ${new Date().toISOString()}`);
|
||||
execCmdSync("npm run build");
|
||||
console.log(
|
||||
`[timer] GUI build completed in ${Date.now() - guiBuildStart}ms`,
|
||||
);
|
||||
}
|
||||
|
||||
// Copy over the dist folder to the JetBrains extension //
|
||||
|
|
@ -98,6 +111,8 @@ void (async () => {
|
|||
rimrafSync(intellijExtensionWebviewPath);
|
||||
fs.mkdirSync(intellijExtensionWebviewPath, { recursive: true });
|
||||
|
||||
const jetbrainsCopyStart = Date.now();
|
||||
console.log(`[timer] Starting JetBrains copy at ${new Date().toISOString()}`);
|
||||
await new Promise((resolve, reject) => {
|
||||
ncp("dist", intellijExtensionWebviewPath, (error) => {
|
||||
if (error) {
|
||||
|
|
@ -110,6 +125,9 @@ void (async () => {
|
|||
resolve();
|
||||
});
|
||||
});
|
||||
console.log(
|
||||
`[timer] JetBrains copy completed in ${Date.now() - jetbrainsCopyStart}ms`,
|
||||
);
|
||||
|
||||
// Put back index.html
|
||||
if (fs.existsSync(indexHtmlPath)) {
|
||||
|
|
@ -123,6 +141,8 @@ void (async () => {
|
|||
// Then copy over the dist folder to the VSCode extension //
|
||||
const vscodeGuiPath = path.join("../extensions/vscode/gui");
|
||||
fs.mkdirSync(vscodeGuiPath, { recursive: true });
|
||||
const vscodeCopyStart = Date.now();
|
||||
console.log(`[timer] Starting VSCode copy at ${new Date().toISOString()}`);
|
||||
await new Promise((resolve, reject) => {
|
||||
ncp("dist", vscodeGuiPath, (error) => {
|
||||
if (error) {
|
||||
|
|
@ -137,6 +157,9 @@ void (async () => {
|
|||
}
|
||||
});
|
||||
});
|
||||
console.log(
|
||||
`[timer] VSCode copy completed in ${Date.now() - vscodeCopyStart}ms`,
|
||||
);
|
||||
|
||||
if (!fs.existsSync(path.join("dist", "assets", "index.js"))) {
|
||||
throw new Error("gui build did not produce index.js");
|
||||
|
|
@ -151,6 +174,10 @@ void (async () => {
|
|||
fs.mkdirSync("bin", { recursive: true });
|
||||
|
||||
// onnxruntime-node
|
||||
const onnxCopyStart = Date.now();
|
||||
console.log(
|
||||
`[timer] Starting onnxruntime copy at ${new Date().toISOString()}`,
|
||||
);
|
||||
await new Promise((resolve, reject) => {
|
||||
ncp(
|
||||
path.join(__dirname, "../../../core/node_modules/onnxruntime-node/bin"),
|
||||
|
|
@ -167,6 +194,9 @@ void (async () => {
|
|||
},
|
||||
);
|
||||
});
|
||||
console.log(
|
||||
`[timer] onnxruntime copy completed in ${Date.now() - onnxCopyStart}ms`,
|
||||
);
|
||||
if (target) {
|
||||
// If building for production, only need the binaries for current platform
|
||||
try {
|
||||
|
|
@ -433,5 +463,8 @@ void (async () => {
|
|||
`out/node_modules/esbuild/lib/main.js`,
|
||||
]);
|
||||
|
||||
console.log(
|
||||
`[timer] Prepackage completed in ${Date.now() - startTime}ms - finished at ${new Date().toISOString()}`,
|
||||
);
|
||||
process.exit(0);
|
||||
})();
|
||||
|
|
|
|||
6
gui/package-lock.json
generated
6
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",
|
||||
|
|
@ -224,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"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
"types": "dist/index.d.ts",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"test": "echo 'No tests to run'",
|
||||
"build": "tsc"
|
||||
},
|
||||
"author": "Nate Sesti and Ty Dunn",
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
},
|
||||
|
|
|
|||
2
packages/continue-sdk/package-lock.json
generated
2
packages/continue-sdk/package-lock.json
generated
|
|
@ -23,7 +23,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"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@
|
|||
"description": "SDK Generator for Continue.dev",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "echo 'No build step needed'",
|
||||
"test": "echo 'No tests to run'",
|
||||
"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 +22,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.16",
|
||||
"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"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
"types": "dist/index.d.ts",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"test": "cross-env NODE_OPTIONS=--experimental-vm-modules jest",
|
||||
"test": "cross-env NODE_OPTIONS=--experimental-vm-modules jest --passWithNoTests",
|
||||
"build": "tsc"
|
||||
},
|
||||
"author": "Continue Dev, Inc.",
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
"types": "dist/index.d.ts",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"test": "echo 'No tests to run'",
|
||||
"build": "tsc"
|
||||
},
|
||||
"author": "Nate Sesti and Ty Dunn",
|
||||
|
|
|
|||
|
|
@ -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"],
|
||||
},
|
||||
{
|
||||
|
|
|
|||
119
packages/openai-adapters/package-lock.json
generated
119
packages/openai-adapters/package-lock.json
generated
|
|
@ -11,9 +11,9 @@
|
|||
"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.16",
|
||||
"@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",
|
||||
|
|
@ -39,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.16",
|
||||
"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",
|
||||
|
|
@ -1333,35 +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.16",
|
||||
"resolved": "https://registry.npmjs.org/@continuedev/fetch/-/fetch-1.0.16.tgz",
|
||||
"integrity": "sha512-LSjVbTKA+UwqCjV8x45sfJQGtG/iekkqCYpSJsakY0ruad807swwEuuui5luuYVUhJAZZpVfZzeJArHfjiJJSw==",
|
||||
"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",
|
||||
|
|
@ -5857,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",
|
||||
|
|
@ -6302,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"
|
||||
|
|
@ -13209,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"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -14,9 +14,9 @@
|
|||
"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.16",
|
||||
"@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",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import { ModelConfig } from "@continuedev/config-yaml";
|
||||
import * as dotenv from "dotenv";
|
||||
import { vi } from "vitest";
|
||||
import { DEEPSEEK_API_BASE } from "../apis/DeepSeek.js";
|
||||
import { INCEPTION_API_BASE } from "../apis/Inception.js";
|
||||
import { OpenAIApi } from "../apis/OpenAI.js";
|
||||
|
|
@ -137,6 +138,7 @@ if (process.env.IGNORE_API_KEY_TESTS === "true") {
|
|||
} else {
|
||||
TESTS.forEach((config) => {
|
||||
describe(`${config.provider}/${config.model}`, () => {
|
||||
vi.setConfig({ testTimeout: 30000 });
|
||||
testConfig({ name: config.model, ...config });
|
||||
});
|
||||
});
|
||||
|
|
|
|||
100
scripts/build-packages.js
Normal file
100
scripts/build-packages.js
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
const { spawn } = require("child_process");
|
||||
const path = require("path");
|
||||
const fs = require("fs");
|
||||
const fsPromises = require("fs/promises");
|
||||
|
||||
const npmInstallCmd = process.env.CI === "true" ? "npm ci" : "npm install";
|
||||
|
||||
function runCommand(command, cwd, packageName) {
|
||||
return new Promise((resolve, reject) => {
|
||||
console.log(`Starting ${packageName}: ${command}`);
|
||||
|
||||
const [cmd, ...args] = command.split(" ");
|
||||
const child = spawn(cmd, args, {
|
||||
cwd,
|
||||
stdio: "pipe",
|
||||
shell: true,
|
||||
});
|
||||
|
||||
let stdout = "";
|
||||
let stderr = "";
|
||||
|
||||
child.stdout.on("data", (data) => {
|
||||
stdout += data.toString();
|
||||
});
|
||||
|
||||
child.stderr.on("data", (data) => {
|
||||
stderr += data.toString();
|
||||
});
|
||||
|
||||
child.on("close", (code) => {
|
||||
if (code === 0) {
|
||||
console.log(`✅ ${packageName}: ${command} completed successfully`);
|
||||
resolve({ packageName, command, stdout, stderr });
|
||||
} else {
|
||||
console.error(`❌ ${packageName}: ${command} failed with code ${code}`);
|
||||
console.error(`stderr: ${stderr}`);
|
||||
reject(
|
||||
new Error(`${packageName} failed: ${command} (exit code ${code})`),
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
child.on("error", (error) => {
|
||||
console.error(`❌ ${packageName}: Failed to start ${command}:`, error);
|
||||
reject(error);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// Helper function to build a package (install + build)
|
||||
async function buildPackage(packageName, cleanNodeModules = false) {
|
||||
const packagePath = path.join(__dirname, "..", "packages", packageName);
|
||||
|
||||
if (!fs.existsSync(packagePath)) {
|
||||
throw new Error(`Package directory not found: ${packagePath}`);
|
||||
}
|
||||
|
||||
if (cleanNodeModules) {
|
||||
const nodeModulesPath = path.join(packagePath, "node_modules");
|
||||
if (fs.existsSync(nodeModulesPath)) {
|
||||
console.log(`🧹 Cleaning node_modules for ${packageName}`);
|
||||
await fsPromises.rm(nodeModulesPath, { recursive: true, force: true });
|
||||
}
|
||||
}
|
||||
|
||||
await runCommand(npmInstallCmd, packagePath, `${packageName} (install)`);
|
||||
|
||||
return runCommand("npm run build", packagePath, `${packageName} (build)`);
|
||||
}
|
||||
|
||||
async function buildPackagesInParallel(packages, cleanNodeModules = false) {
|
||||
const buildPromises = packages.map((pkg) =>
|
||||
buildPackage(pkg, cleanNodeModules),
|
||||
);
|
||||
return Promise.all(buildPromises);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
try {
|
||||
console.log("🚀 Starting package builds...\n");
|
||||
|
||||
// Phase 1: Build config-types (foundation - no dependencies)
|
||||
await buildPackagesInParallel(["config-types"]);
|
||||
|
||||
// Phase 2: Build packages that depend on config-types
|
||||
await buildPackagesInParallel(["fetch", "config-yaml", "llm-info"]);
|
||||
|
||||
// Phase 3: Build packages that depend on other local packages
|
||||
await buildPackagesInParallel(["openai-adapters", "continue-sdk"], true);
|
||||
|
||||
console.log("🎉 All packages built successfully!");
|
||||
} catch (error) {
|
||||
console.error("💥 Build failed:", error.message);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
if (require.main === module) {
|
||||
main();
|
||||
}
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
Push-Location packages
|
||||
|
||||
Push-Location "openai-adapters"
|
||||
npm ci
|
||||
npm run build
|
||||
Pop-Location
|
||||
|
||||
Push-Location "config-yaml"
|
||||
npm ci
|
||||
npm run build
|
||||
Pop-Location
|
||||
|
||||
Pop-Location
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
# Build @continuedev packages for monorepo style linking
|
||||
|
||||
cd packages
|
||||
cd openai-adapters
|
||||
|
||||
npm ci
|
||||
npm run build
|
||||
|
||||
cd ..
|
||||
cd config-yaml
|
||||
|
||||
npm ci
|
||||
npm run build
|
||||
|
|
@ -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
|
||||
node ./scripts/build-packages.js
|
||||
|
||||
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)..."
|
||||
node ./scripts/build-packages.js
|
||||
|
||||
echo "Installing Core extension dependencies..."
|
||||
pushd core
|
||||
|
|
|
|||
|
|
@ -200,14 +200,14 @@ install_from_pr() {
|
|||
exit 1
|
||||
fi
|
||||
|
||||
# Map platform names to GitHub runner OS names
|
||||
local artifact_suffix
|
||||
# Map platform names to artifact names for the new workflow
|
||||
local artifact_name
|
||||
case "$platform" in
|
||||
"macos")
|
||||
artifact_suffix="macOS"
|
||||
artifact_name="darwin-arm64-vsix"
|
||||
;;
|
||||
"linux")
|
||||
artifact_suffix="Linux"
|
||||
artifact_name="linux-x64-vsix"
|
||||
;;
|
||||
*)
|
||||
echo "❌ Unknown platform: $platform"
|
||||
|
|
@ -231,7 +231,7 @@ install_from_pr() {
|
|||
# Get the latest successful workflow run for the branch
|
||||
local run_id=$(gh run list \
|
||||
--repo "$REPO" \
|
||||
--workflow="pr_checks.yaml" \
|
||||
--workflow="pr-build-upload-vsix.yaml" \
|
||||
--branch="$branch_name" \
|
||||
--json databaseId,status,conclusion \
|
||||
--jq ".[] | select(.status == \"completed\" and .conclusion == \"success\") | .databaseId" \
|
||||
|
|
@ -244,7 +244,7 @@ install_from_pr() {
|
|||
fi
|
||||
|
||||
echo "✅ Found workflow run: $run_id"
|
||||
echo "📥 Downloading vscode-extension-build-$artifact_suffix artifact..."
|
||||
echo "📥 Downloading $artifact_name artifact..."
|
||||
|
||||
# Create temporary directory for download
|
||||
local temp_dir=$(mktemp -d)
|
||||
|
|
@ -252,9 +252,9 @@ install_from_pr() {
|
|||
# Download the artifact
|
||||
if ! gh run download "$run_id" \
|
||||
--repo "$REPO" \
|
||||
--name "vscode-extension-build-$artifact_suffix" \
|
||||
--name "$artifact_name" \
|
||||
--dir "$temp_dir"; then
|
||||
echo "❌ Failed to download artifact vscode-extension-build-$artifact_suffix"
|
||||
echo "❌ Failed to download artifact $artifact_name"
|
||||
echo " Make sure the workflow run completed successfully for $platform"
|
||||
rm -rf "$temp_dir"
|
||||
exit 1
|
||||
|
|
@ -269,17 +269,17 @@ install_from_pr() {
|
|||
exit 1
|
||||
fi
|
||||
|
||||
# Extract version from the original VSIX filename (e.g., continue-1.1.66.vsix -> 1.1.66)
|
||||
# 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 version=$(echo "$original_filename" | sed 's/continue-\(.*\)\.vsix/\1/')
|
||||
local full_version=$(echo "$original_filename" | sed 's/continue-\(.*\)\.vsix/\1/')
|
||||
|
||||
if [ -z "$version" ]; then
|
||||
if [ -z "$full_version" ]; then
|
||||
echo "⚠️ Could not extract version from filename: $original_filename"
|
||||
version="unknown"
|
||||
full_version="unknown-pr${pr_number}"
|
||||
fi
|
||||
|
||||
# Create new VSIX name with version and PR number
|
||||
local target_path="$ONEPER_DIR/continue-${version}-${pr_number}.vsix"
|
||||
# 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
|
||||
|
|
@ -297,6 +297,7 @@ install_from_pr() {
|
|||
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)"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue