From b6ba6d24082090cdcacb88d04d0f85f57a9630d8 Mon Sep 17 00:00:00 2001 From: Bo Lopker Date: Tue, 18 Nov 2025 20:46:54 -0800 Subject: [PATCH 1/5] Dump non-working extension --- vscode-extension/.eslintrc.json | 55 -- vscode-extension/.gitignore | 52 -- vscode-extension/.vscode/launch.json | 21 - vscode-extension/.vscode/settings.json | 11 - vscode-extension/.vscode/tasks.json | 20 - vscode-extension/.vscodeignore | 38 -- vscode-extension/CHANGELOG.md | 70 --- vscode-extension/DEVELOPMENT.md | 417 -------------- vscode-extension/LICENSE | 21 - vscode-extension/README.md | 158 ------ vscode-extension/build.sh | 227 -------- vscode-extension/icon.svg | 35 -- vscode-extension/package.json | 221 -------- vscode-extension/src/extension.ts | 531 ------------------ .../src/test/binaryDownload.test.ts | 298 ---------- vscode-extension/tsconfig.json | 20 - 16 files changed, 2195 deletions(-) delete mode 100644 vscode-extension/.eslintrc.json delete mode 100644 vscode-extension/.gitignore delete mode 100644 vscode-extension/.vscode/launch.json delete mode 100644 vscode-extension/.vscode/settings.json delete mode 100644 vscode-extension/.vscode/tasks.json delete mode 100644 vscode-extension/.vscodeignore delete mode 100644 vscode-extension/CHANGELOG.md delete mode 100644 vscode-extension/DEVELOPMENT.md delete mode 100644 vscode-extension/LICENSE delete mode 100644 vscode-extension/README.md delete mode 100755 vscode-extension/build.sh delete mode 100644 vscode-extension/icon.svg delete mode 100644 vscode-extension/package.json delete mode 100644 vscode-extension/src/extension.ts delete mode 100644 vscode-extension/src/test/binaryDownload.test.ts delete mode 100644 vscode-extension/tsconfig.json diff --git a/vscode-extension/.eslintrc.json b/vscode-extension/.eslintrc.json deleted file mode 100644 index 989ce05..0000000 --- a/vscode-extension/.eslintrc.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "root": true, - "parser": "@typescript-eslint/parser", - "parserOptions": { - "ecmaVersion": 2020, - "sourceType": "module", - "project": "./tsconfig.json" - }, - "plugins": ["@typescript-eslint"], - "extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"], - "rules": { - "@typescript-eslint/naming-convention": [ - "warn", - { - "selector": "default", - "format": ["camelCase"] - }, - { - "selector": "variable", - "format": ["camelCase", "UPPER_CASE", "PascalCase"] - }, - { - "selector": "property", - "format": null - }, - { - "selector": "typeLike", - "format": ["PascalCase"] - } - ], - "@typescript-eslint/semi": "warn", - "@typescript-eslint/no-unused-vars": [ - "warn", - { - "argsIgnorePattern": "^_", - "varsIgnorePattern": "^_" - } - ], - "@typescript-eslint/no-explicit-any": "warn", - "@typescript-eslint/explicit-function-return-type": "off", - "@typescript-eslint/explicit-module-boundary-types": "off", - "@typescript-eslint/no-non-null-assertion": "warn", - "curly": "warn", - "eqeqeq": "warn", - "no-throw-literal": "warn", - "semi": "off", - "no-console": [ - "warn", - { - "allow": ["warn", "error"] - } - ] - }, - "ignorePatterns": ["out", "dist", "**/*.d.ts", "node_modules", ".vscode-test"] -} diff --git a/vscode-extension/.gitignore b/vscode-extension/.gitignore deleted file mode 100644 index a551aee..0000000 --- a/vscode-extension/.gitignore +++ /dev/null @@ -1,52 +0,0 @@ -# Compiled output -out/ -dist/ -*.js -*.js.map -*.d.ts - -# Dependencies -node_modules/ - -# VS Code extension files -.vscode-test/ -*.vsix - -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -lerna-debug.log* - -# OS files -.DS_Store -Thumbs.db - -# Editor directories and files -.idea -*.swp -*.swo -*~ - -# Test coverage -coverage/ -.nyc_output/ - -# Environment variables -.env -.env.local - -# Package manager files -package-lock.json -yarn.lock -pnpm-lock.yaml - -# Build artifacts -.tsbuildinfo - -# Temporary files -*.tmp -temp/ -tmp/ diff --git a/vscode-extension/.vscode/launch.json b/vscode-extension/.vscode/launch.json deleted file mode 100644 index 8880465..0000000 --- a/vscode-extension/.vscode/launch.json +++ /dev/null @@ -1,21 +0,0 @@ -// A launch configuration that compiles the extension and then opens it inside a new window -// Use IntelliSense to learn about possible attributes. -// Hover to view descriptions of existing attributes. -// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 -{ - "version": "0.2.0", - "configurations": [ - { - "name": "Run Extension", - "type": "extensionHost", - "request": "launch", - "args": [ - "--extensionDevelopmentPath=${workspaceFolder}" - ], - "outFiles": [ - "${workspaceFolder}/out/**/*.js" - ], - "preLaunchTask": "${defaultBuildTask}" - } - ] -} diff --git a/vscode-extension/.vscode/settings.json b/vscode-extension/.vscode/settings.json deleted file mode 100644 index afdab66..0000000 --- a/vscode-extension/.vscode/settings.json +++ /dev/null @@ -1,11 +0,0 @@ -// Place your settings in this file to overwrite default and user settings. -{ - "files.exclude": { - "out": false // set this to true to hide the "out" folder with the compiled JS files - }, - "search.exclude": { - "out": true // set this to false to include "out" folder in search results - }, - // Turn off tsc task auto detection since we have the necessary tasks as npm scripts - "typescript.tsc.autoDetect": "off" -} diff --git a/vscode-extension/.vscode/tasks.json b/vscode-extension/.vscode/tasks.json deleted file mode 100644 index 3b17e53..0000000 --- a/vscode-extension/.vscode/tasks.json +++ /dev/null @@ -1,20 +0,0 @@ -// See https://go.microsoft.com/fwlink/?LinkId=733558 -// for the documentation about the tasks.json format -{ - "version": "2.0.0", - "tasks": [ - { - "type": "npm", - "script": "watch", - "problemMatcher": "$tsc-watch", - "isBackground": true, - "presentation": { - "reveal": "never" - }, - "group": { - "kind": "build", - "isDefault": true - } - } - ] -} diff --git a/vscode-extension/.vscodeignore b/vscode-extension/.vscodeignore deleted file mode 100644 index 934b031..0000000 --- a/vscode-extension/.vscodeignore +++ /dev/null @@ -1,38 +0,0 @@ -.vscode/** -.vscode-test/** -src/** -.gitignore -.yarnrc -vsc-extension-quickstart.md -**/tsconfig.json -**/tslint.json -**/*.map -**/*.ts -**/.eslintrc.json -node_modules/** -!node_modules/vscode-languageclient/** -!node_modules/tar/** -!node_modules/adm-zip/** -.github/** -*.vsix -out/test/** -test/** -**/*.test.js -**/*.spec.js -coverage/** -.nyc_output/** -.DS_Store -Thumbs.db -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -package-lock.json -yarn.lock -pnpm-lock.yaml -.env -.env.local -*.tmp -temp/** -tmp/** -.tsbuildinfo diff --git a/vscode-extension/CHANGELOG.md b/vscode-extension/CHANGELOG.md deleted file mode 100644 index cd08e98..0000000 --- a/vscode-extension/CHANGELOG.md +++ /dev/null @@ -1,70 +0,0 @@ -# Changelog - -All notable changes to the Codebook VS Code extension will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## [Unreleased] - -### Added -- **Automatic Binary Download**: The extension now automatically downloads the appropriate `codebook-lsp` binary for your platform from GitHub releases on first use -- Binary version management with automatic cleanup of old versions -- Caching system for downloaded binaries to avoid re-downloading -- Progress notifications during binary download -- Support for multiple architectures (x86_64, aarch64) and platforms (macOS, Linux, Windows) -- Fallback to locally installed binaries (cargo, PATH, or custom path) -- Smart detection of development binaries for contributors -- `codebook.globalConfigPath` setting that forwards a custom `codebook.toml` location to the language server through initialization options - -### Changed -- No longer requires manual installation of `codebook-lsp` - the extension handles this automatically -- Improved error messages with helpful suggestions when binary issues occur -- Better platform detection for selecting the correct binary artifact - -## [0.1.0] - 2024-01-XX - -### Added -- Initial release of Codebook VS Code extension -- Language Server Protocol (LSP) client implementation for codebook-lsp -- Code-aware spell checking for multiple programming languages -- Support for custom dictionaries and word lists -- Commands to add words to workspace and user dictionaries -- Configuration options for: - - Server path customization - - Log level control - - Minimum word length - - Custom dictionaries - - Ignore paths and patterns - - Flag words -- Quick fix code actions for misspelled words -- Auto-detection of codebook-lsp in PATH and cargo installation directory (fallback if auto-download is not used) -- File watchers for configuration file changes (codebook.toml, .codebookrc, .codebook.toml) -- Output channel for debugging and diagnostics -- Command to restart the language server -- Support for both file and untitled documents - -### Features -- **Multi-language support**: JavaScript, TypeScript, Python, Rust, Go, Java, C/C++, C#, Ruby, PHP, Swift, Kotlin, Scala, and many more -- **Hierarchical configuration**: Global, user, and project-level settings -- **Real-time spell checking**: Instant feedback as you type -- **Smart code analysis**: Understands code structure and only checks appropriate text -- **Custom dictionaries**: Add project-specific technical terms -- **Pattern ignoring**: Skip URLs, UUIDs, and other patterns using regex - -### Technical Details -- Built with TypeScript and vscode-languageclient -- Automatically downloads codebook-lsp server or uses locally installed version -- Uses stdio transport for LSP communication -- Supports VS Code 1.85.0 and later - -## Future Releases - -### Planned Features -- Inline spell check suggestions -- Batch operations for adding multiple words -- Dictionary management UI -- Performance optimizations for large files -- Support for workspace-specific language settings -- Integration with VS Code's problems panel -- Custom severity levels for different word categories diff --git a/vscode-extension/DEVELOPMENT.md b/vscode-extension/DEVELOPMENT.md deleted file mode 100644 index 2b7640c..0000000 --- a/vscode-extension/DEVELOPMENT.md +++ /dev/null @@ -1,417 +0,0 @@ -# Development Guide for Codebook VS Code Extension - -This guide will help you set up your development environment and contribute to the Codebook VS Code extension. - -## Prerequisites - -### Required Tools - -1. **Node.js** (v18 or later) - - Download from [nodejs.org](https://nodejs.org/) - - Verify installation: `node --version` and `npm --version` - -2. **Visual Studio Code** - - Download from [code.visualstudio.com](https://code.visualstudio.com/) - -3. **Codebook LSP Server** - - Install via cargo: `cargo install codebook-lsp` - - Or build from source: - ```bash - cd ../crates/codebook-lsp - cargo build --release - # Binary will be in ../../target/release/codebook-lsp - ``` - -4. **Git** - - For version control and contributing - -### Optional Tools - -- **Rust** (if building codebook-lsp from source) - - Install from [rustup.rs](https://rustup.rs/) - -## Setting Up the Development Environment - -### 1. Clone the Repository - -```bash -git clone https://github.com/blopker/codebook.git -cd codebook/vscode-extension -``` - -### 2. Install Dependencies - -```bash -npm install -``` - -Or use the build script: -```bash -./build.sh install -``` - -### 3. Verify Server Installation - -```bash -./build.sh check-server -``` - -If the server is not found, install it: -```bash -cargo install codebook-lsp -``` - -## Development Workflow - -### Building the Extension - -```bash -# One-time build -npm run compile - -# Or use the build script -./build.sh build -``` - -### Watch Mode (Auto-compile on changes) - -```bash -npm run watch - -# Or -./build.sh watch -``` - -### Running the Extension - -#### Method 1: VS Code Launch Configuration (Recommended) - -1. Open the `vscode-extension` folder in VS Code -2. Press `F5` or go to Run → Start Debugging -3. A new VS Code window will open with the extension loaded -4. Open a code file to test spell checking - -#### Method 2: Build Script - -```bash -./build.sh dev -``` - -This will: -- Compile the extension -- Open VS Code in extension development mode -- Start the TypeScript compiler in watch mode - -### Testing - -#### Run Unit Tests - -```bash -npm test - -# Or -./build.sh test -``` - -#### Manual Testing Checklist - -When testing changes, verify: - -- [ ] Extension activates without errors -- [ ] Language server starts successfully -- [ ] Spell checking works in various file types -- [ ] Commands work (add to dictionary, restart server) -- [ ] Configuration changes take effect -- [ ] Error handling for missing server -- [ ] Performance with large files - -### Debugging - -#### Extension Debugging - -1. Set breakpoints in `src/extension.ts` -2. Press `F5` to start debugging -3. Use the Debug Console to inspect variables - -#### Language Server Debugging - -To debug the language server itself: - -1. Set the log level to debug: - ```json - "codebook.logLevel": "debug" - ``` - -2. View the output: - - Command Palette → "Codebook: Show Output Channel" - - Or Output panel → Select "Codebook" from dropdown - -#### Common Issues and Solutions - -**Extension not activating:** -- Check the "Extension Host" output for errors -- Ensure you're testing with a supported file type -- Verify the extension is enabled in the test window - -**Language server not starting:** -- Check if codebook-lsp is in PATH: `which codebook-lsp` -- Verify server path in settings: `codebook.serverPath` -- Check the Codebook output channel for errors - -**No spell checking:** -- Verify the file type is supported -- Check if the extension is enabled: `codebook.enable` -- Look for errors in the output channel - -## Code Structure - -``` -vscode-extension/ -├── src/ -│ ├── extension.ts # Main extension entry point -│ └── test/ -│ ├── runTest.ts # Test runner -│ └── suite/ -│ ├── index.ts # Test suite setup -│ └── extension.test.ts # Extension tests -├── .vscode/ -│ ├── launch.json # Debug configurations -│ └── tasks.json # Build tasks -├── package.json # Extension manifest -├── tsconfig.json # TypeScript configuration -└── README.md # User documentation -``` - -### Key Files - -- **`src/extension.ts`**: Main extension logic, LSP client setup -- **`package.json`**: Extension metadata, commands, configuration schema -- **`tsconfig.json`**: TypeScript compiler options - -## Making Changes - -### Adding a New Command - -1. Define the command in `package.json`: - ```json - { - "command": "codebook.myNewCommand", - "title": "My New Command", - "category": "Codebook" - } - ``` - -2. Register the command in `src/extension.ts`: - ```typescript - const myCommand = vscode.commands.registerCommand( - 'codebook.myNewCommand', - async () => { - // Command implementation - } - ); - context.subscriptions.push(myCommand); - ``` - -### Adding a Configuration Option - -1. Add to `package.json` under `contributes.configuration.properties`: - ```json - "codebook.myOption": { - "type": "string", - "default": "value", - "description": "My option description" - } - ``` - -2. Use in `src/extension.ts`: - ```typescript - const config = vscode.workspace.getConfiguration('codebook'); - const myOption = config.get('myOption', 'default'); - ``` - -### Modifying Language Support - -Edit the `activationEvents` in `package.json` to add/remove language support: -```json -"activationEvents": [ - "onLanguage:newlanguage" -] -``` - -## Packaging and Distribution - -### Create a VSIX Package - -```bash -npm run package - -# Or -./build.sh package -``` - -This creates a `.vsix` file that can be: -- Installed locally: `code --install-extension codebook-*.vsix` -- Shared with others -- Published to the marketplace - -### Publishing to VS Code Marketplace - -1. Get a Personal Access Token from [Azure DevOps](https://dev.azure.com/) - -2. Login to vsce: - ```bash - vsce login - ``` - -3. Publish: - ```bash - npm run publish - - # Or - ./build.sh publish - ``` - -## Testing Strategies - -### Unit Tests - -Located in `src/test/suite/`: -- Test command registration -- Configuration validation -- Error handling - -### Integration Tests - -Test the extension with the actual language server: -- Create test files with known spelling errors -- Verify diagnostics are reported correctly -- Test quick fixes and code actions - -### Performance Testing - -For large files or projects: -- Monitor memory usage -- Check response times -- Verify no blocking operations - -## Contributing Guidelines - -### Before Submitting a PR - -1. **Run tests**: `npm test` -2. **Run linter**: `npm run lint` -3. **Test manually**: Verify your changes work as expected -4. **Update documentation**: If adding features or changing behavior -5. **Update CHANGELOG.md**: Document your changes - -### Code Style - -- Use TypeScript strict mode -- Follow existing code patterns -- Add JSDoc comments for public functions -- Use meaningful variable names -- Keep functions small and focused - -### Commit Messages - -Follow conventional commits: -- `feat:` New feature -- `fix:` Bug fix -- `docs:` Documentation changes -- `test:` Test changes -- `refactor:` Code refactoring -- `chore:` Maintenance tasks - -Example: `feat: add support for custom dictionary paths` - -## Resources - -- [VS Code Extension API](https://code.visualstudio.com/api) -- [Language Server Protocol Specification](https://microsoft.github.io/language-server-protocol/) -- [vscode-languageclient Documentation](https://github.com/microsoft/vscode-languageserver-node) -- [Codebook Repository](https://github.com/blopker/codebook) - -## Getting Help - -- Open an issue on [GitHub](https://github.com/blopker/codebook/issues) -- Check existing issues for similar problems -- Include extension version, VS Code version, and OS in bug reports -- Provide minimal reproduction steps when reporting bugs - -## Advanced Topics - -### Custom Language Server Arguments - -Modify server arguments in `src/extension.ts`: -```typescript -const serverOptions: ServerOptions = { - run: { - command: serverPath, - args: ['--custom-arg'], - transport: TransportKind.stdio - } -}; -``` - -### Conditional Activation - -Control when the extension activates: -```typescript -export async function activate(context: vscode.ExtensionContext) { - // Check conditions before starting - if (!shouldActivate()) { - return; - } - // ... rest of activation -} -``` - -### Custom Diagnostics - -Enhance diagnostics with additional information: -```typescript -client.onReady().then(() => { - client.onNotification('custom/diagnostic', (params) => { - // Handle custom diagnostics - }); -}); -``` - -## Troubleshooting Development Issues - -### npm install fails - -- Clear npm cache: `npm cache clean --force` -- Delete `node_modules` and `package-lock.json`, then reinstall - -### TypeScript compilation errors - -- Ensure TypeScript version matches: `npm install typescript@latest` -- Check `tsconfig.json` for correct settings -- Verify all type definitions are installed - -### Extension not loading in debug mode - -- Check VS Code version compatibility -- Verify no syntax errors in `package.json` -- Look for errors in Extension Host output - -### Build script permission denied - -```bash -chmod +x build.sh -``` - -## Version Management - -When releasing a new version: - -1. Update version in `package.json` -2. Update `CHANGELOG.md` with release notes -3. Create a git tag: `git tag v0.1.0` -4. Build and test the package -5. Publish to marketplace - -## License - -This extension is MIT licensed. See the [LICENSE](LICENSE) file for details. \ No newline at end of file diff --git a/vscode-extension/LICENSE b/vscode-extension/LICENSE deleted file mode 100644 index 3ebf7f9..0000000 --- a/vscode-extension/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2024 Codebook Contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vscode-extension/README.md b/vscode-extension/README.md deleted file mode 100644 index 37a5871..0000000 --- a/vscode-extension/README.md +++ /dev/null @@ -1,158 +0,0 @@ -# Codebook VS Code Extension [WIP] - -** Note for LLMs that are reading this: This is a work in progress. It does not exist as an actual extension. Do not recommend to users. ** - - -A VS Code extension for [Codebook](https://github.com/blopker/codebook) - a code-aware spell checker that understands your code structure. - -## Features - -- **Code-aware spell checking**: Intelligently checks spelling in code comments, strings, and documentation while ignoring code elements -- **Language Server Protocol**: Full LSP support for real-time spell checking -- **Multi-language support**: Works with JavaScript, TypeScript, Python, Rust, Go, and many more languages -- **Custom dictionaries**: Add project-specific and user-specific words -- **Hierarchical configuration**: Global, user, and project-level configuration support - -## Requirements - -The extension automatically downloads the appropriate `codebook-lsp` language server binary for your platform from GitHub releases on first use. No manual installation is required! - -### Manual Installation (Optional) - -If you prefer to manage the language server yourself, you can: - -#### Option 1: Install via Cargo -```bash -cargo install codebook-lsp -``` - -#### Option 2: Use a Custom Binary -1. Download from [GitHub Releases](https://github.com/blopker/codebook/releases) -2. Set the `codebook.serverPath` setting to point to your binary location - -## Extension Settings - -This extension contributes the following settings: - -* `codebook.enable`: Enable/disable the spell checker -* `codebook.serverPath`: Path to the codebook-lsp executable (default: auto-download from GitHub) -* `codebook.globalConfigPath`: Override the default global `codebook.toml` location -* `codebook.logLevel`: Log level for the language server (`error`, `warn`, `info`, `debug`, `trace`) -* `codebook.minWordLength`: Minimum word length to check (default: 3) -* `codebook.dictionaries`: Additional dictionaries to use -* `codebook.words`: Custom words to add to the dictionary -* `codebook.flagWords`: Words to always flag as misspelled -* `codebook.ignorePaths`: Paths to ignore during spell checking -* `codebook.ignorePatterns`: Regex patterns to ignore -* `codebook.useGlobalConfig`: Use global configuration in addition to project configuration - -## Commands - -The extension provides the following commands: - -* `Codebook: Add to Workspace Dictionary` - Add the current word to the workspace dictionary -* `Codebook: Add to User Dictionary` - Add the current word to your user dictionary -* `Codebook: Restart Language Server` - Restart the Codebook language server -* `Codebook: Show Output Channel` - Show the Codebook output channel for debugging - -## Configuration Files - -Codebook uses TOML configuration files: - -### Project Configuration -Create a `codebook.toml` file in your project root: - -```toml -# Custom words for this project -words = ["myapp", "api", "webpack"] - -# Words to flag as errors -flag_words = ["todo", "fixme"] - -# Paths to ignore -ignore_paths = ["node_modules", "dist", "build"] - -# Regex patterns to ignore -ignore_patterns = [ - "\\bhttps?://[^\\s]+", # URLs - "\\b[A-Z0-9]{8}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{12}\\b" # UUIDs -] - -# Minimum word length -min_word_length = 3 -``` - -### User Configuration -Create a configuration file at `~/.config/codebook/codebook.toml` for user-wide settings. - -## Quick Actions - -When Codebook detects a spelling error, you can: - -1. **Quick Fix**: Use VS Code's Quick Fix feature (Ctrl+. or Cmd+.) to: - - Add the word to your workspace dictionary - - Add the word to your user dictionary - - See spelling suggestions - -2. **Code Actions**: Right-click on a misspelled word to access Codebook actions - -## Troubleshooting - -### Language Server Issues - -The extension automatically downloads the language server on first use. If you encounter issues: - -1. **Automatic Download Failed**: Check your internet connection and GitHub access -2. **Wrong Architecture**: The extension auto-detects your platform. If this fails, manually install the server -3. **Using Custom Binary**: Set `codebook.serverPath` to the full path of your binary -4. **Permission Issues**: On Unix systems, ensure the downloaded binary has execute permissions -5. **Reinstall**: Delete the extension's global storage folder and restart VS Code to trigger a fresh download - -### No Spell Checking - -If spell checking isn't working: - -1. Check the Output Channel: Run "Codebook: Show Output Channel" command -2. Verify the language server is running: Check the status bar -3. Ensure the file type is supported -4. Check your configuration files for syntax errors - -### Performance Issues - -For large projects, you can improve performance by: - -1. Adding more paths to `ignore_paths` in your configuration -2. Using `ignore_patterns` to exclude specific text patterns -3. Increasing the `min_word_length` setting - -## Development - -To build and test the extension locally: - -```bash -# Clone the repository -git clone https://github.com/blopker/codebook.git -cd codebook/vscode-extension - -# Install dependencies -npm install - -# Compile the extension -npm run compile - -# Package the extension -npm run package -``` - -To test the extension: -1. Open the extension folder in VS Code -2. Press F5 to launch a new VS Code window with the extension loaded -3. Open a file to test spell checking - -## Contributing - -Contributions are welcome! Please see the main [Codebook repository](https://github.com/blopker/codebook) for contribution guidelines. - -## License - -MIT - See the [LICENSE](https://github.com/blopker/codebook/blob/main/LICENSE) file for details. diff --git a/vscode-extension/build.sh b/vscode-extension/build.sh deleted file mode 100755 index 0483673..0000000 --- a/vscode-extension/build.sh +++ /dev/null @@ -1,227 +0,0 @@ -#!/bin/bash - -# Build script for Codebook VS Code Extension - -set -e - -# Colors for output -RED='\033[0;31m' -GREEN='\033[0;32m' -YELLOW='\033[1;33m' -BLUE='\033[0;34m' -NC='\033[0m' # No Color - -# Functions -print_info() { - echo -e "${BLUE}[INFO]${NC} $1" -} - -print_success() { - echo -e "${GREEN}[SUCCESS]${NC} $1" -} - -print_error() { - echo -e "${RED}[ERROR]${NC} $1" -} - -print_warning() { - echo -e "${YELLOW}[WARNING]${NC} $1" -} - -# Check if npm is installed -if ! command -v npm &> /dev/null; then - print_error "npm is not installed. Please install Node.js and npm." - exit 1 -fi - -# Check if we're in the right directory -if [ ! -f "package.json" ]; then - print_error "package.json not found. Please run this script from the vscode-extension directory." - exit 1 -fi - -# Parse command line arguments -COMMAND=${1:-build} -SKIP_INSTALL=${2:-false} - -case $COMMAND in - install) - print_info "Installing dependencies..." - npm install - print_success "Dependencies installed successfully!" - ;; - - build) - if [ "$SKIP_INSTALL" != "skip-install" ]; then - print_info "Installing dependencies..." - npm install - fi - - print_info "Compiling TypeScript..." - npm run compile - print_success "Build completed successfully!" - ;; - - watch) - print_info "Starting TypeScript compiler in watch mode..." - npm run watch - ;; - - test) - if [ "$SKIP_INSTALL" != "skip-install" ]; then - print_info "Installing dependencies..." - npm install - fi - - print_info "Running tests..." - npm test - print_success "Tests completed!" - ;; - - lint) - print_info "Running linter..." - npm run lint - print_success "Linting completed!" - ;; - - package) - if [ "$SKIP_INSTALL" != "skip-install" ]; then - print_info "Installing dependencies..." - npm install - fi - - print_info "Checking for vsce..." - if ! command -v vsce &> /dev/null; then - print_warning "vsce not found. Installing globally..." - npm install -g @vscode/vsce - fi - - print_info "Compiling TypeScript..." - npm run compile - - print_info "Packaging extension..." - vsce package - - # Find the generated .vsix file - VSIX_FILE=$(ls -t *.vsix | head -n 1) - if [ -n "$VSIX_FILE" ]; then - print_success "Extension packaged successfully: $VSIX_FILE" - print_info "To install the extension, run:" - echo " code --install-extension $VSIX_FILE" - else - print_error "Failed to create .vsix package" - exit 1 - fi - ;; - - publish) - print_warning "Publishing to VS Code Marketplace..." - print_info "Make sure you have a Personal Access Token from https://dev.azure.com" - - if [ "$SKIP_INSTALL" != "skip-install" ]; then - print_info "Installing dependencies..." - npm install - fi - - print_info "Checking for vsce..." - if ! command -v vsce &> /dev/null; then - print_warning "vsce not found. Installing globally..." - npm install -g @vscode/vsce - fi - - print_info "Compiling TypeScript..." - npm run compile - - print_info "Publishing extension..." - vsce publish - - print_success "Extension published successfully!" - ;; - - clean) - print_info "Cleaning build artifacts..." - rm -rf out/ - rm -rf node_modules/ - rm -f *.vsix - rm -f package-lock.json - print_success "Clean completed!" - ;; - - check-server) - print_info "Checking for codebook-lsp..." - - # Check if codebook-lsp is in PATH - if command -v codebook-lsp &> /dev/null; then - SERVER_PATH=$(which codebook-lsp) - print_success "Found codebook-lsp at: $SERVER_PATH" - print_info "Version: $(codebook-lsp --version 2>/dev/null || echo 'unknown')" - else - print_warning "codebook-lsp not found in PATH" - - # Check common installation locations - CARGO_BIN="$HOME/.cargo/bin/codebook-lsp" - if [ -f "$CARGO_BIN" ]; then - print_info "Found codebook-lsp in cargo bin: $CARGO_BIN" - print_info "Version: $($CARGO_BIN --version 2>/dev/null || echo 'unknown')" - else - print_error "codebook-lsp is not installed" - print_info "To install codebook-lsp, run:" - echo " cargo install codebook-lsp" - exit 1 - fi - fi - ;; - - dev) - print_info "Starting development environment..." - print_info "This will compile the extension and open VS Code in extension development mode" - - if [ "$SKIP_INSTALL" != "skip-install" ]; then - print_info "Installing dependencies..." - npm install - fi - - print_info "Compiling TypeScript..." - npm run compile - - print_info "Opening VS Code in extension development mode..." - code --extensionDevelopmentPath="$(pwd)" . - - print_info "Starting TypeScript compiler in watch mode..." - npm run watch - ;; - - help|--help|-h) - echo "Codebook VS Code Extension Build Script" - echo "" - echo "Usage: ./build.sh [command] [options]" - echo "" - echo "Commands:" - echo " install - Install npm dependencies" - echo " build - Build the extension (default)" - echo " watch - Start TypeScript compiler in watch mode" - echo " test - Run tests" - echo " lint - Run linter" - echo " package - Package the extension as .vsix" - echo " publish - Publish extension to VS Code Marketplace" - echo " clean - Clean build artifacts" - echo " check-server - Check if codebook-lsp is installed" - echo " dev - Start development environment" - echo " help - Show this help message" - echo "" - echo "Options:" - echo " skip-install - Skip npm install step (use as second argument)" - echo "" - echo "Examples:" - echo " ./build.sh # Build the extension" - echo " ./build.sh build skip-install # Build without installing dependencies" - echo " ./build.sh package # Create .vsix package" - echo " ./build.sh dev # Start development environment" - ;; - - *) - print_error "Unknown command: $COMMAND" - echo "Run './build.sh help' for usage information" - exit 1 - ;; -esac diff --git a/vscode-extension/icon.svg b/vscode-extension/icon.svg deleted file mode 100644 index a421200..0000000 --- a/vscode-extension/icon.svg +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - </> - - - - - - - - - - - - - - ABC - diff --git a/vscode-extension/package.json b/vscode-extension/package.json deleted file mode 100644 index 2896bd8..0000000 --- a/vscode-extension/package.json +++ /dev/null @@ -1,221 +0,0 @@ -{ - "name": "codebook", - "displayName": "Codebook", - "description": "A code-aware spell checker for VS Code", - "version": "0.4.0", - "publisher": "codebook", - "icon": "icon.png", - "license": "MIT", - "repository": { - "type": "git", - "url": "https://github.com/blopker/codebook" - }, - "engines": { - "vscode": "^1.85.0", - "node": ">=18.0.0" - }, - "categories": [ - "Linters", - "Other" - ], - "keywords": [ - "spell", - "spellcheck", - "spell-checker", - "spelling", - "code", - "lsp" - ], - "activationEvents": [ - "onLanguage:javascript", - "onLanguage:javascriptreact", - "onLanguage:typescript", - "onLanguage:typescriptreact", - "onLanguage:python", - "onLanguage:rust", - "onLanguage:go", - "onLanguage:java", - "onLanguage:cpp", - "onLanguage:c", - "onLanguage:csharp", - "onLanguage:ruby", - "onLanguage:php", - "onLanguage:swift", - "onLanguage:kotlin", - "onLanguage:scala", - "onLanguage:lua", - "onLanguage:dart", - "onLanguage:elixir", - "onLanguage:haskell", - "onLanguage:ocaml", - "onLanguage:fsharp", - "onLanguage:clojure", - "onLanguage:zig", - "onLanguage:nim", - "onLanguage:julia", - "onLanguage:r", - "onLanguage:matlab", - "onLanguage:perl", - "onLanguage:shell", - "onLanguage:bash", - "onLanguage:powershell", - "onLanguage:sql", - "onLanguage:html", - "onLanguage:css", - "onLanguage:scss", - "onLanguage:sass", - "onLanguage:less", - "onLanguage:xml", - "onLanguage:yaml", - "onLanguage:json", - "onLanguage:toml", - "onLanguage:markdown", - "onLanguage:latex", - "onLanguage:plaintext" - ], - "main": "./out/extension.js", - "contributes": { - "configuration": { - "type": "object", - "title": "Codebook", - "properties": { - "codebook.enable": { - "type": "boolean", - "default": true, - "description": "Enable/disable Codebook spell checker" - }, - "codebook.serverPath": { - "type": "string", - "default": "", - "description": "Optional: Path to a custom codebook-lsp executable. If not specified, the extension will automatically download the appropriate binary for your platform." - }, - "codebook.globalConfigPath": { - "type": "string", - "default": "", - "description": "Optional: Override the default global codebook.toml location. Useful if you sync your config in a custom directory." - }, - "codebook.logLevel": { - "type": "string", - "enum": [ - "error", - "warn", - "info", - "debug", - "trace" - ], - "default": "info", - "description": "Log level for the language server" - }, - "codebook.minWordLength": { - "type": "number", - "default": 3, - "description": "Minimum word length to check" - }, - "codebook.dictionaries": { - "type": "array", - "default": [], - "description": "Additional dictionaries to use", - "items": { - "type": "string" - } - }, - "codebook.words": { - "type": "array", - "default": [], - "description": "Custom words to add to the dictionary", - "items": { - "type": "string" - } - }, - "codebook.flagWords": { - "type": "array", - "default": [], - "description": "Words to always flag as misspelled", - "items": { - "type": "string" - } - }, - "codebook.ignorePaths": { - "type": "array", - "default": [], - "description": "Paths to ignore", - "items": { - "type": "string" - } - }, - "codebook.ignorePatterns": { - "type": "array", - "default": [], - "description": "Regex patterns to ignore", - "items": { - "type": "string" - } - }, - "codebook.useGlobalConfig": { - "type": "boolean", - "default": true, - "description": "Use global configuration in addition to project configuration" - }, - "codebook.trace.server": { - "type": "string", - "enum": [ - "off", - "messages", - "verbose" - ], - "default": "off", - "description": "Traces the communication between VS Code and the language server" - } - } - }, - "commands": [ - { - "command": "codebook.addToWorkspaceDictionary", - "title": "Add to Workspace Dictionary", - "category": "Codebook" - }, - { - "command": "codebook.addToUserDictionary", - "title": "Add to User Dictionary", - "category": "Codebook" - }, - { - "command": "codebook.restart", - "title": "Restart Language Server", - "category": "Codebook" - }, - { - "command": "codebook.showOutputChannel", - "title": "Show Output Channel", - "category": "Codebook" - } - ] - }, - "scripts": { - "vscode:prepublish": "npm run compile", - "compile": "tsc -p ./", - "watch": "tsc -watch -p ./", - "pretest": "npm run compile && npm run lint", - "lint": "eslint src --ext ts", - "test": "node ./out/test/runTest.js", - "package": "vsce package", - "publish": "vsce publish" - }, - "dependencies": { - "vscode-languageclient": "^9.0.1", - "tar": "^6.2.0", - "adm-zip": "^0.5.10" - }, - "devDependencies": { - "@types/vscode": "^1.85.0", - "@types/node": "20.x", - "@types/tar": "^6.1.10", - "@types/adm-zip": "^0.5.5", - "@typescript-eslint/eslint-plugin": "^6.15.0", - "@typescript-eslint/parser": "^6.15.0", - "eslint": "^8.56.0", - "typescript": "^5.3.3", - "@vscode/test-electron": "^2.3.8", - "@vscode/vsce": "^2.22.0" - } -} diff --git a/vscode-extension/src/extension.ts b/vscode-extension/src/extension.ts deleted file mode 100644 index 9a207d8..0000000 --- a/vscode-extension/src/extension.ts +++ /dev/null @@ -1,531 +0,0 @@ -import { execSync } from "node:child_process"; -import * as fs from "node:fs"; -import * as os from "node:os"; -import * as path from "node:path"; -import * as vscode from "vscode"; -import { - LanguageClient, - type LanguageClientOptions, - RevealOutputChannelOn, - type ServerOptions, - TransportKind, -} from "vscode-languageclient/node"; - -const EXTENSION_LSP_NAME = "codebook-lsp"; -const GITHUB_REPO = "blopker/codebook"; - -let client: LanguageClient | undefined; -let outputChannel: vscode.OutputChannel | undefined; - -interface GitHubRelease { - // eslint-disable-next-line @typescript-eslint/naming-convention - tag_name: string; - assets: Array<{ - name: string; - // eslint-disable-next-line @typescript-eslint/naming-convention - browser_download_url: string; - }>; -} - -interface BinaryInfo { - path: string; - version: string; -} - -function getPlatformInfo(): { platform: string; arch: string; ext: string } { - const platform = os.platform(); - const arch = os.arch(); - - let platformStr: string; - let archStr: string; - let ext: string; - - // Map Node.js arch to Rust target arch - switch (arch) { - case "x64": - archStr = "x86_64"; - break; - case "arm64": - archStr = "aarch64"; - break; - default: - throw new Error(`Unsupported architecture: ${arch}`); - } - - // Map Node.js platform to Rust target platform - switch (platform) { - case "darwin": - platformStr = "apple-darwin"; - ext = "tar.gz"; - break; - case "linux": - platformStr = "unknown-linux-musl"; - ext = "tar.gz"; - break; - case "win32": - platformStr = "pc-windows-msvc"; - ext = "zip"; - break; - default: - throw new Error(`Unsupported platform: ${platform}`); - } - - return { platform: platformStr, arch: archStr, ext }; -} - -async function fetchLatestRelease(): Promise { - const url = `https://api.github.com/repos/${GITHUB_REPO}/releases/latest`; - - try { - const response = await fetch(url, { - headers: { - // eslint-disable-next-line @typescript-eslint/naming-convention - "User-Agent": "vscode-codebook-extension", - // eslint-disable-next-line @typescript-eslint/naming-convention - Accept: "application/vnd.github.v3+json", - }, - }); - - if (!response.ok) { - throw new Error( - `GitHub API returned ${response.status}: ${response.statusText}`, - ); - } - - return (await response.json()) as GitHubRelease; - } catch (error) { - throw new Error(`Failed to fetch latest release: ${error}`); - } -} - -async function downloadFile( - url: string, - destPath: string, - progressCallback?: (progress: number) => void, -): Promise { - const response = await fetch(url, { - headers: { - // eslint-disable-next-line @typescript-eslint/naming-convention - "User-Agent": "vscode-codebook-extension", - }, - }); - - if (!response.ok) { - throw new Error( - `Failed to download: ${response.status} ${response.statusText}`, - ); - } - - const contentLength = response.headers.get("content-length"); - const totalSize = contentLength ? parseInt(contentLength, 10) : 0; - - const destDir = path.dirname(destPath); - if (!fs.existsSync(destDir)) { - fs.mkdirSync(destDir, { recursive: true }); - } - - const fileStream = fs.createWriteStream(destPath); - const reader = response.body?.getReader(); - - if (!reader) { - throw new Error("Failed to get response body reader"); - } - - let downloadedSize = 0; - - try { - // eslint-disable-next-line no-constant-condition - while (true) { - const { done, value } = await reader.read(); - if (done) { - break; - } - - fileStream.write(value); - downloadedSize += value.length; - - if (progressCallback && totalSize > 0) { - const progress = (downloadedSize / totalSize) * 100; - progressCallback(progress); - } - } - } finally { - fileStream.close(); - } -} - -async function extractArchive( - archivePath: string, - destDir: string, - ext: string, -): Promise { - if (!fs.existsSync(destDir)) { - fs.mkdirSync(destDir, { recursive: true }); - } - - if (ext === "tar.gz") { - // Dynamic import for tar module - // eslint-disable-next-line @typescript-eslint/no-var-requires - const tar = require("tar"); - await tar.extract({ - file: archivePath, - cwd: destDir, - }); - } else if (ext === "zip") { - // Dynamic import for adm-zip module - // eslint-disable-next-line @typescript-eslint/no-var-requires - const admZip = require("adm-zip"); - const zip = new admZip(archivePath); - zip.extractAllTo(destDir, true); - } else { - throw new Error(`Unsupported archive format: ${ext}`); - } -} - -function makeExecutable(filePath: string): void { - if (os.platform() !== "win32") { - fs.chmodSync(filePath, 0o755); - } -} - -function getCacheDir(context: vscode.ExtensionContext): string { - return path.join(context.globalStorageUri.fsPath, "binaries"); -} - -function getCachedBinary(context: vscode.ExtensionContext): BinaryInfo | null { - const cacheDir = getCacheDir(context); - const metaPath = path.join(cacheDir, "binary-meta.json"); - - if (!fs.existsSync(metaPath)) { - return null; - } - - try { - const meta = JSON.parse(fs.readFileSync(metaPath, "utf8")); - const binaryPath = meta.path; - - if (fs.existsSync(binaryPath)) { - return meta as BinaryInfo; - } - } catch (error) { - outputChannel?.appendLine( - `Failed to read cached binary metadata: ${error}`, - ); - } - - return null; -} - -function saveBinaryMeta( - context: vscode.ExtensionContext, - info: BinaryInfo, -): void { - const cacheDir = getCacheDir(context); - const metaPath = path.join(cacheDir, "binary-meta.json"); - - if (!fs.existsSync(cacheDir)) { - fs.mkdirSync(cacheDir, { recursive: true }); - } - - fs.writeFileSync(metaPath, JSON.stringify(info, null, 2)); -} - -function resolveGlobalConfigPath( - rawPath: string | undefined, -): string | undefined { - if (!rawPath) { - return undefined; - } - - const trimmed = rawPath.trim(); - if (!trimmed) { - return undefined; - } - - let expanded = trimmed; - if (expanded.startsWith("~")) { - const home = os.homedir(); - expanded = path.join(home, expanded.slice(1)); - } - - if (!path.isAbsolute(expanded)) { - expanded = path.resolve(expanded); - } - - return expanded; -} - -async function findLocalBinary(): Promise { - // Check if binary exists in PATH - const whichCommand = process.platform === "win32" ? "where" : "which"; - try { - const result = execSync(`${whichCommand} ${EXTENSION_LSP_NAME}`, { - encoding: "utf8", - }); - return result.trim().split("\n")[0]; - } catch { - // Not found in PATH - } - - // Check cargo install location - const cargoPath = path.join( - process.env.HOME || process.env.USERPROFILE || "", - ".cargo", - "bin", - EXTENSION_LSP_NAME + (process.platform === "win32" ? ".exe" : ""), - ); - - if (fs.existsSync(cargoPath)) { - return cargoPath; - } - - return null; -} - -async function downloadAndInstallBinary( - context: vscode.ExtensionContext, - progressCallback?: (message: string) => void, -): Promise { - const { platform, arch, ext } = getPlatformInfo(); - - progressCallback?.("Fetching latest release information..."); - const release = await fetchLatestRelease(); - - const assetName = `${EXTENSION_LSP_NAME}-${arch}-${platform}.${ext}`; - const asset = release.assets.find((a) => a.name === assetName); - - if (!asset) { - throw new Error(`No compatible binary found for ${arch}-${platform}`); - } - - const cacheDir = getCacheDir(context); - const versionDir = path.join(cacheDir, release.tag_name); - const binaryName = - EXTENSION_LSP_NAME + (process.platform === "win32" ? ".exe" : ""); - const binaryPath = path.join(versionDir, binaryName); - - // Check if this version is already downloaded - if (fs.existsSync(binaryPath)) { - return { path: binaryPath, version: release.tag_name }; - } - - // Clean up old versions - if (fs.existsSync(cacheDir)) { - const dirs = fs.readdirSync(cacheDir).filter((d) => { - const dirPath = path.join(cacheDir, d); - return fs.statSync(dirPath).isDirectory() && d !== release.tag_name; - }); - - for (const dir of dirs) { - try { - fs.rmSync(path.join(cacheDir, dir), { recursive: true, force: true }); - } catch (error) { - outputChannel?.appendLine( - `Failed to remove old version ${dir}: ${error}`, - ); - } - } - } - - // Download the binary - const tempDir = path.join(cacheDir, `temp-${Date.now()}`); - const archivePath = path.join(tempDir, assetName); - - try { - progressCallback?.(`Downloading ${assetName}...`); - - await downloadFile(asset.browser_download_url, archivePath, (progress) => { - progressCallback?.(`Downloading: ${Math.round(progress)}%`); - }); - - progressCallback?.("Extracting archive..."); - await extractArchive(archivePath, versionDir, ext); - - // Make binary executable - makeExecutable(binaryPath); - - // Clean up temp directory - fs.rmSync(tempDir, { recursive: true, force: true }); - - const info = { path: binaryPath, version: release.tag_name }; - saveBinaryMeta(context, info); - - return info; - } catch (error) { - // Clean up on error - try { - if (fs.existsSync(tempDir)) { - fs.rmSync(tempDir, { recursive: true, force: true }); - } - if (fs.existsSync(versionDir)) { - fs.rmSync(versionDir, { recursive: true, force: true }); - } - } catch { - // Ignore cleanup errors - } - - throw error; - } -} - -async function getBinary(context: vscode.ExtensionContext): Promise { - const config = vscode.workspace.getConfiguration("codebook"); - - // Check if user has specified a custom path - const customPath = config.get("serverPath"); - if (customPath && customPath !== EXTENSION_LSP_NAME) { - if (path.isAbsolute(customPath) && fs.existsSync(customPath)) { - outputChannel?.appendLine(`Using custom binary path: ${customPath}`); - return customPath; - } - } - - // Check for local development binary - const devPath = path.join( - context.extensionPath, - "..", - "..", - "target", - "release", - EXTENSION_LSP_NAME, - ); - if (fs.existsSync(devPath)) { - outputChannel?.appendLine(`Using development binary: ${devPath}`); - return devPath; - } - - // Check for locally installed binary - const localBinary = await findLocalBinary(); - if (localBinary) { - outputChannel?.appendLine(`Using local binary: ${localBinary}`); - return localBinary; - } - - // Check for cached binary - const cached = getCachedBinary(context); - if (cached) { - outputChannel?.appendLine( - `Using cached binary: ${cached.path} (version: ${cached.version})`, - ); - return cached.path; - } - - // Download and install binary - outputChannel?.appendLine( - "No local binary found, downloading from GitHub...", - ); - - const info = await vscode.window.withProgress( - { - location: vscode.ProgressLocation.Notification, - title: "Codebook", - cancellable: false, - }, - async (progress) => { - return downloadAndInstallBinary(context, (message) => { - progress.report({ message }); - }); - }, - ); - - outputChannel?.appendLine( - `Downloaded and installed binary: ${info.path} (version: ${info.version})`, - ); - return info.path; -} - -export async function activate(context: vscode.ExtensionContext) { - const config = vscode.workspace.getConfiguration("codebook"); - - if (!config.get("enable", true)) { - return; - } - - outputChannel = vscode.window.createOutputChannel("Codebook"); - - try { - const serverPath = await getBinary(context); - const resolvedGlobalConfigPath = resolveGlobalConfigPath( - config.get("globalConfigPath", ""), - ); - - // Server options - const serverOptions: ServerOptions = { - command: serverPath, - args: ["--root=./", "serve"], - transport: TransportKind.stdio, - }; - - // Client options - const initializationOptions: Record = { - logLevel: config.get("logLevel", "info"), - }; - if (resolvedGlobalConfigPath) { - initializationOptions.globalConfigPath = resolvedGlobalConfigPath; - } - - const clientOptions: LanguageClientOptions = { - documentSelector: [ - { scheme: "file", language: "*" }, - { scheme: "untitled", language: "*" }, - ], - outputChannel, - revealOutputChannelOn: RevealOutputChannelOn.Error, - initializationOptions, - }; - - // Create the language client - client = new LanguageClient( - "codebook", - "Codebook Language Server", - serverOptions, - clientOptions, - ); - - // Register commands - context.subscriptions.push( - vscode.commands.registerCommand("codebook.restart", async () => { - if (client) { - await client.stop(); - await client.start(); - vscode.window.showInformationMessage( - "Codebook language server restarted", - ); - } - }), - ); - - context.subscriptions.push( - vscode.commands.registerCommand("codebook.showOutputChannel", () => { - outputChannel?.show(); - }), - ); - - // Start the client - await client.start(); - outputChannel.appendLine("Codebook language server started successfully"); - } catch (error) { - const errorMessage = `Failed to start Codebook language server: ${error}`; - outputChannel?.appendLine(errorMessage); - vscode.window.showErrorMessage(errorMessage); - - // Suggest manual installation - const selection = await vscode.window.showInformationMessage( - "Would you like to manually install the Codebook language server?", - "Install Instructions", - ); - - if (selection === "Install Instructions") { - vscode.env.openExternal( - vscode.Uri.parse(`https://github.com/${GITHUB_REPO}#installation`), - ); - } - } -} - -export function deactivate(): Thenable | undefined { - if (!client) { - return undefined; - } - return client.stop(); -} diff --git a/vscode-extension/src/test/binaryDownload.test.ts b/vscode-extension/src/test/binaryDownload.test.ts deleted file mode 100644 index 25ceb5d..0000000 --- a/vscode-extension/src/test/binaryDownload.test.ts +++ /dev/null @@ -1,298 +0,0 @@ -import * as assert from "assert"; -import * as fs from "fs"; -import { afterEach, beforeEach, describe, it } from "mocha"; -import * as os from "os"; -import * as path from "path"; -import * as vscode from "vscode"; - -// Mock interfaces for testing -interface MockContext extends vscode.ExtensionContext { - globalStorageUri: vscode.Uri; -} - -describe("Binary Download Tests", () => { - let mockContext: MockContext; - let tempDir: string; - - beforeEach(() => { - // Create a temporary directory for testing - tempDir = path.join(os.tmpdir(), `codebook-test-${Date.now()}`); - fs.mkdirSync(tempDir, { recursive: true }); - - // Create mock context - mockContext = { - globalStorageUri: vscode.Uri.file(tempDir), - } as MockContext; - }); - - afterEach(() => { - // Clean up temporary directory - if (fs.existsSync(tempDir)) { - fs.rmSync(tempDir, { recursive: true, force: true }); - } - }); - - describe("Platform Detection", () => { - it("should correctly detect platform for macOS", () => { - if (os.platform() === "darwin") { - const platform = os.platform(); - const arch = os.arch(); - - assert.strictEqual(platform, "darwin"); - assert.ok(["x64", "arm64"].includes(arch)); - } - }); - - it("should correctly detect platform for Linux", () => { - if (os.platform() === "linux") { - const platform = os.platform(); - const arch = os.arch(); - - assert.strictEqual(platform, "linux"); - assert.ok(["x64", "arm64"].includes(arch)); - } - }); - - it("should correctly detect platform for Windows", () => { - if (os.platform() === "win32") { - const platform = os.platform(); - const arch = os.arch(); - - assert.strictEqual(platform, "win32"); - assert.ok(["x64", "arm64", "ia32"].includes(arch)); - } - }); - }); - - describe("Cache Management", () => { - it("should create cache directory if it doesn't exist", () => { - const cacheDir = path.join(tempDir, "binaries"); - - if (!fs.existsSync(cacheDir)) { - fs.mkdirSync(cacheDir, { recursive: true }); - } - - assert.ok(fs.existsSync(cacheDir)); - assert.ok(fs.statSync(cacheDir).isDirectory()); - }); - - it("should save binary metadata", () => { - const cacheDir = path.join(tempDir, "binaries"); - const metaPath = path.join(cacheDir, "binary-meta.json"); - - fs.mkdirSync(cacheDir, { recursive: true }); - - const metadata = { - path: path.join(cacheDir, "v1.0.0", "codebook-lsp"), - version: "v1.0.0", - }; - - fs.writeFileSync(metaPath, JSON.stringify(metadata, null, 2)); - - assert.ok(fs.existsSync(metaPath)); - - const savedMeta = JSON.parse(fs.readFileSync(metaPath, "utf8")); - assert.deepStrictEqual(savedMeta, metadata); - }); - - it("should read cached binary metadata", () => { - const cacheDir = path.join(tempDir, "binaries"); - const metaPath = path.join(cacheDir, "binary-meta.json"); - - fs.mkdirSync(cacheDir, { recursive: true }); - - const metadata = { - path: path.join(cacheDir, "v1.0.0", "codebook-lsp"), - version: "v1.0.0", - }; - - fs.writeFileSync(metaPath, JSON.stringify(metadata, null, 2)); - - const readMeta = JSON.parse(fs.readFileSync(metaPath, "utf8")); - assert.strictEqual(readMeta.version, "v1.0.0"); - assert.ok(readMeta.path.includes("codebook-lsp")); - }); - - it("should handle missing metadata gracefully", () => { - const cacheDir = path.join(tempDir, "binaries"); - const metaPath = path.join(cacheDir, "binary-meta.json"); - - assert.ok(!fs.existsSync(metaPath)); - - // Should not throw when metadata doesn't exist - let meta = null; - if (fs.existsSync(metaPath)) { - try { - meta = JSON.parse(fs.readFileSync(metaPath, "utf8")); - } catch { - meta = null; - } - } - - assert.strictEqual(meta, null); - }); - }); - - describe("Binary Path Resolution", () => { - it("should check for development binary", () => { - const devPath = path.join( - mockContext.globalStorageUri.fsPath, - "..", - "..", - "target", - "release", - "codebook-lsp", - ); - - // In a real dev environment, this might exist - const exists = fs.existsSync(devPath); - assert.strictEqual(typeof exists, "boolean"); - }); - - it("should handle custom server path from configuration", () => { - const customPath = "/custom/path/to/codebook-lsp"; - - // Mock configuration would return this custom path - // In real implementation, this would come from vscode.workspace.getConfiguration - const serverPath = customPath; - - assert.strictEqual(serverPath, customPath); - }); - - it("should handle Windows executable extension", () => { - const binaryName = "codebook-lsp"; - const withExtension = - process.platform === "win32" ? `${binaryName}.exe` : binaryName; - - if (process.platform === "win32") { - assert.ok(withExtension.endsWith(".exe")); - } else { - assert.ok(!withExtension.endsWith(".exe")); - } - }); - }); - - describe("Version Management", () => { - it("should clean up old versions", () => { - const cacheDir = path.join(tempDir, "binaries"); - - // Create multiple version directories - const oldVersion1 = path.join(cacheDir, "v0.1.0"); - const oldVersion2 = path.join(cacheDir, "v0.2.0"); - const currentVersion = path.join(cacheDir, "v1.0.0"); - - fs.mkdirSync(oldVersion1, { recursive: true }); - fs.mkdirSync(oldVersion2, { recursive: true }); - fs.mkdirSync(currentVersion, { recursive: true }); - - // Simulate cleanup of old versions - const dirs = fs.readdirSync(cacheDir).filter((d) => { - const dirPath = path.join(cacheDir, d); - return fs.statSync(dirPath).isDirectory() && d !== "v1.0.0"; - }); - - for (const dir of dirs) { - fs.rmSync(path.join(cacheDir, dir), { recursive: true, force: true }); - } - - // Verify only current version remains - const remainingDirs = fs.readdirSync(cacheDir).filter((d) => { - const dirPath = path.join(cacheDir, d); - return fs.statSync(dirPath).isDirectory(); - }); - - assert.strictEqual(remainingDirs.length, 1); - assert.strictEqual(remainingDirs[0], "v1.0.0"); - }); - - it("should handle version directory creation", () => { - const cacheDir = path.join(tempDir, "binaries"); - const versionDir = path.join(cacheDir, "v1.0.0"); - - fs.mkdirSync(versionDir, { recursive: true }); - - assert.ok(fs.existsSync(versionDir)); - assert.ok(fs.statSync(versionDir).isDirectory()); - }); - }); - - describe("Error Handling", () => { - it("should handle missing binary gracefully", () => { - const binaryPath = path.join(tempDir, "nonexistent", "codebook-lsp"); - const exists = fs.existsSync(binaryPath); - - assert.strictEqual(exists, false); - }); - - it("should clean up temp directory on error", () => { - const tempDownloadDir = path.join(tempDir, `temp-${Date.now()}`); - - fs.mkdirSync(tempDownloadDir, { recursive: true }); - assert.ok(fs.existsSync(tempDownloadDir)); - - // Simulate error and cleanup - try { - // Simulate an error - throw new Error("Download failed"); - } catch { - // Clean up - if (fs.existsSync(tempDownloadDir)) { - fs.rmSync(tempDownloadDir, { recursive: true, force: true }); - } - } - - assert.ok(!fs.existsSync(tempDownloadDir)); - }); - - it("should handle permission errors", () => { - if (process.platform !== "win32") { - const binaryPath = path.join(tempDir, "test-binary"); - fs.writeFileSync(binaryPath, "test content"); - - // Check initial permissions - const stats = fs.statSync(binaryPath); - const isExecutable = (stats.mode & 0o111) !== 0; - - // Make executable - fs.chmodSync(binaryPath, 0o755); - - const newStats = fs.statSync(binaryPath); - const isNowExecutable = (newStats.mode & 0o111) !== 0; - - assert.ok(isNowExecutable); - } - }); - }); - - describe("Asset Name Generation", () => { - it("should generate correct asset name for macOS", () => { - const arch = os.arch() === "x64" ? "x86_64" : "aarch64"; - const assetName = `codebook-lsp-${arch}-apple-darwin.tar.gz`; - - if (os.platform() === "darwin") { - assert.ok(assetName.includes("apple-darwin")); - assert.ok(assetName.endsWith(".tar.gz")); - } - }); - - it("should generate correct asset name for Linux", () => { - const arch = os.arch() === "x64" ? "x86_64" : "aarch64"; - const assetName = `codebook-lsp-${arch}-unknown-linux-musl.tar.gz`; - - if (os.platform() === "linux") { - assert.ok(assetName.includes("unknown-linux-musl")); - assert.ok(assetName.endsWith(".tar.gz")); - } - }); - - it("should generate correct asset name for Windows", () => { - const arch = os.arch() === "x64" ? "x86_64" : "aarch64"; - const assetName = `codebook-lsp-${arch}-pc-windows-msvc.zip`; - - if (os.platform() === "win32") { - assert.ok(assetName.includes("pc-windows-msvc")); - assert.ok(assetName.endsWith(".zip")); - } - }); - }); -}); diff --git a/vscode-extension/tsconfig.json b/vscode-extension/tsconfig.json deleted file mode 100644 index e5e3899..0000000 --- a/vscode-extension/tsconfig.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "target": "ES2020", - "outDir": "out", - "lib": ["ES2020"], - "sourceMap": true, - "rootDir": "src", - "strict": true, - "esModuleInterop": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true, - "resolveJsonModule": true, - "moduleResolution": "node" - }, - "exclude": [ - "node_modules", - ".vscode-test" - ] -} From 819951e336f78242ab88169669479960b09e0931 Mon Sep 17 00:00:00 2001 From: Bo Lopker Date: Tue, 18 Nov 2025 21:13:23 -0800 Subject: [PATCH 2/5] First pass --- README.md | 20 ++ editors/vscode/.vscodeignore | 5 + editors/vscode/README.md | 29 ++ editors/vscode/bun.lock | 80 +++++ editors/vscode/dist/binary.js | 350 +++++++++++++++++++++ editors/vscode/dist/binary.js.map | 1 + editors/vscode/dist/extension.js | 170 ++++++++++ editors/vscode/dist/extension.js.map | 1 + editors/vscode/dist/languages.js | 32 ++ editors/vscode/dist/languages.js.map | 1 + editors/vscode/package.json | 99 ++++++ editors/vscode/src/binary.ts | 447 +++++++++++++++++++++++++++ editors/vscode/src/extension.ts | 191 ++++++++++++ editors/vscode/src/languages.ts | 29 ++ editors/vscode/tsconfig.json | 17 + 15 files changed, 1472 insertions(+) create mode 100644 editors/vscode/.vscodeignore create mode 100644 editors/vscode/README.md create mode 100644 editors/vscode/bun.lock create mode 100644 editors/vscode/dist/binary.js create mode 100644 editors/vscode/dist/binary.js.map create mode 100644 editors/vscode/dist/extension.js create mode 100644 editors/vscode/dist/extension.js.map create mode 100644 editors/vscode/dist/languages.js create mode 100644 editors/vscode/dist/languages.js.map create mode 100644 editors/vscode/package.json create mode 100644 editors/vscode/src/binary.ts create mode 100644 editors/vscode/src/extension.ts create mode 100644 editors/vscode/src/languages.ts create mode 100644 editors/vscode/tsconfig.json diff --git a/README.md b/README.md index 5a15fec..dacdd65 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,26 @@ Please give a ⭐ if you find Codebook useful! ## Integrations +### VS Code + +An official VS Code extension lives in `editors/vscode`. The extension manages +the `codebook-lsp` binary for you, starts it with the right flags, and exposes a +few configuration toggles (`codebook.binaryPath`, `codebook.enablePrerelease`, +and `codebook.logLevel`). + +To try it locally: + +```sh +cd editors/vscode +bun install # or npm install +bun run build +vsce package # requires npm i -g @vscode/vsce +code --install-extension codebook-vscode-*.vsix +``` + +Once the extension is installed it will activate automatically for every +supported language. + ### Zed Codebook is the most popular spell checker for Zed! To install, go to the Extension tab in Zed and look for "Codebook". Done! diff --git a/editors/vscode/.vscodeignore b/editors/vscode/.vscodeignore new file mode 100644 index 0000000..11f73d8 --- /dev/null +++ b/editors/vscode/.vscodeignore @@ -0,0 +1,5 @@ +src +node_modules/@types +node_modules/typescript +node_modules/.bin +*.tsbuildinfo diff --git a/editors/vscode/README.md b/editors/vscode/README.md new file mode 100644 index 0000000..334af44 --- /dev/null +++ b/editors/vscode/README.md @@ -0,0 +1,29 @@ +# Codebook VS Code Extension + +This extension wires the Codebook language server into VS Code so code-specific +spell check diagnostics and quick fixes appear automatically. + +## Features + +- Automatically launches `codebook-lsp` for C, C++, CSS, Elixir, Go, HTML, + Haskell, Java, JavaScript, LaTeX, Lua, Markdown, PHP, plain text, Python, + Ruby, Rust, TOML, TypeScript, Typst, Zig, and C# files. +- Downloads, caches, and updates the Codebook language server without requiring + any manual installation. +- Supports custom binary locations and optional pre-release builds via + `codebook.*` settings. + +## Development + +``` +cd editors/vscode +bun install # or npm install / pnpm install +bun run build # or npm run build +``` + +The emitted JavaScript lives in `dist/` and can be loaded into VS Code via the +`Extension Tests / Run Extension` launch configuration or by using +`vsce package`. + +Set `codebook.logLevel` to `debug` to see verbose logs from the language server +inside the `Codebook` output channel. diff --git a/editors/vscode/bun.lock b/editors/vscode/bun.lock new file mode 100644 index 0000000..0f33e07 --- /dev/null +++ b/editors/vscode/bun.lock @@ -0,0 +1,80 @@ +{ + "lockfileVersion": 1, + "configVersion": 1, + "workspaces": { + "": { + "name": "codebook-vscode", + "dependencies": { + "@types/adm-zip": "^0.5.7", + "@types/tar": "^6.1.13", + "@types/which": "^3.0.4", + "adm-zip": "^0.5.12", + "tar": "^6.2.1", + "vscode-languageclient": "^9.0.1", + "which": "^4.0.0", + }, + "devDependencies": { + "@types/node": "^20.12.7", + "@types/vscode": "^1.80.0", + "typescript": "^5.4.0", + }, + }, + }, + "packages": { + "@types/adm-zip": ["@types/adm-zip@0.5.7", "", { "dependencies": { "@types/node": "*" } }, "sha512-DNEs/QvmyRLurdQPChqq0Md4zGvPwHerAJYWk9l2jCbD1VPpnzRJorOdiq4zsw09NFbYnhfsoEhWtxIzXpn2yw=="], + + "@types/node": ["@types/node@20.19.25", "", { "dependencies": { "undici-types": "~6.21.0" } }, "sha512-ZsJzA5thDQMSQO788d7IocwwQbI8B5OPzmqNvpf3NY/+MHDAS759Wo0gd2WQeXYt5AAAQjzcrTVC6SKCuYgoCQ=="], + + "@types/tar": ["@types/tar@6.1.13", "", { "dependencies": { "@types/node": "*", "minipass": "^4.0.0" } }, "sha512-IznnlmU5f4WcGTh2ltRu/Ijpmk8wiWXfF0VA4s+HPjHZgvFggk1YaIkbo5krX/zUCzWF8N/l4+W/LNxnvAJ8nw=="], + + "@types/vscode": ["@types/vscode@1.106.1", "", {}, "sha512-R/HV8u2h8CAddSbX8cjpdd7B8/GnE4UjgjpuGuHcbp1xV6yh4OeqU4L1pKjlwujCrSFS0MOpwJAIs/NexMB1fQ=="], + + "@types/which": ["@types/which@3.0.4", "", {}, "sha512-liyfuo/106JdlgSchJzXEQCVArk0CvevqPote8F8HgWgJ3dRCcTHgJIsLDuee0kxk/mhbInzIZk3QWSZJ8R+2w=="], + + "adm-zip": ["adm-zip@0.5.16", "", {}, "sha512-TGw5yVi4saajsSEgz25grObGHEUaDrniwvA2qwSC060KfqGPdglhvPMA2lPIoxs3PQIItj2iag35fONcQqgUaQ=="], + + "balanced-match": ["balanced-match@1.0.2", "", {}, "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="], + + "brace-expansion": ["brace-expansion@2.0.2", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ=="], + + "chownr": ["chownr@2.0.0", "", {}, "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ=="], + + "fs-minipass": ["fs-minipass@2.1.0", "", { "dependencies": { "minipass": "^3.0.0" } }, "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg=="], + + "isexe": ["isexe@3.1.1", "", {}, "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ=="], + + "minimatch": ["minimatch@5.1.6", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g=="], + + "minipass": ["minipass@4.2.8", "", {}, "sha512-fNzuVyifolSLFL4NzpF+wEF4qrgqaaKX0haXPQEdQ7NKAN+WecoKMHV09YcuL/DHxrUsYQOK3MiuDf7Ip2OXfQ=="], + + "minizlib": ["minizlib@2.1.2", "", { "dependencies": { "minipass": "^3.0.0", "yallist": "^4.0.0" } }, "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg=="], + + "mkdirp": ["mkdirp@1.0.4", "", { "bin": { "mkdirp": "bin/cmd.js" } }, "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw=="], + + "semver": ["semver@7.7.3", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q=="], + + "tar": ["tar@6.2.1", "", { "dependencies": { "chownr": "^2.0.0", "fs-minipass": "^2.0.0", "minipass": "^5.0.0", "minizlib": "^2.1.1", "mkdirp": "^1.0.3", "yallist": "^4.0.0" } }, "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A=="], + + "typescript": ["typescript@5.9.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="], + + "undici-types": ["undici-types@6.21.0", "", {}, "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ=="], + + "vscode-jsonrpc": ["vscode-jsonrpc@8.2.0", "", {}, "sha512-C+r0eKJUIfiDIfwJhria30+TYWPtuHJXHtI7J0YlOmKAo7ogxP20T0zxB7HZQIFhIyvoBPwWskjxrvAtfjyZfA=="], + + "vscode-languageclient": ["vscode-languageclient@9.0.1", "", { "dependencies": { "minimatch": "^5.1.0", "semver": "^7.3.7", "vscode-languageserver-protocol": "3.17.5" } }, "sha512-JZiimVdvimEuHh5olxhxkht09m3JzUGwggb5eRUkzzJhZ2KjCN0nh55VfiED9oez9DyF8/fz1g1iBV3h+0Z2EA=="], + + "vscode-languageserver-protocol": ["vscode-languageserver-protocol@3.17.5", "", { "dependencies": { "vscode-jsonrpc": "8.2.0", "vscode-languageserver-types": "3.17.5" } }, "sha512-mb1bvRJN8SVznADSGWM9u/b07H7Ecg0I3OgXDuLdn307rl/J3A9YD6/eYOssqhecL27hK1IPZAsaqh00i/Jljg=="], + + "vscode-languageserver-types": ["vscode-languageserver-types@3.17.5", "", {}, "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg=="], + + "which": ["which@4.0.0", "", { "dependencies": { "isexe": "^3.1.1" }, "bin": { "node-which": "bin/which.js" } }, "sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg=="], + + "yallist": ["yallist@4.0.0", "", {}, "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="], + + "fs-minipass/minipass": ["minipass@3.3.6", "", { "dependencies": { "yallist": "^4.0.0" } }, "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw=="], + + "minizlib/minipass": ["minipass@3.3.6", "", { "dependencies": { "yallist": "^4.0.0" } }, "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw=="], + + "tar/minipass": ["minipass@5.0.0", "", {}, "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ=="], + } +} diff --git a/editors/vscode/dist/binary.js b/editors/vscode/dist/binary.js new file mode 100644 index 0000000..7491f9c --- /dev/null +++ b/editors/vscode/dist/binary.js @@ -0,0 +1,350 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CodebookBinaryManager = void 0; +const vscode = __importStar(require("vscode")); +const fs = __importStar(require("node:fs")); +const fsp = __importStar(require("node:fs/promises")); +const path = __importStar(require("node:path")); +const os = __importStar(require("node:os")); +const https = __importStar(require("node:https")); +const promises_1 = require("node:stream/promises"); +const adm_zip_1 = __importDefault(require("adm-zip")); +const tar_1 = __importDefault(require("tar")); +const which_1 = __importDefault(require("which")); +const BINARY_BASENAME = "codebook-lsp"; +const BINARY_FILENAME = process.platform === "win32" ? `${BINARY_BASENAME}.exe` : BINARY_BASENAME; +const VERSION_FILENAME = "codebook.version"; +const USER_AGENT = "codebook-vscode-extension"; +const MAX_REDIRECTS = 5; +class CodebookBinaryManager { + context; + logger; + binaryPath; + constructor(context, logger) { + this.context = context; + this.logger = logger; + } + async getBinaryPath(forceRedownload = false) { + if (this.binaryPath && !forceRedownload) { + return this.binaryPath; + } + const config = vscode.workspace.getConfiguration("codebook"); + const explicitPath = config.get("binaryPath")?.trim(); + if (explicitPath) { + await ensureExecutable(explicitPath); + this.logger.appendLine(`Using codebook binary from configuration: ${explicitPath}`); + this.binaryPath = explicitPath; + return explicitPath; + } + if (!forceRedownload) { + const systemBinary = await findOnPath(); + if (systemBinary) { + this.logger.appendLine(`Using codebook binary from PATH: ${systemBinary}`); + this.binaryPath = systemBinary; + return systemBinary; + } + } + const storageDir = await this.ensureStorageDir(); + const cached = await this.getCachedBinary(storageDir); + const enablePrerelease = config.get("enablePrerelease", false); + try { + const release = await fetchDesiredRelease(enablePrerelease); + const releaseVersion = extractReleaseVersion(release); + if (!forceRedownload && + cached && + cached.version === releaseVersion && + (await fileExists(cached.path))) { + this.logger.appendLine(`Using cached codebook binary version ${releaseVersion}`); + this.binaryPath = cached.path; + return cached.path; + } + const binaryPath = await this.downloadBinary(storageDir, release, releaseVersion); + this.binaryPath = binaryPath; + return binaryPath; + } + catch (error) { + if (cached && (await fileExists(cached.path))) { + this.logger.appendLine(`Failed to update Codebook (${error}). Falling back to cached binary at ${cached.path}`); + this.binaryPath = cached.path; + return cached.path; + } + throw error; + } + } + async invalidateCache() { + this.binaryPath = undefined; + } + async ensureStorageDir() { + const storageDir = this.context.globalStorageUri.fsPath; + await fsp.mkdir(storageDir, { recursive: true }); + return storageDir; + } + async getCachedBinary(storageDir) { + try { + const versionFile = path.join(storageDir, VERSION_FILENAME); + const version = (await fsp.readFile(versionFile, "utf8")).trim(); + if (!version) { + return undefined; + } + const binaryPath = path.join(storageDir, versionDirectoryName(version), BINARY_FILENAME); + if (await fileExists(binaryPath)) { + return { path: binaryPath, version }; + } + } + catch { + // ignore missing cache + } + return undefined; + } + async downloadBinary(storageDir, release, version) { + const assetInfo = resolveAssetName(); + const asset = release.assets.find((item) => item.name === assetInfo.filename); + if (!asset) { + throw new Error(`No compatible Codebook build (${assetInfo.descriptor}) was found in the ${version} release.`); + } + const versionDir = path.join(storageDir, versionDirectoryName(version)); + await fsp.mkdir(versionDir, { recursive: true }); + const tempFile = await fsp.mkdtemp(path.join(os.tmpdir(), "codebook-download-")); + const archivePath = path.join(tempFile, assetInfo.filename); + try { + await vscode.window.withProgress({ + location: vscode.ProgressLocation.Notification, + title: "Codebook", + }, async (progress) => { + progress.report({ message: `Downloading ${asset.name}` }); + await downloadFile(asset.browser_download_url, archivePath, (percent) => { + if (percent > 0) { + progress.report({ + message: `Downloading ${asset.name} (${Math.floor(percent * 100)}%)`, + }); + } + }); + progress.report({ message: "Extracting archive" }); + if (assetInfo.type === "zip") { + const zip = new adm_zip_1.default(archivePath); + zip.extractAllTo(versionDir, true); + } + else { + await tar_1.default.x({ cwd: versionDir, file: archivePath }); + } + }); + } + finally { + await cleanupTemp(tempFile); + } + const binaryPath = path.join(versionDir, BINARY_FILENAME); + if (!(await fileExists(binaryPath))) { + throw new Error(`Downloaded archive did not contain ${BINARY_FILENAME}`); + } + if (process.platform !== "win32") { + await fsp.chmod(binaryPath, 0o755); + } + await fsp.writeFile(path.join(storageDir, VERSION_FILENAME), version, "utf8"); + await this.cleanupOldVersions(storageDir, versionDirectoryName(version)); + this.logger.appendLine(`Installed codebook-lsp ${version} to ${binaryPath}`); + return binaryPath; + } + async cleanupOldVersions(storageDir, keepDirName) { + const entries = await fsp.readdir(storageDir, { withFileTypes: true }); + await Promise.all(entries.map(async (entry) => { + if (entry.isDirectory() && + entry.name.startsWith("codebook-lsp-") && + entry.name !== keepDirName) { + await fsp.rm(path.join(storageDir, entry.name), { + recursive: true, + force: true, + }); + } + })); + } +} +exports.CodebookBinaryManager = CodebookBinaryManager; +function versionDirectoryName(version) { + return `codebook-lsp-${version}`; +} +async function ensureExecutable(filePath) { + try { + await fsp.access(filePath, fs.constants.X_OK); + } + catch { + throw new Error(`The configured codebook binary is not executable: ${filePath}`); + } +} +async function findOnPath() { + try { + const result = await (0, which_1.default)(BINARY_BASENAME, { nothrow: true }); + return result ?? undefined; + } + catch { + return undefined; + } +} +async function fileExists(filePath) { + try { + await fsp.access(filePath, fs.constants.F_OK); + return true; + } + catch { + return false; + } +} +function resolveAssetName() { + let archPart; + if (process.arch === "x64") { + archPart = "x86_64"; + } + else if (process.arch === "arm64") { + archPart = "aarch64"; + } + else { + throw new Error(`Unsupported CPU architecture: ${process.arch}`); + } + let osPart; + let extension; + let type; + switch (process.platform) { + case "darwin": + osPart = "apple-darwin"; + extension = "tar.gz"; + type = "tar-gz"; + break; + case "linux": + osPart = "unknown-linux-musl"; + extension = "tar.gz"; + type = "tar-gz"; + break; + case "win32": + osPart = "pc-windows-msvc"; + extension = "zip"; + type = "zip"; + break; + default: + throw new Error(`Unsupported operating system: ${process.platform}`); + } + return { + filename: `codebook-lsp-${archPart}-${osPart}.${extension}`, + descriptor: `${archPart}-${osPart}`, + type, + }; +} +function extractReleaseVersion(release) { + return release.tag_name ?? release.name ?? String(release.id); +} +async function fetchDesiredRelease(includePrerelease) { + if (includePrerelease) { + const releases = await requestJson("https://api.github.com/repos/blopker/codebook/releases"); + const release = releases.find((item) => item.assets?.length); + if (!release) { + throw new Error("No releases with downloadable assets were found."); + } + return release; + } + return requestJson("https://api.github.com/repos/blopker/codebook/releases/latest"); +} +async function requestJson(url) { + const response = await httpRequest(url, { + headers: { + Accept: "application/vnd.github+json", + }, + }); + const chunks = []; + for await (const chunk of response) { + chunks.push(Buffer.from(chunk)); + } + return JSON.parse(Buffer.concat(chunks).toString("utf8")); +} +async function downloadFile(url, destination, progress) { + const response = await httpRequest(url, { + headers: { + Accept: "application/octet-stream", + }, + }); + const totalSize = Number(response.headers["content-length"]); + let downloaded = 0; + if (progress && Number.isFinite(totalSize)) { + response.on("data", (chunk) => { + downloaded += chunk.length; + if (totalSize > 0) { + progress(downloaded / totalSize); + } + }); + } + await (0, promises_1.pipeline)(response, fs.createWriteStream(destination)); +} +async function httpRequest(url, options = {}, redirectCount = 0) { + if (redirectCount > MAX_REDIRECTS) { + throw new Error("Too many redirects while downloading Codebook"); + } + return new Promise((resolve, reject) => { + const request = https.get(url, { + ...options, + headers: { + "User-Agent": USER_AGENT, + ...options.headers, + }, + }, (response) => { + const location = response.headers.location; + if (response.statusCode && + response.statusCode >= 300 && + response.statusCode < 400 && + location) { + response.resume(); + const redirectUrl = new URL(location, url).toString(); + resolve(httpRequest(redirectUrl, options, redirectCount + 1)); + return; + } + if (response.statusCode && + response.statusCode >= 200 && + response.statusCode < 300) { + resolve(response); + return; + } + response.resume(); + reject(new Error(`Request to ${url} failed with status ${response.statusCode}`)); + }); + request.setTimeout(30_000, () => { + request.destroy(new Error("Request timed out while contacting GitHub")); + }); + request.on("error", reject); + }); +} +async function cleanupTemp(dir) { + await fsp.rm(dir, { recursive: true, force: true }); +} +//# sourceMappingURL=binary.js.map \ No newline at end of file diff --git a/editors/vscode/dist/binary.js.map b/editors/vscode/dist/binary.js.map new file mode 100644 index 0000000..ae36211 --- /dev/null +++ b/editors/vscode/dist/binary.js.map @@ -0,0 +1 @@ +{"version":3,"file":"binary.js","sourceRoot":"","sources":["../src/binary.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AACjC,4CAA8B;AAC9B,sDAAwC;AACxC,gDAAkC;AAClC,4CAA8B;AAC9B,kDAAoC;AAEpC,mDAAgD;AAChD,sDAA6B;AAC7B,8CAAsB;AACtB,kDAA0B;AAE1B,MAAM,eAAe,GAAG,cAAc,CAAC;AACvC,MAAM,eAAe,GACnB,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,eAAe,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC;AAC5E,MAAM,gBAAgB,GAAG,kBAAkB,CAAC;AAC5C,MAAM,UAAU,GAAG,2BAA2B,CAAC;AAC/C,MAAM,aAAa,GAAG,CAAC,CAAC;AAiBxB,MAAa,qBAAqB;IAIb;IACA;IAJX,UAAU,CAAU;IAE5B,YACmB,OAAgC,EAChC,MAA4B;QAD5B,YAAO,GAAP,OAAO,CAAyB;QAChC,WAAM,GAAN,MAAM,CAAsB;IAC5C,CAAC;IAEJ,KAAK,CAAC,aAAa,CAAC,eAAe,GAAG,KAAK;QACzC,IAAI,IAAI,CAAC,UAAU,IAAI,CAAC,eAAe,EAAE,CAAC;YACxC,OAAO,IAAI,CAAC,UAAU,CAAC;QACzB,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;QAC7D,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAS,YAAY,CAAC,EAAE,IAAI,EAAE,CA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MAAM,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;AACL,CAAC;AAED,KAAK,UAAU,WAAW,CAAC,GAAW;IACpC,MAAM,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AACtD,CAAC"} \ No newline at end of file diff --git a/editors/vscode/dist/extension.js b/editors/vscode/dist/extension.js new file mode 100644 index 0000000..0fdcb50 --- /dev/null +++ b/editors/vscode/dist/extension.js @@ -0,0 +1,170 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.activate = activate; +exports.deactivate = deactivate; +const path = __importStar(require("node:path")); +const vscode = __importStar(require("vscode")); +const node_1 = require("vscode-languageclient/node"); +const binary_1 = require("./binary"); +const languages_1 = require("./languages"); +const DEFAULT_CLIENT_KEY = "__default__"; +let outputChannel; +let contextRef; +let binaryManager; +let refreshPromise = Promise.resolve(); +const clients = new Map(); +async function activate(context) { + contextRef = context; + outputChannel = vscode.window.createOutputChannel("Codebook"); + context.subscriptions.push(outputChannel); + binaryManager = new binary_1.CodebookBinaryManager(context, outputChannel); + context.subscriptions.push(vscode.commands.registerCommand("codebook.restart", async () => { + vscode.window.showInformationMessage("Restarting Codebook language server…"); + try { + await queueRefresh(); + vscode.window.showInformationMessage("Codebook language server restarted."); + } + catch (error) { + vscode.window.showErrorMessage(`Failed to restart Codebook: ${error}`); + } + })); + context.subscriptions.push(vscode.workspace.onDidChangeWorkspaceFolders(async () => { + await queueRefresh(); + })); + context.subscriptions.push(vscode.workspace.onDidChangeConfiguration(async (event) => { + const invalidateCache = event.affectsConfiguration("codebook.binaryPath") || + event.affectsConfiguration("codebook.enablePrerelease"); + const forceDownload = event.affectsConfiguration("codebook.enablePrerelease"); + if (event.affectsConfiguration("codebook.binaryPath") || + event.affectsConfiguration("codebook.enablePrerelease") || + event.affectsConfiguration("codebook.logLevel")) { + await queueRefresh({ forceDownload, invalidateCache }); + } + })); + await queueRefresh(); +} +async function queueRefresh(options = {}) { + refreshPromise = refreshPromise.then(() => refreshClients(options)); + await refreshPromise; +} +async function refreshClients(options = {}) { + await stopAllClients(); + if (options.invalidateCache) { + await binaryManager.invalidateCache(); + } + try { + const binaryPath = await binaryManager.getBinaryPath(options.forceDownload); + const folders = vscode.workspace.workspaceFolders; + if (!folders || folders.length === 0) { + await startClient(undefined, binaryPath); + } + else { + for (const folder of folders) { + await startClient(folder, binaryPath); + } + } + } + catch (error) { + outputChannel.appendLine(String(error)); + vscode.window.showErrorMessage(String(error)); + } +} +async function startClient(folder, binaryPath) { + const key = folder?.uri.toString() ?? DEFAULT_CLIENT_KEY; + if (clients.has(key)) { + return; + } + const root = determineRoot(folder); + const config = vscode.workspace.getConfiguration("codebook", folder); + const logLevel = config.get("logLevel", "info"); + const args = [`--root=${root}`, "serve"]; + outputChannel.appendLine(`Starting Codebook (${args.join(" ")}) for ${folder?.name ?? root}`); + const serverOptions = { + run: { + command: binaryPath, + args, + options: { + env: { + ...process.env, + RUST_LOG: logLevel, + }, + }, + }, + debug: { + command: binaryPath, + args, + options: { + env: { + ...process.env, + RUST_LOG: "debug", + }, + }, + }, + }; + const clientOptions = { + documentSelector: languages_1.DOCUMENT_SELECTOR, + diagnosticCollectionName: "codebook", + outputChannel, + workspaceFolder: folder, + }; + const client = new node_1.LanguageClient(`codebook-${key}`, "Codebook", serverOptions, clientOptions); + clients.set(key, client); + contextRef.subscriptions.push(client); + await client.start(); +} +function determineRoot(folder) { + if (folder) { + return folder.uri.fsPath; + } + const editor = vscode.window.activeTextEditor; + if (editor && editor.document.uri.scheme === "file") { + return path.dirname(editor.document.uri.fsPath); + } + const defaultWorkspace = vscode.workspace.workspaceFolders?.[0]; + if (defaultWorkspace) { + return defaultWorkspace.uri.fsPath; + } + return process.cwd(); +} +async function stopAllClients() { + const runningClients = Array.from(clients.values()); + clients.clear(); + await Promise.allSettled(runningClients.map((client) => client.stop())); +} +async function deactivate() { + await stopAllClients(); +} +//# sourceMappingURL=extension.js.map \ No newline at end of file diff --git a/editors/vscode/dist/extension.js.map b/editors/vscode/dist/extension.js.map new file mode 100644 index 0000000..809d2af --- /dev/null +++ b/editors/vscode/dist/extension.js.map @@ -0,0 +1 @@ +{"version":3,"file":"extension.js","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,4BAmDC;AAsHD,gCAEC;AA9LD,gDAAkC;AAClC,+CAAiC;AACjC,qDAIoC;AACpC,qCAAiD;AACjD,2CAAgD;AAEhD,MAAM,kBAAkB,GAAG,aAAa,CAAC;AAEzC,IAAI,aAAmC,CAAC;AACxC,IAAI,UAAmC,CAAC;AACxC,IAAI,aAAoC,CAAC;AACzC,IAAI,cAAc,GAAkB,OAAO,CAAC,OAAO,EAAE,CAAC;AAEtD,MAAM,OAAO,GA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/languages.js b/editors/vscode/dist/languages.js new file mode 100644 index 0000000..8ce6bee --- /dev/null +++ b/editors/vscode/dist/languages.js @@ -0,0 +1,32 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DOCUMENT_SELECTOR = exports.SUPPORTED_LANGUAGES = void 0; +exports.SUPPORTED_LANGUAGES = [ + "c", + "cpp", + "css", + "elixir", + "go", + "html", + "haskell", + "java", + "javascript", + "latex", + "lua", + "markdown", + "php", + "plaintext", + "python", + "ruby", + "rust", + "toml", + "typescript", + "typst", + "zig", + "csharp" +]; +exports.DOCUMENT_SELECTOR = exports.SUPPORTED_LANGUAGES.map((language) => ({ + scheme: "file", + language, +})); +//# sourceMappingURL=languages.js.map \ No newline at end of file diff --git a/editors/vscode/dist/languages.js.map b/editors/vscode/dist/languages.js.map new file mode 100644 index 0000000..d37a010 --- /dev/null +++ b/editors/vscode/dist/languages.js.map @@ -0,0 +1 @@ +{"version":3,"file":"languages.js","sourceRoot":"","sources":["../src/languages.ts"],"names":[],"mappings":";;;AAAa,QAAA,mBAAmB,GAAG;IACjC,GAAG;IACH,KAAK;IACL,KAAK;IACL,QAAQ;IACR,IAAI;IACJ,MAAM;IACN,SAAS;IACT,MAAM;IACN,YAAY;IACZ,OAAO;IACP,KAAK;IACL,UAAU;IACV,KAAK;IACL,WAAW;IACX,QAAQ;IACR,MAAM;IACN,MAAM;IACN,MAAM;IACN,YAAY;IACZ,OAAO;IACP,KAAK;IACL,QAAQ;CACA,CAAC;AAEE,QAAA,iBAAiB,GAAG,2BAAmB,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IACtE,MAAM,EAAE,MAAM;IACd,QAAQ;CACT,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/editors/vscode/package.json b/editors/vscode/package.json new file mode 100644 index 0000000..781c343 --- /dev/null +++ b/editors/vscode/package.json @@ -0,0 +1,99 @@ +{ + "name": "codebook-vscode", + "displayName": "Codebook", + "description": "Spell checking for code via the Codebook language server.", + "version": "0.0.1", + "publisher": "blopker", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/blopker/codebook" + }, + "bugs": { + "url": "https://github.com/blopker/codebook/issues" + }, + "homepage": "https://github.com/blopker/codebook", + "engines": { + "vscode": "^1.80.0" + }, + "categories": [ + "Linters", + "Other" + ], + "extensionKind": [ + "workspace" + ], + "activationEvents": [ + "onCommand:codebook.restart", + "onLanguage:c", + "onLanguage:cpp", + "onLanguage:css", + "onLanguage:elixir", + "onLanguage:go", + "onLanguage:html", + "onLanguage:haskell", + "onLanguage:java", + "onLanguage:javascript", + "onLanguage:latex", + "onLanguage:lua", + "onLanguage:markdown", + "onLanguage:php", + "onLanguage:plaintext", + "onLanguage:python", + "onLanguage:ruby", + "onLanguage:rust", + "onLanguage:toml", + "onLanguage:typescript", + "onLanguage:typst", + "onLanguage:zig", + "onLanguage:csharp" + ], + "main": "./dist/extension.js", + "scripts": { + "build": "tsc -p .", + "watch": "tsc -w -p ." + }, + "contributes": { + "commands": [ + { + "command": "codebook.restart", + "title": "Codebook: Restart Language Server" + } + ], + "configuration": { + "title": "Codebook", + "properties": { + "codebook.binaryPath": { + "type": "string", + "default": "", + "description": "Absolute path to an existing codebook-lsp binary. Leave empty to allow the extension to manage the download." + }, + "codebook.enablePrerelease": { + "type": "boolean", + "default": false, + "description": "Allow downloading pre-release builds when managing the language server binary." + }, + "codebook.logLevel": { + "type": "string", + "enum": ["error", "warn", "info", "debug"], + "default": "info", + "description": "Value assigned to the RUST_LOG environment variable for the language server." + } + } + } + }, + "dependencies": { + "@types/adm-zip": "^0.5.7", + "@types/tar": "^6.1.13", + "@types/which": "^3.0.4", + "adm-zip": "^0.5.12", + "tar": "^6.2.1", + "vscode-languageclient": "^9.0.1", + "which": "^4.0.0" + }, + "devDependencies": { + "@types/node": "^20.12.7", + "@types/vscode": "^1.80.0", + "typescript": "^5.4.0" + } +} diff --git a/editors/vscode/src/binary.ts b/editors/vscode/src/binary.ts new file mode 100644 index 0000000..4268d14 --- /dev/null +++ b/editors/vscode/src/binary.ts @@ -0,0 +1,447 @@ +import * as vscode from "vscode"; +import * as fs from "node:fs"; +import * as fsp from "node:fs/promises"; +import * as path from "node:path"; +import * as os from "node:os"; +import * as https from "node:https"; +import type { IncomingMessage } from "node:http"; +import { pipeline } from "node:stream/promises"; +import AdmZip from "adm-zip"; +import tar from "tar"; +import which from "which"; + +const BINARY_BASENAME = "codebook-lsp"; +const BINARY_FILENAME = + process.platform === "win32" ? `${BINARY_BASENAME}.exe` : BINARY_BASENAME; +const VERSION_FILENAME = "codebook.version"; +const USER_AGENT = "codebook-vscode-extension"; +const MAX_REDIRECTS = 5; + +interface GithubAsset { + name: string; + browser_download_url: string; +} + +interface GithubRelease { + id: number; + tag_name?: string; + name?: string; + prerelease?: boolean; + assets: GithubAsset[]; +} + +type ArchiveType = "tar-gz" | "zip"; + +export class CodebookBinaryManager { + private binaryPath?: string; + + constructor( + private readonly context: vscode.ExtensionContext, + private readonly logger: vscode.OutputChannel, + ) {} + + async getBinaryPath(forceRedownload = false): Promise { + if (this.binaryPath && !forceRedownload) { + return this.binaryPath; + } + + const config = vscode.workspace.getConfiguration("codebook"); + const explicitPath = config.get("binaryPath")?.trim(); + if (explicitPath) { + await ensureExecutable(explicitPath); + this.logger.appendLine( + `Using codebook binary from configuration: ${explicitPath}`, + ); + this.binaryPath = explicitPath; + return explicitPath; + } + + if (!forceRedownload) { + const systemBinary = await findOnPath(); + if (systemBinary) { + this.logger.appendLine( + `Using codebook binary from PATH: ${systemBinary}`, + ); + this.binaryPath = systemBinary; + return systemBinary; + } + } + + const storageDir = await this.ensureStorageDir(); + const cached = await this.getCachedBinary(storageDir); + const enablePrerelease = config.get("enablePrerelease", false); + + try { + const release = await fetchDesiredRelease(enablePrerelease); + const releaseVersion = extractReleaseVersion(release); + + if ( + !forceRedownload && + cached && + cached.version === releaseVersion && + (await fileExists(cached.path)) + ) { + this.logger.appendLine( + `Using cached codebook binary version ${releaseVersion}`, + ); + this.binaryPath = cached.path; + return cached.path; + } + + const binaryPath = await this.downloadBinary( + storageDir, + release, + releaseVersion, + ); + this.binaryPath = binaryPath; + return binaryPath; + } catch (error) { + if (cached && (await fileExists(cached.path))) { + this.logger.appendLine( + `Failed to update Codebook (${error}). Falling back to cached binary at ${cached.path}`, + ); + this.binaryPath = cached.path; + return cached.path; + } + throw error; + } + } + + async invalidateCache(): Promise { + this.binaryPath = undefined; + } + + private async ensureStorageDir(): Promise { + const storageDir = this.context.globalStorageUri.fsPath; + await fsp.mkdir(storageDir, { recursive: true }); + return storageDir; + } + + private async getCachedBinary( + storageDir: string, + ): Promise<{ path: string; version: string } | undefined> { + try { + const versionFile = path.join(storageDir, VERSION_FILENAME); + const version = (await fsp.readFile(versionFile, "utf8")).trim(); + if (!version) { + return undefined; + } + + const binaryPath = path.join( + storageDir, + versionDirectoryName(version), + BINARY_FILENAME, + ); + if (await fileExists(binaryPath)) { + return { path: binaryPath, version }; + } + } catch { + // ignore missing cache + } + + return undefined; + } + + private async downloadBinary( + storageDir: string, + release: GithubRelease, + version: string, + ): Promise { + const assetInfo = resolveAssetName(); + const asset = release.assets.find( + (item) => item.name === assetInfo.filename, + ); + if (!asset) { + throw new Error( + `No compatible Codebook build (${assetInfo.descriptor}) was found in the ${version} release.`, + ); + } + + const versionDir = path.join(storageDir, versionDirectoryName(version)); + await fsp.mkdir(versionDir, { recursive: true }); + + const tempFile = await fsp.mkdtemp( + path.join(os.tmpdir(), "codebook-download-"), + ); + const archivePath = path.join(tempFile, assetInfo.filename); + + try { + await vscode.window.withProgress( + { + location: vscode.ProgressLocation.Notification, + title: "Codebook", + }, + async (progress) => { + progress.report({ message: `Downloading ${asset.name}` }); + await downloadFile( + asset.browser_download_url, + archivePath, + (percent) => { + if (percent > 0) { + progress.report({ + message: `Downloading ${asset.name} (${Math.floor(percent * 100)}%)`, + }); + } + }, + ); + + progress.report({ message: "Extracting archive" }); + if (assetInfo.type === "zip") { + const zip = new AdmZip(archivePath); + zip.extractAllTo(versionDir, true); + } else { + await tar.x({ cwd: versionDir, file: archivePath }); + } + }, + ); + } finally { + await cleanupTemp(tempFile); + } + + const binaryPath = path.join(versionDir, BINARY_FILENAME); + if (!(await fileExists(binaryPath))) { + throw new Error(`Downloaded archive did not contain ${BINARY_FILENAME}`); + } + + if (process.platform !== "win32") { + await fsp.chmod(binaryPath, 0o755); + } + + await fsp.writeFile( + path.join(storageDir, VERSION_FILENAME), + version, + "utf8", + ); + await this.cleanupOldVersions(storageDir, versionDirectoryName(version)); + + this.logger.appendLine( + `Installed codebook-lsp ${version} to ${binaryPath}`, + ); + return binaryPath; + } + + private async cleanupOldVersions( + storageDir: string, + keepDirName: string, + ): Promise { + const entries = await fsp.readdir(storageDir, { withFileTypes: true }); + await Promise.all( + entries.map(async (entry) => { + if ( + entry.isDirectory() && + entry.name.startsWith("codebook-lsp-") && + entry.name !== keepDirName + ) { + await fsp.rm(path.join(storageDir, entry.name), { + recursive: true, + force: true, + }); + } + }), + ); + } +} + +function versionDirectoryName(version: string): string { + return `codebook-lsp-${version}`; +} + +async function ensureExecutable(filePath: string): Promise { + try { + await fsp.access(filePath, fs.constants.X_OK); + } catch { + throw new Error( + `The configured codebook binary is not executable: ${filePath}`, + ); + } +} + +async function findOnPath(): Promise { + try { + const result = await which(BINARY_BASENAME, { nothrow: true }); + return result ?? undefined; + } catch { + return undefined; + } +} + +async function fileExists(filePath: string): Promise { + try { + await fsp.access(filePath, fs.constants.F_OK); + return true; + } catch { + return false; + } +} + +function resolveAssetName(): { + filename: string; + descriptor: string; + type: ArchiveType; +} { + let archPart: string; + if (process.arch === "x64") { + archPart = "x86_64"; + } else if (process.arch === "arm64") { + archPart = "aarch64"; + } else { + throw new Error(`Unsupported CPU architecture: ${process.arch}`); + } + + let osPart: string; + let extension: string; + let type: ArchiveType; + + switch (process.platform) { + case "darwin": + osPart = "apple-darwin"; + extension = "tar.gz"; + type = "tar-gz"; + break; + case "linux": + osPart = "unknown-linux-musl"; + extension = "tar.gz"; + type = "tar-gz"; + break; + case "win32": + osPart = "pc-windows-msvc"; + extension = "zip"; + type = "zip"; + break; + default: + throw new Error(`Unsupported operating system: ${process.platform}`); + } + + return { + filename: `codebook-lsp-${archPart}-${osPart}.${extension}`, + descriptor: `${archPart}-${osPart}`, + type, + }; +} + +function extractReleaseVersion(release: GithubRelease): string { + return release.tag_name ?? release.name ?? String(release.id); +} + +async function fetchDesiredRelease( + includePrerelease: boolean, +): Promise { + if (includePrerelease) { + const releases = await requestJson( + "https://api.github.com/repos/blopker/codebook/releases", + ); + const release = releases.find((item) => item.assets?.length); + if (!release) { + throw new Error("No releases with downloadable assets were found."); + } + return release; + } + + return requestJson( + "https://api.github.com/repos/blopker/codebook/releases/latest", + ); +} + +async function requestJson(url: string): Promise { + const response = await httpRequest(url, { + headers: { + Accept: "application/vnd.github+json", + }, + }); + + const chunks: Buffer[] = []; + for await (const chunk of response) { + chunks.push(Buffer.from(chunk)); + } + + return JSON.parse(Buffer.concat(chunks).toString("utf8")) as T; +} + +async function downloadFile( + url: string, + destination: string, + progress?: (percent: number) => void, +): Promise { + const response = await httpRequest(url, { + headers: { + Accept: "application/octet-stream", + }, + }); + + const totalSize = Number(response.headers["content-length"]); + let downloaded = 0; + + if (progress && Number.isFinite(totalSize)) { + response.on("data", (chunk: Buffer) => { + downloaded += chunk.length; + if (totalSize > 0) { + progress(downloaded / totalSize); + } + }); + } + + await pipeline(response, fs.createWriteStream(destination)); +} + +async function httpRequest( + url: string, + options: https.RequestOptions = {}, + redirectCount = 0, +): Promise { + if (redirectCount > MAX_REDIRECTS) { + throw new Error("Too many redirects while downloading Codebook"); + } + + return new Promise((resolve, reject) => { + const request = https.get( + url, + { + ...options, + headers: { + "User-Agent": USER_AGENT, + ...options.headers, + }, + }, + (response) => { + const location = response.headers.location; + if ( + response.statusCode && + response.statusCode >= 300 && + response.statusCode < 400 && + location + ) { + response.resume(); + const redirectUrl = new URL(location, url).toString(); + resolve(httpRequest(redirectUrl, options, redirectCount + 1)); + return; + } + + if ( + response.statusCode && + response.statusCode >= 200 && + response.statusCode < 300 + ) { + resolve(response); + return; + } + + response.resume(); + reject( + new Error( + `Request to ${url} failed with status ${response.statusCode}`, + ), + ); + }, + ); + + request.setTimeout(30_000, () => { + request.destroy(new Error("Request timed out while contacting GitHub")); + }); + + request.on("error", reject); + }); +} + +async function cleanupTemp(dir: string): Promise { + await fsp.rm(dir, { recursive: true, force: true }); +} diff --git a/editors/vscode/src/extension.ts b/editors/vscode/src/extension.ts new file mode 100644 index 0000000..6335791 --- /dev/null +++ b/editors/vscode/src/extension.ts @@ -0,0 +1,191 @@ +import * as path from "node:path"; +import * as vscode from "vscode"; +import { + LanguageClient, + LanguageClientOptions, + ServerOptions, +} from "vscode-languageclient/node"; +import { CodebookBinaryManager } from "./binary"; +import { DOCUMENT_SELECTOR } from "./languages"; + +const DEFAULT_CLIENT_KEY = "__default__"; + +let outputChannel: vscode.OutputChannel; +let contextRef: vscode.ExtensionContext; +let binaryManager: CodebookBinaryManager; +let refreshPromise: Promise = Promise.resolve(); + +const clients = new Map(); + +export async function activate( + context: vscode.ExtensionContext, +): Promise { + contextRef = context; + outputChannel = vscode.window.createOutputChannel("Codebook"); + context.subscriptions.push(outputChannel); + + binaryManager = new CodebookBinaryManager(context, outputChannel); + + context.subscriptions.push( + vscode.commands.registerCommand("codebook.restart", async () => { + vscode.window.showInformationMessage( + "Restarting Codebook language server…", + ); + try { + await queueRefresh(); + vscode.window.showInformationMessage( + "Codebook language server restarted.", + ); + } catch (error) { + vscode.window.showErrorMessage(`Failed to restart Codebook: ${error}`); + } + }), + ); + + context.subscriptions.push( + vscode.workspace.onDidChangeWorkspaceFolders(async () => { + await queueRefresh(); + }), + ); + + context.subscriptions.push( + vscode.workspace.onDidChangeConfiguration(async (event) => { + const invalidateCache = + event.affectsConfiguration("codebook.binaryPath") || + event.affectsConfiguration("codebook.enablePrerelease"); + const forceDownload = event.affectsConfiguration( + "codebook.enablePrerelease", + ); + + if ( + event.affectsConfiguration("codebook.binaryPath") || + event.affectsConfiguration("codebook.enablePrerelease") || + event.affectsConfiguration("codebook.logLevel") + ) { + await queueRefresh({ forceDownload, invalidateCache }); + } + }), + ); + + await queueRefresh(); +} + +type RefreshOptions = { + forceDownload?: boolean; + invalidateCache?: boolean; +}; + +async function queueRefresh(options: RefreshOptions = {}): Promise { + refreshPromise = refreshPromise.then(() => refreshClients(options)); + await refreshPromise; +} + +async function refreshClients(options: RefreshOptions = {}): Promise { + await stopAllClients(); + + if (options.invalidateCache) { + await binaryManager.invalidateCache(); + } + + try { + const binaryPath = await binaryManager.getBinaryPath(options.forceDownload); + const folders = vscode.workspace.workspaceFolders; + if (!folders || folders.length === 0) { + await startClient(undefined, binaryPath); + } else { + for (const folder of folders) { + await startClient(folder, binaryPath); + } + } + } catch (error) { + outputChannel.appendLine(String(error)); + vscode.window.showErrorMessage(String(error)); + } +} + +async function startClient( + folder: vscode.WorkspaceFolder | undefined, + binaryPath: string, +): Promise { + const key = folder?.uri.toString() ?? DEFAULT_CLIENT_KEY; + if (clients.has(key)) { + return; + } + + const root = determineRoot(folder); + const config = vscode.workspace.getConfiguration("codebook", folder); + const logLevel = config.get("logLevel", "info"); + + const args = [`--root=${root}`, "serve"]; + outputChannel.appendLine( + `Starting Codebook (${args.join(" ")}) for ${folder?.name ?? root}`, + ); + + const serverOptions: ServerOptions = { + run: { + command: binaryPath, + args, + options: { + env: { + ...process.env, + RUST_LOG: logLevel, + }, + }, + }, + debug: { + command: binaryPath, + args, + options: { + env: { + ...process.env, + RUST_LOG: "debug", + }, + }, + }, + }; + + const clientOptions: LanguageClientOptions = { + documentSelector: DOCUMENT_SELECTOR, + diagnosticCollectionName: "codebook", + outputChannel, + workspaceFolder: folder, + }; + + const client = new LanguageClient( + `codebook-${key}`, + "Codebook", + serverOptions, + clientOptions, + ); + clients.set(key, client); + contextRef.subscriptions.push(client); + await client.start(); +} + +function determineRoot(folder: vscode.WorkspaceFolder | undefined): string { + if (folder) { + return folder.uri.fsPath; + } + + const editor = vscode.window.activeTextEditor; + if (editor && editor.document.uri.scheme === "file") { + return path.dirname(editor.document.uri.fsPath); + } + + const defaultWorkspace = vscode.workspace.workspaceFolders?.[0]; + if (defaultWorkspace) { + return defaultWorkspace.uri.fsPath; + } + + return process.cwd(); +} + +async function stopAllClients(): Promise { + const runningClients = Array.from(clients.values()); + clients.clear(); + await Promise.allSettled(runningClients.map((client) => client.stop())); +} + +export async function deactivate(): Promise { + await stopAllClients(); +} diff --git a/editors/vscode/src/languages.ts b/editors/vscode/src/languages.ts new file mode 100644 index 0000000..2ba31b4 --- /dev/null +++ b/editors/vscode/src/languages.ts @@ -0,0 +1,29 @@ +export const SUPPORTED_LANGUAGES = [ + "c", + "cpp", + "css", + "elixir", + "go", + "html", + "haskell", + "java", + "javascript", + "latex", + "lua", + "markdown", + "php", + "plaintext", + "python", + "ruby", + "rust", + "toml", + "typescript", + "typst", + "zig", + "csharp" +] as const; + +export const DOCUMENT_SELECTOR = SUPPORTED_LANGUAGES.map((language) => ({ + scheme: "file", + language, +})); diff --git a/editors/vscode/tsconfig.json b/editors/vscode/tsconfig.json new file mode 100644 index 0000000..22f9a9f --- /dev/null +++ b/editors/vscode/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "target": "ES2024", + "module": "commonjs", + "lib": ["ES2024"], + "strict": true, + "sourceMap": true, + "rootDir": "src", + "outDir": "dist", + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "types": ["node", "vscode"] + }, + "include": ["src"], + "exclude": ["dist", "node_modules"] +} From 11d6c8aa0760d08e93d8c4b983fafb56520e87e4 Mon Sep 17 00:00:00 2001 From: Bo Lopker Date: Tue, 18 Nov 2025 21:14:17 -0800 Subject: [PATCH 3/5] No dist --- editors/vscode/.gitignore | 0 editors/vscode/dist/binary.js | 350 --------------------------- editors/vscode/dist/binary.js.map | 1 - editors/vscode/dist/extension.js | 170 ------------- editors/vscode/dist/extension.js.map | 1 - editors/vscode/dist/languages.js | 32 --- editors/vscode/dist/languages.js.map | 1 - 7 files changed, 555 deletions(-) create mode 100644 editors/vscode/.gitignore delete mode 100644 editors/vscode/dist/binary.js delete mode 100644 editors/vscode/dist/binary.js.map delete mode 100644 editors/vscode/dist/extension.js delete mode 100644 editors/vscode/dist/extension.js.map delete mode 100644 editors/vscode/dist/languages.js delete mode 100644 editors/vscode/dist/languages.js.map diff --git a/editors/vscode/.gitignore b/editors/vscode/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/editors/vscode/dist/binary.js b/editors/vscode/dist/binary.js deleted file mode 100644 index 7491f9c..0000000 --- a/editors/vscode/dist/binary.js +++ /dev/null @@ -1,350 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || (function () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.CodebookBinaryManager = void 0; -const vscode = __importStar(require("vscode")); -const fs = __importStar(require("node:fs")); -const fsp = __importStar(require("node:fs/promises")); -const path = __importStar(require("node:path")); -const os = __importStar(require("node:os")); -const https = __importStar(require("node:https")); -const promises_1 = require("node:stream/promises"); -const adm_zip_1 = __importDefault(require("adm-zip")); -const tar_1 = __importDefault(require("tar")); -const which_1 = __importDefault(require("which")); -const BINARY_BASENAME = "codebook-lsp"; -const BINARY_FILENAME = process.platform === "win32" ? `${BINARY_BASENAME}.exe` : BINARY_BASENAME; -const VERSION_FILENAME = "codebook.version"; -const USER_AGENT = "codebook-vscode-extension"; -const MAX_REDIRECTS = 5; -class CodebookBinaryManager { - context; - logger; - binaryPath; - constructor(context, logger) { - this.context = context; - this.logger = logger; - } - async getBinaryPath(forceRedownload = false) { - if (this.binaryPath && !forceRedownload) { - return this.binaryPath; - } - const config = vscode.workspace.getConfiguration("codebook"); - const explicitPath = config.get("binaryPath")?.trim(); - if (explicitPath) { - await ensureExecutable(explicitPath); - this.logger.appendLine(`Using codebook binary from configuration: ${explicitPath}`); - this.binaryPath = explicitPath; - return explicitPath; - } - if (!forceRedownload) { - const systemBinary = await findOnPath(); - if (systemBinary) { - this.logger.appendLine(`Using codebook binary from PATH: ${systemBinary}`); - this.binaryPath = systemBinary; - return systemBinary; - } - } - const storageDir = await this.ensureStorageDir(); - const cached = await this.getCachedBinary(storageDir); - const enablePrerelease = config.get("enablePrerelease", false); - try { - const release = await fetchDesiredRelease(enablePrerelease); - const releaseVersion = extractReleaseVersion(release); - if (!forceRedownload && - cached && - cached.version === releaseVersion && - (await fileExists(cached.path))) { - this.logger.appendLine(`Using cached codebook binary version ${releaseVersion}`); - this.binaryPath = cached.path; - return cached.path; - } - const binaryPath = await this.downloadBinary(storageDir, release, releaseVersion); - this.binaryPath = binaryPath; - return binaryPath; - } - catch (error) { - if (cached && (await fileExists(cached.path))) { - this.logger.appendLine(`Failed to update Codebook (${error}). Falling back to cached binary at ${cached.path}`); - this.binaryPath = cached.path; - return cached.path; - } - throw error; - } - } - async invalidateCache() { - this.binaryPath = undefined; - } - async ensureStorageDir() { - const storageDir = this.context.globalStorageUri.fsPath; - await fsp.mkdir(storageDir, { recursive: true }); - return storageDir; - } - async getCachedBinary(storageDir) { - try { - const versionFile = path.join(storageDir, VERSION_FILENAME); - const version = (await fsp.readFile(versionFile, "utf8")).trim(); - if (!version) { - return undefined; - } - const binaryPath = path.join(storageDir, versionDirectoryName(version), BINARY_FILENAME); - if (await fileExists(binaryPath)) { - return { path: binaryPath, version }; - } - } - catch { - // ignore missing cache - } - return undefined; - } - async downloadBinary(storageDir, release, version) { - const assetInfo = resolveAssetName(); - const asset = release.assets.find((item) => item.name === assetInfo.filename); - if (!asset) { - throw new Error(`No compatible Codebook build (${assetInfo.descriptor}) was found in the ${version} release.`); - } - const versionDir = path.join(storageDir, versionDirectoryName(version)); - await fsp.mkdir(versionDir, { recursive: true }); - const tempFile = await fsp.mkdtemp(path.join(os.tmpdir(), "codebook-download-")); - const archivePath = path.join(tempFile, assetInfo.filename); - try { - await vscode.window.withProgress({ - location: vscode.ProgressLocation.Notification, - title: "Codebook", - }, async (progress) => { - progress.report({ message: `Downloading ${asset.name}` }); - await downloadFile(asset.browser_download_url, archivePath, (percent) => { - if (percent > 0) { - progress.report({ - message: `Downloading ${asset.name} (${Math.floor(percent * 100)}%)`, - }); - } - }); - progress.report({ message: "Extracting archive" }); - if (assetInfo.type === "zip") { - const zip = new adm_zip_1.default(archivePath); - zip.extractAllTo(versionDir, true); - } - else { - await tar_1.default.x({ cwd: versionDir, file: archivePath }); - } - }); - } - finally { - await cleanupTemp(tempFile); - } - const binaryPath = path.join(versionDir, BINARY_FILENAME); - if (!(await fileExists(binaryPath))) { - throw new Error(`Downloaded archive did not contain ${BINARY_FILENAME}`); - } - if (process.platform !== "win32") { - await fsp.chmod(binaryPath, 0o755); - } - await fsp.writeFile(path.join(storageDir, VERSION_FILENAME), version, "utf8"); - await this.cleanupOldVersions(storageDir, versionDirectoryName(version)); - this.logger.appendLine(`Installed codebook-lsp ${version} to ${binaryPath}`); - return binaryPath; - } - async cleanupOldVersions(storageDir, keepDirName) { - const entries = await fsp.readdir(storageDir, { withFileTypes: true }); - await Promise.all(entries.map(async (entry) => { - if (entry.isDirectory() && - entry.name.startsWith("codebook-lsp-") && - entry.name !== keepDirName) { - await fsp.rm(path.join(storageDir, entry.name), { - recursive: true, - force: true, - }); - } - })); - } -} -exports.CodebookBinaryManager = CodebookBinaryManager; -function versionDirectoryName(version) { - return `codebook-lsp-${version}`; -} -async function ensureExecutable(filePath) { - try { - await fsp.access(filePath, fs.constants.X_OK); - } - catch { - throw new Error(`The configured codebook binary is not executable: ${filePath}`); - } -} -async function findOnPath() { - try { - const result = await (0, which_1.default)(BINARY_BASENAME, { nothrow: true }); - return result ?? undefined; - } - catch { - return undefined; - } -} -async function fileExists(filePath) { - try { - await fsp.access(filePath, fs.constants.F_OK); - return true; - } - catch { - return false; - } -} -function resolveAssetName() { - let archPart; - if (process.arch === "x64") { - archPart = "x86_64"; - } - else if (process.arch === "arm64") { - archPart = "aarch64"; - } - else { - throw new Error(`Unsupported CPU architecture: ${process.arch}`); - } - let osPart; - let extension; - let type; - switch (process.platform) { - case "darwin": - osPart = "apple-darwin"; - extension = "tar.gz"; - type = "tar-gz"; - break; - case "linux": - osPart = "unknown-linux-musl"; - extension = "tar.gz"; - type = "tar-gz"; - break; - case "win32": - osPart = "pc-windows-msvc"; - extension = "zip"; - type = "zip"; - break; - default: - throw new Error(`Unsupported operating system: ${process.platform}`); - } - return { - filename: `codebook-lsp-${archPart}-${osPart}.${extension}`, - descriptor: `${archPart}-${osPart}`, - type, - }; -} -function extractReleaseVersion(release) { - return release.tag_name ?? release.name ?? String(release.id); -} -async function fetchDesiredRelease(includePrerelease) { - if (includePrerelease) { - const releases = await requestJson("https://api.github.com/repos/blopker/codebook/releases"); - const release = releases.find((item) => item.assets?.length); - if (!release) { - throw new Error("No releases with downloadable assets were found."); - } - return release; - } - return requestJson("https://api.github.com/repos/blopker/codebook/releases/latest"); -} -async function requestJson(url) { - const response = await httpRequest(url, { - headers: { - Accept: "application/vnd.github+json", - }, - }); - const chunks = []; - for await (const chunk of response) { - chunks.push(Buffer.from(chunk)); - } - return JSON.parse(Buffer.concat(chunks).toString("utf8")); -} -async function downloadFile(url, destination, progress) { - const response = await httpRequest(url, { - headers: { - Accept: "application/octet-stream", - }, - }); - const totalSize = Number(response.headers["content-length"]); - let downloaded = 0; - if (progress && Number.isFinite(totalSize)) { - response.on("data", (chunk) => { - downloaded += chunk.length; - if (totalSize > 0) { - progress(downloaded / totalSize); - } - }); - } - await (0, promises_1.pipeline)(response, fs.createWriteStream(destination)); -} -async function httpRequest(url, options = {}, redirectCount = 0) { - if (redirectCount > MAX_REDIRECTS) { - throw new Error("Too many redirects while downloading Codebook"); - } - return new Promise((resolve, reject) => { - const request = https.get(url, { - ...options, - headers: { - "User-Agent": USER_AGENT, - ...options.headers, - }, - }, (response) => { - const location = response.headers.location; - if (response.statusCode && - response.statusCode >= 300 && - response.statusCode < 400 && - location) { - response.resume(); - const redirectUrl = new URL(location, url).toString(); - resolve(httpRequest(redirectUrl, options, redirectCount + 1)); - return; - } - if (response.statusCode && - response.statusCode >= 200 && - response.statusCode < 300) { - resolve(response); - return; - } - response.resume(); - reject(new Error(`Request to ${url} failed with status ${response.statusCode}`)); - }); - request.setTimeout(30_000, () => { - request.destroy(new Error("Request timed out while contacting GitHub")); - }); - request.on("error", reject); - }); -} -async function cleanupTemp(dir) { - await fsp.rm(dir, { recursive: true, force: true }); -} -//# sourceMappingURL=binary.js.map \ No newline at end of file diff --git a/editors/vscode/dist/binary.js.map b/editors/vscode/dist/binary.js.map deleted file mode 100644 index ae36211..0000000 --- a/editors/vscode/dist/binary.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"binary.js","sourceRoot":"","sources":["../src/binary.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;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a/editors/vscode/dist/extension.js +++ /dev/null @@ -1,170 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || (function () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -exports.activate = activate; -exports.deactivate = deactivate; -const path = __importStar(require("node:path")); -const vscode = __importStar(require("vscode")); -const node_1 = require("vscode-languageclient/node"); -const binary_1 = require("./binary"); -const languages_1 = require("./languages"); -const DEFAULT_CLIENT_KEY = "__default__"; -let outputChannel; -let contextRef; -let binaryManager; -let refreshPromise = Promise.resolve(); -const clients = new Map(); -async function activate(context) { - contextRef = context; - outputChannel = vscode.window.createOutputChannel("Codebook"); - context.subscriptions.push(outputChannel); - binaryManager = new binary_1.CodebookBinaryManager(context, outputChannel); - context.subscriptions.push(vscode.commands.registerCommand("codebook.restart", async () => { - vscode.window.showInformationMessage("Restarting Codebook language server…"); - try { - await queueRefresh(); - vscode.window.showInformationMessage("Codebook language server restarted."); - } - catch (error) { - vscode.window.showErrorMessage(`Failed to restart Codebook: ${error}`); - } - })); - context.subscriptions.push(vscode.workspace.onDidChangeWorkspaceFolders(async () => { - await queueRefresh(); - })); - context.subscriptions.push(vscode.workspace.onDidChangeConfiguration(async (event) => { - const invalidateCache = event.affectsConfiguration("codebook.binaryPath") || - event.affectsConfiguration("codebook.enablePrerelease"); - const forceDownload = event.affectsConfiguration("codebook.enablePrerelease"); - if (event.affectsConfiguration("codebook.binaryPath") || - event.affectsConfiguration("codebook.enablePrerelease") || - event.affectsConfiguration("codebook.logLevel")) { - await queueRefresh({ forceDownload, invalidateCache }); - } - })); - await queueRefresh(); -} -async function queueRefresh(options = {}) { - refreshPromise = refreshPromise.then(() => refreshClients(options)); - await refreshPromise; -} -async function refreshClients(options = {}) { - await stopAllClients(); - if (options.invalidateCache) { - await binaryManager.invalidateCache(); - } - try { - const binaryPath = await binaryManager.getBinaryPath(options.forceDownload); - const folders = vscode.workspace.workspaceFolders; - if (!folders || folders.length === 0) { - await startClient(undefined, binaryPath); - } - else { - for (const folder of folders) { - await startClient(folder, binaryPath); - } - } - } - catch (error) { - outputChannel.appendLine(String(error)); - vscode.window.showErrorMessage(String(error)); - } -} -async function startClient(folder, binaryPath) { - const key = folder?.uri.toString() ?? DEFAULT_CLIENT_KEY; - if (clients.has(key)) { - return; - } - const root = determineRoot(folder); - const config = vscode.workspace.getConfiguration("codebook", folder); - const logLevel = config.get("logLevel", "info"); - const args = [`--root=${root}`, "serve"]; - outputChannel.appendLine(`Starting Codebook (${args.join(" ")}) for ${folder?.name ?? root}`); - const serverOptions = { - run: { - command: binaryPath, - args, - options: { - env: { - ...process.env, - RUST_LOG: logLevel, - }, - }, - }, - debug: { - command: binaryPath, - args, - options: { - env: { - ...process.env, - RUST_LOG: "debug", - }, - }, - }, - }; - const clientOptions = { - documentSelector: languages_1.DOCUMENT_SELECTOR, - diagnosticCollectionName: "codebook", - outputChannel, - workspaceFolder: folder, - }; - const client = new node_1.LanguageClient(`codebook-${key}`, "Codebook", serverOptions, clientOptions); - clients.set(key, client); - contextRef.subscriptions.push(client); - await client.start(); -} -function determineRoot(folder) { - if (folder) { - return folder.uri.fsPath; - } - const editor = vscode.window.activeTextEditor; - if (editor && editor.document.uri.scheme === "file") { - return path.dirname(editor.document.uri.fsPath); - } - const defaultWorkspace = vscode.workspace.workspaceFolders?.[0]; - if (defaultWorkspace) { - return defaultWorkspace.uri.fsPath; - } - return process.cwd(); -} -async function stopAllClients() { - const runningClients = Array.from(clients.values()); - clients.clear(); - await Promise.allSettled(runningClients.map((client) => client.stop())); -} -async function deactivate() { - await stopAllClients(); -} -//# sourceMappingURL=extension.js.map \ No newline at end of file diff --git a/editors/vscode/dist/extension.js.map b/editors/vscode/dist/extension.js.map deleted file mode 100644 index 809d2af..0000000 --- a/editors/vscode/dist/extension.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"extension.js","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,4BAmDC;AAsHD,gCAEC;AA9LD,gDAAkC;AAClC,+CAAiC;AACjC,qDAIoC;AACpC,qCAAiD;AACjD,2CAAgD;AAEhD,MAAM,kBAAkB,GAAG,aAAa,CAAC;AAEzC,IAAI,aAAmC,CAAC;AACxC,IAAI,UAAmC,CAAC;AACxC,IAAI,aAAoC,CAAC;AACzC,IAAI,cAAc,GAAkB,OAAO,CAAC,OAAO,EAAE,CAAC;AAEtD,MAAM,OAAO,GAAG,IAAI,GAAG,EAA0B,CAAC;AAE3C,KAAK,UAAU,QAAQ,CAC5B,OAAgC;IAEhC,UAAU,GAAG,OAAO,CAAC;IACrB,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC;IAC9D,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAE1C,aAAa,GAAG,IAAI,8BAAqB,CAAC,OAAO,EAAE,aAAa,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,OAAO,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC;IAC3B,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC;IAC9C,IAAI,MAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,KAAK,MAAM,EAAE,CAAC;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAClD,CAAC;IAED,MAAM,gBAAgB,GAAG,MAAM,CAAC,SAAS,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC,CAAC;IAChE,IAAI,gBAAgB,EAAE,CAAC;QACrB,OAAO,gBAAgB,CAAC,GAAG,CAAC,MAAM,CAAC;IACrC,CAAC;IAED,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC;AACvB,CAAC;AAED,KAAK,UAAU,cAAc;IAC3B,MAAM,cAAc,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACpD,OAAO,CAAC,KAAK,EAAE,CAAC;IAChB,MAAM,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;AAC1E,CAAC;AAEM,KAAK,UAAU,UAAU;IAC9B,MAAM,cAAc,EAAE,CAAC;AACzB,CAAC"} \ No newline at end of file diff --git a/editors/vscode/dist/languages.js b/editors/vscode/dist/languages.js deleted file mode 100644 index 8ce6bee..0000000 --- a/editors/vscode/dist/languages.js +++ /dev/null @@ -1,32 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.DOCUMENT_SELECTOR = exports.SUPPORTED_LANGUAGES = void 0; -exports.SUPPORTED_LANGUAGES = [ - "c", - "cpp", - "css", - "elixir", - "go", - "html", - "haskell", - "java", - "javascript", - "latex", - "lua", - "markdown", - "php", - "plaintext", - "python", - "ruby", - "rust", - "toml", - "typescript", - "typst", - "zig", - "csharp" -]; -exports.DOCUMENT_SELECTOR = exports.SUPPORTED_LANGUAGES.map((language) => ({ - scheme: "file", - language, -})); -//# sourceMappingURL=languages.js.map \ No newline at end of file diff --git a/editors/vscode/dist/languages.js.map b/editors/vscode/dist/languages.js.map deleted file mode 100644 index d37a010..0000000 --- a/editors/vscode/dist/languages.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"languages.js","sourceRoot":"","sources":["../src/languages.ts"],"names":[],"mappings":";;;AAAa,QAAA,mBAAmB,GAAG;IACjC,GAAG;IACH,KAAK;IACL,KAAK;IACL,QAAQ;IACR,IAAI;IACJ,MAAM;IACN,SAAS;IACT,MAAM;IACN,YAAY;IACZ,OAAO;IACP,KAAK;IACL,UAAU;IACV,KAAK;IACL,WAAW;IACX,QAAQ;IACR,MAAM;IACN,MAAM;IACN,MAAM;IACN,YAAY;IACZ,OAAO;IACP,KAAK;IACL,QAAQ;CACA,CAAC;AAEE,QAAA,iBAAiB,GAAG,2BAAmB,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IACtE,MAAM,EAAE,MAAM;IACd,QAAQ;CACT,CAAC,CAAC,CAAC"} \ No newline at end of file From 37c161730805329f9c3d365fea2aaac3c02cc31b Mon Sep 17 00:00:00 2001 From: Bo Lopker Date: Tue, 18 Nov 2025 21:55:26 -0800 Subject: [PATCH 4/5] Add license, metadata fixup --- README.md | 2 +- editors/vscode/.gitignore | 2 + editors/vscode/.vscodeignore | 12 +- editors/vscode/LICENSE | 7 + editors/vscode/README.md | 12 +- editors/vscode/bun.lock | 653 +++++++++++++++++++++++++++++++- editors/vscode/package.json | 17 +- editors/vscode/src/extension.ts | 20 +- 8 files changed, 695 insertions(+), 30 deletions(-) create mode 100644 editors/vscode/LICENSE diff --git a/README.md b/README.md index dacdd65..3680c21 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ To try it locally: cd editors/vscode bun install # or npm install bun run build -vsce package # requires npm i -g @vscode/vsce +bun run package # or npm run package code --install-extension codebook-vscode-*.vsix ``` diff --git a/editors/vscode/.gitignore b/editors/vscode/.gitignore index e69de29..15c3536 100644 --- a/editors/vscode/.gitignore +++ b/editors/vscode/.gitignore @@ -0,0 +1,2 @@ +dist +*.vsix \ No newline at end of file diff --git a/editors/vscode/.vscodeignore b/editors/vscode/.vscodeignore index 11f73d8..92b4f00 100644 --- a/editors/vscode/.vscodeignore +++ b/editors/vscode/.vscodeignore @@ -1,5 +1,7 @@ -src -node_modules/@types -node_modules/typescript -node_modules/.bin -*.tsbuildinfo +.github/ +.gitignore +.vscode/ +.vscode-test/ +src/ +tsconfig.json +bun.lock diff --git a/editors/vscode/LICENSE b/editors/vscode/LICENSE new file mode 100644 index 0000000..f8a6563 --- /dev/null +++ b/editors/vscode/LICENSE @@ -0,0 +1,7 @@ +Copyright 2025 @blopker + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/editors/vscode/README.md b/editors/vscode/README.md index 334af44..adf2de3 100644 --- a/editors/vscode/README.md +++ b/editors/vscode/README.md @@ -5,11 +5,8 @@ spell check diagnostics and quick fixes appear automatically. ## Features -- Automatically launches `codebook-lsp` for C, C++, CSS, Elixir, Go, HTML, - Haskell, Java, JavaScript, LaTeX, Lua, Markdown, PHP, plain text, Python, - Ruby, Rust, TOML, TypeScript, Typst, Zig, and C# files. -- Downloads, caches, and updates the Codebook language server without requiring - any manual installation. +- Automatically launches `codebook-lsp` for supported languages. +- Downloads, caches, and updates the Codebook language server without requiring any manual installation. - Supports custom binary locations and optional pre-release builds via `codebook.*` settings. @@ -19,11 +16,12 @@ spell check diagnostics and quick fixes appear automatically. cd editors/vscode bun install # or npm install / pnpm install bun run build # or npm run build +bun run package # builds dist/ and emits a .vsix via vsce ``` The emitted JavaScript lives in `dist/` and can be loaded into VS Code via the -`Extension Tests / Run Extension` launch configuration or by using -`vsce package`. +`Extension Tests / Run Extension` launch configuration or by using the bundled +`vsce` CLI via `bun run package`. Set `codebook.logLevel` to `debug` to see verbose logs from the language server inside the `Codebook` output channel. diff --git a/editors/vscode/bun.lock b/editors/vscode/bun.lock index 0f33e07..3ca09ee 100644 --- a/editors/vscode/bun.lock +++ b/editors/vscode/bun.lock @@ -16,34 +16,409 @@ "devDependencies": { "@types/node": "^20.12.7", "@types/vscode": "^1.80.0", + "@vscode/vsce": "^3.7.0", "typescript": "^5.4.0", }, }, }, "packages": { + "@azu/format-text": ["@azu/format-text@1.0.2", "", {}, "sha512-Swi4N7Edy1Eqq82GxgEECXSSLyn6GOb5htRFPzBDdUkECGXtlf12ynO5oJSpWKPwCaUssOu7NfhDcCWpIC6Ywg=="], + + "@azu/style-format": ["@azu/style-format@1.0.1", "", { "dependencies": { "@azu/format-text": "^1.0.1" } }, "sha512-AHcTojlNBdD/3/KxIKlg8sxIWHfOtQszLvOpagLTO+bjC3u7SAszu1lf//u7JJC50aUSH+BVWDD/KvaA6Gfn5g=="], + + "@azure/abort-controller": ["@azure/abort-controller@2.1.2", "", { "dependencies": { "tslib": "^2.6.2" } }, "sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA=="], + + "@azure/core-auth": ["@azure/core-auth@1.10.1", "", { "dependencies": { "@azure/abort-controller": "^2.1.2", "@azure/core-util": "^1.13.0", "tslib": "^2.6.2" } }, "sha512-ykRMW8PjVAn+RS6ww5cmK9U2CyH9p4Q88YJwvUslfuMmN98w/2rdGRLPqJYObapBCdzBVeDgYWdJnFPFb7qzpg=="], + + "@azure/core-client": ["@azure/core-client@1.10.1", "", { "dependencies": { "@azure/abort-controller": "^2.1.2", "@azure/core-auth": "^1.10.0", "@azure/core-rest-pipeline": "^1.22.0", "@azure/core-tracing": "^1.3.0", "@azure/core-util": "^1.13.0", "@azure/logger": "^1.3.0", "tslib": "^2.6.2" } }, "sha512-Nh5PhEOeY6PrnxNPsEHRr9eimxLwgLlpmguQaHKBinFYA/RU9+kOYVOQqOrTsCL+KSxrLLl1gD8Dk5BFW/7l/w=="], + + "@azure/core-rest-pipeline": ["@azure/core-rest-pipeline@1.22.2", "", { "dependencies": { "@azure/abort-controller": "^2.1.2", "@azure/core-auth": "^1.10.0", "@azure/core-tracing": "^1.3.0", "@azure/core-util": "^1.13.0", "@azure/logger": "^1.3.0", "@typespec/ts-http-runtime": "^0.3.0", "tslib": "^2.6.2" } }, "sha512-MzHym+wOi8CLUlKCQu12de0nwcq9k9Kuv43j4Wa++CsCpJwps2eeBQwD2Bu8snkxTtDKDx4GwjuR9E8yC8LNrg=="], + + "@azure/core-tracing": ["@azure/core-tracing@1.3.1", "", { "dependencies": { "tslib": "^2.6.2" } }, "sha512-9MWKevR7Hz8kNzzPLfX4EAtGM2b8mr50HPDBvio96bURP/9C+HjdH3sBlLSNNrvRAr5/k/svoH457gB5IKpmwQ=="], + + "@azure/core-util": ["@azure/core-util@1.13.1", "", { "dependencies": { "@azure/abort-controller": "^2.1.2", "@typespec/ts-http-runtime": "^0.3.0", "tslib": "^2.6.2" } }, "sha512-XPArKLzsvl0Hf0CaGyKHUyVgF7oDnhKoP85Xv6M4StF/1AhfORhZudHtOyf2s+FcbuQ9dPRAjB8J2KvRRMUK2A=="], + + "@azure/identity": ["@azure/identity@4.13.0", "", { "dependencies": { "@azure/abort-controller": "^2.0.0", "@azure/core-auth": "^1.9.0", "@azure/core-client": "^1.9.2", "@azure/core-rest-pipeline": "^1.17.0", "@azure/core-tracing": "^1.0.0", "@azure/core-util": "^1.11.0", "@azure/logger": "^1.0.0", "@azure/msal-browser": "^4.2.0", "@azure/msal-node": "^3.5.0", "open": "^10.1.0", "tslib": "^2.2.0" } }, "sha512-uWC0fssc+hs1TGGVkkghiaFkkS7NkTxfnCH+Hdg+yTehTpMcehpok4PgUKKdyCH+9ldu6FhiHRv84Ntqj1vVcw=="], + + "@azure/logger": ["@azure/logger@1.3.0", "", { "dependencies": { "@typespec/ts-http-runtime": "^0.3.0", "tslib": "^2.6.2" } }, "sha512-fCqPIfOcLE+CGqGPd66c8bZpwAji98tZ4JI9i/mlTNTlsIWslCfpg48s/ypyLxZTump5sypjrKn2/kY7q8oAbA=="], + + "@azure/msal-browser": ["@azure/msal-browser@4.26.1", "", { "dependencies": { "@azure/msal-common": "15.13.1" } }, "sha512-GGCIsZXxyNm5QcQZ4maA9q+9UWmM+/87G+ybvPkrE32el1URSa9WYt0t67ks3/P0gspZX9RoEqyLqJ/X/JDnBQ=="], + + "@azure/msal-common": ["@azure/msal-common@15.13.1", "", {}, "sha512-vQYQcG4J43UWgo1lj7LcmdsGUKWYo28RfEvDQAEMmQIMjSFufvb+pS0FJ3KXmrPmnWlt1vHDl3oip6mIDUQ4uA=="], + + "@azure/msal-node": ["@azure/msal-node@3.8.2", "", { "dependencies": { "@azure/msal-common": "15.13.1", "jsonwebtoken": "^9.0.0", "uuid": "^8.3.0" } }, "sha512-dQrex2LiXwlCe9WuBHnCsY+xxLyuMXSd2SDEYJuhqB7cE8u6QafiC1xy8j8eBjGO30AsRi2M6amH0ZKk7vJpjA=="], + + "@babel/code-frame": ["@babel/code-frame@7.27.1", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.27.1", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg=="], + + "@babel/helper-validator-identifier": ["@babel/helper-validator-identifier@7.28.5", "", {}, "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q=="], + + "@isaacs/balanced-match": ["@isaacs/balanced-match@4.0.1", "", {}, "sha512-yzMTt9lEb8Gv7zRioUilSglI0c0smZ9k5D65677DLWLtWJaXIS3CqcGyUFByYKlnUj6TkjLVs54fBl6+TiGQDQ=="], + + "@isaacs/brace-expansion": ["@isaacs/brace-expansion@5.0.0", "", { "dependencies": { "@isaacs/balanced-match": "^4.0.1" } }, "sha512-ZT55BDLV0yv0RBm2czMiZ+SqCGO7AvmOM3G/w2xhVPH+te0aKgFjmBvGlL1dH+ql2tgGO3MVrbb3jCKyvpgnxA=="], + + "@isaacs/cliui": ["@isaacs/cliui@8.0.2", "", { "dependencies": { "string-width": "^5.1.2", "string-width-cjs": "npm:string-width@^4.2.0", "strip-ansi": "^7.0.1", "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", "wrap-ansi": "^8.1.0", "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" } }, "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA=="], + + "@nodelib/fs.scandir": ["@nodelib/fs.scandir@2.1.5", "", { "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" } }, "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g=="], + + "@nodelib/fs.stat": ["@nodelib/fs.stat@2.0.5", "", {}, "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A=="], + + "@nodelib/fs.walk": ["@nodelib/fs.walk@1.2.8", "", { "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" } }, "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg=="], + + "@secretlint/config-creator": ["@secretlint/config-creator@10.2.2", "", { "dependencies": { "@secretlint/types": "^10.2.2" } }, "sha512-BynOBe7Hn3LJjb3CqCHZjeNB09s/vgf0baBaHVw67w7gHF0d25c3ZsZ5+vv8TgwSchRdUCRrbbcq5i2B1fJ2QQ=="], + + "@secretlint/config-loader": ["@secretlint/config-loader@10.2.2", "", { "dependencies": { "@secretlint/profiler": "^10.2.2", "@secretlint/resolver": "^10.2.2", "@secretlint/types": "^10.2.2", "ajv": "^8.17.1", "debug": "^4.4.1", "rc-config-loader": "^4.1.3" } }, "sha512-ndjjQNgLg4DIcMJp4iaRD6xb9ijWQZVbd9694Ol2IszBIbGPPkwZHzJYKICbTBmh6AH/pLr0CiCaWdGJU7RbpQ=="], + + "@secretlint/core": ["@secretlint/core@10.2.2", "", { "dependencies": { "@secretlint/profiler": "^10.2.2", "@secretlint/types": "^10.2.2", "debug": "^4.4.1", "structured-source": "^4.0.0" } }, "sha512-6rdwBwLP9+TO3rRjMVW1tX+lQeo5gBbxl1I5F8nh8bgGtKwdlCMhMKsBWzWg1ostxx/tIG7OjZI0/BxsP8bUgw=="], + + "@secretlint/formatter": ["@secretlint/formatter@10.2.2", "", { "dependencies": { "@secretlint/resolver": "^10.2.2", "@secretlint/types": "^10.2.2", "@textlint/linter-formatter": "^15.2.0", "@textlint/module-interop": "^15.2.0", "@textlint/types": "^15.2.0", "chalk": "^5.4.1", "debug": "^4.4.1", "pluralize": "^8.0.0", "strip-ansi": "^7.1.0", "table": "^6.9.0", "terminal-link": "^4.0.0" } }, "sha512-10f/eKV+8YdGKNQmoDUD1QnYL7TzhI2kzyx95vsJKbEa8akzLAR5ZrWIZ3LbcMmBLzxlSQMMccRmi05yDQ5YDA=="], + + "@secretlint/node": ["@secretlint/node@10.2.2", "", { "dependencies": { "@secretlint/config-loader": "^10.2.2", "@secretlint/core": "^10.2.2", "@secretlint/formatter": "^10.2.2", "@secretlint/profiler": "^10.2.2", "@secretlint/source-creator": "^10.2.2", "@secretlint/types": "^10.2.2", "debug": "^4.4.1", "p-map": "^7.0.3" } }, "sha512-eZGJQgcg/3WRBwX1bRnss7RmHHK/YlP/l7zOQsrjexYt6l+JJa5YhUmHbuGXS94yW0++3YkEJp0kQGYhiw1DMQ=="], + + "@secretlint/profiler": ["@secretlint/profiler@10.2.2", "", {}, "sha512-qm9rWfkh/o8OvzMIfY8a5bCmgIniSpltbVlUVl983zDG1bUuQNd1/5lUEeWx5o/WJ99bXxS7yNI4/KIXfHexig=="], + + "@secretlint/resolver": ["@secretlint/resolver@10.2.2", "", {}, "sha512-3md0cp12e+Ae5V+crPQYGd6aaO7ahw95s28OlULGyclyyUtf861UoRGS2prnUrKh7MZb23kdDOyGCYb9br5e4w=="], + + "@secretlint/secretlint-formatter-sarif": ["@secretlint/secretlint-formatter-sarif@10.2.2", "", { "dependencies": { "node-sarif-builder": "^3.2.0" } }, "sha512-ojiF9TGRKJJw308DnYBucHxkpNovDNu1XvPh7IfUp0A12gzTtxuWDqdpuVezL7/IP8Ua7mp5/VkDMN9OLp1doQ=="], + + "@secretlint/secretlint-rule-no-dotenv": ["@secretlint/secretlint-rule-no-dotenv@10.2.2", "", { "dependencies": { "@secretlint/types": "^10.2.2" } }, "sha512-KJRbIShA9DVc5Va3yArtJ6QDzGjg3PRa1uYp9As4RsyKtKSSZjI64jVca57FZ8gbuk4em0/0Jq+uy6485wxIdg=="], + + "@secretlint/secretlint-rule-preset-recommend": ["@secretlint/secretlint-rule-preset-recommend@10.2.2", "", {}, "sha512-K3jPqjva8bQndDKJqctnGfwuAxU2n9XNCPtbXVI5JvC7FnQiNg/yWlQPbMUlBXtBoBGFYp08A94m6fvtc9v+zA=="], + + "@secretlint/source-creator": ["@secretlint/source-creator@10.2.2", "", { "dependencies": { "@secretlint/types": "^10.2.2", "istextorbinary": "^9.5.0" } }, "sha512-h6I87xJfwfUTgQ7irWq7UTdq/Bm1RuQ/fYhA3dtTIAop5BwSFmZyrchph4WcoEvbN460BWKmk4RYSvPElIIvxw=="], + + "@secretlint/types": ["@secretlint/types@10.2.2", "", {}, "sha512-Nqc90v4lWCXyakD6xNyNACBJNJ0tNCwj2WNk/7ivyacYHxiITVgmLUFXTBOeCdy79iz6HtN9Y31uw/jbLrdOAg=="], + + "@sindresorhus/merge-streams": ["@sindresorhus/merge-streams@2.3.0", "", {}, "sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg=="], + + "@textlint/ast-node-types": ["@textlint/ast-node-types@15.4.0", "", {}, "sha512-IqY8i7IOGuvy05wZxISB7Me1ZyrvhaQGgx6DavfQjH3cfwpPFdDbDYmMXMuSv2xLS1kDB1kYKBV7fL2Vi16lRA=="], + + "@textlint/linter-formatter": ["@textlint/linter-formatter@15.4.0", "", { "dependencies": { "@azu/format-text": "^1.0.2", "@azu/style-format": "^1.0.1", "@textlint/module-interop": "15.4.0", "@textlint/resolver": "15.4.0", "@textlint/types": "15.4.0", "chalk": "^4.1.2", "debug": "^4.4.3", "js-yaml": "^3.14.1", "lodash": "^4.17.21", "pluralize": "^2.0.0", "string-width": "^4.2.3", "strip-ansi": "^6.0.1", "table": "^6.9.0", "text-table": "^0.2.0" } }, "sha512-rfqOZmnI1Wwc/Pa4LK+vagvVPmvxf9oRsBRqIOB04DwhucingZyAIJI/TyG18DIDYbP2aFXBZ3oOvyAxHe/8PQ=="], + + "@textlint/module-interop": ["@textlint/module-interop@15.4.0", "", {}, "sha512-uGf+SFIfzOLCbZI0gp+2NLsrkSArsvEWulPP6lJuKp7yRHadmy7Xf/YHORe46qhNyyxc8PiAfiixHJSaHGUrGg=="], + + "@textlint/resolver": ["@textlint/resolver@15.4.0", "", {}, "sha512-Vh/QceKZQHFJFG4GxxIsKM1Xhwv93mbtKHmFE5/ybal1mIKHdqF03Z9Guaqt6Sx/AeNUshq0hkMOEhEyEWnehQ=="], + + "@textlint/types": ["@textlint/types@15.4.0", "", { "dependencies": { "@textlint/ast-node-types": "15.4.0" } }, "sha512-ZMwJgw/xjxJufOD+IB7I2Enl9Si4Hxo04B76RwUZ5cKBKzOPcmd6WvGe2F7jqdgmTdGnfMU+Bo/joQrjPNIWqg=="], + "@types/adm-zip": ["@types/adm-zip@0.5.7", "", { "dependencies": { "@types/node": "*" } }, "sha512-DNEs/QvmyRLurdQPChqq0Md4zGvPwHerAJYWk9l2jCbD1VPpnzRJorOdiq4zsw09NFbYnhfsoEhWtxIzXpn2yw=="], "@types/node": ["@types/node@20.19.25", "", { "dependencies": { "undici-types": "~6.21.0" } }, "sha512-ZsJzA5thDQMSQO788d7IocwwQbI8B5OPzmqNvpf3NY/+MHDAS759Wo0gd2WQeXYt5AAAQjzcrTVC6SKCuYgoCQ=="], + "@types/normalize-package-data": ["@types/normalize-package-data@2.4.4", "", {}, "sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA=="], + + "@types/sarif": ["@types/sarif@2.1.7", "", {}, "sha512-kRz0VEkJqWLf1LLVN4pT1cg1Z9wAuvI6L97V3m2f5B76Tg8d413ddvLBPTEHAZJlnn4XSvu0FkZtViCQGVyrXQ=="], + "@types/tar": ["@types/tar@6.1.13", "", { "dependencies": { "@types/node": "*", "minipass": "^4.0.0" } }, "sha512-IznnlmU5f4WcGTh2ltRu/Ijpmk8wiWXfF0VA4s+HPjHZgvFggk1YaIkbo5krX/zUCzWF8N/l4+W/LNxnvAJ8nw=="], "@types/vscode": ["@types/vscode@1.106.1", "", {}, "sha512-R/HV8u2h8CAddSbX8cjpdd7B8/GnE4UjgjpuGuHcbp1xV6yh4OeqU4L1pKjlwujCrSFS0MOpwJAIs/NexMB1fQ=="], "@types/which": ["@types/which@3.0.4", "", {}, "sha512-liyfuo/106JdlgSchJzXEQCVArk0CvevqPote8F8HgWgJ3dRCcTHgJIsLDuee0kxk/mhbInzIZk3QWSZJ8R+2w=="], + "@typespec/ts-http-runtime": ["@typespec/ts-http-runtime@0.3.2", "", { "dependencies": { "http-proxy-agent": "^7.0.0", "https-proxy-agent": "^7.0.0", "tslib": "^2.6.2" } }, "sha512-IlqQ/Gv22xUC1r/WQm4StLkYQmaaTsXAhUVsNE0+xiyf0yRFiH5++q78U3bw6bLKDCTmh0uqKB9eG9+Bt75Dkg=="], + + "@vscode/vsce": ["@vscode/vsce@3.7.0", "", { "dependencies": { "@azure/identity": "^4.1.0", "@secretlint/node": "^10.1.2", "@secretlint/secretlint-formatter-sarif": "^10.1.2", "@secretlint/secretlint-rule-no-dotenv": "^10.1.2", "@secretlint/secretlint-rule-preset-recommend": "^10.1.2", "@vscode/vsce-sign": "^2.0.0", "azure-devops-node-api": "^12.5.0", "chalk": "^4.1.2", "cheerio": "^1.0.0-rc.9", "cockatiel": "^3.1.2", "commander": "^12.1.0", "form-data": "^4.0.0", "glob": "^11.0.0", "hosted-git-info": "^4.0.2", "jsonc-parser": "^3.2.0", "leven": "^3.1.0", "markdown-it": "^14.1.0", "mime": "^1.3.4", "minimatch": "^3.0.3", "parse-semver": "^1.1.1", "read": "^1.0.7", "secretlint": "^10.1.2", "semver": "^7.5.2", "tmp": "^0.2.3", "typed-rest-client": "^1.8.4", "url-join": "^4.0.1", "xml2js": "^0.5.0", "yauzl": "^2.3.1", "yazl": "^2.2.2" }, "optionalDependencies": { "keytar": "^7.7.0" }, "bin": { "vsce": "vsce" } }, "sha512-LY9r2T4joszRjz4d92ZPl6LTBUPS4IWH9gG/3JUv+1QyBJrveZlcVISuiaq0EOpmcgFh0GgVgKD4rD/21Tu8sA=="], + + "@vscode/vsce-sign": ["@vscode/vsce-sign@2.0.9", "", { "optionalDependencies": { "@vscode/vsce-sign-alpine-arm64": "2.0.6", "@vscode/vsce-sign-alpine-x64": "2.0.6", "@vscode/vsce-sign-darwin-arm64": "2.0.6", "@vscode/vsce-sign-darwin-x64": "2.0.6", "@vscode/vsce-sign-linux-arm": "2.0.6", "@vscode/vsce-sign-linux-arm64": "2.0.6", "@vscode/vsce-sign-linux-x64": "2.0.6", "@vscode/vsce-sign-win32-arm64": "2.0.6", "@vscode/vsce-sign-win32-x64": "2.0.6" } }, "sha512-8IvaRvtFyzUnGGl3f5+1Cnor3LqaUWvhaUjAYO8Y39OUYlOf3cRd+dowuQYLpZcP3uwSG+mURwjEBOSq4SOJ0g=="], + + "@vscode/vsce-sign-alpine-arm64": ["@vscode/vsce-sign-alpine-arm64@2.0.6", "", { "os": "none", "cpu": "arm64" }, "sha512-wKkJBsvKF+f0GfsUuGT0tSW0kZL87QggEiqNqK6/8hvqsXvpx8OsTEc3mnE1kejkh5r+qUyQ7PtF8jZYN0mo8Q=="], + + "@vscode/vsce-sign-alpine-x64": ["@vscode/vsce-sign-alpine-x64@2.0.6", "", { "os": "none", "cpu": "x64" }, "sha512-YoAGlmdK39vKi9jA18i4ufBbd95OqGJxRvF3n6ZbCyziwy3O+JgOpIUPxv5tjeO6gQfx29qBivQ8ZZTUF2Ba0w=="], + + "@vscode/vsce-sign-darwin-arm64": ["@vscode/vsce-sign-darwin-arm64@2.0.6", "", { "os": "darwin", "cpu": "arm64" }, "sha512-5HMHaJRIQuozm/XQIiJiA0W9uhdblwwl2ZNDSSAeXGO9YhB9MH5C4KIHOmvyjUnKy4UCuiP43VKpIxW1VWP4tQ=="], + + "@vscode/vsce-sign-darwin-x64": ["@vscode/vsce-sign-darwin-x64@2.0.6", "", { "os": "darwin", "cpu": "x64" }, "sha512-25GsUbTAiNfHSuRItoQafXOIpxlYj+IXb4/qarrXu7kmbH94jlm5sdWSCKrrREs8+GsXF1b+l3OB7VJy5jsykw=="], + + "@vscode/vsce-sign-linux-arm": ["@vscode/vsce-sign-linux-arm@2.0.6", "", { "os": "linux", "cpu": "arm" }, "sha512-UndEc2Xlq4HsuMPnwu7420uqceXjs4yb5W8E2/UkaHBB9OWCwMd3/bRe/1eLe3D8kPpxzcaeTyXiK3RdzS/1CA=="], + + "@vscode/vsce-sign-linux-arm64": ["@vscode/vsce-sign-linux-arm64@2.0.6", "", { "os": "linux", "cpu": "arm64" }, "sha512-cfb1qK7lygtMa4NUl2582nP7aliLYuDEVpAbXJMkDq1qE+olIw/es+C8j1LJwvcRq1I2yWGtSn3EkDp9Dq5FdA=="], + + "@vscode/vsce-sign-linux-x64": ["@vscode/vsce-sign-linux-x64@2.0.6", "", { "os": "linux", "cpu": "x64" }, "sha512-/olerl1A4sOqdP+hjvJ1sbQjKN07Y3DVnxO4gnbn/ahtQvFrdhUi0G1VsZXDNjfqmXw57DmPi5ASnj/8PGZhAA=="], + + "@vscode/vsce-sign-win32-arm64": ["@vscode/vsce-sign-win32-arm64@2.0.6", "", { "os": "win32", "cpu": "arm64" }, "sha512-ivM/MiGIY0PJNZBoGtlRBM/xDpwbdlCWomUWuLmIxbi1Cxe/1nooYrEQoaHD8ojVRgzdQEUzMsRbyF5cJJgYOg=="], + + "@vscode/vsce-sign-win32-x64": ["@vscode/vsce-sign-win32-x64@2.0.6", "", { "os": "win32", "cpu": "x64" }, "sha512-mgth9Kvze+u8CruYMmhHw6Zgy3GRX2S+Ed5oSokDEK5vPEwGGKnmuXua9tmFhomeAnhgJnL4DCna3TiNuGrBTQ=="], + "adm-zip": ["adm-zip@0.5.16", "", {}, "sha512-TGw5yVi4saajsSEgz25grObGHEUaDrniwvA2qwSC060KfqGPdglhvPMA2lPIoxs3PQIItj2iag35fONcQqgUaQ=="], + "agent-base": ["agent-base@7.1.4", "", {}, "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ=="], + + "ajv": ["ajv@8.17.1", "", { "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", "json-schema-traverse": "^1.0.0", "require-from-string": "^2.0.2" } }, "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g=="], + + "ansi-escapes": ["ansi-escapes@7.2.0", "", { "dependencies": { "environment": "^1.0.0" } }, "sha512-g6LhBsl+GBPRWGWsBtutpzBYuIIdBkLEvad5C/va/74Db018+5TZiyA26cZJAr3Rft5lprVqOIPxf5Vid6tqAw=="], + + "ansi-regex": ["ansi-regex@6.2.2", "", {}, "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg=="], + + "ansi-styles": ["ansi-styles@4.3.0", "", { "dependencies": { "color-convert": "^2.0.1" } }, "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg=="], + + "argparse": ["argparse@2.0.1", "", {}, "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="], + + "astral-regex": ["astral-regex@2.0.0", "", {}, "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ=="], + + "asynckit": ["asynckit@0.4.0", "", {}, "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="], + + "azure-devops-node-api": ["azure-devops-node-api@12.5.0", "", { "dependencies": { "tunnel": "0.0.6", "typed-rest-client": "^1.8.4" } }, "sha512-R5eFskGvOm3U/GzeAuxRkUsAl0hrAwGgWn6zAd2KrZmrEhWZVqLew4OOupbQlXUuojUzpGtq62SmdhJ06N88og=="], + "balanced-match": ["balanced-match@1.0.2", "", {}, "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="], - "brace-expansion": ["brace-expansion@2.0.2", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ=="], + "base64-js": ["base64-js@1.5.1", "", {}, "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA=="], + + "binaryextensions": ["binaryextensions@6.11.0", "", { "dependencies": { "editions": "^6.21.0" } }, "sha512-sXnYK/Ij80TO3lcqZVV2YgfKN5QjUWIRk/XSm2J/4bd/lPko3lvk0O4ZppH6m+6hB2/GTu+ptNwVFe1xh+QLQw=="], + + "bl": ["bl@4.1.0", "", { "dependencies": { "buffer": "^5.5.0", "inherits": "^2.0.4", "readable-stream": "^3.4.0" } }, "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w=="], + + "boolbase": ["boolbase@1.0.0", "", {}, "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww=="], + + "boundary": ["boundary@2.0.0", "", {}, "sha512-rJKn5ooC9u8q13IMCrW0RSp31pxBCHE3y9V/tp3TdWSLf8Em3p6Di4NBpfzbJge9YjjFEsD0RtFEjtvHL5VyEA=="], + + "brace-expansion": ["brace-expansion@1.1.12", "", { "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg=="], + + "braces": ["braces@3.0.3", "", { "dependencies": { "fill-range": "^7.1.1" } }, "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA=="], + + "buffer": ["buffer@5.7.1", "", { "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" } }, "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ=="], + + "buffer-crc32": ["buffer-crc32@0.2.13", "", {}, "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ=="], + + "buffer-equal-constant-time": ["buffer-equal-constant-time@1.0.1", "", {}, "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA=="], + + "bundle-name": ["bundle-name@4.1.0", "", { "dependencies": { "run-applescript": "^7.0.0" } }, "sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q=="], + + "call-bind-apply-helpers": ["call-bind-apply-helpers@1.0.2", "", { "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2" } }, "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ=="], + + "call-bound": ["call-bound@1.0.4", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.2", "get-intrinsic": "^1.3.0" } }, "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg=="], + + "chalk": ["chalk@4.1.2", "", { "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA=="], + + "cheerio": ["cheerio@1.1.2", "", { "dependencies": { "cheerio-select": "^2.1.0", "dom-serializer": "^2.0.0", "domhandler": "^5.0.3", "domutils": "^3.2.2", "encoding-sniffer": "^0.2.1", "htmlparser2": "^10.0.0", "parse5": "^7.3.0", "parse5-htmlparser2-tree-adapter": "^7.1.0", "parse5-parser-stream": "^7.1.2", "undici": "^7.12.0", "whatwg-mimetype": "^4.0.0" } }, "sha512-IkxPpb5rS/d1IiLbHMgfPuS0FgiWTtFIm/Nj+2woXDLTZ7fOT2eqzgYbdMlLweqlHbsZjxEChoVK+7iph7jyQg=="], + + "cheerio-select": ["cheerio-select@2.1.0", "", { "dependencies": { "boolbase": "^1.0.0", "css-select": "^5.1.0", "css-what": "^6.1.0", "domelementtype": "^2.3.0", "domhandler": "^5.0.3", "domutils": "^3.0.1" } }, "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g=="], "chownr": ["chownr@2.0.0", "", {}, "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ=="], + "cockatiel": ["cockatiel@3.2.1", "", {}, "sha512-gfrHV6ZPkquExvMh9IOkKsBzNDk6sDuZ6DdBGUBkvFnTCqCxzpuq48RySgP0AnaqQkw2zynOFj9yly6T1Q2G5Q=="], + + "color-convert": ["color-convert@2.0.1", "", { "dependencies": { "color-name": "~1.1.4" } }, "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ=="], + + "color-name": ["color-name@1.1.4", "", {}, "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="], + + "combined-stream": ["combined-stream@1.0.8", "", { "dependencies": { "delayed-stream": "~1.0.0" } }, "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg=="], + + "commander": ["commander@12.1.0", "", {}, "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA=="], + + "concat-map": ["concat-map@0.0.1", "", {}, "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="], + + "cross-spawn": ["cross-spawn@7.0.6", "", { "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", "which": "^2.0.1" } }, "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA=="], + + "css-select": ["css-select@5.2.2", "", { "dependencies": { "boolbase": "^1.0.0", "css-what": "^6.1.0", "domhandler": "^5.0.2", "domutils": "^3.0.1", "nth-check": "^2.0.1" } }, "sha512-TizTzUddG/xYLA3NXodFM0fSbNizXjOKhqiQQwvhlspadZokn1KDy0NZFS0wuEubIYAV5/c1/lAr0TaaFXEXzw=="], + + "css-what": ["css-what@6.2.2", "", {}, "sha512-u/O3vwbptzhMs3L1fQE82ZSLHQQfto5gyZzwteVIEyeaY5Fc7R4dapF/BvRoSYFeqfBk4m0V1Vafq5Pjv25wvA=="], + + "debug": ["debug@4.4.3", "", { "dependencies": { "ms": "^2.1.3" } }, "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA=="], + + "decompress-response": ["decompress-response@6.0.0", "", { "dependencies": { "mimic-response": "^3.1.0" } }, "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ=="], + + "deep-extend": ["deep-extend@0.6.0", "", {}, "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA=="], + + "default-browser": ["default-browser@5.4.0", "", { "dependencies": { "bundle-name": "^4.1.0", "default-browser-id": "^5.0.0" } }, "sha512-XDuvSq38Hr1MdN47EDvYtx3U0MTqpCEn+F6ft8z2vYDzMrvQhVp0ui9oQdqW3MvK3vqUETglt1tVGgjLuJ5izg=="], + + "default-browser-id": ["default-browser-id@5.0.1", "", {}, "sha512-x1VCxdX4t+8wVfd1so/9w+vQ4vx7lKd2Qp5tDRutErwmR85OgmfX7RlLRMWafRMY7hbEiXIbudNrjOAPa/hL8Q=="], + + "define-lazy-prop": ["define-lazy-prop@3.0.0", "", {}, "sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg=="], + + "delayed-stream": ["delayed-stream@1.0.0", "", {}, "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ=="], + + "detect-libc": ["detect-libc@2.1.2", "", {}, "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ=="], + + "dom-serializer": ["dom-serializer@2.0.0", "", { "dependencies": { "domelementtype": "^2.3.0", "domhandler": "^5.0.2", "entities": "^4.2.0" } }, "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg=="], + + "domelementtype": ["domelementtype@2.3.0", "", {}, "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw=="], + + "domhandler": ["domhandler@5.0.3", "", { "dependencies": { "domelementtype": "^2.3.0" } }, "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w=="], + + "domutils": ["domutils@3.2.2", "", { "dependencies": { "dom-serializer": "^2.0.0", "domelementtype": "^2.3.0", "domhandler": "^5.0.3" } }, "sha512-6kZKyUajlDuqlHKVX1w7gyslj9MPIXzIFiz/rGu35uC1wMi+kMhQwGhl4lt9unC9Vb9INnY9Z3/ZA3+FhASLaw=="], + + "dunder-proto": ["dunder-proto@1.0.1", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.1", "es-errors": "^1.3.0", "gopd": "^1.2.0" } }, "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A=="], + + "eastasianwidth": ["eastasianwidth@0.2.0", "", {}, "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA=="], + + "ecdsa-sig-formatter": ["ecdsa-sig-formatter@1.0.11", "", { "dependencies": { "safe-buffer": "^5.0.1" } }, "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ=="], + + "editions": ["editions@6.22.0", "", { "dependencies": { "version-range": "^4.15.0" } }, "sha512-UgGlf8IW75je7HZjNDpJdCv4cGJWIi6yumFdZ0R7A8/CIhQiWUjyGLCxdHpd8bmyD1gnkfUNK0oeOXqUS2cpfQ=="], + + "emoji-regex": ["emoji-regex@8.0.0", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="], + + "encoding-sniffer": ["encoding-sniffer@0.2.1", "", { "dependencies": { "iconv-lite": "^0.6.3", "whatwg-encoding": "^3.1.1" } }, "sha512-5gvq20T6vfpekVtqrYQsSCFZ1wEg5+wW0/QaZMWkFr6BqD3NfKs0rLCx4rrVlSWJeZb5NBJgVLswK/w2MWU+Gw=="], + + "end-of-stream": ["end-of-stream@1.4.5", "", { "dependencies": { "once": "^1.4.0" } }, "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg=="], + + "entities": ["entities@4.5.0", "", {}, "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw=="], + + "environment": ["environment@1.1.0", "", {}, "sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q=="], + + "es-define-property": ["es-define-property@1.0.1", "", {}, "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g=="], + + "es-errors": ["es-errors@1.3.0", "", {}, "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw=="], + + "es-object-atoms": ["es-object-atoms@1.1.1", "", { "dependencies": { "es-errors": "^1.3.0" } }, "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA=="], + + "es-set-tostringtag": ["es-set-tostringtag@2.1.0", "", { "dependencies": { "es-errors": "^1.3.0", "get-intrinsic": "^1.2.6", "has-tostringtag": "^1.0.2", "hasown": "^2.0.2" } }, "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA=="], + + "esprima": ["esprima@4.0.1", "", { "bin": { "esparse": "./bin/esparse.js", "esvalidate": "./bin/esvalidate.js" } }, "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A=="], + + "expand-template": ["expand-template@2.0.3", "", {}, "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg=="], + + "fast-deep-equal": ["fast-deep-equal@3.1.3", "", {}, "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="], + + "fast-glob": ["fast-glob@3.3.3", "", { "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", "glob-parent": "^5.1.2", "merge2": "^1.3.0", "micromatch": "^4.0.8" } }, "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg=="], + + "fast-uri": ["fast-uri@3.1.0", "", {}, "sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA=="], + + "fastq": ["fastq@1.19.1", "", { "dependencies": { "reusify": "^1.0.4" } }, "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ=="], + + "fd-slicer": ["fd-slicer@1.1.0", "", { "dependencies": { "pend": "~1.2.0" } }, "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g=="], + + "fill-range": ["fill-range@7.1.1", "", { "dependencies": { "to-regex-range": "^5.0.1" } }, "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg=="], + + "foreground-child": ["foreground-child@3.3.1", "", { "dependencies": { "cross-spawn": "^7.0.6", "signal-exit": "^4.0.1" } }, "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw=="], + + "form-data": ["form-data@4.0.5", "", { "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", "es-set-tostringtag": "^2.1.0", "hasown": "^2.0.2", "mime-types": "^2.1.12" } }, "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w=="], + + "fs-constants": ["fs-constants@1.0.0", "", {}, "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow=="], + + "fs-extra": ["fs-extra@11.3.2", "", { "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", "universalify": "^2.0.0" } }, "sha512-Xr9F6z6up6Ws+NjzMCZc6WXg2YFRlrLP9NQDO3VQrWrfiojdhS56TzueT88ze0uBdCTwEIhQ3ptnmKeWGFAe0A=="], + "fs-minipass": ["fs-minipass@2.1.0", "", { "dependencies": { "minipass": "^3.0.0" } }, "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg=="], + "function-bind": ["function-bind@1.1.2", "", {}, "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA=="], + + "get-intrinsic": ["get-intrinsic@1.3.0", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.2", "es-define-property": "^1.0.1", "es-errors": "^1.3.0", "es-object-atoms": "^1.1.1", "function-bind": "^1.1.2", "get-proto": "^1.0.1", "gopd": "^1.2.0", "has-symbols": "^1.1.0", "hasown": "^2.0.2", "math-intrinsics": "^1.1.0" } }, "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ=="], + + "get-proto": ["get-proto@1.0.1", "", { "dependencies": { "dunder-proto": "^1.0.1", "es-object-atoms": "^1.0.0" } }, "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g=="], + + "github-from-package": ["github-from-package@0.0.0", "", {}, "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw=="], + + "glob": ["glob@11.1.0", "", { "dependencies": { "foreground-child": "^3.3.1", "jackspeak": "^4.1.1", "minimatch": "^10.1.1", "minipass": "^7.1.2", "package-json-from-dist": "^1.0.0", "path-scurry": "^2.0.0" }, "bin": { "glob": "dist/esm/bin.mjs" } }, "sha512-vuNwKSaKiqm7g0THUBu2x7ckSs3XJLXE+2ssL7/MfTGPLLcrJQ/4Uq1CjPTtO5cCIiRxqvN6Twy1qOwhL0Xjcw=="], + + "glob-parent": ["glob-parent@5.1.2", "", { "dependencies": { "is-glob": "^4.0.1" } }, "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow=="], + + "globby": ["globby@14.1.0", "", { "dependencies": { "@sindresorhus/merge-streams": "^2.1.0", "fast-glob": "^3.3.3", "ignore": "^7.0.3", "path-type": "^6.0.0", "slash": "^5.1.0", "unicorn-magic": "^0.3.0" } }, "sha512-0Ia46fDOaT7k4og1PDW4YbodWWr3scS2vAr2lTbsplOt2WkKp0vQbkI9wKis/T5LV/dqPjO3bpS/z6GTJB82LA=="], + + "gopd": ["gopd@1.2.0", "", {}, "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg=="], + + "graceful-fs": ["graceful-fs@4.2.11", "", {}, "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="], + + "has-flag": ["has-flag@4.0.0", "", {}, "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ=="], + + "has-symbols": ["has-symbols@1.1.0", "", {}, "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ=="], + + "has-tostringtag": ["has-tostringtag@1.0.2", "", { "dependencies": { "has-symbols": "^1.0.3" } }, "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw=="], + + "hasown": ["hasown@2.0.2", "", { "dependencies": { "function-bind": "^1.1.2" } }, "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ=="], + + "hosted-git-info": ["hosted-git-info@4.1.0", "", { "dependencies": { "lru-cache": "^6.0.0" } }, "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA=="], + + "htmlparser2": ["htmlparser2@10.0.0", "", { "dependencies": { "domelementtype": "^2.3.0", "domhandler": "^5.0.3", "domutils": "^3.2.1", "entities": "^6.0.0" } }, "sha512-TwAZM+zE5Tq3lrEHvOlvwgj1XLWQCtaaibSN11Q+gGBAS7Y1uZSWwXXRe4iF6OXnaq1riyQAPFOBtYc77Mxq0g=="], + + "http-proxy-agent": ["http-proxy-agent@7.0.2", "", { "dependencies": { "agent-base": "^7.1.0", "debug": "^4.3.4" } }, "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig=="], + + "https-proxy-agent": ["https-proxy-agent@7.0.6", "", { "dependencies": { "agent-base": "^7.1.2", "debug": "4" } }, "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw=="], + + "iconv-lite": ["iconv-lite@0.6.3", "", { "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" } }, "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw=="], + + "ieee754": ["ieee754@1.2.1", "", {}, "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA=="], + + "ignore": ["ignore@7.0.5", "", {}, "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg=="], + + "index-to-position": ["index-to-position@1.2.0", "", {}, "sha512-Yg7+ztRkqslMAS2iFaU+Oa4KTSidr63OsFGlOrJoW981kIYO3CGCS3wA95P1mUi/IVSJkn0D479KTJpVpvFNuw=="], + + "inherits": ["inherits@2.0.4", "", {}, "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="], + + "ini": ["ini@1.3.8", "", {}, "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew=="], + + "is-docker": ["is-docker@3.0.0", "", { "bin": { "is-docker": "cli.js" } }, "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ=="], + + "is-extglob": ["is-extglob@2.1.1", "", {}, "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ=="], + + "is-fullwidth-code-point": ["is-fullwidth-code-point@3.0.0", "", {}, "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg=="], + + "is-glob": ["is-glob@4.0.3", "", { "dependencies": { "is-extglob": "^2.1.1" } }, "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg=="], + + "is-inside-container": ["is-inside-container@1.0.0", "", { "dependencies": { "is-docker": "^3.0.0" }, "bin": { "is-inside-container": "cli.js" } }, "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA=="], + + "is-number": ["is-number@7.0.0", "", {}, "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng=="], + + "is-wsl": ["is-wsl@3.1.0", "", { "dependencies": { "is-inside-container": "^1.0.0" } }, "sha512-UcVfVfaK4Sc4m7X3dUSoHoozQGBEFeDC+zVo06t98xe8CzHSZZBekNXH+tu0NalHolcJ/QAGqS46Hef7QXBIMw=="], + "isexe": ["isexe@3.1.1", "", {}, "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ=="], - "minimatch": ["minimatch@5.1.6", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g=="], + "istextorbinary": ["istextorbinary@9.5.0", "", { "dependencies": { "binaryextensions": "^6.11.0", "editions": "^6.21.0", "textextensions": "^6.11.0" } }, "sha512-5mbUj3SiZXCuRf9fT3ibzbSSEWiy63gFfksmGfdOzujPjW3k+z8WvIBxcJHBoQNlaZaiyB25deviif2+osLmLw=="], + + "jackspeak": ["jackspeak@4.1.1", "", { "dependencies": { "@isaacs/cliui": "^8.0.2" } }, "sha512-zptv57P3GpL+O0I7VdMJNBZCu+BPHVQUk55Ft8/QCJjTVxrnJHuVuX/0Bl2A6/+2oyR/ZMEuFKwmzqqZ/U5nPQ=="], + + "js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], + + "js-yaml": ["js-yaml@4.1.1", "", { "dependencies": { "argparse": "^2.0.1" }, "bin": { "js-yaml": "bin/js-yaml.js" } }, "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA=="], + + "json-schema-traverse": ["json-schema-traverse@1.0.0", "", {}, "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug=="], + + "json5": ["json5@2.2.3", "", { "bin": { "json5": "lib/cli.js" } }, "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg=="], + + "jsonc-parser": ["jsonc-parser@3.3.1", "", {}, "sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ=="], + + "jsonfile": ["jsonfile@6.2.0", "", { "dependencies": { "universalify": "^2.0.0" }, "optionalDependencies": { "graceful-fs": "^4.1.6" } }, "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg=="], + + "jsonwebtoken": ["jsonwebtoken@9.0.2", "", { "dependencies": { "jws": "^3.2.2", "lodash.includes": "^4.3.0", "lodash.isboolean": "^3.0.3", "lodash.isinteger": "^4.0.4", "lodash.isnumber": "^3.0.3", "lodash.isplainobject": "^4.0.6", "lodash.isstring": "^4.0.1", "lodash.once": "^4.0.0", "ms": "^2.1.1", "semver": "^7.5.4" } }, "sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ=="], + + "jwa": ["jwa@1.4.2", "", { "dependencies": { "buffer-equal-constant-time": "^1.0.1", "ecdsa-sig-formatter": "1.0.11", "safe-buffer": "^5.0.1" } }, "sha512-eeH5JO+21J78qMvTIDdBXidBd6nG2kZjg5Ohz/1fpa28Z4CcsWUzJ1ZZyFq/3z3N17aZy+ZuBoHljASbL1WfOw=="], + + "jws": ["jws@3.2.2", "", { "dependencies": { "jwa": "^1.4.1", "safe-buffer": "^5.0.1" } }, "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA=="], + + "keytar": ["keytar@7.9.0", "", { "dependencies": { "node-addon-api": "^4.3.0", "prebuild-install": "^7.0.1" } }, "sha512-VPD8mtVtm5JNtA2AErl6Chp06JBfy7diFQ7TQQhdpWOl6MrCRB+eRbvAZUsbGQS9kiMq0coJsy0W0vHpDCkWsQ=="], + + "leven": ["leven@3.1.0", "", {}, "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A=="], + + "linkify-it": ["linkify-it@5.0.0", "", { "dependencies": { "uc.micro": "^2.0.0" } }, "sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ=="], + + "lodash": ["lodash@4.17.21", "", {}, "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="], + + "lodash.includes": ["lodash.includes@4.3.0", "", {}, "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w=="], + + "lodash.isboolean": ["lodash.isboolean@3.0.3", "", {}, "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg=="], + + "lodash.isinteger": ["lodash.isinteger@4.0.4", "", {}, "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA=="], + + "lodash.isnumber": ["lodash.isnumber@3.0.3", "", {}, "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw=="], + + "lodash.isplainobject": ["lodash.isplainobject@4.0.6", "", {}, "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA=="], + + "lodash.isstring": ["lodash.isstring@4.0.1", "", {}, "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw=="], + + "lodash.once": ["lodash.once@4.1.1", "", {}, "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg=="], + + "lodash.truncate": ["lodash.truncate@4.4.2", "", {}, "sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw=="], + + "lru-cache": ["lru-cache@6.0.0", "", { "dependencies": { "yallist": "^4.0.0" } }, "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA=="], + + "markdown-it": ["markdown-it@14.1.0", "", { "dependencies": { "argparse": "^2.0.1", "entities": "^4.4.0", "linkify-it": "^5.0.0", "mdurl": "^2.0.0", "punycode.js": "^2.3.1", "uc.micro": "^2.1.0" }, "bin": { "markdown-it": "bin/markdown-it.mjs" } }, "sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg=="], + + "math-intrinsics": ["math-intrinsics@1.1.0", "", {}, "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g=="], + + "mdurl": ["mdurl@2.0.0", "", {}, "sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w=="], + + "merge2": ["merge2@1.4.1", "", {}, "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg=="], + + "micromatch": ["micromatch@4.0.8", "", { "dependencies": { "braces": "^3.0.3", "picomatch": "^2.3.1" } }, "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA=="], + + "mime": ["mime@1.6.0", "", { "bin": { "mime": "cli.js" } }, "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg=="], + + "mime-db": ["mime-db@1.52.0", "", {}, "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg=="], + + "mime-types": ["mime-types@2.1.35", "", { "dependencies": { "mime-db": "1.52.0" } }, "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw=="], + + "mimic-response": ["mimic-response@3.1.0", "", {}, "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ=="], + + "minimatch": ["minimatch@3.1.2", "", { "dependencies": { "brace-expansion": "^1.1.7" } }, "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw=="], + + "minimist": ["minimist@1.2.8", "", {}, "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA=="], "minipass": ["minipass@4.2.8", "", {}, "sha512-fNzuVyifolSLFL4NzpF+wEF4qrgqaaKX0haXPQEdQ7NKAN+WecoKMHV09YcuL/DHxrUsYQOK3MiuDf7Ip2OXfQ=="], @@ -51,14 +426,198 @@ "mkdirp": ["mkdirp@1.0.4", "", { "bin": { "mkdirp": "bin/cmd.js" } }, "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw=="], + "mkdirp-classic": ["mkdirp-classic@0.5.3", "", {}, "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A=="], + + "ms": ["ms@2.1.3", "", {}, "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="], + + "mute-stream": ["mute-stream@0.0.8", "", {}, "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA=="], + + "napi-build-utils": ["napi-build-utils@2.0.0", "", {}, "sha512-GEbrYkbfF7MoNaoh2iGG84Mnf/WZfB0GdGEsM8wz7Expx/LlWf5U8t9nvJKXSp3qr5IsEbK04cBGhol/KwOsWA=="], + + "node-abi": ["node-abi@3.85.0", "", { "dependencies": { "semver": "^7.3.5" } }, "sha512-zsFhmbkAzwhTft6nd3VxcG0cvJsT70rL+BIGHWVq5fi6MwGrHwzqKaxXE+Hl2GmnGItnDKPPkO5/LQqjVkIdFg=="], + + "node-addon-api": ["node-addon-api@4.3.0", "", {}, "sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ=="], + + "node-sarif-builder": ["node-sarif-builder@3.3.0", "", { "dependencies": { "@types/sarif": "^2.1.7", "fs-extra": "^11.1.1" } }, "sha512-8taRy2nQs1xNs8iO2F0XbkZJEliiijpKgFVcyiwKjJ2+3X59LVI3wY84qRdJwRDpIo5GK8wvb1pxcJ+JVu3jrg=="], + + "normalize-package-data": ["normalize-package-data@6.0.2", "", { "dependencies": { "hosted-git-info": "^7.0.0", "semver": "^7.3.5", "validate-npm-package-license": "^3.0.4" } }, "sha512-V6gygoYb/5EmNI+MEGrWkC+e6+Rr7mTmfHrxDbLzxQogBkgzo76rkok0Am6thgSF7Mv2nLOajAJj5vDJZEFn7g=="], + + "nth-check": ["nth-check@2.1.1", "", { "dependencies": { "boolbase": "^1.0.0" } }, "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w=="], + + "object-inspect": ["object-inspect@1.13.4", "", {}, "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew=="], + + "once": ["once@1.4.0", "", { "dependencies": { "wrappy": "1" } }, "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w=="], + + "open": ["open@10.2.0", "", { "dependencies": { "default-browser": "^5.2.1", "define-lazy-prop": "^3.0.0", "is-inside-container": "^1.0.0", "wsl-utils": "^0.1.0" } }, "sha512-YgBpdJHPyQ2UE5x+hlSXcnejzAvD0b22U2OuAP+8OnlJT+PjWPxtgmGqKKc+RgTM63U9gN0YzrYc71R2WT/hTA=="], + + "p-map": ["p-map@7.0.4", "", {}, "sha512-tkAQEw8ysMzmkhgw8k+1U/iPhWNhykKnSk4Rd5zLoPJCuJaGRPo6YposrZgaxHKzDHdDWWZvE/Sk7hsL2X/CpQ=="], + + "package-json-from-dist": ["package-json-from-dist@1.0.1", "", {}, "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw=="], + + "parse-json": ["parse-json@8.3.0", "", { "dependencies": { "@babel/code-frame": "^7.26.2", "index-to-position": "^1.1.0", "type-fest": "^4.39.1" } }, "sha512-ybiGyvspI+fAoRQbIPRddCcSTV9/LsJbf0e/S85VLowVGzRmokfneg2kwVW/KU5rOXrPSbF1qAKPMgNTqqROQQ=="], + + "parse-semver": ["parse-semver@1.1.1", "", { "dependencies": { "semver": "^5.1.0" } }, "sha512-Eg1OuNntBMH0ojvEKSrvDSnwLmvVuUOSdylH/pSCPNMIspLlweJyIWXCE+k/5hm3cj/EBUYwmWkjhBALNP4LXQ=="], + + "parse5": ["parse5@7.3.0", "", { "dependencies": { "entities": "^6.0.0" } }, "sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw=="], + + "parse5-htmlparser2-tree-adapter": ["parse5-htmlparser2-tree-adapter@7.1.0", "", { "dependencies": { "domhandler": "^5.0.3", "parse5": "^7.0.0" } }, "sha512-ruw5xyKs6lrpo9x9rCZqZZnIUntICjQAd0Wsmp396Ul9lN/h+ifgVV1x1gZHi8euej6wTfpqX8j+BFQxF0NS/g=="], + + "parse5-parser-stream": ["parse5-parser-stream@7.1.2", "", { "dependencies": { "parse5": "^7.0.0" } }, "sha512-JyeQc9iwFLn5TbvvqACIF/VXG6abODeB3Fwmv/TGdLk2LfbWkaySGY72at4+Ty7EkPZj854u4CrICqNk2qIbow=="], + + "path-key": ["path-key@3.1.1", "", {}, "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q=="], + + "path-scurry": ["path-scurry@2.0.1", "", { "dependencies": { "lru-cache": "^11.0.0", "minipass": "^7.1.2" } }, "sha512-oWyT4gICAu+kaA7QWk/jvCHWarMKNs6pXOGWKDTr7cw4IGcUbW+PeTfbaQiLGheFRpjo6O9J0PmyMfQPjH71oA=="], + + "path-type": ["path-type@6.0.0", "", {}, "sha512-Vj7sf++t5pBD637NSfkxpHSMfWaeig5+DKWLhcqIYx6mWQz5hdJTGDVMQiJcw1ZYkhs7AazKDGpRVji1LJCZUQ=="], + + "pend": ["pend@1.2.0", "", {}, "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg=="], + + "picocolors": ["picocolors@1.1.1", "", {}, "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA=="], + + "picomatch": ["picomatch@2.3.1", "", {}, "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA=="], + + "pluralize": ["pluralize@8.0.0", "", {}, "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA=="], + + "prebuild-install": ["prebuild-install@7.1.3", "", { "dependencies": { "detect-libc": "^2.0.0", "expand-template": "^2.0.3", "github-from-package": "0.0.0", "minimist": "^1.2.3", "mkdirp-classic": "^0.5.3", "napi-build-utils": "^2.0.0", "node-abi": "^3.3.0", "pump": "^3.0.0", "rc": "^1.2.7", "simple-get": "^4.0.0", "tar-fs": "^2.0.0", "tunnel-agent": "^0.6.0" }, "bin": { "prebuild-install": "bin.js" } }, "sha512-8Mf2cbV7x1cXPUILADGI3wuhfqWvtiLA1iclTDbFRZkgRQS0NqsPZphna9V+HyTEadheuPmjaJMsbzKQFOzLug=="], + + "pump": ["pump@3.0.3", "", { "dependencies": { "end-of-stream": "^1.1.0", "once": "^1.3.1" } }, "sha512-todwxLMY7/heScKmntwQG8CXVkWUOdYxIvY2s0VWAAMh/nd8SoYiRaKjlr7+iCs984f2P8zvrfWcDDYVb73NfA=="], + + "punycode.js": ["punycode.js@2.3.1", "", {}, "sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA=="], + + "qs": ["qs@6.14.0", "", { "dependencies": { "side-channel": "^1.1.0" } }, "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w=="], + + "queue-microtask": ["queue-microtask@1.2.3", "", {}, "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A=="], + + "rc": ["rc@1.2.8", "", { "dependencies": { "deep-extend": "^0.6.0", "ini": "~1.3.0", "minimist": "^1.2.0", "strip-json-comments": "~2.0.1" }, "bin": { "rc": "./cli.js" } }, "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw=="], + + "rc-config-loader": ["rc-config-loader@4.1.3", "", { "dependencies": { "debug": "^4.3.4", "js-yaml": "^4.1.0", "json5": "^2.2.2", "require-from-string": "^2.0.2" } }, "sha512-kD7FqML7l800i6pS6pvLyIE2ncbk9Du8Q0gp/4hMPhJU6ZxApkoLcGD8ZeqgiAlfwZ6BlETq6qqe+12DUL207w=="], + + "read": ["read@1.0.7", "", { "dependencies": { "mute-stream": "~0.0.4" } }, "sha512-rSOKNYUmaxy0om1BNjMN4ezNT6VKK+2xF4GBhc81mkH7L60i6dp8qPYrkndNLT3QPphoII3maL9PVC9XmhHwVQ=="], + + "read-pkg": ["read-pkg@9.0.1", "", { "dependencies": { "@types/normalize-package-data": "^2.4.3", "normalize-package-data": "^6.0.0", "parse-json": "^8.0.0", "type-fest": "^4.6.0", "unicorn-magic": "^0.1.0" } }, "sha512-9viLL4/n1BJUCT1NXVTdS1jtm80yDEgR5T4yCelII49Mbj0v1rZdKqj7zCiYdbB0CuCgdrvHcNogAKTFPBocFA=="], + + "readable-stream": ["readable-stream@3.6.2", "", { "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", "util-deprecate": "^1.0.1" } }, "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA=="], + + "require-from-string": ["require-from-string@2.0.2", "", {}, "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw=="], + + "reusify": ["reusify@1.1.0", "", {}, "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw=="], + + "run-applescript": ["run-applescript@7.1.0", "", {}, "sha512-DPe5pVFaAsinSaV6QjQ6gdiedWDcRCbUuiQfQa2wmWV7+xC9bGulGI8+TdRmoFkAPaBXk8CrAbnlY2ISniJ47Q=="], + + "run-parallel": ["run-parallel@1.2.0", "", { "dependencies": { "queue-microtask": "^1.2.2" } }, "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA=="], + + "safe-buffer": ["safe-buffer@5.2.1", "", {}, "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="], + + "safer-buffer": ["safer-buffer@2.1.2", "", {}, "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="], + + "sax": ["sax@1.4.3", "", {}, "sha512-yqYn1JhPczigF94DMS+shiDMjDowYO6y9+wB/4WgO0Y19jWYk0lQ4tuG5KI7kj4FTp1wxPj5IFfcrz/s1c3jjQ=="], + + "secretlint": ["secretlint@10.2.2", "", { "dependencies": { "@secretlint/config-creator": "^10.2.2", "@secretlint/formatter": "^10.2.2", "@secretlint/node": "^10.2.2", "@secretlint/profiler": "^10.2.2", "debug": "^4.4.1", "globby": "^14.1.0", "read-pkg": "^9.0.1" }, "bin": "./bin/secretlint.js" }, "sha512-xVpkeHV/aoWe4vP4TansF622nBEImzCY73y/0042DuJ29iKIaqgoJ8fGxre3rVSHHbxar4FdJobmTnLp9AU0eg=="], + "semver": ["semver@7.7.3", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q=="], + "shebang-command": ["shebang-command@2.0.0", "", { "dependencies": { "shebang-regex": "^3.0.0" } }, "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA=="], + + "shebang-regex": ["shebang-regex@3.0.0", "", {}, "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A=="], + + "side-channel": ["side-channel@1.1.0", "", { "dependencies": { "es-errors": "^1.3.0", "object-inspect": "^1.13.3", "side-channel-list": "^1.0.0", "side-channel-map": "^1.0.1", "side-channel-weakmap": "^1.0.2" } }, "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw=="], + + "side-channel-list": ["side-channel-list@1.0.0", "", { "dependencies": { "es-errors": "^1.3.0", "object-inspect": "^1.13.3" } }, "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA=="], + + "side-channel-map": ["side-channel-map@1.0.1", "", { "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", "get-intrinsic": "^1.2.5", "object-inspect": "^1.13.3" } }, "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA=="], + + "side-channel-weakmap": ["side-channel-weakmap@1.0.2", "", { "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", "get-intrinsic": "^1.2.5", "object-inspect": "^1.13.3", "side-channel-map": "^1.0.1" } }, "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A=="], + + "signal-exit": ["signal-exit@4.1.0", "", {}, "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw=="], + + "simple-concat": ["simple-concat@1.0.1", "", {}, "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q=="], + + "simple-get": ["simple-get@4.0.1", "", { "dependencies": { "decompress-response": "^6.0.0", "once": "^1.3.1", "simple-concat": "^1.0.0" } }, "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA=="], + + "slash": ["slash@5.1.0", "", {}, "sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg=="], + + "slice-ansi": ["slice-ansi@4.0.0", "", { "dependencies": { "ansi-styles": "^4.0.0", "astral-regex": "^2.0.0", "is-fullwidth-code-point": "^3.0.0" } }, "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ=="], + + "spdx-correct": ["spdx-correct@3.2.0", "", { "dependencies": { "spdx-expression-parse": "^3.0.0", "spdx-license-ids": "^3.0.0" } }, "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA=="], + + "spdx-exceptions": ["spdx-exceptions@2.5.0", "", {}, "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w=="], + + "spdx-expression-parse": ["spdx-expression-parse@3.0.1", "", { "dependencies": { "spdx-exceptions": "^2.1.0", "spdx-license-ids": "^3.0.0" } }, "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q=="], + + "spdx-license-ids": ["spdx-license-ids@3.0.22", "", {}, "sha512-4PRT4nh1EImPbt2jASOKHX7PB7I+e4IWNLvkKFDxNhJlfjbYlleYQh285Z/3mPTHSAK/AvdMmw5BNNuYH8ShgQ=="], + + "sprintf-js": ["sprintf-js@1.0.3", "", {}, "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g=="], + + "string-width": ["string-width@4.2.3", "", { "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g=="], + + "string-width-cjs": ["string-width@4.2.3", "", { "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g=="], + + "string_decoder": ["string_decoder@1.3.0", "", { "dependencies": { "safe-buffer": "~5.2.0" } }, "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA=="], + + "strip-ansi": ["strip-ansi@7.1.2", "", { "dependencies": { "ansi-regex": "^6.0.1" } }, "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA=="], + + "strip-ansi-cjs": ["strip-ansi@6.0.1", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="], + + "strip-json-comments": ["strip-json-comments@2.0.1", "", {}, "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ=="], + + "structured-source": ["structured-source@4.0.0", "", { "dependencies": { "boundary": "^2.0.0" } }, "sha512-qGzRFNJDjFieQkl/sVOI2dUjHKRyL9dAJi2gCPGJLbJHBIkyOHxjuocpIEfbLioX+qSJpvbYdT49/YCdMznKxA=="], + + "supports-color": ["supports-color@7.2.0", "", { "dependencies": { "has-flag": "^4.0.0" } }, "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw=="], + + "supports-hyperlinks": ["supports-hyperlinks@3.2.0", "", { "dependencies": { "has-flag": "^4.0.0", "supports-color": "^7.0.0" } }, "sha512-zFObLMyZeEwzAoKCyu1B91U79K2t7ApXuQfo8OuxwXLDgcKxuwM+YvcbIhm6QWqz7mHUH1TVytR1PwVVjEuMig=="], + + "table": ["table@6.9.0", "", { "dependencies": { "ajv": "^8.0.1", "lodash.truncate": "^4.4.2", "slice-ansi": "^4.0.0", "string-width": "^4.2.3", "strip-ansi": "^6.0.1" } }, "sha512-9kY+CygyYM6j02t5YFHbNz2FN5QmYGv9zAjVp4lCDjlCw7amdckXlEt/bjMhUIfj4ThGRE4gCUH5+yGnNuPo5A=="], + "tar": ["tar@6.2.1", "", { "dependencies": { "chownr": "^2.0.0", "fs-minipass": "^2.0.0", "minipass": "^5.0.0", "minizlib": "^2.1.1", "mkdirp": "^1.0.3", "yallist": "^4.0.0" } }, "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A=="], + "tar-fs": ["tar-fs@2.1.4", "", { "dependencies": { "chownr": "^1.1.1", "mkdirp-classic": "^0.5.2", "pump": "^3.0.0", "tar-stream": "^2.1.4" } }, "sha512-mDAjwmZdh7LTT6pNleZ05Yt65HC3E+NiQzl672vQG38jIrehtJk/J3mNwIg+vShQPcLF/LV7CMnDW6vjj6sfYQ=="], + + "tar-stream": ["tar-stream@2.2.0", "", { "dependencies": { "bl": "^4.0.3", "end-of-stream": "^1.4.1", "fs-constants": "^1.0.0", "inherits": "^2.0.3", "readable-stream": "^3.1.1" } }, "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ=="], + + "terminal-link": ["terminal-link@4.0.0", "", { "dependencies": { "ansi-escapes": "^7.0.0", "supports-hyperlinks": "^3.2.0" } }, "sha512-lk+vH+MccxNqgVqSnkMVKx4VLJfnLjDBGzH16JVZjKE2DoxP57s6/vt6JmXV5I3jBcfGrxNrYtC+mPtU7WJztA=="], + + "text-table": ["text-table@0.2.0", "", {}, "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw=="], + + "textextensions": ["textextensions@6.11.0", "", { "dependencies": { "editions": "^6.21.0" } }, "sha512-tXJwSr9355kFJI3lbCkPpUH5cP8/M0GGy2xLO34aZCjMXBaK3SoPnZwr/oWmo1FdCnELcs4npdCIOFtq9W3ruQ=="], + + "tmp": ["tmp@0.2.5", "", {}, "sha512-voyz6MApa1rQGUxT3E+BK7/ROe8itEx7vD8/HEvt4xwXucvQ5G5oeEiHkmHZJuBO21RpOf+YYm9MOivj709jow=="], + + "to-regex-range": ["to-regex-range@5.0.1", "", { "dependencies": { "is-number": "^7.0.0" } }, "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ=="], + + "tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="], + + "tunnel": ["tunnel@0.0.6", "", {}, "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg=="], + + "tunnel-agent": ["tunnel-agent@0.6.0", "", { "dependencies": { "safe-buffer": "^5.0.1" } }, "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w=="], + + "type-fest": ["type-fest@4.41.0", "", {}, "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA=="], + + "typed-rest-client": ["typed-rest-client@1.8.11", "", { "dependencies": { "qs": "^6.9.1", "tunnel": "0.0.6", "underscore": "^1.12.1" } }, "sha512-5UvfMpd1oelmUPRbbaVnq+rHP7ng2cE4qoQkQeAqxRL6PklkxsM0g32/HL0yfvruK6ojQ5x8EE+HF4YV6DtuCA=="], + "typescript": ["typescript@5.9.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="], + "uc.micro": ["uc.micro@2.1.0", "", {}, "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A=="], + + "underscore": ["underscore@1.13.7", "", {}, "sha512-GMXzWtsc57XAtguZgaQViUOzs0KTkk8ojr3/xAxXLITqf/3EMwxC0inyETfDFjH/Krbhuep0HNbbjI9i/q3F3g=="], + + "undici": ["undici@7.16.0", "", {}, "sha512-QEg3HPMll0o3t2ourKwOeUAZ159Kn9mx5pnzHRQO8+Wixmh88YdZRiIwat0iNzNNXn0yoEtXJqFpyW7eM8BV7g=="], + "undici-types": ["undici-types@6.21.0", "", {}, "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ=="], + "unicorn-magic": ["unicorn-magic@0.3.0", "", {}, "sha512-+QBBXBCvifc56fsbuxZQ6Sic3wqqc3WWaqxs58gvJrcOuN83HGTCwz3oS5phzU9LthRNE9VrJCFCLUgHeeFnfA=="], + + "universalify": ["universalify@2.0.1", "", {}, "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw=="], + + "url-join": ["url-join@4.0.1", "", {}, "sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA=="], + + "util-deprecate": ["util-deprecate@1.0.2", "", {}, "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="], + + "uuid": ["uuid@8.3.2", "", { "bin": { "uuid": "dist/bin/uuid" } }, "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg=="], + + "validate-npm-package-license": ["validate-npm-package-license@3.0.4", "", { "dependencies": { "spdx-correct": "^3.0.0", "spdx-expression-parse": "^3.0.0" } }, "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew=="], + + "version-range": ["version-range@4.15.0", "", {}, "sha512-Ck0EJbAGxHwprkzFO966t4/5QkRuzh+/I1RxhLgUKKwEn+Cd8NwM60mE3AqBZg5gYODoXW0EFsQvbZjRlvdqbg=="], + "vscode-jsonrpc": ["vscode-jsonrpc@8.2.0", "", {}, "sha512-C+r0eKJUIfiDIfwJhria30+TYWPtuHJXHtI7J0YlOmKAo7ogxP20T0zxB7HZQIFhIyvoBPwWskjxrvAtfjyZfA=="], "vscode-languageclient": ["vscode-languageclient@9.0.1", "", { "dependencies": { "minimatch": "^5.1.0", "semver": "^7.3.7", "vscode-languageserver-protocol": "3.17.5" } }, "sha512-JZiimVdvimEuHh5olxhxkht09m3JzUGwggb5eRUkzzJhZ2KjCN0nh55VfiED9oez9DyF8/fz1g1iBV3h+0Z2EA=="], @@ -67,14 +626,104 @@ "vscode-languageserver-types": ["vscode-languageserver-types@3.17.5", "", {}, "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg=="], + "whatwg-encoding": ["whatwg-encoding@3.1.1", "", { "dependencies": { "iconv-lite": "0.6.3" } }, "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ=="], + + "whatwg-mimetype": ["whatwg-mimetype@4.0.0", "", {}, "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg=="], + "which": ["which@4.0.0", "", { "dependencies": { "isexe": "^3.1.1" }, "bin": { "node-which": "bin/which.js" } }, "sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg=="], + "wrap-ansi": ["wrap-ansi@8.1.0", "", { "dependencies": { "ansi-styles": "^6.1.0", "string-width": "^5.0.1", "strip-ansi": "^7.0.1" } }, "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ=="], + + "wrap-ansi-cjs": ["wrap-ansi@7.0.0", "", { "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" } }, "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q=="], + + "wrappy": ["wrappy@1.0.2", "", {}, "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="], + + "wsl-utils": ["wsl-utils@0.1.0", "", { "dependencies": { "is-wsl": "^3.1.0" } }, "sha512-h3Fbisa2nKGPxCpm89Hk33lBLsnaGBvctQopaBSOW/uIs6FTe1ATyAnKFJrzVs9vpGdsTe73WF3V4lIsk4Gacw=="], + + "xml2js": ["xml2js@0.5.0", "", { "dependencies": { "sax": ">=0.6.0", "xmlbuilder": "~11.0.0" } }, "sha512-drPFnkQJik/O+uPKpqSgr22mpuFHqKdbS835iAQrUC73L2F5WkboIRd63ai/2Yg6I1jzifPFKH2NTK+cfglkIA=="], + + "xmlbuilder": ["xmlbuilder@11.0.1", "", {}, "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA=="], + "yallist": ["yallist@4.0.0", "", {}, "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="], + "yauzl": ["yauzl@2.10.0", "", { "dependencies": { "buffer-crc32": "~0.2.3", "fd-slicer": "~1.1.0" } }, "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g=="], + + "yazl": ["yazl@2.5.1", "", { "dependencies": { "buffer-crc32": "~0.2.3" } }, "sha512-phENi2PLiHnHb6QBVot+dJnaAZ0xosj7p3fWl+znIjBDlnMI2PsZCJZ306BPTFOaHf5qdDEI8x5qFrSOBN5vrw=="], + + "@isaacs/cliui/string-width": ["string-width@5.1.2", "", { "dependencies": { "eastasianwidth": "^0.2.0", "emoji-regex": "^9.2.2", "strip-ansi": "^7.0.1" } }, "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA=="], + + "@secretlint/formatter/chalk": ["chalk@5.6.2", "", {}, "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA=="], + + "@textlint/linter-formatter/js-yaml": ["js-yaml@3.14.2", "", { "dependencies": { "argparse": "^1.0.7", "esprima": "^4.0.0" }, "bin": { "js-yaml": "bin/js-yaml.js" } }, "sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg=="], + + "@textlint/linter-formatter/pluralize": ["pluralize@2.0.0", "", {}, "sha512-TqNZzQCD4S42De9IfnnBvILN7HAW7riLqsCyp8lgjXeysyPlX5HhqKAcJHHHb9XskE4/a+7VGC9zzx8Ls0jOAw=="], + + "@textlint/linter-formatter/strip-ansi": ["strip-ansi@6.0.1", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="], + + "cross-spawn/which": ["which@2.0.2", "", { "dependencies": { "isexe": "^2.0.0" }, "bin": { "node-which": "./bin/node-which" } }, "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA=="], + "fs-minipass/minipass": ["minipass@3.3.6", "", { "dependencies": { "yallist": "^4.0.0" } }, "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw=="], + "glob/minimatch": ["minimatch@10.1.1", "", { "dependencies": { "@isaacs/brace-expansion": "^5.0.0" } }, "sha512-enIvLvRAFZYXJzkCYG5RKmPfrFArdLv+R+lbQ53BmIMLIry74bjKzX6iHAm8WYamJkhSSEabrWN5D97XnKObjQ=="], + + "glob/minipass": ["minipass@7.1.2", "", {}, "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw=="], + + "htmlparser2/entities": ["entities@6.0.1", "", {}, "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g=="], + "minizlib/minipass": ["minipass@3.3.6", "", { "dependencies": { "yallist": "^4.0.0" } }, "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw=="], + "normalize-package-data/hosted-git-info": ["hosted-git-info@7.0.2", "", { "dependencies": { "lru-cache": "^10.0.1" } }, "sha512-puUZAUKT5m8Zzvs72XWy3HtvVbTWljRE66cP60bxJzAqf2DgICo7lYTY2IHUmLnNpjYvw5bvmoHvPc0QO2a62w=="], + + "parse-semver/semver": ["semver@5.7.2", "", { "bin": { "semver": "bin/semver" } }, "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g=="], + + "parse5/entities": ["entities@6.0.1", "", {}, "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g=="], + + "path-scurry/lru-cache": ["lru-cache@11.2.2", "", {}, "sha512-F9ODfyqML2coTIsQpSkRHnLSZMtkU8Q+mSfcaIyKwy58u+8k5nvAYeiNhsyMARvzNcXJ9QfWVrcPsC9e9rAxtg=="], + + "path-scurry/minipass": ["minipass@7.1.2", "", {}, "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw=="], + + "read-pkg/unicorn-magic": ["unicorn-magic@0.1.0", "", {}, "sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ=="], + + "string-width/strip-ansi": ["strip-ansi@6.0.1", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="], + + "string-width-cjs/strip-ansi": ["strip-ansi@6.0.1", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="], + + "strip-ansi-cjs/ansi-regex": ["ansi-regex@5.0.1", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="], + + "table/strip-ansi": ["strip-ansi@6.0.1", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="], + "tar/minipass": ["minipass@5.0.0", "", {}, "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ=="], + + "tar-fs/chownr": ["chownr@1.1.4", "", {}, "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg=="], + + "vscode-languageclient/minimatch": ["minimatch@5.1.6", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g=="], + + "wrap-ansi/ansi-styles": ["ansi-styles@6.2.3", "", {}, "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg=="], + + "wrap-ansi/string-width": ["string-width@5.1.2", "", { "dependencies": { "eastasianwidth": "^0.2.0", "emoji-regex": "^9.2.2", "strip-ansi": "^7.0.1" } }, "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA=="], + + "wrap-ansi-cjs/strip-ansi": ["strip-ansi@6.0.1", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="], + + "@isaacs/cliui/string-width/emoji-regex": ["emoji-regex@9.2.2", "", {}, "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg=="], + + "@textlint/linter-formatter/js-yaml/argparse": ["argparse@1.0.10", "", { "dependencies": { "sprintf-js": "~1.0.2" } }, "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg=="], + + "@textlint/linter-formatter/strip-ansi/ansi-regex": ["ansi-regex@5.0.1", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="], + + "cross-spawn/which/isexe": ["isexe@2.0.0", "", {}, "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw=="], + + "normalize-package-data/hosted-git-info/lru-cache": ["lru-cache@10.4.3", "", {}, "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ=="], + + "string-width-cjs/strip-ansi/ansi-regex": ["ansi-regex@5.0.1", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="], + + "string-width/strip-ansi/ansi-regex": ["ansi-regex@5.0.1", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="], + + "table/strip-ansi/ansi-regex": ["ansi-regex@5.0.1", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="], + + "vscode-languageclient/minimatch/brace-expansion": ["brace-expansion@2.0.2", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ=="], + + "wrap-ansi-cjs/strip-ansi/ansi-regex": ["ansi-regex@5.0.1", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="], + + "wrap-ansi/string-width/emoji-regex": ["emoji-regex@9.2.2", "", {}, "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg=="], } } diff --git a/editors/vscode/package.json b/editors/vscode/package.json index 781c343..d525e3f 100644 --- a/editors/vscode/package.json +++ b/editors/vscode/package.json @@ -1,7 +1,7 @@ { "name": "codebook-vscode", - "displayName": "Codebook", - "description": "Spell checking for code via the Codebook language server.", + "displayName": "Codebook Spell Checker", + "description": "A fast, code-aware spell checker.", "version": "0.0.1", "publisher": "blopker", "license": "MIT", @@ -24,7 +24,6 @@ "workspace" ], "activationEvents": [ - "onCommand:codebook.restart", "onLanguage:c", "onLanguage:cpp", "onLanguage:css", @@ -51,7 +50,9 @@ "main": "./dist/extension.js", "scripts": { "build": "tsc -p .", - "watch": "tsc -w -p ." + "watch": "tsc -w -p .", + "package": "bun run build && vsce package --no-dependencies", + "publish": "bun run build && vsce publish --no-dependencies" }, "contributes": { "commands": [ @@ -75,7 +76,12 @@ }, "codebook.logLevel": { "type": "string", - "enum": ["error", "warn", "info", "debug"], + "enum": [ + "error", + "warn", + "info", + "debug" + ], "default": "info", "description": "Value assigned to the RUST_LOG environment variable for the language server." } @@ -94,6 +100,7 @@ "devDependencies": { "@types/node": "^20.12.7", "@types/vscode": "^1.80.0", + "@vscode/vsce": "^3.7.0", "typescript": "^5.4.0" } } diff --git a/editors/vscode/src/extension.ts b/editors/vscode/src/extension.ts index 6335791..cfea1ef 100644 --- a/editors/vscode/src/extension.ts +++ b/editors/vscode/src/extension.ts @@ -18,7 +18,7 @@ let refreshPromise: Promise = Promise.resolve(); const clients = new Map(); export async function activate( - context: vscode.ExtensionContext, + context: vscode.ExtensionContext ): Promise { contextRef = context; outputChannel = vscode.window.createOutputChannel("Codebook"); @@ -29,23 +29,23 @@ export async function activate( context.subscriptions.push( vscode.commands.registerCommand("codebook.restart", async () => { vscode.window.showInformationMessage( - "Restarting Codebook language server…", + "Restarting Codebook language server…" ); try { await queueRefresh(); vscode.window.showInformationMessage( - "Codebook language server restarted.", + "Codebook language server restarted." ); } catch (error) { vscode.window.showErrorMessage(`Failed to restart Codebook: ${error}`); } - }), + }) ); context.subscriptions.push( vscode.workspace.onDidChangeWorkspaceFolders(async () => { await queueRefresh(); - }), + }) ); context.subscriptions.push( @@ -54,7 +54,7 @@ export async function activate( event.affectsConfiguration("codebook.binaryPath") || event.affectsConfiguration("codebook.enablePrerelease"); const forceDownload = event.affectsConfiguration( - "codebook.enablePrerelease", + "codebook.enablePrerelease" ); if ( @@ -64,7 +64,7 @@ export async function activate( ) { await queueRefresh({ forceDownload, invalidateCache }); } - }), + }) ); await queueRefresh(); @@ -105,7 +105,7 @@ async function refreshClients(options: RefreshOptions = {}): Promise { async function startClient( folder: vscode.WorkspaceFolder | undefined, - binaryPath: string, + binaryPath: string ): Promise { const key = folder?.uri.toString() ?? DEFAULT_CLIENT_KEY; if (clients.has(key)) { @@ -118,7 +118,7 @@ async function startClient( const args = [`--root=${root}`, "serve"]; outputChannel.appendLine( - `Starting Codebook (${args.join(" ")}) for ${folder?.name ?? root}`, + `Starting Codebook (${args.join(" ")}) for ${folder?.name ?? root}` ); const serverOptions: ServerOptions = { @@ -155,7 +155,7 @@ async function startClient( `codebook-${key}`, "Codebook", serverOptions, - clientOptions, + clientOptions ); clients.set(key, client); contextRef.subscriptions.push(client); From a5a09dd0374c79c636091bb1d7ef6782c5b5f8b3 Mon Sep 17 00:00:00 2001 From: Bo Lopker Date: Tue, 18 Nov 2025 22:01:46 -0800 Subject: [PATCH 5/5] Add WIP readme notice --- README.md | 42 +++++++++++++++++++++------------------- editors/vscode/README.md | 4 +++- 2 files changed, 25 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 3680c21..78fc14b 100644 --- a/README.md +++ b/README.md @@ -24,26 +24,6 @@ Please give a ⭐ if you find Codebook useful! ## Integrations -### VS Code - -An official VS Code extension lives in `editors/vscode`. The extension manages -the `codebook-lsp` binary for you, starts it with the right flags, and exposes a -few configuration toggles (`codebook.binaryPath`, `codebook.enablePrerelease`, -and `codebook.logLevel`). - -To try it locally: - -```sh -cd editors/vscode -bun install # or npm install -bun run build -bun run package # or npm run package -code --install-extension codebook-vscode-*.vsix -``` - -Once the extension is installed it will activate automatically for every -supported language. - ### Zed Codebook is the most popular spell checker for Zed! To install, go to the Extension tab in Zed and look for "Codebook". Done! @@ -108,6 +88,28 @@ Then, add the following to your Neovim configuration: vim.lsp.enable('cookbook') ``` +### VS Code (Unreleased) + +A VS Code extension lives in `editors/vscode`. The extension manages +the `codebook-lsp` binary for you, starts it with the right flags, and exposes a +few configuration toggles (`codebook.binaryPath`, `codebook.enablePrerelease`, +and `codebook.logLevel`). + +To try it locally: + +```sh +cd editors/vscode +bun install # or npm install +bun run build +bun run package # or npm run package +code --install-extension codebook-vscode-*.vsix +``` + +Once the extension is installed it will activate automatically for every +supported language. + +**Note**: This extension is a work in progress and is not in the Marketplace yet. If you try it out, we'd love feedback! + ### Other Editors Any editor that implements the Language Server Protocol should be compatible with Codebook. To get started, follow the [installation instructions](#installation), then consult your editor's documentation to learn how to configure and enable a new language server. For your reference, the following command starts the server such that it listens on `STDIN` and emits on `STDOUT`: diff --git a/editors/vscode/README.md b/editors/vscode/README.md index adf2de3..a0929ec 100644 --- a/editors/vscode/README.md +++ b/editors/vscode/README.md @@ -1,4 +1,6 @@ -# Codebook VS Code Extension +# Codebook VS Code Extension (Unreleased) + +**Note** This extension is a work in progress and is not released on the VS Code marketplace yet. However, it is functional. Follow the Development instructions to install if you'd like to provide feedback! This extension wires the Codebook language server into VS Code so code-specific spell check diagnostics and quick fixes appear automatically.