diff --git a/CHANGELOG.md b/CHANGELOG.md index 5bdaac3..2063220 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ This file records the notable changes in each dsh-im release. Its format follows ## [Unreleased] +### Changed / 变更 + +- 「IM机器人」设置页已从插件页签迁移到一级设置菜单,并以 `order: 21` 尽量排在「Agent 预设」之后;新版不再注册旧二级入口。升级后重启 `dsh web` 并刷新浏览器即可使用,已有机器人配置和页面内的渠道专属 Logo 保持不变。 + The **IM Bot** settings page has moved from a Plugins tab to the top-level settings menu and uses `order: 21` to follow **Agent Presets**. The new release no longer registers the legacy nested entry. Restart `dsh web` and refresh the browser after upgrading; existing bot configuration and channel-specific logos inside the page are preserved. + ## [2.6.0] - 2026-08-25 ### Added / 新增 diff --git a/README.en.md b/README.en.md index 474e322..e90ac31 100644 --- a/README.en.md +++ b/README.en.md @@ -58,7 +58,7 @@ Connect IM bots to DeepSeek Harness by scanning a QR code, using an App Manifest Other IM platforms can be added through the same channel-adapter structure. -All nine built-in channels can send JPEG, PNG, and WebP images, plus GIFs sent as image files, with optional captions to Harness. Each image is limited to 5 MB, and images in one message are limited to 20 MB in total. Downloading images or files from Feishu user messages requires the `im:message:readonly` tenant scope, shown on the confirmation page as **Read direct and group messages**; Feishu currently offers no narrower image-only scope for that download endpoint. Apps created through the built-in QR flow request it by default; for existing or manually connected apps, click **Complete permissions** in the plugin's Feishu settings and scan the QR code to incrementally add that scope, `im:resource` for uploading bot-sent images or files, and the card callback. +All nine built-in channels can send JPEG, PNG, and WebP images, plus GIFs sent as image files, with optional captions to Harness. Each image is limited to 5 MB, and images in one message are limited to 20 MB in total. Downloading images or files from Feishu user messages requires the `im:message:readonly` tenant scope, shown on the confirmation page as **Read direct and group messages**; Feishu currently offers no narrower image-only scope for that download endpoint. Apps created through the built-in QR flow request it by default; for existing or manually connected apps, click **Complete permissions** on the IM Bot settings page and scan the QR code to incrementally add that scope, `im:resource` for uploading bot-sent images or files, and the card callback. ### Result-file and image delivery @@ -96,7 +96,7 @@ Install the published stable release from npm (recommended): dsh plugin --profile web add -w @xmanrui/dsh-im ``` -Restart `dsh web`, then open **Settings → Plugins → IM Bot**. +Restart `dsh web`, refresh the browser, then open **Settings → IM Bot**. The top-level IM Bot entry uses `order: 21` to follow **Agent Presets**, and the Plugins page no longer retains the old entry. Upgrading preserves existing bots, credentials, workspaces, Agent Presets, and Session bindings. To try the latest code before it is published to npm, use the GitHub-source installer instead: @@ -214,7 +214,7 @@ If the Slack desktop app has no native Slash Command registered with the same na ## Design -- Registers one **IM Bot** settings page containing nine IM channels and one AI Office Connector. +- Registers one top-level **IM Bot** settings page containing nine IM channels and one AI Office Connector. - Maintains the Host, client, and runtime sources for all nine channels and the Office Connector in this repository without external standalone plugins. - Follows the DeepSeek Harness language preference and switches the settings UI live between Chinese and English. Bot chat messages follow the Host's `language` config (Chinese by default; `en` switches them to English), with Chinese always as the fallback so untranslated text is sent verbatim. - Uses logos for WeChat, Feishu, DingTalk, WeCom, QQ, Slack, Telegram, Discord, WhatsApp, and AI Office navigation without enable/disable switches. diff --git a/README.md b/README.md index 59ac392..b72a72d 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ Connect IM bots to DeepSeek Harness by scanning a QR code, using an App Manifest 其他 IM 平台可继续按同一渠道适配器结构接入。 -九个内置渠道均支持把 JPEG、PNG、WebP 图片,以及以图片文件方式发送的 GIF,连同可选文字说明发送给 Harness;单张图片上限为 5 MB,单条消息中的图片总大小上限为 20 MB。飞书下载用户消息中的图片或文件需要租户权限 `im:message:readonly`,确认页将其显示为“获取单聊、群组消息”;飞书目前没有为该下载接口提供仅限图片的更窄权限。扫码新建的应用会默认申请;已有或手动绑定的应用可私聊机器人执行 `/repair`,或在插件页面点击“补全权限”,扫码增量补全该权限、上传机器人图片或文件所需的 `im:resource`,以及卡片回调。 +九个内置渠道均支持把 JPEG、PNG、WebP 图片,以及以图片文件方式发送的 GIF,连同可选文字说明发送给 Harness;单张图片上限为 5 MB,单条消息中的图片总大小上限为 20 MB。飞书下载用户消息中的图片或文件需要租户权限 `im:message:readonly`,确认页将其显示为“获取单聊、群组消息”;飞书目前没有为该下载接口提供仅限图片的更窄权限。扫码新建的应用会默认申请;已有或手动绑定的应用可私聊机器人执行 `/repair`,或在「IM机器人」设置页点击“补全权限”,扫码增量补全该权限、上传机器人图片或文件所需的 `im:resource`,以及卡片回调。 ### 结果文件与图片回传 @@ -99,7 +99,7 @@ Heartbeat 成功响应必须是 JSON:`{"ok":true,"protocolVersion":"office-har dsh plugin --profile web add -w @xmanrui/dsh-im ``` -重启 `dsh web`,然后打开「设置 → 插件 → IM机器人」。 +重启 `dsh web`、刷新浏览器,然后打开「设置 → IM机器人」。IM机器人使用 `order: 21`,尽量排在一级设置菜单的「Agent 预设」之后;插件页面不再保留旧入口。从旧版升级不会改变已有机器人、凭据、工作区、Agent Preset 或会话绑定。 如需试用尚未发布到 npm 的最新代码,可以改用 GitHub 源安装器: @@ -217,7 +217,7 @@ Slack 桌面端若未注册同名的原生 Slash Command,会拦截直接以 `/ ## 设计 -- Harness 中只注册一个「IM机器人」设置页,其中包含九个 IM 渠道和一个 AI Office Connector; +- Harness 一级设置菜单中只注册一个「IM机器人」设置页,其中包含九个 IM 渠道和一个 AI Office Connector; - 九个渠道及 Office Connector 的 Host、客户端与运行时源码都在本仓库维护,不依赖外部独立插件; - 设置页跟随 DeepSeek Harness 的语言选择,在中文和 English 之间即时切换;机器人发出的聊天消息跟随 Host 的 `language` 配置(默认中文;设为 `en` 即为英文),中文始终为兜底,未收录的文案原样输出; - 左侧使用 Logo 切换微信、飞书、钉钉、企业微信、QQ、Slack、Telegram、Discord、WhatsApp 和 AI Office,不使用启用/停用开关; diff --git a/bin/dsh-im.mjs b/bin/dsh-im.mjs index f2b46fd..2dabb04 100755 --- a/bin/dsh-im.mjs +++ b/bin/dsh-im.mjs @@ -82,7 +82,7 @@ try { for (const packageName of legacy) { runDsh(['plugin', '--profile', profile, 'remove', packageName]); } - console.log('\nIM 机器人插件已安装。请重启 dsh web,然后打开「设置 → 插件 → IM机器人」。'); + console.log('\nIM 机器人插件已安装。请重启 dsh web、刷新浏览器,然后打开「设置 → IM机器人」。'); if (legacy.size > 0) { console.log('已用 dsh-im 替换独立飞书/微信/钉钉插件;原有凭据和扫码绑定保持不变。'); } diff --git a/docs/images/imbot.png b/docs/images/imbot.png index e5579b8..31ddec4 100644 Binary files a/docs/images/imbot.png and b/docs/images/imbot.png differ diff --git a/lib/client.js b/lib/client.js index 4b1d779..7f1f90a 100644 --- a/lib/client.js +++ b/lib/client.js @@ -130,7 +130,7 @@ var package_default = { scripts: { build: "node plugin-src/client/build.mjs && node plugin-src/host/build.mjs", test: "node --test test/*.test.mjs test/channels/*/*.test.mjs", - check: "npm test && npm run build && node scripts/verify-package.mjs" + check: "npm run build && npm test && node scripts/verify-package.mjs" }, engines: { node: ">=22.19" @@ -1947,7 +1947,7 @@ function LastMessageErrorSummary({ className = "", error }) { } // plugin-src/client/channels/dingtalk/styles.js -var DINGTALK_STYLE_ID = "xmanrui-dsh-dingtalk-settings"; +var DINGTALK_STYLE_ID = "xmanrui-dsh-im-dingtalk-settings"; var CSS = String.raw` .ddt-page { --ddt-accent: #1677ff; @@ -2075,7 +2075,7 @@ function installDingtalkStyles() { if (existing) return () => { }; const style = document.createElement("style"); - style.dataset.plugin = "@xmanrui/dsh-dingtalk"; + style.dataset.plugin = "@xmanrui/dsh-im"; style.dataset.pluginCss = DINGTALK_STYLE_ID; style.textContent = CSS; document.head.appendChild(style); @@ -3932,578 +3932,6 @@ function useAnimationFrameScheduler() { ); } -// plugin-src/client/channels/feishu/styles.js -var FEISHU_STYLE_ID = "beihuixinghe-dsh-feishu-settings"; -var CSS3 = String.raw` -.bxf-page { - --bxf-accent: var(--dsw-alias-state-business-primary, #3370ff); - --bxf-success: var(--dsw-alias-state-success-primary, #20a162); - --bxf-warning: var(--dsw-alias-state-warn-primary, #d97706); - --bxf-error: var(--dsw-alias-state-error-primary, #d54941); - box-sizing: border-box; - width: 100%; - max-width: 860px; - color: var(--dsw-alias-label-primary, #1f2329); - display: flex; - flex-direction: column; - container-type: inline-size; - gap: 18px; - padding: 2px 0 24px; -} - -.bxf-page *, .bxf-page *::before, .bxf-page *::after { box-sizing: border-box; } - -.bxf-heading { - display: flex; - align-items: flex-start; - justify-content: space-between; - gap: 20px; -} - -.bxf-headingCopy { min-width: 0; } -.bxf-heading h2, .bxf-heading p, .bxf-card h3, .bxf-card p { margin: 0; } - -.bxf-eyebrow { - color: var(--dsw-alias-label-tertiary, #8f959e); - font-size: 12px; - font-weight: 600; - line-height: 18px; - letter-spacing: .08em; - text-transform: uppercase; - margin-bottom: 3px; -} - -.bxf-heading h2 { - font-size: 20px; - line-height: 28px; - font-weight: 650; - letter-spacing: -.015em; -} - -.bxf-heading p { - max-width: 540px; - color: var(--dsw-alias-label-secondary, #646a73); - font-size: 13px; - line-height: 20px; - margin-top: 5px; - white-space: nowrap; -} - -.bxf-headingTools { - width: 100%; - flex: none; - display: flex; - align-items: center; - justify-content: space-between; - flex-wrap: nowrap; - gap: 8px; -} - -.bxf-totalBadge { - min-height: 28px; - display: inline-flex; - align-items: baseline; - gap: 3px; - border-radius: 999px; - padding: 4px 10px; - color: var(--dsw-alias-label-secondary, #646a73); - background: var(--dsw-alias-bg-module-platform, #f2f3f5); - font-size: 11px; - line-height: 16px; - white-space: nowrap; -} - -.bxf-totalBadge strong { color: var(--bxf-success); font-size: 13px; } - -.bxf-card { - position: relative; - overflow: hidden; - border: 1px solid var(--dsw-alias-border-l2, #dee0e3); - border-radius: 14px; - background: var(--dsw-alias-bg-layer-3, #fff); - box-shadow: var(--dsw-shadow-lv1, 0 3px 12px rgba(31, 35, 41, .05)); -} - -.bxf-card::before { - content: ""; - pointer-events: none; - position: absolute; - inset: 0 0 auto; - height: 88px; - background: - radial-gradient(circle at 86% -35%, color-mix(in srgb, var(--bxf-accent) 18%, transparent), transparent 68%); - opacity: .85; -} - -.bxf-cardBody { position: relative; padding: 24px; } - -.bxf-intro { - min-height: 250px; - display: grid; - grid-template-columns: minmax(0, 1fr) 172px; - gap: 32px; - align-items: center; -} - -.bxf-introCopy { max-width: 500px; } - -.bxf-stateLabel { - display: inline-flex; - align-items: center; - gap: 7px; - color: var(--dsw-alias-label-secondary, #646a73); - font-size: 12px; - font-weight: 600; - line-height: 18px; - margin-bottom: 13px; -} - -.bxf-dot { - width: 7px; - height: 7px; - border-radius: 50%; - background: var(--dsw-alias-label-tertiary, #8f959e); - box-shadow: 0 0 0 4px color-mix(in srgb, var(--dsw-alias-label-tertiary, #8f959e) 12%, transparent); -} - -.bxf-dot[data-tone="success"] { - background: var(--bxf-success); - box-shadow: 0 0 0 4px color-mix(in srgb, var(--bxf-success) 13%, transparent); -} - -.bxf-dot[data-tone="warning"] { - background: var(--bxf-warning); - box-shadow: 0 0 0 4px color-mix(in srgb, var(--bxf-warning) 13%, transparent); -} - -.bxf-dot[data-tone="error"] { - background: var(--bxf-error); - box-shadow: 0 0 0 4px color-mix(in srgb, var(--bxf-error) 13%, transparent); -} - -.bxf-intro h3 { - font-size: 24px; - line-height: 34px; - font-weight: 650; - letter-spacing: -.02em; -} - -.bxf-introCopy > p { - max-width: 490px; - color: var(--dsw-alias-label-secondary, #646a73); - font-size: 14px; - line-height: 23px; - margin-top: 8px; -} - -.bxf-note { - display: flex; - gap: 8px; - align-items: flex-start; - color: var(--dsw-alias-label-tertiary, #8f959e); - font-size: 12px; - line-height: 18px; - margin-top: 16px; -} - -.bxf-note svg { flex: none; margin-top: 1px; } - -.bxf-actions { - display: flex; - align-items: center; - flex-wrap: wrap; - gap: 10px; - margin-top: 22px; -} - -.bxf-button { - appearance: none; - min-height: 36px; - display: inline-flex; - align-items: center; - justify-content: center; - gap: 7px; - border: 1px solid var(--dsw-alias-border-l2, #dee0e3); - border-radius: 8px; - padding: 7px 13px; - color: var(--dsw-alias-label-primary, #1f2329); - background: var(--dsw-alias-bg-layer-1, #fff); - font: inherit; - font-size: 13px; - font-weight: 550; - line-height: 20px; - text-decoration: none; - cursor: pointer; - 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); -} - -.bxf-button:hover:not(:disabled) { - background: var(--dsw-alias-interactive-bg-hover, #f2f3f5); - border-color: var(--dsw-alias-border-l1, #c9cdd4); -} - -.bxf-button:active:not(:disabled) { transform: translateY(1px); } - -.bxf-button:focus-visible, .bxf-link:focus-visible { - outline: 2px solid var(--bxf-accent); - outline-offset: 2px; -} - -.bxf-button:disabled { cursor: not-allowed; opacity: .55; } - -.bxf-button[data-kind="primary"] { - border-color: var(--bxf-accent); - color: #fff; - background: var(--bxf-accent); - box-shadow: 0 4px 12px color-mix(in srgb, var(--bxf-accent) 24%, transparent); -} - -.bxf-button[data-kind="primary"]:hover:not(:disabled) { - border-color: color-mix(in srgb, var(--bxf-accent) 86%, #000); - background: color-mix(in srgb, var(--bxf-accent) 90%, #000); -} - -.bxf-button[data-kind="danger"] { color: var(--bxf-error); } -.bxf-button[data-size="small"] { min-height: 32px; padding: 5px 10px; font-size: 12px; } -.bxf-bindButton { flex: none; white-space: nowrap; } - -.bxf-provisionCard { - border-color: color-mix(in srgb, var(--bxf-accent) 32%, var(--dsw-alias-border-l2, #dee0e3)); -} - -.bxf-markStage { - position: relative; - width: 156px; - height: 156px; - display: grid; - place-items: center; - justify-self: end; -} - -.bxf-markStage::before, .bxf-markStage::after { - content: ""; - position: absolute; - border-radius: 50%; -} - -.bxf-markStage::before { - inset: 12px; - border: 1px solid color-mix(in srgb, var(--bxf-accent) 18%, var(--dsw-alias-border-l2, #dee0e3)); - background: color-mix(in srgb, var(--bxf-accent) 4%, var(--dsw-alias-bg-layer-1, #fff)); -} - -.bxf-markStage::after { - inset: 0; - border: 1px dashed color-mix(in srgb, var(--bxf-accent) 16%, transparent); - animation: bxf-rotate 18s linear infinite; -} - -.bxf-brandMark { - position: relative; - z-index: 1; - width: 68px; - height: 68px; - display: grid; - place-items: center; - border-radius: 20px; - color: #fff; - background: var(--bxf-accent); - box-shadow: 0 12px 28px color-mix(in srgb, var(--bxf-accent) 28%, transparent); -} - -.bxf-qrLayout { - display: grid; - grid-template-columns: 236px minmax(0, 1fr); - align-items: center; - gap: 32px; -} - -.bxf-qrColumn { min-width: 0; } - -.bxf-qrFrame { - position: relative; - width: 222px; - height: 222px; - display: grid; - place-items: center; - border: 1px solid var(--dsw-alias-border-l2, #dee0e3); - border-radius: 14px; - padding: 13px; - background: #fff; - box-shadow: 0 8px 24px rgba(31, 35, 41, .07); -} - -.bxf-qrFrame::before, .bxf-qrFrame::after { - content: ""; - position: absolute; - width: 24px; - height: 24px; - border-color: var(--bxf-accent); - border-style: solid; -} - -.bxf-qrFrame::before { inset: -3px auto auto -3px; border-width: 2px 0 0 2px; border-radius: 5px 0 0; } -.bxf-qrFrame::after { inset: auto -3px -3px auto; border-width: 0 2px 2px 0; border-radius: 0 0 5px; } -.bxf-qrFrame img { width: 100%; height: 100%; display: block; object-fit: contain; } - -.bxf-qrFallback { - width: 100%; - height: 100%; - display: grid; - place-items: center; - border-radius: 8px; - color: var(--bxf-accent); - background: #f7f9ff; - text-align: center; - padding: 20px; -} - -.bxf-qrFallback span { display: block; color: #646a73; font-size: 12px; line-height: 18px; margin-top: 8px; } - -.bxf-expiredOverlay { - position: absolute; - inset: 10px; - display: grid; - place-items: center; - border-radius: 9px; - color: #1f2329; - background: rgba(255, 255, 255, .94); - backdrop-filter: blur(3px); - font-size: 13px; - font-weight: 600; - text-align: center; -} - -.bxf-countdown { - width: 222px; - color: var(--dsw-alias-label-tertiary, #8f959e); - font-variant-numeric: tabular-nums; - font-size: 11px; - line-height: 17px; - margin-top: 11px; -} - -.bxf-countdownTop { display: flex; align-items: center; justify-content: space-between; gap: 10px; } -.bxf-progress { height: 3px; overflow: hidden; border-radius: 99px; background: var(--dsw-alias-bg-module-platform, #f2f3f5); margin-top: 6px; } -.bxf-progress > span { display: block; width: var(--bxf-progress, 100%); height: 100%; border-radius: inherit; background: var(--bxf-accent); transition: width 1s linear; } - -.bxf-qrCopy h3 { font-size: 20px; line-height: 29px; font-weight: 650; } -.bxf-qrCopy > p { color: var(--dsw-alias-label-secondary, #646a73); font-size: 13px; line-height: 21px; margin-top: 7px; } - -.bxf-steps { counter-reset: bxf-step; display: flex; flex-direction: column; gap: 11px; margin: 20px 0 0; padding: 0; list-style: none; } -.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; } -.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; } - -.bxf-connecting { min-height: 292px; display: grid; place-items: center; text-align: center; padding: 36px 24px; } -.bxf-connectingCopy { max-width: 430px; } -.bxf-orbit { position: relative; width: 86px; height: 86px; display: grid; place-items: center; margin: 0 auto 22px; } -.bxf-orbit::before, .bxf-orbit::after { content: ""; position: absolute; border-radius: 50%; } -.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; } -.bxf-orbit::after { inset: 0; border: 2px solid transparent; border-top-color: var(--bxf-accent); animation: bxf-rotate 1.2s linear infinite; } -.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)); } -.bxf-connecting h3 { font-size: 20px; line-height: 29px; } -.bxf-connecting p { color: var(--dsw-alias-label-secondary, #646a73); font-size: 13px; line-height: 21px; margin-top: 7px; } -.bxf-connectingCompact { min-height: 248px; } - -.bxf-inlineError { - min-height: 190px; - display: grid; - grid-template-columns: 44px minmax(0, 1fr); - align-content: center; - gap: 15px; - padding: 28px; -} - -.bxf-inlineError h3 { font-size: 17px; line-height: 25px; margin: 0; } -.bxf-inlineError p { color: var(--dsw-alias-label-secondary, #646a73); font-size: 13px; line-height: 21px; margin-top: 5px; overflow-wrap: anywhere; } - -.bxf-listSection { display: flex; flex-direction: column; gap: 10px; } -.bxf-listHeading { min-height: 28px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 2px; } -.bxf-listHeading h3 { font-size: 14px; line-height: 22px; font-weight: 650; margin: 0; } -.bxf-botList { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; } -.bxf-botList > li { min-width: 0; } -.bxf-botCard:focus { outline: none; } -.bxf-botCard:focus-visible { outline: 2px solid var(--bxf-accent); outline-offset: 2px; } - -.bxf-connectedTop { display: flex; align-items: center; justify-content: space-between; gap: 20px; } -.bxf-botIdentity { min-width: 0; display: flex; align-items: center; gap: 13px; } -.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%); } -.bxf-botName { min-width: 0; } -.bxf-botName h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; line-height: 24px; font-weight: 650; } -.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; } - -.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; } -.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); } -.bxf-healthPill[data-health="offline"], .bxf-healthPill[data-health="error"] { color: var(--bxf-error); background: color-mix(in srgb, var(--bxf-error) 10%, transparent); } - - -.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); } -.bxf-responseModeHeader { display: contents; color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; line-height: normal; } -.bxf-responseModeHeader > span:first-child { grid-column: 1; grid-row: 1; white-space: nowrap; } -.bxf-responseModeStatus { grid-column: 2; grid-row: 1; color: var(--dsw-alias-label-tertiary, #8f959e); font-size: 12px; white-space: nowrap; } -.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; } -.bxf-responseModeSelect:hover:not(:disabled) { border-color: color-mix(in srgb, var(--bxf-accent) 45%, var(--dsw-alias-border-l2, #dfe1e5)); } -.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); } -.bxf-responseModeSelect:disabled { cursor: not-allowed; opacity: .55; } -.bxf-responseModeHelp { grid-column: 1 / -1; grid-row: 3; color: var(--dsw-alias-label-tertiary, #8f959e); font-size: 11px; line-height: 1.45; } -.bxf-responseModePermissionAction { grid-column: 1 / -1; grid-row: 4; display: flex; justify-content: flex-start; margin-top: 2px; } -.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); } -.bxf-responseModePermissionButton:hover:not(:disabled) { background: color-mix(in srgb, var(--bxf-accent) 7%, transparent); } -.bxf-responseModeError { grid-column: 1 / -1; grid-row: 5; color: var(--bxf-error); font-size: 12px; line-height: 1.4; margin: 0; } - -.bxf-botProvision { - position: relative; - margin-top: 14px; - scroll-margin-block: 20px; - animation: bxf-revealProvision .2s var(--ds-ease-out, ease-out) both; -} -.bxf-botProvision:focus { outline: none; } -.bxf-botProvision:focus-visible { - outline: 2px solid color-mix(in srgb, var(--bxf-accent) 75%, transparent); - outline-offset: 3px; - border-radius: 12px; -} -.bxf-botProvision > .bxf-provisionCard { - border-radius: 11px; - box-shadow: none; - background: color-mix(in srgb, var(--bxf-accent) 2.5%, var(--dsw-alias-bg-layer-3, #fff)); -} -.bxf-botProvision .bxf-cardBody { padding: 18px; } -.bxf-botProvision .bxf-qrLayout { - grid-template-columns: 184px minmax(0, 1fr); - align-items: start; - gap: 24px; -} -.bxf-botProvision .bxf-qrFrame { width: 176px; height: 176px; padding: 10px; border-radius: 11px; } -.bxf-botProvision .bxf-countdown { width: 176px; } -.bxf-botProvision .bxf-qrCopy h3 { font-size: 18px; line-height: 26px; } -.bxf-botProvision .bxf-steps { gap: 8px; margin-top: 14px; } -.bxf-botProvision .bxf-actions { margin-top: 16px; } -.bxf-botProvision .bxf-inlineError { min-height: 160px; padding: 22px; } - -.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); } -.bxf-healthSummary { min-width: 0; color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; line-height: 18px; } -.bxf-healthSummary[data-error="true"] { color: var(--bxf-error); } -.bxf-botActions { position: relative; flex: none; width: 100%; flex-wrap: wrap; gap: 8px; margin-top: 0; justify-content: flex-end; } -.bxf-botActions .bxf-button { flex: none; white-space: nowrap; } -.bxf-botActions .bxf-repairButton { color: var(--bxf-accent); border-color: color-mix(in srgb, var(--bxf-accent) 35%, var(--dsw-alias-border-l2, #dee0e3)); } -.bxf-botActions .bxf-repairButton:hover:not(:disabled) { background: color-mix(in srgb, var(--bxf-accent) 7%, transparent); } -.bxf-repairAction { display: inline-flex; } -.bxf-repairTooltip { - position: absolute; - right: 0; - bottom: calc(100% + 8px); - z-index: 40; - width: min(330px, 100%); - display: grid; - gap: 3px; - padding: 9px 10px; - border: 1px solid var(--dsw-alias-border-l2, #dfe1e5); - border-radius: 8px; - color: var(--dsw-alias-label-primary, #1f2329); - background: var(--dsw-alias-bg-layer-3, #fff); - box-shadow: 0 10px 28px rgb(31 35 41 / 16%); - opacity: 0; - visibility: hidden; - transform: translateY(3px); - pointer-events: none; - transition: opacity .15s ease, transform .15s ease, visibility .15s ease; -} -.bxf-repairTooltip strong { font-size: 12px; line-height: 17px; font-weight: 650; } -.bxf-repairTooltip > span { color: var(--dsw-alias-label-secondary, #646a73); font-size: 11px; line-height: 17px; font-weight: 400; overflow-wrap: anywhere; } -.bxf-repairAction:hover .bxf-repairTooltip, -.bxf-repairAction:focus-within .bxf-repairTooltip { opacity: 1; visibility: visible; transform: translateY(0); } - -.bxf-confirm { - border-top: 1px solid var(--dsw-alias-border-l2, #dee0e3); - background: color-mix(in srgb, var(--bxf-error) 4%, var(--dsw-alias-bg-module-platform, #f7f8fa)); - padding: 17px 24px 20px; -} -.bxf-confirm:focus { outline: none; } -.bxf-confirm h4 { font-size: 13px; line-height: 20px; margin: 0; } -.bxf-confirm p { color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; line-height: 19px; margin: 4px 0 0; } -.bxf-confirm .bxf-actions { margin-top: 12px; } - -.bxf-error { min-height: 252px; display: grid; grid-template-columns: 44px minmax(0, 1fr); align-content: center; gap: 15px; padding: 30px; } -.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); } -.bxf-error h3 { font-size: 17px; line-height: 25px; } -.bxf-error p { color: var(--dsw-alias-label-secondary, #646a73); font-size: 13px; line-height: 21px; margin-top: 5px; overflow-wrap: anywhere; } -.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; } - -.bxf-statusNotice { - display: flex; - align-items: center; - gap: 9px; - border: 1px solid color-mix(in srgb, var(--bxf-warning) 28%, var(--dsw-alias-border-l2, #dee0e3)); - border-radius: 10px; - padding: 9px 11px; - color: var(--dsw-alias-label-secondary, #646a73); - background: color-mix(in srgb, var(--bxf-warning) 5%, var(--dsw-alias-bg-layer-1, #fff)); - font-size: 12px; - line-height: 18px; -} -.bxf-statusNotice > svg { flex: none; color: var(--bxf-warning); } -.bxf-statusNotice > span { min-width: 0; flex: 1; overflow-wrap: anywhere; } - -.bxf-skeleton { min-height: 260px; padding: 28px; } -.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; } -.bxf-skeletonLine:nth-child(1) { width: 92px; } -.bxf-skeletonLine:nth-child(2) { width: 44%; height: 22px; margin-top: 23px; } -.bxf-skeletonLine:nth-child(3) { width: 72%; margin-top: 14px; } -.bxf-skeletonLine:nth-child(4) { width: 58%; margin-top: 9px; } -.bxf-skeletonBox { width: 138px; height: 38px; border-radius: 8px; background: var(--dsw-alias-bg-module-platform, #f2f3f5); margin-top: 28px; } - -.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; } - -@keyframes bxf-rotate { to { transform: rotate(360deg); } } -@keyframes bxf-pulse { 0%, 100% { transform: scale(.9); opacity: .45; } 50% { transform: scale(1.08); opacity: 1; } } -@keyframes bxf-shimmer { to { background-position: -220% 0; } } -@keyframes bxf-revealProvision { from { opacity: 0; transform: translateY(-5px); } } - -@container (max-width: 620px) { - .bxf-headingTools { gap: 6px; } - .bxf-headingTools .bxf-totalBadge { padding-inline: 8px; } - .bxf-headingTools .bxf-bindButton { padding-inline: 10px; } -} - -@media (max-width: 680px) { - .bxf-intro { grid-template-columns: minmax(0, 1fr); } - .bxf-markStage { display: none; } - .bxf-qrLayout { grid-template-columns: minmax(0, 1fr); justify-items: center; } - .bxf-botProvision .bxf-qrLayout { grid-template-columns: minmax(0, 1fr); } - .bxf-qrCopy { width: 100%; } - .bxf-connectedTop { align-items: flex-start; flex-direction: column; } - .bxf-inlineError { grid-template-columns: minmax(0, 1fr); padding: 20px; } - .bxf-statusNotice { align-items: flex-start; flex-wrap: wrap; } - .bxf-cardBody { padding: 20px; } -} - -@media (prefers-reduced-motion: reduce) { - .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; } -} -`; -function installFeishuStyles() { - if (typeof document === "undefined") { - return () => { - }; - } - const existing = document.querySelector( - `style[data-plugin-css="${FEISHU_STYLE_ID}"]` - ); - if (existing) { - return () => { - }; - } - const style = document.createElement("style"); - style.dataset.plugin = "@xmanrui/dsh-feishu"; - style.dataset.pluginCss = FEISHU_STYLE_ID; - style.textContent = CSS3; - document.head.appendChild(style); - return () => { - style.remove(); - }; -} - // plugin-src/client/channels/feishu/index.js var CALLBACK_REPAIR_OPERATION = FEISHU_REGISTRATION_OPERATIONS.CALLBACK_REPAIR; var GROUP_MESSAGE_PERMISSION_OPERATION = FEISHU_REGISTRATION_OPERATIONS.GROUP_MESSAGE_PERMISSION; @@ -5923,6 +5351,578 @@ function FeishuSettingsTab({ rpcCall }) { )); } +// plugin-src/client/channels/feishu/styles.js +var FEISHU_STYLE_ID = "xmanrui-dsh-im-feishu-settings"; +var CSS3 = String.raw` +.bxf-page { + --bxf-accent: var(--dsw-alias-state-business-primary, #3370ff); + --bxf-success: var(--dsw-alias-state-success-primary, #20a162); + --bxf-warning: var(--dsw-alias-state-warn-primary, #d97706); + --bxf-error: var(--dsw-alias-state-error-primary, #d54941); + box-sizing: border-box; + width: 100%; + max-width: 860px; + color: var(--dsw-alias-label-primary, #1f2329); + display: flex; + flex-direction: column; + container-type: inline-size; + gap: 18px; + padding: 2px 0 24px; +} + +.bxf-page *, .bxf-page *::before, .bxf-page *::after { box-sizing: border-box; } + +.bxf-heading { + display: flex; + align-items: flex-start; + justify-content: space-between; + gap: 20px; +} + +.bxf-headingCopy { min-width: 0; } +.bxf-heading h2, .bxf-heading p, .bxf-card h3, .bxf-card p { margin: 0; } + +.bxf-eyebrow { + color: var(--dsw-alias-label-tertiary, #8f959e); + font-size: 12px; + font-weight: 600; + line-height: 18px; + letter-spacing: .08em; + text-transform: uppercase; + margin-bottom: 3px; +} + +.bxf-heading h2 { + font-size: 20px; + line-height: 28px; + font-weight: 650; + letter-spacing: -.015em; +} + +.bxf-heading p { + max-width: 540px; + color: var(--dsw-alias-label-secondary, #646a73); + font-size: 13px; + line-height: 20px; + margin-top: 5px; + white-space: nowrap; +} + +.bxf-headingTools { + width: 100%; + flex: none; + display: flex; + align-items: center; + justify-content: space-between; + flex-wrap: nowrap; + gap: 8px; +} + +.bxf-totalBadge { + min-height: 28px; + display: inline-flex; + align-items: baseline; + gap: 3px; + border-radius: 999px; + padding: 4px 10px; + color: var(--dsw-alias-label-secondary, #646a73); + background: var(--dsw-alias-bg-module-platform, #f2f3f5); + font-size: 11px; + line-height: 16px; + white-space: nowrap; +} + +.bxf-totalBadge strong { color: var(--bxf-success); font-size: 13px; } + +.bxf-card { + position: relative; + overflow: hidden; + border: 1px solid var(--dsw-alias-border-l2, #dee0e3); + border-radius: 14px; + background: var(--dsw-alias-bg-layer-3, #fff); + box-shadow: var(--dsw-shadow-lv1, 0 3px 12px rgba(31, 35, 41, .05)); +} + +.bxf-card::before { + content: ""; + pointer-events: none; + position: absolute; + inset: 0 0 auto; + height: 88px; + background: + radial-gradient(circle at 86% -35%, color-mix(in srgb, var(--bxf-accent) 18%, transparent), transparent 68%); + opacity: .85; +} + +.bxf-cardBody { position: relative; padding: 24px; } + +.bxf-intro { + min-height: 250px; + display: grid; + grid-template-columns: minmax(0, 1fr) 172px; + gap: 32px; + align-items: center; +} + +.bxf-introCopy { max-width: 500px; } + +.bxf-stateLabel { + display: inline-flex; + align-items: center; + gap: 7px; + color: var(--dsw-alias-label-secondary, #646a73); + font-size: 12px; + font-weight: 600; + line-height: 18px; + margin-bottom: 13px; +} + +.bxf-dot { + width: 7px; + height: 7px; + border-radius: 50%; + background: var(--dsw-alias-label-tertiary, #8f959e); + box-shadow: 0 0 0 4px color-mix(in srgb, var(--dsw-alias-label-tertiary, #8f959e) 12%, transparent); +} + +.bxf-dot[data-tone="success"] { + background: var(--bxf-success); + box-shadow: 0 0 0 4px color-mix(in srgb, var(--bxf-success) 13%, transparent); +} + +.bxf-dot[data-tone="warning"] { + background: var(--bxf-warning); + box-shadow: 0 0 0 4px color-mix(in srgb, var(--bxf-warning) 13%, transparent); +} + +.bxf-dot[data-tone="error"] { + background: var(--bxf-error); + box-shadow: 0 0 0 4px color-mix(in srgb, var(--bxf-error) 13%, transparent); +} + +.bxf-intro h3 { + font-size: 24px; + line-height: 34px; + font-weight: 650; + letter-spacing: -.02em; +} + +.bxf-introCopy > p { + max-width: 490px; + color: var(--dsw-alias-label-secondary, #646a73); + font-size: 14px; + line-height: 23px; + margin-top: 8px; +} + +.bxf-note { + display: flex; + gap: 8px; + align-items: flex-start; + color: var(--dsw-alias-label-tertiary, #8f959e); + font-size: 12px; + line-height: 18px; + margin-top: 16px; +} + +.bxf-note svg { flex: none; margin-top: 1px; } + +.bxf-actions { + display: flex; + align-items: center; + flex-wrap: wrap; + gap: 10px; + margin-top: 22px; +} + +.bxf-button { + appearance: none; + min-height: 36px; + display: inline-flex; + align-items: center; + justify-content: center; + gap: 7px; + border: 1px solid var(--dsw-alias-border-l2, #dee0e3); + border-radius: 8px; + padding: 7px 13px; + color: var(--dsw-alias-label-primary, #1f2329); + background: var(--dsw-alias-bg-layer-1, #fff); + font: inherit; + font-size: 13px; + font-weight: 550; + line-height: 20px; + text-decoration: none; + cursor: pointer; + 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); +} + +.bxf-button:hover:not(:disabled) { + background: var(--dsw-alias-interactive-bg-hover, #f2f3f5); + border-color: var(--dsw-alias-border-l1, #c9cdd4); +} + +.bxf-button:active:not(:disabled) { transform: translateY(1px); } + +.bxf-button:focus-visible, .bxf-link:focus-visible { + outline: 2px solid var(--bxf-accent); + outline-offset: 2px; +} + +.bxf-button:disabled { cursor: not-allowed; opacity: .55; } + +.bxf-button[data-kind="primary"] { + border-color: var(--bxf-accent); + color: #fff; + background: var(--bxf-accent); + box-shadow: 0 4px 12px color-mix(in srgb, var(--bxf-accent) 24%, transparent); +} + +.bxf-button[data-kind="primary"]:hover:not(:disabled) { + border-color: color-mix(in srgb, var(--bxf-accent) 86%, #000); + background: color-mix(in srgb, var(--bxf-accent) 90%, #000); +} + +.bxf-button[data-kind="danger"] { color: var(--bxf-error); } +.bxf-button[data-size="small"] { min-height: 32px; padding: 5px 10px; font-size: 12px; } +.bxf-bindButton { flex: none; white-space: nowrap; } + +.bxf-provisionCard { + border-color: color-mix(in srgb, var(--bxf-accent) 32%, var(--dsw-alias-border-l2, #dee0e3)); +} + +.bxf-markStage { + position: relative; + width: 156px; + height: 156px; + display: grid; + place-items: center; + justify-self: end; +} + +.bxf-markStage::before, .bxf-markStage::after { + content: ""; + position: absolute; + border-radius: 50%; +} + +.bxf-markStage::before { + inset: 12px; + border: 1px solid color-mix(in srgb, var(--bxf-accent) 18%, var(--dsw-alias-border-l2, #dee0e3)); + background: color-mix(in srgb, var(--bxf-accent) 4%, var(--dsw-alias-bg-layer-1, #fff)); +} + +.bxf-markStage::after { + inset: 0; + border: 1px dashed color-mix(in srgb, var(--bxf-accent) 16%, transparent); + animation: bxf-rotate 18s linear infinite; +} + +.bxf-brandMark { + position: relative; + z-index: 1; + width: 68px; + height: 68px; + display: grid; + place-items: center; + border-radius: 20px; + color: #fff; + background: var(--bxf-accent); + box-shadow: 0 12px 28px color-mix(in srgb, var(--bxf-accent) 28%, transparent); +} + +.bxf-qrLayout { + display: grid; + grid-template-columns: 236px minmax(0, 1fr); + align-items: center; + gap: 32px; +} + +.bxf-qrColumn { min-width: 0; } + +.bxf-qrFrame { + position: relative; + width: 222px; + height: 222px; + display: grid; + place-items: center; + border: 1px solid var(--dsw-alias-border-l2, #dee0e3); + border-radius: 14px; + padding: 13px; + background: #fff; + box-shadow: 0 8px 24px rgba(31, 35, 41, .07); +} + +.bxf-qrFrame::before, .bxf-qrFrame::after { + content: ""; + position: absolute; + width: 24px; + height: 24px; + border-color: var(--bxf-accent); + border-style: solid; +} + +.bxf-qrFrame::before { inset: -3px auto auto -3px; border-width: 2px 0 0 2px; border-radius: 5px 0 0; } +.bxf-qrFrame::after { inset: auto -3px -3px auto; border-width: 0 2px 2px 0; border-radius: 0 0 5px; } +.bxf-qrFrame img { width: 100%; height: 100%; display: block; object-fit: contain; } + +.bxf-qrFallback { + width: 100%; + height: 100%; + display: grid; + place-items: center; + border-radius: 8px; + color: var(--bxf-accent); + background: #f7f9ff; + text-align: center; + padding: 20px; +} + +.bxf-qrFallback span { display: block; color: #646a73; font-size: 12px; line-height: 18px; margin-top: 8px; } + +.bxf-expiredOverlay { + position: absolute; + inset: 10px; + display: grid; + place-items: center; + border-radius: 9px; + color: #1f2329; + background: rgba(255, 255, 255, .94); + backdrop-filter: blur(3px); + font-size: 13px; + font-weight: 600; + text-align: center; +} + +.bxf-countdown { + width: 222px; + color: var(--dsw-alias-label-tertiary, #8f959e); + font-variant-numeric: tabular-nums; + font-size: 11px; + line-height: 17px; + margin-top: 11px; +} + +.bxf-countdownTop { display: flex; align-items: center; justify-content: space-between; gap: 10px; } +.bxf-progress { height: 3px; overflow: hidden; border-radius: 99px; background: var(--dsw-alias-bg-module-platform, #f2f3f5); margin-top: 6px; } +.bxf-progress > span { display: block; width: var(--bxf-progress, 100%); height: 100%; border-radius: inherit; background: var(--bxf-accent); transition: width 1s linear; } + +.bxf-qrCopy h3 { font-size: 20px; line-height: 29px; font-weight: 650; } +.bxf-qrCopy > p { color: var(--dsw-alias-label-secondary, #646a73); font-size: 13px; line-height: 21px; margin-top: 7px; } + +.bxf-steps { counter-reset: bxf-step; display: flex; flex-direction: column; gap: 11px; margin: 20px 0 0; padding: 0; list-style: none; } +.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; } +.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; } + +.bxf-connecting { min-height: 292px; display: grid; place-items: center; text-align: center; padding: 36px 24px; } +.bxf-connectingCopy { max-width: 430px; } +.bxf-orbit { position: relative; width: 86px; height: 86px; display: grid; place-items: center; margin: 0 auto 22px; } +.bxf-orbit::before, .bxf-orbit::after { content: ""; position: absolute; border-radius: 50%; } +.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; } +.bxf-orbit::after { inset: 0; border: 2px solid transparent; border-top-color: var(--bxf-accent); animation: bxf-rotate 1.2s linear infinite; } +.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)); } +.bxf-connecting h3 { font-size: 20px; line-height: 29px; } +.bxf-connecting p { color: var(--dsw-alias-label-secondary, #646a73); font-size: 13px; line-height: 21px; margin-top: 7px; } +.bxf-connectingCompact { min-height: 248px; } + +.bxf-inlineError { + min-height: 190px; + display: grid; + grid-template-columns: 44px minmax(0, 1fr); + align-content: center; + gap: 15px; + padding: 28px; +} + +.bxf-inlineError h3 { font-size: 17px; line-height: 25px; margin: 0; } +.bxf-inlineError p { color: var(--dsw-alias-label-secondary, #646a73); font-size: 13px; line-height: 21px; margin-top: 5px; overflow-wrap: anywhere; } + +.bxf-listSection { display: flex; flex-direction: column; gap: 10px; } +.bxf-listHeading { min-height: 28px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 2px; } +.bxf-listHeading h3 { font-size: 14px; line-height: 22px; font-weight: 650; margin: 0; } +.bxf-botList { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; } +.bxf-botList > li { min-width: 0; } +.bxf-botCard:focus { outline: none; } +.bxf-botCard:focus-visible { outline: 2px solid var(--bxf-accent); outline-offset: 2px; } + +.bxf-connectedTop { display: flex; align-items: center; justify-content: space-between; gap: 20px; } +.bxf-botIdentity { min-width: 0; display: flex; align-items: center; gap: 13px; } +.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%); } +.bxf-botName { min-width: 0; } +.bxf-botName h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; line-height: 24px; font-weight: 650; } +.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; } + +.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; } +.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); } +.bxf-healthPill[data-health="offline"], .bxf-healthPill[data-health="error"] { color: var(--bxf-error); background: color-mix(in srgb, var(--bxf-error) 10%, transparent); } + + +.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); } +.bxf-responseModeHeader { display: contents; color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; line-height: normal; } +.bxf-responseModeHeader > span:first-child { grid-column: 1; grid-row: 1; white-space: nowrap; } +.bxf-responseModeStatus { grid-column: 2; grid-row: 1; color: var(--dsw-alias-label-tertiary, #8f959e); font-size: 12px; white-space: nowrap; } +.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; } +.bxf-responseModeSelect:hover:not(:disabled) { border-color: color-mix(in srgb, var(--bxf-accent) 45%, var(--dsw-alias-border-l2, #dfe1e5)); } +.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); } +.bxf-responseModeSelect:disabled { cursor: not-allowed; opacity: .55; } +.bxf-responseModeHelp { grid-column: 1 / -1; grid-row: 3; color: var(--dsw-alias-label-tertiary, #8f959e); font-size: 11px; line-height: 1.45; } +.bxf-responseModePermissionAction { grid-column: 1 / -1; grid-row: 4; display: flex; justify-content: flex-start; margin-top: 2px; } +.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); } +.bxf-responseModePermissionButton:hover:not(:disabled) { background: color-mix(in srgb, var(--bxf-accent) 7%, transparent); } +.bxf-responseModeError { grid-column: 1 / -1; grid-row: 5; color: var(--bxf-error); font-size: 12px; line-height: 1.4; margin: 0; } + +.bxf-botProvision { + position: relative; + margin-top: 14px; + scroll-margin-block: 20px; + animation: bxf-revealProvision .2s var(--ds-ease-out, ease-out) both; +} +.bxf-botProvision:focus { outline: none; } +.bxf-botProvision:focus-visible { + outline: 2px solid color-mix(in srgb, var(--bxf-accent) 75%, transparent); + outline-offset: 3px; + border-radius: 12px; +} +.bxf-botProvision > .bxf-provisionCard { + border-radius: 11px; + box-shadow: none; + background: color-mix(in srgb, var(--bxf-accent) 2.5%, var(--dsw-alias-bg-layer-3, #fff)); +} +.bxf-botProvision .bxf-cardBody { padding: 18px; } +.bxf-botProvision .bxf-qrLayout { + grid-template-columns: 184px minmax(0, 1fr); + align-items: start; + gap: 24px; +} +.bxf-botProvision .bxf-qrFrame { width: 176px; height: 176px; padding: 10px; border-radius: 11px; } +.bxf-botProvision .bxf-countdown { width: 176px; } +.bxf-botProvision .bxf-qrCopy h3 { font-size: 18px; line-height: 26px; } +.bxf-botProvision .bxf-steps { gap: 8px; margin-top: 14px; } +.bxf-botProvision .bxf-actions { margin-top: 16px; } +.bxf-botProvision .bxf-inlineError { min-height: 160px; padding: 22px; } + +.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); } +.bxf-healthSummary { min-width: 0; color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; line-height: 18px; } +.bxf-healthSummary[data-error="true"] { color: var(--bxf-error); } +.bxf-botActions { position: relative; flex: none; width: 100%; flex-wrap: wrap; gap: 8px; margin-top: 0; justify-content: flex-end; } +.bxf-botActions .bxf-button { flex: none; white-space: nowrap; } +.bxf-botActions .bxf-repairButton { color: var(--bxf-accent); border-color: color-mix(in srgb, var(--bxf-accent) 35%, var(--dsw-alias-border-l2, #dee0e3)); } +.bxf-botActions .bxf-repairButton:hover:not(:disabled) { background: color-mix(in srgb, var(--bxf-accent) 7%, transparent); } +.bxf-repairAction { display: inline-flex; } +.bxf-repairTooltip { + position: absolute; + right: 0; + bottom: calc(100% + 8px); + z-index: 40; + width: min(330px, 100%); + display: grid; + gap: 3px; + padding: 9px 10px; + border: 1px solid var(--dsw-alias-border-l2, #dfe1e5); + border-radius: 8px; + color: var(--dsw-alias-label-primary, #1f2329); + background: var(--dsw-alias-bg-layer-3, #fff); + box-shadow: 0 10px 28px rgb(31 35 41 / 16%); + opacity: 0; + visibility: hidden; + transform: translateY(3px); + pointer-events: none; + transition: opacity .15s ease, transform .15s ease, visibility .15s ease; +} +.bxf-repairTooltip strong { font-size: 12px; line-height: 17px; font-weight: 650; } +.bxf-repairTooltip > span { color: var(--dsw-alias-label-secondary, #646a73); font-size: 11px; line-height: 17px; font-weight: 400; overflow-wrap: anywhere; } +.bxf-repairAction:hover .bxf-repairTooltip, +.bxf-repairAction:focus-within .bxf-repairTooltip { opacity: 1; visibility: visible; transform: translateY(0); } + +.bxf-confirm { + border-top: 1px solid var(--dsw-alias-border-l2, #dee0e3); + background: color-mix(in srgb, var(--bxf-error) 4%, var(--dsw-alias-bg-module-platform, #f7f8fa)); + padding: 17px 24px 20px; +} +.bxf-confirm:focus { outline: none; } +.bxf-confirm h4 { font-size: 13px; line-height: 20px; margin: 0; } +.bxf-confirm p { color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; line-height: 19px; margin: 4px 0 0; } +.bxf-confirm .bxf-actions { margin-top: 12px; } + +.bxf-error { min-height: 252px; display: grid; grid-template-columns: 44px minmax(0, 1fr); align-content: center; gap: 15px; padding: 30px; } +.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); } +.bxf-error h3 { font-size: 17px; line-height: 25px; } +.bxf-error p { color: var(--dsw-alias-label-secondary, #646a73); font-size: 13px; line-height: 21px; margin-top: 5px; overflow-wrap: anywhere; } +.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; } + +.bxf-statusNotice { + display: flex; + align-items: center; + gap: 9px; + border: 1px solid color-mix(in srgb, var(--bxf-warning) 28%, var(--dsw-alias-border-l2, #dee0e3)); + border-radius: 10px; + padding: 9px 11px; + color: var(--dsw-alias-label-secondary, #646a73); + background: color-mix(in srgb, var(--bxf-warning) 5%, var(--dsw-alias-bg-layer-1, #fff)); + font-size: 12px; + line-height: 18px; +} +.bxf-statusNotice > svg { flex: none; color: var(--bxf-warning); } +.bxf-statusNotice > span { min-width: 0; flex: 1; overflow-wrap: anywhere; } + +.bxf-skeleton { min-height: 260px; padding: 28px; } +.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; } +.bxf-skeletonLine:nth-child(1) { width: 92px; } +.bxf-skeletonLine:nth-child(2) { width: 44%; height: 22px; margin-top: 23px; } +.bxf-skeletonLine:nth-child(3) { width: 72%; margin-top: 14px; } +.bxf-skeletonLine:nth-child(4) { width: 58%; margin-top: 9px; } +.bxf-skeletonBox { width: 138px; height: 38px; border-radius: 8px; background: var(--dsw-alias-bg-module-platform, #f2f3f5); margin-top: 28px; } + +.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; } + +@keyframes bxf-rotate { to { transform: rotate(360deg); } } +@keyframes bxf-pulse { 0%, 100% { transform: scale(.9); opacity: .45; } 50% { transform: scale(1.08); opacity: 1; } } +@keyframes bxf-shimmer { to { background-position: -220% 0; } } +@keyframes bxf-revealProvision { from { opacity: 0; transform: translateY(-5px); } } + +@container (max-width: 620px) { + .bxf-headingTools { gap: 6px; } + .bxf-headingTools .bxf-totalBadge { padding-inline: 8px; } + .bxf-headingTools .bxf-bindButton { padding-inline: 10px; } +} + +@media (max-width: 680px) { + .bxf-intro { grid-template-columns: minmax(0, 1fr); } + .bxf-markStage { display: none; } + .bxf-qrLayout { grid-template-columns: minmax(0, 1fr); justify-items: center; } + .bxf-botProvision .bxf-qrLayout { grid-template-columns: minmax(0, 1fr); } + .bxf-qrCopy { width: 100%; } + .bxf-connectedTop { align-items: flex-start; flex-direction: column; } + .bxf-inlineError { grid-template-columns: minmax(0, 1fr); padding: 20px; } + .bxf-statusNotice { align-items: flex-start; flex-wrap: wrap; } + .bxf-cardBody { padding: 20px; } +} + +@media (prefers-reduced-motion: reduce) { + .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; } +} +`; +function installFeishuStyles() { + if (typeof document === "undefined") { + return () => { + }; + } + const existing = document.querySelector( + `style[data-plugin-css="${FEISHU_STYLE_ID}"]` + ); + if (existing) { + return () => { + }; + } + const style = document.createElement("style"); + style.dataset.plugin = "@xmanrui/dsh-im"; + style.dataset.pluginCss = FEISHU_STYLE_ID; + style.textContent = CSS3; + document.head.appendChild(style); + return () => { + style.remove(); + }; +} + // plugin-src/client/channels/qq/api.js var QQ_RPC_CHANNEL = "/qq"; var QQ_ENDPOINTS = Object.freeze({ @@ -8417,123 +8417,6 @@ function formatRemaining5(milliseconds) { return `${Math.floor(seconds / 60)}:${String(seconds % 60).padStart(2, "0")}`; } -// plugin-src/client/channels/weixin/styles.js -var WEIXIN_STYLE_ID = "xmanrui-dsh-weixin-settings"; -var CSS9 = String.raw` -.dxw-page { - --dxw-accent: #07c160; - --dxw-accent-dark: #05994c; - --dxw-success: var(--dsw-alias-state-success-primary, #20a162); - --dxw-warning: var(--dsw-alias-state-warn-primary, #d97706); - --dxw-error: var(--dsw-alias-state-error-primary, #d54941); - width: 100%; - max-width: 880px; - display: flex; - flex-direction: column; - gap: 18px; - padding: 2px 0 28px; - color: var(--dsw-alias-label-primary, #1f2329); - box-sizing: border-box; -} -.dxw-page *, .dxw-page *::before, .dxw-page *::after { box-sizing: border-box; } -.dxw-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; } -.dxw-heading h2, .dxw-heading p, .dxw-card h3, .dxw-card p { margin: 0; } -.dxw-eyebrow { color: var(--dsw-alias-label-tertiary, #8f959e); font-size: 12px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 3px; } -.dxw-heading h2 { font-size: 20px; line-height: 28px; font-weight: 680; } -.dxw-heading p { color: var(--dsw-alias-label-secondary, #646a73); font-size: 13px; line-height: 20px; margin-top: 5px; white-space: nowrap; } -.dxw-tools, .dxw-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; } -.dxw-tools { width: 100%; justify-content: space-between; flex-wrap: nowrap; } -.dxw-badge { display: inline-flex; align-items: center; gap: 7px; min-height: 30px; padding: 0 11px; border-radius: 999px; color: var(--dsw-alias-label-secondary, #646a73); background: var(--dsw-alias-bg-module-platform, #f2f3f5); font-size: 12px; white-space: nowrap; } -.dxw-dot { width: 8px; height: 8px; border-radius: 50%; background: #aeb3bb; flex: none; } -.dxw-dot[data-tone="success"] { background: var(--dxw-success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--dxw-success) 14%, transparent); } -.dxw-dot[data-tone="warning"] { background: var(--dxw-warning); } -.dxw-dot[data-tone="error"] { background: var(--dxw-error); } -.dxw-button { min-height: 34px; border: 1px solid var(--dsw-alias-border-l2, #dfe1e5); border-radius: 8px; padding: 0 13px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; color: var(--dsw-alias-label-primary, #1f2329); background: var(--dsw-alias-bg-layer-1, #fff); font: inherit; font-size: 13px; font-weight: 560; cursor: pointer; text-decoration: none; transition: border-color .15s ease, background .15s ease, transform .15s ease; } -.dxw-button:hover:not(:disabled) { border-color: #aeb3bb; background: var(--dsw-alias-interactive-bg-hover, #f7f8fa); } -.dxw-button:active:not(:disabled) { transform: translateY(1px); } -.dxw-button:focus-visible, .dxw-input:focus-visible { outline: 2px solid color-mix(in srgb, var(--dxw-accent) 70%, white); outline-offset: 2px; } -.dxw-button:disabled { cursor: not-allowed; opacity: .55; } -.dxw-button[data-kind="primary"] { color: white; border-color: var(--dxw-accent); background: var(--dxw-accent); } -.dxw-button[data-kind="primary"]:hover:not(:disabled) { border-color: var(--dxw-accent-dark); background: var(--dxw-accent-dark); } -.dxw-button[data-kind="danger"] { color: var(--dxw-error); } -.dxw-card { 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 2px rgb(31 35 41 / 3%); } -.dxw-cardBody { padding: 24px; } -.dxw-empty { min-height: 230px; display: grid; grid-template-columns: minmax(0, 1fr) 180px; align-items: center; gap: 30px; } -.dxw-empty h3 { font-size: 18px; margin-bottom: 8px; } -.dxw-empty p { max-width: 560px; color: var(--dsw-alias-label-secondary, #646a73); line-height: 1.65; } -.dxw-empty .dxw-actions { margin-top: 20px; } -.dxw-logo { width: 110px; height: 110px; display: grid; place-items: center; justify-self: center; border-radius: 28px; color: white; background: var(--dxw-accent); box-shadow: 0 18px 45px rgb(7 193 96 / 22%); } -.dxw-logo svg { width: 62px; height: 62px; } -.dxw-qrLayout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 34px; align-items: center; } -.dxw-qrColumn { display: flex; flex-direction: column; align-items: center; gap: 12px; } -.dxw-qrFrame { position: relative; width: 270px; aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; padding: 10px; border: 1px solid var(--dsw-alias-border-l2, #e5e6eb); border-radius: 16px; background: white; } -.dxw-qrFrame img { display: block; width: 100%; height: 100%; object-fit: contain; } -.dxw-qrFallback { padding: 24px; text-align: center; color: #646a73; } -.dxw-expired { position: absolute; inset: 0; display: grid; place-items: center; padding: 30px; color: white; text-align: center; font-weight: 650; background: rgb(31 35 41 / 76%); backdrop-filter: blur(3px); } -.dxw-countdown { width: 270px; color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; } -.dxw-countdown div { display: flex; justify-content: space-between; margin-bottom: 6px; } -.dxw-progress { height: 4px; overflow: hidden; border-radius: 99px; background: #eef0f3; } -.dxw-progress span { display: block; width: var(--dxw-progress); height: 100%; background: var(--dxw-accent); transition: width .2s linear; } -.dxw-qrCopy h3 { margin: 9px 0 8px; font-size: 18px; } -.dxw-qrCopy > p { color: var(--dsw-alias-label-secondary, #646a73); line-height: 1.65; } -.dxw-steps { margin: 18px 0 22px; padding-left: 22px; color: var(--dsw-alias-label-secondary, #646a73); font-size: 13px; line-height: 1.9; } -.dxw-stateLabel { display: inline-flex; align-items: center; gap: 8px; color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; font-weight: 600; } -.dxw-verify { max-width: 560px; margin: 0 auto; padding: 32px; text-align: center; } -.dxw-verify h3 { margin: 8px 0; font-size: 19px; } -.dxw-verify p { color: var(--dsw-alias-label-secondary, #646a73); line-height: 1.6; } -.dxw-codeRow { display: flex; justify-content: center; gap: 10px; margin: 24px 0 10px; } -.dxw-input { width: 190px; height: 42px; padding: 0 14px; border: 1px solid var(--dsw-alias-border-l2, #dfe1e5); border-radius: 9px; background: var(--dsw-alias-bg-layer-1, white); color: inherit; font: inherit; font-size: 18px; letter-spacing: .16em; text-align: center; } -.dxw-statusNotice, .dxw-error { display: flex; align-items: center; gap: 10px; padding: 13px 15px; border: 1px solid color-mix(in srgb, var(--dxw-error) 28%, transparent); border-radius: 10px; color: var(--dxw-error); background: color-mix(in srgb, var(--dxw-error) 7%, transparent); font-size: 13px; } -.dxw-error { align-items: flex-start; flex-direction: column; padding: 22px; } -.dxw-error h3 { font-size: 17px; } -.dxw-errorCode { font-family: ui-monospace, SFMono-Regular, monospace; font-size: 11px; opacity: .8; } -.dxw-listHeading { display: flex; justify-content: space-between; align-items: center; margin: 2px 0 9px; } -.dxw-listHeading h3 { margin: 0; font-size: 14px; } -.dxw-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; } -.dxw-accountTop { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; } -.dxw-accountIdentity { display: flex; align-items: center; gap: 12px; min-width: 0; } -.dxw-avatar { width: 42px; height: 42px; display: grid; place-items: center; flex: none; border-radius: 12px; color: white; background: var(--dxw-accent); } -.dxw-accountIdentity h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; } -.dxw-accountIdentity p { color: var(--dsw-alias-label-secondary, #646a73); font: 12px ui-monospace, SFMono-Regular, monospace; margin-top: 4px; } -.dxw-health { display: inline-flex; align-items: center; gap: 7px; color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; white-space: nowrap; } -.dxw-accountFooter { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding-top: 16px; border-top: 1px solid var(--dsw-alias-border-l1, #eef0f3); } -.dxw-accountFooter .dxw-actions { flex: none; flex-wrap: nowrap; gap: 8px; margin-top: 0; } -.dxw-accountFooter .dxw-button { flex: none; white-space: nowrap; } -.dxw-summary { color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; } -.dxw-confirm { padding: 18px 24px; border-top: 1px solid color-mix(in srgb, var(--dxw-error) 25%, transparent); background: color-mix(in srgb, var(--dxw-error) 5%, transparent); } -.dxw-confirm strong { display: block; font-size: 14px; margin-bottom: 6px; } -.dxw-confirm p { color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; line-height: 1.55; } -.dxw-confirm .dxw-actions { margin-top: 13px; } -.dxw-loading { padding: 36px; color: var(--dsw-alias-label-secondary, #646a73); text-align: center; } -.dxw-spinner { width: 24px; height: 24px; margin: 0 auto 12px; border: 3px solid #e6e8eb; border-top-color: var(--dxw-accent); border-radius: 50%; animation: dxw-spin .8s linear infinite; } -.dxw-visuallyHidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } -@keyframes dxw-spin { to { transform: rotate(360deg); } } -@media (max-width: 720px) { - .dxw-heading, .dxw-accountTop { flex-direction: column; align-items: stretch; } - .dxw-empty { grid-template-columns: minmax(0, 1fr); } - .dxw-logo { display: none; } - .dxw-qrLayout { grid-template-columns: minmax(0, 1fr); justify-items: center; } - .dxw-qrCopy { width: 100%; } - .dxw-cardBody { padding: 20px; } -} -@media (prefers-reduced-motion: reduce) { - .dxw-page *, .dxw-page *::before, .dxw-page *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } -} -`; -function installWeixinStyles() { - if (typeof document === "undefined") return () => { - }; - const existing = document.querySelector(`style[data-plugin-css="${WEIXIN_STYLE_ID}"]`); - if (existing) return () => { - }; - const style = document.createElement("style"); - style.dataset.plugin = "@xmanrui/dsh-weixin"; - style.dataset.pluginCss = WEIXIN_STYLE_ID; - style.textContent = CSS9; - document.head.appendChild(style); - return () => style.remove(); -} - // plugin-src/client/channels/weixin/index.js var Button12 = React18.forwardRef(function Button13({ children, kind = "secondary", className = "", ...props }, ref) { return h2("button", { @@ -9320,6 +9203,123 @@ function WeixinSettingsTab({ rpcCall }) { )); } +// plugin-src/client/channels/weixin/styles.js +var WEIXIN_STYLE_ID = "xmanrui-dsh-im-weixin-settings"; +var CSS9 = String.raw` +.dxw-page { + --dxw-accent: #07c160; + --dxw-accent-dark: #05994c; + --dxw-success: var(--dsw-alias-state-success-primary, #20a162); + --dxw-warning: var(--dsw-alias-state-warn-primary, #d97706); + --dxw-error: var(--dsw-alias-state-error-primary, #d54941); + width: 100%; + max-width: 880px; + display: flex; + flex-direction: column; + gap: 18px; + padding: 2px 0 28px; + color: var(--dsw-alias-label-primary, #1f2329); + box-sizing: border-box; +} +.dxw-page *, .dxw-page *::before, .dxw-page *::after { box-sizing: border-box; } +.dxw-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; } +.dxw-heading h2, .dxw-heading p, .dxw-card h3, .dxw-card p { margin: 0; } +.dxw-eyebrow { color: var(--dsw-alias-label-tertiary, #8f959e); font-size: 12px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 3px; } +.dxw-heading h2 { font-size: 20px; line-height: 28px; font-weight: 680; } +.dxw-heading p { color: var(--dsw-alias-label-secondary, #646a73); font-size: 13px; line-height: 20px; margin-top: 5px; white-space: nowrap; } +.dxw-tools, .dxw-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; } +.dxw-tools { width: 100%; justify-content: space-between; flex-wrap: nowrap; } +.dxw-badge { display: inline-flex; align-items: center; gap: 7px; min-height: 30px; padding: 0 11px; border-radius: 999px; color: var(--dsw-alias-label-secondary, #646a73); background: var(--dsw-alias-bg-module-platform, #f2f3f5); font-size: 12px; white-space: nowrap; } +.dxw-dot { width: 8px; height: 8px; border-radius: 50%; background: #aeb3bb; flex: none; } +.dxw-dot[data-tone="success"] { background: var(--dxw-success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--dxw-success) 14%, transparent); } +.dxw-dot[data-tone="warning"] { background: var(--dxw-warning); } +.dxw-dot[data-tone="error"] { background: var(--dxw-error); } +.dxw-button { min-height: 34px; border: 1px solid var(--dsw-alias-border-l2, #dfe1e5); border-radius: 8px; padding: 0 13px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; color: var(--dsw-alias-label-primary, #1f2329); background: var(--dsw-alias-bg-layer-1, #fff); font: inherit; font-size: 13px; font-weight: 560; cursor: pointer; text-decoration: none; transition: border-color .15s ease, background .15s ease, transform .15s ease; } +.dxw-button:hover:not(:disabled) { border-color: #aeb3bb; background: var(--dsw-alias-interactive-bg-hover, #f7f8fa); } +.dxw-button:active:not(:disabled) { transform: translateY(1px); } +.dxw-button:focus-visible, .dxw-input:focus-visible { outline: 2px solid color-mix(in srgb, var(--dxw-accent) 70%, white); outline-offset: 2px; } +.dxw-button:disabled { cursor: not-allowed; opacity: .55; } +.dxw-button[data-kind="primary"] { color: white; border-color: var(--dxw-accent); background: var(--dxw-accent); } +.dxw-button[data-kind="primary"]:hover:not(:disabled) { border-color: var(--dxw-accent-dark); background: var(--dxw-accent-dark); } +.dxw-button[data-kind="danger"] { color: var(--dxw-error); } +.dxw-card { 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 2px rgb(31 35 41 / 3%); } +.dxw-cardBody { padding: 24px; } +.dxw-empty { min-height: 230px; display: grid; grid-template-columns: minmax(0, 1fr) 180px; align-items: center; gap: 30px; } +.dxw-empty h3 { font-size: 18px; margin-bottom: 8px; } +.dxw-empty p { max-width: 560px; color: var(--dsw-alias-label-secondary, #646a73); line-height: 1.65; } +.dxw-empty .dxw-actions { margin-top: 20px; } +.dxw-logo { width: 110px; height: 110px; display: grid; place-items: center; justify-self: center; border-radius: 28px; color: white; background: var(--dxw-accent); box-shadow: 0 18px 45px rgb(7 193 96 / 22%); } +.dxw-logo svg { width: 62px; height: 62px; } +.dxw-qrLayout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 34px; align-items: center; } +.dxw-qrColumn { display: flex; flex-direction: column; align-items: center; gap: 12px; } +.dxw-qrFrame { position: relative; width: 270px; aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; padding: 10px; border: 1px solid var(--dsw-alias-border-l2, #e5e6eb); border-radius: 16px; background: white; } +.dxw-qrFrame img { display: block; width: 100%; height: 100%; object-fit: contain; } +.dxw-qrFallback { padding: 24px; text-align: center; color: #646a73; } +.dxw-expired { position: absolute; inset: 0; display: grid; place-items: center; padding: 30px; color: white; text-align: center; font-weight: 650; background: rgb(31 35 41 / 76%); backdrop-filter: blur(3px); } +.dxw-countdown { width: 270px; color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; } +.dxw-countdown div { display: flex; justify-content: space-between; margin-bottom: 6px; } +.dxw-progress { height: 4px; overflow: hidden; border-radius: 99px; background: #eef0f3; } +.dxw-progress span { display: block; width: var(--dxw-progress); height: 100%; background: var(--dxw-accent); transition: width .2s linear; } +.dxw-qrCopy h3 { margin: 9px 0 8px; font-size: 18px; } +.dxw-qrCopy > p { color: var(--dsw-alias-label-secondary, #646a73); line-height: 1.65; } +.dxw-steps { margin: 18px 0 22px; padding-left: 22px; color: var(--dsw-alias-label-secondary, #646a73); font-size: 13px; line-height: 1.9; } +.dxw-stateLabel { display: inline-flex; align-items: center; gap: 8px; color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; font-weight: 600; } +.dxw-verify { max-width: 560px; margin: 0 auto; padding: 32px; text-align: center; } +.dxw-verify h3 { margin: 8px 0; font-size: 19px; } +.dxw-verify p { color: var(--dsw-alias-label-secondary, #646a73); line-height: 1.6; } +.dxw-codeRow { display: flex; justify-content: center; gap: 10px; margin: 24px 0 10px; } +.dxw-input { width: 190px; height: 42px; padding: 0 14px; border: 1px solid var(--dsw-alias-border-l2, #dfe1e5); border-radius: 9px; background: var(--dsw-alias-bg-layer-1, white); color: inherit; font: inherit; font-size: 18px; letter-spacing: .16em; text-align: center; } +.dxw-statusNotice, .dxw-error { display: flex; align-items: center; gap: 10px; padding: 13px 15px; border: 1px solid color-mix(in srgb, var(--dxw-error) 28%, transparent); border-radius: 10px; color: var(--dxw-error); background: color-mix(in srgb, var(--dxw-error) 7%, transparent); font-size: 13px; } +.dxw-error { align-items: flex-start; flex-direction: column; padding: 22px; } +.dxw-error h3 { font-size: 17px; } +.dxw-errorCode { font-family: ui-monospace, SFMono-Regular, monospace; font-size: 11px; opacity: .8; } +.dxw-listHeading { display: flex; justify-content: space-between; align-items: center; margin: 2px 0 9px; } +.dxw-listHeading h3 { margin: 0; font-size: 14px; } +.dxw-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; } +.dxw-accountTop { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; } +.dxw-accountIdentity { display: flex; align-items: center; gap: 12px; min-width: 0; } +.dxw-avatar { width: 42px; height: 42px; display: grid; place-items: center; flex: none; border-radius: 12px; color: white; background: var(--dxw-accent); } +.dxw-accountIdentity h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; } +.dxw-accountIdentity p { color: var(--dsw-alias-label-secondary, #646a73); font: 12px ui-monospace, SFMono-Regular, monospace; margin-top: 4px; } +.dxw-health { display: inline-flex; align-items: center; gap: 7px; color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; white-space: nowrap; } +.dxw-accountFooter { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding-top: 16px; border-top: 1px solid var(--dsw-alias-border-l1, #eef0f3); } +.dxw-accountFooter .dxw-actions { flex: none; flex-wrap: nowrap; gap: 8px; margin-top: 0; } +.dxw-accountFooter .dxw-button { flex: none; white-space: nowrap; } +.dxw-summary { color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; } +.dxw-confirm { padding: 18px 24px; border-top: 1px solid color-mix(in srgb, var(--dxw-error) 25%, transparent); background: color-mix(in srgb, var(--dxw-error) 5%, transparent); } +.dxw-confirm strong { display: block; font-size: 14px; margin-bottom: 6px; } +.dxw-confirm p { color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; line-height: 1.55; } +.dxw-confirm .dxw-actions { margin-top: 13px; } +.dxw-loading { padding: 36px; color: var(--dsw-alias-label-secondary, #646a73); text-align: center; } +.dxw-spinner { width: 24px; height: 24px; margin: 0 auto 12px; border: 3px solid #e6e8eb; border-top-color: var(--dxw-accent); border-radius: 50%; animation: dxw-spin .8s linear infinite; } +.dxw-visuallyHidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } +@keyframes dxw-spin { to { transform: rotate(360deg); } } +@media (max-width: 720px) { + .dxw-heading, .dxw-accountTop { flex-direction: column; align-items: stretch; } + .dxw-empty { grid-template-columns: minmax(0, 1fr); } + .dxw-logo { display: none; } + .dxw-qrLayout { grid-template-columns: minmax(0, 1fr); justify-items: center; } + .dxw-qrCopy { width: 100%; } + .dxw-cardBody { padding: 20px; } +} +@media (prefers-reduced-motion: reduce) { + .dxw-page *, .dxw-page *::before, .dxw-page *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } +} +`; +function installWeixinStyles() { + if (typeof document === "undefined") return () => { + }; + const existing = document.querySelector(`style[data-plugin-css="${WEIXIN_STYLE_ID}"]`); + if (existing) return () => { + }; + const style = document.createElement("style"); + style.dataset.plugin = "@xmanrui/dsh-im"; + style.dataset.pluginCss = WEIXIN_STYLE_ID; + style.textContent = CSS9; + document.head.appendChild(style); + return () => style.remove(); +} + // plugin-src/client/channels/whatsapp/api.js var WHATSAPP_RPC_CHANNEL = "/whatsapp"; var WHATSAPP_ENDPOINTS = Object.freeze({ @@ -10917,10 +10917,10 @@ function apply(ctx) { listDirectory: (path, signal) => ctx.workspaces.listDirectory(path, signal), pickDirectory: () => ctx.workspaces.pickDirectory() }); - ctx.slots.inject("settings.plugins.tab", () => ctx.slots.register({ - name: "settings.plugins.tab", - id: "im", - order: 20, + ctx.slots.inject("settings.section", () => ctx.slots.register({ + name: "settings.section", + id: "xmanrui-dsh-im", + order: 21, label: () => t("IM\u673A\u5668\u4EBA"), locale: IM_LOCALE_NAMESPACE, inject: () => ({ diff --git a/lib/index.js b/lib/index.js index 72ac9c7..1088396 100644 --- a/lib/index.js +++ b/lib/index.js @@ -103,7 +103,7 @@ Subsequent messages will use this model and reasoning effort.`,"\u63A8\u7406\u7B {effort} Current model: {model} -Subsequent messages will use this reasoning effort.`,"\u7528\u6CD5\uFF1A/compact\uFF08\u4E0D\u5E26\u53C2\u6570\uFF09":"Usage: /compact (no arguments)","\u6682\u65E0\u53EF\u538B\u7F29\u7684\u5386\u53F2\u8BB0\u5F55\u3002":"No compactable history yet.","\u5F53\u524D\u4F1A\u8BDD\u6B63\u5728\u751F\u6210\u56DE\u590D\u6216\u6267\u884C\u538B\u7F29\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"The current Session is generating a reply or compacting; please try again later.","\u4E0A\u4E0B\u6587\u538B\u7F29\u5DF2\u53D6\u6D88\u3002":"Context compaction was cancelled.","\u538B\u7F29\u671F\u95F4\u4F1A\u8BDD\u5386\u53F2\u53D1\u751F\u53D8\u5316\uFF0C\u672C\u6B21\u672A\u4FEE\u6539\u4F1A\u8BDD\uFF0C\u8BF7\u91CD\u8BD5\u3002":"The Session history changed during compaction; the Session was not modified this time, please try again.","\u672A\u80FD\u751F\u6210\u6709\u6548\u7684\u538B\u7F29\u6458\u8981\uFF0C\u672C\u6B21\u672A\u4FEE\u6539\u4F1A\u8BDD\u3002":"Could not produce a useful compaction summary; the Session was not modified this time.","\u4E0A\u4E0B\u6587\u538B\u7F29\u672A\u6B63\u5E38\u5B8C\u6210\uFF0C\u90E8\u5206\u4F1A\u8BDD\u5386\u53F2\u53EF\u80FD\u5DF2\u53D8\u5316\uFF0C\u8BF7\u68C0\u67E5\u4F1A\u8BDD\u540E\u518D\u91CD\u8BD5\u3002":"Context compaction did not finish cleanly; some Session history may have changed. Please inspect the Session before retrying.","\u4E0A\u4E0B\u6587\u5DF2\u538B\u7F29\uFF0C\u4F46\u4F1A\u8BDD\u4FDD\u5B58\u5931\u8D25\u3002":"Context was compacted, but saving the Session failed.","\u5DF2\u538B\u7F29 {count} \u6761\u5386\u53F2\u8BB0\u5F55\uFF08\u7EA6 {tokens} \u4E2A token\uFF09\u3002":"Compacted {count} history items (~{tokens} tokens).","\u4E0A\u4E0B\u6587\u538B\u7F29\u5B8C\u6210\u3002":"Context compaction completed.","\u4E0A\u4E0B\u6587\u538B\u7F29\u5931\u8D25\u3002":"Context compaction failed.","\u5F53\u524D\u804A\u5929\u7ED1\u5B9A\u7684\u4F1A\u8BDD\u5DF2\u4E0D\u5B58\u5728\uFF0C\u8BF7\u53D1\u9001\u65B0\u6D88\u606F\u5F00\u542F\u4F1A\u8BDD\u3002":"The Session bound to this chat no longer exists; please send a new message to start a Session.","\u5F53\u524D\u4F1A\u8BDD\u6B63\u5728\u751F\u6210\u56DE\u590D\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"The current Session is generating a reply; please try again later.","\u5F53\u524D Harness \u6682\u4E0D\u652F\u6301\u4ECE\u673A\u5668\u4EBA\u6267\u884C\u4E0A\u4E0B\u6587\u538B\u7F29\u3002":"The current Harness does not support running context compaction from a bot yet.","\u4E0A\u4E0B\u6587\u538B\u7F29\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Context compaction failed; please try again later.","\u5F53\u524D\u673A\u5668\u4EBA\u6CA1\u6709\u53EF\u7528\u7684\u4F1A\u8BDD\u72B6\u6001\u3002":"This bot has no available Session state.","\u5F53\u524D\u804A\u5929\u8FD8\u6CA1\u6709\u53EF\u538B\u7F29\u7684\u4F1A\u8BDD\uFF0C\u8BF7\u5148\u53D1\u9001\u4E00\u6761\u6D88\u606F\u3002":"This chat has no Session to compact yet; please send a message first.","\u5F53\u524D\u673A\u5668\u4EBA\u6682\u4E0D\u652F\u6301\u4E0A\u4E0B\u6587\u538B\u7F29\u3002":"This bot does not support context compaction yet.","\u5F53\u524D Harness \u672A\u6CE8\u518C /compact \u547D\u4EE4\uFF0C\u8BF7\u786E\u8BA4\u4E0A\u4E0B\u6587\u538B\u7F29\u7EC4\u4EF6\u5DF2\u542F\u7528\u3002":"The current Harness has not registered the /compact command; please make sure the context compaction component is enabled.","\u7528\u6CD5\uFF1A/stop\uFF08\u4E0D\u5E26\u53C2\u6570\uFF09":"Usage: /stop (no arguments)","\u7528\u6CD5\uFF1A/version\uFF08\u4E0D\u5E26\u53C2\u6570\uFF09":"Usage: /version (no arguments)","\u7528\u6CD5\uFF1A/steer <\u8865\u5145\u6307\u4EE4>":"Usage: /steer ","\u63A7\u5236\u547D\u4EE4\u4EC5\u652F\u6301\u7EAF\u6587\u5B57\uFF0C\u8BF7\u79FB\u9664\u56FE\u7247\u540E\u91CD\u8BD5\u3002":"Control commands support text only; please remove images and try again.","\u5F53\u524D\u804A\u5929\u6CA1\u6709\u6B63\u5728\u8FD0\u884C\u7684\u4EFB\u52A1\u3002":"This chat has no running task.","\u5DF2\u8BF7\u6C42\u505C\u6B62\u5F53\u524D\u4EFB\u52A1\u3002":"Stop requested for the current task.","\u5F53\u524D\u804A\u5929\u6CA1\u6709\u6B63\u5728\u8FD0\u884C\u7684\u4EFB\u52A1\uFF0C\u8BF7\u76F4\u63A5\u53D1\u9001\u666E\u901A\u6D88\u606F\u3002":"This chat has no running task; just send a regular message.","\u5F53\u524D\u804A\u5929\u6CA1\u6709\u7ED1\u5B9A\u4F1A\u8BDD\uFF0C\u65E0\u6CD5\u8865\u5145\u6307\u4EE4\u3002\u8BF7\u5148\u7ED1\u5B9A\u4F1A\u8BDD\u3002":"No session is bound to this chat, so an additional instruction cannot be given. Bind a session first.","\u4EFB\u52A1\u5DF2\u7ED3\u675F\uFF0C\u6CA1\u6709\u6B63\u5728\u8FD0\u884C\u7684\u4EFB\u52A1\uFF0C\u65E0\u6CD5\u8865\u5145\u6307\u4EE4\u3002\u8BF7\u76F4\u63A5\u53D1\u9001\u6D88\u606F\u5F00\u59CB\u65B0\u4EFB\u52A1\u3002":"The task has ended and there is no running task to steer. Send a message to start a new task.","\u5DF2\u63D0\u4EA4\u8865\u5145\u6307\u4EE4\uFF0CAgent \u4F1A\u5728\u4E0B\u4E00\u6B65\u8BFB\u53D6\u3002":"Additional instruction submitted; the Agent will read it at the next step."};var JU={"\u8BF7\u7CBE\u51C6\u56DE\u590D\u300C\u6279\u51C6\u300D\u6216\u300C\u62D2\u7EDD\u300D\uFF08\u4E5F\u652F\u6301\uFF1A\u540C\u610F / \u4E0D\u540C\u610F / yes / no\uFF09\u3002":"Please reply exactly with \u300C\u6279\u51C6\u300D (approve) or \u300C\u62D2\u7EDD\u300D (reject). Also accepted: \u540C\u610F / \u4E0D\u540C\u610F / yes / no.","\u8BF7\u5148\u5B8C\u6210\u5F53\u524D\u95EE\u9898\uFF0C\u518D\u7CBE\u51C6\u56DE\u590D\u300C\u6279\u51C6\u300D\u6216\u300C\u62D2\u7EDD\u300D\u3002":"Please finish the current question first, then reply exactly with \u300C\u6279\u51C6\u300D (approve) or \u300C\u62D2\u7EDD\u300D (reject).","\u8BE5\u5BA1\u6279\u5DF2\u5904\u7406\uFF0C\u65E0\u9700\u518D\u6B21\u56DE\u590D\u3002":"This approval has already been handled; no need to reply again.","DeepSeek Harness \u9700\u8981\u4F60\u7684\u5BA1\u6279\uFF1A":"DeepSeek Harness needs your approval:","\u5DE5\u5177\uFF1A{tool}":"Tool: {tool}","\u64CD\u4F5C\u53C2\u6570\uFF1A":"Operation parameters:","\u539F\u56E0\uFF1A{reason}":"Reason: {reason}","\u7FA4\u804A\u4E2D\u8BF7 @\u673A\u5668\u4EBA \u540E\u53D1\u9001\u5BA1\u6279\u51B3\u5B9A\u3002":"In group chats, please @ the bot before sending your approval decision.","\u53EA\u6709\u53D1\u8D77\u5F53\u524D\u4EFB\u52A1\u7684\u7528\u6237\u53EF\u4EE5\u5904\u7406\u8FD9\u6761\u5BA1\u6279\u3002":"Only the user who started the current task can handle this approval.","\u5BA1\u6279\u51B3\u5B9A\u6B63\u5728\u63D0\u4EA4\uFF0C\u8BF7\u7A0D\u5019\u3002":"Your approval decision is being submitted; please wait.","\u5DF2\u6279\u51C6\uFF0C\u4EC5\u5BF9\u672C\u6B21\u64CD\u4F5C\u6709\u6548\u3002":"Approved \u2014 valid for this operation only.","\u5DF2\u62D2\u7EDD\u6B64\u6B21\u64CD\u4F5C\u3002":"This operation was rejected.","\u65E0\u6CD5\u5B8C\u6574\u5C55\u793A\u8FD9\u6B21\u64CD\u4F5C\uFF0C\u5DF2\u5B89\u5168\u62D2\u7EDD\u6B64\u6B21\u5BA1\u6279\u3002":"The operation could not be displayed in full, so this approval was safely rejected.","\u5BA1\u6279\u63D0\u4EA4\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u56DE\u590D\u300C\u6279\u51C6\u300D\u6216\u300C\u62D2\u7EDD\u300D\u3002":"Failed to submit the approval; please reply with \u300C\u6279\u51C6\u300D (approve) or \u300C\u62D2\u7EDD\u300D (reject) again.","DeepSeek Harness \u9700\u8981\u4F60\u8865\u5145\u4FE1\u606F{progress}\uFF1A":"DeepSeek Harness needs more information{progress}:","\u8BF7\u8F93\u5165\u4F60\u7684\u56DE\u7B54\u3002":"Please enter your answer.","\u8BF7\u56DE\u590D\u9009\u9879\u5E8F\u53F7\u6216\u6587\u5B57\uFF1B\u591A\u9009\u7528\u9017\u53F7\u5206\u9694\uFF0C\u4E5F\u53EF\u8865\u5145\u5176\u4ED6\u5185\u5BB9\u3002":"Reply with option numbers or text; separate multiple choices with commas, or add anything else.","\u8BF7\u56DE\u590D\u4E00\u4E2A\u9009\u9879\u5E8F\u53F7\u6216\u6587\u5B57\uFF0C\u4E5F\u53EF\u76F4\u63A5\u8F93\u5165\u5176\u4ED6\u7B54\u6848\u3002":"Reply with an option number or its text, or type your own answer directly.","\u8BF7\u76F4\u63A5\u56DE\u590D\u4F60\u7684\u7B54\u6848\u3002":"Please reply with your answer directly.","\u7FA4\u804A\u4E2D\u8BF7 @\u673A\u5668\u4EBA \u540E\u53D1\u9001\u7B54\u6848\u3002":"In group chats, please @ the bot before sending your answer.","\u5F53\u524D\u6A21\u578B\u4E0D\u652F\u6301\u56FE\u7247\uFF0C\u8BF7\u7528 /models \u67E5\u770B\u53EF\u7528\u6A21\u578B\uFF0C\u518D\u7528 /model <\u5E8F\u53F7> \u5207\u6362\u540E\u91CD\u53D1\u3002":"The current model does not support images. Use /models to list available models, switch with /model , then resend.","\u56FE\u7247\u8D85\u8FC7\u5BBF\u4E3B\u5141\u8BB8\u7684\u5927\u5C0F\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002":"The image exceeds the size allowed by the host; compress it and try again.","\u56FE\u7247\u5206\u8FA8\u7387\u8FC7\u9AD8\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002":"The image resolution is too high; compress it and try again.","\u56FE\u7247\u5185\u5BB9\u65E0\u6548\u6216\u683C\u5F0F\u4E0D\u53D7\u652F\u6301\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002":"The image content is invalid or its format is unsupported; please resend it.","\u672A\u80FD\u8BFB\u53D6\u56FE\u7247\u5185\u5BB9\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002":"Could not read the image content; please resend it.","\u56FE\u7247\u683C\u5F0F\u4E0E\u5B9E\u9645\u5185\u5BB9\u4E0D\u4E00\u81F4\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002":"The image format does not match its actual content; please resend it.","\u4E00\u6B21\u53D1\u9001\u7684\u56FE\u7247\u6570\u91CF\u8D85\u8FC7\u5BBF\u4E3B\u9650\u5236\uFF0C\u8BF7\u51CF\u5C11\u540E\u91CD\u8BD5\u3002":"The number of images sent at once exceeds the host limit; send fewer and try again.","\u56FE\u7247\u603B\u5927\u5C0F\u8D85\u8FC7\u5BBF\u4E3B\u9650\u5236\uFF0C\u8BF7\u51CF\u5C11\u56FE\u7247\u6216\u538B\u7F29\u540E\u91CD\u8BD5\u3002":"The total image size exceeds the host limit; send fewer images or compress them and try again.","\u56FE\u7247\u4E0B\u8F7D\u5730\u5740\u53D1\u751F\u4E86\u91CD\u5B9A\u5411\uFF0C\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6\u3002":"The image download URL redirected and cannot be read right now.","\u56FE\u7247\u4E0B\u8F7D\u5931\u8D25\uFF08HTTP {status}\uFF09\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u540E\u518D\u8BD5\u3002":"Image download failed (HTTP {status}); please resend it and try again.","\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002":"The image is larger than 5 MB; compress it and try again.","\u4E00\u6B21\u6700\u591A\u53EA\u80FD\u5904\u7406 {maxImages} \u5F20\u56FE\u7247\u3002":"At most {maxImages} images can be processed at once.","\u4E00\u6B21\u53D1\u9001\u7684\u56FE\u7247\u603B\u5927\u5C0F\u8FC7\u5927\uFF0C\u8BF7\u51CF\u5C11\u56FE\u7247\u6570\u91CF\u6216\u538B\u7F29\u540E\u91CD\u8BD5\u3002":"The total size of the images sent is too large; send fewer images or compress them and try again.","\u56FE\u7247\u4E0B\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u540E\u518D\u8BD5\u3002":"Image download failed; please resend it and try again.","\u6682\u4E0D\u652F\u6301\u8BE5\u56FE\u7247\u683C\u5F0F\uFF0C\u8BF7\u53D1\u9001 JPEG\u3001PNG\u3001WebP \u6216 GIF \u56FE\u7247\u3002":"This image format is not supported yet; please send a JPEG, PNG, WebP, or GIF image.","\u2705 DeepSeek Harness \u8FDE\u63A5\u6D4B\u8BD5\u6210\u529F":"\u2705 DeepSeek Harness connection test succeeded","\u8FD9\u6761\u6D88\u606F\u7531\u63D2\u4EF6\u9875\u9762\u4E2D\u7684\u201C{name}\u201D\u673A\u5668\u4EBA\u5361\u7247\u53D1\u51FA\u3002":'This message was sent from the "{name}" bot card on the plugin page.',"{channelLabel}\u5C1A\u672A\u6536\u5230\u53EF\u7528\u4E8E\u6D4B\u8BD5\u7684\u79C1\u804A\u6D88\u606F\u3002":"The {channelLabel} has not received a direct message that can be used for testing yet.",\u673A\u5668\u4EBA:"bot","\u6B63\u5728\u5904\u7406\u2026":"Processing\u2026","\u5904\u7406\u5B8C\u6210\u3002":"Processing complete.",\u5DE5\u5177:"tool","\u6B63\u5728\u6574\u7406\u7ED3\u679C\u2026":"Gathering results\u2026","_\u6B63\u5728\u641C\u7D22\u7F51\u7EDC\u5E76\u6574\u7406\u4FE1\u606F\u2026_":"_Searching the web and gathering information\u2026_","_\u6B63\u5728\u4F7F\u7528 {name}\u2026_":"_Using {name}\u2026_","\u8BF7\u5206\u6790\u8FD9\u5F20\u56FE\u7247\u3002":"Analyze this image.","\u6587\u4EF6\u63A5\u6536\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u540E\u518D\u8BD5\u3002":"File reception failed. Please resend it.","\u6587\u4EF6\u4E0B\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u540E\u518D\u8BD5\u3002":"File download failed. Please resend it.","Agent Preset \u65E0\u6548\u3002":"Invalid Agent Preset.","/batch \u5F00\u59CB\u6279\u91CF\u8F93\u5165\uFF08\u4EC5\u79C1\u804A\uFF0C\u6700\u591A 10 \u6761\u6587\u5B57\uFF09":"/batch Start batch input (direct messages only, up to 10 text messages)","/send \u63D0\u4EA4\u5F53\u524D\u6279\u6B21":"/send Submit the current batch","/cancel \u53D6\u6D88\u5F53\u524D\u6279\u6B21":"/cancel Cancel the current batch","\u5F00\u59CB\u6279\u91CF\u8F93\u5165\uFF08\u4EC5\u79C1\u804A\uFF09":"Start batch input (direct messages only)",\u63D0\u4EA4\u5F53\u524D\u6279\u6B21:"Submit the current batch",\u53D6\u6D88\u5F53\u524D\u6279\u6B21:"Cancel the current batch","\u5F53\u524D\u5DF2\u5904\u4E8E\u6279\u91CF\u8F93\u5165\u6A21\u5F0F\uFF0C\u5DF2\u6536\u96C6 {count}/{limit} \u6761\u3002\n\u8BF7\u53D1\u9001 /send \u63D0\u4EA4\u6216 /cancel \u53D6\u6D88\u3002":`Batch input is already active with {count}/{limit} messages collected. +Subsequent messages will use this reasoning effort.`,"\u7528\u6CD5\uFF1A/compact\uFF08\u4E0D\u5E26\u53C2\u6570\uFF09":"Usage: /compact (no arguments)","\u6682\u65E0\u53EF\u538B\u7F29\u7684\u5386\u53F2\u8BB0\u5F55\u3002":"No compactable history yet.","\u5F53\u524D\u4F1A\u8BDD\u6B63\u5728\u751F\u6210\u56DE\u590D\u6216\u6267\u884C\u538B\u7F29\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"The current Session is generating a reply or compacting; please try again later.","\u4E0A\u4E0B\u6587\u538B\u7F29\u5DF2\u53D6\u6D88\u3002":"Context compaction was cancelled.","\u538B\u7F29\u671F\u95F4\u4F1A\u8BDD\u5386\u53F2\u53D1\u751F\u53D8\u5316\uFF0C\u672C\u6B21\u672A\u4FEE\u6539\u4F1A\u8BDD\uFF0C\u8BF7\u91CD\u8BD5\u3002":"The Session history changed during compaction; the Session was not modified this time, please try again.","\u672A\u80FD\u751F\u6210\u6709\u6548\u7684\u538B\u7F29\u6458\u8981\uFF0C\u672C\u6B21\u672A\u4FEE\u6539\u4F1A\u8BDD\u3002":"Could not produce a useful compaction summary; the Session was not modified this time.","\u4E0A\u4E0B\u6587\u538B\u7F29\u672A\u6B63\u5E38\u5B8C\u6210\uFF0C\u90E8\u5206\u4F1A\u8BDD\u5386\u53F2\u53EF\u80FD\u5DF2\u53D8\u5316\uFF0C\u8BF7\u68C0\u67E5\u4F1A\u8BDD\u540E\u518D\u91CD\u8BD5\u3002":"Context compaction did not finish cleanly; some Session history may have changed. Please inspect the Session before retrying.","\u4E0A\u4E0B\u6587\u5DF2\u538B\u7F29\uFF0C\u4F46\u4F1A\u8BDD\u4FDD\u5B58\u5931\u8D25\u3002":"Context was compacted, but saving the Session failed.","\u5DF2\u538B\u7F29 {count} \u6761\u5386\u53F2\u8BB0\u5F55\uFF08\u7EA6 {tokens} \u4E2A token\uFF09\u3002":"Compacted {count} history items (~{tokens} tokens).","\u4E0A\u4E0B\u6587\u538B\u7F29\u5B8C\u6210\u3002":"Context compaction completed.","\u4E0A\u4E0B\u6587\u538B\u7F29\u5931\u8D25\u3002":"Context compaction failed.","\u5F53\u524D\u804A\u5929\u7ED1\u5B9A\u7684\u4F1A\u8BDD\u5DF2\u4E0D\u5B58\u5728\uFF0C\u8BF7\u53D1\u9001\u65B0\u6D88\u606F\u5F00\u542F\u4F1A\u8BDD\u3002":"The Session bound to this chat no longer exists; please send a new message to start a Session.","\u5F53\u524D\u4F1A\u8BDD\u6B63\u5728\u751F\u6210\u56DE\u590D\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"The current Session is generating a reply; please try again later.","\u5F53\u524D Harness \u6682\u4E0D\u652F\u6301\u4ECE\u673A\u5668\u4EBA\u6267\u884C\u4E0A\u4E0B\u6587\u538B\u7F29\u3002":"The current Harness does not support running context compaction from a bot yet.","\u4E0A\u4E0B\u6587\u538B\u7F29\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Context compaction failed; please try again later.","\u5F53\u524D\u673A\u5668\u4EBA\u6CA1\u6709\u53EF\u7528\u7684\u4F1A\u8BDD\u72B6\u6001\u3002":"This bot has no available Session state.","\u5F53\u524D\u804A\u5929\u8FD8\u6CA1\u6709\u53EF\u538B\u7F29\u7684\u4F1A\u8BDD\uFF0C\u8BF7\u5148\u53D1\u9001\u4E00\u6761\u6D88\u606F\u3002":"This chat has no Session to compact yet; please send a message first.","\u5F53\u524D\u673A\u5668\u4EBA\u6682\u4E0D\u652F\u6301\u4E0A\u4E0B\u6587\u538B\u7F29\u3002":"This bot does not support context compaction yet.","\u5F53\u524D Harness \u672A\u6CE8\u518C /compact \u547D\u4EE4\uFF0C\u8BF7\u786E\u8BA4\u4E0A\u4E0B\u6587\u538B\u7F29\u7EC4\u4EF6\u5DF2\u542F\u7528\u3002":"The current Harness has not registered the /compact command; please make sure the context compaction component is enabled.","\u7528\u6CD5\uFF1A/stop\uFF08\u4E0D\u5E26\u53C2\u6570\uFF09":"Usage: /stop (no arguments)","\u7528\u6CD5\uFF1A/version\uFF08\u4E0D\u5E26\u53C2\u6570\uFF09":"Usage: /version (no arguments)","\u7528\u6CD5\uFF1A/steer <\u8865\u5145\u6307\u4EE4>":"Usage: /steer ","\u63A7\u5236\u547D\u4EE4\u4EC5\u652F\u6301\u7EAF\u6587\u5B57\uFF0C\u8BF7\u79FB\u9664\u56FE\u7247\u540E\u91CD\u8BD5\u3002":"Control commands support text only; please remove images and try again.","\u5F53\u524D\u804A\u5929\u6CA1\u6709\u6B63\u5728\u8FD0\u884C\u7684\u4EFB\u52A1\u3002":"This chat has no running task.","\u5DF2\u8BF7\u6C42\u505C\u6B62\u5F53\u524D\u4EFB\u52A1\u3002":"Stop requested for the current task.","\u5F53\u524D\u804A\u5929\u6CA1\u6709\u6B63\u5728\u8FD0\u884C\u7684\u4EFB\u52A1\uFF0C\u8BF7\u76F4\u63A5\u53D1\u9001\u666E\u901A\u6D88\u606F\u3002":"This chat has no running task; just send a regular message.","\u5F53\u524D\u804A\u5929\u6CA1\u6709\u7ED1\u5B9A\u4F1A\u8BDD\uFF0C\u65E0\u6CD5\u8865\u5145\u6307\u4EE4\u3002\u8BF7\u5148\u7ED1\u5B9A\u4F1A\u8BDD\u3002":"No session is bound to this chat, so an additional instruction cannot be given. Bind a session first.","\u4EFB\u52A1\u5DF2\u7ED3\u675F\uFF0C\u6CA1\u6709\u6B63\u5728\u8FD0\u884C\u7684\u4EFB\u52A1\uFF0C\u65E0\u6CD5\u8865\u5145\u6307\u4EE4\u3002\u8BF7\u76F4\u63A5\u53D1\u9001\u6D88\u606F\u5F00\u59CB\u65B0\u4EFB\u52A1\u3002":"The task has ended and there is no running task to steer. Send a message to start a new task.","\u5DF2\u63D0\u4EA4\u8865\u5145\u6307\u4EE4\uFF0CAgent \u4F1A\u5728\u4E0B\u4E00\u6B65\u8BFB\u53D6\u3002":"Additional instruction submitted; the Agent will read it at the next step."};var JU={"\u8BF7\u7CBE\u51C6\u56DE\u590D\u300C\u6279\u51C6\u300D\u6216\u300C\u62D2\u7EDD\u300D\uFF08\u4E5F\u652F\u6301\uFF1A\u540C\u610F / \u4E0D\u540C\u610F / yes / no\uFF09\u3002":"Please reply exactly with \u300C\u6279\u51C6\u300D (approve) or \u300C\u62D2\u7EDD\u300D (reject). Also accepted: \u540C\u610F / \u4E0D\u540C\u610F / yes / no.","\u8BF7\u5148\u5B8C\u6210\u5F53\u524D\u95EE\u9898\uFF0C\u518D\u7CBE\u51C6\u56DE\u590D\u300C\u6279\u51C6\u300D\u6216\u300C\u62D2\u7EDD\u300D\u3002":"Please finish the current question first, then reply exactly with \u300C\u6279\u51C6\u300D (approve) or \u300C\u62D2\u7EDD\u300D (reject).","\u8BE5\u5BA1\u6279\u5DF2\u5904\u7406\uFF0C\u65E0\u9700\u518D\u6B21\u56DE\u590D\u3002":"This approval has already been handled; no need to reply again.","DeepSeek Harness \u9700\u8981\u4F60\u7684\u5BA1\u6279\uFF1A":"DeepSeek Harness needs your approval:","\u5DE5\u5177\uFF1A{tool}":"Tool: {tool}","\u64CD\u4F5C\u53C2\u6570\uFF1A":"Operation parameters:","\u539F\u56E0\uFF1A{reason}":"Reason: {reason}","\u7FA4\u804A\u4E2D\u8BF7 @\u673A\u5668\u4EBA \u540E\u53D1\u9001\u5BA1\u6279\u51B3\u5B9A\u3002":"In group chats, please @ the bot before sending your approval decision.","\u53EA\u6709\u53D1\u8D77\u5F53\u524D\u4EFB\u52A1\u7684\u7528\u6237\u53EF\u4EE5\u5904\u7406\u8FD9\u6761\u5BA1\u6279\u3002":"Only the user who started the current task can handle this approval.","\u5BA1\u6279\u51B3\u5B9A\u6B63\u5728\u63D0\u4EA4\uFF0C\u8BF7\u7A0D\u5019\u3002":"Your approval decision is being submitted; please wait.","\u5DF2\u6279\u51C6\uFF0C\u4EC5\u5BF9\u672C\u6B21\u64CD\u4F5C\u6709\u6548\u3002":"Approved \u2014 valid for this operation only.","\u5DF2\u62D2\u7EDD\u6B64\u6B21\u64CD\u4F5C\u3002":"This operation was rejected.","\u65E0\u6CD5\u5B8C\u6574\u5C55\u793A\u8FD9\u6B21\u64CD\u4F5C\uFF0C\u5DF2\u5B89\u5168\u62D2\u7EDD\u6B64\u6B21\u5BA1\u6279\u3002":"The operation could not be displayed in full, so this approval was safely rejected.","\u5BA1\u6279\u63D0\u4EA4\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u56DE\u590D\u300C\u6279\u51C6\u300D\u6216\u300C\u62D2\u7EDD\u300D\u3002":"Failed to submit the approval; please reply with \u300C\u6279\u51C6\u300D (approve) or \u300C\u62D2\u7EDD\u300D (reject) again.","DeepSeek Harness \u9700\u8981\u4F60\u8865\u5145\u4FE1\u606F{progress}\uFF1A":"DeepSeek Harness needs more information{progress}:","\u8BF7\u8F93\u5165\u4F60\u7684\u56DE\u7B54\u3002":"Please enter your answer.","\u8BF7\u56DE\u590D\u9009\u9879\u5E8F\u53F7\u6216\u6587\u5B57\uFF1B\u591A\u9009\u7528\u9017\u53F7\u5206\u9694\uFF0C\u4E5F\u53EF\u8865\u5145\u5176\u4ED6\u5185\u5BB9\u3002":"Reply with option numbers or text; separate multiple choices with commas, or add anything else.","\u8BF7\u56DE\u590D\u4E00\u4E2A\u9009\u9879\u5E8F\u53F7\u6216\u6587\u5B57\uFF0C\u4E5F\u53EF\u76F4\u63A5\u8F93\u5165\u5176\u4ED6\u7B54\u6848\u3002":"Reply with an option number or its text, or type your own answer directly.","\u8BF7\u76F4\u63A5\u56DE\u590D\u4F60\u7684\u7B54\u6848\u3002":"Please reply with your answer directly.","\u7FA4\u804A\u4E2D\u8BF7 @\u673A\u5668\u4EBA \u540E\u53D1\u9001\u7B54\u6848\u3002":"In group chats, please @ the bot before sending your answer.","\u5F53\u524D\u6A21\u578B\u4E0D\u652F\u6301\u56FE\u7247\uFF0C\u8BF7\u7528 /models \u67E5\u770B\u53EF\u7528\u6A21\u578B\uFF0C\u518D\u7528 /model <\u5E8F\u53F7> \u5207\u6362\u540E\u91CD\u53D1\u3002":"The current model does not support images. Use /models to list available models, switch with /model , then resend.","\u56FE\u7247\u8D85\u8FC7\u5BBF\u4E3B\u5141\u8BB8\u7684\u5927\u5C0F\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002":"The image exceeds the size allowed by the host; compress it and try again.","\u56FE\u7247\u5206\u8FA8\u7387\u8FC7\u9AD8\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002":"The image resolution is too high; compress it and try again.","\u56FE\u7247\u5185\u5BB9\u65E0\u6548\u6216\u683C\u5F0F\u4E0D\u53D7\u652F\u6301\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002":"The image content is invalid or its format is unsupported; please resend it.","\u672A\u80FD\u8BFB\u53D6\u56FE\u7247\u5185\u5BB9\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002":"Could not read the image content; please resend it.","\u56FE\u7247\u683C\u5F0F\u4E0E\u5B9E\u9645\u5185\u5BB9\u4E0D\u4E00\u81F4\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002":"The image format does not match its actual content; please resend it.","\u4E00\u6B21\u53D1\u9001\u7684\u56FE\u7247\u6570\u91CF\u8D85\u8FC7\u5BBF\u4E3B\u9650\u5236\uFF0C\u8BF7\u51CF\u5C11\u540E\u91CD\u8BD5\u3002":"The number of images sent at once exceeds the host limit; send fewer and try again.","\u56FE\u7247\u603B\u5927\u5C0F\u8D85\u8FC7\u5BBF\u4E3B\u9650\u5236\uFF0C\u8BF7\u51CF\u5C11\u56FE\u7247\u6216\u538B\u7F29\u540E\u91CD\u8BD5\u3002":"The total image size exceeds the host limit; send fewer images or compress them and try again.","\u56FE\u7247\u4E0B\u8F7D\u5730\u5740\u53D1\u751F\u4E86\u91CD\u5B9A\u5411\uFF0C\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6\u3002":"The image download URL redirected and cannot be read right now.","\u56FE\u7247\u4E0B\u8F7D\u5931\u8D25\uFF08HTTP {status}\uFF09\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u540E\u518D\u8BD5\u3002":"Image download failed (HTTP {status}); please resend it and try again.","\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002":"The image is larger than 5 MB; compress it and try again.","\u4E00\u6B21\u6700\u591A\u53EA\u80FD\u5904\u7406 {maxImages} \u5F20\u56FE\u7247\u3002":"At most {maxImages} images can be processed at once.","\u4E00\u6B21\u53D1\u9001\u7684\u56FE\u7247\u603B\u5927\u5C0F\u8FC7\u5927\uFF0C\u8BF7\u51CF\u5C11\u56FE\u7247\u6570\u91CF\u6216\u538B\u7F29\u540E\u91CD\u8BD5\u3002":"The total size of the images sent is too large; send fewer images or compress them and try again.","\u56FE\u7247\u4E0B\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u540E\u518D\u8BD5\u3002":"Image download failed; please resend it and try again.","\u6682\u4E0D\u652F\u6301\u8BE5\u56FE\u7247\u683C\u5F0F\uFF0C\u8BF7\u53D1\u9001 JPEG\u3001PNG\u3001WebP \u6216 GIF \u56FE\u7247\u3002":"This image format is not supported yet; please send a JPEG, PNG, WebP, or GIF image.","\u2705 DeepSeek Harness \u8FDE\u63A5\u6D4B\u8BD5\u6210\u529F":"\u2705 DeepSeek Harness connection test succeeded","\u8FD9\u6761\u6D88\u606F\u7531\u300CIM\u673A\u5668\u4EBA\u300D\u8BBE\u7F6E\u9875\u4E2D\u7684\u201C{name}\u201D\u673A\u5668\u4EBA\u5361\u7247\u53D1\u51FA\u3002":'This message was sent from the "{name}" bot card on the IM Bot settings page.',"{channelLabel}\u5C1A\u672A\u6536\u5230\u53EF\u7528\u4E8E\u6D4B\u8BD5\u7684\u79C1\u804A\u6D88\u606F\u3002":"The {channelLabel} has not received a direct message that can be used for testing yet.",\u673A\u5668\u4EBA:"bot","\u6B63\u5728\u5904\u7406\u2026":"Processing\u2026","\u5904\u7406\u5B8C\u6210\u3002":"Processing complete.",\u5DE5\u5177:"tool","\u6B63\u5728\u6574\u7406\u7ED3\u679C\u2026":"Gathering results\u2026","_\u6B63\u5728\u641C\u7D22\u7F51\u7EDC\u5E76\u6574\u7406\u4FE1\u606F\u2026_":"_Searching the web and gathering information\u2026_","_\u6B63\u5728\u4F7F\u7528 {name}\u2026_":"_Using {name}\u2026_","\u8BF7\u5206\u6790\u8FD9\u5F20\u56FE\u7247\u3002":"Analyze this image.","\u6587\u4EF6\u63A5\u6536\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u540E\u518D\u8BD5\u3002":"File reception failed. Please resend it.","\u6587\u4EF6\u4E0B\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u540E\u518D\u8BD5\u3002":"File download failed. Please resend it.","Agent Preset \u65E0\u6548\u3002":"Invalid Agent Preset.","/batch \u5F00\u59CB\u6279\u91CF\u8F93\u5165\uFF08\u4EC5\u79C1\u804A\uFF0C\u6700\u591A 10 \u6761\u6587\u5B57\uFF09":"/batch Start batch input (direct messages only, up to 10 text messages)","/send \u63D0\u4EA4\u5F53\u524D\u6279\u6B21":"/send Submit the current batch","/cancel \u53D6\u6D88\u5F53\u524D\u6279\u6B21":"/cancel Cancel the current batch","\u5F00\u59CB\u6279\u91CF\u8F93\u5165\uFF08\u4EC5\u79C1\u804A\uFF09":"Start batch input (direct messages only)",\u63D0\u4EA4\u5F53\u524D\u6279\u6B21:"Submit the current batch",\u53D6\u6D88\u5F53\u524D\u6279\u6B21:"Cancel the current batch","\u5F53\u524D\u5DF2\u5904\u4E8E\u6279\u91CF\u8F93\u5165\u6A21\u5F0F\uFF0C\u5DF2\u6536\u96C6 {count}/{limit} \u6761\u3002\n\u8BF7\u53D1\u9001 /send \u63D0\u4EA4\u6216 /cancel \u53D6\u6D88\u3002":`Batch input is already active with {count}/{limit} messages collected. Send /send to submit or /cancel to cancel.`,"\u5F53\u524D\u5DF2\u5904\u4E8E\u6279\u91CF\u8F93\u5165\u6A21\u5F0F\uFF0C\u5DF2\u6536\u96C6 {count}/{limit} \u6761\u3002\n\u5B8C\u6210\u540E\u53D1\u9001 /send\uFF0C\u53D6\u6D88\u8BF7\u53D1\u9001 /cancel\u3002":`Batch input is already active with {count}/{limit} messages collected. Send /send when finished or /cancel to cancel.`,"[\u6D88\u606F {index}]":"[Message {index}]","\u4EE5\u4E0B\u662F\u7528\u6237\u901A\u8FC7\u6279\u91CF\u8F93\u5165\u6A21\u5F0F\u53D1\u9001\u7684\u591A\u6761\u5185\u5BB9\uFF0C\u8BF7\u6309\u987A\u5E8F\u4F5C\u4E3A\u540C\u4E00\u6B21\u8F93\u5165\u7EDF\u4E00\u5904\u7406\u3002":"The user sent the following messages in batch input mode. Process them in order as one input.","\u6279\u91CF\u8F93\u5165\u6A21\u5F0F\u4EC5\u652F\u6301\u79C1\u804A\uFF0C\u8BF7\u5728\u4E0E\u673A\u5668\u4EBA\u7684\u79C1\u804A\u4E2D\u4F7F\u7528\u3002":"Batch input is available only in direct messages. Please use it in a direct chat with the bot.","\u5F53\u524D\u804A\u5929\u6709\u6B63\u5728\u8FD0\u884C\u7684\u4EFB\u52A1\u3001\u5F85\u56DE\u7B54\u95EE\u9898\u6216\u5F85\u5BA1\u6279\u8BF7\u6C42\u3002\n\u8BF7\u5148\u5B8C\u6210\u5F53\u524D\u4EA4\u4E92\u6216\u53D1\u9001 /stop\uFF0C\u518D\u4F7F\u7528 /batch\u3002":`This chat has a running task, unanswered question, or pending approval. Finish the current interaction or send /stop before using /batch.`,"\u7528\u6CD5\uFF1A/{command}\uFF08\u4E0D\u5E26\u53C2\u6570\uFF09":"Usage: /{command} (without arguments)","\u6279\u91CF\u8F93\u5165\u547D\u4EE4\u4EC5\u652F\u6301\u7EAF\u6587\u5B57\uFF0C\u8BF7\u79FB\u9664\u56FE\u7247\u6216\u6587\u4EF6\u540E\u91CD\u8BD5\u3002":"Batch input commands support text only. Remove the image or file and try again.","\u5F53\u524D\u6CA1\u6709\u5F85\u63D0\u4EA4\u7684\u6279\u91CF\u5185\u5BB9\uFF0C\u8BF7\u5148\u53D1\u9001 /batch\u3002":"There is no batch to submit. Send /batch first.","\u5F53\u524D\u6CA1\u6709\u6B63\u5728\u8FDB\u884C\u7684\u6279\u91CF\u8F93\u5165\u3002":"There is no active batch input.","\u5DF2\u8FDB\u5165\u6279\u91CF\u8F93\u5165\u6A21\u5F0F\uFF0C\u6700\u591A\u53EF\u53D1\u9001 {limit} \u6761\u6587\u5B57\u3002\n\u5B8C\u6210\u540E\u53D1\u9001 /send\uFF0C\u53D6\u6D88\u8BF7\u53D1\u9001 /cancel\u3002":`Batch input started. You can send up to {limit} text messages. @@ -111,7 +111,7 @@ Send /send when finished or /cancel to cancel.`,"\u6279\u91CF\u8F93\u5165\u6A21\ Continue with text, or use /send or /cancel.`,"\u5F53\u524D\u6279\u6B21\u6B63\u5728\u63D0\u4EA4\uFF0C\u8BF7\u52FF\u91CD\u590D\u53D1\u9001 /send\u3002":"The current batch is being submitted. Do not send /send again.","\u6279\u91CF\u5185\u5BB9\u5DF2\u7ECF\u63D0\u4EA4\uFF0C\u65E0\u6CD5\u53D6\u6D88\u3002\n\u5982\u9700\u505C\u6B62\u5F53\u524D\u4EFB\u52A1\uFF0C\u8BF7\u53D1\u9001 /stop\u3002":`The batch has already been submitted and cannot be cancelled. Send /stop if you need to stop the current task.`,"\u5F53\u524D\u6279\u6B21\u6B63\u5728\u63D0\u4EA4\uFF0C\u8BF7\u7B49\u5F85\u5904\u7406\u5B8C\u6210\u540E\u518D\u5F00\u542F\u65B0\u6279\u6B21\u3002":"The current batch is being submitted. Wait for it to finish before starting another batch.","\u5DF2\u53D6\u6D88\u6279\u91CF\u8F93\u5165\u3002":"Batch input cancelled.","\u5DF2\u53D6\u6D88\u6279\u91CF\u8F93\u5165\uFF0C\u5171\u4E22\u5F03 {count} \u6761\u6D88\u606F\u3002":"Batch input cancelled; {count} messages were discarded.","\u5F53\u524D\u6279\u6B21\u8FD8\u6CA1\u6709\u5185\u5BB9\uFF0C\u8BF7\u5148\u53D1\u9001\u6587\u5B57\uFF0C\u6216\u4F7F\u7528 /cancel \u53D6\u6D88\u3002":"The current batch is empty. Send some text first or use /cancel.","\u5F53\u524D\u6B63\u5728\u6279\u91CF\u8F93\u5165\uFF0C\u8BF7\u5148\u53D1\u9001 /send \u63D0\u4EA4\u6216 /cancel \u53D6\u6D88\u3002":"Batch input is active. Send /send to submit or /cancel to cancel first.","\u5F53\u524D\u6279\u6B21\u5DF2\u6EE1\uFF0C\u8FD9\u6761\u6D88\u606F\u672A\u6536\u5F55\u3002\n\u8BF7\u5148\u53D1\u9001 /send \u63D0\u4EA4\u6216 /cancel \u53D6\u6D88\uFF0C\u7136\u540E\u91CD\u65B0\u53D1\u9001\u8FD9\u6761\u6D88\u606F\u3002":`The current batch is full, so this message was not collected. Send /send or /cancel first, then resend this message.`,"\u5DF2\u6536\u96C6 {count}/{limit} \u6761\uFF0C\u5F53\u524D\u6279\u6B21\u5DF2\u6EE1\uFF0C\u8BF7\u53D1\u9001 /send \u63D0\u4EA4\u6216 /cancel \u53D6\u6D88\u3002":"Collected {count}/{limit} messages. The batch is full; send /send or /cancel.","\u6279\u91CF\u5185\u5BB9\u63D0\u4EA4\u5931\u8D25\uFF0C\u5DF2\u4FDD\u7559 {count} \u6761\u6D88\u606F\u3002\n\u8BF7\u518D\u6B21\u53D1\u9001 /send \u91CD\u8BD5\u6216 /cancel \u53D6\u6D88\u3002":`Batch submission failed; {count} messages were retained. -Send /send to retry or /cancel to cancel.`};var qU={"\u5317\u6C47\u661F\u6CB3 AIOS \u5DF2\u8FDE\u63A5 DeepSeek Harness\u3002":"BeiHui XingHe AIOS is connected to DeepSeek Harness.","/repair \u8865\u5168\u98DE\u4E66\u6743\u9650\u4E0E\u5361\u7247\u56DE\u8C03":"/repair Complete Feishu permissions and the card callback","/m\uFF08\u6216 /menu\uFF09 \u6253\u5F00\u4EA4\u4E92\u5361\u7247\u83DC\u5355":"/m (or /menu) Open the interactive card menu","/watch [Session ID \u6216\u5E8F\u53F7] \u5173\u6CE8\u4F1A\u8BDD\uFF0C\u4EFB\u52A1\u5B8C\u6210\u81EA\u52A8\u63A8\u9001":"/watch [Session ID or index] Watch a session; completion is pushed automatically","/unwatch [Session ID \u6216\u5E8F\u53F7] \u53D6\u6D88\u5173\u6CE8":"/unwatch [Session ID or index] Stop watching","/watchlist \u67E5\u770B\u5173\u6CE8\u5217\u8868":"/watchlist View the watch list","/archived on|off \u4F1A\u8BDD\u5217\u8868\u662F\u5426\u5305\u542B\u5F52\u6863\u4F1A\u8BDD":"/archived on|off Whether the session list includes archived sessions","\u5DE5\u4F5C\u533A\u5FC5\u987B\u662F\u7EDD\u5BF9\u8DEF\u5F84\u3002":"The workspace must be an absolute path.","\u5DE5\u4F5C\u533A\u8DEF\u5F84\u4E0D\u5B58\u5728\u3002":"The workspace path does not exist.","\u5DE5\u4F5C\u533A\u8DEF\u5F84\u5FC5\u987B\u6307\u5411\u4E00\u4E2A\u76EE\u5F55\u3002":"The workspace path must point to a directory.","\u673A\u5668\u4EBA\u6B63\u5728\u79FB\u9664\u6216\u5DF2\u91CD\u65B0\u63A5\u5165\uFF0C\u65E0\u6CD5\u64CD\u4F5C\u539F\u4F1A\u8BDD\u7684\u5DE5\u4F5C\u533A\u3002":"The bot is being removed or has been reconnected; the original session\u2019s workspace cannot be changed.","\u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"The operation failed. Please try again later.","\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u673A\u5668\u4EBA\u7F3A\u5C11\u98DE\u4E66\u6587\u4EF6\u4E0A\u4F20\u6743\u9650 im:resource\u3002\u8BF7\u79C1\u804A\u673A\u5668\u4EBA\u6267\u884C /repair \u547D\u4EE4\uFF0C\u6216\u8005\u5728\u63D2\u4EF6\u9875\u9762\u70B9\u51FB\u201C\u8865\u5168\u6743\u9650\u201D\u6309\u94AE\u5E76\u626B\u7801\u3002\u5B8C\u6210\u98DE\u4E66\u8981\u6C42\u7684\u53D1\u5E03\u5BA1\u6279\u540E\u91CD\u8BD5\u3002":'The result file "{name}" was generated, but the bot lacks the Feishu file-upload scope im:resource. Run /repair in a direct chat with the bot, or click the \u201CComplete permissions\u201D button on the plugin page and scan the QR code. Complete any publishing approval Feishu requires, then try again.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u8D85\u8FC7\u98DE\u4E66 30 MB \u4E0A\u9650\uFF0C\u672A\u53D1\u9001\u3002":'The result file "{name}" exceeds the Feishu 30 MB limit and was not sent.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u4E3A\u7A7A\uFF0C\u98DE\u4E66\u4E0D\u5141\u8BB8\u53D1\u9001\u7A7A\u6587\u4EF6\u3002":'The result file "{name}" is empty; Feishu does not allow sending empty files.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u88AB\u98DE\u4E66\u9650\u6D41\uFF0C\u672A\u80FD\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":'The result file "{name}" was temporarily rate-limited by Feishu and could not be sent. Please try again later.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u6682\u65F6\u672A\u80FD\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":'The result file "{name}" was generated but could not be sent right now. Please try again later.',"\u5904\u7406\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002\u5982\u679C\u95EE\u9898\u6301\u7EED\uFF0C\u8BF7\u5728 DeepSeek Harness \u7684\u98DE\u4E66\u63D2\u4EF6\u9875\u9762\u68C0\u67E5\u8FDE\u63A5\u72B6\u6001\u3002":"Message processing failed. Please try again later. If the problem persists, check the connection status on the Feishu plugin page in DeepSeek Harness.","\u5DF2\u5F00\u542F\u5168\u65B0 Harness \u4F1A\u8BDD\u3002":"A brand-new Harness session has started.","\u98DE\u4E66\u673A\u5668\u4EBA\u4E0E DeepSeek Harness \u8FDE\u63A5\u6B63\u5E38\u3002":"The Feishu bot is connected to DeepSeek Harness and working normally.","\u7528\u6CD5\uFF1A/archived on\uFF08\u5305\u542B\u5F52\u6863\u4F1A\u8BDD\uFF09\u6216 /archived off\uFF08\u9690\u85CF\u5F52\u6863\u4F1A\u8BDD\uFF09":"Usage: /archived on (include archived sessions) or /archived off (hide archived sessions)","\u5DF2\u5F00\u542F\uFF1A\u4F1A\u8BDD\u5217\u8868\u5305\u542B\u5F52\u6863\u4F1A\u8BDD\u3002":"On: the session list includes archived sessions.","\u5DF2\u5173\u95ED\uFF1A\u4F1A\u8BDD\u5217\u8868\u9690\u85CF\u5F52\u6863\u4F1A\u8BDD\u3002":"Off: the session list hides archived sessions.","\u4E3A\u907F\u514D\u6388\u6743\u94FE\u63A5\u66B4\u9732\uFF0C\u8BF7\u79C1\u804A\u673A\u5668\u4EBA\u53D1\u9001 /repair\u3002":"To keep the authorization link private, send /repair to the bot in a direct message.","\u65E0\u6CD5\u8BC6\u522B\u5F53\u524D\u53D1\u9001\u8005\uFF0C\u672A\u53D1\u8D77\u4FEE\u590D\u3002":"The current sender could not be identified, so repair was not started.","\u5F53\u524D Host \u7248\u672C\u6682\u4E0D\u652F\u6301\u804A\u5929\u5185\u4FEE\u590D\uFF0C\u8BF7\u5148\u66F4\u65B0\u63D2\u4EF6\u3002":"The current Host version does not support in-chat repair. Update the plugin first.","\u7528\u6CD5\uFF1A/repair\u3001/repair qr\u3001/repair status\u3001/repair cancel \u6216 /repair verify":"Usage: /repair, /repair qr, /repair status, /repair cancel, or /repair verify","\u5F53\u524D Runtime \u6CA1\u6709\u53EF\u6062\u590D\u7684\u4FEE\u590D\u4EFB\u52A1\u8BB0\u5F55\uFF08\u673A\u5668\u4EBA\u53EF\u80FD\u521A\u5B8C\u6210\u5BC6\u94A5\u66F4\u65B0\u5E76\u91CD\u542F\uFF09\u3002\u672C\u547D\u4EE4\u4E0D\u4F1A\u542F\u52A8\u65B0\u7684\u6388\u6743\uFF1B\u8BF7\u67E5\u770B\u673A\u5668\u4EBA\u53D1\u9001\u7684\u9A8C\u8BC1\u7ED3\u679C\uFF0C\u786E\u8BA4\u4E0A\u4E00\u6B21\u4EFB\u52A1\u5DF2\u7ED3\u675F\u540E\u518D\u53D1\u9001 /repair\u3002":"The current Runtime has no recoverable repair attempt (the bot may have just rotated its secret and restarted). This command starts no new authorization. Check the verification result the bot sent, then send /repair after the previous attempt has finished.","\u53E6\u4E00\u4F4D\u7528\u6237\u6B63\u5728\u4FEE\u590D\u8BE5\u673A\u5668\u4EBA\uFF0C\u672C\u6B21\u4E0D\u4F1A\u663E\u793A\u5176\u6388\u6743\u4FE1\u606F\u3002":"Another user is repairing this bot; its authorization info will not be shown this time.","\u6682\u65F6\u65E0\u6CD5\u53D6\u6D88\u4FEE\u590D\u4EFB\u52A1\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Could not cancel the repair task right now. Please try again later.","\u6682\u65F6\u65E0\u6CD5\u53D6\u6D88\u65E7\u4FEE\u590D\u4EFB\u52A1\uFF0C\u672A\u751F\u6210\u65B0\u94FE\u63A5\uFF1B\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Could not cancel the previous repair attempt, so no new link was generated. Please try again later.","\u6682\u65F6\u65E0\u6CD5\u67E5\u8BE2\u4FEE\u590D\u72B6\u6001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Could not check the repair status right now. Please try again later.","\u4FEE\u590D\u6D41\u7A0B\u6682\u65F6\u5931\u8D25\uFF0C\u73B0\u6709\u673A\u5668\u4EBA\u8FDE\u63A5\u4E0D\u53D7\u5F71\u54CD\uFF1B\u8BF7\u7A0D\u540E\u53D1\u9001 /repair \u91CD\u8BD5\u3002":"The repair flow failed for now; the existing bot connection is unaffected. Send /repair again later.","\u98DE\u4E66\u8FD4\u56DE\u4E86\u65E0\u6CD5\u5B89\u5168\u9A8C\u8BC1\u7684\u6388\u6743\u94FE\u63A5\uFF0C\u5DF2\u4E2D\u6B62\u672C\u6B21\u4FEE\u590D\u3002":"Feishu returned an authorization link that cannot be verified safely. This repair was aborted.","\u98DE\u4E66\u672A\u8FD4\u56DE\u6388\u6743\u94FE\u63A5\uFF0C\u5DF2\u4E2D\u6B62\u672C\u6B21\u4FEE\u590D\u3002":"Feishu did not return an authorization link. This repair was aborted.","\u6388\u6743\u5DF2\u786E\u8BA4\uFF0C\u6B63\u5728\u53D1\u9001\u5E76\u7B49\u5F85\u6D4B\u8BD5\u6309\u94AE\u56DE\u8C03\uFF1B\u6536\u5230\u771F\u5B9E\u56DE\u8C03\u540E\u624D\u4F1A\u5B8C\u6210\u3002":"Authorization confirmed. Sending a test button and waiting for its callback; this completes only after a real callback arrives.","\u4FEE\u590D\u72B6\u6001\u67E5\u8BE2\u4E2D\u65AD\uFF0C\u73B0\u6709\u673A\u5668\u4EBA\u8FDE\u63A5\u4E0D\u53D7\u5F71\u54CD\uFF1B\u53D1\u9001 /repair status \u91CD\u8BD5\u67E5\u8BE2\u3002":"The repair status query was interrupted; the existing bot connection is unaffected. Send /repair status to retry.",\u94FE\u63A5\u4E3A\u77ED\u671F\u6709\u6548:"The link is valid for a short time.","\u94FE\u63A5\u7EA6 {minutes} \u5206\u949F\u540E\u8FC7\u671F":"The link expires in about {minutes} minutes","\u65E7\u6388\u6743\u94FE\u63A5\u5DF2\u4F5C\u5E9F\uFF0C\u5DF2\u751F\u6210\u65B0\u7684\u4FEE\u590D\u94FE\u63A5\u3002":"The previous authorization link was invalidated and a new repair link was generated.","\u{1F527} \u51C6\u5907\u8865\u5168\u6743\u9650\u4E0E\u56DE\u8C03\u3002":"\u{1F527} Preparing to complete permissions and the callback.","\u672C\u6B21\u6700\u591A\u589E\u91CF\u6DFB\u52A0\u4E09\u9879\uFF1A\u5361\u7247\u56DE\u8C03 card.action.trigger\uFF1B\u98DE\u4E66\u663E\u793A\u4E3A\u201C\u83B7\u53D6\u5355\u804A\u3001\u7FA4\u7EC4\u6D88\u606F\u201D\u7684\u79DF\u6237\u6743\u9650 im:message:readonly\uFF08\u7528\u4E8E\u8BFB\u53D6\u7528\u6237\u6D88\u606F\u4E2D\u7684\u56FE\u7247\u6216\u6587\u4EF6\uFF09\uFF1B\u4EE5\u53CA im:resource\uFF08\u7528\u4E8E\u4E0A\u4F20\u673A\u5668\u4EBA\u53D1\u9001\u7684\u56FE\u7247\u6216\u6587\u4EF6\uFF09\u3002\u786E\u8BA4\u9875\u53EA\u4F1A\u663E\u793A\u5F53\u524D\u7F3A\u5C11\u7684\u9879\uFF1B\u82E5\u51FA\u73B0\u4E0A\u8FF0\u8303\u56F4\u4E4B\u5916\u7684\u914D\u7F6E\uFF0C\u8BF7\u53D6\u6D88\u3002":"This may incrementally add up to three items: the card callback card.action.trigger; the tenant scope im:message:readonly, shown by Feishu as \u201CRead direct and group messages\u201D and used to read images or files in user messages; and im:resource, used to upload images or files sent by the bot. The confirmation page shows only items the app is currently missing; cancel if anything outside this scope appears.","\u5F53\u524D\u8BBE\u5907\u76F4\u63A5\u6253\u5F00\uFF1A":"Open directly on this device:","\u82E5\u8981\u7528\u53E6\u4E00\u53F0\u8BBE\u5907\u626B\u7801\uFF0C\u53D1\u9001 /repair qr\u3002{expiry}\u3002":"To scan with another device, send /repair qr. {expiry}.","\u8BF7\u7528\u53E6\u4E00\u53F0\u8BBE\u5907\u626B\u7801\u5B8C\u6210\u6388\u6743{remaining}\u3002":"Complete authorization by scanning with another device{remaining}.","\uFF08\u5269\u4F59\u7EA6 {minutes} \u5206\u949F\uFF09":" (about {minutes} minutes left)","\u4E8C\u7EF4\u7801\u6682\u65F6\u65E0\u6CD5\u53D1\u9001\uFF0C\u8BF7\u76F4\u63A5\u6253\u5F00\u6388\u6743\u94FE\u63A5\uFF1A\n{url}":`The QR code could not be sent. Open the authorization link directly: +Send /send to retry or /cancel to cancel.`};var qU={"\u5317\u6C47\u661F\u6CB3 AIOS \u5DF2\u8FDE\u63A5 DeepSeek Harness\u3002":"BeiHui XingHe AIOS is connected to DeepSeek Harness.","/repair \u8865\u5168\u98DE\u4E66\u6743\u9650\u4E0E\u5361\u7247\u56DE\u8C03":"/repair Complete Feishu permissions and the card callback","/m\uFF08\u6216 /menu\uFF09 \u6253\u5F00\u4EA4\u4E92\u5361\u7247\u83DC\u5355":"/m (or /menu) Open the interactive card menu","/watch [Session ID \u6216\u5E8F\u53F7] \u5173\u6CE8\u4F1A\u8BDD\uFF0C\u4EFB\u52A1\u5B8C\u6210\u81EA\u52A8\u63A8\u9001":"/watch [Session ID or index] Watch a session; completion is pushed automatically","/unwatch [Session ID \u6216\u5E8F\u53F7] \u53D6\u6D88\u5173\u6CE8":"/unwatch [Session ID or index] Stop watching","/watchlist \u67E5\u770B\u5173\u6CE8\u5217\u8868":"/watchlist View the watch list","/archived on|off \u4F1A\u8BDD\u5217\u8868\u662F\u5426\u5305\u542B\u5F52\u6863\u4F1A\u8BDD":"/archived on|off Whether the session list includes archived sessions","\u5DE5\u4F5C\u533A\u5FC5\u987B\u662F\u7EDD\u5BF9\u8DEF\u5F84\u3002":"The workspace must be an absolute path.","\u5DE5\u4F5C\u533A\u8DEF\u5F84\u4E0D\u5B58\u5728\u3002":"The workspace path does not exist.","\u5DE5\u4F5C\u533A\u8DEF\u5F84\u5FC5\u987B\u6307\u5411\u4E00\u4E2A\u76EE\u5F55\u3002":"The workspace path must point to a directory.","\u673A\u5668\u4EBA\u6B63\u5728\u79FB\u9664\u6216\u5DF2\u91CD\u65B0\u63A5\u5165\uFF0C\u65E0\u6CD5\u64CD\u4F5C\u539F\u4F1A\u8BDD\u7684\u5DE5\u4F5C\u533A\u3002":"The bot is being removed or has been reconnected; the original session\u2019s workspace cannot be changed.","\u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"The operation failed. Please try again later.","\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u673A\u5668\u4EBA\u7F3A\u5C11\u98DE\u4E66\u6587\u4EF6\u4E0A\u4F20\u6743\u9650 im:resource\u3002\u8BF7\u79C1\u804A\u673A\u5668\u4EBA\u6267\u884C /repair \u547D\u4EE4\uFF0C\u6216\u8005\u5728\u300CIM\u673A\u5668\u4EBA\u300D\u8BBE\u7F6E\u9875\u70B9\u51FB\u201C\u8865\u5168\u6743\u9650\u201D\u6309\u94AE\u5E76\u626B\u7801\u3002\u5B8C\u6210\u98DE\u4E66\u8981\u6C42\u7684\u53D1\u5E03\u5BA1\u6279\u540E\u91CD\u8BD5\u3002":'The result file "{name}" was generated, but the bot lacks the Feishu file-upload scope im:resource. Run /repair in a direct chat with the bot, or click the \u201CComplete permissions\u201D button on the IM Bot settings page and scan the QR code. Complete any publishing approval Feishu requires, then try again.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u8D85\u8FC7\u98DE\u4E66 30 MB \u4E0A\u9650\uFF0C\u672A\u53D1\u9001\u3002":'The result file "{name}" exceeds the Feishu 30 MB limit and was not sent.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u4E3A\u7A7A\uFF0C\u98DE\u4E66\u4E0D\u5141\u8BB8\u53D1\u9001\u7A7A\u6587\u4EF6\u3002":'The result file "{name}" is empty; Feishu does not allow sending empty files.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u88AB\u98DE\u4E66\u9650\u6D41\uFF0C\u672A\u80FD\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":'The result file "{name}" was temporarily rate-limited by Feishu and could not be sent. Please try again later.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u6682\u65F6\u672A\u80FD\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":'The result file "{name}" was generated but could not be sent right now. Please try again later.',"\u5904\u7406\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002\u5982\u679C\u95EE\u9898\u6301\u7EED\uFF0C\u8BF7\u5728 DeepSeek Harness \u7684\u300CIM\u673A\u5668\u4EBA\u300D\u8BBE\u7F6E\u9875\u68C0\u67E5\u98DE\u4E66\u8FDE\u63A5\u72B6\u6001\u3002":"Message processing failed. Please try again later. If the problem persists, check the Feishu connection status on the IM Bot settings page in DeepSeek Harness.","\u5DF2\u5F00\u542F\u5168\u65B0 Harness \u4F1A\u8BDD\u3002":"A brand-new Harness session has started.","\u98DE\u4E66\u673A\u5668\u4EBA\u4E0E DeepSeek Harness \u8FDE\u63A5\u6B63\u5E38\u3002":"The Feishu bot is connected to DeepSeek Harness and working normally.","\u7528\u6CD5\uFF1A/archived on\uFF08\u5305\u542B\u5F52\u6863\u4F1A\u8BDD\uFF09\u6216 /archived off\uFF08\u9690\u85CF\u5F52\u6863\u4F1A\u8BDD\uFF09":"Usage: /archived on (include archived sessions) or /archived off (hide archived sessions)","\u5DF2\u5F00\u542F\uFF1A\u4F1A\u8BDD\u5217\u8868\u5305\u542B\u5F52\u6863\u4F1A\u8BDD\u3002":"On: the session list includes archived sessions.","\u5DF2\u5173\u95ED\uFF1A\u4F1A\u8BDD\u5217\u8868\u9690\u85CF\u5F52\u6863\u4F1A\u8BDD\u3002":"Off: the session list hides archived sessions.","\u4E3A\u907F\u514D\u6388\u6743\u94FE\u63A5\u66B4\u9732\uFF0C\u8BF7\u79C1\u804A\u673A\u5668\u4EBA\u53D1\u9001 /repair\u3002":"To keep the authorization link private, send /repair to the bot in a direct message.","\u65E0\u6CD5\u8BC6\u522B\u5F53\u524D\u53D1\u9001\u8005\uFF0C\u672A\u53D1\u8D77\u4FEE\u590D\u3002":"The current sender could not be identified, so repair was not started.","\u5F53\u524D Host \u7248\u672C\u6682\u4E0D\u652F\u6301\u804A\u5929\u5185\u4FEE\u590D\uFF0C\u8BF7\u5148\u66F4\u65B0\u63D2\u4EF6\u3002":"The current Host version does not support in-chat repair. Update the plugin first.","\u7528\u6CD5\uFF1A/repair\u3001/repair qr\u3001/repair status\u3001/repair cancel \u6216 /repair verify":"Usage: /repair, /repair qr, /repair status, /repair cancel, or /repair verify","\u5F53\u524D Runtime \u6CA1\u6709\u53EF\u6062\u590D\u7684\u4FEE\u590D\u4EFB\u52A1\u8BB0\u5F55\uFF08\u673A\u5668\u4EBA\u53EF\u80FD\u521A\u5B8C\u6210\u5BC6\u94A5\u66F4\u65B0\u5E76\u91CD\u542F\uFF09\u3002\u672C\u547D\u4EE4\u4E0D\u4F1A\u542F\u52A8\u65B0\u7684\u6388\u6743\uFF1B\u8BF7\u67E5\u770B\u673A\u5668\u4EBA\u53D1\u9001\u7684\u9A8C\u8BC1\u7ED3\u679C\uFF0C\u786E\u8BA4\u4E0A\u4E00\u6B21\u4EFB\u52A1\u5DF2\u7ED3\u675F\u540E\u518D\u53D1\u9001 /repair\u3002":"The current Runtime has no recoverable repair attempt (the bot may have just rotated its secret and restarted). This command starts no new authorization. Check the verification result the bot sent, then send /repair after the previous attempt has finished.","\u53E6\u4E00\u4F4D\u7528\u6237\u6B63\u5728\u4FEE\u590D\u8BE5\u673A\u5668\u4EBA\uFF0C\u672C\u6B21\u4E0D\u4F1A\u663E\u793A\u5176\u6388\u6743\u4FE1\u606F\u3002":"Another user is repairing this bot; its authorization info will not be shown this time.","\u6682\u65F6\u65E0\u6CD5\u53D6\u6D88\u4FEE\u590D\u4EFB\u52A1\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Could not cancel the repair task right now. Please try again later.","\u6682\u65F6\u65E0\u6CD5\u53D6\u6D88\u65E7\u4FEE\u590D\u4EFB\u52A1\uFF0C\u672A\u751F\u6210\u65B0\u94FE\u63A5\uFF1B\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Could not cancel the previous repair attempt, so no new link was generated. Please try again later.","\u6682\u65F6\u65E0\u6CD5\u67E5\u8BE2\u4FEE\u590D\u72B6\u6001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Could not check the repair status right now. Please try again later.","\u4FEE\u590D\u6D41\u7A0B\u6682\u65F6\u5931\u8D25\uFF0C\u73B0\u6709\u673A\u5668\u4EBA\u8FDE\u63A5\u4E0D\u53D7\u5F71\u54CD\uFF1B\u8BF7\u7A0D\u540E\u53D1\u9001 /repair \u91CD\u8BD5\u3002":"The repair flow failed for now; the existing bot connection is unaffected. Send /repair again later.","\u98DE\u4E66\u8FD4\u56DE\u4E86\u65E0\u6CD5\u5B89\u5168\u9A8C\u8BC1\u7684\u6388\u6743\u94FE\u63A5\uFF0C\u5DF2\u4E2D\u6B62\u672C\u6B21\u4FEE\u590D\u3002":"Feishu returned an authorization link that cannot be verified safely. This repair was aborted.","\u98DE\u4E66\u672A\u8FD4\u56DE\u6388\u6743\u94FE\u63A5\uFF0C\u5DF2\u4E2D\u6B62\u672C\u6B21\u4FEE\u590D\u3002":"Feishu did not return an authorization link. This repair was aborted.","\u6388\u6743\u5DF2\u786E\u8BA4\uFF0C\u6B63\u5728\u53D1\u9001\u5E76\u7B49\u5F85\u6D4B\u8BD5\u6309\u94AE\u56DE\u8C03\uFF1B\u6536\u5230\u771F\u5B9E\u56DE\u8C03\u540E\u624D\u4F1A\u5B8C\u6210\u3002":"Authorization confirmed. Sending a test button and waiting for its callback; this completes only after a real callback arrives.","\u4FEE\u590D\u72B6\u6001\u67E5\u8BE2\u4E2D\u65AD\uFF0C\u73B0\u6709\u673A\u5668\u4EBA\u8FDE\u63A5\u4E0D\u53D7\u5F71\u54CD\uFF1B\u53D1\u9001 /repair status \u91CD\u8BD5\u67E5\u8BE2\u3002":"The repair status query was interrupted; the existing bot connection is unaffected. Send /repair status to retry.",\u94FE\u63A5\u4E3A\u77ED\u671F\u6709\u6548:"The link is valid for a short time.","\u94FE\u63A5\u7EA6 {minutes} \u5206\u949F\u540E\u8FC7\u671F":"The link expires in about {minutes} minutes","\u65E7\u6388\u6743\u94FE\u63A5\u5DF2\u4F5C\u5E9F\uFF0C\u5DF2\u751F\u6210\u65B0\u7684\u4FEE\u590D\u94FE\u63A5\u3002":"The previous authorization link was invalidated and a new repair link was generated.","\u{1F527} \u51C6\u5907\u8865\u5168\u6743\u9650\u4E0E\u56DE\u8C03\u3002":"\u{1F527} Preparing to complete permissions and the callback.","\u672C\u6B21\u6700\u591A\u589E\u91CF\u6DFB\u52A0\u4E09\u9879\uFF1A\u5361\u7247\u56DE\u8C03 card.action.trigger\uFF1B\u98DE\u4E66\u663E\u793A\u4E3A\u201C\u83B7\u53D6\u5355\u804A\u3001\u7FA4\u7EC4\u6D88\u606F\u201D\u7684\u79DF\u6237\u6743\u9650 im:message:readonly\uFF08\u7528\u4E8E\u8BFB\u53D6\u7528\u6237\u6D88\u606F\u4E2D\u7684\u56FE\u7247\u6216\u6587\u4EF6\uFF09\uFF1B\u4EE5\u53CA im:resource\uFF08\u7528\u4E8E\u4E0A\u4F20\u673A\u5668\u4EBA\u53D1\u9001\u7684\u56FE\u7247\u6216\u6587\u4EF6\uFF09\u3002\u786E\u8BA4\u9875\u53EA\u4F1A\u663E\u793A\u5F53\u524D\u7F3A\u5C11\u7684\u9879\uFF1B\u82E5\u51FA\u73B0\u4E0A\u8FF0\u8303\u56F4\u4E4B\u5916\u7684\u914D\u7F6E\uFF0C\u8BF7\u53D6\u6D88\u3002":"This may incrementally add up to three items: the card callback card.action.trigger; the tenant scope im:message:readonly, shown by Feishu as \u201CRead direct and group messages\u201D and used to read images or files in user messages; and im:resource, used to upload images or files sent by the bot. The confirmation page shows only items the app is currently missing; cancel if anything outside this scope appears.","\u5F53\u524D\u8BBE\u5907\u76F4\u63A5\u6253\u5F00\uFF1A":"Open directly on this device:","\u82E5\u8981\u7528\u53E6\u4E00\u53F0\u8BBE\u5907\u626B\u7801\uFF0C\u53D1\u9001 /repair qr\u3002{expiry}\u3002":"To scan with another device, send /repair qr. {expiry}.","\u8BF7\u7528\u53E6\u4E00\u53F0\u8BBE\u5907\u626B\u7801\u5B8C\u6210\u6388\u6743{remaining}\u3002":"Complete authorization by scanning with another device{remaining}.","\uFF08\u5269\u4F59\u7EA6 {minutes} \u5206\u949F\uFF09":" (about {minutes} minutes left)","\u4E8C\u7EF4\u7801\u6682\u65F6\u65E0\u6CD5\u53D1\u9001\uFF0C\u8BF7\u76F4\u63A5\u6253\u5F00\u6388\u6743\u94FE\u63A5\uFF1A\n{url}":`The QR code could not be sent. Open the authorization link directly: {url}`,"\u6388\u6743\u94FE\u63A5\u5DF2\u8FC7\u671F\uFF1B\u5E73\u53F0\u672A\u8FD4\u56DE\u6210\u529F\u7ED3\u679C\uFF0C\u65E0\u6CD5\u786E\u8BA4\u5DF2\u4FEE\u590D\u3002\u53D1\u9001 /repair \u751F\u6210\u65B0\u94FE\u63A5\u3002":"The authorization link expired; the platform returned no success, so the repair cannot be confirmed. Send /repair for a new link.","\u5DF2\u53D6\u6D88\u672C\u6B21\u4FEE\u590D\u6388\u6743\uFF0C\u672A\u786E\u8BA4\u5B8C\u6210\u4FEE\u590D\u3002":"Repair authorization was cancelled; the repair was not confirmed.","\u4F60\u5DF2\u53D6\u6D88\u6216\u62D2\u7EDD\u6388\u6743\uFF0C\u6CA1\u6709\u786E\u8BA4\u4FEE\u590D\uFF1B\u53D1\u9001 /repair \u53EF\u91CD\u8BD5\u3002":"You cancelled or declined authorization, so the repair was not confirmed. Send /repair to retry.","\u6388\u6743\u5DF2\u63D0\u4EA4\uFF0C\u4F46\u672A\u6536\u5230\u6D4B\u8BD5\u6309\u94AE\u56DE\u8C03\u3002\u53EF\u80FD\u5C1A\u672A\u70B9\u51FB\u6216\u914D\u7F6E\u4ECD\u5728\u4F20\u64AD\uFF1B\u7A0D\u540E\u53D1\u9001 /repair verify \u67E5\u8BE2\uFF0C\u4E0D\u8981\u76F2\u76EE\u91CD\u590D\u6388\u6743\u3002":"Authorization was submitted, but no test-button callback arrived. It may not have been tapped yet, or the config is still propagating. Send /repair verify later to check; do not authorize blindly again.","\u4FEE\u590D\u6D41\u7A0B\u6682\u65F6\u5931\u8D25\uFF0C\u73B0\u6709\u673A\u5668\u4EBA\u8FDE\u63A5\u4E0D\u53D7\u5F71\u54CD\uFF1B\u53D1\u9001 /repair \u53EF\u91CD\u8BD5\u3002":"The repair flow failed for now; the existing bot connection is unaffected. Send /repair to retry.","\u6388\u6743\u5DF2\u786E\u8BA4\uFF0C\u6B63\u5728\u7B49\u5F85\u4E13\u7528\u6D4B\u8BD5\u6309\u94AE\u7684\u771F\u5B9E\u56DE\u8C03\uFF1B\u56DE\u8C03\u5230\u8FBE\u524D\u4E0D\u4F1A\u5BA3\u544A\u6210\u529F\u3002":"Authorization confirmed. Waiting for the real callback from the dedicated test button; success is not declared until it arrives.","\u6388\u6743\u5C1A\u672A\u5B8C\u6210\uFF0C\u6682\u65F6\u4E0D\u80FD\u9A8C\u8BC1\u5361\u7247\u6309\u94AE\u3002\u8BF7\u5148\u6253\u5F00\u6388\u6743\u94FE\u63A5\u5E76\u786E\u8BA4\u3002":"Authorization is not complete, so the card buttons cannot be verified yet. Open the authorization link and confirm first.","\u4FEE\u590D\u4EFB\u52A1\u6B63\u5728\u7B49\u5F85\u6388\u6743{remaining}\u3002\u53D1\u9001 /repair qr \u53EF\u83B7\u53D6\u4E8C\u7EF4\u7801\uFF0C/repair cancel \u53EF\u53D6\u6D88\u3002":"The repair task is waiting for authorization{remaining}. Send /repair qr for the QR code, or /repair cancel to cancel.","\uFF0C\u5269\u4F59\u7EA6 {minutes} \u5206\u949F":", about {minutes} minutes left","\u8FD9\u4E2A\u83DC\u5355\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u56DE\u590D /m \u91CD\u65B0\u6253\u5F00\u3002":"This menu has expired. Send /m to reopen it.","\u83DC\u5355\u6CA1\u6709\u8FD9\u4E2A\u7F16\u53F7\uFF0C\u56DE\u590D /m \u91CD\u65B0\u6253\u5F00\u3002":"This menu has no such number. Send /m to reopen it.","\u672C\u9875\u53EA\u6709 {count} \u4E2A\u4F1A\u8BDD\uFF0C\u56DE\u590D /sessionlist \u91CD\u65B0\u67E5\u770B\u3002":"This page has only {count} sessions. Send /sessionlist to view them again.","\u53EA\u6709 {count} \u4E2A\u5DE5\u4F5C\u533A\uFF0C\u56DE\u590D /workspacelist \u91CD\u65B0\u67E5\u770B\u3002":"There are only {count} workspaces. Send /workspacelist to view them again.","\u5173\u6CE8\u5217\u8868\u53EA\u6709 {count} \u4E2A\u4F1A\u8BDD\u3002":"The watch list has only {count} sessions.","\u5DF2\u7ED1\u5B9A\u4F1A\u8BDD\u300C{title}\u300D\nID\uFF1A{id}":`Session bound: "{title}" ID: {id}`,"\u7ED1\u5B9A\u5931\u8D25\uFF1A{message}":"Binding failed: {message}","\u5207\u6362\u5931\u8D25\uFF1A{message}":"Switch failed: {message}","\u7528\u6CD5\uFF1A/watch ":"Usage: /watch ","\u5F53\u524D\u673A\u5668\u4EBA\u6CA1\u6709\u53EF\u7528\u7684\u5DE5\u4F5C\u533A\uFF0C\u65E0\u6CD5\u6309\u5E8F\u53F7\u89E3\u6790\u4F1A\u8BDD\u3002":"This bot has no available workspace, so sessions cannot be resolved by index.","\u5F53\u524D\u5DE5\u4F5C\u533A\u53EA\u6709 {count} \u4E2A\u4F1A\u8BDD\u3002":"The current workspace has only {count} sessions.","\u6CA1\u6709\u627E\u5230\u8FD9\u4E2A\u4F1A\u8BDD\uFF0C\u8BF7\u7528 /sessionlist \u67E5\u770B\u53EF\u7528\u4F1A\u8BDD\u3002":"Session not found. Use /sessionlist to see the available sessions.","\u5F53\u524D\u72B6\u6001\u5B58\u50A8\u4E0D\u652F\u6301\u5173\u6CE8\u3002":"The current state store does not support watching.","\u65E0\u6CD5\u89E3\u6790\u4F1A\u8BDD\uFF1A{message}":"Could not resolve the session: {message}","\u6BCF\u4E2A\u804A\u5929\u6700\u591A\u5173\u6CE8 {count} \u4E2A\u4F1A\u8BDD\u3002":"Each chat can watch at most {count} sessions.","\u5173\u6CE8\u5217\u8868\u91CC\u6CA1\u6709\u8FD9\u4E2A\u4F1A\u8BDD\uFF0C\u56DE\u590D /watchlist \u67E5\u770B\u3002":"This session is not in the watch list. Send /watchlist to view it.","\u5DF2\u5173\u6CE8\u4F1A\u8BDD\u300C{title}\u300D\uFF0C\u4EFB\u52A1\u5B8C\u6210\u4F1A\u63A8\u9001\u7ED3\u679C\u3002":'Watching session "{title}"; results are pushed when the task completes.',"\u5173\u6CE8\u5931\u8D25\uFF1A{message}":"Could not watch: {message}","\u5DF2\u53D6\u6D88\u5173\u6CE8\u300C{title}\u300D\u3002":'Unwatched "{title}".',"\u53D6\u6D88\u5931\u8D25\uFF1A{message}":"Could not unwatch: {message}","\u98DE\u4E66\u4EA4\u4E92\u95EE\u9898\u53D1\u9001\u5931\u8D25\u3002":"Failed to send the Feishu interaction question.","\u5F53\u524D\u4EFB\u52A1\u4ECD\u5728\u8FD0\u884C\uFF0C\u8BF7\u5148\u505C\u6B62\u4EFB\u52A1\u6216\u7B49\u5F85\u4EFB\u52A1\u5B8C\u6210\u540E\u518D\u5F00\u542F\u65B0\u4F1A\u8BDD\u3002":"The current task is still running. Stop it or wait for it to finish before starting a new session.","\u8BF7\u8F93\u5165\u8865\u5145\u6307\u4EE4\u540E\u518D\u63D0\u4EA4\u3002":"Enter an instruction before submitting.","\u64CD\u4F5C\u8FC7\u4E8E\u9891\u7E41\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5\u3002":"Too many card actions are pending. Please try again shortly.","\u5361\u7247\u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"The card action failed. Please try again later.","\u8BF7\u5148\u9009\u62E9\u81F3\u5C11\u4E00\u4E2A\u4F1A\u8BDD\u3002":"Select at least one session first.","\u5DF2\u6279\u91CF\u5173\u6CE8 {count} \u4E2A\u4F1A\u8BDD\u3002":"Now watching {count} sessions.","\u5DF2\u6279\u91CF\u5173\u6CE8 {count} \u4E2A\u4F1A\u8BDD\uFF0C\u53E6\u6709 {failed} \u4E2A\u672A\u6210\u529F\u3002":"Now watching {count} sessions; {failed} could not be processed.","\u5DF2\u5173\u6CE8\uFF08\u6216\u5DF2\u8FBE\u5173\u6CE8\u4E0A\u9650\uFF09\u3002":"Sessions are already watched, or the watch limit has been reached.","\u5DF2\u53D6\u6D88\u5173\u6CE8 {count} \u4E2A\u4F1A\u8BDD\u3002":"Stopped watching {count} sessions.","\u5DF2\u53D6\u6D88\u5173\u6CE8 {count} \u4E2A\u4F1A\u8BDD\uFF0C\u53E6\u6709 {failed} \u4E2A\u672A\u6210\u529F\u3002":"Stopped watching {count} sessions; {failed} could not be processed.","\u6240\u9009\u4F1A\u8BDD\u5747\u672A\u5904\u7406\u6210\u529F\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"None of the selected sessions could be processed. Please try again later.","\u6240\u9009\u4F1A\u8BDD\u5DF2\u5728\u5173\u6CE8\u5217\u8868\u4E2D\u3002":"The selected sessions are already being watched.","\u6240\u9009\u4F1A\u8BDD\u5DF2\u4E0D\u5728\u5173\u6CE8\u5217\u8868\u4E2D\u3002":"The selected sessions are no longer in the watch list.","\u672A\u53D6\u6D88\u4EFB\u4F55\u5173\u6CE8\u3002":"No watches were removed.","\u5F53\u524D\u6CA1\u6709\u7ED1\u5B9A\u7684\u4F1A\u8BDD\uFF0C\u8BF7\u5148\u4ECE\u4F1A\u8BDD\u5217\u8868\u9009\u62E9\u3002":"No session is currently bound. Select one from the session list first.","\u5DF2\u5C31\u7EEA\uFF0C\u76F4\u63A5\u53D1\u6D88\u606F\u5373\u53EF\u7EE7\u7EED\u5F53\u524D\u4F1A\u8BDD\u3002":"Ready. Send a message to continue the current session.","\u4FEE\u590D\u9700\u5728\u79C1\u804A\u4E2D\u9A8C\u8BC1\u63A5\u5165\u8005\u8EAB\u4EFD\uFF0C\u8BF7\u76F4\u63A5\u53D1\u9001 /repair \u5F00\u59CB\u3002":"Repair must verify the owner in a direct chat. Send /repair there to begin.","\u6682\u65F6\u65E0\u6CD5\u83B7\u53D6\u9884\u8BBE\u5217\u8868\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Could not load the preset list. Please try again later.","\u6682\u65F6\u65E0\u6CD5\u83B7\u53D6\u7CFB\u7EDF\u72B6\u6001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Could not load system status. Please try again later.",\u8FDE\u63A5\u6B63\u5E38:"Connected","\u9884\u8BBE\uFF1A{preset}":"Preset: {preset}",\u672A\u77E5:"Unknown","/stop \u6267\u884C\u5B8C\u6210\u3002":"/stop completed.","\u505C\u6B62\u4EFB\u52A1\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Could not stop the task. Please try again later.","\u5DF2\u63D0\u4EA4\u8865\u5145\u6307\u4EE4\u3002":"Instruction submitted.","\u9884\u8BBE\u91CD\u7F6E\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Could not reset the preset. Please try again later.","\u9884\u8BBE\u5207\u6362\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Could not switch the preset. Please try again later.","\u{1F916} \u52A9\u624B\u4E2D\u5FC3":"\u{1F916} Assistant center","**\u8BBE\u7F6E**":"**Settings**",\u5207\u6362\u4F1A\u8BDD:"Switch session","\u9009\u62E9\u4F1A\u8BDD\uFF08\u5F53\u524D\u672A\u7ED1\u5B9A\uFF09":"Select a session (none currently bound)",\u8DDF\u968F\u9ED8\u8BA4:"Follow default",\u5207\u6362\u9884\u8BBE:"Switch preset",\u5207\u6362\u6A21\u578B:"Switch model","\u5F53\u524D\u5DE5\u4F5C\u533A\u6682\u65E0\u53EF\u7528\u4F1A\u8BDD\u3002":"There are no available sessions in the current workspace.","\u{1F916} \u5207\u6362\u9884\u8BBE":"\u{1F916} Switch preset","\u{1F9E0} \u5207\u6362\u6A21\u578B":"\u{1F9E0} Switch model","\u{1F195} \u65B0\u4F1A\u8BDD":"\u{1F195} New session","\u{1F4CB} \u4F1A\u8BDD/\u5173\u6CE8":"\u{1F4CB} Sessions / watches","\u{1F5C2} \u5DE5\u4F5C\u533A\u5217\u8868":"\u{1F5C2} Workspace list","**\u4EFB\u52A1\u63A7\u5236**":"**Task controls**","\u23F9 \u505C\u6B62":"\u23F9 Stop","\u{1F4D0} \u538B\u7F29":"\u{1F4D0} Compact","**\u8865\u5145\u6307\u4EE4**":"**Steer task**",\u9009\u62E9\u8865\u5145\u6307\u4EE4:"Choose an instruction",\u7EE7\u7EED:"Continue",\u52A0\u901F\u8FD0\u884C:"Move faster",\u603B\u7ED3\u5F53\u524D\u8FDB\u5C55:"Summarize current progress",\u66F4\u7B80\u6D01\u4E9B:"Be more concise",\u66F4\u8BE6\u7EC6\u4E9B:"Be more detailed","\u270F\uFE0F \u66F4\u591A / \u81EA\u5B9A\u4E49\u2026":"\u270F\uFE0F More / custom\u2026","\u{1F5C4} \u5F52\u6863\uFF1A{state}":"\u{1F5C4} Archived: {state}",\u5DF2\u663E\u793A:"shown",\u5DF2\u9690\u85CF:"hidden",\u5207\u6362\u5F52\u6863\u663E\u793A:"Toggle archived sessions","\u{1F4CA} \u72B6\u6001":"\u{1F4CA} Status","\u{1F4D6} \u5E2E\u52A9":"\u{1F4D6} Help","**\u6570\u5B57\u515C\u5E95**\n**1**\u5DE5\u4F5C\u533A\u5217\u8868 \xB7 **2**\u65B0\u4F1A\u8BDD \xB7 **3**\u4F1A\u8BDD\u5217\u8868 \xB7 **4**\u72B6\u6001\n**5**\u{1F527}\u8865\u5168\u6743\u9650 \xB7 **6**\u5E2E\u52A9":`**Number fallback** **1** Workspace list \xB7 **2** New session \xB7 **3** Session list \xB7 **4** Status @@ -132,9 +132,9 @@ ID: {id}`,"\u7ED1\u5B9A\u5931\u8D25\uFF1A{message}":"Binding failed: {message}", Reply with a number for a quick action: **1** Workspace list \xB7 **2** New session \xB7 **3** Sessions/watches **4** Status \xB7 **5** Complete permissions \xB7 **6** Help`,"\u4ECE\u4E0B\u65B9\u4E0B\u62C9\u9009\u62E9\u8865\u5145\u6307\u4EE4\uFF1B\u6700\u540E\u4E00\u9879\u53EF\u81EA\u5B9A\u4E49\u8F93\u5165\u3002":"Choose an instruction below; the last option lets you enter a custom one.","\u5F53\u524D\u6CA1\u6709\u7ED1\u5B9A\u4F1A\u8BDD\uFF0C\u8BF7\u5148\u7ED1\u5B9A\u4F1A\u8BDD\u518D\u8865\u5145\u6307\u4EE4\u3002":"No session is bound. Bind one before steering the task.","\u2795 \u8865\u5145\u6307\u4EE4":"\u2795 Steer task","\u8F93\u5165\u8865\u5145\u6307\u4EE4\u540E\u70B9\u300C\u63D0\u4EA4\u300D\uFF0C\u53D1\u9001\u7ED9\u5F53\u524D\u8FD0\u884C\u7684\u4EFB\u52A1\u3002":"Enter an instruction and press Submit to send it to the running task.",\u8F93\u5165\u4F60\u7684\u8865\u5145\u6307\u4EE4:"Enter your instruction",\u63D0\u4EA4:"Submit","\u2795 \u81EA\u5B9A\u4E49\u6307\u4EE4":"\u2795 Custom instruction","\u{1F916} \u52A9\u624B\u83DC\u5355":"\u{1F916} Assistant menu","**\u70B9\u51FB\u6309\u94AE\u6216\u76F4\u63A5\u56DE\u590D\u6570\u5B57**":"**Tap a button or reply with a number**","1 \xB7 \u4F1A\u8BDD\u5217\u8868":"1 \xB7 Sessions","2 \xB7 \u5DE5\u4F5C\u533A":"2 \xB7 Workspace","3 \xB7 \u65B0\u4F1A\u8BDD":"3 \xB7 New session","4 \xB7 \u72B6\u6001":"4 \xB7 Status","5 \xB7 \u5E2E\u52A9":"5 \xB7 Help","**6 \xB7 \u8865\u5168\u6743\u9650**\uFF08\u8BF7\u76F4\u63A5\u56DE\u590D\u6570\u5B57 **6**\uFF09":"**6 \xB7 Complete permissions** (reply with the number **6**)","7 \xB7 \u5173\u6CE8\u5217\u8868":"7 \xB7 Watch list","\u{1F9EA} \u9A8C\u8BC1\u5361\u7247\u6309\u94AE":"\u{1F9EA} Verify card buttons","\u6388\u6743\u5DF2\u63D0\u4EA4\u3002\u8BF7\u70B9\u51FB\u4E0B\u65B9\u6309\u94AE\uFF1B\u673A\u5668\u4EBA\u771F\u5B9E\u6536\u5230\u56DE\u8C03\u540E\u624D\u4F1A\u5224\u5B9A\u4FEE\u590D\u6210\u529F\u3002":"Authorization submitted. Tap the button below; the repair is confirmed only after the bot receives the real callback.",\u5B8C\u6210\u9A8C\u8BC1:"Finish verification","**\u5DE5\u4F5C\u533A**\uFF1A{workspace}\n\u5171 **{total}** \u4E2A\u4F1A\u8BDD{paging}":`**Workspace**: {workspace} -**{total}** sessions in total{paging}`,"\uFF08\u7B2C {page}/{pageCount} \u9875\uFF09":" (page {page}/{pageCount})","\u2B50\u53D6\u5173":"\u2B50 Unwatch","\u2B50\u5173\u6CE8":"\u2B50 Watch","\u25C0 \u4E0A\u4E00\u9875":"\u25C0 Previous","\u4E0B\u4E00\u9875 \u25B6":"Next \u25B6","\u56DE\u590D\u6570\u5B57\uFF081~N\uFF09\u7ED1\u5B9A\u672C\u9875\u4F1A\u8BDD\u3002":"Reply with a number (1\u2013N) to bind a session on this page.","\u{1F4C2} \u4F1A\u8BDD\u5217\u8868":"\u{1F4C2} Session list","\u5F53\u524D Host \u4E0A\u6CA1\u6709\u5DF2\u767B\u8BB0\u7684\u5DE5\u4F5C\u533A\u3002":"No workspaces are registered on the current Host.","\u56DE\u590D\u6570\u5B57\u5207\u6362\u5DE5\u4F5C\u533A\uFF0C\u6216\u70B9\u51FB\u6309\u94AE\uFF1A":"Reply with a number to switch workspaces, or tap a button:","\u{1F5C2} \u5DE5\u4F5C\u533A":"\u{1F5C2} Workspace","\u{1F916} \u52A9\u624B\u83DC\u5355\uFF08\u56DE\u590D\u6570\u5B57\u5373\u53EF\uFF0C\u65E0\u9700\u8BB0\u547D\u4EE4\uFF09":"\u{1F916} Assistant menu (reply with a number \u2014 no need to memorize commands)","1 \xB7 /sessionlist \u5217\u51FA\u4F1A\u8BDD\uFF08\u56DE\u590D\u6570\u5B57\u7ED1\u5B9A\uFF09":"1 \xB7 /sessionlist List sessions (reply with a number to bind)","2 \xB7 /workspacelist \u5217\u51FA\u5DE5\u4F5C\u533A\uFF08\u56DE\u590D\u6570\u5B57\u5207\u6362\uFF09":"2 \xB7 /workspacelist List workspaces (reply with a number to switch)","3 \xB7 /new \u5F00\u542F\u65B0\u4F1A\u8BDD":"3 \xB7 /new Start a new session","4 \xB7 /status \u8FDE\u63A5\u72B6\u6001":"4 \xB7 /status Connection status","5 \xB7 /help \u672C\u5E2E\u52A9":"5 \xB7 /help This help","6 \xB7 /repair \u8865\u5168\u6743\u9650\u4E0E\u56DE\u8C03\uFF08\u8BF7\u56DE\u590D\u6570\u5B57 6\uFF09":"6 \xB7 /repair Complete permissions and callback (reply with the number 6)","7 \xB7 /watchlist \u5173\u6CE8\u5217\u8868":"7 \xB7 /watchlist Watch list","\u76F4\u63A5\u53D1\u9001\u6587\u5B57/\u56FE\u7247\u5373\u7EE7\u7EED\u5F53\u524D\u4F1A\u8BDD\u3002":"Send text or an image directly to continue the current session.","/session ID \u6216\u5E8F\u53F7 \u7ED1\u5B9A\u5DF2\u6709\u4F1A\u8BDD":"/session ID or index Bind an existing session","/watch ID \u6216\u5E8F\u53F7 \u5173\u6CE8\u4F1A\u8BDD\uFF08\u5B8C\u6210\u540E\u63A8\u9001\uFF09":"/watch ID or index Watch a session (push when done)","/compact \u538B\u7F29\u4E0A\u4E0B\u6587":"/compact Compact the context","/workspace \u7EDD\u5BF9\u8DEF\u5F84 \u5207\u6362\u5DE5\u4F5C\u533A":"/workspace Switch workspace","/presetlist \u5217\u51FA\u53EF\u7528 Agent Preset":"/presetlist List available Agent Presets","\u4EFB\u52A1\u5B8C\u6210\u4F1A\u81EA\u52A8\u63A8\u9001\uFF0C\u56DE\u590D\u6570\u5B57\u6216\u70B9\u6309\u94AE\u53D6\u6D88\u5173\u6CE8\uFF1A":"Completion is pushed automatically. Reply with a number or tap a button to unwatch:","\u{1F441} \u5173\u6CE8\u5217\u8868":"\u{1F441} Watch list","\u2B50 \u53D6\u6D88\u5173\u6CE8":"\u2B50 Unwatch","\u2606 \u5173\u6CE8":"\u2606 Watch","\u{1F50D} \u5173\u6CE8\u5217\u8868":"\u{1F50D} Watch list",\u52FE\u9009\u8981\u5173\u6CE8\u7684\u4F1A\u8BDD:"Select sessions to watch",\u52FE\u9009\u8981\u53D6\u6D88\u5173\u6CE8\u7684\u4F1A\u8BDD:"Select sessions to unwatch","\u5F53\u524D\u6CA1\u6709\u5173\u6CE8\u7684\u4F1A\u8BDD\u3002\u4EFB\u52A1\u5B8C\u6210\u4F1A\u81EA\u52A8\u63A8\u9001\u7ED3\u679C\u3002":"No sessions are being watched. Results are pushed automatically when tasks complete.","\u5F53\u524D\u5173\u6CE8 **{count}** \u4E2A\u4F1A\u8BDD\uFF1A":"Currently watching **{count}** sessions:","**\u2795 \u6DFB\u52A0\u5173\u6CE8**\uFF08\u591A\u9009\u4E0B\u62C9\u52FE\u9009\uFF09":"**\u2795 Add watch** (select from the multi-select dropdown)","**\u2796 \u53D6\u6D88\u5173\u6CE8**\uFF08\u591A\u9009\u4E0B\u62C9\u52FE\u9009\uFF09":"**\u2796 Remove watch** (select from the multi-select dropdown)","\u{1F4CB} \u4F1A\u8BDD\u5217\u8868":"\u{1F4CB} Session list","\u{1F519} \u8FD4\u56DE\u83DC\u5355":"\u{1F519} Back to menu",\u5DF2\u5B8C\u6210:"Completed",\u5DF2\u505C\u6B62:"Stopped",\u5DF2\u4E2D\u6B62:"Aborted",\u5DF2\u53D6\u6D88:"Cancelled",\u5DF2\u7ED3\u675F:"Ended","\u2705 \u4EFB\u52A1\u5B8C\u6210":"\u2705 Task complete","**\u72B6\u6001**\uFF1A{reason}":"**Status**: {reason}",\u6253\u5F00\u4F1A\u8BDD\u5217\u8868:"Open session list",\u5DE5\u4F5C\u533A:"Workspace","\u7ED1\u5B9A\u8BE5\u4F1A\u8BDD\u540E\u53EF\u7EE7\u7EED\u8FFD\u95EE\uFF0C\u8F93\u5165\u6587\u5B57\u5373\u53EF\u3002":"After binding this session you can keep asking; just type a message.","\u5F53\u524D\u6CA1\u6709\u5173\u6CE8\u7684\u4F1A\u8BDD\u3002\n`/watch ` \u5173\u6CE8\u540E\uFF0C\u4EFB\u52A1\u5B8C\u6210\u4F1A\u81EA\u52A8\u63A8\u9001\u3002":"No sessions are being watched.\nWatch one with `/watch ` and completion is pushed automatically.","\u6B63\u5728\u751F\u6210\u2026":"Generating\u2026",\u56DE\u7B54\u5B8C\u6210:"Answer complete",\u98DE\u4E66\u673A\u5668\u4EBA:"Feishu bot","\u98DE\u4E66\u673A\u5668\u4EBA\u7F3A\u5C11\u56FE\u7247\u8BFB\u53D6\u6743\u9650 im:message:readonly\uFF08\u98DE\u4E66\u663E\u793A\u4E3A\u201C\u83B7\u53D6\u5355\u804A\u3001\u7FA4\u7EC4\u6D88\u606F\u201D\uFF09\u3002\u8BF7\u79C1\u804A\u673A\u5668\u4EBA\u6267\u884C /repair \u547D\u4EE4\uFF0C\u6216\u8005\u5728\u63D2\u4EF6\u9875\u9762\u70B9\u51FB\u201C\u8865\u5168\u6743\u9650\u201D\u6309\u94AE\u5E76\u626B\u7801\u3002\u6309\u98DE\u4E66\u63D0\u793A\u53D1\u5E03\u65B0\u7248\u672C\u3001\u5B8C\u6210\u5FC5\u8981\u5BA1\u6279\u540E\uFF0C\u518D\u91CD\u65B0\u53D1\u9001\u56FE\u7247\u3002":"The Feishu bot is missing the image-read scope im:message:readonly, shown by Feishu as \u201CRead direct and group messages.\u201D Run /repair in a direct chat with the bot, or click the \u201CComplete permissions\u201D button on the plugin page and scan the QR code. Publish a new version and complete any approval requested by Feishu, then resend the image.","\u2705 \u4FEE\u590D\u5B8C\u6210\uFF1A\u5DF2\u5B9E\u6D4B\u6536\u5230 card.action.trigger\uFF0C\u83DC\u5355\u6309\u94AE\u73B0\u5728\u53EF\u7528\u3002":"\u2705 Repair complete: card.action.trigger was received in a real test; the menu buttons now work.","\u26A0\uFE0F \u4FEE\u590D\u9A8C\u8BC1\u8D85\u65F6\uFF1A\u672A\u6536\u5230\u6D4B\u8BD5\u5361\u6309\u94AE\u7684 card.action.trigger\uFF0C\u4E0D\u80FD\u786E\u8BA4\u6309\u94AE\u5DF2\u4FEE\u590D\u3002\u8BF7\u4E0D\u8981\u91CD\u590D\u6388\u6743\uFF1B\u5148\u68C0\u67E5\u98DE\u4E66\u5F00\u653E\u5E73\u53F0\u7684\u5361\u7247\u56DE\u8C03\u914D\u7F6E\uFF0C\u786E\u8BA4\u540E\u518D\u53D1\u9001 /repair\u3002":"\u26A0\uFE0F Repair verification timed out: no card.action.trigger from the test card button was received, so the buttons cannot be confirmed repaired. Do not authorize again; check the card-callback configuration in Feishu Open Platform first, then send /repair.","\u26A0\uFE0F \u4FEE\u590D\u9A8C\u8BC1\u5931\u8D25\uFF1A\u65E0\u6CD5\u53D1\u9001\u4E13\u7528\u6D4B\u8BD5\u5361\uFF0C\u4E0D\u80FD\u786E\u8BA4 card.action.trigger \u5DF2\u6062\u590D\u3002\u8BF7\u4E0D\u8981\u91CD\u590D\u6388\u6743\uFF1B\u5148\u68C0\u67E5\u673A\u5668\u4EBA\u6D88\u606F\u6743\u9650\u548C\u8FDE\u63A5\u72B6\u6001\u3002":"\u26A0\uFE0F Repair verification failed: the dedicated test card could not be sent, so card.action.trigger cannot be confirmed restored. Do not authorize again; check the bot message permission and connection status first.","\u26A0\uFE0F \u4FEE\u590D\u9A8C\u8BC1\u4E2D\u65AD\uFF1ARuntime \u5DF2\u505C\u6B62\uFF0C\u672A\u5B8C\u6210 card.action.trigger \u5B9E\u6D4B\uFF0C\u4E0D\u80FD\u786E\u8BA4\u4FEE\u590D\u6210\u529F\u3002\u8BF7\u4E0D\u8981\u91CD\u590D\u6388\u6743\uFF1B\u5148\u7B49\u5F85\u673A\u5668\u4EBA\u6062\u590D\u8FDE\u63A5\u3002":"\u26A0\uFE0F Repair verification interrupted: the Runtime stopped before the card.action.trigger test completed, so the repair cannot be confirmed. Do not authorize again; wait for the bot to reconnect."};var zU={"\u5DF2\u8FDE\u63A5 DeepSeek Harness\uFF0C\u6B63\u5728\u601D\u8003\u2026":"Connected to DeepSeek Harness, thinking\u2026","\u9489\u9489\u673A\u5668\u4EBA\u5DF2\u8FDE\u63A5 DeepSeek Harness\u3002":"The DingTalk bot is connected to DeepSeek Harness.","\u9489\u9489\u672A\u80FD\u6362\u53D6\u56FE\u7247\u4E0B\u8F7D\u5730\u5740\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\uFF1B\u82E5\u6301\u7EED\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u673A\u5668\u4EBA\u7684\u201C\u4F01\u4E1A\u5185\u673A\u5668\u4EBA\u53D1\u9001\u6D88\u606F\u6743\u9650\u201D\u3002":`DingTalk could not provide the image download address. Please resend; if it keeps failing, check the bot's "Send messages as an internal robot" permission.`,"\u9489\u9489\u6CA1\u6709\u8FD4\u56DE\u56FE\u7247\u4E0B\u8F7D\u5730\u5740\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002":"DingTalk did not return an image download address. Please resend.","\u9489\u9489\u8FD4\u56DE\u7684\u56FE\u7247\u4E34\u65F6\u5730\u5740\u65E0\u6CD5\u8BFB\u53D6\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002":"The temporary image address returned by DingTalk could not be read. Please resend.","\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u53D1\u9001\u7ED3\u679C\u672A\u80FD\u786E\u8BA4\uFF0C\u8BF7\u5148\u68C0\u67E5\u804A\u5929\u5185\u662F\u5426\u5DF2\u6536\u5230\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u8BD5\u3002":'Delivery of the result file "{name}" could not be confirmed. Please check whether it already arrived in the chat before retrying.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u9489\u9489\u5E94\u7528\u6216\u673A\u5668\u4EBA\u7F3A\u5C11\u6587\u4EF6\u6D88\u606F\u6743\u9650\u3002\u8BF7\u5F00\u901A\u5E94\u7528 qyapi_base \u6743\u9650\uFF0C\u5E76\u786E\u8BA4\u673A\u5668\u4EBA\u5177\u5907\u6587\u4EF6\u6D88\u606F\u53D1\u9001\u80FD\u529B\u3002":`Result file "{name}" was generated, but the DingTalk app or bot lacks file message permission. Enable the app's qyapi_base permission and make sure the bot can send file messages.`,"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u8D85\u8FC7\u5F53\u524D\u9489\u9489\u673A\u5668\u4EBA\u53EF\u53D1\u9001\u7684\u6587\u4EF6\u5927\u5C0F\uFF0C\u672A\u53D1\u9001\u3002":'Result file "{name}" exceeds the file size limit of the current DingTalk bot and was not sent.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u88AB\u9489\u9489\u9650\u6D41\uFF0C\u672A\u80FD\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":'Result file "{name}" was rate-limited by DingTalk and could not be sent. Please try again later.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u9489\u9489\u62D2\u7EDD\u4E86\u8BE5\u6587\u4EF6\u6D88\u606F\uFF0C\u8BF7\u68C0\u67E5\u6587\u4EF6\u7C7B\u578B\u548C\u673A\u5668\u4EBA\u6587\u4EF6\u6D88\u606F\u914D\u7F6E\u3002":`Result file "{name}" was generated, but DingTalk rejected the file message. Check the file type and the bot's file message configuration.`,"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u6682\u65F6\u672A\u80FD\u901A\u8FC7\u9489\u9489\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":'Result file "{name}" was generated but could not be sent via DingTalk right now. Please try again later.',"\u7ED3\u679C\u6587\u4EF6\u5DF2\u751F\u6210\u3002":"The result file has been generated.","\u9489\u9489\u673A\u5668\u4EBA\u4E0E DeepSeek Harness \u8FDE\u63A5\u6B63\u5E38\u3002":"The DingTalk bot is connected to DeepSeek Harness normally.","\u9489\u9489\u547D\u4EE4\u5904\u7406\u5931\u8D25\u3002":"Failed to process the DingTalk command.","\u9489\u9489\u6D88\u606F\u6CA1\u6709\u5B89\u5168\u7684\u56DE\u590D\u5730\u5740\u3002":"The DingTalk message has no safe reply address.","\u9489\u9489\u5BA1\u6279\u5904\u7406\u5931\u8D25\u3002":"Failed to process the DingTalk approval.","\u9489\u9489\u6D88\u606F\u5904\u7406\u5931\u8D25\u3002":"Failed to process the DingTalk message.","\u9489\u9489\u6D88\u606F\u683C\u5F0F\u65E0\u6548\u3002":"Invalid DingTalk message format.","\u9489\u9489\u4EA4\u4E92\u95EE\u9898\u53D1\u9001\u5931\u8D25\u3002":"Failed to send the DingTalk interaction question.",\u9489\u9489\u7528\u6237:"DingTalk user",\u9489\u9489\u673A\u5668\u4EBA:"DingTalk bot",\u8EAB\u4EFD\u5DF2\u9690\u85CF:"Identity hidden","\u9489\u9489\u673A\u5668\u4EBA\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u626B\u7801\u3002":"The DingTalk bot credentials are missing. Remove the bot and scan the QR code again.","\u9489\u9489\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"The DingTalk connection is not ready. Please try again later.","\u9489\u9489\u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"The DingTalk connection is still not ready. Please try again later.","\u626B\u7801\u63A5\u5165\u5DF2\u53D6\u6D88\u3002":"QR code setup has been cancelled.","\u65E0\u6CD5\u751F\u6210\u9489\u9489\u4E8C\u7EF4\u7801\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Could not generate the DingTalk QR code. Please try again later.","\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u3002":"The QR code has expired. Generate a new one.","\u9489\u9489\u5DF2\u63A5\u5165\uFF0C\u4F46\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"DingTalk is connected, but the message connection is not ready yet. Please try again later.","\u9489\u9489\u672A\u5B8C\u6210\u673A\u5668\u4EBA\u6388\u6743\uFF0C\u8BF7\u91CD\u65B0\u626B\u7801\u3002":"DingTalk did not complete the bot authorization. Please scan the QR code again.","\u9489\u9489\u6388\u6743\u72B6\u6001\u6682\u65F6\u4E0D\u53EF\u7528\uFF0C\u6B63\u5728\u91CD\u8BD5\u3002":"The DingTalk authorization status is temporarily unavailable. Retrying.","\u9489\u9489\u5DF2\u6388\u6743\uFF0C\u4F46\u65E0\u6CD5\u5B89\u5168\u4FDD\u5B58\u63A5\u5165\u914D\u7F6E\u3002":"DingTalk authorization succeeded, but the configuration could not be saved safely.","\u9489\u9489\u6388\u6743\u67E5\u8BE2\u6682\u65F6\u5931\u8D25\uFF0C\u6B63\u5728\u91CD\u8BD5\u3002":"The DingTalk authorization query failed temporarily. Retrying.","\u9489\u9489\u673A\u5668\u4EBA\uFF08{clientId}\uFF09":"DingTalk bot ({clientId})","\u9489\u9489 Stream \u6D88\u606F\u8FDE\u63A5\u8FD0\u884C\u6B63\u5E38":"The DingTalk Stream message connection is running normally",\u9489\u9489\u6D88\u606F\u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF:"The DingTalk message connection is currently offline"};var VU={"\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA\u5DF2\u8FDE\u63A5 DeepSeek Harness\u3002":"The Enterprise WeChat bot is connected to DeepSeek Harness.","\u5F53\u524D\u5F85\u5904\u7406\u56FE\u7247\u8F83\u591A\uFF0C\u8BF7\u7A0D\u540E\u91CD\u65B0\u53D1\u9001\u3002":"Too many images are pending. Please send them again later.","\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u4F01\u4E1A\u5FAE\u4FE1\u667A\u80FD\u673A\u5668\u4EBA\u7F3A\u5C11\u7D20\u6750\u4E0A\u4F20\u6216\u6587\u4EF6\u6D88\u606F\u80FD\u529B\uFF0C\u8BF7\u68C0\u67E5\u673A\u5668\u4EBA\u6743\u9650\u3002":'The result file "{name}" was generated, but the Enterprise WeChat bot lacks media upload or file message capability. Please check the bot permissions.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u8D85\u8FC7\u5F53\u524D\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA\u53EF\u53D1\u9001\u7684\u6587\u4EF6\u5927\u5C0F\uFF0C\u672A\u53D1\u9001\u3002":'The result file "{name}" exceeds the file size this Enterprise WeChat bot can send and was not sent.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u4E3A\u7A7A\uFF0C\u4F01\u4E1A\u5FAE\u4FE1\u4E0D\u5141\u8BB8\u53D1\u9001\u7A7A\u6587\u4EF6\u3002":'The result file "{name}" is empty. Enterprise WeChat does not allow sending empty files.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u88AB\u4F01\u4E1A\u5FAE\u4FE1\u9650\u6D41\uFF0C\u672A\u80FD\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":'The result file "{name}" was rate-limited by Enterprise WeChat and could not be sent. Please try again later.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u4F01\u4E1A\u5FAE\u4FE1\u62D2\u7EDD\u4E86\u8BE5\u6587\u4EF6\u6216\u6587\u4EF6\u6D88\u606F\u3002":'The result file "{name}" was generated, but Enterprise WeChat rejected the file or file message.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u6682\u65F6\u672A\u80FD\u901A\u8FC7\u4F01\u4E1A\u5FAE\u4FE1\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":'The result file "{name}" was generated but could not be sent via Enterprise WeChat right now. Please try again later.',"\u4EFB\u52A1\u5DF2\u5B8C\u6210\uFF0C\u4F46\u6CA1\u6709\u751F\u6210\u53EF\u663E\u793A\u7684\u6587\u672C\u3002":"The task completed, but no displayable text was generated.","\u76EE\u524D\u652F\u6301\u6587\u5B57\u3001\u56FE\u7247\u548C\u8BED\u97F3\u8F6C\u5199\u6D88\u606F\u3002":"Currently only text, images, and voice transcription messages are supported.","\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA\u4E0E DeepSeek Harness \u8FDE\u63A5\u6B63\u5E38\u3002":"The connection between the Enterprise WeChat bot and DeepSeek Harness is working.","\u6B63\u5728\u601D\u8003\u4E2D\u2026":"Thinking\u2026","\u4F01\u4E1A\u5FAE\u4FE1\u4EA4\u4E92\u95EE\u9898\u53D1\u9001\u5931\u8D25\u3002":"Failed to send the Enterprise WeChat interaction question.","\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u626B\u7801\u3002":"The Enterprise WeChat bot credentials are missing. Please remove the bot and scan the QR code again.","\u4F01\u4E1A\u5FAE\u4FE1\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002":"The Enterprise WeChat connection is not ready. The plugin will retry automatically.","\u626B\u7801\u7ED1\u5B9A\u5DF2\u53D6\u6D88\u3002":"QR code binding has been cancelled.","\u65E0\u6CD5\u751F\u6210\u4F01\u4E1A\u5FAE\u4FE1\u4E8C\u7EF4\u7801\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Unable to generate the Enterprise WeChat QR code. Please try again later.","\u4F01\u4E1A\u5FAE\u4FE1\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u3002":"The Enterprise WeChat QR code has expired. Please generate a new one.","\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA\u5DF2\u7ED1\u5B9A\uFF0C\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\u3002":"The Enterprise WeChat bot is bound, but the message connection is not ready yet.","\u4F01\u4E1A\u5FAE\u4FE1\u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"The Enterprise WeChat connection is still not ready. Please try again later.","\u4F01\u4E1A\u5FAE\u4FE1\u626B\u7801\u6CA1\u6709\u5B8C\u6210\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u4E8C\u7EF4\u7801\u3002":"The Enterprise WeChat QR scan was not completed. Please generate a new QR code.","\u4F01\u4E1A\u5FAE\u4FE1\u626B\u7801\u670D\u52A1\u6682\u65F6\u4E0D\u53EF\u7528\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u4E8C\u7EF4\u7801\u3002":"The Enterprise WeChat QR service is temporarily unavailable. Please generate a new QR code.","\u4F01\u4E1A\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u65E0\u6CD5\u5B89\u5168\u4FDD\u5B58\u63A5\u5165\u914D\u7F6E\u3002":"Enterprise WeChat authorization succeeded, but the connection configuration could not be saved safely.",\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA:"Enterprise WeChat bot","\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA\uFF08{botId}\uFF09":"Enterprise WeChat bot ({botId})","\u4F01\u4E1A\u5FAE\u4FE1 WebSocket \u957F\u8FDE\u63A5\u8FD0\u884C\u6B63\u5E38":"The Enterprise WeChat WebSocket long connection is running normally","\u4F01\u4E1A\u5FAE\u4FE1\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5":"The Enterprise WeChat connection is not ready. The plugin will retry automatically",\u4F01\u4E1A\u5FAE\u4FE1\u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF:"The Enterprise WeChat connection is currently offline"};var WU={"QQ \u673A\u5668\u4EBA\u5DF2\u8FDE\u63A5 DeepSeek Harness\u3002":"The QQ bot is connected to DeepSeek Harness.","\u56DE\u7B54\u8F83\u957F\uFF0C\u540E\u7EED\u5185\u5BB9\u672A\u80FD\u901A\u8FC7 QQ \u5B8C\u6574\u53D1\u9001\uFF0C\u8BF7\u56DE\u590D\u201C\u7EE7\u7EED\u201D\u3002":"The answer is long and the rest could not be sent fully through QQ. Reply \u201C\u7EE7\u7EED\u201D (continue) to receive it.","\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46 QQ \u4ECA\u65E5\u6587\u4EF6\u4E0A\u4F20\u989D\u5EA6\u5DF2\u7528\u5B8C\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":`The result file "{name}" was generated, but QQ's daily file upload quota is used up. Please try again later.`,"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u5F53\u524D QQ \u673A\u5668\u4EBA\u6CA1\u6709\u6587\u4EF6\u6D88\u606F\u6743\u9650\u3002":'The result file "{name}" was generated, but the current QQ bot does not have file message permission.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u8D85\u8FC7\u5F53\u524D QQ \u673A\u5668\u4EBA\u53EF\u53D1\u9001\u7684\u6587\u4EF6\u5927\u5C0F\uFF0C\u672A\u53D1\u9001\u3002":'The result file "{name}" exceeds the file size the current QQ bot can send and was not sent.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u4E3A\u7A7A\uFF0CQQ \u4E0D\u5141\u8BB8\u53D1\u9001\u7A7A\u6587\u4EF6\u3002":'The result file "{name}" is empty, and QQ does not allow sending empty files.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u88AB QQ \u9650\u6D41\uFF0C\u672A\u80FD\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":'The result file "{name}" was temporarily rate-limited by QQ and was not sent. Please try again later.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46 QQ \u62D2\u7EDD\u4E86\u8BE5\u6587\u4EF6\u6216\u6587\u4EF6\u6D88\u606F\u3002":'The result file "{name}" was generated, but QQ rejected the file or file message.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u6682\u65F6\u672A\u80FD\u901A\u8FC7 QQ \u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":'The result file "{name}" was generated but could not be sent via QQ right now. Please try again later.',"QQ \u673A\u5668\u4EBA\u4E0E DeepSeek Harness \u8FDE\u63A5\u6B63\u5E38\u3002":"The QQ bot is connected to DeepSeek Harness normally.","QQ \u4EA4\u4E92\u95EE\u9898\u53D1\u9001\u5931\u8D25\u3002":"Failed to send the QQ interaction question.","QQ \u673A\u5668\u4EBA\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u626B\u7801\u3002":"The QQ bot credentials are missing. Remove the bot and scan the QR code again.","QQ \u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002":"The QQ connection is not ready; the plugin will retry automatically.","QQ \u626B\u7801\u670D\u52A1\u6682\u65F6\u4E0D\u53EF\u7528\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u4E8C\u7EF4\u7801\u3002":"The QQ QR service is temporarily unavailable. Please generate a new QR code.","\u65E0\u6CD5\u751F\u6210 QQ \u4E8C\u7EF4\u7801\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Unable to generate the QQ QR code. Please try again later.","QQ \u673A\u5668\u4EBA\u5DF2\u7ED1\u5B9A\uFF0C\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\u3002":"The QQ bot is bound, but the message connection is not ready yet.","QQ \u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"The QQ connection is still not ready. Please try again later.",QQ\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5:"The QQ bot is not connected yet","QQ \u673A\u5668\u4EBA\uFF08{appId}\uFF09":"QQ bot ({appId})",QQ\u673A\u5668\u4EBA:"QQ bot","QQ WebSocket \u957F\u8FDE\u63A5\u8FD0\u884C\u6B63\u5E38":"The QQ WebSocket long connection is running normally","QQ \u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5":"The QQ connection is not ready; the plugin will retry automatically","QQ \u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF":"The QQ connection is currently offline","QQ \u5DF2\u6388\u6743\uFF0C\u4F46\u65E0\u6CD5\u5B89\u5168\u4FDD\u5B58\u63A5\u5165\u914D\u7F6E\u3002":"QQ authorization succeeded, but the connection configuration could not be saved safely."};var ZU={"\u5FAE\u4FE1\u5DF2\u8FDE\u63A5 DeepSeek Harness\u3002":"WeChat is connected to DeepSeek Harness.","\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u5FAE\u4FE1\u673A\u5668\u4EBA\u5F53\u524D\u6CA1\u6709\u6587\u4EF6\u6D88\u606F\u53D1\u9001\u6743\u9650\uFF0C\u8BF7\u68C0\u67E5\u673A\u5668\u4EBA\u6587\u4EF6\u6D88\u606F\u80FD\u529B\u3002":`The result file "{name}" was generated, but the WeChat bot currently has no permission to send file messages. Please check the bot's file messaging capability.`,"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u8D85\u8FC7\u5F53\u524D\u5FAE\u4FE1\u4F1A\u8BDD\u53EF\u53D1\u9001\u7684\u6587\u4EF6\u5927\u5C0F\uFF0C\u672A\u53D1\u9001\u3002":'The result file "{name}" exceeds the file size limit of the current WeChat conversation and was not sent.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u88AB\u5FAE\u4FE1\u9650\u6D41\uFF0C\u672A\u80FD\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":'The result file "{name}" was temporarily rate-limited by WeChat and was not sent. Please try again later.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u5FAE\u4FE1\u62D2\u7EDD\u4E86\u8BE5\u6587\u4EF6\u6D88\u606F\u3002":'The result file "{name}" was generated, but WeChat rejected the file message.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u6682\u65F6\u672A\u80FD\u901A\u8FC7\u5FAE\u4FE1\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":'The result file "{name}" was generated but could not be sent via WeChat right now. Please try again later.',"\u76EE\u524D\u652F\u6301\u6587\u5B57\u3001\u56FE\u7247\uFF0C\u4EE5\u53CA\u5FAE\u4FE1\u5DF2\u8F6C\u6210\u6587\u5B57\u7684\u8BED\u97F3\u6D88\u606F\u3002":"Currently supports text, images, and voice messages that WeChat has converted to text.","\u5FAE\u4FE1\u4E0E DeepSeek Harness \u8FDE\u63A5\u6B63\u5E38\u3002":"WeChat is connected to DeepSeek Harness normally.","\u5FAE\u4FE1\u4EA4\u4E92\u95EE\u9898\u53D1\u9001\u5931\u8D25\u3002":"Failed to send the WeChat interaction question.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u65E0\u6CD5\u8BFB\u53D6\u73B0\u6709\u767B\u5F55\u51ED\u636E\u3002\u8BF7\u68C0\u67E5 DSH \u51ED\u636E\u5B58\u50A8\u3002":"WeChat was authorized, but the existing login credential could not be read. Please check the DSH credential store.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u767B\u5F55\u51ED\u636E\u65E0\u6CD5\u5199\u5165 DSH \u51ED\u636E\u5B58\u50A8\u3002\u8BF7\u68C0\u67E5\u51ED\u636E\u5B58\u50A8\u662F\u5426\u53EF\u5199\u3002":"WeChat was authorized, but the login credential could not be written to the DSH credential store. Please check that the credential store is writable.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u8D26\u53F7\u914D\u7F6E\u65E0\u6CD5\u5199\u5165\u672C\u673A\u3002\u8BF7\u68C0\u67E5 DSH_HOME \u76EE\u5F55\u6743\u9650\u3002":"WeChat was authorized, but the account configuration could not be written locally. Please check the DSH_HOME directory permissions.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u65E0\u6CD5\u521D\u59CB\u5316\u8D26\u53F7\u72B6\u6001\u6216\u5DE5\u4F5C\u533A\u3002\u8BF7\u68C0\u67E5 DSH_HOME \u548C\u5DE5\u4F5C\u533A\u76EE\u5F55\u3002":"WeChat was authorized, but the account state or workspace could not be initialized. Please check DSH_HOME and the workspace directories.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u63D2\u4EF6\u65E0\u6CD5\u8FDE\u63A5\u672C\u673A Harness\u3002\u8BF7\u68C0\u67E5 dsh web \u5730\u5740\u548C\u7AEF\u53E3\u3002":"WeChat was authorized, but the plugin could not connect to the local Harness. Please check the dsh web address and port.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u5065\u5EB7\u68C0\u67E5\u8D85\u65F6\u3002\u8BF7\u786E\u8BA4 dsh web \u672A\u963B\u585E\u3002":"WeChat was authorized, but the Harness health check timed out. Please confirm dsh web is not blocked.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u5065\u5EB7\u68C0\u67E5\u9700\u8981\u8EAB\u4EFD\u8BA4\u8BC1\u3002\u8BF7\u68C0\u67E5\u4EE3\u7406\u3001\u7F51\u5173\u6216\u81EA\u5B9A\u4E49\u9274\u6743\u914D\u7F6E\u3002":"WeChat was authorized, but the Harness health check requires authentication. Please check proxy, gateway, or custom auth configuration.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u672C\u673A Harness \u8BF7\u6C42\u88AB\u4EE3\u7406\u8981\u6C42\u8BA4\u8BC1\u3002\u8BF7\u8BA9\u56DE\u73AF\u5730\u5740\u7ED5\u8FC7\u4EE3\u7406\uFF0C\u5E76\u68C0\u67E5 NO_PROXY \u914D\u7F6E\u3002":"WeChat was authorized, but the local Harness request was challenged for proxy authentication. Please bypass the proxy for loopback addresses and check the NO_PROXY configuration.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u5F02\u5E38\u62D2\u7EDD\u4E86\u56DE\u73AF\u5730\u5740\u7684\u5065\u5EB7\u68C0\u67E5\u3002\u8BF7\u68C0\u67E5 HTTP \u4EE3\u7406\u3001Harness \u6E90\u7801\u7248\u672C\u548C\u6784\u5EFA\u4EA7\u7269\u3002":"WeChat was authorized, but Harness unexpectedly rejected the health check from a loopback address. Please check the HTTP proxy, Harness source version, and build artifacts.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u7684 Host \u4FE1\u4EFB\u68C0\u67E5\u62D2\u7EDD\u4E86\u975E\u56DE\u73AF\u5730\u5740\u8BF7\u6C42\u3002\u8BF7\u68C0\u67E5 harnessBaseUrl \u4E0E trustedHosts \u914D\u7F6E\u3002":"WeChat was authorized, but the Harness Host trust check rejected a non-loopback request. Please check the harnessBaseUrl and trustedHosts configuration.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u5065\u5EB7\u68C0\u67E5\u6536\u5230\u4E86\u975E Harness \u6807\u51C6\u7684 403 \u62D2\u7EDD\u54CD\u5E94\u3002\u8BF7\u68C0\u67E5\u4EE3\u7406\u6216\u7F51\u5173\u914D\u7F6E\u3002":"WeChat was authorized, but the health check received a non-standard Harness 403 rejection. Please check the proxy or gateway configuration.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u627E\u4E0D\u5230 Harness \u5065\u5EB7\u68C0\u67E5\u63A5\u53E3\u3002\u8BF7\u786E\u8BA4 Harness \u4E0E\u63D2\u4EF6\u7248\u672C\u517C\u5BB9\u3002":"WeChat was authorized, but the Harness health check endpoint was not found. Please confirm the Harness and plugin versions are compatible.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u5065\u5EB7\u68C0\u67E5\u8FD4\u56DE\u670D\u52A1\u9519\u8BEF\u3002\u8BF7\u67E5\u770B dsh web \u65E5\u5FD7\u3002":"WeChat was authorized, but the Harness health check returned a server error. Please check the dsh web logs.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u8FD4\u56DE\u4E86\u65E0\u6CD5\u8BC6\u522B\u7684\u54CD\u5E94\u3002\u8BF7\u786E\u8BA4 Harness \u4E0E\u63D2\u4EF6\u7248\u672C\u517C\u5BB9\u3002":"WeChat was authorized, but Harness returned an unrecognized response. Please confirm the Harness and plugin versions are compatible.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u62D2\u7EDD\u4E86\u5065\u5EB7\u68C0\u67E5\u8BF7\u6C42\u3002\u8BF7\u67E5\u770B dsh web \u65E5\u5FD7\u3002":"WeChat was authorized, but Harness rejected the health check request. Please check the dsh web logs.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u5065\u5EB7\u68C0\u67E5\u53D1\u751F\u672A\u77E5\u9519\u8BEF\u3002\u8BF7\u67E5\u770B dsh web \u65E5\u5FD7\u3002":"WeChat was authorized, but the Harness health check failed with an unknown error. Please check the dsh web logs.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u6D88\u606F\u8FDE\u63A5\u521D\u59CB\u5316\u5931\u8D25\u3002\u8BF7\u67E5\u770B dsh web \u65E5\u5FD7\u540E\u91CD\u8BD5\u3002":"WeChat was authorized, but the message connection failed to initialize. Please check the dsh web logs and try again.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u6FC0\u6D3B\u8FC7\u7A0B\u4E2D\u53D1\u751F\u672A\u77E5\u9519\u8BEF\u3002\u8BF7\u67E5\u770B dsh web \u65E5\u5FD7\u3002":"WeChat was authorized, but an unknown error occurred during activation. Please check the dsh web logs.","\u767B\u5F55\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u79FB\u9664\u8D26\u53F7\u540E\u91CD\u65B0\u626B\u7801\u3002":"The login credential is missing. Please remove the account and scan the QR code again.","\u5FAE\u4FE1\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002":"The WeChat connection is not ready; the plugin will retry automatically.","\u5FAE\u4FE1\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5":"The WeChat connection is not ready; the plugin will retry automatically","\u65E0\u6CD5\u751F\u6210\u5FAE\u4FE1\u4E8C\u7EF4\u7801\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Unable to generate the WeChat QR code. Please try again later.","\u5FAE\u4FE1\u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"The WeChat connection is still not ready. Please try again later.",\u5FAE\u4FE1\u673A\u5668\u4EBA:"WeChat Bot","\u5FAE\u4FE1\u673A\u5668\u4EBA\uFF08{name}\uFF09":"WeChat Bot ({name})",\u5FAE\u4FE1\u6D88\u606F\u957F\u8F6E\u8BE2\u8FD0\u884C\u6B63\u5E38:"WeChat message long-polling is running normally",\u5FAE\u4FE1\u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF:"The WeChat connection is currently offline","\u914D\u5BF9\u7801\u591A\u6B21\u9519\u8BEF\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u4E8C\u7EF4\u7801\u3002":"The pairing code was entered incorrectly too many times. Please generate a new QR code.","\u8BE5\u5FAE\u4FE1\u8D26\u53F7\u5DF2\u7ED1\u5B9A\uFF0C\u4F46\u672C\u673A\u6CA1\u6709\u53EF\u6062\u590D\u7684\u51ED\u636E\u3002":"This WeChat account is already bound, but no recoverable credential exists on this machine.","\u5FAE\u4FE1\u6388\u6743\u6210\u529F\uFF0C\u4F46\u8FD4\u56DE\u7684\u8D26\u53F7\u51ED\u636E\u4E0D\u5B8C\u6574\u3002":"WeChat authorization succeeded, but the returned account credential is incomplete.","\u5FAE\u4FE1\u767B\u5F55\u51ED\u636E\u5DF2\u5931\u6548\uFF0C\u8BF7\u79FB\u9664\u8D26\u53F7\u540E\u91CD\u65B0\u626B\u7801\u3002":"The WeChat login credential has expired. Please remove the account and scan the QR code again.","\u5FAE\u4FE1\u6D88\u606F\u540C\u6B65\u8BF7\u6C42\u88AB\u62D2\u7EDD\u3002":"The WeChat message sync request was rejected.","\u5FAE\u4FE1\u56FE\u7247\u7684\u52A0\u5BC6\u5BC6\u94A5\u65E0\u6548\u3002":"The encryption key of the WeChat image is invalid.","\u5FAE\u4FE1\u56FE\u7247\u7684\u52A0\u5BC6\u6570\u636E\u65E0\u6548\u3002":"The encrypted data of the WeChat image is invalid.","\u5FAE\u4FE1\u56FE\u7247\u89E3\u5BC6\u5931\u8D25\u3002":"Failed to decrypt the WeChat image.","\u5FAE\u4FE1\u56FE\u7247\u6CA1\u6709\u53EF\u7528\u7684\u4E0B\u8F7D\u5730\u5740\u3002":"The WeChat image has no usable download URL.","\u5FAE\u4FE1\u56FE\u7247\u7684\u4E0B\u8F7D\u5730\u5740\u65E0\u6548\u3002":"The download URL of the WeChat image is invalid.","\u5FAE\u4FE1\u56FE\u7247\u7684\u4E0B\u8F7D\u5730\u5740\u4E0D\u53D7\u4FE1\u4EFB\u3002":"The download URL of the WeChat image is not trusted.","\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6548\u7684\u8FDE\u63A5\u5730\u5740\u3002":"The WeChat service returned an invalid connection URL.","\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u4E0D\u53D7\u4FE1\u4EFB\u7684\u8FDE\u63A5\u5730\u5740\u3002":"The WeChat service returned an untrusted connection URL.","\u5FAE\u4FE1\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u626B\u7801\u5730\u5740\u3002":"The WeChat service did not return a QR-code URL.","\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6548\u7684\u626B\u7801\u5730\u5740\u3002":"The WeChat service returned an invalid QR-code URL.","\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u4E0D\u53D7\u4FE1\u4EFB\u7684\u626B\u7801\u5730\u5740\u3002":"The WeChat service returned an untrusted QR-code URL.","\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6548\u7684\u6587\u4EF6\u4E0A\u4F20\u5730\u5740\u3002":"The WeChat service returned an invalid file upload URL.","\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u4E0D\u53D7\u4FE1\u4EFB\u7684\u6587\u4EF6\u4E0A\u4F20\u5730\u5740\u3002":"The WeChat service returned an untrusted file upload URL.","\u5FAE\u4FE1\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6587\u4EF6\u4E0A\u4F20\u5730\u5740\u3002":"The WeChat service did not return a file upload URL.","\u5FAE\u4FE1\u6587\u4EF6\u4E0A\u4F20\u88AB\u62D2\u7EDD\uFF08HTTP {status}\uFF09\u3002":"The WeChat file upload was rejected (HTTP {status}).","\u5FAE\u4FE1\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25\uFF08HTTP {status}\uFF09\u3002":"The WeChat file upload failed (HTTP {status}).","\u5FAE\u4FE1\u6587\u4EF6\u4E0A\u4F20\u54CD\u5E94\u7F3A\u5C11\u4E0B\u8F7D\u53C2\u6570\u3002":"The WeChat file upload response is missing the download parameter.","\u5FAE\u4FE1\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25\u3002":"The WeChat file upload failed.","\u62D2\u7EDD\u8BBF\u95EE\u4E0D\u53D7\u4FE1\u4EFB\u7684\u5FAE\u4FE1\u670D\u52A1\u5730\u5740\u3002":"Refusing to access an untrusted WeChat service URL.","\u5FAE\u4FE1\u670D\u52A1\u8BF7\u6C42\u5931\u8D25\uFF08HTTP {status}\uFF09\u3002":"The WeChat service request failed (HTTP {status}).","\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6CD5\u89E3\u6790\u7684\u54CD\u5E94\u3002":"The WeChat service returned an unparseable response.","\u5FAE\u4FE1\u670D\u52A1\u8BF7\u6C42\u8D85\u65F6\u3002":"The WeChat service request timed out.","\u6682\u65F6\u65E0\u6CD5\u8BBF\u95EE\u5FAE\u4FE1\u670D\u52A1\u3002":"The WeChat service is temporarily unreachable.","\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6CD5\u8BC6\u522B\u7684\u626B\u7801\u72B6\u6001\u3002":"The WeChat service returned an unrecognized QR-code status.","\u5FAE\u4FE1\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u4E8C\u7EF4\u7801\u4EE4\u724C\u3002":"The WeChat service did not return a QR-code token.","\u5FAE\u4FE1\u670D\u52A1\u62D2\u7EDD\u4E86\u56DE\u590D\u6D88\u606F\u3002":"The WeChat service rejected the reply message.","\u5FAE\u4FE1\u670D\u52A1\u62D2\u7EDD\u4E86\u6587\u4EF6\u4E0A\u4F20\u8BF7\u6C42\u3002":"The WeChat service rejected the file upload request.","\u5FAE\u4FE1\u670D\u52A1\u62D2\u7EDD\u4E86\u6587\u4EF6\u6D88\u606F\u3002":"The WeChat service rejected the file message.","\u5FAE\u4FE1\u8D26\u53F7\u8FDE\u63A5\u542F\u52A8\u5931\u8D25\u3002":"Failed to start the WeChat account connection."};var XU={Slack\u673A\u5668\u4EBA:"Slack bot","Slack\u673A\u5668\u4EBA\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u63A5\u5165\u3002":"Slack bot credentials are missing. Remove the bot and connect it again.","Slack Socket Mode \u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002":"The Slack Socket Mode connection is not ready yet. The plugin will retry automatically.","Slack\u673A\u5668\u4EBA\u5DF2\u63A5\u5165\uFF0CSocket Mode \u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\u3002":"The Slack bot is connected, but the Socket Mode connection is not ready yet.","Slack Socket Mode \u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u68C0\u67E5\u4E24\u4E2A Token\u3002":"The Slack Socket Mode connection is still not ready. Check both tokens.",Slack\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5:"The Slack bot is not connected yet","Slack Socket Mode \u957F\u8FDE\u63A5\u8FD0\u884C\u6B63\u5E38":"The Slack Socket Mode long-lived connection is running normally","Slack\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5":"The Slack connection is not ready. The plugin will retry automatically",Slack\u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF:"The Slack connection is currently offline","Slack \u672A\u6388\u6743\u673A\u5668\u4EBA\u8BFB\u53D6\u8BE5\u6587\u4EF6\u3002\u8BF7\u4E3A\u5E94\u7528\u6DFB\u52A0 files:read \u540E\u91CD\u65B0\u5B89\u88C5\uFF0C\u518D\u91CD\u65B0\u53D1\u9001\u56FE\u7247\u3002":"Slack has not granted the bot access to this file. Add the files:read scope to the app, reinstall it, then send the image again.","Slack Bot Token \u5FC5\u987B\u4EE5 xoxb- \u5F00\u5934\u3002":"The Slack Bot Token must start with xoxb-.","Slack App Token \u5FC5\u987B\u4EE5 xapp- \u5F00\u5934\u3002":"The Slack App Token must start with xapp-.","Slack Bot Token \u6CA1\u6709\u8FD4\u56DE\u5B8C\u6574\u7684\u673A\u5668\u4EBA\u8EAB\u4EFD\u3002":"The Slack Bot Token did not return a complete bot identity.","Slack App Token \u65E0\u6CD5\u521B\u5EFA Socket Mode \u8FDE\u63A5\uFF0C\u8BF7\u786E\u8BA4\u5DF2\u542F\u7528 Socket Mode \u548C connections:write\u3002":"The Slack App Token could not create a Socket Mode connection. Make sure Socket Mode and connections:write are enabled."};var $U={\u5F00\u542F\u4E00\u4E2A\u5168\u65B0\u4F1A\u8BDD:"Start a brand-new Session",\u538B\u7F29\u5F53\u524D\u4F1A\u8BDD\u7684\u8F83\u65E9\u4E0A\u4E0B\u6587:"Compact the earlier context of the current Session",\u5207\u6362\u5DE5\u4F5C\u533A:"Switch Workspace",\u5217\u51FA\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84:"List Workspace absolute paths","\u5217\u51FA\u4F1A\u8BDD ID \u548C\u6807\u9898":"List Session IDs and titles",\u5C06\u5F53\u524D\u804A\u5929\u7ED1\u5B9A\u5230\u6307\u5B9A\u4F1A\u8BDD:"Bind the current chat to a specific Session",\u6309\u5E8F\u53F7\u5217\u51FA\u6240\u6709\u53EF\u7528\u6A21\u578B:"List all available models by number",\u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u4F1A\u8BDD\u6A21\u578B:"View or switch the model of the current Session","\u5217\u51FA\u53EF\u7528 Agent Preset":"List available Agent Presets","\u67E5\u770B\u6216\u8BBE\u7F6E\u65B0\u4F1A\u8BDD Agent Preset":"View or set the Agent Preset for new Sessions",\u505C\u6B62\u5F53\u524D\u4EFB\u52A1:"Stop the current task",\u7EA0\u504F\u5F53\u524D\u4EFB\u52A1:"Steer the current task",\u68C0\u67E5\u8FDE\u63A5\u72B6\u6001:"Check connection status",\u67E5\u770B\u63D2\u4EF6\u7248\u672C:"Show plugin version",\u663E\u793A\u5E2E\u52A9:"Show help","\u8BE5 Telegram \u673A\u5668\u4EBA\u5DF2\u914D\u7F6E Webhook\uFF0C\u8BF7\u5148\u5728\u539F\u670D\u52A1\u4E2D\u79FB\u9664 Webhook \u540E\u91CD\u8BD5\u3002":"This Telegram bot already has a Webhook configured. Remove the Webhook from the original service and try again.",Telegram\u673A\u5668\u4EBA:"Telegram Bot"," Bot API \u957F\u8F6E\u8BE2":" Bot API long polling"};var eH={"Discord Bot Token \u65E0\u6548\uFF0C\u8BF7\u91CD\u65B0\u586B\u5199\u3002":"The Discord Bot Token is invalid. Please enter it again.","Discord Gateway Intents \u914D\u7F6E\u4E0D\u6B63\u786E\uFF0C\u8BF7\u68C0\u67E5 Developer Portal \u7684 Bot \u8BBE\u7F6E\u3002":"The Discord Gateway Intents are misconfigured. Please check the Bot settings in the Developer Portal.",Discord\u673A\u5668\u4EBA:"Discord Bot"," Gateway \u957F\u8FDE\u63A5":" Gateway long-lived connection"};var AH={"WhatsApp \u5173\u8054\u8BBE\u5907\u5DF2\u5931\u6548\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u626B\u7801\u3002":"The WhatsApp linked device is no longer valid. Remove it and scan the QR code again.","WhatsApp \u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002":"The WhatsApp connection is not ready yet; the plugin will retry automatically.","WhatsApp \u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"The WhatsApp connection is still not ready. Please try again later.",WhatsApp\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5:"The WhatsApp bot is not connected yet",WhatsApp\u673A\u5668\u4EBA:"WhatsApp bot","WhatsApp Web \u5173\u8054\u8BBE\u5907\u8FD0\u884C\u6B63\u5E38":"The WhatsApp Web linked device is working normally","WhatsApp \u8FDE\u63A5\u672A\u5C31\u7EEA":"The WhatsApp connection is not ready","WhatsApp \u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF":"The WhatsApp connection is currently offline","WhatsApp \u5DF2\u7ED1\u5B9A\uFF0C\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\u3002":"WhatsApp is linked, but the messaging connection is not ready yet.","WhatsApp \u5DF2\u626B\u7801\uFF0C\u4F46\u65E0\u6CD5\u4FDD\u5B58\u5173\u8054\u8BBE\u5907\u3002":"The QR code was scanned, but the linked device could not be saved.","\u65E0\u6CD5\u8FDE\u63A5 WhatsApp\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u4E8C\u7EF4\u7801\u3002":"Unable to connect to WhatsApp. Please generate a new QR code.",WhatsApp\u8D26\u53F7:"WhatsApp account"," Web \u5173\u8054\u8BBE\u5907":" Web linked device"};var tH={"AI Office \u62D2\u7EDD\u4E86 Device Token\u3002":"AI Office rejected the Device Token.","AI Office Connector Hook \u5C1A\u672A\u5C31\u7EEA\u3002":"The AI Office Connector Hook is not ready yet.","AI Office Connector \u534F\u8BAE\u7248\u672C\u4E0D\u517C\u5BB9\u3002":"The AI Office Connector protocol version is incompatible.","\u672C\u673A\u6682\u65F6\u65E0\u6CD5\u8BBF\u95EE AI Office\u3002":"This machine cannot reach AI Office right now.","AI Office \u8FDE\u63A5\u5DF2\u4E2D\u65AD\u3002":"The AI Office connection was interrupted.","\u672C\u673A Harness \u5DF2\u505C\u6B62\u8FD9\u6B21\u6267\u884C\u3002":"The local Harness stopped this run.","Office Job \u5DF2\u88AB\u9886\u53D6\u3001\u53D6\u6D88\u6216\u7ED3\u675F\u3002":"The Office Job has already been claimed, cancelled, or finished.","\u672C\u673A Harness \u672A\u80FD\u5B8C\u6210\u4EFB\u52A1\uFF1B\u8BF7\u68C0\u67E5 Harness \u4F1A\u8BDD\u540E\u91CD\u8BD5\u3002":"The local Harness could not complete the task; check the Harness Session and try again.","Office Job \u5F15\u7528\u4E86\u672C\u673A\u672A\u914D\u7F6E\u7684 Workspace/Preset alias\u3002":"The Office Job references a Workspace/Preset alias that is not configured locally.","\u4F60\u6B63\u5728\u672C\u673A DeepSeek Harness \u4E2D\u7EE7\u7EED\u4E00\u4E2A\u6765\u81EA AI Office \u7684\u4EFB\u52A1\u3002":"You are continuing an AI Office task inside the local DeepSeek Harness.","\u53EA\u5728\u5F53\u524D Workspace \u5185\u884C\u52A8\u3002\u5B8C\u6210\u540E\u5FC5\u987B\u8FD4\u56DE\uFF1A\u7ED3\u679C\u6458\u8981\u3001\u6539\u52A8\u6587\u4EF6\u3001\u9A8C\u8BC1\u8BC1\u636E\u3001\u672A\u89E3\u51B3\u98CE\u9669\u3002":"Act only within the current Workspace. When finished you must return: a result summary, changed files, verification evidence, and unresolved risks.","## \u672C\u673A Instruction Preset":"## Local Instruction Preset","## \u672C\u8F6E\u8865\u5145\u6307\u4EE4":"## Additional Instructions for This Round","## Office \u65F6\u95F4\u7EBF":"## Office Timeline","\u6279\u51C6 {tool}":"Approve {tool}","Harness \u5DE5\u5177":"Harness tool","Harness \u9700\u8981 {count} \u9879\u8865\u5145\u4FE1\u606F":"Harness needs {count} pieces of additional information","\u5DF2\u9886\u53D6 Job\uFF0C\u51C6\u5907 Workspace alias\uFF1A{alias}":"Job claimed; preparing Workspace alias: {alias}","Harness Session \u5DF2\u521B\u5EFA\u3002":"Harness Session created.","\u6B63\u5728\u4F7F\u7528 {tool}\u2026":"Using {tool}\u2026"};var rH=Object.freeze(Object.assign({},YU,jU,JU,qU,zU,VU,WU,ZU,XU,$U,eH,AH,tH));var aH="zh";function iH(n){let t=typeof n=="string"?n.trim().toLowerCase():"";aH=t==="english"||/^en(?:[-_].*)?$/u.test(t)?"en":"zh"}function D(n,t){if(typeof n!="string")return n;let o=aH==="en"?rH[n]??n:n;return t==null?o:o.replace(/\{(\w+)\}/g,(i,e)=>Object.hasOwn(t,e)?String(t[e]):i)}var yb=Object.freeze({version:1,bots:Object.freeze([])}),ige=new Set(["clientId","secretRef","approvedSenders"]);function zo(n){return typeof n=="string"&&n.trim()?n.trim():null}function oge(n){return $se("sha256").update(n).digest("hex")}function sH(n){let t=zo(n);return t&&/^dt_[a-f0-9]{24}$/.test(t)?t:null}function nge(n){let t=zo(n);return t&&/^DSH_DINGTALK_BOT_SECRET_[A-F0-9]{24}$/.test(t)?t:null}function sge(n){let t=zo(n);return t&&/^dt_sender_[a-f0-9]{32}$/.test(t)?t:null}function gge(n){let t=typeof n=="string"?{staffId:n}:n;if(!t||typeof t!="object"||Array.isArray(t))return null;let o=sge(t.senderKey),i=zo(t.staffId);return!o||!i?null:Object.freeze({senderKey:o,staffId:i,displayName:zo(t.displayName),approvedAt:zo(t.approvedAt)})}function cge(n){if(!Array.isArray(n))return null;let t=n.map(gge);if(t.some(e=>e===null))return null;let o=new Set,i=new Set;for(let e of t){if(o.has(e.staffId)||i.has(e.senderKey))return null;o.add(e.staffId),i.add(e.senderKey)}return Object.freeze(t)}function gf(n){let t=zo(n);if(!t)throw new TypeError("clientId is required");let o=oge(t).slice(0,24);return Object.freeze({botId:`dt_${o}`,secretRef:`DSH_DINGTALK_BOT_SECRET_${o.toUpperCase()}`})}function gH(){return`dt_sender_${nH().replaceAll("-","")}`}function mb(n){return zo(n)?D("\u8EAB\u4EFD\u5DF2\u9690\u85CF"):D("\u9489\u9489\u7528\u6237")}function Sb(n){let t=zo(n);return t?t.length<=8?`${t.slice(0,2)}\u2022\u2022\u2022\u2022`:`${t.slice(0,4)}\u2022\u2022\u2022\u2022${t.slice(-4)}`:D("\u9489\u9489\u673A\u5668\u4EBA")}function cH(n,{stored:t=!1}={}){if(!n||typeof n!="object"||Array.isArray(n)||"clientSecret"in n||"client_secret"in n||"deviceCode"in n||t&&Object.keys(n).some(r=>!ige.has(r)))return null;let o=zo(n.clientId),i=nge(n.secretRef),e=cge(n.approvedSenders??[]);if(!o||!i||!e)return null;let a=gf(o);return a.secretRef!==i||(n.botId===void 0?a.botId:sH(n.botId))!==a.botId?null:Object.freeze({botId:a.botId,clientId:o,secretRef:i,approvedSenders:e})}function Ige(n){if(!n||n.version!==1||!Array.isArray(n.bots))return null;let t=n.bots.map(a=>cH(a,{stored:!0}));if(t.some(a=>a===null))return null;let o=new Set,i=new Set,e=new Set;for(let a of t){if(o.has(a.botId)||i.has(a.clientId)||e.has(a.secretRef))return null;o.add(a.botId),i.add(a.clientId),e.add(a.secretRef)}return Object.freeze({version:1,bots:Object.freeze(t)})}function lge(n){return{version:1,bots:n.bots.map(t=>({clientId:t.clientId,secretRef:t.secretRef,approvedSenders:t.approvedSenders.map(o=>({senderKey:o.senderKey,staffId:o.staffId,displayName:o.displayName,approvedAt:o.approvedAt}))}))}}var sf=class{#e;#A=yb;#t=Promise.resolve();constructor(t){if(!zo(t))throw new TypeError("config path is required");this.#e=t}async load(){try{let t=Ige(JSON.parse(await Age(this.#e,"utf8")));if(!t)throw new Error("dsh-dingtalk config contains invalid bot data");this.#A=t}catch(t){if(t?.code!=="ENOENT")throw t;this.#A=yb}return this}list(){return structuredClone(this.#A.bots)}get(t){let o=this.#A.bots.find(i=>i.botId===t);return o?structuredClone(o):null}getByClientId(t){let o=this.#A.bots.find(i=>i.clientId===t);return o?structuredClone(o):null}async save(t){let o=cH(t);if(!o)throw new Error("Refusing to persist invalid dsh-dingtalk bot data");return this.#r(i=>{if(i.find(A=>(A.clientId===o.clientId||A.secretRef===o.secretRef)&&A.botId!==o.botId))throw new Error("Duplicate DingTalk bot identity");let a=i.findIndex(A=>A.botId===o.botId);return a===-1?i.push(o):i[a]=o,structuredClone(o)})}async remove(t){if(!sH(t))throw new TypeError("Invalid DingTalk bot id");return this.#r(o=>{let i=o.findIndex(a=>a.botId===t);if(i===-1)return null;let[e]=o.splice(i,1);return structuredClone(e)})}async clear(){let t=this.#t.then(async()=>{try{await oH(this.#e)}catch(o){if(o?.code!=="ENOENT")throw o}this.#A=yb});this.#t=t.then(()=>{},()=>{}),await t}async#r(t){let o,i=this.#t.then(async()=>{let e=[...this.#A.bots];o=t(e);let a=Object.freeze({version:1,bots:Object.freeze(e)});await this.#a(a),this.#A=a});return this.#t=i.then(()=>{},()=>{}),await i,o}async#a(t){await ege(age(this.#e),{recursive:!0,mode:448});let o=`${this.#e}.${process.pid}.${nH()}.tmp`;try{await rge(o,`${JSON.stringify(lge(t),null,2)} +**{total}** sessions in total{paging}`,"\uFF08\u7B2C {page}/{pageCount} \u9875\uFF09":" (page {page}/{pageCount})","\u2B50\u53D6\u5173":"\u2B50 Unwatch","\u2B50\u5173\u6CE8":"\u2B50 Watch","\u25C0 \u4E0A\u4E00\u9875":"\u25C0 Previous","\u4E0B\u4E00\u9875 \u25B6":"Next \u25B6","\u56DE\u590D\u6570\u5B57\uFF081~N\uFF09\u7ED1\u5B9A\u672C\u9875\u4F1A\u8BDD\u3002":"Reply with a number (1\u2013N) to bind a session on this page.","\u{1F4C2} \u4F1A\u8BDD\u5217\u8868":"\u{1F4C2} Session list","\u5F53\u524D Host \u4E0A\u6CA1\u6709\u5DF2\u767B\u8BB0\u7684\u5DE5\u4F5C\u533A\u3002":"No workspaces are registered on the current Host.","\u56DE\u590D\u6570\u5B57\u5207\u6362\u5DE5\u4F5C\u533A\uFF0C\u6216\u70B9\u51FB\u6309\u94AE\uFF1A":"Reply with a number to switch workspaces, or tap a button:","\u{1F5C2} \u5DE5\u4F5C\u533A":"\u{1F5C2} Workspace","\u{1F916} \u52A9\u624B\u83DC\u5355\uFF08\u56DE\u590D\u6570\u5B57\u5373\u53EF\uFF0C\u65E0\u9700\u8BB0\u547D\u4EE4\uFF09":"\u{1F916} Assistant menu (reply with a number \u2014 no need to memorize commands)","1 \xB7 /sessionlist \u5217\u51FA\u4F1A\u8BDD\uFF08\u56DE\u590D\u6570\u5B57\u7ED1\u5B9A\uFF09":"1 \xB7 /sessionlist List sessions (reply with a number to bind)","2 \xB7 /workspacelist \u5217\u51FA\u5DE5\u4F5C\u533A\uFF08\u56DE\u590D\u6570\u5B57\u5207\u6362\uFF09":"2 \xB7 /workspacelist List workspaces (reply with a number to switch)","3 \xB7 /new \u5F00\u542F\u65B0\u4F1A\u8BDD":"3 \xB7 /new Start a new session","4 \xB7 /status \u8FDE\u63A5\u72B6\u6001":"4 \xB7 /status Connection status","5 \xB7 /help \u672C\u5E2E\u52A9":"5 \xB7 /help This help","6 \xB7 /repair \u8865\u5168\u6743\u9650\u4E0E\u56DE\u8C03\uFF08\u8BF7\u56DE\u590D\u6570\u5B57 6\uFF09":"6 \xB7 /repair Complete permissions and callback (reply with the number 6)","7 \xB7 /watchlist \u5173\u6CE8\u5217\u8868":"7 \xB7 /watchlist Watch list","\u76F4\u63A5\u53D1\u9001\u6587\u5B57/\u56FE\u7247\u5373\u7EE7\u7EED\u5F53\u524D\u4F1A\u8BDD\u3002":"Send text or an image directly to continue the current session.","/session ID \u6216\u5E8F\u53F7 \u7ED1\u5B9A\u5DF2\u6709\u4F1A\u8BDD":"/session ID or index Bind an existing session","/watch ID \u6216\u5E8F\u53F7 \u5173\u6CE8\u4F1A\u8BDD\uFF08\u5B8C\u6210\u540E\u63A8\u9001\uFF09":"/watch ID or index Watch a session (push when done)","/compact \u538B\u7F29\u4E0A\u4E0B\u6587":"/compact Compact the context","/workspace \u7EDD\u5BF9\u8DEF\u5F84 \u5207\u6362\u5DE5\u4F5C\u533A":"/workspace Switch workspace","/presetlist \u5217\u51FA\u53EF\u7528 Agent Preset":"/presetlist List available Agent Presets","\u4EFB\u52A1\u5B8C\u6210\u4F1A\u81EA\u52A8\u63A8\u9001\uFF0C\u56DE\u590D\u6570\u5B57\u6216\u70B9\u6309\u94AE\u53D6\u6D88\u5173\u6CE8\uFF1A":"Completion is pushed automatically. Reply with a number or tap a button to unwatch:","\u{1F441} \u5173\u6CE8\u5217\u8868":"\u{1F441} Watch list","\u2B50 \u53D6\u6D88\u5173\u6CE8":"\u2B50 Unwatch","\u2606 \u5173\u6CE8":"\u2606 Watch","\u{1F50D} \u5173\u6CE8\u5217\u8868":"\u{1F50D} Watch list",\u52FE\u9009\u8981\u5173\u6CE8\u7684\u4F1A\u8BDD:"Select sessions to watch",\u52FE\u9009\u8981\u53D6\u6D88\u5173\u6CE8\u7684\u4F1A\u8BDD:"Select sessions to unwatch","\u5F53\u524D\u6CA1\u6709\u5173\u6CE8\u7684\u4F1A\u8BDD\u3002\u4EFB\u52A1\u5B8C\u6210\u4F1A\u81EA\u52A8\u63A8\u9001\u7ED3\u679C\u3002":"No sessions are being watched. Results are pushed automatically when tasks complete.","\u5F53\u524D\u5173\u6CE8 **{count}** \u4E2A\u4F1A\u8BDD\uFF1A":"Currently watching **{count}** sessions:","**\u2795 \u6DFB\u52A0\u5173\u6CE8**\uFF08\u591A\u9009\u4E0B\u62C9\u52FE\u9009\uFF09":"**\u2795 Add watch** (select from the multi-select dropdown)","**\u2796 \u53D6\u6D88\u5173\u6CE8**\uFF08\u591A\u9009\u4E0B\u62C9\u52FE\u9009\uFF09":"**\u2796 Remove watch** (select from the multi-select dropdown)","\u{1F4CB} \u4F1A\u8BDD\u5217\u8868":"\u{1F4CB} Session list","\u{1F519} \u8FD4\u56DE\u83DC\u5355":"\u{1F519} Back to menu",\u5DF2\u5B8C\u6210:"Completed",\u5DF2\u505C\u6B62:"Stopped",\u5DF2\u4E2D\u6B62:"Aborted",\u5DF2\u53D6\u6D88:"Cancelled",\u5DF2\u7ED3\u675F:"Ended","\u2705 \u4EFB\u52A1\u5B8C\u6210":"\u2705 Task complete","**\u72B6\u6001**\uFF1A{reason}":"**Status**: {reason}",\u6253\u5F00\u4F1A\u8BDD\u5217\u8868:"Open session list",\u5DE5\u4F5C\u533A:"Workspace","\u7ED1\u5B9A\u8BE5\u4F1A\u8BDD\u540E\u53EF\u7EE7\u7EED\u8FFD\u95EE\uFF0C\u8F93\u5165\u6587\u5B57\u5373\u53EF\u3002":"After binding this session you can keep asking; just type a message.","\u5F53\u524D\u6CA1\u6709\u5173\u6CE8\u7684\u4F1A\u8BDD\u3002\n`/watch ` \u5173\u6CE8\u540E\uFF0C\u4EFB\u52A1\u5B8C\u6210\u4F1A\u81EA\u52A8\u63A8\u9001\u3002":"No sessions are being watched.\nWatch one with `/watch ` and completion is pushed automatically.","\u6B63\u5728\u751F\u6210\u2026":"Generating\u2026",\u56DE\u7B54\u5B8C\u6210:"Answer complete",\u98DE\u4E66\u673A\u5668\u4EBA:"Feishu bot","\u98DE\u4E66\u673A\u5668\u4EBA\u7F3A\u5C11\u56FE\u7247\u8BFB\u53D6\u6743\u9650 im:message:readonly\uFF08\u98DE\u4E66\u663E\u793A\u4E3A\u201C\u83B7\u53D6\u5355\u804A\u3001\u7FA4\u7EC4\u6D88\u606F\u201D\uFF09\u3002\u8BF7\u79C1\u804A\u673A\u5668\u4EBA\u6267\u884C /repair \u547D\u4EE4\uFF0C\u6216\u8005\u5728\u300CIM\u673A\u5668\u4EBA\u300D\u8BBE\u7F6E\u9875\u70B9\u51FB\u201C\u8865\u5168\u6743\u9650\u201D\u6309\u94AE\u5E76\u626B\u7801\u3002\u6309\u98DE\u4E66\u63D0\u793A\u53D1\u5E03\u65B0\u7248\u672C\u3001\u5B8C\u6210\u5FC5\u8981\u5BA1\u6279\u540E\uFF0C\u518D\u91CD\u65B0\u53D1\u9001\u56FE\u7247\u3002":"The Feishu bot is missing the image-read scope im:message:readonly, shown by Feishu as \u201CRead direct and group messages.\u201D Run /repair in a direct chat with the bot, or click the \u201CComplete permissions\u201D button on the IM Bot settings page and scan the QR code. Publish a new version and complete any approval requested by Feishu, then resend the image.","\u2705 \u4FEE\u590D\u5B8C\u6210\uFF1A\u5DF2\u5B9E\u6D4B\u6536\u5230 card.action.trigger\uFF0C\u83DC\u5355\u6309\u94AE\u73B0\u5728\u53EF\u7528\u3002":"\u2705 Repair complete: card.action.trigger was received in a real test; the menu buttons now work.","\u26A0\uFE0F \u4FEE\u590D\u9A8C\u8BC1\u8D85\u65F6\uFF1A\u672A\u6536\u5230\u6D4B\u8BD5\u5361\u6309\u94AE\u7684 card.action.trigger\uFF0C\u4E0D\u80FD\u786E\u8BA4\u6309\u94AE\u5DF2\u4FEE\u590D\u3002\u8BF7\u4E0D\u8981\u91CD\u590D\u6388\u6743\uFF1B\u5148\u68C0\u67E5\u98DE\u4E66\u5F00\u653E\u5E73\u53F0\u7684\u5361\u7247\u56DE\u8C03\u914D\u7F6E\uFF0C\u786E\u8BA4\u540E\u518D\u53D1\u9001 /repair\u3002":"\u26A0\uFE0F Repair verification timed out: no card.action.trigger from the test card button was received, so the buttons cannot be confirmed repaired. Do not authorize again; check the card-callback configuration in Feishu Open Platform first, then send /repair.","\u26A0\uFE0F \u4FEE\u590D\u9A8C\u8BC1\u5931\u8D25\uFF1A\u65E0\u6CD5\u53D1\u9001\u4E13\u7528\u6D4B\u8BD5\u5361\uFF0C\u4E0D\u80FD\u786E\u8BA4 card.action.trigger \u5DF2\u6062\u590D\u3002\u8BF7\u4E0D\u8981\u91CD\u590D\u6388\u6743\uFF1B\u5148\u68C0\u67E5\u673A\u5668\u4EBA\u6D88\u606F\u6743\u9650\u548C\u8FDE\u63A5\u72B6\u6001\u3002":"\u26A0\uFE0F Repair verification failed: the dedicated test card could not be sent, so card.action.trigger cannot be confirmed restored. Do not authorize again; check the bot message permission and connection status first.","\u26A0\uFE0F \u4FEE\u590D\u9A8C\u8BC1\u4E2D\u65AD\uFF1ARuntime \u5DF2\u505C\u6B62\uFF0C\u672A\u5B8C\u6210 card.action.trigger \u5B9E\u6D4B\uFF0C\u4E0D\u80FD\u786E\u8BA4\u4FEE\u590D\u6210\u529F\u3002\u8BF7\u4E0D\u8981\u91CD\u590D\u6388\u6743\uFF1B\u5148\u7B49\u5F85\u673A\u5668\u4EBA\u6062\u590D\u8FDE\u63A5\u3002":"\u26A0\uFE0F Repair verification interrupted: the Runtime stopped before the card.action.trigger test completed, so the repair cannot be confirmed. Do not authorize again; wait for the bot to reconnect."};var zU={"\u5DF2\u8FDE\u63A5 DeepSeek Harness\uFF0C\u6B63\u5728\u601D\u8003\u2026":"Connected to DeepSeek Harness, thinking\u2026","\u9489\u9489\u673A\u5668\u4EBA\u5DF2\u8FDE\u63A5 DeepSeek Harness\u3002":"The DingTalk bot is connected to DeepSeek Harness.","\u9489\u9489\u672A\u80FD\u6362\u53D6\u56FE\u7247\u4E0B\u8F7D\u5730\u5740\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\uFF1B\u82E5\u6301\u7EED\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u673A\u5668\u4EBA\u7684\u201C\u4F01\u4E1A\u5185\u673A\u5668\u4EBA\u53D1\u9001\u6D88\u606F\u6743\u9650\u201D\u3002":`DingTalk could not provide the image download address. Please resend; if it keeps failing, check the bot's "Send messages as an internal robot" permission.`,"\u9489\u9489\u6CA1\u6709\u8FD4\u56DE\u56FE\u7247\u4E0B\u8F7D\u5730\u5740\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002":"DingTalk did not return an image download address. Please resend.","\u9489\u9489\u8FD4\u56DE\u7684\u56FE\u7247\u4E34\u65F6\u5730\u5740\u65E0\u6CD5\u8BFB\u53D6\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002":"The temporary image address returned by DingTalk could not be read. Please resend.","\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u53D1\u9001\u7ED3\u679C\u672A\u80FD\u786E\u8BA4\uFF0C\u8BF7\u5148\u68C0\u67E5\u804A\u5929\u5185\u662F\u5426\u5DF2\u6536\u5230\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u8BD5\u3002":'Delivery of the result file "{name}" could not be confirmed. Please check whether it already arrived in the chat before retrying.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u9489\u9489\u5E94\u7528\u6216\u673A\u5668\u4EBA\u7F3A\u5C11\u6587\u4EF6\u6D88\u606F\u6743\u9650\u3002\u8BF7\u5F00\u901A\u5E94\u7528 qyapi_base \u6743\u9650\uFF0C\u5E76\u786E\u8BA4\u673A\u5668\u4EBA\u5177\u5907\u6587\u4EF6\u6D88\u606F\u53D1\u9001\u80FD\u529B\u3002":`Result file "{name}" was generated, but the DingTalk app or bot lacks file message permission. Enable the app's qyapi_base permission and make sure the bot can send file messages.`,"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u8D85\u8FC7\u5F53\u524D\u9489\u9489\u673A\u5668\u4EBA\u53EF\u53D1\u9001\u7684\u6587\u4EF6\u5927\u5C0F\uFF0C\u672A\u53D1\u9001\u3002":'Result file "{name}" exceeds the file size limit of the current DingTalk bot and was not sent.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u88AB\u9489\u9489\u9650\u6D41\uFF0C\u672A\u80FD\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":'Result file "{name}" was rate-limited by DingTalk and could not be sent. Please try again later.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u9489\u9489\u62D2\u7EDD\u4E86\u8BE5\u6587\u4EF6\u6D88\u606F\uFF0C\u8BF7\u68C0\u67E5\u6587\u4EF6\u7C7B\u578B\u548C\u673A\u5668\u4EBA\u6587\u4EF6\u6D88\u606F\u914D\u7F6E\u3002":`Result file "{name}" was generated, but DingTalk rejected the file message. Check the file type and the bot's file message configuration.`,"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u6682\u65F6\u672A\u80FD\u901A\u8FC7\u9489\u9489\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":'Result file "{name}" was generated but could not be sent via DingTalk right now. Please try again later.',"\u7ED3\u679C\u6587\u4EF6\u5DF2\u751F\u6210\u3002":"The result file has been generated.","\u9489\u9489\u673A\u5668\u4EBA\u4E0E DeepSeek Harness \u8FDE\u63A5\u6B63\u5E38\u3002":"The DingTalk bot is connected to DeepSeek Harness normally.","\u9489\u9489\u547D\u4EE4\u5904\u7406\u5931\u8D25\u3002":"Failed to process the DingTalk command.","\u9489\u9489\u6D88\u606F\u6CA1\u6709\u5B89\u5168\u7684\u56DE\u590D\u5730\u5740\u3002":"The DingTalk message has no safe reply address.","\u9489\u9489\u5BA1\u6279\u5904\u7406\u5931\u8D25\u3002":"Failed to process the DingTalk approval.","\u9489\u9489\u6D88\u606F\u5904\u7406\u5931\u8D25\u3002":"Failed to process the DingTalk message.","\u9489\u9489\u6D88\u606F\u683C\u5F0F\u65E0\u6548\u3002":"Invalid DingTalk message format.","\u9489\u9489\u4EA4\u4E92\u95EE\u9898\u53D1\u9001\u5931\u8D25\u3002":"Failed to send the DingTalk interaction question.",\u9489\u9489\u7528\u6237:"DingTalk user",\u9489\u9489\u673A\u5668\u4EBA:"DingTalk bot",\u8EAB\u4EFD\u5DF2\u9690\u85CF:"Identity hidden","\u9489\u9489\u673A\u5668\u4EBA\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u626B\u7801\u3002":"The DingTalk bot credentials are missing. Remove the bot and scan the QR code again.","\u9489\u9489\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"The DingTalk connection is not ready. Please try again later.","\u9489\u9489\u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"The DingTalk connection is still not ready. Please try again later.","\u626B\u7801\u63A5\u5165\u5DF2\u53D6\u6D88\u3002":"QR code setup has been cancelled.","\u65E0\u6CD5\u751F\u6210\u9489\u9489\u4E8C\u7EF4\u7801\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Could not generate the DingTalk QR code. Please try again later.","\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u3002":"The QR code has expired. Generate a new one.","\u9489\u9489\u5DF2\u63A5\u5165\uFF0C\u4F46\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"DingTalk is connected, but the message connection is not ready yet. Please try again later.","\u9489\u9489\u672A\u5B8C\u6210\u673A\u5668\u4EBA\u6388\u6743\uFF0C\u8BF7\u91CD\u65B0\u626B\u7801\u3002":"DingTalk did not complete the bot authorization. Please scan the QR code again.","\u9489\u9489\u6388\u6743\u72B6\u6001\u6682\u65F6\u4E0D\u53EF\u7528\uFF0C\u6B63\u5728\u91CD\u8BD5\u3002":"The DingTalk authorization status is temporarily unavailable. Retrying.","\u9489\u9489\u5DF2\u6388\u6743\uFF0C\u4F46\u65E0\u6CD5\u5B89\u5168\u4FDD\u5B58\u63A5\u5165\u914D\u7F6E\u3002":"DingTalk authorization succeeded, but the configuration could not be saved safely.","\u9489\u9489\u6388\u6743\u67E5\u8BE2\u6682\u65F6\u5931\u8D25\uFF0C\u6B63\u5728\u91CD\u8BD5\u3002":"The DingTalk authorization query failed temporarily. Retrying.","\u9489\u9489\u673A\u5668\u4EBA\uFF08{clientId}\uFF09":"DingTalk bot ({clientId})","\u9489\u9489 Stream \u6D88\u606F\u8FDE\u63A5\u8FD0\u884C\u6B63\u5E38":"The DingTalk Stream message connection is running normally",\u9489\u9489\u6D88\u606F\u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF:"The DingTalk message connection is currently offline"};var VU={"\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA\u5DF2\u8FDE\u63A5 DeepSeek Harness\u3002":"The Enterprise WeChat bot is connected to DeepSeek Harness.","\u5F53\u524D\u5F85\u5904\u7406\u56FE\u7247\u8F83\u591A\uFF0C\u8BF7\u7A0D\u540E\u91CD\u65B0\u53D1\u9001\u3002":"Too many images are pending. Please send them again later.","\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u4F01\u4E1A\u5FAE\u4FE1\u667A\u80FD\u673A\u5668\u4EBA\u7F3A\u5C11\u7D20\u6750\u4E0A\u4F20\u6216\u6587\u4EF6\u6D88\u606F\u80FD\u529B\uFF0C\u8BF7\u68C0\u67E5\u673A\u5668\u4EBA\u6743\u9650\u3002":'The result file "{name}" was generated, but the Enterprise WeChat bot lacks media upload or file message capability. Please check the bot permissions.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u8D85\u8FC7\u5F53\u524D\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA\u53EF\u53D1\u9001\u7684\u6587\u4EF6\u5927\u5C0F\uFF0C\u672A\u53D1\u9001\u3002":'The result file "{name}" exceeds the file size this Enterprise WeChat bot can send and was not sent.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u4E3A\u7A7A\uFF0C\u4F01\u4E1A\u5FAE\u4FE1\u4E0D\u5141\u8BB8\u53D1\u9001\u7A7A\u6587\u4EF6\u3002":'The result file "{name}" is empty. Enterprise WeChat does not allow sending empty files.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u88AB\u4F01\u4E1A\u5FAE\u4FE1\u9650\u6D41\uFF0C\u672A\u80FD\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":'The result file "{name}" was rate-limited by Enterprise WeChat and could not be sent. Please try again later.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u4F01\u4E1A\u5FAE\u4FE1\u62D2\u7EDD\u4E86\u8BE5\u6587\u4EF6\u6216\u6587\u4EF6\u6D88\u606F\u3002":'The result file "{name}" was generated, but Enterprise WeChat rejected the file or file message.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u6682\u65F6\u672A\u80FD\u901A\u8FC7\u4F01\u4E1A\u5FAE\u4FE1\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":'The result file "{name}" was generated but could not be sent via Enterprise WeChat right now. Please try again later.',"\u4EFB\u52A1\u5DF2\u5B8C\u6210\uFF0C\u4F46\u6CA1\u6709\u751F\u6210\u53EF\u663E\u793A\u7684\u6587\u672C\u3002":"The task completed, but no displayable text was generated.","\u76EE\u524D\u652F\u6301\u6587\u5B57\u3001\u56FE\u7247\u548C\u8BED\u97F3\u8F6C\u5199\u6D88\u606F\u3002":"Currently only text, images, and voice transcription messages are supported.","\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA\u4E0E DeepSeek Harness \u8FDE\u63A5\u6B63\u5E38\u3002":"The connection between the Enterprise WeChat bot and DeepSeek Harness is working.","\u6B63\u5728\u601D\u8003\u4E2D\u2026":"Thinking\u2026","\u4F01\u4E1A\u5FAE\u4FE1\u4EA4\u4E92\u95EE\u9898\u53D1\u9001\u5931\u8D25\u3002":"Failed to send the Enterprise WeChat interaction question.","\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u626B\u7801\u3002":"The Enterprise WeChat bot credentials are missing. Please remove the bot and scan the QR code again.","\u4F01\u4E1A\u5FAE\u4FE1\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002":"The Enterprise WeChat connection is not ready. The plugin will retry automatically.","\u626B\u7801\u7ED1\u5B9A\u5DF2\u53D6\u6D88\u3002":"QR code binding has been cancelled.","\u65E0\u6CD5\u751F\u6210\u4F01\u4E1A\u5FAE\u4FE1\u4E8C\u7EF4\u7801\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Unable to generate the Enterprise WeChat QR code. Please try again later.","\u4F01\u4E1A\u5FAE\u4FE1\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u3002":"The Enterprise WeChat QR code has expired. Please generate a new one.","\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA\u5DF2\u7ED1\u5B9A\uFF0C\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\u3002":"The Enterprise WeChat bot is bound, but the message connection is not ready yet.","\u4F01\u4E1A\u5FAE\u4FE1\u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"The Enterprise WeChat connection is still not ready. Please try again later.","\u4F01\u4E1A\u5FAE\u4FE1\u626B\u7801\u6CA1\u6709\u5B8C\u6210\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u4E8C\u7EF4\u7801\u3002":"The Enterprise WeChat QR scan was not completed. Please generate a new QR code.","\u4F01\u4E1A\u5FAE\u4FE1\u626B\u7801\u670D\u52A1\u6682\u65F6\u4E0D\u53EF\u7528\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u4E8C\u7EF4\u7801\u3002":"The Enterprise WeChat QR service is temporarily unavailable. Please generate a new QR code.","\u4F01\u4E1A\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u65E0\u6CD5\u5B89\u5168\u4FDD\u5B58\u63A5\u5165\u914D\u7F6E\u3002":"Enterprise WeChat authorization succeeded, but the connection configuration could not be saved safely.",\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA:"Enterprise WeChat bot","\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA\uFF08{botId}\uFF09":"Enterprise WeChat bot ({botId})","\u4F01\u4E1A\u5FAE\u4FE1 WebSocket \u957F\u8FDE\u63A5\u8FD0\u884C\u6B63\u5E38":"The Enterprise WeChat WebSocket long connection is running normally","\u4F01\u4E1A\u5FAE\u4FE1\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5":"The Enterprise WeChat connection is not ready. The plugin will retry automatically",\u4F01\u4E1A\u5FAE\u4FE1\u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF:"The Enterprise WeChat connection is currently offline"};var WU={"QQ \u673A\u5668\u4EBA\u5DF2\u8FDE\u63A5 DeepSeek Harness\u3002":"The QQ bot is connected to DeepSeek Harness.","\u56DE\u7B54\u8F83\u957F\uFF0C\u540E\u7EED\u5185\u5BB9\u672A\u80FD\u901A\u8FC7 QQ \u5B8C\u6574\u53D1\u9001\uFF0C\u8BF7\u56DE\u590D\u201C\u7EE7\u7EED\u201D\u3002":"The answer is long and the rest could not be sent fully through QQ. Reply \u201C\u7EE7\u7EED\u201D (continue) to receive it.","\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46 QQ \u4ECA\u65E5\u6587\u4EF6\u4E0A\u4F20\u989D\u5EA6\u5DF2\u7528\u5B8C\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":`The result file "{name}" was generated, but QQ's daily file upload quota is used up. Please try again later.`,"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u5F53\u524D QQ \u673A\u5668\u4EBA\u6CA1\u6709\u6587\u4EF6\u6D88\u606F\u6743\u9650\u3002":'The result file "{name}" was generated, but the current QQ bot does not have file message permission.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u8D85\u8FC7\u5F53\u524D QQ \u673A\u5668\u4EBA\u53EF\u53D1\u9001\u7684\u6587\u4EF6\u5927\u5C0F\uFF0C\u672A\u53D1\u9001\u3002":'The result file "{name}" exceeds the file size the current QQ bot can send and was not sent.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u4E3A\u7A7A\uFF0CQQ \u4E0D\u5141\u8BB8\u53D1\u9001\u7A7A\u6587\u4EF6\u3002":'The result file "{name}" is empty, and QQ does not allow sending empty files.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u88AB QQ \u9650\u6D41\uFF0C\u672A\u80FD\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":'The result file "{name}" was temporarily rate-limited by QQ and was not sent. Please try again later.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46 QQ \u62D2\u7EDD\u4E86\u8BE5\u6587\u4EF6\u6216\u6587\u4EF6\u6D88\u606F\u3002":'The result file "{name}" was generated, but QQ rejected the file or file message.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u6682\u65F6\u672A\u80FD\u901A\u8FC7 QQ \u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":'The result file "{name}" was generated but could not be sent via QQ right now. Please try again later.',"QQ \u673A\u5668\u4EBA\u4E0E DeepSeek Harness \u8FDE\u63A5\u6B63\u5E38\u3002":"The QQ bot is connected to DeepSeek Harness normally.","QQ \u4EA4\u4E92\u95EE\u9898\u53D1\u9001\u5931\u8D25\u3002":"Failed to send the QQ interaction question.","QQ \u673A\u5668\u4EBA\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u626B\u7801\u3002":"The QQ bot credentials are missing. Remove the bot and scan the QR code again.","QQ \u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002":"The QQ connection is not ready; the plugin will retry automatically.","QQ \u626B\u7801\u670D\u52A1\u6682\u65F6\u4E0D\u53EF\u7528\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u4E8C\u7EF4\u7801\u3002":"The QQ QR service is temporarily unavailable. Please generate a new QR code.","\u65E0\u6CD5\u751F\u6210 QQ \u4E8C\u7EF4\u7801\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Unable to generate the QQ QR code. Please try again later.","QQ \u673A\u5668\u4EBA\u5DF2\u7ED1\u5B9A\uFF0C\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\u3002":"The QQ bot is bound, but the message connection is not ready yet.","QQ \u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"The QQ connection is still not ready. Please try again later.",QQ\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5:"The QQ bot is not connected yet","QQ \u673A\u5668\u4EBA\uFF08{appId}\uFF09":"QQ bot ({appId})",QQ\u673A\u5668\u4EBA:"QQ bot","QQ WebSocket \u957F\u8FDE\u63A5\u8FD0\u884C\u6B63\u5E38":"The QQ WebSocket long connection is running normally","QQ \u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5":"The QQ connection is not ready; the plugin will retry automatically","QQ \u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF":"The QQ connection is currently offline","QQ \u5DF2\u6388\u6743\uFF0C\u4F46\u65E0\u6CD5\u5B89\u5168\u4FDD\u5B58\u63A5\u5165\u914D\u7F6E\u3002":"QQ authorization succeeded, but the connection configuration could not be saved safely."};var ZU={"\u5FAE\u4FE1\u5DF2\u8FDE\u63A5 DeepSeek Harness\u3002":"WeChat is connected to DeepSeek Harness.","\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u5FAE\u4FE1\u673A\u5668\u4EBA\u5F53\u524D\u6CA1\u6709\u6587\u4EF6\u6D88\u606F\u53D1\u9001\u6743\u9650\uFF0C\u8BF7\u68C0\u67E5\u673A\u5668\u4EBA\u6587\u4EF6\u6D88\u606F\u80FD\u529B\u3002":`The result file "{name}" was generated, but the WeChat bot currently has no permission to send file messages. Please check the bot's file messaging capability.`,"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u8D85\u8FC7\u5F53\u524D\u5FAE\u4FE1\u4F1A\u8BDD\u53EF\u53D1\u9001\u7684\u6587\u4EF6\u5927\u5C0F\uFF0C\u672A\u53D1\u9001\u3002":'The result file "{name}" exceeds the file size limit of the current WeChat conversation and was not sent.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u88AB\u5FAE\u4FE1\u9650\u6D41\uFF0C\u672A\u80FD\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":'The result file "{name}" was temporarily rate-limited by WeChat and was not sent. Please try again later.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u5FAE\u4FE1\u62D2\u7EDD\u4E86\u8BE5\u6587\u4EF6\u6D88\u606F\u3002":'The result file "{name}" was generated, but WeChat rejected the file message.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u6682\u65F6\u672A\u80FD\u901A\u8FC7\u5FAE\u4FE1\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":'The result file "{name}" was generated but could not be sent via WeChat right now. Please try again later.',"\u76EE\u524D\u652F\u6301\u6587\u5B57\u3001\u56FE\u7247\uFF0C\u4EE5\u53CA\u5FAE\u4FE1\u5DF2\u8F6C\u6210\u6587\u5B57\u7684\u8BED\u97F3\u6D88\u606F\u3002":"Currently supports text, images, and voice messages that WeChat has converted to text.","\u5FAE\u4FE1\u4E0E DeepSeek Harness \u8FDE\u63A5\u6B63\u5E38\u3002":"WeChat is connected to DeepSeek Harness normally.","\u5FAE\u4FE1\u4EA4\u4E92\u95EE\u9898\u53D1\u9001\u5931\u8D25\u3002":"Failed to send the WeChat interaction question.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u65E0\u6CD5\u8BFB\u53D6\u73B0\u6709\u767B\u5F55\u51ED\u636E\u3002\u8BF7\u68C0\u67E5 DSH \u51ED\u636E\u5B58\u50A8\u3002":"WeChat was authorized, but the existing login credential could not be read. Please check the DSH credential store.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u767B\u5F55\u51ED\u636E\u65E0\u6CD5\u5199\u5165 DSH \u51ED\u636E\u5B58\u50A8\u3002\u8BF7\u68C0\u67E5\u51ED\u636E\u5B58\u50A8\u662F\u5426\u53EF\u5199\u3002":"WeChat was authorized, but the login credential could not be written to the DSH credential store. Please check that the credential store is writable.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u8D26\u53F7\u914D\u7F6E\u65E0\u6CD5\u5199\u5165\u672C\u673A\u3002\u8BF7\u68C0\u67E5 DSH_HOME \u76EE\u5F55\u6743\u9650\u3002":"WeChat was authorized, but the account configuration could not be written locally. Please check the DSH_HOME directory permissions.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u65E0\u6CD5\u521D\u59CB\u5316\u8D26\u53F7\u72B6\u6001\u6216\u5DE5\u4F5C\u533A\u3002\u8BF7\u68C0\u67E5 DSH_HOME \u548C\u5DE5\u4F5C\u533A\u76EE\u5F55\u3002":"WeChat was authorized, but the account state or workspace could not be initialized. Please check DSH_HOME and the workspace directories.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u63D2\u4EF6\u65E0\u6CD5\u8FDE\u63A5\u672C\u673A Harness\u3002\u8BF7\u68C0\u67E5 dsh web \u5730\u5740\u548C\u7AEF\u53E3\u3002":"WeChat was authorized, but the plugin could not connect to the local Harness. Please check the dsh web address and port.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u5065\u5EB7\u68C0\u67E5\u8D85\u65F6\u3002\u8BF7\u786E\u8BA4 dsh web \u672A\u963B\u585E\u3002":"WeChat was authorized, but the Harness health check timed out. Please confirm dsh web is not blocked.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u5065\u5EB7\u68C0\u67E5\u9700\u8981\u8EAB\u4EFD\u8BA4\u8BC1\u3002\u8BF7\u68C0\u67E5\u4EE3\u7406\u3001\u7F51\u5173\u6216\u81EA\u5B9A\u4E49\u9274\u6743\u914D\u7F6E\u3002":"WeChat was authorized, but the Harness health check requires authentication. Please check proxy, gateway, or custom auth configuration.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u672C\u673A Harness \u8BF7\u6C42\u88AB\u4EE3\u7406\u8981\u6C42\u8BA4\u8BC1\u3002\u8BF7\u8BA9\u56DE\u73AF\u5730\u5740\u7ED5\u8FC7\u4EE3\u7406\uFF0C\u5E76\u68C0\u67E5 NO_PROXY \u914D\u7F6E\u3002":"WeChat was authorized, but the local Harness request was challenged for proxy authentication. Please bypass the proxy for loopback addresses and check the NO_PROXY configuration.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u5F02\u5E38\u62D2\u7EDD\u4E86\u56DE\u73AF\u5730\u5740\u7684\u5065\u5EB7\u68C0\u67E5\u3002\u8BF7\u68C0\u67E5 HTTP \u4EE3\u7406\u3001Harness \u6E90\u7801\u7248\u672C\u548C\u6784\u5EFA\u4EA7\u7269\u3002":"WeChat was authorized, but Harness unexpectedly rejected the health check from a loopback address. Please check the HTTP proxy, Harness source version, and build artifacts.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u7684 Host \u4FE1\u4EFB\u68C0\u67E5\u62D2\u7EDD\u4E86\u975E\u56DE\u73AF\u5730\u5740\u8BF7\u6C42\u3002\u8BF7\u68C0\u67E5 harnessBaseUrl \u4E0E trustedHosts \u914D\u7F6E\u3002":"WeChat was authorized, but the Harness Host trust check rejected a non-loopback request. Please check the harnessBaseUrl and trustedHosts configuration.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u5065\u5EB7\u68C0\u67E5\u6536\u5230\u4E86\u975E Harness \u6807\u51C6\u7684 403 \u62D2\u7EDD\u54CD\u5E94\u3002\u8BF7\u68C0\u67E5\u4EE3\u7406\u6216\u7F51\u5173\u914D\u7F6E\u3002":"WeChat was authorized, but the health check received a non-standard Harness 403 rejection. Please check the proxy or gateway configuration.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u627E\u4E0D\u5230 Harness \u5065\u5EB7\u68C0\u67E5\u63A5\u53E3\u3002\u8BF7\u786E\u8BA4 Harness \u4E0E\u63D2\u4EF6\u7248\u672C\u517C\u5BB9\u3002":"WeChat was authorized, but the Harness health check endpoint was not found. Please confirm the Harness and plugin versions are compatible.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u5065\u5EB7\u68C0\u67E5\u8FD4\u56DE\u670D\u52A1\u9519\u8BEF\u3002\u8BF7\u67E5\u770B dsh web \u65E5\u5FD7\u3002":"WeChat was authorized, but the Harness health check returned a server error. Please check the dsh web logs.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u8FD4\u56DE\u4E86\u65E0\u6CD5\u8BC6\u522B\u7684\u54CD\u5E94\u3002\u8BF7\u786E\u8BA4 Harness \u4E0E\u63D2\u4EF6\u7248\u672C\u517C\u5BB9\u3002":"WeChat was authorized, but Harness returned an unrecognized response. Please confirm the Harness and plugin versions are compatible.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u62D2\u7EDD\u4E86\u5065\u5EB7\u68C0\u67E5\u8BF7\u6C42\u3002\u8BF7\u67E5\u770B dsh web \u65E5\u5FD7\u3002":"WeChat was authorized, but Harness rejected the health check request. Please check the dsh web logs.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u5065\u5EB7\u68C0\u67E5\u53D1\u751F\u672A\u77E5\u9519\u8BEF\u3002\u8BF7\u67E5\u770B dsh web \u65E5\u5FD7\u3002":"WeChat was authorized, but the Harness health check failed with an unknown error. Please check the dsh web logs.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u6D88\u606F\u8FDE\u63A5\u521D\u59CB\u5316\u5931\u8D25\u3002\u8BF7\u67E5\u770B dsh web \u65E5\u5FD7\u540E\u91CD\u8BD5\u3002":"WeChat was authorized, but the message connection failed to initialize. Please check the dsh web logs and try again.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u6FC0\u6D3B\u8FC7\u7A0B\u4E2D\u53D1\u751F\u672A\u77E5\u9519\u8BEF\u3002\u8BF7\u67E5\u770B dsh web \u65E5\u5FD7\u3002":"WeChat was authorized, but an unknown error occurred during activation. Please check the dsh web logs.","\u767B\u5F55\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u79FB\u9664\u8D26\u53F7\u540E\u91CD\u65B0\u626B\u7801\u3002":"The login credential is missing. Please remove the account and scan the QR code again.","\u5FAE\u4FE1\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002":"The WeChat connection is not ready; the plugin will retry automatically.","\u5FAE\u4FE1\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5":"The WeChat connection is not ready; the plugin will retry automatically","\u65E0\u6CD5\u751F\u6210\u5FAE\u4FE1\u4E8C\u7EF4\u7801\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Unable to generate the WeChat QR code. Please try again later.","\u5FAE\u4FE1\u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"The WeChat connection is still not ready. Please try again later.",\u5FAE\u4FE1\u673A\u5668\u4EBA:"WeChat Bot","\u5FAE\u4FE1\u673A\u5668\u4EBA\uFF08{name}\uFF09":"WeChat Bot ({name})",\u5FAE\u4FE1\u6D88\u606F\u957F\u8F6E\u8BE2\u8FD0\u884C\u6B63\u5E38:"WeChat message long-polling is running normally",\u5FAE\u4FE1\u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF:"The WeChat connection is currently offline","\u914D\u5BF9\u7801\u591A\u6B21\u9519\u8BEF\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u4E8C\u7EF4\u7801\u3002":"The pairing code was entered incorrectly too many times. Please generate a new QR code.","\u8BE5\u5FAE\u4FE1\u8D26\u53F7\u5DF2\u7ED1\u5B9A\uFF0C\u4F46\u672C\u673A\u6CA1\u6709\u53EF\u6062\u590D\u7684\u51ED\u636E\u3002":"This WeChat account is already bound, but no recoverable credential exists on this machine.","\u5FAE\u4FE1\u6388\u6743\u6210\u529F\uFF0C\u4F46\u8FD4\u56DE\u7684\u8D26\u53F7\u51ED\u636E\u4E0D\u5B8C\u6574\u3002":"WeChat authorization succeeded, but the returned account credential is incomplete.","\u5FAE\u4FE1\u767B\u5F55\u51ED\u636E\u5DF2\u5931\u6548\uFF0C\u8BF7\u79FB\u9664\u8D26\u53F7\u540E\u91CD\u65B0\u626B\u7801\u3002":"The WeChat login credential has expired. Please remove the account and scan the QR code again.","\u5FAE\u4FE1\u6D88\u606F\u540C\u6B65\u8BF7\u6C42\u88AB\u62D2\u7EDD\u3002":"The WeChat message sync request was rejected.","\u5FAE\u4FE1\u56FE\u7247\u7684\u52A0\u5BC6\u5BC6\u94A5\u65E0\u6548\u3002":"The encryption key of the WeChat image is invalid.","\u5FAE\u4FE1\u56FE\u7247\u7684\u52A0\u5BC6\u6570\u636E\u65E0\u6548\u3002":"The encrypted data of the WeChat image is invalid.","\u5FAE\u4FE1\u56FE\u7247\u89E3\u5BC6\u5931\u8D25\u3002":"Failed to decrypt the WeChat image.","\u5FAE\u4FE1\u56FE\u7247\u6CA1\u6709\u53EF\u7528\u7684\u4E0B\u8F7D\u5730\u5740\u3002":"The WeChat image has no usable download URL.","\u5FAE\u4FE1\u56FE\u7247\u7684\u4E0B\u8F7D\u5730\u5740\u65E0\u6548\u3002":"The download URL of the WeChat image is invalid.","\u5FAE\u4FE1\u56FE\u7247\u7684\u4E0B\u8F7D\u5730\u5740\u4E0D\u53D7\u4FE1\u4EFB\u3002":"The download URL of the WeChat image is not trusted.","\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6548\u7684\u8FDE\u63A5\u5730\u5740\u3002":"The WeChat service returned an invalid connection URL.","\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u4E0D\u53D7\u4FE1\u4EFB\u7684\u8FDE\u63A5\u5730\u5740\u3002":"The WeChat service returned an untrusted connection URL.","\u5FAE\u4FE1\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u626B\u7801\u5730\u5740\u3002":"The WeChat service did not return a QR-code URL.","\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6548\u7684\u626B\u7801\u5730\u5740\u3002":"The WeChat service returned an invalid QR-code URL.","\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u4E0D\u53D7\u4FE1\u4EFB\u7684\u626B\u7801\u5730\u5740\u3002":"The WeChat service returned an untrusted QR-code URL.","\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6548\u7684\u6587\u4EF6\u4E0A\u4F20\u5730\u5740\u3002":"The WeChat service returned an invalid file upload URL.","\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u4E0D\u53D7\u4FE1\u4EFB\u7684\u6587\u4EF6\u4E0A\u4F20\u5730\u5740\u3002":"The WeChat service returned an untrusted file upload URL.","\u5FAE\u4FE1\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6587\u4EF6\u4E0A\u4F20\u5730\u5740\u3002":"The WeChat service did not return a file upload URL.","\u5FAE\u4FE1\u6587\u4EF6\u4E0A\u4F20\u88AB\u62D2\u7EDD\uFF08HTTP {status}\uFF09\u3002":"The WeChat file upload was rejected (HTTP {status}).","\u5FAE\u4FE1\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25\uFF08HTTP {status}\uFF09\u3002":"The WeChat file upload failed (HTTP {status}).","\u5FAE\u4FE1\u6587\u4EF6\u4E0A\u4F20\u54CD\u5E94\u7F3A\u5C11\u4E0B\u8F7D\u53C2\u6570\u3002":"The WeChat file upload response is missing the download parameter.","\u5FAE\u4FE1\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25\u3002":"The WeChat file upload failed.","\u62D2\u7EDD\u8BBF\u95EE\u4E0D\u53D7\u4FE1\u4EFB\u7684\u5FAE\u4FE1\u670D\u52A1\u5730\u5740\u3002":"Refusing to access an untrusted WeChat service URL.","\u5FAE\u4FE1\u670D\u52A1\u8BF7\u6C42\u5931\u8D25\uFF08HTTP {status}\uFF09\u3002":"The WeChat service request failed (HTTP {status}).","\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6CD5\u89E3\u6790\u7684\u54CD\u5E94\u3002":"The WeChat service returned an unparseable response.","\u5FAE\u4FE1\u670D\u52A1\u8BF7\u6C42\u8D85\u65F6\u3002":"The WeChat service request timed out.","\u6682\u65F6\u65E0\u6CD5\u8BBF\u95EE\u5FAE\u4FE1\u670D\u52A1\u3002":"The WeChat service is temporarily unreachable.","\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6CD5\u8BC6\u522B\u7684\u626B\u7801\u72B6\u6001\u3002":"The WeChat service returned an unrecognized QR-code status.","\u5FAE\u4FE1\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u4E8C\u7EF4\u7801\u4EE4\u724C\u3002":"The WeChat service did not return a QR-code token.","\u5FAE\u4FE1\u670D\u52A1\u62D2\u7EDD\u4E86\u56DE\u590D\u6D88\u606F\u3002":"The WeChat service rejected the reply message.","\u5FAE\u4FE1\u670D\u52A1\u62D2\u7EDD\u4E86\u6587\u4EF6\u4E0A\u4F20\u8BF7\u6C42\u3002":"The WeChat service rejected the file upload request.","\u5FAE\u4FE1\u670D\u52A1\u62D2\u7EDD\u4E86\u6587\u4EF6\u6D88\u606F\u3002":"The WeChat service rejected the file message.","\u5FAE\u4FE1\u8D26\u53F7\u8FDE\u63A5\u542F\u52A8\u5931\u8D25\u3002":"Failed to start the WeChat account connection."};var XU={Slack\u673A\u5668\u4EBA:"Slack bot","Slack\u673A\u5668\u4EBA\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u63A5\u5165\u3002":"Slack bot credentials are missing. Remove the bot and connect it again.","Slack Socket Mode \u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002":"The Slack Socket Mode connection is not ready yet. The plugin will retry automatically.","Slack\u673A\u5668\u4EBA\u5DF2\u63A5\u5165\uFF0CSocket Mode \u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\u3002":"The Slack bot is connected, but the Socket Mode connection is not ready yet.","Slack Socket Mode \u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u68C0\u67E5\u4E24\u4E2A Token\u3002":"The Slack Socket Mode connection is still not ready. Check both tokens.",Slack\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5:"The Slack bot is not connected yet","Slack Socket Mode \u957F\u8FDE\u63A5\u8FD0\u884C\u6B63\u5E38":"The Slack Socket Mode long-lived connection is running normally","Slack\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5":"The Slack connection is not ready. The plugin will retry automatically",Slack\u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF:"The Slack connection is currently offline","Slack \u672A\u6388\u6743\u673A\u5668\u4EBA\u8BFB\u53D6\u8BE5\u6587\u4EF6\u3002\u8BF7\u4E3A\u5E94\u7528\u6DFB\u52A0 files:read \u540E\u91CD\u65B0\u5B89\u88C5\uFF0C\u518D\u91CD\u65B0\u53D1\u9001\u56FE\u7247\u3002":"Slack has not granted the bot access to this file. Add the files:read scope to the app, reinstall it, then send the image again.","Slack Bot Token \u5FC5\u987B\u4EE5 xoxb- \u5F00\u5934\u3002":"The Slack Bot Token must start with xoxb-.","Slack App Token \u5FC5\u987B\u4EE5 xapp- \u5F00\u5934\u3002":"The Slack App Token must start with xapp-.","Slack Bot Token \u6CA1\u6709\u8FD4\u56DE\u5B8C\u6574\u7684\u673A\u5668\u4EBA\u8EAB\u4EFD\u3002":"The Slack Bot Token did not return a complete bot identity.","Slack App Token \u65E0\u6CD5\u521B\u5EFA Socket Mode \u8FDE\u63A5\uFF0C\u8BF7\u786E\u8BA4\u5DF2\u542F\u7528 Socket Mode \u548C connections:write\u3002":"The Slack App Token could not create a Socket Mode connection. Make sure Socket Mode and connections:write are enabled."};var $U={\u5F00\u542F\u4E00\u4E2A\u5168\u65B0\u4F1A\u8BDD:"Start a brand-new Session",\u538B\u7F29\u5F53\u524D\u4F1A\u8BDD\u7684\u8F83\u65E9\u4E0A\u4E0B\u6587:"Compact the earlier context of the current Session",\u5207\u6362\u5DE5\u4F5C\u533A:"Switch Workspace",\u5217\u51FA\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84:"List Workspace absolute paths","\u5217\u51FA\u4F1A\u8BDD ID \u548C\u6807\u9898":"List Session IDs and titles",\u5C06\u5F53\u524D\u804A\u5929\u7ED1\u5B9A\u5230\u6307\u5B9A\u4F1A\u8BDD:"Bind the current chat to a specific Session",\u6309\u5E8F\u53F7\u5217\u51FA\u6240\u6709\u53EF\u7528\u6A21\u578B:"List all available models by number",\u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u4F1A\u8BDD\u6A21\u578B:"View or switch the model of the current Session","\u5217\u51FA\u53EF\u7528 Agent Preset":"List available Agent Presets","\u67E5\u770B\u6216\u8BBE\u7F6E\u65B0\u4F1A\u8BDD Agent Preset":"View or set the Agent Preset for new Sessions",\u505C\u6B62\u5F53\u524D\u4EFB\u52A1:"Stop the current task",\u7EA0\u504F\u5F53\u524D\u4EFB\u52A1:"Steer the current task",\u68C0\u67E5\u8FDE\u63A5\u72B6\u6001:"Check connection status",\u67E5\u770B\u63D2\u4EF6\u7248\u672C:"Show plugin version",\u663E\u793A\u5E2E\u52A9:"Show help","\u8BE5 Telegram \u673A\u5668\u4EBA\u5DF2\u914D\u7F6E Webhook\uFF0C\u8BF7\u5148\u5728\u539F\u670D\u52A1\u4E2D\u79FB\u9664 Webhook \u540E\u91CD\u8BD5\u3002":"This Telegram bot already has a Webhook configured. Remove the Webhook from the original service and try again.",Telegram\u673A\u5668\u4EBA:"Telegram Bot"," Bot API \u957F\u8F6E\u8BE2":" Bot API long polling"};var eH={"Discord Bot Token \u65E0\u6548\uFF0C\u8BF7\u91CD\u65B0\u586B\u5199\u3002":"The Discord Bot Token is invalid. Please enter it again.","Discord Gateway Intents \u914D\u7F6E\u4E0D\u6B63\u786E\uFF0C\u8BF7\u68C0\u67E5 Developer Portal \u7684 Bot \u8BBE\u7F6E\u3002":"The Discord Gateway Intents are misconfigured. Please check the Bot settings in the Developer Portal.",Discord\u673A\u5668\u4EBA:"Discord Bot"," Gateway \u957F\u8FDE\u63A5":" Gateway long-lived connection"};var AH={"WhatsApp \u5173\u8054\u8BBE\u5907\u5DF2\u5931\u6548\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u626B\u7801\u3002":"The WhatsApp linked device is no longer valid. Remove it and scan the QR code again.","WhatsApp \u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002":"The WhatsApp connection is not ready yet; the plugin will retry automatically.","WhatsApp \u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"The WhatsApp connection is still not ready. Please try again later.",WhatsApp\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5:"The WhatsApp bot is not connected yet",WhatsApp\u673A\u5668\u4EBA:"WhatsApp bot","WhatsApp Web \u5173\u8054\u8BBE\u5907\u8FD0\u884C\u6B63\u5E38":"The WhatsApp Web linked device is working normally","WhatsApp \u8FDE\u63A5\u672A\u5C31\u7EEA":"The WhatsApp connection is not ready","WhatsApp \u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF":"The WhatsApp connection is currently offline","WhatsApp \u5DF2\u7ED1\u5B9A\uFF0C\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\u3002":"WhatsApp is linked, but the messaging connection is not ready yet.","WhatsApp \u5DF2\u626B\u7801\uFF0C\u4F46\u65E0\u6CD5\u4FDD\u5B58\u5173\u8054\u8BBE\u5907\u3002":"The QR code was scanned, but the linked device could not be saved.","\u65E0\u6CD5\u8FDE\u63A5 WhatsApp\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u4E8C\u7EF4\u7801\u3002":"Unable to connect to WhatsApp. Please generate a new QR code.",WhatsApp\u8D26\u53F7:"WhatsApp account"," Web \u5173\u8054\u8BBE\u5907":" Web linked device"};var tH={"AI Office \u62D2\u7EDD\u4E86 Device Token\u3002":"AI Office rejected the Device Token.","AI Office Connector Hook \u5C1A\u672A\u5C31\u7EEA\u3002":"The AI Office Connector Hook is not ready yet.","AI Office Connector \u534F\u8BAE\u7248\u672C\u4E0D\u517C\u5BB9\u3002":"The AI Office Connector protocol version is incompatible.","\u672C\u673A\u6682\u65F6\u65E0\u6CD5\u8BBF\u95EE AI Office\u3002":"This machine cannot reach AI Office right now.","AI Office \u8FDE\u63A5\u5DF2\u4E2D\u65AD\u3002":"The AI Office connection was interrupted.","\u672C\u673A Harness \u5DF2\u505C\u6B62\u8FD9\u6B21\u6267\u884C\u3002":"The local Harness stopped this run.","Office Job \u5DF2\u88AB\u9886\u53D6\u3001\u53D6\u6D88\u6216\u7ED3\u675F\u3002":"The Office Job has already been claimed, cancelled, or finished.","\u672C\u673A Harness \u672A\u80FD\u5B8C\u6210\u4EFB\u52A1\uFF1B\u8BF7\u68C0\u67E5 Harness \u4F1A\u8BDD\u540E\u91CD\u8BD5\u3002":"The local Harness could not complete the task; check the Harness Session and try again.","Office Job \u5F15\u7528\u4E86\u672C\u673A\u672A\u914D\u7F6E\u7684 Workspace/Preset alias\u3002":"The Office Job references a Workspace/Preset alias that is not configured locally.","\u4F60\u6B63\u5728\u672C\u673A DeepSeek Harness \u4E2D\u7EE7\u7EED\u4E00\u4E2A\u6765\u81EA AI Office \u7684\u4EFB\u52A1\u3002":"You are continuing an AI Office task inside the local DeepSeek Harness.","\u53EA\u5728\u5F53\u524D Workspace \u5185\u884C\u52A8\u3002\u5B8C\u6210\u540E\u5FC5\u987B\u8FD4\u56DE\uFF1A\u7ED3\u679C\u6458\u8981\u3001\u6539\u52A8\u6587\u4EF6\u3001\u9A8C\u8BC1\u8BC1\u636E\u3001\u672A\u89E3\u51B3\u98CE\u9669\u3002":"Act only within the current Workspace. When finished you must return: a result summary, changed files, verification evidence, and unresolved risks.","## \u672C\u673A Instruction Preset":"## Local Instruction Preset","## \u672C\u8F6E\u8865\u5145\u6307\u4EE4":"## Additional Instructions for This Round","## Office \u65F6\u95F4\u7EBF":"## Office Timeline","\u6279\u51C6 {tool}":"Approve {tool}","Harness \u5DE5\u5177":"Harness tool","Harness \u9700\u8981 {count} \u9879\u8865\u5145\u4FE1\u606F":"Harness needs {count} pieces of additional information","\u5DF2\u9886\u53D6 Job\uFF0C\u51C6\u5907 Workspace alias\uFF1A{alias}":"Job claimed; preparing Workspace alias: {alias}","Harness Session \u5DF2\u521B\u5EFA\u3002":"Harness Session created.","\u6B63\u5728\u4F7F\u7528 {tool}\u2026":"Using {tool}\u2026"};var rH=Object.freeze(Object.assign({},YU,jU,JU,qU,zU,VU,WU,ZU,XU,$U,eH,AH,tH));var aH="zh";function iH(n){let t=typeof n=="string"?n.trim().toLowerCase():"";aH=t==="english"||/^en(?:[-_].*)?$/u.test(t)?"en":"zh"}function D(n,t){if(typeof n!="string")return n;let o=aH==="en"?rH[n]??n:n;return t==null?o:o.replace(/\{(\w+)\}/g,(i,e)=>Object.hasOwn(t,e)?String(t[e]):i)}var yb=Object.freeze({version:1,bots:Object.freeze([])}),ige=new Set(["clientId","secretRef","approvedSenders"]);function zo(n){return typeof n=="string"&&n.trim()?n.trim():null}function oge(n){return $se("sha256").update(n).digest("hex")}function sH(n){let t=zo(n);return t&&/^dt_[a-f0-9]{24}$/.test(t)?t:null}function nge(n){let t=zo(n);return t&&/^DSH_DINGTALK_BOT_SECRET_[A-F0-9]{24}$/.test(t)?t:null}function sge(n){let t=zo(n);return t&&/^dt_sender_[a-f0-9]{32}$/.test(t)?t:null}function gge(n){let t=typeof n=="string"?{staffId:n}:n;if(!t||typeof t!="object"||Array.isArray(t))return null;let o=sge(t.senderKey),i=zo(t.staffId);return!o||!i?null:Object.freeze({senderKey:o,staffId:i,displayName:zo(t.displayName),approvedAt:zo(t.approvedAt)})}function cge(n){if(!Array.isArray(n))return null;let t=n.map(gge);if(t.some(e=>e===null))return null;let o=new Set,i=new Set;for(let e of t){if(o.has(e.staffId)||i.has(e.senderKey))return null;o.add(e.staffId),i.add(e.senderKey)}return Object.freeze(t)}function gf(n){let t=zo(n);if(!t)throw new TypeError("clientId is required");let o=oge(t).slice(0,24);return Object.freeze({botId:`dt_${o}`,secretRef:`DSH_DINGTALK_BOT_SECRET_${o.toUpperCase()}`})}function gH(){return`dt_sender_${nH().replaceAll("-","")}`}function mb(n){return zo(n)?D("\u8EAB\u4EFD\u5DF2\u9690\u85CF"):D("\u9489\u9489\u7528\u6237")}function Sb(n){let t=zo(n);return t?t.length<=8?`${t.slice(0,2)}\u2022\u2022\u2022\u2022`:`${t.slice(0,4)}\u2022\u2022\u2022\u2022${t.slice(-4)}`:D("\u9489\u9489\u673A\u5668\u4EBA")}function cH(n,{stored:t=!1}={}){if(!n||typeof n!="object"||Array.isArray(n)||"clientSecret"in n||"client_secret"in n||"deviceCode"in n||t&&Object.keys(n).some(r=>!ige.has(r)))return null;let o=zo(n.clientId),i=nge(n.secretRef),e=cge(n.approvedSenders??[]);if(!o||!i||!e)return null;let a=gf(o);return a.secretRef!==i||(n.botId===void 0?a.botId:sH(n.botId))!==a.botId?null:Object.freeze({botId:a.botId,clientId:o,secretRef:i,approvedSenders:e})}function Ige(n){if(!n||n.version!==1||!Array.isArray(n.bots))return null;let t=n.bots.map(a=>cH(a,{stored:!0}));if(t.some(a=>a===null))return null;let o=new Set,i=new Set,e=new Set;for(let a of t){if(o.has(a.botId)||i.has(a.clientId)||e.has(a.secretRef))return null;o.add(a.botId),i.add(a.clientId),e.add(a.secretRef)}return Object.freeze({version:1,bots:Object.freeze(t)})}function lge(n){return{version:1,bots:n.bots.map(t=>({clientId:t.clientId,secretRef:t.secretRef,approvedSenders:t.approvedSenders.map(o=>({senderKey:o.senderKey,staffId:o.staffId,displayName:o.displayName,approvedAt:o.approvedAt}))}))}}var sf=class{#e;#A=yb;#t=Promise.resolve();constructor(t){if(!zo(t))throw new TypeError("config path is required");this.#e=t}async load(){try{let t=Ige(JSON.parse(await Age(this.#e,"utf8")));if(!t)throw new Error("dsh-dingtalk config contains invalid bot data");this.#A=t}catch(t){if(t?.code!=="ENOENT")throw t;this.#A=yb}return this}list(){return structuredClone(this.#A.bots)}get(t){let o=this.#A.bots.find(i=>i.botId===t);return o?structuredClone(o):null}getByClientId(t){let o=this.#A.bots.find(i=>i.clientId===t);return o?structuredClone(o):null}async save(t){let o=cH(t);if(!o)throw new Error("Refusing to persist invalid dsh-dingtalk bot data");return this.#r(i=>{if(i.find(A=>(A.clientId===o.clientId||A.secretRef===o.secretRef)&&A.botId!==o.botId))throw new Error("Duplicate DingTalk bot identity");let a=i.findIndex(A=>A.botId===o.botId);return a===-1?i.push(o):i[a]=o,structuredClone(o)})}async remove(t){if(!sH(t))throw new TypeError("Invalid DingTalk bot id");return this.#r(o=>{let i=o.findIndex(a=>a.botId===t);if(i===-1)return null;let[e]=o.splice(i,1);return structuredClone(e)})}async clear(){let t=this.#t.then(async()=>{try{await oH(this.#e)}catch(o){if(o?.code!=="ENOENT")throw o}this.#A=yb});this.#t=t.then(()=>{},()=>{}),await t}async#r(t){let o,i=this.#t.then(async()=>{let e=[...this.#A.bots];o=t(e);let a=Object.freeze({version:1,bots:Object.freeze(e)});await this.#a(a),this.#A=a});return this.#t=i.then(()=>{},()=>{}),await i,o}async#a(t){await ege(age(this.#e),{recursive:!0,mode:448});let o=`${this.#e}.${process.pid}.${nH()}.tmp`;try{await rge(o,`${JSON.stringify(lge(t),null,2)} `,{encoding:"utf8",flag:"wx",mode:384}),await tge(o,this.#e)}catch(i){try{await oH(o)}catch(e){if(e?.code!=="ENOENT")throw new AggregateError([i,e])}throw i}}};var lH="https://oapi.dingtalk.com",pge="DING_DWS_CLAW";function Vo(n){return typeof n=="string"&&n.trim()?n.trim():null}function IH(n,t){let o=Number(n);return Number.isFinite(o)&&o>0?o:t}function dge(n){let t;try{t=new URL(Vo(n)??lH)}catch{throw new TypeError("DingTalk registration base URL must be a valid HTTPS URL")}let o=t.hostname==="dingtalk.com"||t.hostname.endsWith(".dingtalk.com");if(t.protocol!=="https:"||t.port||!o||t.username||t.password||t.search||t.hash)throw new TypeError("DingTalk registration base URL must be a valid HTTPS URL");return t.pathname=t.pathname.replace(/\/+$/,""),t.href.replace(/\/$/,"")}function hge(n){let t=typeof n?.now=="function"?n.now():n();if(!Number.isFinite(t))throw new TypeError("clock must return a finite timestamp");return t}function Ege(n,t){if(!n||typeof n!="object"||Array.isArray(n))throw new On("invalid-response",`DingTalk ${t} returned an invalid response`,t);if(Number(n.errcode)!==0)throw new On("api-error",`DingTalk ${t} request was rejected`,t);return n}var On=class extends Error{constructor(t,o,i,e={}){super(o,e),this.name="DingtalkDeviceAuthError",this.code=t,this.action=i}},cf=class{#e;#A;#t;#r;constructor({fetch:t=globalThis.fetch,clock:o=Date,baseUrl:i=lH,timeoutMs:e=15e3}={}){if(typeof t!="function")throw new TypeError("fetch is required");if(typeof o!="function"&&typeof o?.now!="function")throw new TypeError("clock must be a function or expose now()");if(!Number.isFinite(e)||e<=0)throw new TypeError("timeoutMs must be a positive number");this.#e=t,this.#A=o,this.#t=dge(i),this.#r=e}async start({signal:t}={}){let o=await this.#a("/app/registration/init",{source:pge},"initialization",t),i=Vo(o.nonce);if(!i)throw new On("missing-nonce","DingTalk registration initialization did not return a nonce","initialization");let e=await this.#a("/app/registration/begin",{nonce:i},"begin",t),a=Vo(e.device_code),A=Vo(e.verification_uri_complete);if(!a||!A)throw new On("incomplete-registration","DingTalk registration did not return complete QR metadata","begin");let r=IH(e.expires_in,7200),s=IH(e.interval,5)*1e3;return Object.freeze({deviceCode:a,verificationUrl:A,verificationUri:Vo(e.verification_uri),userCode:Vo(e.user_code),expiresAt:hge(this.#A)+r*1e3,pollIntervalMs:s})}async poll(t){let o=Vo(typeof t=="string"?t:t?.deviceCode),i=typeof t=="object"?t?.signal:void 0;if(!o)throw new TypeError("deviceCode is required");let e=await this.#a("/app/registration/poll",{device_code:o},"poll",i),a=Vo(e.status)?.toUpperCase(),A=["WAITING","SUCCESS","FAIL","EXPIRED"].includes(a)?a:"UNKNOWN";return Object.freeze({status:A,clientId:Vo(e.client_id),clientSecret:Vo(e.client_secret),failReason:Vo(e.fail_reason)})}async#a(t,o,i,e){let a,A=AbortSignal.timeout(this.#r),r=e?AbortSignal.any([e,A]):A;try{a=await this.#e(`${this.#t}${t}`,{method:"POST",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify(o),redirect:"error",signal:r})}catch(g){throw e?.aborted?e.reason??g:A.aborted?new On("timeout",`DingTalk ${i} request timed out`,i,{cause:g}):g?.name==="AbortError"?g:new On("network-error",`DingTalk ${i} request could not be completed`,i,{cause:g})}if(!a||a.ok===!1||typeof a.json!="function")throw new On("http-error",`DingTalk ${i} request failed`,i);let s;try{s=await a.json()}catch(g){throw new On("invalid-json",`DingTalk ${i} returned invalid JSON`,i,{cause:g})}return Ege(s,i)}};import{randomUUID as wge}from"node:crypto";var pH=new WeakMap,Db=Symbol("dsh-im.connection-test-state-identity");function dH(n){return n?.[Db]??n}function Cge(n){return typeof n=="string"&&n.trim()?n.trim():null}function io(n,t){if(!n||!t||typeof t!="object")return!1;try{return pH.set(dH(n),structuredClone(t)),!0}catch{return!1}}function Kh(n){let t=n?pH.get(dH(n)):null;return t?structuredClone(t):null}function ma(n,t=D("\u673A\u5668\u4EBA")){let o=Cge(n)??t;return`${D("\u2705 DeepSeek Harness \u8FDE\u63A5\u6D4B\u8BD5\u6210\u529F")} -${D("\u8FD9\u6761\u6D88\u606F\u7531\u63D2\u4EF6\u9875\u9762\u4E2D\u7684\u201C{name}\u201D\u673A\u5668\u4EBA\u5361\u7247\u53D1\u51FA\u3002",{name:o})}`}function Ir(n=D("\u673A\u5668\u4EBA")){let t=new Error(D("{channelLabel}\u5C1A\u672A\u6536\u5230\u53EF\u7528\u4E8E\u6D4B\u8BD5\u7684\u79C1\u804A\u6D88\u606F\u3002",{channelLabel:n}));return t.code="test-target-unavailable",t}async function Tg({state:n,send:t,text:o,channelLabel:i}){let e=Kh(n);if(!e)throw Ir(i);return await t(e,o),{sent:!0}}function rr(n){return Object.freeze(n?{sent:!1,code:n?.code==="test-target-unavailable"?"test-target-unavailable":"test-message-failed"}:{sent:!0})}import{randomUUID as uge}from"node:crypto";var Bge=Object.freeze({AUTH:"MODEL_AUTH",MISSING_CREDENTIAL:"MODEL_AUTH",INVALID_CREDENTIAL:"MODEL_AUTH",QUOTA:"MODEL_QUOTA",RATE_LIMIT:"MODEL_RATE_LIMIT",CONTEXT_WINDOW_EXCEEDED:"MODEL_CONTEXT_LIMIT",UNKNOWN_MODEL:"MODEL_UNAVAILABLE",NO_ADAPTER:"MODEL_UNAVAILABLE",UNSUPPORTED_OPTION:"MODEL_CONFIG",UNSUPPORTED_REASONING_EFFORT:"MODEL_CONFIG",TIMEOUT:"MODEL_TIMEOUT",TRANSPORT:"MODEL_TRANSPORT",SERVER:"MODEL_SERVICE",STREAM_CLOSED:"MODEL_STREAM",MALFORMED_RESPONSE:"MODEL_STREAM",EMPTY_RESPONSE:"MODEL_EMPTY_REPLY",CONTENT_FILTER:"MODEL_CONTENT_REJECTED",UNSUPPORTED_CONTENT:"MODEL_CONFIG"}),fge=Object.freeze({HARNESS_CONNECT:"\u65E0\u6CD5\u8FDE\u63A5\u5904\u7406\u670D\u52A1\uFF0C\u6D88\u606F\u5C1A\u672A\u63D0\u4EA4\u3002\u8BF7\u786E\u8BA4 DeepSeek Harness \u6B63\u5728\u8FD0\u884C\u540E\u91CD\u8BD5\u3002",HARNESS_TIMEOUT:"\u5904\u7406\u670D\u52A1\u54CD\u5E94\u8D85\u65F6\uFF0C\u6D88\u606F\u5C1A\u672A\u5F00\u59CB\u5904\u7406\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",HARNESS_RESULT_UNCERTAIN:"\u6682\u65F6\u65E0\u6CD5\u786E\u8BA4\u4EFB\u52A1\u72B6\u6001\uFF0C\u4EFB\u52A1\u53EF\u80FD\u5DF2\u7ECF\u5F00\u59CB\u3002\u8BF7\u5148\u7B49\u5F85\u6216\u53D1\u9001 /stop\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u590D\u63D0\u4EA4\u3002",HARNESS_ACCESS:"\u5904\u7406\u670D\u52A1\u62D2\u7EDD\u4E86\u673A\u5668\u4EBA\u8FDE\u63A5\u3002\u8BF7\u7BA1\u7406\u5458\u68C0\u67E5 Harness \u5730\u5740\u3001\u4EE3\u7406\u6216\u8BBF\u95EE\u914D\u7F6E\u540E\u91CD\u8BD5\u3002",HARNESS_PROTOCOL:"\u673A\u5668\u4EBA\u4E0E DeepSeek Harness \u7684\u63A5\u53E3\u4E0D\u517C\u5BB9\u3002\u8BF7\u7BA1\u7406\u5458\u68C0\u67E5 Harness \u5730\u5740\u5E76\u66F4\u65B0\u76F8\u5173\u7248\u672C\u3002",HARNESS_SERVICE:"DeepSeek Harness \u6682\u65F6\u65E0\u6CD5\u5B8C\u6210\u8BF7\u6C42\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",MODEL_REPLY_TIMEOUT:"\u7B49\u5F85\u6A21\u578B\u56DE\u590D\u8D85\u65F6\uFF0C\u4EFB\u52A1\u53EF\u80FD\u4ECD\u5728\u8FD0\u884C\u3002\u8BF7\u5148\u7B49\u5F85\u6216\u53D1\u9001 /stop\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u590D\u63D0\u4EA4\u3002",MODEL_AUTH:"\u6A21\u578B\u51ED\u636E\u7F3A\u5931\u6216\u5DF2\u5931\u6548\u3002\u8BF7\u7BA1\u7406\u5458\u68C0\u67E5\u6A21\u578B\u914D\u7F6E\u540E\u91CD\u8BD5\u3002",MODEL_QUOTA:"\u6A21\u578B\u989D\u5EA6\u6216\u4F59\u989D\u4E0D\u8DB3\uFF0C\u672C\u6B21\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u7BA1\u7406\u5458\u8865\u5145\u989D\u5EA6\u6216\u5207\u6362\u6A21\u578B\u540E\u91CD\u8BD5\u3002",MODEL_RATE_LIMIT:"\u6A21\u578B\u670D\u52A1\u6B63\u5728\u9650\u6D41\uFF0C\u672C\u6B21\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",MODEL_CONTEXT_LIMIT:"\u5F53\u524D\u4F1A\u8BDD\u5185\u5BB9\u8D85\u8FC7\u6A21\u578B\u4E0A\u4E0B\u6587\u4E0A\u9650\u3002\u8BF7\u53D1\u9001 /compact \u6216 /new \u540E\u91CD\u8BD5\u3002",MODEL_UNAVAILABLE:"\u5F53\u524D\u6A21\u578B\u4E0D\u5B58\u5728\u6216\u4E0D\u652F\u6301\u6240\u9009\u914D\u7F6E\u3002\u8BF7\u53D1\u9001 /models\uFF0C\u5E76\u4F7F\u7528 /model \u91CD\u65B0\u9009\u62E9\u3002",MODEL_CONFIG:"\u5F53\u524D\u6A21\u578B\u4E0D\u652F\u6301\u8FD9\u7C7B\u5185\u5BB9\u6216\u6240\u9009\u914D\u7F6E\u3002\u8BF7\u8C03\u6574\u5185\u5BB9\u3001\u6A21\u578B\u6216\u63A8\u7406\u7B49\u7EA7\u540E\u91CD\u8BD5\u3002",MODEL_TIMEOUT:"\u6A21\u578B\u670D\u52A1\u54CD\u5E94\u8D85\u65F6\uFF0C\u672C\u6B21\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",MODEL_TRANSPORT:"\u6682\u65F6\u65E0\u6CD5\u8FDE\u63A5\u6A21\u578B\u670D\u52A1\uFF0C\u672C\u6B21\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",MODEL_SERVICE:"\u6A21\u578B\u670D\u52A1\u6682\u65F6\u5F02\u5E38\uFF0C\u672C\u6B21\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",MODEL_STREAM:"\u6A21\u578B\u56DE\u590D\u4E2D\u65AD\u6216\u683C\u5F0F\u5F02\u5E38\uFF0C\u672C\u6B21\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u91CD\u8BD5\u3002",MODEL_EMPTY_REPLY:"\u6A21\u578B\u6CA1\u6709\u8FD4\u56DE\u53EF\u663E\u793A\u7684\u5185\u5BB9\u3002\u8BF7\u91CD\u8BD5\uFF1B\u82E5\u6301\u7EED\u53D1\u751F\uFF0C\u8BF7\u5207\u6362\u6A21\u578B\u3002",MODEL_CONTENT_REJECTED:"\u6A21\u578B\u62D2\u7EDD\u5904\u7406\u5F53\u524D\u5185\u5BB9\u3002\u8BF7\u8C03\u6574\u95EE\u9898\u5185\u5BB9\u540E\u91CD\u8BD5\u3002",MODEL_OUTPUT_LIMIT:"\u6A21\u578B\u8FBE\u5230\u8F93\u51FA\u957F\u5EA6\u4E0A\u9650\uFF0C\u4F46\u6CA1\u6709\u751F\u6210\u53EF\u663E\u793A\u7684\u7ED3\u679C\u3002\u8BF7\u7F29\u5C0F\u4EFB\u52A1\u8303\u56F4\u540E\u91CD\u8BD5\u3002",TURN_BLOCKED:"\u4EFB\u52A1\u6B63\u5728\u7B49\u5F85\u65E0\u6CD5\u5728\u5F53\u524D\u6E20\u9053\u5B8C\u6210\u7684\u64CD\u4F5C\u3002\u8BF7\u5728 DeepSeek Harness \u4E2D\u5904\u7406\u540E\u518D\u8BD5\u3002",TURN_INTERRUPTED:"\u4EFB\u52A1\u88AB\u610F\u5916\u4E2D\u65AD\uFF0C\u672C\u6B21\u672A\u5B8C\u6210\u3002\u8BF7\u91CD\u8BD5\u3002",SESSION_NOT_FOUND:"\u5F53\u524D\u4F1A\u8BDD\u5DF2\u4E0D\u5B58\u5728\u3002\u8BF7\u53D1\u9001 /new \u521B\u5EFA\u65B0\u4F1A\u8BDD\u540E\u91CD\u8BD5\u3002",SESSION_BUSY:"\u5F53\u524D\u4F1A\u8BDD\u4ECD\u5728\u5904\u7406\u4E0A\u4E00\u9879\u4EFB\u52A1\u3002\u8BF7\u7B49\u5F85\u5B8C\u6210\uFF0C\u6216\u53D1\u9001 /stop \u540E\u91CD\u8BD5\u3002",SESSION_STALE:"\u5DE5\u4F5C\u533A\u6216\u4F1A\u8BDD\u72B6\u6001\u521A\u521A\u53D1\u751F\u53D8\u5316\u3002\u8BF7\u91CD\u65B0\u53D1\u9001\u8FD9\u6761\u6D88\u606F\u3002",WORKSPACE_UNAVAILABLE:"\u5F53\u524D\u5DE5\u4F5C\u533A\u4E0D\u5B58\u5728\u6216\u6682\u4E0D\u53EF\u7528\u3002\u8BF7\u91CD\u65B0\u9009\u62E9\u5DE5\u4F5C\u533A\u540E\u91CD\u8BD5\u3002",PRESET_UNAVAILABLE:"\u5F53\u524D Agent Preset \u4E0D\u5B58\u5728\u6216\u6682\u4E0D\u53EF\u7528\u3002\u8BF7\u53D1\u9001 /presetlist \u540E\u91CD\u65B0\u9009\u62E9\u3002",CHANNEL_PERMISSION:"\u56DE\u590D\u5DF2\u7ECF\u751F\u6210\uFF0C\u4F46\u673A\u5668\u4EBA\u6CA1\u6709\u53D1\u9001\u6743\u9650\u3002\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u68C0\u67E5\u6E20\u9053\u6743\u9650\u6216\u91CD\u65B0\u7ED1\u5B9A\u673A\u5668\u4EBA\u3002",CHANNEL_RATE_LIMIT:"\u56DE\u590D\u5DF2\u7ECF\u751F\u6210\uFF0C\u4F46\u5F53\u524D\u6E20\u9053\u6B63\u5728\u9650\u6D41\uFF0C\u6682\u65F6\u65E0\u6CD5\u53D1\u9001\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",CHANNEL_DELIVERY_UNCERTAIN:"\u56DE\u590D\u53D1\u9001\u7ED3\u679C\u672A\u80FD\u786E\u8BA4\u3002\u8BF7\u5148\u68C0\u67E5\u804A\u5929\u5185\u662F\u5426\u5DF2\u7ECF\u6536\u5230\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u590D\u63D0\u4EA4\u3002",CHANNEL_DELIVERY:"\u56DE\u590D\u5DF2\u7ECF\u751F\u6210\uFF0C\u4F46\u5F53\u524D\u6E20\u9053\u6682\u65F6\u65E0\u6CD5\u53D1\u9001\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",INPUT_INVALID:"\u5F53\u524D\u6D88\u606F\u5305\u542B\u65E0\u6CD5\u5904\u7406\u7684\u56FE\u7247\u6216\u6587\u4EF6\u3002\u8BF7\u8C03\u6574\u540E\u91CD\u65B0\u53D1\u9001\u3002",INTERNAL_UNKNOWN:"\u4EFB\u52A1\u672A\u5B8C\u6210\uFF0C\u6682\u65F6\u65E0\u6CD5\u786E\u5B9A\u539F\u56E0\u3002\u8BF7\u91CD\u8BD5\uFF1B\u82E5\u6301\u7EED\u53D1\u751F\uFF0C\u8BF7\u5C06\u53C2\u8003\u53F7\u63D0\u4F9B\u7ED9\u7BA1\u7406\u5458\u3002"});function Qge(n){if(n?.code!=="harness-turn-failed")return null;let t=n?.providerCode??n?.details?.providerCode;return typeof t!="string"?null:Bge[t.trim().toUpperCase()]??null}function yge(n){let t=typeof n?.code=="string"?n.code:"",o=Qge(n);if(o)return o;if(t==="harness-connect-failed")return["session.prompt","session.history"].includes(n?.method)?"HARNESS_RESULT_UNCERTAIN":"HARNESS_CONNECT";if(t==="harness-timeout")return["session.prompt","session.history"].includes(n?.method)?"HARNESS_RESULT_UNCERTAIN":"HARNESS_TIMEOUT";if(t==="harness-reply-timeout")return"MODEL_REPLY_TIMEOUT";if(["harness-auth-required","harness-proxy-auth-required","harness-loopback-forbidden","harness-host-untrusted","harness-request-forbidden"].includes(t))return"HARNESS_ACCESS";if(["harness-api-not-found","harness-response-invalid"].includes(t))return"HARNESS_PROTOCOL";if(t==="harness-turn-failed")return"INTERNAL_UNKNOWN";if(["harness-http-failed","harness-rpc-rejected"].includes(t))return"HARNESS_SERVICE";if(t==="model-empty-response")return"MODEL_EMPTY_REPLY";if(t==="model-max-tokens")return"MODEL_OUTPUT_LIMIT";if(t==="turn-blocked")return"TURN_BLOCKED";if(["turn-interrupted","turn-aborted"].includes(t))return"TURN_INTERRUPTED";if(t==="session-not-found")return"SESSION_NOT_FOUND";if(t==="agent-busy")return"SESSION_BUSY";if(t==="workspace-session-stale")return"SESSION_STALE";if(t.startsWith("workspace-"))return"WORKSPACE_UNAVAILABLE";if(t.startsWith("agent-preset-"))return"PRESET_UNAVAILABLE";if(t.startsWith("image-")||t.startsWith("inbound-file-")||t==="attachment-error")return"INPUT_INVALID";let i=Number(n?.status??n?.httpStatus);return i===401||i===403||["channel-permission","permission-required","artifact-permission-required","forbidden","stale-token"].includes(t)?"CHANNEL_PERMISSION":i===429||["channel-rate-limit","rate-limited","artifact-rate-limited"].includes(t)?"CHANNEL_RATE_LIMIT":["channel-delivery-uncertain","delivery-uncertain","artifact-delivery-uncertain"].includes(t)?"CHANNEL_DELIVERY_UNCERTAIN":t==="channel-delivery-failed"||t.startsWith("artifact-")||["network-error","timeout"].includes(t)?"CHANNEL_DELIVERY":"INTERNAL_UNKNOWN"}function mge(n){return typeof n=="string"&&/^[A-Z0-9-]{6,40}$/u.test(n)?n:`MF-${uge().slice(0,8).toUpperCase()}`}function Sge(n){return typeof n!="string"||!/^[A-Za-z0-9_-]{1,64}$/u.test(n)?null:n.toUpperCase().replaceAll("-","_")}function Dge(n,{userMessage:t,reason:o,referenceId:i,at:e=Date.now()}={}){let a=Sge(o),A=yge(n),r=A==="INTERNAL_UNKNOWN"&&a&&typeof t=="string"&&t.trim()?"INPUT_INVALID":A;return Object.freeze({code:r,reason:a??r,message:typeof t=="string"&&t.trim()?t.trim():D(fge[r]),referenceId:mge(i),at:Number.isFinite(e)?e:Date.now()})}function dt(n){return`${n.message} +${D("\u8FD9\u6761\u6D88\u606F\u7531\u300CIM\u673A\u5668\u4EBA\u300D\u8BBE\u7F6E\u9875\u4E2D\u7684\u201C{name}\u201D\u673A\u5668\u4EBA\u5361\u7247\u53D1\u51FA\u3002",{name:o})}`}function Ir(n=D("\u673A\u5668\u4EBA")){let t=new Error(D("{channelLabel}\u5C1A\u672A\u6536\u5230\u53EF\u7528\u4E8E\u6D4B\u8BD5\u7684\u79C1\u804A\u6D88\u606F\u3002",{channelLabel:n}));return t.code="test-target-unavailable",t}async function Tg({state:n,send:t,text:o,channelLabel:i}){let e=Kh(n);if(!e)throw Ir(i);return await t(e,o),{sent:!0}}function rr(n){return Object.freeze(n?{sent:!1,code:n?.code==="test-target-unavailable"?"test-target-unavailable":"test-message-failed"}:{sent:!0})}import{randomUUID as uge}from"node:crypto";var Bge=Object.freeze({AUTH:"MODEL_AUTH",MISSING_CREDENTIAL:"MODEL_AUTH",INVALID_CREDENTIAL:"MODEL_AUTH",QUOTA:"MODEL_QUOTA",RATE_LIMIT:"MODEL_RATE_LIMIT",CONTEXT_WINDOW_EXCEEDED:"MODEL_CONTEXT_LIMIT",UNKNOWN_MODEL:"MODEL_UNAVAILABLE",NO_ADAPTER:"MODEL_UNAVAILABLE",UNSUPPORTED_OPTION:"MODEL_CONFIG",UNSUPPORTED_REASONING_EFFORT:"MODEL_CONFIG",TIMEOUT:"MODEL_TIMEOUT",TRANSPORT:"MODEL_TRANSPORT",SERVER:"MODEL_SERVICE",STREAM_CLOSED:"MODEL_STREAM",MALFORMED_RESPONSE:"MODEL_STREAM",EMPTY_RESPONSE:"MODEL_EMPTY_REPLY",CONTENT_FILTER:"MODEL_CONTENT_REJECTED",UNSUPPORTED_CONTENT:"MODEL_CONFIG"}),fge=Object.freeze({HARNESS_CONNECT:"\u65E0\u6CD5\u8FDE\u63A5\u5904\u7406\u670D\u52A1\uFF0C\u6D88\u606F\u5C1A\u672A\u63D0\u4EA4\u3002\u8BF7\u786E\u8BA4 DeepSeek Harness \u6B63\u5728\u8FD0\u884C\u540E\u91CD\u8BD5\u3002",HARNESS_TIMEOUT:"\u5904\u7406\u670D\u52A1\u54CD\u5E94\u8D85\u65F6\uFF0C\u6D88\u606F\u5C1A\u672A\u5F00\u59CB\u5904\u7406\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",HARNESS_RESULT_UNCERTAIN:"\u6682\u65F6\u65E0\u6CD5\u786E\u8BA4\u4EFB\u52A1\u72B6\u6001\uFF0C\u4EFB\u52A1\u53EF\u80FD\u5DF2\u7ECF\u5F00\u59CB\u3002\u8BF7\u5148\u7B49\u5F85\u6216\u53D1\u9001 /stop\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u590D\u63D0\u4EA4\u3002",HARNESS_ACCESS:"\u5904\u7406\u670D\u52A1\u62D2\u7EDD\u4E86\u673A\u5668\u4EBA\u8FDE\u63A5\u3002\u8BF7\u7BA1\u7406\u5458\u68C0\u67E5 Harness \u5730\u5740\u3001\u4EE3\u7406\u6216\u8BBF\u95EE\u914D\u7F6E\u540E\u91CD\u8BD5\u3002",HARNESS_PROTOCOL:"\u673A\u5668\u4EBA\u4E0E DeepSeek Harness \u7684\u63A5\u53E3\u4E0D\u517C\u5BB9\u3002\u8BF7\u7BA1\u7406\u5458\u68C0\u67E5 Harness \u5730\u5740\u5E76\u66F4\u65B0\u76F8\u5173\u7248\u672C\u3002",HARNESS_SERVICE:"DeepSeek Harness \u6682\u65F6\u65E0\u6CD5\u5B8C\u6210\u8BF7\u6C42\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",MODEL_REPLY_TIMEOUT:"\u7B49\u5F85\u6A21\u578B\u56DE\u590D\u8D85\u65F6\uFF0C\u4EFB\u52A1\u53EF\u80FD\u4ECD\u5728\u8FD0\u884C\u3002\u8BF7\u5148\u7B49\u5F85\u6216\u53D1\u9001 /stop\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u590D\u63D0\u4EA4\u3002",MODEL_AUTH:"\u6A21\u578B\u51ED\u636E\u7F3A\u5931\u6216\u5DF2\u5931\u6548\u3002\u8BF7\u7BA1\u7406\u5458\u68C0\u67E5\u6A21\u578B\u914D\u7F6E\u540E\u91CD\u8BD5\u3002",MODEL_QUOTA:"\u6A21\u578B\u989D\u5EA6\u6216\u4F59\u989D\u4E0D\u8DB3\uFF0C\u672C\u6B21\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u7BA1\u7406\u5458\u8865\u5145\u989D\u5EA6\u6216\u5207\u6362\u6A21\u578B\u540E\u91CD\u8BD5\u3002",MODEL_RATE_LIMIT:"\u6A21\u578B\u670D\u52A1\u6B63\u5728\u9650\u6D41\uFF0C\u672C\u6B21\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",MODEL_CONTEXT_LIMIT:"\u5F53\u524D\u4F1A\u8BDD\u5185\u5BB9\u8D85\u8FC7\u6A21\u578B\u4E0A\u4E0B\u6587\u4E0A\u9650\u3002\u8BF7\u53D1\u9001 /compact \u6216 /new \u540E\u91CD\u8BD5\u3002",MODEL_UNAVAILABLE:"\u5F53\u524D\u6A21\u578B\u4E0D\u5B58\u5728\u6216\u4E0D\u652F\u6301\u6240\u9009\u914D\u7F6E\u3002\u8BF7\u53D1\u9001 /models\uFF0C\u5E76\u4F7F\u7528 /model \u91CD\u65B0\u9009\u62E9\u3002",MODEL_CONFIG:"\u5F53\u524D\u6A21\u578B\u4E0D\u652F\u6301\u8FD9\u7C7B\u5185\u5BB9\u6216\u6240\u9009\u914D\u7F6E\u3002\u8BF7\u8C03\u6574\u5185\u5BB9\u3001\u6A21\u578B\u6216\u63A8\u7406\u7B49\u7EA7\u540E\u91CD\u8BD5\u3002",MODEL_TIMEOUT:"\u6A21\u578B\u670D\u52A1\u54CD\u5E94\u8D85\u65F6\uFF0C\u672C\u6B21\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",MODEL_TRANSPORT:"\u6682\u65F6\u65E0\u6CD5\u8FDE\u63A5\u6A21\u578B\u670D\u52A1\uFF0C\u672C\u6B21\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",MODEL_SERVICE:"\u6A21\u578B\u670D\u52A1\u6682\u65F6\u5F02\u5E38\uFF0C\u672C\u6B21\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",MODEL_STREAM:"\u6A21\u578B\u56DE\u590D\u4E2D\u65AD\u6216\u683C\u5F0F\u5F02\u5E38\uFF0C\u672C\u6B21\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u91CD\u8BD5\u3002",MODEL_EMPTY_REPLY:"\u6A21\u578B\u6CA1\u6709\u8FD4\u56DE\u53EF\u663E\u793A\u7684\u5185\u5BB9\u3002\u8BF7\u91CD\u8BD5\uFF1B\u82E5\u6301\u7EED\u53D1\u751F\uFF0C\u8BF7\u5207\u6362\u6A21\u578B\u3002",MODEL_CONTENT_REJECTED:"\u6A21\u578B\u62D2\u7EDD\u5904\u7406\u5F53\u524D\u5185\u5BB9\u3002\u8BF7\u8C03\u6574\u95EE\u9898\u5185\u5BB9\u540E\u91CD\u8BD5\u3002",MODEL_OUTPUT_LIMIT:"\u6A21\u578B\u8FBE\u5230\u8F93\u51FA\u957F\u5EA6\u4E0A\u9650\uFF0C\u4F46\u6CA1\u6709\u751F\u6210\u53EF\u663E\u793A\u7684\u7ED3\u679C\u3002\u8BF7\u7F29\u5C0F\u4EFB\u52A1\u8303\u56F4\u540E\u91CD\u8BD5\u3002",TURN_BLOCKED:"\u4EFB\u52A1\u6B63\u5728\u7B49\u5F85\u65E0\u6CD5\u5728\u5F53\u524D\u6E20\u9053\u5B8C\u6210\u7684\u64CD\u4F5C\u3002\u8BF7\u5728 DeepSeek Harness \u4E2D\u5904\u7406\u540E\u518D\u8BD5\u3002",TURN_INTERRUPTED:"\u4EFB\u52A1\u88AB\u610F\u5916\u4E2D\u65AD\uFF0C\u672C\u6B21\u672A\u5B8C\u6210\u3002\u8BF7\u91CD\u8BD5\u3002",SESSION_NOT_FOUND:"\u5F53\u524D\u4F1A\u8BDD\u5DF2\u4E0D\u5B58\u5728\u3002\u8BF7\u53D1\u9001 /new \u521B\u5EFA\u65B0\u4F1A\u8BDD\u540E\u91CD\u8BD5\u3002",SESSION_BUSY:"\u5F53\u524D\u4F1A\u8BDD\u4ECD\u5728\u5904\u7406\u4E0A\u4E00\u9879\u4EFB\u52A1\u3002\u8BF7\u7B49\u5F85\u5B8C\u6210\uFF0C\u6216\u53D1\u9001 /stop \u540E\u91CD\u8BD5\u3002",SESSION_STALE:"\u5DE5\u4F5C\u533A\u6216\u4F1A\u8BDD\u72B6\u6001\u521A\u521A\u53D1\u751F\u53D8\u5316\u3002\u8BF7\u91CD\u65B0\u53D1\u9001\u8FD9\u6761\u6D88\u606F\u3002",WORKSPACE_UNAVAILABLE:"\u5F53\u524D\u5DE5\u4F5C\u533A\u4E0D\u5B58\u5728\u6216\u6682\u4E0D\u53EF\u7528\u3002\u8BF7\u91CD\u65B0\u9009\u62E9\u5DE5\u4F5C\u533A\u540E\u91CD\u8BD5\u3002",PRESET_UNAVAILABLE:"\u5F53\u524D Agent Preset \u4E0D\u5B58\u5728\u6216\u6682\u4E0D\u53EF\u7528\u3002\u8BF7\u53D1\u9001 /presetlist \u540E\u91CD\u65B0\u9009\u62E9\u3002",CHANNEL_PERMISSION:"\u56DE\u590D\u5DF2\u7ECF\u751F\u6210\uFF0C\u4F46\u673A\u5668\u4EBA\u6CA1\u6709\u53D1\u9001\u6743\u9650\u3002\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u68C0\u67E5\u6E20\u9053\u6743\u9650\u6216\u91CD\u65B0\u7ED1\u5B9A\u673A\u5668\u4EBA\u3002",CHANNEL_RATE_LIMIT:"\u56DE\u590D\u5DF2\u7ECF\u751F\u6210\uFF0C\u4F46\u5F53\u524D\u6E20\u9053\u6B63\u5728\u9650\u6D41\uFF0C\u6682\u65F6\u65E0\u6CD5\u53D1\u9001\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",CHANNEL_DELIVERY_UNCERTAIN:"\u56DE\u590D\u53D1\u9001\u7ED3\u679C\u672A\u80FD\u786E\u8BA4\u3002\u8BF7\u5148\u68C0\u67E5\u804A\u5929\u5185\u662F\u5426\u5DF2\u7ECF\u6536\u5230\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u590D\u63D0\u4EA4\u3002",CHANNEL_DELIVERY:"\u56DE\u590D\u5DF2\u7ECF\u751F\u6210\uFF0C\u4F46\u5F53\u524D\u6E20\u9053\u6682\u65F6\u65E0\u6CD5\u53D1\u9001\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",INPUT_INVALID:"\u5F53\u524D\u6D88\u606F\u5305\u542B\u65E0\u6CD5\u5904\u7406\u7684\u56FE\u7247\u6216\u6587\u4EF6\u3002\u8BF7\u8C03\u6574\u540E\u91CD\u65B0\u53D1\u9001\u3002",INTERNAL_UNKNOWN:"\u4EFB\u52A1\u672A\u5B8C\u6210\uFF0C\u6682\u65F6\u65E0\u6CD5\u786E\u5B9A\u539F\u56E0\u3002\u8BF7\u91CD\u8BD5\uFF1B\u82E5\u6301\u7EED\u53D1\u751F\uFF0C\u8BF7\u5C06\u53C2\u8003\u53F7\u63D0\u4F9B\u7ED9\u7BA1\u7406\u5458\u3002"});function Qge(n){if(n?.code!=="harness-turn-failed")return null;let t=n?.providerCode??n?.details?.providerCode;return typeof t!="string"?null:Bge[t.trim().toUpperCase()]??null}function yge(n){let t=typeof n?.code=="string"?n.code:"",o=Qge(n);if(o)return o;if(t==="harness-connect-failed")return["session.prompt","session.history"].includes(n?.method)?"HARNESS_RESULT_UNCERTAIN":"HARNESS_CONNECT";if(t==="harness-timeout")return["session.prompt","session.history"].includes(n?.method)?"HARNESS_RESULT_UNCERTAIN":"HARNESS_TIMEOUT";if(t==="harness-reply-timeout")return"MODEL_REPLY_TIMEOUT";if(["harness-auth-required","harness-proxy-auth-required","harness-loopback-forbidden","harness-host-untrusted","harness-request-forbidden"].includes(t))return"HARNESS_ACCESS";if(["harness-api-not-found","harness-response-invalid"].includes(t))return"HARNESS_PROTOCOL";if(t==="harness-turn-failed")return"INTERNAL_UNKNOWN";if(["harness-http-failed","harness-rpc-rejected"].includes(t))return"HARNESS_SERVICE";if(t==="model-empty-response")return"MODEL_EMPTY_REPLY";if(t==="model-max-tokens")return"MODEL_OUTPUT_LIMIT";if(t==="turn-blocked")return"TURN_BLOCKED";if(["turn-interrupted","turn-aborted"].includes(t))return"TURN_INTERRUPTED";if(t==="session-not-found")return"SESSION_NOT_FOUND";if(t==="agent-busy")return"SESSION_BUSY";if(t==="workspace-session-stale")return"SESSION_STALE";if(t.startsWith("workspace-"))return"WORKSPACE_UNAVAILABLE";if(t.startsWith("agent-preset-"))return"PRESET_UNAVAILABLE";if(t.startsWith("image-")||t.startsWith("inbound-file-")||t==="attachment-error")return"INPUT_INVALID";let i=Number(n?.status??n?.httpStatus);return i===401||i===403||["channel-permission","permission-required","artifact-permission-required","forbidden","stale-token"].includes(t)?"CHANNEL_PERMISSION":i===429||["channel-rate-limit","rate-limited","artifact-rate-limited"].includes(t)?"CHANNEL_RATE_LIMIT":["channel-delivery-uncertain","delivery-uncertain","artifact-delivery-uncertain"].includes(t)?"CHANNEL_DELIVERY_UNCERTAIN":t==="channel-delivery-failed"||t.startsWith("artifact-")||["network-error","timeout"].includes(t)?"CHANNEL_DELIVERY":"INTERNAL_UNKNOWN"}function mge(n){return typeof n=="string"&&/^[A-Z0-9-]{6,40}$/u.test(n)?n:`MF-${uge().slice(0,8).toUpperCase()}`}function Sge(n){return typeof n!="string"||!/^[A-Za-z0-9_-]{1,64}$/u.test(n)?null:n.toUpperCase().replaceAll("-","_")}function Dge(n,{userMessage:t,reason:o,referenceId:i,at:e=Date.now()}={}){let a=Sge(o),A=yge(n),r=A==="INTERNAL_UNKNOWN"&&a&&typeof t=="string"&&t.trim()?"INPUT_INVALID":A;return Object.freeze({code:r,reason:a??r,message:typeof t=="string"&&t.trim()?t.trim():D(fge[r]),referenceId:mge(i),at:Number.isFinite(e)?e:Date.now()})}function dt(n){return`${n.message} ${D("\u9519\u8BEF\u7801\uFF1A{code}\uFF1B\u53C2\u8003\u53F7\uFF1A{referenceId}",n)}`}function At(n,t,o){let i=Dge(t,o);return n.lastMessageError=i,i}function oo(n){n.lastMessageError=null}function Sa(n,{uncertain:t=!0}={}){let o=new Error("Channel message delivery failed",{cause:n}),i=Number(n?.status??n?.httpStatus);return o.code=i===401||i===403?"channel-permission":i===429?"channel-rate-limit":t?"channel-delivery-uncertain":"channel-delivery-failed",Number.isInteger(i)&&(o.status=i),o}function qr(n){return!n||typeof n!="object"||typeof n.code!="string"||!n.code||typeof n.reason!="string"||!n.reason||typeof n.message!="string"||!n.message||typeof n.referenceId!="string"||!n.referenceId||!Number.isFinite(n.at)?null:{code:n.code.slice(0,64),reason:n.reason.slice(0,64),message:n.message.slice(0,500),referenceId:n.referenceId.slice(0,40),at:n.at}}var hH=new Set(["starting","pending","connecting"]),If=new Set(["connected","expired","failed","cancelled"]);function zr(n){return typeof n=="string"&&n.trim()?n.trim():null}function Da(n,t){return Object.freeze({code:n,message:t})}function uH(n){return typeof n?.now=="function"?n.now():n()}function Oge(n){return new Date(uH(n)).toISOString()}function Ng(){return new DOMException("DingTalk provisioning was cancelled","AbortError")}function qc(n){return n?{attemptId:n.id,status:n.state,...n.verificationUrl?{verificationUrl:n.verificationUrl}:{},...n.expiresAt?{expiresAt:n.expiresAt}:{},...n.pollIntervalMs?{pollIntervalMs:n.pollIntervalMs}:{},...n.botId?{botId:n.botId}:{},...n.alreadyConnected?{alreadyConnected:!0}:{},...n.error?{error:structuredClone(n.error)}:{}}:null}function wb(n){if(!n)return{};let t=typeof n.status=="function"?n.status():n.status;return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}function EH(n,t){if(!n||t.connected===!1||t.ready===!1)return!1;let o=zr(t.dingtalkStreamState??t.dingtalkConnectionState??t.connectionState??t.state)?.toLowerCase();return["failed","error","offline","disconnected","stopped"].includes(o)?!1:t.connected===!0||t.ready===!0||o==="connected"||o==="ready"}function BH(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let t=zr(n.staffId??n.senderStaffId??n.senderId);if(!t)return null;let o=zr(n.requestId),i=o&&/^ding_sender_[A-Za-z0-9_-]{1,100}$/.test(o)&&!o.includes(t)?o:null;return i?{requestId:i,staffId:t,displayName:zr(n.displayName??n.senderName??n.senderNick)??D("\u9489\u9489\u7528\u6237"),requestedAt:zr(n.requestedAt)}:null}function CH(n){if(!Array.isArray(n.pendingSenders))return[];let t=new Set,o=[];for(let i of n.pendingSenders){let e=BH(i);!e||t.has(e.staffId)||(t.add(e.staffId),o.push(e))}return o}function bge(n){return{requestId:n.requestId,displayName:n.displayName,senderIdMasked:mb(n.staffId),requestedAt:n.requestedAt}}function Mge(n){return{senderKey:n.senderKey,displayName:zr(n.displayName)??D("\u9489\u9489\u7528\u6237"),senderIdMasked:mb(n.staffId),approvedAt:zr(n.approvedAt)}}var xh=class{#e;#A;#t;#r;#a;#i;#c;#s=new Map;#I=new Map;#o=new Map;#n=null;#g=new Map;#l=0;#p=!1;constructor({deviceAuth:t,credentials:o,configStore:i,createRuntime:e,deleteState:a=async()=>{},logger:A=console,clock:r=Date}){if(!t||typeof t.start!="function"||typeof t.poll!="function")throw new TypeError("DingtalkController requires a DingTalk device auth client");if(!o||typeof o.resolve!="function"||typeof o.set!="function"||typeof o.unset!="function")throw new TypeError("DingtalkController requires the DSH credential provider");if(!i||typeof i.list!="function"||typeof i.get!="function"||typeof i.getByClientId!="function"||typeof i.save!="function"||typeof i.remove!="function")throw new TypeError("DingtalkController requires a loaded config store");if(typeof e!="function")throw new TypeError("createRuntime is required");if(typeof a!="function")throw new TypeError("deleteState must be a function");if(typeof r!="function"&&typeof r?.now!="function")throw new TypeError("clock must be a function or expose now()");this.#e=t,this.#A=o,this.#t=i,this.#r=e,this.#a=a,this.#i=A,this.#c=r}async initialize(){if(this.#p)return this.status();for(let t of this.#t.list()){let o=this.#s.get(t.botId);try{if(EH(o,wb(o)))continue}catch{}await this.#Q(t.botId,async()=>{let i=this.#t.get(t.botId);if(!i||this.#p)return;let e=await this.#f(i.secretRef);if(!e){this.#I.set(i.botId,Da("missing-secret",D("\u9489\u9489\u673A\u5668\u4EBA\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u626B\u7801\u3002"))),this.#b();return}try{await this.#u(i,e),this.#I.delete(i.botId)}catch{this.#I.set(i.botId,Da("connection-failed",D("\u9489\u9489\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"))),this.#i.warn?.(`[dsh-dingtalk] bot ${i.botId} failed to initialize`)}this.#b()})}return this.status()}async startProvisioning({signal:t}={}){if(this.#p)throw new Error("dsh-dingtalk controller is closed");this.#n&&await this.cancelProvisioning(this.#n);let o={id:wge(),state:"starting",controller:new AbortController,deviceCode:null,verificationUrl:null,expiresAt:null,pollIntervalMs:null,pollTask:null,botId:null,alreadyConnected:!1,error:null};this.#o.set(o.id,o),this.#n=o.id,this.#b();let i=()=>o.controller.abort(t?.reason);t?.aborted?i():t?.addEventListener("abort",i,{once:!0});try{let e=await this.#e.start({signal:o.controller.signal});if(this.#y(o),o.deviceCode=zr(e.deviceCode),o.verificationUrl=zr(e.verificationUrl),o.expiresAt=Number(e.expiresAt),o.pollIntervalMs=Number(e.pollIntervalMs),!o.deviceCode||!o.verificationUrl||!Number.isFinite(o.expiresAt)||!Number.isFinite(o.pollIntervalMs)||o.pollIntervalMs<=0)throw new Error("DingTalk device auth returned incomplete registration metadata");return o.state="pending",this.#b(),qc(o)}catch(e){if(o.controller.signal.aborted||e?.name==="AbortError"?(o.state="cancelled",o.error=Da("cancelled",D("\u626B\u7801\u63A5\u5165\u5DF2\u53D6\u6D88\u3002"))):(o.state="failed",o.error=Da("qr-start-failed",D("\u65E0\u6CD5\u751F\u6210\u9489\u9489\u4E8C\u7EF4\u7801\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"))),this.#n===o.id&&(this.#n=null),this.#b(),o.state==="failed")throw e;return qc(o)}finally{t?.removeEventListener("abort",i)}}async bindCredentials({clientId:t,clientSecret:o}={}){if(this.#p)throw new Error("dsh-dingtalk controller is closed");let i=zr(t),e=zr(o);if(!i||!e)throw new TypeError("DingTalk Client ID and Client Secret are required");if(this.#n&&await this.cancelProvisioning(this.#n),this.#p)throw new Error("dsh-dingtalk controller is closed");let a=gf(i);return await this.#Q(a.botId,async()=>{if(this.#p)throw Ng();let A=this.#t.getByClientId(i),r=await this.#A.resolve(a.secretRef).catch(()=>{});if(this.#p)throw Ng();let s={botId:a.botId,clientId:i,secretRef:a.secretRef,approvedSenders:A?.approvedSenders??[]};await this.#A.set(a.secretRef,e);try{await this.#t.save(s)}catch(g){throw await this.#m(a.secretRef,r),g}try{await this.#u(s,e),this.#I.delete(a.botId)}catch{this.#I.set(a.botId,Da("connection-failed",D("\u9489\u9489\u5DF2\u63A5\u5165\uFF0C\u4F46\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"))),this.#i.warn?.("[dsh-dingtalk] credential-bound bot saved but its connection is not ready")}this.#b()}),this.status()}async registrationStatus(t){let o=this.#o.get(t);if(!o)return null;if(If.has(o.state)||o.state==="starting")return qc(o);if(uH(this.#c)>=o.expiresAt)return o.state="expired",o.error=Da("expired",D("\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u3002")),this.#n===o.id&&(this.#n=null),this.#b(),qc(o);if(!o.pollTask){let i=this.#d(o).finally(()=>{o.pollTask===i&&(o.pollTask=null)});o.pollTask=i}return await o.pollTask,qc(o)}async cancelProvisioning(t){let o=this.#o.get(t);return o?(If.has(o.state)||(o.controller.abort(),await o.pollTask?.catch(()=>{}),If.has(o.state)||(o.state="cancelled"),o.error??=Da("cancelled",D("\u626B\u7801\u63A5\u5165\u5DF2\u53D6\u6D88\u3002"))),this.#n===o.id&&(this.#n=null),this.#b(),qc(o)):null}async reconnectBot(t){let o=this.#t.get(t);if(!o)throw new Error("Unknown DingTalk bot");return await this.#Q(t,async()=>{let i=await this.#f(o.secretRef);if(!i)throw new Error("The DingTalk client secret is missing");try{await this.#u(o,i),this.#I.delete(t)}catch(e){throw this.#I.set(t,Da("connection-failed",D("\u9489\u9489\u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"))),e}finally{this.#b()}}),this.status()}async sendConnectionTest(t){let o=this.#t.get(t);if(!o)throw new Error("Unknown DingTalk bot");return this.#Q(t,async()=>{let i=this.#s.get(t);if(!i?.status?.ready||typeof i.sendConnectionTest!="function")throw Ir(D("\u9489\u9489\u673A\u5668\u4EBA"));return i.sendConnectionTest(ma(D("\u9489\u9489\u673A\u5668\u4EBA\uFF08{clientId}\uFF09",{clientId:Sb(o.clientId)})))})}async deleteBot(t){let o=this.#t.get(t);if(!o)throw new Error("Unknown DingTalk bot");return await this.#Q(t,async()=>{let i=await this.#A.resolve(o.secretRef).catch(()=>{});await this.#B(t);try{await this.#A.unset(o.secretRef),await this.#t.remove(t)}catch(e){throw zr(i?.value)&&(await this.#A.set(o.secretRef,i.value).catch(()=>{}),await this.#u(o,i.value).catch(()=>{})),new Error("Unable to remove the DingTalk bot safely.",{cause:e})}try{await this.#a({botId:t,config:o})}catch{this.#i.warn?.(`[dsh-dingtalk] bot ${t} state cleanup failed`)}this.#I.delete(t),this.#b()}),this.status()}async approveSender(t,o){let i=this.#t.get(t);if(!i)throw new Error("Unknown DingTalk bot");let e=this.#s.get(t),a=typeof e?.pendingSender=="function"?BH(e.pendingSender(o)):null,A=CH(wb(e)),r=a?.requestId===o?a:A.find(g=>g.requestId===o);if(!r)throw new Error("Unknown DingTalk sender approval request");if(i.approvedSenders.some(g=>g.staffId===r.staffId))return this.status();let s={...i,approvedSenders:[...i.approvedSenders,{senderKey:gH(),staffId:r.staffId,displayName:r.displayName,approvedAt:Oge(this.#c)}]};return await this.#E(i,s),this.status()}async revokeSender(t,o){let i=this.#t.get(t);if(!i)throw new Error("Unknown DingTalk bot");let e=i.approvedSenders.findIndex(A=>A.senderKey===o);if(e===-1)throw new Error("Unknown approved DingTalk sender");let a=[...i.approvedSenders];return a.splice(e,1),await this.#E(i,{...i,approvedSenders:a}),this.status()}status(){let t=this.#t.list().map(e=>{let a=this.#s.get(e.botId),A={};try{A=wb(a)}catch{A={state:"error"}}let r=EH(a,A),s=this.#I.get(e.botId),g=r?"connected":s?"error":"offline",c=new Set(e.approvedSenders.map(d=>d.staffId)),I=CH(A).filter(d=>!c.has(d.staffId)).map(bge);return{botId:e.botId,state:g,connected:r,configured:!0,bot:{name:D("\u9489\u9489\u673A\u5668\u4EBA"),clientIdMasked:Sb(e.clientId)},health:{status:r?"healthy":s?"error":"offline",summary:r?D("\u9489\u9489 Stream \u6D88\u606F\u8FDE\u63A5\u8FD0\u884C\u6B63\u5E38"):s?.message??D("\u9489\u9489\u6D88\u606F\u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF"),lastCheckedAt:A.lastCheckedAt??null},stats:{messagesReceived:Number(A.messagesReceived)||0,messagesReplied:Number(A.messagesReplied)||0},lastMessageError:qr(A.lastMessageError),senders:{pending:I,approved:e.approvedSenders.map(Mge)},error:s?structuredClone(s):null}}),o=t.filter(e=>e.connected).length,i=this.#n?this.#o.get(this.#n):null;return{schemaVersion:1,revision:this.#l,state:i&&hH.has(i.state)?"provisioning":t.length===0?"disconnected":o===t.length?"connected":o>0?"degraded":"offline",bots:t,totals:{configured:t.length,connected:o},...i&&hH.has(i.state)?{provisioning:qc(i)}:{}}}async close(){this.#p||(this.#p=!0,this.#n&&await this.cancelProvisioning(this.#n),await Promise.allSettled([...this.#s.keys()].map(t=>this.#B(t))),await Promise.allSettled([...this.#g.values()]),await Promise.allSettled([...this.#s.keys()].map(t=>this.#B(t))))}async#d(t){try{this.#y(t);let o=await this.#e.poll({deviceCode:t.deviceCode,signal:t.controller.signal});this.#y(t);let i=zr(o.status)?.toUpperCase();if(i==="WAITING")t.state="pending",t.error=null;else if(i==="SUCCESS"){let e=zr(o.clientId),a=zr(o.clientSecret);if(!e||!a)throw new Error("DingTalk returned incomplete credentials");t.state="connecting",t.error=null,this.#b();let A=await this.#h(t,{clientId:e,clientSecret:a});t.botId=A.botId,t.alreadyConnected=A.alreadyConnected,t.state="connected",this.#n===t.id&&(this.#n=null)}else i==="EXPIRED"?(t.state="expired",t.error=Da("expired",D("\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u3002")),this.#n===t.id&&(this.#n=null)):i==="FAIL"?(t.state="failed",t.error=Da("authorization-failed",D("\u9489\u9489\u672A\u5B8C\u6210\u673A\u5668\u4EBA\u6388\u6743\uFF0C\u8BF7\u91CD\u65B0\u626B\u7801\u3002")),this.#n===t.id&&(this.#n=null)):(t.state="pending",t.error=Da("poll-pending",D("\u9489\u9489\u6388\u6743\u72B6\u6001\u6682\u65F6\u4E0D\u53EF\u7528\uFF0C\u6B63\u5728\u91CD\u8BD5\u3002")))}catch(o){t.controller.signal.aborted||o?.name==="AbortError"?(t.state="cancelled",t.error=Da("cancelled",D("\u626B\u7801\u63A5\u5165\u5DF2\u53D6\u6D88\u3002")),this.#n===t.id&&(this.#n=null)):t.state==="connecting"?(t.state="failed",t.error=Da("activation-failed",D("\u9489\u9489\u5DF2\u6388\u6743\uFF0C\u4F46\u65E0\u6CD5\u5B89\u5168\u4FDD\u5B58\u63A5\u5165\u914D\u7F6E\u3002")),this.#n===t.id&&(this.#n=null),this.#i.error?.("[dsh-dingtalk] bot activation failed")):(t.state="pending",t.error=Da("poll-failed",D("\u9489\u9489\u6388\u6743\u67E5\u8BE2\u6682\u65F6\u5931\u8D25\uFF0C\u6B63\u5728\u91CD\u8BD5\u3002")))}finally{this.#b(),this.#C()}}async#h(t,{clientId:o,clientSecret:i}){let e=gf(o),a=this.#t.getByClientId(o),A=await this.#A.resolve(e.secretRef).catch(()=>{}),r={botId:e.botId,clientId:o,secretRef:e.secretRef,approvedSenders:a?.approvedSenders??[]};return this.#Q(e.botId,async()=>{let s=async()=>{await this.#B(e.botId),a?await this.#t.save(a).catch(()=>{}):this.#t.get(e.botId)&&await this.#t.remove(e.botId).catch(()=>null)&&await this.#a({botId:e.botId,config:r}).catch(c=>{this.#i.warn?.("[dsh-dingtalk] failed to clean up cancelled bot state:",c)}),await this.#m(e.secretRef,A),a&&zr(A?.value)&&await this.#u(a,A.value).catch(()=>{})};await this.#A.set(e.secretRef,i);try{this.#y(t),await this.#t.save(r),this.#y(t)}catch(g){throw await s(),g}try{await this.#u(r,i),this.#y(t),this.#I.delete(e.botId)}catch{if(t.controller.signal.aborted||this.#n!==t.id)throw await s(),Ng();this.#I.set(e.botId,Da("connection-failed",D("\u9489\u9489\u5DF2\u63A5\u5165\uFF0C\u4F46\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"))),this.#i.warn?.("[dsh-dingtalk] authorized bot saved but its connection is not ready")}return{botId:e.botId,alreadyConnected:!!a}})}async#E(t,o){return this.#Q(t.botId,async()=>{let i=await this.#f(t.secretRef);if(!i)throw new Error("The DingTalk client secret is missing");await this.#t.save(o);try{await this.#u(o,i),this.#I.delete(t.botId)}catch(e){throw await this.#t.save(t).catch(()=>{}),await this.#u(t,i).catch(()=>{}),this.#I.set(t.botId,Da("connection-failed",D("\u9489\u9489\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"))),e}finally{this.#b()}})}async#u(t,o){if(this.#p||(await this.#B(t.botId),this.#p))throw Ng();let i=await this.#r({botId:t.botId,config:structuredClone(t),clientSecret:o});if(!i||typeof i.start!="function"||typeof i.stop!="function")throw new TypeError("createRuntime returned an invalid DingTalk runtime");if(this.#p)throw await i.stop().catch(()=>{}),Ng();this.#s.set(t.botId,i);try{if(await i.start(),this.#p)throw await i.stop().catch(()=>{}),Ng()}catch(e){throw this.#s.get(t.botId)===i&&this.#s.delete(t.botId),await i.stop().catch(()=>{}),e}}async#B(t){let o=this.#s.get(t);this.#s.delete(t),await o?.stop().catch(()=>{this.#i.warn?.(`[dsh-dingtalk] bot ${t} failed to stop cleanly`)})}async#f(t){let o=await this.#A.resolve(t).catch(()=>{});return zr(o?.value)}async#m(t,o){try{zr(o?.value)?await this.#A.set(t,o.value):await this.#A.unset(t)}catch{this.#i.error?.(`[dsh-dingtalk] failed to restore credential ${t}`)}}#y(t){if(t.controller.signal.aborted||this.#n!==t.id)throw Ng()}#Q(t,o){if(this.#p)return Promise.reject(new Error("dsh-dingtalk controller is closed"));let a=(this.#g.get(t)??Promise.resolve()).catch(()=>{}).then(o).finally(()=>{this.#g.get(t)===a&&this.#g.delete(t)});return this.#g.set(t,a),a}#C(){for(let[t,o]of this.#o)t!==this.#n&&If.has(o.state)&&this.#o.size>16&&this.#o.delete(t)}#b(){this.#l+=1}};import{randomUUID as Yh}from"node:crypto";import{extname as Gge}from"node:path";var yH=5*1024*1024,_ge=20,Tge=20*1024*1024,Nge="\u8BF7\u5206\u6790\u8FD9\u5F20\u56FE\u7247\u3002",ut=class extends Error{constructor(t,o,i,e={}){super(o,e),this.name="ImagePromptError",this.code=t,this.userMessage=i}},fH=Object.freeze({MODEL_DOES_NOT_SUPPORT_IMAGES:"\u5F53\u524D\u6A21\u578B\u4E0D\u652F\u6301\u56FE\u7247\uFF0C\u8BF7\u7528 /models \u67E5\u770B\u53EF\u7528\u6A21\u578B\uFF0C\u518D\u7528 /model <\u5E8F\u53F7> \u5207\u6362\u540E\u91CD\u53D1\u3002",IMAGE_TOO_LARGE:"\u56FE\u7247\u8D85\u8FC7\u5BBF\u4E3B\u5141\u8BB8\u7684\u5927\u5C0F\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002",IMAGE_TOO_MANY_PIXELS:"\u56FE\u7247\u5206\u8FA8\u7387\u8FC7\u9AD8\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002",INVALID_IMAGE:"\u56FE\u7247\u5185\u5BB9\u65E0\u6548\u6216\u683C\u5F0F\u4E0D\u53D7\u652F\u6301\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002",INVALID_IMAGE_BASE64:"\u672A\u80FD\u8BFB\u53D6\u56FE\u7247\u5185\u5BB9\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002",IMAGE_TYPE_MISMATCH:"\u56FE\u7247\u683C\u5F0F\u4E0E\u5B9E\u9645\u5185\u5BB9\u4E0D\u4E00\u81F4\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002",TOO_MANY_IMAGES:"\u4E00\u6B21\u53D1\u9001\u7684\u56FE\u7247\u6570\u91CF\u8D85\u8FC7\u5BBF\u4E3B\u9650\u5236\uFF0C\u8BF7\u51CF\u5C11\u540E\u91CD\u8BD5\u3002",IMAGES_TOO_LARGE:"\u56FE\u7247\u603B\u5927\u5C0F\u8D85\u8FC7\u5BBF\u4E3B\u9650\u5236\uFF0C\u8BF7\u51CF\u5C11\u56FE\u7247\u6216\u538B\u7F29\u540E\u91CD\u8BD5\u3002"});function Rge(n,t){let o=AbortSignal.timeout(t);return n?AbortSignal.any([n,o]):o}async function Ob(n){try{await n?.body?.cancel?.()}catch{}}async function no(n,{fetchImpl:t=fetch,headers:o,signal:i,maxBytes:e=yH,timeoutMs:a=15e3,allowedHosts:A}={}){let r=new URL(n);if(r.protocol!=="https:")throw new Error("Image download URL must use HTTPS");if(Array.isArray(A)&&!A.some(I=>typeof I=="string"&&(r.hostname===I||I.startsWith(".")&&(r.hostname===I.slice(1)||r.hostname.endsWith(I)))))throw new Error("Image download URL is not hosted by the messaging platform");let s=await t(r,{method:"GET",headers:o,signal:Rge(i,a),redirect:"manual"});if(Number.isInteger(s?.status)&&s.status>=300&&s.status<400)throw await Ob(s),new ut("image-redirect-blocked",`Image download redirect was blocked (HTTP ${s.status})`,D("\u56FE\u7247\u4E0B\u8F7D\u5730\u5740\u53D1\u751F\u4E86\u91CD\u5B9A\u5411\uFF0C\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6\u3002"));if(!s?.ok)throw await Ob(s),new ut("image-http-error",`Image download failed with HTTP ${s?.status??"unknown"}`,D("\u56FE\u7247\u4E0B\u8F7D\u5931\u8D25\uFF08HTTP {status}\uFF09\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u540E\u518D\u8BD5\u3002",{status:s?.status??"unknown"}));let g=Number(s.headers?.get?.("content-length"));if(Number.isFinite(g)&&g>e)throw await Ob(s),new ut("image-too-large",`Image response declares ${g} bytes; the limit is ${e}`,D("\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));if(s.body?.[Symbol.asyncIterator]){let I=[],d=0;for await(let B of s.body){let f=Buffer.from(B);if(d+=f.length,d>e)throw await s.body.cancel?.().catch?.(()=>{}),new ut("image-too-large",`Image response exceeded ${e} bytes`,D("\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));I.push(f)}return Buffer.concat(I,d)}let c=Buffer.from(await s.arrayBuffer());if(c.length>e)throw new ut("image-too-large",`Image response contains ${c.length} bytes; the limit is ${e}`,D("\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));return c}function kge(n){return typeof n=="string"?n.trim():""}function mH(n){return Array.isArray(n?.images)?n.images.filter(Boolean):[]}function QH(n){return typeof n!="string"?void 0:n.replaceAll("\\","/").split("/").at(-1)?.replace(/[\u0000-\u001f\u007f]/g,"").trim().slice(0,255)||void 0}function vge(n){if(n.length>=8&&n[0]===137&&n[1]===80&&n[2]===78&&n[3]===71&&n[4]===13&&n[5]===10&&n[6]===26&&n[7]===10)return"image/png";if(n.length>=3&&n[0]===255&&n[1]===216&&n[2]===255)return"image/jpeg";if(n.length>=6){let t=n.subarray(0,6).toString("ascii");if(t==="GIF87a"||t==="GIF89a")return"image/gif"}return n.length>=12&&n.subarray(0,4).toString("ascii")==="RIFF"&&n.subarray(8,12).toString("ascii")==="WEBP"?"image/webp":null}function Pge(n){if(Buffer.isBuffer(n)||n instanceof Uint8Array)return{data:Buffer.from(n)};let t=n?.data??n?.buffer;return Buffer.isBuffer(t)||t instanceof Uint8Array?{data:Buffer.from(t),name:n?.name??n?.filename}:null}function qt(n){return mH(n).length>0}async function so(n,{signal:t,maxImageBytes:o=yH,maxImages:i=_ge,maxTotalImageBytes:e=Tge}={}){let a=mH(n);if(a.length>i)throw new ut("too-many-images",`Image message contains ${a.length} images; the limit is ${i}`,D("\u4E00\u6B21\u6700\u591A\u53EA\u80FD\u5904\u7406 {maxImages} \u5F20\u56FE\u7247\u3002",{maxImages:i}));let A=kge(n?.content),r=[],s=0;A?r.push({type:"text",text:A}):a.length>0&&r.push({type:"text",text:D(Nge)});for(let[g,c]of a.entries()){if(t?.throwIfAborted(),Number.isFinite(c?.size)&&c.size>o)throw new ut("image-too-large",`Image ${g+1} declares ${c.size} bytes; the limit is ${o}`,D("\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));if(Number.isFinite(c?.size)&&s+c.size>e)throw new ut("images-too-large",`Images declare more than ${e} bytes in total`,D("\u4E00\u6B21\u53D1\u9001\u7684\u56FE\u7247\u603B\u5927\u5C0F\u8FC7\u5927\uFF0C\u8BF7\u51CF\u5C11\u56FE\u7247\u6570\u91CF\u6216\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));let I;try{I=c?.data===void 0?await c?.load?.({signal:t,maxBytes:o}):c.data}catch(f){throw t?.aborted||f?.name==="AbortError"||f?.name==="TimeoutError"||f instanceof ut?f:new ut("image-download-failed",`Unable to download image ${g+1}: ${f?.message??String(f)}`,D("\u56FE\u7247\u4E0B\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u540E\u518D\u8BD5\u3002"),{cause:f})}let d=Pge(I);if(!d?.data.length)throw new ut("invalid-image-data",`Image ${g+1} returned no data`,D("\u672A\u80FD\u8BFB\u53D6\u56FE\u7247\u5185\u5BB9\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002"));if(d.data.length>o)throw new ut("image-too-large",`Image ${g+1} contains ${d.data.length} bytes; the limit is ${o}`,D("\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));if(s+d.data.length>e)throw new ut("images-too-large",`Images contain more than ${e} bytes in total`,D("\u4E00\u6B21\u53D1\u9001\u7684\u56FE\u7247\u603B\u5927\u5C0F\u8FC7\u5927\uFF0C\u8BF7\u51CF\u5C11\u56FE\u7247\u6570\u91CF\u6216\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));s+=d.data.length;let B=vge(d.data);if(!B)throw new ut("unsupported-image-type",`Image ${g+1} is not JPEG, PNG, GIF, or WebP`,D("\u6682\u4E0D\u652F\u6301\u8BE5\u56FE\u7247\u683C\u5F0F\uFF0C\u8BF7\u53D1\u9001 JPEG\u3001PNG\u3001WebP \u6216 GIF \u56FE\u7247\u3002"));r.push({type:"image",mediaType:B,data:d.data.toString("base64"),...QH(d.name??c?.name)?{name:QH(d.name??c?.name)}:{}})}return r}function vi(n){if(n instanceof ut)return{code:"image-prompt-error",reason:n.code,userMessage:n.userMessage};if(n?.code!=="attachment-error"||typeof n?.details?.reason!="string")return null;let t=n.details.reason,o=Object.hasOwn(fH,t)?D(fH[t]):null;return o?{code:"attachment-error",reason:t,userMessage:o}:null}function go(n){return vi(n)?.userMessage??null}var SH="https://oapi.dingtalk.com/",Fge="https://api.dingtalk.com/",Lge="DING_DWS_CLAW",Uge="02fcf2f4-5e02-4a85-b672-46d1f715543e.schema",zc="\u{1F914}\u601D\u8003\u4E2D",wH="\u2705\u5DF2\u5B8C\u6210",OH="\u274C\u5904\u7406\u5931\u8D25",Hge=15e3,Kge=5e3,xge="2659900",Yge="im_bg_1",jge=new Set(["WAITING","SUCCESS","FAIL","EXPIRED"]),gt=class extends Error{constructor(t,o,i={}){super(o,i),this.name="DingtalkApiError",this.code=t,this.status=i.status,this.providerCode=i.providerCode}};function WA(n){return typeof n=="string"&&n.trim()?n.trim():null}function qh(n){let t=n==null?null:String(n).trim();return t&&/^-?[A-Za-z0-9_.:-]{1,160}$/.test(t)?t:void 0}function bH(n,t){return Number.isInteger(t?.status)&&(n.status=t.status),t?.providerCode!==void 0&&(n.providerCode=t.providerCode),n}function jh(n,{fallback:t="artifact-provider-rejected"}={}){if(n?.code?.startsWith?.("artifact-"))return n;let o=Number(n?.status),i=qh(n?.providerCode),e=i??"",a=t,A="DingTalk could not prepare the file for delivery.";o===401||o===403||i==="401"||i==="403"||/(?:permission|forbidden|unauthor|access.?denied|\.auth(?:\.|$))/i.test(e)?(a="artifact-permission-required",A="DingTalk denied permission to send the file."):o===413||i==="413"||/(?:too.?large|size.?limit)/i.test(e)?(a="artifact-too-large",A="The file exceeds DingTalk's size limit."):o===429||i==="429"||/(?:rate.?limit|too.?many|throttl)/i.test(e)?(a="artifact-rate-limited",A="DingTalk rate-limited file delivery."):t==="artifact-provider-rejected"&&(A="DingTalk rejected the file message.");let r=new Error(A,{cause:n});return r.code=a,bH(r,n)}function Jge(n){let t=new Error("DingTalk file delivery result is uncertain",{cause:n});return t.code="artifact-delivery-uncertain",bH(t,n)}function bb(n){if(!n||typeof n!="object")return null;for(let t of["errcode","code"])if(n[t]!==void 0&&n[t]!==0&&n[t]!=="0")return qh(n[t])??"rejected";return null}function qge(n,t){if(t?.aborted)throw Mn(t);let o=Number(n?.status);return n?.code==="network-error"||n?.code==="timeout"||n?.code==="invalid-response"||o>=500&&o<600?Jge(n):jh(n)}function zge(n){let t;try{t=new URL(n)}catch(o){throw new gt("invalid-image-download","\u9489\u9489\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6548\u7684\u56FE\u7247\u4E0B\u8F7D\u5730\u5740\u3002",{cause:o})}return t.protocol==="http:"&&(!t.port||t.port==="80")&&(t.protocol="https:",t.port=""),t}function DH(n){let t=n.toLowerCase().replace(/\.$/,"");return t==="dingtalk.com"||t.endsWith(".dingtalk.com")}function Nb(n,{label:t,requireSubdomain:o=!0}={}){let i;try{i=new URL(n)}catch{throw new gt("invalid-url",`${t??"\u9489\u9489\u670D\u52A1"}\u8FD4\u56DE\u4E86\u65E0\u6548\u5730\u5740\u3002`)}let e=i.hostname.toLowerCase().replace(/\.$/,""),a=o?e!=="dingtalk.com"&&DH(e):DH(e);if(i.protocol!=="https:"||!a||i.port&&i.port!=="443")throw new gt("untrusted-url",`${t??"\u9489\u9489\u670D\u52A1"}\u5730\u5740\u4E0D\u53D7\u4FE1\u4EFB\u3002`);if(i.username||i.password)throw new gt("untrusted-url",`${t??"\u9489\u9489\u670D\u52A1"}\u5730\u5740\u4E0D\u53D7\u4FE1\u4EFB\u3002`);return i}function Rg(n){let t=WA(n);if(!t)throw new gt("invalid-session-webhook","\u9489\u9489\u6D88\u606F\u6CA1\u6709\u53EF\u7528\u7684\u56DE\u590D\u5730\u5740\u3002");let o=Nb(t,{label:"\u9489\u9489\u56DE\u590D",requireSubdomain:!1});return o.hash="",o.toString()}function MH(n,t=4e3){let o=typeof n=="string"?n.trim():"";if(!o)return[];if(!Number.isInteger(t)||t<1)throw new TypeError("maxChars must be a positive integer");if(o.length<=t)return[o];let i=[],e=o;for(;e.length>t;){let a=e.lastIndexOf(` `,t);a{if(t?.aborted){i(Mn(t));return}let e=setTimeout(()=>{t?.removeEventListener("abort",a),o()},n),a=()=>{clearTimeout(e),i(Mn(t))};t?.addEventListener("abort",a,{once:!0})})}async function bn(n,t,{body:o,signal:i,timeoutMs:e=Hge,headers:a={},method:A="POST",action:r="request"}={}){let s=new AbortController,g=!1,c=()=>s.abort(i?.reason);if(i?.aborted)throw Mn(i);i?.addEventListener("abort",c,{once:!0});let I=e>0?setTimeout(()=>{g=!0,s.abort()},e):null;try{let d=await n(t,{method:A,redirect:"error",headers:{"content-type":"application/json",...a},body:JSON.stringify(o??{}),signal:s.signal});if(!d.ok){let B;try{let f=await d.json();B=qh(f?.code??f?.errcode)}catch{}throw new gt("http-error",`\u9489\u9489\u670D\u52A1\u8BF7\u6C42\u5931\u8D25\uFF08HTTP ${d.status}\uFF09\u3002`,{status:d.status,providerCode:B})}try{return await d.json()}catch(B){throw new gt("invalid-response","\u9489\u9489\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6CD5\u89E3\u6790\u7684\u54CD\u5E94\u3002",{cause:B})}}catch(d){throw i?.aborted?Mn(i):g?new gt("timeout","\u9489\u9489\u670D\u52A1\u8BF7\u6C42\u8D85\u65F6\u3002",{cause:d}):d instanceof gt?d:new gt("network-error",`\u6682\u65F6\u65E0\u6CD5\u5B8C\u6210\u9489\u9489${r}\u8BF7\u6C42\u3002`,{cause:d})}finally{I&&clearTimeout(I),i?.removeEventListener("abort",c)}}async function Wge(n,t,{body:o,signal:i,timeoutMs:e=6e4}={}){let a=new AbortController,A=!1,r=()=>a.abort(i?.reason);if(i?.aborted)throw Mn(i);i?.addEventListener("abort",r,{once:!0});let s=setTimeout(()=>{A=!0,a.abort()},e);try{let g=await n(t,{method:"POST",body:o,signal:a.signal,redirect:"error"}),c,I;try{c=await g.json()}catch(d){I=d}if(!g.ok)throw new gt("http-error",`\u9489\u9489\u670D\u52A1\u8BF7\u6C42\u5931\u8D25\uFF08HTTP ${g.status}\uFF09\u3002`,{status:g.status,providerCode:qh(c?.code??c?.errcode)});if(I)throw new gt("invalid-response","\u9489\u9489\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6CD5\u89E3\u6790\u7684\u54CD\u5E94\u3002",{cause:I});return c}catch(g){throw i?.aborted?Mn(i):A?new gt("timeout","\u9489\u9489\u670D\u52A1\u8BF7\u6C42\u8D85\u65F6\u3002",{cause:g}):g instanceof gt?g:new gt("network-error","\u6682\u65F6\u65E0\u6CD5\u5B8C\u6210\u9489\u9489\u6587\u4EF6\u4E0A\u4F20\u8BF7\u6C42\u3002",{cause:g})}finally{clearTimeout(s),i?.removeEventListener("abort",r)}}function Zge(n){let t=WA(n?.robotCode);if(!t)throw new TypeError("DingTalk robotCode is required");if(n?.type==="group"){let o=WA(n.openConversationId);if(o)return{type:"group",robotCode:t,openConversationId:o}}if(n?.type==="user"){let o=WA(n.userId);if(o)return{type:"user",robotCode:t,userId:o}}throw new TypeError("DingTalk file target is invalid")}function Xge(n){return Gge(n).slice(1).toLowerCase()}function $ge(n){if(n?.type==="user"){let t=WA(n.userId);if(t)return{type:"user",userId:t}}if(n?.type==="group"){let t=WA(n.openConversationId);if(t)return{type:"group",openConversationId:t}}throw new TypeError("DingTalk AI Card target is invalid")}function Mb(n,t){return{cardParamMap:{flowStatus:t,msgContent:Jh(n),staticMsgContent:"",sys_full_json_obj:JSON.stringify({order:["msgContent"]}),config:JSON.stringify({autoLayout:!0})}}}function ece(n,t,o){let i={outTrackId:n,userIdType:1};return t.type==="group"?{...i,openSpaceId:`dtv1.card//IM_GROUP.${t.openConversationId}`,imGroupOpenDeliverModel:{robotCode:o}}:{...i,openSpaceId:`dtv1.card//IM_ROBOT.${t.userId}`,imRobotOpenDeliverModel:{spaceType:"IM_ROBOT",robotCode:o,extension:{dynamicSummary:"true"}}}}function Jh(n){let o=(typeof n=="string"?n.replace(/\r\n?/g,` @@ -143,7 +143,7 @@ ${D("\u9519\u8BEF\u7801\uFF1A{code}\uFF1B\u53C2\u8003\u53F7\uFF1A{referenceId}", `:/^\s{0,3}(?:[-*+] |\d+[.)] |#{1,6} |\||> )/.test(o[a+1])?`${e} `:`${e}
`}).join("")}function _b(n,t){if(!n||typeof n!="object"||n.errcode!==0)throw new gt("registration-rejected",`\u9489\u9489\u626B\u7801${t}\u5931\u8D25\u3002`);return n}function Tb(n,t){let o=Number(n);return Number.isFinite(o)&&o>0?o:t}function _H({fetchImpl:n=fetch,registrationBaseUrl:t=process.env.DINGTALK_REGISTRATION_BASE_URL||SH,registrationSource:o=process.env.DINGTALK_REGISTRATION_SOURCE||Lge,now:i=()=>Date.now(),cardMinIntervalMs:e=50,cardBackoffMs:a=1e3,delay:A=Vge}={}){if(typeof n!="function")throw new TypeError("fetchImpl must be a function");if(typeof i!="function")throw new TypeError("now must be a function");if(!Number.isFinite(e)||e<0)throw new TypeError("cardMinIntervalMs must be a non-negative number");if(!Number.isFinite(a)||a<0)throw new TypeError("cardBackoffMs must be a non-negative number");if(typeof A!="function")throw new TypeError("delay must be a function");let r=Nb(t,{label:"\u9489\u9489\u6CE8\u518C\u670D\u52A1",requireSubdomain:!1}),s=new URL(Fge),g=WA(o);if(!g)throw new TypeError("registrationSource is required");let c=new Map,I=new Map,d=new Map,B=Promise.resolve(),f=0,Q=(H,J)=>new URL(J.replace(/^\//,""),H);async function y({clientId:H,clientSecret:J,signal:q,requestKind:U="normal"}){let R=WA(H),V=WA(J);if(!R||!V)throw new TypeError("clientId and clientSecret are required");let L=c.get(R);if(L&&L.expiresAt>i())return L.token;let T=U==="reaction"?d:I;if(T.has(R))return T.get(R);let W=(async()=>{let ie=await bn(n,Q(s,"v1.0/oauth2/accessToken"),{body:{appKey:R,appSecret:V},signal:q,action:"\u9274\u6743"}),ge=WA(ie?.accessToken);if(!ge)throw new gt("invalid-access-token","\u9489\u9489\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u8BBF\u95EE\u4EE4\u724C\u3002");let Se=Tb(ie?.expireIn??ie?.expiresIn,7200),de=Math.max(1e3,(Se-60)*1e3);return c.set(R,{token:ge,expiresAt:i()+de}),ge})().finally(()=>T.delete(R));return T.set(R,W),W}async function m({clientId:H,clientSecret:J,robotCode:q,messageId:U,conversationId:R,reactionName:V=zc,signal:L},T){let k=WA(H),W=WA(J),ie=WA(q)??k,ge=WA(U),Se=WA(R),de=WA(V);if(!k||!W)throw new TypeError("clientId and clientSecret are required");if(!ie)throw new TypeError("robotCode is required");if(!ge||!Se)throw new TypeError("messageId and conversationId are required");if(!de)throw new TypeError("reactionName is required");let De=await y({clientId:k,clientSecret:W,signal:L,requestKind:"reaction"}),fe=await bn(n,Q(s,`v1.0/robot/emotion/${T}`),{body:{robotCode:ie,openMsgId:ge,openConversationId:Se,emotionType:2,emotionName:de,textEmotion:{emotionId:xge,emotionName:de,text:de,backgroundId:Yge}},headers:{"x-acs-dingtalk-access-token":De},signal:L,timeoutMs:Kge,action:T==="reply"?"\u6D88\u606F\u72B6\u6001\u6DFB\u52A0":"\u6D88\u606F\u72B6\u6001\u64A4\u56DE"}),ve=fe?.success===!1?qh(fe?.code??fe?.errcode)??"rejected":bb(fe);if(ve)throw new gt("reaction-rejected","\u9489\u9489\u670D\u52A1\u62D2\u7EDD\u4E86\u6D88\u606F\u72B6\u6001\u8BF7\u6C42\u3002",{providerCode:ve});return!0}async function _({clientId:H,clientSecret:J,robotCode:q,downloadCode:U,signal:R,kind:V}){let L=WA(q),T=WA(U);if(!L||!T)throw new TypeError("robotCode and downloadCode are required");let k=await y({clientId:H,clientSecret:J,signal:R}),W;try{W=await bn(n,Q(s,"v1.0/robot/messageFiles/download"),{body:{downloadCode:T,robotCode:L},headers:{"x-acs-dingtalk-access-token":k},signal:R,action:`${V==="image"?"\u56FE\u7247":"\u6587\u4EF6"}\u4E0B\u8F7D\u5730\u5740`})}catch(ge){throw R?.aborted?ge:new gt(`${V}-download-address-failed`,`\u9489\u9489${V==="image"?"\u56FE\u7247":"\u6587\u4EF6"}\u4E0B\u8F7D\u5730\u5740\u83B7\u53D6\u5931\u8D25\u3002`,{cause:ge,status:ge?.status,providerCode:ge?.providerCode})}let ie=WA(W?.downloadUrl??W?.download_url);if(!ie)throw new gt(`invalid-${V}-download`,`\u9489\u9489\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE${V==="image"?"\u56FE\u7247":"\u6587\u4EF6"}\u4E0B\u8F7D\u5730\u5740\u3002`);return zge(ie)}function N(H){let J=async()=>{let U=Math.max(0,f-i());U>0&&await A(U,H),f=Math.max(f,i())+e},q=B.then(J,J);return B=q.catch(()=>{}),q}async function G(H,J){await N(J.signal);try{return await bn(n,Q(s,H),J)}catch(q){if(!(q instanceof gt)||q.status!==403)throw q;return await A(a,J.signal),await N(J.signal),bn(n,Q(s,H),J)}}async function Y({clientId:H,clientSecret:J,cardInstanceId:q,text:U,signal:R}){let V=WA(q),L=WA(U);if(!V)throw new TypeError("cardInstanceId is required");if(!L)throw new TypeError("text is required");let k={"x-acs-dingtalk-access-token":await y({clientId:H,clientSecret:J,signal:R})},W=[G("v1.0/card/streaming",{method:"PUT",body:{outTrackId:V,guid:Yh(),key:"msgContent",content:Jh(L),isFull:!0,isFinalize:!1,isError:!0},headers:k,signal:R,action:"AI Card \u5931\u8D25\u6536\u53E3"}),G("v1.0/card/instances",{method:"PUT",body:{outTrackId:V,cardData:Mb(L,"5"),cardUpdateOptions:{updateCardDataByKey:!0}},headers:k,signal:R,action:"AI Card \u5931\u8D25\u72B6\u6001"})],ie=await Promise.allSettled(W);if(ie.every(({status:ge})=>ge==="rejected"))throw ie[0].reason;return!0}async function j({clientId:H,clientSecret:J,target:q,file:U,signal:R},{uploadType:V,messageKey:L,createMessageParams:T}){if(!U||typeof U!="object"||typeof U.fileName!="string"||!U.fileName||!Buffer.isBuffer(U.bytes))throw new TypeError("A DingTalk file is required");let k=Zge(q),W;try{W=await y({clientId:H,clientSecret:J,signal:R})}catch(Re){if(R?.aborted)throw Mn(R);let AA=Number(Re?.status),ue=Re?.code==="http-error"&&AA>=400&&AA<500?"artifact-provider-rejected":"artifact-provider-failed";throw jh(Re,{fallback:ue})}let ie=new URL("media/upload",SH);ie.searchParams.set("access_token",W),ie.searchParams.set("type",V);let ge=new FormData;ge.append("media",new Blob([U.bytes],{type:U.mediaType??"application/octet-stream"}),U.fileName);let Se;try{Se=await Wge(n,ie,{body:ge,signal:R})}catch(Re){if(R?.aborted)throw Mn(R);let AA=Number(Re?.status),ue=Re?.code==="http-error"&&AA>=400&&AA<500?"artifact-provider-rejected":"artifact-provider-failed";throw jh(Re,{fallback:ue})}let de=bb(Se),De=WA(Se?.media_id);if(de||!De)throw jh(new gt("upload-rejected","\u9489\u9489\u670D\u52A1\u62D2\u7EDD\u4E86\u6587\u4EF6\u4E0A\u4F20\u3002",{providerCode:de??"missing-media-id"}));R?.throwIfAborted();let fe={robotCode:k.robotCode,msgKey:L,msgParam:JSON.stringify(T(De,U)),...k.type==="group"?{openConversationId:k.openConversationId}:{userIds:[k.userId]}},ve=k.type==="group"?"v1.0/robot/groupMessages/send":"v1.0/robot/oToMessages/batchSend",eA;try{eA=await bn(n,Q(s,ve),{body:fe,headers:{"x-acs-dingtalk-access-token":W},signal:R,action:"\u6587\u4EF6\u6D88\u606F\u53D1\u9001"})}catch(Re){throw qge(Re,R)}let iA=bb(eA);if(iA)throw jh(new gt("send-rejected","\u9489\u9489\u670D\u52A1\u62D2\u7EDD\u4E86\u6587\u4EF6\u6D88\u606F\u3002",{providerCode:iA}));return eA}return Object.freeze({async beginRegistration({signal:H}={}){let J=_b(await bn(n,Q(r,"app/registration/init"),{body:{source:g},signal:H,action:"\u521D\u59CB\u5316"}),"\u521D\u59CB\u5316"),q=WA(J.nonce);if(!q)throw new gt("invalid-registration","\u9489\u9489\u626B\u7801\u521D\u59CB\u5316\u7F3A\u5C11 nonce\u3002");let U=_b(await bn(n,Q(r,"app/registration/begin"),{body:{nonce:q},signal:H,action:"\u521B\u5EFA"}),"\u521B\u5EFA"),R=WA(U.device_code),V=WA(U.verification_uri_complete);if(!R||!V)throw new gt("invalid-registration","\u9489\u9489\u626B\u7801\u670D\u52A1\u8FD4\u56DE\u7684\u4FE1\u606F\u4E0D\u5B8C\u6574\u3002");let L=Nb(V,{label:"\u9489\u9489\u626B\u7801",requireSubdomain:!1}).toString();return{deviceCode:R,userCode:WA(U.user_code)??void 0,verificationUri:WA(U.verification_uri)??void 0,verificationUriComplete:L,expiresInSeconds:Tb(U.expires_in,7200),intervalSeconds:Tb(U.interval,5)}},async pollRegistration({deviceCode:H,signal:J}={}){let q=WA(H);if(!q)throw new TypeError("deviceCode is required");let U=_b(await bn(n,Q(r,"app/registration/poll"),{body:{device_code:q},signal:J,action:"\u72B6\u6001\u67E5\u8BE2"}),"\u72B6\u6001\u67E5\u8BE2"),R=WA(U.status)?.toUpperCase();if(!R||!jge.has(R))throw new gt("invalid-registration-status","\u9489\u9489\u626B\u7801\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6CD5\u8BC6\u522B\u7684\u72B6\u6001\u3002");let V={status:R,failReason:WA(U.fail_reason)??void 0};if(R==="SUCCESS"&&(V.clientId=WA(U.client_id)??void 0,V.clientSecret=WA(U.client_secret)??void 0,!V.clientId||!V.clientSecret))throw new gt("missing-credentials","\u9489\u9489\u626B\u7801\u5DF2\u786E\u8BA4\uFF0C\u4F46\u6CA1\u6709\u8FD4\u56DE\u673A\u5668\u4EBA\u51ED\u636E\u3002");return V},accessToken:y,async addReaction(H){return m(H,"reply")},async recallReaction(H){return m(H,"recall")},async addThinkingReaction(H){return m({...H,reactionName:zc},"reply")},async recallThinkingReaction(H){return m({...H,reactionName:zc},"recall")},async downloadImage({clientId:H,clientSecret:J,robotCode:q,downloadCode:U,signal:R,maxBytes:V}){let L=await _({clientId:H,clientSecret:J,robotCode:q,downloadCode:U,signal:R,kind:"image"});try{return await no(L,{fetchImpl:n,signal:R,maxBytes:V})}catch(T){throw R?.aborted||T instanceof ut?T:new gt("image-content-download-failed","\u9489\u9489\u56FE\u7247\u5185\u5BB9\u4E0B\u8F7D\u5931\u8D25\u3002",{cause:T})}},async downloadFile({clientId:H,clientSecret:J,robotCode:q,downloadCode:U,signal:R}){let V=await _({clientId:H,clientSecret:J,robotCode:q,downloadCode:U,signal:R,kind:"file"});if(V.protocol!=="https:")throw new gt("invalid-file-download","\u9489\u9489\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6548\u7684\u6587\u4EF6\u4E0B\u8F7D\u5730\u5740\u3002");try{let L=await n(V,{method:"GET",redirect:"follow",signal:R});if(!L?.ok)throw await L?.body?.cancel?.().catch?.(()=>{}),new gt("file-content-download-failed",`\u9489\u9489\u6587\u4EF6\u5185\u5BB9\u4E0B\u8F7D\u5931\u8D25\uFF08HTTP ${L?.status??"unknown"}\uFF09\u3002`,{status:L?.status});return Buffer.from(await L.arrayBuffer())}catch(L){throw R?.aborted?Mn(R):L instanceof gt?L:new gt("file-content-download-failed","\u9489\u9489\u6587\u4EF6\u5185\u5BB9\u4E0B\u8F7D\u5931\u8D25\u3002",{cause:L})}},async createAiCard({clientId:H,clientSecret:J,target:q,initialText:U,signal:R}){let V=WA(H),L=WA(J),T=WA(U);if(!V||!L)throw new TypeError("clientId and clientSecret are required");if(!T)throw new TypeError("initialText is required");let k=$ge(q),W=await y({clientId:V,clientSecret:L,signal:R}),ie=`dsh_${Yh()}`,ge={"x-acs-dingtalk-access-token":W},Se=!1;try{await G("v1.0/card/instances",{body:{cardTemplateId:Uge,outTrackId:ie,cardData:{cardParamMap:{config:JSON.stringify({autoLayout:!0})}},callbackType:"STREAM",imGroupOpenSpaceModel:{supportForward:!0},imRobotOpenSpaceModel:{supportForward:!0}},headers:ge,signal:R,action:"AI Card \u521B\u5EFA"}),await G("v1.0/card/instances/deliver",{body:ece(ie,k,V),headers:ge,signal:R,action:"AI Card \u6295\u653E"}),Se=!0,await G("v1.0/card/instances",{method:"PUT",body:{outTrackId:ie,cardData:Mb(T,"2")},headers:ge,signal:R,action:"AI Card \u542F\u52A8"}),await G("v1.0/card/streaming",{method:"PUT",body:{outTrackId:ie,guid:Yh(),key:"msgContent",content:Jh(T).replace(/\n+$/,""),isFull:!0,isFinalize:!1,isError:!1},headers:ge,signal:R,action:"AI Card \u542F\u52A8"})}catch(de){if(Se){let De=AbortSignal.timeout(5e3);await Y({clientId:V,clientSecret:L,cardInstanceId:ie,text:D("\u5361\u7247\u5DF2\u7ED3\u675F\uFF0C\u8BF7\u67E5\u770B\u540E\u7EED\u6D88\u606F\u3002"),signal:De}).catch(()=>{})}throw de}return{cardInstanceId:ie}},async updateAiCard({clientId:H,clientSecret:J,cardInstanceId:q,text:U,signal:R}){let V=WA(q),L=WA(U);if(!V)throw new TypeError("cardInstanceId is required");if(!L)throw new TypeError("text is required");let T=await y({clientId:H,clientSecret:J,signal:R});return await G("v1.0/card/streaming",{method:"PUT",body:{outTrackId:V,guid:Yh(),key:"msgContent",content:Jh(L).replace(/\n+$/,""),isFull:!0,isFinalize:!1,isError:!1},headers:{"x-acs-dingtalk-access-token":T},signal:R,action:"AI Card \u66F4\u65B0"}),!0},async finishAiCard({clientId:H,clientSecret:J,cardInstanceId:q,text:U,signal:R}){let V=WA(q),L=WA(U);if(!V)throw new TypeError("cardInstanceId is required");if(!L)throw new TypeError("text is required");let k={"x-acs-dingtalk-access-token":await y({clientId:H,clientSecret:J,signal:R})},W=Jh(L);await G("v1.0/card/streaming",{method:"PUT",body:{outTrackId:V,guid:Yh(),key:"msgContent",content:W,isFull:!0,isFinalize:!0,isError:!1},headers:k,signal:R,action:"AI Card \u5B8C\u6210"});let ie=!0,ge={method:"PUT",body:{outTrackId:V,cardData:Mb(L,"3"),cardUpdateOptions:{updateCardDataByKey:!0}},headers:k,signal:R,action:"AI Card \u6536\u53E3"};try{await G("v1.0/card/instances",ge)}catch{try{await G("v1.0/card/instances",ge)}catch{ie=!1}}return{delivered:!0,completed:ie}},failAiCard:Y,async sendText({clientId:H,clientSecret:J,sessionWebhook:q,text:U,signal:R}){let V=WA(U);if(!V)throw new TypeError("text is required");let L=Rg(q),T=await y({clientId:H,clientSecret:J,signal:R}),k=await bn(n,L,{body:{msgtype:"text",text:{content:V}},headers:{"x-acs-dingtalk-access-token":T},signal:R,action:"\u6D88\u606F\u56DE\u590D"});if(k?.errcode!==void 0&&k.errcode!==0||k?.code!==void 0&&k.code!==0)throw new gt("send-rejected","\u9489\u9489\u670D\u52A1\u62D2\u7EDD\u4E86\u56DE\u590D\u6D88\u606F\u3002");return!0},async sendFile(H){return j(H,{uploadType:"file",messageKey:"sampleFile",createMessageParams:(J,q)=>({mediaId:J,fileName:q.fileName,fileType:Xge(q.fileName)})})},async sendImage(H){return j(H,{uploadType:"image",messageKey:"sampleImageMsg",createMessageParams:J=>({photoURL:J})})},clearAccessToken(H){let J=WA(H);J&&c.delete(J)}})}var Ace=500,tce="\u5361\u7247\u5DF2\u7ED3\u675F\uFF0C\u8BF7\u67E5\u770B\u540E\u7EED\u6D88\u606F\u3002";function Rb(n,t){if(typeof n!="string")throw new TypeError(`${t} must be a string`);return n}function TH(n,t){if(typeof n!="string"||!n.trim())throw new TypeError(`${t} is required`);return n.trim()}function NH({api:n,clientId:t,clientSecret:o,target:i,signal:e,logger:a=console,updateIntervalMs:A=Ace,clock:r=()=>Date.now(),timer:s={setTimeout:(g,c)=>globalThis.setTimeout(g,c),clearTimeout:g=>globalThis.clearTimeout(g)}}={}){if(!n||typeof n.createAiCard!="function"||typeof n.updateAiCard!="function"||typeof n.finishAiCard!="function")throw new TypeError("DingTalk AI Card API is required");let g=TH(t,"clientId"),c=TH(o,"clientSecret");if(i==null)throw new TypeError("target is required");if(!Number.isFinite(A)||A<0)throw new TypeError("updateIntervalMs must be a non-negative number");if(typeof r!="function")throw new TypeError("clock must be a function");if(typeof s?.setTimeout!="function"||typeof s?.clearTimeout!="function")throw new TypeError("timer must provide setTimeout and clearTimeout");let I=()=>{let T=r();if(!Number.isFinite(T))throw new TypeError("clock must return a finite timestamp");return T};I();let d=e?.aborted?"aborted":"idle",B=null,f=null,Q=null,y=null,m=null,_=null,N=0,G=()=>{Q!==null&&(s.clearTimeout(Q),Q=null)},Y=()=>e?.removeEventListener("abort",q),j=T=>{d=T,f=null,G(),Y()},H=()=>!B||typeof n.failAiCard!="function"?Promise.resolve(!1):(_||(_=n.failAiCard({...B,text:D(tce),signal:AbortSignal.timeout(5e3)}).then(()=>!0,()=>!1)),_),J=T=>{d==="failed"||d==="finished"||d==="aborted"||(H(),j("failed"),a?.error?.(`[dsh-dingtalk] AI Card ${T} failed`))};function q(){d==="finished"||d==="failed"||d==="aborted"||(H(),j("aborted"))}d!=="aborted"&&e?.addEventListener("abort",q,{once:!0});let U=()=>{if(d!=="active"||y||f===null)return;let T=Math.max(0,N+A-I());if(T>0){Q=s.setTimeout(()=>{Q=null,U()},T);return}let k=f;f=null,y=(async()=>{try{await n.updateAiCard({...B,text:k,finished:!1}),N=I()}catch{if(e?.aborted||d==="aborted")return;J("update")}})().finally(()=>{y=null,d==="active"&&f!==null&&U()})};return Object.freeze({start:async T=>{if(Rb(T,"initialText"),d!=="idle")return!1;d="starting";try{let k=await n.createAiCard({clientId:g,clientSecret:c,target:i,initialText:T,signal:e}),W=typeof k?.cardInstanceId=="string"?k.cardInstanceId.trim():"";if(!W)throw new TypeError("DingTalk did not return a card instance id");return B=Object.freeze({clientId:g,clientSecret:c,target:i,cardInstanceId:W,signal:e}),d!=="starting"?(H(),!1):(N=I(),d="active",!0)}catch{return e?.aborted||d==="aborted"?(j("aborted"),!1):(J("creation"),!1)}},push:T=>{Rb(T,"progressText"),d==="active"&&(f=T,!Q&&!y&&U())},finish:T=>{if(Rb(T,"finalText"),d==="finished")return Promise.resolve(!0);if(d==="finishing")return m;if(d!=="active")return Promise.resolve(!1);d="finishing",f=null,G();let k=y;return m=(async()=>{if(k&&await k,d!=="finishing")return!1;try{return await n.finishAiCard({...B,text:T}),d!=="finishing"?!1:(j("finished"),!0)}catch{return e?.aborted||d==="aborted"?(j("aborted"),!1):(J("finish"),!1)}})(),m}})}function lf(n){return typeof n=="string"&&n.trim()?n.trim():null}function ti(n){return n&&typeof n.id=="string"&&typeof n.question=="string"&&(n.header===void 0||typeof n.header=="string")&&(n.detail===void 0||typeof n.detail=="string")&&(n.multiSelect===void 0||typeof n.multiSelect=="boolean")&&(n.options===void 0||Array.isArray(n.options)&&n.options.every(t=>t&&typeof t.label=="string"&&(t.description===void 0||typeof t.description=="string")))}function ri(n,t,o,{requiresMention:i=!1}={}){let e=[],a=o>1?`\uFF08${t+1}/${o}\uFF09`:"";e.push(D("DeepSeek Harness \u9700\u8981\u4F60\u8865\u5145\u4FE1\u606F{progress}\uFF1A",{progress:a})),lf(n.header)&&e.push("",n.header.trim()),e.push("",lf(n.question)??D("\u8BF7\u8F93\u5165\u4F60\u7684\u56DE\u7B54\u3002")),lf(n.detail)&&e.push("",n.detail.trim());let A=Array.isArray(n.options)?n.options:[];return A.length>0?(e.push(""),A.forEach((r,s)=>{let g=typeof r?.label=="string"?r.label:"",c=lf(r?.description);e.push(`${s+1}. ${g}${c?` \u2014 ${c}`:""}`)}),e.push("",n.multiSelect===!0?D("\u8BF7\u56DE\u590D\u9009\u9879\u5E8F\u53F7\u6216\u6587\u5B57\uFF1B\u591A\u9009\u7528\u9017\u53F7\u5206\u9694\uFF0C\u4E5F\u53EF\u8865\u5145\u5176\u4ED6\u5185\u5BB9\u3002"):D("\u8BF7\u56DE\u590D\u4E00\u4E2A\u9009\u9879\u5E8F\u53F7\u6216\u6587\u5B57\uFF0C\u4E5F\u53EF\u76F4\u63A5\u8F93\u5165\u5176\u4ED6\u7B54\u6848\u3002"))):e.push("",D("\u8BF7\u76F4\u63A5\u56DE\u590D\u4F60\u7684\u7B54\u6848\u3002")),i&&e.push("",D("\u7FA4\u804A\u4E2D\u8BF7 @\u673A\u5668\u4EBA \u540E\u53D1\u9001\u7B54\u6848\u3002")),e.join(` `)}function RH(n,t){let o=n.trim();if(!o)return null;if(/^\d+$/.test(o)){let e=t[Number(o)-1];return typeof e?.label=="string"?e.label:null}let i=t.find(e=>e?.label===o);return typeof i?.label=="string"?i.label:null}function ai(n,t){let o=Array.isArray(n.options)?n.options:[];if(o.length===0)return{id:n.id,selected:[],custom:t};let i=RH(t,o);if(n.multiSelect!==!0)return i?{id:n.id,selected:[i]}:{id:n.id,selected:[],custom:t};if(i)return{id:n.id,selected:[i]};let e=[],a=[];for(let A of t.split(/[,,、;;\n]+/)){let r=A.trim();if(!r)continue;let s=RH(r,o);s?e.includes(s)||e.push(s):a.push(r)}return{id:n.id,selected:e,...a.length>0?{custom:a.join("\u3001")}:{}}}var rce=new Map([["\u6279\u51C6","allowed-once"],["\u540C\u610F","allowed-once"],["yes","allowed-once"],["\u62D2\u7EDD","rejected"],["\u4E0D\u540C\u610F","rejected"],["no","rejected"]]),kb="\u8BF7\u7CBE\u51C6\u56DE\u590D\u300C\u6279\u51C6\u300D\u6216\u300C\u62D2\u7EDD\u300D\uFF08\u4E5F\u652F\u6301\uFF1A\u540C\u610F / \u4E0D\u540C\u610F / yes / no\uFF09\u3002",ace="\u8BF7\u5148\u5B8C\u6210\u5F53\u524D\u95EE\u9898\uFF0C\u518D\u7CBE\u51C6\u56DE\u590D\u300C\u6279\u51C6\u300D\u6216\u300C\u62D2\u7EDD\u300D\u3002",Gl="\u8BE5\u5BA1\u6279\u5DF2\u5904\u7406\uFF0C\u65E0\u9700\u518D\u6B21\u56DE\u590D\u3002",ice=5*6e4,oce=2048;function wa(n){return typeof n=="string"?n.trim():""}function vb(n){return wa(n).replace(/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/g,"")}function nce(n){return rce.get(wa(n).toLowerCase())??null}function vH(n){return n?.type==="approval/requested"&&!!wa(n.sessionId)&&!!wa(n.approvalId)&&!!wa(n.toolName)&&(n.callId===void 0||!!wa(n.callId))&&(n.reason===void 0||typeof n.reason=="string")}function sce(n){let t=n?.arguments;if(t!==null&&typeof t=="object")try{return JSON.stringify(t,null,2)}catch{return null}if(typeof t!="string")return null;let o=vb(t);if(!o)return t===""?"{}":null;try{return JSON.stringify(JSON.parse(o),null,2)}catch{return o}}function Pb(n,{toolCall:t,requiresMention:o=!1,maxArgumentsLength:i=6e3}={}){if(!vH(n))return null;let e=wa(n.callId);if(!e||wa(t?.callId)!==e||wa(t?.name)!==wa(n.toolName))return null;let a=sce(t);if(!a||a.length>i)return null;let A=[D("DeepSeek Harness \u9700\u8981\u4F60\u7684\u5BA1\u6279\uFF1A"),"",D("\u5DE5\u5177\uFF1A{tool}",{tool:vb(n.toolName)}),D("\u64CD\u4F5C\u53C2\u6570\uFF1A"),a],r=vb(n.reason);return r&&A.push(D("\u539F\u56E0\uFF1A{reason}",{reason:r})),A.push("",D(kb)),o&&A.push("",D("\u7FA4\u804A\u4E2D\u8BF7 @\u673A\u5668\u4EBA \u540E\u53D1\u9001\u5BA1\u6279\u51B3\u5B9A\u3002")),A.join(` -`)}function kH(n,t){return{ok:!0,value:{sessionId:n.sessionId,approvalId:n.approvalId,outcome:t}}}function pf(n){return n==="allowed-once"?D("\u5DF2\u6279\u51C6\uFF0C\u4EC5\u5BF9\u672C\u6B21\u64CD\u4F5C\u6709\u6548\u3002"):n==="rejected"?D("\u5DF2\u62D2\u7EDD\u6B64\u6B21\u64CD\u4F5C\u3002"):D(Gl)}var ii=class{#e;#A;#t=new Map;#r=new Map;#a=new Map;constructor({label:t="IM",logger:o=console}={}){this.#e=t,this.#A=o}hasPending(t){return this.#r.get(t)?.items.some(o=>!o.inactive)===!0}claimReply({key:t,actor:o,text:i,addressed:e=!0,hasPendingQuestion:a=!1,questionCompletion:A,isQuestionPending:r,send:s}){let c=this.#r.get(t)?.items[0],I=nce(i),d=(f,Q=!1)=>({...Q?{resolved:!0}:{},process:async y=>{typeof y=="function"&&await y()===!1||await s(f)}}),B=a&&c&&A&&typeof A.then=="function";return a&&!B?null:!c||c.inactive?(this.#a.get(t)??0)<=Date.now()?(this.#a.delete(t),null):I?d(D(Gl),!0):null:c.actor!==o||c.requiresMention&&e!==!0?I?d(D("\u53EA\u6709\u53D1\u8D77\u5F53\u524D\u4EFB\u52A1\u7684\u7528\u6237\u53EF\u4EE5\u5904\u7406\u8FD9\u6761\u5BA1\u6279\u3002")):null:{process:async f=>{let Q=c.presented,m=(c.replyTail??Promise.resolve()).catch(()=>{}).then(async()=>{if(!(typeof f=="function"&&await f()===!1)){if(B){if(await A.catch(()=>{}),c.inactive||c.resolving)return;if(typeof r=="function"&&r()){await s(D(ace));return}}if(await c.activationTask?.catch(()=>{}),await c.presentationTask?.catch(()=>{}),c.inactive||c.resolving){await s(D(Gl));return}if(c.send=s,!Q||!c.presented){if(c.presented||await this.#i(c),c.inactive||c.resolving)return;await s(D(kb));return}if(c.submitting){await s(D("\u5BA1\u6279\u51B3\u5B9A\u6B63\u5728\u63D0\u4EA4\uFF0C\u8BF7\u7A0D\u5019\u3002"));return}if(!I){await s(D(kb));return}await this.#c(c,I)}});c.replyTail=m;try{await m}finally{c.replyTail===m&&(c.replyTail=null)}}}}async handleRequested(t,o){if(t?.kind!=="approval")return!1;let i=t.payload,e=wa(i?.approvalId);if(!wa(t.rpcId)||!wa(t.sessionId)||!e||!vH(i)||i.sessionId!==t.sessionId||typeof t.respond!="function")return this.#A.warn?.(`[dsh-im:${this.#e}] ignored an invalid Harness approval`),!0;if(t.recovered===!0)return await this.#g(t,i),!0;let a=this.#t.get(e);if(a)return a.interaction=t,a.toolCall=t.toolCall,a.presented||await this.#i(a),!0;let A=o?.send,r=wa(o?.key),s=wa(o?.actor);if(!r||!s||typeof A!="function")return this.#A.warn?.(`[dsh-im:${this.#e}] ignored an approval without a reply route`),await this.#g(t,i),!0;let g=Pb(i,{toolCall:t.toolCall,requiresMention:o.requiresMention===!0});if(!g){let d=await this.#g(t,i);return await A(d?D("\u65E0\u6CD5\u5B8C\u6574\u5C55\u793A\u8FD9\u6B21\u64CD\u4F5C\uFF0C\u5DF2\u5B89\u5168\u62D2\u7EDD\u6B64\u6B21\u5BA1\u6279\u3002"):D(Gl)),!0}let c={approvalId:e,sessionId:t.sessionId,interaction:t,toolCall:t.toolCall,key:r,actor:s,requiresMention:o.requiresMention===!0,send:A,text:g,presented:!1,presentationTask:null,deliveryCompleted:!1,replyTail:null,submitting:!1,inactive:!1,resolving:!1,closedOutcome:null,resolutionNotified:!1,activationTask:null};this.#t.set(e,c);let I=this.#r.get(r)??{items:[]};return I.items.push(c),this.#r.set(r,I),I.items[0]===c&&await this.#i(c),!0}async handleResolved(t){if(t?.kind!=="approval")return!1;let o=this.#t.get(wa(t.interactionId));if(!o||(o.resolving=!0,o.activationTask&&await o.activationTask.catch(()=>{}),o.inactive||this.#t.get(o.approvalId)!==o))return!0;let i=o.presentationTask,e=o.presented||i,a=o.send,A=this.#o(o);return await this.#s(A,async()=>{let r=o.presented;i&&(r=await i.then(()=>!0,()=>!1)),e&&r&&(o.resolutionNotified=!0,await a(pf(t.outcome)).catch(()=>{}))}),!0}async closeRoute(t){let o=this.#r.get(t);if(!o)return;let i=[...o.items];for(let e of i)this.#o(e);await Promise.all(i.map(async e=>{try{await e.interaction.respond(kH(e,"rejected"),{signal:AbortSignal.timeout(5e3)}),e.closedOutcome="rejected",(e.presented||e.deliveryCompleted)&&!e.resolutionNotified&&(e.resolutionNotified=!0,await e.send(pf("rejected")).catch(()=>{}))}catch(a){a?.code==="interaction-not-pending"?(e.closedOutcome="resolved",(e.presented||e.deliveryCompleted)&&!e.resolutionNotified&&(e.resolutionNotified=!0,await e.send(D(Gl)).catch(()=>{}))):this.#A.warn?.(`[dsh-im:${this.#e}] failed to reject a closing approval:`,a)}}))}async#i(t){if(this.#r.get(t.key)?.items[0]!==t||t.inactive||t.resolving||t.presented||(await t.activationTask?.catch(()=>{}),this.#r.get(t.key)?.items[0]!==t||t.inactive||t.resolving||t.presented))return;if(t.presentationTask)return t.presentationTask;let o=Promise.resolve().then(()=>t.send(t.text));t.presentationTask=o;try{await o,t.deliveryCompleted=!0,t.inactive?t.closedOutcome&&!t.resolutionNotified&&(t.resolutionNotified=!0,await t.send(pf(t.closedOutcome)).catch(()=>{})):t.presented=!0}finally{t.presentationTask===o&&(t.presentationTask=null)}}async#c(t,o){t.submitting=!0;try{await t.interaction.respond(kH(t,o))}catch(a){if(a?.code==="interaction-not-pending"){let A=t.send,r=this.#o(t);await this.#s(r,async()=>{t.resolutionNotified||await A(D(Gl)).catch(()=>{})});return}if(t.inactive)return;t.submitting=!1,this.#A.error?.(`[dsh-im:${this.#e}] failed to submit an approval:`,a),await t.send(D("\u5BA1\u6279\u63D0\u4EA4\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u56DE\u590D\u300C\u6279\u51C6\u300D\u6216\u300C\u62D2\u7EDD\u300D\u3002")).catch(()=>{});return}let i=t.send,e=this.#o(t);await this.#s(e,async()=>{t.resolutionNotified||await i(pf(o)).catch(()=>{})})}async#s(t,o){let i,e=new Promise(a=>{i=a});t&&(t.activationTask=e);try{await o()}finally{i(),t?.activationTask===e&&(t.activationTask=null)}await this.#I(t)}async#I(t){if(t)try{await this.#i(t)}catch(o){this.#A.error?.(`[dsh-im:${this.#e}] failed to present the next approval:`,o);try{t.interaction.reconnect?.()}catch{}}}#o(t){if(t.inactive)return null;t.inactive=!0,this.#n(t.key),this.#t.delete(t.approvalId);let o=this.#r.get(t.key);if(!o)return null;let i=o.items[0]===t,e=o.items.indexOf(t);return e!==-1&&o.items.splice(e,1),o.items.length===0?(this.#r.delete(t.key),null):i?o.items[0]:null}#n(t){let o=Date.now();for(let[i,e]of this.#a)e<=o&&this.#a.delete(i);for(this.#a.delete(t),this.#a.set(t,o+ice);this.#a.size>oce;)this.#a.delete(this.#a.keys().next().value)}async#g(t,o){try{return await t.respond({ok:!0,value:{sessionId:t.sessionId,approvalId:o.approvalId,outcome:"rejected"}},{signal:AbortSignal.timeout(5e3)}),!0}catch(i){if(i?.code==="interaction-not-pending")return!1;throw i}}};var Gb=new WeakMap;function gce(n){let t=Gb.get(n);return t||(t=new Map,Gb.set(n,t)),t}async function Vc(n,t,o){let i=typeof n;if(i!=="object"&&i!=="function"||n===null)throw new TypeError("state is required");if(typeof t!="string"||!t)throw new TypeError("conversation key is required");if(typeof o!="function")throw new TypeError("operation is required");let e=gce(n),a=e.get(t)??Promise.resolve(),A,r=new Promise(s=>{A=s});e.set(t,r),await a;try{return await o()}finally{A(),e.get(t)===r&&(e.delete(t),e.size===0&&Gb.delete(n))}}var oi="workspace-session-stale";function PH(n,t){return typeof n.workspaceSession=="function"?n.workspaceSession(t):Object.freeze({sessionId:t,sessionExists:(...o)=>n.sessionExists(t,...o),models:(...o)=>n.getSessionModels(t,...o),selectModel:(...o)=>n.selectSessionModel(t,...o),isRunning:(...o)=>n.isSessionRunning(t,...o),hasActiveTurn:(...o)=>n.hasActiveTurn(t,...o),stopActiveTurn:(...o)=>n.stopActiveTurn(t,...o),steerActiveTurn:(...o)=>n.steerActiveTurn(t,...o),ask:(...o)=>n.ask(t,...o)})}async function cce(n,t){return t===void 0?n.sessionExists():n.sessionExists(t)}async function Ice(n,t){return t===void 0?n.createSession():n.createSession(t)}async function ni({harness:n,state:t,key:o,text:i,content:e,createOptions:a,existsOptions:A,askOptions:r}){for(;;)try{let s=await Vc(t,o,async()=>{let B=t.sessionFor(o),f=B?PH(n,B):null;if(!f||!await cce(f,A)){if(B=await Ice(n,a),await t.setSession(o,B)===!1)return null;f=PH(n,B)}return{sessionId:B,session:f}});if(!s)continue;let g=[],c=typeof r=="object"&&typeof r?.onArtifact=="function"?r.onArtifact:null,I=typeof r=="number"?{timeoutMs:r}:{...r};I.onArtifact=async B=>{g.push(B),await c?.(B)};let d=await s.session.ask(e??i,I);return{sessionId:s.sessionId,answer:d,...g.length>0?{artifacts:g}:{}}}catch(s){if(s?.code!==oi)throw s}}var lce=/^\/compact(?=$|\s)([\s\S]*)$/i,pce="\u7528\u6CD5\uFF1A/compact\uFF08\u4E0D\u5E26\u53C2\u6570\uFF09",GH=new Map([["No compactable history yet.","\u6682\u65E0\u53EF\u538B\u7F29\u7684\u5386\u53F2\u8BB0\u5F55\u3002"],["Compaction is unavailable because this process has an active compaction, or the agent is not idle.","\u5F53\u524D\u4F1A\u8BDD\u6B63\u5728\u751F\u6210\u56DE\u590D\u6216\u6267\u884C\u538B\u7F29\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"],["Compaction cancelled.","\u4E0A\u4E0B\u6587\u538B\u7F29\u5DF2\u53D6\u6D88\u3002"],["The history selected for compaction changed before it could be replaced. The conversation is unchanged; the attempt is recorded in the session log.","\u538B\u7F29\u671F\u95F4\u4F1A\u8BDD\u5386\u53F2\u53D1\u751F\u53D8\u5316\uFF0C\u672C\u6B21\u672A\u4FEE\u6539\u4F1A\u8BDD\uFF0C\u8BF7\u91CD\u8BD5\u3002"],["Compaction could not produce a useful summary. The conversation is unchanged; the attempt is recorded in the session log.","\u672A\u80FD\u751F\u6210\u6709\u6548\u7684\u538B\u7F29\u6458\u8981\uFF0C\u672C\u6B21\u672A\u4FEE\u6539\u4F1A\u8BDD\u3002"],["Compaction did not finish cleanly; some session history may have changed. Inspect the current session state before retrying.","\u4E0A\u4E0B\u6587\u538B\u7F29\u672A\u6B63\u5E38\u5B8C\u6210\uFF0C\u90E8\u5206\u4F1A\u8BDD\u5386\u53F2\u53EF\u80FD\u5DF2\u53D8\u5316\uFF0C\u8BF7\u68C0\u67E5\u4F1A\u8BDD\u540E\u518D\u91CD\u8BD5\u3002"],["Compaction finished, but the session could not be saved.","\u4E0A\u4E0B\u6587\u5DF2\u538B\u7F29\uFF0C\u4F46\u4F1A\u8BDD\u4FDD\u5B58\u5931\u8D25\u3002"]]);function Wc(n){return{handled:!0,message:n,messages:[n]}}function dce(n){if(!n||typeof n!="object"||!["success","error"].includes(n.kind)||n.text!==void 0&&typeof n.text!="string")throw new TypeError("Harness returned an invalid /compact result");let t=n.text?.trim()??"",o=/^Compacted (\d+) history items \(~(\d+) tokens\)\.$/u.exec(t);return o?D("\u5DF2\u538B\u7F29 {count} \u6761\u5386\u53F2\u8BB0\u5F55\uFF08\u7EA6 {tokens} \u4E2A token\uFF09\u3002",{count:o[1],tokens:o[2]}):GH.has(t)?D(GH.get(t)):t||(n.kind==="success"?D("\u4E0A\u4E0B\u6587\u538B\u7F29\u5B8C\u6210\u3002"):D("\u4E0A\u4E0B\u6587\u538B\u7F29\u5931\u8D25\u3002"))}function hce(n){let t=n?.code??n?.failure?.code;return t==="session-not-found"?D("\u5F53\u524D\u804A\u5929\u7ED1\u5B9A\u7684\u4F1A\u8BDD\u5DF2\u4E0D\u5B58\u5728\uFF0C\u8BF7\u53D1\u9001\u65B0\u6D88\u606F\u5F00\u542F\u4F1A\u8BDD\u3002"):t==="agent-busy"?D("\u5F53\u524D\u4F1A\u8BDD\u6B63\u5728\u751F\u6210\u56DE\u590D\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"):t==="cancelled"||n?.name==="AbortError"?D("\u4E0A\u4E0B\u6587\u538B\u7F29\u5DF2\u53D6\u6D88\u3002"):t===oi||t==="workspace-bot-not-found"?D("\u5DE5\u4F5C\u533A\u6216\u673A\u5668\u4EBA\u72B6\u6001\u5DF2\u53D1\u751F\u53D8\u5316\uFF0C\u8BF7\u91CD\u8BD5\u3002"):t==="commands-unavailable"?D("\u5F53\u524D Harness \u6682\u4E0D\u652F\u6301\u4ECE\u673A\u5668\u4EBA\u6267\u884C\u4E0A\u4E0B\u6587\u538B\u7F29\u3002"):D("\u4E0A\u4E0B\u6587\u538B\u7F29\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002")}async function si(n,t,o,i,e={}){if(typeof n!="string")return null;let a=lce.exec(n.trim());if(!a)return null;if(a[1].trim())return Wc(D(pce));if(typeof o?.sessionFor!="function")return Wc(D("\u5F53\u524D\u673A\u5668\u4EBA\u6CA1\u6709\u53EF\u7528\u7684\u4F1A\u8BDD\u72B6\u6001\u3002"));let A=o.sessionFor(i);if(typeof A!="string"||!A)return Wc(D("\u5F53\u524D\u804A\u5929\u8FD8\u6CA1\u6709\u53EF\u538B\u7F29\u7684\u4F1A\u8BDD\uFF0C\u8BF7\u5148\u53D1\u9001\u4E00\u6761\u6D88\u606F\u3002"));if(typeof t?.executeCommand!="function")return Wc(D("\u5F53\u524D\u673A\u5668\u4EBA\u6682\u4E0D\u652F\u6301\u4E0A\u4E0B\u6587\u538B\u7F29\u3002"));try{let r=await t.executeCommand(A,"/compact",e);return Wc(r===void 0?D("\u5F53\u524D Harness \u672A\u6CE8\u518C /compact \u547D\u4EE4\uFF0C\u8BF7\u786E\u8BA4\u4E0A\u4E0B\u6587\u538B\u7F29\u7EC4\u4EF6\u5DF2\u542F\u7528\u3002"):dce(r?.result))}catch(r){return Wc(hce(r))}}var FH={name:"@xmanrui/dsh-im",version:"2.6.0",description:"\u628A\u4E5D\u79CD IM \u673A\u5668\u4EBA\u548C\u516C\u7F51 AI Office \u63A5\u5165\u672C\u673A DeepSeek Harness\u3002 Connect nine IM channels and a public AI Office to a local DeepSeek Harness.",keywords:["deepseek-harness","dsh","dsh-plugin","ai-agent","im","instant-messaging","chatbot","feishu","lark","wechat","wecom","dingtalk","qq","slack","telegram","discord","whatsapp","ai-office"],author:{name:"xmanrui",url:"https://github.com/xmanrui"},contributors:[{name:"C3H3-AI",url:"https://github.com/C3H3-AI"}],license:"MIT",type:"module",repository:{type:"git",url:"git+https://github.com/xmanrui/dsh-im.git"},homepage:"https://github.com/xmanrui/dsh-im#readme",bugs:"https://github.com/xmanrui/dsh-im/issues",publishConfig:{access:"public"},bin:{"dsh-im":"bin/dsh-im.mjs"},main:"./lib/index.js",exports:{".":"./lib/index.js","./client":"./lib/client.js","./package.json":"./package.json"},files:["assets","bin","cordis.patch.yml","lib","plugin-src","scripts","src","LICENSE","README.md","README.en.md","THIRD_PARTY_NOTICES.md"],dsh:{bundle:{patch:"./cordis.patch.yml"},client:{inject:["@deepseek-ai/dsh-client-connection","@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-ui-settings","@deepseek-ai/dsh-client-ui-slots","@deepseek-ai/dsh-client-locale"],platform:"web"}},scripts:{build:"node plugin-src/client/build.mjs && node plugin-src/host/build.mjs",test:"node --test test/*.test.mjs test/channels/*/*.test.mjs",check:"npm test && npm run build && node scripts/verify-package.mjs"},engines:{node:">=22.19"},dependencies:{"@tencent-connect/qqbot-connector":"1.2.0","@tencent-connect/qqbot-nodejs":"1.0.4","@wecom/aibot-node-sdk":"1.0.7","dingtalk-stream":"2.1.4",qrcode:"1.5.4"},devDependencies:{"@larksuiteoapi/node-sdk":"1.73.0","@whiskeysockets/baileys":"7.0.0-rc14",esbuild:"0.25.9","https-proxy-agent":"5.0.1",react:"18.3.1","react-dom":"18.3.1","react-test-renderer":"18.3.1"}};var Cce=/^\/(?:stop|steer|version)(?=$|\s)/iu,uce=/^\/stop(?=$|\s)/iu,Bce=/^\/version(?=$|\s)/iu,fce="\u7528\u6CD5\uFF1A/stop\uFF08\u4E0D\u5E26\u53C2\u6570\uFF09",Qce="\u7528\u6CD5\uFF1A/version\uFF08\u4E0D\u5E26\u53C2\u6570\uFF09",yce="\u7528\u6CD5\uFF1A/steer <\u8865\u5145\u6307\u4EE4>",mce="\u63A7\u5236\u547D\u4EE4\u4EC5\u652F\u6301\u7EAF\u6587\u5B57\uFF0C\u8BF7\u79FB\u9664\u56FE\u7247\u540E\u91CD\u8BD5\u3002";function co(n,t={}){return{message:n,...t}}function LH(n){return n?{signal:n}:{}}function UH(n,t,o){if(typeof t?.sessionFor!="function")return null;let i=t.sessionFor(o);if(typeof i!="string"||!i)return null;if(typeof n?.workspaceSession!="function")throw new TypeError("Harness does not support workspace sessions");let e=n.workspaceSession(i);if(!e||typeof e!="object")throw new TypeError("Harness returned an invalid workspace session");return e}function Pi(n){return typeof n=="string"&&Cce.test(n.trim())}async function gi(n,t,o,i,{signal:e,hasImages:a=!1,pendingInteraction:A=!1,control:r}={}){if(!Pi(n))return null;let s=n.trim(),g=uce.test(s),c=Bce.test(s);if(a)return co(D(mce));if(c)return/^\/version$/iu.test(s)?co(`dsh-im v${FH.version}`):co(D(Qce));if(g){if(!/^\/stop$/iu.test(s))return co(D(fce));let Q=UH(t,o,i);if(!Q)return co(D("\u5F53\u524D\u804A\u5929\u6CA1\u6709\u6B63\u5728\u8FD0\u884C\u7684\u4EFB\u52A1\u3002"));if(typeof Q.stopActiveTurn!="function")throw new TypeError("Harness session does not support stopping active turns");return await Q.stopActiveTurn(r,LH(e))?co(D("\u5DF2\u8BF7\u6C42\u505C\u6B62\u5F53\u524D\u4EFB\u52A1\u3002"),{stopped:!0}):co(D("\u5F53\u524D\u804A\u5929\u6CA1\u6709\u6B63\u5728\u8FD0\u884C\u7684\u4EFB\u52A1\u3002"))}let d=/^\/steer(?:\s+([\s\S]*))?$/iu.exec(s)?.[1]?.trim()??"";if(!d)return co(D(yce));if(A)return co([D("\u5F53\u524D\u4EFB\u52A1\u6B63\u5728\u7B49\u5F85\u4F60\u7684\u56DE\u7B54\u6216\u5BA1\u6279\u3002"),"",D("\u8BF7\u5148\u5904\u7406\u5F53\u524D\u8BF7\u6C42\uFF0C\u6216\u8005\u53D1\u9001 /stop \u505C\u6B62\u4EFB\u52A1\u3002")].join(` +`)}function kH(n,t){return{ok:!0,value:{sessionId:n.sessionId,approvalId:n.approvalId,outcome:t}}}function pf(n){return n==="allowed-once"?D("\u5DF2\u6279\u51C6\uFF0C\u4EC5\u5BF9\u672C\u6B21\u64CD\u4F5C\u6709\u6548\u3002"):n==="rejected"?D("\u5DF2\u62D2\u7EDD\u6B64\u6B21\u64CD\u4F5C\u3002"):D(Gl)}var ii=class{#e;#A;#t=new Map;#r=new Map;#a=new Map;constructor({label:t="IM",logger:o=console}={}){this.#e=t,this.#A=o}hasPending(t){return this.#r.get(t)?.items.some(o=>!o.inactive)===!0}claimReply({key:t,actor:o,text:i,addressed:e=!0,hasPendingQuestion:a=!1,questionCompletion:A,isQuestionPending:r,send:s}){let c=this.#r.get(t)?.items[0],I=nce(i),d=(f,Q=!1)=>({...Q?{resolved:!0}:{},process:async y=>{typeof y=="function"&&await y()===!1||await s(f)}}),B=a&&c&&A&&typeof A.then=="function";return a&&!B?null:!c||c.inactive?(this.#a.get(t)??0)<=Date.now()?(this.#a.delete(t),null):I?d(D(Gl),!0):null:c.actor!==o||c.requiresMention&&e!==!0?I?d(D("\u53EA\u6709\u53D1\u8D77\u5F53\u524D\u4EFB\u52A1\u7684\u7528\u6237\u53EF\u4EE5\u5904\u7406\u8FD9\u6761\u5BA1\u6279\u3002")):null:{process:async f=>{let Q=c.presented,m=(c.replyTail??Promise.resolve()).catch(()=>{}).then(async()=>{if(!(typeof f=="function"&&await f()===!1)){if(B){if(await A.catch(()=>{}),c.inactive||c.resolving)return;if(typeof r=="function"&&r()){await s(D(ace));return}}if(await c.activationTask?.catch(()=>{}),await c.presentationTask?.catch(()=>{}),c.inactive||c.resolving){await s(D(Gl));return}if(c.send=s,!Q||!c.presented){if(c.presented||await this.#i(c),c.inactive||c.resolving)return;await s(D(kb));return}if(c.submitting){await s(D("\u5BA1\u6279\u51B3\u5B9A\u6B63\u5728\u63D0\u4EA4\uFF0C\u8BF7\u7A0D\u5019\u3002"));return}if(!I){await s(D(kb));return}await this.#c(c,I)}});c.replyTail=m;try{await m}finally{c.replyTail===m&&(c.replyTail=null)}}}}async handleRequested(t,o){if(t?.kind!=="approval")return!1;let i=t.payload,e=wa(i?.approvalId);if(!wa(t.rpcId)||!wa(t.sessionId)||!e||!vH(i)||i.sessionId!==t.sessionId||typeof t.respond!="function")return this.#A.warn?.(`[dsh-im:${this.#e}] ignored an invalid Harness approval`),!0;if(t.recovered===!0)return await this.#g(t,i),!0;let a=this.#t.get(e);if(a)return a.interaction=t,a.toolCall=t.toolCall,a.presented||await this.#i(a),!0;let A=o?.send,r=wa(o?.key),s=wa(o?.actor);if(!r||!s||typeof A!="function")return this.#A.warn?.(`[dsh-im:${this.#e}] ignored an approval without a reply route`),await this.#g(t,i),!0;let g=Pb(i,{toolCall:t.toolCall,requiresMention:o.requiresMention===!0});if(!g){let d=await this.#g(t,i);return await A(d?D("\u65E0\u6CD5\u5B8C\u6574\u5C55\u793A\u8FD9\u6B21\u64CD\u4F5C\uFF0C\u5DF2\u5B89\u5168\u62D2\u7EDD\u6B64\u6B21\u5BA1\u6279\u3002"):D(Gl)),!0}let c={approvalId:e,sessionId:t.sessionId,interaction:t,toolCall:t.toolCall,key:r,actor:s,requiresMention:o.requiresMention===!0,send:A,text:g,presented:!1,presentationTask:null,deliveryCompleted:!1,replyTail:null,submitting:!1,inactive:!1,resolving:!1,closedOutcome:null,resolutionNotified:!1,activationTask:null};this.#t.set(e,c);let I=this.#r.get(r)??{items:[]};return I.items.push(c),this.#r.set(r,I),I.items[0]===c&&await this.#i(c),!0}async handleResolved(t){if(t?.kind!=="approval")return!1;let o=this.#t.get(wa(t.interactionId));if(!o||(o.resolving=!0,o.activationTask&&await o.activationTask.catch(()=>{}),o.inactive||this.#t.get(o.approvalId)!==o))return!0;let i=o.presentationTask,e=o.presented||i,a=o.send,A=this.#o(o);return await this.#s(A,async()=>{let r=o.presented;i&&(r=await i.then(()=>!0,()=>!1)),e&&r&&(o.resolutionNotified=!0,await a(pf(t.outcome)).catch(()=>{}))}),!0}async closeRoute(t){let o=this.#r.get(t);if(!o)return;let i=[...o.items];for(let e of i)this.#o(e);await Promise.all(i.map(async e=>{try{await e.interaction.respond(kH(e,"rejected"),{signal:AbortSignal.timeout(5e3)}),e.closedOutcome="rejected",(e.presented||e.deliveryCompleted)&&!e.resolutionNotified&&(e.resolutionNotified=!0,await e.send(pf("rejected")).catch(()=>{}))}catch(a){a?.code==="interaction-not-pending"?(e.closedOutcome="resolved",(e.presented||e.deliveryCompleted)&&!e.resolutionNotified&&(e.resolutionNotified=!0,await e.send(D(Gl)).catch(()=>{}))):this.#A.warn?.(`[dsh-im:${this.#e}] failed to reject a closing approval:`,a)}}))}async#i(t){if(this.#r.get(t.key)?.items[0]!==t||t.inactive||t.resolving||t.presented||(await t.activationTask?.catch(()=>{}),this.#r.get(t.key)?.items[0]!==t||t.inactive||t.resolving||t.presented))return;if(t.presentationTask)return t.presentationTask;let o=Promise.resolve().then(()=>t.send(t.text));t.presentationTask=o;try{await o,t.deliveryCompleted=!0,t.inactive?t.closedOutcome&&!t.resolutionNotified&&(t.resolutionNotified=!0,await t.send(pf(t.closedOutcome)).catch(()=>{})):t.presented=!0}finally{t.presentationTask===o&&(t.presentationTask=null)}}async#c(t,o){t.submitting=!0;try{await t.interaction.respond(kH(t,o))}catch(a){if(a?.code==="interaction-not-pending"){let A=t.send,r=this.#o(t);await this.#s(r,async()=>{t.resolutionNotified||await A(D(Gl)).catch(()=>{})});return}if(t.inactive)return;t.submitting=!1,this.#A.error?.(`[dsh-im:${this.#e}] failed to submit an approval:`,a),await t.send(D("\u5BA1\u6279\u63D0\u4EA4\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u56DE\u590D\u300C\u6279\u51C6\u300D\u6216\u300C\u62D2\u7EDD\u300D\u3002")).catch(()=>{});return}let i=t.send,e=this.#o(t);await this.#s(e,async()=>{t.resolutionNotified||await i(pf(o)).catch(()=>{})})}async#s(t,o){let i,e=new Promise(a=>{i=a});t&&(t.activationTask=e);try{await o()}finally{i(),t?.activationTask===e&&(t.activationTask=null)}await this.#I(t)}async#I(t){if(t)try{await this.#i(t)}catch(o){this.#A.error?.(`[dsh-im:${this.#e}] failed to present the next approval:`,o);try{t.interaction.reconnect?.()}catch{}}}#o(t){if(t.inactive)return null;t.inactive=!0,this.#n(t.key),this.#t.delete(t.approvalId);let o=this.#r.get(t.key);if(!o)return null;let i=o.items[0]===t,e=o.items.indexOf(t);return e!==-1&&o.items.splice(e,1),o.items.length===0?(this.#r.delete(t.key),null):i?o.items[0]:null}#n(t){let o=Date.now();for(let[i,e]of this.#a)e<=o&&this.#a.delete(i);for(this.#a.delete(t),this.#a.set(t,o+ice);this.#a.size>oce;)this.#a.delete(this.#a.keys().next().value)}async#g(t,o){try{return await t.respond({ok:!0,value:{sessionId:t.sessionId,approvalId:o.approvalId,outcome:"rejected"}},{signal:AbortSignal.timeout(5e3)}),!0}catch(i){if(i?.code==="interaction-not-pending")return!1;throw i}}};var Gb=new WeakMap;function gce(n){let t=Gb.get(n);return t||(t=new Map,Gb.set(n,t)),t}async function Vc(n,t,o){let i=typeof n;if(i!=="object"&&i!=="function"||n===null)throw new TypeError("state is required");if(typeof t!="string"||!t)throw new TypeError("conversation key is required");if(typeof o!="function")throw new TypeError("operation is required");let e=gce(n),a=e.get(t)??Promise.resolve(),A,r=new Promise(s=>{A=s});e.set(t,r),await a;try{return await o()}finally{A(),e.get(t)===r&&(e.delete(t),e.size===0&&Gb.delete(n))}}var oi="workspace-session-stale";function PH(n,t){return typeof n.workspaceSession=="function"?n.workspaceSession(t):Object.freeze({sessionId:t,sessionExists:(...o)=>n.sessionExists(t,...o),models:(...o)=>n.getSessionModels(t,...o),selectModel:(...o)=>n.selectSessionModel(t,...o),isRunning:(...o)=>n.isSessionRunning(t,...o),hasActiveTurn:(...o)=>n.hasActiveTurn(t,...o),stopActiveTurn:(...o)=>n.stopActiveTurn(t,...o),steerActiveTurn:(...o)=>n.steerActiveTurn(t,...o),ask:(...o)=>n.ask(t,...o)})}async function cce(n,t){return t===void 0?n.sessionExists():n.sessionExists(t)}async function Ice(n,t){return t===void 0?n.createSession():n.createSession(t)}async function ni({harness:n,state:t,key:o,text:i,content:e,createOptions:a,existsOptions:A,askOptions:r}){for(;;)try{let s=await Vc(t,o,async()=>{let B=t.sessionFor(o),f=B?PH(n,B):null;if(!f||!await cce(f,A)){if(B=await Ice(n,a),await t.setSession(o,B)===!1)return null;f=PH(n,B)}return{sessionId:B,session:f}});if(!s)continue;let g=[],c=typeof r=="object"&&typeof r?.onArtifact=="function"?r.onArtifact:null,I=typeof r=="number"?{timeoutMs:r}:{...r};I.onArtifact=async B=>{g.push(B),await c?.(B)};let d=await s.session.ask(e??i,I);return{sessionId:s.sessionId,answer:d,...g.length>0?{artifacts:g}:{}}}catch(s){if(s?.code!==oi)throw s}}var lce=/^\/compact(?=$|\s)([\s\S]*)$/i,pce="\u7528\u6CD5\uFF1A/compact\uFF08\u4E0D\u5E26\u53C2\u6570\uFF09",GH=new Map([["No compactable history yet.","\u6682\u65E0\u53EF\u538B\u7F29\u7684\u5386\u53F2\u8BB0\u5F55\u3002"],["Compaction is unavailable because this process has an active compaction, or the agent is not idle.","\u5F53\u524D\u4F1A\u8BDD\u6B63\u5728\u751F\u6210\u56DE\u590D\u6216\u6267\u884C\u538B\u7F29\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"],["Compaction cancelled.","\u4E0A\u4E0B\u6587\u538B\u7F29\u5DF2\u53D6\u6D88\u3002"],["The history selected for compaction changed before it could be replaced. The conversation is unchanged; the attempt is recorded in the session log.","\u538B\u7F29\u671F\u95F4\u4F1A\u8BDD\u5386\u53F2\u53D1\u751F\u53D8\u5316\uFF0C\u672C\u6B21\u672A\u4FEE\u6539\u4F1A\u8BDD\uFF0C\u8BF7\u91CD\u8BD5\u3002"],["Compaction could not produce a useful summary. The conversation is unchanged; the attempt is recorded in the session log.","\u672A\u80FD\u751F\u6210\u6709\u6548\u7684\u538B\u7F29\u6458\u8981\uFF0C\u672C\u6B21\u672A\u4FEE\u6539\u4F1A\u8BDD\u3002"],["Compaction did not finish cleanly; some session history may have changed. Inspect the current session state before retrying.","\u4E0A\u4E0B\u6587\u538B\u7F29\u672A\u6B63\u5E38\u5B8C\u6210\uFF0C\u90E8\u5206\u4F1A\u8BDD\u5386\u53F2\u53EF\u80FD\u5DF2\u53D8\u5316\uFF0C\u8BF7\u68C0\u67E5\u4F1A\u8BDD\u540E\u518D\u91CD\u8BD5\u3002"],["Compaction finished, but the session could not be saved.","\u4E0A\u4E0B\u6587\u5DF2\u538B\u7F29\uFF0C\u4F46\u4F1A\u8BDD\u4FDD\u5B58\u5931\u8D25\u3002"]]);function Wc(n){return{handled:!0,message:n,messages:[n]}}function dce(n){if(!n||typeof n!="object"||!["success","error"].includes(n.kind)||n.text!==void 0&&typeof n.text!="string")throw new TypeError("Harness returned an invalid /compact result");let t=n.text?.trim()??"",o=/^Compacted (\d+) history items \(~(\d+) tokens\)\.$/u.exec(t);return o?D("\u5DF2\u538B\u7F29 {count} \u6761\u5386\u53F2\u8BB0\u5F55\uFF08\u7EA6 {tokens} \u4E2A token\uFF09\u3002",{count:o[1],tokens:o[2]}):GH.has(t)?D(GH.get(t)):t||(n.kind==="success"?D("\u4E0A\u4E0B\u6587\u538B\u7F29\u5B8C\u6210\u3002"):D("\u4E0A\u4E0B\u6587\u538B\u7F29\u5931\u8D25\u3002"))}function hce(n){let t=n?.code??n?.failure?.code;return t==="session-not-found"?D("\u5F53\u524D\u804A\u5929\u7ED1\u5B9A\u7684\u4F1A\u8BDD\u5DF2\u4E0D\u5B58\u5728\uFF0C\u8BF7\u53D1\u9001\u65B0\u6D88\u606F\u5F00\u542F\u4F1A\u8BDD\u3002"):t==="agent-busy"?D("\u5F53\u524D\u4F1A\u8BDD\u6B63\u5728\u751F\u6210\u56DE\u590D\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"):t==="cancelled"||n?.name==="AbortError"?D("\u4E0A\u4E0B\u6587\u538B\u7F29\u5DF2\u53D6\u6D88\u3002"):t===oi||t==="workspace-bot-not-found"?D("\u5DE5\u4F5C\u533A\u6216\u673A\u5668\u4EBA\u72B6\u6001\u5DF2\u53D1\u751F\u53D8\u5316\uFF0C\u8BF7\u91CD\u8BD5\u3002"):t==="commands-unavailable"?D("\u5F53\u524D Harness \u6682\u4E0D\u652F\u6301\u4ECE\u673A\u5668\u4EBA\u6267\u884C\u4E0A\u4E0B\u6587\u538B\u7F29\u3002"):D("\u4E0A\u4E0B\u6587\u538B\u7F29\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002")}async function si(n,t,o,i,e={}){if(typeof n!="string")return null;let a=lce.exec(n.trim());if(!a)return null;if(a[1].trim())return Wc(D(pce));if(typeof o?.sessionFor!="function")return Wc(D("\u5F53\u524D\u673A\u5668\u4EBA\u6CA1\u6709\u53EF\u7528\u7684\u4F1A\u8BDD\u72B6\u6001\u3002"));let A=o.sessionFor(i);if(typeof A!="string"||!A)return Wc(D("\u5F53\u524D\u804A\u5929\u8FD8\u6CA1\u6709\u53EF\u538B\u7F29\u7684\u4F1A\u8BDD\uFF0C\u8BF7\u5148\u53D1\u9001\u4E00\u6761\u6D88\u606F\u3002"));if(typeof t?.executeCommand!="function")return Wc(D("\u5F53\u524D\u673A\u5668\u4EBA\u6682\u4E0D\u652F\u6301\u4E0A\u4E0B\u6587\u538B\u7F29\u3002"));try{let r=await t.executeCommand(A,"/compact",e);return Wc(r===void 0?D("\u5F53\u524D Harness \u672A\u6CE8\u518C /compact \u547D\u4EE4\uFF0C\u8BF7\u786E\u8BA4\u4E0A\u4E0B\u6587\u538B\u7F29\u7EC4\u4EF6\u5DF2\u542F\u7528\u3002"):dce(r?.result))}catch(r){return Wc(hce(r))}}var FH={name:"@xmanrui/dsh-im",version:"2.6.0",description:"\u628A\u4E5D\u79CD IM \u673A\u5668\u4EBA\u548C\u516C\u7F51 AI Office \u63A5\u5165\u672C\u673A DeepSeek Harness\u3002 Connect nine IM channels and a public AI Office to a local DeepSeek Harness.",keywords:["deepseek-harness","dsh","dsh-plugin","ai-agent","im","instant-messaging","chatbot","feishu","lark","wechat","wecom","dingtalk","qq","slack","telegram","discord","whatsapp","ai-office"],author:{name:"xmanrui",url:"https://github.com/xmanrui"},contributors:[{name:"C3H3-AI",url:"https://github.com/C3H3-AI"}],license:"MIT",type:"module",repository:{type:"git",url:"git+https://github.com/xmanrui/dsh-im.git"},homepage:"https://github.com/xmanrui/dsh-im#readme",bugs:"https://github.com/xmanrui/dsh-im/issues",publishConfig:{access:"public"},bin:{"dsh-im":"bin/dsh-im.mjs"},main:"./lib/index.js",exports:{".":"./lib/index.js","./client":"./lib/client.js","./package.json":"./package.json"},files:["assets","bin","cordis.patch.yml","lib","plugin-src","scripts","src","LICENSE","README.md","README.en.md","THIRD_PARTY_NOTICES.md"],dsh:{bundle:{patch:"./cordis.patch.yml"},client:{inject:["@deepseek-ai/dsh-client-connection","@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-ui-settings","@deepseek-ai/dsh-client-ui-slots","@deepseek-ai/dsh-client-locale"],platform:"web"}},scripts:{build:"node plugin-src/client/build.mjs && node plugin-src/host/build.mjs",test:"node --test test/*.test.mjs test/channels/*/*.test.mjs",check:"npm run build && npm test && node scripts/verify-package.mjs"},engines:{node:">=22.19"},dependencies:{"@tencent-connect/qqbot-connector":"1.2.0","@tencent-connect/qqbot-nodejs":"1.0.4","@wecom/aibot-node-sdk":"1.0.7","dingtalk-stream":"2.1.4",qrcode:"1.5.4"},devDependencies:{"@larksuiteoapi/node-sdk":"1.73.0","@whiskeysockets/baileys":"7.0.0-rc14",esbuild:"0.25.9","https-proxy-agent":"5.0.1",react:"18.3.1","react-dom":"18.3.1","react-test-renderer":"18.3.1"}};var Cce=/^\/(?:stop|steer|version)(?=$|\s)/iu,uce=/^\/stop(?=$|\s)/iu,Bce=/^\/version(?=$|\s)/iu,fce="\u7528\u6CD5\uFF1A/stop\uFF08\u4E0D\u5E26\u53C2\u6570\uFF09",Qce="\u7528\u6CD5\uFF1A/version\uFF08\u4E0D\u5E26\u53C2\u6570\uFF09",yce="\u7528\u6CD5\uFF1A/steer <\u8865\u5145\u6307\u4EE4>",mce="\u63A7\u5236\u547D\u4EE4\u4EC5\u652F\u6301\u7EAF\u6587\u5B57\uFF0C\u8BF7\u79FB\u9664\u56FE\u7247\u540E\u91CD\u8BD5\u3002";function co(n,t={}){return{message:n,...t}}function LH(n){return n?{signal:n}:{}}function UH(n,t,o){if(typeof t?.sessionFor!="function")return null;let i=t.sessionFor(o);if(typeof i!="string"||!i)return null;if(typeof n?.workspaceSession!="function")throw new TypeError("Harness does not support workspace sessions");let e=n.workspaceSession(i);if(!e||typeof e!="object")throw new TypeError("Harness returned an invalid workspace session");return e}function Pi(n){return typeof n=="string"&&Cce.test(n.trim())}async function gi(n,t,o,i,{signal:e,hasImages:a=!1,pendingInteraction:A=!1,control:r}={}){if(!Pi(n))return null;let s=n.trim(),g=uce.test(s),c=Bce.test(s);if(a)return co(D(mce));if(c)return/^\/version$/iu.test(s)?co(`dsh-im v${FH.version}`):co(D(Qce));if(g){if(!/^\/stop$/iu.test(s))return co(D(fce));let Q=UH(t,o,i);if(!Q)return co(D("\u5F53\u524D\u804A\u5929\u6CA1\u6709\u6B63\u5728\u8FD0\u884C\u7684\u4EFB\u52A1\u3002"));if(typeof Q.stopActiveTurn!="function")throw new TypeError("Harness session does not support stopping active turns");return await Q.stopActiveTurn(r,LH(e))?co(D("\u5DF2\u8BF7\u6C42\u505C\u6B62\u5F53\u524D\u4EFB\u52A1\u3002"),{stopped:!0}):co(D("\u5F53\u524D\u804A\u5929\u6CA1\u6709\u6B63\u5728\u8FD0\u884C\u7684\u4EFB\u52A1\u3002"))}let d=/^\/steer(?:\s+([\s\S]*))?$/iu.exec(s)?.[1]?.trim()??"";if(!d)return co(D(yce));if(A)return co([D("\u5F53\u524D\u4EFB\u52A1\u6B63\u5728\u7B49\u5F85\u4F60\u7684\u56DE\u7B54\u6216\u5BA1\u6279\u3002"),"",D("\u8BF7\u5148\u5904\u7406\u5F53\u524D\u8BF7\u6C42\uFF0C\u6216\u8005\u53D1\u9001 /stop \u505C\u6B62\u4EFB\u52A1\u3002")].join(` `));let B=UH(t,o,i);if(!B)return co(D("\u5F53\u524D\u804A\u5929\u6CA1\u6709\u7ED1\u5B9A\u4F1A\u8BDD\uFF0C\u65E0\u6CD5\u8865\u5145\u6307\u4EE4\u3002\u8BF7\u5148\u7ED1\u5B9A\u4F1A\u8BDD\u3002"));if(typeof B.steerActiveTurn!="function")throw new TypeError("Harness session does not support steering active turns");let f=await B.steerActiveTurn(d,r,LH(e));return co(f?D("\u5DF2\u63D0\u4EA4\u8865\u5145\u6307\u4EE4\uFF0CAgent \u4F1A\u5728\u4E0B\u4E00\u6B65\u8BFB\u53D6\u3002"):D("\u4EFB\u52A1\u5DF2\u7ED3\u675F\uFF0C\u6CA1\u6709\u6B63\u5728\u8FD0\u884C\u7684\u4EFB\u52A1\uFF0C\u65E0\u6CD5\u8865\u5145\u6307\u4EE4\u3002\u8BF7\u76F4\u63A5\u53D1\u9001\u6D88\u606F\u5F00\u59CB\u65B0\u4EFB\u52A1\u3002"))}import{realpath as xH,stat as YH}from"node:fs/promises";import{isAbsolute as jH,resolve as Sce}from"node:path";var Dce=/^\/workspace(?:\s+([\s\S]+))?$/i,wce=/^\/workspacelist(?:\s+([\s\S]+))?$/i,Oce=/^\/sessionlist(?:\s+([\s\S]+))?$/i,bce=/^\/session(?=$|\s)/i,Mce=/^\/session[ \t]+([^\s]+)$/i,_ce=4096,Tce=1800,Nce=256,JH=/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]/u,Rce=/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]+/gu,qH="\u7528\u6CD5\uFF1A/session Session ID \u6216\u5F53\u524D\u5DE5\u4F5C\u533A\u5E8F\u53F7\uFF08/session N\uFF09",Fl=["\u7528\u6CD5\uFF1A","/sessionlist \u5217\u51FA\u5F53\u524D\u5DE5\u4F5C\u533A\u4F1A\u8BDD","/sessionlist \u5DE5\u4F5C\u533A\u5E8F\u53F7 \u6309 /workspacelist \u5E8F\u53F7\u5217\u51FA\u4F1A\u8BDD","/sessionlist \u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84 \u5217\u51FA\u6307\u5B9A\u5DE5\u4F5C\u533A\u4F1A\u8BDD"].join(` `);function Pt(n,t=[n]){return{handled:!0,message:n,messages:t}}function Ll(n){return typeof n!="string"||n.length>_ce||!jH(n)||JH.test(n)?null:Sce(n)}function df(n){return typeof n!="string"?"":n.replace(Rce," ").replace(/\s+/gu," ").trim()}function HH(n){return typeof n=="string"&&n.length>0&&n.length<=Nce&&!new RegExp("\\p{White_Space}","u").test(n)&&!JH.test(n)}async function Fb(n){let t=await Promise.all(n.map(async o=>{let i=Ll(o);if(!i)return null;try{return(await YH(i)).isDirectory()?Ll(await xH(i)):null}catch{return null}}));return[...new Set(t.filter(Boolean))]}async function Lb(n){if(typeof n!="string"||!jH(n.trim()))return{error:D(`\u5DE5\u4F5C\u533A\u5FC5\u987B\u662F\u7EDD\u5BF9\u8DEF\u5F84\u3002 {usage}`,{usage:D(Fl)})};let t=Ll(n.trim());if(!t)return{error:D(`\u5DE5\u4F5C\u533A\u8DEF\u5F84\u5305\u542B\u4E0D\u652F\u6301\u7684\u5B57\u7B26\u6216\u957F\u5EA6\u8D85\u8FC7\u9650\u5236\u3002 @@ -318,7 +318,7 @@ ${i.length>0?i.join(` `,resources:[]};let a=[];e.topic&&a.push(e.topic);for(let A of(i=e.options)!==null&&i!==void 0?i:[])a.push(`\u2022 ${A}`);return{content:` ${a.join(` `)} -`,resources:[]}}),t_e=new Map([["text",ZMe],["post",jMe],["image",FMe],["file",vMe],["audio",TMe],["video",$8],["media",$8],["sticker",VMe],["interactive",UMe],["merge_forward",KMe],["share_chat",qMe],["share_user",zMe],["location",HMe],["system",WMe],["vote",A_e],["todo",XMe],["calendar",NMe],["general_calendar",RMe],["share_calendar_event",kMe],["folder",PMe],["hongbao",GMe],["video_chat",e_e]]);function ez(n,t,o){var i;return h(this,void 0,void 0,function*(){let e=(i=t_e.get(t))!==null&&i!==void 0?i:X8;try{return yield e(n,o)}catch{return X8(n)}})}function Qz(n,t){var o,i,e,a,A,r,s,g,c,I,d,B;let f=(i=(o=n.context)===null||o===void 0?void 0:o.open_message_id)!==null&&i!==void 0?i:n.open_message_id,Q=(a=(e=n.context)===null||e===void 0?void 0:e.open_chat_id)!==null&&a!==void 0?a:n.open_chat_id,y=(A=n.operator)===null||A===void 0?void 0:A.open_id;return!f||!Q||!y?null:{messageId:f,chatId:Q,operator:{openId:y,userId:(r=n.operator)===null||r===void 0?void 0:r.user_id,name:(s=n.operator)===null||s===void 0?void 0:s.name},action:{value:(g=n.action)===null||g===void 0?void 0:g.value,tag:(I=(c=n.action)===null||c===void 0?void 0:c.tag)!==null&&I!==void 0?I:"unknown",name:(d=n.action)===null||d===void 0?void 0:d.name,option:(B=n.action)===null||B===void 0?void 0:B.option},raw:t?.includeRaw?n:void 0}}function fk(n,t,o){var i,e,a,A;let r=n.message_id,s=(i=n.reaction_type)===null||i===void 0?void 0:i.emoji_type,g=(e=n.user_id)===null||e===void 0?void 0:e.open_id;if(!r||!s||!g)return null;let c=n.action_time,I=c?parseInt(c,10):void 0;return{messageId:r,operator:{openId:g,userId:(A=(a=n.user_id)===null||a===void 0?void 0:a.user_id)!==null&&A!==void 0?A:void 0},emojiType:s,action:t,actionTime:I!=null&&Number.isFinite(I)?I:void 0,raw:o?.includeRaw?n:void 0}}function yz(n,t){var o,i,e,a,A,r,s,g,c;let I=n.chat_id,d=(o=n.operator_id)===null||o===void 0?void 0:o.open_id;if(!I||!d)return null;let B=(r=(a=(i=n.name)!==null&&i!==void 0?i:(e=n.i18n_names)===null||e===void 0?void 0:e.zh_cn)!==null&&a!==void 0?a:(A=n.i18n_names)===null||A===void 0?void 0:A.en_us)!==null&&r!==void 0?r:(s=n.i18n_names)===null||s===void 0?void 0:s.ja_jp;return{chatId:I,operator:{openId:d,userId:(c=(g=n.operator_id)===null||g===void 0?void 0:g.user_id)!==null&&c!==void 0?c:void 0},botName:B,external:n.external,raw:t?.includeRaw?n:void 0}}function mz(n,t){var o,i,e,a,A,r,s,g,c,I,d,B,f;let Q=(o=n.file_token)!==null&&o!==void 0?o:(i=n.notice_meta)===null||i===void 0?void 0:i.file_token,y=(e=n.file_type)!==null&&e!==void 0?e:(a=n.notice_meta)===null||a===void 0?void 0:a.file_type,m=n.comment_id,_=(r=(A=n.notice_meta)===null||A===void 0?void 0:A.from_user_id)!==null&&r!==void 0?r:n.user_id,N=_?.open_id;if(!Q||!y||!m||!N)return null;let G=(c=(s=n.create_time)!==null&&s!==void 0?s:(g=n.notice_meta)===null||g===void 0?void 0:g.timestamp)!==null&&c!==void 0?c:n.action_time,Y=G?parseInt(G,10):Date.now();return{fileToken:Q,fileType:y,commentId:m,replyId:n.reply_id,operator:{openId:N,userId:(I=_?.user_id)!==null&&I!==void 0?I:void 0,unionId:_?.union_id},mentionedBot:!!((f=(d=n.is_mentioned)!==null&&d!==void 0?d:(B=n.notice_meta)===null||B===void 0?void 0:B.is_mentioned)!==null&&f!==void 0?f:n.is_mention),timestamp:Number.isFinite(Y)?Y:Date.now(),raw:t?.includeRaw?n:void 0}}function Sz(n,t){var o,i,e,a,A;return h(this,void 0,void 0,function*(){let r=n.message,s=(o=t.botIdentity)===null||o===void 0?void 0:o.openId,{mentions:g,mentionsByOpenId:c,mentionList:I,mentionAll:d,mentionedBot:B}=mMe(r.mentions,s),f=d||r_e(r.content),Q={messageId:r.message_id,botOpenId:s,mentions:g,mentionsByOpenId:c,stripBotMentions:(i=t.stripBotMentions)!==null&&i!==void 0?i:!0,fetchSubMessages:t.fetchSubMessages,resolveUserName:t.resolveUserName,batchResolveNames:t.batchResolveNames,dispatch:ez},{content:y,resources:m}=yield ez(r.content,r.message_type,Q),_=SMe(y,Q),N=n.sender.sender_id.open_id,G=(a=(e=n.sender.sender_id.user_id)!==null&&e!==void 0?e:n.sender.sender_id.union_id)!==null&&a!==void 0?a:"",Y=N??G,j=N?(A=t.resolveSenderName)===null||A===void 0?void 0:A.call(t,N):void 0,H=r.create_time?parseInt(r.create_time,10):0;return{messageId:r.message_id,chatId:r.chat_id,chatType:r.chat_type,senderId:Y,senderName:j,content:_,rawContentType:r.message_type,resources:m,mentions:I,mentionAll:f,mentionedBot:B,rootId:r.root_id,threadId:r.thread_id,replyToMessageId:r.parent_id,createTime:Number.isFinite(H)?H:0,raw:t.includeRaw?n:void 0}})}function r_e(n){return n?/@_all\b/.test(n):!1}var Fy=class{constructor(t){var o,i,e,a,A,r,s;this.handlers={},this.connected=!1,this.opts=t,this.logger=new Xg((o=t.loggerLevel)!==null&&o!==void 0?o:ji.info,(i=t.logger)!==null&&i!==void 0?i:Zs),this.rawClient=new _y({appId:t.appId,appSecret:t.appSecret,domain:(e=t.domain)!==null&&e!==void 0?e:zn.Feishu,cache:t.cache,httpInstance:t.httpInstance,logger:t.logger,loggerLevel:t.loggerLevel,source:t.source,extraUaTags:["channel"]}),this.dispatcher=new Ny({verificationToken:(a=t.webhook)===null||a===void 0?void 0:a.verificationToken,encryptKey:(A=t.webhook)===null||A===void 0?void 0:A.encryptKey,cache:t.cache,logger:t.logger,loggerLevel:t.loggerLevel}),this.sender=new pk(this.rawClient,(r=t.outbound)!==null&&r!==void 0?r:{},this.logger),this.safety=new Bk({config:t.safety,policy:t.policy,cache:(s=t.cache)!==null&&s!==void 0?s:wC,logger:this.logger,onReject:g=>{var c,I;(I=(c=this.handlers).reject)===null||I===void 0||I.call(c,g)},onMessage:g=>h(this,void 0,void 0,function*(){let c=this.handlers.message;c&&(yield c(g))})})}connect(){return h(this,void 0,void 0,function*(){return this.connectPromise?this.connectPromise:(this.connectPromise=this.doConnect().catch(t=>{throw this.connectPromise=void 0,t}),this.connectPromise)})}doConnect(){var t;return h(this,void 0,void 0,function*(){this.botIdentity=yield this.fetchBotIdentity(),this.safety.setBotIdentity(this.botIdentity),this.registerDispatcherHandlers(),((t=this.opts.transport)!==null&&t!==void 0?t:"websocket")==="websocket"&&(yield this.connectWebSocket(15e3)),this.connected=!0})}connectWebSocket(t){return new Promise((o,i)=>{var e;let a=!1,A=setTimeout(()=>{a||(a=!0,i(new Rt("not_connected",`WebSocket handshake did not complete within ${t}ms`)))},t);this.rawWsClient=new ky({appId:this.opts.appId,appSecret:this.opts.appSecret,domain:(e=this.opts.domain)!==null&&e!==void 0?e:zn.Feishu,logger:this.opts.logger,loggerLevel:this.opts.loggerLevel,httpInstance:this.opts.httpInstance,autoReconnect:!0,source:this.opts.source,extraUaTags:["channel"],agent:this.opts.agent,wsConfig:this.opts.wsConfig,handshakeTimeoutMs:this.opts.handshakeTimeoutMs,onReady:()=>{a||(a=!0,clearTimeout(A),o())},onError:r=>{a||(a=!0,clearTimeout(A),i(new Rt("not_connected",`WebSocket connect failed: ${r.message}`,{cause:r})))},onReconnecting:()=>{var r,s;return(s=(r=this.handlers).reconnecting)===null||s===void 0?void 0:s.call(r)},onReconnected:()=>{var r,s;return(s=(r=this.handlers).reconnected)===null||s===void 0?void 0:s.call(r)}}),this.rawWsClient.start({eventDispatcher:this.dispatcher})})}disconnect(){var t;return h(this,void 0,void 0,function*(){if(this.connected){try{(t=this.rawWsClient)===null||t===void 0||t.close({})}catch{}try{yield this.safety.dispose()}catch{}this.connected=!1,this.connectPromise=void 0}})}getConnectionStatus(){var t;return(t=this.rawWsClient)===null||t===void 0?void 0:t.getConnectionStatus()}on(t,o){if(typeof t=="string")return this.attachSingle(t,o);let i=[];return Object.keys(t).forEach(e=>{let a=t[e];a&&i.push(this.attachSingle(e,a))}),()=>i.forEach(e=>e())}attachSingle(t,o){return this.handlers[t]&&this.logger.warn(`channel: handler for "${t}" is being overwritten`),this.handlers[t]=o,()=>{this.handlers[t]===o&&delete this.handlers[t]}}send(t,o,i){return h(this,void 0,void 0,function*(){return this.sender.send(t,o,i)})}stream(t,o,i){return h(this,void 0,void 0,function*(){return this.sender.stream(t,o,i)})}updateCard(t,o){return h(this,void 0,void 0,function*(){yield this.sender.patchCard(t,o)})}editMessage(t,o){return h(this,void 0,void 0,function*(){yield this.rawClient.im.v1.message.update({path:{message_id:t},data:{msg_type:"text",content:JSON.stringify({text:o})}})})}recallMessage(t){return h(this,void 0,void 0,function*(){yield this.rawClient.im.v1.message.delete({path:{message_id:t}})})}addReaction(t,o){var i,e;return h(this,void 0,void 0,function*(){let a=yield this.rawClient.im.v1.messageReaction.create({path:{message_id:t},data:{reaction_type:{emoji_type:o}}}),A=(e=(i=a?.data)===null||i===void 0?void 0:i.reaction_id)!==null&&e!==void 0?e:a?.reaction_id;if(!A)throw new Rt("unknown","messageReaction.create returned no reaction_id");return A})}removeReaction(t,o){return h(this,void 0,void 0,function*(){yield this.rawClient.im.v1.messageReaction.delete({path:{message_id:t,reaction_id:o}})})}removeReactionByEmoji(t,o){var i,e;return h(this,void 0,void 0,function*(){let a=yield this.rawClient.im.v1.messageReaction.list({path:{message_id:t},params:{reaction_type:o,page_size:50}}),r=((e=(i=a?.data)===null||i===void 0?void 0:i.items)!==null&&e!==void 0?e:[]).find(s=>{var g;return((g=s.operator)===null||g===void 0?void 0:g.operator_type)==="app"});return r?.reaction_id?(yield this.removeReaction(t,r.reaction_id),!0):!1})}downloadResource(t,o){return h(this,void 0,void 0,function*(){if(o==="image"){let e=yield this.rawClient.im.v1.image.get({path:{image_key:t}});return yield Az(e)}let i=yield this.rawClient.im.v1.file.get({path:{file_key:t}});return yield Az(i)})}getChatInfo(t){var o,i;return h(this,void 0,void 0,function*(){let a=(o=(yield this.rawClient.im.v1.chat.get({path:{chat_id:t}})).data)!==null&&o!==void 0?o:{};return{chatId:t,name:a.name,description:a.description,chatType:(i=a.chat_mode)!==null&&i!==void 0?i:"group",ownerId:a.owner_id,memberCount:a.user_count}})}getChatMode(t){var o;return h(this,void 0,void 0,function*(){let e=(o=(yield this.rawClient.im.v1.chat.get({path:{chat_id:t}})).data)===null||o===void 0?void 0:o.chat_mode;return e==="p2p"?"p2p":e==="topic"?"topic":"group"})}updatePolicy(t){this.safety.updatePolicy(t)}getPolicy(){return this.safety.getPolicy()}fetchBotIdentity(){var t;return h(this,void 0,void 0,function*(){let o;try{let a=yield this.rawClient.request({url:"/open-apis/bot/v3/info",method:"GET"}),A=a.bot;if(A?.open_id)return{openId:A.open_id,name:(t=A.app_name)!==null&&t!==void 0?t:"bot"};o=new Error(`bot/v3/info response missing open_id: ${JSON.stringify(a).slice(0,200)}`)}catch(a){o=a}let i=Mk(o),e=i.code==="unknown"?"not_connected":i.code;throw new Rt(e,"could not resolve bot identity via /open-apis/bot/v3/info \u2014 required for channel to function",{cause:o})})}registerDispatcherHandlers(){var t,o;let i=A=>h(this,void 0,void 0,function*(){var r,s,g,c;try{return(s=(r=(yield this.rawClient.im.v1.message.get({path:{message_id:A}})).data)===null||r===void 0?void 0:r.items)!==null&&s!==void 0?s:[]}catch(I){return(c=(g=this.logger).warn)===null||c===void 0||c.call(g,"channel: fetchSubMessages failed",I),[]}}),e=(o=(t=this.opts.includeRawEvent)!==null&&t!==void 0?t:this.opts.includeRawInMessage)!==null&&o!==void 0?o:!1,a={botIdentity:this.botIdentity,stripBotMentions:!0,includeRaw:e,fetchSubMessages:i};this.dispatcher.register({"im.message.receive_v1":A=>h(this,void 0,void 0,function*(){try{let r=yield Sz(A,a);yield this.safety.pushMessage(r)}catch(r){this.emitError(r)}}),"card.action.trigger":A=>h(this,void 0,void 0,function*(){let r=Qz(A,{includeRaw:e});if(!r)return;let s=o_e(r.action);yield this.safety.pushAction(`card:${r.messageId}:${r.operator.openId}:${s}`,r.chatId,()=>h(this,void 0,void 0,function*(){let g=this.handlers.cardAction;g&&(yield g(r))}))}),"im.message.reaction.created_v1":A=>h(this,void 0,void 0,function*(){let r=fk(A,"added",{includeRaw:e});if(!r)return;let s=tz(r);yield this.safety.pushLight(s,()=>{var g,c;return(c=(g=this.handlers).reaction)===null||c===void 0?void 0:c.call(g,r)})}),"im.message.reaction.deleted_v1":A=>h(this,void 0,void 0,function*(){let r=fk(A,"removed",{includeRaw:e});if(!r)return;let s=tz(r);yield this.safety.pushLight(s,()=>{var g,c;return(c=(g=this.handlers).reaction)===null||c===void 0?void 0:c.call(g,r)})}),"im.chat.member.bot.added_v1":A=>{var r,s;let g=yz(A,{includeRaw:e});if(g)try{(s=(r=this.handlers).botAdded)===null||s===void 0||s.call(r,g)}catch(c){this.emitError(c)}},"drive.notice.comment_add_v1":A=>h(this,void 0,void 0,function*(){var r;let s=mz(A,{includeRaw:e});s&&(yield this.safety.pushAction(`comment:${s.fileToken}:${s.commentId}:${(r=s.replyId)!==null&&r!==void 0?r:""}`,s.fileToken,()=>h(this,void 0,void 0,function*(){let g=this.handlers.comment;g&&(yield g(s))})))})})}emitError(t){var o,i,e;let a=t instanceof Rt?t:new Rt("unknown",String((o=t?.message)!==null&&o!==void 0?o:t),{cause:t}),A=this.handlers.error;A?A(a):(e=(i=this.logger).error)===null||e===void 0||e.call(i,"channel: unhandled error",a)}};function a_e(n){return new Fy(n)}function Az(n){return h(this,void 0,void 0,function*(){if(Buffer.isBuffer(n))return n;if(n instanceof Uint8Array)return Buffer.from(n);if(typeof n=="object"&&n!==null){let t=n;if(typeof t.getReadableStream=="function")return yield i_e(t.getReadableStream());if(Buffer.isBuffer(t.data))return t.data;if(t.data instanceof Uint8Array)return Buffer.from(t.data)}throw new Rt("unknown","unexpected download response type")})}function i_e(n){return new Promise((t,o)=>{let i=[];n.on("data",e=>{i.push(Buffer.isBuffer(e)?e:Buffer.from(e))}),n.on("end",()=>t(Buffer.concat(i))),n.on("error",o)})}function tz(n){var t;return`rx:${n.messageId}:${n.operator.openId}:${n.emojiType}:${n.action}:${(t=n.actionTime)!==null&&t!==void 0?t:0}`}function o_e(n){var t,o,i;let e=typeof n.value=="string"?n.value:JSON.stringify((t=n.value)!==null&&t!==void 0?t:""),a=e.length>128?e.slice(0,128):e;return`${n.tag}|${(o=n.name)!==null&&o!==void 0?o:""}|${(i=n.option)!==null&&i!==void 0?i:""}|${a}`}var CV=ze(N_(),1);var Dz=Object.freeze([250,1e3,3e3,5e3,1e4,3e4]);function wz(n,t){return Number.isFinite(n)&&n>=0?n:t}function n_e(n){if(!Array.isArray(n)||n.length===0)return[...Dz];let t=n.map(o=>wz(o,-1)).filter(o=>o>=0);return t.length>0?t:[...Dz]}function s_e(n){let t=Number.isInteger(n?.totals?.configured)?n.totals.configured:Array.isArray(n?.bots)?n.bots.length:0,o=Number.isInteger(n?.totals?.connected)?n.totals.connected:Array.isArray(n?.bots)?n.bots.filter(i=>i?.connected===!0).length:0;return{configured:t,connected:o}}var Uy=class{#e;#A;#t;#r;#a;#i;#c;#s=null;#I=null;#o=0;#n=!1;#g=!1;#l;#p;constructor({controller:t,harness:o,logger:i=console,retryDelaysMs:e,healthyIntervalMs:a=15e3,setTimeoutImpl:A=setTimeout,clearTimeoutImpl:r=clearTimeout}){if(!t||typeof t.initialize!="function"||typeof t.status!="function")throw new TypeError("ConnectionSupervisor requires a controller");if(!o||typeof o.ensureRunning!="function")throw new TypeError("ConnectionSupervisor requires a Harness client");this.#e=t,this.#A=o,this.#t=i,this.#r=n_e(e),this.#a=wz(a,15e3),this.#i=A,this.#c=r,this.#l=new Promise(s=>{this.#p=s})}get ready(){return this.#l}start(){return this.#n||this.#g?this:(this.#n=!0,this.#d(0),this)}async close(){this.#g||(this.#g=!0,this.#s!==null&&(this.#c(this.#s),this.#s=null),await this.#I?.catch(()=>{}),this.#p?.(null),this.#p=null)}#d(t){this.#g||(this.#s=this.#i(()=>{this.#s=null,this.#h()},t),this.#s?.unref?.())}async#h(){if(this.#g||this.#I)return;let t=this.#E();this.#I=t;try{await t}finally{this.#I===t&&(this.#I=null)}}async#E(){try{await this.#A.ensureRunning()}catch(t){if(this.#g)return;this.#u("Harness Host is not ready",t);return}if(!this.#g)try{if(await this.#e.initialize(),this.#g)return;let t=await this.#e.status();this.#p?.(t),this.#p=null;let o=s_e(t);if(o.connected`,resources:[]}}),t_e=new Map([["text",ZMe],["post",jMe],["image",FMe],["file",vMe],["audio",TMe],["video",$8],["media",$8],["sticker",VMe],["interactive",UMe],["merge_forward",KMe],["share_chat",qMe],["share_user",zMe],["location",HMe],["system",WMe],["vote",A_e],["todo",XMe],["calendar",NMe],["general_calendar",RMe],["share_calendar_event",kMe],["folder",PMe],["hongbao",GMe],["video_chat",e_e]]);function ez(n,t,o){var i;return h(this,void 0,void 0,function*(){let e=(i=t_e.get(t))!==null&&i!==void 0?i:X8;try{return yield e(n,o)}catch{return X8(n)}})}function Qz(n,t){var o,i,e,a,A,r,s,g,c,I,d,B;let f=(i=(o=n.context)===null||o===void 0?void 0:o.open_message_id)!==null&&i!==void 0?i:n.open_message_id,Q=(a=(e=n.context)===null||e===void 0?void 0:e.open_chat_id)!==null&&a!==void 0?a:n.open_chat_id,y=(A=n.operator)===null||A===void 0?void 0:A.open_id;return!f||!Q||!y?null:{messageId:f,chatId:Q,operator:{openId:y,userId:(r=n.operator)===null||r===void 0?void 0:r.user_id,name:(s=n.operator)===null||s===void 0?void 0:s.name},action:{value:(g=n.action)===null||g===void 0?void 0:g.value,tag:(I=(c=n.action)===null||c===void 0?void 0:c.tag)!==null&&I!==void 0?I:"unknown",name:(d=n.action)===null||d===void 0?void 0:d.name,option:(B=n.action)===null||B===void 0?void 0:B.option},raw:t?.includeRaw?n:void 0}}function fk(n,t,o){var i,e,a,A;let r=n.message_id,s=(i=n.reaction_type)===null||i===void 0?void 0:i.emoji_type,g=(e=n.user_id)===null||e===void 0?void 0:e.open_id;if(!r||!s||!g)return null;let c=n.action_time,I=c?parseInt(c,10):void 0;return{messageId:r,operator:{openId:g,userId:(A=(a=n.user_id)===null||a===void 0?void 0:a.user_id)!==null&&A!==void 0?A:void 0},emojiType:s,action:t,actionTime:I!=null&&Number.isFinite(I)?I:void 0,raw:o?.includeRaw?n:void 0}}function yz(n,t){var o,i,e,a,A,r,s,g,c;let I=n.chat_id,d=(o=n.operator_id)===null||o===void 0?void 0:o.open_id;if(!I||!d)return null;let B=(r=(a=(i=n.name)!==null&&i!==void 0?i:(e=n.i18n_names)===null||e===void 0?void 0:e.zh_cn)!==null&&a!==void 0?a:(A=n.i18n_names)===null||A===void 0?void 0:A.en_us)!==null&&r!==void 0?r:(s=n.i18n_names)===null||s===void 0?void 0:s.ja_jp;return{chatId:I,operator:{openId:d,userId:(c=(g=n.operator_id)===null||g===void 0?void 0:g.user_id)!==null&&c!==void 0?c:void 0},botName:B,external:n.external,raw:t?.includeRaw?n:void 0}}function mz(n,t){var o,i,e,a,A,r,s,g,c,I,d,B,f;let Q=(o=n.file_token)!==null&&o!==void 0?o:(i=n.notice_meta)===null||i===void 0?void 0:i.file_token,y=(e=n.file_type)!==null&&e!==void 0?e:(a=n.notice_meta)===null||a===void 0?void 0:a.file_type,m=n.comment_id,_=(r=(A=n.notice_meta)===null||A===void 0?void 0:A.from_user_id)!==null&&r!==void 0?r:n.user_id,N=_?.open_id;if(!Q||!y||!m||!N)return null;let G=(c=(s=n.create_time)!==null&&s!==void 0?s:(g=n.notice_meta)===null||g===void 0?void 0:g.timestamp)!==null&&c!==void 0?c:n.action_time,Y=G?parseInt(G,10):Date.now();return{fileToken:Q,fileType:y,commentId:m,replyId:n.reply_id,operator:{openId:N,userId:(I=_?.user_id)!==null&&I!==void 0?I:void 0,unionId:_?.union_id},mentionedBot:!!((f=(d=n.is_mentioned)!==null&&d!==void 0?d:(B=n.notice_meta)===null||B===void 0?void 0:B.is_mentioned)!==null&&f!==void 0?f:n.is_mention),timestamp:Number.isFinite(Y)?Y:Date.now(),raw:t?.includeRaw?n:void 0}}function Sz(n,t){var o,i,e,a,A;return h(this,void 0,void 0,function*(){let r=n.message,s=(o=t.botIdentity)===null||o===void 0?void 0:o.openId,{mentions:g,mentionsByOpenId:c,mentionList:I,mentionAll:d,mentionedBot:B}=mMe(r.mentions,s),f=d||r_e(r.content),Q={messageId:r.message_id,botOpenId:s,mentions:g,mentionsByOpenId:c,stripBotMentions:(i=t.stripBotMentions)!==null&&i!==void 0?i:!0,fetchSubMessages:t.fetchSubMessages,resolveUserName:t.resolveUserName,batchResolveNames:t.batchResolveNames,dispatch:ez},{content:y,resources:m}=yield ez(r.content,r.message_type,Q),_=SMe(y,Q),N=n.sender.sender_id.open_id,G=(a=(e=n.sender.sender_id.user_id)!==null&&e!==void 0?e:n.sender.sender_id.union_id)!==null&&a!==void 0?a:"",Y=N??G,j=N?(A=t.resolveSenderName)===null||A===void 0?void 0:A.call(t,N):void 0,H=r.create_time?parseInt(r.create_time,10):0;return{messageId:r.message_id,chatId:r.chat_id,chatType:r.chat_type,senderId:Y,senderName:j,content:_,rawContentType:r.message_type,resources:m,mentions:I,mentionAll:f,mentionedBot:B,rootId:r.root_id,threadId:r.thread_id,replyToMessageId:r.parent_id,createTime:Number.isFinite(H)?H:0,raw:t.includeRaw?n:void 0}})}function r_e(n){return n?/@_all\b/.test(n):!1}var Fy=class{constructor(t){var o,i,e,a,A,r,s;this.handlers={},this.connected=!1,this.opts=t,this.logger=new Xg((o=t.loggerLevel)!==null&&o!==void 0?o:ji.info,(i=t.logger)!==null&&i!==void 0?i:Zs),this.rawClient=new _y({appId:t.appId,appSecret:t.appSecret,domain:(e=t.domain)!==null&&e!==void 0?e:zn.Feishu,cache:t.cache,httpInstance:t.httpInstance,logger:t.logger,loggerLevel:t.loggerLevel,source:t.source,extraUaTags:["channel"]}),this.dispatcher=new Ny({verificationToken:(a=t.webhook)===null||a===void 0?void 0:a.verificationToken,encryptKey:(A=t.webhook)===null||A===void 0?void 0:A.encryptKey,cache:t.cache,logger:t.logger,loggerLevel:t.loggerLevel}),this.sender=new pk(this.rawClient,(r=t.outbound)!==null&&r!==void 0?r:{},this.logger),this.safety=new Bk({config:t.safety,policy:t.policy,cache:(s=t.cache)!==null&&s!==void 0?s:wC,logger:this.logger,onReject:g=>{var c,I;(I=(c=this.handlers).reject)===null||I===void 0||I.call(c,g)},onMessage:g=>h(this,void 0,void 0,function*(){let c=this.handlers.message;c&&(yield c(g))})})}connect(){return h(this,void 0,void 0,function*(){return this.connectPromise?this.connectPromise:(this.connectPromise=this.doConnect().catch(t=>{throw this.connectPromise=void 0,t}),this.connectPromise)})}doConnect(){var t;return h(this,void 0,void 0,function*(){this.botIdentity=yield this.fetchBotIdentity(),this.safety.setBotIdentity(this.botIdentity),this.registerDispatcherHandlers(),((t=this.opts.transport)!==null&&t!==void 0?t:"websocket")==="websocket"&&(yield this.connectWebSocket(15e3)),this.connected=!0})}connectWebSocket(t){return new Promise((o,i)=>{var e;let a=!1,A=setTimeout(()=>{a||(a=!0,i(new Rt("not_connected",`WebSocket handshake did not complete within ${t}ms`)))},t);this.rawWsClient=new ky({appId:this.opts.appId,appSecret:this.opts.appSecret,domain:(e=this.opts.domain)!==null&&e!==void 0?e:zn.Feishu,logger:this.opts.logger,loggerLevel:this.opts.loggerLevel,httpInstance:this.opts.httpInstance,autoReconnect:!0,source:this.opts.source,extraUaTags:["channel"],agent:this.opts.agent,wsConfig:this.opts.wsConfig,handshakeTimeoutMs:this.opts.handshakeTimeoutMs,onReady:()=>{a||(a=!0,clearTimeout(A),o())},onError:r=>{a||(a=!0,clearTimeout(A),i(new Rt("not_connected",`WebSocket connect failed: ${r.message}`,{cause:r})))},onReconnecting:()=>{var r,s;return(s=(r=this.handlers).reconnecting)===null||s===void 0?void 0:s.call(r)},onReconnected:()=>{var r,s;return(s=(r=this.handlers).reconnected)===null||s===void 0?void 0:s.call(r)}}),this.rawWsClient.start({eventDispatcher:this.dispatcher})})}disconnect(){var t;return h(this,void 0,void 0,function*(){if(this.connected){try{(t=this.rawWsClient)===null||t===void 0||t.close({})}catch{}try{yield this.safety.dispose()}catch{}this.connected=!1,this.connectPromise=void 0}})}getConnectionStatus(){var t;return(t=this.rawWsClient)===null||t===void 0?void 0:t.getConnectionStatus()}on(t,o){if(typeof t=="string")return this.attachSingle(t,o);let i=[];return Object.keys(t).forEach(e=>{let a=t[e];a&&i.push(this.attachSingle(e,a))}),()=>i.forEach(e=>e())}attachSingle(t,o){return this.handlers[t]&&this.logger.warn(`channel: handler for "${t}" is being overwritten`),this.handlers[t]=o,()=>{this.handlers[t]===o&&delete this.handlers[t]}}send(t,o,i){return h(this,void 0,void 0,function*(){return this.sender.send(t,o,i)})}stream(t,o,i){return h(this,void 0,void 0,function*(){return this.sender.stream(t,o,i)})}updateCard(t,o){return h(this,void 0,void 0,function*(){yield this.sender.patchCard(t,o)})}editMessage(t,o){return h(this,void 0,void 0,function*(){yield this.rawClient.im.v1.message.update({path:{message_id:t},data:{msg_type:"text",content:JSON.stringify({text:o})}})})}recallMessage(t){return h(this,void 0,void 0,function*(){yield this.rawClient.im.v1.message.delete({path:{message_id:t}})})}addReaction(t,o){var i,e;return h(this,void 0,void 0,function*(){let a=yield this.rawClient.im.v1.messageReaction.create({path:{message_id:t},data:{reaction_type:{emoji_type:o}}}),A=(e=(i=a?.data)===null||i===void 0?void 0:i.reaction_id)!==null&&e!==void 0?e:a?.reaction_id;if(!A)throw new Rt("unknown","messageReaction.create returned no reaction_id");return A})}removeReaction(t,o){return h(this,void 0,void 0,function*(){yield this.rawClient.im.v1.messageReaction.delete({path:{message_id:t,reaction_id:o}})})}removeReactionByEmoji(t,o){var i,e;return h(this,void 0,void 0,function*(){let a=yield this.rawClient.im.v1.messageReaction.list({path:{message_id:t},params:{reaction_type:o,page_size:50}}),r=((e=(i=a?.data)===null||i===void 0?void 0:i.items)!==null&&e!==void 0?e:[]).find(s=>{var g;return((g=s.operator)===null||g===void 0?void 0:g.operator_type)==="app"});return r?.reaction_id?(yield this.removeReaction(t,r.reaction_id),!0):!1})}downloadResource(t,o){return h(this,void 0,void 0,function*(){if(o==="image"){let e=yield this.rawClient.im.v1.image.get({path:{image_key:t}});return yield Az(e)}let i=yield this.rawClient.im.v1.file.get({path:{file_key:t}});return yield Az(i)})}getChatInfo(t){var o,i;return h(this,void 0,void 0,function*(){let a=(o=(yield this.rawClient.im.v1.chat.get({path:{chat_id:t}})).data)!==null&&o!==void 0?o:{};return{chatId:t,name:a.name,description:a.description,chatType:(i=a.chat_mode)!==null&&i!==void 0?i:"group",ownerId:a.owner_id,memberCount:a.user_count}})}getChatMode(t){var o;return h(this,void 0,void 0,function*(){let e=(o=(yield this.rawClient.im.v1.chat.get({path:{chat_id:t}})).data)===null||o===void 0?void 0:o.chat_mode;return e==="p2p"?"p2p":e==="topic"?"topic":"group"})}updatePolicy(t){this.safety.updatePolicy(t)}getPolicy(){return this.safety.getPolicy()}fetchBotIdentity(){var t;return h(this,void 0,void 0,function*(){let o;try{let a=yield this.rawClient.request({url:"/open-apis/bot/v3/info",method:"GET"}),A=a.bot;if(A?.open_id)return{openId:A.open_id,name:(t=A.app_name)!==null&&t!==void 0?t:"bot"};o=new Error(`bot/v3/info response missing open_id: ${JSON.stringify(a).slice(0,200)}`)}catch(a){o=a}let i=Mk(o),e=i.code==="unknown"?"not_connected":i.code;throw new Rt(e,"could not resolve bot identity via /open-apis/bot/v3/info \u2014 required for channel to function",{cause:o})})}registerDispatcherHandlers(){var t,o;let i=A=>h(this,void 0,void 0,function*(){var r,s,g,c;try{return(s=(r=(yield this.rawClient.im.v1.message.get({path:{message_id:A}})).data)===null||r===void 0?void 0:r.items)!==null&&s!==void 0?s:[]}catch(I){return(c=(g=this.logger).warn)===null||c===void 0||c.call(g,"channel: fetchSubMessages failed",I),[]}}),e=(o=(t=this.opts.includeRawEvent)!==null&&t!==void 0?t:this.opts.includeRawInMessage)!==null&&o!==void 0?o:!1,a={botIdentity:this.botIdentity,stripBotMentions:!0,includeRaw:e,fetchSubMessages:i};this.dispatcher.register({"im.message.receive_v1":A=>h(this,void 0,void 0,function*(){try{let r=yield Sz(A,a);yield this.safety.pushMessage(r)}catch(r){this.emitError(r)}}),"card.action.trigger":A=>h(this,void 0,void 0,function*(){let r=Qz(A,{includeRaw:e});if(!r)return;let s=o_e(r.action);yield this.safety.pushAction(`card:${r.messageId}:${r.operator.openId}:${s}`,r.chatId,()=>h(this,void 0,void 0,function*(){let g=this.handlers.cardAction;g&&(yield g(r))}))}),"im.message.reaction.created_v1":A=>h(this,void 0,void 0,function*(){let r=fk(A,"added",{includeRaw:e});if(!r)return;let s=tz(r);yield this.safety.pushLight(s,()=>{var g,c;return(c=(g=this.handlers).reaction)===null||c===void 0?void 0:c.call(g,r)})}),"im.message.reaction.deleted_v1":A=>h(this,void 0,void 0,function*(){let r=fk(A,"removed",{includeRaw:e});if(!r)return;let s=tz(r);yield this.safety.pushLight(s,()=>{var g,c;return(c=(g=this.handlers).reaction)===null||c===void 0?void 0:c.call(g,r)})}),"im.chat.member.bot.added_v1":A=>{var r,s;let g=yz(A,{includeRaw:e});if(g)try{(s=(r=this.handlers).botAdded)===null||s===void 0||s.call(r,g)}catch(c){this.emitError(c)}},"drive.notice.comment_add_v1":A=>h(this,void 0,void 0,function*(){var r;let s=mz(A,{includeRaw:e});s&&(yield this.safety.pushAction(`comment:${s.fileToken}:${s.commentId}:${(r=s.replyId)!==null&&r!==void 0?r:""}`,s.fileToken,()=>h(this,void 0,void 0,function*(){let g=this.handlers.comment;g&&(yield g(s))})))})})}emitError(t){var o,i,e;let a=t instanceof Rt?t:new Rt("unknown",String((o=t?.message)!==null&&o!==void 0?o:t),{cause:t}),A=this.handlers.error;A?A(a):(e=(i=this.logger).error)===null||e===void 0||e.call(i,"channel: unhandled error",a)}};function a_e(n){return new Fy(n)}function Az(n){return h(this,void 0,void 0,function*(){if(Buffer.isBuffer(n))return n;if(n instanceof Uint8Array)return Buffer.from(n);if(typeof n=="object"&&n!==null){let t=n;if(typeof t.getReadableStream=="function")return yield i_e(t.getReadableStream());if(Buffer.isBuffer(t.data))return t.data;if(t.data instanceof Uint8Array)return Buffer.from(t.data)}throw new Rt("unknown","unexpected download response type")})}function i_e(n){return new Promise((t,o)=>{let i=[];n.on("data",e=>{i.push(Buffer.isBuffer(e)?e:Buffer.from(e))}),n.on("end",()=>t(Buffer.concat(i))),n.on("error",o)})}function tz(n){var t;return`rx:${n.messageId}:${n.operator.openId}:${n.emojiType}:${n.action}:${(t=n.actionTime)!==null&&t!==void 0?t:0}`}function o_e(n){var t,o,i;let e=typeof n.value=="string"?n.value:JSON.stringify((t=n.value)!==null&&t!==void 0?t:""),a=e.length>128?e.slice(0,128):e;return`${n.tag}|${(o=n.name)!==null&&o!==void 0?o:""}|${(i=n.option)!==null&&i!==void 0?i:""}|${a}`}var CV=ze(N_(),1);var Dz=Object.freeze([250,1e3,3e3,5e3,1e4,3e4]);function wz(n,t){return Number.isFinite(n)&&n>=0?n:t}function n_e(n){if(!Array.isArray(n)||n.length===0)return[...Dz];let t=n.map(o=>wz(o,-1)).filter(o=>o>=0);return t.length>0?t:[...Dz]}function s_e(n){let t=Number.isInteger(n?.totals?.configured)?n.totals.configured:Array.isArray(n?.bots)?n.bots.length:0,o=Number.isInteger(n?.totals?.connected)?n.totals.connected:Array.isArray(n?.bots)?n.bots.filter(i=>i?.connected===!0).length:0;return{configured:t,connected:o}}var Uy=class{#e;#A;#t;#r;#a;#i;#c;#s=null;#I=null;#o=0;#n=!1;#g=!1;#l;#p;constructor({controller:t,harness:o,logger:i=console,retryDelaysMs:e,healthyIntervalMs:a=15e3,setTimeoutImpl:A=setTimeout,clearTimeoutImpl:r=clearTimeout}){if(!t||typeof t.initialize!="function"||typeof t.status!="function")throw new TypeError("ConnectionSupervisor requires a controller");if(!o||typeof o.ensureRunning!="function")throw new TypeError("ConnectionSupervisor requires a Harness client");this.#e=t,this.#A=o,this.#t=i,this.#r=n_e(e),this.#a=wz(a,15e3),this.#i=A,this.#c=r,this.#l=new Promise(s=>{this.#p=s})}get ready(){return this.#l}start(){return this.#n||this.#g?this:(this.#n=!0,this.#d(0),this)}async close(){this.#g||(this.#g=!0,this.#s!==null&&(this.#c(this.#s),this.#s=null),await this.#I?.catch(()=>{}),this.#p?.(null),this.#p=null)}#d(t){this.#g||(this.#s=this.#i(()=>{this.#s=null,this.#h()},t),this.#s?.unref?.())}async#h(){if(this.#g||this.#I)return;let t=this.#E();this.#I=t;try{await t}finally{this.#I===t&&(this.#I=null)}}async#E(){try{await this.#A.ensureRunning()}catch(t){if(this.#g)return;this.#u("Harness Host is not ready",t);return}if(!this.#g)try{if(await this.#e.initialize(),this.#g)return;let t=await this.#e.status();this.#p?.(t),this.#p=null;let o=s_e(t);if(o.connected=0?o:null}async function h_e(n,{signal:t,maxBytes:o}){if(!n||typeof n[Symbol.asyncIterator]!="function")throw new Error("Feishu image download returned no readable stream");t?.throwIfAborted();let i=()=>n.destroy?.(t.reason??new DOMException("Feishu image download aborted","AbortError"));t?.addEventListener("abort",i,{once:!0});let e=[],a=0;try{for await(let A of n){t?.throwIfAborted();let r=Buffer.from(A);if(a+=r.length,a>o)throw n.destroy?.(),new ut("image-too-large",`Feishu image exceeds ${o} bytes`,D("\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));e.push(r)}return t?.throwIfAborted(),Buffer.concat(e,a)}finally{t?.removeEventListener("abort",i)}}async function E_e(n,{signal:t}){if(!n||typeof n[Symbol.asyncIterator]!="function")throw new Error("Feishu file download returned no readable stream");t?.throwIfAborted();let o=()=>n.destroy?.(t.reason??new DOMException("Feishu file download aborted","AbortError"));t?.addEventListener("abort",o,{once:!0});let i=[],e=0;try{for await(let a of n){t?.throwIfAborted();let A=Buffer.from(a);e+=A.length,i.push(A)}return t?.throwIfAborted(),Buffer.concat(i,e)}finally{t?.removeEventListener("abort",o)}}function Rk(n){if(!n||typeof n!="object")return null;let t=n.code??n.error?.code;return Number.isSafeInteger(Number(t))?Number(t):null}async function C_e(n,t){if(!n||typeof n[Symbol.asyncIterator]!="function")return null;t?.throwIfAborted();let o=AbortSignal.timeout(c_e),i=t?AbortSignal.any([t,o]):o,e=()=>n.destroy?.(i.reason);i.addEventListener("abort",e,{once:!0});let a=[],A=0;try{for await(let r of n){let s=Buffer.from(r);if(A+=s.length,A>g_e)return n.destroy?.(),null;a.push(s)}return Buffer.concat(a,A).toString("utf8")}catch{return t?.throwIfAborted(),null}finally{i.removeEventListener("abort",e)}}async function u_e(n,t){let o=[n],i=new Set;for(;o.length>0&&i.size<8;){let e=o.shift();if(!e||typeof e!="object"&&typeof e!="function"||i.has(e))continue;i.add(e);let a=Rk(e),A=e.response?.data??e.data;if(a===Hy)return A?.destroy?.(),a;if(A&&typeof A[Symbol.asyncIterator]=="function"){let r=await C_e(A,t);try{let s=Rk(JSON.parse(r));if(s===Hy)return s}catch{}}else{let r=Rk(A);if(r===Hy)return r}o.push(e.cause)}return null}async function B_e(n,t){return await u_e(n,t)!==Hy?n:new ut("feishu-image-permission-required","Feishu image download requires the im:message:readonly tenant scope",D(I_e),{cause:n})}function f_e(n,t,o){return{async load({signal:i,maxBytes:e}){i?.throwIfAborted();let a;try{a=await t?.im?.v1?.messageResource?.get?.({path:{message_id:n.message.message_id,file_key:o},params:{type:"image"}})}catch(r){throw await B_e(r,i)}i?.throwIfAborted();let A=d_e(a?.headers);if(A!==null&&A>e)throw a?.getReadableStream?.().destroy?.(),new ut("image-too-large",`Feishu image declares ${A} bytes; the limit is ${e}`,D("\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));return h_e(a?.getReadableStream?.(),{signal:i,maxBytes:e})}}}function Q_e(n,t,o){let i=qp(o?.file_key);return i?{name:qp(o?.file_name)??"file",async load({signal:e}={}){e?.throwIfAborted();let a=await t?.im?.v1?.messageResource?.get?.({path:{message_id:n.message.message_id,file_key:i},params:{type:"file"}});return e?.throwIfAborted(),E_e(a?.getReadableStream?.(),{signal:e})}}:null}function Pk(n,t){let o=n?.message?.message_type,i=vk(n),e=l_e(n,i),a=o==="image"?qp(i?.image_key):null,A=a?[a]:e?.imageKeys??[],r=o==="file"?Q_e(n,t,i):null;return{content:o==="text"?zp(n)??"":e?.text??"",images:A.map(s=>f_e(n,t,s)),files:r?[r]:[]}}function Tz(n,t=9e3){if(n.length<=t)return[n];let o=[],i=n;for(;i.length>t;){let e=i.lastIndexOf(` `,t);ei.value===t);return o>=0?o+1:0}function MC(n){return String(n??"").replace(/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]+/gu," ").replace(/\s+/gu," ").trim()||D("\u6682\u65E0\u6807\u9898")}function wo(n,t){return JSON.stringify({schema:"2.0",header:{title:Yy(n),template:"blue"},body:{elements:t}})}function RI(){return Vn(D("\u{1F519} \u8FD4\u56DE\u83DC\u5355"),"back_to_menu")}function kz(n){let{workspaces:t=[],currentWorkspace:o=null,currentSession:i=null,sessions:e=[],archiveVisible:a=!1,presetCatalog:A=null,modelCatalog:r=null}=n||{},s=i?.id??null,g=i?.title??n?.currentSessionTitle??null,c=(Array.isArray(e)?e:[]).slice(0,20),I=c.length>0,d=Array.isArray(t)&&t.length>0,B=[];B.push({tag:"div",text:Ct(D("**\u8BBE\u7F6E**"))});let f=null;if(I){let k=c.map(W=>({text:{tag:"plain_text",content:`${W.id===s?"\u2713 ":""}${MC(W.title)}`},value:W.id}));f={tag:"select_static",name:"session_pick",placeholder:{tag:"plain_text",content:s?D("\u5207\u6362\u4F1A\u8BDD"):D("\u9009\u62E9\u4F1A\u8BDD\uFF08\u5F53\u524D\u672A\u7ED1\u5B9A\uFF09")},initial_index:Vp(k,s),options:k,behaviors:[{type:"callback",value:{action:"session_pick"}}]}}let Q=null;if(d){let k=t.slice(0,20).map(W=>({text:{tag:"plain_text",content:`${W===o?"\u2713 ":""}${W}`},value:W}));Q={tag:"select_static",name:"workspace_pick",placeholder:{tag:"plain_text",content:D("\u5207\u6362\u5DE5\u4F5C\u533A")},initial_index:Vp(k,o),options:k,behaviors:[{type:"callback",value:{action:"workspace_pick"}}]}}let y=Array.isArray(A?.items)?A.items:[],m=A?._currentId??null,_=m===null,N=null;if(y.length>=1){let k=y.slice(0,30).map(ie=>({text:{tag:"plain_text",content:`${ie.id===m?"\u2713 ":""}${ie.label}`},value:ie.id})),W=_?Ky:m;k.unshift({text:{tag:"plain_text",content:`${_?"\u2713 ":""}${D("\u8DDF\u968F\u9ED8\u8BA4")}`},value:Ky}),N={tag:"select_static",name:"preset_pick",placeholder:{tag:"plain_text",content:D("\u5207\u6362\u9884\u8BBE")},initial_index:Vp(k,W),options:k,behaviors:[{type:"callback",value:{action:"preset_pick"}}]}}let G=Array.isArray(r?.groups)?r.groups:[],Y=r?.current,j=Y?`${Y.provider}/${Y.model}`:null,H=[];for(let k of G)for(let W of k.models||[])H.push({id:`${k.id}/${W.id}`,name:`${k.name} - ${W.name}`});let J=null;if(H.length>1){let k=H.slice(0,30).map(W=>({text:{tag:"plain_text",content:`${W.id===j?"\u2713 ":""}${W.name}`},value:W.id}));J={tag:"select_static",name:"model_pick",placeholder:{tag:"plain_text",content:D("\u5207\u6362\u6A21\u578B")},initial_index:Vp(k,j),options:k,behaviors:[{type:"callback",value:{action:"model_pick"}}]}}function q(k){return{tag:"column",width:"weighted",weight:.1,vertical_align:"center",elements:[{tag:"div",text:{tag:"plain_text",content:k}}]}}function U(k){return{tag:"column",width:"weighted",weight:1,elements:[k]}}let R=[];f&&R.push(f),Q&&R.push(Q),R.length===2?B.push({tag:"column_set",flex_mode:"none",columns:[q("\u{1F4AC}"),U(R[0]),q("\u{1F4C2}"),U(R[1])]}):R[0]&&B.push(R[0]),I||B.push({tag:"div",text:Ct(D("\u5F53\u524D\u5DE5\u4F5C\u533A\u6682\u65E0\u53EF\u7528\u4F1A\u8BDD\u3002"))});let V=[],L=Vn(D("\u{1F916} \u5207\u6362\u9884\u8BBE"),"presets"),T=Vn(D("\u{1F9E0} \u5207\u6362\u6A21\u578B"),"models");return N?V.push(N):V.push(L),J?V.push(J):V.push(T),B.push({tag:"column_set",flex_mode:"none",columns:[q("\u{1F916}"),U(V[0]),q("\u{1F9E0}"),U(V[1])]}),B.push(NI(D("\u{1F195} \u65B0\u4F1A\u8BDD"),"new",D("\u{1F4CB} \u4F1A\u8BDD/\u5173\u6CE8"),"sessions")),!I&&!d&&B.push(Vn(D("\u{1F5C2} \u5DE5\u4F5C\u533A\u5217\u8868"),"workspaces")),B.push({tag:"hr"}),B.push({tag:"div",text:Ct(D("**\u4EFB\u52A1\u63A7\u5236**"))}),B.push(NI(D("\u23F9 \u505C\u6B62"),"stop",D("\u{1F4D0} \u538B\u7F29"),"compact")),B.push({tag:"hr"}),B.push({tag:"column_set",flex_mode:"none",columns:[{tag:"column",width:"weighted",weight:1,elements:[{tag:"div",text:Ct(D("**\u8865\u5145\u6307\u4EE4**"))},{tag:"select_static",name:"steer_pick",placeholder:{tag:"plain_text",content:D("\u9009\u62E9\u8865\u5145\u6307\u4EE4")},initial_index:0,options:[...jz.map(k=>({text:{tag:"plain_text",content:D(k)},value:D(k)})),{text:{tag:"plain_text",content:D("\u270F\uFE0F \u66F4\u591A / \u81EA\u5B9A\u4E49\u2026")},value:"custom"}],behaviors:[{type:"callback",value:{action:"steer_pick"}}]}]},{tag:"column",width:"weighted",weight:1,elements:[{tag:"div",text:Ct(D("\u{1F5C4} \u5F52\u6863\uFF1A{state}",{state:a?D("\u5DF2\u663E\u793A"):D("\u5DF2\u9690\u85CF")}))},Vn(D("\u5207\u6362\u5F52\u6863\u663E\u793A"),"archive_toggle")]}]}),B.push({tag:"hr"}),B.push(NI(D("\u{1F4CA} \u72B6\u6001"),"status",D("\u{1F4D6} \u5E2E\u52A9"),"help")),B.push({tag:"div",text:Ct(D(`**\u6570\u5B57\u515C\u5E95** **1**\u5DE5\u4F5C\u533A\u5217\u8868 \xB7 **2**\u65B0\u4F1A\u8BDD \xB7 **3**\u4F1A\u8BDD\u5217\u8868 \xB7 **4**\u72B6\u6001 @@ -334,7 +334,7 @@ ${s.join(` `)+t)},{tag:"hr"},{tag:"div",text:Ct(D(S_e))},{tag:"hr"},RI()];return wo(D("\u{1F4D6} \u5E2E\u52A9"),o)}function Uz(n){if(typeof n!="string"||!/^[A-Za-z0-9_-]{16,128}$/.test(n))throw new TypeError("A safe card-action probe nonce is required");return wo(D("\u{1F9EA} \u9A8C\u8BC1\u5361\u7247\u6309\u94AE"),[{tag:"div",text:Ct(D("\u6388\u6743\u5DF2\u63D0\u4EA4\u3002\u8BF7\u70B9\u51FB\u4E0B\u65B9\u6309\u94AE\uFF1B\u673A\u5668\u4EBA\u771F\u5B9E\u6536\u5230\u56DE\u8C03\u540E\u624D\u4F1A\u5224\u5B9A\u4FEE\u590D\u6210\u529F\u3002"))},{tag:"column_set",flex_mode:"none",columns:[{tag:"column",width:"weighted",weight:1,elements:[{tag:"button",text:Yy(D("\u5B8C\u6210\u9A8C\u8BC1")),type:"primary",width:"fill",behaviors:[{type:"callback",value:{action:"repair_verify",nonce:n}}]}]}]}])}function Hz(n,t,o,i,e=new Set){let a=o*$g,A=t.slice(a,a+$g),r=Math.max(1,Math.ceil(i/$g)),s=I=>typeof e?.has=="function"&&e.has(I),g=(I,d)=>({tag:"column_set",flex_mode:"none",horizontal_spacing:"default",columns:[{tag:"column",width:"90px",vertical_align:"center",elements:[I]},{tag:"column",width:"weighted",weight:1,vertical_align:"center",elements:[d]}]}),c=[{tag:"div",text:Ct(D(`**\u5DE5\u4F5C\u533A**\uFF1A{workspace} \u5171 **{total}** \u4E2A\u4F1A\u8BDD{paging}`,{workspace:`\`${n}\``,total:i,paging:i>$g?D("\uFF08\u7B2C {page}/{pageCount} \u9875\uFF09",{page:o+1,pageCount:r}):""}))},...A.map((I,d)=>{let B=`${d+1}. ${MC(I.title)}${I.archived===!0?D("\uFF08\u5DF2\u5F52\u6863\uFF09"):""}`,f=s(I.sessionId);return g(xy(f?D("\u2B50 \u53D6\u6D88\u5173\u6CE8"):D("\u2606 \u5173\u6CE8"),f?`unwatch:${I.sessionId}`:`watch:${I.sessionId}`),xy(B,`use:${I.sessionId}`))})];return o>0&&c.push(Vn(D("\u25C0 \u4E0A\u4E00\u9875"),`sessions:${o-1}`)),o+1Vn(`${e+1}. ${i}${i===t?D("\uFF08\u5F53\u524D\uFF09"):""}`,`workspace:${i}`)),{tag:"hr"},RI()];return wo(D("\u{1F5C2} \u5DE5\u4F5C\u533A"),o)}function D_e(n,t){let o=new Set(n.map(e=>e.sessionId)),i=(Array.isArray(t)?t:[]).filter(e=>e?.sessionId&&!o.has(e.sessionId)).slice(0,30).map(e=>({text:{tag:"plain_text",content:MC(e.title??e.sessionId)},value:e.sessionId}));return i.length===0?null:{tag:"multi_select_static",name:"watch_add",placeholder:{tag:"plain_text",content:D("\u52FE\u9009\u8981\u5173\u6CE8\u7684\u4F1A\u8BDD")},options:i,behaviors:[{type:"callback",value:{action:"watch_add",kind:"multi"}}]}}function w_e(n){let t=n.slice(0,30).map(o=>({text:{tag:"plain_text",content:MC(o.title)},value:o.sessionId}));return t.length===0?null:{tag:"multi_select_static",name:"watch_remove",placeholder:{tag:"plain_text",content:D("\u52FE\u9009\u8981\u53D6\u6D88\u5173\u6CE8\u7684\u4F1A\u8BDD")},options:t,behaviors:[{type:"callback",value:{action:"watch_remove",kind:"multi"}}]}}function xz(n,t){let o=Array.isArray(n)?n:[],i=D_e(o,t),e=w_e(o),a=[];return o.length===0?a.push({tag:"div",text:Ct(D("\u5F53\u524D\u6CA1\u6709\u5173\u6CE8\u7684\u4F1A\u8BDD\u3002\u4EFB\u52A1\u5B8C\u6210\u4F1A\u81EA\u52A8\u63A8\u9001\u7ED3\u679C\u3002"))}):a.push({tag:"div",text:Ct(D("\u5F53\u524D\u5173\u6CE8 **{count}** \u4E2A\u4F1A\u8BDD\uFF1A",{count:o.length}))}),i&&a.push({tag:"hr"},{tag:"div",text:Ct(D("**\u2795 \u6DFB\u52A0\u5173\u6CE8**\uFF08\u591A\u9009\u4E0B\u62C9\u52FE\u9009\uFF09"))},i),e&&a.push({tag:"hr"},{tag:"div",text:Ct(D("**\u2796 \u53D6\u6D88\u5173\u6CE8**\uFF08\u591A\u9009\u4E0B\u62C9\u52FE\u9009\uFF09"))},e),a.push({tag:"hr"},NI(D("\u{1F4CB} \u4F1A\u8BDD\u5217\u8868"),"sessions",D("\u{1F519} \u8FD4\u56DE\u83DC\u5355"),"back_to_menu")),wo(D("\u{1F441} \u5173\u6CE8\u5217\u8868"),a)}function Yz(n,t,o){let i=o==="completed"?D("\u5DF2\u5B8C\u6210"):o==="stopped"?D("\u5DF2\u505C\u6B62"):o==="aborted"?D("\u5DF2\u4E2D\u6B62"):o==="cancelled"?D("\u5DF2\u53D6\u6D88"):D("\u5DF2\u7ED3\u675F");return wo(D("\u2705 \u4EFB\u52A1\u5B8C\u6210"),[{tag:"div",text:Ct(`**${MC(t)}** \`${n}\``)},{tag:"div",text:Ct(D("**\u72B6\u6001**\uFF1A{reason}",{reason:i}))},{tag:"hr"},NI(D("\u{1F4CB} \u4F1A\u8BDD\u5217\u8868"),"sessions",D("\u{1F519} \u8FD4\u56DE\u83DC\u5355"),"back_to_menu"),{tag:"div",text:Ct(D("\u7ED1\u5B9A\u8BE5\u4F1A\u8BDD\u540E\u53EF\u7EE7\u7EED\u8FFD\u95EE\uFF0C\u8F93\u5165\u6587\u5B57\u5373\u53EF\u3002"))}])}var jz=["\u7EE7\u7EED","\u52A0\u901F\u8FD0\u884C","\u603B\u7ED3\u5F53\u524D\u8FDB\u5C55","\u66F4\u7B80\u6D01\u4E9B","\u66F4\u8BE6\u7EC6\u4E9B"],_C="__steer_custom__";function Jz({hasSession:n}){let t=n?D("\u4ECE\u4E0B\u65B9\u4E0B\u62C9\u9009\u62E9\u8865\u5145\u6307\u4EE4\uFF1B\u6700\u540E\u4E00\u9879\u53EF\u81EA\u5B9A\u4E49\u8F93\u5165\u3002"):D("\u5F53\u524D\u6CA1\u6709\u7ED1\u5B9A\u4F1A\u8BDD\uFF0C\u8BF7\u5148\u7ED1\u5B9A\u4F1A\u8BDD\u518D\u8865\u5145\u6307\u4EE4\u3002"),o=jz.map(e=>({text:{tag:"plain_text",content:D(e)},value:D(e)}));o.push({text:{tag:"plain_text",content:D("\u270F\uFE0F \u66F4\u591A / \u81EA\u5B9A\u4E49\u2026")},value:_C});let i=[{tag:"div",text:Ct(t)},{tag:"hr"},{tag:"select_static",name:"steer_quick",placeholder:{tag:"plain_text",content:D("\u9009\u62E9\u8865\u5145\u6307\u4EE4")},initial_index:0,options:o,behaviors:[{type:"callback",value:{action:"steer",source:"quick"}}]},{tag:"hr"},Vn(D("\u{1F519} \u8FD4\u56DE\u83DC\u5355"),"back_to_menu")];return wo(D("\u2795 \u8865\u5145\u6307\u4EE4"),i)}function Gk(){let n=[{tag:"div",text:Ct(D("\u8F93\u5165\u8865\u5145\u6307\u4EE4\u540E\u70B9\u300C\u63D0\u4EA4\u300D\uFF0C\u53D1\u9001\u7ED9\u5F53\u524D\u8FD0\u884C\u7684\u4EFB\u52A1\u3002"))},{tag:"hr"},{tag:"form",name:"steer_form",elements:[{tag:"input",name:"steer_text",placeholder:{tag:"plain_text",content:D("\u8F93\u5165\u4F60\u7684\u8865\u5145\u6307\u4EE4")}},{tag:"button",name:"steer_submit",text:{tag:"plain_text",content:D("\u63D0\u4EA4")},type:"primary",width:"fill",form_action_type:"submit",behaviors:[{type:"callback",value:{action:"steer",source:"form"}}]}]},{tag:"hr"},Vn(D("\u{1F519} \u8FD4\u56DE\u83DC\u5355"),"back_to_menu")];return wo(D("\u2795 \u81EA\u5B9A\u4E49\u6307\u4EE4"),n)}import{mkdir as O_e,readFile as b_e,rename as M_e,writeFile as __e}from"node:fs/promises";import{dirname as T_e}from"node:path";var N_e=Object.freeze({version:1,sessions:{},seenMessageIds:[],watches:{},includeArchivedSessions:!1}),Jy=20;function Fk(n){return n&&typeof n=="object"&&typeof n.sessionId=="string"&&n.sessionId.length>0&&typeof n.chatId=="string"&&n.chatId.length>0}var jy=class{#e;#A=structuredClone(N_e);#t=Promise.resolve();constructor(t){this.#e=t}async load(){try{let t=JSON.parse(await b_e(this.#e,"utf8"));this.#A={version:1,sessions:t.sessions&&typeof t.sessions=="object"?t.sessions:{},seenMessageIds:Array.isArray(t.seenMessageIds)?t.seenMessageIds.slice(-1e3):[],watches:t.watches&&typeof t.watches=="object"?t.watches:{},includeArchivedSessions:typeof t.includeArchivedSessions=="boolean"?t.includeArchivedSessions:!1}}catch(t){if(t?.code!=="ENOENT")throw t;await this.#r()}return this}sessionFor(t){return this.#A.sessions[t]??null}async setSession(t,o){this.#A.sessions[t]=o,await this.#r()}async clearSession(t){delete this.#A.sessions[t],await this.#r()}async clearSessions(){this.#A.sessions={},await this.#r()}hasSeen(t){return this.#A.seenMessageIds.includes(t)}async markSeen(t){this.hasSeen(t)||(this.#A.seenMessageIds.push(t),this.#A.seenMessageIds.length>1e3&&this.#A.seenMessageIds.splice(0,this.#A.seenMessageIds.length-1e3),await this.#r())}snapshot(){return structuredClone(this.#A)}watchEntries(t){let o=this.#A.watches[t];return Array.isArray(o)?o.filter(Fk):[]}watchEntry(t,o){return this.watchEntries(t).find(i=>i.sessionId===o)??null}async setWatch(t,o){let i=this.#A.watches[t]??[],e=i.findIndex(a=>a.sessionId===o.sessionId);e===-1?(i.length>=Jy&&i.shift(),i.push(o)):i[e]=o,this.#A.watches[t]=i,await this.#r()}async removeWatch(t,o){let i=this.#A.watches[t]??[];this.#A.watches[t]=i.filter(e=>e.sessionId!==o),await this.#r()}async clearWatches(t){delete this.#A.watches[t],await this.#r()}keysWatching(t){return Object.entries(this.#A.watches).filter(([,o])=>Array.isArray(o)&&o.some(i=>Fk(i)&&i.sessionId===t)).map(([o])=>o)}watchedSessionIds(){let t=new Set;for(let o of Object.values(this.#A.watches))if(Array.isArray(o))for(let i of o)Fk(i)&&t.add(i.sessionId);return[...t]}includesArchivedSessions(){return this.#A.includeArchivedSessions===!0}async setIncludeArchivedSessions(t){this.#A.includeArchivedSessions=t===!0,await this.#r()}async#r(){let t=JSON.stringify(this.#A,null,2)+` -`;this.#t=this.#t.then(async()=>{await O_e(T_e(this.#e),{recursive:!0,mode:448});let o=`${this.#e}.tmp`;await __e(o,t,{encoding:"utf8",mode:384}),await M_e(o,this.#e)}),await this.#t}};var ec=Object.freeze({MENTION:"mention",ALL:"all"});function Ji(n){return n===ec.ALL?ec.ALL:ec.MENTION}function qy(n){return n===ec.MENTION||n===ec.ALL}var zy=()=>D("\u8FD9\u4E2A\u95EE\u9898\u5DF2\u5728\u5176\u4ED6\u5BA2\u6237\u7AEF\u5904\u7406\uFF0C\u65E0\u9700\u518D\u6B21\u56DE\u7B54\u3002"),k_e=30*6e4,v_e=/^\/m(?:enu)?$/i,P_e=/^\/repair(?:\s|$)/i,G_e=/^\/repair(?:\s+(qr|status|cancel|verify))?\s*$/i,qz=/^\/watch(?:\s+([^\s]+))?$/i,zz=/^\/unwatch(?:\s+([^\s]+))?$/i,F_e=/^\/watchlist$/i,L_e=/^\/sessionlist(?:\s|$)/i,U_e=/^\/workspacelist$/i,H_e=/^\d{1,2}$/,K_e=10*6e4,x_e=50,Y_e=8,j_e=8,J_e=10*6e4,Vz=400,q_e=10*6e4,z_e=100,V_e=50,W_e=500,Z_e=5e3,X_e=5e3,$_e=15e3,eTe=1e3,eV=new Set(["starting","qr_ready","polling","slow_down","domain_switched"]),Lk=new Set([...eV,"saving"]),Vy=new Set(["succeeded","expired","cancelled","error"]),ATe=new Set(["accounts.feishu.cn","open.feishu.cn","accounts.larksuite.com","open.larksuite.com"]),Wz=/^\/archived(?:\s+(on|off))?$/i,tTe=/^\/(?:m(?:enu)?|new|help|status|compact|sessionlist(?:\s|$)|workspacelist|watchlist|archived(?:\s+(on|off))?)$/i,rTe=["/session Session ID \u6216\u5F53\u524D\u5DE5\u4F5C\u533A\u5E8F\u53F7 \u5C06\u5F53\u524D\u804A\u5929\u7ED1\u5B9A\u5230\u6307\u5B9A\u4F1A\u8BDD","/workspacelist \u5217\u51FA\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84","/sessionlist [\u5DE5\u4F5C\u533A\u5E8F\u53F7\u6216\u7EDD\u5BF9\u8DEF\u5F84] \u5217\u51FA\u4F1A\u8BDD ID \u548C\u6807\u9898"];function TC(n){switch(n?.code){case"workspace-not-absolute":return D("\u5DE5\u4F5C\u533A\u5FC5\u987B\u662F\u7EDD\u5BF9\u8DEF\u5F84\u3002");case"workspace-not-found":return D("\u5DE5\u4F5C\u533A\u8DEF\u5F84\u4E0D\u5B58\u5728\u3002");case"workspace-not-directory":return D("\u5DE5\u4F5C\u533A\u8DEF\u5F84\u5FC5\u987B\u6307\u5411\u4E00\u4E2A\u76EE\u5F55\u3002");case"workspace-bot-not-found":return D("\u673A\u5668\u4EBA\u6B63\u5728\u79FB\u9664\u6216\u5DF2\u91CD\u65B0\u63A5\u5165\uFF0C\u65E0\u6CD5\u64CD\u4F5C\u539F\u4F1A\u8BDD\u7684\u5DE5\u4F5C\u533A\u3002");default:return D("\u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002")}}function aTe(n,t){let o=String(n??D("\u7ED3\u679C\u6587\u4EF6")).replace(/[\r\n]+/g," ").trim()||D("\u7ED3\u679C\u6587\u4EF6");switch(t?.code){case"artifact-permission-required":return D("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u673A\u5668\u4EBA\u7F3A\u5C11\u98DE\u4E66\u6587\u4EF6\u4E0A\u4F20\u6743\u9650 im:resource\u3002\u8BF7\u79C1\u804A\u673A\u5668\u4EBA\u6267\u884C /repair \u547D\u4EE4\uFF0C\u6216\u8005\u5728\u63D2\u4EF6\u9875\u9762\u70B9\u51FB\u201C\u8865\u5168\u6743\u9650\u201D\u6309\u94AE\u5E76\u626B\u7801\u3002\u5B8C\u6210\u98DE\u4E66\u8981\u6C42\u7684\u53D1\u5E03\u5BA1\u6279\u540E\u91CD\u8BD5\u3002",{name:o});case"artifact-too-large":return D("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u8D85\u8FC7\u98DE\u4E66 30 MB \u4E0A\u9650\uFF0C\u672A\u53D1\u9001\u3002",{name:o});case"artifact-empty":return D("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u4E3A\u7A7A\uFF0C\u98DE\u4E66\u4E0D\u5141\u8BB8\u53D1\u9001\u7A7A\u6587\u4EF6\u3002",{name:o});case"artifact-changed":case"artifact-invalid":case"artifact-unavailable":return D("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6\u6216\u51C6\u5907\u53D1\u9001\uFF0C\u8BF7\u786E\u8BA4\u6587\u4EF6\u4ECD\u53EF\u8BBF\u95EE\u540E\u91CD\u8BD5\u3002",{name:o});case"artifact-rate-limited":return D("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u88AB\u98DE\u4E66\u9650\u6D41\uFF0C\u672A\u80FD\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",{name:o});case"artifact-delivery-uncertain":return D("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u53D1\u9001\u7ED3\u679C\u672A\u80FD\u786E\u8BA4\uFF0C\u8BF7\u5148\u68C0\u67E5\u804A\u5929\u5185\u662F\u5426\u5DF2\u6536\u5230\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u8BD5\u3002",{name:o});default:return D("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u6682\u65F6\u672A\u80FD\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",{name:o})}}function Wy(n,t){return typeof n=="string"&&n.trim()?n:t.length>0?D("\u7ED3\u679C\u6587\u4EF6\u5DF2\u751F\u6210\u3002"):n}function CA(n){return typeof n=="string"&&n.trim()?n.trim():null}function Zz(n){if(n&&typeof n=="object"&&!Array.isArray(n))return n;if(typeof n!="string"||!n.trim())return{};try{let t=JSON.parse(n);return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}catch{return{}}}function RC(n){if(n==null)return null;if(Array.isArray(n)){for(let o of n){let i=RC(o);if(i!==null)return i}return null}if(n&&typeof n=="object")return"value"in n?RC(n.value):"option"in n?RC(n.option):null;if(typeof n!="string")return null;let t=n.trim();if(!t)return null;if(t.startsWith("[")||t.startsWith("{")||t.startsWith('"'))try{let o=JSON.parse(t);if(o!==n)return RC(o)}catch{}return t}function Xs(n){if(n==null)return[];if(Array.isArray(n))return n.flatMap(o=>Xs(o));if(n&&typeof n=="object")return"value"in n?Xs(n.value):"option"in n?Xs(n.option):[];if(typeof n!="string")return[];let t=n.trim();if(!t)return[];if(t.startsWith("[")||t.startsWith("{")||t.startsWith('"'))try{let o=JSON.parse(t);if(o!==n)return Xs(o)}catch{}return t.split(",").map(o=>o.trim()).filter(Boolean)}function nn(n){return Number.isSafeInteger(n)&&n>=-1}function kC(n){return Number.isSafeInteger(n)&&n>=0}function Xy(n){return Number.isSafeInteger(n?.watchStartedAt)&&n.watchStartedAt>=0?n.watchStartedAt:null}function Zy(n){return n&&(Xy(n)!==null||!nn(n.lastSeq))}function iTe(n){return(Array.isArray(n?.events)?n.events:[]).map(t=>t?.event??t).filter(t=>t&&typeof t=="object"&&kC(t.seq)).sort((t,o)=>t.seq-o.seq)}function $y(n){return CA(n?.sender?.sender_id?.open_id)??CA(n?.sender?.sender_id?.user_id)}function oTe(n){return CA(n?.sender?.sender_id?.open_id)}function Xz(n,t){return new Promise((o,i)=>{if(t?.aborted){i(t.reason??new DOMException("Aborted","AbortError"));return}let e=setTimeout(a,n);e.unref?.();function a(){t?.removeEventListener("abort",A),o()}function A(){clearTimeout(e),i(t.reason??new DOMException("Aborted","AbortError"))}t?.addEventListener("abort",A,{once:!0})})}function NC(n,{botId:t}={}){let o=n&&typeof n=="object"?n:{},i=o.registration&&typeof o.registration=="object"?o.registration:o,e=CA(i.operation)??CA(o.operation);if(e&&e!=="callback_repair")throw new Error("The active Feishu operation is not a callback repair");let a=CA(i.botId)??CA(o.botId);if(t&&a&&a!==t)throw new Error("The Feishu repair belongs to another bot");let A=CA(i.state),r=i.attemptId??i.attempt,s=typeof r=="string"||Number.isFinite(r)?String(r):null;if(!A||!s)throw new Error("Feishu returned an invalid repair status");let g=CA(i.verificationUrl)??CA(i.qrCodeUrl),c=Number(i.expiresAt),I=Number(i.remainingSeconds),d=Number(i.pollIntervalMs)||Number(i.pollIntervalSeconds)*1e3;return{state:A,attemptId:s,botId:a,verificationUrl:g,expiresAt:Number.isFinite(c)?c:null,remainingSeconds:Number.isFinite(I)?I:null,pollIntervalMs:Number.isFinite(d)&&d>0?d:null,error:i.error&&typeof i.error=="object"?{code:CA(i.error.code),message:CA(i.error.message)}:null}}function $z(n,t){let o=new URL(n);if(o.protocol!=="https:"||!ATe.has(o.hostname))throw new Error("Feishu returned an untrusted repair URL");if(o.searchParams.get("tp")!=="sdk"||o.searchParams.get("clientID")!==t||o.searchParams.has("createOnly"))throw new Error("Feishu returned an invalid existing-app repair URL");if(o.toString().includes("{{client_id}}")||o.toString().includes("%7B%7Bclient_id%7D%7D"))throw new Error("Feishu returned an unresolved client id placeholder");return o.toString()}function nTe(n,t){return t.needsPresentation!==!0&&t.questions[t.index]&&$y(n)===t.actor&&n?.message?.message_type==="text"&&CA(zp(n))}function sTe(n){for(let t of["messagesReceived","messagesReplied","messagesRejected"])n[t]??=0;n.lastMessageAt??=null,n.lastReplyAt??=null,n.lastRejectedAt??=null,n.lastError??=null,n.lastMessageError??=null}var em=class{#e;#A;#t;#r;#a=new Map;#i=new Ii;#c=new Map;#s=new Map;#I=new Map;#o=new Set;#n=new Set;#g=new Set;#l=new Set;#p=new Map;#d=new Map;#h=new Map;#E=new Map;#u=new Map;#B=new Map;#f=new Map;#m=new Map;#y=new Map;#Q;#C;#b;#M;#w;#S;#_;#R;#k;#N;#v;#T=null;#F=0;#O;#U;#L=new Map;#Y=new Map;#K=null;#J=new Map;#P=new Map;#H=new Map;#q=new Map;#G;constructor({client:t,channel:o,harness:i,state:e,status:a,allowedSenderOpenIds:A=new Set,botId:r,appId:s,botOpenId:g,groupResponseMode:c=ec.ALL,repair:I,repairPollIntervalMs:d=eTe,repairLinkWaitMs:B=$_e,cardDataTimeoutMs:f=X_e,replyTimeoutMs:Q=6e5,logger:y=console,signal:m}){if(!t||!i||!e||!a)throw new TypeError("Feishu bridge dependencies are required");if(I!=null){if(!I||typeof I.start!="function"||typeof I.status!="function"||typeof I.cancel!="function")throw new TypeError("Feishu repair capability requires start/status/cancel");if(!CA(r)||!CA(s))throw new TypeError("Feishu repair capability requires botId and appId")}if(!Number.isFinite(d)||d<=0||!Number.isFinite(B)||B<=0||!Number.isFinite(f)||f<=0)throw new TypeError("Feishu timing values must be positive numbers");this.#e=t,this.#A=o,this.#t=i,this.#r=e,this.#C=a,this.#b=A,this.#_=CA(r),this.#R=CA(s),this.#k=CA(g),this.#N=Ji(c),this.#v=I??null,this.#O=d,this.#U=B,this.#G=f,this.#M=Q,this.#w=y,this.#Q=new ii({label:"Feishu",logger:y}),this.#S=m,sTe(this.#C),typeof this.#t?.watchHarnessEvents=="function"&&queueMicrotask(()=>this.#Te())}setGroupResponseMode(t){this.#N=Ji(t)}#$(t){if(t?.message?.chat_type==="p2p")return!0;let o=Array.isArray(t?.message?.mentions)?t.message.mentions:[];return this.#k?o.some(i=>i?.id?.open_id===this.#k||i?.open_id===this.#k):o.length>0}accept(t){if(this.#S?.aborted)return Promise.resolve();let o=CA(t?.message?.message_id);if(!o||Nz(t))return Promise.resolve();if(!Rz(t,this.#b))return this.#C.messagesRejected+=1,this.#C.lastRejectedAt=new Date().toISOString(),this.#w.warn?.("[dsh-feishu] ignored a message from a sender outside the allowlist"),Promise.resolve();let i=this.#$(t);if(t?.message?.chat_type!=="p2p"&&this.#N===ec.MENTION&&!i||this.#r.hasSeen(o)||this.#o.has(o))return Promise.resolve();let e;try{e=_z(t)}catch{return this.#C.messagesRejected+=1,this.#C.lastRejectedAt=new Date().toISOString(),Promise.resolve()}if(t.message.chat_type==="p2p"){let f=CA(t.message.chat_id);f&&io(this.#r,{chatId:f})}this.#o.add(o);let a=this.#EA(o),A=Pk(t,this.#e),r=CA(A.content)??"",s=t.message.message_type==="text"?CA(zp(t))??"":"",g=t.message.message_type==="text"&&lo(s),c=this.#c.get(e),I=this.#i.status(e);if(g&&t.message.chat_type!=="p2p")return this.#te(t,o,a,{message:Tn()});if(t.message.chat_type==="p2p"&&(g||I.phase==="collecting")){let Q=/^\/batch$/iu.test(s)&&I.phase==="idle"&&(this.#a.has(e)||c||this.#Q.hasPending(e))?{handled:!0,kind:"busy",message:po()}:this.#i.handle(e,s,{plainText:t.message.message_type==="text"&&!!s});if(Q.handled){if(Q.kind==="submit"){let y={...t,batchSubmission:{token:Q.token},message:{...t.message,message_type:"text",content:JSON.stringify({text:Q.prompt}),mentions:[]}};return this.#z(y,o,e,a)}return this.#te(t,o,a,Q)}}if(tTe.test(r))return Promise.resolve().then(()=>this.#Se(t,e,{alreadyRecorded:!1})).then(()=>this.#Ae(o,a,"DONE")).catch(Q=>this.#V(t,o,a,Q)).finally(()=>this.#o.delete(o));let d=Gt(A)?null:Pi(r)?gi:Gi(r)?Fi:Li(r)?ci:null;if(d&&i){let f=this.#Fe(t,o,e,A,d),Q;return Q=f.then(()=>this.#Ae(o,a,"DONE")).catch(y=>this.#V(t,o,a,y)).finally(()=>{this.#o.delete(o),this.#g.delete(Q)}),this.#g.add(Q),Q}if(this.#fe(t,e))return Promise.resolve().then(()=>this.#Qe(t,o)).then(()=>this.#Ae(o,a,"DONE")).catch(Q=>this.#V(t,o,a,Q)).finally(()=>this.#o.delete(o));let B=this.#Q.claimReply({key:e,actor:$y(t),messageId:o,text:zp(t)??"",addressed:i,hasPendingQuestion:!!c,questionCompletion:c?.submitting||c?.claimedReplyMessageId?c.queue:null,isQuestionPending:()=>this.#c.has(e),send:f=>this.#D(t.message.chat_id,f)});if(B){let f=B.process(async()=>this.#r.hasSeen(o)?!1:(await this.#r.markSeen(o),this.#C.lastMessageAt=new Date().toISOString(),this.#C.messagesReceived+=1,!0)),Q;return Q=f.then(()=>this.#Ae(o,a,"DONE")).catch(y=>this.#V(t,o,a,y)).finally(()=>{this.#o.delete(o),this.#n.delete(Q)}),this.#n.add(Q),Q}if(c&&$y(t)!==c.actor)return this.#z(t,o,e,a);if(c?.submitting||c?.claimedReplyMessageId)return this.#z(t,o,e,a);if(c){nTe(t,c)&&(c.claimedReplyMessageId=o);let Q=(c.queue??Promise.resolve()).catch(()=>{}).then(()=>this.#lA(t,o,e,c,a));c.queue=Q;let y=()=>{c.claimedReplyMessageId===o&&(c.claimedReplyMessageId=null),c.queue===Q&&(c.queue=null)},m;return m=Q.then(()=>(y(),this.#Ae(o,a,"DONE")),_=>(y(),this.#V(t,o,a,_))).finally(()=>{y(),this.#o.delete(o),this.#n.delete(m)}),this.#n.add(m),m}return this.#z(t,o,e,a)}#te(t,o,i,e){let a;return a=Promise.resolve().then(async()=>{this.#r.hasSeen(o)||(await this.#r.markSeen(o),this.#C.lastMessageAt=new Date().toISOString(),this.#C.messagesReceived+=1,e?.message&&await this.#D(t.message.chat_id,e.message),this.#C.lastError=null)}).then(()=>this.#Ae(o,i,"DONE")).catch(A=>this.#V(t,o,i,A)).finally(()=>{this.#o.delete(o),this.#g.delete(a)}),this.#g.add(a),a}#z(t,o,i,e,{releaseMessageId:a=!0,alreadyRecorded:A=!1,finalize:r=!0}={}){let g=(this.#a.get(i)??Promise.resolve()).catch(()=>{}).then(()=>this.#Se(t,i,{alreadyRecorded:A})),c=r?g.then(async d=>(await this.#Ae(o,e,"DONE"),d)).catch(d=>this.#V(t,o,e,d)):g,I;return I=c.finally(()=>{a&&this.#o.delete(o),this.#a.get(i)===I&&this.#a.delete(i)}),this.#a.set(i,I),I}#Z(t,{logLabel:o="operation",logLevel:i="warn",userMessage:e,reason:a}={}){this.#C.lastError=t?.message??String(t);let A=At(this.#C,t,{userMessage:e,reason:a});return this.#w?.[i]?.(`[dsh-feishu] ${o} failed [${A.referenceId}]:`,t?.message??String(t)),A}async#x(t,o,i={}){let e=this.#Z(o,i),a=i.appendMessage?`${dt(e)} +`;this.#t=this.#t.then(async()=>{await O_e(T_e(this.#e),{recursive:!0,mode:448});let o=`${this.#e}.tmp`;await __e(o,t,{encoding:"utf8",mode:384}),await M_e(o,this.#e)}),await this.#t}};var ec=Object.freeze({MENTION:"mention",ALL:"all"});function Ji(n){return n===ec.ALL?ec.ALL:ec.MENTION}function qy(n){return n===ec.MENTION||n===ec.ALL}var zy=()=>D("\u8FD9\u4E2A\u95EE\u9898\u5DF2\u5728\u5176\u4ED6\u5BA2\u6237\u7AEF\u5904\u7406\uFF0C\u65E0\u9700\u518D\u6B21\u56DE\u7B54\u3002"),k_e=30*6e4,v_e=/^\/m(?:enu)?$/i,P_e=/^\/repair(?:\s|$)/i,G_e=/^\/repair(?:\s+(qr|status|cancel|verify))?\s*$/i,qz=/^\/watch(?:\s+([^\s]+))?$/i,zz=/^\/unwatch(?:\s+([^\s]+))?$/i,F_e=/^\/watchlist$/i,L_e=/^\/sessionlist(?:\s|$)/i,U_e=/^\/workspacelist$/i,H_e=/^\d{1,2}$/,K_e=10*6e4,x_e=50,Y_e=8,j_e=8,J_e=10*6e4,Vz=400,q_e=10*6e4,z_e=100,V_e=50,W_e=500,Z_e=5e3,X_e=5e3,$_e=15e3,eTe=1e3,eV=new Set(["starting","qr_ready","polling","slow_down","domain_switched"]),Lk=new Set([...eV,"saving"]),Vy=new Set(["succeeded","expired","cancelled","error"]),ATe=new Set(["accounts.feishu.cn","open.feishu.cn","accounts.larksuite.com","open.larksuite.com"]),Wz=/^\/archived(?:\s+(on|off))?$/i,tTe=/^\/(?:m(?:enu)?|new|help|status|compact|sessionlist(?:\s|$)|workspacelist|watchlist|archived(?:\s+(on|off))?)$/i,rTe=["/session Session ID \u6216\u5F53\u524D\u5DE5\u4F5C\u533A\u5E8F\u53F7 \u5C06\u5F53\u524D\u804A\u5929\u7ED1\u5B9A\u5230\u6307\u5B9A\u4F1A\u8BDD","/workspacelist \u5217\u51FA\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84","/sessionlist [\u5DE5\u4F5C\u533A\u5E8F\u53F7\u6216\u7EDD\u5BF9\u8DEF\u5F84] \u5217\u51FA\u4F1A\u8BDD ID \u548C\u6807\u9898"];function TC(n){switch(n?.code){case"workspace-not-absolute":return D("\u5DE5\u4F5C\u533A\u5FC5\u987B\u662F\u7EDD\u5BF9\u8DEF\u5F84\u3002");case"workspace-not-found":return D("\u5DE5\u4F5C\u533A\u8DEF\u5F84\u4E0D\u5B58\u5728\u3002");case"workspace-not-directory":return D("\u5DE5\u4F5C\u533A\u8DEF\u5F84\u5FC5\u987B\u6307\u5411\u4E00\u4E2A\u76EE\u5F55\u3002");case"workspace-bot-not-found":return D("\u673A\u5668\u4EBA\u6B63\u5728\u79FB\u9664\u6216\u5DF2\u91CD\u65B0\u63A5\u5165\uFF0C\u65E0\u6CD5\u64CD\u4F5C\u539F\u4F1A\u8BDD\u7684\u5DE5\u4F5C\u533A\u3002");default:return D("\u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002")}}function aTe(n,t){let o=String(n??D("\u7ED3\u679C\u6587\u4EF6")).replace(/[\r\n]+/g," ").trim()||D("\u7ED3\u679C\u6587\u4EF6");switch(t?.code){case"artifact-permission-required":return D("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u673A\u5668\u4EBA\u7F3A\u5C11\u98DE\u4E66\u6587\u4EF6\u4E0A\u4F20\u6743\u9650 im:resource\u3002\u8BF7\u79C1\u804A\u673A\u5668\u4EBA\u6267\u884C /repair \u547D\u4EE4\uFF0C\u6216\u8005\u5728\u300CIM\u673A\u5668\u4EBA\u300D\u8BBE\u7F6E\u9875\u70B9\u51FB\u201C\u8865\u5168\u6743\u9650\u201D\u6309\u94AE\u5E76\u626B\u7801\u3002\u5B8C\u6210\u98DE\u4E66\u8981\u6C42\u7684\u53D1\u5E03\u5BA1\u6279\u540E\u91CD\u8BD5\u3002",{name:o});case"artifact-too-large":return D("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u8D85\u8FC7\u98DE\u4E66 30 MB \u4E0A\u9650\uFF0C\u672A\u53D1\u9001\u3002",{name:o});case"artifact-empty":return D("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u4E3A\u7A7A\uFF0C\u98DE\u4E66\u4E0D\u5141\u8BB8\u53D1\u9001\u7A7A\u6587\u4EF6\u3002",{name:o});case"artifact-changed":case"artifact-invalid":case"artifact-unavailable":return D("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6\u6216\u51C6\u5907\u53D1\u9001\uFF0C\u8BF7\u786E\u8BA4\u6587\u4EF6\u4ECD\u53EF\u8BBF\u95EE\u540E\u91CD\u8BD5\u3002",{name:o});case"artifact-rate-limited":return D("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u88AB\u98DE\u4E66\u9650\u6D41\uFF0C\u672A\u80FD\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",{name:o});case"artifact-delivery-uncertain":return D("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u53D1\u9001\u7ED3\u679C\u672A\u80FD\u786E\u8BA4\uFF0C\u8BF7\u5148\u68C0\u67E5\u804A\u5929\u5185\u662F\u5426\u5DF2\u6536\u5230\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u8BD5\u3002",{name:o});default:return D("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u6682\u65F6\u672A\u80FD\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",{name:o})}}function Wy(n,t){return typeof n=="string"&&n.trim()?n:t.length>0?D("\u7ED3\u679C\u6587\u4EF6\u5DF2\u751F\u6210\u3002"):n}function CA(n){return typeof n=="string"&&n.trim()?n.trim():null}function Zz(n){if(n&&typeof n=="object"&&!Array.isArray(n))return n;if(typeof n!="string"||!n.trim())return{};try{let t=JSON.parse(n);return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}catch{return{}}}function RC(n){if(n==null)return null;if(Array.isArray(n)){for(let o of n){let i=RC(o);if(i!==null)return i}return null}if(n&&typeof n=="object")return"value"in n?RC(n.value):"option"in n?RC(n.option):null;if(typeof n!="string")return null;let t=n.trim();if(!t)return null;if(t.startsWith("[")||t.startsWith("{")||t.startsWith('"'))try{let o=JSON.parse(t);if(o!==n)return RC(o)}catch{}return t}function Xs(n){if(n==null)return[];if(Array.isArray(n))return n.flatMap(o=>Xs(o));if(n&&typeof n=="object")return"value"in n?Xs(n.value):"option"in n?Xs(n.option):[];if(typeof n!="string")return[];let t=n.trim();if(!t)return[];if(t.startsWith("[")||t.startsWith("{")||t.startsWith('"'))try{let o=JSON.parse(t);if(o!==n)return Xs(o)}catch{}return t.split(",").map(o=>o.trim()).filter(Boolean)}function nn(n){return Number.isSafeInteger(n)&&n>=-1}function kC(n){return Number.isSafeInteger(n)&&n>=0}function Xy(n){return Number.isSafeInteger(n?.watchStartedAt)&&n.watchStartedAt>=0?n.watchStartedAt:null}function Zy(n){return n&&(Xy(n)!==null||!nn(n.lastSeq))}function iTe(n){return(Array.isArray(n?.events)?n.events:[]).map(t=>t?.event??t).filter(t=>t&&typeof t=="object"&&kC(t.seq)).sort((t,o)=>t.seq-o.seq)}function $y(n){return CA(n?.sender?.sender_id?.open_id)??CA(n?.sender?.sender_id?.user_id)}function oTe(n){return CA(n?.sender?.sender_id?.open_id)}function Xz(n,t){return new Promise((o,i)=>{if(t?.aborted){i(t.reason??new DOMException("Aborted","AbortError"));return}let e=setTimeout(a,n);e.unref?.();function a(){t?.removeEventListener("abort",A),o()}function A(){clearTimeout(e),i(t.reason??new DOMException("Aborted","AbortError"))}t?.addEventListener("abort",A,{once:!0})})}function NC(n,{botId:t}={}){let o=n&&typeof n=="object"?n:{},i=o.registration&&typeof o.registration=="object"?o.registration:o,e=CA(i.operation)??CA(o.operation);if(e&&e!=="callback_repair")throw new Error("The active Feishu operation is not a callback repair");let a=CA(i.botId)??CA(o.botId);if(t&&a&&a!==t)throw new Error("The Feishu repair belongs to another bot");let A=CA(i.state),r=i.attemptId??i.attempt,s=typeof r=="string"||Number.isFinite(r)?String(r):null;if(!A||!s)throw new Error("Feishu returned an invalid repair status");let g=CA(i.verificationUrl)??CA(i.qrCodeUrl),c=Number(i.expiresAt),I=Number(i.remainingSeconds),d=Number(i.pollIntervalMs)||Number(i.pollIntervalSeconds)*1e3;return{state:A,attemptId:s,botId:a,verificationUrl:g,expiresAt:Number.isFinite(c)?c:null,remainingSeconds:Number.isFinite(I)?I:null,pollIntervalMs:Number.isFinite(d)&&d>0?d:null,error:i.error&&typeof i.error=="object"?{code:CA(i.error.code),message:CA(i.error.message)}:null}}function $z(n,t){let o=new URL(n);if(o.protocol!=="https:"||!ATe.has(o.hostname))throw new Error("Feishu returned an untrusted repair URL");if(o.searchParams.get("tp")!=="sdk"||o.searchParams.get("clientID")!==t||o.searchParams.has("createOnly"))throw new Error("Feishu returned an invalid existing-app repair URL");if(o.toString().includes("{{client_id}}")||o.toString().includes("%7B%7Bclient_id%7D%7D"))throw new Error("Feishu returned an unresolved client id placeholder");return o.toString()}function nTe(n,t){return t.needsPresentation!==!0&&t.questions[t.index]&&$y(n)===t.actor&&n?.message?.message_type==="text"&&CA(zp(n))}function sTe(n){for(let t of["messagesReceived","messagesReplied","messagesRejected"])n[t]??=0;n.lastMessageAt??=null,n.lastReplyAt??=null,n.lastRejectedAt??=null,n.lastError??=null,n.lastMessageError??=null}var em=class{#e;#A;#t;#r;#a=new Map;#i=new Ii;#c=new Map;#s=new Map;#I=new Map;#o=new Set;#n=new Set;#g=new Set;#l=new Set;#p=new Map;#d=new Map;#h=new Map;#E=new Map;#u=new Map;#B=new Map;#f=new Map;#m=new Map;#y=new Map;#Q;#C;#b;#M;#w;#S;#_;#R;#k;#N;#v;#T=null;#F=0;#O;#U;#L=new Map;#Y=new Map;#K=null;#J=new Map;#P=new Map;#H=new Map;#q=new Map;#G;constructor({client:t,channel:o,harness:i,state:e,status:a,allowedSenderOpenIds:A=new Set,botId:r,appId:s,botOpenId:g,groupResponseMode:c=ec.ALL,repair:I,repairPollIntervalMs:d=eTe,repairLinkWaitMs:B=$_e,cardDataTimeoutMs:f=X_e,replyTimeoutMs:Q=6e5,logger:y=console,signal:m}){if(!t||!i||!e||!a)throw new TypeError("Feishu bridge dependencies are required");if(I!=null){if(!I||typeof I.start!="function"||typeof I.status!="function"||typeof I.cancel!="function")throw new TypeError("Feishu repair capability requires start/status/cancel");if(!CA(r)||!CA(s))throw new TypeError("Feishu repair capability requires botId and appId")}if(!Number.isFinite(d)||d<=0||!Number.isFinite(B)||B<=0||!Number.isFinite(f)||f<=0)throw new TypeError("Feishu timing values must be positive numbers");this.#e=t,this.#A=o,this.#t=i,this.#r=e,this.#C=a,this.#b=A,this.#_=CA(r),this.#R=CA(s),this.#k=CA(g),this.#N=Ji(c),this.#v=I??null,this.#O=d,this.#U=B,this.#G=f,this.#M=Q,this.#w=y,this.#Q=new ii({label:"Feishu",logger:y}),this.#S=m,sTe(this.#C),typeof this.#t?.watchHarnessEvents=="function"&&queueMicrotask(()=>this.#Te())}setGroupResponseMode(t){this.#N=Ji(t)}#$(t){if(t?.message?.chat_type==="p2p")return!0;let o=Array.isArray(t?.message?.mentions)?t.message.mentions:[];return this.#k?o.some(i=>i?.id?.open_id===this.#k||i?.open_id===this.#k):o.length>0}accept(t){if(this.#S?.aborted)return Promise.resolve();let o=CA(t?.message?.message_id);if(!o||Nz(t))return Promise.resolve();if(!Rz(t,this.#b))return this.#C.messagesRejected+=1,this.#C.lastRejectedAt=new Date().toISOString(),this.#w.warn?.("[dsh-feishu] ignored a message from a sender outside the allowlist"),Promise.resolve();let i=this.#$(t);if(t?.message?.chat_type!=="p2p"&&this.#N===ec.MENTION&&!i||this.#r.hasSeen(o)||this.#o.has(o))return Promise.resolve();let e;try{e=_z(t)}catch{return this.#C.messagesRejected+=1,this.#C.lastRejectedAt=new Date().toISOString(),Promise.resolve()}if(t.message.chat_type==="p2p"){let f=CA(t.message.chat_id);f&&io(this.#r,{chatId:f})}this.#o.add(o);let a=this.#EA(o),A=Pk(t,this.#e),r=CA(A.content)??"",s=t.message.message_type==="text"?CA(zp(t))??"":"",g=t.message.message_type==="text"&&lo(s),c=this.#c.get(e),I=this.#i.status(e);if(g&&t.message.chat_type!=="p2p")return this.#te(t,o,a,{message:Tn()});if(t.message.chat_type==="p2p"&&(g||I.phase==="collecting")){let Q=/^\/batch$/iu.test(s)&&I.phase==="idle"&&(this.#a.has(e)||c||this.#Q.hasPending(e))?{handled:!0,kind:"busy",message:po()}:this.#i.handle(e,s,{plainText:t.message.message_type==="text"&&!!s});if(Q.handled){if(Q.kind==="submit"){let y={...t,batchSubmission:{token:Q.token},message:{...t.message,message_type:"text",content:JSON.stringify({text:Q.prompt}),mentions:[]}};return this.#z(y,o,e,a)}return this.#te(t,o,a,Q)}}if(tTe.test(r))return Promise.resolve().then(()=>this.#Se(t,e,{alreadyRecorded:!1})).then(()=>this.#Ae(o,a,"DONE")).catch(Q=>this.#V(t,o,a,Q)).finally(()=>this.#o.delete(o));let d=Gt(A)?null:Pi(r)?gi:Gi(r)?Fi:Li(r)?ci:null;if(d&&i){let f=this.#Fe(t,o,e,A,d),Q;return Q=f.then(()=>this.#Ae(o,a,"DONE")).catch(y=>this.#V(t,o,a,y)).finally(()=>{this.#o.delete(o),this.#g.delete(Q)}),this.#g.add(Q),Q}if(this.#fe(t,e))return Promise.resolve().then(()=>this.#Qe(t,o)).then(()=>this.#Ae(o,a,"DONE")).catch(Q=>this.#V(t,o,a,Q)).finally(()=>this.#o.delete(o));let B=this.#Q.claimReply({key:e,actor:$y(t),messageId:o,text:zp(t)??"",addressed:i,hasPendingQuestion:!!c,questionCompletion:c?.submitting||c?.claimedReplyMessageId?c.queue:null,isQuestionPending:()=>this.#c.has(e),send:f=>this.#D(t.message.chat_id,f)});if(B){let f=B.process(async()=>this.#r.hasSeen(o)?!1:(await this.#r.markSeen(o),this.#C.lastMessageAt=new Date().toISOString(),this.#C.messagesReceived+=1,!0)),Q;return Q=f.then(()=>this.#Ae(o,a,"DONE")).catch(y=>this.#V(t,o,a,y)).finally(()=>{this.#o.delete(o),this.#n.delete(Q)}),this.#n.add(Q),Q}if(c&&$y(t)!==c.actor)return this.#z(t,o,e,a);if(c?.submitting||c?.claimedReplyMessageId)return this.#z(t,o,e,a);if(c){nTe(t,c)&&(c.claimedReplyMessageId=o);let Q=(c.queue??Promise.resolve()).catch(()=>{}).then(()=>this.#lA(t,o,e,c,a));c.queue=Q;let y=()=>{c.claimedReplyMessageId===o&&(c.claimedReplyMessageId=null),c.queue===Q&&(c.queue=null)},m;return m=Q.then(()=>(y(),this.#Ae(o,a,"DONE")),_=>(y(),this.#V(t,o,a,_))).finally(()=>{y(),this.#o.delete(o),this.#n.delete(m)}),this.#n.add(m),m}return this.#z(t,o,e,a)}#te(t,o,i,e){let a;return a=Promise.resolve().then(async()=>{this.#r.hasSeen(o)||(await this.#r.markSeen(o),this.#C.lastMessageAt=new Date().toISOString(),this.#C.messagesReceived+=1,e?.message&&await this.#D(t.message.chat_id,e.message),this.#C.lastError=null)}).then(()=>this.#Ae(o,i,"DONE")).catch(A=>this.#V(t,o,i,A)).finally(()=>{this.#o.delete(o),this.#g.delete(a)}),this.#g.add(a),a}#z(t,o,i,e,{releaseMessageId:a=!0,alreadyRecorded:A=!1,finalize:r=!0}={}){let g=(this.#a.get(i)??Promise.resolve()).catch(()=>{}).then(()=>this.#Se(t,i,{alreadyRecorded:A})),c=r?g.then(async d=>(await this.#Ae(o,e,"DONE"),d)).catch(d=>this.#V(t,o,e,d)):g,I;return I=c.finally(()=>{a&&this.#o.delete(o),this.#a.get(i)===I&&this.#a.delete(i)}),this.#a.set(i,I),I}#Z(t,{logLabel:o="operation",logLevel:i="warn",userMessage:e,reason:a}={}){this.#C.lastError=t?.message??String(t);let A=At(this.#C,t,{userMessage:e,reason:a});return this.#w?.[i]?.(`[dsh-feishu] ${o} failed [${A.referenceId}]:`,t?.message??String(t)),A}async#x(t,o,i={}){let e=this.#Z(o,i),a=i.appendMessage?`${dt(e)} ${i.appendMessage}`:dt(e);return await this.#D(t,a).catch(()=>{}),e}async#V(t,o,i,e){if(e?.code==="turn-stopped"){await this.#Ge(o,i),e?.batchInputMessage&&await this.#D(t.message.chat_id,e.batchInputMessage).catch(()=>{});return}if(this.#S?.aborted){await this.#Ge(o,i);return}let a=Eo(e)??go(e),A=this.#Z(e,{logLabel:"message handling",logLevel:"error",userMessage:a,reason:vi(e)?.reason});await this.#Ae(o,i,"ERROR");let r=e?.batchInputMessage?`${dt(A)} diff --git a/package.json b/package.json index 1144f55..38b4402 100644 --- a/package.json +++ b/package.json @@ -83,7 +83,7 @@ "scripts": { "build": "node plugin-src/client/build.mjs && node plugin-src/host/build.mjs", "test": "node --test test/*.test.mjs test/channels/*/*.test.mjs", - "check": "npm test && npm run build && node scripts/verify-package.mjs" + "check": "npm run build && npm test && node scripts/verify-package.mjs" }, "engines": { "node": ">=22.19" diff --git a/plugin-src/client/channels/dingtalk/index.js b/plugin-src/client/channels/dingtalk/index.js index 67e4cef..fad8572 100644 --- a/plugin-src/client/channels/dingtalk/index.js +++ b/plugin-src/client/channels/dingtalk/index.js @@ -16,7 +16,6 @@ import { } from '../../channel-card-meta.js'; import { DINGTALK_ENDPOINTS, - DINGTALK_RPC_CHANNEL, connectionTestFeedback, formatRemaining, normalizeProvisioning, @@ -29,9 +28,6 @@ import { installDingtalkStyles } from './styles.js'; const ACTIVE_PROVISION_STATES = new Set(['pending', 'scanned', 'authorizing', 'creating', 'connecting']); -export const name = 'dingtalk-settings'; -export const inject = ['slots', 'connection']; - function DingtalkIcon({ size = 28 }) { return h('svg', { width: size, @@ -864,16 +860,3 @@ export function DingtalkSettingsTab({ rpcCall }) { }) : null))); } - -export function apply(ctx) { - ctx.effect(() => installDingtalkStyles(), 'dingtalk-settings: install client styles'); - const rpcCall = (endpoint, payload, signal) => - ctx.connection.rpc.call(DINGTALK_RPC_CHANNEL, endpoint, payload, signal); - ctx.slots.inject('settings.plugins.tab', () => ctx.slots.register({ - name: 'settings.plugins.tab', - id: 'dingtalk', - order: 40, - label: '钉钉', - inject: () => ({ rpcCall }), - }, DingtalkSettingsTab)); -} diff --git a/plugin-src/client/channels/dingtalk/styles.js b/plugin-src/client/channels/dingtalk/styles.js index 1b85439..7f89f6e 100644 --- a/plugin-src/client/channels/dingtalk/styles.js +++ b/plugin-src/client/channels/dingtalk/styles.js @@ -1,4 +1,4 @@ -export const DINGTALK_STYLE_ID = 'xmanrui-dsh-dingtalk-settings'; +export const DINGTALK_STYLE_ID = 'xmanrui-dsh-im-dingtalk-settings'; const CSS = String.raw` .ddt-page { @@ -126,7 +126,7 @@ export function installDingtalkStyles() { const existing = document.querySelector(`style[data-plugin-css="${DINGTALK_STYLE_ID}"]`); if (existing) return () => {}; const style = document.createElement('style'); - style.dataset.plugin = '@xmanrui/dsh-dingtalk'; + style.dataset.plugin = '@xmanrui/dsh-im'; style.dataset.pluginCss = DINGTALK_STYLE_ID; style.textContent = CSS; document.head.appendChild(style); diff --git a/plugin-src/client/channels/feishu/index.js b/plugin-src/client/channels/feishu/index.js index bb77722..3f506ce 100644 --- a/plugin-src/client/channels/feishu/index.js +++ b/plugin-src/client/channels/feishu/index.js @@ -6,7 +6,6 @@ import { h } from "../../i18n.js"; import { FEISHU_ENDPOINTS, FEISHU_REGISTRATION_OPERATIONS, - FEISHU_RPC_CHANNEL, formatRemaining, normalizeBotsSnapshot, normalizeGroupResponseMode, @@ -28,11 +27,6 @@ import { ChannelListHeading, LastMessageErrorSummary, } from "../../channel-card-meta.js"; -import { installFeishuStyles } from "./styles.js"; - -export const name = "feishu-settings"; -export const inject = ["slots", "connection"]; - const CALLBACK_REPAIR_OPERATION = FEISHU_REGISTRATION_OPERATIONS.CALLBACK_REPAIR; const GROUP_MESSAGE_PERMISSION_OPERATION = FEISHU_REGISTRATION_OPERATIONS.GROUP_MESSAGE_PERMISSION; @@ -1540,26 +1534,3 @@ export function FeishuSettingsTab({ rpcCall }) { ), )); } - -export function apply(ctx) { - ctx.effect( - () => installFeishuStyles(), - "feishu-settings: install client styles", - ); - - const rpcCall = (endpoint, payload, signal) => - ctx.connection.rpc.call(FEISHU_RPC_CHANNEL, endpoint, payload, signal); - - ctx.slots.inject("settings.plugins.tab", () => - ctx.slots.register( - { - name: "settings.plugins.tab", - id: "feishu", - order: 20, - label: "飞书", - inject: () => ({ rpcCall }), - }, - FeishuSettingsTab, - ), - ); -} diff --git a/plugin-src/client/channels/feishu/styles.js b/plugin-src/client/channels/feishu/styles.js index 82bb1df..ba000da 100644 --- a/plugin-src/client/channels/feishu/styles.js +++ b/plugin-src/client/channels/feishu/styles.js @@ -1,4 +1,4 @@ -export const FEISHU_STYLE_ID = "beihuixinghe-dsh-feishu-settings"; +export const FEISHU_STYLE_ID = "xmanrui-dsh-im-feishu-settings"; const CSS = String.raw` .bxf-page { @@ -562,7 +562,7 @@ export function installFeishuStyles() { } const style = document.createElement("style"); - style.dataset.plugin = "@xmanrui/dsh-feishu"; + style.dataset.plugin = "@xmanrui/dsh-im"; style.dataset.pluginCss = FEISHU_STYLE_ID; style.textContent = CSS; document.head.appendChild(style); diff --git a/plugin-src/client/channels/qq/index.js b/plugin-src/client/channels/qq/index.js index bd69277..80a53f5 100644 --- a/plugin-src/client/channels/qq/index.js +++ b/plugin-src/client/channels/qq/index.js @@ -18,7 +18,6 @@ import { import { installDingtalkStyles } from '../dingtalk/styles.js'; import { QQ_ENDPOINTS, - QQ_RPC_CHANNEL, connectionTestFeedback, formatRemaining, normalizeProvisioning, @@ -514,11 +513,3 @@ export function QqSettingsTab({ rpcCall }) { ? h(EmptyView, { busy, onStart: () => void startProvisioning() }) : null, botList))); } - -export function apply(ctx) { - ctx.effect(() => installQqStyles(), 'qq-settings: install client styles'); - const rpcCall = (endpoint, payload, signal) => ctx.connection.rpc.call(QQ_RPC_CHANNEL, endpoint, payload, signal); - ctx.slots.inject('settings.plugins.tab', () => ctx.slots.register({ - name: 'settings.plugins.tab', id: 'qq', order: 50, label: 'QQ', inject: () => ({ rpcCall }), - }, QqSettingsTab)); -} diff --git a/plugin-src/client/channels/wecom/index.js b/plugin-src/client/channels/wecom/index.js index 18cdfa5..364a2b3 100644 --- a/plugin-src/client/channels/wecom/index.js +++ b/plugin-src/client/channels/wecom/index.js @@ -18,7 +18,6 @@ import { import { installDingtalkStyles } from '../dingtalk/styles.js'; import { WECOM_ENDPOINTS, - WECOM_RPC_CHANNEL, formatRemaining, normalizeProvisioning, normalizeSnapshot, @@ -546,11 +545,3 @@ export function WecomSettingsTab({ rpcCall }) { ? h(EmptyView, { busy, onStart: () => void startProvisioning() }) : null, botList))); } - -export function apply(ctx) { - ctx.effect(() => installWecomStyles(), 'wecom-settings: install client styles'); - const rpcCall = (endpoint, payload, signal) => ctx.connection.rpc.call(WECOM_RPC_CHANNEL, endpoint, payload, signal); - ctx.slots.inject('settings.plugins.tab', () => ctx.slots.register({ - name: 'settings.plugins.tab', id: 'wecom', order: 45, label: '企业微信', inject: () => ({ rpcCall }), - }, WecomSettingsTab)); -} diff --git a/plugin-src/client/channels/weixin/index.js b/plugin-src/client/channels/weixin/index.js index d2ddef8..4b0796c 100644 --- a/plugin-src/client/channels/weixin/index.js +++ b/plugin-src/client/channels/weixin/index.js @@ -5,7 +5,6 @@ import { QrActionIcon } from '../../credential-binding.js'; import { h } from '../../i18n.js'; import { WEIXIN_ENDPOINTS, - WEIXIN_RPC_CHANNEL, formatRemaining, normalizeProvisioning, normalizeSnapshot, @@ -27,11 +26,6 @@ import { ChannelListHeading, LastMessageErrorSummary, } from '../../channel-card-meta.js'; -import { installWeixinStyles } from './styles.js'; - -export const name = 'weixin-settings'; -export const inject = ['slots', 'connection']; - const Button = React.forwardRef(function Button( { children, kind = 'secondary', className = '', ...props }, ref, @@ -717,16 +711,3 @@ export function WeixinSettingsTab({ rpcCall }) { : null), )); } - -export function apply(ctx) { - ctx.effect(() => installWeixinStyles(), 'weixin-settings: install client styles'); - const rpcCall = (endpoint, payload, signal) => - ctx.connection.rpc.call(WEIXIN_RPC_CHANNEL, endpoint, payload, signal); - ctx.slots.inject('settings.plugins.tab', () => ctx.slots.register({ - name: 'settings.plugins.tab', - id: 'weixin', - order: 30, - label: '微信', - inject: () => ({ rpcCall }), - }, WeixinSettingsTab)); -} diff --git a/plugin-src/client/channels/weixin/styles.js b/plugin-src/client/channels/weixin/styles.js index ff66905..152e2c0 100644 --- a/plugin-src/client/channels/weixin/styles.js +++ b/plugin-src/client/channels/weixin/styles.js @@ -1,4 +1,4 @@ -export const WEIXIN_STYLE_ID = 'xmanrui-dsh-weixin-settings'; +export const WEIXIN_STYLE_ID = 'xmanrui-dsh-im-weixin-settings'; const CSS = String.raw` .dxw-page { @@ -107,7 +107,7 @@ export function installWeixinStyles() { const existing = document.querySelector(`style[data-plugin-css="${WEIXIN_STYLE_ID}"]`); if (existing) return () => {}; const style = document.createElement('style'); - style.dataset.plugin = '@xmanrui/dsh-weixin'; + style.dataset.plugin = '@xmanrui/dsh-im'; style.dataset.pluginCss = WEIXIN_STYLE_ID; style.textContent = CSS; document.head.appendChild(style); diff --git a/plugin-src/client/index.js b/plugin-src/client/index.js index e2dfe61..5265d13 100644 --- a/plugin-src/client/index.js +++ b/plugin-src/client/index.js @@ -333,10 +333,10 @@ export function apply(ctx) { pickDirectory: () => ctx.workspaces.pickDirectory(), }); - ctx.slots.inject('settings.plugins.tab', () => ctx.slots.register({ - name: 'settings.plugins.tab', - id: 'im', - order: 20, + ctx.slots.inject('settings.section', () => ctx.slots.register({ + name: 'settings.section', + id: 'xmanrui-dsh-im', + order: 21, label: () => t('IM机器人'), locale: IM_LOCALE_NAMESPACE, inject: () => ({ diff --git a/scripts/verify-package.mjs b/scripts/verify-package.mjs index 2036a16..2df1d81 100644 --- a/scripts/verify-package.mjs +++ b/scripts/verify-package.mjs @@ -1,8 +1,23 @@ -import { access, readFile, stat } from 'node:fs/promises'; +import { access, readFile, readdir, stat } from 'node:fs/promises'; import { resolve } from 'node:path'; import { pathToFileURL } from 'node:url'; const root = resolve(import.meta.dirname, '..'); + +async function readSourceTree(directory) { + const entries = await readdir(directory, { withFileTypes: true }); + const chunks = []; + for (const entry of entries) { + const path = resolve(directory, entry.name); + if (entry.isDirectory()) { + chunks.push(await readSourceTree(path)); + } else if (entry.isFile() && /\.m?js$/u.test(entry.name)) { + chunks.push(await readFile(path, 'utf8')); + } + } + return chunks.join('\n'); +} + const required = [ 'lib/index.js', 'lib/client.js', @@ -35,7 +50,17 @@ const required = [ ]; await Promise.all(required.map((path) => access(resolve(root, path)))); -const [client, host, patch, manifestText, lockText, hostSource, clientSource, executable] = await Promise.all([ +const [ + client, + host, + patch, + manifestText, + lockText, + hostSource, + clientEntrySource, + clientSources, + executable, +] = await Promise.all([ readFile(resolve(root, 'lib/client.js'), 'utf8'), readFile(resolve(root, 'lib/index.js'), 'utf8'), readFile(resolve(root, 'cordis.patch.yml'), 'utf8'), @@ -43,6 +68,7 @@ const [client, host, patch, manifestText, lockText, hostSource, clientSource, ex readFile(resolve(root, 'package-lock.json'), 'utf8'), readFile(resolve(root, 'plugin-src/host/index.mjs'), 'utf8'), readFile(resolve(root, 'plugin-src/client/index.js'), 'utf8'), + readSourceTree(resolve(root, 'plugin-src/client')), stat(resolve(root, 'bin/dsh-im.mjs')), ]); const manifest = JSON.parse(manifestText); @@ -82,17 +108,28 @@ if (forbiddenDshLockPaths.length > 0) { ); } -if (!client.includes('id: "@xmanrui/dsh-im"')) { +if (!/\bid\s*:\s*["']@xmanrui\/dsh-im["']/u.test(client)) { throw new Error('client bundle does not register the dsh-im loader id'); } -if (!client.includes('id: "im"') - || !client.includes('label: () => t("IM\\u673A\\u5668\\u4EBA")') - || !client.includes('locale: IM_LOCALE_NAMESPACE') - || !client.includes('IM_LOCALE_NAMESPACE = "dsh-im"')) { - throw new Error('client bundle does not register the localized IM settings tab'); +const sourceSectionMarkers = [ + /ctx\.slots\.inject\(\s*["']settings\.section["']/u, + /name\s*:\s*["']settings\.section["']/u, + /id\s*:\s*["']xmanrui-dsh-im["']/u, + /order\s*:\s*21\b/u, + /label\s*:\s*\(\)\s*=>\s*t\(\s*["']IM机器人["']\s*\)/u, + /locale\s*:\s*IM_LOCALE_NAMESPACE\b/u, +]; +const bundleSectionPattern = /name\s*:\s*["']settings\.section["']\s*,\s*id\s*:\s*["']xmanrui-dsh-im["']\s*,\s*order\s*:\s*21\s*,\s*label\s*:\s*\(\)\s*=>\s*[$A-Z_a-z][$\w]*\(\s*["']IM(?:机器人|\\u673A\\u5668\\u4EBA)["']\s*\)\s*,\s*locale\s*:\s*(?:[$A-Z_a-z][$\w]*|["']dsh-im["'])/u; +if (sourceSectionMarkers.some((pattern) => !pattern.test(clientEntrySource)) + || !/IM_LOCALE_NAMESPACE\s*=\s*["']dsh-im["']/u.test(clientSources) + || !bundleSectionPattern.test(client)) { + throw new Error('client bundle does not register the localized top-level IM settings section'); } -if ((client.match(/ctx\.slots\.inject\("settings\.plugins\.tab"/g) ?? []).length !== 1) { - throw new Error('client bundle must register exactly one settings tab'); +if ((client.match(/\.slots\.inject\(\s*["']settings\.section["']/gu) ?? []).length !== 1) { + throw new Error('client bundle must register exactly one top-level settings section'); +} +if (client.includes('settings.plugins.tab') || clientSources.includes('settings.plugins.tab')) { + throw new Error('client source or bundle still contains the legacy Plugins-tab settings entry'); } if (/role:\s*["']switch|type:\s*["']checkbox/.test(client)) { throw new Error('client bundle contains a channel enable switch'); @@ -115,7 +152,7 @@ if (/@xmanrui\/dsh-(?:feishu|weixin|dingtalk)/.test(host)) { throw new Error('host bundle still imports an external channel plugin'); } if (/@xmanrui\/dsh-(?:feishu|weixin|dingtalk)/.test( - manifestText + lockText + hostSource + clientSource, + manifestText + lockText + hostSource + clientSources, )) { throw new Error('source or package metadata still depends on an external channel plugin'); } diff --git a/src/channels/feishu/bridge.mjs b/src/channels/feishu/bridge.mjs index 2180162..46e0a88 100644 --- a/src/channels/feishu/bridge.mjs +++ b/src/channels/feishu/bridge.mjs @@ -159,7 +159,7 @@ function artifactFailureText(fileName, error) { const name = String(fileName ?? t('结果文件')).replace(/[\r\n]+/g, ' ').trim() || t('结果文件'); switch (error?.code) { case 'artifact-permission-required': - return t('结果文件「{name}」已生成,但机器人缺少飞书文件上传权限 im:resource。请私聊机器人执行 /repair 命令,或者在插件页面点击“补全权限”按钮并扫码。完成飞书要求的发布审批后重试。', { name }); + return t('结果文件「{name}」已生成,但机器人缺少飞书文件上传权限 im:resource。请私聊机器人执行 /repair 命令,或者在「IM机器人」设置页点击“补全权限”按钮并扫码。完成飞书要求的发布审批后重试。', { name }); case 'artifact-too-large': return t('结果文件「{name}」超过飞书 30 MB 上限,未发送。', { name }); case 'artifact-empty': diff --git a/src/channels/feishu/message-utils.mjs b/src/channels/feishu/message-utils.mjs index 4e1558f..22f89cc 100644 --- a/src/channels/feishu/message-utils.mjs +++ b/src/channels/feishu/message-utils.mjs @@ -5,7 +5,7 @@ const FEISHU_MISSING_MESSAGE_SCOPE_CODE = 99991672; const FEISHU_ERROR_BODY_LIMIT = 64 * 1024; const FEISHU_ERROR_BODY_TIMEOUT_MS = 1_000; const FEISHU_IMAGE_PERMISSION_MESSAGE = - '飞书机器人缺少图片读取权限 im:message:readonly(飞书显示为“获取单聊、群组消息”)。请私聊机器人执行 /repair 命令,或者在插件页面点击“补全权限”按钮并扫码。按飞书提示发布新版本、完成必要审批后,再重新发送图片。'; + '飞书机器人缺少图片读取权限 im:message:readonly(飞书显示为“获取单聊、群组消息”)。请私聊机器人执行 /repair 命令,或者在「IM机器人」设置页点击“补全权限”按钮并扫码。按飞书提示发布新版本、完成必要审批后,再重新发送图片。'; export function conversationKey(event) { const chatType = event?.message?.chat_type; diff --git a/src/channels/shared/connection-test.mjs b/src/channels/shared/connection-test.mjs index 7271090..09b0e9a 100644 --- a/src/channels/shared/connection-test.mjs +++ b/src/channels/shared/connection-test.mjs @@ -29,7 +29,7 @@ export function connectionTestTarget(state) { export function connectionTestMessage(botName, channelLabel = t('机器人')) { const name = cleanText(botName) ?? channelLabel; - return `${t('✅ DeepSeek Harness 连接测试成功')}\n${t('这条消息由插件页面中的“{name}”机器人卡片发出。', { name })}`; + return `${t('✅ DeepSeek Harness 连接测试成功')}\n${t('这条消息由「IM机器人」设置页中的“{name}”机器人卡片发出。', { name })}`; } export function connectionTestTargetUnavailable(channelLabel = t('机器人')) { diff --git a/src/channels/shared/i18n-en/feishu.mjs b/src/channels/shared/i18n-en/feishu.mjs index c59d369..9343cef 100644 --- a/src/channels/shared/i18n-en/feishu.mjs +++ b/src/channels/shared/i18n-en/feishu.mjs @@ -18,8 +18,8 @@ export default { '机器人正在移除或已重新接入,无法操作原会话的工作区。': 'The bot is being removed or has been reconnected; the original session’s workspace cannot be changed.', '操作失败,请稍后重试。': 'The operation failed. Please try again later.', - '结果文件「{name}」已生成,但机器人缺少飞书文件上传权限 im:resource。请私聊机器人执行 /repair 命令,或者在插件页面点击“补全权限”按钮并扫码。完成飞书要求的发布审批后重试。': - 'The result file "{name}" was generated, but the bot lacks the Feishu file-upload scope im:resource. Run /repair in a direct chat with the bot, or click the “Complete permissions” button on the plugin page and scan the QR code. Complete any publishing approval Feishu requires, then try again.', + '结果文件「{name}」已生成,但机器人缺少飞书文件上传权限 im:resource。请私聊机器人执行 /repair 命令,或者在「IM机器人」设置页点击“补全权限”按钮并扫码。完成飞书要求的发布审批后重试。': + 'The result file "{name}" was generated, but the bot lacks the Feishu file-upload scope im:resource. Run /repair in a direct chat with the bot, or click the “Complete permissions” button on the IM Bot settings page and scan the QR code. Complete any publishing approval Feishu requires, then try again.', '结果文件「{name}」超过飞书 30 MB 上限,未发送。': 'The result file "{name}" exceeds the Feishu 30 MB limit and was not sent.', '结果文件「{name}」为空,飞书不允许发送空文件。': @@ -28,8 +28,8 @@ export default { 'The result file "{name}" was temporarily rate-limited by Feishu and could not be sent. Please try again later.', '结果文件「{name}」已生成,但暂时未能发送,请稍后重试。': 'The result file "{name}" was generated but could not be sent right now. Please try again later.', - '处理失败,请稍后重试。如果问题持续,请在 DeepSeek Harness 的飞书插件页面检查连接状态。': - 'Message processing failed. Please try again later. If the problem persists, check the connection status on the Feishu plugin page in DeepSeek Harness.', + '处理失败,请稍后重试。如果问题持续,请在 DeepSeek Harness 的「IM机器人」设置页检查飞书连接状态。': + 'Message processing failed. Please try again later. If the problem persists, check the Feishu connection status on the IM Bot settings page in DeepSeek Harness.', '已开启全新 Harness 会话。': 'A brand-new Harness session has started.', '飞书机器人与 DeepSeek Harness 连接正常。': 'The Feishu bot is connected to DeepSeek Harness and working normally.', @@ -338,8 +338,8 @@ export default { '飞书机器人': 'Feishu bot', // feishu/message-utils.mjs - '飞书机器人缺少图片读取权限 im:message:readonly(飞书显示为“获取单聊、群组消息”)。请私聊机器人执行 /repair 命令,或者在插件页面点击“补全权限”按钮并扫码。按飞书提示发布新版本、完成必要审批后,再重新发送图片。': - 'The Feishu bot is missing the image-read scope im:message:readonly, shown by Feishu as “Read direct and group messages.” Run /repair in a direct chat with the bot, or click the “Complete permissions” button on the plugin page and scan the QR code. Publish a new version and complete any approval requested by Feishu, then resend the image.', + '飞书机器人缺少图片读取权限 im:message:readonly(飞书显示为“获取单聊、群组消息”)。请私聊机器人执行 /repair 命令,或者在「IM机器人」设置页点击“补全权限”按钮并扫码。按飞书提示发布新版本、完成必要审批后,再重新发送图片。': + 'The Feishu bot is missing the image-read scope im:message:readonly, shown by Feishu as “Read direct and group messages.” Run /repair in a direct chat with the bot, or click the “Complete permissions” button on the IM Bot settings page and scan the QR code. Publish a new version and complete any approval requested by Feishu, then resend the image.', // feishu/feishu-runtime.mjs — callback probe notices '✅ 修复完成:已实测收到 card.action.trigger,菜单按钮现在可用。': diff --git a/src/channels/shared/i18n-en/shared-c.mjs b/src/channels/shared/i18n-en/shared-c.mjs index 4374687..9677348 100644 --- a/src/channels/shared/i18n-en/shared-c.mjs +++ b/src/channels/shared/i18n-en/shared-c.mjs @@ -73,8 +73,8 @@ export default { // connection-test.mjs '✅ DeepSeek Harness 连接测试成功': '✅ DeepSeek Harness connection test succeeded', - '这条消息由插件页面中的“{name}”机器人卡片发出。': - 'This message was sent from the "{name}" bot card on the plugin page.', + '这条消息由「IM机器人」设置页中的“{name}”机器人卡片发出。': + 'This message was sent from the "{name}" bot card on the IM Bot settings page.', '{channelLabel}尚未收到可用于测试的私聊消息。': 'The {channelLabel} has not received a direct message that can be used for testing yet.', '机器人': 'bot', diff --git a/test/channels/dingtalk/client-ui.test.mjs b/test/channels/dingtalk/client-ui.test.mjs index 72e5f62..11a98ad 100644 --- a/test/channels/dingtalk/client-ui.test.mjs +++ b/test/channels/dingtalk/client-ui.test.mjs @@ -5,15 +5,11 @@ import test from 'node:test'; const CLIENT_URL = new URL('../../../plugin-src/client/channels/dingtalk/index.js', import.meta.url); const STYLES_URL = new URL('../../../plugin-src/client/channels/dingtalk/styles.js', import.meta.url); -test('standalone client exports a reusable settings component and registration', async () => { +test('channel client exports a reusable settings component without a standalone settings registration', async () => { const source = await readFile(CLIENT_URL, 'utf8'); - assert.match(source, /export const name = 'dingtalk-settings'/); - assert.match(source, /export const inject = \['slots', 'connection'\]/); assert.match(source, /export function DingtalkSettingsTab\(\{ rpcCall \}\)/); - assert.match(source, /export function apply\(ctx\)/); - assert.match(source, /ctx\.connection\.rpc\.call\(DINGTALK_RPC_CHANNEL/); - assert.match(source, /id: 'dingtalk'/); - assert.match(source, /label: '钉钉'/); + assert.doesNotMatch(source, /export function apply\(ctx\)/); + assert.doesNotMatch(source, /settings\.plugins\.tab/); }); test('QR guidance describes the complete official DingTalk authorization flow', async () => { diff --git a/test/channels/feishu/bridge.test.mjs b/test/channels/feishu/bridge.test.mjs index a9cc7c7..8dfccfd 100644 --- a/test/channels/feishu/bridge.test.mjs +++ b/test/channels/feishu/bridge.test.mjs @@ -993,7 +993,7 @@ test('bridge tells users to grant im:message:readonly when Feishu rejects image assert.match(sent[0], /im:message:readonly/); assert.match(sent[0], /\/repair/); assert.match(sent[0], /发布新版本/); - assert.match(sent[0], /插件页面/); + assert.match(sent[0], /「IM机器人」设置页/); assert.match(sent[0], /补全权限/); assert.doesNotMatch(sent[0], /99991672|HTTP 400|secret-shaped|private\/path/); }); diff --git a/test/channels/feishu/message-utils.test.mjs b/test/channels/feishu/message-utils.test.mjs index d14d1ae..fb0f857 100644 --- a/test/channels/feishu/message-utils.test.mjs +++ b/test/channels/feishu/message-utils.test.mjs @@ -184,7 +184,7 @@ test('Feishu image loading maps the missing message scope to an actionable error assert.equal(error.code, 'feishu-image-permission-required'); assert.match(error.userMessage, /im:message:readonly/); assert.match(error.userMessage, /\/repair/); - assert.match(error.userMessage, /插件页面/); + assert.match(error.userMessage, /「IM机器人」设置页/); assert.match(error.userMessage, /补全权限/); assert.match(error.userMessage, /发布新版本/); assert.equal(error.cause, providerError); diff --git a/test/channels/feishu/multi-bot-controller.test.mjs b/test/channels/feishu/multi-bot-controller.test.mjs index 36fa01e..def76f3 100644 --- a/test/channels/feishu/multi-bot-controller.test.mjs +++ b/test/channels/feishu/multi-bot-controller.test.mjs @@ -791,7 +791,7 @@ test('connection test uses the selected bot runtime and shared message copy', as await fx.controller.initialize(); assert.deepEqual(await fx.controller.sendConnectionTest(healthy.id), { sent: true }); assert.deepEqual(fx.runtimes.get(healthy.id)[0].sentTests, [ - '✅ DeepSeek Harness 连接测试成功\n这条消息由插件页面中的“机器人 healthy(cli_heal••••7890)”机器人卡片发出。', + '✅ DeepSeek Harness 连接测试成功\n这条消息由「IM机器人」设置页中的“机器人 healthy(cli_heal••••7890)”机器人卡片发出。', ]); await fx.controller.close(); }); diff --git a/test/channels/whatsapp/whatsapp.test.mjs b/test/channels/whatsapp/whatsapp.test.mjs index 4f7ea5c..9a9830c 100644 --- a/test/channels/whatsapp/whatsapp.test.mjs +++ b/test/channels/whatsapp/whatsapp.test.mjs @@ -1378,7 +1378,7 @@ test('WhatsApp controller delegates connection test copy to the current runtime' await controller.initialize(); assert.deepEqual(await controller.sendConnectionTest(config.botId), { sent: true }); assert.deepEqual(sent, [ - '✅ DeepSeek Harness 连接测试成功\n这条消息由插件页面中的“Harness WhatsApp(1650••••0123)”机器人卡片发出。', + '✅ DeepSeek Harness 连接测试成功\n这条消息由「IM机器人」设置页中的“Harness WhatsApp(1650••••0123)”机器人卡片发出。', ]); }); diff --git a/test/client-ui.test.mjs b/test/client-ui.test.mjs index 1e12ccd..790815d 100644 --- a/test/client-ui.test.mjs +++ b/test/client-ui.test.mjs @@ -664,7 +664,21 @@ test('every shipped Chinese client string has an English projection', async () = } }); -test('client registers a live bilingual locale seat and directory picker for the IM settings tab', async () => { +test('client source contains no legacy Plugins-tab settings registrations', async () => { + const paths = (await readdir(CLIENT_SOURCE_DIRECTORY_URL, { recursive: true })) + .filter((path) => path.endsWith('.js')); + const sources = await Promise.all(paths.map(async (path) => ({ + path, + source: await readFile(new URL(path, CLIENT_SOURCE_DIRECTORY_URL), 'utf8'), + }))); + const legacy = sources + .filter(({ source }) => source.includes('settings.plugins.tab')) + .map(({ path }) => path); + + assert.deepEqual(legacy, []); +}); + +test('client registers one top-level bilingual IM settings section with a directory picker', async () => { const effects = []; const registrations = []; const dictionaries = []; @@ -697,7 +711,7 @@ test('client registers a live bilingual locale seat and directory picker for the }, slots: { inject(name, install) { - assert.equal(name, 'settings.plugins.tab'); + assert.equal(name, 'settings.section'); install(); }, register(options, component) { @@ -717,8 +731,12 @@ test('client registers a live bilingual locale seat and directory picker for the assert.equal(dictionaries[0].namespace, IM_LOCALE_NAMESPACE); assert.deepEqual(Object.keys(dictionaries[0].value.en).sort(), Object.keys(dictionaries[0].value.zh).sort()); assert.equal(registrations.length, 1); + assert.equal(registrations[0].options.name, 'settings.section'); + assert.equal(registrations[0].options.id, 'xmanrui-dsh-im'); + assert.equal(registrations[0].options.order, 21); assert.equal(registrations[0].options.locale, IM_LOCALE_NAMESPACE); assert.equal(registrations[0].options.label(), 'IM bots'); + assert.equal(registrations[0].component, IMSettingsTab); const injected = registrations[0].options.inject(); const signal = new AbortController().signal; diff --git a/test/loopback-recovery.test.mjs b/test/loopback-recovery.test.mjs index 2254483..1c7e707 100644 --- a/test/loopback-recovery.test.mjs +++ b/test/loopback-recovery.test.mjs @@ -20,11 +20,11 @@ const WEIXIN_FORBIDDEN = new Error( test('creates a localhost recovery target for the known loopback transport 403', () => { const recovery = createLoopbackRecovery(WEIXIN_FORBIDDEN, { - href: 'http://127.0.0.1:3080/settings?tab=plugins#im', + href: 'http://127.0.0.1:3080/settings', }); assert.deepEqual(recovery, { - url: 'http://localhost:3080/settings?tab=plugins#im', + url: 'http://localhost:3080/settings', origin: 'http://localhost:3080', }); assert.deepEqual(createLoopbackRecovery(WEIXIN_FORBIDDEN, { @@ -103,7 +103,7 @@ test('RPC wrappers preserve successful results, unrelated errors, and missing op test('recovery notice exposes one localized navigation action', () => { const recovery = { - url: 'http://localhost:3080/settings?tab=plugins#im', + url: 'http://localhost:3080/settings', origin: 'http://localhost:3080', }; const element = LoopbackRecoveryNotice({ recovery, onNavigate() {} });