@openclaw-china/wecom-app 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 +86 -10
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -5669,6 +5669,7 @@ var CHANNEL_ORDER = [
|
|
|
5669
5669
|
"wecom",
|
|
5670
5670
|
"wecom-app",
|
|
5671
5671
|
"wecom-kf",
|
|
5672
|
+
"wechat-mp",
|
|
5672
5673
|
"feishu-china"
|
|
5673
5674
|
];
|
|
5674
5675
|
var CHANNEL_DISPLAY_LABELS = {
|
|
@@ -5677,6 +5678,7 @@ var CHANNEL_DISPLAY_LABELS = {
|
|
|
5677
5678
|
wecom: "WeCom\uFF08\u4F01\u4E1A\u5FAE\u4FE1-\u667A\u80FD\u673A\u5668\u4EBA\uFF09",
|
|
5678
5679
|
"wecom-app": "WeCom App\uFF08\u81EA\u5EFA\u5E94\u7528-\u53EF\u63A5\u5165\u5FAE\u4FE1\uFF09",
|
|
5679
5680
|
"wecom-kf": "WeCom KF\uFF08\u5FAE\u4FE1\u5BA2\u670D\uFF09",
|
|
5681
|
+
"wechat-mp": "WeChat MP\uFF08\u5FAE\u4FE1\u516C\u4F17\u53F7\uFF09",
|
|
5680
5682
|
qqbot: "QQBot\uFF08QQ \u673A\u5668\u4EBA\uFF09"
|
|
5681
5683
|
};
|
|
5682
5684
|
var CHANNEL_GUIDE_LINKS = {
|
|
@@ -5685,6 +5687,7 @@ var CHANNEL_GUIDE_LINKS = {
|
|
|
5685
5687
|
wecom: `${GUIDES_BASE}/wecom/configuration.md`,
|
|
5686
5688
|
"wecom-app": `${GUIDES_BASE}/wecom-app/configuration.md`,
|
|
5687
5689
|
"wecom-kf": "https://github.com/BytePioneer-AI/openclaw-china/blob/main/extensions/wecom-kf/README.md",
|
|
5690
|
+
"wechat-mp": `${GUIDES_BASE}/wechat-mp/configuration.md`,
|
|
5688
5691
|
qqbot: `${GUIDES_BASE}/qqbot/configuration.md`
|
|
5689
5692
|
};
|
|
5690
5693
|
var CHINA_CLI_STATE_KEY = /* @__PURE__ */ Symbol.for("@openclaw-china/china-cli-state");
|
|
@@ -5894,7 +5897,9 @@ function isChannelConfigured(cfg, channelId) {
|
|
|
5894
5897
|
case "wecom-app":
|
|
5895
5898
|
return hasTokenPair(channelCfg);
|
|
5896
5899
|
case "wecom-kf":
|
|
5897
|
-
return hasNonEmptyString(channelCfg.corpId) && hasNonEmptyString(channelCfg.
|
|
5900
|
+
return hasNonEmptyString(channelCfg.corpId) && hasNonEmptyString(channelCfg.token) && hasNonEmptyString(channelCfg.encodingAESKey);
|
|
5901
|
+
case "wechat-mp":
|
|
5902
|
+
return hasNonEmptyString(channelCfg.appId) && hasNonEmptyString(channelCfg.token);
|
|
5898
5903
|
default:
|
|
5899
5904
|
return false;
|
|
5900
5905
|
}
|
|
@@ -6155,6 +6160,15 @@ async function configureWecomKf(prompter, cfg) {
|
|
|
6155
6160
|
section("\u914D\u7F6E WeCom KF\uFF08\u5FAE\u4FE1\u5BA2\u670D\uFF09");
|
|
6156
6161
|
showGuideLink("wecom-kf");
|
|
6157
6162
|
const existing = getChannelConfig(cfg, "wecom-kf");
|
|
6163
|
+
Ve(
|
|
6164
|
+
[
|
|
6165
|
+
"\u5411\u5BFC\u987A\u5E8F\uFF1AwebhookPath / token / encodingAESKey / corpId / open_kfid / corpSecret",
|
|
6166
|
+
"\u57FA\u7840\u5FC5\u586B\uFF1AcorpId / token / encodingAESKey / open_kfid",
|
|
6167
|
+
"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",
|
|
6168
|
+
"webhookPath \u9ED8\u8BA4\u503C\uFF1A/wecom-kf"
|
|
6169
|
+
].join("\n"),
|
|
6170
|
+
"\u53C2\u6570\u8BF4\u660E"
|
|
6171
|
+
);
|
|
6158
6172
|
const webhookPath = await prompter.askText({
|
|
6159
6173
|
label: "Webhook \u8DEF\u5F84\uFF08\u9ED8\u8BA4 /wecom-kf\uFF09",
|
|
6160
6174
|
defaultValue: toTrimmedString(existing.webhookPath) ?? "/wecom-kf",
|
|
@@ -6175,19 +6189,14 @@ async function configureWecomKf(prompter, cfg) {
|
|
|
6175
6189
|
defaultValue: toTrimmedString(existing.corpId),
|
|
6176
6190
|
required: true
|
|
6177
6191
|
});
|
|
6178
|
-
const corpSecret = await prompter.askSecret({
|
|
6179
|
-
label: "\u5FAE\u4FE1\u5BA2\u670D Secret",
|
|
6180
|
-
existingValue: toTrimmedString(existing.corpSecret),
|
|
6181
|
-
required: true
|
|
6182
|
-
});
|
|
6183
6192
|
const openKfId = await prompter.askText({
|
|
6184
6193
|
label: "open_kfid",
|
|
6185
6194
|
defaultValue: toTrimmedString(existing.openKfId),
|
|
6186
6195
|
required: true
|
|
6187
6196
|
});
|
|
6188
|
-
const
|
|
6189
|
-
label: "\
|
|
6190
|
-
|
|
6197
|
+
const corpSecret = await prompter.askSecret({
|
|
6198
|
+
label: "\u5FAE\u4FE1\u5BA2\u670D Secret\uFF08\u6700\u540E\u586B\u5199\uFF1B\u9996\u6B21\u63A5\u5165\u53EF\u5148\u7559\u7A7A\uFF09",
|
|
6199
|
+
existingValue: toTrimmedString(existing.corpSecret),
|
|
6191
6200
|
required: false
|
|
6192
6201
|
});
|
|
6193
6202
|
return mergeChannelConfig(cfg, "wecom-kf", {
|
|
@@ -6195,8 +6204,72 @@ async function configureWecomKf(prompter, cfg) {
|
|
|
6195
6204
|
token,
|
|
6196
6205
|
encodingAESKey,
|
|
6197
6206
|
corpId,
|
|
6198
|
-
corpSecret,
|
|
6199
6207
|
openKfId,
|
|
6208
|
+
corpSecret: corpSecret || void 0
|
|
6209
|
+
});
|
|
6210
|
+
}
|
|
6211
|
+
async function configureWechatMp(prompter, cfg) {
|
|
6212
|
+
section("\u914D\u7F6E WeChat MP\uFF08\u5FAE\u4FE1\u516C\u4F17\u53F7\uFF09");
|
|
6213
|
+
showGuideLink("wechat-mp");
|
|
6214
|
+
const existing = getChannelConfig(cfg, "wechat-mp");
|
|
6215
|
+
const webhookPath = await prompter.askText({
|
|
6216
|
+
label: "Webhook \u8DEF\u5F84\uFF08\u9ED8\u8BA4 /wechat-mp\uFF09",
|
|
6217
|
+
defaultValue: toTrimmedString(existing.webhookPath) ?? "/wechat-mp",
|
|
6218
|
+
required: true
|
|
6219
|
+
});
|
|
6220
|
+
const appId = await prompter.askText({
|
|
6221
|
+
label: "\u516C\u4F17\u53F7 appId",
|
|
6222
|
+
defaultValue: toTrimmedString(existing.appId),
|
|
6223
|
+
required: true
|
|
6224
|
+
});
|
|
6225
|
+
const appSecret = await prompter.askSecret({
|
|
6226
|
+
label: "\u516C\u4F17\u53F7 appSecret\uFF08\u4E3B\u52A8\u53D1\u9001\u9700\u8981\uFF09",
|
|
6227
|
+
existingValue: toTrimmedString(existing.appSecret),
|
|
6228
|
+
required: false
|
|
6229
|
+
});
|
|
6230
|
+
const token = await prompter.askSecret({
|
|
6231
|
+
label: "\u670D\u52A1\u5668\u914D\u7F6E token",
|
|
6232
|
+
existingValue: toTrimmedString(existing.token),
|
|
6233
|
+
required: true
|
|
6234
|
+
});
|
|
6235
|
+
const messageMode = await prompter.askSelect(
|
|
6236
|
+
"\u6D88\u606F\u52A0\u89E3\u5BC6\u6A21\u5F0F",
|
|
6237
|
+
[
|
|
6238
|
+
{ value: "plain", label: "plain\uFF08\u660E\u6587\uFF09" },
|
|
6239
|
+
{ value: "safe", label: "safe\uFF08\u5B89\u5168\u6A21\u5F0F\uFF09" },
|
|
6240
|
+
{ value: "compat", label: "compat\uFF08\u517C\u5BB9\u6A21\u5F0F\uFF09" }
|
|
6241
|
+
],
|
|
6242
|
+
toTrimmedString(existing.messageMode) ?? "safe"
|
|
6243
|
+
);
|
|
6244
|
+
let encodingAESKey = toTrimmedString(existing.encodingAESKey);
|
|
6245
|
+
if (messageMode !== "plain") {
|
|
6246
|
+
encodingAESKey = await prompter.askSecret({
|
|
6247
|
+
label: "EncodingAESKey\uFF08safe/compat \u5FC5\u586B\uFF09",
|
|
6248
|
+
existingValue: encodingAESKey,
|
|
6249
|
+
required: true
|
|
6250
|
+
});
|
|
6251
|
+
}
|
|
6252
|
+
const replyMode = await prompter.askSelect(
|
|
6253
|
+
"\u56DE\u590D\u6A21\u5F0F",
|
|
6254
|
+
[
|
|
6255
|
+
{ value: "passive", label: "passive\uFF085 \u79D2\u5185\u88AB\u52A8\u56DE\u590D\uFF09" },
|
|
6256
|
+
{ value: "active", label: "active\uFF08\u5BA2\u670D\u6D88\u606F\u4E3B\u52A8\u53D1\u9001\uFF09" }
|
|
6257
|
+
],
|
|
6258
|
+
toTrimmedString(existing.replyMode) ?? "passive"
|
|
6259
|
+
);
|
|
6260
|
+
const welcomeText = await prompter.askText({
|
|
6261
|
+
label: "\u6B22\u8FCE\u8BED\uFF08\u53EF\u9009\uFF09",
|
|
6262
|
+
defaultValue: toTrimmedString(existing.welcomeText),
|
|
6263
|
+
required: false
|
|
6264
|
+
});
|
|
6265
|
+
return mergeChannelConfig(cfg, "wechat-mp", {
|
|
6266
|
+
webhookPath,
|
|
6267
|
+
appId,
|
|
6268
|
+
appSecret: appSecret || void 0,
|
|
6269
|
+
token,
|
|
6270
|
+
encodingAESKey: messageMode === "plain" ? void 0 : encodingAESKey,
|
|
6271
|
+
messageMode,
|
|
6272
|
+
replyMode,
|
|
6200
6273
|
welcomeText: welcomeText || void 0
|
|
6201
6274
|
});
|
|
6202
6275
|
}
|
|
@@ -6258,6 +6331,8 @@ async function configureSingleChannel(channel, prompter, cfg) {
|
|
|
6258
6331
|
return configureWecomApp(prompter, cfg);
|
|
6259
6332
|
case "wecom-kf":
|
|
6260
6333
|
return configureWecomKf(prompter, cfg);
|
|
6334
|
+
case "wechat-mp":
|
|
6335
|
+
return configureWechatMp(prompter, cfg);
|
|
6261
6336
|
case "qqbot":
|
|
6262
6337
|
return configureQQBot(prompter, cfg);
|
|
6263
6338
|
default:
|
|
@@ -6399,6 +6474,7 @@ var SUPPORTED_CHANNELS = [
|
|
|
6399
6474
|
"wecom",
|
|
6400
6475
|
"wecom-app",
|
|
6401
6476
|
"wecom-kf",
|
|
6477
|
+
"wechat-mp",
|
|
6402
6478
|
"qqbot"
|
|
6403
6479
|
];
|
|
6404
6480
|
var CHINA_INSTALL_HINT_SHOWN_KEY = /* @__PURE__ */ Symbol.for("@openclaw-china/china-install-hint-shown");
|