From 6befa8ebb64f533d72797f9bedecf8379f31f68b Mon Sep 17 00:00:00 2001 From: Yige Date: Sat, 8 Aug 2026 17:12:10 +0800 Subject: [PATCH] =?UTF-8?q?feat(compute):=20=E9=87=8D=E6=96=B0=E5=8F=91?= =?UTF-8?q?=E5=B8=83=20Claude=20=E8=AE=A2=E9=98=85=20provider=EF=BC=88anth?= =?UTF-8?q?ropic-claude=EF=BC=89=EF=BC=8CpresetDataVersion=20=E2=86=92=208?= =?UTF-8?q?4=20(#70)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #47/#48/#49 曾因 credentialSource 硬 enum 毒丸老客户端而被 #50 回滚。毒丸根因已由 客户端 desirecore#1021 系统性修复(credentialSource 改开放 string + 合并 salvage + 能力门控降级),claude-oauth 检测器与 SDK 网关由 desirecore#1008 提供, requiredClientVersion 运行时门槛由 desirecore#1038 提供,三者同在 v10.0.83 发布。 本次重新发布相较 #47 的变化: - 声明 requiredClientVersion = 10.0.83,低版本客户端优雅门控为「需更新客户端」 - displayName 去掉冗余 (订阅) 后缀,对齐 #58 的 Codex 命名约定 - 文件名 anthropic-claude.json 与 _index.json basename 一致(#48 的修正一并纳入) --- __tests__/validate.test.mjs | 1 + compute/providers/_index.json | 1 + compute/providers/anthropic-claude.json | 106 ++++++++++++++++++++++++ manifest.json | 4 +- schemas/provider.schema.json | 4 +- 5 files changed, 112 insertions(+), 4 deletions(-) create mode 100644 compute/providers/anthropic-claude.json diff --git a/__tests__/validate.test.mjs b/__tests__/validate.test.mjs index 8581604..999e048 100644 --- a/__tests__/validate.test.mjs +++ b/__tests__/validate.test.mjs @@ -233,6 +233,7 @@ describe('真实数据全量校验', () => { it('所有 Provider 应按供应商归属计价,模型来源不覆盖供应商币种', () => { const expectedCurrencies = { anthropic: 'USD', + 'anthropic-claude': 'USD', baichuan: 'CNY', baidu: 'CNY', cohere: 'USD', diff --git a/compute/providers/_index.json b/compute/providers/_index.json index 20a9ea2..a737bd9 100644 --- a/compute/providers/_index.json +++ b/compute/providers/_index.json @@ -4,6 +4,7 @@ "openai", "openai-codex", "anthropic", + "anthropic-claude", "deepseek", "dashscope", "volcengine", diff --git a/compute/providers/anthropic-claude.json b/compute/providers/anthropic-claude.json new file mode 100644 index 0000000..4f909c5 --- /dev/null +++ b/compute/providers/anthropic-claude.json @@ -0,0 +1,106 @@ +{ + "id": "provider-anthropic-claude-plan-001", + "provider": "anthropic-claude", + "brandGroup": "anthropic", + "label": "Claude 订阅 (Claude Code)", + "baseUrl": "https://api.anthropic.com", + "apiFormat": "anthropic-messages", + "apiKeyRef": "anthropic-claude-oauth-token", + "apiKeyVerified": false, + "enabled": false, + "status": "unconfigured", + "priceCurrency": "USD", + "accessMode": "coding-plan", + "credentialSource": "claude-oauth", + "requiredClientVersion": "10.0.83", + "codingPlan": { + "quotas": {}, + "usageTracking": { + "method": "none", + "consoleUrl": "https://claude.ai/settings/usage" + } + }, + "services": [ + "chat", + "reasoning" + ], + "models": [ + { + "modelName": "claude-fable-5", + "displayName": "Claude Fable 5", + "serviceType": [ + "chat" + ], + "description": "Claude 订阅额度计费,Anthropic 最高能力公开模型,面向长程智能体与高难推理,1M 上下文", + "contextWindow": 1000000, + "maxOutputTokens": 128000, + "capabilities": [ + "chat", + "reasoning", + "code", + "vision", + "tool_use", + "agent", + "long_context" + ], + "source": "preset" + }, + { + "modelName": "claude-opus-4-8", + "displayName": "Claude Opus 4.8", + "serviceType": [ + "chat" + ], + "description": "Claude 订阅额度计费,Opus 级复杂智能体编码与企业任务模型,1M 上下文", + "contextWindow": 1000000, + "maxOutputTokens": 128000, + "capabilities": [ + "chat", + "reasoning", + "code", + "vision", + "tool_use", + "agent", + "long_context" + ], + "source": "preset" + }, + { + "modelName": "claude-sonnet-5", + "displayName": "Claude Sonnet 5", + "serviceType": [ + "chat" + ], + "description": "Claude 订阅额度计费,速度与智能平衡模型,支持长上下文智能体任务", + "contextWindow": 1000000, + "maxOutputTokens": 128000, + "capabilities": [ + "chat", + "reasoning", + "code", + "vision", + "tool_use", + "agent", + "long_context" + ], + "source": "preset" + }, + { + "modelName": "claude-haiku-4-5", + "displayName": "Claude Haiku 4.5", + "serviceType": [ + "chat" + ], + "description": "Claude 订阅额度计费,最快模型,具备接近前沿模型的智能水平,200K 上下文", + "contextWindow": 200000, + "maxOutputTokens": 64000, + "capabilities": [ + "chat", + "code", + "vision", + "tool_use" + ], + "source": "preset" + } + ] +} diff --git a/manifest.json b/manifest.json index 9300af9..1eb1703 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "version": "1.0.0", - "presetDataVersion": 83, - "updatedAt": "2026-07-28", + "presetDataVersion": 84, + "updatedAt": "2026-08-08", "description": "DesireCore 官方配置中心" } diff --git a/schemas/provider.schema.json b/schemas/provider.schema.json index 6f197d3..f3e337f 100644 --- a/schemas/provider.schema.json +++ b/schemas/provider.schema.json @@ -83,8 +83,8 @@ }, "credentialSource": { "type": "string", - "enum": ["codex-cli"], - "description": "凭证托管来源。codex-cli:密钥由客户端本地 Codex CLI 凭证检测器托管(读取 ~/.codex/auth.json 自动刷新写回,fresh token 同步 secrets.json)。需 requiredClientVersion ≥ 引入此字段的客户端版本——老客户端不识别本字段,必须先发版铺开 compute.json 韧性(容忍未知字段)再推送本数据" + "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 韧性(容忍未知字段)再推送本数据" }, "codingPlan": { "type": "object",