@xmanrui/dsh-im 4.16.0 → 4.17.0
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/client.js +66 -18
- package/lib/index.js +259 -256
- package/package.json +5 -1
- package/plugin-src/client/channels/feishu/api.js +3 -0
- package/plugin-src/client/channels/feishu/index.js +45 -13
- package/plugin-src/client/i18n.js +13 -2
- package/plugin-src/host/channels/feishu/production.mjs +1 -0
- package/plugin-src/host/channels/feishu/rpc.mjs +20 -0
- package/src/channels/dingtalk/dingtalk-api.mjs +41 -48
- package/src/channels/dingtalk/dingtalk-bridge.mjs +5 -1
- package/src/channels/feishu/bridge.mjs +475 -11
- package/src/channels/feishu/feishu-cards.mjs +130 -0
- package/src/channels/feishu/feishu-runtime.mjs +10 -0
- package/src/channels/feishu/multi-bot-controller.mjs +28 -0
- package/src/channels/feishu/plugin-config-store.mjs +2 -0
- package/src/channels/feishu/step-push-mode.mjs +19 -0
- package/src/channels/shared/i18n-en/feishu.mjs +8 -0
package/lib/client.js
CHANGED
|
@@ -571,7 +571,7 @@ var React28 = __toESM(require("react"), 1);
|
|
|
571
571
|
// package.json
|
|
572
572
|
var package_default = {
|
|
573
573
|
name: "@xmanrui/dsh-im",
|
|
574
|
-
version: "4.
|
|
574
|
+
version: "4.17.0",
|
|
575
575
|
description: "\u628A\u5341\u79CD IM \u673A\u5668\u4EBA\u548C\u516C\u7F51 AI Office \u63A5\u5165\u672C\u673A DeepSeek Harness\u3002 Connect ten IM channels and a public AI Office to a local DeepSeek Harness.",
|
|
576
576
|
keywords: [
|
|
577
577
|
"deepseek-harness",
|
|
@@ -610,6 +610,10 @@ var package_default = {
|
|
|
610
610
|
{
|
|
611
611
|
name: "BuvkB",
|
|
612
612
|
url: "https://github.com/BuvkB"
|
|
613
|
+
},
|
|
614
|
+
{
|
|
615
|
+
name: "masucc",
|
|
616
|
+
url: "https://github.com/masucc"
|
|
613
617
|
}
|
|
614
618
|
],
|
|
615
619
|
license: "MIT",
|
|
@@ -1081,9 +1085,18 @@ var EN = Object.freeze({
|
|
|
1081
1085
|
"\u5206\u6B65\u76F4\u63A8": "Step push",
|
|
1082
1086
|
"\u67E5\u770B\u5206\u6B65\u76F4\u63A8\u8BF4\u660E": "View step push help",
|
|
1083
1087
|
"\u5F00\u542F\u540E\u9010\u6B65\u63A8\u9001\u5DE5\u5177\u8C03\u7528\u4E0E\u8FC7\u7A0B\u8BF4\u660E": "Push tool calls and process notes step by step",
|
|
1084
|
-
"\
|
|
1085
|
-
"\
|
|
1088
|
+
"\u4EFB\u52A1\u8FC7\u7A0B\u5C55\u793A": "Task progress display",
|
|
1089
|
+
"\u8BBE\u7F6E\u4EFB\u52A1\u6267\u884C\u8FC7\u7A0B\u7684\u5448\u73B0\u65B9\u5F0F\uFF1A\u4E0D\u663E\u793A\u3001\u5B9E\u65F6\u5361\u7247\u6216\u9010\u6B65\u6D88\u606F": "Choose how the execution is presented: hidden, one live card, or step-by-step messages",
|
|
1090
|
+
"\u4E0D\u663E\u793A\u8FC7\u7A0B\uFF08\u53EA\u53D1\u9001\u6700\u7EC8\u7B54\u6848\uFF09": "Hide the process (send the final answer only)",
|
|
1091
|
+
"\u5B9E\u65F6\u8FC7\u7A0B\u5361\uFF08\u5168\u7A0B\u4E00\u5F20\u5361\u7247\u52A8\u6001\u66F4\u65B0\uFF09": "Live process card (one card updated throughout)",
|
|
1092
|
+
"\u9010\u6B65\u76F4\u64AD\uFF08\u6BCF\u4E00\u6B65\u5355\u72EC\u53D1\u4E00\u6761\u6D88\u606F\uFF09": "Step-by-step feed (one message per step)",
|
|
1093
|
+
"\u9002\u5408\u65E5\u5E38\u95EE\u7B54\uFF1A\u6267\u884C\u8FC7\u7A0B\u4E2D\u4E0D\u663E\u793A\u5DE5\u5177\u8C03\u7528\u7B49\u4E2D\u95F4\u6B65\u9AA4\uFF0C\u53EA\u56DE\u590D\u6700\u7EC8\u7ED3\u679C": "For everyday Q&A: tool calls and other interim steps stay hidden, only the final result is replied",
|
|
1094
|
+
"\u63A8\u8350\u957F\u4EFB\u52A1\u4F7F\u7528\uFF1A\u8FC7\u7A0B\u4E0E\u6700\u7EC8\u7B54\u6848\u90FD\u5728\u540C\u4E00\u5F20\u5361\u7247\u91CC\u5B9E\u65F6\u66F4\u65B0\uFF0C\u4E0D\u5237\u5C4F": "Recommended for long tasks: the process and the final answer update live in one card without flooding the chat",
|
|
1095
|
+
"\u6BCF\u4E00\u6B65\u90FD\u5355\u72EC\u53D1\u4E00\u6761\u6D88\u606F\uFF08\u542B\u5DE5\u5177\u8C03\u7528\u548C\u8FC7\u7A0B\u8BF4\u660E\uFF09\uFF1B\u6CE8\u610F\u957F\u4EFB\u52A1\u4F1A\u8FDE\u7EED\u53D1\u9001\u8F83\u591A\u6D88\u606F": "Every step is sent as its own message (including tool calls and notes); long tasks may send many messages in a row",
|
|
1086
1096
|
"\u5206\u6B65\u76F4\u63A8\u8BBE\u7F6E\u4FDD\u5B58\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\u3002": "Could not save the step push setting. Try again.",
|
|
1097
|
+
"zcode\u8FC7\u7A0B\u5361\u6A21\u5F0F": "ZCode process-card mode",
|
|
1098
|
+
"\u8FC7\u7A0B\u8BF4\u660E\u3001\u5DE5\u5177\u6458\u8981\u4E0E\u6700\u7EC8\u7B54\u6848\u90FD\u5728\u540C\u4E00\u5F20\u5361\u7247\u4E2D\u539F\u5730\u5237\u65B0": "Process notes, the tool summary, and the final answer refresh in place inside one card",
|
|
1099
|
+
"\u601D\u8003\u4E0E\u5DE5\u5177\u6458\u8981\u6298\u53E0\u5C55\u793A\uFF0C\u6700\u7EC8\u7B54\u6848\u5728\u540C\u4E00\u5F20\u5361\u7247\u4E2D\u539F\u5730\u5237\u65B0": "Thinking and the tool summary stay folded; the final answer refreshes in place inside one card",
|
|
1087
1100
|
"\u9489\u9489\u8BBE\u7F6E": "DingTalk settings",
|
|
1088
1101
|
"\u4F01\u4E1A\u5FAE\u4FE1\u8BBE\u7F6E": "WeCom settings",
|
|
1089
1102
|
"\u626B\u7801\u63A5\u5165\u673A\u5668\u4EBA": "Scan QR code",
|
|
@@ -5970,6 +5983,16 @@ var DiscordAccountCard = channel.AccountCard;
|
|
|
5970
5983
|
// plugin-src/client/channels/feishu/index.js
|
|
5971
5984
|
var React15 = __toESM(require("react"), 1);
|
|
5972
5985
|
|
|
5986
|
+
// src/channels/feishu/step-push-mode.mjs
|
|
5987
|
+
var FEISHU_STEP_PUSH_MODES = Object.freeze({
|
|
5988
|
+
POST: "post",
|
|
5989
|
+
STREAMING_CARD: "streaming_card"
|
|
5990
|
+
});
|
|
5991
|
+
var DEFAULT_FEISHU_STEP_PUSH_MODE = FEISHU_STEP_PUSH_MODES.STREAMING_CARD;
|
|
5992
|
+
function normalizeFeishuStepPushMode(value) {
|
|
5993
|
+
return value === FEISHU_STEP_PUSH_MODES.STREAMING_CARD ? FEISHU_STEP_PUSH_MODES.STREAMING_CARD : FEISHU_STEP_PUSH_MODES.POST;
|
|
5994
|
+
}
|
|
5995
|
+
|
|
5973
5996
|
// plugin-src/client/channels/feishu/api.js
|
|
5974
5997
|
var FEISHU_RPC_CHANNEL = "/feishu";
|
|
5975
5998
|
var FEISHU_ENDPOINTS = Object.freeze({
|
|
@@ -5991,6 +6014,7 @@ var FEISHU_ENDPOINTS = Object.freeze({
|
|
|
5991
6014
|
setGroupResponseMode: "bot.group-response-mode.set",
|
|
5992
6015
|
setGroupTopicReply: "bot.group-topic-reply.set",
|
|
5993
6016
|
setStepPush: "bot.step-push.set",
|
|
6017
|
+
setStepPushMode: "bot.step-push-mode.set",
|
|
5994
6018
|
// Kept for rolling upgrades. The multi-bot UI never calls these endpoints.
|
|
5995
6019
|
testConnection: "connection.test",
|
|
5996
6020
|
disconnect: "connection.disconnect"
|
|
@@ -6144,6 +6168,7 @@ function normalizeBotConnection(value, fallbackBotId) {
|
|
|
6144
6168
|
groupResponseMode: normalizeGroupResponseMode(value.groupResponseMode),
|
|
6145
6169
|
groupTopicReply: value.groupTopicReply === true,
|
|
6146
6170
|
stepPush: value.stepPush === true,
|
|
6171
|
+
stepPushMode: normalizeFeishuStepPushMode(value.stepPushMode),
|
|
6147
6172
|
groupMessagePermissionGranted: value.groupMessagePermissionGranted === true,
|
|
6148
6173
|
bot: normalizeBot2(value.bot),
|
|
6149
6174
|
health: normalizeHealth(value.health, connected),
|
|
@@ -6714,25 +6739,38 @@ function RemoveConfirmation2({ bot, busy, onConfirm, onCancel }) {
|
|
|
6714
6739
|
)
|
|
6715
6740
|
);
|
|
6716
6741
|
}
|
|
6717
|
-
function StepPushEditor({ value = false, disabled = false, onSave }) {
|
|
6742
|
+
function StepPushEditor({ value = false, mode = "post", disabled = false, onSave, onModeSave }) {
|
|
6718
6743
|
const titleId = React15.useId();
|
|
6719
6744
|
const helpId = `${titleId}-help`;
|
|
6720
|
-
const current = value === true ?
|
|
6745
|
+
const current = value === true ? mode : "off";
|
|
6721
6746
|
const [saving, setSaving] = React15.useState(false);
|
|
6722
6747
|
const [error, setError] = React15.useState(null);
|
|
6723
|
-
const
|
|
6724
|
-
|
|
6725
|
-
if ((next ? "on" : "off") === current || saving || disabled) return;
|
|
6748
|
+
const save = async (run) => {
|
|
6749
|
+
if (saving || disabled) return;
|
|
6726
6750
|
setSaving(true);
|
|
6727
6751
|
setError(null);
|
|
6728
6752
|
try {
|
|
6729
|
-
await
|
|
6753
|
+
await run();
|
|
6730
6754
|
} catch (cause) {
|
|
6731
6755
|
setError(cause?.message ?? "\u5206\u6B65\u76F4\u63A8\u8BBE\u7F6E\u4FDD\u5B58\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\u3002");
|
|
6732
6756
|
} finally {
|
|
6733
6757
|
setSaving(false);
|
|
6734
6758
|
}
|
|
6735
6759
|
};
|
|
6760
|
+
const change = (event) => {
|
|
6761
|
+
const next = event.target.value;
|
|
6762
|
+
if (next === current) return;
|
|
6763
|
+
void save(async () => {
|
|
6764
|
+
if (next === "off") {
|
|
6765
|
+
if (value === true) await onSave?.(false);
|
|
6766
|
+
return;
|
|
6767
|
+
}
|
|
6768
|
+
const nextMode = next === "streaming_card" ? "streaming_card" : "post";
|
|
6769
|
+
if (value !== true) await onSave?.(true);
|
|
6770
|
+
if (nextMode !== mode) await onModeSave?.(nextMode);
|
|
6771
|
+
});
|
|
6772
|
+
};
|
|
6773
|
+
const helpText = current === "off" ? "\u9002\u5408\u65E5\u5E38\u95EE\u7B54\uFF1A\u6267\u884C\u8FC7\u7A0B\u4E2D\u4E0D\u663E\u793A\u5DE5\u5177\u8C03\u7528\u7B49\u4E2D\u95F4\u6B65\u9AA4\uFF0C\u53EA\u56DE\u590D\u6700\u7EC8\u7ED3\u679C" : current === "streaming_card" ? "\u63A8\u8350\u957F\u4EFB\u52A1\u4F7F\u7528\uFF1A\u8FC7\u7A0B\u4E0E\u6700\u7EC8\u7B54\u6848\u90FD\u5728\u540C\u4E00\u5F20\u5361\u7247\u91CC\u5B9E\u65F6\u66F4\u65B0\uFF0C\u4E0D\u5237\u5C4F" : "\u6BCF\u4E00\u6B65\u90FD\u5355\u72EC\u53D1\u4E00\u6761\u6D88\u606F\uFF08\u542B\u5DE5\u5177\u8C03\u7528\u548C\u8FC7\u7A0B\u8BF4\u660E\uFF09\uFF1B\u6CE8\u610F\u957F\u4EFB\u52A1\u4F1A\u8FDE\u7EED\u53D1\u9001\u8F83\u591A\u6D88\u606F";
|
|
6736
6774
|
return h2(
|
|
6737
6775
|
"section",
|
|
6738
6776
|
{
|
|
@@ -6745,7 +6783,7 @@ function StepPushEditor({ value = false, disabled = false, onSave }) {
|
|
|
6745
6783
|
h2(
|
|
6746
6784
|
"div",
|
|
6747
6785
|
{ className: "dim-presetTitle" },
|
|
6748
|
-
h2("h3", { id: titleId }, "\
|
|
6786
|
+
h2("h3", { id: titleId }, "\u4EFB\u52A1\u8FC7\u7A0B\u5C55\u793A"),
|
|
6749
6787
|
h2(
|
|
6750
6788
|
"span",
|
|
6751
6789
|
{ className: "dim-presetHelp" },
|
|
@@ -6759,7 +6797,7 @@ function StepPushEditor({ value = false, disabled = false, onSave }) {
|
|
|
6759
6797
|
id: helpId,
|
|
6760
6798
|
className: "dim-presetTooltip",
|
|
6761
6799
|
role: "tooltip"
|
|
6762
|
-
}, "\
|
|
6800
|
+
}, "\u8BBE\u7F6E\u4EFB\u52A1\u6267\u884C\u8FC7\u7A0B\u7684\u5448\u73B0\u65B9\u5F0F\uFF1A\u4E0D\u663E\u793A\u3001\u5B9E\u65F6\u5361\u7247\u6216\u9010\u6B65\u6D88\u606F")
|
|
6763
6801
|
)
|
|
6764
6802
|
),
|
|
6765
6803
|
saving ? h2("span", { className: "dim-feishuGroupControlStatus", role: "status" }, "\u4FDD\u5B58\u4E2D\u2026") : null
|
|
@@ -6770,14 +6808,14 @@ function StepPushEditor({ value = false, disabled = false, onSave }) {
|
|
|
6770
6808
|
className: "dim-feishuGroupSelect",
|
|
6771
6809
|
value: current,
|
|
6772
6810
|
disabled: disabled || saving,
|
|
6773
|
-
"aria-label": "\
|
|
6774
|
-
onChange:
|
|
6775
|
-
void change(event);
|
|
6776
|
-
}
|
|
6811
|
+
"aria-label": "\u4EFB\u52A1\u8FC7\u7A0B\u5C55\u793A",
|
|
6812
|
+
onChange: change
|
|
6777
6813
|
},
|
|
6778
|
-
h2("option", { value: "off" }, "\
|
|
6779
|
-
h2("option", { value: "
|
|
6814
|
+
h2("option", { value: "off" }, "\u4E0D\u663E\u793A\u8FC7\u7A0B\uFF08\u53EA\u53D1\u9001\u6700\u7EC8\u7B54\u6848\uFF09"),
|
|
6815
|
+
h2("option", { value: "streaming_card" }, "\u5B9E\u65F6\u8FC7\u7A0B\u5361\uFF08\u5168\u7A0B\u4E00\u5F20\u5361\u7247\u52A8\u6001\u66F4\u65B0\uFF09"),
|
|
6816
|
+
h2("option", { value: "post" }, "\u9010\u6B65\u76F4\u64AD\uFF08\u6BCF\u4E00\u6B65\u5355\u72EC\u53D1\u4E00\u6761\u6D88\u606F\uFF09")
|
|
6780
6817
|
),
|
|
6818
|
+
h2("p", { className: "dim-feishuGroupHelp" }, helpText),
|
|
6781
6819
|
error ? h2("p", {
|
|
6782
6820
|
className: "dim-feishuGroupError",
|
|
6783
6821
|
role: "alert"
|
|
@@ -6800,6 +6838,7 @@ function BotCard({
|
|
|
6800
6838
|
onAgentPresetSave,
|
|
6801
6839
|
onContextEnhancementSave,
|
|
6802
6840
|
onStepPushSave,
|
|
6841
|
+
onStepPushModeSave,
|
|
6803
6842
|
onRequestRemove,
|
|
6804
6843
|
onConfirmRemove,
|
|
6805
6844
|
onCancelRemove,
|
|
@@ -6904,8 +6943,10 @@ function BotCard({
|
|
|
6904
6943
|
}),
|
|
6905
6944
|
h2(StepPushEditor, {
|
|
6906
6945
|
value: connection.stepPush,
|
|
6946
|
+
mode: connection.stepPushMode,
|
|
6907
6947
|
disabled: Boolean(busy),
|
|
6908
|
-
onSave: onStepPushSave
|
|
6948
|
+
onSave: onStepPushSave,
|
|
6949
|
+
onModeSave: onStepPushModeSave
|
|
6909
6950
|
}),
|
|
6910
6951
|
provisionContent ? h2("section", {
|
|
6911
6952
|
className: "bxf-botProvision dim-botProvision",
|
|
@@ -7018,6 +7059,7 @@ function BotList(props) {
|
|
|
7018
7059
|
onAgentPresetSave: (agentPreset) => props.onAgentPresetSave(bot, agentPreset),
|
|
7019
7060
|
onContextEnhancementSave: (config) => props.onContextEnhancementSave(bot, config),
|
|
7020
7061
|
onStepPushSave: (stepPush) => props.onStepPushSave(bot, stepPush),
|
|
7062
|
+
onStepPushModeSave: (stepPushMode) => props.onStepPushModeSave(bot, stepPushMode),
|
|
7021
7063
|
onRequestRemove: () => props.onRequestRemove(bot),
|
|
7022
7064
|
onConfirmRemove: () => props.onConfirmRemove(bot),
|
|
7023
7065
|
onCancelRemove: props.onCancelRemove,
|
|
@@ -7726,6 +7768,12 @@ function FeishuSettingsTab({ rpcCall }) {
|
|
|
7726
7768
|
FEISHU_ENDPOINTS.setStepPush,
|
|
7727
7769
|
{ stepPush }
|
|
7728
7770
|
),
|
|
7771
|
+
onStepPushModeSave: (connection, stepPushMode) => saveBotSetting(
|
|
7772
|
+
connection,
|
|
7773
|
+
"step-push-mode",
|
|
7774
|
+
FEISHU_ENDPOINTS.setStepPushMode,
|
|
7775
|
+
{ stepPushMode }
|
|
7776
|
+
),
|
|
7729
7777
|
onRequestRemove: requestRemove,
|
|
7730
7778
|
onConfirmRemove: (bot) => void confirmRemove(bot),
|
|
7731
7779
|
onCancelRemove: cancelRemove,
|