@lumachat/lumachat 0.15.4 → 0.15.5

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/README.md CHANGED
@@ -1,41 +1,61 @@
1
1
  # LumaChat OpenClaw 通道插件
2
2
 
3
- 该插件用于将 OpenClaw 接入 LumaChat App,当前配对方式为 **OAuth 2.0 Device Flow**(授权码 + 扫码)。
3
+ 用于把 OpenClaw 接入 LumaChat App
4
+ 从 `0.15.5` 开始,登录方式升级为 **OAuth 2.0 Device Flow(仅扫码)**,不再使用“配对码 + 安全码”双码流程。
4
5
 
5
- ## 版本与安装
6
+ ## 快速开始(站在 OpenClaw 用户视角)
6
7
 
7
- 当前版本:`0.15.4`
8
+ ### 1) 安装或升级插件
9
+
10
+ 在 OpenClaw 项目目录执行:
8
11
 
9
12
  ```bash
10
- pnpm openclaw plugins install @lumachat/lumachat@0.15.4
11
- # 或升级
13
+ pnpm openclaw plugins install @lumachat/lumachat@0.15.5
14
+ # 已安装过则可直接升级
12
15
  pnpm openclaw plugins update lumachat
13
16
  openclaw gateway restart
14
17
  ```
15
18
 
16
- ## 配对流程(OAuth 设备授权)
19
+ 建议确认当前插件版本:
17
20
 
18
- 1. 在 Clawdbot 机器执行:
21
+ ```bash
22
+ pnpm openclaw plugins list
23
+ ```
24
+
25
+ ### 2) 发起登录授权
19
26
 
20
27
  ```bash
21
- openclaw channels login --channel lumachat
28
+ pnpm openclaw channels login --channel lumachat
22
29
  ```
23
30
 
24
- 2. 终端会输出:
25
- - 二维码(可直接扫码)
26
- - 6 位授权码(`user_code`,可手动输入)
31
+ 预期输出:
32
+ - 终端二维码(ASCII)
33
+ - 仅显示扫码二维码
34
+
35
+ ### 3) 在 App 内完成授权
27
36
 
28
- 3. LumaChat App 中进入:`设置 -> Clawdbot 配对`
29
- - 可扫码授权
30
- - 或手动输入 6 位授权码
37
+ 打开 LumaChat App:`设置 -> Clawdbot 配对`
38
+ - 直接扫码授权
31
39
 
32
- 4. 授权成功后,插件会自动保存 `channelToken` 并建立连接。
40
+ 授权完成后,插件会自动保存 `channelToken` 并连接网关。
41
+
42
+ ## 常用命令
43
+
44
+ ```bash
45
+ # 重新登录(换绑/重绑)
46
+ pnpm openclaw channels logout --channel lumachat
47
+ pnpm openclaw channels login --channel lumachat
48
+
49
+ # 查看插件版本
50
+ pnpm openclaw plugins list
51
+ ```
33
52
 
34
53
  ## 常见问题
35
54
 
36
- - 提示 `授权码已过期`:重新执行 `openclaw channels login --channel lumachat`
37
- - 提示 `OAuth client_id 无效`:升级插件和后端到最新版本
38
- - 一直等待授权:确认 App 已登录并在配对页完成授权
55
+ - 仍看到“配对码 + 安全码”:当前还在用旧版本,请升级到 `@lumachat/lumachat@0.15.5` 后重启网关。
56
+ - 提示 `授权已过期`:重新执行 `pnpm openclaw channels login --channel lumachat`。
57
+ - 提示 `OAuth client_id 无效`:插件和后端版本不匹配,请同时升级。
58
+ - 一直等待授权:确认 App 已登录账号,并停留在配对页面完成授权。
39
59
 
40
60
  ## 可选环境变量
41
61
 
@@ -44,9 +64,9 @@ openclaw channels login --channel lumachat
44
64
  - `CLAWDCHAT_API_BASE_URL`:同上(兼容旧变量)
45
65
  - `CLAWDCHAT_CHANNEL_KEY` / `CLAWDCHAT_SHARED_KEY`:同上(兼容旧变量)
46
66
 
47
- ## 备注
67
+ ## 技术备注
48
68
 
