@xmanrui/dsh-im 5.10.0 → 5.11.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/README.en.md +39 -5
- package/README.md +42 -5
- package/bin/dsh-im.mjs +65 -0
- package/docs/client-integration.md +4 -0
- package/lib/client.js +1202 -95
- package/lib/index.js +365 -339
- package/package.json +7 -6
- package/plugin-src/client/access-policy-settings.js +210 -12
- package/plugin-src/client/bot-general-settings.js +44 -3
- package/plugin-src/client/i18n-ru.js +85 -0
- package/plugin-src/client/i18n.js +83 -0
- package/plugin-src/client/im-channels.js +419 -0
- package/plugin-src/client/index.js +33 -1
- package/plugin-src/client/styles.js +7 -7
- package/plugin-src/client/update-panel.js +2 -1
- package/plugin-src/host/channel-list-rpc.mjs +280 -0
- package/plugin-src/host/channels/dingtalk/production.mjs +28 -10
- package/plugin-src/host/channels/dingtalk/rpc.mjs +10 -1
- package/plugin-src/host/channels/feishu/production.mjs +39 -10
- package/plugin-src/host/channels/feishu/rpc.mjs +10 -1
- package/plugin-src/host/channels/matrix/production.mjs +28 -10
- package/plugin-src/host/channels/matrix/rpc.mjs +10 -0
- package/plugin-src/host/channels/qq/production.mjs +30 -11
- package/plugin-src/host/channels/qq/rpc.mjs +10 -1
- package/plugin-src/host/channels/shared/access-policy-production.mjs +9 -0
- package/plugin-src/host/channels/shared/binding-events.mjs +109 -0
- package/plugin-src/host/channels/shared/production.mjs +14 -1
- package/plugin-src/host/channels/shared/reply-content-rpc.mjs +17 -0
- package/plugin-src/host/channels/shared/rpc.mjs +9 -0
- package/plugin-src/host/channels/slack/production.mjs +28 -10
- package/plugin-src/host/channels/slack/rpc.mjs +10 -0
- package/plugin-src/host/channels/telegram/production.mjs +5 -0
- package/plugin-src/host/channels/wecom/production.mjs +28 -10
- package/plugin-src/host/channels/wecom/rpc.mjs +10 -1
- package/plugin-src/host/channels/wecom-app/production.mjs +28 -10
- package/plugin-src/host/channels/wecom-app/rpc.mjs +9 -0
- package/plugin-src/host/channels/weixin/production.mjs +28 -10
- package/plugin-src/host/channels/weixin/rpc.mjs +10 -1
- package/plugin-src/host/channels/whatsapp/production.mjs +28 -10
- package/plugin-src/host/channels/whatsapp/rpc.mjs +10 -1
- package/plugin-src/host/delivery-service.mjs +3 -4
- package/plugin-src/host/delivery-suggestions.mjs +3 -1
- package/plugin-src/host/harness-connection.mjs +2 -1
- package/plugin-src/host/harness-peer.mjs +3 -1
- package/plugin-src/host/index.mjs +8 -1
- package/plugin-src/host/modern-harness-api.mjs +5 -1
- package/plugin-src/host/root-scope.mjs +32 -0
- package/plugin-src/host/session-sync-coordinator.mjs +2 -1
- package/plugin-src/management-rpc.mjs +18 -2
- package/scripts/verify-package.mjs +36 -7
- package/src/channels/dingtalk/dingtalk-bridge.mjs +50 -6
- package/src/channels/dingtalk/state-store.mjs +56 -0
- package/src/channels/discord/discord-api.mjs +2 -1
- package/src/channels/feishu/bridge.mjs +154 -58
- package/src/channels/feishu/feishu-cards.mjs +10 -4
- package/src/channels/feishu/feishu-runtime.mjs +11 -3
- package/src/channels/feishu/message-utils.mjs +106 -30
- package/src/channels/feishu/slash-command-panel.mjs +26 -0
- package/src/channels/feishu/state-store.mjs +14 -0
- package/src/channels/matrix/matrix-api.mjs +2 -1
- package/src/channels/qq/qq-bridge.mjs +105 -14
- package/src/channels/qq/state-store.mjs +13 -1
- package/src/channels/shared/access-policy.mjs +60 -7
- package/src/channels/shared/bot-workspace-store.mjs +155 -3
- package/src/channels/shared/busy-message-dispatcher.mjs +2 -2
- package/src/channels/shared/channel-capabilities.mjs +44 -0
- package/src/channels/shared/command-catalog.mjs +68 -3
- package/src/channels/shared/command-permission.mjs +6 -2
- package/src/channels/shared/conversation-state-store.mjs +16 -0
- package/src/channels/shared/deferred-delivery-coordinator.mjs +6 -1
- package/src/channels/shared/deferred-delivery.mjs +4 -0
- package/src/channels/shared/diagnostic-details.mjs +6 -1
- package/src/channels/shared/failure-log-file.mjs +79 -0
- package/src/channels/shared/harness-client.mjs +111 -6
- package/src/channels/shared/i18n-en/feishu.mjs +2 -2
- package/src/channels/shared/i18n-en/shared-a.mjs +13 -2
- package/src/channels/shared/i18n-en/shared-b.mjs +67 -4
- package/src/channels/shared/i18n-en/shared-d.mjs +144 -0
- package/src/channels/shared/i18n-en/weixin.mjs +4 -0
- package/src/channels/shared/i18n-en.mjs +2 -0
- package/src/channels/shared/i18n-ru/feishu.mjs +2 -2
- package/src/channels/shared/i18n-ru/shared-a.mjs +13 -2
- package/src/channels/shared/i18n-ru/shared-b.mjs +67 -4
- package/src/channels/shared/i18n-ru/shared-d.mjs +144 -0
- package/src/channels/shared/i18n-ru/weixin.mjs +4 -0
- package/src/channels/shared/i18n-ru.mjs +2 -0
- package/src/channels/shared/inbound-access.mjs +10 -0
- package/src/channels/shared/markdown-chunks.mjs +5 -0
- package/src/channels/shared/message-failure.mjs +22 -1
- package/src/channels/shared/new-command.mjs +158 -4
- package/src/channels/shared/plan-goal-command.mjs +132 -0
- package/src/channels/shared/qrcode.mjs +5 -0
- package/src/channels/shared/reply-content.mjs +102 -0
- package/src/channels/shared/reset-command.mjs +46 -0
- package/src/channels/shared/semantic/artifact.mjs +133 -29
- package/src/channels/shared/semantic/reply-reference.mjs +18 -3
- package/src/channels/shared/session-nav-command.mjs +999 -0
- package/src/channels/shared/session-ring-support.mjs +184 -0
- package/src/channels/shared/session-ring.mjs +202 -0
- package/src/channels/shared/session-title.mjs +11 -0
- package/src/channels/shared/status-command.mjs +2 -1
- package/src/channels/shared/text-harness-bridge.mjs +166 -7
- package/src/channels/shared/workspace-command.mjs +567 -31
- package/src/channels/shared/workspace-session.mjs +39 -3
- package/src/channels/slack/slack-api.mjs +2 -1
- package/src/channels/telegram/config-store.mjs +10 -2
- package/src/channels/telegram/telegram-rich-message.mjs +17 -5
- package/src/channels/telegram/telegram-runtime.mjs +14 -1
- package/src/channels/wecom/state-store.mjs +13 -1
- package/src/channels/wecom/wecom-bridge.mjs +183 -26
- package/src/channels/wecom-app/state-store.mjs +13 -1
- package/src/channels/wecom-app/wecom-app-bridge.mjs +44 -4
- package/src/channels/weixin/state-store.mjs +13 -1
- package/src/channels/weixin/weixin-bridge.mjs +71 -4
package/lib/client.js
CHANGED
|
@@ -607,12 +607,12 @@ async function callManagementRpc(connection, channel7, method, payload, signal)
|
|
|
607
607
|
}
|
|
608
608
|
|
|
609
609
|
// plugin-src/client/index.js
|
|
610
|
-
var
|
|
610
|
+
var React50 = __toESM(require("react"), 1);
|
|
611
611
|
|
|
612
612
|
// package.json
|
|
613
613
|
var package_default = {
|
|
614
614
|
name: "@xmanrui/dsh-im",
|
|
615
|
-
version: "5.
|
|
615
|
+
version: "5.11.0",
|
|
616
616
|
icon: "./assets/logo-plugin-message-link-gradient.webp",
|
|
617
617
|
description: "\u628A\u5FAE\u4FE1\u3001\u98DE\u4E66\u3001\u4F01\u5FAE\u3001\u9489\u9489\u3001QQ\u3001Telegram\u3001WhatsApp\u3001Slack\u3001Discord\u3001Matrix\u63A5\u5165DSH\u3002 Connect Telegram, WhatsApp, Slack, Discord, Matrix, WeChat, Feishu, WeCom, DingTalk, and QQ to DSH.",
|
|
618
618
|
keywords: [
|
|
@@ -693,18 +693,19 @@ var package_default = {
|
|
|
693
693
|
client: {
|
|
694
694
|
inject: [
|
|
695
695
|
"@deepseek-ai/dsh-client-connection",
|
|
696
|
-
"@deepseek-ai/dsh-client-
|
|
696
|
+
"@deepseek-ai/dsh-client-locale",
|
|
697
|
+
"@deepseek-ai/dsh-client-ui-renderer",
|
|
697
698
|
"@deepseek-ai/dsh-client-ui-settings",
|
|
698
|
-
"@deepseek-ai/dsh-client-ui-
|
|
699
|
-
"@deepseek-ai/dsh-client-locale"
|
|
699
|
+
"@deepseek-ai/dsh-client-ui-workspace"
|
|
700
700
|
],
|
|
701
701
|
platform: "web"
|
|
702
702
|
},
|
|
703
703
|
compatibility: {
|
|
704
|
-
dsh: "0.2.
|
|
704
|
+
dsh: "0.2.2-rc.5",
|
|
705
705
|
dshReleases: {
|
|
706
706
|
"0.2.0-rc.2": "compatible",
|
|
707
|
-
"0.2.1-rc.2": "compatible"
|
|
707
|
+
"0.2.1-rc.2": "compatible",
|
|
708
|
+
"0.2.2-rc.5": "compatible"
|
|
708
709
|
},
|
|
709
710
|
profiles: [
|
|
710
711
|
"web"
|
|
@@ -1511,7 +1512,9 @@ var weixin_default = {
|
|
|
1511
1512
|
"\u5FAE\u4FE1\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u4E8C\u7EF4\u7801\u4EE4\u724C\u3002": "\u0421\u0435\u0440\u0432\u0438\u0441 WeChat \u043D\u0435 \u0432\u0435\u0440\u043D\u0443\u043B \u0442\u043E\u043A\u0435\u043D QR-\u043A\u043E\u0434\u0430.",
|
|
1512
1513
|
"\u5FAE\u4FE1\u670D\u52A1\u62D2\u7EDD\u4E86\u56DE\u590D\u6D88\u606F\u3002": "\u0421\u0435\u0440\u0432\u0438\u0441 WeChat \u043E\u0442\u043A\u043B\u043E\u043D\u0438\u043B \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435-\u043E\u0442\u0432\u0435\u0442.",
|
|
1513
1514
|
"\u5FAE\u4FE1\u670D\u52A1\u62D2\u7EDD\u4E86\u6587\u4EF6\u4E0A\u4F20\u8BF7\u6C42\u3002": "\u0421\u0435\u0440\u0432\u0438\u0441 WeChat \u043E\u0442\u043A\u043B\u043E\u043D\u0438\u043B \u0437\u0430\u043F\u0440\u043E\u0441 \u043D\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0443 \u0444\u0430\u0439\u043B\u0430.",
|
|
1514
|
-
"\u5FAE\u4FE1\u670D\u52A1\u62D2\u7EDD\u4E86\u6587\u4EF6\u6D88\u606F\u3002": "\u0421\u0435\u0440\u0432\u0438\u0441 WeChat \u043E\u0442\u043A\u043B\u043E\u043D\u0438\u043B \u0444\u0430\u0439\u043B\u043E\u0432\u043E\u0435 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435."
|
|
1515
|
+
"\u5FAE\u4FE1\u670D\u52A1\u62D2\u7EDD\u4E86\u6587\u4EF6\u6D88\u606F\u3002": "\u0421\u0435\u0440\u0432\u0438\u0441 WeChat \u043E\u0442\u043A\u043B\u043E\u043D\u0438\u043B \u0444\u0430\u0439\u043B\u043E\u0432\u043E\u0435 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435.",
|
|
1516
|
+
"/plan \u8FDB\u5165\u8BA1\u5212\u6A21\u5F0F\uFF08/plan off \u9000\u51FA\uFF0C\u53EF\u9644\u5E26\u8BF4\u660E\u6587\u5B57\uFF09": "/plan \u0412\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u0440\u0435\u0436\u0438\u043C \u043F\u043B\u0430\u043D\u0430 (/plan off \u2014 \u0432\u044B\u0445\u043E\u0434; \u043C\u043E\u0436\u043D\u043E \u043F\u0440\u0438\u043B\u043E\u0436\u0438\u0442\u044C \u043F\u043E\u044F\u0441\u043D\u0435\u043D\u0438\u0435)",
|
|
1517
|
+
"/goal [\u76EE\u6807] \u8BBE\u7F6E\u76EE\u6807\uFF08clear \u6E05\u9664\u3001edit \u4FEE\u6539\u3001pause \u6682\u505C\u3001resume \u6062\u590D\uFF1B\u4E0D\u5E26\u53C2\u6570\u67E5\u770B\uFF09": "/goal [\u0446\u0435\u043B\u044C] \u0417\u0430\u0434\u0430\u0442\u044C \u0446\u0435\u043B\u044C (clear \u2014 \u0443\u0434\u0430\u043B\u0438\u0442\u044C, edit \u2014 \u0438\u0437\u043C\u0435\u043D\u0438\u0442\u044C, pause \u2014 \u043F\u0440\u0438\u043E\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C, resume \u2014 \u0432\u043E\u0437\u043E\u0431\u043D\u043E\u0432\u0438\u0442\u044C; \u0431\u0435\u0437 \u0430\u0440\u0433\u0443\u043C\u0435\u043D\u0442\u0430 \u2014 \u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440)"
|
|
1515
1518
|
};
|
|
1516
1519
|
|
|
1517
1520
|
// plugin-src/client/i18n-ru.js
|
|
@@ -1579,10 +1582,46 @@ var COMPOSED = Object.freeze({
|
|
|
1579
1582
|
"\u64CD\u4F5C\u5931\u8D25\uFF1A{error}": "\u041E\u043F\u0435\u0440\u0430\u0446\u0438\u044F \u043D\u0435 \u0443\u0434\u0430\u043B\u0430\u0441\u044C: {error}",
|
|
1580
1583
|
"\u72B6\u6001\u5237\u65B0\u5931\u8D25\uFF1A{error}": "\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u0441\u043E\u0441\u0442\u043E\u044F\u043D\u0438\u0435: {error}",
|
|
1581
1584
|
"\u72B6\u6001\u81EA\u52A8\u5237\u65B0\u5931\u8D25\uFF1A{error}": "\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u0441\u043E\u0441\u0442\u043E\u044F\u043D\u0438\u0435 \u0430\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0438: {error}",
|
|
1582
|
-
"\u8BF7\u8F93\u5165 -1\u30010 \u6216 1~{max} \u4E4B\u95F4\u7684\u6574\u6570\u3002": "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 -1, 0 \u0438\u043B\u0438 \u0446\u0435\u043B\u043E\u0435 \u0447\u0438\u0441\u043B\u043E \u043E\u0442 1 \u0434\u043E {max}."
|
|
1585
|
+
"\u8BF7\u8F93\u5165 -1\u30010 \u6216 1~{max} \u4E4B\u95F4\u7684\u6574\u6570\u3002": "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 -1, 0 \u0438\u043B\u0438 \u0446\u0435\u043B\u043E\u0435 \u0447\u0438\u0441\u043B\u043E \u043E\u0442 1 \u0434\u043E {max}.",
|
|
1586
|
+
"\u67E5\u770B\u4F1A\u8BDD {sessionId}": "\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u0441\u0435\u0430\u043D\u0441 {sessionId}",
|
|
1587
|
+
"\u590D\u5236\u4F1A\u8BDD ID {sessionId}": "\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C ID \u0441\u0435\u0430\u043D\u0441\u0430 {sessionId}",
|
|
1588
|
+
"{count} \u4E2A\u4F1A\u8BDD": "\u0421\u0435\u0430\u043D\u0441\u043E\u0432: {count}",
|
|
1589
|
+
"\u4E8B\u4EF6 {seq}": "\u0421\u043E\u0431\u044B\u0442\u0438\u0435 {seq}",
|
|
1590
|
+
"\u8BFB\u53D6\u5931\u8D25\uFF1A{error}": "\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u043F\u0440\u043E\u0447\u0438\u0442\u0430\u0442\u044C \u0441\u0435\u0430\u043D\u0441: {error}",
|
|
1591
|
+
"\u5DF2\u663E\u793A {shown} / {total} \u6761\u6B63\u6587": "\u041F\u043E\u043A\u0430\u0437\u0430\u043D\u043E \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0439: {shown} / {total}",
|
|
1592
|
+
"\u52A0\u8F7D\u5931\u8D25\uFF1A{error}": "\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u0441\u0435\u0430\u043D\u0441\u044B \u043A\u0430\u043D\u0430\u043B\u043E\u0432: {error}"
|
|
1583
1593
|
});
|
|
1584
1594
|
var CLIENT = Object.freeze({
|
|
1585
1595
|
...COMPOSED,
|
|
1596
|
+
// Read-only channel session directory and transcript viewer.
|
|
1597
|
+
"\u5FAE\u4FE1\u5BA2\u670D": "\u0421\u043B\u0443\u0436\u0431\u0430 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u043A\u0438 WeChat",
|
|
1598
|
+
"\u6D4F\u89C8\u5668\u672A\u5141\u8BB8\u8BBF\u95EE\u526A\u8D34\u677F": "\u0411\u0440\u0430\u0443\u0437\u0435\u0440 \u043D\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u043B \u0434\u043E\u0441\u0442\u0443\u043F \u043A \u0431\u0443\u0444\u0435\u0440\u0443 \u043E\u0431\u043C\u0435\u043D\u0430",
|
|
1599
|
+
"\u5BBF\u4E3B\u54CD\u5E94\u7F3A\u5C11 value.channels\uFF0C\u8BF7\u68C0\u67E5 dsh-im host \u662F\u5426\u5DF2\u91CD\u8F7D": "\u0412 \u043E\u0442\u0432\u0435\u0442\u0435 Host \u043D\u0435\u0442 value.channels. \u041F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435, \u043F\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043D \u043B\u0438 dsh-im host",
|
|
1600
|
+
"\u5BBF\u4E3B\u54CD\u5E94\u7F3A\u5C11 value.messages\uFF0C\u8BF7\u68C0\u67E5 dsh-im host \u662F\u5426\u5DF2\u91CD\u8F7D": "\u0412 \u043E\u0442\u0432\u0435\u0442\u0435 Host \u043D\u0435\u0442 value.messages. \u041F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435, \u043F\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043D \u043B\u0438 dsh-im host",
|
|
1601
|
+
"\u5BBF\u4E3B\u54CD\u5E94\u7F3A\u5C11 value.messages": "\u0412 \u043E\u0442\u0432\u0435\u0442\u0435 Host \u043D\u0435\u0442 value.messages",
|
|
1602
|
+
"\u67E5\u770B\u8BE5\u4F1A\u8BDD\u7684\u7528\u6237\u4E0E\u52A9\u624B\u6B63\u6587": "\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F \u0438 \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043D\u0442\u0430 \u0432 \u044D\u0442\u043E\u043C \u0441\u0435\u0430\u043D\u0441\u0435",
|
|
1603
|
+
"\u590D\u5236\u5931\u8D25": "\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C",
|
|
1604
|
+
"\u590D\u5236 ID": "\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C ID",
|
|
1605
|
+
"\u901A\u9053 / \u4F1A\u8BDD\u952E": "\u041A\u0430\u043D\u0430\u043B / \u043A\u043B\u044E\u0447 \u0431\u0435\u0441\u0435\u0434\u044B",
|
|
1606
|
+
"DSH \u4F1A\u8BDD ID": "ID \u0441\u0435\u0430\u043D\u0441\u0430 DSH",
|
|
1607
|
+
"\u64CD\u4F5C": "\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044F",
|
|
1608
|
+
"\u52A9\u624B": "\u0410\u0441\u0441\u0438\u0441\u0442\u0435\u043D\u0442",
|
|
1609
|
+
"\u672C\u6761\u6D88\u606F\u8FC7\u957F\uFF0C\u5DF2\u622A\u65AD\u3002": "\u0421\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435 \u0441\u043B\u0438\u0448\u043A\u043E\u043C \u0434\u043B\u0438\u043D\u043D\u043E\u0435 \u0438 \u0431\u044B\u043B\u043E \u043E\u0431\u0440\u0435\u0437\u0430\u043D\u043E.",
|
|
1610
|
+
"\u4F1A\u8BDD\u5185\u5BB9": "\u0421\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u0435 \u0441\u0435\u0430\u043D\u0441\u0430",
|
|
1611
|
+
"\u53EA\u8BFB\u663E\u793A\u7528\u6237\u4E0E\u52A9\u624B\u6B63\u6587\uFF1B\u7CFB\u7EDF\u63D0\u793A\u3001\u5DE5\u5177\u8C03\u7528\u548C\u5185\u90E8\u63A8\u7406\u4E0D\u663E\u793A\u3002": "\u041F\u043E\u043A\u0430\u0437\u044B\u0432\u0430\u044E\u0442\u0441\u044F \u0442\u043E\u043B\u044C\u043A\u043E \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F \u0438 \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043D\u0442\u0430. \u0421\u0438\u0441\u0442\u0435\u043C\u043D\u044B\u0435 \u043F\u043E\u0434\u0441\u043A\u0430\u0437\u043A\u0438, \u0432\u044B\u0437\u043E\u0432\u044B \u0438\u043D\u0441\u0442\u0440\u0443\u043C\u0435\u043D\u0442\u043E\u0432 \u0438 \u0432\u043D\u0443\u0442\u0440\u0435\u043D\u043D\u0438\u0435 \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0435\u043D\u0438\u044F \u0441\u043A\u0440\u044B\u0442\u044B.",
|
|
1612
|
+
"\u8FD4\u56DE\u5217\u8868": "\u0412\u0435\u0440\u043D\u0443\u0442\u044C\u0441\u044F \u043A \u0441\u043F\u0438\u0441\u043A\u0443",
|
|
1613
|
+
"\u52A0\u8F7D\u66F4\u65E9\u6D88\u606F": "\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u0431\u043E\u043B\u0435\u0435 \u0440\u0430\u043D\u043D\u0438\u0435 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F",
|
|
1614
|
+
"\u52A0\u8F7D\u4E2D\u2026": "\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430\u2026",
|
|
1615
|
+
"\u6CA1\u6709\u53EF\u663E\u793A\u7684\u7528\u6237\u6216\u52A9\u624B\u6B63\u6587\u3002": "\u041D\u0435\u0442 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0439 \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F \u0438\u043B\u0438 \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043D\u0442\u0430 \u0434\u043B\u044F \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F.",
|
|
1616
|
+
"\u4F1A\u8BDD\u8BB0\u5F55": "\u0418\u0441\u0442\u043E\u0440\u0438\u044F \u0441\u0435\u0430\u043D\u0441\u043E\u0432",
|
|
1617
|
+
"\u8FD4\u56DE IM\u673A\u5668\u4EBA": "\u041D\u0430\u0437\u0430\u0434 \u043A IM-\u0431\u043E\u0442\u0430\u043C",
|
|
1618
|
+
"\u53EA\u8BFB\u5217\u51FA\u5404 IM \u901A\u9053\u5F53\u524D\u7ED1\u5B9A\u7684 DSH \u4F1A\u8BDD\uFF1B\u70B9\u51FB\u4F1A\u8BDD ID \u67E5\u770B\u6B63\u6587\uFF0C\u4E0D\u4F1A\u4FEE\u6539\u7ED1\u5B9A\u3002": "\u0421\u043F\u0438\u0441\u043E\u043A \u0441\u0435\u0430\u043D\u0441\u043E\u0432 DSH, \u043F\u0440\u0438\u0432\u044F\u0437\u0430\u043D\u043D\u044B\u0445 \u043A \u043A\u0430\u043D\u0430\u043B\u0430\u043C IM, \u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D \u0442\u043E\u043B\u044C\u043A\u043E \u0434\u043B\u044F \u0447\u0442\u0435\u043D\u0438\u044F. \u041D\u0430\u0436\u043C\u0438\u0442\u0435 ID \u0441\u0435\u0430\u043D\u0441\u0430, \u0447\u0442\u043E\u0431\u044B \u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0435\u0442\u044C \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F; \u043F\u0440\u0438\u0432\u044F\u0437\u043A\u0430 \u043D\u0435 \u0438\u0437\u043C\u0435\u043D\u0438\u0442\u0441\u044F.",
|
|
1619
|
+
"\u6B63\u5728\u8BFB\u53D6\u901A\u9053\u4F1A\u8BDD\u2026": "\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043C \u0441\u0435\u0430\u043D\u0441\u044B \u043A\u0430\u043D\u0430\u043B\u043E\u0432\u2026",
|
|
1620
|
+
"\u5C1A\u672A\u53D1\u73B0\u5DF2\u7ED1\u5B9A DSH \u4F1A\u8BDD\u7684\u901A\u9053\u3002": "\u041A\u0430\u043D\u0430\u043B\u044B \u0441 \u043F\u0440\u0438\u0432\u044F\u0437\u0430\u043D\u043D\u044B\u043C\u0438 \u0441\u0435\u0430\u043D\u0441\u0430\u043C\u0438 DSH \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u044B.",
|
|
1621
|
+
"limit \u6216 offset \u53C2\u6570\u65E0\u6548": "\u041D\u0435\u043A\u043E\u0440\u0440\u0435\u043A\u0442\u043D\u044B\u0435 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B limit \u0438\u043B\u0438 offset",
|
|
1622
|
+
"\u8BE5\u4F1A\u8BDD\u4E0D\u5C5E\u4E8E\u6307\u5B9A\u901A\u9053\u7ED1\u5B9A\uFF0C\u53EF\u80FD\u5DF2\u89E3\u7ED1": "\u0421\u0435\u0430\u043D\u0441 \u043D\u0435 \u043F\u0440\u0438\u043D\u0430\u0434\u043B\u0435\u0436\u0438\u0442 \u0443\u043A\u0430\u0437\u0430\u043D\u043D\u043E\u0439 \u043F\u0440\u0438\u0432\u044F\u0437\u043A\u0435 \u043A\u0430\u043D\u0430\u043B\u0430; \u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E, \u043E\u043D \u0431\u044B\u043B \u043E\u0442\u0432\u044F\u0437\u0430\u043D",
|
|
1623
|
+
"\u5BBF\u4E3B sessionQuery \u670D\u52A1\u5C1A\u672A\u5C31\u7EEA": "\u0421\u043B\u0443\u0436\u0431\u0430 sessionQuery \u043D\u0430 Host \u0435\u0449\u0451 \u043D\u0435 \u0433\u043E\u0442\u043E\u0432\u0430",
|
|
1624
|
+
"\u8BE5\u4F1A\u8BDD\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002": "\u0421\u0435\u0430\u043D\u0441 \u0432\u0440\u0435\u043C\u0435\u043D\u043D\u043E \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D \u0434\u043B\u044F \u0447\u0442\u0435\u043D\u0438\u044F. \u041F\u043E\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u043F\u043E\u0437\u0436\u0435.",
|
|
1586
1625
|
// Settings shell: sidebar entry, group history, group policy, bot aliases.
|
|
1587
1626
|
"\u4FA7\u8FB9\u680F\u5165\u53E3": "\u041F\u0443\u043D\u043A\u0442 \u0432 \u0431\u043E\u043A\u043E\u0432\u043E\u0439 \u043F\u0430\u043D\u0435\u043B\u0438",
|
|
1588
1627
|
"\u81EA\u52A8\u6A21\u5F0F\uFF1A\u672A\u914D\u7F6E\u6E20\u9053\u65F6\u663E\u793A\uFF0C\u914D\u7F6E\u81F3\u5C11\u4E00\u4E2A\u6E20\u9053\u540E\u9690\u85CF\u3002\u9690\u85CF\u540E\u4ECD\u53EF\u4ECE\u63D2\u4EF6\u8BE6\u60C5\u6216\u8BBE\u7F6E\u8FDB\u5165\uFF0C\u4E0D\u5F71\u54CD\u673A\u5668\u4EBA\u540E\u53F0\u8FD0\u884C\u3002": "\u0410\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0438: \u043F\u043E\u043A\u0430\u0437\u044B\u0432\u0430\u0442\u044C, \u043F\u043E\u043A\u0430 \u043D\u0435 \u043D\u0430\u0441\u0442\u0440\u043E\u0435\u043D \u043D\u0438 \u043E\u0434\u0438\u043D \u043A\u0430\u043D\u0430\u043B, \u0437\u0430\u0442\u0435\u043C \u0441\u043A\u0440\u044B\u0432\u0430\u0442\u044C. \u041F\u043B\u0430\u0433\u0438\u043D \u043E\u0441\u0442\u0430\u0451\u0442\u0441\u044F \u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D \u0438\u0437 \u043F\u043E\u0434\u0440\u043E\u0431\u043D\u043E\u0441\u0442\u0435\u0439 \u0438 \u043D\u0430\u0441\u0442\u0440\u043E\u0435\u043A; \u0431\u043E\u0442\u044B \u043F\u0440\u043E\u0434\u043E\u043B\u0436\u0430\u044E\u0442 \u0440\u0430\u0431\u043E\u0442\u0430\u0442\u044C \u0432 \u0444\u043E\u043D\u0435.",
|
|
@@ -1653,6 +1692,43 @@ var CLIENT = Object.freeze({
|
|
|
1653
1692
|
"\u673A\u5668\u4EBA\u8BBE\u7F6E\u9875\u7B7E": "\u0412\u043A\u043B\u0430\u0434\u043A\u0438 \u043D\u0430\u0441\u0442\u0440\u043E\u0435\u043A \u0431\u043E\u0442\u0430",
|
|
1654
1693
|
"\u6295\u9012\u8BBE\u7F6E": "\u0414\u043E\u0441\u0442\u0430\u0432\u043A\u0430",
|
|
1655
1694
|
"\u8BBF\u95EE\u8BBE\u7F6E": "\u0414\u043E\u0441\u0442\u0443\u043F",
|
|
1695
|
+
"\u4E0D\u80FD\u6267\u884C\u547D\u4EE4": "\u041D\u0435\u043B\u044C\u0437\u044F \u0432\u044B\u043F\u043E\u043B\u043D\u044F\u0442\u044C \u043A\u043E\u043C\u0430\u043D\u0434\u044B",
|
|
1696
|
+
"\u53EF\u4EE5\u6267\u884C\u6307\u5B9A\u7684\u547D\u4EE4": "\u041C\u043E\u0436\u043D\u043E \u0432\u044B\u043F\u043E\u043B\u043D\u044F\u0442\u044C \u0443\u043A\u0430\u0437\u0430\u043D\u043D\u044B\u0435 \u043A\u043E\u043C\u0430\u043D\u0434\u044B",
|
|
1697
|
+
"\u9009\u62E9\u547D\u4EE4\uFF08{count}\uFF09": "\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u043A\u043E\u043C\u0430\u043D\u0434\u044B ({count})",
|
|
1698
|
+
"\u9009\u62E9\u5141\u8BB8\u7684\u547D\u4EE4": "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0451\u043D\u043D\u044B\u0435 \u043A\u043E\u043C\u0430\u043D\u0434\u044B",
|
|
1699
|
+
"\u9ED8\u8BA4\u52FE\u9009 new\u3001stop\u3001help\u3001status\u3001compact\u3001clear\u3002": "\u041F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E \u0432\u044B\u0431\u0440\u0430\u043D\u044B new, stop, help, status, compact, clear.",
|
|
1700
|
+
"\u641C\u7D22\u547D\u4EE4\u2026": "\u041F\u043E\u0438\u0441\u043A \u043A\u043E\u043C\u0430\u043D\u0434\u2026",
|
|
1701
|
+
"\u641C\u7D22\u547D\u4EE4": "\u041F\u043E\u0438\u0441\u043A \u043A\u043E\u043C\u0430\u043D\u0434",
|
|
1702
|
+
"\u5DF2\u9009 {count} \u9879": "\u0412\u044B\u0431\u0440\u0430\u043D\u043E: {count}",
|
|
1703
|
+
"\u6062\u590D\u9ED8\u8BA4": "\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u043F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E",
|
|
1704
|
+
"\u5168\u90E8\u547D\u4EE4": "\u0412\u0441\u0435 \u043A\u043E\u043C\u0430\u043D\u0434\u044B",
|
|
1705
|
+
"\u5B8C\u6210": "\u0413\u043E\u0442\u043E\u0432\u043E",
|
|
1706
|
+
"/new \u65B0\u4F1A\u8BDD": "/new \u041D\u043E\u0432\u044B\u0439 \u0441\u0435\u0430\u043D\u0441",
|
|
1707
|
+
"/stop \u505C\u6B62\u4EFB\u52A1": "/stop \u041E\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0437\u0430\u0434\u0430\u0447\u0443",
|
|
1708
|
+
"/help \u5E2E\u52A9": "/help \u0421\u043F\u0440\u0430\u0432\u043A\u0430",
|
|
1709
|
+
"/status \u8FDE\u63A5\u72B6\u6001": "/status \u0421\u043E\u0441\u0442\u043E\u044F\u043D\u0438\u0435 \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u044F",
|
|
1710
|
+
"/compact \u538B\u7F29\u4E0A\u4E0B\u6587": "/compact \u0421\u0436\u0430\u0442\u044C \u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442",
|
|
1711
|
+
"/clear \u6E05\u7A7A\u4E0A\u4E0B\u6587": "/clear \u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C \u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442",
|
|
1712
|
+
"/m \u6216 /menu \u83DC\u5355": "/m \u0438\u043B\u0438 /menu \u041C\u0435\u043D\u044E",
|
|
1713
|
+
"/version \u7248\u672C": "/version \u0412\u0435\u0440\u0441\u0438\u044F",
|
|
1714
|
+
"/models \u6A21\u578B\u5217\u8868": "/models \u0421\u043F\u0438\u0441\u043E\u043A \u043C\u043E\u0434\u0435\u043B\u0435\u0439",
|
|
1715
|
+
"/model \u6A21\u578B\u5207\u6362": "/model \u0421\u043C\u0435\u043D\u0438\u0442\u044C \u043C\u043E\u0434\u0435\u043B\u044C",
|
|
1716
|
+
"/reasonings \u63A8\u7406\u7B49\u7EA7": "/reasonings \u0423\u0440\u043E\u0432\u043D\u0438 \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0435\u043D\u0438\u044F",
|
|
1717
|
+
"/reasoning \u63A8\u7406\u7B49\u7EA7\u5207\u6362": "/reasoning \u0421\u043C\u0435\u043D\u0438\u0442\u044C \u0443\u0440\u043E\u0432\u0435\u043D\u044C \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0435\u043D\u0438\u044F",
|
|
1718
|
+
"/presets \u9884\u8BBE\u5217\u8868": "/presets \u0421\u043F\u0438\u0441\u043E\u043A \u043F\u0440\u0435\u0441\u0435\u0442\u043E\u0432",
|
|
1719
|
+
"/preset \u9884\u8BBE\u5207\u6362": "/preset \u0421\u043C\u0435\u043D\u0438\u0442\u044C \u043F\u0440\u0435\u0441\u0435\u0442",
|
|
1720
|
+
"/permissionlist \u6743\u9650\u5217\u8868": "/permissionlist \u0421\u043F\u0438\u0441\u043E\u043A \u043F\u0440\u0430\u0432",
|
|
1721
|
+
"/permission \u6743\u9650\u5207\u6362": "/permission \u0421\u043C\u0435\u043D\u0438\u0442\u044C \u043F\u0440\u0430\u0432\u0430",
|
|
1722
|
+
"/history \u5386\u53F2\u6D88\u606F": "/history \u0418\u0441\u0442\u043E\u0440\u0438\u044F \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0439",
|
|
1723
|
+
"/workspace \u5DE5\u4F5C\u533A": "/workspace \u0420\u0430\u0431\u043E\u0447\u0430\u044F \u043E\u0431\u043B\u0430\u0441\u0442\u044C",
|
|
1724
|
+
"/workspaces \u5DE5\u4F5C\u533A\u5217\u8868": "/workspaces \u0421\u043F\u0438\u0441\u043E\u043A \u0440\u0430\u0431\u043E\u0447\u0438\u0445 \u043E\u0431\u043B\u0430\u0441\u0442\u0435\u0439",
|
|
1725
|
+
"/sessionlist \u4F1A\u8BDD\u5217\u8868": "/sessionlist \u0421\u043F\u0438\u0441\u043E\u043A \u0441\u0435\u0430\u043D\u0441\u043E\u0432",
|
|
1726
|
+
"/session \u7ED1\u5B9A\u4F1A\u8BDD": "/session \u041F\u0440\u0438\u0432\u044F\u0437\u0430\u0442\u044C \u0441\u0435\u0430\u043D\u0441",
|
|
1727
|
+
"/batch \u6279\u91CF\u8F93\u5165": "/batch \u041F\u0430\u043A\u0435\u0442\u043D\u044B\u0439 \u0432\u0432\u043E\u0434",
|
|
1728
|
+
"/send \u53D1\u9001\u6279\u91CF": "/send \u041E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C \u043F\u0430\u043A\u0435\u0442",
|
|
1729
|
+
"/cancel \u53D6\u6D88\u6279\u91CF": "/cancel \u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C \u043F\u0430\u043A\u0435\u0442",
|
|
1730
|
+
"/steer \u8865\u5145\u6307\u4EE4": "/steer \u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0438\u043D\u0441\u0442\u0440\u0443\u043A\u0446\u0438\u044E",
|
|
1731
|
+
"/repair \u4FEE\u590D": "/repair \u0418\u0441\u043F\u0440\u0430\u0432\u0438\u0442\u044C",
|
|
1656
1732
|
"\u67E5\u770B\u8BBF\u95EE\u6743\u9650\u8BF4\u660E": "\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u043E\u043F\u0438\u0441\u0430\u043D\u0438\u0435 \u043F\u0440\u0430\u0432 \u0434\u043E\u0441\u0442\u0443\u043F\u0430",
|
|
1657
1733
|
"\u5141\u8BB8\u6240\u6709\u7528\u6237": "\u0412\u0441\u0435 \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u0438",
|
|
1658
1734
|
"\u4EC5\u767D\u540D\u5355\u7528\u6237": "\u0422\u043E\u043B\u044C\u043A\u043E \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u0438 \u0438\u0437 \u0441\u043F\u0438\u0441\u043A\u0430",
|
|
@@ -2583,6 +2659,15 @@ var CLIENT = Object.freeze({
|
|
|
2583
2659
|
"\u5C06\u65B0\u6D88\u606F\u8865\u5145\u5230\u5F53\u524D\u4EFB\u52A1": "\u0414\u043E\u0431\u0430\u0432\u043B\u044F\u0442\u044C \u043D\u043E\u0432\u044B\u0435 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F \u0432 \u0442\u0435\u043A\u0443\u0449\u0443\u044E \u0437\u0430\u0434\u0430\u0447\u0443",
|
|
2584
2660
|
"\u65E0\u6CD5\u8BFB\u53D6\u6D88\u606F\u5904\u7406\u8BBE\u7F6E\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002": "\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u043F\u0440\u043E\u0447\u0438\u0442\u0430\u0442\u044C \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0443 \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0438 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0439. \u041F\u043E\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u043F\u043E\u0437\u0436\u0435.",
|
|
2585
2661
|
"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u6D88\u606F\u5904\u7406\u65B9\u5F0F\u3002": "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043A\u043E\u0440\u0440\u0435\u043A\u0442\u043D\u044B\u0439 \u0441\u043F\u043E\u0441\u043E\u0431 \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0438 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0439.",
|
|
2662
|
+
"\u6295\u9012\u5185\u5BB9": "\u0421\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u0435 \u043E\u0442\u0432\u0435\u0442\u0430",
|
|
2663
|
+
"\u8FC7\u7A0B\u6B63\u6587": "\u0422\u0435\u043A\u0441\u0442 \u043F\u0440\u043E\u0446\u0435\u0441\u0441\u0430",
|
|
2664
|
+
"\u5DE5\u5177\u6B65\u9AA4": "\u0428\u0430\u0433\u0438 \u0438\u043D\u0441\u0442\u0440\u0443\u043C\u0435\u043D\u0442\u043E\u0432",
|
|
2665
|
+
"\u601D\u8003\u8FC7\u7A0B": "\u0420\u0430\u0441\u0441\u0443\u0436\u0434\u0435\u043D\u0438\u044F",
|
|
2666
|
+
"\u6700\u7EC8\u56DE\u7B54\u59CB\u7EC8\u53D1\u9001\uFF1B\u5173\u95ED\u7684\u9879\u4E0D\u518D\u63A8\u9001\u3002": "\u0418\u0442\u043E\u0433\u043E\u0432\u044B\u0439 \u043E\u0442\u0432\u0435\u0442 \u043E\u0442\u043F\u0440\u0430\u0432\u043B\u044F\u0435\u0442\u0441\u044F \u0432\u0441\u0435\u0433\u0434\u0430; \u0432\u044B\u043A\u043B\u044E\u0447\u0435\u043D\u043D\u044B\u0435 \u0447\u0430\u0441\u0442\u0438 \u043D\u0435 \u043E\u0442\u043F\u0440\u0430\u0432\u043B\u044F\u044E\u0442\u0441\u044F.",
|
|
2667
|
+
"\u6B63\u5728\u6267\u884C\u65F6\u52A9\u624B\u7684\u8BF4\u660E\u6587\u5B57": "\u041F\u043E\u044F\u0441\u043D\u0435\u043D\u0438\u044F \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043D\u0442\u0430 \u0432\u043E \u0432\u0440\u0435\u043C\u044F \u0440\u0430\u0431\u043E\u0442\u044B",
|
|
2668
|
+
"\u5DE5\u5177\u8C03\u7528\u3001\u7ED3\u679C\u4E0E\u5931\u8D25\u63D0\u793A": "\u0412\u044B\u0437\u043E\u0432\u044B \u0438\u043D\u0441\u0442\u0440\u0443\u043C\u0435\u043D\u0442\u043E\u0432, \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B \u0438 \u043E\u0448\u0438\u0431\u043A\u0438",
|
|
2669
|
+
"\u6A21\u578B\u7684\u63A8\u7406\u8FC7\u7A0B\uFF08\u6E20\u9053\u652F\u6301\u65F6\uFF09": "\u0420\u0430\u0441\u0441\u0443\u0436\u0434\u0435\u043D\u0438\u044F \u043C\u043E\u0434\u0435\u043B\u0438, \u0435\u0441\u043B\u0438 \u043A\u0430\u043D\u0430\u043B \u0438\u0445 \u043F\u043E\u043A\u0430\u0437\u044B\u0432\u0430\u0435\u0442",
|
|
2670
|
+
"\u8BF7\u9009\u62E9\u8981\u6295\u9012\u7684\u56DE\u590D\u5185\u5BB9\u3002": "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435, \u043A\u0430\u043A\u0438\u0435 \u0447\u0430\u0441\u0442\u0438 \u043E\u0442\u0432\u0435\u0442\u0430 \u0434\u043E\u0441\u0442\u0430\u0432\u043B\u044F\u0442\u044C.",
|
|
2586
2671
|
"\u901A\u7528\u8BBE\u7F6E": "\u041E\u0431\u0449\u0438\u0435 \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438",
|
|
2587
2672
|
"\u901A\u7528\u8BBE\u7F6E\u5206\u7C7B": "\u0420\u0430\u0437\u0434\u0435\u043B\u044B \u043E\u0431\u0449\u0438\u0445 \u043D\u0430\u0441\u0442\u0440\u043E\u0435\u043A",
|
|
2588
2673
|
"\u9644\u4EF6": "\u0412\u043B\u043E\u0436\u0435\u043D\u0438\u044F",
|
|
@@ -2727,6 +2812,7 @@ var CLIENT = Object.freeze({
|
|
|
2727
2812
|
"dsh-im 4.25.0 \u652F\u6301\u5230 DSH v0.1.6-alpha.2\u3002": "dsh-im 4.25.0 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 DSH \u0434\u043E v0.1.6-alpha.2.",
|
|
2728
2813
|
"dsh-im 4.39.0 \u4EC5\u652F\u6301 DSH 0.2.0-rc.2\u3002": "dsh-im 4.39.0 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0442\u043E\u043B\u044C\u043A\u043E DSH 0.2.0-rc.2.",
|
|
2729
2814
|
"dsh-im 5.0.0 \u4EC5\u652F\u6301 DSH 0.2.1-rc.2\u3002": "dsh-im 5.0.0 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0442\u043E\u043B\u044C\u043A\u043E DSH 0.2.1-rc.2.",
|
|
2815
|
+
"dsh-im 5.10.0 \u8D77\u652F\u6301 DSH 0.2.2-rc.5\u3002": "dsh-im 5.10.0 \u0438 \u043D\u043E\u0432\u0435\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044E\u0442 DSH 0.2.2-rc.5.",
|
|
2730
2816
|
"\u91CD\u65B0\u68C0\u67E5": "\u041F\u0440\u043E\u0432\u0435\u0440\u0438\u0442\u044C \u0441\u043D\u043E\u0432\u0430",
|
|
2731
2817
|
"\u5237\u65B0\u72B6\u6001": "\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u0441\u043E\u0441\u0442\u043E\u044F\u043D\u0438\u0435",
|
|
2732
2818
|
"\u624B\u5DE5\u66F4\u65B0": "\u0420\u0443\u0447\u043D\u043E\u0435 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435",
|
|
@@ -2926,7 +3012,14 @@ var COMPOSED2 = Object.freeze({
|
|
|
2926
3012
|
"\u64CD\u4F5C\u5931\u8D25\uFF1A{error}": "Operation failed: {error}",
|
|
2927
3013
|
"\u72B6\u6001\u5237\u65B0\u5931\u8D25\uFF1A{error}": "Status refresh failed: {error}",
|
|
2928
3014
|
"\u72B6\u6001\u81EA\u52A8\u5237\u65B0\u5931\u8D25\uFF1A{error}": "Automatic status refresh failed: {error}",
|
|
2929
|
-
"\u8BF7\u8F93\u5165 -1\u30010 \u6216 1~{max} \u4E4B\u95F4\u7684\u6574\u6570\u3002": "Enter -1, 0, or an integer from 1 to {max}."
|
|
3015
|
+
"\u8BF7\u8F93\u5165 -1\u30010 \u6216 1~{max} \u4E4B\u95F4\u7684\u6574\u6570\u3002": "Enter -1, 0, or an integer from 1 to {max}.",
|
|
3016
|
+
"\u67E5\u770B\u4F1A\u8BDD {sessionId}": "View session {sessionId}",
|
|
3017
|
+
"\u590D\u5236\u4F1A\u8BDD ID {sessionId}": "Copy session ID {sessionId}",
|
|
3018
|
+
"{count} \u4E2A\u4F1A\u8BDD": "{count} sessions",
|
|
3019
|
+
"\u4E8B\u4EF6 {seq}": "Event {seq}",
|
|
3020
|
+
"\u8BFB\u53D6\u5931\u8D25\uFF1A{error}": "Could not read the session: {error}",
|
|
3021
|
+
"\u5DF2\u663E\u793A {shown} / {total} \u6761\u6B63\u6587": "Showing {shown} / {total} messages",
|
|
3022
|
+
"\u52A0\u8F7D\u5931\u8D25\uFF1A{error}": "Could not load channel sessions: {error}"
|
|
2930
3023
|
});
|
|
2931
3024
|
var EN = Object.freeze({
|
|
2932
3025
|
...COMPOSED2,
|
|
@@ -3076,6 +3169,43 @@ var EN = Object.freeze({
|
|
|
3076
3169
|
"\u65E0\u6CD5\u89E3\u6790\u8BE5\u7FA4\u804A\uFF0C\u8BF7\u91CD\u8BD5\u6216\u586B\u5199\u6570\u5B57\u7FA4 ID\u3002": "Could not resolve this group. Try again or enter the numeric group ID.",
|
|
3077
3170
|
"\u8BE5\u7FA4\u5DF2\u5728\u5217\u8868\u4E2D\uFF0C\u8BF7\u7F16\u8F91\u4E0A\u65B9\u7684\u5361\u7247\u3002": "This group is already in the list. Edit its card above instead.",
|
|
3078
3171
|
"\u8BBF\u95EE\u8BBE\u7F6E": "Access settings",
|
|
3172
|
+
"\u4E0D\u80FD\u6267\u884C\u547D\u4EE4": "Cannot run commands",
|
|
3173
|
+
"\u53EF\u4EE5\u6267\u884C\u6307\u5B9A\u7684\u547D\u4EE4": "Can run specified commands",
|
|
3174
|
+
"\u9009\u62E9\u547D\u4EE4\uFF08{count}\uFF09": "Choose commands ({count})",
|
|
3175
|
+
"\u9009\u62E9\u5141\u8BB8\u7684\u547D\u4EE4": "Choose allowed commands",
|
|
3176
|
+
"\u9ED8\u8BA4\u52FE\u9009 new\u3001stop\u3001help\u3001status\u3001compact\u3001clear\u3002": "By default, new, stop, help, status, compact, and clear are selected.",
|
|
3177
|
+
"\u641C\u7D22\u547D\u4EE4\u2026": "Search commands\u2026",
|
|
3178
|
+
"\u641C\u7D22\u547D\u4EE4": "Search commands",
|
|
3179
|
+
"\u5DF2\u9009 {count} \u9879": "{count} selected",
|
|
3180
|
+
"\u6062\u590D\u9ED8\u8BA4": "Restore defaults",
|
|
3181
|
+
"\u5168\u90E8\u547D\u4EE4": "All commands",
|
|
3182
|
+
"\u5B8C\u6210": "Done",
|
|
3183
|
+
"/new \u65B0\u4F1A\u8BDD": "/new New session",
|
|
3184
|
+
"/stop \u505C\u6B62\u4EFB\u52A1": "/stop Stop task",
|
|
3185
|
+
"/help \u5E2E\u52A9": "/help Help",
|
|
3186
|
+
"/status \u8FDE\u63A5\u72B6\u6001": "/status Connection status",
|
|
3187
|
+
"/compact \u538B\u7F29\u4E0A\u4E0B\u6587": "/compact Compact context",
|
|
3188
|
+
"/clear \u6E05\u7A7A\u4E0A\u4E0B\u6587": "/clear Clear context",
|
|
3189
|
+
"/m \u6216 /menu \u83DC\u5355": "/m or /menu Menu",
|
|
3190
|
+
"/version \u7248\u672C": "/version Version",
|
|
3191
|
+
"/models \u6A21\u578B\u5217\u8868": "/models Model list",
|
|
3192
|
+
"/model \u6A21\u578B\u5207\u6362": "/model Switch model",
|
|
3193
|
+
"/reasonings \u63A8\u7406\u7B49\u7EA7": "/reasonings Reasoning levels",
|
|
3194
|
+
"/reasoning \u63A8\u7406\u7B49\u7EA7\u5207\u6362": "/reasoning Switch reasoning level",
|
|
3195
|
+
"/presets \u9884\u8BBE\u5217\u8868": "/presets Preset list",
|
|
3196
|
+
"/preset \u9884\u8BBE\u5207\u6362": "/preset Switch preset",
|
|
3197
|
+
"/permissionlist \u6743\u9650\u5217\u8868": "/permissionlist Permission list",
|
|
3198
|
+
"/permission \u6743\u9650\u5207\u6362": "/permission Switch permission",
|
|
3199
|
+
"/history \u5386\u53F2\u6D88\u606F": "/history Message history",
|
|
3200
|
+
"/workspace \u5DE5\u4F5C\u533A": "/workspace Workspace",
|
|
3201
|
+
"/workspaces \u5DE5\u4F5C\u533A\u5217\u8868": "/workspaces Workspace list",
|
|
3202
|
+
"/sessionlist \u4F1A\u8BDD\u5217\u8868": "/sessionlist Session list",
|
|
3203
|
+
"/session \u7ED1\u5B9A\u4F1A\u8BDD": "/session Bind session",
|
|
3204
|
+
"/batch \u6279\u91CF\u8F93\u5165": "/batch Batch input",
|
|
3205
|
+
"/send \u53D1\u9001\u6279\u91CF": "/send Send batch",
|
|
3206
|
+
"/cancel \u53D6\u6D88\u6279\u91CF": "/cancel Cancel batch",
|
|
3207
|
+
"/steer \u8865\u5145\u6307\u4EE4": "/steer Add instruction",
|
|
3208
|
+
"/repair \u4FEE\u590D": "/repair Repair",
|
|
3079
3209
|
"\u67E5\u770B\u8BBF\u95EE\u6743\u9650\u8BF4\u660E": "View access permission details",
|
|
3080
3210
|
"\u5141\u8BB8\u6240\u6709\u7528\u6237": "Allow all users",
|
|
3081
3211
|
"\u4EC5\u767D\u540D\u5355\u7528\u6237": "Allowlisted users only",
|
|
@@ -3142,6 +3272,7 @@ var EN = Object.freeze({
|
|
|
3142
3272
|
"dsh-im 4.25.0 \u652F\u6301\u5230 DSH v0.1.6-alpha.2\u3002": "dsh-im 4.25.0 supports DSH up to v0.1.6-alpha.2.",
|
|
3143
3273
|
"dsh-im 4.39.0 \u4EC5\u652F\u6301 DSH 0.2.0-rc.2\u3002": "dsh-im 4.39.0 only supports DSH 0.2.0-rc.2.",
|
|
3144
3274
|
"dsh-im 5.0.0 \u4EC5\u652F\u6301 DSH 0.2.1-rc.2\u3002": "dsh-im 5.0.0 only supports DSH 0.2.1-rc.2.",
|
|
3275
|
+
"dsh-im 5.10.0 \u8D77\u652F\u6301 DSH 0.2.2-rc.5\u3002": "dsh-im 5.10.0 and later support DSH 0.2.2-rc.5.",
|
|
3145
3276
|
"\u91CD\u65B0\u68C0\u67E5": "Check again",
|
|
3146
3277
|
"\u5237\u65B0\u72B6\u6001": "Refresh status",
|
|
3147
3278
|
"\u624B\u5DE5\u66F4\u65B0": "Manual update",
|
|
@@ -4047,6 +4178,15 @@ var EN = Object.freeze({
|
|
|
4047
4178
|
"\u5C06\u65B0\u6D88\u606F\u8865\u5145\u5230\u5F53\u524D\u4EFB\u52A1": "Add new messages to the current task",
|
|
4048
4179
|
"\u65E0\u6CD5\u8BFB\u53D6\u6D88\u606F\u5904\u7406\u8BBE\u7F6E\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002": "Could not read message handling settings. Try again later.",
|
|
4049
4180
|
"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u6D88\u606F\u5904\u7406\u65B9\u5F0F\u3002": "Choose a valid message handling mode.",
|
|
4181
|
+
"\u6295\u9012\u5185\u5BB9": "Reply content",
|
|
4182
|
+
"\u8FC7\u7A0B\u6B63\u6587": "Process prose",
|
|
4183
|
+
"\u5DE5\u5177\u6B65\u9AA4": "Tool steps",
|
|
4184
|
+
"\u601D\u8003\u8FC7\u7A0B": "Reasoning",
|
|
4185
|
+
"\u6700\u7EC8\u56DE\u7B54\u59CB\u7EC8\u53D1\u9001\uFF1B\u5173\u95ED\u7684\u9879\u4E0D\u518D\u63A8\u9001\u3002": "The final answer is always sent; switched-off parts are not pushed.",
|
|
4186
|
+
"\u6B63\u5728\u6267\u884C\u65F6\u52A9\u624B\u7684\u8BF4\u660E\u6587\u5B57": "What the assistant writes while working",
|
|
4187
|
+
"\u5DE5\u5177\u8C03\u7528\u3001\u7ED3\u679C\u4E0E\u5931\u8D25\u63D0\u793A": "Tool calls, results and failures",
|
|
4188
|
+
"\u6A21\u578B\u7684\u63A8\u7406\u8FC7\u7A0B\uFF08\u6E20\u9053\u652F\u6301\u65F6\uFF09": "The model's reasoning, where the channel shows it",
|
|
4189
|
+
"\u8BF7\u9009\u62E9\u8981\u6295\u9012\u7684\u56DE\u590D\u5185\u5BB9\u3002": "Choose which parts of the reply to deliver.",
|
|
4050
4190
|
"\u901A\u7528\u8BBE\u7F6E": "General settings",
|
|
4051
4191
|
"\u901A\u7528\u8BBE\u7F6E\u5206\u7C7B": "General settings categories",
|
|
4052
4192
|
"\u9644\u4EF6": "Attachments",
|
|
@@ -4203,6 +4343,34 @@ var EN = Object.freeze({
|
|
|
4203
4343
|
"\u8BED\u8A00\u8BBE\u7F6E\u6682\u4E0D\u53EF\u7528\u3002": "The language setting is unavailable.",
|
|
4204
4344
|
"\u5728 Web GUI \u4E2D\u53D1\u9001\u7684\u6D88\u606F\u4F1A\u4F5C\u4E3A\u4E00\u6761\u5E26\u524D\u7F00\u7684\u6D88\u606F\u8F6C\u53D1\u5230\u672C\u804A\u5929\u7684\u4F1A\u8BDD\u540C\u6B65\u76EE\u6807\u3002": "A message sent in the Web GUI is forwarded to the Session sync target of this chat, prefixed with the icon.",
|
|
4205
4345
|
"\u5176\u4ED6\u56DE\u5408\uFF08Web \u8F93\u5165\u3001\u5B9A\u65F6\u63D0\u9192\u3001\u5B50\u4EE3\u7406\u901A\u77E5\u7B49\uFF09\u7684\u6A21\u578B\u56DE\u7B54\u4F1A\u53D1\u9001\u5230\u4F1A\u8BDD\u540C\u6B65\u76EE\u6807\u3002": "Model answers of other turns (Web input, schedule reminders, subagent notices and so on) are sent to the Session sync target.",
|
|
4346
|
+
"\u5FAE\u4FE1\u5BA2\u670D": "WeCom Customer Service",
|
|
4347
|
+
"\u6D4F\u89C8\u5668\u672A\u5141\u8BB8\u8BBF\u95EE\u526A\u8D34\u677F": "The browser did not allow clipboard access",
|
|
4348
|
+
"\u5BBF\u4E3B\u54CD\u5E94\u7F3A\u5C11 value.channels\uFF0C\u8BF7\u68C0\u67E5 dsh-im host \u662F\u5426\u5DF2\u91CD\u8F7D": "The Host response is missing value.channels. Reload the dsh-im Host and try again.",
|
|
4349
|
+
"\u5BBF\u4E3B\u54CD\u5E94\u7F3A\u5C11 value.messages\uFF0C\u8BF7\u68C0\u67E5 dsh-im host \u662F\u5426\u5DF2\u91CD\u8F7D": "The Host response is missing value.messages. Reload the dsh-im Host and try again.",
|
|
4350
|
+
"\u5BBF\u4E3B\u54CD\u5E94\u7F3A\u5C11 value.messages": "The Host response is missing value.messages",
|
|
4351
|
+
"\u67E5\u770B\u8BE5\u4F1A\u8BDD\u7684\u7528\u6237\u4E0E\u52A9\u624B\u6B63\u6587": "View the user and assistant messages in this session",
|
|
4352
|
+
"\u590D\u5236\u5931\u8D25": "Copy failed",
|
|
4353
|
+
"\u590D\u5236 ID": "Copy ID",
|
|
4354
|
+
"\u901A\u9053 / \u4F1A\u8BDD\u952E": "Channel / conversation key",
|
|
4355
|
+
"DSH \u4F1A\u8BDD ID": "DSH session ID",
|
|
4356
|
+
"\u64CD\u4F5C": "Actions",
|
|
4357
|
+
"\u52A9\u624B": "Assistant",
|
|
4358
|
+
"\u672C\u6761\u6D88\u606F\u8FC7\u957F\uFF0C\u5DF2\u622A\u65AD\u3002": "This message was too long and has been truncated.",
|
|
4359
|
+
"\u4F1A\u8BDD\u5185\u5BB9": "Session content",
|
|
4360
|
+
"\u53EA\u8BFB\u663E\u793A\u7528\u6237\u4E0E\u52A9\u624B\u6B63\u6587\uFF1B\u7CFB\u7EDF\u63D0\u793A\u3001\u5DE5\u5177\u8C03\u7528\u548C\u5185\u90E8\u63A8\u7406\u4E0D\u663E\u793A\u3002": "Read-only user and assistant messages. System prompts, tool calls, and internal reasoning are hidden.",
|
|
4361
|
+
"\u8FD4\u56DE\u5217\u8868": "Back to list",
|
|
4362
|
+
"\u52A0\u8F7D\u66F4\u65E9\u6D88\u606F": "Load earlier messages",
|
|
4363
|
+
"\u52A0\u8F7D\u4E2D\u2026": "Loading\u2026",
|
|
4364
|
+
"\u6CA1\u6709\u53EF\u663E\u793A\u7684\u7528\u6237\u6216\u52A9\u624B\u6B63\u6587\u3002": "No user or assistant messages to display.",
|
|
4365
|
+
"\u4F1A\u8BDD\u8BB0\u5F55": "Session history",
|
|
4366
|
+
"\u8FD4\u56DE IM\u673A\u5668\u4EBA": "Back to IM bots",
|
|
4367
|
+
"\u53EA\u8BFB\u5217\u51FA\u5404 IM \u901A\u9053\u5F53\u524D\u7ED1\u5B9A\u7684 DSH \u4F1A\u8BDD\uFF1B\u70B9\u51FB\u4F1A\u8BDD ID \u67E5\u770B\u6B63\u6587\uFF0C\u4E0D\u4F1A\u4FEE\u6539\u7ED1\u5B9A\u3002": "Read-only list of DSH sessions bound to each IM channel. Select a session ID to view its messages; bindings are not changed.",
|
|
4368
|
+
"\u6B63\u5728\u8BFB\u53D6\u901A\u9053\u4F1A\u8BDD\u2026": "Loading channel sessions\u2026",
|
|
4369
|
+
"\u5C1A\u672A\u53D1\u73B0\u5DF2\u7ED1\u5B9A DSH \u4F1A\u8BDD\u7684\u901A\u9053\u3002": "No channels with bound DSH sessions were found.",
|
|
4370
|
+
"limit \u6216 offset \u53C2\u6570\u65E0\u6548": "The limit or offset parameter is invalid",
|
|
4371
|
+
"\u8BE5\u4F1A\u8BDD\u4E0D\u5C5E\u4E8E\u6307\u5B9A\u901A\u9053\u7ED1\u5B9A\uFF0C\u53EF\u80FD\u5DF2\u89E3\u7ED1": "The session is not bound to the specified channel, or the binding was removed",
|
|
4372
|
+
"\u5BBF\u4E3B sessionQuery \u670D\u52A1\u5C1A\u672A\u5C31\u7EEA": "The Host sessionQuery service is not ready",
|
|
4373
|
+
"\u8BE5\u4F1A\u8BDD\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002": "The session cannot be read right now. Try again later.",
|
|
4206
4374
|
"\u8BF7\u6C42\u5931\u8D25": "The request failed"
|
|
4207
4375
|
});
|
|
4208
4376
|
var en = EN;
|
|
@@ -4330,16 +4498,16 @@ var DYNAMIC_PHRASES = Object.freeze([
|
|
|
4330
4498
|
["\u8FDE\u63A5\u72B6\u6001", "connection status", "\u0441\u043E\u0441\u0442\u043E\u044F\u043D\u0438\u0435 \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u044F"],
|
|
4331
4499
|
["\u4E8C\u7EF4\u7801", "QR code", "QR-\u043A\u043E\u0434"]
|
|
4332
4500
|
]);
|
|
4333
|
-
function translateDynamic(
|
|
4334
|
-
if (locale === "zh") return
|
|
4501
|
+
function translateDynamic(text9, locale = imLocale()) {
|
|
4502
|
+
if (locale === "zh") return text9;
|
|
4335
4503
|
const column = locale === "ru" ? "ru" : "en";
|
|
4336
4504
|
for (const rule of DYNAMIC_RULES) {
|
|
4337
|
-
const match = rule.pattern.exec(
|
|
4505
|
+
const match = rule.pattern.exec(text9);
|
|
4338
4506
|
if (!match) continue;
|
|
4339
4507
|
return (rule[column] ?? rule.en)(match);
|
|
4340
4508
|
}
|
|
4341
4509
|
const at = column === "ru" ? 2 : 1;
|
|
4342
|
-
let output =
|
|
4510
|
+
let output = text9;
|
|
4343
4511
|
for (const row of DYNAMIC_PHRASES) output = output.replaceAll(row[0], row[at]);
|
|
4344
4512
|
return output;
|
|
4345
4513
|
}
|
|
@@ -4591,13 +4759,13 @@ var DIAGNOSTIC_MESSAGE_EMAIL = /[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+/u;
|
|
|
4591
4759
|
var DIAGNOSTIC_MESSAGE_OPAQUE = /\b[A-Za-z0-9_\-+/=]{32,}\b/u;
|
|
4592
4760
|
function safeDiagnosticMessage(value) {
|
|
4593
4761
|
if (typeof value !== "string") return void 0;
|
|
4594
|
-
const
|
|
4595
|
-
if (!/^[\x20-\x7e]+$/u.test(
|
|
4596
|
-
if (!DIAGNOSTIC_MESSAGE_SHAPES.some((shape) => shape.test(
|
|
4597
|
-
if (DIAGNOSTIC_MESSAGE_DENY.test(
|
|
4598
|
-
if (DIAGNOSTIC_MESSAGE_URL.test(
|
|
4599
|
-
if (DIAGNOSTIC_MESSAGE_OPAQUE.test(
|
|
4600
|
-
return
|
|
4762
|
+
const text9 = value.replace(/[\u0000-\u001f\u007f]/gu, " ").replace(/\s+/gu, " ").trim();
|
|
4763
|
+
if (!/^[\x20-\x7e]+$/u.test(text9)) return void 0;
|
|
4764
|
+
if (!DIAGNOSTIC_MESSAGE_SHAPES.some((shape) => shape.test(text9))) return void 0;
|
|
4765
|
+
if (DIAGNOSTIC_MESSAGE_DENY.test(text9)) return void 0;
|
|
4766
|
+
if (DIAGNOSTIC_MESSAGE_URL.test(text9) || DIAGNOSTIC_MESSAGE_EMAIL.test(text9)) return void 0;
|
|
4767
|
+
if (DIAGNOSTIC_MESSAGE_OPAQUE.test(text9)) return void 0;
|
|
4768
|
+
return text9;
|
|
4601
4769
|
}
|
|
4602
4770
|
function normalizeDiagnosticDetails(value) {
|
|
4603
4771
|
if (!value || typeof value !== "object" || Array.isArray(value)) return {};
|
|
@@ -4638,7 +4806,7 @@ function normalizeDiagnosticDetails(value) {
|
|
|
4638
4806
|
if (typeof value.occurredAt === "string" && /^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d\.\d{3}Z$/.test(value.occurredAt) && Number.isFinite(Date.parse(value.occurredAt))) result2.occurredAt = value.occurredAt;
|
|
4639
4807
|
if (Number.isInteger(value.httpStatus) && value.httpStatus >= 100 && value.httpStatus <= 599) result2.httpStatus = value.httpStatus;
|
|
4640
4808
|
const provider = typeof value.providerCode === "number" && Number.isSafeInteger(value.providerCode) ? String(value.providerCode) : value.providerCode;
|
|
4641
|
-
if (typeof provider === "string" && /^-?\d{1,12}
|
|
4809
|
+
if (typeof provider === "string" && (/^-?\d{1,12}$/u.test(provider) || /^[A-Z][A-Z0-9_]{1,63}$/u.test(provider))) result2.providerCode = provider;
|
|
4642
4810
|
if (typeof value.pluginVersion === "string" && /^\d+\.\d+\.\d+(?:-[A-Za-z0-9.-]+)?$/.test(value.pluginVersion) && value.pluginVersion.length <= 64) result2.pluginVersion = value.pluginVersion;
|
|
4643
4811
|
if (["succeeded", "failed", "not-attempted", "unknown"].includes(value.rollback)) result2.rollback = value.rollback;
|
|
4644
4812
|
if (typeof value.causeMessage === "string") {
|
|
@@ -4768,7 +4936,7 @@ function ConnectionError({ error: value, warning = false, showMessage = true })
|
|
|
4768
4936
|
["\u53C2\u8003\u53F7", details.referenceId],
|
|
4769
4937
|
["\u53D1\u751F\u65F6\u95F4", details.occurredAt],
|
|
4770
4938
|
["\u63D2\u4EF6\u7248\u672C", details.pluginVersion]
|
|
4771
|
-
].filter(([,
|
|
4939
|
+
].filter(([, text9]) => text9 !== void 0 && text9 !== "");
|
|
4772
4940
|
return h2(
|
|
4773
4941
|
"div",
|
|
4774
4942
|
{ className: "dim-connectionDiagnostic", "data-connection-diagnostic": true, "data-weixin-diagnostic": details.channel === "weixin" || /^WX-CONN/.test(details.referenceId ?? "") || void 0, role: isWarning ? "status" : void 0, "data-warning": isWarning || void 0 },
|
|
@@ -4781,9 +4949,9 @@ function ConnectionError({ error: value, warning = false, showMessage = true })
|
|
|
4781
4949
|
h2(
|
|
4782
4950
|
"dl",
|
|
4783
4951
|
{ style: { display: "grid", gridTemplateColumns: "auto minmax(0, 1fr)", gap: "4px 12px", margin: "10px 0" } },
|
|
4784
|
-
...fields.flatMap(([label,
|
|
4952
|
+
...fields.flatMap(([label, text9]) => [
|
|
4785
4953
|
h2("dt", { key: `${label}-label` }, label),
|
|
4786
|
-
React3.createElement("dd", { key: label, style: { margin: 0, overflowWrap: "anywhere" } }, String(
|
|
4954
|
+
React3.createElement("dd", { key: label, style: { margin: 0, overflowWrap: "anywhere" } }, String(text9))
|
|
4787
4955
|
])
|
|
4788
4956
|
),
|
|
4789
4957
|
!details.referenceId ? h2("p", null, "\u672A\u53D6\u5F97 Host \u8BCA\u65AD\u53C2\u8003\u53F7\u3002") : null,
|
|
@@ -4809,15 +4977,15 @@ function ConnectionError({ error: value, warning = false, showMessage = true })
|
|
|
4809
4977
|
}
|
|
4810
4978
|
function normalizeConnectionError(value, fallbackCode = "operation-failed", fallbackMessage = "\u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u67E5\u770B\u539F\u56E0\u548C\u8BCA\u65AD\u8BE6\u60C5\u3002") {
|
|
4811
4979
|
const source = value && typeof value === "object" ? value : {};
|
|
4812
|
-
const
|
|
4980
|
+
const text9 = (v, fallback, n) => typeof v === "string" && v.trim() ? v.trim().slice(0, n) : fallback;
|
|
4813
4981
|
const details = normalizeDiagnosticDetails({
|
|
4814
4982
|
...source.details,
|
|
4815
4983
|
referenceId: source.details?.referenceId ?? source.referenceId,
|
|
4816
4984
|
hint: source.details?.hint ?? source.hint
|
|
4817
4985
|
});
|
|
4818
4986
|
return {
|
|
4819
|
-
code:
|
|
4820
|
-
message:
|
|
4987
|
+
code: text9(source.code, fallbackCode, 100),
|
|
4988
|
+
message: text9(source.message, fallbackMessage, 500),
|
|
4821
4989
|
...Object.keys(details).length ? { details } : {},
|
|
4822
4990
|
...source.hint ? { hint: details.hint } : {},
|
|
4823
4991
|
...source.referenceId ? { referenceId: details.referenceId } : {}
|
|
@@ -5321,9 +5489,12 @@ var ACCESS_POLICY_CONVERSATION_TYPES = Object.freeze(["direct", "group"]);
|
|
|
5321
5489
|
var ACCESS_POLICY_USER_ID_MAX_LENGTH = 256;
|
|
5322
5490
|
var POLICY_KEYS = ["direct", "group"];
|
|
5323
5491
|
var SCOPE_KEYS = ["mode", "open", "allowlist"];
|
|
5324
|
-
var OPEN_KEYS = ["defaultCanExecuteCommands", "commandPermissionOverrides"];
|
|
5492
|
+
var OPEN_KEYS = ["defaultCanExecuteCommands", "commandPermissionOverrides", "commandAllowlist"];
|
|
5493
|
+
var OPEN_REQUIRED_KEYS = ["defaultCanExecuteCommands", "commandPermissionOverrides"];
|
|
5325
5494
|
var ALLOWLIST_KEYS = ["users"];
|
|
5326
|
-
var USER_KEYS = ["id", "canExecuteCommands"];
|
|
5495
|
+
var USER_KEYS = ["id", "canExecuteCommands", "commandAllowlist"];
|
|
5496
|
+
var USER_REQUIRED_KEYS = ["id", "canExecuteCommands"];
|
|
5497
|
+
var COMMAND_ALLOWLIST_LIMIT = 100;
|
|
5327
5498
|
var CONTROL_CHARACTERS = /[\u0000-\u001f\u007f-\u009f\u202a-\u202e\u2066-\u2069]/;
|
|
5328
5499
|
function invalidAccessPolicy(message) {
|
|
5329
5500
|
const error = new TypeError(message);
|
|
@@ -5333,6 +5504,31 @@ function invalidAccessPolicy(message) {
|
|
|
5333
5504
|
function hasExactKeys(input, keys) {
|
|
5334
5505
|
return input && typeof input === "object" && !Array.isArray(input) && [Object.prototype, null].includes(Object.getPrototypeOf(input)) && Reflect.ownKeys(input).length === keys.length && keys.every((key) => Object.hasOwn(input, key));
|
|
5335
5506
|
}
|
|
5507
|
+
function hasAllowedKeys(input, required, optional = []) {
|
|
5508
|
+
if (!input || typeof input !== "object" || Array.isArray(input) || ![Object.prototype, null].includes(Object.getPrototypeOf(input))) return false;
|
|
5509
|
+
const keys = Reflect.ownKeys(input);
|
|
5510
|
+
return required.every((key) => Object.hasOwn(input, key)) && keys.every((key) => required.includes(key) || optional.includes(key));
|
|
5511
|
+
}
|
|
5512
|
+
function normalizeCommandName(value) {
|
|
5513
|
+
if (typeof value !== "string") return null;
|
|
5514
|
+
const first = value.trim().split(/\s+/u)[0];
|
|
5515
|
+
if (!first) return null;
|
|
5516
|
+
const name2 = (first.startsWith("/") ? first.slice(1) : first).toLowerCase();
|
|
5517
|
+
return /^[a-z0-9][a-z0-9:_-]{0,63}$/u.test(name2) ? name2 : null;
|
|
5518
|
+
}
|
|
5519
|
+
function validateCommandAllowlist(input, label) {
|
|
5520
|
+
if (input === void 0) return null;
|
|
5521
|
+
if (!Array.isArray(input)) throw invalidAccessPolicy(`${label}\u5FC5\u987B\u662F\u547D\u4EE4\u540D\u6570\u7EC4\u3002`);
|
|
5522
|
+
if (input.length > COMMAND_ALLOWLIST_LIMIT) {
|
|
5523
|
+
throw invalidAccessPolicy(`${label}\u6700\u591A\u5305\u542B ${COMMAND_ALLOWLIST_LIMIT} \u4E2A\u547D\u4EE4\u3002`);
|
|
5524
|
+
}
|
|
5525
|
+
const names = input.map((value) => {
|
|
5526
|
+
const name2 = normalizeCommandName(value);
|
|
5527
|
+
if (!name2) throw invalidAccessPolicy(`${label}\u5305\u542B\u65E0\u6548\u547D\u4EE4\u540D\u3002`);
|
|
5528
|
+
return name2;
|
|
5529
|
+
});
|
|
5530
|
+
return Object.freeze([...new Set(names)]);
|
|
5531
|
+
}
|
|
5336
5532
|
function normalizeAccessPolicyUserId(value) {
|
|
5337
5533
|
if (typeof value === "number") {
|
|
5338
5534
|
if (!Number.isFinite(value)) throw invalidAccessPolicy("\u7528\u6237\u6807\u8BC6\u65E0\u6548\u3002");
|
|
@@ -5348,15 +5544,17 @@ function normalizeAccessPolicyUserId(value) {
|
|
|
5348
5544
|
return id6;
|
|
5349
5545
|
}
|
|
5350
5546
|
function validateAccessPolicyUser(input) {
|
|
5351
|
-
if (!
|
|
5352
|
-
throw invalidAccessPolicy("\u7528\u6237\u6761\u76EE\u5FC5\u987B\u5305\u542B\u7528\u6237\u6807\u8BC6\
|
|
5547
|
+
if (!hasAllowedKeys(input, USER_REQUIRED_KEYS, USER_KEYS)) {
|
|
5548
|
+
throw invalidAccessPolicy("\u7528\u6237\u6761\u76EE\u5FC5\u987B\u5305\u542B\u7528\u6237\u6807\u8BC6\u3001\u547D\u4EE4\u6743\u9650\u548C\u53EF\u9009\u7684\u547D\u4EE4\u767D\u540D\u5355\u3002");
|
|
5353
5549
|
}
|
|
5354
5550
|
if (typeof input.canExecuteCommands !== "boolean") {
|
|
5355
5551
|
throw invalidAccessPolicy("\u547D\u4EE4\u6743\u9650\u5FC5\u987B\u662F\u5E03\u5C14\u503C\u3002");
|
|
5356
5552
|
}
|
|
5553
|
+
const commandAllowlist = validateCommandAllowlist(input.commandAllowlist, "\u7528\u6237\u547D\u4EE4\u767D\u540D\u5355");
|
|
5357
5554
|
return Object.freeze({
|
|
5358
5555
|
id: normalizeAccessPolicyUserId(input.id),
|
|
5359
|
-
canExecuteCommands: input.canExecuteCommands
|
|
5556
|
+
canExecuteCommands: input.canExecuteCommands,
|
|
5557
|
+
...commandAllowlist === null ? {} : { commandAllowlist }
|
|
5360
5558
|
});
|
|
5361
5559
|
}
|
|
5362
5560
|
function validateUsers(input, { listMessage, duplicateMessage }) {
|
|
@@ -5368,8 +5566,8 @@ function validateUsers(input, { listMessage, duplicateMessage }) {
|
|
|
5368
5566
|
return Object.freeze(users);
|
|
5369
5567
|
}
|
|
5370
5568
|
function validateOpenSettings(input) {
|
|
5371
|
-
if (!
|
|
5372
|
-
throw invalidAccessPolicy("\u5F00\u653E\u6A21\u5F0F\u8BBE\u7F6E\u5FC5\u987B\u5B8C\u6574\u3002");
|
|
5569
|
+
if (!hasAllowedKeys(input, OPEN_REQUIRED_KEYS, OPEN_KEYS)) {
|
|
5570
|
+
throw invalidAccessPolicy("\u5F00\u653E\u6A21\u5F0F\u8BBE\u7F6E\u5FC5\u987B\u5B8C\u6574\uFF08\u53EF\u9009\u7684 commandAllowlist \u9664\u5916\uFF09\u3002");
|
|
5373
5571
|
}
|
|
5374
5572
|
if (typeof input.defaultCanExecuteCommands !== "boolean") {
|
|
5375
5573
|
throw invalidAccessPolicy("\u5F00\u653E\u6A21\u5F0F\u9ED8\u8BA4\u547D\u4EE4\u6743\u9650\u5FC5\u987B\u662F\u5E03\u5C14\u503C\u3002");
|
|
@@ -5379,7 +5577,8 @@ function validateOpenSettings(input) {
|
|
|
5379
5577
|
commandPermissionOverrides: validateUsers(input.commandPermissionOverrides, {
|
|
5380
5578
|
listMessage: "\u5F00\u653E\u6A21\u5F0F\u547D\u4EE4\u6743\u9650\u8986\u76D6\u7528\u6237\u5FC5\u987B\u662F\u6570\u7EC4\u3002",
|
|
5381
5579
|
duplicateMessage: "\u5F00\u653E\u6A21\u5F0F\u547D\u4EE4\u6743\u9650\u8986\u76D6\u7528\u6237\u4E0D\u80FD\u5305\u542B\u91CD\u590D\u7684\u7528\u6237\u6807\u8BC6\u3002"
|
|
5382
|
-
})
|
|
5580
|
+
}),
|
|
5581
|
+
...input.commandAllowlist === void 0 ? {} : { commandAllowlist: validateCommandAllowlist(input.commandAllowlist, "\u5F00\u653E\u6A21\u5F0F\u547D\u4EE4\u767D\u540D\u5355") }
|
|
5383
5582
|
});
|
|
5384
5583
|
}
|
|
5385
5584
|
function validateAllowlistSettings(input) {
|
|
@@ -9339,6 +9538,8 @@ function normalizeFeishuVoiceConfig(value) {
|
|
|
9339
9538
|
var SLASH_COMMAND_MANIFEST = Object.freeze([
|
|
9340
9539
|
{ command: "menu", icon: "skill_outlined", default: "\u6253\u5F00\u529F\u80FD\u83DC\u5355", en_us: "Open the feature menu" },
|
|
9341
9540
|
{ command: "new", icon: "ai-deepthink_outlined", default: "\u5F00\u542F\u5168\u65B0\u4F1A\u8BDD", en_us: "Start a fresh session" },
|
|
9541
|
+
{ command: "fork", icon: "ai-deepthink_outlined", default: "\u4ECE\u5F53\u524D\u4F1A\u8BDD\u5206\u652F\u4E00\u4E2A\u65B0\u4F1A\u8BDD", en_us: "Branch a new session from the current one" },
|
|
9542
|
+
{ command: "reset", icon: "ai-deepthink_outlined", default: "\u91CD\u7F6E\u5F53\u524D\u4F1A\u8BDD\u4E0A\u4E0B\u6587\uFF08\u4FDD\u7559\u4F1A\u8BDD\u7F16\u53F7\uFF09", en_us: "Reset the current session context (keep the number)" },
|
|
9342
9543
|
{ command: "help", icon: "promptword_outlined", default: "\u67E5\u770B\u5E2E\u52A9", en_us: "Show help" },
|
|
9343
9544
|
{ command: "status", icon: "ai-functions_outlined", default: "\u67E5\u770B\u673A\u5668\u4EBA\u72B6\u6001", en_us: "Show bot status" },
|
|
9344
9545
|
{ command: "compact", icon: "ai-block_outlined", default: "\u538B\u7F29\u5F53\u524D\u4F1A\u8BDD\u4E0A\u4E0B\u6587", en_us: "Compact the current session" },
|
|
@@ -9353,6 +9554,14 @@ var SLASH_COMMAND_MANIFEST = Object.freeze([
|
|
|
9353
9554
|
{ command: "workspace", icon: "folder_outlined", default: "\u67E5\u770B\u5E76\u5207\u6362\u5DE5\u4F5C\u533A", en_us: "View and switch workspace" },
|
|
9354
9555
|
{ command: "conv", icon: "folder_outlined", default: "\u8BBE\u7F6E\u5F53\u524D\u5BF9\u8BDD\u4E13\u5C5E\u5DE5\u4F5C\u533A", en_us: "Set the workspace for this conversation" },
|
|
9355
9556
|
{ command: "session", icon: "chat-ai_outlined", default: "\u7ED1\u5B9A\u5DF2\u6709\u4F1A\u8BDD", en_us: "Bind an existing session" },
|
|
9557
|
+
{ command: "sessionarchive", icon: "folder_outlined", default: "\u5F52\u6863\u4E00\u4E2A\u4F1A\u8BDD", en_us: "Archive a session" },
|
|
9558
|
+
{ command: "ls", icon: "chat-ai_outlined", default: "\u5217\u51FA\u672C\u804A\u5929\u4F7F\u7528\u8FC7\u7684\u4F1A\u8BDD\uFF08\u6309\u804A\u5929/\u8BDD\u9898\u9694\u79BB\uFF09", en_us: "List this chat's sessions (per chat / per topic)" },
|
|
9559
|
+
{ command: "go", icon: "chat-ai_outlined", default: "\u5207\u6362\u5230\u6307\u5B9A\u7F16\u53F7\u7684\u4F1A\u8BDD", en_us: "Switch to a session by number" },
|
|
9560
|
+
{ command: "prev", icon: "chat-ai_outlined", default: "\u56DE\u5230\u4E0A\u4E00\u4E2A\u4F1A\u8BDD", en_us: "Go back to the previous session" },
|
|
9561
|
+
{ command: "next", icon: "chat-ai_outlined", default: "\u524D\u8FDB\u5230\u4E0B\u4E00\u4E2A\u4F1A\u8BDD", en_us: "Go forward to the next session" },
|
|
9562
|
+
{ command: "drop", icon: "chat-ai_outlined", default: "\u4ECE\u4F1A\u8BDD\u5217\u8868\u79FB\u9664\u4E00\u6761\u8BB0\u5F55", en_us: "Remove one entry from the session list" },
|
|
9563
|
+
{ command: "title", icon: "chat-ai_outlined", default: "\u67E5\u770B\u6216\u91CD\u547D\u540D\u4F1A\u8BDD\u6807\u9898", en_us: "Show or rename a session title" },
|
|
9564
|
+
{ command: "tail", icon: "chat-ai_outlined", default: "\u9884\u89C8\u6216\u5BFC\u51FA\u4F1A\u8BDD\u5185\u5BB9", en_us: "Preview or export session content" },
|
|
9356
9565
|
{ command: "models", icon: "ai-functions_outlined", default: "\u5217\u51FA\u53EF\u7528\u6A21\u578B", en_us: "List available models" },
|
|
9357
9566
|
{ command: "model", icon: "ai-agent_outlined", default: "\u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u6A21\u578B", en_us: "Show or switch the current model" },
|
|
9358
9567
|
{ command: "reasoninglist", icon: "ai-deepthink_outlined", default: "\u5217\u51FA\u53EF\u7528\u63A8\u7406\u7B49\u7EA7", en_us: "List available reasoning efforts" },
|
|
@@ -9378,7 +9587,7 @@ var DEFAULT_SLASH_PANEL_CONFIG = Object.freeze({
|
|
|
9378
9587
|
order: Object.freeze([])
|
|
9379
9588
|
});
|
|
9380
9589
|
var MAX_SLASH_PANEL_COMMANDS = 100;
|
|
9381
|
-
function
|
|
9590
|
+
function normalizeCommandName2(value) {
|
|
9382
9591
|
if (typeof value !== "string") return null;
|
|
9383
9592
|
const name2 = value.trim().replace(/^\//u, "").toLowerCase();
|
|
9384
9593
|
return name2 || null;
|
|
@@ -9394,7 +9603,7 @@ function normalizeSlashPanelConfig(value) {
|
|
|
9394
9603
|
const order = [];
|
|
9395
9604
|
const seen = /* @__PURE__ */ new Set();
|
|
9396
9605
|
for (const candidate of Array.isArray(value.order) ? value.order : []) {
|
|
9397
|
-
const name2 =
|
|
9606
|
+
const name2 = normalizeCommandName2(candidate);
|
|
9398
9607
|
if (!name2 || seen.has(name2) || !manifestHas(name2)) continue;
|
|
9399
9608
|
seen.add(name2);
|
|
9400
9609
|
order.push(name2);
|
|
@@ -17836,8 +18045,8 @@ function MailboxPanel({ busy, error, onSubmit, onCancel, rpcCall, endpoints }) {
|
|
|
17836
18045
|
);
|
|
17837
18046
|
}
|
|
17838
18047
|
function shortenSessionId(sessionId) {
|
|
17839
|
-
const
|
|
17840
|
-
return
|
|
18048
|
+
const text9 = String(sessionId ?? "");
|
|
18049
|
+
return text9.length <= 20 ? text9 : `${text9.slice(0, 8)}\u2026${text9.slice(-6)}`;
|
|
17841
18050
|
}
|
|
17842
18051
|
function sessionLabel(session) {
|
|
17843
18052
|
const title = String(session?.title ?? "").trim();
|
|
@@ -18584,14 +18793,45 @@ var ACCESS_CHANNEL_DEFINITIONS = Object.freeze({
|
|
|
18584
18793
|
groupSupported: false
|
|
18585
18794
|
})
|
|
18586
18795
|
});
|
|
18796
|
+
var DEFAULT_COMMAND_ALLOWLIST = Object.freeze(["new", "stop", "help", "status", "compact", "clear"]);
|
|
18797
|
+
var COMMAND_CHOICES = Object.freeze([
|
|
18798
|
+
["new", "/new \u65B0\u4F1A\u8BDD"],
|
|
18799
|
+
["stop", "/stop \u505C\u6B62\u4EFB\u52A1"],
|
|
18800
|
+
["help", "/help \u5E2E\u52A9"],
|
|
18801
|
+
["status", "/status \u8FDE\u63A5\u72B6\u6001"],
|
|
18802
|
+
["compact", "/compact \u538B\u7F29\u4E0A\u4E0B\u6587"],
|
|
18803
|
+
["clear", "/clear \u6E05\u7A7A\u4E0A\u4E0B\u6587"],
|
|
18804
|
+
["menu", "/m \u6216 /menu \u83DC\u5355"],
|
|
18805
|
+
["version", "/version \u7248\u672C"],
|
|
18806
|
+
["models", "/models \u6A21\u578B\u5217\u8868"],
|
|
18807
|
+
["model", "/model \u6A21\u578B\u5207\u6362"],
|
|
18808
|
+
["reasoninglist", "/reasonings \u63A8\u7406\u7B49\u7EA7"],
|
|
18809
|
+
["reasoning", "/reasoning \u63A8\u7406\u7B49\u7EA7\u5207\u6362"],
|
|
18810
|
+
["presetlist", "/presets \u9884\u8BBE\u5217\u8868"],
|
|
18811
|
+
["preset", "/preset \u9884\u8BBE\u5207\u6362"],
|
|
18812
|
+
["permissionlist", "/permissionlist \u6743\u9650\u5217\u8868"],
|
|
18813
|
+
["permission", "/permission \u6743\u9650\u5207\u6362"],
|
|
18814
|
+
["history", "/history \u5386\u53F2\u6D88\u606F"],
|
|
18815
|
+
["workspace", "/workspace \u5DE5\u4F5C\u533A"],
|
|
18816
|
+
["workspacelist", "/workspaces \u5DE5\u4F5C\u533A\u5217\u8868"],
|
|
18817
|
+
["sessionlist", "/sessionlist \u4F1A\u8BDD\u5217\u8868"],
|
|
18818
|
+
["session", "/session \u7ED1\u5B9A\u4F1A\u8BDD"],
|
|
18819
|
+
["batch", "/batch \u6279\u91CF\u8F93\u5165"],
|
|
18820
|
+
["send", "/send \u53D1\u9001\u6279\u91CF"],
|
|
18821
|
+
["cancel", "/cancel \u53D6\u6D88\u6279\u91CF"],
|
|
18822
|
+
["steer", "/steer \u8865\u5145\u6307\u4EE4"],
|
|
18823
|
+
["repair", "/repair \u4FEE\u590D"]
|
|
18824
|
+
]);
|
|
18587
18825
|
function clonePolicy(policy) {
|
|
18588
18826
|
const cloneScope = (scope) => ({
|
|
18589
18827
|
mode: scope.mode,
|
|
18590
18828
|
open: {
|
|
18591
18829
|
defaultCanExecuteCommands: scope.open.defaultCanExecuteCommands,
|
|
18592
18830
|
commandPermissionOverrides: scope.open.commandPermissionOverrides.map((user) => ({
|
|
18593
|
-
...user
|
|
18594
|
-
|
|
18831
|
+
...user,
|
|
18832
|
+
...user.commandAllowlist === void 0 ? {} : { commandAllowlist: [...user.commandAllowlist] }
|
|
18833
|
+
})),
|
|
18834
|
+
...scope.open.commandAllowlist === void 0 ? {} : { commandAllowlist: [...scope.open.commandAllowlist] }
|
|
18595
18835
|
},
|
|
18596
18836
|
allowlist: {
|
|
18597
18837
|
users: scope.allowlist.users.map((user) => ({ ...user }))
|
|
@@ -18646,6 +18886,37 @@ function ScenePolicyEditor({
|
|
|
18646
18886
|
}
|
|
18647
18887
|
});
|
|
18648
18888
|
const updateUser = (index, patch) => updateUsers(users.map((user, userIndex) => userIndex === index ? { ...user, ...patch } : user));
|
|
18889
|
+
const [commandPickerOpen, setCommandPickerOpen] = React29.useState(false);
|
|
18890
|
+
const [commandQuery, setCommandQuery] = React29.useState("");
|
|
18891
|
+
const commandMode = policy.open.defaultCanExecuteCommands ? "allow" : policy.open.commandAllowlist?.length ? "custom" : "deny";
|
|
18892
|
+
const allowedCommands = new Set(policy.open.commandAllowlist ?? []);
|
|
18893
|
+
const updateOpen = (patch) => onChange({
|
|
18894
|
+
...policy,
|
|
18895
|
+
open: { ...policy.open, ...patch }
|
|
18896
|
+
});
|
|
18897
|
+
const changeCommandMode = (nextMode) => {
|
|
18898
|
+
if (nextMode === "allow") {
|
|
18899
|
+
updateOpen({ defaultCanExecuteCommands: true, commandAllowlist: void 0 });
|
|
18900
|
+
setCommandPickerOpen(false);
|
|
18901
|
+
return;
|
|
18902
|
+
}
|
|
18903
|
+
if (nextMode === "custom") {
|
|
18904
|
+
updateOpen({
|
|
18905
|
+
defaultCanExecuteCommands: false,
|
|
18906
|
+
commandAllowlist: policy.open.commandAllowlist?.length ? [...policy.open.commandAllowlist] : [...DEFAULT_COMMAND_ALLOWLIST]
|
|
18907
|
+
});
|
|
18908
|
+
return;
|
|
18909
|
+
}
|
|
18910
|
+
updateOpen({ defaultCanExecuteCommands: false, commandAllowlist: void 0 });
|
|
18911
|
+
setCommandPickerOpen(false);
|
|
18912
|
+
};
|
|
18913
|
+
const toggleCommand = (name2, checked) => {
|
|
18914
|
+
const next = new Set(allowedCommands);
|
|
18915
|
+
if (checked) next.add(name2);
|
|
18916
|
+
else if (next.size > 1) next.delete(name2);
|
|
18917
|
+
else return;
|
|
18918
|
+
updateOpen({ commandAllowlist: [...next] });
|
|
18919
|
+
};
|
|
18649
18920
|
return h2(
|
|
18650
18921
|
"fieldset",
|
|
18651
18922
|
{
|
|
@@ -18705,24 +18976,222 @@ function ScenePolicyEditor({
|
|
|
18705
18976
|
)
|
|
18706
18977
|
),
|
|
18707
18978
|
allowlist ? null : h2(
|
|
18708
|
-
|
|
18709
|
-
|
|
18710
|
-
h2("span", null, "\u9ED8\u8BA4\u547D\u4EE4\u6743\u9650"),
|
|
18979
|
+
React29.Fragment,
|
|
18980
|
+
null,
|
|
18711
18981
|
h2(
|
|
18712
|
-
"
|
|
18982
|
+
"label",
|
|
18983
|
+
{ className: "dim-accessField" },
|
|
18984
|
+
h2("span", null, "\u547D\u4EE4\u6743\u9650"),
|
|
18985
|
+
h2(
|
|
18986
|
+
"select",
|
|
18987
|
+
{
|
|
18988
|
+
value: commandMode,
|
|
18989
|
+
"aria-label": [localizeText(title), localizeText("\u9ED8\u8BA4\u547D\u4EE4\u6743\u9650")].join(" "),
|
|
18990
|
+
onChange: (event) => changeCommandMode(event.target.value)
|
|
18991
|
+
},
|
|
18992
|
+
h2("option", { value: "deny" }, "\u4E0D\u80FD\u6267\u884C\u547D\u4EE4"),
|
|
18993
|
+
h2("option", { value: "allow" }, "\u53EF\u4EE5\u6267\u884C\u547D\u4EE4"),
|
|
18994
|
+
h2("option", { value: "custom" }, "\u53EF\u4EE5\u6267\u884C\u6307\u5B9A\u7684\u547D\u4EE4")
|
|
18995
|
+
)
|
|
18996
|
+
),
|
|
18997
|
+
commandMode !== "custom" ? null : h2(
|
|
18998
|
+
"div",
|
|
18713
18999
|
{
|
|
18714
|
-
|
|
18715
|
-
|
|
18716
|
-
onChange: (event) => onChange({
|
|
18717
|
-
...policy,
|
|
18718
|
-
open: {
|
|
18719
|
-
...policy.open,
|
|
18720
|
-
defaultCanExecuteCommands: commandValue(event.target.value)
|
|
18721
|
-
}
|
|
18722
|
-
})
|
|
19000
|
+
className: "dim-accessField dim-accessCommandPicker",
|
|
19001
|
+
style: { position: "relative" }
|
|
18723
19002
|
},
|
|
18724
|
-
h2("
|
|
18725
|
-
|
|
19003
|
+
h2("button", {
|
|
19004
|
+
type: "button",
|
|
19005
|
+
className: "dim-deliveryButton",
|
|
19006
|
+
"aria-expanded": commandPickerOpen,
|
|
19007
|
+
onClick: () => setCommandPickerOpen((value) => !value)
|
|
19008
|
+
}, localizeTemplate("\u9009\u62E9\u547D\u4EE4\uFF08{count}\uFF09", { count: allowedCommands.size })),
|
|
19009
|
+
commandPickerOpen ? h2(
|
|
19010
|
+
"div",
|
|
19011
|
+
{
|
|
19012
|
+
role: "presentation",
|
|
19013
|
+
style: {
|
|
19014
|
+
position: "fixed",
|
|
19015
|
+
inset: 0,
|
|
19016
|
+
zIndex: 1e3,
|
|
19017
|
+
display: "flex",
|
|
19018
|
+
alignItems: "center",
|
|
19019
|
+
justifyContent: "center",
|
|
19020
|
+
padding: 24,
|
|
19021
|
+
background: "rgba(0, 0, 0, 0.42)"
|
|
19022
|
+
},
|
|
19023
|
+
onClick: () => setCommandPickerOpen(false)
|
|
19024
|
+
},
|
|
19025
|
+
h2(
|
|
19026
|
+
"div",
|
|
19027
|
+
{
|
|
19028
|
+
role: "dialog",
|
|
19029
|
+
"aria-modal": "true",
|
|
19030
|
+
"aria-label": "\u9009\u62E9\u5141\u8BB8\u7684\u547D\u4EE4",
|
|
19031
|
+
onClick: (event) => event.stopPropagation(),
|
|
19032
|
+
style: {
|
|
19033
|
+
width: "min(560px, 100%)",
|
|
19034
|
+
maxHeight: "min(680px, calc(100vh - 48px))",
|
|
19035
|
+
display: "flex",
|
|
19036
|
+
flexDirection: "column",
|
|
19037
|
+
gap: 12,
|
|
19038
|
+
padding: 20,
|
|
19039
|
+
borderRadius: 14,
|
|
19040
|
+
border: "1px solid var(--dsw-alias-border-l1)",
|
|
19041
|
+
background: "var(--dsw-alias-bg-overlay)",
|
|
19042
|
+
color: "var(--dsw-alias-label-primary)",
|
|
19043
|
+
boxShadow: "0 24px 64px rgba(0, 0, 0, 0.38)"
|
|
19044
|
+
}
|
|
19045
|
+
},
|
|
19046
|
+
h2(
|
|
19047
|
+
"div",
|
|
19048
|
+
{ style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 12 } },
|
|
19049
|
+
h2(
|
|
19050
|
+
"div",
|
|
19051
|
+
null,
|
|
19052
|
+
h2("strong", { style: { fontSize: 15 } }, "\u9009\u62E9\u5141\u8BB8\u7684\u547D\u4EE4"),
|
|
19053
|
+
h2(
|
|
19054
|
+
"p",
|
|
19055
|
+
{ style: { margin: "4px 0 0", fontSize: 12, lineHeight: 1.5, color: "var(--dsw-alias-label-secondary)" } },
|
|
19056
|
+
"\u9ED8\u8BA4\u52FE\u9009 new\u3001stop\u3001help\u3001status\u3001compact\u3001clear\u3002"
|
|
19057
|
+
)
|
|
19058
|
+
),
|
|
19059
|
+
h2("button", {
|
|
19060
|
+
type: "button",
|
|
19061
|
+
"aria-label": "\u5173\u95ED",
|
|
19062
|
+
onClick: () => setCommandPickerOpen(false),
|
|
19063
|
+
style: {
|
|
19064
|
+
flex: "0 0 auto",
|
|
19065
|
+
width: 28,
|
|
19066
|
+
height: 28,
|
|
19067
|
+
padding: 0,
|
|
19068
|
+
border: "1px solid var(--dsw-alias-border-l1)",
|
|
19069
|
+
borderRadius: 7,
|
|
19070
|
+
background: "transparent",
|
|
19071
|
+
color: "var(--dsw-alias-label-secondary)",
|
|
19072
|
+
cursor: "pointer",
|
|
19073
|
+
fontSize: 16,
|
|
19074
|
+
lineHeight: "24px"
|
|
19075
|
+
}
|
|
19076
|
+
}, "\xD7")
|
|
19077
|
+
),
|
|
19078
|
+
h2("input", {
|
|
19079
|
+
type: "search",
|
|
19080
|
+
value: commandQuery,
|
|
19081
|
+
placeholder: "\u641C\u7D22\u547D\u4EE4\u2026",
|
|
19082
|
+
"aria-label": "\u641C\u7D22\u547D\u4EE4",
|
|
19083
|
+
onChange: (event) => setCommandQuery(event.target.value),
|
|
19084
|
+
style: {
|
|
19085
|
+
width: "100%",
|
|
19086
|
+
boxSizing: "border-box",
|
|
19087
|
+
padding: "8px 10px",
|
|
19088
|
+
border: "1px solid var(--dsw-alias-border-l1)",
|
|
19089
|
+
borderRadius: 8,
|
|
19090
|
+
background: "var(--dsw-alias-bg-base)",
|
|
19091
|
+
color: "var(--dsw-alias-label-primary)",
|
|
19092
|
+
fontSize: 12
|
|
19093
|
+
}
|
|
19094
|
+
}),
|
|
19095
|
+
h2(
|
|
19096
|
+
"div",
|
|
19097
|
+
{
|
|
19098
|
+
style: {
|
|
19099
|
+
display: "grid",
|
|
19100
|
+
gridTemplateColumns: "repeat(2, minmax(0, 1fr))",
|
|
19101
|
+
gap: 4,
|
|
19102
|
+
overflow: "auto",
|
|
19103
|
+
paddingRight: 4,
|
|
19104
|
+
flex: "1 1 auto",
|
|
19105
|
+
minHeight: 0
|
|
19106
|
+
}
|
|
19107
|
+
},
|
|
19108
|
+
COMMAND_CHOICES.filter(([name2, label]) => {
|
|
19109
|
+
const query = commandQuery.trim().toLowerCase();
|
|
19110
|
+
return !query || name2.includes(query) || label.toLowerCase().includes(query);
|
|
19111
|
+
}).map(([name2, label]) => {
|
|
19112
|
+
const checked = allowedCommands.has(name2);
|
|
19113
|
+
return h2(
|
|
19114
|
+
"button",
|
|
19115
|
+
{
|
|
19116
|
+
key: name2,
|
|
19117
|
+
type: "button",
|
|
19118
|
+
role: "checkbox",
|
|
19119
|
+
"aria-checked": checked,
|
|
19120
|
+
onClick: () => toggleCommand(name2, !checked),
|
|
19121
|
+
style: {
|
|
19122
|
+
display: "flex",
|
|
19123
|
+
alignItems: "center",
|
|
19124
|
+
gap: 8,
|
|
19125
|
+
minWidth: 0,
|
|
19126
|
+
padding: "6px 8px",
|
|
19127
|
+
borderRadius: 6,
|
|
19128
|
+
cursor: "pointer",
|
|
19129
|
+
fontSize: 12,
|
|
19130
|
+
textAlign: "left",
|
|
19131
|
+
color: "inherit",
|
|
19132
|
+
border: checked ? "1px solid var(--dsw-alias-brand-primary)" : "1px solid transparent",
|
|
19133
|
+
background: checked ? "var(--dsw-alias-bg-layer-2)" : "transparent"
|
|
19134
|
+
}
|
|
19135
|
+
},
|
|
19136
|
+
h2("span", {
|
|
19137
|
+
style: {
|
|
19138
|
+
flex: "0 0 16px",
|
|
19139
|
+
width: 16,
|
|
19140
|
+
height: 16,
|
|
19141
|
+
lineHeight: "16px",
|
|
19142
|
+
textAlign: "center",
|
|
19143
|
+
borderRadius: 4,
|
|
19144
|
+
fontSize: 11,
|
|
19145
|
+
color: checked ? "#fff" : "transparent",
|
|
19146
|
+
background: checked ? "var(--dsw-alias-brand-primary)" : "transparent",
|
|
19147
|
+
border: checked ? "none" : "1px solid var(--dsw-alias-border-l2)"
|
|
19148
|
+
}
|
|
19149
|
+
}, "\u2713"),
|
|
19150
|
+
h2("span", {
|
|
19151
|
+
style: { overflow: "hidden", whiteSpace: "nowrap", textOverflow: "ellipsis" }
|
|
19152
|
+
}, label)
|
|
19153
|
+
);
|
|
19154
|
+
})
|
|
19155
|
+
),
|
|
19156
|
+
h2(
|
|
19157
|
+
"div",
|
|
19158
|
+
{
|
|
19159
|
+
style: {
|
|
19160
|
+
display: "flex",
|
|
19161
|
+
alignItems: "center",
|
|
19162
|
+
justifyContent: "space-between",
|
|
19163
|
+
gap: 8,
|
|
19164
|
+
paddingTop: 4
|
|
19165
|
+
}
|
|
19166
|
+
},
|
|
19167
|
+
h2(
|
|
19168
|
+
"span",
|
|
19169
|
+
{ style: { fontSize: 12, color: "var(--dsw-alias-label-secondary)" } },
|
|
19170
|
+
localizeTemplate("\u5DF2\u9009 {count} \u9879", { count: allowedCommands.size })
|
|
19171
|
+
),
|
|
19172
|
+
h2(
|
|
19173
|
+
"div",
|
|
19174
|
+
{ style: { display: "flex", gap: 8 } },
|
|
19175
|
+
h2("button", {
|
|
19176
|
+
type: "button",
|
|
19177
|
+
className: "dim-deliveryButton",
|
|
19178
|
+
onClick: () => updateOpen({ commandAllowlist: [...DEFAULT_COMMAND_ALLOWLIST] })
|
|
19179
|
+
}, "\u6062\u590D\u9ED8\u8BA4"),
|
|
19180
|
+
h2("button", {
|
|
19181
|
+
type: "button",
|
|
19182
|
+
className: "dim-deliveryButton",
|
|
19183
|
+
onClick: () => updateOpen({ commandAllowlist: COMMAND_CHOICES.map(([name2]) => name2) })
|
|
19184
|
+
}, "\u5168\u90E8\u547D\u4EE4"),
|
|
19185
|
+
h2("button", {
|
|
19186
|
+
type: "button",
|
|
19187
|
+
className: "dim-deliveryButton",
|
|
19188
|
+
"data-kind": "primary",
|
|
19189
|
+
onClick: () => setCommandPickerOpen(false)
|
|
19190
|
+
}, "\u5B8C\u6210")
|
|
19191
|
+
)
|
|
19192
|
+
)
|
|
19193
|
+
)
|
|
19194
|
+
) : null
|
|
18726
19195
|
)
|
|
18727
19196
|
)
|
|
18728
19197
|
),
|
|
@@ -18932,20 +19401,54 @@ function AccessPolicySettingsPage({ channel: channel7, account, rpcCall, onSaved
|
|
|
18932
19401
|
|
|
18933
19402
|
// plugin-src/client/bot-general-settings.js
|
|
18934
19403
|
var React30 = __toESM(require("react"), 1);
|
|
19404
|
+
|
|
19405
|
+
// src/channels/shared/reply-content.mjs
|
|
19406
|
+
var SET_REPLY_CONTENT_ENDPOINT = "bot.reply-content.set";
|
|
19407
|
+
var REPLY_CONTENT_KEYS = Object.freeze(["narration", "tools", "thinking"]);
|
|
19408
|
+
var DEFAULT_REPLY_CONTENT = Object.freeze({
|
|
19409
|
+
narration: true,
|
|
19410
|
+
tools: true,
|
|
19411
|
+
thinking: true
|
|
19412
|
+
});
|
|
19413
|
+
function booleanOr(value, fallback) {
|
|
19414
|
+
return typeof value === "boolean" ? value : fallback;
|
|
19415
|
+
}
|
|
19416
|
+
function normalizeReplyContent(value) {
|
|
19417
|
+
const source = value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
19418
|
+
return Object.freeze({
|
|
19419
|
+
narration: booleanOr(source.narration, DEFAULT_REPLY_CONTENT.narration),
|
|
19420
|
+
tools: booleanOr(source.tools, DEFAULT_REPLY_CONTENT.tools),
|
|
19421
|
+
thinking: booleanOr(source.thinking, DEFAULT_REPLY_CONTENT.thinking)
|
|
19422
|
+
});
|
|
19423
|
+
}
|
|
19424
|
+
|
|
19425
|
+
// plugin-src/client/bot-general-settings.js
|
|
19426
|
+
var REPLY_CONTENT_ROWS = Object.freeze([
|
|
19427
|
+
["narration", "\u8FC7\u7A0B\u6B63\u6587", "\u6B63\u5728\u6267\u884C\u65F6\u52A9\u624B\u7684\u8BF4\u660E\u6587\u5B57"],
|
|
19428
|
+
["tools", "\u5DE5\u5177\u6B65\u9AA4", "\u5DE5\u5177\u8C03\u7528\u3001\u7ED3\u679C\u4E0E\u5931\u8D25\u63D0\u793A"],
|
|
19429
|
+
["thinking", "\u601D\u8003\u8FC7\u7A0B", "\u6A21\u578B\u7684\u63A8\u7406\u8FC7\u7A0B\uFF08\u6E20\u9053\u652F\u6301\u65F6\uFF09"]
|
|
19430
|
+
]);
|
|
18935
19431
|
function settingsFromResult(result2, botId) {
|
|
18936
19432
|
if (result2?.ok !== true) throw new Error(result2?.error?.message || "\u65E0\u6CD5\u8BFB\u53D6\u901A\u7528\u8BBE\u7F6E\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002");
|
|
18937
19433
|
const bot = result2.value?.bots?.find((entry) => entry.botId === botId);
|
|
18938
19434
|
if (!bot) throw new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");
|
|
18939
19435
|
return {
|
|
18940
19436
|
busyMessageMode: normalizeBusyMessageMode(bot.busyMessageMode),
|
|
18941
|
-
stepCardPanels: normalizeFeishuStepCardPanels(bot.stepCardPanels)
|
|
19437
|
+
stepCardPanels: normalizeFeishuStepCardPanels(bot.stepCardPanels),
|
|
19438
|
+
replyContent: normalizeReplyContent(bot.replyContent)
|
|
18942
19439
|
};
|
|
18943
19440
|
}
|
|
19441
|
+
var SAVE_ENDPOINTS = Object.freeze({
|
|
19442
|
+
busyMessageMode: SET_MESSAGE_MODE_ENDPOINT,
|
|
19443
|
+
stepCardPanels: FEISHU_ENDPOINTS.setStepCardPanels,
|
|
19444
|
+
replyContent: SET_REPLY_CONTENT_ENDPOINT
|
|
19445
|
+
});
|
|
18944
19446
|
function BotGeneralSettingsPage({ channel: channel7, account, rpcCall }) {
|
|
18945
19447
|
const modeId = React30.useId();
|
|
18946
19448
|
const [settings, setSettings] = React30.useState(() => ({
|
|
18947
19449
|
busyMessageMode: "queue",
|
|
18948
|
-
stepCardPanels: normalizeFeishuStepCardPanels()
|
|
19450
|
+
stepCardPanels: normalizeFeishuStepCardPanels(),
|
|
19451
|
+
replyContent: normalizeReplyContent()
|
|
18949
19452
|
}));
|
|
18950
19453
|
const [savedSettings, setSavedSettings] = React30.useState(null);
|
|
18951
19454
|
const [busy, setBusy] = React30.useState(false);
|
|
@@ -18984,8 +19487,7 @@ function BotGeneralSettingsPage({ channel: channel7, account, rpcCall }) {
|
|
|
18984
19487
|
setBusy(true);
|
|
18985
19488
|
setFeedback(null);
|
|
18986
19489
|
try {
|
|
18987
|
-
const
|
|
18988
|
-
const saved = settingsFromResult(await rpcCall(endpoint, {
|
|
19490
|
+
const saved = settingsFromResult(await rpcCall(SAVE_ENDPOINTS[field2], {
|
|
18989
19491
|
botId: account.botId,
|
|
18990
19492
|
[field2]: value
|
|
18991
19493
|
}), account.botId);
|
|
@@ -19040,6 +19542,50 @@ function BotGeneralSettingsPage({ channel: channel7, account, rpcCall }) {
|
|
|
19040
19542
|
)
|
|
19041
19543
|
)
|
|
19042
19544
|
),
|
|
19545
|
+
h2(
|
|
19546
|
+
"div",
|
|
19547
|
+
{ className: "dim-botGeneralRow dim-botGeneralPanelRow" },
|
|
19548
|
+
h2(
|
|
19549
|
+
"div",
|
|
19550
|
+
{ className: "dim-botGeneralText" },
|
|
19551
|
+
h2("label", { className: "dim-botGeneralTitle", htmlFor: `${modeId}-reply-content` }, "\u6295\u9012\u5185\u5BB9"),
|
|
19552
|
+
h2("p", {
|
|
19553
|
+
className: "dim-botGeneralHelp",
|
|
19554
|
+
id: `${modeId}-reply-content-description`
|
|
19555
|
+
}, "\u6700\u7EC8\u56DE\u7B54\u59CB\u7EC8\u53D1\u9001\uFF1B\u5173\u95ED\u7684\u9879\u4E0D\u518D\u63A8\u9001\u3002")
|
|
19556
|
+
)
|
|
19557
|
+
),
|
|
19558
|
+
...REPLY_CONTENT_ROWS.map(([field2, label, help]) => h2(
|
|
19559
|
+
"div",
|
|
19560
|
+
{
|
|
19561
|
+
key: field2,
|
|
19562
|
+
className: "dim-botGeneralRow dim-botGeneralPanelRow"
|
|
19563
|
+
},
|
|
19564
|
+
h2(
|
|
19565
|
+
"div",
|
|
19566
|
+
{ className: "dim-botGeneralText" },
|
|
19567
|
+
h2("label", { className: "dim-botGeneralTitle", htmlFor: `${modeId}-${field2}` }, label),
|
|
19568
|
+
h2("p", { className: "dim-botGeneralHelp" }, help)
|
|
19569
|
+
),
|
|
19570
|
+
h2(
|
|
19571
|
+
"div",
|
|
19572
|
+
{ className: "dim-botGeneralControl" },
|
|
19573
|
+
h2("input", {
|
|
19574
|
+
id: `${modeId}-${field2}`,
|
|
19575
|
+
type: "checkbox",
|
|
19576
|
+
role: "switch",
|
|
19577
|
+
className: "dim-contextSwitch",
|
|
19578
|
+
checked: settings.replyContent[field2],
|
|
19579
|
+
disabled: busy || savedSettings === null,
|
|
19580
|
+
"aria-label": label,
|
|
19581
|
+
"aria-describedby": `${modeId}-reply-content-description`,
|
|
19582
|
+
onChange: (event) => void save("replyContent", {
|
|
19583
|
+
...settings.replyContent,
|
|
19584
|
+
[field2]: event.target.checked
|
|
19585
|
+
})
|
|
19586
|
+
})
|
|
19587
|
+
)
|
|
19588
|
+
)),
|
|
19043
19589
|
channel7 === "feishu" ? [
|
|
19044
19590
|
["thinkingExpanded", "\u5C55\u5F00\u601D\u8003\u8FC7\u7A0B"],
|
|
19045
19591
|
["toolsExpanded", "\u5C55\u5F00\u5DE5\u5177\u6458\u8981"]
|
|
@@ -21326,8 +21872,8 @@ function isListMode(mode) {
|
|
|
21326
21872
|
function modeLabel(value) {
|
|
21327
21873
|
return GROUP_TRIGGER_MODE_OPTIONS.find((option) => option.value === value)?.label ?? GROUP_TRIGGER_MODE_OPTIONS[0].label;
|
|
21328
21874
|
}
|
|
21329
|
-
function splitMemberIds(
|
|
21330
|
-
return String(
|
|
21875
|
+
function splitMemberIds(text9) {
|
|
21876
|
+
return String(text9 ?? "").split(/[\s,;]+/).map((item) => item.trim()).filter(Boolean);
|
|
21331
21877
|
}
|
|
21332
21878
|
function entryFromConfig(value) {
|
|
21333
21879
|
const mode = GROUP_TRIGGER_MODE_OPTIONS.some((option) => option.value === value?.mode) ? value.mode : "off";
|
|
@@ -21873,18 +22419,18 @@ function validSuggestions(definition, value) {
|
|
|
21873
22419
|
});
|
|
21874
22420
|
}
|
|
21875
22421
|
function maskRouteValue(value) {
|
|
21876
|
-
const
|
|
21877
|
-
if (!
|
|
21878
|
-
const at =
|
|
22422
|
+
const text9 = String(value ?? "").trim();
|
|
22423
|
+
if (!text9) return "";
|
|
22424
|
+
const at = text9.indexOf("@");
|
|
21879
22425
|
if (at > 0) {
|
|
21880
|
-
const local =
|
|
21881
|
-
const domain =
|
|
22426
|
+
const local = text9.slice(0, at);
|
|
22427
|
+
const domain = text9.slice(at);
|
|
21882
22428
|
const visible = local.length <= 4 ? `${local.slice(0, 1)}\u2022\u2022${local.slice(-1)}` : `${local.slice(0, 3)}\u2026${local.slice(-2)}`;
|
|
21883
22429
|
return `${visible}${domain}`;
|
|
21884
22430
|
}
|
|
21885
|
-
if (
|
|
21886
|
-
if (
|
|
21887
|
-
return `${
|
|
22431
|
+
if (text9.length <= 6) return `${text9.slice(0, 2)}\u2026${text9.slice(-1)}`;
|
|
22432
|
+
if (text9.length <= 12) return `${text9.slice(0, 3)}\u2026${text9.slice(-3)}`;
|
|
22433
|
+
return `${text9.slice(0, 5)}\u2026${text9.slice(-4)}`;
|
|
21888
22434
|
}
|
|
21889
22435
|
function suggestionFallbackName(definition, suggestion) {
|
|
21890
22436
|
const displayName = suggestionDisplayName(suggestion);
|
|
@@ -22646,14 +23192,14 @@ function normalizeDeliverySyncIcon(value) {
|
|
|
22646
23192
|
if (CONTROL_CHARACTER.test(trimmed)) return "";
|
|
22647
23193
|
return trimmed;
|
|
22648
23194
|
}
|
|
22649
|
-
function
|
|
23195
|
+
function booleanOr2(value, fallback) {
|
|
22650
23196
|
return typeof value === "boolean" ? value : fallback;
|
|
22651
23197
|
}
|
|
22652
23198
|
function normalizeDeliverySyncSettings(value) {
|
|
22653
23199
|
if (!isRecord9(value)) return null;
|
|
22654
23200
|
return Object.freeze({
|
|
22655
|
-
mirrorUserInput:
|
|
22656
|
-
deliverModelAnswers:
|
|
23201
|
+
mirrorUserInput: booleanOr2(value.mirrorUserInput, DEFAULT_DELIVERY_SYNC_SETTINGS.mirrorUserInput),
|
|
23202
|
+
deliverModelAnswers: booleanOr2(
|
|
22657
23203
|
value.deliverModelAnswers,
|
|
22658
23204
|
DEFAULT_DELIVERY_SYNC_SETTINGS.deliverModelAnswers
|
|
22659
23205
|
),
|
|
@@ -23964,14 +24510,14 @@ var CSS15 = String.raw`
|
|
|
23964
24510
|
.dim-githubLink:focus-visible { outline: 2px solid color-mix(in srgb, var(--dim-blue) 70%, white); outline-offset: 2px; }
|
|
23965
24511
|
.dim-updateTooltip, .dim-githubTooltip { position: absolute; top: calc(100% + 8px); right: 0; z-index: 20; width: max-content; max-width: min(220px, 80vw); padding: 6px 9px; border: 1px solid var(--dsw-alias-border-l2, #dfe1e5); border-radius: 7px; color: var(--dsw-alias-label-primary, #1f2329); background: var(--dsw-alias-bg-layer-3, #fff); box-shadow: 0 8px 24px rgb(31 35 41 / 14%); font-size: 11px; line-height: 16px; font-weight: 500; white-space: nowrap; opacity: 0; visibility: hidden; transform: translateY(-3px); pointer-events: none; transition: opacity .15s ease, transform .15s ease, visibility .15s ease; }
|
|
23966
24512
|
.dim-updateAction:hover .dim-updateTooltip, .dim-updateTrigger:focus-visible + .dim-updateTooltip, .dim-githubAction:hover .dim-githubTooltip, .dim-githubAction:focus-within .dim-githubTooltip { opacity: 1; visibility: visible; transform: translateY(0); }
|
|
23967
|
-
.dim-generalSettingsAction { position: relative; display: inline-flex; flex: none; }
|
|
23968
|
-
.dim-generalSettingsButton { width: 30px; height: 30px; display: grid; place-items: center; flex: none; padding: 0; border: 1px solid var(--dsw-alias-border-l2, #dfe1e5); border-radius: 8px; color: var(--dsw-alias-label-secondary, #646a73); background: var(--dsw-alias-bg-layer-1, #fff); cursor: pointer; transition: border-color .15s ease, color .15s ease, background .15s ease, box-shadow .15s ease; }
|
|
23969
|
-
.dim-generalSettingsButton svg { display: block; }
|
|
23970
|
-
.dim-generalSettingsButton:hover { border-color: #aeb3bb; color: var(--dsw-alias-label-primary, #1f2329); background: var(--dsw-alias-interactive-bg-hover, #f7f8fa); }
|
|
24513
|
+
.dim-sessionHistoryAction, .dim-generalSettingsAction { position: relative; display: inline-flex; flex: none; }
|
|
24514
|
+
.dim-sessionHistoryButton, .dim-generalSettingsButton { width: 30px; height: 30px; display: grid; place-items: center; flex: none; padding: 0; border: 1px solid var(--dsw-alias-border-l2, #dfe1e5); border-radius: 8px; color: var(--dsw-alias-label-secondary, #646a73); background: var(--dsw-alias-bg-layer-1, #fff); cursor: pointer; transition: border-color .15s ease, color .15s ease, background .15s ease, box-shadow .15s ease; }
|
|
24515
|
+
.dim-sessionHistoryButton svg, .dim-generalSettingsButton svg { display: block; }
|
|
24516
|
+
.dim-sessionHistoryButton:hover, .dim-generalSettingsButton:hover { border-color: #aeb3bb; color: var(--dsw-alias-label-primary, #1f2329); background: var(--dsw-alias-interactive-bg-hover, #f7f8fa); }
|
|
23971
24517
|
.dim-generalSettingsButton[aria-current="page"] { border-color: color-mix(in srgb, var(--dim-blue) 42%, var(--dsw-alias-border-l2, #dfe1e5)); color: var(--dim-blue); background: var(--dim-blue-soft); }
|
|
23972
|
-
.dim-generalSettingsButton:focus-visible { outline: 2px solid color-mix(in srgb, var(--dim-blue) 70%, white); outline-offset: 2px; }
|
|
23973
|
-
.dim-generalSettingsTooltip { position: absolute; top: calc(100% + 8px); right: 0; z-index: 20; width: max-content; padding: 6px 9px; border: 1px solid var(--dsw-alias-border-l2, #dfe1e5); border-radius: 7px; color: var(--dsw-alias-label-primary, #1f2329); background: var(--dsw-alias-bg-layer-3, #fff); box-shadow: 0 8px 24px rgb(31 35 41 / 14%); font-size: 11px; line-height: 16px; font-weight: 500; white-space: nowrap; opacity: 0; visibility: hidden; transform: translateY(-3px); pointer-events: none; transition: opacity .15s ease, transform .15s ease, visibility .15s ease; }
|
|
23974
|
-
.dim-generalSettingsAction:hover .dim-generalSettingsTooltip, .dim-generalSettingsButton:focus-visible + .dim-generalSettingsTooltip { opacity: 1; visibility: visible; transform: translateY(0); }
|
|
24518
|
+
.dim-sessionHistoryButton:focus-visible, .dim-generalSettingsButton:focus-visible { outline: 2px solid color-mix(in srgb, var(--dim-blue) 70%, white); outline-offset: 2px; }
|
|
24519
|
+
.dim-sessionHistoryTooltip, .dim-generalSettingsTooltip { position: absolute; top: calc(100% + 8px); right: 0; z-index: 20; width: max-content; padding: 6px 9px; border: 1px solid var(--dsw-alias-border-l2, #dfe1e5); border-radius: 7px; color: var(--dsw-alias-label-primary, #1f2329); background: var(--dsw-alias-bg-layer-3, #fff); box-shadow: 0 8px 24px rgb(31 35 41 / 14%); font-size: 11px; line-height: 16px; font-weight: 500; white-space: nowrap; opacity: 0; visibility: hidden; transform: translateY(-3px); pointer-events: none; transition: opacity .15s ease, transform .15s ease, visibility .15s ease; }
|
|
24520
|
+
.dim-sessionHistoryAction:hover .dim-sessionHistoryTooltip, .dim-sessionHistoryButton:focus-visible + .dim-sessionHistoryTooltip, .dim-generalSettingsAction:hover .dim-generalSettingsTooltip, .dim-generalSettingsButton:focus-visible + .dim-generalSettingsTooltip { opacity: 1; visibility: visible; transform: translateY(0); }
|
|
23975
24521
|
.dim-generalSettingsButton[aria-current="page"] + .dim-generalSettingsTooltip { opacity: 0; visibility: hidden; transform: translateY(-3px); }
|
|
23976
24522
|
.dim-layout { display: grid; grid-template-columns: 174px 1px minmax(0, 1fr); gap: 24px; align-items: start; }
|
|
23977
24523
|
.dim-rail { display: grid; align-content: start; gap: 8px; padding: 0 4px 1px 1px; }
|
|
@@ -25558,7 +26104,8 @@ function UpdatePanel({ rpcCall, clientVersion, onStatus }) {
|
|
|
25558
26104
|
h2("strong", null, "DSH \u7248\u672C\u517C\u5BB9\u8BF4\u660E"),
|
|
25559
26105
|
h2("p", { className: "dim-updateManualHint" }, "dsh-im 4.25.0 \u652F\u6301\u5230 DSH v0.1.6-alpha.2\u3002"),
|
|
25560
26106
|
h2("p", { className: "dim-updateManualHint" }, "dsh-im 4.39.0 \u4EC5\u652F\u6301 DSH 0.2.0-rc.2\u3002"),
|
|
25561
|
-
h2("p", { className: "dim-updateManualHint" }, "dsh-im 5.0.0 \u4EC5\u652F\u6301 DSH 0.2.1-rc.2\u3002")
|
|
26107
|
+
h2("p", { className: "dim-updateManualHint" }, "dsh-im 5.0.0 \u4EC5\u652F\u6301 DSH 0.2.1-rc.2\u3002"),
|
|
26108
|
+
h2("p", { className: "dim-updateManualHint" }, "dsh-im 5.10.0 \u8D77\u652F\u6301 DSH 0.2.2-rc.5\u3002")
|
|
25562
26109
|
),
|
|
25563
26110
|
h2(ManualUpdateCommand, {
|
|
25564
26111
|
key: manualCommand ?? "unavailable",
|
|
@@ -25718,6 +26265,520 @@ function installImPluginPage(ctx, { packageName, renderPanel, sidebarVisible = f
|
|
|
25718
26265
|
return controller;
|
|
25719
26266
|
}
|
|
25720
26267
|
|
|
26268
|
+
// plugin-src/client/im-channels.js
|
|
26269
|
+
var React49 = __toESM(require("react"), 1);
|
|
26270
|
+
var CHANNEL_LIST_RPC_CHANNEL = "/dsh-im-channels";
|
|
26271
|
+
var CHANNEL_SESSIONS_PANEL_ID = "xmanrui-dsh-im-channels";
|
|
26272
|
+
var CHANNEL_LABELS = Object.freeze({
|
|
26273
|
+
matrix: "Matrix",
|
|
26274
|
+
telegram: "Telegram",
|
|
26275
|
+
whatsapp: "WhatsApp",
|
|
26276
|
+
wecom: "\u5FAE\u4FE1\u5BA2\u670D",
|
|
26277
|
+
"wecom-app": "\u4F01\u4E1A\u5FAE\u4FE1",
|
|
26278
|
+
feishu: "\u98DE\u4E66",
|
|
26279
|
+
dingtalk: "\u9489\u9489",
|
|
26280
|
+
slack: "Slack",
|
|
26281
|
+
discord: "Discord",
|
|
26282
|
+
line: "LINE",
|
|
26283
|
+
qq: "QQ"
|
|
26284
|
+
});
|
|
26285
|
+
var styles = Object.freeze({
|
|
26286
|
+
header: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 16, marginBottom: 20 },
|
|
26287
|
+
title: { margin: 0, fontSize: 22, fontWeight: 650 },
|
|
26288
|
+
description: { margin: "6px 0 0", opacity: 0.68, lineHeight: 1.6 },
|
|
26289
|
+
button: { border: "1px solid var(--dim-border, #444)", borderRadius: 6, background: "transparent", color: "inherit", padding: "6px 12px", cursor: "pointer", whiteSpace: "nowrap" },
|
|
26290
|
+
group: { marginBottom: 22 },
|
|
26291
|
+
groupTitle: { display: "flex", alignItems: "center", gap: 8, margin: "0 0 8px", fontSize: 16 },
|
|
26292
|
+
count: { opacity: 0.58, fontSize: 12, fontWeight: 400 },
|
|
26293
|
+
tableWrap: { overflowX: "auto", border: "1px solid var(--dim-border, #444)", borderRadius: 8 },
|
|
26294
|
+
table: { width: "100%", borderCollapse: "collapse", fontSize: 13 },
|
|
26295
|
+
th: { textAlign: "left", padding: "10px 12px", borderBottom: "1px solid var(--dim-border, #444)", opacity: 0.65, fontWeight: 500 },
|
|
26296
|
+
td: { padding: "10px 12px", borderBottom: "1px solid var(--dim-border, #333)", verticalAlign: "top" },
|
|
26297
|
+
code: { fontFamily: "ui-monospace, SFMono-Regular, Consolas, monospace", fontSize: 12, overflowWrap: "anywhere" },
|
|
26298
|
+
secondary: { display: "block", marginTop: 4, opacity: 0.55, fontSize: 11 },
|
|
26299
|
+
muted: { opacity: 0.65, padding: "24px 0" },
|
|
26300
|
+
error: { padding: 12, marginBottom: 16, borderRadius: 6, background: "var(--dim-error-bg, rgba(220, 70, 70, .12))", color: "var(--dim-error, #e17777)", whiteSpace: "pre-wrap", overflowWrap: "anywhere" },
|
|
26301
|
+
actions: { display: "flex", flexWrap: "wrap", gap: 8, alignItems: "center" },
|
|
26302
|
+
messageList: { display: "flex", flexDirection: "column", gap: 12, marginTop: 16 },
|
|
26303
|
+
message: { maxWidth: 920, padding: "12px 14px", border: "1px solid var(--dim-border, #444)", borderRadius: 10, background: "var(--dim-bg-secondary, rgba(127, 127, 127, .06))" },
|
|
26304
|
+
userMessage: { borderColor: "var(--dim-accent-border, rgba(80, 140, 220, .45))", background: "var(--dim-accent-bg, rgba(80, 140, 220, .08))" },
|
|
26305
|
+
messageMeta: { display: "flex", justifyContent: "space-between", gap: 12, marginBottom: 7, opacity: 0.62, fontSize: 12 },
|
|
26306
|
+
messageText: { whiteSpace: "pre-wrap", overflowWrap: "anywhere", lineHeight: 1.65, fontSize: 14 },
|
|
26307
|
+
detailMeta: { margin: "8px 0 0", opacity: 0.68, lineHeight: 1.7, overflowWrap: "anywhere" }
|
|
26308
|
+
});
|
|
26309
|
+
function formatTime(value) {
|
|
26310
|
+
if (!Number.isFinite(value)) return "";
|
|
26311
|
+
try {
|
|
26312
|
+
const locale = imLocale();
|
|
26313
|
+
const tag = locale === "zh" ? "zh-CN" : locale === "ru" ? "ru-RU" : "en-US";
|
|
26314
|
+
return new Date(value).toLocaleString(tag, { hour12: false });
|
|
26315
|
+
} catch {
|
|
26316
|
+
return "";
|
|
26317
|
+
}
|
|
26318
|
+
}
|
|
26319
|
+
function text8(value) {
|
|
26320
|
+
return String(value == null ? "" : value);
|
|
26321
|
+
}
|
|
26322
|
+
function errorText(error) {
|
|
26323
|
+
return error instanceof Error ? error.message : text8(error);
|
|
26324
|
+
}
|
|
26325
|
+
async function copyText2(value) {
|
|
26326
|
+
if (globalThis.navigator?.clipboard?.writeText) {
|
|
26327
|
+
await globalThis.navigator.clipboard.writeText(value);
|
|
26328
|
+
return;
|
|
26329
|
+
}
|
|
26330
|
+
const area = document.createElement("textarea");
|
|
26331
|
+
area.value = value;
|
|
26332
|
+
area.style.position = "fixed";
|
|
26333
|
+
area.style.opacity = "0";
|
|
26334
|
+
document.body.appendChild(area);
|
|
26335
|
+
area.select();
|
|
26336
|
+
const copied = document.execCommand("copy");
|
|
26337
|
+
area.remove();
|
|
26338
|
+
if (!copied) throw new Error("\u6D4F\u89C8\u5668\u672A\u5141\u8BB8\u8BBF\u95EE\u526A\u8D34\u677F");
|
|
26339
|
+
}
|
|
26340
|
+
var ChannelListPage = class extends React49.Component {
|
|
26341
|
+
constructor(props) {
|
|
26342
|
+
super(props);
|
|
26343
|
+
this.state = {
|
|
26344
|
+
channels: null,
|
|
26345
|
+
error: null,
|
|
26346
|
+
refreshing: false,
|
|
26347
|
+
copyStatus: null,
|
|
26348
|
+
selected: null,
|
|
26349
|
+
detail: null,
|
|
26350
|
+
detailError: null,
|
|
26351
|
+
detailLoading: false,
|
|
26352
|
+
loadingEarlier: false
|
|
26353
|
+
};
|
|
26354
|
+
this.reload = this.reload.bind(this);
|
|
26355
|
+
this.openSession = this.openSession.bind(this);
|
|
26356
|
+
this.backToList = this.backToList.bind(this);
|
|
26357
|
+
this.loadEarlier = this.loadEarlier.bind(this);
|
|
26358
|
+
this.copySession = this.copySession.bind(this);
|
|
26359
|
+
this.unmounted = false;
|
|
26360
|
+
this.request = null;
|
|
26361
|
+
this.detailRequest = null;
|
|
26362
|
+
this.copyTimer = null;
|
|
26363
|
+
}
|
|
26364
|
+
componentDidMount() {
|
|
26365
|
+
void this.reload();
|
|
26366
|
+
}
|
|
26367
|
+
componentWillUnmount() {
|
|
26368
|
+
this.unmounted = true;
|
|
26369
|
+
this.request?.abort();
|
|
26370
|
+
this.detailRequest?.abort();
|
|
26371
|
+
if (this.copyTimer) clearTimeout(this.copyTimer);
|
|
26372
|
+
}
|
|
26373
|
+
rpc(method, payload, signal) {
|
|
26374
|
+
const call = this.props.channelListRpcCall || ((endpoint, body, rpcSignal) => callManagementRpc(this.props.ctx.connection, CHANNEL_LIST_RPC_CHANNEL, endpoint, body, rpcSignal));
|
|
26375
|
+
return call(method, payload, signal);
|
|
26376
|
+
}
|
|
26377
|
+
async reload() {
|
|
26378
|
+
this.request?.abort();
|
|
26379
|
+
const controller = new AbortController();
|
|
26380
|
+
this.request = controller;
|
|
26381
|
+
this.setState({ refreshing: true, error: null });
|
|
26382
|
+
try {
|
|
26383
|
+
const result2 = await this.rpc("list.channels", {}, controller.signal);
|
|
26384
|
+
if (controller.signal.aborted) return;
|
|
26385
|
+
if (!result2 || result2.ok !== true) {
|
|
26386
|
+
throw new Error(result2?.error?.message || result2?.error?.code || "failed to list channels");
|
|
26387
|
+
}
|
|
26388
|
+
if (!Array.isArray(result2.value?.channels)) {
|
|
26389
|
+
throw new Error("\u5BBF\u4E3B\u54CD\u5E94\u7F3A\u5C11 value.channels\uFF0C\u8BF7\u68C0\u67E5 dsh-im host \u662F\u5426\u5DF2\u91CD\u8F7D");
|
|
26390
|
+
}
|
|
26391
|
+
if (!this.unmounted) this.setState({ channels: result2.value.channels });
|
|
26392
|
+
} catch (error) {
|
|
26393
|
+
if (controller.signal.aborted || this.unmounted) return;
|
|
26394
|
+
this.setState({ channels: null, error: errorText(error) });
|
|
26395
|
+
} finally {
|
|
26396
|
+
if (this.request === controller) {
|
|
26397
|
+
this.request = null;
|
|
26398
|
+
if (!this.unmounted) this.setState({ refreshing: false });
|
|
26399
|
+
}
|
|
26400
|
+
}
|
|
26401
|
+
}
|
|
26402
|
+
async openSession(group, row) {
|
|
26403
|
+
const selected = {
|
|
26404
|
+
channel: group.channel,
|
|
26405
|
+
key: text8(row.key),
|
|
26406
|
+
botId: text8(row.botId),
|
|
26407
|
+
sessionId: text8(row.sessionId)
|
|
26408
|
+
};
|
|
26409
|
+
this.detailRequest?.abort();
|
|
26410
|
+
const controller = new AbortController();
|
|
26411
|
+
this.detailRequest = controller;
|
|
26412
|
+
this.setState({
|
|
26413
|
+
selected,
|
|
26414
|
+
detail: null,
|
|
26415
|
+
detailError: null,
|
|
26416
|
+
detailLoading: true,
|
|
26417
|
+
loadingEarlier: false
|
|
26418
|
+
});
|
|
26419
|
+
try {
|
|
26420
|
+
const result2 = await this.rpc("session.read", selected, controller.signal);
|
|
26421
|
+
if (controller.signal.aborted || this.detailRequest !== controller) return;
|
|
26422
|
+
if (!result2 || result2.ok !== true) {
|
|
26423
|
+
throw new Error(result2?.error?.message || result2?.error?.code || "failed to read session");
|
|
26424
|
+
}
|
|
26425
|
+
if (!Array.isArray(result2.value?.messages)) {
|
|
26426
|
+
throw new Error("\u5BBF\u4E3B\u54CD\u5E94\u7F3A\u5C11 value.messages\uFF0C\u8BF7\u68C0\u67E5 dsh-im host \u662F\u5426\u5DF2\u91CD\u8F7D");
|
|
26427
|
+
}
|
|
26428
|
+
this.setState({ detail: result2.value, detailError: null });
|
|
26429
|
+
} catch (error) {
|
|
26430
|
+
if (controller.signal.aborted || this.unmounted || this.detailRequest !== controller) return;
|
|
26431
|
+
this.setState({ detailError: errorText(error) });
|
|
26432
|
+
} finally {
|
|
26433
|
+
if (this.detailRequest === controller) {
|
|
26434
|
+
this.detailRequest = null;
|
|
26435
|
+
if (!this.unmounted) this.setState({ detailLoading: false });
|
|
26436
|
+
}
|
|
26437
|
+
}
|
|
26438
|
+
}
|
|
26439
|
+
backToList() {
|
|
26440
|
+
this.detailRequest?.abort();
|
|
26441
|
+
this.detailRequest = null;
|
|
26442
|
+
this.setState({
|
|
26443
|
+
selected: null,
|
|
26444
|
+
detail: null,
|
|
26445
|
+
detailError: null,
|
|
26446
|
+
detailLoading: false,
|
|
26447
|
+
loadingEarlier: false
|
|
26448
|
+
});
|
|
26449
|
+
}
|
|
26450
|
+
async loadEarlier() {
|
|
26451
|
+
const { selected, detail } = this.state;
|
|
26452
|
+
if (!selected || !detail?.hasMore || this.detailRequest) return;
|
|
26453
|
+
const controller = new AbortController();
|
|
26454
|
+
this.detailRequest = controller;
|
|
26455
|
+
this.setState({ loadingEarlier: true, detailError: null });
|
|
26456
|
+
try {
|
|
26457
|
+
const result2 = await this.rpc("session.read", {
|
|
26458
|
+
...selected,
|
|
26459
|
+
offset: detail.nextOffset,
|
|
26460
|
+
limit: detail.limit
|
|
26461
|
+
}, controller.signal);
|
|
26462
|
+
if (controller.signal.aborted || this.detailRequest !== controller) return;
|
|
26463
|
+
if (!result2 || result2.ok !== true) {
|
|
26464
|
+
throw new Error(result2?.error?.message || result2?.error?.code || "failed to read earlier messages");
|
|
26465
|
+
}
|
|
26466
|
+
if (!Array.isArray(result2.value?.messages)) throw new Error("\u5BBF\u4E3B\u54CD\u5E94\u7F3A\u5C11 value.messages");
|
|
26467
|
+
const earlier = result2.value;
|
|
26468
|
+
this.setState((previous) => {
|
|
26469
|
+
if (!previous.detail) return null;
|
|
26470
|
+
const prependCount = Math.max(0, previous.detail.offset - earlier.offset);
|
|
26471
|
+
return {
|
|
26472
|
+
detail: {
|
|
26473
|
+
...previous.detail,
|
|
26474
|
+
offset: earlier.offset,
|
|
26475
|
+
hasMore: earlier.hasMore,
|
|
26476
|
+
nextOffset: earlier.nextOffset,
|
|
26477
|
+
messages: [
|
|
26478
|
+
...earlier.messages.slice(0, prependCount),
|
|
26479
|
+
...previous.detail.messages
|
|
26480
|
+
]
|
|
26481
|
+
}
|
|
26482
|
+
};
|
|
26483
|
+
});
|
|
26484
|
+
} catch (error) {
|
|
26485
|
+
if (controller.signal.aborted || this.unmounted || this.detailRequest !== controller) return;
|
|
26486
|
+
this.setState({ detailError: errorText(error) });
|
|
26487
|
+
} finally {
|
|
26488
|
+
if (this.detailRequest === controller) {
|
|
26489
|
+
this.detailRequest = null;
|
|
26490
|
+
if (!this.unmounted) this.setState({ loadingEarlier: false });
|
|
26491
|
+
}
|
|
26492
|
+
}
|
|
26493
|
+
}
|
|
26494
|
+
async copySession(sessionId) {
|
|
26495
|
+
try {
|
|
26496
|
+
await copyText2(sessionId);
|
|
26497
|
+
if (!this.unmounted) this.setState({ copyStatus: { sessionId, ok: true } });
|
|
26498
|
+
} catch {
|
|
26499
|
+
if (!this.unmounted) this.setState({ copyStatus: { sessionId, ok: false } });
|
|
26500
|
+
}
|
|
26501
|
+
if (this.copyTimer) clearTimeout(this.copyTimer);
|
|
26502
|
+
this.copyTimer = setTimeout(() => {
|
|
26503
|
+
if (!this.unmounted) this.setState({ copyStatus: null });
|
|
26504
|
+
}, 1800);
|
|
26505
|
+
}
|
|
26506
|
+
renderRow(group, row) {
|
|
26507
|
+
const sessionId = text8(row.sessionId);
|
|
26508
|
+
const status = this.state.copyStatus?.sessionId === sessionId ? this.state.copyStatus : null;
|
|
26509
|
+
return h2(
|
|
26510
|
+
"tr",
|
|
26511
|
+
{ key: `${group.channel}:${row.botId}:${row.key}:${sessionId}` },
|
|
26512
|
+
h2(
|
|
26513
|
+
"td",
|
|
26514
|
+
{ style: styles.td },
|
|
26515
|
+
h2("code", { style: styles.code }, text8(row.key)),
|
|
26516
|
+
h2("span", { style: styles.secondary }, `bot\uFF1A${text8(row.botId)}`)
|
|
26517
|
+
),
|
|
26518
|
+
h2(
|
|
26519
|
+
"td",
|
|
26520
|
+
{ style: styles.td },
|
|
26521
|
+
h2("button", {
|
|
26522
|
+
type: "button",
|
|
26523
|
+
style: { ...styles.button, ...styles.code, padding: "4px 6px", textAlign: "left" },
|
|
26524
|
+
className: "im-channel-session-open",
|
|
26525
|
+
onClick: () => {
|
|
26526
|
+
void this.openSession(group, row);
|
|
26527
|
+
},
|
|
26528
|
+
"aria-label": localizeTemplate("\u67E5\u770B\u4F1A\u8BDD {sessionId}", { sessionId }),
|
|
26529
|
+
title: "\u67E5\u770B\u8BE5\u4F1A\u8BDD\u7684\u7528\u6237\u4E0E\u52A9\u624B\u6B63\u6587"
|
|
26530
|
+
}, sessionId)
|
|
26531
|
+
),
|
|
26532
|
+
h2(
|
|
26533
|
+
"td",
|
|
26534
|
+
{ style: { ...styles.td, width: 88 } },
|
|
26535
|
+
h2("button", {
|
|
26536
|
+
type: "button",
|
|
26537
|
+
style: styles.button,
|
|
26538
|
+
className: "im-channel-session-copy",
|
|
26539
|
+
onClick: () => {
|
|
26540
|
+
void this.copySession(sessionId);
|
|
26541
|
+
},
|
|
26542
|
+
"aria-label": localizeTemplate("\u590D\u5236\u4F1A\u8BDD ID {sessionId}", { sessionId })
|
|
26543
|
+
}, status ? status.ok ? "\u5DF2\u590D\u5236" : "\u590D\u5236\u5931\u8D25" : "\u590D\u5236 ID")
|
|
26544
|
+
)
|
|
26545
|
+
);
|
|
26546
|
+
}
|
|
26547
|
+
renderGroup(group) {
|
|
26548
|
+
const label = CHANNEL_LABELS[group.channel] || group.channel;
|
|
26549
|
+
const rows = Array.isArray(group.sessions) ? group.sessions : [];
|
|
26550
|
+
return h2(
|
|
26551
|
+
"section",
|
|
26552
|
+
{ key: group.channel, className: "im-channel-group", style: styles.group },
|
|
26553
|
+
h2(
|
|
26554
|
+
"h2",
|
|
26555
|
+
{ style: styles.groupTitle },
|
|
26556
|
+
label,
|
|
26557
|
+
group.channel === label ? null : h2("span", { style: styles.count }, group.channel),
|
|
26558
|
+
h2("span", { style: styles.count }, localizeTemplate("{count} \u4E2A\u4F1A\u8BDD", { count: rows.length }))
|
|
26559
|
+
),
|
|
26560
|
+
h2(
|
|
26561
|
+
"div",
|
|
26562
|
+
{ style: styles.tableWrap },
|
|
26563
|
+
h2(
|
|
26564
|
+
"table",
|
|
26565
|
+
{ style: styles.table },
|
|
26566
|
+
h2("thead", null, h2(
|
|
26567
|
+
"tr",
|
|
26568
|
+
null,
|
|
26569
|
+
h2("th", { style: styles.th }, "\u901A\u9053 / \u4F1A\u8BDD\u952E"),
|
|
26570
|
+
h2("th", { style: styles.th }, "DSH \u4F1A\u8BDD ID"),
|
|
26571
|
+
h2("th", { style: styles.th }, "\u64CD\u4F5C")
|
|
26572
|
+
)),
|
|
26573
|
+
h2("tbody", null, rows.map((row) => this.renderRow(group, row)))
|
|
26574
|
+
)
|
|
26575
|
+
)
|
|
26576
|
+
);
|
|
26577
|
+
}
|
|
26578
|
+
renderMessage(message) {
|
|
26579
|
+
const role = message.role === "user" ? "\u7528\u6237" : "\u52A9\u624B";
|
|
26580
|
+
const time = formatTime(message.time);
|
|
26581
|
+
return h2(
|
|
26582
|
+
"article",
|
|
26583
|
+
{
|
|
26584
|
+
key: message.id || `${message.seq}:${message.role}`,
|
|
26585
|
+
className: `im-channel-message im-channel-message-${message.role}`,
|
|
26586
|
+
style: { ...styles.message, ...message.role === "user" ? styles.userMessage : null }
|
|
26587
|
+
},
|
|
26588
|
+
h2(
|
|
26589
|
+
"div",
|
|
26590
|
+
{ style: styles.messageMeta },
|
|
26591
|
+
h2("strong", null, role),
|
|
26592
|
+
h2("span", null, time || (Number.isInteger(message.seq) ? localizeTemplate("\u4E8B\u4EF6 {seq}", { seq: message.seq }) : ""))
|
|
26593
|
+
),
|
|
26594
|
+
h2("div", { style: styles.messageText }, text8(message.text)),
|
|
26595
|
+
message.truncated ? h2("div", { style: styles.secondary }, "\u672C\u6761\u6D88\u606F\u8FC7\u957F\uFF0C\u5DF2\u622A\u65AD\u3002") : null
|
|
26596
|
+
);
|
|
26597
|
+
}
|
|
26598
|
+
renderDetail() {
|
|
26599
|
+
const { selected, detail, detailError, detailLoading, loadingEarlier, copyStatus } = this.state;
|
|
26600
|
+
const label = CHANNEL_LABELS[selected.channel] || selected.channel;
|
|
26601
|
+
const copyState = copyStatus?.sessionId === selected.sessionId ? copyStatus : null;
|
|
26602
|
+
let body;
|
|
26603
|
+
if (detailLoading && !detail) {
|
|
26604
|
+
body = h2("p", { style: styles.muted }, "\u52A0\u8F7D\u4E2D\u2026");
|
|
26605
|
+
} else if (!detail) {
|
|
26606
|
+
body = null;
|
|
26607
|
+
} else if (detail.messages.length === 0) {
|
|
26608
|
+
body = h2("p", { style: styles.muted }, "\u6CA1\u6709\u53EF\u663E\u793A\u7684\u7528\u6237\u6216\u52A9\u624B\u6B63\u6587\u3002");
|
|
26609
|
+
} else {
|
|
26610
|
+
body = h2(
|
|
26611
|
+
"div",
|
|
26612
|
+
{ className: "im-channel-message-list", style: styles.messageList },
|
|
26613
|
+
detail.messages.map((message) => this.renderMessage(message))
|
|
26614
|
+
);
|
|
26615
|
+
}
|
|
26616
|
+
return h2(
|
|
26617
|
+
React49.Fragment,
|
|
26618
|
+
null,
|
|
26619
|
+
h2(
|
|
26620
|
+
"header",
|
|
26621
|
+
{ style: { ...styles.header, flexWrap: "wrap" } },
|
|
26622
|
+
h2(
|
|
26623
|
+
"div",
|
|
26624
|
+
null,
|
|
26625
|
+
h2("h1", { style: styles.title }, "\u4F1A\u8BDD\u5185\u5BB9"),
|
|
26626
|
+
h2("p", { style: styles.detailMeta }, `${label} \xB7 ${selected.key}`),
|
|
26627
|
+
h2("code", { style: styles.code }, selected.sessionId),
|
|
26628
|
+
h2("p", { style: styles.description }, "\u53EA\u8BFB\u663E\u793A\u7528\u6237\u4E0E\u52A9\u624B\u6B63\u6587\uFF1B\u7CFB\u7EDF\u63D0\u793A\u3001\u5DE5\u5177\u8C03\u7528\u548C\u5185\u90E8\u63A8\u7406\u4E0D\u663E\u793A\u3002")
|
|
26629
|
+
),
|
|
26630
|
+
h2(
|
|
26631
|
+
"div",
|
|
26632
|
+
{ style: styles.actions },
|
|
26633
|
+
this.renderBackToIm(),
|
|
26634
|
+
h2("button", { type: "button", className: "im-channel-back", style: styles.button, onClick: this.backToList }, "\u8FD4\u56DE\u5217\u8868"),
|
|
26635
|
+
h2("button", {
|
|
26636
|
+
type: "button",
|
|
26637
|
+
className: "im-channel-detail-refresh",
|
|
26638
|
+
style: styles.button,
|
|
26639
|
+
disabled: detailLoading || loadingEarlier,
|
|
26640
|
+
onClick: () => {
|
|
26641
|
+
void this.openSession(selected, selected);
|
|
26642
|
+
}
|
|
26643
|
+
}, detailLoading ? "\u5237\u65B0\u4E2D\u2026" : "\u5237\u65B0"),
|
|
26644
|
+
h2("button", {
|
|
26645
|
+
type: "button",
|
|
26646
|
+
className: "im-channel-detail-copy",
|
|
26647
|
+
style: styles.button,
|
|
26648
|
+
onClick: () => {
|
|
26649
|
+
void this.copySession(selected.sessionId);
|
|
26650
|
+
}
|
|
26651
|
+
}, copyState ? copyState.ok ? "\u5DF2\u590D\u5236" : "\u590D\u5236\u5931\u8D25" : "\u590D\u5236 ID")
|
|
26652
|
+
)
|
|
26653
|
+
),
|
|
26654
|
+
detailError ? h2(
|
|
26655
|
+
"div",
|
|
26656
|
+
{ role: "alert", style: styles.error },
|
|
26657
|
+
localizeTemplate("\u8BFB\u53D6\u5931\u8D25\uFF1A{error}", { error: localizeText(detailError) })
|
|
26658
|
+
) : null,
|
|
26659
|
+
detail ? h2(
|
|
26660
|
+
"div",
|
|
26661
|
+
{ style: { marginBottom: 12 } },
|
|
26662
|
+
h2(
|
|
26663
|
+
"p",
|
|
26664
|
+
{ style: { ...styles.description, margin: "0 0 10px" } },
|
|
26665
|
+
localizeTemplate("\u5DF2\u663E\u793A {shown} / {total} \u6761\u6B63\u6587", {
|
|
26666
|
+
shown: detail.messages.length,
|
|
26667
|
+
total: detail.total
|
|
26668
|
+
})
|
|
26669
|
+
),
|
|
26670
|
+
detail.hasMore ? h2("button", {
|
|
26671
|
+
type: "button",
|
|
26672
|
+
className: "im-channel-load-earlier",
|
|
26673
|
+
style: styles.button,
|
|
26674
|
+
onClick: this.loadEarlier,
|
|
26675
|
+
disabled: loadingEarlier
|
|
26676
|
+
}, loadingEarlier ? "\u52A0\u8F7D\u4E2D\u2026" : "\u52A0\u8F7D\u66F4\u65E9\u6D88\u606F") : null
|
|
26677
|
+
) : null,
|
|
26678
|
+
body
|
|
26679
|
+
);
|
|
26680
|
+
}
|
|
26681
|
+
renderBackToIm() {
|
|
26682
|
+
return this.props.onBackToIm ? h2("button", {
|
|
26683
|
+
type: "button",
|
|
26684
|
+
className: "im-channel-back-to-im",
|
|
26685
|
+
style: styles.button,
|
|
26686
|
+
onClick: this.props.onBackToIm
|
|
26687
|
+
}, "\u8FD4\u56DE IM\u673A\u5668\u4EBA") : null;
|
|
26688
|
+
}
|
|
26689
|
+
render() {
|
|
26690
|
+
const { channels, error, refreshing, selected } = this.state;
|
|
26691
|
+
if (selected) {
|
|
26692
|
+
return h2(
|
|
26693
|
+
"div",
|
|
26694
|
+
{ className: "dim-pluginPage im-channel-session-detail" },
|
|
26695
|
+
h2("div", { className: "dim-pluginPageContent" }, this.renderDetail())
|
|
26696
|
+
);
|
|
26697
|
+
}
|
|
26698
|
+
let body;
|
|
26699
|
+
if (error) {
|
|
26700
|
+
body = h2(
|
|
26701
|
+
"div",
|
|
26702
|
+
{ role: "alert", style: styles.error },
|
|
26703
|
+
localizeTemplate("\u52A0\u8F7D\u5931\u8D25\uFF1A{error}", { error: localizeText(error) })
|
|
26704
|
+
);
|
|
26705
|
+
} else if (!channels) {
|
|
26706
|
+
body = h2("p", { style: styles.muted }, "\u6B63\u5728\u8BFB\u53D6\u901A\u9053\u4F1A\u8BDD\u2026");
|
|
26707
|
+
} else if (channels.length === 0) {
|
|
26708
|
+
body = h2("p", { style: styles.muted }, "\u5C1A\u672A\u53D1\u73B0\u5DF2\u7ED1\u5B9A DSH \u4F1A\u8BDD\u7684\u901A\u9053\u3002");
|
|
26709
|
+
} else {
|
|
26710
|
+
body = channels.map((group) => this.renderGroup(group));
|
|
26711
|
+
}
|
|
26712
|
+
return h2(
|
|
26713
|
+
"div",
|
|
26714
|
+
{ className: "dim-pluginPage im-channel-sessions-page" },
|
|
26715
|
+
h2(
|
|
26716
|
+
"div",
|
|
26717
|
+
{ className: "dim-pluginPageContent" },
|
|
26718
|
+
h2(
|
|
26719
|
+
"header",
|
|
26720
|
+
{ style: { ...styles.header, flexWrap: "wrap" } },
|
|
26721
|
+
h2(
|
|
26722
|
+
"div",
|
|
26723
|
+
null,
|
|
26724
|
+
h2("h1", { style: styles.title }, "\u4F1A\u8BDD\u8BB0\u5F55"),
|
|
26725
|
+
h2("p", { style: styles.description }, "\u53EA\u8BFB\u5217\u51FA\u5404 IM \u901A\u9053\u5F53\u524D\u7ED1\u5B9A\u7684 DSH \u4F1A\u8BDD\uFF1B\u70B9\u51FB\u4F1A\u8BDD ID \u67E5\u770B\u6B63\u6587\uFF0C\u4E0D\u4F1A\u4FEE\u6539\u7ED1\u5B9A\u3002")
|
|
26726
|
+
),
|
|
26727
|
+
h2(
|
|
26728
|
+
"div",
|
|
26729
|
+
{ style: styles.actions },
|
|
26730
|
+
this.renderBackToIm(),
|
|
26731
|
+
h2(
|
|
26732
|
+
"button",
|
|
26733
|
+
{ type: "button", className: "im-channel-refresh", style: styles.button, onClick: this.reload, disabled: refreshing },
|
|
26734
|
+
refreshing ? "\u5237\u65B0\u4E2D\u2026" : "\u5237\u65B0"
|
|
26735
|
+
)
|
|
26736
|
+
)
|
|
26737
|
+
),
|
|
26738
|
+
body
|
|
26739
|
+
)
|
|
26740
|
+
);
|
|
26741
|
+
}
|
|
26742
|
+
};
|
|
26743
|
+
function ChannelSessionsPanel(props) {
|
|
26744
|
+
return h2(ChannelListPage, props);
|
|
26745
|
+
}
|
|
26746
|
+
function installChannelSessionsPage(ctx, { channelListRpcCall }) {
|
|
26747
|
+
let navigate = null;
|
|
26748
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
26749
|
+
const publish = (value) => {
|
|
26750
|
+
navigate = value;
|
|
26751
|
+
for (const listener of listeners) listener();
|
|
26752
|
+
};
|
|
26753
|
+
const controller = {
|
|
26754
|
+
available: () => navigate !== null,
|
|
26755
|
+
open: () => navigate?.(),
|
|
26756
|
+
subscribe(listener) {
|
|
26757
|
+
listeners.add(listener);
|
|
26758
|
+
return () => listeners.delete(listener);
|
|
26759
|
+
}
|
|
26760
|
+
};
|
|
26761
|
+
if (typeof ctx.inject === "function") {
|
|
26762
|
+
ctx.inject(["layout"], (pageCtx) => pageCtx.slots.inject("main", () => {
|
|
26763
|
+
const stopMain = pageCtx.slots.register({
|
|
26764
|
+
name: "main",
|
|
26765
|
+
key: CHANNEL_SESSIONS_PANEL_ID,
|
|
26766
|
+
locale: IM_LOCALE_NAMESPACE,
|
|
26767
|
+
inject: () => ({
|
|
26768
|
+
channelListRpcCall,
|
|
26769
|
+
onBackToIm: () => pageCtx.layout.selectPanel(IM_MAIN_PANEL_ID)
|
|
26770
|
+
})
|
|
26771
|
+
}, ChannelSessionsPanel);
|
|
26772
|
+
publish(() => pageCtx.layout.selectPanel(CHANNEL_SESSIONS_PANEL_ID));
|
|
26773
|
+
return () => {
|
|
26774
|
+
publish(null);
|
|
26775
|
+
stopMain();
|
|
26776
|
+
};
|
|
26777
|
+
}));
|
|
26778
|
+
}
|
|
26779
|
+
return controller;
|
|
26780
|
+
}
|
|
26781
|
+
|
|
25721
26782
|
// plugin-src/client/index.js
|
|
25722
26783
|
var name = "im-settings";
|
|
25723
26784
|
var inject = ["slots", "connection", "locale", "workspaces"];
|
|
@@ -25890,32 +26951,34 @@ function IMSettingsTab({
|
|
|
25890
26951
|
deliverySyncRpcCall,
|
|
25891
26952
|
languageRpcCall,
|
|
25892
26953
|
workspaceDirectoryPicker,
|
|
26954
|
+
onOpenSessionHistory,
|
|
25893
26955
|
preferredSectionId,
|
|
25894
26956
|
browserLocation = globalThis.location,
|
|
25895
26957
|
navigateToRecoveryUrl = replacePageLocation
|
|
25896
26958
|
}) {
|
|
25897
|
-
const [selected, setSelected] =
|
|
25898
|
-
const [loopbackRecovery, setLoopbackRecovery] =
|
|
25899
|
-
const [runningVersion, setRunningVersion] =
|
|
25900
|
-
const [deliverySettings, setDeliverySettings] =
|
|
26959
|
+
const [selected, setSelected] = React50.useState(() => preferredSectionId === GLOBAL_SETTINGS_TAB_ID || CHANNELS.some((channel7) => channel7.id === preferredSectionId) ? preferredSectionId : "weixin");
|
|
26960
|
+
const [loopbackRecovery, setLoopbackRecovery] = React50.useState(null);
|
|
26961
|
+
const [runningVersion, setRunningVersion] = React50.useState(IM_PLUGIN_VERSION);
|
|
26962
|
+
const [deliverySettings, setDeliverySettings] = React50.useState(null);
|
|
25901
26963
|
const emailEnabled = useEmailChannelEnabled(emailRpcCall);
|
|
25902
|
-
const visibleChannels =
|
|
26964
|
+
const visibleChannels = React50.useMemo(
|
|
25903
26965
|
() => CHANNELS.filter((channel7) => channel7.id !== "email" || emailEnabled),
|
|
25904
26966
|
[emailEnabled]
|
|
25905
26967
|
);
|
|
25906
|
-
const githubTooltipId =
|
|
25907
|
-
const
|
|
26968
|
+
const githubTooltipId = React50.useId();
|
|
26969
|
+
const sessionHistoryTooltipId = React50.useId();
|
|
26970
|
+
const generalSettingsTooltipId = React50.useId();
|
|
25908
26971
|
const globalSettingsSelected = selected === GLOBAL_SETTINGS_TAB_ID;
|
|
25909
26972
|
const active = visibleChannels.find((channel7) => channel7.id === selected) ?? visibleChannels[0];
|
|
25910
26973
|
const activeTabId = globalSettingsSelected ? "dim-general-settings-trigger" : `dim-tab-${active.id}`;
|
|
25911
26974
|
const activePanelId = globalSettingsSelected ? `dim-panel-${GLOBAL_SETTINGS_TAB_ID}` : `dim-panel-${active.id}`;
|
|
25912
|
-
const reportLoopbackRecovery =
|
|
26975
|
+
const reportLoopbackRecovery = React50.useCallback((recovery) => {
|
|
25913
26976
|
setLoopbackRecovery((current) => current?.url === recovery.url ? current : recovery);
|
|
25914
26977
|
}, []);
|
|
25915
|
-
const reportUpdateStatus =
|
|
26978
|
+
const reportUpdateStatus = React50.useCallback((snapshot) => {
|
|
25916
26979
|
setRunningVersion(snapshot.runningVersion);
|
|
25917
26980
|
}, []);
|
|
25918
|
-
const rpcCalls =
|
|
26981
|
+
const rpcCalls = React50.useMemo(() => createLoopbackAwareRpcCalls({
|
|
25919
26982
|
dingtalkRpcCall,
|
|
25920
26983
|
discordRpcCall,
|
|
25921
26984
|
feishuRpcCall,
|
|
@@ -25960,7 +27023,7 @@ function IMSettingsTab({
|
|
|
25960
27023
|
weixinRpcCall,
|
|
25961
27024
|
whatsappRpcCall
|
|
25962
27025
|
]);
|
|
25963
|
-
const botSettingsContext =
|
|
27026
|
+
const botSettingsContext = React50.useMemo(() => Object.freeze({
|
|
25964
27027
|
openBotSettings: setDeliverySettings
|
|
25965
27028
|
}), []);
|
|
25966
27029
|
return h2(
|
|
@@ -26021,6 +27084,38 @@ function IMSettingsTab({
|
|
|
26021
27084
|
role: "tooltip"
|
|
26022
27085
|
}, "\u5E2E\u52A9\u4E0E\u53CD\u9988 \xB7 \u524D\u5F80 GitHub")
|
|
26023
27086
|
),
|
|
27087
|
+
onOpenSessionHistory ? h2(
|
|
27088
|
+
"span",
|
|
27089
|
+
{ className: "dim-sessionHistoryAction" },
|
|
27090
|
+
h2("button", {
|
|
27091
|
+
type: "button",
|
|
27092
|
+
className: "dim-sessionHistoryButton",
|
|
27093
|
+
"aria-label": "\u4F1A\u8BDD\u8BB0\u5F55",
|
|
27094
|
+
"aria-describedby": sessionHistoryTooltipId,
|
|
27095
|
+
onClick: onOpenSessionHistory
|
|
27096
|
+
}, h2(
|
|
27097
|
+
"svg",
|
|
27098
|
+
{
|
|
27099
|
+
width: 18,
|
|
27100
|
+
height: 18,
|
|
27101
|
+
viewBox: "0 0 24 24",
|
|
27102
|
+
fill: "none",
|
|
27103
|
+
stroke: "currentColor",
|
|
27104
|
+
strokeWidth: 2,
|
|
27105
|
+
strokeLinecap: "round",
|
|
27106
|
+
strokeLinejoin: "round",
|
|
27107
|
+
focusable: "false",
|
|
27108
|
+
"aria-hidden": "true"
|
|
27109
|
+
},
|
|
27110
|
+
h2("path", { d: "M21 15a3 3 0 0 1-3 3H7l-4 3V6a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3Z" }),
|
|
27111
|
+
h2("path", { d: "M8 8h8M8 12h5" })
|
|
27112
|
+
)),
|
|
27113
|
+
h2("span", {
|
|
27114
|
+
id: sessionHistoryTooltipId,
|
|
27115
|
+
className: "dim-sessionHistoryTooltip",
|
|
27116
|
+
role: "tooltip"
|
|
27117
|
+
}, "\u4F1A\u8BDD\u8BB0\u5F55")
|
|
27118
|
+
) : null,
|
|
26024
27119
|
h2(
|
|
26025
27120
|
"span",
|
|
26026
27121
|
{ className: "dim-generalSettingsAction" },
|
|
@@ -26187,6 +27282,7 @@ function apply(ctx) {
|
|
|
26187
27282
|
const globalSettingsRpcCall = (endpoint, payload, signal) => managementRpc(ctx.connection, Object.values(SIDEBAR_SETTINGS_ENDPOINTS).includes(endpoint) ? SIDEBAR_SETTINGS_RPC_CHANNEL : GLOBAL_SETTINGS_RPC_CHANNEL, endpoint, payload, signal);
|
|
26188
27283
|
const deliverySyncRpcCall = (endpoint, payload, signal) => managementRpc(ctx.connection, DELIVERY_SYNC_SETTINGS_RPC_CHANNEL, endpoint, payload, signal);
|
|
26189
27284
|
const languageRpcCall = (endpoint, payload, signal) => managementRpc(ctx.connection, HOST_LANGUAGE_RPC_CHANNEL, endpoint, payload, signal);
|
|
27285
|
+
const channelListRpcCall = (endpoint, payload, signal) => managementRpc(ctx.connection, CHANNEL_LIST_RPC_CHANNEL, endpoint, payload, signal);
|
|
26190
27286
|
const workspaceDirectoryPicker = Object.freeze({
|
|
26191
27287
|
listDirectory: (path, signal) => callWorkspaceDirectoryApi(ctx, "listDirectory", path, signal),
|
|
26192
27288
|
pickDirectory: () => callWorkspaceDirectoryApi(ctx, "pickDirectory")
|
|
@@ -26211,17 +27307,27 @@ function apply(ctx) {
|
|
|
26211
27307
|
globalSettingsRpcCall,
|
|
26212
27308
|
languageRpcCall,
|
|
26213
27309
|
deliverySyncRpcCall,
|
|
27310
|
+
channelListRpcCall,
|
|
26214
27311
|
workspaceDirectoryPicker
|
|
26215
27312
|
};
|
|
26216
27313
|
const subscribeLocale = (listener) => typeof ctx.on === "function" ? ctx.on("locale/change", listener) : () => {
|
|
26217
27314
|
};
|
|
26218
27315
|
const localeSnapshot = () => ctx.locale.getLocale?.()?.active ?? "";
|
|
26219
27316
|
function IMPanel({ preferredSectionId }) {
|
|
26220
|
-
|
|
27317
|
+
React50.useSyncExternalStore(subscribeLocale, localeSnapshot, localeSnapshot);
|
|
27318
|
+
const historyAvailable = React50.useSyncExternalStore(
|
|
27319
|
+
channelSessionsPage.subscribe,
|
|
27320
|
+
channelSessionsPage.available,
|
|
27321
|
+
channelSessionsPage.available
|
|
27322
|
+
);
|
|
26221
27323
|
return h2(
|
|
26222
27324
|
IMPanelErrorBoundary,
|
|
26223
27325
|
null,
|
|
26224
|
-
h2(IMSettingsTab, {
|
|
27326
|
+
h2(IMSettingsTab, {
|
|
27327
|
+
...panelDependencies,
|
|
27328
|
+
preferredSectionId,
|
|
27329
|
+
onOpenSessionHistory: historyAvailable ? channelSessionsPage.open : void 0
|
|
27330
|
+
})
|
|
26225
27331
|
);
|
|
26226
27332
|
}
|
|
26227
27333
|
const buildPanelElement = (props = {}) => h2(IMPanel, {
|
|
@@ -26231,6 +27337,7 @@ function apply(ctx) {
|
|
|
26231
27337
|
packageName: package_default.name,
|
|
26232
27338
|
renderPanel: buildPanelElement
|
|
26233
27339
|
});
|
|
27340
|
+
const channelSessionsPage = installChannelSessionsPage(ctx, { channelListRpcCall });
|
|
26234
27341
|
ctx.effect(() => {
|
|
26235
27342
|
sidebarSync = installSidebarVisibilitySync({
|
|
26236
27343
|
rpcCall: (endpoint, payload, signal) => callManagementRpc(ctx.connection, SIDEBAR_SETTINGS_RPC_CHANNEL, endpoint, payload, signal),
|