+
Tiny macOS 14+ menu bar app that keeps **AI coding-provider limits visible** and shows when each window resets. Codex, OpenAI, Claude, Cursor, Gemini, Copilot, Grok, GroqCloud, ElevenLabs, Deepgram, z.ai, MiniMax, Kiro, Zed, Vertex AI, Augment, OpenRouter, LiteLLM, LLM Proxy, Codebuff, Command Code, ClinePass, AWS Bedrock, and many newer coding providers. One status item per provider, or Merge Icons mode with a provider switcher. No Dock icon, minimal UI, dynamic bar icons.
@@ -85,6 +85,7 @@ See [CLI configuration](docs/cli-configuration.md) for the full flow.
- [OpenCode Go](docs/opencode.md) — Browser or local SQLite data for Go usage windows.
- [Alibaba Coding Plan](docs/alibaba-coding-plan.md) — Web cookies or API key for coding-plan quotas.
- [Alibaba Token Plan](docs/alibaba-token-plan.md) — Bailian browser/manual cookies for token-plan credits.
+- [Qwen Cloud](docs/qwen-cloud.md) — 5-hour and weekly individual Token Plan usage via browser/manual cookies.
- [Gemini](docs/gemini.md) — OAuth-backed quota API using Gemini CLI credentials (no browser cookies).
- [Antigravity](docs/antigravity.md) — Local language server probe (experimental); no external auth.
- [Droid](docs/factory.md) — Browser cookies + WorkOS token flows for Factory usage + billing.
diff --git a/Sources/CodexBar/PreferencesProvidersPane.swift b/Sources/CodexBar/PreferencesProvidersPane.swift
index f1503ea771..8f20103e6c 100644
--- a/Sources/CodexBar/PreferencesProvidersPane.swift
+++ b/Sources/CodexBar/PreferencesProvidersPane.swift
@@ -2,6 +2,17 @@ import AppKit
import CodexBarCore
import SwiftUI
+@MainActor
+enum ProviderSettingsRefreshInteraction {
+ static func perform(operation: () async -> Void) async {
+ await BrowserCookieAccessGate.withExplicitRetry {
+ await ProviderInteractionContext.$current.withValue(.userInitiated) {
+ await operation()
+ }
+ }
+ }
+}
+
@MainActor
struct ProvidersPane: View {
let provider: UsageProvider
@@ -139,7 +150,7 @@ struct ProvidersPane: View {
private func triggerRefresh(for provider: UsageProvider) {
Task { @MainActor in
- await ProviderInteractionContext.$current.withValue(.userInitiated) {
+ await ProviderSettingsRefreshInteraction.perform {
if provider == .codex {
await self.store.refreshCodexAccountScopedState(allowDisabled: true)
} else {
diff --git a/Sources/CodexBar/Providers/QwenCloud/QwenCloudProviderImplementation.swift b/Sources/CodexBar/Providers/QwenCloud/QwenCloudProviderImplementation.swift
new file mode 100644
index 0000000000..213eb6bf3c
--- /dev/null
+++ b/Sources/CodexBar/Providers/QwenCloud/QwenCloudProviderImplementation.swift
@@ -0,0 +1,91 @@
+import AppKit
+import CodexBarCore
+import Foundation
+import SwiftUI
+
+struct QwenCloudProviderImplementation: ProviderImplementation {
+ let id: UsageProvider = .qwencloud
+
+ @MainActor
+ func presentation(context _: ProviderPresentationContext) -> ProviderPresentation {
+ ProviderPresentation { context in
+ context.store.sourceLabel(for: context.provider)
+ }
+ }
+
+ @MainActor
+ func observeSettings(_ settings: SettingsStore) {
+ _ = settings.qwenCloudCookieSource
+ _ = settings.qwenCloudCookieHeader
+ }
+
+ @MainActor
+ func settingsSnapshot(context: ProviderSettingsSnapshotContext) -> ProviderSettingsSnapshotContribution? {
+ _ = context
+ return .qwenCloud(context.settings.qwenCloudSettingsSnapshot())
+ }
+
+ @MainActor
+ func settingsPickers(context: ProviderSettingsContext) -> [ProviderSettingsPickerDescriptor] {
+ let cookieBinding = Binding(
+ get: { context.settings.qwenCloudCookieSource.rawValue },
+ set: { raw in
+ context.settings.qwenCloudCookieSource = ProviderCookieSource(rawValue: raw) ?? .auto
+ })
+ let cookieOptions = ProviderCookieSourceUI.options(
+ allowsOff: false,
+ keychainDisabled: context.settings.debugDisableKeychainAccess)
+ let cookieSubtitle: () -> String? = {
+ ProviderCookieSourceUI.subtitle(
+ source: context.settings.qwenCloudCookieSource,
+ keychainDisabled: context.settings.debugDisableKeychainAccess,
+ auto: "Automatic imports browser cookies from Qwen Cloud.",
+ manual: "Paste a Cookie header from home.qwencloud.com.",
+ off: "Qwen Cloud cookies are disabled.")
+ }
+
+ return [
+ ProviderSettingsPickerDescriptor(
+ id: "qwen-cloud-cookie-source",
+ title: "Cookie source",
+ subtitle: "Automatic imports browser cookies from Qwen Cloud.",
+ dynamicSubtitle: cookieSubtitle,
+ binding: cookieBinding,
+ options: cookieOptions,
+ isVisible: nil,
+ onChange: nil,
+ trailingText: {
+ guard let entry = CookieHeaderCache.loadForDisplay(provider: .qwencloud) else { return nil }
+ let when = entry.storedAt.relativeDescription()
+ return "Cached: \(entry.sourceLabel) • \(when)"
+ }),
+ ]
+ }
+
+ @MainActor
+ func settingsFields(context: ProviderSettingsContext) -> [ProviderSettingsFieldDescriptor] {
+ [
+ ProviderSettingsFieldDescriptor(
+ id: "qwen-cloud-cookie",
+ title: "Cookie header",
+ subtitle: "",
+ kind: .secure,
+ placeholder: "Cookie: ...",
+ binding: context.stringBinding(\.qwenCloudCookieHeader),
+ actions: [
+ ProviderSettingsActionDescriptor(
+ id: "qwen-cloud-open-dashboard",
+ title: "Open Token Plan",
+ style: .link,
+ isVisible: nil,
+ perform: {
+ NSWorkspace.shared.open(QwenCloudUsageFetcher.dashboardURL)
+ }),
+ ],
+ isVisible: {
+ context.settings.qwenCloudCookieSource == .manual
+ },
+ onActivate: nil),
+ ]
+ }
+}
diff --git a/Sources/CodexBar/Providers/QwenCloud/QwenCloudSettingsStore.swift b/Sources/CodexBar/Providers/QwenCloud/QwenCloudSettingsStore.swift
new file mode 100644
index 0000000000..ddd79395be
--- /dev/null
+++ b/Sources/CodexBar/Providers/QwenCloud/QwenCloudSettingsStore.swift
@@ -0,0 +1,30 @@
+import CodexBarCore
+import Foundation
+
+extension SettingsStore {
+ var qwenCloudCookieHeader: String {
+ get { self.configSnapshot.providerConfig(for: .qwencloud)?.sanitizedCookieHeader ?? "" }
+ set {
+ self.updateProviderConfig(provider: .qwencloud) { entry in
+ entry.cookieHeader = self.normalizedConfigValue(newValue)
+ }
+ self.logSecretUpdate(provider: .qwencloud, field: "cookieHeader", value: newValue)
+ }
+ }
+
+ var qwenCloudCookieSource: ProviderCookieSource {
+ get { self.resolvedCookieSource(provider: .qwencloud, fallback: .auto) }
+ set {
+ self.updateProviderConfig(provider: .qwencloud) { entry in
+ entry.cookieSource = newValue
+ }
+ self.logProviderModeChange(provider: .qwencloud, field: "cookieSource", value: newValue.rawValue)
+ }
+ }
+
+ func qwenCloudSettingsSnapshot() -> ProviderSettingsSnapshot.QwenCloudProviderSettings {
+ ProviderSettingsSnapshot.QwenCloudProviderSettings(
+ cookieSource: self.qwenCloudCookieSource,
+ manualCookieHeader: self.qwenCloudCookieHeader)
+ }
+}
diff --git a/Sources/CodexBar/Providers/Shared/ProviderImplementationRegistry.swift b/Sources/CodexBar/Providers/Shared/ProviderImplementationRegistry.swift
index 0c13716e7f..2933d7795c 100644
--- a/Sources/CodexBar/Providers/Shared/ProviderImplementationRegistry.swift
+++ b/Sources/CodexBar/Providers/Shared/ProviderImplementationRegistry.swift
@@ -23,6 +23,7 @@ enum ProviderImplementationRegistry {
case .opencodego: OpenCodeGoProviderImplementation()
case .alibaba: AlibabaCodingPlanProviderImplementation()
case .alibabatokenplan: AlibabaTokenPlanProviderImplementation()
+ case .qwencloud: QwenCloudProviderImplementation()
case .factory: FactoryProviderImplementation()
case .gemini: GeminiProviderImplementation()
case .antigravity: AntigravityProviderImplementation()
diff --git a/Sources/CodexBar/Resources/ProviderIcon-qwencloud.svg b/Sources/CodexBar/Resources/ProviderIcon-qwencloud.svg
new file mode 100644
index 0000000000..2e8609e5de
--- /dev/null
+++ b/Sources/CodexBar/Resources/ProviderIcon-qwencloud.svg
@@ -0,0 +1,4 @@
+
diff --git a/Sources/CodexBar/UsageStore.swift b/Sources/CodexBar/UsageStore.swift
index 30be9d30d7..7df515afe8 100644
--- a/Sources/CodexBar/UsageStore.swift
+++ b/Sources/CodexBar/UsageStore.swift
@@ -969,6 +969,7 @@ extension UsageStore {
.opencode: "OpenCode debug log not yet implemented",
.alibaba: "Alibaba Coding Plan debug log not yet implemented",
.alibabatokenplan: "Alibaba Token Plan debug log not yet implemented",
+ .qwencloud: "Qwen Cloud debug log not yet implemented",
.factory: "Droid debug log not yet implemented",
.copilot: "Copilot debug log not yet implemented",
.manus: "Manus debug log not yet implemented",
@@ -1072,7 +1073,7 @@ extension UsageStore {
configToken: nil,
hasEnvToken: deepSeekHasEnvToken,
hasTokenAccount: deepSeekHasTokenAccount)
- case .clinepass, .gemini, .antigravity, .opencode, .opencodego, .alibabatokenplan, .factory,
+ case .clinepass, .gemini, .antigravity, .opencode, .opencodego, .alibabatokenplan, .qwencloud, .factory,
.copilot, .devin, .vertexai, .kilo, .kiro, .kimi, .moonshot, .jetbrains, .perplexity,
.mimo, .doubao, .sakana, .abacus, .mistral, .deepinfra, .codebuff, .crof, .windsurf,
.venice, .manus, .commandcode, .qoder, .stepfun, .bedrock, .grok, .groq, .t3chat, .llmproxy,
diff --git a/Sources/CodexBarCLI/CLIDiagnoseCommand.swift b/Sources/CodexBarCLI/CLIDiagnoseCommand.swift
index 34e750039e..22ab65ded2 100644
--- a/Sources/CodexBarCLI/CLIDiagnoseCommand.swift
+++ b/Sources/CodexBarCLI/CLIDiagnoseCommand.swift
@@ -297,6 +297,8 @@ extension CodexBarCLI {
switch provider {
case .alibabatokenplan:
AlibabaTokenPlanSettingsReader.cookieHeader(environment: environment) != nil
+ case .qwencloud:
+ QwenCloudSettingsReader.cookieHeader(environment: environment) != nil
case .kimi:
KimiSettingsReader.authToken(environment: environment) != nil
case .manus:
diff --git a/Sources/CodexBarCLI/CLIUsageCommand.swift b/Sources/CodexBarCLI/CLIUsageCommand.swift
index b3e07a8f34..d3d3923a76 100644
--- a/Sources/CodexBarCLI/CLIUsageCommand.swift
+++ b/Sources/CodexBarCLI/CLIUsageCommand.swift
@@ -715,6 +715,19 @@ extension CodexBarCLI {
{
return false
}
+ if provider == .qwencloud,
+ sourceMode == .auto || sourceMode == .web,
+ settings?.qwenCloud?.cookieSource != .off
+ {
+ let hasEnvironmentCookie = environment.map {
+ QwenCloudSettingsReader.cookieHeader(environment: $0) != nil
+ } == true
+ let hasManualCookie = settings?.qwenCloud?.cookieSource == .manual &&
+ CookieHeaderNormalizer.normalize(settings?.qwenCloud?.manualCookieHeader) != nil
+ if hasEnvironmentCookie || hasManualCookie {
+ return false
+ }
+ }
if provider == .qoder,
settings?.qoder?.cookieSource == .manual
{
diff --git a/Sources/CodexBarCLI/TokenAccountCLI.swift b/Sources/CodexBarCLI/TokenAccountCLI.swift
index 3708892916..d7d8ca4d99 100644
--- a/Sources/CodexBarCLI/TokenAccountCLI.swift
+++ b/Sources/CodexBarCLI/TokenAccountCLI.swift
@@ -151,6 +151,7 @@ struct TokenAccountCLIContext {
}
}
+ // swiftlint:disable:next cyclomatic_complexity
private func makeCookieBackedSnapshot(
provider: UsageProvider,
account: ProviderTokenAccount?,
@@ -187,6 +188,8 @@ struct TokenAccountCLIContext {
cookieSource: cookieSettings.cookieSource,
manualCookieHeader: cookieSettings.manualCookieHeader,
apiRegion: self.resolveAlibabaTokenPlanRegion(config)))
+ case .qwencloud:
+ return self.makeSnapshot(qwenCloud: self.makeProviderCookieSettings(cookieSettings))
case .factory:
return self.makeSnapshot(factory: self.makeProviderCookieSettings(cookieSettings))
case .minimax:
@@ -240,6 +243,7 @@ struct TokenAccountCLIContext {
opencodego: ProviderSettingsSnapshot.OpenCodeProviderSettings? = nil,
alibaba: ProviderSettingsSnapshot.AlibabaCodingPlanProviderSettings? = nil,
alibabaTokenPlan: ProviderSettingsSnapshot.AlibabaTokenPlanProviderSettings? = nil,
+ qwenCloud: ProviderSettingsSnapshot.QwenCloudProviderSettings? = nil,
factory: ProviderSettingsSnapshot.FactoryProviderSettings? = nil,
minimax: ProviderSettingsSnapshot.MiniMaxProviderSettings? = nil,
manus: ProviderSettingsSnapshot.ManusProviderSettings? = nil,
@@ -268,6 +272,7 @@ struct TokenAccountCLIContext {
opencodego: opencodego,
alibaba: alibaba,
alibabaTokenPlan: alibabaTokenPlan,
+ qwenCloud: qwenCloud,
factory: factory,
minimax: minimax,
manus: manus,
diff --git a/Sources/CodexBarCore/Generated/CodexParserHash.generated.swift b/Sources/CodexBarCore/Generated/CodexParserHash.generated.swift
index d46bf4b5b2..0f885bdbcb 100644
--- a/Sources/CodexBarCore/Generated/CodexParserHash.generated.swift
+++ b/Sources/CodexBarCore/Generated/CodexParserHash.generated.swift
@@ -1,5 +1,5 @@
// Generated by Scripts/regenerate-codex-parser-hash.sh. Do not edit by hand.
enum CodexParserHash {
- static let value = "48ac20dad61e9a7f"
+ static let value = "e8496ca631793ba0"
}
diff --git a/Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanCookieImporter.swift b/Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanCookieImporter.swift
index 183b122af1..aa7b908b3b 100644
--- a/Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanCookieImporter.swift
+++ b/Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanCookieImporter.swift
@@ -1,16 +1,15 @@
import Foundation
#if os(macOS)
-import CommonCrypto
-import Security
-import SQLite3
import SweetCookieKit
private let alibabaCookieImportOrder: BrowserCookieImportOrder =
ProviderDefaults.metadata[.alibaba]?.browserCookieOrder ?? Browser.defaultImportOrder
+/// Alibaba-specific entry point for the shared OneConsole cookie importer.
public enum AlibabaCodingPlanCookieImporter {
- private static let cookieClient = BrowserCookieClient()
+ public typealias SessionInfo = AliyunOneConsoleCookieImporter.SessionInfo
+
private static let cookieDomains = [
"bailian-singapore-cs.alibabacloud.com",
"bailian-cs.console.aliyun.com",
@@ -27,42 +26,6 @@ public enum AlibabaCodingPlanCookieImporter {
"aliyun.com",
]
- public struct SessionInfo: Sendable {
- public let cookies: [HTTPCookie]
- public let sourceLabel: String
-
- public init(cookies: [HTTPCookie], sourceLabel: String) {
- self.cookies = cookies
- self.sourceLabel = sourceLabel
- }
-
- public var cookieHeader: String {
- var byName: [String: HTTPCookie] = [:]
- byName.reserveCapacity(self.cookies.count)
-
- for cookie in self.cookies {
- if let expiry = cookie.expiresDate, expiry < Date() {
- continue
- }
- guard !cookie.value.isEmpty else { continue }
- if let existing = byName[cookie.name] {
- let existingExpiry = existing.expiresDate ?? .distantPast
- let candidateExpiry = cookie.expiresDate ?? .distantPast
- if candidateExpiry >= existingExpiry {
- byName[cookie.name] = cookie
- }
- } else {
- byName[cookie.name] = cookie
- }
- }
-
- return byName.keys.sorted().compactMap { name in
- guard let cookie = byName[name] else { return nil }
- return "\(cookie.name)=\(cookie.value)"
- }.joined(separator: "; ")
- }
- }
-
#if DEBUG
final class ImportSessionOverrideStore: @unchecked Sendable {
let importSession: (BrowserDetection, ((String) -> Void)?) throws -> SessionInfo
@@ -102,65 +65,21 @@ public enum AlibabaCodingPlanCookieImporter {
return try override(browserDetection, logger)
}
#endif
- let log: (String) -> Void = { msg in logger?("[alibaba-cookie] \(msg)") }
- var accessDeniedHints: [String] = []
- var failureDetails: [String] = []
- let installedBrowsers = self.cookieImportCandidates(browserDetection: browserDetection)
- log("Cookie import candidates: \(installedBrowsers.map(\.displayName).joined(separator: ", "))")
-
- for browserSource in installedBrowsers {
- do {
- log("Checking \(browserSource.displayName)")
- let query = BrowserCookieQuery(domains: self.cookieDomains)
- let sources = try Self.cookieClient.codexBarRecords(
- matching: query,
- in: browserSource,
- logger: log)
- if sources.isEmpty {
- log("No matching cookie records in \(browserSource.displayName)")
- if let fallbackSession = try Self.importChromiumFallbackSession(
- browser: browserSource,
- logger: log)
- {
- return fallbackSession
- }
- }
- for source in sources where !source.records.isEmpty {
- let httpCookies = BrowserCookieClient.makeHTTPCookies(source.records, origin: query.origin)
- if self.isAuthenticatedSession(cookies: httpCookies) {
- log("Found \(httpCookies.count) Alibaba cookies in \(source.label)")
- return SessionInfo(cookies: httpCookies, sourceLabel: source.label)
- }
- let cookieNames = Set(httpCookies.map(\.name))
- let hasTicket = cookieNames.contains("login_aliyunid_ticket")
- let hasAccount =
- cookieNames.contains("login_aliyunid_pk") ||
- cookieNames.contains("login_current_pk") ||
- cookieNames.contains("login_aliyunid")
- log("Skipping \(source.label): missing auth cookies (ticket=\(hasTicket), account=\(hasAccount))")
- }
- if let fallbackSession = try Self.importChromiumFallbackSession(browser: browserSource, logger: log) {
- return fallbackSession
- }
- } catch let error as BrowserCookieError {
- BrowserCookieAccessGate.recordIfNeeded(error)
- if let hint = error.accessDeniedHint {
- accessDeniedHints.append(hint)
- }
- failureDetails.append("\(browserSource.displayName): \(error.localizedDescription)")
- log("\(browserSource.displayName) cookie import failed: \(error.localizedDescription)")
- } catch {
- failureDetails.append("\(browserSource.displayName): \(error.localizedDescription)")
- log("\(browserSource.displayName) cookie import failed: \(error.localizedDescription)")
- }
+ do {
+ return try AliyunOneConsoleCookieImporter.importSession(
+ browserDetection: browserDetection,
+ domains: self.cookieDomains,
+ isAuthenticatedSession: self.isAuthenticatedSession(cookies:),
+ logPrefix: "alibaba-cookie",
+ sessionLabel: "Alibaba",
+ importOrder: alibabaCookieImportOrder,
+ logger: logger)
+ } catch let error as AliyunOneConsoleCookieImportError {
+ throw AlibabaCodingPlanSettingsError.missingCookie(details: error.details)
}
-
- let details = (Array(Set(accessDeniedHints)).sorted() + Array(Set(failureDetails)).sorted())
- .joined(separator: " ")
- throw AlibabaCodingPlanSettingsError.missingCookie(details: details.isEmpty ? nil : details)
}
- private static func isAuthenticatedSession(cookies: [HTTPCookie]) -> Bool {
+ static func isAuthenticatedSession(cookies: [HTTPCookie]) -> Bool {
guard !cookies.isEmpty else { return false }
let names = Set(cookies.map(\.name))
let hasTicket = names.contains("login_aliyunid_ticket")
@@ -175,22 +94,13 @@ public enum AlibabaCodingPlanCookieImporter {
browserDetection: BrowserDetection,
logger: ((String) -> Void)? = nil) -> Bool
{
- do {
- _ = try self.importSession(browserDetection: browserDetection, logger: logger)
- return true
- } catch {
- return false
- }
- }
-
- private static func importChromiumFallbackSession(
- browser: Browser,
- logger: ((String) -> Void)? = nil) throws -> SessionInfo?
- {
- guard browser.usesChromiumProfileStore else { return nil }
- return try AlibabaChromiumCookieFallbackImporter.importSession(
- browser: browser,
+ AliyunOneConsoleCookieImporter.hasSession(
+ browserDetection: browserDetection,
domains: self.cookieDomains,
+ isAuthenticatedSession: self.isAuthenticatedSession(cookies:),
+ logPrefix: "alibaba-cookie",
+ sessionLabel: "Alibaba",
+ importOrder: alibabaCookieImportOrder,
logger: logger)
}
@@ -198,342 +108,17 @@ public enum AlibabaCodingPlanCookieImporter {
browserDetection: BrowserDetection,
importOrder: BrowserCookieImportOrder = alibabaCookieImportOrder) -> [Browser]
{
- importOrder.cookieImportCandidates(using: browserDetection)
+ AliyunOneConsoleCookieImporter.cookieImportCandidates(
+ browserDetection: browserDetection,
+ importOrder: importOrder)
}
static func matchesCookieDomain(_ domain: String, patterns: [String] = Self.cookieDomains) -> Bool {
- let normalized = self.normalizeCookieDomain(domain)
- return patterns.contains { pattern in
- let normalizedPattern = self.normalizeCookieDomain(pattern)
- return normalized == normalizedPattern || normalized.hasSuffix(".\(normalizedPattern)")
- }
+ AliyunOneConsoleCookieImporter.matchesCookieDomain(domain, patterns: patterns)
}
static func normalizeCookieDomain(_ domain: String) -> String {
- let trimmed = domain.trimmingCharacters(in: .whitespacesAndNewlines)
- let normalized = trimmed.hasPrefix(".") ? String(trimmed.dropFirst()) : trimmed
- return normalized.lowercased()
- }
-}
-
-enum AlibabaChromiumCookieFallbackImporter {
- private struct ChromiumCookieRecord {
- let domain: String
- let name: String
- let path: String
- let value: String
- let expires: Date?
- let isSecure: Bool
- }
-
- enum ImportError: LocalizedError {
- case keyUnavailable(browser: Browser)
- case keychainDenied(browser: Browser)
- case sqliteFailed(label: String, details: String)
-
- var errorDescription: String? {
- switch self {
- case let .keyUnavailable(browser):
- "\(browser.displayName) Safe Storage key not found."
- case let .keychainDenied(browser):
- "macOS Keychain denied access to \(browser.displayName) Safe Storage."
- case let .sqliteFailed(label, details):
- "\(label) cookie fallback failed: \(details)"
- }
- }
- }
-
- static func importSession(
- browser: Browser,
- domains: [String],
- cookieClient: BrowserCookieClient = BrowserCookieClient(),
- logger: ((String) -> Void)? = nil) throws -> AlibabaCodingPlanCookieImporter.SessionInfo?
- {
- let stores = try cookieClient.codexBarStores(for: browser).filter { $0.databaseURL != nil }
- guard !stores.isEmpty else { return nil }
-
- logger?("[alibaba-cookie] Trying \(browser.displayName) Chromium fallback")
- let keys = try self.derivedKeys(for: browser)
- for store in stores {
- let cookies = try self.loadCookies(from: store, domains: domains, keys: keys)
- guard !cookies.isEmpty else { continue }
- if self.isAuthenticatedSession(cookies) {
- logger?("[alibaba-cookie] Found \(cookies.count) Alibaba cookies via \(store.label) fallback")
- return AlibabaCodingPlanCookieImporter.SessionInfo(cookies: cookies, sourceLabel: store.label)
- }
- }
- return nil
- }
-
- private static func isAuthenticatedSession(_ cookies: [HTTPCookie]) -> Bool {
- let names = Set(cookies.map(\.name))
- let hasTicket = names.contains("login_aliyunid_ticket")
- let hasAccount =
- names.contains("login_aliyunid_pk") ||
- names.contains("login_current_pk") ||
- names.contains("login_aliyunid")
- return hasTicket && hasAccount
- }
-
- private static func loadCookies(
- from store: BrowserCookieStore,
- domains: [String],
- keys: [Data]) throws -> [HTTPCookie]
- {
- guard let sourceDB = store.databaseURL else { return [] }
- let records = try self.readCookiesFromLockedDB(
- sourceDB: sourceDB,
- domains: domains,
- keys: keys,
- label: store.label)
- return records.compactMap(self.makeCookie)
- }
-
- private static func readCookiesFromLockedDB(
- sourceDB: URL,
- domains: [String],
- keys: [Data],
- label: String) throws -> [ChromiumCookieRecord]
- {
- let tempDir = FileManager.default.temporaryDirectory
- .appendingPathComponent("alibaba-chromium-cookies-\(UUID().uuidString)", isDirectory: true)
- try FileManager.default.createDirectory(at: tempDir, withIntermediateDirectories: true)
-
- let copiedDB = tempDir.appendingPathComponent("Cookies")
- try FileManager.default.copyItem(at: sourceDB, to: copiedDB)
- for suffix in ["-wal", "-shm"] {
- let src = URL(fileURLWithPath: sourceDB.path + suffix)
- if FileManager.default.fileExists(atPath: src.path) {
- let dst = URL(fileURLWithPath: copiedDB.path + suffix)
- try? FileManager.default.copyItem(at: src, to: dst)
- }
- }
- defer { try? FileManager.default.removeItem(at: tempDir) }
-
- return try self.readCookies(fromDB: copiedDB.path, domains: domains, keys: keys, label: label)
- }
-
- private static func readCookies(
- fromDB path: String,
- domains: [String],
- keys: [Data],
- label: String) throws -> [ChromiumCookieRecord]
- {
- var db: OpaquePointer?
- guard sqlite3_open_v2(path, &db, SQLITE_OPEN_READONLY, nil) == SQLITE_OK else {
- throw ImportError.sqliteFailed(label: label, details: String(cString: sqlite3_errmsg(db)))
- }
- defer { sqlite3_close(db) }
-
- let sql = "SELECT host_key, name, path, expires_utc, is_secure, value, encrypted_value FROM cookies"
- var stmt: OpaquePointer?
- guard sqlite3_prepare_v2(db, sql, -1, &stmt, nil) == SQLITE_OK else {
- throw ImportError.sqliteFailed(label: label, details: String(cString: sqlite3_errmsg(db)))
- }
- defer { sqlite3_finalize(stmt) }
-
- var records: [ChromiumCookieRecord] = []
- while sqlite3_step(stmt) == SQLITE_ROW {
- guard let hostKey = self.readText(stmt, index: 0), self.matches(domain: hostKey, patterns: domains) else {
- continue
- }
- guard let name = self.readText(stmt, index: 1), let path = self.readText(stmt, index: 2) else {
- continue
- }
-
- let value: String? = if let plain = self.readText(stmt, index: 5), !plain.isEmpty {
- plain
- } else if let encrypted = self.readBlob(stmt, index: 6) {
- self.decrypt(encrypted, usingAnyOf: keys)
- } else {
- nil
- }
- guard let value, !value.isEmpty else { continue }
-
- records.append(ChromiumCookieRecord(
- domain: AlibabaCodingPlanCookieImporter.normalizeCookieDomain(hostKey),
- name: name,
- path: path,
- value: value,
- expires: self.chromiumExpiry(sqlite3_column_int64(stmt, 3)),
- isSecure: sqlite3_column_int(stmt, 4) != 0))
- }
-
- return records.filter { record in
- guard let expires = record.expires else { return true }
- return expires >= Date()
- }
- }
-
- private static func derivedKeys(for browser: Browser) throws -> [Data] {
- var keys: [Data] = []
- var sawDenied = false
-
- for label in browser.safeStorageLabels {
- switch KeychainAccessPreflight.checkGenericPassword(service: label.service, account: label.account) {
- case .interactionRequired:
- sawDenied = true
- continue
- case .allowed, .notFound, .failure:
- break
- }
-
- if let password = self.safeStoragePassword(service: label.service, account: label.account) {
- keys.append(self.deriveKey(from: password))
- }
- }
-
- if !keys.isEmpty {
- return keys
- }
- if sawDenied {
- throw ImportError.keychainDenied(browser: browser)
- }
- throw ImportError.keyUnavailable(browser: browser)
- }
-
- private static func safeStoragePassword(service: String, account: String) -> String? {
- // The preflight classifies prompt-requiring items as .interactionRequired, but its
- // .notFound (gate disabled) and .failure outcomes still reach this read. Honor the
- // access gate and keep the read strictly non-interactive so it can never prompt.
- guard !KeychainAccessGate.isDisabled else { return nil }
- var query: [String: Any] = [
- kSecClass as String: kSecClassGenericPassword,
- kSecAttrService as String: service,
- kSecAttrAccount as String: account,
- kSecMatchLimit as String: kSecMatchLimitOne,
- kSecReturnData as String: true,
- ]
- KeychainNoUIQuery.apply(to: &query)
-
- var result: AnyObject?
- let status = KeychainSecurity.copyMatching(query as CFDictionary, &result)
- guard status == errSecSuccess, let data = result as? Data else { return nil }
- return String(data: data, encoding: .utf8)
- }
-
- private static func deriveKey(from password: String) -> Data {
- let salt = Data("saltysalt".utf8)
- var key = Data(count: kCCKeySizeAES128)
- let keyLength = key.count
- _ = key.withUnsafeMutableBytes { keyBytes in
- password.utf8CString.withUnsafeBytes { passBytes in
- salt.withUnsafeBytes { saltBytes in
- CCKeyDerivationPBKDF(
- CCPBKDFAlgorithm(kCCPBKDF2),
- passBytes.bindMemory(to: Int8.self).baseAddress,
- passBytes.count - 1,
- saltBytes.bindMemory(to: UInt8.self).baseAddress,
- salt.count,
- CCPseudoRandomAlgorithm(kCCPRFHmacAlgSHA1),
- 1003,
- keyBytes.bindMemory(to: UInt8.self).baseAddress,
- keyLength)
- }
- }
- }
- return key
- }
-
- private static func decrypt(_ encryptedValue: Data, usingAnyOf keys: [Data]) -> String? {
- for key in keys {
- if let value = self.decrypt(encryptedValue, key: key) {
- return value
- }
- }
- return nil
- }
-
- private static func decrypt(_ encryptedValue: Data, key: Data) -> String? {
- guard encryptedValue.count > 3 else { return nil }
- let prefix = String(data: encryptedValue.prefix(3), encoding: .utf8)
- guard prefix == "v10" else { return nil }
-
- let payload = Data(encryptedValue.dropFirst(3))
- let iv = Data(repeating: 0x20, count: kCCBlockSizeAES128)
- var outLength = 0
- var out = Data(count: payload.count + kCCBlockSizeAES128)
- let outCapacity = out.count
-
- let status = out.withUnsafeMutableBytes { outBytes in
- payload.withUnsafeBytes { payloadBytes in
- key.withUnsafeBytes { keyBytes in
- iv.withUnsafeBytes { ivBytes in
- CCCrypt(
- CCOperation(kCCDecrypt),
- CCAlgorithm(kCCAlgorithmAES),
- CCOptions(kCCOptionPKCS7Padding),
- keyBytes.baseAddress,
- key.count,
- ivBytes.baseAddress,
- payloadBytes.baseAddress,
- payload.count,
- outBytes.baseAddress,
- outCapacity,
- &outLength)
- }
- }
- }
- }
-
- guard status == kCCSuccess else { return nil }
- out.count = outLength
-
- if let value = String(data: out, encoding: .utf8), !value.isEmpty {
- return value
- }
- if out.count > 32 {
- let trimmed = out.dropFirst(32)
- if let value = String(data: trimmed, encoding: .utf8), !value.isEmpty {
- return value
- }
- }
- return nil
- }
-
- private static func makeCookie(from record: ChromiumCookieRecord) -> HTTPCookie? {
- var properties: [HTTPCookiePropertyKey: Any] = [
- .domain: record.domain,
- .path: record.path,
- .name: record.name,
- .value: record.value,
- ]
- if record.isSecure {
- properties[.secure] = true
- }
- if let expires = record.expires {
- properties[.expires] = expires
- }
- return HTTPCookie(properties: properties)
- }
-
- private static func readText(_ stmt: OpaquePointer?, index: Int32) -> String? {
- guard sqlite3_column_type(stmt, index) != SQLITE_NULL,
- let value = sqlite3_column_text(stmt, index)
- else {
- return nil
- }
- return String(cString: value)
- }
-
- private static func readBlob(_ stmt: OpaquePointer?, index: Int32) -> Data? {
- guard sqlite3_column_type(stmt, index) != SQLITE_NULL,
- let bytes = sqlite3_column_blob(stmt, index)
- else {
- return nil
- }
- return Data(bytes: bytes, count: Int(sqlite3_column_bytes(stmt, index)))
- }
-
- private static func matches(domain: String, patterns: [String]) -> Bool {
- AlibabaCodingPlanCookieImporter.matchesCookieDomain(domain, patterns: patterns)
- }
-
- private static func chromiumExpiry(_ expiresUTC: Int64) -> Date? {
- guard expiresUTC > 0 else { return nil }
- let seconds = (Double(expiresUTC) / 1_000_000.0) - 11_644_473_600.0
- guard seconds > 0 else { return nil }
- return Date(timeIntervalSince1970: seconds)
+ AliyunOneConsoleCookieImporter.normalizeCookieDomain(domain)
}
}
#endif
diff --git a/Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift b/Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift
index 2eb7918ee9..d9f0c8b0ac 100644
--- a/Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift
+++ b/Sources/CodexBarCore/Providers/Alibaba/AlibabaCodingPlanUsageFetcher.swift
@@ -859,30 +859,12 @@ public struct AlibabaCodingPlanUsageFetcher: Sendable {
}
private static func expandedJSON(_ value: Any) -> Any {
- if let dict = value as? [String: Any] {
- var expanded: [String: Any] = [:]
- expanded.reserveCapacity(dict.count)
- for (key, nested) in dict {
- expanded[key] = self.expandedJSON(nested)
- }
- return expanded
- }
- if let array = value as? [Any] {
- return array.map { self.expandedJSON($0) }
- }
- if let string = value as? String,
- let data = string.data(using: .utf8),
- let nested = try? JSONSerialization.jsonObject(with: data, options: []),
- nested is [String: Any] || nested is [Any]
- {
- return self.expandedJSON(nested)
- }
- return value
+ OneConsoleJSON.expandEmbeddedJSON(value)
}
private static func anyInt(for keys: [String], in dict: [String: Any]) -> Int? {
for key in keys {
- if let value = self.parseInt(dict[key]) {
+ if let value = OneConsoleJSON.int(dict[key]) {
return value
}
}
@@ -891,7 +873,7 @@ public struct AlibabaCodingPlanUsageFetcher: Sendable {
private static func anyString(for keys: [String], in dict: [String: Any]) -> String? {
for key in keys {
- if let value = self.parseString(dict[key]) {
+ if let value = OneConsoleJSON.string(dict[key]) {
return value
}
}
@@ -900,7 +882,7 @@ public struct AlibabaCodingPlanUsageFetcher: Sendable {
private static func anyDate(for keys: [String], in dict: [String: Any]) -> Date? {
for key in keys {
- if let value = self.parseDate(dict[key]) {
+ if let value = OneConsoleJSON.date(dict[key]) {
return value
}
}
@@ -950,47 +932,15 @@ public struct AlibabaCodingPlanUsageFetcher: Sendable {
}
private static func parseDate(_ raw: Any?) -> Date? {
- if let intValue = self.parseInt(raw) {
- if intValue > 1_000_000_000_000 {
- return Date(timeIntervalSince1970: TimeInterval(intValue) / 1000)
- }
- if intValue > 1_000_000_000 {
- return Date(timeIntervalSince1970: TimeInterval(intValue))
- }
- }
- if let string = self.parseString(raw) {
- let formatter = ISO8601DateFormatter()
- if let date = formatter.date(from: string) {
- return date
- }
- let dateFormatter = DateFormatter()
- dateFormatter.locale = Locale(identifier: "en_US_POSIX")
- for format in ["yyyy-MM-dd HH:mm", "yyyy-MM-dd HH:mm:ss"] {
- dateFormatter.dateFormat = format
- if let date = dateFormatter.date(from: string) {
- return date
- }
- }
- }
- return nil
+ OneConsoleJSON.date(raw)
}
private static func parseInt(_ raw: Any?) -> Int? {
- if let value = raw as? Int { return value }
- if let value = raw as? Int64 { return Int(value) }
- if let value = raw as? Double { return Int(value) }
- if let value = raw as? NSNumber { return value.intValue }
- if let value = raw as? String {
- let trimmed = value.trimmingCharacters(in: .whitespacesAndNewlines)
- return Int(trimmed)
- }
- return nil
+ OneConsoleJSON.int(raw)
}
private static func parseString(_ raw: Any?) -> String? {
- guard let value = raw as? String else { return nil }
- let trimmed = value.trimmingCharacters(in: .whitespacesAndNewlines)
- return trimmed.isEmpty ? nil : trimmed
+ OneConsoleJSON.string(raw)
}
private static func parsePercent(_ raw: Any?) -> Double? {
diff --git a/Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanCookieHeader.swift b/Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanCookieHeader.swift
index 14a99af975..bb1cc2a0dc 100644
--- a/Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanCookieHeader.swift
+++ b/Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanCookieHeader.swift
@@ -3,90 +3,49 @@ import Foundation
import FoundationNetworking
#endif
-struct AlibabaTokenPlanCookieHeaders {
- private static let cachedAPIHeaderName = "__codexbar_alibaba_token_plan_api"
- private static let cachedDashboardHeaderName = "__codexbar_alibaba_token_plan_dashboard"
-
- let apiCookieHeader: String
- let dashboardCookieHeader: String
-
- init(apiCookieHeader: String, dashboardCookieHeader: String) {
- self.apiCookieHeader = apiCookieHeader
- self.dashboardCookieHeader = dashboardCookieHeader
- }
-
- init?(singleHeader raw: String?) {
- guard let normalized = CookieHeaderNormalizer.normalize(raw) else { return nil }
- self.apiCookieHeader = normalized
- self.dashboardCookieHeader = normalized
- }
+/// Alibaba Token Plan cookie-header pair.
+///
+/// Wraps the shared `OneConsoleCookieHeaders` so the rest of the codebase
+/// keeps referring to `AlibabaTokenPlanCookieHeaders`. The cached-header
+/// round-trip uses a namespace unique to Alibaba Token Plan so it can never
+/// collide with Qwen Cloud or another provider's cached entry.
+public typealias AlibabaTokenPlanCookieHeaders = OneConsoleCookieHeaders
+
+extension OneConsoleCookieHeaders {
+ static let alibabaTokenPlanCacheNamespace = "alibaba_token_plan"
+}
- init?(cachedHeader raw: String?) {
- var valuesByName: [String: String] = [:]
- for pair in CookieHeaderNormalizer.pairs(from: raw ?? "") {
- valuesByName[pair.name] = pair.value
- }
- if let encodedAPI = valuesByName[Self.cachedAPIHeaderName],
- let encodedDashboard = valuesByName[Self.cachedDashboardHeaderName],
- let apiHeader = Self.decodeCachedHeader(encodedAPI),
- let dashboardHeader = Self.decodeCachedHeader(encodedDashboard),
- let normalizedAPI = CookieHeaderNormalizer.normalize(apiHeader),
- let normalizedDashboard = CookieHeaderNormalizer.normalize(dashboardHeader)
+extension OneConsoleCookieHeaders {
+ public init?(alibabaTokenPlanCachedHeader raw: String?) {
+ if let headers = OneConsoleCookieHeaders(
+ cachedHeader: raw,
+ cacheNamespace: Self.alibabaTokenPlanCacheNamespace)
{
- self.init(apiCookieHeader: normalizedAPI, dashboardCookieHeader: normalizedDashboard)
- return
+ self = headers
+ } else if let headers = OneConsoleCookieHeaders(singleHeader: raw) {
+ self = headers
+ } else {
+ return nil
}
-
- self.init(singleHeader: raw)
- }
-
- var cacheCookieHeader: String {
- [
- "\(Self.cachedAPIHeaderName)=\(Self.encodeCachedHeader(self.apiCookieHeader))",
- "\(Self.cachedDashboardHeaderName)=\(Self.encodeCachedHeader(self.dashboardCookieHeader))",
- ].joined(separator: "; ")
- }
-
- var apiCookieNames: [String] {
- Self.cookieNames(from: self.apiCookieHeader)
- }
-
- var dashboardCookieNames: [String] {
- Self.cookieNames(from: self.dashboardCookieHeader)
- }
-
- func hasCookie(named name: String) -> Bool {
- Self.cookieNames(from: self.apiCookieHeader).contains(name) ||
- Self.cookieNames(from: self.dashboardCookieHeader).contains(name)
- }
-
- private static func cookieNames(from header: String) -> [String] {
- CookieHeaderNormalizer.pairs(from: header)
- .map(\.name)
- .filter { !$0.isEmpty }
- .uniquedSorted()
}
- private static func encodeCachedHeader(_ header: String) -> String {
- Data(header.utf8).base64EncodedString()
- }
-
- private static func decodeCachedHeader(_ encoded: String) -> String? {
- guard let data = Data(base64Encoded: encoded) else { return nil }
- return String(data: data, encoding: .utf8)
+ public func cacheAlibabaTokenPlanCookieHeader() -> String {
+ self.cacheCookieHeader(namespace: Self.alibabaTokenPlanCacheNamespace)
}
}
enum AlibabaTokenPlanCookieHeader {
+ static let cacheNamespace = OneConsoleCookieHeaders.alibabaTokenPlanCacheNamespace
+
static func headers(
from cookies: [HTTPCookie],
region: AlibabaTokenPlanAPIRegion = .international,
environment: [String: String] = ProcessInfo.processInfo.environment) -> AlibabaTokenPlanCookieHeaders?
{
- guard let apiHeader = self.header(
+ guard let apiHeader = OneConsoleCookieHeaderBuilder.header(
from: cookies,
targetURL: AlibabaTokenPlanUsageFetcher.resolveQuotaURL(region: region, environment: environment)),
- let dashboardHeader = self.header(
+ let dashboardHeader = OneConsoleCookieHeaderBuilder.header(
from: cookies,
targetURL: AlibabaTokenPlanUsageFetcher.dashboardURL(region: region, environment: environment))
else {
@@ -96,68 +55,6 @@ enum AlibabaTokenPlanCookieHeader {
}
static func header(from cookies: [HTTPCookie], targetURL: URL) -> String? {
- var byName: [String: HTTPCookie] = [:]
- for cookie in cookies {
- guard !cookie.name.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty else { continue }
- guard !cookie.value.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty else { continue }
- if let expiry = cookie.expiresDate, expiry < Date() { continue }
- guard self.matchesRequestURL(cookie: cookie, url: targetURL) else { continue }
-
- if let existing = byName[cookie.name] {
- if self.cookieSortKey(for: cookie) >= self.cookieSortKey(for: existing) {
- byName[cookie.name] = cookie
- }
- } else {
- byName[cookie.name] = cookie
- }
- }
-
- guard !byName.isEmpty else { return nil }
- return byName.keys.sorted().compactMap { name in
- guard let cookie = byName[name] else { return nil }
- return "\(cookie.name)=\(cookie.value)"
- }.joined(separator: "; ")
- }
-
- private static func matchesRequestURL(cookie: HTTPCookie, url: URL) -> Bool {
- guard let host = url.host?.lowercased() else { return false }
- let normalizedDomain = cookie.domain.lowercased().trimmingCharacters(in: CharacterSet(charactersIn: "."))
- guard !normalizedDomain.isEmpty else { return false }
- guard host == normalizedDomain || host.hasSuffix(".\(normalizedDomain)") else { return false }
-
- let cookiePath = cookie.path.isEmpty ? "/" : cookie.path
- let requestPath = url.path.isEmpty ? "/" : url.path
- if requestPath == cookiePath {
- return true
- }
- guard requestPath.hasPrefix(cookiePath) else { return false }
- guard cookiePath != "/" else { return true }
- if cookiePath.hasSuffix("/") {
- return true
- }
- guard
- let boundaryIndex = requestPath.index(
- requestPath.startIndex,
- offsetBy: cookiePath.count,
- limitedBy: requestPath.endIndex),
- boundaryIndex < requestPath.endIndex
- else {
- return true
- }
- return requestPath[boundaryIndex] == "/"
- }
-
- private static func cookieSortKey(for cookie: HTTPCookie) -> (Int, Int, Date) {
- let pathLength = cookie.path.count
- let normalizedDomain = cookie.domain.lowercased().trimmingCharacters(in: CharacterSet(charactersIn: "."))
- let domainLength = normalizedDomain.count
- let expiry = cookie.expiresDate ?? .distantPast
- return (pathLength, domainLength, expiry)
- }
-}
-
-extension [String] {
- fileprivate func uniquedSorted() -> [String] {
- Array(Set(self)).sorted()
+ OneConsoleCookieHeaderBuilder.header(from: cookies, targetURL: targetURL)
}
}
diff --git a/Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanProviderDescriptor.swift b/Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanProviderDescriptor.swift
index edfd0e645f..a64430d4a9 100644
--- a/Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanProviderDescriptor.swift
+++ b/Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanProviderDescriptor.swift
@@ -183,7 +183,7 @@ struct AlibabaTokenPlanWebFetchStrategy: ProviderFetchStrategy {
#if os(macOS)
if allowCached,
let cached = Self.cachedCookieEntry(region: region),
- let headers = AlibabaTokenPlanCookieHeaders(cachedHeader: cached.cookieHeader)
+ let headers = AlibabaTokenPlanCookieHeaders(alibabaTokenPlanCachedHeader: cached.cookieHeader)
{
Self.log.info(
"Alibaba Token Plan using cached browser cookie header",
@@ -219,7 +219,7 @@ struct AlibabaTokenPlanWebFetchStrategy: ProviderFetchStrategy {
CookieHeaderCache.store(
provider: .alibabatokenplan,
scope: region.cookieCacheScope,
- cookieHeader: headers.cacheCookieHeader,
+ cookieHeader: headers.cacheAlibabaTokenPlanCookieHeader(),
sourceLabel: session.sourceLabel)
Self.log.info(
"Alibaba Token Plan imported browser cookies",
@@ -277,12 +277,6 @@ struct AlibabaTokenPlanWebFetchStrategy: ProviderFetchStrategy {
}
}
-extension [String] {
- fileprivate func uniquedSorted() -> [String] {
- Array(Set(self)).sorted()
- }
-}
-
extension AlibabaTokenPlanUsageError {
fileprivate var isCredentialFailure: Bool {
switch self {
diff --git a/Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanUsageFetcher.swift b/Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanUsageFetcher.swift
index 27aee5a635..d16676b83c 100644
--- a/Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanUsageFetcher.swift
+++ b/Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanUsageFetcher.swift
@@ -554,6 +554,8 @@ public struct AlibabaTokenPlanUsageFetcher: Sendable {
"package_name",
"commodityName",
"commodity_name",
+ "specType",
+ "SpecType",
"instanceName",
"instance_name",
"displayName",
@@ -592,6 +594,8 @@ public struct AlibabaTokenPlanUsageFetcher: Sendable {
"amount",
"totalValue",
"TotalValue",
+ "cycleTotalValue",
+ "CycleTotalValue",
]
private static let remainingQuotaKeys = [
"remainingQuota",
@@ -607,6 +611,8 @@ public struct AlibabaTokenPlanUsageFetcher: Sendable {
"TotalSurplusValue",
"surplusValue",
"SurplusValue",
+ "cycleSurplusValue",
+ "CycleSurplusValue",
]
private static let subscriptionCountKeys = [
"totalCount",
@@ -625,21 +631,34 @@ public struct AlibabaTokenPlanUsageFetcher: Sendable {
"endTime",
"validEndTime",
"instanceEndTime",
+ "EndTime",
+ "cycleEndTime",
+ "CycleEndTime",
"nearestExpireDate",
"NearestExpireDate",
]
private static func findSubscriptionSummary(in payload: [String: Any]) -> [String: Any]? {
+ let quotaKeys = Self.usedQuotaKeys + Self.totalQuotaKeys + Self.remainingQuotaKeys
if let data = self.findFirstDictionary(
forKeys: ["Data", "data", "successResponse", "success_response"],
in: payload),
self.containsSubscriptionSummaryFields(data)
{
+ // Some consoles (e.g. Qwen Cloud) wrap the quota values inside a nested
+ // `EquityList` entry while the outer dictionary only carries `TotalCount`.
+ // Prefer a nested dictionary that actually contains quota numbers so the
+ // used/total/remaining fields are read from the right level.
+ if quotaKeys.contains(where: { data[$0] != nil }) {
+ return data
+ }
+ if let nested = self.findFirstDictionary(matchingAnyKey: quotaKeys, in: data) {
+ return nested
+ }
return data
}
return self.findFirstDictionary(
- matchingAnyKey: Self.usedQuotaKeys + Self.totalQuotaKeys + Self.remainingQuotaKeys +
- Self.subscriptionCountKeys,
+ matchingAnyKey: quotaKeys + Self.subscriptionCountKeys,
in: payload)
}
@@ -804,30 +823,12 @@ public struct AlibabaTokenPlanUsageFetcher: Sendable {
}
private static func expandedJSON(_ value: Any) -> Any {
- if let dict = value as? [String: Any] {
- var expanded: [String: Any] = [:]
- expanded.reserveCapacity(dict.count)
- for (key, nested) in dict {
- expanded[key] = self.expandedJSON(nested)
- }
- return expanded
- }
- if let array = value as? [Any] {
- return array.map { self.expandedJSON($0) }
- }
- if let string = value as? String,
- let data = string.data(using: .utf8),
- let nested = try? JSONSerialization.jsonObject(with: data, options: []),
- nested is [String: Any] || nested is [Any]
- {
- return self.expandedJSON(nested)
- }
- return value
+ OneConsoleJSON.expandEmbeddedJSON(value)
}
private static func anyString(for keys: [String], in dict: [String: Any]) -> String? {
for key in keys {
- if let value = self.parseString(dict[key]) {
+ if let value = OneConsoleJSON.string(dict[key]) {
return value
}
}
@@ -845,7 +846,7 @@ public struct AlibabaTokenPlanUsageFetcher: Sendable {
private static func anyDate(for keys: [String], in dict: [String: Any]) -> Date? {
for key in keys {
- if let value = self.parseDate(dict[key]) {
+ if let value = OneConsoleJSON.date(dict[key]) {
return value
}
}
@@ -862,12 +863,7 @@ public struct AlibabaTokenPlanUsageFetcher: Sendable {
}
private static func parseInt(_ raw: Any?) -> Int? {
- if let value = raw as? Int { return value }
- if let value = raw as? Int64 { return Int(value) }
- if let value = raw as? Double { return Int(value) }
- if let value = raw as? NSNumber { return value.intValue }
- if let value = self.parseString(raw) { return Int(value) }
- return nil
+ OneConsoleJSON.int(raw)
}
private static func parseDouble(_ raw: Any?) -> Double? {
@@ -875,7 +871,7 @@ public struct AlibabaTokenPlanUsageFetcher: Sendable {
if let value = raw as? Int { return Double(value) }
if let value = raw as? Int64 { return Double(value) }
if let value = raw as? NSNumber { return value.doubleValue }
- if let value = self.parseString(raw) {
+ if let value = OneConsoleJSON.string(raw) {
let cleaned = value.replacingOccurrences(of: ",", with: "")
return Double(cleaned)
}
@@ -883,9 +879,7 @@ public struct AlibabaTokenPlanUsageFetcher: Sendable {
}
private static func parseString(_ raw: Any?) -> String? {
- guard let value = raw as? String else { return nil }
- let trimmed = value.trimmingCharacters(in: .whitespacesAndNewlines)
- return trimmed.isEmpty ? nil : trimmed
+ OneConsoleJSON.string(raw)
}
private static func parseDate(_ raw: Any?) -> Date? {
@@ -989,9 +983,3 @@ public struct AlibabaTokenPlanUsageFetcher: Sendable {
return value.isEmpty ? nil : String(value)
}
}
-
-extension [String] {
- fileprivate func uniquedSorted() -> [String] {
- Array(Set(self)).sorted()
- }
-}
diff --git a/Sources/CodexBarCore/Providers/ProviderDescriptor.swift b/Sources/CodexBarCore/Providers/ProviderDescriptor.swift
index d533368cd7..37475df1bf 100644
--- a/Sources/CodexBarCore/Providers/ProviderDescriptor.swift
+++ b/Sources/CodexBarCore/Providers/ProviderDescriptor.swift
@@ -133,6 +133,7 @@ public enum ProviderDescriptorRegistry {
.opencodego: OpenCodeGoProviderDescriptor.descriptor,
.alibaba: AlibabaCodingPlanProviderDescriptor.descriptor,
.alibabatokenplan: AlibabaTokenPlanProviderDescriptor.descriptor,
+ .qwencloud: QwenCloudProviderDescriptor.descriptor,
.factory: FactoryProviderDescriptor.descriptor,
.gemini: GeminiProviderDescriptor.descriptor,
.antigravity: AntigravityProviderDescriptor.descriptor,
diff --git a/Sources/CodexBarCore/Providers/ProviderSettingsSnapshot.swift b/Sources/CodexBarCore/Providers/ProviderSettingsSnapshot.swift
index 9c744f589e..49ea597965 100644
--- a/Sources/CodexBarCore/Providers/ProviderSettingsSnapshot.swift
+++ b/Sources/CodexBarCore/Providers/ProviderSettingsSnapshot.swift
@@ -18,6 +18,7 @@ public struct ProviderSettingsSnapshot: Sendable {
opencodego: OpenCodeProviderSettings? = nil,
alibaba: AlibabaCodingPlanProviderSettings? = nil,
alibabaTokenPlan: AlibabaTokenPlanProviderSettings? = nil,
+ qwenCloud: QwenCloudProviderSettings? = nil,
factory: FactoryProviderSettings? = nil,
minimax: MiniMaxProviderSettings? = nil,
manus: ManusProviderSettings? = nil,
@@ -52,6 +53,7 @@ public struct ProviderSettingsSnapshot: Sendable {
opencodego: opencodego,
alibaba: alibaba,
alibabaTokenPlan: alibabaTokenPlan,
+ qwenCloud: qwenCloud,
factory: factory,
minimax: minimax,
manus: manus,
@@ -198,6 +200,16 @@ public struct ProviderSettingsSnapshot: Sendable {
}
}
+ public struct QwenCloudProviderSettings: ProviderCookieSettings {
+ public let cookieSource: ProviderCookieSource
+ public let manualCookieHeader: String?
+
+ public init(cookieSource: ProviderCookieSource = .auto, manualCookieHeader: String? = nil) {
+ self.cookieSource = cookieSource
+ self.manualCookieHeader = manualCookieHeader
+ }
+ }
+
public struct FactoryProviderSettings: ProviderCookieSettings {
public let cookieSource: ProviderCookieSource
public let manualCookieHeader: String?
@@ -477,6 +489,7 @@ public struct ProviderSettingsSnapshot: Sendable {
public let opencodego: OpenCodeProviderSettings?
public let alibaba: AlibabaCodingPlanProviderSettings?
public let alibabaTokenPlan: AlibabaTokenPlanProviderSettings?
+ public let qwenCloud: QwenCloudProviderSettings?
public let factory: FactoryProviderSettings?
public let minimax: MiniMaxProviderSettings?
public let manus: ManusProviderSettings?
@@ -515,6 +528,7 @@ public struct ProviderSettingsSnapshot: Sendable {
opencodego: OpenCodeProviderSettings?,
alibaba: AlibabaCodingPlanProviderSettings?,
alibabaTokenPlan: AlibabaTokenPlanProviderSettings? = nil,
+ qwenCloud: QwenCloudProviderSettings? = nil,
factory: FactoryProviderSettings?,
minimax: MiniMaxProviderSettings?,
manus: ManusProviderSettings?,
@@ -548,6 +562,7 @@ public struct ProviderSettingsSnapshot: Sendable {
self.opencodego = opencodego
self.alibaba = alibaba
self.alibabaTokenPlan = alibabaTokenPlan
+ self.qwenCloud = qwenCloud
self.factory = factory
self.minimax = minimax
self.manus = manus
@@ -582,6 +597,7 @@ public enum ProviderSettingsSnapshotContribution: Sendable {
case opencodego(ProviderSettingsSnapshot.OpenCodeProviderSettings)
case alibaba(ProviderSettingsSnapshot.AlibabaCodingPlanProviderSettings)
case alibabaTokenPlan(ProviderSettingsSnapshot.AlibabaTokenPlanProviderSettings)
+ case qwenCloud(ProviderSettingsSnapshot.QwenCloudProviderSettings)
case factory(ProviderSettingsSnapshot.FactoryProviderSettings)
case minimax(ProviderSettingsSnapshot.MiniMaxProviderSettings)
case manus(ProviderSettingsSnapshot.ManusProviderSettings)
@@ -617,6 +633,7 @@ public struct ProviderSettingsSnapshotBuilder: Sendable {
public var opencodego: ProviderSettingsSnapshot.OpenCodeProviderSettings?
public var alibaba: ProviderSettingsSnapshot.AlibabaCodingPlanProviderSettings?
public var alibabaTokenPlan: ProviderSettingsSnapshot.AlibabaTokenPlanProviderSettings?
+ public var qwenCloud: ProviderSettingsSnapshot.QwenCloudProviderSettings?
public var factory: ProviderSettingsSnapshot.FactoryProviderSettings?
public var minimax: ProviderSettingsSnapshot.MiniMaxProviderSettings?
public var manus: ProviderSettingsSnapshot.ManusProviderSettings?
@@ -656,6 +673,7 @@ public struct ProviderSettingsSnapshotBuilder: Sendable {
case let .opencodego(value): self.opencodego = value
case let .alibaba(value): self.alibaba = value
case let .alibabaTokenPlan(value): self.alibabaTokenPlan = value
+ case let .qwenCloud(value): self.qwenCloud = value
case let .factory(value): self.factory = value
case let .minimax(value): self.minimax = value
case let .manus(value): self.manus = value
@@ -693,6 +711,7 @@ public struct ProviderSettingsSnapshotBuilder: Sendable {
opencodego: self.opencodego,
alibaba: self.alibaba,
alibabaTokenPlan: self.alibabaTokenPlan,
+ qwenCloud: self.qwenCloud,
factory: self.factory,
minimax: self.minimax,
manus: self.manus,
diff --git a/Sources/CodexBarCore/Providers/Providers.swift b/Sources/CodexBarCore/Providers/Providers.swift
index 4953c94b07..bedb6c5226 100644
--- a/Sources/CodexBarCore/Providers/Providers.swift
+++ b/Sources/CodexBarCore/Providers/Providers.swift
@@ -13,6 +13,7 @@ public enum UsageProvider: String, CaseIterable, Sendable, Codable {
case opencodego
case alibaba
case alibabatokenplan
+ case qwencloud
case factory
case gemini
case antigravity
@@ -84,6 +85,7 @@ public enum IconStyle: String, Sendable, CaseIterable {
case opencode
case opencodego
case alibaba
+ case qwencloud
case factory
case copilot
case devin
diff --git a/Sources/CodexBarCore/Providers/QwenCloud/QwenCloudCookieHeader.swift b/Sources/CodexBarCore/Providers/QwenCloud/QwenCloudCookieHeader.swift
new file mode 100644
index 0000000000..3605bdb8c6
--- /dev/null
+++ b/Sources/CodexBarCore/Providers/QwenCloud/QwenCloudCookieHeader.swift
@@ -0,0 +1,54 @@
+import Foundation
+#if canImport(FoundationNetworking)
+import FoundationNetworking
+#endif
+
+/// Qwen Cloud cookie-header pair.
+///
+/// Wraps the shared `OneConsoleCookieHeaders` so the rest of the codebase
+/// keeps referring to `QwenCloudCookieHeaders`. The cached-header round-trip
+/// uses a namespace unique to Qwen Cloud so it can never collide with
+/// Alibaba Token Plan or another provider's cached entry.
+public typealias QwenCloudCookieHeaders = OneConsoleCookieHeaders
+
+extension OneConsoleCookieHeaders {
+ static let qwenCloudCacheNamespace = "qwen_cloud"
+
+ public init?(qwenCloudCachedHeader raw: String?) {
+ if let headers = OneConsoleCookieHeaders(cachedHeader: raw, cacheNamespace: Self.qwenCloudCacheNamespace) {
+ self = headers
+ } else if let headers = OneConsoleCookieHeaders(singleHeader: raw) {
+ self = headers
+ } else {
+ return nil
+ }
+ }
+
+ public func cacheQwenCloudCookieHeader() -> String {
+ self.cacheCookieHeader(namespace: Self.qwenCloudCacheNamespace)
+ }
+}
+
+enum QwenCloudCookieHeader {
+ static let cacheNamespace = OneConsoleCookieHeaders.qwenCloudCacheNamespace
+
+ static func headers(
+ from cookies: [HTTPCookie],
+ environment: [String: String] = ProcessInfo.processInfo.environment) -> QwenCloudCookieHeaders?
+ {
+ guard let apiHeader = OneConsoleCookieHeaderBuilder.header(
+ from: cookies,
+ targetURL: QwenCloudUsageFetcher.resolveQuotaURL(environment: environment)),
+ let dashboardHeader = OneConsoleCookieHeaderBuilder.header(
+ from: cookies,
+ targetURL: QwenCloudUsageFetcher.dashboardURL(environment: environment))
+ else {
+ return nil
+ }
+ return QwenCloudCookieHeaders(apiCookieHeader: apiHeader, dashboardCookieHeader: dashboardHeader)
+ }
+
+ static func header(from cookies: [HTTPCookie], targetURL: URL) -> String? {
+ OneConsoleCookieHeaderBuilder.header(from: cookies, targetURL: targetURL)
+ }
+}
diff --git a/Sources/CodexBarCore/Providers/QwenCloud/QwenCloudCookieImporter.swift b/Sources/CodexBarCore/Providers/QwenCloud/QwenCloudCookieImporter.swift
new file mode 100644
index 0000000000..8f2c72a69c
--- /dev/null
+++ b/Sources/CodexBarCore/Providers/QwenCloud/QwenCloudCookieImporter.swift
@@ -0,0 +1,60 @@
+#if os(macOS)
+import Foundation
+#if canImport(FoundationNetworking)
+import FoundationNetworking
+#endif
+import SweetCookieKit
+
+/// Qwen Cloud (home.qwencloud.com) shares the Aliyun one-console auth backend, so its
+/// session cookies live on `qwencloud.com` plus the alibabacloud/aliyun passport domains.
+public enum QwenCloudCookieImport {
+ static let cookieDomains: [String] = [
+ "qwencloud.com",
+ "home.qwencloud.com",
+ "account.qwencloud.com",
+ "signin.qwencloud.com",
+ "www.qwencloud.com",
+ "alibabacloud.com",
+ "account.alibabacloud.com",
+ "aliyun.com",
+ "console.aliyun.com",
+ ]
+
+ /// Cookie names that prove an authenticated Qwen Cloud session. Locale
+ /// preferences, account-id markers, and CSRF tokens are intentionally
+ /// excluded: a browser profile that merely visited qwencloud.com already
+ /// carries them while logged out, and treating such a profile as
+ /// authenticated would make the fetcher send a ticketless request, receive
+ /// `loginRequired`, and keep re-importing the same profile forever.
+ static let authTicketCookies: SetPopular providers become status items with their own usage windows, reset countdowns, charts, and provider menus. diff --git a/docs/llms.txt b/docs/llms.txt index bc9837997a..0a6467a4ff 100644 --- a/docs/llms.txt +++ b/docs/llms.txt @@ -1,9 +1,9 @@ # CodexBar -A tiny macOS menu bar app that tracks AI coding-provider usage windows, credits, costs, and resets across 63 providers — Codex, OpenAI, Claude, Cursor, Gemini, Copilot, LiteLLM, and more. +A tiny macOS menu bar app that tracks AI coding-provider usage windows, credits, costs, and resets across 64 providers — Codex, OpenAI, Claude, Cursor, Gemini, Copilot, LiteLLM, and more. Canonical documentation: -- CodexBar — every AI coding limit, in your menu bar: https://codexbar.app/ - A tiny macOS menu bar app that tracks AI coding-provider usage windows, credits, costs, and resets across 63 providers — Codex, OpenAI, Claude, Cursor, Gemini, Copilot, LiteLLM, and more. +- CodexBar — every AI coding limit, in your menu bar: https://codexbar.app/ - A tiny macOS menu bar app that tracks AI coding-provider usage windows, credits, costs, and resets across 64 providers — Codex, OpenAI, Claude, Cursor, Gemini, Copilot, LiteLLM, and more. Source: https://github.com/steipete/CodexBar diff --git a/docs/providers.md b/docs/providers.md index 2be0fdeb74..38d123d1ee 100644 --- a/docs/providers.md +++ b/docs/providers.md @@ -8,7 +8,7 @@ read_when: # Providers -CodexBar currently registers 63 provider IDs. Some companies expose multiple surfaces, such as Codex vs OpenAI API or +CodexBar currently registers 64 provider IDs. Some companies expose multiple surfaces, such as Codex vs OpenAI API or OpenCode vs OpenCode Go, because the auth source and quota shape differ. ## Fetch strategies (current) @@ -45,6 +45,7 @@ scan fails, while provider/account configuration changes replace obsolete result | OpenCode Go | Unscoped Auto: local SQLite usage (`local`) → web dashboard (`web`). Scoped Auto (selected account/manual cookie/workspace): web → local. Explicit Web: web only. | | Alibaba Coding Plan | Console RPC via web cookies (auto/manual) with API key fallback (`web`, `api`). | | Alibaba Token Plan | Bailian subscription summary API via browser or manual cookies (`web`). | +| Qwen Cloud | Qwen Cloud 5-hour/weekly Token Plan APIs via browser or manual cookies (`web`). | | Droid/Factory | API key (`FACTORY_API_KEY` / config) → web cookies → stored tokens → local storage → WorkOS cookies (`auto`, `api`, `web`). | | Devin | Chrome localStorage session or manual Bearer token → daily and weekly quota API (`web`). | | z.ai | API token from config/env → quota API (`api`). | @@ -225,6 +226,37 @@ scan fails, while provider/account configuration changes replace obsolete result - Status: `https://status.aliyun.com` (link only, no auto-polling). - Details: `docs/alibaba-token-plan.md`. +### Aliyun OneConsole family + +Alibaba Coding Plan, Alibaba Token Plan, and Qwen Cloud all run on the Aliyun OneConsole +backend. They selectively reuse plumbing under +`Sources/CodexBarCore/Providers/Shared/AliyunOneConsole/`: + +- `AliyunOneConsoleCookieImporter` — browser cookie iteration, Chromium fallback, Keychain preflight. + The Alibaba providers and Qwen Cloud supply their own cookie domains and authenticated-session predicate. +- `OneConsoleCookieHeaders` / `OneConsoleCookieHeaderBuilder` — `apiCookieHeader` / `dashboardCookieHeader` + pair with cached-header round-trip, currently used by Alibaba Token Plan and Qwen Cloud. +- `OneConsoleJSON` — recursive expand-embedded-JSON traversal and scalar coercion (`number`, `int`, + `string`, `date`, `percentagePoints`), used by all three providers. +- `OneConsoleSECTokenResolver` — dashboard HTML → cookie → user-info chain, currently used by Qwen Cloud. +- `OneConsoleCookieRouting` — Qwen Cloud's provider-local redirect policy. It pins dashboard/API cookies + to their matching trusted origin, strips credentials from cross-origin GET/HEAD navigation, and blocks + cross-origin redirects that preserve a request body. + +Future OneConsole-based providers can adopt the helpers that match their actual protocol while keeping +provider-specific cookie validation, endpoints, login detection, and error translation at the provider boundary. + +## Qwen Cloud +- Web mode resolves `sec_token` through the dashboard (`home.qwencloud.com`), then posts to the current + individual Token Plan usage, subscription, and quota-configuration APIs on `cs-data.qwencloud.com`. +- Displays 5-hour and weekly consumed percentages, reset times, active tier, and tier-specific credit limits. +- Cookie sources: Chrome import (`auto`), manual Cookie header, or `QWEN_CLOUD_COOKIE`. +- Default data gateway: + `https://cs-data.qwencloud.com/data/api.json?action=IntlBroadScopeAspnGateway&product=sfm_bailian`. +- Host overrides: `QWEN_CLOUD_HOST` or `QWEN_CLOUD_QUOTA_URL` (HTTPS URLs or bare hosts normalized to HTTPS). +- Status: `https://status.alibabacloud.com` (link only, no auto-polling). +- Details: `docs/qwen-cloud.md`. + ## Droid (Factory) - API key from `~/.codexbar/config.json` (`providers[].apiKey`), `FACTORY_API_KEY`, or `~/.factory/.env`. - Web API via Factory cookies, bearer tokens, and WorkOS refresh tokens. diff --git a/docs/qwen-cloud.md b/docs/qwen-cloud.md new file mode 100644 index 0000000000..01193010dd --- /dev/null +++ b/docs/qwen-cloud.md @@ -0,0 +1,68 @@ +--- +summary: "Qwen Cloud provider notes: cookie auth, 5-hour and weekly token-plan usage, and setup." +read_when: + - Adding or modifying the Qwen Cloud provider + - Debugging Qwen Cloud cookie import or token-plan usage fetching + - Explaining Qwen Cloud setup and limitations to users +--- + +# Qwen Cloud Provider + +The Qwen Cloud provider tracks the **token plan (individual)** subscription credits from the +Qwen Cloud console (`home.qwencloud.com`), including plans that grant hosted Claude model access. + +## Features + +- **Current quota windows**: Shows 5-hour and weekly usage percentages, reset times, and plan-specific + credit limits from the same APIs used by the Qwen Cloud dashboard. +- **Cookie-based auth**: Uses browser cookies or a pasted `Cookie:` header. +- **Adjustable menu-bar display**: In **Settings → Menu Bar**, add the session/weekly percentage or usage-bar + items and arrange them like any other provider. + +## Setup + +1. Open **Settings → Providers** +2. Enable **Qwen Cloud** +3. Leave **Cookie source** on **Auto** (recommended) + +### Manual cookie import (optional) + +1. Open `https://home.qwencloud.com/billing/subscription/token-plan-individual` +2. Copy a `Cookie:` header from your browser's Network tab +3. Paste it into **Qwen Cloud → Cookie source → Manual** + +## How it works + +- Calls Qwen Cloud's current individual Token Plan APIs through the `sfm_bailian` console gateway: + `personal/api/v2/usage`, `personal/api/v2/subscription`, and `personal/api/v2/quota-config`. +- The usage response supplies the 5-hour and weekly consumed ratios and reset times. The subscription response + identifies the active tier, and quota configuration supplies that tier's numeric credit limits. +- Sends form-encoded fields for `product=sfm_bailian`, `action=IntlBroadScopeAspnGateway`, + `region=ap-southeast-1`, `language=en-US`, a resolved `sec_token`, and the provider-native API payload. +- Uses Qwen Cloud / alibabacloud login cookies, with `sec_token` resolved from the dashboard HTML, + a `sec_token` cookie, or the `/tool/user/info.json` endpoint +- Supports `QWEN_CLOUD_HOST` and `QWEN_CLOUD_QUOTA_URL` for testing endpoint overrides, and + `QWEN_CLOUD_COOKIE` for an environment-supplied cookie header +- Endpoint overrides accept full `https://` URLs or bare hosts (for example, + `QWEN_CLOUD_HOST=home.qwen-cloud.test`), which are normalized to HTTPS; non-HTTPS schemes are rejected + +## Limitations + +- Qwen Cloud currently supports the web-cookie path only +- API-key auth, token cost summaries, and automatic status polling are not supported +- The default endpoint targets the international Qwen Cloud individual Token Plan APIs + +## Troubleshooting + +### "No Qwen Cloud session cookies found in browsers" + +Log in at `https://home.qwencloud.com/billing/subscription/token-plan-individual` in Chrome, then refresh CodexBar. + +### "Qwen Cloud cookie header is invalid" + +The pasted header is empty or not a valid Cookie header. Re-copy the request from the Token Plan page after +logging in again. + +### "Qwen Cloud login required" + +Your Qwen Cloud session is stale. Sign out and back in on the Qwen Cloud console, then refresh CodexBar. diff --git a/docs/site-locales.mjs b/docs/site-locales.mjs index 41733b78ef..b43f18c91e 100644 --- a/docs/site-locales.mjs +++ b/docs/site-locales.mjs @@ -98,8 +98,8 @@ export const localeCatalog = [ export const localeMessages = { "en": { "meta.title": "CodexBar — every AI coding limit in your menu bar", - "meta.description": "A tiny macOS menu bar app that tracks AI coding-provider usage windows, credits, costs, and resets across 63 providers — Codex, OpenAI, Claude, Cursor, Gemini, Copilot, LiteLLM, and more.", - "meta.ogDescription": "Track usage windows, credits, and resets across 63 AI coding providers from your macOS menu bar.", + "meta.description": "A tiny macOS menu bar app that tracks AI coding-provider usage windows, credits, costs, and resets across 64 providers — Codex, OpenAI, Claude, Cursor, Gemini, Copilot, LiteLLM, and more.", + "meta.ogDescription": "Track usage windows, credits, and resets across 64 AI coding providers from your macOS menu bar.", "nav.primary": "Primary", "nav.language": "Language", "nav.docs": "docs", @@ -112,7 +112,7 @@ export const localeMessages = { "hero.description": "CodexBar tracks usage windows, credit balances, and reset countdowns across the providers you actually pay for — one status item each, or merge them into one.", "hero.download": "Download for macOS", "hero.fineprint": "Free & open source · macOS 14+ · Universal via GitHub Releases and Homebrew", - "providers.title": "63 providers,{mobileBreak}one menu bar", + "providers.title": "64 providers,{mobileBreak}one menu bar", "providers.description": "Popular providers become status items with their own usage windows, reset countdowns, charts, and provider menus.", "providers.yourProvider": "Your provider", "providers.authoringGuide": "Authoring guide", @@ -238,8 +238,8 @@ export const localeMessages = { }, "zh-CN": { "meta.title": "CodexBar — 菜单栏中的每个 AI 编码限制", - "meta.description": "一个微小的 macOS 菜单栏应用程序,可跟踪 63 个提供商(Codex、OpenAI、Claude、Cursor、Gemini、Copilot、LiteLLM 等)的 AI 编码提供商使用窗口、积分、成本和重置。", - "meta.ogDescription": "从您的 macOS 菜单栏跟踪 63 个 AI 编码提供商的使用窗口、积分和重置。", + "meta.description": "一个微小的 macOS 菜单栏应用程序,可跟踪 64 个提供商(Codex、OpenAI、Claude、Cursor、Gemini、Copilot、LiteLLM 等)的 AI 编码提供商使用窗口、积分、成本和重置。", + "meta.ogDescription": "从您的 macOS 菜单栏跟踪 64 个 AI 编码提供商的使用窗口、积分和重置。", "nav.primary": "基本的", "nav.language": "语言", "nav.docs": "文档", @@ -252,7 +252,7 @@ export const localeMessages = { "hero.description": "CodexBar 跟踪您实际付费的提供商的使用窗口、信用余额和重置倒计时 - 每个状态项一项,或将它们合并为一项。", "hero.download": "下载macOS", "hero.fineprint": "免费开源 · macOS 14+ · GitHub Releases 和 Homebrew 均提供通用版本", - "providers.title": "63 个提供商,{mobileBreak}一个菜单栏", + "providers.title": "64 个提供商,{mobileBreak}一个菜单栏", "providers.description": "受欢迎的提供商成为状态项目,具有自己的使用窗口、重置倒计时、图表和提供商菜单。", "providers.yourProvider": "您的提供商", "providers.authoringGuide": "创作指南", @@ -378,8 +378,8 @@ export const localeMessages = { }, "zh-TW": { "meta.title": "CodexBar — 功能表列中的每個 AI 編碼限制", - "meta.description": "一個微小的 macOS 功能表列應用程序,可追蹤 63 個提供者(Codex、OpenAI、Claude、Cursor、Gemini、Copilot、LiteLLM 等)的 AI 編碼提供者使用視窗、積分、成本和重設。", - "meta.ogDescription": "從您的 macOS 功能表列追蹤 63 個 AI 編碼提供者的使用視窗、積分和重設。", + "meta.description": "一個微小的 macOS 功能表列應用程序,可追蹤 64 個提供者(Codex、OpenAI、Claude、Cursor、Gemini、Copilot、LiteLLM 等)的 AI 編碼提供者使用視窗、積分、成本和重設。", + "meta.ogDescription": "從您的 macOS 功能表列追蹤 64 個 AI 編碼提供者的使用視窗、積分和重設。", "nav.primary": "基本的", "nav.language": "語言", "nav.docs": "文件", @@ -392,7 +392,7 @@ export const localeMessages = { "hero.description": "CodexBar 追蹤您實際付費的提供者的使用視窗、信用餘額和重設倒數計時 - 每個狀態項一項,或將它們合併為一項。", "hero.download": "下載macOS", "hero.fineprint": "免費開源 · macOS 14+ · GitHub Releases 和 Homebrew 均提供通用版本", - "providers.title": "63 個提供者,{mobileBreak}一個選單列", + "providers.title": "64 個提供者,{mobileBreak}一個選單列", "providers.description": "受歡迎的提供者成為狀態項目,具有自己的使用視窗、重置倒數計時、圖表和提供者選單。", "providers.yourProvider": "您的提供者", "providers.authoringGuide": "創作指南", @@ -518,8 +518,8 @@ export const localeMessages = { }, "ja-JP": { "meta.title": "CodexBar — メニュー バーのすべての AI コーディング制限", - "meta.description": "小さな macOS メニュー バー アプリ。Codex、OpenAI、Claude、Cursor、Gemini、Copilot、LiteLLM など、63 のプロバイダーにわたる AI コーディング プロバイダーの使用期間、クレジット、コスト、リセットを追跡します。", - "meta.ogDescription": "macOS メニュー バーから、63 の AI コーディング プロバイダーにわたる使用期間、クレジット、リセットを追跡します。", + "meta.description": "小さな macOS メニュー バー アプリ。Codex、OpenAI、Claude、Cursor、Gemini、Copilot、LiteLLM など、64 のプロバイダーにわたる AI コーディング プロバイダーの使用期間、クレジット、コスト、リセットを追跡します。", + "meta.ogDescription": "macOS メニュー バーから、64 の AI コーディング プロバイダーにわたる使用期間、クレジット、リセットを追跡します。", "nav.primary": "主要な", "nav.language": "言語", "nav.docs": "ドキュメント", @@ -532,7 +532,7 @@ export const localeMessages = { "hero.description": "CodexBar は、実際に料金を支払っているプロバイダー全体の使用期間、クレジット残高、リセット カウントダウンを追跡します。ステータス項目を 1 つずつ、または 1 つに統合します。", "hero.download": "macOS のダウンロード", "hero.fineprint": "無料・オープンソース · macOS 14+ · GitHub Releases と Homebrew でユニバーサル版を提供", - "providers.title": "63 プロバイダー、{mobileBreak}1つのメニューバー", + "providers.title": "64 プロバイダー、{mobileBreak}1つのメニューバー", "providers.description": "人気のあるプロバイダーは、独自の使用期間、リセット カウントダウン、グラフ、プロバイダー メニューを備えたステータス アイテムになります。", "providers.yourProvider": "あなたのプロバイダー", "providers.authoringGuide": "オーサリングガイド", @@ -658,8 +658,8 @@ export const localeMessages = { }, "es": { "meta.title": "CodexBar: cada límite de codificación de IA en tu barra de menú", - "meta.description": "Una pequeña aplicación de barra de menú macOS que rastrea las ventanas de uso, los créditos, los costos y los restablecimientos de los proveedores de codificación de IA en 63 proveedores: Codex, OpenAI, Claude, Cursor, Gemini, Copilot, LiteLLM y más.", - "meta.ogDescription": "Realice un seguimiento de las ventanas de uso, los créditos y los restablecimientos en 63 proveedores de codificación de IA desde su barra de menú macOS.", + "meta.description": "Una pequeña aplicación de barra de menú macOS que rastrea las ventanas de uso, los créditos, los costos y los restablecimientos de los proveedores de codificación de IA en 64 proveedores: Codex, OpenAI, Claude, Cursor, Gemini, Copilot, LiteLLM y más.", + "meta.ogDescription": "Realice un seguimiento de las ventanas de uso, los créditos y los restablecimientos en 64 proveedores de codificación de IA desde su barra de menú macOS.", "nav.primary": "Primario", "nav.language": "Idioma", "nav.docs": "Documentos", @@ -672,7 +672,7 @@ export const localeMessages = { "hero.description": "CodexBar realiza un seguimiento de los períodos de uso, los saldos de crédito y restablece las cuentas regresivas de los proveedores por los que realmente paga: un elemento de estado para cada uno o los fusiona en uno solo.", "hero.download": "Descargar para macOS", "hero.fineprint": "Gratis y de código abierto · macOS 14+ · Universal mediante GitHub Releases y Homebrew", - "providers.title": "63 proveedores,{mobileBreak}una barra de menús", + "providers.title": "64 proveedores,{mobileBreak}una barra de menús", "providers.description": "Los proveedores populares se convierten en elementos de estado con sus propias ventanas de uso, restablecen cuentas regresivas, gráficos y menús de proveedores.", "providers.yourProvider": "Tu proveedor", "providers.authoringGuide": "guía de autoría", @@ -798,8 +798,8 @@ export const localeMessages = { }, "pt-BR": { "meta.title": "CodexBar — todos os limites de codificação de IA na sua barra de menu", - "meta.description": "Um pequeno aplicativo de barra de menu macOS que rastreia janelas de uso, créditos, custos e redefinições do provedor de codificação de IA em 63 provedores — Codex, OpenAI, Claude, Cursor, Gemini, Copilot, LiteLLM e muito mais.", - "meta.ogDescription": "Rastreie janelas de uso, créditos e redefinições em 63 provedores de codificação de IA na barra de menu macOS.", + "meta.description": "Um pequeno aplicativo de barra de menu macOS que rastreia janelas de uso, créditos, custos e redefinições do provedor de codificação de IA em 64 provedores — Codex, OpenAI, Claude, Cursor, Gemini, Copilot, LiteLLM e muito mais.", + "meta.ogDescription": "Rastreie janelas de uso, créditos e redefinições em 64 provedores de codificação de IA na barra de menu macOS.", "nav.primary": "Primário", "nav.language": "Linguagem", "nav.docs": "Documentos", @@ -812,7 +812,7 @@ export const localeMessages = { "hero.description": "CodexBar rastreia janelas de uso, saldos de crédito e reinicia contagens regressivas nos provedores pelos quais você realmente paga - um item de status cada, ou mescla-os em um.", "hero.download": "Baixar para macOS", "hero.fineprint": "Gratuito e de código aberto · macOS 14+ · Universal via GitHub Releases e Homebrew", - "providers.title": "63 provedores,{mobileBreak}uma barra de menu", + "providers.title": "64 provedores,{mobileBreak}uma barra de menu", "providers.description": "Provedores populares tornam-se itens de status com suas próprias janelas de uso, reiniciam contagens regressivas, gráficos e menus de provedores.", "providers.yourProvider": "Seu provedor", "providers.authoringGuide": "Guia de autoria", @@ -938,8 +938,8 @@ export const localeMessages = { }, "ko": { "meta.title": "CodexBar — 메뉴 표시줄의 모든 AI 코딩 제한", - "meta.description": "Codex, OpenAI, Claude, Cursor, Gemini, Copilot, LiteLLM 등 63개 제공자 전체에서 AI 코딩 제공자 사용 창, 크레딧, 비용 및 재설정을 추적하는 작은 macOS 메뉴 표시줄 앱입니다.", - "meta.ogDescription": "macOS 메뉴 표시줄에서 63개 AI 코딩 제공업체의 사용 기간, 크레딧 및 재설정을 추적하세요.", + "meta.description": "Codex, OpenAI, Claude, Cursor, Gemini, Copilot, LiteLLM 등 64개 제공자 전체에서 AI 코딩 제공자 사용 창, 크레딧, 비용 및 재설정을 추적하는 작은 macOS 메뉴 표시줄 앱입니다.", + "meta.ogDescription": "macOS 메뉴 표시줄에서 64개 AI 코딩 제공업체의 사용 기간, 크레딧 및 재설정을 추적하세요.", "nav.primary": "주요한", "nav.language": "언어", "nav.docs": "문서", @@ -952,7 +952,7 @@ export const localeMessages = { "hero.description": "CodexBar는 귀하가 실제로 비용을 지불한 제공업체 전반에 걸쳐 사용 기간, 크레딧 잔액 및 재설정 카운트다운을 추적합니다. 즉, 각각 하나의 상태 항목 또는 하나로 병합됩니다.", "hero.download": "macOS 동안 다운로드", "hero.fineprint": "무료 오픈 소스 · macOS 14+ · GitHub Releases와 Homebrew에서 유니버설 제공", - "providers.title": "63개 제공자,{mobileBreak}하나의 메뉴 막대", + "providers.title": "64개 제공자,{mobileBreak}하나의 메뉴 막대", "providers.description": "인기 있는 제공업체는 자체 사용 창, 재설정 카운트다운, 차트 및 제공업체 메뉴를 갖춘 상태 항목이 됩니다.", "providers.yourProvider": "귀하의 제공자", "providers.authoringGuide": "저작 가이드", @@ -1078,8 +1078,8 @@ export const localeMessages = { }, "de": { "meta.title": "CodexBar – alle Limits Ihrer KI-Coding-Tools in der Menüleiste", - "meta.description": "Eine kleine macOS-Menüleisten-App, die Nutzungslimits, Guthaben, Kosten und Resets von 63 KI-Coding-Anbietern im Blick behält – Codex, OpenAI, Claude, Cursor, Gemini, Copilot, LiteLLM und mehr.", - "meta.ogDescription": "Nutzungslimits, Guthaben und Resets von 63 KI-Coding-Anbietern direkt in Ihrer macOS-Menüleiste.", + "meta.description": "Eine kleine macOS-Menüleisten-App, die Nutzungslimits, Guthaben, Kosten und Resets von 64 KI-Coding-Anbietern im Blick behält – Codex, OpenAI, Claude, Cursor, Gemini, Copilot, LiteLLM und mehr.", + "meta.ogDescription": "Nutzungslimits, Guthaben und Resets von 64 KI-Coding-Anbietern direkt in Ihrer macOS-Menüleiste.", "nav.primary": "Primär", "nav.language": "Sprache", "nav.docs": "Dokumente", @@ -1092,7 +1092,7 @@ export const localeMessages = { "hero.description": "CodexBar verfolgt Nutzungsfenster, Guthaben und Reset-Countdowns bei den Anbietern, für die Sie tatsächlich bezahlen – jeweils ein Statuselement oder sie werden zu einem zusammengeführt.", "hero.download": "Herunterladen für macOS", "hero.fineprint": "Kostenlos und Open Source · macOS 14+ · Universal über GitHub Releases und Homebrew", - "providers.title": "63 Provider,{mobileBreak}eine Menüleiste", + "providers.title": "64 Provider,{mobileBreak}eine Menüleiste", "providers.description": "Beliebte Anbieter werden zu Statuselementen mit eigenen Nutzungsfenstern, Reset-Countdowns, Diagrammen und Anbietermenüs.", "providers.yourProvider": "Ihr Anbieter", "providers.authoringGuide": "Autorenleitfaden", @@ -1218,8 +1218,8 @@ export const localeMessages = { }, "fr": { "meta.title": "CodexBar — chaque limite de codage IA dans votre barre de menus", - "meta.description": "Une petite application de barre de menus macOS qui suit les fenêtres d'utilisation, les crédits, les coûts et les réinitialisations des fournisseurs de codage d'IA sur 63 fournisseurs : Codex, OpenAI, Claude, Cursor, Gemini, Copilot, LiteLLM, et plus encore.", - "meta.ogDescription": "Suivez les fenêtres d'utilisation, les crédits et les réinitialisations auprès de 63 fournisseurs de codage d'IA à partir de votre barre de menus macOS.", + "meta.description": "Une petite application de barre de menus macOS qui suit les fenêtres d'utilisation, les crédits, les coûts et les réinitialisations des fournisseurs de codage d'IA sur 64 fournisseurs : Codex, OpenAI, Claude, Cursor, Gemini, Copilot, LiteLLM, et plus encore.", + "meta.ogDescription": "Suivez les fenêtres d'utilisation, les crédits et les réinitialisations auprès de 64 fournisseurs de codage d'IA à partir de votre barre de menus macOS.", "nav.primary": "Primaire", "nav.language": "Langue", "nav.docs": "Documents", @@ -1232,7 +1232,7 @@ export const localeMessages = { "hero.description": "CodexBar suit les fenêtres d'utilisation, les soldes créditeurs et réinitialise les comptes à rebours pour les fournisseurs pour lesquels vous payez réellement - un élément de statut chacun, ou les fusionne en un seul.", "hero.download": "Télécharger pour macOS", "hero.fineprint": "Gratuit et open source · macOS 14+ · Universel via GitHub Releases et Homebrew", - "providers.title": "63 fournisseurs,{mobileBreak}une barre des menus", + "providers.title": "64 fournisseurs,{mobileBreak}une barre des menus", "providers.description": "Les fournisseurs populaires deviennent des éléments de statut avec leurs propres fenêtres d'utilisation, réinitialisent les comptes à rebours, les graphiques et les menus des fournisseurs.", "providers.yourProvider": "Votre fournisseur", "providers.authoringGuide": "Guide de création", @@ -1358,8 +1358,8 @@ export const localeMessages = { }, "ar": { "meta.title": "CodexBar — كل حد لترميز الذكاء الاصطناعي في شريط القائمة", - "meta.description": "تطبيق شريط قوائم macOS صغير الحجم يتتبع نوافذ استخدام موفر ترميز الذكاء الاصطناعي، والائتمانات، والتكاليف، وعمليات إعادة التعيين عبر 63 موفرًا - Codex، وOpenAI، وClaude، وCursor، وGemini، وCopilot، وLiteLLM، والمزيد.", - "meta.ogDescription": "تتبع نوافذ الاستخدام والأرصدة وعمليات إعادة التعيين عبر 63 موفرًا لترميز الذكاء الاصطناعي من شريط القائمة macOS.", + "meta.description": "تطبيق شريط قوائم macOS صغير الحجم يتتبع نوافذ استخدام موفر ترميز الذكاء الاصطناعي، والائتمانات، والتكاليف، وعمليات إعادة التعيين عبر 64 موفرًا - Codex، وOpenAI، وClaude، وCursor، وGemini، وCopilot، وLiteLLM، والمزيد.", + "meta.ogDescription": "تتبع نوافذ الاستخدام والأرصدة وعمليات إعادة التعيين عبر 64 موفرًا لترميز الذكاء الاصطناعي من شريط القائمة macOS.", "nav.primary": "أساسي", "nav.language": "لغة", "nav.docs": "المستندات", @@ -1372,7 +1372,7 @@ export const localeMessages = { "hero.description": "يتتبع CodexBar فترات الاستخدام والأرصدة الائتمانية وإعادة تعيين العد التنازلي عبر مقدمي الخدمة الذين تدفع مقابلهم فعليًا — عنصر حالة واحد لكل منهم، أو دمجهم في عنصر واحد.", "hero.download": "التنزيل لمدة macOS", "hero.fineprint": "مجاني ومفتوح المصدر · macOS 14+ · إصدار شامل عبر GitHub Releases وHomebrew", - "providers.title": "63 مزودًا،{mobileBreak}شريط قوائم واحد", + "providers.title": "64 مزودًا،{mobileBreak}شريط قوائم واحد", "providers.description": "يصبح الموفرون المشهورون عناصر حالة مع نوافذ الاستخدام الخاصة بهم، وعمليات إعادة تعيين العد التنازلي، والمخططات، وقوائم الموفر.", "providers.yourProvider": "المزود الخاص بك", "providers.authoringGuide": "دليل التأليف", @@ -1498,8 +1498,8 @@ export const localeMessages = { }, "it": { "meta.title": "CodexBar: ogni limite di codifica AI nella barra dei menu", - "meta.description": "Una piccola app della barra dei menu macOS che tiene traccia delle finestre di utilizzo, dei crediti, dei costi e dei ripristini del fornitore di codifica AI tra 63 fornitori: Codex, OpenAI, Claude, Cursor, Gemini, Copilot, LiteLLM e altri.", - "meta.ogDescription": "Tieni traccia delle finestre di utilizzo, dei crediti e dei ripristini tra 63 fornitori di codifica AI dalla barra dei menu macOS.", + "meta.description": "Una piccola app della barra dei menu macOS che tiene traccia delle finestre di utilizzo, dei crediti, dei costi e dei ripristini del fornitore di codifica AI tra 64 fornitori: Codex, OpenAI, Claude, Cursor, Gemini, Copilot, LiteLLM e altri.", + "meta.ogDescription": "Tieni traccia delle finestre di utilizzo, dei crediti e dei ripristini tra 64 fornitori di codifica AI dalla barra dei menu macOS.", "nav.primary": "Primario", "nav.language": "Lingua", "nav.docs": "Documenti", @@ -1512,7 +1512,7 @@ export const localeMessages = { "hero.description": "CodexBar tiene traccia delle finestre di utilizzo, dei saldi del credito e reimposta i conti alla rovescia tra i fornitori per cui paghi effettivamente: un elemento di stato ciascuno o uniscili in uno solo.", "hero.download": "Scarica per macOS", "hero.fineprint": "Gratuito e open source · macOS 14+ · Universale tramite GitHub Releases e Homebrew", - "providers.title": "63 provider,{mobileBreak}una barra dei menu", + "providers.title": "64 provider,{mobileBreak}una barra dei menu", "providers.description": "I fornitori più popolari diventano elementi di stato con le proprie finestre di utilizzo, reimpostano i conti alla rovescia, i grafici e i menu dei fornitori.", "providers.yourProvider": "Il tuo fornitore", "providers.authoringGuide": "Guida all'autore", @@ -1638,8 +1638,8 @@ export const localeMessages = { }, "vi": { "meta.title": "CodexBar — mọi giới hạn mã hóa AI trong thanh menu của bạn", - "meta.description": "Một ứng dụng thanh menu macOS nhỏ theo dõi khoảng thời gian sử dụng, tín dụng, chi phí và đặt lại của nhà cung cấp mã hóa AI trên 63 nhà cung cấp — Codex, OpenAI, Claude, Cursor, Gemini, Copilot, LiteLLM, v.v.", - "meta.ogDescription": "Theo dõi khoảng thời gian sử dụng, tín dụng và đặt lại trên 63 nhà cung cấp mã hóa AI từ thanh menu macOS của bạn.", + "meta.description": "Một ứng dụng thanh menu macOS nhỏ theo dõi khoảng thời gian sử dụng, tín dụng, chi phí và đặt lại của nhà cung cấp mã hóa AI trên 64 nhà cung cấp — Codex, OpenAI, Claude, Cursor, Gemini, Copilot, LiteLLM, v.v.", + "meta.ogDescription": "Theo dõi khoảng thời gian sử dụng, tín dụng và đặt lại trên 64 nhà cung cấp mã hóa AI từ thanh menu macOS của bạn.", "nav.primary": "Sơ đẳng", "nav.language": "Ngôn ngữ", "nav.docs": "Tài liệu", @@ -1652,7 +1652,7 @@ export const localeMessages = { "hero.description": "CodexBar theo dõi khoảng thời gian sử dụng, số dư tín dụng và đếm ngược đặt lại trên các nhà cung cấp mà bạn thực sự thanh toán — mỗi mục một trạng thái hoặc hợp nhất chúng thành một.", "hero.download": "Tải xuống cho macOS", "hero.fineprint": "Miễn phí và nguồn mở · macOS 14+ · Bản universal qua GitHub Releases và Homebrew", - "providers.title": "63 nhà cung cấp,{mobileBreak}một thanh menu", + "providers.title": "64 nhà cung cấp,{mobileBreak}một thanh menu", "providers.description": "Các nhà cung cấp phổ biến trở thành các mục trạng thái với cửa sổ sử dụng của riêng họ, đặt lại bộ đếm ngược, biểu đồ và menu nhà cung cấp.", "providers.yourProvider": "Nhà cung cấp của bạn", "providers.authoringGuide": "Hướng dẫn soạn thảo", @@ -1778,8 +1778,8 @@ export const localeMessages = { }, "nl": { "meta.title": "CodexBar — elke AI-coderingslimiet in uw menubalk", - "meta.description": "Een kleine macOS menubalk-app die gebruiksperioden, tegoeden, kosten en resets van AI-coderingsproviders bijhoudt bij 63 providers: Codex, OpenAI, Claude, Cursor, Gemini, Copilot, LiteLLM en meer.", - "meta.ogDescription": "Houd gebruiksvensters, tegoeden en resets bij van 63 leveranciers van AI-codering via uw macOS-menubalk.", + "meta.description": "Een kleine macOS menubalk-app die gebruiksperioden, tegoeden, kosten en resets van AI-coderingsproviders bijhoudt bij 64 providers: Codex, OpenAI, Claude, Cursor, Gemini, Copilot, LiteLLM en meer.", + "meta.ogDescription": "Houd gebruiksvensters, tegoeden en resets bij van 64 leveranciers van AI-codering via uw macOS-menubalk.", "nav.primary": "Primair", "nav.language": "Taal", "nav.docs": "Documenten", @@ -1792,7 +1792,7 @@ export const localeMessages = { "hero.description": "CodexBar houdt gebruiksperioden, tegoeden en reset-countdowns bij voor de providers waarvoor u daadwerkelijk betaalt: elk één statusitem, of u kunt ze samenvoegen tot één statusitem.", "hero.download": "Downloaden voor macOS", "hero.fineprint": "Gratis en open source · macOS 14+ · Universeel via GitHub Releases en Homebrew", - "providers.title": "63 providers,{mobileBreak}één menubalk", + "providers.title": "64 providers,{mobileBreak}één menubalk", "providers.description": "Populaire providers worden statusitems met hun eigen gebruiksvensters, resetcountdowns, grafieken en providermenu's.", "providers.yourProvider": "Uw aanbieder", "providers.authoringGuide": "Handleiding voor het schrijven", @@ -1918,8 +1918,8 @@ export const localeMessages = { }, "tr": { "meta.title": "CodexBar — menü çubuğunuzdaki tüm AI kodlama limitleri", - "meta.description": "AI kodlama sağlayıcısı kullanım pencerelerini, kredilerini, maliyetlerini izleyen ve Codex, OpenAI, Claude, Cursor, Gemini, Copilot, LiteLLM ve daha fazlası olmak üzere 63 sağlayıcı genelinde sıfırlamaları izleyen küçük bir macOS menü çubuğu uygulaması.", - "meta.ogDescription": "macOS menü çubuğunu kullanarak 63 AI kodlama sağlayıcısındaki kullanım pencerelerini, kredileri ve sıfırlamaları izleyin.", + "meta.description": "AI kodlama sağlayıcısı kullanım pencerelerini, kredilerini, maliyetlerini izleyen ve Codex, OpenAI, Claude, Cursor, Gemini, Copilot, LiteLLM ve daha fazlası olmak üzere 64 sağlayıcı genelinde sıfırlamaları izleyen küçük bir macOS menü çubuğu uygulaması.", + "meta.ogDescription": "macOS menü çubuğunu kullanarak 64 AI kodlama sağlayıcısındaki kullanım pencerelerini, kredileri ve sıfırlamaları izleyin.", "nav.primary": "Öncelik", "nav.language": "Dil", "nav.docs": "Dokümanlar", @@ -1932,7 +1932,7 @@ export const localeMessages = { "hero.description": "CodexBar, gerçekte ödeme yaptığınız sağlayıcılar genelinde kullanım pencerelerini, kredi bakiyelerini ve geri sayımları sıfırlar (her biri bir durum öğesi olacak şekilde) izler veya bunları tek bir öğede birleştirir.", "hero.download": "macOS için indirin", "hero.fineprint": "Ücretsiz ve açık kaynak · macOS 14+ · GitHub Releases ve Homebrew ile evrensel sürüm", - "providers.title": "63 sağlayıcı,{mobileBreak}bir menü çubuğu", + "providers.title": "64 sağlayıcı,{mobileBreak}bir menü çubuğu", "providers.description": "Popüler sağlayıcılar, kendi kullanım pencereleri, sıfırlama geri sayımları, çizelgeleri ve sağlayıcı menüleriyle durum öğeleri haline gelir.", "providers.yourProvider": "Sağlayıcınız", "providers.authoringGuide": "Yazma kılavuzu", @@ -2058,8 +2058,8 @@ export const localeMessages = { }, "uk": { "meta.title": "CodexBar — кожне обмеження кодування AI у вашій панелі меню", - "meta.description": "Маленький додаток macOS на панелі меню, який відстежує вікна використання постачальників кодування штучного інтелекту, кредити, витрати та скидання 63 постачальників — Codex, OpenAI, Claude, Cursor, Gemini, Copilot, LiteLLM тощо.", - "meta.ogDescription": "Відстежуйте вікна використання, кредити та скидання 63 постачальників кодування ШІ за допомогою панелі меню macOS.", + "meta.description": "Маленький додаток macOS на панелі меню, який відстежує вікна використання постачальників кодування штучного інтелекту, кредити, витрати та скидання 64 постачальників — Codex, OpenAI, Claude, Cursor, Gemini, Copilot, LiteLLM тощо.", + "meta.ogDescription": "Відстежуйте вікна використання, кредити та скидання 64 постачальників кодування ШІ за допомогою панелі меню macOS.", "nav.primary": "Первинний", "nav.language": "Мова", "nav.docs": "документи", @@ -2072,7 +2072,7 @@ export const localeMessages = { "hero.description": "CodexBar відстежує вікна використання, кредитні баланси та скидає зворотний відлік для постачальників, за яких ви фактично платите, — по одному статусу для кожного або об’єднує їх в один.", "hero.download": "Завантажити для macOS", "hero.fineprint": "Безкоштовний і відкритий код · macOS 14+ · Універсальна версія через GitHub Releases і Homebrew", - "providers.title": "63 провайдерів,{mobileBreak}одна панель меню", + "providers.title": "64 провайдерів,{mobileBreak}одна панель меню", "providers.description": "Популярні постачальники стають елементами статусу з власними вікнами використання, скиданням зворотного відліку, діаграмами та меню постачальників.", "providers.yourProvider": "Ваш провайдер", "providers.authoringGuide": "Авторський посібник", @@ -2198,8 +2198,8 @@ export const localeMessages = { }, "ru": { "meta.title": "CodexBar — все лимиты AI-кодинга в вашей строке меню", - "meta.description": "Небольшое приложение для строки меню macOS, которое отслеживает окна использования, кредиты, расходы и сбросы лимитов у 63 AI-провайдеров для кодинга — Codex, OpenAI, Claude, Cursor, Gemini, Copilot, LiteLLM и других.", - "meta.ogDescription": "Отслеживайте окна использования, кредиты и сбросы лимитов у 63 AI-провайдеров для кодинга прямо из строки меню macOS.", + "meta.description": "Небольшое приложение для строки меню macOS, которое отслеживает окна использования, кредиты, расходы и сбросы лимитов у 64 AI-провайдеров для кодинга — Codex, OpenAI, Claude, Cursor, Gemini, Copilot, LiteLLM и других.", + "meta.ogDescription": "Отслеживайте окна использования, кредиты и сбросы лимитов у 64 AI-провайдеров для кодинга прямо из строки меню macOS.", "nav.primary": "Основная навигация", "nav.language": "Язык", "nav.docs": "Документация", @@ -2212,7 +2212,7 @@ export const localeMessages = { "hero.description": "CodexBar отслеживает окна использования, балансы кредитов и обратный отсчет до сброса у провайдеров, за которых вы действительно платите, — по одному элементу статуса на каждого или все вместе в одном.", "hero.download": "Скачать для macOS", "hero.fineprint": "Бесплатно и с открытым исходным кодом · macOS 14+ · универсальная сборка через GitHub Releases и Homebrew", - "providers.title": "63 провайдеров,{mobileBreak}одна строка меню", + "providers.title": "64 провайдеров,{mobileBreak}одна строка меню", "providers.description": "Популярные провайдеры становятся элементами статуса со своими окнами использования, обратным отсчетом до сброса, графиками и меню провайдера.", "providers.yourProvider": "Ваш провайдер", "providers.authoringGuide": "Руководство по добавлению", @@ -2338,8 +2338,8 @@ export const localeMessages = { }, "id": { "meta.title": "CodexBar — setiap batas pengkodean AI di bilah menu Anda", - "meta.description": "Aplikasi bilah menu macOS kecil yang melacak periode penggunaan, kredit, biaya, dan penyetelan ulang penyedia pengkodean AI di 63 penyedia — Codex, OpenAI, Claude, Cursor, Gemini, Copilot, LiteLLM, dan banyak lagi.", - "meta.ogDescription": "Lacak jangka waktu penggunaan, kredit, dan penyetelan ulang di 63 penyedia pengkodean AI dari bilah menu macOS Anda.", + "meta.description": "Aplikasi bilah menu macOS kecil yang melacak periode penggunaan, kredit, biaya, dan penyetelan ulang penyedia pengkodean AI di 64 penyedia — Codex, OpenAI, Claude, Cursor, Gemini, Copilot, LiteLLM, dan banyak lagi.", + "meta.ogDescription": "Lacak jangka waktu penggunaan, kredit, dan penyetelan ulang di 64 penyedia pengkodean AI dari bilah menu macOS Anda.", "nav.primary": "Utama", "nav.language": "Bahasa", "nav.docs": "dokumen", @@ -2352,7 +2352,7 @@ export const localeMessages = { "hero.description": "CodexBar melacak jangka waktu penggunaan, saldo kredit, dan hitungan mundur penyetelan ulang di seluruh penyedia yang sebenarnya Anda bayar — masing-masing satu item status, atau gabungkan menjadi satu.", "hero.download": "Unduh untuk macOS", "hero.fineprint": "Gratis dan sumber terbuka · macOS 14+ · Universal melalui GitHub Releases dan Homebrew", - "providers.title": "63 penyedia,{mobileBreak}satu bilah menu", + "providers.title": "64 penyedia,{mobileBreak}satu bilah menu", "providers.description": "Penyedia populer menjadi item status dengan jendela penggunaannya sendiri, hitung mundur pengaturan ulang, bagan, dan menu penyedia.", "providers.yourProvider": "Penyedia Anda", "providers.authoringGuide": "Panduan penulisan", @@ -2478,8 +2478,8 @@ export const localeMessages = { }, "pl": { "meta.title": "CodexBar — każdy limit kodowania AI na pasku menu", - "meta.description": "Mała aplikacja z paskiem menu macOS, która śledzi okna użycia dostawcy kodowania AI, kredyty, koszty i resety u 63 dostawców — Codex, OpenAI, Claude, Cursor, Gemini, Copilot, LiteLLM i nie tylko.", - "meta.ogDescription": "Śledź okresy użytkowania, kredyty i resety u 63 dostawców kodowania AI za pomocą paska menu macOS.", + "meta.description": "Mała aplikacja z paskiem menu macOS, która śledzi okna użycia dostawcy kodowania AI, kredyty, koszty i resety u 64 dostawców — Codex, OpenAI, Claude, Cursor, Gemini, Copilot, LiteLLM i nie tylko.", + "meta.ogDescription": "Śledź okresy użytkowania, kredyty i resety u 64 dostawców kodowania AI za pomocą paska menu macOS.", "nav.primary": "Podstawowy", "nav.language": "Język", "nav.docs": "Dokumenty", @@ -2492,7 +2492,7 @@ export const localeMessages = { "hero.description": "CodexBar śledzi okna użytkowania, salda kredytów i resetuje odliczanie u dostawców, za których faktycznie płacisz — po jednym statusie dla każdego lub połącz je w jeden.", "hero.download": "Pobierz dla macOS", "hero.fineprint": "Darmowe i otwarte oprogramowanie · macOS 14+ · Wersja uniwersalna przez GitHub Releases i Homebrew", - "providers.title": "63 dostawców,{mobileBreak}jeden pasek menu", + "providers.title": "64 dostawców,{mobileBreak}jeden pasek menu", "providers.description": "Popularni dostawcy stają się elementami statusu z własnymi oknami użytkowania, resetowaniem odliczania, wykresami i menu dostawców.", "providers.yourProvider": "Twój dostawca", "providers.authoringGuide": "Przewodnik autorski", @@ -2618,8 +2618,8 @@ export const localeMessages = { }, "fa": { "meta.title": "CodexBar - هر محدودیت کدنویسی هوش مصنوعی در نوار منو شما", - "meta.description": "یک برنامه نوار منو کوچک macOS که پنجرههای استفاده از ارائهدهنده کدنویسی هوش مصنوعی، اعتبارات، هزینهها، و بازنشانی را در بین 63 ارائهدهنده - Codex، OpenAI، Claude، Cursor، Gemini، Copilot، LiteLLM و موارد دیگر بازنشانی میکند.", - "meta.ogDescription": "پنجرههای استفاده، اعتبارات و بازنشانیها را در بین 63 ارائهدهنده کدنویسی هوش مصنوعی از نوار منوی macOS خود ردیابی کنید.", + "meta.description": "یک برنامه نوار منو کوچک macOS که پنجرههای استفاده از ارائهدهنده کدنویسی هوش مصنوعی، اعتبارات، هزینهها، و بازنشانی را در بین 64 ارائهدهنده - Codex، OpenAI، Claude، Cursor، Gemini، Copilot، LiteLLM و موارد دیگر بازنشانی میکند.", + "meta.ogDescription": "پنجرههای استفاده، اعتبارات و بازنشانیها را در بین 64 ارائهدهنده کدنویسی هوش مصنوعی از نوار منوی macOS خود ردیابی کنید.", "nav.primary": "اولیه", "nav.language": "زبان", "nav.docs": "اسناد", @@ -2632,7 +2632,7 @@ export const localeMessages = { "hero.description": "CodexBar پنجرههای استفاده، مانده اعتبار و بازنشانی شمارش معکوس را در سراسر ارائهدهندگانی که واقعاً برایشان پول پرداخت میکنید ردیابی میکند - هر کدام یک مورد وضعیت، یا آنها را در یکی ادغام کنید.", "hero.download": "دانلود برای macOS", "hero.fineprint": "رایگان و متنباز · macOS 14+ · نسخهٔ یونیورسال از GitHub Releases و Homebrew", - "providers.title": "63 ارائه دهنده،{mobileBreak}یک نوار منو", + "providers.title": "64 ارائه دهنده،{mobileBreak}یک نوار منو", "providers.description": "ارائهدهندگان محبوب با پنجرههای استفاده خاص خود، شمارش معکوس، نمودارها و منوهای ارائهدهنده را بازنشانی میکنند.", "providers.yourProvider": "ارائه دهنده شما", "providers.authoringGuide": "راهنمای نگارش", @@ -2758,8 +2758,8 @@ export const localeMessages = { }, "th": { "meta.title": "CodexBar — ทุกขีดจำกัดการเข้ารหัส AI ในแถบเมนูของคุณ", - "meta.description": "แอปแถบเมนู macOS ขนาดเล็กที่ติดตามกรอบเวลาการใช้งานของผู้ให้บริการเข้ารหัส AI เครดิต ต้นทุน และการรีเซ็ตในผู้ให้บริการ 63 ราย — Codex, OpenAI, Claude, Cursor, Gemini, Copilot, LiteLLM และอีกมากมาย", - "meta.ogDescription": "ติดตามกรอบเวลาการใช้งาน เครดิต และการรีเซ็ตในผู้ให้บริการการเข้ารหัส AI 63 รายจากแถบเมนู macOS", + "meta.description": "แอปแถบเมนู macOS ขนาดเล็กที่ติดตามกรอบเวลาการใช้งานของผู้ให้บริการเข้ารหัส AI เครดิต ต้นทุน และการรีเซ็ตในผู้ให้บริการ 64 ราย — Codex, OpenAI, Claude, Cursor, Gemini, Copilot, LiteLLM และอีกมากมาย", + "meta.ogDescription": "ติดตามกรอบเวลาการใช้งาน เครดิต และการรีเซ็ตในผู้ให้บริการการเข้ารหัส AI 64 รายจากแถบเมนู macOS", "nav.primary": "หลัก", "nav.language": "ภาษา", "nav.docs": "เอกสาร", @@ -2772,7 +2772,7 @@ export const localeMessages = { "hero.description": "CodexBar ติดตามกรอบเวลาการใช้งาน ยอดเครดิต และรีเซ็ตการนับถอยหลังของผู้ให้บริการที่คุณชำระเงินจริง — รายการสถานะแต่ละรายการ หรือรวมรายการเหล่านั้นเป็นรายการเดียว", "hero.download": "ดาวน์โหลดสำหรับ macOS", "hero.fineprint": "ฟรีและโอเพ่นซอร์ส · macOS 14+ · รุ่น Universal ผ่าน GitHub Releases และ Homebrew", - "providers.title": "ผู้ให้บริการ 63 ราย{mobileBreak}หนึ่งแถบเมนู", + "providers.title": "ผู้ให้บริการ 64 ราย{mobileBreak}หนึ่งแถบเมนู", "providers.description": "ผู้ให้บริการยอดนิยมจะกลายเป็นรายการสถานะที่มีหน้าต่างการใช้งานของตนเอง รีเซ็ตการนับถอยหลัง แผนภูมิ และเมนูของผู้ให้บริการ", "providers.yourProvider": "ผู้ให้บริการของคุณ", "providers.authoringGuide": "คู่มือการเขียน", @@ -2898,8 +2898,8 @@ export const localeMessages = { }, "gl": { "meta.title": "CodexBar — todos os límites de programación con IA na túa barra de menús", - "meta.description": "Unha pequena aplicación de barra de menús para macOS que controla as xanelas de uso, os créditos, os custos e os restablecementos de 63 provedores de programación con IA — Codex, OpenAI, Claude, Cursor, Gemini, Copilot, LiteLLM e máis.", - "meta.ogDescription": "Controla as xanelas de uso, os créditos e os restablecementos de 63 provedores de programación con IA desde a barra de menús de macOS.", + "meta.description": "Unha pequena aplicación de barra de menús para macOS que controla as xanelas de uso, os créditos, os custos e os restablecementos de 64 provedores de programación con IA — Codex, OpenAI, Claude, Cursor, Gemini, Copilot, LiteLLM e máis.", + "meta.ogDescription": "Controla as xanelas de uso, os créditos e os restablecementos de 64 provedores de programación con IA desde a barra de menús de macOS.", "nav.primary": "Principal", "nav.language": "Idioma", "nav.docs": "Documentación", @@ -2912,7 +2912,7 @@ export const localeMessages = { "hero.description": "CodexBar controla as xanelas de uso, os saldos de crédito e as contas atrás ata o restablecemento dos provedores polos que realmente pagas — un elemento de estado para cada un ou todos combinados nun só.", "hero.download": "Descargar para macOS", "hero.fineprint": "Gratuíto e de código aberto · macOS 14+ · Universal mediante GitHub Releases e Homebrew", - "providers.title": "63 provedores,{mobileBreak}unha barra de menús", + "providers.title": "64 provedores,{mobileBreak}unha barra de menús", "providers.description": "Os provedores populares convértense en elementos de estado coas súas propias xanelas de uso, contas atrás de restablecemento, gráficas e menús.", "providers.yourProvider": "O teu provedor", "providers.authoringGuide": "Guía de creación", @@ -3038,8 +3038,8 @@ export const localeMessages = { }, "ca": { "meta.title": "CodexBar: tots els límits de la programació amb IA a la barra de menús", - "meta.description": "Una petita aplicació de barra de menús per a macOS que fa un seguiment de les finestres d'ús, els crèdits, els costos i els restabliments dels proveïdors de programació amb IA: 63 proveïdors, entre els quals Codex, OpenAI, Claude, Cursor, Gemini, Copilot, LiteLLM i més.", - "meta.ogDescription": "Feu el seguiment de les finestres d'ús, els crèdits i els restabliments de 63 proveïdors de programació amb IA des de la barra de menús del macOS.", + "meta.description": "Una petita aplicació de barra de menús per a macOS que fa un seguiment de les finestres d'ús, els crèdits, els costos i els restabliments dels proveïdors de programació amb IA: 64 proveïdors, entre els quals Codex, OpenAI, Claude, Cursor, Gemini, Copilot, LiteLLM i més.", + "meta.ogDescription": "Feu el seguiment de les finestres d'ús, els crèdits i els restabliments de 64 proveïdors de programació amb IA des de la barra de menús del macOS.", "nav.primary": "Navegació principal", "nav.language": "Llengua", "nav.docs": "Documentació", @@ -3052,7 +3052,7 @@ export const localeMessages = { "hero.description": "El CodexBar fa el seguiment de les finestres d'ús, els saldos de crèdit i els comptes enrere fins al restabliment dels proveïdors pels quals realment pagueu: un element d'estat per a cadascun, o combineu-los tots en un de sol.", "hero.download": "Baixeu per al macOS", "hero.fineprint": "Gratuït i de codi obert · macOS 14+ · Universal mitjançant GitHub Releases i Homebrew", - "providers.title": "63 proveïdors,{mobileBreak}una barra de menús", + "providers.title": "64 proveïdors,{mobileBreak}una barra de menús", "providers.description": "Els proveïdors populars es converteixen en elements d'estat amb les seves pròpies finestres d'ús, comptes enrere de restabliment, gràfics i menús de proveïdor.", "providers.yourProvider": "El vostre proveïdor", "providers.authoringGuide": "Guia de creació", @@ -3178,8 +3178,8 @@ export const localeMessages = { }, "sv": { "meta.title": "CodexBar — varje AI-kodningsgräns i din menyrad", - "meta.description": "En liten macOS menyradsapp som spårar AI-kodningsleverantörers användningsfönster, krediter, kostnader och återställningar hos 63 leverantörer – Codex, OpenAI, Claude, Cursor, Gemini, Copilot, LiteLLM och mer.", - "meta.ogDescription": "Spåra användningsfönster, krediter och återställningar hos 63 AI-kodningsleverantörer från din macOS-menyrad.", + "meta.description": "En liten macOS menyradsapp som spårar AI-kodningsleverantörers användningsfönster, krediter, kostnader och återställningar hos 64 leverantörer – Codex, OpenAI, Claude, Cursor, Gemini, Copilot, LiteLLM och mer.", + "meta.ogDescription": "Spåra användningsfönster, krediter och återställningar hos 64 AI-kodningsleverantörer från din macOS-menyrad.", "nav.primary": "Primär", "nav.language": "Språk", "nav.docs": "Dokument", @@ -3192,7 +3192,7 @@ export const localeMessages = { "hero.description": "CodexBar spårar användningsfönster, kreditsaldon och återställningsnedräkningar för de leverantörer du faktiskt betalar för – en statuspost var, eller slå samman dem till en.", "hero.download": "Ladda ner för macOS", "hero.fineprint": "Gratis och öppen källkod · macOS 14+ · Universal via GitHub Releases och Homebrew", - "providers.title": "63 leverantörer,{mobileBreak}en menyrad", + "providers.title": "64 leverantörer,{mobileBreak}en menyrad", "providers.description": "Populära leverantörer blir statusobjekt med sina egna användningsfönster, återställer nedräkningar, diagram och leverantörsmenyer.", "providers.yourProvider": "Din leverantör", "providers.authoringGuide": "Författarguide", diff --git a/docs/social.html b/docs/social.html index acbb6291c0..a62990619e 100644 --- a/docs/social.html +++ b/docs/social.html @@ -199,7 +199,7 @@
63 providers·usage windows, credits, resets·one status item each, or merged.
+64 providers·usage windows, credits, resets·one status item each, or merged.