@lotaber_wang/openclaw-dc-plugin 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.
- package/README.md +5 -4
- package/index.js +56 -6
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
## 安装
|
|
17
17
|
|
|
18
18
|
```bash
|
|
19
|
-
openclaw plugins install @lotaber_wang/openclaw-dc-plugin@0.1.
|
|
19
|
+
openclaw plugins install @lotaber_wang/openclaw-dc-plugin@0.1.10
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
安装完成后,建议立刻执行一次检查:
|
|
@@ -52,7 +52,7 @@ openclaw gateway restart
|
|
|
52
52
|
## 推荐安装流程
|
|
53
53
|
|
|
54
54
|
```bash
|
|
55
|
-
openclaw plugins install @lotaber_wang/openclaw-dc-plugin@0.1.
|
|
55
|
+
openclaw plugins install @lotaber_wang/openclaw-dc-plugin@0.1.10
|
|
56
56
|
openclaw plugins inspect openclaw-dc-plugin
|
|
57
57
|
echo 'TapTap DC 插件已安装完成。OpenClaw 接下来会重启 Gateway;重启完成后即可使用 taptap_dc_* 工具。'
|
|
58
58
|
openclaw gateway restart
|
|
@@ -64,6 +64,7 @@ openclaw gateway restart
|
|
|
64
64
|
- `inspect` 用来确认插件元信息、skills、tools 是否已被 Gateway 识别
|
|
65
65
|
- 如果宿主判断需要重启 Gateway,必须先通知用户,再重启
|
|
66
66
|
- 如果 10-30 秒后还没生效,再手动执行 `gateway restart`
|
|
67
|
+
- 如果宿主存在“stock 安装失败后再 fallback npm”的行为,优先使用明确版本号安装,必要时改用本地 `.tgz` 安装,避免双安装链路互相打架
|
|
67
68
|
|
|
68
69
|
## 典型使用流程
|
|
69
70
|
|
|
@@ -129,7 +130,7 @@ openclaw gateway restart
|
|
|
129
130
|
|
|
130
131
|
如果安装后看不到 `taptap_dc_*` 工具,优先按这个顺序排查:
|
|
131
132
|
|
|
132
|
-
1. 确认安装的是 `@lotaber_wang/openclaw-dc-plugin@0.1.
|
|
133
|
+
1. 确认安装的是 `@lotaber_wang/openclaw-dc-plugin@0.1.10` 或更新版本
|
|
133
134
|
2. 执行 `openclaw plugins inspect openclaw-dc-plugin`
|
|
134
135
|
3. 如果宿主要求重启 Gateway,先向用户发送安装完成提示
|
|
135
136
|
4. 再执行 `openclaw gateway restart`
|
|
@@ -157,7 +158,7 @@ openclaw gateway restart
|
|
|
157
158
|
- OpenClaw 进程是否有临时目录写权限
|
|
158
159
|
- OpenClaw 是否已经完成 Gateway 重启
|
|
159
160
|
|
|
160
|
-
从 `0.1.
|
|
161
|
+
从 `0.1.10` 开始,插件安装链路与 bridge 会额外做这些兼容处理:
|
|
161
162
|
|
|
162
163
|
- 在 `package.json` 中补充 `openclaw.install.npmSpec`,让安装链路更稳定
|
|
163
164
|
- 在 `openclaw.plugin.json` 中显式开启 `enabledByDefault`
|
package/index.js
CHANGED
|
@@ -385,6 +385,21 @@ function registerProxyTool(api, bridge, definition) {
|
|
|
385
385
|
);
|
|
386
386
|
}
|
|
387
387
|
|
|
388
|
+
function safeRegisterTool(api, logger, registerFn, toolName) {
|
|
389
|
+
try {
|
|
390
|
+
registerFn();
|
|
391
|
+
logger?.info?.(`[TapTap DC] Registered OpenClaw tool: ${toolName}`);
|
|
392
|
+
return true;
|
|
393
|
+
} catch (error) {
|
|
394
|
+
logger?.error?.(
|
|
395
|
+
`[TapTap DC] Failed to register OpenClaw tool ${toolName}: ${
|
|
396
|
+
error instanceof Error ? error.stack || error.message : String(error)
|
|
397
|
+
}`
|
|
398
|
+
);
|
|
399
|
+
return false;
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
|
|
388
403
|
function registerQuickBriefTool(api, bridge) {
|
|
389
404
|
api.registerTool(
|
|
390
405
|
() => ({
|
|
@@ -754,15 +769,50 @@ const plugin = {
|
|
|
754
769
|
additionalProperties: false,
|
|
755
770
|
},
|
|
756
771
|
register(api) {
|
|
757
|
-
const
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
772
|
+
const logger = api.logger;
|
|
773
|
+
logger?.info?.('[TapTap DC] Starting OpenClaw plugin registration');
|
|
774
|
+
|
|
775
|
+
let bridge;
|
|
776
|
+
try {
|
|
777
|
+
bridge = new TapTapMcpBridge({
|
|
778
|
+
logger,
|
|
779
|
+
config: api.pluginConfig || {},
|
|
780
|
+
});
|
|
781
|
+
} catch (error) {
|
|
782
|
+
logger?.error?.(
|
|
783
|
+
`[TapTap DC] Failed to create TapTapMcpBridge during registration: ${
|
|
784
|
+
error instanceof Error ? error.stack || error.message : String(error)
|
|
785
|
+
}`
|
|
786
|
+
);
|
|
787
|
+
throw error;
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
let successCount = 0;
|
|
791
|
+
|
|
792
|
+
if (
|
|
793
|
+
safeRegisterTool(api, logger, () => registerQuickBriefTool(api, bridge), 'taptap_dc_quick_brief')
|
|
794
|
+
) {
|
|
795
|
+
successCount += 1;
|
|
796
|
+
}
|
|
761
797
|
|
|
762
|
-
registerQuickBriefTool(api, bridge);
|
|
763
798
|
for (const definition of toolDefinitions) {
|
|
764
|
-
|
|
799
|
+
if (
|
|
800
|
+
safeRegisterTool(
|
|
801
|
+
api,
|
|
802
|
+
logger,
|
|
803
|
+
() => registerProxyTool(api, bridge, definition),
|
|
804
|
+
definition.name
|
|
805
|
+
)
|
|
806
|
+
) {
|
|
807
|
+
successCount += 1;
|
|
808
|
+
}
|
|
765
809
|
}
|
|
810
|
+
|
|
811
|
+
logger?.info?.(
|
|
812
|
+
`[TapTap DC] OpenClaw plugin registration completed: ${successCount}/${
|
|
813
|
+
toolDefinitions.length + 1
|
|
814
|
+
} tools registered`
|
|
815
|
+
);
|
|
766
816
|
},
|
|
767
817
|
};
|
|
768
818
|
|
package/openclaw.plugin.json
CHANGED