@cloudbase/cli 2.8.21 → 2.8.23

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/bin/tcb.js CHANGED
@@ -148,13 +148,17 @@ async function main() {
148
148
  * 处理异常
149
149
  */
150
150
  async function errorHandler(err) {
151
- beaconAction.report('tcb_cli_error', {
152
- name: err.name,
153
- message: err.message,
154
- stack: err.stack,
155
- requestId: err.requestId,
156
- canIgnore: 'false'
157
- })
151
+ try {
152
+ await beaconAction.report('tcb_cli_error', {
153
+ name: err.name,
154
+ message: err.message,
155
+ stack: err.stack,
156
+ requestId: err.requestId,
157
+ canIgnore: 'false'
158
+ })
159
+ } catch (error) {
160
+ // 静默处理上报错误,不影响主程序运行
161
+ }
158
162
  process.emit('tcbError')
159
163
  const stackIngoreErrors = ['TencentCloudSDKHttpException', 'CloudBaseError']
160
164
  // 忽略自定义错误的错误栈
@@ -155,13 +155,17 @@ async function main() {
155
155
  * 处理异常
156
156
  */
157
157
  async function errorHandler(err) {
158
- beaconAction.report('tcb_cli_error', {
159
- name: err.name,
160
- message: err.message,
161
- stack: err.stack,
162
- requestId: err.requestId,
163
- canIgnore: 'false'
164
- })
158
+ try {
159
+ await beaconAction.report('tcb_cli_error', {
160
+ name: err.name,
161
+ message: err.message,
162
+ stack: err.stack,
163
+ requestId: err.requestId,
164
+ canIgnore: 'false'
165
+ })
166
+ } catch (error) {
167
+ // 静默处理上报错误,不影响主程序运行
168
+ }
165
169
  process.emit('tcbError')
166
170
  const stackIngoreErrors = ['TencentCloudSDKHttpException', 'CloudBaseError']
167
171
  // 忽略自定义错误的错误栈
@@ -999,16 +1003,30 @@ AICommand = __decorate([
999
1003
  ], AICommand);
1000
1004
  exports.AICommand = AICommand;
1001
1005
  function reportAIUsage(agent, hasEnvId, subCommand) {
1002
- return report_1.beaconAction.report('ai_command_usage', {
1003
- agent,
1004
- hasEnvId,
1005
- subCommand
1006
+ return __awaiter(this, void 0, void 0, function* () {
1007
+ try {
1008
+ return yield report_1.beaconAction.report('ai_command_usage', {
1009
+ agent,
1010
+ hasEnvId,
1011
+ subCommand
1012
+ });
1013
+ }
1014
+ catch (error) {
1015
+ return null;
1016
+ }
1006
1017
  });
1007
1018
  }
1008
1019
  function reportAIError(agent, error) {
1009
- return report_1.beaconAction.report('ai_command_error', {
1010
- agent,
1011
- error
1020
+ return __awaiter(this, void 0, void 0, function* () {
1021
+ try {
1022
+ return yield report_1.beaconAction.report('ai_command_error', {
1023
+ agent,
1024
+ error
1025
+ });
1026
+ }
1027
+ catch (error) {
1028
+ return null;
1029
+ }
1012
1030
  });
1013
1031
  }
1014
1032
 
@@ -2658,11 +2676,15 @@ class Command extends events_1.EventEmitter {
2658
2676
  login_uin: loginState === null || loginState === void 0 ? void 0 : loginState['uin'],
2659
2677
  envId: envId || (loginState === null || loginState === void 0 ? void 0 : loginState['envId'])
2660
2678
  });
2661
- report_1.beaconAction.report('tcb_cli_exec_command', {
2662
- cmd,
2663
- childCmd,
2664
- desc
2665
- });
2679
+ try {
2680
+ yield report_1.beaconAction.report('tcb_cli_exec_command', {
2681
+ cmd,
2682
+ childCmd,
2683
+ desc
2684
+ });
2685
+ }
2686
+ catch (error) {
2687
+ }
2666
2688
  const ctx = {
2667
2689
  cmd,
2668
2690
  envId,
@@ -23751,21 +23773,26 @@ class BeaconAction {
23751
23773
  report(eventCode, eventData = {}) {
23752
23774
  return __awaiter(this, void 0, void 0, function* () {
23753
23775
  const now = Date.now();
23754
- return (0, net_1.postFetch)('https://otheve.beacon.qq.com/analytics/v2_upload', {
23755
- appVersion: '',
23756
- sdkId: 'js',
23757
- sdkVersion: '4.5.14-web',
23758
- mainAppKey: '0WEB0AD0GM4PUUU1',
23759
- platformId: 3,
23760
- common: Object.assign({ A2: this.deviceId, A101: this.userAgent, from: 'tcb-cli', xDeployEnv: "production" }, this.additionalParams),
23761
- events: [
23762
- {
23763
- eventCode,
23764
- eventTime: String(now),
23765
- mapValue: Object.assign({}, eventData)
23766
- }
23767
- ]
23768
- });
23776
+ try {
23777
+ return yield (0, net_1.postFetch)('https://otheve.beacon.qq.com/analytics/v2_upload', {
23778
+ appVersion: '',
23779
+ sdkId: 'js',
23780
+ sdkVersion: '4.5.14-web',
23781
+ mainAppKey: '0WEB0AD0GM4PUUU1',
23782
+ platformId: 3,
23783
+ common: Object.assign({ A2: this.deviceId, A101: this.userAgent, from: 'tcb-cli', xDeployEnv: "production" }, this.additionalParams),
23784
+ events: [
23785
+ {
23786
+ eventCode,
23787
+ eventTime: String(now),
23788
+ mapValue: Object.assign({}, eventData)
23789
+ }
23790
+ ]
23791
+ });
23792
+ }
23793
+ catch (error) {
23794
+ return null;
23795
+ }
23769
23796
  });
23770
23797
  }
23771
23798
  addAdditionalParams(params) {
@@ -617772,7 +617799,7 @@ module.exports = {"version":"3.13.1"};
617772
617799
  /***/ ((module) => {
617773
617800
 
617774
617801
  "use strict";
617775
- module.exports = /*#__PURE__*/JSON.parse('{"name":"@cloudbase/cli","version":"2.8.20","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":{"cloudbase":"bin/cloudbase.js","cloudbase-mcp":"bin/cloudbase-mcp.cjs","tcb":"bin/tcb.js","ccr":"bin/ccr.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.32","@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.4.4","@cloudbase/toolbox":"^0.7.7","@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","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","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","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"}');
617802
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"@cloudbase/cli","version":"2.8.22","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":{"cloudbase":"bin/cloudbase.js","cloudbase-mcp":"bin/cloudbase-mcp.cjs","tcb":"bin/tcb.js","ccr":"bin/ccr.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.32","@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.4.4","@cloudbase/toolbox":"^0.7.7","@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","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","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","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"}');
617776
617803
 
617777
617804
  /***/ })
617778
617805
 
@@ -157,15 +157,29 @@ AICommand = __decorate([
157
157
  ], AICommand);
158
158
  exports.AICommand = AICommand;
159
159
  function reportAIUsage(agent, hasEnvId, subCommand) {
160
- return report_1.beaconAction.report('ai_command_usage', {
161
- agent,
162
- hasEnvId,
163
- subCommand
160
+ return __awaiter(this, void 0, void 0, function* () {
161
+ try {
162
+ return yield report_1.beaconAction.report('ai_command_usage', {
163
+ agent,
164
+ hasEnvId,
165
+ subCommand
166
+ });
167
+ }
168
+ catch (error) {
169
+ return null;
170
+ }
164
171
  });
165
172
  }
166
173
  function reportAIError(agent, error) {
167
- return report_1.beaconAction.report('ai_command_error', {
168
- agent,
169
- error
174
+ return __awaiter(this, void 0, void 0, function* () {
175
+ try {
176
+ return yield report_1.beaconAction.report('ai_command_error', {
177
+ agent,
178
+ error
179
+ });
180
+ }
181
+ catch (error) {
182
+ return null;
183
+ }
170
184
  });
171
185
  }
@@ -162,11 +162,15 @@ class Command extends events_1.EventEmitter {
162
162
  login_uin: loginState === null || loginState === void 0 ? void 0 : loginState['uin'],
163
163
  envId: envId || (loginState === null || loginState === void 0 ? void 0 : loginState['envId'])
164
164
  });
165
- report_1.beaconAction.report('tcb_cli_exec_command', {
166
- cmd,
167
- childCmd,
168
- desc
169
- });
165
+ try {
166
+ yield report_1.beaconAction.report('tcb_cli_exec_command', {
167
+ cmd,
168
+ childCmd,
169
+ desc
170
+ });
171
+ }
172
+ catch (error) {
173
+ }
170
174
  const ctx = {
171
175
  cmd,
172
176
  envId,
@@ -48,21 +48,26 @@ class BeaconAction {
48
48
  report(eventCode, eventData = {}) {
49
49
  return __awaiter(this, void 0, void 0, function* () {
50
50
  const now = Date.now();
51
- return (0, net_1.postFetch)('https://otheve.beacon.qq.com/analytics/v2_upload', {
52
- appVersion: '',
53
- sdkId: 'js',
54
- sdkVersion: '4.5.14-web',
55
- mainAppKey: '0WEB0AD0GM4PUUU1',
56
- platformId: 3,
57
- common: Object.assign({ A2: this.deviceId, A101: this.userAgent, from: 'tcb-cli', xDeployEnv: process.env.NODE_ENV }, this.additionalParams),
58
- events: [
59
- {
60
- eventCode,
61
- eventTime: String(now),
62
- mapValue: Object.assign({}, eventData)
63
- }
64
- ]
65
- });
51
+ try {
52
+ return yield (0, net_1.postFetch)('https://otheve.beacon.qq.com/analytics/v2_upload', {
53
+ appVersion: '',
54
+ sdkId: 'js',
55
+ sdkVersion: '4.5.14-web',
56
+ mainAppKey: '0WEB0AD0GM4PUUU1',
57
+ platformId: 3,
58
+ common: Object.assign({ A2: this.deviceId, A101: this.userAgent, from: 'tcb-cli', xDeployEnv: process.env.NODE_ENV }, this.additionalParams),
59
+ events: [
60
+ {
61
+ eventCode,
62
+ eventTime: String(now),
63
+ mapValue: Object.assign({}, eventData)
64
+ }
65
+ ]
66
+ });
67
+ }
68
+ catch (error) {
69
+ return null;
70
+ }
66
71
  });
67
72
  }
68
73
  addAdditionalParams(params) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/cli",
3
- "version": "2.8.21",
3
+ "version": "2.8.23",
4
4
  "description": "cli tool for cloudbase",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -0,0 +1,93 @@
1
+ # SSL错误修复技术方案设计
2
+
3
+ ## 架构概述
4
+
5
+ 采用多层解决方案架构,从检测到自动修复,提供完整的SSL错误处理流程。
6
+
7
+ ## 技术栈
8
+
9
+ - **错误检测层**:Node.js错误捕获 + SSL协议检测
10
+ - **配置管理层**:环境变量管理 + Node.js配置
11
+ - **网络适配层**:代理配置 + SSL降级处理
12
+ - **用户交互层**:CLI交互 + 自动修复
13
+
14
+ ## 技术选型
15
+
16
+ ### 1. SSL错误检测
17
+ - 使用 `process.on('uncaughtException')` 捕获SSL错误
18
+ - 通过错误信息模式匹配识别SSL协议问题
19
+ - 集成环境信息收集功能
20
+
21
+ ### 2. SSL配置优化
22
+ - 使用 `process.env.NODE_OPTIONS` 设置SSL配置
23
+ - 支持 `--tls-min-v1.2` 和 `--tls-max-v1.3` 参数
24
+ - 提供环境变量配置选项
25
+
26
+ ### 3. 网络适配
27
+ - 集成现有的代理配置系统
28
+ - 支持企业网络环境检测
29
+ - 提供SSL证书验证选项
30
+
31
+ ## 数据库/接口设计
32
+
33
+ ### 配置存储
34
+ ```typescript
35
+ interface SSLConfig {
36
+ tlsMinVersion: string;
37
+ tlsMaxVersion: string;
38
+ secureProtocol: string;
39
+ rejectUnauthorized: boolean;
40
+ proxyEnabled: boolean;
41
+ proxyUrl?: string;
42
+ }
43
+ ```
44
+
45
+ ### 错误诊断接口
46
+ ```typescript
47
+ interface SSLDiagnostic {
48
+ errorType: 'EPROTO' | 'CERTIFICATE' | 'PROXY' | 'UNKNOWN';
49
+ errorMessage: string;
50
+ environment: {
51
+ nodeVersion: string;
52
+ platform: string;
53
+ arch: string;
54
+ sslVersion: string;
55
+ };
56
+ solutions: SSLSolution[];
57
+ }
58
+ ```
59
+
60
+ ## 测试策略
61
+
62
+ 1. **单元测试**:SSL配置函数测试
63
+ 2. **集成测试**:错误检测和修复流程测试
64
+ 3. **环境测试**:Windows 11 PowerShell环境测试
65
+ 4. **兼容性测试**:不同Node.js版本兼容性测试
66
+
67
+ ## 安全性
68
+
69
+ - 保持SSL证书验证的完整性
70
+ - 提供安全的代理配置选项
71
+ - 避免降低安全性的降级方案
72
+
73
+ ## 实施计划
74
+
75
+ ### 阶段1:错误检测与诊断
76
+ - 实现SSL错误自动检测
77
+ - 添加环境信息收集
78
+ - 提供诊断报告功能
79
+
80
+ ### 阶段2:配置优化
81
+ - 实现SSL配置自动优化
82
+ - 添加环境变量配置
83
+ - 提供代理配置选项
84
+
85
+ ### 阶段3:降级处理
86
+ - 实现TLS版本降级
87
+ - 添加兼容性模式
88
+ - 提供自动修复功能
89
+
90
+ ### 阶段4:用户交互
91
+ - 实现CLI交互界面
92
+ - 添加自动修复选项
93
+ - 提供配置管理功能
@@ -0,0 +1,47 @@
1
+ # SSL错误修复需求文档
2
+
3
+ ## 介绍
4
+
5
+ Windows 11 PowerShell环境下运行 `tcb ai` 时出现SSL协议版本不匹配错误,需要提供多种解决方案。
6
+
7
+ ## 需求
8
+
9
+ ### 需求 1 - SSL错误检测与诊断
10
+
11
+ **用户故事:** 当用户遇到SSL错误时,系统应当能够自动检测并提供诊断信息
12
+
13
+ #### 验收标准
14
+
15
+ 1. When 检测到SSL错误时,the 系统 shall 提供详细的错误诊断信息
16
+ 2. When 检测到SSL错误时,the 系统 shall 提供多种解决方案选项
17
+ 3. When 检测到SSL错误时,the 系统 shall 提供环境信息收集功能
18
+
19
+ ### 需求 2 - SSL配置优化
20
+
21
+ **用户故事:** 系统应当提供SSL配置优化选项来解决协议版本不匹配问题
22
+
23
+ #### 验收标准
24
+
25
+ 1. When 用户选择SSL配置优化时,the 系统 shall 提供Node.js SSL配置选项
26
+ 2. When 用户选择SSL配置优化时,the 系统 shall 提供环境变量配置选项
27
+ 3. When 用户选择SSL配置优化时,the 系统 shall 提供代理配置选项
28
+
29
+ ### 需求 3 - 降级兼容性处理
30
+
31
+ **用户故事:** 系统应当提供降级到兼容SSL版本的选项
32
+
33
+ #### 验收标准
34
+
35
+ 1. When 用户选择降级处理时,the 系统 shall 自动设置兼容的SSL协议版本
36
+ 2. When 用户选择降级处理时,the 系统 shall 提供TLS 1.2兼容模式
37
+ 3. When 用户选择降级处理时,the 系统 shall 保持功能完整性
38
+
39
+ ### 需求 4 - 网络环境适配
40
+
41
+ **用户故事:** 系统应当能够适配不同的网络环境配置
42
+
43
+ #### 验收标准
44
+
45
+ 1. When 检测到企业网络环境时,the 系统 shall 提供代理配置指导
46
+ 2. When 检测到防火墙限制时,the 系统 shall 提供绕过方案
47
+ 3. When 检测到SSL证书问题时,the 系统 shall 提供证书验证选项
@@ -0,0 +1,65 @@
1
+ # SSL错误修复实施计划
2
+
3
+ ## 任务拆分
4
+
5
+ - [x] 1. SSL错误检测模块开发
6
+ - 实现SSL错误自动捕获机制
7
+ - 添加错误模式识别功能
8
+ - 集成环境信息收集
9
+ - _需求: 需求1
10
+
11
+ - [x] 2. SSL配置优化模块开发
12
+ - 实现Node.js SSL配置自动设置
13
+ - 添加环境变量配置功能
14
+ - 集成代理配置选项
15
+ - _需求: 需求2
16
+
17
+ - [x] 3. 降级兼容性处理模块开发
18
+ - 实现TLS版本降级功能
19
+ - 添加TLS 1.2兼容模式
20
+ - 确保功能完整性
21
+ - _需求: 需求3
22
+
23
+ - [x] 4. 网络环境适配模块开发
24
+ - 实现企业网络环境检测
25
+ - 添加防火墙绕过方案
26
+ - 提供证书验证选项
27
+ - _需求: 需求4
28
+
29
+ - [x] 5. 用户交互界面开发
30
+ - 实现CLI交互界面
31
+ - 添加自动修复选项
32
+ - 提供配置管理功能
33
+ - _需求: 需求1, 需求2, 需求3, 需求4
34
+
35
+ - [x] 6. 测试与验证
36
+ - 单元测试编写
37
+ - 集成测试执行
38
+ - Windows 11环境测试
39
+ - 兼容性测试验证
40
+ - _需求: 需求1, 需求2, 需求3, 需求4
41
+
42
+ - [x] 7. 文档与部署
43
+ - 用户使用文档编写
44
+ - 故障排除指南更新
45
+ - 部署脚本更新
46
+ - _需求: 需求1, 需求2, 需求3, 需求4
47
+
48
+ ## 优先级排序
49
+
50
+ 1. **高优先级**:任务1、任务2(核心功能)
51
+ 2. **中优先级**:任务3、任务4(兼容性)
52
+ 3. **低优先级**:任务5、任务6、任务7(完善)
53
+
54
+ ## 风险评估
55
+
56
+ - **技术风险**:SSL配置可能影响其他功能
57
+ - **兼容性风险**:不同Node.js版本兼容性
58
+ - **安全风险**:降级方案可能降低安全性
59
+
60
+ ## 成功标准
61
+
62
+ - SSL错误自动检测准确率 > 95%
63
+ - 自动修复成功率 > 90%
64
+ - 用户满意度 > 85%
65
+ - 无安全漏洞引入