@michengai/dsh-im-connect 1.0.4 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/CHANGELOG.zh-CN.md +10 -0
- package/README.zh-CN.md +1 -1
- package/client.js +48 -71
- package/lib/client.js +48 -71
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.0.6 - 2026-10-19
|
|
4
|
+
|
|
5
|
+
- Fix bind modal tab accessibility and layout: dual-method channels keep both tabpanels mounted with `hidden`, single-method channels no longer emit dangling `aria-labelledby`; align the segmented indicator with the 2px inset.
|
|
6
|
+
- Render the IM settings nav icon through a generic CSS mask span instead of rewriting the host `svg`, avoiding conflicts with third-party skin icon detection/hiding engines such as orca-link.
|
|
7
|
+
|
|
8
|
+
## 1.0.5 - 2026-10-19
|
|
9
|
+
|
|
10
|
+
- Fix native sidebar tab registry discovery: strictly inspect the current occupant component instead of relying on stale entry references.
|
|
11
|
+
- Clean up own tab contributions immediately when the foreign sidebar host unregisters its native tab registry, and re-attach cleanly upon sidebar change notifications.
|
|
12
|
+
|
|
3
13
|
## 1.0.4 - 2026-10-18
|
|
4
14
|
|
|
5
15
|
- Fix file delivery error handling: do not skip `not-regular-file` (e.g. directory paths), ensuring non-regular files report actionable delivery errors while missing deleted files remain silently skipped.
|
package/CHANGELOG.zh-CN.md
CHANGED
|
@@ -4,6 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
以下记录近期发布的版本。Git 标签与 GitHub Release 现已和这些条目同步;历史条目继续保留原始发布提交链接。
|
|
6
6
|
|
|
7
|
+
## 1.0.6 - 2026-10-19
|
|
8
|
+
|
|
9
|
+
- 修复绑定弹窗页签的可访问性与布局:双方法渠道常驻两个 `tabpanel` 并用 `hidden` 切换,单方法渠道不再输出悬空的 `aria-labelledby`;页签指示条按 2px 内边距精确对齐。
|
|
10
|
+
- 设置页 IM 导航图标改为通用 CSS mask 注入,不再改写宿主 `svg` 内容,避免与 orca-link 等第三方皮肤的图标识别/隐藏机制冲突。
|
|
11
|
+
|
|
12
|
+
## 1.0.5 - 2026-10-19
|
|
13
|
+
|
|
14
|
+
- 修复原生侧边栏协作页签发现机制:严格识别当前展示的组件实例,不再回退 entry 上的残留缓存。
|
|
15
|
+
- 当外部侧栏外壳注销其注册表时立即撤出自身频道页签,并在收到侧栏变更通知后重新安全接入,避免跨外壳残留。
|
|
16
|
+
|
|
7
17
|
## 1.0.4 - 2026-10-18
|
|
8
18
|
|
|
9
19
|
- 修复文件投递异常处理:不再将 `not-regular-file`(如目录路径)误判为缺失文件静默跳过,确保非普通文件正常报错提示,同时保持已删除文件静默跳过的正确行为。
|
package/README.zh-CN.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
**把飞书、Lark、钉钉、企业微信、微信、QQ、Telegram、Discord、Slack 接到本机 DeepSeek Harness**
|
|
10
10
|
|
|
11
|
-
[English](README.md) · [更新日志](CHANGELOG.zh-CN.md) · [QQ 引用交接](docs/01-当前工作/I022-QQ直接引用接入/00-迭代总览.md) · [Apache-2.0](LICENSE)
|
|
11
|
+
[English](README.md) · [更新日志](CHANGELOG.zh-CN.md) · [QQ 引用交接](docs/01-当前工作/I022-QQ直接引用接入/00-迭代总览.md) · [侧栏协作交接](docs/07-迭代归档/2026/I024-侧栏页签协作与渲染修复/00-迭代总览.md) · [Apache-2.0](LICENSE)
|
|
12
12
|
|
|
13
13
|
[](LICENSE)
|
|
14
14
|
[](https://www.npmjs.com/package/@michengai/dsh-im-connect)
|
package/client.js
CHANGED
|
@@ -136,25 +136,6 @@ window.__ModuleLoader__.load({
|
|
|
136
136
|
children ? React.createElement("span", { className: "ima-checkbox-text" }, children) : null
|
|
137
137
|
);
|
|
138
138
|
}
|
|
139
|
-
function Segmented({ options = [], value, onChange, disabled, block, className }) {
|
|
140
|
-
return React.createElement("div", {
|
|
141
|
-
role: "radiogroup",
|
|
142
|
-
className: ["ima-segmented", block ? "is-block" : "", className].filter(Boolean).join(" "),
|
|
143
|
-
}, options.map((opt) => {
|
|
144
|
-
const val = typeof opt === "object" ? opt.value : opt;
|
|
145
|
-
const lbl = typeof opt === "object" ? opt.label : opt;
|
|
146
|
-
const active = val === value;
|
|
147
|
-
return React.createElement("button", {
|
|
148
|
-
key: String(val),
|
|
149
|
-
type: "button",
|
|
150
|
-
role: "radio",
|
|
151
|
-
"aria-checked": active,
|
|
152
|
-
disabled,
|
|
153
|
-
className: ["ima-segmented-item", active ? "is-active" : ""].filter(Boolean).join(" "),
|
|
154
|
-
onClick: () => { if (!disabled && onChange) onChange(val); },
|
|
155
|
-
}, lbl);
|
|
156
|
-
}));
|
|
157
|
-
}
|
|
158
139
|
function hostModalButton(label, onClick, kind, extra) {
|
|
159
140
|
const options = extra || {};
|
|
160
141
|
const isDanger = kind === "danger" || options.danger;
|
|
@@ -827,7 +808,7 @@ window.__ModuleLoader__.load({
|
|
|
827
808
|
"channel.dingtalk": "钉钉", "channel.feishu": "飞书", "channel.lark": "Lark", "channel.weixin": "微信", "channel.wecom": "企业微信", "channel.qq": "QQ", "channel.telegram": "Telegram", "channel.discord": "Discord", "channel.slack": "Slack",
|
|
828
809
|
"field.dingtalk.clientId": "Client ID(原 AppKey)", "field.dingtalk.clientSecret": "Client Secret(原 AppSecret)",
|
|
829
810
|
"field.wecom.botId": "Bot ID", "field.wecom.secret": "Secret", "field.qq.appId": "AppID", "field.qq.appSecret": "AppSecret", "field.telegram.token": "Bot Token", "field.discord.token": "Bot Token", "field.slack.token": "Bot Token(xoxb- 开头)", "field.slack.appToken": "App Token(xapp- 开头)",
|
|
830
|
-
"bind.title": "配置 {channel}", "bind.quick": "快捷绑定(推荐)", "bind.manual": "手动配置", "bind.saving": "正在保存账号…", "bind.success": "绑定成功,频道已连接", "bind.newIdentity": "检测到新的账号身份,已创建新账号", "bind.qrAlt": "{channel} 绑定二维码", "bind.generating": "正在生成…", "bind.expire": "二维码 {time} 后过期", "bind.scanned": "已扫码,请在手机上确认", "bind.retry": "请重新生成二维码", "bind.refresh": "重新生成二维码", "action.saving": "保存中…", "action.confirm": "确认",
|
|
811
|
+
"bind.title": "配置 {channel}", "bind.tabsAria": "绑定方式", "bind.quick": "快捷绑定(推荐)", "bind.manual": "手动配置", "bind.saving": "正在保存账号…", "bind.success": "绑定成功,频道已连接", "bind.newIdentity": "检测到新的账号身份,已创建新账号", "bind.qrAlt": "{channel} 绑定二维码", "bind.generating": "正在生成…", "bind.expire": "二维码 {time} 后过期", "bind.scanned": "已扫码,请在手机上确认", "bind.retry": "请重新生成二维码", "bind.refresh": "重新生成二维码", "action.saving": "保存中…", "action.confirm": "确认",
|
|
831
812
|
"qr.weixin": "请使用微信扫描二维码完成绑定", "qr.feishu": "请使用飞书扫描二维码,将自动创建机器人", "qr.lark": "请使用 Lark 扫描二维码完成配对", "qr.wecom": "请使用企业微信扫描二维码,快捷绑定机器人", "qr.dingtalk": "请使用钉钉扫描二维码,自动创建机器人", "qr.qq": "请使用手机 QQ 扫描二维码,创建开放平台机器人", "qr.default": "请使用对应 App 扫描二维码",
|
|
832
813
|
"status.connected": "已连接", "action.more": "{channel} 更多",
|
|
833
814
|
"error.loadAssistant": "无法加载账号配置", "error.noModels": "当前 Host 还没有可用模型,请先在网页里配置提供商", "error.save": "保存失败", "error.chooseWorkspace": "请选择工作区目录", "error.workspaceUnavailable": "当前 Host 无法新增工作区", "error.addWorkspace": "新增工作区失败", "error.load": "加载失败", "error.connection": "无法连接本机 IM 助理接口", "error.request": "请求失败", "error.action": "操作失败", "error.qr": "无法生成二维码", "error.detailsInLog": "操作失败,请查看服务器日志。",
|
|
@@ -856,7 +837,7 @@ window.__ModuleLoader__.load({
|
|
|
856
837
|
"channel.dingtalk": "DingTalk", "channel.feishu": "Feishu", "channel.lark": "Lark", "channel.weixin": "WeChat", "channel.wecom": "WeCom", "channel.qq": "QQ", "channel.telegram": "Telegram", "channel.discord": "Discord", "channel.slack": "Slack",
|
|
857
838
|
"field.dingtalk.clientId": "Client ID (formerly AppKey)", "field.dingtalk.clientSecret": "Client Secret (formerly AppSecret)",
|
|
858
839
|
"field.wecom.botId": "Bot ID", "field.wecom.secret": "Secret", "field.qq.appId": "AppID", "field.qq.appSecret": "AppSecret", "field.telegram.token": "Bot Token", "field.discord.token": "Bot Token", "field.slack.token": "Bot Token (starts with xoxb-)", "field.slack.appToken": "App Token (starts with xapp-)",
|
|
859
|
-
"bind.title": "Set up {channel}", "bind.quick": "Quick setup (recommended)", "bind.manual": "Manual setup", "bind.saving": "Saving account…", "bind.success": "Connected successfully", "bind.newIdentity": "A new account identity was detected and a new account was created", "bind.qrAlt": "{channel} setup QR code", "bind.generating": "Generating…", "bind.expire": "QR code expires in {time}", "bind.scanned": "Scanned. Confirm on your phone.", "bind.retry": "Generate a new QR code", "bind.refresh": "Generate a new QR code", "action.saving": "Saving…", "action.confirm": "Confirm",
|
|
840
|
+
"bind.title": "Set up {channel}", "bind.tabsAria": "Setup method", "bind.quick": "Quick setup (recommended)", "bind.manual": "Manual setup", "bind.saving": "Saving account…", "bind.success": "Connected successfully", "bind.newIdentity": "A new account identity was detected and a new account was created", "bind.qrAlt": "{channel} setup QR code", "bind.generating": "Generating…", "bind.expire": "QR code expires in {time}", "bind.scanned": "Scanned. Confirm on your phone.", "bind.retry": "Generate a new QR code", "bind.refresh": "Generate a new QR code", "action.saving": "Saving…", "action.confirm": "Confirm",
|
|
860
841
|
"qr.weixin": "Scan the QR code with WeChat to connect", "qr.feishu": "Scan with Feishu; a bot will be created automatically", "qr.lark": "Scan with Lark to pair", "qr.wecom": "Scan with WeCom to quickly connect a bot", "qr.dingtalk": "Scan with DingTalk; a bot will be created automatically", "qr.qq": "Scan with mobile QQ to create an Open Platform bot", "qr.default": "Scan the QR code with the corresponding app",
|
|
861
842
|
"status.connected": "Connected", "action.more": "More options for {channel}",
|
|
862
843
|
"error.loadAssistant": "Could not load account settings", "error.noModels": "No models are available in the Host. Configure a provider in the web app first.", "error.save": "Could not save", "error.chooseWorkspace": "Choose a workspace directory", "error.workspaceUnavailable": "This Host cannot create workspaces", "error.addWorkspace": "Could not add workspace", "error.load": "Could not load", "error.connection": "Could not connect to the local IM Assistant API", "error.request": "Request failed", "error.action": "Action failed", "error.qr": "Could not generate a QR code", "error.detailsInLog": "The operation failed. Check the server logs for details.",
|
|
@@ -909,6 +890,8 @@ window.__ModuleLoader__.load({
|
|
|
909
890
|
.ima-title-row{display:flex;align-items:center;gap:8px 12px;min-width:0;flex-wrap:wrap}
|
|
910
891
|
.ima-title-links{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
|
|
911
892
|
.ima-title-links>span[data-mpi-check]{display:inline-flex;align-items:center}
|
|
893
|
+
[data-ima-nav-icon="assistant"]>svg{display:none!important}
|
|
894
|
+
.ima-nav-icon-assistant{--ima-nav-icon-mask:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cpath%20fill%3D%22black%22%20d%3D%22M2.15%202.9h11.7v8.2H6.42L2.15%2013.85V2.9Zm1.4%201.4v6.62l1.78-1.12h7.12V4.3H3.55Z%22%2F%3E%3C%2Fsvg%3E");display:inline-block;flex:none;width:16px;height:16px;background:currentColor;-webkit-mask:var(--ima-nav-icon-mask) center/contain no-repeat;mask:var(--ima-nav-icon-mask) center/contain no-repeat}
|
|
912
895
|
.ima-btn{display:inline-flex;align-items:center;justify-content:center;gap:4px;height:32px;padding:0 12px;border:0.5px solid var(--dsw-alias-border-l3,#555);border-radius:var(--dsw-radius-sm,8px);background:transparent;color:var(--dsw-alias-label-primary,#eee);font:inherit;font-size:13px;line-height:20px;cursor:pointer;user-select:none;box-sizing:border-box;text-decoration:none;transition:border-color 120ms ease,color 120ms ease,background 120ms ease}
|
|
913
896
|
.ima-btn:not(.is-primary):not(.ima-btn-danger){color:var(--dsw-alias-label-primary,#eee)!important}
|
|
914
897
|
.ima-btn:hover:not(:disabled):not(.ima-btn-danger){border-color:var(--dsw-alias-border-l3,#666)!important;color:var(--dsw-alias-label-primary,#fff)!important;background:var(--dsw-alias-interactive-bg-hover,rgba(255,255,255,.06))!important}
|
|
@@ -941,11 +924,20 @@ window.__ModuleLoader__.load({
|
|
|
941
924
|
.ima-wrap{display:flex;flex-direction:column;min-height:0;flex:1;height:100%;overflow:hidden}.ima-official-tree{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.ima-native.ima-rail,.ima-rail.dcu-wb{box-sizing:border-box;overflow:hidden}
|
|
942
925
|
.ima-tabs-wrap{display:flex;margin:2px var(--dsh-sidebar-inline-padding,12px) 8px 0;padding:0;width:auto}
|
|
943
926
|
.ima-tabs-wrap .ima-segmented-tabs{width:100%;background:color-mix(in srgb,var(--dsw-alias-label-primary,currentColor) 3%,transparent)!important;border-radius:8px!important;border:0.5px solid var(--dsw-alias-border-l1,rgba(255,255,255,.05))!important;box-sizing:border-box;padding:2px!important}
|
|
944
|
-
.ima-tabs-wrap .ima-segmented-tabs>span{inset:2px auto 2px 2px!important;border-radius:6px!important;border:0.5px solid var(--dsw-alias-border-l2,rgba(255,255,255,.08))!important;background:color-mix(in srgb,var(--dsw-alias-label-primary,currentColor) 8%,transparent)!important;border-color:color-mix(in srgb,var(--dsw-alias-label-primary,currentColor) 12%,transparent)!important;box-shadow:none!important}
|
|
927
|
+
.ima-tabs-wrap .ima-segmented-tabs>span{inset:2px auto 2px 2px!important;width:calc((100% - 4px)/var(--ima-tab-count,2))!important;border-radius:6px!important;border:0.5px solid var(--dsw-alias-border-l2,rgba(255,255,255,.08))!important;background:color-mix(in srgb,var(--dsw-alias-label-primary,currentColor) 8%,transparent)!important;border-color:color-mix(in srgb,var(--dsw-alias-label-primary,currentColor) 12%,transparent)!important;box-shadow:none!important}
|
|
945
928
|
.ima-tabs-wrap .ima-segmented-tabs [role=tab]{display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:5px!important;width:100%!important;height:26px!important;padding:0 6px!important;font-size:13px!important;line-height:18px!important;border-radius:6px!important;color:var(--dsw-alias-label-secondary,#8b8f98);text-align:center!important}
|
|
946
929
|
.ima-tabs-wrap .ima-segmented-tabs [role=tab]>*{display:inline-flex!important;align-items:center!important;justify-content:center!important}
|
|
947
930
|
.ima-tabs-wrap .ima-segmented-tabs [role=tab]:hover{color:var(--dsw-alias-label-primary,inherit)}
|
|
948
931
|
.ima-tabs-wrap .ima-segmented-tabs [role=tab][aria-selected=true]{color:var(--dsw-alias-label-primary,inherit)!important;font-weight:600}
|
|
932
|
+
.ima-bind-tabs-wrap{width:100%;margin:0 0 16px}
|
|
933
|
+
.ima-bind-tabs-wrap.is-disabled{opacity:.6;pointer-events:none}
|
|
934
|
+
.ima-bind-panel[hidden]{display:none!important}
|
|
935
|
+
.ima-bind-tabs-wrap .ima-bind-tabs{width:100%;height:32px;box-sizing:border-box;border-bottom:0;background:color-mix(in srgb,var(--dsw-alias-label-primary,currentColor) 3%,transparent)!important;border-radius:var(--dsw-radius-sm,8px)!important;border:0.5px solid var(--dsw-alias-border-l1,rgba(255,255,255,.05))!important;padding:2px!important}
|
|
936
|
+
.ima-bind-tabs-wrap .ima-bind-tabs>span{inset:2px auto 2px 2px!important;width:calc((100% - 4px)/2)!important;border-radius:calc(var(--dsw-radius-sm,8px) - 2px)!important;border:0.5px solid color-mix(in srgb,var(--dsw-alias-label-primary,currentColor) 12%,transparent)!important;background:color-mix(in srgb,var(--dsw-alias-label-primary,currentColor) 8%,transparent)!important;box-shadow:none!important}
|
|
937
|
+
.ima-bind-tabs-wrap .ima-bind-tabs [role=tab]{display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:6px!important;width:100%!important;height:26px!important;padding:0 10px!important;font-size:13px!important;line-height:18px!important;border-radius:calc(var(--dsw-radius-sm,8px) - 2px)!important;color:var(--dsw-alias-label-secondary,#8b8f98);text-align:center!important}
|
|
938
|
+
.ima-bind-tabs-wrap .ima-bind-tabs [role=tab]>*{display:inline-flex!important;align-items:center!important;justify-content:center!important}
|
|
939
|
+
.ima-bind-tabs-wrap .ima-bind-tabs [role=tab]:hover{color:var(--dsw-alias-label-primary,inherit)}
|
|
940
|
+
.ima-bind-tabs-wrap .ima-bind-tabs [role=tab][aria-selected=true]{color:var(--dsw-alias-label-primary,inherit)!important;font-weight:600}
|
|
949
941
|
.ima-tabs{display:flex;gap:18px;padding:4px 12px 0;border-bottom:1px solid var(--ima-line)}
|
|
950
942
|
.ima-tab{appearance:none;border:0;background:transparent;color:var(--ima-muted);padding:8px 0;font-size:13px;cursor:pointer}
|
|
951
943
|
.ima-tab.on{color:var(--ima-text);box-shadow:inset 0 -2px 0 currentColor}
|
|
@@ -975,11 +967,6 @@ window.__ModuleLoader__.load({
|
|
|
975
967
|
.ima-checkbox-label{display:inline-flex;align-items:center;gap:8px;font-size:13px;color:var(--dsw-alias-label-primary,#eee);cursor:pointer;user-select:none}
|
|
976
968
|
.ima-checkbox-label.is-disabled{opacity:.5;cursor:not-allowed}
|
|
977
969
|
.ima-checkbox{width:16px;height:16px;margin:0;accent-color:var(--dsw-alias-state-business-primary,#4176e6);cursor:inherit}
|
|
978
|
-
.ima-segmented{display:inline-flex;background:var(--dsw-alias-bg-layer-2,rgba(128,128,128,.1));padding:2px;border-radius:var(--dsw-radius-sm,8px);gap:2px;border:0.5px solid var(--dsw-alias-border-l1,rgba(255,255,255,.06))}
|
|
979
|
-
.ima-segmented.is-block{display:flex;width:100%}
|
|
980
|
-
.ima-segmented-item{flex:1;min-width:0;height:28px;padding:0 12px;border:none;border-radius:calc(var(--dsw-radius-sm,8px) - 2px);background:transparent;color:var(--dsw-alias-label-secondary,#a0a0a0);font:inherit;font-size:12px;font-weight:500;cursor:pointer;transition:all 120ms ease;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
981
|
-
.ima-segmented-item:hover:not(:disabled){color:var(--dsw-alias-label-primary,#eee)}
|
|
982
|
-
.ima-segmented-item.is-active{background:var(--dsw-alias-bg-layer-1,#222);color:var(--dsw-alias-label-primary,#fff);box-shadow:0 1px 3px rgba(0,0,0,.2)}
|
|
983
970
|
.ima-tag{display:inline-flex!important;align-items:center!important;gap:4px!important;height:22px!important;padding:0 8px!important;font-size:12px!important;line-height:20px!important;border-radius:var(--dsw-radius-sm,6px)!important;font-weight:500!important;box-sizing:border-box!important;vertical-align:middle!important;background:var(--dsw-alias-interactive-bg-hover,rgba(128,128,128,.12));color:var(--dsw-alias-label-secondary,#b9b9b9);border:none}
|
|
984
971
|
.ima-tag .ima-btn-spinner{width:11px!important;height:11px!important;margin-right:2px!important;vertical-align:0!important}
|
|
985
972
|
.ima-tag-info,.ima-tag-processing,.ima-tag.is-busy{background:color-mix(in srgb,var(--dsw-alias-state-business-primary,#4176e6) 14%,transparent)!important;color:var(--dsw-alias-state-business-primary,#4176e6)!important}
|
|
@@ -1022,7 +1009,7 @@ window.__ModuleLoader__.load({
|
|
|
1022
1009
|
.ima-inspector-status{flex:none}
|
|
1023
1010
|
.ima-form{display:flex;flex-direction:column;gap:16px;padding-top:20px}
|
|
1024
1011
|
.ima-command-permissions{min-width:0;margin:0;padding:0;border:0}
|
|
1025
|
-
.ima-diagnostic-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.ima-inspector-title-row .ima-tag{margin-inline-end:0}.ima-bind-modal .ima-
|
|
1012
|
+
.ima-diagnostic-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.ima-inspector-title-row .ima-tag{margin-inline-end:0}.ima-bind-modal .ima-feedback{margin-bottom:12px}.ima-connection-check{display:grid;gap:6px;padding:12px;border:1px solid var(--ima-line);border-radius:8px;font-size:12px;line-height:1.6;overflow-wrap:anywhere;color:var(--ima-muted)}.ima-connection-check strong{color:var(--ima-text)}.ima-diagnostic-item{padding:8px 0;border-top:1px solid var(--ima-line)}
|
|
1026
1013
|
.ima-inspector-actions{display:flex!important;flex-wrap:wrap!important;align-items:center!important;justify-content:flex-end!important;gap:8px!important;margin-top:16px!important;padding-top:16px!important;padding-bottom:4px!important}
|
|
1027
1014
|
.ima-account-modal .ima-inspector{padding:0 0 16px 0}
|
|
1028
1015
|
.ima-bind-modal,.ima-account-modal{width:min(720px,100%) !important;max-height:100%}
|
|
@@ -1581,6 +1568,7 @@ window.__ModuleLoader__.load({
|
|
|
1581
1568
|
function BindModal({ ch, onClose, onConnected, catalog, permissions, agentPresets, workspaces, defaults, readMainSessionModel, createWorkspace, pickDirectory, modelT, permissionT, presetT, t = fallbackT }) {
|
|
1582
1569
|
const hasQr = ch.kind === "qr" || ch.kind === "qr-or-credentials";
|
|
1583
1570
|
const hasManual = ch.kind === "credentials" || ch.kind === "qr-or-credentials";
|
|
1571
|
+
const showTabs = hasQr && hasManual;
|
|
1584
1572
|
const [tab, setTab] = useState(hasQr ? "qr" : "manual");
|
|
1585
1573
|
const [pairing, setPairing] = useState(null);
|
|
1586
1574
|
const [qrStarted, setQrStarted] = useState(false);
|
|
@@ -1743,16 +1731,19 @@ window.__ModuleLoader__.load({
|
|
|
1743
1731
|
)
|
|
1744
1732
|
: null,
|
|
1745
1733
|
},
|
|
1746
|
-
|
|
1747
|
-
|
|
1734
|
+
showTabs && h("div", {
|
|
1735
|
+
className: ["ima-bind-tabs-wrap", saving ? "is-disabled" : ""].filter(Boolean).join(" "),
|
|
1736
|
+
"aria-disabled": saving ? "true" : undefined,
|
|
1737
|
+
}, h(HostSegmentedTabs, {
|
|
1738
|
+
className: "ima-bind-tabs",
|
|
1739
|
+
label: t("bind.tabsAria"),
|
|
1748
1740
|
value: tab,
|
|
1749
|
-
disabled: saving,
|
|
1750
|
-
options: [
|
|
1751
|
-
{ value: "qr", label: t("bind.quick") },
|
|
1752
|
-
{ value: "manual", label: t("bind.manual") },
|
|
1753
|
-
],
|
|
1754
1741
|
onChange: (next) => switchTab(next),
|
|
1755
|
-
|
|
1742
|
+
items: [
|
|
1743
|
+
{ value: "qr", id: "ima-bind-tab-qr", panelId: "ima-bind-panel-qr", label: t("bind.quick") },
|
|
1744
|
+
{ value: "manual", id: "ima-bind-tab-manual", panelId: "ima-bind-panel-manual", label: t("bind.manual") },
|
|
1745
|
+
],
|
|
1746
|
+
})),
|
|
1756
1747
|
error && h(NoticeBar, { type: "error" }, error),
|
|
1757
1748
|
success && h(NoticeBar, { type: "success" }, success),
|
|
1758
1749
|
h("div", { className: "ima-setup-section" },
|
|
@@ -1777,7 +1768,7 @@ window.__ModuleLoader__.load({
|
|
|
1777
1768
|
}),
|
|
1778
1769
|
h(CommandPermissionSettings, { value: settings.commandPermissions, onSave: commandPermissions => setSettings(current => ({ ...current, commandPermissions })), t }),
|
|
1779
1770
|
),
|
|
1780
|
-
tab
|
|
1771
|
+
hasQr && h("div", showTabs ? { className: "ima-bind-panel", id: "ima-bind-panel-qr", role: "tabpanel", "aria-labelledby": "ima-bind-tab-qr", hidden: tab !== "qr" } : null,
|
|
1781
1772
|
status === "success"
|
|
1782
1773
|
? h(NoticeBar, { type: "success" }, t("bind.success"))
|
|
1783
1774
|
: status === "saving"
|
|
@@ -1798,7 +1789,7 @@ window.__ModuleLoader__.load({
|
|
|
1798
1789
|
hostModalButton(busy ? t("bind.generating") : qrStarted ? t("bind.refresh") : t("action.generateQr"), () => startQr(qrStarted), "primary", { disabled: busy || !workspaceIsListed(settings.cwd, workspaces) || !settings.provider || !settings.model || !settings.permission }),
|
|
1799
1790
|
)
|
|
1800
1791
|
),
|
|
1801
|
-
|
|
1792
|
+
hasManual && h("div", showTabs ? { className: "ima-bind-panel", id: "ima-bind-panel-manual", role: "tabpanel", "aria-labelledby": "ima-bind-tab-manual", hidden: tab !== "manual" } : null,
|
|
1802
1793
|
...ch.fields.map((f) => h("label", { key: f.key, className: "ima-field" },
|
|
1803
1794
|
fieldLabel(ch, f, t),
|
|
1804
1795
|
h(Input, {
|
|
@@ -3509,7 +3500,9 @@ window.__ModuleLoader__.load({
|
|
|
3509
3500
|
}
|
|
3510
3501
|
|
|
3511
3502
|
function findNativeTabRegistry(entry) {
|
|
3512
|
-
|
|
3503
|
+
const target = entry && (typeof entry === "object" || typeof entry === "function") && "component" in entry ? entry.component : entry;
|
|
3504
|
+
const registry = target?.__dshNativeTabs;
|
|
3505
|
+
return registry?.version === 1 && typeof registry.getTabs === "function" && typeof registry.subscribe === "function" && typeof registry.insert === "function" ? registry : null;
|
|
3513
3506
|
}
|
|
3514
3507
|
|
|
3515
3508
|
function applyRegistryFilters(state, registry) {
|
|
@@ -3648,7 +3641,7 @@ window.__ModuleLoader__.load({
|
|
|
3648
3641
|
|
|
3649
3642
|
return h("div", { className: "ima-wrap" },
|
|
3650
3643
|
HostSegmentedTabs
|
|
3651
|
-
? h("div", { className: "ima-tabs-wrap" },
|
|
3644
|
+
? h("div", { className: "ima-tabs-wrap", style: { "--ima-tab-count": String(imTabItems.length) } },
|
|
3652
3645
|
h(HostSegmentedTabs, {
|
|
3653
3646
|
className: "ima-segmented-tabs",
|
|
3654
3647
|
label: t("rail.tabsAria"),
|
|
@@ -3797,9 +3790,8 @@ window.__ModuleLoader__.load({
|
|
|
3797
3790
|
};
|
|
3798
3791
|
|
|
3799
3792
|
const NAV_ICON_MARKER = "data-ima-nav-icon";
|
|
3800
|
-
const
|
|
3793
|
+
const NAV_ICON_CLASS = "ima-nav-icon-assistant";
|
|
3801
3794
|
const NAV_ROW_SELECTOR = '[role="dialog"] nav button';
|
|
3802
|
-
const IM_NAV_PATHS = '<path fill="currentColor" d="M2.15 2.9h11.7v8.2H6.42L2.15 13.85V2.9Zm1.4 1.4v6.62l1.78-1.12h7.12V4.3H3.55Z"/>';
|
|
3803
3795
|
|
|
3804
3796
|
function isOwnNavRow(rowText, wantedLabel) {
|
|
3805
3797
|
const wanted = String(wantedLabel ?? "").trim();
|
|
@@ -3810,41 +3802,25 @@ window.__ModuleLoader__.load({
|
|
|
3810
3802
|
|
|
3811
3803
|
function applySettingsNavIcon(button, wantedLabel) {
|
|
3812
3804
|
if (!isOwnNavRow(button.textContent, wantedLabel())) return false;
|
|
3813
|
-
|
|
3814
|
-
if (
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
if (!
|
|
3818
|
-
svg
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
|
|
3805
|
+
if (!button.querySelector("svg")) return false;
|
|
3806
|
+
if (button.getAttribute(NAV_ICON_MARKER) === "assistant" && button.querySelector(`.${NAV_ICON_CLASS}`)) return false;
|
|
3807
|
+
button.setAttribute(NAV_ICON_MARKER, "assistant");
|
|
3808
|
+
let icon = button.querySelector(`.${NAV_ICON_CLASS}`);
|
|
3809
|
+
if (!icon) {
|
|
3810
|
+
// 不改宿主 svg 内容:皮肤的内容级识别/隐藏规则只作用于 svg 子节点,
|
|
3811
|
+
// 这里用独立的 mask 图标,避免与其互相覆盖。
|
|
3812
|
+
icon = document.createElement("span");
|
|
3813
|
+
icon.className = NAV_ICON_CLASS;
|
|
3814
|
+
icon.setAttribute("aria-hidden", "true");
|
|
3815
|
+
button.prepend(icon);
|
|
3823
3816
|
}
|
|
3824
|
-
svg.setAttribute("data-ima-nav-icon", "assistant");
|
|
3825
|
-
svg.setAttribute("viewBox", "0 0 16 16");
|
|
3826
|
-
svg.setAttribute("fill", "none");
|
|
3827
|
-
svg.innerHTML = IM_NAV_PATHS;
|
|
3828
|
-
button.setAttribute(NAV_ICON_MARKER, "");
|
|
3829
3817
|
return true;
|
|
3830
3818
|
}
|
|
3831
3819
|
|
|
3832
3820
|
function restoreSettingsNavIcon(button) {
|
|
3833
|
-
const svg = button.querySelector("svg");
|
|
3834
3821
|
button.removeAttribute(NAV_ICON_MARKER);
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
svg.removeAttribute("data-ima-nav-icon");
|
|
3838
|
-
svg.removeAttribute(NAV_ICON_ORIGINAL);
|
|
3839
|
-
if (!raw) return false;
|
|
3840
|
-
try {
|
|
3841
|
-
const saved = JSON.parse(raw);
|
|
3842
|
-
svg.innerHTML = saved.innerHTML;
|
|
3843
|
-
if (saved.viewBox == null) svg.removeAttribute("viewBox");
|
|
3844
|
-
else svg.setAttribute("viewBox", saved.viewBox);
|
|
3845
|
-
if (saved.fill == null) svg.removeAttribute("fill");
|
|
3846
|
-
else svg.setAttribute("fill", saved.fill);
|
|
3847
|
-
} catch { /* ignore */ }
|
|
3822
|
+
const icon = button.querySelector(`.${NAV_ICON_CLASS}`);
|
|
3823
|
+
if (icon) icon.remove();
|
|
3848
3824
|
return true;
|
|
3849
3825
|
}
|
|
3850
3826
|
|
|
@@ -3988,6 +3964,7 @@ window.__ModuleLoader__.load({
|
|
|
3988
3964
|
const occupant = entries.find((item) => item && item.component);
|
|
3989
3965
|
if (wrappedEntry && (occupant !== wrappedEntry || occupant.component !== ownedWrapper)) unwrap();
|
|
3990
3966
|
if (!occupant) { clearInsertedTab(); return; }
|
|
3967
|
+
if (insertedTabRegistry && findNativeTabRegistry(occupant) !== insertedTabRegistry) clearInsertedTab();
|
|
3991
3968
|
if (occupant && (occupant.component.__dshNativeTabHost || occupant.component.__dshAutomationWrapped || findNativeTabRegistry(occupant))) {
|
|
3992
3969
|
insertChannelTab(occupant);
|
|
3993
3970
|
return;
|
package/lib/client.js
CHANGED
|
@@ -457,25 +457,6 @@ function observePluginUpdate(options) {
|
|
|
457
457
|
children ? React.createElement("span", { className: "ima-checkbox-text" }, children) : null
|
|
458
458
|
);
|
|
459
459
|
}
|
|
460
|
-
function Segmented({ options = [], value, onChange, disabled, block, className }) {
|
|
461
|
-
return React.createElement("div", {
|
|
462
|
-
role: "radiogroup",
|
|
463
|
-
className: ["ima-segmented", block ? "is-block" : "", className].filter(Boolean).join(" "),
|
|
464
|
-
}, options.map((opt) => {
|
|
465
|
-
const val = typeof opt === "object" ? opt.value : opt;
|
|
466
|
-
const lbl = typeof opt === "object" ? opt.label : opt;
|
|
467
|
-
const active = val === value;
|
|
468
|
-
return React.createElement("button", {
|
|
469
|
-
key: String(val),
|
|
470
|
-
type: "button",
|
|
471
|
-
role: "radio",
|
|
472
|
-
"aria-checked": active,
|
|
473
|
-
disabled,
|
|
474
|
-
className: ["ima-segmented-item", active ? "is-active" : ""].filter(Boolean).join(" "),
|
|
475
|
-
onClick: () => { if (!disabled && onChange) onChange(val); },
|
|
476
|
-
}, lbl);
|
|
477
|
-
}));
|
|
478
|
-
}
|
|
479
460
|
function hostModalButton(label, onClick, kind, extra) {
|
|
480
461
|
const options = extra || {};
|
|
481
462
|
const isDanger = kind === "danger" || options.danger;
|
|
@@ -1148,7 +1129,7 @@ function observePluginUpdate(options) {
|
|
|
1148
1129
|
"channel.dingtalk": "钉钉", "channel.feishu": "飞书", "channel.lark": "Lark", "channel.weixin": "微信", "channel.wecom": "企业微信", "channel.qq": "QQ", "channel.telegram": "Telegram", "channel.discord": "Discord", "channel.slack": "Slack",
|
|
1149
1130
|
"field.dingtalk.clientId": "Client ID(原 AppKey)", "field.dingtalk.clientSecret": "Client Secret(原 AppSecret)",
|
|
1150
1131
|
"field.wecom.botId": "Bot ID", "field.wecom.secret": "Secret", "field.qq.appId": "AppID", "field.qq.appSecret": "AppSecret", "field.telegram.token": "Bot Token", "field.discord.token": "Bot Token", "field.slack.token": "Bot Token(xoxb- 开头)", "field.slack.appToken": "App Token(xapp- 开头)",
|
|
1151
|
-
"bind.title": "配置 {channel}", "bind.quick": "快捷绑定(推荐)", "bind.manual": "手动配置", "bind.saving": "正在保存账号…", "bind.success": "绑定成功,频道已连接", "bind.newIdentity": "检测到新的账号身份,已创建新账号", "bind.qrAlt": "{channel} 绑定二维码", "bind.generating": "正在生成…", "bind.expire": "二维码 {time} 后过期", "bind.scanned": "已扫码,请在手机上确认", "bind.retry": "请重新生成二维码", "bind.refresh": "重新生成二维码", "action.saving": "保存中…", "action.confirm": "确认",
|
|
1132
|
+
"bind.title": "配置 {channel}", "bind.tabsAria": "绑定方式", "bind.quick": "快捷绑定(推荐)", "bind.manual": "手动配置", "bind.saving": "正在保存账号…", "bind.success": "绑定成功,频道已连接", "bind.newIdentity": "检测到新的账号身份,已创建新账号", "bind.qrAlt": "{channel} 绑定二维码", "bind.generating": "正在生成…", "bind.expire": "二维码 {time} 后过期", "bind.scanned": "已扫码,请在手机上确认", "bind.retry": "请重新生成二维码", "bind.refresh": "重新生成二维码", "action.saving": "保存中…", "action.confirm": "确认",
|
|
1152
1133
|
"qr.weixin": "请使用微信扫描二维码完成绑定", "qr.feishu": "请使用飞书扫描二维码,将自动创建机器人", "qr.lark": "请使用 Lark 扫描二维码完成配对", "qr.wecom": "请使用企业微信扫描二维码,快捷绑定机器人", "qr.dingtalk": "请使用钉钉扫描二维码,自动创建机器人", "qr.qq": "请使用手机 QQ 扫描二维码,创建开放平台机器人", "qr.default": "请使用对应 App 扫描二维码",
|
|
1153
1134
|
"status.connected": "已连接", "action.more": "{channel} 更多",
|
|
1154
1135
|
"error.loadAssistant": "无法加载账号配置", "error.noModels": "当前 Host 还没有可用模型,请先在网页里配置提供商", "error.save": "保存失败", "error.chooseWorkspace": "请选择工作区目录", "error.workspaceUnavailable": "当前 Host 无法新增工作区", "error.addWorkspace": "新增工作区失败", "error.load": "加载失败", "error.connection": "无法连接本机 IM 助理接口", "error.request": "请求失败", "error.action": "操作失败", "error.qr": "无法生成二维码", "error.detailsInLog": "操作失败,请查看服务器日志。",
|
|
@@ -1177,7 +1158,7 @@ function observePluginUpdate(options) {
|
|
|
1177
1158
|
"channel.dingtalk": "DingTalk", "channel.feishu": "Feishu", "channel.lark": "Lark", "channel.weixin": "WeChat", "channel.wecom": "WeCom", "channel.qq": "QQ", "channel.telegram": "Telegram", "channel.discord": "Discord", "channel.slack": "Slack",
|
|
1178
1159
|
"field.dingtalk.clientId": "Client ID (formerly AppKey)", "field.dingtalk.clientSecret": "Client Secret (formerly AppSecret)",
|
|
1179
1160
|
"field.wecom.botId": "Bot ID", "field.wecom.secret": "Secret", "field.qq.appId": "AppID", "field.qq.appSecret": "AppSecret", "field.telegram.token": "Bot Token", "field.discord.token": "Bot Token", "field.slack.token": "Bot Token (starts with xoxb-)", "field.slack.appToken": "App Token (starts with xapp-)",
|
|
1180
|
-
"bind.title": "Set up {channel}", "bind.quick": "Quick setup (recommended)", "bind.manual": "Manual setup", "bind.saving": "Saving account…", "bind.success": "Connected successfully", "bind.newIdentity": "A new account identity was detected and a new account was created", "bind.qrAlt": "{channel} setup QR code", "bind.generating": "Generating…", "bind.expire": "QR code expires in {time}", "bind.scanned": "Scanned. Confirm on your phone.", "bind.retry": "Generate a new QR code", "bind.refresh": "Generate a new QR code", "action.saving": "Saving…", "action.confirm": "Confirm",
|
|
1161
|
+
"bind.title": "Set up {channel}", "bind.tabsAria": "Setup method", "bind.quick": "Quick setup (recommended)", "bind.manual": "Manual setup", "bind.saving": "Saving account…", "bind.success": "Connected successfully", "bind.newIdentity": "A new account identity was detected and a new account was created", "bind.qrAlt": "{channel} setup QR code", "bind.generating": "Generating…", "bind.expire": "QR code expires in {time}", "bind.scanned": "Scanned. Confirm on your phone.", "bind.retry": "Generate a new QR code", "bind.refresh": "Generate a new QR code", "action.saving": "Saving…", "action.confirm": "Confirm",
|
|
1181
1162
|
"qr.weixin": "Scan the QR code with WeChat to connect", "qr.feishu": "Scan with Feishu; a bot will be created automatically", "qr.lark": "Scan with Lark to pair", "qr.wecom": "Scan with WeCom to quickly connect a bot", "qr.dingtalk": "Scan with DingTalk; a bot will be created automatically", "qr.qq": "Scan with mobile QQ to create an Open Platform bot", "qr.default": "Scan the QR code with the corresponding app",
|
|
1182
1163
|
"status.connected": "Connected", "action.more": "More options for {channel}",
|
|
1183
1164
|
"error.loadAssistant": "Could not load account settings", "error.noModels": "No models are available in the Host. Configure a provider in the web app first.", "error.save": "Could not save", "error.chooseWorkspace": "Choose a workspace directory", "error.workspaceUnavailable": "This Host cannot create workspaces", "error.addWorkspace": "Could not add workspace", "error.load": "Could not load", "error.connection": "Could not connect to the local IM Assistant API", "error.request": "Request failed", "error.action": "Action failed", "error.qr": "Could not generate a QR code", "error.detailsInLog": "The operation failed. Check the server logs for details.",
|
|
@@ -1230,6 +1211,8 @@ function observePluginUpdate(options) {
|
|
|
1230
1211
|
.ima-title-row{display:flex;align-items:center;gap:8px 12px;min-width:0;flex-wrap:wrap}
|
|
1231
1212
|
.ima-title-links{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
|
|
1232
1213
|
.ima-title-links>span[data-mpi-check]{display:inline-flex;align-items:center}
|
|
1214
|
+
[data-ima-nav-icon="assistant"]>svg{display:none!important}
|
|
1215
|
+
.ima-nav-icon-assistant{--ima-nav-icon-mask:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cpath%20fill%3D%22black%22%20d%3D%22M2.15%202.9h11.7v8.2H6.42L2.15%2013.85V2.9Zm1.4%201.4v6.62l1.78-1.12h7.12V4.3H3.55Z%22%2F%3E%3C%2Fsvg%3E");display:inline-block;flex:none;width:16px;height:16px;background:currentColor;-webkit-mask:var(--ima-nav-icon-mask) center/contain no-repeat;mask:var(--ima-nav-icon-mask) center/contain no-repeat}
|
|
1233
1216
|
.ima-btn{display:inline-flex;align-items:center;justify-content:center;gap:4px;height:32px;padding:0 12px;border:0.5px solid var(--dsw-alias-border-l3,#555);border-radius:var(--dsw-radius-sm,8px);background:transparent;color:var(--dsw-alias-label-primary,#eee);font:inherit;font-size:13px;line-height:20px;cursor:pointer;user-select:none;box-sizing:border-box;text-decoration:none;transition:border-color 120ms ease,color 120ms ease,background 120ms ease}
|
|
1234
1217
|
.ima-btn:not(.is-primary):not(.ima-btn-danger){color:var(--dsw-alias-label-primary,#eee)!important}
|
|
1235
1218
|
.ima-btn:hover:not(:disabled):not(.ima-btn-danger){border-color:var(--dsw-alias-border-l3,#666)!important;color:var(--dsw-alias-label-primary,#fff)!important;background:var(--dsw-alias-interactive-bg-hover,rgba(255,255,255,.06))!important}
|
|
@@ -1262,11 +1245,20 @@ function observePluginUpdate(options) {
|
|
|
1262
1245
|
.ima-wrap{display:flex;flex-direction:column;min-height:0;flex:1;height:100%;overflow:hidden}.ima-official-tree{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.ima-native.ima-rail,.ima-rail.dcu-wb{box-sizing:border-box;overflow:hidden}
|
|
1263
1246
|
.ima-tabs-wrap{display:flex;margin:2px var(--dsh-sidebar-inline-padding,12px) 8px 0;padding:0;width:auto}
|
|
1264
1247
|
.ima-tabs-wrap .ima-segmented-tabs{width:100%;background:color-mix(in srgb,var(--dsw-alias-label-primary,currentColor) 3%,transparent)!important;border-radius:8px!important;border:0.5px solid var(--dsw-alias-border-l1,rgba(255,255,255,.05))!important;box-sizing:border-box;padding:2px!important}
|
|
1265
|
-
.ima-tabs-wrap .ima-segmented-tabs>span{inset:2px auto 2px 2px!important;border-radius:6px!important;border:0.5px solid var(--dsw-alias-border-l2,rgba(255,255,255,.08))!important;background:color-mix(in srgb,var(--dsw-alias-label-primary,currentColor) 8%,transparent)!important;border-color:color-mix(in srgb,var(--dsw-alias-label-primary,currentColor) 12%,transparent)!important;box-shadow:none!important}
|
|
1248
|
+
.ima-tabs-wrap .ima-segmented-tabs>span{inset:2px auto 2px 2px!important;width:calc((100% - 4px)/var(--ima-tab-count,2))!important;border-radius:6px!important;border:0.5px solid var(--dsw-alias-border-l2,rgba(255,255,255,.08))!important;background:color-mix(in srgb,var(--dsw-alias-label-primary,currentColor) 8%,transparent)!important;border-color:color-mix(in srgb,var(--dsw-alias-label-primary,currentColor) 12%,transparent)!important;box-shadow:none!important}
|
|
1266
1249
|
.ima-tabs-wrap .ima-segmented-tabs [role=tab]{display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:5px!important;width:100%!important;height:26px!important;padding:0 6px!important;font-size:13px!important;line-height:18px!important;border-radius:6px!important;color:var(--dsw-alias-label-secondary,#8b8f98);text-align:center!important}
|
|
1267
1250
|
.ima-tabs-wrap .ima-segmented-tabs [role=tab]>*{display:inline-flex!important;align-items:center!important;justify-content:center!important}
|
|
1268
1251
|
.ima-tabs-wrap .ima-segmented-tabs [role=tab]:hover{color:var(--dsw-alias-label-primary,inherit)}
|
|
1269
1252
|
.ima-tabs-wrap .ima-segmented-tabs [role=tab][aria-selected=true]{color:var(--dsw-alias-label-primary,inherit)!important;font-weight:600}
|
|
1253
|
+
.ima-bind-tabs-wrap{width:100%;margin:0 0 16px}
|
|
1254
|
+
.ima-bind-tabs-wrap.is-disabled{opacity:.6;pointer-events:none}
|
|
1255
|
+
.ima-bind-panel[hidden]{display:none!important}
|
|
1256
|
+
.ima-bind-tabs-wrap .ima-bind-tabs{width:100%;height:32px;box-sizing:border-box;border-bottom:0;background:color-mix(in srgb,var(--dsw-alias-label-primary,currentColor) 3%,transparent)!important;border-radius:var(--dsw-radius-sm,8px)!important;border:0.5px solid var(--dsw-alias-border-l1,rgba(255,255,255,.05))!important;padding:2px!important}
|
|
1257
|
+
.ima-bind-tabs-wrap .ima-bind-tabs>span{inset:2px auto 2px 2px!important;width:calc((100% - 4px)/2)!important;border-radius:calc(var(--dsw-radius-sm,8px) - 2px)!important;border:0.5px solid color-mix(in srgb,var(--dsw-alias-label-primary,currentColor) 12%,transparent)!important;background:color-mix(in srgb,var(--dsw-alias-label-primary,currentColor) 8%,transparent)!important;box-shadow:none!important}
|
|
1258
|
+
.ima-bind-tabs-wrap .ima-bind-tabs [role=tab]{display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:6px!important;width:100%!important;height:26px!important;padding:0 10px!important;font-size:13px!important;line-height:18px!important;border-radius:calc(var(--dsw-radius-sm,8px) - 2px)!important;color:var(--dsw-alias-label-secondary,#8b8f98);text-align:center!important}
|
|
1259
|
+
.ima-bind-tabs-wrap .ima-bind-tabs [role=tab]>*{display:inline-flex!important;align-items:center!important;justify-content:center!important}
|
|
1260
|
+
.ima-bind-tabs-wrap .ima-bind-tabs [role=tab]:hover{color:var(--dsw-alias-label-primary,inherit)}
|
|
1261
|
+
.ima-bind-tabs-wrap .ima-bind-tabs [role=tab][aria-selected=true]{color:var(--dsw-alias-label-primary,inherit)!important;font-weight:600}
|
|
1270
1262
|
.ima-tabs{display:flex;gap:18px;padding:4px 12px 0;border-bottom:1px solid var(--ima-line)}
|
|
1271
1263
|
.ima-tab{appearance:none;border:0;background:transparent;color:var(--ima-muted);padding:8px 0;font-size:13px;cursor:pointer}
|
|
1272
1264
|
.ima-tab.on{color:var(--ima-text);box-shadow:inset 0 -2px 0 currentColor}
|
|
@@ -1296,11 +1288,6 @@ function observePluginUpdate(options) {
|
|
|
1296
1288
|
.ima-checkbox-label{display:inline-flex;align-items:center;gap:8px;font-size:13px;color:var(--dsw-alias-label-primary,#eee);cursor:pointer;user-select:none}
|
|
1297
1289
|
.ima-checkbox-label.is-disabled{opacity:.5;cursor:not-allowed}
|
|
1298
1290
|
.ima-checkbox{width:16px;height:16px;margin:0;accent-color:var(--dsw-alias-state-business-primary,#4176e6);cursor:inherit}
|
|
1299
|
-
.ima-segmented{display:inline-flex;background:var(--dsw-alias-bg-layer-2,rgba(128,128,128,.1));padding:2px;border-radius:var(--dsw-radius-sm,8px);gap:2px;border:0.5px solid var(--dsw-alias-border-l1,rgba(255,255,255,.06))}
|
|
1300
|
-
.ima-segmented.is-block{display:flex;width:100%}
|
|
1301
|
-
.ima-segmented-item{flex:1;min-width:0;height:28px;padding:0 12px;border:none;border-radius:calc(var(--dsw-radius-sm,8px) - 2px);background:transparent;color:var(--dsw-alias-label-secondary,#a0a0a0);font:inherit;font-size:12px;font-weight:500;cursor:pointer;transition:all 120ms ease;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
1302
|
-
.ima-segmented-item:hover:not(:disabled){color:var(--dsw-alias-label-primary,#eee)}
|
|
1303
|
-
.ima-segmented-item.is-active{background:var(--dsw-alias-bg-layer-1,#222);color:var(--dsw-alias-label-primary,#fff);box-shadow:0 1px 3px rgba(0,0,0,.2)}
|
|
1304
1291
|
.ima-tag{display:inline-flex!important;align-items:center!important;gap:4px!important;height:22px!important;padding:0 8px!important;font-size:12px!important;line-height:20px!important;border-radius:var(--dsw-radius-sm,6px)!important;font-weight:500!important;box-sizing:border-box!important;vertical-align:middle!important;background:var(--dsw-alias-interactive-bg-hover,rgba(128,128,128,.12));color:var(--dsw-alias-label-secondary,#b9b9b9);border:none}
|
|
1305
1292
|
.ima-tag .ima-btn-spinner{width:11px!important;height:11px!important;margin-right:2px!important;vertical-align:0!important}
|
|
1306
1293
|
.ima-tag-info,.ima-tag-processing,.ima-tag.is-busy{background:color-mix(in srgb,var(--dsw-alias-state-business-primary,#4176e6) 14%,transparent)!important;color:var(--dsw-alias-state-business-primary,#4176e6)!important}
|
|
@@ -1343,7 +1330,7 @@ function observePluginUpdate(options) {
|
|
|
1343
1330
|
.ima-inspector-status{flex:none}
|
|
1344
1331
|
.ima-form{display:flex;flex-direction:column;gap:16px;padding-top:20px}
|
|
1345
1332
|
.ima-command-permissions{min-width:0;margin:0;padding:0;border:0}
|
|
1346
|
-
.ima-diagnostic-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.ima-inspector-title-row .ima-tag{margin-inline-end:0}.ima-bind-modal .ima-
|
|
1333
|
+
.ima-diagnostic-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.ima-inspector-title-row .ima-tag{margin-inline-end:0}.ima-bind-modal .ima-feedback{margin-bottom:12px}.ima-connection-check{display:grid;gap:6px;padding:12px;border:1px solid var(--ima-line);border-radius:8px;font-size:12px;line-height:1.6;overflow-wrap:anywhere;color:var(--ima-muted)}.ima-connection-check strong{color:var(--ima-text)}.ima-diagnostic-item{padding:8px 0;border-top:1px solid var(--ima-line)}
|
|
1347
1334
|
.ima-inspector-actions{display:flex!important;flex-wrap:wrap!important;align-items:center!important;justify-content:flex-end!important;gap:8px!important;margin-top:16px!important;padding-top:16px!important;padding-bottom:4px!important}
|
|
1348
1335
|
.ima-account-modal .ima-inspector{padding:0 0 16px 0}
|
|
1349
1336
|
.ima-bind-modal,.ima-account-modal{width:min(720px,100%) !important;max-height:100%}
|
|
@@ -1902,6 +1889,7 @@ function observePluginUpdate(options) {
|
|
|
1902
1889
|
function BindModal({ ch, onClose, onConnected, catalog, permissions, agentPresets, workspaces, defaults, readMainSessionModel, createWorkspace, pickDirectory, modelT, permissionT, presetT, t = fallbackT }) {
|
|
1903
1890
|
const hasQr = ch.kind === "qr" || ch.kind === "qr-or-credentials";
|
|
1904
1891
|
const hasManual = ch.kind === "credentials" || ch.kind === "qr-or-credentials";
|
|
1892
|
+
const showTabs = hasQr && hasManual;
|
|
1905
1893
|
const [tab, setTab] = useState(hasQr ? "qr" : "manual");
|
|
1906
1894
|
const [pairing, setPairing] = useState(null);
|
|
1907
1895
|
const [qrStarted, setQrStarted] = useState(false);
|
|
@@ -2064,16 +2052,19 @@ function observePluginUpdate(options) {
|
|
|
2064
2052
|
)
|
|
2065
2053
|
: null,
|
|
2066
2054
|
},
|
|
2067
|
-
|
|
2068
|
-
|
|
2055
|
+
showTabs && h("div", {
|
|
2056
|
+
className: ["ima-bind-tabs-wrap", saving ? "is-disabled" : ""].filter(Boolean).join(" "),
|
|
2057
|
+
"aria-disabled": saving ? "true" : undefined,
|
|
2058
|
+
}, h(HostSegmentedTabs, {
|
|
2059
|
+
className: "ima-bind-tabs",
|
|
2060
|
+
label: t("bind.tabsAria"),
|
|
2069
2061
|
value: tab,
|
|
2070
|
-
disabled: saving,
|
|
2071
|
-
options: [
|
|
2072
|
-
{ value: "qr", label: t("bind.quick") },
|
|
2073
|
-
{ value: "manual", label: t("bind.manual") },
|
|
2074
|
-
],
|
|
2075
2062
|
onChange: (next) => switchTab(next),
|
|
2076
|
-
|
|
2063
|
+
items: [
|
|
2064
|
+
{ value: "qr", id: "ima-bind-tab-qr", panelId: "ima-bind-panel-qr", label: t("bind.quick") },
|
|
2065
|
+
{ value: "manual", id: "ima-bind-tab-manual", panelId: "ima-bind-panel-manual", label: t("bind.manual") },
|
|
2066
|
+
],
|
|
2067
|
+
})),
|
|
2077
2068
|
error && h(NoticeBar, { type: "error" }, error),
|
|
2078
2069
|
success && h(NoticeBar, { type: "success" }, success),
|
|
2079
2070
|
h("div", { className: "ima-setup-section" },
|
|
@@ -2098,7 +2089,7 @@ function observePluginUpdate(options) {
|
|
|
2098
2089
|
}),
|
|
2099
2090
|
h(CommandPermissionSettings, { value: settings.commandPermissions, onSave: commandPermissions => setSettings(current => ({ ...current, commandPermissions })), t }),
|
|
2100
2091
|
),
|
|
2101
|
-
tab
|
|
2092
|
+
hasQr && h("div", showTabs ? { className: "ima-bind-panel", id: "ima-bind-panel-qr", role: "tabpanel", "aria-labelledby": "ima-bind-tab-qr", hidden: tab !== "qr" } : null,
|
|
2102
2093
|
status === "success"
|
|
2103
2094
|
? h(NoticeBar, { type: "success" }, t("bind.success"))
|
|
2104
2095
|
: status === "saving"
|
|
@@ -2119,7 +2110,7 @@ function observePluginUpdate(options) {
|
|
|
2119
2110
|
hostModalButton(busy ? t("bind.generating") : qrStarted ? t("bind.refresh") : t("action.generateQr"), () => startQr(qrStarted), "primary", { disabled: busy || !workspaceIsListed(settings.cwd, workspaces) || !settings.provider || !settings.model || !settings.permission }),
|
|
2120
2111
|
)
|
|
2121
2112
|
),
|
|
2122
|
-
|
|
2113
|
+
hasManual && h("div", showTabs ? { className: "ima-bind-panel", id: "ima-bind-panel-manual", role: "tabpanel", "aria-labelledby": "ima-bind-tab-manual", hidden: tab !== "manual" } : null,
|
|
2123
2114
|
...ch.fields.map((f) => h("label", { key: f.key, className: "ima-field" },
|
|
2124
2115
|
fieldLabel(ch, f, t),
|
|
2125
2116
|
h(Input, {
|
|
@@ -3830,7 +3821,9 @@ function observePluginUpdate(options) {
|
|
|
3830
3821
|
}
|
|
3831
3822
|
|
|
3832
3823
|
function findNativeTabRegistry(entry) {
|
|
3833
|
-
|
|
3824
|
+
const target = entry && (typeof entry === "object" || typeof entry === "function") && "component" in entry ? entry.component : entry;
|
|
3825
|
+
const registry = target?.__dshNativeTabs;
|
|
3826
|
+
return registry?.version === 1 && typeof registry.getTabs === "function" && typeof registry.subscribe === "function" && typeof registry.insert === "function" ? registry : null;
|
|
3834
3827
|
}
|
|
3835
3828
|
|
|
3836
3829
|
function applyRegistryFilters(state, registry) {
|
|
@@ -3969,7 +3962,7 @@ function observePluginUpdate(options) {
|
|
|
3969
3962
|
|
|
3970
3963
|
return h("div", { className: "ima-wrap" },
|
|
3971
3964
|
HostSegmentedTabs
|
|
3972
|
-
? h("div", { className: "ima-tabs-wrap" },
|
|
3965
|
+
? h("div", { className: "ima-tabs-wrap", style: { "--ima-tab-count": String(imTabItems.length) } },
|
|
3973
3966
|
h(HostSegmentedTabs, {
|
|
3974
3967
|
className: "ima-segmented-tabs",
|
|
3975
3968
|
label: t("rail.tabsAria"),
|
|
@@ -4118,9 +4111,8 @@ function observePluginUpdate(options) {
|
|
|
4118
4111
|
};
|
|
4119
4112
|
|
|
4120
4113
|
const NAV_ICON_MARKER = "data-ima-nav-icon";
|
|
4121
|
-
const
|
|
4114
|
+
const NAV_ICON_CLASS = "ima-nav-icon-assistant";
|
|
4122
4115
|
const NAV_ROW_SELECTOR = '[role="dialog"] nav button';
|
|
4123
|
-
const IM_NAV_PATHS = '<path fill="currentColor" d="M2.15 2.9h11.7v8.2H6.42L2.15 13.85V2.9Zm1.4 1.4v6.62l1.78-1.12h7.12V4.3H3.55Z"/>';
|
|
4124
4116
|
|
|
4125
4117
|
function isOwnNavRow(rowText, wantedLabel) {
|
|
4126
4118
|
const wanted = String(wantedLabel ?? "").trim();
|
|
@@ -4131,41 +4123,25 @@ function observePluginUpdate(options) {
|
|
|
4131
4123
|
|
|
4132
4124
|
function applySettingsNavIcon(button, wantedLabel) {
|
|
4133
4125
|
if (!isOwnNavRow(button.textContent, wantedLabel())) return false;
|
|
4134
|
-
|
|
4135
|
-
if (
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
if (!
|
|
4139
|
-
svg
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4126
|
+
if (!button.querySelector("svg")) return false;
|
|
4127
|
+
if (button.getAttribute(NAV_ICON_MARKER) === "assistant" && button.querySelector(`.${NAV_ICON_CLASS}`)) return false;
|
|
4128
|
+
button.setAttribute(NAV_ICON_MARKER, "assistant");
|
|
4129
|
+
let icon = button.querySelector(`.${NAV_ICON_CLASS}`);
|
|
4130
|
+
if (!icon) {
|
|
4131
|
+
// 不改宿主 svg 内容:皮肤的内容级识别/隐藏规则只作用于 svg 子节点,
|
|
4132
|
+
// 这里用独立的 mask 图标,避免与其互相覆盖。
|
|
4133
|
+
icon = document.createElement("span");
|
|
4134
|
+
icon.className = NAV_ICON_CLASS;
|
|
4135
|
+
icon.setAttribute("aria-hidden", "true");
|
|
4136
|
+
button.prepend(icon);
|
|
4144
4137
|
}
|
|
4145
|
-
svg.setAttribute("data-ima-nav-icon", "assistant");
|
|
4146
|
-
svg.setAttribute("viewBox", "0 0 16 16");
|
|
4147
|
-
svg.setAttribute("fill", "none");
|
|
4148
|
-
svg.innerHTML = IM_NAV_PATHS;
|
|
4149
|
-
button.setAttribute(NAV_ICON_MARKER, "");
|
|
4150
4138
|
return true;
|
|
4151
4139
|
}
|
|
4152
4140
|
|
|
4153
4141
|
function restoreSettingsNavIcon(button) {
|
|
4154
|
-
const svg = button.querySelector("svg");
|
|
4155
4142
|
button.removeAttribute(NAV_ICON_MARKER);
|
|
4156
|
-
|
|
4157
|
-
|
|
4158
|
-
svg.removeAttribute("data-ima-nav-icon");
|
|
4159
|
-
svg.removeAttribute(NAV_ICON_ORIGINAL);
|
|
4160
|
-
if (!raw) return false;
|
|
4161
|
-
try {
|
|
4162
|
-
const saved = JSON.parse(raw);
|
|
4163
|
-
svg.innerHTML = saved.innerHTML;
|
|
4164
|
-
if (saved.viewBox == null) svg.removeAttribute("viewBox");
|
|
4165
|
-
else svg.setAttribute("viewBox", saved.viewBox);
|
|
4166
|
-
if (saved.fill == null) svg.removeAttribute("fill");
|
|
4167
|
-
else svg.setAttribute("fill", saved.fill);
|
|
4168
|
-
} catch { /* ignore */ }
|
|
4143
|
+
const icon = button.querySelector(`.${NAV_ICON_CLASS}`);
|
|
4144
|
+
if (icon) icon.remove();
|
|
4169
4145
|
return true;
|
|
4170
4146
|
}
|
|
4171
4147
|
|
|
@@ -4309,6 +4285,7 @@ function observePluginUpdate(options) {
|
|
|
4309
4285
|
const occupant = entries.find((item) => item && item.component);
|
|
4310
4286
|
if (wrappedEntry && (occupant !== wrappedEntry || occupant.component !== ownedWrapper)) unwrap();
|
|
4311
4287
|
if (!occupant) { clearInsertedTab(); return; }
|
|
4288
|
+
if (insertedTabRegistry && findNativeTabRegistry(occupant) !== insertedTabRegistry) clearInsertedTab();
|
|
4312
4289
|
if (occupant && (occupant.component.__dshNativeTabHost || occupant.component.__dshAutomationWrapped || findNativeTabRegistry(occupant))) {
|
|
4313
4290
|
insertChannelTab(occupant);
|
|
4314
4291
|
return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@michengai/dsh-im-connect",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "DSH IM Connect — 将主流即时通讯平台接入本机 DeepSeek Harness · Connect major messaging platforms to local DeepSeek Harness agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"packageManager": "pnpm@11.22.0",
|