@openclaw-china/wecom-app 0.1.12 → 0.1.13
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
|
@@ -5961,6 +5961,7 @@ async function configureWecomApp(prompter, cfg) {
|
|
|
5961
5961
|
section("\u914D\u7F6E WeCom App\uFF08\u81EA\u5EFA\u5E94\u7528-\u53EF\u63A5\u5165\u5FAE\u4FE1\uFF09");
|
|
5962
5962
|
showGuideLink("wecom-app");
|
|
5963
5963
|
const existing = getChannelConfig(cfg, "wecom-app");
|
|
5964
|
+
const existingAsr = isRecord(existing.asr) ? existing.asr : {};
|
|
5964
5965
|
const webhookPath = await prompter.askText({
|
|
5965
5966
|
label: "Webhook \u8DEF\u5F84\uFF08\u9700\u4E0E\u4F01\u4E1A\u5FAE\u4FE1\u540E\u53F0\u914D\u7F6E\u4E00\u81F4\uFF0C\u9ED8\u8BA4 /wecom-app\uFF09",
|
|
5966
5967
|
defaultValue: toTrimmedString(existing.webhookPath) ?? "/wecom-app",
|
|
@@ -5999,12 +6000,45 @@ async function configureWecomApp(prompter, cfg) {
|
|
|
5999
6000
|
patch.corpId = corpId;
|
|
6000
6001
|
patch.corpSecret = corpSecret;
|
|
6001
6002
|
patch.agentId = agentId;
|
|
6003
|
+
const asrEnabled = await prompter.askConfirm(
|
|
6004
|
+
"\u542F\u7528 ASR\uFF08\u652F\u6301\u5165\u7AD9\u8BED\u97F3\u81EA\u52A8\u8F6C\u6587\u5B57\uFF09",
|
|
6005
|
+
toBoolean(existingAsr.enabled, false)
|
|
6006
|
+
);
|
|
6007
|
+
const asr = {
|
|
6008
|
+
enabled: asrEnabled
|
|
6009
|
+
};
|
|
6010
|
+
if (asrEnabled) {
|
|
6011
|
+
Ve(
|
|
6012
|
+
[
|
|
6013
|
+
"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",
|
|
6014
|
+
"https://github.com/BytePioneer-AI/openclaw-china/blob/main/doc/guides/wecom-app/configuration.md"
|
|
6015
|
+
].join("\n"),
|
|
6016
|
+
"\u63D0\u793A"
|
|
6017
|
+
);
|
|
6018
|
+
asr.appId = await prompter.askText({
|
|
6019
|
+
label: "ASR appId\uFF08\u817E\u8BAF\u4E91\uFF09",
|
|
6020
|
+
defaultValue: toTrimmedString(existingAsr.appId),
|
|
6021
|
+
required: true
|
|
6022
|
+
});
|
|
6023
|
+
asr.secretId = await prompter.askSecret({
|
|
6024
|
+
label: "ASR secretId\uFF08\u817E\u8BAF\u4E91\uFF09",
|
|
6025
|
+
existingValue: toTrimmedString(existingAsr.secretId),
|
|
6026
|
+
required: true
|
|
6027
|
+
});
|
|
6028
|
+
asr.secretKey = await prompter.askSecret({
|
|
6029
|
+
label: "ASR secretKey\uFF08\u817E\u8BAF\u4E91\uFF09",
|
|
6030
|
+
existingValue: toTrimmedString(existingAsr.secretKey),
|
|
6031
|
+
required: true
|
|
6032
|
+
});
|
|
6033
|
+
}
|
|
6034
|
+
patch.asr = asr;
|
|
6002
6035
|
return mergeChannelConfig(cfg, "wecom-app", patch);
|
|
6003
6036
|
}
|
|
6004
6037
|
async function configureQQBot(prompter, cfg) {
|
|
6005
6038
|
section("\u914D\u7F6E QQBot\uFF08QQ \u673A\u5668\u4EBA\uFF09");
|
|
6006
6039
|
showGuideLink("qqbot");
|
|
6007
6040
|
const existing = getChannelConfig(cfg, "qqbot");
|
|
6041
|
+
const existingAsr = isRecord(existing.asr) ? existing.asr : {};
|
|
6008
6042
|
const appId = await prompter.askText({
|
|
6009
6043
|
label: "QQBot appId",
|
|
6010
6044
|
defaultValue: toTrimmedString(existing.appId),
|
|
@@ -6015,19 +6049,44 @@ async function configureQQBot(prompter, cfg) {
|
|
|
6015
6049
|
existingValue: toTrimmedString(existing.clientSecret),
|
|
6016
6050
|
required: true
|
|
6017
6051
|
});
|
|
6052
|
+
Ve(
|
|
6053
|
+
"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",
|
|
6054
|
+
"\u63D0\u793A"
|
|
6055
|
+
);
|
|
6018
6056
|
const markdownSupport = await prompter.askConfirm(
|
|
6019
6057
|
"\u542F\u7528 Markdown \u652F\u6301",
|
|
6020
6058
|
toBoolean(existing.markdownSupport, false)
|
|
6021
6059
|
);
|
|
6022
|
-
const
|
|
6023
|
-
"\
|
|
6024
|
-
toBoolean(
|
|
6060
|
+
const asrEnabled = await prompter.askConfirm(
|
|
6061
|
+
"\u542F\u7528 ASR\uFF08\u652F\u6301\u5165\u7AD9\u8BED\u97F3\u81EA\u52A8\u8F6C\u6587\u5B57\uFF09",
|
|
6062
|
+
toBoolean(existingAsr.enabled, false)
|
|
6025
6063
|
);
|
|
6064
|
+
const asr = {
|
|
6065
|
+
enabled: asrEnabled
|
|
6066
|
+
};
|
|
6067
|
+
if (asrEnabled) {
|
|
6068
|
+
Ve("ASR \u5F00\u901A\u65B9\u5F0F\u8BE6\u60C5\u8BF7\u67E5\u770B\u914D\u7F6E\u6587\u6863\u3002", "\u63D0\u793A");
|
|
6069
|
+
asr.appId = await prompter.askText({
|
|
6070
|
+
label: "ASR appId\uFF08\u817E\u8BAF\u4E91\uFF09",
|
|
6071
|
+
defaultValue: toTrimmedString(existingAsr.appId),
|
|
6072
|
+
required: true
|
|
6073
|
+
});
|
|
6074
|
+
asr.secretId = await prompter.askSecret({
|
|
6075
|
+
label: "ASR secretId\uFF08\u817E\u8BAF\u4E91\uFF09",
|
|
6076
|
+
existingValue: toTrimmedString(existingAsr.secretId),
|
|
6077
|
+
required: true
|
|
6078
|
+
});
|
|
6079
|
+
asr.secretKey = await prompter.askSecret({
|
|
6080
|
+
label: "ASR secretKey\uFF08\u817E\u8BAF\u4E91\uFF09",
|
|
6081
|
+
existingValue: toTrimmedString(existingAsr.secretKey),
|
|
6082
|
+
required: true
|
|
6083
|
+
});
|
|
6084
|
+
}
|
|
6026
6085
|
return mergeChannelConfig(cfg, "qqbot", {
|
|
6027
6086
|
appId,
|
|
6028
6087
|
clientSecret,
|
|
6029
6088
|
markdownSupport,
|
|
6030
|
-
|
|
6089
|
+
asr
|
|
6031
6090
|
});
|
|
6032
6091
|
}
|
|
6033
6092
|
async function configureSingleChannel(channel, prompter, cfg) {
|