49
- - 插件 OAuth 相关接口:
69
+ - OAuth 设备授权接口:
50
70
  - `POST /oauth/device/code`
51
71
  - `POST /oauth/token`
52
- - WebSocket 连接地址:`/ws/channel/clawdchat`
72
+ - WebSocket 地址:`/ws/channel/clawdchat`
@@ -2,7 +2,7 @@
2
2
  "id": "lumachat",
3
3
  "name": "LumaChat Channel",
4
4
  "description": "LumaChat mobile channel for OpenClaw",
5
- "version": "0.15.4",
5
+ "version": "0.15.5",
6
6
  "channels": [
7
7
  "lumachat",
8
8
  "clawdchat"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumachat/lumachat",
3
- "version": "0.15.4",
3
+ "version": "0.15.5",
4
4
  "description": "LumaChat channel plugin for OpenClaw",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -24,9 +24,9 @@
24
24
  "channel": {
25
25
  "id": "lumachat",
26
26
  "label": "LumaChat",
27
- "selectionLabel": "LumaChat (授权码/扫码)",
27
+ "selectionLabel": "LumaChat (扫码授权)",
28
28
  "docsPath": "/channels/lumachat",
29
- "blurb": "通过 OAuth 授权码或扫码把 Clawdbot 接入 LumaChat。",
29
+ "blurb": "通过扫码授权把 Clawdbot 接入 LumaChat。",
30
30
  "aliases": [
31
31
  "lumachat",
32
32
  "clawdchat"
package/src/index.ts CHANGED
@@ -388,7 +388,7 @@ const createClawdchatPlugin = (api: OpenClawPluginApi): ChannelPlugin<ResolvedCl
388
388
  case "slow_down":
389
389
  return "slow_down";
390
390
  case "expired_token":
391
- return "授权码已过期,请重新执行登录。";
391
+ return "授权已过期,请重新执行登录。";
392
392
  case "invalid_client":
393
393
  return "OAuth client_id 无效,请升级插件或检查后端配置。";
394
394
  case "invalid_grant":
@@ -430,7 +430,7 @@ const createClawdchatPlugin = (api: OpenClawPluginApi): ChannelPlugin<ResolvedCl
430
430
  const message = formatTokenError(result);
431
431
  if (message === "authorization_pending") {
432
432
  if (onProgress) {
433
- onProgress(`等待授权确认中(授权码 ${session.userCode})...`);
433
+ onProgress("等待扫码授权确认中...");
434
434
  }
435
435
  } else if (message === "slow_down") {
436
436
  pollIntervalMs += DEVICE_AUTH_SLOW_DOWN_ADD_MS;
@@ -906,7 +906,7 @@ const createClawdchatPlugin = (api: OpenClawPluginApi): ChannelPlugin<ResolvedCl
906
906
  const expires = session.expiresAt ? ` (expires ${session.expiresAt})` : "";
907
907
  return {
908
908
  qrDataUrl,
909
- message: `OAuth user code: ${session.userCode}${expires}`,
909
+ message: `请在 LumaChat App 扫码授权${expires}`,
910
910
  };
911
911
  },
912
912
  loginWithQrWait: async ({ accountId, timeoutMs }) => {
@@ -973,11 +973,9 @@ const createClawdchatPlugin = (api: OpenClawPluginApi): ChannelPlugin<ResolvedCl
973
973
  log("LumaChat 扫码授权二维码:");
974
974
  log(terminalQr);
975
975
  } else {
976
- warn("二维码生成失败,请改用 6 位授权码手动输入。");
976
+ warn("二维码生成失败,请重新执行登录。");
977
977
  }
978
- log(`LumaChat 授权码:${session.userCode}`);
979
- log("请在 LumaChat App -> 设置 -> Clawdbot 配对 中输入授权码,或直接扫码授权。");
980
- log(`授权链接:${session.verificationUriComplete}`);
978
+ log("请在 LumaChat App -> 设置 -> Clawdbot 配对 中扫码授权。");
981
979
 
982
980
  const expiresAtMs = parseUtcTimestamp(session.expiresAt);
983
981
  const deadline = expiresAtMs && Number.isFinite(expiresAtMs)