@rezti/dsh-rez-wechat 0.1.3 → 0.1.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/lib/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  import type { Context } from '@deepseek-ai/cordis';
2
2
  export declare const name = "rez-wechat";
3
3
  export declare const inject: string[];
4
- export declare function apply(ctx: Context): void;
4
+ export declare function apply(ctx: Context): Promise<void>;
package/lib/index.js CHANGED
@@ -1,8 +1,9 @@
1
+ import { startMcpWhenSecret } from '@rezti/dsh-rez-sso';
1
2
  import { WeixinChannel } from './channel.js';
2
3
  export const name = 'rez-wechat';
3
- export const inject = ['systemPrompt', 'webServer'];
4
+ export const inject = ['systemPrompt', 'webServer', 'rezSso'];
4
5
  const GUIDANCE = [
5
- '企业微信群发送走官方 dsh-mcp-client + wecom-mcp(mcp__wechat__*),密钥 REZ_WECHAT_WEBHOOK。',
6
+ '企业微信群发送走官方 dsh-mcp-client + wecom-mcp(mcp__wechat__*),密钥 REZ_WECHAT_WEBHOOK。未配置时不拉起 wecom-mcpWebhook 在 设置 → 插件 → ReZ-TI 里填。',
6
7
  '个人微信是 QClaw 同款 ClawBot 通道:在 Rez 面板「微信」页扫码一次,然后直接在微信里说话,dsh 会自动回。不要再跑 npx weixin-mcp login,也不要调用 mcp__weixin__*。',
7
8
  '这是 ClawBot 客服会话,不是用个人微信号管好友/群。对外发消息必须先征得用户批准。',
8
9
  ].join('');
@@ -94,7 +95,7 @@ function weixinRoutes(channel) {
94
95
  },
95
96
  ];
96
97
  }
97
- export function apply(ctx) {
98
+ export async function apply(ctx) {
98
99
  const channel = new WeixinChannel();
99
100
  channel.startIfLoggedIn();
100
101
  ctx.effect(() => ctx.systemPrompt.section({
@@ -109,4 +110,16 @@ export function apply(ctx) {
109
110
  dispose(); };
110
111
  }, 'dsh-rez-wechat: weixin routes');
111
112
  ctx.effect(() => () => { channel.dispose(); }, 'dsh-rez-wechat: weixin channel');
113
+ await startMcpWhenSecret(ctx, {
114
+ system: 'wechat',
115
+ label: '企业微信',
116
+ config: (secret) => ({
117
+ serverName: 'wechat',
118
+ transport: 'stdio',
119
+ command: 'npx',
120
+ args: ['-y', 'wecom-mcp'],
121
+ env: { WECOM_WEBHOOK_URL: secret },
122
+ failOnStartupError: false,
123
+ }),
124
+ });
112
125
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rezti/dsh-rez-wechat",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "ReZ-TI WeChat/WeCom bridges. Personal WeChat is QClaw/ClawBot scan-and-chat via dsh-wechat-bridge; WeCom group send uses wecom-mcp.",
5
5
  "type": "module",
6
6
  "engines": {
@@ -21,7 +21,8 @@
21
21
  ],
22
22
  "license": "Apache-2.0",
23
23
  "dependencies": {
24
- "qrcode": "^1.5.4"
24
+ "qrcode": "^1.5.4",
25
+ "@rezti/dsh-rez-sso": "0.1.5"
25
26
  },
26
27
  "devDependencies": {
27
28
  "@deepseek-ai/cordis": "^4.0.1",