@cloudbase/cli 2.8.1-beta.4 → 2.8.2-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/settings.local.json +6 -0
- package/lib/utils/ai/banner.js +2 -1
- package/lib/utils/ai/const.js +18 -4
- package/lib/utils/ai/nodeVersion.js +15 -0
- package/lib/utils/ai/router.js +51 -48
- package/lib/utils/ai/setup.js +41 -18
- package/package.json +1 -1
- package/types/utils/ai/config.d.ts +3 -3
- package/types/utils/ai/const.d.ts +32 -30
- package/types/utils/ai/nodeVersion.d.ts +2 -0
- package/types/utils/ai/router.d.ts +3 -1
- package/types/utils/ai/setup.d.ts +1 -0
- package/cloudbase-cli-2.7.8.tgz +0 -0
package/lib/utils/ai/banner.js
CHANGED
|
@@ -75,7 +75,8 @@ AI ToolKit`, {
|
|
|
75
75
|
log.log(' 🎯 无需运维,极速上线你的创意 💫');
|
|
76
76
|
}
|
|
77
77
|
log.log('');
|
|
78
|
-
log.log(
|
|
78
|
+
log.log('Beta 能力,如遇问题可创建 issue:');
|
|
79
|
+
log.log((0, output_1.genClickableLink)('https://cnb.cool/tencent/cloud/cloudbase/community/-/issues'));
|
|
79
80
|
log.log('');
|
|
80
81
|
}
|
|
81
82
|
catch (e) {
|
package/lib/utils/ai/const.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getDefaultModelByBaseUrl = exports.BASE_URL_MODEL_MAPPING = exports.getAgentConfigValidator = exports.getDefaultConfig = exports.CLOUDBASE_PROVIDERS = exports.AGENTS = exports.NONE = exports.AIDER = exports.CODEX = exports.QWEN = exports.CLAUDE = exports.DEFAULT_CONFIG = exports.CLOUDBASE_MCP_CONFIG_PATH = exports.CLAUDE_CODE_ROUTER_LOG_PATH = exports.CLAUDE_CODE_ROUTER_CONFIG_PATH = exports.ENV_LOCAL_PATH = exports.CONFIG_PATH = void 0;
|
|
6
|
+
exports.LIST_HINT = exports.getBooleanHint = exports.getDefaultModelByBaseUrl = exports.BASE_URL_MODEL_MAPPING = exports.getAgentConfigValidator = exports.getDefaultConfig = exports.CLOUDBASE_PROVIDERS = exports.AGENTS = exports.NONE = exports.AIDER = exports.CODEX = exports.QWEN = exports.CLAUDE = exports.DEFAULT_CONFIG = exports.CLOUDBASE_MCP_CONFIG_PATH = exports.CLAUDE_CODE_ROUTER_LOG_PATH = exports.CLAUDE_CODE_ROUTER_CONFIG_PATH = exports.ENV_LOCAL_PATH = exports.CONFIG_PATH = void 0;
|
|
7
7
|
const os_1 = __importDefault(require("os"));
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
9
|
const v3_1 = __importDefault(require("zod/v3"));
|
|
@@ -20,7 +20,7 @@ exports.CLAUDE = {
|
|
|
20
20
|
value: 'claude',
|
|
21
21
|
configSchema: v3_1.default
|
|
22
22
|
.object({
|
|
23
|
-
type: v3_1.default.enum(['custom', 'cloudbase']).optional(),
|
|
23
|
+
type: v3_1.default.enum(['custom', 'cloudbase', 'none']).optional(),
|
|
24
24
|
baseUrl: v3_1.default.string().optional(),
|
|
25
25
|
apiKey: v3_1.default.string().optional(),
|
|
26
26
|
provider: v3_1.default.string().optional(),
|
|
@@ -34,6 +34,9 @@ exports.CLAUDE = {
|
|
|
34
34
|
else if (data.type === 'cloudbase') {
|
|
35
35
|
return data.provider && data.model;
|
|
36
36
|
}
|
|
37
|
+
else if (data.type === 'none') {
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
37
40
|
return false;
|
|
38
41
|
})
|
|
39
42
|
};
|
|
@@ -42,7 +45,7 @@ exports.QWEN = {
|
|
|
42
45
|
value: 'qwen',
|
|
43
46
|
configSchema: v3_1.default
|
|
44
47
|
.object({
|
|
45
|
-
type: v3_1.default.enum(['custom', 'cloudbase']).optional(),
|
|
48
|
+
type: v3_1.default.enum(['custom', 'cloudbase', 'none']).optional(),
|
|
46
49
|
baseUrl: v3_1.default.string().optional(),
|
|
47
50
|
apiKey: v3_1.default.string().optional(),
|
|
48
51
|
provider: v3_1.default.string().optional(),
|
|
@@ -55,6 +58,9 @@ exports.QWEN = {
|
|
|
55
58
|
else if (data.type === 'cloudbase') {
|
|
56
59
|
return data.provider && data.model;
|
|
57
60
|
}
|
|
61
|
+
else if (data.type === 'none') {
|
|
62
|
+
return true;
|
|
63
|
+
}
|
|
58
64
|
return false;
|
|
59
65
|
})
|
|
60
66
|
};
|
|
@@ -63,7 +69,7 @@ exports.CODEX = {
|
|
|
63
69
|
value: 'codex',
|
|
64
70
|
configSchema: v3_1.default
|
|
65
71
|
.object({
|
|
66
|
-
type: v3_1.default.enum(['custom', 'cloudbase']).optional(),
|
|
72
|
+
type: v3_1.default.enum(['custom', 'cloudbase', 'none']).optional(),
|
|
67
73
|
baseUrl: v3_1.default.string().optional(),
|
|
68
74
|
apiKey: v3_1.default.string().optional(),
|
|
69
75
|
provider: v3_1.default.string().optional(),
|
|
@@ -76,6 +82,9 @@ exports.CODEX = {
|
|
|
76
82
|
else if (data.type === 'cloudbase') {
|
|
77
83
|
return data.provider && data.model;
|
|
78
84
|
}
|
|
85
|
+
else if (data.type === 'none') {
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
79
88
|
return false;
|
|
80
89
|
})
|
|
81
90
|
};
|
|
@@ -155,3 +164,8 @@ function getDefaultModelByBaseUrl(baseUrl) {
|
|
|
155
164
|
return exports.BASE_URL_MODEL_MAPPING[baseUrl] || 'gpt-4';
|
|
156
165
|
}
|
|
157
166
|
exports.getDefaultModelByBaseUrl = getDefaultModelByBaseUrl;
|
|
167
|
+
function getBooleanHint(defaultValue) {
|
|
168
|
+
return `y 是${defaultValue === true ? '(留空默认)' : ''}; n 否${defaultValue === false ? '(留空默认)' : ''}; enter 确认`;
|
|
169
|
+
}
|
|
170
|
+
exports.getBooleanHint = getBooleanHint;
|
|
171
|
+
exports.LIST_HINT = '使用上下键选择,输入 enter 确认选项';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ensureNodeVersion = void 0;
|
|
7
|
+
const semver_1 = __importDefault(require("semver"));
|
|
8
|
+
function ensureNodeVersion(version, log) {
|
|
9
|
+
const result = semver_1.default.compare(process.version, version);
|
|
10
|
+
if (result < 0) {
|
|
11
|
+
log.error(`当前 Node.js 版本为 ${process.version}。请升级到至少 ${version} 版本。`);
|
|
12
|
+
process.exit(1);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.ensureNodeVersion = ensureNodeVersion;
|
package/lib/utils/ai/router.js
CHANGED
|
@@ -51,6 +51,7 @@ const chalk_1 = __importDefault(require("chalk"));
|
|
|
51
51
|
const const_1 = require("./const");
|
|
52
52
|
const utils_1 = require("../../commands/utils");
|
|
53
53
|
const auth_1 = require("../../auth");
|
|
54
|
+
const nodeVersion_1 = require("./nodeVersion");
|
|
54
55
|
const IDE_FILE_MAPPINGS = {
|
|
55
56
|
"cursor": [
|
|
56
57
|
".cursor/rules/cloudbase-rules.mdc",
|
|
@@ -154,42 +155,9 @@ class AICommandRouter {
|
|
|
154
155
|
return __awaiter(this, void 0, void 0, function* () {
|
|
155
156
|
const { missingFiles } = yield this.configManager.checkToolkitConfig(agent);
|
|
156
157
|
if (missingFiles.length > 0) {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
yield this.downloadTemplate(log);
|
|
161
|
-
log.log('');
|
|
162
|
-
}
|
|
163
|
-
else {
|
|
164
|
-
log.info("💡 请运行 'tcb ai --setup' 或访问官方文档进行配置");
|
|
165
|
-
const docUrls = {
|
|
166
|
-
claude: 'https://docs.cloudbase.net/ai/cloudbase-ai-toolkit/ide-setup/claude-code',
|
|
167
|
-
codex: 'https://docs.cloudbase.net/ai/cloudbase-ai-toolkit/ide-setup/codex',
|
|
168
|
-
gemini: 'https://docs.cloudbase.net/ai/cloudbase-ai-toolkit/ide-setup/gemini'
|
|
169
|
-
};
|
|
170
|
-
if (docUrls[agent]) {
|
|
171
|
-
log.info(`📖 文档: ${docUrls[agent]}`);
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
|
-
promptForTemplateDownload(log) {
|
|
178
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
179
|
-
try {
|
|
180
|
-
const { downloadTemplate } = yield inquirer_1.default.prompt([
|
|
181
|
-
{
|
|
182
|
-
type: 'confirm',
|
|
183
|
-
name: 'downloadTemplate',
|
|
184
|
-
message: '是否下载 CloudBase AI ToolKit 模板?(建议下载以获取完整的开发体验)',
|
|
185
|
-
default: true
|
|
186
|
-
}
|
|
187
|
-
]);
|
|
188
|
-
return downloadTemplate;
|
|
189
|
-
}
|
|
190
|
-
catch (error) {
|
|
191
|
-
log.debug('交互提示失败,跳过模板下载');
|
|
192
|
-
return false;
|
|
158
|
+
log.log('');
|
|
159
|
+
yield this.downloadTemplate(log);
|
|
160
|
+
log.log('');
|
|
193
161
|
}
|
|
194
162
|
});
|
|
195
163
|
}
|
|
@@ -200,17 +168,21 @@ class AICommandRouter {
|
|
|
200
168
|
{
|
|
201
169
|
type: 'list',
|
|
202
170
|
name: 'templateType',
|
|
203
|
-
message:
|
|
171
|
+
message: `下载模板以获取完整的开发体验: ${const_1.LIST_HINT}`,
|
|
204
172
|
choices: [
|
|
205
173
|
{ name: '🟦 微信小程序 + CloudBase', value: 'miniprogram' },
|
|
206
174
|
{ name: '🚀 Web 应用 - React + CloudBase', value: 'react' },
|
|
207
175
|
{ name: '🟢 Web 应用 - Vue + CloudBase', value: 'vue' },
|
|
208
176
|
{ name: '🌈 跨端应用 - UniApp + CloudBase', value: 'uniapp' },
|
|
209
|
-
{ name: '🧩 只下载 AI 规则和配置', value: 'rules' }
|
|
177
|
+
{ name: '🧩 只下载 AI 规则和配置', value: 'rules' },
|
|
178
|
+
{ name: '🚫 不下载模板', value: 'none' }
|
|
210
179
|
],
|
|
211
180
|
default: 'miniprogram'
|
|
212
181
|
}
|
|
213
182
|
]);
|
|
183
|
+
if (templateType === 'none') {
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
214
186
|
const shouldCheckOverwrite = yield this.shouldCheckOverwrite(templateType);
|
|
215
187
|
let overwrite = false;
|
|
216
188
|
if (shouldCheckOverwrite) {
|
|
@@ -218,7 +190,7 @@ class AICommandRouter {
|
|
|
218
190
|
{
|
|
219
191
|
type: 'confirm',
|
|
220
192
|
name: 'confirmOverwrite',
|
|
221
|
-
message:
|
|
193
|
+
message: `检测到已存在文件,是否覆盖? ${(0, const_1.getBooleanHint)(false)}`,
|
|
222
194
|
default: false
|
|
223
195
|
}
|
|
224
196
|
]);
|
|
@@ -483,23 +455,32 @@ class AICommandRouter {
|
|
|
483
455
|
if (agentConfig.type === 'cloudbase') {
|
|
484
456
|
return yield this.executeClaudeCloudbaseAgent(agentConfig, additionalArgs, log);
|
|
485
457
|
}
|
|
486
|
-
else {
|
|
458
|
+
else if (agentConfig.type === 'custom') {
|
|
487
459
|
return yield this.executeClaudeAgent(agentConfig, additionalArgs, log);
|
|
488
460
|
}
|
|
461
|
+
else {
|
|
462
|
+
return yield this.executeNoneClaudeAgent(additionalArgs, log);
|
|
463
|
+
}
|
|
489
464
|
case const_1.QWEN.value:
|
|
490
465
|
if (agentConfig.type === 'cloudbase') {
|
|
491
466
|
return yield this.executeQwenCloudbaseAgent(agentConfig, additionalArgs, log);
|
|
492
467
|
}
|
|
493
|
-
else {
|
|
468
|
+
else if (agentConfig.type === 'custom') {
|
|
494
469
|
return yield this.executeQwenAgent(agentConfig, additionalArgs, log);
|
|
495
470
|
}
|
|
471
|
+
else {
|
|
472
|
+
return yield this.executeNoneQwenAgent(additionalArgs, log);
|
|
473
|
+
}
|
|
496
474
|
case const_1.CODEX.value:
|
|
497
475
|
if (agentConfig.type === 'cloudbase') {
|
|
498
476
|
return yield this.executeCodexCloudbaseAgent(agentConfig, additionalArgs, log);
|
|
499
477
|
}
|
|
500
|
-
else {
|
|
478
|
+
else if (agentConfig.type === 'custom') {
|
|
501
479
|
return yield this.executeCodexAgent(agentConfig, additionalArgs, log);
|
|
502
480
|
}
|
|
481
|
+
else {
|
|
482
|
+
return yield this.executeNoneCodexAgent(additionalArgs, log);
|
|
483
|
+
}
|
|
503
484
|
case const_1.AIDER.value:
|
|
504
485
|
if (agentConfig.type === 'cloudbase') {
|
|
505
486
|
return yield this.executeAiderCloudbaseAgent(agentConfig, additionalArgs, log);
|
|
@@ -514,18 +495,33 @@ class AICommandRouter {
|
|
|
514
495
|
}
|
|
515
496
|
executeClaudeAgent({ apiKey, baseUrl }, additionalArgs, log) {
|
|
516
497
|
return __awaiter(this, void 0, void 0, function* () {
|
|
498
|
+
(0, nodeVersion_1.ensureNodeVersion)('v18.0.0', log);
|
|
517
499
|
yield this.ensureClaudeCode(log);
|
|
518
500
|
yield this.executeCommand('claude', additionalArgs, Object.assign(Object.assign({}, process.env), { ANTHROPIC_AUTH_TOKEN: apiKey, ANTHROPIC_BASE_URL: baseUrl }), log);
|
|
519
501
|
});
|
|
520
502
|
}
|
|
503
|
+
executeNoneClaudeAgent(additionalArgs, log) {
|
|
504
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
505
|
+
yield this.ensureClaudeCode(log);
|
|
506
|
+
yield this.executeCommand('claude', additionalArgs, Object.assign({}, process.env), log);
|
|
507
|
+
});
|
|
508
|
+
}
|
|
521
509
|
executeQwenAgent({ apiKey, baseUrl, model }, additionalArgs, log) {
|
|
522
510
|
return __awaiter(this, void 0, void 0, function* () {
|
|
511
|
+
(0, nodeVersion_1.ensureNodeVersion)('v20.0.0', log);
|
|
523
512
|
yield this.ensureQwenCode(log);
|
|
524
513
|
yield this.executeCommand('qwen', additionalArgs, Object.assign(Object.assign({}, process.env), { OPENAI_API_KEY: apiKey, OPENAI_BASE_URL: baseUrl, OPENAI_MODEL: model }), log);
|
|
525
514
|
});
|
|
526
515
|
}
|
|
516
|
+
executeNoneQwenAgent(additionalArgs, log) {
|
|
517
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
518
|
+
yield this.ensureQwenCode(log);
|
|
519
|
+
yield this.executeCommand('qwen', additionalArgs, Object.assign({}, process.env), log);
|
|
520
|
+
});
|
|
521
|
+
}
|
|
527
522
|
executeQwenCloudbaseAgent({ provider, model }, additionalArgs, log) {
|
|
528
523
|
return __awaiter(this, void 0, void 0, function* () {
|
|
524
|
+
(0, nodeVersion_1.ensureNodeVersion)('v20.0.0', log);
|
|
529
525
|
yield this.ensureQwenCode(log);
|
|
530
526
|
const envId = yield (0, config_1.createConfigParser)().get('envId');
|
|
531
527
|
yield (0, auth_1.checkLogin)();
|
|
@@ -547,6 +543,7 @@ class AICommandRouter {
|
|
|
547
543
|
}
|
|
548
544
|
executeClaudeCloudbaseAgent({ provider, model, transformer }, additionalArgs, log) {
|
|
549
545
|
return __awaiter(this, void 0, void 0, function* () {
|
|
546
|
+
(0, nodeVersion_1.ensureNodeVersion)('v18.19.0', log);
|
|
550
547
|
yield this.ensureClaudeCodeRouter(log);
|
|
551
548
|
yield this.ensureClaudeCode(log);
|
|
552
549
|
yield this.configureClaudeCodeRouter(provider, model, transformer, log);
|
|
@@ -641,7 +638,7 @@ class AICommandRouter {
|
|
|
641
638
|
{
|
|
642
639
|
type: 'confirm',
|
|
643
640
|
name: 'shouldOverwrite',
|
|
644
|
-
message:
|
|
641
|
+
message: `claude-code-router 配置文件非合法 JSON ,是否覆盖? ${(0, const_1.getBooleanHint)()}`
|
|
645
642
|
}
|
|
646
643
|
]);
|
|
647
644
|
if (shouldOverwrite) {
|
|
@@ -714,7 +711,7 @@ class AICommandRouter {
|
|
|
714
711
|
{
|
|
715
712
|
type: 'confirm',
|
|
716
713
|
name: 'shouldInstall',
|
|
717
|
-
message:
|
|
714
|
+
message: `AI 开发缺少 claude code router 依赖,是否安装? ${(0, const_1.getBooleanHint)(true)}`
|
|
718
715
|
}
|
|
719
716
|
]);
|
|
720
717
|
if (shouldInstall) {
|
|
@@ -738,7 +735,7 @@ class AICommandRouter {
|
|
|
738
735
|
{
|
|
739
736
|
type: 'confirm',
|
|
740
737
|
name: 'shouldInstall',
|
|
741
|
-
message:
|
|
738
|
+
message: `AI 开发缺少 claude code 依赖,是否安装? ${(0, const_1.getBooleanHint)(true)}`
|
|
742
739
|
}
|
|
743
740
|
]);
|
|
744
741
|
if (shouldInstall) {
|
|
@@ -762,7 +759,7 @@ class AICommandRouter {
|
|
|
762
759
|
{
|
|
763
760
|
type: 'confirm',
|
|
764
761
|
name: 'shouldInstall',
|
|
765
|
-
message:
|
|
762
|
+
message: `AI 开发缺少 qwen code 依赖,是否安装? ${(0, const_1.getBooleanHint)(true)}`
|
|
766
763
|
}
|
|
767
764
|
]);
|
|
768
765
|
if (shouldInstall) {
|
|
@@ -793,6 +790,12 @@ class AICommandRouter {
|
|
|
793
790
|
yield this.executeCommand('codex', codexArgs, Object.assign(Object.assign({}, process.env), { OPENAI_API_KEY: apiKey }), log);
|
|
794
791
|
});
|
|
795
792
|
}
|
|
793
|
+
executeNoneCodexAgent(additionalArgs, log) {
|
|
794
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
795
|
+
yield this.ensureCodexCode(log);
|
|
796
|
+
yield this.executeCommand('codex', additionalArgs, Object.assign({}, process.env), log);
|
|
797
|
+
});
|
|
798
|
+
}
|
|
796
799
|
executeCodexCloudbaseAgent({ provider, model }, additionalArgs, log) {
|
|
797
800
|
return __awaiter(this, void 0, void 0, function* () {
|
|
798
801
|
yield this.ensureCodexCode(log);
|
|
@@ -837,7 +840,7 @@ class AICommandRouter {
|
|
|
837
840
|
{
|
|
838
841
|
type: 'confirm',
|
|
839
842
|
name: 'shouldInstall',
|
|
840
|
-
message:
|
|
843
|
+
message: `AI 开发缺少 codex 依赖,是否安装? ${(0, const_1.getBooleanHint)(true)}`
|
|
841
844
|
}
|
|
842
845
|
]);
|
|
843
846
|
if (shouldInstall) {
|
|
@@ -894,7 +897,7 @@ class AICommandRouter {
|
|
|
894
897
|
{
|
|
895
898
|
type: 'confirm',
|
|
896
899
|
name: 'shouldInstall',
|
|
897
|
-
message:
|
|
900
|
+
message: `AI 开发缺少 aider 依赖,是否安装? ${(0, const_1.getBooleanHint)(true)}`
|
|
898
901
|
}
|
|
899
902
|
]);
|
|
900
903
|
if (shouldInstall) {
|
package/lib/utils/ai/setup.js
CHANGED
|
@@ -55,6 +55,7 @@ class AISetupWizard {
|
|
|
55
55
|
return __awaiter(this, void 0, void 0, function* () {
|
|
56
56
|
log.info('🤖 欢迎使用 CloudBase AI ToolKit CLI 配置向导');
|
|
57
57
|
try {
|
|
58
|
+
this.showConfigInfo(log);
|
|
58
59
|
const defaultAgent = yield this.selectAgent('选择默认使用的 AI CLI 工具:', false);
|
|
59
60
|
yield this.aiConfigManager.updateDefaultAgent(defaultAgent);
|
|
60
61
|
const currentAgent = defaultAgent;
|
|
@@ -74,6 +75,7 @@ class AISetupWizard {
|
|
|
74
75
|
return __awaiter(this, void 0, void 0, function* () {
|
|
75
76
|
log.info('🤖 欢迎使用 CloudBase AI ToolKit CLI 配置向导');
|
|
76
77
|
try {
|
|
78
|
+
this.showConfigInfo(log);
|
|
77
79
|
const currentAgent = yield this.selectCurrentAgent();
|
|
78
80
|
if (currentAgent !== const_1.NONE.value) {
|
|
79
81
|
yield this.configureAgent(currentAgent, log);
|
|
@@ -124,7 +126,7 @@ class AISetupWizard {
|
|
|
124
126
|
{
|
|
125
127
|
type: 'confirm',
|
|
126
128
|
name: 'shouldUpdateEnvId',
|
|
127
|
-
message: `当前使用的 envId 为 ${configEnvId}
|
|
129
|
+
message: `当前使用的 envId 为 ${configEnvId},是否需要更新? ${(0, const_1.getBooleanHint)(false)}`,
|
|
128
130
|
default: false
|
|
129
131
|
}
|
|
130
132
|
]);
|
|
@@ -163,7 +165,7 @@ class AISetupWizard {
|
|
|
163
165
|
{
|
|
164
166
|
type: 'list',
|
|
165
167
|
name: 'agent',
|
|
166
|
-
message:
|
|
168
|
+
message: `选择默认使用的 AI CLI 工具: ${const_1.LIST_HINT}`,
|
|
167
169
|
choices: availableChoices,
|
|
168
170
|
default: configuredAgents[0]
|
|
169
171
|
}
|
|
@@ -176,13 +178,22 @@ class AISetupWizard {
|
|
|
176
178
|
return this.selectAgent('选择当前要配置的 AI CLI 工具:', true);
|
|
177
179
|
});
|
|
178
180
|
}
|
|
181
|
+
showConfigInfo(log) {
|
|
182
|
+
log.info('');
|
|
183
|
+
log.info('📋 配置说明:');
|
|
184
|
+
log.info('• 本配置仅在 CloudBase AI CLI 中生效');
|
|
185
|
+
log.info('• 不会修改您系统中已安装的 AI 工具的原始配置');
|
|
186
|
+
log.info('• 配置文件将保存在当前项目目录下(.env.local 等)');
|
|
187
|
+
log.info('• 您可以随时通过 tcb ai --reset 重置配置');
|
|
188
|
+
log.info('');
|
|
189
|
+
}
|
|
179
190
|
selectAgent(message, includeNone = false) {
|
|
180
191
|
return __awaiter(this, void 0, void 0, function* () {
|
|
181
192
|
const { agent } = yield inquirer_1.default.prompt([
|
|
182
193
|
{
|
|
183
194
|
type: 'list',
|
|
184
195
|
name: 'agent',
|
|
185
|
-
message
|
|
196
|
+
message: `${message} ${const_1.LIST_HINT}`,
|
|
186
197
|
choices: [const_1.CLAUDE, const_1.QWEN, const_1.CODEX, const_1.AIDER, ...(includeNone ? [const_1.NONE] : [])],
|
|
187
198
|
default: const_1.CLAUDE.value
|
|
188
199
|
}
|
|
@@ -214,10 +225,11 @@ class AISetupWizard {
|
|
|
214
225
|
{
|
|
215
226
|
type: 'list',
|
|
216
227
|
name: 'configMethod',
|
|
217
|
-
message:
|
|
228
|
+
message: `选择配置方式: ${const_1.LIST_HINT}`,
|
|
218
229
|
choices: [
|
|
219
230
|
{ name: '使用 CloudBase 服务,一键登录,无需配置', value: 'cloudbase' },
|
|
220
|
-
{ name: '自配置 API KEY 和 Base URL', value: 'custom' }
|
|
231
|
+
{ name: '自配置 API KEY 和 Base URL', value: 'custom' },
|
|
232
|
+
{ name: '无需配置,使用 AI CLI 内置鉴权方式(如 Oauth)', value: 'none' }
|
|
221
233
|
],
|
|
222
234
|
default: 'cloudbase'
|
|
223
235
|
}
|
|
@@ -228,12 +240,12 @@ class AISetupWizard {
|
|
|
228
240
|
yield this.aiConfigManager.updateClaudeConfig('cloudbase', Object.assign({ provider,
|
|
229
241
|
model }, (transformer && { transformer })));
|
|
230
242
|
}
|
|
231
|
-
else {
|
|
243
|
+
else if (configMethod === 'custom') {
|
|
232
244
|
const { baseUrlChoice } = yield inquirer_1.default.prompt([
|
|
233
245
|
{
|
|
234
246
|
type: 'list',
|
|
235
247
|
name: 'baseUrlChoice',
|
|
236
|
-
message:
|
|
248
|
+
message: `选择 API Base URL: ${const_1.LIST_HINT}`,
|
|
237
249
|
choices: [
|
|
238
250
|
{ name: 'Kimi - https://api.moonshot.cn/anthropic', value: 'https://api.moonshot.cn/anthropic' },
|
|
239
251
|
{ name: '智谱 - https://open.bigmodel.cn/api/anthropic', value: 'https://open.bigmodel.cn/api/anthropic' },
|
|
@@ -268,6 +280,9 @@ class AISetupWizard {
|
|
|
268
280
|
]);
|
|
269
281
|
yield this.aiConfigManager.updateClaudeConfig('custom', { baseUrl, apiKey: apikey });
|
|
270
282
|
}
|
|
283
|
+
else {
|
|
284
|
+
yield this.aiConfigManager.updateClaudeConfig('none', {});
|
|
285
|
+
}
|
|
271
286
|
});
|
|
272
287
|
}
|
|
273
288
|
configureQwenAgent(log) {
|
|
@@ -277,10 +292,11 @@ class AISetupWizard {
|
|
|
277
292
|
{
|
|
278
293
|
type: 'list',
|
|
279
294
|
name: 'configMethod',
|
|
280
|
-
message:
|
|
295
|
+
message: `选择配置方式: ${const_1.LIST_HINT}`,
|
|
281
296
|
choices: [
|
|
282
297
|
{ name: '使用 CloudBase 服务,一键登录,无需配置', value: 'cloudbase' },
|
|
283
|
-
{ name: '自配置 API KEY 和 Base URL', value: 'custom' }
|
|
298
|
+
{ name: '自配置 API KEY 和 Base URL', value: 'custom' },
|
|
299
|
+
{ name: '无需配置,使用 AI CLI 内置鉴权方式(如 Oauth)', value: 'none' }
|
|
284
300
|
],
|
|
285
301
|
default: 'cloudbase'
|
|
286
302
|
}
|
|
@@ -293,7 +309,7 @@ class AISetupWizard {
|
|
|
293
309
|
model
|
|
294
310
|
});
|
|
295
311
|
}
|
|
296
|
-
else {
|
|
312
|
+
else if (configMethod === 'custom') {
|
|
297
313
|
const { apiKey, baseUrl, model } = yield inquirer_1.default.prompt([
|
|
298
314
|
{
|
|
299
315
|
type: 'input',
|
|
@@ -316,6 +332,9 @@ class AISetupWizard {
|
|
|
316
332
|
]);
|
|
317
333
|
yield this.aiConfigManager.updateQwenConfig('custom', { baseUrl, apiKey, model });
|
|
318
334
|
}
|
|
335
|
+
else {
|
|
336
|
+
yield this.aiConfigManager.updateQwenConfig('none', {});
|
|
337
|
+
}
|
|
319
338
|
});
|
|
320
339
|
}
|
|
321
340
|
configureCodexAgent(log) {
|
|
@@ -325,10 +344,11 @@ class AISetupWizard {
|
|
|
325
344
|
{
|
|
326
345
|
type: 'list',
|
|
327
346
|
name: 'configMethod',
|
|
328
|
-
message:
|
|
347
|
+
message: `选择配置方式: ${const_1.LIST_HINT}`,
|
|
329
348
|
choices: [
|
|
330
349
|
{ name: '使用 CloudBase 服务,一键登录,无需配置', value: 'cloudbase' },
|
|
331
|
-
{ name: '自配置 API KEY 和 Base URL', value: 'custom' }
|
|
350
|
+
{ name: '自配置 API KEY 和 Base URL', value: 'custom' },
|
|
351
|
+
{ name: '无需配置,使用 AI CLI 内置鉴权方式(如 Oauth)', value: 'none' }
|
|
332
352
|
],
|
|
333
353
|
default: 'cloudbase'
|
|
334
354
|
}
|
|
@@ -341,12 +361,12 @@ class AISetupWizard {
|
|
|
341
361
|
model
|
|
342
362
|
});
|
|
343
363
|
}
|
|
344
|
-
else {
|
|
364
|
+
else if (configMethod === 'custom') {
|
|
345
365
|
const { baseUrlChoice } = yield inquirer_1.default.prompt([
|
|
346
366
|
{
|
|
347
367
|
type: 'list',
|
|
348
368
|
name: 'baseUrlChoice',
|
|
349
|
-
message:
|
|
369
|
+
message: `选择 API Base URL: ${const_1.LIST_HINT}`,
|
|
350
370
|
choices: [
|
|
351
371
|
{ name: 'Kimi - https://api.moonshot.cn/v1', value: 'https://api.moonshot.cn/v1' },
|
|
352
372
|
{ name: '智谱 - https://open.bigmodel.cn/api/paas/v4', value: 'https://open.bigmodel.cn/api/paas/v4' },
|
|
@@ -386,6 +406,9 @@ class AISetupWizard {
|
|
|
386
406
|
]);
|
|
387
407
|
yield this.aiConfigManager.updateCodexConfig('custom', { baseUrl, apiKey, model });
|
|
388
408
|
}
|
|
409
|
+
else {
|
|
410
|
+
yield this.aiConfigManager.updateCodexConfig('none', {});
|
|
411
|
+
}
|
|
389
412
|
});
|
|
390
413
|
}
|
|
391
414
|
configureAiderAgent(log) {
|
|
@@ -395,7 +418,7 @@ class AISetupWizard {
|
|
|
395
418
|
{
|
|
396
419
|
type: 'list',
|
|
397
420
|
name: 'configMethod',
|
|
398
|
-
message:
|
|
421
|
+
message: `选择配置方式: ${const_1.LIST_HINT}`,
|
|
399
422
|
choices: [
|
|
400
423
|
{ name: '使用 CloudBase 服务,一键登录,无需配置', value: 'cloudbase' },
|
|
401
424
|
{ name: '自配置 API KEY 和 Base URL', value: 'custom' }
|
|
@@ -416,7 +439,7 @@ class AISetupWizard {
|
|
|
416
439
|
{
|
|
417
440
|
type: 'list',
|
|
418
441
|
name: 'baseUrlChoice',
|
|
419
|
-
message:
|
|
442
|
+
message: `选择 API Base URL: ${const_1.LIST_HINT}`,
|
|
420
443
|
choices: [
|
|
421
444
|
{ name: 'Kimi - https://api.moonshot.cn/v1', value: 'https://api.moonshot.cn/v1' },
|
|
422
445
|
{ name: '智谱 - https://open.bigmodel.cn/api/paas/v4', value: 'https://open.bigmodel.cn/api/paas/v4' },
|
|
@@ -492,7 +515,7 @@ class AISetupWizard {
|
|
|
492
515
|
{
|
|
493
516
|
type: 'list',
|
|
494
517
|
name: 'selectedProvider',
|
|
495
|
-
message:
|
|
518
|
+
message: `选择大模型供应商: ${const_1.LIST_HINT}`,
|
|
496
519
|
choices: const_1.CLOUDBASE_PROVIDERS.map(p => ({ name: p.name, value: p.value })),
|
|
497
520
|
default: 'kimi-exp'
|
|
498
521
|
}
|
|
@@ -524,7 +547,7 @@ class AISetupWizard {
|
|
|
524
547
|
{
|
|
525
548
|
type: 'list',
|
|
526
549
|
name: 'selectedModel',
|
|
527
|
-
message:
|
|
550
|
+
message: `选择模型: ${const_1.LIST_HINT}`,
|
|
528
551
|
choices: modelChoices,
|
|
529
552
|
default: selectedConfig.models[0]
|
|
530
553
|
}
|
package/package.json
CHANGED
|
@@ -50,20 +50,20 @@ export declare class AIConfigManager {
|
|
|
50
50
|
}>;
|
|
51
51
|
updateEnvId(envId: string): Promise<void>;
|
|
52
52
|
updateDefaultAgent(agent: string): Promise<void>;
|
|
53
|
-
updateClaudeConfig(type: 'custom' | 'cloudbase', config: {
|
|
53
|
+
updateClaudeConfig(type: 'custom' | 'cloudbase' | 'none', config: {
|
|
54
54
|
baseUrl?: string;
|
|
55
55
|
apiKey?: string;
|
|
56
56
|
provider?: string;
|
|
57
57
|
model?: string;
|
|
58
58
|
transformer?: string;
|
|
59
59
|
}): Promise<void>;
|
|
60
|
-
updateQwenConfig(type: 'custom' | 'cloudbase', config: {
|
|
60
|
+
updateQwenConfig(type: 'custom' | 'cloudbase' | 'none', config: {
|
|
61
61
|
baseUrl?: string;
|
|
62
62
|
apiKey?: string;
|
|
63
63
|
provider?: string;
|
|
64
64
|
model?: string;
|
|
65
65
|
}): Promise<void>;
|
|
66
|
-
updateCodexConfig(type: 'custom' | 'cloudbase', config: {
|
|
66
|
+
updateCodexConfig(type: 'custom' | 'cloudbase' | 'none', config: {
|
|
67
67
|
baseUrl?: string;
|
|
68
68
|
apiKey?: string;
|
|
69
69
|
provider?: string;
|
|
@@ -9,35 +9,35 @@ export declare const CLAUDE: {
|
|
|
9
9
|
name: string;
|
|
10
10
|
value: string;
|
|
11
11
|
configSchema: z.ZodEffects<z.ZodObject<{
|
|
12
|
-
type: z.ZodOptional<z.ZodEnum<["custom", "cloudbase"]>>;
|
|
12
|
+
type: z.ZodOptional<z.ZodEnum<["custom", "cloudbase", "none"]>>;
|
|
13
13
|
baseUrl: z.ZodOptional<z.ZodString>;
|
|
14
14
|
apiKey: z.ZodOptional<z.ZodString>;
|
|
15
15
|
provider: z.ZodOptional<z.ZodString>;
|
|
16
16
|
model: z.ZodOptional<z.ZodString>;
|
|
17
17
|
transformer: z.ZodOptional<z.ZodString>;
|
|
18
18
|
}, "strip", z.ZodTypeAny, {
|
|
19
|
-
type?: "custom" | "cloudbase";
|
|
19
|
+
type?: "custom" | "cloudbase" | "none";
|
|
20
20
|
transformer?: string;
|
|
21
21
|
apiKey?: string;
|
|
22
22
|
model?: string;
|
|
23
23
|
baseUrl?: string;
|
|
24
24
|
provider?: string;
|
|
25
25
|
}, {
|
|
26
|
-
type?: "custom" | "cloudbase";
|
|
26
|
+
type?: "custom" | "cloudbase" | "none";
|
|
27
27
|
transformer?: string;
|
|
28
28
|
apiKey?: string;
|
|
29
29
|
model?: string;
|
|
30
30
|
baseUrl?: string;
|
|
31
31
|
provider?: string;
|
|
32
32
|
}>, {
|
|
33
|
-
type?: "custom" | "cloudbase";
|
|
33
|
+
type?: "custom" | "cloudbase" | "none";
|
|
34
34
|
transformer?: string;
|
|
35
35
|
apiKey?: string;
|
|
36
36
|
model?: string;
|
|
37
37
|
baseUrl?: string;
|
|
38
38
|
provider?: string;
|
|
39
39
|
}, {
|
|
40
|
-
type?: "custom" | "cloudbase";
|
|
40
|
+
type?: "custom" | "cloudbase" | "none";
|
|
41
41
|
transformer?: string;
|
|
42
42
|
apiKey?: string;
|
|
43
43
|
model?: string;
|
|
@@ -49,31 +49,31 @@ export declare const QWEN: {
|
|
|
49
49
|
name: string;
|
|
50
50
|
value: string;
|
|
51
51
|
configSchema: z.ZodEffects<z.ZodObject<{
|
|
52
|
-
type: z.ZodOptional<z.ZodEnum<["custom", "cloudbase"]>>;
|
|
52
|
+
type: z.ZodOptional<z.ZodEnum<["custom", "cloudbase", "none"]>>;
|
|
53
53
|
baseUrl: z.ZodOptional<z.ZodString>;
|
|
54
54
|
apiKey: z.ZodOptional<z.ZodString>;
|
|
55
55
|
provider: z.ZodOptional<z.ZodString>;
|
|
56
56
|
model: z.ZodOptional<z.ZodString>;
|
|
57
57
|
}, "strip", z.ZodTypeAny, {
|
|
58
|
-
type?: "custom" | "cloudbase";
|
|
58
|
+
type?: "custom" | "cloudbase" | "none";
|
|
59
59
|
apiKey?: string;
|
|
60
60
|
model?: string;
|
|
61
61
|
baseUrl?: string;
|
|
62
62
|
provider?: string;
|
|
63
63
|
}, {
|
|
64
|
-
type?: "custom" | "cloudbase";
|
|
64
|
+
type?: "custom" | "cloudbase" | "none";
|
|
65
65
|
apiKey?: string;
|
|
66
66
|
model?: string;
|
|
67
67
|
baseUrl?: string;
|
|
68
68
|
provider?: string;
|
|
69
69
|
}>, {
|
|
70
|
-
type?: "custom" | "cloudbase";
|
|
70
|
+
type?: "custom" | "cloudbase" | "none";
|
|
71
71
|
apiKey?: string;
|
|
72
72
|
model?: string;
|
|
73
73
|
baseUrl?: string;
|
|
74
74
|
provider?: string;
|
|
75
75
|
}, {
|
|
76
|
-
type?: "custom" | "cloudbase";
|
|
76
|
+
type?: "custom" | "cloudbase" | "none";
|
|
77
77
|
apiKey?: string;
|
|
78
78
|
model?: string;
|
|
79
79
|
baseUrl?: string;
|
|
@@ -84,31 +84,31 @@ export declare const CODEX: {
|
|
|
84
84
|
name: string;
|
|
85
85
|
value: string;
|
|
86
86
|
configSchema: z.ZodEffects<z.ZodObject<{
|
|
87
|
-
type: z.ZodOptional<z.ZodEnum<["custom", "cloudbase"]>>;
|
|
87
|
+
type: z.ZodOptional<z.ZodEnum<["custom", "cloudbase", "none"]>>;
|
|
88
88
|
baseUrl: z.ZodOptional<z.ZodString>;
|
|
89
89
|
apiKey: z.ZodOptional<z.ZodString>;
|
|
90
90
|
provider: z.ZodOptional<z.ZodString>;
|
|
91
91
|
model: z.ZodOptional<z.ZodString>;
|
|
92
92
|
}, "strip", z.ZodTypeAny, {
|
|
93
|
-
type?: "custom" | "cloudbase";
|
|
93
|
+
type?: "custom" | "cloudbase" | "none";
|
|
94
94
|
apiKey?: string;
|
|
95
95
|
model?: string;
|
|
96
96
|
baseUrl?: string;
|
|
97
97
|
provider?: string;
|
|
98
98
|
}, {
|
|
99
|
-
type?: "custom" | "cloudbase";
|
|
99
|
+
type?: "custom" | "cloudbase" | "none";
|
|
100
100
|
apiKey?: string;
|
|
101
101
|
model?: string;
|
|
102
102
|
baseUrl?: string;
|
|
103
103
|
provider?: string;
|
|
104
104
|
}>, {
|
|
105
|
-
type?: "custom" | "cloudbase";
|
|
105
|
+
type?: "custom" | "cloudbase" | "none";
|
|
106
106
|
apiKey?: string;
|
|
107
107
|
model?: string;
|
|
108
108
|
baseUrl?: string;
|
|
109
109
|
provider?: string;
|
|
110
110
|
}, {
|
|
111
|
-
type?: "custom" | "cloudbase";
|
|
111
|
+
type?: "custom" | "cloudbase" | "none";
|
|
112
112
|
apiKey?: string;
|
|
113
113
|
model?: string;
|
|
114
114
|
baseUrl?: string;
|
|
@@ -158,35 +158,35 @@ export declare const AGENTS: readonly [{
|
|
|
158
158
|
name: string;
|
|
159
159
|
value: string;
|
|
160
160
|
configSchema: z.ZodEffects<z.ZodObject<{
|
|
161
|
-
type: z.ZodOptional<z.ZodEnum<["custom", "cloudbase"]>>;
|
|
161
|
+
type: z.ZodOptional<z.ZodEnum<["custom", "cloudbase", "none"]>>;
|
|
162
162
|
baseUrl: z.ZodOptional<z.ZodString>;
|
|
163
163
|
apiKey: z.ZodOptional<z.ZodString>;
|
|
164
164
|
provider: z.ZodOptional<z.ZodString>;
|
|
165
165
|
model: z.ZodOptional<z.ZodString>;
|
|
166
166
|
transformer: z.ZodOptional<z.ZodString>;
|
|
167
167
|
}, "strip", z.ZodTypeAny, {
|
|
168
|
-
type?: "custom" | "cloudbase";
|
|
168
|
+
type?: "custom" | "cloudbase" | "none";
|
|
169
169
|
transformer?: string;
|
|
170
170
|
apiKey?: string;
|
|
171
171
|
model?: string;
|
|
172
172
|
baseUrl?: string;
|
|
173
173
|
provider?: string;
|
|
174
174
|
}, {
|
|
175
|
-
type?: "custom" | "cloudbase";
|
|
175
|
+
type?: "custom" | "cloudbase" | "none";
|
|
176
176
|
transformer?: string;
|
|
177
177
|
apiKey?: string;
|
|
178
178
|
model?: string;
|
|
179
179
|
baseUrl?: string;
|
|
180
180
|
provider?: string;
|
|
181
181
|
}>, {
|
|
182
|
-
type?: "custom" | "cloudbase";
|
|
182
|
+
type?: "custom" | "cloudbase" | "none";
|
|
183
183
|
transformer?: string;
|
|
184
184
|
apiKey?: string;
|
|
185
185
|
model?: string;
|
|
186
186
|
baseUrl?: string;
|
|
187
187
|
provider?: string;
|
|
188
188
|
}, {
|
|
189
|
-
type?: "custom" | "cloudbase";
|
|
189
|
+
type?: "custom" | "cloudbase" | "none";
|
|
190
190
|
transformer?: string;
|
|
191
191
|
apiKey?: string;
|
|
192
192
|
model?: string;
|
|
@@ -197,31 +197,31 @@ export declare const AGENTS: readonly [{
|
|
|
197
197
|
name: string;
|
|
198
198
|
value: string;
|
|
199
199
|
configSchema: z.ZodEffects<z.ZodObject<{
|
|
200
|
-
type: z.ZodOptional<z.ZodEnum<["custom", "cloudbase"]>>;
|
|
200
|
+
type: z.ZodOptional<z.ZodEnum<["custom", "cloudbase", "none"]>>;
|
|
201
201
|
baseUrl: z.ZodOptional<z.ZodString>;
|
|
202
202
|
apiKey: z.ZodOptional<z.ZodString>;
|
|
203
203
|
provider: z.ZodOptional<z.ZodString>;
|
|
204
204
|
model: z.ZodOptional<z.ZodString>;
|
|
205
205
|
}, "strip", z.ZodTypeAny, {
|
|
206
|
-
type?: "custom" | "cloudbase";
|
|
206
|
+
type?: "custom" | "cloudbase" | "none";
|
|
207
207
|
apiKey?: string;
|
|
208
208
|
model?: string;
|
|
209
209
|
baseUrl?: string;
|
|
210
210
|
provider?: string;
|
|
211
211
|
}, {
|
|
212
|
-
type?: "custom" | "cloudbase";
|
|
212
|
+
type?: "custom" | "cloudbase" | "none";
|
|
213
213
|
apiKey?: string;
|
|
214
214
|
model?: string;
|
|
215
215
|
baseUrl?: string;
|
|
216
216
|
provider?: string;
|
|
217
217
|
}>, {
|
|
218
|
-
type?: "custom" | "cloudbase";
|
|
218
|
+
type?: "custom" | "cloudbase" | "none";
|
|
219
219
|
apiKey?: string;
|
|
220
220
|
model?: string;
|
|
221
221
|
baseUrl?: string;
|
|
222
222
|
provider?: string;
|
|
223
223
|
}, {
|
|
224
|
-
type?: "custom" | "cloudbase";
|
|
224
|
+
type?: "custom" | "cloudbase" | "none";
|
|
225
225
|
apiKey?: string;
|
|
226
226
|
model?: string;
|
|
227
227
|
baseUrl?: string;
|
|
@@ -231,31 +231,31 @@ export declare const AGENTS: readonly [{
|
|
|
231
231
|
name: string;
|
|
232
232
|
value: string;
|
|
233
233
|
configSchema: z.ZodEffects<z.ZodObject<{
|
|
234
|
-
type: z.ZodOptional<z.ZodEnum<["custom", "cloudbase"]>>;
|
|
234
|
+
type: z.ZodOptional<z.ZodEnum<["custom", "cloudbase", "none"]>>;
|
|
235
235
|
baseUrl: z.ZodOptional<z.ZodString>;
|
|
236
236
|
apiKey: z.ZodOptional<z.ZodString>;
|
|
237
237
|
provider: z.ZodOptional<z.ZodString>;
|
|
238
238
|
model: z.ZodOptional<z.ZodString>;
|
|
239
239
|
}, "strip", z.ZodTypeAny, {
|
|
240
|
-
type?: "custom" | "cloudbase";
|
|
240
|
+
type?: "custom" | "cloudbase" | "none";
|
|
241
241
|
apiKey?: string;
|
|
242
242
|
model?: string;
|
|
243
243
|
baseUrl?: string;
|
|
244
244
|
provider?: string;
|
|
245
245
|
}, {
|
|
246
|
-
type?: "custom" | "cloudbase";
|
|
246
|
+
type?: "custom" | "cloudbase" | "none";
|
|
247
247
|
apiKey?: string;
|
|
248
248
|
model?: string;
|
|
249
249
|
baseUrl?: string;
|
|
250
250
|
provider?: string;
|
|
251
251
|
}>, {
|
|
252
|
-
type?: "custom" | "cloudbase";
|
|
252
|
+
type?: "custom" | "cloudbase" | "none";
|
|
253
253
|
apiKey?: string;
|
|
254
254
|
model?: string;
|
|
255
255
|
baseUrl?: string;
|
|
256
256
|
provider?: string;
|
|
257
257
|
}, {
|
|
258
|
-
type?: "custom" | "cloudbase";
|
|
258
|
+
type?: "custom" | "cloudbase" | "none";
|
|
259
259
|
apiKey?: string;
|
|
260
260
|
model?: string;
|
|
261
261
|
baseUrl?: string;
|
|
@@ -327,3 +327,5 @@ export declare const BASE_URL_MODEL_MAPPING: {
|
|
|
327
327
|
readonly 'https://open.bigmodel.cn/api/paas/v4': "glm-4.5";
|
|
328
328
|
};
|
|
329
329
|
export declare function getDefaultModelByBaseUrl(baseUrl: string): string;
|
|
330
|
+
export declare function getBooleanHint(defaultValue?: boolean): string;
|
|
331
|
+
export declare const LIST_HINT = "\u4F7F\u7528\u4E0A\u4E0B\u952E\u9009\u62E9\uFF0C\u8F93\u5165 enter \u786E\u8BA4\u9009\u9879";
|
|
@@ -10,7 +10,6 @@ export declare class AICommandRouter {
|
|
|
10
10
|
constructor();
|
|
11
11
|
execute({ agent, addtionalArgs, log }: IExecute): Promise<void>;
|
|
12
12
|
private checkToolkitConfig;
|
|
13
|
-
private promptForTemplateDownload;
|
|
14
13
|
private downloadTemplate;
|
|
15
14
|
private downloadAndExtractTemplate;
|
|
16
15
|
private getInstallCommand;
|
|
@@ -20,7 +19,9 @@ export declare class AICommandRouter {
|
|
|
20
19
|
private validateAgentConfig;
|
|
21
20
|
private executeAgentWithConfig;
|
|
22
21
|
private executeClaudeAgent;
|
|
22
|
+
private executeNoneClaudeAgent;
|
|
23
23
|
private executeQwenAgent;
|
|
24
|
+
private executeNoneQwenAgent;
|
|
24
25
|
private executeQwenCloudbaseAgent;
|
|
25
26
|
private executeClaudeCloudbaseAgent;
|
|
26
27
|
private restartClaudeCodeRouter;
|
|
@@ -31,6 +32,7 @@ export declare class AICommandRouter {
|
|
|
31
32
|
private ensureClaudeCode;
|
|
32
33
|
private ensureQwenCode;
|
|
33
34
|
private executeCodexAgent;
|
|
35
|
+
private executeNoneCodexAgent;
|
|
34
36
|
private executeCodexCloudbaseAgent;
|
|
35
37
|
private ensureCodexCode;
|
|
36
38
|
private executeAiderAgent;
|
|
@@ -12,6 +12,7 @@ export declare class AISetupWizard {
|
|
|
12
12
|
configureEnvId(log: Logger, _envId: string): Promise<string>;
|
|
13
13
|
private selectDefaultAgent;
|
|
14
14
|
private selectCurrentAgent;
|
|
15
|
+
private showConfigInfo;
|
|
15
16
|
private selectAgent;
|
|
16
17
|
private configureAgent;
|
|
17
18
|
private configureClaudeAgent;
|
package/cloudbase-cli-2.7.8.tgz
DELETED
|
Binary file
|