From 9f331d3f782ff154ad9fa22f932ebafd78c759cb Mon Sep 17 00:00:00 2001 From: Yige Date: Mon, 31 Aug 2026 02:16:30 -0400 Subject: [PATCH] =?UTF-8?q?feat(compute):=20=E6=96=B0=E5=A2=9E=20GitHub=20?= =?UTF-8?q?Copilot=20=E8=AE=A2=E9=98=85=20Provider=20=E9=A2=84=E8=AE=BE=20?= =?UTF-8?q?(#90)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - compute/providers/github-copilot.json:coding-plan + credentialSource github-copilot,models 留空(可用集合随订阅档位与组织策略变化,由客户端 登录后经 /models 动态发现) - schemas/provider.schema.json:credentialSource 枚举登记 github-copilot 及其语义 - _index.json 顺序追加;manifest presetDataVersion 105 → 106 - 测试计价归属表登记 github-copilot(USD) Co-authored-by: yi-ge --- __tests__/validate.test.mjs | 1 + compute/providers/_index.json | 1 + compute/providers/github-copilot.json | 28 +++++++++++++++++++++++++++ manifest.json | 4 ++-- schemas/provider.schema.json | 4 ++-- 5 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 compute/providers/github-copilot.json diff --git a/__tests__/validate.test.mjs b/__tests__/validate.test.mjs index 28e516f..53ae7ce 100644 --- a/__tests__/validate.test.mjs +++ b/__tests__/validate.test.mjs @@ -446,6 +446,7 @@ describe('真实数据全量校验', () => { cohere: 'USD', dashscope: 'CNY', deepseek: 'CNY', + 'github-copilot': 'USD', google: 'USD', kling: 'CNY', 'local-whisper': 'USD', diff --git a/compute/providers/_index.json b/compute/providers/_index.json index ba2dfb0..af997d6 100644 --- a/compute/providers/_index.json +++ b/compute/providers/_index.json @@ -5,6 +5,7 @@ "openai-codex", "anthropic", "anthropic-claude", + "github-copilot", "deepseek", "dashscope", "volcengine", diff --git a/compute/providers/github-copilot.json b/compute/providers/github-copilot.json new file mode 100644 index 0000000..4327880 --- /dev/null +++ b/compute/providers/github-copilot.json @@ -0,0 +1,28 @@ +{ + "id": "provider-github-copilot-plan-001", + "provider": "github-copilot", + "brandGroup": "github", + "label": "GitHub Copilot 订阅", + "baseUrl": "https://api.githubcopilot.com", + "apiFormat": "openai-completions", + "apiKeyRef": "github-copilot-session-token", + "apiKeyVerified": false, + "enabled": false, + "status": "unconfigured", + "priceCurrency": "USD", + "accessMode": "coding-plan", + "credentialSource": "github-copilot", + "requiredClientVersion": "10.0.132", + "codingPlan": { + "quotas": {}, + "usageTracking": { + "method": "none", + "consoleUrl": "https://github.com/settings/copilot/features" + } + }, + "services": [ + "chat", + "reasoning" + ], + "models": [] +} diff --git a/manifest.json b/manifest.json index e434708..1e1eb10 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "version": "1.0.0", - "presetDataVersion": 105, - "updatedAt": "2026-08-28", + "presetDataVersion": 106, + "updatedAt": "2026-08-31", "description": "DesireCore 官方配置中心" } diff --git a/schemas/provider.schema.json b/schemas/provider.schema.json index c4c179c..471953b 100644 --- a/schemas/provider.schema.json +++ b/schemas/provider.schema.json @@ -83,8 +83,8 @@ }, "credentialSource": { "type": "string", - "enum": ["codex-cli", "claude-oauth"], - "description": "凭证托管来源。codex-cli:密钥由客户端本地 Codex CLI 凭证检测器托管(读取 ~/.codex/auth.json 自动刷新写回,fresh token 同步 secrets.json)。claude-oauth:Claude 订阅接入,由客户端 claude-auth 检测器托管——首选复用本机 Claude Code 登录(Agent SDK 自读,不写不刷新),或应用内 OAuth / setup-token 兜底;模型调用经 compat-proxy 内 claude-agent-sdk 后端履约,不直连。需 requiredClientVersion ≥ 引入此字段的客户端版本——老客户端不识别本字段,必须先发版铺开 compute.json 韧性(容忍未知字段)再推送本数据" + "enum": ["codex-cli", "claude-oauth", "github-copilot"], + "description": "凭证托管来源。codex-cli:密钥由客户端本地 Codex CLI 凭证检测器托管(读取 ~/.codex/auth.json 自动刷新写回,fresh token 同步 secrets.json)。claude-oauth:Claude 订阅接入,由客户端 claude-auth 检测器托管——首选复用本机 Claude Code 登录(Agent SDK 自读,不写不刷新),或应用内 OAuth / setup-token 兜底;模型调用经 compat-proxy 内 claude-agent-sdk 后端履约,不直连。github-copilot:GitHub Copilot 订阅接入,由客户端 copilot-auth 检测器托管——GitHub Device Flow 登录,长期 GitHub OAuth token 存 config/copilot-oauth.json,定期交换约 30 分钟有效的 Copilot session token 写入 secrets.json;模型调用携带 Copilot 协议 headers 直连交换响应 endpoints.api 指定域名,模型列表由客户端在登录后经 /models 动态发现(可用集合随订阅档位与组织策略变化,故预设 models 为空)。需 requiredClientVersion ≥ 引入此字段的客户端版本——老客户端不识别本字段,必须先发版铺开 compute.json 韧性(容忍未知字段)再推送本数据" }, "codingPlan": { "type": "object",