npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

opencode-codebuddy-internal-auth

v1.0.1

Published

OpenCode plugin for CodeBuddy Internal (Claude Code Internal) OAuth authentication

Readme

OpenCode CodeBuddy Internal Auth Plugin

为 OpenCode 提供 CodeBuddy Internal (Claude Code Internal) 的 OAuth 认证支持。

功能

  • Device Code Flow 认证: 自动完成工蜂 OAuth 认证
  • Token 自动刷新: 无需手动管理 Token
  • 完整 Headers 注入: 自动添加所有必需的请求头

安装方式

方式一:本地插件(推荐开发测试)

将整个 opencode-codebuddy-internal-auth 目录复制到:

# 项目级插件
cp -r opencode-codebuddy-internal-auth /path/to/your/project/.opencode/plugins/

# 或全局插件
cp -r opencode-codebuddy-internal-auth ~/.config/opencode/plugins/

方式二:npm 包(推荐生产使用)

  1. 发布到 npm:
cd opencode-codebuddy-internal-auth
npm publish
  1. opencode.json 中配置:
{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["opencode-codebuddy-internal-auth"]
}

配置 Provider

opencode.json 中添加 provider 配置:

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["opencode-codebuddy-internal-auth"],
  "provider": {
    "codebuddy-internal": {
      "npm": "@ai-sdk/anthropic",
      "name": "CodeBuddy Internal",
      "models": {
        "claude-sonnet-4.5": {
          "name": "Claude Sonnet 4.5",
          "contextLength": 200000
        },
        "claude-opus-4.5": {
          "name": "Claude Opus 4.5",
          "contextLength": 200000
        },
        "glm-4.7": {
          "name": "GLM-4.7 (Haiku)",
          "contextLength": 128000
        }
      }
    }
  },
  "model": {
    "default": "codebuddy-internal/claude-sonnet-4.5"
  }
}

使用流程

  1. 启动 OpenCode
  2. 选择 codebuddy-internal provider
  3. 系统会提示进行认证
  4. 选择 "工蜂 OAuth (Device Code)" 方式
  5. 浏览器会打开授权页面,输入显示的 user_code
  6. 授权完成后自动获取 Token

可用模型

| 模型 ID | 名称 | 说明 | |---------|------|------| | claude-sonnet-4.5 | Claude Sonnet 4.5 | 非敏感仓库可用,有额度限制 | | claude-opus-4.5 | Claude Opus 4.5 | 非敏感仓库可用,额度消耗更快 | | glm-4.7 | GLM-4.7 / DeepSeek | 无限制 |

注意: API Key 模式只能使用 GLM-4.7,要使用 Claude 模型必须通过 OAuth 认证!

技术细节

认证端点

| 用途 | 端点 | |------|------| | Device Code 请求 | https://copilot.code.woa.com/api/v2/auth/device/code | | Device Token 轮询 | https://copilot.code.woa.com/api/v2/auth/device/token | | Token 刷新 | https://copilot.code.woa.com/api/v2/auth/oauth_token/refresh | | Gateway | https://copilot.code.woa.com/server/chat/codebuddy-gateway/codebuddy-code |

请求 Headers

插件会自动注入以下 Headers:

x-api-key: {accessToken}
x-conversation-id: {uuid}
x-app-version: 1.0.2
x-app-name: codebuddy-code
x-request-platform: CodeBuddy-Code
x-scene-name: common_chat
user-agent: Claude-Code-Internal/1.0.2
x-request-platform-v2: Claude-Code-Internal
x-app-name-v2: claude-code-internal
x-claude-code-internal: true
x-channel: claude-code-internal

开发

# 安装依赖
bun install

# 类型检查
bun run typecheck

License

MIT