@rezti/dsh-rez-wechat 0.1.2 → 0.1.3
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/lib/index.js +7 -10
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { WeixinChannel } from './channel.js';
|
|
2
2
|
export const name = 'rez-wechat';
|
|
3
|
-
export const inject = ['systemPrompt'];
|
|
3
|
+
export const inject = ['systemPrompt', 'webServer'];
|
|
4
4
|
const GUIDANCE = [
|
|
5
5
|
'企业微信群发送走官方 dsh-mcp-client + wecom-mcp(mcp__wechat__*),密钥 REZ_WECHAT_WEBHOOK。',
|
|
6
6
|
'个人微信是 QClaw 同款 ClawBot 通道:在 Rez 面板「微信」页扫码一次,然后直接在微信里说话,dsh 会自动回。不要再跑 npx weixin-mcp login,也不要调用 mcp__weixin__*。',
|
|
@@ -102,14 +102,11 @@ export function apply(ctx) {
|
|
|
102
102
|
order: 162,
|
|
103
103
|
text: GUIDANCE,
|
|
104
104
|
}), 'dsh-rez-wechat: prompt');
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
dispose(); };
|
|
112
|
-
}, 'dsh-rez-wechat: weixin routes');
|
|
113
|
-
}
|
|
105
|
+
const routes = weixinRoutes(channel);
|
|
106
|
+
ctx.effect(() => {
|
|
107
|
+
const disposers = routes.map(route => ctx.webServer.register(route));
|
|
108
|
+
return () => { for (const dispose of disposers)
|
|
109
|
+
dispose(); };
|
|
110
|
+
}, 'dsh-rez-wechat: weixin routes');
|
|
114
111
|
ctx.effect(() => () => { channel.dispose(); }, 'dsh-rez-wechat: weixin channel');
|
|
115
112
|
}
|
package/package.json
CHANGED