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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -164,4 +164,42 @@ describe('non-subscription account creation', () => {
),
);
});

it.each([
['stepfun-global', 'https://api.stepfun.ai/v1'],
['stepfun-cn', 'https://api.stepfun.com/v1'],
['stepfun-plan-global', 'https://api.stepfun.ai/step_plan/v1'],
['stepfun-plan-cn', 'https://api.stepfun.com/step_plan/v1'],
] as const)(
'creates the %s account with its OpenAI-compatible endpoint',
async (service, baseUrl) => {
const onSubmit = vi.fn();
const { container } = render(
<AddAccountForm
serviceId={service}
runtimes={undefined}
onboarding={onboarding()}
busy={false}
onBack={vi.fn()}
onSubmit={onSubmit}
/>,
);

const secret = container.querySelector('input[type="password"]');
if (!secret) throw new Error('credential input missing');
fireEvent.change(secret, { target: { value: 'step-test-key' } });
fireEvent.click(screen.getByRole('button', { name: 'form.submit' }));

await waitFor(() =>
expect(onSubmit).toHaveBeenCalledWith(
expect.objectContaining({
service,
endpoint: { baseUrl, protocol: 'openai-chat' },
credential: { type: 'api-key', key: 'step-test-key' },
}),
),
);
expect(onSubmit.mock.calls[0]?.[0]).not.toHaveProperty('model');
},
);
});
56 changes: 56 additions & 0 deletions packages/client/workbench/src/settings/providers/catalog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,34 @@ export type ServiceDescriptor =
export const SERVICE_CATALOG: ServiceDescriptor[] = [
{ id: 'claude-sub', label: 'Claude', group: 'subscription', kind: 'oauth', agent: 'claude-code' },
{ id: 'chatgpt-sub', label: 'ChatGPT', group: 'subscription', kind: 'oauth', agent: 'codex' },
{
id: 'stepfun-plan-global',
label: 'StepFun Plan Global',
group: 'subscription',
kind: 'endpoint',
variants: [
{
id: 'default',
protocol: 'openai-chat',
baseUrl: 'https://api.stepfun.ai/step_plan/v1',
credentialType: 'api-key',
},
],
},
{
id: 'stepfun-plan-cn',
label: 'StepFun Plan China',
group: 'subscription',
kind: 'endpoint',
variants: [
{
id: 'default',
protocol: 'openai-chat',
baseUrl: 'https://api.stepfun.com/step_plan/v1',
credentialType: 'api-key',
},
],
},
{
id: 'anthropic-api',
label: 'Anthropic API',
Expand Down Expand Up @@ -90,6 +118,34 @@ export const SERVICE_CATALOG: ServiceDescriptor[] = [
],
secretPlaceholder: 'xai-…',
},
{
id: 'stepfun-global',
label: 'StepFun Global',
group: 'direct',
kind: 'endpoint',
variants: [
{
id: 'default',
protocol: 'openai-chat',
baseUrl: 'https://api.stepfun.ai/v1',
credentialType: 'api-key',
},
],
},
{
id: 'stepfun-cn',
label: 'StepFun China',
group: 'direct',
kind: 'endpoint',
variants: [
{
id: 'default',
protocol: 'openai-chat',
baseUrl: 'https://api.stepfun.com/v1',
credentialType: 'api-key',
},
],
},
{
id: 'openrouter',
label: 'OpenRouter',
Expand Down
8 changes: 8 additions & 0 deletions packages/presentation/i18n/src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1057,9 +1057,13 @@ export const en = {
serviceName: {
'claude-sub': 'Claude subscription',
'chatgpt-sub': 'ChatGPT subscription',
'stepfun-plan-global': 'StepFun Plan (Global)',
'stepfun-plan-cn': 'StepFun Plan (China)',
'anthropic-api': 'Anthropic API',
'openai-api': 'OpenAI API',
xai: 'xAI (Grok)',
'stepfun-global': 'StepFun API (Global)',
'stepfun-cn': 'StepFun API (China)',
openrouter: 'OpenRouter',
'vercel-gateway': 'Vercel AI Gateway',
'cloudflare-gateway': 'Cloudflare AI Gateway',
Expand All @@ -1068,9 +1072,13 @@ export const en = {
serviceHint: {
'claude-sub': 'Claude Code login, Pro / Max plans',
'chatgpt-sub': 'Codex login, Plus / Pro plans',
'stepfun-plan-global': 'Step Plan subscription, api.stepfun.ai',
'stepfun-plan-cn': 'Step Plan subscription, api.stepfun.com',
'anthropic-api': 'A key from console.anthropic.com',
'openai-api': 'A key from platform.openai.com',
xai: 'A key from console.x.ai, OpenAI-compatible',
'stepfun-global': 'Direct API billing, api.stepfun.ai',
'stepfun-cn': 'Direct API billing, api.stepfun.com',
openrouter: 'Aggregation gateway, both protocol shapes',
'vercel-gateway': 'Server-side translation, both protocol shapes',
'cloudflare-gateway': 'Pass-through gateway, needs Account / Gateway ID',
Expand Down
8 changes: 8 additions & 0 deletions packages/presentation/i18n/src/locales/zh-cn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1031,9 +1031,13 @@ export const zhCN = {
serviceName: {
'claude-sub': 'Claude 订阅',
'chatgpt-sub': 'ChatGPT 订阅',
'stepfun-plan-global': '阶跃星辰 Step Plan(国际)',
'stepfun-plan-cn': '阶跃星辰 Step Plan(中国)',
'anthropic-api': 'Anthropic API',
'openai-api': 'OpenAI API',
xai: 'xAI(Grok)',
'stepfun-global': '阶跃星辰 API(国际)',
'stepfun-cn': '阶跃星辰 API(中国)',
openrouter: 'OpenRouter',
'vercel-gateway': 'Vercel AI Gateway',
'cloudflare-gateway': 'Cloudflare AI Gateway',
Expand All @@ -1042,9 +1046,13 @@ export const zhCN = {
serviceHint: {
'claude-sub': 'Claude Code 登录,Pro / Max 计划',
'chatgpt-sub': 'Codex 登录,Plus / Pro 计划',
'stepfun-plan-global': '国际站 Step Plan 订阅,api.stepfun.ai',
'stepfun-plan-cn': '中国站 Step Plan 订阅,api.stepfun.com',
'anthropic-api': 'console.anthropic.com 的密钥',
'openai-api': 'platform.openai.com 的密钥',
xai: 'console.x.ai 的密钥,OpenAI 兼容',
'stepfun-global': '国际站 API 直付,api.stepfun.ai',
'stepfun-cn': '中国站 API 直付,api.stepfun.com',
openrouter: '聚合网关,双协议形态',
'vercel-gateway': '服务端翻译,双协议形态',
'cloudflare-gateway': '透传网关,需 Account / Gateway ID',
Expand Down
Loading