@x-all-in-one/coding-helper 0.4.0 → 0.4.1

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.
@@ -7,8 +7,9 @@ export declare class ApiKeyFlow {
7
7
  static getInstance(): ApiKeyFlow;
8
8
  /**
9
9
  * 运行 API Key 配置流程
10
+ * @returns 'success' 验证成功, 'back' 返回上级, undefined 其他情况
10
11
  */
11
- run(): Promise<void>;
12
+ run(): Promise<'success' | 'back' | void>;
12
13
  /**
13
14
  * 输入并验证 API Key
14
15
  */
@@ -24,6 +24,7 @@ export class ApiKeyFlow {
24
24
  }
25
25
  /**
26
26
  * 运行 API Key 配置流程
27
+ * @returns 'success' 验证成功, 'back' 返回上级, undefined 其他情况
27
28
  */
28
29
  async run() {
29
30
  while (true) {
@@ -60,12 +61,12 @@ export class ApiKeyFlow {
60
61
  process.exit(0);
61
62
  }
62
63
  if (action === 'back') {
63
- return;
64
+ return 'back';
64
65
  }
65
66
  if (action === 'input') {
66
67
  const success = await this.inputApiKey();
67
68
  if (success) {
68
- return;
69
+ return 'success';
69
70
  }
70
71
  // 验证失败,继续循环
71
72
  }
@@ -58,7 +58,10 @@ export class Wizard {
58
58
  * 配置 API Key
59
59
  */
60
60
  async configApiKey() {
61
- await apiKeyFlow.run();
61
+ const result = await apiKeyFlow.run();
62
+ if (result === 'success') {
63
+ await this.showMainMenu();
64
+ }
62
65
  }
63
66
  /**
64
67
  * 配置模型(Claude Code 默认3模型配置)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@x-all-in-one/coding-helper",
3
3
  "type": "module",
4
- "version": "0.4.0",
4
+ "version": "0.4.1",
5
5
  "description": "X All In One Coding Helper",
6
6
  "author": "X.AIO",
7
7
  "homepage": "https://docs.x-aio.com/zh/docs",