@xmanrui/dsh-im 4.16.1 → 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 +62 -18
- package/lib/index.js +259 -256
- package/package.json +1 -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/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",
|
|
@@ -1085,9 +1085,18 @@ var EN = Object.freeze({
|
|
|
1085
1085
|
"\u5206\u6B65\u76F4\u63A8": "Step push",
|
|
1086
1086
|
"\u67E5\u770B\u5206\u6B65\u76F4\u63A8\u8BF4\u660E": "View step push help",
|
|
1087
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",
|
|
1088
|
-
"\
|
|
1089
|
-
"\
|
|
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",
|
|
1090
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",
|
|
1091
1100
|
"\u9489\u9489\u8BBE\u7F6E": "DingTalk settings",
|
|
1092
1101
|
"\u4F01\u4E1A\u5FAE\u4FE1\u8BBE\u7F6E": "WeCom settings",
|
|
1093
1102
|
"\u626B\u7801\u63A5\u5165\u673A\u5668\u4EBA": "Scan QR code",
|
|
@@ -5974,6 +5983,16 @@ var DiscordAccountCard = channel.AccountCard;
|
|
|
5974
5983
|
// plugin-src/client/channels/feishu/index.js
|
|
5975
5984
|
var React15 = __toESM(require("react"), 1);
|
|
5976
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
|
+
|
|
5977
5996
|
// plugin-src/client/channels/feishu/api.js
|
|
5978
5997
|
var FEISHU_RPC_CHANNEL = "/feishu";
|
|
5979
5998
|
var FEISHU_ENDPOINTS = Object.freeze({
|
|
@@ -5995,6 +6014,7 @@ var FEISHU_ENDPOINTS = Object.freeze({
|
|
|
5995
6014
|
setGroupResponseMode: "bot.group-response-mode.set",
|
|
5996
6015
|
setGroupTopicReply: "bot.group-topic-reply.set",
|
|
5997
6016
|
setStepPush: "bot.step-push.set",
|
|
6017
|
+
setStepPushMode: "bot.step-push-mode.set",
|
|
5998
6018
|
// Kept for rolling upgrades. The multi-bot UI never calls these endpoints.
|
|
5999
6019
|
testConnection: "connection.test",
|
|
6000
6020
|
disconnect: "connection.disconnect"
|
|
@@ -6148,6 +6168,7 @@ function normalizeBotConnection(value, fallbackBotId) {
|
|
|
6148
6168
|
groupResponseMode: normalizeGroupResponseMode(value.groupResponseMode),
|
|
6149
6169
|
groupTopicReply: value.groupTopicReply === true,
|
|
6150
6170
|
stepPush: value.stepPush === true,
|
|
6171
|
+
stepPushMode: normalizeFeishuStepPushMode(value.stepPushMode),
|
|
6151
6172
|
groupMessagePermissionGranted: value.groupMessagePermissionGranted === true,
|
|
6152
6173
|
bot: normalizeBot2(value.bot),
|
|
6153
6174
|
health: normalizeHealth(value.health, connected),
|
|
@@ -6718,25 +6739,38 @@ function RemoveConfirmation2({ bot, busy, onConfirm, onCancel }) {
|
|
|
6718
6739
|
)
|
|
6719
6740
|
);
|
|
6720
6741
|
}
|
|
6721
|
-
function StepPushEditor({ value = false, disabled = false, onSave }) {
|
|
6742
|
+
function StepPushEditor({ value = false, mode = "post", disabled = false, onSave, onModeSave }) {
|
|
6722
6743
|
const titleId = React15.useId();
|
|
6723
6744
|
const helpId = `${titleId}-help`;
|
|
6724
|
-
const current = value === true ?
|
|
6745
|
+
const current = value === true ? mode : "off";
|
|
6725
6746
|
const [saving, setSaving] = React15.useState(false);
|
|
6726
6747
|
const [error, setError] = React15.useState(null);
|
|
6727
|
-
const
|
|
6728
|
-
|
|
6729
|
-
if ((next ? "on" : "off") === current || saving || disabled) return;
|
|
6748
|
+
const save = async (run) => {
|
|
6749
|
+
if (saving || disabled) return;
|
|
6730
6750
|
setSaving(true);
|
|
6731
6751
|
setError(null);
|
|
6732
6752
|
try {
|
|
6733
|
-
await
|
|
6753
|
+
await run();
|
|
6734
6754
|
} catch (cause) {
|
|
6735
6755
|
setError(cause?.message ?? "\u5206\u6B65\u76F4\u63A8\u8BBE\u7F6E\u4FDD\u5B58\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\u3002");
|
|
6736
6756
|
} finally {
|
|
6737
6757
|
setSaving(false);
|
|
6738
6758
|
}
|
|
6739
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";
|
|
6740
6774
|
return h2(
|
|
6741
6775
|
"section",
|
|
6742
6776
|
{
|
|
@@ -6749,7 +6783,7 @@ function StepPushEditor({ value = false, disabled = false, onSave }) {
|
|
|
6749
6783
|
h2(
|
|
6750
6784
|
"div",
|
|
6751
6785
|
{ className: "dim-presetTitle" },
|
|
6752
|
-
h2("h3", { id: titleId }, "\
|
|
6786
|
+
h2("h3", { id: titleId }, "\u4EFB\u52A1\u8FC7\u7A0B\u5C55\u793A"),
|
|
6753
6787
|
h2(
|
|
6754
6788
|
"span",
|
|
6755
6789
|
{ className: "dim-presetHelp" },
|
|
@@ -6763,7 +6797,7 @@ function StepPushEditor({ value = false, disabled = false, onSave }) {
|
|
|
6763
6797
|
id: helpId,
|
|
6764
6798
|
className: "dim-presetTooltip",
|
|
6765
6799
|
role: "tooltip"
|
|
6766
|
-
}, "\
|
|
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")
|
|
6767
6801
|
)
|
|
6768
6802
|
),
|
|
6769
6803
|
saving ? h2("span", { className: "dim-feishuGroupControlStatus", role: "status" }, "\u4FDD\u5B58\u4E2D\u2026") : null
|
|
@@ -6774,14 +6808,14 @@ function StepPushEditor({ value = false, disabled = false, onSave }) {
|
|
|
6774
6808
|
className: "dim-feishuGroupSelect",
|
|
6775
6809
|
value: current,
|
|
6776
6810
|
disabled: disabled || saving,
|
|
6777
|
-
"aria-label": "\
|
|
6778
|
-
onChange:
|
|
6779
|
-
void change(event);
|
|
6780
|
-
}
|
|
6811
|
+
"aria-label": "\u4EFB\u52A1\u8FC7\u7A0B\u5C55\u793A",
|
|
6812
|
+
onChange: change
|
|
6781
6813
|
},
|
|
6782
|
-
h2("option", { value: "off" }, "\
|
|
6783
|
-
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")
|
|
6784
6817
|
),
|
|
6818
|
+
h2("p", { className: "dim-feishuGroupHelp" }, helpText),
|
|
6785
6819
|
error ? h2("p", {
|
|
6786
6820
|
className: "dim-feishuGroupError",
|
|
6787
6821
|
role: "alert"
|
|
@@ -6804,6 +6838,7 @@ function BotCard({
|
|
|
6804
6838
|
onAgentPresetSave,
|
|
6805
6839
|
onContextEnhancementSave,
|
|
6806
6840
|
onStepPushSave,
|
|
6841
|
+
onStepPushModeSave,
|
|
6807
6842
|
onRequestRemove,
|
|
6808
6843
|
onConfirmRemove,
|
|
6809
6844
|
onCancelRemove,
|
|
@@ -6908,8 +6943,10 @@ function BotCard({
|
|
|
6908
6943
|
}),
|
|
6909
6944
|
h2(StepPushEditor, {
|
|
6910
6945
|
value: connection.stepPush,
|
|
6946
|
+
mode: connection.stepPushMode,
|
|
6911
6947
|
disabled: Boolean(busy),
|
|
6912
|
-
onSave: onStepPushSave
|
|
6948
|
+
onSave: onStepPushSave,
|
|
6949
|
+
onModeSave: onStepPushModeSave
|
|
6913
6950
|
}),
|
|
6914
6951
|
provisionContent ? h2("section", {
|
|
6915
6952
|
className: "bxf-botProvision dim-botProvision",
|
|
@@ -7022,6 +7059,7 @@ function BotList(props) {
|
|
|
7022
7059
|
onAgentPresetSave: (agentPreset) => props.onAgentPresetSave(bot, agentPreset),
|
|
7023
7060
|
onContextEnhancementSave: (config) => props.onContextEnhancementSave(bot, config),
|
|
7024
7061
|
onStepPushSave: (stepPush) => props.onStepPushSave(bot, stepPush),
|
|
7062
|
+
onStepPushModeSave: (stepPushMode) => props.onStepPushModeSave(bot, stepPushMode),
|
|
7025
7063
|
onRequestRemove: () => props.onRequestRemove(bot),
|
|
7026
7064
|
onConfirmRemove: () => props.onConfirmRemove(bot),
|
|
7027
7065
|
onCancelRemove: props.onCancelRemove,
|
|
@@ -7730,6 +7768,12 @@ function FeishuSettingsTab({ rpcCall }) {
|
|
|
7730
7768
|
FEISHU_ENDPOINTS.setStepPush,
|
|
7731
7769
|
{ stepPush }
|
|
7732
7770
|
),
|
|
7771
|
+
onStepPushModeSave: (connection, stepPushMode) => saveBotSetting(
|
|
7772
|
+
connection,
|
|
7773
|
+
"step-push-mode",
|
|
7774
|
+
FEISHU_ENDPOINTS.setStepPushMode,
|
|
7775
|
+
{ stepPushMode }
|
|
7776
|
+
),
|
|
7733
7777
|
onRequestRemove: requestRemove,
|
|
7734
7778
|
onConfirmRemove: (bot) => void confirmRemove(bot),
|
|
7735
7779
|
onCancelRemove: cancelRemove,
|