@wecom/wecom-openclaw-plugin 1.0.10 → 1.0.11
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/dist/index.cjs.js +6 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +6 -4
- package/dist/index.esm.js.map +1 -1
- package/dist/src/interface.d.ts +2 -0
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1596,9 +1596,10 @@ async function cleanupAccount(accountId) {
|
|
|
1596
1596
|
* @throws 响应错误码非 0 或缺少 url 字段时抛出错误
|
|
1597
1597
|
*/
|
|
1598
1598
|
async function fetchMcpConfig(wsClient) {
|
|
1599
|
+
const biz_type = "doc";
|
|
1599
1600
|
const reqId = aibotNodeSdk.generateReqId("mcp_config");
|
|
1600
1601
|
// 通过 reply 方法发送自定义命令
|
|
1601
|
-
const response = await withTimeout(wsClient.reply({ headers: { req_id: reqId } }, { biz_type
|
|
1602
|
+
const response = await withTimeout(wsClient.reply({ headers: { req_id: reqId } }, { biz_type }, MCP_GET_CONFIG_CMD), MCP_CONFIG_FETCH_TIMEOUT_MS, `MCP config fetch timed out after ${MCP_CONFIG_FETCH_TIMEOUT_MS}ms`);
|
|
1602
1603
|
// 校验响应错误码
|
|
1603
1604
|
if (response.errcode && response.errcode !== 0) {
|
|
1604
1605
|
throw new Error(`MCP config request failed: errcode=${response.errcode}, errmsg=${response.errmsg ?? "unknown"}`);
|
|
@@ -1609,8 +1610,9 @@ async function fetchMcpConfig(wsClient) {
|
|
|
1609
1610
|
throw new Error("MCP config response missing required 'url' field");
|
|
1610
1611
|
}
|
|
1611
1612
|
return {
|
|
1613
|
+
biz_type,
|
|
1612
1614
|
url: body.url,
|
|
1613
|
-
type:
|
|
1615
|
+
type: body.type,
|
|
1614
1616
|
is_authed: body.is_authed,
|
|
1615
1617
|
};
|
|
1616
1618
|
}
|
|
@@ -1675,7 +1677,7 @@ async function saveMcpConfigToPluginJson(config, runtime) {
|
|
|
1675
1677
|
pluginJson.mcpConfig = {};
|
|
1676
1678
|
}
|
|
1677
1679
|
// 使用 type 作为键存储配置
|
|
1678
|
-
const typeKey = config.
|
|
1680
|
+
const typeKey = config.biz_type || 'default';
|
|
1679
1681
|
pluginJson.mcpConfig[typeKey] = {
|
|
1680
1682
|
type: config.type,
|
|
1681
1683
|
url: config.url,
|
|
@@ -2774,7 +2776,7 @@ const wecomPlugin = {
|
|
|
2774
2776
|
};
|
|
2775
2777
|
|
|
2776
2778
|
const plugin = {
|
|
2777
|
-
id: "wecom",
|
|
2779
|
+
id: "wecom-openclaw-plugin",
|
|
2778
2780
|
name: "企业微信",
|
|
2779
2781
|
description: "企业微信 OpenClaw 插件",
|
|
2780
2782
|
configSchema: pluginSdk.emptyPluginConfigSchema(),
|