Skip to content

About

Magpie/OpenCode provider plugin for Huawei Cloud OfficeAce (果办/OfficeClaw) models

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

opencode-officeace-auth

English | 简体中文


简体中文

华为云 OfficeAce (果办 / OfficeClaw) 模型接入插件,适用于 Magpie 与 OpenCode。

通过华为云 OAuth 2.0 (PKCE + DPoP) 认证接入果办模型平台,利用华为云 API 网关(V11-HMAC-SHA256 签名)自动获取模型推理 AppKey / AppSecret,提供全自动的 OpenAI 兼容 Chat Completions 对话接口。

🌟 特性

  • 全自动凭据管理:支持 OAuth 2.0 PKCE + DPoP 授权登录与静默无感自动续期。
  • 免依赖桌面客户端:原生对接华为云云端 API(V11-HMAC-SHA256 订阅接口),无需本地安装或启动 OfficeClaw 桌面软件即可全功能使用。
  • 完整模型矩阵:支持 GLM-5.3、DeepSeek-V4.1-Flash、GLM-5.2、openPangu-2.0-Pro、Kimi-K2.6 等全量体验版/正式版大模型。
  • 零外部运行依赖:纯原生 Node.js / Bun(内置 WebCrypto + node:crypto),极致轻量快速。
  • 高覆盖率测试:包含 48 项严格单元测试,覆盖加密签名、PKCE/DPoP、凭据置换、模型发现与推理适配全链路。

📦 安装方式

1. 在 Magpie 中一键安装(推荐)

通过 Magpie 插件市场或命令行直接添加:

magpie plugin add yuweihao17/opencode-officeace-auth

或者本地目录安装开发版:

magpie plugin add /path/to/OfficeAce

2. 在云服务器 / Web 端 Magpie 部署

进入云服务器终端执行:

magpie plugin add github:yuweihao17/opencode-officeace-auth

🔑 登录与使用指南

  1. 打开 Magpie 界面,进入 【供应商】(Providers) 页面。
  2. 找到 OfficeAce 并点击 【登录】。
  3. 浏览器会自动打开华为云登录页面,完成华为云账号登录授权。
  4. 针对云端 / 网页版 Magpie 场景:
    • 登录完成后,浏览器如果跳转至 http://127.0.0.1:... 页面并提示“无法连接”,这是正常现象(因为回调端口监听在云服务器内部)。
    • 直接复制浏览器地址栏的整串网址(格式为 http://127.0.0.1:<端口>/oauth/callback?code=...)。
    • 切回 Magpie 网页端的登录弹窗,将完整链接粘贴到 【回调 URL】 输入框中,点击 【完成登录】 即可! (桌面客户端会自动完成回调,无需手动粘贴)。
  5. 在模型列表中勾选所需模型,点击 【保存】。

🧪 本地测试

npm test
# 或
node --test

48 项单元测试全部通过。


English

A Magpie / OpenCode provider plugin for Huawei Cloud OfficeAce (果办 / OfficeClaw) models.

It provides complete OAuth 2.0 (PKCE + DPoP) sign-in against Huawei Cloud STS, automatic model credential discovery via Huawei Cloud API Gateway (V11-HMAC-SHA256), and high-performance OpenAI-compatible Chat Completions.

🌟 Features

  • OAuth 2.0 PKCE + DPoP: Full browser sign-in lifecycle and silent token refresh.
  • Stand-alone Cloud Operation: Directly connects to Huawei Cloud's model gateway; does not require the OfficeClaw desktop client to be installed or running.
  • Supported Models: Full access to GLM-5.3, DeepSeek-V4.1-Flash, GLM-5.2, openPangu-2.0-Pro, Kimi-K2.6, and more.
  • Zero Runtime Dependencies: Pure Node.js / Bun standard library (WebCrypto + node:crypto).
  • Comprehensive Testing: 48 automated unit tests covering cryptographic primitives, OAuth flows, and model routing.

📦 Installation

In Magpie CLI / Desktop

magpie plugin add yuweihao17/opencode-officeace-auth

Or from local source:

magpie plugin add D:\Projects\OfficeAce

🧪 Testing

npm test

License

MIT

About

Magpie/OpenCode provider plugin for Huawei Cloud OfficeAce (果办/OfficeClaw) models

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages