diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 00000000000..9a888adbb25 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,4 @@ +# web + desktop packages +packages/app/ @adamdotdevin +packages/tauri/ @adamdotdevin +packages/desktop/ @adamdotdevin diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index 4c2b63711a8..fe1ec8409b4 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -11,6 +11,14 @@ body: validations: required: true + - type: input + id: plugins + attributes: + label: Plugins + description: What plugins are you using? + validations: + required: false + - type: input id: opencode-version attributes: diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000000..b4369fa1a43 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,3 @@ +### What does this PR do? + +### How did you verify your code works? diff --git a/.github/workflows/auto-label-tui.yml b/.github/workflows/auto-label-tui.yml deleted file mode 100644 index c2f81a38011..00000000000 --- a/.github/workflows/auto-label-tui.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: Auto-label TUI Issues - -on: - issues: - types: [opened] - -jobs: - auto-label: - runs-on: blacksmith-4vcpu-ubuntu-2404 - permissions: - contents: read - issues: write - steps: - - name: Auto-label and assign issues - uses: actions/github-script@v7 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const issue = context.payload.issue; - const title = issue.title; - const description = issue.body || ''; - - // Check for "opencode web" keyword - const webPattern = /(opencode web)/i; - const isWebRelated = webPattern.test(title) || webPattern.test(description); - - // Check for version patterns like v1.0.x or 1.0.x - const versionPattern = /[v]?1\.0\./i; - const isVersionRelated = versionPattern.test(title) || versionPattern.test(description); - - // Check for "nix" keyword - const nixPattern = /\bnix\b/i; - const isNixRelated = nixPattern.test(title) || nixPattern.test(description); - - const labels = []; - - if (isWebRelated) { - labels.push('web'); - - // Assign to adamdotdevin - await github.rest.issues.addAssignees({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: issue.number, - assignees: ['adamdotdevin'] - }); - } else if (isVersionRelated) { - // Only add opentui if NOT web-related - labels.push('opentui'); - } - - if (isNixRelated) { - labels.push('nix'); - } - - if (labels.length > 0) { - await github.rest.issues.addLabels({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: issue.number, - labels: labels - }); - } diff --git a/.github/workflows/daily-issues-recap.yml b/.github/workflows/daily-issues-recap.yml new file mode 100644 index 00000000000..a333e5365f9 --- /dev/null +++ b/.github/workflows/daily-issues-recap.yml @@ -0,0 +1,166 @@ +name: Daily Issues Recap + +on: + schedule: + # Run at 6 PM EST (23:00 UTC, or 22:00 UTC during daylight saving) + - cron: "0 23 * * *" + workflow_dispatch: # Allow manual trigger for testing + +jobs: + daily-recap: + runs-on: blacksmith-4vcpu-ubuntu-2404 + permissions: + contents: read + issues: read + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - uses: ./.github/actions/setup-bun + + - name: Install opencode + run: curl -fsSL https://opencode.ai/install | bash + + - name: Generate daily issues recap + id: recap + env: + OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + OPENCODE_PERMISSION: | + { + "bash": { + "*": "deny", + "gh issue*": "allow", + "gh search*": "allow" + }, + "webfetch": "deny", + "edit": "deny", + "write": "deny" + } + run: | + # Get today's date range + TODAY=$(date -u +%Y-%m-%d) + + opencode run -m opencode/claude-sonnet-4-5 "Generate a daily issues recap for the OpenCode repository. + + TODAY'S DATE: ${TODAY} + + STEP 1: Gather today's issues + Search for all issues created today (${TODAY}) using: + gh issue list --repo ${{ github.repository }} --state all --search \"created:${TODAY}\" --json number,title,body,labels,state,comments,createdAt,author --limit 500 + + STEP 2: Analyze and categorize + For each issue created today, categorize it: + + **Severity Assessment:** + - CRITICAL: Crashes, data loss, security issues, blocks major functionality + - HIGH: Significant bugs affecting many users, important features broken + - MEDIUM: Bugs with workarounds, minor features broken + - LOW: Minor issues, cosmetic, nice-to-haves + + **Activity Assessment:** + - Note issues with high comment counts or engagement + - Note issues from repeat reporters (check if author has filed before) + + STEP 3: Cross-reference with existing issues + For issues that seem like feature requests or recurring bugs: + - Search for similar older issues to identify patterns + - Note if this is a frequently requested feature + - Identify any issues that are duplicates of long-standing requests + + STEP 4: Generate the recap + Create a structured recap with these sections: + + ===DISCORD_START=== + **Daily Issues Recap - ${TODAY}** + + **Summary Stats** + - Total issues opened today: [count] + - By category: [bugs/features/questions] + + **Critical/High Priority Issues** + [List any CRITICAL or HIGH severity issues with brief descriptions and issue numbers] + + **Most Active/Discussed** + [Issues with significant engagement or from active community members] + + **Trending Topics** + [Patterns noticed - e.g., 'Multiple reports about X', 'Continued interest in Y feature'] + + **Duplicates & Related** + [Issues that relate to existing open issues] + ===DISCORD_END=== + + STEP 5: Format for Discord + Format the recap as a Discord-compatible message: + - Use Discord markdown (**, __, etc.) + - BE EXTREMELY CONCISE - this is an EOD summary, not a detailed report + - Use hyperlinked issue numbers with suppressed embeds: [#1234]() + - Group related issues on single lines where possible + - Add emoji sparingly for critical items only + - HARD LIMIT: Keep under 1800 characters total + - Skip sections that have nothing notable (e.g., if no critical issues, omit that section) + - Prioritize signal over completeness - only surface what matters + + OUTPUT: Output ONLY the content between ===DISCORD_START=== and ===DISCORD_END=== markers. Include the markers so I can extract it." > /tmp/recap_raw.txt + + # Extract only the Discord message between markers + sed -n '/===DISCORD_START===/,/===DISCORD_END===/p' /tmp/recap_raw.txt | grep -v '===DISCORD' > /tmp/recap.txt + + echo "recap_file=/tmp/recap.txt" >> $GITHUB_OUTPUT + + - name: Post to Discord + env: + DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_ISSUES_WEBHOOK_URL }} + run: | + if [ -z "$DISCORD_WEBHOOK_URL" ]; then + echo "Warning: DISCORD_ISSUES_WEBHOOK_URL secret not set, skipping Discord post" + cat /tmp/recap.txt + exit 0 + fi + + # Read the recap + RECAP_RAW=$(cat /tmp/recap.txt) + RECAP_LENGTH=${#RECAP_RAW} + + echo "Recap length: ${RECAP_LENGTH} chars" + + # Function to post a message to Discord + post_to_discord() { + local msg="$1" + local content=$(echo "$msg" | jq -Rs '.') + curl -s -H "Content-Type: application/json" \ + -X POST \ + -d "{\"content\": ${content}}" \ + "$DISCORD_WEBHOOK_URL" + sleep 1 + } + + # If under limit, send as single message + if [ "$RECAP_LENGTH" -le 1950 ]; then + post_to_discord "$RECAP_RAW" + else + echo "Splitting into multiple messages..." + remaining="$RECAP_RAW" + while [ ${#remaining} -gt 0 ]; do + if [ ${#remaining} -le 1950 ]; then + post_to_discord "$remaining" + break + else + chunk="${remaining:0:1900}" + last_newline=$(echo "$chunk" | grep -bo $'\n' | tail -1 | cut -d: -f1) + if [ -n "$last_newline" ] && [ "$last_newline" -gt 500 ]; then + chunk="${remaining:0:$last_newline}" + remaining="${remaining:$((last_newline+1))}" + else + chunk="${remaining:0:1900}" + remaining="${remaining:1900}" + fi + post_to_discord "$chunk" + fi + done + fi + + echo "Posted daily recap to Discord" diff --git a/.github/workflows/daily-pr-recap.yml b/.github/workflows/daily-pr-recap.yml new file mode 100644 index 00000000000..7c8bab395f6 --- /dev/null +++ b/.github/workflows/daily-pr-recap.yml @@ -0,0 +1,169 @@ +name: Daily PR Recap + +on: + schedule: + # Run at 5pm EST (22:00 UTC, or 21:00 UTC during daylight saving) + - cron: "0 22 * * *" + workflow_dispatch: # Allow manual trigger for testing + +jobs: + pr-recap: + runs-on: blacksmith-4vcpu-ubuntu-2404 + permissions: + contents: read + pull-requests: read + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - uses: ./.github/actions/setup-bun + + - name: Install opencode + run: curl -fsSL https://opencode.ai/install | bash + + - name: Generate daily PR recap + id: recap + env: + OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + OPENCODE_PERMISSION: | + { + "bash": { + "*": "deny", + "gh pr*": "allow", + "gh search*": "allow" + }, + "webfetch": "deny", + "edit": "deny", + "write": "deny" + } + run: | + TODAY=$(date -u +%Y-%m-%d) + + opencode run -m opencode/claude-sonnet-4-5 "Generate a daily PR activity recap for the OpenCode repository. + + TODAY'S DATE: ${TODAY} + + STEP 1: Gather PR data + Run these commands to gather PR information. ONLY include PRs created or updated TODAY (${TODAY}): + + # PRs created today + gh pr list --repo ${{ github.repository }} --state all --search \"created:${TODAY}\" --json number,title,author,labels,createdAt,updatedAt,reviewDecision,isDraft,additions,deletions --limit 100 + + # PRs with activity today (updated today) + gh pr list --repo ${{ github.repository }} --state open --search \"updated:${TODAY}\" --json number,title,author,labels,createdAt,updatedAt,reviewDecision,isDraft,additions,deletions --limit 100 + + + + STEP 2: For high-activity PRs, check comment counts + For promising PRs, run: + gh pr view [NUMBER] --repo ${{ github.repository }} --json comments --jq '[.comments[] | select(.author.login != \"copilot-pull-request-reviewer\" and .author.login != \"github-actions\")] | length' + + IMPORTANT: When counting comments/activity, EXCLUDE these bot accounts: + - copilot-pull-request-reviewer + - github-actions + + STEP 3: Identify what matters (ONLY from today's PRs) + + **Bug Fixes From Today:** + - PRs with 'fix' or 'bug' in title created/updated today + - Small bug fixes (< 100 lines changed) that are easy to review + - Bug fixes from community contributors + + **High Activity Today:** + - PRs with significant human comments today (excluding bots listed above) + - PRs with back-and-forth discussion today + + **Quick Wins:** + - Small PRs (< 50 lines) that are approved or nearly approved + - PRs that just need a final review + + STEP 4: Generate the recap + Create a structured recap: + + ===DISCORD_START=== + **Daily PR Recap - ${TODAY}** + + **New PRs Today** + [PRs opened today - group by type: bug fixes, features, etc.] + + **Active PRs Today** + [PRs with activity/updates today - significant discussion] + + **Quick Wins** + [Small PRs ready to merge] + ===DISCORD_END=== + + STEP 5: Format for Discord + - Use Discord markdown (**, __, etc.) + - BE EXTREMELY CONCISE - surface what we might miss + - Use hyperlinked PR numbers with suppressed embeds: [#1234]() + - Include PR author: [#1234]() (@author) + - For bug fixes, add brief description of what it fixes + - Show line count for quick wins: \"(+15/-3 lines)\" + - HARD LIMIT: Keep under 1800 characters total + - Skip empty sections + - Focus on PRs that need human eyes + + OUTPUT: Output ONLY the content between ===DISCORD_START=== and ===DISCORD_END=== markers. Include the markers so I can extract it." > /tmp/pr_recap_raw.txt + + # Extract only the Discord message between markers + sed -n '/===DISCORD_START===/,/===DISCORD_END===/p' /tmp/pr_recap_raw.txt | grep -v '===DISCORD' > /tmp/pr_recap.txt + + echo "recap_file=/tmp/pr_recap.txt" >> $GITHUB_OUTPUT + + - name: Post to Discord + env: + DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_ISSUES_WEBHOOK_URL }} + run: | + if [ -z "$DISCORD_WEBHOOK_URL" ]; then + echo "Warning: DISCORD_ISSUES_WEBHOOK_URL secret not set, skipping Discord post" + cat /tmp/pr_recap.txt + exit 0 + fi + + # Read the recap + RECAP_RAW=$(cat /tmp/pr_recap.txt) + RECAP_LENGTH=${#RECAP_RAW} + + echo "Recap length: ${RECAP_LENGTH} chars" + + # Function to post a message to Discord + post_to_discord() { + local msg="$1" + local content=$(echo "$msg" | jq -Rs '.') + curl -s -H "Content-Type: application/json" \ + -X POST \ + -d "{\"content\": ${content}}" \ + "$DISCORD_WEBHOOK_URL" + sleep 1 + } + + # If under limit, send as single message + if [ "$RECAP_LENGTH" -le 1950 ]; then + post_to_discord "$RECAP_RAW" + else + echo "Splitting into multiple messages..." + remaining="$RECAP_RAW" + while [ ${#remaining} -gt 0 ]; do + if [ ${#remaining} -le 1950 ]; then + post_to_discord "$remaining" + break + else + chunk="${remaining:0:1900}" + last_newline=$(echo "$chunk" | grep -bo $'\n' | tail -1 | cut -d: -f1) + if [ -n "$last_newline" ] && [ "$last_newline" -gt 500 ]; then + chunk="${remaining:0:$last_newline}" + remaining="${remaining:$((last_newline+1))}" + else + chunk="${remaining:0:1900}" + remaining="${remaining:1900}" + fi + post_to_discord "$chunk" + fi + done + fi + + echo "Posted daily PR recap to Discord" diff --git a/.github/workflows/docs-update.yml b/.github/workflows/docs-update.yml new file mode 100644 index 00000000000..a8dd2ae4f2b --- /dev/null +++ b/.github/workflows/docs-update.yml @@ -0,0 +1,72 @@ +name: Docs Update + +on: + schedule: + - cron: "0 */12 * * *" + workflow_dispatch: + +env: + LOOKBACK_HOURS: 4 + +jobs: + update-docs: + if: github.repository == 'sst/opencode' + runs-on: blacksmith-4vcpu-ubuntu-2404 + permissions: + id-token: write + contents: write + pull-requests: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetch full history to access commits + + - name: Setup Bun + uses: ./.github/actions/setup-bun + + - name: Get recent commits + id: commits + run: | + COMMITS=$(git log --since="${{ env.LOOKBACK_HOURS }} hours ago" --pretty=format:"- %h %s" 2>/dev/null || echo "") + if [ -z "$COMMITS" ]; then + echo "No commits in the last ${{ env.LOOKBACK_HOURS }} hours" + echo "has_commits=false" >> $GITHUB_OUTPUT + else + echo "has_commits=true" >> $GITHUB_OUTPUT + { + echo "list<> $GITHUB_OUTPUT + fi + + - name: Run opencode + if: steps.commits.outputs.has_commits == 'true' + uses: sst/opencode/github@latest + env: + OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }} + with: + model: opencode/gpt-5.2 + agent: docs + prompt: | + Review the following commits from the last ${{ env.LOOKBACK_HOURS }} hours and identify any new features that may need documentation. + + + ${{ steps.commits.outputs.list }} + + + Steps: + 1. For each commit that looks like a new feature or significant change: + - Read the changed files to understand what was added + - Check if the feature is already documented in packages/web/src/content/docs/* + 2. If you find undocumented features: + - Update the relevant documentation files in packages/web/src/content/docs/* + - Follow the existing documentation style and structure + - Make sure to document the feature clearly with examples where appropriate + 3. If all new features are already documented, report that no updates are needed + 4. If you are creating a new documentation file be sure to update packages/web/astro.config.mjs too. + + Focus on user-facing features and API changes. Skip internal refactors, bug fixes, and test updates unless they affect user-facing behavior. + Don't feel the need to document every little thing. It is perfectly okay to make 0 changes at all. + Try to keep documentation only for large features or changes that already have a good spot to be documented. diff --git a/.github/workflows/duplicate-issues.yml b/.github/workflows/duplicate-issues.yml index 5969d9d41e4..53aa2a725eb 100644 --- a/.github/workflows/duplicate-issues.yml +++ b/.github/workflows/duplicate-issues.yml @@ -16,6 +16,8 @@ jobs: with: fetch-depth: 1 + - uses: ./.github/actions/setup-bun + - name: Install opencode run: curl -fsSL https://opencode.ai/install | bash @@ -26,8 +28,8 @@ jobs: OPENCODE_PERMISSION: | { "bash": { - "gh issue*": "allow", - "*": "deny" + "*": "deny", + "gh issue*": "allow" }, "webfetch": "deny" } diff --git a/.github/workflows/duplicate-prs.yml b/.github/workflows/duplicate-prs.yml new file mode 100644 index 00000000000..32606858958 --- /dev/null +++ b/.github/workflows/duplicate-prs.yml @@ -0,0 +1,65 @@ +name: Duplicate PR Check + +on: + pull_request_target: + types: [opened] + +jobs: + check-duplicates: + if: | + github.event.pull_request.user.login != 'actions-user' && + github.event.pull_request.user.login != 'opencode' && + github.event.pull_request.user.login != 'rekram1-node' && + github.event.pull_request.user.login != 'thdxr' && + github.event.pull_request.user.login != 'kommander' && + github.event.pull_request.user.login != 'jayair' && + github.event.pull_request.user.login != 'fwang' && + github.event.pull_request.user.login != 'adamdotdevin' && + github.event.pull_request.user.login != 'iamdavidhill' && + github.event.pull_request.user.login != 'opencode-agent[bot]' + runs-on: blacksmith-4vcpu-ubuntu-2404 + permissions: + contents: read + pull-requests: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - name: Setup Bun + uses: ./.github/actions/setup-bun + + - name: Install dependencies + run: bun install + + - name: Install opencode + run: curl -fsSL https://opencode.ai/install | bash + + - name: Build prompt + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PR_NUMBER: ${{ github.event.pull_request.number }} + run: | + { + echo "Check for duplicate PRs related to this new PR:" + echo "" + echo "CURRENT_PR_NUMBER: $PR_NUMBER" + echo "" + echo "Title: $(gh pr view "$PR_NUMBER" --json title --jq .title)" + echo "" + echo "Description:" + gh pr view "$PR_NUMBER" --json body --jq .body + } > pr_info.txt + + - name: Check for duplicate PRs + env: + OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PR_NUMBER: ${{ github.event.pull_request.number }} + run: | + COMMENT=$(bun script/duplicate-pr.ts -f pr_info.txt "Check the attached file for PR details and search for duplicates") + + gh pr comment "$PR_NUMBER" --body "_The following comment was made by an LLM, it may be inaccurate:_ + + $COMMENT" diff --git a/.github/workflows/generate.yml b/.github/workflows/generate.yml index 326090f7a24..29cc9895393 100644 --- a/.github/workflows/generate.yml +++ b/.github/workflows/generate.yml @@ -2,11 +2,8 @@ name: generate on: push: - branches-ignore: - - production - pull_request: - branches-ignore: - - production + branches: + - dev workflow_dispatch: jobs: @@ -14,6 +11,7 @@ jobs: runs-on: blacksmith-4vcpu-ubuntu-2404 permissions: contents: write + pull-requests: write steps: - name: Checkout repository uses: actions/checkout@v4 @@ -25,14 +23,29 @@ jobs: - name: Setup Bun uses: ./.github/actions/setup-bun - - name: Generate SDK - run: | - bun ./packages/sdk/js/script/build.ts - (cd packages/opencode && bun dev generate > ../sdk/openapi.json) - bun x prettier --write packages/sdk/openapi.json + - name: Generate + run: ./script/generate.ts - - name: Format - run: ./script/format.ts - env: - CI: true - PUSH_BRANCH: ${{ github.event.pull_request.head.ref || github.ref_name }} + - name: Commit and push + run: | + if [ -z "$(git status --porcelain)" ]; then + echo "No changes to commit" + exit 0 + fi + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git add -A + git commit -m "chore: generate" + git push origin HEAD:${{ github.ref_name }} --no-verify + # if ! git push origin HEAD:${{ github.event.pull_request.head.ref || github.ref_name }} --no-verify; then + # echo "" + # echo "============================================" + # echo "Failed to push generated code." + # echo "Please run locally and push:" + # echo "" + # echo " ./script/generate.ts" + # echo " git add -A && git commit -m \"chore: generate\" && git push" + # echo "" + # echo "============================================" + # exit 1 + # fi diff --git a/.github/workflows/nix-desktop.yml b/.github/workflows/nix-desktop.yml new file mode 100644 index 00000000000..3d7c4803133 --- /dev/null +++ b/.github/workflows/nix-desktop.yml @@ -0,0 +1,46 @@ +name: nix desktop + +on: + push: + branches: [dev] + paths: + - "flake.nix" + - "flake.lock" + - "nix/**" + - "packages/app/**" + - "packages/desktop/**" + - ".github/workflows/nix-desktop.yml" + pull_request: + paths: + - "flake.nix" + - "flake.lock" + - "nix/**" + - "packages/app/**" + - "packages/desktop/**" + - ".github/workflows/nix-desktop.yml" + workflow_dispatch: + +jobs: + build-desktop: + strategy: + fail-fast: false + matrix: + os: + - blacksmith-4vcpu-ubuntu-2404 + - blacksmith-4vcpu-ubuntu-2404-arm + - macos-15-intel + - macos-latest + runs-on: ${{ matrix.os }} + timeout-minutes: 60 + steps: + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Setup Nix + uses: nixbuild/nix-quick-install-action@v34 + + - name: Build desktop via flake + run: | + set -euo pipefail + nix --version + nix build .#desktop -L diff --git a/.github/workflows/notify-discord.yml b/.github/workflows/notify-discord.yml index d12cc7d733d..62577ecf00e 100644 --- a/.github/workflows/notify-discord.yml +++ b/.github/workflows/notify-discord.yml @@ -2,7 +2,7 @@ name: discord on: release: - types: [published] # fires only when a release is published + types: [released] # fires when a draft release is published jobs: notify: diff --git a/.github/workflows/opencode.yml b/.github/workflows/opencode.yml index 4c75ad2e047..76e75fcaefb 100644 --- a/.github/workflows/opencode.yml +++ b/.github/workflows/opencode.yml @@ -26,9 +26,9 @@ jobs: - uses: ./.github/actions/setup-bun - name: Run opencode - uses: sst/opencode/github@latest + uses: anomalyco/opencode/github@latest env: OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }} OPENCODE_PERMISSION: '{"bash": "deny"}' with: - model: opencode/claude-haiku-4-5 + model: opencode/claude-opus-4-5 diff --git a/.github/workflows/pr-standards.yml b/.github/workflows/pr-standards.yml new file mode 100644 index 00000000000..c1cf1756787 --- /dev/null +++ b/.github/workflows/pr-standards.yml @@ -0,0 +1,139 @@ +name: PR Standards + +on: + pull_request_target: + types: [opened, edited, synchronize] + +jobs: + check-standards: + if: | + github.event.pull_request.user.login != 'actions-user' && + github.event.pull_request.user.login != 'opencode' && + github.event.pull_request.user.login != 'rekram1-node' && + github.event.pull_request.user.login != 'thdxr' && + github.event.pull_request.user.login != 'kommander' && + github.event.pull_request.user.login != 'jayair' && + github.event.pull_request.user.login != 'fwang' && + github.event.pull_request.user.login != 'adamdotdevin' && + github.event.pull_request.user.login != 'iamdavidhill' && + github.event.pull_request.user.login != 'opencode-agent[bot]' + runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: + - name: Check PR standards + uses: actions/github-script@v7 + with: + script: | + const pr = context.payload.pull_request; + const title = pr.title; + + async function addLabel(label) { + await github.rest.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: pr.number, + labels: [label] + }); + } + + async function removeLabel(label) { + try { + await github.rest.issues.removeLabel({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: pr.number, + name: label + }); + } catch (e) { + // Label wasn't present, ignore + } + } + + async function comment(marker, body) { + const markerText = ``; + const { data: comments } = await github.rest.issues.listComments({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: pr.number + }); + + const existing = comments.find(c => c.body.includes(markerText)); + if (existing) return; + + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: pr.number, + body: markerText + '\n' + body + }); + } + + // Step 1: Check title format + // Matches: feat:, feat(scope):, feat (scope):, etc. + const titlePattern = /^(feat|fix|docs|chore|refactor|test)\s*(\([a-zA-Z0-9-]+\))?\s*:/; + const hasValidTitle = titlePattern.test(title); + + if (!hasValidTitle) { + await addLabel('needs:title'); + await comment('title', `Hey! Your PR title \`${title}\` doesn't follow conventional commit format. + + Please update it to start with one of: + - \`feat:\` or \`feat(scope):\` new feature + - \`fix:\` or \`fix(scope):\` bug fix + - \`docs:\` or \`docs(scope):\` documentation changes + - \`chore:\` or \`chore(scope):\` maintenance tasks + - \`refactor:\` or \`refactor(scope):\` code refactoring + - \`test:\` or \`test(scope):\` adding or updating tests + + Where \`scope\` is the package name (e.g., \`app\`, \`desktop\`, \`opencode\`). + + See [CONTRIBUTING.md](../blob/dev/CONTRIBUTING.md#pr-titles) for details.`); + return; + } + + await removeLabel('needs:title'); + + // Step 2: Check for linked issue (skip for docs/refactor PRs) + const skipIssueCheck = /^(docs|refactor)\s*(\([a-zA-Z0-9-]+\))?\s*:/.test(title); + if (skipIssueCheck) { + await removeLabel('needs:issue'); + console.log('Skipping issue check for docs/refactor PR'); + return; + } + const query = ` + query($owner: String!, $repo: String!, $number: Int!) { + repository(owner: $owner, name: $repo) { + pullRequest(number: $number) { + closingIssuesReferences(first: 1) { + totalCount + } + } + } + } + `; + + const result = await github.graphql(query, { + owner: context.repo.owner, + repo: context.repo.repo, + number: pr.number + }); + + const linkedIssues = result.repository.pullRequest.closingIssuesReferences.totalCount; + + if (linkedIssues === 0) { + await addLabel('needs:issue'); + await comment('issue', `Thanks for your contribution! + + This PR doesn't have a linked issue. All PRs must reference an existing issue. + + Please: + 1. Open an issue describing the bug/feature (if one doesn't exist) + 2. Add \`Fixes #\` or \`Closes #\` to this PR description + + See [CONTRIBUTING.md](../blob/dev/CONTRIBUTING.md#issue-first-policy) for details.`); + return; + } + + await removeLabel('needs:issue'); + console.log('PR meets all standards'); diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 9c44efe1b3d..8d7a823b144 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -21,7 +21,7 @@ on: required: false type: string -concurrency: ${{ github.workflow }}-${{ github.ref }} +concurrency: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.version || inputs.bump }} permissions: id-token: write @@ -31,7 +31,7 @@ permissions: jobs: publish: runs-on: blacksmith-4vcpu-ubuntu-2404 - if: github.repository == 'sst/opencode' + if: github.repository == 'anomalyco/opencode' steps: - uses: actions/checkout@v3 with: @@ -41,21 +41,9 @@ jobs: - uses: ./.github/actions/setup-bun - - name: Setup SSH for AUR - if: inputs.bump || inputs.version - run: | - sudo apt-get update - sudo apt-get install -y pacman-package-manager - mkdir -p ~/.ssh - echo "${{ secrets.AUR_KEY }}" > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa - git config --global user.email "opencode@sst.dev" - git config --global user.name "opencode" - ssh-keyscan -H aur.archlinux.org >> ~/.ssh/known_hosts || true - - name: Install OpenCode if: inputs.bump || inputs.version - run: bun i -g opencode-ai@1.0.143 + run: bun i -g opencode-ai@1.0.169 - name: Login to GitHub Container Registry uses: docker/login-action@v3 @@ -75,9 +63,15 @@ jobs: node-version: "24" registry-url: "https://registry.npmjs.org" + - name: Setup Git Identity + run: | + git config --global user.email "opencode@sst.dev" + git config --global user.name "opencode" + git remote set-url origin https://x-access-token:${{ secrets.SST_GITHUB_TOKEN }}@github.com/${{ github.repository }} + - name: Publish id: publish - run: ./script/publish.ts + run: ./script/publish-start.ts env: OPENCODE_BUMP: ${{ inputs.bump }} OPENCODE_VERSION: ${{ inputs.version }} @@ -85,13 +79,20 @@ jobs: AUR_KEY: ${{ secrets.AUR_KEY }} GITHUB_TOKEN: ${{ secrets.SST_GITHUB_TOKEN }} NPM_CONFIG_PROVENANCE: false + + - uses: actions/upload-artifact@v4 + with: + name: opencode-cli + path: packages/opencode/dist + outputs: - releaseId: ${{ steps.publish.outputs.releaseId }} - tagName: ${{ steps.publish.outputs.tagName }} + release: ${{ steps.publish.outputs.release }} + tag: ${{ steps.publish.outputs.tag }} + version: ${{ steps.publish.outputs.version }} publish-tauri: needs: publish - continue-on-error: true + continue-on-error: false strategy: fail-fast: false matrix: @@ -104,11 +105,14 @@ jobs: target: x86_64-pc-windows-msvc - host: blacksmith-4vcpu-ubuntu-2404 target: x86_64-unknown-linux-gnu + - host: blacksmith-4vcpu-ubuntu-2404-arm + target: aarch64-unknown-linux-gnu runs-on: ${{ matrix.settings.host }} steps: - uses: actions/checkout@v3 with: fetch-depth: 0 + ref: ${{ needs.publish.outputs.tag }} - uses: apple-actions/import-codesign-certs@v2 if: ${{ runner.os == 'macOS' }} @@ -147,30 +151,48 @@ jobs: - uses: Swatinem/rust-cache@v2 with: - workspaces: packages/tauri/src-tauri + workspaces: packages/desktop/src-tauri shared-key: ${{ matrix.settings.target }} - name: Prepare run: | - cd packages/tauri + cd packages/desktop bun ./scripts/prepare.ts env: - OPENCODE_BUMP: ${{ inputs.bump }} - OPENCODE_VERSION: ${{ inputs.version }} - OPENCODE_CHANNEL: latest + OPENCODE_VERSION: ${{ needs.publish.outputs.version }} NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }} GITHUB_TOKEN: ${{ secrets.SST_GITHUB_TOKEN }} AUR_KEY: ${{ secrets.AUR_KEY }} OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }} RUST_TARGET: ${{ matrix.settings.target }} GH_TOKEN: ${{ github.token }} + GITHUB_RUN_ID: ${{ github.run_id }} # Fixes AppImage build issues, can be removed when https://github.com/tauri-apps/tauri/pull/12491 is released - - run: cargo install tauri-cli --git https://github.com/tauri-apps/tauri --branch feat/truly-portable-appimage + - name: Install tauri-cli from portable appimage branch if: contains(matrix.settings.host, 'ubuntu') + run: | + cargo install tauri-cli --git https://github.com/tauri-apps/tauri --branch feat/truly-portable-appimage --force + echo "Installed tauri-cli version:" + cargo tauri --version - name: Build and upload artifacts - uses: tauri-apps/tauri-action@390cbe447412ced1303d35abe75287949e43437a + uses: Wandalen/wretry.action@v3 + timeout-minutes: 60 + with: + attempt_limit: 3 + attempt_delay: 10000 + action: tauri-apps/tauri-action@390cbe447412ced1303d35abe75287949e43437a + with: | + projectPath: packages/desktop + uploadWorkflowArtifacts: true + tauriScript: ${{ (contains(matrix.settings.host, 'ubuntu') && 'cargo tauri') || '' }} + args: --target ${{ matrix.settings.target }} --config ./src-tauri/tauri.prod.conf.json --verbose + updaterJsonPreferNsis: true + releaseId: ${{ needs.publish.outputs.release }} + tagName: ${{ needs.publish.outputs.tag }} + releaseAssetNamePattern: opencode-desktop-[platform]-[arch][ext] + releaseDraft: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} TAURI_BUNDLER_NEW_APPIMAGE_FORMAT: true @@ -182,12 +204,34 @@ jobs: APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }} APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }} APPLE_API_KEY_PATH: ${{ runner.temp }}/apple-api-key.p8 + + publish-release: + needs: + - publish + - publish-tauri + if: needs.publish.outputs.tag + runs-on: blacksmith-4vcpu-ubuntu-2404 + steps: + - uses: actions/checkout@v3 with: - projectPath: packages/tauri - uploadWorkflowArtifacts: true - tauriScript: ${{ (contains(matrix.settings.host, 'ubuntu') && 'cargo tauri') || '' }} - args: --target ${{ matrix.settings.target }} - updaterJsonPreferNsis: true - releaseId: ${{ needs.publish.outputs.releaseId }} - tagName: ${{ needs.publish.outputs.tagName }} - releaseAssetNamePattern: opencode-desktop-[platform]-[arch][ext] + fetch-depth: 0 + ref: ${{ needs.publish.outputs.tag }} + + - uses: ./.github/actions/setup-bun + + - name: Setup SSH for AUR + run: | + sudo apt-get update + sudo apt-get install -y pacman-package-manager + mkdir -p ~/.ssh + echo "${{ secrets.AUR_KEY }}" > ~/.ssh/id_rsa + chmod 600 ~/.ssh/id_rsa + git config --global user.email "opencode@sst.dev" + git config --global user.name "opencode" + ssh-keyscan -H aur.archlinux.org >> ~/.ssh/known_hosts || true + + - run: ./script/publish-complete.ts + env: + OPENCODE_VERSION: ${{ needs.publish.outputs.version }} + AUR_KEY: ${{ secrets.AUR_KEY }} + GITHUB_TOKEN: ${{ secrets.SST_GITHUB_TOKEN }} diff --git a/.github/workflows/release-github-action.yml b/.github/workflows/release-github-action.yml new file mode 100644 index 00000000000..3f5caa55c8d --- /dev/null +++ b/.github/workflows/release-github-action.yml @@ -0,0 +1,29 @@ +name: release-github-action + +on: + push: + branches: + - dev + paths: + - "github/**" + +concurrency: ${{ github.workflow }}-${{ github.ref }} + +permissions: + contents: write + +jobs: + release: + runs-on: blacksmith-4vcpu-ubuntu-2404 + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - run: git fetch --force --tags + + - name: Release + run: | + git config --global user.email "opencode@sst.dev" + git config --global user.name "opencode" + ./github/script/release diff --git a/.github/workflows/review.yml b/.github/workflows/review.yml index d974e2a76d7..93b01bafa2b 100644 --- a/.github/workflows/review.yml +++ b/.github/workflows/review.yml @@ -29,6 +29,8 @@ jobs: with: fetch-depth: 1 + - uses: ./.github/actions/setup-bun + - name: Install opencode run: curl -fsSL https://opencode.ai/install | bash @@ -45,7 +47,7 @@ jobs: env: ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - OPENCODE_PERMISSION: '{ "bash": { "gh*": "allow", "gh pr review*": "deny", "*": "deny" } }' + OPENCODE_PERMISSION: '{ "bash": { "*": "deny", "gh*": "allow", "gh pr review*": "deny" } }' PR_TITLE: ${{ steps.pr-details.outputs.title }} run: | PR_BODY=$(jq -r .body pr_data.json) @@ -62,9 +64,11 @@ jobs: Please check all the code changes in this pull request against the style guide, also look for any bugs if they exist. Diffs are important but make sure you read the entire file to get proper context. Make it clear the suggestions are merely suggestions and the human can decide what to do When critiquing code against the style guide, be sure that the code is ACTUALLY in violation, don't complain about else statements if they already use early returns there. You may complain about excessive nesting though, regardless of else statement usage. - When critiquing code style don't be a zealot, we don't like "let" statements but sometimes they are the simpliest option, if someone does a bunch of nesting with let, they should consider using iife (see packages/opencode/src/util.iife.ts) + When critiquing code style don't be a zealot, we don't like "let" statements but sometimes they are the simplest option, if someone does a bunch of nesting with let, they should consider using iife (see packages/opencode/src/util.iife.ts) Use the gh cli to create comments on the files for the violations. Try to leave the comment on the exact line number. If you have a suggested fix include it in a suggestion code block. + If you are writing suggested fixes, BE SURE THAT the change you are recommending is actually valid typescript, often I have seen missing closing "}" or other syntax errors. + Generally, write a comment instead of writing suggested change if you can help it. Command MUST be like this. \`\`\` diff --git a/.github/workflows/stale-issues.yml b/.github/workflows/stale-issues.yml new file mode 100644 index 00000000000..b5378d7d527 --- /dev/null +++ b/.github/workflows/stale-issues.yml @@ -0,0 +1,33 @@ +name: "Auto-close stale issues" + +on: + schedule: + - cron: "30 1 * * *" # Daily at 1:30 AM + workflow_dispatch: + +env: + DAYS_BEFORE_STALE: 90 + DAYS_BEFORE_CLOSE: 7 + +jobs: + stale: + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - uses: actions/stale@v10 + with: + days-before-stale: ${{ env.DAYS_BEFORE_STALE }} + days-before-close: ${{ env.DAYS_BEFORE_CLOSE }} + stale-issue-label: "stale" + close-issue-message: | + [automated] Closing due to ${{ env.DAYS_BEFORE_STALE }}+ days of inactivity. + + Feel free to reopen if you still need this! + stale-issue-message: | + [automated] This issue has had no activity for ${{ env.DAYS_BEFORE_STALE }} days. + + It will be closed in ${{ env.DAYS_BEFORE_CLOSE }} days if there's no new activity. + remove-stale-when-updated: true + exempt-issue-labels: "pinned,security,feature-request,on-hold" + start-date: "2025-12-27" diff --git a/.github/workflows/stats.yml b/.github/workflows/stats.yml index 97e9245179b..824733901d6 100644 --- a/.github/workflows/stats.yml +++ b/.github/workflows/stats.yml @@ -5,8 +5,11 @@ on: - cron: "0 12 * * *" # Run daily at 12:00 UTC workflow_dispatch: # Allow manual trigger +concurrency: ${{ github.workflow }}-${{ github.ref }} + jobs: stats: + if: github.repository == 'anomalyco/opencode' runs-on: blacksmith-4vcpu-ubuntu-2404 permissions: contents: write diff --git a/.github/workflows/sync-zed-extension.yml b/.github/workflows/sync-zed-extension.yml index a504582c3c8..f14487cde97 100644 --- a/.github/workflows/sync-zed-extension.yml +++ b/.github/workflows/sync-zed-extension.yml @@ -2,8 +2,8 @@ name: "sync-zed-extension" on: workflow_dispatch: - # release: - # types: [published] + release: + types: [published] jobs: zed: @@ -31,4 +31,5 @@ jobs: run: | ./script/sync-zed.ts ${{ steps.get_tag.outputs.tag }} env: - GITHUB_TOKEN: ${{ secrets.SST_GITHUB_TOKEN }} + ZED_EXTENSIONS_PAT: ${{ secrets.ZED_EXTENSIONS_PAT }} + ZED_PR_PAT: ${{ secrets.ZED_PR_PAT }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ac1a24fd514..fcbf9569f57 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,15 +2,35 @@ name: test on: push: - branches-ignore: - - production + branches: + - dev pull_request: - branches-ignore: - - production workflow_dispatch: jobs: test: - runs-on: blacksmith-4vcpu-ubuntu-2404 + name: test (${{ matrix.settings.name }}) + strategy: + fail-fast: false + matrix: + settings: + - name: linux + host: blacksmith-4vcpu-ubuntu-2404 + playwright: bunx playwright install --with-deps + workdir: . + command: | + git config --global user.email "bot@opencode.ai" + git config --global user.name "opencode" + bun turbo typecheck + bun turbo test + - name: windows + host: windows-latest + playwright: bunx playwright install + workdir: packages/app + command: bun test:e2e:local + runs-on: ${{ matrix.settings.host }} + defaults: + run: + shell: bash steps: - name: Checkout repository uses: actions/checkout@v4 @@ -20,11 +40,108 @@ jobs: - name: Setup Bun uses: ./.github/actions/setup-bun - - name: run + - name: Install Playwright browsers + working-directory: packages/app + run: ${{ matrix.settings.playwright }} + + - name: Set OS-specific paths + run: | + if [ "${{ runner.os }}" = "Windows" ]; then + printf '%s\n' "OPENCODE_E2E_ROOT=${{ runner.temp }}\\opencode-e2e" >> "$GITHUB_ENV" + printf '%s\n' "OPENCODE_TEST_HOME=${{ runner.temp }}\\opencode-e2e\\home" >> "$GITHUB_ENV" + printf '%s\n' "XDG_DATA_HOME=${{ runner.temp }}\\opencode-e2e\\share" >> "$GITHUB_ENV" + printf '%s\n' "XDG_CACHE_HOME=${{ runner.temp }}\\opencode-e2e\\cache" >> "$GITHUB_ENV" + printf '%s\n' "XDG_CONFIG_HOME=${{ runner.temp }}\\opencode-e2e\\config" >> "$GITHUB_ENV" + printf '%s\n' "XDG_STATE_HOME=${{ runner.temp }}\\opencode-e2e\\state" >> "$GITHUB_ENV" + printf '%s\n' "MODELS_DEV_API_JSON=${{ github.workspace }}\\packages\\opencode\\test\\tool\\fixtures\\models-api.json" >> "$GITHUB_ENV" + else + printf '%s\n' "OPENCODE_E2E_ROOT=${{ runner.temp }}/opencode-e2e" >> "$GITHUB_ENV" + printf '%s\n' "OPENCODE_TEST_HOME=${{ runner.temp }}/opencode-e2e/home" >> "$GITHUB_ENV" + printf '%s\n' "XDG_DATA_HOME=${{ runner.temp }}/opencode-e2e/share" >> "$GITHUB_ENV" + printf '%s\n' "XDG_CACHE_HOME=${{ runner.temp }}/opencode-e2e/cache" >> "$GITHUB_ENV" + printf '%s\n' "XDG_CONFIG_HOME=${{ runner.temp }}/opencode-e2e/config" >> "$GITHUB_ENV" + printf '%s\n' "XDG_STATE_HOME=${{ runner.temp }}/opencode-e2e/state" >> "$GITHUB_ENV" + printf '%s\n' "MODELS_DEV_API_JSON=${{ github.workspace }}/packages/opencode/test/tool/fixtures/models-api.json" >> "$GITHUB_ENV" + fi + + - name: Seed opencode data + if: matrix.settings.name != 'windows' + working-directory: packages/opencode + run: bun script/seed-e2e.ts + env: + MODELS_DEV_API_JSON: ${{ env.MODELS_DEV_API_JSON }} + OPENCODE_DISABLE_MODELS_FETCH: "true" + OPENCODE_DISABLE_SHARE: "true" + OPENCODE_DISABLE_LSP_DOWNLOAD: "true" + OPENCODE_DISABLE_DEFAULT_PLUGINS: "true" + OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER: "true" + OPENCODE_TEST_HOME: ${{ env.OPENCODE_TEST_HOME }} + XDG_DATA_HOME: ${{ env.XDG_DATA_HOME }} + XDG_CACHE_HOME: ${{ env.XDG_CACHE_HOME }} + XDG_CONFIG_HOME: ${{ env.XDG_CONFIG_HOME }} + XDG_STATE_HOME: ${{ env.XDG_STATE_HOME }} + OPENCODE_E2E_PROJECT_DIR: ${{ github.workspace }} + OPENCODE_E2E_SESSION_TITLE: "E2E Session" + OPENCODE_E2E_MESSAGE: "Seeded for UI e2e" + OPENCODE_E2E_MODEL: "opencode/gpt-5-nano" + + - name: Run opencode server + if: matrix.settings.name != 'windows' + working-directory: packages/opencode + run: bun dev -- --print-logs --log-level WARN serve --port 4096 --hostname 127.0.0.1 & + env: + MODELS_DEV_API_JSON: ${{ env.MODELS_DEV_API_JSON }} + OPENCODE_DISABLE_MODELS_FETCH: "true" + OPENCODE_DISABLE_SHARE: "true" + OPENCODE_DISABLE_LSP_DOWNLOAD: "true" + OPENCODE_DISABLE_DEFAULT_PLUGINS: "true" + OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER: "true" + OPENCODE_TEST_HOME: ${{ env.OPENCODE_TEST_HOME }} + XDG_DATA_HOME: ${{ env.XDG_DATA_HOME }} + XDG_CACHE_HOME: ${{ env.XDG_CACHE_HOME }} + XDG_CONFIG_HOME: ${{ env.XDG_CONFIG_HOME }} + XDG_STATE_HOME: ${{ env.XDG_STATE_HOME }} + OPENCODE_CLIENT: "app" + + - name: Wait for opencode server + if: matrix.settings.name != 'windows' run: | - git config --global user.email "bot@opencode.ai" - git config --global user.name "opencode" - bun turbo typecheck - bun turbo test + for i in {1..120}; do + curl -fsS "http://127.0.0.1:4096/global/health" > /dev/null && exit 0 + sleep 1 + done + exit 1 + + - name: run + working-directory: ${{ matrix.settings.workdir }} + run: ${{ matrix.settings.command }} env: CI: true + MODELS_DEV_API_JSON: ${{ env.MODELS_DEV_API_JSON }} + OPENCODE_DISABLE_MODELS_FETCH: "true" + OPENCODE_DISABLE_SHARE: "true" + OPENCODE_DISABLE_LSP_DOWNLOAD: "true" + OPENCODE_DISABLE_DEFAULT_PLUGINS: "true" + OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER: "true" + OPENCODE_TEST_HOME: ${{ env.OPENCODE_TEST_HOME }} + XDG_DATA_HOME: ${{ env.XDG_DATA_HOME }} + XDG_CACHE_HOME: ${{ env.XDG_CACHE_HOME }} + XDG_CONFIG_HOME: ${{ env.XDG_CONFIG_HOME }} + XDG_STATE_HOME: ${{ env.XDG_STATE_HOME }} + PLAYWRIGHT_SERVER_HOST: "127.0.0.1" + PLAYWRIGHT_SERVER_PORT: "4096" + VITE_OPENCODE_SERVER_HOST: "127.0.0.1" + VITE_OPENCODE_SERVER_PORT: "4096" + OPENCODE_CLIENT: "app" + timeout-minutes: 30 + + - name: Upload Playwright artifacts + if: failure() + uses: actions/upload-artifact@v4 + with: + name: playwright-${{ matrix.settings.name }}-${{ github.run_attempt }} + if-no-files-found: ignore + retention-days: 7 + path: | + packages/app/e2e/test-results + packages/app/e2e/playwright-report diff --git a/.github/workflows/triage.yml b/.github/workflows/triage.yml new file mode 100644 index 00000000000..6e150957291 --- /dev/null +++ b/.github/workflows/triage.yml @@ -0,0 +1,37 @@ +name: Issue Triage + +on: + issues: + types: [opened] + +jobs: + triage: + runs-on: blacksmith-4vcpu-ubuntu-2404 + permissions: + contents: read + issues: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - name: Setup Bun + uses: ./.github/actions/setup-bun + + - name: Install opencode + run: curl -fsSL https://opencode.ai/install | bash + + - name: Triage issue + env: + OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ISSUE_NUMBER: ${{ github.event.issue.number }} + ISSUE_TITLE: ${{ github.event.issue.title }} + ISSUE_BODY: ${{ github.event.issue.body }} + run: | + opencode run --agent triage "The following issue was just opened, triage it: + + Title: $ISSUE_TITLE + + $ISSUE_BODY" diff --git a/.github/workflows/update-nix-hashes.yml b/.github/workflows/update-nix-hashes.yml index d2c60b08f01..7175f4fbdd6 100644 --- a/.github/workflows/update-nix-hashes.yml +++ b/.github/workflows/update-nix-hashes.yml @@ -10,22 +10,26 @@ on: - "bun.lock" - "package.json" - "packages/*/package.json" + - "flake.lock" + - ".github/workflows/update-nix-hashes.yml" pull_request: paths: - "bun.lock" - "package.json" - "packages/*/package.json" + - "flake.lock" + - ".github/workflows/update-nix-hashes.yml" jobs: - update: + update-node-modules-hashes: if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository runs-on: blacksmith-4vcpu-ubuntu-2404 env: - SYSTEM: x86_64-linux + TITLE: node_modules hashes steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: token: ${{ secrets.GITHUB_TOKEN }} fetch-depth: 0 @@ -33,39 +37,76 @@ jobs: repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} - name: Setup Nix - uses: DeterminateSystems/nix-installer-action@v20 + uses: nixbuild/nix-quick-install-action@v34 - name: Configure git run: | git config --global user.email "action@github.com" git config --global user.name "Github Action" - - name: Update flake.lock + - name: Pull latest changes + env: + TARGET_BRANCH: ${{ github.head_ref || github.ref_name }} run: | - set -euo pipefail - echo "📦 Updating flake.lock..." - nix flake update - echo "✅ flake.lock updated successfully" + BRANCH="${TARGET_BRANCH:-${GITHUB_REF_NAME}}" + git pull --rebase --autostash origin "$BRANCH" - - name: Update node_modules hash + - name: Compute all node_modules hashes run: | set -euo pipefail - echo "🔄 Updating node_modules hash..." - nix/scripts/update-hashes.sh - echo "✅ node_modules hash updated successfully" - - name: Commit hash changes + HASH_FILE="nix/hashes.json" + SYSTEMS="x86_64-linux aarch64-linux x86_64-darwin aarch64-darwin" + + if [ ! -f "$HASH_FILE" ]; then + mkdir -p "$(dirname "$HASH_FILE")" + echo '{"nodeModules":{}}' > "$HASH_FILE" + fi + + for SYSTEM in $SYSTEMS; do + echo "Computing hash for ${SYSTEM}..." + BUILD_LOG=$(mktemp) + trap 'rm -f "$BUILD_LOG"' EXIT + + # The updater derivations use fakeHash, so they will fail and reveal the correct hash + UPDATER_ATTR=".#packages.x86_64-linux.${SYSTEM}_node_modules" + + nix build "$UPDATER_ATTR" --no-link 2>&1 | tee "$BUILD_LOG" || true + + CORRECT_HASH="$(grep -E 'got:\s+sha256-[A-Za-z0-9+/=]+' "$BUILD_LOG" | awk '{print $2}' | head -n1 || true)" + + if [ -z "$CORRECT_HASH" ]; then + CORRECT_HASH="$(grep -A2 'hash mismatch' "$BUILD_LOG" | grep 'got:' | awk '{print $2}' | sed 's/sha256:/sha256-/' || true)" + fi + + if [ -z "$CORRECT_HASH" ]; then + echo "Failed to determine correct node_modules hash for ${SYSTEM}." + cat "$BUILD_LOG" + exit 1 + fi + + echo " ${SYSTEM}: ${CORRECT_HASH}" + jq --arg sys "$SYSTEM" --arg h "$CORRECT_HASH" \ + '.nodeModules[$sys] = $h' "$HASH_FILE" > "${HASH_FILE}.tmp" + mv "${HASH_FILE}.tmp" "$HASH_FILE" + done + + echo "All hashes computed:" + cat "$HASH_FILE" + + - name: Commit ${{ env.TITLE }} changes env: TARGET_BRANCH: ${{ github.head_ref || github.ref_name }} run: | set -euo pipefail - echo "🔍 Checking for changes in tracked Nix files..." + HASH_FILE="nix/hashes.json" + echo "Checking for changes..." summarize() { local status="$1" { - echo "### Nix Hash Update" + echo "### Nix $TITLE" echo "" echo "- ref: ${GITHUB_REF_NAME}" echo "- status: ${status}" @@ -76,27 +117,22 @@ jobs: echo "" >> "$GITHUB_STEP_SUMMARY" } - FILES=(flake.lock flake.nix nix/node-modules.nix nix/hashes.json) + FILES=("$HASH_FILE") STATUS="$(git status --short -- "${FILES[@]}" || true)" if [ -z "$STATUS" ]; then - echo "✅ No changes detected. Hashes are already up to date." + echo "No changes detected." summarize "no changes" exit 0 fi - echo "📝 Changes detected:" + echo "Changes detected:" echo "$STATUS" - echo "🔗 Staging files..." git add "${FILES[@]}" - echo "💾 Committing changes..." - git commit -m "Update Nix flake.lock and hashes" - echo "✅ Changes committed" + git commit -m "chore: update nix node_modules hashes" BRANCH="${TARGET_BRANCH:-${GITHUB_REF_NAME}}" - echo "🌳 Pulling latest from branch: $BRANCH" - git pull --rebase origin "$BRANCH" - echo "🚀 Pushing changes to branch: $BRANCH" + git pull --rebase --autostash origin "$BRANCH" git push origin HEAD:"$BRANCH" - echo "✅ Changes pushed successfully" + echo "Changes pushed successfully" summarize "committed $(git rev-parse --short HEAD)" diff --git a/.gitignore b/.gitignore index 3d4f9095ab0..78a77f81982 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,10 @@ Session.vim opencode.json a.out target +.scripts +.direnv/ + +# Local dev files +opencode-dev +logs/ +*.bun-build diff --git a/.husky/pre-push b/.husky/pre-push index 2fd039d56dd..5d3cc53411b 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -1,9 +1,20 @@ #!/bin/sh +set -e # Check if bun version matches package.json -EXPECTED_VERSION=$(grep '"packageManager"' package.json | sed 's/.*"bun@\([^"]*\)".*/\1/') -CURRENT_VERSION=$(bun --version) -if [ "$CURRENT_VERSION" != "$EXPECTED_VERSION" ]; then - echo "Error: Bun version $CURRENT_VERSION does not match expected version $EXPECTED_VERSION from package.json" - exit 1 -fi +# keep in sync with packages/script/src/index.ts semver qualifier +bun -e ' +import { semver } from "bun"; +const pkg = await Bun.file("package.json").json(); +const expectedBunVersion = pkg.packageManager?.split("@")[1]; +if (!expectedBunVersion) { + throw new Error("packageManager field not found in root package.json"); +} +const expectedBunVersionRange = `^${expectedBunVersion}`; +if (!semver.satisfies(process.versions.bun, expectedBunVersionRange)) { + throw new Error(`This script requires bun@${expectedBunVersionRange}, but you are using bun@${process.versions.bun}`); +} +if (process.versions.bun !== expectedBunVersion) { + console.warn(`Warning: Bun version ${process.versions.bun} differs from expected ${expectedBunVersion}`); +} +' bun typecheck diff --git a/.opencode/.gitignore b/.opencode/.gitignore new file mode 100644 index 00000000000..00bfdfda298 --- /dev/null +++ b/.opencode/.gitignore @@ -0,0 +1,3 @@ +plans/ +bun.lock +package.json diff --git a/.opencode/agent/docs.md b/.opencode/agent/docs.md index be7c203668e..21cfc6a16e0 100644 --- a/.opencode/agent/docs.md +++ b/.opencode/agent/docs.md @@ -1,11 +1,14 @@ --- description: ALWAYS use this when writing docs +color: "#38A3EE" --- You are an expert technical documentation writer You are not verbose +Use a relaxed and friendly tone + The title of the page should be a word or a 2-3 word phrase The description should be one short line, should not start with "The", should diff --git a/.opencode/agent/duplicate-pr.md b/.opencode/agent/duplicate-pr.md new file mode 100644 index 00000000000..c9c932ef790 --- /dev/null +++ b/.opencode/agent/duplicate-pr.md @@ -0,0 +1,26 @@ +--- +mode: primary +hidden: true +model: opencode/claude-haiku-4-5 +color: "#E67E22" +tools: + "*": false + "github-pr-search": true +--- + +You are a duplicate PR detection agent. When a PR is opened, your job is to search for potentially duplicate or related open PRs. + +Use the github-pr-search tool to search for PRs that might be addressing the same issue or feature. + +IMPORTANT: The input will contain a line `CURRENT_PR_NUMBER: NNNN`. This is the current PR number, you should not mark that the current PR as a duplicate of itself. + +Search using keywords from the PR title and description. Try multiple searches with different relevant terms. + +If you find potential duplicates: + +- List them with their titles and URLs +- Briefly explain why they might be related + +If no duplicates are found, say so clearly. BUT ONLY SAY "No duplicate PRs found" (don't say anything else if no dups) + +Keep your response concise and actionable. diff --git a/.opencode/agent/git-committer.md b/.opencode/agent/git-committer.md deleted file mode 100644 index 49c3e3de19f..00000000000 --- a/.opencode/agent/git-committer.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -description: Use this agent when you are asked to commit and push code changes to a git repository. -mode: subagent ---- - -You commit and push to git - -Commit messages should be brief since they are used to generate release notes. - -Messages should say WHY the change was made and not WHAT was changed. diff --git a/.opencode/agent/triage.md b/.opencode/agent/triage.md new file mode 100644 index 00000000000..5d1147a8859 --- /dev/null +++ b/.opencode/agent/triage.md @@ -0,0 +1,78 @@ +--- +mode: primary +hidden: true +model: opencode/claude-haiku-4-5 +color: "#44BA81" +tools: + "*": false + "github-triage": true +--- + +You are a triage agent responsible for triaging github issues. + +Use your github-triage tool to triage issues. + +## Labels + +### windows + +Use for any issue that mentions Windows (the OS). Be sure they are saying that they are on Windows. + +- Use if they mention WSL too + +#### perf + +Performance-related issues: + +- Slow performance +- High RAM usage +- High CPU usage + +**Only** add if it's likely a RAM or CPU issue. **Do not** add for LLM slowness. + +#### desktop + +Desktop app issues: + +- `opencode web` command +- The desktop app itself + +**Only** add if it's specifically about the Desktop application or `opencode web` view. **Do not** add for terminal, TUI, or general opencode issues. + +#### nix + +**Only** add if the issue explicitly mentions nix. + +#### zen + +**Only** add if the issue mentions "zen" or "opencode zen" or "opencode black". + +If the issue doesn't have "zen" or "opencode black" in it then don't add zen label + +#### docs + +Add if the issue requests better documentation or docs updates. + +#### opentui + +TUI issues potentially caused by our underlying TUI library: + +- Keybindings not working +- Scroll speed issues (too fast/slow/laggy) +- Screen flickering +- Crashes with opentui in the log + +**Do not** add for general TUI bugs. + +When assigning to people here are the following rules: + +adamdotdev: +ONLY assign adam if the issue will have the "desktop" label. + +fwang: +ONLY assign fwang if the issue will have the "zen" label. + +jayair: +ONLY assign jayair if the issue will have the "docs" label. + +In all other cases use best judgment. Avoid assigning to kommander needlessly, when in doubt assign to rekram1-node. diff --git a/.opencode/command/ai-deps.md b/.opencode/command/ai-deps.md new file mode 100644 index 00000000000..4d23c76a4d5 --- /dev/null +++ b/.opencode/command/ai-deps.md @@ -0,0 +1,24 @@ +--- +description: "Bump AI sdk dependencies minor / patch versions only" +--- + +Please read @package.json and @packages/opencode/package.json. + +Your job is to look into AI SDK dependencies, figure out if they have versions that can be upgraded (minor or patch versions ONLY no major ignore major changes). + +I want a report of every dependency and the version that can be upgraded to. +What would be even better is if you can give me links to the changelog for each dependency, or at least some reference info so I can see what bugs were fixed or new features were added. + +Consider using subagents for each dep to save your context window. + +Here is a short list of some deps (please be comprehensive tho): + +- "ai" +- "@ai-sdk/openai" +- "@ai-sdk/anthropic" +- "@openrouter/ai-sdk-provider" +- etc, etc + +DO NOT upgrade the dependencies yet, just make a list of all dependencies and their versions that can be upgraded to minor or patch versions only. + +Write up your findings to ai-sdk-updates.md diff --git a/.opencode/command/commit.md b/.opencode/command/commit.md index c318ed54b1a..8e9346ebc88 100644 --- a/.opencode/command/commit.md +++ b/.opencode/command/commit.md @@ -1,6 +1,7 @@ --- description: git commit and push model: opencode/glm-4.6 +subtask: true --- commit and push diff --git a/.opencode/command/issues.md b/.opencode/command/issues.md index 20ac4c18024..75b59616743 100644 --- a/.opencode/command/issues.md +++ b/.opencode/command/issues.md @@ -3,7 +3,7 @@ description: "find issue(s) on github" model: opencode/claude-haiku-4-5 --- -Search through existing issues in sst/opencode using the gh cli to find issues matching this query: +Search through existing issues in anomalyco/opencode using the gh cli to find issues matching this query: $ARGUMENTS diff --git a/.opencode/env.d.ts b/.opencode/env.d.ts new file mode 100644 index 00000000000..f2b13a934c4 --- /dev/null +++ b/.opencode/env.d.ts @@ -0,0 +1,4 @@ +declare module "*.txt" { + const content: string + export default content +} diff --git a/.opencode/opencode.jsonc b/.opencode/opencode.jsonc index fe70e35fa76..5d2dec625c6 100644 --- a/.opencode/opencode.jsonc +++ b/.opencode/opencode.jsonc @@ -10,4 +10,14 @@ "options": {}, }, }, + "mcp": { + "context7": { + "type": "remote", + "url": "https://mcp.context7.com/mcp", + }, + }, + "tools": { + "github-triage": false, + "github-pr-search": false, + }, } diff --git a/.opencode/skill/bun-file-io/SKILL.md b/.opencode/skill/bun-file-io/SKILL.md new file mode 100644 index 00000000000..ea39507d269 --- /dev/null +++ b/.opencode/skill/bun-file-io/SKILL.md @@ -0,0 +1,39 @@ +--- +name: bun-file-io +description: Use this when you are working on file operations like reading, writing, scanning, or deleting files. It summarizes the preferred file APIs and patterns used in this repo. It also notes when to use filesystem helpers for directories. +--- + +## Use this when + +- Editing file I/O or scans in `packages/opencode` +- Handling directory operations or external tools + +## Bun file APIs (from Bun docs) + +- `Bun.file(path)` is lazy; call `text`, `json`, `stream`, `arrayBuffer`, `bytes`, `exists` to read. +- Metadata: `file.size`, `file.type`, `file.name`. +- `Bun.write(dest, input)` writes strings, buffers, Blobs, Responses, or files. +- `Bun.file(...).delete()` deletes a file. +- `file.writer()` returns a FileSink for incremental writes. +- `Bun.Glob` + `Array.fromAsync(glob.scan({ cwd, absolute, onlyFiles, dot }))` for scans. +- Use `Bun.which` to find a binary, then `Bun.spawn` to run it. +- `Bun.readableStreamToText/Bytes/JSON` for stream output. + +## When to use node:fs + +- Use `node:fs/promises` for directories (`mkdir`, `readdir`, recursive operations). + +## Repo patterns + +- Prefer Bun APIs over Node `fs` for file access. +- Check `Bun.file(...).exists()` before reading. +- For binary/large files use `arrayBuffer()` and MIME checks via `file.type`. +- Use `Bun.Glob` + `Array.fromAsync` for scans. +- Decode tool stderr with `Bun.readableStreamToText`. +- For large writes, use `Bun.write(Bun.file(path), text)`. + +## Quick checklist + +- Use Bun APIs first. +- Use `path.join`/`path.resolve` for paths. +- Prefer promise `.catch(...)` over `try/catch` when possible. diff --git a/.opencode/tool/github-pr-search.ts b/.opencode/tool/github-pr-search.ts new file mode 100644 index 00000000000..587fdfaaf28 --- /dev/null +++ b/.opencode/tool/github-pr-search.ts @@ -0,0 +1,57 @@ +/// +import { tool } from "@opencode-ai/plugin" +import DESCRIPTION from "./github-pr-search.txt" + +async function githubFetch(endpoint: string, options: RequestInit = {}) { + const response = await fetch(`https://api.github.com${endpoint}`, { + ...options, + headers: { + Authorization: `Bearer ${process.env.GITHUB_TOKEN}`, + Accept: "application/vnd.github+json", + "Content-Type": "application/json", + ...options.headers, + }, + }) + if (!response.ok) { + throw new Error(`GitHub API error: ${response.status} ${response.statusText}`) + } + return response.json() +} + +interface PR { + title: string + html_url: string +} + +export default tool({ + description: DESCRIPTION, + args: { + query: tool.schema.string().describe("Search query for PR titles and descriptions"), + limit: tool.schema.number().describe("Maximum number of results to return").default(10), + offset: tool.schema.number().describe("Number of results to skip for pagination").default(0), + }, + async execute(args) { + const owner = "anomalyco" + const repo = "opencode" + + const page = Math.floor(args.offset / args.limit) + 1 + const searchQuery = encodeURIComponent(`${args.query} repo:${owner}/${repo} type:pr state:open`) + const result = await githubFetch( + `/search/issues?q=${searchQuery}&per_page=${args.limit}&page=${page}&sort=updated&order=desc`, + ) + + if (result.total_count === 0) { + return `No PRs found matching "${args.query}"` + } + + const prs = result.items as PR[] + + if (prs.length === 0) { + return `No other PRs found matching "${args.query}"` + } + + const formatted = prs.map((pr) => `${pr.title}\n${pr.html_url}`).join("\n\n") + + return `Found ${result.total_count} PRs (showing ${prs.length}):\n\n${formatted}` + }, +}) diff --git a/.opencode/tool/github-pr-search.txt b/.opencode/tool/github-pr-search.txt new file mode 100644 index 00000000000..28d8643f13c --- /dev/null +++ b/.opencode/tool/github-pr-search.txt @@ -0,0 +1,10 @@ +Use this tool to search GitHub pull requests by title and description. + +This tool searches PRs in the sst/opencode repository and returns LLM-friendly results including: +- PR number and title +- Author +- State (open/closed/merged) +- Labels +- Description snippet + +Use the query parameter to search for keywords that might appear in PR titles or descriptions. diff --git a/.opencode/tool/github-triage.ts b/.opencode/tool/github-triage.ts new file mode 100644 index 00000000000..1e216f1c8da --- /dev/null +++ b/.opencode/tool/github-triage.ts @@ -0,0 +1,90 @@ +/// +// import { Octokit } from "@octokit/rest" +import { tool } from "@opencode-ai/plugin" +import DESCRIPTION from "./github-triage.txt" + +function getIssueNumber(): number { + const issue = parseInt(process.env.ISSUE_NUMBER ?? "", 10) + if (!issue) throw new Error("ISSUE_NUMBER env var not set") + return issue +} + +async function githubFetch(endpoint: string, options: RequestInit = {}) { + const response = await fetch(`https://api.github.com${endpoint}`, { + ...options, + headers: { + Authorization: `Bearer ${process.env.GITHUB_TOKEN}`, + Accept: "application/vnd.github+json", + "Content-Type": "application/json", + ...options.headers, + }, + }) + if (!response.ok) { + throw new Error(`GitHub API error: ${response.status} ${response.statusText}`) + } + return response.json() +} + +export default tool({ + description: DESCRIPTION, + args: { + assignee: tool.schema + .enum(["thdxr", "adamdotdevin", "rekram1-node", "fwang", "jayair", "kommander"]) + .describe("The username of the assignee") + .default("rekram1-node"), + labels: tool.schema + .array(tool.schema.enum(["nix", "opentui", "perf", "desktop", "zen", "docs", "windows"])) + .describe("The labels(s) to add to the issue") + .default([]), + }, + async execute(args) { + const issue = getIssueNumber() + // const octokit = new Octokit({ auth: process.env.GITHUB_TOKEN }) + const owner = "anomalyco" + const repo = "opencode" + + const results: string[] = [] + + if (args.assignee === "adamdotdevin" && !args.labels.includes("desktop")) { + throw new Error("Only desktop issues should be assigned to adamdotdevin") + } + + if (args.assignee === "fwang" && !args.labels.includes("zen")) { + throw new Error("Only zen issues should be assigned to fwang") + } + + if (args.assignee === "kommander" && !args.labels.includes("opentui")) { + throw new Error("Only opentui issues should be assigned to kommander") + } + + // await octokit.rest.issues.addAssignees({ + // owner, + // repo, + // issue_number: issue, + // assignees: [args.assignee], + // }) + await githubFetch(`/repos/${owner}/${repo}/issues/${issue}/assignees`, { + method: "POST", + body: JSON.stringify({ assignees: [args.assignee] }), + }) + results.push(`Assigned @${args.assignee} to issue #${issue}`) + + const labels: string[] = args.labels.map((label) => (label === "desktop" ? "web" : label)) + + if (labels.length > 0) { + // await octokit.rest.issues.addLabels({ + // owner, + // repo, + // issue_number: issue, + // labels, + // }) + await githubFetch(`/repos/${owner}/${repo}/issues/${issue}/labels`, { + method: "POST", + body: JSON.stringify({ labels }), + }) + results.push(`Added labels: ${args.labels.join(", ")}`) + } + + return results.join("\n") + }, +}) diff --git a/.opencode/tool/github-triage.txt b/.opencode/tool/github-triage.txt new file mode 100644 index 00000000000..4c46a72c162 --- /dev/null +++ b/.opencode/tool/github-triage.txt @@ -0,0 +1,88 @@ +Use this tool to assign and/or label a Github issue. + +You can assign the following users: +- thdxr +- adamdotdevin +- fwang +- jayair +- kommander +- rekram1-node + + +You can use the following labels: +- nix +- opentui +- perf +- web +- zen +- docs + +Always try to assign an issue, if in doubt, assign rekram1-node to it. + +## Breakdown of responsibilities: + +### thdxr + +Dax is responsible for managing core parts of the application, for large feature requests, api changes, or things that require significant changes to the codebase assign him. + +This relates to OpenCode server primarily but has overlap with just about anything + +### adamdotdevin + +Adam is responsible for managing the Desktop/Web app. If there is an issue relating to the desktop app or `opencode web` command. Assign him. + + +### fwang + +Frank is responsible for managing Zen, if you see complaints about OpenCode Zen, maybe it's the dashboard, the model quality, billing issues, etc. Assign him to the issue. + +### jayair + +Jay is responsible for documentation. If there is an issue relating to documentation assign him. + +### kommander + +Sebastian is responsible for managing an OpenTUI (a library for building terminal user interfaces). OpenCode's TUI is built with OpenTUI. If there are issues about: +- random characters on screen +- keybinds not working on different terminals +- general terminal stuff +Then assign the issue to Him. + +### rekram1-node + +ALL BUGS SHOULD BE assigned to rekram1-node unless they have the `opentui` label. + +Assign Aiden to an issue as a catch all, if you can't assign anyone else. Most of the time this will be bugs/polish things. +If no one else makes sense to assign, assign rekram1-node to it. + +Always assign to aiden if the issue mentions "acp", "zed", or model performance issues + +## Breakdown of Labels: + +### nix + +Any issue that mentions nix, or nixos should have a nix label + +### opentui + +Anything relating to the TUI itself should have an opentui label + +### perf + +Anything related to slow performance, high ram, high cpu usage, or any other performance related issue should have a perf label + +### desktop + +Anything related to `opencode web` command or the desktop app should have a desktop label. Never add this label for anything terminal/tui related + +### zen + +Anything related to OpenCode Zen, billing, or model quality from Zen should have a zen label + +### docs + +Anything related to the documentation should have a docs label + +### windows + +Use for any issue that involves the windows OS diff --git a/AGENTS.md b/AGENTS.md index 5a95fc509fe..3138f6c5ece 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,34 +1,4 @@ -## Debugging - -- To test opencode in the `packages/opencode` directory you can run `bun dev` - -## Tool Calling - -- ALWAYS USE PARALLEL TOOLS WHEN APPLICABLE. Here is an example illustrating how to execute 3 parallel file reads in this chat environment: - -json -{ -"recipient_name": "multi_tool_use.parallel", -"parameters": { -"tool_uses": [ -{ -"recipient_name": "functions.read", -"parameters": { -"filePath": "path/to/file.tsx" -} -}, -{ -"recipient_name": "functions.read", -"parameters": { -"filePath": "path/to/file.ts" -} -}, -{ -"recipient_name": "functions.read", -"parameters": { -"filePath": "path/to/file.md" -} -} -] -} -} +- To test opencode in `packages/opencode`, run `bun dev`. +- To regenerate the JavaScript SDK, run `./packages/sdk/js/script/build.ts`. +- ALWAYS USE PARALLEL TOOLS WHEN APPLICABLE. +- The default branch in this repo is `dev`. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6a24995e81a..a32504b22f8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,10 +14,10 @@ However, any UI or core product feature must go through a design review with the If you are unsure if a PR would be accepted, feel free to ask a maintainer or look for issues with any of the following labels: -- [`help wanted`](https://github.com/sst/opencode/issues?q=is%3Aissue%20state%3Aopen%20label%3Ahelp-wanted) -- [`good first issue`](https://github.com/sst/opencode/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22good%20first%20issue%22) -- [`bug`](https://github.com/sst/opencode/issues?q=is%3Aissue%20state%3Aopen%20label%3Abug) -- [`perf`](https://github.com/sst/opencode/issues?q=is%3Aopen%20is%3Aissue%20label%3A%22perf%22) +- [`help wanted`](https://github.com/anomalyco/opencode/issues?q=is%3Aissue%20state%3Aopen%20label%3Ahelp-wanted) +- [`good first issue`](https://github.com/anomalyco/opencode/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22good%20first%20issue%22) +- [`bug`](https://github.com/anomalyco/opencode/issues?q=is%3Aissue%20state%3Aopen%20label%3Abug) +- [`perf`](https://github.com/anomalyco/opencode/issues?q=is%3Aopen%20is%3Aissue%20label%3A%22perf%22) > [!NOTE] > PRs that ignore these guardrails will likely be closed. @@ -34,13 +34,119 @@ Want to take on an issue? Leave a comment and a maintainer may assign it to you bun dev ``` +### Running against a different directory + +By default, `bun dev` runs OpenCode in the `packages/opencode` directory. To run it against a different directory or repository: + +```bash +bun dev +``` + +To run OpenCode in the root of the opencode repo itself: + +```bash +bun dev . +``` + +### Building a "localcode" + +To compile a standalone executable: + +```bash +./packages/opencode/script/build.ts --single +``` + +Then run it with: + +```bash +./packages/opencode/dist/opencode-/bin/opencode +``` + +Replace `` with your platform (e.g., `darwin-arm64`, `linux-x64`). + - Core pieces: - `packages/opencode`: OpenCode core business logic & server. - `packages/opencode/src/cli/cmd/tui/`: The TUI code, written in SolidJS with [opentui](https://github.com/sst/opentui) + - `packages/app`: The shared web UI components, written in SolidJS + - `packages/desktop`: The native desktop app, built with Tauri (wraps `packages/app`) - `packages/plugin`: Source for `@opencode-ai/plugin` +### Understanding bun dev vs opencode + +During development, `bun dev` is the local equivalent of the built `opencode` command. Both run the same CLI interface: + +```bash +# Development (from project root) +bun dev --help # Show all available commands +bun dev serve # Start headless API server +bun dev web # Start server + open web interface +bun dev # Start TUI in specific directory + +# Production +opencode --help # Show all available commands +opencode serve # Start headless API server +opencode web # Start server + open web interface +opencode # Start TUI in specific directory +``` + +### Running the API Server + +To start the OpenCode headless API server: + +```bash +bun dev serve +``` + +This starts the headless server on port 4096 by default. You can specify a different port: + +```bash +bun dev serve --port 8080 +``` + +### Running the Web App + +To test UI changes during development: + +1. **First, start the OpenCode server** (see [Running the API Server](#running-the-api-server) section above) +2. **Then run the web app:** + +```bash +bun run --cwd packages/app dev +``` + +This starts a local dev server at http://localhost:5173 (or similar port shown in output). Most UI changes can be tested here, but the server must be running for full functionality. + +### Running the Desktop App + +The desktop app is a native Tauri application that wraps the web UI. + +To run the native desktop app: + +```bash +bun run --cwd packages/desktop tauri dev +``` + +This starts the web dev server on http://localhost:1420 and opens the native window. + +If you only want the web dev server (no native shell): + +```bash +bun run --cwd packages/desktop dev +``` + +To create a production `dist/` and build the native app bundle: + +```bash +bun run --cwd packages/desktop tauri build +``` + +This runs `bun run --cwd packages/desktop build` automatically via Tauri’s `beforeBuildCommand`. + > [!NOTE] -> After touching `packages/opencode/src/server/server.ts`, run "./packages/sdk/js/script/build.ts" to regenerate the JS sdk. +> Running the desktop app requires additional Tauri dependencies (Rust toolchain, platform-specific libraries). See the [Tauri prerequisites](https://v2.tauri.app/start/prerequisites/) for setup instructions. + +> [!NOTE] +> If you make changes to the API or SDK (e.g. `packages/opencode/src/server/server.ts`), run `./script/generate.ts` to regenerate the SDK and related files. Please try to follow the [style guide](./STYLE_GUIDE.md) @@ -53,12 +159,12 @@ your debugger via that URL. Other methods can result in breakpoints being mapped Caveats: -- `*.tsx` files won't have their breakpoints correctly mapped. This seems due to Bun currently not supporting source maps on code transformed - via `BunPlugin`s (currently necessary due to our dependency on `@opentui/solid`). Currently, the best you can do in terms of debugging `*.tsx` - files is writing a `debugger;` statement. Debugging facilities like stepping won't work, but at least you will be informed if a specific code - is triggered. - If you want to run the OpenCode TUI and have breakpoints triggered in the server code, you might need to run `bun dev spawn` instead of the usual `bun dev`. This is because `bun dev` runs the server in a worker thread and breakpoints might not work there. +- If `spawn` does not work for you, you can debug the server separately: + - Debug server: `bun run --inspect=ws://localhost:6499/ --cwd packages/opencode ./src/index.ts serve --port 4096`, + then attach TUI with `opencode attach http://localhost:4096` + - Debug TUI: `bun run --inspect=ws://localhost:6499/ --cwd packages/opencode --conditions=browser ./src/index.ts` Other tips and tricks: @@ -78,11 +184,63 @@ With that said, you may want to try these methods, as they might work for you. ## Pull Request Expectations -- Try to keep pull requests small and focused. -- Link relevant issue(s) in the description +### Issue First Policy + +**All PRs must reference an existing issue.** Before opening a PR, open an issue describing the bug or feature. This helps maintainers triage and prevents duplicate work. PRs without a linked issue may be closed without review. + +- Use `Fixes #123` or `Closes #123` in your PR description to link the issue +- For small fixes, a brief issue is fine - just enough context for maintainers to understand the problem + +### General Requirements + +- Keep pull requests small and focused - Explain the issue and why your change fixes it -- Avoid having verbose LLM generated PR descriptions -- Before adding new functions or functionality, ensure that such behavior doesn't already exist elsewhere in the codebase. +- Before adding new functionality, ensure it doesn't already exist elsewhere in the codebase + +### UI Changes + +If your PR includes UI changes, please include screenshots or videos showing the before and after. This helps maintainers review faster and gives you quicker feedback. + +### Logic Changes + +For non-UI changes (bug fixes, new features, refactors), explain **how you verified it works**: + +- What did you test? +- How can a reviewer reproduce/confirm the fix? + +### No AI-Generated Walls of Text + +Long, AI-generated PR descriptions and issues are not acceptable and may be ignored. Respect the maintainers' time: + +- Write short, focused descriptions +- Explain what changed and why in your own words +- If you can't explain it briefly, your PR might be too large + +### PR Titles + +PR titles should follow conventional commit standards: + +- `feat:` new feature or functionality +- `fix:` bug fix +- `docs:` documentation or README changes +- `chore:` maintenance tasks, dependency updates, etc. +- `refactor:` code refactoring without changing behavior +- `test:` adding or updating tests + +You can optionally include a scope to indicate which package is affected: + +- `feat(app):` feature in the app package +- `fix(desktop):` bug fix in the desktop package +- `chore(opencode):` maintenance in the opencode package + +Examples: + +- `docs: update contributing guidelines` +- `fix: resolve crash on startup` +- `feat: add dark mode support` +- `feat(app): add dark mode support` +- `fix(desktop): resolve crash on startup` +- `chore: bump dependency versions` ### Style Preferences diff --git a/README.md b/README.md index eb0295c9c8f..64ca1ef7a6f 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@

Discord npm - Build status + Build status

[![OpenCode Terminal UI](packages/web/src/assets/lander/screenshot.png)](https://opencode.ai) @@ -26,17 +26,36 @@ curl -fsSL https://opencode.ai/install | bash # Package managers npm i -g opencode-ai@latest # or bun/pnpm/yarn -scoop bucket add extras; scoop install extras/opencode # Windows +scoop install opencode # Windows choco install opencode # Windows -brew install opencode # macOS and Linux +brew install anomalyco/tap/opencode # macOS and Linux (recommended, always up to date) +brew install opencode # macOS and Linux (official brew formula, updated less) paru -S opencode-bin # Arch Linux -mise use -g ubi:sst/opencode # Any OS -nix run nixpkgs#opencode # or github:sst/opencode for latest dev branch +mise use -g opencode # Any OS +nix run nixpkgs#opencode # or github:anomalyco/opencode for latest dev branch ``` > [!TIP] > Remove versions older than 0.1.x before installing. +### Desktop App (BETA) + +OpenCode is also available as a desktop application. Download directly from the [releases page](https://github.com/anomalyco/opencode/releases) or [opencode.ai/download](https://opencode.ai/download). + +| Platform | Download | +| --------------------- | ------------------------------------- | +| macOS (Apple Silicon) | `opencode-desktop-darwin-aarch64.dmg` | +| macOS (Intel) | `opencode-desktop-darwin-x64.dmg` | +| Windows | `opencode-desktop-windows-x64.exe` | +| Linux | `.deb`, `.rpm`, or AppImage | + +```bash +# macOS (Homebrew) +brew install --cask opencode-desktop +# Windows (Scoop) +scoop bucket add extras; scoop install extras/opencode-desktop +``` + #### Installation Directory The install script respects the following priority order for the installation path: @@ -54,8 +73,7 @@ XDG_BIN_DIR=$HOME/.local/bin curl -fsSL https://opencode.ai/install | bash ### Agents -OpenCode includes two built-in agents you can switch between, -you can switch between these using the `Tab` key. +OpenCode includes two built-in agents you can switch between with the `Tab` key. - **build** - Default, full access agent for development work - **plan** - Read-only agent for analysis and code exploration @@ -63,7 +81,7 @@ you can switch between these using the `Tab` key. - Asks permission before running bash commands - Ideal for exploring unfamiliar codebases or planning changes -Also, included is a **general** subagent for complex searches and multi-step tasks. +Also, included is a **general** subagent for complex searches and multistep tasks. This is used internally and can be invoked using `@general` in messages. Learn more about [agents](https://opencode.ai/docs/agents). @@ -78,11 +96,11 @@ If you're interested in contributing to OpenCode, please read our [contributing ### Building on OpenCode -If you are working on a project that's related to OpenCode and is using "opencode" as a part of its name; for example, "opencode-dashboard" or "opencode-mobile", please add a note to your README to clarify that it is not built by the OpenCode team and is not affiliated with us in anyway. +If you are working on a project that's related to OpenCode and is using "opencode" as a part of its name; for example, "opencode-dashboard" or "opencode-mobile", please add a note to your README to clarify that it is not built by the OpenCode team and is not affiliated with us in any way. ### FAQ -#### How is this different than Claude Code? +#### How is this different from Claude Code? It's very similar to Claude Code in terms of capability. Here are the key differences: @@ -92,10 +110,6 @@ It's very similar to Claude Code in terms of capability. Here are the key differ - A focus on TUI. OpenCode is built by neovim users and the creators of [terminal.shop](https://terminal.shop); we are going to push the limits of what's possible in the terminal. - A client/server architecture. This for example can allow OpenCode to run on your computer, while you can drive it remotely from a mobile app. Meaning that the TUI frontend is just one of the possible clients. -#### What's the other repo? - -The other confusingly named repo has no relation to this one. You can [read the story behind it here](https://x.com/thdxr/status/1933561254481666466). - --- **Join our community** [Discord](https://discord.gg/opencode) | [X.com](https://x.com/opencode) diff --git a/README.zh-CN.md b/README.zh-CN.md new file mode 100644 index 00000000000..4b56e0fb0b0 --- /dev/null +++ b/README.zh-CN.md @@ -0,0 +1,118 @@ +

+ + + + + OpenCode logo + + +

+

开源的 AI Coding Agent。

+

+ Discord + npm + Build status +

+ +[![OpenCode Terminal UI](packages/web/src/assets/lander/screenshot.png)](https://opencode.ai) + +--- + +### 安装 + +```bash +# 直接安装 (YOLO) +curl -fsSL https://opencode.ai/install | bash + +# 软件包管理器 +npm i -g opencode-ai@latest # 也可使用 bun/pnpm/yarn +scoop install opencode # Windows +choco install opencode # Windows +brew install anomalyco/tap/opencode # macOS 和 Linux(推荐,始终保持最新) +brew install opencode # macOS 和 Linux(官方 brew formula,更新频率较低) +paru -S opencode-bin # Arch Linux +mise use -g opencode # 任意系统 +nix run nixpkgs#opencode # 或用 github:anomalyco/opencode 获取最新 dev 分支 +``` + +> [!TIP] +> 安装前请先移除 0.1.x 之前的旧版本。 + +### 桌面应用程序 (BETA) + +OpenCode 也提供桌面版应用。可直接从 [发布页 (releases page)](https://github.com/anomalyco/opencode/releases) 或 [opencode.ai/download](https://opencode.ai/download) 下载。 + +| 平台 | 下载文件 | +| --------------------- | ------------------------------------- | +| macOS (Apple Silicon) | `opencode-desktop-darwin-aarch64.dmg` | +| macOS (Intel) | `opencode-desktop-darwin-x64.dmg` | +| Windows | `opencode-desktop-windows-x64.exe` | +| Linux | `.deb`、`.rpm` 或 AppImage | + +```bash +# macOS (Homebrew Cask) +brew install --cask opencode-desktop +# Windows (Scoop) +scoop bucket add extras; scoop install extras/opencode-desktop +``` + +#### 安装目录 + +安装脚本按照以下优先级决定安装路径: + +1. `$OPENCODE_INSTALL_DIR` - 自定义安装目录 +2. `$XDG_BIN_DIR` - 符合 XDG 基础目录规范的路径 +3. `$HOME/bin` - 如果存在或可创建的用户二进制目录 +4. `$HOME/.opencode/bin` - 默认备用路径 + +```bash +# 示例 +OPENCODE_INSTALL_DIR=/usr/local/bin curl -fsSL https://opencode.ai/install | bash +XDG_BIN_DIR=$HOME/.local/bin curl -fsSL https://opencode.ai/install | bash +``` + +### Agents + +OpenCode 内置两种 Agent,可用 `Tab` 键快速切换: + +- **build** - 默认模式,具备完整权限,适合开发工作 +- **plan** - 只读模式,适合代码分析与探索 + - 默认拒绝修改文件 + - 运行 bash 命令前会询问 + - 便于探索未知代码库或规划改动 + +另外还包含一个 **general** 子 Agent,用于复杂搜索和多步任务,内部使用,也可在消息中输入 `@general` 调用。 + +了解更多 [Agents](https://opencode.ai/docs/agents) 相关信息。 + +### 文档 + +更多配置说明请查看我们的 [**官方文档**](https://opencode.ai/docs)。 + +### 参与贡献 + +如有兴趣贡献代码,请在提交 PR 前阅读 [贡献指南 (Contributing Docs)](./CONTRIBUTING.md)。 + +### 基于 OpenCode 进行开发 + +如果你在项目名中使用了 “opencode”(如 “opencode-dashboard” 或 “opencode-mobile”),请在 README 里注明该项目不是 OpenCode 团队官方开发,且不存在隶属关系。 + +### 常见问题 (FAQ) + +#### 这和 Claude Code 有什么不同? + +功能上很相似,关键差异: + +- 100% 开源。 +- 不绑定特定提供商。推荐使用 [OpenCode Zen](https://opencode.ai/zen) 的模型,但也可搭配 Claude、OpenAI、Google 甚至本地模型。模型迭代会缩小差异、降低成本,因此保持 provider-agnostic 很重要。 +- 内置 LSP 支持。 +- 聚焦终端界面 (TUI)。OpenCode 由 Neovim 爱好者和 [terminal.shop](https://terminal.shop) 的创建者打造,会持续探索终端的极限。 +- 客户端/服务器架构。可在本机运行,同时用移动设备远程驱动。TUI 只是众多潜在客户端之一。 + +#### 另一个同名的仓库是什么? + +另一个名字相近的仓库与本项目无关。[点击这里了解背后故事](https://x.com/thdxr/status/1933561254481666466)。 + +--- + +**加入我们的社区** [Discord](https://discord.gg/opencode) | [X.com](https://x.com/opencode) diff --git a/README.zh-TW.md b/README.zh-TW.md new file mode 100644 index 00000000000..66664a70305 --- /dev/null +++ b/README.zh-TW.md @@ -0,0 +1,118 @@ +

+ + + + + OpenCode logo + + +

+

開源的 AI Coding Agent。

+

+ Discord + npm + Build status +

+ +[![OpenCode Terminal UI](packages/web/src/assets/lander/screenshot.png)](https://opencode.ai) + +--- + +### 安裝 + +```bash +# 直接安裝 (YOLO) +curl -fsSL https://opencode.ai/install | bash + +# 套件管理員 +npm i -g opencode-ai@latest # 也可使用 bun/pnpm/yarn +scoop install opencode # Windows +choco install opencode # Windows +brew install anomalyco/tap/opencode # macOS 與 Linux(推薦,始終保持最新) +brew install opencode # macOS 與 Linux(官方 brew formula,更新頻率較低) +paru -S opencode-bin # Arch Linux +mise use -g github:anomalyco/opencode # 任何作業系統 +nix run nixpkgs#opencode # 或使用 github:anomalyco/opencode 以取得最新開發分支 +``` + +> [!TIP] +> 安裝前請先移除 0.1.x 以前的舊版本。 + +### 桌面應用程式 (BETA) + +OpenCode 也提供桌面版應用程式。您可以直接從 [發佈頁面 (releases page)](https://github.com/anomalyco/opencode/releases) 或 [opencode.ai/download](https://opencode.ai/download) 下載。 + +| 平台 | 下載連結 | +| --------------------- | ------------------------------------- | +| macOS (Apple Silicon) | `opencode-desktop-darwin-aarch64.dmg` | +| macOS (Intel) | `opencode-desktop-darwin-x64.dmg` | +| Windows | `opencode-desktop-windows-x64.exe` | +| Linux | `.deb`, `.rpm`, 或 AppImage | + +```bash +# macOS (Homebrew Cask) +brew install --cask opencode-desktop +# Windows (Scoop) +scoop bucket add extras; scoop install extras/opencode-desktop +``` + +#### 安裝目錄 + +安裝腳本會依據以下優先順序決定安裝路徑: + +1. `$OPENCODE_INSTALL_DIR` - 自定義安裝目錄 +2. `$XDG_BIN_DIR` - 符合 XDG 基礎目錄規範的路徑 +3. `$HOME/bin` - 標準使用者執行檔目錄 (若存在或可建立) +4. `$HOME/.opencode/bin` - 預設備用路徑 + +```bash +# 範例 +OPENCODE_INSTALL_DIR=/usr/local/bin curl -fsSL https://opencode.ai/install | bash +XDG_BIN_DIR=$HOME/.local/bin curl -fsSL https://opencode.ai/install | bash +``` + +### Agents + +OpenCode 內建了兩種 Agent,您可以使用 `Tab` 鍵快速切換。 + +- **build** - 預設模式,具備完整權限的 Agent,適用於開發工作。 +- **plan** - 唯讀模式,適用於程式碼分析與探索。 + - 預設禁止修改檔案。 + - 執行 bash 指令前會詢問權限。 + - 非常適合用來探索陌生的程式碼庫或規劃變更。 + +此外,OpenCode 還包含一個 **general** 子 Agent,用於處理複雜搜尋與多步驟任務。此 Agent 供系統內部使用,亦可透過在訊息中輸入 `@general` 來呼叫。 + +了解更多關於 [Agents](https://opencode.ai/docs/agents) 的資訊。 + +### 線上文件 + +關於如何設定 OpenCode 的詳細資訊,請參閱我們的 [**官方文件**](https://opencode.ai/docs)。 + +### 參與貢獻 + +如果您有興趣參與 OpenCode 的開發,請在提交 Pull Request 前先閱讀我們的 [貢獻指南 (Contributing Docs)](./CONTRIBUTING.md)。 + +### 基於 OpenCode 進行開發 + +如果您正在開發與 OpenCode 相關的專案,並在名稱中使用了 "opencode"(例如 "opencode-dashboard" 或 "opencode-mobile"),請在您的 README 中加入聲明,說明該專案並非由 OpenCode 團隊開發,且與我們沒有任何隸屬關係。 + +### 常見問題 (FAQ) + +#### 這跟 Claude Code 有什麼不同? + +在功能面上與 Claude Code 非常相似。以下是關鍵差異: + +- 100% 開源。 +- 不綁定特定的服務提供商。雖然我們推薦使用透過 [OpenCode Zen](https://opencode.ai/zen) 提供的模型,但 OpenCode 也可搭配 Claude, OpenAI, Google 甚至本地模型使用。隨著模型不斷演進,彼此間的差距會縮小且價格會下降,因此具備「不限廠商 (provider-agnostic)」的特性至關重要。 +- 內建 LSP (語言伺服器協定) 支援。 +- 專注於終端機介面 (TUI)。OpenCode 由 Neovim 愛好者與 [terminal.shop](https://terminal.shop) 的創作者打造;我們將不斷挑戰終端機介面的極限。 +- 客戶端/伺服器架構 (Client/Server Architecture)。這讓 OpenCode 能夠在您的電腦上運行的同時,由行動裝置進行遠端操控。這意味著 TUI 前端只是眾多可能的客戶端之一。 + +#### 另一個同名的 Repo 是什麼? + +另一個名稱相近的儲存庫與本專案無關。您可以點此[閱讀背後的故事](https://x.com/thdxr/status/1933561254481666466)。 + +--- + +**加入我們的社群** [Discord](https://discord.gg/opencode) | [X.com](https://x.com/opencode) diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 00000000000..93c7341cef6 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,41 @@ +# Security + +## Threat Model + +### Overview + +OpenCode is an AI-powered coding assistant that runs locally on your machine. It provides an agent system with access to powerful tools including shell execution, file operations, and web access. + +### No Sandbox + +OpenCode does **not** sandbox the agent. The permission system exists as a UX feature to help users stay aware of what actions the agent is taking - it prompts for confirmation before executing commands, writing files, etc. However, it is not designed to provide security isolation. + +If you need true isolation, run OpenCode inside a Docker container or VM. + +### Server Mode + +Server mode is opt-in only. When enabled, set `OPENCODE_SERVER_PASSWORD` to require HTTP Basic Auth. Without this, the server runs unauthenticated (with a warning). It is the end user's responsibility to secure the server - any functionality it provides is not a vulnerability. + +### Out of Scope + +| Category | Rationale | +| ------------------------------- | ----------------------------------------------------------------------- | +| **Server access when opted-in** | If you enable server mode, API access is expected behavior | +| **Sandbox escapes** | The permission system is not a sandbox (see above) | +| **LLM provider data handling** | Data sent to your configured LLM provider is governed by their policies | +| **MCP server behavior** | External MCP servers you configure are outside our trust boundary | +| **Malicious config files** | Users control their own config; modifying it is not an attack vector | + +--- + +# Reporting Security Issues + +We appreciate your efforts to responsibly disclose your findings, and will make every effort to acknowledge your contributions. + +To report a security issue, please use the GitHub Security Advisory ["Report a Vulnerability"](https://github.com/anomalyco/opencode/security/advisories/new) tab. + +The team will send a response indicating the next steps in handling your report. After the initial reply to your report, the security team will keep you informed of the progress towards a fix and full announcement, and may ask for additional information or guidance. + +## Escalation + +If you do not receive an acknowledgement of your report within 6 business days, you may send an email to security@anoma.ly diff --git a/STATS.md b/STATS.md index 93ab445e6ef..5cfa76f16db 100644 --- a/STATS.md +++ b/STATS.md @@ -1,171 +1,210 @@ # Download Stats -| Date | GitHub Downloads | npm Downloads | Total | -| ---------- | ------------------- | ------------------- | ------------------- | -| 2025-06-29 | 18,789 (+0) | 39,420 (+0) | 58,209 (+0) | -| 2025-06-30 | 20,127 (+1,338) | 41,059 (+1,639) | 61,186 (+2,977) | -| 2025-07-01 | 22,108 (+1,981) | 43,745 (+2,686) | 65,853 (+4,667) | -| 2025-07-02 | 24,814 (+2,706) | 46,168 (+2,423) | 70,982 (+5,129) | -| 2025-07-03 | 27,834 (+3,020) | 49,955 (+3,787) | 77,789 (+6,807) | -| 2025-07-04 | 30,608 (+2,774) | 54,758 (+4,803) | 85,366 (+7,577) | -| 2025-07-05 | 32,524 (+1,916) | 58,371 (+3,613) | 90,895 (+5,529) | -| 2025-07-06 | 33,766 (+1,242) | 59,694 (+1,323) | 93,460 (+2,565) | -| 2025-07-08 | 38,052 (+4,286) | 64,468 (+4,774) | 102,520 (+9,060) | -| 2025-07-09 | 40,924 (+2,872) | 67,935 (+3,467) | 108,859 (+6,339) | -| 2025-07-10 | 43,796 (+2,872) | 71,402 (+3,467) | 115,198 (+6,339) | -| 2025-07-11 | 46,982 (+3,186) | 77,462 (+6,060) | 124,444 (+9,246) | -| 2025-07-12 | 49,302 (+2,320) | 82,177 (+4,715) | 131,479 (+7,035) | -| 2025-07-13 | 50,803 (+1,501) | 86,394 (+4,217) | 137,197 (+5,718) | -| 2025-07-14 | 53,283 (+2,480) | 87,860 (+1,466) | 141,143 (+3,946) | -| 2025-07-15 | 57,590 (+4,307) | 91,036 (+3,176) | 148,626 (+7,483) | -| 2025-07-16 | 62,313 (+4,723) | 95,258 (+4,222) | 157,571 (+8,945) | -| 2025-07-17 | 66,684 (+4,371) | 100,048 (+4,790) | 166,732 (+9,161) | -| 2025-07-18 | 70,379 (+3,695) | 102,587 (+2,539) | 172,966 (+6,234) | -| 2025-07-19 | 73,497 (+3,117) | 105,904 (+3,317) | 179,401 (+6,434) | -| 2025-07-20 | 76,453 (+2,956) | 109,044 (+3,140) | 185,497 (+6,096) | -| 2025-07-21 | 80,197 (+3,744) | 113,537 (+4,493) | 193,734 (+8,237) | -| 2025-07-22 | 84,251 (+4,054) | 118,073 (+4,536) | 202,324 (+8,590) | -| 2025-07-23 | 88,589 (+4,338) | 121,436 (+3,363) | 210,025 (+7,701) | -| 2025-07-24 | 92,469 (+3,880) | 124,091 (+2,655) | 216,560 (+6,535) | -| 2025-07-25 | 96,417 (+3,948) | 126,985 (+2,894) | 223,402 (+6,842) | -| 2025-07-26 | 100,646 (+4,229) | 131,411 (+4,426) | 232,057 (+8,655) | -| 2025-07-27 | 102,644 (+1,998) | 134,736 (+3,325) | 237,380 (+5,323) | -| 2025-07-28 | 105,446 (+2,802) | 136,016 (+1,280) | 241,462 (+4,082) | -| 2025-07-29 | 108,998 (+3,552) | 137,542 (+1,526) | 246,540 (+5,078) | -| 2025-07-30 | 113,544 (+4,546) | 140,317 (+2,775) | 253,861 (+7,321) | -| 2025-07-31 | 118,339 (+4,795) | 143,344 (+3,027) | 261,683 (+7,822) | -| 2025-08-01 | 123,539 (+5,200) | 146,680 (+3,336) | 270,219 (+8,536) | -| 2025-08-02 | 127,864 (+4,325) | 149,236 (+2,556) | 277,100 (+6,881) | -| 2025-08-03 | 131,397 (+3,533) | 150,451 (+1,215) | 281,848 (+4,748) | -| 2025-08-04 | 136,266 (+4,869) | 153,260 (+2,809) | 289,526 (+7,678) | -| 2025-08-05 | 141,596 (+5,330) | 155,752 (+2,492) | 297,348 (+7,822) | -| 2025-08-06 | 147,067 (+5,471) | 158,309 (+2,557) | 305,376 (+8,028) | -| 2025-08-07 | 152,591 (+5,524) | 160,889 (+2,580) | 313,480 (+8,104) | -| 2025-08-08 | 158,187 (+5,596) | 163,448 (+2,559) | 321,635 (+8,155) | -| 2025-08-09 | 162,770 (+4,583) | 165,721 (+2,273) | 328,491 (+6,856) | -| 2025-08-10 | 165,695 (+2,925) | 167,109 (+1,388) | 332,804 (+4,313) | -| 2025-08-11 | 169,297 (+3,602) | 167,953 (+844) | 337,250 (+4,446) | -| 2025-08-12 | 176,307 (+7,010) | 171,876 (+3,923) | 348,183 (+10,933) | -| 2025-08-13 | 182,997 (+6,690) | 177,182 (+5,306) | 360,179 (+11,996) | -| 2025-08-14 | 189,063 (+6,066) | 179,741 (+2,559) | 368,804 (+8,625) | -| 2025-08-15 | 193,608 (+4,545) | 181,792 (+2,051) | 375,400 (+6,596) | -| 2025-08-16 | 198,118 (+4,510) | 184,558 (+2,766) | 382,676 (+7,276) | -| 2025-08-17 | 201,299 (+3,181) | 186,269 (+1,711) | 387,568 (+4,892) | -| 2025-08-18 | 204,559 (+3,260) | 187,399 (+1,130) | 391,958 (+4,390) | -| 2025-08-19 | 209,814 (+5,255) | 189,668 (+2,269) | 399,482 (+7,524) | -| 2025-08-20 | 214,497 (+4,683) | 191,481 (+1,813) | 405,978 (+6,496) | -| 2025-08-21 | 220,465 (+5,968) | 194,784 (+3,303) | 415,249 (+9,271) | -| 2025-08-22 | 225,899 (+5,434) | 197,204 (+2,420) | 423,103 (+7,854) | -| 2025-08-23 | 229,005 (+3,106) | 199,238 (+2,034) | 428,243 (+5,140) | -| 2025-08-24 | 232,098 (+3,093) | 201,157 (+1,919) | 433,255 (+5,012) | -| 2025-08-25 | 236,607 (+4,509) | 202,650 (+1,493) | 439,257 (+6,002) | -| 2025-08-26 | 242,783 (+6,176) | 205,242 (+2,592) | 448,025 (+8,768) | -| 2025-08-27 | 248,409 (+5,626) | 205,242 (+0) | 453,651 (+5,626) | -| 2025-08-28 | 252,796 (+4,387) | 205,242 (+0) | 458,038 (+4,387) | -| 2025-08-29 | 256,045 (+3,249) | 211,075 (+5,833) | 467,120 (+9,082) | -| 2025-08-30 | 258,863 (+2,818) | 212,397 (+1,322) | 471,260 (+4,140) | -| 2025-08-31 | 262,004 (+3,141) | 213,944 (+1,547) | 475,948 (+4,688) | -| 2025-09-01 | 265,359 (+3,355) | 215,115 (+1,171) | 480,474 (+4,526) | -| 2025-09-02 | 270,483 (+5,124) | 217,075 (+1,960) | 487,558 (+7,084) | -| 2025-09-03 | 274,793 (+4,310) | 219,755 (+2,680) | 494,548 (+6,990) | -| 2025-09-04 | 280,430 (+5,637) | 222,103 (+2,348) | 502,533 (+7,985) | -| 2025-09-05 | 283,769 (+3,339) | 223,793 (+1,690) | 507,562 (+5,029) | -| 2025-09-06 | 286,245 (+2,476) | 225,036 (+1,243) | 511,281 (+3,719) | -| 2025-09-07 | 288,623 (+2,378) | 225,866 (+830) | 514,489 (+3,208) | -| 2025-09-08 | 293,341 (+4,718) | 227,073 (+1,207) | 520,414 (+5,925) | -| 2025-09-09 | 300,036 (+6,695) | 229,788 (+2,715) | 529,824 (+9,410) | -| 2025-09-10 | 307,287 (+7,251) | 233,435 (+3,647) | 540,722 (+10,898) | -| 2025-09-11 | 314,083 (+6,796) | 237,356 (+3,921) | 551,439 (+10,717) | -| 2025-09-12 | 321,046 (+6,963) | 240,728 (+3,372) | 561,774 (+10,335) | -| 2025-09-13 | 324,894 (+3,848) | 245,539 (+4,811) | 570,433 (+8,659) | -| 2025-09-14 | 328,876 (+3,982) | 248,245 (+2,706) | 577,121 (+6,688) | -| 2025-09-15 | 334,201 (+5,325) | 250,983 (+2,738) | 585,184 (+8,063) | -| 2025-09-16 | 342,609 (+8,408) | 255,264 (+4,281) | 597,873 (+12,689) | -| 2025-09-17 | 351,117 (+8,508) | 260,970 (+5,706) | 612,087 (+14,214) | -| 2025-09-18 | 358,717 (+7,600) | 266,922 (+5,952) | 625,639 (+13,552) | -| 2025-09-19 | 365,401 (+6,684) | 271,859 (+4,937) | 637,260 (+11,621) | -| 2025-09-20 | 372,092 (+6,691) | 276,917 (+5,058) | 649,009 (+11,749) | -| 2025-09-21 | 377,079 (+4,987) | 280,261 (+3,344) | 657,340 (+8,331) | -| 2025-09-22 | 382,492 (+5,413) | 284,009 (+3,748) | 666,501 (+9,161) | -| 2025-09-23 | 387,008 (+4,516) | 289,129 (+5,120) | 676,137 (+9,636) | -| 2025-09-24 | 393,325 (+6,317) | 294,927 (+5,798) | 688,252 (+12,115) | -| 2025-09-25 | 398,879 (+5,554) | 301,663 (+6,736) | 700,542 (+12,290) | -| 2025-09-26 | 404,334 (+5,455) | 306,713 (+5,050) | 711,047 (+10,505) | -| 2025-09-27 | 411,618 (+7,284) | 317,763 (+11,050) | 729,381 (+18,334) | -| 2025-09-28 | 414,910 (+3,292) | 322,522 (+4,759) | 737,432 (+8,051) | -| 2025-09-29 | 419,919 (+5,009) | 328,033 (+5,511) | 747,952 (+10,520) | -| 2025-09-30 | 427,991 (+8,072) | 336,472 (+8,439) | 764,463 (+16,511) | -| 2025-10-01 | 433,591 (+5,600) | 341,742 (+5,270) | 775,333 (+10,870) | -| 2025-10-02 | 440,852 (+7,261) | 348,099 (+6,357) | 788,951 (+13,618) | -| 2025-10-03 | 446,829 (+5,977) | 359,937 (+11,838) | 806,766 (+17,815) | -| 2025-10-04 | 452,561 (+5,732) | 370,386 (+10,449) | 822,947 (+16,181) | -| 2025-10-05 | 455,559 (+2,998) | 374,745 (+4,359) | 830,304 (+7,357) | -| 2025-10-06 | 460,927 (+5,368) | 379,489 (+4,744) | 840,416 (+10,112) | -| 2025-10-07 | 467,336 (+6,409) | 385,438 (+5,949) | 852,774 (+12,358) | -| 2025-10-08 | 474,643 (+7,307) | 394,139 (+8,701) | 868,782 (+16,008) | -| 2025-10-09 | 479,203 (+4,560) | 400,526 (+6,387) | 879,729 (+10,947) | -| 2025-10-10 | 484,374 (+5,171) | 406,015 (+5,489) | 890,389 (+10,660) | -| 2025-10-11 | 488,427 (+4,053) | 414,699 (+8,684) | 903,126 (+12,737) | -| 2025-10-12 | 492,125 (+3,698) | 418,745 (+4,046) | 910,870 (+7,744) | -| 2025-10-14 | 505,130 (+13,005) | 429,286 (+10,541) | 934,416 (+23,546) | -| 2025-10-15 | 512,717 (+7,587) | 439,290 (+10,004) | 952,007 (+17,591) | -| 2025-10-16 | 517,719 (+5,002) | 447,137 (+7,847) | 964,856 (+12,849) | -| 2025-10-17 | 526,239 (+8,520) | 457,467 (+10,330) | 983,706 (+18,850) | -| 2025-10-18 | 531,564 (+5,325) | 465,272 (+7,805) | 996,836 (+13,130) | -| 2025-10-19 | 536,209 (+4,645) | 469,078 (+3,806) | 1,005,287 (+8,451) | -| 2025-10-20 | 541,264 (+5,055) | 472,952 (+3,874) | 1,014,216 (+8,929) | -| 2025-10-21 | 548,721 (+7,457) | 479,703 (+6,751) | 1,028,424 (+14,208) | -| 2025-10-22 | 557,949 (+9,228) | 491,395 (+11,692) | 1,049,344 (+20,920) | -| 2025-10-23 | 564,716 (+6,767) | 498,736 (+7,341) | 1,063,452 (+14,108) | -| 2025-10-24 | 572,692 (+7,976) | 506,905 (+8,169) | 1,079,597 (+16,145) | -| 2025-10-25 | 578,927 (+6,235) | 516,129 (+9,224) | 1,095,056 (+15,459) | -| 2025-10-26 | 584,409 (+5,482) | 521,179 (+5,050) | 1,105,588 (+10,532) | -| 2025-10-27 | 589,999 (+5,590) | 526,001 (+4,822) | 1,116,000 (+10,412) | -| 2025-10-28 | 595,776 (+5,777) | 532,438 (+6,437) | 1,128,214 (+12,214) | -| 2025-10-29 | 606,259 (+10,483) | 542,064 (+9,626) | 1,148,323 (+20,109) | -| 2025-10-30 | 613,746 (+7,487) | 542,064 (+0) | 1,155,810 (+7,487) | -| 2025-10-30 | 617,846 (+4,100) | 555,026 (+12,962) | 1,172,872 (+17,062) | -| 2025-10-31 | 626,612 (+8,766) | 564,579 (+9,553) | 1,191,191 (+18,319) | -| 2025-11-01 | 636,100 (+9,488) | 581,806 (+17,227) | 1,217,906 (+26,715) | -| 2025-11-02 | 644,067 (+7,967) | 590,004 (+8,198) | 1,234,071 (+16,165) | -| 2025-11-03 | 653,130 (+9,063) | 597,139 (+7,135) | 1,250,269 (+16,198) | -| 2025-11-04 | 663,912 (+10,782) | 608,056 (+10,917) | 1,271,968 (+21,699) | -| 2025-11-05 | 675,074 (+11,162) | 619,690 (+11,634) | 1,294,764 (+22,796) | -| 2025-11-06 | 686,252 (+11,178) | 630,885 (+11,195) | 1,317,137 (+22,373) | -| 2025-11-07 | 696,646 (+10,394) | 642,146 (+11,261) | 1,338,792 (+21,655) | -| 2025-11-08 | 706,035 (+9,389) | 653,489 (+11,343) | 1,359,524 (+20,732) | -| 2025-11-09 | 713,462 (+7,427) | 660,459 (+6,970) | 1,373,921 (+14,397) | -| 2025-11-10 | 722,288 (+8,826) | 668,225 (+7,766) | 1,390,513 (+16,592) | -| 2025-11-11 | 729,769 (+7,481) | 677,501 (+9,276) | 1,407,270 (+16,757) | -| 2025-11-12 | 740,180 (+10,411) | 686,454 (+8,953) | 1,426,634 (+19,364) | -| 2025-11-13 | 749,905 (+9,725) | 696,157 (+9,703) | 1,446,062 (+19,428) | -| 2025-11-14 | 759,928 (+10,023) | 705,237 (+9,080) | 1,465,165 (+19,103) | -| 2025-11-15 | 765,955 (+6,027) | 712,870 (+7,633) | 1,478,825 (+13,660) | -| 2025-11-16 | 771,069 (+5,114) | 716,596 (+3,726) | 1,487,665 (+8,840) | -| 2025-11-17 | 780,161 (+9,092) | 723,339 (+6,743) | 1,503,500 (+15,835) | -| 2025-11-18 | 791,563 (+11,402) | 732,544 (+9,205) | 1,524,107 (+20,607) | -| 2025-11-19 | 804,409 (+12,846) | 747,624 (+15,080) | 1,552,033 (+27,926) | -| 2025-11-20 | 814,620 (+10,211) | 757,907 (+10,283) | 1,572,527 (+20,494) | -| 2025-11-21 | 826,309 (+11,689) | 769,307 (+11,400) | 1,595,616 (+23,089) | -| 2025-11-22 | 837,269 (+10,960) | 780,996 (+11,689) | 1,618,265 (+22,649) | -| 2025-11-23 | 846,609 (+9,340) | 795,069 (+14,073) | 1,641,678 (+23,413) | -| 2025-11-24 | 856,733 (+10,124) | 804,033 (+8,964) | 1,660,766 (+19,088) | -| 2025-11-25 | 869,423 (+12,690) | 817,339 (+13,306) | 1,686,762 (+25,996) | -| 2025-11-26 | 881,414 (+11,991) | 832,518 (+15,179) | 1,713,932 (+27,170) | -| 2025-11-27 | 893,960 (+12,546) | 846,180 (+13,662) | 1,740,140 (+26,208) | -| 2025-11-28 | 901,741 (+7,781) | 856,482 (+10,302) | 1,758,223 (+18,083) | -| 2025-11-29 | 908,689 (+6,948) | 863,361 (+6,879) | 1,772,050 (+13,827) | -| 2025-11-30 | 916,116 (+7,427) | 870,194 (+6,833) | 1,786,310 (+14,260) | -| 2025-12-01 | 925,898 (+9,782) | 876,500 (+6,306) | 1,802,398 (+16,088) | -| 2025-12-02 | 939,250 (+13,352) | 890,919 (+14,419) | 1,830,169 (+27,771) | -| 2025-12-03 | 952,249 (+12,999) | 903,713 (+12,794) | 1,855,962 (+25,793) | -| 2025-12-04 | 965,611 (+13,362) | 916,471 (+12,758) | 1,882,082 (+26,120) | -| 2025-12-05 | 977,996 (+12,385) | 930,616 (+14,145) | 1,908,612 (+26,530) | -| 2025-12-06 | 987,884 (+9,888) | 943,773 (+13,157) | 1,931,657 (+23,045) | -| 2025-12-07 | 994,046 (+6,162) | 951,425 (+7,652) | 1,945,471 (+13,814) | -| 2025-12-08 | 1,000,898 (+6,852) | 957,149 (+5,724) | 1,958,047 (+12,576) | -| 2025-12-09 | 1,011,488 (+10,590) | 973,922 (+16,773) | 1,985,410 (+27,363) | -| 2025-12-10 | 1,025,891 (+14,403) | 991,708 (+17,786) | 2,017,599 (+32,189) | -| 2025-12-11 | 1,045,110 (+19,219) | 1,010,559 (+18,851) | 2,055,669 (+38,070) | -| 2025-12-12 | 1,061,340 (+16,230) | 1,030,838 (+20,279) | 2,092,178 (+36,509) | -| 2025-12-13 | 1,073,561 (+12,221) | 1,044,608 (+13,770) | 2,118,169 (+25,991) | +| Date | GitHub Downloads | npm Downloads | Total | +| ---------- | -------------------- | -------------------- | -------------------- | +| 2025-06-29 | 18,789 (+0) | 39,420 (+0) | 58,209 (+0) | +| 2025-06-30 | 20,127 (+1,338) | 41,059 (+1,639) | 61,186 (+2,977) | +| 2025-07-01 | 22,108 (+1,981) | 43,745 (+2,686) | 65,853 (+4,667) | +| 2025-07-02 | 24,814 (+2,706) | 46,168 (+2,423) | 70,982 (+5,129) | +| 2025-07-03 | 27,834 (+3,020) | 49,955 (+3,787) | 77,789 (+6,807) | +| 2025-07-04 | 30,608 (+2,774) | 54,758 (+4,803) | 85,366 (+7,577) | +| 2025-07-05 | 32,524 (+1,916) | 58,371 (+3,613) | 90,895 (+5,529) | +| 2025-07-06 | 33,766 (+1,242) | 59,694 (+1,323) | 93,460 (+2,565) | +| 2025-07-08 | 38,052 (+4,286) | 64,468 (+4,774) | 102,520 (+9,060) | +| 2025-07-09 | 40,924 (+2,872) | 67,935 (+3,467) | 108,859 (+6,339) | +| 2025-07-10 | 43,796 (+2,872) | 71,402 (+3,467) | 115,198 (+6,339) | +| 2025-07-11 | 46,982 (+3,186) | 77,462 (+6,060) | 124,444 (+9,246) | +| 2025-07-12 | 49,302 (+2,320) | 82,177 (+4,715) | 131,479 (+7,035) | +| 2025-07-13 | 50,803 (+1,501) | 86,394 (+4,217) | 137,197 (+5,718) | +| 2025-07-14 | 53,283 (+2,480) | 87,860 (+1,466) | 141,143 (+3,946) | +| 2025-07-15 | 57,590 (+4,307) | 91,036 (+3,176) | 148,626 (+7,483) | +| 2025-07-16 | 62,313 (+4,723) | 95,258 (+4,222) | 157,571 (+8,945) | +| 2025-07-17 | 66,684 (+4,371) | 100,048 (+4,790) | 166,732 (+9,161) | +| 2025-07-18 | 70,379 (+3,695) | 102,587 (+2,539) | 172,966 (+6,234) | +| 2025-07-19 | 73,497 (+3,117) | 105,904 (+3,317) | 179,401 (+6,434) | +| 2025-07-20 | 76,453 (+2,956) | 109,044 (+3,140) | 185,497 (+6,096) | +| 2025-07-21 | 80,197 (+3,744) | 113,537 (+4,493) | 193,734 (+8,237) | +| 2025-07-22 | 84,251 (+4,054) | 118,073 (+4,536) | 202,324 (+8,590) | +| 2025-07-23 | 88,589 (+4,338) | 121,436 (+3,363) | 210,025 (+7,701) | +| 2025-07-24 | 92,469 (+3,880) | 124,091 (+2,655) | 216,560 (+6,535) | +| 2025-07-25 | 96,417 (+3,948) | 126,985 (+2,894) | 223,402 (+6,842) | +| 2025-07-26 | 100,646 (+4,229) | 131,411 (+4,426) | 232,057 (+8,655) | +| 2025-07-27 | 102,644 (+1,998) | 134,736 (+3,325) | 237,380 (+5,323) | +| 2025-07-28 | 105,446 (+2,802) | 136,016 (+1,280) | 241,462 (+4,082) | +| 2025-07-29 | 108,998 (+3,552) | 137,542 (+1,526) | 246,540 (+5,078) | +| 2025-07-30 | 113,544 (+4,546) | 140,317 (+2,775) | 253,861 (+7,321) | +| 2025-07-31 | 118,339 (+4,795) | 143,344 (+3,027) | 261,683 (+7,822) | +| 2025-08-01 | 123,539 (+5,200) | 146,680 (+3,336) | 270,219 (+8,536) | +| 2025-08-02 | 127,864 (+4,325) | 149,236 (+2,556) | 277,100 (+6,881) | +| 2025-08-03 | 131,397 (+3,533) | 150,451 (+1,215) | 281,848 (+4,748) | +| 2025-08-04 | 136,266 (+4,869) | 153,260 (+2,809) | 289,526 (+7,678) | +| 2025-08-05 | 141,596 (+5,330) | 155,752 (+2,492) | 297,348 (+7,822) | +| 2025-08-06 | 147,067 (+5,471) | 158,309 (+2,557) | 305,376 (+8,028) | +| 2025-08-07 | 152,591 (+5,524) | 160,889 (+2,580) | 313,480 (+8,104) | +| 2025-08-08 | 158,187 (+5,596) | 163,448 (+2,559) | 321,635 (+8,155) | +| 2025-08-09 | 162,770 (+4,583) | 165,721 (+2,273) | 328,491 (+6,856) | +| 2025-08-10 | 165,695 (+2,925) | 167,109 (+1,388) | 332,804 (+4,313) | +| 2025-08-11 | 169,297 (+3,602) | 167,953 (+844) | 337,250 (+4,446) | +| 2025-08-12 | 176,307 (+7,010) | 171,876 (+3,923) | 348,183 (+10,933) | +| 2025-08-13 | 182,997 (+6,690) | 177,182 (+5,306) | 360,179 (+11,996) | +| 2025-08-14 | 189,063 (+6,066) | 179,741 (+2,559) | 368,804 (+8,625) | +| 2025-08-15 | 193,608 (+4,545) | 181,792 (+2,051) | 375,400 (+6,596) | +| 2025-08-16 | 198,118 (+4,510) | 184,558 (+2,766) | 382,676 (+7,276) | +| 2025-08-17 | 201,299 (+3,181) | 186,269 (+1,711) | 387,568 (+4,892) | +| 2025-08-18 | 204,559 (+3,260) | 187,399 (+1,130) | 391,958 (+4,390) | +| 2025-08-19 | 209,814 (+5,255) | 189,668 (+2,269) | 399,482 (+7,524) | +| 2025-08-20 | 214,497 (+4,683) | 191,481 (+1,813) | 405,978 (+6,496) | +| 2025-08-21 | 220,465 (+5,968) | 194,784 (+3,303) | 415,249 (+9,271) | +| 2025-08-22 | 225,899 (+5,434) | 197,204 (+2,420) | 423,103 (+7,854) | +| 2025-08-23 | 229,005 (+3,106) | 199,238 (+2,034) | 428,243 (+5,140) | +| 2025-08-24 | 232,098 (+3,093) | 201,157 (+1,919) | 433,255 (+5,012) | +| 2025-08-25 | 236,607 (+4,509) | 202,650 (+1,493) | 439,257 (+6,002) | +| 2025-08-26 | 242,783 (+6,176) | 205,242 (+2,592) | 448,025 (+8,768) | +| 2025-08-27 | 248,409 (+5,626) | 205,242 (+0) | 453,651 (+5,626) | +| 2025-08-28 | 252,796 (+4,387) | 205,242 (+0) | 458,038 (+4,387) | +| 2025-08-29 | 256,045 (+3,249) | 211,075 (+5,833) | 467,120 (+9,082) | +| 2025-08-30 | 258,863 (+2,818) | 212,397 (+1,322) | 471,260 (+4,140) | +| 2025-08-31 | 262,004 (+3,141) | 213,944 (+1,547) | 475,948 (+4,688) | +| 2025-09-01 | 265,359 (+3,355) | 215,115 (+1,171) | 480,474 (+4,526) | +| 2025-09-02 | 270,483 (+5,124) | 217,075 (+1,960) | 487,558 (+7,084) | +| 2025-09-03 | 274,793 (+4,310) | 219,755 (+2,680) | 494,548 (+6,990) | +| 2025-09-04 | 280,430 (+5,637) | 222,103 (+2,348) | 502,533 (+7,985) | +| 2025-09-05 | 283,769 (+3,339) | 223,793 (+1,690) | 507,562 (+5,029) | +| 2025-09-06 | 286,245 (+2,476) | 225,036 (+1,243) | 511,281 (+3,719) | +| 2025-09-07 | 288,623 (+2,378) | 225,866 (+830) | 514,489 (+3,208) | +| 2025-09-08 | 293,341 (+4,718) | 227,073 (+1,207) | 520,414 (+5,925) | +| 2025-09-09 | 300,036 (+6,695) | 229,788 (+2,715) | 529,824 (+9,410) | +| 2025-09-10 | 307,287 (+7,251) | 233,435 (+3,647) | 540,722 (+10,898) | +| 2025-09-11 | 314,083 (+6,796) | 237,356 (+3,921) | 551,439 (+10,717) | +| 2025-09-12 | 321,046 (+6,963) | 240,728 (+3,372) | 561,774 (+10,335) | +| 2025-09-13 | 324,894 (+3,848) | 245,539 (+4,811) | 570,433 (+8,659) | +| 2025-09-14 | 328,876 (+3,982) | 248,245 (+2,706) | 577,121 (+6,688) | +| 2025-09-15 | 334,201 (+5,325) | 250,983 (+2,738) | 585,184 (+8,063) | +| 2025-09-16 | 342,609 (+8,408) | 255,264 (+4,281) | 597,873 (+12,689) | +| 2025-09-17 | 351,117 (+8,508) | 260,970 (+5,706) | 612,087 (+14,214) | +| 2025-09-18 | 358,717 (+7,600) | 266,922 (+5,952) | 625,639 (+13,552) | +| 2025-09-19 | 365,401 (+6,684) | 271,859 (+4,937) | 637,260 (+11,621) | +| 2025-09-20 | 372,092 (+6,691) | 276,917 (+5,058) | 649,009 (+11,749) | +| 2025-09-21 | 377,079 (+4,987) | 280,261 (+3,344) | 657,340 (+8,331) | +| 2025-09-22 | 382,492 (+5,413) | 284,009 (+3,748) | 666,501 (+9,161) | +| 2025-09-23 | 387,008 (+4,516) | 289,129 (+5,120) | 676,137 (+9,636) | +| 2025-09-24 | 393,325 (+6,317) | 294,927 (+5,798) | 688,252 (+12,115) | +| 2025-09-25 | 398,879 (+5,554) | 301,663 (+6,736) | 700,542 (+12,290) | +| 2025-09-26 | 404,334 (+5,455) | 306,713 (+5,050) | 711,047 (+10,505) | +| 2025-09-27 | 411,618 (+7,284) | 317,763 (+11,050) | 729,381 (+18,334) | +| 2025-09-28 | 414,910 (+3,292) | 322,522 (+4,759) | 737,432 (+8,051) | +| 2025-09-29 | 419,919 (+5,009) | 328,033 (+5,511) | 747,952 (+10,520) | +| 2025-09-30 | 427,991 (+8,072) | 336,472 (+8,439) | 764,463 (+16,511) | +| 2025-10-01 | 433,591 (+5,600) | 341,742 (+5,270) | 775,333 (+10,870) | +| 2025-10-02 | 440,852 (+7,261) | 348,099 (+6,357) | 788,951 (+13,618) | +| 2025-10-03 | 446,829 (+5,977) | 359,937 (+11,838) | 806,766 (+17,815) | +| 2025-10-04 | 452,561 (+5,732) | 370,386 (+10,449) | 822,947 (+16,181) | +| 2025-10-05 | 455,559 (+2,998) | 374,745 (+4,359) | 830,304 (+7,357) | +| 2025-10-06 | 460,927 (+5,368) | 379,489 (+4,744) | 840,416 (+10,112) | +| 2025-10-07 | 467,336 (+6,409) | 385,438 (+5,949) | 852,774 (+12,358) | +| 2025-10-08 | 474,643 (+7,307) | 394,139 (+8,701) | 868,782 (+16,008) | +| 2025-10-09 | 479,203 (+4,560) | 400,526 (+6,387) | 879,729 (+10,947) | +| 2025-10-10 | 484,374 (+5,171) | 406,015 (+5,489) | 890,389 (+10,660) | +| 2025-10-11 | 488,427 (+4,053) | 414,699 (+8,684) | 903,126 (+12,737) | +| 2025-10-12 | 492,125 (+3,698) | 418,745 (+4,046) | 910,870 (+7,744) | +| 2025-10-14 | 505,130 (+13,005) | 429,286 (+10,541) | 934,416 (+23,546) | +| 2025-10-15 | 512,717 (+7,587) | 439,290 (+10,004) | 952,007 (+17,591) | +| 2025-10-16 | 517,719 (+5,002) | 447,137 (+7,847) | 964,856 (+12,849) | +| 2025-10-17 | 526,239 (+8,520) | 457,467 (+10,330) | 983,706 (+18,850) | +| 2025-10-18 | 531,564 (+5,325) | 465,272 (+7,805) | 996,836 (+13,130) | +| 2025-10-19 | 536,209 (+4,645) | 469,078 (+3,806) | 1,005,287 (+8,451) | +| 2025-10-20 | 541,264 (+5,055) | 472,952 (+3,874) | 1,014,216 (+8,929) | +| 2025-10-21 | 548,721 (+7,457) | 479,703 (+6,751) | 1,028,424 (+14,208) | +| 2025-10-22 | 557,949 (+9,228) | 491,395 (+11,692) | 1,049,344 (+20,920) | +| 2025-10-23 | 564,716 (+6,767) | 498,736 (+7,341) | 1,063,452 (+14,108) | +| 2025-10-24 | 572,692 (+7,976) | 506,905 (+8,169) | 1,079,597 (+16,145) | +| 2025-10-25 | 578,927 (+6,235) | 516,129 (+9,224) | 1,095,056 (+15,459) | +| 2025-10-26 | 584,409 (+5,482) | 521,179 (+5,050) | 1,105,588 (+10,532) | +| 2025-10-27 | 589,999 (+5,590) | 526,001 (+4,822) | 1,116,000 (+10,412) | +| 2025-10-28 | 595,776 (+5,777) | 532,438 (+6,437) | 1,128,214 (+12,214) | +| 2025-10-29 | 606,259 (+10,483) | 542,064 (+9,626) | 1,148,323 (+20,109) | +| 2025-10-30 | 613,746 (+7,487) | 542,064 (+0) | 1,155,810 (+7,487) | +| 2025-10-30 | 617,846 (+4,100) | 555,026 (+12,962) | 1,172,872 (+17,062) | +| 2025-10-31 | 626,612 (+8,766) | 564,579 (+9,553) | 1,191,191 (+18,319) | +| 2025-11-01 | 636,100 (+9,488) | 581,806 (+17,227) | 1,217,906 (+26,715) | +| 2025-11-02 | 644,067 (+7,967) | 590,004 (+8,198) | 1,234,071 (+16,165) | +| 2025-11-03 | 653,130 (+9,063) | 597,139 (+7,135) | 1,250,269 (+16,198) | +| 2025-11-04 | 663,912 (+10,782) | 608,056 (+10,917) | 1,271,968 (+21,699) | +| 2025-11-05 | 675,074 (+11,162) | 619,690 (+11,634) | 1,294,764 (+22,796) | +| 2025-11-06 | 686,252 (+11,178) | 630,885 (+11,195) | 1,317,137 (+22,373) | +| 2025-11-07 | 696,646 (+10,394) | 642,146 (+11,261) | 1,338,792 (+21,655) | +| 2025-11-08 | 706,035 (+9,389) | 653,489 (+11,343) | 1,359,524 (+20,732) | +| 2025-11-09 | 713,462 (+7,427) | 660,459 (+6,970) | 1,373,921 (+14,397) | +| 2025-11-10 | 722,288 (+8,826) | 668,225 (+7,766) | 1,390,513 (+16,592) | +| 2025-11-11 | 729,769 (+7,481) | 677,501 (+9,276) | 1,407,270 (+16,757) | +| 2025-11-12 | 740,180 (+10,411) | 686,454 (+8,953) | 1,426,634 (+19,364) | +| 2025-11-13 | 749,905 (+9,725) | 696,157 (+9,703) | 1,446,062 (+19,428) | +| 2025-11-14 | 759,928 (+10,023) | 705,237 (+9,080) | 1,465,165 (+19,103) | +| 2025-11-15 | 765,955 (+6,027) | 712,870 (+7,633) | 1,478,825 (+13,660) | +| 2025-11-16 | 771,069 (+5,114) | 716,596 (+3,726) | 1,487,665 (+8,840) | +| 2025-11-17 | 780,161 (+9,092) | 723,339 (+6,743) | 1,503,500 (+15,835) | +| 2025-11-18 | 791,563 (+11,402) | 732,544 (+9,205) | 1,524,107 (+20,607) | +| 2025-11-19 | 804,409 (+12,846) | 747,624 (+15,080) | 1,552,033 (+27,926) | +| 2025-11-20 | 814,620 (+10,211) | 757,907 (+10,283) | 1,572,527 (+20,494) | +| 2025-11-21 | 826,309 (+11,689) | 769,307 (+11,400) | 1,595,616 (+23,089) | +| 2025-11-22 | 837,269 (+10,960) | 780,996 (+11,689) | 1,618,265 (+22,649) | +| 2025-11-23 | 846,609 (+9,340) | 795,069 (+14,073) | 1,641,678 (+23,413) | +| 2025-11-24 | 856,733 (+10,124) | 804,033 (+8,964) | 1,660,766 (+19,088) | +| 2025-11-25 | 869,423 (+12,690) | 817,339 (+13,306) | 1,686,762 (+25,996) | +| 2025-11-26 | 881,414 (+11,991) | 832,518 (+15,179) | 1,713,932 (+27,170) | +| 2025-11-27 | 893,960 (+12,546) | 846,180 (+13,662) | 1,740,140 (+26,208) | +| 2025-11-28 | 901,741 (+7,781) | 856,482 (+10,302) | 1,758,223 (+18,083) | +| 2025-11-29 | 908,689 (+6,948) | 863,361 (+6,879) | 1,772,050 (+13,827) | +| 2025-11-30 | 916,116 (+7,427) | 870,194 (+6,833) | 1,786,310 (+14,260) | +| 2025-12-01 | 925,898 (+9,782) | 876,500 (+6,306) | 1,802,398 (+16,088) | +| 2025-12-02 | 939,250 (+13,352) | 890,919 (+14,419) | 1,830,169 (+27,771) | +| 2025-12-03 | 952,249 (+12,999) | 903,713 (+12,794) | 1,855,962 (+25,793) | +| 2025-12-04 | 965,611 (+13,362) | 916,471 (+12,758) | 1,882,082 (+26,120) | +| 2025-12-05 | 977,996 (+12,385) | 930,616 (+14,145) | 1,908,612 (+26,530) | +| 2025-12-06 | 987,884 (+9,888) | 943,773 (+13,157) | 1,931,657 (+23,045) | +| 2025-12-07 | 994,046 (+6,162) | 951,425 (+7,652) | 1,945,471 (+13,814) | +| 2025-12-08 | 1,000,898 (+6,852) | 957,149 (+5,724) | 1,958,047 (+12,576) | +| 2025-12-09 | 1,011,488 (+10,590) | 973,922 (+16,773) | 1,985,410 (+27,363) | +| 2025-12-10 | 1,025,891 (+14,403) | 991,708 (+17,786) | 2,017,599 (+32,189) | +| 2025-12-11 | 1,045,110 (+19,219) | 1,010,559 (+18,851) | 2,055,669 (+38,070) | +| 2025-12-12 | 1,061,340 (+16,230) | 1,030,838 (+20,279) | 2,092,178 (+36,509) | +| 2025-12-13 | 1,073,561 (+12,221) | 1,044,608 (+13,770) | 2,118,169 (+25,991) | +| 2025-12-14 | 1,082,042 (+8,481) | 1,052,425 (+7,817) | 2,134,467 (+16,298) | +| 2025-12-15 | 1,093,632 (+11,590) | 1,059,078 (+6,653) | 2,152,710 (+18,243) | +| 2025-12-16 | 1,120,477 (+26,845) | 1,078,022 (+18,944) | 2,198,499 (+45,789) | +| 2025-12-17 | 1,151,067 (+30,590) | 1,097,661 (+19,639) | 2,248,728 (+50,229) | +| 2025-12-18 | 1,178,658 (+27,591) | 1,113,418 (+15,757) | 2,292,076 (+43,348) | +| 2025-12-19 | 1,203,485 (+24,827) | 1,129,698 (+16,280) | 2,333,183 (+41,107) | +| 2025-12-20 | 1,223,000 (+19,515) | 1,146,258 (+16,560) | 2,369,258 (+36,075) | +| 2025-12-21 | 1,242,675 (+19,675) | 1,158,909 (+12,651) | 2,401,584 (+32,326) | +| 2025-12-22 | 1,262,522 (+19,847) | 1,169,121 (+10,212) | 2,431,643 (+30,059) | +| 2025-12-23 | 1,286,548 (+24,026) | 1,186,439 (+17,318) | 2,472,987 (+41,344) | +| 2025-12-24 | 1,309,323 (+22,775) | 1,203,767 (+17,328) | 2,513,090 (+40,103) | +| 2025-12-25 | 1,333,032 (+23,709) | 1,217,283 (+13,516) | 2,550,315 (+37,225) | +| 2025-12-26 | 1,352,411 (+19,379) | 1,227,615 (+10,332) | 2,580,026 (+29,711) | +| 2025-12-27 | 1,371,771 (+19,360) | 1,238,236 (+10,621) | 2,610,007 (+29,981) | +| 2025-12-28 | 1,390,388 (+18,617) | 1,245,690 (+7,454) | 2,636,078 (+26,071) | +| 2025-12-29 | 1,415,560 (+25,172) | 1,257,101 (+11,411) | 2,672,661 (+36,583) | +| 2025-12-30 | 1,445,450 (+29,890) | 1,272,689 (+15,588) | 2,718,139 (+45,478) | +| 2025-12-31 | 1,479,598 (+34,148) | 1,293,235 (+20,546) | 2,772,833 (+54,694) | +| 2026-01-01 | 1,508,883 (+29,285) | 1,309,874 (+16,639) | 2,818,757 (+45,924) | +| 2026-01-02 | 1,563,474 (+54,591) | 1,320,959 (+11,085) | 2,884,433 (+65,676) | +| 2026-01-03 | 1,618,065 (+54,591) | 1,331,914 (+10,955) | 2,949,979 (+65,546) | +| 2026-01-04 | 1,672,656 (+39,702) | 1,339,883 (+7,969) | 3,012,539 (+62,560) | +| 2026-01-05 | 1,738,171 (+65,515) | 1,353,043 (+13,160) | 3,091,214 (+78,675) | +| 2026-01-06 | 1,960,988 (+222,817) | 1,377,377 (+24,334) | 3,338,365 (+247,151) | +| 2026-01-07 | 2,123,239 (+162,251) | 1,398,648 (+21,271) | 3,521,887 (+183,522) | +| 2026-01-08 | 2,272,630 (+149,391) | 1,432,480 (+33,832) | 3,705,110 (+183,223) | +| 2026-01-09 | 2,443,565 (+170,935) | 1,469,451 (+36,971) | 3,913,016 (+207,906) | +| 2026-01-10 | 2,632,023 (+188,458) | 1,503,670 (+34,219) | 4,135,693 (+222,677) | +| 2026-01-11 | 2,836,394 (+204,371) | 1,530,479 (+26,809) | 4,366,873 (+231,180) | +| 2026-01-12 | 3,053,594 (+217,200) | 1,553,671 (+23,192) | 4,607,265 (+240,392) | +| 2026-01-13 | 3,297,078 (+243,484) | 1,595,062 (+41,391) | 4,892,140 (+284,875) | +| 2026-01-14 | 3,568,928 (+271,850) | 1,645,362 (+50,300) | 5,214,290 (+322,150) | +| 2026-01-16 | 4,121,550 (+552,622) | 1,754,418 (+109,056) | 5,875,968 (+661,678) | +| 2026-01-17 | 4,389,558 (+268,008) | 1,805,315 (+50,897) | 6,194,873 (+318,905) | +| 2026-01-18 | 4,627,623 (+238,065) | 1,839,171 (+33,856) | 6,466,794 (+271,921) | +| 2026-01-19 | 4,861,108 (+233,485) | 1,863,112 (+23,941) | 6,724,220 (+257,426) | +| 2026-01-20 | 5,128,999 (+267,891) | 1,903,665 (+40,553) | 7,032,664 (+308,444) | +| 2026-01-21 | 5,444,842 (+315,843) | 1,962,531 (+58,866) | 7,407,373 (+374,709) | +| 2026-01-22 | 5,766,340 (+321,498) | 2,029,487 (+66,956) | 7,795,827 (+388,454) | diff --git a/STYLE_GUIDE.md b/STYLE_GUIDE.md index 164f69bd46c..52d012fcb97 100644 --- a/STYLE_GUIDE.md +++ b/STYLE_GUIDE.md @@ -1,12 +1,71 @@ ## Style Guide -- Try to keep things in one function unless composable or reusable -- DO NOT do unnecessary destructuring of variables -- DO NOT use `else` statements unless necessary -- DO NOT use `try`/`catch` if it can be avoided -- AVOID `try`/`catch` where possible -- AVOID `else` statements -- AVOID using `any` type -- AVOID `let` statements -- PREFER single word variable names where possible -- Use as many bun apis as possible like Bun.file() +- Keep things in one function unless composable or reusable +- Avoid unnecessary destructuring. Instead of `const { a, b } = obj`, use `obj.a` and `obj.b` to preserve context +- Avoid `try`/`catch` where possible +- Avoid using the `any` type +- Prefer single word variable names where possible +- Use Bun APIs when possible, like `Bun.file()` + +# Avoid let statements + +We don't like `let` statements, especially combined with if/else statements. +Prefer `const`. + +Good: + +```ts +const foo = condition ? 1 : 2 +``` + +Bad: + +```ts +let foo + +if (condition) foo = 1 +else foo = 2 +``` + +# Avoid else statements + +Prefer early returns or using an `iife` to avoid else statements. + +Good: + +```ts +function foo() { + if (condition) return 1 + return 2 +} +``` + +Bad: + +```ts +function foo() { + if (condition) return 1 + else return 2 +} +``` + +# Prefer single word naming + +Try your best to find a single word name for your variables, functions, etc. +Only use multiple words if you cannot. + +Good: + +```ts +const foo = 1 +const bar = 2 +const baz = 3 +``` + +Bad: + +```ts +const fooBar = 1 +const barBaz = 2 +const bazFoo = 3 +``` diff --git a/bun.lock b/bun.lock index 096d45aeb42..68929677a61 100644 --- a/bun.lock +++ b/bun.lock @@ -6,21 +6,74 @@ "name": "opencode", "dependencies": { "@aws-sdk/client-s3": "3.933.0", + "@opencode-ai/plugin": "workspace:*", "@opencode-ai/script": "workspace:*", "@opencode-ai/sdk": "workspace:*", "typescript": "catalog:", }, "devDependencies": { + "@actions/artifact": "5.0.1", "@tsconfig/bun": "catalog:", "husky": "9.1.7", "prettier": "3.6.2", + "semver": "^7.6.0", "sst": "3.17.23", "turbo": "2.5.6", }, }, + "packages/app": { + "name": "@opencode-ai/app", + "version": "1.1.33", + "dependencies": { + "@kobalte/core": "catalog:", + "@opencode-ai/sdk": "workspace:*", + "@opencode-ai/ui": "workspace:*", + "@opencode-ai/util": "workspace:*", + "@shikijs/transformers": "3.9.2", + "@solid-primitives/active-element": "2.1.3", + "@solid-primitives/audio": "1.4.2", + "@solid-primitives/event-bus": "1.1.2", + "@solid-primitives/i18n": "2.2.1", + "@solid-primitives/media": "2.3.3", + "@solid-primitives/resize-observer": "2.1.3", + "@solid-primitives/scroll": "2.1.3", + "@solid-primitives/storage": "catalog:", + "@solid-primitives/websocket": "1.3.1", + "@solidjs/meta": "catalog:", + "@solidjs/router": "catalog:", + "@thisbeyond/solid-dnd": "0.7.5", + "diff": "catalog:", + "fuzzysort": "catalog:", + "ghostty-web": "0.3.0", + "luxon": "catalog:", + "marked": "catalog:", + "marked-shiki": "catalog:", + "remeda": "catalog:", + "shiki": "catalog:", + "solid-js": "catalog:", + "solid-list": "catalog:", + "tailwindcss": "catalog:", + "virtua": "catalog:", + "zod": "catalog:", + }, + "devDependencies": { + "@happy-dom/global-registrator": "20.0.11", + "@playwright/test": "1.57.0", + "@tailwindcss/vite": "catalog:", + "@tsconfig/bun": "1.0.9", + "@types/bun": "catalog:", + "@types/luxon": "catalog:", + "@types/node": "catalog:", + "@typescript/native-preview": "catalog:", + "typescript": "catalog:", + "vite": "catalog:", + "vite-plugin-icons-spritesheet": "3.0.1", + "vite-plugin-solid": "catalog:", + }, + }, "packages/console/app": { "name": "@opencode-ai/console-app", - "version": "1.0.152", + "version": "1.1.33", "dependencies": { "@cloudflare/vite-plugin": "1.15.2", "@ibm/plex": "6.4.1", @@ -31,24 +84,30 @@ "@opencode-ai/console-mail": "workspace:*", "@opencode-ai/console-resource": "workspace:*", "@opencode-ai/ui": "workspace:*", + "@smithy/eventstream-codec": "4.2.7", + "@smithy/util-utf8": "4.2.0", "@solidjs/meta": "catalog:", "@solidjs/router": "catalog:", "@solidjs/start": "catalog:", + "@stripe/stripe-js": "8.6.1", "chart.js": "4.5.1", "nitro": "3.0.1-alpha.1", "solid-js": "catalog:", + "solid-list": "0.3.0", + "solid-stripe": "0.8.1", "vite": "catalog:", "zod": "catalog:", }, "devDependencies": { "@typescript/native-preview": "catalog:", + "@webgpu/types": "0.1.54", "typescript": "catalog:", "wrangler": "4.50.0", }, }, "packages/console/core": { "name": "@opencode-ai/console-core", - "version": "1.0.152", + "version": "1.1.33", "dependencies": { "@aws-sdk/client-sts": "3.782.0", "@jsx-email/render": "1.1.1", @@ -75,7 +134,7 @@ }, "packages/console/function": { "name": "@opencode-ai/console-function", - "version": "1.0.152", + "version": "1.1.33", "dependencies": { "@ai-sdk/anthropic": "2.0.0", "@ai-sdk/openai": "2.0.2", @@ -99,7 +158,7 @@ }, "packages/console/mail": { "name": "@opencode-ai/console-mail", - "version": "1.0.152", + "version": "1.1.33", "dependencies": { "@jsx-email/all": "2.2.3", "@jsx-email/cli": "1.4.3", @@ -123,58 +182,40 @@ }, "packages/desktop": { "name": "@opencode-ai/desktop", - "version": "1.0.152", + "version": "1.1.33", "dependencies": { - "@kobalte/core": "catalog:", - "@opencode-ai/sdk": "workspace:*", + "@opencode-ai/app": "workspace:*", "@opencode-ai/ui": "workspace:*", - "@opencode-ai/util": "workspace:*", - "@shikijs/transformers": "3.9.2", - "@solid-primitives/active-element": "2.1.3", - "@solid-primitives/audio": "1.4.2", - "@solid-primitives/event-bus": "1.1.2", - "@solid-primitives/media": "2.3.3", - "@solid-primitives/resize-observer": "2.1.3", - "@solid-primitives/scroll": "2.1.3", - "@solid-primitives/storage": "4.3.3", - "@solid-primitives/websocket": "1.3.1", - "@solidjs/meta": "catalog:", - "@solidjs/router": "catalog:", - "@thisbeyond/solid-dnd": "0.7.5", - "diff": "catalog:", - "fuzzysort": "catalog:", - "ghostty-web": "0.3.0", - "luxon": "catalog:", - "marked": "16.2.0", - "marked-shiki": "1.2.1", - "remeda": "catalog:", - "shiki": "3.9.2", + "@solid-primitives/storage": "catalog:", + "@tauri-apps/api": "^2", + "@tauri-apps/plugin-dialog": "~2", + "@tauri-apps/plugin-http": "~2", + "@tauri-apps/plugin-notification": "~2", + "@tauri-apps/plugin-opener": "^2", + "@tauri-apps/plugin-os": "~2", + "@tauri-apps/plugin-process": "~2", + "@tauri-apps/plugin-shell": "~2", + "@tauri-apps/plugin-store": "~2", + "@tauri-apps/plugin-updater": "~2", + "@tauri-apps/plugin-window-state": "~2", "solid-js": "catalog:", - "solid-list": "catalog:", - "tailwindcss": "catalog:", - "virtua": "catalog:", }, "devDependencies": { - "@happy-dom/global-registrator": "20.0.11", - "@tailwindcss/vite": "catalog:", - "@tsconfig/bun": "1.0.9", + "@actions/artifact": "4.0.0", + "@tauri-apps/cli": "^2", "@types/bun": "catalog:", - "@types/luxon": "catalog:", - "@types/node": "catalog:", "@typescript/native-preview": "catalog:", - "typescript": "catalog:", + "typescript": "~5.6.2", "vite": "catalog:", - "vite-plugin-icons-spritesheet": "3.0.1", - "vite-plugin-solid": "catalog:", }, }, "packages/enterprise": { "name": "@opencode-ai/enterprise", - "version": "1.0.152", + "version": "1.1.33", "dependencies": { "@opencode-ai/ui": "workspace:*", "@opencode-ai/util": "workspace:*", - "@pierre/precision-diffs": "catalog:", + "@pierre/diffs": "catalog:", "@solidjs/meta": "catalog:", "@solidjs/router": "catalog:", "@solidjs/start": "catalog:", @@ -199,10 +240,10 @@ }, "packages/function": { "name": "@opencode-ai/function", - "version": "1.0.152", + "version": "1.1.33", "dependencies": { "@octokit/auth-app": "8.0.1", - "@octokit/rest": "22.0.0", + "@octokit/rest": "catalog:", "hono": "catalog:", "jose": "6.0.11", }, @@ -215,45 +256,57 @@ }, "packages/opencode": { "name": "opencode", - "version": "1.0.152", + "version": "1.1.33", "bin": { "opencode": "./bin/opencode", }, "dependencies": { "@actions/core": "1.11.1", "@actions/github": "6.0.1", - "@agentclientprotocol/sdk": "0.5.1", - "@ai-sdk/amazon-bedrock": "3.0.57", - "@ai-sdk/anthropic": "2.0.50", - "@ai-sdk/azure": "2.0.73", - "@ai-sdk/google": "2.0.44", - "@ai-sdk/google-vertex": "3.0.81", - "@ai-sdk/mcp": "0.0.8", - "@ai-sdk/openai": "2.0.71", - "@ai-sdk/openai-compatible": "1.0.27", - "@ai-sdk/provider": "2.0.0", - "@ai-sdk/provider-utils": "3.0.18", + "@agentclientprotocol/sdk": "0.12.0", + "@ai-sdk/amazon-bedrock": "3.0.73", + "@ai-sdk/anthropic": "2.0.57", + "@ai-sdk/azure": "2.0.91", + "@ai-sdk/cerebras": "1.0.34", + "@ai-sdk/cohere": "2.0.22", + "@ai-sdk/deepinfra": "1.0.31", + "@ai-sdk/gateway": "2.0.25", + "@ai-sdk/google": "2.0.52", + "@ai-sdk/google-vertex": "3.0.97", + "@ai-sdk/groq": "2.0.34", + "@ai-sdk/mistral": "2.0.27", + "@ai-sdk/openai": "2.0.89", + "@ai-sdk/openai-compatible": "1.0.30", + "@ai-sdk/perplexity": "2.0.23", + "@ai-sdk/provider": "2.0.1", + "@ai-sdk/provider-utils": "3.0.20", + "@ai-sdk/togetherai": "1.0.31", + "@ai-sdk/vercel": "1.0.31", + "@ai-sdk/xai": "2.0.51", "@clack/prompts": "1.0.0-alpha.1", + "@gitlab/gitlab-ai-provider": "3.2.0", "@hono/standard-validator": "0.1.5", "@hono/zod-validator": "catalog:", - "@modelcontextprotocol/sdk": "1.15.1", + "@modelcontextprotocol/sdk": "1.25.2", "@octokit/graphql": "9.0.2", - "@octokit/rest": "22.0.0", + "@octokit/rest": "catalog:", "@openauthjs/openauth": "catalog:", "@opencode-ai/plugin": "workspace:*", "@opencode-ai/script": "workspace:*", "@opencode-ai/sdk": "workspace:*", "@opencode-ai/util": "workspace:*", "@openrouter/ai-sdk-provider": "1.5.2", - "@opentui/core": "0.0.0-20251211-4403a69a", - "@opentui/solid": "0.0.0-20251211-4403a69a", + "@opentui/core": "0.1.74", + "@opentui/solid": "0.1.74", "@parcel/watcher": "2.5.1", - "@pierre/precision-diffs": "catalog:", + "@pierre/diffs": "catalog:", "@solid-primitives/event-bus": "1.1.2", + "@solid-primitives/scheduled": "1.5.2", "@standard-schema/spec": "1.0.0", "@zip.js/zip.js": "2.7.62", "ai": "catalog:", - "bun-pty": "0.4.2", + "bonjour-service": "1.3.0", + "bun-pty": "0.4.4", "chokidar": "4.0.3", "clipboardy": "4.0.0", "decimal.js": "10.5.0", @@ -307,7 +360,7 @@ }, "packages/plugin": { "name": "@opencode-ai/plugin", - "version": "1.0.152", + "version": "1.1.33", "dependencies": { "@opencode-ai/sdk": "workspace:*", "zod": "catalog:", @@ -327,9 +380,9 @@ }, "packages/sdk/js": { "name": "@opencode-ai/sdk", - "version": "1.0.152", + "version": "1.1.33", "devDependencies": { - "@hey-api/openapi-ts": "0.88.1", + "@hey-api/openapi-ts": "0.90.4", "@tsconfig/node22": "catalog:", "@types/node": "catalog:", "@typescript/native-preview": "catalog:", @@ -338,7 +391,7 @@ }, "packages/slack": { "name": "@opencode-ai/slack", - "version": "1.0.152", + "version": "1.1.33", "dependencies": { "@opencode-ai/sdk": "workspace:*", "@slack/bolt": "^3.17.1", @@ -349,58 +402,39 @@ "typescript": "catalog:", }, }, - "packages/tauri": { - "name": "@opencode-ai/tauri", - "version": "1.0.152", - "dependencies": { - "@opencode-ai/desktop": "workspace:*", - "@tauri-apps/api": "^2", - "@tauri-apps/plugin-dialog": "~2", - "@tauri-apps/plugin-opener": "^2", - "@tauri-apps/plugin-os": "~2", - "@tauri-apps/plugin-process": "~2", - "@tauri-apps/plugin-shell": "~2", - "@tauri-apps/plugin-store": "~2", - "@tauri-apps/plugin-updater": "~2", - "@tauri-apps/plugin-window-state": "~2", - "solid-js": "catalog:", - }, - "devDependencies": { - "@actions/artifact": "4.0.0", - "@tauri-apps/cli": "^2", - "@types/bun": "catalog:", - "@typescript/native-preview": "catalog:", - "typescript": "~5.6.2", - "vite": "catalog:", - }, - }, "packages/ui": { "name": "@opencode-ai/ui", - "version": "1.0.152", + "version": "1.1.33", "dependencies": { "@kobalte/core": "catalog:", "@opencode-ai/sdk": "workspace:*", "@opencode-ai/util": "workspace:*", - "@pierre/precision-diffs": "catalog:", + "@pierre/diffs": "catalog:", "@shikijs/transformers": "3.9.2", "@solid-primitives/bounds": "0.1.3", + "@solid-primitives/media": "2.3.3", "@solid-primitives/resize-observer": "2.1.3", "@solidjs/meta": "catalog:", "@typescript/native-preview": "catalog:", + "dompurify": "3.3.1", "fuzzysort": "catalog:", + "katex": "0.16.27", "luxon": "catalog:", - "marked": "16.2.0", - "marked-shiki": "1.2.1", + "marked": "catalog:", + "marked-katex-extension": "5.1.6", + "marked-shiki": "catalog:", "remeda": "catalog:", - "shiki": "3.9.2", + "shiki": "catalog:", "solid-js": "catalog:", "solid-list": "catalog:", + "strip-ansi": "7.1.2", "virtua": "catalog:", }, "devDependencies": { "@tailwindcss/vite": "catalog:", "@tsconfig/node22": "catalog:", "@types/bun": "catalog:", + "@types/katex": "0.16.7", "@types/luxon": "catalog:", "tailwindcss": "catalog:", "typescript": "catalog:", @@ -411,7 +445,7 @@ }, "packages/util": { "name": "@opencode-ai/util", - "version": "1.0.152", + "version": "1.1.33", "dependencies": { "zod": "catalog:", }, @@ -422,7 +456,7 @@ }, "packages/web": { "name": "@opencode-ai/web", - "version": "1.0.152", + "version": "1.1.33", "dependencies": { "@astrojs/cloudflare": "12.6.3", "@astrojs/markdown-remark": "6.3.1", @@ -437,12 +471,11 @@ "js-base64": "3.7.7", "lang-map": "0.4.0", "luxon": "catalog:", - "marked": "15.0.12", - "marked-shiki": "1.2.1", + "marked": "catalog:", + "marked-shiki": "catalog:", "rehype-autolink-headings": "7.1.0", "remeda": "catalog:", - "sharp": "0.32.5", - "shiki": "3.4.2", + "shiki": "catalog:", "solid-js": "catalog:", "toolbeam-docs-theme": "0.4.8", }, @@ -454,7 +487,6 @@ }, }, "trustedDependencies": [ - "sharp", "esbuild", "web-tree-sitter", "tree-sitter-bash", @@ -470,25 +502,33 @@ "@cloudflare/workers-types": "4.20251008.0", "@hono/zod-validator": "0.4.2", "@kobalte/core": "0.13.11", + "@octokit/rest": "22.0.0", "@openauthjs/openauth": "0.0.0-20250322224806", - "@pierre/precision-diffs": "0.6.1", + "@pierre/diffs": "1.0.2", + "@playwright/test": "1.51.0", + "@solid-primitives/storage": "4.3.3", "@solidjs/meta": "0.29.4", "@solidjs/router": "0.15.4", "@solidjs/start": "https://pkg.pr.new/@solidjs/start@dfb2020", "@tailwindcss/vite": "4.1.11", "@tsconfig/bun": "1.0.9", "@tsconfig/node22": "22.0.2", - "@types/bun": "1.3.4", + "@types/bun": "1.3.5", "@types/luxon": "3.7.1", "@types/node": "22.13.9", + "@types/semver": "7.7.1", "@typescript/native-preview": "7.0.0-dev.20251207.1", - "ai": "5.0.97", + "ai": "5.0.119", "diff": "8.0.2", + "dompurify": "3.3.1", "fuzzysort": "3.1.0", "hono": "4.10.7", "hono-openapi": "1.1.2", "luxon": "3.6.1", + "marked": "17.0.1", + "marked-shiki": "1.2.1", "remeda": "2.26.0", + "shiki": "3.20.0", "solid-js": "1.9.10", "solid-list": "0.3.0", "tailwindcss": "4.1.11", @@ -500,7 +540,7 @@ "zod": "4.1.8", }, "packages": { - "@actions/artifact": ["@actions/artifact@4.0.0", "", { "dependencies": { "@actions/core": "^1.10.0", "@actions/github": "^6.0.1", "@actions/http-client": "^2.1.0", "@azure/core-http": "^3.0.5", "@azure/storage-blob": "^12.15.0", "@octokit/core": "^5.2.1", "@octokit/plugin-request-log": "^1.0.4", "@octokit/plugin-retry": "^3.0.9", "@octokit/request": "^8.4.1", "@octokit/request-error": "^5.1.1", "@protobuf-ts/plugin": "^2.2.3-alpha.1", "archiver": "^7.0.1", "jwt-decode": "^3.1.2", "unzip-stream": "^0.3.1" } }, "sha512-HCc2jMJRAfviGFAh0FsOR/jNfWhirxl7W6z8zDtttt0GltwxBLdEIjLiweOPFl9WbyJRW1VWnPUSAixJqcWUMQ=="], + "@actions/artifact": ["@actions/artifact@5.0.1", "", { "dependencies": { "@actions/core": "^2.0.0", "@actions/github": "^6.0.1", "@actions/http-client": "^3.0.0", "@azure/storage-blob": "^12.29.1", "@octokit/core": "^5.2.1", "@octokit/plugin-request-log": "^1.0.4", "@octokit/plugin-retry": "^3.0.9", "@octokit/request": "^8.4.1", "@octokit/request-error": "^5.1.1", "@protobuf-ts/plugin": "^2.2.3-alpha.1", "archiver": "^7.0.1", "jwt-decode": "^3.1.2", "unzip-stream": "^0.3.1" } }, "sha512-dHJ5rHduhCKUikKTT9eXeWoUvfKia3IjR1sO/VTAV3DVAL4yMTRnl2iO5mcfiBjySHLwPNezwENAVskKYU5ymw=="], "@actions/core": ["@actions/core@1.11.1", "", { "dependencies": { "@actions/exec": "^1.1.1", "@actions/http-client": "^2.0.1" } }, "sha512-hXJCSrkwfA46Vd9Z3q4cpEpHB1rL5NG04+/rbqW9d3+CSvtB1tYe8UTpAlixa1vj0m/ULglfEK2UKxMGxCxv5A=="], @@ -508,40 +548,60 @@ "@actions/github": ["@actions/github@6.0.1", "", { "dependencies": { "@actions/http-client": "^2.2.0", "@octokit/core": "^5.0.1", "@octokit/plugin-paginate-rest": "^9.2.2", "@octokit/plugin-rest-endpoint-methods": "^10.4.0", "@octokit/request": "^8.4.1", "@octokit/request-error": "^5.1.1", "undici": "^5.28.5" } }, "sha512-xbZVcaqD4XnQAe35qSQqskb3SqIAfRyLBrHMd/8TuL7hJSz2QtbDwnNM8zWx4zO5l2fnGtseNE3MbEvD7BxVMw=="], - "@actions/http-client": ["@actions/http-client@2.2.3", "", { "dependencies": { "tunnel": "^0.0.6", "undici": "^5.25.4" } }, "sha512-mx8hyJi/hjFvbPokCg4uRd4ZX78t+YyRPtnKWwIl+RzNaVuFpQHfmlGVfsKEJN8LwTCvL+DfVgAM04XaHkm6bA=="], + "@actions/http-client": ["@actions/http-client@3.0.0", "", { "dependencies": { "tunnel": "^0.0.6", "undici": "^5.28.5" } }, "sha512-1s3tXAfVMSz9a4ZEBkXXRQD4QhY3+GAsWSbaYpeknPOKEeyRiU3lH+bHiLMZdo2x/fIeQ/hscL1wCkDLVM2DZQ=="], "@actions/io": ["@actions/io@1.1.3", "", {}, "sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q=="], "@adobe/css-tools": ["@adobe/css-tools@4.4.4", "", {}, "sha512-Elp+iwUx5rN5+Y8xLt5/GRoG20WGoDCQ/1Fb+1LiGtvwbDavuSk0jhD/eZdckHAuzcDzccnkv+rEjyWfRx18gg=="], - "@agentclientprotocol/sdk": ["@agentclientprotocol/sdk@0.5.1", "", { "dependencies": { "zod": "^3.0.0" } }, "sha512-9bq2TgjhLBSUSC5jE04MEe+Hqw8YePzKghhYZ9QcjOyonY3q2oJfX6GoSO83hURpEnsqEPIrex6VZN3+61fBJg=="], + "@agentclientprotocol/sdk": ["@agentclientprotocol/sdk@0.12.0", "", { "peerDependencies": { "zod": "^3.25.0 || ^4.0.0" } }, "sha512-V8uH/KK1t7utqyJmTA7y7DzKu6+jKFIXM+ZVouz8E55j8Ej2RV42rEvPKn3/PpBJlliI5crcGk1qQhZ7VwaepA=="], - "@ai-sdk/amazon-bedrock": ["@ai-sdk/amazon-bedrock@3.0.57", "", { "dependencies": { "@ai-sdk/anthropic": "2.0.45", "@ai-sdk/provider": "2.0.0", "@ai-sdk/provider-utils": "3.0.17", "@smithy/eventstream-codec": "^4.0.1", "@smithy/util-utf8": "^4.0.0", "aws4fetch": "^1.0.20" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-mOUSLe+RgZzx0rtL1p9QXmSd/08z1EkBR+vQ1ydpd1t5P0Nx2kB8afiukEgM8nuDvmO9eYQlp7VTy1n5ffPs2g=="], + "@ai-sdk/amazon-bedrock": ["@ai-sdk/amazon-bedrock@3.0.73", "", { "dependencies": { "@ai-sdk/anthropic": "2.0.57", "@ai-sdk/provider": "2.0.1", "@ai-sdk/provider-utils": "3.0.20", "@smithy/eventstream-codec": "^4.0.1", "@smithy/util-utf8": "^4.0.0", "aws4fetch": "^1.0.20" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-EAAGJ/dfbAZaqIhK3w52hq6cftSLZwXdC6uHKh8Cls1T0N4MxS6ykDf54UyFO3bZWkQxR+Mdw1B3qireGOxtJQ=="], "@ai-sdk/anthropic": ["@ai-sdk/anthropic@2.0.0", "", { "dependencies": { "@ai-sdk/provider": "2.0.0", "@ai-sdk/provider-utils": "3.0.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4" } }, "sha512-uyyaO4KhxoIKZztREqLPh+6/K3ZJx/rp72JKoUEL9/kC+vfQTThUfPnY/bUryUpcnawx8IY/tSoYNOi/8PCv7w=="], - "@ai-sdk/azure": ["@ai-sdk/azure@2.0.73", "", { "dependencies": { "@ai-sdk/openai": "2.0.71", "@ai-sdk/provider": "2.0.0", "@ai-sdk/provider-utils": "3.0.17" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-LpAg3Ak/V3WOemBu35Qbx9jfQfApsHNXX9p3bXVsnRu3XXi1QQUt5gMOCIb4znPonz+XnHenIDZMBwdsb1TfRQ=="], + "@ai-sdk/azure": ["@ai-sdk/azure@2.0.91", "", { "dependencies": { "@ai-sdk/openai": "2.0.89", "@ai-sdk/provider": "2.0.1", "@ai-sdk/provider-utils": "3.0.20" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-9tznVSs6LGQNKKxb8pKd7CkBV9yk+a/ENpFicHCj2CmBUKefxzwJ9JbUqrlK3VF6dGZw3LXq0dWxt7/Yekaj1w=="], + + "@ai-sdk/cerebras": ["@ai-sdk/cerebras@1.0.34", "", { "dependencies": { "@ai-sdk/openai-compatible": "1.0.30", "@ai-sdk/provider": "2.0.1", "@ai-sdk/provider-utils": "3.0.20" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-XOK0dJsAGoPYi/lfR4KFBi8xhvJ46oCpAxUD6FmJAuJ4eh0qlj5zDt+myvzM8gvN7S6K7zHD+mdWlOPKGQT8Vg=="], + + "@ai-sdk/cohere": ["@ai-sdk/cohere@2.0.22", "", { "dependencies": { "@ai-sdk/provider": "2.0.1", "@ai-sdk/provider-utils": "3.0.20" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-yJ9kP5cEDJwo8qpITq5TQFD8YNfNtW+HbyvWwrKMbFzmiMvIZuk95HIaFXE7PCTuZsqMA05yYu+qX/vQ3rNKjA=="], - "@ai-sdk/gateway": ["@ai-sdk/gateway@2.0.12", "", { "dependencies": { "@ai-sdk/provider": "2.0.0", "@ai-sdk/provider-utils": "3.0.17", "@vercel/oidc": "3.0.5" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-W+cB1sOWvPcz9qiIsNtD+HxUrBUva2vWv2K1EFukuImX+HA0uZx3EyyOjhYQ9gtf/teqEG80M6OvJ7xx/VLV2A=="], + "@ai-sdk/deepinfra": ["@ai-sdk/deepinfra@1.0.31", "", { "dependencies": { "@ai-sdk/openai-compatible": "1.0.30", "@ai-sdk/provider": "2.0.1", "@ai-sdk/provider-utils": "3.0.20" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-87qFcYNvDF/89hB//MQjYTb3tlsAfmgeZrZ34RESeBTZpSgs0EzYOMqPMwFTHUNp4wteoifikDJbaS/9Da8cfw=="], - "@ai-sdk/google": ["@ai-sdk/google@2.0.44", "", { "dependencies": { "@ai-sdk/provider": "2.0.0", "@ai-sdk/provider-utils": "3.0.18" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-c5dck36FjqiVoeeMJQLTEmUheoURcGTU/nBT6iJu8/nZiKFT/y8pD85KMDRB7RerRYaaQOtslR2d6/5PditiRw=="], + "@ai-sdk/gateway": ["@ai-sdk/gateway@2.0.25", "", { "dependencies": { "@ai-sdk/provider": "2.0.1", "@ai-sdk/provider-utils": "3.0.20", "@vercel/oidc": "3.0.5" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-Rq+FX55ne7lMiqai7NcvvDZj4HLsr+hg77WayqmySqc6zhw3tIOLxd4Ty6OpwNj0C0bVMi3iCl2zvJIEirh9XA=="], - "@ai-sdk/google-vertex": ["@ai-sdk/google-vertex@3.0.81", "", { "dependencies": { "@ai-sdk/anthropic": "2.0.50", "@ai-sdk/google": "2.0.44", "@ai-sdk/provider": "2.0.0", "@ai-sdk/provider-utils": "3.0.18", "google-auth-library": "^9.15.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-yrl5Ug0Mqwo9ya45oxczgy2RWgpEA/XQQCSFYP+3NZMQ4yA3Iim1vkOjVCsGaZZ8rjVk395abi1ZMZV0/6rqVA=="], + "@ai-sdk/google": ["@ai-sdk/google@2.0.52", "", { "dependencies": { "@ai-sdk/provider": "2.0.1", "@ai-sdk/provider-utils": "3.0.20" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-2XUnGi3f7TV4ujoAhA+Fg3idUoG/+Y2xjCRg70a1/m0DH1KSQqYaCboJ1C19y6ZHGdf5KNT20eJdswP6TvrY2g=="], - "@ai-sdk/mcp": ["@ai-sdk/mcp@0.0.8", "", { "dependencies": { "@ai-sdk/provider": "2.0.0", "@ai-sdk/provider-utils": "3.0.17", "pkce-challenge": "^5.0.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-9y9GuGcZ9/+pMIHfpOCJgZVp+AZMv6TkjX2NVT17SQZvTF2N8LXuCXyoUPyi1PxIxzxl0n463LxxaB2O6olC+Q=="], + "@ai-sdk/google-vertex": ["@ai-sdk/google-vertex@3.0.97", "", { "dependencies": { "@ai-sdk/anthropic": "2.0.57", "@ai-sdk/google": "2.0.52", "@ai-sdk/provider": "2.0.1", "@ai-sdk/provider-utils": "3.0.20", "google-auth-library": "^10.5.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-s4tI7Z15i6FlbtCvS4SBRal8wRfkOXJzKxlS6cU4mJW/QfUfoVy4b22836NVNJwDvkG/HkDSfzwm/X8mn46MhA=="], + + "@ai-sdk/groq": ["@ai-sdk/groq@2.0.34", "", { "dependencies": { "@ai-sdk/provider": "2.0.1", "@ai-sdk/provider-utils": "3.0.20" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-wfCYkVgmVjxNA32T57KbLabVnv9aFUflJ4urJ7eWgTwbnmGQHElCTu+rJ3ydxkXSqxOkXPwMOttDm7XNrvPjmg=="], + + "@ai-sdk/mistral": ["@ai-sdk/mistral@2.0.27", "", { "dependencies": { "@ai-sdk/provider": "2.0.1", "@ai-sdk/provider-utils": "3.0.20" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-gaptHgaXjMw3+eA0Q4FABcsj5nQNP6EpFaGUR+Pj5WJy7Kn6mApl975/x57224MfeJIShNpt8wFKK3tvh5ewKg=="], "@ai-sdk/openai": ["@ai-sdk/openai@2.0.2", "", { "dependencies": { "@ai-sdk/provider": "2.0.0", "@ai-sdk/provider-utils": "3.0.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4" } }, "sha512-D4zYz2uR90aooKQvX1XnS00Z7PkbrcY+snUvPfm5bCabTG7bzLrVtD56nJ5bSaZG8lmuOMfXpyiEEArYLyWPpw=="], "@ai-sdk/openai-compatible": ["@ai-sdk/openai-compatible@1.0.1", "", { "dependencies": { "@ai-sdk/provider": "2.0.0", "@ai-sdk/provider-utils": "3.0.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4" } }, "sha512-luHVcU+yKzwv3ekKgbP3v+elUVxb2Rt+8c6w9qi7g2NYG2/pEL21oIrnaEnc6UtTZLLZX9EFBcpq2N1FQKDIMw=="], - "@ai-sdk/provider": ["@ai-sdk/provider@2.0.0", "", { "dependencies": { "json-schema": "^0.4.0" } }, "sha512-6o7Y2SeO9vFKB8lArHXehNuusnpddKPk7xqL7T2/b+OvXMRIXUO1rR4wcv1hAFUAT9avGZshty3Wlua/XA7TvA=="], + "@ai-sdk/perplexity": ["@ai-sdk/perplexity@2.0.23", "", { "dependencies": { "@ai-sdk/provider": "2.0.1", "@ai-sdk/provider-utils": "3.0.20" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-aiaRvnc6mhQZKhTTSXPCjPH8Iqr5D/PfCN1hgVP/3RGTBbJtsd9HemIBSABeSdAKbsMH/PwJxgnqH75HEamcBA=="], + + "@ai-sdk/provider": ["@ai-sdk/provider@2.0.1", "", { "dependencies": { "json-schema": "^0.4.0" } }, "sha512-KCUwswvsC5VsW2PWFqF8eJgSCu5Ysj7m1TxiHTVA6g7k360bk0RNQENT8KTMAYEs+8fWPD3Uu4dEmzGHc+jGng=="], - "@ai-sdk/provider-utils": ["@ai-sdk/provider-utils@3.0.18", "", { "dependencies": { "@ai-sdk/provider": "2.0.0", "@standard-schema/spec": "^1.0.0", "eventsource-parser": "^3.0.6" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-ypv1xXMsgGcNKUP+hglKqtdDuMg68nWHucPPAhIENrbFAI+xCHiqPVN8Zllxyv1TNZwGWUghPxJXU+Mqps0YRQ=="], + "@ai-sdk/provider-utils": ["@ai-sdk/provider-utils@3.0.20", "", { "dependencies": { "@ai-sdk/provider": "2.0.1", "@standard-schema/spec": "^1.0.0", "eventsource-parser": "^3.0.6" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-iXHVe0apM2zUEzauqJwqmpC37A5rihrStAih5Ks+JE32iTe4LZ58y17UGBjpQQTCRw9YxMeo2UFLxLpBluyvLQ=="], + + "@ai-sdk/togetherai": ["@ai-sdk/togetherai@1.0.31", "", { "dependencies": { "@ai-sdk/openai-compatible": "1.0.30", "@ai-sdk/provider": "2.0.1", "@ai-sdk/provider-utils": "3.0.20" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-RlYubjStoZQxna4Ng91Vvo8YskvL7lW9zj68IwZfCnaDBSAp1u6Nhc5BR4ZtKnY6PA3XEtu4bATIQl7yiiQ+Lw=="], + + "@ai-sdk/vercel": ["@ai-sdk/vercel@1.0.31", "", { "dependencies": { "@ai-sdk/openai-compatible": "1.0.30", "@ai-sdk/provider": "2.0.1", "@ai-sdk/provider-utils": "3.0.20" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-ggvwAMt/KsbqcdR6ILQrjwrRONLV/8aG6rOLbjcOGvV0Ai+WdZRRKQj5nOeQ06PvwVQtKdkp7S4IinpXIhCiHg=="], + + "@ai-sdk/xai": ["@ai-sdk/xai@2.0.51", "", { "dependencies": { "@ai-sdk/openai-compatible": "1.0.30", "@ai-sdk/provider": "2.0.1", "@ai-sdk/provider-utils": "3.0.20" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-AI3le03qiegkZvn9hpnpDwez49lOvQLj4QUBT8H41SMbrdTYOxn3ktTwrsSu90cNDdzKGMvoH0u2GHju1EdnCg=="], "@alloc/quick-lru": ["@alloc/quick-lru@5.2.0", "", {}, "sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw=="], "@ampproject/remapping": ["@ampproject/remapping@2.3.0", "", { "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw=="], + "@anthropic-ai/sdk": ["@anthropic-ai/sdk@0.71.2", "", { "dependencies": { "json-schema-to-ts": "^3.1.1" }, "peerDependencies": { "zod": "^3.25.0 || ^4.0.0" }, "optionalPeers": ["zod"], "bin": { "anthropic-ai-sdk": "bin/cli" } }, "sha512-TGNDEUuEstk/DKu0/TflXAEt+p+p/WhTlFzEnoosvbaDU2LTjm42igSdlL0VijrKpWejtOKxX0b8A7uc+XiSAQ=="], + + "@anycable/core": ["@anycable/core@0.9.2", "", { "dependencies": { "nanoevents": "^7.0.1" } }, "sha512-x5ZXDcW/N4cxWl93CnbHs/u7qq4793jS2kNPWm+duPrXlrva+ml2ZGT7X9tuOBKzyIHf60zWCdIK7TUgMPAwXA=="], + "@astrojs/cloudflare": ["@astrojs/cloudflare@12.6.3", "", { "dependencies": { "@astrojs/internal-helpers": "0.7.1", "@astrojs/underscore-redirects": "1.0.0", "@cloudflare/workers-types": "^4.20250507.0", "tinyglobby": "^0.2.13", "vite": "^6.3.5", "wrangler": "^4.14.1" }, "peerDependencies": { "astro": "^5.0.0" } }, "sha512-xhJptF5tU2k5eo70nIMyL1Udma0CqmUEnGSlGyFflLqSY82CRQI6nWZ/xZt0ZvmXuErUjIx0YYQNfZsz5CNjLQ=="], "@astrojs/compiler": ["@astrojs/compiler@2.13.0", "", {}, "sha512-mqVORhUJViA28fwHYaWmsXSzLO9osbdZ5ImUfxBarqsYdMlPbqAqGJCxsNzvppp1BEzc1mJNjOVvQqeDN8Vspw=="], @@ -644,7 +704,7 @@ "@aws/lambda-invoke-store": ["@aws/lambda-invoke-store@0.2.1", "", {}, "sha512-sIyFcoPZkTtNu9xFeEoynMef3bPJIAbOfUh+ueYcfhVl6xm2VRtMcMclSxmZCMnHHd4hlYKJeq/aggmBEWynww=="], - "@azure/abort-controller": ["@azure/abort-controller@1.1.0", "", { "dependencies": { "tslib": "^2.2.0" } }, "sha512-TrRLIoSQVzfAJX9H1JeFjzAoDGcoK1IYX1UImfceTZpsyYfWr09Ss1aHW1y5TrrR3iq6RZLBwJ3E24uwPhwahw=="], + "@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=="], @@ -660,7 +720,7 @@ "@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.0.0-preview.13", "", { "dependencies": { "@opentelemetry/api": "^1.0.1", "tslib": "^2.2.0" } }, "sha512-KxDlhXyMlh2Jhj2ykX6vNEU0Vou4nHr025KoSEiz7cS3BNiHNaZcdECk/DmLkEB0as5T7b/TpRcehJ5yV6NeXQ=="], + "@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=="], @@ -862,13 +922,19 @@ "@fontsource/inter": ["@fontsource/inter@5.2.8", "", {}, "sha512-P6r5WnJoKiNVV+zvW2xM13gNdFhAEpQ9dQJHt3naLvfg+LkF2ldgSLiF4T41lf1SQCM9QmkqPTn4TH568IRagg=="], + "@gitlab/gitlab-ai-provider": ["@gitlab/gitlab-ai-provider@3.2.0", "", { "dependencies": { "@anthropic-ai/sdk": "^0.71.0", "@anycable/core": "^0.9.2", "graphql-request": "^6.1.0", "isomorphic-ws": "^5.0.0", "openai": "^6.16.0", "socket.io-client": "^4.8.1", "vscode-jsonrpc": "^8.2.1", "zod": "^3.25.76" }, "peerDependencies": { "@ai-sdk/provider": ">=2.0.0", "@ai-sdk/provider-utils": ">=3.0.0" } }, "sha512-sqP34jDSWWEHygmYbM2rzIcRjhA+1FHVHj8mxUvVz1s7o2Cgb1NnOaUXU7eWTI0AGhO+tPYHDTqI/mRC4cdjlQ=="], + + "@graphql-typed-document-node/core": ["@graphql-typed-document-node/core@3.2.0", "", { "peerDependencies": { "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" } }, "sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ=="], + "@happy-dom/global-registrator": ["@happy-dom/global-registrator@20.0.11", "", { "dependencies": { "@types/node": "^20.0.0", "happy-dom": "^20.0.11" } }, "sha512-GqNqiShBT/lzkHTMC/slKBrvN0DsD4Di8ssBk4aDaVgEn+2WMzE6DXxq701ndSXj7/0cJ8mNT71pM7Bnrr6JRw=="], - "@hey-api/codegen-core": ["@hey-api/codegen-core@0.3.3", "", { "peerDependencies": { "typescript": ">=5.5.3" } }, "sha512-vArVDtrvdzFewu1hnjUm4jX1NBITlSCeO81EdWq676MxQbyxsGcDPAgohaSA+Wvr4HjPSvsg2/1s2zYxUtXebg=="], + "@hey-api/codegen-core": ["@hey-api/codegen-core@0.5.2", "", { "dependencies": { "ansi-colors": "4.1.3", "color-support": "1.1.3" }, "peerDependencies": { "typescript": ">=5.5.3" } }, "sha512-88cqrrB2cLXN8nMOHidQTcVOnZsJ5kebEbBefjMCifaUCwTA30ouSSWvTZqrOX4O104zjJyu7M8Gcv/NNYQuaA=="], "@hey-api/json-schema-ref-parser": ["@hey-api/json-schema-ref-parser@1.2.2", "", { "dependencies": { "@jsdevtools/ono": "^7.1.3", "@types/json-schema": "^7.0.15", "js-yaml": "^4.1.1", "lodash": "^4.17.21" } }, "sha512-oS+5yAdwnK20lSeFO1d53Ku+yaGCsY8PcrmSq2GtSs3bsBfRnHAbpPKSVzQcaxAOrzj5NB+f34WhZglVrNayBA=="], - "@hey-api/openapi-ts": ["@hey-api/openapi-ts@0.88.1", "", { "dependencies": { "@hey-api/codegen-core": "^0.3.3", "@hey-api/json-schema-ref-parser": "1.2.2", "ansi-colors": "4.1.3", "c12": "3.3.2", "color-support": "1.1.3", "commander": "14.0.2", "open": "11.0.0", "semver": "7.7.2" }, "peerDependencies": { "typescript": ">=5.5.3" }, "bin": { "openapi-ts": "bin/run.js" } }, "sha512-x/nDTupOnV9VuSeNIiJpgIpc915GHduhyseJeMTnI0JMsXaObmpa0rgPr3ASVEYMLgpvqozIEG1RTOOnal6zLQ=="], + "@hey-api/openapi-ts": ["@hey-api/openapi-ts@0.90.4", "", { "dependencies": { "@hey-api/codegen-core": "^0.5.2", "@hey-api/json-schema-ref-parser": "1.2.2", "ansi-colors": "4.1.3", "c12": "3.3.3", "color-support": "1.1.3", "commander": "14.0.2", "open": "11.0.0", "semver": "7.7.3" }, "peerDependencies": { "typescript": ">=5.5.3" }, "bin": { "openapi-ts": "bin/run.js" } }, "sha512-9l++kjcb0ui4JqPlueZ6OZ9zKn6eK/8//Z2jHcIXb5MRwDRgubOOSpTU5llEv3uvWfT10VzcMp99dySWq0AASw=="], + + "@hono/node-server": ["@hono/node-server@1.19.7", "", { "peerDependencies": { "hono": "^4" } }, "sha512-vUcD0uauS7EU2caukW8z5lJKtoGMokxNbJtBiwHgpqxEXokaHCBkQUmCHhjFB1VUTWdqj25QoMkMKzgjq+uhrw=="], "@hono/standard-validator": ["@hono/standard-validator@0.1.5", "", { "peerDependencies": { "@standard-schema/spec": "1.0.0", "hono": ">=3.9.0" } }, "sha512-EIyZPPwkyLn6XKwFj5NBEWHXhXbgmnVh2ceIFo5GO7gKI9WmzTjPDKnppQB0KrqKeAkq3kpoW4SIbu5X1dgx3w=="], @@ -1048,11 +1114,13 @@ "@kurkle/color": ["@kurkle/color@0.3.4", "", {}, "sha512-M5UknZPHRu3DEDWoipU6sE8PdkZ6Z/S+v4dD+Ke8IaNlpdSQah50lz1KtcFBa2vsdOnwbbnxJwVM4wty6udA5w=="], + "@leichtgewicht/ip-codec": ["@leichtgewicht/ip-codec@2.0.5", "", {}, "sha512-Vo+PSpZG2/fmgmiNzYK9qWRh8h/CHrwD0mo1h1DzL4yzHNSfWYujGTYsWGreD000gcgmZ7K4Ys6Tx9TxtsKdDw=="], + "@mdx-js/mdx": ["@mdx-js/mdx@3.1.1", "", { "dependencies": { "@types/estree": "^1.0.0", "@types/estree-jsx": "^1.0.0", "@types/hast": "^3.0.0", "@types/mdx": "^2.0.0", "acorn": "^8.0.0", "collapse-white-space": "^2.0.0", "devlop": "^1.0.0", "estree-util-is-identifier-name": "^3.0.0", "estree-util-scope": "^1.0.0", "estree-walker": "^3.0.0", "hast-util-to-jsx-runtime": "^2.0.0", "markdown-extensions": "^2.0.0", "recma-build-jsx": "^1.0.0", "recma-jsx": "^1.0.0", "recma-stringify": "^1.0.0", "rehype-recma": "^1.0.0", "remark-mdx": "^3.0.0", "remark-parse": "^11.0.0", "remark-rehype": "^11.0.0", "source-map": "^0.7.0", "unified": "^11.0.0", "unist-util-position-from-estree": "^2.0.0", "unist-util-stringify-position": "^4.0.0", "unist-util-visit": "^5.0.0", "vfile": "^6.0.0" } }, "sha512-f6ZO2ifpwAQIpzGWaBQT2TXxPv6z3RBzQKpVftEWN78Vl/YweF1uwussDx8ECAXVtr3Rs89fKyG9YlzUs9DyGQ=="], "@mixmark-io/domino": ["@mixmark-io/domino@2.2.0", "", {}, "sha512-Y28PR25bHXUg88kCV7nivXrP2Nj2RueZ3/l/jdx6J9f8J4nsEGcgX0Qe6lt7Pa+J79+kPiJU3LguR6O/6zrLOw=="], - "@modelcontextprotocol/sdk": ["@modelcontextprotocol/sdk@1.15.1", "", { "dependencies": { "ajv": "^6.12.6", "content-type": "^1.0.5", "cors": "^2.8.5", "cross-spawn": "^7.0.5", "eventsource": "^3.0.2", "eventsource-parser": "^3.0.0", "express": "^5.0.1", "express-rate-limit": "^7.5.0", "pkce-challenge": "^5.0.0", "raw-body": "^3.0.0", "zod": "^3.23.8", "zod-to-json-schema": "^3.24.1" } }, "sha512-W/XlN9c528yYn+9MQkVjxiTPgPxoxt+oczfjHBDsJx0+59+O7B75Zhsp0B16Xbwbz8ANISDajh6+V7nIcPMc5w=="], + "@modelcontextprotocol/sdk": ["@modelcontextprotocol/sdk@1.25.2", "", { "dependencies": { "@hono/node-server": "^1.19.7", "ajv": "^8.17.1", "ajv-formats": "^3.0.1", "content-type": "^1.0.5", "cors": "^2.8.5", "cross-spawn": "^7.0.5", "eventsource": "^3.0.2", "eventsource-parser": "^3.0.0", "express": "^5.0.1", "express-rate-limit": "^7.5.0", "jose": "^6.1.1", "json-schema-typed": "^8.0.2", "pkce-challenge": "^5.0.0", "raw-body": "^3.0.0", "zod": "^3.25 || ^4.0", "zod-to-json-schema": "^3.25.0" }, "peerDependencies": { "@cfworker/json-schema": "^4.1.1" }, "optionalPeers": ["@cfworker/json-schema"] }, "sha512-LZFeo4F9M5qOhC/Uc1aQSrBHxMrvxett+9KLHt7OhcExtoiRN9DKgbZffMP/nxjutWDQpfMDfP3nkHI4X9ijww=="], "@motionone/animation": ["@motionone/animation@10.18.0", "", { "dependencies": { "@motionone/easing": "^10.18.0", "@motionone/types": "^10.17.1", "@motionone/utils": "^10.18.0", "tslib": "^2.3.1" } }, "sha512-9z2p5GFGCm0gBsZbi8rVMOAJCtw1WqBTIPw3ozk06gDvZInBPIsQcHgYogEJ4yuHJ+akuW8g1SEIOpTOvYs8hw=="], @@ -1082,11 +1150,11 @@ "@octokit/auth-oauth-user": ["@octokit/auth-oauth-user@6.0.2", "", { "dependencies": { "@octokit/auth-oauth-device": "^8.0.3", "@octokit/oauth-methods": "^6.0.2", "@octokit/request": "^10.0.6", "@octokit/types": "^16.0.0", "universal-user-agent": "^7.0.0" } }, "sha512-qLoPPc6E6GJoz3XeDG/pnDhJpTkODTGG4kY0/Py154i/I003O9NazkrwJwRuzgCalhzyIeWQ+6MDvkUmKXjg/A=="], - "@octokit/auth-token": ["@octokit/auth-token@6.0.0", "", {}, "sha512-P4YJBPdPSpWTQ1NU4XYdvHvXJJDxM6YwpS0FZHRgP7YFkdVxsWcpWGy/NVqlAA7PcPCnMacXlRm1y2PFZRWL/w=="], + "@octokit/auth-token": ["@octokit/auth-token@4.0.0", "", {}, "sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA=="], - "@octokit/core": ["@octokit/core@7.0.6", "", { "dependencies": { "@octokit/auth-token": "^6.0.0", "@octokit/graphql": "^9.0.3", "@octokit/request": "^10.0.6", "@octokit/request-error": "^7.0.2", "@octokit/types": "^16.0.0", "before-after-hook": "^4.0.0", "universal-user-agent": "^7.0.0" } }, "sha512-DhGl4xMVFGVIyMwswXeyzdL4uXD5OGILGX5N8Y+f6W7LhC1Ze2poSNrkF/fedpVDHEEZ+PHFW0vL14I+mm8K3Q=="], + "@octokit/core": ["@octokit/core@5.2.2", "", { "dependencies": { "@octokit/auth-token": "^4.0.0", "@octokit/graphql": "^7.1.0", "@octokit/request": "^8.4.1", "@octokit/request-error": "^5.1.1", "@octokit/types": "^13.0.0", "before-after-hook": "^2.2.0", "universal-user-agent": "^6.0.0" } }, "sha512-/g2d4sW9nUDJOMz3mabVQvOGhVa4e/BN/Um7yca9Bb2XTzPPnfTWHWQg+IsEYO7M3Vx+EXvaM/I2pJWIMun1bg=="], - "@octokit/endpoint": ["@octokit/endpoint@11.0.2", "", { "dependencies": { "@octokit/types": "^16.0.0", "universal-user-agent": "^7.0.2" } }, "sha512-4zCpzP1fWc7QlqunZ5bSEjxc6yLAlRTnDwKtgXfcI/FxxGoqedDG8V2+xJ60bV2kODqcGB+nATdtap/XYq2NZQ=="], + "@octokit/endpoint": ["@octokit/endpoint@9.0.6", "", { "dependencies": { "@octokit/types": "^13.1.0", "universal-user-agent": "^6.0.0" } }, "sha512-H1fNTMA57HbkFESSt3Y9+FBICv+0jFceJFPWDePYlR/iMGrwM5ph+Dd4XRQs+8X+PUFURLQgX9ChPfhJ/1uNQw=="], "@octokit/graphql": ["@octokit/graphql@9.0.2", "", { "dependencies": { "@octokit/request": "^10.0.4", "@octokit/types": "^15.0.0", "universal-user-agent": "^7.0.0" } }, "sha512-iz6KzZ7u95Fzy9Nt2L8cG88lGRMr/qy1Q36ih/XVzMIlPDMYwaNLE/ENhqmIzgPrlNWiYJkwmveEetvxAgFBJw=="], @@ -1098,15 +1166,15 @@ "@octokit/plugin-paginate-rest": ["@octokit/plugin-paginate-rest@13.2.1", "", { "dependencies": { "@octokit/types": "^15.0.1" }, "peerDependencies": { "@octokit/core": ">=6" } }, "sha512-Tj4PkZyIL6eBMYcG/76QGsedF0+dWVeLhYprTmuFVVxzDW7PQh23tM0TP0z+1MvSkxB29YFZwnUX+cXfTiSdyw=="], - "@octokit/plugin-request-log": ["@octokit/plugin-request-log@6.0.0", "", { "peerDependencies": { "@octokit/core": ">=6" } }, "sha512-UkOzeEN3W91/eBq9sPZNQ7sUBvYCqYbrrD8gTbBuGtHEuycE4/awMXcYvx6sVYo7LypPhmQwwpUe4Yyu4QZN5Q=="], + "@octokit/plugin-request-log": ["@octokit/plugin-request-log@1.0.4", "", { "peerDependencies": { "@octokit/core": ">=3" } }, "sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA=="], "@octokit/plugin-rest-endpoint-methods": ["@octokit/plugin-rest-endpoint-methods@16.1.1", "", { "dependencies": { "@octokit/types": "^15.0.1" }, "peerDependencies": { "@octokit/core": ">=6" } }, "sha512-VztDkhM0ketQYSh5Im3IcKWFZl7VIrrsCaHbDINkdYeiiAsJzjhS2xRFCSJgfN6VOcsoW4laMtsmf3HcNqIimg=="], "@octokit/plugin-retry": ["@octokit/plugin-retry@3.0.9", "", { "dependencies": { "@octokit/types": "^6.0.3", "bottleneck": "^2.15.3" } }, "sha512-r+fArdP5+TG6l1Rv/C9hVoty6tldw6cE2pRHNGmFPdyfrc696R6JjrQ3d7HdVqGwuzfyrcaLAKD7K8TX8aehUQ=="], - "@octokit/request": ["@octokit/request@10.0.7", "", { "dependencies": { "@octokit/endpoint": "^11.0.2", "@octokit/request-error": "^7.0.2", "@octokit/types": "^16.0.0", "fast-content-type-parse": "^3.0.0", "universal-user-agent": "^7.0.2" } }, "sha512-v93h0i1yu4idj8qFPZwjehoJx4j3Ntn+JhXsdJrG9pYaX6j/XRz2RmasMUHtNgQD39nrv/VwTWSqK0RNXR8upA=="], + "@octokit/request": ["@octokit/request@8.4.1", "", { "dependencies": { "@octokit/endpoint": "^9.0.6", "@octokit/request-error": "^5.1.1", "@octokit/types": "^13.1.0", "universal-user-agent": "^6.0.0" } }, "sha512-qnB2+SY3hkCmBxZsR/MPCybNmbJe4KAlfWErXq+rBKkQJlbjdJeS85VI9r8UqeLYLvnAenU8Q1okM/0MBsAGXw=="], - "@octokit/request-error": ["@octokit/request-error@7.1.0", "", { "dependencies": { "@octokit/types": "^16.0.0" } }, "sha512-KMQIfq5sOPpkQYajXHwnhjCC0slzCNScLHs9JafXc4RAJI+9f+jNDlBNaIMTvazOPLgb4BnlhGJOTbnN0wIjPw=="], + "@octokit/request-error": ["@octokit/request-error@5.1.1", "", { "dependencies": { "@octokit/types": "^13.1.0", "deprecation": "^2.0.0", "once": "^1.4.0" } }, "sha512-v9iyEQJH6ZntoENr9/yXxjuezh4My67CBSu9r6Ve/05Iu5gNgnisNWOsoJHTP6k0Rr0+HQIpnH+kyammu90q/g=="], "@octokit/rest": ["@octokit/rest@22.0.0", "", { "dependencies": { "@octokit/core": "^7.0.2", "@octokit/plugin-paginate-rest": "^13.0.1", "@octokit/plugin-request-log": "^6.0.0", "@octokit/plugin-rest-endpoint-methods": "^16.0.0" } }, "sha512-z6tmTu9BTnw51jYGulxrlernpsQYXpui1RK21vmXn8yF5bp6iX16yfTtJYGK5Mh1qDkvDOmp2n8sRMcQmR8jiA=="], @@ -1118,6 +1186,8 @@ "@openauthjs/openauth": ["@openauthjs/openauth@0.0.0-20250322224806", "", { "dependencies": { "@standard-schema/spec": "1.0.0-beta.3", "aws4fetch": "1.0.20", "jose": "5.9.6" }, "peerDependencies": { "arctic": "^2.2.2", "hono": "^4.0.0" } }, "sha512-p5IWSRXvABcwocH2dNI0w8c1QJelIOFulwhKk+aLLFfUbs8u1pr7kQbYe8yCSM2+bcLHiwbogpUQc2ovrGwCuw=="], + "@opencode-ai/app": ["@opencode-ai/app@workspace:packages/app"], + "@opencode-ai/console-app": ["@opencode-ai/console-app@workspace:packages/console/app"], "@opencode-ai/console-core": ["@opencode-ai/console-core@workspace:packages/console/core"], @@ -1142,8 +1212,6 @@ "@opencode-ai/slack": ["@opencode-ai/slack@workspace:packages/slack"], - "@opencode-ai/tauri": ["@opencode-ai/tauri@workspace:packages/tauri"], - "@opencode-ai/ui": ["@opencode-ai/ui@workspace:packages/ui"], "@opencode-ai/util": ["@opencode-ai/util@workspace:packages/util"], @@ -1156,21 +1224,21 @@ "@opentelemetry/api": ["@opentelemetry/api@1.9.0", "", {}, "sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg=="], - "@opentui/core": ["@opentui/core@0.0.0-20251211-4403a69a", "", { "dependencies": { "bun-ffi-structs": "0.1.2", "diff": "8.0.2", "jimp": "1.6.0", "yoga-layout": "3.2.1" }, "optionalDependencies": { "@dimforge/rapier2d-simd-compat": "^0.17.3", "@opentui/core-darwin-arm64": "0.0.0-20251211-4403a69a", "@opentui/core-darwin-x64": "0.0.0-20251211-4403a69a", "@opentui/core-linux-arm64": "0.0.0-20251211-4403a69a", "@opentui/core-linux-x64": "0.0.0-20251211-4403a69a", "@opentui/core-win32-arm64": "0.0.0-20251211-4403a69a", "@opentui/core-win32-x64": "0.0.0-20251211-4403a69a", "bun-webgpu": "0.1.4", "planck": "^1.4.2", "three": "0.177.0" }, "peerDependencies": { "web-tree-sitter": "0.25.10" } }, "sha512-wTZKcokyU9yiDqyC0Pvf9eRSdT73s4Ynerkit/z8Af++tynqrTlZHZCXK3o42Ff7itCSILmijcTU94n69aEypA=="], + "@opentui/core": ["@opentui/core@0.1.74", "", { "dependencies": { "bun-ffi-structs": "0.1.2", "diff": "8.0.2", "jimp": "1.6.0", "yoga-layout": "3.2.1" }, "optionalDependencies": { "@dimforge/rapier2d-simd-compat": "^0.17.3", "@opentui/core-darwin-arm64": "0.1.74", "@opentui/core-darwin-x64": "0.1.74", "@opentui/core-linux-arm64": "0.1.74", "@opentui/core-linux-x64": "0.1.74", "@opentui/core-win32-arm64": "0.1.74", "@opentui/core-win32-x64": "0.1.74", "bun-webgpu": "0.1.4", "planck": "^1.4.2", "three": "0.177.0" }, "peerDependencies": { "web-tree-sitter": "0.25.10" } }, "sha512-g4W16ymv12JdgZ+9B4t7mpIICvzWy2+eHERfmDf80ALduOQCUedKQdULcBFhVCYUXIkDRtIy6CID5thMAah3FA=="], - "@opentui/core-darwin-arm64": ["@opentui/core-darwin-arm64@0.0.0-20251211-4403a69a", "", { "os": "darwin", "cpu": "arm64" }, "sha512-VAYjTa+Eiauy8gETXadD8y0PE6ppnKasDK1X354VoexZiWFR3r7rkL+TfDfk7whhqXDYyT44JDT1QmCAhVXRzQ=="], + "@opentui/core-darwin-arm64": ["@opentui/core-darwin-arm64@0.1.74", "", { "os": "darwin", "cpu": "arm64" }, "sha512-rfmlDLtm/u17CnuhJgCxPeYMvOST+A2MOdVOk46IurtHO849bdYqK6iudKNlFRs1FOrymgSKF9GlWBHAOKeRjg=="], - "@opentui/core-darwin-x64": ["@opentui/core-darwin-x64@0.0.0-20251211-4403a69a", "", { "os": "darwin", "cpu": "x64" }, "sha512-n9oVMpsojlILj1soORZzZ2Mjh8Zl73ZNcY7ot0iRmOjBDccrjDTsqKfxoGjKNd/xJSphLeu1LYGlcI5O5OczWQ=="], + "@opentui/core-darwin-x64": ["@opentui/core-darwin-x64@0.1.74", "", { "os": "darwin", "cpu": "x64" }, "sha512-WAD8orsDV0ZdW/5GwjOOB4FY96772xbkz+rcV7WRzEFUVaqoBaC04IuqYzS9d5s+cjkbT5Cpj47hrVYkkVQKng=="], - "@opentui/core-linux-arm64": ["@opentui/core-linux-arm64@0.0.0-20251211-4403a69a", "", { "os": "linux", "cpu": "arm64" }, "sha512-vf4eUjPMI4ANitK4MpTGenZFddKgQD/K21aN6cZjusnH3mTEJAoIR7GbNtMdz3qclU43ajpzTID9sAwhshwdVQ=="], + "@opentui/core-linux-arm64": ["@opentui/core-linux-arm64@0.1.74", "", { "os": "linux", "cpu": "arm64" }, "sha512-lgmHzrzLy4e+rgBS+lhtsMLLgIMLbtLNMm6EzVPyYVDlLDGjM7+ulXMem7AtpaRrWrUUl4REiG9BoQUsCFDwYA=="], - "@opentui/core-linux-x64": ["@opentui/core-linux-x64@0.0.0-20251211-4403a69a", "", { "os": "linux", "cpu": "x64" }, "sha512-61635Up0YvVJ8gZ2eMiL1c8OfA+U6wAzT++LoaurNjbmsUAlKHws6MZdqTLw7aspJJVGsRFbA6d1Y+gXFxbDrQ=="], + "@opentui/core-linux-x64": ["@opentui/core-linux-x64@0.1.74", "", { "os": "linux", "cpu": "x64" }, "sha512-8Mn2WbdBQ29xCThuPZezjDhd1N3+fXwKkGvCBOdTI0le6h2A/vCNbfUVjwfr/EGZSRXxCG+Yapol34BAULGpOA=="], - "@opentui/core-win32-arm64": ["@opentui/core-win32-arm64@0.0.0-20251211-4403a69a", "", { "os": "win32", "cpu": "arm64" }, "sha512-3lUddTJGKZ6uU388eU79MY//IEbgGENCITetDrrRp7v9L1AxMntE1ihf6HniziwBvKKJcsUfqLiJWcq0WPZw2w=="], + "@opentui/core-win32-arm64": ["@opentui/core-win32-arm64@0.1.74", "", { "os": "win32", "cpu": "arm64" }, "sha512-dvYUXz03avnI6ZluyLp00HPmR0UT/IE/6QS97XBsgJlUTtpnbKkBtB5jD1NHwWkElaRj1Qv2QP36ngFoJqbl9g=="], - "@opentui/core-win32-x64": ["@opentui/core-win32-x64@0.0.0-20251211-4403a69a", "", { "os": "win32", "cpu": "x64" }, "sha512-Xwc1gqYsn8UZNTzNKkigZozAhBNBGbfX2B/I/aSbyqL0h8+XIInOodI0urzJWc0B6aEv/IDiT6Rm3coXFikLIg=="], + "@opentui/core-win32-x64": ["@opentui/core-win32-x64@0.1.74", "", { "os": "win32", "cpu": "x64" }, "sha512-3wfWXaAKOIlDQz6ZZIESf2M+YGZ7uFHijjTEM8w/STRlLw8Y6+QyGYi1myHSM4d6RSO+/s2EMDxvjDf899W9vQ=="], - "@opentui/solid": ["@opentui/solid@0.0.0-20251211-4403a69a", "", { "dependencies": { "@babel/core": "7.28.0", "@babel/preset-typescript": "7.27.1", "@opentui/core": "0.0.0-20251211-4403a69a", "babel-plugin-module-resolver": "5.0.2", "babel-preset-solid": "1.9.9", "s-js": "^0.4.9" }, "peerDependencies": { "solid-js": "1.9.9" } }, "sha512-vuLppAdd1Qgaqhie3q2TuEr+8udjT4d8uVg5arvCe1AUDVs19I8kvadVCfzGUVmtXgFIOEakbiv6AxDq5v9Zig=="], + "@opentui/solid": ["@opentui/solid@0.1.74", "", { "dependencies": { "@babel/core": "7.28.0", "@babel/preset-typescript": "7.27.1", "@opentui/core": "0.1.74", "babel-plugin-module-resolver": "5.0.2", "babel-preset-solid": "1.9.9", "s-js": "^0.4.9" }, "peerDependencies": { "solid-js": "1.9.9" } }, "sha512-Vz82cI8T9YeJjGsVg4ULp6ral4N+xyt1j9A6Tbu3aaQgEKiB74LW03EXREehfjPr1irOFxtKfWPbx5NKH0Upag=="], "@oslojs/asn1": ["@oslojs/asn1@1.0.0", "", { "dependencies": { "@oslojs/binary": "1.0.0" } }, "sha512-zw/wn0sj0j0QKbIXfIlnEcTviaCzYOY3V5rAyjR6YtOByFtJiT574+8p9Wlach0lZH9fddD4yb9laEAIl4vXQA=="], @@ -1286,12 +1354,14 @@ "@petamoriken/float16": ["@petamoriken/float16@3.9.3", "", {}, "sha512-8awtpHXCx/bNpFt4mt2xdkgtgVvKqty8VbjHI/WWWQuEw+KLzFot3f4+LkQY9YmOtq7A5GdOnqoIC8Pdygjk2g=="], - "@pierre/precision-diffs": ["@pierre/precision-diffs@0.6.1", "", { "dependencies": { "@shikijs/core": "3.15.0", "@shikijs/transformers": "3.15.0", "diff": "8.0.2", "fast-deep-equal": "3.1.3", "hast-util-to-html": "9.0.5", "lru_map": "0.4.1", "shiki": "3.15.0" }, "peerDependencies": { "react": "^18.3.1 || ^19.0.0", "react-dom": "^18.3.1 || ^19.0.0" } }, "sha512-HXafRSOly6B0rRt6fuP0yy1MimHJMQ2NNnBGcIHhHwsgK4WWs+SBWRWt1usdgz0NIuSgXdIyQn8HY3F1jKyDBQ=="], + "@pierre/diffs": ["@pierre/diffs@1.0.2", "", { "dependencies": { "@shikijs/core": "^3.0.0", "@shikijs/engine-javascript": "3.19.0", "@shikijs/transformers": "3.19.0", "diff": "8.0.2", "hast-util-to-html": "9.0.5", "lru_map": "0.4.1", "shiki": "3.19.0" }, "peerDependencies": { "react": "^18.3.1 || ^19.0.0", "react-dom": "^18.3.1 || ^19.0.0" } }, "sha512-RkFSDD5X/U+8QjyilPViYGJfmJNWXR17zTL8zw48+DcVC1Ujbh6I1edyuRnFfgRzpft05x2DSCkz2cjoIAxPvQ=="], "@pkgjs/parseargs": ["@pkgjs/parseargs@0.11.0", "", {}, "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg=="], "@planetscale/database": ["@planetscale/database@1.19.0", "", {}, "sha512-Tv4jcFUFAFjOWrGSio49H6R2ijALv0ZzVBfJKIdm+kl9X046Fh4LLawrF9OMsglVbK6ukqMJsUCeucGAFTBcMA=="], + "@playwright/test": ["@playwright/test@1.57.0", "", { "dependencies": { "playwright": "1.57.0" }, "bin": { "playwright": "cli.js" } }, "sha512-6TyEnHgd6SArQO8UO2OMTxshln3QMWBtPGrOCgs3wVEmQmwyuNtB10IZMfmYDE0riwNR1cu4q+pPcxMVtaG3TA=="], + "@poppinss/colors": ["@poppinss/colors@4.1.5", "", { "dependencies": { "kleur": "^4.1.5" } }, "sha512-FvdDqtcRCtz6hThExcFOgW0cWX+xwSMWcRuQe5ZEb2m7cVQOAVZOIMt+/v9RxGiD9/OY16qJBXK4CVKWAPalBw=="], "@poppinss/dumper": ["@poppinss/dumper@0.6.5", "", { "dependencies": { "@poppinss/colors": "^4.1.5", "@sindresorhus/is": "^7.0.2", "supports-color": "^10.0.0" } }, "sha512-NBdYIb90J7LfOI32dOewKI1r7wnkiH6m920puQ3qHUeZkxNkQiFnXVWoE6YtFSv6QOiPPf7ys6i+HWWecDz7sw=="], @@ -1422,13 +1492,13 @@ "@shikijs/core": ["@shikijs/core@3.9.2", "", { "dependencies": { "@shikijs/types": "3.9.2", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4", "hast-util-to-html": "^9.0.5" } }, "sha512-3q/mzmw09B2B6PgFNeiaN8pkNOixWS726IHmJEpjDAcneDPMQmUg2cweT9cWXY4XcyQS3i6mOOUgQz9RRUP6HA=="], - "@shikijs/engine-javascript": ["@shikijs/engine-javascript@3.9.2", "", { "dependencies": { "@shikijs/types": "3.9.2", "@shikijs/vscode-textmate": "^10.0.2", "oniguruma-to-es": "^4.3.3" } }, "sha512-kUTRVKPsB/28H5Ko6qEsyudBiWEDLst+Sfi+hwr59E0GLHV0h8RfgbQU7fdN5Lt9A8R1ulRiZyTvAizkROjwDA=="], + "@shikijs/engine-javascript": ["@shikijs/engine-javascript@3.20.0", "", { "dependencies": { "@shikijs/types": "3.20.0", "@shikijs/vscode-textmate": "^10.0.2", "oniguruma-to-es": "^4.3.4" } }, "sha512-OFx8fHAZuk7I42Z9YAdZ95To6jDePQ9Rnfbw9uSRTSbBhYBp1kEOKv/3jOimcj3VRUKusDYM6DswLauwfhboLg=="], - "@shikijs/engine-oniguruma": ["@shikijs/engine-oniguruma@3.9.2", "", { "dependencies": { "@shikijs/types": "3.9.2", "@shikijs/vscode-textmate": "^10.0.2" } }, "sha512-Vn/w5oyQ6TUgTVDIC/BrpXwIlfK6V6kGWDVVz2eRkF2v13YoENUvaNwxMsQU/t6oCuZKzqp9vqtEtEzKl9VegA=="], + "@shikijs/engine-oniguruma": ["@shikijs/engine-oniguruma@3.20.0", "", { "dependencies": { "@shikijs/types": "3.20.0", "@shikijs/vscode-textmate": "^10.0.2" } }, "sha512-Yx3gy7xLzM0ZOjqoxciHjA7dAt5tyzJE3L4uQoM83agahy+PlW244XJSrmJRSBvGYELDhYXPacD4R/cauV5bzQ=="], - "@shikijs/langs": ["@shikijs/langs@3.9.2", "", { "dependencies": { "@shikijs/types": "3.9.2" } }, "sha512-X1Q6wRRQXY7HqAuX3I8WjMscjeGjqXCg/Sve7J2GWFORXkSrXud23UECqTBIdCSNKJioFtmUGJQNKtlMMZMn0w=="], + "@shikijs/langs": ["@shikijs/langs@3.20.0", "", { "dependencies": { "@shikijs/types": "3.20.0" } }, "sha512-le+bssCxcSHrygCWuOrYJHvjus6zhQ2K7q/0mgjiffRbkhM4o1EWu2m+29l0yEsHDbWaWPNnDUTRVVBvBBeKaA=="], - "@shikijs/themes": ["@shikijs/themes@3.9.2", "", { "dependencies": { "@shikijs/types": "3.9.2" } }, "sha512-6z5lBPBMRfLyyEsgf6uJDHPa6NAGVzFJqH4EAZ+03+7sedYir2yJBRu2uPZOKmj43GyhVHWHvyduLDAwJQfDjA=="], + "@shikijs/themes": ["@shikijs/themes@3.20.0", "", { "dependencies": { "@shikijs/types": "3.20.0" } }, "sha512-U1NSU7Sl26Q7ErRvJUouArxfM2euWqq1xaSrbqMu2iqa+tSp0D1Yah8216sDYbdDHw4C8b75UpE65eWorm2erQ=="], "@shikijs/transformers": ["@shikijs/transformers@3.9.2", "", { "dependencies": { "@shikijs/core": "3.9.2", "@shikijs/types": "3.9.2" } }, "sha512-MW5hT4TyUp6bNAgTExRYLk1NNasVQMTCw1kgbxHcEC0O5cbepPWaB+1k+JzW9r3SP2/R8kiens8/3E6hGKfgsA=="], @@ -1462,7 +1532,7 @@ "@smithy/credential-provider-imds": ["@smithy/credential-provider-imds@4.2.5", "", { "dependencies": { "@smithy/node-config-provider": "^4.3.5", "@smithy/property-provider": "^4.2.5", "@smithy/types": "^4.9.0", "@smithy/url-parser": "^4.2.5", "tslib": "^2.6.2" } }, "sha512-BZwotjoZWn9+36nimwm/OLIcVe+KYRwzMjfhd4QT7QxPm9WY0HiOV8t/Wlh+HVUif0SBVV7ksq8//hPaBC/okQ=="], - "@smithy/eventstream-codec": ["@smithy/eventstream-codec@4.2.5", "", { "dependencies": { "@aws-crypto/crc32": "5.2.0", "@smithy/types": "^4.9.0", "@smithy/util-hex-encoding": "^4.2.0", "tslib": "^2.6.2" } }, "sha512-Ogt4Zi9hEbIP17oQMd68qYOHUzmH47UkK7q7Gl55iIm9oKt27MUGrC5JfpMroeHjdkOliOA4Qt3NQ1xMq/nrlA=="], + "@smithy/eventstream-codec": ["@smithy/eventstream-codec@4.2.7", "", { "dependencies": { "@aws-crypto/crc32": "5.2.0", "@smithy/types": "^4.11.0", "@smithy/util-hex-encoding": "^4.2.0", "tslib": "^2.6.2" } }, "sha512-DrpkEoM3j9cBBWhufqBwnbbn+3nf1N9FP6xuVJ+e220jbactKuQgaZwjwP5CP1t+O94brm2JgVMD2atMGX3xIQ=="], "@smithy/eventstream-serde-browser": ["@smithy/eventstream-serde-browser@4.2.5", "", { "dependencies": { "@smithy/eventstream-serde-universal": "^4.2.5", "@smithy/types": "^4.9.0", "tslib": "^2.6.2" } }, "sha512-HohfmCQZjppVnKX2PnXlf47CW3j92Ki6T/vkAT2DhBR47e89pen3s4fIa7otGTtrVxmj7q+IhH0RnC5kpR8wtw=="], @@ -1552,6 +1622,8 @@ "@smithy/uuid": ["@smithy/uuid@1.1.0", "", { "dependencies": { "tslib": "^2.6.2" } }, "sha512-4aUIteuyxtBUhVdiQqcDhKFitwfd9hqoSDYY2KRXiWtgoWJ9Bmise+KfEPDiVHWeJepvF8xJO9/9+WDIciMFFw=="], + "@socket.io/component-emitter": ["@socket.io/component-emitter@3.1.2", "", {}, "sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA=="], + "@solid-primitives/active-element": ["@solid-primitives/active-element@2.1.3", "", { "dependencies": { "@solid-primitives/event-listener": "^2.4.3", "@solid-primitives/utils": "^6.3.2" }, "peerDependencies": { "solid-js": "^1.6.12" } }, "sha512-9t5K4aR2naVDj950XU8OjnLgOg94a8k5wr6JNOPK+N5ESLsJDq42c1ZP8UKpewi1R+wplMMxiM6OPKRzbxJY7A=="], "@solid-primitives/audio": ["@solid-primitives/audio@1.4.2", "", { "dependencies": { "@solid-primitives/static-store": "^0.1.2", "@solid-primitives/utils": "^6.3.2" }, "peerDependencies": { "solid-js": "^1.6.12" } }, "sha512-UMD3ORQfI5Ky8yuKPxidDiEazsjv/dsoiKK5yZxLnsgaeNR1Aym3/77h/qT1jBYeXUgj4DX6t7NMpFUSVr14OQ=="], @@ -1562,6 +1634,8 @@ "@solid-primitives/event-listener": ["@solid-primitives/event-listener@2.4.3", "", { "dependencies": { "@solid-primitives/utils": "^6.3.2" }, "peerDependencies": { "solid-js": "^1.6.12" } }, "sha512-h4VqkYFv6Gf+L7SQj+Y6puigL/5DIi7x5q07VZET7AWcS+9/G3WfIE9WheniHWJs51OEkRB43w6lDys5YeFceg=="], + "@solid-primitives/i18n": ["@solid-primitives/i18n@2.2.1", "", { "peerDependencies": { "solid-js": "^1.6.12" } }, "sha512-TnTnE2Ku11MGYZ1JzhJ8pYscwg1fr9MteoYxPwsfxWfh9Jp5K7RRJncJn9BhOHvNLwROjqOHZ46PT7sPHqbcXw=="], + "@solid-primitives/keyed": ["@solid-primitives/keyed@1.5.2", "", { "peerDependencies": { "solid-js": "^1.6.12" } }, "sha512-BgoEdqPw48URnI+L5sZIHdF4ua4Las1eWEBBPaoSFs42kkhnHue+rwCBPL2Z9ebOyQ75sUhUfOETdJfmv0D6Kg=="], "@solid-primitives/map": ["@solid-primitives/map@0.4.13", "", { "dependencies": { "@solid-primitives/trigger": "^1.1.0" }, "peerDependencies": { "solid-js": "^1.6.12" } }, "sha512-B1zyFbsiTQvqPr+cuPCXO72sRuczG9Swncqk5P74NCGw1VE8qa/Ry9GlfI1e/VdeQYHjan+XkbE3rO2GW/qKew=="], @@ -1576,6 +1650,8 @@ "@solid-primitives/rootless": ["@solid-primitives/rootless@1.5.2", "", { "dependencies": { "@solid-primitives/utils": "^6.3.2" }, "peerDependencies": { "solid-js": "^1.6.12" } }, "sha512-9HULb0QAzL2r47CCad0M+NKFtQ+LrGGNHZfteX/ThdGvKIg2o2GYhBooZubTCd/RTu2l2+Nw4s+dEfiDGvdrrQ=="], + "@solid-primitives/scheduled": ["@solid-primitives/scheduled@1.5.2", "", { "peerDependencies": { "solid-js": "^1.6.12" } }, "sha512-/j2igE0xyNaHhj6kMfcUQn5rAVSTLbAX+CDEBm25hSNBmNiHLu2lM7Usj2kJJ5j36D67bE8wR1hBNA8hjtvsQA=="], + "@solid-primitives/scroll": ["@solid-primitives/scroll@2.1.3", "", { "dependencies": { "@solid-primitives/event-listener": "^2.4.3", "@solid-primitives/rootless": "^1.5.2", "@solid-primitives/static-store": "^0.1.2" }, "peerDependencies": { "solid-js": "^1.6.12" } }, "sha512-Ejq/Z7zKo/6eIEFr1bFLzXFxiGBCMLuqCM8QB8urr3YdPzjSETFLzYRWUyRiDWaBQN0F7k0SY6S7ig5nWOP7vg=="], "@solid-primitives/static-store": ["@solid-primitives/static-store@0.1.2", "", { "dependencies": { "@solid-primitives/utils": "^6.3.2" }, "peerDependencies": { "solid-js": "^1.6.12" } }, "sha512-ReK+5O38lJ7fT+L6mUFvUr6igFwHBESZF+2Ug842s7fvlVeBdIVEdTCErygff6w7uR6+jrr7J8jQo+cYrEq4Iw=="], @@ -1602,6 +1678,8 @@ "@standard-schema/spec": ["@standard-schema/spec@1.0.0", "", {}, "sha512-m2bOd0f2RT9k8QJx1JN85cZYyH1RqFBdlwtkSlf4tBDYLCiiZnv1fIIwacK6cqwXavOydf0NPToMQgpKq+dVlA=="], + "@stripe/stripe-js": ["@stripe/stripe-js@8.6.1", "", {}, "sha512-UJ05U2062XDgydbUcETH1AoRQLNhigQ2KmDn1BG8sC3xfzu6JKg95Qt6YozdzFpxl1Npii/02m2LEWFt1RYjVA=="], + "@swc/helpers": ["@swc/helpers@0.5.17", "", { "dependencies": { "tslib": "^2.8.0" } }, "sha512-5IKx/Y13RsYd+sauPb2x+U/xZikHjolzfuDgTAl/Tdf3Q8rslRvC19NKDLgAJQ6wsqADk10ntlv08nPFw/gO/A=="], "@tailwindcss/node": ["@tailwindcss/node@4.1.11", "", { "dependencies": { "@ampproject/remapping": "^2.3.0", "enhanced-resolve": "^5.18.1", "jiti": "^2.4.2", "lightningcss": "1.30.1", "magic-string": "^0.30.17", "source-map-js": "^1.2.1", "tailwindcss": "4.1.11" } }, "sha512-yzhzuGRmv5QyU9qLNg4GTlYI6STedBWRE7NjxP45CsFYYq9taI0zJXZBMqIC/c8fViNLhmrbpSFS57EoxUmD6Q=="], @@ -1668,6 +1746,10 @@ "@tauri-apps/plugin-dialog": ["@tauri-apps/plugin-dialog@2.4.2", "", { "dependencies": { "@tauri-apps/api": "^2.8.0" } }, "sha512-lNIn5CZuw8WZOn8zHzmFmDSzg5zfohWoa3mdULP0YFh/VogVdMVWZPcWSHlydsiJhRQYaTNSYKN7RmZKE2lCYQ=="], + "@tauri-apps/plugin-http": ["@tauri-apps/plugin-http@2.5.4", "", { "dependencies": { "@tauri-apps/api": "^2.8.0" } }, "sha512-/i4U/9za3mrytTgfRn5RHneKubZE/dwRmshYwyMvNRlkWjvu1m4Ma72kcbVJMZFGXpkbl+qLyWMGrihtWB76Zg=="], + + "@tauri-apps/plugin-notification": ["@tauri-apps/plugin-notification@2.3.3", "", { "dependencies": { "@tauri-apps/api": "^2.8.0" } }, "sha512-Zw+ZH18RJb41G4NrfHgIuofJiymusqN+q8fGUIIV7vyCH+5sSn5coqRv/MWB9qETsUs97vmU045q7OyseCV3Qg=="], + "@tauri-apps/plugin-opener": ["@tauri-apps/plugin-opener@2.5.2", "", { "dependencies": { "@tauri-apps/api": "^2.8.0" } }, "sha512-ei/yRRoCklWHImwpCcDK3VhNXx+QXM9793aQ64YxpqVF0BDuuIlXhZgiAkc15wnPVav+IbkYhmDJIv5R326Mew=="], "@tauri-apps/plugin-os": ["@tauri-apps/plugin-os@2.3.2", "", { "dependencies": { "@tauri-apps/api": "^2.8.0" } }, "sha512-n+nXWeuSeF9wcEsSPmRnBEGrRgOy6jjkSU+UVCOV8YUGKb2erhDOxis7IqRXiRVHhY8XMKks00BJ0OAdkpf6+A=="], @@ -1704,7 +1786,7 @@ "@types/braces": ["@types/braces@3.0.5", "", {}, "sha512-SQFof9H+LXeWNz8wDe7oN5zu7ket0qwMu5vZubW4GCJ8Kkeh6nBWUz87+KTz/G3Kqsrp0j/W253XJb3KMEeg3w=="], - "@types/bun": ["@types/bun@1.3.4", "", { "dependencies": { "bun-types": "1.3.4" } }, "sha512-EEPTKXHP+zKGPkhRLv+HI0UEX8/o+65hqARxLy8Ov5rIxMBPNTjeZww00CIihrIQGEQBYg+0roO5qOnS/7boGA=="], + "@types/bun": ["@types/bun@1.3.5", "", { "dependencies": { "bun-types": "1.3.5" } }, "sha512-RnygCqNrd3srIPEWBd5LFeUYG7plCoH2Yw9WaZGyNmdTEei+gWaHqydbaIRkIkcbXwhBT94q78QljxN0Sk838w=="], "@types/chai": ["@types/chai@5.2.3", "", { "dependencies": { "@types/deep-eql": "*", "assertion-error": "^2.0.1" } }, "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA=="], @@ -1736,6 +1818,8 @@ "@types/jsonwebtoken": ["@types/jsonwebtoken@8.5.9", "", { "dependencies": { "@types/node": "*" } }, "sha512-272FMnFGzAVMGtu9tkr29hRL6bZj4Zs1KZNeHLnKqAvp06tAIcarTMwOh8/8bz4FmKRcMxZhZNeUAQsNLoiPhg=="], + "@types/katex": ["@types/katex@0.16.7", "", {}, "sha512-HMwFiRujE5PjrgwHQ25+bsLJgowjGjm5Z8FVSf0N6PwgJrwxH0QxzHYDcKsTfV3wva0vzrpqMTJS2jXPr5BMEQ=="], + "@types/luxon": ["@types/luxon@3.7.1", "", {}, "sha512-H3iskjFIAn5SlJU7OuxUmTEpebK6TKB8rxZShDslBMZJ5u9S//KM1sbdAisiSrqwLQncVjnpi2OK2J51h+4lsg=="], "@types/mdast": ["@types/mdast@4.0.4", "", { "dependencies": { "@types/unist": "*" } }, "sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA=="], @@ -1774,6 +1858,8 @@ "@types/serve-static": ["@types/serve-static@1.15.10", "", { "dependencies": { "@types/http-errors": "*", "@types/node": "*", "@types/send": "<1" } }, "sha512-tRs1dB+g8Itk72rlSI2ZrW6vZg0YrLI81iQSTkMmOqnqCaNr/8Ek4VwWcN5vZgCYWbg/JJSGBlUaYGAOP73qBw=="], + "@types/trusted-types": ["@types/trusted-types@2.0.7", "", {}, "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw=="], + "@types/tsscmp": ["@types/tsscmp@1.0.2", "", {}, "sha512-cy7BRSU8GYYgxjcx0Py+8lo5MthuDhlyu076KUcYzVNXL23luYgRHkMG2fIFEc6neckeh/ntP82mw+U4QjZq+g=="], "@types/tunnel": ["@types/tunnel@0.0.3", "", { "dependencies": { "@types/node": "*" } }, "sha512-sOUTGn6h1SfQ+gbgqC364jLFBw2lnFqkgF3q0WovEHRLMrVD1sd5aufqi/aJObLekJO+Aq5z646U4Oxy6shXMA=="], @@ -1816,21 +1902,21 @@ "@vitejs/plugin-react": ["@vitejs/plugin-react@4.7.0", "", { "dependencies": { "@babel/core": "^7.28.0", "@babel/plugin-transform-react-jsx-self": "^7.27.1", "@babel/plugin-transform-react-jsx-source": "^7.27.1", "@rolldown/pluginutils": "1.0.0-beta.27", "@types/babel__core": "^7.20.5", "react-refresh": "^0.17.0" }, "peerDependencies": { "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0" } }, "sha512-gUu9hwfWvvEDBBmgtAowQCojwZmJ5mcLn3aufeCsitijs3+f2NsrPtlAWIR6OPiqljl96GVCUbLe0HyqIpVaoA=="], - "@vitest/expect": ["@vitest/expect@4.0.13", "", { "dependencies": { "@standard-schema/spec": "^1.0.0", "@types/chai": "^5.2.2", "@vitest/spy": "4.0.13", "@vitest/utils": "4.0.13", "chai": "^6.2.1", "tinyrainbow": "^3.0.3" } }, "sha512-zYtcnNIBm6yS7Gpr7nFTmq8ncowlMdOJkWLqYvhr/zweY6tFbDkDi8BPPOeHxEtK1rSI69H7Fd4+1sqvEGli6w=="], + "@vitest/expect": ["@vitest/expect@4.0.16", "", { "dependencies": { "@standard-schema/spec": "^1.0.0", "@types/chai": "^5.2.2", "@vitest/spy": "4.0.16", "@vitest/utils": "4.0.16", "chai": "^6.2.1", "tinyrainbow": "^3.0.3" } }, "sha512-eshqULT2It7McaJkQGLkPjPjNph+uevROGuIMJdG3V+0BSR2w9u6J9Lwu+E8cK5TETlfou8GRijhafIMhXsimA=="], - "@vitest/mocker": ["@vitest/mocker@4.0.13", "", { "dependencies": { "@vitest/spy": "4.0.13", "estree-walker": "^3.0.3", "magic-string": "^0.30.21" }, "peerDependencies": { "msw": "^2.4.9", "vite": "^6.0.0 || ^7.0.0-0" }, "optionalPeers": ["msw", "vite"] }, "sha512-eNCwzrI5djoauklwP1fuslHBjrbR8rqIVbvNlAnkq1OTa6XT+lX68mrtPirNM9TnR69XUPt4puBCx2Wexseylg=="], + "@vitest/mocker": ["@vitest/mocker@4.0.16", "", { "dependencies": { "@vitest/spy": "4.0.16", "estree-walker": "^3.0.3", "magic-string": "^0.30.21" }, "peerDependencies": { "msw": "^2.4.9", "vite": "^6.0.0 || ^7.0.0-0" }, "optionalPeers": ["msw", "vite"] }, "sha512-yb6k4AZxJTB+q9ycAvsoxGn+j/po0UaPgajllBgt1PzoMAAmJGYFdDk0uCcRcxb3BrME34I6u8gHZTQlkqSZpg=="], - "@vitest/pretty-format": ["@vitest/pretty-format@4.0.13", "", { "dependencies": { "tinyrainbow": "^3.0.3" } }, "sha512-ooqfze8URWbI2ozOeLDMh8YZxWDpGXoeY3VOgcDnsUxN0jPyPWSUvjPQWqDGCBks+opWlN1E4oP1UYl3C/2EQA=="], + "@vitest/pretty-format": ["@vitest/pretty-format@4.0.16", "", { "dependencies": { "tinyrainbow": "^3.0.3" } }, "sha512-eNCYNsSty9xJKi/UdVD8Ou16alu7AYiS2fCPRs0b1OdhJiV89buAXQLpTbe+X8V9L6qrs9CqyvU7OaAopJYPsA=="], - "@vitest/runner": ["@vitest/runner@4.0.13", "", { "dependencies": { "@vitest/utils": "4.0.13", "pathe": "^2.0.3" } }, "sha512-9IKlAru58wcVaWy7hz6qWPb2QzJTKt+IOVKjAx5vb5rzEFPTL6H4/R9BMvjZ2ppkxKgTrFONEJFtzvnyEpiT+A=="], + "@vitest/runner": ["@vitest/runner@4.0.16", "", { "dependencies": { "@vitest/utils": "4.0.16", "pathe": "^2.0.3" } }, "sha512-VWEDm5Wv9xEo80ctjORcTQRJ539EGPB3Pb9ApvVRAY1U/WkHXmmYISqU5E79uCwcW7xYUV38gwZD+RV755fu3Q=="], - "@vitest/snapshot": ["@vitest/snapshot@4.0.13", "", { "dependencies": { "@vitest/pretty-format": "4.0.13", "magic-string": "^0.30.21", "pathe": "^2.0.3" } }, "sha512-hb7Usvyika1huG6G6l191qu1urNPsq1iFc2hmdzQY3F5/rTgqQnwwplyf8zoYHkpt7H6rw5UfIw6i/3qf9oSxQ=="], + "@vitest/snapshot": ["@vitest/snapshot@4.0.16", "", { "dependencies": { "@vitest/pretty-format": "4.0.16", "magic-string": "^0.30.21", "pathe": "^2.0.3" } }, "sha512-sf6NcrYhYBsSYefxnry+DR8n3UV4xWZwWxYbCJUt2YdvtqzSPR7VfGrY0zsv090DAbjFZsi7ZaMi1KnSRyK1XA=="], - "@vitest/spy": ["@vitest/spy@4.0.13", "", {}, "sha512-hSu+m4se0lDV5yVIcNWqjuncrmBgwaXa2utFLIrBkQCQkt+pSwyZTPFQAZiiF/63j8jYa8uAeUZ3RSfcdWaYWw=="], + "@vitest/spy": ["@vitest/spy@4.0.16", "", {}, "sha512-4jIOWjKP0ZUaEmJm00E0cOBLU+5WE0BpeNr3XN6TEF05ltro6NJqHWxXD0kA8/Zc8Nh23AT8WQxwNG+WeROupw=="], - "@vitest/utils": ["@vitest/utils@4.0.13", "", { "dependencies": { "@vitest/pretty-format": "4.0.13", "tinyrainbow": "^3.0.3" } }, "sha512-ydozWyQ4LZuu8rLp47xFUWis5VOKMdHjXCWhs1LuJsTNKww+pTHQNK4e0assIB9K80TxFyskENL6vCu3j34EYA=="], + "@vitest/utils": ["@vitest/utils@4.0.16", "", { "dependencies": { "@vitest/pretty-format": "4.0.16", "tinyrainbow": "^3.0.3" } }, "sha512-h8z9yYhV3e1LEfaQ3zdypIrnAg/9hguReGZoS7Gl0aBG5xgA410zBqECqmaF/+RkTggRsfnzc1XaAHA6bmUufA=="], - "@webgpu/types": ["@webgpu/types@0.1.66", "", {}, "sha512-YA2hLrwLpDsRueNDXIMqN9NTzD6bCDkuXbOSe0heS+f8YE8usA6Gbv1prj81pzVHrbaAma7zObnIC+I6/sXJgA=="], + "@webgpu/types": ["@webgpu/types@0.1.54", "", {}, "sha512-81oaalC8LFrXjhsczomEQ0u3jG+TqE6V9QHLA8GNZq/Rnot0KDugu3LhSYSlie8tSdooAN1Hov05asrUUp9qgg=="], "@zip.js/zip.js": ["@zip.js/zip.js@2.7.62", "", {}, "sha512-OaLvZ8j4gCkLn048ypkZu29KX30r8/OfFF2w4Jo5WXFr+J04J+lzJ5TKZBVgFXhlvSkqNFQdfnY1Q8TMTCyBVA=="], @@ -1850,9 +1936,11 @@ "agentkeepalive": ["agentkeepalive@4.6.0", "", { "dependencies": { "humanize-ms": "^1.2.1" } }, "sha512-kja8j7PjmncONqaTsB8fQ+wE2mSU2DJ9D4XKoJ5PFWIdRMa6SLSN1ff4mOr4jCbfRSsxR4keIiySJU0N9T5hIQ=="], - "ai": ["ai@5.0.97", "", { "dependencies": { "@ai-sdk/gateway": "2.0.12", "@ai-sdk/provider": "2.0.0", "@ai-sdk/provider-utils": "3.0.17", "@opentelemetry/api": "1.9.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-8zBx0b/owis4eJI2tAlV8a1Rv0BANmLxontcAelkLNwEHhgfgXeKpDkhNB6OgV+BJSwboIUDkgd9312DdJnCOQ=="], + "ai": ["ai@5.0.119", "", { "dependencies": { "@ai-sdk/gateway": "2.0.25", "@ai-sdk/provider": "2.0.1", "@ai-sdk/provider-utils": "3.0.20", "@opentelemetry/api": "1.9.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-HUOwhc17fl2SZTJGZyA/99aNu706qKfXaUBCy9vgZiXBwrxg2eTzn2BCz7kmYDsfx6Fg2ACBy2icm41bsDXCTw=="], + + "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=="], - "ajv": ["ajv@6.12.6", "", { "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", "json-schema-traverse": "^0.4.1", "uri-js": "^4.2.2" } }, "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g=="], + "ajv-formats": ["ajv-formats@3.0.1", "", { "dependencies": { "ajv": "^8.0.0" } }, "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ=="], "ansi-align": ["ansi-align@3.0.1", "", { "dependencies": { "string-width": "^4.1.0" } }, "sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w=="], @@ -1942,16 +2030,6 @@ "bare-events": ["bare-events@2.8.2", "", { "peerDependencies": { "bare-abort-controller": "*" }, "optionalPeers": ["bare-abort-controller"] }, "sha512-riJjyv1/mHLIPX4RwiK+oW9/4c3TEUeORHKefKAKnZ5kyslbN+HXowtbaVEqt4IMUB7OXlfixcs6gsFeo/jhiQ=="], - "bare-fs": ["bare-fs@4.5.1", "", { "dependencies": { "bare-events": "^2.5.4", "bare-path": "^3.0.0", "bare-stream": "^2.6.4", "bare-url": "^2.2.2", "fast-fifo": "^1.3.2" }, "peerDependencies": { "bare-buffer": "*" }, "optionalPeers": ["bare-buffer"] }, "sha512-zGUCsm3yv/ePt2PHNbVxjjn0nNB1MkIaR4wOCxJ2ig5pCf5cCVAYJXVhQg/3OhhJV6DB1ts7Hv0oUaElc2TPQg=="], - - "bare-os": ["bare-os@3.6.2", "", {}, "sha512-T+V1+1srU2qYNBmJCXZkUY5vQ0B4FSlL3QDROnKQYOqeiQR8UbjNHlPa+TIbM4cuidiN9GaTaOZgSEgsvPbh5A=="], - - "bare-path": ["bare-path@3.0.0", "", { "dependencies": { "bare-os": "^3.0.1" } }, "sha512-tyfW2cQcB5NN8Saijrhqn0Zh7AnFNsnczRcuWODH0eYAXBsJ5gVxAUuNr7tsHSC6IZ77cA0SitzT+s47kot8Mw=="], - - "bare-stream": ["bare-stream@2.7.0", "", { "dependencies": { "streamx": "^2.21.0" }, "peerDependencies": { "bare-buffer": "*", "bare-events": "*" }, "optionalPeers": ["bare-buffer", "bare-events"] }, "sha512-oyXQNicV1y8nc2aKffH+BUHFRXmx6VrPzlnaEvMhram0nPBrKcEdcyBg5r08D0i8VxngHFAiVyn1QKXpSG0B8A=="], - - "bare-url": ["bare-url@2.3.2", "", { "dependencies": { "bare-path": "^3.0.0" } }, "sha512-ZMq4gd9ngV5aTMa5p9+UfY0b3skwhHELaDkhEHetMdX0LRkW9kzaym4oo/Eh+Ghm0CCDuMTsRIGM/ytUc1ZYmw=="], - "base-64": ["base-64@1.0.0", "", {}, "sha512-kwDPIFCGx0NZHog36dj+tHiwP4QMzsZ3AgMViUBKI0+V5n4U0ufTCUMhnQ04diaRI8EX/QcPfql7zlhZ7j4zgg=="], "base64-js": ["base64-js@1.5.1", "", {}, "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA=="], @@ -1962,7 +2040,7 @@ "bcp-47-match": ["bcp-47-match@2.0.3", "", {}, "sha512-JtTezzbAibu8G0R9op9zb3vcWZd9JF6M0xOYGPn0fNCd7wOpRB1mU2mH9T8gaBGbAAyIIVgB2G7xG0GP98zMAQ=="], - "before-after-hook": ["before-after-hook@4.0.0", "", {}, "sha512-q6tR3RPqIB1pMiTRMFcZwuG5T8vwp+vUvEG0vuI6B+Rikh5BfPp2fQ82c925FOs+b0lcFQ8CFrL+KbilfZFhOQ=="], + "before-after-hook": ["before-after-hook@2.2.3", "", {}, "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ=="], "bignumber.js": ["bignumber.js@9.3.1", "", {}, "sha512-Ko0uX15oIUS7wJ3Rb30Fs6SkVbLmPBAKdlm7q9+ak9bbIeFf0MwuBsQV6z7+X768/cHsfg+WlysDWJcmthjsjQ=="], @@ -1970,8 +2048,6 @@ "binary-extensions": ["binary-extensions@2.3.0", "", {}, "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw=="], - "bl": ["bl@4.1.0", "", { "dependencies": { "buffer": "^5.5.0", "inherits": "^2.0.4", "readable-stream": "^3.4.0" } }, "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w=="], - "blake3-wasm": ["blake3-wasm@2.1.5", "", {}, "sha512-F1+K8EbfOZE49dtoPtmxUQrpXaBIl3ICvasLh+nJta0xkz+9kF/7uet9fLnwKqhDrmj6g+6K3Tw9yQPUg2ka5g=="], "blob-to-buffer": ["blob-to-buffer@1.2.9", "", {}, "sha512-BF033y5fN6OCofD3vgHmNtwZWRcq9NLyyxyILx9hfMy1sXYy4ojFl765hJ2lP0YaN2fuxPaLO2Vzzoxy0FLFFA=="], @@ -1980,6 +2056,8 @@ "body-parser": ["body-parser@1.20.3", "", { "dependencies": { "bytes": "3.1.2", "content-type": "~1.0.5", "debug": "2.6.9", "depd": "2.0.0", "destroy": "1.2.0", "http-errors": "2.0.0", "iconv-lite": "0.4.24", "on-finished": "2.4.1", "qs": "6.13.0", "raw-body": "2.5.2", "type-is": "~1.6.18", "unpipe": "1.0.0" } }, "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g=="], + "bonjour-service": ["bonjour-service@1.3.0", "", { "dependencies": { "fast-deep-equal": "^3.1.3", "multicast-dns": "^7.2.5" } }, "sha512-3YuAUiSkWykd+2Azjgyxei8OWf8thdn8AITIog2M4UICzoqfjlqr64WIjEXZllf/W6vK1goqleSR6brGomxQqA=="], + "boolbase": ["boolbase@1.0.0", "", {}, "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww=="], "bottleneck": ["bottleneck@2.19.5", "", {}, "sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw=="], @@ -2008,9 +2086,9 @@ "bun-ffi-structs": ["bun-ffi-structs@0.1.2", "", { "peerDependencies": { "typescript": "^5" } }, "sha512-Lh1oQAYHDcnesJauieA4UNkWGXY9hYck7OA5IaRwE3Bp6K2F2pJSNYqq+hIy7P3uOvo3km3oxS8304g5gDMl/w=="], - "bun-pty": ["bun-pty@0.4.2", "", {}, "sha512-sHImDz6pJDsHAroYpC9ouKVgOyqZ7FP3N+stX5IdMddHve3rf9LIZBDomQcXrACQ7sQDNuwZQHG8BKR7w8krkQ=="], + "bun-pty": ["bun-pty@0.4.4", "", {}, "sha512-WK4G6uWsZgu1v4hKIlw6G1q2AOf8Rbga2Yr7RnxArVjjyb+mtVa/CFc9GOJf+OYSJSH8k7LonAtQOVeNAddRyg=="], - "bun-types": ["bun-types@1.3.4", "", { "dependencies": { "@types/node": "*" } }, "sha512-5ua817+BZPZOlNaRgGBpZJOSAQ9RQ17pkwPD0yR7CfJg+r8DgIILByFifDTa+IPDDxzf5VNhtNlcKqFzDgJvlQ=="], + "bun-types": ["bun-types@1.3.5", "", { "dependencies": { "@types/node": "*" } }, "sha512-inmAYe2PFLs0SUbFOWSVD24sg1jFlMPxOjOSSCYqUgn4Hsc3rDc7dFvfVYjFPNHtov6kgUeulV4SxbuIV/stPw=="], "bun-webgpu": ["bun-webgpu@0.1.4", "", { "dependencies": { "@webgpu/types": "^0.1.60" }, "optionalDependencies": { "bun-webgpu-darwin-arm64": "^0.1.4", "bun-webgpu-darwin-x64": "^0.1.4", "bun-webgpu-linux-x64": "^0.1.4", "bun-webgpu-win32-x64": "^0.1.4" } }, "sha512-Kw+HoXl1PMWJTh9wvh63SSRofTA8vYBFCw0XEP1V1fFdQEDhI8Sgf73sdndE/oDpN/7CMx0Yv/q8FCvO39ROMQ=="], @@ -2026,7 +2104,7 @@ "bytes": ["bytes@3.1.2", "", {}, "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg=="], - "c12": ["c12@3.3.2", "", { "dependencies": { "chokidar": "^4.0.3", "confbox": "^0.2.2", "defu": "^6.1.4", "dotenv": "^17.2.3", "exsolve": "^1.0.8", "giget": "^2.0.0", "jiti": "^2.6.1", "ohash": "^2.0.11", "pathe": "^2.0.3", "perfect-debounce": "^2.0.0", "pkg-types": "^2.3.0", "rc9": "^2.1.2" }, "peerDependencies": { "magicast": "*" }, "optionalPeers": ["magicast"] }, "sha512-QkikB2X5voO1okL3QsES0N690Sn/K9WokXqUsDQsWy5SnYb+psYQFGA10iy1bZHj3fjISKsI67Q90gruvWWM3A=="], + "c12": ["c12@3.3.3", "", { "dependencies": { "chokidar": "^5.0.0", "confbox": "^0.2.2", "defu": "^6.1.4", "dotenv": "^17.2.3", "exsolve": "^1.0.8", "giget": "^2.0.0", "jiti": "^2.6.1", "ohash": "^2.0.11", "pathe": "^2.0.3", "perfect-debounce": "^2.0.0", "pkg-types": "^2.3.0", "rc9": "^2.1.2" }, "peerDependencies": { "magicast": "*" }, "optionalPeers": ["magicast"] }, "sha512-750hTRvgBy5kcMNPdh95Qo+XUBeGo8C7nsKSmedDmaQI+E0r82DwHeM6vBewDe4rGFbnxoa4V9pw+sPh5+Iz8Q=="], "call-bind": ["call-bind@1.0.8", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.0", "es-define-property": "^1.0.0", "get-intrinsic": "^1.2.4", "set-function-length": "^1.2.2" } }, "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww=="], @@ -2048,7 +2126,7 @@ "chainsaw": ["chainsaw@0.1.0", "", { "dependencies": { "traverse": ">=0.3.0 <0.4" } }, "sha512-75kWfWt6MEKNC8xYXIdRpDehRYY/tNSgwKaJq+dbbDcxORuVrrQ+SEHoWsniVn9XPYfP4gmdWIeDk/4YNp1rNQ=="], - "chalk": ["chalk@4.1.2", "", { "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA=="], + "chalk": ["chalk@5.6.2", "", {}, "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA=="], "character-entities": ["character-entities@2.0.2", "", {}, "sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ=="], @@ -2160,6 +2238,8 @@ "csstype": ["csstype@3.2.3", "", {}, "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ=="], + "data-uri-to-buffer": ["data-uri-to-buffer@4.0.1", "", {}, "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A=="], + "data-view-buffer": ["data-view-buffer@1.0.2", "", { "dependencies": { "call-bound": "^1.0.3", "es-errors": "^1.3.0", "is-data-view": "^1.0.2" } }, "sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ=="], "data-view-byte-length": ["data-view-byte-length@1.0.2", "", { "dependencies": { "call-bound": "^1.0.3", "es-errors": "^1.3.0", "is-data-view": "^1.0.2" } }, "sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ=="], @@ -2174,10 +2254,6 @@ "decode-named-character-reference": ["decode-named-character-reference@1.2.0", "", { "dependencies": { "character-entities": "^2.0.0" } }, "sha512-c6fcElNV6ShtZXmsgNgFFV5tVX2PaV4g+MOAkb8eXHvn6sryJBrZa9r0zV6+dtTyoCKxtDy5tyQ5ZwQuidtd+Q=="], - "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=="], - "deepmerge": ["deepmerge@4.3.1", "", {}, "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A=="], "default-browser": ["default-browser@5.4.0", "", { "dependencies": { "bundle-name": "^4.1.0", "default-browser-id": "^5.0.0" } }, "sha512-XDuvSq38Hr1MdN47EDvYtx3U0MTqpCEn+F6ft8z2vYDzMrvQhVp0ui9oQdqW3MvK3vqUETglt1tVGgjLuJ5izg=="], @@ -2206,7 +2282,7 @@ "destroy": ["destroy@1.2.0", "", {}, "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg=="], - "detect-libc": ["detect-libc@2.1.2", "", {}, "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ=="], + "detect-libc": ["detect-libc@1.0.3", "", { "bin": { "detect-libc": "./bin/detect-libc.js" } }, "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg=="], "detect-node-es": ["detect-node-es@1.1.0", "", {}, "sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ=="], @@ -2228,12 +2304,16 @@ "dlv": ["dlv@1.1.3", "", {}, "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA=="], + "dns-packet": ["dns-packet@5.6.1", "", { "dependencies": { "@leichtgewicht/ip-codec": "^2.0.1" } }, "sha512-l4gcSouhcgIKRvyy99RNVOgxXiicE+2jZoNmaNmZ6JXiGajBOJAesk1OBlJuM5k2c+eudGdLxDqXuPCKIj6kpw=="], + "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=="], + "dompurify": ["dompurify@3.3.1", "", { "optionalDependencies": { "@types/trusted-types": "^2.0.7" } }, "sha512-qkdCKzLNtrgPFP1Vo+98FRzJnBRGe4ffyCea9IwHB1fyxPOeNTHpLKYGd4Uk9xvNoH0ZoOjwZxNptyMwqrId1Q=="], + "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=="], "dot-case": ["dot-case@3.0.4", "", { "dependencies": { "no-case": "^3.0.4", "tslib": "^2.0.3" } }, "sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w=="], @@ -2266,7 +2346,9 @@ "encodeurl": ["encodeurl@2.0.0", "", {}, "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg=="], - "end-of-stream": ["end-of-stream@1.4.5", "", { "dependencies": { "once": "^1.4.0" } }, "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg=="], + "engine.io-client": ["engine.io-client@6.6.4", "", { "dependencies": { "@socket.io/component-emitter": "~3.1.0", "debug": "~4.4.1", "engine.io-parser": "~5.2.1", "ws": "~8.18.3", "xmlhttprequest-ssl": "~2.1.1" } }, "sha512-+kjUJnZGwzewFDw951CDWcwj35vMNf2fcj7xQWOctq1F2i1jkDdVvdFG9kM/BEChymCH36KgjnW0NsL58JYRxw=="], + + "engine.io-parser": ["engine.io-parser@5.2.3", "", {}, "sha512-HqD3yTBfnBxIrbnM1DoD6Pcq8NECnh8d4As1Qgh0z5Gg3jRRIqijury0CL3ghu/edArpUYiYqQiDUQBIs4np3Q=="], "enhanced-resolve": ["enhanced-resolve@5.18.3", "", { "dependencies": { "graceful-fs": "^4.2.4", "tapable": "^2.2.0" } }, "sha512-d4lC8xfavMeBjzGr2vECC3fsGXziXZQyJxD868h2M/mBI3PwAuODxAkLkq5HYuvrPYcUtiLzsTo8U3PgX3Ocww=="], @@ -2334,7 +2416,7 @@ "eventemitter3": ["eventemitter3@5.0.1", "", {}, "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA=="], - "events": ["events@1.1.1", "", {}, "sha512-kEcvvCBByWXGnZy6JUlgAp2gBIUjfCAV6P6TgT1/aaQKcmuAEC4OZTV1I4EWQLz2gxZw76atuVyvHhTxvi0Flw=="], + "events": ["events@3.3.0", "", {}, "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q=="], "events-universal": ["events-universal@1.0.1", "", { "dependencies": { "bare-events": "^2.7.0" } }, "sha512-LUd5euvbMLpwOF8m6ivPCbhQeSiYVNb8Vs0fQ8QjXo0JTkEHpz8pxdQf0gStltaPpw0Cca8b39KxvK9cfKRiAw=="], @@ -2348,9 +2430,7 @@ "exit-hook": ["exit-hook@2.2.1", "", {}, "sha512-eNTPlAD67BmP31LDINZ3U7HSF8l57TxOY2PmBJ1shpCvpnxBF93mWCE8YHBnXs8qiUZJc9WDcWIeC3a2HIAMfw=="], - "expand-template": ["expand-template@2.0.3", "", {}, "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg=="], - - "expect-type": ["expect-type@1.2.2", "", {}, "sha512-JhFGDVJ7tmDJItKhYgJCGLOWjuK9vPxiXoUFLwLDc99NlmklilbiQJwoctZtt13+xMw91MCk/REan6MWHqDjyA=="], + "expect-type": ["expect-type@1.3.0", "", {}, "sha512-knvyeauYhqjOYvQ66MznSMs83wmHrCycNEN6Ao+2AeYEfxUIkuiVxdEa1qlGEPK+We3n0THiDciYSsCcgW/DoA=="], "express": ["express@4.21.2", "", { "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", "body-parser": "1.20.3", "content-disposition": "0.5.4", "content-type": "~1.0.4", "cookie": "0.7.1", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "etag": "~1.8.1", "finalhandler": "1.3.1", "fresh": "0.5.2", "http-errors": "2.0.0", "merge-descriptors": "1.0.3", "methods": "~1.1.2", "on-finished": "2.4.1", "parseurl": "~1.3.3", "path-to-regexp": "0.1.12", "proxy-addr": "~2.0.7", "qs": "6.13.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", "send": "0.19.0", "serve-static": "1.16.2", "setprototypeof": "1.2.0", "statuses": "2.0.1", "type-is": "~1.6.18", "utils-merge": "1.0.1", "vary": "~1.1.2" } }, "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA=="], @@ -2372,7 +2452,7 @@ "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-json-stable-stringify": ["fast-json-stable-stringify@2.1.0", "", {}, "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw=="], + "fast-uri": ["fast-uri@3.1.0", "", {}, "sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA=="], "fast-xml-parser": ["fast-xml-parser@4.4.1", "", { "dependencies": { "strnum": "^1.0.5" }, "bin": { "fxparser": "src/cli/cli.js" } }, "sha512-xkjOecfnKGkSsOwtZ5Pz7Us/T6mrbPQrq0nh+aCO5V9nk5NLWmasAHumTKjiPJPWANe+kAZ84Jc8ooJkzZ88Sw=="], @@ -2380,6 +2460,8 @@ "fdir": ["fdir@6.5.0", "", { "peerDependencies": { "picomatch": "^3 || ^4" }, "optionalPeers": ["picomatch"] }, "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg=="], + "fetch-blob": ["fetch-blob@3.2.0", "", { "dependencies": { "node-domexception": "^1.0.0", "web-streams-polyfill": "^3.0.3" } }, "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ=="], + "file-type": ["file-type@16.5.4", "", { "dependencies": { "readable-web-to-node-stream": "^3.0.0", "strtok3": "^6.2.4", "token-types": "^4.1.1" } }, "sha512-/yFHK0aGjFEgDJjEKP0pWCplsPFPhwyfwevf/pVxiN0tmE4L9LmwWxWukdJSHdoCli4VgQLehjJtwQBnqmsKcw=="], "fill-range": ["fill-range@7.1.1", "", { "dependencies": { "to-regex-range": "^5.0.1" } }, "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg=="], @@ -2410,6 +2492,8 @@ "formdata-node": ["formdata-node@4.4.1", "", { "dependencies": { "node-domexception": "1.0.0", "web-streams-polyfill": "4.0.0-beta.3" } }, "sha512-0iirZp3uVDjVGt9p49aTaqjk84TrglENEDuqfdlZQ1roC9CWlPk6Avf8EEnZNcAqPonwkG35x4n3ww/1THYAeQ=="], + "formdata-polyfill": ["formdata-polyfill@4.0.10", "", { "dependencies": { "fetch-blob": "^3.1.2" } }, "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g=="], + "forwarded": ["forwarded@0.2.0", "", {}, "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow=="], "fraction.js": ["fraction.js@5.3.4", "", {}, "sha512-1X1NTtiJphryn/uLQz3whtY6jK3fTqoE3ohKs0tT+Ujr1W59oopxmoEh7Lu5p6vBaPbgoM0bzveAW4Qi5RyWDQ=="], @@ -2418,8 +2502,6 @@ "fresh": ["fresh@0.5.2", "", {}, "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q=="], - "fs-constants": ["fs-constants@1.0.0", "", {}, "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow=="], - "fs-extra": ["fs-extra@10.1.0", "", { "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", "universalify": "^2.0.0" } }, "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ=="], "fs.realpath": ["fs.realpath@1.0.0", "", {}, "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw=="], @@ -2434,9 +2516,9 @@ "fuzzysort": ["fuzzysort@3.1.0", "", {}, "sha512-sR9BNCjBg6LNgwvxlBd0sBABvQitkLzoVY9MYYROQVX/FvfJ4Mai9LsGhDgd8qYdds0bY77VzYd5iuB+v5rwQQ=="], - "gaxios": ["gaxios@6.7.1", "", { "dependencies": { "extend": "^3.0.2", "https-proxy-agent": "^7.0.1", "is-stream": "^2.0.0", "node-fetch": "^2.6.9", "uuid": "^9.0.1" } }, "sha512-LDODD4TMYx7XXdpwxAVRAIAuB0bzv0s+ywFonY46k126qzQHT9ygyoa9tncmOiQmmDrik65UYsEkv3lbfqQ3yQ=="], + "gaxios": ["gaxios@7.1.3", "", { "dependencies": { "extend": "^3.0.2", "https-proxy-agent": "^7.0.1", "node-fetch": "^3.3.2", "rimraf": "^5.0.1" } }, "sha512-YGGyuEdVIjqxkxVH1pUTMY/XtmmsApXrCVv5EU25iX6inEPbV+VakJfLealkBtJN69AQmh1eGOdCl9Sm1UP6XQ=="], - "gcp-metadata": ["gcp-metadata@6.1.1", "", { "dependencies": { "gaxios": "^6.1.1", "google-logging-utils": "^0.0.2", "json-bigint": "^1.0.0" } }, "sha512-a4tiq7E0/5fTjxPAaH4jpjkSv/uCaU2p5KC6HVGrvl0cDjA8iBZv4vv1gyzlmK0ZUKqwpOyQMKzZQe3lTit77A=="], + "gcp-metadata": ["gcp-metadata@8.1.2", "", { "dependencies": { "gaxios": "^7.0.0", "google-logging-utils": "^1.0.0", "json-bigint": "^1.0.0" } }, "sha512-zV/5HKTfCeKWnxG0Dmrw51hEWFGfcF2xiXqcA3+J90WDuP0SvoiSO5ORvcBsifmx/FoIjgQN3oNOGaQ5PhLFkg=="], "gel": ["gel@2.2.0", "", { "dependencies": { "@petamoriken/float16": "^3.8.7", "debug": "^4.3.4", "env-paths": "^3.0.0", "semver": "^7.6.2", "shell-quote": "^1.8.1", "which": "^4.0.0" }, "bin": { "gel": "dist/cli.mjs" } }, "sha512-q0ma7z2swmoamHQusey8ayo8+ilVdzDt4WTxSPzq/yRqvucWRfymRVMvNgmSC0XK7eNjjEZEcplxpgaNojKdmQ=="], @@ -2470,8 +2552,6 @@ "giget": ["giget@2.0.0", "", { "dependencies": { "citty": "^0.1.6", "consola": "^3.4.0", "defu": "^6.1.4", "node-fetch-native": "^1.6.6", "nypm": "^0.6.0", "pathe": "^2.0.3" }, "bin": { "giget": "dist/cli.mjs" } }, "sha512-L5bGsVkxJbJgdnwyuheIunkGatUF/zssUoxxjACCseZYAVbaqdh9Tsmmlkl8vYan09H7sbvKt4pS8GqKLBrEzA=="], - "github-from-package": ["github-from-package@0.0.0", "", {}, "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw=="], - "github-slugger": ["github-slugger@2.0.0", "", {}, "sha512-IaOQ9puYtjrkq7Y0Ygl9KDZnrf/aiUJYUpVf89y8kyaxbRG7Y1SrX/jaumrv81vc61+kiMempujsM3Yw7w5qcw=="], "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=="], @@ -2484,17 +2564,21 @@ "globby": ["globby@11.0.4", "", { "dependencies": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", "fast-glob": "^3.1.1", "ignore": "^5.1.4", "merge2": "^1.3.0", "slash": "^3.0.0" } }, "sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg=="], - "google-auth-library": ["google-auth-library@9.15.1", "", { "dependencies": { "base64-js": "^1.3.0", "ecdsa-sig-formatter": "^1.0.11", "gaxios": "^6.1.1", "gcp-metadata": "^6.1.0", "gtoken": "^7.0.0", "jws": "^4.0.0" } }, "sha512-Jb6Z0+nvECVz+2lzSMt9u98UsoakXxA2HGHMCxh+so3n90XgYWkq5dur19JAJV7ONiJY22yBTyJB1TSkvPq9Ng=="], + "google-auth-library": ["google-auth-library@10.5.0", "", { "dependencies": { "base64-js": "^1.3.0", "ecdsa-sig-formatter": "^1.0.11", "gaxios": "^7.0.0", "gcp-metadata": "^8.0.0", "google-logging-utils": "^1.0.0", "gtoken": "^8.0.0", "jws": "^4.0.0" } }, "sha512-7ABviyMOlX5hIVD60YOfHw4/CxOfBhyduaYB+wbFWCWoni4N7SLcV46hrVRktuBbZjFC9ONyqamZITN7q3n32w=="], - "google-logging-utils": ["google-logging-utils@0.0.2", "", {}, "sha512-NEgUnEcBiP5HrPzufUkBzJOD/Sxsco3rLNo1F1TNf7ieU8ryUzBhqba8r756CjLX7rn3fHl6iLEwPYuqpoKgQQ=="], + "google-logging-utils": ["google-logging-utils@1.1.3", "", {}, "sha512-eAmLkjDjAFCVXg7A1unxHsLf961m6y17QFqXqAXGj/gVkKFrEICfStRfwUlGNfeCEjNRa32JEWOUTlYXPyyKvA=="], "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=="], + "graphql": ["graphql@16.12.0", "", {}, "sha512-DKKrynuQRne0PNpEbzuEdHlYOMksHSUI8Zc9Unei5gTsMNA2/vMpoMz/yKba50pejK56qj98qM0SjYxAKi13gQ=="], + + "graphql-request": ["graphql-request@6.1.0", "", { "dependencies": { "@graphql-typed-document-node/core": "^3.2.0", "cross-fetch": "^3.1.5" }, "peerDependencies": { "graphql": "14 - 16" } }, "sha512-p+XPfS4q7aIpKVcgmnZKhMNqhltk20hfXtkaIkTfjjmiKMJ5xrt5c743cL03y/K7y1rg3WrIC49xGiEQ4mxdNw=="], + "gray-matter": ["gray-matter@4.0.3", "", { "dependencies": { "js-yaml": "^3.13.1", "kind-of": "^6.0.2", "section-matter": "^1.0.0", "strip-bom-string": "^1.0.0" } }, "sha512-5v6yZd4JK3eMI3FqqCouswVqwugaA9r4dNZB1wwcmrD02QkV5H0y7XBQW8QwQqEaZY1pM9aqORSORhJRdNK44Q=="], - "gtoken": ["gtoken@7.1.0", "", { "dependencies": { "gaxios": "^6.0.0", "jws": "^4.0.0" } }, "sha512-pCcEwRi+TKpMlxAQObHDQ56KawURgyAf6jtIY046fJ5tIv3zDe/LEIubckAO8fj6JnAxLdmWkUfNyulQ2iKdEw=="], + "gtoken": ["gtoken@8.0.0", "", { "dependencies": { "gaxios": "^7.0.0", "jws": "^4.0.0" } }, "sha512-+CqsMbHPiSTdtSO14O51eMNlrp9N79gmeqmXeouJOhfucAedHw9noVe/n5uJk3tbKE6a+6ZCQg3RPhVhHByAIw=="], "h3": ["h3@2.0.1-rc.4", "", { "dependencies": { "rou3": "^0.7.8", "srvx": "^0.9.1" }, "peerDependencies": { "crossws": "^0.4.1" }, "optionalPeers": ["crossws"] }, "sha512-vZq8pEUp6THsXKXrUXX44eOqfChic2wVQ1GlSzQCBr7DeFBkfIZAo2WyNND4GSv54TAa0E4LYIK73WSPdgKUgw=="], @@ -2720,6 +2804,8 @@ "isexe": ["isexe@3.1.1", "", {}, "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ=="], + "isomorphic-ws": ["isomorphic-ws@5.0.0", "", { "peerDependencies": { "ws": "*" } }, "sha512-muId7Zzn9ywDsyXgTIafTry2sV3nySZeUDe6YedVd1Hvuuep5AsIlqK+XefWpYTyJG5e503F2xIuT2lcU6rCSw=="], + "iterate-iterator": ["iterate-iterator@1.0.2", "", {}, "sha512-t91HubM4ZDQ70M9wqp+pcNpu8OyJ9UAtXntT/Bcsvp5tZMnz9vRa+IunKXeI8AnfZMTv0jNuVEmGeLSMjVvfPw=="], "iterate-value": ["iterate-value@1.0.2", "", { "dependencies": { "es-get-iterator": "^1.0.2", "iterate-iterator": "^1.0.1" } }, "sha512-A6fMAio4D2ot2r/TYzr4yUWrmwNdsN5xL7+HUiyACE4DXm+q8HtPcnFTp+NnW3k4N05tZ7FVYFFb2CR13NxyHQ=="], @@ -2752,7 +2838,11 @@ "json-schema": ["json-schema@0.4.0", "", {}, "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA=="], - "json-schema-traverse": ["json-schema-traverse@0.4.1", "", {}, "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="], + "json-schema-to-ts": ["json-schema-to-ts@3.1.1", "", { "dependencies": { "@babel/runtime": "^7.18.3", "ts-algebra": "^2.0.0" } }, "sha512-+DWg8jCJG2TEnpy7kOm/7/AxaYoaRbjVB4LFZLySZlWn8exGs3A4OLJR966cVvU26N7X9TWxl+Jsw7dzAqKT6g=="], + + "json-schema-traverse": ["json-schema-traverse@1.0.0", "", {}, "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug=="], + + "json-schema-typed": ["json-schema-typed@8.0.2", "", {}, "sha512-fQhoXdcvc3V28x7C7BMs4P5+kNlgUURe2jmUT1T//oBRMDrqy1QPelJimwZGo7Hg9VPV3EQV5Bnq4hbFy2vetA=="], "json5": ["json5@2.2.3", "", { "bin": { "json5": "lib/cli.js" } }, "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg=="], @@ -2768,6 +2858,8 @@ "jwt-decode": ["jwt-decode@3.1.2", "", {}, "sha512-UfpWE/VZn0iP50d8cz9NrZLM9lSWhcJ+0Gt/nm4by88UL+J1SiKN8/5dkjMmbEzwL2CAe+67GsegCbIKtbp75A=="], + "katex": ["katex@0.16.27", "", { "dependencies": { "commander": "^8.3.0" }, "bin": { "katex": "cli.js" } }, "sha512-aeQoDkuRWSqQN6nSvVCEFvfXdqo1OQiCmmW1kc9xSdjutPv7BGO7pqY9sQRJpMOGrEdfDgF2TfRXe5eUAD2Waw=="], + "kind-of": ["kind-of@6.0.3", "", {}, "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw=="], "kleur": ["kleur@4.1.5", "", {}, "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ=="], @@ -2856,7 +2948,9 @@ "markdown-table": ["markdown-table@3.0.4", "", {}, "sha512-wiYz4+JrLyb/DqW2hkFJxP7Vd7JuTDm77fvbM8VfEQdmSMqcImWeeRbHwZjBjIFki/VaMK2BhFi7oUUZeM5bqw=="], - "marked": ["marked@16.2.0", "", { "bin": { "marked": "bin/marked.js" } }, "sha512-LbbTuye+0dWRz2TS9KJ7wsnD4KAtpj0MVkWc90XvBa6AslXsT0hTBVH5k32pcSyHH1fst9XEFJunXHktVy0zlg=="], + "marked": ["marked@17.0.1", "", { "bin": { "marked": "bin/marked.js" } }, "sha512-boeBdiS0ghpWcSwoNm/jJBwdpFaMnZWRzjA6SkUMYb40SVaN1x7mmfGKp0jvexGcx+7y2La5zRZsYFZI6Qpypg=="], + + "marked-katex-extension": ["marked-katex-extension@5.1.6", "", { "peerDependencies": { "katex": ">=0.16 <0.17", "marked": ">=4 <18" } }, "sha512-vYpLXwmlIDKILIhJtiRTgdyZRn5sEYdFBuTmbpjD7lbCIzg0/DWyK3HXIntN3Tp8zV6hvOUgpZNLWRCgWVc24A=="], "marked-shiki": ["marked-shiki@1.2.1", "", { "peerDependencies": { "marked": ">=7.0.0", "shiki": ">=1.0.0" } }, "sha512-yHxYQhPY5oYaIRnROn98foKhuClark7M373/VpLxiy5TrDu9Jd/LsMwo8w+U91Up4oDb9IXFrP0N1MFRz8W/DQ=="], @@ -2996,8 +3090,6 @@ "mimic-fn": ["mimic-fn@4.0.0", "", {}, "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw=="], - "mimic-response": ["mimic-response@3.1.0", "", {}, "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ=="], - "miniflare": ["miniflare@4.20251118.1", "", { "dependencies": { "@cspotcode/source-map-support": "0.8.1", "acorn": "8.14.0", "acorn-walk": "8.3.2", "exit-hook": "2.2.1", "glob-to-regexp": "0.4.1", "sharp": "^0.33.5", "stoppable": "1.1.0", "undici": "7.14.0", "workerd": "1.20251118.0", "ws": "8.18.0", "youch": "4.1.0-beta.10", "zod": "3.22.3" }, "bin": { "miniflare": "bootstrap.js" } }, "sha512-uLSAE/DvOm392fiaig4LOaatxLjM7xzIniFRG5Y3yF9IduOYLLK/pkCPQNCgKQH3ou0YJRHnTN+09LPfqYNTQQ=="], "minimatch": ["minimatch@10.0.3", "", { "dependencies": { "@isaacs/brace-expansion": "^5.0.0" } }, "sha512-IPZ167aShDZZUMdRk66cyQAW3qr0WzbHkPdMYa8bzZhlHhO3jALbKdxcaak7W9FfT2rZNpQuUu4Od7ILEpXSaw=="], @@ -3010,12 +3102,12 @@ "mkdirp": ["mkdirp@0.5.6", "", { "dependencies": { "minimist": "^1.2.6" }, "bin": { "mkdirp": "bin/cmd.js" } }, "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw=="], - "mkdirp-classic": ["mkdirp-classic@0.5.3", "", {}, "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A=="], - "mrmime": ["mrmime@2.0.1", "", {}, "sha512-Y3wQdFg2Va6etvQ5I82yUhGdsKrcYox6p7FfL1LbK2J4V01F9TGlepTIhnK24t7koZibmg82KGglhA1XK5IsLQ=="], "ms": ["ms@2.1.3", "", {}, "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="], + "multicast-dns": ["multicast-dns@7.2.5", "", { "dependencies": { "dns-packet": "^5.2.2", "thunky": "^1.0.2" }, "bin": { "multicast-dns": "cli.js" } }, "sha512-2eznPJP8z2BFLX50tf0LuODrpINqP1RVIm/CObbTcBRITQgmC/TjcREF1NeTBzIcR5XO/ukWo+YHOjBbFwIupg=="], + "mustache": ["mustache@4.2.0", "", { "bin": { "mustache": "bin/mustache" } }, "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ=="], "mysql2": ["mysql2@3.14.4", "", { "dependencies": { "aws-ssl-profiles": "^1.1.1", "denque": "^2.1.0", "generate-function": "^2.3.1", "iconv-lite": "^0.7.0", "long": "^5.2.1", "lru.min": "^1.0.0", "named-placeholders": "^1.1.3", "seq-queue": "^0.0.5", "sqlstring": "^2.3.2" } }, "sha512-Cs/jx3WZPNrYHVz+Iunp9ziahaG5uFMvD2R8Zlmc194AqXNxt9HBNu7ZsPYrUtmJsF0egETCWIdMIYAwOGjL1w=="], @@ -3024,9 +3116,9 @@ "named-placeholders": ["named-placeholders@1.1.3", "", { "dependencies": { "lru-cache": "^7.14.1" } }, "sha512-eLoBxg6wE/rZkJPhU/xRX1WTpkFEwDJEN96oxFrTsqBdbT5ec295Q+CoHrL9IT0DipqKhmGcaZmwOt8OON5x1w=="], - "nanoid": ["nanoid@3.3.11", "", { "bin": { "nanoid": "bin/nanoid.cjs" } }, "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w=="], + "nanoevents": ["nanoevents@7.0.1", "", {}, "sha512-o6lpKiCxLeijK4hgsqfR6CNToPyRU3keKyyI6uwuHRvpRTbZ0wXw51WRgyldVugZqoJfkGFrjrIenYH3bfEO3Q=="], - "napi-build-utils": ["napi-build-utils@2.0.0", "", {}, "sha512-GEbrYkbfF7MoNaoh2iGG84Mnf/WZfB0GdGEsM8wz7Expx/LlWf5U8t9nvJKXSp3qr5IsEbK04cBGhol/KwOsWA=="], + "nanoid": ["nanoid@3.3.11", "", { "bin": { "nanoid": "bin/nanoid.cjs" } }, "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w=="], "negotiator": ["negotiator@0.6.3", "", {}, "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg=="], @@ -3040,9 +3132,7 @@ "no-case": ["no-case@3.0.4", "", { "dependencies": { "lower-case": "^2.0.2", "tslib": "^2.0.3" } }, "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg=="], - "node-abi": ["node-abi@3.85.0", "", { "dependencies": { "semver": "^7.3.5" } }, "sha512-zsFhmbkAzwhTft6nd3VxcG0cvJsT70rL+BIGHWVq5fi6MwGrHwzqKaxXE+Hl2GmnGItnDKPPkO5/LQqjVkIdFg=="], - - "node-addon-api": ["node-addon-api@6.1.0", "", {}, "sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA=="], + "node-addon-api": ["node-addon-api@7.1.1", "", {}, "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ=="], "node-domexception": ["node-domexception@1.0.0", "", {}, "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ=="], @@ -3080,6 +3170,8 @@ "object.assign": ["object.assign@4.1.7", "", { "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.3", "define-properties": "^1.2.1", "es-object-atoms": "^1.0.0", "has-symbols": "^1.1.0", "object-keys": "^1.1.1" } }, "sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw=="], + "obug": ["obug@2.1.1", "", {}, "sha512-uTqF9MuPraAQ+IsnPf366RG4cP9RtUi7MLO1N3KEc+wb0a6yKpeL0lmk2IB1jY5KHPAlTc6T/JRdC/YqxHNwkQ=="], + "ofetch": ["ofetch@2.0.0-alpha.3", "", {}, "sha512-zpYTCs2byOuft65vI3z43Dd6iSdFbOZZLb9/d21aCpx2rGastVU9dOCv0lu4ykc1Ur1anAYjDi3SUvR0vq50JA=="], "ohash": ["ohash@2.0.11", "", {}, "sha512-RdR9FQrFwNBNXAr4GixM8YaRZRJ5PUWbKYbE5eOsrwAjJW0q2REGcf79oYPsLyskQCZG1PLN+S/K1V00joZAoQ=="], @@ -3208,6 +3300,10 @@ "planck": ["planck@1.4.2", "", { "peerDependencies": { "stage-js": "^1.0.0-alpha.12" } }, "sha512-mNbhnV3g8X2rwGxzcesjmN8BDA6qfXgQxXVMkWau9MCRlQY0RLNEkyHlVp6yFy/X6qrzAXyNONCnZ1cGDLrNew=="], + "playwright": ["playwright@1.57.0", "", { "dependencies": { "playwright-core": "1.57.0" }, "optionalDependencies": { "fsevents": "2.3.2" }, "bin": { "playwright": "cli.js" } }, "sha512-ilYQj1s8sr2ppEJ2YVadYBN0Mb3mdo9J0wQ+UuDhzYqURwSoW4n1Xs5vs7ORwgDGmyEh33tRMeS8KhdkMoLXQw=="], + + "playwright-core": ["playwright-core@1.57.0", "", { "bin": { "playwright-core": "cli.js" } }, "sha512-agTcKlMw/mjBWOnD6kFZttAAGHgi/Nw0CZ2o6JqWSbMlI219lAFLZZCyqByTsvVAJq5XA5H8cA6PrvBRpBWEuQ=="], + "pngjs": ["pngjs@7.0.0", "", {}, "sha512-LKWqWJRhstyYo9pGvgor/ivk2w94eSjE3RGVuzLGlr3NmD8bf7RcYGze1mNdEHRP6TRP6rMuDHk5t44hnTRyow=="], "possible-typed-array-names": ["possible-typed-array-names@1.1.0", "", {}, "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg=="], @@ -3232,8 +3328,6 @@ "powershell-utils": ["powershell-utils@0.1.0", "", {}, "sha512-dM0jVuXJPsDN6DvRpea484tCUaMiXWjuCn++HGTqUWzGDjv5tZkEZldAJ/UMlqRYGFrD/etByo4/xOuC/snX2A=="], - "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=="], - "prettier": ["prettier@3.6.2", "", { "bin": { "prettier": "bin/prettier.cjs" } }, "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ=="], "pretty": ["pretty@2.0.0", "", { "dependencies": { "condense-newlines": "^0.2.1", "extend-shallow": "^2.0.1", "js-beautify": "^1.6.12" } }, "sha512-G9xUchgTEiNpormdYBl+Pha50gOUovT18IvAe7EYMZ1/f9W/WWMPRn+xI68yXNMUk3QXHDwo/1wV/4NejVNe1w=="], @@ -3256,8 +3350,6 @@ "proxy-from-env": ["proxy-from-env@1.1.0", "", {}, "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="], - "pump": ["pump@3.0.3", "", { "dependencies": { "end-of-stream": "^1.1.0", "once": "^1.3.1" } }, "sha512-todwxLMY7/heScKmntwQG8CXVkWUOdYxIvY2s0VWAAMh/nd8SoYiRaKjlr7+iCs984f2P8zvrfWcDDYVb73NfA=="], - "punycode": ["punycode@1.3.2", "", {}, "sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw=="], "qs": ["qs@6.14.0", "", { "dependencies": { "side-channel": "^1.1.0" } }, "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w=="], @@ -3274,8 +3366,6 @@ "raw-body": ["raw-body@2.5.2", "", { "dependencies": { "bytes": "3.1.2", "http-errors": "2.0.0", "iconv-lite": "0.4.24", "unpipe": "1.0.0" } }, "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA=="], - "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=="], - "rc9": ["rc9@2.1.2", "", { "dependencies": { "defu": "^6.1.4", "destr": "^2.0.3" } }, "sha512-btXCnMmRIBINM2LDZoEmOogIZU7Qe7zn4BpomSKZ/ykbLObuBdvG+mFq11DL6fjH1DRwHhrlgtYWG96bJiC7Cg=="], "react": ["react@18.2.0", "", { "dependencies": { "loose-envify": "^1.1.0" } }, "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ=="], @@ -3360,6 +3450,8 @@ "remeda": ["remeda@2.26.0", "", { "dependencies": { "type-fest": "^4.41.0" } }, "sha512-lmNNwtaC6Co4m0WTTNoZ/JlpjEqAjPZO0+czC9YVRQUpkbS4x8Hmh+Mn9HPfJfiXqUQ5IXXgSXSOB2pBKAytdA=="], + "require-from-string": ["require-from-string@2.0.2", "", {}, "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw=="], + "reselect": ["reselect@4.1.8", "", {}, "sha512-ab9EmR80F/zQTMNeneUr4cv+jSwPJgIlvEmVwLerwrWVbpLlBuls9XHzIeTFy4cegU2NHBp3va0LKOzU5qFEYQ=="], "resolve": ["resolve@1.22.11", "", { "dependencies": { "is-core-module": "^2.16.1", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, "bin": { "resolve": "bin/resolve" } }, "sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ=="], @@ -3384,6 +3476,8 @@ "reusify": ["reusify@1.1.0", "", {}, "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw=="], + "rimraf": ["rimraf@5.0.10", "", { "dependencies": { "glob": "^10.3.7" }, "bin": { "rimraf": "dist/esm/bin.mjs" } }, "sha512-l0OE8wL34P4nJH/H2ffoaniAokM2qSmrtXHmlpvYr5AVVX8msAyW0l8NVJFDxlSK4u3Uh/f41cQheDVdnYijwQ=="], + "rollup": ["rollup@4.53.3", "", { "dependencies": { "@types/estree": "1.0.8" }, "optionalDependencies": { "@rollup/rollup-android-arm-eabi": "4.53.3", "@rollup/rollup-android-arm64": "4.53.3", "@rollup/rollup-darwin-arm64": "4.53.3", "@rollup/rollup-darwin-x64": "4.53.3", "@rollup/rollup-freebsd-arm64": "4.53.3", "@rollup/rollup-freebsd-x64": "4.53.3", "@rollup/rollup-linux-arm-gnueabihf": "4.53.3", "@rollup/rollup-linux-arm-musleabihf": "4.53.3", "@rollup/rollup-linux-arm64-gnu": "4.53.3", "@rollup/rollup-linux-arm64-musl": "4.53.3", "@rollup/rollup-linux-loong64-gnu": "4.53.3", "@rollup/rollup-linux-ppc64-gnu": "4.53.3", "@rollup/rollup-linux-riscv64-gnu": "4.53.3", "@rollup/rollup-linux-riscv64-musl": "4.53.3", "@rollup/rollup-linux-s390x-gnu": "4.53.3", "@rollup/rollup-linux-x64-gnu": "4.53.3", "@rollup/rollup-linux-x64-musl": "4.53.3", "@rollup/rollup-openharmony-arm64": "4.53.3", "@rollup/rollup-win32-arm64-msvc": "4.53.3", "@rollup/rollup-win32-ia32-msvc": "4.53.3", "@rollup/rollup-win32-x64-gnu": "4.53.3", "@rollup/rollup-win32-x64-msvc": "4.53.3", "fsevents": "~2.3.2" }, "bin": { "rollup": "dist/bin/rollup" } }, "sha512-w8GmOxZfBmKknvdXU1sdM9NHcoQejwF/4mNgj2JuEEdRaHwwF12K7e9eXn1nLZ07ad+du76mkVsyeb2rKGllsA=="], "rou3": ["rou3@0.7.10", "", {}, "sha512-aoFj6f7MJZ5muJ+Of79nrhs9N3oLGqi2VEMe94Zbkjb6Wupha46EuoYgpWSOZlXww3bbd8ojgXTAA2mzimX5Ww=="], @@ -3414,7 +3508,7 @@ "selderee": ["selderee@0.11.0", "", { "dependencies": { "parseley": "^0.12.0" } }, "sha512-5TF+l7p4+OsnP8BCCvSyZiSPc4x4//p5uPwK8TCnVPJYRmU2aYKMpOXvw8zM5a5JvuuCGN1jmsMwuU2W02ukfA=="], - "semver": ["semver@7.7.2", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA=="], + "semver": ["semver@7.7.3", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q=="], "send": ["send@0.19.0", "", { "dependencies": { "debug": "2.6.9", "depd": "2.0.0", "destroy": "1.2.0", "encodeurl": "~1.0.2", "escape-html": "~1.0.3", "etag": "~1.8.1", "fresh": "0.5.2", "http-errors": "2.0.0", "mime": "1.6.0", "ms": "2.1.3", "on-finished": "2.4.1", "range-parser": "~1.2.1", "statuses": "2.0.1" } }, "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw=="], @@ -3434,7 +3528,7 @@ "setprototypeof": ["setprototypeof@1.2.0", "", {}, "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw=="], - "sharp": ["sharp@0.32.5", "", { "dependencies": { "color": "^4.2.3", "detect-libc": "^2.0.2", "node-addon-api": "^6.1.0", "prebuild-install": "^7.1.1", "semver": "^7.5.4", "simple-get": "^4.0.1", "tar-fs": "^3.0.4", "tunnel-agent": "^0.6.0" } }, "sha512-0dap3iysgDkNaPOaOL4X/0akdu0ma62GcdC2NBQ+93eqpePdDdr2/LM0sFdDSMmN7yS+odyZtPsb7tx/cYBKnQ=="], + "sharp": ["sharp@0.33.5", "", { "dependencies": { "color": "^4.2.3", "detect-libc": "^2.0.3", "semver": "^7.6.3" }, "optionalDependencies": { "@img/sharp-darwin-arm64": "0.33.5", "@img/sharp-darwin-x64": "0.33.5", "@img/sharp-libvips-darwin-arm64": "1.0.4", "@img/sharp-libvips-darwin-x64": "1.0.4", "@img/sharp-libvips-linux-arm": "1.0.5", "@img/sharp-libvips-linux-arm64": "1.0.4", "@img/sharp-libvips-linux-s390x": "1.0.4", "@img/sharp-libvips-linux-x64": "1.0.4", "@img/sharp-libvips-linuxmusl-arm64": "1.0.4", "@img/sharp-libvips-linuxmusl-x64": "1.0.4", "@img/sharp-linux-arm": "0.33.5", "@img/sharp-linux-arm64": "0.33.5", "@img/sharp-linux-s390x": "0.33.5", "@img/sharp-linux-x64": "0.33.5", "@img/sharp-linuxmusl-arm64": "0.33.5", "@img/sharp-linuxmusl-x64": "0.33.5", "@img/sharp-wasm32": "0.33.5", "@img/sharp-win32-ia32": "0.33.5", "@img/sharp-win32-x64": "0.33.5" } }, "sha512-haPVm1EkS9pgvHrQ/F3Xy+hgcuMV0Wm9vfIBSiwZ05k+xgb0PkBQpGsAA/oWdDobNaZTH5ppvHtzCFbnSEwHVw=="], "shebang-command": ["shebang-command@2.0.0", "", { "dependencies": { "shebang-regex": "^3.0.0" } }, "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA=="], @@ -3442,7 +3536,7 @@ "shell-quote": ["shell-quote@1.8.3", "", {}, "sha512-ObmnIF4hXNg1BqhnHmgbDETF8dLPCggZWBjkQfhZpbszZnYur5DUljTcCHii5LC3J5E0yeO/1LIMyH+UvHQgyw=="], - "shiki": ["shiki@3.9.2", "", { "dependencies": { "@shikijs/core": "3.9.2", "@shikijs/engine-javascript": "3.9.2", "@shikijs/engine-oniguruma": "3.9.2", "@shikijs/langs": "3.9.2", "@shikijs/themes": "3.9.2", "@shikijs/types": "3.9.2", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } }, "sha512-t6NKl5e/zGTvw/IyftLcumolgOczhuroqwXngDeMqJ3h3EQiTY/7wmfgPlsmloD8oYfqkEDqxiaH37Pjm1zUhQ=="], + "shiki": ["shiki@3.20.0", "", { "dependencies": { "@shikijs/core": "3.20.0", "@shikijs/engine-javascript": "3.20.0", "@shikijs/engine-oniguruma": "3.20.0", "@shikijs/langs": "3.20.0", "@shikijs/themes": "3.20.0", "@shikijs/types": "3.20.0", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } }, "sha512-kgCOlsnyWb+p0WU+01RjkCH+eBVsjL1jOwUYWv0YDWkM2/A46+LDKVs5yZCUXjJG6bj4ndFoAg5iLIIue6dulg=="], "shikiji": ["shikiji@0.6.13", "", { "dependencies": { "hast-util-to-html": "^9.0.0" } }, "sha512-4T7X39csvhT0p7GDnq9vysWddf2b6BeioiN3Ymhnt3xcy9tXmDcnsEFVxX18Z4YcQgEE/w48dLJ4pPPUcG9KkA=="], @@ -3458,10 +3552,6 @@ "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=="], - "simple-swizzle": ["simple-swizzle@0.2.4", "", { "dependencies": { "is-arrayish": "^0.3.1" } }, "sha512-nAu1WFPQSMNr2Zn9PGSZK9AGn4t/y97lEm+MXTtUDwfP0ksAIX4nO+6ruD9Jwut4C49SB1Ws+fbXsm/yScWOHw=="], "simple-xml-to-json": ["simple-xml-to-json@1.2.3", "", {}, "sha512-kWJDCr9EWtZ+/EYYM5MareWj2cRnZGF93YDNpH4jQiHB+hBIZnfPFSQiVMzZOdk+zXWqTZ/9fTeQNu2DqeiudA=="], @@ -3474,6 +3564,10 @@ "smol-toml": ["smol-toml@1.5.2", "", {}, "sha512-QlaZEqcAH3/RtNyet1IPIYPsEWAaYyXXv1Krsi+1L/QHppjX4Ifm8MQsBISz9vE8cHicIq3clogsheili5vhaQ=="], + "socket.io-client": ["socket.io-client@4.8.3", "", { "dependencies": { "@socket.io/component-emitter": "~3.1.0", "debug": "~4.4.1", "engine.io-client": "~6.6.1", "socket.io-parser": "~4.2.4" } }, "sha512-uP0bpjWrjQmUt5DTHq9RuoCBdFJF10cdX9X+a368j/Ft0wmaVgxlrjvK3kjvgCODOMMOz9lcaRzxmso0bTWZ/g=="], + + "socket.io-parser": ["socket.io-parser@4.2.5", "", { "dependencies": { "@socket.io/component-emitter": "~3.1.0", "debug": "~4.4.1" } }, "sha512-bPMmpy/5WWKHea5Y/jYAP6k74A+hvmRCQaJuJB6I/ML5JZq/KfNieUVo/3Mh7SAqn7TyFdIo6wqYHInG1MU1bQ=="], + "solid-js": ["solid-js@1.9.10", "", { "dependencies": { "csstype": "^3.1.0", "seroval": "~1.3.0", "seroval-plugins": "~1.3.0" } }, "sha512-Coz956cos/EPDlhs6+jsdTxKuJDPT7B5SVIWgABwROyxjY7Xbr8wkzD68Et+NxnV7DLJ3nJdAC2r9InuV/4Jew=="], "solid-list": ["solid-list@0.3.0", "", { "dependencies": { "@corvu/utils": "~0.4.0" }, "peerDependencies": { "solid-js": "^1.8" } }, "sha512-t4hx/F/l8Vmq+ib9HtZYl7Z9F1eKxq3eKJTXlvcm7P7yI4Z8O7QSOOEVHb/K6DD7M0RxzVRobK/BS5aSfLRwKg=="], @@ -3484,6 +3578,8 @@ "solid-refresh": ["solid-refresh@0.6.3", "", { "dependencies": { "@babel/generator": "^7.23.6", "@babel/helper-module-imports": "^7.22.15", "@babel/types": "^7.23.6" }, "peerDependencies": { "solid-js": "^1.3" } }, "sha512-F3aPsX6hVw9ttm5LYlth8Q15x6MlI/J3Dn+o3EQyRTtTxidepSTwAYdozt01/YA+7ObcciagGEyXIopGZzQtbA=="], + "solid-stripe": ["solid-stripe@0.8.1", "", { "peerDependencies": { "@stripe/stripe-js": ">=1.44.1 <8.0.0", "solid-js": "^1.6.0" } }, "sha512-l2SkWoe51rsvk9u1ILBRWyCHODZebChSGMR6zHYJTivTRC0XWrRnNNKs5x1PYXsaIU71KYI6ov5CZB5cOtGLWw=="], + "solid-use": ["solid-use@0.9.1", "", { "peerDependencies": { "solid-js": "^1.7" } }, "sha512-UwvXDVPlrrbj/9ewG9ys5uL2IO4jSiwys2KPzK4zsnAcmEl7iDafZWW1Mo4BSEWOmQCGK6IvpmGHo1aou8iOFw=="], "source-map": ["source-map@0.7.6", "", {}, "sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ=="], @@ -3560,8 +3656,6 @@ "strip-final-newline": ["strip-final-newline@3.0.0", "", {}, "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw=="], - "strip-json-comments": ["strip-json-comments@2.0.1", "", {}, "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ=="], - "stripe": ["stripe@18.0.0", "", { "dependencies": { "@types/node": ">=8.1.0", "qs": "^6.11.0" } }, "sha512-3Fs33IzKUby//9kCkCa1uRpinAoTvj6rJgQ2jrBEysoxEvfsclvXdna1amyEYbA2EKkjynuB4+L/kleCCaWTpA=="], "strnum": ["strnum@1.1.2", "", {}, "sha512-vrN+B7DBIoTTZjnPNewwhx6cBA/H+IS7rfW68n7XxC1y7uoiGQBxaKzqucGUgavX15dJgiGztLJ8vxuEzwqBdA=="], @@ -3588,8 +3682,6 @@ "tar": ["tar@7.5.2", "", { "dependencies": { "@isaacs/fs-minipass": "^4.0.0", "chownr": "^3.0.0", "minipass": "^7.1.2", "minizlib": "^3.1.0", "yallist": "^5.0.0" } }, "sha512-7NyxrTE4Anh8km8iEy7o0QYPs+0JKBTj5ZaqHg6B39erLg0qYXN3BijtShwbsNSvQ+LN75+KV+C4QR/f6Gwnpg=="], - "tar-fs": ["tar-fs@3.1.1", "", { "dependencies": { "pump": "^3.0.0", "tar-stream": "^3.1.5" }, "optionalDependencies": { "bare-fs": "^4.0.1", "bare-path": "^3.0.0" } }, "sha512-LZA0oaPOc2fVo82Txf3gw+AkEd38szODlptMYejQUhndHMLQ9M059uXR+AfS7DNo0NpINvSqDsvyaCrBVkptWg=="], - "tar-stream": ["tar-stream@3.1.7", "", { "dependencies": { "b4a": "^1.6.4", "fast-fifo": "^1.2.0", "streamx": "^2.15.0" } }, "sha512-qJj60CXt7IU1Ffyc3NJMjh6EkuCFej46zUqJ4J7pqYlThyd9bO0XBTmcOIhSzZJVWfsLks0+nle/j538YAW9RQ=="], "terracotta": ["terracotta@1.0.6", "", { "dependencies": { "solid-use": "^0.9.0" }, "peerDependencies": { "solid-js": "^1.8" } }, "sha512-yVrmT/Lg6a3tEbeYEJH8ksb1PYkR5FA9k5gr1TchaSNIiA2ZWs5a+koEbePXwlBP0poaV7xViZ/v50bQFcMgqw=="], @@ -3604,6 +3696,8 @@ "three": ["three@0.177.0", "", {}, "sha512-EiXv5/qWAaGI+Vz2A+JfavwYCMdGjxVsrn3oBwllUoqYeaBO75J63ZfyaQKoiLrqNHoTlUc6PFgMXnS0kI45zg=="], + "thunky": ["thunky@1.1.0", "", {}, "sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA=="], + "tiny-inflate": ["tiny-inflate@1.0.3", "", {}, "sha512-pkY1fj1cKHb2seWDy0B16HeWyczlJA9/WW3u3c4z/NiWDsO3DOU5D7nhTLE9CF0yXv/QZFY7sEJmj24dK+Rrqw=="], "tiny-invariant": ["tiny-invariant@1.3.3", "", {}, "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg=="], @@ -3640,6 +3734,8 @@ "trough": ["trough@2.2.0", "", {}, "sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw=="], + "ts-algebra": ["ts-algebra@2.0.0", "", {}, "sha512-FPAhNPFMrkwz76P7cdjdmiShwMynZYN6SgOujD1urY4oNm80Ou9oMdmbR45LotcKOXoy7wSmHkRFE6Mxbrhefw=="], + "ts-interface-checker": ["ts-interface-checker@0.1.13", "", {}, "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA=="], "tsconfck": ["tsconfck@3.1.6", "", { "peerDependencies": { "typescript": "^5.0.0" }, "optionalPeers": ["typescript"], "bin": { "tsconfck": "bin/tsconfck.js" } }, "sha512-ks6Vjr/jEw0P1gmOVwutM3B7fWxoWBL2KRDb1JfqGVawBmO5UsvmWOQFGHBPl5yxYz4eERr19E6L7NMv+Fej4w=="], @@ -3650,8 +3746,6 @@ "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=="], - "turbo": ["turbo@2.5.6", "", { "optionalDependencies": { "turbo-darwin-64": "2.5.6", "turbo-darwin-arm64": "2.5.6", "turbo-linux-64": "2.5.6", "turbo-linux-arm64": "2.5.6", "turbo-windows-64": "2.5.6", "turbo-windows-arm64": "2.5.6" }, "bin": { "turbo": "bin/turbo" } }, "sha512-gxToHmi9oTBNB05UjUsrWf0OyN5ZXtD0apOarC1KIx232Vp3WimRNy3810QzeNSgyD5rsaIDXlxlbnOzlouo+w=="], "turbo-darwin-64": ["turbo-darwin-64@2.5.6", "", { "os": "darwin", "cpu": "x64" }, "sha512-3C1xEdo4aFwMJAPvtlPqz1Sw/+cddWIOmsalHFMrsqqydcptwBfu26WW2cDm3u93bUzMbBJ8k3zNKFqxJ9ei2A=="], @@ -3742,8 +3836,6 @@ "update-browserslist-db": ["update-browserslist-db@1.1.4", "", { "dependencies": { "escalade": "^3.2.0", "picocolors": "^1.1.1" }, "peerDependencies": { "browserslist": ">= 4.21.0" }, "bin": { "update-browserslist-db": "cli.js" } }, "sha512-q0SPT4xyU84saUX+tomz1WLkxUbuaJnR1xWt17M7fJtEJigJeWUNGUqrauFXsHnqev9y9JTRGwk13tFBuKby4A=="], - "uri-js": ["uri-js@4.4.1", "", { "dependencies": { "punycode": "^2.1.0" } }, "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg=="], - "url": ["url@0.10.3", "", { "dependencies": { "punycode": "1.3.2", "querystring": "0.2.0" } }, "sha512-hzSUW2q06EqL1gKM/a+obYHLIO6ct2hwPuviqTTOcfFVc61UbfJ2Q32+uGL/HCPxKqrdGB5QUwIe7UqlDgwsOQ=="], "use-callback-ref": ["use-callback-ref@1.3.3", "", { "dependencies": { "tslib": "^2.0.0" }, "peerDependencies": { "@types/react": "*", "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-jQL3lRnocaFtu3V00JToYz/4QkNWswxijDaCVNZRiRTO3HQDLsdu1ZtmIUvV4yPp+rvWm5j0y0TG/S61cuijTg=="], @@ -3780,7 +3872,7 @@ "vitefu": ["vitefu@1.1.1", "", { "peerDependencies": { "vite": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0-beta.0" }, "optionalPeers": ["vite"] }, "sha512-B/Fegf3i8zh0yFbpzZ21amWzHmuNlLlmJT6n7bu5e+pCHUKQIfXSYokrqOBGEMMe9UG2sostKQF9mml/vYaWJQ=="], - "vitest": ["vitest@4.0.13", "", { "dependencies": { "@vitest/expect": "4.0.13", "@vitest/mocker": "4.0.13", "@vitest/pretty-format": "4.0.13", "@vitest/runner": "4.0.13", "@vitest/snapshot": "4.0.13", "@vitest/spy": "4.0.13", "@vitest/utils": "4.0.13", "debug": "^4.4.3", "es-module-lexer": "^1.7.0", "expect-type": "^1.2.2", "magic-string": "^0.30.21", "pathe": "^2.0.3", "picomatch": "^4.0.3", "std-env": "^3.10.0", "tinybench": "^2.9.0", "tinyexec": "^0.3.2", "tinyglobby": "^0.2.15", "tinyrainbow": "^3.0.3", "vite": "^6.0.0 || ^7.0.0", "why-is-node-running": "^2.3.0" }, "peerDependencies": { "@edge-runtime/vm": "*", "@opentelemetry/api": "^1.9.0", "@types/debug": "^4.1.12", "@types/node": "^20.0.0 || ^22.0.0 || >=24.0.0", "@vitest/browser-playwright": "4.0.13", "@vitest/browser-preview": "4.0.13", "@vitest/browser-webdriverio": "4.0.13", "@vitest/ui": "4.0.13", "happy-dom": "*", "jsdom": "*" }, "optionalPeers": ["@edge-runtime/vm", "@opentelemetry/api", "@types/debug", "@types/node", "@vitest/browser-playwright", "@vitest/browser-preview", "@vitest/browser-webdriverio", "@vitest/ui", "happy-dom", "jsdom"], "bin": { "vitest": "vitest.mjs" } }, "sha512-QSD4I0fN6uZQfftryIXuqvqgBxTvJ3ZNkF6RWECd82YGAYAfhcppBLFXzXJHQAAhVFyYEuFTrq6h0hQqjB7jIQ=="], + "vitest": ["vitest@4.0.16", "", { "dependencies": { "@vitest/expect": "4.0.16", "@vitest/mocker": "4.0.16", "@vitest/pretty-format": "4.0.16", "@vitest/runner": "4.0.16", "@vitest/snapshot": "4.0.16", "@vitest/spy": "4.0.16", "@vitest/utils": "4.0.16", "es-module-lexer": "^1.7.0", "expect-type": "^1.2.2", "magic-string": "^0.30.21", "obug": "^2.1.1", "pathe": "^2.0.3", "picomatch": "^4.0.3", "std-env": "^3.10.0", "tinybench": "^2.9.0", "tinyexec": "^1.0.2", "tinyglobby": "^0.2.15", "tinyrainbow": "^3.0.3", "vite": "^6.0.0 || ^7.0.0", "why-is-node-running": "^2.3.0" }, "peerDependencies": { "@edge-runtime/vm": "*", "@opentelemetry/api": "^1.9.0", "@types/node": "^20.0.0 || ^22.0.0 || >=24.0.0", "@vitest/browser-playwright": "4.0.16", "@vitest/browser-preview": "4.0.16", "@vitest/browser-webdriverio": "4.0.16", "@vitest/ui": "4.0.16", "happy-dom": "*", "jsdom": "*" }, "optionalPeers": ["@edge-runtime/vm", "@opentelemetry/api", "@types/node", "@vitest/browser-playwright", "@vitest/browser-preview", "@vitest/browser-webdriverio", "@vitest/ui", "happy-dom", "jsdom"], "bin": { "vitest": "vitest.mjs" } }, "sha512-E4t7DJ9pESL6E3I8nFjPa4xGUd3PmiWDLsDztS2qXSJWfHtbQnwAWylaBvSNY48I3vr8PTqIZlyK8TE3V3CA4Q=="], "vscode-jsonrpc": ["vscode-jsonrpc@8.2.1", "", {}, "sha512-kdjOSJ2lLIn7r1rtrMbbNCHjyMPfRnowdKjBQ+mGq6NAW5QY2bEZC/khaC5OR8svbbjvLEaIXkOq45e2X9BIbQ=="], @@ -3836,6 +3928,8 @@ "xmlbuilder": ["xmlbuilder@11.0.1", "", {}, "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA=="], + "xmlhttprequest-ssl": ["xmlhttprequest-ssl@2.1.2", "", {}, "sha512-TEU+nJVUUnA4CYJFLvK5X9AOeH4KvDvhIfm0vV1GaQRtchnG0hgK5p8hw/xjv8cunWYCsiPCSDzObPyhEwq3KQ=="], + "xxhash-wasm": ["xxhash-wasm@1.1.0", "", {}, "sha512-147y/6YNh+tlp6nd/2pWq38i9h6mz/EuQ6njIrmW8D1BS5nCqs0P6DG+m6zTGnNz5I+uhZ0SHxBs9BsPrwcKDA=="], "y18n": ["y18n@5.0.8", "", {}, "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA=="], @@ -3870,50 +3964,50 @@ "zwitch": ["zwitch@2.0.4", "", {}, "sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A=="], - "@actions/artifact/@octokit/core": ["@octokit/core@5.2.2", "", { "dependencies": { "@octokit/auth-token": "^4.0.0", "@octokit/graphql": "^7.1.0", "@octokit/request": "^8.4.1", "@octokit/request-error": "^5.1.1", "@octokit/types": "^13.0.0", "before-after-hook": "^2.2.0", "universal-user-agent": "^6.0.0" } }, "sha512-/g2d4sW9nUDJOMz3mabVQvOGhVa4e/BN/Um7yca9Bb2XTzPPnfTWHWQg+IsEYO7M3Vx+EXvaM/I2pJWIMun1bg=="], - - "@actions/artifact/@octokit/plugin-request-log": ["@octokit/plugin-request-log@1.0.4", "", { "peerDependencies": { "@octokit/core": ">=3" } }, "sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA=="], + "@actions/artifact/@actions/core": ["@actions/core@2.0.1", "", { "dependencies": { "@actions/exec": "^2.0.0", "@actions/http-client": "^3.0.0" } }, "sha512-oBfqT3GwkvLlo1fjvhQLQxuwZCGTarTE5OuZ2Wg10hvhBj7LRIlF611WT4aZS6fDhO5ZKlY7lCAZTlpmyaHaeg=="], - "@actions/artifact/@octokit/request": ["@octokit/request@8.4.1", "", { "dependencies": { "@octokit/endpoint": "^9.0.6", "@octokit/request-error": "^5.1.1", "@octokit/types": "^13.1.0", "universal-user-agent": "^6.0.0" } }, "sha512-qnB2+SY3hkCmBxZsR/MPCybNmbJe4KAlfWErXq+rBKkQJlbjdJeS85VI9r8UqeLYLvnAenU8Q1okM/0MBsAGXw=="], + "@actions/core/@actions/http-client": ["@actions/http-client@2.2.3", "", { "dependencies": { "tunnel": "^0.0.6", "undici": "^5.25.4" } }, "sha512-mx8hyJi/hjFvbPokCg4uRd4ZX78t+YyRPtnKWwIl+RzNaVuFpQHfmlGVfsKEJN8LwTCvL+DfVgAM04XaHkm6bA=="], - "@actions/artifact/@octokit/request-error": ["@octokit/request-error@5.1.1", "", { "dependencies": { "@octokit/types": "^13.1.0", "deprecation": "^2.0.0", "once": "^1.4.0" } }, "sha512-v9iyEQJH6ZntoENr9/yXxjuezh4My67CBSu9r6Ve/05Iu5gNgnisNWOsoJHTP6k0Rr0+HQIpnH+kyammu90q/g=="], - - "@actions/github/@octokit/core": ["@octokit/core@5.2.2", "", { "dependencies": { "@octokit/auth-token": "^4.0.0", "@octokit/graphql": "^7.1.0", "@octokit/request": "^8.4.1", "@octokit/request-error": "^5.1.1", "@octokit/types": "^13.0.0", "before-after-hook": "^2.2.0", "universal-user-agent": "^6.0.0" } }, "sha512-/g2d4sW9nUDJOMz3mabVQvOGhVa4e/BN/Um7yca9Bb2XTzPPnfTWHWQg+IsEYO7M3Vx+EXvaM/I2pJWIMun1bg=="], + "@actions/github/@actions/http-client": ["@actions/http-client@2.2.3", "", { "dependencies": { "tunnel": "^0.0.6", "undici": "^5.25.4" } }, "sha512-mx8hyJi/hjFvbPokCg4uRd4ZX78t+YyRPtnKWwIl+RzNaVuFpQHfmlGVfsKEJN8LwTCvL+DfVgAM04XaHkm6bA=="], "@actions/github/@octokit/plugin-paginate-rest": ["@octokit/plugin-paginate-rest@9.2.2", "", { "dependencies": { "@octokit/types": "^12.6.0" }, "peerDependencies": { "@octokit/core": "5" } }, "sha512-u3KYkGF7GcZnSD/3UP0S7K5XUFT2FkOQdcfXZGZQPGv3lm4F2Xbf71lvjldr8c1H3nNbF+33cLEkWYbokGWqiQ=="], "@actions/github/@octokit/plugin-rest-endpoint-methods": ["@octokit/plugin-rest-endpoint-methods@10.4.1", "", { "dependencies": { "@octokit/types": "^12.6.0" }, "peerDependencies": { "@octokit/core": "5" } }, "sha512-xV1b+ceKV9KytQe3zCVqjg+8GTGfDYwaT1ATU5isiUyVtlVAO3HNdzpS4sr4GBx4hxQ46s7ITtZrAsxG22+rVg=="], - "@actions/github/@octokit/request": ["@octokit/request@8.4.1", "", { "dependencies": { "@octokit/endpoint": "^9.0.6", "@octokit/request-error": "^5.1.1", "@octokit/types": "^13.1.0", "universal-user-agent": "^6.0.0" } }, "sha512-qnB2+SY3hkCmBxZsR/MPCybNmbJe4KAlfWErXq+rBKkQJlbjdJeS85VI9r8UqeLYLvnAenU8Q1okM/0MBsAGXw=="], - - "@actions/github/@octokit/request-error": ["@octokit/request-error@5.1.1", "", { "dependencies": { "@octokit/types": "^13.1.0", "deprecation": "^2.0.0", "once": "^1.4.0" } }, "sha512-v9iyEQJH6ZntoENr9/yXxjuezh4My67CBSu9r6Ve/05Iu5gNgnisNWOsoJHTP6k0Rr0+HQIpnH+kyammu90q/g=="], - "@actions/github/undici": ["undici@5.29.0", "", { "dependencies": { "@fastify/busboy": "^2.0.0" } }, "sha512-raqeBD6NQK4SkWhQzeYKd1KmIG6dllBOTt55Rmkt4HtI9mwdWtJljnrXjAFUBLTSN67HWrOIZ3EPF4kjUw80Bg=="], "@actions/http-client/undici": ["undici@5.29.0", "", { "dependencies": { "@fastify/busboy": "^2.0.0" } }, "sha512-raqeBD6NQK4SkWhQzeYKd1KmIG6dllBOTt55Rmkt4HtI9mwdWtJljnrXjAFUBLTSN67HWrOIZ3EPF4kjUw80Bg=="], - "@agentclientprotocol/sdk/zod": ["zod@3.25.76", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="], + "@ai-sdk/amazon-bedrock/@ai-sdk/anthropic": ["@ai-sdk/anthropic@2.0.57", "", { "dependencies": { "@ai-sdk/provider": "2.0.1", "@ai-sdk/provider-utils": "3.0.20" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-DREpYqW2pylgaj69gZ+K8u92bo9DaMgFdictYnY+IwYeY3bawQ4zI7l/o1VkDsBDljAx8iYz5lPURwVZNu+Xpg=="], - "@ai-sdk/amazon-bedrock/@ai-sdk/anthropic": ["@ai-sdk/anthropic@2.0.45", "", { "dependencies": { "@ai-sdk/provider": "2.0.0", "@ai-sdk/provider-utils": "3.0.17" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-Ipv62vavDCmrV/oE/lXehL9FzwQuZOnnlhPEftWizx464Wb6lvnBTJx8uhmEYruFSzOWTI95Z33ncZ4tA8E6RQ=="], + "@ai-sdk/amazon-bedrock/@smithy/eventstream-codec": ["@smithy/eventstream-codec@4.2.5", "", { "dependencies": { "@aws-crypto/crc32": "5.2.0", "@smithy/types": "^4.9.0", "@smithy/util-hex-encoding": "^4.2.0", "tslib": "^2.6.2" } }, "sha512-Ogt4Zi9hEbIP17oQMd68qYOHUzmH47UkK7q7Gl55iIm9oKt27MUGrC5JfpMroeHjdkOliOA4Qt3NQ1xMq/nrlA=="], - "@ai-sdk/amazon-bedrock/@ai-sdk/provider-utils": ["@ai-sdk/provider-utils@3.0.17", "", { "dependencies": { "@ai-sdk/provider": "2.0.0", "@standard-schema/spec": "^1.0.0", "eventsource-parser": "^3.0.6" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-TR3Gs4I3Tym4Ll+EPdzRdvo/rc8Js6c4nVhFLuvGLX/Y4V9ZcQMa/HTiYsHEgmYrf1zVi6Q145UEZUfleOwOjw=="], + "@ai-sdk/anthropic/@ai-sdk/provider": ["@ai-sdk/provider@2.0.0", "", { "dependencies": { "json-schema": "^0.4.0" } }, "sha512-6o7Y2SeO9vFKB8lArHXehNuusnpddKPk7xqL7T2/b+OvXMRIXUO1rR4wcv1hAFUAT9avGZshty3Wlua/XA7TvA=="], "@ai-sdk/anthropic/@ai-sdk/provider-utils": ["@ai-sdk/provider-utils@3.0.0", "", { "dependencies": { "@ai-sdk/provider": "2.0.0", "@standard-schema/spec": "^1.0.0", "eventsource-parser": "^3.0.3", "zod-to-json-schema": "^3.24.1" }, "peerDependencies": { "zod": "^3.25.76 || ^4" } }, "sha512-BoQZtGcBxkeSH1zK+SRYNDtJPIPpacTeiMZqnG4Rv6xXjEwM0FH4MGs9c+PlhyEWmQCzjRM2HAotEydFhD4dYw=="], - "@ai-sdk/azure/@ai-sdk/openai": ["@ai-sdk/openai@2.0.71", "", { "dependencies": { "@ai-sdk/provider": "2.0.0", "@ai-sdk/provider-utils": "3.0.17" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-tg+gj+R0z/On9P4V7hy7/7o04cQPjKGayMCL3gzWD/aNGjAKkhEnaocuNDidSnghizt8g2zJn16cAuAolnW+qQ=="], + "@ai-sdk/azure/@ai-sdk/openai": ["@ai-sdk/openai@2.0.89", "", { "dependencies": { "@ai-sdk/provider": "2.0.1", "@ai-sdk/provider-utils": "3.0.20" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-4+qWkBCbL9HPKbgrUO/F2uXZ8GqrYxHa8SWEYIzxEJ9zvWw3ISr3t1/27O1i8MGSym+PzEyHBT48EV4LAwWaEw=="], - "@ai-sdk/azure/@ai-sdk/provider-utils": ["@ai-sdk/provider-utils@3.0.17", "", { "dependencies": { "@ai-sdk/provider": "2.0.0", "@standard-schema/spec": "^1.0.0", "eventsource-parser": "^3.0.6" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-TR3Gs4I3Tym4Ll+EPdzRdvo/rc8Js6c4nVhFLuvGLX/Y4V9ZcQMa/HTiYsHEgmYrf1zVi6Q145UEZUfleOwOjw=="], + "@ai-sdk/cerebras/@ai-sdk/openai-compatible": ["@ai-sdk/openai-compatible@1.0.30", "", { "dependencies": { "@ai-sdk/provider": "2.0.1", "@ai-sdk/provider-utils": "3.0.20" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-thubwhRtv9uicAxSWwNpinM7hiL/0CkhL/ymPaHuKvI494J7HIzn8KQZQ2ymRz284WTIZnI7VMyyejxW4RMM6w=="], - "@ai-sdk/gateway/@ai-sdk/provider-utils": ["@ai-sdk/provider-utils@3.0.17", "", { "dependencies": { "@ai-sdk/provider": "2.0.0", "@standard-schema/spec": "^1.0.0", "eventsource-parser": "^3.0.6" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-TR3Gs4I3Tym4Ll+EPdzRdvo/rc8Js6c4nVhFLuvGLX/Y4V9ZcQMa/HTiYsHEgmYrf1zVi6Q145UEZUfleOwOjw=="], + "@ai-sdk/deepinfra/@ai-sdk/openai-compatible": ["@ai-sdk/openai-compatible@1.0.30", "", { "dependencies": { "@ai-sdk/provider": "2.0.1", "@ai-sdk/provider-utils": "3.0.20" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-thubwhRtv9uicAxSWwNpinM7hiL/0CkhL/ymPaHuKvI494J7HIzn8KQZQ2ymRz284WTIZnI7VMyyejxW4RMM6w=="], - "@ai-sdk/google-vertex/@ai-sdk/anthropic": ["@ai-sdk/anthropic@2.0.50", "", { "dependencies": { "@ai-sdk/provider": "2.0.0", "@ai-sdk/provider-utils": "3.0.18" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-21PaHfoLmouOXXNINTsZJsMw+wE5oLR2He/1kq/sKokTVKyq7ObGT1LDk6ahwxaz/GoaNaGankMh+EgVcdv2Cw=="], + "@ai-sdk/google-vertex/@ai-sdk/anthropic": ["@ai-sdk/anthropic@2.0.57", "", { "dependencies": { "@ai-sdk/provider": "2.0.1", "@ai-sdk/provider-utils": "3.0.20" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-DREpYqW2pylgaj69gZ+K8u92bo9DaMgFdictYnY+IwYeY3bawQ4zI7l/o1VkDsBDljAx8iYz5lPURwVZNu+Xpg=="], - "@ai-sdk/mcp/@ai-sdk/provider-utils": ["@ai-sdk/provider-utils@3.0.17", "", { "dependencies": { "@ai-sdk/provider": "2.0.0", "@standard-schema/spec": "^1.0.0", "eventsource-parser": "^3.0.6" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-TR3Gs4I3Tym4Ll+EPdzRdvo/rc8Js6c4nVhFLuvGLX/Y4V9ZcQMa/HTiYsHEgmYrf1zVi6Q145UEZUfleOwOjw=="], + "@ai-sdk/openai/@ai-sdk/provider": ["@ai-sdk/provider@2.0.0", "", { "dependencies": { "json-schema": "^0.4.0" } }, "sha512-6o7Y2SeO9vFKB8lArHXehNuusnpddKPk7xqL7T2/b+OvXMRIXUO1rR4wcv1hAFUAT9avGZshty3Wlua/XA7TvA=="], "@ai-sdk/openai/@ai-sdk/provider-utils": ["@ai-sdk/provider-utils@3.0.0", "", { "dependencies": { "@ai-sdk/provider": "2.0.0", "@standard-schema/spec": "^1.0.0", "eventsource-parser": "^3.0.3", "zod-to-json-schema": "^3.24.1" }, "peerDependencies": { "zod": "^3.25.76 || ^4" } }, "sha512-BoQZtGcBxkeSH1zK+SRYNDtJPIPpacTeiMZqnG4Rv6xXjEwM0FH4MGs9c+PlhyEWmQCzjRM2HAotEydFhD4dYw=="], + "@ai-sdk/openai-compatible/@ai-sdk/provider": ["@ai-sdk/provider@2.0.0", "", { "dependencies": { "json-schema": "^0.4.0" } }, "sha512-6o7Y2SeO9vFKB8lArHXehNuusnpddKPk7xqL7T2/b+OvXMRIXUO1rR4wcv1hAFUAT9avGZshty3Wlua/XA7TvA=="], + "@ai-sdk/openai-compatible/@ai-sdk/provider-utils": ["@ai-sdk/provider-utils@3.0.0", "", { "dependencies": { "@ai-sdk/provider": "2.0.0", "@standard-schema/spec": "^1.0.0", "eventsource-parser": "^3.0.3", "zod-to-json-schema": "^3.24.1" }, "peerDependencies": { "zod": "^3.25.76 || ^4" } }, "sha512-BoQZtGcBxkeSH1zK+SRYNDtJPIPpacTeiMZqnG4Rv6xXjEwM0FH4MGs9c+PlhyEWmQCzjRM2HAotEydFhD4dYw=="], + "@ai-sdk/togetherai/@ai-sdk/openai-compatible": ["@ai-sdk/openai-compatible@1.0.30", "", { "dependencies": { "@ai-sdk/provider": "2.0.1", "@ai-sdk/provider-utils": "3.0.20" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-thubwhRtv9uicAxSWwNpinM7hiL/0CkhL/ymPaHuKvI494J7HIzn8KQZQ2ymRz284WTIZnI7VMyyejxW4RMM6w=="], + + "@ai-sdk/vercel/@ai-sdk/openai-compatible": ["@ai-sdk/openai-compatible@1.0.30", "", { "dependencies": { "@ai-sdk/provider": "2.0.1", "@ai-sdk/provider-utils": "3.0.20" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-thubwhRtv9uicAxSWwNpinM7hiL/0CkhL/ymPaHuKvI494J7HIzn8KQZQ2ymRz284WTIZnI7VMyyejxW4RMM6w=="], + + "@ai-sdk/xai/@ai-sdk/openai-compatible": ["@ai-sdk/openai-compatible@1.0.30", "", { "dependencies": { "@ai-sdk/provider": "2.0.1", "@ai-sdk/provider-utils": "3.0.20" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-thubwhRtv9uicAxSWwNpinM7hiL/0CkhL/ymPaHuKvI494J7HIzn8KQZQ2ymRz284WTIZnI7VMyyejxW4RMM6w=="], + "@astrojs/cloudflare/vite": ["vite@6.4.1", "", { "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.4.4", "picomatch": "^4.0.2", "postcss": "^8.5.3", "rollup": "^4.34.9", "tinyglobby": "^0.2.13" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", "jiti": ">=1.21.0", "less": "*", "lightningcss": "^1.21.0", "sass": "*", "sass-embedded": "*", "stylus": "*", "sugarss": "*", "terser": "^5.16.0", "tsx": "^4.8.1", "yaml": "^2.4.2" }, "optionalPeers": ["@types/node", "jiti", "less", "lightningcss", "sass", "sass-embedded", "stylus", "sugarss", "terser", "tsx", "yaml"], "bin": { "vite": "bin/vite.js" } }, "sha512-+Oxm7q9hDoLMyJOYfUYBuHQo+dkAloi33apOPP56pzj+vsdJDzr+j1NISE5pyaAuKL4A3UD34qd0lx5+kfKp2g=="], "@astrojs/markdown-remark/@astrojs/internal-helpers": ["@astrojs/internal-helpers@0.6.1", "", {}, "sha512-l5Pqf6uZu31aG+3Lv8nl/3s4DbUzdlxTWDof4pEpto6GUJNhhCbelVi9dEyurOVyqaelwmS9oSyOWOENSfgo9A=="], @@ -3958,40 +4052,16 @@ "@aws-sdk/xml-builder/fast-xml-parser": ["fast-xml-parser@5.2.5", "", { "dependencies": { "strnum": "^2.1.0" }, "bin": { "fxparser": "src/cli/cli.js" } }, "sha512-pfX9uG9Ki0yekDHx2SiuRIyFdyAr1kMIMitPvb0YBo8SUfKvia7w7FIyd/l6av85pFYRhZscS75MwMnbvY+hcQ=="], - "@azure/core-auth/@azure/abort-controller": ["@azure/abort-controller@2.1.2", "", { "dependencies": { "tslib": "^2.6.2" } }, "sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA=="], - - "@azure/core-client/@azure/abort-controller": ["@azure/abort-controller@2.1.2", "", { "dependencies": { "tslib": "^2.6.2" } }, "sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA=="], + "@azure/core-http/@azure/abort-controller": ["@azure/abort-controller@1.1.0", "", { "dependencies": { "tslib": "^2.2.0" } }, "sha512-TrRLIoSQVzfAJX9H1JeFjzAoDGcoK1IYX1UImfceTZpsyYfWr09Ss1aHW1y5TrrR3iq6RZLBwJ3E24uwPhwahw=="], - "@azure/core-client/@azure/core-tracing": ["@azure/core-tracing@1.3.1", "", { "dependencies": { "tslib": "^2.6.2" } }, "sha512-9MWKevR7Hz8kNzzPLfX4EAtGM2b8mr50HPDBvio96bURP/9C+HjdH3sBlLSNNrvRAr5/k/svoH457gB5IKpmwQ=="], + "@azure/core-http/@azure/core-tracing": ["@azure/core-tracing@1.0.0-preview.13", "", { "dependencies": { "@opentelemetry/api": "^1.0.1", "tslib": "^2.2.0" } }, "sha512-KxDlhXyMlh2Jhj2ykX6vNEU0Vou4nHr025KoSEiz7cS3BNiHNaZcdECk/DmLkEB0as5T7b/TpRcehJ5yV6NeXQ=="], "@azure/core-http/uuid": ["uuid@8.3.2", "", { "bin": { "uuid": "dist/bin/uuid" } }, "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg=="], "@azure/core-http/xml2js": ["xml2js@0.5.0", "", { "dependencies": { "sax": ">=0.6.0", "xmlbuilder": "~11.0.0" } }, "sha512-drPFnkQJik/O+uPKpqSgr22mpuFHqKdbS835iAQrUC73L2F5WkboIRd63ai/2Yg6I1jzifPFKH2NTK+cfglkIA=="], - "@azure/core-http-compat/@azure/abort-controller": ["@azure/abort-controller@2.1.2", "", { "dependencies": { "tslib": "^2.6.2" } }, "sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA=="], - - "@azure/core-lro/@azure/abort-controller": ["@azure/abort-controller@2.1.2", "", { "dependencies": { "tslib": "^2.6.2" } }, "sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA=="], - - "@azure/core-rest-pipeline/@azure/abort-controller": ["@azure/abort-controller@2.1.2", "", { "dependencies": { "tslib": "^2.6.2" } }, "sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA=="], - - "@azure/core-rest-pipeline/@azure/core-tracing": ["@azure/core-tracing@1.3.1", "", { "dependencies": { "tslib": "^2.6.2" } }, "sha512-9MWKevR7Hz8kNzzPLfX4EAtGM2b8mr50HPDBvio96bURP/9C+HjdH3sBlLSNNrvRAr5/k/svoH457gB5IKpmwQ=="], - - "@azure/core-util/@azure/abort-controller": ["@azure/abort-controller@2.1.2", "", { "dependencies": { "tslib": "^2.6.2" } }, "sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA=="], - "@azure/core-xml/fast-xml-parser": ["fast-xml-parser@5.2.5", "", { "dependencies": { "strnum": "^2.1.0" }, "bin": { "fxparser": "src/cli/cli.js" } }, "sha512-pfX9uG9Ki0yekDHx2SiuRIyFdyAr1kMIMitPvb0YBo8SUfKvia7w7FIyd/l6av85pFYRhZscS75MwMnbvY+hcQ=="], - "@azure/storage-blob/@azure/abort-controller": ["@azure/abort-controller@2.1.2", "", { "dependencies": { "tslib": "^2.6.2" } }, "sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA=="], - - "@azure/storage-blob/@azure/core-tracing": ["@azure/core-tracing@1.3.1", "", { "dependencies": { "tslib": "^2.6.2" } }, "sha512-9MWKevR7Hz8kNzzPLfX4EAtGM2b8mr50HPDBvio96bURP/9C+HjdH3sBlLSNNrvRAr5/k/svoH457gB5IKpmwQ=="], - - "@azure/storage-blob/events": ["events@3.3.0", "", {}, "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q=="], - - "@azure/storage-common/@azure/abort-controller": ["@azure/abort-controller@2.1.2", "", { "dependencies": { "tslib": "^2.6.2" } }, "sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA=="], - - "@azure/storage-common/@azure/core-tracing": ["@azure/core-tracing@1.3.1", "", { "dependencies": { "tslib": "^2.6.2" } }, "sha512-9MWKevR7Hz8kNzzPLfX4EAtGM2b8mr50HPDBvio96bURP/9C+HjdH3sBlLSNNrvRAr5/k/svoH457gB5IKpmwQ=="], - - "@azure/storage-common/events": ["events@3.3.0", "", {}, "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q=="], - "@babel/core/semver": ["semver@6.3.1", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="], "@babel/helper-compilation-targets/lru-cache": ["lru-cache@5.1.1", "", { "dependencies": { "yallist": "^3.0.2" } }, "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w=="], @@ -4004,10 +4074,16 @@ "@cspotcode/source-map-support/@jridgewell/trace-mapping": ["@jridgewell/trace-mapping@0.3.9", "", { "dependencies": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" } }, "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ=="], + "@dot/log/chalk": ["chalk@4.1.2", "", { "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA=="], + "@esbuild-kit/core-utils/esbuild": ["esbuild@0.18.20", "", { "optionalDependencies": { "@esbuild/android-arm": "0.18.20", "@esbuild/android-arm64": "0.18.20", "@esbuild/android-x64": "0.18.20", "@esbuild/darwin-arm64": "0.18.20", "@esbuild/darwin-x64": "0.18.20", "@esbuild/freebsd-arm64": "0.18.20", "@esbuild/freebsd-x64": "0.18.20", "@esbuild/linux-arm": "0.18.20", "@esbuild/linux-arm64": "0.18.20", "@esbuild/linux-ia32": "0.18.20", "@esbuild/linux-loong64": "0.18.20", "@esbuild/linux-mips64el": "0.18.20", "@esbuild/linux-ppc64": "0.18.20", "@esbuild/linux-riscv64": "0.18.20", "@esbuild/linux-s390x": "0.18.20", "@esbuild/linux-x64": "0.18.20", "@esbuild/netbsd-x64": "0.18.20", "@esbuild/openbsd-x64": "0.18.20", "@esbuild/sunos-x64": "0.18.20", "@esbuild/win32-arm64": "0.18.20", "@esbuild/win32-ia32": "0.18.20", "@esbuild/win32-x64": "0.18.20" }, "bin": { "esbuild": "bin/esbuild" } }, "sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA=="], "@expressive-code/plugin-shiki/shiki": ["shiki@3.15.0", "", { "dependencies": { "@shikijs/core": "3.15.0", "@shikijs/engine-javascript": "3.15.0", "@shikijs/engine-oniguruma": "3.15.0", "@shikijs/langs": "3.15.0", "@shikijs/themes": "3.15.0", "@shikijs/types": "3.15.0", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } }, "sha512-kLdkY6iV3dYbtPwS9KXU7mjfmDm25f5m0IPNFnaXO7TBPcvbUOY72PYXSuSqDzwp+vlH/d7MXpHlKO/x+QoLXw=="], + "@gitlab/gitlab-ai-provider/openai": ["openai@6.16.0", "", { "peerDependencies": { "ws": "^8.18.0", "zod": "^3.25 || ^4.0" }, "optionalPeers": ["ws", "zod"], "bin": { "openai": "bin/cli" } }, "sha512-fZ1uBqjFUjXzbGc35fFtYKEOxd20kd9fDpFeqWtsOZWiubY8CZ1NAlXHW3iathaFvqmNtCWMIsosCuyeI7Joxg=="], + + "@gitlab/gitlab-ai-provider/zod": ["zod@3.25.76", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="], + "@hey-api/json-schema-ref-parser/js-yaml": ["js-yaml@4.1.1", "", { "dependencies": { "argparse": "^2.0.1" }, "bin": { "js-yaml": "bin/js-yaml.js" } }, "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA=="], "@hey-api/openapi-ts/open": ["open@11.0.0", "", { "dependencies": { "default-browser": "^5.4.0", "define-lazy-prop": "^3.0.0", "is-in-ssh": "^1.0.0", "is-inside-container": "^1.0.0", "powershell-utils": "^0.1.0", "wsl-utils": "^0.3.0" } }, "sha512-smsWv2LzFjP03xmvFoJ331ss6h+jixfA4UUV/Bsiyuu4YJPfN+FIQGOIiv4w9/+MoHkfkJ22UIaQWRVFRfH6Vw=="], @@ -4050,6 +4126,8 @@ "@jimp/types/zod": ["zod@3.25.76", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="], + "@jsx-email/cli/chalk": ["chalk@4.1.2", "", { "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA=="], + "@jsx-email/cli/esbuild": ["esbuild@0.19.12", "", { "optionalDependencies": { "@esbuild/aix-ppc64": "0.19.12", "@esbuild/android-arm": "0.19.12", "@esbuild/android-arm64": "0.19.12", "@esbuild/android-x64": "0.19.12", "@esbuild/darwin-arm64": "0.19.12", "@esbuild/darwin-x64": "0.19.12", "@esbuild/freebsd-arm64": "0.19.12", "@esbuild/freebsd-x64": "0.19.12", "@esbuild/linux-arm": "0.19.12", "@esbuild/linux-arm64": "0.19.12", "@esbuild/linux-ia32": "0.19.12", "@esbuild/linux-loong64": "0.19.12", "@esbuild/linux-mips64el": "0.19.12", "@esbuild/linux-ppc64": "0.19.12", "@esbuild/linux-riscv64": "0.19.12", "@esbuild/linux-s390x": "0.19.12", "@esbuild/linux-x64": "0.19.12", "@esbuild/netbsd-x64": "0.19.12", "@esbuild/openbsd-x64": "0.19.12", "@esbuild/sunos-x64": "0.19.12", "@esbuild/win32-arm64": "0.19.12", "@esbuild/win32-ia32": "0.19.12", "@esbuild/win32-x64": "0.19.12" }, "bin": { "esbuild": "bin/esbuild" } }, "sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg=="], "@jsx-email/cli/tailwindcss": ["tailwindcss@3.3.3", "", { "dependencies": { "@alloc/quick-lru": "^5.2.0", "arg": "^5.0.2", "chokidar": "^3.5.3", "didyoumean": "^1.2.2", "dlv": "^1.1.3", "fast-glob": "^3.2.12", "glob-parent": "^6.0.2", "is-glob": "^4.0.3", "jiti": "^1.18.2", "lilconfig": "^2.1.0", "micromatch": "^4.0.5", "normalize-path": "^3.0.0", "object-hash": "^3.0.0", "picocolors": "^1.0.0", "postcss": "^8.4.23", "postcss-import": "^15.1.0", "postcss-js": "^4.0.1", "postcss-load-config": "^4.0.1", "postcss-nested": "^6.0.1", "postcss-selector-parser": "^6.0.11", "resolve": "^1.22.2", "sucrase": "^3.32.0" }, "bin": { "tailwind": "lib/cli.js", "tailwindcss": "lib/cli.js" } }, "sha512-A0KgSkef7eE4Mf+nKJ83i75TMyq8HqY3qmFIJSWy8bNt0v1lG7jUcpGpoTFxAwYcWOphcTBLPPJg+bDfhDf52w=="], @@ -4060,47 +4138,77 @@ "@modelcontextprotocol/sdk/express": ["express@5.1.0", "", { "dependencies": { "accepts": "^2.0.0", "body-parser": "^2.2.0", "content-disposition": "^1.0.0", "content-type": "^1.0.5", "cookie": "^0.7.1", "cookie-signature": "^1.2.1", "debug": "^4.4.0", "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "etag": "^1.8.1", "finalhandler": "^2.1.0", "fresh": "^2.0.0", "http-errors": "^2.0.0", "merge-descriptors": "^2.0.0", "mime-types": "^3.0.0", "on-finished": "^2.4.1", "once": "^1.4.0", "parseurl": "^1.3.3", "proxy-addr": "^2.0.7", "qs": "^6.14.0", "range-parser": "^1.2.1", "router": "^2.2.0", "send": "^1.1.0", "serve-static": "^2.2.0", "statuses": "^2.0.1", "type-is": "^2.0.1", "vary": "^1.1.2" } }, "sha512-DT9ck5YIRU+8GYzzU5kT3eHGA5iL+1Zd0EutOmTE9Dtk+Tvuzd23VBU+ec7HPNSTxXYO55gPV/hq4pSBJDjFpA=="], + "@modelcontextprotocol/sdk/jose": ["jose@6.1.3", "", {}, "sha512-0TpaTfihd4QMNwrz/ob2Bp7X04yuxJkjRGi4aKmOqwhov54i6u79oCv7T+C7lo70MKH6BesI3vscD1yb/yzKXQ=="], + "@modelcontextprotocol/sdk/raw-body": ["raw-body@3.0.2", "", { "dependencies": { "bytes": "~3.1.2", "http-errors": "~2.0.1", "iconv-lite": "~0.7.0", "unpipe": "~1.0.0" } }, "sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA=="], - "@modelcontextprotocol/sdk/zod": ["zod@3.25.76", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="], + "@modelcontextprotocol/sdk/zod-to-json-schema": ["zod-to-json-schema@3.25.1", "", { "peerDependencies": { "zod": "^3.25 || ^4" } }, "sha512-pM/SU9d3YAggzi6MtR4h7ruuQlqKtad8e9S0fmxcMi+ueAK5Korys/aWcV9LIIHTVbj01NdzxcnXSN+O74ZIVA=="], + + "@octokit/auth-app/@octokit/request": ["@octokit/request@10.0.7", "", { "dependencies": { "@octokit/endpoint": "^11.0.2", "@octokit/request-error": "^7.0.2", "@octokit/types": "^16.0.0", "fast-content-type-parse": "^3.0.0", "universal-user-agent": "^7.0.2" } }, "sha512-v93h0i1yu4idj8qFPZwjehoJx4j3Ntn+JhXsdJrG9pYaX6j/XRz2RmasMUHtNgQD39nrv/VwTWSqK0RNXR8upA=="], + + "@octokit/auth-app/@octokit/request-error": ["@octokit/request-error@7.1.0", "", { "dependencies": { "@octokit/types": "^16.0.0" } }, "sha512-KMQIfq5sOPpkQYajXHwnhjCC0slzCNScLHs9JafXc4RAJI+9f+jNDlBNaIMTvazOPLgb4BnlhGJOTbnN0wIjPw=="], + + "@octokit/auth-oauth-app/@octokit/request": ["@octokit/request@10.0.7", "", { "dependencies": { "@octokit/endpoint": "^11.0.2", "@octokit/request-error": "^7.0.2", "@octokit/types": "^16.0.0", "fast-content-type-parse": "^3.0.0", "universal-user-agent": "^7.0.2" } }, "sha512-v93h0i1yu4idj8qFPZwjehoJx4j3Ntn+JhXsdJrG9pYaX6j/XRz2RmasMUHtNgQD39nrv/VwTWSqK0RNXR8upA=="], "@octokit/auth-oauth-app/@octokit/types": ["@octokit/types@16.0.0", "", { "dependencies": { "@octokit/openapi-types": "^27.0.0" } }, "sha512-sKq+9r1Mm4efXW1FCk7hFSeJo4QKreL/tTbR0rz/qx/r1Oa2VV83LTA/H/MuCOX7uCIJmQVRKBcbmWoySjAnSg=="], + "@octokit/auth-oauth-device/@octokit/request": ["@octokit/request@10.0.7", "", { "dependencies": { "@octokit/endpoint": "^11.0.2", "@octokit/request-error": "^7.0.2", "@octokit/types": "^16.0.0", "fast-content-type-parse": "^3.0.0", "universal-user-agent": "^7.0.2" } }, "sha512-v93h0i1yu4idj8qFPZwjehoJx4j3Ntn+JhXsdJrG9pYaX6j/XRz2RmasMUHtNgQD39nrv/VwTWSqK0RNXR8upA=="], + "@octokit/auth-oauth-device/@octokit/types": ["@octokit/types@16.0.0", "", { "dependencies": { "@octokit/openapi-types": "^27.0.0" } }, "sha512-sKq+9r1Mm4efXW1FCk7hFSeJo4QKreL/tTbR0rz/qx/r1Oa2VV83LTA/H/MuCOX7uCIJmQVRKBcbmWoySjAnSg=="], + "@octokit/auth-oauth-user/@octokit/request": ["@octokit/request@10.0.7", "", { "dependencies": { "@octokit/endpoint": "^11.0.2", "@octokit/request-error": "^7.0.2", "@octokit/types": "^16.0.0", "fast-content-type-parse": "^3.0.0", "universal-user-agent": "^7.0.2" } }, "sha512-v93h0i1yu4idj8qFPZwjehoJx4j3Ntn+JhXsdJrG9pYaX6j/XRz2RmasMUHtNgQD39nrv/VwTWSqK0RNXR8upA=="], + "@octokit/auth-oauth-user/@octokit/types": ["@octokit/types@16.0.0", "", { "dependencies": { "@octokit/openapi-types": "^27.0.0" } }, "sha512-sKq+9r1Mm4efXW1FCk7hFSeJo4QKreL/tTbR0rz/qx/r1Oa2VV83LTA/H/MuCOX7uCIJmQVRKBcbmWoySjAnSg=="], - "@octokit/core/@octokit/graphql": ["@octokit/graphql@9.0.3", "", { "dependencies": { "@octokit/request": "^10.0.6", "@octokit/types": "^16.0.0", "universal-user-agent": "^7.0.0" } }, "sha512-grAEuupr/C1rALFnXTv6ZQhFuL1D8G5y8CN04RgrO4FIPMrtm+mcZzFG7dcBm+nq+1ppNixu+Jd78aeJOYxlGA=="], + "@octokit/core/@octokit/graphql": ["@octokit/graphql@7.1.1", "", { "dependencies": { "@octokit/request": "^8.4.1", "@octokit/types": "^13.0.0", "universal-user-agent": "^6.0.0" } }, "sha512-3mkDltSfcDUoa176nlGoA32RGjeWjl3K7F/BwHwRMJUW/IteSa4bnSV8p2ThNkcIcZU2umkZWxwETSSCJf2Q7g=="], + + "@octokit/core/@octokit/types": ["@octokit/types@13.10.0", "", { "dependencies": { "@octokit/openapi-types": "^24.2.0" } }, "sha512-ifLaO34EbbPj0Xgro4G5lP5asESjwHracYJvVaPIyXMuiuXLlhic3S47cBdTb+jfODkTE5YtGCLt3Ay3+J97sA=="], + + "@octokit/core/universal-user-agent": ["universal-user-agent@6.0.1", "", {}, "sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ=="], + + "@octokit/endpoint/@octokit/types": ["@octokit/types@13.10.0", "", { "dependencies": { "@octokit/openapi-types": "^24.2.0" } }, "sha512-ifLaO34EbbPj0Xgro4G5lP5asESjwHracYJvVaPIyXMuiuXLlhic3S47cBdTb+jfODkTE5YtGCLt3Ay3+J97sA=="], - "@octokit/core/@octokit/types": ["@octokit/types@16.0.0", "", { "dependencies": { "@octokit/openapi-types": "^27.0.0" } }, "sha512-sKq+9r1Mm4efXW1FCk7hFSeJo4QKreL/tTbR0rz/qx/r1Oa2VV83LTA/H/MuCOX7uCIJmQVRKBcbmWoySjAnSg=="], + "@octokit/endpoint/universal-user-agent": ["universal-user-agent@6.0.1", "", {}, "sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ=="], - "@octokit/endpoint/@octokit/types": ["@octokit/types@16.0.0", "", { "dependencies": { "@octokit/openapi-types": "^27.0.0" } }, "sha512-sKq+9r1Mm4efXW1FCk7hFSeJo4QKreL/tTbR0rz/qx/r1Oa2VV83LTA/H/MuCOX7uCIJmQVRKBcbmWoySjAnSg=="], + "@octokit/graphql/@octokit/request": ["@octokit/request@10.0.7", "", { "dependencies": { "@octokit/endpoint": "^11.0.2", "@octokit/request-error": "^7.0.2", "@octokit/types": "^16.0.0", "fast-content-type-parse": "^3.0.0", "universal-user-agent": "^7.0.2" } }, "sha512-v93h0i1yu4idj8qFPZwjehoJx4j3Ntn+JhXsdJrG9pYaX6j/XRz2RmasMUHtNgQD39nrv/VwTWSqK0RNXR8upA=="], "@octokit/graphql/@octokit/types": ["@octokit/types@15.0.2", "", { "dependencies": { "@octokit/openapi-types": "^26.0.0" } }, "sha512-rR+5VRjhYSer7sC51krfCctQhVTmjyUMAaShfPB8mscVa8tSoLyon3coxQmXu0ahJoLVWl8dSGD/3OGZlFV44Q=="], + "@octokit/oauth-methods/@octokit/request": ["@octokit/request@10.0.7", "", { "dependencies": { "@octokit/endpoint": "^11.0.2", "@octokit/request-error": "^7.0.2", "@octokit/types": "^16.0.0", "fast-content-type-parse": "^3.0.0", "universal-user-agent": "^7.0.2" } }, "sha512-v93h0i1yu4idj8qFPZwjehoJx4j3Ntn+JhXsdJrG9pYaX6j/XRz2RmasMUHtNgQD39nrv/VwTWSqK0RNXR8upA=="], + + "@octokit/oauth-methods/@octokit/request-error": ["@octokit/request-error@7.1.0", "", { "dependencies": { "@octokit/types": "^16.0.0" } }, "sha512-KMQIfq5sOPpkQYajXHwnhjCC0slzCNScLHs9JafXc4RAJI+9f+jNDlBNaIMTvazOPLgb4BnlhGJOTbnN0wIjPw=="], + "@octokit/oauth-methods/@octokit/types": ["@octokit/types@16.0.0", "", { "dependencies": { "@octokit/openapi-types": "^27.0.0" } }, "sha512-sKq+9r1Mm4efXW1FCk7hFSeJo4QKreL/tTbR0rz/qx/r1Oa2VV83LTA/H/MuCOX7uCIJmQVRKBcbmWoySjAnSg=="], + "@octokit/plugin-paginate-rest/@octokit/core": ["@octokit/core@7.0.6", "", { "dependencies": { "@octokit/auth-token": "^6.0.0", "@octokit/graphql": "^9.0.3", "@octokit/request": "^10.0.6", "@octokit/request-error": "^7.0.2", "@octokit/types": "^16.0.0", "before-after-hook": "^4.0.0", "universal-user-agent": "^7.0.0" } }, "sha512-DhGl4xMVFGVIyMwswXeyzdL4uXD5OGILGX5N8Y+f6W7LhC1Ze2poSNrkF/fedpVDHEEZ+PHFW0vL14I+mm8K3Q=="], + "@octokit/plugin-paginate-rest/@octokit/types": ["@octokit/types@15.0.2", "", { "dependencies": { "@octokit/openapi-types": "^26.0.0" } }, "sha512-rR+5VRjhYSer7sC51krfCctQhVTmjyUMAaShfPB8mscVa8tSoLyon3coxQmXu0ahJoLVWl8dSGD/3OGZlFV44Q=="], + "@octokit/plugin-rest-endpoint-methods/@octokit/core": ["@octokit/core@7.0.6", "", { "dependencies": { "@octokit/auth-token": "^6.0.0", "@octokit/graphql": "^9.0.3", "@octokit/request": "^10.0.6", "@octokit/request-error": "^7.0.2", "@octokit/types": "^16.0.0", "before-after-hook": "^4.0.0", "universal-user-agent": "^7.0.0" } }, "sha512-DhGl4xMVFGVIyMwswXeyzdL4uXD5OGILGX5N8Y+f6W7LhC1Ze2poSNrkF/fedpVDHEEZ+PHFW0vL14I+mm8K3Q=="], + "@octokit/plugin-rest-endpoint-methods/@octokit/types": ["@octokit/types@15.0.2", "", { "dependencies": { "@octokit/openapi-types": "^26.0.0" } }, "sha512-rR+5VRjhYSer7sC51krfCctQhVTmjyUMAaShfPB8mscVa8tSoLyon3coxQmXu0ahJoLVWl8dSGD/3OGZlFV44Q=="], "@octokit/plugin-retry/@octokit/types": ["@octokit/types@6.41.0", "", { "dependencies": { "@octokit/openapi-types": "^12.11.0" } }, "sha512-eJ2jbzjdijiL3B4PrSQaSjuF2sPEQPVCPzBvTHJD9Nz+9dw2SGH4K4xeQJ77YfTq5bRQ+bD8wT11JbeDPmxmGg=="], - "@octokit/request/@octokit/types": ["@octokit/types@16.0.0", "", { "dependencies": { "@octokit/openapi-types": "^27.0.0" } }, "sha512-sKq+9r1Mm4efXW1FCk7hFSeJo4QKreL/tTbR0rz/qx/r1Oa2VV83LTA/H/MuCOX7uCIJmQVRKBcbmWoySjAnSg=="], + "@octokit/request/@octokit/types": ["@octokit/types@13.10.0", "", { "dependencies": { "@octokit/openapi-types": "^24.2.0" } }, "sha512-ifLaO34EbbPj0Xgro4G5lP5asESjwHracYJvVaPIyXMuiuXLlhic3S47cBdTb+jfODkTE5YtGCLt3Ay3+J97sA=="], + + "@octokit/request/universal-user-agent": ["universal-user-agent@6.0.1", "", {}, "sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ=="], - "@octokit/request-error/@octokit/types": ["@octokit/types@16.0.0", "", { "dependencies": { "@octokit/openapi-types": "^27.0.0" } }, "sha512-sKq+9r1Mm4efXW1FCk7hFSeJo4QKreL/tTbR0rz/qx/r1Oa2VV83LTA/H/MuCOX7uCIJmQVRKBcbmWoySjAnSg=="], + "@octokit/request-error/@octokit/types": ["@octokit/types@13.10.0", "", { "dependencies": { "@octokit/openapi-types": "^24.2.0" } }, "sha512-ifLaO34EbbPj0Xgro4G5lP5asESjwHracYJvVaPIyXMuiuXLlhic3S47cBdTb+jfODkTE5YtGCLt3Ay3+J97sA=="], + + "@octokit/rest/@octokit/core": ["@octokit/core@7.0.6", "", { "dependencies": { "@octokit/auth-token": "^6.0.0", "@octokit/graphql": "^9.0.3", "@octokit/request": "^10.0.6", "@octokit/request-error": "^7.0.2", "@octokit/types": "^16.0.0", "before-after-hook": "^4.0.0", "universal-user-agent": "^7.0.0" } }, "sha512-DhGl4xMVFGVIyMwswXeyzdL4uXD5OGILGX5N8Y+f6W7LhC1Ze2poSNrkF/fedpVDHEEZ+PHFW0vL14I+mm8K3Q=="], + + "@octokit/rest/@octokit/plugin-request-log": ["@octokit/plugin-request-log@6.0.0", "", { "peerDependencies": { "@octokit/core": ">=6" } }, "sha512-UkOzeEN3W91/eBq9sPZNQ7sUBvYCqYbrrD8gTbBuGtHEuycE4/awMXcYvx6sVYo7LypPhmQwwpUe4Yyu4QZN5Q=="], "@openauthjs/openauth/@standard-schema/spec": ["@standard-schema/spec@1.0.0-beta.3", "", {}, "sha512-0ifF3BjA1E8SY9C+nUew8RefNOIq0cDlYALPty4rhUm8Rrl6tCM8hBT4bhGhx7I7iXD0uAgt50lgo8dD73ACMw=="], "@openauthjs/openauth/jose": ["jose@5.9.6", "", {}, "sha512-AMlnetc9+CV9asI19zHmrgS/WYsWUwCn2R7RzlbJWD7F9eWYUTGyBmU9o6PxngtLGOiDGPRu+Uc4fhKzbpteZQ=="], - "@opencode-ai/tauri/typescript": ["typescript@5.6.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw=="], + "@opencode-ai/desktop/@actions/artifact": ["@actions/artifact@4.0.0", "", { "dependencies": { "@actions/core": "^1.10.0", "@actions/github": "^6.0.1", "@actions/http-client": "^2.1.0", "@azure/core-http": "^3.0.5", "@azure/storage-blob": "^12.15.0", "@octokit/core": "^5.2.1", "@octokit/plugin-request-log": "^1.0.4", "@octokit/plugin-retry": "^3.0.9", "@octokit/request": "^8.4.1", "@octokit/request-error": "^5.1.1", "@protobuf-ts/plugin": "^2.2.3-alpha.1", "archiver": "^7.0.1", "jwt-decode": "^3.1.2", "unzip-stream": "^0.3.1" } }, "sha512-HCc2jMJRAfviGFAh0FsOR/jNfWhirxl7W6z8zDtttt0GltwxBLdEIjLiweOPFl9WbyJRW1VWnPUSAixJqcWUMQ=="], - "@opencode-ai/web/@shikijs/transformers": ["@shikijs/transformers@3.4.2", "", { "dependencies": { "@shikijs/core": "3.4.2", "@shikijs/types": "3.4.2" } }, "sha512-I5baLVi/ynLEOZoWSAMlACHNnG+yw5HDmse0oe+GW6U1u+ULdEB3UHiVWaHoJSSONV7tlcVxuaMy74sREDkSvg=="], + "@opencode-ai/desktop/typescript": ["typescript@5.6.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw=="], - "@opencode-ai/web/marked": ["marked@15.0.12", "", { "bin": { "marked": "bin/marked.js" } }, "sha512-8dD6FusOQSrpv9Z1rdNMdlSgQOIP880DHqnohobOmYLElGEqAL/JvxvuxZO16r4HtjTlfPRDC1hbvxC9dPN2nA=="], - - "@opencode-ai/web/shiki": ["shiki@3.4.2", "", { "dependencies": { "@shikijs/core": "3.4.2", "@shikijs/engine-javascript": "3.4.2", "@shikijs/engine-oniguruma": "3.4.2", "@shikijs/langs": "3.4.2", "@shikijs/themes": "3.4.2", "@shikijs/types": "3.4.2", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } }, "sha512-wuxzZzQG8kvZndD7nustrNFIKYJ1jJoWIPaBpVe2+KHSvtzMi4SBjOxrigs8qeqce/l3U0cwiC+VAkLKSunHQQ=="], + "@opencode-ai/web/@shikijs/transformers": ["@shikijs/transformers@3.4.2", "", { "dependencies": { "@shikijs/core": "3.4.2", "@shikijs/types": "3.4.2" } }, "sha512-I5baLVi/ynLEOZoWSAMlACHNnG+yw5HDmse0oe+GW6U1u+ULdEB3UHiVWaHoJSSONV7tlcVxuaMy74sREDkSvg=="], "@opentui/solid/@babel/core": ["@babel/core@7.28.0", "", { "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.27.1", "@babel/generator": "^7.28.0", "@babel/helper-compilation-targets": "^7.27.2", "@babel/helper-module-transforms": "^7.27.3", "@babel/helpers": "^7.27.6", "@babel/parser": "^7.28.0", "@babel/template": "^7.27.2", "@babel/traverse": "^7.28.0", "@babel/types": "^7.28.0", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-UlLAnTPrFdNGoFtbSXwcGFQBtQZJCNjaN6hQNP3UPvuNXT1i82N26KL3dZeIpNalWywr9IuQuncaAfUaS1g6sQ=="], @@ -4108,15 +4216,13 @@ "@oslojs/jwt/@oslojs/encoding": ["@oslojs/encoding@0.4.1", "", {}, "sha512-hkjo6MuIK/kQR5CrGNdAPZhS01ZCXuWDRJ187zh6qqF2+yMHZpD9fAYpX8q2bOO6Ryhl3XpCT6kUX76N8hhm4Q=="], - "@parcel/watcher/detect-libc": ["detect-libc@1.0.3", "", { "bin": { "detect-libc": "./bin/detect-libc.js" } }, "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg=="], + "@pierre/diffs/@shikijs/core": ["@shikijs/core@3.20.0", "", { "dependencies": { "@shikijs/types": "3.20.0", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4", "hast-util-to-html": "^9.0.5" } }, "sha512-f2ED7HYV4JEk827mtMDwe/yQ25pRiXZmtHjWF8uzZKuKiEsJR7Ce1nuQ+HhV9FzDcbIo4ObBCD9GPTzNuy9S1g=="], - "@parcel/watcher/node-addon-api": ["node-addon-api@7.1.1", "", {}, "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ=="], + "@pierre/diffs/@shikijs/engine-javascript": ["@shikijs/engine-javascript@3.19.0", "", { "dependencies": { "@shikijs/types": "3.19.0", "@shikijs/vscode-textmate": "^10.0.2", "oniguruma-to-es": "^4.3.4" } }, "sha512-ZfWJNm2VMhKkQIKT9qXbs76RRcT0SF/CAvEz0+RkpUDAoDaCx0uFdCGzSRiD9gSlhm6AHkjdieOBJMaO2eC1rQ=="], - "@pierre/precision-diffs/@shikijs/core": ["@shikijs/core@3.15.0", "", { "dependencies": { "@shikijs/types": "3.15.0", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4", "hast-util-to-html": "^9.0.5" } }, "sha512-8TOG6yG557q+fMsSVa8nkEDOZNTSxjbbR8l6lF2gyr6Np+jrPlslqDxQkN6rMXCECQ3isNPZAGszAfYoJOPGlg=="], + "@pierre/diffs/@shikijs/transformers": ["@shikijs/transformers@3.19.0", "", { "dependencies": { "@shikijs/core": "3.19.0", "@shikijs/types": "3.19.0" } }, "sha512-e6vwrsyw+wx4OkcrDbL+FVCxwx8jgKiCoXzakVur++mIWVcgpzIi8vxf4/b4dVTYrV/nUx5RjinMf4tq8YV8Fw=="], - "@pierre/precision-diffs/@shikijs/transformers": ["@shikijs/transformers@3.15.0", "", { "dependencies": { "@shikijs/core": "3.15.0", "@shikijs/types": "3.15.0" } }, "sha512-Hmwip5ovvSkg+Kc41JTvSHHVfCYF+C8Cp1omb5AJj4Xvd+y9IXz2rKJwmFRGsuN0vpHxywcXJ1+Y4B9S7EG1/A=="], - - "@pierre/precision-diffs/shiki": ["shiki@3.15.0", "", { "dependencies": { "@shikijs/core": "3.15.0", "@shikijs/engine-javascript": "3.15.0", "@shikijs/engine-oniguruma": "3.15.0", "@shikijs/langs": "3.15.0", "@shikijs/themes": "3.15.0", "@shikijs/types": "3.15.0", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } }, "sha512-kLdkY6iV3dYbtPwS9KXU7mjfmDm25f5m0IPNFnaXO7TBPcvbUOY72PYXSuSqDzwp+vlH/d7MXpHlKO/x+QoLXw=="], + "@pierre/diffs/shiki": ["shiki@3.19.0", "", { "dependencies": { "@shikijs/core": "3.19.0", "@shikijs/engine-javascript": "3.19.0", "@shikijs/engine-oniguruma": "3.19.0", "@shikijs/langs": "3.19.0", "@shikijs/themes": "3.19.0", "@shikijs/types": "3.19.0", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } }, "sha512-77VJr3OR/VUZzPiStyRhADmO2jApMM0V2b1qf0RpfWya8Zr1PeZev5AEpPGAAKWdiYUtcZGBE4F5QvJml1PvWA=="], "@poppinss/dumper/supports-color": ["supports-color@10.2.2", "", {}, "sha512-SS+jx45GF1QjgEXQx4NJZV9ImqmO2NPz5FNsIHrsDjh2YsHnawpan7SNQ1o8NuhrbHZy9AZhIoCUiCeaW/C80g=="], @@ -4124,6 +4230,14 @@ "@rollup/pluginutils/estree-walker": ["estree-walker@2.0.2", "", {}, "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w=="], + "@shikijs/engine-javascript/@shikijs/types": ["@shikijs/types@3.20.0", "", { "dependencies": { "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } }, "sha512-lhYAATn10nkZcBQ0BlzSbJA3wcmL5MXUUF8d2Zzon6saZDlToKaiRX60n2+ZaHJCmXEcZRWNzn+k9vplr8Jhsw=="], + + "@shikijs/engine-oniguruma/@shikijs/types": ["@shikijs/types@3.20.0", "", { "dependencies": { "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } }, "sha512-lhYAATn10nkZcBQ0BlzSbJA3wcmL5MXUUF8d2Zzon6saZDlToKaiRX60n2+ZaHJCmXEcZRWNzn+k9vplr8Jhsw=="], + + "@shikijs/langs/@shikijs/types": ["@shikijs/types@3.20.0", "", { "dependencies": { "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } }, "sha512-lhYAATn10nkZcBQ0BlzSbJA3wcmL5MXUUF8d2Zzon6saZDlToKaiRX60n2+ZaHJCmXEcZRWNzn+k9vplr8Jhsw=="], + + "@shikijs/themes/@shikijs/types": ["@shikijs/types@3.20.0", "", { "dependencies": { "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } }, "sha512-lhYAATn10nkZcBQ0BlzSbJA3wcmL5MXUUF8d2Zzon6saZDlToKaiRX60n2+ZaHJCmXEcZRWNzn+k9vplr8Jhsw=="], + "@slack/bolt/path-to-regexp": ["path-to-regexp@8.3.0", "", {}, "sha512-7jdwVIRtsP8MYpdXSwOS0YdD0Du+qOoF/AEPIt88PcCFrZCzx41oxku1jD88hZBwbNUIEfpqvuhjFaMAqMTWnA=="], "@slack/oauth/@slack/logger": ["@slack/logger@3.0.0", "", { "dependencies": { "@types/node": ">=12.0.0" } }, "sha512-DTuBFbqu4gGfajREEMrkq5jBhcnskinhr4+AnfJEk48zhVeEv3XnUKGIX98B74kxhYsIMfApGGySTn7V3b5yBA=="], @@ -4140,6 +4254,10 @@ "@slack/web-api/p-queue": ["p-queue@6.6.2", "", { "dependencies": { "eventemitter3": "^4.0.4", "p-timeout": "^3.2.0" } }, "sha512-RwFpb72c/BhQLEXIZ5K2e+AhgNVmIejGlTgiB9MzZ0e93GRvqZ7uSi0dvRF7/XIXDeNkra2fNHBxTyPDGySpjQ=="], + "@smithy/eventstream-codec/@smithy/types": ["@smithy/types@4.11.0", "", { "dependencies": { "tslib": "^2.6.2" } }, "sha512-mlrmL0DRDVe3mNrjTcVcZEgkFmufITfUAPBEA+AHYiIeYyJebso/He1qLbP3PssRe22KUzLRpQSdBPbXdgZ2VA=="], + + "@smithy/eventstream-serde-universal/@smithy/eventstream-codec": ["@smithy/eventstream-codec@4.2.5", "", { "dependencies": { "@aws-crypto/crc32": "5.2.0", "@smithy/types": "^4.9.0", "@smithy/util-hex-encoding": "^4.2.0", "tslib": "^2.6.2" } }, "sha512-Ogt4Zi9hEbIP17oQMd68qYOHUzmH47UkK7q7Gl55iIm9oKt27MUGrC5JfpMroeHjdkOliOA4Qt3NQ1xMq/nrlA=="], + "@solidjs/start/esbuild": ["esbuild@0.25.12", "", { "optionalDependencies": { "@esbuild/aix-ppc64": "0.25.12", "@esbuild/android-arm": "0.25.12", "@esbuild/android-arm64": "0.25.12", "@esbuild/android-x64": "0.25.12", "@esbuild/darwin-arm64": "0.25.12", "@esbuild/darwin-x64": "0.25.12", "@esbuild/freebsd-arm64": "0.25.12", "@esbuild/freebsd-x64": "0.25.12", "@esbuild/linux-arm": "0.25.12", "@esbuild/linux-arm64": "0.25.12", "@esbuild/linux-ia32": "0.25.12", "@esbuild/linux-loong64": "0.25.12", "@esbuild/linux-mips64el": "0.25.12", "@esbuild/linux-ppc64": "0.25.12", "@esbuild/linux-riscv64": "0.25.12", "@esbuild/linux-s390x": "0.25.12", "@esbuild/linux-x64": "0.25.12", "@esbuild/netbsd-arm64": "0.25.12", "@esbuild/netbsd-x64": "0.25.12", "@esbuild/openbsd-arm64": "0.25.12", "@esbuild/openbsd-x64": "0.25.12", "@esbuild/openharmony-arm64": "0.25.12", "@esbuild/sunos-x64": "0.25.12", "@esbuild/win32-arm64": "0.25.12", "@esbuild/win32-ia32": "0.25.12", "@esbuild/win32-x64": "0.25.12" }, "bin": { "esbuild": "bin/esbuild" } }, "sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg=="], "@solidjs/start/path-to-regexp": ["path-to-regexp@8.3.0", "", {}, "sha512-7jdwVIRtsP8MYpdXSwOS0YdD0Du+qOoF/AEPIt88PcCFrZCzx41oxku1jD88hZBwbNUIEfpqvuhjFaMAqMTWnA=="], @@ -4148,6 +4266,8 @@ "@solidjs/start/vite": ["vite@7.1.10", "", { "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.5.0", "picomatch": "^4.0.3", "postcss": "^8.5.6", "rollup": "^4.43.0", "tinyglobby": "^0.2.15" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^20.19.0 || >=22.12.0", "jiti": ">=1.21.0", "less": "^4.0.0", "lightningcss": "^1.21.0", "sass": "^1.70.0", "sass-embedded": "^1.70.0", "stylus": ">=0.54.8", "sugarss": "^5.0.0", "terser": "^5.16.0", "tsx": "^4.8.1", "yaml": "^2.4.2" }, "optionalPeers": ["@types/node", "jiti", "less", "lightningcss", "sass", "sass-embedded", "stylus", "sugarss", "terser", "tsx", "yaml"], "bin": { "vite": "bin/vite.js" } }, "sha512-CmuvUBzVJ/e3HGxhg6cYk88NGgTnBoOo7ogtfJJ0fefUWAxN/WDSUa50o+oVBxuIhO8FoEZW0j2eW7sfjs5EtA=="], + "@tailwindcss/oxide/detect-libc": ["detect-libc@2.1.2", "", {}, "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ=="], + "@tailwindcss/oxide-wasm32-wasi/@emnapi/core": ["@emnapi/core@1.7.1", "", { "dependencies": { "@emnapi/wasi-threads": "1.1.0", "tslib": "^2.4.0" }, "bundled": true }, "sha512-o1uhUASyo921r2XtHYOHy7gdkGLge8ghBEQHMWmyJFoXlpU58kIrhhN3w26lpQb6dspetweapMn2CSNwQ8I4wg=="], "@tailwindcss/oxide-wasm32-wasi/@emnapi/runtime": ["@emnapi/runtime@1.7.1", "", { "dependencies": { "tslib": "^2.4.0" }, "bundled": true }, "sha512-PVtJr5CmLwYAU9PZDMITZoR5iAOShYREoR45EyyLrbntV50mdePTgUn4AmOw90Ifcj+x2kRjdzr1HP3RrNiHGA=="], @@ -4162,8 +4282,6 @@ "accepts/mime-types": ["mime-types@2.1.35", "", { "dependencies": { "mime-db": "1.52.0" } }, "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw=="], - "ai/@ai-sdk/provider-utils": ["@ai-sdk/provider-utils@3.0.17", "", { "dependencies": { "@ai-sdk/provider": "2.0.0", "@standard-schema/spec": "^1.0.0", "eventsource-parser": "^3.0.6" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-TR3Gs4I3Tym4Ll+EPdzRdvo/rc8Js6c4nVhFLuvGLX/Y4V9ZcQMa/HTiYsHEgmYrf1zVi6Q145UEZUfleOwOjw=="], - "ansi-align/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=="], "anymatch/picomatch": ["picomatch@2.3.1", "", {}, "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA=="], @@ -4176,7 +4294,7 @@ "astro/diff": ["diff@5.2.0", "", {}, "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A=="], - "astro/sharp": ["sharp@0.33.5", "", { "dependencies": { "color": "^4.2.3", "detect-libc": "^2.0.3", "semver": "^7.6.3" }, "optionalDependencies": { "@img/sharp-darwin-arm64": "0.33.5", "@img/sharp-darwin-x64": "0.33.5", "@img/sharp-libvips-darwin-arm64": "1.0.4", "@img/sharp-libvips-darwin-x64": "1.0.4", "@img/sharp-libvips-linux-arm": "1.0.5", "@img/sharp-libvips-linux-arm64": "1.0.4", "@img/sharp-libvips-linux-s390x": "1.0.4", "@img/sharp-libvips-linux-x64": "1.0.4", "@img/sharp-libvips-linuxmusl-arm64": "1.0.4", "@img/sharp-libvips-linuxmusl-x64": "1.0.4", "@img/sharp-linux-arm": "0.33.5", "@img/sharp-linux-arm64": "0.33.5", "@img/sharp-linux-s390x": "0.33.5", "@img/sharp-linux-x64": "0.33.5", "@img/sharp-linuxmusl-arm64": "0.33.5", "@img/sharp-linuxmusl-x64": "0.33.5", "@img/sharp-wasm32": "0.33.5", "@img/sharp-win32-ia32": "0.33.5", "@img/sharp-win32-x64": "0.33.5" } }, "sha512-haPVm1EkS9pgvHrQ/F3Xy+hgcuMV0Wm9vfIBSiwZ05k+xgb0PkBQpGsAA/oWdDobNaZTH5ppvHtzCFbnSEwHVw=="], + "astro/semver": ["semver@7.7.2", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA=="], "astro/shiki": ["shiki@3.15.0", "", { "dependencies": { "@shikijs/core": "3.15.0", "@shikijs/engine-javascript": "3.15.0", "@shikijs/engine-oniguruma": "3.15.0", "@shikijs/langs": "3.15.0", "@shikijs/themes": "3.15.0", "@shikijs/types": "3.15.0", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } }, "sha512-kLdkY6iV3dYbtPwS9KXU7mjfmDm25f5m0IPNFnaXO7TBPcvbUOY72PYXSuSqDzwp+vlH/d7MXpHlKO/x+QoLXw=="], @@ -4186,21 +4304,21 @@ "astro/zod": ["zod@3.25.76", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="], + "aws-sdk/events": ["events@1.1.1", "", {}, "sha512-kEcvvCBByWXGnZy6JUlgAp2gBIUjfCAV6P6TgT1/aaQKcmuAEC4OZTV1I4EWQLz2gxZw76atuVyvHhTxvi0Flw=="], + "babel-plugin-jsx-dom-expressions/@babel/helper-module-imports": ["@babel/helper-module-imports@7.18.6", "", { "dependencies": { "@babel/types": "^7.18.6" } }, "sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA=="], "babel-plugin-module-resolver/glob": ["glob@9.3.5", "", { "dependencies": { "fs.realpath": "^1.0.0", "minimatch": "^8.0.2", "minipass": "^4.2.4", "path-scurry": "^1.6.1" } }, "sha512-e1LleDykUz2Iu+MTYdkSsuWX8lvAjAcs0Xef0lNIu0S2wOAzuTxCJtcd9S3cijlwYF18EsU3rzb8jPVobxDh9Q=="], - "bl/buffer": ["buffer@5.7.1", "", { "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" } }, "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ=="], - - "bl/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=="], - "body-parser/debug": ["debug@2.6.9", "", { "dependencies": { "ms": "2.0.0" } }, "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA=="], "body-parser/iconv-lite": ["iconv-lite@0.4.24", "", { "dependencies": { "safer-buffer": ">= 2.1.2 < 3" } }, "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA=="], "body-parser/qs": ["qs@6.13.0", "", { "dependencies": { "side-channel": "^1.0.6" } }, "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg=="], - "boxen/chalk": ["chalk@5.6.2", "", {}, "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA=="], + "bun-webgpu/@webgpu/types": ["@webgpu/types@0.1.66", "", {}, "sha512-YA2hLrwLpDsRueNDXIMqN9NTzD6bCDkuXbOSe0heS+f8YE8usA6Gbv1prj81pzVHrbaAma7zObnIC+I6/sXJgA=="], + + "c12/chokidar": ["chokidar@5.0.0", "", { "dependencies": { "readdirp": "^5.0.0" } }, "sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw=="], "clean-css/source-map": ["source-map@0.6.1", "", {}, "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="], @@ -4218,8 +4336,14 @@ "editorconfig/minimatch": ["minimatch@9.0.1", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-0jWhJpD/MdhPXwPuiRkCbfYfSKp2qnn2eOc279qI7f+osl/l+prKSrvhg157zSYvx/1nmgn2NqdT6k2Z7zSH9w=="], + "editorconfig/semver": ["semver@7.7.2", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA=="], + + "engine.io-client/ws": ["ws@8.18.3", "", { "peerDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": ">=5.0.2" }, "optionalPeers": ["bufferutil", "utf-8-validate"] }, "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg=="], + "es-get-iterator/isarray": ["isarray@2.0.5", "", {}, "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw=="], + "esbuild-plugin-copy/chalk": ["chalk@4.1.2", "", { "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA=="], + "esbuild-plugin-copy/chokidar": ["chokidar@3.6.0", "", { "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", "glob-parent": "~5.1.2", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", "normalize-path": "~3.0.0", "readdirp": "~3.6.0" }, "optionalDependencies": { "fsevents": "~2.3.2" } }, "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw=="], "execa/is-stream": ["is-stream@3.0.0", "", {}, "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA=="], @@ -4232,13 +4356,15 @@ "express/qs": ["qs@6.13.0", "", { "dependencies": { "side-channel": "^1.0.6" } }, "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg=="], + "fetch-blob/web-streams-polyfill": ["web-streams-polyfill@3.3.3", "", {}, "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw=="], + "finalhandler/debug": ["debug@2.6.9", "", { "dependencies": { "ms": "2.0.0" } }, "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA=="], "form-data/mime-types": ["mime-types@2.1.35", "", { "dependencies": { "mime-db": "1.52.0" } }, "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw=="], - "gaxios/is-stream": ["is-stream@2.0.1", "", {}, "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg=="], + "gaxios/node-fetch": ["node-fetch@3.3.2", "", { "dependencies": { "data-uri-to-buffer": "^4.0.0", "fetch-blob": "^3.1.4", "formdata-polyfill": "^4.0.10" } }, "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA=="], - "gaxios/uuid": ["uuid@9.0.1", "", { "bin": { "uuid": "dist/bin/uuid" } }, "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA=="], + "gel/semver": ["semver@7.7.2", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA=="], "glob/minimatch": ["minimatch@10.1.1", "", { "dependencies": { "@isaacs/brace-expansion": "^5.0.0" } }, "sha512-enIvLvRAFZYXJzkCYG5RKmPfrFArdLv+R+lbQ53BmIMLIry74bjKzX6iHAm8WYamJkhSSEabrWN5D97XnKObjQ=="], @@ -4254,8 +4380,14 @@ "jsonwebtoken/jws": ["jws@3.2.2", "", { "dependencies": { "jwa": "^1.4.1", "safe-buffer": "^5.0.1" } }, "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA=="], + "jsonwebtoken/semver": ["semver@7.7.2", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA=="], + + "katex/commander": ["commander@8.3.0", "", {}, "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww=="], + "lazystream/readable-stream": ["readable-stream@2.3.8", "", { "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", "isarray": "~1.0.0", "process-nextick-args": "~2.0.0", "safe-buffer": "~5.1.1", "string_decoder": "~1.1.1", "util-deprecate": "~1.0.1" } }, "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA=="], + "lightningcss/detect-libc": ["detect-libc@2.1.2", "", {}, "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ=="], + "md-to-react-email/marked": ["marked@7.0.4", "", { "bin": { "marked": "bin/marked.js" } }, "sha512-t8eP0dXRJMtMvBojtkcsA7n48BkauktUKzfkPSCq85ZMTJ0v76Rke4DYz01omYpPTUh4p/f7HePgRo3ebG8+QQ=="], "mdast-util-find-and-replace/escape-string-regexp": ["escape-string-regexp@5.0.0", "", {}, "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw=="], @@ -4264,8 +4396,6 @@ "miniflare/acorn": ["acorn@8.14.0", "", { "bin": { "acorn": "bin/acorn" } }, "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA=="], - "miniflare/sharp": ["sharp@0.33.5", "", { "dependencies": { "color": "^4.2.3", "detect-libc": "^2.0.3", "semver": "^7.6.3" }, "optionalDependencies": { "@img/sharp-darwin-arm64": "0.33.5", "@img/sharp-darwin-x64": "0.33.5", "@img/sharp-libvips-darwin-arm64": "1.0.4", "@img/sharp-libvips-darwin-x64": "1.0.4", "@img/sharp-libvips-linux-arm": "1.0.5", "@img/sharp-libvips-linux-arm64": "1.0.4", "@img/sharp-libvips-linux-s390x": "1.0.4", "@img/sharp-libvips-linux-x64": "1.0.4", "@img/sharp-libvips-linuxmusl-arm64": "1.0.4", "@img/sharp-libvips-linuxmusl-x64": "1.0.4", "@img/sharp-linux-arm": "0.33.5", "@img/sharp-linux-arm64": "0.33.5", "@img/sharp-linux-s390x": "0.33.5", "@img/sharp-linux-x64": "0.33.5", "@img/sharp-linuxmusl-arm64": "0.33.5", "@img/sharp-linuxmusl-x64": "0.33.5", "@img/sharp-wasm32": "0.33.5", "@img/sharp-win32-ia32": "0.33.5", "@img/sharp-win32-x64": "0.33.5" } }, "sha512-haPVm1EkS9pgvHrQ/F3Xy+hgcuMV0Wm9vfIBSiwZ05k+xgb0PkBQpGsAA/oWdDobNaZTH5ppvHtzCFbnSEwHVw=="], - "miniflare/undici": ["undici@7.14.0", "", {}, "sha512-Vqs8HTzjpQXZeXdpsfChQTlafcMQaaIwnGwLam1wudSSjlJeQ3bw1j+TLPePgrCnCpUXx7Ba5Pdpf5OBih62NQ=="], "miniflare/zod": ["zod@3.22.3", "", {}, "sha512-EjIevzuJRiRPbVH4mGc8nApb/lVLKVpmUhAaR5R5doKGfAnGJ6Gr3CViAVjP+4FWSxCsybeWQdcgCtbX+7oZug=="], @@ -4278,11 +4408,11 @@ "nypm/tinyexec": ["tinyexec@1.0.2", "", {}, "sha512-W/KYk+NFhkmsYpuHq5JykngiOCnxeVL8v8dFnqxSD8qEEdRfXk1SDM6JzNqcERbcGYj9tMrDQBYV9cjgnunFIg=="], - "opencode/@ai-sdk/anthropic": ["@ai-sdk/anthropic@2.0.50", "", { "dependencies": { "@ai-sdk/provider": "2.0.0", "@ai-sdk/provider-utils": "3.0.18" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-21PaHfoLmouOXXNINTsZJsMw+wE5oLR2He/1kq/sKokTVKyq7ObGT1LDk6ahwxaz/GoaNaGankMh+EgVcdv2Cw=="], + "opencode/@ai-sdk/anthropic": ["@ai-sdk/anthropic@2.0.57", "", { "dependencies": { "@ai-sdk/provider": "2.0.1", "@ai-sdk/provider-utils": "3.0.20" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-DREpYqW2pylgaj69gZ+K8u92bo9DaMgFdictYnY+IwYeY3bawQ4zI7l/o1VkDsBDljAx8iYz5lPURwVZNu+Xpg=="], - "opencode/@ai-sdk/openai": ["@ai-sdk/openai@2.0.71", "", { "dependencies": { "@ai-sdk/provider": "2.0.0", "@ai-sdk/provider-utils": "3.0.17" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-tg+gj+R0z/On9P4V7hy7/7o04cQPjKGayMCL3gzWD/aNGjAKkhEnaocuNDidSnghizt8g2zJn16cAuAolnW+qQ=="], + "opencode/@ai-sdk/openai": ["@ai-sdk/openai@2.0.89", "", { "dependencies": { "@ai-sdk/provider": "2.0.1", "@ai-sdk/provider-utils": "3.0.20" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-4+qWkBCbL9HPKbgrUO/F2uXZ8GqrYxHa8SWEYIzxEJ9zvWw3ISr3t1/27O1i8MGSym+PzEyHBT48EV4LAwWaEw=="], - "opencode/@ai-sdk/openai-compatible": ["@ai-sdk/openai-compatible@1.0.27", "", { "dependencies": { "@ai-sdk/provider": "2.0.0", "@ai-sdk/provider-utils": "3.0.17" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-bpYruxVLhrTbVH6CCq48zMJNeHu6FmHtEedl9FXckEgcIEAi036idFhJlcRwC1jNCwlacbzb8dPD7OAH1EKJaQ=="], + "opencode/@ai-sdk/openai-compatible": ["@ai-sdk/openai-compatible@1.0.30", "", { "dependencies": { "@ai-sdk/provider": "2.0.1", "@ai-sdk/provider-utils": "3.0.20" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-thubwhRtv9uicAxSWwNpinM7hiL/0CkhL/ymPaHuKvI494J7HIzn8KQZQ2ymRz284WTIZnI7VMyyejxW4RMM6w=="], "opencontrol/@modelcontextprotocol/sdk": ["@modelcontextprotocol/sdk@1.6.1", "", { "dependencies": { "content-type": "^1.0.5", "cors": "^2.8.5", "eventsource": "^3.0.2", "express": "^5.0.1", "express-rate-limit": "^7.5.0", "pkce-challenge": "^4.1.0", "raw-body": "^3.0.0", "zod": "^3.23.8", "zod-to-json-schema": "^3.24.1" } }, "sha512-oxzMzYCkZHMntzuyerehK3fV6A2Kwh5BD6CGEJSVDU2QNEhfLOptf2X7esQgaHZXHZY0oHmMsOtIDLP71UJXgA=="], @@ -4296,10 +4426,6 @@ "openid-client/jose": ["jose@4.15.9", "", {}, "sha512-1vUQX+IdDMVPj4k8kOxgUqlcK518yluMuGZwqlr44FS1ppZB/5GWh4rZG89erpOBOJjU/OBsnCVFfapsRz6nEA=="], - "opentui-spinner/@opentui/core": ["@opentui/core@0.1.60", "", { "dependencies": { "bun-ffi-structs": "0.1.2", "diff": "8.0.2", "jimp": "1.6.0", "yoga-layout": "3.2.1" }, "optionalDependencies": { "@dimforge/rapier2d-simd-compat": "^0.17.3", "@opentui/core-darwin-arm64": "0.1.60", "@opentui/core-darwin-x64": "0.1.60", "@opentui/core-linux-arm64": "0.1.60", "@opentui/core-linux-x64": "0.1.60", "@opentui/core-win32-arm64": "0.1.60", "@opentui/core-win32-x64": "0.1.60", "bun-webgpu": "0.1.4", "planck": "^1.4.2", "three": "0.177.0" }, "peerDependencies": { "web-tree-sitter": "0.25.10" } }, "sha512-28jphd0AJo48uvEuKXcT9pJhgAu8I2rEJhPt25cc5ipJ2iw/eDk1uoxrbID80MPDqgOEzN21vXmzXwCd6ao+hg=="], - - "opentui-spinner/@opentui/solid": ["@opentui/solid@0.1.60", "", { "dependencies": { "@babel/core": "7.28.0", "@babel/preset-typescript": "7.27.1", "@opentui/core": "0.1.60", "babel-plugin-module-resolver": "5.0.2", "babel-preset-solid": "1.9.9", "s-js": "^0.4.9" }, "peerDependencies": { "solid-js": "1.9.9" } }, "sha512-pn91stzAHNGWaNL6h39q55bq3G1/DLqxKtT3wVsRAV68dHfPpwmqikX1nEJZK8OU84ZTPS9Ly9fz8po2Mot2uQ=="], - "p-locate/p-limit": ["p-limit@2.3.0", "", { "dependencies": { "p-try": "^2.0.0" } }, "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w=="], "parse-bmfont-xml/xml2js": ["xml2js@0.5.0", "", { "dependencies": { "sax": ">=0.6.0", "xmlbuilder": "~11.0.0" } }, "sha512-drPFnkQJik/O+uPKpqSgr22mpuFHqKdbS835iAQrUC73L2F5WkboIRd63ai/2Yg6I1jzifPFKH2NTK+cfglkIA=="], @@ -4314,9 +4440,9 @@ "pkg-up/find-up": ["find-up@3.0.0", "", { "dependencies": { "locate-path": "^3.0.0" } }, "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg=="], - "postcss-load-config/lilconfig": ["lilconfig@3.1.3", "", {}, "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw=="], + "playwright/fsevents": ["fsevents@2.3.2", "", { "os": "darwin" }, "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA=="], - "prebuild-install/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=="], + "postcss-load-config/lilconfig": ["lilconfig@3.1.3", "", {}, "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw=="], "prompts/kleur": ["kleur@3.0.3", "", {}, "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w=="], @@ -4324,10 +4450,10 @@ "readable-stream/buffer": ["buffer@6.0.3", "", { "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" } }, "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA=="], - "readable-stream/events": ["events@3.3.0", "", {}, "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q=="], - "readdir-glob/minimatch": ["minimatch@5.1.6", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g=="], + "rimraf/glob": ["glob@10.5.0", "", { "dependencies": { "foreground-child": "^3.1.0", "jackspeak": "^3.1.2", "minimatch": "^9.0.4", "minipass": "^7.1.2", "package-json-from-dist": "^1.0.0", "path-scurry": "^1.11.1" }, "bin": { "glob": "dist/esm/bin.mjs" } }, "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg=="], + "router/path-to-regexp": ["path-to-regexp@8.3.0", "", {}, "sha512-7jdwVIRtsP8MYpdXSwOS0YdD0Du+qOoF/AEPIt88PcCFrZCzx41oxku1jD88hZBwbNUIEfpqvuhjFaMAqMTWnA=="], "safe-array-concat/isarray": ["isarray@2.0.5", "", {}, "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw=="], @@ -4340,6 +4466,14 @@ "send/mime": ["mime@1.6.0", "", { "bin": { "mime": "cli.js" } }, "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg=="], + "sharp/detect-libc": ["detect-libc@2.1.2", "", {}, "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ=="], + + "sharp/semver": ["semver@7.7.2", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA=="], + + "shiki/@shikijs/core": ["@shikijs/core@3.20.0", "", { "dependencies": { "@shikijs/types": "3.20.0", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4", "hast-util-to-html": "^9.0.5" } }, "sha512-f2ED7HYV4JEk827mtMDwe/yQ25pRiXZmtHjWF8uzZKuKiEsJR7Ce1nuQ+HhV9FzDcbIo4ObBCD9GPTzNuy9S1g=="], + + "shiki/@shikijs/types": ["@shikijs/types@3.20.0", "", { "dependencies": { "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } }, "sha512-lhYAATn10nkZcBQ0BlzSbJA3wcmL5MXUUF8d2Zzon6saZDlToKaiRX60n2+ZaHJCmXEcZRWNzn+k9vplr8Jhsw=="], + "sitemap/sax": ["sax@1.4.3", "", {}, "sha512-yqYn1JhPczigF94DMS+shiDMjDowYO6y9+wB/4WgO0Y19jWYk0lQ4tuG5KI7kj4FTp1wxPj5IFfcrz/s1c3jjQ=="], "source-map-support/source-map": ["source-map@0.6.1", "", {}, "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="], @@ -4372,11 +4506,9 @@ "unifont/ofetch": ["ofetch@1.5.1", "", { "dependencies": { "destr": "^2.0.5", "node-fetch-native": "^1.6.7", "ufo": "^1.6.1" } }, "sha512-2W4oUZlVaqAPAil6FUg/difl6YhqhUR7x2eZY4bQCko22UXg3hptq9KLQdqFClV+Wu85UX7hNtdGTngi/1BxcA=="], - "uri-js/punycode": ["punycode@2.3.1", "", {}, "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg=="], - "utif2/pako": ["pako@1.0.11", "", {}, "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw=="], - "vite-plugin-icons-spritesheet/chalk": ["chalk@5.6.2", "", {}, "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA=="], + "vitest/tinyexec": ["tinyexec@1.0.2", "", {}, "sha512-W/KYk+NFhkmsYpuHq5JykngiOCnxeVL8v8dFnqxSD8qEEdRfXk1SDM6JzNqcERbcGYj9tMrDQBYV9cjgnunFIg=="], "vitest/vite": ["vite@7.1.10", "", { "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.5.0", "picomatch": "^4.0.3", "postcss": "^8.5.6", "rollup": "^4.43.0", "tinyglobby": "^0.2.15" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^20.19.0 || >=22.12.0", "jiti": ">=1.21.0", "less": "^4.0.0", "lightningcss": "^1.21.0", "sass": "^1.70.0", "sass-embedded": "^1.70.0", "stylus": ">=0.54.8", "sugarss": "^5.0.0", "terser": "^5.16.0", "tsx": "^4.8.1", "yaml": "^2.4.2" }, "optionalPeers": ["@types/node", "jiti", "less", "lightningcss", "sass", "sass-embedded", "stylus", "sugarss", "terser", "tsx", "yaml"], "bin": { "vite": "bin/vite.js" } }, "sha512-CmuvUBzVJ/e3HGxhg6cYk88NGgTnBoOo7ogtfJJ0fefUWAxN/WDSUa50o+oVBxuIhO8FoEZW0j2eW7sfjs5EtA=="], @@ -4398,46 +4530,14 @@ "zod-to-ts/zod": ["zod@3.25.76", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="], - "@actions/artifact/@octokit/core/@octokit/auth-token": ["@octokit/auth-token@4.0.0", "", {}, "sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA=="], - - "@actions/artifact/@octokit/core/@octokit/graphql": ["@octokit/graphql@7.1.1", "", { "dependencies": { "@octokit/request": "^8.4.1", "@octokit/types": "^13.0.0", "universal-user-agent": "^6.0.0" } }, "sha512-3mkDltSfcDUoa176nlGoA32RGjeWjl3K7F/BwHwRMJUW/IteSa4bnSV8p2ThNkcIcZU2umkZWxwETSSCJf2Q7g=="], - - "@actions/artifact/@octokit/core/@octokit/types": ["@octokit/types@13.10.0", "", { "dependencies": { "@octokit/openapi-types": "^24.2.0" } }, "sha512-ifLaO34EbbPj0Xgro4G5lP5asESjwHracYJvVaPIyXMuiuXLlhic3S47cBdTb+jfODkTE5YtGCLt3Ay3+J97sA=="], - - "@actions/artifact/@octokit/core/before-after-hook": ["before-after-hook@2.2.3", "", {}, "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ=="], - - "@actions/artifact/@octokit/core/universal-user-agent": ["universal-user-agent@6.0.1", "", {}, "sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ=="], - - "@actions/artifact/@octokit/request/@octokit/endpoint": ["@octokit/endpoint@9.0.6", "", { "dependencies": { "@octokit/types": "^13.1.0", "universal-user-agent": "^6.0.0" } }, "sha512-H1fNTMA57HbkFESSt3Y9+FBICv+0jFceJFPWDePYlR/iMGrwM5ph+Dd4XRQs+8X+PUFURLQgX9ChPfhJ/1uNQw=="], + "@actions/artifact/@actions/core/@actions/exec": ["@actions/exec@2.0.0", "", { "dependencies": { "@actions/io": "^2.0.0" } }, "sha512-k8ngrX2voJ/RIN6r9xB82NVqKpnMRtxDoiO+g3olkIUpQNqjArXrCQceduQZCQj3P3xm32pChRLqRrtXTlqhIw=="], - "@actions/artifact/@octokit/request/@octokit/types": ["@octokit/types@13.10.0", "", { "dependencies": { "@octokit/openapi-types": "^24.2.0" } }, "sha512-ifLaO34EbbPj0Xgro4G5lP5asESjwHracYJvVaPIyXMuiuXLlhic3S47cBdTb+jfODkTE5YtGCLt3Ay3+J97sA=="], - - "@actions/artifact/@octokit/request/universal-user-agent": ["universal-user-agent@6.0.1", "", {}, "sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ=="], - - "@actions/artifact/@octokit/request-error/@octokit/types": ["@octokit/types@13.10.0", "", { "dependencies": { "@octokit/openapi-types": "^24.2.0" } }, "sha512-ifLaO34EbbPj0Xgro4G5lP5asESjwHracYJvVaPIyXMuiuXLlhic3S47cBdTb+jfODkTE5YtGCLt3Ay3+J97sA=="], - - "@actions/github/@octokit/core/@octokit/auth-token": ["@octokit/auth-token@4.0.0", "", {}, "sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA=="], - - "@actions/github/@octokit/core/@octokit/graphql": ["@octokit/graphql@7.1.1", "", { "dependencies": { "@octokit/request": "^8.4.1", "@octokit/types": "^13.0.0", "universal-user-agent": "^6.0.0" } }, "sha512-3mkDltSfcDUoa176nlGoA32RGjeWjl3K7F/BwHwRMJUW/IteSa4bnSV8p2ThNkcIcZU2umkZWxwETSSCJf2Q7g=="], - - "@actions/github/@octokit/core/@octokit/types": ["@octokit/types@13.10.0", "", { "dependencies": { "@octokit/openapi-types": "^24.2.0" } }, "sha512-ifLaO34EbbPj0Xgro4G5lP5asESjwHracYJvVaPIyXMuiuXLlhic3S47cBdTb+jfODkTE5YtGCLt3Ay3+J97sA=="], - - "@actions/github/@octokit/core/before-after-hook": ["before-after-hook@2.2.3", "", {}, "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ=="], - - "@actions/github/@octokit/core/universal-user-agent": ["universal-user-agent@6.0.1", "", {}, "sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ=="], + "@actions/core/@actions/http-client/undici": ["undici@5.29.0", "", { "dependencies": { "@fastify/busboy": "^2.0.0" } }, "sha512-raqeBD6NQK4SkWhQzeYKd1KmIG6dllBOTt55Rmkt4HtI9mwdWtJljnrXjAFUBLTSN67HWrOIZ3EPF4kjUw80Bg=="], "@actions/github/@octokit/plugin-paginate-rest/@octokit/types": ["@octokit/types@12.6.0", "", { "dependencies": { "@octokit/openapi-types": "^20.0.0" } }, "sha512-1rhSOfRa6H9w4YwK0yrf5faDaDTb+yLyBUKOCV4xtCDB5VmIPqd/v9yr9o6SAzOAlRxMiRiCic6JVM1/kunVkw=="], "@actions/github/@octokit/plugin-rest-endpoint-methods/@octokit/types": ["@octokit/types@12.6.0", "", { "dependencies": { "@octokit/openapi-types": "^20.0.0" } }, "sha512-1rhSOfRa6H9w4YwK0yrf5faDaDTb+yLyBUKOCV4xtCDB5VmIPqd/v9yr9o6SAzOAlRxMiRiCic6JVM1/kunVkw=="], - "@actions/github/@octokit/request/@octokit/endpoint": ["@octokit/endpoint@9.0.6", "", { "dependencies": { "@octokit/types": "^13.1.0", "universal-user-agent": "^6.0.0" } }, "sha512-H1fNTMA57HbkFESSt3Y9+FBICv+0jFceJFPWDePYlR/iMGrwM5ph+Dd4XRQs+8X+PUFURLQgX9ChPfhJ/1uNQw=="], - - "@actions/github/@octokit/request/@octokit/types": ["@octokit/types@13.10.0", "", { "dependencies": { "@octokit/openapi-types": "^24.2.0" } }, "sha512-ifLaO34EbbPj0Xgro4G5lP5asESjwHracYJvVaPIyXMuiuXLlhic3S47cBdTb+jfODkTE5YtGCLt3Ay3+J97sA=="], - - "@actions/github/@octokit/request/universal-user-agent": ["universal-user-agent@6.0.1", "", {}, "sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ=="], - - "@actions/github/@octokit/request-error/@octokit/types": ["@octokit/types@13.10.0", "", { "dependencies": { "@octokit/openapi-types": "^24.2.0" } }, "sha512-ifLaO34EbbPj0Xgro4G5lP5asESjwHracYJvVaPIyXMuiuXLlhic3S47cBdTb+jfODkTE5YtGCLt3Ay3+J97sA=="], - "@astrojs/markdown-remark/shiki/@shikijs/core": ["@shikijs/core@3.15.0", "", { "dependencies": { "@shikijs/types": "3.15.0", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4", "hast-util-to-html": "^9.0.5" } }, "sha512-8TOG6yG557q+fMsSVa8nkEDOZNTSxjbbR8l6lF2gyr6Np+jrPlslqDxQkN6rMXCECQ3isNPZAGszAfYoJOPGlg=="], "@astrojs/markdown-remark/shiki/@shikijs/engine-javascript": ["@shikijs/engine-javascript@3.15.0", "", { "dependencies": { "@shikijs/types": "3.15.0", "@shikijs/vscode-textmate": "^10.0.2", "oniguruma-to-es": "^4.3.3" } }, "sha512-ZedbOFpopibdLmvTz2sJPJgns8Xvyabe2QbmqMTz07kt1pTzfEvKZc5IqPVO/XFiEbbNyaOpjPBkkr1vlwS+qg=="], @@ -4628,61 +4728,117 @@ "@modelcontextprotocol/sdk/raw-body/http-errors": ["http-errors@2.0.1", "", { "dependencies": { "depd": "~2.0.0", "inherits": "~2.0.4", "setprototypeof": "~1.2.0", "statuses": "~2.0.2", "toidentifier": "~1.0.1" } }, "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ=="], + "@octokit/auth-app/@octokit/request/@octokit/endpoint": ["@octokit/endpoint@11.0.2", "", { "dependencies": { "@octokit/types": "^16.0.0", "universal-user-agent": "^7.0.2" } }, "sha512-4zCpzP1fWc7QlqunZ5bSEjxc6yLAlRTnDwKtgXfcI/FxxGoqedDG8V2+xJ60bV2kODqcGB+nATdtap/XYq2NZQ=="], + + "@octokit/auth-app/@octokit/request/@octokit/types": ["@octokit/types@16.0.0", "", { "dependencies": { "@octokit/openapi-types": "^27.0.0" } }, "sha512-sKq+9r1Mm4efXW1FCk7hFSeJo4QKreL/tTbR0rz/qx/r1Oa2VV83LTA/H/MuCOX7uCIJmQVRKBcbmWoySjAnSg=="], + + "@octokit/auth-app/@octokit/request-error/@octokit/types": ["@octokit/types@16.0.0", "", { "dependencies": { "@octokit/openapi-types": "^27.0.0" } }, "sha512-sKq+9r1Mm4efXW1FCk7hFSeJo4QKreL/tTbR0rz/qx/r1Oa2VV83LTA/H/MuCOX7uCIJmQVRKBcbmWoySjAnSg=="], + + "@octokit/auth-oauth-app/@octokit/request/@octokit/endpoint": ["@octokit/endpoint@11.0.2", "", { "dependencies": { "@octokit/types": "^16.0.0", "universal-user-agent": "^7.0.2" } }, "sha512-4zCpzP1fWc7QlqunZ5bSEjxc6yLAlRTnDwKtgXfcI/FxxGoqedDG8V2+xJ60bV2kODqcGB+nATdtap/XYq2NZQ=="], + + "@octokit/auth-oauth-app/@octokit/request/@octokit/request-error": ["@octokit/request-error@7.1.0", "", { "dependencies": { "@octokit/types": "^16.0.0" } }, "sha512-KMQIfq5sOPpkQYajXHwnhjCC0slzCNScLHs9JafXc4RAJI+9f+jNDlBNaIMTvazOPLgb4BnlhGJOTbnN0wIjPw=="], + "@octokit/auth-oauth-app/@octokit/types/@octokit/openapi-types": ["@octokit/openapi-types@27.0.0", "", {}, "sha512-whrdktVs1h6gtR+09+QsNk2+FO+49j6ga1c55YZudfEG+oKJVvJLQi3zkOm5JjiUXAagWK2tI2kTGKJ2Ys7MGA=="], + "@octokit/auth-oauth-device/@octokit/request/@octokit/endpoint": ["@octokit/endpoint@11.0.2", "", { "dependencies": { "@octokit/types": "^16.0.0", "universal-user-agent": "^7.0.2" } }, "sha512-4zCpzP1fWc7QlqunZ5bSEjxc6yLAlRTnDwKtgXfcI/FxxGoqedDG8V2+xJ60bV2kODqcGB+nATdtap/XYq2NZQ=="], + + "@octokit/auth-oauth-device/@octokit/request/@octokit/request-error": ["@octokit/request-error@7.1.0", "", { "dependencies": { "@octokit/types": "^16.0.0" } }, "sha512-KMQIfq5sOPpkQYajXHwnhjCC0slzCNScLHs9JafXc4RAJI+9f+jNDlBNaIMTvazOPLgb4BnlhGJOTbnN0wIjPw=="], + "@octokit/auth-oauth-device/@octokit/types/@octokit/openapi-types": ["@octokit/openapi-types@27.0.0", "", {}, "sha512-whrdktVs1h6gtR+09+QsNk2+FO+49j6ga1c55YZudfEG+oKJVvJLQi3zkOm5JjiUXAagWK2tI2kTGKJ2Ys7MGA=="], + "@octokit/auth-oauth-user/@octokit/request/@octokit/endpoint": ["@octokit/endpoint@11.0.2", "", { "dependencies": { "@octokit/types": "^16.0.0", "universal-user-agent": "^7.0.2" } }, "sha512-4zCpzP1fWc7QlqunZ5bSEjxc6yLAlRTnDwKtgXfcI/FxxGoqedDG8V2+xJ60bV2kODqcGB+nATdtap/XYq2NZQ=="], + + "@octokit/auth-oauth-user/@octokit/request/@octokit/request-error": ["@octokit/request-error@7.1.0", "", { "dependencies": { "@octokit/types": "^16.0.0" } }, "sha512-KMQIfq5sOPpkQYajXHwnhjCC0slzCNScLHs9JafXc4RAJI+9f+jNDlBNaIMTvazOPLgb4BnlhGJOTbnN0wIjPw=="], + "@octokit/auth-oauth-user/@octokit/types/@octokit/openapi-types": ["@octokit/openapi-types@27.0.0", "", {}, "sha512-whrdktVs1h6gtR+09+QsNk2+FO+49j6ga1c55YZudfEG+oKJVvJLQi3zkOm5JjiUXAagWK2tI2kTGKJ2Ys7MGA=="], - "@octokit/core/@octokit/types/@octokit/openapi-types": ["@octokit/openapi-types@27.0.0", "", {}, "sha512-whrdktVs1h6gtR+09+QsNk2+FO+49j6ga1c55YZudfEG+oKJVvJLQi3zkOm5JjiUXAagWK2tI2kTGKJ2Ys7MGA=="], + "@octokit/core/@octokit/types/@octokit/openapi-types": ["@octokit/openapi-types@24.2.0", "", {}, "sha512-9sIH3nSUttelJSXUrmGzl7QUBFul0/mB8HRYl3fOlgHbIWG+WnYDXU3v/2zMtAvuzZ/ed00Ei6on975FhBfzrg=="], + + "@octokit/endpoint/@octokit/types/@octokit/openapi-types": ["@octokit/openapi-types@24.2.0", "", {}, "sha512-9sIH3nSUttelJSXUrmGzl7QUBFul0/mB8HRYl3fOlgHbIWG+WnYDXU3v/2zMtAvuzZ/ed00Ei6on975FhBfzrg=="], - "@octokit/endpoint/@octokit/types/@octokit/openapi-types": ["@octokit/openapi-types@27.0.0", "", {}, "sha512-whrdktVs1h6gtR+09+QsNk2+FO+49j6ga1c55YZudfEG+oKJVvJLQi3zkOm5JjiUXAagWK2tI2kTGKJ2Ys7MGA=="], + "@octokit/graphql/@octokit/request/@octokit/endpoint": ["@octokit/endpoint@11.0.2", "", { "dependencies": { "@octokit/types": "^16.0.0", "universal-user-agent": "^7.0.2" } }, "sha512-4zCpzP1fWc7QlqunZ5bSEjxc6yLAlRTnDwKtgXfcI/FxxGoqedDG8V2+xJ60bV2kODqcGB+nATdtap/XYq2NZQ=="], + + "@octokit/graphql/@octokit/request/@octokit/request-error": ["@octokit/request-error@7.1.0", "", { "dependencies": { "@octokit/types": "^16.0.0" } }, "sha512-KMQIfq5sOPpkQYajXHwnhjCC0slzCNScLHs9JafXc4RAJI+9f+jNDlBNaIMTvazOPLgb4BnlhGJOTbnN0wIjPw=="], + + "@octokit/graphql/@octokit/request/@octokit/types": ["@octokit/types@16.0.0", "", { "dependencies": { "@octokit/openapi-types": "^27.0.0" } }, "sha512-sKq+9r1Mm4efXW1FCk7hFSeJo4QKreL/tTbR0rz/qx/r1Oa2VV83LTA/H/MuCOX7uCIJmQVRKBcbmWoySjAnSg=="], "@octokit/graphql/@octokit/types/@octokit/openapi-types": ["@octokit/openapi-types@26.0.0", "", {}, "sha512-7AtcfKtpo77j7Ts73b4OWhOZHTKo/gGY8bB3bNBQz4H+GRSWqx2yvj8TXRsbdTE0eRmYmXOEY66jM7mJ7LzfsA=="], + "@octokit/oauth-methods/@octokit/request/@octokit/endpoint": ["@octokit/endpoint@11.0.2", "", { "dependencies": { "@octokit/types": "^16.0.0", "universal-user-agent": "^7.0.2" } }, "sha512-4zCpzP1fWc7QlqunZ5bSEjxc6yLAlRTnDwKtgXfcI/FxxGoqedDG8V2+xJ60bV2kODqcGB+nATdtap/XYq2NZQ=="], + "@octokit/oauth-methods/@octokit/types/@octokit/openapi-types": ["@octokit/openapi-types@27.0.0", "", {}, "sha512-whrdktVs1h6gtR+09+QsNk2+FO+49j6ga1c55YZudfEG+oKJVvJLQi3zkOm5JjiUXAagWK2tI2kTGKJ2Ys7MGA=="], + "@octokit/plugin-paginate-rest/@octokit/core/@octokit/auth-token": ["@octokit/auth-token@6.0.0", "", {}, "sha512-P4YJBPdPSpWTQ1NU4XYdvHvXJJDxM6YwpS0FZHRgP7YFkdVxsWcpWGy/NVqlAA7PcPCnMacXlRm1y2PFZRWL/w=="], + + "@octokit/plugin-paginate-rest/@octokit/core/@octokit/graphql": ["@octokit/graphql@9.0.3", "", { "dependencies": { "@octokit/request": "^10.0.6", "@octokit/types": "^16.0.0", "universal-user-agent": "^7.0.0" } }, "sha512-grAEuupr/C1rALFnXTv6ZQhFuL1D8G5y8CN04RgrO4FIPMrtm+mcZzFG7dcBm+nq+1ppNixu+Jd78aeJOYxlGA=="], + + "@octokit/plugin-paginate-rest/@octokit/core/@octokit/request": ["@octokit/request@10.0.7", "", { "dependencies": { "@octokit/endpoint": "^11.0.2", "@octokit/request-error": "^7.0.2", "@octokit/types": "^16.0.0", "fast-content-type-parse": "^3.0.0", "universal-user-agent": "^7.0.2" } }, "sha512-v93h0i1yu4idj8qFPZwjehoJx4j3Ntn+JhXsdJrG9pYaX6j/XRz2RmasMUHtNgQD39nrv/VwTWSqK0RNXR8upA=="], + + "@octokit/plugin-paginate-rest/@octokit/core/@octokit/request-error": ["@octokit/request-error@7.1.0", "", { "dependencies": { "@octokit/types": "^16.0.0" } }, "sha512-KMQIfq5sOPpkQYajXHwnhjCC0slzCNScLHs9JafXc4RAJI+9f+jNDlBNaIMTvazOPLgb4BnlhGJOTbnN0wIjPw=="], + + "@octokit/plugin-paginate-rest/@octokit/core/@octokit/types": ["@octokit/types@16.0.0", "", { "dependencies": { "@octokit/openapi-types": "^27.0.0" } }, "sha512-sKq+9r1Mm4efXW1FCk7hFSeJo4QKreL/tTbR0rz/qx/r1Oa2VV83LTA/H/MuCOX7uCIJmQVRKBcbmWoySjAnSg=="], + + "@octokit/plugin-paginate-rest/@octokit/core/before-after-hook": ["before-after-hook@4.0.0", "", {}, "sha512-q6tR3RPqIB1pMiTRMFcZwuG5T8vwp+vUvEG0vuI6B+Rikh5BfPp2fQ82c925FOs+b0lcFQ8CFrL+KbilfZFhOQ=="], + "@octokit/plugin-paginate-rest/@octokit/types/@octokit/openapi-types": ["@octokit/openapi-types@26.0.0", "", {}, "sha512-7AtcfKtpo77j7Ts73b4OWhOZHTKo/gGY8bB3bNBQz4H+GRSWqx2yvj8TXRsbdTE0eRmYmXOEY66jM7mJ7LzfsA=="], + "@octokit/plugin-rest-endpoint-methods/@octokit/core/@octokit/auth-token": ["@octokit/auth-token@6.0.0", "", {}, "sha512-P4YJBPdPSpWTQ1NU4XYdvHvXJJDxM6YwpS0FZHRgP7YFkdVxsWcpWGy/NVqlAA7PcPCnMacXlRm1y2PFZRWL/w=="], + + "@octokit/plugin-rest-endpoint-methods/@octokit/core/@octokit/graphql": ["@octokit/graphql@9.0.3", "", { "dependencies": { "@octokit/request": "^10.0.6", "@octokit/types": "^16.0.0", "universal-user-agent": "^7.0.0" } }, "sha512-grAEuupr/C1rALFnXTv6ZQhFuL1D8G5y8CN04RgrO4FIPMrtm+mcZzFG7dcBm+nq+1ppNixu+Jd78aeJOYxlGA=="], + + "@octokit/plugin-rest-endpoint-methods/@octokit/core/@octokit/request": ["@octokit/request@10.0.7", "", { "dependencies": { "@octokit/endpoint": "^11.0.2", "@octokit/request-error": "^7.0.2", "@octokit/types": "^16.0.0", "fast-content-type-parse": "^3.0.0", "universal-user-agent": "^7.0.2" } }, "sha512-v93h0i1yu4idj8qFPZwjehoJx4j3Ntn+JhXsdJrG9pYaX6j/XRz2RmasMUHtNgQD39nrv/VwTWSqK0RNXR8upA=="], + + "@octokit/plugin-rest-endpoint-methods/@octokit/core/@octokit/request-error": ["@octokit/request-error@7.1.0", "", { "dependencies": { "@octokit/types": "^16.0.0" } }, "sha512-KMQIfq5sOPpkQYajXHwnhjCC0slzCNScLHs9JafXc4RAJI+9f+jNDlBNaIMTvazOPLgb4BnlhGJOTbnN0wIjPw=="], + + "@octokit/plugin-rest-endpoint-methods/@octokit/core/@octokit/types": ["@octokit/types@16.0.0", "", { "dependencies": { "@octokit/openapi-types": "^27.0.0" } }, "sha512-sKq+9r1Mm4efXW1FCk7hFSeJo4QKreL/tTbR0rz/qx/r1Oa2VV83LTA/H/MuCOX7uCIJmQVRKBcbmWoySjAnSg=="], + + "@octokit/plugin-rest-endpoint-methods/@octokit/core/before-after-hook": ["before-after-hook@4.0.0", "", {}, "sha512-q6tR3RPqIB1pMiTRMFcZwuG5T8vwp+vUvEG0vuI6B+Rikh5BfPp2fQ82c925FOs+b0lcFQ8CFrL+KbilfZFhOQ=="], + "@octokit/plugin-rest-endpoint-methods/@octokit/types/@octokit/openapi-types": ["@octokit/openapi-types@26.0.0", "", {}, "sha512-7AtcfKtpo77j7Ts73b4OWhOZHTKo/gGY8bB3bNBQz4H+GRSWqx2yvj8TXRsbdTE0eRmYmXOEY66jM7mJ7LzfsA=="], "@octokit/plugin-retry/@octokit/types/@octokit/openapi-types": ["@octokit/openapi-types@12.11.0", "", {}, "sha512-VsXyi8peyRq9PqIz/tpqiL2w3w80OgVMwBHltTml3LmVvXiphgeqmY9mvBw9Wu7e0QWk/fqD37ux8yP5uVekyQ=="], - "@octokit/request-error/@octokit/types/@octokit/openapi-types": ["@octokit/openapi-types@27.0.0", "", {}, "sha512-whrdktVs1h6gtR+09+QsNk2+FO+49j6ga1c55YZudfEG+oKJVvJLQi3zkOm5JjiUXAagWK2tI2kTGKJ2Ys7MGA=="], + "@octokit/request-error/@octokit/types/@octokit/openapi-types": ["@octokit/openapi-types@24.2.0", "", {}, "sha512-9sIH3nSUttelJSXUrmGzl7QUBFul0/mB8HRYl3fOlgHbIWG+WnYDXU3v/2zMtAvuzZ/ed00Ei6on975FhBfzrg=="], - "@octokit/request/@octokit/types/@octokit/openapi-types": ["@octokit/openapi-types@27.0.0", "", {}, "sha512-whrdktVs1h6gtR+09+QsNk2+FO+49j6ga1c55YZudfEG+oKJVvJLQi3zkOm5JjiUXAagWK2tI2kTGKJ2Ys7MGA=="], + "@octokit/request/@octokit/types/@octokit/openapi-types": ["@octokit/openapi-types@24.2.0", "", {}, "sha512-9sIH3nSUttelJSXUrmGzl7QUBFul0/mB8HRYl3fOlgHbIWG+WnYDXU3v/2zMtAvuzZ/ed00Ei6on975FhBfzrg=="], - "@opencode-ai/web/@shikijs/transformers/@shikijs/core": ["@shikijs/core@3.4.2", "", { "dependencies": { "@shikijs/types": "3.4.2", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4", "hast-util-to-html": "^9.0.5" } }, "sha512-AG8vnSi1W2pbgR2B911EfGqtLE9c4hQBYkv/x7Z+Kt0VxhgQKcW7UNDVYsu9YxwV6u+OJrvdJrMq6DNWoBjihQ=="], + "@octokit/rest/@octokit/core/@octokit/auth-token": ["@octokit/auth-token@6.0.0", "", {}, "sha512-P4YJBPdPSpWTQ1NU4XYdvHvXJJDxM6YwpS0FZHRgP7YFkdVxsWcpWGy/NVqlAA7PcPCnMacXlRm1y2PFZRWL/w=="], - "@opencode-ai/web/@shikijs/transformers/@shikijs/types": ["@shikijs/types@3.4.2", "", { "dependencies": { "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } }, "sha512-zHC1l7L+eQlDXLnxvM9R91Efh2V4+rN3oMVS2swCBssbj2U/FBwybD1eeLaq8yl/iwT+zih8iUbTBCgGZOYlVg=="], + "@octokit/rest/@octokit/core/@octokit/graphql": ["@octokit/graphql@9.0.3", "", { "dependencies": { "@octokit/request": "^10.0.6", "@octokit/types": "^16.0.0", "universal-user-agent": "^7.0.0" } }, "sha512-grAEuupr/C1rALFnXTv6ZQhFuL1D8G5y8CN04RgrO4FIPMrtm+mcZzFG7dcBm+nq+1ppNixu+Jd78aeJOYxlGA=="], - "@opencode-ai/web/shiki/@shikijs/core": ["@shikijs/core@3.4.2", "", { "dependencies": { "@shikijs/types": "3.4.2", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4", "hast-util-to-html": "^9.0.5" } }, "sha512-AG8vnSi1W2pbgR2B911EfGqtLE9c4hQBYkv/x7Z+Kt0VxhgQKcW7UNDVYsu9YxwV6u+OJrvdJrMq6DNWoBjihQ=="], + "@octokit/rest/@octokit/core/@octokit/request": ["@octokit/request@10.0.7", "", { "dependencies": { "@octokit/endpoint": "^11.0.2", "@octokit/request-error": "^7.0.2", "@octokit/types": "^16.0.0", "fast-content-type-parse": "^3.0.0", "universal-user-agent": "^7.0.2" } }, "sha512-v93h0i1yu4idj8qFPZwjehoJx4j3Ntn+JhXsdJrG9pYaX6j/XRz2RmasMUHtNgQD39nrv/VwTWSqK0RNXR8upA=="], - "@opencode-ai/web/shiki/@shikijs/engine-javascript": ["@shikijs/engine-javascript@3.4.2", "", { "dependencies": { "@shikijs/types": "3.4.2", "@shikijs/vscode-textmate": "^10.0.2", "oniguruma-to-es": "^4.3.3" } }, "sha512-1/adJbSMBOkpScCE/SB6XkjJU17ANln3Wky7lOmrnpl+zBdQ1qXUJg2GXTYVHRq+2j3hd1DesmElTXYDgtfSOQ=="], + "@octokit/rest/@octokit/core/@octokit/request-error": ["@octokit/request-error@7.1.0", "", { "dependencies": { "@octokit/types": "^16.0.0" } }, "sha512-KMQIfq5sOPpkQYajXHwnhjCC0slzCNScLHs9JafXc4RAJI+9f+jNDlBNaIMTvazOPLgb4BnlhGJOTbnN0wIjPw=="], - "@opencode-ai/web/shiki/@shikijs/engine-oniguruma": ["@shikijs/engine-oniguruma@3.4.2", "", { "dependencies": { "@shikijs/types": "3.4.2", "@shikijs/vscode-textmate": "^10.0.2" } }, "sha512-zcZKMnNndgRa3ORja6Iemsr3DrLtkX3cAF7lTJkdMB6v9alhlBsX9uNiCpqofNrXOvpA3h6lHcLJxgCIhVOU5Q=="], + "@octokit/rest/@octokit/core/@octokit/types": ["@octokit/types@16.0.0", "", { "dependencies": { "@octokit/openapi-types": "^27.0.0" } }, "sha512-sKq+9r1Mm4efXW1FCk7hFSeJo4QKreL/tTbR0rz/qx/r1Oa2VV83LTA/H/MuCOX7uCIJmQVRKBcbmWoySjAnSg=="], - "@opencode-ai/web/shiki/@shikijs/langs": ["@shikijs/langs@3.4.2", "", { "dependencies": { "@shikijs/types": "3.4.2" } }, "sha512-H6azIAM+OXD98yztIfs/KH5H4PU39t+SREhmM8LaNXyUrqj2mx+zVkr8MWYqjceSjDw9I1jawm1WdFqU806rMA=="], + "@octokit/rest/@octokit/core/before-after-hook": ["before-after-hook@4.0.0", "", {}, "sha512-q6tR3RPqIB1pMiTRMFcZwuG5T8vwp+vUvEG0vuI6B+Rikh5BfPp2fQ82c925FOs+b0lcFQ8CFrL+KbilfZFhOQ=="], - "@opencode-ai/web/shiki/@shikijs/themes": ["@shikijs/themes@3.4.2", "", { "dependencies": { "@shikijs/types": "3.4.2" } }, "sha512-qAEuAQh+brd8Jyej2UDDf+b4V2g1Rm8aBIdvt32XhDPrHvDkEnpb7Kzc9hSuHUxz0Iuflmq7elaDuQAP9bHIhg=="], + "@opencode-ai/desktop/@actions/artifact/@actions/http-client": ["@actions/http-client@2.2.3", "", { "dependencies": { "tunnel": "^0.0.6", "undici": "^5.25.4" } }, "sha512-mx8hyJi/hjFvbPokCg4uRd4ZX78t+YyRPtnKWwIl+RzNaVuFpQHfmlGVfsKEJN8LwTCvL+DfVgAM04XaHkm6bA=="], - "@opencode-ai/web/shiki/@shikijs/types": ["@shikijs/types@3.4.2", "", { "dependencies": { "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } }, "sha512-zHC1l7L+eQlDXLnxvM9R91Efh2V4+rN3oMVS2swCBssbj2U/FBwybD1eeLaq8yl/iwT+zih8iUbTBCgGZOYlVg=="], + "@opencode-ai/web/@shikijs/transformers/@shikijs/core": ["@shikijs/core@3.4.2", "", { "dependencies": { "@shikijs/types": "3.4.2", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4", "hast-util-to-html": "^9.0.5" } }, "sha512-AG8vnSi1W2pbgR2B911EfGqtLE9c4hQBYkv/x7Z+Kt0VxhgQKcW7UNDVYsu9YxwV6u+OJrvdJrMq6DNWoBjihQ=="], + + "@opencode-ai/web/@shikijs/transformers/@shikijs/types": ["@shikijs/types@3.4.2", "", { "dependencies": { "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } }, "sha512-zHC1l7L+eQlDXLnxvM9R91Efh2V4+rN3oMVS2swCBssbj2U/FBwybD1eeLaq8yl/iwT+zih8iUbTBCgGZOYlVg=="], "@opentui/solid/@babel/core/semver": ["semver@6.3.1", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="], - "@pierre/precision-diffs/@shikijs/core/@shikijs/types": ["@shikijs/types@3.15.0", "", { "dependencies": { "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } }, "sha512-BnP+y/EQnhihgHy4oIAN+6FFtmfTekwOLsQbRw9hOKwqgNy8Bdsjq8B05oAt/ZgvIWWFrshV71ytOrlPfYjIJw=="], + "@pierre/diffs/@shikijs/core/@shikijs/types": ["@shikijs/types@3.20.0", "", { "dependencies": { "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } }, "sha512-lhYAATn10nkZcBQ0BlzSbJA3wcmL5MXUUF8d2Zzon6saZDlToKaiRX60n2+ZaHJCmXEcZRWNzn+k9vplr8Jhsw=="], + + "@pierre/diffs/@shikijs/engine-javascript/@shikijs/types": ["@shikijs/types@3.19.0", "", { "dependencies": { "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } }, "sha512-Z2hdeEQlzuntf/BZpFG8a+Fsw9UVXdML7w0o3TgSXV3yNESGon+bs9ITkQb3Ki7zxoXOOu5oJWqZ2uto06V9iQ=="], - "@pierre/precision-diffs/@shikijs/transformers/@shikijs/types": ["@shikijs/types@3.15.0", "", { "dependencies": { "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } }, "sha512-BnP+y/EQnhihgHy4oIAN+6FFtmfTekwOLsQbRw9hOKwqgNy8Bdsjq8B05oAt/ZgvIWWFrshV71ytOrlPfYjIJw=="], + "@pierre/diffs/@shikijs/transformers/@shikijs/core": ["@shikijs/core@3.19.0", "", { "dependencies": { "@shikijs/types": "3.19.0", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4", "hast-util-to-html": "^9.0.5" } }, "sha512-L7SrRibU7ZoYi1/TrZsJOFAnnHyLTE1SwHG1yNWjZIVCqjOEmCSuK2ZO9thnRbJG6TOkPp+Z963JmpCNw5nzvA=="], - "@pierre/precision-diffs/shiki/@shikijs/engine-javascript": ["@shikijs/engine-javascript@3.15.0", "", { "dependencies": { "@shikijs/types": "3.15.0", "@shikijs/vscode-textmate": "^10.0.2", "oniguruma-to-es": "^4.3.3" } }, "sha512-ZedbOFpopibdLmvTz2sJPJgns8Xvyabe2QbmqMTz07kt1pTzfEvKZc5IqPVO/XFiEbbNyaOpjPBkkr1vlwS+qg=="], + "@pierre/diffs/@shikijs/transformers/@shikijs/types": ["@shikijs/types@3.19.0", "", { "dependencies": { "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } }, "sha512-Z2hdeEQlzuntf/BZpFG8a+Fsw9UVXdML7w0o3TgSXV3yNESGon+bs9ITkQb3Ki7zxoXOOu5oJWqZ2uto06V9iQ=="], - "@pierre/precision-diffs/shiki/@shikijs/engine-oniguruma": ["@shikijs/engine-oniguruma@3.15.0", "", { "dependencies": { "@shikijs/types": "3.15.0", "@shikijs/vscode-textmate": "^10.0.2" } }, "sha512-HnqFsV11skAHvOArMZdLBZZApRSYS4LSztk2K3016Y9VCyZISnlYUYsL2hzlS7tPqKHvNqmI5JSUJZprXloMvA=="], + "@pierre/diffs/shiki/@shikijs/core": ["@shikijs/core@3.19.0", "", { "dependencies": { "@shikijs/types": "3.19.0", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4", "hast-util-to-html": "^9.0.5" } }, "sha512-L7SrRibU7ZoYi1/TrZsJOFAnnHyLTE1SwHG1yNWjZIVCqjOEmCSuK2ZO9thnRbJG6TOkPp+Z963JmpCNw5nzvA=="], - "@pierre/precision-diffs/shiki/@shikijs/langs": ["@shikijs/langs@3.15.0", "", { "dependencies": { "@shikijs/types": "3.15.0" } }, "sha512-WpRvEFvkVvO65uKYW4Rzxs+IG0gToyM8SARQMtGGsH4GDMNZrr60qdggXrFOsdfOVssG/QQGEl3FnJ3EZ+8w8A=="], + "@pierre/diffs/shiki/@shikijs/engine-oniguruma": ["@shikijs/engine-oniguruma@3.19.0", "", { "dependencies": { "@shikijs/types": "3.19.0", "@shikijs/vscode-textmate": "^10.0.2" } }, "sha512-1hRxtYIJfJSZeM5ivbUXv9hcJP3PWRo5prG/V2sWwiubUKTa+7P62d2qxCW8jiVFX4pgRHhnHNp+qeR7Xl+6kg=="], - "@pierre/precision-diffs/shiki/@shikijs/themes": ["@shikijs/themes@3.15.0", "", { "dependencies": { "@shikijs/types": "3.15.0" } }, "sha512-8ow2zWb1IDvCKjYb0KiLNrK4offFdkfNVPXb1OZykpLCzRU6j+efkY+Y7VQjNlNFXonSw+4AOdGYtmqykDbRiQ=="], + "@pierre/diffs/shiki/@shikijs/langs": ["@shikijs/langs@3.19.0", "", { "dependencies": { "@shikijs/types": "3.19.0" } }, "sha512-dBMFzzg1QiXqCVQ5ONc0z2ebyoi5BKz+MtfByLm0o5/nbUu3Iz8uaTCa5uzGiscQKm7lVShfZHU1+OG3t5hgwg=="], - "@pierre/precision-diffs/shiki/@shikijs/types": ["@shikijs/types@3.15.0", "", { "dependencies": { "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } }, "sha512-BnP+y/EQnhihgHy4oIAN+6FFtmfTekwOLsQbRw9hOKwqgNy8Bdsjq8B05oAt/ZgvIWWFrshV71ytOrlPfYjIJw=="], + "@pierre/diffs/shiki/@shikijs/themes": ["@shikijs/themes@3.19.0", "", { "dependencies": { "@shikijs/types": "3.19.0" } }, "sha512-H36qw+oh91Y0s6OlFfdSuQ0Ld+5CgB/VE6gNPK+Hk4VRbVG/XQgkjnt4KzfnnoO6tZPtKJKHPjwebOCfjd6F8A=="], + + "@pierre/diffs/shiki/@shikijs/types": ["@shikijs/types@3.19.0", "", { "dependencies": { "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } }, "sha512-Z2hdeEQlzuntf/BZpFG8a+Fsw9UVXdML7w0o3TgSXV3yNESGon+bs9ITkQb3Ki7zxoXOOu5oJWqZ2uto06V9iQ=="], "@slack/web-api/form-data/mime-types": ["mime-types@2.1.35", "", { "dependencies": { "mime-db": "1.52.0" } }, "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw=="], @@ -4792,6 +4948,8 @@ "body-parser/debug/ms": ["ms@2.0.0", "", {}, "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="], + "c12/chokidar/readdirp": ["readdirp@5.0.0", "", {}, "sha512-9u/XQ1pvrQtYyMpZe7DXKv2p5CNvyVwzUB6uhLAnQwHMSgKMBR62lc7AHljaeteeHXn11XTAaLLUVZYVZyuRBQ=="], + "cross-spawn/which/isexe": ["isexe@2.0.0", "", {}, "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw=="], "drizzle-kit/esbuild/@esbuild/aix-ppc64": ["@esbuild/aix-ppc64@0.19.12", "", { "os": "aix", "cpu": "ppc64" }, "sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA=="], @@ -4862,10 +5020,6 @@ "lazystream/readable-stream/string_decoder": ["string_decoder@1.1.1", "", { "dependencies": { "safe-buffer": "~5.1.0" } }, "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg=="], - "opencode/@ai-sdk/openai/@ai-sdk/provider-utils": ["@ai-sdk/provider-utils@3.0.17", "", { "dependencies": { "@ai-sdk/provider": "2.0.0", "@standard-schema/spec": "^1.0.0", "eventsource-parser": "^3.0.6" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-TR3Gs4I3Tym4Ll+EPdzRdvo/rc8Js6c4nVhFLuvGLX/Y4V9ZcQMa/HTiYsHEgmYrf1zVi6Q145UEZUfleOwOjw=="], - - "opencode/@ai-sdk/openai-compatible/@ai-sdk/provider-utils": ["@ai-sdk/provider-utils@3.0.17", "", { "dependencies": { "@ai-sdk/provider": "2.0.0", "@standard-schema/spec": "^1.0.0", "eventsource-parser": "^3.0.6" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-TR3Gs4I3Tym4Ll+EPdzRdvo/rc8Js6c4nVhFLuvGLX/Y4V9ZcQMa/HTiYsHEgmYrf1zVi6Q145UEZUfleOwOjw=="], - "opencontrol/@modelcontextprotocol/sdk/express": ["express@5.1.0", "", { "dependencies": { "accepts": "^2.0.0", "body-parser": "^2.2.0", "content-disposition": "^1.0.0", "content-type": "^1.0.5", "cookie": "^0.7.1", "cookie-signature": "^1.2.1", "debug": "^4.4.0", "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "etag": "^1.8.1", "finalhandler": "^2.1.0", "fresh": "^2.0.0", "http-errors": "^2.0.0", "merge-descriptors": "^2.0.0", "mime-types": "^3.0.0", "on-finished": "^2.4.1", "once": "^1.4.0", "parseurl": "^1.3.3", "proxy-addr": "^2.0.7", "qs": "^6.14.0", "range-parser": "^1.2.1", "router": "^2.2.0", "send": "^1.1.0", "serve-static": "^2.2.0", "statuses": "^2.0.1", "type-is": "^2.0.1", "vary": "^1.1.2" } }, "sha512-DT9ck5YIRU+8GYzzU5kT3eHGA5iL+1Zd0EutOmTE9Dtk+Tvuzd23VBU+ec7HPNSTxXYO55gPV/hq4pSBJDjFpA=="], "opencontrol/@modelcontextprotocol/sdk/pkce-challenge": ["pkce-challenge@4.1.0", "", {}, "sha512-ZBmhE1C9LcPoH9XZSdwiPtbPHZROwAnMy+kIFQVrnMCxY4Cudlz3gBOpzilgc0jOgRaiT3sIWfpMomW2ar2orQ=="], @@ -4876,31 +5030,17 @@ "opencontrol/@modelcontextprotocol/sdk/zod-to-json-schema": ["zod-to-json-schema@3.24.5", "", { "peerDependencies": { "zod": "^3.24.1" } }, "sha512-/AuWwMP+YqiPbsJx5D6TfgRTc4kTLjsh5SOcd4bLsfUg2RcEXrFMJl1DGgdHy2aCfsIA/cr/1JM0xcB2GZji8g=="], - "opentui-spinner/@opentui/core/@opentui/core-darwin-arm64": ["@opentui/core-darwin-arm64@0.1.60", "", { "os": "darwin", "cpu": "arm64" }, "sha512-N4feqnOBDA4O4yocpat5vOiV06HqJVwJGx8rEZE9DiOtl1i+1cPQ1Lx6+zWdLhbrVBJ0ENhb7Azox8sXkm/+5Q=="], - - "opentui-spinner/@opentui/core/@opentui/core-darwin-x64": ["@opentui/core-darwin-x64@0.1.60", "", { "os": "darwin", "cpu": "x64" }, "sha512-+z3q4WaoIs7ANU8+eTFlvnfCjAS81rk81TOdZm4TJ53Ti3/B+yheWtnV/mLpLLhvZDz2VUVxxRmfDrGMnJb4fQ=="], - - "opentui-spinner/@opentui/core/@opentui/core-linux-arm64": ["@opentui/core-linux-arm64@0.1.60", "", { "os": "linux", "cpu": "arm64" }, "sha512-/Q65sjqVGB9ygJ6lStI8n1X6RyfmJZC8XofRGEuFiMLiWcWC/xoBtztdL8LAIvHQy42y2+pl9zIiW0fWSQ0wjw=="], - - "opentui-spinner/@opentui/core/@opentui/core-linux-x64": ["@opentui/core-linux-x64@0.1.60", "", { "os": "linux", "cpu": "x64" }, "sha512-AegF+g7OguIpjZKN+PS55sc3ZFY6fj+fLwfETbSRGw6NqX+aiwpae0Y3gXX1s298Yq5yQEzMXnARTCJTGH4uzg=="], - - "opentui-spinner/@opentui/core/@opentui/core-win32-arm64": ["@opentui/core-win32-arm64@0.1.60", "", { "os": "win32", "cpu": "arm64" }, "sha512-fbkq8MOZJgT3r9q3JWqsfVxRpQ1SlbmhmvB35BzukXnZBK8eA178wbSadGH6irMDrkSIYye9WYddHI/iXjmgVQ=="], - - "opentui-spinner/@opentui/core/@opentui/core-win32-x64": ["@opentui/core-win32-x64@0.1.60", "", { "os": "win32", "cpu": "x64" }, "sha512-OebCL7f9+CKodBw0G+NvKIcc74bl6/sBEHfb73cACdJDJKh+T3C3Vt9H3kQQ0m1C8wRAqX6rh706OArk1pUb2A=="], - - "opentui-spinner/@opentui/solid/@babel/core": ["@babel/core@7.28.0", "", { "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.27.1", "@babel/generator": "^7.28.0", "@babel/helper-compilation-targets": "^7.27.2", "@babel/helper-module-transforms": "^7.27.3", "@babel/helpers": "^7.27.6", "@babel/parser": "^7.28.0", "@babel/template": "^7.27.2", "@babel/traverse": "^7.28.0", "@babel/types": "^7.28.0", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-UlLAnTPrFdNGoFtbSXwcGFQBtQZJCNjaN6hQNP3UPvuNXT1i82N26KL3dZeIpNalWywr9IuQuncaAfUaS1g6sQ=="], - - "opentui-spinner/@opentui/solid/babel-preset-solid": ["babel-preset-solid@1.9.9", "", { "dependencies": { "babel-plugin-jsx-dom-expressions": "^0.40.1" }, "peerDependencies": { "@babel/core": "^7.0.0", "solid-js": "^1.9.8" }, "optionalPeers": ["solid-js"] }, "sha512-pCnxWrciluXCeli/dj5PIEHgbNzim3evtTn12snjqqg8QZWJNMjH1AWIp4iG/tbVjqQ72aBEymMSagvmgxubXw=="], - "parse-bmfont-xml/xml2js/sax": ["sax@1.4.3", "", {}, "sha512-yqYn1JhPczigF94DMS+shiDMjDowYO6y9+wB/4WgO0Y19jWYk0lQ4tuG5KI7kj4FTp1wxPj5IFfcrz/s1c3jjQ=="], "pkg-up/find-up/locate-path": ["locate-path@3.0.0", "", { "dependencies": { "p-locate": "^3.0.0", "path-exists": "^3.0.0" } }, "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A=="], - "prebuild-install/tar-fs/chownr": ["chownr@1.1.4", "", {}, "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg=="], + "readable-stream/buffer/ieee754": ["ieee754@1.2.1", "", {}, "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA=="], + + "rimraf/glob/jackspeak": ["jackspeak@3.4.3", "", { "dependencies": { "@isaacs/cliui": "^8.0.2" }, "optionalDependencies": { "@pkgjs/parseargs": "^0.11.0" } }, "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw=="], - "prebuild-install/tar-fs/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=="], + "rimraf/glob/minimatch": ["minimatch@9.0.5", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow=="], - "readable-stream/buffer/ieee754": ["ieee754@1.2.1", "", {}, "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA=="], + "rimraf/glob/path-scurry": ["path-scurry@1.11.1", "", { "dependencies": { "lru-cache": "^10.2.0", "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" } }, "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA=="], "send/debug/ms": ["ms@2.0.0", "", {}, "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="], @@ -4924,22 +5064,12 @@ "wrap-ansi-cjs/strip-ansi/ansi-regex": ["ansi-regex@5.0.1", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="], - "@actions/artifact/@octokit/core/@octokit/types/@octokit/openapi-types": ["@octokit/openapi-types@24.2.0", "", {}, "sha512-9sIH3nSUttelJSXUrmGzl7QUBFul0/mB8HRYl3fOlgHbIWG+WnYDXU3v/2zMtAvuzZ/ed00Ei6on975FhBfzrg=="], - - "@actions/artifact/@octokit/request-error/@octokit/types/@octokit/openapi-types": ["@octokit/openapi-types@24.2.0", "", {}, "sha512-9sIH3nSUttelJSXUrmGzl7QUBFul0/mB8HRYl3fOlgHbIWG+WnYDXU3v/2zMtAvuzZ/ed00Ei6on975FhBfzrg=="], - - "@actions/artifact/@octokit/request/@octokit/types/@octokit/openapi-types": ["@octokit/openapi-types@24.2.0", "", {}, "sha512-9sIH3nSUttelJSXUrmGzl7QUBFul0/mB8HRYl3fOlgHbIWG+WnYDXU3v/2zMtAvuzZ/ed00Ei6on975FhBfzrg=="], - - "@actions/github/@octokit/core/@octokit/types/@octokit/openapi-types": ["@octokit/openapi-types@24.2.0", "", {}, "sha512-9sIH3nSUttelJSXUrmGzl7QUBFul0/mB8HRYl3fOlgHbIWG+WnYDXU3v/2zMtAvuzZ/ed00Ei6on975FhBfzrg=="], + "@actions/artifact/@actions/core/@actions/exec/@actions/io": ["@actions/io@2.0.0", "", {}, "sha512-Jv33IN09XLO+0HS79aaODsvIRyduiF7NY/F6LYeK5oeUmrsz7aFdRphQjFoESF4jS7lMauDOttKALcpapVDIAg=="], "@actions/github/@octokit/plugin-paginate-rest/@octokit/types/@octokit/openapi-types": ["@octokit/openapi-types@20.0.0", "", {}, "sha512-EtqRBEjp1dL/15V7WiX5LJMIxxkdiGJnabzYx5Apx4FkQIFgAfKumXeYAqqJCj1s+BMX4cPFIFC4OLCR6stlnA=="], "@actions/github/@octokit/plugin-rest-endpoint-methods/@octokit/types/@octokit/openapi-types": ["@octokit/openapi-types@20.0.0", "", {}, "sha512-EtqRBEjp1dL/15V7WiX5LJMIxxkdiGJnabzYx5Apx4FkQIFgAfKumXeYAqqJCj1s+BMX4cPFIFC4OLCR6stlnA=="], - "@actions/github/@octokit/request-error/@octokit/types/@octokit/openapi-types": ["@octokit/openapi-types@24.2.0", "", {}, "sha512-9sIH3nSUttelJSXUrmGzl7QUBFul0/mB8HRYl3fOlgHbIWG+WnYDXU3v/2zMtAvuzZ/ed00Ei6on975FhBfzrg=="], - - "@actions/github/@octokit/request/@octokit/types/@octokit/openapi-types": ["@octokit/openapi-types@24.2.0", "", {}, "sha512-9sIH3nSUttelJSXUrmGzl7QUBFul0/mB8HRYl3fOlgHbIWG+WnYDXU3v/2zMtAvuzZ/ed00Ei6on975FhBfzrg=="], - "@astrojs/mdx/@astrojs/markdown-remark/shiki/@shikijs/core": ["@shikijs/core@3.15.0", "", { "dependencies": { "@shikijs/types": "3.15.0", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4", "hast-util-to-html": "^9.0.5" } }, "sha512-8TOG6yG557q+fMsSVa8nkEDOZNTSxjbbR8l6lF2gyr6Np+jrPlslqDxQkN6rMXCECQ3isNPZAGszAfYoJOPGlg=="], "@astrojs/mdx/@astrojs/markdown-remark/shiki/@shikijs/engine-javascript": ["@shikijs/engine-javascript@3.15.0", "", { "dependencies": { "@shikijs/types": "3.15.0", "@shikijs/vscode-textmate": "^10.0.2", "oniguruma-to-es": "^4.3.3" } }, "sha512-ZedbOFpopibdLmvTz2sJPJgns8Xvyabe2QbmqMTz07kt1pTzfEvKZc5IqPVO/XFiEbbNyaOpjPBkkr1vlwS+qg=="], @@ -5022,6 +5152,26 @@ "@modelcontextprotocol/sdk/raw-body/http-errors/statuses": ["statuses@2.0.2", "", {}, "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw=="], + "@octokit/auth-app/@octokit/request-error/@octokit/types/@octokit/openapi-types": ["@octokit/openapi-types@27.0.0", "", {}, "sha512-whrdktVs1h6gtR+09+QsNk2+FO+49j6ga1c55YZudfEG+oKJVvJLQi3zkOm5JjiUXAagWK2tI2kTGKJ2Ys7MGA=="], + + "@octokit/auth-app/@octokit/request/@octokit/types/@octokit/openapi-types": ["@octokit/openapi-types@27.0.0", "", {}, "sha512-whrdktVs1h6gtR+09+QsNk2+FO+49j6ga1c55YZudfEG+oKJVvJLQi3zkOm5JjiUXAagWK2tI2kTGKJ2Ys7MGA=="], + + "@octokit/graphql/@octokit/request/@octokit/types/@octokit/openapi-types": ["@octokit/openapi-types@27.0.0", "", {}, "sha512-whrdktVs1h6gtR+09+QsNk2+FO+49j6ga1c55YZudfEG+oKJVvJLQi3zkOm5JjiUXAagWK2tI2kTGKJ2Ys7MGA=="], + + "@octokit/plugin-paginate-rest/@octokit/core/@octokit/request/@octokit/endpoint": ["@octokit/endpoint@11.0.2", "", { "dependencies": { "@octokit/types": "^16.0.0", "universal-user-agent": "^7.0.2" } }, "sha512-4zCpzP1fWc7QlqunZ5bSEjxc6yLAlRTnDwKtgXfcI/FxxGoqedDG8V2+xJ60bV2kODqcGB+nATdtap/XYq2NZQ=="], + + "@octokit/plugin-paginate-rest/@octokit/core/@octokit/types/@octokit/openapi-types": ["@octokit/openapi-types@27.0.0", "", {}, "sha512-whrdktVs1h6gtR+09+QsNk2+FO+49j6ga1c55YZudfEG+oKJVvJLQi3zkOm5JjiUXAagWK2tI2kTGKJ2Ys7MGA=="], + + "@octokit/plugin-rest-endpoint-methods/@octokit/core/@octokit/request/@octokit/endpoint": ["@octokit/endpoint@11.0.2", "", { "dependencies": { "@octokit/types": "^16.0.0", "universal-user-agent": "^7.0.2" } }, "sha512-4zCpzP1fWc7QlqunZ5bSEjxc6yLAlRTnDwKtgXfcI/FxxGoqedDG8V2+xJ60bV2kODqcGB+nATdtap/XYq2NZQ=="], + + "@octokit/plugin-rest-endpoint-methods/@octokit/core/@octokit/types/@octokit/openapi-types": ["@octokit/openapi-types@27.0.0", "", {}, "sha512-whrdktVs1h6gtR+09+QsNk2+FO+49j6ga1c55YZudfEG+oKJVvJLQi3zkOm5JjiUXAagWK2tI2kTGKJ2Ys7MGA=="], + + "@octokit/rest/@octokit/core/@octokit/request/@octokit/endpoint": ["@octokit/endpoint@11.0.2", "", { "dependencies": { "@octokit/types": "^16.0.0", "universal-user-agent": "^7.0.2" } }, "sha512-4zCpzP1fWc7QlqunZ5bSEjxc6yLAlRTnDwKtgXfcI/FxxGoqedDG8V2+xJ60bV2kODqcGB+nATdtap/XYq2NZQ=="], + + "@octokit/rest/@octokit/core/@octokit/types/@octokit/openapi-types": ["@octokit/openapi-types@27.0.0", "", {}, "sha512-whrdktVs1h6gtR+09+QsNk2+FO+49j6ga1c55YZudfEG+oKJVvJLQi3zkOm5JjiUXAagWK2tI2kTGKJ2Ys7MGA=="], + + "@opencode-ai/desktop/@actions/artifact/@actions/http-client/undici": ["undici@5.29.0", "", { "dependencies": { "@fastify/busboy": "^2.0.0" } }, "sha512-raqeBD6NQK4SkWhQzeYKd1KmIG6dllBOTt55Rmkt4HtI9mwdWtJljnrXjAFUBLTSN67HWrOIZ3EPF4kjUw80Bg=="], + "@slack/web-api/form-data/mime-types/mime-db": ["mime-db@1.52.0", "", {}, "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg=="], "@solidjs/start/shiki/@shikijs/engine-javascript/oniguruma-to-es": ["oniguruma-to-es@2.3.0", "", { "dependencies": { "emoji-regex-xs": "^1.0.0", "regex": "^5.1.1", "regex-recursion": "^5.1.1" } }, "sha512-bwALDxriqfKGfUufKGGepCzu9x7nJQuoRoAFp4AnwehhC2crqrDIAP/uN2qdlsAvSMpeRC3+Yzhqc7hLmle5+g=="], @@ -5070,13 +5220,11 @@ "opencontrol/@modelcontextprotocol/sdk/raw-body/http-errors": ["http-errors@2.0.1", "", { "dependencies": { "depd": "~2.0.0", "inherits": "~2.0.4", "setprototypeof": "~1.2.0", "statuses": "~2.0.2", "toidentifier": "~1.0.1" } }, "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ=="], - "opentui-spinner/@opentui/solid/@babel/core/semver": ["semver@6.3.1", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="], - "pkg-up/find-up/locate-path/p-locate": ["p-locate@3.0.0", "", { "dependencies": { "p-limit": "^2.0.0" } }, "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ=="], "pkg-up/find-up/locate-path/path-exists": ["path-exists@3.0.0", "", {}, "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ=="], - "prebuild-install/tar-fs/tar-stream/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=="], + "rimraf/glob/path-scurry/lru-cache": ["lru-cache@10.4.3", "", {}, "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ=="], "tw-to-css/tailwindcss/chokidar/glob-parent": ["glob-parent@5.1.2", "", { "dependencies": { "is-glob": "^4.0.1" } }, "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow=="], diff --git a/bunfig.toml b/bunfig.toml index b6874be144e..36a21d9332a 100644 --- a/bunfig.toml +++ b/bunfig.toml @@ -1,2 +1,6 @@ [install] exact = true + +[test] +root = "./do-not-run-tests-from-root" + diff --git a/flake.lock b/flake.lock index 58344d82c45..16fb71c0a5a 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1765425892, - "narHash": "sha256-jlQpSkg2sK6IJVzTQBDyRxQZgKADC2HKMRfGCSgNMHo=", + "lastModified": 1768393167, + "narHash": "sha256-n2063BRjHde6DqAz2zavhOOiLUwA3qXt7jQYHyETjX8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5d6bdbddb4695a62f0d00a3620b37a15275a5093", + "rev": "2f594d5af95d4fdac67fba60376ec11e482041cb", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index a6614a5dc9c..e4d214a0b93 100644 --- a/flake.nix +++ b/flake.nix @@ -6,10 +6,7 @@ }; outputs = - { - nixpkgs, - ... - }: + { self, nixpkgs, ... }: let systems = [ "aarch64-linux" @@ -17,91 +14,56 @@ "aarch64-darwin" "x86_64-darwin" ]; - lib = nixpkgs.lib; - forEachSystem = lib.genAttrs systems; - pkgsFor = system: nixpkgs.legacyPackages.${system}; - packageJson = builtins.fromJSON (builtins.readFile ./packages/opencode/package.json); - bunTarget = { - "aarch64-linux" = "bun-linux-arm64"; - "x86_64-linux" = "bun-linux-x64"; - "aarch64-darwin" = "bun-darwin-arm64"; - "x86_64-darwin" = "bun-darwin-x64"; - }; - defaultNodeModules = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="; - hashesFile = "${./nix}/hashes.json"; - hashesData = - if builtins.pathExists hashesFile then builtins.fromJSON (builtins.readFile hashesFile) else { }; - nodeModulesHash = hashesData.nodeModules or defaultNodeModules; - modelsDev = forEachSystem ( - system: - let - pkgs = pkgsFor system; - in - pkgs."models-dev" - ); + forEachSystem = f: nixpkgs.lib.genAttrs systems (system: f nixpkgs.legacyPackages.${system}); + rev = self.shortRev or self.dirtyShortRev or "dirty"; in { - devShells = forEachSystem ( - system: - let - pkgs = pkgsFor system; - in - { - default = pkgs.mkShell { - packages = with pkgs; [ - bun - nodejs_20 - pkg-config - openssl - git - ]; - }; - } - ); + devShells = forEachSystem (pkgs: { + default = pkgs.mkShell { + packages = with pkgs; [ + bun + nodejs_20 + pkg-config + openssl + git + ]; + }; + }); packages = forEachSystem ( - system: + pkgs: let - pkgs = pkgsFor system; - mkNodeModules = pkgs.callPackage ./nix/node-modules.nix { - hash = nodeModulesHash; + node_modules = pkgs.callPackage ./nix/node_modules.nix { + inherit rev; }; - mkPackage = pkgs.callPackage ./nix/opencode.nix { }; - in - { - default = mkPackage { - version = packageJson.version; - src = ./.; - scripts = ./nix/scripts; - target = bunTarget.${system}; - modelsDev = "${modelsDev.${system}}/dist/_api.json"; - mkNodeModules = mkNodeModules; + opencode = pkgs.callPackage ./nix/opencode.nix { + inherit node_modules; }; - } - ); - - apps = forEachSystem ( - system: - let - pkgs = pkgsFor system; + desktop = pkgs.callPackage ./nix/desktop.nix { + inherit opencode; + }; + # nixpkgs cpu naming to bun cpu naming + cpuMap = { x86_64 = "x64"; aarch64 = "arm64"; }; + # matrix of node_modules builds - these will always fail due to fakeHash usage + # but allow computation of the correct hash from any build machine for any cpu/os + # see the update-nix-hashes workflow for usage + moduleUpdaters = pkgs.lib.listToAttrs ( + pkgs.lib.concatMap (cpu: + map (os: { + name = "${cpu}-${os}_node_modules"; + value = node_modules.override { + bunCpu = cpuMap.${cpu}; + bunOs = os; + hash = pkgs.lib.fakeHash; + }; + }) [ "linux" "darwin" ] + ) [ "x86_64" "aarch64" ] + ); in { - opencode-dev = { - type = "app"; - meta = { - description = "Nix devshell shell for OpenCode"; - runtimeInputs = [ pkgs.bun ]; - }; - program = "${ - pkgs.writeShellApplication { - name = "opencode-dev"; - text = '' - exec bun run dev "$@" - ''; - } - }/bin/opencode-dev"; - }; - } + default = opencode; + inherit opencode desktop; + } // moduleUpdaters ); }; } diff --git a/github/README.md b/github/README.md index 36342b40995..17b24ffb1d6 100644 --- a/github/README.md +++ b/github/README.md @@ -6,7 +6,7 @@ Mention `/opencode` in your comment, and opencode will execute tasks within your ## Features -#### Explain an issues +#### Explain an issue Leave the following comment on a GitHub issue. `opencode` will read the entire thread, including all comments, and reply with a clear explanation. @@ -14,7 +14,7 @@ Leave the following comment on a GitHub issue. `opencode` will read the entire t /opencode explain this issue ``` -#### Fix an issues +#### Fix an issue Leave the following comment on a GitHub issue. opencode will create a new branch, implement the changes, and open a PR with the changes. @@ -81,24 +81,27 @@ This will walk you through installing the GitHub app, creating the workflow, and permissions: id-token: write steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 1 - - - name: Run opencode - uses: sst/opencode/github@latest + - name: Checkout repository + uses: actions/checkout@v6 + with: + fetch-depth: 1 + persist-credentials: false + + - name: Run opencode + uses: anomalyco/opencode/github@latest env: ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: model: anthropic/claude-sonnet-4-20250514 + use_github_token: true ``` 3. Store the API keys in secrets. In your organization or project **settings**, expand **Secrets and variables** on the left and select **Actions**. Add the required API keys. ## Support -This is an early release. If you encounter issues or have feedback, please create an issue at https://github.com/sst/opencode/issues. +This is an early release. If you encounter issues or have feedback, please create an issue at https://github.com/anomalyco/opencode/issues. ## Development diff --git a/github/action.yml b/github/action.yml index fe6a32206b8..8652bb8c151 100644 --- a/github/action.yml +++ b/github/action.yml @@ -9,6 +9,10 @@ inputs: description: "Model to use" required: true + agent: + description: "Agent to use. Must be a primary agent. Falls back to default_agent from config or 'build' if not found." + required: false + share: description: "Share the opencode session (defaults to true for public repos)" required: false @@ -22,6 +26,14 @@ inputs: required: false default: "false" + mentions: + description: "Comma-separated list of trigger phrases (case-insensitive). Defaults to '/opencode,/oc'" + required: false + + oidc_base_url: + description: "Base URL for OIDC token exchange API. Only required when running a custom GitHub App install. Defaults to https://api.opencode.ai" + required: false + runs: using: "composite" steps: @@ -29,7 +41,7 @@ runs: id: version shell: bash run: | - VERSION=$(curl -sf https://api.github.com/repos/sst/opencode/releases/latest | grep -o '"tag_name": *"[^"]*"' | cut -d'"' -f4) + VERSION=$(curl -sf https://api.github.com/repos/anomalyco/opencode/releases/latest | grep -o '"tag_name": *"[^"]*"' | cut -d'"' -f4) echo "version=${VERSION:-latest}" >> $GITHUB_OUTPUT - name: Cache opencode @@ -54,6 +66,9 @@ runs: run: opencode github run env: MODEL: ${{ inputs.model }} + AGENT: ${{ inputs.agent }} SHARE: ${{ inputs.share }} PROMPT: ${{ inputs.prompt }} USE_GITHUB_TOKEN: ${{ inputs.use_github_token }} + MENTIONS: ${{ inputs.mentions }} + OIDC_BASE_URL: ${{ inputs.oidc_base_url }} diff --git a/github/index.ts b/github/index.ts index 6d826326ed7..73378894cd3 100644 --- a/github/index.ts +++ b/github/index.ts @@ -281,7 +281,7 @@ async function assertOpencodeConnected() { connected = true break } catch (e) {} - await new Promise((resolve) => setTimeout(resolve, 300)) + await Bun.sleep(300) } while (retry++ < 30) if (!connected) { @@ -318,6 +318,10 @@ function useEnvRunUrl() { return `/${repo.owner}/${repo.repo}/actions/runs/${runId}` } +function useEnvAgent() { + return process.env["AGENT"] || undefined +} + function useEnvShare() { const value = process.env["SHARE"] if (!value) return undefined @@ -570,24 +574,49 @@ async function subscribeSessionEvents() { } async function summarize(response: string) { - const payload = useContext().payload as IssueCommentEvent try { return await chat(`Summarize the following in less than 40 characters:\n\n${response}`) } catch (e) { + if (isScheduleEvent()) { + return "Scheduled task changes" + } + const payload = useContext().payload as IssueCommentEvent return `Fix issue: ${payload.issue.title}` } } +async function resolveAgent(): Promise { + const envAgent = useEnvAgent() + if (!envAgent) return undefined + + // Validate the agent exists and is a primary agent + const agents = await client.agent.list() + const agent = agents.data?.find((a) => a.name === envAgent) + + if (!agent) { + console.warn(`agent "${envAgent}" not found. Falling back to default agent`) + return undefined + } + + if (agent.mode === "subagent") { + console.warn(`agent "${envAgent}" is a subagent, not a primary agent. Falling back to default agent`) + return undefined + } + + return envAgent +} + async function chat(text: string, files: PromptFiles = []) { console.log("Sending message to opencode...") const { providerID, modelID } = useEnvModel() + const agent = await resolveAgent() const chat = await client.session.chat({ path: session, body: { providerID, modelID, - agent: "build", + agent, parts: [ { type: "text", diff --git a/github/package.json b/github/package.json index 1a6598d6ba1..e1b913abedc 100644 --- a/github/package.json +++ b/github/package.json @@ -3,6 +3,7 @@ "module": "index.ts", "type": "module", "private": true, + "license": "MIT", "devDependencies": { "@types/bun": "catalog:" }, @@ -13,7 +14,7 @@ "@actions/core": "1.11.1", "@actions/github": "6.0.1", "@octokit/graphql": "9.0.1", - "@octokit/rest": "22.0.0", + "@octokit/rest": "catalog:", "@opencode-ai/sdk": "workspace:*" } } diff --git a/infra/app.ts b/infra/app.ts index 7215995badd..bb627f51ec5 100644 --- a/infra/app.ts +++ b/infra/app.ts @@ -4,6 +4,10 @@ const GITHUB_APP_ID = new sst.Secret("GITHUB_APP_ID") const GITHUB_APP_PRIVATE_KEY = new sst.Secret("GITHUB_APP_PRIVATE_KEY") export const EMAILOCTOPUS_API_KEY = new sst.Secret("EMAILOCTOPUS_API_KEY") const ADMIN_SECRET = new sst.Secret("ADMIN_SECRET") +const DISCORD_SUPPORT_BOT_TOKEN = new sst.Secret("DISCORD_SUPPORT_BOT_TOKEN") +const DISCORD_SUPPORT_CHANNEL_ID = new sst.Secret("DISCORD_SUPPORT_CHANNEL_ID") +const FEISHU_APP_ID = new sst.Secret("FEISHU_APP_ID") +const FEISHU_APP_SECRET = new sst.Secret("FEISHU_APP_SECRET") const bucket = new sst.cloudflare.Bucket("Bucket") export const api = new sst.cloudflare.Worker("Api", { @@ -13,7 +17,16 @@ export const api = new sst.cloudflare.Worker("Api", { WEB_DOMAIN: domain, }, url: true, - link: [bucket, GITHUB_APP_ID, GITHUB_APP_PRIVATE_KEY, ADMIN_SECRET], + link: [ + bucket, + GITHUB_APP_ID, + GITHUB_APP_PRIVATE_KEY, + ADMIN_SECRET, + DISCORD_SUPPORT_BOT_TOKEN, + DISCORD_SUPPORT_CHANNEL_ID, + FEISHU_APP_ID, + FEISHU_APP_SECRET, + ], transform: { worker: (args) => { args.logpush = true @@ -44,3 +57,12 @@ new sst.cloudflare.x.Astro("Web", { VITE_API_URL: api.url.apply((url) => url!), }, }) + +new sst.cloudflare.StaticSite("WebApp", { + domain: "app." + domain, + path: "packages/app", + build: { + command: "bun turbo build", + output: "./dist", + }, +}) diff --git a/infra/console.ts b/infra/console.ts index 8f54823f840..3d482160d02 100644 --- a/infra/console.ts +++ b/infra/console.ts @@ -76,6 +76,7 @@ export const stripeWebhook = new stripe.WebhookEndpoint("StripeWebhookEndpoint", "checkout.session.completed", "checkout.session.expired", "charge.refunded", + "invoice.payment_succeeded", "customer.created", "customer.deleted", "customer.updated", @@ -97,14 +98,42 @@ export const stripeWebhook = new stripe.WebhookEndpoint("StripeWebhookEndpoint", ], }) +const zenProduct = new stripe.Product("ZenBlack", { + name: "OpenCode Black", +}) +const zenPriceProps = { + product: zenProduct.id, + currency: "usd", + recurring: { + interval: "month", + intervalCount: 1, + }, +} +const zenPrice200 = new stripe.Price("ZenBlackPrice", { ...zenPriceProps, unitAmount: 20000 }) +const zenPrice100 = new stripe.Price("ZenBlack100Price", { ...zenPriceProps, unitAmount: 10000 }) +const zenPrice20 = new stripe.Price("ZenBlack20Price", { ...zenPriceProps, unitAmount: 2000 }) +const ZEN_BLACK_PRICE = new sst.Linkable("ZEN_BLACK_PRICE", { + properties: { + product: zenProduct.id, + plan200: zenPrice200.id, + plan100: zenPrice100.id, + plan20: zenPrice20.id, + }, +}) +const ZEN_BLACK_LIMITS = new sst.Secret("ZEN_BLACK_LIMITS") + const ZEN_MODELS = [ new sst.Secret("ZEN_MODELS1"), new sst.Secret("ZEN_MODELS2"), new sst.Secret("ZEN_MODELS3"), new sst.Secret("ZEN_MODELS4"), new sst.Secret("ZEN_MODELS5"), + new sst.Secret("ZEN_MODELS6"), + new sst.Secret("ZEN_MODELS7"), + new sst.Secret("ZEN_MODELS8"), ] const STRIPE_SECRET_KEY = new sst.Secret("STRIPE_SECRET_KEY") +const STRIPE_PUBLISHABLE_KEY = new sst.Secret("STRIPE_PUBLISHABLE_KEY") const AUTH_API_URL = new sst.Linkable("AUTH_API_URL", { properties: { value: auth.url.apply((url) => url!) }, }) @@ -118,6 +147,7 @@ const gatewayKv = new sst.cloudflare.Kv("GatewayKv") //////////////// const bucket = new sst.cloudflare.Bucket("ZenData") +const bucketNew = new sst.cloudflare.Bucket("ZenDataNew") const AWS_SES_ACCESS_KEY_ID = new sst.Secret("AWS_SES_ACCESS_KEY_ID") const AWS_SES_SECRET_ACCESS_KEY = new sst.Secret("AWS_SES_SECRET_ACCESS_KEY") @@ -136,6 +166,7 @@ new sst.cloudflare.x.SolidStart("Console", { path: "packages/console/app", link: [ bucket, + bucketNew, database, AUTH_API_URL, STRIPE_WEBHOOK_SECRET, @@ -143,6 +174,9 @@ new sst.cloudflare.x.SolidStart("Console", { EMAILOCTOPUS_API_KEY, AWS_SES_ACCESS_KEY_ID, AWS_SES_SECRET_ACCESS_KEY, + ZEN_BLACK_PRICE, + ZEN_BLACK_LIMITS, + new sst.Secret("ZEN_SESSION_SECRET"), ...ZEN_MODELS, ...($dev ? [ @@ -156,6 +190,7 @@ new sst.cloudflare.x.SolidStart("Console", { //VITE_DOCS_URL: web.url.apply((url) => url!), //VITE_API_URL: gateway.url.apply((url) => url!), VITE_AUTH_URL: auth.url.apply((url) => url!), + VITE_STRIPE_PUBLISHABLE_KEY: STRIPE_PUBLISHABLE_KEY.value, }, transform: { server: { diff --git a/infra/desktop.ts b/infra/desktop.ts deleted file mode 100644 index d4e32c65d72..00000000000 --- a/infra/desktop.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { domain } from "./stage" - -new sst.cloudflare.StaticSite("Desktop", { - domain: "desktop." + domain, - path: "packages/desktop", - build: { - command: "bun turbo build", - output: "./dist", - }, -}) diff --git a/install b/install index c6f20973458..22b7ca39ed7 100755 --- a/install +++ b/install @@ -7,112 +7,187 @@ RED='\033[0;31m' ORANGE='\033[38;5;214m' NC='\033[0m' # No Color +usage() { + cat < Install a specific version (e.g., 1.0.180) + -b, --binary Install from a local binary instead of downloading + --no-modify-path Don't modify shell config files (.zshrc, .bashrc, etc.) + +Examples: + curl -fsSL https://opencode.ai/install | bash + curl -fsSL https://opencode.ai/install | bash -s -- --version 1.0.180 + ./install --binary /path/to/opencode +EOF +} + requested_version=${VERSION:-} +no_modify_path=false +binary_path="" -raw_os=$(uname -s) -os=$(echo "$raw_os" | tr '[:upper:]' '[:lower:]') -case "$raw_os" in - Darwin*) os="darwin" ;; - Linux*) os="linux" ;; - MINGW*|MSYS*|CYGWIN*) os="windows" ;; -esac +while [[ $# -gt 0 ]]; do + case "$1" in + -h|--help) + usage + exit 0 + ;; + -v|--version) + if [[ -n "${2:-}" ]]; then + requested_version="$2" + shift 2 + else + echo -e "${RED}Error: --version requires a version argument${NC}" + exit 1 + fi + ;; + -b|--binary) + if [[ -n "${2:-}" ]]; then + binary_path="$2" + shift 2 + else + echo -e "${RED}Error: --binary requires a path argument${NC}" + exit 1 + fi + ;; + --no-modify-path) + no_modify_path=true + shift + ;; + *) + echo -e "${ORANGE}Warning: Unknown option '$1'${NC}" >&2 + shift + ;; + esac +done -arch=$(uname -m) -if [[ "$arch" == "aarch64" ]]; then - arch="arm64" -fi -if [[ "$arch" == "x86_64" ]]; then - arch="x64" -fi +INSTALL_DIR=$HOME/.opencode/bin +mkdir -p "$INSTALL_DIR" -if [ "$os" = "darwin" ] && [ "$arch" = "x64" ]; then - rosetta_flag=$(sysctl -n sysctl.proc_translated 2>/dev/null || echo 0) - if [ "$rosetta_flag" = "1" ]; then - arch="arm64" - fi -fi +# If --binary is provided, skip all download/detection logic +if [ -n "$binary_path" ]; then + if [ ! -f "$binary_path" ]; then + echo -e "${RED}Error: Binary not found at ${binary_path}${NC}" + exit 1 + fi + specific_version="local" +else + raw_os=$(uname -s) + os=$(echo "$raw_os" | tr '[:upper:]' '[:lower:]') + case "$raw_os" in + Darwin*) os="darwin" ;; + Linux*) os="linux" ;; + MINGW*|MSYS*|CYGWIN*) os="windows" ;; + esac -combo="$os-$arch" -case "$combo" in - linux-x64|linux-arm64|darwin-x64|darwin-arm64|windows-x64) - ;; - *) - echo -e "${RED}Unsupported OS/Arch: $os/$arch${NC}" - exit 1 - ;; -esac + arch=$(uname -m) + if [[ "$arch" == "aarch64" ]]; then + arch="arm64" + fi + if [[ "$arch" == "x86_64" ]]; then + arch="x64" + fi -archive_ext=".zip" -if [ "$os" = "linux" ]; then - archive_ext=".tar.gz" -fi + if [ "$os" = "darwin" ] && [ "$arch" = "x64" ]; then + rosetta_flag=$(sysctl -n sysctl.proc_translated 2>/dev/null || echo 0) + if [ "$rosetta_flag" = "1" ]; then + arch="arm64" + fi + fi -is_musl=false -if [ "$os" = "linux" ]; then - if [ -f /etc/alpine-release ]; then - is_musl=true - fi + combo="$os-$arch" + case "$combo" in + linux-x64|linux-arm64|darwin-x64|darwin-arm64|windows-x64) + ;; + *) + echo -e "${RED}Unsupported OS/Arch: $os/$arch${NC}" + exit 1 + ;; + esac - if command -v ldd >/dev/null 2>&1; then - if ldd --version 2>&1 | grep -qi musl; then - is_musl=true + archive_ext=".zip" + if [ "$os" = "linux" ]; then + archive_ext=".tar.gz" fi - fi -fi -needs_baseline=false -if [ "$arch" = "x64" ]; then - if [ "$os" = "linux" ]; then - if ! grep -qi avx2 /proc/cpuinfo 2>/dev/null; then - needs_baseline=true - fi - fi + is_musl=false + if [ "$os" = "linux" ]; then + if [ -f /etc/alpine-release ]; then + is_musl=true + fi - if [ "$os" = "darwin" ]; then - avx2=$(sysctl -n hw.optional.avx2_0 2>/dev/null || echo 0) - if [ "$avx2" != "1" ]; then - needs_baseline=true + if command -v ldd >/dev/null 2>&1; then + if ldd --version 2>&1 | grep -qi musl; then + is_musl=true + fi + fi fi - fi -fi - -target="$os-$arch" -if [ "$needs_baseline" = "true" ]; then - target="$target-baseline" -fi -if [ "$is_musl" = "true" ]; then - target="$target-musl" -fi -filename="$APP-$target$archive_ext" + needs_baseline=false + if [ "$arch" = "x64" ]; then + if [ "$os" = "linux" ]; then + if ! grep -qi avx2 /proc/cpuinfo 2>/dev/null; then + needs_baseline=true + fi + fi + if [ "$os" = "darwin" ]; then + avx2=$(sysctl -n hw.optional.avx2_0 2>/dev/null || echo 0) + if [ "$avx2" != "1" ]; then + needs_baseline=true + fi + fi + fi -if [ "$os" = "linux" ]; then - if ! command -v tar >/dev/null 2>&1; then - echo -e "${RED}Error: 'tar' is required but not installed.${NC}" - exit 1 + target="$os-$arch" + if [ "$needs_baseline" = "true" ]; then + target="$target-baseline" fi -else - if ! command -v unzip >/dev/null 2>&1; then - echo -e "${RED}Error: 'unzip' is required but not installed.${NC}" - exit 1 + if [ "$is_musl" = "true" ]; then + target="$target-musl" fi -fi -INSTALL_DIR=$HOME/.opencode/bin -mkdir -p "$INSTALL_DIR" + filename="$APP-$target$archive_ext" -if [ -z "$requested_version" ]; then - url="https://github.com/sst/opencode/releases/latest/download/$filename" - specific_version=$(curl -s https://api.github.com/repos/sst/opencode/releases/latest | sed -n 's/.*"tag_name": *"v\([^"]*\)".*/\1/p') - if [[ $? -ne 0 || -z "$specific_version" ]]; then - echo -e "${RED}Failed to fetch version information${NC}" - exit 1 + if [ "$os" = "linux" ]; then + if ! command -v tar >/dev/null 2>&1; then + echo -e "${RED}Error: 'tar' is required but not installed.${NC}" + exit 1 + fi + else + if ! command -v unzip >/dev/null 2>&1; then + echo -e "${RED}Error: 'unzip' is required but not installed.${NC}" + exit 1 + fi + fi + + if [ -z "$requested_version" ]; then + url="https://github.com/anomalyco/opencode/releases/latest/download/$filename" + specific_version=$(curl -s https://api.github.com/repos/anomalyco/opencode/releases/latest | sed -n 's/.*"tag_name": *"v\([^"]*\)".*/\1/p') + + if [[ $? -ne 0 || -z "$specific_version" ]]; then + echo -e "${RED}Failed to fetch version information${NC}" + exit 1 + fi + else + # Strip leading 'v' if present + requested_version="${requested_version#v}" + url="https://github.com/anomalyco/opencode/releases/download/v${requested_version}/$filename" + specific_version=$requested_version + + # Verify the release exists before downloading + http_status=$(curl -sI -o /dev/null -w "%{http_code}" "https://github.com/anomalyco/opencode/releases/tag/v${requested_version}") + if [ "$http_status" = "404" ]; then + echo -e "${RED}Error: Release v${requested_version} not found${NC}" + echo -e "${MUTED}Available releases: https://github.com/anomalyco/opencode/releases${NC}" + exit 1 + fi fi -else - url="https://github.com/sst/opencode/releases/download/v${requested_version}/$filename" - specific_version=$requested_version fi print_message() { @@ -133,11 +208,8 @@ check_version() { if command -v opencode >/dev/null 2>&1; then opencode_path=$(which opencode) - - ## TODO: check if version is installed - # installed_version=$(opencode version) - installed_version="0.0.1" - installed_version=$(echo $installed_version | awk '{print $2}') + ## Check the installed version + installed_version=$(opencode --version 2>/dev/null || echo "") if [[ "$installed_version" != "$specific_version" ]]; then print_message info "${MUTED}Installed version: ${NC}$installed_version." @@ -213,11 +285,11 @@ download_with_progress() { { local length=0 local bytes=0 - + while IFS=" " read -r -a line; do [ "${#line[@]}" -lt 2 ] && continue local tag="${line[0]} ${line[1]}" - + if [ "$tag" = "0000: content-length:" ]; then length="${line[2]}" length=$(echo "$length" | tr -d '\r') @@ -240,26 +312,37 @@ download_with_progress() { download_and_install() { print_message info "\n${MUTED}Installing ${NC}opencode ${MUTED}version: ${NC}$specific_version" - mkdir -p opencodetmp && cd opencodetmp - - if [[ "$os" == "windows" ]] || ! download_with_progress "$url" "$filename"; then - # Fallback to standard curl on Windows or if custom progress fails - curl -# -L -o "$filename" "$url" + local tmp_dir="${TMPDIR:-/tmp}/opencode_install_$$" + mkdir -p "$tmp_dir" + + if [[ "$os" == "windows" ]] || ! [ -t 2 ] || ! download_with_progress "$url" "$tmp_dir/$filename"; then + # Fallback to standard curl on Windows, non-TTY environments, or if custom progress fails + curl -# -L -o "$tmp_dir/$filename" "$url" fi if [ "$os" = "linux" ]; then - tar -xzf "$filename" + tar -xzf "$tmp_dir/$filename" -C "$tmp_dir" else - unzip -q "$filename" + unzip -q "$tmp_dir/$filename" -d "$tmp_dir" fi - - mv opencode "$INSTALL_DIR" + + mv "$tmp_dir/opencode" "$INSTALL_DIR" chmod 755 "${INSTALL_DIR}/opencode" - cd .. && rm -rf opencodetmp + rm -rf "$tmp_dir" } -check_version -download_and_install +install_from_binary() { + print_message info "\n${MUTED}Installing ${NC}opencode ${MUTED}from: ${NC}$binary_path" + cp "$binary_path" "${INSTALL_DIR}/opencode" + chmod 755 "${INSTALL_DIR}/opencode" +} + +if [ -n "$binary_path" ]; then + install_from_binary +else + check_version + download_and_install +fi add_to_path() { @@ -286,7 +369,7 @@ case $current_shell in config_files="$HOME/.config/fish/config.fish" ;; zsh) - config_files="$HOME/.zshrc $HOME/.zshenv $XDG_CONFIG_HOME/zsh/.zshrc $XDG_CONFIG_HOME/zsh/.zshenv" + config_files="${ZDOTDIR:-$HOME}/.zshrc ${ZDOTDIR:-$HOME}/.zshenv $XDG_CONFIG_HOME/zsh/.zshrc $XDG_CONFIG_HOME/zsh/.zshenv" ;; bash) config_files="$HOME/.bashrc $HOME/.bash_profile $HOME/.profile $XDG_CONFIG_HOME/bash/.bashrc $XDG_CONFIG_HOME/bash/.bash_profile" @@ -303,42 +386,42 @@ case $current_shell in ;; esac -config_file="" -for file in $config_files; do - if [[ -f $file ]]; then - config_file=$file - break +if [[ "$no_modify_path" != "true" ]]; then + config_file="" + for file in $config_files; do + if [[ -f $file ]]; then + config_file=$file + break + fi + done + + if [[ -z $config_file ]]; then + print_message warning "No config file found for $current_shell. You may need to manually add to PATH:" + print_message info " export PATH=$INSTALL_DIR:\$PATH" + elif [[ ":$PATH:" != *":$INSTALL_DIR:"* ]]; then + case $current_shell in + fish) + add_to_path "$config_file" "fish_add_path $INSTALL_DIR" + ;; + zsh) + add_to_path "$config_file" "export PATH=$INSTALL_DIR:\$PATH" + ;; + bash) + add_to_path "$config_file" "export PATH=$INSTALL_DIR:\$PATH" + ;; + ash) + add_to_path "$config_file" "export PATH=$INSTALL_DIR:\$PATH" + ;; + sh) + add_to_path "$config_file" "export PATH=$INSTALL_DIR:\$PATH" + ;; + *) + export PATH=$INSTALL_DIR:$PATH + print_message warning "Manually add the directory to $config_file (or similar):" + print_message info " export PATH=$INSTALL_DIR:\$PATH" + ;; + esac fi -done - -if [[ -z $config_file ]]; then - print_message error "No config file found for $current_shell. Checked files: ${config_files[@]}" - exit 1 -fi - -if [[ ":$PATH:" != *":$INSTALL_DIR:"* ]]; then - case $current_shell in - fish) - add_to_path "$config_file" "fish_add_path $INSTALL_DIR" - ;; - zsh) - add_to_path "$config_file" "export PATH=$INSTALL_DIR:\$PATH" - ;; - bash) - add_to_path "$config_file" "export PATH=$INSTALL_DIR:\$PATH" - ;; - ash) - add_to_path "$config_file" "export PATH=$INSTALL_DIR:\$PATH" - ;; - sh) - add_to_path "$config_file" "export PATH=$INSTALL_DIR:\$PATH" - ;; - *) - export PATH=$INSTALL_DIR:$PATH - print_message warning "Manually add the directory to $config_file (or similar):" - print_message info " export PATH=$INSTALL_DIR:\$PATH" - ;; - esac fi if [ -n "${GITHUB_ACTIONS-}" ] && [ "${GITHUB_ACTIONS}" == "true" ]; then @@ -361,4 +444,3 @@ echo -e "" echo -e "${MUTED}For more information visit ${NC}https://opencode.ai/docs" echo -e "" echo -e "" - diff --git a/nix/bundle.ts b/nix/bundle.ts deleted file mode 100644 index effb1dff7cc..00000000000 --- a/nix/bundle.ts +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env bun - -import solidPlugin from "./node_modules/@opentui/solid/scripts/solid-plugin" -import path from "path" -import fs from "fs" - -const dir = process.cwd() -const parser = fs.realpathSync(path.join(dir, "node_modules/@opentui/core/parser.worker.js")) -const worker = "./src/cli/cmd/tui/worker.ts" -const version = process.env.OPENCODE_VERSION ?? "local" -const channel = process.env.OPENCODE_CHANNEL ?? "local" - -fs.rmSync(path.join(dir, "dist"), { recursive: true, force: true }) - -const result = await Bun.build({ - entrypoints: ["./src/index.ts", worker, parser], - outdir: "./dist", - target: "bun", - sourcemap: "none", - tsconfig: "./tsconfig.json", - plugins: [solidPlugin], - external: ["@opentui/core"], - define: { - OPENCODE_VERSION: `'${version}'`, - OPENCODE_CHANNEL: `'${channel}'`, - // Leave undefined so runtime picks bundled/dist worker or fallback in code. - OPENCODE_WORKER_PATH: "undefined", - OTUI_TREE_SITTER_WORKER_PATH: 'new URL("./cli/cmd/tui/parser.worker.js", import.meta.url).href', - }, -}) - -if (!result.success) { - console.error("bundle failed") - for (const log of result.logs) console.error(log) - process.exit(1) -} - -const parserOut = path.join(dir, "dist/src/cli/cmd/tui/parser.worker.js") -fs.mkdirSync(path.dirname(parserOut), { recursive: true }) -await Bun.write(parserOut, Bun.file(parser)) diff --git a/nix/desktop.nix b/nix/desktop.nix new file mode 100644 index 00000000000..9625f75c271 --- /dev/null +++ b/nix/desktop.nix @@ -0,0 +1,100 @@ +{ + lib, + stdenv, + rustPlatform, + pkg-config, + cargo-tauri, + bun, + nodejs, + cargo, + rustc, + jq, + wrapGAppsHook4, + makeWrapper, + dbus, + glib, + gtk4, + libsoup_3, + librsvg, + libappindicator, + glib-networking, + openssl, + webkitgtk_4_1, + gst_all_1, + opencode, +}: +rustPlatform.buildRustPackage (finalAttrs: { + pname = "opencode-desktop"; + inherit (opencode) + version + src + node_modules + patches + ; + + cargoRoot = "packages/desktop/src-tauri"; + cargoLock.lockFile = ../packages/desktop/src-tauri/Cargo.lock; + buildAndTestSubdir = finalAttrs.cargoRoot; + + nativeBuildInputs = [ + pkg-config + cargo-tauri.hook + bun + nodejs # for patchShebangs node_modules + cargo + rustc + jq + makeWrapper + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ wrapGAppsHook4 ]; + + buildInputs = lib.optionals stdenv.isLinux [ + dbus + glib + gtk4 + libsoup_3 + librsvg + libappindicator + glib-networking + openssl + webkitgtk_4_1 + gst_all_1.gstreamer + gst_all_1.gst-plugins-base + gst_all_1.gst-plugins-good + ]; + + strictDeps = true; + + preBuild = '' + cp -a ${finalAttrs.node_modules}/{node_modules,packages} . + chmod -R u+w node_modules packages + patchShebangs node_modules + patchShebangs packages/desktop/node_modules + + mkdir -p packages/desktop/src-tauri/sidecars + cp ${opencode}/bin/opencode packages/desktop/src-tauri/sidecars/opencode-cli-${stdenv.hostPlatform.rust.rustcTarget} + ''; + + # see publish-tauri job in .github/workflows/publish.yml + tauriBuildFlags = [ + "--config" + "tauri.prod.conf.json" + "--no-sign" # no code signing or auto updates + ]; + + # FIXME: workaround for concerns about case insensitive filesystems + # should be removed once binary is renamed or decided otherwise + # darwin output is a .app bundle so no conflict + postFixup = lib.optionalString stdenv.hostPlatform.isLinux '' + mv $out/bin/OpenCode $out/bin/opencode-desktop + sed -i 's|^Exec=OpenCode$|Exec=opencode-desktop|' $out/share/applications/OpenCode.desktop + ''; + + meta = { + description = "OpenCode Desktop App"; + homepage = "https://opencode.ai"; + license = lib.licenses.mit; + mainProgram = "opencode-desktop"; + inherit (opencode.meta) platforms; + }; +}) \ No newline at end of file diff --git a/nix/hashes.json b/nix/hashes.json index 5f3baf1919c..80e646d45dd 100644 --- a/nix/hashes.json +++ b/nix/hashes.json @@ -1,3 +1,8 @@ { - "nodeModules": "sha256-lgPsYtNJT7a+mDk5cTiEJLlBnTMTjxZCl8bw5WxcuaM=" + "nodeModules": { + "x86_64-linux": "sha256-wSkJcUnS0ODOYkbkjRnxnjfWYKQOVXwkDNB8qrikuLA=", + "aarch64-linux": "sha256-4BlpH/oIXRJEjkQydXDv1oi1Yx7li3k1dKHUy2/Gb10=", + "aarch64-darwin": "sha256-awW0ooZo/QfB2xmRdZ9XLNzQ9sP/mbN+rTg215id6nc=", + "x86_64-darwin": "sha256-CHrE2z+LqY2WXTQeGWG5LNMF1AY4UGSwViJAy4IwIVw=" + } } diff --git a/nix/node-modules.nix b/nix/node-modules.nix deleted file mode 100644 index 7b22ef8e7da..00000000000 --- a/nix/node-modules.nix +++ /dev/null @@ -1,52 +0,0 @@ -{ hash, lib, stdenvNoCC, bun, cacert, curl }: -args: -stdenvNoCC.mkDerivation { - pname = "opencode-node_modules"; - version = args.version; - src = args.src; - - impureEnvVars = - lib.fetchers.proxyImpureEnvVars - ++ [ - "GIT_PROXY_COMMAND" - "SOCKS_SERVER" - ]; - - nativeBuildInputs = [ bun cacert curl ]; - - dontConfigure = true; - - buildPhase = '' - runHook preBuild - export HOME=$(mktemp -d) - export BUN_INSTALL_CACHE_DIR=$(mktemp -d) - bun install \ - --cpu="*" \ - --os="*" \ - --frozen-lockfile \ - --ignore-scripts \ - --no-progress \ - --linker=isolated - bun --bun ${args.canonicalizeScript} - bun --bun ${args.normalizeBinsScript} - runHook postBuild - ''; - - installPhase = '' - runHook preInstall - mkdir -p $out - while IFS= read -r dir; do - rel="''${dir#./}" - dest="$out/$rel" - mkdir -p "$(dirname "$dest")" - cp -R "$dir" "$dest" - done < <(find . -type d -name node_modules -prune | sort) - runHook postInstall - ''; - - dontFixup = true; - - outputHashAlgo = "sha256"; - outputHashMode = "recursive"; - outputHash = hash; -} diff --git a/nix/node_modules.nix b/nix/node_modules.nix new file mode 100644 index 00000000000..981a60ef9ba --- /dev/null +++ b/nix/node_modules.nix @@ -0,0 +1,85 @@ +{ + lib, + stdenvNoCC, + bun, + bunCpu ? if stdenvNoCC.hostPlatform.isAarch64 then "arm64" else "x64", + bunOs ? if stdenvNoCC.hostPlatform.isLinux then "linux" else "darwin", + rev ? "dirty", + hash ? + (lib.pipe ./hashes.json [ + builtins.readFile + builtins.fromJSON + ]).nodeModules.${stdenvNoCC.hostPlatform.system}, +}: +let + packageJson = lib.pipe ../packages/opencode/package.json [ + builtins.readFile + builtins.fromJSON + ]; +in +stdenvNoCC.mkDerivation { + pname = "opencode-node_modules"; + version = "${packageJson.version}-${rev}"; + + src = lib.fileset.toSource { + root = ../.; + fileset = lib.fileset.intersection (lib.fileset.fromSource (lib.sources.cleanSource ../.)) ( + lib.fileset.unions [ + ../packages + ../bun.lock + ../package.json + ../patches + ../install + ] + ); + }; + + impureEnvVars = lib.fetchers.proxyImpureEnvVars ++ [ + "GIT_PROXY_COMMAND" + "SOCKS_SERVER" + ]; + + nativeBuildInputs = [ + bun + ]; + + dontConfigure = true; + + buildPhase = '' + runHook preBuild + export HOME=$(mktemp -d) + export BUN_INSTALL_CACHE_DIR=$(mktemp -d) + bun install \ + --cpu="${bunCpu}" \ + --os="${bunOs}" \ + --frozen-lockfile \ + --ignore-scripts \ + --no-progress \ + --linker=isolated + bun --bun ${./scripts/canonicalize-node-modules.ts} + bun --bun ${./scripts/normalize-bun-binaries.ts} + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + + mkdir -p $out + find . -type d -name node_modules -exec cp -R --parents {} $out \; + + runHook postInstall + ''; + + dontFixup = true; + + outputHashAlgo = "sha256"; + outputHashMode = "recursive"; + outputHash = hash; + + meta.platforms = [ + "aarch64-linux" + "x86_64-linux" + "aarch64-darwin" + "x86_64-darwin" + ]; +} diff --git a/nix/opencode.nix b/nix/opencode.nix index 87b3f17ba99..23d9fbe34e0 100644 --- a/nix/opencode.nix +++ b/nix/opencode.nix @@ -1,58 +1,48 @@ -{ lib, stdenvNoCC, bun, ripgrep, makeBinaryWrapper }: -args: -let - scripts = args.scripts; - mkModules = - attrs: - args.mkNodeModules ( - attrs - // { - canonicalizeScript = scripts + "/canonicalize-node-modules.ts"; - normalizeBinsScript = scripts + "/normalize-bun-binaries.ts"; - } - ); -in +{ + lib, + stdenvNoCC, + callPackage, + bun, + sysctl, + makeBinaryWrapper, + models-dev, + ripgrep, + installShellFiles, + versionCheckHook, + writableTmpDirAsHomeHook, + node_modules ? callPackage ./node-modules.nix { }, +}: stdenvNoCC.mkDerivation (finalAttrs: { pname = "opencode"; - version = args.version; - - src = args.src; - - node_modules = mkModules { - version = finalAttrs.version; - src = finalAttrs.src; - }; + inherit (node_modules) version src; + inherit node_modules; nativeBuildInputs = [ bun + installShellFiles makeBinaryWrapper + models-dev + writableTmpDirAsHomeHook ]; - env.MODELS_DEV_API_JSON = args.modelsDev; - env.OPENCODE_VERSION = args.version; - env.OPENCODE_CHANNEL = "stable"; - dontConfigure = true; + configurePhase = '' + runHook preConfigure - buildPhase = '' - runHook preBuild + cp -R ${finalAttrs.node_modules}/. . - cp -r ${finalAttrs.node_modules}/node_modules . - cp -r ${finalAttrs.node_modules}/packages . + runHook postConfigure + ''; - ( - cd packages/opencode + env.MODELS_DEV_API_JSON = "${models-dev}/dist/_api.json"; + env.OPENCODE_VERSION = finalAttrs.version; + env.OPENCODE_CHANNEL = "local"; - chmod -R u+w ./node_modules - mkdir -p ./node_modules/@opencode-ai - rm -f ./node_modules/@opencode-ai/{script,sdk,plugin} - ln -s $(pwd)/../../packages/script ./node_modules/@opencode-ai/script - ln -s $(pwd)/../../packages/sdk/js ./node_modules/@opencode-ai/sdk - ln -s $(pwd)/../../packages/plugin ./node_modules/@opencode-ai/plugin + buildPhase = '' + runHook preBuild - cp ${./bundle.ts} ./bundle.ts - chmod +x ./bundle.ts - bun run ./bundle.ts - ) + cd ./packages/opencode + bun --bun ./script/build.ts --single --skip-install + bun --bun ./script/schema.ts schema.json runHook postBuild ''; @@ -60,76 +50,47 @@ stdenvNoCC.mkDerivation (finalAttrs: { installPhase = '' runHook preInstall - cd packages/opencode - if [ ! -d dist ]; then - echo "ERROR: dist directory missing after bundle step" - exit 1 - fi - - mkdir -p $out/lib/opencode - cp -r dist $out/lib/opencode/ - chmod -R u+w $out/lib/opencode/dist - - # Select bundled worker assets deterministically (sorted find output) - worker_file=$(find "$out/lib/opencode/dist" -type f \( -path '*/tui/worker.*' -o -name 'worker.*' \) | sort | head -n1) - parser_worker_file=$(find "$out/lib/opencode/dist" -type f -name 'parser.worker.*' | sort | head -n1) - if [ -z "$worker_file" ]; then - echo "ERROR: bundled worker not found" - exit 1 - fi - - main_wasm=$(printf '%s\n' "$out"/lib/opencode/dist/tree-sitter-*.wasm | sort | head -n1) - wasm_list=$(find "$out/lib/opencode/dist" -maxdepth 1 -name 'tree-sitter-*.wasm' -print) - for patch_file in "$worker_file" "$parser_worker_file"; do - [ -z "$patch_file" ] && continue - [ ! -f "$patch_file" ] && continue - if [ -n "$wasm_list" ] && grep -q 'tree-sitter' "$patch_file"; then - # Rewrite wasm references to absolute store paths to avoid runtime resolve failures. - bun --bun ${scripts + "/patch-wasm.ts"} "$patch_file" "$main_wasm" $wasm_list - fi - done - - mkdir -p $out/lib/opencode/node_modules - cp -r ../../node_modules/.bun $out/lib/opencode/node_modules/ - mkdir -p $out/lib/opencode/node_modules/@opentui - - mkdir -p $out/bin - makeWrapper ${bun}/bin/bun $out/bin/opencode \ - --add-flags "run" \ - --add-flags "$out/lib/opencode/dist/src/index.js" \ - --prefix PATH : ${lib.makeBinPath [ ripgrep ]} \ - --argv0 opencode + install -Dm755 dist/opencode-*/bin/opencode $out/bin/opencode + install -Dm644 schema.json $out/share/opencode/schema.json + + wrapProgram $out/bin/opencode \ + --prefix PATH : ${ + lib.makeBinPath ( + [ + ripgrep + ] + # bun runs sysctl to detect if dunning on rosetta2 + ++ lib.optional stdenvNoCC.hostPlatform.isDarwin sysctl + ) + } runHook postInstall ''; - postInstall = '' - for pkg in $out/lib/opencode/node_modules/.bun/@opentui+core-* $out/lib/opencode/node_modules/.bun/@opentui+solid-* $out/lib/opencode/node_modules/.bun/@opentui+core@* $out/lib/opencode/node_modules/.bun/@opentui+solid@*; do - if [ -d "$pkg" ]; then - pkgName=$(basename "$pkg" | sed 's/@opentui+\([^@]*\)@.*/\1/') - ln -sf ../.bun/$(basename "$pkg")/node_modules/@opentui/$pkgName \ - $out/lib/opencode/node_modules/@opentui/$pkgName - fi - done + postInstall = lib.optionalString (stdenvNoCC.buildPlatform.canExecute stdenvNoCC.hostPlatform) '' + # trick yargs into also generating zsh completions + installShellCompletion --cmd opencode \ + --bash <($out/bin/opencode completion) \ + --zsh <(SHELL=/bin/zsh $out/bin/opencode completion) ''; - dontFixup = true; + nativeInstallCheckInputs = [ + versionCheckHook + writableTmpDirAsHomeHook + ]; + doInstallCheck = true; + versionCheckKeepEnvironment = [ "HOME" ]; + versionCheckProgramArg = "--version"; + + passthru = { + jsonschema = "${placeholder "out"}/share/opencode/schema.json"; + }; meta = { - description = "AI coding agent built for the terminal"; - longDescription = '' - OpenCode is a terminal-based agent that can build anything. - It combines a TypeScript/JavaScript core with a Go-based TUI - to provide an interactive AI coding experience. - ''; - homepage = "https://github.com/sst/opencode"; + description = "The open source coding agent"; + homepage = "https://opencode.ai/"; license = lib.licenses.mit; - platforms = [ - "aarch64-linux" - "x86_64-linux" - "aarch64-darwin" - "x86_64-darwin" - ]; mainProgram = "opencode"; + inherit (node_modules.meta) platforms; }; }) diff --git a/nix/scripts/bun-build.ts b/nix/scripts/bun-build.ts deleted file mode 100644 index a227081639d..00000000000 --- a/nix/scripts/bun-build.ts +++ /dev/null @@ -1,115 +0,0 @@ -import solidPlugin from "./packages/opencode/node_modules/@opentui/solid/scripts/solid-plugin" -import path from "path" -import fs from "fs" - -const version = "@VERSION@" -const pkg = path.join(process.cwd(), "packages/opencode") -const parser = fs.realpathSync(path.join(pkg, "./node_modules/@opentui/core/parser.worker.js")) -const worker = "./src/cli/cmd/tui/worker.ts" -const target = process.env["BUN_COMPILE_TARGET"] - -if (!target) { - throw new Error("BUN_COMPILE_TARGET not set") -} - -process.chdir(pkg) - -const manifestName = "opencode-assets.manifest" -const manifestPath = path.join(pkg, manifestName) - -const readTrackedAssets = () => { - if (!fs.existsSync(manifestPath)) return [] - return fs - .readFileSync(manifestPath, "utf8") - .split("\n") - .map((line) => line.trim()) - .filter((line) => line.length > 0) -} - -const removeTrackedAssets = () => { - for (const file of readTrackedAssets()) { - const filePath = path.join(pkg, file) - if (fs.existsSync(filePath)) { - fs.rmSync(filePath, { force: true }) - } - } -} - -const assets = new Set() - -const addAsset = async (p: string) => { - const file = path.basename(p) - const dest = path.join(pkg, file) - await Bun.write(dest, Bun.file(p)) - assets.add(file) -} - -removeTrackedAssets() - -const result = await Bun.build({ - conditions: ["browser"], - tsconfig: "./tsconfig.json", - plugins: [solidPlugin], - sourcemap: "external", - entrypoints: ["./src/index.ts", parser, worker], - define: { - OPENCODE_VERSION: `'@VERSION@'`, - OTUI_TREE_SITTER_WORKER_PATH: "/$bunfs/root/" + path.relative(pkg, parser).replace(/\\/g, "/"), - OPENCODE_CHANNEL: "'latest'", - }, - compile: { - target, - outfile: "opencode", - execArgv: ["--user-agent=opencode/" + version, '--env-file=""', "--"], - windows: {}, - }, -}) - -if (!result.success) { - console.error("Build failed!") - for (const log of result.logs) { - console.error(log) - } - throw new Error("Compilation failed") -} - -const assetOutputs = result.outputs?.filter((x) => x.kind === "asset") ?? [] -for (const x of assetOutputs) { - await addAsset(x.path) -} - -const bundle = await Bun.build({ - entrypoints: [worker], - tsconfig: "./tsconfig.json", - plugins: [solidPlugin], - target: "bun", - outdir: "./.opencode-worker", - sourcemap: "none", -}) - -if (!bundle.success) { - console.error("Worker build failed!") - for (const log of bundle.logs) { - console.error(log) - } - throw new Error("Worker compilation failed") -} - -const workerAssets = bundle.outputs?.filter((x) => x.kind === "asset") ?? [] -for (const x of workerAssets) { - await addAsset(x.path) -} - -const output = bundle.outputs.find((x) => x.kind === "entry-point") -if (!output) { - throw new Error("Worker build produced no entry-point output") -} - -const dest = path.join(pkg, "opencode-worker.js") -await Bun.write(dest, Bun.file(output.path)) -fs.rmSync(path.dirname(output.path), { recursive: true, force: true }) - -const list = Array.from(assets) -await Bun.write(manifestPath, list.length > 0 ? list.join("\n") + "\n" : "") - -console.log("Build successful!") diff --git a/nix/scripts/patch-wasm.ts b/nix/scripts/patch-wasm.ts deleted file mode 100644 index 99f8a40e9f3..00000000000 --- a/nix/scripts/patch-wasm.ts +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env bun - -import fs from "fs" -import path from "path" - -/** - * Rewrite tree-sitter wasm references inside a JS file to absolute paths. - * argv: [node, script, file, mainWasm, ...wasmPaths] - */ -const [, , file, mainWasm, ...wasmPaths] = process.argv - -if (!file || !mainWasm) { - console.error("usage: patch-wasm [wasmPaths...]") - process.exit(1) -} - -const content = fs.readFileSync(file, "utf8") -const byName = new Map() - -for (const wasm of wasmPaths) { - const name = path.basename(wasm) - byName.set(name, wasm) -} - -let next = content - -for (const [name, wasmPath] of byName) { - next = next.replaceAll(name, wasmPath) -} - -next = next.replaceAll("tree-sitter.wasm", mainWasm).replaceAll("web-tree-sitter/tree-sitter.wasm", mainWasm) - -// Collapse any relative prefixes before absolute store paths (e.g., "../../../..//nix/store/...") -next = next.replace(/(\.\/)+/g, "./") -next = next.replace(/(\.\.\/)+\/?(\/nix\/store[^"']+)/g, "/$2") -next = next.replace(/(["'])\/{2,}(\/nix\/store[^"']+)(["'])/g, "$1/$2$3") -next = next.replace(/(["'])\/\/(nix\/store[^"']+)(["'])/g, "$1/$2$3") - -if (next !== content) fs.writeFileSync(file, next) diff --git a/nix/scripts/update-hashes.sh b/nix/scripts/update-hashes.sh deleted file mode 100755 index 7bf183c5b32..00000000000 --- a/nix/scripts/update-hashes.sh +++ /dev/null @@ -1,112 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -DUMMY="sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" -SYSTEM=${SYSTEM:-x86_64-linux} -DEFAULT_HASH_FILE=${MODULES_HASH_FILE:-nix/hashes.json} -HASH_FILE=${HASH_FILE:-$DEFAULT_HASH_FILE} - -if [ ! -f "$HASH_FILE" ]; then - cat >"$HASH_FILE" </dev/null 2>&1; then - if ! git ls-files --error-unmatch "$HASH_FILE" >/dev/null 2>&1; then - git add -N "$HASH_FILE" >/dev/null 2>&1 || true - fi -fi - -export DUMMY -export NIX_KEEP_OUTPUTS=1 -export NIX_KEEP_DERIVATIONS=1 - -cleanup() { - rm -f "${JSON_OUTPUT:-}" "${BUILD_LOG:-}" "${TMP_EXPR:-}" -} - -trap cleanup EXIT - -write_node_modules_hash() { - local value="$1" - local temp - temp=$(mktemp) - jq --arg value "$value" '.nodeModules = $value' "$HASH_FILE" >"$temp" - mv "$temp" "$HASH_FILE" -} - -TARGET="packages.${SYSTEM}.default" -MODULES_ATTR=".#packages.${SYSTEM}.default.node_modules" -CORRECT_HASH="" - -DRV_PATH="$(nix eval --raw "${MODULES_ATTR}.drvPath")" - -echo "Setting dummy node_modules outputHash for ${SYSTEM}..." -write_node_modules_hash "$DUMMY" - -BUILD_LOG=$(mktemp) -JSON_OUTPUT=$(mktemp) - -echo "Building node_modules for ${SYSTEM} to discover correct outputHash..." -echo "Attempting to realize derivation: ${DRV_PATH}" -REALISE_OUT=$(nix-store --realise "$DRV_PATH" --keep-failed 2>&1 | tee "$BUILD_LOG" || true) - -BUILD_PATH=$(echo "$REALISE_OUT" | grep "^/nix/store/" | head -n1 || true) -if [ -n "$BUILD_PATH" ] && [ -d "$BUILD_PATH" ]; then - echo "Realized node_modules output: $BUILD_PATH" - CORRECT_HASH=$(nix hash path --sri "$BUILD_PATH" 2>/dev/null || true) -fi - -if [ -z "$CORRECT_HASH" ]; then - CORRECT_HASH="$(grep -E 'got:\s+sha256-[A-Za-z0-9+/=]+' "$BUILD_LOG" | awk '{print $2}' | head -n1 || true)" - - if [ -z "$CORRECT_HASH" ]; then - CORRECT_HASH="$(grep -A2 'hash mismatch' "$BUILD_LOG" | grep 'got:' | awk '{print $2}' | sed 's/sha256:/sha256-/' || true)" - fi - - if [ -z "$CORRECT_HASH" ]; then - echo "Searching for kept failed build directory..." - KEPT_DIR=$(grep -oE "build directory.*'[^']+'" "$BUILD_LOG" | grep -oE "'/[^']+'" | tr -d "'" | head -n1) - - if [ -z "$KEPT_DIR" ]; then - KEPT_DIR=$(grep -oE '/nix/var/nix/builds/[^ ]+' "$BUILD_LOG" | head -n1) - fi - - if [ -n "$KEPT_DIR" ] && [ -d "$KEPT_DIR" ]; then - echo "Found kept build directory: $KEPT_DIR" - if [ -d "$KEPT_DIR/build" ]; then - HASH_PATH="$KEPT_DIR/build" - else - HASH_PATH="$KEPT_DIR" - fi - - echo "Attempting to hash: $HASH_PATH" - ls -la "$HASH_PATH" || true - - if [ -d "$HASH_PATH/node_modules" ]; then - CORRECT_HASH=$(nix hash path --sri "$HASH_PATH" 2>/dev/null || true) - echo "Computed hash from kept build: $CORRECT_HASH" - fi - fi - fi -fi - -if [ -z "$CORRECT_HASH" ]; then - echo "Failed to determine correct node_modules hash for ${SYSTEM}." - echo "Build log:" - cat "$BUILD_LOG" - exit 1 -fi - -write_node_modules_hash "$CORRECT_HASH" - -jq -e --arg hash "$CORRECT_HASH" '.nodeModules == $hash' "$HASH_FILE" >/dev/null - -echo "node_modules hash updated for ${SYSTEM}: $CORRECT_HASH" - -rm -f "$BUILD_LOG" -unset BUILD_LOG diff --git a/package.json b/package.json index ca2a10f784b..4267ef64566 100644 --- a/package.json +++ b/package.json @@ -4,13 +4,14 @@ "description": "AI-powered development tool", "private": true, "type": "module", - "packageManager": "bun@1.3.4", + "packageManager": "bun@1.3.5", "scripts": { "dev": "bun run --cwd packages/opencode --conditions=browser src/index.ts", "typecheck": "bun turbo typecheck", "prepare": "husky", "random": "echo 'Random script'", - "hello": "echo 'Hello World!'" + "hello": "echo 'Hello World!'", + "test": "echo 'do not run tests from root' && exit 1" }, "workspaces": { "packages": [ @@ -20,28 +21,36 @@ "packages/slack" ], "catalog": { - "@types/bun": "1.3.4", + "@types/bun": "1.3.5", + "@octokit/rest": "22.0.0", "@hono/zod-validator": "0.4.2", "ulid": "3.0.1", "@kobalte/core": "0.13.11", "@types/luxon": "3.7.1", "@types/node": "22.13.9", + "@types/semver": "7.7.1", "@tsconfig/node22": "22.0.2", "@tsconfig/bun": "1.0.9", "@cloudflare/workers-types": "4.20251008.0", "@openauthjs/openauth": "0.0.0-20250322224806", - "@pierre/precision-diffs": "0.6.1", + "@pierre/diffs": "1.0.2", + "@solid-primitives/storage": "4.3.3", "@tailwindcss/vite": "4.1.11", "diff": "8.0.2", - "ai": "5.0.97", + "dompurify": "3.3.1", + "ai": "5.0.119", "hono": "4.10.7", "hono-openapi": "1.1.2", "fuzzysort": "3.1.0", "luxon": "3.6.1", + "marked": "17.0.1", + "marked-shiki": "1.2.1", + "@playwright/test": "1.51.0", "typescript": "5.8.2", "@typescript/native-preview": "7.0.0-dev.20251207.1", "zod": "4.1.8", "remeda": "2.26.0", + "shiki": "3.20.0", "solid-list": "0.3.0", "tailwindcss": "4.1.11", "virtua": "0.42.3", @@ -54,21 +63,24 @@ } }, "devDependencies": { + "@actions/artifact": "5.0.1", "@tsconfig/bun": "catalog:", "husky": "9.1.7", "prettier": "3.6.2", + "semver": "^7.6.0", "sst": "3.17.23", "turbo": "2.5.6" }, "dependencies": { "@aws-sdk/client-s3": "3.933.0", + "@opencode-ai/plugin": "workspace:*", "@opencode-ai/script": "workspace:*", "@opencode-ai/sdk": "workspace:*", "typescript": "catalog:" }, "repository": { "type": "git", - "url": "https://github.com/sst/opencode" + "url": "https://github.com/anomalyco/opencode" }, "license": "MIT", "prettier": { @@ -78,7 +90,6 @@ "trustedDependencies": [ "esbuild", "protobufjs", - "sharp", "tree-sitter", "tree-sitter-bash", "web-tree-sitter" diff --git a/packages/app/.gitignore b/packages/app/.gitignore new file mode 100644 index 00000000000..d699efb38d2 --- /dev/null +++ b/packages/app/.gitignore @@ -0,0 +1,3 @@ +src/assets/theme.css +e2e/test-results +e2e/playwright-report diff --git a/packages/app/AGENTS.md b/packages/app/AGENTS.md new file mode 100644 index 00000000000..765e960c817 --- /dev/null +++ b/packages/app/AGENTS.md @@ -0,0 +1,30 @@ +## Debugging + +- NEVER try to restart the app, or the server process, EVER. + +## Local Dev + +- `opencode dev web` proxies `https://app.opencode.ai`, so local UI/CSS changes will not show there. +- For local UI changes, run the backend and app dev servers separately. +- Backend (from `packages/opencode`): `bun run --conditions=browser ./src/index.ts serve --port 4096` +- App (from `packages/app`): `bun dev -- --port 4444` +- Open `http://localhost:4444` to verify UI changes (it targets the backend at `http://localhost:4096`). + +## SolidJS + +- Always prefer `createStore` over multiple `createSignal` calls + +## Tool Calling + +- ALWAYS USE PARALLEL TOOLS WHEN APPLICABLE. + +## Browser Automation + +Use `agent-browser` for web automation. Run `agent-browser --help` for all commands. + +Core workflow: + +1. `agent-browser open ` - Navigate to page +2. `agent-browser snapshot -i` - Get interactive elements with refs (@e1, @e2) +3. `agent-browser click @e1` / `fill @e2 "text"` - Interact using refs +4. Re-snapshot after page changes diff --git a/packages/app/README.md b/packages/app/README.md new file mode 100644 index 00000000000..54d1b2861b6 --- /dev/null +++ b/packages/app/README.md @@ -0,0 +1,51 @@ +## Usage + +Dependencies for these templates are managed with [pnpm](https://pnpm.io) using `pnpm up -Lri`. + +This is the reason you see a `pnpm-lock.yaml`. That said, any package manager will work. This file can safely be removed once you clone a template. + +```bash +$ npm install # or pnpm install or yarn install +``` + +### Learn more on the [Solid Website](https://solidjs.com) and come chat with us on our [Discord](https://discord.com/invite/solidjs) + +## Available Scripts + +In the project directory, you can run: + +### `npm run dev` or `npm start` + +Runs the app in the development mode.
+Open [http://localhost:3000](http://localhost:3000) to view it in the browser. + +The page will reload if you make edits.
+ +### `npm run build` + +Builds the app for production to the `dist` folder.
+It correctly bundles Solid in production mode and optimizes the build for the best performance. + +The build is minified and the filenames include the hashes.
+Your app is ready to be deployed! + +## E2E Testing + +Playwright starts the Vite dev server automatically via `webServer`, and UI tests need an opencode backend (defaults to `localhost:4096`). +Use the local runner to create a temp sandbox, seed data, and run the tests. + +```bash +bunx playwright install +bun run test:e2e:local +bun run test:e2e:local -- --grep "settings" +``` + +Environment options: + +- `PLAYWRIGHT_SERVER_HOST` / `PLAYWRIGHT_SERVER_PORT` (backend address, default: `localhost:4096`) +- `PLAYWRIGHT_PORT` (Vite dev server port, default: `3000`) +- `PLAYWRIGHT_BASE_URL` (override base URL, default: `http://localhost:`) + +## Deployment + +You can deploy the `dist` folder to any static host provider (netlify, surge, now, etc.) diff --git a/packages/desktop/bunfig.toml b/packages/app/bunfig.toml similarity index 100% rename from packages/desktop/bunfig.toml rename to packages/app/bunfig.toml diff --git a/packages/app/e2e/context.spec.ts b/packages/app/e2e/context.spec.ts new file mode 100644 index 00000000000..beabd2eb7dd --- /dev/null +++ b/packages/app/e2e/context.spec.ts @@ -0,0 +1,45 @@ +import { test, expect } from "./fixtures" +import { promptSelector } from "./utils" + +test("context panel can be opened from the prompt", async ({ page, sdk, gotoSession }) => { + const title = `e2e smoke context ${Date.now()}` + const created = await sdk.session.create({ title }).then((r) => r.data) + + if (!created?.id) throw new Error("Session create did not return an id") + const sessionID = created.id + + try { + await sdk.session.promptAsync({ + sessionID, + noReply: true, + parts: [ + { + type: "text", + text: "seed context", + }, + ], + }) + + await expect + .poll(async () => { + const messages = await sdk.session.messages({ sessionID, limit: 1 }).then((r) => r.data ?? []) + return messages.length + }) + .toBeGreaterThan(0) + + await gotoSession(sessionID) + + const contextButton = page + .locator('[data-component="button"]') + .filter({ has: page.locator('[data-component="progress-circle"]').first() }) + .first() + + await expect(contextButton).toBeVisible() + await contextButton.click() + + const tabs = page.locator('[data-component="tabs"][data-variant="normal"]') + await expect(tabs.getByRole("tab", { name: "Context" })).toBeVisible() + } finally { + await sdk.session.delete({ sessionID }).catch(() => undefined) + } +}) diff --git a/packages/app/e2e/file-open.spec.ts b/packages/app/e2e/file-open.spec.ts new file mode 100644 index 00000000000..fb7104b6b05 --- /dev/null +++ b/packages/app/e2e/file-open.spec.ts @@ -0,0 +1,23 @@ +import { test, expect } from "./fixtures" +import { modKey } from "./utils" + +test("can open a file tab from the search palette", async ({ page, gotoSession }) => { + await gotoSession() + + await page.keyboard.press(`${modKey}+P`) + + const dialog = page.getByRole("dialog") + await expect(dialog).toBeVisible() + + const input = dialog.getByRole("textbox").first() + await input.fill("package.json") + + const fileItem = dialog.locator('[data-slot="list-item"][data-key^="file:"]').first() + await expect(fileItem).toBeVisible() + await fileItem.click() + + await expect(dialog).toHaveCount(0) + + const tabs = page.locator('[data-component="tabs"][data-variant="normal"]') + await expect(tabs.locator('[data-slot="tabs-trigger"]').first()).toBeVisible() +}) diff --git a/packages/app/e2e/file-viewer.spec.ts b/packages/app/e2e/file-viewer.spec.ts new file mode 100644 index 00000000000..1e0f8a6f23a --- /dev/null +++ b/packages/app/e2e/file-viewer.spec.ts @@ -0,0 +1,35 @@ +import { test, expect } from "./fixtures" +import { modKey } from "./utils" + +test("smoke file viewer renders real file content", async ({ page, gotoSession }) => { + await gotoSession() + + const sep = process.platform === "win32" ? "\\" : "/" + const file = ["packages", "app", "package.json"].join(sep) + + await page.keyboard.press(`${modKey}+P`) + + const dialog = page.getByRole("dialog") + await expect(dialog).toBeVisible() + + const input = dialog.getByRole("textbox").first() + await input.fill(file) + + const fileItem = dialog + .locator( + '[data-slot="list-item"][data-key^="file:"][data-key*="packages"][data-key*="app"][data-key$="package.json"]', + ) + .first() + await expect(fileItem).toBeVisible() + await fileItem.click() + + await expect(dialog).toHaveCount(0) + + const tab = page.getByRole("tab", { name: "package.json" }) + await expect(tab).toBeVisible() + await tab.click() + + const code = page.locator('[data-component="code"]').first() + await expect(code).toBeVisible() + await expect(code.getByText("@opencode-ai/app")).toBeVisible() +}) diff --git a/packages/app/e2e/fixtures.ts b/packages/app/e2e/fixtures.ts new file mode 100644 index 00000000000..721d60049ce --- /dev/null +++ b/packages/app/e2e/fixtures.ts @@ -0,0 +1,40 @@ +import { test as base, expect } from "@playwright/test" +import { createSdk, dirSlug, getWorktree, promptSelector, sessionPath } from "./utils" + +type TestFixtures = { + sdk: ReturnType + gotoSession: (sessionID?: string) => Promise +} + +type WorkerFixtures = { + directory: string + slug: string +} + +export const test = base.extend({ + directory: [ + async ({}, use) => { + const directory = await getWorktree() + await use(directory) + }, + { scope: "worker" }, + ], + slug: [ + async ({ directory }, use) => { + await use(dirSlug(directory)) + }, + { scope: "worker" }, + ], + sdk: async ({ directory }, use) => { + await use(createSdk(directory)) + }, + gotoSession: async ({ page, directory }, use) => { + const gotoSession = async (sessionID?: string) => { + await page.goto(sessionPath(directory, sessionID)) + await expect(page.locator(promptSelector)).toBeVisible() + } + await use(gotoSession) + }, +}) + +export { expect } diff --git a/packages/app/e2e/home.spec.ts b/packages/app/e2e/home.spec.ts new file mode 100644 index 00000000000..c6fb0e3b074 --- /dev/null +++ b/packages/app/e2e/home.spec.ts @@ -0,0 +1,21 @@ +import { test, expect } from "./fixtures" +import { serverName } from "./utils" + +test("home renders and shows core entrypoints", async ({ page }) => { + await page.goto("/") + + await expect(page.getByRole("button", { name: "Open project" }).first()).toBeVisible() + await expect(page.getByRole("button", { name: serverName })).toBeVisible() +}) + +test("server picker dialog opens from home", async ({ page }) => { + await page.goto("/") + + const trigger = page.getByRole("button", { name: serverName }) + await expect(trigger).toBeVisible() + await trigger.click() + + const dialog = page.getByRole("dialog") + await expect(dialog).toBeVisible() + await expect(dialog.getByRole("textbox").first()).toBeVisible() +}) diff --git a/packages/app/e2e/model-picker.spec.ts b/packages/app/e2e/model-picker.spec.ts new file mode 100644 index 00000000000..9e64b3dfb0a --- /dev/null +++ b/packages/app/e2e/model-picker.spec.ts @@ -0,0 +1,43 @@ +import { test, expect } from "./fixtures" +import { promptSelector } from "./utils" + +test("smoke model selection updates prompt footer", async ({ page, gotoSession }) => { + await gotoSession() + + await page.locator(promptSelector).click() + await page.keyboard.type("/model") + + const command = page.locator('[data-slash-id="model.choose"]') + await expect(command).toBeVisible() + await command.hover() + + await page.keyboard.press("Enter") + + const dialog = page.getByRole("dialog") + await expect(dialog).toBeVisible() + + const input = dialog.getByRole("textbox").first() + + const selected = dialog.locator('[data-slot="list-item"][data-selected="true"]').first() + await expect(selected).toBeVisible() + + const other = dialog.locator('[data-slot="list-item"]:not([data-selected="true"])').first() + const target = (await other.count()) > 0 ? other : selected + + const key = await target.getAttribute("data-key") + if (!key) throw new Error("Failed to resolve model key from list item") + + const name = (await target.locator("span").first().innerText()).trim() + const model = key.split(":").slice(1).join(":") + + await input.fill(model) + + const item = dialog.locator(`[data-slot="list-item"][data-key="${key}"]`) + await expect(item).toBeVisible() + await item.click() + + await expect(dialog).toHaveCount(0) + + const form = page.locator(promptSelector).locator("xpath=ancestor::form[1]") + await expect(form.locator('[data-component="button"]').filter({ hasText: name }).first()).toBeVisible() +}) diff --git a/packages/app/e2e/navigation.spec.ts b/packages/app/e2e/navigation.spec.ts new file mode 100644 index 00000000000..76923af6ede --- /dev/null +++ b/packages/app/e2e/navigation.spec.ts @@ -0,0 +1,9 @@ +import { test, expect } from "./fixtures" +import { dirPath, promptSelector } from "./utils" + +test("project route redirects to /session", async ({ page, directory, slug }) => { + await page.goto(dirPath(directory)) + + await expect(page).toHaveURL(new RegExp(`/${slug}/session`)) + await expect(page.locator(promptSelector)).toBeVisible() +}) diff --git a/packages/app/e2e/palette.spec.ts b/packages/app/e2e/palette.spec.ts new file mode 100644 index 00000000000..617c55ac167 --- /dev/null +++ b/packages/app/e2e/palette.spec.ts @@ -0,0 +1,15 @@ +import { test, expect } from "./fixtures" +import { modKey } from "./utils" + +test("search palette opens and closes", async ({ page, gotoSession }) => { + await gotoSession() + + await page.keyboard.press(`${modKey}+P`) + + const dialog = page.getByRole("dialog") + await expect(dialog).toBeVisible() + await expect(dialog.getByRole("textbox").first()).toBeVisible() + + await page.keyboard.press("Escape") + await expect(dialog).toHaveCount(0) +}) diff --git a/packages/app/e2e/prompt-mention.spec.ts b/packages/app/e2e/prompt-mention.spec.ts new file mode 100644 index 00000000000..113b8465f71 --- /dev/null +++ b/packages/app/e2e/prompt-mention.spec.ts @@ -0,0 +1,26 @@ +import { test, expect } from "./fixtures" +import { promptSelector } from "./utils" + +test("smoke @mention inserts file pill token", async ({ page, gotoSession }) => { + await gotoSession() + + await page.locator(promptSelector).click() + const sep = process.platform === "win32" ? "\\" : "/" + const file = ["packages", "app", "package.json"].join(sep) + const filePattern = /packages[\\/]+app[\\/]+\s*package\.json/ + + await page.keyboard.type(`@${file}`) + + const suggestion = page.getByRole("button", { name: filePattern }).first() + await expect(suggestion).toBeVisible() + await suggestion.hover() + + await page.keyboard.press("Tab") + + const pill = page.locator(`${promptSelector} [data-type="file"]`).first() + await expect(pill).toBeVisible() + await expect(pill).toHaveAttribute("data-path", filePattern) + + await page.keyboard.type(" ok") + await expect(page.locator(promptSelector)).toContainText("ok") +}) diff --git a/packages/app/e2e/prompt-slash-open.spec.ts b/packages/app/e2e/prompt-slash-open.spec.ts new file mode 100644 index 00000000000..3c29d405c18 --- /dev/null +++ b/packages/app/e2e/prompt-slash-open.spec.ts @@ -0,0 +1,22 @@ +import { test, expect } from "./fixtures" +import { promptSelector } from "./utils" + +test("smoke /open opens file picker dialog", async ({ page, gotoSession }) => { + await gotoSession() + + await page.locator(promptSelector).click() + await page.keyboard.type("/open") + + const command = page.locator('[data-slash-id="file.open"]') + await expect(command).toBeVisible() + await command.hover() + + await page.keyboard.press("Enter") + + const dialog = page.getByRole("dialog") + await expect(dialog).toBeVisible() + await expect(dialog.getByRole("textbox").first()).toBeVisible() + + await page.keyboard.press("Escape") + await expect(dialog).toHaveCount(0) +}) diff --git a/packages/app/e2e/prompt.spec.ts b/packages/app/e2e/prompt.spec.ts new file mode 100644 index 00000000000..3e5892ce8d5 --- /dev/null +++ b/packages/app/e2e/prompt.spec.ts @@ -0,0 +1,62 @@ +import { test, expect } from "./fixtures" +import { promptSelector } from "./utils" + +function sessionIDFromUrl(url: string) { + const match = /\/session\/([^/?#]+)/.exec(url) + return match?.[1] +} + +test("can send a prompt and receive a reply", async ({ page, sdk, gotoSession }) => { + test.setTimeout(120_000) + + const pageErrors: string[] = [] + const onPageError = (err: Error) => { + pageErrors.push(err.message) + } + page.on("pageerror", onPageError) + + await gotoSession() + + const token = `E2E_OK_${Date.now()}` + + const prompt = page.locator(promptSelector) + await prompt.click() + await page.keyboard.type(`Reply with exactly: ${token}`) + await page.keyboard.press("Enter") + + await expect(page).toHaveURL(/\/session\/[^/?#]+/, { timeout: 30_000 }) + + const sessionID = (() => { + const id = sessionIDFromUrl(page.url()) + if (!id) throw new Error(`Failed to parse session id from url: ${page.url()}`) + return id + })() + + try { + await expect + .poll( + async () => { + const messages = await sdk.session.messages({ sessionID, limit: 50 }).then((r) => r.data ?? []) + return messages + .filter((m) => m.info.role === "assistant") + .flatMap((m) => m.parts) + .filter((p) => p.type === "text") + .map((p) => p.text) + .join("\n") + }, + { timeout: 90_000 }, + ) + + .toContain(token) + + const reply = page.locator('[data-slot="session-turn-summary-section"]').filter({ hasText: token }).first() + await expect(reply).toBeVisible({ timeout: 90_000 }) + } finally { + page.off("pageerror", onPageError) + await sdk.session.delete({ sessionID }).catch(() => undefined) + } + + if (pageErrors.length > 0) { + throw new Error(`Page error(s):\n${pageErrors.join("\n")}`) + } +}) diff --git a/packages/app/e2e/session.spec.ts b/packages/app/e2e/session.spec.ts new file mode 100644 index 00000000000..19e25a42131 --- /dev/null +++ b/packages/app/e2e/session.spec.ts @@ -0,0 +1,21 @@ +import { test, expect } from "./fixtures" +import { promptSelector } from "./utils" + +test("can open an existing session and type into the prompt", async ({ page, sdk, gotoSession }) => { + const title = `e2e smoke ${Date.now()}` + const created = await sdk.session.create({ title }).then((r) => r.data) + + if (!created?.id) throw new Error("Session create did not return an id") + const sessionID = created.id + + try { + await gotoSession(sessionID) + + const prompt = page.locator(promptSelector) + await prompt.click() + await page.keyboard.type("hello from e2e") + await expect(prompt).toContainText("hello from e2e") + } finally { + await sdk.session.delete({ sessionID }).catch(() => undefined) + } +}) diff --git a/packages/app/e2e/settings.spec.ts b/packages/app/e2e/settings.spec.ts new file mode 100644 index 00000000000..09dc942cc92 --- /dev/null +++ b/packages/app/e2e/settings.spec.ts @@ -0,0 +1,44 @@ +import { test, expect } from "./fixtures" +import { modKey } from "./utils" + +test("smoke settings dialog opens, switches tabs, closes", async ({ page, gotoSession }) => { + await gotoSession() + + const dialog = page.getByRole("dialog") + + await page.keyboard.press(`${modKey}+Comma`).catch(() => undefined) + + const opened = await dialog + .waitFor({ state: "visible", timeout: 3000 }) + .then(() => true) + .catch(() => false) + + if (!opened) { + await page.getByRole("button", { name: "Settings" }).first().click() + await expect(dialog).toBeVisible() + } + + await dialog.getByRole("tab", { name: "Shortcuts" }).click() + await expect(dialog.getByRole("button", { name: "Reset to defaults" })).toBeVisible() + await expect(dialog.getByPlaceholder("Search shortcuts")).toBeVisible() + + await page.keyboard.press("Escape") + + const closed = await dialog + .waitFor({ state: "detached", timeout: 1500 }) + .then(() => true) + .catch(() => false) + + if (closed) return + + await page.keyboard.press("Escape") + const closedSecond = await dialog + .waitFor({ state: "detached", timeout: 1500 }) + .then(() => true) + .catch(() => false) + + if (closedSecond) return + + await page.locator('[data-component="dialog-overlay"]').click({ position: { x: 5, y: 5 } }) + await expect(dialog).toHaveCount(0) +}) diff --git a/packages/app/e2e/sidebar.spec.ts b/packages/app/e2e/sidebar.spec.ts new file mode 100644 index 00000000000..925590f5106 --- /dev/null +++ b/packages/app/e2e/sidebar.spec.ts @@ -0,0 +1,21 @@ +import { test, expect } from "./fixtures" +import { modKey } from "./utils" + +test("sidebar can be collapsed and expanded", async ({ page, gotoSession }) => { + await gotoSession() + + const main = page.locator("main") + const closedClass = /xl:border-l/ + const isClosed = await main.evaluate((node) => node.className.includes("xl:border-l")) + + if (isClosed) { + await page.keyboard.press(`${modKey}+B`) + await expect(main).not.toHaveClass(closedClass) + } + + await page.keyboard.press(`${modKey}+B`) + await expect(main).toHaveClass(closedClass) + + await page.keyboard.press(`${modKey}+B`) + await expect(main).not.toHaveClass(closedClass) +}) diff --git a/packages/app/e2e/terminal-init.spec.ts b/packages/app/e2e/terminal-init.spec.ts new file mode 100644 index 00000000000..cfde2d01930 --- /dev/null +++ b/packages/app/e2e/terminal-init.spec.ts @@ -0,0 +1,25 @@ +import { test, expect } from "./fixtures" +import { promptSelector, terminalSelector, terminalToggleKey } from "./utils" + +test("smoke terminal mounts and can create a second tab", async ({ page, gotoSession }) => { + await gotoSession() + + const terminals = page.locator(terminalSelector) + const opened = await terminals.first().isVisible() + + if (!opened) { + await page.keyboard.press(terminalToggleKey) + } + + await expect(terminals.first()).toBeVisible() + await expect(terminals.first().locator("textarea")).toHaveCount(1) + await expect(terminals).toHaveCount(1) + + // Ghostty captures a lot of keybinds when focused; move focus back + // to the app shell before triggering `terminal.new`. + await page.locator(promptSelector).click() + await page.keyboard.press("Control+Alt+T") + + await expect(terminals).toHaveCount(2) + await expect(terminals.nth(1).locator("textarea")).toHaveCount(1) +}) diff --git a/packages/app/e2e/terminal.spec.ts b/packages/app/e2e/terminal.spec.ts new file mode 100644 index 00000000000..fc558b63259 --- /dev/null +++ b/packages/app/e2e/terminal.spec.ts @@ -0,0 +1,16 @@ +import { test, expect } from "./fixtures" +import { terminalSelector, terminalToggleKey } from "./utils" + +test("terminal panel can be toggled", async ({ page, gotoSession }) => { + await gotoSession() + + const terminal = page.locator(terminalSelector) + const initiallyOpen = await terminal.isVisible() + if (initiallyOpen) { + await page.keyboard.press(terminalToggleKey) + await expect(terminal).toHaveCount(0) + } + + await page.keyboard.press(terminalToggleKey) + await expect(terminal).toBeVisible() +}) diff --git a/packages/app/e2e/tsconfig.json b/packages/app/e2e/tsconfig.json new file mode 100644 index 00000000000..76438a03cc8 --- /dev/null +++ b/packages/app/e2e/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "noEmit": true, + "types": ["node"] + }, + "include": ["./**/*.ts"] +} diff --git a/packages/app/e2e/utils.ts b/packages/app/e2e/utils.ts new file mode 100644 index 00000000000..eb0395950ae --- /dev/null +++ b/packages/app/e2e/utils.ts @@ -0,0 +1,38 @@ +import { createOpencodeClient } from "@opencode-ai/sdk/v2/client" +import { base64Encode } from "@opencode-ai/util/encode" + +export const serverHost = process.env.PLAYWRIGHT_SERVER_HOST ?? "localhost" +export const serverPort = process.env.PLAYWRIGHT_SERVER_PORT ?? "4096" + +export const serverUrl = `http://${serverHost}:${serverPort}` +export const serverName = `${serverHost}:${serverPort}` + +export const modKey = process.platform === "darwin" ? "Meta" : "Control" +export const terminalToggleKey = "Control+Backquote" + +export const promptSelector = '[data-component="prompt-input"]' +export const terminalSelector = '[data-component="terminal"]' + +export function createSdk(directory?: string) { + return createOpencodeClient({ baseUrl: serverUrl, directory, throwOnError: true }) +} + +export async function getWorktree() { + const sdk = createSdk() + const result = await sdk.path.get() + const data = result.data + if (!data?.worktree) throw new Error(`Failed to resolve a worktree from ${serverUrl}/path`) + return data.worktree +} + +export function dirSlug(directory: string) { + return base64Encode(directory) +} + +export function dirPath(directory: string) { + return `/${dirSlug(directory)}` +} + +export function sessionPath(directory: string, sessionID?: string) { + return `${dirPath(directory)}/session${sessionID ? `/${sessionID}` : ""}` +} diff --git a/packages/desktop/happydom.ts b/packages/app/happydom.ts similarity index 100% rename from packages/desktop/happydom.ts rename to packages/app/happydom.ts diff --git a/packages/tauri/index.html b/packages/app/index.html similarity index 50% rename from packages/tauri/index.html rename to packages/app/index.html index 8de2d21d01a..6fa34553510 100644 --- a/packages/tauri/index.html +++ b/packages/app/index.html @@ -1,28 +1,23 @@ - + OpenCode - - - - + + + + + - - + -
- +
+ diff --git a/packages/app/package.json b/packages/app/package.json new file mode 100644 index 00000000000..de0e50b5fc6 --- /dev/null +++ b/packages/app/package.json @@ -0,0 +1,69 @@ +{ + "name": "@opencode-ai/app", + "version": "1.1.33", + "description": "", + "type": "module", + "exports": { + ".": "./src/index.ts", + "./vite": "./vite.js" + }, + "scripts": { + "typecheck": "tsgo -b", + "start": "vite", + "dev": "vite", + "build": "vite build", + "serve": "vite preview", + "test": "playwright test", + "test:e2e": "playwright test", + "test:e2e:local": "bun script/e2e-local.ts", + "test:e2e:ui": "playwright test --ui", + "test:e2e:report": "playwright show-report e2e/playwright-report" + }, + "license": "MIT", + "devDependencies": { + "@happy-dom/global-registrator": "20.0.11", + "@playwright/test": "1.57.0", + "@tailwindcss/vite": "catalog:", + "@tsconfig/bun": "1.0.9", + "@types/bun": "catalog:", + "@types/luxon": "catalog:", + "@types/node": "catalog:", + "@typescript/native-preview": "catalog:", + "typescript": "catalog:", + "vite": "catalog:", + "vite-plugin-icons-spritesheet": "3.0.1", + "vite-plugin-solid": "catalog:" + }, + "dependencies": { + "@kobalte/core": "catalog:", + "@opencode-ai/sdk": "workspace:*", + "@opencode-ai/ui": "workspace:*", + "@opencode-ai/util": "workspace:*", + "@shikijs/transformers": "3.9.2", + "@solid-primitives/active-element": "2.1.3", + "@solid-primitives/audio": "1.4.2", + "@solid-primitives/i18n": "2.2.1", + "@solid-primitives/event-bus": "1.1.2", + "@solid-primitives/media": "2.3.3", + "@solid-primitives/resize-observer": "2.1.3", + "@solid-primitives/scroll": "2.1.3", + "@solid-primitives/storage": "catalog:", + "@solid-primitives/websocket": "1.3.1", + "@solidjs/meta": "catalog:", + "@solidjs/router": "catalog:", + "@thisbeyond/solid-dnd": "0.7.5", + "diff": "catalog:", + "fuzzysort": "catalog:", + "ghostty-web": "0.3.0", + "luxon": "catalog:", + "marked": "catalog:", + "marked-shiki": "catalog:", + "remeda": "catalog:", + "shiki": "catalog:", + "solid-js": "catalog:", + "solid-list": "catalog:", + "tailwindcss": "catalog:", + "virtua": "catalog:", + "zod": "catalog:" + } +} diff --git a/packages/app/playwright.config.ts b/packages/app/playwright.config.ts new file mode 100644 index 00000000000..10819e69ffe --- /dev/null +++ b/packages/app/playwright.config.ts @@ -0,0 +1,43 @@ +import { defineConfig, devices } from "@playwright/test" + +const port = Number(process.env.PLAYWRIGHT_PORT ?? 3000) +const baseURL = process.env.PLAYWRIGHT_BASE_URL ?? `http://localhost:${port}` +const serverHost = process.env.PLAYWRIGHT_SERVER_HOST ?? "localhost" +const serverPort = process.env.PLAYWRIGHT_SERVER_PORT ?? "4096" +const command = `bun run dev -- --host 0.0.0.0 --port ${port}` +const reuse = !process.env.CI + +export default defineConfig({ + testDir: "./e2e", + outputDir: "./e2e/test-results", + timeout: 60_000, + expect: { + timeout: 10_000, + }, + fullyParallel: true, + forbidOnly: !!process.env.CI, + retries: process.env.CI ? 2 : 0, + reporter: [["html", { outputFolder: "e2e/playwright-report", open: "never" }], ["line"]], + webServer: { + command, + url: baseURL, + reuseExistingServer: reuse, + timeout: 120_000, + env: { + VITE_OPENCODE_SERVER_HOST: serverHost, + VITE_OPENCODE_SERVER_PORT: serverPort, + }, + }, + use: { + baseURL, + trace: "on-first-retry", + screenshot: "only-on-failure", + video: "retain-on-failure", + }, + projects: [ + { + name: "chromium", + use: { ...devices["Desktop Chrome"] }, + }, + ], +}) diff --git a/packages/app/public/_headers b/packages/app/public/_headers new file mode 100644 index 00000000000..f5157b1debc --- /dev/null +++ b/packages/app/public/_headers @@ -0,0 +1,17 @@ +/assets/*.js + Content-Type: application/javascript + +/assets/*.mjs + Content-Type: application/javascript + +/assets/*.css + Content-Type: text/css + +/*.js + Content-Type: application/javascript + +/*.mjs + Content-Type: application/javascript + +/*.css + Content-Type: text/css diff --git a/packages/app/public/apple-touch-icon-v3.png b/packages/app/public/apple-touch-icon-v3.png new file mode 120000 index 00000000000..a6f48a689db --- /dev/null +++ b/packages/app/public/apple-touch-icon-v3.png @@ -0,0 +1 @@ +../../ui/src/assets/favicon/apple-touch-icon-v3.png \ No newline at end of file diff --git a/packages/desktop/public/apple-touch-icon.png b/packages/app/public/apple-touch-icon.png similarity index 100% rename from packages/desktop/public/apple-touch-icon.png rename to packages/app/public/apple-touch-icon.png diff --git a/packages/app/public/favicon-96x96-v3.png b/packages/app/public/favicon-96x96-v3.png new file mode 120000 index 00000000000..5d21163ce86 --- /dev/null +++ b/packages/app/public/favicon-96x96-v3.png @@ -0,0 +1 @@ +../../ui/src/assets/favicon/favicon-96x96-v3.png \ No newline at end of file diff --git a/packages/desktop/public/favicon-96x96.png b/packages/app/public/favicon-96x96.png similarity index 100% rename from packages/desktop/public/favicon-96x96.png rename to packages/app/public/favicon-96x96.png diff --git a/packages/app/public/favicon-v3.ico b/packages/app/public/favicon-v3.ico new file mode 120000 index 00000000000..b3da91f3c45 --- /dev/null +++ b/packages/app/public/favicon-v3.ico @@ -0,0 +1 @@ +../../ui/src/assets/favicon/favicon-v3.ico \ No newline at end of file diff --git a/packages/app/public/favicon-v3.svg b/packages/app/public/favicon-v3.svg new file mode 120000 index 00000000000..fc95f68af4a --- /dev/null +++ b/packages/app/public/favicon-v3.svg @@ -0,0 +1 @@ +../../ui/src/assets/favicon/favicon-v3.svg \ No newline at end of file diff --git a/packages/desktop/public/favicon.ico b/packages/app/public/favicon.ico similarity index 100% rename from packages/desktop/public/favicon.ico rename to packages/app/public/favicon.ico diff --git a/packages/desktop/public/favicon.svg b/packages/app/public/favicon.svg similarity index 100% rename from packages/desktop/public/favicon.svg rename to packages/app/public/favicon.svg diff --git a/packages/app/public/oc-theme-preload.js b/packages/app/public/oc-theme-preload.js new file mode 100644 index 00000000000..f8c71049619 --- /dev/null +++ b/packages/app/public/oc-theme-preload.js @@ -0,0 +1,28 @@ +;(function () { + var themeId = localStorage.getItem("opencode-theme-id") + if (!themeId) return + + var scheme = localStorage.getItem("opencode-color-scheme") || "system" + var isDark = scheme === "dark" || (scheme === "system" && matchMedia("(prefers-color-scheme: dark)").matches) + var mode = isDark ? "dark" : "light" + + document.documentElement.dataset.theme = themeId + document.documentElement.dataset.colorScheme = mode + + if (themeId === "oc-1") return + + var css = localStorage.getItem("opencode-theme-css-" + themeId + "-" + mode) + if (css) { + var style = document.createElement("style") + style.id = "oc-theme-preload" + style.textContent = + ":root{color-scheme:" + + mode + + ";--text-mix-blend-mode:" + + (isDark ? "plus-lighter" : "multiply") + + ";" + + css + + "}" + document.head.appendChild(style) + } +})() diff --git a/packages/desktop/public/site.webmanifest b/packages/app/public/site.webmanifest similarity index 100% rename from packages/desktop/public/site.webmanifest rename to packages/app/public/site.webmanifest diff --git a/packages/desktop/public/social-share-zen.png b/packages/app/public/social-share-zen.png similarity index 100% rename from packages/desktop/public/social-share-zen.png rename to packages/app/public/social-share-zen.png diff --git a/packages/desktop/public/social-share.png b/packages/app/public/social-share.png similarity index 100% rename from packages/desktop/public/social-share.png rename to packages/app/public/social-share.png diff --git a/packages/desktop/public/web-app-manifest-192x192.png b/packages/app/public/web-app-manifest-192x192.png similarity index 100% rename from packages/desktop/public/web-app-manifest-192x192.png rename to packages/app/public/web-app-manifest-192x192.png diff --git a/packages/desktop/public/web-app-manifest-512x512.png b/packages/app/public/web-app-manifest-512x512.png similarity index 100% rename from packages/desktop/public/web-app-manifest-512x512.png rename to packages/app/public/web-app-manifest-512x512.png diff --git a/packages/app/script/e2e-local.ts b/packages/app/script/e2e-local.ts new file mode 100644 index 00000000000..aac2c15bb76 --- /dev/null +++ b/packages/app/script/e2e-local.ts @@ -0,0 +1,143 @@ +import fs from "node:fs/promises" +import net from "node:net" +import os from "node:os" +import path from "node:path" + +async function freePort() { + return await new Promise((resolve, reject) => { + const server = net.createServer() + server.once("error", reject) + server.listen(0, () => { + const address = server.address() + if (!address || typeof address === "string") { + server.close(() => reject(new Error("Failed to acquire a free port"))) + return + } + server.close((err) => { + if (err) { + reject(err) + return + } + resolve(address.port) + }) + }) + }) +} + +async function waitForHealth(url: string) { + const timeout = Date.now() + 120_000 + const errors: string[] = [] + while (Date.now() < timeout) { + const result = await fetch(url) + .then((r) => ({ ok: r.ok, error: undefined })) + .catch((error) => ({ + ok: false, + error: error instanceof Error ? error.message : String(error), + })) + if (result.ok) return + if (result.error) errors.push(result.error) + await new Promise((r) => setTimeout(r, 250)) + } + const last = errors.length ? ` (last error: ${errors[errors.length - 1]})` : "" + throw new Error(`Timed out waiting for server health: ${url}${last}`) +} + +const appDir = process.cwd() +const repoDir = path.resolve(appDir, "../..") +const opencodeDir = path.join(repoDir, "packages", "opencode") +const modelsJson = path.join(opencodeDir, "test", "tool", "fixtures", "models-api.json") + +const extraArgs = (() => { + const args = process.argv.slice(2) + if (args[0] === "--") return args.slice(1) + return args +})() + +const [serverPort, webPort] = await Promise.all([freePort(), freePort()]) + +const sandbox = await fs.mkdtemp(path.join(os.tmpdir(), "opencode-e2e-")) + +const serverEnv = { + ...process.env, + MODELS_DEV_API_JSON: modelsJson, + OPENCODE_DISABLE_MODELS_FETCH: "true", + OPENCODE_DISABLE_SHARE: "true", + OPENCODE_DISABLE_LSP_DOWNLOAD: "true", + OPENCODE_DISABLE_DEFAULT_PLUGINS: "true", + OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER: "true", + OPENCODE_TEST_HOME: path.join(sandbox, "home"), + XDG_DATA_HOME: path.join(sandbox, "share"), + XDG_CACHE_HOME: path.join(sandbox, "cache"), + XDG_CONFIG_HOME: path.join(sandbox, "config"), + XDG_STATE_HOME: path.join(sandbox, "state"), + OPENCODE_E2E_PROJECT_DIR: repoDir, + OPENCODE_E2E_SESSION_TITLE: "E2E Session", + OPENCODE_E2E_MESSAGE: "Seeded for UI e2e", + OPENCODE_E2E_MODEL: "opencode/gpt-5-nano", + OPENCODE_CLIENT: "app", +} satisfies Record + +const runnerEnv = { + ...serverEnv, + PLAYWRIGHT_SERVER_HOST: "127.0.0.1", + PLAYWRIGHT_SERVER_PORT: String(serverPort), + VITE_OPENCODE_SERVER_HOST: "127.0.0.1", + VITE_OPENCODE_SERVER_PORT: String(serverPort), + PLAYWRIGHT_PORT: String(webPort), +} satisfies Record + +const seed = Bun.spawn(["bun", "script/seed-e2e.ts"], { + cwd: opencodeDir, + env: serverEnv, + stdout: "inherit", + stderr: "inherit", +}) + +const seedExit = await seed.exited +if (seedExit !== 0) { + process.exit(seedExit) +} + +Object.assign(process.env, serverEnv) +process.env.AGENT = "1" +process.env.OPENCODE = "1" + +const log = await import("../../opencode/src/util/log") +const install = await import("../../opencode/src/installation") +await log.Log.init({ + print: true, + dev: install.Installation.isLocal(), + level: "WARN", +}) + +const servermod = await import("../../opencode/src/server/server") +const inst = await import("../../opencode/src/project/instance") +const server = servermod.Server.listen({ port: serverPort, hostname: "127.0.0.1" }) +console.log(`opencode server listening on http://127.0.0.1:${serverPort}`) + +const result = await (async () => { + try { + await waitForHealth(`http://127.0.0.1:${serverPort}/global/health`) + + const runner = Bun.spawn(["bun", "test:e2e", ...extraArgs], { + cwd: appDir, + env: runnerEnv, + stdout: "inherit", + stderr: "inherit", + }) + + return { code: await runner.exited } + } catch (error) { + return { error } + } finally { + await inst.Instance.disposeAll() + await server.stop() + } +})() + +if ("error" in result) { + console.error(result.error) + process.exit(1) +} + +process.exit(result.code) diff --git a/packages/desktop/src/addons/serialize.test.ts b/packages/app/src/addons/serialize.test.ts similarity index 85% rename from packages/desktop/src/addons/serialize.test.ts rename to packages/app/src/addons/serialize.test.ts index ad165f43f75..7f6780557da 100644 --- a/packages/desktop/src/addons/serialize.test.ts +++ b/packages/app/src/addons/serialize.test.ts @@ -242,6 +242,53 @@ describe("SerializeAddon", () => { expect(term2.buffer.active.getLine(2)?.translateToString(true)).toBe("total 42") }) + test("serialized output should restore after Terminal.reset()", async () => { + const { term, addon } = createTerminal() + + const content = [ + "\x1b[1;32m❯\x1b[0m \x1b[34mcd\x1b[0m /some/path", + "\x1b[1;32m❯\x1b[0m \x1b[34mls\x1b[0m -la", + "total 42", + ].join("\r\n") + + await writeAndWait(term, content) + + const serialized = addon.serialize() + + const { term: term2 } = createTerminal() + terminals.push(term2) + term2.reset() + await writeAndWait(term2, serialized) + + expect(term2.buffer.active.getLine(0)?.translateToString(true)).toContain("cd /some/path") + expect(term2.buffer.active.getLine(1)?.translateToString(true)).toContain("ls -la") + expect(term2.buffer.active.getLine(2)?.translateToString(true)).toBe("total 42") + }) + + test("alternate buffer should round-trip without garbage", async () => { + const { term, addon } = createTerminal(20, 5) + + await writeAndWait(term, "normal\r\n") + await writeAndWait(term, "\x1b[?1049h\x1b[HALT") + + expect(term.buffer.active.type).toBe("alternate") + + const serialized = addon.serialize() + + const { term: term2 } = createTerminal(20, 5) + terminals.push(term2) + await writeAndWait(term2, serialized) + + expect(term2.buffer.active.type).toBe("alternate") + + const line = term2.buffer.active.getLine(0) + expect(line?.translateToString(true)).toBe("ALT") + + // Ensure a cell beyond content isn't garbage + const cellCode = line?.getCell(10)?.getCode() + expect(cellCode === 0 || cellCode === 32).toBe(true) + }) + test("serialized output written to new terminal should match original colors", async () => { const { term, addon } = createTerminal(40, 5) diff --git a/packages/desktop/src/addons/serialize.ts b/packages/app/src/addons/serialize.ts similarity index 95% rename from packages/desktop/src/addons/serialize.ts rename to packages/app/src/addons/serialize.ts index cb1ff84423f..4309a725e51 100644 --- a/packages/desktop/src/addons/serialize.ts +++ b/packages/app/src/addons/serialize.ts @@ -157,23 +157,6 @@ function equalFlags(cell1: IBufferCell, cell2: IBufferCell): boolean { abstract class BaseSerializeHandler { constructor(protected readonly _buffer: IBuffer) {} - private _isRealContent(codepoint: number): boolean { - if (codepoint === 0) return false - if (codepoint >= 0xf000) return false - return true - } - - private _findLastContentColumn(line: IBufferLine): number { - let lastContent = -1 - for (let col = 0; col < line.length; col++) { - const cell = line.getCell(col) - if (cell && this._isRealContent(cell.getCode())) { - lastContent = col - } - } - return lastContent + 1 - } - public serialize(range: IBufferRange, excludeFinalCursorPosition?: boolean): string { let oldCell = this._buffer.getNullCell() @@ -182,14 +165,14 @@ abstract class BaseSerializeHandler { const startColumn = range.start.x const endColumn = range.end.x - this._beforeSerialize(endRow - startRow, startRow, endRow) + this._beforeSerialize(endRow - startRow + 1, startRow, endRow) for (let row = startRow; row <= endRow; row++) { const line = this._buffer.getLine(row) if (line) { const startLineColumn = row === range.start.y ? startColumn : 0 - const maxColumn = row === range.end.y ? endColumn : this._findLastContentColumn(line) - const endLineColumn = Math.min(maxColumn, line.length) + const endLineColumn = Math.min(endColumn, line.length) + for (let col = startLineColumn; col < endLineColumn; col++) { const c = line.getCell(col) if (!c) { @@ -243,6 +226,13 @@ class StringSerializeHandler extends BaseSerializeHandler { protected _beforeSerialize(rows: number, start: number, _end: number): void { this._allRows = new Array(rows) + this._allRowSeparators = new Array(rows) + this._rowIndex = 0 + + this._currentRow = "" + this._nullCellCount = 0 + this._cursorStyle = this._buffer.getNullCell() + this._lastContentCursorRow = start this._lastCursorRow = start this._firstRow = start @@ -251,6 +241,11 @@ class StringSerializeHandler extends BaseSerializeHandler { protected _rowEnd(row: number, isLastRow: boolean): void { let rowSeparator = "" + if (this._nullCellCount > 0) { + this._currentRow += " ".repeat(this._nullCellCount) + this._nullCellCount = 0 + } + if (!isLastRow) { const nextLine = this._buffer.getLine(row + 1) @@ -388,7 +383,8 @@ class StringSerializeHandler extends BaseSerializeHandler { } const codepoint = cell.getCode() - const isGarbage = codepoint >= 0xf000 + const isInvalidCodepoint = codepoint > 0x10ffff || (codepoint >= 0xd800 && codepoint <= 0xdfff) + const isGarbage = isInvalidCodepoint || (codepoint >= 0xf000 && cell.getWidth() === 1) const isEmptyCell = codepoint === 0 || cell.getChars() === "" || isGarbage const sgrSeq = this._diffStyle(cell, this._cursorStyle) @@ -397,7 +393,7 @@ class StringSerializeHandler extends BaseSerializeHandler { if (styleChanged) { if (this._nullCellCount > 0) { - this._currentRow += `\u001b[${this._nullCellCount}C` + this._currentRow += " ".repeat(this._nullCellCount) this._nullCellCount = 0 } @@ -417,7 +413,7 @@ class StringSerializeHandler extends BaseSerializeHandler { this._nullCellCount += cell.getWidth() } else { if (this._nullCellCount > 0) { - this._currentRow += `\u001b[${this._nullCellCount}C` + this._currentRow += " ".repeat(this._nullCellCount) this._nullCellCount = 0 } diff --git a/packages/app/src/app.tsx b/packages/app/src/app.tsx new file mode 100644 index 00000000000..56d6ec406fa --- /dev/null +++ b/packages/app/src/app.tsx @@ -0,0 +1,149 @@ +import "@/index.css" +import { ErrorBoundary, Show, lazy, type ParentProps } from "solid-js" +import { Router, Route, Navigate } from "@solidjs/router" +import { MetaProvider } from "@solidjs/meta" +import { Font } from "@opencode-ai/ui/font" +import { MarkedProvider } from "@opencode-ai/ui/context/marked" +import { DiffComponentProvider } from "@opencode-ai/ui/context/diff" +import { CodeComponentProvider } from "@opencode-ai/ui/context/code" +import { I18nProvider } from "@opencode-ai/ui/context" +import { Diff } from "@opencode-ai/ui/diff" +import { Code } from "@opencode-ai/ui/code" +import { ThemeProvider } from "@opencode-ai/ui/theme" +import { GlobalSyncProvider } from "@/context/global-sync" +import { PermissionProvider } from "@/context/permission" +import { LayoutProvider } from "@/context/layout" +import { GlobalSDKProvider } from "@/context/global-sdk" +import { ServerProvider, useServer } from "@/context/server" +import { SettingsProvider } from "@/context/settings" +import { TerminalProvider } from "@/context/terminal" +import { PromptProvider } from "@/context/prompt" +import { FileProvider } from "@/context/file" +import { NotificationProvider } from "@/context/notification" +import { DialogProvider } from "@opencode-ai/ui/context/dialog" +import { CommandProvider } from "@/context/command" +import { LanguageProvider, useLanguage } from "@/context/language" +import { usePlatform } from "@/context/platform" +import { Logo } from "@opencode-ai/ui/logo" +import Layout from "@/pages/layout" +import DirectoryLayout from "@/pages/directory-layout" +import { ErrorPage } from "./pages/error" +import { iife } from "@opencode-ai/util/iife" +import { Suspense } from "solid-js" + +const Home = lazy(() => import("@/pages/home")) +const Session = lazy(() => import("@/pages/session")) +const Loading = () =>
+ +function UiI18nBridge(props: ParentProps) { + const language = useLanguage() + return {props.children} +} + +declare global { + interface Window { + __OPENCODE__?: { updaterEnabled?: boolean; serverPassword?: string } + } +} + +function MarkedProviderWithNativeParser(props: ParentProps) { + const platform = usePlatform() + return {props.children} +} + +export function AppBaseProviders(props: ParentProps) { + return ( + + + + + + }> + + + + {props.children} + + + + + + + + + ) +} + +function ServerKey(props: ParentProps) { + const server = useServer() + return ( + + {props.children} + + ) +} + +export function AppInterface(props: { defaultUrl?: string }) { + const defaultServerUrl = () => { + if (props.defaultUrl) return props.defaultUrl + if (location.hostname.includes("opencode.ai")) return "http://localhost:4096" + if (import.meta.env.DEV) + return `http://${import.meta.env.VITE_OPENCODE_SERVER_HOST ?? "localhost"}:${import.meta.env.VITE_OPENCODE_SERVER_PORT ?? "4096"}` + + return window.location.origin + } + + return ( + + + + + ( + + + + + + {props.children} + + + + + + )} + > + ( + }> + + + )} + /> + + } /> + ( + + + + + }> + + + + + + + )} + /> + + + + + + + ) +} diff --git a/packages/app/src/components/dialog-connect-provider.tsx b/packages/app/src/components/dialog-connect-provider.tsx new file mode 100644 index 00000000000..be33cba75fc --- /dev/null +++ b/packages/app/src/components/dialog-connect-provider.tsx @@ -0,0 +1,425 @@ +import type { ProviderAuthAuthorization } from "@opencode-ai/sdk/v2/client" +import { Button } from "@opencode-ai/ui/button" +import { useDialog } from "@opencode-ai/ui/context/dialog" +import { Dialog } from "@opencode-ai/ui/dialog" +import { Icon } from "@opencode-ai/ui/icon" +import { IconButton } from "@opencode-ai/ui/icon-button" +import type { IconName } from "@opencode-ai/ui/icons/provider" +import { List, type ListRef } from "@opencode-ai/ui/list" +import { ProviderIcon } from "@opencode-ai/ui/provider-icon" +import { Spinner } from "@opencode-ai/ui/spinner" +import { TextField } from "@opencode-ai/ui/text-field" +import { showToast } from "@opencode-ai/ui/toast" +import { iife } from "@opencode-ai/util/iife" +import { createMemo, Match, onCleanup, onMount, Switch } from "solid-js" +import { createStore, produce } from "solid-js/store" +import { Link } from "@/components/link" +import { useLanguage } from "@/context/language" +import { useGlobalSDK } from "@/context/global-sdk" +import { useGlobalSync } from "@/context/global-sync" +import { usePlatform } from "@/context/platform" +import { DialogSelectModel } from "./dialog-select-model" +import { DialogSelectProvider } from "./dialog-select-provider" + +export function DialogConnectProvider(props: { provider: string }) { + const dialog = useDialog() + const globalSync = useGlobalSync() + const globalSDK = useGlobalSDK() + const platform = usePlatform() + const language = useLanguage() + const provider = createMemo(() => globalSync.data.provider.all.find((x) => x.id === props.provider)!) + const methods = createMemo( + () => + globalSync.data.provider_auth[props.provider] ?? [ + { + type: "api", + label: language.t("provider.connect.method.apiKey"), + }, + ], + ) + const [store, setStore] = createStore({ + methodIndex: undefined as undefined | number, + authorization: undefined as undefined | ProviderAuthAuthorization, + state: "pending" as undefined | "pending" | "complete" | "error", + error: undefined as string | undefined, + }) + + const method = createMemo(() => (store.methodIndex !== undefined ? methods().at(store.methodIndex!) : undefined)) + + const methodLabel = (value?: { type?: string; label?: string }) => { + if (!value) return "" + if (value.type === "api") return language.t("provider.connect.method.apiKey") + return value.label ?? "" + } + + async function selectMethod(index: number) { + const method = methods()[index] + setStore( + produce((draft) => { + draft.methodIndex = index + draft.authorization = undefined + draft.state = undefined + draft.error = undefined + }), + ) + + if (method.type === "oauth") { + setStore("state", "pending") + const start = Date.now() + await globalSDK.client.provider.oauth + .authorize( + { + providerID: props.provider, + method: index, + }, + { throwOnError: true }, + ) + .then((x) => { + const elapsed = Date.now() - start + const delay = 1000 - elapsed + + if (delay > 0) { + setTimeout(() => { + setStore("state", "complete") + setStore("authorization", x.data!) + }, delay) + return + } + setStore("state", "complete") + setStore("authorization", x.data!) + }) + .catch((e) => { + setStore("state", "error") + setStore("error", String(e)) + }) + } + } + + let listRef: ListRef | undefined + function handleKey(e: KeyboardEvent) { + if (e.key === "Enter" && e.target instanceof HTMLInputElement) { + return + } + if (e.key === "Escape") return + listRef?.onKeyDown(e) + } + + onMount(() => { + if (methods().length === 1) { + selectMethod(0) + } + document.addEventListener("keydown", handleKey) + onCleanup(() => { + document.removeEventListener("keydown", handleKey) + }) + }) + + async function complete() { + await globalSDK.client.global.dispose() + dialog.close() + showToast({ + variant: "success", + icon: "circle-check", + title: language.t("provider.connect.toast.connected.title", { provider: provider().name }), + description: language.t("provider.connect.toast.connected.description", { provider: provider().name }), + }) + } + + function goBack() { + if (methods().length === 1) { + dialog.show(() => ) + return + } + if (store.authorization) { + setStore("authorization", undefined) + setStore("methodIndex", undefined) + return + } + if (store.methodIndex) { + setStore("methodIndex", undefined) + return + } + dialog.show(() => ) + } + + return ( + + } + > +
+
+ +
+ + + {language.t("provider.connect.title.anthropicProMax")} + + {language.t("provider.connect.title", { provider: provider().name })} + +
+
+
+ + +
+ {language.t("provider.connect.selectMethod", { provider: provider().name })} +
+
+ { + listRef = ref + }} + items={methods} + key={(m) => m?.label} + onSelect={async (method, index) => { + if (!method) return + selectMethod(index) + }} + > + {(i) => ( +
+
+ + {methodLabel(i)} +
+ )} + +
+ + +
+
+ + {language.t("provider.connect.status.inProgress")} +
+
+
+ +
+
+ + {language.t("provider.connect.status.failed", { error: store.error ?? "" })} +
+
+
+ + {iife(() => { + const [formStore, setFormStore] = createStore({ + value: "", + error: undefined as string | undefined, + }) + + async function handleSubmit(e: SubmitEvent) { + e.preventDefault() + + const form = e.currentTarget as HTMLFormElement + const formData = new FormData(form) + const apiKey = formData.get("apiKey") as string + + if (!apiKey?.trim()) { + setFormStore("error", language.t("provider.connect.apiKey.required")) + return + } + + setFormStore("error", undefined) + await globalSDK.client.auth.set({ + providerID: props.provider, + auth: { + type: "api", + key: apiKey, + }, + }) + await complete() + } + + return ( +
+ + +
+
+ {language.t("provider.connect.opencodeZen.line1")} +
+
+ {language.t("provider.connect.opencodeZen.line2")} +
+
+ {language.t("provider.connect.opencodeZen.visit.prefix")} + + {language.t("provider.connect.opencodeZen.visit.link")} + + {language.t("provider.connect.opencodeZen.visit.suffix")} +
+
+
+ +
+ {language.t("provider.connect.apiKey.description", { provider: provider().name })} +
+
+
+
+ + + +
+ ) + })} +
+ + + + {iife(() => { + const [formStore, setFormStore] = createStore({ + value: "", + error: undefined as string | undefined, + }) + + onMount(() => { + if (store.authorization?.method === "code" && store.authorization?.url) { + platform.openLink(store.authorization.url) + } + }) + + async function handleSubmit(e: SubmitEvent) { + e.preventDefault() + + const form = e.currentTarget as HTMLFormElement + const formData = new FormData(form) + const code = formData.get("code") as string + + if (!code?.trim()) { + setFormStore("error", language.t("provider.connect.oauth.code.required")) + return + } + + setFormStore("error", undefined) + const result = await globalSDK.client.provider.oauth + .callback({ + providerID: props.provider, + method: store.methodIndex, + code, + }) + .then((value) => + value.error ? { ok: false as const, error: value.error } : { ok: true as const }, + ) + .catch((error) => ({ ok: false as const, error })) + if (result.ok) { + await complete() + return + } + const message = result.error instanceof Error ? result.error.message : String(result.error) + setFormStore("error", message || language.t("provider.connect.oauth.code.invalid")) + } + + return ( +
+
+ {language.t("provider.connect.oauth.code.visit.prefix")} + + {language.t("provider.connect.oauth.code.visit.link")} + + {language.t("provider.connect.oauth.code.visit.suffix", { provider: provider().name })} +
+
+ + + +
+ ) + })} +
+ + {iife(() => { + const code = createMemo(() => { + const instructions = store.authorization?.instructions + if (instructions?.includes(":")) { + return instructions?.split(":")[1]?.trim() + } + return instructions + }) + + onMount(async () => { + const result = await globalSDK.client.provider.oauth + .callback({ + providerID: props.provider, + method: store.methodIndex, + }) + .then((value) => + value.error ? { ok: false as const, error: value.error } : { ok: true as const }, + ) + .catch((error) => ({ ok: false as const, error })) + if (!result.ok) { + const message = result.error instanceof Error ? result.error.message : String(result.error) + setStore("state", "error") + setStore("error", message) + return + } + await complete() + }) + + return ( +
+
+ {language.t("provider.connect.oauth.auto.visit.prefix")} + + {language.t("provider.connect.oauth.auto.visit.link")} + + {language.t("provider.connect.oauth.auto.visit.suffix", { provider: provider().name })} +
+ +
+ + {language.t("provider.connect.status.waiting")} +
+
+ ) + })} +
+
+
+ +
+
+
+ ) +} diff --git a/packages/app/src/components/dialog-edit-project.tsx b/packages/app/src/components/dialog-edit-project.tsx new file mode 100644 index 00000000000..9e2bddc6be4 --- /dev/null +++ b/packages/app/src/components/dialog-edit-project.tsx @@ -0,0 +1,259 @@ +import { Button } from "@opencode-ai/ui/button" +import { useDialog } from "@opencode-ai/ui/context/dialog" +import { Dialog } from "@opencode-ai/ui/dialog" +import { TextField } from "@opencode-ai/ui/text-field" +import { Icon } from "@opencode-ai/ui/icon" +import { createMemo, createSignal, For, Show } from "solid-js" +import { createStore } from "solid-js/store" +import { useGlobalSDK } from "@/context/global-sdk" +import { useGlobalSync } from "@/context/global-sync" +import { type LocalProject, getAvatarColors } from "@/context/layout" +import { getFilename } from "@opencode-ai/util/path" +import { Avatar } from "@opencode-ai/ui/avatar" +import { useLanguage } from "@/context/language" + +const AVATAR_COLOR_KEYS = ["pink", "mint", "orange", "purple", "cyan", "lime"] as const + +export function DialogEditProject(props: { project: LocalProject }) { + const dialog = useDialog() + const globalSDK = useGlobalSDK() + const globalSync = useGlobalSync() + const language = useLanguage() + + const folderName = createMemo(() => getFilename(props.project.worktree)) + const defaultName = createMemo(() => props.project.name || folderName()) + + const [store, setStore] = createStore({ + name: defaultName(), + color: props.project.icon?.color || "pink", + iconUrl: props.project.icon?.override || "", + startup: props.project.commands?.start ?? "", + saving: false, + }) + + const [dragOver, setDragOver] = createSignal(false) + const [iconHover, setIconHover] = createSignal(false) + + function handleFileSelect(file: File) { + if (!file.type.startsWith("image/")) return + const reader = new FileReader() + reader.onload = (e) => { + setStore("iconUrl", e.target?.result as string) + setIconHover(false) + } + reader.readAsDataURL(file) + } + + function handleDrop(e: DragEvent) { + e.preventDefault() + setDragOver(false) + const file = e.dataTransfer?.files[0] + if (file) handleFileSelect(file) + } + + function handleDragOver(e: DragEvent) { + e.preventDefault() + setDragOver(true) + } + + function handleDragLeave() { + setDragOver(false) + } + + function handleInputChange(e: Event) { + const input = e.target as HTMLInputElement + const file = input.files?.[0] + if (file) handleFileSelect(file) + } + + function clearIcon() { + setStore("iconUrl", "") + } + + async function handleSubmit(e: SubmitEvent) { + e.preventDefault() + + setStore("saving", true) + const name = store.name.trim() === folderName() ? "" : store.name.trim() + const start = store.startup.trim() + + if (props.project.id && props.project.id !== "global") { + await globalSDK.client.project.update({ + projectID: props.project.id, + directory: props.project.worktree, + name, + icon: { color: store.color, override: store.iconUrl }, + commands: { start }, + }) + globalSync.project.icon(props.project.worktree, store.iconUrl || undefined) + setStore("saving", false) + dialog.close() + return + } + + globalSync.project.meta(props.project.worktree, { + name, + icon: { color: store.color, override: store.iconUrl || undefined }, + commands: { start: start || undefined }, + }) + setStore("saving", false) + dialog.close() + } + + return ( + +
+
+ setStore("name", v)} + /> + +
+ +
+
setIconHover(true)} onMouseLeave={() => setIconHover(false)}> +
{ + if (store.iconUrl && iconHover()) { + clearIcon() + } else { + document.getElementById("icon-upload")?.click() + } + }} + > + + +
+ } + > + {language.t("dialog.project.edit.icon.alt")} + +
+
+ +
+
+ +
+
+ +
+ {language.t("dialog.project.edit.icon.hint")} + {language.t("dialog.project.edit.icon.recommended")} +
+
+
+ + +
+ +
+ + {(color) => ( + + )} + +
+
+
+ + setStore("startup", v)} + spellcheck={false} + class="max-h-40 w-full font-mono text-xs no-scrollbar" + /> +
+ +
+ + +
+ + + ) +} diff --git a/packages/app/src/components/dialog-fork.tsx b/packages/app/src/components/dialog-fork.tsx new file mode 100644 index 00000000000..17782f5ab8d --- /dev/null +++ b/packages/app/src/components/dialog-fork.tsx @@ -0,0 +1,104 @@ +import { Component, createMemo } from "solid-js" +import { useNavigate, useParams } from "@solidjs/router" +import { useSync } from "@/context/sync" +import { useSDK } from "@/context/sdk" +import { usePrompt } from "@/context/prompt" +import { useDialog } from "@opencode-ai/ui/context/dialog" +import { Dialog } from "@opencode-ai/ui/dialog" +import { List } from "@opencode-ai/ui/list" +import { extractPromptFromParts } from "@/utils/prompt" +import type { TextPart as SDKTextPart } from "@opencode-ai/sdk/v2/client" +import { base64Encode } from "@opencode-ai/util/encode" +import { useLanguage } from "@/context/language" + +interface ForkableMessage { + id: string + text: string + time: string +} + +function formatTime(date: Date): string { + return date.toLocaleTimeString(undefined, { timeStyle: "short" }) +} + +export const DialogFork: Component = () => { + const params = useParams() + const navigate = useNavigate() + const sync = useSync() + const sdk = useSDK() + const prompt = usePrompt() + const dialog = useDialog() + const language = useLanguage() + + const messages = createMemo((): ForkableMessage[] => { + const sessionID = params.id + if (!sessionID) return [] + + const msgs = sync.data.message[sessionID] ?? [] + const result: ForkableMessage[] = [] + + for (const message of msgs) { + if (message.role !== "user") continue + + const parts = sync.data.part[message.id] ?? [] + const textPart = parts.find((x): x is SDKTextPart => x.type === "text" && !x.synthetic && !x.ignored) + if (!textPart) continue + + result.push({ + id: message.id, + text: textPart.text.replace(/\n/g, " ").slice(0, 200), + time: formatTime(new Date(message.time.created)), + }) + } + + return result.reverse() + }) + + const handleSelect = (item: ForkableMessage | undefined) => { + if (!item) return + + const sessionID = params.id + if (!sessionID) return + + const parts = sync.data.part[item.id] ?? [] + const restored = extractPromptFromParts(parts, { + directory: sdk.directory, + attachmentName: language.t("common.attachment"), + }) + + dialog.close() + + sdk.client.session.fork({ sessionID, messageID: item.id }).then((forked) => { + if (!forked.data) return + navigate(`/${base64Encode(sdk.directory)}/session/${forked.data.id}`) + requestAnimationFrame(() => { + prompt.set(restored) + }) + }) + } + + return ( + + x.id} + items={messages} + filterKeys={["text"]} + onSelect={handleSelect} + > + {(item) => ( +
+ + {item.text} + + + {item.time} + +
+ )} +
+
+ ) +} diff --git a/packages/app/src/components/dialog-manage-models.tsx b/packages/app/src/components/dialog-manage-models.tsx new file mode 100644 index 00000000000..1ecefa2cbbf --- /dev/null +++ b/packages/app/src/components/dialog-manage-models.tsx @@ -0,0 +1,59 @@ +import { Dialog } from "@opencode-ai/ui/dialog" +import { List } from "@opencode-ai/ui/list" +import { Switch } from "@opencode-ai/ui/switch" +import type { Component } from "solid-js" +import { useLocal } from "@/context/local" +import { popularProviders } from "@/hooks/use-providers" +import { useLanguage } from "@/context/language" + +export const DialogManageModels: Component = () => { + const local = useLocal() + const language = useLanguage() + return ( + + `${x?.provider?.id}:${x?.id}`} + items={local.model.list()} + filterKeys={["provider.name", "name", "id"]} + sortBy={(a, b) => a.name.localeCompare(b.name)} + groupBy={(x) => x.provider.name} + sortGroupsBy={(a, b) => { + const aProvider = a.items[0].provider.id + const bProvider = b.items[0].provider.id + if (popularProviders.includes(aProvider) && !popularProviders.includes(bProvider)) return -1 + if (!popularProviders.includes(aProvider) && popularProviders.includes(bProvider)) return 1 + return popularProviders.indexOf(aProvider) - popularProviders.indexOf(bProvider) + }} + onSelect={(x) => { + if (!x) return + const visible = local.model.visible({ + modelID: x.id, + providerID: x.provider.id, + }) + local.model.setVisibility({ modelID: x.id, providerID: x.provider.id }, !visible) + }} + > + {(i) => ( +
+ {i.name} +
e.stopPropagation()}> + { + local.model.setVisibility({ modelID: i.id, providerID: i.provider.id }, checked) + }} + /> +
+
+ )} +
+
+ ) +} diff --git a/packages/app/src/components/dialog-select-directory.tsx b/packages/app/src/components/dialog-select-directory.tsx new file mode 100644 index 00000000000..b9a7d6ed9b1 --- /dev/null +++ b/packages/app/src/components/dialog-select-directory.tsx @@ -0,0 +1,208 @@ +import { useDialog } from "@opencode-ai/ui/context/dialog" +import { Dialog } from "@opencode-ai/ui/dialog" +import { FileIcon } from "@opencode-ai/ui/file-icon" +import { List } from "@opencode-ai/ui/list" +import { getDirectory, getFilename } from "@opencode-ai/util/path" +import fuzzysort from "fuzzysort" +import { createMemo } from "solid-js" +import { useGlobalSDK } from "@/context/global-sdk" +import { useGlobalSync } from "@/context/global-sync" +import { useLanguage } from "@/context/language" + +interface DialogSelectDirectoryProps { + title?: string + multiple?: boolean + onSelect: (result: string | string[] | null) => void +} + +export function DialogSelectDirectory(props: DialogSelectDirectoryProps) { + const sync = useGlobalSync() + const sdk = useGlobalSDK() + const dialog = useDialog() + const language = useLanguage() + + const home = createMemo(() => sync.data.path.home) + + const start = createMemo(() => sync.data.path.home || sync.data.path.directory) + + const cache = new Map>>() + + function normalize(input: string) { + const v = input.replaceAll("\\", "/") + if (v.startsWith("//") && !v.startsWith("///")) return "//" + v.slice(2).replace(/\/+/g, "/") + return v.replace(/\/+/g, "/") + } + + function normalizeDriveRoot(input: string) { + const v = normalize(input) + if (/^[A-Za-z]:$/.test(v)) return v + "/" + return v + } + + function trimTrailing(input: string) { + const v = normalizeDriveRoot(input) + if (v === "/") return v + if (v === "//") return v + if (/^[A-Za-z]:\/$/.test(v)) return v + return v.replace(/\/+$/, "") + } + + function join(base: string | undefined, rel: string) { + const b = trimTrailing(base ?? "") + const r = trimTrailing(rel).replace(/^\/+/, "") + if (!b) return r + if (!r) return b + if (b.endsWith("/")) return b + r + return b + "/" + r + } + + function rootOf(input: string) { + const v = normalizeDriveRoot(input) + if (v.startsWith("//")) return "//" + if (v.startsWith("/")) return "/" + if (/^[A-Za-z]:\//.test(v)) return v.slice(0, 3) + return "" + } + + function display(path: string) { + const full = trimTrailing(path) + const h = home() + if (!h) return full + + const hn = trimTrailing(h) + const lc = full.toLowerCase() + const hc = hn.toLowerCase() + if (lc === hc) return "~" + if (lc.startsWith(hc + "/")) return "~" + full.slice(hn.length) + return full + } + + function scoped(filter: string) { + const base = start() + if (!base) return + + const raw = normalizeDriveRoot(filter.trim()) + if (!raw) return { directory: trimTrailing(base), path: "" } + + const h = home() + if (raw === "~") return { directory: trimTrailing(h ?? base), path: "" } + if (raw.startsWith("~/")) return { directory: trimTrailing(h ?? base), path: raw.slice(2) } + + const root = rootOf(raw) + if (root) return { directory: trimTrailing(root), path: raw.slice(root.length) } + return { directory: trimTrailing(base), path: raw } + } + + async function dirs(dir: string) { + const key = trimTrailing(dir) + const existing = cache.get(key) + if (existing) return existing + + const request = sdk.client.file + .list({ directory: key, path: "" }) + .then((x) => x.data ?? []) + .catch(() => []) + .then((nodes) => + nodes + .filter((n) => n.type === "directory") + .map((n) => ({ + name: n.name, + absolute: trimTrailing(normalizeDriveRoot(n.absolute)), + })), + ) + + cache.set(key, request) + return request + } + + async function match(dir: string, query: string, limit: number) { + const items = await dirs(dir) + if (!query) return items.slice(0, limit).map((x) => x.absolute) + return fuzzysort.go(query, items, { key: "name", limit }).map((x) => x.obj.absolute) + } + + const directories = async (filter: string) => { + const input = scoped(filter) + if (!input) return [] as string[] + + const raw = normalizeDriveRoot(filter.trim()) + const isPath = raw.startsWith("~") || !!rootOf(raw) || raw.includes("/") + + const query = normalizeDriveRoot(input.path) + + if (!isPath) { + const results = await sdk.client.find + .files({ directory: input.directory, query, type: "directory", limit: 50 }) + .then((x) => x.data ?? []) + .catch(() => []) + + return results.map((rel) => join(input.directory, rel)).slice(0, 50) + } + + const segments = query.replace(/^\/+/, "").split("/") + const head = segments.slice(0, segments.length - 1).filter((x) => x && x !== ".") + const tail = segments[segments.length - 1] ?? "" + + const cap = 12 + const branch = 4 + let paths = [input.directory] + for (const part of head) { + if (part === "..") { + paths = paths.map((p) => { + const v = trimTrailing(p) + if (v === "/") return v + if (/^[A-Za-z]:\/$/.test(v)) return v + const i = v.lastIndexOf("/") + if (i <= 0) return "/" + return v.slice(0, i) + }) + continue + } + + const next = (await Promise.all(paths.map((p) => match(p, part, branch)))).flat() + paths = Array.from(new Set(next)).slice(0, cap) + if (paths.length === 0) return [] as string[] + } + + const out = (await Promise.all(paths.map((p) => match(p, tail, 50)))).flat() + return Array.from(new Set(out)).slice(0, 50) + } + + function resolve(absolute: string) { + props.onSelect(props.multiple ? [absolute] : absolute) + dialog.close() + } + + return ( + + x} + onSelect={(path) => { + if (!path) return + resolve(path) + }} + > + {(absolute) => { + const path = display(absolute) + return ( +
+
+ +
+ + {getDirectory(path)} + + {getFilename(path)} +
+
+
+ ) + }} +
+
+ ) +} diff --git a/packages/app/src/components/dialog-select-file.tsx b/packages/app/src/components/dialog-select-file.tsx new file mode 100644 index 00000000000..7c3113a544e --- /dev/null +++ b/packages/app/src/components/dialog-select-file.tsx @@ -0,0 +1,196 @@ +import { useDialog } from "@opencode-ai/ui/context/dialog" +import { Dialog } from "@opencode-ai/ui/dialog" +import { FileIcon } from "@opencode-ai/ui/file-icon" +import { Keybind } from "@opencode-ai/ui/keybind" +import { List } from "@opencode-ai/ui/list" +import { getDirectory, getFilename } from "@opencode-ai/util/path" +import { useParams } from "@solidjs/router" +import { createMemo, createSignal, onCleanup, Show } from "solid-js" +import { formatKeybind, useCommand, type CommandOption } from "@/context/command" +import { useLayout } from "@/context/layout" +import { useFile } from "@/context/file" +import { useLanguage } from "@/context/language" + +type EntryType = "command" | "file" + +type Entry = { + id: string + type: EntryType + title: string + description?: string + keybind?: string + category: string + option?: CommandOption + path?: string +} + +export function DialogSelectFile() { + const command = useCommand() + const language = useLanguage() + const layout = useLayout() + const file = useFile() + const dialog = useDialog() + const params = useParams() + const sessionKey = createMemo(() => `${params.dir}${params.id ? "/" + params.id : ""}`) + const tabs = createMemo(() => layout.tabs(sessionKey())) + const view = createMemo(() => layout.view(sessionKey())) + const state = { cleanup: undefined as (() => void) | void, committed: false } + const [grouped, setGrouped] = createSignal(false) + const common = [ + "session.new", + "workspace.new", + "session.previous", + "session.next", + "terminal.toggle", + "review.toggle", + ] + const limit = 5 + + const allowed = createMemo(() => + command.options.filter( + (option) => !option.disabled && !option.id.startsWith("suggested.") && option.id !== "file.open", + ), + ) + + const commandItem = (option: CommandOption): Entry => ({ + id: "command:" + option.id, + type: "command", + title: option.title, + description: option.description, + keybind: option.keybind, + category: language.t("palette.group.commands"), + option, + }) + + const fileItem = (path: string): Entry => ({ + id: "file:" + path, + type: "file", + title: path, + category: language.t("palette.group.files"), + path, + }) + + const list = createMemo(() => allowed().map(commandItem)) + + const picks = createMemo(() => { + const all = allowed() + const order = new Map(common.map((id, index) => [id, index])) + const picked = all.filter((option) => order.has(option.id)) + const base = picked.length ? picked : all.slice(0, limit) + const sorted = picked.length ? [...base].sort((a, b) => (order.get(a.id) ?? 0) - (order.get(b.id) ?? 0)) : base + return sorted.map(commandItem) + }) + + const recent = createMemo(() => { + const all = tabs().all() + const active = tabs().active() + const order = active ? [active, ...all.filter((item) => item !== active)] : all + const seen = new Set() + const items: Entry[] = [] + + for (const item of order) { + const path = file.pathFromTab(item) + if (!path) continue + if (seen.has(path)) continue + seen.add(path) + items.push(fileItem(path)) + } + + return items.slice(0, limit) + }) + + const items = async (filter: string) => { + const query = filter.trim() + setGrouped(query.length > 0) + if (!query) return [...picks(), ...recent()] + const files = await file.searchFiles(query) + const entries = files.map(fileItem) + return [...list(), ...entries] + } + + const handleMove = (item: Entry | undefined) => { + state.cleanup?.() + if (!item) return + if (item.type !== "command") return + state.cleanup = item.option?.onHighlight?.() + } + + const open = (path: string) => { + const value = file.tab(path) + tabs().open(value) + file.load(path) + view().reviewPanel.open() + } + + const handleSelect = (item: Entry | undefined) => { + if (!item) return + state.committed = true + state.cleanup = undefined + dialog.close() + + if (item.type === "command") { + item.option?.onSelect?.("palette") + return + } + + if (!item.path) return + open(item.path) + } + + onCleanup(() => { + if (state.committed) return + state.cleanup?.() + }) + + return ( + + item.id} + filterKeys={["title", "description", "category"]} + groupBy={(item) => item.category} + onMove={handleMove} + onSelect={handleSelect} + > + {(item) => ( + +
+ +
+ + {getDirectory(item.path ?? "")} + + {getFilename(item.path ?? "")} +
+
+ + } + > +
+
+ {item.title} + + {item.description} + +
+ + {formatKeybind(item.keybind ?? "")} + +
+
+ )} +
+
+ ) +} diff --git a/packages/app/src/components/dialog-select-mcp.tsx b/packages/app/src/components/dialog-select-mcp.tsx new file mode 100644 index 00000000000..8eb08878912 --- /dev/null +++ b/packages/app/src/components/dialog-select-mcp.tsx @@ -0,0 +1,96 @@ +import { Component, createMemo, createSignal, Show } from "solid-js" +import { useSync } from "@/context/sync" +import { useSDK } from "@/context/sdk" +import { Dialog } from "@opencode-ai/ui/dialog" +import { List } from "@opencode-ai/ui/list" +import { Switch } from "@opencode-ai/ui/switch" +import { useLanguage } from "@/context/language" + +export const DialogSelectMcp: Component = () => { + const sync = useSync() + const sdk = useSDK() + const language = useLanguage() + const [loading, setLoading] = createSignal(null) + + const items = createMemo(() => + Object.entries(sync.data.mcp ?? {}) + .map(([name, status]) => ({ name, status: status.status })) + .sort((a, b) => a.name.localeCompare(b.name)), + ) + + const toggle = async (name: string) => { + if (loading()) return + setLoading(name) + const status = sync.data.mcp[name] + if (status?.status === "connected") { + await sdk.client.mcp.disconnect({ name }) + } else { + await sdk.client.mcp.connect({ name }) + } + const result = await sdk.client.mcp.status() + if (result.data) sync.set("mcp", result.data) + setLoading(null) + } + + const enabledCount = createMemo(() => items().filter((i) => i.status === "connected").length) + const totalCount = createMemo(() => items().length) + + return ( + + x?.name ?? ""} + items={items} + filterKeys={["name", "status"]} + sortBy={(a, b) => a.name.localeCompare(b.name)} + onSelect={(x) => { + if (x) toggle(x.name) + }} + > + {(i) => { + const mcpStatus = () => sync.data.mcp[i.name] + const status = () => mcpStatus()?.status + const error = () => { + const s = mcpStatus() + return s?.status === "failed" ? s.error : undefined + } + const enabled = () => status() === "connected" + return ( +
+
+
+ {i.name} + + {language.t("mcp.status.connected")} + + + {language.t("mcp.status.failed")} + + + {language.t("mcp.status.needs_auth")} + + + {language.t("mcp.status.disabled")} + + + {language.t("common.loading.ellipsis")} + +
+ + {error()} + +
+
e.stopPropagation()}> + toggle(i.name)} /> +
+
+ ) + }} +
+
+ ) +} diff --git a/packages/app/src/components/dialog-select-model-unpaid.tsx b/packages/app/src/components/dialog-select-model-unpaid.tsx new file mode 100644 index 00000000000..1e7c9f52a9a --- /dev/null +++ b/packages/app/src/components/dialog-select-model-unpaid.tsx @@ -0,0 +1,130 @@ +import { Button } from "@opencode-ai/ui/button" +import { useDialog } from "@opencode-ai/ui/context/dialog" +import { Dialog } from "@opencode-ai/ui/dialog" +import type { IconName } from "@opencode-ai/ui/icons/provider" +import { List, type ListRef } from "@opencode-ai/ui/list" +import { ProviderIcon } from "@opencode-ai/ui/provider-icon" +import { Tag } from "@opencode-ai/ui/tag" +import { Tooltip } from "@opencode-ai/ui/tooltip" +import { type Component, onCleanup, onMount, Show } from "solid-js" +import { useLocal } from "@/context/local" +import { popularProviders, useProviders } from "@/hooks/use-providers" +import { DialogConnectProvider } from "./dialog-connect-provider" +import { DialogSelectProvider } from "./dialog-select-provider" +import { ModelTooltip } from "./model-tooltip" +import { useLanguage } from "@/context/language" + +export const DialogSelectModelUnpaid: Component = () => { + const local = useLocal() + const dialog = useDialog() + const providers = useProviders() + const language = useLanguage() + + let listRef: ListRef | undefined + const handleKey = (e: KeyboardEvent) => { + if (e.key === "Escape") return + listRef?.onKeyDown(e) + } + + onMount(() => { + document.addEventListener("keydown", handleKey) + onCleanup(() => { + document.removeEventListener("keydown", handleKey) + }) + }) + + return ( + +
+
{language.t("dialog.model.unpaid.freeModels.title")}
+ (listRef = ref)} + items={local.model.list} + current={local.model.current()} + key={(x) => `${x.provider.id}:${x.id}`} + itemWrapper={(item, node) => ( + + } + > + {node} + + )} + onSelect={(x) => { + local.model.set(x ? { modelID: x.id, providerID: x.provider.id } : undefined, { + recent: true, + }) + dialog.close() + }} + > + {(i) => ( +
+ {i.name} + {language.t("model.tag.free")} + + {language.t("model.tag.latest")} + +
+ )} +
+
+
+
+
+
+
+
{language.t("dialog.model.unpaid.addMore.title")}
+
+ x?.id} + items={providers.popular} + activeIcon="plus-small" + sortBy={(a, b) => { + if (popularProviders.includes(a.id) && popularProviders.includes(b.id)) + return popularProviders.indexOf(a.id) - popularProviders.indexOf(b.id) + return a.name.localeCompare(b.name) + }} + onSelect={(x) => { + if (!x) return + dialog.show(() => ) + }} + > + {(i) => ( +
+ + {i.name} + + {language.t("dialog.provider.tag.recommended")} + + +
{language.t("dialog.provider.anthropic.note")}
+
+
+ )} +
+ +
+
+
+
+
+ ) +} diff --git a/packages/app/src/components/dialog-select-model.tsx b/packages/app/src/components/dialog-select-model.tsx new file mode 100644 index 00000000000..5569d7780fe --- /dev/null +++ b/packages/app/src/components/dialog-select-model.tsx @@ -0,0 +1,162 @@ +import { Popover as Kobalte } from "@kobalte/core/popover" +import { Component, ComponentProps, createMemo, createSignal, JSX, Show, ValidComponent } from "solid-js" +import { useLocal } from "@/context/local" +import { useDialog } from "@opencode-ai/ui/context/dialog" +import { popularProviders } from "@/hooks/use-providers" +import { Button } from "@opencode-ai/ui/button" +import { IconButton } from "@opencode-ai/ui/icon-button" +import { Tag } from "@opencode-ai/ui/tag" +import { Dialog } from "@opencode-ai/ui/dialog" +import { List } from "@opencode-ai/ui/list" +import { Tooltip } from "@opencode-ai/ui/tooltip" +import { DialogSelectProvider } from "./dialog-select-provider" +import { DialogManageModels } from "./dialog-manage-models" +import { ModelTooltip } from "./model-tooltip" +import { useLanguage } from "@/context/language" + +const ModelList: Component<{ + provider?: string + class?: string + onSelect: () => void + action?: JSX.Element +}> = (props) => { + const local = useLocal() + const language = useLanguage() + + const models = createMemo(() => + local.model + .list() + .filter((m) => local.model.visible({ modelID: m.id, providerID: m.provider.id })) + .filter((m) => (props.provider ? m.provider.id === props.provider : true)), + ) + + return ( + `${x.provider.id}:${x.id}`} + items={models} + current={local.model.current()} + filterKeys={["provider.name", "name", "id"]} + sortBy={(a, b) => a.name.localeCompare(b.name)} + groupBy={(x) => x.provider.name} + sortGroupsBy={(a, b) => { + const aProvider = a.items[0].provider.id + const bProvider = b.items[0].provider.id + if (popularProviders.includes(aProvider) && !popularProviders.includes(bProvider)) return -1 + if (!popularProviders.includes(aProvider) && popularProviders.includes(bProvider)) return 1 + return popularProviders.indexOf(aProvider) - popularProviders.indexOf(bProvider) + }} + itemWrapper={(item, node) => ( + + } + > + {node} + + )} + onSelect={(x) => { + local.model.set(x ? { modelID: x.id, providerID: x.provider.id } : undefined, { + recent: true, + }) + props.onSelect() + }} + > + {(i) => ( +
+ {i.name} + + {language.t("model.tag.free")} + + + {language.t("model.tag.latest")} + +
+ )} +
+ ) +} + +export function ModelSelectorPopover(props: { + provider?: string + children?: JSX.Element + triggerAs?: T + triggerProps?: ComponentProps +}) { + const [open, setOpen] = createSignal(false) + const dialog = useDialog() + + const handleManage = () => { + setOpen(false) + dialog.show(() => ) + } + const language = useLanguage() + + return ( + + + {props.children} + + + + {language.t("dialog.model.select.title")} + setOpen(false)} + class="p-1" + action={ + + } + /> + + + + ) +} + +export const DialogSelectModel: Component<{ provider?: string }> = (props) => { + const dialog = useDialog() + const language = useLanguage() + + return ( + dialog.show(() => )} + > + {language.t("command.provider.connect")} + + } + > + dialog.close()} /> + + + ) +} diff --git a/packages/app/src/components/dialog-select-provider.tsx b/packages/app/src/components/dialog-select-provider.tsx new file mode 100644 index 00000000000..1e059c21983 --- /dev/null +++ b/packages/app/src/components/dialog-select-provider.tsx @@ -0,0 +1,64 @@ +import { Component, Show } from "solid-js" +import { useDialog } from "@opencode-ai/ui/context/dialog" +import { popularProviders, useProviders } from "@/hooks/use-providers" +import { Dialog } from "@opencode-ai/ui/dialog" +import { List } from "@opencode-ai/ui/list" +import { Tag } from "@opencode-ai/ui/tag" +import { ProviderIcon } from "@opencode-ai/ui/provider-icon" +import { IconName } from "@opencode-ai/ui/icons/provider" +import { DialogConnectProvider } from "./dialog-connect-provider" +import { useLanguage } from "@/context/language" + +export const DialogSelectProvider: Component = () => { + const dialog = useDialog() + const providers = useProviders() + const language = useLanguage() + + const popularGroup = () => language.t("dialog.provider.group.popular") + const otherGroup = () => language.t("dialog.provider.group.other") + + return ( + + x?.id} + items={() => { + language.locale() + return providers.all() + }} + filterKeys={["id", "name"]} + groupBy={(x) => (popularProviders.includes(x.id) ? popularGroup() : otherGroup())} + sortBy={(a, b) => { + if (popularProviders.includes(a.id) && popularProviders.includes(b.id)) + return popularProviders.indexOf(a.id) - popularProviders.indexOf(b.id) + return a.name.localeCompare(b.name) + }} + sortGroupsBy={(a, b) => { + const popular = popularGroup() + if (a.category === popular && b.category !== popular) return -1 + if (b.category === popular && a.category !== popular) return 1 + return 0 + }} + onSelect={(x) => { + if (!x) return + dialog.show(() => ) + }} + > + {(i) => ( +
+ + {i.name} + + {language.t("dialog.provider.tag.recommended")} + + +
{language.t("dialog.provider.anthropic.note")}
+
+
+ )} +
+
+ ) +} diff --git a/packages/app/src/components/dialog-select-server.tsx b/packages/app/src/components/dialog-select-server.tsx new file mode 100644 index 00000000000..4466fdde16a --- /dev/null +++ b/packages/app/src/components/dialog-select-server.tsx @@ -0,0 +1,249 @@ +import { createResource, createEffect, createMemo, onCleanup, Show } from "solid-js" +import { createStore, reconcile } from "solid-js/store" +import { useDialog } from "@opencode-ai/ui/context/dialog" +import { Dialog } from "@opencode-ai/ui/dialog" +import { List } from "@opencode-ai/ui/list" +import { TextField } from "@opencode-ai/ui/text-field" +import { Button } from "@opencode-ai/ui/button" +import { IconButton } from "@opencode-ai/ui/icon-button" +import { normalizeServerUrl, serverDisplayName, useServer } from "@/context/server" +import { usePlatform } from "@/context/platform" +import { createOpencodeClient } from "@opencode-ai/sdk/v2/client" +import { useNavigate } from "@solidjs/router" +import { useLanguage } from "@/context/language" + +type ServerStatus = { healthy: boolean; version?: string } + +async function checkHealth(url: string, fetch?: typeof globalThis.fetch): Promise { + const sdk = createOpencodeClient({ + baseUrl: url, + fetch, + signal: AbortSignal.timeout(3000), + }) + return sdk.global + .health() + .then((x) => ({ healthy: x.data?.healthy === true, version: x.data?.version })) + .catch(() => ({ healthy: false })) +} + +export function DialogSelectServer() { + const navigate = useNavigate() + const dialog = useDialog() + const server = useServer() + const platform = usePlatform() + const language = useLanguage() + const [store, setStore] = createStore({ + url: "", + adding: false, + error: "", + status: {} as Record, + }) + const [defaultUrl, defaultUrlActions] = createResource(() => platform.getDefaultServerUrl?.()) + const isDesktop = platform.platform === "desktop" + + const items = createMemo(() => { + const current = server.url + const list = server.list + if (!current) return list + if (!list.includes(current)) return [current, ...list] + return [current, ...list.filter((x) => x !== current)] + }) + + const current = createMemo(() => items().find((x) => x === server.url) ?? items()[0]) + + const sortedItems = createMemo(() => { + const list = items() + if (!list.length) return list + const active = current() + const order = new Map(list.map((url, index) => [url, index] as const)) + const rank = (value?: ServerStatus) => { + if (value?.healthy === true) return 0 + if (value?.healthy === false) return 2 + return 1 + } + return list.slice().sort((a, b) => { + if (a === active) return -1 + if (b === active) return 1 + const diff = rank(store.status[a]) - rank(store.status[b]) + if (diff !== 0) return diff + return (order.get(a) ?? 0) - (order.get(b) ?? 0) + }) + }) + + async function refreshHealth() { + const results: Record = {} + await Promise.all( + items().map(async (url) => { + results[url] = await checkHealth(url, platform.fetch) + }), + ) + setStore("status", reconcile(results)) + } + + createEffect(() => { + items() + refreshHealth() + const interval = setInterval(refreshHealth, 10_000) + onCleanup(() => clearInterval(interval)) + }) + + function select(value: string, persist?: boolean) { + if (!persist && store.status[value]?.healthy === false) return + dialog.close() + if (persist) { + server.add(value) + navigate("/") + return + } + server.setActive(value) + navigate("/") + } + + async function handleSubmit(e: SubmitEvent) { + e.preventDefault() + const value = normalizeServerUrl(store.url) + if (!value) return + + setStore("adding", true) + setStore("error", "") + + const result = await checkHealth(value, platform.fetch) + setStore("adding", false) + + if (!result.healthy) { + setStore("error", language.t("dialog.server.add.error")) + return + } + + setStore("url", "") + select(value, true) + } + + async function handleRemove(url: string) { + server.remove(url) + } + + return ( + +
+ x} + current={current()} + onSelect={(x) => { + if (x) select(x) + }} + > + {(i) => ( +
+
+
+ {serverDisplayName(i)} + {store.status[i]?.version} +
+ + { + e.stopPropagation() + handleRemove(i) + }} + /> + +
+ )} + + +
+
+

{language.t("dialog.server.add.title")}

+
+
+
+
+ { + setStore("url", v) + setStore("error", "") + }} + validationState={store.error ? "invalid" : "valid"} + error={store.error} + /> +
+ +
+
+
+ + +
+
+

{language.t("dialog.server.default.title")}

+

{language.t("dialog.server.default.description")}

+
+
+ {language.t("dialog.server.default.none")} + } + > + + + } + > +
+ {serverDisplayName(defaultUrl()!)} +
+ + +
+
+
+
+
+ ) +} diff --git a/packages/app/src/components/dialog-settings.tsx b/packages/app/src/components/dialog-settings.tsx new file mode 100644 index 00000000000..dbbc8fa7adc --- /dev/null +++ b/packages/app/src/components/dialog-settings.tsx @@ -0,0 +1,112 @@ +import { Component } from "solid-js" +import { Dialog } from "@opencode-ai/ui/dialog" +import { Tabs } from "@opencode-ai/ui/tabs" +import { Icon } from "@opencode-ai/ui/icon" +import { useLanguage } from "@/context/language" +import { usePlatform } from "@/context/platform" +import { SettingsGeneral } from "./settings-general" +import { SettingsKeybinds } from "./settings-keybinds" +import { SettingsPermissions } from "./settings-permissions" +import { SettingsProviders } from "./settings-providers" +import { SettingsModels } from "./settings-models" +import { SettingsAgents } from "./settings-agents" +import { SettingsCommands } from "./settings-commands" +import { SettingsMcp } from "./settings-mcp" + +export const DialogSettings: Component = () => { + const language = useLanguage() + const platform = usePlatform() + + return ( + + + +
+
+ {language.t("settings.section.desktop")} +
+ + + {language.t("settings.tab.general")} + + + + {language.t("settings.tab.shortcuts")} + +
+
+
+ OpenCode Desktop + v{platform.version} +
+
+ {/* Server */} + {/* */} + {/* */} + {/* Permissions */} + {/* */} + {/* */} + {/* */} + {/* Providers */} + {/* */} + {/* */} + {/* */} + {/* Models */} + {/* */} + {/* */} + {/* */} + {/* Agents */} + {/* */} + {/* */} + {/* */} + {/* Commands */} + {/* */} + {/* */} + {/* */} + {/* MCP */} + {/* */} +
+ + + + + + + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} +
+
+ ) +} diff --git a/packages/desktop/src/components/file-tree.tsx b/packages/app/src/components/file-tree.tsx similarity index 92% rename from packages/desktop/src/components/file-tree.tsx rename to packages/app/src/components/file-tree.tsx index 0841c71d1d9..3439d366cee 100644 --- a/packages/desktop/src/components/file-tree.tsx +++ b/packages/app/src/components/file-tree.tsx @@ -2,7 +2,7 @@ import { useLocal, type LocalFile } from "@/context/local" import { Collapsible } from "@opencode-ai/ui/collapsible" import { FileIcon } from "@opencode-ai/ui/file-icon" import { Tooltip } from "@opencode-ai/ui/tooltip" -import { For, Match, Switch, Show, type ComponentProps, type ParentProps } from "solid-js" +import { For, Match, Switch, type ComponentProps, type ParentProps } from "solid-js" import { Dynamic } from "solid-js/web" export default function FileTree(props: { @@ -57,14 +57,14 @@ export default function FileTree(props: { "text-text-muted/40": p.node.ignored, "text-text-muted/80": !p.node.ignored, // "!text-text": local.file.active()?.path === p.node.path, - "!text-primary": local.file.changed(p.node.path), + // "!text-primary": local.file.changed(p.node.path), }} > {p.node.name} - - - + {/* */} + {/* */} + {/* */} ) diff --git a/packages/desktop/src/components/link.tsx b/packages/app/src/components/link.tsx similarity index 100% rename from packages/desktop/src/components/link.tsx rename to packages/app/src/components/link.tsx diff --git a/packages/app/src/components/model-tooltip.tsx b/packages/app/src/components/model-tooltip.tsx new file mode 100644 index 00000000000..53164dae85e --- /dev/null +++ b/packages/app/src/components/model-tooltip.tsx @@ -0,0 +1,91 @@ +import { Show, type Component } from "solid-js" +import { useLanguage } from "@/context/language" + +type InputKey = "text" | "image" | "audio" | "video" | "pdf" +type InputMap = Record + +type ModelInfo = { + id: string + name: string + provider: { + name: string + } + capabilities?: { + reasoning: boolean + input: InputMap + } + modalities?: { + input: Array + } + reasoning?: boolean + limit: { + context: number + } +} + +export const ModelTooltip: Component<{ model: ModelInfo; latest?: boolean; free?: boolean }> = (props) => { + const language = useLanguage() + const sourceName = (model: ModelInfo) => { + const value = `${model.id} ${model.name}`.toLowerCase() + + if (/claude|anthropic/.test(value)) return language.t("model.provider.anthropic") + if (/gpt|o[1-4]|codex|openai/.test(value)) return language.t("model.provider.openai") + if (/gemini|palm|bard|google/.test(value)) return language.t("model.provider.google") + if (/grok|xai/.test(value)) return language.t("model.provider.xai") + if (/llama|meta/.test(value)) return language.t("model.provider.meta") + + return model.provider.name + } + const inputLabel = (value: string) => { + if (value === "text") return language.t("model.input.text") + if (value === "image") return language.t("model.input.image") + if (value === "audio") return language.t("model.input.audio") + if (value === "video") return language.t("model.input.video") + if (value === "pdf") return language.t("model.input.pdf") + return value + } + const title = () => { + const tags: Array = [] + if (props.latest) tags.push(language.t("model.tag.latest")) + if (props.free) tags.push(language.t("model.tag.free")) + const suffix = tags.length ? ` (${tags.join(", ")})` : "" + return `${sourceName(props.model)} ${props.model.name}${suffix}` + } + const inputs = () => { + if (props.model.capabilities) { + const input = props.model.capabilities.input + const order: Array = ["text", "image", "audio", "video", "pdf"] + const entries = order.filter((key) => input[key]).map((key) => inputLabel(key)) + return entries.length ? entries.join(", ") : undefined + } + const raw = props.model.modalities?.input + if (!raw) return + const entries = raw.map((value) => inputLabel(value)) + return entries.length ? entries.join(", ") : undefined + } + const reasoning = () => { + if (props.model.capabilities) + return props.model.capabilities.reasoning + ? language.t("model.tooltip.reasoning.allowed") + : language.t("model.tooltip.reasoning.none") + return props.model.reasoning + ? language.t("model.tooltip.reasoning.allowed") + : language.t("model.tooltip.reasoning.none") + } + const context = () => language.t("model.tooltip.context", { limit: props.model.limit.context.toLocaleString() }) + + return ( +
+
{title()}
+ + {(value) => ( +
+ {language.t("model.tooltip.allows", { inputs: value() })} +
+ )} +
+
{reasoning()}
+
{context()}
+
+ ) +} diff --git a/packages/app/src/components/prompt-input.tsx b/packages/app/src/components/prompt-input.tsx new file mode 100644 index 00000000000..44a1db2535d --- /dev/null +++ b/packages/app/src/components/prompt-input.tsx @@ -0,0 +1,1886 @@ +import { useFilteredList } from "@opencode-ai/ui/hooks" +import { + createEffect, + on, + Component, + Show, + For, + onMount, + onCleanup, + Switch, + Match, + createMemo, + createSignal, +} from "solid-js" +import { createStore, produce } from "solid-js/store" +import { createFocusSignal } from "@solid-primitives/active-element" +import { useLocal } from "@/context/local" +import { useFile, type FileSelection } from "@/context/file" +import { + ContentPart, + DEFAULT_PROMPT, + isPromptEqual, + Prompt, + usePrompt, + ImageAttachmentPart, + AgentPart, + FileAttachmentPart, +} from "@/context/prompt" +import { useLayout } from "@/context/layout" +import { useSDK } from "@/context/sdk" +import { useNavigate, useParams } from "@solidjs/router" +import { useSync } from "@/context/sync" +import { FileIcon } from "@opencode-ai/ui/file-icon" +import { Button } from "@opencode-ai/ui/button" +import { Icon } from "@opencode-ai/ui/icon" +import { ProviderIcon } from "@opencode-ai/ui/provider-icon" +import type { IconName } from "@opencode-ai/ui/icons/provider" +import { Tooltip, TooltipKeybind } from "@opencode-ai/ui/tooltip" +import { IconButton } from "@opencode-ai/ui/icon-button" +import { Select } from "@opencode-ai/ui/select" +import { getDirectory, getFilename } from "@opencode-ai/util/path" +import { useDialog } from "@opencode-ai/ui/context/dialog" +import { ImagePreview } from "@opencode-ai/ui/image-preview" +import { ModelSelectorPopover } from "@/components/dialog-select-model" +import { DialogSelectModelUnpaid } from "@/components/dialog-select-model-unpaid" +import { useProviders } from "@/hooks/use-providers" +import { useCommand } from "@/context/command" +import { Persist, persisted } from "@/utils/persist" +import { Identifier } from "@/utils/id" +import { SessionContextUsage } from "@/components/session-context-usage" +import { usePermission } from "@/context/permission" +import { useLanguage } from "@/context/language" +import { useGlobalSync } from "@/context/global-sync" +import { usePlatform } from "@/context/platform" +import { createOpencodeClient, type Message, type Part } from "@opencode-ai/sdk/v2/client" +import { Binary } from "@opencode-ai/util/binary" +import { showToast } from "@opencode-ai/ui/toast" +import { base64Encode } from "@opencode-ai/util/encode" + +const ACCEPTED_IMAGE_TYPES = ["image/png", "image/jpeg", "image/gif", "image/webp"] +const ACCEPTED_FILE_TYPES = [...ACCEPTED_IMAGE_TYPES, "application/pdf"] + +interface PromptInputProps { + class?: string + ref?: (el: HTMLDivElement) => void + newSessionWorktree?: string + onNewSessionWorktreeReset?: () => void + onSubmit?: () => void +} + +const EXAMPLES = [ + "prompt.example.1", + "prompt.example.2", + "prompt.example.3", + "prompt.example.4", + "prompt.example.5", + "prompt.example.6", + "prompt.example.7", + "prompt.example.8", + "prompt.example.9", + "prompt.example.10", + "prompt.example.11", + "prompt.example.12", + "prompt.example.13", + "prompt.example.14", + "prompt.example.15", + "prompt.example.16", + "prompt.example.17", + "prompt.example.18", + "prompt.example.19", + "prompt.example.20", + "prompt.example.21", + "prompt.example.22", + "prompt.example.23", + "prompt.example.24", + "prompt.example.25", +] as const + +interface SlashCommand { + id: string + trigger: string + title: string + description?: string + keybind?: string + type: "builtin" | "custom" +} + +export const PromptInput: Component = (props) => { + const navigate = useNavigate() + const sdk = useSDK() + const sync = useSync() + const globalSync = useGlobalSync() + const platform = usePlatform() + const local = useLocal() + const files = useFile() + const prompt = usePrompt() + const layout = useLayout() + const params = useParams() + const dialog = useDialog() + const providers = useProviders() + const command = useCommand() + const permission = usePermission() + const language = useLanguage() + let editorRef!: HTMLDivElement + let fileInputRef!: HTMLInputElement + let scrollRef!: HTMLDivElement + let slashPopoverRef!: HTMLDivElement + + const scrollCursorIntoView = () => { + const container = scrollRef + const selection = window.getSelection() + if (!container || !selection || selection.rangeCount === 0) return + + const range = selection.getRangeAt(0) + if (!editorRef.contains(range.startContainer)) return + + const rect = range.getBoundingClientRect() + if (!rect.height) return + + const containerRect = container.getBoundingClientRect() + const top = rect.top - containerRect.top + container.scrollTop + const bottom = rect.bottom - containerRect.top + container.scrollTop + const padding = 12 + + if (top < container.scrollTop + padding) { + container.scrollTop = Math.max(0, top - padding) + return + } + + if (bottom > container.scrollTop + container.clientHeight - padding) { + container.scrollTop = bottom - container.clientHeight + padding + } + } + + const queueScroll = () => { + requestAnimationFrame(scrollCursorIntoView) + } + + const sessionKey = createMemo(() => `${params.dir}${params.id ? "/" + params.id : ""}`) + const tabs = createMemo(() => layout.tabs(sessionKey())) + const activeFile = createMemo(() => { + const tab = tabs().active() + if (!tab) return + return files.pathFromTab(tab) + }) + const info = createMemo(() => (params.id ? sync.session.get(params.id) : undefined)) + const status = createMemo( + () => + sync.data.session_status[params.id ?? ""] ?? { + type: "idle", + }, + ) + const working = createMemo(() => status()?.type !== "idle") + const imageAttachments = createMemo( + () => prompt.current().filter((part) => part.type === "image") as ImageAttachmentPart[], + ) + + const [store, setStore] = createStore<{ + popover: "at" | "slash" | null + historyIndex: number + savedPrompt: Prompt | null + placeholder: number + dragging: boolean + mode: "normal" | "shell" + applyingHistory: boolean + }>({ + popover: null, + historyIndex: -1, + savedPrompt: null, + placeholder: Math.floor(Math.random() * EXAMPLES.length), + dragging: false, + mode: "normal", + applyingHistory: false, + }) + + const MAX_HISTORY = 100 + const [history, setHistory] = persisted( + Persist.global("prompt-history", ["prompt-history.v1"]), + createStore<{ + entries: Prompt[] + }>({ + entries: [], + }), + ) + const [shellHistory, setShellHistory] = persisted( + Persist.global("prompt-history-shell", ["prompt-history-shell.v1"]), + createStore<{ + entries: Prompt[] + }>({ + entries: [], + }), + ) + + const clonePromptParts = (prompt: Prompt): Prompt => + prompt.map((part) => { + if (part.type === "text") return { ...part } + if (part.type === "image") return { ...part } + if (part.type === "agent") return { ...part } + return { + ...part, + selection: part.selection ? { ...part.selection } : undefined, + } + }) + + const promptLength = (prompt: Prompt) => + prompt.reduce((len, part) => len + ("content" in part ? part.content.length : 0), 0) + + const applyHistoryPrompt = (p: Prompt, position: "start" | "end") => { + const length = position === "start" ? 0 : promptLength(p) + setStore("applyingHistory", true) + prompt.set(p, length) + requestAnimationFrame(() => { + editorRef.focus() + setCursorPosition(editorRef, length) + setStore("applyingHistory", false) + queueScroll() + }) + } + + const getCaretState = () => { + const selection = window.getSelection() + const textLength = promptLength(prompt.current()) + if (!selection || selection.rangeCount === 0) { + return { collapsed: false, cursorPosition: 0, textLength } + } + const anchorNode = selection.anchorNode + if (!anchorNode || !editorRef.contains(anchorNode)) { + return { collapsed: false, cursorPosition: 0, textLength } + } + return { + collapsed: selection.isCollapsed, + cursorPosition: getCursorPosition(editorRef), + textLength, + } + } + + const isFocused = createFocusSignal(() => editorRef) + + createEffect(() => { + params.id + if (params.id) return + const interval = setInterval(() => { + setStore("placeholder", (prev) => (prev + 1) % EXAMPLES.length) + }, 6500) + onCleanup(() => clearInterval(interval)) + }) + + const [composing, setComposing] = createSignal(false) + const isImeComposing = (event: KeyboardEvent) => event.isComposing || composing() || event.keyCode === 229 + + const addImageAttachment = async (file: File) => { + if (!ACCEPTED_FILE_TYPES.includes(file.type)) return + + const reader = new FileReader() + reader.onload = () => { + const dataUrl = reader.result as string + const attachment: ImageAttachmentPart = { + type: "image", + id: crypto.randomUUID(), + filename: file.name, + mime: file.type, + dataUrl, + } + const cursorPosition = prompt.cursor() ?? getCursorPosition(editorRef) + prompt.set([...prompt.current(), attachment], cursorPosition) + } + reader.readAsDataURL(file) + } + + const removeImageAttachment = (id: string) => { + const current = prompt.current() + const next = current.filter((part) => part.type !== "image" || part.id !== id) + prompt.set(next, prompt.cursor()) + } + + const handlePaste = async (event: ClipboardEvent) => { + if (!isFocused()) return + const clipboardData = event.clipboardData + if (!clipboardData) return + + event.preventDefault() + event.stopPropagation() + + const items = Array.from(clipboardData.items) + const fileItems = items.filter((item) => item.kind === "file") + const imageItems = fileItems.filter((item) => ACCEPTED_FILE_TYPES.includes(item.type)) + + if (imageItems.length > 0) { + for (const item of imageItems) { + const file = item.getAsFile() + if (file) await addImageAttachment(file) + } + return + } + + if (fileItems.length > 0) { + showToast({ + title: language.t("prompt.toast.pasteUnsupported.title"), + description: language.t("prompt.toast.pasteUnsupported.description"), + }) + return + } + + const plainText = clipboardData.getData("text/plain") ?? "" + if (!plainText) return + addPart({ type: "text", content: plainText, start: 0, end: 0 }) + } + + const handleGlobalDragOver = (event: DragEvent) => { + if (dialog.active) return + + event.preventDefault() + const hasFiles = event.dataTransfer?.types.includes("Files") + if (hasFiles) { + setStore("dragging", true) + } + } + + const handleGlobalDragLeave = (event: DragEvent) => { + if (dialog.active) return + + // relatedTarget is null when leaving the document window + if (!event.relatedTarget) { + setStore("dragging", false) + } + } + + const handleGlobalDrop = async (event: DragEvent) => { + if (dialog.active) return + + event.preventDefault() + setStore("dragging", false) + + const dropped = event.dataTransfer?.files + if (!dropped) return + + for (const file of Array.from(dropped)) { + if (ACCEPTED_FILE_TYPES.includes(file.type)) { + await addImageAttachment(file) + } + } + } + + onMount(() => { + document.addEventListener("dragover", handleGlobalDragOver) + document.addEventListener("dragleave", handleGlobalDragLeave) + document.addEventListener("drop", handleGlobalDrop) + }) + onCleanup(() => { + document.removeEventListener("dragover", handleGlobalDragOver) + document.removeEventListener("dragleave", handleGlobalDragLeave) + document.removeEventListener("drop", handleGlobalDrop) + }) + + createEffect(() => { + if (!isFocused()) setStore("popover", null) + }) + + // Safety: reset composing state on focus change to prevent stuck state + // This handles edge cases where compositionend event may not fire + createEffect(() => { + if (!isFocused()) setComposing(false) + }) + + type AtOption = { type: "agent"; name: string; display: string } | { type: "file"; path: string; display: string } + + const agentList = createMemo(() => + sync.data.agent + .filter((agent) => !agent.hidden && agent.mode !== "primary") + .map((agent): AtOption => ({ type: "agent", name: agent.name, display: agent.name })), + ) + + const handleAtSelect = (option: AtOption | undefined) => { + if (!option) return + if (option.type === "agent") { + addPart({ type: "agent", name: option.name, content: "@" + option.name, start: 0, end: 0 }) + } else { + addPart({ type: "file", path: option.path, content: "@" + option.path, start: 0, end: 0 }) + } + } + + const atKey = (x: AtOption | undefined) => { + if (!x) return "" + return x.type === "agent" ? `agent:${x.name}` : `file:${x.path}` + } + + const { + flat: atFlat, + active: atActive, + setActive: setAtActive, + onInput: atOnInput, + onKeyDown: atOnKeyDown, + } = useFilteredList({ + items: async (query) => { + const agents = agentList() + const paths = await files.searchFilesAndDirectories(query) + const fileOptions: AtOption[] = paths.map((path) => ({ type: "file", path, display: path })) + return [...agents, ...fileOptions] + }, + key: atKey, + filterKeys: ["display"], + onSelect: handleAtSelect, + }) + + const slashCommands = createMemo(() => { + const builtin = command.options + .filter((opt) => !opt.disabled && !opt.id.startsWith("suggested.") && opt.slash) + .map((opt) => ({ + id: opt.id, + trigger: opt.slash!, + title: opt.title, + description: opt.description, + keybind: opt.keybind, + type: "builtin" as const, + })) + + const custom = sync.data.command.map((cmd) => ({ + id: `custom.${cmd.name}`, + trigger: cmd.name, + title: cmd.name, + description: cmd.description, + type: "custom" as const, + })) + + return [...custom, ...builtin] + }) + + const handleSlashSelect = (cmd: SlashCommand | undefined) => { + if (!cmd) return + setStore("popover", null) + + if (cmd.type === "custom") { + const text = `/${cmd.trigger} ` + editorRef.innerHTML = "" + editorRef.textContent = text + prompt.set([{ type: "text", content: text, start: 0, end: text.length }], text.length) + requestAnimationFrame(() => { + editorRef.focus() + const range = document.createRange() + const sel = window.getSelection() + range.selectNodeContents(editorRef) + range.collapse(false) + sel?.removeAllRanges() + sel?.addRange(range) + }) + return + } + + editorRef.innerHTML = "" + prompt.set([{ type: "text", content: "", start: 0, end: 0 }], 0) + command.trigger(cmd.id, "slash") + } + + const { + flat: slashFlat, + active: slashActive, + setActive: setSlashActive, + onInput: slashOnInput, + onKeyDown: slashOnKeyDown, + refetch: slashRefetch, + } = useFilteredList({ + items: slashCommands, + key: (x) => x?.id, + filterKeys: ["trigger", "title", "description"], + onSelect: handleSlashSelect, + }) + + const createPill = (part: FileAttachmentPart | AgentPart) => { + const pill = document.createElement("span") + pill.textContent = part.content + pill.setAttribute("data-type", part.type) + if (part.type === "file") pill.setAttribute("data-path", part.path) + if (part.type === "agent") pill.setAttribute("data-name", part.name) + pill.setAttribute("contenteditable", "false") + pill.style.userSelect = "text" + pill.style.cursor = "default" + return pill + } + + const isNormalizedEditor = () => + Array.from(editorRef.childNodes).every((node) => { + if (node.nodeType === Node.TEXT_NODE) { + const text = node.textContent ?? "" + if (!text.includes("\u200B")) return true + if (text !== "\u200B") return false + + const prev = node.previousSibling + const next = node.nextSibling + const prevIsBr = prev?.nodeType === Node.ELEMENT_NODE && (prev as HTMLElement).tagName === "BR" + const nextIsBr = next?.nodeType === Node.ELEMENT_NODE && (next as HTMLElement).tagName === "BR" + if (!prevIsBr && !nextIsBr) return false + if (nextIsBr && !prevIsBr && prev) return false + return true + } + if (node.nodeType !== Node.ELEMENT_NODE) return false + const el = node as HTMLElement + if (el.dataset.type === "file") return true + if (el.dataset.type === "agent") return true + return el.tagName === "BR" + }) + + const renderEditor = (parts: Prompt) => { + editorRef.innerHTML = "" + for (const part of parts) { + if (part.type === "text") { + editorRef.appendChild(createTextFragment(part.content)) + continue + } + if (part.type === "file" || part.type === "agent") { + editorRef.appendChild(createPill(part)) + } + } + } + + createEffect( + on( + () => sync.data.command, + () => slashRefetch(), + { defer: true }, + ), + ) + + // Auto-scroll active command into view when navigating with keyboard + createEffect(() => { + const activeId = slashActive() + if (!activeId || !slashPopoverRef) return + + requestAnimationFrame(() => { + const element = slashPopoverRef.querySelector(`[data-slash-id="${activeId}"]`) + element?.scrollIntoView({ block: "nearest", behavior: "smooth" }) + }) + }) + + const selectPopoverActive = () => { + if (store.popover === "at") { + const items = atFlat() + if (items.length === 0) return + const active = atActive() + const item = items.find((entry) => atKey(entry) === active) ?? items[0] + handleAtSelect(item) + return + } + + if (store.popover === "slash") { + const items = slashFlat() + if (items.length === 0) return + const active = slashActive() + const item = items.find((entry) => entry.id === active) ?? items[0] + handleSlashSelect(item) + } + } + + createEffect( + on( + () => prompt.current(), + (currentParts) => { + const inputParts = currentParts.filter((part) => part.type !== "image") as Prompt + const domParts = parseFromDOM() + if (isNormalizedEditor() && isPromptEqual(inputParts, domParts)) return + + const selection = window.getSelection() + let cursorPosition: number | null = null + if (selection && selection.rangeCount > 0 && editorRef.contains(selection.anchorNode)) { + cursorPosition = getCursorPosition(editorRef) + } + + renderEditor(inputParts) + + if (cursorPosition !== null) { + setCursorPosition(editorRef, cursorPosition) + } + }, + ), + ) + + const parseFromDOM = (): Prompt => { + const parts: Prompt = [] + let position = 0 + let buffer = "" + + const flushText = () => { + const content = buffer.replace(/\r\n?/g, "\n").replace(/\u200B/g, "") + buffer = "" + if (!content) return + parts.push({ type: "text", content, start: position, end: position + content.length }) + position += content.length + } + + const pushFile = (file: HTMLElement) => { + const content = file.textContent ?? "" + parts.push({ + type: "file", + path: file.dataset.path!, + content, + start: position, + end: position + content.length, + }) + position += content.length + } + + const pushAgent = (agent: HTMLElement) => { + const content = agent.textContent ?? "" + parts.push({ + type: "agent", + name: agent.dataset.name!, + content, + start: position, + end: position + content.length, + }) + position += content.length + } + + const visit = (node: Node) => { + if (node.nodeType === Node.TEXT_NODE) { + buffer += node.textContent ?? "" + return + } + if (node.nodeType !== Node.ELEMENT_NODE) return + + const el = node as HTMLElement + if (el.dataset.type === "file") { + flushText() + pushFile(el) + return + } + if (el.dataset.type === "agent") { + flushText() + pushAgent(el) + return + } + if (el.tagName === "BR") { + buffer += "\n" + return + } + + for (const child of Array.from(el.childNodes)) { + visit(child) + } + } + + const children = Array.from(editorRef.childNodes) + children.forEach((child, index) => { + const isBlock = child.nodeType === Node.ELEMENT_NODE && ["DIV", "P"].includes((child as HTMLElement).tagName) + visit(child) + if (isBlock && index < children.length - 1) { + buffer += "\n" + } + }) + + flushText() + + if (parts.length === 0) parts.push(...DEFAULT_PROMPT) + return parts + } + + const handleInput = () => { + const rawParts = parseFromDOM() + const images = imageAttachments() + const cursorPosition = getCursorPosition(editorRef) + const rawText = rawParts.map((p) => ("content" in p ? p.content : "")).join("") + const trimmed = rawText.replace(/\u200B/g, "").trim() + const hasNonText = rawParts.some((part) => part.type !== "text") + const shouldReset = trimmed.length === 0 && !hasNonText && images.length === 0 + + if (shouldReset) { + setStore("popover", null) + if (store.historyIndex >= 0 && !store.applyingHistory) { + setStore("historyIndex", -1) + setStore("savedPrompt", null) + } + if (prompt.dirty()) { + prompt.set(DEFAULT_PROMPT, 0) + } + queueScroll() + return + } + + const shellMode = store.mode === "shell" + + if (!shellMode) { + const atMatch = rawText.substring(0, cursorPosition).match(/@(\S*)$/) + const slashMatch = rawText.match(/^\/(\S*)$/) + + if (atMatch) { + atOnInput(atMatch[1]) + setStore("popover", "at") + } else if (slashMatch) { + slashOnInput(slashMatch[1]) + setStore("popover", "slash") + } else { + setStore("popover", null) + } + } else { + setStore("popover", null) + } + + if (store.historyIndex >= 0 && !store.applyingHistory) { + setStore("historyIndex", -1) + setStore("savedPrompt", null) + } + + prompt.set([...rawParts, ...images], cursorPosition) + queueScroll() + } + + const setRangeEdge = (range: Range, edge: "start" | "end", offset: number) => { + let remaining = offset + const nodes = Array.from(editorRef.childNodes) + + for (const node of nodes) { + const length = getNodeLength(node) + const isText = node.nodeType === Node.TEXT_NODE + const isPill = + node.nodeType === Node.ELEMENT_NODE && + ((node as HTMLElement).dataset.type === "file" || (node as HTMLElement).dataset.type === "agent") + const isBreak = node.nodeType === Node.ELEMENT_NODE && (node as HTMLElement).tagName === "BR" + + if (isText && remaining <= length) { + if (edge === "start") range.setStart(node, remaining) + if (edge === "end") range.setEnd(node, remaining) + return + } + + if ((isPill || isBreak) && remaining <= length) { + if (edge === "start" && remaining === 0) range.setStartBefore(node) + if (edge === "start" && remaining > 0) range.setStartAfter(node) + if (edge === "end" && remaining === 0) range.setEndBefore(node) + if (edge === "end" && remaining > 0) range.setEndAfter(node) + return + } + + remaining -= length + } + } + + const addPart = (part: ContentPart) => { + const selection = window.getSelection() + if (!selection || selection.rangeCount === 0) return + + const cursorPosition = getCursorPosition(editorRef) + const currentPrompt = prompt.current() + const rawText = currentPrompt.map((p) => ("content" in p ? p.content : "")).join("") + const textBeforeCursor = rawText.substring(0, cursorPosition) + const atMatch = textBeforeCursor.match(/@(\S*)$/) + + if (part.type === "file" || part.type === "agent") { + const pill = createPill(part) + const gap = document.createTextNode(" ") + const range = selection.getRangeAt(0) + + if (atMatch) { + const start = atMatch.index ?? cursorPosition - atMatch[0].length + setRangeEdge(range, "start", start) + setRangeEdge(range, "end", cursorPosition) + } + + range.deleteContents() + range.insertNode(gap) + range.insertNode(pill) + range.setStartAfter(gap) + range.collapse(true) + selection.removeAllRanges() + selection.addRange(range) + } else if (part.type === "text") { + const range = selection.getRangeAt(0) + const fragment = createTextFragment(part.content) + const last = fragment.lastChild + range.deleteContents() + range.insertNode(fragment) + if (last) { + if (last.nodeType === Node.TEXT_NODE) { + const text = last.textContent ?? "" + if (text === "\u200B") { + range.setStart(last, 0) + } + if (text !== "\u200B") { + range.setStart(last, text.length) + } + } + if (last.nodeType !== Node.TEXT_NODE) { + range.setStartAfter(last) + } + } + range.collapse(true) + selection.removeAllRanges() + selection.addRange(range) + } + + handleInput() + setStore("popover", null) + } + + const abort = () => + sdk.client.session + .abort({ + sessionID: params.id!, + }) + .catch(() => {}) + + const addToHistory = (prompt: Prompt, mode: "normal" | "shell") => { + const text = prompt + .map((p) => ("content" in p ? p.content : "")) + .join("") + .trim() + const hasImages = prompt.some((part) => part.type === "image") + if (!text && !hasImages) return + + const entry = clonePromptParts(prompt) + const currentHistory = mode === "shell" ? shellHistory : history + const setCurrentHistory = mode === "shell" ? setShellHistory : setHistory + const lastEntry = currentHistory.entries[0] + if (lastEntry && isPromptEqual(lastEntry, entry)) return + + setCurrentHistory("entries", (entries) => [entry, ...entries].slice(0, MAX_HISTORY)) + } + + const navigateHistory = (direction: "up" | "down") => { + const entries = store.mode === "shell" ? shellHistory.entries : history.entries + const current = store.historyIndex + + if (direction === "up") { + if (entries.length === 0) return false + if (current === -1) { + setStore("savedPrompt", clonePromptParts(prompt.current())) + setStore("historyIndex", 0) + applyHistoryPrompt(entries[0], "start") + return true + } + if (current < entries.length - 1) { + const next = current + 1 + setStore("historyIndex", next) + applyHistoryPrompt(entries[next], "start") + return true + } + return false + } + + if (current > 0) { + const next = current - 1 + setStore("historyIndex", next) + applyHistoryPrompt(entries[next], "end") + return true + } + if (current === 0) { + setStore("historyIndex", -1) + const saved = store.savedPrompt + if (saved) { + applyHistoryPrompt(saved, "end") + setStore("savedPrompt", null) + return true + } + applyHistoryPrompt(DEFAULT_PROMPT, "end") + return true + } + + return false + } + + const handleKeyDown = (event: KeyboardEvent) => { + if (event.key === "Backspace") { + const selection = window.getSelection() + if (selection && selection.isCollapsed) { + const node = selection.anchorNode + const offset = selection.anchorOffset + if (node && node.nodeType === Node.TEXT_NODE) { + const text = node.textContent ?? "" + if (/^\u200B+$/.test(text) && offset > 0) { + const range = document.createRange() + range.setStart(node, 0) + range.collapse(true) + selection.removeAllRanges() + selection.addRange(range) + } + } + } + } + + if (event.key === "!" && store.mode === "normal") { + const cursorPosition = getCursorPosition(editorRef) + if (cursorPosition === 0) { + setStore("mode", "shell") + setStore("popover", null) + event.preventDefault() + return + } + } + if (store.mode === "shell") { + const { collapsed, cursorPosition, textLength } = getCaretState() + if (event.key === "Escape") { + setStore("mode", "normal") + event.preventDefault() + return + } + if (event.key === "Backspace" && collapsed && cursorPosition === 0 && textLength === 0) { + setStore("mode", "normal") + event.preventDefault() + return + } + } + + // Handle Shift+Enter BEFORE IME check - Shift+Enter is never used for IME input + // and should always insert a newline regardless of composition state + if (event.key === "Enter" && event.shiftKey) { + addPart({ type: "text", content: "\n", start: 0, end: 0 }) + event.preventDefault() + return + } + + if (event.key === "Enter" && isImeComposing(event)) { + return + } + + if (store.popover) { + if (event.key === "Tab") { + selectPopoverActive() + event.preventDefault() + return + } + if (event.key === "ArrowUp" || event.key === "ArrowDown" || event.key === "Enter") { + if (store.popover === "at") { + atOnKeyDown(event) + event.preventDefault() + return + } + if (store.popover === "slash") { + slashOnKeyDown(event) + } + event.preventDefault() + return + } + } + + const ctrl = event.ctrlKey && !event.metaKey && !event.altKey && !event.shiftKey + + if (ctrl && event.code === "KeyG") { + if (store.popover) { + setStore("popover", null) + event.preventDefault() + return + } + if (working()) { + abort() + event.preventDefault() + } + return + } + + if (event.key === "ArrowUp" || event.key === "ArrowDown") { + if (event.altKey || event.ctrlKey || event.metaKey) return + const { collapsed } = getCaretState() + if (!collapsed) return + + const cursorPosition = getCursorPosition(editorRef) + const textLength = promptLength(prompt.current()) + const textContent = prompt + .current() + .map((part) => ("content" in part ? part.content : "")) + .join("") + const isEmpty = textContent.trim() === "" || textLength <= 1 + const hasNewlines = textContent.includes("\n") + const inHistory = store.historyIndex >= 0 + const atStart = cursorPosition <= (isEmpty ? 1 : 0) + const atEnd = cursorPosition >= (isEmpty ? textLength - 1 : textLength) + const allowUp = isEmpty || atStart || (!hasNewlines && !inHistory) || (inHistory && atEnd) + const allowDown = isEmpty || atEnd || (!hasNewlines && !inHistory) || (inHistory && atStart) + + if (event.key === "ArrowUp") { + if (!allowUp) return + if (navigateHistory("up")) { + event.preventDefault() + } + return + } + + if (!allowDown) return + if (navigateHistory("down")) { + event.preventDefault() + } + return + } + + // Note: Shift+Enter is handled earlier, before IME check + if (event.key === "Enter" && !event.shiftKey) { + handleSubmit(event) + } + if (event.key === "Escape") { + if (store.popover) { + setStore("popover", null) + } else if (working()) { + abort() + } + } + } + + const handleSubmit = async (event: Event) => { + event.preventDefault() + + const currentPrompt = prompt.current() + const text = currentPrompt.map((part) => ("content" in part ? part.content : "")).join("") + const images = imageAttachments().slice() + const mode = store.mode + + if (text.trim().length === 0 && images.length === 0) { + if (working()) abort() + return + } + + const currentModel = local.model.current() + const currentAgent = local.agent.current() + if (!currentModel || !currentAgent) { + showToast({ + title: language.t("prompt.toast.modelAgentRequired.title"), + description: language.t("prompt.toast.modelAgentRequired.description"), + }) + return + } + + const errorMessage = (err: unknown) => { + if (err && typeof err === "object" && "data" in err) { + const data = (err as { data?: { message?: string } }).data + if (data?.message) return data.message + } + if (err instanceof Error) return err.message + return language.t("common.requestFailed") + } + + addToHistory(currentPrompt, mode) + setStore("historyIndex", -1) + setStore("savedPrompt", null) + + const projectDirectory = sdk.directory + const isNewSession = !params.id + const worktreeSelection = props.newSessionWorktree ?? "main" + + let sessionDirectory = projectDirectory + let client = sdk.client + + if (isNewSession) { + if (worktreeSelection === "create") { + const createdWorktree = await client.worktree + .create({ directory: projectDirectory }) + .then((x) => x.data) + .catch((err) => { + showToast({ + title: language.t("prompt.toast.worktreeCreateFailed.title"), + description: errorMessage(err), + }) + return undefined + }) + + if (!createdWorktree?.directory) { + showToast({ + title: language.t("prompt.toast.worktreeCreateFailed.title"), + description: language.t("common.requestFailed"), + }) + return + } + sessionDirectory = createdWorktree.directory + } + + if (worktreeSelection !== "main" && worktreeSelection !== "create") { + sessionDirectory = worktreeSelection + } + + if (sessionDirectory !== projectDirectory) { + client = createOpencodeClient({ + baseUrl: sdk.url, + fetch: platform.fetch, + directory: sessionDirectory, + throwOnError: true, + }) + globalSync.child(sessionDirectory) + } + + props.onNewSessionWorktreeReset?.() + } + + let session = info() + if (!session && isNewSession) { + session = await client.session + .create() + .then((x) => x.data ?? undefined) + .catch((err) => { + showToast({ + title: language.t("prompt.toast.sessionCreateFailed.title"), + description: errorMessage(err), + }) + return undefined + }) + if (session) navigate(`/${base64Encode(sessionDirectory)}/session/${session.id}`) + } + if (!session) return + + props.onSubmit?.() + + const model = { + modelID: currentModel.id, + providerID: currentModel.provider.id, + } + const agent = currentAgent.name + const variant = local.model.variant.current() + + const clearInput = () => { + prompt.reset() + setStore("mode", "normal") + setStore("popover", null) + } + + const restoreInput = () => { + prompt.set(currentPrompt, promptLength(currentPrompt)) + setStore("mode", mode) + setStore("popover", null) + requestAnimationFrame(() => { + editorRef.focus() + setCursorPosition(editorRef, promptLength(currentPrompt)) + queueScroll() + }) + } + + if (mode === "shell") { + clearInput() + client.session + .shell({ + sessionID: session.id, + agent, + model, + command: text, + }) + .catch((err) => { + showToast({ + title: language.t("prompt.toast.shellSendFailed.title"), + description: errorMessage(err), + }) + restoreInput() + }) + return + } + + if (text.startsWith("/")) { + const [cmdName, ...args] = text.split(" ") + const commandName = cmdName.slice(1) + const customCommand = sync.data.command.find((c) => c.name === commandName) + if (customCommand) { + clearInput() + client.session + .command({ + sessionID: session.id, + command: commandName, + arguments: args.join(" "), + agent, + model: `${model.providerID}/${model.modelID}`, + variant, + parts: images.map((attachment) => ({ + id: Identifier.ascending("part"), + type: "file" as const, + mime: attachment.mime, + url: attachment.dataUrl, + filename: attachment.filename, + })), + }) + .catch((err) => { + showToast({ + title: language.t("prompt.toast.commandSendFailed.title"), + description: errorMessage(err), + }) + restoreInput() + }) + return + } + } + + const toAbsolutePath = (path: string) => + path.startsWith("/") ? path : (sessionDirectory + "/" + path).replace("//", "/") + + const fileAttachments = currentPrompt.filter((part) => part.type === "file") as FileAttachmentPart[] + const agentAttachments = currentPrompt.filter((part) => part.type === "agent") as AgentPart[] + + const fileAttachmentParts = fileAttachments.map((attachment) => { + const absolute = toAbsolutePath(attachment.path) + const query = attachment.selection + ? `?start=${attachment.selection.startLine}&end=${attachment.selection.endLine}` + : "" + return { + id: Identifier.ascending("part"), + type: "file" as const, + mime: "text/plain", + url: `file://${absolute}${query}`, + filename: getFilename(attachment.path), + source: { + type: "file" as const, + text: { + value: attachment.content, + start: attachment.start, + end: attachment.end, + }, + path: absolute, + }, + } + }) + + const agentAttachmentParts = agentAttachments.map((attachment) => ({ + id: Identifier.ascending("part"), + type: "agent" as const, + name: attachment.name, + source: { + value: attachment.content, + start: attachment.start, + end: attachment.end, + }, + })) + + const usedUrls = new Set(fileAttachmentParts.map((part) => part.url)) + + const contextFileParts: Array<{ + id: string + type: "file" + mime: string + url: string + filename?: string + }> = [] + + const addContextFile = (path: string, selection?: FileSelection) => { + const absolute = toAbsolutePath(path) + const query = selection ? `?start=${selection.startLine}&end=${selection.endLine}` : "" + const url = `file://${absolute}${query}` + if (usedUrls.has(url)) return + usedUrls.add(url) + contextFileParts.push({ + id: Identifier.ascending("part"), + type: "file", + mime: "text/plain", + url, + filename: getFilename(path), + }) + } + + const activePath = activeFile() + if (activePath && prompt.context.activeTab()) { + addContextFile(activePath) + } + + for (const item of prompt.context.items()) { + if (item.type !== "file") continue + addContextFile(item.path, item.selection) + } + + const imageAttachmentParts = images.map((attachment) => ({ + id: Identifier.ascending("part"), + type: "file" as const, + mime: attachment.mime, + url: attachment.dataUrl, + filename: attachment.filename, + })) + + const messageID = Identifier.ascending("message") + const textPart = { + id: Identifier.ascending("part"), + type: "text" as const, + text, + } + const requestParts = [ + textPart, + ...fileAttachmentParts, + ...contextFileParts, + ...agentAttachmentParts, + ...imageAttachmentParts, + ] + + const optimisticParts = requestParts.map((part) => ({ + ...part, + sessionID: session.id, + messageID, + })) as unknown as Part[] + + const optimisticMessage: Message = { + id: messageID, + sessionID: session.id, + role: "user", + time: { created: Date.now() }, + agent, + model, + } + + const setSyncStore = sessionDirectory === projectDirectory ? sync.set : globalSync.child(sessionDirectory)[1] + + const addOptimisticMessage = () => { + setSyncStore( + produce((draft) => { + const messages = draft.message[session.id] + if (!messages) { + draft.message[session.id] = [optimisticMessage] + } else { + const result = Binary.search(messages, messageID, (m) => m.id) + messages.splice(result.index, 0, optimisticMessage) + } + draft.part[messageID] = optimisticParts + .filter((p) => !!p?.id) + .slice() + .sort((a, b) => a.id.localeCompare(b.id)) + }), + ) + } + + const removeOptimisticMessage = () => { + setSyncStore( + produce((draft) => { + const messages = draft.message[session.id] + if (messages) { + const result = Binary.search(messages, messageID, (m) => m.id) + if (result.found) messages.splice(result.index, 1) + } + delete draft.part[messageID] + }), + ) + } + + clearInput() + addOptimisticMessage() + + client.session + .prompt({ + sessionID: session.id, + agent, + model, + messageID, + parts: requestParts, + variant, + }) + .catch((err) => { + showToast({ + title: language.t("prompt.toast.promptSendFailed.title"), + description: errorMessage(err), + }) + removeOptimisticMessage() + restoreInput() + }) + } + + return ( +
+ +
{ + if (store.popover === "slash") slashPopoverRef = el + }} + class="absolute inset-x-0 -top-3 -translate-y-full origin-bottom-left max-h-80 min-h-10 + overflow-auto no-scrollbar flex flex-col p-2 rounded-md + border border-border-base bg-surface-raised-stronger-non-alpha shadow-md" + onMouseDown={(e) => e.preventDefault()} + > + + + 0} + fallback={
{language.t("prompt.popover.emptyResults")}
} + > + + {(item) => ( + + )} + +
+
+ + 0} + fallback={
{language.t("prompt.popover.emptyCommands")}
} + > + + {(cmd) => ( + + )} + +
+
+
+
+
+
+ +
+
+ + {language.t("prompt.dropzone.label")} +
+
+
+ 0 || !!activeFile())}> +
+ + {(path) => ( +
+ +
+ {getDirectory(path())} + {getFilename(path())} + {language.t("prompt.context.active")} +
+ prompt.context.removeActive()} + aria-label={language.t("prompt.context.removeActiveFile")} + /> +
+ )} +
+ + + + + {(item) => ( +
+ +
+ {getDirectory(item.path)} + {getFilename(item.path)} + + {(sel) => ( + + {sel().startLine === sel().endLine + ? `:${sel().startLine}` + : `:${sel().startLine}-${sel().endLine}`} + + )} + +
+ prompt.context.remove(item.key)} + aria-label={language.t("prompt.context.removeFile")} + /> +
+ )} +
+
+
+ 0}> +
+ + {(attachment) => ( +
+ + +
+ } + > + {attachment.filename} + dialog.show(() => ) + } + /> + + +
+ {attachment.filename} +
+
+ )} + +
+ +
(scrollRef = el)}> +
{ + editorRef = el + props.ref?.(el) + }} + role="textbox" + aria-multiline="true" + aria-label={ + store.mode === "shell" + ? language.t("prompt.placeholder.shell") + : language.t("prompt.placeholder.normal", { example: language.t(EXAMPLES[store.placeholder]) }) + } + contenteditable="true" + onInput={handleInput} + onPaste={handlePaste} + onCompositionStart={() => setComposing(true)} + onCompositionEnd={() => setComposing(false)} + onKeyDown={handleKeyDown} + classList={{ + "select-text": true, + "w-full px-5 py-3 pr-12 text-14-regular text-text-strong focus:outline-none whitespace-pre-wrap": true, + "[&_[data-type=file]]:text-syntax-property": true, + "[&_[data-type=agent]]:text-syntax-type": true, + "font-mono!": store.mode === "shell", + }} + /> + +
+ {store.mode === "shell" + ? language.t("prompt.placeholder.shell") + : language.t("prompt.placeholder.normal", { example: language.t(EXAMPLES[store.placeholder]) })} +
+
+
+
+
+ + +
+ + {language.t("prompt.mode.shell")} + {language.t("prompt.mode.shell.exit")} +
+
+ + + { + const file = e.currentTarget.files?.[0] + if (file) addImageAttachment(file) + e.currentTarget.value = "" + }} + /> +
+ + + + + + +
+ + +
+ {language.t("prompt.action.stop")} + {language.t("common.key.esc")} +
+
+ +
+ {language.t("prompt.action.send")} + +
+
+
+ } + > + + +
+
+ +
+ ) +} + +function createTextFragment(content: string): DocumentFragment { + const fragment = document.createDocumentFragment() + const segments = content.split("\n") + segments.forEach((segment, index) => { + if (segment) { + fragment.appendChild(document.createTextNode(segment)) + } else if (segments.length > 1) { + fragment.appendChild(document.createTextNode("\u200B")) + } + if (index < segments.length - 1) { + fragment.appendChild(document.createElement("br")) + } + }) + return fragment +} + +function getNodeLength(node: Node): number { + if (node.nodeType === Node.ELEMENT_NODE && (node as HTMLElement).tagName === "BR") return 1 + return (node.textContent ?? "").replace(/\u200B/g, "").length +} + +function getTextLength(node: Node): number { + if (node.nodeType === Node.TEXT_NODE) return (node.textContent ?? "").replace(/\u200B/g, "").length + if (node.nodeType === Node.ELEMENT_NODE && (node as HTMLElement).tagName === "BR") return 1 + let length = 0 + for (const child of Array.from(node.childNodes)) { + length += getTextLength(child) + } + return length +} + +function getCursorPosition(parent: HTMLElement): number { + const selection = window.getSelection() + if (!selection || selection.rangeCount === 0) return 0 + const range = selection.getRangeAt(0) + if (!parent.contains(range.startContainer)) return 0 + const preCaretRange = range.cloneRange() + preCaretRange.selectNodeContents(parent) + preCaretRange.setEnd(range.startContainer, range.startOffset) + return getTextLength(preCaretRange.cloneContents()) +} + +function setCursorPosition(parent: HTMLElement, position: number) { + let remaining = position + let node = parent.firstChild + while (node) { + const length = getNodeLength(node) + const isText = node.nodeType === Node.TEXT_NODE + const isPill = + node.nodeType === Node.ELEMENT_NODE && + ((node as HTMLElement).dataset.type === "file" || (node as HTMLElement).dataset.type === "agent") + const isBreak = node.nodeType === Node.ELEMENT_NODE && (node as HTMLElement).tagName === "BR" + + if (isText && remaining <= length) { + const range = document.createRange() + const selection = window.getSelection() + range.setStart(node, remaining) + range.collapse(true) + selection?.removeAllRanges() + selection?.addRange(range) + return + } + + if ((isPill || isBreak) && remaining <= length) { + const range = document.createRange() + const selection = window.getSelection() + if (remaining === 0) { + range.setStartBefore(node) + } + if (remaining > 0 && isPill) { + range.setStartAfter(node) + } + if (remaining > 0 && isBreak) { + const next = node.nextSibling + if (next && next.nodeType === Node.TEXT_NODE) { + range.setStart(next, 0) + } + if (!next || next.nodeType !== Node.TEXT_NODE) { + range.setStartAfter(node) + } + } + range.collapse(true) + selection?.removeAllRanges() + selection?.addRange(range) + return + } + + remaining -= length + node = node.nextSibling + } + + const fallbackRange = document.createRange() + const fallbackSelection = window.getSelection() + const last = parent.lastChild + if (last && last.nodeType === Node.TEXT_NODE) { + const len = last.textContent ? last.textContent.length : 0 + fallbackRange.setStart(last, len) + } + if (!last || last.nodeType !== Node.TEXT_NODE) { + fallbackRange.selectNodeContents(parent) + } + fallbackRange.collapse(false) + fallbackSelection?.removeAllRanges() + fallbackSelection?.addRange(fallbackRange) +} diff --git a/packages/app/src/components/session-context-usage.tsx b/packages/app/src/components/session-context-usage.tsx new file mode 100644 index 00000000000..ee93b3f03c0 --- /dev/null +++ b/packages/app/src/components/session-context-usage.tsx @@ -0,0 +1,113 @@ +import { Match, Show, Switch, createMemo } from "solid-js" +import { Tooltip } from "@opencode-ai/ui/tooltip" +import { ProgressCircle } from "@opencode-ai/ui/progress-circle" +import { Button } from "@opencode-ai/ui/button" +import { useParams } from "@solidjs/router" +import { AssistantMessage } from "@opencode-ai/sdk/v2/client" + +import { useLayout } from "@/context/layout" +import { useSync } from "@/context/sync" +import { useLanguage } from "@/context/language" + +interface SessionContextUsageProps { + variant?: "button" | "indicator" +} + +export function SessionContextUsage(props: SessionContextUsageProps) { + const sync = useSync() + const params = useParams() + const layout = useLayout() + const language = useLanguage() + + const variant = createMemo(() => props.variant ?? "button") + const sessionKey = createMemo(() => `${params.dir}${params.id ? "/" + params.id : ""}`) + const tabs = createMemo(() => layout.tabs(sessionKey())) + const view = createMemo(() => layout.view(sessionKey())) + const messages = createMemo(() => (params.id ? (sync.data.message[params.id] ?? []) : [])) + + const cost = createMemo(() => { + const locale = language.locale() + const total = messages().reduce((sum, x) => sum + (x.role === "assistant" ? x.cost : 0), 0) + return new Intl.NumberFormat(locale, { + style: "currency", + currency: "USD", + }).format(total) + }) + + const context = createMemo(() => { + const locale = language.locale() + const last = messages().findLast((x) => { + if (x.role !== "assistant") return false + const total = x.tokens.input + x.tokens.output + x.tokens.reasoning + x.tokens.cache.read + x.tokens.cache.write + return total > 0 + }) as AssistantMessage + if (!last) return + const total = + last.tokens.input + last.tokens.output + last.tokens.reasoning + last.tokens.cache.read + last.tokens.cache.write + const model = sync.data.provider.all.find((x) => x.id === last.providerID)?.models[last.modelID] + return { + tokens: total.toLocaleString(locale), + percentage: model?.limit.context ? Math.round((total / model.limit.context) * 100) : null, + } + }) + + const openContext = () => { + if (!params.id) return + view().reviewPanel.open() + tabs().open("context") + tabs().setActive("context") + } + + const circle = () => ( +
+ +
+ ) + + const tooltipValue = () => ( +
+ + {(ctx) => ( + <> +
+ {ctx().tokens} + {language.t("context.usage.tokens")} +
+
+ {ctx().percentage ?? 0}% + {language.t("context.usage.usage")} +
+ + )} +
+
+ {cost()} + {language.t("context.usage.cost")} +
+ +
{language.t("context.usage.clickToView")}
+
+
+ ) + + return ( + + + + {circle()} + + + + + + + ) +} diff --git a/packages/app/src/components/session-lsp-indicator.tsx b/packages/app/src/components/session-lsp-indicator.tsx new file mode 100644 index 00000000000..dab92920ec4 --- /dev/null +++ b/packages/app/src/components/session-lsp-indicator.tsx @@ -0,0 +1,42 @@ +import { createMemo, Show } from "solid-js" +import { useSync } from "@/context/sync" +import { useLanguage } from "@/context/language" +import { Tooltip } from "@opencode-ai/ui/tooltip" + +export function SessionLspIndicator() { + const sync = useSync() + const language = useLanguage() + + const lspStats = createMemo(() => { + const lsp = sync.data.lsp ?? [] + const connected = lsp.filter((s) => s.status === "connected").length + const hasError = lsp.some((s) => s.status === "error") + const total = lsp.length + return { connected, hasError, total } + }) + + const tooltipContent = createMemo(() => { + const lsp = sync.data.lsp ?? [] + if (lsp.length === 0) return language.t("lsp.tooltip.none") + return lsp.map((s) => s.name).join(", ") + }) + + return ( + 0}> + +
+
0, + }} + /> + + {language.t("lsp.label.connected", { count: lspStats().connected })} + +
+ + + ) +} diff --git a/packages/app/src/components/session-mcp-indicator.tsx b/packages/app/src/components/session-mcp-indicator.tsx new file mode 100644 index 00000000000..489223b9bf5 --- /dev/null +++ b/packages/app/src/components/session-mcp-indicator.tsx @@ -0,0 +1,34 @@ +import { createMemo, Show } from "solid-js" +import { Button } from "@opencode-ai/ui/button" +import { useDialog } from "@opencode-ai/ui/context/dialog" +import { useSync } from "@/context/sync" +import { DialogSelectMcp } from "@/components/dialog-select-mcp" + +export function SessionMcpIndicator() { + const sync = useSync() + const dialog = useDialog() + + const mcpStats = createMemo(() => { + const mcp = sync.data.mcp ?? {} + const entries = Object.entries(mcp) + const enabled = entries.filter(([, status]) => status.status === "connected").length + const failed = entries.some(([, status]) => status.status === "failed") + const total = entries.length + return { enabled, failed, total } + }) + + return ( + 0}> + + + ) +} diff --git a/packages/app/src/components/session/index.ts b/packages/app/src/components/session/index.ts new file mode 100644 index 00000000000..20124b6fdef --- /dev/null +++ b/packages/app/src/components/session/index.ts @@ -0,0 +1,5 @@ +export { SessionHeader } from "./session-header" +export { SessionContextTab } from "./session-context-tab" +export { SortableTab, FileVisual } from "./session-sortable-tab" +export { SortableTerminalTab } from "./session-sortable-terminal-tab" +export { NewSessionView } from "./session-new-view" diff --git a/packages/app/src/components/session/session-context-tab.tsx b/packages/app/src/components/session/session-context-tab.tsx new file mode 100644 index 00000000000..b415789107d --- /dev/null +++ b/packages/app/src/components/session/session-context-tab.tsx @@ -0,0 +1,432 @@ +import { createMemo, createEffect, on, onCleanup, For, Show } from "solid-js" +import type { JSX } from "solid-js" +import { useParams } from "@solidjs/router" +import { DateTime } from "luxon" +import { useSync } from "@/context/sync" +import { useLayout } from "@/context/layout" +import { checksum } from "@opencode-ai/util/encode" +import { Icon } from "@opencode-ai/ui/icon" +import { Accordion } from "@opencode-ai/ui/accordion" +import { StickyAccordionHeader } from "@opencode-ai/ui/sticky-accordion-header" +import { Code } from "@opencode-ai/ui/code" +import { Markdown } from "@opencode-ai/ui/markdown" +import type { AssistantMessage, Message, Part, UserMessage } from "@opencode-ai/sdk/v2/client" +import { useLanguage } from "@/context/language" + +interface SessionContextTabProps { + messages: () => Message[] + visibleUserMessages: () => UserMessage[] + view: () => ReturnType["view"]> + info: () => ReturnType["session"]["get"]> +} + +export function SessionContextTab(props: SessionContextTabProps) { + const params = useParams() + const sync = useSync() + const language = useLanguage() + + const ctx = createMemo(() => { + const last = props.messages().findLast((x) => { + if (x.role !== "assistant") return false + const total = x.tokens.input + x.tokens.output + x.tokens.reasoning + x.tokens.cache.read + x.tokens.cache.write + return total > 0 + }) as AssistantMessage + if (!last) return + + const provider = sync.data.provider.all.find((x) => x.id === last.providerID) + const model = provider?.models[last.modelID] + const limit = model?.limit.context + + const input = last.tokens.input + const output = last.tokens.output + const reasoning = last.tokens.reasoning + const cacheRead = last.tokens.cache.read + const cacheWrite = last.tokens.cache.write + const total = input + output + reasoning + cacheRead + cacheWrite + const usage = limit ? Math.round((total / limit) * 100) : null + + return { + message: last, + provider, + model, + limit, + input, + output, + reasoning, + cacheRead, + cacheWrite, + total, + usage, + } + }) + + const cost = createMemo(() => { + const locale = language.locale() + const total = props.messages().reduce((sum, x) => sum + (x.role === "assistant" ? x.cost : 0), 0) + return new Intl.NumberFormat(locale, { + style: "currency", + currency: "USD", + }).format(total) + }) + + const counts = createMemo(() => { + const all = props.messages() + const user = all.reduce((count, x) => count + (x.role === "user" ? 1 : 0), 0) + const assistant = all.reduce((count, x) => count + (x.role === "assistant" ? 1 : 0), 0) + return { + all: all.length, + user, + assistant, + } + }) + + const systemPrompt = createMemo(() => { + const msg = props.visibleUserMessages().findLast((m) => !!m.system) + const system = msg?.system + if (!system) return + const trimmed = system.trim() + if (!trimmed) return + return trimmed + }) + + const number = (value: number | null | undefined) => { + if (value === undefined) return "—" + if (value === null) return "—" + return value.toLocaleString(language.locale()) + } + + const percent = (value: number | null | undefined) => { + if (value === undefined) return "—" + if (value === null) return "—" + return value.toLocaleString(language.locale()) + "%" + } + + const time = (value: number | undefined) => { + if (!value) return "—" + return DateTime.fromMillis(value).setLocale(language.locale()).toLocaleString(DateTime.DATETIME_MED) + } + + const providerLabel = createMemo(() => { + const c = ctx() + if (!c) return "—" + return c.provider?.name ?? c.message.providerID + }) + + const modelLabel = createMemo(() => { + const c = ctx() + if (!c) return "—" + if (c.model?.name) return c.model.name + return c.message.modelID + }) + + const breakdown = createMemo( + on( + () => [ctx()?.message.id, ctx()?.input, props.messages().length, systemPrompt()], + () => { + const c = ctx() + if (!c) return [] + const input = c.input + if (!input) return [] + + const out = { + system: systemPrompt()?.length ?? 0, + user: 0, + assistant: 0, + tool: 0, + } + + for (const msg of props.messages()) { + const parts = (sync.data.part[msg.id] ?? []) as Part[] + + if (msg.role === "user") { + for (const part of parts) { + if (part.type === "text") out.user += part.text.length + if (part.type === "file") out.user += part.source?.text.value.length ?? 0 + if (part.type === "agent") out.user += part.source?.value.length ?? 0 + } + continue + } + + if (msg.role === "assistant") { + for (const part of parts) { + if (part.type === "text") out.assistant += part.text.length + if (part.type === "reasoning") out.assistant += part.text.length + if (part.type === "tool") { + out.tool += Object.keys(part.state.input).length * 16 + if (part.state.status === "pending") out.tool += part.state.raw.length + if (part.state.status === "completed") out.tool += part.state.output.length + if (part.state.status === "error") out.tool += part.state.error.length + } + } + } + } + + const estimateTokens = (chars: number) => Math.ceil(chars / 4) + const system = estimateTokens(out.system) + const user = estimateTokens(out.user) + const assistant = estimateTokens(out.assistant) + const tool = estimateTokens(out.tool) + const estimated = system + user + assistant + tool + + const pct = (tokens: number) => (tokens / input) * 100 + const pctLabel = (tokens: number) => (Math.round(pct(tokens) * 10) / 10).toString() + "%" + + const build = (tokens: { system: number; user: number; assistant: number; tool: number; other: number }) => { + return [ + { + key: "system", + label: language.t("context.breakdown.system"), + tokens: tokens.system, + width: pct(tokens.system), + percent: pctLabel(tokens.system), + color: "var(--syntax-info)", + }, + { + key: "user", + label: language.t("context.breakdown.user"), + tokens: tokens.user, + width: pct(tokens.user), + percent: pctLabel(tokens.user), + color: "var(--syntax-success)", + }, + { + key: "assistant", + label: language.t("context.breakdown.assistant"), + tokens: tokens.assistant, + width: pct(tokens.assistant), + percent: pctLabel(tokens.assistant), + color: "var(--syntax-property)", + }, + { + key: "tool", + label: language.t("context.breakdown.tool"), + tokens: tokens.tool, + width: pct(tokens.tool), + percent: pctLabel(tokens.tool), + color: "var(--syntax-warning)", + }, + { + key: "other", + label: language.t("context.breakdown.other"), + tokens: tokens.other, + width: pct(tokens.other), + percent: pctLabel(tokens.other), + color: "var(--syntax-comment)", + }, + ].filter((x) => x.tokens > 0) + } + + if (estimated <= input) { + return build({ system, user, assistant, tool, other: input - estimated }) + } + + const scale = input / estimated + const scaled = { + system: Math.floor(system * scale), + user: Math.floor(user * scale), + assistant: Math.floor(assistant * scale), + tool: Math.floor(tool * scale), + } + const scaledTotal = scaled.system + scaled.user + scaled.assistant + scaled.tool + return build({ ...scaled, other: Math.max(0, input - scaledTotal) }) + }, + ), + ) + + function Stat(statProps: { label: string; value: JSX.Element }) { + return ( +
+
{statProps.label}
+
{statProps.value}
+
+ ) + } + + const stats = createMemo(() => { + const c = ctx() + const count = counts() + return [ + { label: language.t("context.stats.session"), value: props.info()?.title ?? params.id ?? "—" }, + { label: language.t("context.stats.messages"), value: count.all.toLocaleString(language.locale()) }, + { label: language.t("context.stats.provider"), value: providerLabel() }, + { label: language.t("context.stats.model"), value: modelLabel() }, + { label: language.t("context.stats.limit"), value: number(c?.limit) }, + { label: language.t("context.stats.totalTokens"), value: number(c?.total) }, + { label: language.t("context.stats.usage"), value: percent(c?.usage) }, + { label: language.t("context.stats.inputTokens"), value: number(c?.input) }, + { label: language.t("context.stats.outputTokens"), value: number(c?.output) }, + { label: language.t("context.stats.reasoningTokens"), value: number(c?.reasoning) }, + { + label: language.t("context.stats.cacheTokens"), + value: `${number(c?.cacheRead)} / ${number(c?.cacheWrite)}`, + }, + { label: language.t("context.stats.userMessages"), value: count.user.toLocaleString(language.locale()) }, + { + label: language.t("context.stats.assistantMessages"), + value: count.assistant.toLocaleString(language.locale()), + }, + { label: language.t("context.stats.totalCost"), value: cost() }, + { label: language.t("context.stats.sessionCreated"), value: time(props.info()?.time.created) }, + { label: language.t("context.stats.lastActivity"), value: time(c?.message.time.created) }, + ] satisfies { label: string; value: JSX.Element }[] + }) + + function RawMessageContent(msgProps: { message: Message }) { + const file = createMemo(() => { + const parts = (sync.data.part[msgProps.message.id] ?? []) as Part[] + const contents = JSON.stringify({ message: msgProps.message, parts }, null, 2) + return { + name: `${msgProps.message.role}-${msgProps.message.id}.json`, + contents, + cacheKey: checksum(contents), + } + }) + + return + } + + function RawMessage(msgProps: { message: Message }) { + return ( + + + +
+
+ {msgProps.message.role} • {msgProps.message.id} +
+
+
{time(msgProps.message.time.created)}
+ +
+
+
+
+ +
+ +
+
+
+ ) + } + + let scroll: HTMLDivElement | undefined + let frame: number | undefined + let pending: { x: number; y: number } | undefined + + const restoreScroll = (retries = 0) => { + const el = scroll + if (!el) return + + const s = props.view()?.scroll("context") + if (!s) return + + // Wait for content to be scrollable - content may not have rendered yet + if (el.scrollHeight <= el.clientHeight && retries < 10) { + requestAnimationFrame(() => restoreScroll(retries + 1)) + return + } + + if (el.scrollTop !== s.y) el.scrollTop = s.y + if (el.scrollLeft !== s.x) el.scrollLeft = s.x + } + + const handleScroll = (event: Event & { currentTarget: HTMLDivElement }) => { + pending = { + x: event.currentTarget.scrollLeft, + y: event.currentTarget.scrollTop, + } + if (frame !== undefined) return + + frame = requestAnimationFrame(() => { + frame = undefined + + const next = pending + pending = undefined + if (!next) return + + props.view().setScroll("context", next) + }) + } + + createEffect( + on( + () => props.messages().length, + () => { + requestAnimationFrame(restoreScroll) + }, + { defer: true }, + ), + ) + + onCleanup(() => { + if (frame === undefined) return + cancelAnimationFrame(frame) + }) + + return ( +
{ + scroll = el + restoreScroll() + }} + onScroll={handleScroll} + > +
+
+ {(stat) => } +
+ + 0}> +
+
{language.t("context.breakdown.title")}
+
+ + {(segment) => ( +
+ )} + +
+
+ + {(segment) => ( +
+
+
{segment.label}
+
{segment.percent}
+
+ )} + +
+ +
+ + + + {(prompt) => ( +
+
{language.t("context.systemPrompt.title")}
+
+ +
+
+ )} +
+ +
+
{language.t("context.rawMessages.title")}
+ + {(message) => } + +
+
+
+ ) +} diff --git a/packages/app/src/components/session/session-header.tsx b/packages/app/src/components/session/session-header.tsx new file mode 100644 index 00000000000..a76734a691d --- /dev/null +++ b/packages/app/src/components/session/session-header.tsx @@ -0,0 +1,343 @@ +import { createEffect, createMemo, onCleanup, Show } from "solid-js" +import { createStore } from "solid-js/store" +import { Portal } from "solid-js/web" +import { useParams } from "@solidjs/router" +import { useLayout } from "@/context/layout" +import { useCommand } from "@/context/command" +import { useLanguage } from "@/context/language" +// import { useServer } from "@/context/server" +// import { useDialog } from "@opencode-ai/ui/context/dialog" +import { usePlatform } from "@/context/platform" +import { useSync } from "@/context/sync" +import { useGlobalSDK } from "@/context/global-sdk" +import { getFilename } from "@opencode-ai/util/path" +import { base64Decode } from "@opencode-ai/util/encode" + +import { Icon } from "@opencode-ai/ui/icon" +import { IconButton } from "@opencode-ai/ui/icon-button" +import { Button } from "@opencode-ai/ui/button" +import { Tooltip, TooltipKeybind } from "@opencode-ai/ui/tooltip" +import { Popover } from "@opencode-ai/ui/popover" +import { TextField } from "@opencode-ai/ui/text-field" +import { Keybind } from "@opencode-ai/ui/keybind" + +export function SessionHeader() { + const globalSDK = useGlobalSDK() + const layout = useLayout() + const params = useParams() + const command = useCommand() + // const server = useServer() + // const dialog = useDialog() + const sync = useSync() + const platform = usePlatform() + const language = useLanguage() + + const projectDirectory = createMemo(() => base64Decode(params.dir ?? "")) + const project = createMemo(() => { + const directory = projectDirectory() + if (!directory) return + return layout.projects.list().find((p) => p.worktree === directory || p.sandboxes?.includes(directory)) + }) + const name = createMemo(() => { + const current = project() + if (current) return current.name || getFilename(current.worktree) + return getFilename(projectDirectory()) + }) + const hotkey = createMemo(() => command.keybind("file.open")) + + const currentSession = createMemo(() => sync.data.session.find((s) => s.id === params.id)) + const shareEnabled = createMemo(() => sync.data.config.share !== "disabled") + const showShare = createMemo(() => shareEnabled() && !!currentSession()) + const showReview = createMemo(() => !!currentSession()) + const sessionKey = createMemo(() => `${params.dir}${params.id ? "/" + params.id : ""}`) + const view = createMemo(() => layout.view(sessionKey())) + + const [state, setState] = createStore({ + share: false, + unshare: false, + copied: false, + timer: undefined as number | undefined, + }) + const shareUrl = createMemo(() => currentSession()?.share?.url) + + createEffect(() => { + const url = shareUrl() + if (url) return + if (state.timer) window.clearTimeout(state.timer) + setState({ copied: false, timer: undefined }) + }) + + onCleanup(() => { + if (state.timer) window.clearTimeout(state.timer) + }) + + function shareSession() { + const session = currentSession() + if (!session || state.share) return + setState("share", true) + globalSDK.client.session + .share({ sessionID: session.id, directory: projectDirectory() }) + .catch((error) => { + console.error("Failed to share session", error) + }) + .finally(() => { + setState("share", false) + }) + } + + function unshareSession() { + const session = currentSession() + if (!session || state.unshare) return + setState("unshare", true) + globalSDK.client.session + .unshare({ sessionID: session.id, directory: projectDirectory() }) + .catch((error) => { + console.error("Failed to unshare session", error) + }) + .finally(() => { + setState("unshare", false) + }) + } + + function copyLink() { + const url = shareUrl() + if (!url) return + navigator.clipboard + .writeText(url) + .then(() => { + if (state.timer) window.clearTimeout(state.timer) + setState("copied", true) + const timer = window.setTimeout(() => { + setState("copied", false) + setState("timer", undefined) + }, 3000) + setState("timer", timer) + }) + .catch((error) => { + console.error("Failed to copy share link", error) + }) + } + + function viewShare() { + const url = shareUrl() + if (!url) return + platform.openLink(url) + } + + const centerMount = createMemo(() => document.getElementById("opencode-titlebar-center")) + const rightMount = createMemo(() => document.getElementById("opencode-titlebar-right")) + + return ( + <> + + {(mount) => ( + + + + )} + + + {(mount) => ( + +
+ {/* */} +
+ + +
+ +
+ +
+ + +
+ } + > +
+ +
+ + +
+
+ +
+ + +
+
+
+ + )} + + + ) +} diff --git a/packages/app/src/components/session/session-new-view.tsx b/packages/app/src/components/session/session-new-view.tsx new file mode 100644 index 00000000000..f7f422fc5ea --- /dev/null +++ b/packages/app/src/components/session/session-new-view.tsx @@ -0,0 +1,93 @@ +import { Show, createMemo } from "solid-js" +import { DateTime } from "luxon" +import { useSync } from "@/context/sync" +import { useLanguage } from "@/context/language" +import { Icon } from "@opencode-ai/ui/icon" +import { getDirectory, getFilename } from "@opencode-ai/util/path" +import { Select } from "@opencode-ai/ui/select" + +const MAIN_WORKTREE = "main" +const CREATE_WORKTREE = "create" + +interface NewSessionViewProps { + worktree: string + onWorktreeChange: (value: string) => void +} + +export function NewSessionView(props: NewSessionViewProps) { + const sync = useSync() + const language = useLanguage() + + const sandboxes = createMemo(() => sync.project?.sandboxes ?? []) + const options = createMemo(() => [MAIN_WORKTREE, ...sandboxes(), CREATE_WORKTREE]) + const current = createMemo(() => { + const selection = props.worktree + if (options().includes(selection)) return selection + return MAIN_WORKTREE + }) + const projectRoot = createMemo(() => sync.project?.worktree ?? sync.data.path.directory) + const isWorktree = createMemo(() => { + const project = sync.project + if (!project) return false + return sync.data.path.directory !== project.worktree + }) + + const label = (value: string) => { + if (value === MAIN_WORKTREE) { + if (isWorktree()) return language.t("session.new.worktree.main") + const branch = sync.data.vcs?.branch + if (branch) return language.t("session.new.worktree.mainWithBranch", { branch }) + return language.t("session.new.worktree.main") + } + + if (value === CREATE_WORKTREE) return language.t("session.new.worktree.create") + + return getFilename(value) + } + + return ( +
+
{language.t("command.session.new")}
+
+ +
+ {getDirectory(projectRoot())} + {getFilename(projectRoot())} +
+
+
+ + setTitle(e.currentTarget.value)} + onBlur={save} + onKeyDown={keydown} + onMouseDown={(e) => e.stopPropagation()} + class="bg-transparent border-none outline-none text-sm min-w-0 flex-1" + /> +
+ + + + + + + {language.t("common.rename")} + + + + {language.t("common.close")} + + + + +
+
+ ) +} diff --git a/packages/app/src/components/settings-agents.tsx b/packages/app/src/components/settings-agents.tsx new file mode 100644 index 00000000000..e68f1e59c53 --- /dev/null +++ b/packages/app/src/components/settings-agents.tsx @@ -0,0 +1,15 @@ +import { Component } from "solid-js" +import { useLanguage } from "@/context/language" + +export const SettingsAgents: Component = () => { + const language = useLanguage() + + return ( +
+
+

{language.t("settings.agents.title")}

+

{language.t("settings.agents.description")}

+
+
+ ) +} diff --git a/packages/app/src/components/settings-commands.tsx b/packages/app/src/components/settings-commands.tsx new file mode 100644 index 00000000000..cf796d0aa7a --- /dev/null +++ b/packages/app/src/components/settings-commands.tsx @@ -0,0 +1,15 @@ +import { Component } from "solid-js" +import { useLanguage } from "@/context/language" + +export const SettingsCommands: Component = () => { + const language = useLanguage() + + return ( +
+
+

{language.t("settings.commands.title")}

+

{language.t("settings.commands.description")}

+
+
+ ) +} diff --git a/packages/app/src/components/settings-general.tsx b/packages/app/src/components/settings-general.tsx new file mode 100644 index 00000000000..c3cc2760142 --- /dev/null +++ b/packages/app/src/components/settings-general.tsx @@ -0,0 +1,296 @@ +import { Component, createMemo, type JSX } from "solid-js" +import { Select } from "@opencode-ai/ui/select" +import { Switch } from "@opencode-ai/ui/switch" +import { useTheme, type ColorScheme } from "@opencode-ai/ui/theme" +import { useLanguage } from "@/context/language" +import { useSettings, monoFontFamily } from "@/context/settings" +import { playSound, SOUND_OPTIONS } from "@/utils/sound" +import { Link } from "./link" + +export const SettingsGeneral: Component = () => { + const theme = useTheme() + const language = useLanguage() + const settings = useSettings() + + const themeOptions = createMemo(() => + Object.entries(theme.themes()).map(([id, def]) => ({ id, name: def.name ?? id })), + ) + + const colorSchemeOptions = createMemo((): { value: ColorScheme; label: string }[] => [ + { value: "system", label: language.t("theme.scheme.system") }, + { value: "light", label: language.t("theme.scheme.light") }, + { value: "dark", label: language.t("theme.scheme.dark") }, + ]) + + const languageOptions = createMemo(() => + language.locales.map((locale) => ({ + value: locale, + label: language.label(locale), + })), + ) + + const fontOptions = [ + { value: "ibm-plex-mono", label: "font.option.ibmPlexMono" }, + { value: "cascadia-code", label: "font.option.cascadiaCode" }, + { value: "fira-code", label: "font.option.firaCode" }, + { value: "hack", label: "font.option.hack" }, + { value: "inconsolata", label: "font.option.inconsolata" }, + { value: "intel-one-mono", label: "font.option.intelOneMono" }, + { value: "jetbrains-mono", label: "font.option.jetbrainsMono" }, + { value: "meslo-lgs", label: "font.option.mesloLgs" }, + { value: "roboto-mono", label: "font.option.robotoMono" }, + { value: "source-code-pro", label: "font.option.sourceCodePro" }, + { value: "ubuntu-mono", label: "font.option.ubuntuMono" }, + ] as const + const fontOptionsList = [...fontOptions] + + const soundOptions = [...SOUND_OPTIONS] + + return ( +
+
+
+

{language.t("settings.tab.general")}

+
+
+ +
+ {/* Appearance Section */} +
+

{language.t("settings.general.section.appearance")}

+ +
+ + o.value === theme.colorScheme())} + value={(o) => o.value} + label={(o) => o.label} + onSelect={(option) => option && theme.setColorScheme(option.value)} + onHighlight={(option) => { + if (!option) return + theme.previewColorScheme(option.value) + return () => theme.cancelPreview() + }} + variant="secondary" + size="small" + triggerVariant="settings" + /> + + + + {language.t("settings.general.row.theme.description")}{" "} + {language.t("common.learnMore")} + + } + > + o.value === settings.appearance.font())} + value={(o) => o.value} + label={(o) => language.t(o.label)} + onSelect={(option) => option && settings.appearance.setFont(option.value)} + variant="secondary" + size="small" + triggerVariant="settings" + triggerStyle={{ "font-family": monoFontFamily(settings.appearance.font()), "min-width": "180px" }} + > + {(option) => ( + + {option ? language.t(option.label) : ""} + + )} + + +
+
+ + {/* System notifications Section */} +
+

{language.t("settings.general.section.notifications")}

+ +
+ + settings.notifications.setAgent(checked)} + /> + + + + settings.notifications.setPermissions(checked)} + /> + + + + settings.notifications.setErrors(checked)} + /> + +
+
+ + {/* Sound effects Section */} +
+

{language.t("settings.general.section.sounds")}

+ +
+ + o.id === settings.sounds.permissions())} + value={(o) => o.id} + label={(o) => language.t(o.label)} + onHighlight={(option) => { + if (!option) return + playSound(option.src) + }} + onSelect={(option) => { + if (!option) return + settings.sounds.setPermissions(option.id) + playSound(option.src) + }} + variant="secondary" + size="small" + triggerVariant="settings" + /> + + + + o.value === actionFor(item.id))} + value={(o) => o.value} + label={(o) => o.label} + onSelect={(option) => option && setPermission(item.id, option.value)} + variant="secondary" + size="small" + triggerVariant="settings" + /> + + )} + +
+
+
+
+ ) +} + +interface SettingsRowProps { + title: string + description: string + children: JSX.Element +} + +const SettingsRow: Component = (props) => { + return ( +
+
+ {props.title} + {props.description} +
+
{props.children}
+
+ ) +} diff --git a/packages/app/src/components/settings-providers.tsx b/packages/app/src/components/settings-providers.tsx new file mode 100644 index 00000000000..7b6ca193924 --- /dev/null +++ b/packages/app/src/components/settings-providers.tsx @@ -0,0 +1,15 @@ +import { Component } from "solid-js" +import { useLanguage } from "@/context/language" + +export const SettingsProviders: Component = () => { + const language = useLanguage() + + return ( +
+
+

{language.t("settings.providers.title")}

+

{language.t("settings.providers.description")}

+
+
+ ) +} diff --git a/packages/app/src/components/terminal.tsx b/packages/app/src/components/terminal.tsx new file mode 100644 index 00000000000..6bedcfae2ce --- /dev/null +++ b/packages/app/src/components/terminal.tsx @@ -0,0 +1,315 @@ +import type { Ghostty, Terminal as Term, FitAddon } from "ghostty-web" +import { ComponentProps, createEffect, createSignal, onCleanup, onMount, splitProps } from "solid-js" +import { useSDK } from "@/context/sdk" +import { monoFontFamily, useSettings } from "@/context/settings" +import { SerializeAddon } from "@/addons/serialize" +import { LocalPTY } from "@/context/terminal" +import { resolveThemeVariant, useTheme, withAlpha, type HexColor } from "@opencode-ai/ui/theme" + +export interface TerminalProps extends ComponentProps<"div"> { + pty: LocalPTY + onSubmit?: () => void + onCleanup?: (pty: LocalPTY) => void + onConnect?: () => void + onConnectError?: (error: unknown) => void +} + +type TerminalColors = { + background: string + foreground: string + cursor: string + selectionBackground: string +} + +const DEFAULT_TERMINAL_COLORS: Record<"light" | "dark", TerminalColors> = { + light: { + background: "#fcfcfc", + foreground: "#211e1e", + cursor: "#211e1e", + selectionBackground: withAlpha("#211e1e", 0.2), + }, + dark: { + background: "#191515", + foreground: "#d4d4d4", + cursor: "#d4d4d4", + selectionBackground: withAlpha("#d4d4d4", 0.25), + }, +} + +export const Terminal = (props: TerminalProps) => { + const sdk = useSDK() + const settings = useSettings() + const theme = useTheme() + let container!: HTMLDivElement + const [local, others] = splitProps(props, ["pty", "class", "classList", "onConnect", "onConnectError"]) + let ws: WebSocket | undefined + let term: Term | undefined + let ghostty: Ghostty + let serializeAddon: SerializeAddon + let fitAddon: FitAddon + let handleResize: () => void + let handleTextareaFocus: () => void + let handleTextareaBlur: () => void + let reconnect: number | undefined + let disposed = false + + const getTerminalColors = (): TerminalColors => { + const mode = theme.mode() + const fallback = DEFAULT_TERMINAL_COLORS[mode] + const currentTheme = theme.themes()[theme.themeId()] + if (!currentTheme) return fallback + const variant = mode === "dark" ? currentTheme.dark : currentTheme.light + if (!variant?.seeds) return fallback + const resolved = resolveThemeVariant(variant, mode === "dark") + const text = resolved["text-stronger"] ?? fallback.foreground + const background = resolved["background-stronger"] ?? fallback.background + const alpha = mode === "dark" ? 0.25 : 0.2 + const base = text.startsWith("#") ? (text as HexColor) : (fallback.foreground as HexColor) + const selectionBackground = withAlpha(base, alpha) + return { + background, + foreground: text, + cursor: text, + selectionBackground, + } + } + + const [terminalColors, setTerminalColors] = createSignal(getTerminalColors()) + + createEffect(() => { + const colors = getTerminalColors() + setTerminalColors(colors) + if (!term) return + const setOption = (term as unknown as { setOption?: (key: string, value: TerminalColors) => void }).setOption + if (!setOption) return + setOption("theme", colors) + }) + + createEffect(() => { + const font = monoFontFamily(settings.appearance.font()) + if (!term) return + const setOption = (term as unknown as { setOption?: (key: string, value: string) => void }).setOption + if (!setOption) return + setOption("fontFamily", font) + }) + + const focusTerminal = () => { + const t = term + if (!t) return + t.focus() + setTimeout(() => t.textarea?.focus(), 0) + } + const handlePointerDown = () => { + const activeElement = document.activeElement + if (activeElement instanceof HTMLElement && activeElement !== container) { + activeElement.blur() + } + focusTerminal() + } + + onMount(async () => { + const mod = await import("ghostty-web") + ghostty = await mod.Ghostty.load() + + const url = new URL(sdk.url + `/pty/${local.pty.id}/connect?directory=${encodeURIComponent(sdk.directory)}`) + if (window.__OPENCODE__?.serverPassword) { + url.username = "opencode" + url.password = window.__OPENCODE__?.serverPassword + } + const socket = new WebSocket(url) + ws = socket + + const t = new mod.Terminal({ + cursorBlink: true, + cursorStyle: "bar", + fontSize: 14, + fontFamily: monoFontFamily(settings.appearance.font()), + allowTransparency: true, + theme: terminalColors(), + scrollback: 10_000, + ghostty, + }) + term = t + + const copy = () => { + const selection = t.getSelection() + if (!selection) return false + + const body = document.body + if (body) { + const textarea = document.createElement("textarea") + textarea.value = selection + textarea.setAttribute("readonly", "") + textarea.style.position = "fixed" + textarea.style.opacity = "0" + body.appendChild(textarea) + textarea.select() + const copied = document.execCommand("copy") + body.removeChild(textarea) + if (copied) return true + } + + const clipboard = navigator.clipboard + if (clipboard?.writeText) { + clipboard.writeText(selection).catch(() => {}) + return true + } + + return false + } + + t.attachCustomKeyEventHandler((event) => { + const key = event.key.toLowerCase() + + if (event.ctrlKey && event.shiftKey && !event.metaKey && key === "c") { + copy() + return true + } + + if (event.metaKey && !event.ctrlKey && !event.altKey && key === "c") { + if (!t.hasSelection()) return true + copy() + return true + } + + // allow for ctrl-` to toggle terminal in parent + if (event.ctrlKey && key === "`") { + return true + } + + return false + }) + + fitAddon = new mod.FitAddon() + serializeAddon = new SerializeAddon() + t.loadAddon(serializeAddon) + t.loadAddon(fitAddon) + + t.open(container) + container.addEventListener("pointerdown", handlePointerDown) + + handleTextareaFocus = () => { + t.options.cursorBlink = true + } + handleTextareaBlur = () => { + t.options.cursorBlink = false + } + + t.textarea?.addEventListener("focus", handleTextareaFocus) + t.textarea?.addEventListener("blur", handleTextareaBlur) + + focusTerminal() + + if (local.pty.buffer) { + if (local.pty.rows && local.pty.cols) { + t.resize(local.pty.cols, local.pty.rows) + } + t.write(local.pty.buffer, () => { + if (local.pty.scrollY) { + t.scrollToLine(local.pty.scrollY) + } + fitAddon.fit() + }) + } + + fitAddon.observeResize() + handleResize = () => fitAddon.fit() + window.addEventListener("resize", handleResize) + t.onResize(async (size) => { + if (socket.readyState === WebSocket.OPEN) { + await sdk.client.pty + .update({ + ptyID: local.pty.id, + size: { + cols: size.cols, + rows: size.rows, + }, + }) + .catch(() => {}) + } + }) + t.onData((data) => { + if (socket.readyState === WebSocket.OPEN) { + socket.send(data) + } + }) + t.onKey((key) => { + if (key.key == "Enter") { + props.onSubmit?.() + } + }) + // t.onScroll((ydisp) => { + // console.log("Scroll position:", ydisp) + // }) + socket.addEventListener("open", () => { + local.onConnect?.() + sdk.client.pty + .update({ + ptyID: local.pty.id, + size: { + cols: t.cols, + rows: t.rows, + }, + }) + .catch(() => {}) + }) + socket.addEventListener("message", (event) => { + t.write(event.data) + }) + socket.addEventListener("error", (error) => { + if (disposed) return + console.error("WebSocket error:", error) + local.onConnectError?.(error) + }) + socket.addEventListener("close", (event) => { + if (disposed) return + // Normal closure (code 1000) means PTY process exited - server event handles cleanup + // For other codes (network issues, server restart), trigger error handler + if (event.code !== 1000) { + local.onConnectError?.(new Error(`WebSocket closed abnormally: ${event.code}`)) + } + }) + }) + + onCleanup(() => { + disposed = true + if (handleResize) { + window.removeEventListener("resize", handleResize) + } + container.removeEventListener("pointerdown", handlePointerDown) + term?.textarea?.removeEventListener("focus", handleTextareaFocus) + term?.textarea?.removeEventListener("blur", handleTextareaBlur) + + const t = term + if (serializeAddon && props.onCleanup && t) { + const buffer = serializeAddon.serialize() + props.onCleanup({ + ...local.pty, + buffer, + rows: t.rows, + cols: t.cols, + scrollY: t.getViewportY(), + }) + } + + ws?.close() + t?.dispose() + }) + + return ( +
+ ) +} diff --git a/packages/app/src/components/titlebar.tsx b/packages/app/src/components/titlebar.tsx new file mode 100644 index 00000000000..f631305b4ec --- /dev/null +++ b/packages/app/src/components/titlebar.tsx @@ -0,0 +1,156 @@ +import { createEffect, createMemo, Show } from "solid-js" +import { IconButton } from "@opencode-ai/ui/icon-button" +import { Icon } from "@opencode-ai/ui/icon" +import { Button } from "@opencode-ai/ui/button" +import { TooltipKeybind } from "@opencode-ai/ui/tooltip" +import { useTheme } from "@opencode-ai/ui/theme" + +import { useLayout } from "@/context/layout" +import { usePlatform } from "@/context/platform" +import { useCommand } from "@/context/command" +import { useLanguage } from "@/context/language" + +export function Titlebar() { + const layout = useLayout() + const platform = usePlatform() + const command = useCommand() + const language = useLanguage() + const theme = useTheme() + + const mac = createMemo(() => platform.platform === "desktop" && platform.os === "macos") + const windows = createMemo(() => platform.platform === "desktop" && platform.os === "windows") + const reserve = createMemo( + () => platform.platform === "desktop" && (platform.os === "windows" || platform.os === "linux"), + ) + const web = createMemo(() => platform.platform === "web") + + const getWin = () => { + if (platform.platform !== "desktop") return + + const tauri = ( + window as unknown as { + __TAURI__?: { window?: { getCurrentWindow?: () => { startDragging?: () => Promise } } } + } + ).__TAURI__ + if (!tauri?.window?.getCurrentWindow) return + + return tauri.window.getCurrentWindow() + } + + createEffect(() => { + if (platform.platform !== "desktop") return + + const scheme = theme.colorScheme() + const value = scheme === "system" ? null : scheme + + const tauri = (window as unknown as { __TAURI__?: { webviewWindow?: { getCurrentWebviewWindow?: () => unknown } } }) + .__TAURI__ + const get = tauri?.webviewWindow?.getCurrentWebviewWindow + if (!get) return + + const win = get() as { setTheme?: (theme?: "light" | "dark" | null) => Promise } + if (!win.setTheme) return + + void win.setTheme(value).catch(() => undefined) + }) + + const interactive = (target: EventTarget | null) => { + if (!(target instanceof Element)) return false + + const selector = + "button, a, input, textarea, select, option, [role='button'], [role='menuitem'], [contenteditable='true'], [contenteditable='']" + + return !!target.closest(selector) + } + + const drag = (e: MouseEvent) => { + if (platform.platform !== "desktop") return + if (e.buttons !== 1) return + if (interactive(e.target)) return + + const win = getWin() + if (!win?.startDragging) return + + e.preventDefault() + void win.startDragging().catch(() => undefined) + } + + return ( +
+
+ +
+
+ +
+ + +
+ +
+
+ + + +
+
+
+ +
+ +
+
+
+
+
+ ) +} diff --git a/packages/app/src/context/command.tsx b/packages/app/src/context/command.tsx new file mode 100644 index 00000000000..39bd11a1bb0 --- /dev/null +++ b/packages/app/src/context/command.tsx @@ -0,0 +1,308 @@ +import { createEffect, createMemo, createSignal, onCleanup, onMount, type Accessor } from "solid-js" +import { createStore } from "solid-js/store" +import { createSimpleContext } from "@opencode-ai/ui/context" +import { useDialog } from "@opencode-ai/ui/context/dialog" +import { useLanguage } from "@/context/language" +import { useSettings } from "@/context/settings" +import { Persist, persisted } from "@/utils/persist" + +const IS_MAC = typeof navigator === "object" && /(Mac|iPod|iPhone|iPad)/.test(navigator.platform) + +const PALETTE_ID = "command.palette" +const DEFAULT_PALETTE_KEYBIND = "mod+shift+p" +const SUGGESTED_PREFIX = "suggested." + +function actionId(id: string) { + if (!id.startsWith(SUGGESTED_PREFIX)) return id + return id.slice(SUGGESTED_PREFIX.length) +} + +function normalizeKey(key: string) { + if (key === ",") return "comma" + if (key === "+") return "plus" + if (key === " ") return "space" + return key.toLowerCase() +} + +export type KeybindConfig = string + +export interface Keybind { + key: string + ctrl: boolean + meta: boolean + shift: boolean + alt: boolean +} + +export interface CommandOption { + id: string + title: string + description?: string + category?: string + keybind?: KeybindConfig + slash?: string + suggested?: boolean + disabled?: boolean + onSelect?: (source?: "palette" | "keybind" | "slash") => void + onHighlight?: () => (() => void) | void +} + +export type CommandCatalogItem = { + title: string + description?: string + category?: string + keybind?: KeybindConfig + slash?: string +} + +export function parseKeybind(config: string): Keybind[] { + if (!config || config === "none") return [] + + return config.split(",").map((combo) => { + const parts = combo.trim().toLowerCase().split("+") + const keybind: Keybind = { + key: "", + ctrl: false, + meta: false, + shift: false, + alt: false, + } + + for (const part of parts) { + switch (part) { + case "ctrl": + case "control": + keybind.ctrl = true + break + case "meta": + case "cmd": + case "command": + keybind.meta = true + break + case "mod": + if (IS_MAC) keybind.meta = true + else keybind.ctrl = true + break + case "alt": + case "option": + keybind.alt = true + break + case "shift": + keybind.shift = true + break + default: + keybind.key = part + break + } + } + + return keybind + }) +} + +export function matchKeybind(keybinds: Keybind[], event: KeyboardEvent): boolean { + const eventKey = normalizeKey(event.key) + + for (const kb of keybinds) { + const keyMatch = kb.key === eventKey + const ctrlMatch = kb.ctrl === (event.ctrlKey || false) + const metaMatch = kb.meta === (event.metaKey || false) + const shiftMatch = kb.shift === (event.shiftKey || false) + const altMatch = kb.alt === (event.altKey || false) + + if (keyMatch && ctrlMatch && metaMatch && shiftMatch && altMatch) { + return true + } + } + + return false +} + +export function formatKeybind(config: string): string { + if (!config || config === "none") return "" + + const keybinds = parseKeybind(config) + if (keybinds.length === 0) return "" + + const kb = keybinds[0] + const parts: string[] = [] + + if (kb.ctrl) parts.push(IS_MAC ? "⌃" : "Ctrl") + if (kb.alt) parts.push(IS_MAC ? "⌥" : "Alt") + if (kb.shift) parts.push(IS_MAC ? "⇧" : "Shift") + if (kb.meta) parts.push(IS_MAC ? "⌘" : "Meta") + + if (kb.key) { + const keys: Record = { + arrowup: "↑", + arrowdown: "↓", + arrowleft: "←", + arrowright: "→", + comma: ",", + plus: "+", + space: "Space", + } + const key = kb.key.toLowerCase() + const displayKey = keys[key] ?? (key.length === 1 ? key.toUpperCase() : key.charAt(0).toUpperCase() + key.slice(1)) + parts.push(displayKey) + } + + return IS_MAC ? parts.join("") : parts.join("+") +} + +export const { use: useCommand, provider: CommandProvider } = createSimpleContext({ + name: "Command", + init: () => { + const dialog = useDialog() + const settings = useSettings() + const language = useLanguage() + const [registrations, setRegistrations] = createSignal[]>([]) + const [suspendCount, setSuspendCount] = createSignal(0) + + const [catalog, setCatalog, _, catalogReady] = persisted( + Persist.global("command.catalog.v1"), + createStore>({}), + ) + + const bind = (id: string, def: KeybindConfig | undefined) => { + const custom = settings.keybinds.get(actionId(id)) + const config = custom ?? def + if (!config || config === "none") return + return config + } + + const registered = createMemo(() => { + const seen = new Set() + const all: CommandOption[] = [] + + for (const reg of registrations()) { + for (const opt of reg()) { + if (seen.has(opt.id)) continue + seen.add(opt.id) + all.push(opt) + } + } + + return all + }) + + createEffect(() => { + if (!catalogReady()) return + + for (const opt of registered()) { + const id = actionId(opt.id) + setCatalog(id, { + title: opt.title, + description: opt.description, + category: opt.category, + keybind: opt.keybind, + slash: opt.slash, + }) + } + }) + + const catalogOptions = createMemo(() => Object.entries(catalog).map(([id, meta]) => ({ id, ...meta }))) + + const options = createMemo(() => { + const resolved = registered().map((opt) => ({ + ...opt, + keybind: bind(opt.id, opt.keybind), + })) + + const suggested = resolved.filter((x) => x.suggested && !x.disabled) + + return [ + ...suggested.map((x) => ({ + ...x, + id: SUGGESTED_PREFIX + x.id, + category: language.t("command.category.suggested"), + })), + ...resolved, + ] + }) + + const suspended = () => suspendCount() > 0 + + const run = (id: string, source?: "palette" | "keybind" | "slash") => { + for (const option of options()) { + if (option.id === id || option.id === "suggested." + id) { + option.onSelect?.(source) + return + } + } + } + + const showPalette = () => { + run("file.open", "palette") + } + + const handleKeyDown = (event: KeyboardEvent) => { + if (suspended() || dialog.active) return + + const paletteKeybinds = parseKeybind(settings.keybinds.get(PALETTE_ID) ?? DEFAULT_PALETTE_KEYBIND) + if (matchKeybind(paletteKeybinds, event)) { + event.preventDefault() + showPalette() + return + } + + for (const option of options()) { + if (option.disabled) continue + if (!option.keybind) continue + + const keybinds = parseKeybind(option.keybind) + if (matchKeybind(keybinds, event)) { + event.preventDefault() + option.onSelect?.("keybind") + return + } + } + } + + onMount(() => { + document.addEventListener("keydown", handleKeyDown) + }) + + onCleanup(() => { + document.removeEventListener("keydown", handleKeyDown) + }) + + return { + register(cb: () => CommandOption[]) { + const results = createMemo(cb) + setRegistrations((arr) => [results, ...arr]) + onCleanup(() => { + setRegistrations((arr) => arr.filter((x) => x !== results)) + }) + }, + trigger(id: string, source?: "palette" | "keybind" | "slash") { + run(id, source) + }, + keybind(id: string) { + if (id === PALETTE_ID) { + return formatKeybind(settings.keybinds.get(PALETTE_ID) ?? DEFAULT_PALETTE_KEYBIND) + } + + const base = actionId(id) + const option = options().find((x) => actionId(x.id) === base) + if (option?.keybind) return formatKeybind(option.keybind) + + const meta = catalog[base] + const config = bind(base, meta?.keybind) + if (!config) return "" + return formatKeybind(config) + }, + show: showPalette, + keybinds(enabled: boolean) { + setSuspendCount((count) => count + (enabled ? -1 : 1)) + }, + suspended, + get catalog() { + return catalogOptions() + }, + get options() { + return options() + }, + } + }, +}) diff --git a/packages/app/src/context/file.tsx b/packages/app/src/context/file.tsx new file mode 100644 index 00000000000..5ea4993879c --- /dev/null +++ b/packages/app/src/context/file.tsx @@ -0,0 +1,395 @@ +import { createEffect, createMemo, createRoot, onCleanup } from "solid-js" +import { createStore, produce } from "solid-js/store" +import { createSimpleContext } from "@opencode-ai/ui/context" +import type { FileContent } from "@opencode-ai/sdk/v2" +import { showToast } from "@opencode-ai/ui/toast" +import { useParams } from "@solidjs/router" +import { getFilename } from "@opencode-ai/util/path" +import { useSDK } from "./sdk" +import { useSync } from "./sync" +import { useLanguage } from "@/context/language" +import { Persist, persisted } from "@/utils/persist" + +export type FileSelection = { + startLine: number + startChar: number + endLine: number + endChar: number +} + +export type SelectedLineRange = { + start: number + end: number + side?: "additions" | "deletions" + endSide?: "additions" | "deletions" +} + +export type FileViewState = { + scrollTop?: number + scrollLeft?: number + selectedLines?: SelectedLineRange | null +} + +export type FileState = { + path: string + name: string + loaded?: boolean + loading?: boolean + error?: string + content?: FileContent +} + +function stripFileProtocol(input: string) { + if (!input.startsWith("file://")) return input + return input.slice("file://".length) +} + +function stripQueryAndHash(input: string) { + const hashIndex = input.indexOf("#") + const queryIndex = input.indexOf("?") + + if (hashIndex !== -1 && queryIndex !== -1) { + return input.slice(0, Math.min(hashIndex, queryIndex)) + } + + if (hashIndex !== -1) return input.slice(0, hashIndex) + if (queryIndex !== -1) return input.slice(0, queryIndex) + return input +} + +export function selectionFromLines(range: SelectedLineRange): FileSelection { + const startLine = Math.min(range.start, range.end) + const endLine = Math.max(range.start, range.end) + return { + startLine, + endLine, + startChar: 0, + endChar: 0, + } +} + +function normalizeSelectedLines(range: SelectedLineRange): SelectedLineRange { + if (range.start <= range.end) return range + + const startSide = range.side + const endSide = range.endSide ?? startSide + + return { + ...range, + start: range.end, + end: range.start, + side: endSide, + endSide: startSide !== endSide ? startSide : undefined, + } +} + +const WORKSPACE_KEY = "__workspace__" +const MAX_FILE_VIEW_SESSIONS = 20 +const MAX_VIEW_FILES = 500 + +type ViewSession = ReturnType + +type ViewCacheEntry = { + value: ViewSession + dispose: VoidFunction +} + +function createViewSession(dir: string, id: string | undefined) { + const legacyViewKey = `${dir}/file${id ? "/" + id : ""}.v1` + + const [view, setView, _, ready] = persisted( + Persist.scoped(dir, id, "file-view", [legacyViewKey]), + createStore<{ + file: Record + }>({ + file: {}, + }), + ) + + const meta = { pruned: false } + + const pruneView = (keep?: string) => { + const keys = Object.keys(view.file) + if (keys.length <= MAX_VIEW_FILES) return + + const drop = keys.filter((key) => key !== keep).slice(0, keys.length - MAX_VIEW_FILES) + if (drop.length === 0) return + + setView( + produce((draft) => { + for (const key of drop) { + delete draft.file[key] + } + }), + ) + } + + createEffect(() => { + if (!ready()) return + if (meta.pruned) return + meta.pruned = true + pruneView() + }) + + const scrollTop = (path: string) => view.file[path]?.scrollTop + const scrollLeft = (path: string) => view.file[path]?.scrollLeft + const selectedLines = (path: string) => view.file[path]?.selectedLines + + const setScrollTop = (path: string, top: number) => { + setView("file", path, (current) => { + if (current?.scrollTop === top) return current + return { + ...(current ?? {}), + scrollTop: top, + } + }) + pruneView(path) + } + + const setScrollLeft = (path: string, left: number) => { + setView("file", path, (current) => { + if (current?.scrollLeft === left) return current + return { + ...(current ?? {}), + scrollLeft: left, + } + }) + pruneView(path) + } + + const setSelectedLines = (path: string, range: SelectedLineRange | null) => { + const next = range ? normalizeSelectedLines(range) : null + setView("file", path, (current) => { + if (current?.selectedLines === next) return current + return { + ...(current ?? {}), + selectedLines: next, + } + }) + pruneView(path) + } + + return { + ready, + scrollTop, + scrollLeft, + selectedLines, + setScrollTop, + setScrollLeft, + setSelectedLines, + } +} + +export const { use: useFile, provider: FileProvider } = createSimpleContext({ + name: "File", + gate: false, + init: () => { + const sdk = useSDK() + const sync = useSync() + const params = useParams() + const language = useLanguage() + + const directory = createMemo(() => sync.data.path.directory) + + function normalize(input: string) { + const root = directory() + const prefix = root.endsWith("/") ? root : root + "/" + + let path = stripQueryAndHash(stripFileProtocol(input)) + + if (path.startsWith(prefix)) { + path = path.slice(prefix.length) + } + + if (path.startsWith(root)) { + path = path.slice(root.length) + } + + if (path.startsWith("./")) { + path = path.slice(2) + } + + if (path.startsWith("/")) { + path = path.slice(1) + } + + return path + } + + function tab(input: string) { + const path = normalize(input) + return `file://${path}` + } + + function pathFromTab(tabValue: string) { + if (!tabValue.startsWith("file://")) return + return normalize(tabValue) + } + + const inflight = new Map>() + + const [store, setStore] = createStore<{ + file: Record + }>({ + file: {}, + }) + + const viewCache = new Map() + + const disposeViews = () => { + for (const entry of viewCache.values()) { + entry.dispose() + } + viewCache.clear() + } + + const pruneViews = () => { + while (viewCache.size > MAX_FILE_VIEW_SESSIONS) { + const first = viewCache.keys().next().value + if (!first) return + const entry = viewCache.get(first) + entry?.dispose() + viewCache.delete(first) + } + } + + const loadView = (dir: string, id: string | undefined) => { + const key = `${dir}:${id ?? WORKSPACE_KEY}` + const existing = viewCache.get(key) + if (existing) { + viewCache.delete(key) + viewCache.set(key, existing) + return existing.value + } + + const entry = createRoot((dispose) => ({ + value: createViewSession(dir, id), + dispose, + })) + + viewCache.set(key, entry) + pruneViews() + return entry.value + } + + const view = createMemo(() => loadView(params.dir!, params.id)) + + function ensure(path: string) { + if (!path) return + if (store.file[path]) return + setStore("file", path, { path, name: getFilename(path) }) + } + + function load(input: string, options?: { force?: boolean }) { + const path = normalize(input) + if (!path) return Promise.resolve() + + ensure(path) + + const current = store.file[path] + if (!options?.force && current?.loaded) return Promise.resolve() + + const pending = inflight.get(path) + if (pending) return pending + + setStore( + "file", + path, + produce((draft) => { + draft.loading = true + draft.error = undefined + }), + ) + + const promise = sdk.client.file + .read({ path }) + .then((x) => { + setStore( + "file", + path, + produce((draft) => { + draft.loaded = true + draft.loading = false + draft.content = x.data + }), + ) + }) + .catch((e) => { + setStore( + "file", + path, + produce((draft) => { + draft.loading = false + draft.error = e.message + }), + ) + showToast({ + variant: "error", + title: language.t("toast.file.loadFailed.title"), + description: e.message, + }) + }) + .finally(() => { + inflight.delete(path) + }) + + inflight.set(path, promise) + return promise + } + + const stop = sdk.event.listen((e) => { + const event = e.details + if (event.type !== "file.watcher.updated") return + const path = normalize(event.properties.file) + if (!path) return + if (path.startsWith(".git/")) return + if (!store.file[path]) return + load(path, { force: true }) + }) + + const get = (input: string) => store.file[normalize(input)] + + const scrollTop = (input: string) => view().scrollTop(normalize(input)) + const scrollLeft = (input: string) => view().scrollLeft(normalize(input)) + const selectedLines = (input: string) => view().selectedLines(normalize(input)) + + const setScrollTop = (input: string, top: number) => { + const path = normalize(input) + view().setScrollTop(path, top) + } + + const setScrollLeft = (input: string, left: number) => { + const path = normalize(input) + view().setScrollLeft(path, left) + } + + const setSelectedLines = (input: string, range: SelectedLineRange | null) => { + const path = normalize(input) + view().setSelectedLines(path, range) + } + + onCleanup(() => { + stop() + disposeViews() + }) + + return { + ready: () => view().ready(), + normalize, + tab, + pathFromTab, + get, + load, + scrollTop, + scrollLeft, + setScrollTop, + setScrollLeft, + selectedLines, + setSelectedLines, + searchFiles: (query: string) => + sdk.client.find.files({ query, dirs: "false" }).then((x) => (x.data ?? []).map(normalize)), + searchFilesAndDirectories: (query: string) => + sdk.client.find.files({ query, dirs: "true" }).then((x) => (x.data ?? []).map(normalize)), + } + }, +}) diff --git a/packages/app/src/context/global-sdk.tsx b/packages/app/src/context/global-sdk.tsx new file mode 100644 index 00000000000..7d93682bf35 --- /dev/null +++ b/packages/app/src/context/global-sdk.tsx @@ -0,0 +1,106 @@ +import { createOpencodeClient, type Event } from "@opencode-ai/sdk/v2/client" +import { createSimpleContext } from "@opencode-ai/ui/context" +import { createGlobalEmitter } from "@solid-primitives/event-bus" +import { batch, onCleanup } from "solid-js" +import { usePlatform } from "./platform" +import { useServer } from "./server" + +export const { use: useGlobalSDK, provider: GlobalSDKProvider } = createSimpleContext({ + name: "GlobalSDK", + init: () => { + const server = useServer() + const platform = usePlatform() + const abort = new AbortController() + + const eventSdk = createOpencodeClient({ + baseUrl: server.url, + signal: abort.signal, + fetch: platform.fetch, + }) + const emitter = createGlobalEmitter<{ + [key: string]: Event + }>() + + type Queued = { directory: string; payload: Event } + + let queue: Array = [] + const coalesced = new Map() + let timer: ReturnType | undefined + let last = 0 + + const key = (directory: string, payload: Event) => { + if (payload.type === "session.status") return `session.status:${directory}:${payload.properties.sessionID}` + if (payload.type === "lsp.updated") return `lsp.updated:${directory}` + if (payload.type === "message.part.updated") { + const part = payload.properties.part + return `message.part.updated:${directory}:${part.messageID}:${part.id}` + } + } + + const flush = () => { + if (timer) clearTimeout(timer) + timer = undefined + + const events = queue + queue = [] + coalesced.clear() + if (events.length === 0) return + + last = Date.now() + batch(() => { + for (const event of events) { + if (!event) continue + emitter.emit(event.directory, event.payload) + } + }) + } + + const schedule = () => { + if (timer) return + const elapsed = Date.now() - last + timer = setTimeout(flush, Math.max(0, 16 - elapsed)) + } + + const stop = () => { + flush() + } + + void (async () => { + const events = await eventSdk.global.event() + let yielded = Date.now() + for await (const event of events.stream) { + const directory = event.directory ?? "global" + const payload = event.payload + const k = key(directory, payload) + if (k) { + const i = coalesced.get(k) + if (i !== undefined) { + queue[i] = undefined + } + coalesced.set(k, queue.length) + } + queue.push({ directory, payload }) + schedule() + + if (Date.now() - yielded < 8) continue + yielded = Date.now() + await new Promise((resolve) => setTimeout(resolve, 0)) + } + })() + .finally(stop) + .catch(() => undefined) + + onCleanup(() => { + abort.abort() + stop() + }) + + const sdk = createOpencodeClient({ + baseUrl: server.url, + fetch: platform.fetch, + throwOnError: true, + }) + + return { url: server.url, client: sdk, event: emitter } + }, +}) diff --git a/packages/app/src/context/global-sync.tsx b/packages/app/src/context/global-sync.tsx new file mode 100644 index 00000000000..5f0f3d76fdb --- /dev/null +++ b/packages/app/src/context/global-sync.tsx @@ -0,0 +1,893 @@ +import { + type Message, + type Agent, + type Session, + type Part, + type Config, + type Path, + type Project, + type FileDiff, + type Todo, + type SessionStatus, + type ProviderListResponse, + type ProviderAuthResponse, + type Command, + type McpStatus, + type LspStatus, + type VcsInfo, + type PermissionRequest, + type QuestionRequest, + createOpencodeClient, +} from "@opencode-ai/sdk/v2/client" +import { createStore, produce, reconcile, type SetStoreFunction, type Store } from "solid-js/store" +import { Binary } from "@opencode-ai/util/binary" +import { retry } from "@opencode-ai/util/retry" +import { useGlobalSDK } from "./global-sdk" +import { ErrorPage, type InitError } from "../pages/error" +import { + batch, + createContext, + createEffect, + getOwner, + runWithOwner, + useContext, + onCleanup, + onMount, + type Accessor, + type ParentProps, + Switch, + Match, +} from "solid-js" +import { showToast } from "@opencode-ai/ui/toast" +import { getFilename } from "@opencode-ai/util/path" +import { usePlatform } from "./platform" +import { useLanguage } from "@/context/language" +import { Persist, persisted } from "@/utils/persist" + +type ProjectMeta = { + name?: string + icon?: { + override?: string + color?: string + } + commands?: { + start?: string + } +} + +type State = { + status: "loading" | "partial" | "complete" + agent: Agent[] + command: Command[] + project: string + projectMeta: ProjectMeta | undefined + icon: string | undefined + provider: ProviderListResponse + config: Config + path: Path + session: Session[] + sessionTotal: number + session_status: { + [sessionID: string]: SessionStatus + } + session_diff: { + [sessionID: string]: FileDiff[] + } + todo: { + [sessionID: string]: Todo[] + } + permission: { + [sessionID: string]: PermissionRequest[] + } + question: { + [sessionID: string]: QuestionRequest[] + } + mcp: { + [name: string]: McpStatus + } + lsp: LspStatus[] + vcs: VcsInfo | undefined + limit: number + message: { + [sessionID: string]: Message[] + } + part: { + [messageID: string]: Part[] + } +} + +type VcsCache = { + store: Store<{ value: VcsInfo | undefined }> + setStore: SetStoreFunction<{ value: VcsInfo | undefined }> + ready: Accessor +} + +type MetaCache = { + store: Store<{ value: ProjectMeta | undefined }> + setStore: SetStoreFunction<{ value: ProjectMeta | undefined }> + ready: Accessor +} + +type IconCache = { + store: Store<{ value: string | undefined }> + setStore: SetStoreFunction<{ value: string | undefined }> + ready: Accessor +} + +type ChildOptions = { + bootstrap?: boolean +} + +function createGlobalSync() { + const globalSDK = useGlobalSDK() + const platform = usePlatform() + const language = useLanguage() + const owner = getOwner() + if (!owner) throw new Error("GlobalSync must be created within owner") + const vcsCache = new Map() + const metaCache = new Map() + const iconCache = new Map() + + const [projectCache, setProjectCache, , projectCacheReady] = persisted( + Persist.global("globalSync.project", ["globalSync.project.v1"]), + createStore({ value: [] as Project[] }), + ) + + const sanitizeProject = (project: Project) => { + if (!project.icon?.url && !project.icon?.override) return project + return { + ...project, + icon: { + ...project.icon, + url: undefined, + override: undefined, + }, + } + } + const [globalStore, setGlobalStore] = createStore<{ + ready: boolean + error?: InitError + path: Path + project: Project[] + provider: ProviderListResponse + provider_auth: ProviderAuthResponse + config: Config + reload: undefined | "pending" | "complete" + }>({ + ready: false, + path: { state: "", config: "", worktree: "", directory: "", home: "" }, + project: projectCache.value, + provider: { all: [], connected: [], default: {} }, + provider_auth: {}, + config: {}, + reload: undefined, + }) + let bootstrapQueue: string[] = [] + + createEffect(() => { + if (!projectCacheReady()) return + if (globalStore.project.length !== 0) return + const cached = projectCache.value + if (cached.length === 0) return + setGlobalStore("project", cached) + }) + + createEffect(() => { + if (!projectCacheReady()) return + if (globalStore.project.length === 0 && projectCache.value.length !== 0) return + setProjectCache("value", globalStore.project.map(sanitizeProject)) + }) + + createEffect(async () => { + if (globalStore.reload !== "complete") return + if (bootstrapQueue.length) { + for (const directory of bootstrapQueue) { + bootstrapInstance(directory) + } + bootstrap() + } + bootstrapQueue = [] + setGlobalStore("reload", undefined) + }) + + const children: Record, SetStoreFunction]> = {} + const booting = new Map>() + const sessionLoads = new Map>() + const sessionMeta = new Map() + + function ensureChild(directory: string) { + if (!directory) console.error("No directory provided") + if (!children[directory]) { + const cache = runWithOwner(owner, () => + persisted( + Persist.workspace(directory, "vcs", ["vcs.v1"]), + createStore({ value: undefined as VcsInfo | undefined }), + ), + ) + if (!cache) throw new Error("Failed to create persisted cache") + vcsCache.set(directory, { store: cache[0], setStore: cache[1], ready: cache[3] }) + + const meta = runWithOwner(owner, () => + persisted( + Persist.workspace(directory, "project", ["project.v1"]), + createStore({ value: undefined as ProjectMeta | undefined }), + ), + ) + if (!meta) throw new Error("Failed to create persisted project metadata") + metaCache.set(directory, { store: meta[0], setStore: meta[1], ready: meta[3] }) + + const icon = runWithOwner(owner, () => + persisted( + Persist.workspace(directory, "icon", ["icon.v1"]), + createStore({ value: undefined as string | undefined }), + ), + ) + if (!icon) throw new Error("Failed to create persisted project icon") + iconCache.set(directory, { store: icon[0], setStore: icon[1], ready: icon[3] }) + + const init = () => { + const child = createStore({ + project: "", + projectMeta: meta[0].value, + icon: icon[0].value, + provider: { all: [], connected: [], default: {} }, + config: {}, + path: { state: "", config: "", worktree: "", directory: "", home: "" }, + status: "loading" as const, + agent: [], + command: [], + session: [], + sessionTotal: 0, + session_status: {}, + session_diff: {}, + todo: {}, + permission: {}, + question: {}, + mcp: {}, + lsp: [], + vcs: cache[0].value, + limit: 5, + message: {}, + part: {}, + }) + + children[directory] = child + + createEffect(() => { + child[1]("projectMeta", meta[0].value) + }) + + createEffect(() => { + child[1]("icon", icon[0].value) + }) + } + + runWithOwner(owner, init) + } + const childStore = children[directory] + if (!childStore) throw new Error("Failed to create store") + return childStore + } + + function child(directory: string, options: ChildOptions = {}) { + const childStore = ensureChild(directory) + const shouldBootstrap = options.bootstrap ?? true + if (shouldBootstrap && childStore[0].status === "loading") { + void bootstrapInstance(directory) + } + return childStore + } + + async function loadSessions(directory: string) { + const pending = sessionLoads.get(directory) + if (pending) return pending + + const [store, setStore] = child(directory, { bootstrap: false }) + const meta = sessionMeta.get(directory) + if (meta && meta.limit >= store.limit) return + + const promise = globalSDK.client.session + .list({ directory, roots: true }) + .then((x) => { + const nonArchived = (x.data ?? []) + .filter((s) => !!s?.id) + .filter((s) => !s.time?.archived) + .slice() + .sort((a, b) => a.id.localeCompare(b.id)) + + // Read the current limit at resolve-time so callers that bump the limit while + // a request is in-flight still get the expanded result. + const limit = store.limit + + const sandboxWorkspace = globalStore.project.some((p) => (p.sandboxes ?? []).includes(directory)) + if (sandboxWorkspace) { + setStore("sessionTotal", nonArchived.length) + setStore("session", reconcile(nonArchived, { key: "id" })) + sessionMeta.set(directory, { limit }) + return + } + + const fourHoursAgo = Date.now() - 4 * 60 * 60 * 1000 + // Include up to the limit, plus any updated in the last 4 hours + const sessions = nonArchived.filter((s, i) => { + if (i < limit) return true + const updated = new Date(s.time?.updated ?? s.time?.created).getTime() + return updated > fourHoursAgo + }) + // Store total session count (used for "load more" pagination) + setStore("sessionTotal", nonArchived.length) + setStore("session", reconcile(sessions, { key: "id" })) + sessionMeta.set(directory, { limit }) + }) + .catch((err) => { + console.error("Failed to load sessions", err) + const project = getFilename(directory) + showToast({ title: language.t("toast.session.listFailed.title", { project }), description: err.message }) + }) + + sessionLoads.set(directory, promise) + promise.finally(() => { + sessionLoads.delete(directory) + }) + return promise + } + + async function bootstrapInstance(directory: string) { + if (!directory) return + const pending = booting.get(directory) + if (pending) return pending + + const promise = (async () => { + const [store, setStore] = ensureChild(directory) + const cache = vcsCache.get(directory) + if (!cache) return + const meta = metaCache.get(directory) + if (!meta) return + const sdk = createOpencodeClient({ + baseUrl: globalSDK.url, + fetch: platform.fetch, + directory, + throwOnError: true, + }) + + setStore("status", "loading") + + createEffect(() => { + if (!cache.ready()) return + const cached = cache.store.value + if (!cached?.branch) return + setStore("vcs", (value) => value ?? cached) + }) + + // projectMeta is synced from persisted storage in ensureChild. + + const blockingRequests = { + project: () => sdk.project.current().then((x) => setStore("project", x.data!.id)), + provider: () => + sdk.provider.list().then((x) => { + const data = x.data! + setStore("provider", { + ...data, + all: data.all.map((provider) => ({ + ...provider, + models: Object.fromEntries( + Object.entries(provider.models).filter(([, info]) => info.status !== "deprecated"), + ), + })), + }) + }), + agent: () => sdk.app.agents().then((x) => setStore("agent", x.data ?? [])), + config: () => sdk.config.get().then((x) => setStore("config", x.data!)), + } + + try { + await Promise.all(Object.values(blockingRequests).map((p) => retry(p))) + } catch (err) { + console.error("Failed to bootstrap instance", err) + const project = getFilename(directory) + const message = err instanceof Error ? err.message : String(err) + showToast({ title: `Failed to reload ${project}`, description: message }) + setStore("status", "partial") + return + } + + if (store.status !== "complete") setStore("status", "partial") + + Promise.all([ + sdk.path.get().then((x) => setStore("path", x.data!)), + sdk.command.list().then((x) => setStore("command", x.data ?? [])), + sdk.session.status().then((x) => setStore("session_status", x.data!)), + loadSessions(directory), + sdk.mcp.status().then((x) => setStore("mcp", x.data!)), + sdk.lsp.status().then((x) => setStore("lsp", x.data!)), + sdk.vcs.get().then((x) => { + const next = x.data ?? store.vcs + setStore("vcs", next) + if (next?.branch) cache.setStore("value", next) + }), + sdk.permission.list().then((x) => { + const grouped: Record = {} + for (const perm of x.data ?? []) { + if (!perm?.id || !perm.sessionID) continue + const existing = grouped[perm.sessionID] + if (existing) { + existing.push(perm) + continue + } + grouped[perm.sessionID] = [perm] + } + + batch(() => { + for (const sessionID of Object.keys(store.permission)) { + if (grouped[sessionID]) continue + setStore("permission", sessionID, []) + } + for (const [sessionID, permissions] of Object.entries(grouped)) { + setStore( + "permission", + sessionID, + reconcile( + permissions + .filter((p) => !!p?.id) + .slice() + .sort((a, b) => a.id.localeCompare(b.id)), + { key: "id" }, + ), + ) + } + }) + }), + sdk.question.list().then((x) => { + const grouped: Record = {} + for (const question of x.data ?? []) { + if (!question?.id || !question.sessionID) continue + const existing = grouped[question.sessionID] + if (existing) { + existing.push(question) + continue + } + grouped[question.sessionID] = [question] + } + + batch(() => { + for (const sessionID of Object.keys(store.question)) { + if (grouped[sessionID]) continue + setStore("question", sessionID, []) + } + for (const [sessionID, questions] of Object.entries(grouped)) { + setStore( + "question", + sessionID, + reconcile( + questions + .filter((q) => !!q?.id) + .slice() + .sort((a, b) => a.id.localeCompare(b.id)), + { key: "id" }, + ), + ) + } + }) + }), + ]).then(() => { + setStore("status", "complete") + }) + })() + + booting.set(directory, promise) + promise.finally(() => { + booting.delete(directory) + }) + return promise + } + + const unsub = globalSDK.event.listen((e) => { + const directory = e.name + const event = e.details + + if (directory === "global") { + switch (event?.type) { + case "global.disposed": { + if (globalStore.reload) return + bootstrap() + break + } + case "project.updated": { + const result = Binary.search(globalStore.project, event.properties.id, (s) => s.id) + if (result.found) { + setGlobalStore("project", result.index, reconcile(event.properties)) + return + } + setGlobalStore( + "project", + produce((draft) => { + draft.splice(result.index, 0, event.properties) + }), + ) + break + } + } + return + } + + const existing = children[directory] + if (!existing) return + + const [store, setStore] = existing + switch (event.type) { + case "server.instance.disposed": { + if (globalStore.reload) { + bootstrapQueue.push(directory) + return + } + bootstrapInstance(directory) + break + } + case "session.created": { + const result = Binary.search(store.session, event.properties.info.id, (s) => s.id) + if (result.found) { + setStore("session", result.index, reconcile(event.properties.info)) + break + } + setStore( + "session", + produce((draft) => { + draft.splice(result.index, 0, event.properties.info) + }), + ) + if (!event.properties.info.parentID) { + setStore("sessionTotal", store.sessionTotal + 1) + } + break + } + case "session.updated": { + const result = Binary.search(store.session, event.properties.info.id, (s) => s.id) + if (event.properties.info.time.archived) { + if (result.found) { + setStore( + "session", + produce((draft) => { + draft.splice(result.index, 1) + }), + ) + } + if (event.properties.info.parentID) break + setStore("sessionTotal", (value) => Math.max(0, value - 1)) + break + } + if (result.found) { + setStore("session", result.index, reconcile(event.properties.info)) + break + } + setStore( + "session", + produce((draft) => { + draft.splice(result.index, 0, event.properties.info) + }), + ) + break + } + case "session.deleted": { + const result = Binary.search(store.session, event.properties.info.id, (s) => s.id) + if (result.found) { + setStore( + "session", + produce((draft) => { + draft.splice(result.index, 1) + }), + ) + } + if (event.properties.info.parentID) break + setStore("sessionTotal", (value) => Math.max(0, value - 1)) + break + } + case "session.diff": + setStore("session_diff", event.properties.sessionID, reconcile(event.properties.diff, { key: "file" })) + break + case "todo.updated": + setStore("todo", event.properties.sessionID, reconcile(event.properties.todos, { key: "id" })) + break + case "session.status": { + setStore("session_status", event.properties.sessionID, reconcile(event.properties.status)) + break + } + case "message.updated": { + const messages = store.message[event.properties.info.sessionID] + if (!messages) { + setStore("message", event.properties.info.sessionID, [event.properties.info]) + break + } + const result = Binary.search(messages, event.properties.info.id, (m) => m.id) + if (result.found) { + setStore("message", event.properties.info.sessionID, result.index, reconcile(event.properties.info)) + break + } + setStore( + "message", + event.properties.info.sessionID, + produce((draft) => { + draft.splice(result.index, 0, event.properties.info) + }), + ) + break + } + case "message.removed": { + const messages = store.message[event.properties.sessionID] + if (!messages) break + const result = Binary.search(messages, event.properties.messageID, (m) => m.id) + if (result.found) { + setStore( + "message", + event.properties.sessionID, + produce((draft) => { + draft.splice(result.index, 1) + }), + ) + } + break + } + case "message.part.updated": { + const part = event.properties.part + const parts = store.part[part.messageID] + if (!parts) { + setStore("part", part.messageID, [part]) + break + } + const result = Binary.search(parts, part.id, (p) => p.id) + if (result.found) { + setStore("part", part.messageID, result.index, reconcile(part)) + break + } + setStore( + "part", + part.messageID, + produce((draft) => { + draft.splice(result.index, 0, part) + }), + ) + break + } + case "message.part.removed": { + const parts = store.part[event.properties.messageID] + if (!parts) break + const result = Binary.search(parts, event.properties.partID, (p) => p.id) + if (result.found) { + setStore( + "part", + event.properties.messageID, + produce((draft) => { + draft.splice(result.index, 1) + }), + ) + } + break + } + case "vcs.branch.updated": { + const next = { branch: event.properties.branch } + setStore("vcs", next) + const cache = vcsCache.get(directory) + if (cache) cache.setStore("value", next) + break + } + case "permission.asked": { + const sessionID = event.properties.sessionID + const permissions = store.permission[sessionID] + if (!permissions) { + setStore("permission", sessionID, [event.properties]) + break + } + + const result = Binary.search(permissions, event.properties.id, (p) => p.id) + if (result.found) { + setStore("permission", sessionID, result.index, reconcile(event.properties)) + break + } + + setStore( + "permission", + sessionID, + produce((draft) => { + draft.splice(result.index, 0, event.properties) + }), + ) + break + } + case "permission.replied": { + const permissions = store.permission[event.properties.sessionID] + if (!permissions) break + const result = Binary.search(permissions, event.properties.requestID, (p) => p.id) + if (!result.found) break + setStore( + "permission", + event.properties.sessionID, + produce((draft) => { + draft.splice(result.index, 1) + }), + ) + break + } + case "question.asked": { + const sessionID = event.properties.sessionID + const questions = store.question[sessionID] + if (!questions) { + setStore("question", sessionID, [event.properties]) + break + } + + const result = Binary.search(questions, event.properties.id, (q) => q.id) + if (result.found) { + setStore("question", sessionID, result.index, reconcile(event.properties)) + break + } + + setStore( + "question", + sessionID, + produce((draft) => { + draft.splice(result.index, 0, event.properties) + }), + ) + break + } + case "question.replied": + case "question.rejected": { + const questions = store.question[event.properties.sessionID] + if (!questions) break + const result = Binary.search(questions, event.properties.requestID, (q) => q.id) + if (!result.found) break + setStore( + "question", + event.properties.sessionID, + produce((draft) => { + draft.splice(result.index, 1) + }), + ) + break + } + case "lsp.updated": { + const sdk = createOpencodeClient({ + baseUrl: globalSDK.url, + fetch: platform.fetch, + directory, + throwOnError: true, + }) + sdk.lsp.status().then((x) => setStore("lsp", x.data ?? [])) + break + } + } + }) + onCleanup(unsub) + + async function bootstrap() { + const health = await globalSDK.client.global + .health() + .then((x) => x.data) + .catch(() => undefined) + if (!health?.healthy) { + setGlobalStore("error", new Error(language.t("error.globalSync.connectFailed", { url: globalSDK.url }))) + return + } + + return Promise.all([ + retry(() => + globalSDK.client.path.get().then((x) => { + setGlobalStore("path", x.data!) + }), + ), + retry(() => + globalSDK.client.config.get().then((x) => { + setGlobalStore("config", x.data!) + }), + ), + retry(() => + globalSDK.client.project.list().then(async (x) => { + const projects = (x.data ?? []) + .filter((p) => !!p?.id) + .filter((p) => !!p.worktree && !p.worktree.includes("opencode-test")) + .slice() + .sort((a, b) => a.id.localeCompare(b.id)) + setGlobalStore("project", projects) + }), + ), + retry(() => + globalSDK.client.provider.list().then((x) => { + const data = x.data! + setGlobalStore("provider", { + ...data, + all: data.all.map((provider) => ({ + ...provider, + models: Object.fromEntries( + Object.entries(provider.models).filter(([, info]) => info.status !== "deprecated"), + ), + })), + }) + }), + ), + retry(() => + globalSDK.client.provider.auth().then((x) => { + setGlobalStore("provider_auth", x.data ?? {}) + }), + ), + ]) + .then(() => setGlobalStore("ready", true)) + .catch((e) => setGlobalStore("error", e)) + } + + onMount(() => { + bootstrap() + }) + + function projectMeta(directory: string, patch: ProjectMeta) { + const [store, setStore] = ensureChild(directory) + const cached = metaCache.get(directory) + if (!cached) return + const previous = store.projectMeta ?? {} + const icon = patch.icon ? { ...(previous.icon ?? {}), ...patch.icon } : previous.icon + const commands = patch.commands ? { ...(previous.commands ?? {}), ...patch.commands } : previous.commands + const next = { + ...previous, + ...patch, + icon, + commands, + } + cached.setStore("value", next) + setStore("projectMeta", next) + } + + function projectIcon(directory: string, value: string | undefined) { + const [store, setStore] = ensureChild(directory) + const cached = iconCache.get(directory) + if (!cached) return + if (store.icon === value) return + cached.setStore("value", value) + setStore("icon", value) + } + + return { + data: globalStore, + set: setGlobalStore, + get ready() { + return globalStore.ready + }, + get error() { + return globalStore.error + }, + child, + bootstrap, + updateConfig: async (config: Config) => { + setGlobalStore("reload", "pending") + const response = await globalSDK.client.config.update({ config }) + setTimeout(() => { + setGlobalStore("reload", "complete") + }, 1000) + return response + }, + project: { + loadSessions, + meta: projectMeta, + icon: projectIcon, + }, + } +} + +const GlobalSyncContext = createContext>() + +export function GlobalSyncProvider(props: ParentProps) { + const value = createGlobalSync() + return ( + + + + + + {props.children} + + + ) +} + +export function useGlobalSync() { + const context = useContext(GlobalSyncContext) + if (!context) throw new Error("useGlobalSync must be used within GlobalSyncProvider") + return context +} diff --git a/packages/app/src/context/language.tsx b/packages/app/src/context/language.tsx new file mode 100644 index 00000000000..da10e4773ae --- /dev/null +++ b/packages/app/src/context/language.tsx @@ -0,0 +1,161 @@ +import * as i18n from "@solid-primitives/i18n" +import { createEffect, createMemo } from "solid-js" +import { createStore } from "solid-js/store" +import { createSimpleContext } from "@opencode-ai/ui/context" +import { Persist, persisted } from "@/utils/persist" +import { dict as en } from "@/i18n/en" +import { dict as zh } from "@/i18n/zh" +import { dict as zht } from "@/i18n/zht" +import { dict as ko } from "@/i18n/ko" +import { dict as de } from "@/i18n/de" +import { dict as es } from "@/i18n/es" +import { dict as fr } from "@/i18n/fr" +import { dict as da } from "@/i18n/da" +import { dict as ja } from "@/i18n/ja" +import { dict as pl } from "@/i18n/pl" +import { dict as ru } from "@/i18n/ru" +import { dict as ar } from "@/i18n/ar" +import { dict as no } from "@/i18n/no" +import { dict as br } from "@/i18n/br" +import { dict as uiEn } from "@opencode-ai/ui/i18n/en" +import { dict as uiZh } from "@opencode-ai/ui/i18n/zh" +import { dict as uiZht } from "@opencode-ai/ui/i18n/zht" +import { dict as uiKo } from "@opencode-ai/ui/i18n/ko" +import { dict as uiDe } from "@opencode-ai/ui/i18n/de" +import { dict as uiEs } from "@opencode-ai/ui/i18n/es" +import { dict as uiFr } from "@opencode-ai/ui/i18n/fr" +import { dict as uiDa } from "@opencode-ai/ui/i18n/da" +import { dict as uiJa } from "@opencode-ai/ui/i18n/ja" +import { dict as uiPl } from "@opencode-ai/ui/i18n/pl" +import { dict as uiRu } from "@opencode-ai/ui/i18n/ru" +import { dict as uiAr } from "@opencode-ai/ui/i18n/ar" +import { dict as uiNo } from "@opencode-ai/ui/i18n/no" +import { dict as uiBr } from "@opencode-ai/ui/i18n/br" + +export type Locale = "en" | "zh" | "zht" | "ko" | "de" | "es" | "fr" | "da" | "ja" | "pl" | "ru" | "ar" | "no" | "br" + +type RawDictionary = typeof en & typeof uiEn +type Dictionary = i18n.Flatten + +const LOCALES: readonly Locale[] = ["en", "zh", "zht", "ko", "de", "es", "fr", "da", "ja", "pl", "ru", "ar", "no", "br"] + +function detectLocale(): Locale { + if (typeof navigator !== "object") return "en" + + const languages = navigator.languages?.length ? navigator.languages : [navigator.language] + for (const language of languages) { + if (!language) continue + if (language.toLowerCase().startsWith("zh")) { + if (language.toLowerCase().includes("hant")) return "zht" + return "zh" + } + if (language.toLowerCase().startsWith("ko")) return "ko" + if (language.toLowerCase().startsWith("de")) return "de" + if (language.toLowerCase().startsWith("es")) return "es" + if (language.toLowerCase().startsWith("fr")) return "fr" + if (language.toLowerCase().startsWith("da")) return "da" + if (language.toLowerCase().startsWith("ja")) return "ja" + if (language.toLowerCase().startsWith("pl")) return "pl" + if (language.toLowerCase().startsWith("ru")) return "ru" + if (language.toLowerCase().startsWith("ar")) return "ar" + if ( + language.toLowerCase().startsWith("no") || + language.toLowerCase().startsWith("nb") || + language.toLowerCase().startsWith("nn") + ) + return "no" + if (language.toLowerCase().startsWith("pt")) return "br" + } + + return "en" +} + +export const { use: useLanguage, provider: LanguageProvider } = createSimpleContext({ + name: "Language", + init: () => { + const [store, setStore, _, ready] = persisted( + Persist.global("language", ["language.v1"]), + createStore({ + locale: detectLocale() as Locale, + }), + ) + + const locale = createMemo(() => { + if (store.locale === "zh") return "zh" + if (store.locale === "zht") return "zht" + if (store.locale === "ko") return "ko" + if (store.locale === "de") return "de" + if (store.locale === "es") return "es" + if (store.locale === "fr") return "fr" + if (store.locale === "da") return "da" + if (store.locale === "ja") return "ja" + if (store.locale === "pl") return "pl" + if (store.locale === "ru") return "ru" + if (store.locale === "ar") return "ar" + if (store.locale === "no") return "no" + if (store.locale === "br") return "br" + return "en" + }) + + createEffect(() => { + const current = locale() + if (store.locale === current) return + setStore("locale", current) + }) + + const base = i18n.flatten({ ...en, ...uiEn }) + const dict = createMemo(() => { + if (locale() === "en") return base + if (locale() === "zh") return { ...base, ...i18n.flatten({ ...zh, ...uiZh }) } + if (locale() === "zht") return { ...base, ...i18n.flatten({ ...zht, ...uiZht }) } + if (locale() === "de") return { ...base, ...i18n.flatten({ ...de, ...uiDe }) } + if (locale() === "es") return { ...base, ...i18n.flatten({ ...es, ...uiEs }) } + if (locale() === "fr") return { ...base, ...i18n.flatten({ ...fr, ...uiFr }) } + if (locale() === "da") return { ...base, ...i18n.flatten({ ...da, ...uiDa }) } + if (locale() === "ja") return { ...base, ...i18n.flatten({ ...ja, ...uiJa }) } + if (locale() === "pl") return { ...base, ...i18n.flatten({ ...pl, ...uiPl }) } + if (locale() === "ru") return { ...base, ...i18n.flatten({ ...ru, ...uiRu }) } + if (locale() === "ar") return { ...base, ...i18n.flatten({ ...ar, ...uiAr }) } + if (locale() === "no") return { ...base, ...i18n.flatten({ ...no, ...uiNo }) } + if (locale() === "br") return { ...base, ...i18n.flatten({ ...br, ...uiBr }) } + return { ...base, ...i18n.flatten({ ...ko, ...uiKo }) } + }) + + const t = i18n.translator(dict, i18n.resolveTemplate) + + const labelKey: Record = { + en: "language.en", + zh: "language.zh", + zht: "language.zht", + ko: "language.ko", + de: "language.de", + es: "language.es", + fr: "language.fr", + da: "language.da", + ja: "language.ja", + pl: "language.pl", + ru: "language.ru", + ar: "language.ar", + no: "language.no", + br: "language.br", + } + + const label = (value: Locale) => t(labelKey[value]) + + createEffect(() => { + if (typeof document !== "object") return + document.documentElement.lang = locale() + }) + + return { + ready, + locale, + locales: LOCALES, + label, + t, + setLocale(next: Locale) { + setStore("locale", next) + }, + } + }, +}) diff --git a/packages/app/src/context/layout-scroll.test.ts b/packages/app/src/context/layout-scroll.test.ts new file mode 100644 index 00000000000..b7962c411cd --- /dev/null +++ b/packages/app/src/context/layout-scroll.test.ts @@ -0,0 +1,73 @@ +import { describe, expect, test } from "bun:test" +import { createRoot } from "solid-js" +import { createStore } from "solid-js/store" +import { makePersisted, type SyncStorage } from "@solid-primitives/storage" +import { createScrollPersistence } from "./layout-scroll" + +describe("createScrollPersistence", () => { + test("debounces persisted scroll writes", async () => { + const key = "layout-scroll.test" + const data = new Map() + const writes: string[] = [] + const stats = { flushes: 0 } + + const storage = { + getItem: (k: string) => data.get(k) ?? null, + setItem: (k: string, v: string) => { + data.set(k, v) + if (k === key) writes.push(v) + }, + removeItem: (k: string) => { + data.delete(k) + }, + } as SyncStorage + + await new Promise((resolve, reject) => { + createRoot((dispose) => { + const [raw, setRaw] = createStore({ + sessionView: {} as Record }>, + }) + + const [store, setStore] = makePersisted([raw, setRaw], { name: key, storage }) + + const scroll = createScrollPersistence({ + debounceMs: 30, + getSnapshot: (sessionKey) => store.sessionView[sessionKey]?.scroll, + onFlush: (sessionKey, next) => { + stats.flushes += 1 + + const current = store.sessionView[sessionKey] + if (!current) { + setStore("sessionView", sessionKey, { scroll: next }) + return + } + setStore("sessionView", sessionKey, "scroll", (prev) => ({ ...(prev ?? {}), ...next })) + }, + }) + + const run = async () => { + await new Promise((r) => setTimeout(r, 0)) + writes.length = 0 + + for (const i of Array.from({ length: 100 }, (_, n) => n)) { + scroll.setScroll("session", "review", { x: 0, y: i }) + } + + await new Promise((r) => setTimeout(r, 120)) + + expect(stats.flushes).toBeGreaterThanOrEqual(1) + expect(writes.length).toBeGreaterThanOrEqual(1) + expect(writes.length).toBeLessThanOrEqual(2) + } + + void run() + .then(resolve) + .catch(reject) + .finally(() => { + scroll.dispose() + dispose() + }) + }) + }) + }) +}) diff --git a/packages/app/src/context/layout-scroll.ts b/packages/app/src/context/layout-scroll.ts new file mode 100644 index 00000000000..30b0f69044a --- /dev/null +++ b/packages/app/src/context/layout-scroll.ts @@ -0,0 +1,118 @@ +import { createStore, produce } from "solid-js/store" + +export type SessionScroll = { + x: number + y: number +} + +type ScrollMap = Record + +type Options = { + debounceMs?: number + getSnapshot: (sessionKey: string) => ScrollMap | undefined + onFlush: (sessionKey: string, scroll: ScrollMap) => void +} + +export function createScrollPersistence(opts: Options) { + const wait = opts.debounceMs ?? 200 + const [cache, setCache] = createStore>({}) + const dirty = new Set() + const timers = new Map>() + + function clone(input?: ScrollMap) { + const out: ScrollMap = {} + if (!input) return out + + for (const key of Object.keys(input)) { + const pos = input[key] + if (!pos) continue + out[key] = { x: pos.x, y: pos.y } + } + + return out + } + + function seed(sessionKey: string) { + if (cache[sessionKey]) return + setCache(sessionKey, clone(opts.getSnapshot(sessionKey))) + } + + function scroll(sessionKey: string, tab: string) { + seed(sessionKey) + return cache[sessionKey]?.[tab] ?? opts.getSnapshot(sessionKey)?.[tab] + } + + function schedule(sessionKey: string) { + const prev = timers.get(sessionKey) + if (prev) clearTimeout(prev) + timers.set( + sessionKey, + setTimeout(() => flush(sessionKey), wait), + ) + } + + function setScroll(sessionKey: string, tab: string, pos: SessionScroll) { + seed(sessionKey) + + const prev = cache[sessionKey]?.[tab] + if (prev?.x === pos.x && prev?.y === pos.y) return + + setCache(sessionKey, tab, { x: pos.x, y: pos.y }) + dirty.add(sessionKey) + schedule(sessionKey) + } + + function flush(sessionKey: string) { + const timer = timers.get(sessionKey) + if (timer) clearTimeout(timer) + timers.delete(sessionKey) + + if (!dirty.has(sessionKey)) return + dirty.delete(sessionKey) + + opts.onFlush(sessionKey, clone(cache[sessionKey])) + } + + function flushAll() { + const keys = Array.from(dirty) + if (keys.length === 0) return + + for (const key of keys) { + flush(key) + } + } + + function drop(keys: string[]) { + if (keys.length === 0) return + + for (const key of keys) { + const timer = timers.get(key) + if (timer) clearTimeout(timer) + timers.delete(key) + dirty.delete(key) + } + + setCache( + produce((draft) => { + for (const key of keys) { + delete draft[key] + } + }), + ) + } + + function dispose() { + drop(Array.from(timers.keys())) + } + + return { + cache, + drop, + flush, + flushAll, + scroll, + seed, + setScroll, + dispose, + } +} diff --git a/packages/app/src/context/layout.tsx b/packages/app/src/context/layout.tsx new file mode 100644 index 00000000000..444a36d65af --- /dev/null +++ b/packages/app/src/context/layout.tsx @@ -0,0 +1,607 @@ +import { createStore, produce } from "solid-js/store" +import { batch, createEffect, createMemo, onCleanup, onMount } from "solid-js" +import { createSimpleContext } from "@opencode-ai/ui/context" +import { useGlobalSync } from "./global-sync" +import { useGlobalSDK } from "./global-sdk" +import { useServer } from "./server" +import { Project } from "@opencode-ai/sdk/v2" +import { Persist, persisted, removePersisted } from "@/utils/persist" +import { same } from "@/utils/same" +import { createScrollPersistence, type SessionScroll } from "./layout-scroll" + +const AVATAR_COLOR_KEYS = ["pink", "mint", "orange", "purple", "cyan", "lime"] as const +export type AvatarColorKey = (typeof AVATAR_COLOR_KEYS)[number] + +export function getAvatarColors(key?: string) { + if (key && AVATAR_COLOR_KEYS.includes(key as AvatarColorKey)) { + return { + background: `var(--avatar-background-${key})`, + foreground: `var(--avatar-text-${key})`, + } + } + return { + background: "var(--surface-info-base)", + foreground: "var(--text-base)", + } +} + +type SessionTabs = { + active?: string + all: string[] +} + +type SessionView = { + scroll: Record + reviewOpen?: string[] +} + +export type LocalProject = Partial & { worktree: string; expanded: boolean } + +export type ReviewDiffStyle = "unified" | "split" + +export const { use: useLayout, provider: LayoutProvider } = createSimpleContext({ + name: "Layout", + init: () => { + const globalSdk = useGlobalSDK() + const globalSync = useGlobalSync() + const server = useServer() + + const isRecord = (value: unknown): value is Record => + typeof value === "object" && value !== null && !Array.isArray(value) + + const migrate = (value: unknown) => { + if (!isRecord(value)) return value + const sidebar = value.sidebar + if (!isRecord(sidebar)) return value + if (typeof sidebar.workspaces !== "boolean") return value + return { + ...value, + sidebar: { + ...sidebar, + workspaces: {}, + workspacesDefault: sidebar.workspaces, + }, + } + } + + const target = Persist.global("layout", ["layout.v6"]) + const [store, setStore, _, ready] = persisted( + { ...target, migrate }, + createStore({ + sidebar: { + opened: false, + width: 344, + workspaces: {} as Record, + workspacesDefault: false, + }, + terminal: { + height: 280, + opened: false, + }, + review: { + diffStyle: "split" as ReviewDiffStyle, + panelOpened: true, + }, + session: { + width: 600, + }, + mobileSidebar: { + opened: false, + }, + sessionTabs: {} as Record, + sessionView: {} as Record, + }), + ) + + const MAX_SESSION_KEYS = 50 + const meta = { active: undefined as string | undefined, pruned: false } + const used = new Map() + + const SESSION_STATE_KEYS = [ + { key: "prompt", legacy: "prompt", version: "v2" }, + { key: "terminal", legacy: "terminal", version: "v1" }, + { key: "file-view", legacy: "file", version: "v1" }, + ] as const + + const dropSessionState = (keys: string[]) => { + for (const key of keys) { + const parts = key.split("/") + const dir = parts[0] + const session = parts[1] + if (!dir) continue + + for (const entry of SESSION_STATE_KEYS) { + const target = session ? Persist.session(dir, session, entry.key) : Persist.workspace(dir, entry.key) + void removePersisted(target) + + const legacyKey = `${dir}/${entry.legacy}${session ? "/" + session : ""}.${entry.version}` + void removePersisted({ key: legacyKey }) + } + } + } + + function prune(keep?: string) { + if (!keep) return + + const keys = new Set() + for (const key of Object.keys(store.sessionView)) keys.add(key) + for (const key of Object.keys(store.sessionTabs)) keys.add(key) + if (keys.size <= MAX_SESSION_KEYS) return + + const score = (key: string) => { + if (key === keep) return Number.MAX_SAFE_INTEGER + return used.get(key) ?? 0 + } + + const ordered = Array.from(keys).sort((a, b) => score(b) - score(a)) + const drop = ordered.slice(MAX_SESSION_KEYS) + if (drop.length === 0) return + + setStore( + produce((draft) => { + for (const key of drop) { + delete draft.sessionView[key] + delete draft.sessionTabs[key] + } + }), + ) + + scroll.drop(drop) + dropSessionState(drop) + + for (const key of drop) { + used.delete(key) + } + } + + function touch(sessionKey: string) { + meta.active = sessionKey + used.set(sessionKey, Date.now()) + + if (!ready()) return + if (meta.pruned) return + + meta.pruned = true + prune(sessionKey) + } + + const scroll = createScrollPersistence({ + debounceMs: 250, + getSnapshot: (sessionKey) => store.sessionView[sessionKey]?.scroll, + onFlush: (sessionKey, next) => { + const current = store.sessionView[sessionKey] + const keep = meta.active ?? sessionKey + if (!current) { + setStore("sessionView", sessionKey, { scroll: next }) + prune(keep) + return + } + + setStore("sessionView", sessionKey, "scroll", (prev) => ({ ...(prev ?? {}), ...next })) + prune(keep) + }, + }) + + createEffect(() => { + if (!ready()) return + if (meta.pruned) return + const active = meta.active + if (!active) return + meta.pruned = true + prune(active) + }) + + onMount(() => { + const flush = () => batch(() => scroll.flushAll()) + const handleVisibility = () => { + if (document.visibilityState !== "hidden") return + flush() + } + + window.addEventListener("pagehide", flush) + document.addEventListener("visibilitychange", handleVisibility) + + onCleanup(() => { + window.removeEventListener("pagehide", flush) + document.removeEventListener("visibilitychange", handleVisibility) + scroll.dispose() + }) + }) + + const [colors, setColors] = createStore>({}) + + function pickAvailableColor(used: Set): AvatarColorKey { + const available = AVATAR_COLOR_KEYS.filter((c) => !used.has(c)) + if (available.length === 0) return AVATAR_COLOR_KEYS[Math.floor(Math.random() * AVATAR_COLOR_KEYS.length)] + return available[Math.floor(Math.random() * available.length)] + } + + function enrich(project: { worktree: string; expanded: boolean }) { + const [childStore] = globalSync.child(project.worktree) + const projectID = childStore.project + const metadata = projectID + ? globalSync.data.project.find((x) => x.id === projectID) + : globalSync.data.project.find((x) => x.worktree === project.worktree) + + const local = childStore.projectMeta + const localOverride = + local?.name !== undefined || + local?.commands?.start !== undefined || + local?.icon?.override !== undefined || + local?.icon?.color !== undefined + + const base = { + ...(metadata ?? {}), + ...project, + icon: { + url: metadata?.icon?.url, + override: metadata?.icon?.override ?? childStore.icon, + color: metadata?.icon?.color, + }, + } + + const isGlobal = projectID === "global" || (metadata?.id === undefined && localOverride) + if (!isGlobal) return base + + return { + ...base, + id: base.id ?? "global", + name: local?.name, + commands: local?.commands, + icon: { + url: base.icon?.url, + override: local?.icon?.override, + color: local?.icon?.color, + }, + } + } + + const roots = createMemo(() => { + const map = new Map() + for (const project of globalSync.data.project) { + const sandboxes = project.sandboxes ?? [] + for (const sandbox of sandboxes) { + map.set(sandbox, project.worktree) + } + } + return map + }) + + createEffect(() => { + const map = roots() + if (map.size === 0) return + + const projects = server.projects.list() + const seen = new Set(projects.map((project) => project.worktree)) + + batch(() => { + for (const project of projects) { + const root = map.get(project.worktree) + if (!root) continue + + server.projects.close(project.worktree) + + if (!seen.has(root)) { + server.projects.open(root) + seen.add(root) + } + + if (project.expanded) server.projects.expand(root) + } + }) + }) + + const enriched = createMemo(() => server.projects.list().map(enrich)) + const list = createMemo(() => { + const projects = enriched() + return projects.map((project) => { + const color = project.icon?.color ?? colors[project.worktree] + if (!color) return project + const icon = project.icon ? { ...project.icon, color } : { color } + return { ...project, icon } + }) + }) + + createEffect(() => { + const projects = enriched() + if (projects.length === 0) return + + if (globalSync.ready) { + for (const project of projects) { + if (!project.id) continue + if (project.id === "global") continue + globalSync.project.icon(project.worktree, project.icon?.override) + } + } + + const used = new Set() + for (const project of projects) { + const color = project.icon?.color ?? colors[project.worktree] + if (color) used.add(color) + } + + for (const project of projects) { + if (project.icon?.color) continue + const existing = colors[project.worktree] + const color = existing ?? pickAvailableColor(used) + if (!existing) { + used.add(color) + setColors(project.worktree, color) + } + if (!project.id) continue + if (project.id === "global") { + globalSync.project.meta(project.worktree, { icon: { color } }) + continue + } + void globalSdk.client.project.update({ projectID: project.id, directory: project.worktree, icon: { color } }) + } + }) + + onMount(() => { + Promise.all( + server.projects.list().map((project) => { + return globalSync.project.loadSessions(project.worktree) + }), + ) + }) + + return { + ready, + projects: { + list, + open(directory: string) { + const root = roots().get(directory) ?? directory + if (server.projects.list().find((x) => x.worktree === root)) return + globalSync.project.loadSessions(root) + server.projects.open(root) + }, + close(directory: string) { + server.projects.close(directory) + }, + expand(directory: string) { + server.projects.expand(directory) + }, + collapse(directory: string) { + server.projects.collapse(directory) + }, + move(directory: string, toIndex: number) { + server.projects.move(directory, toIndex) + }, + }, + sidebar: { + opened: createMemo(() => store.sidebar.opened), + open() { + setStore("sidebar", "opened", true) + }, + close() { + setStore("sidebar", "opened", false) + }, + toggle() { + setStore("sidebar", "opened", (x) => !x) + }, + width: createMemo(() => store.sidebar.width), + resize(width: number) { + setStore("sidebar", "width", width) + }, + workspaces(directory: string) { + return createMemo(() => store.sidebar.workspaces[directory] ?? store.sidebar.workspacesDefault ?? false) + }, + setWorkspaces(directory: string, value: boolean) { + setStore("sidebar", "workspaces", directory, value) + }, + toggleWorkspaces(directory: string) { + const current = store.sidebar.workspaces[directory] ?? store.sidebar.workspacesDefault ?? false + setStore("sidebar", "workspaces", directory, !current) + }, + }, + terminal: { + height: createMemo(() => store.terminal.height), + resize(height: number) { + setStore("terminal", "height", height) + }, + }, + review: { + diffStyle: createMemo(() => store.review?.diffStyle ?? "split"), + setDiffStyle(diffStyle: ReviewDiffStyle) { + if (!store.review) { + setStore("review", { diffStyle }) + return + } + setStore("review", "diffStyle", diffStyle) + }, + }, + session: { + width: createMemo(() => store.session?.width ?? 600), + resize(width: number) { + if (!store.session) { + setStore("session", { width }) + return + } + setStore("session", "width", width) + }, + }, + mobileSidebar: { + opened: createMemo(() => store.mobileSidebar?.opened ?? false), + show() { + setStore("mobileSidebar", "opened", true) + }, + hide() { + setStore("mobileSidebar", "opened", false) + }, + toggle() { + setStore("mobileSidebar", "opened", (x) => !x) + }, + }, + view(sessionKey: string) { + touch(sessionKey) + scroll.seed(sessionKey) + const s = createMemo(() => store.sessionView[sessionKey] ?? { scroll: {} }) + const terminalOpened = createMemo(() => store.terminal?.opened ?? false) + const reviewPanelOpened = createMemo(() => store.review?.panelOpened ?? true) + + function setTerminalOpened(next: boolean) { + const current = store.terminal + if (!current) { + setStore("terminal", { height: 280, opened: next }) + return + } + + const value = current.opened ?? false + if (value === next) return + setStore("terminal", "opened", next) + } + + function setReviewPanelOpened(next: boolean) { + const current = store.review + if (!current) { + setStore("review", { diffStyle: "split" as ReviewDiffStyle, panelOpened: next }) + return + } + + const value = current.panelOpened ?? true + if (value === next) return + setStore("review", "panelOpened", next) + } + + return { + scroll(tab: string) { + return scroll.scroll(sessionKey, tab) + }, + setScroll(tab: string, pos: SessionScroll) { + scroll.setScroll(sessionKey, tab, pos) + }, + terminal: { + opened: terminalOpened, + open() { + setTerminalOpened(true) + }, + close() { + setTerminalOpened(false) + }, + toggle() { + setTerminalOpened(!terminalOpened()) + }, + }, + reviewPanel: { + opened: reviewPanelOpened, + open() { + setReviewPanelOpened(true) + }, + close() { + setReviewPanelOpened(false) + }, + toggle() { + setReviewPanelOpened(!reviewPanelOpened()) + }, + }, + review: { + open: createMemo(() => s().reviewOpen), + setOpen(open: string[]) { + const current = store.sessionView[sessionKey] + if (!current) { + setStore("sessionView", sessionKey, { + scroll: {}, + reviewOpen: open, + }) + return + } + + if (same(current.reviewOpen, open)) return + setStore("sessionView", sessionKey, "reviewOpen", open) + }, + }, + } + }, + tabs(sessionKey: string) { + touch(sessionKey) + const tabs = createMemo(() => store.sessionTabs[sessionKey] ?? { all: [] }) + return { + tabs, + active: createMemo(() => tabs().active), + all: createMemo(() => tabs().all), + setActive(tab: string | undefined) { + if (!store.sessionTabs[sessionKey]) { + setStore("sessionTabs", sessionKey, { all: [], active: tab }) + } else { + setStore("sessionTabs", sessionKey, "active", tab) + } + }, + setAll(all: string[]) { + if (!store.sessionTabs[sessionKey]) { + setStore("sessionTabs", sessionKey, { all, active: undefined }) + } else { + setStore("sessionTabs", sessionKey, "all", all) + } + }, + async open(tab: string) { + const current = store.sessionTabs[sessionKey] ?? { all: [] } + + if (tab === "review") { + if (!store.sessionTabs[sessionKey]) { + setStore("sessionTabs", sessionKey, { all: [], active: tab }) + return + } + setStore("sessionTabs", sessionKey, "active", tab) + return + } + + if (tab === "context") { + const all = [tab, ...current.all.filter((x) => x !== tab)] + if (!store.sessionTabs[sessionKey]) { + setStore("sessionTabs", sessionKey, { all, active: tab }) + return + } + setStore("sessionTabs", sessionKey, "all", all) + setStore("sessionTabs", sessionKey, "active", tab) + return + } + + if (!current.all.includes(tab)) { + if (!store.sessionTabs[sessionKey]) { + setStore("sessionTabs", sessionKey, { all: [tab], active: tab }) + return + } + setStore("sessionTabs", sessionKey, "all", [...current.all, tab]) + setStore("sessionTabs", sessionKey, "active", tab) + return + } + + if (!store.sessionTabs[sessionKey]) { + setStore("sessionTabs", sessionKey, { all: current.all, active: tab }) + return + } + setStore("sessionTabs", sessionKey, "active", tab) + }, + close(tab: string) { + const current = store.sessionTabs[sessionKey] + if (!current) return + + const all = current.all.filter((x) => x !== tab) + batch(() => { + setStore("sessionTabs", sessionKey, "all", all) + if (current.active !== tab) return + + const index = current.all.findIndex((f) => f === tab) + const next = all[index - 1] ?? all[0] + setStore("sessionTabs", sessionKey, "active", next) + }) + }, + move(tab: string, to: number) { + const current = store.sessionTabs[sessionKey] + if (!current) return + const index = current.all.findIndex((f) => f === tab) + if (index === -1) return + setStore( + "sessionTabs", + sessionKey, + "all", + produce((opened) => { + opened.splice(to, 0, opened.splice(index, 1)[0]) + }), + ) + }, + } + }, + } + }, +}) diff --git a/packages/desktop/src/context/local.tsx b/packages/app/src/context/local.tsx similarity index 57% rename from packages/desktop/src/context/local.tsx rename to packages/app/src/context/local.tsx index 39fd1f98744..64bfa838dde 100644 --- a/packages/desktop/src/context/local.tsx +++ b/packages/app/src/context/local.tsx @@ -1,12 +1,16 @@ import { createStore, produce, reconcile } from "solid-js/store" -import { batch, createEffect, createMemo } from "solid-js" -import { uniqueBy } from "remeda" +import { batch, createMemo, onCleanup } from "solid-js" +import { filter, firstBy, flat, groupBy, mapValues, pipe, uniqueBy, values } from "remeda" import type { FileContent, FileNode, Model, Provider, File as FileStatus } from "@opencode-ai/sdk/v2" import { createSimpleContext } from "@opencode-ai/ui/context" import { useSDK } from "./sdk" import { useSync } from "./sync" import { base64Encode } from "@opencode-ai/util/encode" import { useProviders } from "@/hooks/use-providers" +import { DateTime } from "luxon" +import { Persist, persisted } from "@/utils/persist" +import { showToast } from "@opencode-ai/ui/toast" +import { useLanguage } from "@/context/language" export type LocalFile = FileNode & Partial<{ @@ -39,6 +43,7 @@ export const { use: useLocal, provider: LocalProvider } = createSimpleContext({ const sdk = useSDK() const sync = useSync() const providers = useProviders() + const language = useLanguage() function isModelValid(model: ModelKey) { const provider = providers.all().find((x) => x.id === model.providerID) @@ -59,44 +64,43 @@ export const { use: useLocal, provider: LocalProvider } = createSimpleContext({ } } - // Automatically update model when agent changes - createEffect(() => { - const value = agent.current() - if (value.model) { - if (isModelValid(value.model)) - model.set({ - providerID: value.model.providerID, - modelID: value.model.modelID, - }) - // else - // toast.show({ - // type: "warning", - // message: `Agent ${value.name}'s configured model ${value.model.providerID}/${value.model.modelID} is not valid`, - // duration: 3000, - // }) - } - }) - const agent = (() => { - const list = createMemo(() => sync.data.agent.filter((x) => x.mode !== "subagent")) + const list = createMemo(() => sync.data.agent.filter((x) => x.mode !== "subagent" && !x.hidden)) const [store, setStore] = createStore<{ - current: string + current?: string }>({ - current: list()[0].name, + current: list()[0]?.name, }) return { list, current() { - return list().find((x) => x.name === store.current)! + const available = list() + if (available.length === 0) return undefined + return available.find((x) => x.name === store.current) ?? available[0] }, set(name: string | undefined) { - setStore("current", name ?? list()[0].name) + const available = list() + if (available.length === 0) { + setStore("current", undefined) + return + } + if (name && available.some((x) => x.name === name)) { + setStore("current", name) + return + } + setStore("current", available[0].name) }, move(direction: 1 | -1) { - let next = list().findIndex((x) => x.name === store.current) + direction - if (next < 0) next = list().length - 1 - if (next >= list().length) next = 0 - const value = list()[next] + const available = list() + if (available.length === 0) { + setStore("current", undefined) + return + } + let next = available.findIndex((x) => x.name === store.current) + direction + if (next < 0) next = available.length - 1 + if (next >= available.length) next = 0 + const value = available[next] + if (!value) return setStore("current", value.name) if (value.model) model.set({ @@ -108,30 +112,74 @@ export const { use: useLocal, provider: LocalProvider } = createSimpleContext({ })() const model = (() => { - const [store, setStore] = createStore<{ + const [store, setStore, _, modelReady] = persisted( + Persist.global("model", ["model.v1"]), + createStore<{ + user: (ModelKey & { visibility: "show" | "hide"; favorite?: boolean })[] + recent: ModelKey[] + variant?: Record + }>({ + user: [], + recent: [], + variant: {}, + }), + ) + + const [ephemeral, setEphemeral] = createStore<{ model: Record - recent: ModelKey[] }>({ model: {}, - recent: [], - }) - - const value = localStorage.getItem("model") - setStore("recent", JSON.parse(value ?? "[]")) - createEffect(() => { - localStorage.setItem("model", JSON.stringify(store.recent)) }) - const list = createMemo(() => + const available = createMemo(() => providers.connected().flatMap((p) => Object.values(p.models).map((m) => ({ ...m, - name: m.name.replace("(latest)", "").trim(), provider: p, - latest: m.name.includes("(latest)"), })), ), ) + + const latest = createMemo(() => + pipe( + available(), + filter((x) => Math.abs(DateTime.fromISO(x.release_date).diffNow().as("months")) < 6), + groupBy((x) => x.provider.id), + mapValues((models) => + pipe( + models, + groupBy((x) => x.family), + values(), + (groups) => + groups.flatMap((g) => { + const first = firstBy(g, [(x) => x.release_date, "desc"]) + return first ? [{ modelID: first.id, providerID: first.provider.id }] : [] + }), + ), + ), + values(), + flat(), + ), + ) + + const latestSet = createMemo(() => new Set(latest().map((x) => `${x.providerID}:${x.modelID}`))) + + const userVisibilityMap = createMemo(() => { + const map = new Map() + for (const item of store.user) { + map.set(`${item.providerID}:${item.modelID}`, item.visibility) + } + return map + }) + + const list = createMemo(() => + available().map((m) => ({ + ...m, + name: m.name.replace("(latest)", "").trim(), + latest: m.name.includes("(latest)"), + })), + ) + const find = (key: ModelKey) => list().find((m) => m.id === key?.modelID && m.provider.id === key.providerID) const fallbackModel = createMemo(() => { @@ -163,13 +211,15 @@ export const { use: useLocal, provider: LocalProvider } = createSimpleContext({ throw new Error("No default model found") }) - const currentModel = createMemo(() => { + const current = createMemo(() => { const a = agent.current() + if (!a) return undefined const key = getFirstValidModel( - () => store.model[a.name], + () => ephemeral.model[a.name], () => a.model, fallbackModel, - )! + ) + if (!key) return undefined return find(key) }) @@ -177,10 +227,12 @@ export const { use: useLocal, provider: LocalProvider } = createSimpleContext({ const cycle = (direction: 1 | -1) => { const recentList = recent() - const current = currentModel() - if (!current) return + const currentModel = current() + if (!currentModel) return - const index = recentList.findIndex((x) => x?.provider.id === current.provider.id && x?.id === current.id) + const index = recentList.findIndex( + (x) => x?.provider.id === currentModel.provider.id && x?.id === currentModel.id, + ) if (index === -1) return let next = index + direction @@ -196,14 +248,26 @@ export const { use: useLocal, provider: LocalProvider } = createSimpleContext({ }) } + function updateVisibility(model: ModelKey, visibility: "show" | "hide") { + const index = store.user.findIndex((x) => x.modelID === model.modelID && x.providerID === model.providerID) + if (index >= 0) { + setStore("user", index, { visibility }) + } else { + setStore("user", store.user.length, { ...model, visibility }) + } + } + return { - current: currentModel, + ready: modelReady, + current, recent, list, cycle, set(model: ModelKey | undefined, options?: { recent?: boolean }) { batch(() => { - setStore("model", agent.current().name, model ?? fallbackModel()) + const currentAgent = agent.current() + if (currentAgent) setEphemeral("model", currentAgent.name, model ?? fallbackModel()) + if (model) updateVisibility(model, "show") if (options?.recent && model) { const uniq = uniqueBy([model, ...store.recent], (x) => x.providerID + x.modelID) if (uniq.length > 5) uniq.pop() @@ -211,6 +275,59 @@ export const { use: useLocal, provider: LocalProvider } = createSimpleContext({ } }) }, + visible(model: ModelKey) { + const key = `${model.providerID}:${model.modelID}` + const visibility = userVisibilityMap().get(key) + if (visibility === "hide") return false + if (visibility === "show") return true + if (latestSet().has(key)) return true + // For models without valid release_date (e.g. custom models), show by default + const m = find(model) + if (!m?.release_date || !DateTime.fromISO(m.release_date).isValid) return true + return false + }, + setVisibility(model: ModelKey, visible: boolean) { + updateVisibility(model, visible ? "show" : "hide") + }, + variant: { + current() { + const m = current() + if (!m) return undefined + const key = `${m.provider.id}/${m.id}` + return store.variant?.[key] + }, + list() { + const m = current() + if (!m) return [] + if (!m.variants) return [] + return Object.keys(m.variants) + }, + set(value: string | undefined) { + const m = current() + if (!m) return + const key = `${m.provider.id}/${m.id}` + if (!store.variant) { + setStore("variant", { [key]: value }) + } else { + setStore("variant", key, value) + } + }, + cycle() { + const variants = this.list() + if (variants.length === 0) return + const currentVariant = this.current() + if (!currentVariant) { + this.set(variants[0]) + return + } + const index = variants.indexOf(currentVariant) + if (index === -1 || index === variants.length - 1) { + this.set(undefined) + return + } + this.set(variants[index + 1]) + }, + }, } })() @@ -218,11 +335,11 @@ export const { use: useLocal, provider: LocalProvider } = createSimpleContext({ const [store, setStore] = createStore<{ node: Record }>({ - node: Object.fromEntries(sync.data.node.map((x) => [x.path, x])), + node: {}, // Object.fromEntries(sync.data.node.map((x) => [x.path, x])), }) - const changeset = createMemo(() => new Set(sync.data.changes.map((f) => f.path))) - const changes = createMemo(() => Array.from(changeset()).sort((a, b) => a.localeCompare(b))) + // const changeset = createMemo(() => new Set(sync.data.changes.map((f) => f.path))) + // const changes = createMemo(() => Array.from(changeset()).sort((a, b) => a.localeCompare(b))) // createEffect((prev: FileStatus[]) => { // const removed = prev.filter((p) => !sync.data.changes.find((c) => c.path === p.path)) @@ -250,16 +367,16 @@ export const { use: useLocal, provider: LocalProvider } = createSimpleContext({ // return sync.data.changes // }, sync.data.changes) - const changed = (path: string) => { - const node = store.node[path] - if (node?.status) return true - const set = changeset() - if (set.has(path)) return true - for (const p of set) { - if (p.startsWith(path ? path + "/" : "")) return true - } - return false - } + // const changed = (path: string) => { + // const node = store.node[path] + // if (node?.status) return true + // const set = changeset() + // if (set.has(path)) return true + // for (const p of set) { + // if (p.startsWith(path ? path + "/" : "")) return true + // } + // return false + // } // const resetNode = (path: string) => { // setStore("node", path, { @@ -278,16 +395,26 @@ export const { use: useLocal, provider: LocalProvider } = createSimpleContext({ const load = async (path: string) => { const relativePath = relative(path) - await sdk.client.file.read({ path: relativePath }).then((x) => { - setStore( - "node", - relativePath, - produce((draft) => { - draft.loaded = true - draft.content = x.data - }), - ) - }) + await sdk.client.file + .read({ path: relativePath }) + .then((x) => { + if (!store.node[relativePath]) return + setStore( + "node", + relativePath, + produce((draft) => { + draft.loaded = true + draft.content = x.data + }), + ) + }) + .catch((e) => { + showToast({ + variant: "error", + title: language.t("toast.file.loadFailed.title"), + description: e.message, + }) + }) } const fetch = async (path: string) => { @@ -301,7 +428,7 @@ export const { use: useLocal, provider: LocalProvider } = createSimpleContext({ const init = async (path: string) => { const relativePath = relative(path) if (!store.node[relativePath]) await fetch(path) - if (store.node[relativePath].loaded) return + if (store.node[relativePath]?.loaded) return return load(relativePath) } @@ -318,41 +445,45 @@ export const { use: useLocal, provider: LocalProvider } = createSimpleContext({ // ] // }) // setStore("active", relativePath) - context.addActive() + // context.addActive() if (options?.pinned) setStore("node", path, "pinned", true) if (options?.view && store.node[relativePath].view === undefined) setStore("node", path, "view", options.view) - if (store.node[relativePath].loaded) return + if (store.node[relativePath]?.loaded) return return load(relativePath) } const list = async (path: string) => { - return sdk.client.file.list({ path: path + "/" }).then((x) => { - setStore( - "node", - produce((draft) => { - x.data!.forEach((node) => { - if (node.path in draft) return - draft[node.path] = node - }) - }), - ) - }) + return sdk.client.file + .list({ path: path + "/" }) + .then((x) => { + setStore( + "node", + produce((draft) => { + x.data!.forEach((node) => { + if (node.path in draft) return + draft[node.path] = node + }) + }), + ) + }) + .catch(() => {}) } const searchFiles = (query: string) => sdk.client.find.files({ query, dirs: "false" }).then((x) => x.data!) const searchFilesAndDirectories = (query: string) => sdk.client.find.files({ query, dirs: "true" }).then((x) => x.data!) - sdk.event.listen((e) => { + const unsub = sdk.event.listen((e) => { const event = e.details switch (event.type) { case "file.watcher.updated": const relativePath = relative(event.properties.file) if (relativePath.startsWith(".git/")) return - load(relativePath) + if (store.node[relativePath]) load(relativePath) break } }) + onCleanup(unsub) return { node: async (path: string) => { @@ -367,7 +498,7 @@ export const { use: useLocal, provider: LocalProvider } = createSimpleContext({ init, expand(path: string) { setStore("node", path, "expanded", true) - if (store.node[path].loaded) return + if (store.node[path]?.loaded) return setStore("node", path, "loaded", true) list(path) }, @@ -407,8 +538,8 @@ export const { use: useLocal, provider: LocalProvider } = createSimpleContext({ setChangeIndex(path: string, index: number | undefined) { setStore("node", path, "selectedChange", index) }, - changes, - changed, + // changes, + // changed, children(path: string) { return Object.values(store.node).filter( (x) => @@ -423,66 +554,11 @@ export const { use: useLocal, provider: LocalProvider } = createSimpleContext({ } })() - const context = (() => { - const [store, setStore] = createStore<{ - activeTab: boolean - files: string[] - activeFile?: string - items: (ContextItem & { key: string })[] - }>({ - activeTab: true, - files: [], - items: [], - }) - const files = createMemo(() => store.files.map((x) => file.node(x))) - const activeFile = createMemo(() => (store.activeFile ? file.node(store.activeFile) : undefined)) - - return { - all() { - return store.items - }, - // active() { - // return store.activeTab ? file.active() : undefined - // }, - addActive() { - setStore("activeTab", true) - }, - removeActive() { - setStore("activeTab", false) - }, - add(item: ContextItem) { - let key = item.type - switch (item.type) { - case "file": - key += `${item.path}:${item.selection?.startLine}:${item.selection?.endLine}` - break - } - if (store.items.find((x) => x.key === key)) return - setStore("items", (x) => [...x, { key, ...item }]) - }, - remove(key: string) { - setStore("items", (x) => x.filter((x) => x.key !== key)) - }, - files, - openFile(path: string) { - file.init(path).then(() => { - setStore("files", (x) => [...x, path]) - setStore("activeFile", path) - }) - }, - activeFile, - setActiveFile(path: string | undefined) { - setStore("activeFile", path) - }, - } - })() - const result = { slug: createMemo(() => base64Encode(sdk.directory)), model, agent, file, - context, } return result }, diff --git a/packages/app/src/context/notification.tsx b/packages/app/src/context/notification.tsx new file mode 100644 index 00000000000..58e7fbf83aa --- /dev/null +++ b/packages/app/src/context/notification.tsx @@ -0,0 +1,173 @@ +import { createStore } from "solid-js/store" +import { createEffect, onCleanup } from "solid-js" +import { useParams } from "@solidjs/router" +import { createSimpleContext } from "@opencode-ai/ui/context" +import { useGlobalSDK } from "./global-sdk" +import { useGlobalSync } from "./global-sync" +import { usePlatform } from "@/context/platform" +import { useLanguage } from "@/context/language" +import { useSettings } from "@/context/settings" +import { Binary } from "@opencode-ai/util/binary" +import { base64Decode, base64Encode } from "@opencode-ai/util/encode" +import { EventSessionError } from "@opencode-ai/sdk/v2" +import { Persist, persisted } from "@/utils/persist" +import { playSound, soundSrc } from "@/utils/sound" + +type NotificationBase = { + directory?: string + session?: string + metadata?: any + time: number + viewed: boolean +} + +type TurnCompleteNotification = NotificationBase & { + type: "turn-complete" +} + +type ErrorNotification = NotificationBase & { + type: "error" + error: EventSessionError["properties"]["error"] +} + +export type Notification = TurnCompleteNotification | ErrorNotification + +const MAX_NOTIFICATIONS = 500 +const NOTIFICATION_TTL_MS = 1000 * 60 * 60 * 24 * 30 + +function pruneNotifications(list: Notification[]) { + const cutoff = Date.now() - NOTIFICATION_TTL_MS + const pruned = list.filter((n) => n.time >= cutoff) + if (pruned.length <= MAX_NOTIFICATIONS) return pruned + return pruned.slice(pruned.length - MAX_NOTIFICATIONS) +} + +export const { use: useNotification, provider: NotificationProvider } = createSimpleContext({ + name: "Notification", + init: () => { + const params = useParams() + const globalSDK = useGlobalSDK() + const globalSync = useGlobalSync() + const platform = usePlatform() + const settings = useSettings() + const language = useLanguage() + + const [store, setStore, _, ready] = persisted( + Persist.global("notification", ["notification.v1"]), + createStore({ + list: [] as Notification[], + }), + ) + + const meta = { pruned: false } + + createEffect(() => { + if (!ready()) return + if (meta.pruned) return + meta.pruned = true + setStore("list", pruneNotifications(store.list)) + }) + + const append = (notification: Notification) => { + setStore("list", (list) => pruneNotifications([...list, notification])) + } + + const unsub = globalSDK.event.listen((e) => { + const directory = e.name + const event = e.details + const time = Date.now() + const activeDirectory = params.dir ? base64Decode(params.dir) : undefined + const activeSession = params.id + const viewed = (sessionID?: string) => { + if (!activeDirectory) return false + if (!activeSession) return false + if (!sessionID) return false + if (directory !== activeDirectory) return false + return sessionID === activeSession + } + switch (event.type) { + case "session.idle": { + const sessionID = event.properties.sessionID + const [syncStore] = globalSync.child(directory) + const match = Binary.search(syncStore.session, sessionID, (s) => s.id) + const session = match.found ? syncStore.session[match.index] : undefined + if (session?.parentID) break + + playSound(soundSrc(settings.sounds.agent())) + + append({ + directory, + time, + viewed: viewed(sessionID), + type: "turn-complete", + session: sessionID, + }) + + const href = `/${base64Encode(directory)}/session/${sessionID}` + if (settings.notifications.agent()) { + void platform.notify( + language.t("notification.session.responseReady.title"), + session?.title ?? sessionID, + href, + ) + } + break + } + case "session.error": { + const sessionID = event.properties.sessionID + const [syncStore] = globalSync.child(directory) + const match = sessionID ? Binary.search(syncStore.session, sessionID, (s) => s.id) : undefined + const session = sessionID && match?.found ? syncStore.session[match.index] : undefined + if (session?.parentID) break + + playSound(soundSrc(settings.sounds.errors())) + + const error = "error" in event.properties ? event.properties.error : undefined + append({ + directory, + time, + viewed: viewed(sessionID), + type: "error", + session: sessionID ?? "global", + error, + }) + const description = + session?.title ?? + (typeof error === "string" ? error : language.t("notification.session.error.fallbackDescription")) + const href = sessionID ? `/${base64Encode(directory)}/session/${sessionID}` : `/${base64Encode(directory)}` + if (settings.notifications.errors()) { + void platform.notify(language.t("notification.session.error.title"), description, href) + } + break + } + } + }) + onCleanup(unsub) + + return { + ready, + session: { + all(session: string) { + return store.list.filter((n) => n.session === session) + }, + unseen(session: string) { + return store.list.filter((n) => n.session === session && !n.viewed) + }, + markViewed(session: string) { + setStore("list", (n) => n.session === session, "viewed", true) + }, + }, + project: { + all(directory: string) { + return store.list.filter((n) => n.directory === directory) + }, + unseen(directory: string) { + return store.list.filter((n) => n.directory === directory && !n.viewed) + }, + markViewed(directory: string) { + setStore("list", (n) => n.directory === directory, "viewed", true) + }, + }, + } + }, +}) diff --git a/packages/app/src/context/permission.tsx b/packages/app/src/context/permission.tsx new file mode 100644 index 00000000000..52878ba8f80 --- /dev/null +++ b/packages/app/src/context/permission.tsx @@ -0,0 +1,167 @@ +import { createMemo, onCleanup } from "solid-js" +import { createStore, produce } from "solid-js/store" +import { createSimpleContext } from "@opencode-ai/ui/context" +import type { PermissionRequest } from "@opencode-ai/sdk/v2/client" +import { Persist, persisted } from "@/utils/persist" +import { useGlobalSDK } from "@/context/global-sdk" +import { useGlobalSync } from "./global-sync" +import { useParams } from "@solidjs/router" +import { base64Decode, base64Encode } from "@opencode-ai/util/encode" + +type PermissionRespondFn = (input: { + sessionID: string + permissionID: string + response: "once" | "always" | "reject" + directory?: string +}) => void + +function shouldAutoAccept(perm: PermissionRequest) { + return perm.permission === "edit" +} + +function isNonAllowRule(rule: unknown) { + if (!rule) return false + if (typeof rule === "string") return rule !== "allow" + if (typeof rule !== "object") return false + if (Array.isArray(rule)) return false + + for (const action of Object.values(rule)) { + if (action !== "allow") return true + } + + return false +} + +function hasAutoAcceptPermissionConfig(permission: unknown) { + if (!permission) return false + if (typeof permission === "string") return permission !== "allow" + if (typeof permission !== "object") return false + if (Array.isArray(permission)) return false + + const config = permission as Record + if (isNonAllowRule(config.edit)) return true + if (isNonAllowRule(config.write)) return true + + return false +} + +export const { use: usePermission, provider: PermissionProvider } = createSimpleContext({ + name: "Permission", + init: () => { + const params = useParams() + const globalSDK = useGlobalSDK() + const globalSync = useGlobalSync() + + const permissionsEnabled = createMemo(() => { + const directory = params.dir ? base64Decode(params.dir) : undefined + if (!directory) return false + const [store] = globalSync.child(directory) + return hasAutoAcceptPermissionConfig(store.config.permission) + }) + + const [store, setStore, _, ready] = persisted( + Persist.global("permission", ["permission.v3"]), + createStore({ + autoAcceptEdits: {} as Record, + }), + ) + + const responded = new Set() + + const respond: PermissionRespondFn = (input) => { + globalSDK.client.permission.respond(input).catch(() => { + responded.delete(input.permissionID) + }) + } + + function respondOnce(permission: PermissionRequest, directory?: string) { + if (responded.has(permission.id)) return + responded.add(permission.id) + respond({ + sessionID: permission.sessionID, + permissionID: permission.id, + response: "once", + directory, + }) + } + + function acceptKey(sessionID: string, directory?: string) { + if (!directory) return sessionID + return `${base64Encode(directory)}/${sessionID}` + } + + function isAutoAccepting(sessionID: string, directory?: string) { + const key = acceptKey(sessionID, directory) + return store.autoAcceptEdits[key] ?? store.autoAcceptEdits[sessionID] ?? false + } + + const unsubscribe = globalSDK.event.listen((e) => { + const event = e.details + if (event?.type !== "permission.asked") return + + const perm = event.properties + if (!isAutoAccepting(perm.sessionID, e.name)) return + if (!shouldAutoAccept(perm)) return + + respondOnce(perm, e.name) + }) + onCleanup(unsubscribe) + + function enable(sessionID: string, directory: string) { + const key = acceptKey(sessionID, directory) + setStore( + produce((draft) => { + draft.autoAcceptEdits[key] = true + delete draft.autoAcceptEdits[sessionID] + }), + ) + + globalSDK.client.permission + .list({ directory }) + .then((x) => { + for (const perm of x.data ?? []) { + if (!perm?.id) continue + if (perm.sessionID !== sessionID) continue + if (!shouldAutoAccept(perm)) continue + respondOnce(perm, directory) + } + }) + .catch(() => undefined) + } + + function disable(sessionID: string, directory?: string) { + const key = directory ? acceptKey(sessionID, directory) : undefined + setStore( + produce((draft) => { + if (key) delete draft.autoAcceptEdits[key] + delete draft.autoAcceptEdits[sessionID] + }), + ) + } + + return { + ready, + respond, + autoResponds(permission: PermissionRequest, directory?: string) { + return isAutoAccepting(permission.sessionID, directory) && shouldAutoAccept(permission) + }, + isAutoAccepting, + toggleAutoAccept(sessionID: string, directory: string) { + if (isAutoAccepting(sessionID, directory)) { + disable(sessionID, directory) + return + } + + enable(sessionID, directory) + }, + enableAutoAccept(sessionID: string, directory: string) { + if (isAutoAccepting(sessionID, directory)) return + enable(sessionID, directory) + }, + disableAutoAccept(sessionID: string, directory?: string) { + disable(sessionID, directory) + }, + permissionsEnabled, + } + }, +}) diff --git a/packages/app/src/context/platform.tsx b/packages/app/src/context/platform.tsx new file mode 100644 index 00000000000..89056b2c845 --- /dev/null +++ b/packages/app/src/context/platform.tsx @@ -0,0 +1,59 @@ +import { createSimpleContext } from "@opencode-ai/ui/context" +import { AsyncStorage, SyncStorage } from "@solid-primitives/storage" + +export type Platform = { + /** Platform discriminator */ + platform: "web" | "desktop" + + /** Desktop OS (Tauri only) */ + os?: "macos" | "windows" | "linux" + + /** App version */ + version?: string + + /** Open a URL in the default browser */ + openLink(url: string): void + + /** Restart the app */ + restart(): Promise + + /** Send a system notification (optional deep link) */ + notify(title: string, description?: string, href?: string): Promise + + /** Open directory picker dialog (native on Tauri, server-backed on web) */ + openDirectoryPickerDialog?(opts?: { title?: string; multiple?: boolean }): Promise + + /** Open native file picker dialog (Tauri only) */ + openFilePickerDialog?(opts?: { title?: string; multiple?: boolean }): Promise + + /** Save file picker dialog (Tauri only) */ + saveFilePickerDialog?(opts?: { title?: string; defaultPath?: string }): Promise + + /** Storage mechanism, defaults to localStorage */ + storage?: (name?: string) => SyncStorage | AsyncStorage + + /** Check for updates (Tauri only) */ + checkUpdate?(): Promise<{ updateAvailable: boolean; version?: string }> + + /** Install updates (Tauri only) */ + update?(): Promise + + /** Fetch override */ + fetch?: typeof fetch + + /** Get the configured default server URL (desktop only) */ + getDefaultServerUrl?(): Promise + + /** Set the default server URL to use on app startup (desktop only) */ + setDefaultServerUrl?(url: string | null): Promise + + /** Parse markdown to HTML using native parser (desktop only, returns unprocessed code blocks) */ + parseMarkdown?(markdown: string): Promise +} + +export const { use: usePlatform, provider: PlatformProvider } = createSimpleContext({ + name: "Platform", + init: (props: { value: Platform }) => { + return props.value + }, +}) diff --git a/packages/app/src/context/prompt.tsx b/packages/app/src/context/prompt.tsx new file mode 100644 index 00000000000..993d7e7a89a --- /dev/null +++ b/packages/app/src/context/prompt.tsx @@ -0,0 +1,244 @@ +import { createStore } from "solid-js/store" +import { createSimpleContext } from "@opencode-ai/ui/context" +import { batch, createMemo, createRoot, onCleanup } from "solid-js" +import { useParams } from "@solidjs/router" +import type { FileSelection } from "@/context/file" +import { Persist, persisted } from "@/utils/persist" + +interface PartBase { + content: string + start: number + end: number +} + +export interface TextPart extends PartBase { + type: "text" +} + +export interface FileAttachmentPart extends PartBase { + type: "file" + path: string + selection?: FileSelection +} + +export interface AgentPart extends PartBase { + type: "agent" + name: string +} + +export interface ImageAttachmentPart { + type: "image" + id: string + filename: string + mime: string + dataUrl: string +} + +export type ContentPart = TextPart | FileAttachmentPart | AgentPart | ImageAttachmentPart +export type Prompt = ContentPart[] + +export type FileContextItem = { + type: "file" + path: string + selection?: FileSelection +} + +export type ContextItem = FileContextItem + +export const DEFAULT_PROMPT: Prompt = [{ type: "text", content: "", start: 0, end: 0 }] + +function isSelectionEqual(a?: FileSelection, b?: FileSelection) { + if (!a && !b) return true + if (!a || !b) return false + return ( + a.startLine === b.startLine && a.startChar === b.startChar && a.endLine === b.endLine && a.endChar === b.endChar + ) +} + +export function isPromptEqual(promptA: Prompt, promptB: Prompt): boolean { + if (promptA.length !== promptB.length) return false + for (let i = 0; i < promptA.length; i++) { + const partA = promptA[i] + const partB = promptB[i] + if (partA.type !== partB.type) return false + if (partA.type === "text" && partA.content !== (partB as TextPart).content) { + return false + } + if (partA.type === "file") { + const fileA = partA as FileAttachmentPart + const fileB = partB as FileAttachmentPart + if (fileA.path !== fileB.path) return false + if (!isSelectionEqual(fileA.selection, fileB.selection)) return false + } + if (partA.type === "agent" && partA.name !== (partB as AgentPart).name) { + return false + } + if (partA.type === "image" && partA.id !== (partB as ImageAttachmentPart).id) { + return false + } + } + return true +} + +function cloneSelection(selection?: FileSelection) { + if (!selection) return undefined + return { ...selection } +} + +function clonePart(part: ContentPart): ContentPart { + if (part.type === "text") return { ...part } + if (part.type === "image") return { ...part } + if (part.type === "agent") return { ...part } + return { + ...part, + selection: cloneSelection(part.selection), + } +} + +function clonePrompt(prompt: Prompt): Prompt { + return prompt.map(clonePart) +} + +const WORKSPACE_KEY = "__workspace__" +const MAX_PROMPT_SESSIONS = 20 + +type PromptSession = ReturnType + +type PromptCacheEntry = { + value: PromptSession + dispose: VoidFunction +} + +function createPromptSession(dir: string, id: string | undefined) { + const legacy = `${dir}/prompt${id ? "/" + id : ""}.v2` + + const [store, setStore, _, ready] = persisted( + Persist.scoped(dir, id, "prompt", [legacy]), + createStore<{ + prompt: Prompt + cursor?: number + context: { + activeTab: boolean + items: (ContextItem & { key: string })[] + } + }>({ + prompt: clonePrompt(DEFAULT_PROMPT), + cursor: undefined, + context: { + activeTab: true, + items: [], + }, + }), + ) + + function keyForItem(item: ContextItem) { + if (item.type !== "file") return item.type + const start = item.selection?.startLine + const end = item.selection?.endLine + return `${item.type}:${item.path}:${start}:${end}` + } + + return { + ready, + current: createMemo(() => store.prompt), + cursor: createMemo(() => store.cursor), + dirty: createMemo(() => !isPromptEqual(store.prompt, DEFAULT_PROMPT)), + context: { + activeTab: createMemo(() => store.context.activeTab), + items: createMemo(() => store.context.items), + addActive() { + setStore("context", "activeTab", true) + }, + removeActive() { + setStore("context", "activeTab", false) + }, + add(item: ContextItem) { + const key = keyForItem(item) + if (store.context.items.find((x) => x.key === key)) return + setStore("context", "items", (items) => [...items, { key, ...item }]) + }, + remove(key: string) { + setStore("context", "items", (items) => items.filter((x) => x.key !== key)) + }, + }, + set(prompt: Prompt, cursorPosition?: number) { + const next = clonePrompt(prompt) + batch(() => { + setStore("prompt", next) + if (cursorPosition !== undefined) setStore("cursor", cursorPosition) + }) + }, + reset() { + batch(() => { + setStore("prompt", clonePrompt(DEFAULT_PROMPT)) + setStore("cursor", 0) + }) + }, + } +} + +export const { use: usePrompt, provider: PromptProvider } = createSimpleContext({ + name: "Prompt", + gate: false, + init: () => { + const params = useParams() + const cache = new Map() + + const disposeAll = () => { + for (const entry of cache.values()) { + entry.dispose() + } + cache.clear() + } + + onCleanup(disposeAll) + + const prune = () => { + while (cache.size > MAX_PROMPT_SESSIONS) { + const first = cache.keys().next().value + if (!first) return + const entry = cache.get(first) + entry?.dispose() + cache.delete(first) + } + } + + const load = (dir: string, id: string | undefined) => { + const key = `${dir}:${id ?? WORKSPACE_KEY}` + const existing = cache.get(key) + if (existing) { + cache.delete(key) + cache.set(key, existing) + return existing.value + } + + const entry = createRoot((dispose) => ({ + value: createPromptSession(dir, id), + dispose, + })) + + cache.set(key, entry) + prune() + return entry.value + } + + const session = createMemo(() => load(params.dir!, params.id)) + + return { + ready: () => session().ready(), + current: () => session().current(), + cursor: () => session().cursor(), + dirty: () => session().dirty(), + context: { + activeTab: () => session().context.activeTab(), + items: () => session().context.items(), + addActive: () => session().context.addActive(), + removeActive: () => session().context.removeActive(), + add: (item: ContextItem) => session().context.add(item), + remove: (key: string) => session().context.remove(key), + }, + set: (prompt: Prompt, cursorPosition?: number) => session().set(prompt, cursorPosition), + reset: () => session().reset(), + } + }, +}) diff --git a/packages/desktop/src/context/sdk.tsx b/packages/app/src/context/sdk.tsx similarity index 79% rename from packages/desktop/src/context/sdk.tsx rename to packages/app/src/context/sdk.tsx index 764b01f8aa4..aa4820c4945 100644 --- a/packages/desktop/src/context/sdk.tsx +++ b/packages/app/src/context/sdk.tsx @@ -3,29 +3,28 @@ import { createSimpleContext } from "@opencode-ai/ui/context" import { createGlobalEmitter } from "@solid-primitives/event-bus" import { onCleanup } from "solid-js" import { useGlobalSDK } from "./global-sdk" +import { usePlatform } from "./platform" export const { use: useSDK, provider: SDKProvider } = createSimpleContext({ name: "SDK", init: (props: { directory: string }) => { + const platform = usePlatform() const globalSDK = useGlobalSDK() - const abort = new AbortController() const sdk = createOpencodeClient({ baseUrl: globalSDK.url, - signal: abort.signal, + fetch: platform.fetch, directory: props.directory, + throwOnError: true, }) const emitter = createGlobalEmitter<{ [key in Event["type"]]: Extract }>() - globalSDK.event.on(props.directory, async (event) => { + const unsub = globalSDK.event.on(props.directory, (event) => { emitter.emit(event.type, event) }) - - onCleanup(() => { - abort.abort() - }) + onCleanup(unsub) return { directory: props.directory, client: sdk, event: emitter, url: globalSDK.url } }, diff --git a/packages/app/src/context/server.tsx b/packages/app/src/context/server.tsx new file mode 100644 index 00000000000..1076570928f --- /dev/null +++ b/packages/app/src/context/server.tsx @@ -0,0 +1,214 @@ +import { createOpencodeClient } from "@opencode-ai/sdk/v2/client" +import { createSimpleContext } from "@opencode-ai/ui/context" +import { batch, createEffect, createMemo, createSignal, onCleanup } from "solid-js" +import { createStore } from "solid-js/store" +import { usePlatform } from "@/context/platform" +import { Persist, persisted } from "@/utils/persist" + +type StoredProject = { worktree: string; expanded: boolean } + +export function normalizeServerUrl(input: string) { + const trimmed = input.trim() + if (!trimmed) return + const withProtocol = /^https?:\/\//.test(trimmed) ? trimmed : `http://${trimmed}` + return withProtocol.replace(/\/+$/, "") +} + +export function serverDisplayName(url: string) { + if (!url) return "" + return url.replace(/^https?:\/\//, "").replace(/\/+$/, "") +} + +function projectsKey(url: string) { + if (!url) return "" + const host = url.replace(/^https?:\/\//, "").split(":")[0] + if (host === "localhost" || host === "127.0.0.1") return "local" + return url +} + +export const { use: useServer, provider: ServerProvider } = createSimpleContext({ + name: "Server", + init: (props: { defaultUrl: string }) => { + const platform = usePlatform() + + const [store, setStore, _, ready] = persisted( + Persist.global("server", ["server.v3"]), + createStore({ + list: [] as string[], + projects: {} as Record, + lastProject: {} as Record, + }), + ) + + const [active, setActiveRaw] = createSignal("") + + function setActive(input: string) { + const url = normalizeServerUrl(input) + if (!url) return + setActiveRaw(url) + } + + function add(input: string) { + const url = normalizeServerUrl(input) + if (!url) return + + const fallback = normalizeServerUrl(props.defaultUrl) + if (fallback && url === fallback) { + setActiveRaw(url) + return + } + + batch(() => { + if (!store.list.includes(url)) { + setStore("list", store.list.length, url) + } + setActiveRaw(url) + }) + } + + function remove(input: string) { + const url = normalizeServerUrl(input) + if (!url) return + + const list = store.list.filter((x) => x !== url) + const next = active() === url ? (list[0] ?? normalizeServerUrl(props.defaultUrl) ?? "") : active() + + batch(() => { + setStore("list", list) + setActiveRaw(next) + }) + } + + createEffect(() => { + if (!ready()) return + if (active()) return + const url = normalizeServerUrl(props.defaultUrl) + if (!url) return + setActiveRaw(url) + }) + + const isReady = createMemo(() => ready() && !!active()) + + const [healthy, setHealthy] = createSignal(undefined) + + const check = (url: string) => { + const sdk = createOpencodeClient({ + baseUrl: url, + fetch: platform.fetch, + signal: AbortSignal.timeout(3000), + }) + return sdk.global + .health() + .then((x) => x.data?.healthy === true) + .catch(() => false) + } + + createEffect(() => { + const url = active() + if (!url) return + + setHealthy(undefined) + + let alive = true + let busy = false + + const run = () => { + if (busy) return + busy = true + void check(url) + .then((next) => { + if (!alive) return + setHealthy(next) + }) + .finally(() => { + busy = false + }) + } + + run() + const interval = setInterval(run, 10_000) + + onCleanup(() => { + alive = false + clearInterval(interval) + }) + }) + + const origin = createMemo(() => projectsKey(active())) + const projectsList = createMemo(() => store.projects[origin()] ?? []) + const isLocal = createMemo(() => origin() === "local") + + return { + ready: isReady, + healthy, + isLocal, + get url() { + return active() + }, + get name() { + return serverDisplayName(active()) + }, + get list() { + return store.list + }, + setActive, + add, + remove, + projects: { + list: projectsList, + open(directory: string) { + const key = origin() + if (!key) return + const current = store.projects[key] ?? [] + if (current.find((x) => x.worktree === directory)) return + setStore("projects", key, [{ worktree: directory, expanded: true }, ...current]) + }, + close(directory: string) { + const key = origin() + if (!key) return + const current = store.projects[key] ?? [] + setStore( + "projects", + key, + current.filter((x) => x.worktree !== directory), + ) + }, + expand(directory: string) { + const key = origin() + if (!key) return + const current = store.projects[key] ?? [] + const index = current.findIndex((x) => x.worktree === directory) + if (index !== -1) setStore("projects", key, index, "expanded", true) + }, + collapse(directory: string) { + const key = origin() + if (!key) return + const current = store.projects[key] ?? [] + const index = current.findIndex((x) => x.worktree === directory) + if (index !== -1) setStore("projects", key, index, "expanded", false) + }, + move(directory: string, toIndex: number) { + const key = origin() + if (!key) return + const current = store.projects[key] ?? [] + const fromIndex = current.findIndex((x) => x.worktree === directory) + if (fromIndex === -1 || fromIndex === toIndex) return + const result = [...current] + const [item] = result.splice(fromIndex, 1) + result.splice(toIndex, 0, item) + setStore("projects", key, result) + }, + last() { + const key = origin() + if (!key) return + return store.lastProject[key] + }, + touch(directory: string) { + const key = origin() + if (!key) return + setStore("lastProject", key, directory) + }, + }, + } + }, +}) diff --git a/packages/app/src/context/settings.tsx b/packages/app/src/context/settings.tsx new file mode 100644 index 00000000000..9211eacd2a8 --- /dev/null +++ b/packages/app/src/context/settings.tsx @@ -0,0 +1,158 @@ +import { createStore, reconcile } from "solid-js/store" +import { createEffect, createMemo } from "solid-js" +import { createSimpleContext } from "@opencode-ai/ui/context" +import { persisted } from "@/utils/persist" + +export interface NotificationSettings { + agent: boolean + permissions: boolean + errors: boolean +} + +export interface SoundSettings { + agent: string + permissions: string + errors: string +} + +export interface Settings { + general: { + autoSave: boolean + } + appearance: { + fontSize: number + font: string + } + keybinds: Record + permissions: { + autoApprove: boolean + } + notifications: NotificationSettings + sounds: SoundSettings +} + +const defaultSettings: Settings = { + general: { + autoSave: true, + }, + appearance: { + fontSize: 14, + font: "ibm-plex-mono", + }, + keybinds: {}, + permissions: { + autoApprove: false, + }, + notifications: { + agent: true, + permissions: true, + errors: false, + }, + sounds: { + agent: "staplebops-01", + permissions: "staplebops-02", + errors: "nope-03", + }, +} + +const monoFallback = + 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace' + +const monoFonts: Record = { + "ibm-plex-mono": `"IBM Plex Mono", "IBM Plex Mono Fallback", ${monoFallback}`, + "cascadia-code": `"Cascadia Code Nerd Font", "Cascadia Code NF", "Cascadia Mono NF", "IBM Plex Mono", "IBM Plex Mono Fallback", ${monoFallback}`, + "fira-code": `"Fira Code Nerd Font", "FiraMono Nerd Font", "FiraMono Nerd Font Mono", "IBM Plex Mono", "IBM Plex Mono Fallback", ${monoFallback}`, + hack: `"Hack Nerd Font", "Hack Nerd Font Mono", "IBM Plex Mono", "IBM Plex Mono Fallback", ${monoFallback}`, + inconsolata: `"Inconsolata Nerd Font", "Inconsolata Nerd Font Mono","IBM Plex Mono", "IBM Plex Mono Fallback", ${monoFallback}`, + "intel-one-mono": `"Intel One Mono Nerd Font", "IntoneMono Nerd Font", "IntoneMono Nerd Font Mono", "IBM Plex Mono", "IBM Plex Mono Fallback", ${monoFallback}`, + "jetbrains-mono": `"JetBrains Mono Nerd Font", "JetBrainsMono Nerd Font Mono", "JetBrainsMonoNL Nerd Font", "JetBrainsMonoNL Nerd Font Mono", "IBM Plex Mono", "IBM Plex Mono Fallback", ${monoFallback}`, + "meslo-lgs": `"Meslo LGS Nerd Font", "MesloLGS Nerd Font", "MesloLGM Nerd Font", "IBM Plex Mono", "IBM Plex Mono Fallback", ${monoFallback}`, + "roboto-mono": `"Roboto Mono Nerd Font", "RobotoMono Nerd Font", "RobotoMono Nerd Font Mono", "IBM Plex Mono", "IBM Plex Mono Fallback", ${monoFallback}`, + "source-code-pro": `"Source Code Pro Nerd Font", "SauceCodePro Nerd Font", "SauceCodePro Nerd Font Mono", "IBM Plex Mono", "IBM Plex Mono Fallback", ${monoFallback}`, + "ubuntu-mono": `"Ubuntu Mono Nerd Font", "UbuntuMono Nerd Font", "UbuntuMono Nerd Font Mono", "IBM Plex Mono", "IBM Plex Mono Fallback", ${monoFallback}`, +} + +export function monoFontFamily(font: string | undefined) { + return monoFonts[font ?? defaultSettings.appearance.font] ?? monoFonts[defaultSettings.appearance.font] +} + +export const { use: useSettings, provider: SettingsProvider } = createSimpleContext({ + name: "Settings", + init: () => { + const [store, setStore, _, ready] = persisted("settings.v3", createStore(defaultSettings)) + + createEffect(() => { + if (typeof document === "undefined") return + document.documentElement.style.setProperty("--font-family-mono", monoFontFamily(store.appearance?.font)) + }) + + return { + ready, + get current() { + return store + }, + general: { + autoSave: createMemo(() => store.general?.autoSave ?? defaultSettings.general.autoSave), + setAutoSave(value: boolean) { + setStore("general", "autoSave", value) + }, + }, + appearance: { + fontSize: createMemo(() => store.appearance?.fontSize ?? defaultSettings.appearance.fontSize), + setFontSize(value: number) { + setStore("appearance", "fontSize", value) + }, + font: createMemo(() => store.appearance?.font ?? defaultSettings.appearance.font), + setFont(value: string) { + setStore("appearance", "font", value) + }, + }, + keybinds: { + get: (action: string) => store.keybinds?.[action], + set(action: string, keybind: string) { + setStore("keybinds", action, keybind) + }, + reset(action: string) { + setStore("keybinds", action, undefined!) + }, + resetAll() { + setStore("keybinds", reconcile({})) + }, + }, + permissions: { + autoApprove: createMemo(() => store.permissions?.autoApprove ?? defaultSettings.permissions.autoApprove), + setAutoApprove(value: boolean) { + setStore("permissions", "autoApprove", value) + }, + }, + notifications: { + agent: createMemo(() => store.notifications?.agent ?? defaultSettings.notifications.agent), + setAgent(value: boolean) { + setStore("notifications", "agent", value) + }, + permissions: createMemo(() => store.notifications?.permissions ?? defaultSettings.notifications.permissions), + setPermissions(value: boolean) { + setStore("notifications", "permissions", value) + }, + errors: createMemo(() => store.notifications?.errors ?? defaultSettings.notifications.errors), + setErrors(value: boolean) { + setStore("notifications", "errors", value) + }, + }, + sounds: { + agent: createMemo(() => store.sounds?.agent ?? defaultSettings.sounds.agent), + setAgent(value: string) { + setStore("sounds", "agent", value) + }, + permissions: createMemo(() => store.sounds?.permissions ?? defaultSettings.sounds.permissions), + setPermissions(value: string) { + setStore("sounds", "permissions", value) + }, + errors: createMemo(() => store.sounds?.errors ?? defaultSettings.sounds.errors), + setErrors(value: string) { + setStore("sounds", "errors", value) + }, + }, + } + }, +}) diff --git a/packages/app/src/context/sync.tsx b/packages/app/src/context/sync.tsx new file mode 100644 index 00000000000..33129e1b475 --- /dev/null +++ b/packages/app/src/context/sync.tsx @@ -0,0 +1,256 @@ +import { batch, createMemo } from "solid-js" +import { createStore, produce, reconcile } from "solid-js/store" +import { Binary } from "@opencode-ai/util/binary" +import { retry } from "@opencode-ai/util/retry" +import { createSimpleContext } from "@opencode-ai/ui/context" +import { useGlobalSync } from "./global-sync" +import { useSDK } from "./sdk" +import type { Message, Part } from "@opencode-ai/sdk/v2/client" + +export const { use: useSync, provider: SyncProvider } = createSimpleContext({ + name: "Sync", + init: () => { + const globalSync = useGlobalSync() + const sdk = useSDK() + const [store, setStore] = globalSync.child(sdk.directory) + const absolute = (path: string) => (store.path.directory + "/" + path).replace("//", "/") + const chunk = 400 + const inflight = new Map>() + const inflightDiff = new Map>() + const inflightTodo = new Map>() + const [meta, setMeta] = createStore({ + limit: {} as Record, + complete: {} as Record, + loading: {} as Record, + }) + + const getSession = (sessionID: string) => { + const match = Binary.search(store.session, sessionID, (s) => s.id) + if (match.found) return store.session[match.index] + return undefined + } + + const limitFor = (count: number) => { + if (count <= chunk) return chunk + return Math.ceil(count / chunk) * chunk + } + + const hydrateMessages = (sessionID: string) => { + if (meta.limit[sessionID] !== undefined) return + + const messages = store.message[sessionID] + if (!messages) return + + const limit = limitFor(messages.length) + setMeta("limit", sessionID, limit) + setMeta("complete", sessionID, messages.length < limit) + } + + const loadMessages = async (sessionID: string, limit: number) => { + if (meta.loading[sessionID]) return + + setMeta("loading", sessionID, true) + await retry(() => sdk.client.session.messages({ sessionID, limit })) + .then((messages) => { + const items = (messages.data ?? []).filter((x) => !!x?.info?.id) + const next = items + .map((x) => x.info) + .filter((m) => !!m?.id) + .slice() + .sort((a, b) => a.id.localeCompare(b.id)) + + batch(() => { + setStore("message", sessionID, reconcile(next, { key: "id" })) + + for (const message of items) { + setStore( + "part", + message.info.id, + reconcile( + message.parts + .filter((p) => !!p?.id) + .slice() + .sort((a, b) => a.id.localeCompare(b.id)), + { key: "id" }, + ), + ) + } + + setMeta("limit", sessionID, limit) + setMeta("complete", sessionID, next.length < limit) + }) + }) + .finally(() => { + setMeta("loading", sessionID, false) + }) + } + + return { + data: store, + set: setStore, + get status() { + return store.status + }, + get ready() { + return store.status !== "loading" + }, + get project() { + const match = Binary.search(globalSync.data.project, store.project, (p) => p.id) + if (match.found) return globalSync.data.project[match.index] + return undefined + }, + session: { + get: getSession, + addOptimisticMessage(input: { + sessionID: string + messageID: string + parts: Part[] + agent: string + model: { providerID: string; modelID: string } + }) { + const message: Message = { + id: input.messageID, + sessionID: input.sessionID, + role: "user", + time: { created: Date.now() }, + agent: input.agent, + model: input.model, + } + setStore( + produce((draft) => { + const messages = draft.message[input.sessionID] + if (!messages) { + draft.message[input.sessionID] = [message] + } else { + const result = Binary.search(messages, input.messageID, (m) => m.id) + messages.splice(result.index, 0, message) + } + draft.part[input.messageID] = input.parts + .filter((p) => !!p?.id) + .slice() + .sort((a, b) => a.id.localeCompare(b.id)) + }), + ) + }, + async sync(sessionID: string) { + const hasSession = getSession(sessionID) !== undefined + hydrateMessages(sessionID) + + const hasMessages = store.message[sessionID] !== undefined + if (hasSession && hasMessages) return + + const pending = inflight.get(sessionID) + if (pending) return pending + + const limit = meta.limit[sessionID] ?? chunk + + const sessionReq = hasSession + ? Promise.resolve() + : retry(() => sdk.client.session.get({ sessionID })).then((session) => { + const data = session.data + if (!data) return + setStore( + "session", + produce((draft) => { + const match = Binary.search(draft, sessionID, (s) => s.id) + if (match.found) { + draft[match.index] = data + return + } + draft.splice(match.index, 0, data) + }), + ) + }) + + const messagesReq = hasMessages ? Promise.resolve() : loadMessages(sessionID, limit) + + const promise = Promise.all([sessionReq, messagesReq]) + .then(() => {}) + .finally(() => { + inflight.delete(sessionID) + }) + + inflight.set(sessionID, promise) + return promise + }, + async diff(sessionID: string) { + if (store.session_diff[sessionID] !== undefined) return + + const pending = inflightDiff.get(sessionID) + if (pending) return pending + + const promise = retry(() => sdk.client.session.diff({ sessionID })) + .then((diff) => { + setStore("session_diff", sessionID, reconcile(diff.data ?? [], { key: "file" })) + }) + .finally(() => { + inflightDiff.delete(sessionID) + }) + + inflightDiff.set(sessionID, promise) + return promise + }, + async todo(sessionID: string) { + if (store.todo[sessionID] !== undefined) return + + const pending = inflightTodo.get(sessionID) + if (pending) return pending + + const promise = retry(() => sdk.client.session.todo({ sessionID })) + .then((todo) => { + setStore("todo", sessionID, reconcile(todo.data ?? [], { key: "id" })) + }) + .finally(() => { + inflightTodo.delete(sessionID) + }) + + inflightTodo.set(sessionID, promise) + return promise + }, + history: { + more(sessionID: string) { + if (store.message[sessionID] === undefined) return false + if (meta.limit[sessionID] === undefined) return false + if (meta.complete[sessionID]) return false + return true + }, + loading(sessionID: string) { + return meta.loading[sessionID] ?? false + }, + async loadMore(sessionID: string, count = chunk) { + if (meta.loading[sessionID]) return + if (meta.complete[sessionID]) return + + const current = meta.limit[sessionID] ?? chunk + await loadMessages(sessionID, current + count) + }, + }, + fetch: async (count = 10) => { + setStore("limit", (x) => x + count) + await sdk.client.session.list().then((x) => { + const sessions = (x.data ?? []) + .filter((s) => !!s?.id) + .slice() + .sort((a, b) => a.id.localeCompare(b.id)) + .slice(0, store.limit) + setStore("session", reconcile(sessions, { key: "id" })) + }) + }, + more: createMemo(() => store.session.length >= store.limit), + archive: async (sessionID: string) => { + await sdk.client.session.update({ sessionID, time: { archived: Date.now() } }) + setStore( + produce((draft) => { + const match = Binary.search(draft.session, sessionID, (s) => s.id) + if (match.found) draft.session.splice(match.index, 1) + }), + ) + }, + }, + absolute, + get directory() { + return store.path.directory + }, + } + }, +}) diff --git a/packages/app/src/context/terminal.tsx b/packages/app/src/context/terminal.tsx new file mode 100644 index 00000000000..147c4f8f7ea --- /dev/null +++ b/packages/app/src/context/terminal.tsx @@ -0,0 +1,267 @@ +import { createStore, produce } from "solid-js/store" +import { createSimpleContext } from "@opencode-ai/ui/context" +import { batch, createEffect, createMemo, createRoot, onCleanup } from "solid-js" +import { useParams } from "@solidjs/router" +import { useSDK } from "./sdk" +import { Persist, persisted } from "@/utils/persist" + +export type LocalPTY = { + id: string + title: string + titleNumber: number + rows?: number + cols?: number + buffer?: string + scrollY?: number + error?: boolean +} + +const WORKSPACE_KEY = "__workspace__" +const MAX_TERMINAL_SESSIONS = 20 + +type TerminalSession = ReturnType + +type TerminalCacheEntry = { + value: TerminalSession + dispose: VoidFunction +} + +function createTerminalSession(sdk: ReturnType, dir: string, session?: string) { + const legacy = session ? [`${dir}/terminal/${session}.v1`, `${dir}/terminal.v1`] : [`${dir}/terminal.v1`] + + const numberFromTitle = (title: string) => { + const match = title.match(/^Terminal (\d+)$/) + if (!match) return + const value = Number(match[1]) + if (!Number.isFinite(value) || value <= 0) return + return value + } + + const [store, setStore, _, ready] = persisted( + Persist.workspace(dir, "terminal", legacy), + createStore<{ + active?: string + all: LocalPTY[] + }>({ + all: [], + }), + ) + + const unsub = sdk.event.on("pty.exited", (event) => { + const id = event.properties.id + if (!store.all.some((x) => x.id === id)) return + batch(() => { + setStore( + "all", + store.all.filter((x) => x.id !== id), + ) + if (store.active === id) { + const remaining = store.all.filter((x) => x.id !== id) + setStore("active", remaining[0]?.id) + } + }) + }) + onCleanup(unsub) + + const meta = { migrated: false } + + createEffect(() => { + if (!ready()) return + if (meta.migrated) return + meta.migrated = true + + setStore("all", (all) => { + const next = all.map((pty) => { + const direct = Number.isFinite(pty.titleNumber) && pty.titleNumber > 0 ? pty.titleNumber : undefined + if (direct !== undefined) return pty + const parsed = numberFromTitle(pty.title) + if (parsed === undefined) return pty + return { ...pty, titleNumber: parsed } + }) + if (next.every((pty, index) => pty === all[index])) return all + return next + }) + }) + + return { + ready, + all: createMemo(() => Object.values(store.all)), + active: createMemo(() => store.active), + new() { + const existingTitleNumbers = new Set( + store.all.flatMap((pty) => { + const direct = Number.isFinite(pty.titleNumber) && pty.titleNumber > 0 ? pty.titleNumber : undefined + if (direct !== undefined) return [direct] + const parsed = numberFromTitle(pty.title) + if (parsed === undefined) return [] + return [parsed] + }), + ) + + const nextNumber = + Array.from({ length: existingTitleNumbers.size + 1 }, (_, index) => index + 1).find( + (number) => !existingTitleNumbers.has(number), + ) ?? 1 + + sdk.client.pty + .create({ title: `Terminal ${nextNumber}` }) + .then((pty) => { + const id = pty.data?.id + if (!id) return + const newTerminal = { + id, + title: pty.data?.title ?? "Terminal", + titleNumber: nextNumber, + } + setStore("all", (all) => { + const newAll = [...all, newTerminal] + return newAll + }) + setStore("active", id) + }) + .catch((e) => { + console.error("Failed to create terminal", e) + }) + }, + update(pty: Partial & { id: string }) { + const index = store.all.findIndex((x) => x.id === pty.id) + if (index !== -1) { + setStore("all", index, (existing) => ({ ...existing, ...pty })) + } + sdk.client.pty + .update({ + ptyID: pty.id, + title: pty.title, + size: pty.cols && pty.rows ? { rows: pty.rows, cols: pty.cols } : undefined, + }) + .catch((e) => { + console.error("Failed to update terminal", e) + }) + }, + async clone(id: string) { + const index = store.all.findIndex((x) => x.id === id) + const pty = store.all[index] + if (!pty) return + const clone = await sdk.client.pty + .create({ + title: pty.title, + }) + .catch((e) => { + console.error("Failed to clone terminal", e) + return undefined + }) + if (!clone?.data) return + setStore("all", index, { + ...pty, + ...clone.data, + }) + if (store.active === pty.id) { + setStore("active", clone.data.id) + } + }, + open(id: string) { + setStore("active", id) + }, + next() { + const index = store.all.findIndex((x) => x.id === store.active) + if (index === -1) return + const nextIndex = (index + 1) % store.all.length + setStore("active", store.all[nextIndex]?.id) + }, + previous() { + const index = store.all.findIndex((x) => x.id === store.active) + if (index === -1) return + const prevIndex = index === 0 ? store.all.length - 1 : index - 1 + setStore("active", store.all[prevIndex]?.id) + }, + async close(id: string) { + batch(() => { + const filtered = store.all.filter((x) => x.id !== id) + if (store.active === id) { + const index = store.all.findIndex((f) => f.id === id) + const next = index > 0 ? index - 1 : 0 + setStore("active", filtered[next]?.id) + } + setStore("all", filtered) + }) + + await sdk.client.pty.remove({ ptyID: id }).catch((e) => { + console.error("Failed to close terminal", e) + }) + }, + move(id: string, to: number) { + const index = store.all.findIndex((f) => f.id === id) + if (index === -1) return + setStore( + "all", + produce((all) => { + all.splice(to, 0, all.splice(index, 1)[0]) + }), + ) + }, + } +} + +export const { use: useTerminal, provider: TerminalProvider } = createSimpleContext({ + name: "Terminal", + gate: false, + init: () => { + const sdk = useSDK() + const params = useParams() + const cache = new Map() + + const disposeAll = () => { + for (const entry of cache.values()) { + entry.dispose() + } + cache.clear() + } + + onCleanup(disposeAll) + + const prune = () => { + while (cache.size > MAX_TERMINAL_SESSIONS) { + const first = cache.keys().next().value + if (!first) return + const entry = cache.get(first) + entry?.dispose() + cache.delete(first) + } + } + + const load = (dir: string, session?: string) => { + const key = `${dir}:${WORKSPACE_KEY}` + const existing = cache.get(key) + if (existing) { + cache.delete(key) + cache.set(key, existing) + return existing.value + } + + const entry = createRoot((dispose) => ({ + value: createTerminalSession(sdk, dir, session), + dispose, + })) + + cache.set(key, entry) + prune() + return entry.value + } + + const workspace = createMemo(() => load(params.dir!, params.id)) + + return { + ready: () => workspace().ready(), + all: () => workspace().all(), + active: () => workspace().active(), + new: () => workspace().new(), + update: (pty: Partial & { id: string }) => workspace().update(pty), + clone: (id: string) => workspace().clone(id), + open: (id: string) => workspace().open(id), + close: (id: string) => workspace().close(id), + move: (id: string, to: number) => workspace().move(id, to), + next: () => workspace().next(), + previous: () => workspace().previous(), + } + }, +}) diff --git a/packages/desktop/src/custom-elements.d.ts b/packages/app/src/custom-elements.d.ts similarity index 100% rename from packages/desktop/src/custom-elements.d.ts rename to packages/app/src/custom-elements.d.ts diff --git a/packages/app/src/entry.tsx b/packages/app/src/entry.tsx new file mode 100644 index 00000000000..df8547636b4 --- /dev/null +++ b/packages/app/src/entry.tsx @@ -0,0 +1,76 @@ +// @refresh reload +import { render } from "solid-js/web" +import { AppBaseProviders, AppInterface } from "@/app" +import { Platform, PlatformProvider } from "@/context/platform" +import { dict as en } from "@/i18n/en" +import { dict as zh } from "@/i18n/zh" +import pkg from "../package.json" + +const root = document.getElementById("root") +if (import.meta.env.DEV && !(root instanceof HTMLElement)) { + const locale = (() => { + if (typeof navigator !== "object") return "en" as const + const languages = navigator.languages?.length ? navigator.languages : [navigator.language] + for (const language of languages) { + if (!language) continue + if (language.toLowerCase().startsWith("zh")) return "zh" as const + } + return "en" as const + })() + + const key = "error.dev.rootNotFound" as const + const message = locale === "zh" ? (zh[key] ?? en[key]) : en[key] + throw new Error(message) +} + +const platform: Platform = { + platform: "web", + version: pkg.version, + openLink(url: string) { + window.open(url, "_blank") + }, + restart: async () => { + window.location.reload() + }, + notify: async (title, description, href) => { + if (!("Notification" in window)) return + + const permission = + Notification.permission === "default" + ? await Notification.requestPermission().catch(() => "denied") + : Notification.permission + + if (permission !== "granted") return + + const inView = document.visibilityState === "visible" && document.hasFocus() + if (inView) return + + await Promise.resolve() + .then(() => { + const notification = new Notification(title, { + body: description ?? "", + icon: "https://opencode.ai/favicon-96x96-v3.png", + }) + notification.onclick = () => { + window.focus() + if (href) { + window.history.pushState(null, "", href) + window.dispatchEvent(new PopStateEvent("popstate")) + } + notification.close() + } + }) + .catch(() => undefined) + }, +} + +render( + () => ( + + + + + + ), + root!, +) diff --git a/packages/desktop/src/env.d.ts b/packages/app/src/env.d.ts similarity index 100% rename from packages/desktop/src/env.d.ts rename to packages/app/src/env.d.ts diff --git a/packages/desktop/src/hooks/use-providers.ts b/packages/app/src/hooks/use-providers.ts similarity index 100% rename from packages/desktop/src/hooks/use-providers.ts rename to packages/app/src/hooks/use-providers.ts index 501ff9d0c31..4a73fa05588 100644 --- a/packages/desktop/src/hooks/use-providers.ts +++ b/packages/app/src/hooks/use-providers.ts @@ -6,8 +6,8 @@ import { createMemo } from "solid-js" export const popularProviders = ["opencode", "anthropic", "github-copilot", "openai", "google", "openrouter", "vercel"] export function useProviders() { - const params = useParams() const globalSync = useGlobalSync() + const params = useParams() const currentDirectory = createMemo(() => base64Decode(params.dir ?? "")) const providers = createMemo(() => { if (currentDirectory()) { diff --git a/packages/app/src/i18n/ar.ts b/packages/app/src/i18n/ar.ts new file mode 100644 index 00000000000..08c69ea62c9 --- /dev/null +++ b/packages/app/src/i18n/ar.ts @@ -0,0 +1,654 @@ +export const dict = { + "command.category.suggested": "مقترح", + "command.category.view": "عرض", + "command.category.project": "مشروع", + "command.category.provider": "موفر", + "command.category.server": "خادم", + "command.category.session": "جلسة", + "command.category.theme": "سمة", + "command.category.language": "لغة", + "command.category.file": "ملف", + "command.category.terminal": "محطة طرفية", + "command.category.model": "نموذج", + "command.category.mcp": "MCP", + "command.category.agent": "وكيل", + "command.category.permissions": "أذونات", + "command.category.workspace": "مساحة عمل", + "command.category.settings": "إعدادات", + + "theme.scheme.system": "نظام", + "theme.scheme.light": "فاتح", + "theme.scheme.dark": "داكن", + + "command.sidebar.toggle": "تبديل الشريط الجانبي", + "command.project.open": "فتح مشروع", + "command.provider.connect": "اتصال بموفر", + "command.server.switch": "تبديل الخادم", + "command.settings.open": "فتح الإعدادات", + "command.session.previous": "الجلسة السابقة", + "command.session.next": "الجلسة التالية", + "command.session.archive": "أرشفة الجلسة", + + "command.palette": "لوحة الأوامر", + + "command.theme.cycle": "تغيير السمة", + "command.theme.set": "استخدام السمة: {{theme}}", + "command.theme.scheme.cycle": "تغيير مخطط الألوان", + "command.theme.scheme.set": "استخدام مخطط الألوان: {{scheme}}", + + "command.language.cycle": "تغيير اللغة", + "command.language.set": "استخدام اللغة: {{language}}", + + "command.session.new": "جلسة جديدة", + "command.file.open": "فتح ملف", + "command.file.open.description": "البحث في الملفات والأوامر", + "command.terminal.toggle": "تبديل المحطة الطرفية", + "command.review.toggle": "تبديل المراجعة", + "command.terminal.new": "محطة طرفية جديدة", + "command.terminal.new.description": "إنشاء علامة تبويب جديدة للمحطة الطرفية", + "command.steps.toggle": "تبديل الخطوات", + "command.steps.toggle.description": "إظهار أو إخفاء خطوات الرسالة الحالية", + "command.message.previous": "الرسالة السابقة", + "command.message.previous.description": "انتقل إلى رسالة المستخدم السابقة", + "command.message.next": "الرسالة التالية", + "command.message.next.description": "انتقل إلى رسالة المستخدم التالية", + "command.model.choose": "اختيار نموذج", + "command.model.choose.description": "حدد نموذجًا مختلفًا", + "command.mcp.toggle": "تبديل MCPs", + "command.mcp.toggle.description": "تبديل MCPs", + "command.agent.cycle": "تغيير الوكيل", + "command.agent.cycle.description": "التبديل إلى الوكيل التالي", + "command.agent.cycle.reverse": "تغيير الوكيل للخلف", + "command.agent.cycle.reverse.description": "التبديل إلى الوكيل السابق", + "command.model.variant.cycle": "تغيير جهد التفكير", + "command.model.variant.cycle.description": "التبديل إلى مستوى الجهد التالي", + "command.permissions.autoaccept.enable": "قبول التعديلات تلقائيًا", + "command.permissions.autoaccept.disable": "إيقاف قبول التعديلات تلقائيًا", + "command.session.undo": "تراجع", + "command.session.undo.description": "تراجع عن الرسالة الأخيرة", + "command.session.redo": "إعادة", + "command.session.redo.description": "إعادة الرسالة التي تم التراجع عنها", + "command.session.compact": "ضغط الجلسة", + "command.session.compact.description": "تلخيص الجلسة لتقليل حجم السياق", + "command.session.fork": "تشعب من الرسالة", + "command.session.fork.description": "إنشاء جلسة جديدة من رسالة سابقة", + "command.session.share": "مشاركة الجلسة", + "command.session.share.description": "مشاركة هذه الجلسة ونسخ الرابط إلى الحافظة", + "command.session.unshare": "إلغاء مشاركة الجلسة", + "command.session.unshare.description": "إيقاف مشاركة هذه الجلسة", + + "palette.search.placeholder": "البحث في الملفات والأوامر", + "palette.empty": "لا توجد نتائج", + "palette.group.commands": "الأوامر", + "palette.group.files": "الملفات", + + "dialog.provider.search.placeholder": "البحث عن موفرين", + "dialog.provider.empty": "لم يتم العثور على موفرين", + "dialog.provider.group.popular": "شائع", + "dialog.provider.group.other": "آخر", + "dialog.provider.tag.recommended": "موصى به", + "dialog.provider.anthropic.note": "اتصل باستخدام Claude Pro/Max أو مفتاح API", + + "dialog.model.select.title": "تحديد نموذج", + "dialog.model.search.placeholder": "البحث عن نماذج", + "dialog.model.empty": "لا توجد نتائج للنماذج", + "dialog.model.manage": "إدارة النماذج", + "dialog.model.manage.description": "تخصيص النماذج التي تظهر في محدد النماذج.", + + "dialog.model.unpaid.freeModels.title": "نماذج مجانية مقدمة من OpenCode", + "dialog.model.unpaid.addMore.title": "إضافة المزيد من النماذج من موفرين مشهورين", + + "dialog.provider.viewAll": "عرض جميع الموفرين", + + "provider.connect.title": "اتصال {{provider}}", + "provider.connect.title.anthropicProMax": "تسجيل الدخول باستخدام Claude Pro/Max", + "provider.connect.selectMethod": "حدد طريقة تسجيل الدخول لـ {{provider}}.", + "provider.connect.method.apiKey": "مفتاح API", + "provider.connect.status.inProgress": "جارٍ التفويض...", + "provider.connect.status.waiting": "في انتظار التفويض...", + "provider.connect.status.failed": "فشل التفويض: {{error}}", + "provider.connect.apiKey.description": + "أدخل مفتاح واجهة برمجة تطبيقات {{provider}} الخاص بك لتوصيل حسابك واستخدام نماذج {{provider}} في OpenCode.", + "provider.connect.apiKey.label": "مفتاح واجهة برمجة تطبيقات {{provider}}", + "provider.connect.apiKey.placeholder": "مفتاح API", + "provider.connect.apiKey.required": "مفتاح API مطلوب", + "provider.connect.opencodeZen.line1": + "يمنحك OpenCode Zen الوصول إلى مجموعة مختارة من النماذج الموثوقة والمحسنة لوكلاء البرمجة.", + "provider.connect.opencodeZen.line2": + "باستخدام مفتاح API واحد، ستحصل على إمكانية الوصول إلى نماذج مثل Claude و GPT و Gemini و GLM والمزيد.", + "provider.connect.opencodeZen.visit.prefix": "قم بزيارة ", + "provider.connect.opencodeZen.visit.link": "opencode.ai/zen", + "provider.connect.opencodeZen.visit.suffix": " للحصول على مفتاح API الخاص بك.", + "provider.connect.oauth.code.visit.prefix": "قم بزيارة ", + "provider.connect.oauth.code.visit.link": "هذا الرابط", + "provider.connect.oauth.code.visit.suffix": + " للحصول على رمز التفويض الخاص بك لتوصيل حسابك واستخدام نماذج {{provider}} في OpenCode.", + "provider.connect.oauth.code.label": "رمز تفويض {{method}}", + "provider.connect.oauth.code.placeholder": "رمز التفويض", + "provider.connect.oauth.code.required": "رمز التفويض مطلوب", + "provider.connect.oauth.code.invalid": "رمز التفويض غير صالح", + "provider.connect.oauth.auto.visit.prefix": "قم بزيارة ", + "provider.connect.oauth.auto.visit.link": "هذا الرابط", + "provider.connect.oauth.auto.visit.suffix": + " وأدخل الرمز أدناه لتوصيل حسابك واستخدام نماذج {{provider}} في OpenCode.", + "provider.connect.oauth.auto.confirmationCode": "رمز التأكيد", + "provider.connect.toast.connected.title": "تم توصيل {{provider}}", + "provider.connect.toast.connected.description": "نماذج {{provider}} متاحة الآن للاستخدام.", + + "model.tag.free": "مجاني", + "model.tag.latest": "الأحدث", + "model.provider.anthropic": "Anthropic", + "model.provider.openai": "OpenAI", + "model.provider.google": "Google", + "model.provider.xai": "xAI", + "model.provider.meta": "Meta", + "model.input.text": "نص", + "model.input.image": "صورة", + "model.input.audio": "صوت", + "model.input.video": "فيديو", + "model.input.pdf": "pdf", + "model.tooltip.allows": "يسمح: {{inputs}}", + "model.tooltip.reasoning.allowed": "يسمح بالاستنتاج", + "model.tooltip.reasoning.none": "بدون استنتاج", + "model.tooltip.context": "حد السياق {{limit}}", + + "common.search.placeholder": "بحث", + "common.goBack": "رجوع", + "common.loading": "جارٍ التحميل", + "common.loading.ellipsis": "...", + "common.cancel": "إلغاء", + "common.submit": "إرسال", + "common.save": "حفظ", + "common.saving": "جارٍ الحفظ...", + "common.default": "افتراضي", + "common.attachment": "مرفق", + + "prompt.placeholder.shell": "أدخل أمر shell...", + "prompt.placeholder.normal": 'اسأل أي شيء... "{{example}}"', + "prompt.mode.shell": "Shell", + "prompt.mode.shell.exit": "esc للخروج", + + "prompt.example.1": "إصلاح TODO في قاعدة التعليمات البرمجية", + "prompt.example.2": "ما هو المكدس التقني لهذا المشروع؟", + "prompt.example.3": "إصلاح الاختبارات المعطلة", + "prompt.example.4": "اشرح كيف تعمل المصادقة", + "prompt.example.5": "البحث عن وإصلاح الثغرات الأمنية", + "prompt.example.6": "إضافة اختبارات وحدة لخدمة المستخدم", + "prompt.example.7": "إعادة هيكلة هذه الدالة لتكون أكثر قابلية للقراءة", + "prompt.example.8": "ماذا يعني هذا الخطأ؟", + "prompt.example.9": "ساعدني في تصحيح هذه المشكلة", + "prompt.example.10": "توليد وثائق API", + "prompt.example.11": "تحسين استعلامات قاعدة البيانات", + "prompt.example.12": "إضافة التحقق من صحة الإدخال", + "prompt.example.13": "إنشاء مكون جديد لـ...", + "prompt.example.14": "كيف أقوم بنشر هذا المشروع؟", + "prompt.example.15": "مراجعة الكود الخاص بي لأفضل الممارسات", + "prompt.example.16": "إضافة معالجة الأخطاء لهذه الدالة", + "prompt.example.17": "اشرح نمط regex هذا", + "prompt.example.18": "تحويل هذا إلى TypeScript", + "prompt.example.19": "إضافة تسجيل الدخول (logging) في جميع أنحاء قاعدة التعليمات البرمجية", + "prompt.example.20": "ما هي التبعيات القديمة؟", + "prompt.example.21": "ساعدني في كتابة برنامج نصي للهجرة", + "prompt.example.22": "تنفيذ التخزين المؤقت لهذه النقطة النهائية", + "prompt.example.23": "إضافة ترقيم الصفحات إلى هذه القائمة", + "prompt.example.24": "إنشاء أمر CLI لـ...", + "prompt.example.25": "كيف تعمل متغيرات البيئة هنا؟", + + "prompt.popover.emptyResults": "لا توجد نتائج مطابقة", + "prompt.popover.emptyCommands": "لا توجد أوامر مطابقة", + "prompt.dropzone.label": "أفلت الصور أو ملفات PDF هنا", + "prompt.slash.badge.custom": "مخصص", + "prompt.context.active": "نشط", + "prompt.context.includeActiveFile": "تضمين الملف النشط", + "prompt.context.removeActiveFile": "إزالة الملف النشط من السياق", + "prompt.context.removeFile": "إزالة الملف من السياق", + "prompt.action.attachFile": "إرفاق ملف", + "prompt.attachment.remove": "إزالة المرفق", + "prompt.action.send": "إرسال", + "prompt.action.stop": "توقف", + + "prompt.toast.pasteUnsupported.title": "لصق غير مدعوم", + "prompt.toast.pasteUnsupported.description": "يمكن لصق الصور أو ملفات PDF فقط هنا.", + "prompt.toast.modelAgentRequired.title": "حدد وكيلاً ونموذجاً", + "prompt.toast.modelAgentRequired.description": "اختر وكيلاً ونموذجاً قبل إرسال الموجه.", + "prompt.toast.worktreeCreateFailed.title": "فشل إنشاء شجرة العمل", + "prompt.toast.sessionCreateFailed.title": "فشل إنشاء الجلسة", + "prompt.toast.shellSendFailed.title": "فشل إرسال أمر shell", + "prompt.toast.commandSendFailed.title": "فشل إرسال الأمر", + "prompt.toast.promptSendFailed.title": "فشل إرسال الموجه", + + "dialog.mcp.title": "MCPs", + "dialog.mcp.description": "{{enabled}} من {{total}} مفعل", + "dialog.mcp.empty": "لم يتم تكوين MCPs", + + "mcp.status.connected": "متصل", + "mcp.status.failed": "فشل", + "mcp.status.needs_auth": "يحتاج إلى مصادقة", + "mcp.status.disabled": "معطل", + + "dialog.fork.empty": "لا توجد رسائل للتفرع منها", + + "dialog.directory.search.placeholder": "البحث في المجلدات", + "dialog.directory.empty": "لم يتم العثور على مجلدات", + + "dialog.server.title": "الخوادم", + "dialog.server.description": "تبديل خادم OpenCode الذي يتصل به هذا التطبيق.", + "dialog.server.search.placeholder": "البحث في الخوادم", + "dialog.server.empty": "لا توجد خوادم بعد", + "dialog.server.add.title": "إضافة خادم", + "dialog.server.add.url": "عنوان URL للخادم", + "dialog.server.add.placeholder": "http://localhost:4096", + "dialog.server.add.error": "تعذر الاتصال بالخادم", + "dialog.server.add.checking": "جارٍ التحقق...", + "dialog.server.add.button": "إضافة", + "dialog.server.default.title": "الخادم الافتراضي", + "dialog.server.default.description": + "الاتصال بهذا الخادم عند بدء تشغيل التطبيق بدلاً من بدء خادم محلي. يتطلب إعادة التشغيل.", + "dialog.server.default.none": "لم يتم تحديد خادم", + "dialog.server.default.set": "تعيين الخادم الحالي كافتراضي", + "dialog.server.default.clear": "مسح", + "dialog.server.action.remove": "إزالة الخادم", + + "dialog.project.edit.title": "تحرير المشروع", + "dialog.project.edit.name": "الاسم", + "dialog.project.edit.icon": "أيقونة", + "dialog.project.edit.icon.alt": "أيقونة المشروع", + "dialog.project.edit.icon.hint": "انقر أو اسحب صورة", + "dialog.project.edit.icon.recommended": "موصى به: 128x128px", + "dialog.project.edit.color": "لون", + "dialog.project.edit.color.select": "اختر لون {{color}}", + + "context.breakdown.title": "تفصيل السياق", + "context.breakdown.note": 'تفصيل تقريبي لرموز الإدخال. يشمل "أخرى" تعريفات الأدوات والنفقات العامة.', + "context.breakdown.system": "النظام", + "context.breakdown.user": "المستخدم", + "context.breakdown.assistant": "المساعد", + "context.breakdown.tool": "استدعاءات الأداة", + "context.breakdown.other": "أخرى", + + "context.systemPrompt.title": "موجه النظام", + "context.rawMessages.title": "الرسائل الخام", + + "context.stats.session": "جلسة", + "context.stats.messages": "رسائل", + "context.stats.provider": "موفر", + "context.stats.model": "نموذج", + "context.stats.limit": "حد السياق", + "context.stats.totalTokens": "إجمالي الرموز", + "context.stats.usage": "استخدام", + "context.stats.inputTokens": "رموز الإدخال", + "context.stats.outputTokens": "رموز الإخراج", + "context.stats.reasoningTokens": "رموز الاستنتاج", + "context.stats.cacheTokens": "رموز التخزين المؤقت (قراءة/كتابة)", + "context.stats.userMessages": "رسائل المستخدم", + "context.stats.assistantMessages": "رسائل المساعد", + "context.stats.totalCost": "التكلفة الإجمالية", + "context.stats.sessionCreated": "تم إنشاء الجلسة", + "context.stats.lastActivity": "آخر نشاط", + + "context.usage.tokens": "رموز", + "context.usage.usage": "استخدام", + "context.usage.cost": "تكلفة", + "context.usage.clickToView": "انقر لعرض السياق", + "context.usage.view": "عرض استخدام السياق", + + "language.en": "الإنجليزية", + "language.zh": "الصينية (المبسطة)", + "language.zht": "الصينية (التقليدية)", + "language.ko": "الكورية", + "language.de": "الألمانية", + "language.es": "الإسبانية", + "language.fr": "الفرنسية", + "language.ja": "اليابانية", + "language.da": "الدانماركية", + "language.ru": "الروسية", + "language.pl": "البولندية", + "language.ar": "العربية", + "language.no": "النرويجية", + "language.br": "البرتغالية (البرازيل)", + + "toast.language.title": "لغة", + "toast.language.description": "تم التبديل إلى {{language}}", + + "toast.theme.title": "تم تبديل السمة", + "toast.scheme.title": "مخطط الألوان", + + "toast.permissions.autoaccept.on.title": "قبول التعديلات تلقائيًا", + "toast.permissions.autoaccept.on.description": "سيتم الموافقة تلقائيًا على أذونات التحرير والكتابة", + "toast.permissions.autoaccept.off.title": "توقف قبول التعديلات تلقائيًا", + "toast.permissions.autoaccept.off.description": "ستتطلب أذونات التحرير والكتابة موافقة", + + "toast.model.none.title": "لم يتم تحديد نموذج", + "toast.model.none.description": "قم بتوصيل موفر لتلخيص هذه الجلسة", + + "toast.file.loadFailed.title": "فشل تحميل الملف", + + "toast.session.share.copyFailed.title": "فشل نسخ عنوان URL إلى الحافظة", + "toast.session.share.success.title": "تمت مشاركة الجلسة", + "toast.session.share.success.description": "تم نسخ عنوان URL للمشاركة إلى الحافظة!", + "toast.session.share.failed.title": "فشل مشاركة الجلسة", + "toast.session.share.failed.description": "حدث خطأ أثناء مشاركة الجلسة", + + "toast.session.unshare.success.title": "تم إلغاء مشاركة الجلسة", + "toast.session.unshare.success.description": "تم إلغاء مشاركة الجلسة بنجاح!", + "toast.session.unshare.failed.title": "فشل إلغاء مشاركة الجلسة", + "toast.session.unshare.failed.description": "حدث خطأ أثناء إلغاء مشاركة الجلسة", + + "toast.session.listFailed.title": "فشل تحميل الجلسات لـ {{project}}", + + "toast.update.title": "تحديث متاح", + "toast.update.description": "نسخة جديدة من OpenCode ({{version}}) متاحة الآن للتثبيت.", + "toast.update.action.installRestart": "تثبيت وإعادة تشغيل", + "toast.update.action.notYet": "ليس الآن", + + "error.page.title": "حدث خطأ ما", + "error.page.description": "حدث خطأ أثناء تحميل التطبيق.", + "error.page.details.label": "تفاصيل الخطأ", + "error.page.action.restart": "إعادة تشغيل", + "error.page.action.checking": "جارٍ التحقق...", + "error.page.action.checkUpdates": "التحقق من وجود تحديثات", + "error.page.action.updateTo": "تحديث إلى {{version}}", + "error.page.report.prefix": "يرجى الإبلاغ عن هذا الخطأ لفريق OpenCode", + "error.page.report.discord": "على Discord", + "error.page.version": "الإصدار: {{version}}", + + "error.dev.rootNotFound": + "لم يتم العثور على العنصر الجذري. هل نسيت إضافته إلى index.html؟ أو ربما تمت كتابة سمة id بشكل خاطئ؟", + + "error.globalSync.connectFailed": "تعذر الاتصال بالخادم. هل هناك خادم يعمل في `{{url}}`؟", + + "error.chain.unknown": "خطأ غير معروف", + "error.chain.causedBy": "بسبب:", + "error.chain.apiError": "خطأ API", + "error.chain.status": "الحالة: {{status}}", + "error.chain.retryable": "قابل لإعادة المحاولة: {{retryable}}", + "error.chain.responseBody": "نص الاستجابة:\n{{body}}", + "error.chain.didYouMean": "هل كنت تعني: {{suggestions}}", + "error.chain.modelNotFound": "النموذج غير موجود: {{provider}}/{{model}}", + "error.chain.checkConfig": "تحقق من أسماء الموفر/النموذج في التكوين (opencode.json)", + "error.chain.mcpFailed": 'فشل خادم MCP "{{name}}". لاحظ أن OpenCode لا يدعم مصادقة MCP بعد.', + "error.chain.providerAuthFailed": "فشلت مصادقة الموفر ({{provider}}): {{message}}", + "error.chain.providerInitFailed": 'فشل تهيئة الموفر "{{provider}}". تحقق من بيانات الاعتماد والتكوين.', + "error.chain.configJsonInvalid": "ملف التكوين في {{path}} ليس JSON(C) صالحًا", + "error.chain.configJsonInvalidWithMessage": "ملف التكوين في {{path}} ليس JSON(C) صالحًا: {{message}}", + "error.chain.configDirectoryTypo": + 'الدليل "{{dir}}" في {{path}} غير صالح. أعد تسمية الدليل إلى "{{suggestion}}" أو قم بإزالته. هذا خطأ مطبعي شائع.', + "error.chain.configFrontmatterError": "فشل تحليل frontmatter في {{path}}:\n{{message}}", + "error.chain.configInvalid": "ملف التكوين في {{path}} غير صالح", + "error.chain.configInvalidWithMessage": "ملف التكوين في {{path}} غير صالح: {{message}}", + + "notification.permission.title": "مطلوب إذن", + "notification.permission.description": "{{sessionTitle}} في {{projectName}} يحتاج إلى إذن", + "notification.question.title": "سؤال", + "notification.question.description": "{{sessionTitle}} في {{projectName}} لديه سؤال", + "notification.action.goToSession": "انتقل إلى الجلسة", + + "notification.session.responseReady.title": "الاستجابة جاهزة", + "notification.session.error.title": "خطأ في الجلسة", + "notification.session.error.fallbackDescription": "حدث خطأ", + + "home.recentProjects": "المشاريع الحديثة", + "home.empty.title": "لا توجد مشاريع حديثة", + "home.empty.description": "ابدأ بفتح مشروع محلي", + + "session.tab.session": "جلسة", + "session.tab.review": "مراجعة", + "session.tab.context": "سياق", + "session.panel.reviewAndFiles": "المراجعة والملفات", + "session.review.filesChanged": "تم تغيير {{count}} ملفات", + "session.review.loadingChanges": "جارٍ تحميل التغييرات...", + "session.review.empty": "لا توجد تغييرات في هذه الجلسة بعد", + "session.messages.renderEarlier": "عرض الرسائل السابقة", + "session.messages.loadingEarlier": "جارٍ تحميل الرسائل السابقة...", + "session.messages.loadEarlier": "تحميل الرسائل السابقة", + "session.messages.loading": "جارٍ تحميل الرسائل...", + "session.messages.jumpToLatest": "الانتقال إلى الأحدث", + + "session.context.addToContext": "إضافة {{selection}} إلى السياق", + + "session.new.worktree.main": "الفرع الرئيسي", + "session.new.worktree.mainWithBranch": "الفرع الرئيسي ({{branch}})", + "session.new.worktree.create": "إنشاء شجرة عمل جديدة", + "session.new.lastModified": "آخر تعديل", + + "session.header.search.placeholder": "بحث {{project}}", + "session.header.searchFiles": "بحث عن الملفات", + + "session.share.popover.title": "نشر على الويب", + "session.share.popover.description.shared": "هذه الجلسة عامة على الويب. يمكن لأي شخص لديه الرابط الوصول إليها.", + "session.share.popover.description.unshared": "شارك الجلسة علنًا على الويب. ستكون متاحة لأي شخص لديه الرابط.", + "session.share.action.share": "مشاركة", + "session.share.action.publish": "نشر", + "session.share.action.publishing": "جارٍ النشر...", + "session.share.action.unpublish": "إلغاء النشر", + "session.share.action.unpublishing": "جارٍ إلغاء النشر...", + "session.share.action.view": "عرض", + "session.share.copy.copied": "تم النسخ", + "session.share.copy.copyLink": "نسخ الرابط", + + "lsp.tooltip.none": "لا توجد خوادم LSP", + "lsp.label.connected": "{{count}} LSP", + + "prompt.loading": "جارٍ تحميل الموجه...", + "terminal.loading": "جارٍ تحميل المحطة الطرفية...", + "terminal.title": "محطة طرفية", + "terminal.title.numbered": "محطة طرفية {{number}}", + "terminal.close": "إغلاق المحطة الطرفية", + "terminal.connectionLost.title": "فقد الاتصال", + "terminal.connectionLost.description": "انقطع اتصال المحطة الطرفية. يمكن أن يحدث هذا عند إعادة تشغيل الخادم.", + + "common.closeTab": "إغلاق علامة التبويب", + "common.dismiss": "رفض", + "common.requestFailed": "فشل الطلب", + "common.moreOptions": "مزيد من الخيارات", + "common.learnMore": "اعرف المزيد", + "common.rename": "إعادة تسمية", + "common.reset": "إعادة تعيين", + "common.archive": "أرشفة", + "common.delete": "حذف", + "common.close": "إغلاق", + "common.edit": "تحرير", + "common.loadMore": "تحميل المزيد", + "common.key.esc": "ESC", + + "sidebar.menu.toggle": "تبديل القائمة", + "sidebar.nav.projectsAndSessions": "المشاريع والجلسات", + "sidebar.settings": "الإعدادات", + "sidebar.help": "مساعدة", + "sidebar.workspaces.enable": "تمكين مساحات العمل", + "sidebar.workspaces.disable": "تعطيل مساحات العمل", + "sidebar.gettingStarted.title": "البدء", + "sidebar.gettingStarted.line1": "يتضمن OpenCode نماذج مجانية حتى تتمكن من البدء فورًا.", + "sidebar.gettingStarted.line2": "قم بتوصيل أي موفر لاستخدام النماذج، بما في ذلك Claude و GPT و Gemini وما إلى ذلك.", + "sidebar.project.recentSessions": "الجلسات الحديثة", + "sidebar.project.viewAllSessions": "عرض جميع الجلسات", + + "settings.section.desktop": "سطح المكتب", + "settings.tab.general": "عام", + "settings.tab.shortcuts": "اختصارات", + + "settings.general.section.appearance": "المظهر", + "settings.general.section.notifications": "إشعارات النظام", + "settings.general.section.sounds": "المؤثرات الصوتية", + + "settings.general.row.language.title": "اللغة", + "settings.general.row.language.description": "تغيير لغة العرض لـ OpenCode", + "settings.general.row.appearance.title": "المظهر", + "settings.general.row.appearance.description": "تخصيص كيفية ظهور OpenCode على جهازك", + "settings.general.row.theme.title": "السمة", + "settings.general.row.theme.description": "تخصيص سمة OpenCode.", + "settings.general.row.font.title": "الخط", + "settings.general.row.font.description": "تخصيص الخط الأحادي المستخدم في كتل التعليمات البرمجية", + "font.option.ibmPlexMono": "IBM Plex Mono", + "font.option.cascadiaCode": "Cascadia Code", + "font.option.firaCode": "Fira Code", + "font.option.hack": "Hack", + "font.option.inconsolata": "Inconsolata", + "font.option.intelOneMono": "Intel One Mono", + "font.option.jetbrainsMono": "JetBrains Mono", + "font.option.mesloLgs": "Meslo LGS", + "font.option.robotoMono": "Roboto Mono", + "font.option.sourceCodePro": "Source Code Pro", + "font.option.ubuntuMono": "Ubuntu Mono", + "sound.option.alert01": "تنبيه 01", + "sound.option.alert02": "تنبيه 02", + "sound.option.alert03": "تنبيه 03", + "sound.option.alert04": "تنبيه 04", + "sound.option.alert05": "تنبيه 05", + "sound.option.alert06": "تنبيه 06", + "sound.option.alert07": "تنبيه 07", + "sound.option.alert08": "تنبيه 08", + "sound.option.alert09": "تنبيه 09", + "sound.option.alert10": "تنبيه 10", + "sound.option.bipbop01": "بيب بوب 01", + "sound.option.bipbop02": "بيب بوب 02", + "sound.option.bipbop03": "بيب بوب 03", + "sound.option.bipbop04": "بيب بوب 04", + "sound.option.bipbop05": "بيب بوب 05", + "sound.option.bipbop06": "بيب بوب 06", + "sound.option.bipbop07": "بيب بوب 07", + "sound.option.bipbop08": "بيب بوب 08", + "sound.option.bipbop09": "بيب بوب 09", + "sound.option.bipbop10": "بيب بوب 10", + "sound.option.staplebops01": "ستابل بوبس 01", + "sound.option.staplebops02": "ستابل بوبس 02", + "sound.option.staplebops03": "ستابل بوبس 03", + "sound.option.staplebops04": "ستابل بوبس 04", + "sound.option.staplebops05": "ستابل بوبس 05", + "sound.option.staplebops06": "ستابل بوبس 06", + "sound.option.staplebops07": "ستابل بوبس 07", + "sound.option.nope01": "كلا 01", + "sound.option.nope02": "كلا 02", + "sound.option.nope03": "كلا 03", + "sound.option.nope04": "كلا 04", + "sound.option.nope05": "كلا 05", + "sound.option.nope06": "كلا 06", + "sound.option.nope07": "كلا 07", + "sound.option.nope08": "كلا 08", + "sound.option.nope09": "كلا 09", + "sound.option.nope10": "كلا 10", + "sound.option.nope11": "كلا 11", + "sound.option.nope12": "كلا 12", + "sound.option.yup01": "نعم 01", + "sound.option.yup02": "نعم 02", + "sound.option.yup03": "نعم 03", + "sound.option.yup04": "نعم 04", + "sound.option.yup05": "نعم 05", + "sound.option.yup06": "نعم 06", + + "settings.general.notifications.agent.title": "وكيل", + "settings.general.notifications.agent.description": "عرض إشعار النظام عندما يكتمل الوكيل أو يحتاج إلى اهتمام", + "settings.general.notifications.permissions.title": "أذونات", + "settings.general.notifications.permissions.description": "عرض إشعار النظام عند الحاجة إلى إذن", + "settings.general.notifications.errors.title": "أخطاء", + "settings.general.notifications.errors.description": "عرض إشعار النظام عند حدوث خطأ", + + "settings.general.sounds.agent.title": "وكيل", + "settings.general.sounds.agent.description": "تشغيل صوت عندما يكتمل الوكيل أو يحتاج إلى اهتمام", + "settings.general.sounds.permissions.title": "أذونات", + "settings.general.sounds.permissions.description": "تشغيل صوت عند الحاجة إلى إذن", + "settings.general.sounds.errors.title": "أخطاء", + "settings.general.sounds.errors.description": "تشغيل صوت عند حدوث خطأ", + + "settings.shortcuts.title": "اختصارات لوحة المفاتيح", + "settings.shortcuts.reset.button": "إعادة التعيين إلى الافتراضيات", + "settings.shortcuts.reset.toast.title": "تم إعادة تعيين الاختصارات", + "settings.shortcuts.reset.toast.description": "تم إعادة تعيين اختصارات لوحة المفاتيح إلى الافتراضيات.", + "settings.shortcuts.conflict.title": "الاختصار قيد الاستخدام بالفعل", + "settings.shortcuts.conflict.description": "{{keybind}} معين بالفعل لـ {{titles}}.", + "settings.shortcuts.unassigned": "غير معين", + "settings.shortcuts.pressKeys": "اضغط على المفاتيح", + "settings.shortcuts.search.placeholder": "البحث في الاختصارات", + "settings.shortcuts.search.empty": "لم يتم العثور على اختصارات", + + "settings.shortcuts.group.general": "عام", + "settings.shortcuts.group.session": "جلسة", + "settings.shortcuts.group.navigation": "تصفح", + "settings.shortcuts.group.modelAndAgent": "النموذج والوكيل", + "settings.shortcuts.group.terminal": "المحطة الطرفية", + "settings.shortcuts.group.prompt": "موجه", + + "settings.providers.title": "الموفرون", + "settings.providers.description": "ستكون إعدادات الموفر قابلة للتكوين هنا.", + "settings.models.title": "النماذج", + "settings.models.description": "ستكون إعدادات النموذج قابلة للتكوين هنا.", + "settings.agents.title": "الوكلاء", + "settings.agents.description": "ستكون إعدادات الوكيل قابلة للتكوين هنا.", + "settings.commands.title": "الأوامر", + "settings.commands.description": "ستكون إعدادات الأمر قابلة للتكوين هنا.", + "settings.mcp.title": "MCP", + "settings.mcp.description": "ستكون إعدادات MCP قابلة للتكوين هنا.", + + "settings.permissions.title": "الأذونات", + "settings.permissions.description": "تحكم في الأدوات التي يمكن للخادم استخدامها بشكل افتراضي.", + "settings.permissions.section.tools": "الأدوات", + "settings.permissions.toast.updateFailed.title": "فشل تحديث الأذونات", + + "settings.permissions.action.allow": "سماح", + "settings.permissions.action.ask": "سؤال", + "settings.permissions.action.deny": "رفض", + + "settings.permissions.tool.read.title": "قراءة", + "settings.permissions.tool.read.description": "قراءة ملف (يطابق مسار الملف)", + "settings.permissions.tool.edit.title": "تحرير", + "settings.permissions.tool.edit.description": + "تعديل الملفات، بما في ذلك التحرير والكتابة والتصحيحات والتحرير المتعدد", + "settings.permissions.tool.glob.title": "Glob", + "settings.permissions.tool.glob.description": "مطابقة الملفات باستخدام أنماط glob", + "settings.permissions.tool.grep.title": "Grep", + "settings.permissions.tool.grep.description": "البحث في محتويات الملف باستخدام التعبيرات العادية", + "settings.permissions.tool.list.title": "قائمة", + "settings.permissions.tool.list.description": "سرد الملفات داخل دليل", + "settings.permissions.tool.bash.title": "Bash", + "settings.permissions.tool.bash.description": "تشغيل أوامر shell", + "settings.permissions.tool.task.title": "Task", + "settings.permissions.tool.task.description": "تشغيل الوكلاء الفرعيين", + "settings.permissions.tool.skill.title": "Skill", + "settings.permissions.tool.skill.description": "تحميل مهارة بالاسم", + "settings.permissions.tool.lsp.title": "LSP", + "settings.permissions.tool.lsp.description": "تشغيل استعلامات خادم اللغة", + "settings.permissions.tool.todoread.title": "قراءة المهام", + "settings.permissions.tool.todoread.description": "قراءة قائمة المهام", + "settings.permissions.tool.todowrite.title": "كتابة المهام", + "settings.permissions.tool.todowrite.description": "تحديث قائمة المهام", + "settings.permissions.tool.webfetch.title": "جلب الويب", + "settings.permissions.tool.webfetch.description": "جلب محتوى من عنوان URL", + "settings.permissions.tool.websearch.title": "بحث الويب", + "settings.permissions.tool.websearch.description": "البحث في الويب", + "settings.permissions.tool.codesearch.title": "بحث الكود", + "settings.permissions.tool.codesearch.description": "البحث عن كود على الويب", + "settings.permissions.tool.external_directory.title": "دليل خارجي", + "settings.permissions.tool.external_directory.description": "الوصول إلى الملفات خارج دليل المشروع", + "settings.permissions.tool.doom_loop.title": "حلقة الموت", + "settings.permissions.tool.doom_loop.description": "اكتشاف استدعاءات الأدوات المتكررة بمدخلات متطابقة", + + "session.delete.failed.title": "فشل حذف الجلسة", + "session.delete.title": "حذف الجلسة", + "session.delete.confirm": 'حذف الجلسة "{{name}}"؟', + "session.delete.button": "حذف الجلسة", + + "workspace.new": "مساحة عمل جديدة", + "workspace.type.local": "محلي", + "workspace.type.sandbox": "صندوق رمل", + "workspace.create.failed.title": "فشل إنشاء مساحة العمل", + "workspace.delete.failed.title": "فشل حذف مساحة العمل", + "workspace.resetting.title": "إعادة تعيين مساحة العمل", + "workspace.resetting.description": "قد يستغرق هذا دقيقة.", + "workspace.reset.failed.title": "فشل إعادة تعيين مساحة العمل", + "workspace.reset.success.title": "تمت إعادة تعيين مساحة العمل", + "workspace.reset.success.description": "مساحة العمل تطابق الآن الفرع الافتراضي.", + "workspace.status.checking": "التحقق من التغييرات غير المدمجة...", + "workspace.status.error": "تعذر التحقق من حالة git.", + "workspace.status.clean": "لم يتم اكتشاف تغييرات غير مدمجة.", + "workspace.status.dirty": "تم اكتشاف تغييرات غير مدمجة في مساحة العمل هذه.", + "workspace.delete.title": "حذف مساحة العمل", + "workspace.delete.confirm": 'حذف مساحة العمل "{{name}}"؟', + "workspace.delete.button": "حذف مساحة العمل", + "workspace.reset.title": "إعادة تعيين مساحة العمل", + "workspace.reset.confirm": 'إعادة تعيين مساحة العمل "{{name}}"؟', + "workspace.reset.button": "إعادة تعيين مساحة العمل", + "workspace.reset.archived.none": "لن تتم أرشفة أي جلسات نشطة.", + "workspace.reset.archived.one": "ستتم أرشفة جلسة واحدة.", + "workspace.reset.archived.many": "ستتم أرشفة {{count}} جلسات.", + "workspace.reset.note": "سيؤدي هذا إلى إعادة تعيين مساحة العمل لتتطابق مع الفرع الافتراضي.", +} diff --git a/packages/app/src/i18n/br.ts b/packages/app/src/i18n/br.ts new file mode 100644 index 00000000000..af9a71b16fd --- /dev/null +++ b/packages/app/src/i18n/br.ts @@ -0,0 +1,665 @@ +export const dict = { + "command.category.suggested": "Sugerido", + "command.category.view": "Visualizar", + "command.category.project": "Projeto", + "command.category.provider": "Provedor", + "command.category.server": "Servidor", + "command.category.session": "Sessão", + "command.category.theme": "Tema", + "command.category.language": "Idioma", + "command.category.file": "Arquivo", + "command.category.terminal": "Terminal", + "command.category.model": "Modelo", + "command.category.mcp": "MCP", + "command.category.agent": "Agente", + "command.category.permissions": "Permissões", + "command.category.workspace": "Espaço de trabalho", + "command.category.settings": "Configurações", + + "theme.scheme.system": "Sistema", + "theme.scheme.light": "Claro", + "theme.scheme.dark": "Escuro", + + "command.sidebar.toggle": "Alternar barra lateral", + "command.project.open": "Abrir projeto", + "command.provider.connect": "Conectar provedor", + "command.server.switch": "Trocar servidor", + "command.settings.open": "Abrir configurações", + "command.session.previous": "Sessão anterior", + "command.session.next": "Próxima sessão", + "command.session.archive": "Arquivar sessão", + + "command.palette": "Paleta de comandos", + + "command.theme.cycle": "Alternar tema", + "command.theme.set": "Usar tema: {{theme}}", + "command.theme.scheme.cycle": "Alternar esquema de cores", + "command.theme.scheme.set": "Usar esquema de cores: {{scheme}}", + + "command.language.cycle": "Alternar idioma", + "command.language.set": "Usar idioma: {{language}}", + + "command.session.new": "Nova sessão", + "command.file.open": "Abrir arquivo", + "command.file.open.description": "Buscar arquivos e comandos", + "command.terminal.toggle": "Alternar terminal", + "command.review.toggle": "Alternar revisão", + "command.terminal.new": "Novo terminal", + "command.terminal.new.description": "Criar uma nova aba de terminal", + "command.steps.toggle": "Alternar passos", + "command.steps.toggle.description": "Mostrar ou ocultar passos da mensagem atual", + "command.message.previous": "Mensagem anterior", + "command.message.previous.description": "Ir para a mensagem de usuário anterior", + "command.message.next": "Próxima mensagem", + "command.message.next.description": "Ir para a próxima mensagem de usuário", + "command.model.choose": "Escolher modelo", + "command.model.choose.description": "Selecionar um modelo diferente", + "command.mcp.toggle": "Alternar MCPs", + "command.mcp.toggle.description": "Alternar MCPs", + "command.agent.cycle": "Alternar agente", + "command.agent.cycle.description": "Mudar para o próximo agente", + "command.agent.cycle.reverse": "Alternar agente (reverso)", + "command.agent.cycle.reverse.description": "Mudar para o agente anterior", + "command.model.variant.cycle": "Alternar nível de raciocínio", + "command.model.variant.cycle.description": "Mudar para o próximo nível de esforço", + "command.permissions.autoaccept.enable": "Aceitar edições automaticamente", + "command.permissions.autoaccept.disable": "Parar de aceitar edições automaticamente", + "command.session.undo": "Desfazer", + "command.session.undo.description": "Desfazer a última mensagem", + "command.session.redo": "Refazer", + "command.session.redo.description": "Refazer a última mensagem desfeita", + "command.session.compact": "Compactar sessão", + "command.session.compact.description": "Resumir a sessão para reduzir o tamanho do contexto", + "command.session.fork": "Bifurcar da mensagem", + "command.session.fork.description": "Criar uma nova sessão a partir de uma mensagem anterior", + "command.session.share": "Compartilhar sessão", + "command.session.share.description": "Compartilhar esta sessão e copiar a URL para a área de transferência", + "command.session.unshare": "Parar de compartilhar sessão", + "command.session.unshare.description": "Parar de compartilhar esta sessão", + + "palette.search.placeholder": "Buscar arquivos e comandos", + "palette.empty": "Nenhum resultado encontrado", + "palette.group.commands": "Comandos", + "palette.group.files": "Arquivos", + + "dialog.provider.search.placeholder": "Buscar provedores", + "dialog.provider.empty": "Nenhum provedor encontrado", + "dialog.provider.group.popular": "Popular", + "dialog.provider.group.other": "Outro", + "dialog.provider.tag.recommended": "Recomendado", + "dialog.provider.anthropic.note": "Conectar com Claude Pro/Max ou chave de API", + + "dialog.model.select.title": "Selecionar modelo", + "dialog.model.search.placeholder": "Buscar modelos", + "dialog.model.empty": "Nenhum resultado de modelo", + "dialog.model.manage": "Gerenciar modelos", + "dialog.model.manage.description": "Personalizar quais modelos aparecem no seletor de modelos.", + + "dialog.model.unpaid.freeModels.title": "Modelos gratuitos fornecidos pelo OpenCode", + "dialog.model.unpaid.addMore.title": "Adicionar mais modelos de provedores populares", + + "dialog.provider.viewAll": "Ver todos os provedores", + + "provider.connect.title": "Conectar {{provider}}", + "provider.connect.title.anthropicProMax": "Entrar com Claude Pro/Max", + "provider.connect.selectMethod": "Selecionar método de login para {{provider}}.", + "provider.connect.method.apiKey": "Chave de API", + "provider.connect.status.inProgress": "Autorização em andamento...", + "provider.connect.status.waiting": "Aguardando autorização...", + "provider.connect.status.failed": "Autorização falhou: {{error}}", + "provider.connect.apiKey.description": + "Digite sua chave de API do {{provider}} para conectar sua conta e usar modelos do {{provider}} no OpenCode.", + "provider.connect.apiKey.label": "Chave de API do {{provider}}", + "provider.connect.apiKey.placeholder": "Chave de API", + "provider.connect.apiKey.required": "A chave de API é obrigatória", + "provider.connect.opencodeZen.line1": + "OpenCode Zen oferece acesso a um conjunto selecionado de modelos confiáveis otimizados para agentes de código.", + "provider.connect.opencodeZen.line2": + "Com uma única chave de API você terá acesso a modelos como Claude, GPT, Gemini, GLM e mais.", + "provider.connect.opencodeZen.visit.prefix": "Visite ", + "provider.connect.opencodeZen.visit.link": "opencode.ai/zen", + "provider.connect.opencodeZen.visit.suffix": " para obter sua chave de API.", + "provider.connect.oauth.code.visit.prefix": "Visite ", + "provider.connect.oauth.code.visit.link": "este link", + "provider.connect.oauth.code.visit.suffix": + " para obter seu código de autorização e conectar sua conta para usar modelos do {{provider}} no OpenCode.", + "provider.connect.oauth.code.label": "Código de autorização {{method}}", + "provider.connect.oauth.code.placeholder": "Código de autorização", + "provider.connect.oauth.code.required": "O código de autorização é obrigatório", + "provider.connect.oauth.code.invalid": "Código de autorização inválido", + "provider.connect.oauth.auto.visit.prefix": "Visite ", + "provider.connect.oauth.auto.visit.link": "este link", + "provider.connect.oauth.auto.visit.suffix": + " e digite o código abaixo para conectar sua conta e usar modelos do {{provider}} no OpenCode.", + "provider.connect.oauth.auto.confirmationCode": "Código de confirmação", + "provider.connect.toast.connected.title": "{{provider}} conectado", + "provider.connect.toast.connected.description": "Modelos do {{provider}} agora estão disponíveis para uso.", + + "model.tag.free": "Grátis", + "model.tag.latest": "Mais recente", + "model.provider.anthropic": "Anthropic", + "model.provider.openai": "OpenAI", + "model.provider.google": "Google", + "model.provider.xai": "xAI", + "model.provider.meta": "Meta", + "model.input.text": "texto", + "model.input.image": "imagem", + "model.input.audio": "áudio", + "model.input.video": "vídeo", + "model.input.pdf": "pdf", + "model.tooltip.allows": "Permite: {{inputs}}", + "model.tooltip.reasoning.allowed": "Permite raciocínio", + "model.tooltip.reasoning.none": "Sem raciocínio", + "model.tooltip.context": "Limite de contexto {{limit}}", + + "common.search.placeholder": "Buscar", + "common.goBack": "Voltar", + "common.loading": "Carregando", + "common.loading.ellipsis": "...", + "common.cancel": "Cancelar", + "common.submit": "Enviar", + "common.save": "Salvar", + "common.saving": "Salvando...", + "common.default": "Padrão", + "common.attachment": "anexo", + + "prompt.placeholder.shell": "Digite comando do shell...", + "prompt.placeholder.normal": 'Pergunte qualquer coisa... "{{example}}"', + "prompt.mode.shell": "Shell", + "prompt.mode.shell.exit": "esc para sair", + + "prompt.example.1": "Corrigir um TODO no código", + "prompt.example.2": "Qual é a stack tecnológica deste projeto?", + "prompt.example.3": "Corrigir testes quebrados", + "prompt.example.4": "Explicar como funciona a autenticação", + "prompt.example.5": "Encontrar e corrigir vulnerabilidades de segurança", + "prompt.example.6": "Adicionar testes unitários para o serviço de usuário", + "prompt.example.7": "Refatorar esta função para melhor legibilidade", + "prompt.example.8": "O que significa este erro?", + "prompt.example.9": "Me ajude a depurar este problema", + "prompt.example.10": "Gerar documentação da API", + "prompt.example.11": "Otimizar consultas ao banco de dados", + "prompt.example.12": "Adicionar validação de entrada", + "prompt.example.13": "Criar um novo componente para...", + "prompt.example.14": "Como faço o deploy deste projeto?", + "prompt.example.15": "Revisar meu código para boas práticas", + "prompt.example.16": "Adicionar tratamento de erros a esta função", + "prompt.example.17": "Explicar este padrão regex", + "prompt.example.18": "Converter isto para TypeScript", + "prompt.example.19": "Adicionar logging em todo o código", + "prompt.example.20": "Quais dependências estão desatualizadas?", + "prompt.example.21": "Me ajude a escrever um script de migração", + "prompt.example.22": "Implementar cache para este endpoint", + "prompt.example.23": "Adicionar paginação a esta lista", + "prompt.example.24": "Criar um comando CLI para...", + "prompt.example.25": "Como funcionam as variáveis de ambiente aqui?", + + "prompt.popover.emptyResults": "Nenhum resultado correspondente", + "prompt.popover.emptyCommands": "Nenhum comando correspondente", + "prompt.dropzone.label": "Solte imagens ou PDFs aqui", + "prompt.slash.badge.custom": "personalizado", + "prompt.context.active": "ativo", + "prompt.context.includeActiveFile": "Incluir arquivo ativo", + "prompt.context.removeActiveFile": "Remover arquivo ativo do contexto", + "prompt.context.removeFile": "Remover arquivo do contexto", + "prompt.action.attachFile": "Anexar arquivo", + "prompt.attachment.remove": "Remover anexo", + "prompt.action.send": "Enviar", + "prompt.action.stop": "Parar", + + "prompt.toast.pasteUnsupported.title": "Colagem não suportada", + "prompt.toast.pasteUnsupported.description": "Somente imagens ou PDFs podem ser colados aqui.", + "prompt.toast.modelAgentRequired.title": "Selecione um agente e modelo", + "prompt.toast.modelAgentRequired.description": "Escolha um agente e modelo antes de enviar um prompt.", + "prompt.toast.worktreeCreateFailed.title": "Falha ao criar worktree", + "prompt.toast.sessionCreateFailed.title": "Falha ao criar sessão", + "prompt.toast.shellSendFailed.title": "Falha ao enviar comando shell", + "prompt.toast.commandSendFailed.title": "Falha ao enviar comando", + "prompt.toast.promptSendFailed.title": "Falha ao enviar prompt", + + "dialog.mcp.title": "MCPs", + "dialog.mcp.description": "{{enabled}} de {{total}} habilitados", + "dialog.mcp.empty": "Nenhum MCP configurado", + + "mcp.status.connected": "conectado", + "mcp.status.failed": "falhou", + "mcp.status.needs_auth": "precisa de autenticação", + "mcp.status.disabled": "desabilitado", + + "dialog.fork.empty": "Nenhuma mensagem para bifurcar", + + "dialog.directory.search.placeholder": "Buscar pastas", + "dialog.directory.empty": "Nenhuma pasta encontrada", + + "dialog.server.title": "Servidores", + "dialog.server.description": "Trocar para qual servidor OpenCode este aplicativo se conecta.", + "dialog.server.search.placeholder": "Buscar servidores", + "dialog.server.empty": "Nenhum servidor ainda", + "dialog.server.add.title": "Adicionar um servidor", + "dialog.server.add.url": "URL do servidor", + "dialog.server.add.placeholder": "http://localhost:4096", + "dialog.server.add.error": "Não foi possível conectar ao servidor", + "dialog.server.add.checking": "Verificando...", + "dialog.server.add.button": "Adicionar", + "dialog.server.default.title": "Servidor padrão", + "dialog.server.default.description": + "Conectar a este servidor na inicialização do aplicativo ao invés de iniciar um servidor local. Requer reinicialização.", + "dialog.server.default.none": "Nenhum servidor selecionado", + "dialog.server.default.set": "Definir servidor atual como padrão", + "dialog.server.default.clear": "Limpar", + "dialog.server.action.remove": "Remover servidor", + + "dialog.project.edit.title": "Editar projeto", + "dialog.project.edit.name": "Nome", + "dialog.project.edit.icon": "Ícone", + "dialog.project.edit.icon.alt": "Ícone do projeto", + "dialog.project.edit.icon.hint": "Clique ou arraste uma imagem", + "dialog.project.edit.icon.recommended": "Recomendado: 128x128px", + "dialog.project.edit.color": "Cor", + "dialog.project.edit.color.select": "Selecionar cor {{color}}", + "dialog.project.edit.worktree.startup": "Script de inicialização do espaço de trabalho", + "dialog.project.edit.worktree.startup.description": "Executa após criar um novo espaço de trabalho (worktree).", + "dialog.project.edit.worktree.startup.placeholder": "ex: bun install", + + "context.breakdown.title": "Detalhamento do Contexto", + "context.breakdown.note": + 'Detalhamento aproximado dos tokens de entrada. "Outros" inclui definições de ferramentas e overhead.', + "context.breakdown.system": "Sistema", + "context.breakdown.user": "Usuário", + "context.breakdown.assistant": "Assistente", + "context.breakdown.tool": "Chamadas de Ferramentas", + "context.breakdown.other": "Outros", + + "context.systemPrompt.title": "Prompt do Sistema", + "context.rawMessages.title": "Mensagens brutas", + + "context.stats.session": "Sessão", + "context.stats.messages": "Mensagens", + "context.stats.provider": "Provedor", + "context.stats.model": "Modelo", + "context.stats.limit": "Limite de Contexto", + "context.stats.totalTokens": "Total de Tokens", + "context.stats.usage": "Uso", + "context.stats.inputTokens": "Tokens de Entrada", + "context.stats.outputTokens": "Tokens de Saída", + "context.stats.reasoningTokens": "Tokens de Raciocínio", + "context.stats.cacheTokens": "Tokens de Cache (leitura/escrita)", + "context.stats.userMessages": "Mensagens de Usuário", + "context.stats.assistantMessages": "Mensagens do Assistente", + "context.stats.totalCost": "Custo Total", + "context.stats.sessionCreated": "Sessão Criada", + "context.stats.lastActivity": "Última Atividade", + + "context.usage.tokens": "Tokens", + "context.usage.usage": "Uso", + "context.usage.cost": "Custo", + "context.usage.clickToView": "Clique para ver o contexto", + "context.usage.view": "Ver uso do contexto", + + "language.en": "Inglês", + "language.zh": "Chinês (Simplificado)", + "language.zht": "Chinês (Tradicional)", + "language.ko": "Coreano", + "language.de": "Alemão", + "language.es": "Espanhol", + "language.fr": "Francês", + "language.ja": "Japonês", + "language.da": "Dinamarquês", + "language.ru": "Russo", + "language.pl": "Polonês", + "language.ar": "Árabe", + "language.no": "Norueguês", + "language.br": "Português (Brasil)", + + "toast.language.title": "Idioma", + "toast.language.description": "Alterado para {{language}}", + + "toast.theme.title": "Tema alterado", + "toast.scheme.title": "Esquema de cores", + + "toast.permissions.autoaccept.on.title": "Aceitando edições automaticamente", + "toast.permissions.autoaccept.on.description": "Permissões de edição e escrita serão aprovadas automaticamente", + "toast.permissions.autoaccept.off.title": "Parou de aceitar edições automaticamente", + "toast.permissions.autoaccept.off.description": "Permissões de edição e escrita exigirão aprovação", + + "toast.model.none.title": "Nenhum modelo selecionado", + "toast.model.none.description": "Conecte um provedor para resumir esta sessão", + + "toast.file.loadFailed.title": "Falha ao carregar arquivo", + + "toast.session.share.copyFailed.title": "Falha ao copiar URL para a área de transferência", + "toast.session.share.success.title": "Sessão compartilhada", + "toast.session.share.success.description": "URL compartilhada copiada para a área de transferência!", + "toast.session.share.failed.title": "Falha ao compartilhar sessão", + "toast.session.share.failed.description": "Ocorreu um erro ao compartilhar a sessão", + + "toast.session.unshare.success.title": "Sessão não compartilhada", + "toast.session.unshare.success.description": "Sessão deixou de ser compartilhada com sucesso!", + "toast.session.unshare.failed.title": "Falha ao parar de compartilhar sessão", + "toast.session.unshare.failed.description": "Ocorreu um erro ao parar de compartilhar a sessão", + + "toast.session.listFailed.title": "Falha ao carregar sessões para {{project}}", + + "toast.update.title": "Atualização disponível", + "toast.update.description": "Uma nova versão do OpenCode ({{version}}) está disponível para instalação.", + "toast.update.action.installRestart": "Instalar e reiniciar", + "toast.update.action.notYet": "Agora não", + + "error.page.title": "Algo deu errado", + "error.page.description": "Ocorreu um erro ao carregar a aplicação.", + "error.page.details.label": "Detalhes do Erro", + "error.page.action.restart": "Reiniciar", + "error.page.action.checking": "Verificando...", + "error.page.action.checkUpdates": "Verificar atualizações", + "error.page.action.updateTo": "Atualizar para {{version}}", + "error.page.report.prefix": "Por favor, reporte este erro para a equipe do OpenCode", + "error.page.report.discord": "no Discord", + "error.page.version": "Versão: {{version}}", + + "error.dev.rootNotFound": + "Elemento raiz não encontrado. Você esqueceu de adicioná-lo ao seu index.html? Ou talvez o atributo id foi escrito incorretamente?", + + "error.globalSync.connectFailed": "Não foi possível conectar ao servidor. Há um servidor executando em `{{url}}`?", + + "error.chain.unknown": "Erro desconhecido", + "error.chain.causedBy": "Causado por:", + "error.chain.apiError": "Erro de API", + "error.chain.status": "Status: {{status}}", + "error.chain.retryable": "Pode tentar novamente: {{retryable}}", + "error.chain.responseBody": "Corpo da resposta:\n{{body}}", + "error.chain.didYouMean": "Você quis dizer: {{suggestions}}", + "error.chain.modelNotFound": "Modelo não encontrado: {{provider}}/{{model}}", + "error.chain.checkConfig": "Verifique os nomes de provedor/modelo na sua configuração (opencode.json)", + "error.chain.mcpFailed": 'Servidor MCP "{{name}}" falhou. Nota: OpenCode ainda não suporta autenticação MCP.', + "error.chain.providerAuthFailed": "Autenticação do provedor falhou ({{provider}}): {{message}}", + "error.chain.providerInitFailed": + 'Falha ao inicializar provedor "{{provider}}". Verifique credenciais e configuração.', + "error.chain.configJsonInvalid": "Arquivo de configuração em {{path}} não é um JSON(C) válido", + "error.chain.configJsonInvalidWithMessage": + "Arquivo de configuração em {{path}} não é um JSON(C) válido: {{message}}", + "error.chain.configDirectoryTypo": + 'Diretório "{{dir}}" em {{path}} não é válido. Renomeie o diretório para "{{suggestion}}" ou remova-o. Este é um erro de digitação comum.', + "error.chain.configFrontmatterError": "Falha ao analisar frontmatter em {{path}}:\n{{message}}", + "error.chain.configInvalid": "Arquivo de configuração em {{path}} é inválido", + "error.chain.configInvalidWithMessage": "Arquivo de configuração em {{path}} é inválido: {{message}}", + + "notification.permission.title": "Permissão necessária", + "notification.permission.description": "{{sessionTitle}} em {{projectName}} precisa de permissão", + "notification.question.title": "Pergunta", + "notification.question.description": "{{sessionTitle}} em {{projectName}} tem uma pergunta", + "notification.action.goToSession": "Ir para sessão", + + "notification.session.responseReady.title": "Resposta pronta", + "notification.session.error.title": "Erro na sessão", + "notification.session.error.fallbackDescription": "Ocorreu um erro", + + "home.recentProjects": "Projetos recentes", + "home.empty.title": "Nenhum projeto recente", + "home.empty.description": "Comece abrindo um projeto local", + + "session.tab.session": "Sessão", + "session.tab.review": "Revisão", + "session.tab.context": "Contexto", + "session.panel.reviewAndFiles": "Revisão e arquivos", + "session.review.filesChanged": "{{count}} Arquivos Alterados", + "session.review.loadingChanges": "Carregando alterações...", + "session.review.empty": "Nenhuma alteração nesta sessão ainda", + "session.messages.renderEarlier": "Renderizar mensagens anteriores", + "session.messages.loadingEarlier": "Carregando mensagens anteriores...", + "session.messages.loadEarlier": "Carregar mensagens anteriores", + "session.messages.loading": "Carregando mensagens...", + "session.messages.jumpToLatest": "Ir para a mais recente", + + "session.context.addToContext": "Adicionar {{selection}} ao contexto", + + "session.new.worktree.main": "Branch principal", + "session.new.worktree.mainWithBranch": "Branch principal ({{branch}})", + "session.new.worktree.create": "Criar novo worktree", + "session.new.lastModified": "Última modificação", + + "session.header.search.placeholder": "Buscar {{project}}", + "session.header.searchFiles": "Buscar arquivos", + + "session.share.popover.title": "Publicar na web", + "session.share.popover.description.shared": + "Esta sessão é pública na web. Está acessível para qualquer pessoa com o link.", + "session.share.popover.description.unshared": + "Compartilhar sessão publicamente na web. Estará acessível para qualquer pessoa com o link.", + "session.share.action.share": "Compartilhar", + "session.share.action.publish": "Publicar", + "session.share.action.publishing": "Publicando...", + "session.share.action.unpublish": "Cancelar publicação", + "session.share.action.unpublishing": "Cancelando publicação...", + "session.share.action.view": "Ver", + "session.share.copy.copied": "Copiado", + "session.share.copy.copyLink": "Copiar link", + + "lsp.tooltip.none": "Nenhum servidor LSP", + "lsp.label.connected": "{{count}} LSP", + + "prompt.loading": "Carregando prompt...", + "terminal.loading": "Carregando terminal...", + "terminal.title": "Terminal", + "terminal.title.numbered": "Terminal {{number}}", + "terminal.close": "Fechar terminal", + "terminal.connectionLost.title": "Conexão Perdida", + "terminal.connectionLost.description": + "A conexão do terminal foi interrompida. Isso pode acontecer quando o servidor reinicia.", + + "common.closeTab": "Fechar aba", + "common.dismiss": "Descartar", + "common.requestFailed": "Requisição falhou", + "common.moreOptions": "Mais opções", + "common.learnMore": "Saiba mais", + "common.rename": "Renomear", + "common.reset": "Redefinir", + "common.archive": "Arquivar", + "common.delete": "Excluir", + "common.close": "Fechar", + "common.edit": "Editar", + "common.loadMore": "Carregar mais", + "common.key.esc": "ESC", + + "sidebar.menu.toggle": "Alternar menu", + "sidebar.nav.projectsAndSessions": "Projetos e sessões", + "sidebar.settings": "Configurações", + "sidebar.help": "Ajuda", + "sidebar.workspaces.enable": "Habilitar espaços de trabalho", + "sidebar.workspaces.disable": "Desabilitar espaços de trabalho", + "sidebar.gettingStarted.title": "Começando", + "sidebar.gettingStarted.line1": "OpenCode inclui modelos gratuitos para você começar imediatamente.", + "sidebar.gettingStarted.line2": "Conecte qualquer provedor para usar modelos, incluindo Claude, GPT, Gemini etc.", + "sidebar.project.recentSessions": "Sessões recentes", + "sidebar.project.viewAllSessions": "Ver todas as sessões", + + "settings.section.desktop": "Desktop", + "settings.tab.general": "Geral", + "settings.tab.shortcuts": "Atalhos", + + "settings.general.section.appearance": "Aparência", + "settings.general.section.notifications": "Notificações do sistema", + "settings.general.section.sounds": "Efeitos sonoros", + + "settings.general.row.language.title": "Idioma", + "settings.general.row.language.description": "Alterar o idioma de exibição do OpenCode", + "settings.general.row.appearance.title": "Aparência", + "settings.general.row.appearance.description": "Personalize como o OpenCode aparece no seu dispositivo", + "settings.general.row.theme.title": "Tema", + "settings.general.row.theme.description": "Personalize como o OpenCode é tematizado.", + "settings.general.row.font.title": "Fonte", + "settings.general.row.font.description": "Personalize a fonte monoespaçada usada em blocos de código", + "font.option.ibmPlexMono": "IBM Plex Mono", + "font.option.cascadiaCode": "Cascadia Code", + "font.option.firaCode": "Fira Code", + "font.option.hack": "Hack", + "font.option.inconsolata": "Inconsolata", + "font.option.intelOneMono": "Intel One Mono", + "font.option.jetbrainsMono": "JetBrains Mono", + "font.option.mesloLgs": "Meslo LGS", + "font.option.robotoMono": "Roboto Mono", + "font.option.sourceCodePro": "Source Code Pro", + "font.option.ubuntuMono": "Ubuntu Mono", + "sound.option.alert01": "Alerta 01", + "sound.option.alert02": "Alerta 02", + "sound.option.alert03": "Alerta 03", + "sound.option.alert04": "Alerta 04", + "sound.option.alert05": "Alerta 05", + "sound.option.alert06": "Alerta 06", + "sound.option.alert07": "Alerta 07", + "sound.option.alert08": "Alerta 08", + "sound.option.alert09": "Alerta 09", + "sound.option.alert10": "Alerta 10", + "sound.option.bipbop01": "Bip-bop 01", + "sound.option.bipbop02": "Bip-bop 02", + "sound.option.bipbop03": "Bip-bop 03", + "sound.option.bipbop04": "Bip-bop 04", + "sound.option.bipbop05": "Bip-bop 05", + "sound.option.bipbop06": "Bip-bop 06", + "sound.option.bipbop07": "Bip-bop 07", + "sound.option.bipbop08": "Bip-bop 08", + "sound.option.bipbop09": "Bip-bop 09", + "sound.option.bipbop10": "Bip-bop 10", + "sound.option.staplebops01": "Staplebops 01", + "sound.option.staplebops02": "Staplebops 02", + "sound.option.staplebops03": "Staplebops 03", + "sound.option.staplebops04": "Staplebops 04", + "sound.option.staplebops05": "Staplebops 05", + "sound.option.staplebops06": "Staplebops 06", + "sound.option.staplebops07": "Staplebops 07", + "sound.option.nope01": "Não 01", + "sound.option.nope02": "Não 02", + "sound.option.nope03": "Não 03", + "sound.option.nope04": "Não 04", + "sound.option.nope05": "Não 05", + "sound.option.nope06": "Não 06", + "sound.option.nope07": "Não 07", + "sound.option.nope08": "Não 08", + "sound.option.nope09": "Não 09", + "sound.option.nope10": "Não 10", + "sound.option.nope11": "Não 11", + "sound.option.nope12": "Não 12", + "sound.option.yup01": "Sim 01", + "sound.option.yup02": "Sim 02", + "sound.option.yup03": "Sim 03", + "sound.option.yup04": "Sim 04", + "sound.option.yup05": "Sim 05", + "sound.option.yup06": "Sim 06", + + "settings.general.notifications.agent.title": "Agente", + "settings.general.notifications.agent.description": + "Mostrar notificação do sistema quando o agente estiver completo ou precisar de atenção", + "settings.general.notifications.permissions.title": "Permissões", + "settings.general.notifications.permissions.description": + "Mostrar notificação do sistema quando uma permissão for necessária", + "settings.general.notifications.errors.title": "Erros", + "settings.general.notifications.errors.description": "Mostrar notificação do sistema quando ocorrer um erro", + + "settings.general.sounds.agent.title": "Agente", + "settings.general.sounds.agent.description": "Reproduzir som quando o agente estiver completo ou precisar de atenção", + "settings.general.sounds.permissions.title": "Permissões", + "settings.general.sounds.permissions.description": "Reproduzir som quando uma permissão for necessária", + "settings.general.sounds.errors.title": "Erros", + "settings.general.sounds.errors.description": "Reproduzir som quando ocorrer um erro", + + "settings.shortcuts.title": "Atalhos de teclado", + "settings.shortcuts.reset.button": "Redefinir para padrões", + "settings.shortcuts.reset.toast.title": "Atalhos redefinidos", + "settings.shortcuts.reset.toast.description": "Atalhos de teclado foram redefinidos para os padrões.", + "settings.shortcuts.conflict.title": "Atalho já em uso", + "settings.shortcuts.conflict.description": "{{keybind}} já está atribuído a {{titles}}.", + "settings.shortcuts.unassigned": "Não atribuído", + "settings.shortcuts.pressKeys": "Pressione teclas", + "settings.shortcuts.search.placeholder": "Buscar atalhos", + "settings.shortcuts.search.empty": "Nenhum atalho encontrado", + + "settings.shortcuts.group.general": "Geral", + "settings.shortcuts.group.session": "Sessão", + "settings.shortcuts.group.navigation": "Navegação", + "settings.shortcuts.group.modelAndAgent": "Modelo e agente", + "settings.shortcuts.group.terminal": "Terminal", + "settings.shortcuts.group.prompt": "Prompt", + + "settings.providers.title": "Provedores", + "settings.providers.description": "Configurações de provedores estarão disponíveis aqui.", + "settings.models.title": "Modelos", + "settings.models.description": "Configurações de modelos estarão disponíveis aqui.", + "settings.agents.title": "Agentes", + "settings.agents.description": "Configurações de agentes estarão disponíveis aqui.", + "settings.commands.title": "Comandos", + "settings.commands.description": "Configurações de comandos estarão disponíveis aqui.", + "settings.mcp.title": "MCP", + "settings.mcp.description": "Configurações de MCP estarão disponíveis aqui.", + + "settings.permissions.title": "Permissões", + "settings.permissions.description": "Controle quais ferramentas o servidor pode usar por padrão.", + "settings.permissions.section.tools": "Ferramentas", + "settings.permissions.toast.updateFailed.title": "Falha ao atualizar permissões", + + "settings.permissions.action.allow": "Permitir", + "settings.permissions.action.ask": "Perguntar", + "settings.permissions.action.deny": "Negar", + + "settings.permissions.tool.read.title": "Ler", + "settings.permissions.tool.read.description": "Ler um arquivo (corresponde ao caminho do arquivo)", + "settings.permissions.tool.edit.title": "Editar", + "settings.permissions.tool.edit.description": + "Modificar arquivos, incluindo edições, escritas, patches e multi-edições", + "settings.permissions.tool.glob.title": "Glob", + "settings.permissions.tool.glob.description": "Corresponder arquivos usando padrões glob", + "settings.permissions.tool.grep.title": "Grep", + "settings.permissions.tool.grep.description": "Buscar conteúdo de arquivos usando expressões regulares", + "settings.permissions.tool.list.title": "Listar", + "settings.permissions.tool.list.description": "Listar arquivos dentro de um diretório", + "settings.permissions.tool.bash.title": "Bash", + "settings.permissions.tool.bash.description": "Executar comandos shell", + "settings.permissions.tool.task.title": "Tarefa", + "settings.permissions.tool.task.description": "Lançar sub-agentes", + "settings.permissions.tool.skill.title": "Habilidade", + "settings.permissions.tool.skill.description": "Carregar uma habilidade por nome", + "settings.permissions.tool.lsp.title": "LSP", + "settings.permissions.tool.lsp.description": "Executar consultas de servidor de linguagem", + "settings.permissions.tool.todoread.title": "Ler Tarefas", + "settings.permissions.tool.todoread.description": "Ler a lista de tarefas", + "settings.permissions.tool.todowrite.title": "Escrever Tarefas", + "settings.permissions.tool.todowrite.description": "Atualizar a lista de tarefas", + "settings.permissions.tool.webfetch.title": "Buscar Web", + "settings.permissions.tool.webfetch.description": "Buscar conteúdo de uma URL", + "settings.permissions.tool.websearch.title": "Pesquisa Web", + "settings.permissions.tool.websearch.description": "Pesquisar na web", + "settings.permissions.tool.codesearch.title": "Pesquisa de Código", + "settings.permissions.tool.codesearch.description": "Pesquisar código na web", + "settings.permissions.tool.external_directory.title": "Diretório Externo", + "settings.permissions.tool.external_directory.description": "Acessar arquivos fora do diretório do projeto", + "settings.permissions.tool.doom_loop.title": "Loop Infinito", + "settings.permissions.tool.doom_loop.description": "Detectar chamadas de ferramentas repetidas com entrada idêntica", + + "session.delete.failed.title": "Falha ao excluir sessão", + "session.delete.title": "Excluir sessão", + "session.delete.confirm": 'Excluir sessão "{{name}}"?', + "session.delete.button": "Excluir sessão", + + "workspace.new": "Novo espaço de trabalho", + "workspace.type.local": "local", + "workspace.type.sandbox": "sandbox", + "workspace.create.failed.title": "Falha ao criar espaço de trabalho", + "workspace.delete.failed.title": "Falha ao excluir espaço de trabalho", + "workspace.resetting.title": "Redefinindo espaço de trabalho", + "workspace.resetting.description": "Isso pode levar um minuto.", + "workspace.reset.failed.title": "Falha ao redefinir espaço de trabalho", + "workspace.reset.success.title": "Espaço de trabalho redefinido", + "workspace.reset.success.description": "Espaço de trabalho agora corresponde ao branch padrão.", + "workspace.status.checking": "Verificando alterações não mescladas...", + "workspace.status.error": "Não foi possível verificar o status do git.", + "workspace.status.clean": "Nenhuma alteração não mesclada detectada.", + "workspace.status.dirty": "Alterações não mescladas detectadas neste espaço de trabalho.", + "workspace.delete.title": "Excluir espaço de trabalho", + "workspace.delete.confirm": 'Excluir espaço de trabalho "{{name}}"?', + "workspace.delete.button": "Excluir espaço de trabalho", + "workspace.reset.title": "Redefinir espaço de trabalho", + "workspace.reset.confirm": 'Redefinir espaço de trabalho "{{name}}"?', + "workspace.reset.button": "Redefinir espaço de trabalho", + "workspace.reset.archived.none": "Nenhuma sessão ativa será arquivada.", + "workspace.reset.archived.one": "1 sessão será arquivada.", + "workspace.reset.archived.many": "{{count}} sessões serão arquivadas.", + "workspace.reset.note": "Isso redefinirá o espaço de trabalho para corresponder ao branch padrão.", +} diff --git a/packages/app/src/i18n/da.ts b/packages/app/src/i18n/da.ts new file mode 100644 index 00000000000..b1e3f59c37c --- /dev/null +++ b/packages/app/src/i18n/da.ts @@ -0,0 +1,580 @@ +export const dict = { + "command.category.suggested": "Foreslået", + "command.category.view": "Vis", + "command.category.project": "Projekt", + "command.category.provider": "Udbyder", + "command.category.server": "Server", + "command.category.session": "Session", + "command.category.theme": "Tema", + "command.category.language": "Sprog", + "command.category.file": "Fil", + "command.category.terminal": "Terminal", + "command.category.model": "Model", + "command.category.mcp": "MCP", + "command.category.agent": "Agent", + "command.category.permissions": "Tilladelser", + "command.category.workspace": "Arbejdsområde", + + "theme.scheme.system": "System", + "theme.scheme.light": "Lys", + "theme.scheme.dark": "Mørk", + + "command.sidebar.toggle": "Skift sidebjælke", + "command.project.open": "Åbn projekt", + "command.provider.connect": "Tilslut udbyder", + "command.server.switch": "Skift server", + "command.session.previous": "Forrige session", + "command.session.next": "Næste session", + "command.session.archive": "Arkivér session", + + "command.palette": "Kommandopalette", + + "command.theme.cycle": "Skift tema", + "command.theme.set": "Brug tema: {{theme}}", + "command.theme.scheme.cycle": "Skift farveskema", + "command.theme.scheme.set": "Brug farveskema: {{scheme}}", + + "command.language.cycle": "Skift sprog", + "command.language.set": "Brug sprog: {{language}}", + + "command.session.new": "Ny session", + "command.file.open": "Åbn fil", + "command.file.open.description": "Søg i filer og kommandoer", + "command.terminal.toggle": "Skift terminal", + "command.review.toggle": "Skift gennemgang", + "command.terminal.new": "Ny terminal", + "command.terminal.new.description": "Opret en ny terminalfane", + "command.steps.toggle": "Skift trin", + "command.steps.toggle.description": "Vis eller skjul trin for den aktuelle besked", + "command.message.previous": "Forrige besked", + "command.message.previous.description": "Gå til den forrige brugerbesked", + "command.message.next": "Næste besked", + "command.message.next.description": "Gå til den næste brugerbesked", + "command.model.choose": "Vælg model", + "command.model.choose.description": "Vælg en anden model", + "command.mcp.toggle": "Skift MCP'er", + "command.mcp.toggle.description": "Skift MCP'er", + "command.agent.cycle": "Skift agent", + "command.agent.cycle.description": "Skift til næste agent", + "command.agent.cycle.reverse": "Skift agent baglæns", + "command.agent.cycle.reverse.description": "Skift til forrige agent", + "command.model.variant.cycle": "Skift tænkeindsats", + "command.model.variant.cycle.description": "Skift til næste indsatsniveau", + "command.permissions.autoaccept.enable": "Accepter ændringer automatisk", + "command.permissions.autoaccept.disable": "Stop automatisk accept af ændringer", + "command.session.undo": "Fortryd", + "command.session.undo.description": "Fortryd den sidste besked", + "command.session.redo": "Omgør", + "command.session.redo.description": "Omgør den sidste fortrudte besked", + "command.session.compact": "Komprimér session", + "command.session.compact.description": "Opsummer sessionen for at reducere kontekststørrelsen", + "command.session.fork": "Forgren fra besked", + "command.session.fork.description": "Opret en ny session fra en tidligere besked", + "command.session.share": "Del session", + "command.session.share.description": "Del denne session og kopier URL'en til udklipsholderen", + "command.session.unshare": "Stop deling af session", + "command.session.unshare.description": "Stop med at dele denne session", + + "palette.search.placeholder": "Søg i filer og kommandoer", + "palette.empty": "Ingen resultater fundet", + "palette.group.commands": "Kommandoer", + "palette.group.files": "Filer", + + "dialog.provider.search.placeholder": "Søg udbydere", + "dialog.provider.empty": "Ingen udbydere fundet", + "dialog.provider.group.popular": "Populære", + "dialog.provider.group.other": "Andre", + "dialog.provider.tag.recommended": "Anbefalet", + "dialog.provider.anthropic.note": "Forbind med Claude Pro/Max eller API-nøgle", + + "dialog.model.select.title": "Vælg model", + "dialog.model.search.placeholder": "Søg modeller", + "dialog.model.empty": "Ingen modeller fundet", + "dialog.model.manage": "Administrer modeller", + "dialog.model.manage.description": "Tilpas hvilke modeller der vises i modelvælgeren.", + + "dialog.model.unpaid.freeModels.title": "Gratis modeller leveret af OpenCode", + "dialog.model.unpaid.addMore.title": "Tilføj flere modeller fra populære udbydere", + + "dialog.provider.viewAll": "Vis alle udbydere", + + "provider.connect.title": "Forbind {{provider}}", + "provider.connect.title.anthropicProMax": "Log ind med Claude Pro/Max", + "provider.connect.selectMethod": "Vælg loginmetode for {{provider}}.", + "provider.connect.method.apiKey": "API-nøgle", + "provider.connect.status.inProgress": "Godkendelse i gang...", + "provider.connect.status.waiting": "Venter på godkendelse...", + "provider.connect.status.failed": "Godkendelse mislykkedes: {{error}}", + "provider.connect.apiKey.description": + "Indtast din {{provider}} API-nøgle for at forbinde din konto og bruge {{provider}} modeller i OpenCode.", + "provider.connect.apiKey.label": "{{provider}} API-nøgle", + "provider.connect.apiKey.placeholder": "API-nøgle", + "provider.connect.apiKey.required": "API-nøgle er påkrævet", + "provider.connect.opencodeZen.line1": + "OpenCode Zen giver dig adgang til et udvalg af pålidelige optimerede modeller til kodningsagenter.", + "provider.connect.opencodeZen.line2": + "Med en enkelt API-nøgle får du adgang til modeller som Claude, GPT, Gemini, GLM og flere.", + "provider.connect.opencodeZen.visit.prefix": "Besøg ", + "provider.connect.opencodeZen.visit.suffix": " for at hente din API-nøgle.", + "provider.connect.oauth.code.visit.prefix": "Besøg ", + "provider.connect.oauth.code.visit.link": "dette link", + "provider.connect.oauth.code.visit.suffix": + " for at hente din godkendelseskode for at forbinde din konto og bruge {{provider}} modeller i OpenCode.", + "provider.connect.oauth.code.label": "{{method}} godkendelseskode", + "provider.connect.oauth.code.placeholder": "Godkendelseskode", + "provider.connect.oauth.code.required": "Godkendelseskode er påkrævet", + "provider.connect.oauth.code.invalid": "Ugyldig godkendelseskode", + "provider.connect.oauth.auto.visit.prefix": "Besøg ", + "provider.connect.oauth.auto.visit.link": "dette link", + "provider.connect.oauth.auto.visit.suffix": + " og indtast koden nedenfor for at forbinde din konto og bruge {{provider}} modeller i OpenCode.", + "provider.connect.oauth.auto.confirmationCode": "Bekræftelseskode", + "provider.connect.toast.connected.title": "{{provider}} forbundet", + "provider.connect.toast.connected.description": "{{provider}} modeller er nu tilgængelige.", + + "model.tag.free": "Gratis", + "model.tag.latest": "Nyeste", + + "common.search.placeholder": "Søg", + "common.goBack": "Gå tilbage", + "common.loading": "Indlæser", + "common.cancel": "Annuller", + "common.submit": "Indsend", + "common.save": "Gem", + "common.saving": "Gemmer...", + "common.default": "Standard", + "common.attachment": "vedhæftning", + + "prompt.placeholder.shell": "Indtast shell-kommando...", + "prompt.placeholder.normal": 'Spørg om hvad som helst... "{{example}}"', + "prompt.mode.shell": "Shell", + "prompt.mode.shell.exit": "esc for at afslutte", + + "prompt.example.1": "Ret en TODO i koden", + "prompt.example.2": "Hvad er teknologistakken for dette projekt?", + "prompt.example.3": "Ret ødelagte tests", + "prompt.example.4": "Forklar hvordan godkendelse fungerer", + "prompt.example.5": "Find og ret sikkerhedshuller", + "prompt.example.6": "Tilføj enhedstests for brugerservice", + "prompt.example.7": "Refaktorer denne funktion så den er mere læsbar", + "prompt.example.8": "Hvad betyder denne fejl?", + "prompt.example.9": "Hjælp mig med at debugge dette problem", + "prompt.example.10": "Generer API-dokumentation", + "prompt.example.11": "Optimer databaseforespørgsler", + "prompt.example.12": "Tilføj validering af input", + "prompt.example.13": "Opret en ny komponent til...", + "prompt.example.14": "Hvordan deployerer jeg dette projekt?", + "prompt.example.15": "Gennemgå min kode for bedste praksis", + "prompt.example.16": "Tilføj fejlhåndtering til denne funktion", + "prompt.example.17": "Forklar dette regex-mønster", + "prompt.example.18": "Konverter dette til TypeScript", + "prompt.example.19": "Tilføj logning i hele koden", + "prompt.example.20": "Hvilke afhængigheder er forældede?", + "prompt.example.21": "Hjælp mig med at skrive et migreringsscript", + "prompt.example.22": "Implementer caching for dette endpoint", + "prompt.example.23": "Tilføj sideinddeling til denne liste", + "prompt.example.24": "Opret en CLI-kommando til...", + "prompt.example.25": "Hvordan fungerer miljøvariabler her?", + + "prompt.popover.emptyResults": "Ingen matchende resultater", + "prompt.popover.emptyCommands": "Ingen matchende kommandoer", + "prompt.dropzone.label": "Slip billeder eller PDF'er her", + "prompt.slash.badge.custom": "brugerdefineret", + "prompt.context.active": "aktiv", + "prompt.context.includeActiveFile": "Inkluder aktiv fil", + "prompt.context.removeActiveFile": "Fjern aktiv fil fra kontekst", + "prompt.context.removeFile": "Fjern fil fra kontekst", + "prompt.action.attachFile": "Vedhæft fil", + "prompt.attachment.remove": "Fjern vedhæftning", + "prompt.action.send": "Send", + "prompt.action.stop": "Stop", + + "prompt.toast.pasteUnsupported.title": "Ikke understøttet indsæt", + "prompt.toast.pasteUnsupported.description": "Kun billeder eller PDF'er kan indsættes her.", + "prompt.toast.modelAgentRequired.title": "Vælg en agent og model", + "prompt.toast.modelAgentRequired.description": "Vælg en agent og model før du sender en forespørgsel.", + "prompt.toast.worktreeCreateFailed.title": "Kunne ikke oprette worktree", + "prompt.toast.sessionCreateFailed.title": "Kunne ikke oprette session", + "prompt.toast.shellSendFailed.title": "Kunne ikke sende shell-kommando", + "prompt.toast.commandSendFailed.title": "Kunne ikke sende kommando", + "prompt.toast.promptSendFailed.title": "Kunne ikke sende forespørgsel", + + "dialog.mcp.title": "MCP'er", + "dialog.mcp.description": "{{enabled}} af {{total}} aktiveret", + "dialog.mcp.empty": "Ingen MCP'er konfigureret", + + "mcp.status.connected": "forbundet", + "mcp.status.failed": "mislykkedes", + "mcp.status.needs_auth": "kræver godkendelse", + "mcp.status.disabled": "deaktiveret", + + "dialog.fork.empty": "Ingen beskeder at forgrene fra", + + "dialog.directory.search.placeholder": "Søg mapper", + "dialog.directory.empty": "Ingen mapper fundet", + + "dialog.server.title": "Servere", + "dialog.server.description": "Skift hvilken OpenCode-server denne app forbinder til.", + "dialog.server.search.placeholder": "Søg servere", + "dialog.server.empty": "Ingen servere endnu", + "dialog.server.add.title": "Tilføj en server", + "dialog.server.add.url": "Server URL", + "dialog.server.add.placeholder": "http://localhost:4096", + "dialog.server.add.error": "Kunne ikke forbinde til server", + "dialog.server.add.checking": "Tjekker...", + "dialog.server.add.button": "Tilføj", + "dialog.server.default.title": "Standardserver", + "dialog.server.default.description": + "Forbind til denne server ved start af app i stedet for at starte en lokal server. Kræver genstart.", + "dialog.server.default.none": "Ingen server valgt", + "dialog.server.default.set": "Sæt nuværende server som standard", + "dialog.server.default.clear": "Ryd", + "dialog.server.action.remove": "Fjern server", + + "dialog.project.edit.title": "Rediger projekt", + "dialog.project.edit.name": "Navn", + "dialog.project.edit.icon": "Ikon", + "dialog.project.edit.icon.alt": "Projektikon", + "dialog.project.edit.icon.hint": "Klik eller træk et billede", + "dialog.project.edit.icon.recommended": "Anbefalet: 128x128px", + "dialog.project.edit.color": "Farve", + "dialog.project.edit.color.select": "Vælg farven {{color}}", + + "context.breakdown.title": "Kontekstfordeling", + "context.breakdown.note": + 'Omtrentlig fordeling af input-tokens. "Andre" inkluderer værktøjsdefinitioner og overhead.', + "context.breakdown.system": "System", + "context.breakdown.user": "Bruger", + "context.breakdown.assistant": "Assistent", + "context.breakdown.tool": "Værktøjskald", + "context.breakdown.other": "Andre", + + "context.systemPrompt.title": "Systemprompt", + "context.rawMessages.title": "Rå beskeder", + + "context.stats.session": "Session", + "context.stats.messages": "Beskeder", + "context.stats.provider": "Udbyder", + "context.stats.model": "Model", + "context.stats.limit": "Kontekstgrænse", + "context.stats.totalTokens": "Total Tokens", + "context.stats.usage": "Forbrug", + "context.stats.inputTokens": "Input Tokens", + "context.stats.outputTokens": "Output Tokens", + "context.stats.reasoningTokens": "Tænke Tokens", + "context.stats.cacheTokens": "Cache Tokens (læs/skriv)", + "context.stats.userMessages": "Brugerbeskeder", + "context.stats.assistantMessages": "Assistentbeskeder", + "context.stats.totalCost": "Samlede omkostninger", + "context.stats.sessionCreated": "Session oprettet", + "context.stats.lastActivity": "Seneste aktivitet", + + "context.usage.tokens": "Tokens", + "context.usage.usage": "Forbrug", + "context.usage.cost": "Omkostning", + "context.usage.clickToView": "Klik for at se kontekst", + "context.usage.view": "Se kontekstforbrug", + + "language.en": "Engelsk", + "language.zh": "Kinesisk (forenklet)", + "language.zht": "Kinesisk (traditionelt)", + "language.ko": "Koreansk", + "language.de": "Tysk", + "language.es": "Spansk", + "language.fr": "Fransk", + "language.ja": "Japansk", + "language.da": "Dansk", + "language.ru": "Russisk", + "language.pl": "Polsk", + "language.ar": "Arabisk", + "language.no": "Norsk", + "language.br": "Portugisisk (Brasilien)", + + "toast.language.title": "Sprog", + "toast.language.description": "Skiftede til {{language}}", + + "toast.theme.title": "Tema skiftet", + "toast.scheme.title": "Farveskema", + + "toast.permissions.autoaccept.on.title": "Accepterer ændringer automatisk", + "toast.permissions.autoaccept.on.description": "Redigerings- og skrivetilladelser vil automatisk blive godkendt", + "toast.permissions.autoaccept.off.title": "Stoppede automatisk accept af ændringer", + "toast.permissions.autoaccept.off.description": "Redigerings- og skrivetilladelser vil kræve godkendelse", + + "toast.model.none.title": "Ingen model valgt", + "toast.model.none.description": "Forbind en udbyder for at opsummere denne session", + + "toast.file.loadFailed.title": "Kunne ikke indlæse fil", + + "toast.session.share.copyFailed.title": "Kunne ikke kopiere URL til udklipsholder", + "toast.session.share.success.title": "Session delt", + "toast.session.share.success.description": "Delings-URL kopieret til udklipsholder!", + "toast.session.share.failed.title": "Kunne ikke dele session", + "toast.session.share.failed.description": "Der opstod en fejl under deling af sessionen", + + "toast.session.unshare.success.title": "Deling af session stoppet", + "toast.session.unshare.success.description": "Deling af session blev stoppet!", + "toast.session.unshare.failed.title": "Kunne ikke stoppe deling af session", + "toast.session.unshare.failed.description": "Der opstod en fejl under stop af sessionsdeling", + + "toast.session.listFailed.title": "Kunne ikke indlæse sessioner for {{project}}", + + "toast.update.title": "Opdatering tilgængelig", + "toast.update.description": "En ny version af OpenCode ({{version}}) er nu tilgængelig til installation.", + "toast.update.action.installRestart": "Installer og genstart", + "toast.update.action.notYet": "Ikke endnu", + + "error.page.title": "Noget gik galt", + "error.page.description": "Der opstod en fejl under indlæsning af applikationen.", + "error.page.details.label": "Fejldetaljer", + "error.page.action.restart": "Genstart", + "error.page.action.checking": "Tjekker...", + "error.page.action.checkUpdates": "Tjek for opdateringer", + "error.page.action.updateTo": "Opdater til {{version}}", + "error.page.report.prefix": "Rapporter venligst denne fejl til OpenCode-teamet", + "error.page.report.discord": "på Discord", + "error.page.version": "Version: {{version}}", + + "error.dev.rootNotFound": + "Rodelement ikke fundet. Har du glemt at tilføje det til din index.html? Eller måske er id-attributten stavet forkert?", + + "error.globalSync.connectFailed": "Kunne ikke forbinde til server. Kører der en server på `{{url}}`?", + + "error.chain.unknown": "Ukendt fejl", + "error.chain.causedBy": "Forårsaget af:", + "error.chain.apiError": "API-fejl", + "error.chain.status": "Status: {{status}}", + "error.chain.retryable": "Kan forsøges igen: {{retryable}}", + "error.chain.responseBody": "Svarindhold:\n{{body}}", + "error.chain.didYouMean": "Mente du: {{suggestions}}", + "error.chain.modelNotFound": "Model ikke fundet: {{provider}}/{{model}}", + "error.chain.checkConfig": "Tjek dine konfigurations (opencode.json) udbyder/modelnavne", + "error.chain.mcpFailed": 'MCP-server "{{name}}" fejlede. Bemærk, OpenCode understøtter ikke MCP-godkendelse endnu.', + "error.chain.providerAuthFailed": "Udbydergodkendelse mislykkedes ({{provider}}): {{message}}", + "error.chain.providerInitFailed": + 'Kunne ikke initialisere udbyder "{{provider}}". Tjek legitimationsoplysninger og konfiguration.', + "error.chain.configJsonInvalid": "Konfigurationsfil på {{path}} er ikke gyldig JSON(C)", + "error.chain.configJsonInvalidWithMessage": "Konfigurationsfil på {{path}} er ikke gyldig JSON(C): {{message}}", + "error.chain.configDirectoryTypo": + 'Mappe "{{dir}}" i {{path}} er ikke gyldig. Omdøb mappen til "{{suggestion}}" eller fjern den. Dette er en almindelig slåfejl.', + "error.chain.configFrontmatterError": "Kunne ikke parse frontmatter i {{path}}:\n{{message}}", + "error.chain.configInvalid": "Konfigurationsfil på {{path}} er ugyldig", + "error.chain.configInvalidWithMessage": "Konfigurationsfil på {{path}} er ugyldig: {{message}}", + + "notification.permission.title": "Tilladelse påkrævet", + "notification.permission.description": "{{sessionTitle}} i {{projectName}} kræver tilladelse", + "notification.question.title": "Spørgsmål", + "notification.question.description": "{{sessionTitle}} i {{projectName}} har et spørgsmål", + "notification.action.goToSession": "Gå til session", + + "notification.session.responseReady.title": "Svar klar", + "notification.session.error.title": "Sessionsfejl", + "notification.session.error.fallbackDescription": "Der opstod en fejl", + + "home.recentProjects": "Seneste projekter", + "home.empty.title": "Ingen seneste projekter", + "home.empty.description": "Kom i gang ved at åbne et lokalt projekt", + + "session.tab.session": "Session", + "session.tab.review": "Gennemgang", + "session.tab.context": "Kontekst", + "session.panel.reviewAndFiles": "Gennemgang og filer", + "session.review.filesChanged": "{{count}} Filer ændret", + "session.review.loadingChanges": "Indlæser ændringer...", + "session.review.empty": "Ingen ændringer i denne session endnu", + "session.messages.renderEarlier": "Vis tidligere beskeder", + "session.messages.loadingEarlier": "Indlæser tidligere beskeder...", + "session.messages.loadEarlier": "Indlæs tidligere beskeder", + "session.messages.loading": "Indlæser beskeder...", + + "session.context.addToContext": "Tilføj {{selection}} til kontekst", + + "session.new.worktree.main": "Hovedgren", + "session.new.worktree.mainWithBranch": "Hovedgren ({{branch}})", + "session.new.worktree.create": "Opret nyt worktree", + "session.new.lastModified": "Sidst ændret", + + "session.header.search.placeholder": "Søg {{project}}", + "session.header.searchFiles": "Søg efter filer", + + "session.share.popover.title": "Udgiv på nettet", + "session.share.popover.description.shared": + "Denne session er offentlig på nettet. Den er tilgængelig for alle med linket.", + "session.share.popover.description.unshared": + "Del session offentligt på nettet. Den vil være tilgængelig for alle med linket.", + "session.share.action.share": "Del", + "session.share.action.publish": "Udgiv", + "session.share.action.publishing": "Udgiver...", + "session.share.action.unpublish": "Afpublicer", + "session.share.action.unpublishing": "Afpublicerer...", + "session.share.action.view": "Vis", + "session.share.copy.copied": "Kopieret", + "session.share.copy.copyLink": "Kopier link", + + "lsp.tooltip.none": "Ingen LSP-servere", + "lsp.label.connected": "{{count}} LSP", + + "prompt.loading": "Indlæser prompt...", + "terminal.loading": "Indlæser terminal...", + "terminal.title": "Terminal", + "terminal.title.numbered": "Terminal {{number}}", + "terminal.close": "Luk terminal", + + "common.closeTab": "Luk fane", + "common.dismiss": "Afvis", + "common.requestFailed": "Forespørgsel mislykkedes", + "common.moreOptions": "Flere muligheder", + "common.learnMore": "Lær mere", + "common.rename": "Omdøb", + "common.reset": "Nulstil", + "common.archive": "Arkivér", + "common.delete": "Slet", + "common.close": "Luk", + "common.edit": "Rediger", + "common.loadMore": "Indlæs flere", + + "sidebar.nav.projectsAndSessions": "Projekter og sessioner", + "sidebar.settings": "Indstillinger", + "sidebar.help": "Hjælp", + "sidebar.workspaces.enable": "Aktiver arbejdsområder", + "sidebar.workspaces.disable": "Deaktiver arbejdsområder", + "sidebar.gettingStarted.title": "Kom i gang", + "sidebar.gettingStarted.line1": "OpenCode inkluderer gratis modeller så du kan starte med det samme.", + "sidebar.gettingStarted.line2": "Forbind enhver udbyder for at bruge modeller, inkl. Claude, GPT, Gemini osv.", + "sidebar.project.recentSessions": "Seneste sessioner", + "sidebar.project.viewAllSessions": "Vis alle sessioner", + + "settings.section.desktop": "Desktop", + "settings.tab.general": "Generelt", + "settings.tab.shortcuts": "Genveje", + + "settings.general.section.appearance": "Udseende", + "settings.general.section.notifications": "Systemmeddelelser", + "settings.general.section.sounds": "Lydeffekter", + + "settings.general.row.language.title": "Sprog", + "settings.general.row.language.description": "Ændr visningssproget for OpenCode", + "settings.general.row.appearance.title": "Udseende", + "settings.general.row.appearance.description": "Tilpas hvordan OpenCode ser ud på din enhed", + "settings.general.row.theme.title": "Tema", + "settings.general.row.theme.description": "Tilpas hvordan OpenCode er temabestemt.", + "settings.general.row.font.title": "Skrifttype", + "settings.general.row.font.description": "Tilpas mono-skrifttypen brugt i kodeblokke", + + "settings.general.notifications.agent.title": "Agent", + "settings.general.notifications.agent.description": + "Vis systemmeddelelse når agenten er færdig eller kræver opmærksomhed", + "settings.general.notifications.permissions.title": "Tilladelser", + "settings.general.notifications.permissions.description": "Vis systemmeddelelse når en tilladelse er påkrævet", + "settings.general.notifications.errors.title": "Fejl", + "settings.general.notifications.errors.description": "Vis systemmeddelelse når der opstår en fejl", + + "settings.general.sounds.agent.title": "Agent", + "settings.general.sounds.agent.description": "Afspil lyd når agenten er færdig eller kræver opmærksomhed", + "settings.general.sounds.permissions.title": "Tilladelser", + "settings.general.sounds.permissions.description": "Afspil lyd når en tilladelse er påkrævet", + "settings.general.sounds.errors.title": "Fejl", + "settings.general.sounds.errors.description": "Afspil lyd når der opstår en fejl", + + "settings.shortcuts.title": "Tastaturgenveje", + "settings.shortcuts.reset.button": "Nulstil til standard", + "settings.shortcuts.reset.toast.title": "Genveje nulstillet", + "settings.shortcuts.reset.toast.description": "Tastaturgenveje er blevet nulstillet til standard.", + "settings.shortcuts.conflict.title": "Genvej allerede i brug", + "settings.shortcuts.conflict.description": "{{keybind}} er allerede tildelt til {{titles}}.", + "settings.shortcuts.unassigned": "Ikke tildelt", + "settings.shortcuts.pressKeys": "Tryk på taster", + "settings.shortcuts.search.placeholder": "Søg genveje", + "settings.shortcuts.search.empty": "Ingen genveje fundet", + + "settings.shortcuts.group.general": "Generelt", + "settings.shortcuts.group.session": "Session", + "settings.shortcuts.group.navigation": "Navigation", + "settings.shortcuts.group.modelAndAgent": "Model og agent", + "settings.shortcuts.group.terminal": "Terminal", + "settings.shortcuts.group.prompt": "Prompt", + + "settings.providers.title": "Udbydere", + "settings.providers.description": "Udbyderindstillinger vil kunne konfigureres her.", + "settings.models.title": "Modeller", + "settings.models.description": "Modelindstillinger vil kunne konfigureres her.", + "settings.agents.title": "Agenter", + "settings.agents.description": "Agentindstillinger vil kunne konfigureres her.", + "settings.commands.title": "Kommandoer", + "settings.commands.description": "Kommandoindstillinger vil kunne konfigureres her.", + "settings.mcp.title": "MCP", + "settings.mcp.description": "MCP-indstillinger vil kunne konfigureres her.", + + "settings.permissions.title": "Tilladelser", + "settings.permissions.description": "Styr hvilke værktøjer serveren kan bruge som standard.", + "settings.permissions.section.tools": "Værktøjer", + "settings.permissions.toast.updateFailed.title": "Kunne ikke opdatere tilladelser", + + "settings.permissions.action.allow": "Tillad", + "settings.permissions.action.ask": "Spørg", + "settings.permissions.action.deny": "Afvis", + + "settings.permissions.tool.read.title": "Læs", + "settings.permissions.tool.read.description": "Læsning af en fil (matcher filstien)", + "settings.permissions.tool.edit.title": "Rediger", + "settings.permissions.tool.edit.description": + "Ændre filer, herunder redigeringer, skrivninger, patches og multi-redigeringer", + "settings.permissions.tool.glob.title": "Glob", + "settings.permissions.tool.glob.description": "Match filer ved hjælp af glob-mønstre", + "settings.permissions.tool.grep.title": "Grep", + "settings.permissions.tool.grep.description": "Søg i filindhold ved hjælp af regulære udtryk", + "settings.permissions.tool.list.title": "Liste", + "settings.permissions.tool.list.description": "List filer i en mappe", + "settings.permissions.tool.bash.title": "Bash", + "settings.permissions.tool.bash.description": "Kør shell-kommandoer", + "settings.permissions.tool.task.title": "Opgave", + "settings.permissions.tool.task.description": "Start underagenter", + "settings.permissions.tool.skill.title": "Færdighed", + "settings.permissions.tool.skill.description": "Indlæs en færdighed efter navn", + "settings.permissions.tool.lsp.title": "LSP", + "settings.permissions.tool.lsp.description": "Kør sprogserverforespørgsler", + "settings.permissions.tool.todoread.title": "Læs To-do", + "settings.permissions.tool.todoread.description": "Læs to-do listen", + "settings.permissions.tool.todowrite.title": "Skriv To-do", + "settings.permissions.tool.todowrite.description": "Opdater to-do listen", + "settings.permissions.tool.webfetch.title": "Webhentning", + "settings.permissions.tool.webfetch.description": "Hent indhold fra en URL", + "settings.permissions.tool.websearch.title": "Websøgning", + "settings.permissions.tool.websearch.description": "Søg på nettet", + "settings.permissions.tool.codesearch.title": "Kodesøgning", + "settings.permissions.tool.codesearch.description": "Søg kode på nettet", + "settings.permissions.tool.external_directory.title": "Ekstern mappe", + "settings.permissions.tool.external_directory.description": "Få adgang til filer uden for projektmappen", + "settings.permissions.tool.doom_loop.title": "Doom Loop", + "settings.permissions.tool.doom_loop.description": "Opdag gentagne værktøjskald med identisk input", + + "session.delete.failed.title": "Kunne ikke slette session", + "session.delete.title": "Slet session", + "session.delete.confirm": 'Slet session "{{name}}"?', + "session.delete.button": "Slet session", + + "workspace.new": "Nyt arbejdsområde", + "workspace.type.local": "lokal", + "workspace.type.sandbox": "sandkasse", + "workspace.create.failed.title": "Kunne ikke oprette arbejdsområde", + "workspace.delete.failed.title": "Kunne ikke slette arbejdsområde", + "workspace.resetting.title": "Nulstiller arbejdsområde", + "workspace.resetting.description": "Dette kan tage et minut.", + "workspace.reset.failed.title": "Kunne ikke nulstille arbejdsområde", + "workspace.reset.success.title": "Arbejdsområde nulstillet", + "workspace.reset.success.description": "Arbejdsområdet matcher nu hovedgrenen.", + "workspace.status.checking": "Tjekker for uflettede ændringer...", + "workspace.status.error": "Kunne ikke bekræfte git-status.", + "workspace.status.clean": "Ingen uflettede ændringer fundet.", + "workspace.status.dirty": "Uflettede ændringer fundet i dette arbejdsområde.", + "workspace.delete.title": "Slet arbejdsområde", + "workspace.delete.confirm": 'Slet arbejdsområde "{{name}}"?', + "workspace.delete.button": "Slet arbejdsområde", + "workspace.reset.title": "Nulstil arbejdsområde", + "workspace.reset.confirm": 'Nulstil arbejdsområde "{{name}}"?', + "workspace.reset.button": "Nulstil arbejdsområde", + "workspace.reset.archived.none": "Ingen aktive sessioner vil blive arkiveret.", + "workspace.reset.archived.one": "1 session vil blive arkiveret.", + "workspace.reset.archived.many": "{{count}} sessioner vil blive arkiveret.", + "workspace.reset.note": "Dette vil nulstille arbejdsområdet til at matche hovedgrenen.", +} diff --git a/packages/app/src/i18n/de.ts b/packages/app/src/i18n/de.ts new file mode 100644 index 00000000000..9b7d1e5e6af --- /dev/null +++ b/packages/app/src/i18n/de.ts @@ -0,0 +1,589 @@ +import { dict as en } from "./en" + +type Keys = keyof typeof en + +export const dict = { + "command.category.suggested": "Vorgeschlagen", + "command.category.view": "Ansicht", + "command.category.project": "Projekt", + "command.category.provider": "Anbieter", + "command.category.server": "Server", + "command.category.session": "Sitzung", + "command.category.theme": "Thema", + "command.category.language": "Sprache", + "command.category.file": "Datei", + "command.category.terminal": "Terminal", + "command.category.model": "Modell", + "command.category.mcp": "MCP", + "command.category.agent": "Agent", + "command.category.permissions": "Berechtigungen", + "command.category.workspace": "Arbeitsbereich", + + "theme.scheme.system": "System", + "theme.scheme.light": "Hell", + "theme.scheme.dark": "Dunkel", + + "command.sidebar.toggle": "Seitenleiste umschalten", + "command.project.open": "Projekt öffnen", + "command.provider.connect": "Anbieter verbinden", + "command.server.switch": "Server wechseln", + "command.session.previous": "Vorherige Sitzung", + "command.session.next": "Nächste Sitzung", + "command.session.archive": "Sitzung archivieren", + + "command.palette": "Befehlspalette", + + "command.theme.cycle": "Thema wechseln", + "command.theme.set": "Thema verwenden: {{theme}}", + "command.theme.scheme.cycle": "Farbschema wechseln", + "command.theme.scheme.set": "Farbschema verwenden: {{scheme}}", + + "command.language.cycle": "Sprache wechseln", + "command.language.set": "Sprache verwenden: {{language}}", + + "command.session.new": "Neue Sitzung", + "command.file.open": "Datei öffnen", + "command.file.open.description": "Dateien und Befehle durchsuchen", + "command.terminal.toggle": "Terminal umschalten", + "command.review.toggle": "Überprüfung umschalten", + "command.terminal.new": "Neues Terminal", + "command.terminal.new.description": "Neuen Terminal-Tab erstellen", + "command.steps.toggle": "Schritte umschalten", + "command.steps.toggle.description": "Schritte für die aktuelle Nachricht anzeigen oder ausblenden", + "command.message.previous": "Vorherige Nachricht", + "command.message.previous.description": "Zur vorherigen Benutzernachricht gehen", + "command.message.next": "Nächste Nachricht", + "command.message.next.description": "Zur nächsten Benutzernachricht gehen", + "command.model.choose": "Modell wählen", + "command.model.choose.description": "Ein anderes Modell auswählen", + "command.mcp.toggle": "MCPs umschalten", + "command.mcp.toggle.description": "MCPs umschalten", + "command.agent.cycle": "Agent wechseln", + "command.agent.cycle.description": "Zum nächsten Agenten wechseln", + "command.agent.cycle.reverse": "Agent rückwärts wechseln", + "command.agent.cycle.reverse.description": "Zum vorherigen Agenten wechseln", + "command.model.variant.cycle": "Denkaufwand wechseln", + "command.model.variant.cycle.description": "Zum nächsten Aufwandslevel wechseln", + "command.permissions.autoaccept.enable": "Änderungen automatisch akzeptieren", + "command.permissions.autoaccept.disable": "Automatische Annahme von Änderungen stoppen", + "command.session.undo": "Rückgängig", + "command.session.undo.description": "Letzte Nachricht rückgängig machen", + "command.session.redo": "Wiederherstellen", + "command.session.redo.description": "Letzte rückgängig gemachte Nachricht wiederherstellen", + "command.session.compact": "Sitzung komprimieren", + "command.session.compact.description": "Sitzung zusammenfassen, um die Kontextgröße zu reduzieren", + "command.session.fork": "Von Nachricht abzweigen", + "command.session.fork.description": "Neue Sitzung aus einer früheren Nachricht erstellen", + "command.session.share": "Sitzung teilen", + "command.session.share.description": "Diese Sitzung teilen und URL in die Zwischenablage kopieren", + "command.session.unshare": "Teilen der Sitzung aufheben", + "command.session.unshare.description": "Teilen dieser Sitzung beenden", + + "palette.search.placeholder": "Dateien und Befehle durchsuchen", + "palette.empty": "Keine Ergebnisse gefunden", + "palette.group.commands": "Befehle", + "palette.group.files": "Dateien", + + "dialog.provider.search.placeholder": "Anbieter durchsuchen", + "dialog.provider.empty": "Keine Anbieter gefunden", + "dialog.provider.group.popular": "Beliebt", + "dialog.provider.group.other": "Andere", + "dialog.provider.tag.recommended": "Empfohlen", + "dialog.provider.anthropic.note": "Mit Claude Pro/Max oder API-Schlüssel verbinden", + + "dialog.model.select.title": "Modell auswählen", + "dialog.model.search.placeholder": "Modelle durchsuchen", + "dialog.model.empty": "Keine Modellergebnisse", + "dialog.model.manage": "Modelle verwalten", + "dialog.model.manage.description": "Anpassen, welche Modelle in der Modellauswahl erscheinen.", + + "dialog.model.unpaid.freeModels.title": "Kostenlose Modelle von OpenCode", + "dialog.model.unpaid.addMore.title": "Weitere Modelle von beliebten Anbietern hinzufügen", + + "dialog.provider.viewAll": "Alle Anbieter anzeigen", + + "provider.connect.title": "{{provider}} verbinden", + "provider.connect.title.anthropicProMax": "Mit Claude Pro/Max anmelden", + "provider.connect.selectMethod": "Anmeldemethode für {{provider}} auswählen.", + "provider.connect.method.apiKey": "API-Schlüssel", + "provider.connect.status.inProgress": "Autorisierung läuft...", + "provider.connect.status.waiting": "Warten auf Autorisierung...", + "provider.connect.status.failed": "Autorisierung fehlgeschlagen: {{error}}", + "provider.connect.apiKey.description": + "Geben Sie Ihren {{provider}} API-Schlüssel ein, um Ihr Konto zu verbinden und {{provider}} Modelle in OpenCode zu nutzen.", + "provider.connect.apiKey.label": "{{provider}} API-Schlüssel", + "provider.connect.apiKey.placeholder": "API-Schlüssel", + "provider.connect.apiKey.required": "API-Schlüssel ist erforderlich", + "provider.connect.opencodeZen.line1": + "OpenCode Zen bietet Ihnen Zugriff auf eine kuratierte Auswahl zuverlässiger, optimierter Modelle für Coding-Agenten.", + "provider.connect.opencodeZen.line2": + "Mit einem einzigen API-Schlüssel erhalten Sie Zugriff auf Modelle wie Claude, GPT, Gemini, GLM und mehr.", + "provider.connect.opencodeZen.visit.prefix": "Besuchen Sie ", + "provider.connect.opencodeZen.visit.suffix": ", um Ihren API-Schlüssel zu erhalten.", + "provider.connect.oauth.code.visit.prefix": "Besuchen Sie ", + "provider.connect.oauth.code.visit.link": "diesen Link", + "provider.connect.oauth.code.visit.suffix": + ", um Ihren Autorisierungscode zu erhalten, Ihr Konto zu verbinden und {{provider}} Modelle in OpenCode zu nutzen.", + "provider.connect.oauth.code.label": "{{method}} Autorisierungscode", + "provider.connect.oauth.code.placeholder": "Autorisierungscode", + "provider.connect.oauth.code.required": "Autorisierungscode ist erforderlich", + "provider.connect.oauth.code.invalid": "Ungültiger Autorisierungscode", + "provider.connect.oauth.auto.visit.prefix": "Besuchen Sie ", + "provider.connect.oauth.auto.visit.link": "diesen Link", + "provider.connect.oauth.auto.visit.suffix": + " und geben Sie den untenstehenden Code ein, um Ihr Konto zu verbinden und {{provider}} Modelle in OpenCode zu nutzen.", + "provider.connect.oauth.auto.confirmationCode": "Bestätigungscode", + "provider.connect.toast.connected.title": "{{provider}} verbunden", + "provider.connect.toast.connected.description": "{{provider}} Modelle sind jetzt verfügbar.", + + "model.tag.free": "Kostenlos", + "model.tag.latest": "Neueste", + + "common.search.placeholder": "Suchen", + "common.goBack": "Zurück", + "common.loading": "Laden", + "common.cancel": "Abbrechen", + "common.submit": "Absenden", + "common.save": "Speichern", + "common.saving": "Speichert...", + "common.default": "Standard", + "common.attachment": "Anhang", + + "prompt.placeholder.shell": "Shell-Befehl eingeben...", + "prompt.placeholder.normal": 'Fragen Sie alles... "{{example}}"', + "prompt.mode.shell": "Shell", + "prompt.mode.shell.exit": "esc zum Verlassen", + + "prompt.example.1": "Ein TODO in der Codebasis beheben", + "prompt.example.2": "Was ist der Tech-Stack dieses Projekts?", + "prompt.example.3": "Fehlerhafte Tests beheben", + "prompt.example.4": "Erkläre, wie die Authentifizierung funktioniert", + "prompt.example.5": "Sicherheitslücken finden und beheben", + "prompt.example.6": "Unit-Tests für den Benutzerdienst hinzufügen", + "prompt.example.7": "Diese Funktion lesbarer gestalten", + "prompt.example.8": "Was bedeutet dieser Fehler?", + "prompt.example.9": "Hilf mir, dieses Problem zu debuggen", + "prompt.example.10": "API-Dokumentation generieren", + "prompt.example.11": "Datenbankabfragen optimieren", + "prompt.example.12": "Eingabevalidierung hinzufügen", + "prompt.example.13": "Neue Komponente erstellen für...", + "prompt.example.14": "Wie deploye ich dieses Projekt?", + "prompt.example.15": "Meinen Code auf Best Practices überprüfen", + "prompt.example.16": "Fehlerbehandlung zu dieser Funktion hinzufügen", + "prompt.example.17": "Erkläre dieses Regex-Muster", + "prompt.example.18": "Dies in TypeScript konvertieren", + "prompt.example.19": "Logging in der gesamten Codebasis hinzufügen", + "prompt.example.20": "Welche Abhängigkeiten sind veraltet?", + "prompt.example.21": "Hilf mir, ein Migrationsskript zu schreiben", + "prompt.example.22": "Caching für diesen Endpunkt implementieren", + "prompt.example.23": "Paginierung zu dieser Liste hinzufügen", + "prompt.example.24": "CLI-Befehl erstellen für...", + "prompt.example.25": "Wie funktionieren Umgebungsvariablen hier?", + + "prompt.popover.emptyResults": "Keine passenden Ergebnisse", + "prompt.popover.emptyCommands": "Keine passenden Befehle", + "prompt.dropzone.label": "Bilder oder PDFs hier ablegen", + "prompt.slash.badge.custom": "benutzerdefiniert", + "prompt.context.active": "aktiv", + "prompt.context.includeActiveFile": "Aktive Datei einbeziehen", + "prompt.context.removeActiveFile": "Aktive Datei aus dem Kontext entfernen", + "prompt.context.removeFile": "Datei aus dem Kontext entfernen", + "prompt.action.attachFile": "Datei anhängen", + "prompt.attachment.remove": "Anhang entfernen", + "prompt.action.send": "Senden", + "prompt.action.stop": "Stopp", + + "prompt.toast.pasteUnsupported.title": "Nicht unterstütztes Einfügen", + "prompt.toast.pasteUnsupported.description": "Hier können nur Bilder oder PDFs eingefügt werden.", + "prompt.toast.modelAgentRequired.title": "Wählen Sie einen Agenten und ein Modell", + "prompt.toast.modelAgentRequired.description": + "Wählen Sie einen Agenten und ein Modell, bevor Sie eine Eingabe senden.", + "prompt.toast.worktreeCreateFailed.title": "Worktree konnte nicht erstellt werden", + "prompt.toast.sessionCreateFailed.title": "Sitzung konnte nicht erstellt werden", + "prompt.toast.shellSendFailed.title": "Shell-Befehl konnte nicht gesendet werden", + "prompt.toast.commandSendFailed.title": "Befehl konnte nicht gesendet werden", + "prompt.toast.promptSendFailed.title": "Eingabe konnte nicht gesendet werden", + + "dialog.mcp.title": "MCPs", + "dialog.mcp.description": "{{enabled}} von {{total}} aktiviert", + "dialog.mcp.empty": "Keine MCPs konfiguriert", + + "mcp.status.connected": "verbunden", + "mcp.status.failed": "fehlgeschlagen", + "mcp.status.needs_auth": "benötigt Authentifizierung", + "mcp.status.disabled": "deaktiviert", + + "dialog.fork.empty": "Keine Nachrichten zum Abzweigen vorhanden", + + "dialog.directory.search.placeholder": "Ordner durchsuchen", + "dialog.directory.empty": "Keine Ordner gefunden", + + "dialog.server.title": "Server", + "dialog.server.description": "Wechseln Sie den OpenCode-Server, mit dem sich diese App verbindet.", + "dialog.server.search.placeholder": "Server durchsuchen", + "dialog.server.empty": "Noch keine Server", + "dialog.server.add.title": "Server hinzufügen", + "dialog.server.add.url": "Server-URL", + "dialog.server.add.placeholder": "http://localhost:4096", + "dialog.server.add.error": "Verbindung zum Server fehlgeschlagen", + "dialog.server.add.checking": "Prüfen...", + "dialog.server.add.button": "Hinzufügen", + "dialog.server.default.title": "Standardserver", + "dialog.server.default.description": + "Beim App-Start mit diesem Server verbinden, anstatt einen lokalen Server zu starten. Erfordert Neustart.", + "dialog.server.default.none": "Kein Server ausgewählt", + "dialog.server.default.set": "Aktuellen Server als Standard setzen", + "dialog.server.default.clear": "Löschen", + "dialog.server.action.remove": "Server entfernen", + + "dialog.project.edit.title": "Projekt bearbeiten", + "dialog.project.edit.name": "Name", + "dialog.project.edit.icon": "Icon", + "dialog.project.edit.icon.alt": "Projekt-Icon", + "dialog.project.edit.icon.hint": "Klicken oder Bild ziehen", + "dialog.project.edit.icon.recommended": "Empfohlen: 128x128px", + "dialog.project.edit.color": "Farbe", + "dialog.project.edit.color.select": "{{color}}-Farbe auswählen", + + "context.breakdown.title": "Kontext-Aufschlüsselung", + "context.breakdown.note": + 'Ungefähre Aufschlüsselung der Eingabe-Token. "Andere" beinhaltet Werkzeugdefinitionen und Overhead.', + "context.breakdown.system": "System", + "context.breakdown.user": "Benutzer", + "context.breakdown.assistant": "Assistent", + "context.breakdown.tool": "Werkzeugaufrufe", + "context.breakdown.other": "Andere", + + "context.systemPrompt.title": "System-Prompt", + "context.rawMessages.title": "Rohdaten der Nachrichten", + + "context.stats.session": "Sitzung", + "context.stats.messages": "Nachrichten", + "context.stats.provider": "Anbieter", + "context.stats.model": "Modell", + "context.stats.limit": "Kontextlimit", + "context.stats.totalTokens": "Gesamt-Token", + "context.stats.usage": "Nutzung", + "context.stats.inputTokens": "Eingabe-Token", + "context.stats.outputTokens": "Ausgabe-Token", + "context.stats.reasoningTokens": "Reasoning-Token", + "context.stats.cacheTokens": "Cache-Token (lesen/schreiben)", + "context.stats.userMessages": "Benutzernachrichten", + "context.stats.assistantMessages": "Assistentennachrichten", + "context.stats.totalCost": "Gesamtkosten", + "context.stats.sessionCreated": "Sitzung erstellt", + "context.stats.lastActivity": "Letzte Aktivität", + + "context.usage.tokens": "Token", + "context.usage.usage": "Nutzung", + "context.usage.cost": "Kosten", + "context.usage.clickToView": "Klicken, um Kontext anzuzeigen", + "context.usage.view": "Kontextnutzung anzeigen", + + "language.en": "Englisch", + "language.zh": "Chinesisch (Vereinfacht)", + "language.zht": "Chinesisch (Traditionell)", + "language.ko": "Koreanisch", + "language.de": "Deutsch", + "language.es": "Spanisch", + "language.fr": "Französisch", + "language.ja": "Japanisch", + "language.da": "Dänisch", + "language.ru": "Russisch", + "language.pl": "Polnisch", + "language.ar": "Arabisch", + "language.no": "Norwegisch", + "language.br": "Portugiesisch (Brasilien)", + + "toast.language.title": "Sprache", + "toast.language.description": "Zu {{language}} gewechselt", + + "toast.theme.title": "Thema gewechselt", + "toast.scheme.title": "Farbschema", + + "toast.permissions.autoaccept.on.title": "Änderungen werden automatisch akzeptiert", + "toast.permissions.autoaccept.on.description": "Bearbeitungs- und Schreibrechte werden automatisch genehmigt", + "toast.permissions.autoaccept.off.title": "Automatische Annahme von Änderungen gestoppt", + "toast.permissions.autoaccept.off.description": "Bearbeitungs- und Schreibrechte erfordern Genehmigung", + + "toast.model.none.title": "Kein Modell ausgewählt", + "toast.model.none.description": "Verbinden Sie einen Anbieter, um diese Sitzung zusammenzufassen", + + "toast.file.loadFailed.title": "Datei konnte nicht geladen werden", + + "toast.session.share.copyFailed.title": "URL konnte nicht in die Zwischenablage kopiert werden", + "toast.session.share.success.title": "Sitzung geteilt", + "toast.session.share.success.description": "Teilen-URL in die Zwischenablage kopiert!", + "toast.session.share.failed.title": "Sitzung konnte nicht geteilt werden", + "toast.session.share.failed.description": "Beim Teilen der Sitzung ist ein Fehler aufgetreten", + + "toast.session.unshare.success.title": "Teilen der Sitzung aufgehoben", + "toast.session.unshare.success.description": "Teilen der Sitzung erfolgreich aufgehoben!", + "toast.session.unshare.failed.title": "Aufheben des Teilens fehlgeschlagen", + "toast.session.unshare.failed.description": "Beim Aufheben des Teilens ist ein Fehler aufgetreten", + + "toast.session.listFailed.title": "Sitzungen für {{project}} konnten nicht geladen werden", + + "toast.update.title": "Update verfügbar", + "toast.update.description": "Eine neue Version von OpenCode ({{version}}) ist zur Installation verfügbar.", + "toast.update.action.installRestart": "Installieren und neu starten", + "toast.update.action.notYet": "Noch nicht", + + "error.page.title": "Etwas ist schiefgelaufen", + "error.page.description": "Beim Laden der Anwendung ist ein Fehler aufgetreten.", + "error.page.details.label": "Fehlerdetails", + "error.page.action.restart": "Neustart", + "error.page.action.checking": "Prüfen...", + "error.page.action.checkUpdates": "Nach Updates suchen", + "error.page.action.updateTo": "Auf {{version}} aktualisieren", + "error.page.report.prefix": "Bitte melden Sie diesen Fehler dem OpenCode-Team", + "error.page.report.discord": "auf Discord", + "error.page.version": "Version: {{version}}", + + "error.dev.rootNotFound": + "Wurzelelement nicht gefunden. Haben Sie vergessen, es in Ihre index.html aufzunehmen? Oder wurde das id-Attribut falsch geschrieben?", + + "error.globalSync.connectFailed": "Verbindung zum Server fehlgeschlagen. Läuft ein Server unter `{{url}}`?", + + "error.chain.unknown": "Unbekannter Fehler", + "error.chain.causedBy": "Verursacht durch:", + "error.chain.apiError": "API-Fehler", + "error.chain.status": "Status: {{status}}", + "error.chain.retryable": "Wiederholbar: {{retryable}}", + "error.chain.responseBody": "Antwort-Body:\n{{body}}", + "error.chain.didYouMean": "Meinten Sie: {{suggestions}}", + "error.chain.modelNotFound": "Modell nicht gefunden: {{provider}}/{{model}}", + "error.chain.checkConfig": "Überprüfen Sie Ihre Konfiguration (opencode.json) auf Anbieter-/Modellnamen", + "error.chain.mcpFailed": + 'MCP-Server "{{name}}" fehlgeschlagen. Hinweis: OpenCode unterstützt noch keine MCP-Authentifizierung.', + "error.chain.providerAuthFailed": "Anbieter-Authentifizierung fehlgeschlagen ({{provider}}): {{message}}", + "error.chain.providerInitFailed": + 'Anbieter "{{provider}}" konnte nicht initialisiert werden. Überprüfen Sie Anmeldeinformationen und Konfiguration.', + "error.chain.configJsonInvalid": "Konfigurationsdatei unter {{path}} ist kein gültiges JSON(C)", + "error.chain.configJsonInvalidWithMessage": + "Konfigurationsdatei unter {{path}} ist kein gültiges JSON(C): {{message}}", + "error.chain.configDirectoryTypo": + 'Verzeichnis "{{dir}}" in {{path}} ist ungültig. Benennen Sie das Verzeichnis in "{{suggestion}}" um oder entfernen Sie es. Dies ist ein häufiger Tippfehler.', + "error.chain.configFrontmatterError": "Frontmatter in {{path}} konnte nicht geparst werden:\n{{message}}", + "error.chain.configInvalid": "Konfigurationsdatei unter {{path}} ist ungültig", + "error.chain.configInvalidWithMessage": "Konfigurationsdatei unter {{path}} ist ungültig: {{message}}", + + "notification.permission.title": "Berechtigung erforderlich", + "notification.permission.description": "{{sessionTitle}} in {{projectName}} benötigt Berechtigung", + "notification.question.title": "Frage", + "notification.question.description": "{{sessionTitle}} in {{projectName}} hat eine Frage", + "notification.action.goToSession": "Zur Sitzung gehen", + + "notification.session.responseReady.title": "Antwort bereit", + "notification.session.error.title": "Sitzungsfehler", + "notification.session.error.fallbackDescription": "Ein Fehler ist aufgetreten", + + "home.recentProjects": "Letzte Projekte", + "home.empty.title": "Keine letzten Projekte", + "home.empty.description": "Starten Sie, indem Sie ein lokales Projekt öffnen", + + "session.tab.session": "Sitzung", + "session.tab.review": "Überprüfung", + "session.tab.context": "Kontext", + "session.panel.reviewAndFiles": "Überprüfung und Dateien", + "session.review.filesChanged": "{{count}} Dateien geändert", + "session.review.loadingChanges": "Lade Änderungen...", + "session.review.empty": "Noch keine Änderungen in dieser Sitzung", + "session.messages.renderEarlier": "Frühere Nachrichten rendern", + "session.messages.loadingEarlier": "Lade frühere Nachrichten...", + "session.messages.loadEarlier": "Frühere Nachrichten laden", + "session.messages.loading": "Lade Nachrichten...", + + "session.context.addToContext": "{{selection}} zum Kontext hinzufügen", + + "session.new.worktree.main": "Haupt-Branch", + "session.new.worktree.mainWithBranch": "Haupt-Branch ({{branch}})", + "session.new.worktree.create": "Neuen Worktree erstellen", + "session.new.lastModified": "Zuletzt geändert", + + "session.header.search.placeholder": "{{project}} durchsuchen", + "session.header.searchFiles": "Dateien suchen", + + "session.share.popover.title": "Im Web veröffentlichen", + "session.share.popover.description.shared": + "Diese Sitzung ist öffentlich im Web. Sie ist für jeden mit dem Link zugänglich.", + "session.share.popover.description.unshared": + "Sitzung öffentlich im Web teilen. Sie wird für jeden mit dem Link zugänglich sein.", + "session.share.action.share": "Teilen", + "session.share.action.publish": "Veröffentlichen", + "session.share.action.publishing": "Veröffentliche...", + "session.share.action.unpublish": "Veröffentlichung aufheben", + "session.share.action.unpublishing": "Hebe Veröffentlichung auf...", + "session.share.action.view": "Ansehen", + "session.share.copy.copied": "Kopiert", + "session.share.copy.copyLink": "Link kopieren", + + "lsp.tooltip.none": "Keine LSP-Server", + "lsp.label.connected": "{{count}} LSP", + + "prompt.loading": "Lade Prompt...", + "terminal.loading": "Lade Terminal...", + "terminal.title": "Terminal", + "terminal.title.numbered": "Terminal {{number}}", + "terminal.close": "Terminal schließen", + + "common.closeTab": "Tab schließen", + "common.dismiss": "Verwerfen", + "common.requestFailed": "Anfrage fehlgeschlagen", + "common.moreOptions": "Weitere Optionen", + "common.learnMore": "Mehr erfahren", + "common.rename": "Umbenennen", + "common.reset": "Zurücksetzen", + "common.archive": "Archivieren", + "common.delete": "Löschen", + "common.close": "Schließen", + "common.edit": "Bearbeiten", + "common.loadMore": "Mehr laden", + + "sidebar.nav.projectsAndSessions": "Projekte und Sitzungen", + "sidebar.settings": "Einstellungen", + "sidebar.help": "Hilfe", + "sidebar.workspaces.enable": "Arbeitsbereiche aktivieren", + "sidebar.workspaces.disable": "Arbeitsbereiche deaktivieren", + "sidebar.gettingStarted.title": "Erste Schritte", + "sidebar.gettingStarted.line1": "OpenCode enthält kostenlose Modelle, damit Sie sofort loslegen können.", + "sidebar.gettingStarted.line2": + "Verbinden Sie einen beliebigen Anbieter, um Modelle wie Claude, GPT, Gemini usw. zu nutzen.", + "sidebar.project.recentSessions": "Letzte Sitzungen", + "sidebar.project.viewAllSessions": "Alle Sitzungen anzeigen", + + "settings.section.desktop": "Desktop", + "settings.tab.general": "Allgemein", + "settings.tab.shortcuts": "Tastenkombinationen", + + "settings.general.section.appearance": "Erscheinungsbild", + "settings.general.section.notifications": "Systembenachrichtigungen", + "settings.general.section.sounds": "Soundeffekte", + + "settings.general.row.language.title": "Sprache", + "settings.general.row.language.description": "Die Anzeigesprache für OpenCode ändern", + "settings.general.row.appearance.title": "Erscheinungsbild", + "settings.general.row.appearance.description": "Anpassen, wie OpenCode auf Ihrem Gerät aussieht", + "settings.general.row.theme.title": "Thema", + "settings.general.row.theme.description": "Das Thema von OpenCode anpassen.", + "settings.general.row.font.title": "Schriftart", + "settings.general.row.font.description": "Die in Codeblöcken verwendete Monospace-Schriftart anpassen", + + "settings.general.notifications.agent.title": "Agent", + "settings.general.notifications.agent.description": + "Systembenachrichtigung anzeigen, wenn der Agent fertig ist oder Aufmerksamkeit benötigt", + "settings.general.notifications.permissions.title": "Berechtigungen", + "settings.general.notifications.permissions.description": + "Systembenachrichtigung anzeigen, wenn eine Berechtigung erforderlich ist", + "settings.general.notifications.errors.title": "Fehler", + "settings.general.notifications.errors.description": "Systembenachrichtigung anzeigen, wenn ein Fehler auftritt", + + "settings.general.sounds.agent.title": "Agent", + "settings.general.sounds.agent.description": "Ton abspielen, wenn der Agent fertig ist oder Aufmerksamkeit benötigt", + "settings.general.sounds.permissions.title": "Berechtigungen", + "settings.general.sounds.permissions.description": "Ton abspielen, wenn eine Berechtigung erforderlich ist", + "settings.general.sounds.errors.title": "Fehler", + "settings.general.sounds.errors.description": "Ton abspielen, wenn ein Fehler auftritt", + + "settings.shortcuts.title": "Tastenkombinationen", + "settings.shortcuts.reset.button": "Auf Standard zurücksetzen", + "settings.shortcuts.reset.toast.title": "Tastenkombinationen zurückgesetzt", + "settings.shortcuts.reset.toast.description": "Die Tastenkombinationen wurden auf die Standardwerte zurückgesetzt.", + "settings.shortcuts.conflict.title": "Tastenkombination bereits in Verwendung", + "settings.shortcuts.conflict.description": "{{keybind}} ist bereits {{titles}} zugewiesen.", + "settings.shortcuts.unassigned": "Nicht zugewiesen", + "settings.shortcuts.pressKeys": "Tasten drücken", + "settings.shortcuts.search.placeholder": "Tastenkürzel suchen", + "settings.shortcuts.search.empty": "Keine Tastenkürzel gefunden", + + "settings.shortcuts.group.general": "Allgemein", + "settings.shortcuts.group.session": "Sitzung", + "settings.shortcuts.group.navigation": "Navigation", + "settings.shortcuts.group.modelAndAgent": "Modell und Agent", + "settings.shortcuts.group.terminal": "Terminal", + "settings.shortcuts.group.prompt": "Prompt", + + "settings.providers.title": "Anbieter", + "settings.providers.description": "Anbietereinstellungen können hier konfiguriert werden.", + "settings.models.title": "Modelle", + "settings.models.description": "Modelleinstellungen können hier konfiguriert werden.", + "settings.agents.title": "Agenten", + "settings.agents.description": "Agenteneinstellungen können hier konfiguriert werden.", + "settings.commands.title": "Befehle", + "settings.commands.description": "Befehlseinstellungen können hier konfiguriert werden.", + "settings.mcp.title": "MCP", + "settings.mcp.description": "MCP-Einstellungen können hier konfiguriert werden.", + + "settings.permissions.title": "Berechtigungen", + "settings.permissions.description": "Steuern Sie, welche Tools der Server standardmäßig verwenden darf.", + "settings.permissions.section.tools": "Tools", + "settings.permissions.toast.updateFailed.title": "Berechtigungen konnten nicht aktualisiert werden", + + "settings.permissions.action.allow": "Erlauben", + "settings.permissions.action.ask": "Fragen", + "settings.permissions.action.deny": "Verweigern", + + "settings.permissions.tool.read.title": "Lesen", + "settings.permissions.tool.read.description": "Lesen einer Datei (stimmt mit dem Dateipfad überein)", + "settings.permissions.tool.edit.title": "Bearbeiten", + "settings.permissions.tool.edit.description": + "Dateien ändern, einschließlich Bearbeitungen, Schreibvorgängen, Patches und Mehrfachbearbeitungen", + "settings.permissions.tool.glob.title": "Glob", + "settings.permissions.tool.glob.description": "Dateien mithilfe von Glob-Mustern abgleichen", + "settings.permissions.tool.grep.title": "Grep", + "settings.permissions.tool.grep.description": "Dateiinhalte mit regulären Ausdrücken durchsuchen", + "settings.permissions.tool.list.title": "Auflisten", + "settings.permissions.tool.list.description": "Dateien in einem Verzeichnis auflisten", + "settings.permissions.tool.bash.title": "Bash", + "settings.permissions.tool.bash.description": "Shell-Befehle ausführen", + "settings.permissions.tool.task.title": "Aufgabe", + "settings.permissions.tool.task.description": "Unteragenten starten", + "settings.permissions.tool.skill.title": "Fähigkeit", + "settings.permissions.tool.skill.description": "Eine Fähigkeit nach Namen laden", + "settings.permissions.tool.lsp.title": "LSP", + "settings.permissions.tool.lsp.description": "Language-Server-Abfragen ausführen", + "settings.permissions.tool.todoread.title": "Todo lesen", + "settings.permissions.tool.todoread.description": "Die Todo-Liste lesen", + "settings.permissions.tool.todowrite.title": "Todo schreiben", + "settings.permissions.tool.todowrite.description": "Die Todo-Liste aktualisieren", + "settings.permissions.tool.webfetch.title": "Web-Abruf", + "settings.permissions.tool.webfetch.description": "Inhalt von einer URL abrufen", + "settings.permissions.tool.websearch.title": "Web-Suche", + "settings.permissions.tool.websearch.description": "Das Web durchsuchen", + "settings.permissions.tool.codesearch.title": "Code-Suche", + "settings.permissions.tool.codesearch.description": "Code im Web durchsuchen", + "settings.permissions.tool.external_directory.title": "Externes Verzeichnis", + "settings.permissions.tool.external_directory.description": "Zugriff auf Dateien außerhalb des Projektverzeichnisses", + "settings.permissions.tool.doom_loop.title": "Doom Loop", + "settings.permissions.tool.doom_loop.description": "Wiederholte Tool-Aufrufe mit identischer Eingabe erkennen", + + "session.delete.failed.title": "Sitzung konnte nicht gelöscht werden", + "session.delete.title": "Sitzung löschen", + "session.delete.confirm": 'Sitzung "{{name}}" löschen?', + "session.delete.button": "Sitzung löschen", + + "workspace.new": "Neuer Arbeitsbereich", + "workspace.type.local": "lokal", + "workspace.type.sandbox": "Sandbox", + "workspace.create.failed.title": "Arbeitsbereich konnte nicht erstellt werden", + "workspace.delete.failed.title": "Arbeitsbereich konnte nicht gelöscht werden", + "workspace.resetting.title": "Arbeitsbereich wird zurückgesetzt", + "workspace.resetting.description": "Dies kann eine Minute dauern.", + "workspace.reset.failed.title": "Arbeitsbereich konnte nicht zurückgesetzt werden", + "workspace.reset.success.title": "Arbeitsbereich zurückgesetzt", + "workspace.reset.success.description": "Der Arbeitsbereich entspricht jetzt dem Standard-Branch.", + "workspace.status.checking": "Suche nach nicht zusammengeführten Änderungen...", + "workspace.status.error": "Git-Status konnte nicht überprüft werden.", + "workspace.status.clean": "Keine nicht zusammengeführten Änderungen erkannt.", + "workspace.status.dirty": "Nicht zusammengeführte Änderungen in diesem Arbeitsbereich erkannt.", + "workspace.delete.title": "Arbeitsbereich löschen", + "workspace.delete.confirm": 'Arbeitsbereich "{{name}}" löschen?', + "workspace.delete.button": "Arbeitsbereich löschen", + "workspace.reset.title": "Arbeitsbereich zurücksetzen", + "workspace.reset.confirm": 'Arbeitsbereich "{{name}}" zurücksetzen?', + "workspace.reset.button": "Arbeitsbereich zurücksetzen", + "workspace.reset.archived.none": "Keine aktiven Sitzungen werden archiviert.", + "workspace.reset.archived.one": "1 Sitzung wird archiviert.", + "workspace.reset.archived.many": "{{count}} Sitzungen werden archiviert.", + "workspace.reset.note": "Dadurch wird der Arbeitsbereich auf den Standard-Branch zurückgesetzt.", +} satisfies Partial> diff --git a/packages/app/src/i18n/en.ts b/packages/app/src/i18n/en.ts new file mode 100644 index 00000000000..ed00ff18be7 --- /dev/null +++ b/packages/app/src/i18n/en.ts @@ -0,0 +1,661 @@ +export const dict = { + "command.category.suggested": "Suggested", + "command.category.view": "View", + "command.category.project": "Project", + "command.category.provider": "Provider", + "command.category.server": "Server", + "command.category.session": "Session", + "command.category.theme": "Theme", + "command.category.language": "Language", + "command.category.file": "File", + "command.category.terminal": "Terminal", + "command.category.model": "Model", + "command.category.mcp": "MCP", + "command.category.agent": "Agent", + "command.category.permissions": "Permissions", + "command.category.workspace": "Workspace", + "command.category.settings": "Settings", + + "theme.scheme.system": "System", + "theme.scheme.light": "Light", + "theme.scheme.dark": "Dark", + + "command.sidebar.toggle": "Toggle sidebar", + "command.project.open": "Open project", + "command.provider.connect": "Connect provider", + "command.server.switch": "Switch server", + "command.settings.open": "Open settings", + "command.session.previous": "Previous session", + "command.session.next": "Next session", + "command.session.archive": "Archive session", + + "command.palette": "Command palette", + + "command.theme.cycle": "Cycle theme", + "command.theme.set": "Use theme: {{theme}}", + "command.theme.scheme.cycle": "Cycle color scheme", + "command.theme.scheme.set": "Use color scheme: {{scheme}}", + + "command.language.cycle": "Cycle language", + "command.language.set": "Use language: {{language}}", + + "command.session.new": "New session", + "command.file.open": "Open file", + "command.file.open.description": "Search files and commands", + "command.terminal.toggle": "Toggle terminal", + "command.review.toggle": "Toggle review", + "command.terminal.new": "New terminal", + "command.terminal.new.description": "Create a new terminal tab", + "command.steps.toggle": "Toggle steps", + "command.steps.toggle.description": "Show or hide steps for the current message", + "command.message.previous": "Previous message", + "command.message.previous.description": "Go to the previous user message", + "command.message.next": "Next message", + "command.message.next.description": "Go to the next user message", + "command.model.choose": "Choose model", + "command.model.choose.description": "Select a different model", + "command.mcp.toggle": "Toggle MCPs", + "command.mcp.toggle.description": "Toggle MCPs", + "command.agent.cycle": "Cycle agent", + "command.agent.cycle.description": "Switch to the next agent", + "command.agent.cycle.reverse": "Cycle agent backwards", + "command.agent.cycle.reverse.description": "Switch to the previous agent", + "command.model.variant.cycle": "Cycle thinking effort", + "command.model.variant.cycle.description": "Switch to the next effort level", + "command.permissions.autoaccept.enable": "Auto-accept edits", + "command.permissions.autoaccept.disable": "Stop auto-accepting edits", + "command.session.undo": "Undo", + "command.session.undo.description": "Undo the last message", + "command.session.redo": "Redo", + "command.session.redo.description": "Redo the last undone message", + "command.session.compact": "Compact session", + "command.session.compact.description": "Summarize the session to reduce context size", + "command.session.fork": "Fork from message", + "command.session.fork.description": "Create a new session from a previous message", + "command.session.share": "Share session", + "command.session.share.description": "Share this session and copy the URL to clipboard", + "command.session.unshare": "Unshare session", + "command.session.unshare.description": "Stop sharing this session", + + "palette.search.placeholder": "Search files and commands", + "palette.empty": "No results found", + "palette.group.commands": "Commands", + "palette.group.files": "Files", + + "dialog.provider.search.placeholder": "Search providers", + "dialog.provider.empty": "No providers found", + "dialog.provider.group.popular": "Popular", + "dialog.provider.group.other": "Other", + "dialog.provider.tag.recommended": "Recommended", + "dialog.provider.anthropic.note": "Connect with Claude Pro/Max or API key", + + "dialog.model.select.title": "Select model", + "dialog.model.search.placeholder": "Search models", + "dialog.model.empty": "No model results", + "dialog.model.manage": "Manage models", + "dialog.model.manage.description": "Customize which models appear in the model selector.", + + "dialog.model.unpaid.freeModels.title": "Free models provided by OpenCode", + "dialog.model.unpaid.addMore.title": "Add more models from popular providers", + + "dialog.provider.viewAll": "View all providers", + + "provider.connect.title": "Connect {{provider}}", + "provider.connect.title.anthropicProMax": "Login with Claude Pro/Max", + "provider.connect.selectMethod": "Select login method for {{provider}}.", + "provider.connect.method.apiKey": "API key", + "provider.connect.status.inProgress": "Authorization in progress...", + "provider.connect.status.waiting": "Waiting for authorization...", + "provider.connect.status.failed": "Authorization failed: {{error}}", + "provider.connect.apiKey.description": + "Enter your {{provider}} API key to connect your account and use {{provider}} models in OpenCode.", + "provider.connect.apiKey.label": "{{provider}} API key", + "provider.connect.apiKey.placeholder": "API key", + "provider.connect.apiKey.required": "API key is required", + "provider.connect.opencodeZen.line1": + "OpenCode Zen gives you access to a curated set of reliable optimized models for coding agents.", + "provider.connect.opencodeZen.line2": + "With a single API key you'll get access to models such as Claude, GPT, Gemini, GLM and more.", + "provider.connect.opencodeZen.visit.prefix": "Visit ", + "provider.connect.opencodeZen.visit.link": "opencode.ai/zen", + "provider.connect.opencodeZen.visit.suffix": " to collect your API key.", + "provider.connect.oauth.code.visit.prefix": "Visit ", + "provider.connect.oauth.code.visit.link": "this link", + "provider.connect.oauth.code.visit.suffix": + " to collect your authorization code to connect your account and use {{provider}} models in OpenCode.", + "provider.connect.oauth.code.label": "{{method}} authorization code", + "provider.connect.oauth.code.placeholder": "Authorization code", + "provider.connect.oauth.code.required": "Authorization code is required", + "provider.connect.oauth.code.invalid": "Invalid authorization code", + "provider.connect.oauth.auto.visit.prefix": "Visit ", + "provider.connect.oauth.auto.visit.link": "this link", + "provider.connect.oauth.auto.visit.suffix": + " and enter the code below to connect your account and use {{provider}} models in OpenCode.", + "provider.connect.oauth.auto.confirmationCode": "Confirmation code", + "provider.connect.toast.connected.title": "{{provider}} connected", + "provider.connect.toast.connected.description": "{{provider}} models are now available to use.", + + "model.tag.free": "Free", + "model.tag.latest": "Latest", + "model.provider.anthropic": "Anthropic", + "model.provider.openai": "OpenAI", + "model.provider.google": "Google", + "model.provider.xai": "xAI", + "model.provider.meta": "Meta", + "model.input.text": "text", + "model.input.image": "image", + "model.input.audio": "audio", + "model.input.video": "video", + "model.input.pdf": "pdf", + "model.tooltip.allows": "Allows: {{inputs}}", + "model.tooltip.reasoning.allowed": "Allows reasoning", + "model.tooltip.reasoning.none": "No reasoning", + "model.tooltip.context": "Context limit {{limit}}", + + "common.search.placeholder": "Search", + "common.goBack": "Go back", + "common.loading": "Loading", + "common.loading.ellipsis": "...", + "common.cancel": "Cancel", + "common.submit": "Submit", + "common.save": "Save", + "common.saving": "Saving...", + "common.default": "Default", + "common.attachment": "attachment", + + "prompt.placeholder.shell": "Enter shell command...", + "prompt.placeholder.normal": 'Ask anything... "{{example}}"', + "prompt.mode.shell": "Shell", + "prompt.mode.shell.exit": "esc to exit", + + "prompt.example.1": "Fix a TODO in the codebase", + "prompt.example.2": "What is the tech stack of this project?", + "prompt.example.3": "Fix broken tests", + "prompt.example.4": "Explain how authentication works", + "prompt.example.5": "Find and fix security vulnerabilities", + "prompt.example.6": "Add unit tests for the user service", + "prompt.example.7": "Refactor this function to be more readable", + "prompt.example.8": "What does this error mean?", + "prompt.example.9": "Help me debug this issue", + "prompt.example.10": "Generate API documentation", + "prompt.example.11": "Optimize database queries", + "prompt.example.12": "Add input validation", + "prompt.example.13": "Create a new component for...", + "prompt.example.14": "How do I deploy this project?", + "prompt.example.15": "Review my code for best practices", + "prompt.example.16": "Add error handling to this function", + "prompt.example.17": "Explain this regex pattern", + "prompt.example.18": "Convert this to TypeScript", + "prompt.example.19": "Add logging throughout the codebase", + "prompt.example.20": "What dependencies are outdated?", + "prompt.example.21": "Help me write a migration script", + "prompt.example.22": "Implement caching for this endpoint", + "prompt.example.23": "Add pagination to this list", + "prompt.example.24": "Create a CLI command for...", + "prompt.example.25": "How do environment variables work here?", + + "prompt.popover.emptyResults": "No matching results", + "prompt.popover.emptyCommands": "No matching commands", + "prompt.dropzone.label": "Drop images or PDFs here", + "prompt.slash.badge.custom": "custom", + "prompt.context.active": "active", + "prompt.context.includeActiveFile": "Include active file", + "prompt.context.removeActiveFile": "Remove active file from context", + "prompt.context.removeFile": "Remove file from context", + "prompt.action.attachFile": "Attach file", + "prompt.attachment.remove": "Remove attachment", + "prompt.action.send": "Send", + "prompt.action.stop": "Stop", + + "prompt.toast.pasteUnsupported.title": "Unsupported paste", + "prompt.toast.pasteUnsupported.description": "Only images or PDFs can be pasted here.", + "prompt.toast.modelAgentRequired.title": "Select an agent and model", + "prompt.toast.modelAgentRequired.description": "Choose an agent and model before sending a prompt.", + "prompt.toast.worktreeCreateFailed.title": "Failed to create worktree", + "prompt.toast.sessionCreateFailed.title": "Failed to create session", + "prompt.toast.shellSendFailed.title": "Failed to send shell command", + "prompt.toast.commandSendFailed.title": "Failed to send command", + "prompt.toast.promptSendFailed.title": "Failed to send prompt", + + "dialog.mcp.title": "MCPs", + "dialog.mcp.description": "{{enabled}} of {{total}} enabled", + "dialog.mcp.empty": "No MCPs configured", + + "mcp.status.connected": "connected", + "mcp.status.failed": "failed", + "mcp.status.needs_auth": "needs auth", + "mcp.status.disabled": "disabled", + + "dialog.fork.empty": "No messages to fork from", + + "dialog.directory.search.placeholder": "Search folders", + "dialog.directory.empty": "No folders found", + + "dialog.server.title": "Servers", + "dialog.server.description": "Switch which OpenCode server this app connects to.", + "dialog.server.search.placeholder": "Search servers", + "dialog.server.empty": "No servers yet", + "dialog.server.add.title": "Add a server", + "dialog.server.add.url": "Server URL", + "dialog.server.add.placeholder": "http://localhost:4096", + "dialog.server.add.error": "Could not connect to server", + "dialog.server.add.checking": "Checking...", + "dialog.server.add.button": "Add", + "dialog.server.default.title": "Default server", + "dialog.server.default.description": + "Connect to this server on app launch instead of starting a local server. Requires restart.", + "dialog.server.default.none": "No server selected", + "dialog.server.default.set": "Set current server as default", + "dialog.server.default.clear": "Clear", + "dialog.server.action.remove": "Remove server", + + "dialog.project.edit.title": "Edit project", + "dialog.project.edit.name": "Name", + "dialog.project.edit.icon": "Icon", + "dialog.project.edit.icon.alt": "Project icon", + "dialog.project.edit.icon.hint": "Click or drag an image", + "dialog.project.edit.icon.recommended": "Recommended: 128x128px", + "dialog.project.edit.color": "Color", + "dialog.project.edit.color.select": "Select {{color}} color", + "dialog.project.edit.worktree.startup": "Workspace startup script", + "dialog.project.edit.worktree.startup.description": "Runs after creating a new workspace (worktree).", + "dialog.project.edit.worktree.startup.placeholder": "e.g. bun install", + + "context.breakdown.title": "Context Breakdown", + "context.breakdown.note": 'Approximate breakdown of input tokens. "Other" includes tool definitions and overhead.', + "context.breakdown.system": "System", + "context.breakdown.user": "User", + "context.breakdown.assistant": "Assistant", + "context.breakdown.tool": "Tool Calls", + "context.breakdown.other": "Other", + + "context.systemPrompt.title": "System Prompt", + "context.rawMessages.title": "Raw messages", + + "context.stats.session": "Session", + "context.stats.messages": "Messages", + "context.stats.provider": "Provider", + "context.stats.model": "Model", + "context.stats.limit": "Context Limit", + "context.stats.totalTokens": "Total Tokens", + "context.stats.usage": "Usage", + "context.stats.inputTokens": "Input Tokens", + "context.stats.outputTokens": "Output Tokens", + "context.stats.reasoningTokens": "Reasoning Tokens", + "context.stats.cacheTokens": "Cache Tokens (read/write)", + "context.stats.userMessages": "User Messages", + "context.stats.assistantMessages": "Assistant Messages", + "context.stats.totalCost": "Total Cost", + "context.stats.sessionCreated": "Session Created", + "context.stats.lastActivity": "Last Activity", + + "context.usage.tokens": "Tokens", + "context.usage.usage": "Usage", + "context.usage.cost": "Cost", + "context.usage.clickToView": "Click to view context", + "context.usage.view": "View context usage", + + "language.en": "English", + "language.zh": "Chinese (Simplified)", + "language.zht": "Chinese (Traditional)", + "language.ko": "Korean", + "language.de": "German", + "language.es": "Spanish", + "language.fr": "French", + "language.ja": "Japanese", + "language.da": "Danish", + "language.ru": "Russian", + "language.pl": "Polish", + "language.ar": "Arabic", + "language.no": "Norwegian", + "language.br": "Portuguese (Brazil)", + + "toast.language.title": "Language", + "toast.language.description": "Switched to {{language}}", + + "toast.theme.title": "Theme switched", + "toast.scheme.title": "Color scheme", + + "toast.permissions.autoaccept.on.title": "Auto-accepting edits", + "toast.permissions.autoaccept.on.description": "Edit and write permissions will be automatically approved", + "toast.permissions.autoaccept.off.title": "Stopped auto-accepting edits", + "toast.permissions.autoaccept.off.description": "Edit and write permissions will require approval", + + "toast.model.none.title": "No model selected", + "toast.model.none.description": "Connect a provider to summarize this session", + + "toast.file.loadFailed.title": "Failed to load file", + + "toast.session.share.copyFailed.title": "Failed to copy URL to clipboard", + "toast.session.share.success.title": "Session shared", + "toast.session.share.success.description": "Share URL copied to clipboard!", + "toast.session.share.failed.title": "Failed to share session", + "toast.session.share.failed.description": "An error occurred while sharing the session", + + "toast.session.unshare.success.title": "Session unshared", + "toast.session.unshare.success.description": "Session unshared successfully!", + "toast.session.unshare.failed.title": "Failed to unshare session", + "toast.session.unshare.failed.description": "An error occurred while unsharing the session", + + "toast.session.listFailed.title": "Failed to load sessions for {{project}}", + + "toast.update.title": "Update available", + "toast.update.description": "A new version of OpenCode ({{version}}) is now available to install.", + "toast.update.action.installRestart": "Install and restart", + "toast.update.action.notYet": "Not yet", + + "error.page.title": "Something went wrong", + "error.page.description": "An error occurred while loading the application.", + "error.page.details.label": "Error Details", + "error.page.action.restart": "Restart", + "error.page.action.checking": "Checking...", + "error.page.action.checkUpdates": "Check for updates", + "error.page.action.updateTo": "Update to {{version}}", + "error.page.report.prefix": "Please report this error to the OpenCode team", + "error.page.report.discord": "on Discord", + "error.page.version": "Version: {{version}}", + + "error.dev.rootNotFound": + "Root element not found. Did you forget to add it to your index.html? Or maybe the id attribute got misspelled?", + + "error.globalSync.connectFailed": "Could not connect to server. Is there a server running at `{{url}}`?", + + "error.chain.unknown": "Unknown error", + "error.chain.causedBy": "Caused by:", + "error.chain.apiError": "API error", + "error.chain.status": "Status: {{status}}", + "error.chain.retryable": "Retryable: {{retryable}}", + "error.chain.responseBody": "Response body:\n{{body}}", + "error.chain.didYouMean": "Did you mean: {{suggestions}}", + "error.chain.modelNotFound": "Model not found: {{provider}}/{{model}}", + "error.chain.checkConfig": "Check your config (opencode.json) provider/model names", + "error.chain.mcpFailed": 'MCP server "{{name}}" failed. Note, OpenCode does not support MCP authentication yet.', + "error.chain.providerAuthFailed": "Provider authentication failed ({{provider}}): {{message}}", + "error.chain.providerInitFailed": + 'Failed to initialize provider "{{provider}}". Check credentials and configuration.', + "error.chain.configJsonInvalid": "Config file at {{path}} is not valid JSON(C)", + "error.chain.configJsonInvalidWithMessage": "Config file at {{path}} is not valid JSON(C): {{message}}", + "error.chain.configDirectoryTypo": + 'Directory "{{dir}}" in {{path}} is not valid. Rename the directory to "{{suggestion}}" or remove it. This is a common typo.', + "error.chain.configFrontmatterError": "Failed to parse frontmatter in {{path}}:\n{{message}}", + "error.chain.configInvalid": "Config file at {{path}} is invalid", + "error.chain.configInvalidWithMessage": "Config file at {{path}} is invalid: {{message}}", + + "notification.permission.title": "Permission required", + "notification.permission.description": "{{sessionTitle}} in {{projectName}} needs permission", + "notification.question.title": "Question", + "notification.question.description": "{{sessionTitle}} in {{projectName}} has a question", + "notification.action.goToSession": "Go to session", + + "notification.session.responseReady.title": "Response ready", + "notification.session.error.title": "Session error", + "notification.session.error.fallbackDescription": "An error occurred", + + "home.recentProjects": "Recent projects", + "home.empty.title": "No recent projects", + "home.empty.description": "Get started by opening a local project", + + "session.tab.session": "Session", + "session.tab.review": "Review", + "session.tab.context": "Context", + "session.panel.reviewAndFiles": "Review and files", + "session.review.filesChanged": "{{count}} Files Changed", + "session.review.loadingChanges": "Loading changes...", + "session.review.empty": "No changes in this session yet", + "session.messages.renderEarlier": "Render earlier messages", + "session.messages.loadingEarlier": "Loading earlier messages...", + "session.messages.loadEarlier": "Load earlier messages", + "session.messages.loading": "Loading messages...", + "session.messages.jumpToLatest": "Jump to latest", + + "session.context.addToContext": "Add {{selection}} to context", + + "session.new.worktree.main": "Main branch", + "session.new.worktree.mainWithBranch": "Main branch ({{branch}})", + "session.new.worktree.create": "Create new worktree", + "session.new.lastModified": "Last modified", + + "session.header.search.placeholder": "Search {{project}}", + "session.header.searchFiles": "Search files", + + "session.share.popover.title": "Publish on web", + "session.share.popover.description.shared": + "This session is public on the web. It is accessible to anyone with the link.", + "session.share.popover.description.unshared": + "Share session publicly on the web. It will be accessible to anyone with the link.", + "session.share.action.share": "Share", + "session.share.action.publish": "Publish", + "session.share.action.publishing": "Publishing...", + "session.share.action.unpublish": "Unpublish", + "session.share.action.unpublishing": "Unpublishing...", + "session.share.action.view": "View", + "session.share.copy.copied": "Copied", + "session.share.copy.copyLink": "Copy link", + + "lsp.tooltip.none": "No LSP servers", + "lsp.label.connected": "{{count}} LSP", + + "prompt.loading": "Loading prompt...", + "terminal.loading": "Loading terminal...", + "terminal.title": "Terminal", + "terminal.title.numbered": "Terminal {{number}}", + "terminal.close": "Close terminal", + "terminal.connectionLost.title": "Connection Lost", + "terminal.connectionLost.description": + "The terminal connection was interrupted. This can happen when the server restarts.", + + "common.closeTab": "Close tab", + "common.dismiss": "Dismiss", + "common.requestFailed": "Request failed", + "common.moreOptions": "More options", + "common.learnMore": "Learn more", + "common.rename": "Rename", + "common.reset": "Reset", + "common.archive": "Archive", + "common.delete": "Delete", + "common.close": "Close", + "common.edit": "Edit", + "common.loadMore": "Load more", + "common.key.esc": "ESC", + + "sidebar.menu.toggle": "Toggle menu", + "sidebar.nav.projectsAndSessions": "Projects and sessions", + "sidebar.settings": "Settings", + "sidebar.help": "Help", + "sidebar.workspaces.enable": "Enable workspaces", + "sidebar.workspaces.disable": "Disable workspaces", + "sidebar.gettingStarted.title": "Getting started", + "sidebar.gettingStarted.line1": "OpenCode includes free models so you can start immediately.", + "sidebar.gettingStarted.line2": "Connect any provider to use models, inc. Claude, GPT, Gemini etc.", + "sidebar.project.recentSessions": "Recent sessions", + "sidebar.project.viewAllSessions": "View all sessions", + + "settings.section.desktop": "Desktop", + "settings.tab.general": "General", + "settings.tab.shortcuts": "Shortcuts", + + "settings.general.section.appearance": "Appearance", + "settings.general.section.notifications": "System notifications", + "settings.general.section.sounds": "Sound effects", + + "settings.general.row.language.title": "Language", + "settings.general.row.language.description": "Change the display language for OpenCode", + "settings.general.row.appearance.title": "Appearance", + "settings.general.row.appearance.description": "Customise how OpenCode looks on your device", + "settings.general.row.theme.title": "Theme", + "settings.general.row.theme.description": "Customise how OpenCode is themed.", + "settings.general.row.font.title": "Font", + "settings.general.row.font.description": "Customise the mono font used in code blocks", + "font.option.ibmPlexMono": "IBM Plex Mono", + "font.option.cascadiaCode": "Cascadia Code", + "font.option.firaCode": "Fira Code", + "font.option.hack": "Hack", + "font.option.inconsolata": "Inconsolata", + "font.option.intelOneMono": "Intel One Mono", + "font.option.jetbrainsMono": "JetBrains Mono", + "font.option.mesloLgs": "Meslo LGS", + "font.option.robotoMono": "Roboto Mono", + "font.option.sourceCodePro": "Source Code Pro", + "font.option.ubuntuMono": "Ubuntu Mono", + "sound.option.alert01": "Alert 01", + "sound.option.alert02": "Alert 02", + "sound.option.alert03": "Alert 03", + "sound.option.alert04": "Alert 04", + "sound.option.alert05": "Alert 05", + "sound.option.alert06": "Alert 06", + "sound.option.alert07": "Alert 07", + "sound.option.alert08": "Alert 08", + "sound.option.alert09": "Alert 09", + "sound.option.alert10": "Alert 10", + "sound.option.bipbop01": "Bip-bop 01", + "sound.option.bipbop02": "Bip-bop 02", + "sound.option.bipbop03": "Bip-bop 03", + "sound.option.bipbop04": "Bip-bop 04", + "sound.option.bipbop05": "Bip-bop 05", + "sound.option.bipbop06": "Bip-bop 06", + "sound.option.bipbop07": "Bip-bop 07", + "sound.option.bipbop08": "Bip-bop 08", + "sound.option.bipbop09": "Bip-bop 09", + "sound.option.bipbop10": "Bip-bop 10", + "sound.option.staplebops01": "Staplebops 01", + "sound.option.staplebops02": "Staplebops 02", + "sound.option.staplebops03": "Staplebops 03", + "sound.option.staplebops04": "Staplebops 04", + "sound.option.staplebops05": "Staplebops 05", + "sound.option.staplebops06": "Staplebops 06", + "sound.option.staplebops07": "Staplebops 07", + "sound.option.nope01": "Nope 01", + "sound.option.nope02": "Nope 02", + "sound.option.nope03": "Nope 03", + "sound.option.nope04": "Nope 04", + "sound.option.nope05": "Nope 05", + "sound.option.nope06": "Nope 06", + "sound.option.nope07": "Nope 07", + "sound.option.nope08": "Nope 08", + "sound.option.nope09": "Nope 09", + "sound.option.nope10": "Nope 10", + "sound.option.nope11": "Nope 11", + "sound.option.nope12": "Nope 12", + "sound.option.yup01": "Yup 01", + "sound.option.yup02": "Yup 02", + "sound.option.yup03": "Yup 03", + "sound.option.yup04": "Yup 04", + "sound.option.yup05": "Yup 05", + "sound.option.yup06": "Yup 06", + + "settings.general.notifications.agent.title": "Agent", + "settings.general.notifications.agent.description": + "Show system notification when the agent is complete or needs attention", + "settings.general.notifications.permissions.title": "Permissions", + "settings.general.notifications.permissions.description": "Show system notification when a permission is required", + "settings.general.notifications.errors.title": "Errors", + "settings.general.notifications.errors.description": "Show system notification when an error occurs", + + "settings.general.sounds.agent.title": "Agent", + "settings.general.sounds.agent.description": "Play sound when the agent is complete or needs attention", + "settings.general.sounds.permissions.title": "Permissions", + "settings.general.sounds.permissions.description": "Play sound when a permission is required", + "settings.general.sounds.errors.title": "Errors", + "settings.general.sounds.errors.description": "Play sound when an error occurs", + + "settings.shortcuts.title": "Keyboard shortcuts", + "settings.shortcuts.reset.button": "Reset to defaults", + "settings.shortcuts.reset.toast.title": "Shortcuts reset", + "settings.shortcuts.reset.toast.description": "Keyboard shortcuts have been reset to defaults.", + "settings.shortcuts.conflict.title": "Shortcut already in use", + "settings.shortcuts.conflict.description": "{{keybind}} is already assigned to {{titles}}.", + "settings.shortcuts.unassigned": "Unassigned", + "settings.shortcuts.pressKeys": "Press keys", + "settings.shortcuts.search.placeholder": "Search shortcuts", + "settings.shortcuts.search.empty": "No shortcuts found", + + "settings.shortcuts.group.general": "General", + "settings.shortcuts.group.session": "Session", + "settings.shortcuts.group.navigation": "Navigation", + "settings.shortcuts.group.modelAndAgent": "Model and agent", + "settings.shortcuts.group.terminal": "Terminal", + "settings.shortcuts.group.prompt": "Prompt", + + "settings.providers.title": "Providers", + "settings.providers.description": "Provider settings will be configurable here.", + "settings.models.title": "Models", + "settings.models.description": "Model settings will be configurable here.", + "settings.agents.title": "Agents", + "settings.agents.description": "Agent settings will be configurable here.", + "settings.commands.title": "Commands", + "settings.commands.description": "Command settings will be configurable here.", + "settings.mcp.title": "MCP", + "settings.mcp.description": "MCP settings will be configurable here.", + + "settings.permissions.title": "Permissions", + "settings.permissions.description": "Control what tools the server can use by default.", + "settings.permissions.section.tools": "Tools", + "settings.permissions.toast.updateFailed.title": "Failed to update permissions", + + "settings.permissions.action.allow": "Allow", + "settings.permissions.action.ask": "Ask", + "settings.permissions.action.deny": "Deny", + + "settings.permissions.tool.read.title": "Read", + "settings.permissions.tool.read.description": "Reading a file (matches the file path)", + "settings.permissions.tool.edit.title": "Edit", + "settings.permissions.tool.edit.description": "Modify files, including edits, writes, patches, and multi-edits", + "settings.permissions.tool.glob.title": "Glob", + "settings.permissions.tool.glob.description": "Match files using glob patterns", + "settings.permissions.tool.grep.title": "Grep", + "settings.permissions.tool.grep.description": "Search file contents using regular expressions", + "settings.permissions.tool.list.title": "List", + "settings.permissions.tool.list.description": "List files within a directory", + "settings.permissions.tool.bash.title": "Bash", + "settings.permissions.tool.bash.description": "Run shell commands", + "settings.permissions.tool.task.title": "Task", + "settings.permissions.tool.task.description": "Launch sub-agents", + "settings.permissions.tool.skill.title": "Skill", + "settings.permissions.tool.skill.description": "Load a skill by name", + "settings.permissions.tool.lsp.title": "LSP", + "settings.permissions.tool.lsp.description": "Run language server queries", + "settings.permissions.tool.todoread.title": "Todo Read", + "settings.permissions.tool.todoread.description": "Read the todo list", + "settings.permissions.tool.todowrite.title": "Todo Write", + "settings.permissions.tool.todowrite.description": "Update the todo list", + "settings.permissions.tool.webfetch.title": "Web Fetch", + "settings.permissions.tool.webfetch.description": "Fetch content from a URL", + "settings.permissions.tool.websearch.title": "Web Search", + "settings.permissions.tool.websearch.description": "Search the web", + "settings.permissions.tool.codesearch.title": "Code Search", + "settings.permissions.tool.codesearch.description": "Search code on the web", + "settings.permissions.tool.external_directory.title": "External Directory", + "settings.permissions.tool.external_directory.description": "Access files outside the project directory", + "settings.permissions.tool.doom_loop.title": "Doom Loop", + "settings.permissions.tool.doom_loop.description": "Detect repeated tool calls with identical input", + + "session.delete.failed.title": "Failed to delete session", + "session.delete.title": "Delete session", + "session.delete.confirm": 'Delete session "{{name}}"?', + "session.delete.button": "Delete session", + + "workspace.new": "New workspace", + "workspace.type.local": "local", + "workspace.type.sandbox": "sandbox", + "workspace.create.failed.title": "Failed to create workspace", + "workspace.delete.failed.title": "Failed to delete workspace", + "workspace.resetting.title": "Resetting workspace", + "workspace.resetting.description": "This may take a minute.", + "workspace.reset.failed.title": "Failed to reset workspace", + "workspace.reset.success.title": "Workspace reset", + "workspace.reset.success.description": "Workspace now matches the default branch.", + "workspace.status.checking": "Checking for unmerged changes...", + "workspace.status.error": "Unable to verify git status.", + "workspace.status.clean": "No unmerged changes detected.", + "workspace.status.dirty": "Unmerged changes detected in this workspace.", + "workspace.delete.title": "Delete workspace", + "workspace.delete.confirm": 'Delete workspace "{{name}}"?', + "workspace.delete.button": "Delete workspace", + "workspace.reset.title": "Reset workspace", + "workspace.reset.confirm": 'Reset workspace "{{name}}"?', + "workspace.reset.button": "Reset workspace", + "workspace.reset.archived.none": "No active sessions will be archived.", + "workspace.reset.archived.one": "1 session will be archived.", + "workspace.reset.archived.many": "{{count}} sessions will be archived.", + "workspace.reset.note": "This will reset the workspace to match the default branch.", +} diff --git a/packages/app/src/i18n/es.ts b/packages/app/src/i18n/es.ts new file mode 100644 index 00000000000..8de149d2f5a --- /dev/null +++ b/packages/app/src/i18n/es.ts @@ -0,0 +1,583 @@ +export const dict = { + "command.category.suggested": "Sugerido", + "command.category.view": "Ver", + "command.category.project": "Proyecto", + "command.category.provider": "Proveedor", + "command.category.server": "Servidor", + "command.category.session": "Sesión", + "command.category.theme": "Tema", + "command.category.language": "Idioma", + "command.category.file": "Archivo", + "command.category.terminal": "Terminal", + "command.category.model": "Modelo", + "command.category.mcp": "MCP", + "command.category.agent": "Agente", + "command.category.permissions": "Permisos", + "command.category.workspace": "Espacio de trabajo", + + "theme.scheme.system": "Sistema", + "theme.scheme.light": "Claro", + "theme.scheme.dark": "Oscuro", + + "command.sidebar.toggle": "Alternar barra lateral", + "command.project.open": "Abrir proyecto", + "command.provider.connect": "Conectar proveedor", + "command.server.switch": "Cambiar servidor", + "command.session.previous": "Sesión anterior", + "command.session.next": "Siguiente sesión", + "command.session.archive": "Archivar sesión", + + "command.palette": "Paleta de comandos", + + "command.theme.cycle": "Alternar tema", + "command.theme.set": "Usar tema: {{theme}}", + "command.theme.scheme.cycle": "Alternar esquema de color", + "command.theme.scheme.set": "Usar esquema de color: {{scheme}}", + + "command.language.cycle": "Alternar idioma", + "command.language.set": "Usar idioma: {{language}}", + + "command.session.new": "Nueva sesión", + "command.file.open": "Abrir archivo", + "command.file.open.description": "Buscar archivos y comandos", + "command.terminal.toggle": "Alternar terminal", + "command.review.toggle": "Alternar revisión", + "command.terminal.new": "Nueva terminal", + "command.terminal.new.description": "Crear una nueva pestaña de terminal", + "command.steps.toggle": "Alternar pasos", + "command.steps.toggle.description": "Mostrar u ocultar pasos para el mensaje actual", + "command.message.previous": "Mensaje anterior", + "command.message.previous.description": "Ir al mensaje de usuario anterior", + "command.message.next": "Siguiente mensaje", + "command.message.next.description": "Ir al siguiente mensaje de usuario", + "command.model.choose": "Elegir modelo", + "command.model.choose.description": "Seleccionar un modelo diferente", + "command.mcp.toggle": "Alternar MCPs", + "command.mcp.toggle.description": "Alternar MCPs", + "command.agent.cycle": "Alternar agente", + "command.agent.cycle.description": "Cambiar al siguiente agente", + "command.agent.cycle.reverse": "Alternar agente hacia atrás", + "command.agent.cycle.reverse.description": "Cambiar al agente anterior", + "command.model.variant.cycle": "Alternar esfuerzo de pensamiento", + "command.model.variant.cycle.description": "Cambiar al siguiente nivel de esfuerzo", + "command.permissions.autoaccept.enable": "Aceptar ediciones automáticamente", + "command.permissions.autoaccept.disable": "Dejar de aceptar ediciones automáticamente", + "command.session.undo": "Deshacer", + "command.session.undo.description": "Deshacer el último mensaje", + "command.session.redo": "Rehacer", + "command.session.redo.description": "Rehacer el último mensaje deshecho", + "command.session.compact": "Compactar sesión", + "command.session.compact.description": "Resumir la sesión para reducir el tamaño del contexto", + "command.session.fork": "Bifurcar desde mensaje", + "command.session.fork.description": "Crear una nueva sesión desde un mensaje anterior", + "command.session.share": "Compartir sesión", + "command.session.share.description": "Compartir esta sesión y copiar la URL al portapapeles", + "command.session.unshare": "Dejar de compartir sesión", + "command.session.unshare.description": "Dejar de compartir esta sesión", + + "palette.search.placeholder": "Buscar archivos y comandos", + "palette.empty": "No se encontraron resultados", + "palette.group.commands": "Comandos", + "palette.group.files": "Archivos", + + "dialog.provider.search.placeholder": "Buscar proveedores", + "dialog.provider.empty": "No se encontraron proveedores", + "dialog.provider.group.popular": "Popular", + "dialog.provider.group.other": "Otro", + "dialog.provider.tag.recommended": "Recomendado", + "dialog.provider.anthropic.note": "Conectar con Claude Pro/Max o clave API", + + "dialog.model.select.title": "Seleccionar modelo", + "dialog.model.search.placeholder": "Buscar modelos", + "dialog.model.empty": "Sin resultados de modelos", + "dialog.model.manage": "Gestionar modelos", + "dialog.model.manage.description": "Personalizar qué modelos aparecen en el selector de modelos.", + + "dialog.model.unpaid.freeModels.title": "Modelos gratuitos proporcionados por OpenCode", + "dialog.model.unpaid.addMore.title": "Añadir más modelos de proveedores populares", + + "dialog.provider.viewAll": "Ver todos los proveedores", + + "provider.connect.title": "Conectar {{provider}}", + "provider.connect.title.anthropicProMax": "Iniciar sesión con Claude Pro/Max", + "provider.connect.selectMethod": "Seleccionar método de inicio de sesión para {{provider}}.", + "provider.connect.method.apiKey": "Clave API", + "provider.connect.status.inProgress": "Autorización en progreso...", + "provider.connect.status.waiting": "Esperando autorización...", + "provider.connect.status.failed": "Autorización fallida: {{error}}", + "provider.connect.apiKey.description": + "Introduce tu clave API de {{provider}} para conectar tu cuenta y usar modelos de {{provider}} en OpenCode.", + "provider.connect.apiKey.label": "Clave API de {{provider}}", + "provider.connect.apiKey.placeholder": "Clave API", + "provider.connect.apiKey.required": "La clave API es obligatoria", + "provider.connect.opencodeZen.line1": + "OpenCode Zen te da acceso a un conjunto curado de modelos fiables optimizados para agentes de programación.", + "provider.connect.opencodeZen.line2": + "Con una sola clave API obtendrás acceso a modelos como Claude, GPT, Gemini, GLM y más.", + "provider.connect.opencodeZen.visit.prefix": "Visita ", + "provider.connect.opencodeZen.visit.suffix": " para obtener tu clave API.", + "provider.connect.oauth.code.visit.prefix": "Visita ", + "provider.connect.oauth.code.visit.link": "este enlace", + "provider.connect.oauth.code.visit.suffix": + " para obtener tu código de autorización para conectar tu cuenta y usar modelos de {{provider}} en OpenCode.", + "provider.connect.oauth.code.label": "Código de autorización {{method}}", + "provider.connect.oauth.code.placeholder": "Código de autorización", + "provider.connect.oauth.code.required": "El código de autorización es obligatorio", + "provider.connect.oauth.code.invalid": "Código de autorización inválido", + "provider.connect.oauth.auto.visit.prefix": "Visita ", + "provider.connect.oauth.auto.visit.link": "este enlace", + "provider.connect.oauth.auto.visit.suffix": + " e introduce el código a continuación para conectar tu cuenta y usar modelos de {{provider}} en OpenCode.", + "provider.connect.oauth.auto.confirmationCode": "Código de confirmación", + "provider.connect.toast.connected.title": "{{provider}} conectado", + "provider.connect.toast.connected.description": "Los modelos de {{provider}} ahora están disponibles para usar.", + + "model.tag.free": "Gratis", + "model.tag.latest": "Último", + + "common.search.placeholder": "Buscar", + "common.goBack": "Volver", + "common.loading": "Cargando", + "common.cancel": "Cancelar", + "common.submit": "Enviar", + "common.save": "Guardar", + "common.saving": "Guardando...", + "common.default": "Predeterminado", + "common.attachment": "adjunto", + + "prompt.placeholder.shell": "Introduce comando de shell...", + "prompt.placeholder.normal": 'Pregunta cualquier cosa... "{{example}}"', + "prompt.mode.shell": "Shell", + "prompt.mode.shell.exit": "esc para salir", + + "prompt.example.1": "Arreglar un TODO en el código", + "prompt.example.2": "¿Cuál es el stack tecnológico de este proyecto?", + "prompt.example.3": "Arreglar pruebas rotas", + "prompt.example.4": "Explicar cómo funciona la autenticación", + "prompt.example.5": "Encontrar y arreglar vulnerabilidades de seguridad", + "prompt.example.6": "Añadir pruebas unitarias para el servicio de usuario", + "prompt.example.7": "Refactorizar esta función para que sea más legible", + "prompt.example.8": "¿Qué significa este error?", + "prompt.example.9": "Ayúdame a depurar este problema", + "prompt.example.10": "Generar documentación de API", + "prompt.example.11": "Optimizar consultas a la base de datos", + "prompt.example.12": "Añadir validación de entrada", + "prompt.example.13": "Crear un nuevo componente para...", + "prompt.example.14": "¿Cómo despliego este proyecto?", + "prompt.example.15": "Revisar mi código para mejores prácticas", + "prompt.example.16": "Añadir manejo de errores a esta función", + "prompt.example.17": "Explicar este patrón de regex", + "prompt.example.18": "Convertir esto a TypeScript", + "prompt.example.19": "Añadir logging en todo el código", + "prompt.example.20": "¿Qué dependencias están desactualizadas?", + "prompt.example.21": "Ayúdame a escribir un script de migración", + "prompt.example.22": "Implementar caché para este endpoint", + "prompt.example.23": "Añadir paginación a esta lista", + "prompt.example.24": "Crear un comando CLI para...", + "prompt.example.25": "¿Cómo funcionan las variables de entorno aquí?", + + "prompt.popover.emptyResults": "Sin resultados coincidentes", + "prompt.popover.emptyCommands": "Sin comandos coincidentes", + "prompt.dropzone.label": "Suelta imágenes o PDFs aquí", + "prompt.slash.badge.custom": "personalizado", + "prompt.context.active": "activo", + "prompt.context.includeActiveFile": "Incluir archivo activo", + "prompt.context.removeActiveFile": "Eliminar archivo activo del contexto", + "prompt.context.removeFile": "Eliminar archivo del contexto", + "prompt.action.attachFile": "Adjuntar archivo", + "prompt.attachment.remove": "Eliminar adjunto", + "prompt.action.send": "Enviar", + "prompt.action.stop": "Detener", + + "prompt.toast.pasteUnsupported.title": "Pegado no soportado", + "prompt.toast.pasteUnsupported.description": "Solo se pueden pegar imágenes o PDFs aquí.", + "prompt.toast.modelAgentRequired.title": "Selecciona un agente y modelo", + "prompt.toast.modelAgentRequired.description": "Elige un agente y modelo antes de enviar un prompt.", + "prompt.toast.worktreeCreateFailed.title": "Fallo al crear el árbol de trabajo", + "prompt.toast.sessionCreateFailed.title": "Fallo al crear la sesión", + "prompt.toast.shellSendFailed.title": "Fallo al enviar comando de shell", + "prompt.toast.commandSendFailed.title": "Fallo al enviar comando", + "prompt.toast.promptSendFailed.title": "Fallo al enviar prompt", + + "dialog.mcp.title": "MCPs", + "dialog.mcp.description": "{{enabled}} de {{total}} habilitados", + "dialog.mcp.empty": "No hay MCPs configurados", + + "mcp.status.connected": "conectado", + "mcp.status.failed": "fallido", + "mcp.status.needs_auth": "necesita auth", + "mcp.status.disabled": "deshabilitado", + + "dialog.fork.empty": "No hay mensajes desde donde bifurcar", + + "dialog.directory.search.placeholder": "Buscar carpetas", + "dialog.directory.empty": "No se encontraron carpetas", + + "dialog.server.title": "Servidores", + "dialog.server.description": "Cambiar a qué servidor de OpenCode se conecta esta app.", + "dialog.server.search.placeholder": "Buscar servidores", + "dialog.server.empty": "No hay servidores aún", + "dialog.server.add.title": "Añadir un servidor", + "dialog.server.add.url": "URL del servidor", + "dialog.server.add.placeholder": "http://localhost:4096", + "dialog.server.add.error": "No se pudo conectar al servidor", + "dialog.server.add.checking": "Comprobando...", + "dialog.server.add.button": "Añadir", + "dialog.server.default.title": "Servidor predeterminado", + "dialog.server.default.description": + "Conectar a este servidor al iniciar la app en lugar de iniciar un servidor local. Requiere reinicio.", + "dialog.server.default.none": "Ningún servidor seleccionado", + "dialog.server.default.set": "Establecer servidor actual como predeterminado", + "dialog.server.default.clear": "Limpiar", + "dialog.server.action.remove": "Eliminar servidor", + + "dialog.project.edit.title": "Editar proyecto", + "dialog.project.edit.name": "Nombre", + "dialog.project.edit.icon": "Icono", + "dialog.project.edit.icon.alt": "Icono del proyecto", + "dialog.project.edit.icon.hint": "Haz clic o arrastra una imagen", + "dialog.project.edit.icon.recommended": "Recomendado: 128x128px", + "dialog.project.edit.color": "Color", + "dialog.project.edit.color.select": "Seleccionar color {{color}}", + + "context.breakdown.title": "Desglose de Contexto", + "context.breakdown.note": + 'Desglose aproximado de tokens de entrada. "Otro" incluye definiciones de herramientas y sobrecarga.', + "context.breakdown.system": "Sistema", + "context.breakdown.user": "Usuario", + "context.breakdown.assistant": "Asistente", + "context.breakdown.tool": "Llamadas a herramientas", + "context.breakdown.other": "Otro", + + "context.systemPrompt.title": "Prompt del Sistema", + "context.rawMessages.title": "Mensajes en bruto", + + "context.stats.session": "Sesión", + "context.stats.messages": "Mensajes", + "context.stats.provider": "Proveedor", + "context.stats.model": "Modelo", + "context.stats.limit": "Límite de Contexto", + "context.stats.totalTokens": "Tokens Totales", + "context.stats.usage": "Uso", + "context.stats.inputTokens": "Tokens de Entrada", + "context.stats.outputTokens": "Tokens de Salida", + "context.stats.reasoningTokens": "Tokens de Razonamiento", + "context.stats.cacheTokens": "Tokens de Caché (lectura/escritura)", + "context.stats.userMessages": "Mensajes de Usuario", + "context.stats.assistantMessages": "Mensajes de Asistente", + "context.stats.totalCost": "Costo Total", + "context.stats.sessionCreated": "Sesión Creada", + "context.stats.lastActivity": "Última Actividad", + + "context.usage.tokens": "Tokens", + "context.usage.usage": "Uso", + "context.usage.cost": "Costo", + "context.usage.clickToView": "Haz clic para ver contexto", + "context.usage.view": "Ver uso del contexto", + + "language.en": "Inglés", + "language.zh": "Chino (simplificado)", + "language.zht": "Chino (tradicional)", + "language.ko": "Coreano", + "language.de": "Alemán", + "language.es": "Español", + "language.fr": "Francés", + "language.ja": "Japonés", + "language.da": "Danés", + "language.ru": "Ruso", + "language.pl": "Polaco", + "language.ar": "Árabe", + "language.no": "Noruego", + "language.br": "Portugués (Brasil)", + + "toast.language.title": "Idioma", + "toast.language.description": "Cambiado a {{language}}", + + "toast.theme.title": "Tema cambiado", + "toast.scheme.title": "Esquema de color", + + "toast.permissions.autoaccept.on.title": "Aceptando ediciones automáticamente", + "toast.permissions.autoaccept.on.description": "Los permisos de edición y escritura serán aprobados automáticamente", + "toast.permissions.autoaccept.off.title": "Se dejó de aceptar ediciones automáticamente", + "toast.permissions.autoaccept.off.description": "Los permisos de edición y escritura requerirán aprobación", + + "toast.model.none.title": "Ningún modelo seleccionado", + "toast.model.none.description": "Conecta un proveedor para resumir esta sesión", + + "toast.file.loadFailed.title": "Fallo al cargar archivo", + + "toast.session.share.copyFailed.title": "Fallo al copiar URL al portapapeles", + "toast.session.share.success.title": "Sesión compartida", + "toast.session.share.success.description": "¡URL compartida copiada al portapapeles!", + "toast.session.share.failed.title": "Fallo al compartir sesión", + "toast.session.share.failed.description": "Ocurrió un error al compartir la sesión", + + "toast.session.unshare.success.title": "Sesión dejó de compartirse", + "toast.session.unshare.success.description": "¡La sesión dejó de compartirse exitosamente!", + "toast.session.unshare.failed.title": "Fallo al dejar de compartir sesión", + "toast.session.unshare.failed.description": "Ocurrió un error al dejar de compartir la sesión", + + "toast.session.listFailed.title": "Fallo al cargar sesiones para {{project}}", + + "toast.update.title": "Actualización disponible", + "toast.update.description": "Una nueva versión de OpenCode ({{version}}) está disponible para instalar.", + "toast.update.action.installRestart": "Instalar y reiniciar", + "toast.update.action.notYet": "Todavía no", + + "error.page.title": "Algo salió mal", + "error.page.description": "Ocurrió un error al cargar la aplicación.", + "error.page.details.label": "Detalles del error", + "error.page.action.restart": "Reiniciar", + "error.page.action.checking": "Comprobando...", + "error.page.action.checkUpdates": "Buscar actualizaciones", + "error.page.action.updateTo": "Actualizar a {{version}}", + "error.page.report.prefix": "Por favor reporta este error al equipo de OpenCode", + "error.page.report.discord": "en Discord", + "error.page.version": "Versión: {{version}}", + + "error.dev.rootNotFound": + "Elemento raíz no encontrado. ¿Olvidaste añadirlo a tu index.html? ¿O tal vez el atributo id está mal escrito?", + + "error.globalSync.connectFailed": "No se pudo conectar al servidor. ¿Hay un servidor ejecutándose en `{{url}}`?", + + "error.chain.unknown": "Error desconocido", + "error.chain.causedBy": "Causado por:", + "error.chain.apiError": "Error de API", + "error.chain.status": "Estado: {{status}}", + "error.chain.retryable": "Reintentable: {{retryable}}", + "error.chain.responseBody": "Cuerpo de la respuesta:\n{{body}}", + "error.chain.didYouMean": "¿Quisiste decir: {{suggestions}}", + "error.chain.modelNotFound": "Modelo no encontrado: {{provider}}/{{model}}", + "error.chain.checkConfig": "Comprueba los nombres de proveedor/modelo en tu configuración (opencode.json)", + "error.chain.mcpFailed": 'El servidor MCP "{{name}}" falló. Nota, OpenCode no soporta autenticación MCP todavía.', + "error.chain.providerAuthFailed": "Autenticación de proveedor fallida ({{provider}}): {{message}}", + "error.chain.providerInitFailed": + 'Fallo al inicializar proveedor "{{provider}}". Comprueba credenciales y configuración.', + "error.chain.configJsonInvalid": "El archivo de configuración en {{path}} no es un JSON(C) válido", + "error.chain.configJsonInvalidWithMessage": + "El archivo de configuración en {{path}} no es un JSON(C) válido: {{message}}", + "error.chain.configDirectoryTypo": + 'El directorio "{{dir}}" en {{path}} no es válido. Renombra el directorio a "{{suggestion}}" o elimínalo. Esto es un error tipográfico común.', + "error.chain.configFrontmatterError": "Fallo al analizar frontmatter en {{path}}:\n{{message}}", + "error.chain.configInvalid": "El archivo de configuración en {{path}} es inválido", + "error.chain.configInvalidWithMessage": "El archivo de configuración en {{path}} es inválido: {{message}}", + + "notification.permission.title": "Permiso requerido", + "notification.permission.description": "{{sessionTitle}} en {{projectName}} necesita permiso", + "notification.question.title": "Pregunta", + "notification.question.description": "{{sessionTitle}} en {{projectName}} tiene una pregunta", + "notification.action.goToSession": "Ir a sesión", + + "notification.session.responseReady.title": "Respuesta lista", + "notification.session.error.title": "Error de sesión", + "notification.session.error.fallbackDescription": "Ocurrió un error", + + "home.recentProjects": "Proyectos recientes", + "home.empty.title": "Sin proyectos recientes", + "home.empty.description": "Empieza abriendo un proyecto local", + + "session.tab.session": "Sesión", + "session.tab.review": "Revisión", + "session.tab.context": "Contexto", + "session.panel.reviewAndFiles": "Revisión y archivos", + "session.review.filesChanged": "{{count}} Archivos Cambiados", + "session.review.loadingChanges": "Cargando cambios...", + "session.review.empty": "No hay cambios en esta sesión aún", + "session.messages.renderEarlier": "Renderizar mensajes anteriores", + "session.messages.loadingEarlier": "Cargando mensajes anteriores...", + "session.messages.loadEarlier": "Cargar mensajes anteriores", + "session.messages.loading": "Cargando mensajes...", + + "session.context.addToContext": "Añadir {{selection}} al contexto", + + "session.new.worktree.main": "Rama principal", + "session.new.worktree.mainWithBranch": "Rama principal ({{branch}})", + "session.new.worktree.create": "Crear nuevo árbol de trabajo", + "session.new.lastModified": "Última modificación", + + "session.header.search.placeholder": "Buscar {{project}}", + "session.header.searchFiles": "Buscar archivos", + + "session.share.popover.title": "Publicar en web", + "session.share.popover.description.shared": + "Esta sesión es pública en la web. Es accesible para cualquiera con el enlace.", + "session.share.popover.description.unshared": + "Compartir sesión públicamente en la web. Será accesible para cualquiera con el enlace.", + "session.share.action.share": "Compartir", + "session.share.action.publish": "Publicar", + "session.share.action.publishing": "Publicando...", + "session.share.action.unpublish": "Despublicar", + "session.share.action.unpublishing": "Despublicando...", + "session.share.action.view": "Ver", + "session.share.copy.copied": "Copiado", + "session.share.copy.copyLink": "Copiar enlace", + + "lsp.tooltip.none": "Sin servidores LSP", + "lsp.label.connected": "{{count}} LSP", + + "prompt.loading": "Cargando prompt...", + "terminal.loading": "Cargando terminal...", + "terminal.title": "Terminal", + "terminal.title.numbered": "Terminal {{number}}", + "terminal.close": "Cerrar terminal", + + "common.closeTab": "Cerrar pestaña", + "common.dismiss": "Descartar", + "common.requestFailed": "Solicitud fallida", + "common.moreOptions": "Más opciones", + "common.learnMore": "Saber más", + "common.rename": "Renombrar", + "common.reset": "Restablecer", + "common.archive": "Archivar", + "common.delete": "Eliminar", + "common.close": "Cerrar", + "common.edit": "Editar", + "common.loadMore": "Cargar más", + + "sidebar.nav.projectsAndSessions": "Proyectos y sesiones", + "sidebar.settings": "Ajustes", + "sidebar.help": "Ayuda", + "sidebar.workspaces.enable": "Habilitar espacios de trabajo", + "sidebar.workspaces.disable": "Deshabilitar espacios de trabajo", + "sidebar.gettingStarted.title": "Empezando", + "sidebar.gettingStarted.line1": "OpenCode incluye modelos gratuitos para que puedas empezar inmediatamente.", + "sidebar.gettingStarted.line2": "Conecta cualquier proveedor para usar modelos, inc. Claude, GPT, Gemini etc.", + "sidebar.project.recentSessions": "Sesiones recientes", + "sidebar.project.viewAllSessions": "Ver todas las sesiones", + + "settings.section.desktop": "Escritorio", + "settings.tab.general": "General", + "settings.tab.shortcuts": "Atajos", + + "settings.general.section.appearance": "Apariencia", + "settings.general.section.notifications": "Notificaciones del sistema", + "settings.general.section.sounds": "Efectos de sonido", + + "settings.general.row.language.title": "Idioma", + "settings.general.row.language.description": "Cambiar el idioma de visualización para OpenCode", + "settings.general.row.appearance.title": "Apariencia", + "settings.general.row.appearance.description": "Personaliza cómo se ve OpenCode en tu dispositivo", + "settings.general.row.theme.title": "Tema", + "settings.general.row.theme.description": "Personaliza el tema de OpenCode.", + "settings.general.row.font.title": "Fuente", + "settings.general.row.font.description": "Personaliza la fuente mono usada en bloques de código", + + "settings.general.notifications.agent.title": "Agente", + "settings.general.notifications.agent.description": + "Mostrar notificación del sistema cuando el agente termine o necesite atención", + "settings.general.notifications.permissions.title": "Permisos", + "settings.general.notifications.permissions.description": + "Mostrar notificación del sistema cuando se requiera un permiso", + "settings.general.notifications.errors.title": "Errores", + "settings.general.notifications.errors.description": "Mostrar notificación del sistema cuando ocurra un error", + + "settings.general.sounds.agent.title": "Agente", + "settings.general.sounds.agent.description": "Reproducir sonido cuando el agente termine o necesite atención", + "settings.general.sounds.permissions.title": "Permisos", + "settings.general.sounds.permissions.description": "Reproducir sonido cuando se requiera un permiso", + "settings.general.sounds.errors.title": "Errores", + "settings.general.sounds.errors.description": "Reproducir sonido cuando ocurra un error", + + "settings.shortcuts.title": "Atajos de teclado", + "settings.shortcuts.reset.button": "Restablecer a valores predeterminados", + "settings.shortcuts.reset.toast.title": "Atajos restablecidos", + "settings.shortcuts.reset.toast.description": + "Los atajos de teclado han sido restablecidos a los valores predeterminados.", + "settings.shortcuts.conflict.title": "Atajo ya en uso", + "settings.shortcuts.conflict.description": "{{keybind}} ya está asignado a {{titles}}.", + "settings.shortcuts.unassigned": "Sin asignar", + "settings.shortcuts.pressKeys": "Presiona teclas", + "settings.shortcuts.search.placeholder": "Buscar atajos", + "settings.shortcuts.search.empty": "No se encontraron atajos", + + "settings.shortcuts.group.general": "General", + "settings.shortcuts.group.session": "Sesión", + "settings.shortcuts.group.navigation": "Navegación", + "settings.shortcuts.group.modelAndAgent": "Modelo y agente", + "settings.shortcuts.group.terminal": "Terminal", + "settings.shortcuts.group.prompt": "Prompt", + + "settings.providers.title": "Proveedores", + "settings.providers.description": "La configuración de proveedores estará disponible aquí.", + "settings.models.title": "Modelos", + "settings.models.description": "La configuración de modelos estará disponible aquí.", + "settings.agents.title": "Agentes", + "settings.agents.description": "La configuración de agentes estará disponible aquí.", + "settings.commands.title": "Comandos", + "settings.commands.description": "La configuración de comandos estará disponible aquí.", + "settings.mcp.title": "MCP", + "settings.mcp.description": "La configuración de MCP estará disponible aquí.", + + "settings.permissions.title": "Permisos", + "settings.permissions.description": "Controla qué herramientas puede usar el servidor por defecto.", + "settings.permissions.section.tools": "Herramientas", + "settings.permissions.toast.updateFailed.title": "Fallo al actualizar permisos", + + "settings.permissions.action.allow": "Permitir", + "settings.permissions.action.ask": "Preguntar", + "settings.permissions.action.deny": "Denegar", + + "settings.permissions.tool.read.title": "Leer", + "settings.permissions.tool.read.description": "Leer un archivo (coincide con la ruta del archivo)", + "settings.permissions.tool.edit.title": "Editar", + "settings.permissions.tool.edit.description": + "Modificar archivos, incluyendo ediciones, escrituras, parches y multi-ediciones", + "settings.permissions.tool.glob.title": "Glob", + "settings.permissions.tool.glob.description": "Coincidir archivos usando patrones glob", + "settings.permissions.tool.grep.title": "Grep", + "settings.permissions.tool.grep.description": "Buscar contenidos de archivo usando expresiones regulares", + "settings.permissions.tool.list.title": "Listar", + "settings.permissions.tool.list.description": "Listar archivos dentro de un directorio", + "settings.permissions.tool.bash.title": "Bash", + "settings.permissions.tool.bash.description": "Ejecutar comandos de shell", + "settings.permissions.tool.task.title": "Tarea", + "settings.permissions.tool.task.description": "Lanzar sub-agentes", + "settings.permissions.tool.skill.title": "Habilidad", + "settings.permissions.tool.skill.description": "Cargar una habilidad por nombre", + "settings.permissions.tool.lsp.title": "LSP", + "settings.permissions.tool.lsp.description": "Ejecutar consultas de servidor de lenguaje", + "settings.permissions.tool.todoread.title": "Leer Todo", + "settings.permissions.tool.todoread.description": "Leer la lista de tareas", + "settings.permissions.tool.todowrite.title": "Escribir Todo", + "settings.permissions.tool.todowrite.description": "Actualizar la lista de tareas", + "settings.permissions.tool.webfetch.title": "Web Fetch", + "settings.permissions.tool.webfetch.description": "Obtener contenido de una URL", + "settings.permissions.tool.websearch.title": "Búsqueda Web", + "settings.permissions.tool.websearch.description": "Buscar en la web", + "settings.permissions.tool.codesearch.title": "Búsqueda de Código", + "settings.permissions.tool.codesearch.description": "Buscar código en la web", + "settings.permissions.tool.external_directory.title": "Directorio Externo", + "settings.permissions.tool.external_directory.description": "Acceder a archivos fuera del directorio del proyecto", + "settings.permissions.tool.doom_loop.title": "Bucle Infinito", + "settings.permissions.tool.doom_loop.description": "Detectar llamadas a herramientas repetidas con entrada idéntica", + + "session.delete.failed.title": "Fallo al eliminar sesión", + "session.delete.title": "Eliminar sesión", + "session.delete.confirm": '¿Eliminar sesión "{{name}}"?', + "session.delete.button": "Eliminar sesión", + + "workspace.new": "Nuevo espacio de trabajo", + "workspace.type.local": "local", + "workspace.type.sandbox": "sandbox", + "workspace.create.failed.title": "Fallo al crear espacio de trabajo", + "workspace.delete.failed.title": "Fallo al eliminar espacio de trabajo", + "workspace.resetting.title": "Restableciendo espacio de trabajo", + "workspace.resetting.description": "Esto puede tomar un minuto.", + "workspace.reset.failed.title": "Fallo al restablecer espacio de trabajo", + "workspace.reset.success.title": "Espacio de trabajo restablecido", + "workspace.reset.success.description": "El espacio de trabajo ahora coincide con la rama predeterminada.", + "workspace.status.checking": "Comprobando cambios no fusionados...", + "workspace.status.error": "No se pudo verificar el estado de git.", + "workspace.status.clean": "No se detectaron cambios no fusionados.", + "workspace.status.dirty": "Cambios no fusionados detectados en este espacio de trabajo.", + "workspace.delete.title": "Eliminar espacio de trabajo", + "workspace.delete.confirm": '¿Eliminar espacio de trabajo "{{name}}"?', + "workspace.delete.button": "Eliminar espacio de trabajo", + "workspace.reset.title": "Restablecer espacio de trabajo", + "workspace.reset.confirm": '¿Restablecer espacio de trabajo "{{name}}"?', + "workspace.reset.button": "Restablecer espacio de trabajo", + "workspace.reset.archived.none": "No se archivarán sesiones activas.", + "workspace.reset.archived.one": "1 sesión será archivada.", + "workspace.reset.archived.many": "{{count}} sesiones serán archivadas.", + "workspace.reset.note": "Esto restablecerá el espacio de trabajo para coincidir con la rama predeterminada.", +} diff --git a/packages/app/src/i18n/fr.ts b/packages/app/src/i18n/fr.ts new file mode 100644 index 00000000000..8ac4d5dd402 --- /dev/null +++ b/packages/app/src/i18n/fr.ts @@ -0,0 +1,590 @@ +export const dict = { + "command.category.suggested": "Suggéré", + "command.category.view": "Affichage", + "command.category.project": "Projet", + "command.category.provider": "Fournisseur", + "command.category.server": "Serveur", + "command.category.session": "Session", + "command.category.theme": "Thème", + "command.category.language": "Langue", + "command.category.file": "Fichier", + "command.category.terminal": "Terminal", + "command.category.model": "Modèle", + "command.category.mcp": "MCP", + "command.category.agent": "Agent", + "command.category.permissions": "Permissions", + "command.category.workspace": "Espace de travail", + + "theme.scheme.system": "Système", + "theme.scheme.light": "Clair", + "theme.scheme.dark": "Sombre", + + "command.sidebar.toggle": "Basculer la barre latérale", + "command.project.open": "Ouvrir un projet", + "command.provider.connect": "Connecter un fournisseur", + "command.server.switch": "Changer de serveur", + "command.session.previous": "Session précédente", + "command.session.next": "Session suivante", + "command.session.archive": "Archiver la session", + + "command.palette": "Palette de commandes", + + "command.theme.cycle": "Changer de thème", + "command.theme.set": "Utiliser le thème : {{theme}}", + "command.theme.scheme.cycle": "Changer de schéma de couleurs", + "command.theme.scheme.set": "Utiliser le schéma de couleurs : {{scheme}}", + + "command.language.cycle": "Changer de langue", + "command.language.set": "Utiliser la langue : {{language}}", + + "command.session.new": "Nouvelle session", + "command.file.open": "Ouvrir un fichier", + "command.file.open.description": "Rechercher des fichiers et des commandes", + "command.terminal.toggle": "Basculer le terminal", + "command.review.toggle": "Basculer la revue", + "command.terminal.new": "Nouveau terminal", + "command.terminal.new.description": "Créer un nouvel onglet de terminal", + "command.steps.toggle": "Basculer les étapes", + "command.steps.toggle.description": "Afficher ou masquer les étapes du message actuel", + "command.message.previous": "Message précédent", + "command.message.previous.description": "Aller au message utilisateur précédent", + "command.message.next": "Message suivant", + "command.message.next.description": "Aller au message utilisateur suivant", + "command.model.choose": "Choisir le modèle", + "command.model.choose.description": "Sélectionner un modèle différent", + "command.mcp.toggle": "Basculer MCP", + "command.mcp.toggle.description": "Basculer les MCPs", + "command.agent.cycle": "Changer d'agent", + "command.agent.cycle.description": "Passer à l'agent suivant", + "command.agent.cycle.reverse": "Changer d'agent (inverse)", + "command.agent.cycle.reverse.description": "Passer à l'agent précédent", + "command.model.variant.cycle": "Changer l'effort de réflexion", + "command.model.variant.cycle.description": "Passer au niveau d'effort suivant", + "command.permissions.autoaccept.enable": "Accepter automatiquement les modifications", + "command.permissions.autoaccept.disable": "Arrêter l'acceptation automatique des modifications", + "command.session.undo": "Annuler", + "command.session.undo.description": "Annuler le dernier message", + "command.session.redo": "Rétablir", + "command.session.redo.description": "Rétablir le dernier message annulé", + "command.session.compact": "Compacter la session", + "command.session.compact.description": "Résumer la session pour réduire la taille du contexte", + "command.session.fork": "Bifurquer à partir du message", + "command.session.fork.description": "Créer une nouvelle session à partir d'un message précédent", + "command.session.share": "Partager la session", + "command.session.share.description": "Partager cette session et copier l'URL dans le presse-papiers", + "command.session.unshare": "Ne plus partager la session", + "command.session.unshare.description": "Arrêter de partager cette session", + + "palette.search.placeholder": "Rechercher des fichiers et des commandes", + "palette.empty": "Aucun résultat trouvé", + "palette.group.commands": "Commandes", + "palette.group.files": "Fichiers", + + "dialog.provider.search.placeholder": "Rechercher des fournisseurs", + "dialog.provider.empty": "Aucun fournisseur trouvé", + "dialog.provider.group.popular": "Populaire", + "dialog.provider.group.other": "Autre", + "dialog.provider.tag.recommended": "Recommandé", + "dialog.provider.anthropic.note": "Connectez-vous avec Claude Pro/Max ou une clé API", + + "dialog.model.select.title": "Sélectionner un modèle", + "dialog.model.search.placeholder": "Rechercher des modèles", + "dialog.model.empty": "Aucun résultat de modèle", + "dialog.model.manage": "Gérer les modèles", + "dialog.model.manage.description": "Personnalisez les modèles qui apparaissent dans le sélecteur.", + + "dialog.model.unpaid.freeModels.title": "Modèles gratuits fournis par OpenCode", + "dialog.model.unpaid.addMore.title": "Ajouter plus de modèles de fournisseurs populaires", + + "dialog.provider.viewAll": "Voir tous les fournisseurs", + + "provider.connect.title": "Connecter {{provider}}", + "provider.connect.title.anthropicProMax": "Connexion avec Claude Pro/Max", + "provider.connect.selectMethod": "Sélectionnez la méthode de connexion pour {{provider}}.", + "provider.connect.method.apiKey": "Clé API", + "provider.connect.status.inProgress": "Autorisation en cours...", + "provider.connect.status.waiting": "En attente d'autorisation...", + "provider.connect.status.failed": "Échec de l'autorisation : {{error}}", + "provider.connect.apiKey.description": + "Entrez votre clé API {{provider}} pour connecter votre compte et utiliser les modèles {{provider}} dans OpenCode.", + "provider.connect.apiKey.label": "Clé API {{provider}}", + "provider.connect.apiKey.placeholder": "Clé API", + "provider.connect.apiKey.required": "La clé API est requise", + "provider.connect.opencodeZen.line1": + "OpenCode Zen vous donne accès à un ensemble sélectionné de modèles fiables et optimisés pour les agents de codage.", + "provider.connect.opencodeZen.line2": + "Avec une seule clé API, vous aurez accès à des modèles tels que Claude, GPT, Gemini, GLM et plus encore.", + "provider.connect.opencodeZen.visit.prefix": "Visitez ", + "provider.connect.opencodeZen.visit.suffix": " pour récupérer votre clé API.", + "provider.connect.oauth.code.visit.prefix": "Visitez ", + "provider.connect.oauth.code.visit.link": "ce lien", + "provider.connect.oauth.code.visit.suffix": + " pour récupérer votre code d'autorisation afin de connecter votre compte et utiliser les modèles {{provider}} dans OpenCode.", + "provider.connect.oauth.code.label": "Code d'autorisation {{method}}", + "provider.connect.oauth.code.placeholder": "Code d'autorisation", + "provider.connect.oauth.code.required": "Le code d'autorisation est requis", + "provider.connect.oauth.code.invalid": "Code d'autorisation invalide", + "provider.connect.oauth.auto.visit.prefix": "Visitez ", + "provider.connect.oauth.auto.visit.link": "ce lien", + "provider.connect.oauth.auto.visit.suffix": + " et entrez le code ci-dessous pour connecter votre compte et utiliser les modèles {{provider}} dans OpenCode.", + "provider.connect.oauth.auto.confirmationCode": "Code de confirmation", + "provider.connect.toast.connected.title": "{{provider}} connecté", + "provider.connect.toast.connected.description": "Les modèles {{provider}} sont maintenant disponibles.", + + "model.tag.free": "Gratuit", + "model.tag.latest": "Dernier", + + "common.search.placeholder": "Rechercher", + "common.goBack": "Retour", + "common.loading": "Chargement", + "common.cancel": "Annuler", + "common.submit": "Soumettre", + "common.save": "Enregistrer", + "common.saving": "Enregistrement...", + "common.default": "Défaut", + "common.attachment": "pièce jointe", + + "prompt.placeholder.shell": "Entrez une commande shell...", + "prompt.placeholder.normal": 'Demandez n\'importe quoi... "{{example}}"', + "prompt.mode.shell": "Shell", + "prompt.mode.shell.exit": "esc pour quitter", + + "prompt.example.1": "Corriger un TODO dans la base de code", + "prompt.example.2": "Quelle est la pile technique de ce projet ?", + "prompt.example.3": "Réparer les tests échoués", + "prompt.example.4": "Expliquer comment fonctionne l'authentification", + "prompt.example.5": "Trouver et corriger les vulnérabilités de sécurité", + "prompt.example.6": "Ajouter des tests unitaires pour le service utilisateur", + "prompt.example.7": "Refactoriser cette fonction pour être plus lisible", + "prompt.example.8": "Que signifie cette erreur ?", + "prompt.example.9": "Aidez-moi à déboguer ce problème", + "prompt.example.10": "Générer la documentation de l'API", + "prompt.example.11": "Optimiser les requêtes de base de données", + "prompt.example.12": "Ajouter une validation d'entrée", + "prompt.example.13": "Créer un nouveau composant pour...", + "prompt.example.14": "Comment déployer ce projet ?", + "prompt.example.15": "Vérifier mon code pour les meilleures pratiques", + "prompt.example.16": "Ajouter la gestion des erreurs à cette fonction", + "prompt.example.17": "Expliquer ce modèle regex", + "prompt.example.18": "Convertir ceci en TypeScript", + "prompt.example.19": "Ajouter des logs dans toute la base de code", + "prompt.example.20": "Quelles dépendances sont obsolètes ?", + "prompt.example.21": "Aidez-moi à écrire un script de migration", + "prompt.example.22": "Implémenter la mise en cache pour ce point de terminaison", + "prompt.example.23": "Ajouter la pagination à cette liste", + "prompt.example.24": "Créer une commande CLI pour...", + "prompt.example.25": "Comment fonctionnent les variables d'environnement ici ?", + + "prompt.popover.emptyResults": "Aucun résultat correspondant", + "prompt.popover.emptyCommands": "Aucune commande correspondante", + "prompt.dropzone.label": "Déposez des images ou des PDF ici", + "prompt.slash.badge.custom": "personnalisé", + "prompt.context.active": "actif", + "prompt.context.includeActiveFile": "Inclure le fichier actif", + "prompt.context.removeActiveFile": "Retirer le fichier actif du contexte", + "prompt.context.removeFile": "Retirer le fichier du contexte", + "prompt.action.attachFile": "Joindre un fichier", + "prompt.attachment.remove": "Supprimer la pièce jointe", + "prompt.action.send": "Envoyer", + "prompt.action.stop": "Arrêter", + + "prompt.toast.pasteUnsupported.title": "Collage non supporté", + "prompt.toast.pasteUnsupported.description": "Seules les images ou les PDF peuvent être collés ici.", + "prompt.toast.modelAgentRequired.title": "Sélectionnez un agent et un modèle", + "prompt.toast.modelAgentRequired.description": "Choisissez un agent et un modèle avant d'envoyer un message.", + "prompt.toast.worktreeCreateFailed.title": "Échec de la création de l'arbre de travail", + "prompt.toast.sessionCreateFailed.title": "Échec de la création de la session", + "prompt.toast.shellSendFailed.title": "Échec de l'envoi de la commande shell", + "prompt.toast.commandSendFailed.title": "Échec de l'envoi de la commande", + "prompt.toast.promptSendFailed.title": "Échec de l'envoi du message", + + "dialog.mcp.title": "MCPs", + "dialog.mcp.description": "{{enabled}} sur {{total}} activés", + "dialog.mcp.empty": "Aucun MCP configuré", + + "mcp.status.connected": "connecté", + "mcp.status.failed": "échoué", + "mcp.status.needs_auth": "nécessite auth", + "mcp.status.disabled": "désactivé", + + "dialog.fork.empty": "Aucun message à partir duquel bifurquer", + + "dialog.directory.search.placeholder": "Rechercher des dossiers", + "dialog.directory.empty": "Aucun dossier trouvé", + + "dialog.server.title": "Serveurs", + "dialog.server.description": "Changez le serveur OpenCode auquel cette application se connecte.", + "dialog.server.search.placeholder": "Rechercher des serveurs", + "dialog.server.empty": "Aucun serveur pour l'instant", + "dialog.server.add.title": "Ajouter un serveur", + "dialog.server.add.url": "URL du serveur", + "dialog.server.add.placeholder": "http://localhost:4096", + "dialog.server.add.error": "Impossible de se connecter au serveur", + "dialog.server.add.checking": "Vérification...", + "dialog.server.add.button": "Ajouter", + "dialog.server.default.title": "Serveur par défaut", + "dialog.server.default.description": + "Se connecter à ce serveur au lancement de l'application au lieu de démarrer un serveur local. Nécessite un redémarrage.", + "dialog.server.default.none": "Aucun serveur sélectionné", + "dialog.server.default.set": "Définir le serveur actuel comme défaut", + "dialog.server.default.clear": "Effacer", + "dialog.server.action.remove": "Supprimer le serveur", + + "dialog.project.edit.title": "Modifier le projet", + "dialog.project.edit.name": "Nom", + "dialog.project.edit.icon": "Icône", + "dialog.project.edit.icon.alt": "Icône du projet", + "dialog.project.edit.icon.hint": "Cliquez ou faites glisser une image", + "dialog.project.edit.icon.recommended": "Recommandé : 128x128px", + "dialog.project.edit.color": "Couleur", + "dialog.project.edit.color.select": "Sélectionner la couleur {{color}}", + + "context.breakdown.title": "Répartition du contexte", + "context.breakdown.note": + "Répartition approximative des jetons d'entrée. \"Autre\" inclut les définitions d'outils et les frais généraux.", + "context.breakdown.system": "Système", + "context.breakdown.user": "Utilisateur", + "context.breakdown.assistant": "Assistant", + "context.breakdown.tool": "Appels d'outils", + "context.breakdown.other": "Autre", + + "context.systemPrompt.title": "Prompt système", + "context.rawMessages.title": "Messages bruts", + + "context.stats.session": "Session", + "context.stats.messages": "Messages", + "context.stats.provider": "Fournisseur", + "context.stats.model": "Modèle", + "context.stats.limit": "Limite de contexte", + "context.stats.totalTokens": "Total des jetons", + "context.stats.usage": "Utilisation", + "context.stats.inputTokens": "Jetons d'entrée", + "context.stats.outputTokens": "Jetons de sortie", + "context.stats.reasoningTokens": "Jetons de raisonnement", + "context.stats.cacheTokens": "Jetons de cache (lecture/écriture)", + "context.stats.userMessages": "Messages utilisateur", + "context.stats.assistantMessages": "Messages assistant", + "context.stats.totalCost": "Coût total", + "context.stats.sessionCreated": "Session créée", + "context.stats.lastActivity": "Dernière activité", + + "context.usage.tokens": "Jetons", + "context.usage.usage": "Utilisation", + "context.usage.cost": "Coût", + "context.usage.clickToView": "Cliquez pour voir le contexte", + "context.usage.view": "Voir l'utilisation du contexte", + + "language.en": "Anglais", + "language.zh": "Chinois (simplifié)", + "language.zht": "Chinois (traditionnel)", + "language.ko": "Coréen", + "language.de": "Allemand", + "language.es": "Espagnol", + "language.fr": "Français", + "language.ja": "Japonais", + "language.da": "Danois", + "language.ru": "Russe", + "language.pl": "Polonais", + "language.ar": "Arabe", + "language.no": "Norvégien", + "language.br": "Portugais (Brésil)", + + "toast.language.title": "Langue", + "toast.language.description": "Passé à {{language}}", + + "toast.theme.title": "Thème changé", + "toast.scheme.title": "Schéma de couleurs", + + "toast.permissions.autoaccept.on.title": "Acceptation auto des modifications", + "toast.permissions.autoaccept.on.description": + "Les permissions de modification et d'écriture seront automatiquement approuvées", + "toast.permissions.autoaccept.off.title": "Arrêt acceptation auto des modifications", + "toast.permissions.autoaccept.off.description": + "Les permissions de modification et d'écriture nécessiteront une approbation", + + "toast.model.none.title": "Aucun modèle sélectionné", + "toast.model.none.description": "Connectez un fournisseur pour résumer cette session", + + "toast.file.loadFailed.title": "Échec du chargement du fichier", + + "toast.session.share.copyFailed.title": "Échec de la copie de l'URL dans le presse-papiers", + "toast.session.share.success.title": "Session partagée", + "toast.session.share.success.description": "URL de partage copiée dans le presse-papiers !", + "toast.session.share.failed.title": "Échec du partage de la session", + "toast.session.share.failed.description": "Une erreur s'est produite lors du partage de la session", + + "toast.session.unshare.success.title": "Session non partagée", + "toast.session.unshare.success.description": "Session non partagée avec succès !", + "toast.session.unshare.failed.title": "Échec de l'annulation du partage", + "toast.session.unshare.failed.description": "Une erreur s'est produite lors de l'annulation du partage de la session", + + "toast.session.listFailed.title": "Échec du chargement des sessions pour {{project}}", + + "toast.update.title": "Mise à jour disponible", + "toast.update.description": + "Une nouvelle version d'OpenCode ({{version}}) est maintenant disponible pour installation.", + "toast.update.action.installRestart": "Installer et redémarrer", + "toast.update.action.notYet": "Pas encore", + + "error.page.title": "Quelque chose s'est mal passé", + "error.page.description": "Une erreur s'est produite lors du chargement de l'application.", + "error.page.details.label": "Détails de l'erreur", + "error.page.action.restart": "Redémarrer", + "error.page.action.checking": "Vérification...", + "error.page.action.checkUpdates": "Vérifier les mises à jour", + "error.page.action.updateTo": "Mettre à jour vers {{version}}", + "error.page.report.prefix": "Veuillez signaler cette erreur à l'équipe OpenCode", + "error.page.report.discord": "sur Discord", + "error.page.version": "Version : {{version}}", + + "error.dev.rootNotFound": + "Élément racine introuvable. Avez-vous oublié de l'ajouter à votre index.html ? Ou peut-être que l'attribut id est mal orthographié ?", + + "error.globalSync.connectFailed": + "Impossible de se connecter au serveur. Y a-t-il un serveur en cours d'exécution à `{{url}}` ?", + + "error.chain.unknown": "Erreur inconnue", + "error.chain.causedBy": "Causé par :", + "error.chain.apiError": "Erreur API", + "error.chain.status": "Statut : {{status}}", + "error.chain.retryable": "Réessayable : {{retryable}}", + "error.chain.responseBody": "Corps de la réponse :\n{{body}}", + "error.chain.didYouMean": "Vouliez-vous dire : {{suggestions}}", + "error.chain.modelNotFound": "Modèle introuvable : {{provider}}/{{model}}", + "error.chain.checkConfig": "Vérifiez votre configuration (opencode.json) pour les noms de fournisseur/modèle", + "error.chain.mcpFailed": + "Le serveur MCP \"{{name}}\" a échoué. Notez qu'OpenCode ne supporte pas encore l'authentification MCP.", + "error.chain.providerAuthFailed": "Échec de l'authentification du fournisseur ({{provider}}) : {{message}}", + "error.chain.providerInitFailed": + 'Échec de l\'initialisation du fournisseur "{{provider}}". Vérifiez les identifiants et la configuration.', + "error.chain.configJsonInvalid": "Le fichier de configuration à {{path}} n'est pas un JSON(C) valide", + "error.chain.configJsonInvalidWithMessage": + "Le fichier de configuration à {{path}} n'est pas un JSON(C) valide : {{message}}", + "error.chain.configDirectoryTypo": + 'Le répertoire "{{dir}}" dans {{path}} n\'est pas valide. Renommez le répertoire en "{{suggestion}}" ou supprimez-le. C\'est une faute de frappe courante.', + "error.chain.configFrontmatterError": "Échec de l'analyse du frontmatter dans {{path}} :\n{{message}}", + "error.chain.configInvalid": "Le fichier de configuration à {{path}} est invalide", + "error.chain.configInvalidWithMessage": "Le fichier de configuration à {{path}} est invalide : {{message}}", + + "notification.permission.title": "Permission requise", + "notification.permission.description": "{{sessionTitle}} dans {{projectName}} a besoin d'une permission", + "notification.question.title": "Question", + "notification.question.description": "{{sessionTitle}} dans {{projectName}} a une question", + "notification.action.goToSession": "Aller à la session", + + "notification.session.responseReady.title": "Réponse prête", + "notification.session.error.title": "Erreur de session", + "notification.session.error.fallbackDescription": "Une erreur s'est produite", + + "home.recentProjects": "Projets récents", + "home.empty.title": "Aucun projet récent", + "home.empty.description": "Commencez par ouvrir un projet local", + + "session.tab.session": "Session", + "session.tab.review": "Revue", + "session.tab.context": "Contexte", + "session.panel.reviewAndFiles": "Revue et fichiers", + "session.review.filesChanged": "{{count}} fichiers modifiés", + "session.review.loadingChanges": "Chargement des modifications...", + "session.review.empty": "Aucune modification dans cette session pour l'instant", + "session.messages.renderEarlier": "Afficher les messages précédents", + "session.messages.loadingEarlier": "Chargement des messages précédents...", + "session.messages.loadEarlier": "Charger les messages précédents", + "session.messages.loading": "Chargement des messages...", + + "session.context.addToContext": "Ajouter {{selection}} au contexte", + + "session.new.worktree.main": "Branche principale", + "session.new.worktree.mainWithBranch": "Branche principale ({{branch}})", + "session.new.worktree.create": "Créer un nouvel arbre de travail", + "session.new.lastModified": "Dernière modification", + + "session.header.search.placeholder": "Rechercher {{project}}", + "session.header.searchFiles": "Rechercher des fichiers", + + "session.share.popover.title": "Publier sur le web", + "session.share.popover.description.shared": + "Cette session est publique sur le web. Elle est accessible à toute personne disposant du lien.", + "session.share.popover.description.unshared": + "Partager la session publiquement sur le web. Elle sera accessible à toute personne disposant du lien.", + "session.share.action.share": "Partager", + "session.share.action.publish": "Publier", + "session.share.action.publishing": "Publication...", + "session.share.action.unpublish": "Dépublier", + "session.share.action.unpublishing": "Dépublication...", + "session.share.action.view": "Voir", + "session.share.copy.copied": "Copié", + "session.share.copy.copyLink": "Copier le lien", + + "lsp.tooltip.none": "Aucun serveur LSP", + "lsp.label.connected": "{{count}} LSP", + + "prompt.loading": "Chargement du prompt...", + "terminal.loading": "Chargement du terminal...", + "terminal.title": "Terminal", + "terminal.title.numbered": "Terminal {{number}}", + "terminal.close": "Fermer le terminal", + + "common.closeTab": "Fermer l'onglet", + "common.dismiss": "Ignorer", + "common.requestFailed": "La demande a échoué", + "common.moreOptions": "Plus d'options", + "common.learnMore": "En savoir plus", + "common.rename": "Renommer", + "common.reset": "Réinitialiser", + "common.archive": "Archiver", + "common.delete": "Supprimer", + "common.close": "Fermer", + "common.edit": "Modifier", + "common.loadMore": "Charger plus", + + "sidebar.nav.projectsAndSessions": "Projets et sessions", + "sidebar.settings": "Paramètres", + "sidebar.help": "Aide", + "sidebar.workspaces.enable": "Activer les espaces de travail", + "sidebar.workspaces.disable": "Désactiver les espaces de travail", + "sidebar.gettingStarted.title": "Commencer", + "sidebar.gettingStarted.line1": + "OpenCode inclut des modèles gratuits pour que vous puissiez commencer immédiatement.", + "sidebar.gettingStarted.line2": + "Connectez n'importe quel fournisseur pour utiliser des modèles, y compris Claude, GPT, Gemini etc.", + "sidebar.project.recentSessions": "Sessions récentes", + "sidebar.project.viewAllSessions": "Voir toutes les sessions", + + "settings.section.desktop": "Bureau", + "settings.tab.general": "Général", + "settings.tab.shortcuts": "Raccourcis", + + "settings.general.section.appearance": "Apparence", + "settings.general.section.notifications": "Notifications système", + "settings.general.section.sounds": "Effets sonores", + + "settings.general.row.language.title": "Langue", + "settings.general.row.language.description": "Changer la langue d'affichage pour OpenCode", + "settings.general.row.appearance.title": "Apparence", + "settings.general.row.appearance.description": "Personnaliser l'apparence d'OpenCode sur votre appareil", + "settings.general.row.theme.title": "Thème", + "settings.general.row.theme.description": "Personnaliser le thème d'OpenCode.", + "settings.general.row.font.title": "Police", + "settings.general.row.font.description": "Personnaliser la police mono utilisée dans les blocs de code", + + "settings.general.notifications.agent.title": "Agent", + "settings.general.notifications.agent.description": + "Afficher une notification système lorsque l'agent a terminé ou nécessite une attention", + "settings.general.notifications.permissions.title": "Permissions", + "settings.general.notifications.permissions.description": + "Afficher une notification système lorsqu'une permission est requise", + "settings.general.notifications.errors.title": "Erreurs", + "settings.general.notifications.errors.description": "Afficher une notification système lorsqu'une erreur se produit", + + "settings.general.sounds.agent.title": "Agent", + "settings.general.sounds.agent.description": "Jouer un son lorsque l'agent a terminé ou nécessite une attention", + "settings.general.sounds.permissions.title": "Permissions", + "settings.general.sounds.permissions.description": "Jouer un son lorsqu'une permission est requise", + "settings.general.sounds.errors.title": "Erreurs", + "settings.general.sounds.errors.description": "Jouer un son lorsqu'une erreur se produit", + + "settings.shortcuts.title": "Raccourcis clavier", + "settings.shortcuts.reset.button": "Rétablir les défauts", + "settings.shortcuts.reset.toast.title": "Raccourcis réinitialisés", + "settings.shortcuts.reset.toast.description": "Les raccourcis clavier ont été réinitialisés aux valeurs par défaut.", + "settings.shortcuts.conflict.title": "Raccourci déjà utilisé", + "settings.shortcuts.conflict.description": "{{keybind}} est déjà assigné à {{titles}}.", + "settings.shortcuts.unassigned": "Non assigné", + "settings.shortcuts.pressKeys": "Appuyez sur les touches", + "settings.shortcuts.search.placeholder": "Rechercher des raccourcis", + "settings.shortcuts.search.empty": "Aucun raccourci trouvé", + + "settings.shortcuts.group.general": "Général", + "settings.shortcuts.group.session": "Session", + "settings.shortcuts.group.navigation": "Navigation", + "settings.shortcuts.group.modelAndAgent": "Modèle et agent", + "settings.shortcuts.group.terminal": "Terminal", + "settings.shortcuts.group.prompt": "Prompt", + + "settings.providers.title": "Fournisseurs", + "settings.providers.description": "Les paramètres des fournisseurs seront configurables ici.", + "settings.models.title": "Modèles", + "settings.models.description": "Les paramètres des modèles seront configurables ici.", + "settings.agents.title": "Agents", + "settings.agents.description": "Les paramètres des agents seront configurables ici.", + "settings.commands.title": "Commandes", + "settings.commands.description": "Les paramètres des commandes seront configurables ici.", + "settings.mcp.title": "MCP", + "settings.mcp.description": "Les paramètres MCP seront configurables ici.", + + "settings.permissions.title": "Permissions", + "settings.permissions.description": "Contrôlez les outils que le serveur peut utiliser par défaut.", + "settings.permissions.section.tools": "Outils", + "settings.permissions.toast.updateFailed.title": "Échec de la mise à jour des permissions", + + "settings.permissions.action.allow": "Autoriser", + "settings.permissions.action.ask": "Demander", + "settings.permissions.action.deny": "Refuser", + + "settings.permissions.tool.read.title": "Lire", + "settings.permissions.tool.read.description": "Lecture d'un fichier (correspond au chemin du fichier)", + "settings.permissions.tool.edit.title": "Modifier", + "settings.permissions.tool.edit.description": + "Modifier des fichiers, y compris les modifications, écritures, patchs et multi-modifications", + "settings.permissions.tool.glob.title": "Glob", + "settings.permissions.tool.glob.description": "Correspondre aux fichiers utilisant des modèles glob", + "settings.permissions.tool.grep.title": "Grep", + "settings.permissions.tool.grep.description": + "Rechercher dans le contenu des fichiers à l'aide d'expressions régulières", + "settings.permissions.tool.list.title": "Lister", + "settings.permissions.tool.list.description": "Lister les fichiers dans un répertoire", + "settings.permissions.tool.bash.title": "Bash", + "settings.permissions.tool.bash.description": "Exécuter des commandes shell", + "settings.permissions.tool.task.title": "Tâche", + "settings.permissions.tool.task.description": "Lancer des sous-agents", + "settings.permissions.tool.skill.title": "Compétence", + "settings.permissions.tool.skill.description": "Charger une compétence par son nom", + "settings.permissions.tool.lsp.title": "LSP", + "settings.permissions.tool.lsp.description": "Exécuter des requêtes de serveur de langage", + "settings.permissions.tool.todoread.title": "Lire Todo", + "settings.permissions.tool.todoread.description": "Lire la liste de tâches", + "settings.permissions.tool.todowrite.title": "Écrire Todo", + "settings.permissions.tool.todowrite.description": "Mettre à jour la liste de tâches", + "settings.permissions.tool.webfetch.title": "Récupération Web", + "settings.permissions.tool.webfetch.description": "Récupérer le contenu d'une URL", + "settings.permissions.tool.websearch.title": "Recherche Web", + "settings.permissions.tool.websearch.description": "Rechercher sur le web", + "settings.permissions.tool.codesearch.title": "Recherche de code", + "settings.permissions.tool.codesearch.description": "Rechercher du code sur le web", + "settings.permissions.tool.external_directory.title": "Répertoire externe", + "settings.permissions.tool.external_directory.description": "Accéder aux fichiers en dehors du répertoire du projet", + "settings.permissions.tool.doom_loop.title": "Boucle infernale", + "settings.permissions.tool.doom_loop.description": "Détecter les appels d'outils répétés avec une entrée identique", + + "session.delete.failed.title": "Échec de la suppression de la session", + "session.delete.title": "Supprimer la session", + "session.delete.confirm": 'Supprimer la session "{{name}}" ?', + "session.delete.button": "Supprimer la session", + + "workspace.new": "Nouvel espace de travail", + "workspace.type.local": "local", + "workspace.type.sandbox": "bac à sable", + "workspace.create.failed.title": "Échec de la création de l'espace de travail", + "workspace.delete.failed.title": "Échec de la suppression de l'espace de travail", + "workspace.resetting.title": "Réinitialisation de l'espace de travail", + "workspace.resetting.description": "Cela peut prendre une minute.", + "workspace.reset.failed.title": "Échec de la réinitialisation de l'espace de travail", + "workspace.reset.success.title": "Espace de travail réinitialisé", + "workspace.reset.success.description": "L'espace de travail correspond maintenant à la branche par défaut.", + "workspace.status.checking": "Vérification des modifications non fusionnées...", + "workspace.status.error": "Impossible de vérifier le statut git.", + "workspace.status.clean": "Aucune modification non fusionnée détectée.", + "workspace.status.dirty": "Modifications non fusionnées détectées dans cet espace de travail.", + "workspace.delete.title": "Supprimer l'espace de travail", + "workspace.delete.confirm": 'Supprimer l\'espace de travail "{{name}}" ?', + "workspace.delete.button": "Supprimer l'espace de travail", + "workspace.reset.title": "Réinitialiser l'espace de travail", + "workspace.reset.confirm": 'Réinitialiser l\'espace de travail "{{name}}" ?', + "workspace.reset.button": "Réinitialiser l'espace de travail", + "workspace.reset.archived.none": "Aucune session active ne sera archivée.", + "workspace.reset.archived.one": "1 session sera archivée.", + "workspace.reset.archived.many": "{{count}} sessions seront archivées.", + "workspace.reset.note": "Cela réinitialisera l'espace de travail pour correspondre à la branche par défaut.", +} diff --git a/packages/app/src/i18n/ja.ts b/packages/app/src/i18n/ja.ts new file mode 100644 index 00000000000..821cda762e9 --- /dev/null +++ b/packages/app/src/i18n/ja.ts @@ -0,0 +1,577 @@ +export const dict = { + "command.category.suggested": "おすすめ", + "command.category.view": "表示", + "command.category.project": "プロジェクト", + "command.category.provider": "プロバイダー", + "command.category.server": "サーバー", + "command.category.session": "セッション", + "command.category.theme": "テーマ", + "command.category.language": "言語", + "command.category.file": "ファイル", + "command.category.terminal": "ターミナル", + "command.category.model": "モデル", + "command.category.mcp": "MCP", + "command.category.agent": "エージェント", + "command.category.permissions": "権限", + "command.category.workspace": "ワークスペース", + + "theme.scheme.system": "システム", + "theme.scheme.light": "ライト", + "theme.scheme.dark": "ダーク", + + "command.sidebar.toggle": "サイドバーの切り替え", + "command.project.open": "プロジェクトを開く", + "command.provider.connect": "プロバイダーに接続", + "command.server.switch": "サーバーの切り替え", + "command.session.previous": "前のセッション", + "command.session.next": "次のセッション", + "command.session.archive": "セッションをアーカイブ", + + "command.palette": "コマンドパレット", + + "command.theme.cycle": "テーマの切り替え", + "command.theme.set": "テーマを使用: {{theme}}", + "command.theme.scheme.cycle": "配色の切り替え", + "command.theme.scheme.set": "配色を使用: {{scheme}}", + + "command.language.cycle": "言語の切り替え", + "command.language.set": "言語を使用: {{language}}", + + "command.session.new": "新しいセッション", + "command.file.open": "ファイルを開く", + "command.file.open.description": "ファイルとコマンドを検索", + "command.terminal.toggle": "ターミナルの切り替え", + "command.review.toggle": "レビューの切り替え", + "command.terminal.new": "新しいターミナル", + "command.terminal.new.description": "新しいターミナルタブを作成", + "command.steps.toggle": "ステップの切り替え", + "command.steps.toggle.description": "現在のメッセージのステップを表示または非表示", + "command.message.previous": "前のメッセージ", + "command.message.previous.description": "前のユーザーメッセージに移動", + "command.message.next": "次のメッセージ", + "command.message.next.description": "次のユーザーメッセージに移動", + "command.model.choose": "モデルを選択", + "command.model.choose.description": "別のモデルを選択", + "command.mcp.toggle": "MCPの切り替え", + "command.mcp.toggle.description": "MCPを切り替える", + "command.agent.cycle": "エージェントの切り替え", + "command.agent.cycle.description": "次のエージェントに切り替え", + "command.agent.cycle.reverse": "エージェントを逆順に切り替え", + "command.agent.cycle.reverse.description": "前のエージェントに切り替え", + "command.model.variant.cycle": "思考レベルの切り替え", + "command.model.variant.cycle.description": "次の思考レベルに切り替え", + "command.permissions.autoaccept.enable": "編集を自動承認", + "command.permissions.autoaccept.disable": "編集の自動承認を停止", + "command.session.undo": "元に戻す", + "command.session.undo.description": "最後のメッセージを元に戻す", + "command.session.redo": "やり直す", + "command.session.redo.description": "元に戻したメッセージをやり直す", + "command.session.compact": "セッションを圧縮", + "command.session.compact.description": "セッションを要約してコンテキストサイズを削減", + "command.session.fork": "メッセージからフォーク", + "command.session.fork.description": "以前のメッセージから新しいセッションを作成", + "command.session.share": "セッションを共有", + "command.session.share.description": "このセッションを共有しURLをクリップボードにコピー", + "command.session.unshare": "セッションの共有を停止", + "command.session.unshare.description": "このセッションの共有を停止", + + "palette.search.placeholder": "ファイルとコマンドを検索", + "palette.empty": "結果が見つかりません", + "palette.group.commands": "コマンド", + "palette.group.files": "ファイル", + + "dialog.provider.search.placeholder": "プロバイダーを検索", + "dialog.provider.empty": "プロバイダーが見つかりません", + "dialog.provider.group.popular": "人気", + "dialog.provider.group.other": "その他", + "dialog.provider.tag.recommended": "推奨", + "dialog.provider.anthropic.note": "Claude Pro/MaxまたはAPIキーで接続", + + "dialog.model.select.title": "モデルを選択", + "dialog.model.search.placeholder": "モデルを検索", + "dialog.model.empty": "モデルが見つかりません", + "dialog.model.manage": "モデルを管理", + "dialog.model.manage.description": "モデルセレクターに表示するモデルをカスタマイズします。", + + "dialog.model.unpaid.freeModels.title": "OpenCodeが提供する無料モデル", + "dialog.model.unpaid.addMore.title": "人気のプロバイダーからモデルを追加", + + "dialog.provider.viewAll": "すべてのプロバイダーを表示", + + "provider.connect.title": "{{provider}}を接続", + "provider.connect.title.anthropicProMax": "Claude Pro/Maxでログイン", + "provider.connect.selectMethod": "{{provider}}のログイン方法を選択してください。", + "provider.connect.method.apiKey": "APIキー", + "provider.connect.status.inProgress": "認証中...", + "provider.connect.status.waiting": "認証を待機中...", + "provider.connect.status.failed": "認証に失敗しました: {{error}}", + "provider.connect.apiKey.description": + "{{provider}}のAPIキーを入力してアカウントを接続し、OpenCodeで{{provider}}モデルを使用します。", + "provider.connect.apiKey.label": "{{provider}} APIキー", + "provider.connect.apiKey.placeholder": "APIキー", + "provider.connect.apiKey.required": "APIキーが必要です", + "provider.connect.opencodeZen.line1": + "OpenCode Zenは、コーディングエージェント向けに最適化された信頼性の高いモデルへのアクセスを提供します。", + "provider.connect.opencodeZen.line2": "1つのAPIキーで、Claude、GPT、Gemini、GLMなどのモデルにアクセスできます。", + "provider.connect.opencodeZen.visit.prefix": " ", + "provider.connect.opencodeZen.visit.suffix": " にアクセスしてAPIキーを取得してください。", + "provider.connect.oauth.code.visit.prefix": " ", + "provider.connect.oauth.code.visit.link": "このリンク", + "provider.connect.oauth.code.visit.suffix": + " にアクセスして認証コードを取得し、アカウントを接続してOpenCodeで{{provider}}モデルを使用してください。", + "provider.connect.oauth.code.label": "{{method}} 認証コード", + "provider.connect.oauth.code.placeholder": "認証コード", + "provider.connect.oauth.code.required": "認証コードが必要です", + "provider.connect.oauth.code.invalid": "無効な認証コード", + "provider.connect.oauth.auto.visit.prefix": " ", + "provider.connect.oauth.auto.visit.link": "このリンク", + "provider.connect.oauth.auto.visit.suffix": + " にアクセスし、以下のコードを入力してアカウントを接続し、OpenCodeで{{provider}}モデルを使用してください。", + "provider.connect.oauth.auto.confirmationCode": "確認コード", + "provider.connect.toast.connected.title": "{{provider}}が接続されました", + "provider.connect.toast.connected.description": "{{provider}}モデルが使用可能になりました。", + + "model.tag.free": "無料", + "model.tag.latest": "最新", + + "common.search.placeholder": "検索", + "common.goBack": "戻る", + "common.loading": "読み込み中", + "common.cancel": "キャンセル", + "common.submit": "送信", + "common.save": "保存", + "common.saving": "保存中...", + "common.default": "デフォルト", + "common.attachment": "添付ファイル", + + "prompt.placeholder.shell": "シェルコマンドを入力...", + "prompt.placeholder.normal": '何でも聞いてください... "{{example}}"', + "prompt.mode.shell": "Shell", + "prompt.mode.shell.exit": "escで終了", + + "prompt.example.1": "コードベースのTODOを修正", + "prompt.example.2": "このプロジェクトの技術スタックは何ですか?", + "prompt.example.3": "壊れたテストを修正", + "prompt.example.4": "認証の仕組みを説明して", + "prompt.example.5": "セキュリティの脆弱性を見つけて修正", + "prompt.example.6": "ユーザーサービスのユニットテストを追加", + "prompt.example.7": "この関数を読みやすくリファクタリング", + "prompt.example.8": "このエラーはどういう意味ですか?", + "prompt.example.9": "この問題のデバッグを手伝って", + "prompt.example.10": "APIドキュメントを生成", + "prompt.example.11": "データベースクエリを最適化", + "prompt.example.12": "入力バリデーションを追加", + "prompt.example.13": "〜の新しいコンポーネントを作成", + "prompt.example.14": "このプロジェクトをデプロイするには?", + "prompt.example.15": "ベストプラクティスの観点でコードをレビュー", + "prompt.example.16": "この関数にエラーハンドリングを追加", + "prompt.example.17": "この正規表現パターンを説明して", + "prompt.example.18": "これをTypeScriptに変換", + "prompt.example.19": "コードベース全体にログを追加", + "prompt.example.20": "古い依存関係はどれですか?", + "prompt.example.21": "マイグレーションスクリプトの作成を手伝って", + "prompt.example.22": "このエンドポイントにキャッシュを実装", + "prompt.example.23": "このリストにページネーションを追加", + "prompt.example.24": "〜のCLIコマンドを作成", + "prompt.example.25": "ここでは環境変数はどう機能しますか?", + + "prompt.popover.emptyResults": "一致する結果がありません", + "prompt.popover.emptyCommands": "一致するコマンドがありません", + "prompt.dropzone.label": "画像またはPDFをここにドロップ", + "prompt.slash.badge.custom": "カスタム", + "prompt.context.active": "アクティブ", + "prompt.context.includeActiveFile": "アクティブなファイルを含める", + "prompt.context.removeActiveFile": "コンテキストからアクティブなファイルを削除", + "prompt.context.removeFile": "コンテキストからファイルを削除", + "prompt.action.attachFile": "ファイルを添付", + "prompt.attachment.remove": "添付ファイルを削除", + "prompt.action.send": "送信", + "prompt.action.stop": "停止", + + "prompt.toast.pasteUnsupported.title": "サポートされていない貼り付け", + "prompt.toast.pasteUnsupported.description": "ここでは画像またはPDFのみ貼り付け可能です。", + "prompt.toast.modelAgentRequired.title": "エージェントとモデルを選択", + "prompt.toast.modelAgentRequired.description": "プロンプトを送信する前にエージェントとモデルを選択してください。", + "prompt.toast.worktreeCreateFailed.title": "ワークツリーの作成に失敗しました", + "prompt.toast.sessionCreateFailed.title": "セッションの作成に失敗しました", + "prompt.toast.shellSendFailed.title": "シェルコマンドの送信に失敗しました", + "prompt.toast.commandSendFailed.title": "コマンドの送信に失敗しました", + "prompt.toast.promptSendFailed.title": "プロンプトの送信に失敗しました", + + "dialog.mcp.title": "MCP", + "dialog.mcp.description": "{{total}}個中{{enabled}}個が有効", + "dialog.mcp.empty": "MCPが設定されていません", + + "mcp.status.connected": "接続済み", + "mcp.status.failed": "失敗", + "mcp.status.needs_auth": "認証が必要", + "mcp.status.disabled": "無効", + + "dialog.fork.empty": "フォーク元のメッセージがありません", + + "dialog.directory.search.placeholder": "フォルダを検索", + "dialog.directory.empty": "フォルダが見つかりません", + + "dialog.server.title": "サーバー", + "dialog.server.description": "このアプリが接続するOpenCodeサーバーを切り替えます。", + "dialog.server.search.placeholder": "サーバーを検索", + "dialog.server.empty": "サーバーはまだありません", + "dialog.server.add.title": "サーバーを追加", + "dialog.server.add.url": "サーバーURL", + "dialog.server.add.placeholder": "http://localhost:4096", + "dialog.server.add.error": "サーバーに接続できませんでした", + "dialog.server.add.checking": "確認中...", + "dialog.server.add.button": "追加", + "dialog.server.default.title": "デフォルトサーバー", + "dialog.server.default.description": + "ローカルサーバーを起動する代わりに、アプリ起動時にこのサーバーに接続します。再起動が必要です。", + "dialog.server.default.none": "サーバーが選択されていません", + "dialog.server.default.set": "現在のサーバーをデフォルトに設定", + "dialog.server.default.clear": "クリア", + "dialog.server.action.remove": "サーバーを削除", + + "dialog.project.edit.title": "プロジェクトを編集", + "dialog.project.edit.name": "名前", + "dialog.project.edit.icon": "アイコン", + "dialog.project.edit.icon.alt": "プロジェクトアイコン", + "dialog.project.edit.icon.hint": "クリックまたは画像をドラッグ", + "dialog.project.edit.icon.recommended": "推奨: 128x128px", + "dialog.project.edit.color": "色", + "dialog.project.edit.color.select": "{{color}}の色を選択", + + "context.breakdown.title": "コンテキストの内訳", + "context.breakdown.note": '入力トークンのおおよその内訳です。"その他"にはツールの定義やオーバーヘッドが含まれます。', + "context.breakdown.system": "システム", + "context.breakdown.user": "ユーザー", + "context.breakdown.assistant": "アシスタント", + "context.breakdown.tool": "ツール呼び出し", + "context.breakdown.other": "その他", + + "context.systemPrompt.title": "システムプロンプト", + "context.rawMessages.title": "生のメッセージ", + + "context.stats.session": "セッション", + "context.stats.messages": "メッセージ", + "context.stats.provider": "プロバイダー", + "context.stats.model": "モデル", + "context.stats.limit": "コンテキスト制限", + "context.stats.totalTokens": "総トークン数", + "context.stats.usage": "使用量", + "context.stats.inputTokens": "入力トークン", + "context.stats.outputTokens": "出力トークン", + "context.stats.reasoningTokens": "推論トークン", + "context.stats.cacheTokens": "キャッシュトークン (読込/書込)", + "context.stats.userMessages": "ユーザーメッセージ", + "context.stats.assistantMessages": "アシスタントメッセージ", + "context.stats.totalCost": "総コスト", + "context.stats.sessionCreated": "セッション作成日時", + "context.stats.lastActivity": "最終アクティビティ", + + "context.usage.tokens": "トークン", + "context.usage.usage": "使用量", + "context.usage.cost": "コスト", + "context.usage.clickToView": "クリックしてコンテキストを表示", + "context.usage.view": "コンテキスト使用量を表示", + + "language.en": "英語", + "language.zh": "中国語(簡体字)", + "language.zht": "中国語(繁体字)", + "language.ko": "韓国語", + "language.de": "ドイツ語", + "language.es": "スペイン語", + "language.fr": "フランス語", + "language.ja": "日本語", + "language.da": "デンマーク語", + "language.ru": "ロシア語", + "language.pl": "ポーランド語", + "language.ar": "アラビア語", + "language.no": "ノルウェー語", + "language.br": "ポルトガル語(ブラジル)", + + "toast.language.title": "言語", + "toast.language.description": "{{language}}に切り替えました", + + "toast.theme.title": "テーマが切り替わりました", + "toast.scheme.title": "配色", + + "toast.permissions.autoaccept.on.title": "編集を自動承認中", + "toast.permissions.autoaccept.on.description": "編集と書き込みの権限は自動的に承認されます", + "toast.permissions.autoaccept.off.title": "編集の自動承認を停止しました", + "toast.permissions.autoaccept.off.description": "編集と書き込みの権限には承認が必要です", + + "toast.model.none.title": "モデルが選択されていません", + "toast.model.none.description": "このセッションを要約するにはプロバイダーを接続してください", + + "toast.file.loadFailed.title": "ファイルの読み込みに失敗しました", + + "toast.session.share.copyFailed.title": "URLのコピーに失敗しました", + "toast.session.share.success.title": "セッションを共有しました", + "toast.session.share.success.description": "共有URLをクリップボードにコピーしました!", + "toast.session.share.failed.title": "セッションの共有に失敗しました", + "toast.session.share.failed.description": "セッションの共有中にエラーが発生しました", + + "toast.session.unshare.success.title": "セッションの共有を解除しました", + "toast.session.unshare.success.description": "セッションの共有解除に成功しました!", + "toast.session.unshare.failed.title": "セッションの共有解除に失敗しました", + "toast.session.unshare.failed.description": "セッションの共有解除中にエラーが発生しました", + + "toast.session.listFailed.title": "{{project}}のセッション読み込みに失敗しました", + + "toast.update.title": "アップデートが利用可能です", + "toast.update.description": "OpenCodeの新しいバージョン ({{version}}) がインストール可能です。", + "toast.update.action.installRestart": "インストールして再起動", + "toast.update.action.notYet": "今はしない", + + "error.page.title": "問題が発生しました", + "error.page.description": "アプリケーションの読み込み中にエラーが発生しました。", + "error.page.details.label": "エラー詳細", + "error.page.action.restart": "再起動", + "error.page.action.checking": "確認中...", + "error.page.action.checkUpdates": "アップデートを確認", + "error.page.action.updateTo": "{{version}}にアップデート", + "error.page.report.prefix": "このエラーをOpenCodeチームに報告してください: ", + "error.page.report.discord": "Discord", + "error.page.version": "バージョン: {{version}}", + + "error.dev.rootNotFound": + "ルート要素が見つかりません。index.htmlに追加するのを忘れていませんか?またはid属性のスペルが間違っていませんか?", + + "error.globalSync.connectFailed": "サーバーに接続できませんでした。`{{url}}`でサーバーが実行されていますか?", + + "error.chain.unknown": "不明なエラー", + "error.chain.causedBy": "原因:", + "error.chain.apiError": "APIエラー", + "error.chain.status": "ステータス: {{status}}", + "error.chain.retryable": "再試行可能: {{retryable}}", + "error.chain.responseBody": "レスポンス本文:\n{{body}}", + "error.chain.didYouMean": "もしかして: {{suggestions}}", + "error.chain.modelNotFound": "モデルが見つかりません: {{provider}}/{{model}}", + "error.chain.checkConfig": "config (opencode.json) のプロバイダー/モデル名を確認してください", + "error.chain.mcpFailed": 'MCPサーバー "{{name}}" が失敗しました。注意: OpenCodeはまだMCP認証をサポートしていません。', + "error.chain.providerAuthFailed": "プロバイダー認証に失敗しました ({{provider}}): {{message}}", + "error.chain.providerInitFailed": + 'プロバイダー "{{provider}}" の初期化に失敗しました。認証情報と設定を確認してください。', + "error.chain.configJsonInvalid": "{{path}} の設定ファイルは有効なJSON(C)ではありません", + "error.chain.configJsonInvalidWithMessage": "{{path}} の設定ファイルは有効なJSON(C)ではありません: {{message}}", + "error.chain.configDirectoryTypo": + '{{path}} 内のディレクトリ "{{dir}}" は無効です。"{{suggestion}}" に名前を変更するか削除してください。これはよくあるタイプミスです。', + "error.chain.configFrontmatterError": "{{path}} のフロントマターの解析に失敗しました:\n{{message}}", + "error.chain.configInvalid": "{{path}} の設定ファイルが無効です", + "error.chain.configInvalidWithMessage": "{{path}} の設定ファイルが無効です: {{message}}", + + "notification.permission.title": "権限が必要です", + "notification.permission.description": "{{projectName}} の {{sessionTitle}} が権限を必要としています", + "notification.question.title": "質問", + "notification.question.description": "{{projectName}} の {{sessionTitle}} から質問があります", + "notification.action.goToSession": "セッションへ移動", + + "notification.session.responseReady.title": "応答の準備ができました", + "notification.session.error.title": "セッションエラー", + "notification.session.error.fallbackDescription": "エラーが発生しました", + + "home.recentProjects": "最近のプロジェクト", + "home.empty.title": "最近のプロジェクトはありません", + "home.empty.description": "ローカルプロジェクトを開いて始めましょう", + + "session.tab.session": "セッション", + "session.tab.review": "レビュー", + "session.tab.context": "コンテキスト", + "session.panel.reviewAndFiles": "レビューとファイル", + "session.review.filesChanged": "{{count}} ファイル変更", + "session.review.loadingChanges": "変更を読み込み中...", + "session.review.empty": "このセッションでの変更はまだありません", + "session.messages.renderEarlier": "以前のメッセージを表示", + "session.messages.loadingEarlier": "以前のメッセージを読み込み中...", + "session.messages.loadEarlier": "以前のメッセージを読み込む", + "session.messages.loading": "メッセージを読み込み中...", + + "session.context.addToContext": "{{selection}}をコンテキストに追加", + + "session.new.worktree.main": "メインブランチ", + "session.new.worktree.mainWithBranch": "メインブランチ ({{branch}})", + "session.new.worktree.create": "新しいワークツリーを作成", + "session.new.lastModified": "最終更新", + + "session.header.search.placeholder": "{{project}}を検索", + "session.header.searchFiles": "ファイルを検索", + + "session.share.popover.title": "ウェブで公開", + "session.share.popover.description.shared": + "このセッションはウェブで公開されています。リンクを知っている人なら誰でもアクセスできます。", + "session.share.popover.description.unshared": + "セッションをウェブで公開します。リンクを知っている人なら誰でもアクセスできるようになります。", + "session.share.action.share": "共有", + "session.share.action.publish": "公開", + "session.share.action.publishing": "公開中...", + "session.share.action.unpublish": "非公開にする", + "session.share.action.unpublishing": "非公開にしています...", + "session.share.action.view": "表示", + "session.share.copy.copied": "コピーしました", + "session.share.copy.copyLink": "リンクをコピー", + + "lsp.tooltip.none": "LSPサーバーなし", + "lsp.label.connected": "{{count}} LSP", + + "prompt.loading": "プロンプトを読み込み中...", + "terminal.loading": "ターミナルを読み込み中...", + "terminal.title": "ターミナル", + "terminal.title.numbered": "ターミナル {{number}}", + "terminal.close": "ターミナルを閉じる", + + "common.closeTab": "タブを閉じる", + "common.dismiss": "閉じる", + "common.requestFailed": "リクエスト失敗", + "common.moreOptions": "その他のオプション", + "common.learnMore": "詳細", + "common.rename": "名前変更", + "common.reset": "リセット", + "common.archive": "アーカイブ", + "common.delete": "削除", + "common.close": "閉じる", + "common.edit": "編集", + "common.loadMore": "さらに読み込む", + + "sidebar.nav.projectsAndSessions": "プロジェクトとセッション", + "sidebar.settings": "設定", + "sidebar.help": "ヘルプ", + "sidebar.workspaces.enable": "ワークスペースを有効化", + "sidebar.workspaces.disable": "ワークスペースを無効化", + "sidebar.gettingStarted.title": "はじめに", + "sidebar.gettingStarted.line1": "OpenCodeには無料モデルが含まれているため、すぐに開始できます。", + "sidebar.gettingStarted.line2": "プロバイダーを接続して、Claude、GPT、Geminiなどのモデルを使用できます。", + "sidebar.project.recentSessions": "最近のセッション", + "sidebar.project.viewAllSessions": "すべてのセッションを表示", + + "settings.section.desktop": "デスクトップ", + "settings.tab.general": "一般", + "settings.tab.shortcuts": "ショートカット", + + "settings.general.section.appearance": "外観", + "settings.general.section.notifications": "システム通知", + "settings.general.section.sounds": "効果音", + + "settings.general.row.language.title": "言語", + "settings.general.row.language.description": "OpenCodeの表示言語を変更します", + "settings.general.row.appearance.title": "外観", + "settings.general.row.appearance.description": "デバイスでのOpenCodeの表示をカスタマイズします", + "settings.general.row.theme.title": "テーマ", + "settings.general.row.theme.description": "OpenCodeのテーマをカスタマイズします。", + "settings.general.row.font.title": "フォント", + "settings.general.row.font.description": "コードブロックで使用する等幅フォントをカスタマイズします", + + "settings.general.notifications.agent.title": "エージェント", + "settings.general.notifications.agent.description": + "エージェントが完了したか、注意が必要な場合にシステム通知を表示します", + "settings.general.notifications.permissions.title": "権限", + "settings.general.notifications.permissions.description": "権限が必要な場合にシステム通知を表示します", + "settings.general.notifications.errors.title": "エラー", + "settings.general.notifications.errors.description": "エラーが発生した場合にシステム通知を表示します", + + "settings.general.sounds.agent.title": "エージェント", + "settings.general.sounds.agent.description": "エージェントが完了したか、注意が必要な場合に音を再生します", + "settings.general.sounds.permissions.title": "権限", + "settings.general.sounds.permissions.description": "権限が必要な場合に音を再生します", + "settings.general.sounds.errors.title": "エラー", + "settings.general.sounds.errors.description": "エラーが発生した場合に音を再生します", + + "settings.shortcuts.title": "キーボードショートカット", + "settings.shortcuts.reset.button": "デフォルトにリセット", + "settings.shortcuts.reset.toast.title": "ショートカットをリセットしました", + "settings.shortcuts.reset.toast.description": "キーボードショートカットがデフォルトにリセットされました。", + "settings.shortcuts.conflict.title": "ショートカットは既に使用されています", + "settings.shortcuts.conflict.description": "{{keybind}} は既に {{titles}} に割り当てられています。", + "settings.shortcuts.unassigned": "未割り当て", + "settings.shortcuts.pressKeys": "キーを押してください", + "settings.shortcuts.search.placeholder": "ショートカットを検索", + "settings.shortcuts.search.empty": "ショートカットが見つかりません", + + "settings.shortcuts.group.general": "一般", + "settings.shortcuts.group.session": "セッション", + "settings.shortcuts.group.navigation": "ナビゲーション", + "settings.shortcuts.group.modelAndAgent": "モデルとエージェント", + "settings.shortcuts.group.terminal": "ターミナル", + "settings.shortcuts.group.prompt": "プロンプト", + + "settings.providers.title": "プロバイダー", + "settings.providers.description": "プロバイダー設定はここで構成できます。", + "settings.models.title": "モデル", + "settings.models.description": "モデル設定はここで構成できます。", + "settings.agents.title": "エージェント", + "settings.agents.description": "エージェント設定はここで構成できます。", + "settings.commands.title": "コマンド", + "settings.commands.description": "コマンド設定はここで構成できます。", + "settings.mcp.title": "MCP", + "settings.mcp.description": "MCP設定はここで構成できます。", + + "settings.permissions.title": "権限", + "settings.permissions.description": "サーバーがデフォルトで使用できるツールを制御します。", + "settings.permissions.section.tools": "ツール", + "settings.permissions.toast.updateFailed.title": "権限の更新に失敗しました", + + "settings.permissions.action.allow": "許可", + "settings.permissions.action.ask": "確認", + "settings.permissions.action.deny": "拒否", + + "settings.permissions.tool.read.title": "読み込み", + "settings.permissions.tool.read.description": "ファイルの読み込み (ファイルパスに一致)", + "settings.permissions.tool.edit.title": "編集", + "settings.permissions.tool.edit.description": "ファイルの変更(編集、書き込み、パッチ、複数編集を含む)", + "settings.permissions.tool.glob.title": "Glob", + "settings.permissions.tool.glob.description": "Globパターンを使用したファイルの一致", + "settings.permissions.tool.grep.title": "Grep", + "settings.permissions.tool.grep.description": "正規表現を使用したファイル内容の検索", + "settings.permissions.tool.list.title": "リスト", + "settings.permissions.tool.list.description": "ディレクトリ内のファイル一覧表示", + "settings.permissions.tool.bash.title": "Bash", + "settings.permissions.tool.bash.description": "シェルコマンドの実行", + "settings.permissions.tool.task.title": "タスク", + "settings.permissions.tool.task.description": "サブエージェントの起動", + "settings.permissions.tool.skill.title": "スキル", + "settings.permissions.tool.skill.description": "名前によるスキルの読み込み", + "settings.permissions.tool.lsp.title": "LSP", + "settings.permissions.tool.lsp.description": "言語サーバークエリの実行", + "settings.permissions.tool.todoread.title": "Todo読み込み", + "settings.permissions.tool.todoread.description": "Todoリストの読み込み", + "settings.permissions.tool.todowrite.title": "Todo書き込み", + "settings.permissions.tool.todowrite.description": "Todoリストの更新", + "settings.permissions.tool.webfetch.title": "Web Fetch", + "settings.permissions.tool.webfetch.description": "URLからコンテンツを取得", + "settings.permissions.tool.websearch.title": "Web Search", + "settings.permissions.tool.websearch.description": "ウェブを検索", + "settings.permissions.tool.codesearch.title": "Code Search", + "settings.permissions.tool.codesearch.description": "ウェブ上のコードを検索", + "settings.permissions.tool.external_directory.title": "外部ディレクトリ", + "settings.permissions.tool.external_directory.description": "プロジェクトディレクトリ外のファイルへのアクセス", + "settings.permissions.tool.doom_loop.title": "Doom Loop", + "settings.permissions.tool.doom_loop.description": "同一入力による繰り返しのツール呼び出しを検出", + + "session.delete.failed.title": "セッションの削除に失敗しました", + "session.delete.title": "セッションの削除", + "session.delete.confirm": 'セッション "{{name}}" を削除しますか?', + "session.delete.button": "セッションを削除", + + "workspace.new": "新しいワークスペース", + "workspace.type.local": "ローカル", + "workspace.type.sandbox": "サンドボックス", + "workspace.create.failed.title": "ワークスペースの作成に失敗しました", + "workspace.delete.failed.title": "ワークスペースの削除に失敗しました", + "workspace.resetting.title": "ワークスペースをリセット中", + "workspace.resetting.description": "これには少し時間がかかる場合があります。", + "workspace.reset.failed.title": "ワークスペースのリセットに失敗しました", + "workspace.reset.success.title": "ワークスペースをリセットしました", + "workspace.reset.success.description": "ワークスペースはデフォルトブランチと一致しています。", + "workspace.status.checking": "未マージの変更を確認中...", + "workspace.status.error": "gitステータスを確認できません。", + "workspace.status.clean": "未マージの変更は検出されませんでした。", + "workspace.status.dirty": "このワークスペースで未マージの変更が検出されました。", + "workspace.delete.title": "ワークスペースの削除", + "workspace.delete.confirm": 'ワークスペース "{{name}}" を削除しますか?', + "workspace.delete.button": "ワークスペースを削除", + "workspace.reset.title": "ワークスペースのリセット", + "workspace.reset.confirm": 'ワークスペース "{{name}}" をリセットしますか?', + "workspace.reset.button": "ワークスペースをリセット", + "workspace.reset.archived.none": "アクティブなセッションはアーカイブされません。", + "workspace.reset.archived.one": "1つのセッションがアーカイブされます。", + "workspace.reset.archived.many": "{{count}}個のセッションがアーカイブされます。", + "workspace.reset.note": "これにより、ワークスペースはデフォルトブランチと一致するようにリセットされます。", +} diff --git a/packages/app/src/i18n/ko.ts b/packages/app/src/i18n/ko.ts new file mode 100644 index 00000000000..69a5fd65889 --- /dev/null +++ b/packages/app/src/i18n/ko.ts @@ -0,0 +1,578 @@ +import { dict as en } from "./en" + +type Keys = keyof typeof en + +export const dict = { + "command.category.suggested": "추천", + "command.category.view": "보기", + "command.category.project": "프로젝트", + "command.category.provider": "공급자", + "command.category.server": "서버", + "command.category.session": "세션", + "command.category.theme": "테마", + "command.category.language": "언어", + "command.category.file": "파일", + "command.category.terminal": "터미널", + "command.category.model": "모델", + "command.category.mcp": "MCP", + "command.category.agent": "에이전트", + "command.category.permissions": "권한", + "command.category.workspace": "작업 공간", + + "theme.scheme.system": "시스템", + "theme.scheme.light": "라이트", + "theme.scheme.dark": "다크", + + "command.sidebar.toggle": "사이드바 토글", + "command.project.open": "프로젝트 열기", + "command.provider.connect": "공급자 연결", + "command.server.switch": "서버 전환", + "command.session.previous": "이전 세션", + "command.session.next": "다음 세션", + "command.session.archive": "세션 보관", + + "command.palette": "명령 팔레트", + + "command.theme.cycle": "테마 순환", + "command.theme.set": "테마 사용: {{theme}}", + "command.theme.scheme.cycle": "색상 테마 순환", + "command.theme.scheme.set": "색상 테마 사용: {{scheme}}", + + "command.language.cycle": "언어 순환", + "command.language.set": "언어 사용: {{language}}", + + "command.session.new": "새 세션", + "command.file.open": "파일 열기", + "command.file.open.description": "파일 및 명령어 검색", + "command.terminal.toggle": "터미널 토글", + "command.review.toggle": "검토 토글", + "command.terminal.new": "새 터미널", + "command.terminal.new.description": "새 터미널 탭 생성", + "command.steps.toggle": "단계 토글", + "command.steps.toggle.description": "현재 메시지의 단계 표시/숨기기", + "command.message.previous": "이전 메시지", + "command.message.previous.description": "이전 사용자 메시지로 이동", + "command.message.next": "다음 메시지", + "command.message.next.description": "다음 사용자 메시지로 이동", + "command.model.choose": "모델 선택", + "command.model.choose.description": "다른 모델 선택", + "command.mcp.toggle": "MCP 토글", + "command.mcp.toggle.description": "MCP 토글", + "command.agent.cycle": "에이전트 순환", + "command.agent.cycle.description": "다음 에이전트로 전환", + "command.agent.cycle.reverse": "에이전트 역순환", + "command.agent.cycle.reverse.description": "이전 에이전트로 전환", + "command.model.variant.cycle": "생각 수준 순환", + "command.model.variant.cycle.description": "다음 생각 수준으로 전환", + "command.permissions.autoaccept.enable": "편집 자동 수락", + "command.permissions.autoaccept.disable": "편집 자동 수락 중지", + "command.session.undo": "실행 취소", + "command.session.undo.description": "마지막 메시지 실행 취소", + "command.session.redo": "다시 실행", + "command.session.redo.description": "마지막 실행 취소된 메시지 다시 실행", + "command.session.compact": "세션 압축", + "command.session.compact.description": "컨텍스트 크기를 줄이기 위해 세션 요약", + "command.session.fork": "메시지에서 분기", + "command.session.fork.description": "이전 메시지에서 새 세션 생성", + "command.session.share": "세션 공유", + "command.session.share.description": "이 세션을 공유하고 URL을 클립보드에 복사", + "command.session.unshare": "세션 공유 중지", + "command.session.unshare.description": "이 세션 공유 중지", + + "palette.search.placeholder": "파일 및 명령어 검색", + "palette.empty": "결과 없음", + "palette.group.commands": "명령어", + "palette.group.files": "파일", + + "dialog.provider.search.placeholder": "공급자 검색", + "dialog.provider.empty": "공급자 없음", + "dialog.provider.group.popular": "인기", + "dialog.provider.group.other": "기타", + "dialog.provider.tag.recommended": "추천", + "dialog.provider.anthropic.note": "Claude Pro/Max 또는 API 키로 연결", + + "dialog.model.select.title": "모델 선택", + "dialog.model.search.placeholder": "모델 검색", + "dialog.model.empty": "모델 결과 없음", + "dialog.model.manage": "모델 관리", + "dialog.model.manage.description": "모델 선택기에 표시할 모델 사용자 지정", + + "dialog.model.unpaid.freeModels.title": "OpenCode에서 제공하는 무료 모델", + "dialog.model.unpaid.addMore.title": "인기 공급자의 모델 추가", + + "dialog.provider.viewAll": "모든 공급자 보기", + + "provider.connect.title": "{{provider}} 연결", + "provider.connect.title.anthropicProMax": "Claude Pro/Max로 로그인", + "provider.connect.selectMethod": "{{provider}} 로그인 방법 선택", + "provider.connect.method.apiKey": "API 키", + "provider.connect.status.inProgress": "인증 진행 중...", + "provider.connect.status.waiting": "인증 대기 중...", + "provider.connect.status.failed": "인증 실패: {{error}}", + "provider.connect.apiKey.description": + "{{provider}} API 키를 입력하여 계정을 연결하고 OpenCode에서 {{provider}} 모델을 사용하세요.", + "provider.connect.apiKey.label": "{{provider}} API 키", + "provider.connect.apiKey.placeholder": "API 키", + "provider.connect.apiKey.required": "API 키가 필요합니다", + "provider.connect.opencodeZen.line1": + "OpenCode Zen은 코딩 에이전트를 위해 최적화된 신뢰할 수 있는 엄선된 모델에 대한 액세스를 제공합니다.", + "provider.connect.opencodeZen.line2": "단일 API 키로 Claude, GPT, Gemini, GLM 등 다양한 모델에 액세스할 수 있습니다.", + "provider.connect.opencodeZen.visit.prefix": "", + "provider.connect.opencodeZen.visit.suffix": "를 방문하여 API 키를 받으세요.", + "provider.connect.oauth.code.visit.prefix": "", + "provider.connect.oauth.code.visit.link": "이 링크", + "provider.connect.oauth.code.visit.suffix": + "를 방문하여 인증 코드를 받아 계정을 연결하고 OpenCode에서 {{provider}} 모델을 사용하세요.", + "provider.connect.oauth.code.label": "{{method}} 인증 코드", + "provider.connect.oauth.code.placeholder": "인증 코드", + "provider.connect.oauth.code.required": "인증 코드가 필요합니다", + "provider.connect.oauth.code.invalid": "유효하지 않은 인증 코드", + "provider.connect.oauth.auto.visit.prefix": "", + "provider.connect.oauth.auto.visit.link": "이 링크", + "provider.connect.oauth.auto.visit.suffix": + "를 방문하고 아래 코드를 입력하여 계정을 연결하고 OpenCode에서 {{provider}} 모델을 사용하세요.", + "provider.connect.oauth.auto.confirmationCode": "확인 코드", + "provider.connect.toast.connected.title": "{{provider}} 연결됨", + "provider.connect.toast.connected.description": "이제 {{provider}} 모델을 사용할 수 있습니다.", + + "model.tag.free": "무료", + "model.tag.latest": "최신", + + "common.search.placeholder": "검색", + "common.goBack": "뒤로 가기", + "common.loading": "로딩 중", + "common.cancel": "취소", + "common.submit": "제출", + "common.save": "저장", + "common.saving": "저장 중...", + "common.default": "기본값", + "common.attachment": "첨부 파일", + + "prompt.placeholder.shell": "셸 명령어 입력...", + "prompt.placeholder.normal": '무엇이든 물어보세요... "{{example}}"', + "prompt.mode.shell": "셸", + "prompt.mode.shell.exit": "종료하려면 esc", + + "prompt.example.1": "코드베이스의 TODO 수정", + "prompt.example.2": "이 프로젝트의 기술 스택이 무엇인가요?", + "prompt.example.3": "고장 난 테스트 수정", + "prompt.example.4": "인증 작동 방식 설명", + "prompt.example.5": "보안 취약점 찾기 및 수정", + "prompt.example.6": "사용자 서비스에 단위 테스트 추가", + "prompt.example.7": "이 함수를 더 읽기 쉽게 리팩터링", + "prompt.example.8": "이 오류는 무엇을 의미하나요?", + "prompt.example.9": "이 문제 디버깅 도와줘", + "prompt.example.10": "API 문서 생성", + "prompt.example.11": "데이터베이스 쿼리 최적화", + "prompt.example.12": "입력 유효성 검사 추가", + "prompt.example.13": "...를 위한 새 컴포넌트 생성", + "prompt.example.14": "이 프로젝트를 어떻게 배포하나요?", + "prompt.example.15": "모범 사례를 기준으로 내 코드 검토", + "prompt.example.16": "이 함수에 오류 처리 추가", + "prompt.example.17": "이 정규식 패턴 설명", + "prompt.example.18": "이것을 TypeScript로 변환", + "prompt.example.19": "코드베이스 전체에 로깅 추가", + "prompt.example.20": "오래된 종속성은 무엇인가요?", + "prompt.example.21": "마이그레이션 스크립트 작성 도와줘", + "prompt.example.22": "이 엔드포인트에 캐싱 구현", + "prompt.example.23": "이 목록에 페이지네이션 추가", + "prompt.example.24": "...를 위한 CLI 명령어 생성", + "prompt.example.25": "여기서 환경 변수는 어떻게 작동하나요?", + + "prompt.popover.emptyResults": "일치하는 결과 없음", + "prompt.popover.emptyCommands": "일치하는 명령어 없음", + "prompt.dropzone.label": "이미지나 PDF를 여기에 드롭하세요", + "prompt.slash.badge.custom": "사용자 지정", + "prompt.context.active": "활성", + "prompt.context.includeActiveFile": "활성 파일 포함", + "prompt.context.removeActiveFile": "컨텍스트에서 활성 파일 제거", + "prompt.context.removeFile": "컨텍스트에서 파일 제거", + "prompt.action.attachFile": "파일 첨부", + "prompt.attachment.remove": "첨부 파일 제거", + "prompt.action.send": "전송", + "prompt.action.stop": "중지", + + "prompt.toast.pasteUnsupported.title": "지원되지 않는 붙여넣기", + "prompt.toast.pasteUnsupported.description": "이미지나 PDF만 붙여넣을 수 있습니다.", + "prompt.toast.modelAgentRequired.title": "에이전트 및 모델 선택", + "prompt.toast.modelAgentRequired.description": "프롬프트를 보내기 전에 에이전트와 모델을 선택하세요.", + "prompt.toast.worktreeCreateFailed.title": "작업 트리 생성 실패", + "prompt.toast.sessionCreateFailed.title": "세션 생성 실패", + "prompt.toast.shellSendFailed.title": "셸 명령 전송 실패", + "prompt.toast.commandSendFailed.title": "명령 전송 실패", + "prompt.toast.promptSendFailed.title": "프롬프트 전송 실패", + + "dialog.mcp.title": "MCP", + "dialog.mcp.description": "{{total}}개 중 {{enabled}}개 활성화됨", + "dialog.mcp.empty": "구성된 MCP 없음", + + "mcp.status.connected": "연결됨", + "mcp.status.failed": "실패", + "mcp.status.needs_auth": "인증 필요", + "mcp.status.disabled": "비활성화됨", + + "dialog.fork.empty": "분기할 메시지 없음", + + "dialog.directory.search.placeholder": "폴더 검색", + "dialog.directory.empty": "폴더 없음", + + "dialog.server.title": "서버", + "dialog.server.description": "이 앱이 연결할 OpenCode 서버를 전환합니다.", + "dialog.server.search.placeholder": "서버 검색", + "dialog.server.empty": "서버 없음", + "dialog.server.add.title": "서버 추가", + "dialog.server.add.url": "서버 URL", + "dialog.server.add.placeholder": "http://localhost:4096", + "dialog.server.add.error": "서버에 연결할 수 없습니다", + "dialog.server.add.checking": "확인 중...", + "dialog.server.add.button": "추가", + "dialog.server.default.title": "기본 서버", + "dialog.server.default.description": + "로컬 서버를 시작하는 대신 앱 실행 시 이 서버에 연결합니다. 다시 시작해야 합니다.", + "dialog.server.default.none": "선택된 서버 없음", + "dialog.server.default.set": "현재 서버를 기본값으로 설정", + "dialog.server.default.clear": "지우기", + "dialog.server.action.remove": "서버 제거", + + "dialog.project.edit.title": "프로젝트 편집", + "dialog.project.edit.name": "이름", + "dialog.project.edit.icon": "아이콘", + "dialog.project.edit.icon.alt": "프로젝트 아이콘", + "dialog.project.edit.icon.hint": "이미지를 클릭하거나 드래그하세요", + "dialog.project.edit.icon.recommended": "권장: 128x128px", + "dialog.project.edit.color": "색상", + "dialog.project.edit.color.select": "{{color}} 색상 선택", + + "context.breakdown.title": "컨텍스트 분석", + "context.breakdown.note": '입력 토큰의 대략적인 분석입니다. "기타"에는 도구 정의 및 오버헤드가 포함됩니다.', + "context.breakdown.system": "시스템", + "context.breakdown.user": "사용자", + "context.breakdown.assistant": "어시스턴트", + "context.breakdown.tool": "도구 호출", + "context.breakdown.other": "기타", + + "context.systemPrompt.title": "시스템 프롬프트", + "context.rawMessages.title": "원시 메시지", + + "context.stats.session": "세션", + "context.stats.messages": "메시지", + "context.stats.provider": "공급자", + "context.stats.model": "모델", + "context.stats.limit": "컨텍스트 제한", + "context.stats.totalTokens": "총 토큰", + "context.stats.usage": "사용량", + "context.stats.inputTokens": "입력 토큰", + "context.stats.outputTokens": "출력 토큰", + "context.stats.reasoningTokens": "추론 토큰", + "context.stats.cacheTokens": "캐시 토큰 (읽기/쓰기)", + "context.stats.userMessages": "사용자 메시지", + "context.stats.assistantMessages": "어시스턴트 메시지", + "context.stats.totalCost": "총 비용", + "context.stats.sessionCreated": "세션 생성됨", + "context.stats.lastActivity": "최근 활동", + + "context.usage.tokens": "토큰", + "context.usage.usage": "사용량", + "context.usage.cost": "비용", + "context.usage.clickToView": "컨텍스트를 보려면 클릭", + "context.usage.view": "컨텍스트 사용량 보기", + + "language.en": "영어", + "language.zh": "중국어 (간체)", + "language.zht": "중국어 (번체)", + "language.ko": "한국어", + "language.de": "독일어", + "language.es": "스페인어", + "language.fr": "프랑스어", + "language.ja": "일본어", + "language.da": "덴마크어", + "language.ru": "러시아어", + "language.pl": "폴란드어", + "language.ar": "아랍어", + "language.no": "노르웨이어", + "language.br": "포르투갈어 (브라질)", + + "toast.language.title": "언어", + "toast.language.description": "{{language}}(으)로 전환됨", + + "toast.theme.title": "테마 전환됨", + "toast.scheme.title": "색상 테마", + + "toast.permissions.autoaccept.on.title": "편집 자동 수락 중", + "toast.permissions.autoaccept.on.description": "편집 및 쓰기 권한이 자동으로 승인됩니다", + "toast.permissions.autoaccept.off.title": "편집 자동 수락 중지됨", + "toast.permissions.autoaccept.off.description": "편집 및 쓰기 권한 승인이 필요합니다", + + "toast.model.none.title": "선택된 모델 없음", + "toast.model.none.description": "이 세션을 요약하려면 공급자를 연결하세요", + + "toast.file.loadFailed.title": "파일 로드 실패", + + "toast.session.share.copyFailed.title": "URL 클립보드 복사 실패", + "toast.session.share.success.title": "세션 공유됨", + "toast.session.share.success.description": "공유 URL이 클립보드에 복사되었습니다!", + "toast.session.share.failed.title": "세션 공유 실패", + "toast.session.share.failed.description": "세션을 공유하는 동안 오류가 발생했습니다", + + "toast.session.unshare.success.title": "세션 공유 해제됨", + "toast.session.unshare.success.description": "세션 공유가 성공적으로 해제되었습니다!", + "toast.session.unshare.failed.title": "세션 공유 해제 실패", + "toast.session.unshare.failed.description": "세션 공유를 해제하는 동안 오류가 발생했습니다", + + "toast.session.listFailed.title": "{{project}}에 대한 세션을 로드하지 못했습니다", + + "toast.update.title": "업데이트 가능", + "toast.update.description": "OpenCode의 새 버전({{version}})을 설치할 수 있습니다.", + "toast.update.action.installRestart": "설치 및 다시 시작", + "toast.update.action.notYet": "나중에", + + "error.page.title": "문제가 발생했습니다", + "error.page.description": "애플리케이션을 로드하는 동안 오류가 발생했습니다.", + "error.page.details.label": "오류 세부 정보", + "error.page.action.restart": "다시 시작", + "error.page.action.checking": "확인 중...", + "error.page.action.checkUpdates": "업데이트 확인", + "error.page.action.updateTo": "{{version}} 버전으로 업데이트", + "error.page.report.prefix": "이 오류를 OpenCode 팀에 제보해 주세요: ", + "error.page.report.discord": "Discord", + "error.page.version": "버전: {{version}}", + + "error.dev.rootNotFound": + "루트 요소를 찾을 수 없습니다. index.html에 추가하는 것을 잊으셨나요? 또는 id 속성의 철자가 틀렸을 수 있습니다.", + + "error.globalSync.connectFailed": "서버에 연결할 수 없습니다. `{{url}}`에서 서버가 실행 중인가요?", + + "error.chain.unknown": "알 수 없는 오류", + "error.chain.causedBy": "원인:", + "error.chain.apiError": "API 오류", + "error.chain.status": "상태: {{status}}", + "error.chain.retryable": "재시도 가능: {{retryable}}", + "error.chain.responseBody": "응답 본문:\n{{body}}", + "error.chain.didYouMean": "혹시 {{suggestions}}을(를) 의미하셨나요?", + "error.chain.modelNotFound": "모델을 찾을 수 없음: {{provider}}/{{model}}", + "error.chain.checkConfig": "구성(opencode.json)의 공급자/모델 이름을 확인하세요", + "error.chain.mcpFailed": 'MCP 서버 "{{name}}" 실패. 참고: OpenCode는 아직 MCP 인증을 지원하지 않습니다.', + "error.chain.providerAuthFailed": "공급자 인증 실패 ({{provider}}): {{message}}", + "error.chain.providerInitFailed": '공급자 "{{provider}}" 초기화 실패. 자격 증명과 구성을 확인하세요.', + "error.chain.configJsonInvalid": "{{path}}의 구성 파일이 유효한 JSON(C)가 아닙니다", + "error.chain.configJsonInvalidWithMessage": "{{path}}의 구성 파일이 유효한 JSON(C)가 아닙니다: {{message}}", + "error.chain.configDirectoryTypo": + '{{path}}의 "{{dir}}" 디렉터리가 유효하지 않습니다. 디렉터리 이름을 "{{suggestion}}"으로 변경하거나 제거하세요. 이는 흔한 오타입니다.', + "error.chain.configFrontmatterError": "{{path}}의 frontmatter 파싱 실패:\n{{message}}", + "error.chain.configInvalid": "{{path}}의 구성 파일이 유효하지 않습니다", + "error.chain.configInvalidWithMessage": "{{path}}의 구성 파일이 유효하지 않습니다: {{message}}", + + "notification.permission.title": "권한 필요", + "notification.permission.description": "{{projectName}}의 {{sessionTitle}}에서 권한이 필요합니다", + "notification.question.title": "질문", + "notification.question.description": "{{projectName}}의 {{sessionTitle}}에서 질문이 있습니다", + "notification.action.goToSession": "세션으로 이동", + + "notification.session.responseReady.title": "응답 준비됨", + "notification.session.error.title": "세션 오류", + "notification.session.error.fallbackDescription": "오류가 발생했습니다", + + "home.recentProjects": "최근 프로젝트", + "home.empty.title": "최근 프로젝트 없음", + "home.empty.description": "로컬 프로젝트를 열어 시작하세요", + + "session.tab.session": "세션", + "session.tab.review": "검토", + "session.tab.context": "컨텍스트", + "session.panel.reviewAndFiles": "검토 및 파일", + "session.review.filesChanged": "{{count}}개 파일 변경됨", + "session.review.loadingChanges": "변경 사항 로드 중...", + "session.review.empty": "이 세션에 변경 사항이 아직 없습니다", + "session.messages.renderEarlier": "이전 메시지 렌더링", + "session.messages.loadingEarlier": "이전 메시지 로드 중...", + "session.messages.loadEarlier": "이전 메시지 로드", + "session.messages.loading": "메시지 로드 중...", + + "session.context.addToContext": "컨텍스트에 {{selection}} 추가", + + "session.new.worktree.main": "메인 브랜치", + "session.new.worktree.mainWithBranch": "메인 브랜치 ({{branch}})", + "session.new.worktree.create": "새 작업 트리 생성", + "session.new.lastModified": "최근 수정", + + "session.header.search.placeholder": "{{project}} 검색", + "session.header.searchFiles": "파일 검색", + + "session.share.popover.title": "웹에 게시", + "session.share.popover.description.shared": "이 세션은 웹에 공개되었습니다. 링크가 있는 누구나 액세스할 수 있습니다.", + "session.share.popover.description.unshared": + "세션을 웹에 공개적으로 공유합니다. 링크가 있는 누구나 액세스할 수 있습니다.", + "session.share.action.share": "공유", + "session.share.action.publish": "게시", + "session.share.action.publishing": "게시 중...", + "session.share.action.unpublish": "게시 취소", + "session.share.action.unpublishing": "게시 취소 중...", + "session.share.action.view": "보기", + "session.share.copy.copied": "복사됨", + "session.share.copy.copyLink": "링크 복사", + + "lsp.tooltip.none": "LSP 서버 없음", + "lsp.label.connected": "{{count}} LSP", + + "prompt.loading": "프롬프트 로드 중...", + "terminal.loading": "터미널 로드 중...", + "terminal.title": "터미널", + "terminal.title.numbered": "터미널 {{number}}", + "terminal.close": "터미널 닫기", + + "common.closeTab": "탭 닫기", + "common.dismiss": "닫기", + "common.requestFailed": "요청 실패", + "common.moreOptions": "더 많은 옵션", + "common.learnMore": "더 알아보기", + "common.rename": "이름 바꾸기", + "common.reset": "초기화", + "common.archive": "보관", + "common.delete": "삭제", + "common.close": "닫기", + "common.edit": "편집", + "common.loadMore": "더 불러오기", + + "sidebar.nav.projectsAndSessions": "프로젝트 및 세션", + "sidebar.settings": "설정", + "sidebar.help": "도움말", + "sidebar.workspaces.enable": "작업 공간 활성화", + "sidebar.workspaces.disable": "작업 공간 비활성화", + "sidebar.gettingStarted.title": "시작하기", + "sidebar.gettingStarted.line1": "OpenCode에는 무료 모델이 포함되어 있어 즉시 시작할 수 있습니다.", + "sidebar.gettingStarted.line2": "Claude, GPT, Gemini 등을 포함한 모델을 사용하려면 공급자를 연결하세요.", + "sidebar.project.recentSessions": "최근 세션", + "sidebar.project.viewAllSessions": "모든 세션 보기", + + "settings.section.desktop": "데스크톱", + "settings.tab.general": "일반", + "settings.tab.shortcuts": "단축키", + + "settings.general.section.appearance": "모양", + "settings.general.section.notifications": "시스템 알림", + "settings.general.section.sounds": "효과음", + + "settings.general.row.language.title": "언어", + "settings.general.row.language.description": "OpenCode 표시 언어 변경", + "settings.general.row.appearance.title": "모양", + "settings.general.row.appearance.description": "기기에서 OpenCode가 보이는 방식 사용자 지정", + "settings.general.row.theme.title": "테마", + "settings.general.row.theme.description": "OpenCode 테마 사용자 지정", + "settings.general.row.font.title": "글꼴", + "settings.general.row.font.description": "코드 블록에 사용되는 고정폭 글꼴 사용자 지정", + + "settings.general.notifications.agent.title": "에이전트", + "settings.general.notifications.agent.description": "에이전트가 완료되거나 주의가 필요할 때 시스템 알림 표시", + "settings.general.notifications.permissions.title": "권한", + "settings.general.notifications.permissions.description": "권한이 필요할 때 시스템 알림 표시", + "settings.general.notifications.errors.title": "오류", + "settings.general.notifications.errors.description": "오류가 발생했을 때 시스템 알림 표시", + + "settings.general.sounds.agent.title": "에이전트", + "settings.general.sounds.agent.description": "에이전트가 완료되거나 주의가 필요할 때 소리 재생", + "settings.general.sounds.permissions.title": "권한", + "settings.general.sounds.permissions.description": "권한이 필요할 때 소리 재생", + "settings.general.sounds.errors.title": "오류", + "settings.general.sounds.errors.description": "오류가 발생했을 때 소리 재생", + + "settings.shortcuts.title": "키보드 단축키", + "settings.shortcuts.reset.button": "기본값으로 초기화", + "settings.shortcuts.reset.toast.title": "단축키 초기화됨", + "settings.shortcuts.reset.toast.description": "키보드 단축키가 기본값으로 초기화되었습니다.", + "settings.shortcuts.conflict.title": "단축키가 이미 사용 중임", + "settings.shortcuts.conflict.description": "{{keybind}}은(는) 이미 {{titles}}에 할당되어 있습니다.", + "settings.shortcuts.unassigned": "할당되지 않음", + "settings.shortcuts.pressKeys": "키 누르기", + "settings.shortcuts.search.placeholder": "단축키 검색", + "settings.shortcuts.search.empty": "단축키를 찾을 수 없습니다", + + "settings.shortcuts.group.general": "일반", + "settings.shortcuts.group.session": "세션", + "settings.shortcuts.group.navigation": "탐색", + "settings.shortcuts.group.modelAndAgent": "모델 및 에이전트", + "settings.shortcuts.group.terminal": "터미널", + "settings.shortcuts.group.prompt": "프롬프트", + + "settings.providers.title": "공급자", + "settings.providers.description": "공급자 설정은 여기서 구성할 수 있습니다.", + "settings.models.title": "모델", + "settings.models.description": "모델 설정은 여기서 구성할 수 있습니다.", + "settings.agents.title": "에이전트", + "settings.agents.description": "에이전트 설정은 여기서 구성할 수 있습니다.", + "settings.commands.title": "명령어", + "settings.commands.description": "명령어 설정은 여기서 구성할 수 있습니다.", + "settings.mcp.title": "MCP", + "settings.mcp.description": "MCP 설정은 여기서 구성할 수 있습니다.", + + "settings.permissions.title": "권한", + "settings.permissions.description": "서버가 기본적으로 사용할 수 있는 도구를 제어합니다.", + "settings.permissions.section.tools": "도구", + "settings.permissions.toast.updateFailed.title": "권한 업데이트 실패", + + "settings.permissions.action.allow": "허용", + "settings.permissions.action.ask": "묻기", + "settings.permissions.action.deny": "거부", + + "settings.permissions.tool.read.title": "읽기", + "settings.permissions.tool.read.description": "파일 읽기 (파일 경로와 일치)", + "settings.permissions.tool.edit.title": "편집", + "settings.permissions.tool.edit.description": "파일 수정 (편집, 쓰기, 패치 및 다중 편집 포함)", + "settings.permissions.tool.glob.title": "Glob", + "settings.permissions.tool.glob.description": "glob 패턴을 사용하여 파일 일치", + "settings.permissions.tool.grep.title": "Grep", + "settings.permissions.tool.grep.description": "정규식을 사용하여 파일 내용 검색", + "settings.permissions.tool.list.title": "목록", + "settings.permissions.tool.list.description": "디렉터리 내 파일 나열", + "settings.permissions.tool.bash.title": "Bash", + "settings.permissions.tool.bash.description": "셸 명령어 실행", + "settings.permissions.tool.task.title": "작업", + "settings.permissions.tool.task.description": "하위 에이전트 실행", + "settings.permissions.tool.skill.title": "기술", + "settings.permissions.tool.skill.description": "이름으로 기술 로드", + "settings.permissions.tool.lsp.title": "LSP", + "settings.permissions.tool.lsp.description": "언어 서버 쿼리 실행", + "settings.permissions.tool.todoread.title": "할 일 읽기", + "settings.permissions.tool.todoread.description": "할 일 목록 읽기", + "settings.permissions.tool.todowrite.title": "할 일 쓰기", + "settings.permissions.tool.todowrite.description": "할 일 목록 업데이트", + "settings.permissions.tool.webfetch.title": "웹 가져오기", + "settings.permissions.tool.webfetch.description": "URL에서 콘텐츠 가져오기", + "settings.permissions.tool.websearch.title": "웹 검색", + "settings.permissions.tool.websearch.description": "웹 검색", + "settings.permissions.tool.codesearch.title": "코드 검색", + "settings.permissions.tool.codesearch.description": "웹에서 코드 검색", + "settings.permissions.tool.external_directory.title": "외부 디렉터리", + "settings.permissions.tool.external_directory.description": "프로젝트 디렉터리 외부의 파일에 액세스", + "settings.permissions.tool.doom_loop.title": "무한 반복", + "settings.permissions.tool.doom_loop.description": "동일한 입력으로 반복되는 도구 호출 감지", + + "session.delete.failed.title": "세션 삭제 실패", + "session.delete.title": "세션 삭제", + "session.delete.confirm": '"{{name}}" 세션을 삭제하시겠습니까?', + "session.delete.button": "세션 삭제", + + "workspace.new": "새 작업 공간", + "workspace.type.local": "로컬", + "workspace.type.sandbox": "샌드박스", + "workspace.create.failed.title": "작업 공간 생성 실패", + "workspace.delete.failed.title": "작업 공간 삭제 실패", + "workspace.resetting.title": "작업 공간 재설정 중", + "workspace.resetting.description": "잠시 시간이 걸릴 수 있습니다.", + "workspace.reset.failed.title": "작업 공간 재설정 실패", + "workspace.reset.success.title": "작업 공간 재설정됨", + "workspace.reset.success.description": "작업 공간이 이제 기본 브랜치와 일치합니다.", + "workspace.status.checking": "병합되지 않은 변경 사항 확인 중...", + "workspace.status.error": "Git 상태를 확인할 수 없습니다.", + "workspace.status.clean": "병합되지 않은 변경 사항이 감지되지 않았습니다.", + "workspace.status.dirty": "이 작업 공간에서 병합되지 않은 변경 사항이 감지되었습니다.", + "workspace.delete.title": "작업 공간 삭제", + "workspace.delete.confirm": '"{{name}}" 작업 공간을 삭제하시겠습니까?', + "workspace.delete.button": "작업 공간 삭제", + "workspace.reset.title": "작업 공간 재설정", + "workspace.reset.confirm": '"{{name}}" 작업 공간을 재설정하시겠습니까?', + "workspace.reset.button": "작업 공간 재설정", + "workspace.reset.archived.none": "활성 세션이 보관되지 않습니다.", + "workspace.reset.archived.one": "1개의 세션이 보관됩니다.", + "workspace.reset.archived.many": "{{count}}개의 세션이 보관됩니다.", + "workspace.reset.note": "이 작업은 작업 공간을 기본 브랜치와 일치하도록 재설정합니다.", +} diff --git a/packages/app/src/i18n/no.ts b/packages/app/src/i18n/no.ts new file mode 100644 index 00000000000..5a82ec1e04b --- /dev/null +++ b/packages/app/src/i18n/no.ts @@ -0,0 +1,600 @@ +import { dict as en } from "./en" +type Keys = keyof typeof en + +export const dict = { + "command.category.suggested": "Foreslått", + "command.category.view": "Visning", + "command.category.project": "Prosjekt", + "command.category.provider": "Leverandør", + "command.category.server": "Server", + "command.category.session": "Sesjon", + "command.category.theme": "Tema", + "command.category.language": "Språk", + "command.category.file": "Fil", + "command.category.terminal": "Terminal", + "command.category.model": "Modell", + "command.category.mcp": "MCP", + "command.category.agent": "Agent", + "command.category.permissions": "Tillatelser", + "command.category.workspace": "Arbeidsområde", + "command.category.settings": "Innstillinger", + + "theme.scheme.system": "System", + "theme.scheme.light": "Lys", + "theme.scheme.dark": "Mørk", + + "command.sidebar.toggle": "Veksle sidepanel", + "command.project.open": "Åpne prosjekt", + "command.provider.connect": "Koble til leverandør", + "command.server.switch": "Bytt server", + "command.settings.open": "Åpne innstillinger", + "command.session.previous": "Forrige sesjon", + "command.session.next": "Neste sesjon", + "command.session.archive": "Arkiver sesjon", + + "command.palette": "Kommandopalett", + + "command.theme.cycle": "Bytt tema", + "command.theme.set": "Bruk tema: {{theme}}", + "command.theme.scheme.cycle": "Bytt fargevalg", + "command.theme.scheme.set": "Bruk fargevalg: {{scheme}}", + + "command.language.cycle": "Bytt språk", + "command.language.set": "Bruk språk: {{language}}", + + "command.session.new": "Ny sesjon", + "command.file.open": "Åpne fil", + "command.file.open.description": "Søk i filer og kommandoer", + "command.terminal.toggle": "Veksle terminal", + "command.review.toggle": "Veksle gjennomgang", + "command.terminal.new": "Ny terminal", + "command.terminal.new.description": "Opprett en ny terminalfane", + "command.steps.toggle": "Veksle trinn", + "command.steps.toggle.description": "Vis eller skjul trinn for gjeldende melding", + "command.message.previous": "Forrige melding", + "command.message.previous.description": "Gå til forrige brukermelding", + "command.message.next": "Neste melding", + "command.message.next.description": "Gå til neste brukermelding", + "command.model.choose": "Velg modell", + "command.model.choose.description": "Velg en annen modell", + "command.mcp.toggle": "Veksle MCP-er", + "command.mcp.toggle.description": "Veksle MCP-er", + "command.agent.cycle": "Bytt agent", + "command.agent.cycle.description": "Bytt til neste agent", + "command.agent.cycle.reverse": "Bytt agent bakover", + "command.agent.cycle.reverse.description": "Bytt til forrige agent", + "command.model.variant.cycle": "Bytt tenkeinnsats", + "command.model.variant.cycle.description": "Bytt til neste innsatsnivå", + "command.permissions.autoaccept.enable": "Godta endringer automatisk", + "command.permissions.autoaccept.disable": "Slutt å godta endringer automatisk", + "command.session.undo": "Angre", + "command.session.undo.description": "Angre siste melding", + "command.session.redo": "Gjør om", + "command.session.redo.description": "Gjør om siste angrede melding", + "command.session.compact": "Komprimer sesjon", + "command.session.compact.description": "Oppsummer sesjonen for å redusere kontekststørrelsen", + "command.session.fork": "Forgren fra melding", + "command.session.fork.description": "Opprett en ny sesjon fra en tidligere melding", + "command.session.share": "Del sesjon", + "command.session.share.description": "Del denne sesjonen og kopier URL-en til utklippstavlen", + "command.session.unshare": "Slutt å dele sesjon", + "command.session.unshare.description": "Slutt å dele denne sesjonen", + + "palette.search.placeholder": "Søk i filer og kommandoer", + "palette.empty": "Ingen resultater funnet", + "palette.group.commands": "Kommandoer", + "palette.group.files": "Filer", + + "dialog.provider.search.placeholder": "Søk etter leverandører", + "dialog.provider.empty": "Ingen leverandører funnet", + "dialog.provider.group.popular": "Populære", + "dialog.provider.group.other": "Andre", + "dialog.provider.tag.recommended": "Anbefalt", + "dialog.provider.anthropic.note": "Koble til med Claude Pro/Max eller API-nøkkel", + + "dialog.model.select.title": "Velg modell", + "dialog.model.search.placeholder": "Søk etter modeller", + "dialog.model.empty": "Ingen modellresultater", + "dialog.model.manage": "Administrer modeller", + "dialog.model.manage.description": "Tilpass hvilke modeller som vises i modellvelgeren.", + + "dialog.model.unpaid.freeModels.title": "Gratis modeller levert av OpenCode", + "dialog.model.unpaid.addMore.title": "Legg til flere modeller fra populære leverandører", + + "dialog.provider.viewAll": "Vis alle leverandører", + + "provider.connect.title": "Koble til {{provider}}", + "provider.connect.title.anthropicProMax": "Logg inn med Claude Pro/Max", + "provider.connect.selectMethod": "Velg innloggingsmetode for {{provider}}.", + "provider.connect.method.apiKey": "API-nøkkel", + "provider.connect.status.inProgress": "Autorisering pågår...", + "provider.connect.status.waiting": "Venter på autorisering...", + "provider.connect.status.failed": "Autorisering mislyktes: {{error}}", + "provider.connect.apiKey.description": + "Skriv inn din {{provider}} API-nøkkel for å koble til kontoen din og bruke {{provider}}-modeller i OpenCode.", + "provider.connect.apiKey.label": "{{provider}} API-nøkkel", + "provider.connect.apiKey.placeholder": "API-nøkkel", + "provider.connect.apiKey.required": "API-nøkkel er påkrevd", + "provider.connect.opencodeZen.line1": + "OpenCode Zen gir deg tilgang til et utvalg av pålitelige optimaliserte modeller for kodeagenter.", + "provider.connect.opencodeZen.line2": + "Med én enkelt API-nøkkel får du tilgang til modeller som Claude, GPT, Gemini, GLM og flere.", + "provider.connect.opencodeZen.visit.prefix": "Besøk ", + "provider.connect.opencodeZen.visit.link": "opencode.ai/zen", + "provider.connect.opencodeZen.visit.suffix": " for å hente API-nøkkelen din.", + "provider.connect.oauth.code.visit.prefix": "Besøk ", + "provider.connect.oauth.code.visit.link": "denne lenken", + "provider.connect.oauth.code.visit.suffix": + " for å hente autorisasjonskoden din for å koble til kontoen din og bruke {{provider}}-modeller i OpenCode.", + "provider.connect.oauth.code.label": "{{method}} autorisasjonskode", + "provider.connect.oauth.code.placeholder": "Autorisasjonskode", + "provider.connect.oauth.code.required": "Autorisasjonskode er påkrevd", + "provider.connect.oauth.code.invalid": "Ugyldig autorisasjonskode", + "provider.connect.oauth.auto.visit.prefix": "Besøk ", + "provider.connect.oauth.auto.visit.link": "denne lenken", + "provider.connect.oauth.auto.visit.suffix": + " og skriv inn koden nedenfor for å koble til kontoen din og bruke {{provider}}-modeller i OpenCode.", + "provider.connect.oauth.auto.confirmationCode": "Bekreftelseskode", + "provider.connect.toast.connected.title": "{{provider}} tilkoblet", + "provider.connect.toast.connected.description": "{{provider}}-modeller er nå tilgjengelige.", + + "model.tag.free": "Gratis", + "model.tag.latest": "Nyeste", + "model.provider.anthropic": "Anthropic", + "model.provider.openai": "OpenAI", + "model.provider.google": "Google", + "model.provider.xai": "xAI", + "model.provider.meta": "Meta", + "model.input.text": "tekst", + "model.input.image": "bilde", + "model.input.audio": "lyd", + "model.input.video": "video", + "model.input.pdf": "pdf", + "model.tooltip.allows": "Tillater: {{inputs}}", + "model.tooltip.reasoning.allowed": "Tillater resonnering", + "model.tooltip.reasoning.none": "Ingen resonnering", + "model.tooltip.context": "Kontekstgrense {{limit}}", + + "common.search.placeholder": "Søk", + "common.goBack": "Gå tilbake", + "common.loading": "Laster", + "common.loading.ellipsis": "...", + "common.cancel": "Avbryt", + "common.submit": "Send inn", + "common.save": "Lagre", + "common.saving": "Lagrer...", + "common.default": "Standard", + "common.attachment": "vedlegg", + + "prompt.placeholder.shell": "Skriv inn shell-kommando...", + "prompt.placeholder.normal": 'Spør om hva som helst... "{{example}}"', + "prompt.mode.shell": "Shell", + "prompt.mode.shell.exit": "ESC for å avslutte", + + "prompt.example.1": "Fiks en TODO i kodebasen", + "prompt.example.2": "Hva er teknologistabelen i dette prosjektet?", + "prompt.example.3": "Fiks ødelagte tester", + "prompt.example.4": "Forklar hvordan autentisering fungerer", + "prompt.example.5": "Finn og fiks sikkerhetssårbarheter", + "prompt.example.6": "Legg til enhetstester for brukerservicen", + "prompt.example.7": "Refaktorer denne funksjonen for bedre lesbarhet", + "prompt.example.8": "Hva betyr denne feilen?", + "prompt.example.9": "Hjelp meg med å feilsøke dette problemet", + "prompt.example.10": "Generer API-dokumentasjon", + "prompt.example.11": "Optimaliser databasespørringer", + "prompt.example.12": "Legg til inputvalidering", + "prompt.example.13": "Lag en ny komponent for...", + "prompt.example.14": "Hvordan deployer jeg dette prosjektet?", + "prompt.example.15": "Gjennomgå koden min for beste praksis", + "prompt.example.16": "Legg til feilhåndtering i denne funksjonen", + "prompt.example.17": "Forklar dette regex-mønsteret", + "prompt.example.18": "Konverter dette til TypeScript", + "prompt.example.19": "Legg til logging i hele kodebasen", + "prompt.example.20": "Hvilke avhengigheter er utdaterte?", + "prompt.example.21": "Hjelp meg med å skrive et migreringsskript", + "prompt.example.22": "Implementer caching for dette endepunktet", + "prompt.example.23": "Legg til paginering i denne listen", + "prompt.example.24": "Lag en CLI-kommando for...", + "prompt.example.25": "Hvordan fungerer miljøvariabler her?", + + "prompt.popover.emptyResults": "Ingen matchende resultater", + "prompt.popover.emptyCommands": "Ingen matchende kommandoer", + "prompt.dropzone.label": "Slipp bilder eller PDF-er her", + "prompt.slash.badge.custom": "egendefinert", + "prompt.context.active": "aktiv", + "prompt.context.includeActiveFile": "Inkluder aktiv fil", + "prompt.context.removeActiveFile": "Fjern aktiv fil fra kontekst", + "prompt.context.removeFile": "Fjern fil fra kontekst", + "prompt.action.attachFile": "Legg ved fil", + "prompt.attachment.remove": "Fjern vedlegg", + "prompt.action.send": "Send", + "prompt.action.stop": "Stopp", + + "prompt.toast.pasteUnsupported.title": "Liming ikke støttet", + "prompt.toast.pasteUnsupported.description": "Kun bilder eller PDF-er kan limes inn her.", + "prompt.toast.modelAgentRequired.title": "Velg en agent og modell", + "prompt.toast.modelAgentRequired.description": "Velg en agent og modell før du sender en forespørsel.", + "prompt.toast.worktreeCreateFailed.title": "Kunne ikke opprette worktree", + "prompt.toast.sessionCreateFailed.title": "Kunne ikke opprette sesjon", + "prompt.toast.shellSendFailed.title": "Kunne ikke sende shell-kommando", + "prompt.toast.commandSendFailed.title": "Kunne ikke sende kommando", + "prompt.toast.promptSendFailed.title": "Kunne ikke sende forespørsel", + + "dialog.mcp.title": "MCP-er", + "dialog.mcp.description": "{{enabled}} av {{total}} aktivert", + "dialog.mcp.empty": "Ingen MCP-er konfigurert", + + "mcp.status.connected": "tilkoblet", + "mcp.status.failed": "mislyktes", + "mcp.status.needs_auth": "trenger autentisering", + "mcp.status.disabled": "deaktivert", + + "dialog.fork.empty": "Ingen meldinger å forgrene fra", + + "dialog.directory.search.placeholder": "Søk etter mapper", + "dialog.directory.empty": "Ingen mapper funnet", + + "dialog.server.title": "Servere", + "dialog.server.description": "Bytt hvilken OpenCode-server denne appen kobler til.", + "dialog.server.search.placeholder": "Søk etter servere", + "dialog.server.empty": "Ingen servere ennå", + "dialog.server.add.title": "Legg til en server", + "dialog.server.add.url": "Server-URL", + "dialog.server.add.placeholder": "http://localhost:4096", + "dialog.server.add.error": "Kunne ikke koble til server", + "dialog.server.add.checking": "Sjekker...", + "dialog.server.add.button": "Legg til", + "dialog.server.default.title": "Standardserver", + "dialog.server.default.description": + "Koble til denne serveren ved oppstart i stedet for å starte en lokal server. Krever omstart.", + "dialog.server.default.none": "Ingen server valgt", + "dialog.server.default.set": "Sett gjeldende server som standard", + "dialog.server.default.clear": "Tøm", + "dialog.server.action.remove": "Fjern server", + + "dialog.project.edit.title": "Rediger prosjekt", + "dialog.project.edit.name": "Navn", + "dialog.project.edit.icon": "Ikon", + "dialog.project.edit.icon.alt": "Prosjektikon", + "dialog.project.edit.icon.hint": "Klikk eller dra et bilde", + "dialog.project.edit.icon.recommended": "Anbefalt: 128x128px", + "dialog.project.edit.color": "Farge", + "dialog.project.edit.color.select": "Velg fargen {{color}}", + + "context.breakdown.title": "Kontekstfordeling", + "context.breakdown.note": 'Omtrentlig fordeling av input-tokens. "Annet" inkluderer verktøydefinisjoner og overhead.', + "context.breakdown.system": "System", + "context.breakdown.user": "Bruker", + "context.breakdown.assistant": "Assistent", + "context.breakdown.tool": "Verktøykall", + "context.breakdown.other": "Annet", + + "context.systemPrompt.title": "Systemprompt", + "context.rawMessages.title": "Rå meldinger", + + "context.stats.session": "Sesjon", + "context.stats.messages": "Meldinger", + "context.stats.provider": "Leverandør", + "context.stats.model": "Modell", + "context.stats.limit": "Kontekstgrense", + "context.stats.totalTokens": "Totalt antall tokens", + "context.stats.usage": "Forbruk", + "context.stats.inputTokens": "Input-tokens", + "context.stats.outputTokens": "Output-tokens", + "context.stats.reasoningTokens": "Resonnerings-tokens", + "context.stats.cacheTokens": "Cache-tokens (les/skriv)", + "context.stats.userMessages": "Brukermeldinger", + "context.stats.assistantMessages": "Assistentmeldinger", + "context.stats.totalCost": "Total kostnad", + "context.stats.sessionCreated": "Sesjon opprettet", + "context.stats.lastActivity": "Siste aktivitet", + + "context.usage.tokens": "Tokens", + "context.usage.usage": "Forbruk", + "context.usage.cost": "Kostnad", + "context.usage.clickToView": "Klikk for å se kontekst", + "context.usage.view": "Se kontekstforbruk", + + "language.en": "Engelsk", + "language.zh": "Kinesisk (forenklet)", + "language.zht": "Kinesisk (tradisjonell)", + "language.ko": "Koreansk", + "language.de": "Tysk", + "language.es": "Spansk", + "language.fr": "Fransk", + "language.ja": "Japansk", + "language.da": "Dansk", + "language.ru": "Russisk", + "language.pl": "Polsk", + "language.ar": "Arabisk", + "language.no": "Norsk", + "language.br": "Portugisisk (Brasil)", + + "toast.language.title": "Språk", + "toast.language.description": "Byttet til {{language}}", + + "toast.theme.title": "Tema byttet", + "toast.scheme.title": "Fargevalg", + + "toast.permissions.autoaccept.on.title": "Godtar endringer automatisk", + "toast.permissions.autoaccept.on.description": "Redigerings- og skrivetillatelser vil bli godkjent automatisk", + "toast.permissions.autoaccept.off.title": "Sluttet å godta endringer automatisk", + "toast.permissions.autoaccept.off.description": "Redigerings- og skrivetillatelser vil kreve godkjenning", + + "toast.model.none.title": "Ingen modell valgt", + "toast.model.none.description": "Koble til en leverandør for å oppsummere denne sesjonen", + + "toast.file.loadFailed.title": "Kunne ikke laste fil", + + "toast.session.share.copyFailed.title": "Kunne ikke kopiere URL til utklippstavlen", + "toast.session.share.success.title": "Sesjon delt", + "toast.session.share.success.description": "Delings-URL kopiert til utklippstavlen!", + "toast.session.share.failed.title": "Kunne ikke dele sesjon", + "toast.session.share.failed.description": "Det oppstod en feil under deling av sesjonen", + + "toast.session.unshare.success.title": "Deling av sesjon stoppet", + "toast.session.unshare.success.description": "Sesjonen deles ikke lenger!", + "toast.session.unshare.failed.title": "Kunne ikke stoppe deling av sesjon", + "toast.session.unshare.failed.description": "Det oppstod en feil da delingen av sesjonen skulle stoppes", + + "toast.session.listFailed.title": "Kunne ikke laste sesjoner for {{project}}", + + "toast.update.title": "Oppdatering tilgjengelig", + "toast.update.description": "En ny versjon av OpenCode ({{version}}) er nå tilgjengelig for installasjon.", + "toast.update.action.installRestart": "Installer og start på nytt", + "toast.update.action.notYet": "Ikke nå", + + "error.page.title": "Noe gikk galt", + "error.page.description": "Det oppstod en feil under lasting av applikasjonen.", + "error.page.details.label": "Feildetaljer", + "error.page.action.restart": "Start på nytt", + "error.page.action.checking": "Sjekker...", + "error.page.action.checkUpdates": "Se etter oppdateringer", + "error.page.action.updateTo": "Oppdater til {{version}}", + "error.page.report.prefix": "Vennligst rapporter denne feilen til OpenCode-teamet", + "error.page.report.discord": "på Discord", + "error.page.version": "Versjon: {{version}}", + + "error.dev.rootNotFound": + "Rotelement ikke funnet. Glemte du å legge det til i index.html? Eller kanskje id-attributten er feilstavet?", + + "error.globalSync.connectFailed": "Kunne ikke koble til server. Kjører det en server på `{{url}}`?", + + "error.chain.unknown": "Ukjent feil", + "error.chain.causedBy": "Forårsaket av:", + "error.chain.apiError": "API-feil", + "error.chain.status": "Status: {{status}}", + "error.chain.retryable": "Kan prøves på nytt: {{retryable}}", + "error.chain.responseBody": "Responsinnhold:\n{{body}}", + "error.chain.didYouMean": "Mente du: {{suggestions}}", + "error.chain.modelNotFound": "Modell ikke funnet: {{provider}}/{{model}}", + "error.chain.checkConfig": "Sjekk leverandør-/modellnavnene i konfigurasjonen din (opencode.json)", + "error.chain.mcpFailed": 'MCP-server "{{name}}" mislyktes. Merk at OpenCode ikke støtter MCP-autentisering ennå.', + "error.chain.providerAuthFailed": "Leverandørautentisering mislyktes ({{provider}}): {{message}}", + "error.chain.providerInitFailed": + 'Kunne ikke initialisere leverandør "{{provider}}". Sjekk legitimasjon og konfigurasjon.', + "error.chain.configJsonInvalid": "Konfigurasjonsfilen på {{path}} er ikke gyldig JSON(C)", + "error.chain.configJsonInvalidWithMessage": "Konfigurasjonsfilen på {{path}} er ikke gyldig JSON(C): {{message}}", + "error.chain.configDirectoryTypo": + 'Mappen "{{dir}}" i {{path}} er ikke gyldig. Gi mappen nytt navn til "{{suggestion}}" eller fjern den. Dette er en vanlig skrivefeil.', + "error.chain.configFrontmatterError": "Kunne ikke analysere frontmatter i {{path}}:\n{{message}}", + "error.chain.configInvalid": "Konfigurasjonsfilen på {{path}} er ugyldig", + "error.chain.configInvalidWithMessage": "Konfigurasjonsfilen på {{path}} er ugyldig: {{message}}", + + "notification.permission.title": "Tillatelse påkrevd", + "notification.permission.description": "{{sessionTitle}} i {{projectName}} trenger tillatelse", + "notification.question.title": "Spørsmål", + "notification.question.description": "{{sessionTitle}} i {{projectName}} har et spørsmål", + "notification.action.goToSession": "Gå til sesjon", + + "notification.session.responseReady.title": "Svar klart", + "notification.session.error.title": "Sesjonsfeil", + "notification.session.error.fallbackDescription": "Det oppstod en feil", + + "home.recentProjects": "Nylige prosjekter", + "home.empty.title": "Ingen nylige prosjekter", + "home.empty.description": "Kom i gang ved å åpne et lokalt prosjekt", + + "session.tab.session": "Sesjon", + "session.tab.review": "Gjennomgang", + "session.tab.context": "Kontekst", + "session.panel.reviewAndFiles": "Gjennomgang og filer", + "session.review.filesChanged": "{{count}} filer endret", + "session.review.loadingChanges": "Laster endringer...", + "session.review.empty": "Ingen endringer i denne sesjonen ennå", + "session.messages.renderEarlier": "Vis tidligere meldinger", + "session.messages.loadingEarlier": "Laster inn tidligere meldinger...", + "session.messages.loadEarlier": "Last inn tidligere meldinger", + "session.messages.loading": "Laster meldinger...", + "session.messages.jumpToLatest": "Hopp til nyeste", + + "session.context.addToContext": "Legg til {{selection}} i kontekst", + + "session.new.worktree.main": "Hovedgren", + "session.new.worktree.mainWithBranch": "Hovedgren ({{branch}})", + "session.new.worktree.create": "Opprett nytt worktree", + "session.new.lastModified": "Sist endret", + + "session.header.search.placeholder": "Søk i {{project}}", + "session.header.searchFiles": "Søk etter filer", + + "session.share.popover.title": "Publiser på nett", + "session.share.popover.description.shared": + "Denne sesjonen er offentlig på nettet. Den er tilgjengelig for alle med lenken.", + "session.share.popover.description.unshared": + "Del sesjonen offentlig på nettet. Den vil være tilgjengelig for alle med lenken.", + "session.share.action.share": "Del", + "session.share.action.publish": "Publiser", + "session.share.action.publishing": "Publiserer...", + "session.share.action.unpublish": "Avpubliser", + "session.share.action.unpublishing": "Avpubliserer...", + "session.share.action.view": "Vis", + "session.share.copy.copied": "Kopiert", + "session.share.copy.copyLink": "Kopier lenke", + + "lsp.tooltip.none": "Ingen LSP-servere", + "lsp.label.connected": "{{count}} LSP", + + "prompt.loading": "Laster prompt...", + "terminal.loading": "Laster terminal...", + "terminal.title": "Terminal", + "terminal.title.numbered": "Terminal {{number}}", + "terminal.close": "Lukk terminal", + "terminal.connectionLost.title": "Tilkobling mistet", + "terminal.connectionLost.description": + "Terminalforbindelsen ble avbrutt. Dette kan skje når serveren starter på nytt.", + + "common.closeTab": "Lukk fane", + "common.dismiss": "Avvis", + "common.requestFailed": "Forespørsel mislyktes", + "common.moreOptions": "Flere alternativer", + "common.learnMore": "Lær mer", + "common.rename": "Gi nytt navn", + "common.reset": "Tilbakestill", + "common.delete": "Slett", + "common.close": "Lukk", + "common.edit": "Rediger", + "common.loadMore": "Last flere", + "common.key.esc": "ESC", + + "sidebar.menu.toggle": "Veksle meny", + "sidebar.nav.projectsAndSessions": "Prosjekter og sesjoner", + "sidebar.settings": "Innstillinger", + "sidebar.help": "Hjelp", + "sidebar.workspaces.enable": "Aktiver arbeidsområder", + "sidebar.workspaces.disable": "Deaktiver arbeidsområder", + "sidebar.gettingStarted.title": "Kom i gang", + "sidebar.gettingStarted.line1": "OpenCode inkluderer gratis modeller så du kan starte umiddelbart.", + "sidebar.gettingStarted.line2": "Koble til en leverandør for å bruke modeller, inkl. Claude, GPT, Gemini osv.", + "sidebar.project.recentSessions": "Nylige sesjoner", + "sidebar.project.viewAllSessions": "Vis alle sesjoner", + + "settings.section.desktop": "Skrivebord", + "settings.tab.general": "Generelt", + "settings.tab.shortcuts": "Snarveier", + + "settings.general.section.appearance": "Utseende", + "settings.general.section.notifications": "Systemvarsler", + "settings.general.section.sounds": "Lydeffekter", + + "settings.general.row.language.title": "Språk", + "settings.general.row.language.description": "Endre visningsspråket for OpenCode", + "settings.general.row.appearance.title": "Utseende", + "settings.general.row.appearance.description": "Tilpass hvordan OpenCode ser ut på enheten din", + "settings.general.row.theme.title": "Tema", + "settings.general.row.theme.description": "Tilpass hvordan OpenCode er tematisert.", + "settings.general.row.font.title": "Skrift", + "settings.general.row.font.description": "Tilpass mono-skriften som brukes i kodeblokker", + + "settings.general.notifications.agent.title": "Agent", + "settings.general.notifications.agent.description": + "Vis systemvarsel når agenten er ferdig eller trenger oppmerksomhet", + "settings.general.notifications.permissions.title": "Tillatelser", + "settings.general.notifications.permissions.description": "Vis systemvarsel når en tillatelse er påkrevd", + "settings.general.notifications.errors.title": "Feil", + "settings.general.notifications.errors.description": "Vis systemvarsel når det oppstår en feil", + + "settings.general.sounds.agent.title": "Agent", + "settings.general.sounds.agent.description": "Spill av lyd når agenten er ferdig eller trenger oppmerksomhet", + "settings.general.sounds.permissions.title": "Tillatelser", + "settings.general.sounds.permissions.description": "Spill av lyd når en tillatelse er påkrevd", + "settings.general.sounds.errors.title": "Feil", + "settings.general.sounds.errors.description": "Spill av lyd når det oppstår en feil", + + "settings.shortcuts.title": "Tastatursnarveier", + "settings.shortcuts.reset.button": "Tilbakestill til standard", + "settings.shortcuts.reset.toast.title": "Snarveier tilbakestilt", + "settings.shortcuts.reset.toast.description": "Tastatursnarveier er tilbakestilt til standard.", + "settings.shortcuts.conflict.title": "Snarvei allerede i bruk", + "settings.shortcuts.conflict.description": "{{keybind}} er allerede tilordnet til {{titles}}.", + "settings.shortcuts.unassigned": "Ikke tilordnet", + "settings.shortcuts.pressKeys": "Trykk taster", + "settings.shortcuts.search.placeholder": "Søk etter snarveier", + "settings.shortcuts.search.empty": "Ingen snarveier funnet", + + "settings.shortcuts.group.general": "Generelt", + "settings.shortcuts.group.session": "Sesjon", + "settings.shortcuts.group.navigation": "Navigasjon", + "settings.shortcuts.group.modelAndAgent": "Modell og agent", + "settings.shortcuts.group.terminal": "Terminal", + "settings.shortcuts.group.prompt": "Prompt", + + "settings.providers.title": "Leverandører", + "settings.providers.description": "Leverandørinnstillinger vil kunne konfigureres her.", + "settings.models.title": "Modeller", + "settings.models.description": "Modellinnstillinger vil kunne konfigureres her.", + "settings.agents.title": "Agenter", + "settings.agents.description": "Agentinnstillinger vil kunne konfigureres her.", + "settings.commands.title": "Kommandoer", + "settings.commands.description": "Kommandoinnstillinger vil kunne konfigureres her.", + "settings.mcp.title": "MCP", + "settings.mcp.description": "MCP-innstillinger vil kunne konfigureres her.", + + "settings.permissions.title": "Tillatelser", + "settings.permissions.description": "Kontroller hvilke verktøy serveren kan bruke som standard.", + "settings.permissions.section.tools": "Verktøy", + "settings.permissions.toast.updateFailed.title": "Kunne ikke oppdatere tillatelser", + + "settings.permissions.action.allow": "Tillat", + "settings.permissions.action.ask": "Spør", + "settings.permissions.action.deny": "Avslå", + + "settings.permissions.tool.read.title": "Les", + "settings.permissions.tool.read.description": "Lesing av en fil (matcher filbanen)", + "settings.permissions.tool.edit.title": "Rediger", + "settings.permissions.tool.edit.description": + "Endre filer, inkludert redigeringer, skriving, patcher og multi-redigeringer", + "settings.permissions.tool.glob.title": "Glob", + "settings.permissions.tool.glob.description": "Match filer ved hjelp av glob-mønstre", + "settings.permissions.tool.grep.title": "Grep", + "settings.permissions.tool.grep.description": "Søk i filinnhold ved hjelp av regulære uttrykk", + "settings.permissions.tool.list.title": "Liste", + "settings.permissions.tool.list.description": "List filer i en mappe", + "settings.permissions.tool.bash.title": "Bash", + "settings.permissions.tool.bash.description": "Kjør shell-kommandoer", + "settings.permissions.tool.task.title": "Oppgave", + "settings.permissions.tool.task.description": "Start underagenter", + "settings.permissions.tool.skill.title": "Ferdighet", + "settings.permissions.tool.skill.description": "Last en ferdighet etter navn", + "settings.permissions.tool.lsp.title": "LSP", + "settings.permissions.tool.lsp.description": "Kjør språkserverforespørsler", + "settings.permissions.tool.todoread.title": "Les gjøremål", + "settings.permissions.tool.todoread.description": "Les gjøremålslisten", + "settings.permissions.tool.todowrite.title": "Skriv gjøremål", + "settings.permissions.tool.todowrite.description": "Oppdater gjøremålslisten", + "settings.permissions.tool.webfetch.title": "Webhenting", + "settings.permissions.tool.webfetch.description": "Hent innhold fra en URL", + "settings.permissions.tool.websearch.title": "Websøk", + "settings.permissions.tool.websearch.description": "Søk på nettet", + "settings.permissions.tool.codesearch.title": "Kodesøk", + "settings.permissions.tool.codesearch.description": "Søk etter kode på nettet", + "settings.permissions.tool.external_directory.title": "Ekstern mappe", + "settings.permissions.tool.external_directory.description": "Få tilgang til filer utenfor prosjektmappen", + "settings.permissions.tool.doom_loop.title": "Doom Loop", + "settings.permissions.tool.doom_loop.description": "Oppdager gjentatte verktøykall med identisk input", + + "workspace.new": "Nytt arbeidsområde", + "workspace.type.local": "lokal", + "workspace.type.sandbox": "sandkasse", + "workspace.create.failed.title": "Kunne ikke opprette arbeidsområde", + "workspace.delete.failed.title": "Kunne ikke slette arbeidsområde", + "workspace.resetting.title": "Tilbakestiller arbeidsområde", + "workspace.resetting.description": "Dette kan ta et minutt.", + "workspace.reset.failed.title": "Kunne ikke tilbakestille arbeidsområde", + "workspace.reset.success.title": "Arbeidsområde tilbakestilt", + "workspace.reset.success.description": "Arbeidsområdet samsvarer nå med standardgrenen.", + "workspace.status.checking": "Sjekker for ikke-sammenslåtte endringer...", + "workspace.status.error": "Kunne ikke bekrefte git-status.", + "workspace.status.clean": "Ingen ikke-sammenslåtte endringer oppdaget.", + "workspace.status.dirty": "Ikke-sammenslåtte endringer oppdaget i dette arbeidsområdet.", + "workspace.delete.title": "Slett arbeidsområde", + "workspace.delete.confirm": 'Slette arbeidsområdet "{{name}}"?', + "workspace.delete.button": "Slett arbeidsområde", + "workspace.reset.title": "Tilbakestill arbeidsområde", + "workspace.reset.confirm": 'Tilbakestille arbeidsområdet "{{name}}"?', + "workspace.reset.button": "Tilbakestill arbeidsområde", + "workspace.reset.archived.none": "Ingen aktive sesjoner vil bli arkivert.", + "workspace.reset.archived.one": "1 sesjon vil bli arkivert.", + "workspace.reset.archived.many": "{{count}} sesjoner vil bli arkivert.", + "workspace.reset.note": "Dette vil tilbakestille arbeidsområdet til å samsvare med standardgrenen.", +} satisfies Partial> diff --git a/packages/app/src/i18n/pl.ts b/packages/app/src/i18n/pl.ts new file mode 100644 index 00000000000..9d95424dd60 --- /dev/null +++ b/packages/app/src/i18n/pl.ts @@ -0,0 +1,659 @@ +export const dict = { + "command.category.suggested": "Sugerowane", + "command.category.view": "Widok", + "command.category.project": "Projekt", + "command.category.provider": "Dostawca", + "command.category.server": "Serwer", + "command.category.session": "Sesja", + "command.category.theme": "Motyw", + "command.category.language": "Język", + "command.category.file": "Plik", + "command.category.terminal": "Terminal", + "command.category.model": "Model", + "command.category.mcp": "MCP", + "command.category.agent": "Agent", + "command.category.permissions": "Uprawnienia", + "command.category.workspace": "Przestrzeń robocza", + "command.category.settings": "Ustawienia", + + "theme.scheme.system": "Systemowy", + "theme.scheme.light": "Jasny", + "theme.scheme.dark": "Ciemny", + + "command.sidebar.toggle": "Przełącz pasek boczny", + "command.project.open": "Otwórz projekt", + "command.provider.connect": "Połącz dostawcę", + "command.server.switch": "Przełącz serwer", + "command.settings.open": "Otwórz ustawienia", + "command.session.previous": "Poprzednia sesja", + "command.session.next": "Następna sesja", + "command.session.archive": "Zarchiwizuj sesję", + + "command.palette": "Paleta poleceń", + + "command.theme.cycle": "Przełącz motyw", + "command.theme.set": "Użyj motywu: {{theme}}", + "command.theme.scheme.cycle": "Przełącz schemat kolorów", + "command.theme.scheme.set": "Użyj schematu kolorów: {{scheme}}", + + "command.language.cycle": "Przełącz język", + "command.language.set": "Użyj języka: {{language}}", + + "command.session.new": "Nowa sesja", + "command.file.open": "Otwórz plik", + "command.file.open.description": "Szukaj plików i poleceń", + "command.terminal.toggle": "Przełącz terminal", + "command.review.toggle": "Przełącz przegląd", + "command.terminal.new": "Nowy terminal", + "command.terminal.new.description": "Utwórz nową kartę terminala", + "command.steps.toggle": "Przełącz kroki", + "command.steps.toggle.description": "Pokaż lub ukryj kroki dla bieżącej wiadomości", + "command.message.previous": "Poprzednia wiadomość", + "command.message.previous.description": "Przejdź do poprzedniej wiadomości użytkownika", + "command.message.next": "Następna wiadomość", + "command.message.next.description": "Przejdź do następnej wiadomości użytkownika", + "command.model.choose": "Wybierz model", + "command.model.choose.description": "Wybierz inny model", + "command.mcp.toggle": "Przełącz MCP", + "command.mcp.toggle.description": "Przełącz MCP", + "command.agent.cycle": "Przełącz agenta", + "command.agent.cycle.description": "Przełącz na następnego agenta", + "command.agent.cycle.reverse": "Przełącz agenta wstecz", + "command.agent.cycle.reverse.description": "Przełącz na poprzedniego agenta", + "command.model.variant.cycle": "Przełącz wysiłek myślowy", + "command.model.variant.cycle.description": "Przełącz na następny poziom wysiłku", + "command.permissions.autoaccept.enable": "Automatyczne akceptowanie edycji", + "command.permissions.autoaccept.disable": "Zatrzymaj automatyczne akceptowanie edycji", + "command.session.undo": "Cofnij", + "command.session.undo.description": "Cofnij ostatnią wiadomość", + "command.session.redo": "Ponów", + "command.session.redo.description": "Ponów ostatnią cofniętą wiadomość", + "command.session.compact": "Kompaktuj sesję", + "command.session.compact.description": "Podsumuj sesję, aby zmniejszyć rozmiar kontekstu", + "command.session.fork": "Rozwidlij od wiadomości", + "command.session.fork.description": "Utwórz nową sesję od poprzedniej wiadomości", + "command.session.share": "Udostępnij sesję", + "command.session.share.description": "Udostępnij tę sesję i skopiuj URL do schowka", + "command.session.unshare": "Przestań udostępniać sesję", + "command.session.unshare.description": "Zatrzymaj udostępnianie tej sesji", + + "palette.search.placeholder": "Szukaj plików i poleceń", + "palette.empty": "Brak wyników", + "palette.group.commands": "Polecenia", + "palette.group.files": "Pliki", + + "dialog.provider.search.placeholder": "Szukaj dostawców", + "dialog.provider.empty": "Nie znaleziono dostawców", + "dialog.provider.group.popular": "Popularne", + "dialog.provider.group.other": "Inne", + "dialog.provider.tag.recommended": "Zalecane", + "dialog.provider.anthropic.note": "Połącz z Claude Pro/Max lub kluczem API", + + "dialog.model.select.title": "Wybierz model", + "dialog.model.search.placeholder": "Szukaj modeli", + "dialog.model.empty": "Brak wyników modelu", + "dialog.model.manage": "Zarządzaj modelami", + "dialog.model.manage.description": "Dostosuj, które modele pojawiają się w wyborze modelu.", + + "dialog.model.unpaid.freeModels.title": "Darmowe modele dostarczane przez OpenCode", + "dialog.model.unpaid.addMore.title": "Dodaj więcej modeli od popularnych dostawców", + + "dialog.provider.viewAll": "Zobacz wszystkich dostawców", + + "provider.connect.title": "Połącz {{provider}}", + "provider.connect.title.anthropicProMax": "Zaloguj się z Claude Pro/Max", + "provider.connect.selectMethod": "Wybierz metodę logowania dla {{provider}}.", + "provider.connect.method.apiKey": "Klucz API", + "provider.connect.status.inProgress": "Autoryzacja w toku...", + "provider.connect.status.waiting": "Oczekiwanie na autoryzację...", + "provider.connect.status.failed": "Autoryzacja nie powiodła się: {{error}}", + "provider.connect.apiKey.description": + "Wprowadź swój klucz API {{provider}}, aby połączyć konto i używać modeli {{provider}} w OpenCode.", + "provider.connect.apiKey.label": "Klucz API {{provider}}", + "provider.connect.apiKey.placeholder": "Klucz API", + "provider.connect.apiKey.required": "Klucz API jest wymagany", + "provider.connect.opencodeZen.line1": + "OpenCode Zen daje dostęp do wybranego zestawu niezawodnych, zoptymalizowanych modeli dla agentów kodujących.", + "provider.connect.opencodeZen.line2": + "Z jednym kluczem API uzyskasz dostęp do modeli takich jak Claude, GPT, Gemini, GLM i więcej.", + "provider.connect.opencodeZen.visit.prefix": "Odwiedź ", + "provider.connect.opencodeZen.visit.link": "opencode.ai/zen", + "provider.connect.opencodeZen.visit.suffix": ", aby odebrać swój klucz API.", + "provider.connect.oauth.code.visit.prefix": "Odwiedź ", + "provider.connect.oauth.code.visit.link": "ten link", + "provider.connect.oauth.code.visit.suffix": + ", aby odebrać kod autoryzacyjny, połączyć konto i używać modeli {{provider}} w OpenCode.", + "provider.connect.oauth.code.label": "Kod autoryzacyjny {{method}}", + "provider.connect.oauth.code.placeholder": "Kod autoryzacyjny", + "provider.connect.oauth.code.required": "Kod autoryzacyjny jest wymagany", + "provider.connect.oauth.code.invalid": "Nieprawidłowy kod autoryzacyjny", + "provider.connect.oauth.auto.visit.prefix": "Odwiedź ", + "provider.connect.oauth.auto.visit.link": "ten link", + "provider.connect.oauth.auto.visit.suffix": + " i wprowadź poniższy kod, aby połączyć konto i używać modeli {{provider}} w OpenCode.", + "provider.connect.oauth.auto.confirmationCode": "Kod potwierdzający", + "provider.connect.toast.connected.title": "Połączono {{provider}}", + "provider.connect.toast.connected.description": "Modele {{provider}} są teraz dostępne do użycia.", + + "model.tag.free": "Darmowy", + "model.tag.latest": "Najnowszy", + "model.provider.anthropic": "Anthropic", + "model.provider.openai": "OpenAI", + "model.provider.google": "Google", + "model.provider.xai": "xAI", + "model.provider.meta": "Meta", + "model.input.text": "tekst", + "model.input.image": "obraz", + "model.input.audio": "audio", + "model.input.video": "wideo", + "model.input.pdf": "pdf", + "model.tooltip.allows": "Obsługuje: {{inputs}}", + "model.tooltip.reasoning.allowed": "Obsługuje wnioskowanie", + "model.tooltip.reasoning.none": "Brak wnioskowania", + "model.tooltip.context": "Limit kontekstu {{limit}}", + + "common.search.placeholder": "Szukaj", + "common.goBack": "Wstecz", + "common.loading": "Ładowanie", + "common.loading.ellipsis": "...", + "common.cancel": "Anuluj", + "common.submit": "Prześlij", + "common.save": "Zapisz", + "common.saving": "Zapisywanie...", + "common.default": "Domyślny", + "common.attachment": "załącznik", + + "prompt.placeholder.shell": "Wpisz polecenie terminala...", + "prompt.placeholder.normal": 'Zapytaj o cokolwiek... "{{example}}"', + "prompt.mode.shell": "Terminal", + "prompt.mode.shell.exit": "esc aby wyjść", + + "prompt.example.1": "Napraw TODO w bazie kodu", + "prompt.example.2": "Jaki jest stos technologiczny tego projektu?", + "prompt.example.3": "Napraw zepsute testy", + "prompt.example.4": "Wyjaśnij jak działa uwierzytelnianie", + "prompt.example.5": "Znajdź i napraw luki w zabezpieczeniach", + "prompt.example.6": "Dodaj testy jednostkowe dla serwisu użytkownika", + "prompt.example.7": "Zrefaktoryzuj tę funkcję, aby była bardziej czytelna", + "prompt.example.8": "Co oznacza ten błąd?", + "prompt.example.9": "Pomóż mi zdebugować ten problem", + "prompt.example.10": "Wygeneruj dokumentację API", + "prompt.example.11": "Zoptymalizuj zapytania do bazy danych", + "prompt.example.12": "Dodaj walidację danych wejściowych", + "prompt.example.13": "Utwórz nowy komponent dla...", + "prompt.example.14": "Jak wdrożyć ten projekt?", + "prompt.example.15": "Sprawdź mój kod pod kątem najlepszych praktyk", + "prompt.example.16": "Dodaj obsługę błędów do tej funkcję", + "prompt.example.17": "Wyjaśnij ten wzorzec regex", + "prompt.example.18": "Przekonwertuj to na TypeScript", + "prompt.example.19": "Dodaj logowanie w całej bazie kodu", + "prompt.example.20": "Które zależności są przestarzałe?", + "prompt.example.21": "Pomóż mi napisać skrypt migracyjny", + "prompt.example.22": "Zaimplementuj cachowanie dla tego punktu końcowego", + "prompt.example.23": "Dodaj stronicowanie do tej listy", + "prompt.example.24": "Utwórz polecenie CLI dla...", + "prompt.example.25": "Jak działają tutaj zmienne środowiskowe?", + + "prompt.popover.emptyResults": "Brak pasujących wyników", + "prompt.popover.emptyCommands": "Brak pasujących poleceń", + "prompt.dropzone.label": "Upuść obrazy lub pliki PDF tutaj", + "prompt.slash.badge.custom": "własne", + "prompt.context.active": "aktywny", + "prompt.context.includeActiveFile": "Dołącz aktywny plik", + "prompt.context.removeActiveFile": "Usuń aktywny plik z kontekstu", + "prompt.context.removeFile": "Usuń plik z kontekstu", + "prompt.action.attachFile": "Załącz plik", + "prompt.attachment.remove": "Usuń załącznik", + "prompt.action.send": "Wyślij", + "prompt.action.stop": "Zatrzymaj", + + "prompt.toast.pasteUnsupported.title": "Nieobsługiwane wklejanie", + "prompt.toast.pasteUnsupported.description": "Tylko obrazy lub pliki PDF mogą być tutaj wklejane.", + "prompt.toast.modelAgentRequired.title": "Wybierz agenta i model", + "prompt.toast.modelAgentRequired.description": "Wybierz agenta i model przed wysłaniem zapytania.", + "prompt.toast.worktreeCreateFailed.title": "Nie udało się utworzyć drzewa roboczego", + "prompt.toast.sessionCreateFailed.title": "Nie udało się utworzyć sesji", + "prompt.toast.shellSendFailed.title": "Nie udało się wysłać polecenia powłoki", + "prompt.toast.commandSendFailed.title": "Nie udało się wysłać polecenia", + "prompt.toast.promptSendFailed.title": "Nie udało się wysłać zapytania", + + "dialog.mcp.title": "MCP", + "dialog.mcp.description": "{{enabled}} z {{total}} włączone", + "dialog.mcp.empty": "Brak skonfigurowanych MCP", + + "mcp.status.connected": "połączono", + "mcp.status.failed": "niepowodzenie", + "mcp.status.needs_auth": "wymaga autoryzacji", + "mcp.status.disabled": "wyłączone", + + "dialog.fork.empty": "Brak wiadomości do rozwidlenia", + + "dialog.directory.search.placeholder": "Szukaj folderów", + "dialog.directory.empty": "Nie znaleziono folderów", + + "dialog.server.title": "Serwery", + "dialog.server.description": "Przełącz serwer OpenCode, z którym łączy się ta aplikacja.", + "dialog.server.search.placeholder": "Szukaj serwerów", + "dialog.server.empty": "Brak serwerów", + "dialog.server.add.title": "Dodaj serwer", + "dialog.server.add.url": "URL serwera", + "dialog.server.add.placeholder": "http://localhost:4096", + "dialog.server.add.error": "Nie można połączyć się z serwerem", + "dialog.server.add.checking": "Sprawdzanie...", + "dialog.server.add.button": "Dodaj", + "dialog.server.default.title": "Domyślny serwer", + "dialog.server.default.description": + "Połącz z tym serwerem przy uruchomieniu aplikacji zamiast uruchamiać lokalny serwer. Wymaga restartu.", + "dialog.server.default.none": "Nie wybrano serwera", + "dialog.server.default.set": "Ustaw bieżący serwer jako domyślny", + "dialog.server.default.clear": "Wyczyść", + "dialog.server.action.remove": "Usuń serwer", + + "dialog.project.edit.title": "Edytuj projekt", + "dialog.project.edit.name": "Nazwa", + "dialog.project.edit.icon": "Ikona", + "dialog.project.edit.icon.alt": "Ikona projektu", + "dialog.project.edit.icon.hint": "Kliknij lub przeciągnij obraz", + "dialog.project.edit.icon.recommended": "Zalecane: 128x128px", + "dialog.project.edit.color": "Kolor", + "dialog.project.edit.color.select": "Wybierz kolor {{color}}", + + "context.breakdown.title": "Podział kontekstu", + "context.breakdown.note": 'Przybliżony podział tokenów wejściowych. "Inne" obejmuje definicje narzędzi i narzut.', + "context.breakdown.system": "System", + "context.breakdown.user": "Użytkownik", + "context.breakdown.assistant": "Asystent", + "context.breakdown.tool": "Wywołania narzędzi", + "context.breakdown.other": "Inne", + + "context.systemPrompt.title": "Prompt systemowy", + "context.rawMessages.title": "Surowe wiadomości", + + "context.stats.session": "Sesja", + "context.stats.messages": "Wiadomości", + "context.stats.provider": "Dostawca", + "context.stats.model": "Model", + "context.stats.limit": "Limit kontekstu", + "context.stats.totalTokens": "Całkowita liczba tokenów", + "context.stats.usage": "Użycie", + "context.stats.inputTokens": "Tokeny wejściowe", + "context.stats.outputTokens": "Tokeny wyjściowe", + "context.stats.reasoningTokens": "Tokeny wnioskowania", + "context.stats.cacheTokens": "Tokeny pamięci podręcznej (odczyt/zapis)", + "context.stats.userMessages": "Wiadomości użytkownika", + "context.stats.assistantMessages": "Wiadomości asystenta", + "context.stats.totalCost": "Całkowity koszt", + "context.stats.sessionCreated": "Utworzono sesję", + "context.stats.lastActivity": "Ostatnia aktywność", + + "context.usage.tokens": "Tokeny", + "context.usage.usage": "Użycie", + "context.usage.cost": "Koszt", + "context.usage.clickToView": "Kliknij, aby zobaczyć kontekst", + "context.usage.view": "Pokaż użycie kontekstu", + + "language.en": "Angielski", + "language.zh": "Chiński", + "language.ko": "Koreański", + "language.de": "Niemiecki", + "language.es": "Hiszpański", + "language.fr": "Francuski", + "language.ja": "Japoński", + "language.da": "Duński", + "language.pl": "Polski", + "language.ru": "Rosyjski", + "language.ar": "Arabski", + "language.no": "Norweski", + "language.br": "Portugalski (Brazylia)", + + "toast.language.title": "Język", + "toast.language.description": "Przełączono na {{language}}", + + "toast.theme.title": "Przełączono motyw", + "toast.scheme.title": "Schemat kolorów", + + "toast.permissions.autoaccept.on.title": "Automatyczne akceptowanie edycji", + "toast.permissions.autoaccept.on.description": "Uprawnienia do edycji i zapisu będą automatycznie zatwierdzane", + "toast.permissions.autoaccept.off.title": "Zatrzymano automatyczne akceptowanie edycji", + "toast.permissions.autoaccept.off.description": "Uprawnienia do edycji i zapisu będą wymagały zatwierdzenia", + + "toast.model.none.title": "Nie wybrano modelu", + "toast.model.none.description": "Połącz dostawcę, aby podsumować tę sesję", + + "toast.file.loadFailed.title": "Nie udało się załadować pliku", + + "toast.session.share.copyFailed.title": "Nie udało się skopiować URL do schowka", + "toast.session.share.success.title": "Sesja udostępniona", + "toast.session.share.success.description": "Link udostępniania skopiowany do schowka!", + "toast.session.share.failed.title": "Nie udało się udostępnić sesji", + "toast.session.share.failed.description": "Wystąpił błąd podczas udostępniania sesji", + + "toast.session.unshare.success.title": "Zatrzymano udostępnianie sesji", + "toast.session.unshare.success.description": "Udostępnianie sesji zostało pomyślnie zatrzymane!", + "toast.session.unshare.failed.title": "Nie udało się zatrzymać udostępniania sesji", + "toast.session.unshare.failed.description": "Wystąpił błąd podczas zatrzymywania udostępniania sesji", + + "toast.session.listFailed.title": "Nie udało się załadować sesji dla {{project}}", + + "toast.update.title": "Dostępna aktualizacja", + "toast.update.description": "Nowa wersja OpenCode ({{version}}) jest teraz dostępna do instalacji.", + "toast.update.action.installRestart": "Zainstaluj i zrestartuj", + "toast.update.action.notYet": "Jeszcze nie", + + "error.page.title": "Coś poszło nie tak", + "error.page.description": "Wystąpił błąd podczas ładowania aplikacji.", + "error.page.details.label": "Szczegóły błędu", + "error.page.action.restart": "Restartuj", + "error.page.action.checking": "Sprawdzanie...", + "error.page.action.checkUpdates": "Sprawdź aktualizacje", + "error.page.action.updateTo": "Zaktualizuj do {{version}}", + "error.page.report.prefix": "Proszę zgłosić ten błąd do zespołu OpenCode", + "error.page.report.discord": "na Discordzie", + "error.page.version": "Wersja: {{version}}", + + "error.dev.rootNotFound": + "Nie znaleziono elementu głównego. Czy zapomniałeś dodać go do swojego index.html? A może atrybut id został błędnie wpisany?", + + "error.globalSync.connectFailed": "Nie można połączyć się z serwerem. Czy serwer działa pod adresem `{{url}}`?", + + "error.chain.unknown": "Nieznany błąd", + "error.chain.causedBy": "Spowodowany przez:", + "error.chain.apiError": "Błąd API", + "error.chain.status": "Status: {{status}}", + "error.chain.retryable": "Można ponowić: {{retryable}}", + "error.chain.responseBody": "Treść odpowiedzi:\n{{body}}", + "error.chain.didYouMean": "Czy miałeś na myśli: {{suggestions}}", + "error.chain.modelNotFound": "Model nie znaleziony: {{provider}}/{{model}}", + "error.chain.checkConfig": "Sprawdź swoją konfigurację (opencode.json) nazwy dostawców/modeli", + "error.chain.mcpFailed": + 'Serwer MCP "{{name}}" nie powiódł się. Uwaga, OpenCode nie obsługuje jeszcze uwierzytelniania MCP.', + "error.chain.providerAuthFailed": "Uwierzytelnianie dostawcy nie powiodło się ({{provider}}): {{message}}", + "error.chain.providerInitFailed": + 'Nie udało się zainicjować dostawcy "{{provider}}". Sprawdź poświadczenia i konfigurację.', + "error.chain.configJsonInvalid": "Plik konfiguracyjny w {{path}} nie jest poprawnym JSON(C)", + "error.chain.configJsonInvalidWithMessage": "Plik konfiguracyjny w {{path}} nie jest poprawnym JSON(C): {{message}}", + "error.chain.configDirectoryTypo": + 'Katalog "{{dir}}" w {{path}} jest nieprawidłowy. Zmień nazwę katalogu na "{{suggestion}}" lub usuń go. To częsta literówka.', + "error.chain.configFrontmatterError": "Nie udało się przetworzyć frontmatter w {{path}}:\n{{message}}", + "error.chain.configInvalid": "Plik konfiguracyjny w {{path}} jest nieprawidłowy", + "error.chain.configInvalidWithMessage": "Plik konfiguracyjny w {{path}} jest nieprawidłowy: {{message}}", + + "notification.permission.title": "Wymagane uprawnienie", + "notification.permission.description": "{{sessionTitle}} w {{projectName}} potrzebuje uprawnienia", + "notification.question.title": "Pytanie", + "notification.question.description": "{{sessionTitle}} w {{projectName}} ma pytanie", + "notification.action.goToSession": "Przejdź do sesji", + + "notification.session.responseReady.title": "Odpowiedź gotowa", + "notification.session.error.title": "Błąd sesji", + "notification.session.error.fallbackDescription": "Wystąpił błąd", + + "home.recentProjects": "Ostatnie projekty", + "home.empty.title": "Brak ostatnich projektów", + "home.empty.description": "Zacznij od otwarcia lokalnego projektu", + + "session.tab.session": "Sesja", + "session.tab.review": "Przegląd", + "session.tab.context": "Kontekst", + "session.panel.reviewAndFiles": "Przegląd i pliki", + "session.review.filesChanged": "Zmieniono {{count}} plików", + "session.review.loadingChanges": "Ładowanie zmian...", + "session.review.empty": "Brak zmian w tej sesji", + "session.messages.renderEarlier": "Renderuj wcześniejsze wiadomości", + "session.messages.loadingEarlier": "Ładowanie wcześniejszych wiadomości...", + "session.messages.loadEarlier": "Załaduj wcześniejsze wiadomości", + "session.messages.loading": "Ładowanie wiadomości...", + "session.messages.jumpToLatest": "Przejdź do najnowszych", + + "session.context.addToContext": "Dodaj {{selection}} do kontekstu", + + "session.new.worktree.main": "Główna gałąź", + "session.new.worktree.mainWithBranch": "Główna gałąź ({{branch}})", + "session.new.worktree.create": "Utwórz nowe drzewo robocze", + "session.new.lastModified": "Ostatnio zmodyfikowano", + + "session.header.search.placeholder": "Szukaj {{project}}", + "session.header.searchFiles": "Szukaj plików", + + "session.share.popover.title": "Opublikuj w sieci", + "session.share.popover.description.shared": + "Ta sesja jest publiczna w sieci. Jest dostępna dla każdego, kto posiada link.", + "session.share.popover.description.unshared": + "Udostępnij sesję publicznie w sieci. Będzie dostępna dla każdego, kto posiada link.", + "session.share.action.share": "Udostępnij", + "session.share.action.publish": "Opublikuj", + "session.share.action.publishing": "Publikowanie...", + "session.share.action.unpublish": "Cofnij publikację", + "session.share.action.unpublishing": "Cofanie publikacji...", + "session.share.action.view": "Widok", + "session.share.copy.copied": "Skopiowano", + "session.share.copy.copyLink": "Kopiuj link", + + "lsp.tooltip.none": "Brak serwerów LSP", + "lsp.label.connected": "{{count}} LSP", + + "prompt.loading": "Ładowanie promptu...", + "terminal.loading": "Ładowanie terminala...", + "terminal.title": "Terminal", + "terminal.title.numbered": "Terminal {{number}}", + "terminal.close": "Zamknij terminal", + "terminal.connectionLost.title": "Utracono połączenie", + "terminal.connectionLost.description": + "Połączenie z terminalem zostało przerwane. Może się to zdarzyć przy restarcie serwera.", + + "common.closeTab": "Zamknij kartę", + "common.dismiss": "Odrzuć", + "common.requestFailed": "Żądanie nie powiodło się", + "common.moreOptions": "Więcej opcji", + "common.learnMore": "Dowiedz się więcej", + "common.rename": "Zmień nazwę", + "common.reset": "Resetuj", + "common.archive": "Archiwizuj", + "common.delete": "Usuń", + "common.close": "Zamknij", + "common.edit": "Edytuj", + "common.loadMore": "Załaduj więcej", + "common.key.esc": "ESC", + + "sidebar.menu.toggle": "Przełącz menu", + "sidebar.nav.projectsAndSessions": "Projekty i sesje", + "sidebar.settings": "Ustawienia", + "sidebar.help": "Pomoc", + "sidebar.workspaces.enable": "Włącz przestrzenie robocze", + "sidebar.workspaces.disable": "Wyłącz przestrzenie robocze", + "sidebar.gettingStarted.title": "Pierwsze kroki", + "sidebar.gettingStarted.line1": "OpenCode zawiera darmowe modele, więc możesz zacząć od razu.", + "sidebar.gettingStarted.line2": "Połącz dowolnego dostawcę, aby używać modeli, w tym Claude, GPT, Gemini itp.", + "sidebar.project.recentSessions": "Ostatnie sesje", + "sidebar.project.viewAllSessions": "Zobacz wszystkie sesje", + + "settings.section.desktop": "Pulpit", + "settings.tab.general": "Ogólne", + "settings.tab.shortcuts": "Skróty", + + "settings.general.section.appearance": "Wygląd", + "settings.general.section.notifications": "Powiadomienia systemowe", + "settings.general.section.sounds": "Efekty dźwiękowe", + + "settings.general.row.language.title": "Język", + "settings.general.row.language.description": "Zmień język wyświetlania dla OpenCode", + "settings.general.row.appearance.title": "Wygląd", + "settings.general.row.appearance.description": "Dostosuj wygląd OpenCode na swoim urządzeniu", + "settings.general.row.theme.title": "Motyw", + "settings.general.row.theme.description": "Dostosuj motyw OpenCode.", + "settings.general.row.font.title": "Czcionka", + "settings.general.row.font.description": "Dostosuj czcionkę mono używaną w blokach kodu", + "font.option.ibmPlexMono": "IBM Plex Mono", + "font.option.cascadiaCode": "Cascadia Code", + "font.option.firaCode": "Fira Code", + "font.option.hack": "Hack", + "font.option.inconsolata": "Inconsolata", + "font.option.intelOneMono": "Intel One Mono", + "font.option.jetbrainsMono": "JetBrains Mono", + "font.option.mesloLgs": "Meslo LGS", + "font.option.robotoMono": "Roboto Mono", + "font.option.sourceCodePro": "Source Code Pro", + "font.option.ubuntuMono": "Ubuntu Mono", + "sound.option.alert01": "Alert 01", + "sound.option.alert02": "Alert 02", + "sound.option.alert03": "Alert 03", + "sound.option.alert04": "Alert 04", + "sound.option.alert05": "Alert 05", + "sound.option.alert06": "Alert 06", + "sound.option.alert07": "Alert 07", + "sound.option.alert08": "Alert 08", + "sound.option.alert09": "Alert 09", + "sound.option.alert10": "Alert 10", + "sound.option.bipbop01": "Bip-bop 01", + "sound.option.bipbop02": "Bip-bop 02", + "sound.option.bipbop03": "Bip-bop 03", + "sound.option.bipbop04": "Bip-bop 04", + "sound.option.bipbop05": "Bip-bop 05", + "sound.option.bipbop06": "Bip-bop 06", + "sound.option.bipbop07": "Bip-bop 07", + "sound.option.bipbop08": "Bip-bop 08", + "sound.option.bipbop09": "Bip-bop 09", + "sound.option.bipbop10": "Bip-bop 10", + "sound.option.staplebops01": "Staplebops 01", + "sound.option.staplebops02": "Staplebops 02", + "sound.option.staplebops03": "Staplebops 03", + "sound.option.staplebops04": "Staplebops 04", + "sound.option.staplebops05": "Staplebops 05", + "sound.option.staplebops06": "Staplebops 06", + "sound.option.staplebops07": "Staplebops 07", + "sound.option.nope01": "Nope 01", + "sound.option.nope02": "Nope 02", + "sound.option.nope03": "Nope 03", + "sound.option.nope04": "Nope 04", + "sound.option.nope05": "Nope 05", + "sound.option.nope06": "Nope 06", + "sound.option.nope07": "Nope 07", + "sound.option.nope08": "Nope 08", + "sound.option.nope09": "Nope 09", + "sound.option.nope10": "Nope 10", + "sound.option.nope11": "Nope 11", + "sound.option.nope12": "Nope 12", + "sound.option.yup01": "Yup 01", + "sound.option.yup02": "Yup 02", + "sound.option.yup03": "Yup 03", + "sound.option.yup04": "Yup 04", + "sound.option.yup05": "Yup 05", + "sound.option.yup06": "Yup 06", + + "settings.general.notifications.agent.title": "Agent", + "settings.general.notifications.agent.description": + "Pokaż powiadomienie systemowe, gdy agent zakończy pracę lub wymaga uwagi", + "settings.general.notifications.permissions.title": "Uprawnienia", + "settings.general.notifications.permissions.description": + "Pokaż powiadomienie systemowe, gdy wymagane jest uprawnienie", + "settings.general.notifications.errors.title": "Błędy", + "settings.general.notifications.errors.description": "Pokaż powiadomienie systemowe, gdy wystąpi błąd", + + "settings.general.sounds.agent.title": "Agent", + "settings.general.sounds.agent.description": "Odtwórz dźwięk, gdy agent zakończy pracę lub wymaga uwagi", + "settings.general.sounds.permissions.title": "Uprawnienia", + "settings.general.sounds.permissions.description": "Odtwórz dźwięk, gdy wymagane jest uprawnienie", + "settings.general.sounds.errors.title": "Błędy", + "settings.general.sounds.errors.description": "Odtwórz dźwięk, gdy wystąpi błąd", + + "settings.shortcuts.title": "Skróty klawiszowe", + "settings.shortcuts.reset.button": "Przywróć domyślne", + "settings.shortcuts.reset.toast.title": "Zresetowano skróty", + "settings.shortcuts.reset.toast.description": "Skróty klawiszowe zostały przywrócone do ustawień domyślnych.", + "settings.shortcuts.conflict.title": "Skrót już w użyciu", + "settings.shortcuts.conflict.description": "{{keybind}} jest już przypisany do {{titles}}.", + "settings.shortcuts.unassigned": "Nieprzypisany", + "settings.shortcuts.pressKeys": "Naciśnij klawisze", + "settings.shortcuts.search.placeholder": "Szukaj skrótów", + "settings.shortcuts.search.empty": "Nie znaleziono skrótów", + + "settings.shortcuts.group.general": "Ogólne", + "settings.shortcuts.group.session": "Sesja", + "settings.shortcuts.group.navigation": "Nawigacja", + "settings.shortcuts.group.modelAndAgent": "Model i agent", + "settings.shortcuts.group.terminal": "Terminal", + "settings.shortcuts.group.prompt": "Prompt", + + "settings.providers.title": "Dostawcy", + "settings.providers.description": "Ustawienia dostawców będą tutaj konfigurowalne.", + "settings.models.title": "Modele", + "settings.models.description": "Ustawienia modeli będą tutaj konfigurowalne.", + "settings.agents.title": "Agenci", + "settings.agents.description": "Ustawienia agentów będą tutaj konfigurowalne.", + "settings.commands.title": "Polecenia", + "settings.commands.description": "Ustawienia poleceń będą tutaj konfigurowalne.", + "settings.mcp.title": "MCP", + "settings.mcp.description": "Ustawienia MCP będą tutaj konfigurowalne.", + + "settings.permissions.title": "Uprawnienia", + "settings.permissions.description": "Kontroluj, jakich narzędzi serwer może używać domyślnie.", + "settings.permissions.section.tools": "Narzędzia", + "settings.permissions.toast.updateFailed.title": "Nie udało się zaktualizować uprawnień", + + "settings.permissions.action.allow": "Zezwól", + "settings.permissions.action.ask": "Pytaj", + "settings.permissions.action.deny": "Odmów", + + "settings.permissions.tool.read.title": "Odczyt", + "settings.permissions.tool.read.description": "Odczyt pliku (pasuje do ścieżki pliku)", + "settings.permissions.tool.edit.title": "Edycja", + "settings.permissions.tool.edit.description": "Modyfikacja plików, w tym edycje, zapisy, łatki i multi-edycje", + "settings.permissions.tool.glob.title": "Glob", + "settings.permissions.tool.glob.description": "Dopasowywanie plików za pomocą wzorców glob", + "settings.permissions.tool.grep.title": "Grep", + "settings.permissions.tool.grep.description": "Przeszukiwanie zawartości plików za pomocą wyrażeń regularnych", + "settings.permissions.tool.list.title": "Lista", + "settings.permissions.tool.list.description": "Wyświetlanie listy plików w katalogu", + "settings.permissions.tool.bash.title": "Bash", + "settings.permissions.tool.bash.description": "Uruchamianie poleceń powłoki", + "settings.permissions.tool.task.title": "Zadanie", + "settings.permissions.tool.task.description": "Uruchamianie pod-agentów", + "settings.permissions.tool.skill.title": "Umiejętność", + "settings.permissions.tool.skill.description": "Ładowanie umiejętności według nazwy", + "settings.permissions.tool.lsp.title": "LSP", + "settings.permissions.tool.lsp.description": "Uruchamianie zapytań serwera językowego", + "settings.permissions.tool.todoread.title": "Odczyt Todo", + "settings.permissions.tool.todoread.description": "Odczyt listy zadań", + "settings.permissions.tool.todowrite.title": "Zapis Todo", + "settings.permissions.tool.todowrite.description": "Aktualizacja listy zadań", + "settings.permissions.tool.webfetch.title": "Pobieranie z sieci", + "settings.permissions.tool.webfetch.description": "Pobieranie zawartości z adresu URL", + "settings.permissions.tool.websearch.title": "Wyszukiwanie w sieci", + "settings.permissions.tool.websearch.description": "Przeszukiwanie sieci", + "settings.permissions.tool.codesearch.title": "Wyszukiwanie kodu", + "settings.permissions.tool.codesearch.description": "Przeszukiwanie kodu w sieci", + "settings.permissions.tool.external_directory.title": "Katalog zewnętrzny", + "settings.permissions.tool.external_directory.description": "Dostęp do plików poza katalogiem projektu", + "settings.permissions.tool.doom_loop.title": "Zapętlenie", + "settings.permissions.tool.doom_loop.description": "Wykrywanie powtarzających się wywołań narzędzi (doom loop)", + + "session.delete.failed.title": "Nie udało się usunąć sesji", + "session.delete.title": "Usuń sesję", + "session.delete.confirm": 'Usunąć sesję "{{name}}"?', + "session.delete.button": "Usuń sesję", + + "workspace.new": "Nowa przestrzeń robocza", + "workspace.type.local": "lokalna", + "workspace.type.sandbox": "piaskownica", + "workspace.create.failed.title": "Nie udało się utworzyć przestrzeni roboczej", + "workspace.delete.failed.title": "Nie udało się usunąć przestrzeni roboczej", + "workspace.resetting.title": "Resetowanie przestrzeni roboczej", + "workspace.resetting.description": "To może potrwać minutę.", + "workspace.reset.failed.title": "Nie udało się zresetować przestrzeni roboczej", + "workspace.reset.success.title": "Przestrzeń robocza zresetowana", + "workspace.reset.success.description": "Przestrzeń robocza odpowiada teraz domyślnej gałęzi.", + "workspace.status.checking": "Sprawdzanie niezscalonych zmian...", + "workspace.status.error": "Nie można zweryfikować statusu git.", + "workspace.status.clean": "Nie wykryto niezscalonych zmian.", + "workspace.status.dirty": "Wykryto niezscalone zmiany w tej przestrzeni roboczej.", + "workspace.delete.title": "Usuń przestrzeń roboczą", + "workspace.delete.confirm": 'Usunąć przestrzeń roboczą "{{name}}"?', + "workspace.delete.button": "Usuń przestrzeń roboczą", + "workspace.reset.title": "Resetuj przestrzeń roboczą", + "workspace.reset.confirm": 'Zresetować przestrzeń roboczą "{{name}}"?', + "workspace.reset.button": "Resetuj przestrzeń roboczą", + "workspace.reset.archived.none": "Żadne aktywne sesje nie zostaną zarchiwizowane.", + "workspace.reset.archived.one": "1 sesja zostanie zarchiwizowana.", + "workspace.reset.archived.many": "{{count}} sesji zostanie zarchiwizowanych.", + "workspace.reset.note": "To zresetuje przestrzeń roboczą, aby odpowiadała domyślnej gałęzi.", +} diff --git a/packages/app/src/i18n/ru.ts b/packages/app/src/i18n/ru.ts new file mode 100644 index 00000000000..dd399e27cf4 --- /dev/null +++ b/packages/app/src/i18n/ru.ts @@ -0,0 +1,662 @@ +export const dict = { + "command.category.suggested": "Предложено", + "command.category.view": "Просмотр", + "command.category.project": "Проект", + "command.category.provider": "Провайдер", + "command.category.server": "Сервер", + "command.category.session": "Сессия", + "command.category.theme": "Тема", + "command.category.language": "Язык", + "command.category.file": "Файл", + "command.category.terminal": "Терминал", + "command.category.model": "Модель", + "command.category.mcp": "MCP", + "command.category.agent": "Агент", + "command.category.permissions": "Разрешения", + "command.category.workspace": "Рабочее пространство", + "command.category.settings": "Настройки", + + "theme.scheme.system": "Системная", + "theme.scheme.light": "Светлая", + "theme.scheme.dark": "Тёмная", + + "command.sidebar.toggle": "Переключить боковую панель", + "command.project.open": "Открыть проект", + "command.provider.connect": "Подключить провайдера", + "command.server.switch": "Переключить сервер", + "command.settings.open": "Открыть настройки", + "command.session.previous": "Предыдущая сессия", + "command.session.next": "Следующая сессия", + "command.session.archive": "Архивировать сессию", + + "command.palette": "Палитра команд", + + "command.theme.cycle": "Цикл тем", + "command.theme.set": "Использовать тему: {{theme}}", + "command.theme.scheme.cycle": "Цикл цветовой схемы", + "command.theme.scheme.set": "Использовать цветовую схему: {{scheme}}", + + "command.language.cycle": "Цикл языков", + "command.language.set": "Использовать язык: {{language}}", + + "command.session.new": "Новая сессия", + "command.file.open": "Открыть файл", + "command.file.open.description": "Поиск файлов и команд", + "command.terminal.toggle": "Переключить терминал", + "command.review.toggle": "Переключить обзор", + "command.terminal.new": "Новый терминал", + "command.terminal.new.description": "Создать новую вкладку терминала", + "command.steps.toggle": "Переключить шаги", + "command.steps.toggle.description": "Показать или скрыть шаги для текущего сообщения", + "command.message.previous": "Предыдущее сообщение", + "command.message.previous.description": "Перейти к предыдущему сообщению пользователя", + "command.message.next": "Следующее сообщение", + "command.message.next.description": "Перейти к следующему сообщению пользователя", + "command.model.choose": "Выбрать модель", + "command.model.choose.description": "Выбрать другую модель", + "command.mcp.toggle": "Переключить MCP", + "command.mcp.toggle.description": "Переключить MCP", + "command.agent.cycle": "Цикл агентов", + "command.agent.cycle.description": "Переключиться к следующему агенту", + "command.agent.cycle.reverse": "Цикл агентов назад", + "command.agent.cycle.reverse.description": "Переключиться к предыдущему агенту", + "command.model.variant.cycle": "Цикл режимов мышления", + "command.model.variant.cycle.description": "Переключиться к следующему уровню усилий", + "command.permissions.autoaccept.enable": "Авто-принятие изменений", + "command.permissions.autoaccept.disable": "Прекратить авто-принятие изменений", + "command.session.undo": "Отменить", + "command.session.undo.description": "Отменить последнее сообщение", + "command.session.redo": "Повторить", + "command.session.redo.description": "Повторить отменённое сообщение", + "command.session.compact": "Сжать сессию", + "command.session.compact.description": "Сократить сессию для уменьшения размера контекста", + "command.session.fork": "Создать ответвление", + "command.session.fork.description": "Создать новую сессию из сообщения", + "command.session.share": "Поделиться сессией", + "command.session.share.description": "Поделиться сессией и скопировать URL в буфер обмена", + "command.session.unshare": "Отменить публикацию", + "command.session.unshare.description": "Прекратить публикацию сессии", + + "palette.search.placeholder": "Поиск файлов и команд", + "palette.empty": "Ничего не найдено", + "palette.group.commands": "Команды", + "palette.group.files": "Файлы", + + "dialog.provider.search.placeholder": "Поиск провайдеров", + "dialog.provider.empty": "Провайдеры не найдены", + "dialog.provider.group.popular": "Популярные", + "dialog.provider.group.other": "Другие", + "dialog.provider.tag.recommended": "Рекомендуемые", + "dialog.provider.anthropic.note": "Подключитесь с помощью Claude Pro/Max или API ключа", + + "dialog.model.select.title": "Выбрать модель", + "dialog.model.search.placeholder": "Поиск моделей", + "dialog.model.empty": "Модели не найдены", + "dialog.model.manage": "Управление моделями", + "dialog.model.manage.description": "Настройте какие модели появляются в выборе модели", + + "dialog.model.unpaid.freeModels.title": "Бесплатные модели от OpenCode", + "dialog.model.unpaid.addMore.title": "Добавьте больше моделей от популярных провайдеров", + + "dialog.provider.viewAll": "Посмотреть всех провайдеров", + + "provider.connect.title": "Подключить {{provider}}", + "provider.connect.title.anthropicProMax": "Войти с помощью Claude Pro/Max", + "provider.connect.selectMethod": "Выберите способ входа для {{provider}}.", + "provider.connect.method.apiKey": "API ключ", + "provider.connect.status.inProgress": "Авторизация...", + "provider.connect.status.waiting": "Ожидание авторизации...", + "provider.connect.status.failed": "Ошибка авторизации: {{error}}", + "provider.connect.apiKey.description": + "Введите ваш API ключ {{provider}} для подключения аккаунта и использования моделей {{provider}} в OpenCode.", + "provider.connect.apiKey.label": "{{provider}} API ключ", + "provider.connect.apiKey.placeholder": "API ключ", + "provider.connect.apiKey.required": "API ключ обязателен", + "provider.connect.opencodeZen.line1": + "OpenCode Zen даёт вам доступ к отобранным надёжным оптимизированным моделям для агентов программирования.", + "provider.connect.opencodeZen.line2": + "С одним API ключом вы получите доступ к таким моделям как Claude, GPT, Gemini, GLM и другим.", + "provider.connect.opencodeZen.visit.prefix": "Посетите ", + "provider.connect.opencodeZen.visit.link": "opencode.ai/zen", + "provider.connect.opencodeZen.visit.suffix": " чтобы получить ваш API ключ.", + "provider.connect.oauth.code.visit.prefix": "Посетите ", + "provider.connect.oauth.code.visit.link": "эту ссылку", + "provider.connect.oauth.code.visit.suffix": + " чтобы получить код авторизации для подключения аккаунта и использования моделей {{provider}} в OpenCode.", + "provider.connect.oauth.code.label": "{{method}} код авторизации", + "provider.connect.oauth.code.placeholder": "Код авторизации", + "provider.connect.oauth.code.required": "Код авторизации обязателен", + "provider.connect.oauth.code.invalid": "Неверный код авторизации", + "provider.connect.oauth.auto.visit.prefix": "Посетите ", + "provider.connect.oauth.auto.visit.link": "эту ссылку", + "provider.connect.oauth.auto.visit.suffix": + " и введите код ниже для подключения аккаунта и использования моделей {{provider}} в OpenCode.", + "provider.connect.oauth.auto.confirmationCode": "Код подтверждения", + "provider.connect.toast.connected.title": "{{provider}} подключён", + "provider.connect.toast.connected.description": "Модели {{provider}} теперь доступны.", + + "model.tag.free": "Бесплатно", + "model.tag.latest": "Последняя", + "model.provider.anthropic": "Anthropic", + "model.provider.openai": "OpenAI", + "model.provider.google": "Google", + "model.provider.xai": "xAI", + "model.provider.meta": "Meta", + "model.input.text": "текст", + "model.input.image": "изображение", + "model.input.audio": "аудио", + "model.input.video": "видео", + "model.input.pdf": "pdf", + "model.tooltip.allows": "Разрешено: {{inputs}}", + "model.tooltip.reasoning.allowed": "Разрешает рассуждение", + "model.tooltip.reasoning.none": "Без рассуждения", + "model.tooltip.context": "Лимит контекста {{limit}}", + + "common.search.placeholder": "Поиск", + "common.goBack": "Назад", + "common.loading": "Загрузка", + "common.loading.ellipsis": "...", + "common.cancel": "Отмена", + "common.submit": "Отправить", + "common.save": "Сохранить", + "common.saving": "Сохранение...", + "common.default": "По умолчанию", + "common.attachment": "вложение", + + "prompt.placeholder.shell": "Введите команду оболочки...", + "prompt.placeholder.normal": 'Спросите что угодно... "{{example}}"', + "prompt.mode.shell": "Оболочка", + "prompt.mode.shell.exit": "esc для выхода", + + "prompt.example.1": "Исправить TODO в коде", + "prompt.example.2": "Какой технологический стек этого проекта?", + "prompt.example.3": "Исправить сломанные тесты", + "prompt.example.4": "Объясни как работает аутентификация", + "prompt.example.5": "Найти и исправить уязвимости безопасности", + "prompt.example.6": "Добавить юнит-тесты для сервиса пользователя", + "prompt.example.7": "Рефакторить эту функцию для лучшей читаемости", + "prompt.example.8": "Что означает эта ошибка?", + "prompt.example.9": "Помоги мне отладить эту проблему", + "prompt.example.10": "Сгенерировать документацию API", + "prompt.example.11": "Оптимизировать запросы к базе данных", + "prompt.example.12": "Добавить валидацию ввода", + "prompt.example.13": "Создать новый компонент для...", + "prompt.example.14": "Как развернуть этот проект?", + "prompt.example.15": "Проверь мой код на лучшие практики", + "prompt.example.16": "Добавить обработку ошибок в эту функцию", + "prompt.example.17": "Объясни этот паттерн regex", + "prompt.example.18": "Конвертировать это в TypeScript", + "prompt.example.19": "Добавить логирование по всему проекту", + "prompt.example.20": "Какие зависимости устарели?", + "prompt.example.21": "Помоги написать скрипт миграции", + "prompt.example.22": "Реализовать кэширование для этой конечной точки", + "prompt.example.23": "Добавить пагинацию в этот список", + "prompt.example.24": "Создать CLI команду для...", + "prompt.example.25": "Как работают переменные окружения здесь?", + + "prompt.popover.emptyResults": "Нет совпадений", + "prompt.popover.emptyCommands": "Нет совпадающих команд", + "prompt.dropzone.label": "Перетащите изображения или PDF сюда", + "prompt.slash.badge.custom": "своё", + "prompt.context.active": "активно", + "prompt.context.includeActiveFile": "Включить активный файл", + "prompt.context.removeActiveFile": "Удалить активный файл из контекста", + "prompt.context.removeFile": "Удалить файл из контекста", + "prompt.action.attachFile": "Прикрепить файл", + "prompt.attachment.remove": "Удалить вложение", + "prompt.action.send": "Отправить", + "prompt.action.stop": "Остановить", + + "prompt.toast.pasteUnsupported.title": "Неподдерживаемая вставка", + "prompt.toast.pasteUnsupported.description": "Сюда можно вставлять только изображения или PDF.", + "prompt.toast.modelAgentRequired.title": "Выберите агента и модель", + "prompt.toast.modelAgentRequired.description": "Выберите агента и модель перед отправкой запроса.", + "prompt.toast.worktreeCreateFailed.title": "Не удалось создать worktree", + "prompt.toast.sessionCreateFailed.title": "Не удалось создать сессию", + "prompt.toast.shellSendFailed.title": "Не удалось отправить команду оболочки", + "prompt.toast.commandSendFailed.title": "Не удалось отправить команду", + "prompt.toast.promptSendFailed.title": "Не удалось отправить запрос", + + "dialog.mcp.title": "MCP", + "dialog.mcp.description": "{{enabled}} из {{total}} включено", + "dialog.mcp.empty": "MCP не настроены", + + "mcp.status.connected": "подключено", + "mcp.status.failed": "ошибка", + "mcp.status.needs_auth": "требуется авторизация", + "mcp.status.disabled": "отключено", + + "dialog.fork.empty": "Нет сообщений для ответвления", + + "dialog.directory.search.placeholder": "Поиск папок", + "dialog.directory.empty": "Папки не найдены", + + "dialog.server.title": "Серверы", + "dialog.server.description": "Переключите сервер OpenCode к которому подключается приложение.", + "dialog.server.search.placeholder": "Поиск серверов", + "dialog.server.empty": "Серверов пока нет", + "dialog.server.add.title": "Добавить сервер", + "dialog.server.add.url": "URL сервера", + "dialog.server.add.placeholder": "http://localhost:4096", + "dialog.server.add.error": "Не удалось подключиться к серверу", + "dialog.server.add.checking": "Проверка...", + "dialog.server.add.button": "Добавить", + "dialog.server.default.title": "Сервер по умолчанию", + "dialog.server.default.description": + "Подключаться к этому серверу при запуске приложения вместо запуска локального сервера. Требуется перезапуск.", + "dialog.server.default.none": "Сервер не выбран", + "dialog.server.default.set": "Установить текущий сервер по умолчанию", + "dialog.server.default.clear": "Очистить", + "dialog.server.action.remove": "Удалить сервер", + + "dialog.project.edit.title": "Редактировать проект", + "dialog.project.edit.name": "Название", + "dialog.project.edit.icon": "Иконка", + "dialog.project.edit.icon.alt": "Иконка проекта", + "dialog.project.edit.icon.hint": "Нажмите или перетащите изображение", + "dialog.project.edit.icon.recommended": "Рекомендуется: 128x128px", + "dialog.project.edit.color": "Цвет", + "dialog.project.edit.color.select": "Выбрать цвет {{color}}", + + "context.breakdown.title": "Разбивка контекста", + "context.breakdown.note": + 'Приблизительная разбивка входных токенов. "Другое" включает определения инструментов и накладные расходы.', + "context.breakdown.system": "Система", + "context.breakdown.user": "Пользователь", + "context.breakdown.assistant": "Ассистент", + "context.breakdown.tool": "Вызовы инструментов", + "context.breakdown.other": "Другое", + + "context.systemPrompt.title": "Системный промпт", + "context.rawMessages.title": "Исходные сообщения", + + "context.stats.session": "Сессия", + "context.stats.messages": "Сообщения", + "context.stats.provider": "Провайдер", + "context.stats.model": "Модель", + "context.stats.limit": "Лимит контекста", + "context.stats.totalTokens": "Всего токенов", + "context.stats.usage": "Использование", + "context.stats.inputTokens": "Входные токены", + "context.stats.outputTokens": "Выходные токены", + "context.stats.reasoningTokens": "Токены рассуждения", + "context.stats.cacheTokens": "Токены кэша (чтение/запись)", + "context.stats.userMessages": "Сообщения пользователя", + "context.stats.assistantMessages": "Сообщения ассистента", + "context.stats.totalCost": "Общая стоимость", + "context.stats.sessionCreated": "Сессия создана", + "context.stats.lastActivity": "Последняя активность", + + "context.usage.tokens": "Токены", + "context.usage.usage": "Использование", + "context.usage.cost": "Стоимость", + "context.usage.clickToView": "Нажмите для просмотра контекста", + "context.usage.view": "Показать использование контекста", + + "language.en": "Английский", + "language.zh": "Китайский", + "language.ko": "Корейский", + "language.de": "Немецкий", + "language.es": "Испанский", + "language.fr": "Французский", + "language.ja": "Японский", + "language.da": "Датский", + "language.ru": "Русский", + "language.ar": "Арабский", + "language.no": "Норвежский", + "language.br": "Португальский (Бразилия)", + + "toast.language.title": "Язык", + "toast.language.description": "Переключено на {{language}}", + + "toast.theme.title": "Тема переключена", + "toast.scheme.title": "Цветовая схема", + + "toast.permissions.autoaccept.on.title": "Авто-принятие изменений", + "toast.permissions.autoaccept.on.description": "Разрешения на редактирование и запись будут автоматически одобрены", + "toast.permissions.autoaccept.off.title": "Авто-принятие остановлено", + "toast.permissions.autoaccept.off.description": "Редактирование и запись потребуют подтверждения", + + "toast.model.none.title": "Модель не выбрана", + "toast.model.none.description": "Подключите провайдера для суммаризации сессии", + + "toast.file.loadFailed.title": "Не удалось загрузить файл", + + "toast.session.share.copyFailed.title": "Не удалось скопировать URL в буфер обмена", + "toast.session.share.success.title": "Сессия опубликована", + "toast.session.share.success.description": "URL скопирован в буфер обмена!", + "toast.session.share.failed.title": "Не удалось опубликовать сессию", + "toast.session.share.failed.description": "Произошла ошибка при публикации сессии", + + "toast.session.unshare.success.title": "Публикация отменена", + "toast.session.unshare.success.description": "Публикация успешно отменена!", + "toast.session.unshare.failed.title": "Не удалось отменить публикацию", + "toast.session.unshare.failed.description": "Произошла ошибка при отмене публикации", + + "toast.session.listFailed.title": "Не удалось загрузить сессии для {{project}}", + + "toast.update.title": "Доступно обновление", + "toast.update.description": "Новая версия OpenCode ({{version}}) доступна для установки.", + "toast.update.action.installRestart": "Установить и перезапустить", + "toast.update.action.notYet": "Пока нет", + + "error.page.title": "Что-то пошло не так", + "error.page.description": "Произошла ошибка при загрузке приложения.", + "error.page.details.label": "Детали ошибки", + "error.page.action.restart": "Перезапустить", + "error.page.action.checking": "Проверка...", + "error.page.action.checkUpdates": "Проверить обновления", + "error.page.action.updateTo": "Обновить до {{version}}", + "error.page.report.prefix": "Пожалуйста, сообщите об этой ошибке команде OpenCode", + "error.page.report.discord": "в Discord", + "error.page.version": "Версия: {{version}}", + + "error.dev.rootNotFound": + "Корневой элемент не найден. Вы забыли добавить его в index.html? Или, может быть, атрибут id был написан неправильно?", + + "error.globalSync.connectFailed": "Не удалось подключиться к серверу. Запущен ли сервер по адресу `{{url}}`?", + + "error.chain.unknown": "Неизвестная ошибка", + "error.chain.causedBy": "Причина:", + "error.chain.apiError": "Ошибка API", + "error.chain.status": "Статус: {{status}}", + "error.chain.retryable": "Повторная попытка: {{retryable}}", + "error.chain.responseBody": "Тело ответа:\n{{body}}", + "error.chain.didYouMean": "Возможно, вы имели в виду: {{suggestions}}", + "error.chain.modelNotFound": "Модель не найдена: {{provider}}/{{model}}", + "error.chain.checkConfig": "Проверьте названия провайдера/модели в конфиге (opencode.json)", + "error.chain.mcpFailed": + 'MCP сервер "{{name}}" завершился с ошибкой. Обратите внимание, что OpenCode пока не поддерживает MCP авторизацию.', + "error.chain.providerAuthFailed": "Ошибка аутентификации провайдера ({{provider}}): {{message}}", + "error.chain.providerInitFailed": + 'Не удалось инициализировать провайдера "{{provider}}". Проверьте учётные данные и конфигурацию.', + "error.chain.configJsonInvalid": "Конфигурационный файл по адресу {{path}} не является валидным JSON(C)", + "error.chain.configJsonInvalidWithMessage": + "Конфигурационный файл по адресу {{path}} не является валидным JSON(C): {{message}}", + "error.chain.configDirectoryTypo": + 'Папка "{{dir}}" в {{path}} невалидна. Переименуйте папку в "{{suggestion}}" или удалите её. Это распространённая опечатка.', + "error.chain.configFrontmatterError": "Не удалось разобрать frontmatter в {{path}}:\n{{message}}", + "error.chain.configInvalid": "Конфигурационный файл по адресу {{path}} невалиден", + "error.chain.configInvalidWithMessage": "Конфигурационный файл по адресу {{path}} невалиден: {{message}}", + + "notification.permission.title": "Требуется разрешение", + "notification.permission.description": "{{sessionTitle}} в {{projectName}} требуется разрешение", + "notification.question.title": "Вопрос", + "notification.question.description": "У {{sessionTitle}} в {{projectName}} есть вопрос", + "notification.action.goToSession": "Перейти к сессии", + + "notification.session.responseReady.title": "Ответ готов", + "notification.session.error.title": "Ошибка сессии", + "notification.session.error.fallbackDescription": "Произошла ошибка", + + "home.recentProjects": "Недавние проекты", + "home.empty.title": "Нет недавних проектов", + "home.empty.description": "Начните с открытия локального проекта", + + "session.tab.session": "Сессия", + "session.tab.review": "Обзор", + "session.tab.context": "Контекст", + "session.panel.reviewAndFiles": "Обзор и файлы", + "session.review.filesChanged": "{{count}} файлов изменено", + "session.review.loadingChanges": "Загрузка изменений...", + "session.review.empty": "Изменений в этой сессии пока нет", + "session.messages.renderEarlier": "Показать предыдущие сообщения", + "session.messages.loadingEarlier": "Загрузка предыдущих сообщений...", + "session.messages.loadEarlier": "Загрузить предыдущие сообщения", + "session.messages.loading": "Загрузка сообщений...", + "session.messages.jumpToLatest": "Перейти к последнему", + + "session.context.addToContext": "Добавить {{selection}} в контекст", + + "session.new.worktree.main": "Основная ветка", + "session.new.worktree.mainWithBranch": "Основная ветка ({{branch}})", + "session.new.worktree.create": "Создать новый worktree", + "session.new.lastModified": "Последнее изменение", + + "session.header.search.placeholder": "Поиск {{project}}", + "session.header.searchFiles": "Поиск файлов", + + "session.share.popover.title": "Опубликовать в интернете", + "session.share.popover.description.shared": + "Эта сессия общедоступна. Доступ к ней может получить любой, у кого есть ссылка.", + "session.share.popover.description.unshared": + "Опубликуйте сессию в интернете. Доступ к ней сможет получить любой, у кого есть ссылка.", + "session.share.action.share": "Поделиться", + "session.share.action.publish": "Опубликовать", + "session.share.action.publishing": "Публикация...", + "session.share.action.unpublish": "Отменить публикацию", + "session.share.action.unpublishing": "Отмена публикации...", + "session.share.action.view": "Посмотреть", + "session.share.copy.copied": "Скопировано", + "session.share.copy.copyLink": "Копировать ссылку", + + "lsp.tooltip.none": "Нет LSP серверов", + "lsp.label.connected": "{{count}} LSP", + + "prompt.loading": "Загрузка запроса...", + "terminal.loading": "Загрузка терминала...", + "terminal.title": "Терминал", + "terminal.title.numbered": "Терминал {{number}}", + "terminal.close": "Закрыть терминал", + "terminal.connectionLost.title": "Соединение потеряно", + "terminal.connectionLost.description": + "Соединение с терминалом прервано. Это может произойти при перезапуске сервера.", + + "common.closeTab": "Закрыть вкладку", + "common.dismiss": "Закрыть", + "common.requestFailed": "Запрос не выполнен", + "common.moreOptions": "Дополнительные опции", + "common.learnMore": "Подробнее", + "common.rename": "Переименовать", + "common.reset": "Сбросить", + "common.archive": "Архивировать", + "common.delete": "Удалить", + "common.close": "Закрыть", + "common.edit": "Редактировать", + "common.loadMore": "Загрузить ещё", + "common.key.esc": "ESC", + + "sidebar.menu.toggle": "Переключить меню", + "sidebar.nav.projectsAndSessions": "Проекты и сессии", + "sidebar.settings": "Настройки", + "sidebar.help": "Помощь", + "sidebar.workspaces.enable": "Включить рабочие пространства", + "sidebar.workspaces.disable": "Отключить рабочие пространства", + "sidebar.gettingStarted.title": "Начало работы", + "sidebar.gettingStarted.line1": "OpenCode включает бесплатные модели, чтобы вы могли начать сразу.", + "sidebar.gettingStarted.line2": + "Подключите любого провайдера для использования моделей, включая Claude, GPT, Gemini и др.", + "sidebar.project.recentSessions": "Недавние сессии", + "sidebar.project.viewAllSessions": "Посмотреть все сессии", + + "settings.section.desktop": "Приложение", + "settings.tab.general": "Основные", + "settings.tab.shortcuts": "Горячие клавиши", + + "settings.general.section.appearance": "Внешний вид", + "settings.general.section.notifications": "Системные уведомления", + "settings.general.section.sounds": "Звуковые эффекты", + + "settings.general.row.language.title": "Язык", + "settings.general.row.language.description": "Изменить язык отображения OpenCode", + "settings.general.row.appearance.title": "Внешний вид", + "settings.general.row.appearance.description": "Настройте как OpenCode выглядит на вашем устройстве", + "settings.general.row.theme.title": "Тема", + "settings.general.row.theme.description": "Настройте оформление OpenCode.", + "settings.general.row.font.title": "Шрифт", + "settings.general.row.font.description": "Настройте моноширинный шрифт для блоков кода", + "font.option.ibmPlexMono": "IBM Plex Mono", + "font.option.cascadiaCode": "Cascadia Code", + "font.option.firaCode": "Fira Code", + "font.option.hack": "Hack", + "font.option.inconsolata": "Inconsolata", + "font.option.intelOneMono": "Intel One Mono", + "font.option.jetbrainsMono": "JetBrains Mono", + "font.option.mesloLgs": "Meslo LGS", + "font.option.robotoMono": "Roboto Mono", + "font.option.sourceCodePro": "Source Code Pro", + "font.option.ubuntuMono": "Ubuntu Mono", + "sound.option.alert01": "Alert 01", + "sound.option.alert02": "Alert 02", + "sound.option.alert03": "Alert 03", + "sound.option.alert04": "Alert 04", + "sound.option.alert05": "Alert 05", + "sound.option.alert06": "Alert 06", + "sound.option.alert07": "Alert 07", + "sound.option.alert08": "Alert 08", + "sound.option.alert09": "Alert 09", + "sound.option.alert10": "Alert 10", + "sound.option.bipbop01": "Bip-bop 01", + "sound.option.bipbop02": "Bip-bop 02", + "sound.option.bipbop03": "Bip-bop 03", + "sound.option.bipbop04": "Bip-bop 04", + "sound.option.bipbop05": "Bip-bop 05", + "sound.option.bipbop06": "Bip-bop 06", + "sound.option.bipbop07": "Bip-bop 07", + "sound.option.bipbop08": "Bip-bop 08", + "sound.option.bipbop09": "Bip-bop 09", + "sound.option.bipbop10": "Bip-bop 10", + "sound.option.staplebops01": "Staplebops 01", + "sound.option.staplebops02": "Staplebops 02", + "sound.option.staplebops03": "Staplebops 03", + "sound.option.staplebops04": "Staplebops 04", + "sound.option.staplebops05": "Staplebops 05", + "sound.option.staplebops06": "Staplebops 06", + "sound.option.staplebops07": "Staplebops 07", + "sound.option.nope01": "Nope 01", + "sound.option.nope02": "Nope 02", + "sound.option.nope03": "Nope 03", + "sound.option.nope04": "Nope 04", + "sound.option.nope05": "Nope 05", + "sound.option.nope06": "Nope 06", + "sound.option.nope07": "Nope 07", + "sound.option.nope08": "Nope 08", + "sound.option.nope09": "Nope 09", + "sound.option.nope10": "Nope 10", + "sound.option.nope11": "Nope 11", + "sound.option.nope12": "Nope 12", + "sound.option.yup01": "Yup 01", + "sound.option.yup02": "Yup 02", + "sound.option.yup03": "Yup 03", + "sound.option.yup04": "Yup 04", + "sound.option.yup05": "Yup 05", + "sound.option.yup06": "Yup 06", + + "settings.general.notifications.agent.title": "Агент", + "settings.general.notifications.agent.description": + "Показывать системное уведомление когда агент завершён или требует внимания", + "settings.general.notifications.permissions.title": "Разрешения", + "settings.general.notifications.permissions.description": + "Показывать системное уведомление когда требуется разрешение", + "settings.general.notifications.errors.title": "Ошибки", + "settings.general.notifications.errors.description": "Показывать системное уведомление когда происходит ошибка", + + "settings.general.sounds.agent.title": "Агент", + "settings.general.sounds.agent.description": "Воспроизводить звук когда агент завершён или требует внимания", + "settings.general.sounds.permissions.title": "Разрешения", + "settings.general.sounds.permissions.description": "Воспроизводить звук когда требуется разрешение", + "settings.general.sounds.errors.title": "Ошибки", + "settings.general.sounds.errors.description": "Воспроизводить звук когда происходит ошибка", + + "settings.shortcuts.title": "Горячие клавиши", + "settings.shortcuts.reset.button": "Сбросить к умолчаниям", + "settings.shortcuts.reset.toast.title": "Горячие клавиши сброшены", + "settings.shortcuts.reset.toast.description": "Горячие клавиши были сброшены к значениям по умолчанию.", + "settings.shortcuts.conflict.title": "Сочетание уже используется", + "settings.shortcuts.conflict.description": "{{keybind}} уже назначено для {{titles}}.", + "settings.shortcuts.unassigned": "Не назначено", + "settings.shortcuts.pressKeys": "Нажмите клавиши", + "settings.shortcuts.search.placeholder": "Поиск горячих клавиш", + "settings.shortcuts.search.empty": "Горячие клавиши не найдены", + + "settings.shortcuts.group.general": "Основные", + "settings.shortcuts.group.session": "Сессия", + "settings.shortcuts.group.navigation": "Навигация", + "settings.shortcuts.group.modelAndAgent": "Модель и агент", + "settings.shortcuts.group.terminal": "Терминал", + "settings.shortcuts.group.prompt": "Запрос", + + "settings.providers.title": "Провайдеры", + "settings.providers.description": "Настройки провайдеров будут доступны здесь.", + "settings.models.title": "Модели", + "settings.models.description": "Настройки моделей будут доступны здесь.", + "settings.agents.title": "Агенты", + "settings.agents.description": "Настройки агентов будут доступны здесь.", + "settings.commands.title": "Команды", + "settings.commands.description": "Настройки команд будут доступны здесь.", + "settings.mcp.title": "MCP", + "settings.mcp.description": "Настройки MCP будут доступны здесь.", + + "settings.permissions.title": "Разрешения", + "settings.permissions.description": "Контролируйте какие инструменты сервер может использовать по умолчанию.", + "settings.permissions.section.tools": "Инструменты", + "settings.permissions.toast.updateFailed.title": "Не удалось обновить разрешения", + + "settings.permissions.action.allow": "Разрешить", + "settings.permissions.action.ask": "Спрашивать", + "settings.permissions.action.deny": "Запретить", + + "settings.permissions.tool.read.title": "Чтение", + "settings.permissions.tool.read.description": "Чтение файла (по совпадению пути)", + "settings.permissions.tool.edit.title": "Редактирование", + "settings.permissions.tool.edit.description": + "Изменение файлов, включая редактирование, запись, патчи и мульти-редактирование", + "settings.permissions.tool.glob.title": "Glob", + "settings.permissions.tool.glob.description": "Сопоставление файлов по паттернам glob", + "settings.permissions.tool.grep.title": "Grep", + "settings.permissions.tool.grep.description": "Поиск по содержимому файлов с использованием регулярных выражений", + "settings.permissions.tool.list.title": "Список", + "settings.permissions.tool.list.description": "Список файлов в директории", + "settings.permissions.tool.bash.title": "Bash", + "settings.permissions.tool.bash.description": "Выполнение команд оболочки", + "settings.permissions.tool.task.title": "Task", + "settings.permissions.tool.task.description": "Запуск под-агентов", + "settings.permissions.tool.skill.title": "Skill", + "settings.permissions.tool.skill.description": "Загрузить навык по имени", + "settings.permissions.tool.lsp.title": "LSP", + "settings.permissions.tool.lsp.description": "Выполнение запросов к языковому серверу", + "settings.permissions.tool.todoread.title": "Чтение списка задач", + "settings.permissions.tool.todoread.description": "Чтение списка задач", + "settings.permissions.tool.todowrite.title": "Запись списка задач", + "settings.permissions.tool.todowrite.description": "Обновление списка задач", + "settings.permissions.tool.webfetch.title": "Web Fetch", + "settings.permissions.tool.webfetch.description": "Получить содержимое по URL", + "settings.permissions.tool.websearch.title": "Web Search", + "settings.permissions.tool.websearch.description": "Поиск в интернете", + "settings.permissions.tool.codesearch.title": "Поиск кода", + "settings.permissions.tool.codesearch.description": "Поиск кода в интернете", + "settings.permissions.tool.external_directory.title": "Внешняя директория", + "settings.permissions.tool.external_directory.description": "Доступ к файлам вне директории проекта", + "settings.permissions.tool.doom_loop.title": "Doom Loop", + "settings.permissions.tool.doom_loop.description": "Обнаружение повторных вызовов инструментов с одинаковым вводом", + + "session.delete.failed.title": "Не удалось удалить сессию", + "session.delete.title": "Удалить сессию", + "session.delete.confirm": 'Удалить сессию "{{name}}"?', + "session.delete.button": "Удалить сессию", + + "workspace.new": "Новое рабочее пространство", + "workspace.type.local": "локальное", + "workspace.type.sandbox": "песочница", + "workspace.create.failed.title": "Не удалось создать рабочее пространство", + "workspace.delete.failed.title": "Не удалось удалить рабочее пространство", + "workspace.resetting.title": "Сброс рабочего пространства", + "workspace.resetting.description": "Это может занять минуту.", + "workspace.reset.failed.title": "Не удалось сбросить рабочее пространство", + "workspace.reset.success.title": "Рабочее пространство сброшено", + "workspace.reset.success.description": "Рабочее пространство теперь соответствует ветке по умолчанию.", + "workspace.status.checking": "Проверка наличия неслитых изменений...", + "workspace.status.error": "Не удалось проверить статус git.", + "workspace.status.clean": "Неслитые изменения не обнаружены.", + "workspace.status.dirty": "Обнаружены неслитые изменения в этом рабочем пространстве.", + "workspace.delete.title": "Удалить рабочее пространство", + "workspace.delete.confirm": 'Удалить рабочее пространство "{{name}}"?', + "workspace.delete.button": "Удалить рабочее пространство", + "workspace.reset.title": "Сбросить рабочее пространство", + "workspace.reset.confirm": 'Сбросить рабочее пространство "{{name}}"?', + "workspace.reset.button": "Сбросить рабочее пространство", + "workspace.reset.archived.none": "Никакие активные сессии не будут архивированы.", + "workspace.reset.archived.one": "1 сессия будет архивирована.", + "workspace.reset.archived.many": "{{count}} сессий будет архивировано.", + "workspace.reset.note": "Рабочее пространство будет сброшено в соответствие с веткой по умолчанию.", +} diff --git a/packages/app/src/i18n/zh.ts b/packages/app/src/i18n/zh.ts new file mode 100644 index 00000000000..079c96baafb --- /dev/null +++ b/packages/app/src/i18n/zh.ts @@ -0,0 +1,572 @@ +import { dict as en } from "./en" + +type Keys = keyof typeof en + +export const dict = { + "command.category.suggested": "建议", + "command.category.view": "视图", + "command.category.project": "项目", + "command.category.provider": "提供商", + "command.category.server": "服务器", + "command.category.session": "会话", + "command.category.theme": "主题", + "command.category.language": "语言", + "command.category.file": "文件", + "command.category.terminal": "终端", + "command.category.model": "模型", + "command.category.mcp": "MCP", + "command.category.agent": "智能体", + "command.category.permissions": "权限", + "command.category.workspace": "工作区", + + "theme.scheme.system": "系统", + "theme.scheme.light": "浅色", + "theme.scheme.dark": "深色", + + "command.sidebar.toggle": "切换侧边栏", + "command.project.open": "打开项目", + "command.provider.connect": "连接提供商", + "command.server.switch": "切换服务器", + "command.session.previous": "上一个会话", + "command.session.next": "下一个会话", + "command.session.archive": "归档会话", + + "command.palette": "命令面板", + + "command.theme.cycle": "切换主题", + "command.theme.set": "使用主题: {{theme}}", + "command.theme.scheme.cycle": "切换配色方案", + "command.theme.scheme.set": "使用配色方案: {{scheme}}", + + "command.language.cycle": "切换语言", + "command.language.set": "使用语言: {{language}}", + + "command.session.new": "新建会话", + "command.file.open": "打开文件", + "command.file.open.description": "搜索文件和命令", + "command.terminal.toggle": "切换终端", + "command.review.toggle": "切换审查", + "command.terminal.new": "新建终端", + "command.terminal.new.description": "创建新的终端标签页", + "command.steps.toggle": "切换步骤", + "command.steps.toggle.description": "显示或隐藏当前消息的步骤", + "command.message.previous": "上一条消息", + "command.message.previous.description": "跳转到上一条用户消息", + "command.message.next": "下一条消息", + "command.message.next.description": "跳转到下一条用户消息", + "command.model.choose": "选择模型", + "command.model.choose.description": "选择不同的模型", + "command.mcp.toggle": "切换 MCPs", + "command.mcp.toggle.description": "切换 MCPs", + "command.agent.cycle": "切换智能体", + "command.agent.cycle.description": "切换到下一个智能体", + "command.agent.cycle.reverse": "反向切换智能体", + "command.agent.cycle.reverse.description": "切换到上一个智能体", + "command.model.variant.cycle": "切换思考强度", + "command.model.variant.cycle.description": "切换到下一个强度等级", + "command.permissions.autoaccept.enable": "自动接受编辑", + "command.permissions.autoaccept.disable": "停止自动接受编辑", + "command.session.undo": "撤销", + "command.session.undo.description": "撤销上一条消息", + "command.session.redo": "重做", + "command.session.redo.description": "重做上一条撤销的消息", + "command.session.compact": "精简会话", + "command.session.compact.description": "总结会话以减少上下文大小", + "command.session.fork": "从消息分叉", + "command.session.fork.description": "从之前的消息创建新会话", + "command.session.share": "分享会话", + "command.session.share.description": "分享此会话并将链接复制到剪贴板", + "command.session.unshare": "取消分享会话", + "command.session.unshare.description": "停止分享此会话", + + "palette.search.placeholder": "搜索文件和命令", + "palette.empty": "未找到结果", + "palette.group.commands": "命令", + "palette.group.files": "文件", + + "dialog.provider.search.placeholder": "搜索提供商", + "dialog.provider.empty": "未找到提供商", + "dialog.provider.group.popular": "热门", + "dialog.provider.group.other": "其他", + "dialog.provider.tag.recommended": "推荐", + "dialog.provider.anthropic.note": "使用 Claude Pro/Max 或 API 密钥连接", + + "dialog.model.select.title": "选择模型", + "dialog.model.search.placeholder": "搜索模型", + "dialog.model.empty": "未找到模型", + "dialog.model.manage": "管理模型", + "dialog.model.manage.description": "自定义模型选择器中显示的模型。", + + "dialog.model.unpaid.freeModels.title": "OpenCode 提供的免费模型", + "dialog.model.unpaid.addMore.title": "从热门提供商添加更多模型", + + "dialog.provider.viewAll": "查看全部提供商", + + "provider.connect.title": "连接 {{provider}}", + "provider.connect.title.anthropicProMax": "使用 Claude Pro/Max 登录", + "provider.connect.selectMethod": "选择 {{provider}} 的登录方式。", + "provider.connect.method.apiKey": "API 密钥", + "provider.connect.status.inProgress": "正在授权...", + "provider.connect.status.waiting": "等待授权...", + "provider.connect.status.failed": "授权失败: {{error}}", + "provider.connect.apiKey.description": + "输入你的 {{provider}} API 密钥以连接帐户,并在 OpenCode 中使用 {{provider}} 模型。", + "provider.connect.apiKey.label": "{{provider}} API 密钥", + "provider.connect.apiKey.placeholder": "API 密钥", + "provider.connect.apiKey.required": "API 密钥为必填项", + "provider.connect.opencodeZen.line1": "OpenCode Zen 为你提供一组精选的可靠优化模型,用于代码智能体。", + "provider.connect.opencodeZen.line2": "只需一个 API 密钥,你就能使用 Claude、GPT、Gemini、GLM 等模型。", + "provider.connect.opencodeZen.visit.prefix": "访问 ", + "provider.connect.opencodeZen.visit.suffix": " 获取你的 API 密钥。", + "provider.connect.oauth.code.visit.prefix": "访问 ", + "provider.connect.oauth.code.visit.link": "此链接", + "provider.connect.oauth.code.visit.suffix": " 获取授权码,以连接你的帐户并在 OpenCode 中使用 {{provider}} 模型。", + "provider.connect.oauth.code.label": "{{method}} 授权码", + "provider.connect.oauth.code.placeholder": "授权码", + "provider.connect.oauth.code.required": "授权码为必填项", + "provider.connect.oauth.code.invalid": "授权码无效", + "provider.connect.oauth.auto.visit.prefix": "访问 ", + "provider.connect.oauth.auto.visit.link": "此链接", + "provider.connect.oauth.auto.visit.suffix": " 并输入以下代码,以连接你的帐户并在 OpenCode 中使用 {{provider}} 模型。", + "provider.connect.oauth.auto.confirmationCode": "确认码", + "provider.connect.toast.connected.title": "{{provider}} 已连接", + "provider.connect.toast.connected.description": "现在可以使用 {{provider}} 模型了。", + + "model.tag.free": "免费", + "model.tag.latest": "最新", + + "common.search.placeholder": "搜索", + "common.goBack": "返回", + "common.loading": "加载中", + "common.cancel": "取消", + "common.submit": "提交", + "common.save": "保存", + "common.saving": "保存中...", + "common.default": "默认", + "common.attachment": "附件", + + "prompt.placeholder.shell": "输入 shell 命令...", + "prompt.placeholder.normal": '随便问点什么... "{{example}}"', + "prompt.mode.shell": "Shell", + "prompt.mode.shell.exit": "按 esc 退出", + + "prompt.example.1": "修复代码库中的一个 TODO", + "prompt.example.2": "这个项目的技术栈是什么?", + "prompt.example.3": "修复失败的测试", + "prompt.example.4": "解释认证是如何工作的", + "prompt.example.5": "查找并修复安全漏洞", + "prompt.example.6": "为用户服务添加单元测试", + "prompt.example.7": "重构这个函数,让它更易读", + "prompt.example.8": "这个错误是什么意思?", + "prompt.example.9": "帮我调试这个问题", + "prompt.example.10": "生成 API 文档", + "prompt.example.11": "优化数据库查询", + "prompt.example.12": "添加输入校验", + "prompt.example.13": "创建一个新的组件用于...", + "prompt.example.14": "我该如何部署这个项目?", + "prompt.example.15": "审查我的代码并给出最佳实践建议", + "prompt.example.16": "为这个函数添加错误处理", + "prompt.example.17": "解释这个正则表达式", + "prompt.example.18": "把它转换成 TypeScript", + "prompt.example.19": "在整个代码库中添加日志", + "prompt.example.20": "哪些依赖已经过期?", + "prompt.example.21": "帮我写一个迁移脚本", + "prompt.example.22": "为这个接口实现缓存", + "prompt.example.23": "给这个列表添加分页", + "prompt.example.24": "创建一个 CLI 命令用于...", + "prompt.example.25": "这里的环境变量是怎么工作的?", + + "prompt.popover.emptyResults": "没有匹配的结果", + "prompt.popover.emptyCommands": "没有匹配的命令", + "prompt.dropzone.label": "将图片或 PDF 拖到这里", + "prompt.slash.badge.custom": "自定义", + "prompt.context.active": "当前", + "prompt.context.includeActiveFile": "包含当前文件", + "prompt.context.removeActiveFile": "从上下文移除活动文件", + "prompt.context.removeFile": "从上下文移除文件", + "prompt.action.attachFile": "附加文件", + "prompt.attachment.remove": "移除附件", + "prompt.action.send": "发送", + "prompt.action.stop": "停止", + + "prompt.toast.pasteUnsupported.title": "不支持的粘贴", + "prompt.toast.pasteUnsupported.description": "这里只能粘贴图片或 PDF 文件。", + "prompt.toast.modelAgentRequired.title": "请选择智能体和模型", + "prompt.toast.modelAgentRequired.description": "发送提示前请先选择智能体和模型。", + "prompt.toast.worktreeCreateFailed.title": "创建工作树失败", + "prompt.toast.sessionCreateFailed.title": "创建会话失败", + "prompt.toast.shellSendFailed.title": "发送 shell 命令失败", + "prompt.toast.commandSendFailed.title": "发送命令失败", + "prompt.toast.promptSendFailed.title": "发送提示失败", + + "dialog.mcp.title": "MCPs", + "dialog.mcp.description": "已启用 {{enabled}} / {{total}}", + "dialog.mcp.empty": "未配置 MCPs", + + "mcp.status.connected": "已连接", + "mcp.status.failed": "失败", + "mcp.status.needs_auth": "需要授权", + "mcp.status.disabled": "已禁用", + + "dialog.fork.empty": "没有可用于分叉的消息", + + "dialog.directory.search.placeholder": "搜索文件夹", + "dialog.directory.empty": "未找到文件夹", + + "dialog.server.title": "服务器", + "dialog.server.description": "切换此应用连接的 OpenCode 服务器。", + "dialog.server.search.placeholder": "搜索服务器", + "dialog.server.empty": "暂无服务器", + "dialog.server.add.title": "添加服务器", + "dialog.server.add.url": "服务器 URL", + "dialog.server.add.placeholder": "http://localhost:4096", + "dialog.server.add.error": "无法连接到服务器", + "dialog.server.add.checking": "检查中...", + "dialog.server.add.button": "添加", + "dialog.server.default.title": "默认服务器", + "dialog.server.default.description": "应用启动时连接此服务器,而不是启动本地服务器。需要重启。", + "dialog.server.default.none": "未选择服务器", + "dialog.server.default.set": "将当前服务器设为默认", + "dialog.server.default.clear": "清除", + "dialog.server.action.remove": "移除服务器", + + "dialog.project.edit.title": "编辑项目", + "dialog.project.edit.name": "名称", + "dialog.project.edit.icon": "图标", + "dialog.project.edit.icon.alt": "项目图标", + "dialog.project.edit.icon.hint": "点击或拖拽图片", + "dialog.project.edit.icon.recommended": "建议:128x128px", + "dialog.project.edit.color": "颜色", + "dialog.project.edit.color.select": "选择{{color}}颜色", + + "context.breakdown.title": "上下文拆分", + "context.breakdown.note": "输入 token 的大致拆分。“其他”包含工具定义和开销。", + "context.breakdown.system": "系统", + "context.breakdown.user": "用户", + "context.breakdown.assistant": "助手", + "context.breakdown.tool": "工具调用", + "context.breakdown.other": "其他", + + "context.systemPrompt.title": "系统提示词", + "context.rawMessages.title": "原始消息", + + "context.stats.session": "会话", + "context.stats.messages": "消息数", + "context.stats.provider": "提供商", + "context.stats.model": "模型", + "context.stats.limit": "上下文限制", + "context.stats.totalTokens": "总 token", + "context.stats.usage": "使用率", + "context.stats.inputTokens": "输入 token", + "context.stats.outputTokens": "输出 token", + "context.stats.reasoningTokens": "推理 token", + "context.stats.cacheTokens": "缓存 token(读/写)", + "context.stats.userMessages": "用户消息", + "context.stats.assistantMessages": "助手消息", + "context.stats.totalCost": "总成本", + "context.stats.sessionCreated": "创建时间", + "context.stats.lastActivity": "最后活动", + + "context.usage.tokens": "Token", + "context.usage.usage": "使用率", + "context.usage.cost": "成本", + "context.usage.clickToView": "点击查看上下文", + "context.usage.view": "查看上下文用量", + + "language.en": "英语", + "language.zh": "简体中文", + "language.zht": "繁体中文", + "language.ko": "韩语", + "language.de": "德语", + "language.es": "西班牙语", + "language.fr": "法语", + "language.ja": "日语", + "language.da": "丹麦语", + "language.ru": "俄语", + "language.pl": "波兰语", + "language.ar": "阿拉伯语", + "language.no": "挪威语", + "language.br": "葡萄牙语(巴西)", + + "toast.language.title": "语言", + "toast.language.description": "已切换到{{language}}", + + "toast.theme.title": "主题已切换", + "toast.scheme.title": "配色方案", + + "toast.permissions.autoaccept.on.title": "自动接受编辑", + "toast.permissions.autoaccept.on.description": "编辑和写入权限将自动获批", + "toast.permissions.autoaccept.off.title": "已停止自动接受编辑", + "toast.permissions.autoaccept.off.description": "编辑和写入权限将需要手动批准", + + "toast.model.none.title": "未选择模型", + "toast.model.none.description": "请先连接提供商以总结此会话", + + "toast.file.loadFailed.title": "加载文件失败", + + "toast.session.share.copyFailed.title": "无法复制链接到剪贴板", + "toast.session.share.success.title": "会话已分享", + "toast.session.share.success.description": "分享链接已复制到剪贴板", + "toast.session.share.failed.title": "分享会话失败", + "toast.session.share.failed.description": "分享会话时发生错误", + + "toast.session.unshare.success.title": "已取消分享会话", + "toast.session.unshare.success.description": "会话已成功取消分享", + "toast.session.unshare.failed.title": "取消分享失败", + "toast.session.unshare.failed.description": "取消分享会话时发生错误", + + "toast.session.listFailed.title": "无法加载 {{project}} 的会话", + + "toast.update.title": "有可用更新", + "toast.update.description": "OpenCode 有新版本 ({{version}}) 可安装。", + "toast.update.action.installRestart": "安装并重启", + "toast.update.action.notYet": "稍后", + + "error.page.title": "出了点问题", + "error.page.description": "加载应用程序时发生错误。", + "error.page.details.label": "错误详情", + "error.page.action.restart": "重启", + "error.page.action.checking": "检查中...", + "error.page.action.checkUpdates": "检查更新", + "error.page.action.updateTo": "更新到 {{version}}", + "error.page.report.prefix": "请将此错误报告给 OpenCode 团队", + "error.page.report.discord": "在 Discord 上", + "error.page.version": "版本: {{version}}", + + "error.dev.rootNotFound": "未找到根元素。你是不是忘了把它添加到 index.html? 或者 id 属性拼写错了?", + + "error.globalSync.connectFailed": "无法连接到服务器。是否有服务器正在 `{{url}}` 运行?", + + "error.chain.unknown": "未知错误", + "error.chain.causedBy": "原因:", + "error.chain.apiError": "API 错误", + "error.chain.status": "状态: {{status}}", + "error.chain.retryable": "可重试: {{retryable}}", + "error.chain.responseBody": "响应内容:\n{{body}}", + "error.chain.didYouMean": "你是不是想输入: {{suggestions}}", + "error.chain.modelNotFound": "未找到模型: {{provider}}/{{model}}", + "error.chain.checkConfig": "请检查你的配置 (opencode.json) 中的 provider/model 名称", + "error.chain.mcpFailed": 'MCP 服务器 "{{name}}" 启动失败。注意: OpenCode 暂不支持 MCP 认证。', + "error.chain.providerAuthFailed": "提供商认证失败 ({{provider}}): {{message}}", + "error.chain.providerInitFailed": '无法初始化提供商 "{{provider}}"。请检查凭据和配置。', + "error.chain.configJsonInvalid": "配置文件 {{path}} 不是有效的 JSON(C)", + "error.chain.configJsonInvalidWithMessage": "配置文件 {{path}} 不是有效的 JSON(C): {{message}}", + "error.chain.configDirectoryTypo": + '{{path}} 中的目录 "{{dir}}" 无效。请将目录重命名为 "{{suggestion}}" 或移除它。这是一个常见拼写错误。', + "error.chain.configFrontmatterError": "无法解析 {{path}} 中的 frontmatter:\n{{message}}", + "error.chain.configInvalid": "配置文件 {{path}} 无效", + "error.chain.configInvalidWithMessage": "配置文件 {{path}} 无效: {{message}}", + + "notification.permission.title": "需要权限", + "notification.permission.description": "{{sessionTitle}}({{projectName}})需要权限", + "notification.question.title": "问题", + "notification.question.description": "{{sessionTitle}}({{projectName}})有一个问题", + "notification.action.goToSession": "前往会话", + + "notification.session.responseReady.title": "回复已就绪", + "notification.session.error.title": "会话错误", + "notification.session.error.fallbackDescription": "发生错误", + + "home.recentProjects": "最近项目", + "home.empty.title": "没有最近项目", + "home.empty.description": "通过打开本地项目开始使用", + + "session.tab.session": "会话", + "session.tab.review": "审查", + "session.tab.context": "上下文", + "session.panel.reviewAndFiles": "审查和文件", + "session.review.filesChanged": "{{count}} 个文件变更", + "session.review.loadingChanges": "正在加载更改...", + "session.review.empty": "此会话暂无更改", + "session.messages.renderEarlier": "显示更早的消息", + "session.messages.loadingEarlier": "正在加载更早的消息...", + "session.messages.loadEarlier": "加载更早的消息", + "session.messages.loading": "正在加载消息...", + + "session.context.addToContext": "将 {{selection}} 添加到上下文", + + "session.new.worktree.main": "主分支", + "session.new.worktree.mainWithBranch": "主分支 ({{branch}})", + "session.new.worktree.create": "创建新的 worktree", + "session.new.lastModified": "最后修改", + + "session.header.search.placeholder": "搜索 {{project}}", + "session.header.searchFiles": "搜索文件", + + "session.share.popover.title": "发布到网页", + "session.share.popover.description.shared": "此会话已在网页上公开。任何拥有链接的人都可以访问。", + "session.share.popover.description.unshared": "在网页上公开分享此会话。任何拥有链接的人都可以访问。", + "session.share.action.share": "分享", + "session.share.action.publish": "发布", + "session.share.action.publishing": "正在发布...", + "session.share.action.unpublish": "取消发布", + "session.share.action.unpublishing": "正在取消发布...", + "session.share.action.view": "查看", + "session.share.copy.copied": "已复制", + "session.share.copy.copyLink": "复制链接", + + "lsp.tooltip.none": "没有 LSP 服务器", + "lsp.label.connected": "{{count}} LSP", + + "prompt.loading": "正在加载提示...", + "terminal.loading": "正在加载终端...", + "terminal.title": "终端", + "terminal.title.numbered": "终端 {{number}}", + "terminal.close": "关闭终端", + + "common.closeTab": "关闭标签页", + "common.dismiss": "忽略", + "common.requestFailed": "请求失败", + "common.moreOptions": "更多选项", + "common.learnMore": "了解更多", + "common.rename": "重命名", + "common.reset": "重置", + "common.archive": "归档", + "common.delete": "删除", + "common.close": "关闭", + "common.edit": "编辑", + "common.loadMore": "加载更多", + + "sidebar.nav.projectsAndSessions": "项目和会话", + "sidebar.settings": "设置", + "sidebar.help": "帮助", + "sidebar.workspaces.enable": "启用工作区", + "sidebar.workspaces.disable": "禁用工作区", + "sidebar.gettingStarted.title": "入门", + "sidebar.gettingStarted.line1": "OpenCode 提供免费模型,你可以立即开始使用。", + "sidebar.gettingStarted.line2": "连接任意提供商即可使用更多模型,如 Claude、GPT、Gemini 等。", + "sidebar.project.recentSessions": "最近会话", + "sidebar.project.viewAllSessions": "查看全部会话", + + "settings.section.desktop": "桌面", + "settings.tab.general": "通用", + "settings.tab.shortcuts": "快捷键", + + "settings.general.section.appearance": "外观", + "settings.general.section.notifications": "系统通知", + "settings.general.section.sounds": "音效", + + "settings.general.row.language.title": "语言", + "settings.general.row.language.description": "更改 OpenCode 的显示语言", + "settings.general.row.appearance.title": "外观", + "settings.general.row.appearance.description": "自定义 OpenCode 在你的设备上的外观", + "settings.general.row.theme.title": "主题", + "settings.general.row.theme.description": "自定义 OpenCode 的主题。", + "settings.general.row.font.title": "字体", + "settings.general.row.font.description": "自定义代码块使用的等宽字体", + + "settings.general.notifications.agent.title": "智能体", + "settings.general.notifications.agent.description": "当智能体完成或需要注意时显示系统通知", + "settings.general.notifications.permissions.title": "权限", + "settings.general.notifications.permissions.description": "当需要权限时显示系统通知", + "settings.general.notifications.errors.title": "错误", + "settings.general.notifications.errors.description": "发生错误时显示系统通知", + + "settings.general.sounds.agent.title": "智能体", + "settings.general.sounds.agent.description": "当智能体完成或需要注意时播放声音", + "settings.general.sounds.permissions.title": "权限", + "settings.general.sounds.permissions.description": "当需要权限时播放声音", + "settings.general.sounds.errors.title": "错误", + "settings.general.sounds.errors.description": "发生错误时播放声音", + + "settings.shortcuts.title": "键盘快捷键", + "settings.shortcuts.reset.button": "重置为默认值", + "settings.shortcuts.reset.toast.title": "快捷键已重置", + "settings.shortcuts.reset.toast.description": "键盘快捷键已重置为默认设置。", + "settings.shortcuts.conflict.title": "快捷键已被占用", + "settings.shortcuts.conflict.description": "{{keybind}} 已分配给 {{titles}}。", + "settings.shortcuts.unassigned": "未设置", + "settings.shortcuts.pressKeys": "按下按键", + "settings.shortcuts.search.placeholder": "搜索快捷键", + "settings.shortcuts.search.empty": "未找到快捷键", + + "settings.shortcuts.group.general": "通用", + "settings.shortcuts.group.session": "会话", + "settings.shortcuts.group.navigation": "导航", + "settings.shortcuts.group.modelAndAgent": "模型与智能体", + "settings.shortcuts.group.terminal": "终端", + "settings.shortcuts.group.prompt": "提示", + + "settings.providers.title": "提供商", + "settings.providers.description": "提供商设置将在此处可配置。", + "settings.models.title": "模型", + "settings.models.description": "模型设置将在此处可配置。", + "settings.agents.title": "智能体", + "settings.agents.description": "智能体设置将在此处可配置。", + "settings.commands.title": "命令", + "settings.commands.description": "命令设置将在此处可配置。", + "settings.mcp.title": "MCP", + "settings.mcp.description": "MCP 设置将在此处可配置。", + + "settings.permissions.title": "权限", + "settings.permissions.description": "控制服务器默认可以使用哪些工具。", + "settings.permissions.section.tools": "工具", + "settings.permissions.toast.updateFailed.title": "更新权限失败", + + "settings.permissions.action.allow": "允许", + "settings.permissions.action.ask": "询问", + "settings.permissions.action.deny": "拒绝", + + "settings.permissions.tool.read.title": "读取", + "settings.permissions.tool.read.description": "读取文件(匹配文件路径)", + "settings.permissions.tool.edit.title": "编辑", + "settings.permissions.tool.edit.description": "修改文件,包括编辑、写入、补丁和多重编辑", + "settings.permissions.tool.glob.title": "Glob", + "settings.permissions.tool.glob.description": "使用 glob 模式匹配文件", + "settings.permissions.tool.grep.title": "Grep", + "settings.permissions.tool.grep.description": "使用正则表达式搜索文件内容", + "settings.permissions.tool.list.title": "列表", + "settings.permissions.tool.list.description": "列出目录中的文件", + "settings.permissions.tool.bash.title": "Bash", + "settings.permissions.tool.bash.description": "运行 shell 命令", + "settings.permissions.tool.task.title": "Task", + "settings.permissions.tool.task.description": "启动子智能体", + "settings.permissions.tool.skill.title": "Skill", + "settings.permissions.tool.skill.description": "按名称加载技能", + "settings.permissions.tool.lsp.title": "LSP", + "settings.permissions.tool.lsp.description": "运行语言服务器查询", + "settings.permissions.tool.todoread.title": "读取待办", + "settings.permissions.tool.todoread.description": "读取待办列表", + "settings.permissions.tool.todowrite.title": "更新待办", + "settings.permissions.tool.todowrite.description": "更新待办列表", + "settings.permissions.tool.webfetch.title": "Web Fetch", + "settings.permissions.tool.webfetch.description": "从 URL 获取内容", + "settings.permissions.tool.websearch.title": "Web Search", + "settings.permissions.tool.websearch.description": "搜索网页", + "settings.permissions.tool.codesearch.title": "Code Search", + "settings.permissions.tool.codesearch.description": "在网上搜索代码", + "settings.permissions.tool.external_directory.title": "外部目录", + "settings.permissions.tool.external_directory.description": "访问项目目录之外的文件", + "settings.permissions.tool.doom_loop.title": "Doom Loop", + "settings.permissions.tool.doom_loop.description": "检测具有相同输入的重复工具调用", + + "session.delete.failed.title": "删除会话失败", + "session.delete.title": "删除会话", + "session.delete.confirm": '删除会话 "{{name}}"?', + "session.delete.button": "删除会话", + + "workspace.new": "新建工作区", + "workspace.type.local": "本地", + "workspace.type.sandbox": "沙盒", + "workspace.create.failed.title": "创建工作区失败", + "workspace.delete.failed.title": "删除工作区失败", + "workspace.resetting.title": "正在重置工作区", + "workspace.resetting.description": "这可能需要一点时间。", + "workspace.reset.failed.title": "重置工作区失败", + "workspace.reset.success.title": "工作区已重置", + "workspace.reset.success.description": "工作区已与默认分支保持一致。", + "workspace.status.checking": "正在检查未合并的更改...", + "workspace.status.error": "无法验证 git 状态。", + "workspace.status.clean": "未检测到未合并的更改。", + "workspace.status.dirty": "检测到未合并的更改。", + "workspace.delete.title": "删除工作区", + "workspace.delete.confirm": '删除工作区 "{{name}}"?', + "workspace.delete.button": "删除工作区", + "workspace.reset.title": "重置工作区", + "workspace.reset.confirm": '重置工作区 "{{name}}"?', + "workspace.reset.button": "重置工作区", + "workspace.reset.archived.none": "不会归档任何活跃会话。", + "workspace.reset.archived.one": "将归档 1 个会话。", + "workspace.reset.archived.many": "将归档 {{count}} 个会话。", + "workspace.reset.note": "这将把工作区重置为与默认分支一致。", +} satisfies Partial> diff --git a/packages/app/src/i18n/zht.ts b/packages/app/src/i18n/zht.ts new file mode 100644 index 00000000000..35b25dd1dc2 --- /dev/null +++ b/packages/app/src/i18n/zht.ts @@ -0,0 +1,568 @@ +import { dict as en } from "./en" + +type Keys = keyof typeof en + +export const dict = { + "command.category.suggested": "建議", + "command.category.view": "檢視", + "command.category.project": "專案", + "command.category.provider": "提供者", + "command.category.server": "伺服器", + "command.category.session": "工作階段", + "command.category.theme": "主題", + "command.category.language": "語言", + "command.category.file": "檔案", + "command.category.terminal": "終端機", + "command.category.model": "模型", + "command.category.mcp": "MCP", + "command.category.agent": "代理程式", + "command.category.permissions": "權限", + "command.category.workspace": "工作區", + + "theme.scheme.system": "系統", + "theme.scheme.light": "淺色", + "theme.scheme.dark": "深色", + + "command.sidebar.toggle": "切換側邊欄", + "command.project.open": "開啟專案", + "command.provider.connect": "連接提供者", + "command.server.switch": "切換伺服器", + "command.session.previous": "上一個工作階段", + "command.session.next": "下一個工作階段", + "command.session.archive": "封存工作階段", + + "command.palette": "命令面板", + + "command.theme.cycle": "循環主題", + "command.theme.set": "使用主題: {{theme}}", + "command.theme.scheme.cycle": "循環配色方案", + "command.theme.scheme.set": "使用配色方案: {{scheme}}", + + "command.language.cycle": "循環語言", + "command.language.set": "使用語言: {{language}}", + + "command.session.new": "新增工作階段", + "command.file.open": "開啟檔案", + "command.file.open.description": "搜尋檔案和命令", + "command.terminal.toggle": "切換終端機", + "command.review.toggle": "切換審查", + "command.terminal.new": "新增終端機", + "command.terminal.new.description": "建立新的終端機標籤頁", + "command.steps.toggle": "切換步驟", + "command.steps.toggle.description": "顯示或隱藏目前訊息的步驟", + "command.message.previous": "上一則訊息", + "command.message.previous.description": "跳到上一則使用者訊息", + "command.message.next": "下一則訊息", + "command.message.next.description": "跳到下一則使用者訊息", + "command.model.choose": "選擇模型", + "command.model.choose.description": "選擇不同的模型", + "command.mcp.toggle": "切換 MCP", + "command.mcp.toggle.description": "切換 MCP", + "command.agent.cycle": "循環代理程式", + "command.agent.cycle.description": "切換到下一個代理程式", + "command.agent.cycle.reverse": "反向循環代理程式", + "command.agent.cycle.reverse.description": "切換到上一個代理程式", + "command.model.variant.cycle": "循環思考強度", + "command.model.variant.cycle.description": "切換到下一個強度等級", + "command.permissions.autoaccept.enable": "自動接受編輯", + "command.permissions.autoaccept.disable": "停止自動接受編輯", + "command.session.undo": "復原", + "command.session.undo.description": "復原上一則訊息", + "command.session.redo": "重做", + "command.session.redo.description": "重做上一則復原的訊息", + "command.session.compact": "精簡工作階段", + "command.session.compact.description": "總結工作階段以減少上下文大小", + "command.session.fork": "從訊息分支", + "command.session.fork.description": "從先前的訊息建立新工作階段", + "command.session.share": "分享工作階段", + "command.session.share.description": "分享此工作階段並將連結複製到剪貼簿", + "command.session.unshare": "取消分享工作階段", + "command.session.unshare.description": "停止分享此工作階段", + + "palette.search.placeholder": "搜尋檔案和命令", + "palette.empty": "找不到結果", + "palette.group.commands": "命令", + "palette.group.files": "檔案", + + "dialog.provider.search.placeholder": "搜尋提供者", + "dialog.provider.empty": "找不到提供者", + "dialog.provider.group.popular": "熱門", + "dialog.provider.group.other": "其他", + "dialog.provider.tag.recommended": "推薦", + "dialog.provider.anthropic.note": "使用 Claude Pro/Max 或 API 金鑰連線", + + "dialog.model.select.title": "選擇模型", + "dialog.model.search.placeholder": "搜尋模型", + "dialog.model.empty": "找不到模型", + "dialog.model.manage": "管理模型", + "dialog.model.manage.description": "自訂模型選擇器中顯示的模型。", + + "dialog.model.unpaid.freeModels.title": "OpenCode 提供的免費模型", + "dialog.model.unpaid.addMore.title": "從熱門提供者新增更多模型", + + "dialog.provider.viewAll": "查看全部提供者", + + "provider.connect.title": "連線 {{provider}}", + "provider.connect.title.anthropicProMax": "使用 Claude Pro/Max 登入", + "provider.connect.selectMethod": "選擇 {{provider}} 的登入方式。", + "provider.connect.method.apiKey": "API 金鑰", + "provider.connect.status.inProgress": "正在授權...", + "provider.connect.status.waiting": "等待授權...", + "provider.connect.status.failed": "授權失敗: {{error}}", + "provider.connect.apiKey.description": + "輸入你的 {{provider}} API 金鑰以連線帳戶,並在 OpenCode 中使用 {{provider}} 模型。", + "provider.connect.apiKey.label": "{{provider}} API 金鑰", + "provider.connect.apiKey.placeholder": "API 金鑰", + "provider.connect.apiKey.required": "API 金鑰為必填", + "provider.connect.opencodeZen.line1": "OpenCode Zen 為你提供一組精選的可靠最佳化模型,用於程式碼代理程式。", + "provider.connect.opencodeZen.line2": "只需一個 API 金鑰,你就能使用 Claude、GPT、Gemini、GLM 等模型。", + "provider.connect.opencodeZen.visit.prefix": "造訪 ", + "provider.connect.opencodeZen.visit.link": "opencode.ai/zen", + "provider.connect.opencodeZen.visit.suffix": " 取得你的 API 金鑰。", + "provider.connect.oauth.code.visit.prefix": "造訪 ", + "provider.connect.oauth.code.visit.link": "此連結", + "provider.connect.oauth.code.visit.suffix": " 取得授權碼,以連線你的帳戶並在 OpenCode 中使用 {{provider}} 模型。", + "provider.connect.oauth.code.label": "{{method}} 授權碼", + "provider.connect.oauth.code.placeholder": "授權碼", + "provider.connect.oauth.code.required": "授權碼為必填", + "provider.connect.oauth.code.invalid": "授權碼無效", + "provider.connect.oauth.auto.visit.prefix": "造訪 ", + "provider.connect.oauth.auto.visit.link": "此連結", + "provider.connect.oauth.auto.visit.suffix": + " 並輸入以下程式碼,以連線你的帳戶並在 OpenCode 中使用 {{provider}} 模型。", + "provider.connect.oauth.auto.confirmationCode": "確認碼", + "provider.connect.toast.connected.title": "{{provider}} 已連線", + "provider.connect.toast.connected.description": "現在可以使用 {{provider}} 模型了。", + + "model.tag.free": "免費", + "model.tag.latest": "最新", + + "common.search.placeholder": "搜尋", + "common.goBack": "返回", + "common.loading": "載入中", + "common.cancel": "取消", + "common.submit": "提交", + "common.save": "儲存", + "common.saving": "儲存中...", + "common.default": "預設", + "common.attachment": "附件", + + "prompt.placeholder.shell": "輸入 shell 命令...", + "prompt.placeholder.normal": '隨便問點什麼... "{{example}}"', + "prompt.mode.shell": "Shell", + "prompt.mode.shell.exit": "按 esc 退出", + + "prompt.example.1": "修復程式碼庫中的一個 TODO", + "prompt.example.2": "這個專案的技術堆疊是什麼?", + "prompt.example.3": "修復失敗的測試", + "prompt.example.4": "解釋驗證是如何運作的", + "prompt.example.5": "尋找並修復安全漏洞", + "prompt.example.6": "為使用者服務新增單元測試", + "prompt.example.7": "重構這個函式,讓它更易讀", + "prompt.example.8": "這個錯誤是什麼意思?", + "prompt.example.9": "幫我偵錯這個問題", + "prompt.example.10": "產生 API 文件", + "prompt.example.11": "最佳化資料庫查詢", + "prompt.example.12": "新增輸入驗證", + "prompt.example.13": "建立一個新的元件用於...", + "prompt.example.14": "我該如何部署這個專案?", + "prompt.example.15": "審查我的程式碼並給出最佳實務建議", + "prompt.example.16": "為這個函式新增錯誤處理", + "prompt.example.17": "解釋這個正規表示式", + "prompt.example.18": "把它轉換成 TypeScript", + "prompt.example.19": "在整個程式碼庫中新增日誌", + "prompt.example.20": "哪些相依性已經過期?", + "prompt.example.21": "幫我寫一個遷移腳本", + "prompt.example.22": "為這個端點實作快取", + "prompt.example.23": "給這個清單新增分頁", + "prompt.example.24": "建立一個 CLI 命令用於...", + "prompt.example.25": "這裡的環境變數是怎麼運作的?", + + "prompt.popover.emptyResults": "沒有符合的結果", + "prompt.popover.emptyCommands": "沒有符合的命令", + "prompt.dropzone.label": "將圖片或 PDF 拖到這裡", + "prompt.slash.badge.custom": "自訂", + "prompt.context.active": "作用中", + "prompt.context.includeActiveFile": "包含作用中檔案", + "prompt.context.removeActiveFile": "從上下文移除目前檔案", + "prompt.context.removeFile": "從上下文移除檔案", + "prompt.action.attachFile": "附加檔案", + "prompt.attachment.remove": "移除附件", + "prompt.action.send": "傳送", + "prompt.action.stop": "停止", + + "prompt.toast.pasteUnsupported.title": "不支援的貼上", + "prompt.toast.pasteUnsupported.description": "這裡只能貼上圖片或 PDF 檔案。", + "prompt.toast.modelAgentRequired.title": "請選擇代理程式和模型", + "prompt.toast.modelAgentRequired.description": "傳送提示前請先選擇代理程式和模型。", + "prompt.toast.worktreeCreateFailed.title": "建立工作樹失敗", + "prompt.toast.sessionCreateFailed.title": "建立工作階段失敗", + "prompt.toast.shellSendFailed.title": "傳送 shell 命令失敗", + "prompt.toast.commandSendFailed.title": "傳送命令失敗", + "prompt.toast.promptSendFailed.title": "傳送提示失敗", + + "dialog.mcp.title": "MCP", + "dialog.mcp.description": "已啟用 {{enabled}} / {{total}}", + "dialog.mcp.empty": "未設定 MCP", + + "mcp.status.connected": "已連線", + "mcp.status.failed": "失敗", + "mcp.status.needs_auth": "需要授權", + "mcp.status.disabled": "已停用", + + "dialog.fork.empty": "沒有可用於分支的訊息", + + "dialog.directory.search.placeholder": "搜尋資料夾", + "dialog.directory.empty": "找不到資料夾", + + "dialog.server.title": "伺服器", + "dialog.server.description": "切換此應用程式連線的 OpenCode 伺服器。", + "dialog.server.search.placeholder": "搜尋伺服器", + "dialog.server.empty": "暫無伺服器", + "dialog.server.add.title": "新增伺服器", + "dialog.server.add.url": "伺服器 URL", + "dialog.server.add.placeholder": "http://localhost:4096", + "dialog.server.add.error": "無法連線到伺服器", + "dialog.server.add.checking": "檢查中...", + "dialog.server.add.button": "新增", + "dialog.server.default.title": "預設伺服器", + "dialog.server.default.description": "應用程式啟動時連線此伺服器,而不是啟動本地伺服器。需要重新啟動。", + "dialog.server.default.none": "未選擇伺服器", + "dialog.server.default.set": "將目前伺服器設為預設", + "dialog.server.default.clear": "清除", + "dialog.server.action.remove": "移除伺服器", + + "dialog.project.edit.title": "編輯專案", + "dialog.project.edit.name": "名稱", + "dialog.project.edit.icon": "圖示", + "dialog.project.edit.icon.alt": "專案圖示", + "dialog.project.edit.icon.hint": "點擊或拖曳圖片", + "dialog.project.edit.icon.recommended": "建議:128x128px", + "dialog.project.edit.color": "顏色", + "dialog.project.edit.color.select": "選擇{{color}}顏色", + + "context.breakdown.title": "上下文拆分", + "context.breakdown.note": "輸入 token 的大致拆分。「其他」包含工具定義和額外開銷。", + "context.breakdown.system": "系統", + "context.breakdown.user": "使用者", + "context.breakdown.assistant": "助手", + "context.breakdown.tool": "工具呼叫", + "context.breakdown.other": "其他", + + "context.systemPrompt.title": "系統提示詞", + "context.rawMessages.title": "原始訊息", + + "context.stats.session": "工作階段", + "context.stats.messages": "訊息數", + "context.stats.provider": "提供者", + "context.stats.model": "模型", + "context.stats.limit": "上下文限制", + "context.stats.totalTokens": "總 token", + "context.stats.usage": "使用量", + "context.stats.inputTokens": "輸入 token", + "context.stats.outputTokens": "輸出 token", + "context.stats.reasoningTokens": "推理 token", + "context.stats.cacheTokens": "快取 token(讀/寫)", + "context.stats.userMessages": "使用者訊息", + "context.stats.assistantMessages": "助手訊息", + "context.stats.totalCost": "總成本", + "context.stats.sessionCreated": "建立時間", + "context.stats.lastActivity": "最後活動", + + "context.usage.tokens": "Token", + "context.usage.usage": "使用量", + "context.usage.cost": "成本", + "context.usage.clickToView": "點擊查看上下文", + "context.usage.view": "檢視上下文用量", + + "language.en": "英語", + "language.zh": "簡體中文", + "language.zht": "繁體中文", + "language.ko": "韓語", + "language.ru": "俄語", + "language.ar": "阿拉伯語", + "language.no": "挪威語", + "language.br": "葡萄牙語(巴西)", + + "toast.language.title": "語言", + "toast.language.description": "已切換到 {{language}}", + + "toast.theme.title": "主題已切換", + "toast.scheme.title": "配色方案", + + "toast.permissions.autoaccept.on.title": "自動接受編輯", + "toast.permissions.autoaccept.on.description": "編輯和寫入權限將自動獲准", + "toast.permissions.autoaccept.off.title": "已停止自動接受編輯", + "toast.permissions.autoaccept.off.description": "編輯和寫入權限將需要手動批准", + + "toast.model.none.title": "未選擇模型", + "toast.model.none.description": "請先連線提供者以總結此工作階段", + + "toast.file.loadFailed.title": "載入檔案失敗", + + "toast.session.share.copyFailed.title": "無法複製連結到剪貼簿", + "toast.session.share.success.title": "工作階段已分享", + "toast.session.share.success.description": "分享連結已複製到剪貼簿", + "toast.session.share.failed.title": "分享工作階段失敗", + "toast.session.share.failed.description": "分享工作階段時發生錯誤", + + "toast.session.unshare.success.title": "已取消分享工作階段", + "toast.session.unshare.success.description": "工作階段已成功取消分享", + "toast.session.unshare.failed.title": "取消分享失敗", + "toast.session.unshare.failed.description": "取消分享工作階段時發生錯誤", + + "toast.session.listFailed.title": "無法載入 {{project}} 的工作階段", + + "toast.update.title": "有可用更新", + "toast.update.description": "OpenCode 有新版本 ({{version}}) 可安裝。", + "toast.update.action.installRestart": "安裝並重新啟動", + "toast.update.action.notYet": "稍後", + + "error.page.title": "出了點問題", + "error.page.description": "載入應用程式時發生錯誤。", + "error.page.details.label": "錯誤詳情", + "error.page.action.restart": "重新啟動", + "error.page.action.checking": "檢查中...", + "error.page.action.checkUpdates": "檢查更新", + "error.page.action.updateTo": "更新到 {{version}}", + "error.page.report.prefix": "請將此錯誤回報給 OpenCode 團隊", + "error.page.report.discord": "在 Discord 上", + "error.page.version": "版本: {{version}}", + + "error.dev.rootNotFound": "找不到根元素。你是不是忘了把它新增到 index.html? 或者 id 屬性拼錯了?", + + "error.globalSync.connectFailed": "無法連線到伺服器。是否有伺服器正在 `{{url}}` 執行?", + + "error.chain.unknown": "未知錯誤", + "error.chain.causedBy": "原因:", + "error.chain.apiError": "API 錯誤", + "error.chain.status": "狀態: {{status}}", + "error.chain.retryable": "可重試: {{retryable}}", + "error.chain.responseBody": "回應內容:\n{{body}}", + "error.chain.didYouMean": "你是不是想輸入: {{suggestions}}", + "error.chain.modelNotFound": "找不到模型: {{provider}}/{{model}}", + "error.chain.checkConfig": "請檢查你的設定 (opencode.json) 中的 provider/model 名稱", + "error.chain.mcpFailed": 'MCP 伺服器 "{{name}}" 啟動失敗。注意: OpenCode 暫不支援 MCP 認證。', + "error.chain.providerAuthFailed": "提供者認證失敗 ({{provider}}): {{message}}", + "error.chain.providerInitFailed": '無法初始化提供者 "{{provider}}"。請檢查憑證和設定。', + "error.chain.configJsonInvalid": "設定檔 {{path}} 不是有效的 JSON(C)", + "error.chain.configJsonInvalidWithMessage": "設定檔 {{path}} 不是有效的 JSON(C): {{message}}", + "error.chain.configDirectoryTypo": + '{{path}} 中的目錄 "{{dir}}" 無效。請將目錄重新命名為 "{{suggestion}}" 或移除它。這是一個常見拼寫錯誤。', + "error.chain.configFrontmatterError": "無法解析 {{path}} 中的 frontmatter:\n{{message}}", + "error.chain.configInvalid": "設定檔 {{path}} 無效", + "error.chain.configInvalidWithMessage": "設定檔 {{path}} 無效: {{message}}", + + "notification.permission.title": "需要權限", + "notification.permission.description": "{{sessionTitle}}({{projectName}})需要權限", + "notification.question.title": "問題", + "notification.question.description": "{{sessionTitle}}({{projectName}})有一個問題", + "notification.action.goToSession": "前往工作階段", + + "notification.session.responseReady.title": "回覆已就緒", + "notification.session.error.title": "工作階段錯誤", + "notification.session.error.fallbackDescription": "發生錯誤", + + "home.recentProjects": "最近專案", + "home.empty.title": "沒有最近專案", + "home.empty.description": "透過開啟本地專案開始使用", + + "session.tab.session": "工作階段", + "session.tab.review": "審查", + "session.tab.context": "上下文", + "session.panel.reviewAndFiles": "審查與檔案", + "session.review.filesChanged": "{{count}} 個檔案變更", + "session.review.loadingChanges": "正在載入變更...", + "session.review.empty": "此工作階段暫無變更", + "session.messages.renderEarlier": "顯示更早的訊息", + "session.messages.loadingEarlier": "正在載入更早的訊息...", + "session.messages.loadEarlier": "載入更早的訊息", + "session.messages.loading": "正在載入訊息...", + + "session.context.addToContext": "將 {{selection}} 新增到上下文", + + "session.new.worktree.main": "主分支", + "session.new.worktree.mainWithBranch": "主分支 ({{branch}})", + "session.new.worktree.create": "建立新的 worktree", + "session.new.lastModified": "最後修改", + + "session.header.search.placeholder": "搜尋 {{project}}", + "session.header.searchFiles": "搜尋檔案", + + "session.share.popover.title": "發佈到網頁", + "session.share.popover.description.shared": "此工作階段已在網頁上公開。任何擁有連結的人都可以存取。", + "session.share.popover.description.unshared": "在網頁上公開分享此工作階段。任何擁有連結的人都可以存取。", + "session.share.action.share": "分享", + "session.share.action.publish": "發佈", + "session.share.action.publishing": "正在發佈...", + "session.share.action.unpublish": "取消發佈", + "session.share.action.unpublishing": "正在取消發佈...", + "session.share.action.view": "檢視", + "session.share.copy.copied": "已複製", + "session.share.copy.copyLink": "複製連結", + + "lsp.tooltip.none": "沒有 LSP 伺服器", + "lsp.label.connected": "{{count}} LSP", + + "prompt.loading": "正在載入提示...", + "terminal.loading": "正在載入終端機...", + "terminal.title": "終端機", + "terminal.title.numbered": "終端機 {{number}}", + "terminal.close": "關閉終端機", + + "common.closeTab": "關閉標籤頁", + "common.dismiss": "忽略", + "common.requestFailed": "要求失敗", + "common.moreOptions": "更多選項", + "common.learnMore": "深入了解", + "common.rename": "重新命名", + "common.reset": "重設", + "common.archive": "封存", + "common.delete": "刪除", + "common.close": "關閉", + "common.edit": "編輯", + "common.loadMore": "載入更多", + + "sidebar.nav.projectsAndSessions": "專案與工作階段", + "sidebar.settings": "設定", + "sidebar.help": "說明", + "sidebar.workspaces.enable": "啟用工作區", + "sidebar.workspaces.disable": "停用工作區", + "sidebar.gettingStarted.title": "開始使用", + "sidebar.gettingStarted.line1": "OpenCode 提供免費模型,你可以立即開始使用。", + "sidebar.gettingStarted.line2": "連線任意提供者即可使用更多模型,如 Claude、GPT、Gemini 等。", + "sidebar.project.recentSessions": "最近工作階段", + "sidebar.project.viewAllSessions": "查看全部工作階段", + + "settings.section.desktop": "桌面", + "settings.tab.general": "一般", + "settings.tab.shortcuts": "快速鍵", + + "settings.general.section.appearance": "外觀", + "settings.general.section.notifications": "系統通知", + "settings.general.section.sounds": "音效", + + "settings.general.row.language.title": "語言", + "settings.general.row.language.description": "變更 OpenCode 的顯示語言", + "settings.general.row.appearance.title": "外觀", + "settings.general.row.appearance.description": "自訂 OpenCode 在你的裝置上的外觀", + "settings.general.row.theme.title": "主題", + "settings.general.row.theme.description": "自訂 OpenCode 的主題。", + "settings.general.row.font.title": "字型", + "settings.general.row.font.description": "自訂程式碼區塊使用的等寬字型", + + "settings.general.notifications.agent.title": "代理程式", + "settings.general.notifications.agent.description": "當代理程式完成或需要注意時顯示系統通知", + "settings.general.notifications.permissions.title": "權限", + "settings.general.notifications.permissions.description": "當需要權限時顯示系統通知", + "settings.general.notifications.errors.title": "錯誤", + "settings.general.notifications.errors.description": "發生錯誤時顯示系統通知", + + "settings.general.sounds.agent.title": "代理程式", + "settings.general.sounds.agent.description": "當代理程式完成或需要注意時播放聲音", + "settings.general.sounds.permissions.title": "權限", + "settings.general.sounds.permissions.description": "當需要權限時播放聲音", + "settings.general.sounds.errors.title": "錯誤", + "settings.general.sounds.errors.description": "發生錯誤時播放聲音", + + "settings.shortcuts.title": "鍵盤快速鍵", + "settings.shortcuts.reset.button": "重設為預設值", + "settings.shortcuts.reset.toast.title": "快速鍵已重設", + "settings.shortcuts.reset.toast.description": "鍵盤快速鍵已重設為預設設定。", + "settings.shortcuts.conflict.title": "快速鍵已被占用", + "settings.shortcuts.conflict.description": "{{keybind}} 已分配給 {{titles}}。", + "settings.shortcuts.unassigned": "未設定", + "settings.shortcuts.pressKeys": "按下按鍵", + "settings.shortcuts.search.placeholder": "搜尋快速鍵", + "settings.shortcuts.search.empty": "找不到快速鍵", + + "settings.shortcuts.group.general": "一般", + "settings.shortcuts.group.session": "工作階段", + "settings.shortcuts.group.navigation": "導覽", + "settings.shortcuts.group.modelAndAgent": "模型與代理程式", + "settings.shortcuts.group.terminal": "終端機", + "settings.shortcuts.group.prompt": "提示", + + "settings.providers.title": "提供者", + "settings.providers.description": "提供者設定將在此處可設定。", + "settings.models.title": "模型", + "settings.models.description": "模型設定將在此處可設定。", + "settings.agents.title": "代理程式", + "settings.agents.description": "代理程式設定將在此處可設定。", + "settings.commands.title": "命令", + "settings.commands.description": "命令設定將在此處可設定。", + "settings.mcp.title": "MCP", + "settings.mcp.description": "MCP 設定將在此處可設定。", + + "settings.permissions.title": "權限", + "settings.permissions.description": "控制伺服器預設可以使用哪些工具。", + "settings.permissions.section.tools": "工具", + "settings.permissions.toast.updateFailed.title": "更新權限失敗", + + "settings.permissions.action.allow": "允許", + "settings.permissions.action.ask": "詢問", + "settings.permissions.action.deny": "拒絕", + + "settings.permissions.tool.read.title": "讀取", + "settings.permissions.tool.read.description": "讀取檔案(符合檔案路徑)", + "settings.permissions.tool.edit.title": "編輯", + "settings.permissions.tool.edit.description": "修改檔案,包括編輯、寫入、修補和多重編輯", + "settings.permissions.tool.glob.title": "Glob", + "settings.permissions.tool.glob.description": "使用 glob 模式符合檔案", + "settings.permissions.tool.grep.title": "Grep", + "settings.permissions.tool.grep.description": "使用正規表示式搜尋檔案內容", + "settings.permissions.tool.list.title": "清單", + "settings.permissions.tool.list.description": "列出目錄中的檔案", + "settings.permissions.tool.bash.title": "Bash", + "settings.permissions.tool.bash.description": "執行 shell 命令", + "settings.permissions.tool.task.title": "Task", + "settings.permissions.tool.task.description": "啟動子代理程式", + "settings.permissions.tool.skill.title": "Skill", + "settings.permissions.tool.skill.description": "按名稱載入技能", + "settings.permissions.tool.lsp.title": "LSP", + "settings.permissions.tool.lsp.description": "執行語言伺服器查詢", + "settings.permissions.tool.todoread.title": "讀取待辦", + "settings.permissions.tool.todoread.description": "讀取待辦清單", + "settings.permissions.tool.todowrite.title": "更新待辦", + "settings.permissions.tool.todowrite.description": "更新待辦清單", + "settings.permissions.tool.webfetch.title": "Web Fetch", + "settings.permissions.tool.webfetch.description": "從 URL 取得內容", + "settings.permissions.tool.websearch.title": "Web Search", + "settings.permissions.tool.websearch.description": "搜尋網頁", + "settings.permissions.tool.codesearch.title": "Code Search", + "settings.permissions.tool.codesearch.description": "在網路上搜尋程式碼", + "settings.permissions.tool.external_directory.title": "外部目錄", + "settings.permissions.tool.external_directory.description": "存取專案目錄之外的檔案", + "settings.permissions.tool.doom_loop.title": "Doom Loop", + "settings.permissions.tool.doom_loop.description": "偵測具有相同輸入的重複工具呼叫", + + "session.delete.failed.title": "刪除工作階段失敗", + "session.delete.title": "刪除工作階段", + "session.delete.confirm": '刪除工作階段 "{{name}}"?', + "session.delete.button": "刪除工作階段", + + "workspace.new": "新增工作區", + "workspace.type.local": "本地", + "workspace.type.sandbox": "沙盒", + "workspace.create.failed.title": "建立工作區失敗", + "workspace.delete.failed.title": "刪除工作區失敗", + "workspace.resetting.title": "正在重設工作區", + "workspace.resetting.description": "這可能需要一點時間。", + "workspace.reset.failed.title": "重設工作區失敗", + "workspace.reset.success.title": "工作區已重設", + "workspace.reset.success.description": "工作區已與預設分支保持一致。", + "workspace.status.checking": "正在檢查未合併的變更...", + "workspace.status.error": "無法驗證 git 狀態。", + "workspace.status.clean": "未偵測到未合併的變更。", + "workspace.status.dirty": "偵測到未合併的變更。", + "workspace.delete.title": "刪除工作區", + "workspace.delete.confirm": '刪除工作區 "{{name}}"?', + "workspace.delete.button": "刪除工作區", + "workspace.reset.title": "重設工作區", + "workspace.reset.confirm": '重設工作區 "{{name}}"?', + "workspace.reset.button": "重設工作區", + "workspace.reset.archived.none": "不會封存任何作用中工作階段。", + "workspace.reset.archived.one": "將封存 1 個工作階段。", + "workspace.reset.archived.many": "將封存 {{count}} 個工作階段。", + "workspace.reset.note": "這將把工作區重設為與預設分支一致。", +} satisfies Partial> diff --git a/packages/app/src/index.css b/packages/app/src/index.css new file mode 100644 index 00000000000..3d7b9db7af9 --- /dev/null +++ b/packages/app/src/index.css @@ -0,0 +1,57 @@ +@import "@opencode-ai/ui/styles/tailwind"; + +:root { + a { + cursor: default; + } +} + +[data-component="markdown"] ul { + list-style: disc outside; + padding-left: 1.5rem; +} + +[data-component="markdown"] ol { + list-style: decimal outside; + padding-left: 1.5rem; +} + +[data-component="markdown"] li > p:first-child { + display: inline; + margin: 0; +} + +[data-component="markdown"] li > p + p { + display: block; + margin-top: 0.5rem; +} + +*[data-tauri-drag-region] { + app-region: drag; +} + +.session-scroller::-webkit-scrollbar { + width: 10px !important; + height: 10px !important; +} + +.session-scroller::-webkit-scrollbar-track { + background: transparent !important; + border-radius: 5px !important; +} + +.session-scroller::-webkit-scrollbar-thumb { + background: var(--border-weak-base) !important; + border-radius: 5px !important; + border: 3px solid transparent !important; + background-clip: padding-box !important; +} + +.session-scroller::-webkit-scrollbar-thumb:hover { + background: var(--border-weak-base) !important; +} + +.session-scroller { + scrollbar-width: thin !important; + scrollbar-color: var(--border-weak-base) transparent !important; +} diff --git a/packages/desktop/src/index.ts b/packages/app/src/index.ts similarity index 55% rename from packages/desktop/src/index.ts rename to packages/app/src/index.ts index cf5be9f512f..df3181133e9 100644 --- a/packages/desktop/src/index.ts +++ b/packages/app/src/index.ts @@ -1,2 +1,2 @@ export { PlatformProvider, type Platform } from "./context/platform" -export { App } from "./app" +export { AppBaseProviders, AppInterface } from "./app" diff --git a/packages/app/src/pages/directory-layout.tsx b/packages/app/src/pages/directory-layout.tsx new file mode 100644 index 00000000000..dca02489a8a --- /dev/null +++ b/packages/app/src/pages/directory-layout.tsx @@ -0,0 +1,57 @@ +import { createMemo, Show, type ParentProps } from "solid-js" +import { useNavigate, useParams } from "@solidjs/router" +import { SDKProvider, useSDK } from "@/context/sdk" +import { SyncProvider, useSync } from "@/context/sync" +import { LocalProvider } from "@/context/local" + +import { base64Decode } from "@opencode-ai/util/encode" +import { DataProvider } from "@opencode-ai/ui/context" +import { iife } from "@opencode-ai/util/iife" +import type { QuestionAnswer } from "@opencode-ai/sdk/v2" + +export default function Layout(props: ParentProps) { + const params = useParams() + const navigate = useNavigate() + const directory = createMemo(() => { + return base64Decode(params.dir!) + }) + return ( + + + + {iife(() => { + const sync = useSync() + const sdk = useSDK() + const respond = (input: { + sessionID: string + permissionID: string + response: "once" | "always" | "reject" + }) => sdk.client.permission.respond(input) + + const replyToQuestion = (input: { requestID: string; answers: QuestionAnswer[] }) => + sdk.client.question.reply(input) + + const rejectQuestion = (input: { requestID: string }) => sdk.client.question.reject(input) + + const navigateToSession = (sessionID: string) => { + navigate(`/${params.dir}/session/${sessionID}`) + } + + return ( + + {props.children} + + ) + })} + + + + ) +} diff --git a/packages/app/src/pages/error.tsx b/packages/app/src/pages/error.tsx new file mode 100644 index 00000000000..6d6faf6fa3b --- /dev/null +++ b/packages/app/src/pages/error.tsx @@ -0,0 +1,290 @@ +import { TextField } from "@opencode-ai/ui/text-field" +import { Logo } from "@opencode-ai/ui/logo" +import { Button } from "@opencode-ai/ui/button" +import { Component, Show } from "solid-js" +import { createStore } from "solid-js/store" +import { usePlatform } from "@/context/platform" +import { useLanguage } from "@/context/language" +import { Icon } from "@opencode-ai/ui/icon" + +export type InitError = { + name: string + data: Record +} + +type Translator = ReturnType["t"] + +function isInitError(error: unknown): error is InitError { + return ( + typeof error === "object" && + error !== null && + "name" in error && + "data" in error && + typeof (error as InitError).data === "object" + ) +} + +function safeJson(value: unknown): string { + const seen = new WeakSet() + const json = JSON.stringify( + value, + (_key, val) => { + if (typeof val === "bigint") return val.toString() + if (typeof val === "object" && val) { + if (seen.has(val)) return "[Circular]" + seen.add(val) + } + return val + }, + 2, + ) + return json ?? String(value) +} + +function formatInitError(error: InitError, t: Translator): string { + const data = error.data + switch (error.name) { + case "MCPFailed": { + const name = typeof data.name === "string" ? data.name : "" + return t("error.chain.mcpFailed", { name }) + } + case "ProviderAuthError": { + const providerID = typeof data.providerID === "string" ? data.providerID : "unknown" + const message = typeof data.message === "string" ? data.message : safeJson(data.message) + return t("error.chain.providerAuthFailed", { provider: providerID, message }) + } + case "APIError": { + const message = typeof data.message === "string" ? data.message : t("error.chain.apiError") + const lines: string[] = [message] + + if (typeof data.statusCode === "number") { + lines.push(t("error.chain.status", { status: data.statusCode })) + } + + if (typeof data.isRetryable === "boolean") { + lines.push(t("error.chain.retryable", { retryable: data.isRetryable })) + } + + if (typeof data.responseBody === "string" && data.responseBody) { + lines.push(t("error.chain.responseBody", { body: data.responseBody })) + } + + return lines.join("\n") + } + case "ProviderModelNotFoundError": { + const { providerID, modelID, suggestions } = data as { + providerID: string + modelID: string + suggestions?: string[] + } + + const suggestionsLine = + Array.isArray(suggestions) && suggestions.length + ? [t("error.chain.didYouMean", { suggestions: suggestions.join(", ") })] + : [] + + return [ + t("error.chain.modelNotFound", { provider: providerID, model: modelID }), + ...suggestionsLine, + t("error.chain.checkConfig"), + ].join("\n") + } + case "ProviderInitError": { + const providerID = typeof data.providerID === "string" ? data.providerID : "unknown" + return t("error.chain.providerInitFailed", { provider: providerID }) + } + case "ConfigJsonError": { + const path = typeof data.path === "string" ? data.path : safeJson(data.path) + const message = typeof data.message === "string" ? data.message : "" + if (message) return t("error.chain.configJsonInvalidWithMessage", { path, message }) + return t("error.chain.configJsonInvalid", { path }) + } + case "ConfigDirectoryTypoError": { + const path = typeof data.path === "string" ? data.path : safeJson(data.path) + const dir = typeof data.dir === "string" ? data.dir : safeJson(data.dir) + const suggestion = typeof data.suggestion === "string" ? data.suggestion : safeJson(data.suggestion) + return t("error.chain.configDirectoryTypo", { dir, path, suggestion }) + } + case "ConfigFrontmatterError": { + const path = typeof data.path === "string" ? data.path : safeJson(data.path) + const message = typeof data.message === "string" ? data.message : safeJson(data.message) + return t("error.chain.configFrontmatterError", { path, message }) + } + case "ConfigInvalidError": { + const issues = Array.isArray(data.issues) + ? data.issues.map( + (issue: { message: string; path: string[] }) => "↳ " + issue.message + " " + issue.path.join("."), + ) + : [] + const message = typeof data.message === "string" ? data.message : "" + const path = typeof data.path === "string" ? data.path : safeJson(data.path) + + const line = message + ? t("error.chain.configInvalidWithMessage", { path, message }) + : t("error.chain.configInvalid", { path }) + + return [line, ...issues].join("\n") + } + case "UnknownError": + return typeof data.message === "string" ? data.message : safeJson(data) + default: + if (typeof data.message === "string") return data.message + return safeJson(data) + } +} + +function formatErrorChain(error: unknown, t: Translator, depth = 0, parentMessage?: string): string { + if (!error) return t("error.chain.unknown") + + if (isInitError(error)) { + const message = formatInitError(error, t) + if (depth > 0 && parentMessage === message) return "" + const indent = depth > 0 ? `\n${"─".repeat(40)}\n${t("error.chain.causedBy")}\n` : "" + return indent + `${error.name}\n${message}` + } + + if (error instanceof Error) { + const isDuplicate = depth > 0 && parentMessage === error.message + const parts: string[] = [] + const indent = depth > 0 ? `\n${"─".repeat(40)}\n${t("error.chain.causedBy")}\n` : "" + + const header = `${error.name}${error.message ? `: ${error.message}` : ""}` + const stack = error.stack?.trim() + + if (stack) { + const startsWithHeader = stack.startsWith(header) + + if (isDuplicate && startsWithHeader) { + const trace = stack.split("\n").slice(1).join("\n").trim() + if (trace) { + parts.push(indent + trace) + } + } + + if (isDuplicate && !startsWithHeader) { + parts.push(indent + stack) + } + + if (!isDuplicate && startsWithHeader) { + parts.push(indent + stack) + } + + if (!isDuplicate && !startsWithHeader) { + parts.push(indent + `${header}\n${stack}`) + } + } + + if (!stack && !isDuplicate) { + parts.push(indent + header) + } + + if (error.cause) { + const causeResult = formatErrorChain(error.cause, t, depth + 1, error.message) + if (causeResult) { + parts.push(causeResult) + } + } + + return parts.join("\n\n") + } + + if (typeof error === "string") { + if (depth > 0 && parentMessage === error) return "" + const indent = depth > 0 ? `\n${"─".repeat(40)}\n${t("error.chain.causedBy")}\n` : "" + return indent + error + } + + const indent = depth > 0 ? `\n${"─".repeat(40)}\n${t("error.chain.causedBy")}\n` : "" + return indent + safeJson(error) +} + +function formatError(error: unknown, t: Translator): string { + return formatErrorChain(error, t, 0) +} + +interface ErrorPageProps { + error: unknown +} + +export const ErrorPage: Component = (props) => { + const platform = usePlatform() + const language = useLanguage() + const [store, setStore] = createStore({ + checking: false, + version: undefined as string | undefined, + }) + + async function checkForUpdates() { + if (!platform.checkUpdate) return + setStore("checking", true) + const result = await platform.checkUpdate() + setStore("checking", false) + if (result.updateAvailable && result.version) setStore("version", result.version) + } + + async function installUpdate() { + if (!platform.update || !platform.restart) return + await platform.update() + await platform.restart() + } + + return ( +
+
+ +
+

{language.t("error.page.title")}

+

{language.t("error.page.description")}

+
+ +
+ + + + {store.checking + ? language.t("error.page.action.checking") + : language.t("error.page.action.checkUpdates")} + + } + > + + + +
+
+
+ {language.t("error.page.report.prefix")} + +
+ + {(version) => ( +

{language.t("error.page.version", { version: version() })}

+ )} +
+
+
+
+ ) +} diff --git a/packages/desktop/src/pages/home.tsx b/packages/app/src/pages/home.tsx similarity index 51% rename from packages/desktop/src/pages/home.tsx rename to packages/app/src/pages/home.tsx index 7cd2916e8f5..4007129b5cc 100644 --- a/packages/desktop/src/pages/home.tsx +++ b/packages/app/src/pages/home.tsx @@ -1,4 +1,3 @@ -import { useGlobalSync } from "@/context/global-sync" import { createMemo, For, Match, Show, Switch } from "solid-js" import { Button } from "@opencode-ai/ui/button" import { Logo } from "@opencode-ai/ui/logo" @@ -8,46 +7,81 @@ import { base64Encode } from "@opencode-ai/util/encode" import { Icon } from "@opencode-ai/ui/icon" import { usePlatform } from "@/context/platform" import { DateTime } from "luxon" +import { useDialog } from "@opencode-ai/ui/context/dialog" +import { DialogSelectDirectory } from "@/components/dialog-select-directory" +import { DialogSelectServer } from "@/components/dialog-select-server" +import { useServer } from "@/context/server" +import { useGlobalSync } from "@/context/global-sync" +import { useLanguage } from "@/context/language" export default function Home() { const sync = useGlobalSync() const layout = useLayout() const platform = usePlatform() + const dialog = useDialog() const navigate = useNavigate() + const server = useServer() + const language = useLanguage() const homedir = createMemo(() => sync.data.path.home) function openProject(directory: string) { layout.projects.open(directory) + server.projects.touch(directory) navigate(`/${base64Encode(directory)}`) } async function chooseProject() { - const result = await platform.openDirectoryPickerDialog?.({ - title: "Open project", - multiple: true, - }) - if (Array.isArray(result)) { - for (const directory of result) { - openProject(directory) + function resolve(result: string | string[] | null) { + if (Array.isArray(result)) { + for (const directory of result) { + openProject(directory) + } + } else if (result) { + openProject(result) } - } else if (result) { - openProject(result) + } + + if (platform.openDirectoryPickerDialog && server.isLocal()) { + const result = await platform.openDirectoryPickerDialog?.({ + title: language.t("command.project.open"), + multiple: true, + }) + resolve(result) + } else { + dialog.show( + () => , + () => resolve(null), + ) } } return ( -
- +
+ + 0}>
-
Recent projects
- - - +
{language.t("home.recentProjects")}
+
    -
    No recent projects
    -
    Get started by opening a local project
    +
    {language.t("home.empty.title")}
    +
    {language.t("home.empty.description")}
    - - - +
    diff --git a/packages/app/src/pages/layout.tsx b/packages/app/src/pages/layout.tsx new file mode 100644 index 00000000000..12e11e724a0 --- /dev/null +++ b/packages/app/src/pages/layout.tsx @@ -0,0 +1,2560 @@ +import { + batch, + createEffect, + createMemo, + createSignal, + For, + Match, + on, + onCleanup, + onMount, + ParentProps, + Show, + Switch, + untrack, + type Accessor, + type JSX, +} from "solid-js" +import { A, useNavigate, useParams } from "@solidjs/router" +import { useLayout, getAvatarColors, LocalProject } from "@/context/layout" +import { useGlobalSync } from "@/context/global-sync" +import { Persist, persisted } from "@/utils/persist" +import { base64Decode, base64Encode } from "@opencode-ai/util/encode" +import { Avatar } from "@opencode-ai/ui/avatar" +import { ResizeHandle } from "@opencode-ai/ui/resize-handle" +import { Button } from "@opencode-ai/ui/button" +import { Icon } from "@opencode-ai/ui/icon" +import { IconButton } from "@opencode-ai/ui/icon-button" +import { InlineInput } from "@opencode-ai/ui/inline-input" +import { Tooltip, TooltipKeybind } from "@opencode-ai/ui/tooltip" +import { HoverCard } from "@opencode-ai/ui/hover-card" +import { MessageNav } from "@opencode-ai/ui/message-nav" +import { DropdownMenu } from "@opencode-ai/ui/dropdown-menu" +import { Collapsible } from "@opencode-ai/ui/collapsible" +import { DiffChanges } from "@opencode-ai/ui/diff-changes" +import { Spinner } from "@opencode-ai/ui/spinner" +import { Dialog } from "@opencode-ai/ui/dialog" +import { getFilename } from "@opencode-ai/util/path" +import { Session, type Message, type TextPart } from "@opencode-ai/sdk/v2/client" +import { usePlatform } from "@/context/platform" +import { useSettings } from "@/context/settings" +import { createStore, produce, reconcile } from "solid-js/store" +import { + DragDropProvider, + DragDropSensors, + DragOverlay, + SortableProvider, + closestCenter, + createSortable, +} from "@thisbeyond/solid-dnd" +import type { DragEvent } from "@thisbeyond/solid-dnd" +import { useProviders } from "@/hooks/use-providers" +import { showToast, Toast, toaster } from "@opencode-ai/ui/toast" +import { useGlobalSDK } from "@/context/global-sdk" +import { useNotification } from "@/context/notification" +import { usePermission } from "@/context/permission" +import { Binary } from "@opencode-ai/util/binary" +import { retry } from "@opencode-ai/util/retry" +import { playSound, soundSrc } from "@/utils/sound" + +import { useDialog } from "@opencode-ai/ui/context/dialog" +import { useTheme, type ColorScheme } from "@opencode-ai/ui/theme" +import { DialogSelectProvider } from "@/components/dialog-select-provider" +import { DialogSelectServer } from "@/components/dialog-select-server" +import { DialogSettings } from "@/components/dialog-settings" +import { useCommand, type CommandOption } from "@/context/command" +import { ConstrainDragXAxis } from "@/utils/solid-dnd" +import { navStart } from "@/utils/perf" +import { DialogSelectDirectory } from "@/components/dialog-select-directory" +import { DialogEditProject } from "@/components/dialog-edit-project" +import { Titlebar } from "@/components/titlebar" +import { useServer } from "@/context/server" +import { useLanguage, type Locale } from "@/context/language" + +export default function Layout(props: ParentProps) { + const [store, setStore, , ready] = persisted( + Persist.global("layout.page", ["layout.page.v1"]), + createStore({ + lastSession: {} as { [directory: string]: string }, + activeProject: undefined as string | undefined, + activeWorkspace: undefined as string | undefined, + workspaceOrder: {} as Record, + workspaceName: {} as Record, + workspaceBranchName: {} as Record>, + workspaceExpanded: {} as Record, + }), + ) + + const pageReady = createMemo(() => ready()) + + let scrollContainerRef: HTMLDivElement | undefined + const xlQuery = window.matchMedia("(min-width: 1280px)") + const [isLargeViewport, setIsLargeViewport] = createSignal(xlQuery.matches) + const handleViewportChange = (e: MediaQueryListEvent) => setIsLargeViewport(e.matches) + xlQuery.addEventListener("change", handleViewportChange) + onCleanup(() => xlQuery.removeEventListener("change", handleViewportChange)) + + const params = useParams() + const [autoselect, setAutoselect] = createSignal(!params.dir) + const globalSDK = useGlobalSDK() + const globalSync = useGlobalSync() + const layout = useLayout() + const layoutReady = createMemo(() => layout.ready()) + const platform = usePlatform() + const settings = useSettings() + const server = useServer() + const notification = useNotification() + const permission = usePermission() + const navigate = useNavigate() + const providers = useProviders() + const dialog = useDialog() + const command = useCommand() + const theme = useTheme() + const language = useLanguage() + const initialDir = params.dir + const availableThemeEntries = createMemo(() => Object.entries(theme.themes())) + const colorSchemeOrder: ColorScheme[] = ["system", "light", "dark"] + const colorSchemeKey: Record = { + system: "theme.scheme.system", + light: "theme.scheme.light", + dark: "theme.scheme.dark", + } + const colorSchemeLabel = (scheme: ColorScheme) => language.t(colorSchemeKey[scheme]) + + const [editor, setEditor] = createStore({ + active: "" as string, + value: "", + }) + const [busyWorkspaces, setBusyWorkspaces] = createSignal>(new Set()) + const setBusy = (directory: string, value: boolean) => { + const key = workspaceKey(directory) + setBusyWorkspaces((prev) => { + const next = new Set(prev) + if (value) next.add(key) + else next.delete(key) + return next + }) + } + const isBusy = (directory: string) => busyWorkspaces().has(workspaceKey(directory)) + const editorRef = { current: undefined as HTMLInputElement | undefined } + + const [hoverSession, setHoverSession] = createSignal() + + const autoselecting = createMemo(() => { + if (params.dir) return false + if (initialDir) return false + if (!autoselect()) return false + if (!pageReady()) return true + if (!layoutReady()) return true + const list = layout.projects.list() + if (list.length === 0) return false + return true + }) + + const editorOpen = (id: string) => editor.active === id + const editorValue = () => editor.value + + const openEditor = (id: string, value: string) => { + if (!id) return + setEditor({ active: id, value }) + } + + const closeEditor = () => setEditor({ active: "", value: "" }) + + const saveEditor = (callback: (next: string) => void) => { + const next = editor.value.trim() + if (!next) { + closeEditor() + return + } + closeEditor() + callback(next) + } + + const editorKeyDown = (event: KeyboardEvent, callback: (next: string) => void) => { + if (event.key === "Enter") { + event.preventDefault() + saveEditor(callback) + return + } + if (event.key === "Escape") { + event.preventDefault() + closeEditor() + } + } + + const InlineEditor = (props: { + id: string + value: Accessor + onSave: (next: string) => void + class?: string + displayClass?: string + editing?: boolean + stopPropagation?: boolean + openOnDblClick?: boolean + }) => { + const isEditing = () => props.editing ?? editorOpen(props.id) + const stopEvents = () => props.stopPropagation ?? false + const allowDblClick = () => props.openOnDblClick ?? true + const stopPropagation = (event: Event) => { + if (!stopEvents()) return + event.stopPropagation() + } + const handleDblClick = (event: MouseEvent) => { + if (!allowDblClick()) return + stopPropagation(event) + openEditor(props.id, props.value()) + } + + return ( + + {props.value()} + + } + > + { + editorRef.current = el + requestAnimationFrame(() => el.focus()) + }} + value={editorValue()} + class={props.class} + onInput={(event) => setEditor("value", event.currentTarget.value)} + onKeyDown={(event) => { + event.stopPropagation() + editorKeyDown(event, props.onSave) + }} + onBlur={() => closeEditor()} + onPointerDown={stopPropagation} + onClick={stopPropagation} + onDblClick={stopPropagation} + onMouseDown={stopPropagation} + onMouseUp={stopPropagation} + onTouchStart={stopPropagation} + /> + + ) + } + + function cycleTheme(direction = 1) { + const ids = availableThemeEntries().map(([id]) => id) + if (ids.length === 0) return + const currentIndex = ids.indexOf(theme.themeId()) + const nextIndex = currentIndex === -1 ? 0 : (currentIndex + direction + ids.length) % ids.length + const nextThemeId = ids[nextIndex] + theme.setTheme(nextThemeId) + const nextTheme = theme.themes()[nextThemeId] + showToast({ + title: language.t("toast.theme.title"), + description: nextTheme?.name ?? nextThemeId, + }) + } + + function cycleColorScheme(direction = 1) { + const current = theme.colorScheme() + const currentIndex = colorSchemeOrder.indexOf(current) + const nextIndex = + currentIndex === -1 ? 0 : (currentIndex + direction + colorSchemeOrder.length) % colorSchemeOrder.length + const next = colorSchemeOrder[nextIndex] + theme.setColorScheme(next) + showToast({ + title: language.t("toast.scheme.title"), + description: colorSchemeLabel(next), + }) + } + + function setLocale(next: Locale) { + if (next === language.locale()) return + language.setLocale(next) + showToast({ + title: language.t("toast.language.title"), + description: language.t("toast.language.description", { language: language.label(next) }), + }) + } + + function cycleLanguage(direction = 1) { + const locales = language.locales + const currentIndex = locales.indexOf(language.locale()) + const nextIndex = currentIndex === -1 ? 0 : (currentIndex + direction + locales.length) % locales.length + const next = locales[nextIndex] + if (!next) return + setLocale(next) + } + + onMount(() => { + if (!platform.checkUpdate || !platform.update || !platform.restart) return + + let toastId: number | undefined + + async function pollUpdate() { + const { updateAvailable, version } = await platform.checkUpdate!() + if (updateAvailable && toastId === undefined) { + toastId = showToast({ + persistent: true, + icon: "download", + title: language.t("toast.update.title"), + description: language.t("toast.update.description", { version: version ?? "" }), + actions: [ + { + label: language.t("toast.update.action.installRestart"), + onClick: async () => { + await platform.update!() + await platform.restart!() + }, + }, + { + label: language.t("toast.update.action.notYet"), + onClick: "dismiss", + }, + ], + }) + } + } + + pollUpdate() + const interval = setInterval(pollUpdate, 10 * 60 * 1000) + onCleanup(() => clearInterval(interval)) + }) + + onMount(() => { + const toastBySession = new Map() + const alertedAtBySession = new Map() + const cooldownMs = 5000 + + const unsub = globalSDK.event.listen((e) => { + if (e.details?.type !== "permission.asked" && e.details?.type !== "question.asked") return + const title = + e.details.type === "permission.asked" + ? language.t("notification.permission.title") + : language.t("notification.question.title") + const icon = e.details.type === "permission.asked" ? ("checklist" as const) : ("bubble-5" as const) + const directory = e.name + const props = e.details.properties + if (e.details.type === "permission.asked" && permission.autoResponds(e.details.properties, directory)) return + + const [store] = globalSync.child(directory) + const session = store.session.find((s) => s.id === props.sessionID) + const sessionKey = `${directory}:${props.sessionID}` + + const sessionTitle = session?.title ?? language.t("command.session.new") + const projectName = getFilename(directory) + const description = + e.details.type === "permission.asked" + ? language.t("notification.permission.description", { sessionTitle, projectName }) + : language.t("notification.question.description", { sessionTitle, projectName }) + const href = `/${base64Encode(directory)}/session/${props.sessionID}` + + const now = Date.now() + const lastAlerted = alertedAtBySession.get(sessionKey) ?? 0 + if (now - lastAlerted < cooldownMs) return + alertedAtBySession.set(sessionKey, now) + + if (e.details.type === "permission.asked") { + playSound(soundSrc(settings.sounds.permissions())) + if (settings.notifications.permissions()) { + void platform.notify(title, description, href) + } + } + + if (e.details.type === "question.asked") { + if (settings.notifications.agent()) { + void platform.notify(title, description, href) + } + } + + const currentDir = params.dir ? base64Decode(params.dir) : undefined + const currentSession = params.id + if (directory === currentDir && props.sessionID === currentSession) return + if (directory === currentDir && session?.parentID === currentSession) return + + const existingToastId = toastBySession.get(sessionKey) + if (existingToastId !== undefined) toaster.dismiss(existingToastId) + + const toastId = showToast({ + persistent: true, + icon, + title, + description, + actions: [ + { + label: language.t("notification.action.goToSession"), + onClick: () => navigate(href), + }, + { + label: language.t("common.dismiss"), + onClick: "dismiss", + }, + ], + }) + toastBySession.set(sessionKey, toastId) + }) + onCleanup(unsub) + + createEffect(() => { + const currentDir = params.dir ? base64Decode(params.dir) : undefined + const currentSession = params.id + if (!currentDir || !currentSession) return + const sessionKey = `${currentDir}:${currentSession}` + const toastId = toastBySession.get(sessionKey) + if (toastId !== undefined) { + toaster.dismiss(toastId) + toastBySession.delete(sessionKey) + alertedAtBySession.delete(sessionKey) + } + const [store] = globalSync.child(currentDir) + const childSessions = store.session.filter((s) => s.parentID === currentSession) + for (const child of childSessions) { + const childKey = `${currentDir}:${child.id}` + const childToastId = toastBySession.get(childKey) + if (childToastId !== undefined) { + toaster.dismiss(childToastId) + toastBySession.delete(childKey) + alertedAtBySession.delete(childKey) + } + } + }) + }) + + function sortSessions(a: Session, b: Session) { + const now = Date.now() + const oneMinuteAgo = now - 60 * 1000 + const aUpdated = a.time.updated ?? a.time.created + const bUpdated = b.time.updated ?? b.time.created + const aRecent = aUpdated > oneMinuteAgo + const bRecent = bUpdated > oneMinuteAgo + if (aRecent && bRecent) return a.id.localeCompare(b.id) + if (aRecent && !bRecent) return -1 + if (!aRecent && bRecent) return 1 + return bUpdated - aUpdated + } + + const [scrollSessionKey, setScrollSessionKey] = createSignal(undefined) + + function scrollToSession(sessionId: string, sessionKey: string) { + if (!scrollContainerRef) return + if (scrollSessionKey() === sessionKey) return + const element = scrollContainerRef.querySelector(`[data-session-id="${sessionId}"]`) + if (!element) return + const containerRect = scrollContainerRef.getBoundingClientRect() + const elementRect = element.getBoundingClientRect() + if (elementRect.top >= containerRect.top && elementRect.bottom <= containerRect.bottom) { + setScrollSessionKey(sessionKey) + return + } + setScrollSessionKey(sessionKey) + element.scrollIntoView({ block: "nearest", behavior: "smooth" }) + } + + const currentProject = createMemo(() => { + const directory = params.dir ? base64Decode(params.dir) : undefined + if (!directory) return + + const projects = layout.projects.list() + + const sandbox = projects.find((p) => p.sandboxes?.includes(directory)) + if (sandbox) return sandbox + + const direct = projects.find((p) => p.worktree === directory) + if (direct) return direct + + const [child] = globalSync.child(directory) + const id = child.project + if (!id) return + + const meta = globalSync.data.project.find((p) => p.id === id) + const root = meta?.worktree + if (!root) return + + return projects.find((p) => p.worktree === root) + }) + + createEffect( + on( + () => ({ ready: pageReady(), project: currentProject() }), + (value) => { + if (!value.ready) return + const project = value.project + if (!project) return + const last = server.projects.last() + if (last === project.worktree) return + server.projects.touch(project.worktree) + }, + { defer: true }, + ), + ) + + createEffect( + on( + () => ({ ready: pageReady(), layoutReady: layoutReady(), dir: params.dir, list: layout.projects.list() }), + (value) => { + if (!value.ready) return + if (!value.layoutReady) return + if (!autoselect()) return + if (initialDir) return + if (value.dir) return + if (value.list.length === 0) return + + const last = server.projects.last() + const next = value.list.find((project) => project.worktree === last) ?? value.list[0] + if (!next) return + setAutoselect(false) + openProject(next.worktree, false) + navigateToProject(next.worktree) + }, + { defer: true }, + ), + ) + + const workspaceKey = (directory: string) => directory.replace(/[\\/]+$/, "") + + const workspaceName = (directory: string, projectId?: string, branch?: string) => { + const key = workspaceKey(directory) + const direct = store.workspaceName[key] ?? store.workspaceName[directory] + if (direct) return direct + if (!projectId) return + if (!branch) return + return store.workspaceBranchName[projectId]?.[branch] + } + + const setWorkspaceName = (directory: string, next: string, projectId?: string, branch?: string) => { + const key = workspaceKey(directory) + setStore("workspaceName", (prev) => ({ ...(prev ?? {}), [key]: next })) + if (!projectId) return + if (!branch) return + setStore("workspaceBranchName", projectId, (prev) => ({ ...(prev ?? {}), [branch]: next })) + } + + const workspaceLabel = (directory: string, branch?: string, projectId?: string) => + workspaceName(directory, projectId, branch) ?? branch ?? getFilename(directory) + + const isWorkspaceEditing = () => editor.active.startsWith("workspace:") + + const workspaceSetting = createMemo(() => { + const project = currentProject() + if (!project) return false + return layout.sidebar.workspaces(project.worktree)() + }) + + createEffect(() => { + if (!pageReady()) return + if (!layoutReady()) return + const project = currentProject() + if (!project) return + + const dirs = [project.worktree, ...(project.sandboxes ?? [])] + const existing = store.workspaceOrder[project.worktree] + if (!existing) { + setStore("workspaceOrder", project.worktree, dirs) + return + } + + const keep = existing.filter((d) => dirs.includes(d)) + const missing = dirs.filter((d) => !existing.includes(d)) + const merged = [...keep, ...missing] + + if (merged.length !== existing.length) { + setStore("workspaceOrder", project.worktree, merged) + return + } + + if (merged.some((d, i) => d !== existing[i])) { + setStore("workspaceOrder", project.worktree, merged) + } + }) + + createEffect(() => { + if (!pageReady()) return + if (!layoutReady()) return + const projects = layout.projects.list() + for (const [directory, expanded] of Object.entries(store.workspaceExpanded)) { + if (!expanded) continue + const project = projects.find((item) => item.worktree === directory || item.sandboxes?.includes(directory)) + if (!project) continue + if (layout.sidebar.workspaces(project.worktree)()) continue + setStore("workspaceExpanded", directory, false) + } + }) + + const currentSessions = createMemo(() => { + const project = currentProject() + if (!project) return [] as Session[] + if (workspaceSetting()) { + const dirs = workspaceIds(project) + const activeDir = params.dir ? base64Decode(params.dir) : "" + const result: Session[] = [] + for (const dir of dirs) { + const expanded = store.workspaceExpanded[dir] ?? dir === project.worktree + const active = dir === activeDir + if (!expanded && !active) continue + const [dirStore] = globalSync.child(dir, { bootstrap: true }) + const dirSessions = dirStore.session + .filter((session) => session.directory === dirStore.path.directory) + .filter((session) => !session.parentID && !session.time?.archived) + .toSorted(sortSessions) + result.push(...dirSessions) + } + return result + } + const [projectStore] = globalSync.child(project.worktree) + return projectStore.session + .filter((session) => session.directory === projectStore.path.directory) + .filter((session) => !session.parentID && !session.time?.archived) + .toSorted(sortSessions) + }) + + type PrefetchQueue = { + inflight: Set + pending: string[] + pendingSet: Set + running: number + } + + const prefetchChunk = 600 + const prefetchConcurrency = 1 + const prefetchPendingLimit = 6 + const prefetchToken = { value: 0 } + const prefetchQueues = new Map() + + createEffect(() => { + params.dir + globalSDK.url + + prefetchToken.value += 1 + for (const q of prefetchQueues.values()) { + q.pending.length = 0 + q.pendingSet.clear() + } + }) + + const queueFor = (directory: string) => { + const existing = prefetchQueues.get(directory) + if (existing) return existing + + const created: PrefetchQueue = { + inflight: new Set(), + pending: [], + pendingSet: new Set(), + running: 0, + } + prefetchQueues.set(directory, created) + return created + } + + async function prefetchMessages(directory: string, sessionID: string, token: number) { + const [, setStore] = globalSync.child(directory) + + return retry(() => globalSDK.client.session.messages({ directory, sessionID, limit: prefetchChunk })) + .then((messages) => { + if (prefetchToken.value !== token) return + + const items = (messages.data ?? []).filter((x) => !!x?.info?.id) + const next = items + .map((x) => x.info) + .filter((m) => !!m?.id) + .slice() + .sort((a, b) => a.id.localeCompare(b.id)) + + batch(() => { + setStore("message", sessionID, reconcile(next, { key: "id" })) + + for (const message of items) { + setStore( + "part", + message.info.id, + reconcile( + message.parts + .filter((p) => !!p?.id) + .slice() + .sort((a, b) => a.id.localeCompare(b.id)), + { key: "id" }, + ), + ) + } + }) + }) + .catch(() => undefined) + } + + const pumpPrefetch = (directory: string) => { + const q = queueFor(directory) + if (q.running >= prefetchConcurrency) return + + const sessionID = q.pending.shift() + if (!sessionID) return + + q.pendingSet.delete(sessionID) + q.inflight.add(sessionID) + q.running += 1 + + const token = prefetchToken.value + + void prefetchMessages(directory, sessionID, token).finally(() => { + q.running -= 1 + q.inflight.delete(sessionID) + pumpPrefetch(directory) + }) + } + + const prefetchSession = (session: Session, priority: "high" | "low" = "low") => { + const directory = session.directory + if (!directory) return + + const [store] = globalSync.child(directory) + if (store.message[session.id] !== undefined) return + + const q = queueFor(directory) + if (q.inflight.has(session.id)) return + if (q.pendingSet.has(session.id)) return + + if (priority === "high") q.pending.unshift(session.id) + if (priority !== "high") q.pending.push(session.id) + q.pendingSet.add(session.id) + + while (q.pending.length > prefetchPendingLimit) { + const dropped = q.pending.pop() + if (!dropped) continue + q.pendingSet.delete(dropped) + } + + pumpPrefetch(directory) + } + + createEffect(() => { + const sessions = currentSessions() + const id = params.id + + if (!id) { + const first = sessions[0] + if (first) prefetchSession(first) + + const second = sessions[1] + if (second) prefetchSession(second) + return + } + + const index = sessions.findIndex((s) => s.id === id) + if (index === -1) return + + const next = sessions[index + 1] + if (next) prefetchSession(next) + + const prev = sessions[index - 1] + if (prev) prefetchSession(prev) + }) + + function navigateSessionByOffset(offset: number) { + const sessions = currentSessions() + if (sessions.length === 0) return + + const sessionIndex = params.id ? sessions.findIndex((s) => s.id === params.id) : -1 + + let targetIndex: number + if (sessionIndex === -1) { + targetIndex = offset > 0 ? 0 : sessions.length - 1 + } else { + targetIndex = (sessionIndex + offset + sessions.length) % sessions.length + } + + const session = sessions[targetIndex] + if (!session) return + + const next = sessions[(targetIndex + 1) % sessions.length] + const prev = sessions[(targetIndex - 1 + sessions.length) % sessions.length] + + if (offset > 0) { + if (next) prefetchSession(next, "high") + if (prev) prefetchSession(prev) + } + + if (offset < 0) { + if (prev) prefetchSession(prev, "high") + if (next) prefetchSession(next) + } + + if (import.meta.env.DEV) { + navStart({ + dir: base64Encode(session.directory), + from: params.id, + to: session.id, + trigger: offset > 0 ? "alt+arrowdown" : "alt+arrowup", + }) + } + navigateToSession(session) + queueMicrotask(() => scrollToSession(session.id, `${session.directory}:${session.id}`)) + } + + async function archiveSession(session: Session) { + const [store, setStore] = globalSync.child(session.directory) + const sessions = store.session ?? [] + const index = sessions.findIndex((s) => s.id === session.id) + const nextSession = sessions[index + 1] ?? sessions[index - 1] + + await globalSDK.client.session.update({ + directory: session.directory, + sessionID: session.id, + time: { archived: Date.now() }, + }) + setStore( + produce((draft) => { + const match = Binary.search(draft.session, session.id, (s) => s.id) + if (match.found) draft.session.splice(match.index, 1) + }), + ) + if (session.id === params.id) { + if (nextSession) { + navigate(`/${params.dir}/session/${nextSession.id}`) + } else { + navigate(`/${params.dir}/session`) + } + } + } + + async function deleteSession(session: Session) { + const [store, setStore] = globalSync.child(session.directory) + const sessions = (store.session ?? []).filter((s) => !s.parentID && !s.time?.archived) + const index = sessions.findIndex((s) => s.id === session.id) + const nextSession = sessions[index + 1] ?? sessions[index - 1] + + const result = await globalSDK.client.session + .delete({ directory: session.directory, sessionID: session.id }) + .then((x) => x.data) + .catch((err) => { + showToast({ + title: language.t("session.delete.failed.title"), + description: errorMessage(err), + }) + return false + }) + + if (!result) return + + setStore( + produce((draft) => { + const removed = new Set([session.id]) + const collect = (parentID: string) => { + for (const item of draft.session) { + if (item.parentID !== parentID) continue + removed.add(item.id) + collect(item.id) + } + } + collect(session.id) + draft.session = draft.session.filter((s) => !removed.has(s.id)) + }), + ) + + if (session.id === params.id) { + if (nextSession) { + navigate(`/${params.dir}/session/${nextSession.id}`) + } else { + navigate(`/${params.dir}/session`) + } + } + } + + command.register(() => { + const commands: CommandOption[] = [ + { + id: "sidebar.toggle", + title: language.t("command.sidebar.toggle"), + category: language.t("command.category.view"), + keybind: "mod+b", + onSelect: () => layout.sidebar.toggle(), + }, + { + id: "project.open", + title: language.t("command.project.open"), + category: language.t("command.category.project"), + keybind: "mod+o", + onSelect: () => chooseProject(), + }, + { + id: "provider.connect", + title: language.t("command.provider.connect"), + category: language.t("command.category.provider"), + onSelect: () => connectProvider(), + }, + { + id: "server.switch", + title: language.t("command.server.switch"), + category: language.t("command.category.server"), + onSelect: () => openServer(), + }, + { + id: "settings.open", + title: language.t("command.settings.open"), + category: language.t("command.category.settings"), + keybind: "mod+comma", + onSelect: () => openSettings(), + }, + { + id: "session.previous", + title: language.t("command.session.previous"), + category: language.t("command.category.session"), + keybind: "alt+arrowup", + onSelect: () => navigateSessionByOffset(-1), + }, + { + id: "session.next", + title: language.t("command.session.next"), + category: language.t("command.category.session"), + keybind: "alt+arrowdown", + onSelect: () => navigateSessionByOffset(1), + }, + { + id: "session.archive", + title: language.t("command.session.archive"), + category: language.t("command.category.session"), + keybind: "mod+shift+backspace", + disabled: !params.dir || !params.id, + onSelect: () => { + const session = currentSessions().find((s) => s.id === params.id) + if (session) archiveSession(session) + }, + }, + { + id: "theme.cycle", + title: language.t("command.theme.cycle"), + category: language.t("command.category.theme"), + keybind: "mod+shift+t", + onSelect: () => cycleTheme(1), + }, + ] + + for (const [id, definition] of availableThemeEntries()) { + commands.push({ + id: `theme.set.${id}`, + title: language.t("command.theme.set", { theme: definition.name ?? id }), + category: language.t("command.category.theme"), + onSelect: () => theme.commitPreview(), + onHighlight: () => { + theme.previewTheme(id) + return () => theme.cancelPreview() + }, + }) + } + + commands.push({ + id: "theme.scheme.cycle", + title: language.t("command.theme.scheme.cycle"), + category: language.t("command.category.theme"), + keybind: "mod+shift+s", + onSelect: () => cycleColorScheme(1), + }) + + for (const scheme of colorSchemeOrder) { + commands.push({ + id: `theme.scheme.${scheme}`, + title: language.t("command.theme.scheme.set", { scheme: colorSchemeLabel(scheme) }), + category: language.t("command.category.theme"), + onSelect: () => theme.commitPreview(), + onHighlight: () => { + theme.previewColorScheme(scheme) + return () => theme.cancelPreview() + }, + }) + } + + commands.push({ + id: "language.cycle", + title: language.t("command.language.cycle"), + category: language.t("command.category.language"), + onSelect: () => cycleLanguage(1), + }) + + for (const locale of language.locales) { + commands.push({ + id: `language.set.${locale}`, + title: language.t("command.language.set", { language: language.label(locale) }), + category: language.t("command.category.language"), + onSelect: () => setLocale(locale), + }) + } + + return commands + }) + + function connectProvider() { + dialog.show(() => ) + } + + function openServer() { + dialog.show(() => ) + } + + function openSettings() { + dialog.show(() => ) + } + + function navigateToProject(directory: string | undefined) { + if (!directory) return + server.projects.touch(directory) + const lastSession = store.lastSession[directory] + navigate(`/${base64Encode(directory)}${lastSession ? `/session/${lastSession}` : ""}`) + layout.mobileSidebar.hide() + } + + function navigateToSession(session: Session | undefined) { + if (!session) return + navigate(`/${base64Encode(session.directory)}/session/${session.id}`) + layout.mobileSidebar.hide() + } + + function openProject(directory: string, navigate = true) { + layout.projects.open(directory) + if (navigate) navigateToProject(directory) + } + + const displayName = (project: LocalProject) => project.name || getFilename(project.worktree) + + async function renameProject(project: LocalProject, next: string) { + const current = displayName(project) + if (next === current) return + const name = next === getFilename(project.worktree) ? "" : next + + if (project.id && project.id !== "global") { + await globalSDK.client.project.update({ projectID: project.id, directory: project.worktree, name }) + return + } + + globalSync.project.meta(project.worktree, { name }) + } + + async function renameSession(session: Session, next: string) { + if (next === session.title) return + await globalSDK.client.session.update({ + directory: session.directory, + sessionID: session.id, + title: next, + }) + } + + const renameWorkspace = (directory: string, next: string, projectId?: string, branch?: string) => { + const current = workspaceName(directory, projectId, branch) ?? branch ?? getFilename(directory) + if (current === next) return + setWorkspaceName(directory, next, projectId, branch) + } + + function closeProject(directory: string) { + const index = layout.projects.list().findIndex((x) => x.worktree === directory) + const next = layout.projects.list()[index + 1] + layout.projects.close(directory) + if (next) navigateToProject(next.worktree) + else navigate("/") + } + + async function chooseProject() { + function resolve(result: string | string[] | null) { + if (Array.isArray(result)) { + for (const directory of result) { + openProject(directory, false) + } + navigateToProject(result[0]) + } else if (result) { + openProject(result) + } + } + + if (platform.openDirectoryPickerDialog && server.isLocal()) { + const result = await platform.openDirectoryPickerDialog?.({ + title: language.t("command.project.open"), + multiple: true, + }) + resolve(result) + } else { + dialog.show( + () => , + () => resolve(null), + ) + } + } + + const errorMessage = (err: unknown) => { + if (err && typeof err === "object" && "data" in err) { + const data = (err as { data?: { message?: string } }).data + if (data?.message) return data.message + } + if (err instanceof Error) return err.message + return language.t("common.requestFailed") + } + + const deleteWorkspace = async (directory: string) => { + const current = currentProject() + if (!current) return + if (directory === current.worktree) return + + setBusy(directory, true) + + const result = await globalSDK.client.worktree + .remove({ directory: current.worktree, worktreeRemoveInput: { directory } }) + .then((x) => x.data) + .catch((err) => { + showToast({ + title: language.t("workspace.delete.failed.title"), + description: errorMessage(err), + }) + return false + }) + + setBusy(directory, false) + + if (!result) return + + layout.projects.close(directory) + layout.projects.open(current.worktree) + + if (params.dir && base64Decode(params.dir) === directory) { + navigateToProject(current.worktree) + } + } + + const resetWorkspace = async (directory: string) => { + const current = currentProject() + if (!current) return + if (directory === current.worktree) return + setBusy(directory, true) + + const progress = showToast({ + persistent: true, + title: language.t("workspace.resetting.title"), + description: language.t("workspace.resetting.description"), + }) + const dismiss = () => toaster.dismiss(progress) + + const sessions = await globalSDK.client.session + .list({ directory }) + .then((x) => x.data ?? []) + .catch(() => []) + + const result = await globalSDK.client.worktree + .reset({ directory: current.worktree, worktreeResetInput: { directory } }) + .then((x) => x.data) + .catch((err) => { + showToast({ + title: language.t("workspace.reset.failed.title"), + description: errorMessage(err), + }) + return false + }) + + if (!result) { + setBusy(directory, false) + dismiss() + return + } + + const archivedAt = Date.now() + await Promise.all( + sessions + .filter((session) => session.time.archived === undefined) + .map((session) => + globalSDK.client.session + .update({ + sessionID: session.id, + directory: session.directory, + time: { archived: archivedAt }, + }) + .catch(() => undefined), + ), + ) + + await globalSDK.client.instance.dispose({ directory }).catch(() => undefined) + + setBusy(directory, false) + dismiss() + + showToast({ + title: language.t("workspace.reset.success.title"), + description: language.t("workspace.reset.success.description"), + actions: [ + { + label: language.t("command.session.new"), + onClick: () => { + const href = `/${base64Encode(directory)}/session` + navigate(href) + layout.mobileSidebar.hide() + }, + }, + { + label: language.t("common.dismiss"), + onClick: "dismiss", + }, + ], + }) + } + + function DialogDeleteSession(props: { session: Session }) { + const handleDelete = async () => { + await deleteSession(props.session) + dialog.close() + } + + return ( + +
    +
    + + {language.t("session.delete.confirm", { name: props.session.title })} + +
    +
    + + +
    +
    +
    + ) + } + + function DialogDeleteWorkspace(props: { directory: string }) { + const name = createMemo(() => getFilename(props.directory)) + const [data, setData] = createStore({ + status: "loading" as "loading" | "ready" | "error", + dirty: false, + }) + + onMount(() => { + const current = currentProject() + if (!current) { + setData({ status: "error", dirty: false }) + return + } + + globalSDK.client.file + .status({ directory: props.directory }) + .then((x) => { + const files = x.data ?? [] + const dirty = files.length > 0 + setData({ status: "ready", dirty }) + }) + .catch(() => { + setData({ status: "error", dirty: false }) + }) + }) + + const handleDelete = async () => { + await deleteWorkspace(props.directory) + dialog.close() + } + + const description = () => { + if (data.status === "loading") return language.t("workspace.status.checking") + if (data.status === "error") return language.t("workspace.status.error") + if (!data.dirty) return language.t("workspace.status.clean") + return language.t("workspace.status.dirty") + } + + return ( + +
    +
    + + {language.t("workspace.delete.confirm", { name: name() })} + + {description()} +
    +
    + + +
    +
    +
    + ) + } + + function DialogResetWorkspace(props: { directory: string }) { + const name = createMemo(() => getFilename(props.directory)) + const [state, setState] = createStore({ + status: "loading" as "loading" | "ready" | "error", + dirty: false, + sessions: [] as Session[], + }) + + const refresh = async () => { + const sessions = await globalSDK.client.session + .list({ directory: props.directory }) + .then((x) => x.data ?? []) + .catch(() => []) + const active = sessions.filter((session) => session.time.archived === undefined) + setState({ sessions: active }) + } + + onMount(() => { + const current = currentProject() + if (!current) { + setState({ status: "error", dirty: false }) + return + } + + globalSDK.client.file + .status({ directory: props.directory }) + .then((x) => { + const files = x.data ?? [] + const dirty = files.length > 0 + setState({ status: "ready", dirty }) + void refresh() + }) + .catch(() => { + setState({ status: "error", dirty: false }) + }) + }) + + const handleReset = () => { + dialog.close() + void resetWorkspace(props.directory) + } + + const archivedCount = () => state.sessions.length + + const description = () => { + if (state.status === "loading") return language.t("workspace.status.checking") + if (state.status === "error") return language.t("workspace.status.error") + if (!state.dirty) return language.t("workspace.status.clean") + return language.t("workspace.status.dirty") + } + + const archivedLabel = () => { + const count = archivedCount() + if (count === 0) return language.t("workspace.reset.archived.none") + if (count === 1) return language.t("workspace.reset.archived.one") + return language.t("workspace.reset.archived.many", { count }) + } + + return ( + +
    +
    + + {language.t("workspace.reset.confirm", { name: name() })} + + + {description()} {archivedLabel()} {language.t("workspace.reset.note")} + +
    +
    + + +
    +
    +
    + ) + } + + createEffect( + on( + () => ({ ready: pageReady(), dir: params.dir, id: params.id }), + (value) => { + if (!value.ready) return + const dir = value.dir + const id = value.id + if (!dir || !id) return + const directory = base64Decode(dir) + setStore("lastSession", directory, id) + notification.session.markViewed(id) + const expanded = untrack(() => store.workspaceExpanded[directory]) + if (expanded === false) { + setStore("workspaceExpanded", directory, true) + } + requestAnimationFrame(() => scrollToSession(id, `${directory}:${id}`)) + }, + { defer: true }, + ), + ) + + createEffect(() => { + const project = currentProject() + if (!project) return + + if (workspaceSetting()) { + const activeDir = params.dir ? base64Decode(params.dir) : "" + const dirs = [project.worktree, ...(project.sandboxes ?? [])] + for (const directory of dirs) { + const expanded = store.workspaceExpanded[directory] ?? directory === project.worktree + const active = directory === activeDir + if (!expanded && !active) continue + globalSync.project.loadSessions(directory) + } + return + } + + globalSync.project.loadSessions(project.worktree) + }) + + function getDraggableId(event: unknown): string | undefined { + if (typeof event !== "object" || event === null) return undefined + if (!("draggable" in event)) return undefined + const draggable = (event as { draggable?: { id?: unknown } }).draggable + if (!draggable) return undefined + return typeof draggable.id === "string" ? draggable.id : undefined + } + + function handleDragStart(event: unknown) { + const id = getDraggableId(event) + if (!id) return + setStore("activeProject", id) + } + + function handleDragOver(event: DragEvent) { + const { draggable, droppable } = event + if (draggable && droppable) { + const projects = layout.projects.list() + const fromIndex = projects.findIndex((p) => p.worktree === draggable.id.toString()) + const toIndex = projects.findIndex((p) => p.worktree === droppable.id.toString()) + if (fromIndex !== toIndex && toIndex !== -1) { + layout.projects.move(draggable.id.toString(), toIndex) + } + } + } + + function handleDragEnd() { + setStore("activeProject", undefined) + } + + function workspaceIds(project: LocalProject | undefined) { + if (!project) return [] + const dirs = [project.worktree, ...(project.sandboxes ?? [])] + const active = currentProject() + const directory = active?.worktree === project.worktree && params.dir ? base64Decode(params.dir) : undefined + const next = directory && directory !== project.worktree && !dirs.includes(directory) ? [...dirs, directory] : dirs + + const existing = store.workspaceOrder[project.worktree] + if (!existing) return next + + const keep = existing.filter((d) => next.includes(d)) + const missing = next.filter((d) => !existing.includes(d)) + return [...keep, ...missing] + } + + function handleWorkspaceDragStart(event: unknown) { + const id = getDraggableId(event) + if (!id) return + setStore("activeWorkspace", id) + } + + function handleWorkspaceDragOver(event: DragEvent) { + const { draggable, droppable } = event + if (!draggable || !droppable) return + + const project = currentProject() + if (!project) return + + const ids = workspaceIds(project) + const fromIndex = ids.findIndex((dir) => dir === draggable.id.toString()) + const toIndex = ids.findIndex((dir) => dir === droppable.id.toString()) + if (fromIndex === -1 || toIndex === -1) return + if (fromIndex === toIndex) return + + const result = ids.slice() + const [item] = result.splice(fromIndex, 1) + if (!item) return + result.splice(toIndex, 0, item) + setStore("workspaceOrder", project.worktree, result) + } + + function handleWorkspaceDragEnd() { + setStore("activeWorkspace", undefined) + } + + const ProjectIcon = (props: { project: LocalProject; class?: string; notify?: boolean }): JSX.Element => { + const notification = useNotification() + const notifications = createMemo(() => notification.project.unseen(props.project.worktree)) + const hasError = createMemo(() => notifications().some((n) => n.type === "error")) + const name = createMemo(() => props.project.name || getFilename(props.project.worktree)) + const mask = "radial-gradient(circle 5px at calc(100% - 4px) 4px, transparent 5px, black 5.5px)" + const opencode = "4b0ea68d7af9a6031a7ffda7ad66e0cb83315750" + + return ( +
    +
    + 0 && props.notify + ? { "-webkit-mask-image": mask, "mask-image": mask } + : undefined + } + /> +
    + 0 && props.notify}> +
    + +
    + ) + } + + const SessionItem = (props: { + session: Session + slug: string + mobile?: boolean + dense?: boolean + popover?: boolean + }): JSX.Element => { + const notification = useNotification() + const notifications = createMemo(() => notification.session.unseen(props.session.id)) + const hasError = createMemo(() => notifications().some((n) => n.type === "error")) + const [sessionStore] = globalSync.child(props.session.directory) + const hasPermissions = createMemo(() => { + const permissions = sessionStore.permission?.[props.session.id] ?? [] + if (permissions.length > 0) return true + const childSessions = sessionStore.session.filter((s) => s.parentID === props.session.id) + for (const child of childSessions) { + const childPermissions = sessionStore.permission?.[child.id] ?? [] + if (childPermissions.length > 0) return true + } + return false + }) + const isWorking = createMemo(() => { + if (hasPermissions()) return false + const status = sessionStore.session_status[props.session.id] + return status?.type === "busy" || status?.type === "retry" + }) + + const tint = createMemo(() => { + const messages = sessionStore.message[props.session.id] + if (!messages) return undefined + const user = messages + .slice() + .reverse() + .find((m) => m.role === "user") + if (!user?.agent) return undefined + + const agent = sessionStore.agent.find((a) => a.name === user.agent) + return agent?.color + }) + + const hoverMessages = createMemo(() => + sessionStore.message[props.session.id]?.filter((message) => message.role === "user"), + ) + const hoverReady = createMemo(() => sessionStore.message[props.session.id] !== undefined) + const hoverAllowed = createMemo(() => !props.mobile && layout.sidebar.opened()) + const hoverEnabled = createMemo(() => (props.popover ?? true) && hoverAllowed()) + const isActive = createMemo(() => props.session.id === params.id) + const [menuOpen, setMenuOpen] = createSignal(false) + const [pendingRename, setPendingRename] = createSignal(false) + + const messageLabel = (message: Message) => { + const parts = sessionStore.part[message.id] ?? [] + const text = parts.find((part): part is TextPart => part?.type === "text" && !part.synthetic && !part.ignored) + return text?.text + } + + const item = ( + prefetchSession(props.session, "high")} + onFocus={() => prefetchSession(props.session, "high")} + onClick={() => setHoverSession(undefined)} + > +
    +
    + }> + + + + +
    + + +
    + + 0}> +
    + + +
    + props.session.title} + onSave={(next) => renameSession(props.session, next)} + class="text-14-regular text-text-strong grow-1 min-w-0 overflow-hidden text-ellipsis truncate" + displayClass="text-14-regular text-text-strong grow-1 min-w-0 overflow-hidden text-ellipsis truncate" + stopPropagation + /> + + {(summary) => ( +
    + +
    + )} +
    +
    +
    + ) + + return ( +
    + + {item} + + } + > + setHoverSession(open ? props.session.id : undefined)} + > + {language.t("session.messages.loading")}
    } + > +
    + { + if (!isActive()) { + sessionStorage.setItem("opencode.pendingMessage", `${props.session.id}|${message.id}`) + navigate(`${props.slug}/session/${props.session.id}`) + return + } + window.history.replaceState(null, "", `#message-${message.id}`) + window.dispatchEvent(new HashChangeEvent("hashchange")) + }} + size="normal" + class="w-60" + /> +
    + + + +
    + + + + + + { + if (!pendingRename()) return + event.preventDefault() + setPendingRename(false) + openEditor(`session:${props.session.id}`, props.session.title) + }} + > + { + setPendingRename(true) + setMenuOpen(false) + }} + > + {language.t("common.rename")} + + archiveSession(props.session)}> + {language.t("common.archive")} + + + dialog.show(() => )}> + {language.t("common.delete")} + + + + +
    +
    + ) + } + + const NewSessionItem = (props: { slug: string; mobile?: boolean; dense?: boolean }): JSX.Element => { + const label = language.t("command.session.new") + const tooltip = () => props.mobile || !layout.sidebar.opened() + const item = ( + setHoverSession(undefined)} + > +
    +
    + +
    + + {label} + +
    +
    + ) + + return ( +
    + + {item} + + } + > + {item} + +
    + ) + } + + const SessionSkeleton = (props: { count?: number }): JSX.Element => { + const items = Array.from({ length: props.count ?? 4 }, (_, index) => index) + return ( +
    + + {() =>
    } + +
    + ) + } + + const ProjectDragOverlay = (): JSX.Element => { + const project = createMemo(() => layout.projects.list().find((p) => p.worktree === store.activeProject)) + return ( + + {(p) => ( +
    + +
    + )} +
    + ) + } + + const WorkspaceDragOverlay = (): JSX.Element => { + const label = createMemo(() => { + const project = currentProject() + if (!project) return + const directory = store.activeWorkspace + if (!directory) return + + const [workspaceStore] = globalSync.child(directory) + const kind = + directory === project.worktree ? language.t("workspace.type.local") : language.t("workspace.type.sandbox") + const name = workspaceLabel(directory, workspaceStore.vcs?.branch, project.id) + return `${kind} : ${name}` + }) + + return ( + + {(value) => ( +
    {value()}
    + )} +
    + ) + } + + const SortableWorkspace = (props: { directory: string; project: LocalProject; mobile?: boolean }): JSX.Element => { + const sortable = createSortable(props.directory) + const [workspaceStore, setWorkspaceStore] = globalSync.child(props.directory, { bootstrap: false }) + const [menuOpen, setMenuOpen] = createSignal(false) + const [pendingRename, setPendingRename] = createSignal(false) + const slug = createMemo(() => base64Encode(props.directory)) + const sessions = createMemo(() => + workspaceStore.session + .filter((session) => session.directory === workspaceStore.path.directory) + .filter((session) => !session.parentID && !session.time?.archived) + .toSorted(sortSessions), + ) + const local = createMemo(() => props.directory === props.project.worktree) + const active = createMemo(() => { + const current = params.dir ? base64Decode(params.dir) : "" + return current === props.directory + }) + const workspaceValue = createMemo(() => { + const branch = workspaceStore.vcs?.branch + const name = branch ?? getFilename(props.directory) + return workspaceName(props.directory, props.project.id, branch) ?? name + }) + const open = createMemo(() => store.workspaceExpanded[props.directory] ?? local()) + const boot = createMemo(() => open() || active()) + const loading = createMemo(() => open() && workspaceStore.status !== "complete" && sessions().length === 0) + const hasMore = createMemo(() => local() && workspaceStore.sessionTotal > workspaceStore.session.length) + const busy = createMemo(() => isBusy(props.directory)) + const loadMore = async () => { + if (!local()) return + setWorkspaceStore("limit", (limit) => limit + 5) + await globalSync.project.loadSessions(props.directory) + } + + const workspaceEditActive = createMemo(() => editorOpen(`workspace:${props.directory}`)) + + const openWrapper = (value: boolean) => { + setStore("workspaceExpanded", props.directory, value) + if (value) return + if (editorOpen(`workspace:${props.directory}`)) closeEditor() + } + + createEffect(() => { + if (!boot()) return + globalSync.child(props.directory, { bootstrap: true }) + }) + + const header = () => ( +
    +
    + }> + + +
    + + {local() ? language.t("workspace.type.local") : language.t("workspace.type.sandbox")} : + + + {workspaceStore.vcs?.branch ?? getFilename(props.directory)} + + } + > + { + const trimmed = next.trim() + if (!trimmed) return + renameWorkspace(props.directory, trimmed, props.project.id, workspaceStore.vcs?.branch) + setEditor("value", workspaceValue()) + }} + class="text-14-medium text-text-base min-w-0 truncate" + displayClass="text-14-medium text-text-base min-w-0 truncate" + editing={workspaceEditActive()} + stopPropagation={false} + openOnDblClick={false} + /> + + +
    + ) + + return ( +
    + +
    +
    +
    + + {header()} + + } + > +
    {header()}
    +
    +
    + + + + + + { + if (!pendingRename()) return + event.preventDefault() + setPendingRename(false) + openEditor(`workspace:${props.directory}`, workspaceValue()) + }} + > + { + setPendingRename(true) + setMenuOpen(false) + }} + > + {language.t("common.rename")} + + dialog.show(() => )} + > + {language.t("common.reset")} + + dialog.show(() => )} + > + {language.t("common.delete")} + + + + +
    +
    +
    +
    + + + + +
    +
    + ) + } + + const SortableProject = (props: { project: LocalProject; mobile?: boolean }): JSX.Element => { + const sortable = createSortable(props.project.worktree) + const selected = createMemo(() => { + const current = params.dir ? base64Decode(params.dir) : "" + return props.project.worktree === current || props.project.sandboxes?.includes(current) + }) + + const workspaces = createMemo(() => workspaceIds(props.project).slice(0, 2)) + const workspaceEnabled = createMemo(() => layout.sidebar.workspaces(props.project.worktree)()) + const [open, setOpen] = createSignal(false) + + const label = (directory: string) => { + const [data] = globalSync.child(directory) + const kind = + directory === props.project.worktree ? language.t("workspace.type.local") : language.t("workspace.type.sandbox") + const name = workspaceLabel(directory, data.vcs?.branch, props.project.id) + return `${kind} : ${name}` + } + + const sessions = (directory: string) => { + const [data] = globalSync.child(directory) + return data.session + .filter((session) => session.directory === data.path.directory) + .filter((session) => !session.parentID && !session.time?.archived) + .toSorted(sortSessions) + .slice(0, 2) + } + + const projectSessions = () => { + const [data] = globalSync.child(props.project.worktree) + return data.session + .filter((session) => session.directory === data.path.directory) + .filter((session) => !session.parentID && !session.time?.archived) + .toSorted(sortSessions) + .slice(0, 2) + } + + const projectName = () => props.project.name || getFilename(props.project.worktree) + const trigger = ( + + ) + + return ( + // @ts-ignore +
    + { + setOpen(value) + if (value) setHoverSession(undefined) + }} + > +
    +
    +
    {displayName(props.project)}
    + + { + event.stopPropagation() + setOpen(false) + closeProject(props.project.worktree) + }} + /> + +
    +
    {language.t("sidebar.project.recentSessions")}
    +
    + + {(session) => ( + + )} + + } + > + + {(directory) => ( +
    +
    +
    + +
    + {label(directory)} +
    + + {(session) => ( + + )} + +
    + )} +
    +
    +
    +
    + +
    +
    +
    +
    + ) + } + + const LocalWorkspace = (props: { project: LocalProject; mobile?: boolean }): JSX.Element => { + const [workspaceStore, setWorkspaceStore] = globalSync.child(props.project.worktree) + const slug = createMemo(() => base64Encode(props.project.worktree)) + const sessions = createMemo(() => + workspaceStore.session + .filter((session) => session.directory === workspaceStore.path.directory) + .filter((session) => !session.parentID && !session.time?.archived) + .toSorted(sortSessions), + ) + const loading = createMemo(() => workspaceStore.status !== "complete" && sessions().length === 0) + const hasMore = createMemo(() => workspaceStore.sessionTotal > workspaceStore.session.length) + const loadMore = async () => { + setWorkspaceStore("limit", (limit) => limit + 5) + await globalSync.project.loadSessions(props.project.worktree) + } + + return ( +
    { + if (!props.mobile) scrollContainerRef = el + }} + class="size-full flex flex-col py-2 overflow-y-auto no-scrollbar" + style={{ "overflow-anchor": "none" }} + > + +
    + ) + } + + const SidebarContent = (sidebarProps: { mobile?: boolean }) => { + const expanded = () => sidebarProps.mobile || layout.sidebar.opened() + + const sync = useGlobalSync() + const project = createMemo(() => currentProject()) + const projectName = createMemo(() => { + const current = project() + if (!current) return "" + return current.name || getFilename(current.worktree) + }) + const projectId = createMemo(() => project()?.id ?? "") + const workspaces = createMemo(() => workspaceIds(project())) + + const createWorkspace = async () => { + const current = project() + if (!current) return + + const created = await globalSDK.client.worktree + .create({ directory: current.worktree }) + .then((x) => x.data) + .catch((err) => { + showToast({ + title: language.t("workspace.create.failed.title"), + description: errorMessage(err), + }) + return undefined + }) + + if (!created?.directory) return + + globalSync.child(created.directory) + navigate(`/${base64Encode(created.directory)}/session`) + } + + command.register(() => [ + { + id: "workspace.new", + title: language.t("workspace.new"), + category: language.t("command.category.workspace"), + keybind: "mod+shift+w", + disabled: !layout.sidebar.workspaces(project()?.worktree ?? "")(), + onSelect: createWorkspace, + }, + ]) + + const homedir = createMemo(() => sync.data.path.home) + + return ( +
    +
    +
    + + + +
    + p.worktree)}> + + {(project) => } + + + + {language.t("command.project.open")} + + {command.keybind("project.open")} + +
    + } + > + + +
    + + + + +
    +
    + + + + + platform.openLink("https://opencode.ai/desktop-feedback")} + aria-label={language.t("sidebar.help")} + /> + +
    +
    + + +
    + + {(p) => ( + <> +
    +
    +
    + project() && renameProject(project()!, next)} + class="text-16-medium text-text-strong truncate" + displayClass="text-16-medium text-text-strong truncate" + stopPropagation + /> + + + + {project()?.worktree.replace(homedir(), "~")} + + +
    + + + + + + dialog.show(() => )}> + {language.t("common.edit")} + + layout.sidebar.toggleWorkspaces(p.worktree)}> + + {layout.sidebar.workspaces(p.worktree)() + ? language.t("sidebar.workspaces.disable") + : language.t("sidebar.workspaces.enable")} + + + + closeProject(p.worktree)}> + {language.t("common.close")} + + + + +
    +
    + + +
    + + + +
    +
    + +
    + + } + > + <> +
    + + + +
    +
    + + + +
    { + if (!sidebarProps.mobile) scrollContainerRef = el + }} + class="size-full flex flex-col py-2 gap-4 overflow-y-auto no-scrollbar" + style={{ "overflow-anchor": "none" }} + > + + + {(directory) => ( + + )} + + +
    + + + +
    +
    + +
    + + )} +
    + 0 && providers.paid().length === 0}> +
    +
    +
    +
    {language.t("sidebar.gettingStarted.title")}
    +
    {language.t("sidebar.gettingStarted.line1")}
    +
    {language.t("sidebar.gettingStarted.line2")}
    +
    + +
    +
    +
    +
    +
    +
    + ) + } + + return ( +
    + +
    + +
    +
    { + if (e.target === e.currentTarget) layout.mobileSidebar.hide() + }} + /> + +
    + +
    + }> + {props.children} + +
    +
    + +
    + ) +} diff --git a/packages/app/src/pages/session.tsx b/packages/app/src/pages/session.tsx new file mode 100644 index 00000000000..719e13f0052 --- /dev/null +++ b/packages/app/src/pages/session.tsx @@ -0,0 +1,2150 @@ +import { + For, + Index, + onCleanup, + onMount, + Show, + Match, + Switch, + createMemo, + createEffect, + on, + createSignal, +} from "solid-js" +import { createMediaQuery } from "@solid-primitives/media" +import { createResizeObserver } from "@solid-primitives/resize-observer" +import { Dynamic } from "solid-js/web" +import { useLocal } from "@/context/local" +import { selectionFromLines, useFile, type SelectedLineRange } from "@/context/file" +import { createStore } from "solid-js/store" +import { PromptInput } from "@/components/prompt-input" +import { SessionContextUsage } from "@/components/session-context-usage" +import { IconButton } from "@opencode-ai/ui/icon-button" +import { Button } from "@opencode-ai/ui/button" +import { Icon } from "@opencode-ai/ui/icon" +import { Tooltip, TooltipKeybind } from "@opencode-ai/ui/tooltip" +import { DiffChanges } from "@opencode-ai/ui/diff-changes" +import { ResizeHandle } from "@opencode-ai/ui/resize-handle" +import { Tabs } from "@opencode-ai/ui/tabs" +import { useCodeComponent } from "@opencode-ai/ui/context/code" +import { SessionTurn } from "@opencode-ai/ui/session-turn" +import { createAutoScroll } from "@opencode-ai/ui/hooks" +import { SessionReview } from "@opencode-ai/ui/session-review" +import { Mark } from "@opencode-ai/ui/logo" + +import { DragDropProvider, DragDropSensors, DragOverlay, SortableProvider, closestCenter } from "@thisbeyond/solid-dnd" +import type { DragEvent } from "@thisbeyond/solid-dnd" +import { useSync } from "@/context/sync" +import { useTerminal, type LocalPTY } from "@/context/terminal" +import { useLayout } from "@/context/layout" +import { Terminal } from "@/components/terminal" +import { checksum, base64Encode, base64Decode } from "@opencode-ai/util/encode" +import { useDialog } from "@opencode-ai/ui/context/dialog" +import { DialogSelectFile } from "@/components/dialog-select-file" +import { DialogSelectModel } from "@/components/dialog-select-model" +import { DialogSelectMcp } from "@/components/dialog-select-mcp" +import { DialogFork } from "@/components/dialog-fork" +import { useCommand } from "@/context/command" +import { useLanguage } from "@/context/language" +import { useNavigate, useParams } from "@solidjs/router" +import { UserMessage } from "@opencode-ai/sdk/v2" +import type { FileDiff } from "@opencode-ai/sdk/v2/client" +import { useSDK } from "@/context/sdk" +import { usePrompt } from "@/context/prompt" +import { extractPromptFromParts } from "@/utils/prompt" +import { ConstrainDragYAxis, getDraggableId } from "@/utils/solid-dnd" +import { usePermission } from "@/context/permission" +import { showToast } from "@opencode-ai/ui/toast" +import { + SessionHeader, + SessionContextTab, + SortableTab, + FileVisual, + SortableTerminalTab, + NewSessionView, +} from "@/components/session" +import { usePlatform } from "@/context/platform" +import { navMark, navParams } from "@/utils/perf" +import { same } from "@/utils/same" + +type DiffStyle = "unified" | "split" + +const handoff = { + prompt: "", + terminals: [] as string[], + files: {} as Record, +} + +interface SessionReviewTabProps { + diffs: () => FileDiff[] + view: () => ReturnType["view"]> + diffStyle: DiffStyle + onDiffStyleChange?: (style: DiffStyle) => void + onViewFile?: (file: string) => void + classes?: { + root?: string + header?: string + container?: string + } +} + +function SessionReviewTab(props: SessionReviewTabProps) { + let scroll: HTMLDivElement | undefined + let frame: number | undefined + let pending: { x: number; y: number } | undefined + + const sdk = useSDK() + + const readFile = (path: string) => { + return sdk.client.file + .read({ path }) + .then((x) => x.data) + .catch(() => undefined) + } + + const restoreScroll = (retries = 0) => { + const el = scroll + if (!el) return + + const s = props.view().scroll("review") + if (!s) return + + // Wait for content to be scrollable - content may not have rendered yet + if (el.scrollHeight <= el.clientHeight && retries < 10) { + requestAnimationFrame(() => restoreScroll(retries + 1)) + return + } + + if (el.scrollTop !== s.y) el.scrollTop = s.y + if (el.scrollLeft !== s.x) el.scrollLeft = s.x + } + + const handleScroll = (event: Event & { currentTarget: HTMLDivElement }) => { + pending = { + x: event.currentTarget.scrollLeft, + y: event.currentTarget.scrollTop, + } + if (frame !== undefined) return + + frame = requestAnimationFrame(() => { + frame = undefined + + const next = pending + pending = undefined + if (!next) return + + props.view().setScroll("review", next) + }) + } + + createEffect( + on( + () => props.diffs().length, + () => { + requestAnimationFrame(restoreScroll) + }, + { defer: true }, + ), + ) + + onCleanup(() => { + if (frame === undefined) return + cancelAnimationFrame(frame) + }) + + return ( + { + scroll = el + restoreScroll() + }} + onScroll={handleScroll} + open={props.view().review.open()} + onOpenChange={props.view().review.setOpen} + classes={{ + root: props.classes?.root ?? "pb-40", + header: props.classes?.header ?? "px-6", + container: props.classes?.container ?? "px-6", + }} + diffs={props.diffs()} + diffStyle={props.diffStyle} + onDiffStyleChange={props.onDiffStyleChange} + onViewFile={props.onViewFile} + readFile={readFile} + /> + ) +} + +export default function Page() { + const layout = useLayout() + const local = useLocal() + const file = useFile() + const sync = useSync() + const terminal = useTerminal() + const dialog = useDialog() + const codeComponent = useCodeComponent() + const command = useCommand() + const language = useLanguage() + const platform = usePlatform() + const params = useParams() + const navigate = useNavigate() + const sdk = useSDK() + const prompt = usePrompt() + const permission = usePermission() + const [pendingMessage, setPendingMessage] = createSignal(undefined) + const [pendingHash, setPendingHash] = createSignal(undefined) + const sessionKey = createMemo(() => `${params.dir}${params.id ? "/" + params.id : ""}`) + const tabs = createMemo(() => layout.tabs(sessionKey())) + const view = createMemo(() => layout.view(sessionKey())) + + if (import.meta.env.DEV) { + createEffect( + on( + () => [params.dir, params.id] as const, + ([dir, id], prev) => { + if (!id) return + navParams({ dir, from: prev?.[1], to: id }) + }, + ), + ) + + createEffect(() => { + const id = params.id + if (!id) return + if (!prompt.ready()) return + navMark({ dir: params.dir, to: id, name: "storage:prompt-ready" }) + }) + + createEffect(() => { + const id = params.id + if (!id) return + if (!terminal.ready()) return + navMark({ dir: params.dir, to: id, name: "storage:terminal-ready" }) + }) + + createEffect(() => { + const id = params.id + if (!id) return + if (!file.ready()) return + navMark({ dir: params.dir, to: id, name: "storage:file-view-ready" }) + }) + + createEffect(() => { + const id = params.id + if (!id) return + if (sync.data.message[id] === undefined) return + navMark({ dir: params.dir, to: id, name: "session:data-ready" }) + }) + } + + const isDesktop = createMediaQuery("(min-width: 768px)") + + function normalizeTab(tab: string) { + if (!tab.startsWith("file://")) return tab + return file.tab(tab) + } + + function normalizeTabs(list: string[]) { + const seen = new Set() + const next: string[] = [] + for (const item of list) { + const value = normalizeTab(item) + if (seen.has(value)) continue + seen.add(value) + next.push(value) + } + return next + } + + const openTab = (value: string) => { + const next = normalizeTab(value) + tabs().open(next) + + const path = file.pathFromTab(next) + if (path) file.load(path) + } + + createEffect(() => { + const active = tabs().active() + if (!active) return + + const path = file.pathFromTab(active) + if (path) file.load(path) + }) + + createEffect(() => { + const current = tabs().all() + if (current.length === 0) return + + const next = normalizeTabs(current) + if (same(current, next)) return + + tabs().setAll(next) + + const active = tabs().active() + if (!active) return + if (!active.startsWith("file://")) return + + const normalized = normalizeTab(active) + if (active === normalized) return + tabs().setActive(normalized) + }) + + const info = createMemo(() => (params.id ? sync.session.get(params.id) : undefined)) + const reviewCount = createMemo(() => info()?.summary?.files ?? 0) + const hasReview = createMemo(() => reviewCount() > 0) + const revertMessageID = createMemo(() => info()?.revert?.messageID) + const messages = createMemo(() => (params.id ? (sync.data.message[params.id] ?? []) : [])) + const messagesReady = createMemo(() => { + const id = params.id + if (!id) return true + return sync.data.message[id] !== undefined + }) + const historyMore = createMemo(() => { + const id = params.id + if (!id) return false + return sync.session.history.more(id) + }) + const historyLoading = createMemo(() => { + const id = params.id + if (!id) return false + return sync.session.history.loading(id) + }) + const emptyUserMessages: UserMessage[] = [] + const userMessages = createMemo(() => messages().filter((m) => m.role === "user") as UserMessage[], emptyUserMessages) + const visibleUserMessages = createMemo(() => { + const revert = revertMessageID() + if (!revert) return userMessages() + return userMessages().filter((m) => m.id < revert) + }, emptyUserMessages) + const lastUserMessage = createMemo(() => visibleUserMessages().at(-1)) + + createEffect( + on( + () => lastUserMessage()?.id, + () => { + const msg = lastUserMessage() + if (!msg) return + if (msg.agent) local.agent.set(msg.agent) + if (msg.model) local.model.set(msg.model) + }, + ), + ) + + const [store, setStore] = createStore({ + activeDraggable: undefined as string | undefined, + activeTerminalDraggable: undefined as string | undefined, + expanded: {} as Record, + messageId: undefined as string | undefined, + turnStart: 0, + mobileTab: "session" as "session" | "review", + newSessionWorktree: "main", + promptHeight: 0, + }) + + const renderedUserMessages = createMemo(() => { + const msgs = visibleUserMessages() + const start = store.turnStart + if (start <= 0) return msgs + if (start >= msgs.length) return emptyUserMessages + return msgs.slice(start) + }, emptyUserMessages) + + const newSessionWorktree = createMemo(() => { + if (store.newSessionWorktree === "create") return "create" + const project = sync.project + if (project && sync.data.path.directory !== project.worktree) return sync.data.path.directory + return "main" + }) + + const activeMessage = createMemo(() => { + if (!store.messageId) return lastUserMessage() + const found = visibleUserMessages()?.find((m) => m.id === store.messageId) + return found ?? lastUserMessage() + }) + const setActiveMessage = (message: UserMessage | undefined) => { + setStore("messageId", message?.id) + } + + function navigateMessageByOffset(offset: number) { + const msgs = visibleUserMessages() + if (msgs.length === 0) return + + const current = activeMessage() + const currentIndex = current ? msgs.findIndex((m) => m.id === current.id) : -1 + const targetIndex = currentIndex === -1 ? (offset > 0 ? 0 : msgs.length - 1) : currentIndex + offset + if (targetIndex < 0 || targetIndex >= msgs.length) return + + scrollToMessage(msgs[targetIndex], "auto") + } + + const diffs = createMemo(() => (params.id ? (sync.data.session_diff[params.id] ?? []) : [])) + const diffsReady = createMemo(() => { + const id = params.id + if (!id) return true + if (!hasReview()) return true + return sync.data.session_diff[id] !== undefined + }) + + const idle = { type: "idle" as const } + let inputRef!: HTMLDivElement + let promptDock: HTMLDivElement | undefined + let scroller: HTMLDivElement | undefined + + const [scrollGesture, setScrollGesture] = createSignal(0) + const scrollGestureWindowMs = 250 + + const markScrollGesture = (target?: EventTarget | null) => { + const root = scroller + if (!root) return + + const el = target instanceof Element ? target : undefined + const nested = el?.closest("[data-scrollable]") + if (nested && nested !== root) return + + setScrollGesture(Date.now()) + } + + const hasScrollGesture = () => Date.now() - scrollGesture() < scrollGestureWindowMs + + createEffect(() => { + if (!params.id) return + sync.session.sync(params.id) + }) + + const [autoCreated, setAutoCreated] = createSignal(false) + + createEffect(() => { + if (!view().terminal.opened()) { + setAutoCreated(false) + return + } + if (!terminal.ready() || terminal.all().length !== 0 || autoCreated()) return + terminal.new() + setAutoCreated(true) + }) + + createEffect( + on( + () => terminal.all().length, + (count, prevCount) => { + if (prevCount !== undefined && prevCount > 0 && count === 0) { + if (view().terminal.opened()) { + view().terminal.toggle() + } + } + }, + ), + ) + + createEffect( + on( + () => terminal.active(), + (activeId) => { + if (!activeId || !view().terminal.opened()) return + // Immediately remove focus + if (document.activeElement instanceof HTMLElement) { + document.activeElement.blur() + } + const wrapper = document.getElementById(`terminal-wrapper-${activeId}`) + const element = wrapper?.querySelector('[data-component="terminal"]') as HTMLElement + if (!element) return + + // Find and focus the ghostty textarea (the actual input element) + const textarea = element.querySelector("textarea") as HTMLTextAreaElement + if (textarea) { + textarea.focus() + return + } + // Fallback: focus container and dispatch pointer event + element.focus() + element.dispatchEvent(new PointerEvent("pointerdown", { bubbles: true, cancelable: true })) + }, + ), + ) + + createEffect( + on( + () => visibleUserMessages().at(-1)?.id, + (lastId, prevLastId) => { + if (lastId && prevLastId && lastId > prevLastId) { + setStore("messageId", undefined) + } + }, + { defer: true }, + ), + ) + + const status = createMemo(() => sync.data.session_status[params.id ?? ""] ?? idle) + + createEffect( + on( + () => params.id, + () => { + setStore("messageId", undefined) + setStore("expanded", {}) + }, + { defer: true }, + ), + ) + + createEffect(() => { + const id = lastUserMessage()?.id + if (!id) return + setStore("expanded", id, status().type !== "idle") + }) + + command.register(() => [ + { + id: "session.new", + title: language.t("command.session.new"), + category: language.t("command.category.session"), + keybind: "mod+shift+s", + slash: "new", + onSelect: () => navigate(`/${params.dir}/session`), + }, + { + id: "file.open", + title: language.t("command.file.open"), + description: language.t("command.file.open.description"), + category: language.t("command.category.file"), + keybind: "mod+p", + slash: "open", + onSelect: () => dialog.show(() => ), + }, + { + id: "terminal.toggle", + title: language.t("command.terminal.toggle"), + description: "", + category: language.t("command.category.view"), + keybind: "ctrl+`", + slash: "terminal", + onSelect: () => view().terminal.toggle(), + }, + { + id: "review.toggle", + title: language.t("command.review.toggle"), + description: "", + category: language.t("command.category.view"), + keybind: "mod+shift+r", + onSelect: () => view().reviewPanel.toggle(), + }, + { + id: "terminal.new", + title: language.t("command.terminal.new"), + description: language.t("command.terminal.new.description"), + category: language.t("command.category.terminal"), + keybind: "ctrl+alt+t", + onSelect: () => { + if (terminal.all().length > 0) terminal.new() + view().terminal.open() + }, + }, + { + id: "steps.toggle", + title: language.t("command.steps.toggle"), + description: language.t("command.steps.toggle.description"), + category: language.t("command.category.view"), + keybind: "mod+e", + slash: "steps", + disabled: !params.id, + onSelect: () => { + const msg = activeMessage() + if (!msg) return + setStore("expanded", msg.id, (open: boolean | undefined) => !open) + }, + }, + { + id: "message.previous", + title: language.t("command.message.previous"), + description: language.t("command.message.previous.description"), + category: language.t("command.category.session"), + keybind: "mod+arrowup", + disabled: !params.id, + onSelect: () => navigateMessageByOffset(-1), + }, + { + id: "message.next", + title: language.t("command.message.next"), + description: language.t("command.message.next.description"), + category: language.t("command.category.session"), + keybind: "mod+arrowdown", + disabled: !params.id, + onSelect: () => navigateMessageByOffset(1), + }, + { + id: "model.choose", + title: language.t("command.model.choose"), + description: language.t("command.model.choose.description"), + category: language.t("command.category.model"), + keybind: "mod+'", + slash: "model", + onSelect: () => dialog.show(() => ), + }, + { + id: "mcp.toggle", + title: language.t("command.mcp.toggle"), + description: language.t("command.mcp.toggle.description"), + category: language.t("command.category.mcp"), + keybind: "mod+;", + slash: "mcp", + onSelect: () => dialog.show(() => ), + }, + { + id: "agent.cycle", + title: language.t("command.agent.cycle"), + description: language.t("command.agent.cycle.description"), + category: language.t("command.category.agent"), + keybind: "mod+.", + slash: "agent", + onSelect: () => local.agent.move(1), + }, + { + id: "agent.cycle.reverse", + title: language.t("command.agent.cycle.reverse"), + description: language.t("command.agent.cycle.reverse.description"), + category: language.t("command.category.agent"), + keybind: "shift+mod+.", + onSelect: () => local.agent.move(-1), + }, + { + id: "model.variant.cycle", + title: language.t("command.model.variant.cycle"), + description: language.t("command.model.variant.cycle.description"), + category: language.t("command.category.model"), + keybind: "shift+mod+d", + onSelect: () => { + local.model.variant.cycle() + }, + }, + { + id: "permissions.autoaccept", + title: + params.id && permission.isAutoAccepting(params.id, sdk.directory) + ? language.t("command.permissions.autoaccept.disable") + : language.t("command.permissions.autoaccept.enable"), + category: language.t("command.category.permissions"), + keybind: "mod+shift+a", + disabled: !params.id || !permission.permissionsEnabled(), + onSelect: () => { + const sessionID = params.id + if (!sessionID) return + permission.toggleAutoAccept(sessionID, sdk.directory) + const enabled = permission.isAutoAccepting(sessionID, sdk.directory) + showToast({ + title: enabled + ? language.t("toast.permissions.autoaccept.on.title") + : language.t("toast.permissions.autoaccept.off.title"), + description: enabled + ? language.t("toast.permissions.autoaccept.on.description") + : language.t("toast.permissions.autoaccept.off.description"), + }) + }, + }, + { + id: "session.undo", + title: language.t("command.session.undo"), + description: language.t("command.session.undo.description"), + category: language.t("command.category.session"), + slash: "undo", + disabled: !params.id || visibleUserMessages().length === 0, + onSelect: async () => { + const sessionID = params.id + if (!sessionID) return + if (status()?.type !== "idle") { + await sdk.client.session.abort({ sessionID }).catch(() => {}) + } + const revert = info()?.revert?.messageID + // Find the last user message that's not already reverted + const message = userMessages().findLast((x) => !revert || x.id < revert) + if (!message) return + await sdk.client.session.revert({ sessionID, messageID: message.id }) + // Restore the prompt from the reverted message + const parts = sync.data.part[message.id] + if (parts) { + const restored = extractPromptFromParts(parts, { + directory: sdk.directory, + attachmentName: language.t("common.attachment"), + }) + prompt.set(restored) + } + // Navigate to the message before the reverted one (which will be the new last visible message) + const priorMessage = userMessages().findLast((x) => x.id < message.id) + setActiveMessage(priorMessage) + }, + }, + { + id: "session.redo", + title: language.t("command.session.redo"), + description: language.t("command.session.redo.description"), + category: language.t("command.category.session"), + slash: "redo", + disabled: !params.id || !info()?.revert?.messageID, + onSelect: async () => { + const sessionID = params.id + if (!sessionID) return + const revertMessageID = info()?.revert?.messageID + if (!revertMessageID) return + const nextMessage = userMessages().find((x) => x.id > revertMessageID) + if (!nextMessage) { + // Full unrevert - restore all messages and navigate to last + await sdk.client.session.unrevert({ sessionID }) + prompt.reset() + // Navigate to the last message (the one that was at the revert point) + const lastMsg = userMessages().findLast((x) => x.id >= revertMessageID) + setActiveMessage(lastMsg) + return + } + // Partial redo - move forward to next message + await sdk.client.session.revert({ sessionID, messageID: nextMessage.id }) + // Navigate to the message before the new revert point + const priorMsg = userMessages().findLast((x) => x.id < nextMessage.id) + setActiveMessage(priorMsg) + }, + }, + { + id: "session.compact", + title: language.t("command.session.compact"), + description: language.t("command.session.compact.description"), + category: language.t("command.category.session"), + slash: "compact", + disabled: !params.id || visibleUserMessages().length === 0, + onSelect: async () => { + const sessionID = params.id + if (!sessionID) return + const model = local.model.current() + if (!model) { + showToast({ + title: language.t("toast.model.none.title"), + description: language.t("toast.model.none.description"), + }) + return + } + await sdk.client.session.summarize({ + sessionID, + modelID: model.id, + providerID: model.provider.id, + }) + }, + }, + { + id: "session.fork", + title: language.t("command.session.fork"), + description: language.t("command.session.fork.description"), + category: language.t("command.category.session"), + slash: "fork", + disabled: !params.id || visibleUserMessages().length === 0, + onSelect: () => dialog.show(() => ), + }, + ...(sync.data.config.share !== "disabled" + ? [ + { + id: "session.share", + title: language.t("command.session.share"), + description: language.t("command.session.share.description"), + category: language.t("command.category.session"), + slash: "share", + disabled: !params.id || !!info()?.share?.url, + onSelect: async () => { + if (!params.id) return + await sdk.client.session + .share({ sessionID: params.id }) + .then((res) => { + navigator.clipboard.writeText(res.data!.share!.url).catch(() => + showToast({ + title: language.t("toast.session.share.copyFailed.title"), + variant: "error", + }), + ) + }) + .then(() => + showToast({ + title: language.t("toast.session.share.success.title"), + description: language.t("toast.session.share.success.description"), + variant: "success", + }), + ) + .catch(() => + showToast({ + title: language.t("toast.session.share.failed.title"), + description: language.t("toast.session.share.failed.description"), + variant: "error", + }), + ) + }, + }, + { + id: "session.unshare", + title: language.t("command.session.unshare"), + description: language.t("command.session.unshare.description"), + category: language.t("command.category.session"), + slash: "unshare", + disabled: !params.id || !info()?.share?.url, + onSelect: async () => { + if (!params.id) return + await sdk.client.session + .unshare({ sessionID: params.id }) + .then(() => + showToast({ + title: language.t("toast.session.unshare.success.title"), + description: language.t("toast.session.unshare.success.description"), + variant: "success", + }), + ) + .catch(() => + showToast({ + title: language.t("toast.session.unshare.failed.title"), + description: language.t("toast.session.unshare.failed.description"), + variant: "error", + }), + ) + }, + }, + ] + : []), + ]) + + const handleKeyDown = (event: KeyboardEvent) => { + const activeElement = document.activeElement as HTMLElement | undefined + if (activeElement) { + const isProtected = activeElement.closest("[data-prevent-autofocus]") + const isInput = /^(INPUT|TEXTAREA|SELECT|BUTTON)$/.test(activeElement.tagName) || activeElement.isContentEditable + if (isProtected || isInput) return + } + if (dialog.active) return + + if (activeElement === inputRef) { + if (event.key === "Escape") inputRef?.blur() + return + } + + // Don't autofocus chat if terminal panel is open + if (view().terminal.opened()) return + + // Only treat explicit scroll keys as potential "user scroll" gestures. + if (event.key === "PageUp" || event.key === "PageDown" || event.key === "Home" || event.key === "End") { + markScrollGesture() + return + } + + if (event.key.length === 1 && event.key !== "Unidentified" && !(event.ctrlKey || event.metaKey)) { + inputRef?.focus() + } + } + + const handleDragStart = (event: unknown) => { + const id = getDraggableId(event) + if (!id) return + setStore("activeDraggable", id) + } + + const handleDragOver = (event: DragEvent) => { + const { draggable, droppable } = event + if (draggable && droppable) { + const currentTabs = tabs().all() + const fromIndex = currentTabs?.indexOf(draggable.id.toString()) + const toIndex = currentTabs?.indexOf(droppable.id.toString()) + if (fromIndex !== toIndex && toIndex !== undefined) { + tabs().move(draggable.id.toString(), toIndex) + } + } + } + + const handleDragEnd = () => { + setStore("activeDraggable", undefined) + } + + const handleTerminalDragStart = (event: unknown) => { + const id = getDraggableId(event) + if (!id) return + setStore("activeTerminalDraggable", id) + } + + const handleTerminalDragOver = (event: DragEvent) => { + const { draggable, droppable } = event + if (draggable && droppable) { + const terminals = terminal.all() + const fromIndex = terminals.findIndex((t: LocalPTY) => t.id === draggable.id.toString()) + const toIndex = terminals.findIndex((t: LocalPTY) => t.id === droppable.id.toString()) + if (fromIndex !== -1 && toIndex !== -1 && fromIndex !== toIndex) { + terminal.move(draggable.id.toString(), toIndex) + } + } + } + + const handleTerminalDragEnd = () => { + setStore("activeTerminalDraggable", undefined) + const activeId = terminal.active() + if (!activeId) return + setTimeout(() => { + const wrapper = document.getElementById(`terminal-wrapper-${activeId}`) + const element = wrapper?.querySelector('[data-component="terminal"]') as HTMLElement + if (!element) return + + // Find and focus the ghostty textarea (the actual input element) + const textarea = element.querySelector("textarea") as HTMLTextAreaElement + if (textarea) { + textarea.focus() + return + } + // Fallback: focus container and dispatch pointer event + element.focus() + element.dispatchEvent(new PointerEvent("pointerdown", { bubbles: true, cancelable: true })) + }, 0) + } + + const contextOpen = createMemo(() => tabs().active() === "context" || tabs().all().includes("context")) + const openedTabs = createMemo(() => + tabs() + .all() + .filter((tab) => tab !== "context"), + ) + + const mobileReview = createMemo(() => !isDesktop() && view().reviewPanel.opened() && store.mobileTab === "review") + + const showTabs = createMemo(() => view().reviewPanel.opened()) + + const activeTab = createMemo(() => { + const active = tabs().active() + if (active) return active + if (hasReview()) return "review" + + const first = openedTabs()[0] + if (first) return first + if (contextOpen()) return "context" + return "review" + }) + + createEffect(() => { + if (!layout.ready()) return + if (tabs().active()) return + if (!hasReview() && openedTabs().length === 0 && !contextOpen()) return + tabs().setActive(activeTab()) + }) + + createEffect(() => { + const id = params.id + if (!id) return + if (!hasReview()) return + + const wants = isDesktop() ? view().reviewPanel.opened() && activeTab() === "review" : store.mobileTab === "review" + if (!wants) return + if (diffsReady()) return + + sync.session.diff(id) + }) + + const autoScroll = createAutoScroll({ + working: () => true, + overflowAnchor: "dynamic", + }) + + const resumeScroll = () => { + setStore("messageId", undefined) + autoScroll.forceScrollToBottom() + } + + // When the user returns to the bottom, treat the active message as "latest". + createEffect( + on( + autoScroll.userScrolled, + (scrolled) => { + if (scrolled) return + setStore("messageId", undefined) + }, + { defer: true }, + ), + ) + + let scrollSpyFrame: number | undefined + let scrollSpyTarget: HTMLDivElement | undefined + + const anchor = (id: string) => `message-${id}` + + const setScrollRef = (el: HTMLDivElement | undefined) => { + scroller = el + autoScroll.scrollRef(el) + } + + const turnInit = 20 + const turnBatch = 20 + let turnHandle: number | undefined + let turnIdle = false + + function cancelTurnBackfill() { + const handle = turnHandle + if (handle === undefined) return + turnHandle = undefined + + if (turnIdle && window.cancelIdleCallback) { + window.cancelIdleCallback(handle) + return + } + + clearTimeout(handle) + } + + function scheduleTurnBackfill() { + if (turnHandle !== undefined) return + if (store.turnStart <= 0) return + + if (window.requestIdleCallback) { + turnIdle = true + turnHandle = window.requestIdleCallback(() => { + turnHandle = undefined + backfillTurns() + }) + return + } + + turnIdle = false + turnHandle = window.setTimeout(() => { + turnHandle = undefined + backfillTurns() + }, 0) + } + + function backfillTurns() { + const start = store.turnStart + if (start <= 0) return + + const next = start - turnBatch + const nextStart = next > 0 ? next : 0 + + const el = scroller + if (!el) { + setStore("turnStart", nextStart) + scheduleTurnBackfill() + return + } + + const beforeTop = el.scrollTop + const beforeHeight = el.scrollHeight + + setStore("turnStart", nextStart) + + requestAnimationFrame(() => { + const delta = el.scrollHeight - beforeHeight + if (delta) el.scrollTop = beforeTop + delta + }) + + scheduleTurnBackfill() + } + + createEffect( + on( + () => [params.id, messagesReady()] as const, + ([id, ready]) => { + cancelTurnBackfill() + setStore("turnStart", 0) + if (!id || !ready) return + + const len = visibleUserMessages().length + const start = len > turnInit ? len - turnInit : 0 + setStore("turnStart", start) + scheduleTurnBackfill() + }, + { defer: true }, + ), + ) + + createResizeObserver( + () => promptDock, + ({ height }) => { + const next = Math.ceil(height) + + if (next === store.promptHeight) return + + const el = scroller + const stick = el ? el.scrollHeight - el.clientHeight - el.scrollTop < 10 : false + + setStore("promptHeight", next) + + if (stick && el) { + requestAnimationFrame(() => { + el.scrollTo({ top: el.scrollHeight, behavior: "auto" }) + }) + } + }, + ) + + const updateHash = (id: string) => { + window.history.replaceState(null, "", `#${anchor(id)}`) + } + + createEffect(() => { + const sessionID = params.id + if (!sessionID) return + const raw = sessionStorage.getItem("opencode.pendingMessage") + if (!raw) return + const parts = raw.split("|") + const pendingSessionID = parts[0] + const messageID = parts[1] + if (!pendingSessionID || !messageID) return + if (pendingSessionID !== sessionID) return + + sessionStorage.removeItem("opencode.pendingMessage") + setPendingMessage(messageID) + }) + + const scrollToElement = (el: HTMLElement, behavior: ScrollBehavior) => { + const root = scroller + if (!root) return false + + const a = el.getBoundingClientRect() + const b = root.getBoundingClientRect() + const offset = (info()?.title ? 40 : 0) + 12 + const top = a.top - b.top + root.scrollTop - offset + root.scrollTo({ top: top > 0 ? top : 0, behavior }) + return true + } + + const scrollToMessage = (message: UserMessage, behavior: ScrollBehavior = "smooth") => { + // Navigating to a specific message should always pause auto-follow. + autoScroll.pause() + setActiveMessage(message) + updateHash(message.id) + + const msgs = visibleUserMessages() + const index = msgs.findIndex((m) => m.id === message.id) + if (index !== -1 && index < store.turnStart) { + setStore("turnStart", index) + scheduleTurnBackfill() + } + + const id = anchor(message.id) + const attempt = (tries: number) => { + const el = document.getElementById(id) + if (el && scrollToElement(el, behavior)) return + if (tries >= 8) return + requestAnimationFrame(() => attempt(tries + 1)) + } + attempt(0) + } + + const applyHash = (behavior: ScrollBehavior) => { + const hash = window.location.hash.slice(1) + if (!hash) { + setPendingHash(undefined) + autoScroll.forceScrollToBottom() + return + } + + const match = hash.match(/^message-(.+)$/) + if (match) { + const msg = visibleUserMessages().find((m) => m.id === match[1]) + if (msg) { + setPendingHash(undefined) + scrollToMessage(msg, behavior) + return + } + + // If we have a message hash but the message isn't loaded/rendered yet, + // don't fall back to "bottom". We'll retry once messages arrive. + setPendingHash(match[1]) + return + } + + const target = document.getElementById(hash) + if (target) { + setPendingHash(undefined) + scrollToElement(target, behavior) + return + } + + setPendingHash(undefined) + autoScroll.forceScrollToBottom() + } + + const getActiveMessageId = (container: HTMLDivElement) => { + const cutoff = container.scrollTop + 100 + const nodes = container.querySelectorAll("[data-message-id]") + let id: string | undefined + + for (const node of nodes) { + const next = node.dataset.messageId + if (!next) continue + if (node.offsetTop > cutoff) break + id = next + } + + return id + } + + const scheduleScrollSpy = (container: HTMLDivElement) => { + scrollSpyTarget = container + if (scrollSpyFrame !== undefined) return + + scrollSpyFrame = requestAnimationFrame(() => { + scrollSpyFrame = undefined + + const target = scrollSpyTarget + scrollSpyTarget = undefined + if (!target) return + + const id = getActiveMessageId(target) + if (!id) return + if (id === store.messageId) return + + setStore("messageId", id) + }) + } + + createEffect(() => { + const sessionID = params.id + const ready = messagesReady() + if (!sessionID || !ready) return + + requestAnimationFrame(() => { + applyHash("auto") + }) + }) + + // Retry message navigation once the target message is actually loaded. + createEffect(() => { + const sessionID = params.id + const ready = messagesReady() + if (!sessionID || !ready) return + + // dependencies + visibleUserMessages().length + store.turnStart + + const targetId = pendingMessage() ?? pendingHash() + if (!targetId) return + if (store.messageId === targetId) return + + const msg = visibleUserMessages().find((m) => m.id === targetId) + if (!msg) return + if (pendingMessage() === targetId) setPendingMessage(undefined) + if (pendingHash() === targetId) setPendingHash(undefined) + requestAnimationFrame(() => scrollToMessage(msg, "auto")) + }) + + createEffect(() => { + const sessionID = params.id + const ready = messagesReady() + if (!sessionID || !ready) return + + const handler = () => requestAnimationFrame(() => applyHash("auto")) + window.addEventListener("hashchange", handler) + onCleanup(() => window.removeEventListener("hashchange", handler)) + }) + + createEffect(() => { + document.addEventListener("keydown", handleKeyDown) + }) + + const previewPrompt = () => + prompt + .current() + .map((part) => { + if (part.type === "file") return `[file:${part.path}]` + if (part.type === "agent") return `@${part.name}` + if (part.type === "image") return `[image:${part.filename}]` + return part.content + }) + .join("") + .trim() + + createEffect(() => { + if (!prompt.ready()) return + handoff.prompt = previewPrompt() + }) + + createEffect(() => { + if (!terminal.ready()) return + language.locale() + + const label = (pty: LocalPTY) => { + const title = pty.title + const number = pty.titleNumber + const match = title.match(/^Terminal (\d+)$/) + const parsed = match ? Number(match[1]) : undefined + const isDefaultTitle = Number.isFinite(number) && number > 0 && Number.isFinite(parsed) && parsed === number + + if (title && !isDefaultTitle) return title + if (Number.isFinite(number) && number > 0) return language.t("terminal.title.numbered", { number }) + if (title) return title + return language.t("terminal.title") + } + + handoff.terminals = terminal.all().map(label) + }) + + createEffect(() => { + if (!file.ready()) return + handoff.files = Object.fromEntries( + tabs() + .all() + .flatMap((tab) => { + const path = file.pathFromTab(tab) + if (!path) return [] + return [[path, file.selectedLines(path) ?? null] as const] + }), + ) + }) + + onCleanup(() => { + cancelTurnBackfill() + document.removeEventListener("keydown", handleKeyDown) + if (scrollSpyFrame !== undefined) cancelAnimationFrame(scrollSpyFrame) + }) + + return ( +
    + +
    + {/* Mobile tab bar - only shown on mobile when user opened review */} + + + + setStore("mobileTab", "session")} + > + {language.t("session.tab.session")} + + setStore("mobileTab", "review")} + > + + + {language.t("session.review.filesChanged", { count: reviewCount() })} + + {language.t("session.tab.review")} + + + + + + + {/* Session panel */} +
    +
    + + + + + + + + {language.t("session.review.loadingChanges")} +
    + } + > + { + const value = file.tab(path) + tabs().open(value) + file.load(path) + }} + classes={{ + root: "pb-[calc(var(--prompt-height,8rem)+32px)]", + header: "px-4", + container: "px-4", + }} + /> + + + +
    + +
    + {language.t("session.review.empty")} +
    +
    +
    + +
    + } + > +
    +
    + +
    +
    markScrollGesture(e.target)} + onTouchMove={(e) => markScrollGesture(e.target)} + onPointerDown={(e) => { + if (e.target !== e.currentTarget) return + markScrollGesture(e.target) + }} + onScroll={(e) => { + if (!hasScrollGesture()) return + markScrollGesture(e.target) + autoScroll.handleScroll() + if (isDesktop() && autoScroll.userScrolled()) scheduleScrollSpy(e.currentTarget) + }} + class="relative min-w-0 w-full h-full overflow-y-auto session-scroller" + style={{ "--session-title-height": info()?.title ? "40px" : "0px" }} + > + +
    +
    +

    {info()?.title}

    +
    +
    +
    + +
    + 0}> +
    + +
    +
    + +
    + +
    +
    + + {(message) => { + if (import.meta.env.DEV) { + onMount(() => { + const id = params.id + if (!id) return + navMark({ dir: params.dir, to: id, name: "session:first-turn-mounted" }) + }) + } + + return ( +
    + + setStore("expanded", message.id, (open: boolean | undefined) => !open) + } + classes={{ + root: "min-w-0 w-full relative", + content: "flex flex-col justify-between !overflow-visible", + container: "w-full px-4 md:px-6", + }} + /> +
    + ) + }} +
    +
    +
    +
    + + + + + { + if (value === "create") { + setStore("newSessionWorktree", value) + return + } + + setStore("newSessionWorktree", "main") + + const target = value === "main" ? sync.project?.worktree : value + if (!target) return + if (target === sync.data.path.directory) return + layout.projects.open(target) + navigate(`/${base64Encode(target)}/session`) + }} + /> + + +
    + + {/* Prompt input */} +
    (promptDock = el)} + class="absolute inset-x-0 bottom-0 pt-12 pb-4 md:pb-6 flex flex-col justify-center items-center z-50 px-4 md:px-0 bg-gradient-to-t from-background-stronger via-background-stronger to-transparent pointer-events-none" + > +
    + + {handoff.prompt || language.t("prompt.loading")} +
    + } + > + { + inputRef = el + }} + newSessionWorktree={newSessionWorktree()} + onNewSessionWorktreeReset={() => setStore("newSessionWorktree", "main")} + onSubmit={resumeScroll} + /> + +
    +
    + + + + +
    + + {/* Desktop tabs panel (Review + Context + Files) - hidden on mobile */} + +
    + + + + + + +
    + +
    +
    +
    +
    + + {(tab) => { + let scroll: HTMLDivElement | undefined + let scrollFrame: number | undefined + let pending: { x: number; y: number } | undefined + + const path = createMemo(() => file.pathFromTab(tab)) + const state = createMemo(() => { + const p = path() + if (!p) return + return file.get(p) + }) + const contents = createMemo(() => state()?.content?.content ?? "") + const cacheKey = createMemo(() => checksum(contents())) + const isImage = createMemo(() => { + const c = state()?.content + return ( + c?.encoding === "base64" && c?.mimeType?.startsWith("image/") && c?.mimeType !== "image/svg+xml" + ) + }) + const isSvg = createMemo(() => { + const c = state()?.content + return c?.mimeType === "image/svg+xml" + }) + const svgContent = createMemo(() => { + if (!isSvg()) return + const c = state()?.content + if (!c) return + if (c.encoding === "base64") return base64Decode(c.content) + return c.content + }) + const svgPreviewUrl = createMemo(() => { + if (!isSvg()) return + const c = state()?.content + if (!c) return + if (c.encoding === "base64") return `data:image/svg+xml;base64,${c.content}` + return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(c.content)}` + }) + const imageDataUrl = createMemo(() => { + if (!isImage()) return + const c = state()?.content + return `data:${c?.mimeType};base64,${c?.content}` + }) + const selectedLines = createMemo(() => { + const p = path() + if (!p) return null + if (file.ready()) return file.selectedLines(p) ?? null + return handoff.files[p] ?? null + }) + const selection = createMemo(() => { + const range = selectedLines() + if (!range) return + return selectionFromLines(range) + }) + const selectionLabel = createMemo(() => { + const sel = selection() + if (!sel) return + if (sel.startLine === sel.endLine) return `L${sel.startLine}` + return `L${sel.startLine}-${sel.endLine}` + }) + + const restoreScroll = (retries = 0) => { + const el = scroll + if (!el) return + + const s = view()?.scroll(tab) + if (!s) return + + // Wait for content to be scrollable - content may not have rendered yet + if (el.scrollHeight <= el.clientHeight && retries < 10) { + requestAnimationFrame(() => restoreScroll(retries + 1)) + return + } + + if (el.scrollTop !== s.y) el.scrollTop = s.y + if (el.scrollLeft !== s.x) el.scrollLeft = s.x + } + + const handleScroll = (event: Event & { currentTarget: HTMLDivElement }) => { + pending = { + x: event.currentTarget.scrollLeft, + y: event.currentTarget.scrollTop, + } + if (scrollFrame !== undefined) return + + scrollFrame = requestAnimationFrame(() => { + scrollFrame = undefined + + const next = pending + pending = undefined + if (!next) return + + view().setScroll(tab, next) + }) + } + + createEffect( + on( + () => state()?.loaded, + (loaded) => { + if (!loaded) return + requestAnimationFrame(restoreScroll) + }, + { defer: true }, + ), + ) + + createEffect( + on( + () => file.ready(), + (ready) => { + if (!ready) return + requestAnimationFrame(restoreScroll) + }, + { defer: true }, + ), + ) + + createEffect( + on( + () => tabs().active() === tab, + (active) => { + if (!active) return + if (!state()?.loaded) return + requestAnimationFrame(restoreScroll) + }, + ), + ) + + onCleanup(() => { + if (scrollFrame === undefined) return + cancelAnimationFrame(scrollFrame) + }) + + return ( + { + scroll = el + restoreScroll() + }} + onScroll={handleScroll} + > + + + {(sel) => ( + + )} + + + +
    + {path()} +
    +
    + +
    + { + const p = path() + if (!p) return + file.setSelectedLines(p, range) + }} + overflow="scroll" + class="select-text" + /> + +
    + {path()} +
    +
    +
    +
    + + { + const p = path() + if (!p) return + file.setSelectedLines(p, range) + }} + overflow="scroll" + class="select-text pb-40" + /> + + +
    {language.t("common.loading")}...
    +
    + + {(err) =>
    {err()}
    } +
    +
    +
    +
    + ) + }} +
    + + + + {(tab) => { + const path = createMemo(() => file.pathFromTab(tab())) + return ( +
    + {(p) => } +
    + ) + }} +
    +
    + + + +
    + + +
    + + +
    + + {(title) => ( +
    + {title} +
    + )} +
    +
    +
    {language.t("common.loading")}...
    +
    +
    + {language.t("terminal.loading")} +
    +
    + } + > + + + +
    + { + // Only switch tabs if not in the middle of starting edit mode + terminal.open(id) + }} + class="!h-auto !flex-none" + > + + t.id)}> + + {(pty) => ( + { + view().terminal.close() + setAutoCreated(false) + }} + /> + )} + + +
    + + + +
    +
    +
    +
    + + {(pty) => { + const [dismissed, setDismissed] = createSignal(false) + return ( +
    + terminal.update({ ...data, id: pty.id })} + onConnect={() => { + terminal.update({ id: pty.id, error: false }) + setDismissed(false) + }} + onConnectError={() => { + setDismissed(false) + terminal.update({ id: pty.id, error: true }) + }} + /> + +
    + +
    +
    {language.t("terminal.connectionLost.title")}
    +
    + {language.t("terminal.connectionLost.description")} +
    +
    + +
    +
    +
    + ) + }} +
    +
    +
    + + + {(draggedId) => { + const pty = createMemo(() => terminal.all().find((t: LocalPTY) => t.id === draggedId())) + return ( + + {(t) => ( +
    + {(() => { + const title = t().title + const number = t().titleNumber + const match = title.match(/^Terminal (\d+)$/) + const parsed = match ? Number(match[1]) : undefined + const isDefaultTitle = + Number.isFinite(number) && number > 0 && Number.isFinite(parsed) && parsed === number + + if (title && !isDefaultTitle) return title + if (Number.isFinite(number) && number > 0) + return language.t("terminal.title.numbered", { number }) + if (title) return title + return language.t("terminal.title") + })()} +
    + )} +
    + ) + }} +
    +
    +
    +
    +
    +
    +
    + ) +} diff --git a/packages/desktop/src/sst-env.d.ts b/packages/app/src/sst-env.d.ts similarity index 100% rename from packages/desktop/src/sst-env.d.ts rename to packages/app/src/sst-env.d.ts diff --git a/packages/desktop/src/utils/dom.ts b/packages/app/src/utils/dom.ts similarity index 100% rename from packages/desktop/src/utils/dom.ts rename to packages/app/src/utils/dom.ts diff --git a/packages/app/src/utils/id.ts b/packages/app/src/utils/id.ts new file mode 100644 index 00000000000..fa27cf4c5f9 --- /dev/null +++ b/packages/app/src/utils/id.ts @@ -0,0 +1,99 @@ +import z from "zod" + +const prefixes = { + session: "ses", + message: "msg", + permission: "per", + user: "usr", + part: "prt", + pty: "pty", +} as const + +const LENGTH = 26 +let lastTimestamp = 0 +let counter = 0 + +type Prefix = keyof typeof prefixes +export namespace Identifier { + export function schema(prefix: Prefix) { + return z.string().startsWith(prefixes[prefix]) + } + + export function ascending(prefix: Prefix, given?: string) { + return generateID(prefix, false, given) + } + + export function descending(prefix: Prefix, given?: string) { + return generateID(prefix, true, given) + } +} + +function generateID(prefix: Prefix, descending: boolean, given?: string): string { + if (!given) { + return create(prefix, descending) + } + + if (!given.startsWith(prefixes[prefix])) { + throw new Error(`ID ${given} does not start with ${prefixes[prefix]}`) + } + + return given +} + +function create(prefix: Prefix, descending: boolean, timestamp?: number): string { + const currentTimestamp = timestamp ?? Date.now() + + if (currentTimestamp !== lastTimestamp) { + lastTimestamp = currentTimestamp + counter = 0 + } + + counter += 1 + + let now = BigInt(currentTimestamp) * BigInt(0x1000) + BigInt(counter) + + if (descending) { + now = ~now + } + + const timeBytes = new Uint8Array(6) + for (let i = 0; i < 6; i += 1) { + timeBytes[i] = Number((now >> BigInt(40 - 8 * i)) & BigInt(0xff)) + } + + return prefixes[prefix] + "_" + bytesToHex(timeBytes) + randomBase62(LENGTH - 12) +} + +function bytesToHex(bytes: Uint8Array): string { + let hex = "" + for (let i = 0; i < bytes.length; i += 1) { + hex += bytes[i].toString(16).padStart(2, "0") + } + return hex +} + +function randomBase62(length: number): string { + const chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + const bytes = getRandomBytes(length) + let result = "" + for (let i = 0; i < length; i += 1) { + result += chars[bytes[i] % 62] + } + return result +} + +function getRandomBytes(length: number): Uint8Array { + const bytes = new Uint8Array(length) + const cryptoObj = typeof globalThis !== "undefined" ? globalThis.crypto : undefined + + if (cryptoObj && typeof cryptoObj.getRandomValues === "function") { + cryptoObj.getRandomValues(bytes) + return bytes + } + + for (let i = 0; i < length; i += 1) { + bytes[i] = Math.floor(Math.random() * 256) + } + + return bytes +} diff --git a/packages/desktop/src/utils/index.ts b/packages/app/src/utils/index.ts similarity index 100% rename from packages/desktop/src/utils/index.ts rename to packages/app/src/utils/index.ts diff --git a/packages/app/src/utils/perf.ts b/packages/app/src/utils/perf.ts new file mode 100644 index 00000000000..0ecbc33ffc1 --- /dev/null +++ b/packages/app/src/utils/perf.ts @@ -0,0 +1,135 @@ +type Nav = { + id: string + dir?: string + from?: string + to: string + trigger?: string + start: number + marks: Record + logged: boolean + timer?: ReturnType +} + +const dev = import.meta.env.DEV + +const key = (dir: string | undefined, to: string) => `${dir ?? ""}:${to}` + +const now = () => performance.now() + +const uid = () => crypto.randomUUID?.() ?? Math.random().toString(16).slice(2) + +const navs = new Map() +const pending = new Map() +const active = new Map() + +const required = [ + "session:params", + "session:data-ready", + "session:first-turn-mounted", + "storage:prompt-ready", + "storage:terminal-ready", + "storage:file-view-ready", +] + +function flush(id: string, reason: "complete" | "timeout") { + if (!dev) return + const nav = navs.get(id) + if (!nav) return + if (nav.logged) return + + nav.logged = true + if (nav.timer) clearTimeout(nav.timer) + + const baseName = nav.marks["navigate:start"] !== undefined ? "navigate:start" : "session:params" + const base = nav.marks[baseName] ?? nav.start + + const ms = Object.fromEntries( + Object.entries(nav.marks) + .slice() + .sort(([a], [b]) => a.localeCompare(b)) + .map(([name, t]) => [name, Math.round((t - base) * 100) / 100]), + ) + + console.log( + "perf.session-nav " + + JSON.stringify({ + type: "perf.session-nav.v0", + id: nav.id, + dir: nav.dir, + from: nav.from, + to: nav.to, + trigger: nav.trigger, + base: baseName, + reason, + ms, + }), + ) + + navs.delete(id) +} + +function maybeFlush(id: string) { + if (!dev) return + const nav = navs.get(id) + if (!nav) return + if (nav.logged) return + if (!required.every((name) => nav.marks[name] !== undefined)) return + flush(id, "complete") +} + +function ensure(id: string, data: Omit) { + const existing = navs.get(id) + if (existing) return existing + + const nav: Nav = { + ...data, + marks: {}, + logged: false, + } + nav.timer = setTimeout(() => flush(id, "timeout"), 5000) + navs.set(id, nav) + return nav +} + +export function navStart(input: { dir?: string; from?: string; to: string; trigger?: string }) { + if (!dev) return + + const id = uid() + const start = now() + const nav = ensure(id, { ...input, id, start }) + nav.marks["navigate:start"] = start + + pending.set(key(input.dir, input.to), id) + return id +} + +export function navParams(input: { dir?: string; from?: string; to: string }) { + if (!dev) return + + const k = key(input.dir, input.to) + const pendingId = pending.get(k) + if (pendingId) pending.delete(k) + const id = pendingId ?? uid() + + const start = now() + const nav = ensure(id, { ...input, id, start, trigger: pendingId ? "key" : "route" }) + nav.marks["session:params"] = start + + active.set(k, id) + maybeFlush(id) + return id +} + +export function navMark(input: { dir?: string; to: string; name: string }) { + if (!dev) return + + const id = active.get(key(input.dir, input.to)) + if (!id) return + + const nav = navs.get(id) + if (!nav) return + if (nav.marks[input.name] !== undefined) return + + nav.marks[input.name] = now() + maybeFlush(id) +} diff --git a/packages/app/src/utils/persist.ts b/packages/app/src/utils/persist.ts new file mode 100644 index 00000000000..70884977c75 --- /dev/null +++ b/packages/app/src/utils/persist.ts @@ -0,0 +1,377 @@ +import { usePlatform } from "@/context/platform" +import { makePersisted, type AsyncStorage, type SyncStorage } from "@solid-primitives/storage" +import { checksum } from "@opencode-ai/util/encode" +import { createResource, type Accessor } from "solid-js" +import type { SetStoreFunction, Store } from "solid-js/store" + +type InitType = Promise | string | null +type PersistedWithReady = [Store, SetStoreFunction, InitType, Accessor] + +type PersistTarget = { + storage?: string + key: string + legacy?: string[] + migrate?: (value: unknown) => unknown +} + +const LEGACY_STORAGE = "default.dat" +const GLOBAL_STORAGE = "opencode.global.dat" +const LOCAL_PREFIX = "opencode." +const fallback = { disabled: false } +const cache = new Map() + +function quota(error: unknown) { + if (error instanceof DOMException) { + if (error.name === "QuotaExceededError") return true + if (error.name === "NS_ERROR_DOM_QUOTA_REACHED") return true + if (error.name === "QUOTA_EXCEEDED_ERR") return true + if (error.code === 22 || error.code === 1014) return true + return false + } + + if (!error || typeof error !== "object") return false + const name = (error as { name?: string }).name + if (name === "QuotaExceededError" || name === "NS_ERROR_DOM_QUOTA_REACHED") return true + if (name && /quota/i.test(name)) return true + + const code = (error as { code?: number }).code + if (code === 22 || code === 1014) return true + + const message = (error as { message?: string }).message + if (typeof message !== "string") return false + if (/quota/i.test(message)) return true + return false +} + +type Evict = { key: string; size: number } + +function evict(storage: Storage, keep: string, value: string) { + const total = storage.length + const indexes = Array.from({ length: total }, (_, index) => index) + const items: Evict[] = [] + + for (const index of indexes) { + const name = storage.key(index) + if (!name) continue + if (!name.startsWith(LOCAL_PREFIX)) continue + if (name === keep) continue + const stored = storage.getItem(name) + items.push({ key: name, size: stored?.length ?? 0 }) + } + + items.sort((a, b) => b.size - a.size) + + for (const item of items) { + storage.removeItem(item.key) + + try { + storage.setItem(keep, value) + return true + } catch (error) { + if (!quota(error)) throw error + } + } + + return false +} + +function write(storage: Storage, key: string, value: string) { + try { + storage.setItem(key, value) + return true + } catch (error) { + if (!quota(error)) throw error + } + + try { + storage.removeItem(key) + storage.setItem(key, value) + return true + } catch (error) { + if (!quota(error)) throw error + } + + return evict(storage, key, value) +} + +function snapshot(value: unknown) { + return JSON.parse(JSON.stringify(value)) as unknown +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value) +} + +function merge(defaults: unknown, value: unknown): unknown { + if (value === undefined) return defaults + if (value === null) return value + + if (Array.isArray(defaults)) { + if (Array.isArray(value)) return value + return defaults + } + + if (isRecord(defaults)) { + if (!isRecord(value)) return defaults + + const result: Record = { ...defaults } + for (const key of Object.keys(value)) { + if (key in defaults) { + result[key] = merge((defaults as Record)[key], (value as Record)[key]) + } else { + result[key] = (value as Record)[key] + } + } + return result + } + + return value +} + +function parse(value: string) { + try { + return JSON.parse(value) as unknown + } catch { + return undefined + } +} + +function workspaceStorage(dir: string) { + const head = dir.slice(0, 12) || "workspace" + const sum = checksum(dir) ?? "0" + return `opencode.workspace.${head}.${sum}.dat` +} + +function localStorageWithPrefix(prefix: string): SyncStorage { + const base = `${prefix}:` + const item = (key: string) => base + key + return { + getItem: (key) => { + const name = item(key) + const cached = cache.get(name) + if (fallback.disabled && cached !== undefined) return cached + + const stored = localStorage.getItem(name) + if (stored === null) return cached ?? null + cache.set(name, stored) + return stored + }, + setItem: (key, value) => { + const name = item(key) + cache.set(name, value) + if (fallback.disabled) return + try { + if (write(localStorage, name, value)) return + } catch { + fallback.disabled = true + return + } + fallback.disabled = true + }, + removeItem: (key) => { + const name = item(key) + cache.delete(name) + if (fallback.disabled) return + localStorage.removeItem(name) + }, + } +} + +function localStorageDirect(): SyncStorage { + return { + getItem: (key) => { + const cached = cache.get(key) + if (fallback.disabled && cached !== undefined) return cached + + const stored = localStorage.getItem(key) + if (stored === null) return cached ?? null + cache.set(key, stored) + return stored + }, + setItem: (key, value) => { + cache.set(key, value) + if (fallback.disabled) return + try { + if (write(localStorage, key, value)) return + } catch { + fallback.disabled = true + return + } + fallback.disabled = true + }, + removeItem: (key) => { + cache.delete(key) + if (fallback.disabled) return + localStorage.removeItem(key) + }, + } +} + +export const Persist = { + global(key: string, legacy?: string[]): PersistTarget { + return { storage: GLOBAL_STORAGE, key, legacy } + }, + workspace(dir: string, key: string, legacy?: string[]): PersistTarget { + return { storage: workspaceStorage(dir), key: `workspace:${key}`, legacy } + }, + session(dir: string, session: string, key: string, legacy?: string[]): PersistTarget { + return { storage: workspaceStorage(dir), key: `session:${session}:${key}`, legacy } + }, + scoped(dir: string, session: string | undefined, key: string, legacy?: string[]): PersistTarget { + if (session) return Persist.session(dir, session, key, legacy) + return Persist.workspace(dir, key, legacy) + }, +} + +export function removePersisted(target: { storage?: string; key: string }) { + const platform = usePlatform() + const isDesktop = platform.platform === "desktop" && !!platform.storage + + if (isDesktop) { + return platform.storage?.(target.storage)?.removeItem(target.key) + } + + if (!target.storage) { + localStorageDirect().removeItem(target.key) + return + } + + localStorageWithPrefix(target.storage).removeItem(target.key) +} + +export function persisted( + target: string | PersistTarget, + store: [Store, SetStoreFunction], +): PersistedWithReady { + const platform = usePlatform() + const config: PersistTarget = typeof target === "string" ? { key: target } : target + + const defaults = snapshot(store[0]) + const legacy = config.legacy ?? [] + + const isDesktop = platform.platform === "desktop" && !!platform.storage + + const currentStorage = (() => { + if (isDesktop) return platform.storage?.(config.storage) + if (!config.storage) return localStorageDirect() + return localStorageWithPrefix(config.storage) + })() + + const legacyStorage = (() => { + if (!isDesktop) return localStorageDirect() + if (!config.storage) return platform.storage?.() + return platform.storage?.(LEGACY_STORAGE) + })() + + const storage = (() => { + if (!isDesktop) { + const current = currentStorage as SyncStorage + const legacyStore = legacyStorage as SyncStorage + + const api: SyncStorage = { + getItem: (key) => { + const raw = current.getItem(key) + if (raw !== null) { + const parsed = parse(raw) + if (parsed === undefined) return raw + + const migrated = config.migrate ? config.migrate(parsed) : parsed + const merged = merge(defaults, migrated) + const next = JSON.stringify(merged) + if (raw !== next) current.setItem(key, next) + return next + } + + for (const legacyKey of legacy) { + const legacyRaw = legacyStore.getItem(legacyKey) + if (legacyRaw === null) continue + + current.setItem(key, legacyRaw) + legacyStore.removeItem(legacyKey) + + const parsed = parse(legacyRaw) + if (parsed === undefined) return legacyRaw + + const migrated = config.migrate ? config.migrate(parsed) : parsed + const merged = merge(defaults, migrated) + const next = JSON.stringify(merged) + if (legacyRaw !== next) current.setItem(key, next) + return next + } + + return null + }, + setItem: (key, value) => { + current.setItem(key, value) + }, + removeItem: (key) => { + current.removeItem(key) + }, + } + + return api + } + + const current = currentStorage as AsyncStorage + const legacyStore = legacyStorage as AsyncStorage | undefined + + const api: AsyncStorage = { + getItem: async (key) => { + const raw = await current.getItem(key) + if (raw !== null) { + const parsed = parse(raw) + if (parsed === undefined) return raw + + const migrated = config.migrate ? config.migrate(parsed) : parsed + const merged = merge(defaults, migrated) + const next = JSON.stringify(merged) + if (raw !== next) await current.setItem(key, next) + return next + } + + if (!legacyStore) return null + + for (const legacyKey of legacy) { + const legacyRaw = await legacyStore.getItem(legacyKey) + if (legacyRaw === null) continue + + await current.setItem(key, legacyRaw) + await legacyStore.removeItem(legacyKey) + + const parsed = parse(legacyRaw) + if (parsed === undefined) return legacyRaw + + const migrated = config.migrate ? config.migrate(parsed) : parsed + const merged = merge(defaults, migrated) + const next = JSON.stringify(merged) + if (legacyRaw !== next) await current.setItem(key, next) + return next + } + + return null + }, + setItem: async (key, value) => { + await current.setItem(key, value) + }, + removeItem: async (key) => { + await current.removeItem(key) + }, + } + + return api + })() + + const [state, setState, init] = makePersisted(store, { name: config.key, storage }) + + const isAsync = init instanceof Promise + const [ready] = createResource( + () => init, + async (initValue) => { + if (initValue instanceof Promise) await initValue + return true + }, + { initialValue: !isAsync }, + ) + + return [state, setState, init, () => ready() === true] +} diff --git a/packages/app/src/utils/prompt.ts b/packages/app/src/utils/prompt.ts new file mode 100644 index 00000000000..35aec0071aa --- /dev/null +++ b/packages/app/src/utils/prompt.ts @@ -0,0 +1,203 @@ +import type { AgentPart as MessageAgentPart, FilePart, Part, TextPart } from "@opencode-ai/sdk/v2" +import type { AgentPart, FileAttachmentPart, ImageAttachmentPart, Prompt } from "@/context/prompt" + +type Inline = + | { + type: "file" + start: number + end: number + value: string + path: string + selection?: { + startLine: number + endLine: number + startChar: number + endChar: number + } + } + | { + type: "agent" + start: number + end: number + value: string + name: string + } + +function selectionFromFileUrl(url: string): Extract["selection"] { + const queryIndex = url.indexOf("?") + if (queryIndex === -1) return undefined + const params = new URLSearchParams(url.slice(queryIndex + 1)) + const startLine = Number(params.get("start")) + const endLine = Number(params.get("end")) + if (!Number.isFinite(startLine) || !Number.isFinite(endLine)) return undefined + return { + startLine, + endLine, + startChar: 0, + endChar: 0, + } +} + +function textPartValue(parts: Part[]) { + const candidates = parts + .filter((part): part is TextPart => part.type === "text") + .filter((part) => !part.synthetic && !part.ignored) + return candidates.reduce((best: TextPart | undefined, part) => { + if (!best) return part + if (part.text.length > best.text.length) return part + return best + }, undefined) +} + +/** + * Extract prompt content from message parts for restoring into the prompt input. + * This is used by undo to restore the original user prompt. + */ +export function extractPromptFromParts(parts: Part[], opts?: { directory?: string; attachmentName?: string }): Prompt { + const textPart = textPartValue(parts) + const text = textPart?.text ?? "" + const directory = opts?.directory + const attachmentName = opts?.attachmentName ?? "attachment" + + const toRelative = (path: string) => { + if (!directory) return path + + const prefix = directory.endsWith("/") ? directory : directory + "/" + if (path.startsWith(prefix)) return path.slice(prefix.length) + + if (path.startsWith(directory)) { + const next = path.slice(directory.length) + if (next.startsWith("/")) return next.slice(1) + return next + } + + return path + } + + const inline: Inline[] = [] + const images: ImageAttachmentPart[] = [] + + for (const part of parts) { + if (part.type === "file") { + const filePart = part as FilePart + const sourceText = filePart.source?.text + if (sourceText) { + const value = sourceText.value + const start = sourceText.start + const end = sourceText.end + let path = value + if (value.startsWith("@")) path = value.slice(1) + if (!value.startsWith("@") && filePart.source && "path" in filePart.source) { + path = filePart.source.path + } + inline.push({ + type: "file", + start, + end, + value, + path: toRelative(path), + selection: selectionFromFileUrl(filePart.url), + }) + continue + } + + if (filePart.url.startsWith("data:")) { + images.push({ + type: "image", + id: filePart.id, + filename: filePart.filename ?? attachmentName, + mime: filePart.mime, + dataUrl: filePart.url, + }) + } + } + + if (part.type === "agent") { + const agentPart = part as MessageAgentPart + const source = agentPart.source + if (!source) continue + inline.push({ + type: "agent", + start: source.start, + end: source.end, + value: source.value, + name: agentPart.name, + }) + } + } + + inline.sort((a, b) => { + if (a.start !== b.start) return a.start - b.start + return a.end - b.end + }) + + const result: Prompt = [] + let position = 0 + let cursor = 0 + + const pushText = (content: string) => { + if (!content) return + result.push({ + type: "text", + content, + start: position, + end: position + content.length, + }) + position += content.length + } + + const pushFile = (item: Extract) => { + const content = item.value + const attachment: FileAttachmentPart = { + type: "file", + path: item.path, + content, + start: position, + end: position + content.length, + selection: item.selection, + } + result.push(attachment) + position += content.length + } + + const pushAgent = (item: Extract) => { + const content = item.value + const mention: AgentPart = { + type: "agent", + name: item.name, + content, + start: position, + end: position + content.length, + } + result.push(mention) + position += content.length + } + + for (const item of inline) { + if (item.start < 0 || item.end < item.start) continue + + const expected = item.value + if (!expected) continue + + const mismatch = item.end > text.length || item.start < cursor || text.slice(item.start, item.end) !== expected + const start = mismatch ? text.indexOf(expected, cursor) : item.start + if (start === -1) continue + const end = mismatch ? start + expected.length : item.end + + pushText(text.slice(cursor, start)) + + if (item.type === "file") pushFile(item) + if (item.type === "agent") pushAgent(item) + + cursor = end + } + + pushText(text.slice(cursor)) + + if (result.length === 0) { + result.push({ type: "text", content: "", start: 0, end: 0 }) + } + + if (images.length === 0) return result + return [...result, ...images] +} diff --git a/packages/app/src/utils/same.ts b/packages/app/src/utils/same.ts new file mode 100644 index 00000000000..c956f92998a --- /dev/null +++ b/packages/app/src/utils/same.ts @@ -0,0 +1,6 @@ +export function same(a: readonly T[] | undefined, b: readonly T[] | undefined) { + if (a === b) return true + if (!a || !b) return false + if (a.length !== b.length) return false + return a.every((x, i) => x === b[i]) +} diff --git a/packages/app/src/utils/solid-dnd.tsx b/packages/app/src/utils/solid-dnd.tsx new file mode 100644 index 00000000000..a634be4b486 --- /dev/null +++ b/packages/app/src/utils/solid-dnd.tsx @@ -0,0 +1,55 @@ +import { useDragDropContext } from "@thisbeyond/solid-dnd" +import { JSXElement } from "solid-js" +import type { Transformer } from "@thisbeyond/solid-dnd" + +export const getDraggableId = (event: unknown): string | undefined => { + if (typeof event !== "object" || event === null) return undefined + if (!("draggable" in event)) return undefined + const draggable = (event as { draggable?: { id?: unknown } }).draggable + if (!draggable) return undefined + return typeof draggable.id === "string" ? draggable.id : undefined +} + +export const ConstrainDragXAxis = (): JSXElement => { + const context = useDragDropContext() + if (!context) return <> + const [, { onDragStart, onDragEnd, addTransformer, removeTransformer }] = context + const transformer: Transformer = { + id: "constrain-x-axis", + order: 100, + callback: (transform) => ({ ...transform, x: 0 }), + } + onDragStart((event) => { + const id = getDraggableId(event) + if (!id) return + addTransformer("draggables", id, transformer) + }) + onDragEnd((event) => { + const id = getDraggableId(event) + if (!id) return + removeTransformer("draggables", id, transformer.id) + }) + return <> +} + +export const ConstrainDragYAxis = (): JSXElement => { + const context = useDragDropContext() + if (!context) return <> + const [, { onDragStart, onDragEnd, addTransformer, removeTransformer }] = context + const transformer: Transformer = { + id: "constrain-y-axis", + order: 100, + callback: (transform) => ({ ...transform, y: 0 }), + } + onDragStart((event) => { + const id = getDraggableId(event) + if (!id) return + addTransformer("draggables", id, transformer) + }) + onDragEnd((event) => { + const id = getDraggableId(event) + if (!id) return + removeTransformer("draggables", id, transformer.id) + }) + return <> +} diff --git a/packages/app/src/utils/sound.ts b/packages/app/src/utils/sound.ts new file mode 100644 index 00000000000..d5e606c6750 --- /dev/null +++ b/packages/app/src/utils/sound.ts @@ -0,0 +1,110 @@ +import alert01 from "@opencode-ai/ui/audio/alert-01.aac" +import alert02 from "@opencode-ai/ui/audio/alert-02.aac" +import alert03 from "@opencode-ai/ui/audio/alert-03.aac" +import alert04 from "@opencode-ai/ui/audio/alert-04.aac" +import alert05 from "@opencode-ai/ui/audio/alert-05.aac" +import alert06 from "@opencode-ai/ui/audio/alert-06.aac" +import alert07 from "@opencode-ai/ui/audio/alert-07.aac" +import alert08 from "@opencode-ai/ui/audio/alert-08.aac" +import alert09 from "@opencode-ai/ui/audio/alert-09.aac" +import alert10 from "@opencode-ai/ui/audio/alert-10.aac" +import bipbop01 from "@opencode-ai/ui/audio/bip-bop-01.aac" +import bipbop02 from "@opencode-ai/ui/audio/bip-bop-02.aac" +import bipbop03 from "@opencode-ai/ui/audio/bip-bop-03.aac" +import bipbop04 from "@opencode-ai/ui/audio/bip-bop-04.aac" +import bipbop05 from "@opencode-ai/ui/audio/bip-bop-05.aac" +import bipbop06 from "@opencode-ai/ui/audio/bip-bop-06.aac" +import bipbop07 from "@opencode-ai/ui/audio/bip-bop-07.aac" +import bipbop08 from "@opencode-ai/ui/audio/bip-bop-08.aac" +import bipbop09 from "@opencode-ai/ui/audio/bip-bop-09.aac" +import bipbop10 from "@opencode-ai/ui/audio/bip-bop-10.aac" +import nope01 from "@opencode-ai/ui/audio/nope-01.aac" +import nope02 from "@opencode-ai/ui/audio/nope-02.aac" +import nope03 from "@opencode-ai/ui/audio/nope-03.aac" +import nope04 from "@opencode-ai/ui/audio/nope-04.aac" +import nope05 from "@opencode-ai/ui/audio/nope-05.aac" +import nope06 from "@opencode-ai/ui/audio/nope-06.aac" +import nope07 from "@opencode-ai/ui/audio/nope-07.aac" +import nope08 from "@opencode-ai/ui/audio/nope-08.aac" +import nope09 from "@opencode-ai/ui/audio/nope-09.aac" +import nope10 from "@opencode-ai/ui/audio/nope-10.aac" +import nope11 from "@opencode-ai/ui/audio/nope-11.aac" +import nope12 from "@opencode-ai/ui/audio/nope-12.aac" +import staplebops01 from "@opencode-ai/ui/audio/staplebops-01.aac" +import staplebops02 from "@opencode-ai/ui/audio/staplebops-02.aac" +import staplebops03 from "@opencode-ai/ui/audio/staplebops-03.aac" +import staplebops04 from "@opencode-ai/ui/audio/staplebops-04.aac" +import staplebops05 from "@opencode-ai/ui/audio/staplebops-05.aac" +import staplebops06 from "@opencode-ai/ui/audio/staplebops-06.aac" +import staplebops07 from "@opencode-ai/ui/audio/staplebops-07.aac" +import yup01 from "@opencode-ai/ui/audio/yup-01.aac" +import yup02 from "@opencode-ai/ui/audio/yup-02.aac" +import yup03 from "@opencode-ai/ui/audio/yup-03.aac" +import yup04 from "@opencode-ai/ui/audio/yup-04.aac" +import yup05 from "@opencode-ai/ui/audio/yup-05.aac" +import yup06 from "@opencode-ai/ui/audio/yup-06.aac" + +export const SOUND_OPTIONS = [ + { id: "alert-01", label: "sound.option.alert01", src: alert01 }, + { id: "alert-02", label: "sound.option.alert02", src: alert02 }, + { id: "alert-03", label: "sound.option.alert03", src: alert03 }, + { id: "alert-04", label: "sound.option.alert04", src: alert04 }, + { id: "alert-05", label: "sound.option.alert05", src: alert05 }, + { id: "alert-06", label: "sound.option.alert06", src: alert06 }, + { id: "alert-07", label: "sound.option.alert07", src: alert07 }, + { id: "alert-08", label: "sound.option.alert08", src: alert08 }, + { id: "alert-09", label: "sound.option.alert09", src: alert09 }, + { id: "alert-10", label: "sound.option.alert10", src: alert10 }, + { id: "bip-bop-01", label: "sound.option.bipbop01", src: bipbop01 }, + { id: "bip-bop-02", label: "sound.option.bipbop02", src: bipbop02 }, + { id: "bip-bop-03", label: "sound.option.bipbop03", src: bipbop03 }, + { id: "bip-bop-04", label: "sound.option.bipbop04", src: bipbop04 }, + { id: "bip-bop-05", label: "sound.option.bipbop05", src: bipbop05 }, + { id: "bip-bop-06", label: "sound.option.bipbop06", src: bipbop06 }, + { id: "bip-bop-07", label: "sound.option.bipbop07", src: bipbop07 }, + { id: "bip-bop-08", label: "sound.option.bipbop08", src: bipbop08 }, + { id: "bip-bop-09", label: "sound.option.bipbop09", src: bipbop09 }, + { id: "bip-bop-10", label: "sound.option.bipbop10", src: bipbop10 }, + { id: "staplebops-01", label: "sound.option.staplebops01", src: staplebops01 }, + { id: "staplebops-02", label: "sound.option.staplebops02", src: staplebops02 }, + { id: "staplebops-03", label: "sound.option.staplebops03", src: staplebops03 }, + { id: "staplebops-04", label: "sound.option.staplebops04", src: staplebops04 }, + { id: "staplebops-05", label: "sound.option.staplebops05", src: staplebops05 }, + { id: "staplebops-06", label: "sound.option.staplebops06", src: staplebops06 }, + { id: "staplebops-07", label: "sound.option.staplebops07", src: staplebops07 }, + { id: "nope-01", label: "sound.option.nope01", src: nope01 }, + { id: "nope-02", label: "sound.option.nope02", src: nope02 }, + { id: "nope-03", label: "sound.option.nope03", src: nope03 }, + { id: "nope-04", label: "sound.option.nope04", src: nope04 }, + { id: "nope-05", label: "sound.option.nope05", src: nope05 }, + { id: "nope-06", label: "sound.option.nope06", src: nope06 }, + { id: "nope-07", label: "sound.option.nope07", src: nope07 }, + { id: "nope-08", label: "sound.option.nope08", src: nope08 }, + { id: "nope-09", label: "sound.option.nope09", src: nope09 }, + { id: "nope-10", label: "sound.option.nope10", src: nope10 }, + { id: "nope-11", label: "sound.option.nope11", src: nope11 }, + { id: "nope-12", label: "sound.option.nope12", src: nope12 }, + { id: "yup-01", label: "sound.option.yup01", src: yup01 }, + { id: "yup-02", label: "sound.option.yup02", src: yup02 }, + { id: "yup-03", label: "sound.option.yup03", src: yup03 }, + { id: "yup-04", label: "sound.option.yup04", src: yup04 }, + { id: "yup-05", label: "sound.option.yup05", src: yup05 }, + { id: "yup-06", label: "sound.option.yup06", src: yup06 }, +] as const + +export type SoundOption = (typeof SOUND_OPTIONS)[number] +export type SoundID = SoundOption["id"] + +const soundById = Object.fromEntries(SOUND_OPTIONS.map((s) => [s.id, s.src])) as Record + +export function soundSrc(id: string | undefined) { + if (!id) return + if (!(id in soundById)) return + return soundById[id as SoundID] +} + +export function playSound(src: string | undefined) { + if (typeof Audio === "undefined") return + if (!src) return + void new Audio(src).play().catch(() => undefined) +} diff --git a/packages/desktop/src/utils/speech.ts b/packages/app/src/utils/speech.ts similarity index 100% rename from packages/desktop/src/utils/speech.ts rename to packages/app/src/utils/speech.ts diff --git a/packages/tauri/sst-env.d.ts b/packages/app/sst-env.d.ts similarity index 100% rename from packages/tauri/sst-env.d.ts rename to packages/app/sst-env.d.ts diff --git a/packages/tauri/tsconfig.json b/packages/app/tsconfig.json similarity index 51% rename from packages/tauri/tsconfig.json rename to packages/app/tsconfig.json index e7f5c5c2798..e2a27dd5d8a 100644 --- a/packages/tauri/tsconfig.json +++ b/packages/app/tsconfig.json @@ -1,5 +1,7 @@ { + "$schema": "https://json.schemastore.org/tsconfig", "compilerOptions": { + "composite": true, "target": "ESNext", "module": "ESNext", "skipLibCheck": true, @@ -9,12 +11,16 @@ "jsx": "preserve", "jsxImportSource": "solid-js", "allowJs": true, + "resolveJsonModule": true, "strict": true, + "noEmit": false, + "emitDeclarationOnly": true, + "outDir": "node_modules/.ts-dist", "isolatedModules": true, - "noEmit": true, - "emitDeclarationOnly": false, - "outDir": "node_modules/.ts-dist" + "paths": { + "@/*": ["./src/*"] + } }, - "references": [{ "path": "../desktop" }], - "include": ["src"] + "include": ["src", "package.json"], + "exclude": ["dist", "ts-dist"] } diff --git a/packages/app/vite.config.ts b/packages/app/vite.config.ts new file mode 100644 index 00000000000..6a29ae6345e --- /dev/null +++ b/packages/app/vite.config.ts @@ -0,0 +1,15 @@ +import { defineConfig } from "vite" +import desktopPlugin from "./vite" + +export default defineConfig({ + plugins: [desktopPlugin] as any, + server: { + host: "0.0.0.0", + allowedHosts: true, + port: 3000, + }, + build: { + target: "esnext", + // sourcemap: true, + }, +}) diff --git a/packages/desktop/vite.js b/packages/app/vite.js similarity index 100% rename from packages/desktop/vite.js rename to packages/app/vite.js diff --git a/packages/console/app/.opencode/agent/css.md b/packages/console/app/.opencode/agent/css.md index d0ec43a483b..d5e68c7bf6a 100644 --- a/packages/console/app/.opencode/agent/css.md +++ b/packages/console/app/.opencode/agent/css.md @@ -49,7 +49,7 @@ use data attributes to represent different states of the component } ``` -this will allow jsx to control the syling +this will allow jsx to control the styling avoid selectors that just target an element type like `> span` you should assign it a slot name. it's ok to do this sometimes where it makes sense semantically diff --git a/packages/console/app/package.json b/packages/console/app/package.json index 96cd611f432..dca6f8477cd 100644 --- a/packages/console/app/package.json +++ b/packages/console/app/package.json @@ -1,11 +1,12 @@ { "name": "@opencode-ai/console-app", - "version": "1.0.152", + "version": "1.1.33", "type": "module", + "license": "MIT", "scripts": { "typecheck": "tsgo --noEmit", "dev": "vite dev --host 0.0.0.0", - "dev:remote": "VITE_AUTH_URL=https://auth.dev.opencode.ai bun sst shell --stage=dev bun dev", + "dev:remote": "VITE_AUTH_URL=https://auth.dev.opencode.ai VITE_STRIPE_PUBLISHABLE_KEY=pk_test_51RtuLNE7fOCwHSD4mewwzFejyytjdGoSDK7CAvhbffwaZnPbNb2rwJICw6LTOXCmWO320fSNXvb5NzI08RZVkAxd00syfqrW7t bun sst shell --stage=dev bun dev", "build": "./script/generate-sitemap.ts && vite build && ../../opencode/script/schema.ts ./.output/public/config.json", "start": "vite start" }, @@ -19,17 +20,23 @@ "@opencode-ai/console-mail": "workspace:*", "@opencode-ai/console-resource": "workspace:*", "@opencode-ai/ui": "workspace:*", + "@smithy/eventstream-codec": "4.2.7", + "@smithy/util-utf8": "4.2.0", "@solidjs/meta": "catalog:", "@solidjs/router": "catalog:", "@solidjs/start": "catalog:", + "@stripe/stripe-js": "8.6.1", "chart.js": "4.5.1", "nitro": "3.0.1-alpha.1", "solid-js": "catalog:", + "solid-list": "0.3.0", + "solid-stripe": "0.8.1", "vite": "catalog:", "zod": "catalog:" }, "devDependencies": { "@typescript/native-preview": "catalog:", + "@webgpu/types": "0.1.54", "typescript": "catalog:", "wrangler": "4.50.0" }, diff --git a/packages/console/app/public/apple-touch-icon-v3.png b/packages/console/app/public/apple-touch-icon-v3.png new file mode 120000 index 00000000000..ddd1d1ac33c --- /dev/null +++ b/packages/console/app/public/apple-touch-icon-v3.png @@ -0,0 +1 @@ +../../../ui/src/assets/favicon/apple-touch-icon-v3.png \ No newline at end of file diff --git a/packages/console/app/public/favicon-96x96-v3.png b/packages/console/app/public/favicon-96x96-v3.png new file mode 120000 index 00000000000..5f4b8a73bbf --- /dev/null +++ b/packages/console/app/public/favicon-96x96-v3.png @@ -0,0 +1 @@ +../../../ui/src/assets/favicon/favicon-96x96-v3.png \ No newline at end of file diff --git a/packages/console/app/public/favicon-v3.ico b/packages/console/app/public/favicon-v3.ico new file mode 120000 index 00000000000..6e1f48aec90 --- /dev/null +++ b/packages/console/app/public/favicon-v3.ico @@ -0,0 +1 @@ +../../../ui/src/assets/favicon/favicon-v3.ico \ No newline at end of file diff --git a/packages/console/app/public/favicon-v3.svg b/packages/console/app/public/favicon-v3.svg new file mode 120000 index 00000000000..77814acf5c1 --- /dev/null +++ b/packages/console/app/public/favicon-v3.svg @@ -0,0 +1 @@ +../../../ui/src/assets/favicon/favicon-v3.svg \ No newline at end of file diff --git a/packages/console/app/public/social-share-black.png b/packages/console/app/public/social-share-black.png new file mode 120000 index 00000000000..5baa00483b5 --- /dev/null +++ b/packages/console/app/public/social-share-black.png @@ -0,0 +1 @@ +../../../ui/src/assets/images/social-share-black.png \ No newline at end of file diff --git a/packages/console/app/src/asset/black/hero.png b/packages/console/app/src/asset/black/hero.png new file mode 100644 index 00000000000..967f4ac6e50 Binary files /dev/null and b/packages/console/app/src/asset/black/hero.png differ diff --git a/packages/console/app/src/component/footer.tsx b/packages/console/app/src/component/footer.tsx index 5eac75967ac..27f8ddd65f1 100644 --- a/packages/console/app/src/component/footer.tsx +++ b/packages/console/app/src/component/footer.tsx @@ -24,6 +24,9 @@ export function Footer() { +
    + Changelog +
    diff --git a/packages/console/app/src/component/header.tsx b/packages/console/app/src/component/header.tsx index 39e83397358..7bfcc782508 100644 --- a/packages/console/app/src/component/header.tsx +++ b/packages/console/app/src/component/header.tsx @@ -119,8 +119,8 @@ export function Header(props: { zen?: boolean; hideGetStarted?: boolean }) {
    @@ -169,6 +169,25 @@ export function Header(props: { zen?: boolean; hideGetStarted?: boolean }) { + + {" "} +
  • + {" "} + + {" "} + + {" "} + {" "} + {" "} + Free{" "} + {" "} +
  • +
) } diff --git a/packages/console/app/src/component/spotlight.css b/packages/console/app/src/component/spotlight.css new file mode 100644 index 00000000000..4b311c3d021 --- /dev/null +++ b/packages/console/app/src/component/spotlight.css @@ -0,0 +1,15 @@ +.spotlight-container { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 50dvh; + pointer-events: none; + overflow: hidden; +} + +.spotlight-container canvas { + display: block; + width: 100%; + height: 100%; +} diff --git a/packages/console/app/src/component/spotlight.tsx b/packages/console/app/src/component/spotlight.tsx new file mode 100644 index 00000000000..70430699055 --- /dev/null +++ b/packages/console/app/src/component/spotlight.tsx @@ -0,0 +1,820 @@ +import { createSignal, createEffect, onMount, onCleanup, Accessor } from "solid-js" +import "./spotlight.css" + +export interface ParticlesConfig { + enabled: boolean + amount: number + size: [number, number] + speed: number + opacity: number + drift: number +} + +export interface SpotlightConfig { + placement: [number, number] + color: string + speed: number + spread: number + length: number + width: number + pulsating: false | [number, number] + distance: number + saturation: number + noiseAmount: number + distortion: number + opacity: number + particles: ParticlesConfig +} + +export const defaultConfig: SpotlightConfig = { + placement: [0.5, -0.15], + color: "#ffffff", + speed: 0.8, + spread: 0.5, + length: 4.0, + width: 0.15, + pulsating: [0.95, 1.1], + distance: 3.5, + saturation: 0.35, + noiseAmount: 0.15, + distortion: 0.05, + opacity: 0.325, + particles: { + enabled: true, + amount: 70, + size: [1.25, 1.5], + speed: 0.75, + opacity: 0.9, + drift: 1.5, + }, +} + +export interface SpotlightAnimationState { + time: number + intensity: number + pulseValue: number +} + +interface SpotlightProps { + config: Accessor + class?: string + onAnimationFrame?: (state: SpotlightAnimationState) => void +} + +const hexToRgb = (hex: string): [number, number, number] => { + const m = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex) + return m ? [parseInt(m[1], 16) / 255, parseInt(m[2], 16) / 255, parseInt(m[3], 16) / 255] : [1, 1, 1] +} + +const getAnchorAndDir = ( + placement: [number, number], + w: number, + h: number, +): { anchor: [number, number]; dir: [number, number] } => { + const [px, py] = placement + const outside = 0.2 + + let anchorX = px * w + let anchorY = py * h + let dirX = 0 + let dirY = 0 + + const centerX = 0.5 + const centerY = 0.5 + + if (py <= 0.25) { + anchorY = -outside * h + py * h + dirY = 1 + dirX = (centerX - px) * 0.5 + } else if (py >= 0.75) { + anchorY = (1 + outside) * h - (1 - py) * h + dirY = -1 + dirX = (centerX - px) * 0.5 + } else if (px <= 0.25) { + anchorX = -outside * w + px * w + dirX = 1 + dirY = (centerY - py) * 0.5 + } else if (px >= 0.75) { + anchorX = (1 + outside) * w - (1 - px) * w + dirX = -1 + dirY = (centerY - py) * 0.5 + } else { + dirY = 1 + } + + const len = Math.sqrt(dirX * dirX + dirY * dirY) + if (len > 0) { + dirX /= len + dirY /= len + } + + return { anchor: [anchorX, anchorY], dir: [dirX, dirY] } +} + +interface UniformData { + iTime: number + iResolution: [number, number] + lightPos: [number, number] + lightDir: [number, number] + color: [number, number, number] + speed: number + lightSpread: number + lightLength: number + sourceWidth: number + pulsating: number + pulsatingMin: number + pulsatingMax: number + fadeDistance: number + saturation: number + noiseAmount: number + distortion: number + particlesEnabled: number + particleAmount: number + particleSizeMin: number + particleSizeMax: number + particleSpeed: number + particleOpacity: number + particleDrift: number +} + +const WGSL_SHADER = ` + struct Uniforms { + iTime: f32, + _pad0: f32, + iResolution: vec2, + lightPos: vec2, + lightDir: vec2, + color: vec3, + speed: f32, + lightSpread: f32, + lightLength: f32, + sourceWidth: f32, + pulsating: f32, + pulsatingMin: f32, + pulsatingMax: f32, + fadeDistance: f32, + saturation: f32, + noiseAmount: f32, + distortion: f32, + particlesEnabled: f32, + particleAmount: f32, + particleSizeMin: f32, + particleSizeMax: f32, + particleSpeed: f32, + particleOpacity: f32, + particleDrift: f32, + _pad1: f32, + _pad2: f32, + }; + + @group(0) @binding(0) var uniforms: Uniforms; + + struct VertexOutput { + @builtin(position) position: vec4, + @location(0) vUv: vec2, + }; + + @vertex + fn vertexMain(@builtin(vertex_index) vertexIndex: u32) -> VertexOutput { + var positions = array, 3>( + vec2(-1.0, -1.0), + vec2(3.0, -1.0), + vec2(-1.0, 3.0) + ); + + var output: VertexOutput; + let pos = positions[vertexIndex]; + output.position = vec4(pos, 0.0, 1.0); + output.vUv = pos * 0.5 + 0.5; + return output; + } + + fn hash(p: vec2) -> f32 { + let p3 = fract(p.xyx * 0.1031); + return fract((p3.x + p3.y) * p3.z + dot(p3, p3.yzx + 33.33)); + } + + fn hash2(p: vec2) -> vec2 { + let n = sin(dot(p, vec2(41.0, 289.0))); + return fract(vec2(n * 262144.0, n * 32768.0)); + } + + fn fastNoise(st: vec2) -> f32 { + return fract(sin(dot(st, vec2(12.9898, 78.233))) * 43758.5453); + } + + fn lightStrengthCombined(lightSource: vec2, lightRefDirection: vec2, coord: vec2) -> f32 { + let sourceToCoord = coord - lightSource; + let distSq = dot(sourceToCoord, sourceToCoord); + let distance = sqrt(distSq); + + let baseSize = min(uniforms.iResolution.x, uniforms.iResolution.y); + let maxDistance = max(baseSize * uniforms.lightLength, 0.001); + if (distance > maxDistance) { + return 0.0; + } + + let invDist = 1.0 / max(distance, 0.001); + let dirNorm = sourceToCoord * invDist; + let cosAngle = dot(dirNorm, lightRefDirection); + + if (cosAngle < 0.0) { + return 0.0; + } + + let side = dot(dirNorm, vec2(-lightRefDirection.y, lightRefDirection.x)); + let time = uniforms.iTime; + let speed = uniforms.speed; + + let asymNoise = fastNoise(vec2(side * 6.0 + time * 0.12, distance * 0.004 + cosAngle * 2.0)); + let asymShift = (asymNoise - 0.5) * uniforms.distortion * 0.6; + + let distortPhase = time * 1.4 + distance * 0.006 + cosAngle * 4.5 + side * 1.7; + let distortedAngle = cosAngle + uniforms.distortion * sin(distortPhase) * 0.22 + asymShift; + + let flickerSeed = cosAngle * 9.0 + side * 4.0 + time * speed * 0.35; + let flicker = 0.86 + fastNoise(vec2(flickerSeed, distance * 0.01)) * 0.28; + + let asymSpread = max(uniforms.lightSpread * (0.9 + (asymNoise - 0.5) * 0.25), 0.001); + let spreadFactor = pow(max(distortedAngle, 0.0), 1.0 / asymSpread); + let lengthFalloff = clamp(1.0 - distance / maxDistance, 0.0, 1.0); + + let fadeMaxDist = max(baseSize * uniforms.fadeDistance, 0.001); + let fadeFalloff = clamp((fadeMaxDist - distance) / fadeMaxDist, 0.0, 1.0); + + var pulse: f32 = 1.0; + if (uniforms.pulsating > 0.5) { + let pulseCenter = (uniforms.pulsatingMin + uniforms.pulsatingMax) * 0.5; + let pulseAmplitude = (uniforms.pulsatingMax - uniforms.pulsatingMin) * 0.5; + pulse = pulseCenter + pulseAmplitude * sin(time * speed * 3.0); + } + + let timeSpeed = time * speed; + let wave = 0.5 + + 0.25 * sin(cosAngle * 28.0 + side * 8.0 + timeSpeed * 1.2) + + 0.18 * cos(cosAngle * 22.0 - timeSpeed * 0.95 + side * 6.0) + + 0.12 * sin(cosAngle * 35.0 + timeSpeed * 1.6 + asymNoise * 3.0); + let minStrength = 0.14 + asymNoise * 0.06; + let baseStrength = max(clamp(wave * (0.85 + asymNoise * 0.3), 0.0, 1.0), minStrength); + + let lightStrength = baseStrength * lengthFalloff * fadeFalloff * spreadFactor * pulse * flicker; + let ambientLight = (0.06 + asymNoise * 0.04) * lengthFalloff * fadeFalloff * spreadFactor; + + return max(lightStrength, ambientLight); + } + + fn particle(coord: vec2, particlePos: vec2, size: f32) -> f32 { + let delta = coord - particlePos; + let distSq = dot(delta, delta); + let sizeSq = size * size; + + if (distSq > sizeSq * 9.0) { + return 0.0; + } + + let d = sqrt(distSq); + let core = smoothstep(size, size * 0.35, d); + let glow = smoothstep(size * 3.0, 0.0, d) * 0.55; + return core + glow; + } + + fn renderParticles(coord: vec2, lightSource: vec2, lightDir: vec2) -> f32 { + if (uniforms.particlesEnabled < 0.5 || uniforms.particleAmount < 1.0) { + return 0.0; + } + + var particleSum: f32 = 0.0; + let particleCount = i32(uniforms.particleAmount); + let time = uniforms.iTime * uniforms.particleSpeed; + let perpDir = vec2(-lightDir.y, lightDir.x); + let baseSize = min(uniforms.iResolution.x, uniforms.iResolution.y); + let maxDist = max(baseSize * uniforms.lightLength, 1.0); + let spreadScale = uniforms.lightSpread * baseSize * 0.65; + let coneHalfWidth = uniforms.lightSpread * baseSize * 0.55; + + for (var i: i32 = 0; i < particleCount; i = i + 1) { + let fi = f32(i); + let seed = vec2(fi * 127.1, fi * 311.7); + let rnd = hash2(seed); + + let lifeDuration = 2.0 + hash(seed + vec2(19.0, 73.0)) * 3.0; + let lifeOffset = hash(seed + vec2(91.0, 37.0)) * lifeDuration; + let lifeProgress = fract((time + lifeOffset) / lifeDuration); + + let fadeIn = smoothstep(0.0, 0.2, lifeProgress); + let fadeOut = 1.0 - smoothstep(0.8, 1.0, lifeProgress); + let lifeFade = fadeIn * fadeOut; + if (lifeFade < 0.01) { + continue; + } + + let alongLight = rnd.x * maxDist * 0.8; + let perpOffset = (rnd.y - 0.5) * spreadScale; + + let floatPhase = rnd.y * 6.28318 + fi * 0.37; + let floatSpeed = 0.35 + rnd.x * 0.9; + let drift = vec2( + sin(time * floatSpeed + floatPhase), + cos(time * floatSpeed * 0.85 + floatPhase * 1.3) + ) * uniforms.particleDrift * baseSize * 0.08; + + let wobble = vec2( + sin(time * 1.4 + floatPhase * 2.1), + cos(time * 1.1 + floatPhase * 1.6) + ) * uniforms.particleDrift * baseSize * 0.03; + + let flowOffset = (rnd.x - 0.5) * baseSize * 0.12 + fract(time * 0.06 + rnd.y) * baseSize * 0.1; + + let basePos = lightSource + lightDir * (alongLight + flowOffset) + perpDir * perpOffset + drift + wobble; + + let toParticle = basePos - lightSource; + let projLen = dot(toParticle, lightDir); + if (projLen < 0.0 || projLen > maxDist) { + continue; + } + + let sideDist = abs(dot(toParticle, perpDir)); + if (sideDist > coneHalfWidth) { + continue; + } + + let size = mix(uniforms.particleSizeMin, uniforms.particleSizeMax, rnd.x); + let twinkle = 0.7 + 0.3 * sin(time * (1.5 + rnd.y * 2.0) + floatPhase); + let distFade = 1.0 - smoothstep(maxDist * 0.2, maxDist * 0.95, projLen); + if (distFade < 0.01) { + continue; + } + + let p = particle(coord, basePos, size); + if (p > 0.0) { + particleSum = particleSum + p * lifeFade * twinkle * distFade * uniforms.particleOpacity; + if (particleSum >= 1.0) { + break; + } + } + } + + return min(particleSum, 1.0); + } + + @fragment + fn fragmentMain(@builtin(position) fragCoord: vec4, @location(0) vUv: vec2) -> @location(0) vec4 { + let coord = vec2(fragCoord.x, fragCoord.y); + + let normalizedX = (coord.x / uniforms.iResolution.x) - 0.5; + let widthOffset = -normalizedX * uniforms.sourceWidth * uniforms.iResolution.x; + + let perpDir = vec2(-uniforms.lightDir.y, uniforms.lightDir.x); + let adjustedLightPos = uniforms.lightPos + perpDir * widthOffset; + + let lightValue = lightStrengthCombined(adjustedLightPos, uniforms.lightDir, coord); + + if (lightValue < 0.001) { + let particles = renderParticles(coord, adjustedLightPos, uniforms.lightDir); + if (particles < 0.001) { + return vec4(0.0, 0.0, 0.0, 0.0); + } + let particleBrightness = particles * 1.8; + return vec4(uniforms.color * particleBrightness, particles * 0.9); + } + + var fragColor = vec4(lightValue, lightValue, lightValue, lightValue); + + if (uniforms.noiseAmount > 0.01) { + let n = fastNoise(coord * 0.5 + uniforms.iTime * 0.5); + let grain = mix(1.0, n, uniforms.noiseAmount * 0.5); + fragColor = vec4(fragColor.rgb * grain, fragColor.a); + } + + let brightness = 1.0 - (coord.y / uniforms.iResolution.y); + fragColor = vec4( + fragColor.x * (0.15 + brightness * 0.85), + fragColor.y * (0.35 + brightness * 0.65), + fragColor.z * (0.55 + brightness * 0.45), + fragColor.a + ); + + if (abs(uniforms.saturation - 1.0) > 0.01) { + let gray = dot(fragColor.rgb, vec3(0.299, 0.587, 0.114)); + fragColor = vec4(mix(vec3(gray), fragColor.rgb, uniforms.saturation), fragColor.a); + } + + fragColor = vec4(fragColor.rgb * uniforms.color, fragColor.a); + + let particles = renderParticles(coord, adjustedLightPos, uniforms.lightDir); + if (particles > 0.001) { + let particleBrightness = particles * 1.8; + fragColor = vec4(fragColor.rgb + uniforms.color * particleBrightness, max(fragColor.a, particles * 0.9)); + } + + return fragColor; + } +` + +const UNIFORM_BUFFER_SIZE = 144 + +function updateUniformBuffer(buffer: Float32Array, data: UniformData): void { + buffer[0] = data.iTime + buffer[2] = data.iResolution[0] + buffer[3] = data.iResolution[1] + buffer[4] = data.lightPos[0] + buffer[5] = data.lightPos[1] + buffer[6] = data.lightDir[0] + buffer[7] = data.lightDir[1] + buffer[8] = data.color[0] + buffer[9] = data.color[1] + buffer[10] = data.color[2] + buffer[11] = data.speed + buffer[12] = data.lightSpread + buffer[13] = data.lightLength + buffer[14] = data.sourceWidth + buffer[15] = data.pulsating + buffer[16] = data.pulsatingMin + buffer[17] = data.pulsatingMax + buffer[18] = data.fadeDistance + buffer[19] = data.saturation + buffer[20] = data.noiseAmount + buffer[21] = data.distortion + buffer[22] = data.particlesEnabled + buffer[23] = data.particleAmount + buffer[24] = data.particleSizeMin + buffer[25] = data.particleSizeMax + buffer[26] = data.particleSpeed + buffer[27] = data.particleOpacity + buffer[28] = data.particleDrift +} + +export default function Spotlight(props: SpotlightProps) { + let containerRef: HTMLDivElement | undefined + let canvasRef: HTMLCanvasElement | null = null + let deviceRef: GPUDevice | null = null + let contextRef: GPUCanvasContext | null = null + let pipelineRef: GPURenderPipeline | null = null + let uniformBufferRef: GPUBuffer | null = null + let bindGroupRef: GPUBindGroup | null = null + let animationIdRef: number | null = null + let cleanupFunctionRef: (() => void) | null = null + let uniformDataRef: UniformData | null = null + let uniformArrayRef: Float32Array | null = null + let configRef: SpotlightConfig = props.config() + let frameCount = 0 + + const [isVisible, setIsVisible] = createSignal(false) + + createEffect(() => { + configRef = props.config() + }) + + onMount(() => { + if (!containerRef) return + + const observer = new IntersectionObserver( + (entries) => { + const entry = entries[0] + setIsVisible(entry.isIntersecting) + }, + { threshold: 0.1 }, + ) + + observer.observe(containerRef) + + onCleanup(() => { + observer.disconnect() + }) + }) + + createEffect(() => { + const visible = isVisible() + const config = props.config() + if (!visible || !containerRef) { + return + } + + if (cleanupFunctionRef) { + cleanupFunctionRef() + cleanupFunctionRef = null + } + + const initializeWebGPU = async () => { + if (!containerRef) { + return + } + + await new Promise((resolve) => setTimeout(resolve, 10)) + + if (!containerRef) { + return + } + + if (!navigator.gpu) { + console.warn("WebGPU is not supported in this browser") + return + } + + const adapter = await navigator.gpu.requestAdapter({ + powerPreference: "high-performance", + }) + if (!adapter) { + console.warn("Failed to get WebGPU adapter") + return + } + + const device = await adapter.requestDevice() + deviceRef = device + + const canvas = document.createElement("canvas") + canvas.style.width = "100%" + canvas.style.height = "100%" + canvasRef = canvas + + while (containerRef.firstChild) { + containerRef.removeChild(containerRef.firstChild) + } + containerRef.appendChild(canvas) + + const context = canvas.getContext("webgpu") + if (!context) { + console.warn("Failed to get WebGPU context") + return + } + contextRef = context + + const presentationFormat = navigator.gpu.getPreferredCanvasFormat() + context.configure({ + device, + format: presentationFormat, + alphaMode: "premultiplied", + }) + + const shaderModule = device.createShaderModule({ + code: WGSL_SHADER, + }) + + const uniformBuffer = device.createBuffer({ + size: UNIFORM_BUFFER_SIZE, + usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST, + }) + uniformBufferRef = uniformBuffer + + const bindGroupLayout = device.createBindGroupLayout({ + entries: [ + { + binding: 0, + visibility: GPUShaderStage.VERTEX | GPUShaderStage.FRAGMENT, + buffer: { type: "uniform" }, + }, + ], + }) + + const bindGroup = device.createBindGroup({ + layout: bindGroupLayout, + entries: [ + { + binding: 0, + resource: { buffer: uniformBuffer }, + }, + ], + }) + bindGroupRef = bindGroup + + const pipelineLayout = device.createPipelineLayout({ + bindGroupLayouts: [bindGroupLayout], + }) + + const pipeline = device.createRenderPipeline({ + layout: pipelineLayout, + vertex: { + module: shaderModule, + entryPoint: "vertexMain", + }, + fragment: { + module: shaderModule, + entryPoint: "fragmentMain", + targets: [ + { + format: presentationFormat, + blend: { + color: { + srcFactor: "src-alpha", + dstFactor: "one-minus-src-alpha", + operation: "add", + }, + alpha: { + srcFactor: "one", + dstFactor: "one-minus-src-alpha", + operation: "add", + }, + }, + }, + ], + }, + primitive: { + topology: "triangle-list", + }, + }) + pipelineRef = pipeline + + const { clientWidth: wCSS, clientHeight: hCSS } = containerRef + const dpr = Math.min(window.devicePixelRatio, 2) + const w = wCSS * dpr + const h = hCSS * dpr + const { anchor, dir } = getAnchorAndDir(config.placement, w, h) + + uniformDataRef = { + iTime: 0, + iResolution: [w, h], + lightPos: anchor, + lightDir: dir, + color: hexToRgb(config.color), + speed: config.speed, + lightSpread: config.spread, + lightLength: config.length, + sourceWidth: config.width, + pulsating: config.pulsating !== false ? 1.0 : 0.0, + pulsatingMin: config.pulsating !== false ? config.pulsating[0] : 1.0, + pulsatingMax: config.pulsating !== false ? config.pulsating[1] : 1.0, + fadeDistance: config.distance, + saturation: config.saturation, + noiseAmount: config.noiseAmount, + distortion: config.distortion, + particlesEnabled: config.particles.enabled ? 1.0 : 0.0, + particleAmount: config.particles.amount, + particleSizeMin: config.particles.size[0], + particleSizeMax: config.particles.size[1], + particleSpeed: config.particles.speed, + particleOpacity: config.particles.opacity, + particleDrift: config.particles.drift, + } + + const updatePlacement = () => { + if (!containerRef || !canvasRef || !uniformDataRef) { + return + } + + const dpr = Math.min(window.devicePixelRatio, 2) + const { clientWidth: wCSS, clientHeight: hCSS } = containerRef + const w = Math.floor(wCSS * dpr) + const h = Math.floor(hCSS * dpr) + + canvasRef.width = w + canvasRef.height = h + + uniformDataRef.iResolution = [w, h] + + const { anchor, dir } = getAnchorAndDir(configRef.placement, w, h) + uniformDataRef.lightPos = anchor + uniformDataRef.lightDir = dir + } + + const loop = (t: number) => { + if (!deviceRef || !contextRef || !pipelineRef || !uniformBufferRef || !bindGroupRef || !uniformDataRef) { + return + } + + const timeSeconds = t * 0.001 + uniformDataRef.iTime = timeSeconds + frameCount++ + + if (props.onAnimationFrame && frameCount % 2 === 0) { + const pulsatingMin = configRef.pulsating !== false ? configRef.pulsating[0] : 1.0 + const pulsatingMax = configRef.pulsating !== false ? configRef.pulsating[1] : 1.0 + const pulseCenter = (pulsatingMin + pulsatingMax) * 0.5 + const pulseAmplitude = (pulsatingMax - pulsatingMin) * 0.5 + const pulseValue = + configRef.pulsating !== false + ? pulseCenter + pulseAmplitude * Math.sin(timeSeconds * configRef.speed * 3.0) + : 1.0 + + const baseIntensity1 = 0.45 + 0.15 * Math.sin(timeSeconds * configRef.speed * 1.5) + const baseIntensity2 = 0.3 + 0.2 * Math.cos(timeSeconds * configRef.speed * 1.1) + const intensity = Math.max((baseIntensity1 + baseIntensity2) * pulseValue, 0.55) + + props.onAnimationFrame({ + time: timeSeconds, + intensity, + pulseValue: Math.max(pulseValue, 0.9), + }) + } + + try { + if (!uniformArrayRef) { + uniformArrayRef = new Float32Array(36) + } + updateUniformBuffer(uniformArrayRef, uniformDataRef) + deviceRef.queue.writeBuffer(uniformBufferRef, 0, uniformArrayRef.buffer) + + const commandEncoder = deviceRef.createCommandEncoder() + + const textureView = contextRef.getCurrentTexture().createView() + + const renderPass = commandEncoder.beginRenderPass({ + colorAttachments: [ + { + view: textureView, + clearValue: { r: 0, g: 0, b: 0, a: 0 }, + loadOp: "clear", + storeOp: "store", + }, + ], + }) + + renderPass.setPipeline(pipelineRef) + renderPass.setBindGroup(0, bindGroupRef) + renderPass.draw(3) + renderPass.end() + + deviceRef.queue.submit([commandEncoder.finish()]) + + animationIdRef = requestAnimationFrame(loop) + } catch (error) { + console.warn("WebGPU rendering error:", error) + return + } + } + + window.addEventListener("resize", updatePlacement) + updatePlacement() + animationIdRef = requestAnimationFrame(loop) + + cleanupFunctionRef = () => { + if (animationIdRef) { + cancelAnimationFrame(animationIdRef) + animationIdRef = null + } + + window.removeEventListener("resize", updatePlacement) + + if (uniformBufferRef) { + uniformBufferRef.destroy() + uniformBufferRef = null + } + + if (deviceRef) { + deviceRef.destroy() + deviceRef = null + } + + if (canvasRef && canvasRef.parentNode) { + canvasRef.parentNode.removeChild(canvasRef) + } + + canvasRef = null + contextRef = null + pipelineRef = null + bindGroupRef = null + uniformDataRef = null + } + } + + initializeWebGPU() + + onCleanup(() => { + if (cleanupFunctionRef) { + cleanupFunctionRef() + cleanupFunctionRef = null + } + }) + }) + + createEffect(() => { + if (!uniformDataRef || !containerRef) { + return + } + + const config = props.config() + + uniformDataRef.color = hexToRgb(config.color) + uniformDataRef.speed = config.speed + uniformDataRef.lightSpread = config.spread + uniformDataRef.lightLength = config.length + uniformDataRef.sourceWidth = config.width + uniformDataRef.pulsating = config.pulsating !== false ? 1.0 : 0.0 + uniformDataRef.pulsatingMin = config.pulsating !== false ? config.pulsating[0] : 1.0 + uniformDataRef.pulsatingMax = config.pulsating !== false ? config.pulsating[1] : 1.0 + uniformDataRef.fadeDistance = config.distance + uniformDataRef.saturation = config.saturation + uniformDataRef.noiseAmount = config.noiseAmount + uniformDataRef.distortion = config.distortion + uniformDataRef.particlesEnabled = config.particles.enabled ? 1.0 : 0.0 + uniformDataRef.particleAmount = config.particles.amount + uniformDataRef.particleSizeMin = config.particles.size[0] + uniformDataRef.particleSizeMax = config.particles.size[1] + uniformDataRef.particleSpeed = config.particles.speed + uniformDataRef.particleOpacity = config.particles.opacity + uniformDataRef.particleDrift = config.particles.drift + + const dpr = Math.min(window.devicePixelRatio, 2) + const { clientWidth: wCSS, clientHeight: hCSS } = containerRef + const { anchor, dir } = getAnchorAndDir(config.placement, wCSS * dpr, hCSS * dpr) + uniformDataRef.lightPos = anchor + uniformDataRef.lightDir = dir + }) + + return ( +
+ ) +} diff --git a/packages/console/app/src/config.ts b/packages/console/app/src/config.ts index e8a2ed252ba..1d99def1b9a 100644 --- a/packages/console/app/src/config.ts +++ b/packages/console/app/src/config.ts @@ -7,10 +7,10 @@ export const config = { // GitHub github: { - repoUrl: "https://github.com/sst/opencode", + repoUrl: "https://github.com/anomalyco/opencode", starsFormatted: { - compact: "38K", - full: "38,000", + compact: "80K", + full: "80,000", }, }, @@ -22,8 +22,8 @@ export const config = { // Static stats (used on landing page) stats: { - contributors: "375", - commits: "5,250", - monthlyUsers: "400,000", + contributors: "600", + commits: "7,500", + monthlyUsers: "1.5M", }, } as const diff --git a/packages/console/app/src/context/auth.session.ts b/packages/console/app/src/context/auth.session.ts index 726b6c8346c..e69de29bb2d 100644 --- a/packages/console/app/src/context/auth.session.ts +++ b/packages/console/app/src/context/auth.session.ts @@ -1,24 +0,0 @@ -import { useSession } from "@solidjs/start/http" - -export interface AuthSession { - account?: Record< - string, - { - id: string - email: string - } - > - current?: string -} - -export function useAuthSession() { - return useSession({ - password: "0".repeat(32), - name: "auth", - maxAge: 60 * 60 * 24 * 365, - cookie: { - secure: false, - httpOnly: true, - }, - }) -} diff --git a/packages/console/app/src/context/auth.ts b/packages/console/app/src/context/auth.ts index dbbd3c3b2fb..aed07a630f8 100644 --- a/packages/console/app/src/context/auth.ts +++ b/packages/console/app/src/context/auth.ts @@ -5,13 +5,38 @@ import { redirect } from "@solidjs/router" import { Actor } from "@opencode-ai/console-core/actor.js" import { createClient } from "@openauthjs/openauth/client" -import { useAuthSession } from "./auth.session" export const AuthClient = createClient({ clientID: "app", issuer: import.meta.env.VITE_AUTH_URL, }) +import { useSession } from "@solidjs/start/http" +import { Resource } from "@opencode-ai/console-resource" + +export interface AuthSession { + account?: Record< + string, + { + id: string + email: string + } + > + current?: string +} + +export function useAuthSession() { + return useSession({ + password: Resource.ZEN_SESSION_SECRET.value, + name: "auth", + maxAge: 60 * 60 * 24 * 365, + cookie: { + secure: false, + httpOnly: true, + }, + }) +} + export const getActor = async (workspace?: string): Promise => { "use server" const evt = getRequestEvent() diff --git a/packages/console/app/src/entry-server.tsx b/packages/console/app/src/entry-server.tsx index 913c8ca0600..deaadc747de 100644 --- a/packages/console/app/src/entry-server.tsx +++ b/packages/console/app/src/entry-server.tsx @@ -1,6 +1,8 @@ // @refresh reload import { createHandler, StartServer } from "@solidjs/start/server" +const criticalCSS = `[data-component="top"]{min-height:80px;display:flex;align-items:center}` + export default createHandler( () => ( + {assets} diff --git a/packages/console/app/src/lib/github.ts b/packages/console/app/src/lib/github.ts index cc266f58c4d..ccde5972d37 100644 --- a/packages/console/app/src/lib/github.ts +++ b/packages/console/app/src/lib/github.ts @@ -14,13 +14,14 @@ export const github = query(async () => { fetch(`${apiBaseUrl}/releases`, { headers }).then((res) => res.json()), fetch(`${apiBaseUrl}/contributors?per_page=1`, { headers }), ]) + if (!Array.isArray(releases) || releases.length === 0) { + return undefined + } const [release] = releases - const contributorCount = Number.parseInt( - contributors.headers - .get("Link")! - .match(/&page=(\d+)>; rel="last"/)! - .at(1)!, - ) + const linkHeader = contributors.headers.get("Link") + const contributorCount = linkHeader + ? Number.parseInt(linkHeader.match(/&page=(\d+)>; rel="last"/)?.at(1) ?? "0") + : 0 return { stars: meta.stargazers_count, release: { diff --git a/packages/console/app/src/routes/[...404].tsx b/packages/console/app/src/routes/[...404].tsx index ba2842b5a04..1fd378774b1 100644 --- a/packages/console/app/src/routes/[...404].tsx +++ b/packages/console/app/src/routes/[...404].tsx @@ -26,7 +26,7 @@ export default function NotFound() { Docs
Discord diff --git a/packages/console/app/src/routes/auth/[...callback].ts b/packages/console/app/src/routes/auth/[...callback].ts new file mode 100644 index 00000000000..36a9c5194d0 --- /dev/null +++ b/packages/console/app/src/routes/auth/[...callback].ts @@ -0,0 +1,41 @@ +import { redirect } from "@solidjs/router" +import type { APIEvent } from "@solidjs/start/server" +import { AuthClient } from "~/context/auth" +import { useAuthSession } from "~/context/auth" + +export async function GET(input: APIEvent) { + const url = new URL(input.request.url) + + try { + const code = url.searchParams.get("code") + if (!code) throw new Error("No code found") + const result = await AuthClient.exchange(code, `${url.origin}${url.pathname}`) + if (result.err) throw new Error(result.err.message) + const decoded = AuthClient.decode(result.tokens.access, {} as any) + if (decoded.err) throw new Error(decoded.err.message) + const session = await useAuthSession() + const id = decoded.subject.properties.accountID + await session.update((value) => { + return { + ...value, + account: { + ...value.account, + [id]: { + id, + email: decoded.subject.properties.email, + }, + }, + current: id, + } + }) + return redirect(url.pathname === "/auth/callback" ? "/auth" : url.pathname.replace("/auth/callback", "")) + } catch (e: any) { + return new Response( + JSON.stringify({ + error: e.message, + cause: Object.fromEntries(url.searchParams.entries()), + }), + { status: 500 }, + ) + } +} diff --git a/packages/console/app/src/routes/auth/authorize.ts b/packages/console/app/src/routes/auth/authorize.ts index 166466ef859..0f0651ae36b 100644 --- a/packages/console/app/src/routes/auth/authorize.ts +++ b/packages/console/app/src/routes/auth/authorize.ts @@ -2,6 +2,9 @@ import type { APIEvent } from "@solidjs/start/server" import { AuthClient } from "~/context/auth" export async function GET(input: APIEvent) { - const result = await AuthClient.authorize(new URL("./callback", input.request.url).toString(), "code") + const url = new URL(input.request.url) + const cont = url.searchParams.get("continue") ?? "" + const callbackUrl = new URL(`./callback${cont}`, input.request.url) + const result = await AuthClient.authorize(callbackUrl.toString(), "code") return Response.redirect(result.url, 302) } diff --git a/packages/console/app/src/routes/auth/callback.ts b/packages/console/app/src/routes/auth/callback.ts deleted file mode 100644 index a793b85962a..00000000000 --- a/packages/console/app/src/routes/auth/callback.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { redirect } from "@solidjs/router" -import type { APIEvent } from "@solidjs/start/server" -import { AuthClient } from "~/context/auth" -import { useAuthSession } from "~/context/auth.session" - -export async function GET(input: APIEvent) { - const url = new URL(input.request.url) - const code = url.searchParams.get("code") - if (!code) throw new Error("No code found") - const result = await AuthClient.exchange(code, `${url.origin}${url.pathname}`) - if (result.err) { - throw new Error(result.err.message) - } - const decoded = AuthClient.decode(result.tokens.access, {} as any) - if (decoded.err) throw new Error(decoded.err.message) - const session = await useAuthSession() - const id = decoded.subject.properties.accountID - await session.update((value) => { - return { - ...value, - account: { - ...value.account, - [id]: { - id, - email: decoded.subject.properties.email, - }, - }, - current: id, - } - }) - return redirect("/auth") -} diff --git a/packages/console/app/src/routes/auth/logout.ts b/packages/console/app/src/routes/auth/logout.ts index 7fbe5199a74..9aaac37e224 100644 --- a/packages/console/app/src/routes/auth/logout.ts +++ b/packages/console/app/src/routes/auth/logout.ts @@ -1,6 +1,6 @@ import { redirect } from "@solidjs/router" import { APIEvent } from "@solidjs/start" -import { useAuthSession } from "~/context/auth.session" +import { useAuthSession } from "~/context/auth" export async function GET(event: APIEvent) { const auth = await useAuthSession() diff --git a/packages/console/app/src/routes/auth/status.ts b/packages/console/app/src/routes/auth/status.ts index eaab9dbef27..215cae698f9 100644 --- a/packages/console/app/src/routes/auth/status.ts +++ b/packages/console/app/src/routes/auth/status.ts @@ -1,5 +1,5 @@ import { APIEvent } from "@solidjs/start" -import { useAuthSession } from "~/context/auth.session" +import { useAuthSession } from "~/context/auth" export async function GET(input: APIEvent) { const session = await useAuthSession() diff --git a/packages/console/app/src/routes/bench/[id].tsx b/packages/console/app/src/routes/bench/[id].tsx new file mode 100644 index 00000000000..4586eef9bf9 --- /dev/null +++ b/packages/console/app/src/routes/bench/[id].tsx @@ -0,0 +1,365 @@ +import { Title } from "@solidjs/meta" +import { createAsync, query, useParams } from "@solidjs/router" +import { createSignal, For, Show } from "solid-js" +import { Database, desc, eq } from "@opencode-ai/console-core/drizzle/index.js" +import { BenchmarkTable } from "@opencode-ai/console-core/schema/benchmark.sql.js" + +interface TaskSource { + repo: string + from: string + to: string +} + +interface Judge { + score: number + rationale: string + judge: string +} + +interface ScoreDetail { + criterion: string + weight: number + average: number + variance?: number + judges?: Judge[] +} + +interface RunUsage { + input: number + output: number + cost: number +} + +interface Run { + task: string + model: string + agent: string + score: { + final: number + base: number + penalty: number + } + scoreDetails: ScoreDetail[] + usage?: RunUsage + duration?: number +} + +interface Prompt { + commit: string + prompt: string +} + +interface AverageUsage { + input: number + output: number + cost: number +} + +interface Task { + averageScore: number + averageDuration?: number + averageUsage?: AverageUsage + model?: string + agent?: string + summary?: string + runs?: Run[] + task: { + id: string + source: TaskSource + prompts?: Prompt[] + } +} + +interface BenchmarkResult { + averageScore: number + tasks: Task[] +} + +async function getTaskDetail(benchmarkId: string, taskId: string) { + "use server" + const rows = await Database.use((tx) => + tx.select().from(BenchmarkTable).where(eq(BenchmarkTable.id, benchmarkId)).limit(1), + ) + if (!rows[0]) return null + const parsed = JSON.parse(rows[0].result) as BenchmarkResult + const task = parsed.tasks.find((t) => t.task.id === taskId) + return task ?? null +} + +const queryTaskDetail = query(getTaskDetail, "benchmark.task.detail") + +function formatDuration(ms: number): string { + const seconds = Math.floor(ms / 1000) + const minutes = Math.floor(seconds / 60) + const remainingSeconds = seconds % 60 + if (minutes > 0) { + return `${minutes}m ${remainingSeconds}s` + } + return `${remainingSeconds}s` +} + +export default function BenchDetail() { + const params = useParams() + const [benchmarkId, taskId] = (params.id ?? "").split(":") + const task = createAsync(() => queryTaskDetail(benchmarkId, taskId)) + + return ( +
+ Benchmark - {taskId} +
+ Task not found

}> +
+
+ Agent: + {task()?.agent ?? "N/A"} +
+
+ Model: + {task()?.model ?? "N/A"} +
+
+ Task: + {task()!.task.id} +
+
+ + + + 0}> +
+ Prompt: + + {(p) => ( +
+
Commit: {p.commit.slice(0, 7)}
+

{p.prompt}

+
+ )} +
+
+
+ +
+ +
+
+ Average Duration: + {task()?.averageDuration ? formatDuration(task()!.averageDuration!) : "N/A"} +
+
+ Average Score: + {task()?.averageScore?.toFixed(3) ?? "N/A"} +
+
+ Average Cost: + {task()?.averageUsage?.cost ? `$${task()!.averageUsage!.cost.toFixed(4)}` : "N/A"} +
+
+ + +
+ Summary: +

{task()!.summary}

+
+
+ + 0}> +
+ Runs: + + + + + + + + + {(detail) => ( + + )} + + + + + + {(run, index) => ( + + + + + + + {(detail) => ( + + )} + + + )} + + +
Run + Score (Base - Penalty) + CostDuration + {detail.criterion} ({detail.weight}) +
{index() + 1} + {run.score.final.toFixed(3)} ({run.score.base.toFixed(3)} - {run.score.penalty.toFixed(3)}) + + {run.usage?.cost ? `$${run.usage.cost.toFixed(4)}` : "N/A"} + + {run.duration ? formatDuration(run.duration) : "N/A"} + + + {(judge) => ( + + {judge.score === 1 ? "✓" : judge.score === 0 ? "✗" : judge.score} + + )} + +
+ + {(run, index) => ( +
+

Run {index() + 1}

+
+ Score: + {run.score.final.toFixed(3)} (Base: {run.score.base.toFixed(3)} - Penalty:{" "} + {run.score.penalty.toFixed(3)}) +
+ + {(detail) => ( +
+
+ {detail.criterion} (weight: {detail.weight}){" "} + + {(judge) => ( + + {judge.score === 1 ? "✓" : judge.score === 0 ? "✗" : judge.score} + + )} + +
+ 0}> + + {(judge) => { + const [expanded, setExpanded] = createSignal(false) + return ( +
+
setExpanded(!expanded())} + > + {expanded() ? "▼" : "▶"} + + {judge.score === 1 ? "✓" : judge.score === 0 ? "✗" : judge.score} + {" "} + {judge.judge} +
+ +

+ {judge.rationale} +

+
+
+ ) + }} +
+
+
+ )} +
+
+ )} +
+
+
+ + {(() => { + const [jsonExpanded, setJsonExpanded] = createSignal(false) + return ( +
+ + +
{JSON.stringify(task(), null, 2)}
+
+
+ ) + })()} +
+
+
+ ) +} diff --git a/packages/console/app/src/routes/bench/index.tsx b/packages/console/app/src/routes/bench/index.tsx new file mode 100644 index 00000000000..9b8d0b8f24f --- /dev/null +++ b/packages/console/app/src/routes/bench/index.tsx @@ -0,0 +1,86 @@ +import { Title } from "@solidjs/meta" +import { A, createAsync, query } from "@solidjs/router" +import { createMemo, For, Show } from "solid-js" +import { Database, desc } from "@opencode-ai/console-core/drizzle/index.js" +import { BenchmarkTable } from "@opencode-ai/console-core/schema/benchmark.sql.js" + +interface BenchmarkResult { + averageScore: number + tasks: { averageScore: number; task: { id: string } }[] +} + +async function getBenchmarks() { + "use server" + const rows = await Database.use((tx) => + tx.select().from(BenchmarkTable).orderBy(desc(BenchmarkTable.timeCreated)).limit(100), + ) + return rows.map((row) => { + const parsed = JSON.parse(row.result) as BenchmarkResult + const taskScores: Record = {} + for (const t of parsed.tasks) { + taskScores[t.task.id] = t.averageScore + } + return { + id: row.id, + agent: row.agent, + model: row.model, + averageScore: parsed.averageScore, + taskScores, + } + }) +} + +const queryBenchmarks = query(getBenchmarks, "benchmarks.list") + +export default function Bench() { + const benchmarks = createAsync(() => queryBenchmarks()) + + const taskIds = createMemo(() => { + const ids = new Set() + for (const row of benchmarks() ?? []) { + for (const id of Object.keys(row.taskScores)) { + ids.add(id) + } + } + return [...ids].sort() + }) + + return ( +
+ Benchmark +

Benchmarks

+ + + + + + + {(id) => } + + + + + {(row) => ( + + + + + + {(id) => ( + + )} + + + )} + + +
AgentModelScore{id}
{row.agent}{row.model}{row.averageScore.toFixed(3)} + + + {row.taskScores[id]?.toFixed(3)} + + +
+
+ ) +} diff --git a/packages/console/app/src/routes/bench/submission.ts b/packages/console/app/src/routes/bench/submission.ts new file mode 100644 index 00000000000..94639439b11 --- /dev/null +++ b/packages/console/app/src/routes/bench/submission.ts @@ -0,0 +1,29 @@ +import type { APIEvent } from "@solidjs/start/server" +import { Database } from "@opencode-ai/console-core/drizzle/index.js" +import { BenchmarkTable } from "@opencode-ai/console-core/schema/benchmark.sql.js" +import { Identifier } from "@opencode-ai/console-core/identifier.js" + +interface SubmissionBody { + model: string + agent: string + result: string +} + +export async function POST(event: APIEvent) { + const body = (await event.request.json()) as SubmissionBody + + if (!body.model || !body.agent || !body.result) { + return Response.json({ error: "All fields are required" }, { status: 400 }) + } + + await Database.use((tx) => + tx.insert(BenchmarkTable).values({ + id: Identifier.create("benchmark"), + model: body.model, + agent: body.agent, + result: body.result, + }), + ) + + return Response.json({ success: true }, { status: 200 }) +} diff --git a/packages/console/app/src/routes/black.css b/packages/console/app/src/routes/black.css new file mode 100644 index 00000000000..66bffea5995 --- /dev/null +++ b/packages/console/app/src/routes/black.css @@ -0,0 +1,828 @@ +::view-transition-group(*) { + animation-duration: 250ms; + animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); +} + +::view-transition-old(root), +::view-transition-new(root) { + animation-duration: 250ms; + animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); +} + +::view-transition-image-pair(root) { + isolation: isolate; +} + +::view-transition-old(root) { + animation: none; + mix-blend-mode: normal; +} + +::view-transition-new(root) { + animation: none; + mix-blend-mode: normal; +} + +@keyframes fade-in { + from { + opacity: 0; + } + to { + opacity: 1; + } +} + +@keyframes fade-out { + from { + opacity: 1; + } + to { + opacity: 0; + } +} + +@keyframes fade-in-up { + from { + opacity: 0; + transform: translateY(8px); + } + to { + opacity: 1; + transform: translateY(0); + } +} + +@keyframes reveal-terms { + from { + mask-position: 0% 200%; + } + to { + mask-position: 0% 50%; + } +} + +@keyframes hide-terms { + from { + mask-position: 0% 50%; + } + to { + mask-position: 0% 200%; + } +} + +::view-transition-old(terms-20), +::view-transition-old(terms-100), +::view-transition-old(terms-200) { + mask-image: linear-gradient(to bottom, transparent, black 25% 75%, transparent); + mask-repeat: no-repeat; + mask-size: 100% 200%; + animation: hide-terms 200ms cubic-bezier(0.25, 0, 0.5, 1) forwards; +} + +::view-transition-new(terms-20), +::view-transition-new(terms-100), +::view-transition-new(terms-200) { + mask-image: linear-gradient(to bottom, transparent, black 25% 75%, transparent); + mask-repeat: no-repeat; + mask-position: 0% 200%; + mask-size: 100% 200%; + animation: reveal-terms 300ms cubic-bezier(0.25, 0, 0.5, 1) 50ms forwards; +} + +::view-transition-old(actions-20), +::view-transition-old(actions-100), +::view-transition-old(actions-200) { + animation: fade-out 80ms cubic-bezier(0.4, 0, 0.2, 1) forwards; +} + +::view-transition-new(actions-20), +::view-transition-new(actions-100), +::view-transition-new(actions-200) { + animation: fade-in-up 300ms cubic-bezier(0.16, 1, 0.3, 1) 300ms forwards; + opacity: 0; +} + +::view-transition-group(card-20), +::view-transition-group(card-100), +::view-transition-group(card-200) { + animation-duration: 250ms; + animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); +} + +[data-page="black"] { + background: #000; + min-height: 100vh; + display: flex; + flex-direction: column; + align-items: center; + justify-content: stretch; + font-family: var(--font-mono); + color: #fff; + + [data-component="header-logo"] { + filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.25)) drop-shadow(0 4px 16px rgba(0, 0, 0, 0.1)); + position: relative; + z-index: 1; + } + + .header-light-rays { + position: absolute; + inset: 0 0 auto 0; + height: 30dvh; + pointer-events: none; + z-index: 0; + } + + [data-component="header"] { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + padding-top: 40px; + flex-shrink: 0; + } + + [data-component="content"] { + display: flex; + flex-direction: column; + align-items: center; + width: 100%; + flex-grow: 1; + + [data-slot="hero"] { + display: flex; + flex-direction: column; + align-items: center; + text-align: center; + gap: 8px; + margin-top: 40px; + padding: 0 20px; + + @media (min-width: 768px) { + margin-top: 60px; + } + + h1 { + color: rgba(255, 255, 255, 0.92); + font-size: 16px; + font-style: normal; + font-weight: 400; + line-height: 1.45; + margin: 0; + + @media (min-width: 768px) { + font-size: 20px; + } + + @media (max-width: 480px) { + font-size: 14px; + } + } + + p { + color: rgba(255, 255, 255, 0.59); + font-size: 16px; + font-style: normal; + font-weight: 400; + line-height: 1.45; + margin: 0; + + @media (min-width: 768px) { + font-size: 20px; + } + + @media (max-width: 480px) { + font-size: 14px; + } + } + } + + [data-slot="hero-black"] { + margin-top: 40px; + padding: 0 20px; + position: relative; + + @media (min-width: 768px) { + margin-top: 60px; + } + + svg { + width: 100%; + max-width: 590px; + height: auto; + overflow: visible; + filter: drop-shadow(0 0 20px rgba(255, 255, 255, calc(0.1 + var(--hero-black-glow-intensity, 0) * 0.15))) + drop-shadow(0 -5px 30px rgba(255, 255, 255, calc(var(--hero-black-glow-intensity, 0) * 0.2))); + mask-image: linear-gradient(to bottom, black, transparent); + stroke-width: 1.5; + + [data-slot="black-base"] { + fill: url(#hero-black-fill-gradient); + stroke: url(#hero-black-stroke-gradient); + } + + [data-slot="black-glow"] { + fill: url(#hero-black-top-glow); + pointer-events: none; + } + + [data-slot="black-shimmer"] { + fill: url(#hero-black-shimmer-gradient); + pointer-events: none; + mix-blend-mode: overlay; + } + } + } + + [data-slot="cta"] { + display: flex; + flex-direction: column; + gap: 16px; + align-items: center; + text-align: center; + margin-top: -40px; + width: 100%; + + @media (min-width: 768px) { + margin-top: -20px; + } + + [data-slot="heading"] { + color: rgba(255, 255, 255, 0.92); + text-align: center; + font-size: 18px; + font-style: normal; + font-weight: 400; + line-height: 160%; + + span { + display: inline-block; + } + } + [data-slot="subheading"] { + color: rgba(255, 255, 255, 0.59); + font-size: 15px; + font-style: normal; + font-weight: 400; + line-height: 160%; + + @media (min-width: 768px) { + font-size: 18px; + line-height: 160%; + } + } + [data-slot="button"] { + display: inline-flex; + height: 40px; + padding: 0 12px; + justify-content: center; + align-items: center; + gap: 8px; + border-radius: 4px; + background: rgba(255, 255, 255, 0.92); + text-decoration: none; + color: #000; + font-family: "JetBrains Mono Nerd Font"; + font-size: 16px; + font-style: normal; + font-weight: 500; + line-height: normal; + + &:hover { + background: #e0e0e0; + } + + &:active { + transform: scale(0.98); + } + } + [data-slot="back-soon"] { + color: rgba(255, 255, 255, 0.59); + text-align: center; + font-size: 13px; + font-style: normal; + font-weight: 400; + line-height: 160%; /* 20.8px */ + } + [data-slot="follow-us"] { + display: inline-flex; + height: 40px; + padding: 0 12px; + justify-content: center; + align-items: center; + gap: 8px; + border-radius: 4px; + border: 1px solid rgba(255, 255, 255, 0.17); + color: rgba(255, 255, 255, 0.59); + font-family: var(--font-mono); + font-size: 14px; + font-style: normal; + font-weight: 400; + line-height: normal; + text-decoration: none; + } + + [data-slot="pricing"] { + display: flex; + flex-direction: column; + gap: 16px; + width: 100%; + max-width: 660px; + padding: 0 20px; + + @media (min-width: 768px) { + padding: 0; + } + } + + [data-slot="pricing-card"] { + display: flex; + flex-direction: column; + gap: 12px; + padding: 24px; + border: 1px solid rgba(255, 255, 255, 0.17); + background: black; + background-clip: padding-box; + border-radius: 4px; + text-decoration: none; + transition: border-color 0.15s ease; + cursor: pointer; + text-align: left; + + @media (max-width: 480px) { + padding: 16px; + } + + &:hover:not(:active) { + border-color: rgba(255, 255, 255, 0.35); + } + + [data-slot="icon"] { + color: rgba(255, 255, 255, 0.59); + } + + [data-slot="price"] { + display: flex; + flex-wrap: wrap; + align-items: baseline; + gap: 8px; + } + + [data-slot="amount"] { + color: rgba(255, 255, 255, 0.92); + font-size: 24px; + font-weight: 500; + } + + [data-slot="period"] { + color: rgba(255, 255, 255, 0.59); + font-size: 14px; + } + + [data-slot="multiplier"] { + color: rgba(255, 255, 255, 0.39); + font-size: 14px; + + &::before { + content: "·"; + margin-right: 8px; + } + } + } + + [data-slot="selected-plan"] { + display: flex; + flex-direction: column; + gap: 32px; + width: 100%; + max-width: 660px; + margin: 0 auto; + position: relative; + background-color: rgba(0, 0, 0, 0.75); + z-index: 1; + + @media (max-width: 480px) { + margin: 0 20px; + width: calc(100% - 40px); + } + } + + [data-slot="selected-card"] { + display: flex; + flex-direction: column; + gap: 12px; + padding: 24px; + border: 1px solid rgba(255, 255, 255, 0.17); + border-radius: 4px; + width: 100%; + + [data-slot="icon"] { + color: rgba(255, 255, 255, 0.59); + } + + [data-slot="price"] { + display: flex; + flex-wrap: wrap; + align-items: baseline; + gap: 8px; + } + + [data-slot="amount"] { + color: rgba(255, 255, 255, 0.92); + font-size: 24px; + font-weight: 500; + } + + [data-slot="period"] { + color: rgba(255, 255, 255, 0.59); + font-size: 14px; + } + + [data-slot="multiplier"] { + color: rgba(255, 255, 255, 0.39); + font-size: 14px; + + &::before { + content: "·"; + margin-right: 8px; + } + } + + [data-slot="terms"] { + list-style: none; + padding: 0; + margin: 0; + display: flex; + flex-direction: column; + gap: 8px; + text-align: left; + + li { + color: rgba(255, 255, 255, 0.59); + font-size: 14px; + line-height: 1.5; + padding-left: 16px; + position: relative; + + &::before { + content: "▪"; + position: absolute; + left: 0; + color: rgba(255, 255, 255, 0.39); + } + + @media (max-width: 768px) { + font-size: 12px; + } + } + } + + [data-slot="actions"] { + display: flex; + gap: 16px; + margin-top: 8px; + + button, + a { + flex: 1; + display: inline-flex; + height: 48px; + padding: 0 16px; + justify-content: center; + align-items: center; + border-radius: 4px; + font-family: var(--font-mono); + font-size: 16px; + font-weight: 400; + text-decoration: none; + cursor: pointer; + } + + [data-slot="cancel"] { + background: rgba(255, 255, 255, 0.05); + border: 1px solid rgba(255, 255, 255, 0.17); + color: rgba(255, 255, 255, 0.92); + transition-property: background-color, border-color; + transition-duration: 150ms; + transition-timing-function: cubic-bezier(0.25, 0, 0.5, 1); + + &:hover { + background-color: rgba(255, 255, 255, 0.08); + border-color: rgba(255, 255, 255, 0.25); + } + } + + [data-slot="continue"] { + background: rgb(255, 255, 255); + color: rgb(0, 0, 0); + transition: background-color 150ms cubic-bezier(0.25, 0, 0.5, 1); + + &:hover { + background: rgba(255, 255, 255, 0.9); + } + } + } + } + + [data-slot="fine-print"] { + color: rgba(255, 255, 255, 0.39); + text-align: center; + font-size: 13px; + font-style: normal; + font-weight: 400; + line-height: 160%; /* 20.8px */ + font-style: italic; + + a { + color: rgba(255, 255, 255, 0.39); + text-decoration: underline; + } + } + } + + /* Subscribe page styles */ + [data-slot="subscribe-form"] { + display: flex; + flex-direction: column; + gap: 32px; + align-items: center; + margin-top: -18px; + width: 100%; + max-width: 660px; + padding: 0 20px; + + @media (min-width: 768px) { + margin-top: 40px; + padding: 0; + } + + [data-slot="form-card"] { + width: 100%; + border: 1px solid rgba(255, 255, 255, 0.17); + border-radius: 4px; + padding: 24px; + display: flex; + flex-direction: column; + gap: 20px; + } + + [data-slot="plan-header"] { + display: flex; + flex-direction: column; + gap: 8px; + } + + [data-slot="title"] { + color: rgba(255, 255, 255, 0.92); + font-size: 16px; + font-weight: 400; + margin-bottom: 8px; + } + + [data-slot="icon"] { + color: rgba(255, 255, 255, 0.59); + isolation: isolate; + transform: translateZ(0); + } + + [data-slot="price"] { + display: flex; + flex-wrap: wrap; + align-items: baseline; + gap: 8px; + } + + [data-slot="amount"] { + color: rgba(255, 255, 255, 0.92); + font-size: 24px; + font-weight: 500; + } + + [data-slot="period"] { + color: rgba(255, 255, 255, 0.59); + font-size: 14px; + } + + [data-slot="multiplier"] { + color: rgba(255, 255, 255, 0.39); + font-size: 14px; + + &::before { + content: "·"; + margin: 0 8px; + } + } + + [data-slot="divider"] { + height: 1px; + background: rgba(255, 255, 255, 0.17); + } + + [data-slot="section-title"] { + color: rgba(255, 255, 255, 0.92); + font-size: 16px; + font-weight: 400; + } + + [data-slot="checkout-form"] { + display: flex; + flex-direction: column; + gap: 20px; + } + + [data-slot="error"] { + color: #ff6b6b; + font-size: 14px; + } + + [data-slot="submit-button"] { + width: 100%; + height: 48px; + background: rgba(255, 255, 255, 0.92); + border: none; + border-radius: 4px; + color: #000; + font-family: var(--font-mono); + font-size: 16px; + font-weight: 500; + cursor: pointer; + transition: background 0.15s ease; + + &:hover:not(:disabled) { + background: #e0e0e0; + } + + &:disabled { + opacity: 0.5; + cursor: not-allowed; + } + } + + [data-slot="charge-notice"] { + color: #d4a500; + font-size: 14px; + text-align: center; + } + + [data-slot="loading"] { + display: flex; + justify-content: center; + padding: 40px 0; + + p { + color: rgba(255, 255, 255, 0.59); + font-size: 14px; + } + } + + [data-slot="fine-print"] { + color: rgba(255, 255, 255, 0.39); + text-align: center; + font-size: 13px; + font-style: italic; + view-transition-name: fine-print; + + a { + color: rgba(255, 255, 255, 0.39); + text-decoration: underline; + } + } + + [data-slot="workspace-picker"] { + [data-slot="workspace-list"] { + width: 100%; + padding: 0; + margin: 0; + list-style: none; + display: flex; + flex-direction: column; + align-items: flex-start; + gap: 8px; + align-self: stretch; + outline: none; + overflow-y: auto; + max-height: 240px; + scrollbar-width: none; + + &::-webkit-scrollbar { + display: none; + } + + [data-slot="workspace-item"] { + width: 100%; + display: flex; + padding: 8px 12px; + align-items: center; + gap: 8px; + align-self: stretch; + cursor: pointer; + + [data-slot="selected-icon"] { + visibility: hidden; + color: rgba(255, 255, 255, 0.39); + font-family: "IBM Plex Mono", monospace; + font-size: 16px; + font-style: normal; + font-weight: 400; + line-height: 160%; + } + + span:last-child { + color: rgba(255, 255, 255, 0.92); + font-size: 16px; + font-style: normal; + font-weight: 400; + line-height: 160%; + } + + &:hover, + &[data-active="true"] { + background: #161616; + + [data-slot="selected-icon"] { + visibility: visible; + } + } + } + } + } + } + } + + [data-component="footer"] { + display: flex; + flex-direction: column; + width: 100%; + justify-content: center; + align-items: center; + gap: 24px; + flex-shrink: 0; + + @media (min-width: 768px) { + height: 120px; + } + + [data-slot="footer-content"] { + display: flex; + gap: 24px; + align-items: center; + justify-content: center; + + @media (min-width: 768px) { + gap: 40px; + } + + span, + a { + color: rgba(255, 255, 255, 0.39); + font-family: "JetBrains Mono Nerd Font"; + font-size: 16px; + font-style: normal; + font-weight: 400; + line-height: normal; + text-decoration: none; + } + + [data-slot="github-stars"] { + color: rgba(255, 255, 255, 0.25); + font-family: "JetBrains Mono Nerd Font"; + font-size: 16px; + font-style: normal; + font-weight: 400; + line-height: normal; + } + + [data-slot="anomaly"] { + display: none; + + @media (min-width: 768px) { + display: block; + } + } + } + [data-slot="anomaly-alt"] { + color: rgba(255, 255, 255, 0.39); + font-family: "JetBrains Mono Nerd Font"; + font-size: 16px; + font-style: normal; + font-weight: 400; + line-height: normal; + text-decoration: none; + margin-bottom: 24px; + + a { + color: rgba(255, 255, 255, 0.39); + font-family: "JetBrains Mono Nerd Font"; + font-size: 16px; + font-style: normal; + font-weight: 400; + line-height: normal; + text-decoration: none; + } + + @media (min-width: 768px) { + display: none; + } + } + } +} diff --git a/packages/console/app/src/routes/black.tsx b/packages/console/app/src/routes/black.tsx new file mode 100644 index 00000000000..b991a60a77c --- /dev/null +++ b/packages/console/app/src/routes/black.tsx @@ -0,0 +1,285 @@ +import { A, createAsync, RouteSectionProps } from "@solidjs/router" +import { Title, Meta, Link } from "@solidjs/meta" +import { createMemo, createSignal } from "solid-js" +import { github } from "~/lib/github" +import { config } from "~/config" +import Spotlight, { defaultConfig, type SpotlightAnimationState } from "~/component/spotlight" +import "./black.css" + +export default function BlackLayout(props: RouteSectionProps) { + const githubData = createAsync(() => github()) + const starCount = createMemo(() => + githubData()?.stars + ? new Intl.NumberFormat("en-US", { + notation: "compact", + compactDisplay: "short", + }).format(githubData()!.stars!) + : config.github.starsFormatted.compact, + ) + + const [spotlightAnimationState, setSpotlightAnimationState] = createSignal({ + time: 0, + intensity: 0.5, + pulseValue: 1, + }) + + const svgLightingValues = createMemo(() => { + const state = spotlightAnimationState() + const t = state.time + + const wave1 = Math.sin(t * 1.5) * 0.5 + 0.5 + const wave2 = Math.sin(t * 2.3 + 1.2) * 0.5 + 0.5 + const wave3 = Math.sin(t * 0.8 + 2.5) * 0.5 + 0.5 + + const shimmerPos = Math.sin(t * 0.7) * 0.5 + 0.5 + const glowIntensity = Math.max(state.intensity * state.pulseValue * 0.35, 0.15) + const fillOpacity = Math.max(0.1 + wave1 * 0.08 * state.pulseValue, 0.12) + const strokeBrightness = Math.max(55 + wave2 * 25 * state.pulseValue, 60) + + const shimmerIntensity = Math.max(wave3 * 0.15 * state.pulseValue, 0.08) + + return { + glowIntensity, + fillOpacity, + strokeBrightness, + shimmerPos, + shimmerIntensity, + } + }) + + const svgLightingStyle = createMemo(() => { + const values = svgLightingValues() + return { + "--hero-black-glow-intensity": values.glowIntensity.toFixed(3), + "--hero-black-stroke-brightness": `${values.strokeBrightness.toFixed(0)}%`, + } as Record + }) + + const handleAnimationFrame = (state: SpotlightAnimationState) => { + setSpotlightAnimationState(state) + } + + const spotlightConfig = () => defaultConfig + + return ( +
+ OpenCode Black | Access all the world's best coding models + + + + + + + + + + + + + + +
+ + + opencode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+

Access all the world's best coding models

+

Including Claude, GPT, Gemini and more

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ {props.children} +
+ +
+ ) +} diff --git a/packages/console/app/src/routes/black/common.tsx b/packages/console/app/src/routes/black/common.tsx new file mode 100644 index 00000000000..39844abee38 --- /dev/null +++ b/packages/console/app/src/routes/black/common.tsx @@ -0,0 +1,62 @@ +import { Match, Switch } from "solid-js" + +export const plans = [ + { id: "20", multiplier: null }, + { id: "100", multiplier: "5x more usage than Black 20" }, + { id: "200", multiplier: "20x more usage than Black 20" }, +] as const + +export type PlanID = (typeof plans)[number]["id"] +export type Plan = (typeof plans)[number] + +export function PlanIcon(props: { plan: string }) { + return ( + + + + Black 20 plan + + + + + + Black 100 plan + + + + + + + + + Black 200 plan + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ) +} diff --git a/packages/console/app/src/routes/black/index.tsx b/packages/console/app/src/routes/black/index.tsx new file mode 100644 index 00000000000..5ea5c3e9268 --- /dev/null +++ b/packages/console/app/src/routes/black/index.tsx @@ -0,0 +1,108 @@ +import { A, useSearchParams } from "@solidjs/router" +import { Title } from "@solidjs/meta" +import { createMemo, createSignal, For, Match, onMount, Show, Switch } from "solid-js" +import { PlanIcon, plans } from "./common" + +export default function Black() { + const [params] = useSearchParams() + const [selected, setSelected] = createSignal((params.plan as string) || null) + const [mounted, setMounted] = createSignal(false) + const selectedPlan = createMemo(() => plans.find((p) => p.id === selected())) + + onMount(() => { + requestAnimationFrame(() => setMounted(true)) + }) + + const transition = (action: () => void) => { + if (mounted() && "startViewTransition" in document) { + ;(document as any).startViewTransition(action) + return + } + + action() + } + + const select = (planId: string) => { + if (selected() === planId) { + return + } + + transition(() => setSelected(planId)) + } + + const cancel = () => { + transition(() => setSelected(null)) + } + + return ( + <> + opencode +
+ + +
+ + {(plan) => ( + + )} + +
+
+ + {(plan) => ( +
+
+
+ +
+

+ ${plan().id}{" "} + per person billed monthly + + {plan().multiplier} + +

+
    +
  • Your subscription will not start immediately
  • +
  • You will be added to the waitlist and activated soon
  • +
  • Your card will be only charged when your subscription is activated
  • +
  • Usage limits apply, heavily automated use may reach limits sooner
  • +
  • Subscriptions for individuals, contact Enterprise for teams
  • +
  • Limits may be adjusted and plans may be discontinued in the future
  • +
  • Cancel your subscription at anytime
  • +
+
+ + + Continue + +
+
+
+ )} +
+
+

+ Prices shown don't include applicable tax · Terms of Service +

+
+ + ) +} diff --git a/packages/console/app/src/routes/black/subscribe/[plan].tsx b/packages/console/app/src/routes/black/subscribe/[plan].tsx new file mode 100644 index 00000000000..a7cf92a25ec --- /dev/null +++ b/packages/console/app/src/routes/black/subscribe/[plan].tsx @@ -0,0 +1,449 @@ +import { A, createAsync, query, redirect, useParams } from "@solidjs/router" +import { Title } from "@solidjs/meta" +import { createEffect, createSignal, For, Match, Show, Switch } from "solid-js" +import { type Stripe, type PaymentMethod, loadStripe } from "@stripe/stripe-js" +import { Elements, PaymentElement, useStripe, useElements, AddressElement } from "solid-stripe" +import { PlanID, plans } from "../common" +import { getActor, useAuthSession } from "~/context/auth" +import { withActor } from "~/context/auth.withActor" +import { Actor } from "@opencode-ai/console-core/actor.js" +import { and, Database, eq, isNull } from "@opencode-ai/console-core/drizzle/index.js" +import { WorkspaceTable } from "@opencode-ai/console-core/schema/workspace.sql.js" +import { UserTable } from "@opencode-ai/console-core/schema/user.sql.js" +import { createList } from "solid-list" +import { Modal } from "~/component/modal" +import { BillingTable } from "@opencode-ai/console-core/schema/billing.sql.js" +import { Billing } from "@opencode-ai/console-core/billing.js" + +const plansMap = Object.fromEntries(plans.map((p) => [p.id, p])) as Record +const stripePromise = loadStripe(import.meta.env.VITE_STRIPE_PUBLISHABLE_KEY!) + +const getWorkspaces = query(async (plan: string) => { + "use server" + const actor = await getActor() + if (actor.type === "public") throw redirect("/auth/authorize?continue=/black/subscribe/" + plan) + return withActor(async () => { + return Database.use((tx) => + tx + .select({ + id: WorkspaceTable.id, + name: WorkspaceTable.name, + slug: WorkspaceTable.slug, + billing: { + customerID: BillingTable.customerID, + paymentMethodID: BillingTable.paymentMethodID, + paymentMethodType: BillingTable.paymentMethodType, + paymentMethodLast4: BillingTable.paymentMethodLast4, + subscriptionID: BillingTable.subscriptionID, + timeSubscriptionBooked: BillingTable.timeSubscriptionBooked, + }, + }) + .from(UserTable) + .innerJoin(WorkspaceTable, eq(UserTable.workspaceID, WorkspaceTable.id)) + .innerJoin(BillingTable, eq(WorkspaceTable.id, BillingTable.workspaceID)) + .where( + and( + eq(UserTable.accountID, Actor.account()), + isNull(WorkspaceTable.timeDeleted), + isNull(UserTable.timeDeleted), + ), + ), + ) + }) +}, "black.subscribe.workspaces") + +const createSetupIntent = async (input: { plan: string; workspaceID: string }) => { + "use server" + const { plan, workspaceID } = input + + if (!plan || !["20", "100", "200"].includes(plan)) return { error: "Invalid plan" } + if (!workspaceID) return { error: "Workspace ID is required" } + + return withActor(async () => { + const session = await useAuthSession() + const account = session.data.account?.[session.data.current ?? ""] + const email = account?.email + + const customer = await Database.use((tx) => + tx + .select({ + customerID: BillingTable.customerID, + subscriptionID: BillingTable.subscriptionID, + }) + .from(BillingTable) + .where(eq(BillingTable.workspaceID, workspaceID)) + .then((rows) => rows[0]), + ) + if (customer?.subscriptionID) { + return { error: "This workspace already has a subscription" } + } + + let customerID = customer?.customerID + if (!customerID) { + const customer = await Billing.stripe().customers.create({ + email, + metadata: { + workspaceID, + }, + }) + customerID = customer.id + await Database.use((tx) => + tx + .update(BillingTable) + .set({ + customerID, + }) + .where(eq(BillingTable.workspaceID, workspaceID)), + ) + } + + const intent = await Billing.stripe().setupIntents.create({ + customer: customerID, + payment_method_types: ["card"], + metadata: { + workspaceID, + }, + }) + + return { clientSecret: intent.client_secret ?? undefined } + }, workspaceID) +} + +const bookSubscription = async (input: { + workspaceID: string + plan: PlanID + paymentMethodID: string + paymentMethodType: string + paymentMethodLast4?: string +}) => { + "use server" + return withActor( + () => + Database.use((tx) => + tx + .update(BillingTable) + .set({ + paymentMethodID: input.paymentMethodID, + paymentMethodType: input.paymentMethodType, + paymentMethodLast4: input.paymentMethodLast4, + subscriptionPlan: input.plan, + timeSubscriptionBooked: new Date(), + }) + .where(eq(BillingTable.workspaceID, input.workspaceID)), + ), + input.workspaceID, + ) +} + +interface SuccessData { + plan: string + paymentMethodType: string + paymentMethodLast4?: string +} + +function Failure(props: { message: string }) { + return ( +
+

Uh oh! {props.message}

+
+ ) +} + +function Success(props: SuccessData) { + return ( +
+

You're on the OpenCode Black waitlist

+
+
+
Subscription plan
+
OpenCode Black {props.plan}
+
+
+
Amount
+
${props.plan} per month
+
+
+
Payment method
+
+ {props.paymentMethodType}}> + + {props.paymentMethodType} - {props.paymentMethodLast4} + + +
+
+
+
Date joined
+
{new Date().toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" })}
+
+
+

Your card will be charged when your subscription is activated

+
+ ) +} + +function IntentForm(props: { plan: PlanID; workspaceID: string; onSuccess: (data: SuccessData) => void }) { + const stripe = useStripe() + const elements = useElements() + const [error, setError] = createSignal(undefined) + const [loading, setLoading] = createSignal(false) + + const handleSubmit = async (e: Event) => { + e.preventDefault() + if (!stripe() || !elements()) return + + setLoading(true) + setError(undefined) + + const result = await elements()!.submit() + if (result.error) { + setError(result.error.message ?? "An error occurred") + setLoading(false) + return + } + + const { error: confirmError, setupIntent } = await stripe()!.confirmSetup({ + elements: elements()!, + confirmParams: { + expand: ["payment_method"], + payment_method_data: { + allow_redisplay: "always", + }, + }, + redirect: "if_required", + }) + + if (confirmError) { + setError(confirmError.message ?? "An error occurred") + setLoading(false) + return + } + + if (setupIntent?.status === "succeeded") { + const pm = setupIntent.payment_method as PaymentMethod + + await bookSubscription({ + workspaceID: props.workspaceID, + plan: props.plan, + paymentMethodID: pm.id, + paymentMethodType: pm.type, + paymentMethodLast4: pm.card?.last4, + }) + + props.onSuccess({ + plan: props.plan, + paymentMethodType: pm.type, + paymentMethodLast4: pm.card?.last4, + }) + } + + setLoading(false) + } + + return ( +
+ + + +

{error()}

+
+ +

You will only be charged when your subscription is activated

+ + ) +} + +export default function BlackSubscribe() { + const params = useParams() + const planData = plansMap[(params.plan as PlanID) ?? "20"] ?? plansMap["20"] + const plan = planData.id + + const workspaces = createAsync(() => getWorkspaces(plan)) + const [selectedWorkspace, setSelectedWorkspace] = createSignal(undefined) + const [success, setSuccess] = createSignal(undefined) + const [failure, setFailure] = createSignal(undefined) + const [clientSecret, setClientSecret] = createSignal(undefined) + const [stripe, setStripe] = createSignal(undefined) + + // Resolve stripe promise once + createEffect(() => { + stripePromise.then((s) => { + if (s) setStripe(s) + }) + }) + + // Auto-select if only one workspace + createEffect(() => { + const ws = workspaces() + if (ws?.length === 1 && !selectedWorkspace()) { + setSelectedWorkspace(ws[0].id) + } + }) + + // Fetch setup intent when workspace is selected (unless workspace already has payment method) + createEffect(async () => { + const id = selectedWorkspace() + if (!id) return + + const ws = workspaces()?.find((w) => w.id === id) + if (ws?.billing?.subscriptionID) { + setFailure("This workspace already has a subscription") + return + } + if (ws?.billing?.paymentMethodID) { + if (!ws?.billing?.timeSubscriptionBooked) { + await bookSubscription({ + workspaceID: id, + plan: planData.id, + paymentMethodID: ws.billing.paymentMethodID!, + paymentMethodType: ws.billing.paymentMethodType!, + paymentMethodLast4: ws.billing.paymentMethodLast4 ?? undefined, + }) + } + setSuccess({ + plan: planData.id, + paymentMethodType: ws.billing.paymentMethodType!, + paymentMethodLast4: ws.billing.paymentMethodLast4 ?? undefined, + }) + return + } + + const result = await createSetupIntent({ plan, workspaceID: id }) + if (result.error) { + setFailure(result.error) + } else if ("clientSecret" in result) { + setClientSecret(result.clientSecret) + } + }) + + // Keyboard navigation for workspace picker + const { active, setActive, onKeyDown } = createList({ + items: () => workspaces()?.map((w) => w.id) ?? [], + initialActive: null, + }) + + const handleSelectWorkspace = (id: string) => { + setSelectedWorkspace(id) + } + + let listRef: HTMLUListElement | undefined + + // Show workspace picker if multiple workspaces and none selected + const showWorkspacePicker = () => { + const ws = workspaces() + return ws && ws.length > 1 && !selectedWorkspace() + } + + return ( + <> + Subscribe to OpenCode Black +
+
+ + {(data) => } + {(data) => } + + <> +
+

Subscribe to OpenCode Black

+

+ ${planData.id} per month + + {planData.multiplier} + +

+
+
+

Payment method

+ + +

{selectedWorkspace() ? "Loading payment form..." : "Select a workspace to continue"}

+
+ } + > + + + + + +
+
+
+ + {/* Workspace picker modal */} + {}} title="Select a workspace for this plan"> +
+
    { + if (e.key === "Enter" && active()) { + handleSelectWorkspace(active()!) + } else { + onKeyDown(e) + } + }} + > + + {(workspace) => ( +
  • setActive(workspace.id)} + onClick={() => handleSelectWorkspace(workspace.id)} + > + [*] + {workspace.name || workspace.slug} +
  • + )} +
    +
+
+
+

+ Prices shown don't include applicable tax · Terms of Service +

+
+ + ) +} diff --git a/packages/console/app/src/routes/black/workspace.css b/packages/console/app/src/routes/black/workspace.css new file mode 100644 index 00000000000..bf9d948786f --- /dev/null +++ b/packages/console/app/src/routes/black/workspace.css @@ -0,0 +1,214 @@ +[data-page="black"] { + background: #000; + min-height: 100vh; + display: flex; + flex-direction: column; + align-items: center; + justify-content: stretch; + font-family: var(--font-mono); + color: #fff; + + [data-component="header-gradient"] { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 288px; + background: linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(0, 0, 0, 0) 100%); + } + + [data-component="header"] { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + padding-top: 40px; + flex-shrink: 0; + + /* [data-component="header-logo"] { */ + /* } */ + } + + [data-component="content"] { + display: flex; + flex-direction: column; + align-items: center; + width: 100%; + flex-grow: 1; + + [data-slot="hero-black"] { + margin-top: 110px; + + @media (min-width: 768px) { + margin-top: 150px; + } + } + + [data-slot="select-workspace"] { + display: flex; + margin-top: -24px; + width: 100%; + max-width: 480px; + height: 305px; + padding: 32px 20px 0 20px; + flex-direction: column; + align-items: flex-start; + gap: 24px; + + border: 1px solid #303030; + background: #0a0a0a; + box-shadow: + 0 100px 80px 0 rgba(0, 0, 0, 0.04), + 0 41.778px 33.422px 0 rgba(0, 0, 0, 0.05), + 0 22.336px 17.869px 0 rgba(0, 0, 0, 0.06), + 0 12.522px 10.017px 0 rgba(0, 0, 0, 0.08), + 0 6.65px 5.32px 0 rgba(0, 0, 0, 0.09), + 0 2.767px 2.214px 0 rgba(0, 0, 0, 0.13); + + [data-slot="select-workspace-title"] { + flex-shrink: 0; + align-self: stretch; + color: rgba(255, 255, 255, 0.59); + text-align: center; + font-size: 16px; + font-style: normal; + font-weight: 400; + line-height: 160%; /* 25.6px */ + } + + [data-slot="workspaces"] { + width: 100%; + padding: 0; + display: flex; + flex-direction: column; + align-items: flex-start; + gap: 8px; + align-self: stretch; + outline: none; + overflow-y: auto; + flex: 1; + min-height: 0; + + scrollbar-width: none; + &::-webkit-scrollbar { + display: none; + } + + [data-slot="workspace"] { + width: 100%; + display: flex; + padding: 8px 12px; + align-items: center; + gap: 8px; + align-self: stretch; + cursor: pointer; + + [data-slot="selected-icon"] { + visibility: hidden; + color: rgba(255, 255, 255, 0.39); + font-family: "IBM Plex Mono"; + font-size: 16px; + font-style: normal; + font-weight: 400; + line-height: 160%; /* 25.6px */ + } + + a { + color: rgba(255, 255, 255, 0.92); + font-size: 16px; + font-style: normal; + font-weight: 400; + line-height: 160%; /* 25.6px */ + text-decoration: none; + } + } + + [data-slot="workspace"]:hover, + [data-slot="workspace"][data-active="true"] { + background: #161616; + + [data-slot="selected-icon"] { + visibility: visible; + } + } + } + } + } + + [data-component="footer"] { + display: flex; + flex-direction: column; + width: 100%; + justify-content: center; + align-items: center; + gap: 24px; + flex-shrink: 0; + + @media (min-width: 768px) { + height: 120px; + } + + [data-slot="footer-content"] { + display: flex; + gap: 24px; + align-items: center; + justify-content: center; + + @media (min-width: 768px) { + gap: 40px; + } + + span, + a { + color: rgba(255, 255, 255, 0.39); + font-family: "JetBrains Mono Nerd Font"; + font-size: 16px; + font-style: normal; + font-weight: 400; + line-height: normal; + text-decoration: none; + } + + [data-slot="github-stars"] { + color: rgba(255, 255, 255, 0.25); + font-family: "JetBrains Mono Nerd Font"; + font-size: 16px; + font-style: normal; + font-weight: 400; + line-height: normal; + } + + [data-slot="anomaly"] { + display: none; + + @media (min-width: 768px) { + display: block; + } + } + } + [data-slot="anomaly-alt"] { + color: rgba(255, 255, 255, 0.39); + font-family: "JetBrains Mono Nerd Font"; + font-size: 16px; + font-style: normal; + font-weight: 400; + line-height: normal; + text-decoration: none; + margin-bottom: 24px; + + a { + color: rgba(255, 255, 255, 0.39); + font-family: "JetBrains Mono Nerd Font"; + font-size: 16px; + font-style: normal; + font-weight: 400; + line-height: normal; + text-decoration: none; + } + + @media (min-width: 768px) { + display: none; + } + } + } +} diff --git a/packages/console/app/src/routes/black/workspace.tsx b/packages/console/app/src/routes/black/workspace.tsx new file mode 100644 index 00000000000..0eca8cd11ab --- /dev/null +++ b/packages/console/app/src/routes/black/workspace.tsx @@ -0,0 +1,229 @@ +import { A, createAsync, useNavigate } from "@solidjs/router" +import "./workspace.css" +import { Title } from "@solidjs/meta" +import { github } from "~/lib/github" +import { createEffect, createMemo, For, onMount } from "solid-js" +import { config } from "~/config" +import { createList } from "solid-list" + +export default function BlackWorkspace() { + const navigate = useNavigate() + const githubData = createAsync(() => github()) + const starCount = createMemo(() => + githubData()?.stars + ? new Intl.NumberFormat("en-US", { + notation: "compact", + compactDisplay: "short", + }).format(githubData()!.stars!) + : config.github.starsFormatted.compact, + ) + + // TODO: Frank, replace with real workspaces + const workspaces = [ + { name: "Workspace 1", id: "wrk_123" }, + { name: "Workspace 2", id: "wrk_456" }, + { name: "Workspace 3", id: "wrk_789" }, + { name: "Workspace 4", id: "wrk_111" }, + { name: "Workspace 5", id: "wrk_222" }, + { name: "Workspace 6", id: "wrk_333" }, + { name: "Workspace 7", id: "wrk_444" }, + { name: "Workspace 8", id: "wrk_555" }, + ] + + let listRef: HTMLUListElement | undefined + + const { active, setActive, onKeyDown } = createList({ + items: () => workspaces.map((w) => w.id), + initialActive: workspaces[0]?.id ?? null, + handleTab: true, + }) + + onMount(() => { + listRef?.focus() + }) + + createEffect(() => { + const id = active() + if (!id || !listRef) return + const el = listRef.querySelector(`[data-id="${id}"]`) + el?.scrollIntoView({ block: "nearest" }) + }) + + return ( +
+ opencode +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + + + + + + + + + + + + + + + + + +
+
+

Select a workspace for this plan

+
    { + if (e.key === "Enter" && active()) { + navigate(`/black/workspace/${active()}`) + } else if (e.key === "Tab") { + e.preventDefault() + onKeyDown(e) + } else { + onKeyDown(e) + } + }} + > + + {(workspace) => ( +
  • setActive(workspace.id)} + onClick={() => navigate(`/black/workspace/${workspace.id}`)} + > + [*] + {workspace.name} +
  • + )} +
    +
+
+
+ +
+ ) +} diff --git a/packages/console/app/src/routes/brand/index.css b/packages/console/app/src/routes/brand/index.css index b7c76f5bbf0..2bfe5711aa6 100644 --- a/packages/console/app/src/routes/brand/index.css +++ b/packages/console/app/src/routes/brand/index.css @@ -8,7 +8,8 @@ } } -[data-page="enterprise"] { +[data-page="enterprise"], +[data-page="legal"] { --color-background: hsl(0, 20%, 99%); --color-background-weak: hsl(0, 8%, 97%); --color-background-weak-hover: hsl(0, 8%, 94%); @@ -110,10 +111,13 @@ [data-slot="cta-button"] { background: var(--color-background-strong); color: var(--color-text-inverted); - padding: 8px 16px; + padding: 8px 16px 8px 10px; border-radius: 4px; font-weight: 500; text-decoration: none; + display: flex; + align-items: center; + gap: 8px; @media (max-width: 55rem) { display: none; diff --git a/packages/console/app/src/routes/changelog/index.css b/packages/console/app/src/routes/changelog/index.css new file mode 100644 index 00000000000..29020a924e5 --- /dev/null +++ b/packages/console/app/src/routes/changelog/index.css @@ -0,0 +1,477 @@ +::selection { + background: var(--color-background-interactive); + color: var(--color-text-strong); + + @media (prefers-color-scheme: dark) { + background: var(--color-background-interactive); + color: var(--color-text-inverted); + } +} + +[data-page="changelog"] { + --color-background: hsl(0, 20%, 99%); + --color-background-weak: hsl(0, 8%, 97%); + --color-background-weak-hover: hsl(0, 8%, 94%); + --color-background-strong: hsl(0, 5%, 12%); + --color-background-strong-hover: hsl(0, 5%, 18%); + --color-background-interactive: hsl(62, 84%, 88%); + --color-background-interactive-weaker: hsl(64, 74%, 95%); + + --color-text: hsl(0, 1%, 39%); + --color-text-weak: hsl(0, 1%, 60%); + --color-text-weaker: hsl(30, 2%, 81%); + --color-text-strong: hsl(0, 5%, 12%); + --color-text-inverted: hsl(0, 20%, 99%); + + --color-border: hsl(30, 2%, 81%); + --color-border-weak: hsl(0, 1%, 85%); + + --color-icon: hsl(0, 1%, 55%); + + background: var(--color-background); + font-family: var(--font-mono); + color: var(--color-text); + padding-bottom: 5rem; + + @media (prefers-color-scheme: dark) { + --color-background: hsl(0, 9%, 7%); + --color-background-weak: hsl(0, 6%, 10%); + --color-background-weak-hover: hsl(0, 6%, 15%); + --color-background-strong: hsl(0, 15%, 94%); + --color-background-strong-hover: hsl(0, 15%, 97%); + --color-background-interactive: hsl(62, 100%, 90%); + --color-background-interactive-weaker: hsl(60, 20%, 8%); + + --color-text: hsl(0, 4%, 71%); + --color-text-weak: hsl(0, 2%, 49%); + --color-text-weaker: hsl(0, 3%, 28%); + --color-text-strong: hsl(0, 15%, 94%); + --color-text-inverted: hsl(0, 9%, 7%); + + --color-border: hsl(0, 3%, 28%); + --color-border-weak: hsl(0, 4%, 23%); + + --color-icon: hsl(10, 3%, 43%); + } + + /* Header styles - copied from download */ + [data-component="top"] { + padding: 24px 5rem; + height: 80px; + position: sticky; + top: 0; + display: flex; + justify-content: space-between; + align-items: center; + background: var(--color-background); + border-bottom: 1px solid var(--color-border-weak); + z-index: 10; + + @media (max-width: 60rem) { + padding: 24px 1.5rem; + } + + img { + height: 34px; + width: auto; + } + + [data-component="nav-desktop"] { + ul { + display: flex; + justify-content: space-between; + align-items: center; + gap: 48px; + + @media (max-width: 55rem) { + gap: 32px; + } + + @media (max-width: 48rem) { + gap: 24px; + } + li { + display: inline-block; + a { + text-decoration: none; + span { + color: var(--color-text-weak); + } + } + a:hover { + text-decoration: underline; + text-underline-offset: 2px; + text-decoration-thickness: 1px; + } + [data-slot="cta-button"] { + background: var(--color-background-strong); + color: var(--color-text-inverted); + padding: 8px 16px; + border-radius: 4px; + font-weight: 500; + text-decoration: none; + + @media (max-width: 55rem) { + display: none; + } + } + [data-slot="cta-button"]:hover { + background: var(--color-background-strong-hover); + text-decoration: none; + } + } + } + + @media (max-width: 40rem) { + display: none; + } + } + + [data-component="nav-mobile"] { + button > svg { + color: var(--color-icon); + } + } + + [data-component="nav-mobile-toggle"] { + border: none; + background: none; + outline: none; + height: 40px; + width: 40px; + cursor: pointer; + margin-right: -8px; + } + + [data-component="nav-mobile-toggle"]:hover { + background: var(--color-background-weak); + } + + [data-component="nav-mobile"] { + display: none; + + @media (max-width: 40rem) { + display: block; + + [data-component="nav-mobile-icon"] { + cursor: pointer; + height: 40px; + width: 40px; + display: flex; + align-items: center; + justify-content: center; + } + + [data-component="nav-mobile-menu-list"] { + position: fixed; + background: var(--color-background); + top: 80px; + left: 0; + right: 0; + height: 100vh; + + ul { + list-style: none; + padding: 20px 0; + + li { + a { + text-decoration: none; + padding: 20px; + display: block; + + span { + color: var(--color-text-weak); + } + } + + a:hover { + background: var(--color-background-weak); + } + } + } + } + } + } + + [data-slot="logo dark"] { + display: none; + } + + @media (prefers-color-scheme: dark) { + [data-slot="logo light"] { + display: none; + } + [data-slot="logo dark"] { + display: block; + } + } + } + + [data-component="footer"] { + border-top: 1px solid var(--color-border-weak); + display: flex; + flex-direction: row; + margin-top: 4rem; + + @media (max-width: 65rem) { + border-bottom: 1px solid var(--color-border-weak); + } + + [data-slot="cell"] { + flex: 1; + text-align: center; + + a { + text-decoration: none; + padding: 2rem 0; + width: 100%; + display: block; + + span { + color: var(--color-text-weak); + + @media (max-width: 40rem) { + display: none; + } + } + } + + a:hover { + background: var(--color-background-weak); + text-decoration: underline; + text-underline-offset: 2px; + text-decoration-thickness: 1px; + } + } + + [data-slot="cell"] + [data-slot="cell"] { + border-left: 1px solid var(--color-border-weak); + + @media (max-width: 40rem) { + border-left: none; + } + } + + @media (max-width: 25rem) { + flex-wrap: wrap; + + [data-slot="cell"] { + flex: 1 0 100%; + border-left: none; + border-top: 1px solid var(--color-border-weak); + } + + [data-slot="cell"]:nth-child(1) { + border-top: none; + } + } + } + + [data-component="container"] { + max-width: 67.5rem; + margin: 0 auto; + border: 1px solid var(--color-border-weak); + border-top: none; + + @media (max-width: 65rem) { + border: none; + } + } + + [data-component="content"] { + padding: 6rem 5rem; + + @media (max-width: 60rem) { + padding: 4rem 1.5rem; + } + } + + [data-component="legal"] { + color: var(--color-text-weak); + text-align: center; + padding: 2rem 5rem; + display: flex; + gap: 32px; + justify-content: center; + + @media (max-width: 60rem) { + padding: 2rem 1.5rem; + } + + a { + color: var(--color-text-weak); + text-decoration: none; + } + + a:hover { + color: var(--color-text); + text-decoration: underline; + } + } + + /* Changelog Hero */ + [data-component="changelog-hero"] { + margin-bottom: 4rem; + padding-bottom: 2rem; + border-bottom: 1px solid var(--color-border-weak); + + @media (max-width: 50rem) { + margin-bottom: 2rem; + padding-bottom: 1.5rem; + } + + h1 { + font-size: 1.5rem; + font-weight: 700; + color: var(--color-text-strong); + margin-bottom: 8px; + } + + p { + color: var(--color-text); + } + } + + /* Releases */ + [data-component="releases"] { + display: flex; + flex-direction: column; + gap: 0; + } + + [data-component="release"] { + display: grid; + grid-template-columns: 180px 1fr; + gap: 3rem; + padding: 2rem 0; + border-bottom: 1px solid var(--color-border-weak); + + @media (max-width: 50rem) { + grid-template-columns: 1fr; + gap: 1rem; + } + + &:first-child { + padding-top: 0; + } + + &:last-child { + border-bottom: none; + } + + header { + display: flex; + flex-direction: column; + gap: 4px; + + @media (max-width: 50rem) { + flex-direction: row; + align-items: center; + gap: 12px; + } + + [data-slot="version"] { + a { + font-weight: 600; + color: var(--color-text-strong); + text-decoration: none; + + &:hover { + text-decoration: underline; + text-underline-offset: 2px; + text-decoration-thickness: 1px; + } + } + } + + time { + color: var(--color-text-weak); + font-size: 14px; + } + } + + [data-slot="content"] { + display: flex; + flex-direction: column; + gap: 1.5rem; + } + + [data-component="section"] { + h3 { + font-size: 14px; + font-weight: 600; + color: var(--color-text-strong); + margin-bottom: 8px; + } + + ul { + list-style: none; + padding: 0; + margin: 0; + display: flex; + flex-direction: column; + gap: 6px; + + li { + color: var(--color-text); + line-height: 1.5; + padding-left: 16px; + position: relative; + + &::before { + content: "-"; + position: absolute; + left: 0; + color: var(--color-text-weak); + } + + [data-slot="author"] { + color: var(--color-text-weak); + font-size: 13px; + margin-left: 4px; + text-decoration: none; + + &:hover { + text-decoration: underline; + text-underline-offset: 2px; + text-decoration-thickness: 1px; + } + } + } + } + } + + [data-component="contributors"] { + font-size: 13px; + color: var(--color-text-weak); + padding-top: 0.5rem; + + span { + color: var(--color-text-weak); + } + + a { + color: var(--color-text); + text-decoration: none; + + &:hover { + text-decoration: underline; + text-underline-offset: 2px; + text-decoration-thickness: 1px; + } + } + } + } + + a { + color: var(--color-text-strong); + text-decoration: underline; + text-underline-offset: 2px; + text-decoration-thickness: 1px; + + &:hover { + text-decoration-thickness: 2px; + } + } +} diff --git a/packages/console/app/src/routes/changelog/index.tsx b/packages/console/app/src/routes/changelog/index.tsx new file mode 100644 index 00000000000..cf71d021ccb --- /dev/null +++ b/packages/console/app/src/routes/changelog/index.tsx @@ -0,0 +1,147 @@ +import "./index.css" +import { Title, Meta, Link } from "@solidjs/meta" +import { createAsync, query } from "@solidjs/router" +import { Header } from "~/component/header" +import { Footer } from "~/component/footer" +import { Legal } from "~/component/legal" +import { config } from "~/config" +import { For, Show } from "solid-js" + +type Release = { + tag_name: string + name: string + body: string + published_at: string + html_url: string +} + +const getReleases = query(async () => { + "use server" + const response = await fetch("https://api.github.com/repos/anomalyco/opencode/releases?per_page=20", { + headers: { + Accept: "application/vnd.github.v3+json", + "User-Agent": "OpenCode-Console", + }, + cf: { + cacheTtl: 60 * 5, + cacheEverything: true, + }, + } as any) + if (!response.ok) return [] + return response.json() as Promise +}, "releases.get") + +function formatDate(dateString: string) { + const date = new Date(dateString) + return date.toLocaleDateString("en-US", { + year: "numeric", + month: "short", + day: "numeric", + }) +} + +function parseMarkdown(body: string) { + const lines = body.split("\n") + const sections: { title: string; items: string[] }[] = [] + let current: { title: string; items: string[] } | null = null + let skip = false + + for (const line of lines) { + if (line.startsWith("## ")) { + if (current) sections.push(current) + const title = line.slice(3).trim() + current = { title, items: [] } + skip = false + } else if (line.startsWith("**Thank you")) { + skip = true + } else if (line.startsWith("- ") && !skip) { + current?.items.push(line.slice(2).trim()) + } + } + if (current) sections.push(current) + + return { sections } +} + +function ReleaseItem(props: { item: string }) { + const parts = () => { + const match = props.item.match(/^(.+?)(\s*\(@([\w-]+)\))?$/) + if (match) { + return { + text: match[1], + username: match[3], + } + } + return { text: props.item, username: undefined } + } + + return ( +
  • + {parts().text} + + + (@{parts().username}) + + +
  • + ) +} + +export default function Changelog() { + const releases = createAsync(() => getReleases()) + + return ( +
    + OpenCode | Changelog + + + +
    +
    + +
    +
    +

    Changelog

    +

    New updates and improvements to OpenCode

    +
    + +
    + + {(release) => { + const parsed = () => parseMarkdown(release.body || "") + return ( +
    +
    + + +
    +
    + + {(section) => ( +
    +

    {section.title}

    +
      + {(item) => } +
    +
    + )} +
    +
    +
    + ) + }} +
    +
    + +
    +
    +
    + + +
    + ) +} diff --git a/packages/console/app/src/routes/download/[platform].ts b/packages/console/app/src/routes/download/[platform].ts new file mode 100644 index 00000000000..2c30a803623 --- /dev/null +++ b/packages/console/app/src/routes/download/[platform].ts @@ -0,0 +1,38 @@ +import { APIEvent } from "@solidjs/start" +import { DownloadPlatform } from "./types" + +const assetNames: Record = { + "darwin-aarch64-dmg": "opencode-desktop-darwin-aarch64.dmg", + "darwin-x64-dmg": "opencode-desktop-darwin-x64.dmg", + "windows-x64-nsis": "opencode-desktop-windows-x64.exe", + "linux-x64-deb": "opencode-desktop-linux-amd64.deb", + "linux-x64-appimage": "opencode-desktop-linux-amd64.AppImage", + "linux-x64-rpm": "opencode-desktop-linux-x86_64.rpm", +} satisfies Record + +// Doing this on the server lets us preserve the original name for platforms we don't care to rename for +const downloadNames: Record = { + "darwin-aarch64-dmg": "OpenCode Desktop.dmg", + "darwin-x64-dmg": "OpenCode Desktop.dmg", + "windows-x64-nsis": "OpenCode Desktop Installer.exe", +} satisfies { [K in DownloadPlatform]?: string } + +export async function GET({ params: { platform } }: APIEvent) { + const assetName = assetNames[platform] + if (!assetName) return new Response("Not Found", { status: 404 }) + + const resp = await fetch(`https://github.com/anomalyco/opencode/releases/latest/download/${assetName}`, { + cf: { + // in case gh releases has rate limits + cacheTtl: 60 * 5, + cacheEverything: true, + }, + } as any) + + const downloadName = downloadNames[platform] + + const headers = new Headers(resp.headers) + if (downloadName) headers.set("content-disposition", `attachment; filename="${downloadName}"`) + + return new Response(resp.body, { ...resp, headers }) +} diff --git a/packages/console/app/src/routes/download/index.css b/packages/console/app/src/routes/download/index.css index 5178a6e55b9..a5ca692a2d5 100644 --- a/packages/console/app/src/routes/download/index.css +++ b/packages/console/app/src/routes/download/index.css @@ -34,7 +34,6 @@ font-family: var(--font-mono); color: var(--color-text); padding-bottom: 5rem; - overflow-x: hidden; @media (prefers-color-scheme: dark) { --color-background: hsl(0, 9%, 7%); diff --git a/packages/console/app/src/routes/download/index.tsx b/packages/console/app/src/routes/download/index.tsx index 31ce49617be..8b8f50968ce 100644 --- a/packages/console/app/src/routes/download/index.tsx +++ b/packages/console/app/src/routes/download/index.tsx @@ -8,7 +8,51 @@ import { Faq } from "~/component/faq" import desktopAppIcon from "../../asset/lander/opencode-desktop-icon.png" import { Legal } from "~/component/legal" import { config } from "~/config" -import { github } from "~/lib/github" +import { createSignal, onMount, Show, JSX } from "solid-js" +import { DownloadPlatform } from "./types" + +type OS = "macOS" | "Windows" | "Linux" | null + +function detectOS(): OS { + if (typeof navigator === "undefined") return null + const platform = navigator.platform.toLowerCase() + const userAgent = navigator.userAgent.toLowerCase() + + if (platform.includes("mac") || userAgent.includes("mac")) return "macOS" + if (platform.includes("win") || userAgent.includes("win")) return "Windows" + if (platform.includes("linux") || userAgent.includes("linux")) return "Linux" + return null +} + +function getDownloadPlatform(os: OS): DownloadPlatform { + switch (os) { + case "macOS": + return "darwin-aarch64-dmg" + case "Windows": + return "windows-x64-nsis" + case "Linux": + return "linux-x64-deb" + default: + return "darwin-aarch64-dmg" + } +} + +function getDownloadHref(platform: DownloadPlatform) { + return `/download/${platform}` +} + +function IconDownload(props: JSX.SvgSVGAttributes) { + return ( + + + + ) +} function CopyStatus() { return ( @@ -20,14 +64,12 @@ function CopyStatus() { } export default function Download() { - const githubData = createAsync(() => github(), { - deferStream: true, + const [detectedOS, setDetectedOS] = createSignal(null) + + onMount(() => { + setDetectedOS(detectOS()) }) - const download = () => { - const version = githubData()?.release.tag_name - if (!version) return null - return `https://github.com/sst/opencode/releases/download/${version}` - } + const handleCopyClick = (command: string) => (event: Event) => { const button = event.currentTarget as HTMLButtonElement navigator.clipboard.writeText(command) @@ -52,6 +94,12 @@ export default function Download() {

    Download OpenCode

    Available in Beta for macOS, Windows, and Linux

    + + + + Download for {detectedOS()} + +
    @@ -81,9 +129,9 @@ export default function Download() { - @@ -101,6 +149,12 @@ export default function Download() { [2] OpenCode Desktop (Beta)
    +
    @@ -115,7 +169,7 @@ export default function Download() { macOS (Apple Silicon)
    - + Download
    @@ -131,7 +185,7 @@ export default function Download() { macOS (Intel)
    - + Download
    @@ -154,7 +208,7 @@ export default function Download() { Windows (x64)
    - + Download
    @@ -170,7 +224,7 @@ export default function Download() { Linux (.deb) - + Download @@ -186,10 +240,27 @@ export default function Download() { Linux (.rpm) - + Download + {/* Disabled temporarily as it doesn't work */} + {/*
    +
    + + + + + + Linux (.AppImage) +
    + + Download + +
    */} @@ -370,7 +441,8 @@ export default function Download() {
  • - Not anymore! OpenCode is now available as an app for your desktop. + Not anymore! OpenCode is now available as an app for your desktop and{" "} + web!
  • diff --git a/packages/console/app/src/routes/download/types.ts b/packages/console/app/src/routes/download/types.ts new file mode 100644 index 00000000000..916f97022e3 --- /dev/null +++ b/packages/console/app/src/routes/download/types.ts @@ -0,0 +1,4 @@ +export type DownloadPlatform = + | `darwin-${"x64" | "aarch64"}-dmg` + | "windows-x64-nsis" + | `linux-x64-${"deb" | "rpm" | "appimage"}` diff --git a/packages/console/app/src/routes/enterprise/index.css b/packages/console/app/src/routes/enterprise/index.css index 496a886ebeb..7eebf16ce98 100644 --- a/packages/console/app/src/routes/enterprise/index.css +++ b/packages/console/app/src/routes/enterprise/index.css @@ -110,10 +110,13 @@ [data-slot="cta-button"] { background: var(--color-background-strong); color: var(--color-text-inverted); - padding: 8px 16px; + padding: 8px 16px 8px 10px; border-radius: 4px; font-weight: 500; text-decoration: none; + display: flex; + align-items: center; + gap: 8px; @media (max-width: 55rem) { display: none; diff --git a/packages/console/app/src/routes/index.css b/packages/console/app/src/routes/index.css index ae329b98bf8..9df1d85c7d5 100644 --- a/packages/console/app/src/routes/index.css +++ b/packages/console/app/src/routes/index.css @@ -206,6 +206,7 @@ body { [data-component="top"] { padding: 24px var(--padding); height: 80px; + min-height: 80px; position: sticky; top: 0; display: flex; @@ -521,7 +522,7 @@ body { [data-slot="content"] { display: flex; align-items: center; - gap: 4px; + gap: 1ch; } [data-slot="text"] { diff --git a/packages/console/app/src/routes/index.tsx b/packages/console/app/src/routes/index.tsx index 9948551e4c4..252dcbb9743 100644 --- a/packages/console/app/src/routes/index.tsx +++ b/packages/console/app/src/routes/index.tsx @@ -1,6 +1,6 @@ import "./index.css" import { Title, Meta, Link } from "@solidjs/meta" -// import { HttpHeader } from "@solidjs/start" +//import { HttpHeader } from "@solidjs/start" import video from "../asset/lander/opencode-min.mp4" import videoPoster from "../asset/lander/opencode-poster.png" import { IconCopy, IconCheck } from "../component/icon" @@ -52,6 +52,21 @@ export default function Home() {
    +
    + New +
    + + Desktop app available in beta on macOS, Windows, and Linux. + + + Download now + + + Download the desktop beta now + +
    +
    +
    {/* brew install - opencode + anomalyco/tap/opencode @@ -177,7 +192,13 @@ export default function Home() {
  • [*]
    - Claude Pro Log in with Anthropic to use your Claude Pro or Max account + GitHub Copilot Log in with GitHub to use your Copilot account +
    +
  • +
  • + [*] +
    + ChatGPT Plus/Pro Log in with OpenAI to use your ChatGPT Plus or Pro account
  • @@ -213,7 +234,7 @@ export default function Home() { [*]

    With over {config.github.starsFormatted.full} GitHub stars,{" "} - {config.stats.contributors} contributors, and almost{" "} + {config.stats.contributors} contributors, and over{" "} {config.stats.commits} commits, OpenCode is used and trusted by over{" "} {config.stats.monthlyUsers} developers every month.

    @@ -671,7 +692,8 @@ export default function Home() {
  • - Not anymore! OpenCode is now available as an app for your desktop. + Not anymore! OpenCode is now available as an app for your desktop and{" "} + web!
  • diff --git a/packages/console/app/src/routes/legal/privacy-policy/index.css b/packages/console/app/src/routes/legal/privacy-policy/index.css new file mode 100644 index 00000000000..dbc9f2aa197 --- /dev/null +++ b/packages/console/app/src/routes/legal/privacy-policy/index.css @@ -0,0 +1,343 @@ +[data-component="privacy-policy"] { + max-width: 800px; + margin: 0 auto; + line-height: 1.7; +} + +[data-component="privacy-policy"] h1 { + font-size: 2rem; + font-weight: 700; + color: var(--color-text-strong); + margin-bottom: 0.5rem; + margin-top: 0; +} + +[data-component="privacy-policy"] .effective-date { + font-size: 0.95rem; + color: var(--color-text-weak); + margin-bottom: 2rem; +} + +[data-component="privacy-policy"] h2 { + font-size: 1.5rem; + font-weight: 600; + color: var(--color-text-strong); + margin-top: 3rem; + margin-bottom: 1rem; + padding-top: 1rem; + border-top: 1px solid var(--color-border-weak); +} + +[data-component="privacy-policy"] h2:first-of-type { + margin-top: 2rem; +} + +[data-component="privacy-policy"] h3 { + font-size: 1.25rem; + font-weight: 600; + color: var(--color-text-strong); + margin-top: 2rem; + margin-bottom: 1rem; +} + +[data-component="privacy-policy"] h4 { + font-size: 1.1rem; + font-weight: 600; + color: var(--color-text-strong); + margin-top: 1.5rem; + margin-bottom: 0.75rem; +} + +[data-component="privacy-policy"] p { + margin-bottom: 1rem; + color: var(--color-text); +} + +[data-component="privacy-policy"] ul, +[data-component="privacy-policy"] ol { + margin-bottom: 1rem; + padding-left: 1.5rem; + color: var(--color-text); +} + +[data-component="privacy-policy"] li { + margin-bottom: 0.5rem; + line-height: 1.7; +} + +[data-component="privacy-policy"] ul ul, +[data-component="privacy-policy"] ul ol, +[data-component="privacy-policy"] ol ul, +[data-component="privacy-policy"] ol ol { + margin-top: 0.5rem; + margin-bottom: 0.5rem; +} + +[data-component="privacy-policy"] a { + color: var(--color-text-strong); + text-decoration: underline; + text-underline-offset: 2px; + text-decoration-thickness: 1px; + word-break: break-word; +} + +[data-component="privacy-policy"] a:hover { + text-decoration-thickness: 2px; +} + +[data-component="privacy-policy"] strong { + font-weight: 600; + color: var(--color-text-strong); +} + +[data-component="privacy-policy"] .table-wrapper { + overflow-x: auto; + margin: 1.5rem 0; +} + +[data-component="privacy-policy"] table { + width: 100%; + border-collapse: collapse; + border: 1px solid var(--color-border); +} + +[data-component="privacy-policy"] th, +[data-component="privacy-policy"] td { + padding: 0.75rem 1rem; + text-align: left; + border: 1px solid var(--color-border); + vertical-align: top; +} + +[data-component="privacy-policy"] th { + background: var(--color-background-weak); + font-weight: 600; + color: var(--color-text-strong); +} + +[data-component="privacy-policy"] td { + color: var(--color-text); +} + +[data-component="privacy-policy"] td ul { + margin: 0; + padding-left: 1.25rem; +} + +[data-component="privacy-policy"] td li { + margin-bottom: 0.25rem; +} + +/* Mobile responsiveness */ +@media (max-width: 60rem) { + [data-component="privacy-policy"] { + padding: 0; + } + + [data-component="privacy-policy"] h1 { + font-size: 1.75rem; + } + + [data-component="privacy-policy"] h2 { + font-size: 1.35rem; + margin-top: 2.5rem; + } + + [data-component="privacy-policy"] h3 { + font-size: 1.15rem; + } + + [data-component="privacy-policy"] h4 { + font-size: 1rem; + } + + [data-component="privacy-policy"] table { + font-size: 0.9rem; + } + + [data-component="privacy-policy"] th, + [data-component="privacy-policy"] td { + padding: 0.5rem 0.75rem; + } +} + +html { + scroll-behavior: smooth; +} + +[data-component="privacy-policy"] [id] { + scroll-margin-top: 100px; +} + +@media print { + @page { + margin: 2cm; + size: letter; + } + + [data-component="top"], + [data-component="footer"], + [data-component="legal"] { + display: none !important; + } + + [data-page="legal"] { + background: white !important; + padding: 0 !important; + } + + [data-component="container"] { + max-width: none !important; + border: none !important; + margin: 0 !important; + } + + [data-component="content"], + [data-component="brand-content"] { + padding: 0 !important; + margin: 0 !important; + } + + [data-component="privacy-policy"] { + max-width: none !important; + margin: 0 !important; + padding: 0 !important; + } + + [data-component="privacy-policy"] * { + color: black !important; + background: transparent !important; + } + + [data-component="privacy-policy"] h1 { + font-size: 24pt; + margin-top: 0; + margin-bottom: 12pt; + page-break-after: avoid; + } + + [data-component="privacy-policy"] h2 { + font-size: 18pt; + border-top: 2pt solid black !important; + padding-top: 12pt; + margin-top: 24pt; + margin-bottom: 8pt; + page-break-after: avoid; + page-break-before: auto; + } + + [data-component="privacy-policy"] h2:first-of-type { + margin-top: 16pt; + } + + [data-component="privacy-policy"] h3 { + font-size: 14pt; + margin-top: 16pt; + margin-bottom: 8pt; + page-break-after: avoid; + } + + [data-component="privacy-policy"] h4 { + font-size: 12pt; + margin-top: 12pt; + margin-bottom: 6pt; + page-break-after: avoid; + } + + [data-component="privacy-policy"] p { + font-size: 11pt; + line-height: 1.5; + margin-bottom: 8pt; + orphans: 3; + widows: 3; + } + + [data-component="privacy-policy"] .effective-date { + font-size: 10pt; + margin-bottom: 16pt; + } + + [data-component="privacy-policy"] ul, + [data-component="privacy-policy"] ol { + margin-bottom: 8pt; + page-break-inside: auto; + } + + [data-component="privacy-policy"] li { + font-size: 11pt; + line-height: 1.5; + margin-bottom: 4pt; + page-break-inside: avoid; + } + + [data-component="privacy-policy"] a { + color: black !important; + text-decoration: underline; + } + + [data-component="privacy-policy"] .table-wrapper { + overflow: visible !important; + margin: 12pt 0; + } + + [data-component="privacy-policy"] table { + border: 2pt solid black !important; + page-break-inside: avoid; + width: 100% !important; + font-size: 10pt; + } + + [data-component="privacy-policy"] th, + [data-component="privacy-policy"] td { + border: 1pt solid black !important; + padding: 6pt 8pt !important; + background: white !important; + } + + [data-component="privacy-policy"] th { + background: #f0f0f0 !important; + font-weight: bold; + page-break-after: avoid; + } + + [data-component="privacy-policy"] tr { + page-break-inside: avoid; + } + + [data-component="privacy-policy"] td ul { + margin: 2pt 0; + padding-left: 12pt; + } + + [data-component="privacy-policy"] td li { + margin-bottom: 2pt; + font-size: 9pt; + } + + [data-component="privacy-policy"] strong { + font-weight: bold; + color: black !important; + } + + [data-component="privacy-policy"] h1, + [data-component="privacy-policy"] h2, + [data-component="privacy-policy"] h3, + [data-component="privacy-policy"] h4 { + page-break-inside: avoid; + page-break-after: avoid; + } + + [data-component="privacy-policy"] h2 + p, + [data-component="privacy-policy"] h3 + p, + [data-component="privacy-policy"] h4 + p, + [data-component="privacy-policy"] h2 + ul, + [data-component="privacy-policy"] h3 + ul, + [data-component="privacy-policy"] h4 + ul { + page-break-before: avoid; + } + + [data-component="privacy-policy"] table, + [data-component="privacy-policy"] .table-wrapper { + page-break-inside: avoid; + } +} diff --git a/packages/console/app/src/routes/legal/privacy-policy/index.tsx b/packages/console/app/src/routes/legal/privacy-policy/index.tsx new file mode 100644 index 00000000000..8b30ba14e0e --- /dev/null +++ b/packages/console/app/src/routes/legal/privacy-policy/index.tsx @@ -0,0 +1,1512 @@ +import "../../brand/index.css" +import "./index.css" +import { Title, Meta, Link } from "@solidjs/meta" +import { Header } from "~/component/header" +import { config } from "~/config" +import { Footer } from "~/component/footer" +import { Legal } from "~/component/legal" + +export default function PrivacyPolicy() { + return ( +
    + OpenCode | Privacy Policy + + +
    +
    + +
    +
    +
    +

    Privacy Policy

    +

    Effective date: Dec 16, 2025

    + +

    + At OpenCode, we take your privacy seriously. Please read this Privacy Policy to learn how we treat your + personal data.{" "} + + By using or accessing our Services in any manner, you acknowledge that you accept the practices and + policies outlined below, and you hereby consent that we will collect, use and disclose your + information as described in this Privacy Policy. + +

    + +

    + Remember that your use of OpenCode is at all times subject to our Terms of Use,{" "} + https://opencode.ai/legal/terms-of-service, which incorporates + this Privacy Policy. Any terms we use in this Policy without defining them have the definitions given to + them in the Terms of Use. +

    + +

    You may print a copy of this Privacy Policy by clicking the print button in your browser.

    + +

    + As we continually work to improve our Services, we may need to change this Privacy Policy from time to + time. We will alert you of material changes by placing a notice on the OpenCode website, by sending you + an email and/or by some other means. Please note that if you've opted not to receive legal notice emails + from us (or you haven't provided us with your email address), those legal notices will still govern your + use of the Services, and you are still responsible for reading and understanding them. If you use the + Services after any changes to the Privacy Policy have been posted, that means you agree to all of the + changes. +

    + +

    Privacy Policy Table of Contents

    + + +

    What this Privacy Policy Covers

    +

    + This Privacy Policy covers how we treat Personal Data that we gather when you access or use our + Services. "Personal Data" means any information that identifies or relates to a particular individual + and also includes information referred to as "personally identifiable information" or "personal + information" under applicable data privacy laws, rules or regulations. This Privacy Policy does not + cover the practices of companies we don't own or control or people we don't manage. +

    + +

    Personal Data

    + +

    Categories of Personal Data We Collect

    +

    + This chart details the categories of Personal Data that we collect and have collected over the past 12 + months: +

    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Category of Personal Data (and Examples)Business or Commercial Purpose(s) for CollectionCategories of Third Parties With Whom We Disclose this Personal Data
    + Profile or Contact Data such as first and last name, email, phone number and + mailing address. + +
      +
    • Providing, Customizing and Improving the Services
    • +
    • Marketing the Services
    • +
    • Corresponding with You
    • +
    +
    +
      +
    • Service Providers
    • +
    • Business Partners
    • +
    • Parties You Authorize, Access or Authenticate
    • +
    +
    + Payment Data such as financial account information, payment card type, full + number of payment card, last 4 digits of payment card, bank account information, billing + address, billing phone number and billing email + +
      +
    • Providing, Customizing and Improving the Services
    • +
    • Marketing the Services
    • +
    • Corresponding with You
    • +
    +
    +
      +
    • Service Providers (specifically our payment processing partner)
    • +
    • Business Partners
    • +
    • Parties You Authorize, Access or Authenticate
    • +
    +
    + Device/IP Data such as IP address, device ID, domain server, type of + device/operating system/browser used to access the Services. + +
      +
    • Providing, Customizing and Improving the Services
    • +
    • Marketing the Services
    • +
    • Corresponding with You
    • +
    +
    +
      +
    • None
    • +
    • Service Providers
    • +
    • Business Partners
    • +
    • Parties You Authorize, Access or Authenticate
    • +
    +
    + Other Identifying Information that You Voluntarily Choose to Provide such as + information included in conversations or prompts that you submit to AI + +
      +
    • Providing, Customizing and Improving the Services
    • +
    • Marketing the Services
    • +
    • Corresponding with You
    • +
    +
    +
      +
    • Service Providers
    • +
    • Business Partners
    • +
    • Parties You Authorize, Access or Authenticate
    • +
    +
    +
    + +

    Our Commercial or Business Purposes for Collecting Personal Data

    + +

    Providing, Customizing and Improving the Services

    +
      +
    • Creating and managing your account or other user profiles.
    • +
    • Providing you with the products, services or information you request.
    • +
    • Meeting or fulfilling the reason you provided the information to us.
    • +
    • Providing support and assistance for the Services.
    • +
    • + Improving the Services, including testing, research, internal analytics and product development. +
    • +
    • Doing fraud protection, security and debugging.
    • +
    • + Carrying out other business purposes stated when collecting your Personal Data or as otherwise set + forth in applicable data privacy laws, such as the California Consumer Privacy Act, as amended by the + California Privacy Rights Act of 2020 (the "CCPA"), the Colorado Privacy Act (the "CPA"), the + Connecticut Data Privacy Act (the "CTDPA"), the Delaware Personal Data Privacy Act (the "DPDPA"), the + Iowa Consumer Data Protection Act (the "ICDPA"), the Montana Consumer Data Privacy Act ("MCDPA"), the + Nebraska Data Privacy Act (the "NDPA"), the New Hampshire Privacy Act (the "NHPA"), the New Jersey + Privacy Act (the "NJPA"), the Oregon Consumer Privacy Act ("OCPA"), the Texas Data Privacy and + Security Act ("TDPSA"), the Utah Consumer Privacy Act (the "UCPA"), or the Virginia Consumer Data + Protection Act (the "VCDPA") (collectively, the "State Privacy Laws"). +
    • +
    + +

    Marketing the Services

    +
      +
    • Marketing and selling the Services.
    • +
    + +

    Corresponding with You

    +
      +
    • + Responding to correspondence that we receive from you, contacting you when necessary or requested, and + sending you information about OpenCode. +
    • +
    • Sending emails and other communications according to your preferences.
    • +
    + +

    Other Permitted Purposes for Processing Personal Data

    +

    + In addition, each of the above referenced categories of Personal Data may be collected, used, and + disclosed with the government, including law enforcement, or other parties to meet certain legal + requirements and enforcing legal terms including: fulfilling our legal obligations under applicable law, + regulation, court order or other legal process, such as preventing, detecting and investigating security + incidents and potentially illegal or prohibited activities; protecting the rights, property or safety of + you, OpenCode or another party; enforcing any agreements with you; responding to claims that any posting + or other content violates third-party rights; and resolving disputes. +

    + +

    + We will not collect additional categories of Personal Data or use the Personal Data we collected for + materially different, unrelated or incompatible purposes without providing you notice or obtaining your + consent. +

    + +

    Categories of Sources of Personal Data

    +

    We collect Personal Data about you from the following categories of sources:

    + +

    You

    +
      +
    • + When you provide such information directly to us. +
        +
      • When you create an account or use our interactive tools and Services.
      • +
      • + When you voluntarily provide information in free-form text boxes through the Services or through + responses to surveys or questionnaires. +
      • +
      • When you send us an email or otherwise contact us.
      • +
      +
    • +
    • + When you use the Services and such information is collected automatically. +
        +
      • Through Cookies (defined in the "Tracking Tools and Opt-Out" section below).
      • +
      • + If you download and install certain applications and software we make available, we may receive + and collect information transmitted from your computing device for the purpose of providing you + the relevant Services, such as information regarding when you are logged on and available to + receive updates or alert notices. +
      • +
      +
    • +
    + +

    Public Records

    +
      +
    • From the government.
    • +
    + +

    Third Parties

    +
      +
    • + Vendors +
        +
      • + We may use analytics providers to analyze how you interact and engage with the Services, or third + parties may help us provide you with customer support. +
      • +
      • We may use vendors to obtain information to generate leads and create user profiles.
      • +
      +
    • +
    + +

    How We Disclose Your Personal Data

    +

    + We disclose your Personal Data to the categories of service providers and other parties listed in this + section. Depending on state laws that may be applicable to you, some of these disclosures may constitute + a "sale" of your Personal Data. For more information, please refer to the state-specific sections below. +

    + +

    Service Providers

    +

    + These parties help us provide the Services or perform business functions on our behalf. They include: +

    +
      +
    • Hosting, technology and communication providers.
    • +
    • Analytics providers for web traffic or usage of the site.
    • +
    • Security and fraud prevention consultants.
    • +
    • Support and customer service vendors.
    • +
    + +

    Business Partners

    +

    These parties partner with us in offering various services. They include:

    +
      +
    • Businesses that you have a relationship with.
    • +
    • Companies that we partner with to offer joint promotional offers or opportunities.
    • +
    + +

    Parties You Authorize, Access or Authenticate

    +
      +
    • Home buyers
    • +
    + +

    Legal Obligations

    +

    + We may disclose any Personal Data that we collect with third parties in conjunction with any of the + activities set forth under "Other Permitted Purposes for Processing Personal Data" section above. +

    + +

    Business Transfers

    +

    + All of your Personal Data that we collect may be transferred to a third party if we undergo a merger, + acquisition, bankruptcy or other transaction in which that third party assumes control of our business + (in whole or in part). +

    + +

    Data that is Not Personal Data

    +

    + We may create aggregated, de-identified or anonymized data from the Personal Data we collect, including + by removing information that makes the data personally identifiable to a particular user. We may use + such aggregated, de-identified or anonymized data and disclose it with third parties for our lawful + business purposes, including to analyze, build and improve the Services and promote our business, + provided that we will not disclose such data in a manner that could identify you. +

    + +

    Tracking Tools and Opt-Out

    +

    + The Services use cookies and similar technologies such as pixel tags, web beacons, clear GIFs and + JavaScript (collectively, "Cookies") to enable our servers to recognize your web browser, tell us how + and when you visit and use our Services, analyze trends, learn about our user base and operate and + improve our Services. Cookies are small pieces of data– usually text files – placed on your computer, + tablet, phone or similar device when you use that device to access our Services. We may also supplement + the information we collect from you with information received from third parties, including third + parties that have placed their own Cookies on your device(s). +

    + +

    + Please note that because of our use of Cookies, the Services do not support "Do Not Track" requests sent + from a browser at this time. +

    + +

    We use the following types of Cookies:

    + +
      +
    • + Essential Cookies. Essential Cookies are required for providing you with features or + services that you have requested. For example, certain Cookies enable you to log into secure areas of + our Services. Disabling these Cookies may make certain features and services unavailable. +
    • +
    • + Functional Cookies. Functional Cookies are used to record your choices and settings + regarding our Services, maintain your preferences over time and recognize you when you return to our + Services. These Cookies help us to personalize our content for you, greet you by name and remember + your preferences (for example, your choice of language or region). +
    • +
    • + Performance/Analytical Cookies. Performance/Analytical Cookies allow us to understand + how visitors use our Services. They do this by collecting information about the number of visitors to + the Services, what pages visitors view on our Services and how long visitors are viewing pages on the + Services. Performance/Analytical Cookies also help us measure the performance of our advertising + campaigns in order to help us improve our campaigns and the Services' content for those who engage + with our advertising. For example, Google LLC ("Google") uses cookies in connection with its Google + Analytics services. Google's ability to use and disclose information collected by Google Analytics + about your visits to the Services is subject to the Google Analytics Terms of Use and the Google + Privacy Policy. You have the option to opt-out of Google's use of Cookies by visiting the Google + advertising opt-out page at{" "} + www.google.com/privacy_ads.html or the Google + Analytics Opt-out Browser Add-on at{" "} + https://tools.google.com/dlpage/gaoptout/. +
    • +
    + +

    + You can decide whether or not to accept Cookies through your internet browser's settings. Most browsers + have an option for turning off the Cookie feature, which will prevent your browser from accepting new + Cookies, as well as (depending on the sophistication of your browser software) allow you to decide on + acceptance of each new Cookie in a variety of ways. You can also delete all Cookies that are already on + your device. If you do this, however, you may have to manually adjust some preferences every time you + visit our website and some of the Services and functionalities may not work. +

    + +

    + To find out more information about Cookies generally, including information about how to manage and + delete Cookies, please visit{" "} + http://www.allaboutcookies.org/. +

    + +

    Data Security

    +

    + We seek to protect your Personal Data from unauthorized access, use and disclosure using appropriate + physical, technical, organizational and administrative security measures based on the type of Personal + Data and how we are processing that data. You should also help protect your data by appropriately + selecting and protecting your password and/or other sign-on mechanism; limiting access to your computer + or device and browser; and signing off after you have finished accessing your account. Although we work + to protect the security of your account and other data that we hold in our records, please be aware that + no method of transmitting data over the internet or storing data is completely secure. +

    + +

    Data Retention

    +

    + We retain Personal Data about you for as long as necessary to provide you with our Services or to + perform our business or commercial purposes for collecting your Personal Data. When establishing a + retention period for specific categories of data, we consider who we collected the data from, our need + for the Personal Data, why we collected the Personal Data, and the sensitivity of the Personal Data. In + some cases we retain Personal Data for longer, if doing so is necessary to comply with our legal + obligations, resolve disputes or collect fees owed, or is otherwise permitted or required by applicable + law, rule or regulation. We may further retain information in an anonymous or aggregated form where that + information would not identify you personally. +

    + +

    Personal Data of Children

    +

    + As noted in the Terms of Use, we do not knowingly collect or solicit Personal Data from children under + 18 years of age; if you are a child under the age of 18, please do not attempt to register for or + otherwise use the Services or send us any Personal Data. If we learn we have collected Personal Data + from a child under 18 years of age, we will delete that information as quickly as possible. If you + believe that a child under 18 years of age may have provided Personal Data to us, please contact us at{" "} + contact@anoma.ly. +

    + +

    California Resident Rights

    +

    + If you are a California resident, you have the rights set forth in this section. Please see the + "Exercising Your Rights under the State Privacy Laws" section below for instructions regarding how to + exercise these rights. Please note that we may process Personal Data of our customers' end users or + employees in connection with our provision of certain services to our customers. If we are processing + your Personal Data as a service provider, you should contact the entity that collected your Personal + Data in the first instance to address your rights with respect to such data. Additionally, please note + that these rights are subject to certain conditions and exceptions under applicable law, which may + permit or require us to deny your request. +

    + +

    + If there are any conflicts between this section and any other provision of this Privacy Policy and you + are a California resident, the portion that is more protective of Personal Data shall control to the + extent of such conflict. If you have any questions about this section or whether any of the following + rights apply to you, please contact us at contact@anoma.ly. +

    + +

    Access

    +

    + You have the right to request certain information about our collection and use of your Personal Data. In + response, we will provide you with the following information in the past 12 months: +

    +
      +
    • The categories of Personal Data that we have collected about you.
    • +
    • The categories of sources from which that Personal Data was collected.
    • +
    • The business or commercial purpose for collecting or selling your Personal Data.
    • +
    • The categories of third parties with whom we have shared your Personal Data.
    • +
    • The specific pieces of Personal Data that we have collected about you.
    • +
    + +

    + If we have disclosed your Personal Data to any third parties for a business purpose over the past 12 + months, we will identify the categories of Personal Data shared with each category of third party + recipient. If we have sold your Personal Data over the past 12 months, we will identify the categories + of Personal Data sold to each category of third party recipient. +

    + +

    + You may request the above information beyond the 12-month period, but no earlier than January 1, 2022. + If you do make such a request, we are required to provide that information unless doing so proves + impossible or would involve disproportionate effort. +

    + +

    Deletion

    +

    + You have the right to request that we delete the Personal Data that we have collected from you. Under + the CCPA, this right is subject to certain exceptions: for example, we may need to retain your Personal + Data to provide you with the Services or complete a transaction or other action you have requested, or + if deletion of your Personal Data involves disproportionate effort. If your deletion request is subject + to one of these exceptions, we may deny your deletion request. +

    + +

    Correction

    +

    + You have the right to request that we correct any inaccurate Personal Data we have collected about you. + Under the CCPA, this right is subject to certain exceptions: for example, if we decide, based on the + totality of circumstances related to your Personal Data, that such data is correct. If your correction + request is subject to one of these exceptions, we may deny your request. +

    + +

    Personal Data Sales Opt-Out

    +

    + We will not sell or share your Personal Data, and have not done so over the last 12 months. To our + knowledge, we do not sell or share the Personal Data of minors under 13 years of age or of consumers + under 16 years of age. +

    + +

    Limit the Use of Sensitive Personal Information

    +

    + Consumers have certain rights over the processing of their Sensitive Personal Information. However, we + do not collect Sensitive Personal Information. +

    + +

    We Will Not Discriminate Against You for Exercising Your Rights Under the CCPA

    +

    + We will not discriminate against you for exercising your rights under the CCPA. We will not deny you our + goods or services, charge you different prices or rates, or provide you a lower quality of goods and + services if you exercise your rights under the CCPA. However, we may offer different tiers of our + Services as allowed by applicable data privacy laws (including the CCPA) with varying prices, rates or + levels of quality of the goods or services you receive related to the value of Personal Data that we + receive from you. +

    + +

    Colorado Resident Rights

    +

    + If you are a Colorado resident, you have the rights set forth under the Colorado Privacy Act ("CPA"). + Please see the "Exercising Your Rights under the State Privacy Laws" section below for instructions + regarding how to exercise these rights. Please note that we may process Personal Data of our customers' + end users or employees in connection with our provision of certain services to our customers. If we are + processing your Personal Data as a service provider, you should contact the entity that collected your + Personal Data in the first instance to address your rights with respect to such data. Additionally, + please note that these rights are subject to certain conditions and exceptions under applicable law, + which may permit or require us to deny your request. +

    + +

    + If there are any conflicts between this section and any other provision of this Privacy Policy and you + are a Colorado resident, the portion that is more protective of Personal Data shall control to the + extent of such conflict. If you have any questions about this section or whether any of the following + rights apply to you, please contact us at contact@anoma.ly. +

    + +

    Access and Portability

    +

    + You have the right to request confirmation of whether or not we are processing your Personal Data and to + access and request a copy of your Personal Data in a machine-readable format, to the extent technically + feasible, twice within a calendar year. +

    + +

    Correction

    +

    + You have the right to correct inaccuracies in your Personal Data, to the extent such correction is + appropriate in consideration of the nature of such data and our purposes of processing your Personal + Data. +

    + +

    Deletion

    +

    You have the right to delete Personal Data concerning you.

    + +

    Personal Data Sales Opt-Out

    +

    + We do not currently sell or process for the purposes of targeted advertising your Personal Data as + defined under the CPA. +

    + +

    Profiling Opt-Out

    +

    + We do not process your Personal Data for "Profiling" to make "Decisions" under the CPA. "Profiling" + means any form of automated processing performed on personal data to evaluate, analyze or predict + personal aspects related to an identified or identifiable individual's economic situation, health, + personal preferences, interests, reliability, behavior, location or movements. "Decision" means any + "Decisions that produce legal or similarly significant effects concerning a Consumer," as defined in the + CPA that concern you. +

    + +

    Consent or "Opt-in" Required and How to Withdraw

    +

    + We may seek your consent to collect or process certain Personal Data, including: 1) Sensitive Data, 2) + Personal Data from a known child under 13 years of age, 3) to sell, or process Personal Data for + Targeted Advertising or Profiling after you exercise your right to opt-out, or 4) Personal Data for + Secondary Use. +

    + +

    + If you would like to withdraw your consent, please follow the instructions under the "Exercising Your + Rights under the State Privacy Laws" section. +

    + +

    We Will Not Discriminate Against You

    +

    + We will not process your personal data in violation of state and federal laws that prohibit unlawful + discrimination against consumers. +

    + +

    Connecticut Resident Rights

    +

    + If you are a Connecticut resident, you have the rights set forth under the Connecticut Data Privacy Act + ("CTDPA"). Please see the "Exercising Your Rights under the State Privacy Laws" section below for + instructions regarding how to exercise these rights. Please note that we may process Personal Data of + our customers' end users or employees in connection with our provision of certain services to our + customers. If we are processing your Personal Data as a service provider, you should contact the entity + that collected your Personal Data in the first instance to address your rights with respect to such + data. Additionally, please note that these rights are subject to certain conditions and exceptions under + applicable law, which may permit or require us to deny your request. +

    + +

    + If there are any conflicts between this section and any other provision of this Privacy Policy and you + are a Connecticut resident, the portion that is more protective of Personal Data shall control to the + extent of such conflict. If you have any questions about this section or whether any of the following + rights apply to you, please contact us at contact@anoma.ly. +

    + +

    Access and Portability

    +

    + You have the right to request confirmation of whether or not we are processing your Personal Data and to + access your Personal Data and request a copy of your Personal Data in a machine-readable format, to the + extent technically feasible. +

    + +

    Correction

    +

    + You have the right to correct inaccuracies in your Personal Data, to the extent such correction is + appropriate in consideration of the nature of such data and our purposes of processing your Personal + Data. +

    + +

    Deletion

    +

    You have the right to delete Personal Data you have provided to us or we have obtained about you.

    + +

    Personal Data Sales Opt-Out

    +

    + We do not currently sell or process for the purposes of targeted advertising your Personal Data as + defined under the CTDPA. +

    + +

    Profiling Opt-Out

    +

    + We do not process your Personal Data for "Profiling" as defined under the CTDPA. "Profiling" means any + form of automated processing performed on personal data to evaluate, analyze or predict personal aspects + related to an identified or identifiable individual's economic situation, health, personal preferences, + interests, reliability, behavior, location or movements. +

    + +

    Consent or "Opt-in" Required and How to Withdraw

    +

    + We may seek your consent to collect or process certain Personal Data, including: 1) Sensitive Data, 2) + Sensitive Data from a known child under 13 years of age, or 3) to sell, or process Personal Data for + Targeted Advertising of a consumer at least 13 years of age but younger than 16 years of age. +

    + +

    However, we currently do not collect or process your Personal Data as described above.

    + +

    We Will Not Discriminate Against You for Exercising Your Rights Under the CTDPA

    +

    + We will not discriminate against you for exercising your rights under the CTDPA. We will not deny you + our goods or services, charge you different prices or rates, or provide you a lower quality of goods and + services if you exercise your rights under the CTDPA. However, we may offer different tiers of our + Services as allowed by applicable data privacy laws (including the CTDPA) with varying prices, rates or + levels of quality of the goods or services you receive related to the value of Personal Data that we + receive from you. +

    + +

    Delaware Resident Rights

    +

    + If you are a Delaware resident, you have the rights set forth under the Delaware Personal Data Privacy + Act ("DPDPA"). Please see the "Exercising Your Rights under the State Privacy Laws" section below for + instructions regarding how to exercise these rights. Please note that we may process Personal Data of + our customers' end users or employees in connection with our provision of certain services to our + customers. If we are processing your Personal Data as a service provider, you should contact the entity + that collected your Personal Data in the first instance to address your rights with respect to such + data. Additionally, please note that these rights are subject to certain conditions and exceptions under + applicable law, which may permit or require us to deny your request. +

    + +

    + If there are any conflicts between this section and any other provision of this Privacy Policy and you + are a Delaware resident, the portion that is more protective of Personal Data shall control to the + extent of such conflict. If you have any questions about this section or whether any of the following + rights apply to you, please contact us at contact@anoma.ly. +

    + +

    Access and Portability

    +

    + You have the right to request confirmation of whether or not we are processing your Personal Data and to + access and request a copy of your Personal Data in a machine-readable format, to the extent technically + feasible. +

    + +

    Correction

    +

    + You have the right to correct inaccuracies in your Personal Data, to the extent such correction is + appropriate in consideration of the nature of such data and our purposes of processing your Personal + Data. +

    + +

    Deletion

    +

    You have the right to delete Personal Data you have provided to us or we have obtained about you.

    + +

    Personal Data Sales Opt-Out

    +

    + We do not currently sell or process for the purposes of targeted advertising your Personal Data as + defined under the DPDPA. +

    + +

    Profiling Opt-Out

    +

    + We do not process your Personal Data for "Profiling" to make "Decisions" under the DPDPA. "Profiling" + means any form of automated processing performed on personal data to evaluate, analyze or predict + personal aspects related to an identified or identifiable individual's economic circumstances, health, + personal preferences, interests, reliability, behavior, location or movements. "Decision" means any + "Decisions that produce legal or similarly significant effects concerning a Consumer," as defined in the + DPDPA that concern you. To our knowledge, we do not process the Personal Data of consumers under 18 + years of age for the purpose of Profiling. +

    + +

    Consent or "Opt-in" Required and How to Withdraw

    +

    + We may seek your consent to collect or process certain Personal Data, including: 1) Sensitive Data, 2) + Sensitive Data from a known child under 13 years of age, 3) or to sell, or process Personal Data for + Targeted Advertising, or Profiling of a consumer at least 13 years of age but younger than 18 years of + age. +

    + +

    However, we currently do not collect or process your Personal Data as described above.

    + +

    We Will Not Discriminate Against You

    +

    + We will not discriminate against you for exercising your rights under the DPDPA. We will not deny you + our goods or services, charge you different prices or rates, or provide you a lower quality of goods and + services if you exercise your rights under the DPDPA. However, we may offer different tiers of our + Services as allowed by applicable data privacy laws (including the DPDPA) with varying prices, rates or + levels of quality of the goods or services you receive related to the value of Personal Data that we + receive from you. +

    + +

    Iowa Resident Rights

    +

    + If you are an Iowa resident, you have the rights set forth under the Iowa Consumer Data Protection Act + ("ICDPA"). Please see the "Exercising Your Rights under the State Privacy Laws" section below for + instructions regarding how to exercise these rights. Please note that we may process Personal Data of + our customers' end users or employees in connection with our provision of certain services to our + customers. If we are processing your Personal Data as a service provider, you should contact the entity + that collected your Personal Data in the first instance to address your rights with respect to such + data. Additionally, please note that these rights are subject to certain conditions and exceptions under + applicable law, which may permit or require us to deny your request. +

    + +

    + If there are any conflicts between this section and any other provision of this Privacy Policy and you + are an Iowa resident, the portion that is more protective of Personal Data shall control to the extent + of such conflict. If you have any questions about this section or whether any of the following rights + apply to you, please contact us at contact@anoma.ly. +

    + +

    Access and Portability

    +

    + You have the right to request confirmation of whether or not we are processing your Personal Data and to + access and request a copy of your Personal Data in a machine-readable format, to the extent technically + feasible, twice within a calendar year. +

    + +

    Deletion

    +

    You have the right to delete Personal Data you have provided to us.

    + +

    Opt-Out of Certain Processing Activities

    +
      +
    • Targeted Advertising: We do not process your Personal Data for targeted advertising purposes.
    • +
    • Sale of Personal Data: We do not currently sell your Personal Data as defined under the ICDPA.
    • +
    • Processing of Sensitive Personal Data: We do not process Sensitive Personal Data.
    • +
    + +

    We Will Not Discriminate Against You for Exercising Your Rights Under the ICDPA

    +

    + We will not discriminate against you for exercising your rights under the ICDPA. We will not deny you + our goods or services, charge you different prices or rates, or provide you a lower quality of goods and + services if you exercise your rights under the ICDPA. However, we may offer different tiers of our + Services as allowed by applicable data privacy laws (including the ICDPA) with varying prices, rates or + levels of quality of the goods or services you receive related to the value of Personal Data that we + receive from you. +

    + +

    Montana Resident Rights

    +

    + If you are a Montana resident, you have the rights set forth under the Montana Consumer Data Privacy Act + ("MCDPA"). Please see the "Exercising Your Rights under the State Privacy Laws" section below for + instructions regarding how to exercise these rights. Please note that we may process Personal Data of + our customers' end users or employees in connection with our provision of certain services to our + customers. If we are processing your Personal Data as a service provider, you should contact the entity + that collected your Personal Data in the first instance to address your rights with respect to such + data. Additionally, please note that these rights are subject to certain conditions and exceptions under + applicable law, which may permit or require us to deny your request. +

    + +

    + If there are any conflicts between this section and any other provision of this Privacy Policy and you + are a Montana resident, the portion that is more protective of Personal Data shall control to the extent + of such conflict. If you have any questions about this section or whether any of the following rights + apply to you, please contact us at contact@anoma.ly. +

    + +

    Access and Portability

    +

    + You have the right to request confirmation of whether or not we are processing your Personal Data and to + access your Personal Data and request a copy of your Personal Data in a machine-readable format, to the + extent technically feasible. +

    + +

    Correction

    +

    + You have the right to correct inaccuracies in your Personal Data, to the extent such correction is + appropriate in consideration of the nature of such data and our purposes of processing your Personal + Data. +

    + +

    Deletion

    +

    You have the right to delete Personal Data you have provided to us or we have obtained about you.

    + +

    Personal Data Sales Opt-Out

    +

    + We do not currently sell or process for the purposes of targeted advertising your Personal Data as + defined under the MCDPA. +

    + +

    Profiling Opt-Out

    +

    + We do not process your Personal Data for "Profiling" to make "Decisions" under the MCDPA. "Profiling" + means any form of automated processing performed on personal data to evaluate, analyze or predict + personal aspects related to an identified or identifiable individual's economic circumstances, health, + personal preferences, interests, reliability, behavior, location or movements. "Decision" means any + "Decisions that produce legal or similarly significant effects concerning a Consumer," as defined in the + MCDPA that concern you. To our knowledge, we do not process the Personal Data of consumers under 16 + years of age for the purpose of Profiling. +

    + +

    Consent or "Opt-in" Required and How to Withdraw

    +

    + We may seek your consent to collect or process certain Personal Data, including: 1) Sensitive Data, 2) + Sensitive Data from a known child under 13 years of age, or 3) to sell, or process Personal Data for + Targeted Advertising or Profiling of a consumer at least 13 years of age but younger than 16 years of + age. +

    + +

    However, we currently do not collect or process your Personal Data as described above.

    + +

    We Will Not Discriminate Against You for Exercising Your Rights Under the MCDPA

    +

    + We will not discriminate against you for exercising your rights under the MCDPA. We will not deny you + our goods or services, charge you different prices or rates, or provide you a lower quality of goods and + services if you exercise your rights under the MCDPA. However, we may offer different tiers of our + Services as allowed by applicable data privacy laws (including the MCDPA) with varying prices, rates or + levels of quality of the goods or services you receive related to the value of Personal Data that we + receive from you. +

    + +

    Nebraska Resident Rights

    +

    + If you are a Nebraska resident, you have the rights set forth under the Nebraska Data Privacy Act + ("NDPA"). Please see the "Exercising Your Rights under the State Privacy Laws" section below for + instructions regarding how to exercise these rights. Please note that we may process Personal Data of + our customers' end users or employees in connection with our provision of certain services to our + customers. If we are processing your Personal Data as a service provider, you should contact the entity + that collected your Personal Data in the first instance to address your rights with respect to such + data. Additionally, please note that these rights are subject to certain conditions and exceptions under + applicable law, which may permit or require us to deny your request. +

    + +

    + If there are any conflicts between this section and any other provision of this Privacy Policy and you + are a Nebraska resident, the portion that is more protective of Personal Data shall control to the + extent of such conflict. If you have any questions about this section or whether any of the following + rights apply to you, please contact us at contact@anoma.ly. +

    + +

    Access and Portability

    +

    + You have the right to request confirmation of whether or not we are processing your Personal Data and to + access your Personal Data and request a copy of your Personal Data in a machine-readable format, to the + extent technically feasible, twice within a calendar year. +

    + +

    Correction

    +

    + You have the right to correct inaccuracies in your Personal Data, to the extent such correction is + appropriate in consideration of the nature of such data and our purposes of processing your Personal + Data. +

    + +

    Deletion

    +

    You have the right to delete Personal Data you have provided to us or we have obtained about you.

    + +

    Personal Data Sales Opt-Out

    +

    + We do not currently sell or process for the purposes of targeted advertising your Personal Data as + defined under the NDPA. +

    + +

    Profiling Opt-Out

    +

    + We do not process your Personal Data for "Profiling" to make "Decisions" under the NDPA. "Profiling" + means any form of automated processing performed on personal data to evaluate, analyze or predict + personal aspects related to an identified or identifiable individual's economic circumstances, health, + personal preferences, interests, reliability, behavior, location or movements. "Decision" means any + "Decisions that produce legal or similarly significant effects concerning a Consumer," as defined in the + NDPA that concern you. +

    + +

    Consent or "Opt-in" Required and How to Withdraw

    +

    + We may seek your consent to collect or process certain Personal Data, including: 1) Sensitive Data and + 2) Sensitive Data from a known child under 13 years of age. +

    + +

    However, we currently do not collect or process your Personal Data as described above.

    + +

    We Will Not Discriminate Against You for Exercising Your Rights Under the NDPA

    +

    + We will not discriminate against you for exercising your rights under the NDPA. We will not deny you our + goods or services, charge you different prices or rates, or provide you a lower quality of goods and + services if you exercise your rights under the NDPA. However, we may offer different tiers of our + Services as allowed by applicable data privacy laws (including the NDPA) with varying prices, rates or + levels of quality of the goods or services you receive related to the value of Personal Data that we + receive from you. +

    + +

    New Hampshire Resident Rights

    +

    + If you are a New Hampshire resident, you have the rights set forth under the New Hampshire Privacy Act + ("NHPA"). Please see the "Exercising Your Rights under the State Privacy Laws" section below for + instructions regarding how to exercise these rights. Please note that we may process Personal Data of + our customers' end users or employees in connection with our provision of certain services to our + customers. If we are processing your Personal Data as a service provider, you should contact the entity + that collected your Personal Data in the first instance to address your rights with respect to such + data. Additionally, please note that these rights are subject to certain conditions and exceptions under + applicable law, which may permit or require us to deny your request. +

    + +

    + If there are any conflicts between this section and any other provision of this Privacy Policy and you + are a New Hampshire resident, the portion that is more protective of Personal Data shall control to the + extent of such conflict. If you have any questions about this section or whether any of the following + rights apply to you, please contact us at contact@anoma.ly. +

    + +

    Access and Portability

    +

    + You have the right to request confirmation of whether or not we are processing your Personal Data and to + access your Personal Data and request a copy of your Personal Data in a machine-readable format, to the + extent technically feasible. +

    + +

    Correction

    +

    + You have the right to correct inaccuracies in your Personal Data, to the extent such correction is + appropriate in consideration of the nature of such data and our purposes of processing your Personal + Data. +

    + +

    Deletion

    +

    You have the right to delete Personal Data you have provided to us or we have obtained about you.

    + +

    Personal Data Sales Opt-Out

    +

    + We do not currently sell or process for the purposes of targeted advertising your Personal Data as + defined under the NHPA. +

    + +

    Profiling Opt-Out

    +

    + We do not process your Personal Data for "Profiling" to make "Decisions" under the NHPA. "Profiling" + means any form of automated processing performed on personal data to evaluate, analyze or predict + personal aspects related to an identified or identifiable individual's economic circumstances, health, + personal preferences, interests, reliability, behavior, location or movements. "Decision" means any + "Decisions that produce legal or similarly significant effects concerning a Consumer," as defined in the + NHPA that concern you. +

    + +

    Consent or "Opt-in" Required and How to Withdraw

    +

    + We may seek your consent to collect or process certain Personal Data, including: 1) Sensitive Data and + 2) Sensitive Data from a known child under 13 years of age, 3) or to sell or process Personal Data for + Targeted Advertising of a consumer at least 13 years of age but younger than 16 years of age. +

    + +

    However, we currently do not collect or process your Personal Data as described above.

    + +

    We Will Not Discriminate Against You for Exercising Your Rights Under the NHPA

    +

    + We will not discriminate against you for exercising your rights under the NHPA. We will not deny you our + goods or services, charge you different prices or rates, or provide you a lower quality of goods and + services if you exercise your rights under the NHPA. However, we may offer different tiers of our + Services as allowed by applicable data privacy laws (including the NHPA) with varying prices, rates or + levels of quality of the goods or services you receive related to the value of Personal Data that we + receive from you. +

    + +

    New Jersey Resident Rights

    +

    + If you are a New Jersey resident, you have the rights set forth under the New Jersey Privacy Act + ("NJPA"). Please see the "Exercising Your Rights under the State Privacy Laws" section below for + instructions regarding how to exercise these rights. Please note that we may process Personal Data of + our customers' end users or employees in connection with our provision of certain services to our + customers. If we are processing your Personal Data as a service provider, you should contact the entity + that collected your Personal Data in the first instance to address your rights with respect to such + data. Additionally, please note that these rights are subject to certain conditions and exceptions under + applicable law, which may permit or require us to deny your request. +

    + +

    + If there are any conflicts between this section and any other provision of this Privacy Policy and you + are a New Jersey resident, the portion that is more protective of Personal Data shall control to the + extent of such conflict. If you have any questions about this section or whether any of the following + rights apply to you, please contact us at contact@anoma.ly. +

    + +

    Access and Portability

    +

    + You have the right to request confirmation of whether or not we are processing your Personal Data and to + access and request a copy of your Personal Data in a machine-readable format, to the extent technically + feasible. +

    + +

    Correction

    +

    + You have the right to correct inaccuracies in your Personal Data, to the extent such correction is + appropriate in consideration of the nature of such data and our purposes of processing your Personal + Data. +

    + +

    Deletion

    +

    You have the right to delete Personal Data concerning you.

    + +

    Personal Data Sales Opt-Out

    +

    + We do not currently sell or process for the purposes of targeted advertising your Personal Data as + defined under the NJPA. +

    + +

    Profiling Opt-Out

    +

    + We do not process your Personal Data for "Profiling" to make "Decisions" under the NJPA. "Profiling" + means any form of automated processing performed on personal data to evaluate, analyze or predict + personal aspects related to an identified or identifiable individual's economic circumstances, health, + personal preferences, interests, reliability, behavior, location or movements. "Decision" means any + "Decisions that produce legal or similarly significant effects concerning a Consumer," as defined in the + NJPA that concern you. To our knowledge, we do not process the Personal Data of consumers under 17 years + of age for the purpose of Profiling. +

    + +

    Consent or "Opt-in" Required and How to Withdraw

    +

    + We may seek your consent to collect or process certain Personal Data, including: 1) Sensitive Data, 2) + Sensitive Data from a known child under 13 years of age, 3) or to sell, or process Personal Data for + Targeted Advertising, or Profiling of a consumer at least 13 years of age but younger than 17 years of + age. +

    + +

    However, we currently do not collect or process your Personal Data as described above.

    + +

    We Will Not Discriminate Against You

    +

    + We will not discriminate against you for exercising your rights under the NJPA. We will not deny you our + goods or services, charge you different prices or rates, or provide you a lower quality of goods and + services if you exercise your rights under the NJPA. However, we may offer different tiers of our + Services as allowed by applicable data privacy laws (including the NJPA) with varying prices, rates or + levels of quality of the goods or services you receive related to the value of Personal Data that we + receive from you. +

    + +

    Oregon Resident Rights

    +

    + If you are an Oregon resident, you have the rights set forth under the Oregon Consumer Privacy Act + ("OCPA"). Please see the "Exercising Your Rights under the State Privacy Laws" section below for + instructions regarding how to exercise these rights. Please note that we may process Personal Data of + our customers' end users or employees in connection with our provision of certain services to our + customers. If we are processing your Personal Data as a service provider, you should contact the entity + that collected your Personal Data in the first instance to address your rights with respect to such + data. Additionally, please note that these rights are subject to certain conditions and exceptions under + applicable law, which may permit or require us to deny your request. +

    + +

    + If there are any conflicts between this section and any other provision of this Privacy Policy and you + are an Oregon resident, the portion that is more protective of Personal Data shall control to the extent + of such conflict. If you have any questions about this section or whether any of the following rights + apply to you, please contact us at contact@anoma.ly. +

    + +

    Access and Portability

    +

    + You have the right to request confirmation of whether or not we are processing your Personal Data and to + access and request a copy of your Personal Data, including a list of specific third parties, other than + natural persons, to which we have disclosed your Personal Data or any Personal Data, in a + machine-readable format, to the extent technically feasible. +

    + +

    Correction

    +

    + You have the right to correct inaccuracies in your Personal Data, to the extent such correction is + appropriate in consideration of the nature of such data and our purposes of processing your Personal + Data. +

    + +

    Deletion

    +

    You have the right to delete Personal Data you have provided to us or we have obtained about you.

    + +

    Personal Data Sales Opt-Out

    +

    + We do not currently sell or process for the purposes of targeted advertising your Personal Data as + defined under the OCPA. +

    + +

    Profiling Opt-Out

    +

    + We do not process your Personal Data for "Profiling" to make "Decisions" under the OCPA. "Profiling" + means any form of automated processing performed on personal data to evaluate, analyze or predict + personal aspects related to an identified or identifiable individual's economic circumstances, health, + personal preferences, interests, reliability, behavior, location or movements. "Decision" means any + "Decisions that produce legal or similarly significant effects concerning a Consumer," as defined in the + OCPA that concern you. To our knowledge, we do not process the Personal Data of consumers under 16 years + of age for the purpose of Profiling. +

    + +

    Consent or "Opt-in" Required and How to Withdraw

    +

    + We may seek your consent to collect or process certain Personal Data, including: 1) Sensitive Data, 2) + Sensitive Data from a known child under 13 years of age, or 3) to sell, or process Personal Data for + Targeted Advertising, or Profiling of a consumer at least 13 years of age but younger than 16 years of + age. +

    + +

    However, we currently do not collect or process your Personal Data as described above.

    + +

    We Will Not Discriminate Against You

    +

    + We will not discriminate against you for exercising your rights under the OCPA. We will not deny you our + goods or services, charge you different prices or rates, or provide you a lower quality of goods and + services if you exercise your rights under the OCPA. However, we may offer different tiers of our + Services as allowed by applicable data privacy laws (including the OCPA) with varying prices, rates or + levels of quality of the goods or services you receive related to the value of Personal Data that we + receive from you. +

    + +

    Texas Resident Rights

    +

    + If you are a Texas resident, you have the rights set forth under the Texas Data Privacy and Security Act + ("TDPSA"). Please see the "Exercising Your Rights under the State Privacy Laws" section below for + instructions regarding how to exercise these rights. Please note that we may process Personal Data of + our customers' end users or employees in connection with our provision of certain services to our + customers. If we are processing your Personal Data as a service provider, you should contact the entity + that collected your Personal Data in the first instance to address your rights with respect to such + data. Additionally, please note that these rights are subject to certain conditions and exceptions under + applicable law, which may permit or require us to deny your request. +

    + +

    + If there are any conflicts between this section and any other provision of this Privacy Policy and you + are a Texas resident, the portion that is more protective of Personal Data shall control to the extent + of such conflict. If you have any questions about this section or whether any of the following rights + apply to you, please contact us at contact@anoma.ly. +

    + +

    Access and Portability

    +

    + You have the right to request confirmation of whether or not we are processing your Personal Data and to + access your Personal Data and request a copy of your Personal Data in a machine-readable format, to the + extent technically feasible, twice within a calendar year. +

    + +

    Correction

    +

    + You have the right to correct inaccuracies in your Personal Data, to the extent such correction is + appropriate in consideration of the nature of such data and our purposes of processing your Personal + Data. +

    + +

    Deletion

    +

    You have the right to delete Personal Data you have provided to us or we have obtained about you.

    + +

    Personal Data Sales Opt-Out

    +

    + We do not currently sell or process for the purposes of targeted advertising your Personal Data as + defined under the TDPSA. +

    + +

    Profiling Opt-Out

    +

    + We do not process your Personal Data for "Profiling" as defined under the TDPSA. "Profiling" means any + form of solely automated processing performed on personal data to evaluate, analyze, or predict personal + aspects related to an identified or identifiable individual's economic situation, health, personal + preferences, interests, reliability, behavior, location, or movements. +

    + +

    Consent or "Opt-in" Required and How to Withdraw

    +

    + We may seek your consent to collect or process certain Personal Data, including: 1) Sensitive Data, or + 2) Sensitive Data from a known child under 13 years of age. +

    + +

    However, we currently do not collect or process your Personal Data as described above.

    + +

    We Will Not Discriminate Against You for Exercising Your Rights Under the TDPSA

    +

    + We will not discriminate against you for exercising your rights under the TDPSA. We will not deny you + our goods or services, charge you different prices or rates, or provide you a lower quality of goods and + services if you exercise your rights under the TDPSA. However, we may offer different tiers of our + Services as allowed by applicable data privacy laws (including the TDPSA) with varying prices, rates or + levels of quality of the goods or services you receive related to the value of Personal Data that we + receive from you. +

    + +

    Utah Resident Rights

    +

    + If you are a Utah resident, you have the rights set forth under the Utah Consumer Privacy Act ("UCPA"). + Please see the "Exercising Your Rights under the State Privacy Laws" section below for instructions + regarding how to exercise these rights. Please note that we may process Personal Data of our customers' + end users or employees in connection with our provision of certain services to our customers. If we are + processing your Personal Data as a service provider, you should contact the entity that collected your + Personal Data in the first instance to address your rights with respect to such data. Additionally, + please note that these rights are subject to certain conditions and exceptions under applicable law, + which may permit or require us to deny your request. +

    + +

    + If there are any conflicts between this section and any other provision of this Privacy Policy and you + are a Utah resident, the portion that is more protective of Personal Data shall control to the extent of + such conflict. If you have any questions about this section or whether any of the following rights apply + to you, please contact us at contact@anoma.ly. +

    + +

    Access and Portability

    +

    + You have the right to request confirmation of whether or not we are processing your Personal Data and to + access your Personal Data and request a copy of your Personal Data in a machine-readable format, to the + extent technically feasible. +

    + +

    Deletion

    +

    You have the right to delete Personal Data that you have provided to us.

    + +

    Opt-Out of Certain Processing Activities

    +
      +
    • Targeted Advertising: We do not process your Personal Data for targeted advertising purposes.
    • +
    • Sale of Personal Data: We do not currently sell your Personal Data as defined under the UCPA.
    • +
    • Processing of Sensitive Personal Data: We do not process Sensitive Personal Data.
    • +
    + +

    We Will Not Discriminate Against You for Exercising Your Rights Under the UCPA

    +

    + We will not discriminate against you for exercising your rights under the UCPA. We will not deny you our + goods or services, charge you different prices or rates, or provide you a lower quality of goods and + services if you exercise your rights under the UCPA. However, we may offer different tiers of our + Services as allowed by applicable data privacy laws (including the UCPA) with varying prices, rates or + levels of quality of the goods or services you receive related to the value of Personal Data that we + receive from you. +

    + +

    Virginia Resident Rights

    +

    + If you are a Virginia resident, you have the rights set forth under the Virginia Consumer Data + Protection Act ("VCDPA"). Please see the "Exercising Your Rights under the State Privacy Laws" section + below for instructions regarding how to exercise these rights. Please note that we may process Personal + Data of our customers' end users or employees in connection with our provision of certain services to + our customers. If we are processing your Personal Data as a service provider, you should contact the + entity that collected your Personal Data in the first instance to address your rights with respect to + such data. Additionally, please note that these rights are subject to certain conditions and exceptions + under applicable law, which may permit or require us to deny your request. +

    + +

    + If there are any conflicts between this section and any other provision of this Privacy Policy and you + are a Virginia resident, the portion that is more protective of Personal Data shall control to the + extent of such conflict. If you have any questions about this section or whether any of the following + rights apply to you, please contact us at contact@anoma.ly. +

    + +

    Access and Portability

    +

    + You have the right to request confirmation of whether or not we are processing your Personal Data and to + access your Personal Data, and request a copy of your Personal Data in a machine-readable format, to the + extent technically feasible. +

    + +

    Correction

    +

    + You have the right to correct inaccuracies in your Personal Data, to the extent such correction is + appropriate in consideration of the nature of such data and our purposes of processing your Personal + Data. +

    + +

    Deletion

    +

    You have the right to delete Personal Data you have provided to us or we have obtained about you.

    + +

    Consent or "Opt-in" Required and How to Withdraw

    +

    + We may seek your consent to collect or process certain Personal Data, including: 1) Sensitive Data, or + 2) Sensitive Data from a known child under 13 years of age. +

    + +

    However, we currently do not collect or process Personal data as described above.

    + +

    Opt-Out of Certain Processing Activities

    +
      +
    • Targeted Advertising: We do not process your Personal Data for targeted advertising purposes.
    • +
    • Sale of Personal Data: We do not currently sell your Personal Data as defined under the VDCPA.
    • +
    • + Processing for Profiling Purposes: We do not currently process your Personal Data for the purposes of + profiling. +
    • +
    + +

    + To exercise any of your rights for these certain processing activities, please follow the instructions + under the "Exercising Your Rights under the State Privacy Laws" section. +

    + +

    We Will Not Discriminate Against You for Exercising Your Rights Under the VCDPA

    +

    + We will not discriminate against you for exercising your rights under the VCDPA. We will not deny you + our goods or services, charge you different prices or rates, or provide you a lower quality of goods and + services if you exercise your rights under the VCDPA. However, we may offer different tiers of our + Services as allowed by applicable data privacy laws (including the VCDPA) with varying prices, rates or + levels of quality of the goods or services you receive related to the value of Personal Data that we + receive from you. +

    + +

    Exercising Your Rights under the State Privacy Laws

    +

    + To exercise the rights described in this Privacy Policy, you or, if you are a California, Colorado, + Connecticut, Delaware, Montana, Nebraska, New Hampshire, New Jersey, Oregon or Texas resident, your + Authorized Agent (defined below) must send us a request that (1) provides sufficient information to + allow us to verify that you are the person about whom we have collected Personal Data, and (2) describes + your request in sufficient detail to allow us to understand, evaluate and respond to it. Each request + that meets both of these criteria will be considered a "Valid Request." We may not respond to requests + that do not meet these criteria. We will only use Personal Data provided in a Valid Request to verify + your identity and complete your request. You do not need an account to submit a Valid Request. +

    + +

    + We will work to respond to your Valid Request within the time period required by applicable law. We will + not charge you a fee for making a Valid Request unless your Valid Request(s) is excessive, repetitive or + manifestly unfounded. If we determine that your Valid Request warrants a fee, we will notify you of the + fee and explain that decision before completing your request. +

    + +

    Request to Withdraw Consent to Certain Processing Activities

    +

    + If you are a California resident, you may withdraw your consent allowing us: 1) to sell or share your + Personal Data, by using the following method: +

    + + +

    Request to Access, Delete, or Correct

    +

    + You may submit a Valid Request for any other rights afforded to you in this Privacy Policy by using the + following methods: +

    + + +

    + If you are a California, Colorado, Connecticut, Delaware, Montana, Nebraska, New Hampshire, New Jersey, + Oregon or Texas resident, you may also authorize an agent (an "Authorized Agent") to exercise your + rights on your behalf. To do this, you must provide your Authorized Agent with written permission to + exercise your rights on your behalf, and we may request a copy of this written permission from your + Authorized Agent when they make a request on your behalf. +

    + +

    Appealing a Denial

    +

    + If you are a Colorado, Connecticut, Delaware, Iowa, Montana, Nebraska, New Hampshire, New Jersey, + Oregon, Texas or Virginia resident and we refuse to take action on your request within a reasonable + period of time after receiving your request in accordance with this section, you may appeal our + decision. In such appeal, you must (1) provide sufficient information to allow us to verify that you are + the person about whom the original request pertains and to identify the original request, and (2) + provide a description of the basis of your appeal. Please note that your appeal will be subject to your + rights and obligations afforded to you under the State Privacy Laws (as applicable). We will respond to + your appeal within the time period required under the applicable law. You can submit a Verified Request + to appeal by the following methods: +

    + + +

    + If we deny your appeal, you have the right to contact the Attorney General of your State, including by + the following links: Colorado, Connecticut, Delaware, Iowa, Montana, Nebraska, New Hampshire, New + Jersey, Oregon, Texas and Virginia. +

    + +

    Other State Law Privacy Rights

    + +

    California Resident Rights

    +

    + Under California Civil Code Sections 1798.83-1798.84, California residents are entitled to contact us to + prevent disclosure of Personal Data to third parties for such third parties' direct marketing purposes; + in order to submit such a request, please contact us at{" "} + contact@anoma.ly. +

    + +

    + Your browser may offer you a "Do Not Track" option, which allows you to signal to operators of websites + and web applications and services that you do not wish such operators to track certain of your online + activities over time and across different websites. Our Services do not support Do Not Track requests at + this time. To find out more about "Do Not Track," you can visit{" "} + www.allaboutdnt.com. +

    + +

    Nevada Resident Rights

    +

    + Please note that we do not currently sell your Personal Data as sales are defined in Nevada Revised + Statutes Chapter 603A. +

    + +

    Contact Information

    +

    + If you have any questions or comments about this Privacy Policy, the ways in which we collect and use + your Personal Data or your choices and rights regarding such collection and use, please do not hesitate + to contact us at: +

    + +
    +
    +
    +
    +
    + +
    + ) +} diff --git a/packages/console/app/src/routes/legal/terms-of-service/index.css b/packages/console/app/src/routes/legal/terms-of-service/index.css new file mode 100644 index 00000000000..709b3a9c37e --- /dev/null +++ b/packages/console/app/src/routes/legal/terms-of-service/index.css @@ -0,0 +1,254 @@ +[data-component="terms-of-service"] { + max-width: 800px; + margin: 0 auto; + line-height: 1.7; +} + +[data-component="terms-of-service"] h1 { + font-size: 2rem; + font-weight: 700; + color: var(--color-text-strong); + margin-bottom: 0.5rem; + margin-top: 0; +} + +[data-component="terms-of-service"] .effective-date { + font-size: 0.95rem; + color: var(--color-text-weak); + margin-bottom: 2rem; +} + +[data-component="terms-of-service"] h2 { + font-size: 1.5rem; + font-weight: 600; + color: var(--color-text-strong); + margin-top: 3rem; + margin-bottom: 1rem; + padding-top: 1rem; + border-top: 1px solid var(--color-border-weak); +} + +[data-component="terms-of-service"] h2:first-of-type { + margin-top: 2rem; +} + +[data-component="terms-of-service"] h3 { + font-size: 1.25rem; + font-weight: 600; + color: var(--color-text-strong); + margin-top: 2rem; + margin-bottom: 1rem; +} + +[data-component="terms-of-service"] h4 { + font-size: 1.1rem; + font-weight: 600; + color: var(--color-text-strong); + margin-top: 1.5rem; + margin-bottom: 0.75rem; +} + +[data-component="terms-of-service"] p { + margin-bottom: 1rem; + color: var(--color-text); +} + +[data-component="terms-of-service"] ul, +[data-component="terms-of-service"] ol { + margin-bottom: 1rem; + padding-left: 1.5rem; + color: var(--color-text); +} + +[data-component="terms-of-service"] li { + margin-bottom: 0.5rem; + line-height: 1.7; +} + +[data-component="terms-of-service"] ul ul, +[data-component="terms-of-service"] ul ol, +[data-component="terms-of-service"] ol ul, +[data-component="terms-of-service"] ol ol { + margin-top: 0.5rem; + margin-bottom: 0.5rem; +} + +[data-component="terms-of-service"] a { + color: var(--color-text-strong); + text-decoration: underline; + text-underline-offset: 2px; + text-decoration-thickness: 1px; + word-break: break-word; +} + +[data-component="terms-of-service"] a:hover { + text-decoration-thickness: 2px; +} + +[data-component="terms-of-service"] strong { + font-weight: 600; + color: var(--color-text-strong); +} + +@media (max-width: 60rem) { + [data-component="terms-of-service"] { + padding: 0; + } + + [data-component="terms-of-service"] h1 { + font-size: 1.75rem; + } + + [data-component="terms-of-service"] h2 { + font-size: 1.35rem; + margin-top: 2.5rem; + } + + [data-component="terms-of-service"] h3 { + font-size: 1.15rem; + } + + [data-component="terms-of-service"] h4 { + font-size: 1rem; + } +} + +html { + scroll-behavior: smooth; +} + +[data-component="terms-of-service"] [id] { + scroll-margin-top: 100px; +} + +@media print { + @page { + margin: 2cm; + size: letter; + } + + [data-component="top"], + [data-component="footer"], + [data-component="legal"] { + display: none !important; + } + + [data-page="legal"] { + background: white !important; + padding: 0 !important; + } + + [data-component="container"] { + max-width: none !important; + border: none !important; + margin: 0 !important; + } + + [data-component="content"], + [data-component="brand-content"] { + padding: 0 !important; + margin: 0 !important; + } + + [data-component="terms-of-service"] { + max-width: none !important; + margin: 0 !important; + padding: 0 !important; + } + + [data-component="terms-of-service"] * { + color: black !important; + background: transparent !important; + } + + [data-component="terms-of-service"] h1 { + font-size: 24pt; + margin-top: 0; + margin-bottom: 12pt; + page-break-after: avoid; + } + + [data-component="terms-of-service"] h2 { + font-size: 18pt; + border-top: 2pt solid black !important; + padding-top: 12pt; + margin-top: 24pt; + margin-bottom: 8pt; + page-break-after: avoid; + page-break-before: auto; + } + + [data-component="terms-of-service"] h2:first-of-type { + margin-top: 16pt; + } + + [data-component="terms-of-service"] h3 { + font-size: 14pt; + margin-top: 16pt; + margin-bottom: 8pt; + page-break-after: avoid; + } + + [data-component="terms-of-service"] h4 { + font-size: 12pt; + margin-top: 12pt; + margin-bottom: 6pt; + page-break-after: avoid; + } + + [data-component="terms-of-service"] p { + font-size: 11pt; + line-height: 1.5; + margin-bottom: 8pt; + orphans: 3; + widows: 3; + } + + [data-component="terms-of-service"] .effective-date { + font-size: 10pt; + margin-bottom: 16pt; + } + + [data-component="terms-of-service"] ul, + [data-component="terms-of-service"] ol { + margin-bottom: 8pt; + page-break-inside: auto; + } + + [data-component="terms-of-service"] li { + font-size: 11pt; + line-height: 1.5; + margin-bottom: 4pt; + page-break-inside: avoid; + } + + [data-component="terms-of-service"] a { + color: black !important; + text-decoration: underline; + } + + [data-component="terms-of-service"] strong { + font-weight: bold; + color: black !important; + } + + [data-component="terms-of-service"] h1, + [data-component="terms-of-service"] h2, + [data-component="terms-of-service"] h3, + [data-component="terms-of-service"] h4 { + page-break-inside: avoid; + page-break-after: avoid; + } + + [data-component="terms-of-service"] h2 + p, + [data-component="terms-of-service"] h3 + p, + [data-component="terms-of-service"] h4 + p, + [data-component="terms-of-service"] h2 + ul, + [data-component="terms-of-service"] h3 + ul, + [data-component="terms-of-service"] h4 + ul, + [data-component="terms-of-service"] h2 + ol, + [data-component="terms-of-service"] h3 + ol, + [data-component="terms-of-service"] h4 + ol { + page-break-before: avoid; + } +} diff --git a/packages/console/app/src/routes/legal/terms-of-service/index.tsx b/packages/console/app/src/routes/legal/terms-of-service/index.tsx new file mode 100644 index 00000000000..f0d7be61c06 --- /dev/null +++ b/packages/console/app/src/routes/legal/terms-of-service/index.tsx @@ -0,0 +1,512 @@ +import "../../brand/index.css" +import "./index.css" +import { Title, Meta, Link } from "@solidjs/meta" +import { Header } from "~/component/header" +import { config } from "~/config" +import { Footer } from "~/component/footer" +import { Legal } from "~/component/legal" + +export default function TermsOfService() { + return ( +
    + OpenCode | Terms of Service + + +
    +
    + +
    +
    +
    +

    Terms of Use

    +

    Effective date: Dec 16, 2025

    + +

    + Welcome to OpenCode. Please read on to learn the rules and restrictions that govern your use of OpenCode + (the "Services"). If you have any questions, comments, or concerns regarding these terms or the + Services, please contact us at: +

    + +

    + Email: contact@anoma.ly +

    + +

    + These Terms of Use (the "Terms") are a binding contract between you and{" "} + ANOMALY INNOVATIONS, INC. ("OpenCode," "we" and "us"). Your use of the Services in any + way means that you agree to all of these Terms, and these Terms will remain in effect while you use the + Services. These Terms include the provisions in this document as well as those in the Privacy Policy{" "} + https://opencode.ai/legal/privacy-policy.{" "} + + Your use of or participation in certain Services may also be subject to additional policies, rules + and/or conditions ("Additional Terms"), which are incorporated herein by reference, and you understand + and agree that by using or participating in any such Services, you agree to also comply with these + Additional Terms. + +

    + +

    + Please read these Terms carefully. They cover important information about Services provided to you and + any charges, taxes, and fees we bill you. These Terms include information about{" "} + future changes to these Terms,{" "} + automatic renewals,{" "} + limitations of liability,{" "} + a class action waiver and{" "} + resolution of disputes by arbitration instead of in court.{" "} + + PLEASE NOTE THAT YOUR USE OF AND ACCESS TO OUR SERVICES ARE SUBJECT TO THE FOLLOWING TERMS; IF YOU DO + NOT AGREE TO ALL OF THE FOLLOWING, YOU MAY NOT USE OR ACCESS THE SERVICES IN ANY MANNER. + +

    + +

    + ARBITRATION NOTICE AND CLASS ACTION WAIVER: EXCEPT FOR CERTAIN TYPES OF DISPUTES + DESCRIBED IN THE ARBITRATION AGREEMENT SECTION BELOW, YOU AGREE + THAT DISPUTES BETWEEN YOU AND US WILL BE RESOLVED BY BINDING, INDIVIDUAL ARBITRATION AND YOU WAIVE YOUR + RIGHT TO PARTICIPATE IN A CLASS ACTION LAWSUIT OR CLASS-WIDE ARBITRATION. +

    + +

    What is OpenCode?

    +

    + OpenCode is an AI-powered coding agent that helps you write, understand, and modify code using large + language models. Certain of these large language models are provided by third parties ("Third Party + Models") and certain of these models are provided directly by us if you use the OpenCode Zen paid + offering ("Zen"). Regardless of whether you use Third Party Models or Zen, OpenCode enables you to + access the functionality of models through a coding agent running within your terminal. +

    + +

    Will these Terms ever change?

    +

    + We are constantly trying to improve our Services, so these Terms may need to change along with our + Services. We reserve the right to change the Terms at any time, but if we do, we will place a notice on + our site located at opencode.ai, send you an email, and/or notify you by some other means. +

    + +

    + If you don't agree with the new Terms, you are free to reject them; unfortunately, that means you will + no longer be able to use the Services. If you use the Services in any way after a change to the Terms is + effective, that means you agree to all of the changes. +

    + +

    + Except for changes by us as described here, no other amendment or modification of these Terms will be + effective unless in writing and signed by both you and us. +

    + +

    What about my privacy?

    +

    + OpenCode takes the privacy of its users very seriously. For the current OpenCode Privacy Policy, please + click here{" "} + https://opencode.ai/legal/privacy-policy. +

    + +

    Children's Online Privacy Protection Act

    +

    + The Children's Online Privacy Protection Act ("COPPA") requires that online service providers obtain + parental consent before they knowingly collect personally identifiable information online from children + who are under 13 years of age. We do not knowingly collect or solicit personally identifiable + information from children under 13 years of age; if you are a child under 13 years of age, please do not + attempt to register for or otherwise use the Services or send us any personal information. If we learn + we have collected personal information from a child under 13 years of age, we will delete that + information as quickly as possible. If you believe that a child under 13 years of age may have provided + us personal information, please contact us at contact@anoma.ly. +

    + +

    What are the basics of using OpenCode?

    +

    + You represent and warrant that you are an individual of legal age to form a binding contract (or if not, + you've received your parent's or guardian's permission to use the Services and have gotten your parent + or guardian to agree to these Terms on your behalf). If you're agreeing to these Terms on behalf of an + organization or entity, you represent and warrant that you are authorized to agree to these Terms on + that organization's or entity's behalf and bind them to these Terms (in which case, the references to + "you" and "your" in these Terms, except for in this sentence, refer to that organization or entity). +

    + +

    + You will only use the Services for your own internal use, and not on behalf of or for the benefit of any + third party, and only in a manner that complies with all laws that apply to you. If your use of the + Services is prohibited by applicable laws, then you aren't authorized to use the Services. We can't and + won't be responsible for your using the Services in a way that breaks the law. +

    + +

    Are there restrictions in how I can use the Services?

    +

    + You represent, warrant, and agree that you will not provide or contribute anything, including any + Content (as that term is defined below), to the Services, or otherwise use or interact with the + Services, in a manner that: +

    + +
      +
    1. + infringes or violates the intellectual property rights or any other rights of anyone else (including + OpenCode); +
    2. +
    3. + violates any law or regulation, including, without limitation, any applicable export control laws, + privacy laws or any other purpose not reasonably intended by OpenCode; +
    4. +
    5. + is dangerous, harmful, fraudulent, deceptive, threatening, harassing, defamatory, obscene, or + otherwise objectionable; +
    6. +
    7. automatically or programmatically extracts data or Output (defined below);
    8. +
    9. Represent that the Output was human-generated when it was not;
    10. +
    11. + uses Output to develop artificial intelligence models that compete with the Services or any Third + Party Models; +
    12. +
    13. + attempts, in any manner, to obtain the password, account, or other security information from any other + user; +
    14. +
    15. + violates the security of any computer network, or cracks any passwords or security encryption codes; +
    16. +
    17. + runs Maillist, Listserv, any form of auto-responder or "spam" on the Services, or any processes that + run or are activated while you are not logged into the Services, or that otherwise interfere with the + proper working of the Services (including by placing an unreasonable load on the Services' + infrastructure); +
    18. +
    19. + "crawls," "scrapes," or "spiders" any page, data, or portion of or relating to the Services or Content + (through use of manual or automated means); +
    20. +
    21. copies or stores any significant portion of the Content; or
    22. +
    23. + decompiles, reverse engineers, or otherwise attempts to obtain the source code or underlying ideas or + information of or relating to the Services. +
    24. +
    + +

    + A violation of any of the foregoing is grounds for termination of your right to use or access the + Services. +

    + +

    Who Owns the Services and Content?

    + +

    Our IP

    +

    + We retain all right, title and interest in and to the Services. Except as expressly set forth herein, no + rights to the Services or Third Party Models are granted to you. +

    + +

    Your IP

    +

    + You may provide input to the Services ("Input"), and receive output from the Services based on the Input + ("Output"). Input and Output are collectively "Content." You are responsible for Content, including + ensuring that it does not violate any applicable law or these Terms. You represent and warrant that you + have all rights, licenses, and permissions needed to provide Input to our Services. +

    + +

    + As between you and us, and to the extent permitted by applicable law, you (a) retain your ownership + rights in Input and (b) own the Output. We hereby assign to you all our right, title, and interest, if + any, in and to Output. +

    + +

    + Due to the nature of our Services and artificial intelligence generally, output may not be unique and + other users may receive similar output from our Services. Our assignment above does not extend to other + users' output. +

    + +

    + We use Content to provide our Services, comply with applicable law, enforce our terms and policies, and + keep our Services safe. In addition, if you are using the Services through an unpaid account, we may use + Content to further develop and improve our Services. +

    + +

    + If you use OpenCode with Third Party Models, then your Content will be subject to the data retention + policies of the providers of such Third Party Models. Although we will not retain your Content, we + cannot and do not control the retention practices of Third Party Model providers. You should review the + terms and conditions applicable to any Third Party Model for more information about the data use and + retention policies applicable to such Third Party Models. +

    + +

    What about Third Party Models?

    +

    + The Services enable you to access and use Third Party Models, which are not owned or controlled by + OpenCode. Your ability to access Third Party Models is contingent on you having API keys or otherwise + having the right to access such Third Party Models. +

    + +

    + OpenCode has no control over, and assumes no responsibility for, the content, accuracy, privacy + policies, or practices of any providers of Third Party Models. We encourage you to read the terms and + conditions and privacy policy of each provider of a Third Party Model that you choose to utilize. By + using the Services, you release and hold us harmless from any and all liability arising from your use of + any Third Party Model. +

    + +

    Will OpenCode ever change the Services?

    +

    + We're always trying to improve our Services, so they may change over time. We may suspend or discontinue + any part of the Services, or we may introduce new features or impose limits on certain features or + restrict access to parts or all of the Services. +

    + +

    Do the Services cost anything?

    +

    + The Services may be free or we may charge a fee for using the Services. If you are using a free version + of the Services, we will notify you before any Services you are then using begin carrying a fee, and if + you wish to continue using such Services, you must pay all applicable fees for such Services. Any and + all such charges, fees or costs are your sole responsibility. You should consult with your +

    + +

    Paid Services

    +

    + Certain of our Services, including Zen, may be subject to payments now or in the future (the "Paid + Services"). Please see our Paid Services page https://opencode.ai/zen for a + description of the current Paid Services. Please note that any payment terms presented to you in the + process of using or signing up for a Paid Service are deemed part of these Terms. +

    + +

    Billing

    +

    + We use a third-party payment processor (the "Payment Processor") to bill you through a payment account + linked to your account on the Services (your "Billing Account") for use of the Paid Services. The + processing of payments will be subject to the terms, conditions and privacy policies of the Payment + Processor in addition to these Terms. Currently, we use Stripe, Inc. as our Payment Processor. You can + access Stripe's Terms of Service at{" "} + https://stripe.com/us/checkout/legal and their + Privacy Policy at https://stripe.com/us/privacy. We are not + responsible for any error by, or other acts or omissions of, the Payment Processor. By choosing to use + Paid Services, you agree to pay us, through the Payment Processor, all charges at the prices then in + effect for any use of such Paid Services in accordance with the applicable payment terms, and you + authorize us, through the Payment Processor, to charge your chosen payment provider (your "Payment + Method"). You agree to make payment using that selected Payment Method. We reserve the right to correct + any errors or mistakes that the Payment Processor makes even if it has already requested or received + payment. +

    + +

    Payment Method

    +

    + The terms of your payment will be based on your Payment Method and may be determined by agreements + between you and the financial institution, credit card issuer or other provider of your chosen Payment + Method. If we, through the Payment Processor, do not receive payment from you, you agree to pay all + amounts due on your Billing Account upon demand. +

    + +

    Recurring Billing

    +

    + Some of the Paid Services may consist of an initial period, for which there is a one-time charge, + followed by recurring period charges as agreed to by you. By choosing a recurring payment plan, you + acknowledge that such Services have an initial and recurring payment feature and you accept + responsibility for all recurring charges prior to cancellation. WE MAY SUBMIT PERIODIC CHARGES (E.G., + MONTHLY) WITHOUT FURTHER AUTHORIZATION FROM YOU, UNTIL YOU PROVIDE PRIOR NOTICE (RECEIPT OF WHICH IS + CONFIRMED BY US) THAT YOU HAVE TERMINATED THIS AUTHORIZATION OR WISH TO CHANGE YOUR PAYMENT METHOD. SUCH + NOTICE WILL NOT AFFECT CHARGES SUBMITTED BEFORE WE REASONABLY COULD ACT. TO TERMINATE YOUR AUTHORIZATION + OR CHANGE YOUR PAYMENT METHOD, GO TO ACCOUNT SETTINGS{" "} + https://opencode.ai/auth. +

    + +

    Free Trials and Other Promotions

    +

    + Any free trial or other promotion that provides access to a Paid Service must be used within the + specified time of the trial. You must stop using a Paid Service before the end of the trial period in + order to avoid being charged for that Paid Service. If you cancel prior to the end of the trial period + and are inadvertently charged for a Paid Service, please contact us at{" "} + contact@anoma.ly. +

    + +

    What if I want to stop using the Services?

    +

    + You're free to do that at any time; please refer to our Privacy Policy{" "} + https://opencode.ai/legal/privacy-policy, as well as the licenses + above, to understand how we treat information you provide to us after you have stopped using our + Services. +

    + +

    + OpenCode is also free to terminate (or suspend access to) your use of the Services for any reason in our + discretion, including your breach of these Terms. OpenCode has the sole right to decide whether you are + in violation of any of the restrictions set forth in these Terms. +

    + +

    + Provisions that, by their nature, should survive termination of these Terms shall survive termination. + By way of example, all of the following will survive termination: any obligation you have to pay us or + indemnify us, any limitations on our liability, any terms regarding ownership or intellectual property + rights, and terms regarding disputes between us, including without limitation the arbitration agreement. +

    + +

    What else do I need to know?

    + +

    Warranty Disclaimer

    +

    + OpenCode and its licensors, suppliers, partners, parent, subsidiaries or affiliated entities, and each + of their respective officers, directors, members, employees, consultants, contract employees, + representatives and agents, and each of their respective successors and assigns (OpenCode and all such + parties together, the "OpenCode Parties") make no representations or warranties concerning the Services, + including without limitation regarding any Content contained in or accessed through the Services, and + the OpenCode Parties will not be responsible or liable for the accuracy, copyright compliance, legality, + or decency of material contained in or accessed through the Services or any claims, actions, suits + procedures, costs, expenses, damages or liabilities arising out of use of, or in any way related to your + participation in, the Services. The OpenCode Parties make no representations or warranties regarding + suggestions or recommendations of services or products offered or purchased through or in connection + with the Services. THE SERVICES AND CONTENT ARE PROVIDED BY OPENCODE (AND ITS LICENSORS AND SUPPLIERS) + ON AN "AS-IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT + LIMITATION, IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, + OR THAT USE OF THE SERVICES WILL BE UNINTERRUPTED OR ERROR-FREE. SOME STATES DO NOT ALLOW LIMITATIONS ON + HOW LONG AN IMPLIED WARRANTY LASTS, SO THE ABOVE LIMITATIONS MAY NOT APPLY TO YOU. +

    + +

    Limitation of Liability

    +

    + TO THE FULLEST EXTENT ALLOWED BY APPLICABLE LAW, UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY + (INCLUDING, WITHOUT LIMITATION, TORT, CONTRACT, STRICT LIABILITY, OR OTHERWISE) SHALL ANY OF THE + OPENCODE PARTIES BE LIABLE TO YOU OR TO ANY OTHER PERSON FOR (A) ANY INDIRECT, SPECIAL, INCIDENTAL, + PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND, INCLUDING DAMAGES FOR LOST PROFITS, BUSINESS + INTERRUPTION, LOSS OF DATA, LOSS OF GOODWILL, WORK STOPPAGE, ACCURACY OF RESULTS, OR COMPUTER FAILURE OR + MALFUNCTION, (B) ANY SUBSTITUTE GOODS, SERVICES OR TECHNOLOGY, (C) ANY AMOUNT, IN THE AGGREGATE, IN + EXCESS OF THE GREATER OF (I) ONE-HUNDRED ($100) DOLLARS OR (II) THE AMOUNTS PAID AND/OR PAYABLE BY YOU + TO OPENCODE IN CONNECTION WITH THE SERVICES IN THE TWELVE (12) MONTH PERIOD PRECEDING THIS APPLICABLE + CLAIM OR (D) ANY MATTER BEYOND OUR REASONABLE CONTROL. SOME STATES DO NOT ALLOW THE EXCLUSION OR + LIMITATION OF INCIDENTAL OR CONSEQUENTIAL OR CERTAIN OTHER DAMAGES, SO THE ABOVE LIMITATION AND + EXCLUSIONS MAY NOT APPLY TO YOU. +

    + +

    Indemnity

    +

    + You agree to indemnify and hold the OpenCode Parties harmless from and against any and all claims, + liabilities, damages (actual and consequential), losses and expenses (including attorneys' fees) arising + from or in any way related to any claims relating to (a) your use of the Services, and (b) your + violation of these Terms. In the event of such a claim, suit, or action ("Claim"), we will attempt to + provide notice of the Claim to the contact information we have for your account (provided that failure + to deliver such notice shall not eliminate or reduce your indemnification obligations hereunder). +

    + +

    Assignment

    +

    + You may not assign, delegate or transfer these Terms or your rights or obligations hereunder, or your + Services account, in any way (by operation of law or otherwise) without OpenCode's prior written + consent. We may transfer, assign, or delegate these Terms and our rights and obligations without + consent. +

    + +

    Choice of Law

    +

    + These Terms are governed by and will be construed under the Federal Arbitration Act, applicable federal + law, and the laws of the State of Delaware, without regard to the conflicts of laws provisions thereof. +

    + +

    Arbitration Agreement

    +

    + Please read the following ARBITRATION AGREEMENT carefully because it requires you to arbitrate certain + disputes and claims with OpenCode and limits the manner in which you can seek relief from OpenCode. Both + you and OpenCode acknowledge and agree that for the purposes of any dispute arising out of or relating + to the subject matter of these Terms, OpenCode's officers, directors, employees and independent + contractors ("Personnel") are third-party beneficiaries of these Terms, and that upon your acceptance of + these Terms, Personnel will have the right (and will be deemed to have accepted the right) to enforce + these Terms against you as the third-party beneficiary hereof. +

    + +

    Arbitration Rules; Applicability of Arbitration Agreement

    +

    + The parties shall use their best efforts to settle any dispute, claim, question, or disagreement arising + out of or relating to the subject matter of these Terms directly through good-faith negotiations, which + shall be a precondition to either party initiating arbitration. If such negotiations do not resolve the + dispute, it shall be finally settled by binding arbitration in New Castle County, Delaware. The + arbitration will proceed in the English language, in accordance with the JAMS Streamlined Arbitration + Rules and Procedures (the "Rules") then in effect, by one commercial arbitrator with substantial + experience in resolving intellectual property and commercial contract disputes. The arbitrator shall be + selected from the appropriate list of JAMS arbitrators in accordance with such Rules. Judgment upon the + award rendered by such arbitrator may be entered in any court of competent jurisdiction. +

    + +

    Costs of Arbitration

    +

    + The Rules will govern payment of all arbitration fees. OpenCode will pay all arbitration fees for claims + less than seventy-five thousand ($75,000) dollars. OpenCode will not seek its attorneys' fees and costs + in arbitration unless the arbitrator determines that your claim is frivolous. +

    + +

    Small Claims Court; Infringement

    +

    + Either you or OpenCode may assert claims, if they qualify, in small claims court in New Castle County, + Delaware or any United States county where you live or work. Furthermore, notwithstanding the foregoing + obligation to arbitrate disputes, each party shall have the right to pursue injunctive or other + equitable relief at any time, from any court of competent jurisdiction, to prevent the actual or + threatened infringement, misappropriation or violation of a party's copyrights, trademarks, trade + secrets, patents or other intellectual property rights. +

    + +

    Waiver of Jury Trial

    +

    + YOU AND OPENCODE WAIVE ANY CONSTITUTIONAL AND STATUTORY RIGHTS TO GO TO COURT AND HAVE A TRIAL IN FRONT + OF A JUDGE OR JURY. You and OpenCode are instead choosing to have claims and disputes resolved by + arbitration. Arbitration procedures are typically more limited, more efficient, and less costly than + rules applicable in court and are subject to very limited review by a court. In any litigation between + you and OpenCode over whether to vacate or enforce an arbitration award, YOU AND OPENCODE WAIVE ALL + RIGHTS TO A JURY TRIAL, and elect instead to have the dispute be resolved by a judge. +

    + +

    Waiver of Class or Consolidated Actions

    +

    + ALL CLAIMS AND DISPUTES WITHIN THE SCOPE OF THIS ARBITRATION AGREEMENT MUST BE ARBITRATED OR LITIGATED + ON AN INDIVIDUAL BASIS AND NOT ON A CLASS BASIS. CLAIMS OF MORE THAN ONE CUSTOMER OR USER CANNOT BE + ARBITRATED OR LITIGATED JOINTLY OR CONSOLIDATED WITH THOSE OF ANY OTHER CUSTOMER OR USER. If however, + this waiver of class or consolidated actions is deemed invalid or unenforceable, neither you nor + OpenCode is entitled to arbitration; instead all claims and disputes will be resolved in a court as set + forth in (g) below. +

    + +

    Opt-out

    +

    + You have the right to opt out of the provisions of this Section by sending written notice of your + decision to opt out to the following address: [ADDRESS], [CITY], Canada [ZIP CODE] postmarked within + thirty (30) days of first accepting these Terms. You must include (i) your name and residence address, + (ii) the email address and/or telephone number associated with your account, and (iii) a clear statement + that you want to opt out of these Terms' arbitration agreement. +

    + +

    Exclusive Venue

    +

    + If you send the opt-out notice in (f), and/or in any circumstances where the foregoing arbitration + agreement permits either you or OpenCode to litigate any dispute arising out of or relating to the + subject matter of these Terms in court, then the foregoing arbitration agreement will not apply to + either party, and both you and OpenCode agree that any judicial proceeding (other than small claims + actions) will be brought in the state or federal courts located in, respectively, New Castle County, + Delaware, or the federal district in which that county falls. +

    + +

    Severability

    +

    + If the prohibition against class actions and other claims brought on behalf of third parties contained + above is found to be unenforceable, then all of the preceding language in this Arbitration Agreement + section will be null and void. This arbitration agreement will survive the termination of your + relationship with OpenCode. +

    + +

    Miscellaneous

    +

    + You will be responsible for paying, withholding, filing, and reporting all taxes, duties, and other + governmental assessments associated with your activity in connection with the Services, provided that + the OpenCode may, in its sole discretion, do any of the foregoing on your behalf or for itself as it + sees fit. The failure of either you or us to exercise, in any way, any right herein shall not be deemed + a waiver of any further rights hereunder. If any provision of these Terms are found to be unenforceable + or invalid, that provision will be limited or eliminated, to the minimum extent necessary, so that these + Terms shall otherwise remain in full force and effect and enforceable. You and OpenCode agree that these + Terms are the complete and exclusive statement of the mutual understanding between you and OpenCode, and + that these Terms supersede and cancel all previous written and oral agreements, communications and other + understandings relating to the subject matter of these Terms. You hereby acknowledge and agree that you + are not an employee, agent, partner, or joint venture of OpenCode, and you do not have any authority of + any kind to bind OpenCode in any respect whatsoever. +

    + +

    + Except as expressly set forth in the section above regarding the arbitration agreement, you and OpenCode + agree there are no third-party beneficiaries intended under these Terms. +

    +
    +
    +
    +
    +
    + +
    + ) +} diff --git a/packages/console/app/src/routes/openapi.json.ts b/packages/console/app/src/routes/openapi.json.ts index 8b27cb89ae4..2789e85c49e 100644 --- a/packages/console/app/src/routes/openapi.json.ts +++ b/packages/console/app/src/routes/openapi.json.ts @@ -1,6 +1,6 @@ export async function GET() { const response = await fetch( - "https://raw.githubusercontent.com/sst/opencode/refs/heads/dev/packages/sdk/openapi.json", + "https://raw.githubusercontent.com/anomalyco/opencode/refs/heads/dev/packages/sdk/openapi.json", ) const json = await response.json() return json diff --git a/packages/console/app/src/routes/stripe/webhook.ts b/packages/console/app/src/routes/stripe/webhook.ts index 3260f31b229..34f83b44603 100644 --- a/packages/console/app/src/routes/stripe/webhook.ts +++ b/packages/console/app/src/routes/stripe/webhook.ts @@ -1,11 +1,13 @@ import { Billing } from "@opencode-ai/console-core/billing.js" import type { APIEvent } from "@solidjs/start/server" -import { and, Database, eq, sql } from "@opencode-ai/console-core/drizzle/index.js" -import { BillingTable, PaymentTable } from "@opencode-ai/console-core/schema/billing.sql.js" +import { and, Database, eq, isNull, sql } from "@opencode-ai/console-core/drizzle/index.js" +import { BillingTable, PaymentTable, SubscriptionTable } from "@opencode-ai/console-core/schema/billing.sql.js" import { Identifier } from "@opencode-ai/console-core/identifier.js" import { centsToMicroCents } from "@opencode-ai/console-core/util/price.js" import { Actor } from "@opencode-ai/console-core/actor.js" import { Resource } from "@opencode-ai/console-resource" +import { UserTable } from "@opencode-ai/console-core/schema/user.sql.js" +import { AuthTable } from "@opencode-ai/console-core/schema/auth.sql.js" export async function POST(input: APIEvent) { const body = await Billing.stripe().webhooks.constructEventAsync( @@ -39,7 +41,7 @@ export async function POST(input: APIEvent) { .where(eq(BillingTable.customerID, customerID)) }) } - if (body.type === "checkout.session.completed") { + if (body.type === "checkout.session.completed" && body.data.object.mode === "payment") { const workspaceID = body.data.object.metadata?.workspaceID const amountInCents = body.data.object.metadata?.amount && parseInt(body.data.object.metadata?.amount) const customerID = body.data.object.customer as string @@ -85,7 +87,6 @@ export async function POST(input: APIEvent) { ...(customer?.customerID ? {} : { - reload: true, reloadError: null, timeReloadError: null, }), @@ -102,6 +103,381 @@ export async function POST(input: APIEvent) { }) }) } + if (body.type === "checkout.session.completed" && body.data.object.mode === "subscription") { + const workspaceID = body.data.object.custom_fields.find((f) => f.key === "workspaceid")?.text?.value + const amountInCents = body.data.object.amount_total as number + const customerID = body.data.object.customer as string + const customerEmail = body.data.object.customer_details?.email as string + const invoiceID = body.data.object.invoice as string + const subscriptionID = body.data.object.subscription as string + const promoCode = body.data.object.discounts?.[0]?.promotion_code as string + + if (!workspaceID) throw new Error("Workspace ID not found") + if (!customerID) throw new Error("Customer ID not found") + if (!amountInCents) throw new Error("Amount not found") + if (!invoiceID) throw new Error("Invoice ID not found") + if (!subscriptionID) throw new Error("Subscription ID not found") + + // get payment id from invoice + const invoice = await Billing.stripe().invoices.retrieve(invoiceID, { + expand: ["payments"], + }) + const paymentID = invoice.payments?.data[0].payment.payment_intent as string + if (!paymentID) throw new Error("Payment ID not found") + + // get payment method for the payment intent + const paymentIntent = await Billing.stripe().paymentIntents.retrieve(paymentID, { + expand: ["payment_method"], + }) + const paymentMethod = paymentIntent.payment_method + if (!paymentMethod || typeof paymentMethod === "string") throw new Error("Payment method not expanded") + + // get coupon id from promotion code + const couponID = await (async () => { + if (!promoCode) return + const coupon = await Billing.stripe().promotionCodes.retrieve(promoCode) + const couponID = coupon.coupon.id + if (!couponID) throw new Error("Coupon not found for promotion code") + return couponID + })() + + // get user + + await Actor.provide("system", { workspaceID }, async () => { + // look up current billing + const billing = await Billing.get() + if (!billing) throw new Error(`Workspace with ID ${workspaceID} not found`) + + // Temporarily skip this check because during Black drop, user can checkout + // as a new customer + //if (billing.customerID !== customerID) throw new Error("Customer ID mismatch") + + // Temporarily check the user to apply to. After Black drop, we will allow + // look up the user to apply to + const users = await Database.use((tx) => + tx + .select({ id: UserTable.id, email: AuthTable.subject }) + .from(UserTable) + .innerJoin(AuthTable, and(eq(AuthTable.accountID, UserTable.accountID), eq(AuthTable.provider, "email"))) + .where(and(eq(UserTable.workspaceID, workspaceID), isNull(UserTable.timeDeleted))), + ) + const user = users.find((u) => u.email === customerEmail) ?? users[0] + if (!user) { + console.error(`Error: User with email ${customerEmail} not found in workspace ${workspaceID}`) + process.exit(1) + } + + // set customer metadata + if (!billing?.customerID) { + await Billing.stripe().customers.update(customerID, { + metadata: { + workspaceID, + }, + }) + } + + await Database.transaction(async (tx) => { + await tx + .update(BillingTable) + .set({ + customerID, + subscriptionID, + subscription: { + status: "subscribed", + coupon: couponID, + seats: 1, + plan: "200", + }, + paymentMethodID: paymentMethod.id, + paymentMethodLast4: paymentMethod.card?.last4 ?? null, + paymentMethodType: paymentMethod.type, + }) + .where(eq(BillingTable.workspaceID, workspaceID)) + + await tx.insert(SubscriptionTable).values({ + workspaceID, + id: Identifier.create("subscription"), + userID: user.id, + }) + + await tx.insert(PaymentTable).values({ + workspaceID, + id: Identifier.create("payment"), + amount: centsToMicroCents(amountInCents), + paymentID, + invoiceID, + customerID, + enrichment: { + type: "subscription", + couponID, + }, + }) + }) + }) + } + if (body.type === "customer.subscription.created") { + /* +{ + id: "evt_1Smq802SrMQ2Fneksse5FMNV", + object: "event", + api_version: "2025-07-30.basil", + created: 1767766916, + data: { + object: { + id: "sub_1Smq7x2SrMQ2Fnek8F1yf3ZD", + object: "subscription", + application: null, + application_fee_percent: null, + automatic_tax: { + disabled_reason: null, + enabled: false, + liability: null, + }, + billing_cycle_anchor: 1770445200, + billing_cycle_anchor_config: null, + billing_mode: { + flexible: { + proration_discounts: "included", + }, + type: "flexible", + updated_at: 1770445200, + }, + billing_thresholds: null, + cancel_at: null, + cancel_at_period_end: false, + canceled_at: null, + cancellation_details: { + comment: null, + feedback: null, + reason: null, + }, + collection_method: "charge_automatically", + created: 1770445200, + currency: "usd", + customer: "cus_TkKmZZvysJ2wej", + customer_account: null, + days_until_due: null, + default_payment_method: null, + default_source: "card_1Smq7u2SrMQ2FneknjyOa7sq", + default_tax_rates: [], + description: null, + discounts: [], + ended_at: null, + invoice_settings: { + account_tax_ids: null, + issuer: { + type: "self", + }, + }, + items: { + object: "list", + data: [ + { + id: "si_TkKnBKXFX76t0O", + object: "subscription_item", + billing_thresholds: null, + created: 1770445200, + current_period_end: 1772864400, + current_period_start: 1770445200, + discounts: [], + metadata: {}, + plan: { + id: "price_1SmfFG2SrMQ2FnekJuzwHMea", + object: "plan", + active: true, + amount: 20000, + amount_decimal: "20000", + billing_scheme: "per_unit", + created: 1767725082, + currency: "usd", + interval: "month", + interval_count: 1, + livemode: false, + metadata: {}, + meter: null, + nickname: null, + product: "prod_Tk9LjWT1n0DgYm", + tiers_mode: null, + transform_usage: null, + trial_period_days: null, + usage_type: "licensed", + }, + price: { + id: "price_1SmfFG2SrMQ2FnekJuzwHMea", + object: "price", + active: true, + billing_scheme: "per_unit", + created: 1767725082, + currency: "usd", + custom_unit_amount: null, + livemode: false, + lookup_key: null, + metadata: {}, + nickname: null, + product: "prod_Tk9LjWT1n0DgYm", + recurring: { + interval: "month", + interval_count: 1, + meter: null, + trial_period_days: null, + usage_type: "licensed", + }, + tax_behavior: "unspecified", + tiers_mode: null, + transform_quantity: null, + type: "recurring", + unit_amount: 20000, + unit_amount_decimal: "20000", + }, + quantity: 1, + subscription: "sub_1Smq7x2SrMQ2Fnek8F1yf3ZD", + tax_rates: [], + }, + ], + has_more: false, + total_count: 1, + url: "/v1/subscription_items?subscription=sub_1Smq7x2SrMQ2Fnek8F1yf3ZD", + }, + latest_invoice: "in_1Smq7x2SrMQ2FnekSJesfPwE", + livemode: false, + metadata: {}, + next_pending_invoice_item_invoice: null, + on_behalf_of: null, + pause_collection: null, + payment_settings: { + payment_method_options: null, + payment_method_types: null, + save_default_payment_method: "off", + }, + pending_invoice_item_interval: null, + pending_setup_intent: null, + pending_update: null, + plan: { + id: "price_1SmfFG2SrMQ2FnekJuzwHMea", + object: "plan", + active: true, + amount: 20000, + amount_decimal: "20000", + billing_scheme: "per_unit", + created: 1767725082, + currency: "usd", + interval: "month", + interval_count: 1, + livemode: false, + metadata: {}, + meter: null, + nickname: null, + product: "prod_Tk9LjWT1n0DgYm", + tiers_mode: null, + transform_usage: null, + trial_period_days: null, + usage_type: "licensed", + }, + quantity: 1, + schedule: null, + start_date: 1770445200, + status: "active", + test_clock: "clock_1Smq6n2SrMQ2FnekQw4yt2PZ", + transfer_data: null, + trial_end: null, + trial_settings: { + end_behavior: { + missing_payment_method: "create_invoice", + }, + }, + trial_start: null, + }, + }, + livemode: false, + pending_webhooks: 0, + request: { + id: "req_6YO9stvB155WJD", + idempotency_key: "581ba059-6f86-49b2-9c49-0d8450255322", + }, + type: "customer.subscription.created", +} + */ + } + if (body.type === "customer.subscription.deleted") { + const subscriptionID = body.data.object.id + if (!subscriptionID) throw new Error("Subscription ID not found") + + const workspaceID = await Database.use((tx) => + tx + .select({ workspaceID: BillingTable.workspaceID }) + .from(BillingTable) + .where(eq(BillingTable.subscriptionID, subscriptionID)) + .then((rows) => rows[0]?.workspaceID), + ) + if (!workspaceID) throw new Error("Workspace ID not found for subscription") + + await Database.transaction(async (tx) => { + await tx + .update(BillingTable) + .set({ subscriptionID: null, subscription: null }) + .where(eq(BillingTable.workspaceID, workspaceID)) + + await tx.delete(SubscriptionTable).where(eq(SubscriptionTable.workspaceID, workspaceID)) + }) + } + if (body.type === "invoice.payment_succeeded") { + if ( + body.data.object.billing_reason === "subscription_cycle" || + body.data.object.billing_reason === "subscription_create" + ) { + const invoiceID = body.data.object.id as string + const amountInCents = body.data.object.amount_paid + const customerID = body.data.object.customer as string + const subscriptionID = body.data.object.parent?.subscription_details?.subscription as string + + if (!customerID) throw new Error("Customer ID not found") + if (!invoiceID) throw new Error("Invoice ID not found") + if (!subscriptionID) throw new Error("Subscription ID not found") + + // get coupon id from subscription + const subscriptionData = await Billing.stripe().subscriptions.retrieve(subscriptionID, { + expand: ["discounts"], + }) + const couponID = + typeof subscriptionData.discounts[0] === "string" + ? subscriptionData.discounts[0] + : subscriptionData.discounts[0]?.coupon?.id + + // get payment id from invoice + const invoice = await Billing.stripe().invoices.retrieve(invoiceID, { + expand: ["payments"], + }) + const paymentID = invoice.payments?.data[0].payment.payment_intent as string + if (!paymentID) { + // payment id can be undefined when using coupon + if (!couponID) throw new Error("Payment ID not found") + } + + const workspaceID = await Database.use((tx) => + tx + .select({ workspaceID: BillingTable.workspaceID }) + .from(BillingTable) + .where(eq(BillingTable.customerID, customerID)) + .then((rows) => rows[0]?.workspaceID), + ) + if (!workspaceID) throw new Error("Workspace ID not found for customer") + + await Database.use((tx) => + tx.insert(PaymentTable).values({ + workspaceID, + id: Identifier.create("payment"), + amount: centsToMicroCents(amountInCents), + paymentID, + invoiceID, + customerID, + enrichment: { + type: "subscription", + couponID, + }, + }), + ) + } + } if (body.type === "charge.refunded") { const customerID = body.data.object.customer as string const paymentIntentID = body.data.object.payment_intent as string diff --git a/packages/console/app/src/routes/temp.tsx b/packages/console/app/src/routes/temp.tsx index b0aef00e746..ccd95681068 100644 --- a/packages/console/app/src/routes/temp.tsx +++ b/packages/console/app/src/routes/temp.tsx @@ -89,7 +89,10 @@ export default function Home() { Shareable links Share a link to any sessions for reference or to debug
  • - Claude Pro Log in with Anthropic to use your Claude Pro or Max account + GitHub Copilot Log in with GitHub to use your Copilot account +
  • +
  • + ChatGPT Plus/Pro Log in with OpenAI to use your ChatGPT Plus or Pro account
  • Use any model Supports 75+ LLM providers through{" "} @@ -151,7 +154,7 @@ export default function Home() { X.com
  • Discord diff --git a/packages/console/app/src/routes/user-menu.tsx b/packages/console/app/src/routes/user-menu.tsx index e0931efd951..a910c2efd1b 100644 --- a/packages/console/app/src/routes/user-menu.tsx +++ b/packages/console/app/src/routes/user-menu.tsx @@ -1,6 +1,6 @@ import { action } from "@solidjs/router" import { getRequestEvent } from "solid-js/web" -import { useAuthSession } from "~/context/auth.session" +import { useAuthSession } from "~/context/auth" import { Dropdown } from "~/component/dropdown" import "./user-menu.css" diff --git a/packages/console/app/src/routes/workspace/[id]/billing/black-section.module.css b/packages/console/app/src/routes/workspace/[id]/billing/black-section.module.css new file mode 100644 index 00000000000..766cff6848c --- /dev/null +++ b/packages/console/app/src/routes/workspace/[id]/billing/black-section.module.css @@ -0,0 +1,62 @@ +.root { + [data-slot="title-row"] { + display: flex; + justify-content: space-between; + align-items: center; + gap: var(--space-4); + } + + [data-slot="usage"] { + display: flex; + gap: var(--space-6); + margin-top: var(--space-4); + + @media (max-width: 40rem) { + flex-direction: column; + gap: var(--space-4); + } + } + + [data-slot="usage-item"] { + flex: 1; + display: flex; + flex-direction: column; + gap: var(--space-2); + } + + [data-slot="usage-header"] { + display: flex; + justify-content: space-between; + align-items: baseline; + } + + [data-slot="usage-label"] { + font-size: var(--font-size-md); + font-weight: 500; + color: var(--color-text); + } + + [data-slot="usage-value"] { + font-size: var(--font-size-sm); + color: var(--color-text-muted); + } + + [data-slot="progress"] { + height: 8px; + background-color: var(--color-bg-surface); + border-radius: var(--border-radius-sm); + overflow: hidden; + } + + [data-slot="progress-bar"] { + height: 100%; + background-color: var(--color-accent); + border-radius: var(--border-radius-sm); + transition: width 0.3s ease; + } + + [data-slot="reset-time"] { + font-size: var(--font-size-sm); + color: var(--color-text-muted); + } +} diff --git a/packages/console/app/src/routes/workspace/[id]/billing/black-section.tsx b/packages/console/app/src/routes/workspace/[id]/billing/black-section.tsx new file mode 100644 index 00000000000..03c75387ab9 --- /dev/null +++ b/packages/console/app/src/routes/workspace/[id]/billing/black-section.tsx @@ -0,0 +1,229 @@ +import { action, useParams, useAction, useSubmission, json, query, createAsync } from "@solidjs/router" +import { createStore } from "solid-js/store" +import { Show } from "solid-js" +import { Billing } from "@opencode-ai/console-core/billing.js" +import { Database, eq, and, isNull } from "@opencode-ai/console-core/drizzle/index.js" +import { BillingTable, SubscriptionTable } from "@opencode-ai/console-core/schema/billing.sql.js" +import { Actor } from "@opencode-ai/console-core/actor.js" +import { Black } from "@opencode-ai/console-core/black.js" +import { withActor } from "~/context/auth.withActor" +import { queryBillingInfo } from "../../common" +import styles from "./black-section.module.css" +import waitlistStyles from "./black-waitlist-section.module.css" + +const querySubscription = query(async (workspaceID: string) => { + "use server" + return withActor(async () => { + const row = await Database.use((tx) => + tx + .select({ + rollingUsage: SubscriptionTable.rollingUsage, + fixedUsage: SubscriptionTable.fixedUsage, + timeRollingUpdated: SubscriptionTable.timeRollingUpdated, + timeFixedUpdated: SubscriptionTable.timeFixedUpdated, + subscription: BillingTable.subscription, + }) + .from(BillingTable) + .innerJoin(SubscriptionTable, eq(SubscriptionTable.workspaceID, BillingTable.workspaceID)) + .where(and(eq(SubscriptionTable.workspaceID, Actor.workspace()), isNull(SubscriptionTable.timeDeleted))) + .then((r) => r[0]), + ) + if (!row?.subscription) return null + + return { + plan: row.subscription.plan, + rollingUsage: Black.analyzeRollingUsage({ + plan: row.subscription.plan, + usage: row.rollingUsage ?? 0, + timeUpdated: row.timeRollingUpdated ?? new Date(), + }), + weeklyUsage: Black.analyzeWeeklyUsage({ + plan: row.subscription.plan, + usage: row.fixedUsage ?? 0, + timeUpdated: row.timeFixedUpdated ?? new Date(), + }), + } + }, workspaceID) +}, "subscription.get") + +function formatResetTime(seconds: number) { + const days = Math.floor(seconds / 86400) + if (days >= 1) { + const hours = Math.floor((seconds % 86400) / 3600) + return `${days} ${days === 1 ? "day" : "days"} ${hours} ${hours === 1 ? "hour" : "hours"}` + } + const hours = Math.floor(seconds / 3600) + const minutes = Math.floor((seconds % 3600) / 60) + if (hours >= 1) return `${hours} ${hours === 1 ? "hour" : "hours"} ${minutes} ${minutes === 1 ? "minute" : "minutes"}` + if (minutes === 0) return "a few seconds" + return `${minutes} ${minutes === 1 ? "minute" : "minutes"}` +} + +const cancelWaitlist = action(async (workspaceID: string) => { + "use server" + return json( + await withActor(async () => { + await Database.use((tx) => + tx + .update(BillingTable) + .set({ + subscriptionPlan: null, + timeSubscriptionBooked: null, + timeSubscriptionSelected: null, + }) + .where(eq(BillingTable.workspaceID, workspaceID)), + ) + return { error: undefined } + }, workspaceID).catch((e) => ({ error: e.message as string })), + { revalidate: [queryBillingInfo.key, querySubscription.key] }, + ) +}, "cancelWaitlist") + +const enroll = action(async (workspaceID: string) => { + "use server" + return json( + await withActor(async () => { + await Billing.subscribe({ seats: 1 }) + return { error: undefined } + }, workspaceID).catch((e) => ({ error: e.message as string })), + { revalidate: [queryBillingInfo.key, querySubscription.key] }, + ) +}, "enroll") + +const createSessionUrl = action(async (workspaceID: string, returnUrl: string) => { + "use server" + return json( + await withActor( + () => + Billing.generateSessionUrl({ returnUrl }) + .then((data) => ({ error: undefined, data })) + .catch((e) => ({ + error: e.message as string, + data: undefined, + })), + workspaceID, + ), + { revalidate: [queryBillingInfo.key, querySubscription.key] }, + ) +}, "sessionUrl") + +export function BlackSection() { + const params = useParams() + const billing = createAsync(() => queryBillingInfo(params.id!)) + const subscription = createAsync(() => querySubscription(params.id!)) + const sessionAction = useAction(createSessionUrl) + const sessionSubmission = useSubmission(createSessionUrl) + const cancelAction = useAction(cancelWaitlist) + const cancelSubmission = useSubmission(cancelWaitlist) + const enrollAction = useAction(enroll) + const enrollSubmission = useSubmission(enroll) + const [store, setStore] = createStore({ + sessionRedirecting: false, + cancelled: false, + enrolled: false, + }) + + async function onClickSession() { + const result = await sessionAction(params.id!, window.location.href) + if (result.data) { + setStore("sessionRedirecting", true) + window.location.href = result.data + } + } + + async function onClickCancel() { + const result = await cancelAction(params.id!) + if (!result.error) { + setStore("cancelled", true) + } + } + + async function onClickEnroll() { + const result = await enrollAction(params.id!) + if (!result.error) { + setStore("enrolled", true) + } + } + + return ( + <> + + {(sub) => ( +
    +
    +

    Subscription

    +
    +

    You are subscribed to OpenCode Black for ${sub().plan} per month.

    + +
    +
    +
    +
    +
    + 5-hour Usage + {sub().rollingUsage.usagePercent}% +
    +
    +
    +
    + Resets in {formatResetTime(sub().rollingUsage.resetInSec)} +
    +
    +
    + Weekly Usage + {sub().weeklyUsage.usagePercent}% +
    +
    +
    +
    + Resets in {formatResetTime(sub().weeklyUsage.resetInSec)} +
    +
    +
    + )} +
    + +
    +
    +

    Waitlist

    +
    +

    + {billing()?.timeSubscriptionSelected + ? `We're ready to enroll you into the $${billing()?.subscriptionPlan} per month OpenCode Black plan.` + : `You are on the waitlist for the $${billing()?.subscriptionPlan} per month OpenCode Black plan.`} +

    + +
    +
    + +
    + +

    + When you click Enroll, your subscription starts immediately and your card will be charged. +

    +
    +
    +
    +
    + + ) +} diff --git a/packages/console/app/src/routes/workspace/[id]/billing/black-waitlist-section.module.css b/packages/console/app/src/routes/workspace/[id]/billing/black-waitlist-section.module.css new file mode 100644 index 00000000000..685d62c93ba --- /dev/null +++ b/packages/console/app/src/routes/workspace/[id]/billing/black-waitlist-section.module.css @@ -0,0 +1,23 @@ +.root { + [data-slot="title-row"] { + display: flex; + justify-content: space-between; + align-items: center; + gap: var(--space-4); + } + + [data-slot="enroll-section"] { + display: flex; + flex-direction: column; + gap: var(--space-3); + } + + [data-slot="enroll-button"] { + align-self: flex-start; + } + + [data-slot="enroll-note"] { + font-size: var(--font-size-sm); + color: var(--color-text-muted); + } +} diff --git a/packages/console/app/src/routes/workspace/[id]/billing/index.tsx b/packages/console/app/src/routes/workspace/[id]/billing/index.tsx index feb646514de..a252a02344e 100644 --- a/packages/console/app/src/routes/workspace/[id]/billing/index.tsx +++ b/packages/console/app/src/routes/workspace/[id]/billing/index.tsx @@ -2,19 +2,23 @@ import { MonthlyLimitSection } from "./monthly-limit-section" import { BillingSection } from "./billing-section" import { ReloadSection } from "./reload-section" import { PaymentSection } from "./payment-section" +import { BlackSection } from "./black-section" import { Show } from "solid-js" import { createAsync, useParams } from "@solidjs/router" import { queryBillingInfo, querySessionInfo } from "../../common" export default function () { const params = useParams() - const userInfo = createAsync(() => querySessionInfo(params.id!)) + const sessionInfo = createAsync(() => querySessionInfo(params.id!)) const billingInfo = createAsync(() => queryBillingInfo(params.id!)) return (
    - + + + + diff --git a/packages/console/app/src/routes/workspace/[id]/billing/payment-section.module.css b/packages/console/app/src/routes/workspace/[id]/billing/payment-section.module.css index 2e1afe78bcc..6452484ed38 100644 --- a/packages/console/app/src/routes/workspace/[id]/billing/payment-section.module.css +++ b/packages/console/app/src/routes/workspace/[id]/billing/payment-section.module.css @@ -45,6 +45,19 @@ text-decoration: line-through; } } + + &[data-slot="payment-receipt"] { + span { + display: inline-block; + padding: var(--space-3) var(--space-4); + font-size: var(--font-size-sm); + line-height: 1.5; + } + + button { + font-size: var(--font-size-sm); + } + } } tbody tr { @@ -61,13 +74,17 @@ } th { - &:nth-child(2) /* Payment ID */ { + &:nth-child(2) + + /* Payment ID */ { display: none; } } td { - &:nth-child(2) /* Payment ID */ { + &:nth-child(2) + + /* Payment ID */ { display: none; } } diff --git a/packages/console/app/src/routes/workspace/[id]/billing/payment-section.tsx b/packages/console/app/src/routes/workspace/[id]/billing/payment-section.tsx index 3712513bfe7..d21c4edce92 100644 --- a/packages/console/app/src/routes/workspace/[id]/billing/payment-section.tsx +++ b/packages/console/app/src/routes/workspace/[id]/billing/payment-section.tsx @@ -1,6 +1,6 @@ import { Billing } from "@opencode-ai/console-core/billing.js" import { query, action, useParams, createAsync, useAction } from "@solidjs/router" -import { For, Show } from "solid-js" +import { For, Match, Show, Switch } from "solid-js" import { withActor } from "~/context/auth.withActor" import { formatDateUTC, formatDateForTable } from "../../common" import styles from "./payment-section.module.css" @@ -77,6 +77,8 @@ export function PaymentSection() { {(payment) => { const date = new Date(payment.timeCreated) + const amount = + payment.enrichment?.type === "subscription" && payment.enrichment.couponID ? 0 : payment.amount return ( @@ -84,20 +86,28 @@ export function PaymentSection() { {payment.id} - ${((payment.amount ?? 0) / 100000000).toFixed(2)} + ${((amount ?? 0) / 100000000).toFixed(2)} + + (credit) + (subscription) + - + {payment.paymentID ? ( + + ) : ( + - + )} ) diff --git a/packages/console/app/src/routes/workspace/[id]/billing/reload-section.tsx b/packages/console/app/src/routes/workspace/[id]/billing/reload-section.tsx index 99b5939669a..b099e900e6b 100644 --- a/packages/console/app/src/routes/workspace/[id]/billing/reload-section.tsx +++ b/packages/console/app/src/routes/workspace/[id]/billing/reload-section.tsx @@ -1,5 +1,5 @@ import { json, action, useParams, createAsync, useSubmission } from "@solidjs/router" -import { createEffect, Show } from "solid-js" +import { createEffect, Show, createMemo } from "solid-js" import { createStore } from "solid-js/store" import { withActor } from "~/context/auth.withActor" import { Billing } from "@opencode-ai/console-core/billing.js" @@ -68,6 +68,12 @@ export function ReloadSection() { reloadTrigger: "", }) + const processingFee = createMemo(() => { + const reloadAmount = billingInfo()?.reloadAmount + if (!reloadAmount) return "0.00" + return (((reloadAmount + 0.3) / 0.956) * 0.044 + 0.3).toFixed(2) + }) + createEffect(() => { if (!setReloadSubmission.pending && setReloadSubmission.result && !(setReloadSubmission.result as any).error) { setStore("show", false) @@ -104,8 +110,8 @@ export function ReloadSection() { } >

    - Auto reload is enabled. We'll reload ${billingInfo()?.reloadAmount} (+$1.23 processing fee) - when balance reaches ${billingInfo()?.reloadTrigger}. + Auto reload is enabled. We'll reload ${billingInfo()?.reloadAmount} (+${processingFee()}{" "} + processing fee) when balance reaches ${billingInfo()?.reloadTrigger}.

    - } - > - - Current balance ${balance()} - -
    + + + + Current balance ${balance()} + + +

    diff --git a/packages/console/app/src/routes/workspace/[id]/model-section.tsx b/packages/console/app/src/routes/workspace/[id]/model-section.tsx index e760ccea25a..38813d276b5 100644 --- a/packages/console/app/src/routes/workspace/[id]/model-section.tsx +++ b/packages/console/app/src/routes/workspace/[id]/model-section.tsx @@ -9,6 +9,7 @@ import { IconAlibaba, IconAnthropic, IconGemini, + IconMiniMax, IconMoonshotAI, IconOpenAI, IconStealth, @@ -23,6 +24,7 @@ const getModelLab = (modelId: string) => { if (modelId.startsWith("kimi")) return "Moonshot AI" if (modelId.startsWith("glm")) return "Z.ai" if (modelId.startsWith("qwen")) return "Alibaba" + if (modelId.startsWith("minimax")) return "MiniMax" if (modelId.startsWith("grok")) return "xAI" return "Stealth" } @@ -35,7 +37,7 @@ const getModelsInfo = query(async (workspaceID: string) => { .filter(([id, _model]) => !["claude-3-5-haiku"].includes(id)) .filter(([id, _model]) => !id.startsWith("alpha-")) .sort(([idA, modelA], [idB, modelB]) => { - const priority = ["big-pickle", "grok", "claude", "gpt", "gemini"] + const priority = ["big-pickle", "minimax", "grok", "claude", "gpt", "gemini"] const getPriority = (id: string) => { const index = priority.findIndex((p) => id.startsWith(p)) return index === -1 ? Infinity : index @@ -129,6 +131,8 @@ export function ModelSection() { return case "xAI": return + case "MiniMax": + return default: return } diff --git a/packages/console/app/src/routes/workspace/[id]/usage-section.module.css b/packages/console/app/src/routes/workspace/[id]/usage-section.module.css index 83c783a2f6f..00232de88f7 100644 --- a/packages/console/app/src/routes/workspace/[id]/usage-section.module.css +++ b/packages/console/app/src/routes/workspace/[id]/usage-section.module.css @@ -42,7 +42,7 @@ font-family: var(--font-mono); &[data-slot="usage-date"] { - color: var(--color-text); + color: var(--color-text-muted); } &[data-slot="usage-model"] { @@ -53,8 +53,7 @@ } &[data-slot="usage-cost"] { - color: var(--color-text); - font-weight: 500; + color: var(--color-text-muted); } [data-slot="tokens-with-breakdown"] { diff --git a/packages/console/app/src/routes/workspace/[id]/usage-section.tsx b/packages/console/app/src/routes/workspace/[id]/usage-section.tsx index 8ba5dfdbd16..3b02b1e7dfa 100644 --- a/packages/console/app/src/routes/workspace/[id]/usage-section.tsx +++ b/packages/console/app/src/routes/workspace/[id]/usage-section.tsx @@ -169,7 +169,14 @@ export function UsageSection() {
    - ${((usage.cost ?? 0) / 100000000).toFixed(4)} + + ${((usage.cost ?? 0) / 100000000).toFixed(4)}} + > + subscription (${((usage.cost ?? 0) / 100000000).toFixed(4)}) + + ) }} diff --git a/packages/console/app/src/routes/workspace/common.tsx b/packages/console/app/src/routes/workspace/common.tsx index a6eaaeb1eb7..b5a90f74924 100644 --- a/packages/console/app/src/routes/workspace/common.tsx +++ b/packages/console/app/src/routes/workspace/common.tsx @@ -3,7 +3,6 @@ import { Actor } from "@opencode-ai/console-core/actor.js" import { action, json, query } from "@solidjs/router" import { withActor } from "~/context/auth.withActor" import { Billing } from "@opencode-ai/console-core/billing.js" -import { User } from "@opencode-ai/console-core/user.js" import { and, Database, desc, eq, isNull } from "@opencode-ai/console-core/drizzle/index.js" import { WorkspaceTable } from "@opencode-ai/console-core/schema/workspace.sql.js" import { UserTable } from "@opencode-ai/console-core/schema/user.sql.js" @@ -96,11 +95,25 @@ export const queryBillingInfo = query(async (workspaceID: string) => { return withActor(async () => { const billing = await Billing.get() return { - ...billing, + customerID: billing.customerID, + paymentMethodID: billing.paymentMethodID, + paymentMethodType: billing.paymentMethodType, + paymentMethodLast4: billing.paymentMethodLast4, + balance: billing.balance, + reload: billing.reload, reloadAmount: billing.reloadAmount ?? Billing.RELOAD_AMOUNT, reloadAmountMin: Billing.RELOAD_AMOUNT_MIN, reloadTrigger: billing.reloadTrigger ?? Billing.RELOAD_TRIGGER, reloadTriggerMin: Billing.RELOAD_TRIGGER_MIN, + monthlyLimit: billing.monthlyLimit, + monthlyUsage: billing.monthlyUsage, + timeMonthlyUsageUpdated: billing.timeMonthlyUsageUpdated, + reloadError: billing.reloadError, + timeReloadError: billing.timeReloadError, + subscriptionID: billing.subscriptionID, + subscriptionPlan: billing.subscriptionPlan, + timeSubscriptionBooked: billing.timeSubscriptionBooked, + timeSubscriptionSelected: billing.timeSubscriptionSelected, } }, workspaceID) }, "billing.get") diff --git a/packages/console/app/src/routes/zen/index.tsx b/packages/console/app/src/routes/zen/index.tsx index 6b163315c6f..5708c238cde 100644 --- a/packages/console/app/src/routes/zen/index.tsx +++ b/packages/console/app/src/routes/zen/index.tsx @@ -1,7 +1,7 @@ import "./index.css" import { createAsync, query, redirect } from "@solidjs/router" import { Title, Meta, Link } from "@solidjs/meta" -// import { HttpHeader } from "@solidjs/start" +//import { HttpHeader } from "@solidjs/start" import zenLogoLight from "../../asset/zen-ornate-light.svg" import { config } from "~/config" import zenLogoDark from "../../asset/zen-ornate-dark.svg" diff --git a/packages/console/app/src/routes/zen/util/dataDumper.ts b/packages/console/app/src/routes/zen/util/dataDumper.ts index 155cc6c58b6..b852ca0b5c0 100644 --- a/packages/console/app/src/routes/zen/util/dataDumper.ts +++ b/packages/console/app/src/routes/zen/util/dataDumper.ts @@ -19,17 +19,23 @@ export function createDataDumper(sessionId: string, requestId: string, projectId if (!data.modelName) return const timestamp = new Date().toISOString().replace(/[^0-9]/g, "") + const year = timestamp.substring(0, 4) + const month = timestamp.substring(4, 6) + const day = timestamp.substring(6, 8) + const hour = timestamp.substring(8, 10) + const minute = timestamp.substring(10, 12) + const second = timestamp.substring(12, 14) waitUntil( - Resource.ZenData.put( - `data/${data.modelName}/${sessionId}/${requestId}.json`, + Resource.ZenDataNew.put( + `data/${data.modelName}/${year}/${month}/${day}/${hour}/${minute}/${second}/${requestId}.json`, JSON.stringify({ timestamp, ...data }), ), ) waitUntil( - Resource.ZenData.put( - `meta/${data.modelName}/${timestamp}/${requestId}.json`, + Resource.ZenDataNew.put( + `meta/${data.modelName}/${sessionId}/${requestId}.json`, JSON.stringify({ timestamp, ...metadata }), ), ) diff --git a/packages/console/app/src/routes/zen/util/error.ts b/packages/console/app/src/routes/zen/util/error.ts index f1e1314683c..b97b7343074 100644 --- a/packages/console/app/src/routes/zen/util/error.ts +++ b/packages/console/app/src/routes/zen/util/error.ts @@ -1,6 +1,13 @@ export class AuthError extends Error {} export class CreditsError extends Error {} export class MonthlyLimitError extends Error {} +export class SubscriptionError extends Error { + retryAfter?: number + constructor(message: string, retryAfter?: number) { + super(message) + this.retryAfter = retryAfter + } +} export class UserLimitError extends Error {} export class ModelError extends Error {} export class RateLimitError extends Error {} diff --git a/packages/console/app/src/routes/zen/util/handler.ts b/packages/console/app/src/routes/zen/util/handler.ts index 5e9c877cc39..18571d6b257 100644 --- a/packages/console/app/src/routes/zen/util/handler.ts +++ b/packages/console/app/src/routes/zen/util/handler.ts @@ -1,18 +1,28 @@ import type { APIEvent } from "@solidjs/start/server" import { and, Database, eq, isNull, lt, or, sql } from "@opencode-ai/console-core/drizzle/index.js" import { KeyTable } from "@opencode-ai/console-core/schema/key.sql.js" -import { BillingTable, UsageTable } from "@opencode-ai/console-core/schema/billing.sql.js" +import { BillingTable, SubscriptionTable, UsageTable } from "@opencode-ai/console-core/schema/billing.sql.js" import { centsToMicroCents } from "@opencode-ai/console-core/util/price.js" +import { getWeekBounds } from "@opencode-ai/console-core/util/date.js" import { Identifier } from "@opencode-ai/console-core/identifier.js" import { Billing } from "@opencode-ai/console-core/billing.js" import { Actor } from "@opencode-ai/console-core/actor.js" import { WorkspaceTable } from "@opencode-ai/console-core/schema/workspace.sql.js" import { ZenData } from "@opencode-ai/console-core/model.js" +import { Black, BlackData } from "@opencode-ai/console-core/black.js" import { UserTable } from "@opencode-ai/console-core/schema/user.sql.js" import { ModelTable } from "@opencode-ai/console-core/schema/model.sql.js" import { ProviderTable } from "@opencode-ai/console-core/schema/provider.sql.js" import { logger } from "./logger" -import { AuthError, CreditsError, MonthlyLimitError, UserLimitError, ModelError, RateLimitError } from "./error" +import { + AuthError, + CreditsError, + MonthlyLimitError, + SubscriptionError, + UserLimitError, + ModelError, + RateLimitError, +} from "./error" import { createBodyConverter, createStreamPartConverter, createResponseConverter, UsageInfo } from "./provider/provider" import { anthropicHelper } from "./provider/anthropic" import { googleHelper } from "./provider/google" @@ -69,14 +79,15 @@ export async function handler( const dataDumper = createDataDumper(sessionId, requestId, projectId) const trialLimiter = createTrialLimiter(modelInfo.trial, ip, ocClient) const isTrial = await trialLimiter?.isTrial() - const rateLimiter = createRateLimiter(modelInfo.id, modelInfo.rateLimit, ip) + const rateLimiter = createRateLimiter(modelInfo.rateLimit, ip) await rateLimiter?.check() - const stickyTracker = createStickyTracker(modelInfo.stickyProvider ?? false, sessionId) + const stickyTracker = createStickyTracker(modelInfo.stickyProvider, sessionId) const stickyProvider = await stickyTracker?.get() + const authInfo = await authenticate(modelInfo) const retriableRequest = async (retry: RetryOptions = { excludeProviders: [], retryCount: 0 }) => { - const authInfo = await authenticate(modelInfo) const providerInfo = selectProvider( + model, zenData, authInfo, modelInfo, @@ -91,7 +102,7 @@ export async function handler( logger.metric({ provider: providerInfo.id }) const startTimestamp = Date.now() - const reqUrl = providerInfo.modifyUrl(providerInfo.api, providerInfo.model, isStream) + const reqUrl = providerInfo.modifyUrl(providerInfo.api, isStream) const reqBody = JSON.stringify( providerInfo.modifyBody({ ...createBodyConverter(opts.format, providerInfo.format)(body), @@ -112,23 +123,33 @@ export async function handler( headers.delete("content-length") headers.delete("x-opencode-request") headers.delete("x-opencode-session") + headers.delete("x-opencode-project") + headers.delete("x-opencode-client") return headers })(), body: reqBody, }) // Try another provider => stop retrying if using fallback provider - if (res.status !== 200 && modelInfo.fallbackProvider && providerInfo.id !== modelInfo.fallbackProvider) { + if ( + res.status !== 200 && + // ie. openai 404 error: Item with id 'msg_0ead8b004a3b165d0069436a6b6834819896da85b63b196a3f' not found. + res.status !== 404 && + // ie. cannot change codex model providers mid-session + modelInfo.stickyProvider !== "strict" && + modelInfo.fallbackProvider && + providerInfo.id !== modelInfo.fallbackProvider + ) { return retriableRequest({ excludeProviders: [...retry.excludeProviders, providerInfo.id], retryCount: retry.retryCount + 1, }) } - return { providerInfo, authInfo, reqBody, res, startTimestamp } + return { providerInfo, reqBody, res, startTimestamp } } - const { providerInfo, authInfo, reqBody, res, startTimestamp } = await retriableRequest() + const { providerInfo, reqBody, res, startTimestamp } = await retriableRequest() // Store model request dataDumper?.provideModel(providerInfo.storeModel) @@ -137,6 +158,9 @@ export async function handler( // Store sticky provider await stickyTracker?.set(providerInfo.id) + // Temporarily change 404 to 400 status code b/c solid start automatically override 404 response + const resStatus = res.status === 404 ? 400 : res.status + // Scrub response headers const resHeaders = new Headers() const keepHeaders = ["content-type", "cache-control"] @@ -159,10 +183,10 @@ export async function handler( const tokensInfo = providerInfo.normalizeUsage(json.usage) await trialLimiter?.track(tokensInfo) await rateLimiter?.track() - await trackUsage(authInfo, modelInfo, providerInfo, tokensInfo) - await reload(authInfo) + const costInfo = await trackUsage(authInfo, modelInfo, providerInfo, tokensInfo) + await reload(authInfo, costInfo) return new Response(body, { - status: res.status, + status: resStatus, statusText: res.statusText, headers: resHeaders, }) @@ -171,17 +195,19 @@ export async function handler( // Handle streaming response const streamConverter = createStreamPartConverter(providerInfo.format, opts.format) const usageParser = providerInfo.createUsageParser() + const binaryDecoder = providerInfo.createBinaryStreamDecoder() const stream = new ReadableStream({ start(c) { const reader = res.body?.getReader() const decoder = new TextDecoder() const encoder = new TextEncoder() + let buffer = "" let responseLength = 0 function pump(): Promise { return ( - reader?.read().then(async ({ done, value }) => { + reader?.read().then(async ({ done, value: rawValue }) => { if (done) { logger.metric({ response_length: responseLength, @@ -193,8 +219,8 @@ export async function handler( if (usage) { const tokensInfo = providerInfo.normalizeUsage(usage) await trialLimiter?.track(tokensInfo) - await trackUsage(authInfo, modelInfo, providerInfo, tokensInfo) - await reload(authInfo) + const costInfo = await trackUsage(authInfo, modelInfo, providerInfo, tokensInfo) + await reload(authInfo, costInfo) } c.close() return @@ -207,6 +233,10 @@ export async function handler( "timestamp.first_byte": now, }) } + + const value = binaryDecoder ? binaryDecoder(rawValue) : rawValue + if (!value) return + responseLength += value.length buffer += decoder.decode(value, { stream: true }) dataDumper?.provideStream(buffer) @@ -240,7 +270,7 @@ export async function handler( }) return new Response(stream, { - status: res.status, + status: resStatus, statusText: res.statusText, headers: resHeaders, }) @@ -266,14 +296,19 @@ export async function handler( { status: 401 }, ) - if (error instanceof RateLimitError) + if (error instanceof RateLimitError || error instanceof SubscriptionError) { + const headers = new Headers() + if (error instanceof SubscriptionError && error.retryAfter) { + headers.set("retry-after", String(error.retryAfter)) + } return new Response( JSON.stringify({ type: "error", error: { type: error.constructor.name, message: error.message }, }), - { status: 429 }, + { status: 429, headers }, ) + } return new Response( JSON.stringify({ @@ -303,6 +338,7 @@ export async function handler( } function selectProvider( + reqModel: string, zenData: ZenData, authInfo: AuthInfo, modelInfo: ModelInfo, @@ -311,7 +347,7 @@ export async function handler( retry: RetryOptions, stickyProvider: string | undefined, ) { - const provider = (() => { + const modelProvider = (() => { if (authInfo?.provider?.credentials) { return modelInfo.providers.find((provider) => provider.id === modelInfo.byokProvider) } @@ -344,18 +380,19 @@ export async function handler( return providers[index || 0] })() - if (!provider) throw new ModelError("No provider available") - if (!(provider.id in zenData.providers)) throw new ModelError(`Provider ${provider.id} not supported`) + if (!modelProvider) throw new ModelError("No provider available") + if (!(modelProvider.id in zenData.providers)) throw new ModelError(`Provider ${modelProvider.id} not supported`) return { - ...provider, - ...zenData.providers[provider.id], + ...modelProvider, + ...zenData.providers[modelProvider.id], ...(() => { - const format = zenData.providers[provider.id].format - if (format === "anthropic") return anthropicHelper - if (format === "google") return googleHelper - if (format === "openai") return openaiHelper - return oaCompatHelper + const format = zenData.providers[modelProvider.id].format + const providerModel = modelProvider.model + if (format === "anthropic") return anthropicHelper({ reqModel, providerModel }) + if (format === "google") return googleHelper({ reqModel, providerModel }) + if (format === "openai") return openaiHelper({ reqModel, providerModel }) + return oaCompatHelper({ reqModel, providerModel }) })(), } } @@ -379,6 +416,8 @@ export async function handler( monthlyUsage: BillingTable.monthlyUsage, timeMonthlyUsageUpdated: BillingTable.timeMonthlyUsageUpdated, reloadTrigger: BillingTable.reloadTrigger, + timeReloadLockedTill: BillingTable.timeReloadLockedTill, + subscription: BillingTable.subscription, }, user: { id: UserTable.id, @@ -386,6 +425,13 @@ export async function handler( monthlyUsage: UserTable.monthlyUsage, timeMonthlyUsageUpdated: UserTable.timeMonthlyUsageUpdated, }, + subscription: { + id: SubscriptionTable.id, + rollingUsage: SubscriptionTable.rollingUsage, + fixedUsage: SubscriptionTable.fixedUsage, + timeRollingUpdated: SubscriptionTable.timeRollingUpdated, + timeFixedUpdated: SubscriptionTable.timeFixedUpdated, + }, provider: { credentials: ProviderTable.credentials, }, @@ -405,6 +451,14 @@ export async function handler( ) : sql`false`, ) + .leftJoin( + SubscriptionTable, + and( + eq(SubscriptionTable.workspaceID, KeyTable.workspaceID), + eq(SubscriptionTable.userID, KeyTable.userID), + isNull(SubscriptionTable.timeDeleted), + ), + ) .where(and(eq(KeyTable.key, apiKey), isNull(KeyTable.timeDeleted))) .then((rows) => rows[0]), ) @@ -413,6 +467,8 @@ export async function handler( logger.metric({ api_key: data.apiKey, workspace: data.workspaceID, + isSubscription: data.subscription ? true : false, + subscription: data.billing.subscription?.plan, }) return { @@ -420,6 +476,7 @@ export async function handler( workspaceID: data.workspaceID, billing: data.billing, user: data.user, + subscription: data.subscription, provider: data.provider, isFree: FREE_WORKSPACES.includes(data.workspaceID), isDisabled: !!data.timeDisabled, @@ -432,6 +489,52 @@ export async function handler( if (authInfo.isFree) return if (modelInfo.allowAnonymous) return + // Validate subscription billing + if (authInfo.billing.subscription && authInfo.subscription) { + const sub = authInfo.subscription + const plan = authInfo.billing.subscription.plan + + const formatRetryTime = (seconds: number) => { + const days = Math.floor(seconds / 86400) + if (days >= 1) return `${days} day${days > 1 ? "s" : ""}` + const hours = Math.floor(seconds / 3600) + const minutes = Math.ceil((seconds % 3600) / 60) + if (hours >= 1) return `${hours}hr ${minutes}min` + return `${minutes}min` + } + + // Check weekly limit + if (sub.fixedUsage && sub.timeFixedUpdated) { + const result = Black.analyzeWeeklyUsage({ + plan, + usage: sub.fixedUsage, + timeUpdated: sub.timeFixedUpdated, + }) + if (result.status === "rate-limited") + throw new SubscriptionError( + `Subscription quota exceeded. Retry in ${formatRetryTime(result.resetInSec)}.`, + result.resetInSec, + ) + } + + // Check rolling limit + if (sub.rollingUsage && sub.timeRollingUpdated) { + const result = Black.analyzeRollingUsage({ + plan, + usage: sub.rollingUsage, + timeUpdated: sub.timeRollingUpdated, + }) + if (result.status === "rate-limited") + throw new SubscriptionError( + `Subscription quota exceeded. Retry in ${formatRetryTime(result.resetInSec)}.`, + result.resetInSec, + ) + } + + return + } + + // Validate pay as you go billing const billing = authInfo.billing if (!billing.paymentMethodID) throw new CreditsError( @@ -449,29 +552,25 @@ export async function handler( billing.monthlyLimit && billing.monthlyUsage && billing.timeMonthlyUsageUpdated && - billing.monthlyUsage >= centsToMicroCents(billing.monthlyLimit * 100) - ) { - const dateYear = billing.timeMonthlyUsageUpdated.getUTCFullYear() - const dateMonth = billing.timeMonthlyUsageUpdated.getUTCMonth() - if (currentYear === dateYear && currentMonth === dateMonth) - throw new MonthlyLimitError( - `Your workspace has reached its monthly spending limit of $${billing.monthlyLimit}. Manage your limits here: https://opencode.ai/workspace/${authInfo.workspaceID}/billing`, - ) - } + billing.monthlyUsage >= centsToMicroCents(billing.monthlyLimit * 100) && + currentYear === billing.timeMonthlyUsageUpdated.getUTCFullYear() && + currentMonth === billing.timeMonthlyUsageUpdated.getUTCMonth() + ) + throw new MonthlyLimitError( + `Your workspace has reached its monthly spending limit of $${billing.monthlyLimit}. Manage your limits here: https://opencode.ai/workspace/${authInfo.workspaceID}/billing`, + ) if ( authInfo.user.monthlyLimit && authInfo.user.monthlyUsage && authInfo.user.timeMonthlyUsageUpdated && - authInfo.user.monthlyUsage >= centsToMicroCents(authInfo.user.monthlyLimit * 100) - ) { - const dateYear = authInfo.user.timeMonthlyUsageUpdated.getUTCFullYear() - const dateMonth = authInfo.user.timeMonthlyUsageUpdated.getUTCMonth() - if (currentYear === dateYear && currentMonth === dateMonth) - throw new UserLimitError( - `You have reached your monthly spending limit of $${authInfo.user.monthlyLimit}. Manage your limits here: https://opencode.ai/workspace/${authInfo.workspaceID}/members`, - ) - } + authInfo.user.monthlyUsage >= centsToMicroCents(authInfo.user.monthlyLimit * 100) && + currentYear === authInfo.user.timeMonthlyUsageUpdated.getUTCFullYear() && + currentMonth === authInfo.user.timeMonthlyUsageUpdated.getUTCMonth() + ) + throw new UserLimitError( + `You have reached your monthly spending limit of $${authInfo.user.monthlyLimit}. Manage your limits here: https://opencode.ai/workspace/${authInfo.workspaceID}/members`, + ) } function validateModelSettings(authInfo: AuthInfo) { @@ -546,61 +645,112 @@ export async function handler( if (!authInfo) return - const cost = authInfo.isFree || authInfo.provider?.credentials ? 0 : centsToMicroCents(totalCostInCent) - await Database.transaction(async (tx) => { - await tx.insert(UsageTable).values({ - workspaceID: authInfo.workspaceID, - id: Identifier.create("usage"), - model: modelInfo.id, - provider: providerInfo.id, - inputTokens, - outputTokens, - reasoningTokens, - cacheReadTokens, - cacheWrite5mTokens, - cacheWrite1hTokens, - cost, - keyID: authInfo.apiKeyId, - }) - await tx - .update(BillingTable) - .set({ - balance: sql`${BillingTable.balance} - ${cost}`, - monthlyUsage: sql` + const cost = authInfo.provider?.credentials ? 0 : centsToMicroCents(totalCostInCent) + await Database.use((db) => + Promise.all([ + db.insert(UsageTable).values({ + workspaceID: authInfo.workspaceID, + id: Identifier.create("usage"), + model: modelInfo.id, + provider: providerInfo.id, + inputTokens, + outputTokens, + reasoningTokens, + cacheReadTokens, + cacheWrite5mTokens, + cacheWrite1hTokens, + cost, + keyID: authInfo.apiKeyId, + enrichment: authInfo.subscription ? { plan: "sub" } : undefined, + }), + db + .update(KeyTable) + .set({ timeUsed: sql`now()` }) + .where(and(eq(KeyTable.workspaceID, authInfo.workspaceID), eq(KeyTable.id, authInfo.apiKeyId))), + ...(authInfo.subscription + ? (() => { + const plan = authInfo.billing.subscription!.plan + const black = BlackData.getLimits({ plan }) + const week = getWeekBounds(new Date()) + const rollingWindowSeconds = black.rollingWindow * 3600 + return [ + db + .update(SubscriptionTable) + .set({ + fixedUsage: sql` + CASE + WHEN ${SubscriptionTable.timeFixedUpdated} >= ${week.start} THEN ${SubscriptionTable.fixedUsage} + ${cost} + ELSE ${cost} + END + `, + timeFixedUpdated: sql`now()`, + rollingUsage: sql` + CASE + WHEN UNIX_TIMESTAMP(${SubscriptionTable.timeRollingUpdated}) >= UNIX_TIMESTAMP(now()) - ${rollingWindowSeconds} THEN ${SubscriptionTable.rollingUsage} + ${cost} + ELSE ${cost} + END + `, + timeRollingUpdated: sql` + CASE + WHEN UNIX_TIMESTAMP(${SubscriptionTable.timeRollingUpdated}) >= UNIX_TIMESTAMP(now()) - ${rollingWindowSeconds} THEN ${SubscriptionTable.timeRollingUpdated} + ELSE now() + END + `, + }) + .where( + and( + eq(SubscriptionTable.workspaceID, authInfo.workspaceID), + eq(SubscriptionTable.userID, authInfo.user.id), + ), + ), + ] + })() + : [ + db + .update(BillingTable) + .set({ + balance: authInfo.isFree + ? sql`${BillingTable.balance} - ${0}` + : sql`${BillingTable.balance} - ${cost}`, + monthlyUsage: sql` CASE WHEN MONTH(${BillingTable.timeMonthlyUsageUpdated}) = MONTH(now()) AND YEAR(${BillingTable.timeMonthlyUsageUpdated}) = YEAR(now()) THEN ${BillingTable.monthlyUsage} + ${cost} ELSE ${cost} END `, - timeMonthlyUsageUpdated: sql`now()`, - }) - .where(eq(BillingTable.workspaceID, authInfo.workspaceID)) - await tx - .update(UserTable) - .set({ - monthlyUsage: sql` + timeMonthlyUsageUpdated: sql`now()`, + }) + .where(eq(BillingTable.workspaceID, authInfo.workspaceID)), + db + .update(UserTable) + .set({ + monthlyUsage: sql` CASE WHEN MONTH(${UserTable.timeMonthlyUsageUpdated}) = MONTH(now()) AND YEAR(${UserTable.timeMonthlyUsageUpdated}) = YEAR(now()) THEN ${UserTable.monthlyUsage} + ${cost} ELSE ${cost} END `, - timeMonthlyUsageUpdated: sql`now()`, - }) - .where(and(eq(UserTable.workspaceID, authInfo.workspaceID), eq(UserTable.id, authInfo.user.id))) - }) - - await Database.use((tx) => - tx - .update(KeyTable) - .set({ timeUsed: sql`now()` }) - .where(and(eq(KeyTable.workspaceID, authInfo.workspaceID), eq(KeyTable.id, authInfo.apiKeyId))), + timeMonthlyUsageUpdated: sql`now()`, + }) + .where(and(eq(UserTable.workspaceID, authInfo.workspaceID), eq(UserTable.id, authInfo.user.id))), + ]), + ]), ) + + return { costInMicroCents: cost } } - async function reload(authInfo: AuthInfo) { + async function reload(authInfo: AuthInfo, costInfo: Awaited>) { if (!authInfo) return if (authInfo.isFree) return if (authInfo.provider?.credentials) return + if (authInfo.subscription) return + + if (!costInfo) return + + const reloadTrigger = centsToMicroCents((authInfo.billing.reloadTrigger ?? Billing.RELOAD_TRIGGER) * 100) + if (authInfo.billing.balance - costInfo.costInMicroCents >= reloadTrigger) return + if (authInfo.billing.timeReloadLockedTill && authInfo.billing.timeReloadLockedTill > new Date()) return const lock = await Database.use((tx) => tx @@ -612,10 +762,7 @@ export async function handler( and( eq(BillingTable.workspaceID, authInfo.workspaceID), eq(BillingTable.reload, true), - lt( - BillingTable.balance, - centsToMicroCents((authInfo.billing.reloadTrigger ?? Billing.RELOAD_TRIGGER) * 100), - ), + lt(BillingTable.balance, reloadTrigger), or(isNull(BillingTable.timeReloadLockedTill), lt(BillingTable.timeReloadLockedTill, sql`now()`)), ), ), diff --git a/packages/console/app/src/routes/zen/util/provider/anthropic.ts b/packages/console/app/src/routes/zen/util/provider/anthropic.ts index 887a6e4b5e2..a5f92a29acf 100644 --- a/packages/console/app/src/routes/zen/util/provider/anthropic.ts +++ b/packages/console/app/src/routes/zen/util/provider/anthropic.ts @@ -1,4 +1,6 @@ +import { EventStreamCodec } from "@smithy/eventstream-codec" import { ProviderHelper, CommonRequest, CommonResponse, CommonChunk } from "./provider" +import { fromUtf8, toUtf8 } from "@smithy/util-utf8" type Usage = { cache_creation?: { @@ -14,65 +16,169 @@ type Usage = { } } -export const anthropicHelper = { - format: "anthropic", - modifyUrl: (providerApi: string) => providerApi + "/messages", - modifyHeaders: (headers: Headers, body: Record, apiKey: string) => { - headers.set("x-api-key", apiKey) - headers.set("anthropic-version", headers.get("anthropic-version") ?? "2023-06-01") - if (body.model.startsWith("claude-sonnet-")) { - headers.set("anthropic-beta", "context-1m-2025-08-07") - } - }, - modifyBody: (body: Record) => { - return { +export const anthropicHelper: ProviderHelper = ({ reqModel, providerModel }) => { + const isBedrockModelArn = providerModel.startsWith("arn:aws:bedrock:") + const isBedrockModelID = providerModel.startsWith("global.anthropic.") + const isBedrock = isBedrockModelArn || isBedrockModelID + const isSonnet = reqModel.includes("sonnet") + return { + format: "anthropic", + modifyUrl: (providerApi: string, isStream?: boolean) => + isBedrock + ? `${providerApi}/model/${isBedrockModelArn ? encodeURIComponent(providerModel) : providerModel}/${isStream ? "invoke-with-response-stream" : "invoke"}` + : providerApi + "/messages", + modifyHeaders: (headers: Headers, body: Record, apiKey: string) => { + if (isBedrock) { + headers.set("Authorization", `Bearer ${apiKey}`) + } else { + headers.set("x-api-key", apiKey) + headers.set("anthropic-version", headers.get("anthropic-version") ?? "2023-06-01") + if (body.model.startsWith("claude-sonnet-")) { + headers.set("anthropic-beta", "context-1m-2025-08-07") + } + } + }, + modifyBody: (body: Record) => ({ ...body, - service_tier: "standard_only", - } - }, - streamSeparator: "\n\n", - createUsageParser: () => { - let usage: Usage - - return { - parse: (chunk: string) => { - const data = chunk.split("\n")[1] - if (!data.startsWith("data: ")) return - - let json - try { - json = JSON.parse(data.slice(6)) - } catch (e) { - return + ...(isBedrock + ? { + anthropic_version: "bedrock-2023-05-31", + anthropic_beta: isSonnet ? "context-1m-2025-08-07" : undefined, + model: undefined, + stream: undefined, + } + : { + service_tier: "standard_only", + }), + }), + createBinaryStreamDecoder: () => { + if (!isBedrock) return undefined + + const decoder = new TextDecoder() + const encoder = new TextEncoder() + const codec = new EventStreamCodec(toUtf8, fromUtf8) + let buffer = new Uint8Array(0) + return (value: Uint8Array) => { + const newBuffer = new Uint8Array(buffer.length + value.length) + newBuffer.set(buffer) + newBuffer.set(value, buffer.length) + buffer = newBuffer + + const messages = [] + while (buffer.length >= 4) { + // first 4 bytes are the total length (big-endian) + const totalLength = new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength).getUint32(0, false) + + // wait for more chunks + if (buffer.length < totalLength) break + + try { + const subView = buffer.subarray(0, totalLength) + const decoded = codec.decode(subView) + buffer = buffer.slice(totalLength) + + /* Example of Bedrock data + ``` + { + bytes: 'eyJ0eXBlIjoibWVzc2FnZV9zdGFydCIsIm1lc3NhZ2UiOnsibW9kZWwiOiJjbGF1ZGUtb3B1cy00LTUtMjAyNTExMDEiLCJpZCI6Im1zZ19iZHJrXzAxMjVGdHRGb2lkNGlwWmZ4SzZMbktxeCIsInR5cGUiOiJtZXNzYWdlIiwicm9sZSI6ImFzc2lzdGFudCIsImNvbnRlbnQiOltdLCJzdG9wX3JlYXNvbiI6bnVsbCwic3RvcF9zZXF1ZW5jZSI6bnVsbCwidXNhZ2UiOnsiaW5wdXRfdG9rZW5zIjo0LCJjYWNoZV9jcmVhdGlvbl9pbnB1dF90b2tlbnMiOjEsImNhY2hlX3JlYWRfaW5wdXRfdG9rZW5zIjoxMTk2MywiY2FjaGVfY3JlYXRpb24iOnsiZXBoZW1lcmFsXzVtX2lucHV0X3Rva2VucyI6MSwiZXBoZW1lcmFsXzFoX2lucHV0X3Rva2VucyI6MH0sIm91dHB1dF90b2tlbnMiOjF9fX0=', + p: '...' } - - const usageUpdate = json.usage ?? json.message?.usage - if (!usageUpdate) return - usage = { - ...usage, - ...usageUpdate, - cache_creation: { - ...usage?.cache_creation, - ...usageUpdate.cache_creation, - }, - server_tool_use: { - ...usage?.server_tool_use, - ...usageUpdate.server_tool_use, - }, + ``` + + Decoded bytes + ``` + { + type: 'message_start', + message: { + model: 'claude-opus-4-5-20251101', + id: 'msg_bdrk_0125FttFoid4ipZfxK6LnKqx', + type: 'message', + role: 'assistant', + content: [], + stop_reason: null, + stop_sequence: null, + usage: { + input_tokens: 4, + cache_creation_input_tokens: 1, + cache_read_input_tokens: 11963, + cache_creation: [Object], + output_tokens: 1 + } + } } - }, - retrieve: () => usage, - } - }, - normalizeUsage: (usage: Usage) => ({ - inputTokens: usage.input_tokens ?? 0, - outputTokens: usage.output_tokens ?? 0, - reasoningTokens: undefined, - cacheReadTokens: usage.cache_read_input_tokens ?? undefined, - cacheWrite5mTokens: usage.cache_creation?.ephemeral_5m_input_tokens ?? undefined, - cacheWrite1hTokens: usage.cache_creation?.ephemeral_1h_input_tokens ?? undefined, - }), -} satisfies ProviderHelper + ``` + */ + + /* Example of Anthropic data + ``` + event: message_delta + data: {"type":"message_start","message":{"model":"claude-opus-4-5-20251101","id":"msg_01ETvwVWSKULxzPdkQ1xAnk2","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":3,"cache_creation_input_tokens":11543,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":11543,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}}} + ``` + */ + if (decoded.headers[":message-type"]?.value === "event") { + const data = decoder.decode(decoded.body, { stream: true }) + + const parsedDataResult = JSON.parse(data) + delete parsedDataResult.p + const binary = atob(parsedDataResult.bytes) + const uint8 = Uint8Array.from(binary, (c) => c.charCodeAt(0)) + const bytes = decoder.decode(uint8) + const eventName = JSON.parse(bytes).type + messages.push([`event: ${eventName}`, "\n", `data: ${bytes}`, "\n\n"].join("")) + } + } catch (e) { + console.log("@@@EE@@@") + console.log(e) + break + } + } + return encoder.encode(messages.join("")) + } + }, + streamSeparator: "\n\n", + createUsageParser: () => { + let usage: Usage + + return { + parse: (chunk: string) => { + const data = chunk.split("\n")[1] + if (!data.startsWith("data: ")) return + + let json + try { + json = JSON.parse(data.slice(6)) + } catch (e) { + return + } + + const usageUpdate = json.usage ?? json.message?.usage + if (!usageUpdate) return + usage = { + ...usage, + ...usageUpdate, + cache_creation: { + ...usage?.cache_creation, + ...usageUpdate.cache_creation, + }, + server_tool_use: { + ...usage?.server_tool_use, + ...usageUpdate.server_tool_use, + }, + } + }, + retrieve: () => usage, + } + }, + normalizeUsage: (usage: Usage) => ({ + inputTokens: usage.input_tokens ?? 0, + outputTokens: usage.output_tokens ?? 0, + reasoningTokens: undefined, + cacheReadTokens: usage.cache_read_input_tokens ?? undefined, + cacheWrite5mTokens: usage.cache_creation?.ephemeral_5m_input_tokens ?? undefined, + cacheWrite1hTokens: usage.cache_creation?.ephemeral_1h_input_tokens ?? undefined, + }), + } +} export function fromAnthropicRequest(body: any): CommonRequest { if (!body || typeof body !== "object") return body diff --git a/packages/console/app/src/routes/zen/util/provider/google.ts b/packages/console/app/src/routes/zen/util/provider/google.ts index afde42096c1..f6f7d6e19b2 100644 --- a/packages/console/app/src/routes/zen/util/provider/google.ts +++ b/packages/console/app/src/routes/zen/util/provider/google.ts @@ -26,16 +26,17 @@ type Usage = { thoughtsTokenCount?: number } -export const googleHelper = { +export const googleHelper: ProviderHelper = ({ providerModel }) => ({ format: "google", - modifyUrl: (providerApi: string, model?: string, isStream?: boolean) => - `${providerApi}/models/${model}:${isStream ? "streamGenerateContent?alt=sse" : "generateContent"}`, + modifyUrl: (providerApi: string, isStream?: boolean) => + `${providerApi}/models/${providerModel}:${isStream ? "streamGenerateContent?alt=sse" : "generateContent"}`, modifyHeaders: (headers: Headers, body: Record, apiKey: string) => { headers.set("x-goog-api-key", apiKey) }, modifyBody: (body: Record) => { return body }, + createBinaryStreamDecoder: () => undefined, streamSeparator: "\r\n\r\n", createUsageParser: () => { let usage: Usage @@ -71,4 +72,4 @@ export const googleHelper = { cacheWrite1hTokens: undefined, } }, -} satisfies ProviderHelper +}) diff --git a/packages/console/app/src/routes/zen/util/provider/openai-compatible.ts b/packages/console/app/src/routes/zen/util/provider/openai-compatible.ts index 5771ed4faa1..699243d085f 100644 --- a/packages/console/app/src/routes/zen/util/provider/openai-compatible.ts +++ b/packages/console/app/src/routes/zen/util/provider/openai-compatible.ts @@ -21,7 +21,7 @@ type Usage = { } } -export const oaCompatHelper = { +export const oaCompatHelper: ProviderHelper = () => ({ format: "oa-compat", modifyUrl: (providerApi: string) => providerApi + "/chat/completions", modifyHeaders: (headers: Headers, body: Record, apiKey: string) => { @@ -33,6 +33,7 @@ export const oaCompatHelper = { ...(body.stream ? { stream_options: { include_usage: true } } : {}), } }, + createBinaryStreamDecoder: () => undefined, streamSeparator: "\n\n", createUsageParser: () => { let usage: Usage @@ -68,7 +69,7 @@ export const oaCompatHelper = { cacheWrite1hTokens: undefined, } }, -} satisfies ProviderHelper +}) export function fromOaCompatibleRequest(body: any): CommonRequest { if (!body || typeof body !== "object") return body diff --git a/packages/console/app/src/routes/zen/util/provider/openai.ts b/packages/console/app/src/routes/zen/util/provider/openai.ts index dff6e13fbe3..f4d7699e97c 100644 --- a/packages/console/app/src/routes/zen/util/provider/openai.ts +++ b/packages/console/app/src/routes/zen/util/provider/openai.ts @@ -12,7 +12,7 @@ type Usage = { total_tokens?: number } -export const openaiHelper = { +export const openaiHelper: ProviderHelper = () => ({ format: "openai", modifyUrl: (providerApi: string) => providerApi + "/responses", modifyHeaders: (headers: Headers, body: Record, apiKey: string) => { @@ -21,6 +21,7 @@ export const openaiHelper = { modifyBody: (body: Record) => { return body }, + createBinaryStreamDecoder: () => undefined, streamSeparator: "\n\n", createUsageParser: () => { let usage: Usage @@ -58,7 +59,7 @@ export const openaiHelper = { cacheWrite1hTokens: undefined, } }, -} satisfies ProviderHelper +}) export function fromOpenaiRequest(body: any): CommonRequest { if (!body || typeof body !== "object") return body diff --git a/packages/console/app/src/routes/zen/util/provider/provider.ts b/packages/console/app/src/routes/zen/util/provider/provider.ts index 730ad5a278a..bbf54f4f96d 100644 --- a/packages/console/app/src/routes/zen/util/provider/provider.ts +++ b/packages/console/app/src/routes/zen/util/provider/provider.ts @@ -33,11 +33,12 @@ export type UsageInfo = { cacheWrite1hTokens?: number } -export type ProviderHelper = { +export type ProviderHelper = (input: { reqModel: string; providerModel: string }) => { format: ZenData.Format - modifyUrl: (providerApi: string, model?: string, isStream?: boolean) => string + modifyUrl: (providerApi: string, isStream?: boolean) => string modifyHeaders: (headers: Headers, body: Record, apiKey: string) => void modifyBody: (body: Record) => Record + createBinaryStreamDecoder: () => ((chunk: Uint8Array) => Uint8Array | undefined) | undefined streamSeparator: string createUsageParser: () => { parse: (chunk: string) => void diff --git a/packages/console/app/src/routes/zen/util/rateLimiter.ts b/packages/console/app/src/routes/zen/util/rateLimiter.ts index b3c03681575..244db072c6d 100644 --- a/packages/console/app/src/routes/zen/util/rateLimiter.ts +++ b/packages/console/app/src/routes/zen/util/rateLimiter.ts @@ -1,28 +1,34 @@ -import { Resource } from "@opencode-ai/console-resource" +import { Database, eq, and, sql, inArray } from "@opencode-ai/console-core/drizzle/index.js" +import { IpRateLimitTable } from "@opencode-ai/console-core/schema/ip.sql.js" import { RateLimitError } from "./error" import { logger } from "./logger" -export function createRateLimiter(model: string, limit: number | undefined, ip: string) { +export function createRateLimiter(limit: number | undefined, rawIp: string) { if (!limit) return + const ip = !rawIp.length ? "unknown" : rawIp const now = Date.now() - const currKey = `usage:${ip}:${model}:${buildYYYYMMDDHH(now)}` - const prevKey = `usage:${ip}:${model}:${buildYYYYMMDDHH(now - 3_600_000)}` - let currRate: number - let prevRate: number + const intervals = [buildYYYYMMDDHH(now), buildYYYYMMDDHH(now - 3_600_000), buildYYYYMMDDHH(now - 7_200_000)] return { track: async () => { - await Resource.GatewayKv.put(currKey, currRate + 1, { expirationTtl: 3600 }) + await Database.use((tx) => + tx + .insert(IpRateLimitTable) + .values({ ip, interval: intervals[0], count: 1 }) + .onDuplicateKeyUpdate({ set: { count: sql`${IpRateLimitTable.count} + 1` } }), + ) }, check: async () => { - const values = await Resource.GatewayKv.get([currKey, prevKey]) - const prevValue = values?.get(prevKey) - const currValue = values?.get(currKey) - prevRate = prevValue ? parseInt(prevValue) : 0 - currRate = currValue ? parseInt(currValue) : 0 - logger.debug(`rate limit ${model} prev/curr: ${prevRate}/${currRate}`) - if (prevRate + currRate >= limit) throw new RateLimitError(`Rate limit exceeded. Please try again later.`) + const rows = await Database.use((tx) => + tx + .select({ count: IpRateLimitTable.count }) + .from(IpRateLimitTable) + .where(and(eq(IpRateLimitTable.ip, ip), inArray(IpRateLimitTable.interval, intervals))), + ) + const total = rows.reduce((sum, r) => sum + r.count, 0) + logger.debug(`rate limit total: ${total}`) + if (total >= limit) throw new RateLimitError(`Rate limit exceeded. Please try again later.`) }, } } diff --git a/packages/console/app/src/routes/zen/util/stickyProviderTracker.ts b/packages/console/app/src/routes/zen/util/stickyProviderTracker.ts index 63cbb0a68c9..8029757c5b6 100644 --- a/packages/console/app/src/routes/zen/util/stickyProviderTracker.ts +++ b/packages/console/app/src/routes/zen/util/stickyProviderTracker.ts @@ -1,6 +1,6 @@ import { Resource } from "@opencode-ai/console-resource" -export function createStickyTracker(stickyProvider: boolean, session: string) { +export function createStickyTracker(stickyProvider: "strict" | "prefer" | undefined, session: string) { if (!stickyProvider) return if (!session) return const key = `sticky:${session}` diff --git a/packages/console/app/tsconfig.json b/packages/console/app/tsconfig.json index e30a673892e..e5fb212de51 100644 --- a/packages/console/app/tsconfig.json +++ b/packages/console/app/tsconfig.json @@ -12,7 +12,7 @@ "allowJs": true, "strict": true, "noEmit": true, - "types": ["vite/client"], + "types": ["vite/client", "@webgpu/types"], "isolatedModules": true, "paths": { "~/*": ["./src/*"] diff --git a/packages/console/core/migrations/0039_striped_forge.sql b/packages/console/core/migrations/0039_striped_forge.sql new file mode 100644 index 00000000000..ad823197fb1 --- /dev/null +++ b/packages/console/core/migrations/0039_striped_forge.sql @@ -0,0 +1,12 @@ +CREATE TABLE `benchmark` ( + `id` varchar(30) NOT NULL, + `time_created` timestamp(3) NOT NULL DEFAULT (now()), + `time_updated` timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3), + `time_deleted` timestamp(3), + `model` varchar(64) NOT NULL, + `agent` varchar(64) NOT NULL, + `result` mediumtext NOT NULL, + CONSTRAINT `benchmark_id_pk` PRIMARY KEY(`id`) +); +--> statement-breakpoint +CREATE INDEX `time_created` ON `benchmark` (`time_created`); \ No newline at end of file diff --git a/packages/console/core/migrations/0040_broken_gamora.sql b/packages/console/core/migrations/0040_broken_gamora.sql new file mode 100644 index 00000000000..f6008f7855e --- /dev/null +++ b/packages/console/core/migrations/0040_broken_gamora.sql @@ -0,0 +1 @@ +CREATE INDEX `usage_time_created` ON `usage` (`workspace_id`,`time_created`); \ No newline at end of file diff --git a/packages/console/core/migrations/0041_odd_misty_knight.sql b/packages/console/core/migrations/0041_odd_misty_knight.sql new file mode 100644 index 00000000000..5b98137f08a --- /dev/null +++ b/packages/console/core/migrations/0041_odd_misty_knight.sql @@ -0,0 +1,6 @@ +CREATE TABLE `ip_rate_limit` ( + `ip` varchar(45) NOT NULL, + `interval` varchar(10) NOT NULL, + `count` int NOT NULL, + CONSTRAINT `ip_rate_limit_ip_interval_pk` PRIMARY KEY(`ip`,`interval`) +); diff --git a/packages/console/core/migrations/0042_flat_nightmare.sql b/packages/console/core/migrations/0042_flat_nightmare.sql new file mode 100644 index 00000000000..666988edc61 --- /dev/null +++ b/packages/console/core/migrations/0042_flat_nightmare.sql @@ -0,0 +1,7 @@ +ALTER TABLE `billing` ADD `subscription_id` varchar(28);--> statement-breakpoint +ALTER TABLE `usage` ADD `data` json;--> statement-breakpoint +ALTER TABLE `user` ADD `time_subscribed` timestamp(3);--> statement-breakpoint +ALTER TABLE `user` ADD `sub_recent_usage` bigint;--> statement-breakpoint +ALTER TABLE `user` ADD `sub_monthly_usage` bigint;--> statement-breakpoint +ALTER TABLE `user` ADD `sub_time_recent_usage_updated` timestamp(3);--> statement-breakpoint +ALTER TABLE `user` ADD `sub_time_monthly_usage_updated` timestamp(3); \ No newline at end of file diff --git a/packages/console/core/migrations/0043_lame_calypso.sql b/packages/console/core/migrations/0043_lame_calypso.sql new file mode 100644 index 00000000000..9a2facbc4fe --- /dev/null +++ b/packages/console/core/migrations/0043_lame_calypso.sql @@ -0,0 +1,2 @@ +ALTER TABLE `user` RENAME COLUMN `sub_recent_usage` TO `sub_interval_usage`;--> statement-breakpoint +ALTER TABLE `user` RENAME COLUMN `sub_time_recent_usage_updated` TO `sub_time_interval_usage_updated`; \ No newline at end of file diff --git a/packages/console/core/migrations/0044_tiny_captain_midlands.sql b/packages/console/core/migrations/0044_tiny_captain_midlands.sql new file mode 100644 index 00000000000..07163dd6524 --- /dev/null +++ b/packages/console/core/migrations/0044_tiny_captain_midlands.sql @@ -0,0 +1 @@ +ALTER TABLE `usage` RENAME COLUMN `data` TO `enrichment`; \ No newline at end of file diff --git a/packages/console/core/migrations/0045_cuddly_diamondback.sql b/packages/console/core/migrations/0045_cuddly_diamondback.sql new file mode 100644 index 00000000000..476e6bfe8a2 --- /dev/null +++ b/packages/console/core/migrations/0045_cuddly_diamondback.sql @@ -0,0 +1 @@ +ALTER TABLE `billing` ADD CONSTRAINT `global_subscription_id` UNIQUE(`subscription_id`); \ No newline at end of file diff --git a/packages/console/core/migrations/0046_charming_black_bolt.sql b/packages/console/core/migrations/0046_charming_black_bolt.sql new file mode 100644 index 00000000000..607300db865 --- /dev/null +++ b/packages/console/core/migrations/0046_charming_black_bolt.sql @@ -0,0 +1,13 @@ +CREATE TABLE `subscription` ( + `id` varchar(30) NOT NULL, + `workspace_id` varchar(30) NOT NULL, + `time_created` timestamp(3) NOT NULL DEFAULT (now()), + `time_updated` timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3), + `time_deleted` timestamp(3), + `user_id` varchar(30) NOT NULL, + `rolling_usage` bigint, + `fixed_usage` bigint, + `time_rolling_updated` timestamp(3), + `time_fixed_updated` timestamp(3), + CONSTRAINT `subscription_workspace_id_id_pk` PRIMARY KEY(`workspace_id`,`id`) +); diff --git a/packages/console/core/migrations/0047_huge_omega_red.sql b/packages/console/core/migrations/0047_huge_omega_red.sql new file mode 100644 index 00000000000..d5086f05a15 --- /dev/null +++ b/packages/console/core/migrations/0047_huge_omega_red.sql @@ -0,0 +1,6 @@ +CREATE INDEX `workspace_user_id` ON `subscription` (`workspace_id`,`user_id`);--> statement-breakpoint +ALTER TABLE `user` DROP COLUMN `time_subscribed`;--> statement-breakpoint +ALTER TABLE `user` DROP COLUMN `sub_interval_usage`;--> statement-breakpoint +ALTER TABLE `user` DROP COLUMN `sub_monthly_usage`;--> statement-breakpoint +ALTER TABLE `user` DROP COLUMN `sub_time_interval_usage_updated`;--> statement-breakpoint +ALTER TABLE `user` DROP COLUMN `sub_time_monthly_usage_updated`; \ No newline at end of file diff --git a/packages/console/core/migrations/0048_mean_frank_castle.sql b/packages/console/core/migrations/0048_mean_frank_castle.sql new file mode 100644 index 00000000000..c2cf5ee47ea --- /dev/null +++ b/packages/console/core/migrations/0048_mean_frank_castle.sql @@ -0,0 +1,2 @@ +DROP INDEX `workspace_user_id` ON `subscription`;--> statement-breakpoint +ALTER TABLE `subscription` ADD CONSTRAINT `workspace_user_id` UNIQUE(`workspace_id`,`user_id`); \ No newline at end of file diff --git a/packages/console/core/migrations/0049_noisy_domino.sql b/packages/console/core/migrations/0049_noisy_domino.sql new file mode 100644 index 00000000000..654a5a81db9 --- /dev/null +++ b/packages/console/core/migrations/0049_noisy_domino.sql @@ -0,0 +1 @@ +ALTER TABLE `billing` ADD `subscription_coupon_id` varchar(28); \ No newline at end of file diff --git a/packages/console/core/migrations/0050_bumpy_mephistopheles.sql b/packages/console/core/migrations/0050_bumpy_mephistopheles.sql new file mode 100644 index 00000000000..2c3d554f095 --- /dev/null +++ b/packages/console/core/migrations/0050_bumpy_mephistopheles.sql @@ -0,0 +1 @@ +ALTER TABLE `payment` ADD `enrichment` json; \ No newline at end of file diff --git a/packages/console/core/migrations/0051_jazzy_green_goblin.sql b/packages/console/core/migrations/0051_jazzy_green_goblin.sql new file mode 100644 index 00000000000..cadb4a709e5 --- /dev/null +++ b/packages/console/core/migrations/0051_jazzy_green_goblin.sql @@ -0,0 +1 @@ +ALTER TABLE `billing` ADD `time_subscription_booked` timestamp(3); \ No newline at end of file diff --git a/packages/console/core/migrations/0052_aromatic_agent_zero.sql b/packages/console/core/migrations/0052_aromatic_agent_zero.sql new file mode 100644 index 00000000000..c53ba5e2b9c --- /dev/null +++ b/packages/console/core/migrations/0052_aromatic_agent_zero.sql @@ -0,0 +1 @@ +ALTER TABLE `billing` ADD `subscription_plan` enum('20','100','200'); \ No newline at end of file diff --git a/packages/console/core/migrations/0053_gigantic_hardball.sql b/packages/console/core/migrations/0053_gigantic_hardball.sql new file mode 100644 index 00000000000..72d43135f44 --- /dev/null +++ b/packages/console/core/migrations/0053_gigantic_hardball.sql @@ -0,0 +1 @@ +ALTER TABLE `billing` ADD `subscription` json; \ No newline at end of file diff --git a/packages/console/core/migrations/0054_numerous_annihilus.sql b/packages/console/core/migrations/0054_numerous_annihilus.sql new file mode 100644 index 00000000000..299847db64f --- /dev/null +++ b/packages/console/core/migrations/0054_numerous_annihilus.sql @@ -0,0 +1 @@ +ALTER TABLE `billing` DROP COLUMN `subscription_coupon_id`; \ No newline at end of file diff --git a/packages/console/core/migrations/0055_moaning_karnak.sql b/packages/console/core/migrations/0055_moaning_karnak.sql new file mode 100644 index 00000000000..120ae727c30 --- /dev/null +++ b/packages/console/core/migrations/0055_moaning_karnak.sql @@ -0,0 +1 @@ +ALTER TABLE `billing` ADD `time_subscription_selected` timestamp(3); \ No newline at end of file diff --git a/packages/console/core/migrations/meta/0039_snapshot.json b/packages/console/core/migrations/meta/0039_snapshot.json new file mode 100644 index 00000000000..ba34f1ac490 --- /dev/null +++ b/packages/console/core/migrations/meta/0039_snapshot.json @@ -0,0 +1,1053 @@ +{ + "version": "5", + "dialect": "mysql", + "id": "49a1ac05-78ab-4aae-908e-d4aeeb8196fc", + "prevId": "9d5d9885-7ec5-45f6-ac53-45a8e25dede7", + "tables": { + "account": { + "name": "account", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "account_id_pk": { + "name": "account_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "auth": { + "name": "auth", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "enum('email','github','google')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "subject": { + "name": "subject", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "account_id": { + "name": "account_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "provider": { + "name": "provider", + "columns": ["provider", "subject"], + "isUnique": true + }, + "account_id": { + "name": "account_id", + "columns": ["account_id"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "auth_id_pk": { + "name": "auth_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "benchmark": { + "name": "benchmark", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "agent": { + "name": "agent", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "result": { + "name": "result", + "type": "mediumtext", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "time_created": { + "name": "time_created", + "columns": ["time_created"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "benchmark_id_pk": { + "name": "benchmark_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "billing": { + "name": "billing", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "customer_id": { + "name": "customer_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_id": { + "name": "payment_method_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_type": { + "name": "payment_method_type", + "type": "varchar(32)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_last4": { + "name": "payment_method_last4", + "type": "varchar(4)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "balance": { + "name": "balance", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "monthly_limit": { + "name": "monthly_limit", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "monthly_usage": { + "name": "monthly_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_monthly_usage_updated": { + "name": "time_monthly_usage_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload": { + "name": "reload", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_trigger": { + "name": "reload_trigger", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_amount": { + "name": "reload_amount", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_error": { + "name": "reload_error", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_reload_error": { + "name": "time_reload_error", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_reload_locked_till": { + "name": "time_reload_locked_till", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "global_customer_id": { + "name": "global_customer_id", + "columns": ["customer_id"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "billing_workspace_id_id_pk": { + "name": "billing_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "payment": { + "name": "payment", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "customer_id": { + "name": "customer_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "invoice_id": { + "name": "invoice_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_id": { + "name": "payment_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "amount": { + "name": "amount", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_refunded": { + "name": "time_refunded", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "payment_workspace_id_id_pk": { + "name": "payment_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "usage": { + "name": "usage", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "input_tokens": { + "name": "input_tokens", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "output_tokens": { + "name": "output_tokens", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "reasoning_tokens": { + "name": "reasoning_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_read_tokens": { + "name": "cache_read_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_write_5m_tokens": { + "name": "cache_write_5m_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_write_1h_tokens": { + "name": "cache_write_1h_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cost": { + "name": "cost", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "key_id": { + "name": "key_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "usage_workspace_id_id_pk": { + "name": "usage_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "ip": { + "name": "ip", + "columns": { + "ip": { + "name": "ip", + "type": "varchar(45)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "usage": { + "name": "usage", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "ip_ip_pk": { + "name": "ip_ip_pk", + "columns": ["ip"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "key": { + "name": "key", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "key": { + "name": "key", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_used": { + "name": "time_used", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "global_key": { + "name": "global_key", + "columns": ["key"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "key_workspace_id_id_pk": { + "name": "key_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "model": { + "name": "model", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "model_workspace_model": { + "name": "model_workspace_model", + "columns": ["workspace_id", "model"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "model_workspace_id_id_pk": { + "name": "model_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "provider": { + "name": "provider", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "credentials": { + "name": "credentials", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "workspace_provider": { + "name": "workspace_provider", + "columns": ["workspace_id", "provider"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "provider_workspace_id_id_pk": { + "name": "provider_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "user": { + "name": "user", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "account_id": { + "name": "account_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "email": { + "name": "email", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_seen": { + "name": "time_seen", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "color": { + "name": "color", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "role": { + "name": "role", + "type": "enum('admin','member')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "monthly_limit": { + "name": "monthly_limit", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "monthly_usage": { + "name": "monthly_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_monthly_usage_updated": { + "name": "time_monthly_usage_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "user_account_id": { + "name": "user_account_id", + "columns": ["workspace_id", "account_id"], + "isUnique": true + }, + "user_email": { + "name": "user_email", + "columns": ["workspace_id", "email"], + "isUnique": true + }, + "global_account_id": { + "name": "global_account_id", + "columns": ["account_id"], + "isUnique": false + }, + "global_email": { + "name": "global_email", + "columns": ["email"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "user_workspace_id_id_pk": { + "name": "user_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "workspace": { + "name": "workspace", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "slug": { + "name": "slug", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "slug": { + "name": "slug", + "columns": ["slug"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "workspace_id": { + "name": "workspace_id", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + } + }, + "views": {}, + "_meta": { + "schemas": {}, + "tables": {}, + "columns": {} + }, + "internal": { + "tables": {}, + "indexes": {} + } +} diff --git a/packages/console/core/migrations/meta/0040_snapshot.json b/packages/console/core/migrations/meta/0040_snapshot.json new file mode 100644 index 00000000000..77012fd0ff1 --- /dev/null +++ b/packages/console/core/migrations/meta/0040_snapshot.json @@ -0,0 +1,1059 @@ +{ + "version": "5", + "dialect": "mysql", + "id": "bf19cd74-71f9-4bdf-b50e-67c2436f3408", + "prevId": "49a1ac05-78ab-4aae-908e-d4aeeb8196fc", + "tables": { + "account": { + "name": "account", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "account_id_pk": { + "name": "account_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "auth": { + "name": "auth", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "enum('email','github','google')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "subject": { + "name": "subject", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "account_id": { + "name": "account_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "provider": { + "name": "provider", + "columns": ["provider", "subject"], + "isUnique": true + }, + "account_id": { + "name": "account_id", + "columns": ["account_id"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "auth_id_pk": { + "name": "auth_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "benchmark": { + "name": "benchmark", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "agent": { + "name": "agent", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "result": { + "name": "result", + "type": "mediumtext", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "time_created": { + "name": "time_created", + "columns": ["time_created"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "benchmark_id_pk": { + "name": "benchmark_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "billing": { + "name": "billing", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "customer_id": { + "name": "customer_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_id": { + "name": "payment_method_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_type": { + "name": "payment_method_type", + "type": "varchar(32)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_last4": { + "name": "payment_method_last4", + "type": "varchar(4)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "balance": { + "name": "balance", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "monthly_limit": { + "name": "monthly_limit", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "monthly_usage": { + "name": "monthly_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_monthly_usage_updated": { + "name": "time_monthly_usage_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload": { + "name": "reload", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_trigger": { + "name": "reload_trigger", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_amount": { + "name": "reload_amount", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_error": { + "name": "reload_error", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_reload_error": { + "name": "time_reload_error", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_reload_locked_till": { + "name": "time_reload_locked_till", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "global_customer_id": { + "name": "global_customer_id", + "columns": ["customer_id"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "billing_workspace_id_id_pk": { + "name": "billing_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "payment": { + "name": "payment", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "customer_id": { + "name": "customer_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "invoice_id": { + "name": "invoice_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_id": { + "name": "payment_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "amount": { + "name": "amount", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_refunded": { + "name": "time_refunded", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "payment_workspace_id_id_pk": { + "name": "payment_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "usage": { + "name": "usage", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "input_tokens": { + "name": "input_tokens", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "output_tokens": { + "name": "output_tokens", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "reasoning_tokens": { + "name": "reasoning_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_read_tokens": { + "name": "cache_read_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_write_5m_tokens": { + "name": "cache_write_5m_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_write_1h_tokens": { + "name": "cache_write_1h_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cost": { + "name": "cost", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "key_id": { + "name": "key_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "usage_time_created": { + "name": "usage_time_created", + "columns": ["workspace_id", "time_created"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "usage_workspace_id_id_pk": { + "name": "usage_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "ip": { + "name": "ip", + "columns": { + "ip": { + "name": "ip", + "type": "varchar(45)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "usage": { + "name": "usage", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "ip_ip_pk": { + "name": "ip_ip_pk", + "columns": ["ip"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "key": { + "name": "key", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "key": { + "name": "key", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_used": { + "name": "time_used", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "global_key": { + "name": "global_key", + "columns": ["key"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "key_workspace_id_id_pk": { + "name": "key_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "model": { + "name": "model", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "model_workspace_model": { + "name": "model_workspace_model", + "columns": ["workspace_id", "model"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "model_workspace_id_id_pk": { + "name": "model_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "provider": { + "name": "provider", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "credentials": { + "name": "credentials", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "workspace_provider": { + "name": "workspace_provider", + "columns": ["workspace_id", "provider"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "provider_workspace_id_id_pk": { + "name": "provider_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "user": { + "name": "user", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "account_id": { + "name": "account_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "email": { + "name": "email", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_seen": { + "name": "time_seen", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "color": { + "name": "color", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "role": { + "name": "role", + "type": "enum('admin','member')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "monthly_limit": { + "name": "monthly_limit", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "monthly_usage": { + "name": "monthly_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_monthly_usage_updated": { + "name": "time_monthly_usage_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "user_account_id": { + "name": "user_account_id", + "columns": ["workspace_id", "account_id"], + "isUnique": true + }, + "user_email": { + "name": "user_email", + "columns": ["workspace_id", "email"], + "isUnique": true + }, + "global_account_id": { + "name": "global_account_id", + "columns": ["account_id"], + "isUnique": false + }, + "global_email": { + "name": "global_email", + "columns": ["email"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "user_workspace_id_id_pk": { + "name": "user_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "workspace": { + "name": "workspace", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "slug": { + "name": "slug", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "slug": { + "name": "slug", + "columns": ["slug"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "workspace_id": { + "name": "workspace_id", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + } + }, + "views": {}, + "_meta": { + "schemas": {}, + "tables": {}, + "columns": {} + }, + "internal": { + "tables": {}, + "indexes": {} + } +} diff --git a/packages/console/core/migrations/meta/0041_snapshot.json b/packages/console/core/migrations/meta/0041_snapshot.json new file mode 100644 index 00000000000..583b55925b3 --- /dev/null +++ b/packages/console/core/migrations/meta/0041_snapshot.json @@ -0,0 +1,1095 @@ +{ + "version": "5", + "dialect": "mysql", + "id": "9cf10c24-6029-4cb4-866e-ff9b501eaf7e", + "prevId": "bf19cd74-71f9-4bdf-b50e-67c2436f3408", + "tables": { + "account": { + "name": "account", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "account_id_pk": { + "name": "account_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "auth": { + "name": "auth", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "enum('email','github','google')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "subject": { + "name": "subject", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "account_id": { + "name": "account_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "provider": { + "name": "provider", + "columns": ["provider", "subject"], + "isUnique": true + }, + "account_id": { + "name": "account_id", + "columns": ["account_id"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "auth_id_pk": { + "name": "auth_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "benchmark": { + "name": "benchmark", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "agent": { + "name": "agent", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "result": { + "name": "result", + "type": "mediumtext", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "time_created": { + "name": "time_created", + "columns": ["time_created"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "benchmark_id_pk": { + "name": "benchmark_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "billing": { + "name": "billing", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "customer_id": { + "name": "customer_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_id": { + "name": "payment_method_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_type": { + "name": "payment_method_type", + "type": "varchar(32)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_last4": { + "name": "payment_method_last4", + "type": "varchar(4)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "balance": { + "name": "balance", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "monthly_limit": { + "name": "monthly_limit", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "monthly_usage": { + "name": "monthly_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_monthly_usage_updated": { + "name": "time_monthly_usage_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload": { + "name": "reload", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_trigger": { + "name": "reload_trigger", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_amount": { + "name": "reload_amount", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_error": { + "name": "reload_error", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_reload_error": { + "name": "time_reload_error", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_reload_locked_till": { + "name": "time_reload_locked_till", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "global_customer_id": { + "name": "global_customer_id", + "columns": ["customer_id"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "billing_workspace_id_id_pk": { + "name": "billing_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "payment": { + "name": "payment", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "customer_id": { + "name": "customer_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "invoice_id": { + "name": "invoice_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_id": { + "name": "payment_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "amount": { + "name": "amount", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_refunded": { + "name": "time_refunded", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "payment_workspace_id_id_pk": { + "name": "payment_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "usage": { + "name": "usage", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "input_tokens": { + "name": "input_tokens", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "output_tokens": { + "name": "output_tokens", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "reasoning_tokens": { + "name": "reasoning_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_read_tokens": { + "name": "cache_read_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_write_5m_tokens": { + "name": "cache_write_5m_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_write_1h_tokens": { + "name": "cache_write_1h_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cost": { + "name": "cost", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "key_id": { + "name": "key_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "usage_time_created": { + "name": "usage_time_created", + "columns": ["workspace_id", "time_created"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "usage_workspace_id_id_pk": { + "name": "usage_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "ip_rate_limit": { + "name": "ip_rate_limit", + "columns": { + "ip": { + "name": "ip", + "type": "varchar(45)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "interval": { + "name": "interval", + "type": "varchar(10)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "count": { + "name": "count", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "ip_rate_limit_ip_interval_pk": { + "name": "ip_rate_limit_ip_interval_pk", + "columns": ["ip", "interval"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "ip": { + "name": "ip", + "columns": { + "ip": { + "name": "ip", + "type": "varchar(45)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "usage": { + "name": "usage", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "ip_ip_pk": { + "name": "ip_ip_pk", + "columns": ["ip"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "key": { + "name": "key", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "key": { + "name": "key", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_used": { + "name": "time_used", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "global_key": { + "name": "global_key", + "columns": ["key"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "key_workspace_id_id_pk": { + "name": "key_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "model": { + "name": "model", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "model_workspace_model": { + "name": "model_workspace_model", + "columns": ["workspace_id", "model"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "model_workspace_id_id_pk": { + "name": "model_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "provider": { + "name": "provider", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "credentials": { + "name": "credentials", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "workspace_provider": { + "name": "workspace_provider", + "columns": ["workspace_id", "provider"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "provider_workspace_id_id_pk": { + "name": "provider_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "user": { + "name": "user", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "account_id": { + "name": "account_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "email": { + "name": "email", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_seen": { + "name": "time_seen", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "color": { + "name": "color", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "role": { + "name": "role", + "type": "enum('admin','member')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "monthly_limit": { + "name": "monthly_limit", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "monthly_usage": { + "name": "monthly_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_monthly_usage_updated": { + "name": "time_monthly_usage_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "user_account_id": { + "name": "user_account_id", + "columns": ["workspace_id", "account_id"], + "isUnique": true + }, + "user_email": { + "name": "user_email", + "columns": ["workspace_id", "email"], + "isUnique": true + }, + "global_account_id": { + "name": "global_account_id", + "columns": ["account_id"], + "isUnique": false + }, + "global_email": { + "name": "global_email", + "columns": ["email"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "user_workspace_id_id_pk": { + "name": "user_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "workspace": { + "name": "workspace", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "slug": { + "name": "slug", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "slug": { + "name": "slug", + "columns": ["slug"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "workspace_id": { + "name": "workspace_id", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + } + }, + "views": {}, + "_meta": { + "schemas": {}, + "tables": {}, + "columns": {} + }, + "internal": { + "tables": {}, + "indexes": {} + } +} diff --git a/packages/console/core/migrations/meta/0042_snapshot.json b/packages/console/core/migrations/meta/0042_snapshot.json new file mode 100644 index 00000000000..e0f731e3975 --- /dev/null +++ b/packages/console/core/migrations/meta/0042_snapshot.json @@ -0,0 +1,1144 @@ +{ + "version": "5", + "dialect": "mysql", + "id": "4775571c-ad9c-4104-a202-2374b1963cfe", + "prevId": "9cf10c24-6029-4cb4-866e-ff9b501eaf7e", + "tables": { + "account": { + "name": "account", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "account_id_pk": { + "name": "account_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "auth": { + "name": "auth", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "enum('email','github','google')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "subject": { + "name": "subject", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "account_id": { + "name": "account_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "provider": { + "name": "provider", + "columns": ["provider", "subject"], + "isUnique": true + }, + "account_id": { + "name": "account_id", + "columns": ["account_id"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "auth_id_pk": { + "name": "auth_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "benchmark": { + "name": "benchmark", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "agent": { + "name": "agent", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "result": { + "name": "result", + "type": "mediumtext", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "time_created": { + "name": "time_created", + "columns": ["time_created"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "benchmark_id_pk": { + "name": "benchmark_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "billing": { + "name": "billing", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "customer_id": { + "name": "customer_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_id": { + "name": "payment_method_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_type": { + "name": "payment_method_type", + "type": "varchar(32)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_last4": { + "name": "payment_method_last4", + "type": "varchar(4)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "balance": { + "name": "balance", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "monthly_limit": { + "name": "monthly_limit", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "monthly_usage": { + "name": "monthly_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_monthly_usage_updated": { + "name": "time_monthly_usage_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload": { + "name": "reload", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_trigger": { + "name": "reload_trigger", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_amount": { + "name": "reload_amount", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_error": { + "name": "reload_error", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_reload_error": { + "name": "time_reload_error", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_reload_locked_till": { + "name": "time_reload_locked_till", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "subscription_id": { + "name": "subscription_id", + "type": "varchar(28)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "global_customer_id": { + "name": "global_customer_id", + "columns": ["customer_id"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "billing_workspace_id_id_pk": { + "name": "billing_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "payment": { + "name": "payment", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "customer_id": { + "name": "customer_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "invoice_id": { + "name": "invoice_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_id": { + "name": "payment_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "amount": { + "name": "amount", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_refunded": { + "name": "time_refunded", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "payment_workspace_id_id_pk": { + "name": "payment_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "usage": { + "name": "usage", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "input_tokens": { + "name": "input_tokens", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "output_tokens": { + "name": "output_tokens", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "reasoning_tokens": { + "name": "reasoning_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_read_tokens": { + "name": "cache_read_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_write_5m_tokens": { + "name": "cache_write_5m_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_write_1h_tokens": { + "name": "cache_write_1h_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cost": { + "name": "cost", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "key_id": { + "name": "key_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "data": { + "name": "data", + "type": "json", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "usage_time_created": { + "name": "usage_time_created", + "columns": ["workspace_id", "time_created"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "usage_workspace_id_id_pk": { + "name": "usage_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "ip_rate_limit": { + "name": "ip_rate_limit", + "columns": { + "ip": { + "name": "ip", + "type": "varchar(45)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "interval": { + "name": "interval", + "type": "varchar(10)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "count": { + "name": "count", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "ip_rate_limit_ip_interval_pk": { + "name": "ip_rate_limit_ip_interval_pk", + "columns": ["ip", "interval"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "ip": { + "name": "ip", + "columns": { + "ip": { + "name": "ip", + "type": "varchar(45)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "usage": { + "name": "usage", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "ip_ip_pk": { + "name": "ip_ip_pk", + "columns": ["ip"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "key": { + "name": "key", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "key": { + "name": "key", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_used": { + "name": "time_used", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "global_key": { + "name": "global_key", + "columns": ["key"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "key_workspace_id_id_pk": { + "name": "key_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "model": { + "name": "model", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "model_workspace_model": { + "name": "model_workspace_model", + "columns": ["workspace_id", "model"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "model_workspace_id_id_pk": { + "name": "model_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "provider": { + "name": "provider", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "credentials": { + "name": "credentials", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "workspace_provider": { + "name": "workspace_provider", + "columns": ["workspace_id", "provider"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "provider_workspace_id_id_pk": { + "name": "provider_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "user": { + "name": "user", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "account_id": { + "name": "account_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "email": { + "name": "email", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_seen": { + "name": "time_seen", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "color": { + "name": "color", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "role": { + "name": "role", + "type": "enum('admin','member')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "monthly_limit": { + "name": "monthly_limit", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "monthly_usage": { + "name": "monthly_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_monthly_usage_updated": { + "name": "time_monthly_usage_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_subscribed": { + "name": "time_subscribed", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sub_recent_usage": { + "name": "sub_recent_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sub_monthly_usage": { + "name": "sub_monthly_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sub_time_recent_usage_updated": { + "name": "sub_time_recent_usage_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sub_time_monthly_usage_updated": { + "name": "sub_time_monthly_usage_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "user_account_id": { + "name": "user_account_id", + "columns": ["workspace_id", "account_id"], + "isUnique": true + }, + "user_email": { + "name": "user_email", + "columns": ["workspace_id", "email"], + "isUnique": true + }, + "global_account_id": { + "name": "global_account_id", + "columns": ["account_id"], + "isUnique": false + }, + "global_email": { + "name": "global_email", + "columns": ["email"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "user_workspace_id_id_pk": { + "name": "user_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "workspace": { + "name": "workspace", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "slug": { + "name": "slug", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "slug": { + "name": "slug", + "columns": ["slug"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "workspace_id": { + "name": "workspace_id", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + } + }, + "views": {}, + "_meta": { + "schemas": {}, + "tables": {}, + "columns": {} + }, + "internal": { + "tables": {}, + "indexes": {} + } +} diff --git a/packages/console/core/migrations/meta/0043_snapshot.json b/packages/console/core/migrations/meta/0043_snapshot.json new file mode 100644 index 00000000000..ef9caa74e6b --- /dev/null +++ b/packages/console/core/migrations/meta/0043_snapshot.json @@ -0,0 +1,1147 @@ +{ + "version": "5", + "dialect": "mysql", + "id": "3ff862f3-eeb6-4b10-8c78-254de3778ab3", + "prevId": "4775571c-ad9c-4104-a202-2374b1963cfe", + "tables": { + "account": { + "name": "account", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "account_id_pk": { + "name": "account_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "auth": { + "name": "auth", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "enum('email','github','google')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "subject": { + "name": "subject", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "account_id": { + "name": "account_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "provider": { + "name": "provider", + "columns": ["provider", "subject"], + "isUnique": true + }, + "account_id": { + "name": "account_id", + "columns": ["account_id"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "auth_id_pk": { + "name": "auth_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "benchmark": { + "name": "benchmark", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "agent": { + "name": "agent", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "result": { + "name": "result", + "type": "mediumtext", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "time_created": { + "name": "time_created", + "columns": ["time_created"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "benchmark_id_pk": { + "name": "benchmark_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "billing": { + "name": "billing", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "customer_id": { + "name": "customer_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_id": { + "name": "payment_method_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_type": { + "name": "payment_method_type", + "type": "varchar(32)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_last4": { + "name": "payment_method_last4", + "type": "varchar(4)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "balance": { + "name": "balance", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "monthly_limit": { + "name": "monthly_limit", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "monthly_usage": { + "name": "monthly_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_monthly_usage_updated": { + "name": "time_monthly_usage_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload": { + "name": "reload", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_trigger": { + "name": "reload_trigger", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_amount": { + "name": "reload_amount", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_error": { + "name": "reload_error", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_reload_error": { + "name": "time_reload_error", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_reload_locked_till": { + "name": "time_reload_locked_till", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "subscription_id": { + "name": "subscription_id", + "type": "varchar(28)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "global_customer_id": { + "name": "global_customer_id", + "columns": ["customer_id"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "billing_workspace_id_id_pk": { + "name": "billing_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "payment": { + "name": "payment", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "customer_id": { + "name": "customer_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "invoice_id": { + "name": "invoice_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_id": { + "name": "payment_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "amount": { + "name": "amount", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_refunded": { + "name": "time_refunded", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "payment_workspace_id_id_pk": { + "name": "payment_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "usage": { + "name": "usage", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "input_tokens": { + "name": "input_tokens", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "output_tokens": { + "name": "output_tokens", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "reasoning_tokens": { + "name": "reasoning_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_read_tokens": { + "name": "cache_read_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_write_5m_tokens": { + "name": "cache_write_5m_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_write_1h_tokens": { + "name": "cache_write_1h_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cost": { + "name": "cost", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "key_id": { + "name": "key_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "data": { + "name": "data", + "type": "json", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "usage_time_created": { + "name": "usage_time_created", + "columns": ["workspace_id", "time_created"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "usage_workspace_id_id_pk": { + "name": "usage_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "ip_rate_limit": { + "name": "ip_rate_limit", + "columns": { + "ip": { + "name": "ip", + "type": "varchar(45)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "interval": { + "name": "interval", + "type": "varchar(10)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "count": { + "name": "count", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "ip_rate_limit_ip_interval_pk": { + "name": "ip_rate_limit_ip_interval_pk", + "columns": ["ip", "interval"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "ip": { + "name": "ip", + "columns": { + "ip": { + "name": "ip", + "type": "varchar(45)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "usage": { + "name": "usage", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "ip_ip_pk": { + "name": "ip_ip_pk", + "columns": ["ip"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "key": { + "name": "key", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "key": { + "name": "key", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_used": { + "name": "time_used", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "global_key": { + "name": "global_key", + "columns": ["key"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "key_workspace_id_id_pk": { + "name": "key_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "model": { + "name": "model", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "model_workspace_model": { + "name": "model_workspace_model", + "columns": ["workspace_id", "model"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "model_workspace_id_id_pk": { + "name": "model_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "provider": { + "name": "provider", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "credentials": { + "name": "credentials", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "workspace_provider": { + "name": "workspace_provider", + "columns": ["workspace_id", "provider"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "provider_workspace_id_id_pk": { + "name": "provider_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "user": { + "name": "user", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "account_id": { + "name": "account_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "email": { + "name": "email", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_seen": { + "name": "time_seen", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "color": { + "name": "color", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "role": { + "name": "role", + "type": "enum('admin','member')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "monthly_limit": { + "name": "monthly_limit", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "monthly_usage": { + "name": "monthly_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_monthly_usage_updated": { + "name": "time_monthly_usage_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_subscribed": { + "name": "time_subscribed", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sub_interval_usage": { + "name": "sub_interval_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sub_monthly_usage": { + "name": "sub_monthly_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sub_time_interval_usage_updated": { + "name": "sub_time_interval_usage_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sub_time_monthly_usage_updated": { + "name": "sub_time_monthly_usage_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "user_account_id": { + "name": "user_account_id", + "columns": ["workspace_id", "account_id"], + "isUnique": true + }, + "user_email": { + "name": "user_email", + "columns": ["workspace_id", "email"], + "isUnique": true + }, + "global_account_id": { + "name": "global_account_id", + "columns": ["account_id"], + "isUnique": false + }, + "global_email": { + "name": "global_email", + "columns": ["email"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "user_workspace_id_id_pk": { + "name": "user_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "workspace": { + "name": "workspace", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "slug": { + "name": "slug", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "slug": { + "name": "slug", + "columns": ["slug"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "workspace_id": { + "name": "workspace_id", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + } + }, + "views": {}, + "_meta": { + "schemas": {}, + "tables": {}, + "columns": { + "\"user\".\"sub_recent_usage\"": "\"user\".\"sub_interval_usage\"", + "\"user\".\"sub_time_recent_usage_updated\"": "\"user\".\"sub_time_interval_usage_updated\"" + } + }, + "internal": { + "tables": {}, + "indexes": {} + } +} diff --git a/packages/console/core/migrations/meta/0044_snapshot.json b/packages/console/core/migrations/meta/0044_snapshot.json new file mode 100644 index 00000000000..cde7fabf228 --- /dev/null +++ b/packages/console/core/migrations/meta/0044_snapshot.json @@ -0,0 +1,1146 @@ +{ + "version": "5", + "dialect": "mysql", + "id": "70394850-2c28-4012-a3d5-69357e3348b6", + "prevId": "3ff862f3-eeb6-4b10-8c78-254de3778ab3", + "tables": { + "account": { + "name": "account", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "account_id_pk": { + "name": "account_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "auth": { + "name": "auth", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "enum('email','github','google')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "subject": { + "name": "subject", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "account_id": { + "name": "account_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "provider": { + "name": "provider", + "columns": ["provider", "subject"], + "isUnique": true + }, + "account_id": { + "name": "account_id", + "columns": ["account_id"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "auth_id_pk": { + "name": "auth_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "benchmark": { + "name": "benchmark", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "agent": { + "name": "agent", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "result": { + "name": "result", + "type": "mediumtext", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "time_created": { + "name": "time_created", + "columns": ["time_created"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "benchmark_id_pk": { + "name": "benchmark_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "billing": { + "name": "billing", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "customer_id": { + "name": "customer_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_id": { + "name": "payment_method_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_type": { + "name": "payment_method_type", + "type": "varchar(32)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_last4": { + "name": "payment_method_last4", + "type": "varchar(4)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "balance": { + "name": "balance", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "monthly_limit": { + "name": "monthly_limit", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "monthly_usage": { + "name": "monthly_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_monthly_usage_updated": { + "name": "time_monthly_usage_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload": { + "name": "reload", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_trigger": { + "name": "reload_trigger", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_amount": { + "name": "reload_amount", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_error": { + "name": "reload_error", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_reload_error": { + "name": "time_reload_error", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_reload_locked_till": { + "name": "time_reload_locked_till", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "subscription_id": { + "name": "subscription_id", + "type": "varchar(28)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "global_customer_id": { + "name": "global_customer_id", + "columns": ["customer_id"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "billing_workspace_id_id_pk": { + "name": "billing_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "payment": { + "name": "payment", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "customer_id": { + "name": "customer_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "invoice_id": { + "name": "invoice_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_id": { + "name": "payment_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "amount": { + "name": "amount", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_refunded": { + "name": "time_refunded", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "payment_workspace_id_id_pk": { + "name": "payment_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "usage": { + "name": "usage", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "input_tokens": { + "name": "input_tokens", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "output_tokens": { + "name": "output_tokens", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "reasoning_tokens": { + "name": "reasoning_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_read_tokens": { + "name": "cache_read_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_write_5m_tokens": { + "name": "cache_write_5m_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_write_1h_tokens": { + "name": "cache_write_1h_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cost": { + "name": "cost", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "key_id": { + "name": "key_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "enrichment": { + "name": "enrichment", + "type": "json", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "usage_time_created": { + "name": "usage_time_created", + "columns": ["workspace_id", "time_created"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "usage_workspace_id_id_pk": { + "name": "usage_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "ip_rate_limit": { + "name": "ip_rate_limit", + "columns": { + "ip": { + "name": "ip", + "type": "varchar(45)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "interval": { + "name": "interval", + "type": "varchar(10)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "count": { + "name": "count", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "ip_rate_limit_ip_interval_pk": { + "name": "ip_rate_limit_ip_interval_pk", + "columns": ["ip", "interval"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "ip": { + "name": "ip", + "columns": { + "ip": { + "name": "ip", + "type": "varchar(45)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "usage": { + "name": "usage", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "ip_ip_pk": { + "name": "ip_ip_pk", + "columns": ["ip"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "key": { + "name": "key", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "key": { + "name": "key", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_used": { + "name": "time_used", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "global_key": { + "name": "global_key", + "columns": ["key"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "key_workspace_id_id_pk": { + "name": "key_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "model": { + "name": "model", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "model_workspace_model": { + "name": "model_workspace_model", + "columns": ["workspace_id", "model"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "model_workspace_id_id_pk": { + "name": "model_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "provider": { + "name": "provider", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "credentials": { + "name": "credentials", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "workspace_provider": { + "name": "workspace_provider", + "columns": ["workspace_id", "provider"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "provider_workspace_id_id_pk": { + "name": "provider_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "user": { + "name": "user", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "account_id": { + "name": "account_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "email": { + "name": "email", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_seen": { + "name": "time_seen", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "color": { + "name": "color", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "role": { + "name": "role", + "type": "enum('admin','member')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "monthly_limit": { + "name": "monthly_limit", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "monthly_usage": { + "name": "monthly_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_monthly_usage_updated": { + "name": "time_monthly_usage_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_subscribed": { + "name": "time_subscribed", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sub_interval_usage": { + "name": "sub_interval_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sub_monthly_usage": { + "name": "sub_monthly_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sub_time_interval_usage_updated": { + "name": "sub_time_interval_usage_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sub_time_monthly_usage_updated": { + "name": "sub_time_monthly_usage_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "user_account_id": { + "name": "user_account_id", + "columns": ["workspace_id", "account_id"], + "isUnique": true + }, + "user_email": { + "name": "user_email", + "columns": ["workspace_id", "email"], + "isUnique": true + }, + "global_account_id": { + "name": "global_account_id", + "columns": ["account_id"], + "isUnique": false + }, + "global_email": { + "name": "global_email", + "columns": ["email"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "user_workspace_id_id_pk": { + "name": "user_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "workspace": { + "name": "workspace", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "slug": { + "name": "slug", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "slug": { + "name": "slug", + "columns": ["slug"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "workspace_id": { + "name": "workspace_id", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + } + }, + "views": {}, + "_meta": { + "schemas": {}, + "tables": {}, + "columns": { + "\"usage\".\"data\"": "\"usage\".\"enrichment\"" + } + }, + "internal": { + "tables": {}, + "indexes": {} + } +} diff --git a/packages/console/core/migrations/meta/0045_snapshot.json b/packages/console/core/migrations/meta/0045_snapshot.json new file mode 100644 index 00000000000..6ab9760c680 --- /dev/null +++ b/packages/console/core/migrations/meta/0045_snapshot.json @@ -0,0 +1,1149 @@ +{ + "version": "5", + "dialect": "mysql", + "id": "27c1a3eb-b125-46d4-b436-abe5764fe4b7", + "prevId": "70394850-2c28-4012-a3d5-69357e3348b6", + "tables": { + "account": { + "name": "account", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "account_id_pk": { + "name": "account_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "auth": { + "name": "auth", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "enum('email','github','google')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "subject": { + "name": "subject", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "account_id": { + "name": "account_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "provider": { + "name": "provider", + "columns": ["provider", "subject"], + "isUnique": true + }, + "account_id": { + "name": "account_id", + "columns": ["account_id"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "auth_id_pk": { + "name": "auth_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "benchmark": { + "name": "benchmark", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "agent": { + "name": "agent", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "result": { + "name": "result", + "type": "mediumtext", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "time_created": { + "name": "time_created", + "columns": ["time_created"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "benchmark_id_pk": { + "name": "benchmark_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "billing": { + "name": "billing", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "customer_id": { + "name": "customer_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_id": { + "name": "payment_method_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_type": { + "name": "payment_method_type", + "type": "varchar(32)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_last4": { + "name": "payment_method_last4", + "type": "varchar(4)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "balance": { + "name": "balance", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "monthly_limit": { + "name": "monthly_limit", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "monthly_usage": { + "name": "monthly_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_monthly_usage_updated": { + "name": "time_monthly_usage_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload": { + "name": "reload", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_trigger": { + "name": "reload_trigger", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_amount": { + "name": "reload_amount", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_error": { + "name": "reload_error", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_reload_error": { + "name": "time_reload_error", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_reload_locked_till": { + "name": "time_reload_locked_till", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "subscription_id": { + "name": "subscription_id", + "type": "varchar(28)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "global_customer_id": { + "name": "global_customer_id", + "columns": ["customer_id"], + "isUnique": true + }, + "global_subscription_id": { + "name": "global_subscription_id", + "columns": ["subscription_id"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "billing_workspace_id_id_pk": { + "name": "billing_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "payment": { + "name": "payment", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "customer_id": { + "name": "customer_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "invoice_id": { + "name": "invoice_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_id": { + "name": "payment_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "amount": { + "name": "amount", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_refunded": { + "name": "time_refunded", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "payment_workspace_id_id_pk": { + "name": "payment_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "usage": { + "name": "usage", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "input_tokens": { + "name": "input_tokens", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "output_tokens": { + "name": "output_tokens", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "reasoning_tokens": { + "name": "reasoning_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_read_tokens": { + "name": "cache_read_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_write_5m_tokens": { + "name": "cache_write_5m_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_write_1h_tokens": { + "name": "cache_write_1h_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cost": { + "name": "cost", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "key_id": { + "name": "key_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "enrichment": { + "name": "enrichment", + "type": "json", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "usage_time_created": { + "name": "usage_time_created", + "columns": ["workspace_id", "time_created"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "usage_workspace_id_id_pk": { + "name": "usage_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "ip_rate_limit": { + "name": "ip_rate_limit", + "columns": { + "ip": { + "name": "ip", + "type": "varchar(45)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "interval": { + "name": "interval", + "type": "varchar(10)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "count": { + "name": "count", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "ip_rate_limit_ip_interval_pk": { + "name": "ip_rate_limit_ip_interval_pk", + "columns": ["ip", "interval"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "ip": { + "name": "ip", + "columns": { + "ip": { + "name": "ip", + "type": "varchar(45)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "usage": { + "name": "usage", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "ip_ip_pk": { + "name": "ip_ip_pk", + "columns": ["ip"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "key": { + "name": "key", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "key": { + "name": "key", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_used": { + "name": "time_used", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "global_key": { + "name": "global_key", + "columns": ["key"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "key_workspace_id_id_pk": { + "name": "key_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "model": { + "name": "model", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "model_workspace_model": { + "name": "model_workspace_model", + "columns": ["workspace_id", "model"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "model_workspace_id_id_pk": { + "name": "model_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "provider": { + "name": "provider", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "credentials": { + "name": "credentials", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "workspace_provider": { + "name": "workspace_provider", + "columns": ["workspace_id", "provider"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "provider_workspace_id_id_pk": { + "name": "provider_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "user": { + "name": "user", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "account_id": { + "name": "account_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "email": { + "name": "email", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_seen": { + "name": "time_seen", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "color": { + "name": "color", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "role": { + "name": "role", + "type": "enum('admin','member')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "monthly_limit": { + "name": "monthly_limit", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "monthly_usage": { + "name": "monthly_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_monthly_usage_updated": { + "name": "time_monthly_usage_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_subscribed": { + "name": "time_subscribed", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sub_interval_usage": { + "name": "sub_interval_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sub_monthly_usage": { + "name": "sub_monthly_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sub_time_interval_usage_updated": { + "name": "sub_time_interval_usage_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sub_time_monthly_usage_updated": { + "name": "sub_time_monthly_usage_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "user_account_id": { + "name": "user_account_id", + "columns": ["workspace_id", "account_id"], + "isUnique": true + }, + "user_email": { + "name": "user_email", + "columns": ["workspace_id", "email"], + "isUnique": true + }, + "global_account_id": { + "name": "global_account_id", + "columns": ["account_id"], + "isUnique": false + }, + "global_email": { + "name": "global_email", + "columns": ["email"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "user_workspace_id_id_pk": { + "name": "user_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "workspace": { + "name": "workspace", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "slug": { + "name": "slug", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "slug": { + "name": "slug", + "columns": ["slug"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "workspace_id": { + "name": "workspace_id", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + } + }, + "views": {}, + "_meta": { + "schemas": {}, + "tables": {}, + "columns": {} + }, + "internal": { + "tables": {}, + "indexes": {} + } +} diff --git a/packages/console/core/migrations/meta/0046_snapshot.json b/packages/console/core/migrations/meta/0046_snapshot.json new file mode 100644 index 00000000000..46ff73e263a --- /dev/null +++ b/packages/console/core/migrations/meta/0046_snapshot.json @@ -0,0 +1,1236 @@ +{ + "version": "5", + "dialect": "mysql", + "id": "f3725f6d-5f33-4497-b4ba-cf05c46fb873", + "prevId": "27c1a3eb-b125-46d4-b436-abe5764fe4b7", + "tables": { + "account": { + "name": "account", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "account_id_pk": { + "name": "account_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "auth": { + "name": "auth", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "enum('email','github','google')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "subject": { + "name": "subject", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "account_id": { + "name": "account_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "provider": { + "name": "provider", + "columns": ["provider", "subject"], + "isUnique": true + }, + "account_id": { + "name": "account_id", + "columns": ["account_id"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "auth_id_pk": { + "name": "auth_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "benchmark": { + "name": "benchmark", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "agent": { + "name": "agent", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "result": { + "name": "result", + "type": "mediumtext", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "time_created": { + "name": "time_created", + "columns": ["time_created"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "benchmark_id_pk": { + "name": "benchmark_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "billing": { + "name": "billing", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "customer_id": { + "name": "customer_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_id": { + "name": "payment_method_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_type": { + "name": "payment_method_type", + "type": "varchar(32)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_last4": { + "name": "payment_method_last4", + "type": "varchar(4)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "balance": { + "name": "balance", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "monthly_limit": { + "name": "monthly_limit", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "monthly_usage": { + "name": "monthly_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_monthly_usage_updated": { + "name": "time_monthly_usage_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload": { + "name": "reload", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_trigger": { + "name": "reload_trigger", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_amount": { + "name": "reload_amount", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_error": { + "name": "reload_error", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_reload_error": { + "name": "time_reload_error", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_reload_locked_till": { + "name": "time_reload_locked_till", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "subscription_id": { + "name": "subscription_id", + "type": "varchar(28)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "global_customer_id": { + "name": "global_customer_id", + "columns": ["customer_id"], + "isUnique": true + }, + "global_subscription_id": { + "name": "global_subscription_id", + "columns": ["subscription_id"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "billing_workspace_id_id_pk": { + "name": "billing_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "payment": { + "name": "payment", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "customer_id": { + "name": "customer_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "invoice_id": { + "name": "invoice_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_id": { + "name": "payment_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "amount": { + "name": "amount", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_refunded": { + "name": "time_refunded", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "payment_workspace_id_id_pk": { + "name": "payment_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "subscription": { + "name": "subscription", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "rolling_usage": { + "name": "rolling_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "fixed_usage": { + "name": "fixed_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_rolling_updated": { + "name": "time_rolling_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_fixed_updated": { + "name": "time_fixed_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "subscription_workspace_id_id_pk": { + "name": "subscription_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "usage": { + "name": "usage", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "input_tokens": { + "name": "input_tokens", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "output_tokens": { + "name": "output_tokens", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "reasoning_tokens": { + "name": "reasoning_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_read_tokens": { + "name": "cache_read_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_write_5m_tokens": { + "name": "cache_write_5m_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_write_1h_tokens": { + "name": "cache_write_1h_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cost": { + "name": "cost", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "key_id": { + "name": "key_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "enrichment": { + "name": "enrichment", + "type": "json", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "usage_time_created": { + "name": "usage_time_created", + "columns": ["workspace_id", "time_created"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "usage_workspace_id_id_pk": { + "name": "usage_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "ip_rate_limit": { + "name": "ip_rate_limit", + "columns": { + "ip": { + "name": "ip", + "type": "varchar(45)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "interval": { + "name": "interval", + "type": "varchar(10)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "count": { + "name": "count", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "ip_rate_limit_ip_interval_pk": { + "name": "ip_rate_limit_ip_interval_pk", + "columns": ["ip", "interval"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "ip": { + "name": "ip", + "columns": { + "ip": { + "name": "ip", + "type": "varchar(45)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "usage": { + "name": "usage", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "ip_ip_pk": { + "name": "ip_ip_pk", + "columns": ["ip"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "key": { + "name": "key", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "key": { + "name": "key", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_used": { + "name": "time_used", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "global_key": { + "name": "global_key", + "columns": ["key"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "key_workspace_id_id_pk": { + "name": "key_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "model": { + "name": "model", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "model_workspace_model": { + "name": "model_workspace_model", + "columns": ["workspace_id", "model"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "model_workspace_id_id_pk": { + "name": "model_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "provider": { + "name": "provider", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "credentials": { + "name": "credentials", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "workspace_provider": { + "name": "workspace_provider", + "columns": ["workspace_id", "provider"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "provider_workspace_id_id_pk": { + "name": "provider_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "user": { + "name": "user", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "account_id": { + "name": "account_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "email": { + "name": "email", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_seen": { + "name": "time_seen", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "color": { + "name": "color", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "role": { + "name": "role", + "type": "enum('admin','member')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "monthly_limit": { + "name": "monthly_limit", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "monthly_usage": { + "name": "monthly_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_monthly_usage_updated": { + "name": "time_monthly_usage_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_subscribed": { + "name": "time_subscribed", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sub_interval_usage": { + "name": "sub_interval_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sub_monthly_usage": { + "name": "sub_monthly_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sub_time_interval_usage_updated": { + "name": "sub_time_interval_usage_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "sub_time_monthly_usage_updated": { + "name": "sub_time_monthly_usage_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "user_account_id": { + "name": "user_account_id", + "columns": ["workspace_id", "account_id"], + "isUnique": true + }, + "user_email": { + "name": "user_email", + "columns": ["workspace_id", "email"], + "isUnique": true + }, + "global_account_id": { + "name": "global_account_id", + "columns": ["account_id"], + "isUnique": false + }, + "global_email": { + "name": "global_email", + "columns": ["email"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "user_workspace_id_id_pk": { + "name": "user_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "workspace": { + "name": "workspace", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "slug": { + "name": "slug", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "slug": { + "name": "slug", + "columns": ["slug"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "workspace_id": { + "name": "workspace_id", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + } + }, + "views": {}, + "_meta": { + "schemas": {}, + "tables": {}, + "columns": {} + }, + "internal": { + "tables": {}, + "indexes": {} + } +} diff --git a/packages/console/core/migrations/meta/0047_snapshot.json b/packages/console/core/migrations/meta/0047_snapshot.json new file mode 100644 index 00000000000..f8002bd8bb6 --- /dev/null +++ b/packages/console/core/migrations/meta/0047_snapshot.json @@ -0,0 +1,1207 @@ +{ + "version": "5", + "dialect": "mysql", + "id": "fec4cb15-6f13-465d-a902-b76b026872f4", + "prevId": "f3725f6d-5f33-4497-b4ba-cf05c46fb873", + "tables": { + "account": { + "name": "account", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "account_id_pk": { + "name": "account_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "auth": { + "name": "auth", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "enum('email','github','google')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "subject": { + "name": "subject", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "account_id": { + "name": "account_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "provider": { + "name": "provider", + "columns": ["provider", "subject"], + "isUnique": true + }, + "account_id": { + "name": "account_id", + "columns": ["account_id"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "auth_id_pk": { + "name": "auth_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "benchmark": { + "name": "benchmark", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "agent": { + "name": "agent", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "result": { + "name": "result", + "type": "mediumtext", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "time_created": { + "name": "time_created", + "columns": ["time_created"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "benchmark_id_pk": { + "name": "benchmark_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "billing": { + "name": "billing", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "customer_id": { + "name": "customer_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_id": { + "name": "payment_method_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_type": { + "name": "payment_method_type", + "type": "varchar(32)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_last4": { + "name": "payment_method_last4", + "type": "varchar(4)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "balance": { + "name": "balance", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "monthly_limit": { + "name": "monthly_limit", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "monthly_usage": { + "name": "monthly_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_monthly_usage_updated": { + "name": "time_monthly_usage_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload": { + "name": "reload", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_trigger": { + "name": "reload_trigger", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_amount": { + "name": "reload_amount", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_error": { + "name": "reload_error", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_reload_error": { + "name": "time_reload_error", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_reload_locked_till": { + "name": "time_reload_locked_till", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "subscription_id": { + "name": "subscription_id", + "type": "varchar(28)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "global_customer_id": { + "name": "global_customer_id", + "columns": ["customer_id"], + "isUnique": true + }, + "global_subscription_id": { + "name": "global_subscription_id", + "columns": ["subscription_id"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "billing_workspace_id_id_pk": { + "name": "billing_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "payment": { + "name": "payment", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "customer_id": { + "name": "customer_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "invoice_id": { + "name": "invoice_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_id": { + "name": "payment_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "amount": { + "name": "amount", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_refunded": { + "name": "time_refunded", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "payment_workspace_id_id_pk": { + "name": "payment_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "subscription": { + "name": "subscription", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "rolling_usage": { + "name": "rolling_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "fixed_usage": { + "name": "fixed_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_rolling_updated": { + "name": "time_rolling_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_fixed_updated": { + "name": "time_fixed_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "workspace_user_id": { + "name": "workspace_user_id", + "columns": ["workspace_id", "user_id"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "subscription_workspace_id_id_pk": { + "name": "subscription_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "usage": { + "name": "usage", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "input_tokens": { + "name": "input_tokens", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "output_tokens": { + "name": "output_tokens", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "reasoning_tokens": { + "name": "reasoning_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_read_tokens": { + "name": "cache_read_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_write_5m_tokens": { + "name": "cache_write_5m_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_write_1h_tokens": { + "name": "cache_write_1h_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cost": { + "name": "cost", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "key_id": { + "name": "key_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "enrichment": { + "name": "enrichment", + "type": "json", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "usage_time_created": { + "name": "usage_time_created", + "columns": ["workspace_id", "time_created"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "usage_workspace_id_id_pk": { + "name": "usage_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "ip_rate_limit": { + "name": "ip_rate_limit", + "columns": { + "ip": { + "name": "ip", + "type": "varchar(45)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "interval": { + "name": "interval", + "type": "varchar(10)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "count": { + "name": "count", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "ip_rate_limit_ip_interval_pk": { + "name": "ip_rate_limit_ip_interval_pk", + "columns": ["ip", "interval"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "ip": { + "name": "ip", + "columns": { + "ip": { + "name": "ip", + "type": "varchar(45)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "usage": { + "name": "usage", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "ip_ip_pk": { + "name": "ip_ip_pk", + "columns": ["ip"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "key": { + "name": "key", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "key": { + "name": "key", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_used": { + "name": "time_used", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "global_key": { + "name": "global_key", + "columns": ["key"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "key_workspace_id_id_pk": { + "name": "key_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "model": { + "name": "model", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "model_workspace_model": { + "name": "model_workspace_model", + "columns": ["workspace_id", "model"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "model_workspace_id_id_pk": { + "name": "model_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "provider": { + "name": "provider", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "credentials": { + "name": "credentials", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "workspace_provider": { + "name": "workspace_provider", + "columns": ["workspace_id", "provider"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "provider_workspace_id_id_pk": { + "name": "provider_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "user": { + "name": "user", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "account_id": { + "name": "account_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "email": { + "name": "email", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_seen": { + "name": "time_seen", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "color": { + "name": "color", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "role": { + "name": "role", + "type": "enum('admin','member')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "monthly_limit": { + "name": "monthly_limit", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "monthly_usage": { + "name": "monthly_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_monthly_usage_updated": { + "name": "time_monthly_usage_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "user_account_id": { + "name": "user_account_id", + "columns": ["workspace_id", "account_id"], + "isUnique": true + }, + "user_email": { + "name": "user_email", + "columns": ["workspace_id", "email"], + "isUnique": true + }, + "global_account_id": { + "name": "global_account_id", + "columns": ["account_id"], + "isUnique": false + }, + "global_email": { + "name": "global_email", + "columns": ["email"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "user_workspace_id_id_pk": { + "name": "user_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "workspace": { + "name": "workspace", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "slug": { + "name": "slug", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "slug": { + "name": "slug", + "columns": ["slug"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "workspace_id": { + "name": "workspace_id", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + } + }, + "views": {}, + "_meta": { + "schemas": {}, + "tables": {}, + "columns": {} + }, + "internal": { + "tables": {}, + "indexes": {} + } +} diff --git a/packages/console/core/migrations/meta/0048_snapshot.json b/packages/console/core/migrations/meta/0048_snapshot.json new file mode 100644 index 00000000000..e0593749b38 --- /dev/null +++ b/packages/console/core/migrations/meta/0048_snapshot.json @@ -0,0 +1,1207 @@ +{ + "version": "5", + "dialect": "mysql", + "id": "bb90bb3e-fd08-439a-b92f-5f433807480e", + "prevId": "fec4cb15-6f13-465d-a902-b76b026872f4", + "tables": { + "account": { + "name": "account", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "account_id_pk": { + "name": "account_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "auth": { + "name": "auth", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "enum('email','github','google')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "subject": { + "name": "subject", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "account_id": { + "name": "account_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "provider": { + "name": "provider", + "columns": ["provider", "subject"], + "isUnique": true + }, + "account_id": { + "name": "account_id", + "columns": ["account_id"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "auth_id_pk": { + "name": "auth_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "benchmark": { + "name": "benchmark", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "agent": { + "name": "agent", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "result": { + "name": "result", + "type": "mediumtext", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "time_created": { + "name": "time_created", + "columns": ["time_created"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "benchmark_id_pk": { + "name": "benchmark_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "billing": { + "name": "billing", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "customer_id": { + "name": "customer_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_id": { + "name": "payment_method_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_type": { + "name": "payment_method_type", + "type": "varchar(32)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_last4": { + "name": "payment_method_last4", + "type": "varchar(4)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "balance": { + "name": "balance", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "monthly_limit": { + "name": "monthly_limit", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "monthly_usage": { + "name": "monthly_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_monthly_usage_updated": { + "name": "time_monthly_usage_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload": { + "name": "reload", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_trigger": { + "name": "reload_trigger", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_amount": { + "name": "reload_amount", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_error": { + "name": "reload_error", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_reload_error": { + "name": "time_reload_error", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_reload_locked_till": { + "name": "time_reload_locked_till", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "subscription_id": { + "name": "subscription_id", + "type": "varchar(28)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "global_customer_id": { + "name": "global_customer_id", + "columns": ["customer_id"], + "isUnique": true + }, + "global_subscription_id": { + "name": "global_subscription_id", + "columns": ["subscription_id"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "billing_workspace_id_id_pk": { + "name": "billing_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "payment": { + "name": "payment", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "customer_id": { + "name": "customer_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "invoice_id": { + "name": "invoice_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_id": { + "name": "payment_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "amount": { + "name": "amount", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_refunded": { + "name": "time_refunded", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "payment_workspace_id_id_pk": { + "name": "payment_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "subscription": { + "name": "subscription", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "rolling_usage": { + "name": "rolling_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "fixed_usage": { + "name": "fixed_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_rolling_updated": { + "name": "time_rolling_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_fixed_updated": { + "name": "time_fixed_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "workspace_user_id": { + "name": "workspace_user_id", + "columns": ["workspace_id", "user_id"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "subscription_workspace_id_id_pk": { + "name": "subscription_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "usage": { + "name": "usage", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "input_tokens": { + "name": "input_tokens", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "output_tokens": { + "name": "output_tokens", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "reasoning_tokens": { + "name": "reasoning_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_read_tokens": { + "name": "cache_read_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_write_5m_tokens": { + "name": "cache_write_5m_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_write_1h_tokens": { + "name": "cache_write_1h_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cost": { + "name": "cost", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "key_id": { + "name": "key_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "enrichment": { + "name": "enrichment", + "type": "json", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "usage_time_created": { + "name": "usage_time_created", + "columns": ["workspace_id", "time_created"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "usage_workspace_id_id_pk": { + "name": "usage_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "ip_rate_limit": { + "name": "ip_rate_limit", + "columns": { + "ip": { + "name": "ip", + "type": "varchar(45)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "interval": { + "name": "interval", + "type": "varchar(10)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "count": { + "name": "count", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "ip_rate_limit_ip_interval_pk": { + "name": "ip_rate_limit_ip_interval_pk", + "columns": ["ip", "interval"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "ip": { + "name": "ip", + "columns": { + "ip": { + "name": "ip", + "type": "varchar(45)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "usage": { + "name": "usage", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "ip_ip_pk": { + "name": "ip_ip_pk", + "columns": ["ip"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "key": { + "name": "key", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "key": { + "name": "key", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_used": { + "name": "time_used", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "global_key": { + "name": "global_key", + "columns": ["key"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "key_workspace_id_id_pk": { + "name": "key_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "model": { + "name": "model", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "model_workspace_model": { + "name": "model_workspace_model", + "columns": ["workspace_id", "model"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "model_workspace_id_id_pk": { + "name": "model_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "provider": { + "name": "provider", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "credentials": { + "name": "credentials", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "workspace_provider": { + "name": "workspace_provider", + "columns": ["workspace_id", "provider"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "provider_workspace_id_id_pk": { + "name": "provider_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "user": { + "name": "user", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "account_id": { + "name": "account_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "email": { + "name": "email", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_seen": { + "name": "time_seen", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "color": { + "name": "color", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "role": { + "name": "role", + "type": "enum('admin','member')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "monthly_limit": { + "name": "monthly_limit", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "monthly_usage": { + "name": "monthly_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_monthly_usage_updated": { + "name": "time_monthly_usage_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "user_account_id": { + "name": "user_account_id", + "columns": ["workspace_id", "account_id"], + "isUnique": true + }, + "user_email": { + "name": "user_email", + "columns": ["workspace_id", "email"], + "isUnique": true + }, + "global_account_id": { + "name": "global_account_id", + "columns": ["account_id"], + "isUnique": false + }, + "global_email": { + "name": "global_email", + "columns": ["email"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "user_workspace_id_id_pk": { + "name": "user_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "workspace": { + "name": "workspace", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "slug": { + "name": "slug", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "slug": { + "name": "slug", + "columns": ["slug"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "workspace_id": { + "name": "workspace_id", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + } + }, + "views": {}, + "_meta": { + "schemas": {}, + "tables": {}, + "columns": {} + }, + "internal": { + "tables": {}, + "indexes": {} + } +} diff --git a/packages/console/core/migrations/meta/0049_snapshot.json b/packages/console/core/migrations/meta/0049_snapshot.json new file mode 100644 index 00000000000..58679382e52 --- /dev/null +++ b/packages/console/core/migrations/meta/0049_snapshot.json @@ -0,0 +1,1214 @@ +{ + "version": "5", + "dialect": "mysql", + "id": "2fd0308b-0653-437d-aea3-29428a4de9f1", + "prevId": "bb90bb3e-fd08-439a-b92f-5f433807480e", + "tables": { + "account": { + "name": "account", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "account_id_pk": { + "name": "account_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "auth": { + "name": "auth", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "enum('email','github','google')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "subject": { + "name": "subject", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "account_id": { + "name": "account_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "provider": { + "name": "provider", + "columns": ["provider", "subject"], + "isUnique": true + }, + "account_id": { + "name": "account_id", + "columns": ["account_id"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "auth_id_pk": { + "name": "auth_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "benchmark": { + "name": "benchmark", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "agent": { + "name": "agent", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "result": { + "name": "result", + "type": "mediumtext", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "time_created": { + "name": "time_created", + "columns": ["time_created"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "benchmark_id_pk": { + "name": "benchmark_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "billing": { + "name": "billing", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "customer_id": { + "name": "customer_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_id": { + "name": "payment_method_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_type": { + "name": "payment_method_type", + "type": "varchar(32)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_last4": { + "name": "payment_method_last4", + "type": "varchar(4)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "balance": { + "name": "balance", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "monthly_limit": { + "name": "monthly_limit", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "monthly_usage": { + "name": "monthly_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_monthly_usage_updated": { + "name": "time_monthly_usage_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload": { + "name": "reload", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_trigger": { + "name": "reload_trigger", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_amount": { + "name": "reload_amount", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_error": { + "name": "reload_error", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_reload_error": { + "name": "time_reload_error", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_reload_locked_till": { + "name": "time_reload_locked_till", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "subscription_id": { + "name": "subscription_id", + "type": "varchar(28)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "subscription_coupon_id": { + "name": "subscription_coupon_id", + "type": "varchar(28)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "global_customer_id": { + "name": "global_customer_id", + "columns": ["customer_id"], + "isUnique": true + }, + "global_subscription_id": { + "name": "global_subscription_id", + "columns": ["subscription_id"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "billing_workspace_id_id_pk": { + "name": "billing_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "payment": { + "name": "payment", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "customer_id": { + "name": "customer_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "invoice_id": { + "name": "invoice_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_id": { + "name": "payment_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "amount": { + "name": "amount", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_refunded": { + "name": "time_refunded", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "payment_workspace_id_id_pk": { + "name": "payment_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "subscription": { + "name": "subscription", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "rolling_usage": { + "name": "rolling_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "fixed_usage": { + "name": "fixed_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_rolling_updated": { + "name": "time_rolling_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_fixed_updated": { + "name": "time_fixed_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "workspace_user_id": { + "name": "workspace_user_id", + "columns": ["workspace_id", "user_id"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "subscription_workspace_id_id_pk": { + "name": "subscription_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "usage": { + "name": "usage", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "input_tokens": { + "name": "input_tokens", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "output_tokens": { + "name": "output_tokens", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "reasoning_tokens": { + "name": "reasoning_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_read_tokens": { + "name": "cache_read_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_write_5m_tokens": { + "name": "cache_write_5m_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_write_1h_tokens": { + "name": "cache_write_1h_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cost": { + "name": "cost", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "key_id": { + "name": "key_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "enrichment": { + "name": "enrichment", + "type": "json", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "usage_time_created": { + "name": "usage_time_created", + "columns": ["workspace_id", "time_created"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "usage_workspace_id_id_pk": { + "name": "usage_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "ip_rate_limit": { + "name": "ip_rate_limit", + "columns": { + "ip": { + "name": "ip", + "type": "varchar(45)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "interval": { + "name": "interval", + "type": "varchar(10)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "count": { + "name": "count", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "ip_rate_limit_ip_interval_pk": { + "name": "ip_rate_limit_ip_interval_pk", + "columns": ["ip", "interval"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "ip": { + "name": "ip", + "columns": { + "ip": { + "name": "ip", + "type": "varchar(45)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "usage": { + "name": "usage", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "ip_ip_pk": { + "name": "ip_ip_pk", + "columns": ["ip"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "key": { + "name": "key", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "key": { + "name": "key", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_used": { + "name": "time_used", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "global_key": { + "name": "global_key", + "columns": ["key"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "key_workspace_id_id_pk": { + "name": "key_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "model": { + "name": "model", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "model_workspace_model": { + "name": "model_workspace_model", + "columns": ["workspace_id", "model"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "model_workspace_id_id_pk": { + "name": "model_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "provider": { + "name": "provider", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "credentials": { + "name": "credentials", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "workspace_provider": { + "name": "workspace_provider", + "columns": ["workspace_id", "provider"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "provider_workspace_id_id_pk": { + "name": "provider_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "user": { + "name": "user", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "account_id": { + "name": "account_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "email": { + "name": "email", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_seen": { + "name": "time_seen", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "color": { + "name": "color", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "role": { + "name": "role", + "type": "enum('admin','member')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "monthly_limit": { + "name": "monthly_limit", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "monthly_usage": { + "name": "monthly_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_monthly_usage_updated": { + "name": "time_monthly_usage_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "user_account_id": { + "name": "user_account_id", + "columns": ["workspace_id", "account_id"], + "isUnique": true + }, + "user_email": { + "name": "user_email", + "columns": ["workspace_id", "email"], + "isUnique": true + }, + "global_account_id": { + "name": "global_account_id", + "columns": ["account_id"], + "isUnique": false + }, + "global_email": { + "name": "global_email", + "columns": ["email"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "user_workspace_id_id_pk": { + "name": "user_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "workspace": { + "name": "workspace", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "slug": { + "name": "slug", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "slug": { + "name": "slug", + "columns": ["slug"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "workspace_id": { + "name": "workspace_id", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + } + }, + "views": {}, + "_meta": { + "schemas": {}, + "tables": {}, + "columns": {} + }, + "internal": { + "tables": {}, + "indexes": {} + } +} diff --git a/packages/console/core/migrations/meta/0050_snapshot.json b/packages/console/core/migrations/meta/0050_snapshot.json new file mode 100644 index 00000000000..75289bc262d --- /dev/null +++ b/packages/console/core/migrations/meta/0050_snapshot.json @@ -0,0 +1,1221 @@ +{ + "version": "5", + "dialect": "mysql", + "id": "a0d18802-c390-47d4-98f1-d1f83869cf0c", + "prevId": "2fd0308b-0653-437d-aea3-29428a4de9f1", + "tables": { + "account": { + "name": "account", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "account_id_pk": { + "name": "account_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "auth": { + "name": "auth", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "enum('email','github','google')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "subject": { + "name": "subject", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "account_id": { + "name": "account_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "provider": { + "name": "provider", + "columns": ["provider", "subject"], + "isUnique": true + }, + "account_id": { + "name": "account_id", + "columns": ["account_id"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "auth_id_pk": { + "name": "auth_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "benchmark": { + "name": "benchmark", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "agent": { + "name": "agent", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "result": { + "name": "result", + "type": "mediumtext", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "time_created": { + "name": "time_created", + "columns": ["time_created"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "benchmark_id_pk": { + "name": "benchmark_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "billing": { + "name": "billing", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "customer_id": { + "name": "customer_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_id": { + "name": "payment_method_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_type": { + "name": "payment_method_type", + "type": "varchar(32)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_last4": { + "name": "payment_method_last4", + "type": "varchar(4)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "balance": { + "name": "balance", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "monthly_limit": { + "name": "monthly_limit", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "monthly_usage": { + "name": "monthly_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_monthly_usage_updated": { + "name": "time_monthly_usage_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload": { + "name": "reload", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_trigger": { + "name": "reload_trigger", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_amount": { + "name": "reload_amount", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_error": { + "name": "reload_error", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_reload_error": { + "name": "time_reload_error", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_reload_locked_till": { + "name": "time_reload_locked_till", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "subscription_id": { + "name": "subscription_id", + "type": "varchar(28)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "subscription_coupon_id": { + "name": "subscription_coupon_id", + "type": "varchar(28)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "global_customer_id": { + "name": "global_customer_id", + "columns": ["customer_id"], + "isUnique": true + }, + "global_subscription_id": { + "name": "global_subscription_id", + "columns": ["subscription_id"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "billing_workspace_id_id_pk": { + "name": "billing_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "payment": { + "name": "payment", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "customer_id": { + "name": "customer_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "invoice_id": { + "name": "invoice_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_id": { + "name": "payment_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "amount": { + "name": "amount", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_refunded": { + "name": "time_refunded", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "enrichment": { + "name": "enrichment", + "type": "json", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "payment_workspace_id_id_pk": { + "name": "payment_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "subscription": { + "name": "subscription", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "rolling_usage": { + "name": "rolling_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "fixed_usage": { + "name": "fixed_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_rolling_updated": { + "name": "time_rolling_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_fixed_updated": { + "name": "time_fixed_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "workspace_user_id": { + "name": "workspace_user_id", + "columns": ["workspace_id", "user_id"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "subscription_workspace_id_id_pk": { + "name": "subscription_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "usage": { + "name": "usage", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "input_tokens": { + "name": "input_tokens", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "output_tokens": { + "name": "output_tokens", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "reasoning_tokens": { + "name": "reasoning_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_read_tokens": { + "name": "cache_read_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_write_5m_tokens": { + "name": "cache_write_5m_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_write_1h_tokens": { + "name": "cache_write_1h_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cost": { + "name": "cost", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "key_id": { + "name": "key_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "enrichment": { + "name": "enrichment", + "type": "json", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "usage_time_created": { + "name": "usage_time_created", + "columns": ["workspace_id", "time_created"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "usage_workspace_id_id_pk": { + "name": "usage_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "ip_rate_limit": { + "name": "ip_rate_limit", + "columns": { + "ip": { + "name": "ip", + "type": "varchar(45)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "interval": { + "name": "interval", + "type": "varchar(10)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "count": { + "name": "count", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "ip_rate_limit_ip_interval_pk": { + "name": "ip_rate_limit_ip_interval_pk", + "columns": ["ip", "interval"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "ip": { + "name": "ip", + "columns": { + "ip": { + "name": "ip", + "type": "varchar(45)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "usage": { + "name": "usage", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "ip_ip_pk": { + "name": "ip_ip_pk", + "columns": ["ip"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "key": { + "name": "key", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "key": { + "name": "key", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_used": { + "name": "time_used", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "global_key": { + "name": "global_key", + "columns": ["key"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "key_workspace_id_id_pk": { + "name": "key_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "model": { + "name": "model", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "model_workspace_model": { + "name": "model_workspace_model", + "columns": ["workspace_id", "model"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "model_workspace_id_id_pk": { + "name": "model_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "provider": { + "name": "provider", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "credentials": { + "name": "credentials", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "workspace_provider": { + "name": "workspace_provider", + "columns": ["workspace_id", "provider"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "provider_workspace_id_id_pk": { + "name": "provider_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "user": { + "name": "user", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "account_id": { + "name": "account_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "email": { + "name": "email", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_seen": { + "name": "time_seen", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "color": { + "name": "color", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "role": { + "name": "role", + "type": "enum('admin','member')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "monthly_limit": { + "name": "monthly_limit", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "monthly_usage": { + "name": "monthly_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_monthly_usage_updated": { + "name": "time_monthly_usage_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "user_account_id": { + "name": "user_account_id", + "columns": ["workspace_id", "account_id"], + "isUnique": true + }, + "user_email": { + "name": "user_email", + "columns": ["workspace_id", "email"], + "isUnique": true + }, + "global_account_id": { + "name": "global_account_id", + "columns": ["account_id"], + "isUnique": false + }, + "global_email": { + "name": "global_email", + "columns": ["email"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "user_workspace_id_id_pk": { + "name": "user_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "workspace": { + "name": "workspace", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "slug": { + "name": "slug", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "slug": { + "name": "slug", + "columns": ["slug"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "workspace_id": { + "name": "workspace_id", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + } + }, + "views": {}, + "_meta": { + "schemas": {}, + "tables": {}, + "columns": {} + }, + "internal": { + "tables": {}, + "indexes": {} + } +} diff --git a/packages/console/core/migrations/meta/0051_snapshot.json b/packages/console/core/migrations/meta/0051_snapshot.json new file mode 100644 index 00000000000..0f904791623 --- /dev/null +++ b/packages/console/core/migrations/meta/0051_snapshot.json @@ -0,0 +1,1228 @@ +{ + "version": "5", + "dialect": "mysql", + "id": "14cbf4c8-55f1-4488-956f-56fb5ccb3a5a", + "prevId": "a0d18802-c390-47d4-98f1-d1f83869cf0c", + "tables": { + "account": { + "name": "account", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "account_id_pk": { + "name": "account_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "auth": { + "name": "auth", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "enum('email','github','google')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "subject": { + "name": "subject", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "account_id": { + "name": "account_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "provider": { + "name": "provider", + "columns": ["provider", "subject"], + "isUnique": true + }, + "account_id": { + "name": "account_id", + "columns": ["account_id"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "auth_id_pk": { + "name": "auth_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "benchmark": { + "name": "benchmark", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "agent": { + "name": "agent", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "result": { + "name": "result", + "type": "mediumtext", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "time_created": { + "name": "time_created", + "columns": ["time_created"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "benchmark_id_pk": { + "name": "benchmark_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "billing": { + "name": "billing", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "customer_id": { + "name": "customer_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_id": { + "name": "payment_method_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_type": { + "name": "payment_method_type", + "type": "varchar(32)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_last4": { + "name": "payment_method_last4", + "type": "varchar(4)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "balance": { + "name": "balance", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "monthly_limit": { + "name": "monthly_limit", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "monthly_usage": { + "name": "monthly_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_monthly_usage_updated": { + "name": "time_monthly_usage_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload": { + "name": "reload", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_trigger": { + "name": "reload_trigger", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_amount": { + "name": "reload_amount", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_error": { + "name": "reload_error", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_reload_error": { + "name": "time_reload_error", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_reload_locked_till": { + "name": "time_reload_locked_till", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "subscription_id": { + "name": "subscription_id", + "type": "varchar(28)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "subscription_coupon_id": { + "name": "subscription_coupon_id", + "type": "varchar(28)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_subscription_booked": { + "name": "time_subscription_booked", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "global_customer_id": { + "name": "global_customer_id", + "columns": ["customer_id"], + "isUnique": true + }, + "global_subscription_id": { + "name": "global_subscription_id", + "columns": ["subscription_id"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "billing_workspace_id_id_pk": { + "name": "billing_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "payment": { + "name": "payment", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "customer_id": { + "name": "customer_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "invoice_id": { + "name": "invoice_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_id": { + "name": "payment_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "amount": { + "name": "amount", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_refunded": { + "name": "time_refunded", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "enrichment": { + "name": "enrichment", + "type": "json", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "payment_workspace_id_id_pk": { + "name": "payment_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "subscription": { + "name": "subscription", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "rolling_usage": { + "name": "rolling_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "fixed_usage": { + "name": "fixed_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_rolling_updated": { + "name": "time_rolling_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_fixed_updated": { + "name": "time_fixed_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "workspace_user_id": { + "name": "workspace_user_id", + "columns": ["workspace_id", "user_id"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "subscription_workspace_id_id_pk": { + "name": "subscription_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "usage": { + "name": "usage", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "input_tokens": { + "name": "input_tokens", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "output_tokens": { + "name": "output_tokens", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "reasoning_tokens": { + "name": "reasoning_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_read_tokens": { + "name": "cache_read_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_write_5m_tokens": { + "name": "cache_write_5m_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_write_1h_tokens": { + "name": "cache_write_1h_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cost": { + "name": "cost", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "key_id": { + "name": "key_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "enrichment": { + "name": "enrichment", + "type": "json", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "usage_time_created": { + "name": "usage_time_created", + "columns": ["workspace_id", "time_created"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "usage_workspace_id_id_pk": { + "name": "usage_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "ip_rate_limit": { + "name": "ip_rate_limit", + "columns": { + "ip": { + "name": "ip", + "type": "varchar(45)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "interval": { + "name": "interval", + "type": "varchar(10)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "count": { + "name": "count", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "ip_rate_limit_ip_interval_pk": { + "name": "ip_rate_limit_ip_interval_pk", + "columns": ["ip", "interval"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "ip": { + "name": "ip", + "columns": { + "ip": { + "name": "ip", + "type": "varchar(45)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "usage": { + "name": "usage", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "ip_ip_pk": { + "name": "ip_ip_pk", + "columns": ["ip"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "key": { + "name": "key", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "key": { + "name": "key", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_used": { + "name": "time_used", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "global_key": { + "name": "global_key", + "columns": ["key"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "key_workspace_id_id_pk": { + "name": "key_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "model": { + "name": "model", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "model_workspace_model": { + "name": "model_workspace_model", + "columns": ["workspace_id", "model"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "model_workspace_id_id_pk": { + "name": "model_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "provider": { + "name": "provider", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "credentials": { + "name": "credentials", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "workspace_provider": { + "name": "workspace_provider", + "columns": ["workspace_id", "provider"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "provider_workspace_id_id_pk": { + "name": "provider_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "user": { + "name": "user", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "account_id": { + "name": "account_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "email": { + "name": "email", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_seen": { + "name": "time_seen", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "color": { + "name": "color", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "role": { + "name": "role", + "type": "enum('admin','member')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "monthly_limit": { + "name": "monthly_limit", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "monthly_usage": { + "name": "monthly_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_monthly_usage_updated": { + "name": "time_monthly_usage_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "user_account_id": { + "name": "user_account_id", + "columns": ["workspace_id", "account_id"], + "isUnique": true + }, + "user_email": { + "name": "user_email", + "columns": ["workspace_id", "email"], + "isUnique": true + }, + "global_account_id": { + "name": "global_account_id", + "columns": ["account_id"], + "isUnique": false + }, + "global_email": { + "name": "global_email", + "columns": ["email"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "user_workspace_id_id_pk": { + "name": "user_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "workspace": { + "name": "workspace", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "slug": { + "name": "slug", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "slug": { + "name": "slug", + "columns": ["slug"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "workspace_id": { + "name": "workspace_id", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + } + }, + "views": {}, + "_meta": { + "schemas": {}, + "tables": {}, + "columns": {} + }, + "internal": { + "tables": {}, + "indexes": {} + } +} diff --git a/packages/console/core/migrations/meta/0052_snapshot.json b/packages/console/core/migrations/meta/0052_snapshot.json new file mode 100644 index 00000000000..339e153eba8 --- /dev/null +++ b/packages/console/core/migrations/meta/0052_snapshot.json @@ -0,0 +1,1235 @@ +{ + "version": "5", + "dialect": "mysql", + "id": "00774acd-a1e5-49c0-b296-cacc9506a566", + "prevId": "14cbf4c8-55f1-4488-956f-56fb5ccb3a5a", + "tables": { + "account": { + "name": "account", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "account_id_pk": { + "name": "account_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "auth": { + "name": "auth", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "enum('email','github','google')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "subject": { + "name": "subject", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "account_id": { + "name": "account_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "provider": { + "name": "provider", + "columns": ["provider", "subject"], + "isUnique": true + }, + "account_id": { + "name": "account_id", + "columns": ["account_id"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "auth_id_pk": { + "name": "auth_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "benchmark": { + "name": "benchmark", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "agent": { + "name": "agent", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "result": { + "name": "result", + "type": "mediumtext", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "time_created": { + "name": "time_created", + "columns": ["time_created"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "benchmark_id_pk": { + "name": "benchmark_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "billing": { + "name": "billing", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "customer_id": { + "name": "customer_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_id": { + "name": "payment_method_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_type": { + "name": "payment_method_type", + "type": "varchar(32)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_last4": { + "name": "payment_method_last4", + "type": "varchar(4)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "balance": { + "name": "balance", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "monthly_limit": { + "name": "monthly_limit", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "monthly_usage": { + "name": "monthly_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_monthly_usage_updated": { + "name": "time_monthly_usage_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload": { + "name": "reload", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_trigger": { + "name": "reload_trigger", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_amount": { + "name": "reload_amount", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_error": { + "name": "reload_error", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_reload_error": { + "name": "time_reload_error", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_reload_locked_till": { + "name": "time_reload_locked_till", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "subscription_id": { + "name": "subscription_id", + "type": "varchar(28)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "subscription_coupon_id": { + "name": "subscription_coupon_id", + "type": "varchar(28)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "subscription_plan": { + "name": "subscription_plan", + "type": "enum('20','100','200')", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_subscription_booked": { + "name": "time_subscription_booked", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "global_customer_id": { + "name": "global_customer_id", + "columns": ["customer_id"], + "isUnique": true + }, + "global_subscription_id": { + "name": "global_subscription_id", + "columns": ["subscription_id"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "billing_workspace_id_id_pk": { + "name": "billing_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "payment": { + "name": "payment", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "customer_id": { + "name": "customer_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "invoice_id": { + "name": "invoice_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_id": { + "name": "payment_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "amount": { + "name": "amount", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_refunded": { + "name": "time_refunded", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "enrichment": { + "name": "enrichment", + "type": "json", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "payment_workspace_id_id_pk": { + "name": "payment_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "subscription": { + "name": "subscription", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "rolling_usage": { + "name": "rolling_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "fixed_usage": { + "name": "fixed_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_rolling_updated": { + "name": "time_rolling_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_fixed_updated": { + "name": "time_fixed_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "workspace_user_id": { + "name": "workspace_user_id", + "columns": ["workspace_id", "user_id"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "subscription_workspace_id_id_pk": { + "name": "subscription_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "usage": { + "name": "usage", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "input_tokens": { + "name": "input_tokens", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "output_tokens": { + "name": "output_tokens", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "reasoning_tokens": { + "name": "reasoning_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_read_tokens": { + "name": "cache_read_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_write_5m_tokens": { + "name": "cache_write_5m_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_write_1h_tokens": { + "name": "cache_write_1h_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cost": { + "name": "cost", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "key_id": { + "name": "key_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "enrichment": { + "name": "enrichment", + "type": "json", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "usage_time_created": { + "name": "usage_time_created", + "columns": ["workspace_id", "time_created"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "usage_workspace_id_id_pk": { + "name": "usage_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "ip_rate_limit": { + "name": "ip_rate_limit", + "columns": { + "ip": { + "name": "ip", + "type": "varchar(45)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "interval": { + "name": "interval", + "type": "varchar(10)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "count": { + "name": "count", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "ip_rate_limit_ip_interval_pk": { + "name": "ip_rate_limit_ip_interval_pk", + "columns": ["ip", "interval"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "ip": { + "name": "ip", + "columns": { + "ip": { + "name": "ip", + "type": "varchar(45)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "usage": { + "name": "usage", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "ip_ip_pk": { + "name": "ip_ip_pk", + "columns": ["ip"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "key": { + "name": "key", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "key": { + "name": "key", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_used": { + "name": "time_used", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "global_key": { + "name": "global_key", + "columns": ["key"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "key_workspace_id_id_pk": { + "name": "key_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "model": { + "name": "model", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "model_workspace_model": { + "name": "model_workspace_model", + "columns": ["workspace_id", "model"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "model_workspace_id_id_pk": { + "name": "model_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "provider": { + "name": "provider", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "credentials": { + "name": "credentials", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "workspace_provider": { + "name": "workspace_provider", + "columns": ["workspace_id", "provider"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "provider_workspace_id_id_pk": { + "name": "provider_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "user": { + "name": "user", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "account_id": { + "name": "account_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "email": { + "name": "email", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_seen": { + "name": "time_seen", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "color": { + "name": "color", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "role": { + "name": "role", + "type": "enum('admin','member')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "monthly_limit": { + "name": "monthly_limit", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "monthly_usage": { + "name": "monthly_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_monthly_usage_updated": { + "name": "time_monthly_usage_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "user_account_id": { + "name": "user_account_id", + "columns": ["workspace_id", "account_id"], + "isUnique": true + }, + "user_email": { + "name": "user_email", + "columns": ["workspace_id", "email"], + "isUnique": true + }, + "global_account_id": { + "name": "global_account_id", + "columns": ["account_id"], + "isUnique": false + }, + "global_email": { + "name": "global_email", + "columns": ["email"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "user_workspace_id_id_pk": { + "name": "user_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "workspace": { + "name": "workspace", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "slug": { + "name": "slug", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "slug": { + "name": "slug", + "columns": ["slug"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "workspace_id": { + "name": "workspace_id", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + } + }, + "views": {}, + "_meta": { + "schemas": {}, + "tables": {}, + "columns": {} + }, + "internal": { + "tables": {}, + "indexes": {} + } +} diff --git a/packages/console/core/migrations/meta/0053_snapshot.json b/packages/console/core/migrations/meta/0053_snapshot.json new file mode 100644 index 00000000000..75a2cb7c929 --- /dev/null +++ b/packages/console/core/migrations/meta/0053_snapshot.json @@ -0,0 +1,1242 @@ +{ + "version": "5", + "dialect": "mysql", + "id": "32a0c40b-a269-4ad1-a5a0-52b1f18932aa", + "prevId": "00774acd-a1e5-49c0-b296-cacc9506a566", + "tables": { + "account": { + "name": "account", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "account_id_pk": { + "name": "account_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "auth": { + "name": "auth", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "enum('email','github','google')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "subject": { + "name": "subject", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "account_id": { + "name": "account_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "provider": { + "name": "provider", + "columns": ["provider", "subject"], + "isUnique": true + }, + "account_id": { + "name": "account_id", + "columns": ["account_id"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "auth_id_pk": { + "name": "auth_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "benchmark": { + "name": "benchmark", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "agent": { + "name": "agent", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "result": { + "name": "result", + "type": "mediumtext", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "time_created": { + "name": "time_created", + "columns": ["time_created"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "benchmark_id_pk": { + "name": "benchmark_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "billing": { + "name": "billing", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "customer_id": { + "name": "customer_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_id": { + "name": "payment_method_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_type": { + "name": "payment_method_type", + "type": "varchar(32)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_last4": { + "name": "payment_method_last4", + "type": "varchar(4)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "balance": { + "name": "balance", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "monthly_limit": { + "name": "monthly_limit", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "monthly_usage": { + "name": "monthly_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_monthly_usage_updated": { + "name": "time_monthly_usage_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload": { + "name": "reload", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_trigger": { + "name": "reload_trigger", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_amount": { + "name": "reload_amount", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_error": { + "name": "reload_error", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_reload_error": { + "name": "time_reload_error", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_reload_locked_till": { + "name": "time_reload_locked_till", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "subscription": { + "name": "subscription", + "type": "json", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "subscription_id": { + "name": "subscription_id", + "type": "varchar(28)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "subscription_coupon_id": { + "name": "subscription_coupon_id", + "type": "varchar(28)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "subscription_plan": { + "name": "subscription_plan", + "type": "enum('20','100','200')", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_subscription_booked": { + "name": "time_subscription_booked", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "global_customer_id": { + "name": "global_customer_id", + "columns": ["customer_id"], + "isUnique": true + }, + "global_subscription_id": { + "name": "global_subscription_id", + "columns": ["subscription_id"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "billing_workspace_id_id_pk": { + "name": "billing_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "payment": { + "name": "payment", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "customer_id": { + "name": "customer_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "invoice_id": { + "name": "invoice_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_id": { + "name": "payment_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "amount": { + "name": "amount", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_refunded": { + "name": "time_refunded", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "enrichment": { + "name": "enrichment", + "type": "json", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "payment_workspace_id_id_pk": { + "name": "payment_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "subscription": { + "name": "subscription", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "rolling_usage": { + "name": "rolling_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "fixed_usage": { + "name": "fixed_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_rolling_updated": { + "name": "time_rolling_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_fixed_updated": { + "name": "time_fixed_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "workspace_user_id": { + "name": "workspace_user_id", + "columns": ["workspace_id", "user_id"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "subscription_workspace_id_id_pk": { + "name": "subscription_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "usage": { + "name": "usage", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "input_tokens": { + "name": "input_tokens", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "output_tokens": { + "name": "output_tokens", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "reasoning_tokens": { + "name": "reasoning_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_read_tokens": { + "name": "cache_read_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_write_5m_tokens": { + "name": "cache_write_5m_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_write_1h_tokens": { + "name": "cache_write_1h_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cost": { + "name": "cost", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "key_id": { + "name": "key_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "enrichment": { + "name": "enrichment", + "type": "json", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "usage_time_created": { + "name": "usage_time_created", + "columns": ["workspace_id", "time_created"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "usage_workspace_id_id_pk": { + "name": "usage_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "ip_rate_limit": { + "name": "ip_rate_limit", + "columns": { + "ip": { + "name": "ip", + "type": "varchar(45)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "interval": { + "name": "interval", + "type": "varchar(10)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "count": { + "name": "count", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "ip_rate_limit_ip_interval_pk": { + "name": "ip_rate_limit_ip_interval_pk", + "columns": ["ip", "interval"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "ip": { + "name": "ip", + "columns": { + "ip": { + "name": "ip", + "type": "varchar(45)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "usage": { + "name": "usage", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "ip_ip_pk": { + "name": "ip_ip_pk", + "columns": ["ip"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "key": { + "name": "key", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "key": { + "name": "key", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_used": { + "name": "time_used", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "global_key": { + "name": "global_key", + "columns": ["key"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "key_workspace_id_id_pk": { + "name": "key_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "model": { + "name": "model", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "model_workspace_model": { + "name": "model_workspace_model", + "columns": ["workspace_id", "model"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "model_workspace_id_id_pk": { + "name": "model_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "provider": { + "name": "provider", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "credentials": { + "name": "credentials", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "workspace_provider": { + "name": "workspace_provider", + "columns": ["workspace_id", "provider"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "provider_workspace_id_id_pk": { + "name": "provider_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "user": { + "name": "user", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "account_id": { + "name": "account_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "email": { + "name": "email", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_seen": { + "name": "time_seen", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "color": { + "name": "color", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "role": { + "name": "role", + "type": "enum('admin','member')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "monthly_limit": { + "name": "monthly_limit", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "monthly_usage": { + "name": "monthly_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_monthly_usage_updated": { + "name": "time_monthly_usage_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "user_account_id": { + "name": "user_account_id", + "columns": ["workspace_id", "account_id"], + "isUnique": true + }, + "user_email": { + "name": "user_email", + "columns": ["workspace_id", "email"], + "isUnique": true + }, + "global_account_id": { + "name": "global_account_id", + "columns": ["account_id"], + "isUnique": false + }, + "global_email": { + "name": "global_email", + "columns": ["email"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "user_workspace_id_id_pk": { + "name": "user_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "workspace": { + "name": "workspace", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "slug": { + "name": "slug", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "slug": { + "name": "slug", + "columns": ["slug"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "workspace_id": { + "name": "workspace_id", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + } + }, + "views": {}, + "_meta": { + "schemas": {}, + "tables": {}, + "columns": {} + }, + "internal": { + "tables": {}, + "indexes": {} + } +} diff --git a/packages/console/core/migrations/meta/0054_snapshot.json b/packages/console/core/migrations/meta/0054_snapshot.json new file mode 100644 index 00000000000..a1e3851d857 --- /dev/null +++ b/packages/console/core/migrations/meta/0054_snapshot.json @@ -0,0 +1,1235 @@ +{ + "version": "5", + "dialect": "mysql", + "id": "a0ade64b-b735-4a70-8d39-ebd84bc9e924", + "prevId": "32a0c40b-a269-4ad1-a5a0-52b1f18932aa", + "tables": { + "account": { + "name": "account", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "account_id_pk": { + "name": "account_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "auth": { + "name": "auth", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "enum('email','github','google')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "subject": { + "name": "subject", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "account_id": { + "name": "account_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "provider": { + "name": "provider", + "columns": ["provider", "subject"], + "isUnique": true + }, + "account_id": { + "name": "account_id", + "columns": ["account_id"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "auth_id_pk": { + "name": "auth_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "benchmark": { + "name": "benchmark", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "agent": { + "name": "agent", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "result": { + "name": "result", + "type": "mediumtext", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "time_created": { + "name": "time_created", + "columns": ["time_created"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "benchmark_id_pk": { + "name": "benchmark_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "billing": { + "name": "billing", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "customer_id": { + "name": "customer_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_id": { + "name": "payment_method_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_type": { + "name": "payment_method_type", + "type": "varchar(32)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_last4": { + "name": "payment_method_last4", + "type": "varchar(4)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "balance": { + "name": "balance", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "monthly_limit": { + "name": "monthly_limit", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "monthly_usage": { + "name": "monthly_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_monthly_usage_updated": { + "name": "time_monthly_usage_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload": { + "name": "reload", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_trigger": { + "name": "reload_trigger", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_amount": { + "name": "reload_amount", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_error": { + "name": "reload_error", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_reload_error": { + "name": "time_reload_error", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_reload_locked_till": { + "name": "time_reload_locked_till", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "subscription": { + "name": "subscription", + "type": "json", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "subscription_id": { + "name": "subscription_id", + "type": "varchar(28)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "subscription_plan": { + "name": "subscription_plan", + "type": "enum('20','100','200')", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_subscription_booked": { + "name": "time_subscription_booked", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "global_customer_id": { + "name": "global_customer_id", + "columns": ["customer_id"], + "isUnique": true + }, + "global_subscription_id": { + "name": "global_subscription_id", + "columns": ["subscription_id"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "billing_workspace_id_id_pk": { + "name": "billing_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "payment": { + "name": "payment", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "customer_id": { + "name": "customer_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "invoice_id": { + "name": "invoice_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_id": { + "name": "payment_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "amount": { + "name": "amount", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_refunded": { + "name": "time_refunded", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "enrichment": { + "name": "enrichment", + "type": "json", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "payment_workspace_id_id_pk": { + "name": "payment_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "subscription": { + "name": "subscription", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "rolling_usage": { + "name": "rolling_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "fixed_usage": { + "name": "fixed_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_rolling_updated": { + "name": "time_rolling_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_fixed_updated": { + "name": "time_fixed_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "workspace_user_id": { + "name": "workspace_user_id", + "columns": ["workspace_id", "user_id"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "subscription_workspace_id_id_pk": { + "name": "subscription_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "usage": { + "name": "usage", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "input_tokens": { + "name": "input_tokens", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "output_tokens": { + "name": "output_tokens", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "reasoning_tokens": { + "name": "reasoning_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_read_tokens": { + "name": "cache_read_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_write_5m_tokens": { + "name": "cache_write_5m_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_write_1h_tokens": { + "name": "cache_write_1h_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cost": { + "name": "cost", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "key_id": { + "name": "key_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "enrichment": { + "name": "enrichment", + "type": "json", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "usage_time_created": { + "name": "usage_time_created", + "columns": ["workspace_id", "time_created"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "usage_workspace_id_id_pk": { + "name": "usage_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "ip_rate_limit": { + "name": "ip_rate_limit", + "columns": { + "ip": { + "name": "ip", + "type": "varchar(45)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "interval": { + "name": "interval", + "type": "varchar(10)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "count": { + "name": "count", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "ip_rate_limit_ip_interval_pk": { + "name": "ip_rate_limit_ip_interval_pk", + "columns": ["ip", "interval"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "ip": { + "name": "ip", + "columns": { + "ip": { + "name": "ip", + "type": "varchar(45)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "usage": { + "name": "usage", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "ip_ip_pk": { + "name": "ip_ip_pk", + "columns": ["ip"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "key": { + "name": "key", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "key": { + "name": "key", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_used": { + "name": "time_used", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "global_key": { + "name": "global_key", + "columns": ["key"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "key_workspace_id_id_pk": { + "name": "key_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "model": { + "name": "model", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "model_workspace_model": { + "name": "model_workspace_model", + "columns": ["workspace_id", "model"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "model_workspace_id_id_pk": { + "name": "model_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "provider": { + "name": "provider", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "credentials": { + "name": "credentials", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "workspace_provider": { + "name": "workspace_provider", + "columns": ["workspace_id", "provider"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "provider_workspace_id_id_pk": { + "name": "provider_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "user": { + "name": "user", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "account_id": { + "name": "account_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "email": { + "name": "email", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_seen": { + "name": "time_seen", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "color": { + "name": "color", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "role": { + "name": "role", + "type": "enum('admin','member')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "monthly_limit": { + "name": "monthly_limit", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "monthly_usage": { + "name": "monthly_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_monthly_usage_updated": { + "name": "time_monthly_usage_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "user_account_id": { + "name": "user_account_id", + "columns": ["workspace_id", "account_id"], + "isUnique": true + }, + "user_email": { + "name": "user_email", + "columns": ["workspace_id", "email"], + "isUnique": true + }, + "global_account_id": { + "name": "global_account_id", + "columns": ["account_id"], + "isUnique": false + }, + "global_email": { + "name": "global_email", + "columns": ["email"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "user_workspace_id_id_pk": { + "name": "user_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "workspace": { + "name": "workspace", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "slug": { + "name": "slug", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "slug": { + "name": "slug", + "columns": ["slug"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "workspace_id": { + "name": "workspace_id", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + } + }, + "views": {}, + "_meta": { + "schemas": {}, + "tables": {}, + "columns": {} + }, + "internal": { + "tables": {}, + "indexes": {} + } +} diff --git a/packages/console/core/migrations/meta/0055_snapshot.json b/packages/console/core/migrations/meta/0055_snapshot.json new file mode 100644 index 00000000000..82293d86663 --- /dev/null +++ b/packages/console/core/migrations/meta/0055_snapshot.json @@ -0,0 +1,1242 @@ +{ + "version": "5", + "dialect": "mysql", + "id": "e630f63c-04a8-4b59-bf56-03efcdd1b011", + "prevId": "a0ade64b-b735-4a70-8d39-ebd84bc9e924", + "tables": { + "account": { + "name": "account", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "account_id_pk": { + "name": "account_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "auth": { + "name": "auth", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "enum('email','github','google')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "subject": { + "name": "subject", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "account_id": { + "name": "account_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "provider": { + "name": "provider", + "columns": ["provider", "subject"], + "isUnique": true + }, + "account_id": { + "name": "account_id", + "columns": ["account_id"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "auth_id_pk": { + "name": "auth_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "benchmark": { + "name": "benchmark", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "agent": { + "name": "agent", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "result": { + "name": "result", + "type": "mediumtext", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "time_created": { + "name": "time_created", + "columns": ["time_created"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "benchmark_id_pk": { + "name": "benchmark_id_pk", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "billing": { + "name": "billing", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "customer_id": { + "name": "customer_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_id": { + "name": "payment_method_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_type": { + "name": "payment_method_type", + "type": "varchar(32)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_method_last4": { + "name": "payment_method_last4", + "type": "varchar(4)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "balance": { + "name": "balance", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "monthly_limit": { + "name": "monthly_limit", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "monthly_usage": { + "name": "monthly_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_monthly_usage_updated": { + "name": "time_monthly_usage_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload": { + "name": "reload", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_trigger": { + "name": "reload_trigger", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_amount": { + "name": "reload_amount", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "reload_error": { + "name": "reload_error", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_reload_error": { + "name": "time_reload_error", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_reload_locked_till": { + "name": "time_reload_locked_till", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "subscription": { + "name": "subscription", + "type": "json", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "subscription_id": { + "name": "subscription_id", + "type": "varchar(28)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "subscription_plan": { + "name": "subscription_plan", + "type": "enum('20','100','200')", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_subscription_booked": { + "name": "time_subscription_booked", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_subscription_selected": { + "name": "time_subscription_selected", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "global_customer_id": { + "name": "global_customer_id", + "columns": ["customer_id"], + "isUnique": true + }, + "global_subscription_id": { + "name": "global_subscription_id", + "columns": ["subscription_id"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "billing_workspace_id_id_pk": { + "name": "billing_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "payment": { + "name": "payment", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "customer_id": { + "name": "customer_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "invoice_id": { + "name": "invoice_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "payment_id": { + "name": "payment_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "amount": { + "name": "amount", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_refunded": { + "name": "time_refunded", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "enrichment": { + "name": "enrichment", + "type": "json", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "payment_workspace_id_id_pk": { + "name": "payment_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "subscription": { + "name": "subscription", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "rolling_usage": { + "name": "rolling_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "fixed_usage": { + "name": "fixed_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_rolling_updated": { + "name": "time_rolling_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_fixed_updated": { + "name": "time_fixed_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "workspace_user_id": { + "name": "workspace_user_id", + "columns": ["workspace_id", "user_id"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "subscription_workspace_id_id_pk": { + "name": "subscription_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "usage": { + "name": "usage", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "input_tokens": { + "name": "input_tokens", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "output_tokens": { + "name": "output_tokens", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "reasoning_tokens": { + "name": "reasoning_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_read_tokens": { + "name": "cache_read_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_write_5m_tokens": { + "name": "cache_write_5m_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cache_write_1h_tokens": { + "name": "cache_write_1h_tokens", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "cost": { + "name": "cost", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "key_id": { + "name": "key_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "enrichment": { + "name": "enrichment", + "type": "json", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "usage_time_created": { + "name": "usage_time_created", + "columns": ["workspace_id", "time_created"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "usage_workspace_id_id_pk": { + "name": "usage_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "ip_rate_limit": { + "name": "ip_rate_limit", + "columns": { + "ip": { + "name": "ip", + "type": "varchar(45)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "interval": { + "name": "interval", + "type": "varchar(10)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "count": { + "name": "count", + "type": "int", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "ip_rate_limit_ip_interval_pk": { + "name": "ip_rate_limit_ip_interval_pk", + "columns": ["ip", "interval"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "ip": { + "name": "ip", + "columns": { + "ip": { + "name": "ip", + "type": "varchar(45)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "usage": { + "name": "usage", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "ip_ip_pk": { + "name": "ip_ip_pk", + "columns": ["ip"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "key": { + "name": "key", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "key": { + "name": "key", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_used": { + "name": "time_used", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "global_key": { + "name": "global_key", + "columns": ["key"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "key_workspace_id_id_pk": { + "name": "key_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "model": { + "name": "model", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "model": { + "name": "model", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "model_workspace_model": { + "name": "model_workspace_model", + "columns": ["workspace_id", "model"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "model_workspace_id_id_pk": { + "name": "model_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "provider": { + "name": "provider", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "provider": { + "name": "provider", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "credentials": { + "name": "credentials", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "workspace_provider": { + "name": "workspace_provider", + "columns": ["workspace_id", "provider"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "provider_workspace_id_id_pk": { + "name": "provider_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "user": { + "name": "user", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "account_id": { + "name": "account_id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "email": { + "name": "email", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_seen": { + "name": "time_seen", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "color": { + "name": "color", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "role": { + "name": "role", + "type": "enum('admin','member')", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "monthly_limit": { + "name": "monthly_limit", + "type": "int", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "monthly_usage": { + "name": "monthly_usage", + "type": "bigint", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "time_monthly_usage_updated": { + "name": "time_monthly_usage_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "user_account_id": { + "name": "user_account_id", + "columns": ["workspace_id", "account_id"], + "isUnique": true + }, + "user_email": { + "name": "user_email", + "columns": ["workspace_id", "email"], + "isUnique": true + }, + "global_account_id": { + "name": "global_account_id", + "columns": ["account_id"], + "isUnique": false + }, + "global_email": { + "name": "global_email", + "columns": ["email"], + "isUnique": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "user_workspace_id_id_pk": { + "name": "user_workspace_id_id_pk", + "columns": ["workspace_id", "id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + }, + "workspace": { + "name": "workspace", + "columns": { + "id": { + "name": "id", + "type": "varchar(30)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "slug": { + "name": "slug", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "time_created": { + "name": "time_created", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(now())" + }, + "time_updated": { + "name": "time_updated", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)" + }, + "time_deleted": { + "name": "time_deleted", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": false, + "autoincrement": false + } + }, + "indexes": { + "slug": { + "name": "slug", + "columns": ["slug"], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "workspace_id": { + "name": "workspace_id", + "columns": ["id"] + } + }, + "uniqueConstraints": {}, + "checkConstraint": {} + } + }, + "views": {}, + "_meta": { + "schemas": {}, + "tables": {}, + "columns": {} + }, + "internal": { + "tables": {}, + "indexes": {} + } +} diff --git a/packages/console/core/migrations/meta/_journal.json b/packages/console/core/migrations/meta/_journal.json index 8a1a38551fb..f807eab6687 100644 --- a/packages/console/core/migrations/meta/_journal.json +++ b/packages/console/core/migrations/meta/_journal.json @@ -274,6 +274,125 @@ "when": 1764110043942, "tag": "0038_famous_magik", "breakpoints": true + }, + { + "idx": 39, + "version": "5", + "when": 1766946179892, + "tag": "0039_striped_forge", + "breakpoints": true + }, + { + "idx": 40, + "version": "5", + "when": 1767584617316, + "tag": "0040_broken_gamora", + "breakpoints": true + }, + { + "idx": 41, + "version": "5", + "when": 1767732559197, + "tag": "0041_odd_misty_knight", + "breakpoints": true + }, + { + "idx": 42, + "version": "5", + "when": 1767744077346, + "tag": "0042_flat_nightmare", + "breakpoints": true + }, + { + "idx": 43, + "version": "5", + "when": 1767752636118, + "tag": "0043_lame_calypso", + "breakpoints": true + }, + { + "idx": 44, + "version": "5", + "when": 1767759322451, + "tag": "0044_tiny_captain_midlands", + "breakpoints": true + }, + { + "idx": 45, + "version": "5", + "when": 1767765497502, + "tag": "0045_cuddly_diamondback", + "breakpoints": true + }, + { + "idx": 46, + "version": "5", + "when": 1767912262458, + "tag": "0046_charming_black_bolt", + "breakpoints": true + }, + { + "idx": 47, + "version": "5", + "when": 1767916965243, + "tag": "0047_huge_omega_red", + "breakpoints": true + }, + { + "idx": 48, + "version": "5", + "when": 1767917785224, + "tag": "0048_mean_frank_castle", + "breakpoints": true + }, + { + "idx": 49, + "version": "5", + "when": 1767922954153, + "tag": "0049_noisy_domino", + "breakpoints": true + }, + { + "idx": 50, + "version": "5", + "when": 1767931290031, + "tag": "0050_bumpy_mephistopheles", + "breakpoints": true + }, + { + "idx": 51, + "version": "5", + "when": 1768341152722, + "tag": "0051_jazzy_green_goblin", + "breakpoints": true + }, + { + "idx": 52, + "version": "5", + "when": 1768343920467, + "tag": "0052_aromatic_agent_zero", + "breakpoints": true + }, + { + "idx": 53, + "version": "5", + "when": 1768599366758, + "tag": "0053_gigantic_hardball", + "breakpoints": true + }, + { + "idx": 54, + "version": "5", + "when": 1768603665356, + "tag": "0054_numerous_annihilus", + "breakpoints": true + }, + { + "idx": 55, + "version": "5", + "when": 1769108945841, + "tag": "0055_moaning_karnak", + "breakpoints": true } ] } diff --git a/packages/console/core/package.json b/packages/console/core/package.json index 6fd87c2f89f..bfd4e447db4 100644 --- a/packages/console/core/package.json +++ b/packages/console/core/package.json @@ -1,9 +1,10 @@ { "$schema": "https://json.schemastore.org/package.json", "name": "@opencode-ai/console-core", - "version": "1.0.152", + "version": "1.1.33", "private": true, "type": "module", + "license": "MIT", "dependencies": { "@aws-sdk/client-sts": "3.782.0", "@jsx-email/render": "1.1.1", @@ -31,6 +32,10 @@ "promote-models-to-dev": "script/promote-models.ts dev", "promote-models-to-prod": "script/promote-models.ts production", "pull-models-from-dev": "script/pull-models.ts dev", + "pull-models-from-prod": "script/pull-models.ts production", + "update-black": "script/update-black.ts", + "promote-black-to-dev": "script/promote-black.ts dev", + "promote-black-to-prod": "script/promote-black.ts production", "typecheck": "tsgo --noEmit" }, "devDependencies": { diff --git a/packages/console/core/script/black-cancel-waitlist.ts b/packages/console/core/script/black-cancel-waitlist.ts new file mode 100644 index 00000000000..ab2aa16d5de --- /dev/null +++ b/packages/console/core/script/black-cancel-waitlist.ts @@ -0,0 +1,41 @@ +import { subscribe } from "diagnostics_channel" +import { Billing } from "../src/billing.js" +import { and, Database, eq } from "../src/drizzle/index.js" +import { BillingTable, PaymentTable, SubscriptionTable } from "../src/schema/billing.sql.js" + +const workspaceID = process.argv[2] + +if (!workspaceID) { + console.error("Usage: bun script/foo.ts ") + process.exit(1) +} + +console.log(`Removing from Black waitlist`) + +const billing = await Database.use((tx) => + tx + .select({ + subscriptionPlan: BillingTable.subscriptionPlan, + timeSubscriptionBooked: BillingTable.timeSubscriptionBooked, + }) + .from(BillingTable) + .where(eq(BillingTable.workspaceID, workspaceID)) + .then((rows) => rows[0]), +) + +if (!billing?.timeSubscriptionBooked) { + console.error(`Error: Workspace is not on the waitlist`) + process.exit(1) +} + +await Database.use((tx) => + tx + .update(BillingTable) + .set({ + subscriptionPlan: null, + timeSubscriptionBooked: null, + }) + .where(eq(BillingTable.workspaceID, workspaceID)), +) + +console.log(`Done`) diff --git a/packages/console/core/script/black-gift.ts b/packages/console/core/script/black-gift.ts new file mode 100644 index 00000000000..c666a1ab669 --- /dev/null +++ b/packages/console/core/script/black-gift.ts @@ -0,0 +1,117 @@ +import { Billing } from "../src/billing.js" +import { and, Database, eq, isNull, sql } from "../src/drizzle/index.js" +import { UserTable } from "../src/schema/user.sql.js" +import { BillingTable, PaymentTable, SubscriptionTable } from "../src/schema/billing.sql.js" +import { Identifier } from "../src/identifier.js" +import { centsToMicroCents } from "../src/util/price.js" +import { AuthTable } from "../src/schema/auth.sql.js" +import { BlackData } from "../src/black.js" +import { Actor } from "../src/actor.js" + +const plan = "200" +const couponID = "JAIr0Pe1" +const workspaceID = process.argv[2] +const seats = parseInt(process.argv[3]) + +console.log(`Gifting ${seats} seats of Black to workspace ${workspaceID}`) + +if (!workspaceID || !seats) throw new Error("Usage: bun foo.ts ") + +// Get workspace user +const users = await Database.use((tx) => + tx + .select({ + id: UserTable.id, + role: UserTable.role, + email: AuthTable.subject, + }) + .from(UserTable) + .leftJoin(AuthTable, and(eq(AuthTable.accountID, UserTable.accountID), eq(AuthTable.provider, "email"))) + .where(and(eq(UserTable.workspaceID, workspaceID), isNull(UserTable.timeDeleted))), +) +if (users.length === 0) throw new Error(`Error: No users found in workspace ${workspaceID}`) +if (users.length !== seats) + throw new Error(`Error: Workspace ${workspaceID} has ${users.length} users, expected ${seats}`) +const adminUser = users.find((user) => user.role === "admin") +if (!adminUser) throw new Error(`Error: No admin user found in workspace ${workspaceID}`) +if (!adminUser.email) throw new Error(`Error: Admin user ${adminUser.id} has no email`) + +// Get Billing +const billing = await Database.use((tx) => + tx + .select({ + customerID: BillingTable.customerID, + subscriptionID: BillingTable.subscriptionID, + }) + .from(BillingTable) + .where(eq(BillingTable.workspaceID, workspaceID)) + .then((rows) => rows[0]), +) +if (!billing) throw new Error(`Error: Workspace ${workspaceID} has no billing record`) +if (billing.subscriptionID) throw new Error(`Error: Workspace ${workspaceID} already has a subscription`) + +// Look up the Stripe customer by email +const customerID = + billing.customerID ?? + (await (() => + Billing.stripe() + .customers.create({ + email: adminUser.email, + metadata: { + workspaceID, + }, + }) + .then((customer) => customer.id))()) +console.log(`Customer ID: ${customerID}`) + +const subscription = await Billing.stripe().subscriptions.create({ + customer: customerID!, + items: [ + { + price: BlackData.planToPriceID({ plan }), + discounts: [{ coupon: couponID }], + quantity: seats, + }, + ], + metadata: { + workspaceID, + }, +}) +console.log(`Subscription ID: ${subscription.id}`) + +await Database.transaction(async (tx) => { + // Set customer id, subscription id, and payment method on workspace billing + await tx + .update(BillingTable) + .set({ + customerID, + subscriptionID: subscription.id, + subscription: { status: "subscribed", coupon: couponID, seats, plan }, + }) + .where(eq(BillingTable.workspaceID, workspaceID)) + + // Create a row in subscription table + for (const user of users) { + await tx.insert(SubscriptionTable).values({ + workspaceID, + id: Identifier.create("subscription"), + userID: user.id, + }) + } + // + // // Create a row in payments table + // await tx.insert(PaymentTable).values({ + // workspaceID, + // id: Identifier.create("payment"), + // amount: centsToMicroCents(amountInCents), + // customerID, + // invoiceID, + // paymentID, + // enrichment: { + // type: "subscription", + // couponID, + // }, + // }) +}) + +console.log(`done`) diff --git a/packages/console/core/script/black-transfer.ts b/packages/console/core/script/black-transfer.ts new file mode 100644 index 00000000000..e962ba5d361 --- /dev/null +++ b/packages/console/core/script/black-transfer.ts @@ -0,0 +1,163 @@ +import { Billing } from "../src/billing.js" +import { and, Database, desc, eq, isNotNull, lt, sql } from "../src/drizzle/index.js" +import { BillingTable, PaymentTable, SubscriptionTable } from "../src/schema/billing.sql.js" + +const fromWrkID = process.argv[2] +const toWrkID = process.argv[3] + +if (!fromWrkID || !toWrkID) { + console.error("Usage: bun foo.ts ") + process.exit(1) +} + +console.log(`Transferring subscription from ${fromWrkID} to ${toWrkID}`) + +// Look up the FROM workspace billing +const fromBilling = await Database.use((tx) => + tx + .select({ + customerID: BillingTable.customerID, + subscriptionID: BillingTable.subscriptionID, + subscription: BillingTable.subscription, + paymentMethodID: BillingTable.paymentMethodID, + paymentMethodType: BillingTable.paymentMethodType, + paymentMethodLast4: BillingTable.paymentMethodLast4, + }) + .from(BillingTable) + .where(eq(BillingTable.workspaceID, fromWrkID)) + .then((rows) => rows[0]), +) +if (!fromBilling) throw new Error(`Error: FROM workspace has no billing record`) +if (!fromBilling.customerID) throw new Error(`Error: FROM workspace has no Stripe customer ID`) +if (!fromBilling.subscriptionID) throw new Error(`Error: FROM workspace has no subscription`) + +const fromSubscription = await Database.use((tx) => + tx + .select({ userID: SubscriptionTable.userID }) + .from(SubscriptionTable) + .where(eq(SubscriptionTable.workspaceID, fromWrkID)) + .then((rows) => rows[0]), +) +if (!fromSubscription) throw new Error(`Error: FROM workspace has no subscription`) + +// Look up the previous customer ID in FROM workspace +const subscriptionPayment = await Database.use((tx) => + tx + .select({ + customerID: PaymentTable.customerID, + timeCreated: PaymentTable.timeCreated, + }) + .from(PaymentTable) + .where(and(eq(PaymentTable.workspaceID, fromWrkID), sql`JSON_EXTRACT(enrichment, '$.type') = 'subscription'`)) + .then((rows) => { + if (rows.length > 1) { + console.error(`Error: Multiple subscription payments found for workspace ${fromWrkID}`) + process.exit(1) + } + return rows[0] + }), +) +const fromPrevPayment = await Database.use((tx) => + tx + .select({ customerID: PaymentTable.customerID }) + .from(PaymentTable) + .where( + and( + eq(PaymentTable.workspaceID, fromWrkID), + isNotNull(PaymentTable.customerID), + lt(PaymentTable.timeCreated, subscriptionPayment.timeCreated), + ), + ) + .orderBy(desc(PaymentTable.timeCreated)) + .limit(1) + .then((rows) => rows[0]), +) +if (!fromPrevPayment?.customerID) throw new Error(`Error: FROM workspace has no previous Stripe customer to revert to`) +if (fromPrevPayment.customerID === fromBilling.customerID) + throw new Error(`Error: FROM workspace has the same Stripe customer ID as the current one`) + +const fromPrevPaymentMethods = await Billing.stripe().customers.listPaymentMethods(fromPrevPayment.customerID, {}) +if (fromPrevPaymentMethods.data.length === 0) + throw new Error(`Error: FROM workspace has no previous Stripe payment methods`) + +// Look up the TO workspace billing +const toBilling = await Database.use((tx) => + tx + .select({ + customerID: BillingTable.customerID, + subscriptionID: BillingTable.subscriptionID, + }) + .from(BillingTable) + .where(eq(BillingTable.workspaceID, toWrkID)) + .then((rows) => rows[0]), +) +if (!toBilling) throw new Error(`Error: TO workspace has no billing record`) +if (toBilling.subscriptionID) throw new Error(`Error: TO workspace already has a subscription`) + +console.log(`FROM:`) +console.log(` Old Customer ID: ${fromBilling.customerID}`) +console.log(` New Customer ID: ${fromPrevPayment.customerID}`) +console.log(`TO:`) +console.log(` Old Customer ID: ${toBilling.customerID}`) +console.log(` New Customer ID: ${fromBilling.customerID}`) + +// Clear workspaceID from Stripe customer metadata +await Billing.stripe().customers.update(fromPrevPayment.customerID, { + metadata: { + workspaceID: fromWrkID, + }, +}) +await Billing.stripe().customers.update(fromBilling.customerID, { + metadata: { + workspaceID: toWrkID, + }, +}) + +await Database.transaction(async (tx) => { + await tx + .update(BillingTable) + .set({ + customerID: fromPrevPayment.customerID, + subscriptionID: null, + subscription: null, + paymentMethodID: fromPrevPaymentMethods.data[0].id, + paymentMethodLast4: fromPrevPaymentMethods.data[0].card?.last4 ?? null, + paymentMethodType: fromPrevPaymentMethods.data[0].type, + }) + .where(eq(BillingTable.workspaceID, fromWrkID)) + + await tx + .update(BillingTable) + .set({ + customerID: fromBilling.customerID, + subscriptionID: fromBilling.subscriptionID, + subscription: fromBilling.subscription, + paymentMethodID: fromBilling.paymentMethodID, + paymentMethodLast4: fromBilling.paymentMethodLast4, + paymentMethodType: fromBilling.paymentMethodType, + }) + .where(eq(BillingTable.workspaceID, toWrkID)) + + await tx + .update(SubscriptionTable) + .set({ + workspaceID: toWrkID, + userID: fromSubscription.userID, + }) + .where(eq(SubscriptionTable.workspaceID, fromWrkID)) + + await tx + .update(PaymentTable) + .set({ + workspaceID: toWrkID, + }) + .where( + and( + eq(PaymentTable.workspaceID, fromWrkID), + sql`JSON_EXTRACT(enrichment, '$.type') = 'subscription'`, + eq(PaymentTable.amount, 20000000000), + ), + ) +}) + +console.log(`done`) diff --git a/packages/console/core/script/credit-workspace.ts b/packages/console/core/script/credit-workspace.ts new file mode 100644 index 00000000000..ad2404f799a --- /dev/null +++ b/packages/console/core/script/credit-workspace.ts @@ -0,0 +1,35 @@ +import { Billing } from "../src/billing.js" +import { Database, eq } from "../src/drizzle/index.js" +import { WorkspaceTable } from "../src/schema/workspace.sql.js" + +// get input from command line +const workspaceID = process.argv[2] +const dollarAmount = process.argv[3] + +if (!workspaceID || !dollarAmount) { + console.error("Usage: bun credit-workspace.ts ") + process.exit(1) +} + +// check workspace exists +const workspace = await Database.use((tx) => + tx + .select() + .from(WorkspaceTable) + .where(eq(WorkspaceTable.id, workspaceID)) + .then((rows) => rows[0]), +) +if (!workspace) { + console.error("Error: Workspace not found") + process.exit(1) +} + +const amountInDollars = parseFloat(dollarAmount) +if (isNaN(amountInDollars) || amountInDollars <= 0) { + console.error("Error: dollarAmount must be a positive number") + process.exit(1) +} + +await Billing.grantCredit(workspaceID, amountInDollars) + +console.log(`Added payment of $${amountInDollars.toFixed(2)} to workspace ${workspaceID}`) diff --git a/packages/console/core/script/lookup-user.ts b/packages/console/core/script/lookup-user.ts index 1ae18c4ddae..0a614bc15a1 100644 --- a/packages/console/core/script/lookup-user.ts +++ b/packages/console/core/script/lookup-user.ts @@ -1,26 +1,303 @@ -import { Database, eq } from "../src/drizzle/index.js" -import { AuthTable } from "../src/schema/auth.sql" +import { Database, and, eq, sql } from "../src/drizzle/index.js" +import { AuthTable } from "../src/schema/auth.sql.js" +import { UserTable } from "../src/schema/user.sql.js" +import { + BillingTable, + PaymentTable, + SubscriptionTable, + SubscriptionPlan, + UsageTable, +} from "../src/schema/billing.sql.js" +import { WorkspaceTable } from "../src/schema/workspace.sql.js" +import { BlackData } from "../src/black.js" +import { centsToMicroCents } from "../src/util/price.js" +import { getWeekBounds } from "../src/util/date.js" // get input from command line -const email = process.argv[2] -if (!email) { - console.error("Usage: bun lookup-user.ts ") +const identifier = process.argv[2] +if (!identifier) { + console.error("Usage: bun lookup-user.ts ") process.exit(1) } -const authData = await printTable("Auth", (tx) => tx.select().from(AuthTable).where(eq(AuthTable.subject, email))) -if (authData.length === 0) { - console.error("User not found") - process.exit(1) +if (identifier.startsWith("wrk_")) { + await printWorkspace(identifier) +} else { + const authData = await Database.use(async (tx) => + tx.select().from(AuthTable).where(eq(AuthTable.subject, identifier)), + ) + if (authData.length === 0) { + console.error("Email not found") + process.exit(1) + } + if (authData.length > 1) console.warn("Multiple users found for email", identifier) + + // Get all auth records for email + const accountID = authData[0].accountID + await printTable("Auth", (tx) => tx.select().from(AuthTable).where(eq(AuthTable.accountID, accountID))) + + // Get all workspaces for this account + const users = await printTable("Workspaces", (tx) => + tx + .select({ + userID: UserTable.id, + workspaceID: UserTable.workspaceID, + workspaceName: WorkspaceTable.name, + role: UserTable.role, + subscribed: SubscriptionTable.timeCreated, + }) + .from(UserTable) + .rightJoin(WorkspaceTable, eq(WorkspaceTable.id, UserTable.workspaceID)) + .leftJoin(SubscriptionTable, eq(SubscriptionTable.userID, UserTable.id)) + .where(eq(UserTable.accountID, accountID)) + .then((rows) => + rows.map((row) => ({ + userID: row.userID, + workspaceID: row.workspaceID, + workspaceName: row.workspaceName, + role: row.role, + subscribed: formatDate(row.subscribed), + })), + ), + ) + + for (const user of users) { + await printWorkspace(user.workspaceID) + } +} + +async function printWorkspace(workspaceID: string) { + const workspace = await Database.use((tx) => + tx + .select() + .from(WorkspaceTable) + .where(eq(WorkspaceTable.id, workspaceID)) + .then((rows) => rows[0]), + ) + + printHeader(`Workspace "${workspace.name}" (${workspace.id})`) + + await printTable("Users", (tx) => + tx + .select({ + authEmail: AuthTable.subject, + inviteEmail: UserTable.email, + role: UserTable.role, + timeSeen: UserTable.timeSeen, + monthlyLimit: UserTable.monthlyLimit, + monthlyUsage: UserTable.monthlyUsage, + timeDeleted: UserTable.timeDeleted, + fixedUsage: SubscriptionTable.fixedUsage, + rollingUsage: SubscriptionTable.rollingUsage, + timeFixedUpdated: SubscriptionTable.timeFixedUpdated, + timeRollingUpdated: SubscriptionTable.timeRollingUpdated, + timeSubscriptionCreated: SubscriptionTable.timeCreated, + subscription: BillingTable.subscription, + }) + .from(UserTable) + .innerJoin(BillingTable, eq(BillingTable.workspaceID, workspace.id)) + .leftJoin(AuthTable, and(eq(UserTable.accountID, AuthTable.accountID), eq(AuthTable.provider, "email"))) + .leftJoin(SubscriptionTable, eq(SubscriptionTable.userID, UserTable.id)) + .where(eq(UserTable.workspaceID, workspace.id)) + .then((rows) => + rows.map((row) => { + const subStatus = getSubscriptionStatus(row) + return { + email: (row.timeDeleted ? "❌ " : "") + (row.authEmail ?? row.inviteEmail), + role: row.role, + timeSeen: formatDate(row.timeSeen), + monthly: formatMonthlyUsage(row.monthlyUsage, row.monthlyLimit), + subscribed: formatDate(row.timeSubscriptionCreated), + subWeekly: subStatus.weekly, + subRolling: subStatus.rolling, + rateLimited: subStatus.rateLimited, + retryIn: subStatus.retryIn, + } + }), + ), + ) + + await printTable("Billing", (tx) => + tx + .select({ + balance: BillingTable.balance, + customerID: BillingTable.customerID, + reload: BillingTable.reload, + subscriptionID: BillingTable.subscriptionID, + subscription: { + plan: BillingTable.subscriptionPlan, + booked: BillingTable.timeSubscriptionBooked, + enrichment: BillingTable.subscription, + }, + }) + .from(BillingTable) + .where(eq(BillingTable.workspaceID, workspace.id)) + .then( + (rows) => + rows.map((row) => ({ + ...row, + balance: `$${(row.balance / 100000000).toFixed(2)}`, + subscription: row.subscriptionID + ? [ + `Black ${row.subscription.enrichment!.plan}`, + row.subscription.enrichment!.seats > 1 ? `X ${row.subscription.enrichment!.seats} seats` : "", + row.subscription.enrichment!.coupon ? `(coupon: ${row.subscription.enrichment!.coupon})` : "", + `(ref: ${row.subscriptionID})`, + ].join(" ") + : row.subscription.booked + ? `Waitlist ${row.subscription.plan} plan` + : undefined, + }))[0], + ), + ) + + await printTable("Payments", (tx) => + tx + .select({ + amount: PaymentTable.amount, + paymentID: PaymentTable.paymentID, + invoiceID: PaymentTable.invoiceID, + customerID: PaymentTable.customerID, + timeCreated: PaymentTable.timeCreated, + timeRefunded: PaymentTable.timeRefunded, + }) + .from(PaymentTable) + .where(eq(PaymentTable.workspaceID, workspace.id)) + .orderBy(sql`${PaymentTable.timeCreated} DESC`) + .limit(100) + .then((rows) => + rows.map((row) => ({ + ...row, + amount: `$${(row.amount / 100000000).toFixed(2)}`, + paymentID: row.paymentID + ? `https://dashboard.stripe.com/acct_1RszBH2StuRr0lbX/payments/${row.paymentID}` + : null, + })), + ), + ) + + /* + await printTable("Usage", (tx) => + tx + .select({ + model: UsageTable.model, + provider: UsageTable.provider, + inputTokens: UsageTable.inputTokens, + outputTokens: UsageTable.outputTokens, + reasoningTokens: UsageTable.reasoningTokens, + cacheReadTokens: UsageTable.cacheReadTokens, + cacheWrite5mTokens: UsageTable.cacheWrite5mTokens, + cacheWrite1hTokens: UsageTable.cacheWrite1hTokens, + cost: UsageTable.cost, + timeCreated: UsageTable.timeCreated, + }) + .from(UsageTable) + .where(eq(UsageTable.workspaceID, workspace.id)) + .orderBy(sql`${UsageTable.timeCreated} DESC`) + .limit(10) + .then((rows) => + rows.map((row) => ({ + ...row, + cost: `$${(row.cost / 100000000).toFixed(2)}`, + })), + ), + ) + */ +} + +function formatMicroCents(value: number | null | undefined) { + if (value === null || value === undefined) return null + return `$${(value / 100000000).toFixed(2)}` +} + +function formatDate(value: Date | null | undefined) { + if (!value) return null + return value.toISOString().split("T")[0] } -await printTable("Auth", (tx) => tx.select().from(AuthTable).where(eq(AuthTable.accountID, authData[0].accountID))) +function formatMonthlyUsage(usage: number | null | undefined, limit: number | null | undefined) { + const usageText = formatMicroCents(usage) ?? "$0.00" + if (limit === null || limit === undefined) return `${usageText} / no limit` + return `${usageText} / $${limit.toFixed(2)}` +} + +function formatRetryTime(seconds: number) { + const days = Math.floor(seconds / 86400) + if (days >= 1) return `${days} day${days > 1 ? "s" : ""}` + const hours = Math.floor(seconds / 3600) + const minutes = Math.ceil((seconds % 3600) / 60) + if (hours >= 1) return `${hours}hr ${minutes}min` + return `${minutes}min` +} + +function getSubscriptionStatus(row: { + subscription: { + plan: (typeof SubscriptionPlan)[number] + } | null + timeSubscriptionCreated: Date | null + fixedUsage: number | null + rollingUsage: number | null + timeFixedUpdated: Date | null + timeRollingUpdated: Date | null +}) { + if (!row.timeSubscriptionCreated || !row.subscription) { + return { weekly: null, rolling: null, rateLimited: null, retryIn: null } + } + + const black = BlackData.getLimits({ plan: row.subscription.plan }) + const now = new Date() + const week = getWeekBounds(now) + + const fixedLimit = black.fixedLimit ? centsToMicroCents(black.fixedLimit * 100) : null + const rollingLimit = black.rollingLimit ? centsToMicroCents(black.rollingLimit * 100) : null + const rollingWindowMs = (black.rollingWindow ?? 5) * 3600 * 1000 + + // Calculate current weekly usage (reset if outside current week) + const currentWeekly = + row.fixedUsage && row.timeFixedUpdated && row.timeFixedUpdated >= week.start ? row.fixedUsage : 0 + + // Calculate current rolling usage + const windowStart = new Date(now.getTime() - rollingWindowMs) + const currentRolling = + row.rollingUsage && row.timeRollingUpdated && row.timeRollingUpdated >= windowStart ? row.rollingUsage : 0 + + // Check rate limiting + const isWeeklyLimited = fixedLimit !== null && currentWeekly >= fixedLimit + const isRollingLimited = rollingLimit !== null && currentRolling >= rollingLimit + + let retryIn: string | null = null + if (isWeeklyLimited) { + const retryAfter = Math.ceil((week.end.getTime() - now.getTime()) / 1000) + retryIn = formatRetryTime(retryAfter) + } else if (isRollingLimited && row.timeRollingUpdated) { + const retryAfter = Math.ceil((row.timeRollingUpdated.getTime() + rollingWindowMs - now.getTime()) / 1000) + retryIn = formatRetryTime(retryAfter) + } + + return { + weekly: fixedLimit !== null ? `${formatMicroCents(currentWeekly)} / $${black.fixedLimit}` : null, + rolling: rollingLimit !== null ? `${formatMicroCents(currentRolling)} / $${black.rollingLimit}` : null, + rateLimited: isWeeklyLimited || isRollingLimited ? "yes" : "no", + retryIn, + } +} + +function printHeader(title: string) { + console.log() + console.log("─".repeat(title.length)) + console.log(`${title}`) + console.log("─".repeat(title.length)) +} -function printTable(title: string, callback: (tx: Database.TxOrDb) => Promise): Promise { +function printTable(title: string, callback: (tx: Database.TxOrDb) => Promise): Promise { return Database.use(async (tx) => { const data = await callback(tx) - console.log(`== ${title} ==`) - console.table(data) + console.log(`\n== ${title} ==`) + if (data.length === 0) { + console.log("(no data)") + } else { + console.table(data) + } return data }) } diff --git a/packages/console/core/script/promote-black.ts b/packages/console/core/script/promote-black.ts new file mode 100755 index 00000000000..4338d0e4216 --- /dev/null +++ b/packages/console/core/script/promote-black.ts @@ -0,0 +1,22 @@ +#!/usr/bin/env bun + +import { $ } from "bun" +import path from "path" +import { BlackData } from "../src/black" + +const stage = process.argv[2] +if (!stage) throw new Error("Stage is required") + +const root = path.resolve(process.cwd(), "..", "..", "..") + +// read the secret +const ret = await $`bun sst secret list`.cwd(root).text() +const lines = ret.split("\n") +const value = lines.find((line) => line.startsWith("ZEN_BLACK_LIMITS"))?.split("=")[1] +if (!value) throw new Error("ZEN_BLACK_LIMITS not found") + +// validate value +BlackData.validate(JSON.parse(value)) + +// update the secret +await $`bun sst secret set ZEN_BLACK_LIMITS ${value} --stage ${stage}` diff --git a/packages/console/core/script/promote-models.ts b/packages/console/core/script/promote-models.ts index bebef5cfb55..bc57fc5bb36 100755 --- a/packages/console/core/script/promote-models.ts +++ b/packages/console/core/script/promote-models.ts @@ -8,27 +8,25 @@ const stage = process.argv[2] if (!stage) throw new Error("Stage is required") const root = path.resolve(process.cwd(), "..", "..", "..") +const PARTS = 8 // read the secret const ret = await $`bun sst secret list`.cwd(root).text() const lines = ret.split("\n") -const value1 = lines.find((line) => line.startsWith("ZEN_MODELS1"))?.split("=")[1] -const value2 = lines.find((line) => line.startsWith("ZEN_MODELS2"))?.split("=")[1] -const value3 = lines.find((line) => line.startsWith("ZEN_MODELS3"))?.split("=")[1] -const value4 = lines.find((line) => line.startsWith("ZEN_MODELS4"))?.split("=")[1] -const value5 = lines.find((line) => line.startsWith("ZEN_MODELS5"))?.split("=")[1] -if (!value1) throw new Error("ZEN_MODELS1 not found") -if (!value2) throw new Error("ZEN_MODELS2 not found") -if (!value3) throw new Error("ZEN_MODELS3 not found") -if (!value4) throw new Error("ZEN_MODELS4 not found") -if (!value5) throw new Error("ZEN_MODELS5 not found") +const values = Array.from({ length: PARTS }, (_, i) => { + const value = lines + .find((line) => line.startsWith(`ZEN_MODELS${i + 1}`)) + ?.split("=") + .slice(1) + .join("=") + if (!value) throw new Error(`ZEN_MODELS${i + 1} not found`) + return value +}) // validate value -ZenData.validate(JSON.parse(value1 + value2 + value3 + value4 + value5)) +ZenData.validate(JSON.parse(values.join(""))) // update the secret -await $`bun sst secret set ZEN_MODELS1 ${value1} --stage ${stage}` -await $`bun sst secret set ZEN_MODELS2 ${value2} --stage ${stage}` -await $`bun sst secret set ZEN_MODELS3 ${value3} --stage ${stage}` -await $`bun sst secret set ZEN_MODELS4 ${value4} --stage ${stage}` -await $`bun sst secret set ZEN_MODELS5 ${value5} --stage ${stage}` +for (let i = 0; i < PARTS; i++) { + await $`bun sst secret set ZEN_MODELS${i + 1} --stage ${stage} -- ${values[i]}` +} diff --git a/packages/console/core/script/pull-models.ts b/packages/console/core/script/pull-models.ts index afa865625b0..f360b818647 100755 --- a/packages/console/core/script/pull-models.ts +++ b/packages/console/core/script/pull-models.ts @@ -8,27 +8,25 @@ const stage = process.argv[2] if (!stage) throw new Error("Stage is required") const root = path.resolve(process.cwd(), "..", "..", "..") +const PARTS = 8 // read the secret const ret = await $`bun sst secret list --stage ${stage}`.cwd(root).text() const lines = ret.split("\n") -const value1 = lines.find((line) => line.startsWith("ZEN_MODELS1"))?.split("=")[1] -const value2 = lines.find((line) => line.startsWith("ZEN_MODELS2"))?.split("=")[1] -const value3 = lines.find((line) => line.startsWith("ZEN_MODELS3"))?.split("=")[1] -const value4 = lines.find((line) => line.startsWith("ZEN_MODELS4"))?.split("=")[1] -const value5 = lines.find((line) => line.startsWith("ZEN_MODELS5"))?.split("=")[1] -if (!value1) throw new Error("ZEN_MODELS1 not found") -if (!value2) throw new Error("ZEN_MODELS2 not found") -if (!value3) throw new Error("ZEN_MODELS3 not found") -if (!value4) throw new Error("ZEN_MODELS4 not found") -if (!value5) throw new Error("ZEN_MODELS5 not found") +const values = Array.from({ length: PARTS }, (_, i) => { + const value = lines + .find((line) => line.startsWith(`ZEN_MODELS${i + 1}`)) + ?.split("=") + .slice(1) + .join("=") + if (!value) throw new Error(`ZEN_MODELS${i + 1} not found`) + return value +}) // validate value -ZenData.validate(JSON.parse(value1 + value2 + value3 + value4 + value5)) +ZenData.validate(JSON.parse(values.join(""))) // update the secret -await $`bun sst secret set ZEN_MODELS1 ${value1}` -await $`bun sst secret set ZEN_MODELS2 ${value2}` -await $`bun sst secret set ZEN_MODELS3 ${value3}` -await $`bun sst secret set ZEN_MODELS4 ${value4}` -await $`bun sst secret set ZEN_MODELS5 ${value5}` +for (let i = 0; i < PARTS; i++) { + await $`bun sst secret set ZEN_MODELS${i + 1} -- ${values[i]}` +} diff --git a/packages/console/core/script/update-black.ts b/packages/console/core/script/update-black.ts new file mode 100755 index 00000000000..695a5d3ce47 --- /dev/null +++ b/packages/console/core/script/update-black.ts @@ -0,0 +1,28 @@ +#!/usr/bin/env bun + +import { $ } from "bun" +import path from "path" +import os from "os" +import { BlackData } from "../src/black" + +const root = path.resolve(process.cwd(), "..", "..", "..") +const secrets = await $`bun sst secret list`.cwd(root).text() + +// read value +const lines = secrets.split("\n") +const oldValue = lines.find((line) => line.startsWith("ZEN_BLACK_LIMITS"))?.split("=")[1] ?? "{}" +if (!oldValue) throw new Error("ZEN_BLACK_LIMITS not found") + +// store the prettified json to a temp file +const filename = `black-${Date.now()}.json` +const tempFile = Bun.file(path.join(os.tmpdir(), filename)) +await tempFile.write(JSON.stringify(JSON.parse(oldValue), null, 2)) +console.log("tempFile", tempFile.name) + +// open temp file in vim and read the file on close +await $`vim ${tempFile.name}` +const newValue = JSON.stringify(JSON.parse(await tempFile.text())) +BlackData.validate(JSON.parse(newValue)) + +// update the secret +await $`bun sst secret set ZEN_BLACK_LIMITS ${newValue}` diff --git a/packages/console/core/script/update-models.ts b/packages/console/core/script/update-models.ts index 5d40b4d5a3e..56940af257e 100755 --- a/packages/console/core/script/update-models.ts +++ b/packages/console/core/script/update-models.ts @@ -7,24 +7,24 @@ import { ZenData } from "../src/model" const root = path.resolve(process.cwd(), "..", "..", "..") const models = await $`bun sst secret list`.cwd(root).text() +const PARTS = 8 // read the line starting with "ZEN_MODELS" const lines = models.split("\n") -const oldValue1 = lines.find((line) => line.startsWith("ZEN_MODELS1"))?.split("=")[1] -const oldValue2 = lines.find((line) => line.startsWith("ZEN_MODELS2"))?.split("=")[1] -const oldValue3 = lines.find((line) => line.startsWith("ZEN_MODELS3"))?.split("=")[1] -const oldValue4 = lines.find((line) => line.startsWith("ZEN_MODELS4"))?.split("=")[1] -const oldValue5 = lines.find((line) => line.startsWith("ZEN_MODELS5"))?.split("=")[1] -if (!oldValue1) throw new Error("ZEN_MODELS1 not found") -if (!oldValue2) throw new Error("ZEN_MODELS2 not found") -if (!oldValue3) throw new Error("ZEN_MODELS3 not found") -if (!oldValue4) throw new Error("ZEN_MODELS4 not found") -if (!oldValue5) throw new Error("ZEN_MODELS5 not found") +const oldValues = Array.from({ length: PARTS }, (_, i) => { + const value = lines + .find((line) => line.startsWith(`ZEN_MODELS${i + 1}`)) + ?.split("=") + .slice(1) + .join("=") + if (!value) throw new Error(`ZEN_MODELS${i + 1} not found`) + return value +}) // store the prettified json to a temp file const filename = `models-${Date.now()}.json` const tempFile = Bun.file(path.join(os.tmpdir(), filename)) -await tempFile.write(JSON.stringify(JSON.parse(oldValue1 + oldValue2 + oldValue3 + oldValue4 + oldValue5), null, 2)) +await tempFile.write(JSON.stringify(JSON.parse(oldValues.join("")), null, 2)) console.log("tempFile", tempFile.name) // open temp file in vim and read the file on close @@ -33,15 +33,11 @@ const newValue = JSON.stringify(JSON.parse(await tempFile.text())) ZenData.validate(JSON.parse(newValue)) // update the secret -const chunk = Math.ceil(newValue.length / 5) -const newValue1 = newValue.slice(0, chunk) -const newValue2 = newValue.slice(chunk, chunk * 2) -const newValue3 = newValue.slice(chunk * 2, chunk * 3) -const newValue4 = newValue.slice(chunk * 3, chunk * 4) -const newValue5 = newValue.slice(chunk * 4) +const chunk = Math.ceil(newValue.length / PARTS) +const newValues = Array.from({ length: PARTS }, (_, i) => + newValue.slice(chunk * i, i === PARTS - 1 ? undefined : chunk * (i + 1)), +) -await $`bun sst secret set ZEN_MODELS1 ${newValue1}` -await $`bun sst secret set ZEN_MODELS2 ${newValue2}` -await $`bun sst secret set ZEN_MODELS3 ${newValue3}` -await $`bun sst secret set ZEN_MODELS4 ${newValue4}` -await $`bun sst secret set ZEN_MODELS5 ${newValue5}` +for (let i = 0; i < PARTS; i++) { + await $`bun sst secret set ZEN_MODELS${i + 1} -- ${newValues[i]}` +} diff --git a/packages/console/core/src/billing.ts b/packages/console/core/src/billing.ts index 049ee29bbe3..7031a384b5d 100644 --- a/packages/console/core/src/billing.ts +++ b/packages/console/core/src/billing.ts @@ -1,6 +1,6 @@ import { Stripe } from "stripe" import { Database, eq, sql } from "./drizzle" -import { BillingTable, PaymentTable, UsageTable } from "./schema/billing.sql" +import { BillingTable, PaymentTable, SubscriptionTable, UsageTable } from "./schema/billing.sql" import { Actor } from "./actor" import { fn } from "./util/fn" import { z } from "zod" @@ -8,6 +8,7 @@ import { Resource } from "@opencode-ai/console-resource" import { Identifier } from "./identifier" import { centsToMicroCents } from "./util/price" import { User } from "./user" +import { BlackData } from "./black" export namespace Billing { export const ITEM_CREDIT_NAME = "opencode credits" @@ -25,21 +26,7 @@ export namespace Billing { export const get = async () => { return Database.use(async (tx) => tx - .select({ - customerID: BillingTable.customerID, - paymentMethodID: BillingTable.paymentMethodID, - paymentMethodType: BillingTable.paymentMethodType, - paymentMethodLast4: BillingTable.paymentMethodLast4, - balance: BillingTable.balance, - reload: BillingTable.reload, - reloadAmount: BillingTable.reloadAmount, - reloadTrigger: BillingTable.reloadTrigger, - monthlyLimit: BillingTable.monthlyLimit, - monthlyUsage: BillingTable.monthlyUsage, - timeMonthlyUsageUpdated: BillingTable.timeMonthlyUsageUpdated, - reloadError: BillingTable.reloadError, - timeReloadError: BillingTable.timeReloadError, - }) + .select() .from(BillingTable) .where(eq(BillingTable.workspaceID, Actor.workspace())) .then((r) => r[0]), @@ -157,6 +144,27 @@ export namespace Billing { }) } + export const grantCredit = async (workspaceID: string, dollarAmount: number) => { + const amountInMicroCents = centsToMicroCents(dollarAmount * 100) + await Database.transaction(async (tx) => { + await tx + .update(BillingTable) + .set({ + balance: sql`${BillingTable.balance} + ${amountInMicroCents}`, + }) + .where(eq(BillingTable.workspaceID, workspaceID)) + await tx.insert(PaymentTable).values({ + workspaceID, + id: Identifier.create("payment"), + amount: amountInMicroCents, + enrichment: { + type: "credit", + }, + }) + }) + return amountInMicroCents + } + export const setMonthlyLimit = fn(z.number(), async (input) => { return await Database.use((tx) => tx @@ -211,6 +219,7 @@ export namespace Billing { customer: customer.customerID, customer_update: { name: "auto", + address: "auto", }, } : { @@ -280,4 +289,69 @@ export namespace Billing { return charge.receipt_url }, ) + + export const subscribe = fn( + z.object({ + seats: z.number(), + coupon: z.string().optional(), + }), + async ({ seats, coupon }) => { + const user = Actor.assert("user") + const billing = await Database.use((tx) => + tx + .select({ + customerID: BillingTable.customerID, + paymentMethodID: BillingTable.paymentMethodID, + subscriptionID: BillingTable.subscriptionID, + subscriptionPlan: BillingTable.subscriptionPlan, + timeSubscriptionSelected: BillingTable.timeSubscriptionSelected, + }) + .from(BillingTable) + .where(eq(BillingTable.workspaceID, Actor.workspace())) + .then((rows) => rows[0]), + ) + + if (!billing) throw new Error("Billing record not found") + if (!billing.timeSubscriptionSelected) throw new Error("Not selected for subscription") + if (billing.subscriptionID) throw new Error("Already subscribed") + if (!billing.customerID) throw new Error("No customer ID") + if (!billing.paymentMethodID) throw new Error("No payment method") + if (!billing.subscriptionPlan) throw new Error("No subscription plan") + + const subscription = await Billing.stripe().subscriptions.create({ + customer: billing.customerID, + default_payment_method: billing.paymentMethodID, + items: [{ price: BlackData.planToPriceID({ plan: billing.subscriptionPlan }) }], + metadata: { + workspaceID: Actor.workspace(), + }, + }) + + await Database.transaction(async (tx) => { + await tx + .update(BillingTable) + .set({ + subscriptionID: subscription.id, + subscription: { + status: "subscribed", + coupon, + seats, + plan: billing.subscriptionPlan!, + }, + subscriptionPlan: null, + timeSubscriptionBooked: null, + timeSubscriptionSelected: null, + }) + .where(eq(BillingTable.workspaceID, Actor.workspace())) + + await tx.insert(SubscriptionTable).values({ + workspaceID: Actor.workspace(), + id: Identifier.create("subscription"), + userID: user.properties.userID, + }) + }) + + return subscription.id + }, + ) } diff --git a/packages/console/core/src/black.ts b/packages/console/core/src/black.ts new file mode 100644 index 00000000000..5f8db62738d --- /dev/null +++ b/packages/console/core/src/black.ts @@ -0,0 +1,134 @@ +import { z } from "zod" +import { fn } from "./util/fn" +import { Resource } from "@opencode-ai/console-resource" +import { centsToMicroCents } from "./util/price" +import { getWeekBounds } from "./util/date" +import { SubscriptionPlan } from "./schema/billing.sql" + +export namespace BlackData { + const Schema = z.object({ + "200": z.object({ + fixedLimit: z.number().int(), + rollingLimit: z.number().int(), + rollingWindow: z.number().int(), + }), + "100": z.object({ + fixedLimit: z.number().int(), + rollingLimit: z.number().int(), + rollingWindow: z.number().int(), + }), + "20": z.object({ + fixedLimit: z.number().int(), + rollingLimit: z.number().int(), + rollingWindow: z.number().int(), + }), + }) + + export const validate = fn(Schema, (input) => { + return input + }) + + export const getLimits = fn( + z.object({ + plan: z.enum(SubscriptionPlan), + }), + ({ plan }) => { + const json = JSON.parse(Resource.ZEN_BLACK_LIMITS.value) + return Schema.parse(json)[plan] + }, + ) + + export const planToPriceID = fn( + z.object({ + plan: z.enum(SubscriptionPlan), + }), + ({ plan }) => { + if (plan === "200") return Resource.ZEN_BLACK_PRICE.plan200 + if (plan === "100") return Resource.ZEN_BLACK_PRICE.plan100 + return Resource.ZEN_BLACK_PRICE.plan20 + }, + ) + + export const priceIDToPlan = fn( + z.object({ + priceID: z.string(), + }), + ({ priceID }) => { + if (priceID === Resource.ZEN_BLACK_PRICE.plan200) return "200" + if (priceID === Resource.ZEN_BLACK_PRICE.plan100) return "100" + return "20" + }, + ) +} + +export namespace Black { + export const analyzeRollingUsage = fn( + z.object({ + plan: z.enum(SubscriptionPlan), + usage: z.number().int(), + timeUpdated: z.date(), + }), + ({ plan, usage, timeUpdated }) => { + const now = new Date() + const black = BlackData.getLimits({ plan }) + const rollingWindowMs = black.rollingWindow * 3600 * 1000 + const rollingLimitInMicroCents = centsToMicroCents(black.rollingLimit * 100) + const windowStart = new Date(now.getTime() - rollingWindowMs) + if (timeUpdated < windowStart) { + return { + status: "ok" as const, + resetInSec: black.rollingWindow * 3600, + usagePercent: 0, + } + } + + const windowEnd = new Date(timeUpdated.getTime() + rollingWindowMs) + if (usage < rollingLimitInMicroCents) { + return { + status: "ok" as const, + resetInSec: Math.ceil((windowEnd.getTime() - now.getTime()) / 1000), + usagePercent: Math.ceil(Math.min(100, (usage / rollingLimitInMicroCents) * 100)), + } + } + return { + status: "rate-limited" as const, + resetInSec: Math.ceil((windowEnd.getTime() - now.getTime()) / 1000), + usagePercent: 100, + } + }, + ) + + export const analyzeWeeklyUsage = fn( + z.object({ + plan: z.enum(SubscriptionPlan), + usage: z.number().int(), + timeUpdated: z.date(), + }), + ({ plan, usage, timeUpdated }) => { + const black = BlackData.getLimits({ plan }) + const now = new Date() + const week = getWeekBounds(now) + const fixedLimitInMicroCents = centsToMicroCents(black.fixedLimit * 100) + if (timeUpdated < week.start) { + return { + status: "ok" as const, + resetInSec: Math.ceil((week.end.getTime() - now.getTime()) / 1000), + usagePercent: 0, + } + } + if (usage < fixedLimitInMicroCents) { + return { + status: "ok" as const, + resetInSec: Math.ceil((week.end.getTime() - now.getTime()) / 1000), + usagePercent: Math.ceil(Math.min(100, (usage / fixedLimitInMicroCents) * 100)), + } + } + + return { + status: "rate-limited" as const, + resetInSec: Math.ceil((week.end.getTime() - now.getTime()) / 1000), + usagePercent: 100, + } + }, + ) +} diff --git a/packages/console/core/src/identifier.ts b/packages/console/core/src/identifier.ts index 8fdf79cde28..b10bf32f6f1 100644 --- a/packages/console/core/src/identifier.ts +++ b/packages/console/core/src/identifier.ts @@ -5,11 +5,13 @@ export namespace Identifier { const prefixes = { account: "acc", auth: "aut", + benchmark: "ben", billing: "bil", key: "key", model: "mod", payment: "pay", provider: "prv", + subscription: "sub", usage: "usg", user: "usr", workspace: "wrk", diff --git a/packages/console/core/src/model.ts b/packages/console/core/src/model.ts index 55d6c895c58..0fd8bdecfbf 100644 --- a/packages/console/core/src/model.ts +++ b/packages/console/core/src/model.ts @@ -35,7 +35,7 @@ export namespace ZenData { cost200K: ModelCostSchema.optional(), allowAnonymous: z.boolean().optional(), byokProvider: z.enum(["openai", "anthropic", "google"]).optional(), - stickyProvider: z.boolean().optional(), + stickyProvider: z.enum(["strict", "prefer"]).optional(), trial: TrialSchema.optional(), rateLimit: z.number().optional(), fallbackProvider: z.string().optional(), @@ -72,7 +72,10 @@ export namespace ZenData { Resource.ZEN_MODELS2.value + Resource.ZEN_MODELS3.value + Resource.ZEN_MODELS4.value + - Resource.ZEN_MODELS5.value, + Resource.ZEN_MODELS5.value + + Resource.ZEN_MODELS6.value + + Resource.ZEN_MODELS7.value + + Resource.ZEN_MODELS8.value, ) return ModelsSchema.parse(json) }) diff --git a/packages/console/core/src/schema/benchmark.sql.ts b/packages/console/core/src/schema/benchmark.sql.ts new file mode 100644 index 00000000000..8d435eddfd8 --- /dev/null +++ b/packages/console/core/src/schema/benchmark.sql.ts @@ -0,0 +1,14 @@ +import { index, mediumtext, mysqlTable, primaryKey, varchar } from "drizzle-orm/mysql-core" +import { id, timestamps } from "../drizzle/types" + +export const BenchmarkTable = mysqlTable( + "benchmark", + { + id: id(), + ...timestamps, + model: varchar("model", { length: 64 }).notNull(), + agent: varchar("agent", { length: 64 }).notNull(), + result: mediumtext("result").notNull(), + }, + (table) => [primaryKey({ columns: [table.id] }), index("time_created").on(table.timeCreated)], +) diff --git a/packages/console/core/src/schema/billing.sql.ts b/packages/console/core/src/schema/billing.sql.ts index 6d1520d1589..6f5c558504d 100644 --- a/packages/console/core/src/schema/billing.sql.ts +++ b/packages/console/core/src/schema/billing.sql.ts @@ -1,7 +1,8 @@ -import { bigint, boolean, int, mysqlTable, uniqueIndex, varchar } from "drizzle-orm/mysql-core" +import { bigint, boolean, index, int, json, mysqlEnum, mysqlTable, uniqueIndex, varchar } from "drizzle-orm/mysql-core" import { timestamps, ulid, utc, workspaceColumns } from "../drizzle/types" import { workspaceIndexes } from "./workspace.sql" +export const SubscriptionPlan = ["20", "100", "200"] as const export const BillingTable = mysqlTable( "billing", { @@ -21,8 +22,36 @@ export const BillingTable = mysqlTable( reloadError: varchar("reload_error", { length: 255 }), timeReloadError: utc("time_reload_error"), timeReloadLockedTill: utc("time_reload_locked_till"), + subscription: json("subscription").$type<{ + status: "subscribed" + coupon?: string + seats: number + plan: "20" | "100" | "200" + }>(), + subscriptionID: varchar("subscription_id", { length: 28 }), + subscriptionPlan: mysqlEnum("subscription_plan", SubscriptionPlan), + timeSubscriptionBooked: utc("time_subscription_booked"), + timeSubscriptionSelected: utc("time_subscription_selected"), }, - (table) => [...workspaceIndexes(table), uniqueIndex("global_customer_id").on(table.customerID)], + (table) => [ + ...workspaceIndexes(table), + uniqueIndex("global_customer_id").on(table.customerID), + uniqueIndex("global_subscription_id").on(table.subscriptionID), + ], +) + +export const SubscriptionTable = mysqlTable( + "subscription", + { + ...workspaceColumns, + ...timestamps, + userID: ulid("user_id").notNull(), + rollingUsage: bigint("rolling_usage", { mode: "number" }), + fixedUsage: bigint("fixed_usage", { mode: "number" }), + timeRollingUpdated: utc("time_rolling_updated"), + timeFixedUpdated: utc("time_fixed_updated"), + }, + (table) => [...workspaceIndexes(table), uniqueIndex("workspace_user_id").on(table.workspaceID, table.userID)], ) export const PaymentTable = mysqlTable( @@ -35,6 +64,15 @@ export const PaymentTable = mysqlTable( paymentID: varchar("payment_id", { length: 255 }), amount: bigint("amount", { mode: "number" }).notNull(), timeRefunded: utc("time_refunded"), + enrichment: json("enrichment").$type< + | { + type: "subscription" + couponID?: string + } + | { + type: "credit" + } + >(), }, (table) => [...workspaceIndexes(table)], ) @@ -54,6 +92,9 @@ export const UsageTable = mysqlTable( cacheWrite1hTokens: int("cache_write_1h_tokens"), cost: bigint("cost", { mode: "number" }).notNull(), keyID: ulid("key_id"), + enrichment: json("enrichment").$type<{ + plan: "sub" + }>(), }, - (table) => [...workspaceIndexes(table)], + (table) => [...workspaceIndexes(table), index("usage_time_created").on(table.workspaceID, table.timeCreated)], ) diff --git a/packages/console/core/src/schema/ip.sql.ts b/packages/console/core/src/schema/ip.sql.ts index be5fb7fa2da..97e35602487 100644 --- a/packages/console/core/src/schema/ip.sql.ts +++ b/packages/console/core/src/schema/ip.sql.ts @@ -10,3 +10,13 @@ export const IpTable = mysqlTable( }, (table) => [primaryKey({ columns: [table.ip] })], ) + +export const IpRateLimitTable = mysqlTable( + "ip_rate_limit", + { + ip: varchar("ip", { length: 45 }).notNull(), + interval: varchar("interval", { length: 10 }).notNull(), + count: int("count").notNull(), + }, + (table) => [primaryKey({ columns: [table.ip, table.interval] })], +) diff --git a/packages/console/core/src/util/date.test.ts b/packages/console/core/src/util/date.test.ts new file mode 100644 index 00000000000..074df8a2fad --- /dev/null +++ b/packages/console/core/src/util/date.test.ts @@ -0,0 +1,20 @@ +import { describe, expect, test } from "bun:test" +import { getWeekBounds } from "./date" + +describe("util.date.getWeekBounds", () => { + test("returns a Monday-based week for Sunday dates", () => { + const date = new Date("2026-01-18T12:00:00Z") + const bounds = getWeekBounds(date) + + expect(bounds.start.toISOString()).toBe("2026-01-12T00:00:00.000Z") + expect(bounds.end.toISOString()).toBe("2026-01-19T00:00:00.000Z") + }) + + test("returns a seven day window", () => { + const date = new Date("2026-01-14T12:00:00Z") + const bounds = getWeekBounds(date) + + const span = bounds.end.getTime() - bounds.start.getTime() + expect(span).toBe(7 * 24 * 60 * 60 * 1000) + }) +}) diff --git a/packages/console/core/src/util/date.ts b/packages/console/core/src/util/date.ts new file mode 100644 index 00000000000..9c1ab12d2c9 --- /dev/null +++ b/packages/console/core/src/util/date.ts @@ -0,0 +1,9 @@ +export function getWeekBounds(date: Date) { + const offset = (date.getUTCDay() + 6) % 7 + const start = new Date(date) + start.setUTCDate(date.getUTCDate() - offset) + start.setUTCHours(0, 0, 0, 0) + const end = new Date(start) + end.setUTCDate(start.getUTCDate() + 7) + return { start, end } +} diff --git a/packages/console/core/sst-env.d.ts b/packages/console/core/sst-env.d.ts index 632ea3fbe78..cb490281300 100644 --- a/packages/console/core/sst-env.d.ts +++ b/packages/console/core/sst-env.d.ts @@ -34,6 +34,14 @@ declare module "sst" { "type": "sst.cloudflare.SolidStart" "url": string } + "DISCORD_SUPPORT_BOT_TOKEN": { + "type": "sst.sst.Secret" + "value": string + } + "DISCORD_SUPPORT_CHANNEL_ID": { + "type": "sst.sst.Secret" + "value": string + } "Database": { "database": string "host": string @@ -42,14 +50,18 @@ declare module "sst" { "type": "sst.sst.Linkable" "username": string } - "Desktop": { - "type": "sst.cloudflare.StaticSite" - "url": string - } "EMAILOCTOPUS_API_KEY": { "type": "sst.sst.Secret" "value": string } + "FEISHU_APP_ID": { + "type": "sst.sst.Secret" + "value": string + } + "FEISHU_APP_SECRET": { + "type": "sst.sst.Secret" + "value": string + } "GITHUB_APP_ID": { "type": "sst.sst.Secret" "value": string @@ -82,6 +94,10 @@ declare module "sst" { "type": "sst.sst.Secret" "value": string } + "STRIPE_PUBLISHABLE_KEY": { + "type": "sst.sst.Secret" + "value": string + } "STRIPE_SECRET_KEY": { "type": "sst.sst.Secret" "value": string @@ -98,6 +114,21 @@ declare module "sst" { "type": "sst.cloudflare.Astro" "url": string } + "WebApp": { + "type": "sst.cloudflare.StaticSite" + "url": string + } + "ZEN_BLACK_LIMITS": { + "type": "sst.sst.Secret" + "value": string + } + "ZEN_BLACK_PRICE": { + "plan100": string + "plan20": string + "plan200": string + "product": string + "type": "sst.sst.Linkable" + } "ZEN_MODELS1": { "type": "sst.sst.Secret" "value": string @@ -118,6 +149,22 @@ declare module "sst" { "type": "sst.sst.Secret" "value": string } + "ZEN_MODELS6": { + "type": "sst.sst.Secret" + "value": string + } + "ZEN_MODELS7": { + "type": "sst.sst.Secret" + "value": string + } + "ZEN_MODELS8": { + "type": "sst.sst.Secret" + "value": string + } + "ZEN_SESSION_SECRET": { + "type": "sst.sst.Secret" + "value": string + } } } // cloudflare @@ -132,6 +179,7 @@ declare module "sst" { "GatewayKv": cloudflare.KVNamespace "LogProcessor": cloudflare.Service "ZenData": cloudflare.R2Bucket + "ZenDataNew": cloudflare.R2Bucket } } diff --git a/packages/console/function/package.json b/packages/console/function/package.json index 22322aa243d..4e531f63308 100644 --- a/packages/console/function/package.json +++ b/packages/console/function/package.json @@ -1,9 +1,10 @@ { "name": "@opencode-ai/console-function", - "version": "1.0.152", + "version": "1.1.33", "$schema": "https://json.schemastore.org/package.json", "private": true, "type": "module", + "license": "MIT", "scripts": { "typecheck": "tsgo --noEmit" }, diff --git a/packages/console/function/src/auth.ts b/packages/console/function/src/auth.ts index 742e0d567ce..c26ab215b32 100644 --- a/packages/console/function/src/auth.ts +++ b/packages/console/function/src/auth.ts @@ -35,7 +35,7 @@ export const subjects = createSubjects({ const MY_THEME: Theme = { ...THEME_OPENAUTH, - logo: "https://opencode.ai/favicon.svg", + logo: "https://opencode.ai/favicon-v3.svg", } export default { @@ -123,7 +123,11 @@ export default { }, }).then((x) => x.json())) as any subject = user.id.toString() - email = emails.find((x: any) => x.primary && x.verified)?.email + + const primaryEmail = emails.find((x: any) => x.primary) + if (!primaryEmail) throw new Error("No primary email found for GitHub user") + if (!primaryEmail.verified) throw new Error("Primary email for GitHub user not verified") + email = primaryEmail.email } else if (response.provider === "google") { if (!response.id.email_verified) throw new Error("Google email not verified") subject = response.id.sub as string diff --git a/packages/console/function/sst-env.d.ts b/packages/console/function/sst-env.d.ts index 632ea3fbe78..cb490281300 100644 --- a/packages/console/function/sst-env.d.ts +++ b/packages/console/function/sst-env.d.ts @@ -34,6 +34,14 @@ declare module "sst" { "type": "sst.cloudflare.SolidStart" "url": string } + "DISCORD_SUPPORT_BOT_TOKEN": { + "type": "sst.sst.Secret" + "value": string + } + "DISCORD_SUPPORT_CHANNEL_ID": { + "type": "sst.sst.Secret" + "value": string + } "Database": { "database": string "host": string @@ -42,14 +50,18 @@ declare module "sst" { "type": "sst.sst.Linkable" "username": string } - "Desktop": { - "type": "sst.cloudflare.StaticSite" - "url": string - } "EMAILOCTOPUS_API_KEY": { "type": "sst.sst.Secret" "value": string } + "FEISHU_APP_ID": { + "type": "sst.sst.Secret" + "value": string + } + "FEISHU_APP_SECRET": { + "type": "sst.sst.Secret" + "value": string + } "GITHUB_APP_ID": { "type": "sst.sst.Secret" "value": string @@ -82,6 +94,10 @@ declare module "sst" { "type": "sst.sst.Secret" "value": string } + "STRIPE_PUBLISHABLE_KEY": { + "type": "sst.sst.Secret" + "value": string + } "STRIPE_SECRET_KEY": { "type": "sst.sst.Secret" "value": string @@ -98,6 +114,21 @@ declare module "sst" { "type": "sst.cloudflare.Astro" "url": string } + "WebApp": { + "type": "sst.cloudflare.StaticSite" + "url": string + } + "ZEN_BLACK_LIMITS": { + "type": "sst.sst.Secret" + "value": string + } + "ZEN_BLACK_PRICE": { + "plan100": string + "plan20": string + "plan200": string + "product": string + "type": "sst.sst.Linkable" + } "ZEN_MODELS1": { "type": "sst.sst.Secret" "value": string @@ -118,6 +149,22 @@ declare module "sst" { "type": "sst.sst.Secret" "value": string } + "ZEN_MODELS6": { + "type": "sst.sst.Secret" + "value": string + } + "ZEN_MODELS7": { + "type": "sst.sst.Secret" + "value": string + } + "ZEN_MODELS8": { + "type": "sst.sst.Secret" + "value": string + } + "ZEN_SESSION_SECRET": { + "type": "sst.sst.Secret" + "value": string + } } } // cloudflare @@ -132,6 +179,7 @@ declare module "sst" { "GatewayKv": cloudflare.KVNamespace "LogProcessor": cloudflare.Service "ZenData": cloudflare.R2Bucket + "ZenDataNew": cloudflare.R2Bucket } } diff --git a/packages/console/mail/package.json b/packages/console/mail/package.json index f26d54d3582..24cc1eb4c48 100644 --- a/packages/console/mail/package.json +++ b/packages/console/mail/package.json @@ -1,6 +1,6 @@ { "name": "@opencode-ai/console-mail", - "version": "1.0.152", + "version": "1.1.33", "dependencies": { "@jsx-email/all": "2.2.3", "@jsx-email/cli": "1.4.3", @@ -17,5 +17,6 @@ "scripts": { "dev": "email preview emails/templates" }, - "type": "module" + "type": "module", + "license": "MIT" } diff --git a/packages/console/resource/package.json b/packages/console/resource/package.json index f110f6c2a56..6e874331d24 100644 --- a/packages/console/resource/package.json +++ b/packages/console/resource/package.json @@ -1,6 +1,7 @@ { "$schema": "https://json.schemastore.org/package.json", "name": "@opencode-ai/console-resource", + "license": "MIT", "dependencies": { "@cloudflare/workers-types": "catalog:" }, diff --git a/packages/console/resource/sst-env.d.ts b/packages/console/resource/sst-env.d.ts index 632ea3fbe78..cb490281300 100644 --- a/packages/console/resource/sst-env.d.ts +++ b/packages/console/resource/sst-env.d.ts @@ -34,6 +34,14 @@ declare module "sst" { "type": "sst.cloudflare.SolidStart" "url": string } + "DISCORD_SUPPORT_BOT_TOKEN": { + "type": "sst.sst.Secret" + "value": string + } + "DISCORD_SUPPORT_CHANNEL_ID": { + "type": "sst.sst.Secret" + "value": string + } "Database": { "database": string "host": string @@ -42,14 +50,18 @@ declare module "sst" { "type": "sst.sst.Linkable" "username": string } - "Desktop": { - "type": "sst.cloudflare.StaticSite" - "url": string - } "EMAILOCTOPUS_API_KEY": { "type": "sst.sst.Secret" "value": string } + "FEISHU_APP_ID": { + "type": "sst.sst.Secret" + "value": string + } + "FEISHU_APP_SECRET": { + "type": "sst.sst.Secret" + "value": string + } "GITHUB_APP_ID": { "type": "sst.sst.Secret" "value": string @@ -82,6 +94,10 @@ declare module "sst" { "type": "sst.sst.Secret" "value": string } + "STRIPE_PUBLISHABLE_KEY": { + "type": "sst.sst.Secret" + "value": string + } "STRIPE_SECRET_KEY": { "type": "sst.sst.Secret" "value": string @@ -98,6 +114,21 @@ declare module "sst" { "type": "sst.cloudflare.Astro" "url": string } + "WebApp": { + "type": "sst.cloudflare.StaticSite" + "url": string + } + "ZEN_BLACK_LIMITS": { + "type": "sst.sst.Secret" + "value": string + } + "ZEN_BLACK_PRICE": { + "plan100": string + "plan20": string + "plan200": string + "product": string + "type": "sst.sst.Linkable" + } "ZEN_MODELS1": { "type": "sst.sst.Secret" "value": string @@ -118,6 +149,22 @@ declare module "sst" { "type": "sst.sst.Secret" "value": string } + "ZEN_MODELS6": { + "type": "sst.sst.Secret" + "value": string + } + "ZEN_MODELS7": { + "type": "sst.sst.Secret" + "value": string + } + "ZEN_MODELS8": { + "type": "sst.sst.Secret" + "value": string + } + "ZEN_SESSION_SECRET": { + "type": "sst.sst.Secret" + "value": string + } } } // cloudflare @@ -132,6 +179,7 @@ declare module "sst" { "GatewayKv": cloudflare.KVNamespace "LogProcessor": cloudflare.Service "ZenData": cloudflare.R2Bucket + "ZenDataNew": cloudflare.R2Bucket } } diff --git a/packages/desktop/.gitignore b/packages/desktop/.gitignore index 4a20d55a70d..a547bf36d8d 100644 --- a/packages/desktop/.gitignore +++ b/packages/desktop/.gitignore @@ -1 +1,24 @@ -src/assets/theme.css +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/packages/desktop/AGENTS.md b/packages/desktop/AGENTS.md deleted file mode 100644 index 3137bddc257..00000000000 --- a/packages/desktop/AGENTS.md +++ /dev/null @@ -1,28 +0,0 @@ -# Agent Guidelines for @opencode/app - -## Build/Test Commands - -- **Development**: `bun run dev` (starts Vite dev server on port 3000) -- **Build**: `bun run build` (production build) -- **Preview**: `bun run serve` (preview production build) -- **Validation**: Use `bun run typecheck` only - do not build or run project for validation -- **Testing**: Do not create or run automated tests - -## Code Style - -- **Framework**: SolidJS with TypeScript -- **Imports**: Use `@/` alias for src/ directory (e.g., `import Button from "@/ui/button"`) -- **Formatting**: Prettier configured with semicolons disabled, 120 character line width -- **Components**: Use function declarations, splitProps for component props -- **Types**: Define interfaces for component props, avoid `any` type -- **CSS**: TailwindCSS with custom CSS variables theme system -- **Naming**: PascalCase for components, camelCase for variables/functions, snake_case for file names -- **File Structure**: UI primitives in `/ui/`, higher-level components in `/components/`, pages in `/pages/`, providers in `/providers/` - -## Key Dependencies - -- SolidJS, @solidjs/router, @kobalte/core (UI primitives) -- TailwindCSS 4.x with @tailwindcss/vite -- Custom theme system with CSS variables - -No special rules files found. diff --git a/packages/desktop/README.md b/packages/desktop/README.md index 6a176453668..ebaf4882231 100644 --- a/packages/desktop/README.md +++ b/packages/desktop/README.md @@ -1,34 +1,32 @@ -## Usage +# OpenCode Desktop -Those templates dependencies are maintained via [pnpm](https://pnpm.io) via `pnpm up -Lri`. +Native OpenCode desktop app, built with Tauri v2. -This is the reason you see a `pnpm-lock.yaml`. That being said, any package manager will work. This file can be safely be removed once you clone a template. +## Development + +From the repo root: ```bash -$ npm install # or pnpm install or yarn install +bun install +bun run --cwd packages/desktop tauri dev ``` -### Learn more on the [Solid Website](https://solidjs.com) and come chat with us on our [Discord](https://discord.com/invite/solidjs) - -## Available Scripts - -In the project directory, you can run: - -### `npm run dev` or `npm start` +This starts the Vite dev server on http://localhost:1420 and opens the native window. -Runs the app in the development mode.
    -Open [http://localhost:3000](http://localhost:3000) to view it in the browser. +If you only want the web dev server (no native shell): -The page will reload if you make edits.
    +```bash +bun run --cwd packages/desktop dev +``` -### `npm run build` +## Build -Builds the app for production to the `dist` folder.
    -It correctly bundles Solid in production mode and optimizes the build for the best performance. +To create a production `dist/` and build the native app bundle: -The build is minified and the filenames include the hashes.
    -Your app is ready to be deployed! +```bash +bun run --cwd packages/desktop tauri build +``` -## Deployment +## Prerequisites -You can deploy the `dist` folder to any static host provider (netlify, surge, now, etc.) +Running the desktop app requires additional Tauri dependencies (Rust toolchain, platform-specific libraries). See the [Tauri prerequisites](https://v2.tauri.app/start/prerequisites/) for setup instructions. diff --git a/packages/desktop/index.html b/packages/desktop/index.html index 9803517a07e..6a81ef4a50d 100644 --- a/packages/desktop/index.html +++ b/packages/desktop/index.html @@ -1,28 +1,24 @@ - + OpenCode - - - - + + + + + - - + -
    - +
    +