Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions apps/desktop-tauri/src/components/providers/providerIcons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import perplexity from "./icons/ProviderIcon-perplexity.svg?raw";
import qoder from "./icons/ProviderIcon-qoder.svg?raw";
import sakana from "./icons/ProviderIcon-sakana.svg?raw";
import stepfun from "./icons/ProviderIcon-stepfun.svg?raw";
import sub2api from "./icons/ProviderIcon-sub2api.svg?raw";
import t3chat from "./icons/ProviderIcon-t3chat.svg?raw";
import venice from "./icons/ProviderIcon-venice.svg?raw";
import vertexai from "./icons/ProviderIcon-vertexai.svg?raw";
Expand Down Expand Up @@ -112,6 +113,7 @@ const RAW: Record<string, string> = {
qoder: tint(qoder),
sakana: tint(sakana),
stepfun: tint(stepfun),
sub2api: tint(sub2api),
t3chat: tint(t3chat),
venice: tint(venice),
vertexai: tint(vertexai),
Expand Down Expand Up @@ -177,6 +179,7 @@ export const PROVIDER_ICON_REGISTRY: Record<string, ProviderIcon> = {
qoder: { id: "qoder", brandColor: "#2563eb", fallbackLetter: "Q", svgPath: RAW.qoder },
sakana: { id: "sakana", brandColor: "#0ea5e9", fallbackLetter: "S", svgPath: RAW.sakana },
stepfun: { id: "stepfun", brandColor: "#999999", fallbackLetter: "S", svgPath: RAW.stepfun },
sub2api: { id: "sub2api", brandColor: "#2dc6d8", fallbackLetter: "S", svgPath: RAW.sub2api },
venice: { id: "venice", brandColor: "#111827", fallbackLetter: "V", svgPath: RAW.venice },
openaiapi: { id: "openaiapi", brandColor: "#10a37f", fallbackLetter: "O" },
chutes: { id: "chutes", brandColor: "#ff5c35", fallbackLetter: "C" },
Expand Down Expand Up @@ -219,6 +222,8 @@ const ALIASES: Record<string, string> = {
"sakana-ai": "sakana",
"step fun": "stepfun",
"step-fun": "stepfun",
"sub-2-api": "sub2api",
"sub 2 api": "sub2api",
"openai api": "openaiapi",
"openai-api": "openaiapi",
"azure openai": "azureopenai",
Expand Down
4 changes: 4 additions & 0 deletions apps/desktop-tauri/src/i18n/keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,10 @@ export const ALL_LOCALE_KEYS = [
"ZedApiUrlLabel",
"ZedApiUrlPlaceholder",
"ZedApiUrlHelp",
"Sub2ApiTitle",
"Sub2ApiBaseUrlLabel",
"Sub2ApiBaseUrlPlaceholder",
"Sub2ApiBaseUrlHelp",

// Tray icon visibility (Windows 11 hidden-icons overflow)
"PromoteTrayIconLabel",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@ function CredentialsDispatcher({
case "devin":
case "opencodego":
case "zed":
case "sub2api":
return <OpenAiExtras providerId={providerId} t={t} />;
default:
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,13 @@ export function OpenAiExtras({ providerId = "codex", t }: Props) {
placeholder: t("ZedApiUrlPlaceholder"),
help: t("ZedApiUrlHelp"),
};
case "sub2api":
return {
title: t("Sub2ApiTitle"),
label: t("Sub2ApiBaseUrlLabel"),
placeholder: t("Sub2ApiBaseUrlPlaceholder"),
help: t("Sub2ApiBaseUrlHelp"),
};
default:
return null;
}
Expand Down
1 change: 1 addition & 0 deletions apps/desktop-tauri/src/test/providerCatalog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,5 @@ export const TEST_PROVIDER_CATALOG: Array<[string, string]> = [
["crossmodel", "CrossModel"],
["qoder", "Qoder"],
["sakana", "Sakana AI"],
["sub2api", "sub2api"],
];
1 change: 1 addition & 0 deletions apps/desktop-tauri/src/types/bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ export type ProofProviderId =
| "crossmodel"
| "qoder"
| "sakana"
| "sub2api"
| "wayfinder";

export type TrayPanelSurfaceTarget = { kind: "summary" };
Expand Down
4 changes: 4 additions & 0 deletions rust/assets/icons/ProviderIcon-sub2api.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 9 additions & 1 deletion rust/src/core/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ pub enum ProviderId {
CrossModel,
Qoder,
Sakana,
Sub2Api,
Wayfinder,
}

Expand Down Expand Up @@ -130,6 +131,7 @@ impl ProviderId {
ProviderId::CrossModel,
ProviderId::Qoder,
ProviderId::Sakana,
ProviderId::Sub2Api,
ProviderId::Wayfinder,
]
}
Expand Down Expand Up @@ -193,6 +195,7 @@ impl ProviderId {
ProviderId::CrossModel => "crossmodel",
ProviderId::Qoder => "qoder",
ProviderId::Sakana => "sakana",
ProviderId::Sub2Api => "sub2api",
ProviderId::Wayfinder => "wayfinder",
}
}
Expand Down Expand Up @@ -256,6 +259,7 @@ impl ProviderId {
ProviderId::CrossModel => "CrossModel",
ProviderId::Qoder => "Qoder",
ProviderId::Sakana => "Sakana AI",
ProviderId::Sub2Api => "sub2api",
ProviderId::Wayfinder => "Wayfinder",
}
}
Expand Down Expand Up @@ -324,6 +328,7 @@ impl ProviderId {
ProviderId::Devin => None,
ProviderId::Zed => None,
ProviderId::CrossModel => None,
ProviderId::Sub2Api => None,
ProviderId::Wayfinder => None,
}
}
Expand Down Expand Up @@ -394,6 +399,7 @@ impl ProviderId {
"crossmodel" | "cross-model" | "cross model" => Some(ProviderId::CrossModel),
"qoder" => Some(ProviderId::Qoder),
"sakana" | "sakana-ai" | "sakana ai" => Some(ProviderId::Sakana),
"sub2api" | "sub-2-api" | "sub 2 api" => Some(ProviderId::Sub2Api),
"wayfinder" => Some(ProviderId::Wayfinder),
_ => None,
}
Expand Down Expand Up @@ -617,6 +623,7 @@ pub fn cli_name_map() -> HashMap<&'static str, ProviderId> {
map.insert("llm-proxy", ProviderId::LLMProxy);
map.insert("cross-model", ProviderId::CrossModel);
map.insert("sakana-ai", ProviderId::Sakana);
map.insert("sub-2-api", ProviderId::Sub2Api);
map
}

