@lark-people/cli 0.0.6 → 0.0.8

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.
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-people/cli",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "description": "The official CLI for People open platform",
5
5
  "bin": {
6
6
  "people-cli": "scripts/run.js"
@@ -43,19 +43,36 @@ npx @lark-people/cli install
43
43
 
44
44
  ### Step 2: 检查版本并处理更新
45
45
 
46
- 检查是否有更新:
46
+ 必须先执行结构化检查:
47
+
48
+ ```bash
49
+ people-cli update --check --json
50
+ ```
51
+
52
+ 判断规则:
53
+
54
+ - `update_available=true`:必须立即执行 `people-cli update`,不能继续 Step 3 或任何业务命令。
55
+ - `skills_status.in_sync=false`:即使 CLI 已是最新版,也必须立即执行 `people-cli update` 同步 Skills,不能继续 Step 3 或任何业务命令。
56
+ - 只有 `update_available=false`,且 `skills_status.in_sync` 不为 `false` 时,才能继续 Step 3。
57
+ - 命令失败、输出不是合法 JSON、或缺少 `update_available` 字段:改用文本检查兜底。
58
+
59
+ 文本检查兜底:
47
60
 
48
61
  ```bash
49
62
  people-cli update --check
50
63
  ```
51
64
 
52
- 如果提示有新版本,或后续任意 `people-cli` 输出中提示需要更新 CLI / Skills,执行:
65
+ 如果输出包含 `Update available:` 或提示运行 `people-cli update`,即使命令退出码是 0,也代表存在可更新版本;必须立即执行:
53
66
 
54
67
  ```bash
55
68
  people-cli update
56
69
  ```
57
70
 
58
- 更新完成后重新执行 `people-cli --version`。如果更新同步了 Skills,提醒用户退出并重新打开 AI Agent,让新 Skills 生效。
71
+ 更新完成后必须重新执行 `people-cli --version` 和 `people-cli update --check --json`。只有确认 `update_available=false`,且 `skills_status.in_sync` 不为 `false` 后,才能继续 Step 3 或业务命令。
72
+
73
+ 如果 `people-cli update` 失败、更新后版本仍不是最新,或检查结果仍显示 `update_available=true` / `skills_status.in_sync=false`,停止业务操作,并把错误信息和 CLI 返回的 hint 告知用户。
74
+
75
+ 例外:如果 `people-cli update` 返回 `update_error`,且 `hint` 是明确的 `npm install -g @lark-people/cli@...` 或 `pnpm add -g @lark-people/cli@...` 安装命令,可以按该 hint 执行一次手动安装兜底。兜底完成后仍必须重新执行 `people-cli --version` 和 `people-cli update --check --json`;复查不通过时停止业务操作。
59
76
 
60
77
  ### Step 3: 检查用户身份和授权
61
78
 
Binary file