dsh-long-plugins 2.2.1 → 2.2.2
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/client/client.js +231 -15
- package/dsh.plugin.json +1 -1
- package/package.json +1 -1
- package/skill/dsh-upgrade/SKILL.md +29 -0
package/client/client.js
CHANGED
|
@@ -3053,7 +3053,7 @@ window.__ModuleLoader__.load({
|
|
|
3053
3053
|
backdrop-filter: none;
|
|
3054
3054
|
-webkit-backdrop-filter: none;
|
|
3055
3055
|
}
|
|
3056
|
-
/*
|
|
3056
|
+
/* 左栏顶部「新会话」按钮:去掉白/黑实底与边框,透出背景图;文字颜色交由下方统一的侧边栏/顶栏可读文字规则决定 */
|
|
3057
3057
|
html[data-dsh-glass="on"] #root [class*="newSession"] {
|
|
3058
3058
|
background-color: transparent !important;
|
|
3059
3059
|
background-image: none !important;
|
|
@@ -3062,9 +3062,9 @@ window.__ModuleLoader__.load({
|
|
|
3062
3062
|
box-shadow: none !important;
|
|
3063
3063
|
backdrop-filter: none !important;
|
|
3064
3064
|
-webkit-backdrop-filter: none !important;
|
|
3065
|
-
color: #ffffff !important;
|
|
3066
|
-
text-shadow: 0 1px 3px rgba(0,0,0,.85);
|
|
3067
3065
|
}
|
|
3066
|
+
/* 左栏/顶栏文字可读性改用 JS 处理(见 glassPlugin.apply 的 applyChromeText),
|
|
3067
|
+
只作用于主界面左栏/顶栏、并跳过设置/弹窗/浮层,避免波及设置面板 */
|
|
3068
3068
|
/* 左栏内部根 / 底部容器也用透明(这些是 DSH 当前版本哈希类名;背景图要透到左栏与底部) */
|
|
3069
3069
|
html[data-dsh-glass="on"] #root [class*="hHd-Xa_root"],
|
|
3070
3070
|
html[data-dsh-glass="on"] #root [class*="FJxK0a_root"] {
|
|
@@ -3109,7 +3109,7 @@ window.__ModuleLoader__.load({
|
|
|
3109
3109
|
-webkit-backdrop-filter: none !important;
|
|
3110
3110
|
}
|
|
3111
3111
|
/* 输入框盒子(uV2eYG_card):实底(浅色=白/深色=深)并在背景图之上,文字随主题,保证可读。
|
|
3112
|
-
加 #root 提高优先级,压过 DSH 自身把 card 背景设透明的规则 */
|
|
3112
|
+
加 #root 提高优先级,压过 DSH 自身把 card 背景设透明的规则(与 v2.2.1 一致) */
|
|
3113
3113
|
html[data-dsh-glass="on"] #root [class*="uV2eYG_card"],
|
|
3114
3114
|
html[data-dsh-glass="on"] [class*="uV2eYG_card"] {
|
|
3115
3115
|
position: relative !important;
|
|
@@ -3125,6 +3125,33 @@ window.__ModuleLoader__.load({
|
|
|
3125
3125
|
html[data-dsh-glass="on"] #root [class*="uV2eYG_card"],
|
|
3126
3126
|
html[data-dsh-glass="on"] [class*="uV2eYG_card"] { background: #1c2530 !important; color: #f5f7fa !important; }
|
|
3127
3127
|
}
|
|
3128
|
+
/* 会话语流"耗时统计"(turn-tail: 12:38/用时/首token/tok/s):白字+深投影,避免淡字叠在背景图上看不见 */
|
|
3129
|
+
html[data-dsh-glass="on"] [class*="osXY9a_root"],
|
|
3130
|
+
html[data-dsh-glass="on"] [class*="osXY9a_root"] span,
|
|
3131
|
+
html[data-dsh-glass="on"] [class*="p-xYUq_timeEnd"],
|
|
3132
|
+
html[data-dsh-glass="on"] [class*="p-xYUq_"] span {
|
|
3133
|
+
color: #ffffff !important;
|
|
3134
|
+
text-shadow: 0 1px 1px rgba(0,0,0,.5);
|
|
3135
|
+
}
|
|
3136
|
+
/* DSH 弹窗/浮层(提问/确认/重命名等):给不透明底+主题文字, 杜绝透明与会话内容重叠 */
|
|
3137
|
+
html[data-dsh-glass="on"] [class*="Radix"] [class*="Content"],
|
|
3138
|
+
html[data-dsh-glass="on"] [class*="DialogContent"],
|
|
3139
|
+
html[data-dsh-glass="on"] [class*="ModalContent"],
|
|
3140
|
+
html[data-dsh-glass="on"] [class*="overlay"] [class*="content"],
|
|
3141
|
+
html[data-dsh-glass="on"] [class*="_content"][class*="dialog"] {
|
|
3142
|
+
background-color: var(--dsw-specific-input-major, #e8edf3) !important;
|
|
3143
|
+
color: var(--dsw-alias-label-primary) !important;
|
|
3144
|
+
backdrop-filter: blur(8px) !important;
|
|
3145
|
+
-webkit-backdrop-filter: blur(8px) !important;
|
|
3146
|
+
}
|
|
3147
|
+
/* DSH 提问/弹窗卡(M8wy4a_card 等):不透明底+原生文字, 避免透明重叠、白字 */
|
|
3148
|
+
html[data-dsh-glass="on"] [class*="M8wy4a_card"],
|
|
3149
|
+
html[data-dsh-glass="on"] [data-chain-overlay-fallback] [class*="card"] {
|
|
3150
|
+
background-color: var(--dsw-specific-input-major, #e8edf3) !important;
|
|
3151
|
+
color: var(--dsw-alias-label-primary) !important;
|
|
3152
|
+
backdrop-filter: blur(8px) !important;
|
|
3153
|
+
-webkit-backdrop-filter: blur(8px) !important;
|
|
3154
|
+
}
|
|
3128
3155
|
/* 轮次/历史提问预览:默认隐藏(点开才显示),并去掉头部底色,避免底部露出白条 */
|
|
3129
3156
|
.dsh-turn-preview:not(.open){display:none !important;}
|
|
3130
3157
|
.dsh-turn-preview-head{background:transparent !important;}
|
|
@@ -3148,17 +3175,21 @@ window.__ModuleLoader__.load({
|
|
|
3148
3175
|
html[data-dsh-glass="on"][data-dsh-theme="light"] #root [class*="QWLzLg_title"] {
|
|
3149
3176
|
color: #2f3d4a !important;
|
|
3150
3177
|
}
|
|
3151
|
-
/* 输入框下方状态/统计行(余额+步数/时长/速度等)都在 composer.dock
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
html[data-dsh-glass="on"]
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3178
|
+
/* 输入框下方状态/统计行(余额+步数/时长/速度等)都在 composer.dock 槽里:
|
|
3179
|
+
背景是会变的背景图, 单色难保证可读;给整块加半透明深色衬底+亮字, 任意背景都可读。
|
|
3180
|
+
槽位属性可能是 data-slot-conversation 或 data-slot(两种都锁) */
|
|
3181
|
+
html[data-dsh-glass="on"] [data-slot-conversation="conversation.composer.dock"],
|
|
3182
|
+
html[data-dsh-glass="on"] [data-slot="conversation.composer.dock"] {
|
|
3183
|
+
background-color: rgba(12,20,30,.55) !important;
|
|
3184
|
+
border-radius: 8px !important;
|
|
3185
|
+
padding: 1px 10px !important;
|
|
3186
|
+
backdrop-filter: blur(2px);
|
|
3187
|
+
-webkit-backdrop-filter: blur(2px);
|
|
3188
|
+
}
|
|
3189
|
+
html[data-dsh-glass="on"] [data-slot-conversation="conversation.composer.dock"] *,
|
|
3190
|
+
html[data-dsh-glass="on"] [data-slot="conversation.composer.dock"] * {
|
|
3191
|
+
color: #f0f4f9 !important;
|
|
3192
|
+
text-shadow: 0 1px 1px rgba(0,0,0,.5);
|
|
3162
3193
|
}
|
|
3163
3194
|
/* 会话区所有内容元素背景透明化:去掉"反底色"小块衬底,统一融入磨砂卡片 */
|
|
3164
3195
|
html[data-dsh-glass="on"] #root [class*="wSkVaW_scrollBody"] *:not([class*="button"]):not([class*="bubble"]):not([class*="_menu"]) {
|
|
@@ -3509,6 +3540,7 @@ window.__ModuleLoader__.load({
|
|
|
3509
3540
|
const bgHex = hasColor ? tb.color : defBg
|
|
3510
3541
|
const alpha = (tb && typeof tb.opacity === 'number' && Number.isFinite(tb.opacity)) ? Math.min(1, Math.max(0, tb.opacity)) : 1
|
|
3511
3542
|
const bg = `rgba(${hexToRgb(bgHex)},${alpha})`
|
|
3543
|
+
// 背景/文字同步:按背景底色亮度决定文字色(亮底=深字/暗底=浅字),确保可读;与 v2.2.1 一致
|
|
3512
3544
|
const fg = relLum(bgHex) > 0.5 ? '#1a2332' : '#f5f7fa'
|
|
3513
3545
|
inputCard.style.setProperty('background-color', bg, 'important')
|
|
3514
3546
|
inputCard.style.setProperty('color', fg, 'important')
|
|
@@ -3517,6 +3549,157 @@ window.__ModuleLoader__.load({
|
|
|
3517
3549
|
el.style.setProperty('color', fg, 'important')
|
|
3518
3550
|
})
|
|
3519
3551
|
}
|
|
3552
|
+
// 主界面左栏/顶栏可见文字:白字+单层轻投影(Windows 桌面图标风格, 不加粗)。
|
|
3553
|
+
// 显式跳过设置/弹窗/浮层(modal/overlay/dialog/settings/panel/drawer/Radix/menu), 避免波及设置面板/弹出菜单。
|
|
3554
|
+
const SKIP_SEL = ':is([class*="settings"],[class*="Dialog"],[class*="dialog"],[class*="modal"],[class*="overlay"],[class*="_panel"],[class*="panel"],[class*="drawer"],[class*="Radix"],[class*="_menu"],[class*="brand"],[data-chain-overlay-fallback],[class*="M8wy4a_"])'
|
|
3555
|
+
const isInSkip = (el) => { let p = el; while (p && p !== document.documentElement) { if (p.matches && p.matches(SKIP_SEL)) return true; p = p.parentElement } return false }
|
|
3556
|
+
const applyChromeText = () => {
|
|
3557
|
+
if (!c.enabled) return
|
|
3558
|
+
// 只处理主界面左栏/顶栏内带文字的元素;跳过图标/纯容器。
|
|
3559
|
+
// 文字检测放宽:button/a/span/li/p/标题等直接算,纯 div 容器需自身带文本才算,
|
|
3560
|
+
// 这样底部「设置/已归档」等包在子元素里的按钮也能命中。
|
|
3561
|
+
const roots = [...document.querySelectorAll('#root [class*="sidebarCol"],#root [class*="wSkVaW_header"]')]
|
|
3562
|
+
roots.forEach((root) => {
|
|
3563
|
+
if (isInSkip(root)) return
|
|
3564
|
+
root.querySelectorAll('div,span,button,a,label,p,li,h1,h2,h3,h4').forEach((el) => {
|
|
3565
|
+
if (isInSkip(el)) return
|
|
3566
|
+
const tag = el.tagName
|
|
3567
|
+
const hasText = el.textContent && el.textContent.trim()
|
|
3568
|
+
if (!hasText) return
|
|
3569
|
+
const ownText = Array.from(el.childNodes).some((n) => n.nodeType === 3 && n.textContent.trim())
|
|
3570
|
+
const textLike = /^(BUTTON|A|SPAN|LABEL|LI|P|H1|H2|H3|H4)$/.test(tag)
|
|
3571
|
+
if (!textLike && !ownText) return
|
|
3572
|
+
// 跳过有盒子背景的元素(badge/徽章/药丸等, 如 deepseek 的 HARNESS 徽章):
|
|
3573
|
+
// 这类文字颜色应随其盒子背景走主题, 不强制白字(否则白底徽章+白字不可见)
|
|
3574
|
+
const bgbg = getComputedStyle(el).backgroundColor
|
|
3575
|
+
if (bgbg && bgbg !== 'rgba(0, 0, 0, 0)' && bgbg !== 'transparent') return
|
|
3576
|
+
el.style.setProperty('color', '#ffffff', 'important')
|
|
3577
|
+
el.style.setProperty('text-shadow', '0 1px 1px rgba(0,0,0,.5)')
|
|
3578
|
+
})
|
|
3579
|
+
// 图标也变白(随 currentColor),用于工作区文件夹等单色图标;保留显式品牌色
|
|
3580
|
+
root.querySelectorAll('svg, [class*="icon"], [class*="Icon"]').forEach((el) => {
|
|
3581
|
+
if (isInSkip(el)) return
|
|
3582
|
+
el.style.setProperty('color', '#ffffff', 'important')
|
|
3583
|
+
el.querySelectorAll('path,use,rect,circle,line,polyline,ellipse').forEach((p) => {
|
|
3584
|
+
const f = (p.getAttribute('fill') || '').toLowerCase()
|
|
3585
|
+
if (f && f !== 'none' && f !== 'currentcolor') return
|
|
3586
|
+
p.style.setProperty('fill', 'currentColor', 'important')
|
|
3587
|
+
const s = (p.getAttribute('stroke') || '').toLowerCase()
|
|
3588
|
+
if (s && s !== 'none' && s !== 'currentcolor') return
|
|
3589
|
+
p.style.setProperty('stroke', 'currentColor', 'important')
|
|
3590
|
+
})
|
|
3591
|
+
})
|
|
3592
|
+
})
|
|
3593
|
+
}
|
|
3594
|
+
// 会话区内容(尤其 AI 过程内容:Bash/Think 标签、思考、工具输出等浅色灰字)
|
|
3595
|
+
// 在透明背景图上看不清;用同侧边栏「白字+深投影」处理,跳过有盒子背景的元素(用户气泡/代码块衬底等)。
|
|
3596
|
+
const applySessionText = () => {
|
|
3597
|
+
if (!c.enabled) return
|
|
3598
|
+
const scroll = document.querySelector('#root [class*="wSkVaW_scrollBody"]')
|
|
3599
|
+
if (!scroll) return
|
|
3600
|
+
scroll.querySelectorAll('div,span,p,li,pre,code,button,a,label,h1,h2,h3,h4').forEach((el) => {
|
|
3601
|
+
if (isInSkip(el)) return
|
|
3602
|
+
const hasText = el.textContent && el.textContent.trim()
|
|
3603
|
+
if (!hasText) return
|
|
3604
|
+
const ownText = Array.from(el.childNodes).some((n) => n.nodeType === 3 && n.textContent.trim())
|
|
3605
|
+
const textLike = /^(BUTTON|A|SPAN|LABEL|LI|P|H1|H2|H3|H4|PRE|CODE)$/.test(el.tagName)
|
|
3606
|
+
if (!textLike && !ownText) return
|
|
3607
|
+
const bgbg = getComputedStyle(el).backgroundColor
|
|
3608
|
+
if (bgbg && bgbg !== 'rgba(0, 0, 0, 0)' && bgbg !== 'transparent') return
|
|
3609
|
+
el.style.setProperty('color', '#ffffff', 'important')
|
|
3610
|
+
el.style.setProperty('text-shadow', '0 1px 1px rgba(0,0,0,.5)')
|
|
3611
|
+
})
|
|
3612
|
+
// 在白字底上, 给过程内容配色区分, Error 用红色。
|
|
3613
|
+
// 文字常在标签的子元素里(白字已把它设白), 故连同文本子元素一起上色。
|
|
3614
|
+
const paint = (el, color) => {
|
|
3615
|
+
if (!el) return
|
|
3616
|
+
const set = (d) => { if (d.textContent && d.textContent.trim()) d.style.setProperty('color', color, 'important') }
|
|
3617
|
+
set(el)
|
|
3618
|
+
el.querySelectorAll('span,div,p,li,a').forEach(set)
|
|
3619
|
+
}
|
|
3620
|
+
// 错误/失败单行文本 → 红(只判短行、以 Error/错误/失败/异常 开头, 避免整段误标红)
|
|
3621
|
+
const isErrText = (d) => {
|
|
3622
|
+
const t = (d.textContent || '').trim()
|
|
3623
|
+
if (!t || t.length > 120) return false
|
|
3624
|
+
return /^(error|错误|失败|异常|fail)\b/i.test(t) || /^(error|错误|失败|异常)\s*[::]/i.test(t) || /^File not found/i.test(t)
|
|
3625
|
+
}
|
|
3626
|
+
scroll.querySelectorAll('div,span,p,li,pre,code').forEach((el) => {
|
|
3627
|
+
if (!isErrText(el)) return
|
|
3628
|
+
const ownText = Array.from(el.childNodes).some((n) => n.nodeType === 3 && n.textContent.trim())
|
|
3629
|
+
if (ownText) el.style.setProperty('color', '#ff6b6b', 'important')
|
|
3630
|
+
})
|
|
3631
|
+
// 工具名标签(o3BgMG_title):按工具类型配色(Bash/Shell=绿, Read=蓝, Edit=橙, Write=紫, 默认蓝)
|
|
3632
|
+
const toolColor = (text) => {
|
|
3633
|
+
const t = (text || '').toLowerCase()
|
|
3634
|
+
if (/bash|shell|zsh|terminal|powershell|cmd|sh\b/i.test(t)) return '#5ec26b'
|
|
3635
|
+
if (/edit|modify/i.test(t)) return '#f0a860'
|
|
3636
|
+
if (/write|create/i.test(t)) return '#c9a0ff'
|
|
3637
|
+
return '#8ccfff'
|
|
3638
|
+
}
|
|
3639
|
+
scroll.querySelectorAll('[class*="o3BgMG_title"],[class*="CY-8Ka_title"]').forEach((title) => {
|
|
3640
|
+
paint(title, toolColor(title.textContent))
|
|
3641
|
+
// 从标签向上找最近一个"含链接/代码/更多文本"的容器作为工具行,找不到就用父级
|
|
3642
|
+
let box = title.parentElement
|
|
3643
|
+
for (let i = 0; i < 4 && box; i++) {
|
|
3644
|
+
if (box.querySelector && box.querySelector('a, code, [class*="desc"], [class*="path"], [class*="cmd"], [class*="arg"]')) break
|
|
3645
|
+
box = box.parentElement
|
|
3646
|
+
}
|
|
3647
|
+
if (!box) box = title.parentElement
|
|
3648
|
+
box.querySelectorAll('div,span,a,p,li,pre,code').forEach((el) => {
|
|
3649
|
+
if (el === title || el.querySelector('[class*="o3BgMG_title"]')) return
|
|
3650
|
+
const ownText = Array.from(el.childNodes).some((n) => n.nodeType === 3 && n.textContent.trim())
|
|
3651
|
+
if (!ownText || isErrText(el)) return
|
|
3652
|
+
paint(el, '#6fb89a')
|
|
3653
|
+
})
|
|
3654
|
+
})
|
|
3655
|
+
// 工具输出/路径(o3BgMG_summary):成功 → 水绿;errorSummary 保持红
|
|
3656
|
+
scroll.querySelectorAll('[class*="o3BgMG_summary"]').forEach((el) => {
|
|
3657
|
+
if (/errorSummary/i.test(String(el.className))) return
|
|
3658
|
+
paint(el, '#6fb89a')
|
|
3659
|
+
})
|
|
3660
|
+
// 路径/文件链接(o3BgMG_fileLink) → 水绿(与白字标签区分)
|
|
3661
|
+
scroll.querySelectorAll('[class*="o3BgMG_fileLink"]').forEach((el) => paint(el, '#6fb89a'))
|
|
3662
|
+
// 思考正文(think 容器) → 暖琥珀;再覆盖 Think 标签为琥珀。
|
|
3663
|
+
// 全文档查找,不受 scrollBody 位置/加载时序影响(仍跳过设置/菜单/浮层)
|
|
3664
|
+
const paintThinkBody = (root) => {
|
|
3665
|
+
if (!root) return
|
|
3666
|
+
root.querySelectorAll('div,span,p,li').forEach((el) => {
|
|
3667
|
+
const ownText = Array.from(el.childNodes).some((n) => n.nodeType === 3 && n.textContent.trim())
|
|
3668
|
+
if (ownText && !isErrText(el) && !isInSkip(el)) paint(el, '#e6c583')
|
|
3669
|
+
})
|
|
3670
|
+
}
|
|
3671
|
+
const thinkRoots = [...document.querySelectorAll('[class*="QWLzLg_root"]')].filter((r) => !isInSkip(r))
|
|
3672
|
+
thinkRoots.forEach(paintThinkBody)
|
|
3673
|
+
document.querySelectorAll('[class*="QWLzLg_title"]').forEach((el) => {
|
|
3674
|
+
if (!isInSkip(el)) paint(el, '#f2c566')
|
|
3675
|
+
})
|
|
3676
|
+
// 会话区工具调用等图标:改为白色清晰显示(单色图标随 currentColor 变白, 保留品牌色)
|
|
3677
|
+
scroll.querySelectorAll('svg, [class*="icon"], [class*="Icon"]').forEach((el) => {
|
|
3678
|
+
if (isInSkip(el)) return
|
|
3679
|
+
el.style.setProperty('color', '#ffffff', 'important')
|
|
3680
|
+
el.querySelectorAll('path,use,rect,circle,line,polyline,ellipse').forEach((p) => {
|
|
3681
|
+
const f = (p.getAttribute('fill') || '').toLowerCase()
|
|
3682
|
+
if (f && f !== 'none' && f !== 'currentcolor') return
|
|
3683
|
+
p.style.setProperty('fill', 'currentColor', 'important')
|
|
3684
|
+
const s = (p.getAttribute('stroke') || '').toLowerCase()
|
|
3685
|
+
if (s && s !== 'none' && s !== 'currentcolor') return
|
|
3686
|
+
p.style.setProperty('stroke', 'currentColor', 'important')
|
|
3687
|
+
})
|
|
3688
|
+
})
|
|
3689
|
+
}
|
|
3690
|
+
// DSH 提问/弹窗卡(M8wy4a_card 等):内联强制不透明底+原生文字色, 压过 DSH 重渲染/透明与白字
|
|
3691
|
+
const fixDialogs = () => {
|
|
3692
|
+
if (!c.enabled) return
|
|
3693
|
+
const dark = dshDark()
|
|
3694
|
+
const bg = (getComputedStyle(document.documentElement).getPropertyValue('--dsw-specific-input-major') || '').trim() || '#e8edf3'
|
|
3695
|
+
const fg = dark ? '#f2f6fa' : '#1a2332'
|
|
3696
|
+
// 只匹配提问/弹窗卡(M8wy4a_card),避免误匹配输入框 uV2eYG_card(含"card")导致 blur 重影
|
|
3697
|
+
document.querySelectorAll('[class*="M8wy4a_card"]').forEach((el) => {
|
|
3698
|
+
el.style.setProperty('background-color', bg, 'important')
|
|
3699
|
+
el.style.setProperty('color', fg, 'important')
|
|
3700
|
+
el.style.setProperty('backdrop-filter', 'blur(8px)')
|
|
3701
|
+
})
|
|
3702
|
+
}
|
|
3520
3703
|
// 主题相关的东西统一重算:背景罩 + 输入框。切主题时由 observer/mq 触发。
|
|
3521
3704
|
// 写入前先断开观察器,写完再重连,避免自触发造成死循环。
|
|
3522
3705
|
const applyTheme = () => {
|
|
@@ -3529,6 +3712,9 @@ window.__ModuleLoader__.load({
|
|
|
3529
3712
|
const v = `rgba(${hexToRgb(bt.color)},${bt.mask})`
|
|
3530
3713
|
root.style.setProperty('--dsh-glass-bg-zone', v)
|
|
3531
3714
|
applyInputCard()
|
|
3715
|
+
applyChromeText()
|
|
3716
|
+
applySessionText()
|
|
3717
|
+
fixDialogs()
|
|
3532
3718
|
} finally {
|
|
3533
3719
|
if (obs) obs.observe(document.documentElement, { attributes: true, attributeFilter: ['style', 'class'] })
|
|
3534
3720
|
}
|
|
@@ -3563,6 +3749,30 @@ window.__ModuleLoader__.load({
|
|
|
3563
3749
|
// 记录当前主题应用函数,供唯一观察器/mq 调用
|
|
3564
3750
|
window.__dshGlassApplyTheme = applyTheme
|
|
3565
3751
|
centerScroll()
|
|
3752
|
+
// 侧边栏/顶栏 DOM 变化(会话列表更新等)时重算左栏/顶栏文字,防抖 120ms
|
|
3753
|
+
let chromeTimer = null
|
|
3754
|
+
const chromeRoots = [...document.querySelectorAll('#root [class*="sidebarCol"],#root [class*="wSkVaW_header"]')]
|
|
3755
|
+
const chromeObs = new MutationObserver(() => { if (chromeTimer) clearTimeout(chromeTimer); chromeTimer = setTimeout(applyChromeText, 120) })
|
|
3756
|
+
chromeRoots.forEach((r) => chromeObs.observe(r, { childList: true, subtree: true, characterData: true }))
|
|
3757
|
+
// 输入框卡片(uV2eYG_card/root)可能在启动后才挂载(会话/输入区加载晚),
|
|
3758
|
+
// 启动那一刻 applyInputCard 常找不到框 → 需刷新才生效。监听新增卡片节点时重算,防抖 100ms。
|
|
3759
|
+
let cardTimer = null
|
|
3760
|
+
const hasInputNode = (node) => (node.querySelector && (node.querySelector('[class*="uV2eYG_card"]') || node.querySelector('[class*="uV2eYG_root"]'))) || (node.matches && (node.matches('[class*="uV2eYG_card"]') || node.matches('[class*="uV2eYG_root"]')))
|
|
3761
|
+
const cardObs = new MutationObserver((muts) => {
|
|
3762
|
+
let hit = false
|
|
3763
|
+
for (const m of muts) { for (const node of m.addedNodes) { if (node && node.nodeType === 1 && hasInputNode(node)) { hit = true; break } } if (hit) break }
|
|
3764
|
+
if (hit) { if (cardTimer) clearTimeout(cardTimer); cardTimer = setTimeout(() => applyTheme(), 100) }
|
|
3765
|
+
})
|
|
3766
|
+
cardObs.observe(document.body, { childList: true, subtree: true })
|
|
3767
|
+
// 会话区内容随流式更新会持续变,重算会话区文字(防抖 150ms, 只监听新增/移除节点)
|
|
3768
|
+
let sessionTimer = null
|
|
3769
|
+
const inScroll = (node) => { let p = node; while (p && p !== document.documentElement) { if (p.matches && p.matches('[class*="wSkVaW_scrollBody"]')) return true; p = p.parentElement } return false }
|
|
3770
|
+
const sessionObs = new MutationObserver((muts) => {
|
|
3771
|
+
let hit = false
|
|
3772
|
+
for (const m of muts) { for (const node of m.addedNodes) { if (node.nodeType === 1 && inScroll(node)) { hit = true; break } } if (hit) break }
|
|
3773
|
+
if (hit) { if (sessionTimer) clearTimeout(sessionTimer); sessionTimer = setTimeout(() => { applySessionText(); fixDialogs() }, 150) }
|
|
3774
|
+
})
|
|
3775
|
+
sessionObs.observe(document.body, { childList: true, subtree: true })
|
|
3566
3776
|
}
|
|
3567
3777
|
return () => {
|
|
3568
3778
|
window.__dshGlassApply = undefined
|
|
@@ -3571,6 +3781,12 @@ window.__ModuleLoader__.load({
|
|
|
3571
3781
|
if (window.__dshGlassStyleObs) { window.__dshGlassStyleObs.disconnect(); window.__dshGlassStyleObs = null }
|
|
3572
3782
|
if (themeMq) themeMq.removeEventListener('change', themeMqHandler)
|
|
3573
3783
|
window.__dshGlassApplyTheme = undefined
|
|
3784
|
+
if (chromeObs) chromeObs.disconnect()
|
|
3785
|
+
if (chromeTimer) clearTimeout(chromeTimer)
|
|
3786
|
+
if (cardObs) cardObs.disconnect()
|
|
3787
|
+
if (cardTimer) clearTimeout(cardTimer)
|
|
3788
|
+
if (sessionObs) sessionObs.disconnect()
|
|
3789
|
+
if (sessionTimer) clearTimeout(sessionTimer)
|
|
3574
3790
|
}
|
|
3575
3791
|
}, 'dsh-long-plugins: glass applier')
|
|
3576
3792
|
ctx.slots.inject('settings.section', () => ctx.slots.register({ name: 'settings.section', id: 'glass-ui', order: 40, label: 'RA-Span' }, GlassSettingsSection))
|
package/dsh.plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-long-plugins",
|
|
3
3
|
"description": "Merged DSH web plugins: upload manager (drag-and-drop attach any file to the message), workspace output files, skill docs, account balance, Markdown-to-Word (md2docx), and polished file preview (Word & PowerPoint real preview with zoom/pan, rendered Markdown), plus an auto-repair install for DSH core patches (reverse-proxy WebSocket heartbeat, upgrade relink). | 一个插件整合 DSH Web 的常用增强:上传管理(拖放上传:拖任意文件到会话框直接附加)、工作区「输出文件」面板、技能文档浏览、账户余额显示、Markdown 转 Word(md2docx)、Word/PowerPoint 真实预览(可缩放、翻页);并自带修复安装,自动重连 DSH 核心补丁(反代 WebSocket 心跳、升级重连)。",
|
|
4
|
-
"version": "2.2.
|
|
4
|
+
"version": "2.2.2",
|
|
5
5
|
"entry": {
|
|
6
6
|
"name": "dsh-long-plugins",
|
|
7
7
|
"inject": [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-long-plugins",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.2",
|
|
4
4
|
"description": "Merged DSH web plugins: upload manager (drag-and-drop attach any file to the message), workspace output files, skill docs, account balance, Markdown-to-Word (md2docx), and polished file preview (Word & PowerPoint real preview with zoom/pan, rendered Markdown), plus an auto-repair install for DSH core patches (reverse-proxy WebSocket heartbeat, upgrade relink). | 一个插件整合 DSH Web 的常用增强:上传管理(拖放上传:拖任意文件到会话框直接附加)、工作区「输出文件」面板、技能文档浏览、账户余额显示、Markdown 转 Word(md2docx)、Word/PowerPoint 真实预览(可缩放、翻页);并自带修复安装,自动重连 DSH 核心补丁(反代 WebSocket 心跳、升级重连)。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -73,6 +73,34 @@ cd "$DSH_HOME/profiles/web" && pnpm install
|
|
|
73
73
|
4. 提问/审批窗口:弹出一个问题,等 60s+ 不再自己消失(心跳补丁生效)。
|
|
74
74
|
5. 插件设置面板「上传文件」「输出文件」「技能文档」都在。
|
|
75
75
|
6. `grep -q WEBSOCKET_HEARTBEAT_MS <核心解压路径>/dsh-client-connection/lib/index.js` → 心跳在位。
|
|
76
|
+
7. **RA-Span 玻璃观感**:左栏/顶栏文字图标、会话区过程内容配色、输入框、提问卡、耗时统计等是否仍正常(见下文"RA-Span 升级后需重新校准")。
|
|
77
|
+
|
|
78
|
+
## RA-Span(统一桌面/玻璃)升级后需重新校准 ⚠️
|
|
79
|
+
|
|
80
|
+
dsh-long-plugins 的「RA-Span(统一桌面/玻璃)」**大量依赖 DSH 内部混淆类名**(`o3BgMG_*`/`CY-8Ka_*`/`QWLzLg_*`/`M8wy4a_*`/`uV2eYG_*`/`wSkVaW_*`/`osXY9a_*`/`p-xYUq_*` 等)与 DSH 内部 DOM 结构。DSH 升级重打包后**这些类名前缀会变**,导致插件里靠类名压样式的规则/JS **静默失效**(不报错,只是观感/配色不对)。
|
|
81
|
+
|
|
82
|
+
升级流程会**同步插件代码(逻辑保住)**,但**不会自动重抓新的类名**,所以升级后必须**人工复核**玻璃观感。
|
|
83
|
+
|
|
84
|
+
### 升级后重点复核 + 处理
|
|
85
|
+
1. 浏览器强刷(Ctrl/Cmd+Shift+R)。
|
|
86
|
+
2. 逐项看 RA-Span 是否仍正常:
|
|
87
|
+
- 左栏/顶栏文字与图标(白字+深影、品牌区不被白化)
|
|
88
|
+
- 会话区过程内容配色(Bash 绿 / Read 蓝 / Edit 橙 / Write 紫 / Think 琥珀、错误红、工具输出水绿)
|
|
89
|
+
- 状态/统计行余额(走 `data-slot-conversation="composer.dock"` 的相对稳)
|
|
90
|
+
- 输入框(无重影、背景/文字随主题、可调色)
|
|
91
|
+
- 「新会话」按钮去白底
|
|
92
|
+
3. 若某项观感/配色不对 → **新类名变了**。让用户在对应元素「右键 → 检查」,把高亮元素及父级的 class 发我,把 `client/client.js` 里对应的 `[class*="..."]` 前缀更新成新类名(只改选择器,不动逻辑)。
|
|
93
|
+
4. 稳定项无需动:用 `data-slot-*` 的(状态栏)、注入 `<head>` 的 CSS、`data-dsh-theme` 属性。
|
|
94
|
+
|
|
95
|
+
### 各依赖类名的功能清单(升级后最可能失效)
|
|
96
|
+
| 功能 | 依赖类名 | 失效表现 |
|
|
97
|
+
|---|---|---|
|
|
98
|
+
| 工具名配色(Bash/Read/Edit/Write) | `o3BgMG_title` / `CY-8Ka_title` | 标签不变色 |
|
|
99
|
+
| Think 配色 | `QWLzLg_*` | Think 不琥珀 |
|
|
100
|
+
| 提问/弹窗不透明 | `M8wy4a_card` | 弹窗透明重叠 |
|
|
101
|
+
| 输入框 | `uV2eYG_*` | 重影/背景不随主题 |
|
|
102
|
+
| 耗时统计 | `osXY9a_*` / `p-xYUq_*` | 统计字淡/重影 |
|
|
103
|
+
| 左栏「新会话」 | `newSession` | 白底回来 |
|
|
76
104
|
|
|
77
105
|
## 硬性安全边界(必须遵守)
|
|
78
106
|
- **不主动 push / 打 tag / 发 Release**;需要发布版本时停下用 ask_user_question 等确认。
|
|
@@ -86,4 +114,5 @@ cd "$DSH_HOME/profiles/web" && pnpm install
|
|
|
86
114
|
| 升级后设置页"未暴露命名空间" | 补丁2 被覆盖 | 重跑 apply-dsh-patches.sh |
|
|
87
115
|
| 升级后提问窗口自己消失 | 心跳补丁(补丁3)被覆盖 | 重跑 apply-dsh-patches.sh 或装插件补丁脚本 |
|
|
88
116
|
| 升级后插件不显示 | 插件安装副本未同步 | 步骤 5 `pnpm install` |
|
|
117
|
+
| 升级后 RA-Span 观感/配色不对(输入框重影、标签不变色、弹窗透明、统计字淡等) | DSH 混淆类名变了 | 见 RA-Span 校准节:强刷 + 逐项检查,让用户右键给出新类名,更新 `client/client.js` 对应选择器 |
|
|
89
118
|
| 按钮全没了/界面异常 | 浏览器缓存了旧前端 | 强刷 Ctrl/Cmd+Shift+R |
|