diff --git a/.github/workflows/b2.yml b/.github/workflows/b2.yml new file mode 100644 index 00000000..17e3c236 --- /dev/null +++ b/.github/workflows/b2.yml @@ -0,0 +1,412 @@ +name: VS Code Build + +on: + push: + branches: [ main, release/*, github-workflow ] + pull_request: + branches: [ main ] + + workflow_dispatch: + inputs: + build_macos: + description: 'Build macOS' + type: boolean + default: true + build_macos_arm64: + description: 'Build macOS ARM64' + type: boolean + default: true + build_macos_universal: + description: 'Build macOS Universal' + type: boolean + default: true + build_linux: + description: 'Build Linux x64' + type: boolean + default: true + build_linux_arm64: + description: 'Build Linux ARM64' + type: boolean + default: false + build_windows: + description: 'Build Windows' + type: boolean + default: true + quality: + description: 'Quality (insider or stable)' + type: choice + options: + - insider + - stable + default: 'insider' + +env: + VSCODE_QUALITY: ${{ github.event.inputs.quality }} + NPM_REGISTRY: 'https://registry.npmjs.org/' + VSCODE_ARCH: 'x64' + VSCODE_CIBUILD: false + +jobs: + compile: + runs-on: macos-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version-file: '.nvmrc' + + - name: Install Dependencies + run: | + npm ci + + - name: Compile + run: | + npm run compile + + - name: Package Compilation Output + run: | + mkdir -p .build + tar -czf compilation.tar.gz .build out-* test/integration/browser/out test/smoke/out test/automation/out + + - name: Upload Compilation Artifact + uses: actions/upload-artifact@v4 + with: + name: compilation + path: compilation.tar.gz + + compile-cli: + runs-on: ubuntu-latest + needs: compile + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version-file: '.nvmrc' + + - name: Setup Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + + - name: Install Dependencies + run: | + npm ci + + - name: Build CLI + run: | + cd cli + cargo build --release --bin=code + + - name: Upload CLI Artifacts + uses: actions/upload-artifact@v4 + with: + name: vscode_cli + path: cli/target/release/code + + build-macos: + if: ${{ github.event.inputs.build_macos == 'true' }} + runs-on: macos-latest + needs: [compile, compile-cli] + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version-file: '.nvmrc' + + - name: Download Compilation + uses: actions/download-artifact@v4 + with: + name: compilation + + - name: Extract Compilation + run: tar -xzf compilation.tar.gz + + - name: Install Dependencies + run: npm ci + + - name: Build macOS x64 + run: | + npm run gulp vscode-darwin-x64-min-ci + + - name: Download CLI + uses: actions/download-artifact@v4 + with: + name: vscode_cli + path: cli-bin + + - name: Integrate CLI + run: | + APP_ROOT="$(pwd)/../VSCode-darwin-x64" + APP_NAME="`ls $APP_ROOT | head -n 1`" + APP_PATH="$APP_ROOT/$APP_NAME" + CLI_APP_NAME=$(node -p "require(\"$APP_PATH/Contents/Resources/app/product.json\").tunnelApplicationName") + mkdir -p "$APP_PATH/Contents/Resources/app/bin" + cp cli-bin/code "$APP_PATH/Contents/Resources/app/bin/$CLI_APP_NAME" + chmod +x "$APP_PATH/Contents/Resources/app/bin/$CLI_APP_NAME" + + - name: Package macOS App + run: | + ARCHIVE_PATH="VSCode-darwin-x64.zip" + (cd ../VSCode-darwin-x64 && zip -r -X -y $(pwd)/$ARCHIVE_PATH *) + + - name: Upload macOS App + uses: actions/upload-artifact@v4 + with: + name: vscode-darwin-x64 + path: VSCode-darwin-x64.zip + + build-macos-arm64: + if: ${{ github.event.inputs.build_macos_arm64 == 'true' }} + runs-on: macos-latest + needs: [compile, compile-cli] + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version-file: '.nvmrc' + + - name: Download Compilation + uses: actions/download-artifact@v4 + with: + name: compilation + + - name: Extract Compilation + run: tar -xzf compilation.tar.gz + + - name: Install Dependencies + run: npm ci + + - name: Build macOS ARM64 + run: | + npm run gulp vscode-darwin-arm64-min-ci + + - name: Download CLI + uses: actions/download-artifact@v4 + with: + name: vscode_cli + path: cli-bin + + - name: Integrate CLI + run: | + APP_ROOT="$(pwd)/../VSCode-darwin-arm64" + APP_NAME="`ls $APP_ROOT | head -n 1`" + APP_PATH="$APP_ROOT/$APP_NAME" + CLI_APP_NAME=$(node -p "require(\"$APP_PATH/Contents/Resources/app/product.json\").tunnelApplicationName") + mkdir -p "$APP_PATH/Contents/Resources/app/bin" + cp cli-bin/code "$APP_PATH/Contents/Resources/app/bin/$CLI_APP_NAME" + chmod +x "$APP_PATH/Contents/Resources/app/bin/$CLI_APP_NAME" + + - name: Package macOS App + run: | + ARCHIVE_PATH="VSCode-darwin-arm64.zip" + (cd ../VSCode-darwin-arm64 && zip -r -X -y $(pwd)/$ARCHIVE_PATH *) + + - name: Upload macOS App + uses: actions/upload-artifact@v4 + with: + name: vscode-darwin-arm64 + path: VSCode-darwin-arm64.zip + + build-macos-universal: + if: ${{ github.event.inputs.build_macos_universal == 'true' && github.event.inputs.build_macos == 'true' && github.event.inputs.build_macos_arm64 == 'true' }} + runs-on: macos-latest + needs: [build-macos, build-macos-arm64] + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version-file: '.nvmrc' + + - name: Download x64 Build + uses: actions/download-artifact@v4 + with: + name: vscode-darwin-x64 + + - name: Download ARM64 Build + uses: actions/download-artifact@v4 + with: + name: vscode-darwin-arm64 + + - name: Extract Builds + run: | + mkdir -p VSCode-darwin-x64 + mkdir -p VSCode-darwin-arm64 + unzip VSCode-darwin-x64.zip -d VSCode-darwin-x64 + unzip VSCode-darwin-arm64.zip -d VSCode-darwin-arm64 + + - name: Install Dependencies + run: npm ci + + - name: Create Universal Build + run: | + node build/darwin/create-universal-app.js $(pwd) + + - name: Package Universal App + run: | + ARCHIVE_PATH="VSCode-darwin-universal.zip" + (cd VSCode-darwin-universal && zip -r -X -y $(pwd)/$ARCHIVE_PATH *) + + - name: Upload Universal App + uses: actions/upload-artifact@v4 + with: + name: vscode-darwin-universal + path: VSCode-darwin-universal.zip + + build-linux: + if: ${{ github.event.inputs.build_linux == 'true' }} + runs-on: ubuntu-latest + needs: [compile, compile-cli] + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version-file: '.nvmrc' + + - name: Install Dependencies + run: | + sudo apt-get update + sudo apt-get install -y libxkbfile-dev pkg-config libsecret-1-dev libxss1 dbus xvfb libgtk-3-0 libgbm1 + npm ci + + - name: Download Compilation + uses: actions/download-artifact@v4 + with: + name: compilation + + - name: Extract Compilation + run: tar -xzf compilation.tar.gz + + - name: Build Linux x64 + run: | + npm run gulp vscode-linux-x64-min-ci + + - name: Download CLI + uses: actions/download-artifact@v4 + with: + name: vscode_cli + path: cli-bin + + - name: Integrate CLI + run: | + CLI_APP_NAME=$(node -p "require(\"../VSCode-linux-x64/resources/app/product.json\").tunnelApplicationName") + mkdir -p "../VSCode-linux-x64/bin" + cp cli-bin/code "../VSCode-linux-x64/bin/$CLI_APP_NAME" + chmod +x "../VSCode-linux-x64/bin/$CLI_APP_NAME" + + - name: Create .tar.gz Archive + run: | + ARCHIVE_PATH="VSCode-linux-x64.tar.gz" + (cd .. && tar -czf $(pwd)/$ARCHIVE_PATH VSCode-linux-x64) + + - name: Upload Linux Build + uses: actions/upload-artifact@v4 + with: + name: vscode-linux-x64-archive + path: VSCode-linux-x64.tar.gz + + - name: Build .deb Package + run: | + npm run gulp vscode-linux-x64-prepare-deb + npm run gulp vscode-linux-x64-build-deb + + - name: Upload .deb Package + uses: actions/upload-artifact@v4 + with: + name: vscode-linux-x64-deb + path: .build/linux/deb/*/deb/*.deb + + - name: Build .rpm Package + run: | + npm run gulp vscode-linux-x64-prepare-rpm + npm run gulp vscode-linux-x64-build-rpm + + - name: Upload .rpm Package + uses: actions/upload-artifact@v4 + with: + name: vscode-linux-x64-rpm + path: .build/linux/rpm/*/*.rpm + + build-windows: + if: ${{ github.event.inputs.build_windows == 'true' }} + runs-on: windows-latest + needs: [compile, compile-cli] + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version-file: '.nvmrc' + + - name: Download Compilation + uses: actions/download-artifact@v4 + with: + name: compilation + + - name: Extract Compilation + shell: powershell + run: tar -xzf compilation.tar.gz + + - name: Install Dependencies + run: npm ci + + - name: Build Windows x64 + run: | + npm run gulp vscode-win32-x64-min-ci + npm run gulp vscode-win32-x64-inno-updater + + - name: Download CLI + uses: actions/download-artifact@v4 + with: + name: vscode_cli + path: cli-bin + + - name: Integrate CLI + shell: powershell + run: | + $AppProductJson = Get-Content -Raw -Path "../VSCode-win32-x64/resources/app/product.json" | ConvertFrom-Json + $CliAppName = $AppProductJson.tunnelApplicationName + $AppName = $AppProductJson.applicationName + mkdir -Force "../VSCode-win32-x64/bin" + Copy-Item -Path "cli-bin/code" -Destination "../VSCode-win32-x64/bin/$CliAppName.exe" + + - name: Package Windows Build + shell: powershell + run: | + $ArchivePath = "VSCode-win32-x64.zip" + Compress-Archive -Path "../VSCode-win32-x64/*" -DestinationPath $ArchivePath + + - name: Upload Windows Build + uses: actions/upload-artifact@v4 + with: + name: vscode-win32-x64-archive + path: VSCode-win32-x64.zip + + - name: Build User Setup + run: | + npm run gulp vscode-win32-x64-user-setup + + - name: Upload User Setup + uses: actions/upload-artifact@v4 + with: + name: vscode-win32-x64-user-setup + path: .build/win32-x64/user-setup/VSCodeSetup.exe diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eb0d6882..d7b2049a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -447,9 +447,23 @@ jobs: - name: Install dependencies for universal app run: | cd build/ + # Set npm config to use GitHub token for authentication to avoid rate limits + npm config set //github.com/:_authToken=${{ github.token }} + npm config set //api.github.com/:_authToken=${{ github.token }} + npm config set //npm.pkg.github.com/:_authToken=${{ github.token }} + # Configure npm to use the GitHub token for all requests to github.com domains + npm config set @microsoft:registry https://npm.pkg.github.com + npm config set @vscode:registry https://npm.pkg.github.com + # Increase network timeout to handle slow connections + npm config set fetch-timeout 300000 + npm config set fetch-retry-mintimeout 20000 + npm config set fetch-retry-maxtimeout 120000 + npm install + npm install -g create-dmg npm run compile + - name: Create Universal App run: | # Script to create universal binary @@ -464,9 +478,6 @@ jobs: with: node-version-file: '.nvmrc' - - name: Install create-dmg - run: npm install -g create-dmg - - name: Create Universal DMG run: | cd .build/darwin-universal/universal diff --git a/src/vs/workbench/contrib/void/browser/aiRegexService.ts b/src/vs/workbench/contrib/void/browser/aiRegexService.ts index 6495a310..4e37f99c 100644 --- a/src/vs/workbench/contrib/void/browser/aiRegexService.ts +++ b/src/vs/workbench/contrib/void/browser/aiRegexService.ts @@ -34,7 +34,7 @@ // // const result = await new Promise((res, rej) => { // // sendLLMMessage({ // // messages, -// // tools: ['text_search'], +// // tools: ['grep_search'], // // onFinalMessage: ({ result: r, }) => { // // res(r) // // }, @@ -73,7 +73,7 @@ // // const result = new Promise((res, rej) => { // // sendLLMMessage({ // // messages, -// // tools: ['text_search'], +// // tools: ['grep_search'], // // onResult: (r) => { // // res(r) // // } diff --git a/src/vs/workbench/contrib/void/browser/chatThreadService.ts b/src/vs/workbench/contrib/void/browser/chatThreadService.ts index e3024792..ca2f6369 100644 --- a/src/vs/workbench/contrib/void/browser/chatThreadService.ts +++ b/src/vs/workbench/contrib/void/browser/chatThreadService.ts @@ -392,7 +392,7 @@ class ChatThreadService extends Disposable implements IChatThreadService { { role: 'tool', - name: 'text_search', + name: 'grep_search', id: 'tool-4', paramsStr: '{"query": "function main"}', content: 'Found matches in 3 files', @@ -408,15 +408,15 @@ class ChatThreadService extends Disposable implements IChatThreadService { hasNextPage: false } }, - } satisfies ToolMessage<'text_search'>, + } satisfies ToolMessage<'grep_search'>, // { // role: 'tool_request', - // name: 'text_search', + // name: 'grep_search', // params: { queryStr: 'function main', pageNumber: 0 }, // paramsStr: '{"query": "function main"}', // id: 'request-4', - // } satisfies ToolRequestApproval<'text_search'>, + // } satisfies ToolRequestApproval<'grep_search'>, // --- diff --git a/src/vs/workbench/contrib/void/browser/editCodeService.ts b/src/vs/workbench/contrib/void/browser/editCodeService.ts index ccf5484e..098b073e 100644 --- a/src/vs/workbench/contrib/void/browser/editCodeService.ts +++ b/src/vs/workbench/contrib/void/browser/editCodeService.ts @@ -1628,7 +1628,7 @@ class EditCodeService extends Disposable implements IEditCodeService { this._notifyError(e) onDone() this._undoHistory(uri) - throw e.fullError // throw error h + throw e.fullError || new Error(e.message) // throw error h } // refresh now in case onText takes a while to get 1st message diff --git a/src/vs/workbench/contrib/void/browser/react/src/markdown/ApplyBlockHoverButtons.tsx b/src/vs/workbench/contrib/void/browser/react/src/markdown/ApplyBlockHoverButtons.tsx index b09a22ba..1069b635 100644 --- a/src/vs/workbench/contrib/void/browser/react/src/markdown/ApplyBlockHoverButtons.tsx +++ b/src/vs/workbench/contrib/void/browser/react/src/markdown/ApplyBlockHoverButtons.tsx @@ -267,7 +267,7 @@ export const useApplyButtonHTML = ({ codeStr, applyBoxId, uri }: { codeStr: stri > } - const statusIndicatorHTML =