@botharness/im-provider 4.32.0-botharness.3
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/LICENSE +21 -0
- package/PROVENANCE.json +25 -0
- package/README.en.md +445 -0
- package/README.md +448 -0
- package/THIRD_PARTY_NOTICES.md +93 -0
- package/assets/dingtalk-menu-template.json +6 -0
- package/assets/logo-dsh-im-chinese-readme-3x2.png +0 -0
- package/assets/logo-dsh-im-connecting-readme-3x2.png +0 -0
- package/assets/logo-dsh-im-connecting-square-v4.png +0 -0
- package/assets/logo-icon.png +0 -0
- package/assets/logo-plugin-message-link-gradient.webp +0 -0
- package/assets/logo-plugin-phone.png +0 -0
- package/assets/logo.png +0 -0
- package/assets/logo_cn.png +0 -0
- package/assets/screenshot-menu-card.png +0 -0
- package/cordis.patch.yml +3 -0
- package/lib/client.js +20330 -0
- package/lib/index.js +602 -0
- package/locale/en.json +5 -0
- package/locale/zh.json +5 -0
- package/package.json +181 -0
- package/plugin-src/client/access-policy-settings.js +362 -0
- package/plugin-src/client/agent-preset.js +119 -0
- package/plugin-src/client/bot-alias.js +169 -0
- package/plugin-src/client/build.mjs +38 -0
- package/plugin-src/client/channel-card-meta.js +132 -0
- package/plugin-src/client/channel-logos.js +190 -0
- package/plugin-src/client/channels/dingtalk/api.js +267 -0
- package/plugin-src/client/channels/dingtalk/index.js +954 -0
- package/plugin-src/client/channels/dingtalk/styles.js +136 -0
- package/plugin-src/client/channels/discord/api.js +11 -0
- package/plugin-src/client/channels/discord/index.js +25 -0
- package/plugin-src/client/channels/discord/styles.js +19 -0
- package/plugin-src/client/channels/email/api.js +52 -0
- package/plugin-src/client/channels/email/index.js +728 -0
- package/plugin-src/client/channels/email/styles.js +51 -0
- package/plugin-src/client/channels/feishu/api.js +405 -0
- package/plugin-src/client/channels/feishu/group-settings.js +581 -0
- package/plugin-src/client/channels/feishu/index.js +1583 -0
- package/plugin-src/client/channels/feishu/slash-panel-settings.js +322 -0
- package/plugin-src/client/channels/feishu/styles.js +573 -0
- package/plugin-src/client/channels/feishu/voice-editor.js +115 -0
- package/plugin-src/client/channels/feishu/voice-settings.js +71 -0
- package/plugin-src/client/channels/imessage/api.js +12 -0
- package/plugin-src/client/channels/imessage/index.js +46 -0
- package/plugin-src/client/channels/imessage/styles.js +19 -0
- package/plugin-src/client/channels/matrix/api.js +11 -0
- package/plugin-src/client/channels/matrix/index.js +151 -0
- package/plugin-src/client/channels/matrix/styles.js +36 -0
- package/plugin-src/client/channels/office/api.js +46 -0
- package/plugin-src/client/channels/office/index.js +153 -0
- package/plugin-src/client/channels/office/styles.js +50 -0
- package/plugin-src/client/channels/qq/api.js +171 -0
- package/plugin-src/client/channels/qq/index.js +593 -0
- package/plugin-src/client/channels/qq/styles.js +19 -0
- package/plugin-src/client/channels/shared/collapsible-account.js +103 -0
- package/plugin-src/client/channels/shared/token-api.js +124 -0
- package/plugin-src/client/channels/shared/token-channel.js +495 -0
- package/plugin-src/client/channels/slack/api.js +11 -0
- package/plugin-src/client/channels/slack/index.js +131 -0
- package/plugin-src/client/channels/slack/styles.js +34 -0
- package/plugin-src/client/channels/telegram/api.js +11 -0
- package/plugin-src/client/channels/telegram/index.js +28 -0
- package/plugin-src/client/channels/telegram/styles.js +31 -0
- package/plugin-src/client/channels/telegram/thinking-traces.js +25 -0
- package/plugin-src/client/channels/wecom/api.js +160 -0
- package/plugin-src/client/channels/wecom/index.js +625 -0
- package/plugin-src/client/channels/wecom/styles.js +19 -0
- package/plugin-src/client/channels/wecom-app/api.js +132 -0
- package/plugin-src/client/channels/wecom-app/index.js +634 -0
- package/plugin-src/client/channels/wecom-app/styles.js +25 -0
- package/plugin-src/client/channels/weixin/api.js +211 -0
- package/plugin-src/client/channels/weixin/connection-error.js +1 -0
- package/plugin-src/client/channels/weixin/index.js +801 -0
- package/plugin-src/client/channels/weixin/styles.js +115 -0
- package/plugin-src/client/channels/whatsapp/api.js +152 -0
- package/plugin-src/client/channels/whatsapp/index.js +609 -0
- package/plugin-src/client/channels/whatsapp/styles.js +19 -0
- package/plugin-src/client/connection-error.js +87 -0
- package/plugin-src/client/context-enhancement.js +415 -0
- package/plugin-src/client/credential-binding.js +118 -0
- package/plugin-src/client/delivery-settings.js +905 -0
- package/plugin-src/client/global-settings.js +433 -0
- package/plugin-src/client/i18n.js +1314 -0
- package/plugin-src/client/index.js +624 -0
- package/plugin-src/client/interface-language.js +89 -0
- package/plugin-src/client/last-message-error.js +18 -0
- package/plugin-src/client/lifecycle.js +86 -0
- package/plugin-src/client/loopback-recovery.js +75 -0
- package/plugin-src/client/model-setting.js +172 -0
- package/plugin-src/client/panel-error-boundary.js +21 -0
- package/plugin-src/client/plugin-page.js +51 -0
- package/plugin-src/client/session-channel-logos.js +243 -0
- package/plugin-src/client/styles.js +770 -0
- package/plugin-src/client/update-panel.js +14 -0
- package/plugin-src/client/workspace-directory-picker.js +280 -0
- package/plugin-src/client/workspace-editor.js +69 -0
- package/plugin-src/client/workspace-snapshot-fence.js +28 -0
- package/plugin-src/host/build.mjs +52 -0
- package/plugin-src/host/channels/dingtalk/connection-supervisor.mjs +130 -0
- package/plugin-src/host/channels/dingtalk/index.mjs +35 -0
- package/plugin-src/host/channels/dingtalk/production.mjs +193 -0
- package/plugin-src/host/channels/dingtalk/rpc.mjs +359 -0
- package/plugin-src/host/channels/discord/index.mjs +33 -0
- package/plugin-src/host/channels/discord/production.mjs +17 -0
- package/plugin-src/host/channels/discord/rpc.mjs +21 -0
- package/plugin-src/host/channels/email/availability.mjs +60 -0
- package/plugin-src/host/channels/email/index.mjs +36 -0
- package/plugin-src/host/channels/email/production.mjs +58 -0
- package/plugin-src/host/channels/email/rpc.mjs +163 -0
- package/plugin-src/host/channels/feishu/connection-supervisor.mjs +167 -0
- package/plugin-src/host/channels/feishu/controller.mjs +172 -0
- package/plugin-src/host/channels/feishu/credential-store.mjs +84 -0
- package/plugin-src/host/channels/feishu/index.mjs +69 -0
- package/plugin-src/host/channels/feishu/production.mjs +318 -0
- package/plugin-src/host/channels/feishu/rpc.mjs +863 -0
- package/plugin-src/host/channels/imessage/index.mjs +21 -0
- package/plugin-src/host/channels/imessage/production.mjs +13 -0
- package/plugin-src/host/channels/imessage/rpc.mjs +78 -0
- package/plugin-src/host/channels/matrix/index.mjs +31 -0
- package/plugin-src/host/channels/matrix/production.mjs +241 -0
- package/plugin-src/host/channels/matrix/rpc.mjs +228 -0
- package/plugin-src/host/channels/office/index.mjs +14 -0
- package/plugin-src/host/channels/office/production.mjs +45 -0
- package/plugin-src/host/channels/office/rpc.mjs +51 -0
- package/plugin-src/host/channels/qq/connection-supervisor.mjs +124 -0
- package/plugin-src/host/channels/qq/index.mjs +28 -0
- package/plugin-src/host/channels/qq/production.mjs +181 -0
- package/plugin-src/host/channels/qq/rpc.mjs +250 -0
- package/plugin-src/host/channels/shared/access-policy-production.mjs +137 -0
- package/plugin-src/host/channels/shared/access-policy-rpc.mjs +17 -0
- package/plugin-src/host/channels/shared/agent-preset-rpc.mjs +25 -0
- package/plugin-src/host/channels/shared/bot-alias-rpc.mjs +15 -0
- package/plugin-src/host/channels/shared/connection-supervisor.mjs +133 -0
- package/plugin-src/host/channels/shared/context-enhancement-rpc.mjs +17 -0
- package/plugin-src/host/channels/shared/model-setting-rpc.mjs +18 -0
- package/plugin-src/host/channels/shared/production.mjs +237 -0
- package/plugin-src/host/channels/shared/rpc.mjs +226 -0
- package/plugin-src/host/channels/shared/startup-error.mjs +55 -0
- package/plugin-src/host/channels/shared/startup.mjs +76 -0
- package/plugin-src/host/channels/shared/thinking-traces-rpc.mjs +11 -0
- package/plugin-src/host/channels/shared/workspace-rpc.mjs +31 -0
- package/plugin-src/host/channels/slack/index.mjs +31 -0
- package/plugin-src/host/channels/slack/production.mjs +176 -0
- package/plugin-src/host/channels/slack/rpc.mjs +221 -0
- package/plugin-src/host/channels/telegram/index.mjs +33 -0
- package/plugin-src/host/channels/telegram/production.mjs +19 -0
- package/plugin-src/host/channels/telegram/rpc.mjs +22 -0
- package/plugin-src/host/channels/wecom/connection-supervisor.mjs +124 -0
- package/plugin-src/host/channels/wecom/index.mjs +34 -0
- package/plugin-src/host/channels/wecom/production.mjs +187 -0
- package/plugin-src/host/channels/wecom/rpc.mjs +255 -0
- package/plugin-src/host/channels/wecom-app/index.mjs +33 -0
- package/plugin-src/host/channels/wecom-app/production.mjs +221 -0
- package/plugin-src/host/channels/wecom-app/rpc.mjs +235 -0
- package/plugin-src/host/channels/weixin/connection-supervisor.mjs +139 -0
- package/plugin-src/host/channels/weixin/index.mjs +44 -0
- package/plugin-src/host/channels/weixin/production.mjs +257 -0
- package/plugin-src/host/channels/weixin/rpc.mjs +285 -0
- package/plugin-src/host/channels/whatsapp/index.mjs +33 -0
- package/plugin-src/host/channels/whatsapp/production.mjs +198 -0
- package/plugin-src/host/channels/whatsapp/rpc.mjs +242 -0
- package/plugin-src/host/delivery-adapter.mjs +388 -0
- package/plugin-src/host/delivery-http.mjs +132 -0
- package/plugin-src/host/delivery-rpc.mjs +173 -0
- package/plugin-src/host/delivery-service.mjs +552 -0
- package/plugin-src/host/delivery-suggestions.mjs +198 -0
- package/plugin-src/host/harness-command-executor.mjs +48 -0
- package/plugin-src/host/harness-connection.mjs +20 -0
- package/plugin-src/host/harness-session-coordinator.mjs +183 -0
- package/plugin-src/host/host-language-rpc.mjs +71 -0
- package/plugin-src/host/host-language.mjs +157 -0
- package/plugin-src/host/image-input-rpc.mjs +24 -0
- package/plugin-src/host/inbound-ttl-rpc.mjs +86 -0
- package/plugin-src/host/inbound-ttl-runtime.mjs +85 -0
- package/plugin-src/host/inbound-ttl-service.mjs +179 -0
- package/plugin-src/host/index.mjs +224 -0
- package/plugin-src/host/injected-context.mjs +104 -0
- package/plugin-src/host/lark-sdk-handshake-patch.mjs +181 -0
- package/plugin-src/host/modern-harness-api.mjs +738 -0
- package/plugin-src/host/rpc-authority.mjs +12 -0
- package/plugin-src/host/session-sync-coordinator.mjs +233 -0
- package/plugin-src/host/session-title-prefix.mjs +122 -0
- package/plugin-src/host/update-policy.mjs +31 -0
- package/plugin-src/host/update-rpc.mjs +16 -0
- package/plugin-src/host/update-runtime.mjs +339 -0
- package/plugin-src/host/update-service.mjs +392 -0
- package/plugin-src/management-rpc.mjs +87 -0
- package/src/channels/dingtalk/config-store.mjs +284 -0
- package/src/channels/dingtalk/connection-error.mjs +292 -0
- package/src/channels/dingtalk/device-auth.mjs +240 -0
- package/src/channels/dingtalk/dingtalk-api.mjs +1140 -0
- package/src/channels/dingtalk/dingtalk-bridge.mjs +1889 -0
- package/src/channels/dingtalk/dingtalk-card-stream.mjs +242 -0
- package/src/channels/dingtalk/dingtalk-controller.mjs +852 -0
- package/src/channels/dingtalk/dingtalk-menu.mjs +95 -0
- package/src/channels/dingtalk/dingtalk-runtime.mjs +482 -0
- package/src/channels/dingtalk/harness-client.mjs +19 -0
- package/src/channels/dingtalk/state-store.mjs +325 -0
- package/src/channels/discord/config-store.mjs +25 -0
- package/src/channels/discord/discord-api.mjs +347 -0
- package/src/channels/discord/discord-bridge.mjs +16 -0
- package/src/channels/discord/discord-controller.mjs +16 -0
- package/src/channels/discord/discord-runtime.mjs +974 -0
- package/src/channels/discord/harness-client.mjs +11 -0
- package/src/channels/discord/state-store.mjs +3 -0
- package/src/channels/email/config-store.mjs +194 -0
- package/src/channels/email/email-api.mjs +20 -0
- package/src/channels/email/email-bridge.mjs +17 -0
- package/src/channels/email/email-controller.mjs +824 -0
- package/src/channels/email/email-runtime.mjs +699 -0
- package/src/channels/email/harness-client.mjs +7 -0
- package/src/channels/email/mail-format.mjs +91 -0
- package/src/channels/email/state-store.mjs +176 -0
- package/src/channels/email/transport.mjs +64 -0
- package/src/channels/email/transports/agent-mail.mjs +604 -0
- package/src/channels/email/transports/agently-cli.mjs +288 -0
- package/src/channels/email/transports/imap-smtp.mjs +165 -0
- package/src/channels/feishu/bridge.mjs +6286 -0
- package/src/channels/feishu/config.mjs +71 -0
- package/src/channels/feishu/external-consumer.mjs +77 -0
- package/src/channels/feishu/external-files.mjs +111 -0
- package/src/channels/feishu/feishu-app.mjs +54 -0
- package/src/channels/feishu/feishu-cards.mjs +1285 -0
- package/src/channels/feishu/feishu-channel.mjs +651 -0
- package/src/channels/feishu/feishu-runtime.mjs +950 -0
- package/src/channels/feishu/group-message-permission-manager.mjs +72 -0
- package/src/channels/feishu/group-response-mode.mjs +15 -0
- package/src/channels/feishu/harness-client.mjs +19 -0
- package/src/channels/feishu/history-reader.mjs +77 -0
- package/src/channels/feishu/live-cot.mjs +260 -0
- package/src/channels/feishu/message-utils.mjs +613 -0
- package/src/channels/feishu/multi-bot-controller.mjs +1588 -0
- package/src/channels/feishu/nearby-history.mjs +72 -0
- package/src/channels/feishu/plugin-config-store.mjs +216 -0
- package/src/channels/feishu/plugin-controller.mjs +254 -0
- package/src/channels/feishu/registration-manager.mjs +349 -0
- package/src/channels/feishu/repair-manager.mjs +138 -0
- package/src/channels/feishu/reply-context.mjs +22 -0
- package/src/channels/feishu/slash-command-panel.mjs +155 -0
- package/src/channels/feishu/slash-command-registry.mjs +495 -0
- package/src/channels/feishu/state-store.mjs +214 -0
- package/src/channels/feishu/step-push-mode.mjs +25 -0
- package/src/channels/feishu/voice-config.mjs +34 -0
- package/src/channels/feishu/voice.mjs +134 -0
- package/src/channels/imessage/config-store.mjs +24 -0
- package/src/channels/imessage/controller.mjs +37 -0
- package/src/channels/imessage/harness-client.mjs +7 -0
- package/src/channels/imessage/imessage-api.mjs +194 -0
- package/src/channels/imessage/imessage-bridge.mjs +16 -0
- package/src/channels/imessage/runtime.mjs +102 -0
- package/src/channels/imessage/state-store.mjs +3 -0
- package/src/channels/matrix/matrix-api.mjs +696 -0
- package/src/channels/matrix/matrix-bridge.mjs +20 -0
- package/src/channels/matrix/matrix-config-store.mjs +368 -0
- package/src/channels/matrix/matrix-controller.mjs +404 -0
- package/src/channels/matrix/matrix-crypto-store.mjs +279 -0
- package/src/channels/matrix/matrix-crypto.mjs +1014 -0
- package/src/channels/matrix/matrix-harness-client.mjs +11 -0
- package/src/channels/matrix/matrix-normalize.mjs +357 -0
- package/src/channels/matrix/matrix-rich-text.mjs +313 -0
- package/src/channels/matrix/matrix-room-history.mjs +316 -0
- package/src/channels/matrix/matrix-runtime.mjs +1014 -0
- package/src/channels/office/config-store.mjs +107 -0
- package/src/channels/office/office-controller.mjs +178 -0
- package/src/channels/office/office-job-executor.mjs +391 -0
- package/src/channels/office/office-runtime.mjs +175 -0
- package/src/channels/office/office-transport.mjs +171 -0
- package/src/channels/office/protocol.mjs +43 -0
- package/src/channels/qq/config-store.mjs +173 -0
- package/src/channels/qq/harness-client.mjs +11 -0
- package/src/channels/qq/markdown-reply.mjs +446 -0
- package/src/channels/qq/qq-bridge.mjs +1507 -0
- package/src/channels/qq/qq-controller.mjs +514 -0
- package/src/channels/qq/qq-menu.mjs +208 -0
- package/src/channels/qq/qq-runtime.mjs +303 -0
- package/src/channels/qq/qr-auth.mjs +24 -0
- package/src/channels/qq/state-error.mjs +17 -0
- package/src/channels/qq/state-store.mjs +143 -0
- package/src/channels/shared/access-policy.mjs +210 -0
- package/src/channels/shared/agent-preset.mjs +76 -0
- package/src/channels/shared/batch-input.mjs +229 -0
- package/src/channels/shared/bot-alias.mjs +29 -0
- package/src/channels/shared/bot-workspace-store.mjs +2383 -0
- package/src/channels/shared/command-catalog.mjs +107 -0
- package/src/channels/shared/command-permission.mjs +32 -0
- package/src/channels/shared/compact-command.mjs +109 -0
- package/src/channels/shared/config-read-error.mjs +24 -0
- package/src/channels/shared/connection-error.mjs +191 -0
- package/src/channels/shared/connection-test.mjs +58 -0
- package/src/channels/shared/context-enhancement.mjs +372 -0
- package/src/channels/shared/control-command.mjs +111 -0
- package/src/channels/shared/conversation-state-store.mjs +165 -0
- package/src/channels/shared/default-workspace.mjs +31 -0
- package/src/channels/shared/deferred-delivery-coordinator.mjs +241 -0
- package/src/channels/shared/deferred-delivery.mjs +161 -0
- package/src/channels/shared/deferred-state.mjs +53 -0
- package/src/channels/shared/diagnostic-details.mjs +95 -0
- package/src/channels/shared/editable-message-stream.mjs +100 -0
- package/src/channels/shared/exclusive-inbound-consumers.mjs +71 -0
- package/src/channels/shared/file-download.mjs +64 -0
- package/src/channels/shared/harness-approval.mjs +508 -0
- package/src/channels/shared/harness-client.mjs +2143 -0
- package/src/channels/shared/harness-mux.mjs +123 -0
- package/src/channels/shared/harness-question.mjs +95 -0
- package/src/channels/shared/harness-session-binding.mjs +119 -0
- package/src/channels/shared/history-command.mjs +193 -0
- package/src/channels/shared/i18n-en/diagnostics.mjs +55 -0
- package/src/channels/shared/i18n-en/dingtalk.mjs +81 -0
- package/src/channels/shared/i18n-en/discord.mjs +10 -0
- package/src/channels/shared/i18n-en/email.mjs +25 -0
- package/src/channels/shared/i18n-en/feishu.mjs +404 -0
- package/src/channels/shared/i18n-en/image-input.mjs +18 -0
- package/src/channels/shared/i18n-en/matrix.mjs +85 -0
- package/src/channels/shared/i18n-en/office.mjs +23 -0
- package/src/channels/shared/i18n-en/qq.mjs +96 -0
- package/src/channels/shared/i18n-en/shared-a.mjs +241 -0
- package/src/channels/shared/i18n-en/shared-b.mjs +263 -0
- package/src/channels/shared/i18n-en/shared-c.mjs +203 -0
- package/src/channels/shared/i18n-en/slack.mjs +27 -0
- package/src/channels/shared/i18n-en/telegram.mjs +27 -0
- package/src/channels/shared/i18n-en/wecom-app.mjs +33 -0
- package/src/channels/shared/i18n-en/wecom.mjs +62 -0
- package/src/channels/shared/i18n-en/weixin.mjs +88 -0
- package/src/channels/shared/i18n-en/whatsapp.mjs +17 -0
- package/src/channels/shared/i18n-en.mjs +45 -0
- package/src/channels/shared/i18n.mjs +78 -0
- package/src/channels/shared/im-source-guidance.mjs +65 -0
- package/src/channels/shared/image-input-policy.mjs +35 -0
- package/src/channels/shared/image-input-settings-store.mjs +60 -0
- package/src/channels/shared/image-input.mjs +124 -0
- package/src/channels/shared/image-prompt.mjs +360 -0
- package/src/channels/shared/inbound-access.mjs +43 -0
- package/src/channels/shared/inbound-file.mjs +323 -0
- package/src/channels/shared/inbound-ttl-store.mjs +110 -0
- package/src/channels/shared/inbound-ttl.mjs +22 -0
- package/src/channels/shared/injected-context.mjs +362 -0
- package/src/channels/shared/interface-language-store.mjs +127 -0
- package/src/channels/shared/interface-language.mjs +51 -0
- package/src/channels/shared/message-failure.mjs +257 -0
- package/src/channels/shared/model-command.mjs +741 -0
- package/src/channels/shared/model-setting.mjs +145 -0
- package/src/channels/shared/preset-command.mjs +308 -0
- package/src/channels/shared/semantic/artifact-delivery.mjs +177 -0
- package/src/channels/shared/semantic/artifact.mjs +750 -0
- package/src/channels/shared/semantic/delivery.mjs +193 -0
- package/src/channels/shared/semantic/reply-reference.mjs +148 -0
- package/src/channels/shared/session-binding-lock.mjs +40 -0
- package/src/channels/shared/session-channel-labels.mjs +28 -0
- package/src/channels/shared/session-reply-recovery.mjs +104 -0
- package/src/channels/shared/session-sync-registry.mjs +22 -0
- package/src/channels/shared/session-title.mjs +74 -0
- package/src/channels/shared/status-reaction.mjs +107 -0
- package/src/channels/shared/text-harness-bridge.mjs +1623 -0
- package/src/channels/shared/token-bot-controller.mjs +417 -0
- package/src/channels/shared/token-config-store.mjs +208 -0
- package/src/channels/shared/workspace-command.mjs +532 -0
- package/src/channels/shared/workspace-session.mjs +196 -0
- package/src/channels/slack/config-store.mjs +177 -0
- package/src/channels/slack/external-consumer.mjs +80 -0
- package/src/channels/slack/external-files.mjs +90 -0
- package/src/channels/slack/harness-client.mjs +11 -0
- package/src/channels/slack/history-reader.mjs +203 -0
- package/src/channels/slack/manifest.mjs +37 -0
- package/src/channels/slack/slack-api.mjs +636 -0
- package/src/channels/slack/slack-bridge.mjs +20 -0
- package/src/channels/slack/slack-controller.mjs +468 -0
- package/src/channels/slack/slack-runtime.mjs +879 -0
- package/src/channels/slack/state-store.mjs +3 -0
- package/src/channels/telegram/config-store.mjs +89 -0
- package/src/channels/telegram/harness-client.mjs +11 -0
- package/src/channels/telegram/state-store.mjs +3 -0
- package/src/channels/telegram/telegram-api.mjs +486 -0
- package/src/channels/telegram/telegram-bridge.mjs +81 -0
- package/src/channels/telegram/telegram-controller.mjs +52 -0
- package/src/channels/telegram/telegram-http.mjs +21 -0
- package/src/channels/telegram/telegram-rich-message.mjs +149 -0
- package/src/channels/telegram/telegram-runtime.mjs +1471 -0
- package/src/channels/wecom/config-store.mjs +172 -0
- package/src/channels/wecom/harness-client.mjs +11 -0
- package/src/channels/wecom/qr-auth.mjs +95 -0
- package/src/channels/wecom/send-error.mjs +31 -0
- package/src/channels/wecom/state-store.mjs +107 -0
- package/src/channels/wecom/wecom-bridge.mjs +1833 -0
- package/src/channels/wecom/wecom-cards.mjs +101 -0
- package/src/channels/wecom/wecom-controller.mjs +530 -0
- package/src/channels/wecom/wecom-runtime.mjs +269 -0
- package/src/channels/wecom-app/callback-server.mjs +471 -0
- package/src/channels/wecom-app/config-store.mjs +242 -0
- package/src/channels/wecom-app/harness-client.mjs +11 -0
- package/src/channels/wecom-app/state-store.mjs +107 -0
- package/src/channels/wecom-app/wecom-app-api.mjs +432 -0
- package/src/channels/wecom-app/wecom-app-bridge.mjs +1072 -0
- package/src/channels/wecom-app/wecom-app-controller.mjs +453 -0
- package/src/channels/wecom-app/wecom-app-runtime.mjs +222 -0
- package/src/channels/weixin/config-store.mjs +192 -0
- package/src/channels/weixin/connection-error.en.mjs +137 -0
- package/src/channels/weixin/connection-error.mjs +153 -0
- package/src/channels/weixin/diagnostic-details.mjs +1 -0
- package/src/channels/weixin/harness-client.mjs +19 -0
- package/src/channels/weixin/state-store.mjs +291 -0
- package/src/channels/weixin/weixin-api.mjs +949 -0
- package/src/channels/weixin/weixin-bridge.mjs +1537 -0
- package/src/channels/weixin/weixin-controller.mjs +669 -0
- package/src/channels/weixin/weixin-runtime.mjs +416 -0
- package/src/channels/whatsapp/config-store.mjs +210 -0
- package/src/channels/whatsapp/harness-client.mjs +11 -0
- package/src/channels/whatsapp/state-store.mjs +3 -0
- package/src/channels/whatsapp/whatsapp-bridge.mjs +18 -0
- package/src/channels/whatsapp/whatsapp-controller.mjs +470 -0
- package/src/channels/whatsapp/whatsapp-runtime.mjs +917 -0
- package/src/channels/whatsapp/whatsapp-web-session.mjs +214 -0
|
@@ -0,0 +1,573 @@
|
|
|
1
|
+
export const FEISHU_STYLE_ID = "xmanrui-dsh-im-feishu-settings";
|
|
2
|
+
|
|
3
|
+
const CSS = String.raw`
|
|
4
|
+
.bxf-page {
|
|
5
|
+
--bxf-accent: var(--dsw-alias-state-business-primary, #3370ff);
|
|
6
|
+
--bxf-success: var(--dsw-alias-state-success-primary, #20a162);
|
|
7
|
+
--bxf-warning: var(--dsw-alias-state-warn-primary, #d97706);
|
|
8
|
+
--bxf-error: var(--dsw-alias-state-error-primary, #d54941);
|
|
9
|
+
box-sizing: border-box;
|
|
10
|
+
width: 100%;
|
|
11
|
+
max-width: 860px;
|
|
12
|
+
color: var(--dsw-alias-label-primary, #1f2329);
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
container-type: inline-size;
|
|
16
|
+
gap: 18px;
|
|
17
|
+
padding: 2px 0 24px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.bxf-page *, .bxf-page *::before, .bxf-page *::after { box-sizing: border-box; }
|
|
21
|
+
|
|
22
|
+
.bxf-heading {
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: flex-start;
|
|
25
|
+
justify-content: space-between;
|
|
26
|
+
gap: 20px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.bxf-headingCopy { min-width: 0; }
|
|
30
|
+
.bxf-heading h2, .bxf-heading p, .bxf-card h3, .bxf-card p { margin: 0; }
|
|
31
|
+
|
|
32
|
+
.bxf-eyebrow {
|
|
33
|
+
color: var(--dsw-alias-label-tertiary, #8f959e);
|
|
34
|
+
font-size: 12px;
|
|
35
|
+
font-weight: 600;
|
|
36
|
+
line-height: 18px;
|
|
37
|
+
letter-spacing: .08em;
|
|
38
|
+
text-transform: uppercase;
|
|
39
|
+
margin-bottom: 3px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.bxf-heading h2 {
|
|
43
|
+
font-size: 20px;
|
|
44
|
+
line-height: 28px;
|
|
45
|
+
font-weight: 650;
|
|
46
|
+
letter-spacing: -.015em;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.bxf-heading p {
|
|
50
|
+
max-width: 540px;
|
|
51
|
+
color: var(--dsw-alias-label-secondary, #646a73);
|
|
52
|
+
font-size: 13px;
|
|
53
|
+
line-height: 20px;
|
|
54
|
+
margin-top: 5px;
|
|
55
|
+
white-space: nowrap;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.bxf-headingTools {
|
|
59
|
+
width: 100%;
|
|
60
|
+
flex: none;
|
|
61
|
+
display: flex;
|
|
62
|
+
align-items: center;
|
|
63
|
+
justify-content: space-between;
|
|
64
|
+
flex-wrap: nowrap;
|
|
65
|
+
gap: 8px;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.bxf-totalBadge {
|
|
69
|
+
min-height: 28px;
|
|
70
|
+
display: inline-flex;
|
|
71
|
+
align-items: baseline;
|
|
72
|
+
gap: 3px;
|
|
73
|
+
border-radius: 999px;
|
|
74
|
+
padding: 4px 10px;
|
|
75
|
+
color: var(--dsw-alias-label-secondary, #646a73);
|
|
76
|
+
background: var(--dsw-alias-bg-module-platform, #f2f3f5);
|
|
77
|
+
font-size: 11px;
|
|
78
|
+
line-height: 16px;
|
|
79
|
+
white-space: nowrap;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.bxf-totalBadge strong { color: var(--bxf-success); font-size: 13px; }
|
|
83
|
+
|
|
84
|
+
.bxf-card {
|
|
85
|
+
position: relative;
|
|
86
|
+
overflow: hidden;
|
|
87
|
+
border: 1px solid var(--dsw-alias-border-l2, #dee0e3);
|
|
88
|
+
border-radius: 14px;
|
|
89
|
+
background: var(--dsw-alias-bg-layer-3, #fff);
|
|
90
|
+
box-shadow: var(--dsw-shadow-lv1, 0 3px 12px rgba(31, 35, 41, .05));
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.bxf-card::before {
|
|
94
|
+
content: "";
|
|
95
|
+
pointer-events: none;
|
|
96
|
+
position: absolute;
|
|
97
|
+
inset: 0 0 auto;
|
|
98
|
+
height: 88px;
|
|
99
|
+
background:
|
|
100
|
+
radial-gradient(circle at 86% -35%, color-mix(in srgb, var(--bxf-accent) 18%, transparent), transparent 68%);
|
|
101
|
+
opacity: .85;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.bxf-cardBody { position: relative; padding: 24px; }
|
|
105
|
+
|
|
106
|
+
.bxf-intro {
|
|
107
|
+
min-height: 250px;
|
|
108
|
+
display: grid;
|
|
109
|
+
grid-template-columns: minmax(0, 1fr) 172px;
|
|
110
|
+
gap: 32px;
|
|
111
|
+
align-items: center;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.bxf-introCopy { max-width: 500px; }
|
|
115
|
+
|
|
116
|
+
.bxf-stateLabel {
|
|
117
|
+
display: inline-flex;
|
|
118
|
+
align-items: center;
|
|
119
|
+
gap: 7px;
|
|
120
|
+
color: var(--dsw-alias-label-secondary, #646a73);
|
|
121
|
+
font-size: 12px;
|
|
122
|
+
font-weight: 600;
|
|
123
|
+
line-height: 18px;
|
|
124
|
+
margin-bottom: 13px;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.bxf-dot {
|
|
128
|
+
width: 7px;
|
|
129
|
+
height: 7px;
|
|
130
|
+
border-radius: 50%;
|
|
131
|
+
background: var(--dsw-alias-label-tertiary, #8f959e);
|
|
132
|
+
box-shadow: 0 0 0 4px color-mix(in srgb, var(--dsw-alias-label-tertiary, #8f959e) 12%, transparent);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.bxf-dot[data-tone="success"] {
|
|
136
|
+
background: var(--bxf-success);
|
|
137
|
+
box-shadow: 0 0 0 4px color-mix(in srgb, var(--bxf-success) 13%, transparent);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.bxf-dot[data-tone="warning"] {
|
|
141
|
+
background: var(--bxf-warning);
|
|
142
|
+
box-shadow: 0 0 0 4px color-mix(in srgb, var(--bxf-warning) 13%, transparent);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.bxf-dot[data-tone="error"] {
|
|
146
|
+
background: var(--bxf-error);
|
|
147
|
+
box-shadow: 0 0 0 4px color-mix(in srgb, var(--bxf-error) 13%, transparent);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.bxf-intro h3 {
|
|
151
|
+
font-size: 24px;
|
|
152
|
+
line-height: 34px;
|
|
153
|
+
font-weight: 650;
|
|
154
|
+
letter-spacing: -.02em;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.bxf-introCopy > p {
|
|
158
|
+
max-width: 490px;
|
|
159
|
+
color: var(--dsw-alias-label-secondary, #646a73);
|
|
160
|
+
font-size: 14px;
|
|
161
|
+
line-height: 23px;
|
|
162
|
+
margin-top: 8px;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.bxf-note {
|
|
166
|
+
display: flex;
|
|
167
|
+
gap: 8px;
|
|
168
|
+
align-items: flex-start;
|
|
169
|
+
color: var(--dsw-alias-label-tertiary, #8f959e);
|
|
170
|
+
font-size: 12px;
|
|
171
|
+
line-height: 18px;
|
|
172
|
+
margin-top: 16px;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.bxf-note svg { flex: none; margin-top: 1px; }
|
|
176
|
+
|
|
177
|
+
.bxf-actions {
|
|
178
|
+
display: flex;
|
|
179
|
+
align-items: center;
|
|
180
|
+
flex-wrap: wrap;
|
|
181
|
+
gap: 10px;
|
|
182
|
+
margin-top: 22px;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.bxf-button {
|
|
186
|
+
appearance: none;
|
|
187
|
+
min-height: 36px;
|
|
188
|
+
display: inline-flex;
|
|
189
|
+
align-items: center;
|
|
190
|
+
justify-content: center;
|
|
191
|
+
gap: 7px;
|
|
192
|
+
border: 1px solid var(--dsw-alias-border-l2, #dee0e3);
|
|
193
|
+
border-radius: 8px;
|
|
194
|
+
padding: 7px 13px;
|
|
195
|
+
color: var(--dsw-alias-label-primary, #1f2329);
|
|
196
|
+
background: var(--dsw-alias-bg-layer-1, #fff);
|
|
197
|
+
font: inherit;
|
|
198
|
+
font-size: 13px;
|
|
199
|
+
font-weight: 550;
|
|
200
|
+
line-height: 20px;
|
|
201
|
+
text-decoration: none;
|
|
202
|
+
cursor: pointer;
|
|
203
|
+
transition: background .15s var(--ds-ease-in-out, ease), border-color .15s var(--ds-ease-in-out, ease), transform .15s var(--ds-ease-in-out, ease);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.bxf-button:hover:not(:disabled) {
|
|
207
|
+
background: var(--dsw-alias-interactive-bg-hover, #f2f3f5);
|
|
208
|
+
border-color: var(--dsw-alias-border-l1, #c9cdd4);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.bxf-button:active:not(:disabled) { transform: translateY(1px); }
|
|
212
|
+
|
|
213
|
+
.bxf-button:focus-visible, .bxf-link:focus-visible {
|
|
214
|
+
outline: 2px solid var(--bxf-accent);
|
|
215
|
+
outline-offset: 2px;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.bxf-button:disabled { cursor: not-allowed; opacity: .55; }
|
|
219
|
+
|
|
220
|
+
.bxf-button[data-kind="primary"] {
|
|
221
|
+
border-color: var(--bxf-accent);
|
|
222
|
+
color: #fff;
|
|
223
|
+
background: var(--bxf-accent);
|
|
224
|
+
box-shadow: 0 4px 12px color-mix(in srgb, var(--bxf-accent) 24%, transparent);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.bxf-button[data-kind="primary"]:hover:not(:disabled) {
|
|
228
|
+
border-color: color-mix(in srgb, var(--bxf-accent) 86%, #000);
|
|
229
|
+
background: color-mix(in srgb, var(--bxf-accent) 90%, #000);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.bxf-button[data-kind="danger"] { color: var(--bxf-error); }
|
|
233
|
+
.bxf-button[data-size="small"] { min-height: 32px; padding: 5px 10px; font-size: 12px; }
|
|
234
|
+
.bxf-bindButton { flex: none; white-space: nowrap; }
|
|
235
|
+
|
|
236
|
+
.bxf-provisionCard {
|
|
237
|
+
border-color: color-mix(in srgb, var(--bxf-accent) 32%, var(--dsw-alias-border-l2, #dee0e3));
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.bxf-markStage {
|
|
241
|
+
position: relative;
|
|
242
|
+
width: 156px;
|
|
243
|
+
height: 156px;
|
|
244
|
+
display: grid;
|
|
245
|
+
place-items: center;
|
|
246
|
+
justify-self: end;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.bxf-markStage::before, .bxf-markStage::after {
|
|
250
|
+
content: "";
|
|
251
|
+
position: absolute;
|
|
252
|
+
border-radius: 50%;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.bxf-markStage::before {
|
|
256
|
+
inset: 12px;
|
|
257
|
+
border: 1px solid color-mix(in srgb, var(--bxf-accent) 18%, var(--dsw-alias-border-l2, #dee0e3));
|
|
258
|
+
background: color-mix(in srgb, var(--bxf-accent) 4%, var(--dsw-alias-bg-layer-1, #fff));
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.bxf-markStage::after {
|
|
262
|
+
inset: 0;
|
|
263
|
+
border: 1px dashed color-mix(in srgb, var(--bxf-accent) 16%, transparent);
|
|
264
|
+
animation: bxf-rotate 18s linear infinite;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.bxf-brandMark {
|
|
268
|
+
position: relative;
|
|
269
|
+
z-index: 1;
|
|
270
|
+
width: 68px;
|
|
271
|
+
height: 68px;
|
|
272
|
+
display: grid;
|
|
273
|
+
place-items: center;
|
|
274
|
+
border-radius: 20px;
|
|
275
|
+
color: #fff;
|
|
276
|
+
background: var(--bxf-accent);
|
|
277
|
+
box-shadow: 0 12px 28px color-mix(in srgb, var(--bxf-accent) 28%, transparent);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.bxf-qrLayout {
|
|
281
|
+
display: grid;
|
|
282
|
+
grid-template-columns: 236px minmax(0, 1fr);
|
|
283
|
+
align-items: center;
|
|
284
|
+
gap: 32px;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.bxf-qrColumn { min-width: 0; }
|
|
288
|
+
|
|
289
|
+
.bxf-qrFrame {
|
|
290
|
+
position: relative;
|
|
291
|
+
width: 222px;
|
|
292
|
+
height: 222px;
|
|
293
|
+
display: grid;
|
|
294
|
+
place-items: center;
|
|
295
|
+
border: 1px solid var(--dsw-alias-border-l2, #dee0e3);
|
|
296
|
+
border-radius: 14px;
|
|
297
|
+
padding: 13px;
|
|
298
|
+
background: #fff;
|
|
299
|
+
box-shadow: 0 8px 24px rgba(31, 35, 41, .07);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.bxf-qrFrame::before, .bxf-qrFrame::after {
|
|
303
|
+
content: "";
|
|
304
|
+
position: absolute;
|
|
305
|
+
width: 24px;
|
|
306
|
+
height: 24px;
|
|
307
|
+
border-color: var(--bxf-accent);
|
|
308
|
+
border-style: solid;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.bxf-qrFrame::before { inset: -3px auto auto -3px; border-width: 2px 0 0 2px; border-radius: 5px 0 0; }
|
|
312
|
+
.bxf-qrFrame::after { inset: auto -3px -3px auto; border-width: 0 2px 2px 0; border-radius: 0 0 5px; }
|
|
313
|
+
.bxf-qrFrame img { width: 100%; height: 100%; display: block; object-fit: contain; }
|
|
314
|
+
|
|
315
|
+
.bxf-qrFallback {
|
|
316
|
+
width: 100%;
|
|
317
|
+
height: 100%;
|
|
318
|
+
display: grid;
|
|
319
|
+
place-items: center;
|
|
320
|
+
border-radius: 8px;
|
|
321
|
+
color: var(--bxf-accent);
|
|
322
|
+
background: #f7f9ff;
|
|
323
|
+
text-align: center;
|
|
324
|
+
padding: 20px;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.bxf-qrFallback span { display: block; color: #646a73; font-size: 12px; line-height: 18px; margin-top: 8px; }
|
|
328
|
+
|
|
329
|
+
.bxf-expiredOverlay {
|
|
330
|
+
position: absolute;
|
|
331
|
+
inset: 10px;
|
|
332
|
+
display: grid;
|
|
333
|
+
place-items: center;
|
|
334
|
+
border-radius: 9px;
|
|
335
|
+
color: #1f2329;
|
|
336
|
+
background: rgba(255, 255, 255, .94);
|
|
337
|
+
backdrop-filter: blur(3px);
|
|
338
|
+
font-size: 13px;
|
|
339
|
+
font-weight: 600;
|
|
340
|
+
text-align: center;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
.bxf-countdown {
|
|
344
|
+
width: 222px;
|
|
345
|
+
color: var(--dsw-alias-label-tertiary, #8f959e);
|
|
346
|
+
font-variant-numeric: tabular-nums;
|
|
347
|
+
font-size: 11px;
|
|
348
|
+
line-height: 17px;
|
|
349
|
+
margin-top: 11px;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
.bxf-countdownTop { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
|
|
353
|
+
.bxf-progress { height: 3px; overflow: hidden; border-radius: 99px; background: var(--dsw-alias-bg-module-platform, #f2f3f5); margin-top: 6px; }
|
|
354
|
+
.bxf-progress > span { display: block; width: var(--bxf-progress, 100%); height: 100%; border-radius: inherit; background: var(--bxf-accent); transition: width 1s linear; }
|
|
355
|
+
|
|
356
|
+
.bxf-qrCopy h3 { font-size: 20px; line-height: 29px; font-weight: 650; }
|
|
357
|
+
.bxf-qrCopy > p { color: var(--dsw-alias-label-secondary, #646a73); font-size: 13px; line-height: 21px; margin-top: 7px; }
|
|
358
|
+
|
|
359
|
+
.bxf-steps { counter-reset: bxf-step; display: flex; flex-direction: column; gap: 11px; margin: 20px 0 0; padding: 0; list-style: none; }
|
|
360
|
+
.bxf-steps li { counter-increment: bxf-step; display: grid; grid-template-columns: 23px minmax(0, 1fr); align-items: start; gap: 9px; color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; line-height: 19px; }
|
|
361
|
+
.bxf-steps li::before { content: counter(bxf-step); width: 21px; height: 21px; display: grid; place-items: center; border: 1px solid var(--dsw-alias-border-l2, #dee0e3); border-radius: 50%; color: var(--dsw-alias-label-primary, #1f2329); background: var(--dsw-alias-bg-layer-1, #fff); font-size: 10px; font-weight: 650; }
|
|
362
|
+
|
|
363
|
+
.bxf-connecting { min-height: 292px; display: grid; place-items: center; text-align: center; padding: 36px 24px; }
|
|
364
|
+
.bxf-connectingCopy { max-width: 430px; }
|
|
365
|
+
.bxf-orbit { position: relative; width: 86px; height: 86px; display: grid; place-items: center; margin: 0 auto 22px; }
|
|
366
|
+
.bxf-orbit::before, .bxf-orbit::after { content: ""; position: absolute; border-radius: 50%; }
|
|
367
|
+
.bxf-orbit::before { inset: 3px; border: 1px solid color-mix(in srgb, var(--bxf-accent) 24%, transparent); animation: bxf-pulse 1.8s var(--ds-ease-in-out, ease) infinite; }
|
|
368
|
+
.bxf-orbit::after { inset: 0; border: 2px solid transparent; border-top-color: var(--bxf-accent); animation: bxf-rotate 1.2s linear infinite; }
|
|
369
|
+
.bxf-orbitCore { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 16px; color: var(--bxf-accent); background: color-mix(in srgb, var(--bxf-accent) 9%, var(--dsw-alias-bg-layer-1, #fff)); }
|
|
370
|
+
.bxf-connecting h3 { font-size: 20px; line-height: 29px; }
|
|
371
|
+
.bxf-connecting p { color: var(--dsw-alias-label-secondary, #646a73); font-size: 13px; line-height: 21px; margin-top: 7px; }
|
|
372
|
+
.bxf-connectingCompact { min-height: 248px; }
|
|
373
|
+
|
|
374
|
+
.bxf-inlineError {
|
|
375
|
+
min-height: 190px;
|
|
376
|
+
display: grid;
|
|
377
|
+
grid-template-columns: 44px minmax(0, 1fr);
|
|
378
|
+
align-content: center;
|
|
379
|
+
gap: 15px;
|
|
380
|
+
padding: 28px;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
.bxf-inlineError h3 { font-size: 17px; line-height: 25px; margin: 0; }
|
|
384
|
+
.bxf-inlineError p { color: var(--dsw-alias-label-secondary, #646a73); font-size: 13px; line-height: 21px; margin-top: 5px; overflow-wrap: anywhere; }
|
|
385
|
+
|
|
386
|
+
.bxf-listSection { display: flex; flex-direction: column; gap: 10px; }
|
|
387
|
+
.bxf-listHeading { min-height: 28px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 2px; }
|
|
388
|
+
.bxf-listHeading h3 { font-size: 14px; line-height: 22px; font-weight: 650; margin: 0; }
|
|
389
|
+
.bxf-botList { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
|
|
390
|
+
.bxf-botList > li { min-width: 0; }
|
|
391
|
+
.bxf-botCard:focus { outline: none; }
|
|
392
|
+
.bxf-botCard:focus-visible { outline: 2px solid var(--bxf-accent); outline-offset: 2px; }
|
|
393
|
+
|
|
394
|
+
.bxf-connectedTop { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
|
|
395
|
+
.bxf-botIdentity { min-width: 0; display: flex; align-items: center; gap: 13px; }
|
|
396
|
+
.bxf-avatar { flex: none; width: 48px; height: 48px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--dsw-alias-border-l2, #e5e6eb); border-radius: 14px; background: var(--dsw-alias-bg-layer-1, #fff); box-shadow: 0 1px 3px rgb(31 35 41 / 7%); }
|
|
397
|
+
.bxf-botName { min-width: 0; }
|
|
398
|
+
.bxf-botName h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; line-height: 24px; font-weight: 650; }
|
|
399
|
+
.bxf-botName p { overflow: hidden; color: var(--dsw-alias-label-tertiary, #8f959e); font-family: var(--ds-font-family-code, monospace); font-size: 12px; line-height: 18px; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
|
|
400
|
+
|
|
401
|
+
.bxf-healthPill { flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 28px; border-radius: 999px; padding: 4px 10px; color: var(--bxf-success); background: color-mix(in srgb, var(--bxf-success) 10%, transparent); font-size: 12px; font-weight: 600; line-height: 18px; }
|
|
402
|
+
.bxf-healthPill[data-health="degraded"], .bxf-healthPill[data-health="checking"], .bxf-healthPill[data-health="connecting"] { color: var(--bxf-warning); background: color-mix(in srgb, var(--bxf-warning) 10%, transparent); }
|
|
403
|
+
.bxf-healthPill[data-health="offline"], .bxf-healthPill[data-health="error"] { color: var(--bxf-error); background: color-mix(in srgb, var(--bxf-error) 10%, transparent); }
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
.bxf-responseMode { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) max-content; align-items: center; column-gap: 10px; row-gap: 5px; margin-top: 6px; padding: 8px 10px; border: 1px solid var(--dsw-alias-border-l1, #eef0f3); border-radius: 9px; background: var(--dsw-alias-bg-module-platform, #f7f8fa); }
|
|
407
|
+
.bxf-responseModeHeader { display: contents; color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; line-height: normal; }
|
|
408
|
+
.bxf-responseModeHeader > span:first-child { grid-column: 1; grid-row: 1; white-space: nowrap; }
|
|
409
|
+
.bxf-responseModeStatus { grid-column: 2; grid-row: 1; color: var(--dsw-alias-label-tertiary, #8f959e); font-size: 12px; white-space: nowrap; }
|
|
410
|
+
.bxf-responseModeSelect { min-width: 0; width: 100%; grid-column: 1 / -1; grid-row: 2; height: 32px; padding: 0 30px 0 9px; border: 1px solid var(--dsw-alias-border-l2, #dfe1e5); border-radius: 7px; color: var(--dsw-alias-label-primary, #1f2329); background-color: var(--dsw-alias-bg-layer-1, #fff); font: inherit; font-size: 12px; cursor: pointer; transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease; }
|
|
411
|
+
.bxf-responseModeSelect:hover:not(:disabled) { border-color: color-mix(in srgb, var(--bxf-accent) 45%, var(--dsw-alias-border-l2, #dfe1e5)); }
|
|
412
|
+
.bxf-responseModeSelect:focus-visible { outline: none; border-color: var(--bxf-accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--bxf-accent) 16%, transparent); }
|
|
413
|
+
.bxf-responseModeSelect:disabled { cursor: not-allowed; opacity: .55; }
|
|
414
|
+
.bxf-responseModeHelp { grid-column: 1 / -1; grid-row: 3; color: var(--dsw-alias-label-tertiary, #8f959e); font-size: 11px; line-height: 1.45; }
|
|
415
|
+
.bxf-responseModePermissionAction { grid-column: 1 / -1; grid-row: 4; display: flex; justify-content: flex-start; margin-top: 2px; }
|
|
416
|
+
.bxf-responseModePermissionButton { min-height: 28px; padding: 3px 9px; color: var(--bxf-accent); border-color: color-mix(in srgb, var(--bxf-accent) 30%, var(--dsw-alias-border-l2, #dfe1e5)); background: var(--dsw-alias-bg-layer-1, #fff); }
|
|
417
|
+
.bxf-responseModePermissionButton:hover:not(:disabled) { background: color-mix(in srgb, var(--bxf-accent) 7%, transparent); }
|
|
418
|
+
.bxf-responseModeError { grid-column: 1 / -1; grid-row: 5; color: var(--bxf-error); font-size: 12px; line-height: 1.4; margin: 0; }
|
|
419
|
+
|
|
420
|
+
.bxf-botProvision {
|
|
421
|
+
position: relative;
|
|
422
|
+
margin-top: 14px;
|
|
423
|
+
scroll-margin-block: 20px;
|
|
424
|
+
animation: bxf-revealProvision .2s var(--ds-ease-out, ease-out) both;
|
|
425
|
+
}
|
|
426
|
+
.bxf-botProvision:focus { outline: none; }
|
|
427
|
+
.bxf-botProvision:focus-visible {
|
|
428
|
+
outline: 2px solid color-mix(in srgb, var(--bxf-accent) 75%, transparent);
|
|
429
|
+
outline-offset: 3px;
|
|
430
|
+
border-radius: 12px;
|
|
431
|
+
}
|
|
432
|
+
.bxf-botProvision > .bxf-provisionCard {
|
|
433
|
+
border-radius: 11px;
|
|
434
|
+
box-shadow: none;
|
|
435
|
+
background: color-mix(in srgb, var(--bxf-accent) 2.5%, var(--dsw-alias-bg-layer-3, #fff));
|
|
436
|
+
}
|
|
437
|
+
.bxf-botProvision .bxf-cardBody { padding: 18px; }
|
|
438
|
+
.bxf-botProvision .bxf-qrLayout {
|
|
439
|
+
grid-template-columns: 184px minmax(0, 1fr);
|
|
440
|
+
align-items: start;
|
|
441
|
+
gap: 24px;
|
|
442
|
+
}
|
|
443
|
+
.bxf-botProvision .bxf-qrFrame { width: 176px; height: 176px; padding: 10px; border-radius: 11px; }
|
|
444
|
+
.bxf-botProvision .bxf-countdown { width: 176px; }
|
|
445
|
+
.bxf-botProvision .bxf-qrCopy h3 { font-size: 18px; line-height: 26px; }
|
|
446
|
+
.bxf-botProvision .bxf-steps { gap: 8px; margin-top: 14px; }
|
|
447
|
+
.bxf-botProvision .bxf-actions { margin-top: 16px; }
|
|
448
|
+
.bxf-botProvision .bxf-inlineError { min-height: 160px; padding: 22px; }
|
|
449
|
+
|
|
450
|
+
.bxf-connectedFooter { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--dsw-alias-border-l1, #eef0f3); }
|
|
451
|
+
.bxf-healthSummary { min-width: 0; color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; line-height: 18px; }
|
|
452
|
+
.bxf-healthSummary[data-error="true"] { color: var(--bxf-error); }
|
|
453
|
+
.bxf-botActions { position: relative; flex: none; width: 100%; flex-wrap: wrap; gap: 8px; margin-top: 0; justify-content: flex-end; }
|
|
454
|
+
.bxf-botActions .bxf-button { flex: none; white-space: nowrap; }
|
|
455
|
+
.bxf-botActions .bxf-repairButton { color: var(--bxf-accent); border-color: color-mix(in srgb, var(--bxf-accent) 35%, var(--dsw-alias-border-l2, #dee0e3)); }
|
|
456
|
+
.bxf-botActions .bxf-repairButton:hover:not(:disabled) { background: color-mix(in srgb, var(--bxf-accent) 7%, transparent); }
|
|
457
|
+
.bxf-repairAction { display: inline-flex; }
|
|
458
|
+
.bxf-repairTooltip {
|
|
459
|
+
position: absolute;
|
|
460
|
+
right: 0;
|
|
461
|
+
bottom: calc(100% + 8px);
|
|
462
|
+
z-index: 40;
|
|
463
|
+
width: min(330px, 100%);
|
|
464
|
+
display: grid;
|
|
465
|
+
gap: 3px;
|
|
466
|
+
padding: 9px 10px;
|
|
467
|
+
border: 1px solid var(--dsw-alias-border-l2, #dfe1e5);
|
|
468
|
+
border-radius: 8px;
|
|
469
|
+
color: var(--dsw-alias-label-primary, #1f2329);
|
|
470
|
+
background: var(--dsw-alias-bg-layer-3, #fff);
|
|
471
|
+
box-shadow: 0 10px 28px rgb(31 35 41 / 16%);
|
|
472
|
+
opacity: 0;
|
|
473
|
+
visibility: hidden;
|
|
474
|
+
transform: translateY(3px);
|
|
475
|
+
pointer-events: none;
|
|
476
|
+
transition: opacity .15s ease, transform .15s ease, visibility .15s ease;
|
|
477
|
+
}
|
|
478
|
+
.bxf-repairTooltip strong { font-size: 12px; line-height: 17px; font-weight: 650; }
|
|
479
|
+
.bxf-repairTooltip > span { color: var(--dsw-alias-label-secondary, #646a73); font-size: 11px; line-height: 17px; font-weight: 400; overflow-wrap: anywhere; }
|
|
480
|
+
.bxf-repairAction:hover .bxf-repairTooltip,
|
|
481
|
+
.bxf-repairAction:focus-within .bxf-repairTooltip { opacity: 1; visibility: visible; transform: translateY(0); }
|
|
482
|
+
|
|
483
|
+
.bxf-confirm {
|
|
484
|
+
border-top: 1px solid var(--dsw-alias-border-l2, #dee0e3);
|
|
485
|
+
background: color-mix(in srgb, var(--bxf-error) 4%, var(--dsw-alias-bg-module-platform, #f7f8fa));
|
|
486
|
+
padding: 17px 24px 20px;
|
|
487
|
+
}
|
|
488
|
+
.bxf-confirm:focus { outline: none; }
|
|
489
|
+
.bxf-confirm h4 { font-size: 13px; line-height: 20px; margin: 0; }
|
|
490
|
+
.bxf-confirm p { color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; line-height: 19px; margin: 4px 0 0; }
|
|
491
|
+
.bxf-confirm .bxf-actions { margin-top: 12px; }
|
|
492
|
+
|
|
493
|
+
.bxf-error { min-height: 252px; display: grid; grid-template-columns: 44px minmax(0, 1fr); align-content: center; gap: 15px; padding: 30px; }
|
|
494
|
+
.bxf-errorIcon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; color: var(--bxf-error); background: color-mix(in srgb, var(--bxf-error) 9%, transparent); }
|
|
495
|
+
.bxf-error h3 { font-size: 17px; line-height: 25px; }
|
|
496
|
+
.bxf-error p { color: var(--dsw-alias-label-secondary, #646a73); font-size: 13px; line-height: 21px; margin-top: 5px; overflow-wrap: anywhere; }
|
|
497
|
+
.bxf-errorCode { display: inline-block; color: var(--dsw-alias-label-tertiary, #8f959e); font-family: var(--ds-font-family-code, monospace); font-size: 11px; margin-top: 7px; }
|
|
498
|
+
|
|
499
|
+
.bxf-statusNotice {
|
|
500
|
+
display: flex;
|
|
501
|
+
align-items: center;
|
|
502
|
+
gap: 9px;
|
|
503
|
+
border: 1px solid color-mix(in srgb, var(--bxf-warning) 28%, var(--dsw-alias-border-l2, #dee0e3));
|
|
504
|
+
border-radius: 10px;
|
|
505
|
+
padding: 9px 11px;
|
|
506
|
+
color: var(--dsw-alias-label-secondary, #646a73);
|
|
507
|
+
background: color-mix(in srgb, var(--bxf-warning) 5%, var(--dsw-alias-bg-layer-1, #fff));
|
|
508
|
+
font-size: 12px;
|
|
509
|
+
line-height: 18px;
|
|
510
|
+
}
|
|
511
|
+
.bxf-statusNotice > svg { flex: none; color: var(--bxf-warning); }
|
|
512
|
+
.bxf-statusNotice > span { min-width: 0; flex: 1; overflow-wrap: anywhere; }
|
|
513
|
+
|
|
514
|
+
.bxf-skeleton { min-height: 260px; padding: 28px; }
|
|
515
|
+
.bxf-skeletonLine { height: 12px; border-radius: 999px; background: linear-gradient(90deg, var(--dsw-alias-bg-module-platform, #f2f3f5), color-mix(in srgb, var(--dsw-alias-label-tertiary, #8f959e) 10%, transparent), var(--dsw-alias-bg-module-platform, #f2f3f5)); background-size: 220% 100%; animation: bxf-shimmer 1.5s linear infinite; }
|
|
516
|
+
.bxf-skeletonLine:nth-child(1) { width: 92px; }
|
|
517
|
+
.bxf-skeletonLine:nth-child(2) { width: 44%; height: 22px; margin-top: 23px; }
|
|
518
|
+
.bxf-skeletonLine:nth-child(3) { width: 72%; margin-top: 14px; }
|
|
519
|
+
.bxf-skeletonLine:nth-child(4) { width: 58%; margin-top: 9px; }
|
|
520
|
+
.bxf-skeletonBox { width: 138px; height: 38px; border-radius: 8px; background: var(--dsw-alias-bg-module-platform, #f2f3f5); margin-top: 28px; }
|
|
521
|
+
|
|
522
|
+
.bxf-visuallyHidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
|
|
523
|
+
|
|
524
|
+
@keyframes bxf-rotate { to { transform: rotate(360deg); } }
|
|
525
|
+
@keyframes bxf-pulse { 0%, 100% { transform: scale(.9); opacity: .45; } 50% { transform: scale(1.08); opacity: 1; } }
|
|
526
|
+
@keyframes bxf-shimmer { to { background-position: -220% 0; } }
|
|
527
|
+
@keyframes bxf-revealProvision { from { opacity: 0; transform: translateY(-5px); } }
|
|
528
|
+
|
|
529
|
+
@container (max-width: 620px) {
|
|
530
|
+
.bxf-headingTools { gap: 6px; }
|
|
531
|
+
.bxf-headingTools .bxf-totalBadge { padding-inline: 8px; }
|
|
532
|
+
.bxf-headingTools .bxf-bindButton { padding-inline: 10px; }
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
@media (max-width: 680px) {
|
|
536
|
+
.bxf-intro { grid-template-columns: minmax(0, 1fr); }
|
|
537
|
+
.bxf-markStage { display: none; }
|
|
538
|
+
.bxf-qrLayout { grid-template-columns: minmax(0, 1fr); justify-items: center; }
|
|
539
|
+
.bxf-botProvision .bxf-qrLayout { grid-template-columns: minmax(0, 1fr); }
|
|
540
|
+
.bxf-qrCopy { width: 100%; }
|
|
541
|
+
.bxf-connectedTop { align-items: flex-start; flex-direction: column; }
|
|
542
|
+
.bxf-inlineError { grid-template-columns: minmax(0, 1fr); padding: 20px; }
|
|
543
|
+
.bxf-statusNotice { align-items: flex-start; flex-wrap: wrap; }
|
|
544
|
+
.bxf-cardBody { padding: 20px; }
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
@media (prefers-reduced-motion: reduce) {
|
|
548
|
+
.bxf-page *, .bxf-page *::before, .bxf-page *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
|
|
549
|
+
}
|
|
550
|
+
`;
|
|
551
|
+
|
|
552
|
+
export function installFeishuStyles() {
|
|
553
|
+
if (typeof document === "undefined") {
|
|
554
|
+
return () => {};
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
const existing = document.querySelector(
|
|
558
|
+
`style[data-plugin-css="${FEISHU_STYLE_ID}"]`,
|
|
559
|
+
);
|
|
560
|
+
if (existing) {
|
|
561
|
+
return () => {};
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
const style = document.createElement("style");
|
|
565
|
+
style.dataset.plugin = "@xmanrui/dsh-im";
|
|
566
|
+
style.dataset.pluginCss = FEISHU_STYLE_ID;
|
|
567
|
+
style.textContent = CSS;
|
|
568
|
+
document.head.appendChild(style);
|
|
569
|
+
|
|
570
|
+
return () => {
|
|
571
|
+
style.remove();
|
|
572
|
+
};
|
|
573
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
import { h } from '../../i18n.js';
|
|
4
|
+
|
|
5
|
+
// 语音交互编辑器:开关 + 凭据引用 + 模型/音色参数。
|
|
6
|
+
// 凭据值由插件凭据库管理,这里只保存 secretRef 名称——密钥本身不进入配置,
|
|
7
|
+
// 也不经本表单传输。开启后:收到语音消息时转写为文字走正常流水线,并用
|
|
8
|
+
// 语音回复同回合答案(需 DashScope qwen3 系列密钥与可用 ffmpeg)。
|
|
9
|
+
export function VoiceEditor({ value = null, disabled = false, onSave }) {
|
|
10
|
+
const [enabled, setEnabled] = React.useState(value != null);
|
|
11
|
+
const [secretRef, setSecretRef] = React.useState(value?.secretRef ?? 'DASHSCOPE_API_KEY');
|
|
12
|
+
const [asrModel, setAsrModel] = React.useState(value?.asrModel ?? 'qwen3-asr-flash');
|
|
13
|
+
const [ttsModel, setTtsModel] = React.useState(value?.ttsModel ?? 'qwen3-tts-flash');
|
|
14
|
+
const [ttsVoice, setTtsVoice] = React.useState(value?.ttsVoice ?? 'Momo');
|
|
15
|
+
const [saving, setSaving] = React.useState(false);
|
|
16
|
+
const [error, setError] = React.useState(null);
|
|
17
|
+
const titleId = React.useId();
|
|
18
|
+
const helpId = `${titleId}-help`;
|
|
19
|
+
|
|
20
|
+
React.useEffect(() => {
|
|
21
|
+
setEnabled(value != null);
|
|
22
|
+
if (value) {
|
|
23
|
+
setSecretRef(value.secretRef ?? 'DASHSCOPE_API_KEY');
|
|
24
|
+
setAsrModel(value.asrModel ?? 'qwen3-asr-flash');
|
|
25
|
+
setTtsModel(value.ttsModel ?? 'qwen3-tts-flash');
|
|
26
|
+
setTtsVoice(value.ttsVoice ?? 'Momo');
|
|
27
|
+
}
|
|
28
|
+
}, [value]);
|
|
29
|
+
|
|
30
|
+
const persist = async (payload) => {
|
|
31
|
+
if (saving || disabled) return;
|
|
32
|
+
setSaving(true);
|
|
33
|
+
setError(null);
|
|
34
|
+
try {
|
|
35
|
+
await onSave?.(payload);
|
|
36
|
+
} catch (cause) {
|
|
37
|
+
setError(cause?.message ?? '语音设置保存失败,请重试。');
|
|
38
|
+
} finally {
|
|
39
|
+
setSaving(false);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const save = () => persist(enabled ? { enabled: true, secretRef, asrModel, ttsModel, ttsVoice } : null);
|
|
44
|
+
|
|
45
|
+
// 切到“关闭”立即持久化 null:关闭态没有保存按钮,若不在这里落盘,
|
|
46
|
+
// 后台会一直保持原配置,用户以为语音已停而实际仍在处理语音。
|
|
47
|
+
const toggle = (next) => {
|
|
48
|
+
setEnabled(next);
|
|
49
|
+
if (!next) void persist(null);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const input = (label, state, setState, placeholder) => h('label', { className: 'dim-feishuVoiceField' },
|
|
53
|
+
h('span', { className: 'dim-feishuVoiceLabel' }, label),
|
|
54
|
+
h('input', {
|
|
55
|
+
type: 'text',
|
|
56
|
+
className: 'dim-feishuVoiceInput',
|
|
57
|
+
value: state,
|
|
58
|
+
placeholder,
|
|
59
|
+
disabled: disabled || saving,
|
|
60
|
+
onChange: (event) => setState(event.target.value),
|
|
61
|
+
}),
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
return h('section', {
|
|
65
|
+
className: 'dim-feishuGroupControl',
|
|
66
|
+
"aria-labelledby": titleId,
|
|
67
|
+
},
|
|
68
|
+
h('div', { className: 'dim-feishuGroupControlHeader' },
|
|
69
|
+
h('div', { className: 'dim-presetTitle' },
|
|
70
|
+
h('h3', { id: titleId }, '语音交互'),
|
|
71
|
+
h('span', { className: 'dim-presetHelp' },
|
|
72
|
+
h('button', {
|
|
73
|
+
type: 'button',
|
|
74
|
+
className: 'dim-presetHelpButton',
|
|
75
|
+
"aria-label": '查看语音交互说明',
|
|
76
|
+
"aria-describedby": helpId,
|
|
77
|
+
}, h('span', { "aria-hidden": 'true' }, '?')),
|
|
78
|
+
h('span', {
|
|
79
|
+
id: helpId,
|
|
80
|
+
className: 'dim-presetTooltip',
|
|
81
|
+
role: 'tooltip',
|
|
82
|
+
}, '收到语音消息时转写为文字并按文字流水线处理,答案同时以语音回复;转写失败时降级为仅支持文字/图片/文件的提示。凭据值在插件凭据库里管理,这里只引用环境变量名。'))),
|
|
83
|
+
saving
|
|
84
|
+
? h('span', { className: 'dim-feishuGroupControlStatus', role: 'status' }, '保存中…')
|
|
85
|
+
: null),
|
|
86
|
+
h('select', {
|
|
87
|
+
className: 'dim-feishuGroupSelect',
|
|
88
|
+
value: enabled ? 'on' : 'off',
|
|
89
|
+
disabled: disabled || saving,
|
|
90
|
+
"aria-label": '语音交互开关',
|
|
91
|
+
onChange: (event) => toggle(event.target.value === 'on'),
|
|
92
|
+
},
|
|
93
|
+
h('option', { value: 'off' }, '关闭'),
|
|
94
|
+
h('option', { value: 'on' }, '开启(语音提问与语音回复)')),
|
|
95
|
+
enabled
|
|
96
|
+
? h('div', { className: 'dim-feishuVoiceForm' },
|
|
97
|
+
input('凭据引用(环境变量名)', secretRef, setSecretRef, 'DASHSCOPE_API_KEY'),
|
|
98
|
+
input('转写模型(ASR)', asrModel, setAsrModel, 'qwen3-asr-flash'),
|
|
99
|
+
input('合成模型(TTS)', ttsModel, setTtsModel, 'qwen3-tts-flash'),
|
|
100
|
+
input('回复音色', ttsVoice, setTtsVoice, 'Momo'),
|
|
101
|
+
h('p', { className: 'dim-feishuGroupHelp' },
|
|
102
|
+
'需要 DashScope 密钥(凭据库中以"凭据引用"为名的环境变量)与可用 ffmpeg;音色支持 Cherry/Serena/Bella/Chelsie/Momo/Katerina 等 qwen3-tts-flash 官方音色。'),
|
|
103
|
+
h('div', { className: 'dim-feishuVoiceActions' },
|
|
104
|
+
h('button', {
|
|
105
|
+
type: 'button',
|
|
106
|
+
className: 'dim-feishuVoiceSave',
|
|
107
|
+
onClick: () => void save(),
|
|
108
|
+
disabled: disabled || saving || !secretRef.trim(),
|
|
109
|
+
}, '保存语音设置')))
|
|
110
|
+
: h('p', { className: 'dim-feishuGroupHelp' }, '默认关闭;开启后机器人可听懂语音消息并以语音回复。'),
|
|
111
|
+
error ? h('p', {
|
|
112
|
+
className: 'dim-feishuGroupError',
|
|
113
|
+
role: 'alert',
|
|
114
|
+
}, error) : null);
|
|
115
|
+
}
|