mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 13:38:31 +00:00
feat(providers): add trae/windsurf/zed/workbuddy/codebuddy-intl + icons
- New providers: trae, windsurf, zed, workbuddy, codebuddy-intl
(registry + executor, wired into executors/index.js + registry/index.js)
- zed: port hosted cloud proxy from OmniRoute — RSA access-token → short-lived
LLM token exchange (shared/zedAuth.js) + NDJSON {event}/{status}/[DONE]
stream translated back to OpenAI via Claude/Gemini/OpenAI-Responses translators
- Provider icons (128x128 png) for the 5 new providers
- qoder + tokenRefresh provider tweaks
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
79918c7830
commit
039c4dbc72
@@ -0,0 +1,74 @@
|
||||
// CodeBuddy international (codebuddy.ai) — mirrors codebuddy-cn registry shape,
|
||||
// swapping the Tencent CN domain for the .ai endpoint set discovered in
|
||||
// cockpit-tools/src-tauri/src/modules/codebuddy_oauth.rs. All OAuth/plugin URLs
|
||||
// use the /v2/plugin prefix with platform=ide (CN uses platform=CLI).
|
||||
export default {
|
||||
id: "codebuddy-intl",
|
||||
alias: "cbai",
|
||||
uiAlias: "cbai",
|
||||
hidden: false,
|
||||
priority: 90,
|
||||
display: {
|
||||
name: "CodeBuddy",
|
||||
icon: "smart_toy",
|
||||
color: "#006EFF",
|
||||
website: "https://www.codebuddy.ai",
|
||||
notice: {
|
||||
signupUrl: "https://www.codebuddy.ai",
|
||||
},
|
||||
},
|
||||
category: "oauth",
|
||||
authModes: ["oauth", "apikey"],
|
||||
hasOAuth: true,
|
||||
transport: {
|
||||
// Chat gateway is OpenAI-compatible SSE (same /v2/chat/completions path as CN).
|
||||
baseUrl: "https://www.codebuddy.ai/v2/chat/completions",
|
||||
forceStream: true,
|
||||
// CodeBuddy intl speaks the same unified OpenAI reasoning_effort shape as CN.
|
||||
thinkingFormat: "openai",
|
||||
headers: {
|
||||
"User-Agent": "IDE/2.108.1 CodeBuddy/2.108.1",
|
||||
"X-Product": "SaaS",
|
||||
"X-IDE-Type": "IDE",
|
||||
"X-IDE-Name": "IDE",
|
||||
"x-requested-with": "XMLHttpRequest",
|
||||
"x-codebuddy-request": "1",
|
||||
},
|
||||
auth: {
|
||||
combined: true,
|
||||
header: "Authorization",
|
||||
scheme: "bearer",
|
||||
},
|
||||
},
|
||||
// Same model lineup exposed by the CN gateway — intl backend is the same catalog.
|
||||
models: [
|
||||
{ id: "glm-5.2", name: "GLM-5.2" },
|
||||
{ id: "glm-5.1", name: "GLM-5.1" },
|
||||
{ id: "glm-5.0", name: "GLM-5.0" },
|
||||
{ id: "glm-5.0-turbo", name: "GLM-5.0-Turbo" },
|
||||
{ id: "glm-5v-turbo", name: "GLM-5v-Turbo" },
|
||||
{ id: "glm-4.7", name: "GLM-4.7" },
|
||||
{ id: "minimax-m3", name: "MiniMax-M3" },
|
||||
{ id: "minimax-m2.7", name: "MiniMax-M2.7" },
|
||||
{ id: "kimi-k2.7", name: "Kimi-K2.7-Code" },
|
||||
{ id: "kimi-k2.6", name: "Kimi-K2.6" },
|
||||
{ id: "kimi-k2.5", name: "Kimi-K2.5" },
|
||||
{ id: "hy3-preview", name: "Hy3 Preview" },
|
||||
{ id: "deepseek-v4-pro", name: "DeepSeek-V4-Pro" },
|
||||
{ id: "deepseek-v4-flash", name: "DeepSeek-V4-Flash" },
|
||||
{ id: "deepseek-v3-2-volc", name: "DeepSeek-V3.2" },
|
||||
],
|
||||
oauth: {
|
||||
baseUrl: "https://www.codebuddy.ai",
|
||||
stateUrl: "https://www.codebuddy.ai/v2/plugin/auth/state",
|
||||
tokenUrl: "https://www.codebuddy.ai/v2/plugin/auth/token",
|
||||
refreshUrl: "https://www.codebuddy.ai/v2/plugin/auth/token/refresh",
|
||||
userAgent: "IDE/2.63.2 CodeBuddy/2.63.2",
|
||||
platform: "ide",
|
||||
pollInterval: 5000,
|
||||
},
|
||||
features: {
|
||||
usage: true,
|
||||
usageApikey: true,
|
||||
},
|
||||
};
|
||||
@@ -99,6 +99,11 @@ import p96 from "./xiaomi-mimo.js";
|
||||
import p97 from "./xiaomi-tokenplan.js";
|
||||
import p98 from "./youcom.js";
|
||||
import p99 from "./alims-intl.js";
|
||||
import p100 from "./codebuddy-intl.js";
|
||||
import p101 from "./workbuddy.js";
|
||||
import p102 from "./trae.js";
|
||||
import p103 from "./zed.js";
|
||||
import p104 from "./windsurf.js";
|
||||
|
||||
export default [
|
||||
p0,
|
||||
@@ -201,4 +206,9 @@ export default [
|
||||
p97,
|
||||
p98,
|
||||
p99,
|
||||
p100,
|
||||
p101,
|
||||
p102,
|
||||
p103,
|
||||
p104,
|
||||
];
|
||||
|
||||
@@ -25,18 +25,22 @@ export default {
|
||||
},
|
||||
},
|
||||
models: [
|
||||
// { id: "auto", name: "Qoder Auto" },
|
||||
// { id: "ultimate", name: "Qoder Ultimate" },
|
||||
// { id: "performance", name: "Qoder Performance" },
|
||||
// { id: "efficient", name: "Qoder Efficient" },
|
||||
// { id: "lite", name: "Qoder Lite" },
|
||||
// { id: "qmodel", name: "Qwen 3.6 Plus (Qoder)" },
|
||||
{ id: "qmodel_latest", name: "Qoder Qwen 3.7 Max" },
|
||||
// { id: "dmodel", name: "DeepSeek V4 Pro (Qoder)" },
|
||||
// { id: "dfmodel", name: "DeepSeek V4 Flash (Qoder)" },
|
||||
// { id: "gm51model", name: "GLM 5.1 (Qoder)" },
|
||||
// { id: "kmodel", name: "Kimi K2.6 (Qoder)" },
|
||||
// { id: "mmodel", name: "MiniMax M2.7 (Qoder)" },
|
||||
{ id: "qoder-rome-30ba3b", name: "Qoder ROME" },
|
||||
{ id: "glm-5.2", name: "GLM-5.2" },
|
||||
{ id: "minimax-m3", name: "MiniMax M3" },
|
||||
{ id: "qwen3-coder-plus", name: "Qwen3 Coder Plus" },
|
||||
{ id: "qwen3-max", name: "Qwen3 Max" },
|
||||
{ id: "qwen3-vl-plus", name: "Qwen3 Vision Plus" },
|
||||
{ id: "kimi-k2-0905", name: "Kimi K2 0905" },
|
||||
{ id: "qwen3-max-preview", name: "Qwen3 Max Preview" },
|
||||
{ id: "kimi-k2", name: "Kimi K2" },
|
||||
{ id: "deepseek-v3.2", name: "DeepSeek-V3.2-Exp" },
|
||||
{ id: "deepseek-r1", name: "DeepSeek R1" },
|
||||
{ id: "deepseek-v3", name: "DeepSeek V3" },
|
||||
{ id: "qwen3-32b", name: "Qwen3 32B" },
|
||||
{ id: "qwen3-235b-a22b-thinking-2507", name: "Qwen3 235B A22B Thinking 2507" },
|
||||
{ id: "qwen3-235b-a22b-instruct", name: "Qwen3 235B A22B Instruct" },
|
||||
{ id: "qwen3-235b", name: "Qwen3 235B" },
|
||||
],
|
||||
oauth: {
|
||||
openApiBaseUrl: "https://openapi.qoder.sh",
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
// Trae (ByteDance marscode) provider registry entry.
|
||||
// Auth + exchange URLs verified from cockpit-tools/src-tauri/src/modules/trae_oauth.rs.
|
||||
// Region origins verified from trae_account.rs lines 63-66.
|
||||
// Chat endpoint path /cloudide/api/v3/trae/Chat is GUESSED (TODO verify upstream).
|
||||
export default {
|
||||
id: "trae",
|
||||
alias: "tr",
|
||||
uiAlias: "tr",
|
||||
aliases: ["marscode"],
|
||||
category: "oauth",
|
||||
authType: "oauth",
|
||||
hasOAuth: true,
|
||||
authModes: ["oauth"],
|
||||
display: {
|
||||
name: "Trae",
|
||||
icon: "bolt",
|
||||
color: "#FF6A00",
|
||||
textIcon: "TR",
|
||||
website: "https://www.trae.ai",
|
||||
notice: { signupUrl: "https://www.trae.ai" },
|
||||
},
|
||||
transport: {
|
||||
// IDE flow (cockpit-tools verified): x-cloudide-token auth, OpenAI-shaped SSE.
|
||||
baseUrl: "https://api.marscode.com/cloudide/api/v3/trae/Chat",
|
||||
format: "openai",
|
||||
headers: {
|
||||
"x-app-version": "3.5.54",
|
||||
"x-app-type": "stable",
|
||||
"x-env": "production",
|
||||
"client_id": "ono9krqynydwx5",
|
||||
"User-Agent": "Trae/1.0.0 antigravity-cockpit-tools",
|
||||
},
|
||||
// Auth: x-cloudide-token + Authorization: Bearer — injected by executor buildHeaders.
|
||||
auth: {
|
||||
combined: true,
|
||||
header: "x-cloudide-token",
|
||||
scheme: "raw",
|
||||
},
|
||||
usage: {
|
||||
url: "https://api.marscode.com/cloudide/api/v3/trae/GetUserInfo",
|
||||
},
|
||||
regions: {
|
||||
cn: "https://api.marscode.com",
|
||||
sg: "https://api.trae.ai",
|
||||
us: "https://www.trae.ai",
|
||||
},
|
||||
defaultRegion: "cn",
|
||||
},
|
||||
oauth: {
|
||||
clientId: "ono9krqynydwx5",
|
||||
clientSecret: "-",
|
||||
platform: "trae",
|
||||
pollInterval: 1500,
|
||||
// Login guidance returns LoginHost for browser open.
|
||||
loginGuidanceUrl: "https://api.marscode.com/cloudide/api/v3/trae/GetLoginGuidance",
|
||||
// ExchangeToken: refresh -> access (POST JSON, body below).
|
||||
tokenUrl: "https://api.marscode.com/cloudide/api/v3/trae/oauth/ExchangeToken",
|
||||
exchangeTokenUrl: "https://api.marscode.com/cloudide/api/v3/trae/oauth/ExchangeToken",
|
||||
refreshUrl: "https://api.marscode.com/cloudide/api/v3/trae/oauth/ExchangeToken",
|
||||
userInfoUrl: "https://api.marscode.com/cloudide/api/v3/trae/GetUserInfo",
|
||||
// Trae refresh uses custom JSON body, not OAuth form — handled by refresh.js, not config-driven.
|
||||
refresh: { encoding: "json" },
|
||||
},
|
||||
// Model catalog sourced from OmniRoute (IDE flow, core-normal.trae.ai).
|
||||
models: [
|
||||
{ id: "auto", name: "Auto (Server Picks)" },
|
||||
{ id: "work", name: "Work (Fast)" },
|
||||
{ id: "gemini-3.1-pro", name: "Gemini 3.1 Pro" },
|
||||
{ id: "gemini-3-flash-solo", name: "Gemini 3 Flash" },
|
||||
{ id: "minimax-m3", name: "MiniMax M3" },
|
||||
{ id: "minimax-m2.7", name: "MiniMax M2.7" },
|
||||
{ id: "kimi-k2.5", name: "Kimi K2.5" },
|
||||
{ id: "gpt-5.4", name: "GPT 5.4" },
|
||||
{ id: "gpt-5.2", name: "GPT 5.2" },
|
||||
],
|
||||
features: { usage: true },
|
||||
};
|
||||
@@ -0,0 +1,146 @@
|
||||
// Windsurf provider registry — Firebase+Codeium+Devin auth chain.
|
||||
// Chat transport is Codeium protobuf gRPC-Web: endpoint + schema are GUESS,
|
||||
// the cockpit-tools source only documents auth/quota (SeatManagement) paths.
|
||||
export default {
|
||||
id: "windsurf",
|
||||
alias: "ws",
|
||||
uiAlias: "ws",
|
||||
display: {
|
||||
name: "Windsurf",
|
||||
icon: "surfing",
|
||||
color: "#14B8A6",
|
||||
website: "https://windsurf.com",
|
||||
notice: { signupUrl: "https://windsurf.com" },
|
||||
},
|
||||
category: "oauth",
|
||||
authType: "oauth",
|
||||
hasOAuth: true,
|
||||
authModes: ["oauth", "apikey"],
|
||||
|
||||
// TODO(chat): Codeium ServerService protobuf schema unknown — endpoint is a guess.
|
||||
transport: {
|
||||
// GUESS: Codeium chat lives under /exa.server_pb.ServerService/GetChatMessage.
|
||||
baseUrl: "https://server.codeium.com/exa.server_pb.ServerService/GetChatMessage",
|
||||
format: "windsurf",
|
||||
headers: {
|
||||
"Content-Type": "application/proto",
|
||||
"Connect-Protocol-Version": "1",
|
||||
"ideName": "Windsurf",
|
||||
"extensionName": "codeium.windsurf",
|
||||
},
|
||||
// Bearer of apiKey (sk-ws-... / Firebase-derived / Devin session) — Connect-Protocol scheme unverified.
|
||||
auth: { combined: true, header: "Authorization" },
|
||||
},
|
||||
|
||||
// Auth chain (4 terminal paths, all yield apiKey):
|
||||
// 1) OAuth web → Firebase JWT → POST register.windsurf.com/.../RegisterUser {firebase_id_token} → {apiKey, apiServerUrl, name}
|
||||
// 2) sk-ws-... direct API key (apiKey used as metadata.apiKey on GetUserStatus)
|
||||
// 3) Firebase JWT (eyJ...) → same RegisterUser exchange as #1
|
||||
// 4) Devin auth1_... → self-serve chain → ide_token used as apiKey on server.self-serve.windsurf.com
|
||||
oauth: {
|
||||
clientId: "3GUryQ7ldAeKEuD2obYnppsnmj58eP5u",
|
||||
firebaseApiKey: "AIzaSyDsOl-1XpT5err0Tcn0TFFod1H8gVGIycY",
|
||||
firebaseSignInUrl: "https://identitytoolkit.googleapis.com/v1/accounts:signInWithPassword",
|
||||
registerUrl: "https://register.windsurf.com/exa.seat_management_pb.SeatManagementService/RegisterUser",
|
||||
apiServerUrl: "https://server.codeium.com",
|
||||
auth1ApiServerUrl: "https://server.self-serve.windsurf.com",
|
||||
platform: "windsurf",
|
||||
// Quota (Connect RPC, protobuf): POST windsurf.com/_backend/.../GetPlanStatus,
|
||||
// headers Content-Type:application/proto + Connect-Protocol-Version:1 + X-Auth-Token:<session>,
|
||||
// body = field1:session_token, field2:varint 1.
|
||||
quotaUrl: "https://windsurf.com/_backend/exa.seat_management_pb.SeatManagementService/GetPlanStatus",
|
||||
},
|
||||
|
||||
// Catalog verified against model_configs_v2.bin from Devin CLI (2026.5.x).
|
||||
// Source: OmniRoute registry (guanxiaol/WindsurfPoolAPI). Dot-notation ids; the
|
||||
// executor MODEL_ALIAS_MAP would map these to Windsurf modelUid once proto chat
|
||||
// is implemented. contextLength dropped — 9router schema uses id+name only.
|
||||
models: [
|
||||
// Cognition / SWE
|
||||
{ id: "swe-1.6-fast", name: "SWE-1.6 Fast" },
|
||||
{ id: "swe-1.6", name: "SWE-1.6" },
|
||||
{ id: "swe-1.5-fast", name: "SWE-1.5 Fast" },
|
||||
{ id: "swe-1.5", name: "SWE-1.5" },
|
||||
// Claude Opus 4.7 — effort-tiered
|
||||
{ id: "claude-opus-4.7-max", name: "Claude Opus 4.7 Max" },
|
||||
{ id: "claude-opus-4.7-xhigh", name: "Claude Opus 4.7 XHigh" },
|
||||
{ id: "claude-opus-4.7-high", name: "Claude Opus 4.7 High" },
|
||||
{ id: "claude-opus-4.7-medium", name: "Claude Opus 4.7 Medium" },
|
||||
{ id: "claude-opus-4.7-low", name: "Claude Opus 4.7 Low" },
|
||||
{ id: "claude-opus-4.7-review", name: "Claude Opus 4.7 Review" },
|
||||
// Claude Sonnet/Opus 4.6
|
||||
{ id: "claude-sonnet-4.6-thinking-1m", name: "Claude Sonnet 4.6 Thinking 1M" },
|
||||
{ id: "claude-sonnet-4.6-1m", name: "Claude Sonnet 4.6 1M" },
|
||||
{ id: "claude-sonnet-4.6-thinking", name: "Claude Sonnet 4.6 Thinking" },
|
||||
{ id: "claude-sonnet-4.6", name: "Claude Sonnet 4.6" },
|
||||
{ id: "claude-opus-4.6-thinking", name: "Claude Opus 4.6 Thinking" },
|
||||
{ id: "claude-opus-4.6", name: "Claude Opus 4.6" },
|
||||
// Claude 4.5
|
||||
{ id: "claude-opus-4.5-thinking", name: "Claude Opus 4.5 Thinking" },
|
||||
{ id: "claude-opus-4.5", name: "Claude Opus 4.5" },
|
||||
{ id: "claude-sonnet-4.5-thinking", name: "Claude Sonnet 4.5 Thinking" },
|
||||
{ id: "claude-sonnet-4.5", name: "Claude Sonnet 4.5" },
|
||||
{ id: "claude-haiku-4.5", name: "Claude Haiku 4.5" },
|
||||
// GPT-5.5 — effort-tiered
|
||||
{ id: "gpt-5.5-xhigh-fast", name: "GPT-5.5 XHigh Fast" },
|
||||
{ id: "gpt-5.5-xhigh", name: "GPT-5.5 XHigh" },
|
||||
{ id: "gpt-5.5-high-fast", name: "GPT-5.5 High Fast" },
|
||||
{ id: "gpt-5.5-high", name: "GPT-5.5 High" },
|
||||
{ id: "gpt-5.5-medium-fast", name: "GPT-5.5 Medium Fast" },
|
||||
{ id: "gpt-5.5-medium", name: "GPT-5.5 Medium" },
|
||||
{ id: "gpt-5.5-low-fast", name: "GPT-5.5 Low Fast" },
|
||||
{ id: "gpt-5.5-low", name: "GPT-5.5 Low" },
|
||||
{ id: "gpt-5.5-none-fast", name: "GPT-5.5 None Fast" },
|
||||
{ id: "gpt-5.5-none", name: "GPT-5.5 None" },
|
||||
// GPT-5.4 — effort-tiered
|
||||
{ id: "gpt-5.4-xhigh-fast", name: "GPT-5.4 XHigh Fast" },
|
||||
{ id: "gpt-5.4-xhigh", name: "GPT-5.4 XHigh" },
|
||||
{ id: "gpt-5.4-high-fast", name: "GPT-5.4 High Fast" },
|
||||
{ id: "gpt-5.4-high", name: "GPT-5.4 High" },
|
||||
{ id: "gpt-5.4-medium-fast", name: "GPT-5.4 Medium Fast" },
|
||||
{ id: "gpt-5.4-medium", name: "GPT-5.4 Medium" },
|
||||
{ id: "gpt-5.4-low-fast", name: "GPT-5.4 Low Fast" },
|
||||
{ id: "gpt-5.4-low", name: "GPT-5.4 Low" },
|
||||
{ id: "gpt-5.4-none-fast", name: "GPT-5.4 None Fast" },
|
||||
{ id: "gpt-5.4-none", name: "GPT-5.4 None" },
|
||||
{ id: "gpt-5.4-mini-xhigh", name: "GPT-5.4 Mini XHigh" },
|
||||
{ id: "gpt-5.4-mini-high", name: "GPT-5.4 Mini High" },
|
||||
{ id: "gpt-5.4-mini-medium", name: "GPT-5.4 Mini Medium" },
|
||||
{ id: "gpt-5.4-mini-low", name: "GPT-5.4 Mini Low" },
|
||||
// GPT-5.3 Codex
|
||||
{ id: "gpt-5.3-codex-xhigh-fast", name: "GPT-5.3 Codex XHigh Fast" },
|
||||
{ id: "gpt-5.3-codex-xhigh", name: "GPT-5.3 Codex XHigh" },
|
||||
{ id: "gpt-5.3-codex-high-fast", name: "GPT-5.3 Codex High Fast" },
|
||||
{ id: "gpt-5.3-codex-high", name: "GPT-5.3 Codex High" },
|
||||
{ id: "gpt-5.3-codex-medium-fast", name: "GPT-5.3 Codex Medium Fast" },
|
||||
{ id: "gpt-5.3-codex-medium", name: "GPT-5.3 Codex Medium" },
|
||||
{ id: "gpt-5.3-codex-low-fast", name: "GPT-5.3 Codex Low Fast" },
|
||||
{ id: "gpt-5.3-codex-low", name: "GPT-5.3 Codex Low" },
|
||||
// GPT-5.2 / 5
|
||||
{ id: "gpt-5.2-xhigh", name: "GPT-5.2 XHigh" },
|
||||
{ id: "gpt-5.2-high", name: "GPT-5.2 High" },
|
||||
{ id: "gpt-5.2-medium", name: "GPT-5.2 Medium" },
|
||||
{ id: "gpt-5.2-low", name: "GPT-5.2 Low" },
|
||||
{ id: "gpt-5.2-none", name: "GPT-5.2 None" },
|
||||
{ id: "gpt-5", name: "GPT-5" },
|
||||
// GPT-4.1 / 4o
|
||||
{ id: "gpt-4.1", name: "GPT-4.1" },
|
||||
{ id: "gpt-4.1-mini", name: "GPT-4.1 Mini" },
|
||||
{ id: "gpt-4.1-nano", name: "GPT-4.1 Nano" },
|
||||
{ id: "gpt-4o", name: "GPT-4o" },
|
||||
{ id: "gpt-4o-mini", name: "GPT-4o Mini" },
|
||||
// Gemini
|
||||
{ id: "gemini-3.1-pro-high", name: "Gemini 3.1 Pro High" },
|
||||
{ id: "gemini-3.1-pro-low", name: "Gemini 3.1 Pro Low" },
|
||||
{ id: "gemini-3.0-flash-high", name: "Gemini 3 Flash High" },
|
||||
{ id: "gemini-3.0-flash-medium", name: "Gemini 3 Flash Medium" },
|
||||
{ id: "gemini-3.0-flash-low", name: "Gemini 3 Flash Low" },
|
||||
{ id: "gemini-3.0-flash-minimal", name: "Gemini 3 Flash Minimal" },
|
||||
{ id: "gemini-2.5-pro", name: "Gemini 2.5 Pro" },
|
||||
// Others
|
||||
{ id: "deepseek-v4", name: "DeepSeek V4" },
|
||||
{ id: "kimi-k2.6", name: "Kimi K2.6" },
|
||||
{ id: "kimi-k2.5", name: "Kimi K2.5" },
|
||||
{ id: "glm-5.1", name: "GLM-5.1" },
|
||||
],
|
||||
};
|
||||
@@ -0,0 +1,73 @@
|
||||
export default {
|
||||
id: "workbuddy",
|
||||
// Short model prefix (wb/glm-5.2). WorkBuddy is a B2B/enterprise skin of
|
||||
// CodeBuddy CN (same codebuddy.cn backend), so models mirror codebuddy-cn.
|
||||
alias: "wb",
|
||||
uiAlias: "wb",
|
||||
hidden: false,
|
||||
priority: 90,
|
||||
display: {
|
||||
name: "WorkBuddy",
|
||||
icon: "smart_toy",
|
||||
color: "#006EFF",
|
||||
website: "https://www.codebuddy.cn",
|
||||
notice: {
|
||||
signupUrl: "https://www.codebuddy.cn",
|
||||
},
|
||||
},
|
||||
category: "oauth",
|
||||
authModes: ["oauth", "apikey"],
|
||||
hasOAuth: true,
|
||||
transport: {
|
||||
// Same OpenAI-compatible gateway as codebuddy-cn; platform=workbuddy is
|
||||
// distinguished at the OAuth layer, not the chat endpoint.
|
||||
baseUrl: "https://www.codebuddy.cn/v2/chat/completions",
|
||||
forceStream: true,
|
||||
thinkingFormat: "openai",
|
||||
headers: {
|
||||
"User-Agent": "CLI/2.108.1 CodeBuddy/2.108.1",
|
||||
"X-Product": "SaaS",
|
||||
"X-IDE-Type": "CLI",
|
||||
"X-IDE-Name": "CLI",
|
||||
"x-requested-with": "XMLHttpRequest",
|
||||
"x-codebuddy-request": "1",
|
||||
},
|
||||
auth: {
|
||||
combined: true,
|
||||
header: "Authorization",
|
||||
scheme: "bearer",
|
||||
},
|
||||
},
|
||||
models: [
|
||||
{ id: "glm-5.2", name: "GLM-5.2" },
|
||||
{ id: "glm-5.1", name: "GLM-5.1" },
|
||||
{ id: "glm-5.0", name: "GLM-5.0" },
|
||||
{ id: "glm-5.0-turbo", name: "GLM-5.0-Turbo" },
|
||||
{ id: "glm-5v-turbo", name: "GLM-5v-Turbo" },
|
||||
{ id: "glm-4.7", name: "GLM-4.7" },
|
||||
{ id: "minimax-m3", name: "MiniMax-M3" },
|
||||
{ id: "minimax-m2.7", name: "MiniMax-M2.7" },
|
||||
{ id: "kimi-k2.7", name: "Kimi-K2.7-Code" },
|
||||
{ id: "kimi-k2.6", name: "Kimi-K2.6" },
|
||||
{ id: "kimi-k2.5", name: "Kimi-K2.5" },
|
||||
{ id: "hy3-preview", name: "Hy3 Preview" },
|
||||
{ id: "deepseek-v4-pro", name: "DeepSeek-V4-Pro" },
|
||||
{ id: "deepseek-v4-flash", name: "DeepSeek-V4-Flash" },
|
||||
{ id: "deepseek-v3-2-volc", name: "DeepSeek-V3.2" },
|
||||
],
|
||||
oauth: {
|
||||
// Same codebuddy.cn host as codebuddy-cn; only platform param differs
|
||||
// (workbuddy vs CLI). Prefix /v2/plugin matches cockpit-tools Rust.
|
||||
baseUrl: "https://www.codebuddy.cn",
|
||||
stateUrl: "https://www.codebuddy.cn/v2/plugin/auth/state",
|
||||
tokenUrl: "https://www.codebuddy.cn/v2/plugin/auth/token",
|
||||
refreshUrl: "https://www.codebuddy.cn/v2/plugin/auth/token/refresh",
|
||||
userAgent: "CLI/2.63.2 CodeBuddy/2.63.2",
|
||||
platform: "workbuddy",
|
||||
pollInterval: 5000,
|
||||
},
|
||||
features: {
|
||||
usage: true,
|
||||
usageApikey: true,
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,72 @@
|
||||
// Zed provider — RSA keypair callback auth (NOT standard OAuth).
|
||||
// Source of truth: .repo/cockpit-tools/src-tauri/src/modules/zed_oauth.rs + zed_account.rs.
|
||||
export default {
|
||||
id: "zed",
|
||||
priority: 10,
|
||||
alias: "zd",
|
||||
uiAlias: "zd",
|
||||
display: {
|
||||
name: "Zed",
|
||||
icon: "code",
|
||||
color: "#A855F7",
|
||||
website: "https://zed.dev",
|
||||
notice: {
|
||||
signupUrl: "https://zed.dev/native_app_signin",
|
||||
},
|
||||
},
|
||||
category: "oauth",
|
||||
authType: "oauth",
|
||||
hasOAuth: true,
|
||||
|
||||
transport: {
|
||||
// Zed hosted LLM aggregator (OmniRoute-verified): cloud.zed.dev/completions is a
|
||||
// multi-format proxy fronting Anthropic/OpenAI/Google/xAI depending on the model.
|
||||
// Wire protocol = NDJSON/SSE-ish stream authenticated with a short-lived LLM bearer
|
||||
// token exchanged from the RSA-decrypted access_token (see open-sse/shared/zedAuth
|
||||
// in OmniRoute). cockpit-tools only covered the RSA login + cloud.zed.dev quota path.
|
||||
baseUrl: "https://cloud.zed.dev/completions",
|
||||
format: "openai",
|
||||
forceStream: true,
|
||||
headers: {
|
||||
"content-type": "application/json",
|
||||
},
|
||||
// Auth scheme is non-standard: "Authorization: <user_id> <access_token>" plus a duplicate
|
||||
// x-zed-cloud-token header (verified in zed_account.rs build_authorization_header +
|
||||
// cloud fetch). Executor builds both; scheme here is a marker for config-driven tooling.
|
||||
auth: {
|
||||
combined: true,
|
||||
header: "Authorization",
|
||||
scheme: "<user_id> <access_token>", // placeholder — real value built in executor
|
||||
},
|
||||
usage: {
|
||||
url: "https://cloud.zed.dev/client/users/me", // verified in zed_account.rs
|
||||
},
|
||||
// Live catalog discovery — Zed's hosted model list changes frequently and is fetched
|
||||
// per-connection rather than hardcoded (OmniRoute pattern).
|
||||
modelsUrl: "https://cloud.zed.dev/models",
|
||||
},
|
||||
|
||||
// Empty static catalog + passthrough: Zed fronts a rotating set of upstream models
|
||||
// (Claude/GPT/Gemini/Grok). Resolved live via modelsUrl; any client-sent model id is
|
||||
// forwarded as-is rather than validated against a frozen list.
|
||||
models: [],
|
||||
passthroughModels: true,
|
||||
|
||||
oauth: {
|
||||
// Zed auth flow is RSA-based, NOT OAuth2/PKCE:
|
||||
// 1. App generates RSA-2048 keypair locally (PKCS#1 DER, URL-safe base64).
|
||||
// 2. Bind random TCP port on 127.0.0.1.
|
||||
// 3. Open https://zed.dev/native_app_signin?native_app_port={port}&native_app_public_key={pub}.
|
||||
// 4. After login, browser redirects http://127.0.0.1:{port}/?user_id=...&access_token=...
|
||||
// where access_token = base64(RSA-encrypted plaintext token).
|
||||
// 5. Decrypt with private key (OAEP-SHA256, fallback PKCS1v15). Store user_id + plaintext token.
|
||||
// No clientId/clientSecret/tokenUrl/refreshUrl — long-lived access_token, no refresh.
|
||||
authorizeUrl: "https://zed.dev/native_app_signin",
|
||||
platform: "zed",
|
||||
rsaKeyExchange: true, // new flag: signals frontend/router this flow needs local RSA + TCP listener.
|
||||
},
|
||||
|
||||
features: {
|
||||
usage: true,
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user