diff --git a/.github/workflows/respond-to-cubic.yaml b/.github/workflows/respond-to-cubic.yaml deleted file mode 100644 index 252c2538c..000000000 --- a/.github/workflows/respond-to-cubic.yaml +++ /dev/null @@ -1,302 +0,0 @@ -name: Respond to @continuedev Comments - -on: - issue_comment: - types: [created] - pull_request_review_comment: - types: [created] - -permissions: - contents: write - pull-requests: write - issues: write - -jobs: - respond-to-comment: - # Only run on pull request comments - if: github.event_name == 'issue_comment' && github.event.issue.pull_request - runs-on: ubuntu-latest - - steps: - - name: Check if comment contains @continuedev - id: check-mention - run: | - # Create a temporary file to safely handle comment body with special characters - cat > /tmp/comment.txt << 'COMMENT_EOF' - ${{ github.event.comment.body }} - COMMENT_EOF - - if grep -q "@continuedev" /tmp/comment.txt; then - echo "contains_mention=true" >> $GITHUB_OUTPUT - else - echo "contains_mention=false" >> $GITHUB_OUTPUT - fi - - - name: Add eyes reaction to comment - if: steps.check-mention.outputs.contains_mention == 'true' - uses: actions/github-script@v8 - with: - script: | - await github.rest.reactions.createForIssueComment({ - owner: context.repo.owner, - repo: context.repo.repo, - comment_id: ${{ github.event.comment.id }}, - content: 'eyes' - }); - - - name: Checkout PR branch - if: steps.check-mention.outputs.contains_mention == 'true' - uses: actions/checkout@v5 - with: - token: ${{ secrets.GITHUB_TOKEN }} - fetch-depth: 0 - - - name: Get PR information - if: steps.check-mention.outputs.contains_mention == 'true' - id: pr-info - uses: actions/github-script@v8 - with: - script: | - const { data: pr } = await github.rest.pulls.get({ - owner: context.repo.owner, - repo: context.repo.repo, - pull_number: context.issue.number - }); - - core.setOutput('head_ref', pr.head.ref); - core.setOutput('head_sha', pr.head.sha); - return pr; - - - name: Checkout PR branch - if: steps.check-mention.outputs.contains_mention == 'true' - run: | - git checkout ${{ steps.pr-info.outputs.head_ref }} - - - name: Setup Node.js - if: steps.check-mention.outputs.contains_mention == 'true' - uses: actions/setup-node@v5 - with: - node-version: "20" - - - name: Install Continue CLI globally - if: steps.check-mention.outputs.contains_mention == 'true' - run: npm i -g @continuedev/cli - - - name: Start remote session - if: steps.check-mention.outputs.contains_mention == 'true' - id: remote-session - env: - CONTINUE_API_KEY: ${{ secrets.CONTINUE_API_KEY }} - run: | - # Create a temporary file for the prompt to handle special characters and newlines properly - cat > /tmp/prompt.txt << 'PROMPT_EOF' - Please help with the following request from @${{ github.event.comment.user.login }} on PR #${{ github.event.issue.number }}: - - ${{ github.event.comment.body }} - - Please analyze the current PR, understand the request, implement the necessary changes, and commit them to this branch. - PROMPT_EOF - - # Debug output - echo "PROMPT content:" - cat /tmp/prompt.txt - - # Start remote session and capture JSON output - echo "Starting cn with prompt..." - SESSION_OUTPUT=$(cat /tmp/prompt.txt | cn remote -s --config continuedev/address-code-review --branch ${{ steps.pr-info.outputs.head_ref }}) - echo "Raw session output: $SESSION_OUTPUT" - - # Extract URL from JSON output - SESSION_URL=$(echo "$SESSION_OUTPUT" | jq -r '.url // empty') - - if [ -z "$SESSION_URL" ] || [ "$SESSION_URL" = "null" ]; then - echo "Failed to extract session URL from output: $SESSION_OUTPUT" - exit 1 - fi - - echo "session_url=$SESSION_URL" >> $GITHUB_OUTPUT - echo "✅ Started remote session: $SESSION_URL" - - - name: Comment with session URL - if: steps.check-mention.outputs.contains_mention == 'true' && steps.remote-session.outputs.session_url - uses: actions/github-script@v8 - env: - ORIGINAL_COMMENT: ${{ github.event.comment.body }} - with: - script: | - const sessionUrl = '${{ steps.remote-session.outputs.session_url }}'; - const originalComment = process.env.ORIGINAL_COMMENT; - const commentBody = "I've started [a remote session](" + sessionUrl + ") to help with your request:\n> " + originalComment; - - await github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - body: commentBody - }); - - - name: Log session details - if: steps.check-mention.outputs.contains_mention == 'true' - run: | - echo "✅ Successfully started remote session for comment from ${{ github.event.comment.user.login }} on PR #${{ github.event.issue.number }}" - echo "Session URL: ${{ steps.remote-session.outputs.session_url }}" - echo "Original comment:" - cat /tmp/comment.txt - - respond-to-review-comment: - # Only run on pull request review comments - if: github.event_name == 'pull_request_review_comment' - runs-on: ubuntu-latest - - steps: - - name: Check if comment contains @continuedev - id: check-mention - run: | - # Create a temporary file to safely handle comment body with special characters - cat > /tmp/review_comment.txt << 'COMMENT_EOF' - ${{ github.event.comment.body }} - COMMENT_EOF - - if grep -q "@continuedev" /tmp/review_comment.txt; then - echo "contains_mention=true" >> $GITHUB_OUTPUT - else - echo "contains_mention=false" >> $GITHUB_OUTPUT - fi - - - name: Add eyes reaction to comment - if: steps.check-mention.outputs.contains_mention == 'true' - uses: actions/github-script@v8 - with: - script: | - await github.rest.reactions.createForPullRequestReviewComment({ - owner: context.repo.owner, - repo: context.repo.repo, - comment_id: ${{ github.event.comment.id }}, - content: 'eyes' - }); - - - name: Checkout PR branch - if: steps.check-mention.outputs.contains_mention == 'true' - uses: actions/checkout@v5 - with: - token: ${{ secrets.GITHUB_TOKEN }} - fetch-depth: 0 - ref: ${{ github.event.pull_request.head.ref }} - - - name: Setup Node.js - if: steps.check-mention.outputs.contains_mention == 'true' - uses: actions/setup-node@v5 - with: - node-version: "20" - - - name: Install Continue CLI globally - if: steps.check-mention.outputs.contains_mention == 'true' - run: npm i -g @continuedev/cli - - - name: Get review context - if: steps.check-mention.outputs.contains_mention == 'true' - id: review-context - uses: actions/github-script@v8 - with: - script: | - let reviewContext = ''; - - // Check if this comment is a reply to another review comment - if (context.payload.comment.in_reply_to_id) { - try { - const { data: originalComment } = await github.rest.pulls.getReviewComment({ - owner: context.repo.owner, - repo: context.repo.repo, - comment_id: context.payload.comment.in_reply_to_id - }); - - reviewContext = `**Original review comment by @${originalComment.user.login}:** - ${originalComment.body} - - **Reply by @${{ github.event.comment.user.login }}:** - ${{ github.event.comment.body }}`; - } catch (error) { - console.log('Could not fetch original comment, using current comment only'); - reviewContext = `**Review comment by @${{ github.event.comment.user.login }}:** - ${{ github.event.comment.body }}`; - } - } else { - reviewContext = `**Review comment by @${{ github.event.comment.user.login }}:** - ${{ github.event.comment.body }}`; - } - - core.setOutput('context', reviewContext); - - - name: Start remote session - if: steps.check-mention.outputs.contains_mention == 'true' - id: remote-session - env: - CONTINUE_API_KEY: ${{ secrets.CONTINUE_API_KEY }} - run: | - # Debug: Echo the branch we're starting the session on - echo "Starting remote session on branch: ${{ github.event.pull_request.head.ref }}" - - # Create a temporary file for the prompt to handle special characters and newlines properly - cat > /tmp/prompt.txt << 'PROMPT_EOF' - Please help with the following code review discussion from PR #${{ github.event.pull_request.number }}: - - **File:** ${{ github.event.comment.path }} - **Line:** ${{ github.event.comment.line || github.event.comment.original_line || 'N/A' }} - - ${{ steps.review-context.outputs.context }} - - Please analyze the specific file and line mentioned, understand the review feedback and any discussion context, implement the necessary changes, and commit them to this branch. - PROMPT_EOF - - # Debug output - echo "PROMPT content:" - cat /tmp/prompt.txt - - # Start remote session and capture JSON output - echo "Starting cn with prompt..." - SESSION_OUTPUT=$(cat /tmp/prompt.txt | cn remote -s --config continuedev/address-code-review --branch ${{ github.event.pull_request.head.ref }}) - echo "Raw session output: $SESSION_OUTPUT" - - # Extract URL from JSON output - SESSION_URL=$(echo "$SESSION_OUTPUT" | jq -r '.url // empty') - - if [ -z "$SESSION_URL" ] || [ "$SESSION_URL" = "null" ]; then - echo "Failed to extract session URL from output: $SESSION_OUTPUT" - exit 1 - fi - - echo "session_url=$SESSION_URL" >> $GITHUB_OUTPUT - echo "✅ Started remote session: $SESSION_URL" - - - name: Comment with session URL - if: steps.check-mention.outputs.contains_mention == 'true' && steps.remote-session.outputs.session_url - uses: actions/github-script@v8 - env: - ORIGINAL_COMMENT: ${{ github.event.comment.body }} - with: - script: | - const sessionUrl = '${{ steps.remote-session.outputs.session_url }}'; - const originalComment = process.env.ORIGINAL_COMMENT; - const commentBody = "I've started [a remote session](" + sessionUrl + ") to help with your request:\n> " + originalComment; - - const commentParams = { - owner: context.repo.owner, - repo: context.repo.repo, - pull_number: ${{ github.event.pull_request.number }}, - body: commentBody, - commit_id: '${{ github.event.pull_request.head.sha }}', - path: '${{ github.event.comment.path }}', - in_reply_to: ${{ github.event.comment.id }} - }; - - await github.rest.pulls.createReviewComment(commentParams); - - - name: Log session details - if: steps.check-mention.outputs.contains_mention == 'true' - run: | - echo "✅ Successfully started remote session for review comment from ${{ github.event.comment.user.login }} on PR #${{ github.event.pull_request.number }}" - echo "Session URL: ${{ steps.remote-session.outputs.session_url }}" - echo "File: ${{ github.event.comment.path }}" - echo "Line: ${{ github.event.comment.line }}" - echo "Original comment:" - cat /tmp/review_comment.txt diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 000000000..4526a3f3f --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1 @@ +npx lint-staged --no-install diff --git a/.prettierignore b/.prettierignore index cd8b968db..7b9235d9f 100644 --- a/.prettierignore +++ b/.prettierignore @@ -11,9 +11,13 @@ extensions/vscode/.vscode-test extensions/vscode/bin extensions/vscode/build extensions/vscode/out +extensions/vscode/textmate-syntaxes extensions/vscode/gui extensions/vscode/e2e/.test-extensions extensions/vscode/e2e/test-continue +extensions/vscode/e2e/_output +extensions/vscode/e2e/storage +extensions/vscode/e2e/vsix extensions/vscode/models extensions/intellij/src/main/resources gui/dist @@ -26,4 +30,5 @@ CHANGELOG.md core/vendor coverage # e2e -packages/continue-sdk \ No newline at end of file +packages/continue-sdk +.conductor \ No newline at end of file diff --git a/core/config/markdown/utils.ts b/core/config/markdown/utils.ts index 5fbade09b..df64a75be 100644 --- a/core/config/markdown/utils.ts +++ b/core/config/markdown/utils.ts @@ -4,6 +4,15 @@ import { } from "@continuedev/config-yaml"; import { joinPathsToUri } from "../../util/uri"; +function createRelativeRuleFilePathParts(ruleName: string): string[] { + const safeRuleName = sanitizeRuleName(ruleName); + return [".continue", "rules", `${safeRuleName}.${RULE_FILE_EXTENSION}`]; +} + +export function createRelativeRuleFilePath(ruleName: string): string { + return createRelativeRuleFilePathParts(ruleName).join("/"); +} + /** * Creates the file path for a rule in the workspace .continue/rules directory */ @@ -11,11 +20,8 @@ export function createRuleFilePath( workspaceDir: string, ruleName: string, ): string { - const safeRuleName = sanitizeRuleName(ruleName); return joinPathsToUri( workspaceDir, - ".continue", - "rules", - `${safeRuleName}.${RULE_FILE_EXTENSION}`, + ...createRelativeRuleFilePathParts(ruleName), ); } diff --git a/core/llm/index.ts b/core/llm/index.ts index a634fc5d6..ecb43bfca 100644 --- a/core/llm/index.ts +++ b/core/llm/index.ts @@ -213,7 +213,7 @@ export abstract class BaseLLM implements ILLM { this.providerName === "continue-proxy" ? this.model?.split("/").pop() || this.model : this.model; - const llmInfo = findLlmInfo(modelSearchString); + const llmInfo = findLlmInfo(modelSearchString, this.underlyingProviderName); const templateType = options.template ?? autodetectTemplateType(options.model); diff --git a/core/package-lock.json b/core/package-lock.json index 109605f18..974572995 100644 --- a/core/package-lock.json +++ b/core/package-lock.json @@ -202,7 +202,7 @@ }, "../packages/llm-info": { "name": "@continuedev/llm-info", - "version": "1.0.9", + "version": "1.0.10", "license": "Apache-2.0", "devDependencies": { "@semantic-release/changelog": "^6.0.3", @@ -16364,9 +16364,9 @@ } }, "node_modules/prebuild-install/node_modules/tar-fs": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.3.tgz", - "integrity": "sha512-090nwYJDmlhwFwEW3QQl+vaNnxsO2yVsd45eTKRBzSzu+hlb1w2K9inVq5b0ngXuLVqQ4ApvsUHHnu/zQNkWAg==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.4.tgz", + "integrity": "sha512-mDAjwmZdh7LTT6pNleZ05Yt65HC3E+NiQzl672vQG38jIrehtJk/J3mNwIg+vShQPcLF/LV7CMnDW6vjj6sfYQ==", "license": "MIT", "dependencies": { "chownr": "^1.1.1", @@ -18323,9 +18323,9 @@ } }, "node_modules/tar-fs": { - "version": "3.0.9", - "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.0.9.tgz", - "integrity": "sha512-XF4w9Xp+ZQgifKakjZYmFdkLoSWd34VGKcsTCwlNWM7QG3ZbaxnTsaBwnjFZqHRf/rROxaR8rXnbtwdvaDI+lA==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.1.1.tgz", + "integrity": "sha512-LZA0oaPOc2fVo82Txf3gw+AkEd38szODlptMYejQUhndHMLQ9M059uXR+AfS7DNo0NpINvSqDsvyaCrBVkptWg==", "license": "MIT", "dependencies": { "pump": "^3.0.0", diff --git a/docs/cli/install.mdx b/docs/cli/install.mdx new file mode 100644 index 000000000..d9d0db43a --- /dev/null +++ b/docs/cli/install.mdx @@ -0,0 +1,134 @@ +--- +title: "Install Continue CLI" +description: "Get Continue CLI installed and configured for command-line AI coding assistance and automation" +sidebarTitle: "Install" +--- + + + Make sure you have [Node.js 18 or higher + installed](https://nodejs.org/en/download/). + + +## Installation + +Install Continue CLI globally using npm: + +```bash +npm i -g @continuedev/cli +``` + +## Two Ways to Use Continue CLI + + + **Quick Overview**: Continue CLI works in two modes - TUI for interactive + conversations or headless for automated commands. + + + + +**Interactive development sessions** + +Start a conversation with AI in your terminal: + +```bash +cn +> @src/app.js Generate unit tests for this component +``` + +Perfect for exploration, debugging, and iterative development. + + + + +**Automation and scripting** + +Single commands that return results: + +```bash +cn -p "Generate a commit message for current changes" +cn -p "Review the last 5 commits for issues" +``` + +Perfect for CI/CD, git hooks, and automated workflows. + + + + +## Setup + + + + +For interactive development and exploration: + + + +```bash +cn login +``` +This will open your browser to authenticate with Continue Hub. + + + +Start an interactive session: +```bash +cn +``` + +Try asking a question: + +``` +> Tell me about the CLI +``` + + + + + + +For automation workflows and scripting: + + + +For automation workflows, get an API key: +1. Visit [Continue Hub API Keys](https://hub.continue.dev/settings/api-keys) +2. Click **"+ New API Key"** +3. Copy the API key immediately (you won't see it again!) +4. Login using your Continue account + + + +Store secure credentials for CLI workflows: +1. Visit [Continue Hub Secrets](https://hub.continue.dev/settings/secrets) +2. Add your API keys and sensitive data +3. Reference in configurations with `${{ secrets.SECRET_NAME }}` + + + +Try headless mode for automation: +```bash +cn -p "Generate a conventional commit message for the current git changes" +``` + + + + + +## What's Next? + + + + Learn basic usage with practical examples + + + + Build automated workflows with Continue CLI + + + +## Getting Help + +If you encounter issues: + +- Ask for help in [our discussions](https://github.com/continuedev/continue/discussions) +- Report bugs on [GitHub](https://github.com/continuedev/continue) diff --git a/docs/cli/overview.mdx b/docs/cli/overview.mdx new file mode 100644 index 000000000..a94bfdce5 --- /dev/null +++ b/docs/cli/overview.mdx @@ -0,0 +1,228 @@ +--- +title: "Continue CLI (cn) Overview" +description: "Command-line interface for automated coding tasks, scripting, and headless development workflows with Continue's AI coding capabilities" +sidebarTitle: "Overview" +--- + + + + + +**Continue enables developers to ship faster with Continuous AI.** + + + Build features from descriptions. Debug and fix issues. Navigate any codebase. + Automate tedious tasks. + + +## Get started in 30 seconds + +Prerequisites: + +- [Node.js 18 or newer](https://nodejs.org/en/download/) +- A [Continue Hub](https://hub.continue.dev) account (recommended) or local configuration + +```bash npm +# Install Continue CLI +npm install -g @continuedev/cli + +# Navigate to your project + +cd your-awesome-project + +# Start coding with Continue + +cn + +# You'll be prompted to set up on first use + +``` + +That's it! You're ready to start automating with Continue CLI. + +[Continue with CLI Quickstart →](/cli/quick-start) + +## Two Ways to Use Continue CLI + +Continue CLI offers two distinct modes designed for different workflows: + +### TUI Mode: Interactive Development + +**Perfect for exploration, debugging, and iterating on AI workflows** + +```bash +cn +> @src/components/UserProfile.js Review this component for security issues +> Generate comprehensive unit tests +> Suggest performance improvements +``` + +- **Interactive conversations** with your codebase +- **Iterate and refine** prompts and approaches +- **Explore and understand** complex codebases +- **Perfect for experimentation** and learning + +### Headless Mode: Production Automation + +**Perfect for CI/CD, automation, and reliable workflows** + +```bash +cn -p "Generate a conventional commit message for staged changes" +cn -p "Review pull request changes for security vulnerabilities" +cn -p "Update documentation based on recent code changes" +``` + +- **Single-command execution** for automation +- **Reliable, repeatable results** for production use +- **CI/CD and pipeline integration** +- **Git hooks and automated workflows** + +### Development Workflow: TUI → Headless + + + **Pro Tip**: Start in TUI mode to iterate on your AI agent and prompts. Once + you have a workflow that works reliably, deploy it as a Continuous AI + automation. + + +1. **Experiment in TUI mode** to perfect your prompts and agent configuration +2. **Test different approaches** interactively until you get consistent results +3. **Convert successful workflows** to automated Continuous AI commands +4. **Deploy in production** with confidence in your proven approach + +## Why developers love Continue CLI + +- **Works in your terminal**: Not another chat window. Not another IDE. Continue CLI meets you where you already work, with the tools you already love. +- **Takes action**: Continue CLI can directly edit files, run commands, and create commits. Need more? Check out our [MCPs](/customize/deep-dives/mcp). +- **Automate tasks**: Create issues from PostHog data, automatically assign labels to issues, and more. Do all this in a single command from your developer machines, or automatically in CI. +- **Flexible development flow**: Start interactive, then automate proven workflows. + +## Key Capabilities + +### Context Engineering + +- Use `@` to reference files and provide context +- Use `/` to run slash commands for specific tasks +- Access the same context providers as IDE extensions + +### Tool Integration + +- File editing and creation +- Terminal command execution +- Codebase understanding and analysis +- Git integration +- Web search and documentation access + +### Model Flexibility + +- Switch between models with `/model` command +- Use any model configured in your `config.yaml` +- Access Continue Hub models and configurations + +## Continue Hub Integration + +Continue CLI integrates seamlessly with [Continue Hub](https://hub.continue.dev) for: + +### API Access + +Get an API key for automation workflows: + +1. Visit [Continue Hub API Keys](https://hub.continue.dev/settings/api-keys) +2. Create a new API key +3. Use with `cn login` or in your automation scripts + +### Secrets Management + +Store secure credentials for CLI workflows: + +1. Visit [Continue Hub Secrets](https://hub.continue.dev/settings/secrets) +2. Add your API keys and sensitive data +3. Reference in configurations with `${{ secrets.SECRET_NAME }}` + +### Configuration Sync + +- Cloud-managed configurations automatically sync +- Share configurations across team members +- Version control for your AI workflows + +## Common Use Cases + +### TUI Mode Examples + +**Interactive development and exploration:** + + +```bash Codebase Exploration +# Start interactive session +cn +> @src/components Find all unused React components +> /explain How does authentication work in this codebase? +> @auth/ What security patterns are used here? +``` + +```bash Iterative Debugging +# Debug issues interactively +cn +> @tests/auth.test.js This test is failing, help me understand why +> @src/auth/middleware.js Let's examine this middleware +> /debug What could be causing the timeout error? +``` + +```bash Workflow Development +# Develop and test automation workflows +cn +> @package.json @CHANGELOG.md Generate a release notes template +> # Test and refine the approach +> # Once working, convert to: cn -p "Generate release notes" +``` + + + +### Headless Mode Examples + +**Production automation and scripting:** + + +```bash Git Automation +# Generate commit messages +cn -p "Generate a conventional commit message for the current changes" + +# Code review automation + +cn -p "Review the current git changes for bugs and suggest improvements" + +```` + +```bash CI/CD Integration +# In your pipeline scripts +cn -p "Analyze test failures and suggest fixes" + +# Automated documentation updates +cn -p "@README.md Update this documentation based on recent changes" +```` + +```bash Issue Management +# Create GitHub issues from PostHog data +cn -p "@posthog-data.json Create GitHub issues for UX problems found in this session data" + +# Automated security audits +cn -p "Scan the codebase for potential security vulnerabilities" +``` + + + +## Next steps + + + + Learn basic commands and common workflows + + + + Install Continue CLI and set up your environment + + + + Task-specific tutorials and examples + + diff --git a/docs/cli/quick-start.mdx b/docs/cli/quick-start.mdx new file mode 100644 index 000000000..79a481ecd --- /dev/null +++ b/docs/cli/quick-start.mdx @@ -0,0 +1,176 @@ +--- +title: "Continue CLI Quick Start" +description: "Get hands-on experience with Continue CLI through practical examples and common use cases" +sidebarTitle: "Quick Start" +--- + +Get hands-on experience with Continue CLI through practical development workflows. + + + + TUI Mode (`cn` command) is for **large development tasks** that require + agentic workflows with human oversight. Perfect for complex refactors, + feature implementation, or one-off automation tasks that need monitoring and + iteration. + + + Headless Mode (`-p` flag) is for **reliable, repeatable tasks** that no + longer need constant supervision. Perfect for CI/CD pipelines, git hooks, + and automated workflows you've already tested and refined. + + + +## TUI Mode: Large Development Tasks + +Make sure you have [Continue CLI installed](/cli/install) and are in a project directory. + +### Example: Implementing a New Feature + +```bash +# Navigate to your project directory +cd your-awesome-project + +# Start TUI Mode for complex development work +cn +``` + +**Example workflow for adding authentication:** + +``` +> I need to add JWT authentication to this Express app. Let me start by showing you the current structure. + +> @src/app.js @package.json Here's my current setup. Can you implement JWT auth with middleware, login/register routes, and user model? + +> [Agent analyzes codebase and implements auth system] +> [You review changes, test, and provide feedback] +> [Agent iterates based on your input until the feature is complete] +``` + +### Example: Complex Refactoring + +```bash +cn +``` + +**Refactoring a monolithic component:** + +``` +> @src/components/Dashboard.jsx This component is 800 lines and does too much. Help me break it into smaller, reusable components. + +> [Agent analyzes component structure] +> [Proposes component breakdown strategy] +> [You approve approach] +> [Agent implements the refactor with proper props and state management] +> [You test and request adjustments] +``` + +### When to Use TUI Mode + +✅ **Large development tasks** that need oversight +✅ **Complex refactors** requiring multiple steps +✅ **New feature implementation** with unknowns +✅ **One-off automation tasks** you haven't done before +✅ **Debugging complex issues** that need exploration + +## Headless Mode: Automated Workflows + +Once you've refined a workflow in TUI Mode, convert it to Continuous AI for automation. + +### Example: From REPL → Continuous AI + +**Step 1: Develop in TUI Mode** + +```bash +cn +> @package.json @CHANGELOG.md Generate release notes for version 2.1.0 +> [Test and refine the prompt until it works perfectly] +``` + +**Step 2: Convert to Continuous AI** + +```bash +# Now use the refined workflow in automation +cn -p "Generate release notes for the current version based on package.json and recent commits" +``` + +### Common Continuous AI Workflows + +```bash +# Git automation +cn -p "Generate a conventional commit message for staged changes" +cn -p "Review the last 3 commits for potential issues" + +# Code quality +cn -p "Fix all TypeScript errors in the src/ directory" +cn -p "Update outdated dependencies and fix breaking changes" + +# Documentation +cn -p "@README.md Update documentation based on recent changes" +cn -p "Generate API documentation from JSDoc comments" + +# CI/CD integration +cn -p "Analyze test failures and create GitHub issue with findings" +cn -p "Update version numbers and create release branch" +``` + +### When to Use Headless Mode + +✅ **Proven workflows** you've tested in TUI Mode +✅ **Repetitive tasks** that no longer need oversight +✅ **CI/CD automation** in pipelines +✅ **Git hooks** for automated checks +✅ **Scheduled tasks** that run unattended + +### Available Slash Commands + +Common slash commands available in CLI: + +- `/clear` - Clear the chat history +- `/compact` - Summarize chat history into a compact form +- `/config` - Switch configuration or organization +- `/exit` - Exit the chat +- `/fork` - Start a forked chat session from the current history +- `/help` - Show help message +- `/info` - Show session information +- `/init` - Create an AGENTS.md file +- `/login` - Authenticate with your account +- `/logout` - Sign out of your current session +- `/mcp` - Manage MCP server connections +- `/model` - Switch between available chat models +- `/resume` - Resume a previous chat session +- `/whoami` - Check who you're currently logged in as + +Use `/help` to see all available commands. + +## The Development Workflow + + + **Recommended Approach**: Start complex tasks in TUI Mode to iterate and + refine your approach. Once you have a reliable workflow, convert it to + Headless Mode for automation. + + +### Workflow Pattern + +1. **🔬 Experiment in TUI Mode** + + - Try complex development tasks with human oversight + - Iterate on prompts and approaches until they work reliably + - Test edge cases and refine the agent's behavior + +2. **⚡ Automate with Continuous AI** + - Convert proven REPL workflows to single commands + - Deploy in CI/CD, git hooks, or scheduled tasks + - Run with confidence knowing the approach is tested + +## Next Steps + + + + Build an automated PostHog to GitHub issues workflow + + + + Learn to build and deploy AI-powered development workflows + + diff --git a/docs/docs.json b/docs/docs.json index f3e932b50..56c6e2303 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -23,6 +23,11 @@ "getting-started/quick-start" ] }, + { + "group": "CLI", + "icon": "terminal", + "pages": ["cli/overview", "cli/install", "cli/quick-start"] + }, { "group": "Features", "icon": "star", diff --git a/docs/images/cn-demo.gif b/docs/images/cn-demo.gif index 795be614d..4b37b3f77 100644 Binary files a/docs/images/cn-demo.gif and b/docs/images/cn-demo.gif differ diff --git a/docs/index.mdx b/docs/index.mdx index 4df6c30cc..52c753c11 100644 --- a/docs/index.mdx +++ b/docs/index.mdx @@ -1,55 +1,148 @@ --- -title: "Introduction" +title: "Welcome to Continue" icon: book-open -description: "Continue is an open source platform for building AI-powered coding assistants with customizable components for chat, autocomplete, edit, and agent workflows in VS Code and JetBrains IDEs" +description: "Practice Continuous AI with an open-source CLI, open-source IDE extensions, and a Hub for custom AI coding agents" --- -**Continue enables developers to ship faster with Continuous AI.** + + **Build faster with AI across your IDE, terminal, and CI/CD pipelines with + Continue.** + -**You can use Continue to build and run custom agents across your IDE, terminal, and CI.** +## Continue CLI -1. Get started with Continue in [VS Code](https://marketplace.visualstudio.com/items?itemName=Continue.continue) or [JetBrains](https://plugins.jetbrains.com/plugin/22707-continue-extension) extensions +Terminal-native AI coding assistance with TUI and headless modes. -2. Try out [Continue CLI (cn)](https://docs.continue.dev/guides/cli) and give us feedback + -3. Discover models, rules, and MCP tools on [Continue Hub](https://hub.continue.dev/) + ```bash npm + npm install -g @continuedev/cli + ``` + + ```bash yarn + yarn global add @continuedev/cli + ``` + + ```bash pnpm + pnpm add -g @continuedev/cli + ``` + + - to work on development tasks together with AI + Interactive terminal interface for development workflows +
+ • Automate builds & refactoring +
+ • Pre-commit hooks & scripted fixes +
+ • Terminal-first development
- to ask general questions and clarify code sections + Automated AI coding for CI/CD and server environments +
+ • Run in CI/CD pipelines +
+ • Batch processing & bulk operations +
+ • Server & container deployments +
+
+ +## IDE Extensions + + + **Complement your CLI workflow** - Rich editor integrations for interactive + development. + + + + + Install from VS Code Marketplace +
+ Real-time coding assistance and refactoring
- to modify a code section without leaving your current file + Install from JetBrains Plugin Repository +
+ Autocomplete and multi-file edits +
+
+ +## Core Features + + + + Multi-step workflows and complex task automation + + + Ask questions and explore your codebase + + + In-place code editing without breaking flow - to receive inline code suggestions as you type + Inline AI suggestions as you type + + + +## Configuration + + + + Connect your preferred AI models + + + Configure AI behavior and constraints + + + Extend functionality with MCP tools + + + +## Resources + + + + Community models, rules, and tools + + + Get help from the community + + + TUI and headless workflow examples - diff --git a/extensions/cli/src/commands/init.ts b/extensions/cli/src/commands/init.ts index f4c31e614..ad50333ef 100644 --- a/extensions/cli/src/commands/init.ts +++ b/extensions/cli/src/commands/init.ts @@ -1,9 +1,11 @@ import { type AssistantConfig } from "@continuedev/sdk"; +import { createRelativeRuleFilePath } from "core/config/markdown/utils.js"; import { SlashCommandResult } from "../ui/hooks/useChat.types.js"; function createInitPrompt(): string { - return `Please analyze this repository and create a comprehensive AGENTS.md file. Use your available tools to understand the project structure, read important files like README.md, package.json, requirements.txt, and other configuration files to understand the technology stack and setup. + const relativeRuleFilepath = createRelativeRuleFilePath("review"); + return `Please analyze this repository and create a comprehensive AGENTS.md file, along with a custom slash command. Use your available tools to understand the project structure, read important files like README.md, package.json, requirements.txt, and other configuration files to understand the technology stack and setup. Create an AGENTS.md file with the following structure: @@ -30,7 +32,23 @@ Create an AGENTS.md file with the following structure: - Development environment setup - Lint and format commands -Please create the AGENTS.md file using the Write tool after analyzing the repository. Focus on providing actionable information that would help both AI agents and human developers understand and work effectively with this codebase. Keep the file concise but informational.`; +Additionally, create a slash command file at ${relativeRuleFilepath} with the following structure: + +\`\`\`md +--- +invokable: true +--- + +Review this code for potential issues, including: + + + +Provide specific, actionable feedback for improvements. +\`\`\` + +This slash command will be invokable using /review and will provide instructions for code review tasks common to this repository. + +Please create both the AGENTS.md file and the .continue/rules/review.md file using the Write tool after analyzing the repository. Focus on providing actionable information that would help both AI agents and human developers understand and work effectively with this codebase. Keep the files concise but informational.`; } export async function handleInit( diff --git a/extensions/cli/src/ui/components/ChecklistDisplay.test.tsx b/extensions/cli/src/ui/components/ChecklistDisplay.test.tsx new file mode 100644 index 000000000..dbbe0245c --- /dev/null +++ b/extensions/cli/src/ui/components/ChecklistDisplay.test.tsx @@ -0,0 +1,63 @@ +import { render } from "ink-testing-library"; +import React from "react"; + +import { ChecklistDisplay } from "./ChecklistDisplay.js"; + +describe("ChecklistDisplay", () => { + it("should highlight the first incomplete item", () => { + const content = `Task list status: +- [x] Completed task +- [ ] First incomplete task +- [ ] Second incomplete task`; + + const { lastFrame } = render(); + const output = lastFrame(); + + // The output should contain the checkbox symbols and text + expect(output).toContain("✓"); + expect(output).toContain("○"); + expect(output).toContain("Completed task"); + expect(output).toContain("First incomplete task"); + expect(output).toContain("Second incomplete task"); + }); + + it("should handle empty checklist", () => { + const content = "Task list status:"; + + const { lastFrame } = render(); + const output = lastFrame(); + + expect(output).toBeDefined(); + }); + + it("should handle all completed tasks", () => { + const content = `Task list status: +- [x] Completed task 1 +- [x] Completed task 2`; + + const { lastFrame } = render(); + const output = lastFrame(); + + expect(output).toContain("✓"); + expect(output).toContain("Completed task 1"); + expect(output).toContain("Completed task 2"); + }); + + it("should handle mixed content with headers", () => { + const content = `Task list status: +## Important Tasks +- [x] Done task +- [ ] Todo task + +## Other Tasks +- [ ] Another todo`; + + const { lastFrame } = render(); + const output = lastFrame(); + + expect(output).toContain("Important Tasks"); + expect(output).toContain("Other Tasks"); + expect(output).toContain("✓"); + expect(output).toContain("○"); + }); +}); diff --git a/extensions/cli/src/ui/components/ChecklistDisplay.tsx b/extensions/cli/src/ui/components/ChecklistDisplay.tsx index 926a4193f..458e3a7cb 100644 --- a/extensions/cli/src/ui/components/ChecklistDisplay.tsx +++ b/extensions/cli/src/ui/components/ChecklistDisplay.tsx @@ -13,6 +13,17 @@ export const ChecklistDisplay: React.FC = ({ }) => { const lines = content.split("\n"); + // Find the index of the first incomplete checkbox item + let firstIncompleteIndex = -1; + for (let i = 0; i < lines.length; i++) { + const line = lines[i]; + const checkboxMatch = line.match(/^(\s*)-\s*\[([ x])\]\s*(.*)$/); + if (checkboxMatch && checkboxMatch[2] === " ") { + firstIncompleteIndex = i; + break; + } + } + return ( {lines.map((line, index) => { @@ -25,6 +36,7 @@ export const ChecklistDisplay: React.FC = ({ if (checkboxMatch) { const [, indent, status, taskText] = checkboxMatch; const isCompleted = status === "x"; + const isFirstIncomplete = index === firstIncompleteIndex; return ( @@ -34,8 +46,11 @@ export const ChecklistDisplay: React.FC = ({ {taskText} diff --git a/extensions/intellij/gradle.properties b/extensions/intellij/gradle.properties index 92258d32c..9c0d4c5b8 100644 --- a/extensions/intellij/gradle.properties +++ b/extensions/intellij/gradle.properties @@ -1,5 +1,5 @@ pluginGroup=com.github.continuedev.continueintellijextension -pluginVersion=1.0.45 +pluginVersion=1.0.46 platformVersion=2024.1 kotlin.stdlib.default.dependency=false org.gradle.configuration-cache=true diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json index 3c63eefc4..8b5173c9b 100644 --- a/extensions/vscode/package.json +++ b/extensions/vscode/package.json @@ -2,7 +2,7 @@ "name": "continue", "icon": "media/icon.png", "author": "Continue Dev, Inc", - "version": "1.3.12", + "version": "1.3.13", "repository": { "type": "git", "url": "https://github.com/continuedev/continue" diff --git a/gui/src/components/AssistantAndOrgListbox/SelectedAssistantButton.tsx b/gui/src/components/AssistantAndOrgListbox/SelectedAssistantButton.tsx index 09334a9ec..b842cda77 100644 --- a/gui/src/components/AssistantAndOrgListbox/SelectedAssistantButton.tsx +++ b/gui/src/components/AssistantAndOrgListbox/SelectedAssistantButton.tsx @@ -48,9 +48,7 @@ export function SelectedAssistantButton({ ) : ( <> - + diff --git a/gui/src/components/AssistantAndOrgListbox/index.tsx b/gui/src/components/AssistantAndOrgListbox/index.tsx index 55db674be..4bc002c2e 100644 --- a/gui/src/components/AssistantAndOrgListbox/index.tsx +++ b/gui/src/components/AssistantAndOrgListbox/index.tsx @@ -150,7 +150,7 @@ export function AssistantAndOrgListbox({ />
diff --git a/gui/src/components/StyledMarkdownPreview/MermaidBlock.tsx b/gui/src/components/StyledMarkdownPreview/MermaidBlock.tsx index 9deea5872..b11c69a03 100644 --- a/gui/src/components/StyledMarkdownPreview/MermaidBlock.tsx +++ b/gui/src/components/StyledMarkdownPreview/MermaidBlock.tsx @@ -141,7 +141,7 @@ export default function MermaidDiagram({ code }: { code: string }) { {!!error ? (
{error}
) : ( -
+
code) { font-family: var(--vscode-editor-font-family); } diff --git a/gui/src/components/StyledMarkdownPreview/markdown.css b/gui/src/components/StyledMarkdownPreview/markdown.css index afb57b9fa..d9dfcfa2d 100644 --- a/gui/src/components/StyledMarkdownPreview/markdown.css +++ b/gui/src/components/StyledMarkdownPreview/markdown.css @@ -1038,3 +1038,6 @@ body[data-color-mode*="light"] { .token.entity { cursor: help; } +.mermaid foreignObject { + width: 100%; +} diff --git a/gui/src/components/mainInput/InputToolbar.tsx b/gui/src/components/mainInput/InputToolbar.tsx index 25355a7bd..87cf5344f 100644 --- a/gui/src/components/mainInput/InputToolbar.tsx +++ b/gui/src/components/mainInput/InputToolbar.tsx @@ -56,7 +56,6 @@ function InputToolbar(props: InputToolbarProps) { const hasReasoningEnabled = useAppSelector( (store) => store.session.hasReasoningEnabled, ); - const isEnterDisabled = props.disabled || (isInEdit && codeToEdit.length === 0); diff --git a/gui/src/components/mainInput/Lump/LumpToolbar/BlockSettingsTopToolbar.tsx b/gui/src/components/mainInput/Lump/LumpToolbar/BlockSettingsTopToolbar.tsx index cc83b9c46..5cca2cdc1 100644 --- a/gui/src/components/mainInput/Lump/LumpToolbar/BlockSettingsTopToolbar.tsx +++ b/gui/src/components/mainInput/Lump/LumpToolbar/BlockSettingsTopToolbar.tsx @@ -105,7 +105,7 @@ export function BlockSettingsTopToolbar() { }; return ( -
+
{shouldShowError && ( diff --git a/gui/src/components/ui/Button.tsx b/gui/src/components/ui/Button.tsx index 690a72bb3..e4cf466e3 100644 --- a/gui/src/components/ui/Button.tsx +++ b/gui/src/components/ui/Button.tsx @@ -40,7 +40,7 @@ const Button = React.forwardRef( className={cn( "cursor-pointer transition-all duration-200", "hover:enabled:cursor-pointer", - "disabled:text-description-muted disabled:pointer-events-none disabled:opacity-50", + "disabled:cursor-not-allowed disabled:opacity-50", buttonVariants[variant], isIcon ? iconButtonSizes[size] diff --git a/gui/src/pages/gui/StreamError.tsx b/gui/src/pages/gui/StreamError.tsx index bbb75b141..f9a60daf2 100644 --- a/gui/src/pages/gui/StreamError.tsx +++ b/gui/src/pages/gui/StreamError.tsx @@ -290,10 +290,7 @@ const StreamErrorDialog = ({ error }: StreamErrorProps) => { { - ideMessenger.post("controlPlane/openUrl", { - path: GITHUB_LINK, - orgSlug: undefined, - }); + ideMessenger.post("openUrl", GITHUB_LINK); }} > @@ -302,10 +299,7 @@ const StreamErrorDialog = ({ error }: StreamErrorProps) => { { - ideMessenger.post("controlPlane/openUrl", { - path: DISCORD_LINK, - orgSlug: undefined, - }); + ideMessenger.post("openUrl", DISCORD_LINK); }} > diff --git a/gui/src/pages/gui/ToolCallDiv/SimpleToolCallUI.tsx b/gui/src/pages/gui/ToolCallDiv/SimpleToolCallUI.tsx index b9fa4777d..d875af8f0 100644 --- a/gui/src/pages/gui/ToolCallDiv/SimpleToolCallUI.tsx +++ b/gui/src/pages/gui/ToolCallDiv/SimpleToolCallUI.tsx @@ -7,6 +7,7 @@ import { import { IdeMessengerContext } from "../../../context/IdeMessenger"; import { ToggleWithIcon } from "./ToggleWithIcon"; import { ToolCallStatusMessage } from "./ToolCallStatusMessage"; +import { ToolTruncateHistoryIcon } from "./ToolTruncateHistoryIcon"; import { toolCallStateToContextItems } from "./utils"; interface SimpleToolCallUIProps { @@ -61,6 +62,10 @@ export function SimpleToolCallUI({ />
+ + {!!toolCallState.output?.length && ( + + )}
{isToggleable && ( diff --git a/gui/src/pages/gui/ToolCallDiv/ToolCallDisplay.tsx b/gui/src/pages/gui/ToolCallDiv/ToolCallDisplay.tsx index f5a660050..6c5b89805 100644 --- a/gui/src/pages/gui/ToolCallDiv/ToolCallDisplay.tsx +++ b/gui/src/pages/gui/ToolCallDiv/ToolCallDisplay.tsx @@ -1,5 +1,6 @@ import { Tool, ToolCallState } from "core"; import { ToolCallStatusMessage } from "./ToolCallStatusMessage"; +import { ToolTruncateHistoryIcon } from "./ToolTruncateHistoryIcon"; interface ToolCallDisplayProps { children: React.ReactNode; @@ -19,7 +20,7 @@ export function ToolCallDisplay({ return (
-
+
{icon} @@ -29,6 +30,9 @@ export function ToolCallDisplay({ )}
+ {!!toolCallState.output?.length && ( + + )}
{children}
diff --git a/gui/src/pages/gui/ToolCallDiv/ToolCallStatusMessage.tsx b/gui/src/pages/gui/ToolCallDiv/ToolCallStatusMessage.tsx index 4a88fd7cb..c633b0514 100644 --- a/gui/src/pages/gui/ToolCallDiv/ToolCallStatusMessage.tsx +++ b/gui/src/pages/gui/ToolCallDiv/ToolCallStatusMessage.tsx @@ -53,7 +53,7 @@ export function ToolCallStatusMessage({ return (
{`Continue ${intro} ${message}`} diff --git a/gui/src/pages/gui/ToolCallDiv/ToolTruncateHistoryIcon.tsx b/gui/src/pages/gui/ToolCallDiv/ToolTruncateHistoryIcon.tsx index d28cd9328..dc5c2a03b 100644 --- a/gui/src/pages/gui/ToolCallDiv/ToolTruncateHistoryIcon.tsx +++ b/gui/src/pages/gui/ToolCallDiv/ToolTruncateHistoryIcon.tsx @@ -21,7 +21,8 @@ export function ToolTruncateHistoryIcon({ const { mainEditor } = useMainEditor(); if (historyIndex === lastMessageIndex) { - return null; + // filler so doesn't jump in + return
; } return ( diff --git a/package-lock.json b/package-lock.json index b3ddaef8f..3989f3c00 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,8 @@ "@typescript-eslint/parser": "^7.8.0", "concurrently": "^9.1.2", "eslint-plugin-import": "^2.29.1", + "husky": "^9.1.7", + "lint-staged": "^15.5.2", "prettier": "^3.3.3", "prettier-plugin-tailwindcss": "^0.6.8", "typescript": "^5.6.3" @@ -385,6 +387,22 @@ "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/ansi-escapes": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-7.1.1.tgz", + "integrity": "sha512-Zhl0ErHcSRUaVfGUeUdDuLgpkEo8KIFjB4Y9uAc46ScOpdDiU1Dbyplh7qWJeJ/ZHpbyMSM26+X3BySgnIz40Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "environment": "^1.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", @@ -698,6 +716,93 @@ "node": ">=8" } }, + "node_modules/cli-cursor": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz", + "integrity": "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==", + "dev": true, + "license": "MIT", + "dependencies": { + "restore-cursor": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-truncate": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-4.0.0.tgz", + "integrity": "sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==", + "dev": true, + "license": "MIT", + "dependencies": { + "slice-ansi": "^5.0.0", + "string-width": "^7.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-truncate/node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/cli-truncate/node_modules/emoji-regex": { + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.5.0.tgz", + "integrity": "sha512-lb49vf1Xzfx080OKA0o6l8DQQpV+6Vg95zyCJX9VB/BqKYlhG7N4wgROUUHRA+ZPUefLnteQOad7z1kT2bV7bg==", + "dev": true, + "license": "MIT" + }, + "node_modules/cli-truncate/node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-truncate/node_modules/strip-ansi": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", + "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, "node_modules/cliui": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", @@ -733,6 +838,23 @@ "dev": true, "license": "MIT" }, + "node_modules/colorette": { + "version": "2.0.20", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", + "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", + "dev": true, + "license": "MIT" + }, + "node_modules/commander": { + "version": "13.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-13.1.0.tgz", + "integrity": "sha512-/rFeCpNJQbhSZjGVwO9RFV3xPqbnERS8MmIQzCtD/zl6gpJuV/bMLuN92oG3F7d8oDEHHRrujSXNUr8fpjntKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -772,7 +894,6 @@ "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -947,6 +1068,19 @@ "dev": true, "license": "MIT" }, + "node_modules/environment": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/environment/-/environment-1.1.0.tgz", + "integrity": "sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/es-abstract": { "version": "1.24.0", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.24.0.tgz", @@ -1444,6 +1578,37 @@ "node": ">=0.10.0" } }, + "node_modules/eventemitter3": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", + "dev": true, + "license": "MIT" + }, + "node_modules/execa": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", + "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", + "dev": true, + "license": "MIT", + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^8.0.1", + "human-signals": "^5.0.0", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^4.1.0", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": ">=16.17" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -1652,6 +1817,19 @@ "node": "6.* || 8.* || >= 10.*" } }, + "node_modules/get-east-asian-width": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.4.0.tgz", + "integrity": "sha512-QZjmEOC+IT1uk6Rx0sX22V6uHWVwbdbxf1faPqJ1QhLdGgsRGCZoyaQBm/piRdJy/D2um6hM1UP7ZEeQ4EkP+Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/get-intrinsic": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", @@ -1691,6 +1869,19 @@ "node": ">= 0.4" } }, + "node_modules/get-stream": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", + "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/get-symbol-description": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.1.0.tgz", @@ -1942,6 +2133,32 @@ "node": ">= 0.4" } }, + "node_modules/human-signals": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", + "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=16.17.0" + } + }, + "node_modules/husky": { + "version": "9.1.7", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.7.tgz", + "integrity": "sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==", + "dev": true, + "license": "MIT", + "bin": { + "husky": "bin.js" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/typicode" + } + }, "node_modules/ignore": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", @@ -2332,6 +2549,19 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-string": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.1.1.tgz", @@ -2441,8 +2671,7 @@ "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true, - "license": "ISC", - "peer": true + "license": "ISC" }, "node_modules/js-yaml": { "version": "4.1.0", @@ -2521,6 +2750,163 @@ "node": ">= 0.8.0" } }, + "node_modules/lilconfig": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz", + "integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antonk52" + } + }, + "node_modules/lint-staged": { + "version": "15.5.2", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.5.2.tgz", + "integrity": "sha512-YUSOLq9VeRNAo/CTaVmhGDKG+LBtA8KF1X4K5+ykMSwWST1vDxJRB2kv2COgLb1fvpCo+A/y9A0G0znNVmdx4w==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^5.4.1", + "commander": "^13.1.0", + "debug": "^4.4.0", + "execa": "^8.0.1", + "lilconfig": "^3.1.3", + "listr2": "^8.2.5", + "micromatch": "^4.0.8", + "pidtree": "^0.6.0", + "string-argv": "^0.3.2", + "yaml": "^2.7.0" + }, + "bin": { + "lint-staged": "bin/lint-staged.js" + }, + "engines": { + "node": ">=18.12.0" + }, + "funding": { + "url": "https://opencollective.com/lint-staged" + } + }, + "node_modules/lint-staged/node_modules/chalk": { + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz", + "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/listr2": { + "version": "8.3.3", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-8.3.3.tgz", + "integrity": "sha512-LWzX2KsqcB1wqQ4AHgYb4RsDXauQiqhjLk+6hjbaeHG4zpjjVAB6wC/gz6X0l+Du1cN3pUB5ZlrvTbhGSNnUQQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "cli-truncate": "^4.0.0", + "colorette": "^2.0.20", + "eventemitter3": "^5.0.1", + "log-update": "^6.1.0", + "rfdc": "^1.4.1", + "wrap-ansi": "^9.0.0" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/listr2/node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/listr2/node_modules/ansi-styles": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/listr2/node_modules/emoji-regex": { + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.5.0.tgz", + "integrity": "sha512-lb49vf1Xzfx080OKA0o6l8DQQpV+6Vg95zyCJX9VB/BqKYlhG7N4wgROUUHRA+ZPUefLnteQOad7z1kT2bV7bg==", + "dev": true, + "license": "MIT" + }, + "node_modules/listr2/node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/listr2/node_modules/strip-ansi": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", + "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/listr2/node_modules/wrap-ansi": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz", + "integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, "node_modules/locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", @@ -2553,6 +2939,144 @@ "license": "MIT", "peer": true }, + "node_modules/log-update": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/log-update/-/log-update-6.1.0.tgz", + "integrity": "sha512-9ie8ItPR6tjY5uYJh8K/Zrv/RMZ5VOlOWvtZdEHYSTFKZfIBPQa9tOAEeAWhd+AnIneLJ22w5fjOYtoutpWq5w==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-escapes": "^7.0.0", + "cli-cursor": "^5.0.0", + "slice-ansi": "^7.1.0", + "strip-ansi": "^7.1.0", + "wrap-ansi": "^9.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/log-update/node_modules/ansi-styles": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/log-update/node_modules/emoji-regex": { + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.5.0.tgz", + "integrity": "sha512-lb49vf1Xzfx080OKA0o6l8DQQpV+6Vg95zyCJX9VB/BqKYlhG7N4wgROUUHRA+ZPUefLnteQOad7z1kT2bV7bg==", + "dev": true, + "license": "MIT" + }, + "node_modules/log-update/node_modules/is-fullwidth-code-point": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-5.1.0.tgz", + "integrity": "sha512-5XHYaSyiqADb4RnZ1Bdad6cPp8Toise4TzEjcOYDHZkTCbKgiUl7WTUCpNWHuxmDt91wnsZBc9xinNzopv3JMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-east-asian-width": "^1.3.1" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/slice-ansi": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-7.1.2.tgz", + "integrity": "sha512-iOBWFgUX7caIZiuutICxVgX1SdxwAVFFKwt1EvMYYec/NWO5meOJ6K5uQxhrYBdQJne4KxiqZc+KptFOWFSI9w==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.2.1", + "is-fullwidth-code-point": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/log-update/node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/strip-ansi": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", + "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/log-update/node_modules/wrap-ansi": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz", + "integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, "node_modules/math-intrinsics": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", @@ -2563,6 +3087,13 @@ "node": ">= 0.4" } }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true, + "license": "MIT" + }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -2587,6 +3118,32 @@ "node": ">=8.6" } }, + "node_modules/mimic-fn": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mimic-function": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz", + "integrity": "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/minimatch": { "version": "9.0.5", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", @@ -2628,6 +3185,35 @@ "license": "MIT", "peer": true }, + "node_modules/npm-run-path": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", + "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/npm-run-path/node_modules/path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/object-inspect": { "version": "1.13.4", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", @@ -2736,6 +3322,22 @@ "wrappy": "1" } }, + "node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "mimic-fn": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/optionator": { "version": "0.9.4", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", @@ -2849,7 +3451,6 @@ "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=8" } @@ -2884,6 +3485,19 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/pidtree": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.6.0.tgz", + "integrity": "sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==", + "dev": true, + "license": "MIT", + "bin": { + "pidtree": "bin/pidtree.js" + }, + "engines": { + "node": ">=0.10" + } + }, "node_modules/possible-typed-array-names": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz", @@ -3118,6 +3732,39 @@ "node": ">=4" } }, + "node_modules/restore-cursor": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-5.1.0.tgz", + "integrity": "sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==", + "dev": true, + "license": "MIT", + "dependencies": { + "onetime": "^7.0.0", + "signal-exit": "^4.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/restore-cursor/node_modules/onetime": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-7.0.0.tgz", + "integrity": "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "mimic-function": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/reusify": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", @@ -3129,6 +3776,13 @@ "node": ">=0.10.0" } }, + "node_modules/rfdc": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz", + "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==", + "dev": true, + "license": "MIT" + }, "node_modules/rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -3304,7 +3958,6 @@ "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "shebang-regex": "^3.0.0" }, @@ -3318,7 +3971,6 @@ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=8" } @@ -3412,6 +4064,19 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", @@ -3422,6 +4087,49 @@ "node": ">=8" } }, + "node_modules/slice-ansi": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-5.0.0.tgz", + "integrity": "sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.0.0", + "is-fullwidth-code-point": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/slice-ansi/node_modules/ansi-styles": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/slice-ansi/node_modules/is-fullwidth-code-point": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-4.0.0.tgz", + "integrity": "sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/stop-iteration-iterator": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz", @@ -3436,6 +4144,16 @@ "node": ">= 0.4" } }, + "node_modules/string-argv": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz", + "integrity": "sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.6.19" + } + }, "node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -3533,6 +4251,19 @@ "node": ">=4" } }, + "node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -3796,7 +4527,6 @@ "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, "license": "ISC", - "peer": true, "dependencies": { "isexe": "^2.0.0" }, @@ -3943,6 +4673,19 @@ "node": ">=10" } }, + "node_modules/yaml": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.1.tgz", + "integrity": "sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw==", + "dev": true, + "license": "ISC", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14.6" + } + }, "node_modules/yargs": { "version": "17.7.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", diff --git a/package.json b/package.json index 28cdb97d8..ceb907fdd 100644 --- a/package.json +++ b/package.json @@ -7,12 +7,18 @@ "tsc:watch:core": "tsc --project core/tsconfig.json --watch --noEmit --pretty", "tsc:watch:binary": "tsc --project binary/tsconfig.json --watch --noEmit --pretty", "format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,css,md}\" --ignore-path .gitignore --ignore-path .prettierignore", - "format:check": "prettier --check \"**/*.{js,jsx,ts,tsx,json,css,md}\" --ignore-path .gitignore --ignore-path .prettierignore" + "format:check": "prettier --check \"**/*.{js,jsx,ts,tsx,json,css,md}\" --ignore-path .gitignore --ignore-path .prettierignore", + "prepare": "husky" + }, + "lint-staged": { + "*.{js,jsx,ts,tsx,json,css,md}": "prettier --write" }, "devDependencies": { "@typescript-eslint/parser": "^7.8.0", "concurrently": "^9.1.2", "eslint-plugin-import": "^2.29.1", + "husky": "^9.1.7", + "lint-staged": "^15.5.2", "prettier": "^3.3.3", "prettier-plugin-tailwindcss": "^0.6.8", "typescript": "^5.6.3" diff --git a/packages/llm-info/src/index.ts b/packages/llm-info/src/index.ts index 35b88abf6..c1aaa6643 100644 --- a/packages/llm-info/src/index.ts +++ b/packages/llm-info/src/index.ts @@ -10,7 +10,7 @@ import { OpenAi } from "./providers/openai.js"; import { Vllm } from "./providers/vllm.js"; import { Voyage } from "./providers/voyage.js"; import { xAI } from "./providers/xAI.js"; -import { LlmInfo, ModelProvider, UseCase } from "./types.js"; +import { LlmInfoWithProvider, ModelProvider, UseCase } from "./types.js"; export const allModelProviders: ModelProvider[] = [ OpenAi, @@ -27,16 +27,32 @@ export const allModelProviders: ModelProvider[] = [ xAI, ]; -export const allLlms: LlmInfo[] = allModelProviders.flatMap((provider) => - provider.models.map((model) => ({ ...model, provider: provider.id })), +export const allLlms: LlmInfoWithProvider[] = allModelProviders.flatMap( + (provider) => + provider.models.map((model) => ({ ...model, provider: provider.id })), ); -export function findLlmInfo(model: string): LlmInfo | undefined { +export function findLlmInfo( + model: string, + preferProviderId?: string, +): LlmInfoWithProvider | undefined { + if (preferProviderId) { + const provider = allModelProviders.find((p) => p.id === preferProviderId); + const info = provider?.models.find((llm) => + llm.regex ? llm.regex.test(model) : llm.model === model, + ); + if (info) { + return { + ...info, + provider: preferProviderId, + }; + } + } return allLlms.find((llm) => llm.regex ? llm.regex.test(model) : llm.model === model, ); } -export function getAllRecommendedFor(useCase: UseCase): LlmInfo[] { +export function getAllRecommendedFor(useCase: UseCase): LlmInfoWithProvider[] { return allLlms.filter((llm) => llm.recommendedFor?.includes(useCase)); }