Expand All @@ -627,7 +634,7 @@ mod tests {
#[test]
fn test_provider_id_all() {
let all = ProviderId::all();
assert_eq!(all.len(), 57);
assert_eq!(all.len(), 58);
assert!(all.contains(&ProviderId::Claude));
assert!(all.contains(&ProviderId::Codex));
assert!(all.contains(&ProviderId::Kimi));
Expand Down Expand Up @@ -664,6 +671,7 @@ mod tests {
assert!(all.contains(&ProviderId::CrossModel));
assert!(all.contains(&ProviderId::Qoder));
assert!(all.contains(&ProviderId::Sakana));
assert!(all.contains(&ProviderId::Sub2Api));
assert!(all.contains(&ProviderId::Wayfinder));
}

Expand Down
5 changes: 3 additions & 2 deletions rust/src/core/provider_factory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ use crate::providers::{
KiroProvider, LLMProxyProvider, LiteLLMProvider, ManusProvider, MiMoProvider, MiniMaxProvider,
MistralProvider, NanoGPTProvider, OllamaProvider, OpenAIApiProvider, OpenCodeGoProvider,
OpenCodeProvider, OpenRouterProvider, PerplexityProvider, PoeProvider, QoderProvider,
SakanaProvider, StepFunProvider, T3ChatProvider, VeniceProvider, VertexAIProvider,
WarpProvider, WayfinderProvider, WindsurfProvider, ZaiProvider, ZedProvider,
SakanaProvider, StepFunProvider, Sub2ApiProvider, T3ChatProvider, VeniceProvider,
VertexAIProvider, WarpProvider, WayfinderProvider, WindsurfProvider, ZaiProvider, ZedProvider,
};

/// Instantiate the concrete [`Provider`] implementation for a given [`ProviderId`].
Expand Down Expand Up @@ -82,6 +82,7 @@ pub fn instantiate(id: ProviderId) -> Box<dyn Provider> {
ProviderId::CrossModel => Box::new(CrossModelProvider::new()),
ProviderId::Qoder => Box::new(QoderProvider::new()),
ProviderId::Sakana => Box::new(SakanaProvider::new()),
ProviderId::Sub2Api => Box::new(Sub2ApiProvider::new()),
ProviderId::Wayfinder => Box::new(WayfinderProvider::new()),
}
}
Expand Down
10 changes: 10 additions & 0 deletions rust/src/core/token_accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,16 @@ impl TokenAccountSupport {
requires_manual_cookie_source: true,
cookie_name: None,
}),
ProviderId::Sub2Api => Some(TokenAccountSupport {
title: "Group API keys",
subtitle: "Store multiple sub2api group API keys with labels such as Claude, Codex, or Gemini.",
placeholder: "sk-...",
injection: TokenInjection::Environment {
key: "SUB2API_API_KEY".to_string(),
},
requires_manual_cookie_source: false,
cookie_name: None,
}),
ProviderId::Copilot => Some(TokenAccountSupport {
title: "GitHub accounts",
subtitle: "Store GitHub OAuth tokens for Copilot plan usage.",
Expand Down
4 changes: 4 additions & 0 deletions rust/src/locale.rs
Original file line number Diff line number Diff line change
Expand Up @@ -945,6 +945,10 @@ locale_keys! {
ZedApiUrlLabel,
ZedApiUrlPlaceholder,
ZedApiUrlHelp,
Sub2ApiTitle,
Sub2ApiBaseUrlLabel,
Sub2ApiBaseUrlPlaceholder,
Sub2ApiBaseUrlHelp,

// Tray icon visibility (Windows 11 hidden-icons overflow)
PromoteTrayIconLabel,
Expand Down
4 changes: 4 additions & 0 deletions rust/src/locale/en-US.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,10 @@ ZedApiTitle = Zed API
ZedApiUrlLabel = API URL
ZedApiUrlPlaceholder = https://cloud.zed.dev/client/users/me
ZedApiUrlHelp = Optional. Leave blank for the default Zed Cloud API URL.
Sub2ApiTitle = sub2api
Sub2ApiBaseUrlLabel = Base URL
Sub2ApiBaseUrlPlaceholder = https://sub2api.example.com
Sub2ApiBaseUrlHelp = Deployment URL for GET /v1/usage. Use HTTPS, or loopback HTTP (127.0.0.1 / localhost) for local development.
PromoteTrayIconLabel = Pin to Taskbar (Windows 11)
PromoteTrayIconHelper = Always show the CodexBar icon on the taskbar instead of inside the overflow chevron
PromoteTrayIconUnsupportedHint = Not available on this operating system. Drag the icon out of the ^ overflow area in Windows Settings > Taskbar to pin it manually.
4 changes: 4 additions & 0 deletions rust/src/locale/ja-JP.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,10 @@ TokenAccountTokenPlaceholder = トークンを貼り付け…
WaitingForUsage = 使用量データを待機中
ZedApiTitle = Zed API
ZedApiUrlHelp = 任意。既定の Zed Cloud API URL を使用する場合は空欄にします。
Sub2ApiTitle = sub2api
Sub2ApiBaseUrlLabel = Base URL
Sub2ApiBaseUrlPlaceholder = https://sub2api.example.com
Sub2ApiBaseUrlHelp = Deployment URL for GET /v1/usage. Use HTTPS, or loopback HTTP for local development.
ZedApiUrlLabel = API URL
ZedApiUrlPlaceholder = https://cloud.zed.dev/client/users/me
PromoteTrayIconLabel = タスクバーにピン留め (Windows 11)
Expand Down
4 changes: 4 additions & 0 deletions rust/src/locale/zh-CN.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,10 @@ ZedApiTitle = Zed API
ZedApiUrlLabel = API URL
ZedApiUrlPlaceholder = https://cloud.zed.dev/client/users/me
ZedApiUrlHelp = 可选。留空则使用默认的 Zed Cloud API URL。
Sub2ApiTitle = sub2api
Sub2ApiBaseUrlLabel = Base URL
Sub2ApiBaseUrlPlaceholder = https://sub2api.example.com
Sub2ApiBaseUrlHelp = Deployment URL for GET /v1/usage. Use HTTPS, or loopback HTTP for local development.
PromoteTrayIconLabel = 固定到任务栏(Windows 11)
PromoteTrayIconHelper = 始终将 CodexBar 图标显示在任务栏上,而不是隐藏在溢出区域中
PromoteTrayIconUnsupportedHint = 此操作系统不支持该功能。请在 Windows 设置 > 任务栏 中将图标从 ^ 溢出区域手动拖出固定。
4 changes: 4 additions & 0 deletions rust/src/locale/zh-TW.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,10 @@ ZedApiTitle = Zed API
ZedApiUrlLabel = API URL
ZedApiUrlPlaceholder = https://cloud.zed.dev/client/users/me
ZedApiUrlHelp = 選用。留空則使用預設的 Zed Cloud API URL。
Sub2ApiTitle = sub2api
Sub2ApiBaseUrlLabel = Base URL
Sub2ApiBaseUrlPlaceholder = https://sub2api.example.com
Sub2ApiBaseUrlHelp = Deployment URL for GET /v1/usage. Use HTTPS, or loopback HTTP for local development.
PromoteTrayIconLabel = 釘選到工作列(Windows 11)
PromoteTrayIconHelper = 一律在工作列顯示 CodexBar 圖示,而非隱藏於溢位區域
PromoteTrayIconUnsupportedHint = 此作業系統不支援此功能。請在 Windows 設定 > 工作列中,從 ^ 溢位區域手動拖出圖示以釘選。
2 changes: 2 additions & 0 deletions rust/src/providers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ pub mod poe;
pub mod qoder;
pub mod sakana;
pub mod stepfun;
pub mod sub2api;
pub mod t3chat;
pub mod venice;
pub mod vertexai;
Expand Down Expand Up @@ -111,6 +112,7 @@ pub use poe::PoeProvider;
pub use qoder::QoderProvider;
pub use sakana::SakanaProvider;
pub use stepfun::StepFunProvider;
pub use sub2api::Sub2ApiProvider;
pub use t3chat::T3ChatProvider;
pub use venice::VeniceProvider;
pub use vertexai::VertexAIProvider;
Expand Down
Loading
Loading