From 8abd538e329ccb753b91d4d20ba46c739ac7b5cf Mon Sep 17 00:00:00 2001 From: binyangzhu000-sudo <224954946+binyangzhu000-sudo@users.noreply.github.com> Date: Fri, 31 Jul 2026 18:22:22 +0800 Subject: [PATCH] feat: add Atlas Cloud provider preset Signed-off-by: binyangzhu000-sudo <224954946+binyangzhu000-sudo@users.noreply.github.com> --- src/ai-providers/model-semantics.ts | 12 +++++++++ src/ai-providers/preset-catalog.spec.ts | 17 +++++++++++++ src/ai-providers/preset-catalog.ts | 34 +++++++++++++++++++++++++ 3 files changed, 63 insertions(+) diff --git a/src/ai-providers/model-semantics.ts b/src/ai-providers/model-semantics.ts index 02c9c4fe5..6c00b2c92 100644 --- a/src/ai-providers/model-semantics.ts +++ b/src/ai-providers/model-semantics.ts @@ -244,6 +244,18 @@ export const MODEL_SEMANTICS_BY_VENDOR: Registry = { }, }, }, + 'atlas-cloud': { + 'deepseek-ai/deepseek-v4-pro': { + contextWindow: 1_000_000, + maxOutputTokens: 384_000, + reasoning: { + mode: 'optional', + efforts: ['high', 'max'], + defaultEffort: 'high', + interleaved: true, + }, + }, + }, longcat: { 'LongCat-2.0': { maxOutputTokens: 131_072, diff --git a/src/ai-providers/preset-catalog.spec.ts b/src/ai-providers/preset-catalog.spec.ts index 4951ae6c8..249699144 100644 --- a/src/ai-providers/preset-catalog.spec.ts +++ b/src/ai-providers/preset-catalog.spec.ts @@ -1,6 +1,7 @@ import { describe, expect, it } from 'vitest'; import { + ATLAS_CLOUD, CLAUDE_API, CLAUDE_OAUTH, CODEX_API, @@ -23,6 +24,21 @@ describe('LONGCAT preset', () => { }); }); +describe('ATLAS_CLOUD preset', () => { + it('uses the versioned OpenAI-compatible endpoint and nested model id', () => { + expect(ATLAS_CLOUD.regions?.[0]?.wires['openai-chat']).toBe('https://api.atlascloud.ai/v1'); + const parsed = ATLAS_CLOUD.zodSchema.parse({ + backend: 'vercel-ai-sdk', + provider: 'openai-compatible', + apiKey: 'test-key', + }) as { baseUrl?: string; model?: string }; + expect(parsed).toMatchObject({ + baseUrl: 'https://api.atlascloud.ai/v1', + model: 'deepseek-ai/deepseek-v4-pro', + }); + }); +}); + describe('credential form catalog', () => { it('uses native Claude Code aliases for subscription profiles', () => { expect(CLAUDE_OAUTH.models?.map((model) => model.id)).toEqual([ @@ -106,6 +122,7 @@ describe('credential form catalog', () => { kimi: 'kimi', deepseek: 'deepseek', longcat: 'longcat', + 'atlas-cloud': 'atlas-cloud', }; for (const [presetId, vendor] of Object.entries(vendorByPreset)) { diff --git a/src/ai-providers/preset-catalog.ts b/src/ai-providers/preset-catalog.ts index 25ac2e6d1..65c96bbae 100644 --- a/src/ai-providers/preset-catalog.ts +++ b/src/ai-providers/preset-catalog.ts @@ -415,6 +415,38 @@ export const LONGCAT: PresetDef = { writeOnlyFields: ['apiKey'], } +// ==================== Third-party: Atlas Cloud ==================== + +export const ATLAS_CLOUD: PresetDef = { + id: 'atlas-cloud', + label: 'Atlas Cloud', + description: 'Atlas Cloud models via its OpenAI-compatible API', + category: 'third-party', + defaultName: 'Atlas Cloud', + hint: 'Uses Atlas Cloud\'s OpenAI-compatible Chat Completions endpoint. This credential can drive OpenCode and Pi.', + zodSchema: z.object({ + backend: z.literal('vercel-ai-sdk'), + provider: z.literal('openai-compatible'), + baseUrl: z.string().default('https://api.atlascloud.ai/v1').describe('API endpoint'), + model: z.string().default('deepseek-ai/deepseek-v4-pro').describe('Model'), + apiKey: z.string().min(1).describe('Atlas Cloud API key'), + }), + regions: [{ + id: 'default', + label: 'Atlas Cloud (api.atlascloud.ai)', + wires: { 'openai-chat': 'https://api.atlascloud.ai/v1' }, + }], + models: withModelSemantics('atlas-cloud', [ + { id: 'deepseek-ai/deepseek-v4-pro', label: 'DeepSeek V4 Pro' }, + ]), + setup: { + apiKeyLabel: 'Atlas Cloud API key', + apiKeyHelp: 'Use an API key from the Atlas Cloud console.', + modelHelp: 'Choose a model available to the key, or paste another exact Atlas Cloud model ID.', + }, + writeOnlyFields: ['apiKey'], +} + // ==================== Custom ==================== export const CUSTOM: PresetDef = { @@ -453,6 +485,7 @@ export const PRESET_CATALOG: PresetDef[] = [ KIMI, DEEPSEEK, LONGCAT, + ATLAS_CLOUD, GEMINI, CUSTOM, ] @@ -475,4 +508,5 @@ export const DEFAULT_MODEL_BY_VENDOR: Record = { kimi: 'kimi-k2.7-code', deepseek: 'deepseek-v4-pro', longcat: 'LongCat-2.0', + 'atlas-cloud': 'deepseek-ai/deepseek-v4-pro', }