feat: restructure command for Claude models and add new remote routes

- Deleted the old cc.ts command and created a new cc.ts under src/command/claude for better organization.
- Added support for a new model 'bailian' in the command.
- Implemented remote app connection status and connection routes in assistant/src/routes/remote/index.ts.
- Updated index.ts to reflect the new path for the cc command.
- Added a placeholder for future management of plugin operations in src/command/opencode/plugin.ts.
This commit is contained in:
2026-01-21 23:22:58 +08:00
parent a911334459
commit 028a6ac726
15 changed files with 469 additions and 276 deletions

View File

@@ -1,5 +1,5 @@
import { program, Command } from '@/program.ts';
import { chalk } from '../module/chalk.ts';
import { chalk } from '../../module/chalk.ts';
import path from 'node:path';
import { spawn } from 'node:child_process';
import { useKey } from '@kevisual/use-config';
@@ -7,7 +7,7 @@ import os from 'node:os'
import fs from 'node:fs';
import { select } from '@inquirer/prompts';
const MODELS = ['minimax', 'glm', 'volcengine'] as const;
const MODELS = ['minimax', 'glm', 'volcengine', 'bailian'] as const;
type Model = typeof MODELS[number];
const changeMinimax = (token?: string) => {
@@ -53,7 +53,20 @@ const changeVolcengine = (token?: string) => {
}
}
}
const changeBailian = (token?: string) => {
const auth_token = token || useKey('BAILIAN_API_KEY')
return {
"env": {
"ANTHROPIC_AUTH_TOKEN": auth_token,
"ANTHROPIC_BASE_URL": "https://coding.dashscope.aliyuncs.com/apps/anthropic",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "qwen3-coder-plus",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "qwen3-coder-plus",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "qwen3-coder-plus",
"ANTHROPIC_MODEL": "qwen3-coder-plus"
},
"includeCoAuthoredBy": false
}
}
/**
* ~/.claude.json "hasCompletedOnboarding": true
*/
@@ -83,6 +96,7 @@ const modelConfig: Record<Model, (token?: string) => object> = {
minimax: changeMinimax,
glm: changeGLM,
volcengine: changeVolcengine,
bailian: changeBailian,
};
const readOrCreateConfig = (configPath: string): Record<string, unknown> => {

View File

@@ -0,0 +1,2 @@
// TODO: 对 .opencode/plugin/agent.ts 的内容进行管理
// 例如添加、删除、列出等操作

View File

@@ -17,7 +17,7 @@ import './command/gist/index.ts';
import './command/config-remote.ts';
import './command/config-secret-remote.ts';
import './command/ai.ts';
import './command/cc.ts'
import './command/claude/cc.ts'
import './command/docker.ts';
// program.parse(process.argv);