feat(providers): add Cline free-tier models and sync Freebuff catalog

- Cline: 6 free models, cline-cli product headers, API-key auth,
  {data} envelope unwrap, workos: prefix handling
- Freebuff: muse-spark 1.3 → 1.2 (upstream withdrawal 2026-09-07),
  DeepSeek V4.1 Flash rename
This commit is contained in:
MUH. IQRAM BAHRING committed 2026-09-11 12:21:35 +08:00
1 parent 8b34cfaa44
commit b0505067b2
16 files changed
+319 -64

No files matched your search

+8 -3
View File
@@ -25,8 +25,13 @@ function setAuth(headers, spec, token) {
// Resolve auth onto headers from a descriptor.
function applyAuth(headers, desc, credentials) {
if (desc.combined) {
// combined providers always set the header (legacy behavior, incl. noAuth → "Bearer undefined")
setAuth(headers, desc, credentials.apiKey || credentials.accessToken);
// combined providers always set the header (legacy behavior, incl. noAuth → "Bearer undefined") —
// unless the descriptor opts into preserveHookAuth: a hook then owns the
// Authorization value (e.g. Cline needs workos:-prefixed OAuth tokens but
// plain API keys, which a single merged token can't express).
if (!(desc.preserveHookAuth && headers[desc.header])) {
setAuth(headers, desc, credentials.apiKey || credentials.accessToken);
}
if (desc.anthropicVersion && !headers["anthropic-version"]) headers["anthropic-version"] = ANTHROPIC_API_VERSION;
return;
}
@@ -40,7 +45,7 @@ function applyAuth(headers, desc, credentials) {
const HEADER_HOOKS = {
// Stable device_id from OAuth connection (CLIProxyAPI KimiTokenStorage.DeviceID)
kimiHeaders: (h, c) => Object.assign(h, buildKimiHeaders(c?.providerSpecificData?.deviceId)),
clineHeaders: (h, c) => Object.assign(h, buildClineHeaders(c.apiKey || c.accessToken)),
clineHeaders: (h, c) => Object.assign(h, buildClineHeaders(c.apiKey || c.accessToken, {}, { isApiKey: !!c.apiKey })),
kilocodeOrg: (h, c) => { if (c.providerSpecificData?.orgId) h["X-Kilocode-OrganizationID"] = c.providerSpecificData.orgId; },
};