@openclaw-china/feishu-china 2026.3.18 → 2026.3.19

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.js CHANGED
@@ -5632,6 +5632,7 @@ var CHANNEL_ORDER = [
5632
5632
  "wecom",
5633
5633
  "wecom-app",
5634
5634
  "wecom-kf",
5635
+ "wechat-mp",
5635
5636
  "feishu-china"
5636
5637
  ];
5637
5638
  var CHANNEL_DISPLAY_LABELS = {
@@ -5640,6 +5641,7 @@ var CHANNEL_DISPLAY_LABELS = {
5640
5641
  wecom: "WeCom\uFF08\u4F01\u4E1A\u5FAE\u4FE1-\u667A\u80FD\u673A\u5668\u4EBA\uFF09",
5641
5642
  "wecom-app": "WeCom App\uFF08\u81EA\u5EFA\u5E94\u7528-\u53EF\u63A5\u5165\u5FAE\u4FE1\uFF09",
5642
5643
  "wecom-kf": "WeCom KF\uFF08\u5FAE\u4FE1\u5BA2\u670D\uFF09",
5644
+ "wechat-mp": "WeChat MP\uFF08\u5FAE\u4FE1\u516C\u4F17\u53F7\uFF09",
5643
5645
  qqbot: "QQBot\uFF08QQ \u673A\u5668\u4EBA\uFF09"
5644
5646
  };
5645
5647
  var CHANNEL_GUIDE_LINKS = {
@@ -5648,6 +5650,7 @@ var CHANNEL_GUIDE_LINKS = {
5648
5650
  wecom: `${GUIDES_BASE}/wecom/configuration.md`,
5649
5651
  "wecom-app": `${GUIDES_BASE}/wecom-app/configuration.md`,
5650
5652
  "wecom-kf": "https://github.com/BytePioneer-AI/openclaw-china/blob/main/extensions/wecom-kf/README.md",
5653
+ "wechat-mp": `${GUIDES_BASE}/wechat-mp/configuration.md`,
5651
5654
  qqbot: `${GUIDES_BASE}/qqbot/configuration.md`
5652
5655
  };
5653
5656
  var CHINA_CLI_STATE_KEY = /* @__PURE__ */ Symbol.for("@openclaw-china/china-cli-state");
@@ -5857,7 +5860,9 @@ function isChannelConfigured(cfg, channelId) {
5857
5860
  case "wecom-app":
5858
5861
  return hasTokenPair(channelCfg);
5859
5862
  case "wecom-kf":
5860
- return hasNonEmptyString(channelCfg.corpId) && hasNonEmptyString(channelCfg.corpSecret) && hasNonEmptyString(channelCfg.token) && hasNonEmptyString(channelCfg.encodingAESKey);
5863
+ return hasNonEmptyString(channelCfg.corpId) && hasNonEmptyString(channelCfg.token) && hasNonEmptyString(channelCfg.encodingAESKey);
5864
+ case "wechat-mp":
5865
+ return hasNonEmptyString(channelCfg.appId) && hasNonEmptyString(channelCfg.token);
5861
5866
  default:
5862
5867
  return false;
5863
5868
  }
@@ -6118,6 +6123,15 @@ async function configureWecomKf(prompter, cfg) {
6118
6123
  section("\u914D\u7F6E WeCom KF\uFF08\u5FAE\u4FE1\u5BA2\u670D\uFF09");
6119
6124
  showGuideLink("wecom-kf");
6120
6125
  const existing = getChannelConfig(cfg, "wecom-kf");
6126
+ Ve(
6127
+ [
6128
+ "\u5411\u5BFC\u987A\u5E8F\uFF1AwebhookPath / token / encodingAESKey / corpId / open_kfid / corpSecret",
6129
+ "\u57FA\u7840\u5FC5\u586B\uFF1AcorpId / token / encodingAESKey / open_kfid",
6130
+ "corpSecret \u4F1A\u4F5C\u4E3A\u6700\u540E\u4E00\u4E2A\u53C2\u6570\u8BE2\u95EE\uFF1B\u9996\u6B21\u63A5\u5165\u53EF\u5148\u7559\u7A7A\uFF0C\u5F85\u56DE\u8C03 URL \u6821\u9A8C\u901A\u8FC7\u5E76\u70B9\u51FB\u201C\u5F00\u59CB\u4F7F\u7528\u201D\u540E\u518D\u8865",
6131
+ "webhookPath \u9ED8\u8BA4\u503C\uFF1A/wecom-kf"
6132
+ ].join("\n"),
6133
+ "\u53C2\u6570\u8BF4\u660E"
6134
+ );
6121
6135
  const webhookPath = await prompter.askText({
6122
6136
  label: "Webhook \u8DEF\u5F84\uFF08\u9ED8\u8BA4 /wecom-kf\uFF09",
6123
6137
  defaultValue: toTrimmedString(existing.webhookPath) ?? "/wecom-kf",
@@ -6138,19 +6152,14 @@ async function configureWecomKf(prompter, cfg) {
6138
6152
  defaultValue: toTrimmedString(existing.corpId),
6139
6153
  required: true
6140
6154
  });
6141
- const corpSecret = await prompter.askSecret({
6142
- label: "\u5FAE\u4FE1\u5BA2\u670D Secret",
6143
- existingValue: toTrimmedString(existing.corpSecret),
6144
- required: true
6145
- });
6146
6155
  const openKfId = await prompter.askText({
6147
6156
  label: "open_kfid",
6148
6157
  defaultValue: toTrimmedString(existing.openKfId),
6149
6158
  required: true
6150
6159
  });
6151
- const welcomeText = await prompter.askText({
6152
- label: "\u6B22\u8FCE\u8BED\uFF08\u53EF\u9009\uFF09",
6153
- defaultValue: toTrimmedString(existing.welcomeText),
6160
+ const corpSecret = await prompter.askSecret({
6161
+ label: "\u5FAE\u4FE1\u5BA2\u670D Secret\uFF08\u6700\u540E\u586B\u5199\uFF1B\u9996\u6B21\u63A5\u5165\u53EF\u5148\u7559\u7A7A\uFF09",
6162
+ existingValue: toTrimmedString(existing.corpSecret),
6154
6163
  required: false
6155
6164
  });
6156
6165
  return mergeChannelConfig(cfg, "wecom-kf", {
@@ -6158,8 +6167,72 @@ async function configureWecomKf(prompter, cfg) {
6158
6167
  token,
6159
6168
  encodingAESKey,
6160
6169
  corpId,
6161
- corpSecret,
6162
6170
  openKfId,
6171
+ corpSecret: corpSecret || void 0
6172
+ });
6173
+ }
6174
+ async function configureWechatMp(prompter, cfg) {
6175
+ section("\u914D\u7F6E WeChat MP\uFF08\u5FAE\u4FE1\u516C\u4F17\u53F7\uFF09");
6176
+ showGuideLink("wechat-mp");
6177
+ const existing = getChannelConfig(cfg, "wechat-mp");
6178
+ const webhookPath = await prompter.askText({
6179
+ label: "Webhook \u8DEF\u5F84\uFF08\u9ED8\u8BA4 /wechat-mp\uFF09",
6180
+ defaultValue: toTrimmedString(existing.webhookPath) ?? "/wechat-mp",
6181
+ required: true
6182
+ });
6183
+ const appId = await prompter.askText({
6184
+ label: "\u516C\u4F17\u53F7 appId",
6185
+ defaultValue: toTrimmedString(existing.appId),
6186
+ required: true
6187
+ });
6188
+ const appSecret = await prompter.askSecret({
6189
+ label: "\u516C\u4F17\u53F7 appSecret\uFF08\u4E3B\u52A8\u53D1\u9001\u9700\u8981\uFF09",
6190
+ existingValue: toTrimmedString(existing.appSecret),
6191
+ required: false
6192
+ });
6193
+ const token = await prompter.askSecret({
6194
+ label: "\u670D\u52A1\u5668\u914D\u7F6E token",
6195
+ existingValue: toTrimmedString(existing.token),
6196
+ required: true
6197
+ });
6198
+ const messageMode = await prompter.askSelect(
6199
+ "\u6D88\u606F\u52A0\u89E3\u5BC6\u6A21\u5F0F",
6200
+ [
6201
+ { value: "plain", label: "plain\uFF08\u660E\u6587\uFF09" },
6202
+ { value: "safe", label: "safe\uFF08\u5B89\u5168\u6A21\u5F0F\uFF09" },
6203
+ { value: "compat", label: "compat\uFF08\u517C\u5BB9\u6A21\u5F0F\uFF09" }
6204
+ ],
6205
+ toTrimmedString(existing.messageMode) ?? "safe"
6206
+ );
6207
+ let encodingAESKey = toTrimmedString(existing.encodingAESKey);
6208
+ if (messageMode !== "plain") {
6209
+ encodingAESKey = await prompter.askSecret({
6210
+ label: "EncodingAESKey\uFF08safe/compat \u5FC5\u586B\uFF09",
6211
+ existingValue: encodingAESKey,
6212
+ required: true
6213
+ });
6214
+ }
6215
+ const replyMode = await prompter.askSelect(
6216
+ "\u56DE\u590D\u6A21\u5F0F",
6217
+ [
6218
+ { value: "passive", label: "passive\uFF085 \u79D2\u5185\u88AB\u52A8\u56DE\u590D\uFF09" },
6219
+ { value: "active", label: "active\uFF08\u5BA2\u670D\u6D88\u606F\u4E3B\u52A8\u53D1\u9001\uFF09" }
6220
+ ],
6221
+ toTrimmedString(existing.replyMode) ?? "passive"
6222
+ );
6223
+ const welcomeText = await prompter.askText({
6224
+ label: "\u6B22\u8FCE\u8BED\uFF08\u53EF\u9009\uFF09",
6225
+ defaultValue: toTrimmedString(existing.welcomeText),
6226
+ required: false
6227
+ });
6228
+ return mergeChannelConfig(cfg, "wechat-mp", {
6229
+ webhookPath,
6230
+ appId,
6231
+ appSecret: appSecret || void 0,
6232
+ token,
6233
+ encodingAESKey: messageMode === "plain" ? void 0 : encodingAESKey,
6234
+ messageMode,
6235
+ replyMode,
6163
6236
  welcomeText: welcomeText || void 0
6164
6237
  });
6165
6238
  }
@@ -6221,6 +6294,8 @@ async function configureSingleChannel(channel, prompter, cfg) {
6221
6294
  return configureWecomApp(prompter, cfg);
6222
6295
  case "wecom-kf":
6223
6296
  return configureWecomKf(prompter, cfg);
6297
+ case "wechat-mp":
6298
+ return configureWechatMp(prompter, cfg);
6224
6299
  case "qqbot":
6225
6300
  return configureQQBot(prompter, cfg);
6226
6301
  default:
@@ -6362,6 +6437,7 @@ var SUPPORTED_CHANNELS = [
6362
6437
  "wecom",
6363
6438
  "wecom-app",
6364
6439
  "wecom-kf",
6440
+ "wechat-mp",
6365
6441
  "qqbot"
6366
6442
  ];
6367
6443
  var CHINA_INSTALL_HINT_SHOWN_KEY = /* @__PURE__ */ Symbol.for("@openclaw-china/china-install-hint-shown");