@cloudbase/cli 2.9.5 → 2.9.7
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/dist/standalone/cli.js +79 -11
- package/lib/commands/cloudrun/base.js +30 -25
- package/lib/utils/ai/router.js +4 -4
- package/lib/utils/ai/setup.js +1 -1
- package/package.json +3 -3
- package/specs/tcb-pull-cnb-support/design.md +3 -0
- package/specs/tcb-pull-cnb-support/requirements.md +3 -0
- package/specs/tcb-pull-cnb-support/tasks.md +3 -0
- package/specs/tcb-pull-mcp-integration/design.md +3 -0
- package/specs/tcb-pull-mcp-integration/implementation-summary.md +3 -0
- package/specs/tcb-pull-mcp-integration/requirements.md +3 -0
package/dist/standalone/cli.js
CHANGED
|
@@ -42403,7 +42403,7 @@ module.exports = function generate_pattern(it, $keyword, $ruleType) {
|
|
|
42403
42403
|
/***/ ((module) => {
|
|
42404
42404
|
|
|
42405
42405
|
"use strict";
|
|
42406
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@cloudbase/cli","version":"2.9.
|
|
42406
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@cloudbase/cli","version":"2.9.5","description":"cli tool for cloudbase","main":"lib/index.js","scripts":{"build":"rimraf lib types && tsc --resolveJsonModule && cpx \\"src/**/*.html\\" lib","watch":"rimraf lib types && tsc -w","dev":"rimraf lib types && cpx \\"src/**/*.html\\" lib && tsc -w","eslint":"eslint \\"./**/*.ts\\"","test":"node --experimental-vm-modules node_modules/jest/bin/jest.js --runInBand --forceExit --detectOpenHandles --coverage --verbose --testTimeout=10000","tsc":"tsc","pkg":"pkg ./bin/cloudbase.js --out-path ./pkg","postinstall":"node ./post-install.js || exit 0 && patch-package","prepublishOnly":"npm run build","debug":"bin/tcb.js lowcode watch","build:bundle":"webpack --config build/webpack/cli.cjs && webpack --config build/webpack/ccr.cjs","package:darwin-arm64":"OS=darwin ARCH=arm64 VERSION= node -e \\"require(\'child_process\').execSync(\'bash build/scripts/package.sh\',{stdio:\'inherit\'})\\"","package:darwin-x64":"OS=darwin ARCH=x64 VERSION= node -e \\"require(\'child_process\').execSync(\'bash build/scripts/package.sh\',{stdio:\'inherit\'})\\"","package:linux-arm64":"OS=linux ARCH=arm64 VERSION= node -e \\"require(\'child_process\').execSync(\'bash build/scripts/package.sh\',{stdio:\'inherit\'})\\"","package:linux-x64":"OS=linux ARCH=x64 VERSION= node -e \\"require(\'child_process\').execSync(\'bash build/scripts/package.sh\',{stdio:\'inherit\'})\\"","package:all":"bash build/scripts/build-all.sh","node:fetch:one":"node -e \\"require(\'child_process\').execSync(\'bash build/scripts/fetch-node.sh\',{stdio:\'inherit\'})\\"","node:fetch:all":"NODE_VERSION=22.18.0 bash build/scripts/fetch-node.sh --all","node:fetch:win-x64":"OS=windows ARCH=x64 NODE_VERSION=22.18.0 bash build/scripts/fetch-node.sh","node:fetch:win-arm64":"OS=windows ARCH=arm64 NODE_VERSION=22.18.0 bash build/scripts/fetch-node.sh","package:windows-x64":"OS=windows ARCH=x64 VERSION= node -e \\"require(\'child_process\').execSync(\'bash build/scripts/package.sh\',{stdio:\'inherit\'})\\"","package:windows-arm64":"OS=windows ARCH=arm64 VERSION= node -e \\"require(\'child_process\').execSync(\'bash build/scripts/package.sh\',{stdio:\'inherit\'})\\"","package:windows-all":"npm run -s node:fetch:win-x64 && npm run -s node:fetch:win-arm64 && npm run -s package:windows-x64 && npm run -s package:windows-arm64","out:prune":"bash build/scripts/prune-out.sh"},"repository":{"type":"git","url":"https://github.com/TencentCloudBase/cloud-base-cli.git"},"bin":{"ccr":"bin/ccr.js","cloudbase":"bin/cloudbase.js","cloudbase-mcp":"bin/cloudbase-mcp.cjs","tcb":"bin/tcb.js"},"husky":{"hooks":{"pre-commit":"npm run build"}},"author":"cwuyiqing@gmail.com","license":"ISC","dependencies":{"@cloudbase/cloud-api":"^0.5.5","@cloudbase/cloudbase-mcp":"^1.8.41","@cloudbase/framework-core":"^1.9.7","@cloudbase/functions-framework":"1.16.0","@cloudbase/iac-core":"0.0.3-alpha.11","@cloudbase/lowcode-cli":"^0.22.2","@cloudbase/manager-node":"4.6.1","@cloudbase/toolbox":"^0.7.9","@dotenvx/dotenvx":"^1.48.3","@musistudio/claude-code-router":"1.0.36","address":"^1.1.2","camelcase-keys":"^7.0.2","chalk":"^2.4.2","cli-table3":"^0.5.1","commander":"7","del":"^5.1.0","didyoumean":"^1.2.2","enquirer":"^2.3.6","execa":"^4.0.3","figlet":"^1.7.0","fs-extra":"^8.1.0","gradient-string":"^2.0.2","https-proxy-agent":"^5.0.1","i":"^0.3.7","inquirer":"^6.5.0","json-schema-to-typescript":"^14.0.5","lodash":"^4.17.21","log-symbols":"^3.0.0","lowdb":"^1.0.0","make-dir":"^3.0.0","node-fetch":"^2.6.0","nodemon":"^3.1.4","npm":"^11.5.2","open":"^7.0.0","ora":"^4.0.2","patch-package":"^8.0.0","portfinder":"^1.0.28","progress":"^2.0.3","query-string":"^6.8.1","reflect-metadata":"^0.1.13","semver":"^7.3.7","simple-git":"^3.28.0","tar-fs":"^2.0.1","terminal-link":"^2.1.1","toml":"^3.0.0","unzipper":"^0.10.10","update-notifier":"^4.0.0","xdg-basedir":"^4.0.0","yargs":"^16.2.0","yargs-parser":"^21.0.1","zod":"^4.0.13"},"devDependencies":{"@types/fs-extra":"^11.0.4","@types/jest":"^27","@types/koa__router":"^8.0.11","@types/lodash":"^4.14.182","@types/node":"^12.12.38","@types/node-fetch":"^2.5.4","@types/react":"^17.0.37","@types/semver":"^7.3.9","@types/unzipper":"^0.10.11","@types/webpack-dev-server":"^3.11.1","@typescript-eslint/eslint-plugin":"^4.8.1","@typescript-eslint/parser":"^4.8.1","cpx":"^1.5.0","eslint":"^7.14.0","eslint-config-alloy":"^3.8.2","husky":"^3.0.9","jest":"^27","rimraf":"^3.0.2","ts-jest":"^27","typescript":"^4.7.2","webpack":"^5.92.0","webpack-cli":"^5.1.4"},"packageManager":"yarn@3.6.2+sha512.2c2f8b9615e6659773f65cdec7cf92ef773a98a99e611579601f61c7a91ec94c89c929aac86f1cee819421a9b0db7acfd53ec3ebb95af44f77f77634b08b9557"}');
|
|
42407
42407
|
|
|
42408
42408
|
/***/ }),
|
|
42409
42409
|
|
|
@@ -470047,6 +470047,19 @@ class TemplateManager {
|
|
|
470047
470047
|
subpath: giteeMatch[4]
|
|
470048
470048
|
};
|
|
470049
470049
|
}
|
|
470050
|
+
const cnbMatchWithDash = url.match(/https?:\/\/cnb\.cool\/(.+?)\/-\/tree\/([^\/]+)\/(.+)$/);
|
|
470051
|
+
if (cnbMatchWithDash) {
|
|
470052
|
+
const pathParts = cnbMatchWithDash[1].split('/').filter(p => p.length > 0);
|
|
470053
|
+
if (pathParts.length >= 2) {
|
|
470054
|
+
return {
|
|
470055
|
+
platform: 'cnb',
|
|
470056
|
+
owner: pathParts[0],
|
|
470057
|
+
repo: pathParts.slice(1).join('/'),
|
|
470058
|
+
branch: cnbMatchWithDash[2] || 'main',
|
|
470059
|
+
subpath: cnbMatchWithDash[3]
|
|
470060
|
+
};
|
|
470061
|
+
}
|
|
470062
|
+
}
|
|
470050
470063
|
const cnbMatch = url.match(/https?:\/\/cnb\.cool\/(.+?)(?:\/tree\/([^\/]+)\/(.+))?$/);
|
|
470051
470064
|
if (cnbMatch) {
|
|
470052
470065
|
const pathParts = cnbMatch[1].split('/').filter(p => p.length > 0);
|
|
@@ -470083,6 +470096,38 @@ class TemplateManager {
|
|
|
470083
470096
|
}
|
|
470084
470097
|
throw new error_1.CloudBaseError(`不支持的 Git 平台: ${gitInfo.platform}`);
|
|
470085
470098
|
}
|
|
470099
|
+
cloneWithSubpathOptimized(gitUrl, tempDir, gitInfo, log) {
|
|
470100
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
470101
|
+
try {
|
|
470102
|
+
yield this.git.clone(gitUrl, tempDir, [
|
|
470103
|
+
'--depth', '1',
|
|
470104
|
+
'--single-branch',
|
|
470105
|
+
'--branch', gitInfo.branch,
|
|
470106
|
+
'--filter=blob:none'
|
|
470107
|
+
]);
|
|
470108
|
+
const subpathFull = path_1.default.join(tempDir, gitInfo.subpath);
|
|
470109
|
+
if (!(yield fs_extra_1.default.pathExists(subpathFull))) {
|
|
470110
|
+
throw new error_1.CloudBaseError(`子目录不存在: ${gitInfo.subpath}`);
|
|
470111
|
+
}
|
|
470112
|
+
const tempContentDir = path_1.default.join(tempDir, '.temp-content-' + Date.now());
|
|
470113
|
+
yield fs_extra_1.default.move(subpathFull, tempContentDir);
|
|
470114
|
+
const tempFiles = yield fs_extra_1.default.readdir(tempDir);
|
|
470115
|
+
for (const file of tempFiles) {
|
|
470116
|
+
if (file !== path_1.default.basename(tempContentDir)) {
|
|
470117
|
+
yield fs_extra_1.default.remove(path_1.default.join(tempDir, file));
|
|
470118
|
+
}
|
|
470119
|
+
}
|
|
470120
|
+
const contentFiles = yield fs_extra_1.default.readdir(tempContentDir);
|
|
470121
|
+
for (const file of contentFiles) {
|
|
470122
|
+
yield fs_extra_1.default.move(path_1.default.join(tempContentDir, file), path_1.default.join(tempDir, file));
|
|
470123
|
+
}
|
|
470124
|
+
yield fs_extra_1.default.remove(tempContentDir);
|
|
470125
|
+
}
|
|
470126
|
+
catch (error) {
|
|
470127
|
+
throw new error_1.CloudBaseError(`克隆子目录失败: ${error.message}`, { original: error });
|
|
470128
|
+
}
|
|
470129
|
+
});
|
|
470130
|
+
}
|
|
470086
470131
|
cloneWithSubpath(gitUrl, tempDir, gitInfo, log) {
|
|
470087
470132
|
return __awaiter(this, void 0, void 0, function* () {
|
|
470088
470133
|
try {
|
|
@@ -470135,10 +470180,10 @@ class TemplateManager {
|
|
|
470135
470180
|
log.info(`📦 正在从 ${gitInfo.platform} 下载模板到临时目录...`);
|
|
470136
470181
|
try {
|
|
470137
470182
|
if (gitInfo.subpath) {
|
|
470138
|
-
yield this.
|
|
470183
|
+
yield this.cloneWithSubpathOptimized(gitUrl, tempDir, gitInfo, log);
|
|
470139
470184
|
}
|
|
470140
470185
|
else {
|
|
470141
|
-
yield this.git.clone(gitUrl, tempDir);
|
|
470186
|
+
yield this.git.clone(gitUrl, tempDir, ['--depth', '1', '--single-branch', '--branch', gitInfo.branch]);
|
|
470142
470187
|
}
|
|
470143
470188
|
log.info(`✅ Git 模板下载完成到临时目录`);
|
|
470144
470189
|
}
|
|
@@ -470194,10 +470239,14 @@ class TemplateManager {
|
|
|
470194
470239
|
if (stat.isDirectory()) {
|
|
470195
470240
|
yield fs_extra_1.default.ensureDir(destPath);
|
|
470196
470241
|
const entries = yield fs_extra_1.default.readdir(srcPath, { withFileTypes: true });
|
|
470197
|
-
|
|
470242
|
+
const copyPromises = entries.map(entry => {
|
|
470198
470243
|
const entrySrcPath = path_1.default.join(srcPath, entry.name);
|
|
470199
470244
|
const entryDestPath = path_1.default.join(destPath, entry.name);
|
|
470200
|
-
|
|
470245
|
+
return copyFile(entrySrcPath, entryDestPath);
|
|
470246
|
+
});
|
|
470247
|
+
const chunks = this.chunkArray(copyPromises, 10);
|
|
470248
|
+
for (const chunk of chunks) {
|
|
470249
|
+
yield Promise.all(chunk);
|
|
470201
470250
|
}
|
|
470202
470251
|
}
|
|
470203
470252
|
else {
|
|
@@ -470218,10 +470267,14 @@ class TemplateManager {
|
|
|
470218
470267
|
}
|
|
470219
470268
|
});
|
|
470220
470269
|
const entries = yield fs_extra_1.default.readdir(sourceDir, { withFileTypes: true });
|
|
470221
|
-
|
|
470270
|
+
const copyPromises = entries.map(entry => {
|
|
470222
470271
|
const srcPath = path_1.default.join(sourceDir, entry.name);
|
|
470223
470272
|
const destPath = path_1.default.join(targetDir, entry.name);
|
|
470224
|
-
|
|
470273
|
+
return copyFile(srcPath, destPath);
|
|
470274
|
+
});
|
|
470275
|
+
const chunks = this.chunkArray(copyPromises, 5);
|
|
470276
|
+
for (const chunk of chunks) {
|
|
470277
|
+
yield Promise.all(chunk);
|
|
470225
470278
|
}
|
|
470226
470279
|
log.info(`📊 复制统计: ${copiedCount} 个新文件复制, ${overwrittenCount} 个文件覆盖`);
|
|
470227
470280
|
});
|
|
@@ -470236,10 +470289,14 @@ class TemplateManager {
|
|
|
470236
470289
|
if (stat.isDirectory()) {
|
|
470237
470290
|
yield fs_extra_1.default.ensureDir(destPath);
|
|
470238
470291
|
const entries = yield fs_extra_1.default.readdir(srcPath, { withFileTypes: true });
|
|
470239
|
-
|
|
470292
|
+
const copyPromises = entries.map(entry => {
|
|
470240
470293
|
const entrySrcPath = path_1.default.join(srcPath, entry.name);
|
|
470241
470294
|
const entryDestPath = path_1.default.join(destPath, entry.name);
|
|
470242
|
-
|
|
470295
|
+
return copyFile(entrySrcPath, entryDestPath);
|
|
470296
|
+
});
|
|
470297
|
+
const chunks = this.chunkArray(copyPromises, 10);
|
|
470298
|
+
for (const chunk of chunks) {
|
|
470299
|
+
yield Promise.all(chunk);
|
|
470243
470300
|
}
|
|
470244
470301
|
}
|
|
470245
470302
|
else {
|
|
@@ -470260,14 +470317,25 @@ class TemplateManager {
|
|
|
470260
470317
|
}
|
|
470261
470318
|
});
|
|
470262
470319
|
const entries = yield fs_extra_1.default.readdir(sourceDir, { withFileTypes: true });
|
|
470263
|
-
|
|
470320
|
+
const copyPromises = entries.map(entry => {
|
|
470264
470321
|
const srcPath = path_1.default.join(sourceDir, entry.name);
|
|
470265
470322
|
const destPath = path_1.default.join(targetDir, entry.name);
|
|
470266
|
-
|
|
470323
|
+
return copyFile(srcPath, destPath);
|
|
470324
|
+
});
|
|
470325
|
+
const chunks = this.chunkArray(copyPromises, 5);
|
|
470326
|
+
for (const chunk of chunks) {
|
|
470327
|
+
yield Promise.all(chunk);
|
|
470267
470328
|
}
|
|
470268
470329
|
log.info(`📊 复制统计: ${copiedCount} 个文件复制完成, ${skippedCount} 个文件跳过`);
|
|
470269
470330
|
});
|
|
470270
470331
|
}
|
|
470332
|
+
chunkArray(array, chunkSize) {
|
|
470333
|
+
const chunks = [];
|
|
470334
|
+
for (let i = 0; i < array.length; i += chunkSize) {
|
|
470335
|
+
chunks.push(array.slice(i, i + chunkSize));
|
|
470336
|
+
}
|
|
470337
|
+
return chunks;
|
|
470338
|
+
}
|
|
470271
470339
|
getBuiltinTemplates() {
|
|
470272
470340
|
const templates = {};
|
|
470273
470341
|
for (const [key, template] of Object.entries(BUILTIN_TEMPLATES)) {
|
|
@@ -79,6 +79,10 @@ const AccessType = {
|
|
|
79
79
|
MINIAPP: 'MINIAPP',
|
|
80
80
|
VPC: 'VPC'
|
|
81
81
|
};
|
|
82
|
+
const ResourceTitle = {
|
|
83
|
+
container: '容器型云托管',
|
|
84
|
+
function: '函数型云托管'
|
|
85
|
+
};
|
|
82
86
|
function getCloudrunService(envId) {
|
|
83
87
|
return __awaiter(this, void 0, void 0, function* () {
|
|
84
88
|
const region = yield (0, toolbox_1.getRegion)();
|
|
@@ -598,12 +602,17 @@ let CloudRunDeployCommand = class CloudRunDeployCommand extends common_1.Command
|
|
|
598
602
|
}
|
|
599
603
|
serviceName = yield _inputServiceName(defaultName);
|
|
600
604
|
}
|
|
605
|
+
const containerConfigFile = 'container.config.json';
|
|
606
|
+
const containerConfigPath = path_1.default.join(targetDir, containerConfigFile);
|
|
607
|
+
if (yield fs_extra_1.default.pathExists(containerConfigPath)) {
|
|
608
|
+
log.warn(`CLI 中 ${containerConfigFile} 文件将不会生效,请通过命令行参数进行配置!`);
|
|
609
|
+
}
|
|
601
610
|
if (!force) {
|
|
602
611
|
const answers = yield inquirer_1.default.prompt([
|
|
603
612
|
{
|
|
604
613
|
type: 'confirm',
|
|
605
614
|
name: 'confirm',
|
|
606
|
-
message:
|
|
615
|
+
message: '即将开始部署,是否确认继续?',
|
|
607
616
|
default: true
|
|
608
617
|
}
|
|
609
618
|
]);
|
|
@@ -643,29 +652,25 @@ let CloudRunDeployCommand = class CloudRunDeployCommand extends common_1.Command
|
|
|
643
652
|
function _runDeploy() {
|
|
644
653
|
return __awaiter(this, void 0, void 0, function* () {
|
|
645
654
|
try {
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
})
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
}, function (message) {
|
|
660
|
-
(0, utils_2.trackCallback)(message, log);
|
|
661
|
-
});
|
|
655
|
+
utils_2.trackCallback === null || utils_2.trackCallback === void 0 ? void 0 : (0, utils_2.trackCallback)({
|
|
656
|
+
details: `正在提交${ResourceTitle[serverType]} ${serviceName} 中,请稍候...`,
|
|
657
|
+
status: 'progress'
|
|
658
|
+
}, log);
|
|
659
|
+
yield cloudrunService.deploy({
|
|
660
|
+
serverName: serviceName,
|
|
661
|
+
targetPath: targetDir,
|
|
662
|
+
serverConfig: Object.assign({}, (port ? { Port: Number(port) } : {}))
|
|
663
|
+
});
|
|
664
|
+
utils_2.trackCallback === null || utils_2.trackCallback === void 0 ? void 0 : (0, utils_2.trackCallback)({
|
|
665
|
+
details: `提交${ResourceTitle[serverType]} ${serviceName} 已完成!`,
|
|
666
|
+
status: 'done'
|
|
667
|
+
}, log);
|
|
662
668
|
yield (0, utils_2.upsertCloudbaserc)(targetDir, {
|
|
663
669
|
envId,
|
|
664
670
|
cloudrun: { name: serviceName }
|
|
665
671
|
});
|
|
666
|
-
const { envId: _envId, name, resourceType: _resourceType } = res === null || res === void 0 ? void 0 : res.data;
|
|
667
672
|
(0, utils_2.trackCallback)({
|
|
668
|
-
details: `请打开链接查看部署状态: https://tcb.cloud.tencent.com/dev?envId=${
|
|
673
|
+
details: `请打开链接查看部署状态: https://tcb.cloud.tencent.com/dev?envId=${envId}#/platform-run/service/detail?serverName=${serviceName}&tabId=deploy&envId=${envId}`
|
|
669
674
|
}, log);
|
|
670
675
|
}
|
|
671
676
|
catch (e) {
|
|
@@ -675,7 +680,7 @@ let CloudRunDeployCommand = class CloudRunDeployCommand extends common_1.Command
|
|
|
675
680
|
{
|
|
676
681
|
type: 'confirm',
|
|
677
682
|
name: 'confirm',
|
|
678
|
-
message:
|
|
683
|
+
message: '平台当前有部署发布任务正在运行中。确认继续部署,正在执行的部署任务将被取消,并立即部署最新的代码',
|
|
679
684
|
default: true
|
|
680
685
|
}
|
|
681
686
|
])
|
|
@@ -743,11 +748,11 @@ let CloudRunRunCommand = class CloudRunRunCommand extends common_1.Command {
|
|
|
743
748
|
options: [
|
|
744
749
|
{
|
|
745
750
|
flags: '--runMode <runMode>',
|
|
746
|
-
desc:
|
|
751
|
+
desc: '运行模式,可选值: normal(普通函数) | agent(函数式 Agent),默认值: normal'
|
|
747
752
|
},
|
|
748
753
|
{
|
|
749
754
|
flags: '--agentId <agentId>',
|
|
750
|
-
desc:
|
|
755
|
+
desc: '在 agent 模式下需要提供 Agent ID 进行调试'
|
|
751
756
|
},
|
|
752
757
|
{
|
|
753
758
|
flags: '-e, --envId <envId>',
|
|
@@ -793,7 +798,7 @@ let CloudRunRunCommand = class CloudRunRunCommand extends common_1.Command {
|
|
|
793
798
|
},
|
|
794
799
|
{
|
|
795
800
|
flags: '--open-debug-panel <openDebugPanel>',
|
|
796
|
-
desc:
|
|
801
|
+
desc: '是否打开调试面板,默认为 \'true\''
|
|
797
802
|
}
|
|
798
803
|
],
|
|
799
804
|
requiredEnvId: false,
|
|
@@ -828,7 +833,7 @@ let CloudRunRunCommand = class CloudRunRunCommand extends common_1.Command {
|
|
|
828
833
|
{
|
|
829
834
|
type: 'input',
|
|
830
835
|
name: 'agentId',
|
|
831
|
-
message:
|
|
836
|
+
message: '请输入 Agent ID(如没有请填写任意值):',
|
|
832
837
|
validate: (val) => {
|
|
833
838
|
return val.trim() ? true : 'Agent ID 不能为空';
|
|
834
839
|
}
|
|
@@ -895,7 +900,7 @@ let CloudRunRunCommand = class CloudRunRunCommand extends common_1.Command {
|
|
|
895
900
|
logger.info(`[nodemon ${e.type}] ${e.message}`);
|
|
896
901
|
})
|
|
897
902
|
.on('crash', () => {
|
|
898
|
-
logger.error(
|
|
903
|
+
logger.error('Server crashed.');
|
|
899
904
|
process.exit(1);
|
|
900
905
|
})
|
|
901
906
|
.on('exit', (e) => {
|
package/lib/utils/ai/router.js
CHANGED
|
@@ -393,8 +393,8 @@ class AICommandRouter {
|
|
|
393
393
|
return {
|
|
394
394
|
success: true,
|
|
395
395
|
command: 'npm',
|
|
396
|
-
args: ['install', '-g', '@tencent-ai/codebuddy-code
|
|
397
|
-
message: 'npm install -g @tencent-ai/codebuddy-code
|
|
396
|
+
args: ['install', '-g', '@tencent-ai/codebuddy-code'],
|
|
397
|
+
message: 'npm install -g @tencent-ai/codebuddy-code'
|
|
398
398
|
};
|
|
399
399
|
default:
|
|
400
400
|
return { success: false, message: `# 请查阅 ${agent} 的官方安装文档` };
|
|
@@ -1238,12 +1238,12 @@ class AICommandRouter {
|
|
|
1238
1238
|
}
|
|
1239
1239
|
]);
|
|
1240
1240
|
if (shouldInstall) {
|
|
1241
|
-
yield this.executeCommand('npm', ['install', '-g', '@tencent-ai/codebuddy-code
|
|
1241
|
+
yield this.executeCommand('npm', ['install', '-g', '@tencent-ai/codebuddy-code'], process.env, log);
|
|
1242
1242
|
log.info('✅ codebuddy 安装完成');
|
|
1243
1243
|
}
|
|
1244
1244
|
else {
|
|
1245
1245
|
log.info('❌ codebuddy 未安装,请手动安装');
|
|
1246
|
-
log.info('📦 安装命令: npm install -g @tencent-ai/codebuddy-code
|
|
1246
|
+
log.info('📦 安装命令: npm install -g @tencent-ai/codebuddy-code');
|
|
1247
1247
|
process.exit(1);
|
|
1248
1248
|
}
|
|
1249
1249
|
}
|
package/lib/utils/ai/setup.js
CHANGED
|
@@ -660,7 +660,7 @@ class AISetupWizard {
|
|
|
660
660
|
}
|
|
661
661
|
configureCodebuddyAgent(log) {
|
|
662
662
|
return __awaiter(this, void 0, void 0, function* () {
|
|
663
|
-
log.info(`配置说明可参考 ${(0, output_1.genClickableLink)('https://cnb.
|
|
663
|
+
log.info(`配置说明可参考 ${(0, output_1.genClickableLink)('https://cnb.cool/codebuddy/codebuddy-code/-/blob/main/docs/cli-reference.md')}`);
|
|
664
664
|
const { configMethod } = yield inquirer_1.default.prompt([
|
|
665
665
|
{
|
|
666
666
|
type: 'list',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudbase/cli",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.7",
|
|
4
4
|
"description": "cli tool for cloudbase",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -48,12 +48,12 @@
|
|
|
48
48
|
"license": "ISC",
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@cloudbase/cloud-api": "^0.5.5",
|
|
51
|
-
"@cloudbase/cloudbase-mcp": "^1.8.
|
|
51
|
+
"@cloudbase/cloudbase-mcp": "^1.8.44",
|
|
52
52
|
"@cloudbase/framework-core": "^1.9.7",
|
|
53
53
|
"@cloudbase/functions-framework": "1.16.0",
|
|
54
54
|
"@cloudbase/iac-core": "0.0.3-alpha.11",
|
|
55
55
|
"@cloudbase/lowcode-cli": "^0.22.2",
|
|
56
|
-
"@cloudbase/manager-node": "4.6.
|
|
56
|
+
"@cloudbase/manager-node": "4.6.3",
|
|
57
57
|
"@cloudbase/toolbox": "^0.7.9",
|
|
58
58
|
"@dotenvx/dotenvx": "^1.48.3",
|
|
59
59
|
"@musistudio/claude-code-router": "1.0.36",
|