@puyinkai/xiaobao-cli 0.1.9 → 0.1.10
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.
|
@@ -6,7 +6,7 @@ var auth_default = defineCommand({
|
|
|
6
6
|
description: "OAuth 登录 / 身份查询 / 登出(device flow)"
|
|
7
7
|
},
|
|
8
8
|
subCommands: {
|
|
9
|
-
login: () => import("./login-
|
|
9
|
+
login: () => import("./login-EtQi30zd.mjs").then((m) => m.default),
|
|
10
10
|
whoami: () => import("./whoami-z-76WaCP.mjs").then((m) => m.default),
|
|
11
11
|
logout: () => import("./logout-DP7REhCd.mjs").then((m) => m.default)
|
|
12
12
|
}
|
package/dist/cli.mjs
CHANGED
|
@@ -18,7 +18,7 @@ runMain(defineCommand({
|
|
|
18
18
|
description: "旺小宝 CLI — host-agnostic 14 tools (openclaw-xiaobao plugin 的 CLI 等价物)"
|
|
19
19
|
},
|
|
20
20
|
subCommands: {
|
|
21
|
-
auth: () => import("./auth-
|
|
21
|
+
auth: () => import("./auth-B4Yeoxae.mjs").then((m) => m.default),
|
|
22
22
|
project: () => import("./project-BD0g4oAW.mjs").then((m) => m.default),
|
|
23
23
|
consultant: () => import("./consultant-E33hTGUO.mjs").then((m) => m.default),
|
|
24
24
|
audio: () => import("./audio-CRSMqaKo.mjs").then((m) => m.default),
|
|
@@ -127,10 +127,11 @@ var login_default = defineCommand({
|
|
|
127
127
|
writeResult({
|
|
128
128
|
awaiting_authorization: true,
|
|
129
129
|
verification_uri: verificationUri,
|
|
130
|
+
verification_link: `[点击完成旺小宝登录授权](${verificationUri})`,
|
|
130
131
|
user_code: init.user_code,
|
|
131
132
|
expires_in: init.expires_in,
|
|
132
133
|
interval,
|
|
133
|
-
message: "
|
|
134
|
+
message: "把 verification_link(markdown 可点击链接)原样发给用户点击授权,授权完成后跑 `xiaobao-cli auth login --resume` 完成登录。device_code 已安全保存在本地,无需手动传。"
|
|
134
135
|
}, fmt);
|
|
135
136
|
return;
|
|
136
137
|
}
|
package/package.json
CHANGED
|
@@ -53,13 +53,15 @@ xiaobao-cli customer list --portrait 高意向
|
|
|
53
53
|
# 步骤 A:发起,立即返回(约 0.5s),拿到 verification_uri
|
|
54
54
|
xiaobao-cli auth login --no-wait
|
|
55
55
|
# stdout: { "awaiting_authorization": true, "verification_uri": "...",
|
|
56
|
+
# "verification_link": "[点击完成旺小宝登录授权](https://...)",
|
|
56
57
|
# "user_code": "...", "expires_in": 300, "interval": 5, ... }
|
|
57
58
|
# device_code 不在 stdout —— 已安全存到 ~/.xiaobao/pending-auth.json(0600)
|
|
58
59
|
```
|
|
59
60
|
|
|
60
|
-
agent 拿到后:把 `
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
agent 拿到后:把 stdout 里的 `verification_link` 字段**原样**发给用户 —— 它
|
|
62
|
+
已经是 markdown 可点击链接 `[点击完成旺小宝登录授权](https://...)`,直接粘进
|
|
63
|
+
回复正文(**不要**放进代码块 —— 代码块里链接不可点击),用户点一下即可在浏览器
|
|
64
|
+
打开授权。**不要**改写链接、不要做 URL 编码。发完**结束本轮**,把控制权交还用户。
|
|
63
65
|
|
|
64
66
|
```bash
|
|
65
67
|
# 步骤 B:用户回复"授权完成"后,直接换 token(秒级)——
|