@lotaber_wang/openclaw-dc-plugin 0.1.15 → 0.1.16

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
@@ -9,7 +9,7 @@
9
9
  请这样安装:
10
10
 
11
11
  ```bash
12
- openclaw plugins install @lotaber_wang/openclaw-dc-plugin@0.1.15
12
+ openclaw plugins install @lotaber_wang/openclaw-dc-plugin@0.1.16
13
13
  ```
14
14
 
15
15
  不要这样安装:
@@ -67,7 +67,7 @@ openclaw gateway restart
67
67
  ## 推荐安装流程
68
68
 
69
69
  ```bash
70
- openclaw plugins install @lotaber_wang/openclaw-dc-plugin@0.1.15
70
+ openclaw plugins install @lotaber_wang/openclaw-dc-plugin@0.1.16
71
71
  openclaw plugins inspect openclaw-dc-plugin
72
72
  echo 'TapTap DC 插件已安装完成。OpenClaw 接下来如需重启 Gateway,应先通过飞书或其他通信插件通知用户;重启完成后即可使用 taptap_dc_* 工具。'
73
73
  openclaw gateway restart
@@ -77,7 +77,7 @@ openclaw gateway restart
77
77
 
78
78
  - `install` 负责把插件包装进 OpenClaw
79
79
  - `inspect` 用来确认插件元信息、skills、tools 是否已被 Gateway 识别
80
- - 从 `0.1.15` 开始,插件包不再声明 `openclaw` 的 `peerDependencies`,避免误用 `npm install` 时把 OpenClaw 宿主大依赖树一起拉下来
80
+ - 从 `0.1.16` 开始,插件包不再声明 `openclaw` 的 `peerDependencies`,避免误用 `npm install` 时把 OpenClaw 宿主大依赖树一起拉下来
81
81
  - 如果有人误用 `npm install` 或 `npm install -g`,插件包会在 `postinstall` 阶段打印醒目的纠正提示
82
82
  - 如果宿主判断需要重启 Gateway,必须先通过飞书或其他通信插件通知用户,再重启
83
83
  - 如果 10-30 秒后还没生效,再手动执行 `gateway restart`
@@ -147,7 +147,7 @@ openclaw gateway restart
147
147
 
148
148
  如果安装后看不到 `taptap_dc_*` 工具,优先按这个顺序排查:
149
149
 
150
- 1. 确认安装的是 `@lotaber_wang/openclaw-dc-plugin@0.1.15` 或更新版本
150
+ 1. 确认安装的是 `@lotaber_wang/openclaw-dc-plugin@0.1.16` 或更新版本
151
151
  2. 执行 `openclaw plugins inspect openclaw-dc-plugin`
152
152
  3. 如果宿主要求重启 Gateway,先通过飞书或其他通信插件向用户发送安装完成提示
153
153
  4. 再执行 `openclaw gateway restart`
@@ -175,7 +175,7 @@ openclaw gateway restart
175
175
  - OpenClaw 进程是否有临时目录写权限
176
176
  - OpenClaw 是否已经完成 Gateway 重启
177
177
 
178
- 从 `0.1.15` 开始,插件安装链路与 bridge 会额外做这些兼容处理:
178
+ 从 `0.1.16` 开始,插件安装链路与 bridge 会额外做这些兼容处理:
179
179
 
180
180
  - 在 `package.json` 中补充 `openclaw.install.npmSpec`,让安装链路更稳定
181
181
  - 在 `package.json` 的 `openclaw.install` 中补充 `preferredCommand` / `doNotUseCommands` / `wrongInstallHint`
@@ -195,3 +195,4 @@ openclaw gateway restart
195
195
  - 过滤 PTY 场景下被回显到 stdout 的请求消息
196
196
  - 授权结果会把裸授权直链放在最前面,并在 `details.preferred_auth_url` / `details.auth_links` 中重复返回,降低宿主偶发吞链路时的影响
197
197
  - 如果原始 tool 调用直接抛出“缺少认证信息”错误,bridge 也会从错误文本里提取 `wrapped_auth_url`,并补出 `preferred_auth_url`、手机端点击链接,以及“从 code 参数 decodeURIComponent 得到直链”的解析提示
198
+ - 从这版开始,授权提示会同时保留 `desktop_scan_url` 和 `mobile_click_url`;只要发生转发就默认保留这两条,因为飞书消息也可能在 PC 端打开。同时明确要求在飞书等 IM 中优先使用 markdown 链接格式,避免 `_` 等字符导致裸链接被截断
package/index.js CHANGED
@@ -5,7 +5,7 @@ import { TapTapMcpBridge } from './lib/mcp-bridge.js';
5
5
  const RESTART_NOTICE =
6
6
  'TapTap DC 插件已安装完成。OpenClaw 接下来如需重启 Gateway,应先通过飞书或其他通信插件通知用户;重启完成后即可使用 taptap_dc_* 工具。';
7
7
  const PREFERRED_INSTALL_COMMAND =
8
- 'openclaw plugins install @lotaber_wang/openclaw-dc-plugin@0.1.15';
8
+ 'openclaw plugins install @lotaber_wang/openclaw-dc-plugin@0.1.16';
9
9
  const WRONG_INSTALL_HINT =
10
10
  '这是 OpenClaw 插件包,不是普通 npm CLI 包。请不要直接用 npm install,改用 openclaw plugins install。';
11
11
 
@@ -74,6 +74,14 @@ function buildMarkdownLink(label, url) {
74
74
  return `[${label}](${url})`;
75
75
  }
76
76
 
77
+ function buildAutolink(url) {
78
+ if (!url) {
79
+ return '-';
80
+ }
81
+
82
+ return `<${url}>`;
83
+ }
84
+
77
85
  function tryParseUrl(value) {
78
86
  if (!value || typeof value !== 'string') {
79
87
  return null;
@@ -110,16 +118,25 @@ function extractUrlsFromText(value) {
110
118
  }
111
119
 
112
120
  function buildAuthLinkParseHint(wrappedAuthUrl, directAuthUrl, preferredAuthUrl) {
121
+ const desktopScanUrl = wrappedAuthUrl || null;
122
+ const mobileClickUrl = preferredAuthUrl || directAuthUrl || wrappedAuthUrl || null;
113
123
  return {
114
- mobile_click_url: preferredAuthUrl || directAuthUrl || wrappedAuthUrl || null,
124
+ desktop_scan_url: desktopScanUrl,
125
+ mobile_click_url: mobileClickUrl,
115
126
  wrapped_auth_url: wrappedAuthUrl || null,
116
127
  direct_auth_url: directAuthUrl || null,
128
+ desktop_scan_markdown: desktopScanUrl ? buildMarkdownLink('PC 扫码授权页', desktopScanUrl) : null,
129
+ mobile_click_markdown: mobileClickUrl
130
+ ? buildMarkdownLink('手机直接授权', mobileClickUrl)
131
+ : null,
117
132
  parse_rule:
118
133
  wrappedAuthUrl && directAuthUrl
119
134
  ? '如果只有 wrapped_auth_url,请读取其中的 code 参数,并执行一次 decodeURIComponent(code),得到 direct_auth_url。手机端优先打开 direct_auth_url。'
120
135
  : '如果当前是手机端会话,请优先展示 preferred_auth_url;如果宿主吞掉超链接,就直接输出这条裸 URL。',
121
136
  display_rule:
122
- '如果当前是手机端或移动端对话,请把 mobile_click_url 单独作为一条消息再次发给用户,便于直接点击授权。',
137
+ '如果需要转发给用户,默认同时保留 desktop_scan_url 和 mobile_click_url 两条链接;即使是飞书消息也这样处理,因为飞书可能在 PC 端打开。手机端对话时可以额外再单独发一次 mobile_click_url。',
138
+ lark_render_rule:
139
+ '飞书或其他 IM 中,转发时默认同时给出 [PC 扫码授权页](desktop_scan_url) 与 [手机直接授权](mobile_click_url) 两条 markdown 链接;如果 markdown 被吞掉,再分别单独发送两行 <URL>。',
123
140
  };
124
141
  }
125
142
 
@@ -345,30 +362,33 @@ function buildAuthGuideText(authPayload) {
345
362
  const directAuthUrl = enriched?.direct_auth_url;
346
363
  const wrappedAuthUrl = enriched?.wrapped_auth_url;
347
364
  const qrcodeUrl = enriched?.qrcode_url;
365
+ const desktopScanUrl = wrappedAuthUrl || qrcodeUrl || null;
366
+ const mobileClickUrl = preferredAuthUrl || directAuthUrl || wrappedAuthUrl || null;
348
367
  const lines = ['当前还没有完成 TapTap 授权,请先完成一次授权。'];
349
368
 
350
- if (preferredAuthUrl) {
369
+ if (desktopScanUrl) {
351
370
  lines.push(
352
371
  '',
353
- '优先打开下面这条授权直链。这一行会同时保留裸链接,方便手机端直接点击,或在宿主吞掉超链接时复制打开:',
354
- preferredAuthUrl,
355
- `<${preferredAuthUrl}>`
372
+ 'PC / 桌面端请保留下面这条扫码授权页链接,避免宿主只保留手机直链后导致电脑端链路断掉:',
373
+ buildMarkdownLink('PC 扫码授权页', desktopScanUrl),
374
+ buildAutolink(desktopScanUrl)
356
375
  );
357
376
  }
358
377
 
359
- if (preferredAuthUrl || directAuthUrl || wrappedAuthUrl || qrcodeUrl) {
378
+ if (mobileClickUrl) {
360
379
  lines.push(
361
380
  '',
362
- '可点击版本:',
363
- `- ${buildMarkdownLink('直接点击授权', preferredAuthUrl || directAuthUrl)}`,
364
- `- ${buildMarkdownLink('打开 TapTap 包装授权页', wrappedAuthUrl)}`,
365
- `- ${buildMarkdownLink('打开授权页直链', qrcodeUrl || directAuthUrl || preferredAuthUrl)}`
381
+ '手机端请额外再给用户一条可直接点击的授权链接:',
382
+ buildMarkdownLink('手机直接授权', mobileClickUrl),
383
+ buildAutolink(mobileClickUrl)
366
384
  );
367
385
  }
368
386
 
369
387
  lines.push(
370
388
  '',
371
- '如果你在手机上对话,优先直接点上面的第一条裸链接;如果超链接显示异常,优先使用 details.preferred_auth_url。',
389
+ '如果需要把授权信息转发给用户,请默认同时保留“PC 扫码授权页”和“手机直接授权”两条链接,因为飞书消息也可能在 PC 端打开。',
390
+ '如果你当前就是手机端对话,可以额外强调“手机直接授权”;但不要把 PC 扫码授权页删掉。',
391
+ '如果超链接显示异常,优先使用 markdown 链接;如果 markdown 仍被吞掉,再单独输出一行 `<URL>`。',
372
392
  '完成授权后,请继续调用 `taptap_dc_complete_authorization`,然后再次调用 `taptap_dc_quick_brief`。'
373
393
  );
374
394
 
@@ -380,6 +400,14 @@ function buildAuthGuideText(authPayload) {
380
400
  lines.push('', `preferred_auth_url:${preferredAuthUrl}`);
381
401
  }
382
402
 
403
+ if (desktopScanUrl) {
404
+ lines.push(`desktop_scan_url:${desktopScanUrl}`);
405
+ }
406
+
407
+ if (mobileClickUrl) {
408
+ lines.push(`mobile_click_url:${mobileClickUrl}`);
409
+ }
410
+
383
411
  if (directAuthUrl && directAuthUrl !== preferredAuthUrl) {
384
412
  lines.push('', `直接授权链接:${directAuthUrl}`);
385
413
  }
@@ -395,7 +423,9 @@ function buildAuthGuideText(authPayload) {
395
423
  lines.push(
396
424
  '',
397
425
  '给 Agent / 龙虾的额外处理提示:',
398
- '- 如果当前是手机端对话,请把 `preferred_auth_url` `mobile_auth_url` 单独再发一条消息给用户,方便直接点击授权。',
426
+ '- 只要发生转发,就默认同时展示 `desktop_scan_url` `mobile_click_url`,不要只保留其中一条,因为飞书也可能在 PC 端打开。',
427
+ '- 如果当前是手机端对话,可以把 `mobile_click_url` 单独再发一条消息给用户,方便直接点击授权,但仍要保留 `desktop_scan_url`。',
428
+ '- 通过飞书或其他通信插件转发时,优先使用 markdown 链接格式:`[PC 扫码授权页](desktop_scan_url)` 与 `[手机直接授权](mobile_click_url)`;如果 markdown 被吞掉,再分别发两条仅包含 `<URL>` 的消息。',
399
429
  '- 如果你只拿到了 TapTap 包装授权页(`wrapped_auth_url`),请取其中的 `code` 参数,再执行一次 `decodeURIComponent(code)`,即可得到更适合手机端直接点击的 `direct_auth_url`。',
400
430
  '- 如果宿主把 markdown 链接吞掉了,请直接输出 `details.preferred_auth_url` 这条裸 URL,不要只说“请扫码”。'
401
431
  );
@@ -2,7 +2,7 @@
2
2
  "id": "openclaw-dc-plugin",
3
3
  "name": "TapTap DC",
4
4
  "description": "面向 OpenClaw 的 TapTap DC 插件。请使用 openclaw plugins install 安装,不要直接 npm install;如需重启 Gateway,应先通过飞书或其他通信插件通知用户。",
5
- "version": "0.1.15",
5
+ "version": "0.1.16",
6
6
  "enabledByDefault": true,
7
7
  "skills": ["./skills"],
8
8
  "configSchema": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lotaber_wang/openclaw-dc-plugin",
3
- "version": "0.1.15",
3
+ "version": "0.1.16",
4
4
  "type": "module",
5
5
  "description": "TapTap DC 的 OpenClaw 插件。请使用 openclaw plugins install 安装,不要直接 npm install;如需重启 Gateway,应先通过飞书或其他通信插件通知用户。",
6
6
  "main": "index.js",
@@ -13,12 +13,12 @@
13
13
  ],
14
14
  "install": {
15
15
  "npmSpec": "@lotaber_wang/openclaw-dc-plugin",
16
- "preferredCommand": "openclaw plugins install @lotaber_wang/openclaw-dc-plugin@0.1.15",
16
+ "preferredCommand": "openclaw plugins install @lotaber_wang/openclaw-dc-plugin@0.1.16",
17
17
  "doNotUseCommands": [
18
18
  "npm install @lotaber_wang/openclaw-dc-plugin",
19
19
  "npm install -g @lotaber_wang/openclaw-dc-plugin"
20
20
  ],
21
- "wrongInstallHint": "这是 OpenClaw 插件包,不是普通 npm CLI 包。请改用 openclaw plugins install @lotaber_wang/openclaw-dc-plugin@0.1.15。",
21
+ "wrongInstallHint": "这是 OpenClaw 插件包,不是普通 npm CLI 包。请改用 openclaw plugins install @lotaber_wang/openclaw-dc-plugin@0.1.16。",
22
22
  "postInstallMessage": "TapTap DC 插件已安装完成。OpenClaw 接下来如需重启 Gateway,应先通过飞书或其他通信插件通知用户;重启完成后即可使用 taptap_dc_* 工具。",
23
23
  "restartRequired": true,
24
24
  "restartCommand": "openclaw gateway restart",
@@ -1,7 +1,7 @@
1
1
  import process from 'node:process';
2
2
 
3
3
  const PACKAGE_NAME = '@lotaber_wang/openclaw-dc-plugin';
4
- const PACKAGE_VERSION = '0.1.15';
4
+ const PACKAGE_VERSION = '0.1.16';
5
5
  const PREFERRED_COMMAND = `openclaw plugins install ${PACKAGE_NAME}@${PACKAGE_VERSION}`;
6
6
  const DISCOURAGED_COMMANDS = [
7
7
  `npm install ${PACKAGE_NAME}`,