@openclaw-china/wecom 0.1.25 → 0.1.26
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 +63 -4
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -6024,6 +6024,7 @@ async function configureWecomApp(prompter, cfg) {
|
|
|
6024
6024
|
section("\u914D\u7F6E WeCom App\uFF08\u81EA\u5EFA\u5E94\u7528-\u53EF\u63A5\u5165\u5FAE\u4FE1\uFF09");
|
|
6025
6025
|
showGuideLink("wecom-app");
|
|
6026
6026
|
const existing = getChannelConfig(cfg, "wecom-app");
|
|
6027
|
+
const existingAsr = isRecord(existing.asr) ? existing.asr : {};
|
|
6027
6028
|
const webhookPath = await prompter.askText({
|
|
6028
6029
|
label: "Webhook \u8DEF\u5F84\uFF08\u9700\u4E0E\u4F01\u4E1A\u5FAE\u4FE1\u540E\u53F0\u914D\u7F6E\u4E00\u81F4\uFF0C\u9ED8\u8BA4 /wecom-app\uFF09",
|
|
6029
6030
|
defaultValue: toTrimmedString(existing.webhookPath) ?? "/wecom-app",
|
|
@@ -6062,12 +6063,45 @@ async function configureWecomApp(prompter, cfg) {
|
|
|
6062
6063
|
patch.corpId = corpId;
|
|
6063
6064
|
patch.corpSecret = corpSecret;
|
|
6064
6065
|
patch.agentId = agentId;
|
|
6066
|
+
const asrEnabled = await prompter.askConfirm(
|
|
6067
|
+
"\u542F\u7528 ASR\uFF08\u652F\u6301\u5165\u7AD9\u8BED\u97F3\u81EA\u52A8\u8F6C\u6587\u5B57\uFF09",
|
|
6068
|
+
toBoolean(existingAsr.enabled, false)
|
|
6069
|
+
);
|
|
6070
|
+
const asr = {
|
|
6071
|
+
enabled: asrEnabled
|
|
6072
|
+
};
|
|
6073
|
+
if (asrEnabled) {
|
|
6074
|
+
Ve(
|
|
6075
|
+
[
|
|
6076
|
+
"ASR \u5F00\u901A\u65B9\u5F0F\u8BF7\u67E5\u770B\u914D\u7F6E\u6587\u6863\uFF1A\u6B65\u9AA4\u4E03\uFF08\u53EF\u9009\uFF09\uFF1A\u5F00\u542F\u8BED\u97F3\u8F6C\u6587\u672C\uFF08ASR\uFF09",
|
|
6077
|
+
"https://github.com/BytePioneer-AI/openclaw-china/blob/main/doc/guides/wecom-app/configuration.md"
|
|
6078
|
+
].join("\n"),
|
|
6079
|
+
"\u63D0\u793A"
|
|
6080
|
+
);
|
|
6081
|
+
asr.appId = await prompter.askText({
|
|
6082
|
+
label: "ASR appId\uFF08\u817E\u8BAF\u4E91\uFF09",
|
|
6083
|
+
defaultValue: toTrimmedString(existingAsr.appId),
|
|
6084
|
+
required: true
|
|
6085
|
+
});
|
|
6086
|
+
asr.secretId = await prompter.askSecret({
|
|
6087
|
+
label: "ASR secretId\uFF08\u817E\u8BAF\u4E91\uFF09",
|
|
6088
|
+
existingValue: toTrimmedString(existingAsr.secretId),
|
|
6089
|
+
required: true
|
|
6090
|
+
});
|
|
6091
|
+
asr.secretKey = await prompter.askSecret({
|
|
6092
|
+
label: "ASR secretKey\uFF08\u817E\u8BAF\u4E91\uFF09",
|
|
6093
|
+
existingValue: toTrimmedString(existingAsr.secretKey),
|
|
6094
|
+
required: true
|
|
6095
|
+
});
|
|
6096
|
+
}
|
|
6097
|
+
patch.asr = asr;
|
|
6065
6098
|
return mergeChannelConfig(cfg, "wecom-app", patch);
|
|
6066
6099
|
}
|
|
6067
6100
|
async function configureQQBot(prompter, cfg) {
|
|
6068
6101
|
section("\u914D\u7F6E QQBot\uFF08QQ \u673A\u5668\u4EBA\uFF09");
|
|
6069
6102
|
showGuideLink("qqbot");
|
|
6070
6103
|
const existing = getChannelConfig(cfg, "qqbot");
|
|
6104
|
+
const existingAsr = isRecord(existing.asr) ? existing.asr : {};
|
|
6071
6105
|
const appId = await prompter.askText({
|
|
6072
6106
|
label: "QQBot appId",
|
|
6073
6107
|
defaultValue: toTrimmedString(existing.appId),
|
|
@@ -6078,19 +6112,44 @@ async function configureQQBot(prompter, cfg) {
|
|
|
6078
6112
|
existingValue: toTrimmedString(existing.clientSecret),
|
|
6079
6113
|
required: true
|
|
6080
6114
|
});
|
|
6115
|
+
Ve(
|
|
6116
|
+
"QQ \u7684 Markdown \u4F53\u9A8C\u5F88\u597D\uFF0C\u4F46\u9700\u8981\u5148\u7533\u8BF7\u5F00\u901A\uFF0C\u8BE6\u60C5\u8BF7\u67E5\u770B\u914D\u7F6E\u6587\u6863\u3002",
|
|
6117
|
+
"\u63D0\u793A"
|
|
6118
|
+
);
|
|
6081
6119
|
const markdownSupport = await prompter.askConfirm(
|
|
6082
6120
|
"\u542F\u7528 Markdown \u652F\u6301",
|
|
6083
6121
|
toBoolean(existing.markdownSupport, false)
|
|
6084
6122
|
);
|
|
6085
|
-
const
|
|
6086
|
-
"\
|
|
6087
|
-
toBoolean(
|
|
6123
|
+
const asrEnabled = await prompter.askConfirm(
|
|
6124
|
+
"\u542F\u7528 ASR\uFF08\u652F\u6301\u5165\u7AD9\u8BED\u97F3\u81EA\u52A8\u8F6C\u6587\u5B57\uFF09",
|
|
6125
|
+
toBoolean(existingAsr.enabled, false)
|
|
6088
6126
|
);
|
|
6127
|
+
const asr = {
|
|
6128
|
+
enabled: asrEnabled
|
|
6129
|
+
};
|
|
6130
|
+
if (asrEnabled) {
|
|
6131
|
+
Ve("ASR \u5F00\u901A\u65B9\u5F0F\u8BE6\u60C5\u8BF7\u67E5\u770B\u914D\u7F6E\u6587\u6863\u3002", "\u63D0\u793A");
|
|
6132
|
+
asr.appId = await prompter.askText({
|
|
6133
|
+
label: "ASR appId\uFF08\u817E\u8BAF\u4E91\uFF09",
|
|
6134
|
+
defaultValue: toTrimmedString(existingAsr.appId),
|
|
6135
|
+
required: true
|
|
6136
|
+
});
|
|
6137
|
+
asr.secretId = await prompter.askSecret({
|
|
6138
|
+
label: "ASR secretId\uFF08\u817E\u8BAF\u4E91\uFF09",
|
|
6139
|
+
existingValue: toTrimmedString(existingAsr.secretId),
|
|
6140
|
+
required: true
|
|
6141
|
+
});
|
|
6142
|
+
asr.secretKey = await prompter.askSecret({
|
|
6143
|
+
label: "ASR secretKey\uFF08\u817E\u8BAF\u4E91\uFF09",
|
|
6144
|
+
existingValue: toTrimmedString(existingAsr.secretKey),
|
|
6145
|
+
required: true
|
|
6146
|
+
});
|
|
6147
|
+
}
|
|
6089
6148
|
return mergeChannelConfig(cfg, "qqbot", {
|
|
6090
6149
|
appId,
|
|
6091
6150
|
clientSecret,
|
|
6092
6151
|
markdownSupport,
|
|
6093
|
-
|
|
6152
|
+
asr
|
|
6094
6153
|
});
|
|
6095
6154
|
}
|
|
6096
6155
|
async function configureSingleChannel(channel, prompter, cfg) {
|