@megen-lebar/dsh-reasoning-effort 0.2.0 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +10 -0
- package/lib/client.js +598 -194
- package/lib/official-levels.json +191 -2
- package/package.json +5 -5
package/lib/client.js
CHANGED
|
@@ -24,6 +24,25 @@ window.__ModuleLoader__.load({
|
|
|
24
24
|
xhigh: "超高",
|
|
25
25
|
max: "最大",
|
|
26
26
|
};
|
|
27
|
+
var LEVEL_NOTES = {
|
|
28
|
+
off: "模型直接给出回答,不产生思考内容",
|
|
29
|
+
minimal: "一闪而过的短思考",
|
|
30
|
+
low: "轻量推理,快而省",
|
|
31
|
+
medium: "均衡的日常深度",
|
|
32
|
+
high: "深度推理,质量优先",
|
|
33
|
+
xhigh: "极深推理,慢而彻底",
|
|
34
|
+
max: "不设上限的最大预算",
|
|
35
|
+
};
|
|
36
|
+
var FORMAT_TITLES = {
|
|
37
|
+
openai: "OpenAI 系协议",
|
|
38
|
+
deepseek: "DeepSeek 官方",
|
|
39
|
+
openrouter: "聚合协议",
|
|
40
|
+
together: "Together 协议",
|
|
41
|
+
zai: "智谱 Z.ai 协议",
|
|
42
|
+
qwen: "通义 Qwen 协议",
|
|
43
|
+
"string-thinking": "<think> 标签",
|
|
44
|
+
"ant-ling": "Ling 系协议",
|
|
45
|
+
};
|
|
27
46
|
|
|
28
47
|
var icons = {
|
|
29
48
|
brain: '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M9.5 4.5A3.5 3.5 0 0 0 3 6.3a3.6 3.6 0 0 0-.8 5.9A3.6 3.6 0 0 0 5.7 18c1.5 0 2.8-.9 3.8-2.1V4.5Z"/><path d="M14.5 4.5A3.5 3.5 0 0 1 21 6.3a3.6 3.6 0 0 1 .8 5.9 3.6 3.6 0 0 1-3.5 5.8c-1.5 0-2.8-.9-3.8-2.1V4.5Z"/><path d="M5.8 9.2c1.4.1 2.4.9 2.8 2.2M18.2 9.2c-1.4.1-2.4.9-2.8 2.2"/></svg>',
|
|
@@ -31,6 +50,7 @@ window.__ModuleLoader__.load({
|
|
|
31
50
|
back: '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="m15 18-6-6 6-6"/></svg>',
|
|
32
51
|
refresh: '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M20 12a8 8 0 1 1-2.3-5.7L20 8"/><path d="M20 3v5h-5"/></svg>',
|
|
33
52
|
chevron: '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="m9 18 6-6-6-6"/></svg>',
|
|
53
|
+
caret: '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="m6 9 6 6 6-6"/></svg>',
|
|
34
54
|
check: '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="m5 12 4 4L19 6"/></svg>',
|
|
35
55
|
info: '<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M12 11v5M12 8h.01"/></svg>',
|
|
36
56
|
};
|
|
@@ -72,124 +92,239 @@ window.__ModuleLoader__.load({
|
|
|
72
92
|
|
|
73
93
|
function cssText() {
|
|
74
94
|
return [
|
|
75
|
-
|
|
76
|
-
'[data-dsh-reasoning-entry]
|
|
77
|
-
'[data-dsh-reasoning-entry]:
|
|
78
|
-
'[data-dsh-reasoning-entry]
|
|
79
|
-
'[data-dsh-reasoning-entry]
|
|
80
|
-
'[data-dsh-
|
|
81
|
-
'[data-dsh-
|
|
82
|
-
'[data-dsh-reasoning-
|
|
95
|
+
// ── 侧边栏入口:与 ssh / 任务看板同一套行样式 ──
|
|
96
|
+
'[data-dsh-reasoning-entry]{box-sizing:border-box;width:100%;min-height:36px;color:var(--dsw-alias-label-secondary);cursor:pointer;white-space:nowrap;background:0 0;border:none;border-radius:8px;align-items:center;gap:10px;padding:0 10px;font-size:13px;display:flex;font-family:inherit;transition:background-color .12s,color .12s}',
|
|
97
|
+
'[data-dsh-reasoning-entry]:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}',
|
|
98
|
+
'[data-dsh-reasoning-entry][data-active]{background:var(--dsw-alias-interactive-bg-active);color:var(--dsw-alias-label-primary);font-weight:600}',
|
|
99
|
+
'[data-dsh-reasoning-entry]:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}',
|
|
100
|
+
'[data-dsh-reasoning-entry-icon]{flex:none;justify-content:center;align-items:center;width:24px;height:24px;display:inline-flex}',
|
|
101
|
+
'[data-dsh-reasoning-entry-icon] svg{width:18px;height:18px;display:block;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}',
|
|
102
|
+
'[data-dsh-reasoning-entry-label]{text-overflow:ellipsis;overflow:hidden}',
|
|
103
|
+
'[data-dsh-frame][data-sidebar-collapsed] [data-dsh-reasoning-entry]{border-radius:50%;justify-content:center;width:36px;min-height:36px;margin:0 auto 12px;padding:0}',
|
|
104
|
+
'[data-dsh-frame][data-sidebar-collapsed] [data-dsh-reasoning-entry-label]{display:none}',
|
|
105
|
+
// ── 主视图:悬浮抽屉,贴侧栏弹出;水墨纸色 ──
|
|
106
|
+
'[data-dsh-reasoning-view]{--ink-paper:#f7f6f1;--ink-card:#fdfcf8;--ink-soft:#eeece4;--ink-text:#211f1b;--ink-mist:#8a867a;--ink-faint:#b9b5a7;--ink-line:rgba(33,31,27,.1);--ink-line-strong:rgba(33,31,27,.18);--ink-hover:rgba(33,31,27,.045);--ink-active:rgba(33,31,27,.075);--ink-cinnabar:#b5432f;--ink-cinnabar-soft:rgba(181,67,47,.09);--ink-pine:#41705a;--ink-focus:rgba(33,31,27,.16);--ink-mask:rgba(28,26,22,.36);--ink-serif:"Noto Serif SC","Source Han Serif SC","Songti SC","STSong","STZhongsong","SimSun",serif;z-index:10000;display:none;position:fixed;left:-100000px;top:0;width:420px;height:0;max-width:calc(100vw - 16px);box-sizing:border-box;flex-direction:column;background:var(--ink-paper);color:var(--ink-text);font-family:var(--dsw-font-family,inherit);border:1px solid var(--ink-line);border-radius:16px;box-shadow:0 18px 48px rgba(28,26,22,.16);overflow:hidden;overscroll-behavior:contain;isolation:isolate}',
|
|
83
107
|
'[data-dsh-reasoning-view][data-open]{display:flex}',
|
|
84
|
-
':root[data-theme=dark] [data-dsh-reasoning-view]{--
|
|
85
|
-
'@media(prefers-color-scheme:dark){:root:not([data-theme=light]) [data-dsh-reasoning-view]{--
|
|
86
|
-
|
|
87
|
-
'[data-dsh-reasoning-
|
|
88
|
-
'[data-dsh-reasoning-mark]
|
|
108
|
+
':root[data-theme=dark] [data-dsh-reasoning-view]{--ink-paper:#1b1a17;--ink-card:#242220;--ink-soft:#2d2b28;--ink-text:#ece9e0;--ink-mist:#9b968a;--ink-faint:#6f6b60;--ink-line:rgba(236,233,224,.09);--ink-line-strong:rgba(236,233,224,.18);--ink-hover:rgba(236,233,224,.05);--ink-active:rgba(236,233,224,.09);--ink-cinnabar:#d3705f;--ink-cinnabar-soft:rgba(211,112,95,.13);--ink-pine:#7fa98e;--ink-focus:rgba(236,233,224,.22);--ink-mask:rgba(0,0,0,.52);box-shadow:0 18px 48px rgba(0,0,0,.5)}',
|
|
109
|
+
'@media(prefers-color-scheme:dark){:root:not([data-theme=light]) [data-dsh-reasoning-view]{--ink-paper:#1b1a17;--ink-card:#242220;--ink-soft:#2d2b28;--ink-text:#ece9e0;--ink-mist:#9b968a;--ink-faint:#6f6b60;--ink-line:rgba(236,233,224,.09);--ink-line-strong:rgba(236,233,224,.18);--ink-hover:rgba(236,233,224,.05);--ink-active:rgba(236,233,224,.09);--ink-cinnabar:#d3705f;--ink-cinnabar-soft:rgba(211,112,95,.13);--ink-pine:#7fa98e;--ink-focus:rgba(236,233,224,.22);--ink-mask:rgba(0,0,0,.52);box-shadow:0 18px 48px rgba(0,0,0,.5)}}',
|
|
110
|
+
// ── 头部:印章式图标 + 宋体标题 ──
|
|
111
|
+
'[data-dsh-reasoning-header]{flex:none;display:flex;align-items:center;gap:12px;padding:16px 18px 12px}',
|
|
112
|
+
'[data-dsh-reasoning-mark]{flex:none;width:34px;height:34px;display:grid;place-items:center;border:1px solid var(--ink-line);border-radius:10px;background:var(--ink-card);color:var(--ink-text)}',
|
|
113
|
+
'[data-dsh-reasoning-mark] svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}',
|
|
89
114
|
'[data-dsh-reasoning-heading]{flex:1;min-width:0}',
|
|
90
|
-
'[data-dsh-reasoning-title]{font-size:
|
|
91
|
-
'[data-dsh-reasoning-subtitle]{font-size:11px;color:var(--
|
|
92
|
-
'[data-dsh-reasoning-icon-btn]{width:32px;height:32px;display:grid;place-items:center;flex:none;border:0;border-radius:
|
|
93
|
-
'[data-dsh-reasoning-icon-btn]:hover{background:var(--
|
|
94
|
-
'[data-dsh-reasoning-icon-btn]:disabled{opacity:.
|
|
95
|
-
'[data-dsh-reasoning-icon-btn] svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.
|
|
115
|
+
'[data-dsh-reasoning-title]{font-family:var(--ink-serif);font-size:17px;font-weight:700;line-height:23px;letter-spacing:.02em}',
|
|
116
|
+
'[data-dsh-reasoning-subtitle]{margin-top:1px;font-size:11px;line-height:16px;color:var(--ink-mist);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}',
|
|
117
|
+
'[data-dsh-reasoning-icon-btn]{width:32px;height:32px;display:grid;place-items:center;flex:none;border:0;border-radius:9px;background:transparent;color:var(--ink-mist);cursor:pointer;transition:background-color .12s,color .12s}',
|
|
118
|
+
'[data-dsh-reasoning-icon-btn]:hover{background:var(--ink-hover);color:var(--ink-text)}',
|
|
119
|
+
'[data-dsh-reasoning-icon-btn]:disabled{opacity:.4;cursor:default}',
|
|
120
|
+
'[data-dsh-reasoning-icon-btn] svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}',
|
|
96
121
|
'[data-dsh-reasoning-icon-btn][data-loading] svg{animation:dsh-reasoning-spin .8s linear infinite}',
|
|
122
|
+
'[data-dsh-reasoning-empty] [data-loading] svg{animation:dsh-reasoning-spin .8s linear infinite}',
|
|
123
|
+
'[data-dsh-reasoning-empty] svg{fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}',
|
|
97
124
|
'@keyframes dsh-reasoning-spin{to{transform:rotate(360deg)}}',
|
|
98
|
-
|
|
99
|
-
'[data-dsh-reasoning-
|
|
100
|
-
'[data-dsh-reasoning-
|
|
101
|
-
'[data-dsh-reasoning-
|
|
102
|
-
'[data-dsh-reasoning-
|
|
103
|
-
'[data-dsh-reasoning-
|
|
104
|
-
'[data-dsh-reasoning-
|
|
125
|
+
// ── 内容区:留白 + 分组卡片 + 发丝分隔线 ──
|
|
126
|
+
'[data-dsh-reasoning-scroll]{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--ink-faint) transparent}',
|
|
127
|
+
'[data-dsh-reasoning-scroll]::-webkit-scrollbar{width:8px}',
|
|
128
|
+
'[data-dsh-reasoning-scroll]::-webkit-scrollbar-thumb{background:var(--ink-line-strong);border-radius:999px}',
|
|
129
|
+
'[data-dsh-reasoning-scroll]::-webkit-scrollbar-track{background:transparent}',
|
|
130
|
+
'[data-dsh-reasoning-body]{display:flex;flex-direction:column;gap:12px;padding:4px 18px 22px}',
|
|
131
|
+
'[data-dsh-reasoning-card]{background:var(--ink-card);border:1px solid var(--ink-line);border-radius:14px;overflow:hidden}',
|
|
132
|
+
'[data-dsh-reasoning-divided]>*+*{border-top:1px solid var(--ink-line)}',
|
|
133
|
+
'[data-dsh-reasoning-toolbar]{display:flex;align-items:center;gap:8px;padding:10px 12px}',
|
|
134
|
+
'[data-dsh-reasoning-search],[data-dsh-reasoning-wire]{box-sizing:border-box;height:36px;border:1px solid var(--ink-line-strong);border-radius:10px;background:var(--ink-paper);color:var(--ink-text);font:inherit;font-size:12.5px;outline:none;transition:border-color .12s,box-shadow .12s}',
|
|
135
|
+
'[data-dsh-reasoning-search]{width:100%;padding:0 12px}',
|
|
136
|
+
'[data-dsh-reasoning-search-empty]{display:none;padding:20px 14px;text-align:center;font-size:11px;color:var(--ink-mist)}',
|
|
105
137
|
'[data-dsh-reasoning-search-empty][data-visible]{display:block}',
|
|
106
|
-
'[data-dsh-reasoning-wire]{width:
|
|
107
|
-
'[data-dsh-reasoning-wire]:disabled{opacity:.
|
|
108
|
-
'[data-dsh-reasoning-
|
|
109
|
-
'[data-dsh-reasoning-
|
|
110
|
-
'[data-dsh-reasoning-
|
|
111
|
-
'[data-dsh-reasoning-summary-copy]{margin-top:2px;font-size:11px;line-height:16px;color:var(--dsw-alias-label-tertiary)}',
|
|
112
|
-
'[data-dsh-reasoning-source]{flex:none;font-size:10px;color:var(--re-success);padding-top:2px}',
|
|
113
|
-
'[data-dsh-reasoning-conversation]{display:flex;align-items:center;gap:10px;padding:10px 11px;border:1px solid var(--dsw-alias-border-l1);border-radius:8px;background:var(--re-accent-soft)}',
|
|
114
|
-
'[data-dsh-reasoning-conversation][data-off]{border-color:var(--re-danger);background:rgba(193,60,68,.08)}',
|
|
138
|
+
'[data-dsh-reasoning-wire]{width:126px;padding:0 9px;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:11.5px;text-align:right}',
|
|
139
|
+
'[data-dsh-reasoning-wire]:disabled{opacity:.42;border-color:var(--ink-line);background:transparent}',
|
|
140
|
+
'[data-dsh-reasoning-search]:focus,[data-dsh-reasoning-wire]:focus{border-color:var(--ink-text);box-shadow:0 0 0 3px var(--ink-focus)}',
|
|
141
|
+
'[data-dsh-reasoning-conversation]{display:flex;align-items:center;gap:10px;padding:12px 14px;border:1px solid var(--ink-line);border-radius:14px;background:var(--ink-card)}',
|
|
142
|
+
'[data-dsh-reasoning-conversation][data-off]{border-color:var(--ink-cinnabar)}',
|
|
115
143
|
'[data-dsh-reasoning-conversation-copy]{flex:1;min-width:0}',
|
|
116
|
-
'[data-dsh-reasoning-conversation-title]{font-size:11px;font-weight:700}',
|
|
117
|
-
'[data-dsh-reasoning-conversation-identity]{margin-top:2px;font-size:
|
|
118
|
-
'[data-dsh-reasoning-conversation-state]{flex:none;font-size:
|
|
119
|
-
'[data-dsh-reasoning-conversation][data-off] [data-dsh-reasoning-conversation-state]{color:var(--
|
|
120
|
-
'[data-dsh-reasoning-
|
|
121
|
-
'[data-dsh-reasoning-
|
|
122
|
-
'[data-dsh-reasoning-
|
|
123
|
-
'[data-dsh-reasoning-
|
|
144
|
+
'[data-dsh-reasoning-conversation-title]{font-size:11px;font-weight:700;letter-spacing:.04em;color:var(--ink-mist)}',
|
|
145
|
+
'[data-dsh-reasoning-conversation-identity]{margin-top:2px;font-size:12px;line-height:17px;color:var(--ink-text);overflow-wrap:anywhere}',
|
|
146
|
+
'[data-dsh-reasoning-conversation-state]{flex:none;font-size:10.5px;padding:3px 9px;border-radius:999px;background:var(--ink-soft);color:var(--ink-mist);white-space:nowrap}',
|
|
147
|
+
'[data-dsh-reasoning-conversation][data-off] [data-dsh-reasoning-conversation-state]{background:var(--ink-cinnabar-soft);color:var(--ink-cinnabar)}',
|
|
148
|
+
'[data-dsh-reasoning-summary]{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;padding:2px 2px 0}',
|
|
149
|
+
'[data-dsh-reasoning-summary-title]{font-size:13px;font-weight:700}',
|
|
150
|
+
'[data-dsh-reasoning-summary-copy]{margin-top:2px;font-size:11px;line-height:16px;color:var(--ink-mist)}',
|
|
151
|
+
'[data-dsh-reasoning-source]{flex:none;font-size:10.5px;color:var(--ink-pine);padding-bottom:1px}',
|
|
152
|
+
'[data-dsh-reasoning-model-list]{display:flex;flex-direction:column}',
|
|
153
|
+
'[data-dsh-reasoning-model]{display:flex;width:100%;align-items:center;gap:10px;padding:12px 14px;text-align:left;border:0;background:transparent;color:inherit;font:inherit;cursor:pointer;transition:background-color .12s}',
|
|
154
|
+
'[data-dsh-reasoning-model]:hover{background:var(--ink-hover)}',
|
|
155
|
+
'[data-dsh-reasoning-model][data-current]{background:var(--ink-active)}',
|
|
156
|
+
'[data-dsh-reasoning-model][hidden]{display:none!important}',
|
|
157
|
+
'[data-dsh-reasoning-model]>div:first-child{flex:1;min-width:0}',
|
|
124
158
|
'[data-dsh-reasoning-model-name]{font-size:13px;font-weight:650;overflow-wrap:anywhere}',
|
|
125
|
-
'[data-dsh-reasoning-model-id]{margin-top:2px;font-size:
|
|
126
|
-
'[data-dsh-reasoning-model-meta]{display:flex;flex-wrap:wrap;gap:8px;margin-top:
|
|
127
|
-
'[data-dsh-reasoning-model-meta] [data-configured]{color:var(--
|
|
128
|
-
'[data-dsh-reasoning-model-meta] [data-off]{color:var(--
|
|
129
|
-
'[data-dsh-reasoning-model-meta] [data-current]{color:var(--
|
|
130
|
-
'[data-dsh-reasoning-model] [data-chevron]
|
|
131
|
-
'[data-dsh-reasoning-
|
|
132
|
-
'[data-dsh-reasoning-
|
|
133
|
-
'[data-dsh-reasoning-
|
|
159
|
+
'[data-dsh-reasoning-model-id]{margin-top:2px;font-size:10.5px;color:var(--ink-mist);overflow-wrap:anywhere}',
|
|
160
|
+
'[data-dsh-reasoning-model-meta]{display:flex;flex-wrap:wrap;gap:8px;margin-top:6px;font-size:10.5px;color:var(--ink-mist)}',
|
|
161
|
+
'[data-dsh-reasoning-model-meta] [data-configured]{color:var(--ink-pine)}',
|
|
162
|
+
'[data-dsh-reasoning-model-meta] [data-off]{color:var(--ink-cinnabar)}',
|
|
163
|
+
'[data-dsh-reasoning-model-meta] [data-current]{color:var(--ink-text);font-weight:700}',
|
|
164
|
+
'[data-dsh-reasoning-model] [data-chevron]{flex:none;display:inline-flex;color:var(--ink-faint)}',
|
|
165
|
+
'[data-dsh-reasoning-model] [data-chevron] svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}',
|
|
166
|
+
'[data-dsh-reasoning-model]:hover [data-chevron]{color:var(--ink-mist)}',
|
|
167
|
+
'[data-dsh-reasoning-empty]{display:flex;flex-direction:column;align-items:center;gap:8px;padding:48px 16px;text-align:center;color:var(--ink-mist);font-size:12px}',
|
|
168
|
+
'[data-dsh-reasoning-empty] svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}',
|
|
169
|
+
'[data-dsh-reasoning-editor-head]{display:flex;align-items:center;gap:10px;padding-bottom:2px}',
|
|
134
170
|
'[data-dsh-reasoning-editor-copy]{flex:1;min-width:0}',
|
|
135
|
-
'[data-dsh-reasoning-editor-name]{font-size:
|
|
136
|
-
'[data-dsh-reasoning-editor-id]{margin-top:2px;font-size:
|
|
137
|
-
'[data-dsh-reasoning-section]{display:flex;flex-direction:column;gap:8px
|
|
138
|
-
'[data-dsh-reasoning-section]+[data-dsh-reasoning-section]{
|
|
139
|
-
'[data-dsh-reasoning-section-head]{display:flex;align-items:
|
|
140
|
-
'[data-dsh-reasoning-section-title]{font-size:12px;font-weight:700}',
|
|
141
|
-
'[data-dsh-reasoning-section-note]{font-size:
|
|
142
|
-
|
|
143
|
-
'[data-dsh-reasoning-
|
|
144
|
-
'[data-dsh-reasoning-
|
|
145
|
-
'[data-dsh-reasoning-
|
|
146
|
-
'[data-dsh-reasoning-
|
|
147
|
-
'[data-dsh-reasoning-
|
|
148
|
-
'[data-dsh-reasoning-
|
|
149
|
-
'[data-dsh-reasoning-
|
|
150
|
-
'[data-dsh-reasoning-off]
|
|
151
|
-
'[data-dsh-reasoning-
|
|
152
|
-
'[data-dsh-reasoning-
|
|
153
|
-
'[data-dsh-reasoning-off]
|
|
154
|
-
'[data-dsh-reasoning-off]
|
|
155
|
-
'[data-dsh-reasoning-off]
|
|
156
|
-
'[data-dsh-reasoning-off]
|
|
157
|
-
'[data-dsh-reasoning-off]
|
|
158
|
-
'[data-dsh-reasoning-off]>label{min-width:0;cursor:pointer}',
|
|
159
|
-
'[data-dsh-reasoning-off-state]{flex:none;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:10px;font-weight:700;padding:2px 7px;border-radius:5px;color:var(--dsw-alias-label-tertiary);background:var(--dsw-alias-bg-layer-2)}',
|
|
160
|
-
'[data-dsh-reasoning-off][data-active] [data-dsh-reasoning-off-state]{color:#fff;background:var(--re-danger)}',
|
|
161
|
-
'[data-dsh-reasoning-off-callout]{padding:10px 11px;border:1px solid rgba(193,60,68,.32);border-radius:7px;background:rgba(193,60,68,.06)}',
|
|
162
|
-
'[data-dsh-reasoning-off-callout-title]{font-size:12px;font-weight:700;color:var(--re-danger)}',
|
|
163
|
-
'[data-dsh-reasoning-off-callout-copy],[data-dsh-reasoning-scope-note]{margin-top:3px;font-size:10px;line-height:16px;color:var(--dsw-alias-label-secondary);overflow-wrap:anywhere}',
|
|
171
|
+
'[data-dsh-reasoning-editor-name]{font-family:var(--ink-serif);font-size:16px;font-weight:700;overflow-wrap:anywhere}',
|
|
172
|
+
'[data-dsh-reasoning-editor-id]{margin-top:2px;font-size:10.5px;color:var(--ink-mist);overflow-wrap:anywhere}',
|
|
173
|
+
'[data-dsh-reasoning-section]{display:flex;flex-direction:column;gap:8px}',
|
|
174
|
+
'[data-dsh-reasoning-section]+[data-dsh-reasoning-section]{margin-top:4px}',
|
|
175
|
+
'[data-dsh-reasoning-section-head]{display:flex;align-items:baseline;justify-content:space-between;gap:10px;padding:0 2px}',
|
|
176
|
+
'[data-dsh-reasoning-section-title]{font-size:12px;font-weight:700;letter-spacing:.02em}',
|
|
177
|
+
'[data-dsh-reasoning-section-note]{font-size:10.5px;color:var(--ink-mist)}',
|
|
178
|
+
// ── 关闭推理:药丸开关(墨色) ──
|
|
179
|
+
'[data-dsh-reasoning-off]{display:flex;align-items:center;gap:12px;padding:13px 14px}',
|
|
180
|
+
'[data-dsh-reasoning-off][data-active]{background:var(--ink-cinnabar-soft)}',
|
|
181
|
+
'[data-dsh-reasoning-off]>label{flex:1;min-width:0;cursor:pointer}',
|
|
182
|
+
'[data-dsh-reasoning-off] input[type=checkbox]{appearance:none;-webkit-appearance:none;position:relative;flex:none;width:40px;height:22px;margin:0;border:none;border-radius:999px;background:var(--ink-line-strong);cursor:pointer;transition:background .16s ease;outline:none}',
|
|
183
|
+
'[data-dsh-reasoning-off] input[type=checkbox]:after{content:"";position:absolute;top:3px;left:3px;width:16px;height:16px;border-radius:50%;background:var(--ink-paper);box-shadow:0 1px 3px rgba(0,0,0,.25);transition:transform .16s ease}',
|
|
184
|
+
'[data-dsh-reasoning-off] input[type=checkbox]:checked{background:var(--ink-text)}',
|
|
185
|
+
'[data-dsh-reasoning-off] input[type=checkbox]:checked:after{transform:translateX(18px)}',
|
|
186
|
+
'[data-dsh-reasoning-off] input[type=checkbox]:focus-visible{box-shadow:0 0 0 3px var(--ink-focus)}',
|
|
187
|
+
'[data-dsh-reasoning-level-name]{font-size:12.5px;font-weight:650}',
|
|
188
|
+
'[data-dsh-reasoning-level-detail]{margin-top:1px;font-size:10px;line-height:15px;color:var(--ink-mist)}',
|
|
189
|
+
'[data-dsh-reasoning-off-state]{flex:none;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:10px;font-weight:700;padding:2px 8px;border-radius:999px;background:var(--ink-soft);color:var(--ink-mist)}',
|
|
190
|
+
'[data-dsh-reasoning-off][data-active] [data-dsh-reasoning-off-state]{background:var(--ink-cinnabar);color:#fff}',
|
|
191
|
+
'[data-dsh-reasoning-off-callout]{padding:12px 14px;background:var(--ink-cinnabar-soft)}',
|
|
192
|
+
'[data-dsh-reasoning-off-callout-title]{font-size:12px;font-weight:700;color:var(--ink-cinnabar)}',
|
|
193
|
+
'[data-dsh-reasoning-off-callout-copy],[data-dsh-reasoning-scope-note]{margin-top:3px;font-size:10.5px;line-height:16px;color:var(--ink-mist);overflow-wrap:anywhere}',
|
|
164
194
|
'[data-dsh-reasoning-scope-note]{padding:0 2px}',
|
|
165
|
-
'[data-dsh-reasoning-
|
|
166
|
-
'[data-dsh-reasoning-
|
|
167
|
-
'[data-dsh-reasoning-
|
|
168
|
-
'[data-dsh-reasoning-
|
|
169
|
-
'[data-dsh-reasoning-
|
|
170
|
-
'[data-dsh-reasoning-
|
|
171
|
-
'[data-dsh-reasoning-
|
|
172
|
-
'[data-dsh-reasoning-
|
|
173
|
-
'
|
|
174
|
-
'
|
|
175
|
-
'[data-dsh-reasoning-
|
|
176
|
-
'[data-dsh-reasoning-
|
|
177
|
-
'[data-dsh-reasoning-
|
|
178
|
-
'[data-dsh-reasoning-
|
|
179
|
-
'[data-dsh-reasoning-
|
|
195
|
+
'[data-dsh-reasoning-level]{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px;padding:10px 14px;min-height:52px;transition:background-color .12s}',
|
|
196
|
+
'[data-dsh-reasoning-level]:hover{background:var(--ink-hover)}',
|
|
197
|
+
'[data-dsh-reasoning-level] input[type=checkbox]{width:15px;height:15px;margin:0;accent-color:var(--ink-text);cursor:pointer}',
|
|
198
|
+
'[data-dsh-reasoning-level]>label{min-width:0;cursor:pointer}',
|
|
199
|
+
'[data-dsh-reasoning-quick]{display:flex;flex-wrap:wrap;gap:8px;padding:0 2px}',
|
|
200
|
+
'[data-dsh-reasoning-form-row]{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 14px;min-height:56px}',
|
|
201
|
+
'[data-dsh-reasoning-label]{font-size:12.5px;color:var(--ink-text)}',
|
|
202
|
+
'[data-dsh-reasoning-form-row] [data-dsh-reasoning-dd]{width:216px;flex:none}',
|
|
203
|
+
'[data-dsh-reasoning-form-row] [data-dsh-reasoning-dd-pop]{left:auto;right:0;min-width:292px;max-width:100%}',
|
|
204
|
+
'[data-dsh-reasoning-btn]{min-height:34px;box-sizing:border-box;border-radius:10px;padding:0 14px;border:1px solid var(--ink-line-strong);background:transparent;color:var(--ink-text);font:inherit;font-size:12.5px;cursor:pointer;transition:background-color .12s,border-color .12s,transform .12s,opacity .12s}',
|
|
205
|
+
'[data-dsh-reasoning-btn]:hover:not(:disabled){background:var(--ink-hover)}',
|
|
206
|
+
'[data-dsh-reasoning-btn]:active:not(:disabled){transform:translateY(1px)}',
|
|
207
|
+
'[data-dsh-reasoning-btn]:disabled{opacity:.4;cursor:default;transform:none}',
|
|
208
|
+
'[data-dsh-reasoning-btn=primary]{min-width:88px;border-color:var(--ink-text);background:var(--ink-text);color:var(--ink-paper);font-weight:650}',
|
|
209
|
+
'[data-dsh-reasoning-btn=primary]:hover:not(:disabled){opacity:.9;background:var(--ink-text)}',
|
|
210
|
+
'[data-dsh-reasoning-btn=primary][data-danger]{border-color:var(--ink-cinnabar);background:var(--ink-cinnabar);color:#fff}',
|
|
211
|
+
'[data-dsh-reasoning-btn=primary][data-danger]:hover:not(:disabled){opacity:.92;background:var(--ink-cinnabar)}',
|
|
212
|
+
'[data-dsh-reasoning-actions]{flex:none;display:flex;align-items:center;gap:8px;padding:12px 18px calc(12px + env(safe-area-inset-bottom,0px));border-top:1px solid var(--ink-line);background:var(--ink-paper)}',
|
|
213
|
+
'[data-dsh-reasoning-save-state]{flex:1;min-width:0;font-size:10.5px;color:var(--ink-mist);overflow-wrap:anywhere}',
|
|
180
214
|
'[data-dsh-reasoning-confirm]{display:flex;align-items:center;gap:8px;width:100%}',
|
|
181
|
-
'[data-dsh-reasoning-confirm-copy]{flex:1;min-width:0;font-size:
|
|
182
|
-
'
|
|
183
|
-
|
|
215
|
+
'[data-dsh-reasoning-confirm-copy]{flex:1;min-width:0;font-size:11px;color:var(--ink-cinnabar)}',
|
|
216
|
+
'[data-dsh-reasoning-notice]{flex:none;display:flex;align-items:flex-start;gap:8px;margin:0 18px;padding:10px 12px;border:1px solid var(--ink-line);border-left:3px solid var(--ink-faint);border-radius:12px;background:var(--ink-card);font-size:11.5px;line-height:17px;color:var(--ink-mist)}',
|
|
217
|
+
'[data-dsh-reasoning-notice] svg{width:14px;height:14px;flex:none;margin-top:1px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}',
|
|
218
|
+
'[data-dsh-reasoning-notice=success]{border-left-color:var(--ink-pine);color:var(--ink-pine)}',
|
|
219
|
+
'[data-dsh-reasoning-notice=error]{border-left-color:var(--ink-cinnabar);color:var(--ink-cinnabar)}',
|
|
220
|
+
'[data-dsh-reasoning-view] button:focus-visible{outline:2px solid var(--ink-text);outline-offset:2px}',
|
|
221
|
+
'@media(max-width:768px){[data-dsh-reasoning-entry],[data-dsh-reasoning-btn]{min-height:44px}[data-dsh-reasoning-dd-btn],[data-dsh-reasoning-search],[data-dsh-reasoning-wire]{height:44px;font-size:16px}[data-dsh-reasoning-model]{min-height:52px}[data-dsh-reasoning-body]{padding:4px 14px 18px}[data-dsh-reasoning-header]{padding:14px 14px 10px}[data-dsh-reasoning-notice]{margin:0 14px}[data-dsh-reasoning-form-row]{flex-wrap:wrap}[data-dsh-reasoning-form-row] [data-dsh-reasoning-dd]{flex:1 1 170px;width:auto}[data-dsh-reasoning-wire]{width:112px}[data-dsh-reasoning-actions]{padding:10px 14px calc(10px + env(safe-area-inset-bottom,0px))}}',
|
|
222
|
+
'@media(prefers-reduced-motion:reduce){[data-dsh-reasoning-entry],[data-dsh-reasoning-view],[data-dsh-reasoning-view] *,[data-dsh-reasoning-icon-btn] svg{transition:none!important;animation:none!important}}',
|
|
223
|
+
// ── 液态玻璃皮肤:白色玻璃主体 + 青花瓷釉色点缀 + 活水(焦散漂光/折射带呼吸) ──
|
|
224
|
+
// body 前缀 + !important,覆盖上方水墨纸色规则(注入顺序也在其后)
|
|
225
|
+
// 焦散漂光:@property 注册百分比变量使 keyframes 可插值;老内核无 @property 时退化为静态 14%/6%
|
|
226
|
+
'@property --dsh-reasoning-ink-x{syntax:"<percentage>";inherits:false;initial-value:14%}',
|
|
227
|
+
'@property --dsh-reasoning-ink-y{syntax:"<percentage>";inherits:false;initial-value:6%}',
|
|
228
|
+
'@keyframes dsh-reasoning-ink-caustic{0%{--dsh-reasoning-ink-x:14%;--dsh-reasoning-ink-y:6%}45%{--dsh-reasoning-ink-x:74%;--dsh-reasoning-ink-y:36%}100%{--dsh-reasoning-ink-x:24%;--dsh-reasoning-ink-y:80%}}',
|
|
229
|
+
'@keyframes dsh-reasoning-ink-flow{from{background-position:8% 6%}to{background-position:-4% -2%}}',
|
|
230
|
+
'body [data-dsh-reasoning-view]{--ink-paper:rgba(255,255,255,.5);--ink-card:rgba(255,255,255,.58);--ink-soft:rgba(255,255,255,.42);--ink-line:rgba(255,255,255,.5);--ink-line-strong:rgba(255,255,255,.65);--ink-hover:rgba(255,255,255,.38);--ink-active:rgba(255,255,255,.5);background-color:rgba(255,255,255,.52)!important;background-image:radial-gradient(42% 30% at var(--dsh-reasoning-ink-x,14%) var(--dsh-reasoning-ink-y,6%),rgba(150,190,225,.2),rgba(86,140,190,.08) 48%,rgba(86,140,190,0) 74%),radial-gradient(120% 90% at 50% -30%,rgba(43,88,158,.17),rgba(43,88,158,0) 55%),radial-gradient(34% 26% at 4% 2%,rgba(48,78,128,.06),rgba(48,78,128,0) 70%),radial-gradient(90% 44% at 50% 118%,rgba(43,88,158,.1),rgba(43,88,158,0) 72%),radial-gradient(140% 110% at 90% 120%,rgba(228,214,188,.16),rgba(228,214,188,0) 55%),radial-gradient(100% 85% at 4% 78%,rgba(181,67,47,.05),rgba(181,67,47,0) 55%),radial-gradient(95% 80% at 99% 40%,rgba(86,140,190,.14),rgba(86,140,190,0) 58%),linear-gradient(115deg,rgba(255,255,255,0) 30%,rgba(60,98,158,.045) 45%,rgba(60,98,158,.02) 52%,rgba(255,255,255,0) 62%),linear-gradient(160deg,rgba(255,255,255,.72) 0%,rgba(255,255,255,.42) 48%,rgba(255,255,255,.26) 100%);animation:dsh-reasoning-ink-caustic 26s ease-in-out infinite alternate;-webkit-backdrop-filter:blur(30px) saturate(200%) brightness(1.04);backdrop-filter:blur(30px) saturate(200%) brightness(1.04);border:1px solid rgba(255,255,255,.8)!important;box-shadow:inset 0 1px 0 rgba(255,255,255,1),inset 0 6px 12px -6px rgba(160,200,235,.28),inset 0 3px 8px rgba(255,255,255,.5),inset 1px 0 0 rgba(255,255,255,.5),inset -1px 0 0 rgba(255,255,255,.5),inset 0 -1px 0 rgba(255,255,255,.4),inset 0 -10px 18px -8px rgba(255,255,255,.55),inset 0 0 24px rgba(255,255,255,.55),inset 0 0 64px rgba(110,140,184,.18),inset 0 0 120px rgba(226,212,186,.1),0 26px 70px rgba(56,52,44,.22),0 0 44px rgba(86,140,190,.12),0 4px 12px rgba(255,255,255,.55)!important}',
|
|
231
|
+
':root[data-theme=dark] body [data-dsh-reasoning-view]{--ink-paper:rgba(40,40,44,.4);--ink-card:rgba(50,52,58,.42);--ink-soft:rgba(70,72,82,.34);--ink-line:rgba(255,255,255,.1);--ink-line-strong:rgba(255,255,255,.18);--ink-hover:rgba(255,255,255,.06);--ink-active:rgba(255,255,255,.1);--ink-text:#ece9e0;--ink-mist:#b6b2a6;--ink-faint:#8a857a;--ink-cinnabar:#d3705f;--ink-cinnabar-soft:rgba(211,112,95,.14);--ink-pine:#7fa98e;background-color:rgba(38,35,31,.5)!important;background-image:radial-gradient(42% 30% at var(--dsh-reasoning-ink-x,14%) var(--dsh-reasoning-ink-y,6%),rgba(140,165,200,.15),rgba(104,118,142,.06) 48%,rgba(104,118,142,0) 74%),radial-gradient(120% 90% at 50% -20%,rgba(104,118,142,.26),rgba(104,118,142,0) 55%),radial-gradient(90% 44% at 50% 118%,rgba(8,12,22,.4),rgba(8,12,22,0) 72%),radial-gradient(130% 100% at 90% 115%,rgba(150,110,90,.12),rgba(150,110,90,0) 58%),linear-gradient(160deg,rgba(255,250,240,.07),rgba(255,250,240,0));animation:dsh-reasoning-ink-caustic 26s ease-in-out infinite alternate;border:1px solid rgba(255,250,240,.18)!important;box-shadow:inset 0 1px 0 rgba(255,250,240,.2),inset 0 6px 14px -8px rgba(140,165,205,.22),inset 0 0 28px rgba(255,250,240,.05),0 24px 64px rgba(0,0,0,.5),0 0 40px rgba(104,118,142,.16)!important;-webkit-backdrop-filter:blur(40px) saturate(190%) brightness(.85);backdrop-filter:blur(40px) saturate(190%) brightness(.85)}',
|
|
232
|
+
'@media(prefers-color-scheme:dark){:root:not([data-theme=light]) body [data-dsh-reasoning-view]{--ink-paper:rgba(40,40,44,.4);--ink-card:rgba(50,52,58,.42);--ink-soft:rgba(70,72,82,.34);--ink-line:rgba(255,255,255,.1);--ink-line-strong:rgba(255,255,255,.18);--ink-hover:rgba(255,255,255,.06);--ink-active:rgba(255,255,255,.1);--ink-text:#ece9e0;--ink-mist:#b6b2a6;--ink-faint:#8a857a;--ink-cinnabar:#d3705f;--ink-cinnabar-soft:rgba(211,112,95,.14);--ink-pine:#7fa98e;background-color:rgba(38,35,31,.5)!important;background-image:radial-gradient(42% 30% at var(--dsh-reasoning-ink-x,14%) var(--dsh-reasoning-ink-y,6%),rgba(140,165,200,.15),rgba(104,118,142,.06) 48%,rgba(104,118,142,0) 74%),radial-gradient(120% 90% at 50% -20%,rgba(104,118,142,.26),rgba(104,118,142,0) 55%),radial-gradient(90% 44% at 50% 118%,rgba(8,12,22,.4),rgba(8,12,22,0) 72%),radial-gradient(130% 100% at 90% 115%,rgba(150,110,90,.12),rgba(150,110,90,0) 58%),linear-gradient(160deg,rgba(255,250,240,.07),rgba(255,250,240,0));animation:dsh-reasoning-ink-caustic 26s ease-in-out infinite alternate;border:1px solid rgba(255,250,240,.18)!important;box-shadow:inset 0 1px 0 rgba(255,250,240,.2),inset 0 6px 14px -8px rgba(140,165,205,.22),inset 0 0 28px rgba(255,250,240,.05),0 24px 64px rgba(0,0,0,.5),0 0 40px rgba(104,118,142,.16)!important;-webkit-backdrop-filter:blur(40px) saturate(190%) brightness(.85);backdrop-filter:blur(40px) saturate(190%) brightness(.85)}}',
|
|
233
|
+
'body [data-dsh-reasoning-view]::before{content:"";position:absolute;inset:0;z-index:1;pointer-events:none;border-radius:inherit;background:radial-gradient(70% 42% at 18% 0%,rgba(255,255,255,.3),rgba(255,255,255,0) 70%),linear-gradient(115deg,rgba(255,255,255,0) 26%,rgba(255,255,255,.42) 44%,rgba(255,255,255,.05) 52%,rgba(255,255,255,0) 64%),linear-gradient(128deg,rgba(255,255,255,0) 36%,rgba(255,255,255,.16) 47%,rgba(255,255,255,0) 58%),linear-gradient(to bottom,rgba(216,232,248,.5),rgba(255,255,255,.06) 42%,rgba(255,255,255,0) 62%);background-size:116% 116%;animation:dsh-reasoning-ink-flow 18s ease-in-out infinite alternate;mix-blend-mode:screen;filter:blur(.3px)}',
|
|
234
|
+
'body [data-dsh-reasoning-view]::after{content:"";position:absolute;inset:0;z-index:1;pointer-events:none;border-radius:inherit;background-image:url("data:image/svg+xml;utf8,<svg xmlns=%27http://www.w3.org/2000/svg%27 width=%27260%27 height=%27260%27><filter id=%27p%27><feTurbulence type=%27fractalNoise%27 baseFrequency=%270.8%27 numOctaves=%273%27 stitchTiles=%27stitch%27/><feColorMatrix type=%27saturate%27 values=%270%27/></filter><rect width=%27260%27 height=%27260%27 filter=%27url(%23p)%27/></svg>");background-size:260px 260px;opacity:.045;mix-blend-mode:multiply}',
|
|
235
|
+
'body [data-dsh-reasoning-view]>*{position:relative;z-index:2}',
|
|
236
|
+
'body [data-dsh-reasoning-view] [data-dsh-reasoning-card]{border-color:rgba(255,255,255,.6)!important;box-shadow:inset 0 1px 0 rgba(255,255,255,1),inset 0 -1px 0 rgba(48,78,128,.1),inset 0 -6px 10px -7px rgba(255,255,255,.5),inset 0 0 18px rgba(255,255,255,.4)!important}',
|
|
237
|
+
'body [data-dsh-reasoning-view] [data-dsh-reasoning-search],body [data-dsh-reasoning-view] [data-dsh-reasoning-wire]{background:rgba(255,255,255,.55)!important;border-color:rgba(255,255,255,.75)!important;box-shadow:inset 0 1px 0 rgba(255,255,255,1),inset 0 -1px 0 rgba(48,78,128,.12),inset 0 -5px 8px -6px rgba(255,255,255,.55),inset 0 0 12px rgba(255,255,255,.4)!important}',
|
|
238
|
+
'body [data-dsh-reasoning-view] [data-dsh-reasoning-search]:focus,body [data-dsh-reasoning-view] [data-dsh-reasoning-wire]:focus,body [data-dsh-reasoning-view] [data-dsh-reasoning-search]:focus-visible,body [data-dsh-reasoning-view] [data-dsh-reasoning-wire]:focus-visible{outline:none!important;border-color:rgba(255,255,255,.95)!important;box-shadow:0 0 0 3px rgba(43,88,158,.3),0 0 0 6px rgba(43,88,158,.1),inset 0 1px 0 rgba(255,255,255,.95),inset 0 -1px 0 rgba(48,78,128,.08)!important}',
|
|
239
|
+
'body [data-dsh-reasoning-view] button:focus-visible{outline:none!important;box-shadow:0 0 0 3px rgba(43,88,158,.26),inset 0 1px 0 rgba(255,255,255,.7)!important}',
|
|
240
|
+
'body [data-dsh-reasoning-view] [data-dsh-reasoning-conversation]{transition:background-color .12s,box-shadow .12s,transform .12s}',
|
|
241
|
+
'body [data-dsh-reasoning-view] [data-dsh-reasoning-conversation]:hover{background:rgba(255,255,255,.55)!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.9),inset 0 0 18px rgba(255,255,255,.45)!important}',
|
|
242
|
+
'body [data-dsh-reasoning-view] [data-dsh-reasoning-conversation-state]{background:rgba(233,240,250,.55)!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.85),inset 0 0 8px rgba(150,180,220,.22)!important}',
|
|
243
|
+
'body [data-dsh-reasoning-view] [data-dsh-reasoning-mark],body [data-dsh-reasoning-view] [data-dsh-reasoning-icon-btn]{background:rgba(255,255,255,.45)!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.8),inset 0 0 8px rgba(255,255,255,.2)!important}',
|
|
244
|
+
'body [data-dsh-reasoning-view] [data-dsh-reasoning-actions]{background:rgba(255,255,255,.3)!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.75)!important}',
|
|
245
|
+
'body [data-dsh-reasoning-view] [data-dsh-reasoning-title]::before{content:"";display:inline-block;width:8px;height:8px;margin-right:8px;border-radius:2px;background:linear-gradient(135deg,#c2543f,#a03726);box-shadow:0 1px 4px rgba(181,67,47,.45),inset 0 1px 0 rgba(255,255,255,.35);vertical-align:1px}',
|
|
246
|
+
':root[data-theme=dark] body [data-dsh-reasoning-view] [data-dsh-reasoning-card],:root[data-theme=dark] body [data-dsh-reasoning-view] [data-dsh-reasoning-search],:root[data-theme=dark] body [data-dsh-reasoning-view] [data-dsh-reasoning-wire],:root[data-theme=dark] body [data-dsh-reasoning-view] [data-dsh-reasoning-conversation-state],:root[data-theme=dark] body [data-dsh-reasoning-view] [data-dsh-reasoning-mark],:root[data-theme=dark] body [data-dsh-reasoning-view] [data-dsh-reasoning-icon-btn]{background:rgba(255,250,240,.07)!important;border-color:rgba(255,250,240,.15)!important;box-shadow:inset 0 1px 0 rgba(255,250,240,.15),inset 0 -1px 0 rgba(0,0,0,.4),inset 0 0 12px rgba(150,180,220,.05)!important}',
|
|
247
|
+
':root[data-theme=dark] body [data-dsh-reasoning-view] [data-dsh-reasoning-actions]{background:rgba(255,250,240,.06)!important;box-shadow:inset 0 1px 0 rgba(255,250,240,.15)!important}',
|
|
248
|
+
':root[data-theme=dark] body [data-dsh-reasoning-view] [data-dsh-reasoning-conversation]:hover{background:rgba(255,250,240,.1)!important;box-shadow:inset 0 1px 0 rgba(255,250,240,.18),inset 0 0 16px rgba(255,250,240,.08)!important}',
|
|
249
|
+
'@media(prefers-color-scheme:dark){:root:not([data-theme=light]) body [data-dsh-reasoning-view] [data-dsh-reasoning-card],:root:not([data-theme=light]) body [data-dsh-reasoning-view] [data-dsh-reasoning-search],:root:not([data-theme=light]) body [data-dsh-reasoning-view] [data-dsh-reasoning-wire],:root:not([data-theme=light]) body [data-dsh-reasoning-view] [data-dsh-reasoning-conversation-state],:root:not([data-theme=light]) body [data-dsh-reasoning-view] [data-dsh-reasoning-mark],:root:not([data-theme=light]) body [data-dsh-reasoning-view] [data-dsh-reasoning-icon-btn]{background:rgba(255,250,240,.07)!important;border-color:rgba(255,250,240,.15)!important;box-shadow:inset 0 1px 0 rgba(255,250,240,.15),inset 0 -1px 0 rgba(0,0,0,.4),inset 0 0 12px rgba(150,180,220,.05)!important};:root:not([data-theme=light]) body [data-dsh-reasoning-view] [data-dsh-reasoning-actions]{background:rgba(255,250,240,.06)!important;box-shadow:inset 0 1px 0 rgba(255,250,240,.15)!important};:root:not([data-theme=light]) body [data-dsh-reasoning-view] [data-dsh-reasoning-conversation]:hover{background:rgba(255,250,240,.1)!important;box-shadow:inset 0 1px 0 rgba(255,250,240,.18),inset 0 0 16px rgba(255,250,240,.08)!important}}',
|
|
250
|
+
// 减少动态偏好:view 本体的焦散动画由上方内置 reduced-motion 规则停用,这里补 ::before 折射带
|
|
251
|
+
'@media(prefers-reduced-motion:reduce){body [data-dsh-reasoning-view]::before{animation:none!important}}',
|
|
252
|
+
// ── 瓷上青花 · 晕染艺术:钴青入釉层层晕散 × 底部釉白堆脂 × 玻璃内环(仿 iPhone 双圈口沿) ──
|
|
253
|
+
// 无线描纹样;v2 晕染加重:深钴青右上入釉、天青横染、淡青大面晕散、底部钴青汇聚;焦散漂光继续游走;全部静态层
|
|
254
|
+
'body [data-dsh-reasoning-view]{background-image:radial-gradient(58% 44% at 78% 6%,rgba(38,80,158,.26),rgba(38,80,158,.12) 42%,rgba(38,80,158,0) 72%),radial-gradient(42% 30% at var(--dsh-reasoning-ink-x,14%) var(--dsh-reasoning-ink-y,6%),rgba(150,190,225,.22),rgba(86,140,190,.1) 48%,rgba(86,140,190,0) 74%),radial-gradient(120% 90% at 50% -30%,rgba(43,88,158,.28),rgba(43,88,158,0) 55%),radial-gradient(34% 26% at 4% 2%,rgba(48,78,128,.1),rgba(48,78,128,0) 70%),radial-gradient(90% 44% at 50% 118%,rgba(43,88,158,.18),rgba(43,88,158,0) 72%),radial-gradient(140% 110% at 90% 120%,rgba(228,214,188,.16),rgba(228,214,188,0) 55%),radial-gradient(100% 85% at 4% 78%,rgba(181,67,47,.08),rgba(181,67,47,0) 55%),radial-gradient(95% 80% at 99% 40%,rgba(86,140,190,.24),rgba(86,140,190,0) 58%),radial-gradient(80% 62% at 10% 40%,rgba(110,158,220,.18),rgba(110,158,220,0) 70%),radial-gradient(46% 34% at 62% 78%,rgba(52,102,180,.12),rgba(52,102,180,0) 70%),linear-gradient(115deg,rgba(255,255,255,0) 30%,rgba(60,98,158,.045) 45%,rgba(60,98,158,.02) 52%,rgba(255,255,255,0) 62%),linear-gradient(180deg,rgba(255,255,255,.58) 0%,rgba(255,255,255,.34) 40%,rgba(255,255,255,.52) 68%,rgba(255,255,255,.78) 88%,rgba(255,255,255,.88) 100%)!important;outline:1px solid rgba(255,255,255,.55);outline-offset:-2px}',
|
|
255
|
+
// 钴蓝描印:头部印章改青花白釉地 + 钴蓝环;标题印泥方块加外廓如钤印
|
|
256
|
+
'body [data-dsh-reasoning-view] [data-dsh-reasoning-mark]{color:#2b589e;background:linear-gradient(165deg,rgba(255,255,255,.95),rgba(224,235,250,.82))!important;box-shadow:inset 0 0 0 1px rgba(43,88,158,.22),inset 0 1px 0 rgba(255,255,255,.95),0 1px 8px rgba(43,88,158,.22)!important}',
|
|
257
|
+
'body [data-dsh-reasoning-view] [data-dsh-reasoning-title]::before{background:linear-gradient(135deg,#c8553d,#a03726 60%,#8e2f20)!important;box-shadow:inset 0 0 0 .5px rgba(255,255,255,.45),0 0 0 2px rgba(181,67,47,.14),0 1px 5px rgba(181,67,47,.42)!important}',
|
|
258
|
+
// 当前对话模型行:钴蓝侧栏标记 + 青花晕染
|
|
259
|
+
'body [data-dsh-reasoning-view] [data-dsh-reasoning-model][data-current]{background:linear-gradient(90deg,rgba(43,88,158,.11),rgba(43,88,158,.03) 55%,rgba(43,88,158,0))!important;box-shadow:inset 2.5px 0 0 rgba(43,88,158,.6),inset 0 1px 0 rgba(255,255,255,.75)!important}',
|
|
260
|
+
// 底部操作栏:白釉堆脂,向底加厚
|
|
261
|
+
'body [data-dsh-reasoning-view] [data-dsh-reasoning-actions]{background:linear-gradient(180deg,rgba(255,255,255,.14),rgba(255,255,255,.66))!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.95),inset 0 -6px 14px -8px rgba(255,255,255,.8)!important}',
|
|
262
|
+
'body [data-dsh-reasoning-view] [data-dsh-reasoning-scroll]{scrollbar-color:rgba(43,88,158,.32) transparent}',
|
|
263
|
+
'body [data-dsh-reasoning-view] [data-dsh-reasoning-scroll]::-webkit-scrollbar-thumb{background:rgba(43,88,158,.28)!important}',
|
|
264
|
+
':root[data-theme=dark] body [data-dsh-reasoning-view]{background-image:radial-gradient(58% 44% at 78% 6%,rgba(70,100,165,.3),rgba(70,100,165,.14) 42%,rgba(70,100,165,0) 72%),radial-gradient(42% 30% at var(--dsh-reasoning-ink-x,14%) var(--dsh-reasoning-ink-y,6%),rgba(140,165,200,.17),rgba(104,118,142,.08) 48%,rgba(104,118,142,0) 74%),radial-gradient(120% 90% at 50% -20%,rgba(104,118,142,.36),rgba(104,118,142,0) 55%),radial-gradient(90% 44% at 50% 118%,rgba(8,12,22,.4),rgba(8,12,22,0) 72%),radial-gradient(130% 100% at 90% 115%,rgba(150,110,90,.16),rgba(150,110,90,0) 58%),radial-gradient(80% 62% at 10% 40%,rgba(104,130,175,.14),rgba(104,130,175,0) 70%),linear-gradient(160deg,rgba(255,250,240,.07),rgba(255,250,240,0))!important;outline-color:rgba(255,250,240,.14)}',
|
|
265
|
+
':root[data-theme=dark] body [data-dsh-reasoning-view] [data-dsh-reasoning-mark]{color:#a9c3e8;background:linear-gradient(165deg,rgba(78,94,128,.55),rgba(44,56,84,.5))!important;box-shadow:inset 0 0 0 1px rgba(169,195,232,.28),inset 0 1px 0 rgba(255,250,240,.2),0 1px 8px rgba(0,0,0,.4)!important}',
|
|
266
|
+
':root[data-theme=dark] body [data-dsh-reasoning-view] [data-dsh-reasoning-model][data-current]{background:linear-gradient(90deg,rgba(140,168,224,.16),rgba(140,168,224,.05) 55%,rgba(140,168,224,0))!important;box-shadow:inset 2.5px 0 0 rgba(150,178,228,.65),inset 0 1px 0 rgba(255,250,240,.15)!important}',
|
|
267
|
+
'@media(prefers-color-scheme:dark){:root:not([data-theme=light]) body [data-dsh-reasoning-view]{background-image:radial-gradient(58% 44% at 78% 6%,rgba(70,100,165,.3),rgba(70,100,165,.14) 42%,rgba(70,100,165,0) 72%),radial-gradient(42% 30% at var(--dsh-reasoning-ink-x,14%) var(--dsh-reasoning-ink-y,6%),rgba(140,165,200,.17),rgba(104,118,142,.08) 48%,rgba(104,118,142,0) 74%),radial-gradient(120% 90% at 50% -20%,rgba(104,118,142,.36),rgba(104,118,142,0) 55%),radial-gradient(90% 44% at 50% 118%,rgba(8,12,22,.4),rgba(8,12,22,0) 72%),radial-gradient(130% 100% at 90% 115%,rgba(150,110,90,.16),rgba(150,110,90,0) 58%),radial-gradient(80% 62% at 10% 40%,rgba(104,130,175,.14),rgba(104,130,175,0) 70%),linear-gradient(160deg,rgba(255,250,240,.07),rgba(255,250,240,0))!important;outline-color:rgba(255,250,240,.14)}}',
|
|
268
|
+
'@media(prefers-color-scheme:dark){:root:not([data-theme=light]) body [data-dsh-reasoning-view] [data-dsh-reasoning-mark]{color:#a9c3e8;background:linear-gradient(165deg,rgba(78,94,128,.55),rgba(44,56,84,.5))!important;box-shadow:inset 0 0 0 1px rgba(169,195,232,.28),inset 0 1px 0 rgba(255,250,240,.2),0 1px 8px rgba(0,0,0,.4)!important}}',
|
|
269
|
+
'@media(prefers-color-scheme:dark){:root:not([data-theme=light]) body [data-dsh-reasoning-view] [data-dsh-reasoning-model][data-current]{background:linear-gradient(90deg,rgba(140,168,224,.16),rgba(140,168,224,.05) 55%,rgba(140,168,224,0))!important;box-shadow:inset 2.5px 0 0 rgba(150,178,228,.65),inset 0 1px 0 rgba(255,250,240,.15)!important}}',
|
|
270
|
+
// 自定义 Provider 下拉:原生 select 弹层由 OS 渲染无法着色,替换为玻璃化 listbox
|
|
271
|
+
// 玻璃卡片(backdrop-filter)各自成层叠上下文,弹层须随工具栏卡片整体抬到相邻卡片之上;卡片 overflow:hidden 会裁掉弹层,打开态一并放开
|
|
272
|
+
'body [data-dsh-reasoning-view] [data-dsh-reasoning-card]:has([data-dsh-reasoning-dd][data-open]){position:relative;z-index:30;overflow:visible}',
|
|
273
|
+
'[data-dsh-reasoning-dd]{position:relative;flex:1;min-width:0}',
|
|
274
|
+
'[data-dsh-reasoning-dd-btn]{box-sizing:border-box;width:100%;height:36px;display:flex;align-items:center;gap:8px;padding:0 30px 0 11px;border:1px solid var(--ink-line-strong);border-radius:10px;background:var(--ink-paper);color:var(--ink-text);font:inherit;font-size:12.5px;line-height:1.25;outline:none;cursor:pointer;text-align:left;transition:border-color .12s,box-shadow .12s}',
|
|
275
|
+
'[data-dsh-reasoning-dd-btn]:focus{border-color:var(--ink-text);box-shadow:0 0 0 3px var(--ink-focus)}',
|
|
276
|
+
'[data-dsh-reasoning-dd-label]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}',
|
|
277
|
+
'[data-dsh-reasoning-dd-arrow]{flex:none;display:flex;color:var(--ink-mist);transition:transform .18s ease}',
|
|
278
|
+
'[data-dsh-reasoning-dd][data-open] [data-dsh-reasoning-dd-arrow]{transform:rotate(180deg)}',
|
|
279
|
+
'[data-dsh-reasoning-dd-arrow svg]{width:14px;height:14px;display:block}',
|
|
280
|
+
'[data-dsh-reasoning-dd-pop]{position:absolute;z-index:60;left:0;right:0;top:calc(100% + 6px);max-height:262px;overflow:auto;box-sizing:border-box;padding:4px;display:none;border:1px solid var(--ink-line-strong);border-radius:12px;background:var(--ink-card);box-shadow:0 14px 36px rgba(28,26,22,.18)}',
|
|
281
|
+
'[data-dsh-reasoning-dd][data-open] [data-dsh-reasoning-dd-pop]{display:block;animation:dsh-reasoning-dd-in .16s ease}',
|
|
282
|
+
'@keyframes dsh-reasoning-dd-in{from{opacity:0;transform:translateY(-4px) scale(.985)}to{opacity:1;transform:none}}',
|
|
283
|
+
'[data-dsh-reasoning-dd-row]{display:flex;align-items:center;gap:8px;width:100%;box-sizing:border-box;border:0;background:none;font:inherit;font-size:12.5px;color:var(--ink-text);padding:7px 10px;border-radius:9px;cursor:pointer;text-align:left}',
|
|
284
|
+
'[data-dsh-reasoning-dd-group]{padding:9px 10px 3px;font-size:10px;font-weight:700;letter-spacing:.08em;color:var(--ink-faint)}',
|
|
285
|
+
'[data-dsh-reasoning-dd-group]:not(:first-child){margin-top:3px;border-top:1px solid var(--ink-line)}',
|
|
286
|
+
'[data-dsh-reasoning-dd-body]{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}',
|
|
287
|
+
'[data-dsh-reasoning-dd-title]{display:flex;align-items:center;gap:7px;min-width:0;font-size:12.5px}',
|
|
288
|
+
'[data-dsh-reasoning-dd-title]>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}',
|
|
289
|
+
'[data-dsh-reasoning-dd-title] code{flex:none;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:10.5px;font-weight:700;letter-spacing:.03em;padding:1.5px 7px;border-radius:6px;background:var(--ink-soft);color:var(--ink-text)}',
|
|
290
|
+
'[data-dsh-reasoning-dd-note]{font-size:10.5px;line-height:15px;color:var(--ink-mist);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}',
|
|
291
|
+
'[data-dsh-reasoning-dd-row]:disabled{opacity:.42;cursor:default}',
|
|
292
|
+
'[data-dsh-reasoning-dd-row]:disabled:hover{background:none}',
|
|
293
|
+
'[data-dsh-reasoning-dd][data-drop-up] [data-dsh-reasoning-dd-pop]{top:auto;bottom:calc(100% + 6px)}',
|
|
294
|
+
'[data-dsh-reasoning-dd-check]{flex:none;display:flex;color:#2b589e;opacity:0;transition:opacity .12s}',
|
|
295
|
+
'[data-dsh-reasoning-dd-check] svg,[data-dsh-reasoning-dd-arrow] svg{width:14px;height:14px;display:block}',
|
|
296
|
+
'[data-dsh-reasoning-dd-row][aria-selected=true] [data-dsh-reasoning-dd-check]{opacity:1}',
|
|
297
|
+
'[data-dsh-reasoning-dd-row]:hover,[data-dsh-reasoning-dd-row][data-active]{background:var(--ink-hover)}',
|
|
298
|
+
'[data-dsh-reasoning-dd-row]:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--ink-focus)}',
|
|
299
|
+
':root[data-theme=dark] [data-dsh-reasoning-dd-check]{color:#a9c3e8}',
|
|
300
|
+
'@media(prefers-color-scheme:dark){:root:not([data-theme=light]) [data-dsh-reasoning-dd-check]{color:#a9c3e8}}',
|
|
301
|
+
'body [data-dsh-reasoning-view] [data-dsh-reasoning-dd-btn]{background:linear-gradient(170deg,rgba(255,255,255,.72),rgba(255,255,255,.5))!important;border-color:rgba(255,255,255,.78)!important;box-shadow:inset 0 1px 0 rgba(255,255,255,1),inset 0 -1px 0 rgba(48,78,128,.12),inset 0 0 12px rgba(255,255,255,.4)!important}',
|
|
302
|
+
'body [data-dsh-reasoning-view] [data-dsh-reasoning-dd-btn]:focus,body [data-dsh-reasoning-view] [data-dsh-reasoning-dd-btn][aria-expanded=true]{border-color:rgba(255,255,255,.95)!important;box-shadow:0 0 0 3px rgba(43,88,158,.28),0 0 0 6px rgba(43,88,158,.1),inset 0 1px 0 rgba(255,255,255,.95)!important}',
|
|
303
|
+
'body [data-dsh-reasoning-view] [data-dsh-reasoning-dd-pop]{background:linear-gradient(172deg,rgba(255,255,255,.92),rgba(240,247,255,.88))!important;-webkit-backdrop-filter:blur(26px) saturate(180%);backdrop-filter:blur(26px) saturate(180%);border-color:rgba(255,255,255,.82)!important;box-shadow:inset 0 1px 0 rgba(255,255,255,1),inset 0 0 0 1px rgba(43,88,158,.08),inset 0 0 18px rgba(255,255,255,.5),0 18px 44px rgba(28,26,22,.24),0 0 26px rgba(86,140,190,.14)!important}',
|
|
304
|
+
'body [data-dsh-reasoning-view] [data-dsh-reasoning-dd-row]:not(:disabled):hover,body [data-dsh-reasoning-view] [data-dsh-reasoning-dd-row][data-active]{background:rgba(43,88,158,.1)!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.7)}',
|
|
305
|
+
'body [data-dsh-reasoning-view] [data-dsh-reasoning-dd-row][aria-selected=true]{background:linear-gradient(90deg,rgba(43,88,158,.16),rgba(43,88,158,.05) 58%,rgba(43,88,158,0))!important;box-shadow:inset 2px 0 0 rgba(43,88,158,.68),inset 0 1px 0 rgba(255,255,255,.7)}',
|
|
306
|
+
':root[data-theme=dark] body [data-dsh-reasoning-view] [data-dsh-reasoning-dd-btn]{background:linear-gradient(170deg,rgba(255,250,240,.09),rgba(255,250,240,.05))!important;border-color:rgba(255,250,240,.16)!important;box-shadow:inset 0 1px 0 rgba(255,250,240,.16),inset 0 -1px 0 rgba(0,0,0,.4)!important}',
|
|
307
|
+
':root[data-theme=dark] body [data-dsh-reasoning-view] [data-dsh-reasoning-dd-pop]{background:linear-gradient(172deg,rgba(52,56,66,.94),rgba(38,40,48,.92))!important;-webkit-backdrop-filter:blur(26px) saturate(170%);backdrop-filter:blur(26px) saturate(170%);border-color:rgba(255,250,240,.14)!important;box-shadow:inset 0 1px 0 rgba(255,250,240,.16),inset 0 0 0 1px rgba(150,180,220,.06),0 18px 44px rgba(0,0,0,.5)!important}',
|
|
308
|
+
':root[data-theme=dark] body [data-dsh-reasoning-view] [data-dsh-reasoning-dd-row]:not(:disabled):hover,:root[data-theme=dark] body [data-dsh-reasoning-view] [data-dsh-reasoning-dd-row][data-active]{background:rgba(140,168,224,.14)!important}',
|
|
309
|
+
':root[data-theme=dark] body [data-dsh-reasoning-view] [data-dsh-reasoning-dd-row][aria-selected=true]{background:linear-gradient(90deg,rgba(140,168,224,.2),rgba(140,168,224,.06) 58%,rgba(140,168,224,0))!important;box-shadow:inset 2px 0 0 rgba(150,178,228,.7)}',
|
|
310
|
+
'@media(prefers-color-scheme:dark){:root:not([data-theme=light]) body [data-dsh-reasoning-view] [data-dsh-reasoning-dd-btn]{background:linear-gradient(170deg,rgba(255,250,240,.09),rgba(255,250,240,.05))!important;border-color:rgba(255,250,240,.16)!important;box-shadow:inset 0 1px 0 rgba(255,250,240,.16),inset 0 -1px 0 rgba(0,0,0,.4)!important}}',
|
|
311
|
+
'@media(prefers-color-scheme:dark){:root:not([data-theme=light]) body [data-dsh-reasoning-view] [data-dsh-reasoning-dd-pop]{background:linear-gradient(172deg,rgba(52,56,66,.94),rgba(38,40,48,.92))!important;border-color:rgba(255,250,240,.14)!important;box-shadow:inset 0 1px 0 rgba(255,250,240,.16),inset 0 0 0 1px rgba(150,180,220,.06),0 18px 44px rgba(0,0,0,.5)!important}}',
|
|
312
|
+
'@media(prefers-color-scheme:dark){:root:not([data-theme=light]) body [data-dsh-reasoning-view] [data-dsh-reasoning-dd-row]:not(:disabled):hover,:root:not([data-theme=light]) body [data-dsh-reasoning-view] [data-dsh-reasoning-dd-row][data-active]{background:rgba(140,168,224,.14)!important}}',
|
|
313
|
+
'@media(prefers-color-scheme:dark){:root:not([data-theme=light]) body [data-dsh-reasoning-view] [data-dsh-reasoning-dd-row][aria-selected=true]{background:linear-gradient(90deg,rgba(140,168,224,.2),rgba(140,168,224,.06) 58%,rgba(140,168,224,0))!important;box-shadow:inset 2px 0 0 rgba(150,178,228,.7)}}',
|
|
314
|
+
].join("\n");
|
|
184
315
|
}
|
|
185
316
|
|
|
186
317
|
function injectCss() {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
318
|
+
// The embedded webview may truncate a large dynamically injected
|
|
319
|
+
// stylesheet. Keep each block small while preserving whole CSS rules.
|
|
320
|
+
if (document.getElementById("dsh-reasoning-effort-css-0")) return;
|
|
321
|
+
var rules = cssText().split("\n");
|
|
322
|
+
for (var i = 0; i < rules.length; i += 20) {
|
|
323
|
+
var style = document.createElement("style");
|
|
324
|
+
style.id = "dsh-reasoning-effort-css-" + String(i / 20);
|
|
325
|
+
style.textContent = rules.slice(i, i + 20).join("\n");
|
|
326
|
+
document.head.appendChild(style);
|
|
327
|
+
}
|
|
193
328
|
}
|
|
194
329
|
|
|
195
330
|
function sidebarRoot() {
|
|
@@ -227,7 +362,13 @@ window.__ModuleLoader__.load({
|
|
|
227
362
|
var modelDirectories;
|
|
228
363
|
|
|
229
364
|
function publish() {
|
|
230
|
-
for (var i = 0; i < listeners.length; i++)
|
|
365
|
+
for (var i = 0; i < listeners.length; i++) {
|
|
366
|
+
try {
|
|
367
|
+
listeners[i]();
|
|
368
|
+
} catch (error) {
|
|
369
|
+
console.warn("[dsh-reasoning-effort] render failed:", error);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
231
372
|
}
|
|
232
373
|
|
|
233
374
|
function subscribe(fn) {
|
|
@@ -388,15 +529,23 @@ window.__ModuleLoader__.load({
|
|
|
388
529
|
}
|
|
389
530
|
|
|
390
531
|
function popoverShown() {
|
|
391
|
-
|
|
392
|
-
if (!view) return false;
|
|
393
|
-
return view.hasAttribute("data-open");
|
|
532
|
+
return state.open && !!document.querySelector("[data-dsh-reasoning-view]");
|
|
394
533
|
}
|
|
395
534
|
|
|
396
535
|
function setOpen(open, announce) {
|
|
536
|
+
// ssh / task-board only yield to each other's panel names; borrowing
|
|
537
|
+
// their protocol closes them. Dispatched before state.open flips so
|
|
538
|
+
// our own sibling listener ignores these.
|
|
539
|
+
if (open && announce !== false) {
|
|
540
|
+
document.dispatchEvent(new CustomEvent("dsh-panel-activate", { detail: "taskboard" }));
|
|
541
|
+
document.dispatchEvent(new CustomEvent("dsh-panel-activate", { detail: "ssh" }));
|
|
542
|
+
}
|
|
397
543
|
state.open = open;
|
|
398
544
|
document.documentElement.toggleAttribute("data-dsh-reasoning-active", open);
|
|
399
|
-
if (open && announce !== false)
|
|
545
|
+
if (open && announce !== false) {
|
|
546
|
+
window.dispatchEvent(new CustomEvent(PANEL_EVENT, { detail: { panel: PANEL_ID } }));
|
|
547
|
+
document.dispatchEvent(new CustomEvent("dsh-panel-activate", { detail: PANEL_ID }));
|
|
548
|
+
}
|
|
400
549
|
if (open) refresh({ quiet: !!state.list, syncConversation: true });
|
|
401
550
|
publish();
|
|
402
551
|
}
|
|
@@ -655,9 +804,16 @@ window.__ModuleLoader__.load({
|
|
|
655
804
|
]));
|
|
656
805
|
}
|
|
657
806
|
|
|
658
|
-
|
|
807
|
+
// Wraps children in the shared ink card with hairline dividers.
|
|
808
|
+
function inkCard(children, divided) {
|
|
809
|
+
var card = el("div", { "data-dsh-reasoning-card": "" }, children);
|
|
810
|
+
if (divided) card.setAttribute("data-dsh-reasoning-divided", "");
|
|
811
|
+
return card;
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
function renderNotice(body) {
|
|
659
815
|
if (!state.notice) return;
|
|
660
|
-
|
|
816
|
+
body.appendChild(el("div", {
|
|
661
817
|
"data-dsh-reasoning-notice": state.notice.type,
|
|
662
818
|
role: state.notice.type === "error" ? "alert" : "status",
|
|
663
819
|
}, [
|
|
@@ -690,8 +846,10 @@ window.__ModuleLoader__.load({
|
|
|
690
846
|
}
|
|
691
847
|
|
|
692
848
|
function renderLoading(body) {
|
|
849
|
+
var spinner = el("div", { html: icons.refresh });
|
|
850
|
+
spinner.setAttribute("data-loading", "");
|
|
693
851
|
body.appendChild(el("div", { "data-dsh-reasoning-empty": "" }, [
|
|
694
|
-
|
|
852
|
+
spinner,
|
|
695
853
|
el("div", { text: "正在同步模型配置..." }),
|
|
696
854
|
]));
|
|
697
855
|
}
|
|
@@ -712,6 +870,205 @@ window.__ModuleLoader__.load({
|
|
|
712
870
|
return levels.length ? "官方 " + levels.length + " 档" : "官方推理模型";
|
|
713
871
|
}
|
|
714
872
|
|
|
873
|
+
// Shared porcelain listbox behind every picker in the panel. The popup of
|
|
874
|
+
// a native <select> is rendered by the OS and cannot take the panel's
|
|
875
|
+
// skin, so each choice is rebuilt as a trigger button plus a floating
|
|
876
|
+
// listbox. config: { label, value, placeholder, groups: [{ title,
|
|
877
|
+
// options: [{ value, title, code, note, disabled }] }], summarize,
|
|
878
|
+
// onChange }.
|
|
879
|
+
function glassDropdown(config) {
|
|
880
|
+
var wrapper = el("div", { "data-dsh-reasoning-dd": "" });
|
|
881
|
+
var label = el("span", { "data-dsh-reasoning-dd-label": "" });
|
|
882
|
+
var button = el("button", {
|
|
883
|
+
type: "button",
|
|
884
|
+
"data-dsh-reasoning-dd-btn": "",
|
|
885
|
+
"aria-haspopup": "listbox",
|
|
886
|
+
"aria-expanded": "false",
|
|
887
|
+
"aria-label": config.label,
|
|
888
|
+
}, [label, el("span", { "data-dsh-reasoning-dd-arrow": "", html: icons.caret })]);
|
|
889
|
+
var popup = el("div", { "data-dsh-reasoning-dd-pop": "", role: "listbox", "aria-label": config.label });
|
|
890
|
+
var options = [];
|
|
891
|
+
var rows = [];
|
|
892
|
+
|
|
893
|
+
for (var g = 0; g < config.groups.length; g++) {
|
|
894
|
+
(function (group) {
|
|
895
|
+
if (group.title) popup.appendChild(el("div", { "data-dsh-reasoning-dd-group": "", text: group.title }));
|
|
896
|
+
for (var i = 0; i < group.options.length; i++) {
|
|
897
|
+
(function (option) {
|
|
898
|
+
var row = el("button", {
|
|
899
|
+
type: "button",
|
|
900
|
+
role: "option",
|
|
901
|
+
"data-dsh-reasoning-dd-row": "",
|
|
902
|
+
"data-value": option.value,
|
|
903
|
+
disabled: !!option.disabled,
|
|
904
|
+
}, [
|
|
905
|
+
el("span", { "data-dsh-reasoning-dd-body": "" }, [
|
|
906
|
+
el("span", { "data-dsh-reasoning-dd-title": "" }, [
|
|
907
|
+
option.code ? el("code", { text: option.code }) : null,
|
|
908
|
+
el("span", { text: option.title }),
|
|
909
|
+
]),
|
|
910
|
+
option.note ? el("span", { "data-dsh-reasoning-dd-note": "", text: option.note }) : null,
|
|
911
|
+
]),
|
|
912
|
+
el("span", { "data-dsh-reasoning-dd-check": "", html: icons.check }),
|
|
913
|
+
]);
|
|
914
|
+
row.addEventListener("click", function () {
|
|
915
|
+
if (option.disabled) return;
|
|
916
|
+
closePopup();
|
|
917
|
+
if (String(option.value) === currentValue()) return;
|
|
918
|
+
config.value = option.value;
|
|
919
|
+
syncSelection();
|
|
920
|
+
config.onChange(option.value);
|
|
921
|
+
});
|
|
922
|
+
options.push(option);
|
|
923
|
+
rows.push(row);
|
|
924
|
+
popup.appendChild(row);
|
|
925
|
+
})(group.options[i]);
|
|
926
|
+
}
|
|
927
|
+
})(config.groups[g]);
|
|
928
|
+
}
|
|
929
|
+
wrapper.appendChild(button);
|
|
930
|
+
wrapper.appendChild(popup);
|
|
931
|
+
|
|
932
|
+
var isOpen = false;
|
|
933
|
+
var activeIndex = -1;
|
|
934
|
+
|
|
935
|
+
function currentValue() {
|
|
936
|
+
return config.value == null ? "" : String(config.value);
|
|
937
|
+
}
|
|
938
|
+
function selectedOption() {
|
|
939
|
+
var value = currentValue();
|
|
940
|
+
for (var i = 0; i < options.length; i++) {
|
|
941
|
+
if (String(options[i].value) === value) return options[i];
|
|
942
|
+
}
|
|
943
|
+
return null;
|
|
944
|
+
}
|
|
945
|
+
function syncSelection() {
|
|
946
|
+
var value = currentValue();
|
|
947
|
+
for (var i = 0; i < rows.length; i++) {
|
|
948
|
+
var selected = rows[i].getAttribute("data-value") === value;
|
|
949
|
+
if (selected) activeIndex = i;
|
|
950
|
+
rows[i].setAttribute("aria-selected", selected ? "true" : "false");
|
|
951
|
+
}
|
|
952
|
+
var current = selectedOption();
|
|
953
|
+
label.textContent = current ? (config.summarize ? config.summarize(current) : current.title) : config.placeholder;
|
|
954
|
+
}
|
|
955
|
+
function paintActive() {
|
|
956
|
+
for (var i = 0; i < rows.length; i++) {
|
|
957
|
+
if (i === activeIndex) rows[i].setAttribute("data-active", "");
|
|
958
|
+
else rows[i].removeAttribute("data-active");
|
|
959
|
+
}
|
|
960
|
+
if (rows[activeIndex]) rows[activeIndex].scrollIntoView({ block: "nearest" });
|
|
961
|
+
}
|
|
962
|
+
function nearestActivable(start, delta) {
|
|
963
|
+
for (var step = 1; step <= rows.length; step++) {
|
|
964
|
+
var index = ((start + delta * step) % rows.length + rows.length) % rows.length;
|
|
965
|
+
if (!rows[index].disabled) return index;
|
|
966
|
+
}
|
|
967
|
+
return start;
|
|
968
|
+
}
|
|
969
|
+
function placePopup() {
|
|
970
|
+
// Flip above the trigger when the drawer's scroll viewport lacks room
|
|
971
|
+
// below; scrollIntoView then covers whatever clipping remains.
|
|
972
|
+
var viewport = button.closest("[data-dsh-reasoning-scroll]");
|
|
973
|
+
var bounds = viewport ? viewport.getBoundingClientRect() : { top: 0, bottom: window.innerHeight };
|
|
974
|
+
var rect = button.getBoundingClientRect();
|
|
975
|
+
var needed = Math.min(popup.scrollHeight, 262) + 12;
|
|
976
|
+
var below = bounds.bottom - rect.bottom;
|
|
977
|
+
var above = rect.top - bounds.top;
|
|
978
|
+
wrapper.toggleAttribute("data-drop-up", below < needed && above > below);
|
|
979
|
+
popup.scrollIntoView({ block: "nearest" });
|
|
980
|
+
}
|
|
981
|
+
function onOutside(event) {
|
|
982
|
+
if (!wrapper.contains(event.target)) closePopup();
|
|
983
|
+
}
|
|
984
|
+
function onKeydown(event) {
|
|
985
|
+
if (event.key === "Escape") {
|
|
986
|
+
event.preventDefault();
|
|
987
|
+
closePopup();
|
|
988
|
+
button.focus();
|
|
989
|
+
} else if (event.key === "ArrowDown" || event.key === "ArrowUp") {
|
|
990
|
+
event.preventDefault();
|
|
991
|
+
var delta = event.key === "ArrowDown" ? 1 : -1;
|
|
992
|
+
activeIndex = nearestActivable(activeIndex < 0 ? 0 : activeIndex, delta);
|
|
993
|
+
paintActive();
|
|
994
|
+
} else if (event.key === "Home") {
|
|
995
|
+
event.preventDefault();
|
|
996
|
+
activeIndex = nearestActivable(0, -1);
|
|
997
|
+
paintActive();
|
|
998
|
+
} else if (event.key === "End") {
|
|
999
|
+
event.preventDefault();
|
|
1000
|
+
activeIndex = nearestActivable(rows.length - 1, 1);
|
|
1001
|
+
paintActive();
|
|
1002
|
+
} else if (event.key === "Enter") {
|
|
1003
|
+
event.preventDefault();
|
|
1004
|
+
var row = rows[activeIndex];
|
|
1005
|
+
if (row && !row.disabled) row.click();
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
function openPopup() {
|
|
1009
|
+
if (isOpen) return;
|
|
1010
|
+
isOpen = true;
|
|
1011
|
+
syncSelection();
|
|
1012
|
+
wrapper.setAttribute("data-open", "");
|
|
1013
|
+
button.setAttribute("aria-expanded", "true");
|
|
1014
|
+
if (activeIndex >= 0) {
|
|
1015
|
+
var row = rows[activeIndex];
|
|
1016
|
+
popup.scrollTop = Math.max(0, row.offsetTop - popup.clientHeight / 2 + row.offsetHeight / 2);
|
|
1017
|
+
}
|
|
1018
|
+
placePopup();
|
|
1019
|
+
paintActive();
|
|
1020
|
+
document.addEventListener("pointerdown", onOutside, true);
|
|
1021
|
+
document.addEventListener("keydown", onKeydown, true);
|
|
1022
|
+
}
|
|
1023
|
+
function closePopup() {
|
|
1024
|
+
if (!isOpen) return;
|
|
1025
|
+
isOpen = false;
|
|
1026
|
+
wrapper.removeAttribute("data-open");
|
|
1027
|
+
button.setAttribute("aria-expanded", "false");
|
|
1028
|
+
document.removeEventListener("pointerdown", onOutside, true);
|
|
1029
|
+
document.removeEventListener("keydown", onKeydown, true);
|
|
1030
|
+
}
|
|
1031
|
+
button.addEventListener("click", function () {
|
|
1032
|
+
if (isOpen) closePopup();
|
|
1033
|
+
else openPopup();
|
|
1034
|
+
});
|
|
1035
|
+
button.addEventListener("keydown", function (event) {
|
|
1036
|
+
if (!isOpen && (event.key === "ArrowDown" || event.key === "ArrowUp")) {
|
|
1037
|
+
event.preventDefault();
|
|
1038
|
+
openPopup();
|
|
1039
|
+
}
|
|
1040
|
+
});
|
|
1041
|
+
syncSelection();
|
|
1042
|
+
// Lets outside state changes (e.g. unchecking a level row) move the
|
|
1043
|
+
// selection without rebuilding the whole editor.
|
|
1044
|
+
wrapper.setDropdownValue = function (value) {
|
|
1045
|
+
config.value = value;
|
|
1046
|
+
syncSelection();
|
|
1047
|
+
};
|
|
1048
|
+
return wrapper;
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
function providerDropdown() {
|
|
1052
|
+
return glassDropdown({
|
|
1053
|
+
label: "选择 Provider",
|
|
1054
|
+
value: state.providerId || "",
|
|
1055
|
+
placeholder: "选择 Provider",
|
|
1056
|
+
summarize: function (option) { return option.title + " · " + option.note; },
|
|
1057
|
+
groups: [{
|
|
1058
|
+
options: state.list.providers.map(function (provider) {
|
|
1059
|
+
return { value: provider.id, title: provider.displayName, note: provider.id };
|
|
1060
|
+
}),
|
|
1061
|
+
}],
|
|
1062
|
+
onChange: function (providerId) {
|
|
1063
|
+
state.providerId = providerId;
|
|
1064
|
+
state.providerPinned = true;
|
|
1065
|
+
state.query = "";
|
|
1066
|
+
state.notice = null;
|
|
1067
|
+
publish();
|
|
1068
|
+
},
|
|
1069
|
+
});
|
|
1070
|
+
}
|
|
1071
|
+
|
|
715
1072
|
function renderModelList(body) {
|
|
716
1073
|
var list = state.list;
|
|
717
1074
|
if (!list || !list.providers.length) {
|
|
@@ -722,27 +1079,14 @@ window.__ModuleLoader__.load({
|
|
|
722
1079
|
return;
|
|
723
1080
|
}
|
|
724
1081
|
|
|
725
|
-
var
|
|
726
|
-
return el("option", { value: provider.id, text: provider.displayName + " · " + provider.id });
|
|
727
|
-
});
|
|
728
|
-
var providerSelect = el("select", {
|
|
729
|
-
"data-dsh-reasoning-select": "",
|
|
730
|
-
"aria-label": "选择 Provider",
|
|
731
|
-
value: state.providerId,
|
|
732
|
-
onchange: function (event) {
|
|
733
|
-
state.providerId = event.target.value;
|
|
734
|
-
state.providerPinned = true;
|
|
735
|
-
state.query = "";
|
|
736
|
-
state.notice = null;
|
|
737
|
-
publish();
|
|
738
|
-
},
|
|
739
|
-
}, providerOptions);
|
|
1082
|
+
var providerSelect = providerDropdown();
|
|
740
1083
|
var refreshButton = iconButton(icons.refresh, state.loading ? "正在同步" : "重新同步", function () { refresh(); }, state.loading);
|
|
741
1084
|
if (state.loading) refreshButton.setAttribute("data-loading", "");
|
|
742
|
-
body.appendChild(el("div", { "data-dsh-reasoning-toolbar": "" }, [
|
|
1085
|
+
body.appendChild(inkCard([el("div", { "data-dsh-reasoning-toolbar": "" }, [
|
|
743
1086
|
providerSelect,
|
|
744
1087
|
refreshButton,
|
|
745
|
-
]));
|
|
1088
|
+
])]));
|
|
1089
|
+
|
|
746
1090
|
renderConversationStatus(body);
|
|
747
1091
|
|
|
748
1092
|
var provider = selectedProvider();
|
|
@@ -813,12 +1157,12 @@ window.__ModuleLoader__.load({
|
|
|
813
1157
|
modelList.appendChild(row);
|
|
814
1158
|
})(provider.models[i]);
|
|
815
1159
|
}
|
|
816
|
-
body.appendChild(modelList);
|
|
1160
|
+
body.appendChild(inkCard([modelList], true));
|
|
817
1161
|
body.appendChild(searchEmpty);
|
|
818
1162
|
filterRows(state.query);
|
|
819
1163
|
}
|
|
820
1164
|
|
|
821
|
-
function renderLevelRows(
|
|
1165
|
+
function renderLevelRows(container, model) {
|
|
822
1166
|
var official = officialMap(model);
|
|
823
1167
|
for (var i = 1; i < LEVELS.length; i++) {
|
|
824
1168
|
(function (level) {
|
|
@@ -850,8 +1194,8 @@ window.__ModuleLoader__.load({
|
|
|
850
1194
|
row.toggleAttribute("data-active", field.checked);
|
|
851
1195
|
if (!field.checked && state.edit.defaultReasoning === level) {
|
|
852
1196
|
state.edit.defaultReasoning = "";
|
|
853
|
-
var
|
|
854
|
-
if (
|
|
1197
|
+
var defaultPicker = document.querySelector("[data-dsh-reasoning-default]");
|
|
1198
|
+
if (defaultPicker && defaultPicker.setDropdownValue) defaultPicker.setDropdownValue("");
|
|
855
1199
|
}
|
|
856
1200
|
markEdited();
|
|
857
1201
|
},
|
|
@@ -865,11 +1209,29 @@ window.__ModuleLoader__.load({
|
|
|
865
1209
|
wire,
|
|
866
1210
|
]);
|
|
867
1211
|
row.toggleAttribute("data-active", field.checked);
|
|
868
|
-
|
|
1212
|
+
container.appendChild(row);
|
|
869
1213
|
})(LEVELS[i]);
|
|
870
1214
|
}
|
|
871
1215
|
}
|
|
872
1216
|
|
|
1217
|
+
// Default-strength options for the picker: levels this model does not
|
|
1218
|
+
// enable stay visible but locked, with the reason in the note.
|
|
1219
|
+
function strengthLevelOptions() {
|
|
1220
|
+
var options = [];
|
|
1221
|
+
for (var i = 1; i < LEVELS.length; i++) {
|
|
1222
|
+
var level = LEVELS[i];
|
|
1223
|
+
var enabled = !!state.edit.levels[level].checked;
|
|
1224
|
+
options.push({
|
|
1225
|
+
value: level,
|
|
1226
|
+
code: level,
|
|
1227
|
+
title: LEVEL_LABELS[level],
|
|
1228
|
+
note: enabled ? LEVEL_NOTES[level] : "未在此模型启用",
|
|
1229
|
+
disabled: !enabled,
|
|
1230
|
+
});
|
|
1231
|
+
}
|
|
1232
|
+
return options;
|
|
1233
|
+
}
|
|
1234
|
+
|
|
873
1235
|
function renderEditor(body, view) {
|
|
874
1236
|
var provider = selectedProvider();
|
|
875
1237
|
var model = selectedModel();
|
|
@@ -914,79 +1276,90 @@ window.__ModuleLoader__.load({
|
|
|
914
1276
|
]);
|
|
915
1277
|
offRow.toggleAttribute("data-active", !!state.edit.off);
|
|
916
1278
|
|
|
917
|
-
var
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
offRow,
|
|
923
|
-
]);
|
|
1279
|
+
var levelRows = el("div", { "data-dsh-reasoning-section": "" });
|
|
1280
|
+
levelRows.appendChild(el("div", { "data-dsh-reasoning-section-head": "" }, [
|
|
1281
|
+
el("div", { "data-dsh-reasoning-section-title": "", text: "可用思考等级" }),
|
|
1282
|
+
el("div", { "data-dsh-reasoning-section-note": "", text: state.edit.off ? "推理已关闭" : "设置模型可选档位" }),
|
|
1283
|
+
]));
|
|
924
1284
|
if (state.edit.off) {
|
|
925
|
-
|
|
1285
|
+
levelRows.appendChild(inkCard([offRow, el("div", { "data-dsh-reasoning-off-callout": "", role: "status" }, [
|
|
926
1286
|
el("div", { "data-dsh-reasoning-off-callout-title": "", text: "推理已关闭" }),
|
|
927
1287
|
el("div", { "data-dsh-reasoning-off-callout-copy": "", text: "保存并同步后,此模型不会在对话框中显示推理等级。重新开启开关后可恢复编辑档位。" }),
|
|
928
|
-
]));
|
|
1288
|
+
])], true));
|
|
929
1289
|
} else {
|
|
930
|
-
|
|
1290
|
+
levelRows.appendChild(el("div", { "data-dsh-reasoning-quick": "" }, [
|
|
931
1291
|
el("button", { type: "button", "data-dsh-reasoning-btn": "", text: "同步官方档位", disabled: !(model.official && model.official.reasoning), onclick: applyOfficial }),
|
|
932
1292
|
el("button", { type: "button", "data-dsh-reasoning-btn": "", text: "恢复当前配置", onclick: restoreCurrent }),
|
|
933
1293
|
]));
|
|
934
|
-
|
|
1294
|
+
var levelCard = inkCard([offRow], true);
|
|
1295
|
+
renderLevelRows(levelCard, model);
|
|
1296
|
+
levelRows.appendChild(levelCard);
|
|
935
1297
|
}
|
|
936
|
-
body.appendChild(
|
|
1298
|
+
body.appendChild(levelRows);
|
|
937
1299
|
|
|
938
1300
|
if (state.edit.off) {
|
|
939
1301
|
body.appendChild(el("div", { "data-dsh-reasoning-scope-note": "", text: "Provider 默认强度与协议设置保持不变;关闭推理只影响此模型。" }));
|
|
940
1302
|
} else {
|
|
941
|
-
var
|
|
942
|
-
|
|
943
|
-
el("option", { value: "off", text: "off · 不思考" }),
|
|
944
|
-
];
|
|
945
|
-
for (var i = 1; i < LEVELS.length; i++) {
|
|
946
|
-
var level = LEVELS[i];
|
|
947
|
-
defaultOptions.push(el("option", {
|
|
948
|
-
value: level,
|
|
949
|
-
text: level + " · " + LEVEL_LABELS[level],
|
|
950
|
-
disabled: !state.edit.levels[level].checked,
|
|
951
|
-
}));
|
|
952
|
-
}
|
|
953
|
-
var defaultSelect = el("select", {
|
|
954
|
-
"data-dsh-reasoning-select": "",
|
|
955
|
-
"data-dsh-reasoning-default": "",
|
|
1303
|
+
var defaultPicker = glassDropdown({
|
|
1304
|
+
label: "新对话默认强度",
|
|
956
1305
|
value: state.edit.defaultReasoning,
|
|
957
|
-
|
|
958
|
-
|
|
1306
|
+
placeholder: "不设置 Provider 默认值",
|
|
1307
|
+
summarize: function (option) { return option.code ? option.code + " · " + option.title : option.title; },
|
|
1308
|
+
groups: [
|
|
1309
|
+
{ options: [{ value: "", title: "不设置 Provider 默认值", note: "新对话不预选强度,进对话后手动切换" }] },
|
|
1310
|
+
{ title: "关闭推理", options: [{ value: "off", code: "off", title: "不思考", note: LEVEL_NOTES.off }] },
|
|
1311
|
+
{ title: "思考等级", options: strengthLevelOptions() },
|
|
1312
|
+
],
|
|
1313
|
+
onChange: function (value) { state.edit.defaultReasoning = value; markEdited(); },
|
|
1314
|
+
});
|
|
1315
|
+
defaultPicker.setAttribute("data-dsh-reasoning-default", "");
|
|
959
1316
|
|
|
960
|
-
var formatOptions = [el("option", { value: "", text: "自动检测" })];
|
|
961
1317
|
var formats = state.list && state.list.thinkingFormats ? state.list.thinkingFormats : [];
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
"data-dsh-reasoning-select": "",
|
|
1318
|
+
var formatPicker = glassDropdown({
|
|
1319
|
+
label: "思考内容格式",
|
|
965
1320
|
value: state.edit.thinkingFormat,
|
|
966
|
-
|
|
967
|
-
|
|
1321
|
+
placeholder: "自动检测",
|
|
1322
|
+
summarize: function (option) { return option.code || option.title; },
|
|
1323
|
+
groups: [{
|
|
1324
|
+
options: [{ value: "", title: "自动检测", note: "按 Provider 协议自动匹配" }].concat(formats.map(function (format) {
|
|
1325
|
+
return { value: format, code: format, title: FORMAT_TITLES[format] || "手动指定的思考协议" };
|
|
1326
|
+
})),
|
|
1327
|
+
}],
|
|
1328
|
+
onChange: function (value) { state.edit.thinkingFormat = value; markEdited(); },
|
|
1329
|
+
});
|
|
968
1330
|
|
|
969
|
-
var
|
|
970
|
-
|
|
1331
|
+
var effortPicker = glassDropdown({
|
|
1332
|
+
label: "reasoning_effort 参数",
|
|
971
1333
|
value: state.edit.supportsReasoningEffort,
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
1334
|
+
placeholder: "自动检测",
|
|
1335
|
+
groups: [{
|
|
1336
|
+
options: [
|
|
1337
|
+
{ value: "", title: "自动检测", note: "按模型与协议自动判断是否携带" },
|
|
1338
|
+
{ value: "true", title: "启用 reasoning_effort", note: "请求体携带 reasoning_effort 字段" },
|
|
1339
|
+
{ value: "false", title: "不发送 reasoning_effort", note: "兼容不识别该字段的中转站" },
|
|
1340
|
+
],
|
|
1341
|
+
}],
|
|
1342
|
+
onChange: function (value) { state.edit.supportsReasoningEffort = value; markEdited(); },
|
|
1343
|
+
});
|
|
978
1344
|
|
|
979
|
-
|
|
1345
|
+
var formSection = el("div", { "data-dsh-reasoning-section": "" }, [
|
|
980
1346
|
el("div", { "data-dsh-reasoning-section-head": "" }, [
|
|
981
1347
|
el("div", { "data-dsh-reasoning-section-title": "", text: "默认与协议" }),
|
|
982
1348
|
el("div", { "data-dsh-reasoning-section-note": "", text: "Provider 级设置,影响同一 Provider 的模型" }),
|
|
983
1349
|
]),
|
|
984
|
-
|
|
985
|
-
el("
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
1350
|
+
inkCard([
|
|
1351
|
+
el("div", { "data-dsh-reasoning-form-row": "" }, [
|
|
1352
|
+
el("label", { "data-dsh-reasoning-label": "", text: "新对话默认强度" }), defaultPicker,
|
|
1353
|
+
]),
|
|
1354
|
+
el("div", { "data-dsh-reasoning-form-row": "" }, [
|
|
1355
|
+
el("label", { "data-dsh-reasoning-label": "", text: "思考内容格式" }), formatPicker,
|
|
1356
|
+
]),
|
|
1357
|
+
el("div", { "data-dsh-reasoning-form-row": "" }, [
|
|
1358
|
+
el("label", { "data-dsh-reasoning-label": "", text: "reasoning_effort 参数" }), effortPicker,
|
|
1359
|
+
]),
|
|
1360
|
+
], true),
|
|
1361
|
+
]);
|
|
1362
|
+
body.appendChild(formSection);
|
|
990
1363
|
}
|
|
991
1364
|
|
|
992
1365
|
if (state.discardConfirm) {
|
|
@@ -1011,12 +1384,12 @@ window.__ModuleLoader__.load({
|
|
|
1011
1384
|
if (!view) return;
|
|
1012
1385
|
view.textContent = "";
|
|
1013
1386
|
renderHeader(view);
|
|
1014
|
-
renderNotice(view);
|
|
1015
1387
|
|
|
1016
1388
|
var scroll = el("div", { "data-dsh-reasoning-scroll": "" });
|
|
1017
1389
|
var body = el("div", { "data-dsh-reasoning-body": "" });
|
|
1018
1390
|
scroll.appendChild(body);
|
|
1019
1391
|
view.appendChild(scroll);
|
|
1392
|
+
renderNotice(body);
|
|
1020
1393
|
|
|
1021
1394
|
if (state.loading && !state.list) renderLoading(body);
|
|
1022
1395
|
else if (state.error && !state.list) {
|
|
@@ -1031,12 +1404,21 @@ window.__ModuleLoader__.load({
|
|
|
1031
1404
|
}
|
|
1032
1405
|
|
|
1033
1406
|
function mountPanel() {
|
|
1407
|
+
// Floating drawer anchored to the sidebar's right edge (the original
|
|
1408
|
+
// presentation); the ink restyle only changed the surface, not the mode.
|
|
1034
1409
|
var view = document.createElement("div");
|
|
1035
1410
|
view.setAttribute("data-dsh-reasoning-view", "");
|
|
1411
|
+
// Inline fallbacks keep the drawer fixed even if the injected
|
|
1412
|
+
// stylesheet is lost (HMR half-swap or external CSS interference).
|
|
1413
|
+
view.style.position = "fixed";
|
|
1414
|
+
view.style.zIndex = "10000";
|
|
1415
|
+
view.style.top = "0";
|
|
1416
|
+
view.style.left = "-100000px";
|
|
1417
|
+
view.style.display = "none";
|
|
1036
1418
|
document.body.appendChild(view);
|
|
1419
|
+
|
|
1037
1420
|
var sidebar;
|
|
1038
1421
|
var sidebarObserver = typeof ResizeObserver === "function" ? new ResizeObserver(syncBounds) : null;
|
|
1039
|
-
var unsubscribeRender = subscribe(renderPanel);
|
|
1040
1422
|
|
|
1041
1423
|
function syncBounds() {
|
|
1042
1424
|
var next = document.querySelector('[data-pane="sidebar"], [class*="sidebarCol"]');
|
|
@@ -1045,7 +1427,14 @@ window.__ModuleLoader__.load({
|
|
|
1045
1427
|
sidebar = next || undefined;
|
|
1046
1428
|
if (sidebarObserver && sidebar) sidebarObserver.observe(sidebar);
|
|
1047
1429
|
}
|
|
1048
|
-
if (!sidebar)
|
|
1430
|
+
if (!sidebar) {
|
|
1431
|
+
var fallbackWidth = Math.min(420, Math.max(300, window.innerWidth - 16));
|
|
1432
|
+
view.style.left = Math.max(8, window.innerWidth - fallbackWidth - 8) + "px";
|
|
1433
|
+
view.style.top = "8px";
|
|
1434
|
+
view.style.width = fallbackWidth + "px";
|
|
1435
|
+
view.style.height = Math.max(220, window.innerHeight - 16) + "px";
|
|
1436
|
+
return;
|
|
1437
|
+
}
|
|
1049
1438
|
var rect = sidebar.getBoundingClientRect();
|
|
1050
1439
|
var width = Math.min(420, Math.max(300, window.innerWidth - rect.right - 16));
|
|
1051
1440
|
var left = Math.min(rect.right + 8, window.innerWidth - width - 8);
|
|
@@ -1057,14 +1446,16 @@ window.__ModuleLoader__.load({
|
|
|
1057
1446
|
|
|
1058
1447
|
function syncOpen() {
|
|
1059
1448
|
syncBounds();
|
|
1449
|
+
view.style.display = state.open ? "flex" : "none";
|
|
1060
1450
|
view.toggleAttribute("data-open", state.open);
|
|
1061
1451
|
}
|
|
1062
1452
|
|
|
1453
|
+
var unsubscribeRender = subscribe(renderPanel);
|
|
1063
1454
|
var unsubscribeOpen = subscribe(syncOpen);
|
|
1064
1455
|
var observer = new MutationObserver(syncBounds);
|
|
1065
1456
|
observer.observe(document.body, { childList: true, subtree: true });
|
|
1066
1457
|
window.addEventListener("resize", syncBounds);
|
|
1067
|
-
|
|
1458
|
+
syncOpen();
|
|
1068
1459
|
|
|
1069
1460
|
return function () {
|
|
1070
1461
|
observer.disconnect();
|
|
@@ -1081,17 +1472,28 @@ window.__ModuleLoader__.load({
|
|
|
1081
1472
|
function onPanelOpen(event) {
|
|
1082
1473
|
if (event && event.detail && event.detail.panel !== PANEL_ID && state.open) setOpen(false, false);
|
|
1083
1474
|
}
|
|
1475
|
+
// ssh / task-board announce on `document` via dsh-panel-activate.
|
|
1476
|
+
function onSiblingActivate(event) {
|
|
1477
|
+
if (event && typeof event.detail === "string" && event.detail !== PANEL_ID && state.open) setOpen(false, false);
|
|
1478
|
+
}
|
|
1084
1479
|
window.addEventListener(PANEL_EVENT, onPanelOpen);
|
|
1085
|
-
|
|
1480
|
+
document.addEventListener("dsh-panel-activate", onSiblingActivate);
|
|
1481
|
+
return function () {
|
|
1482
|
+
window.removeEventListener(PANEL_EVENT, onPanelOpen);
|
|
1483
|
+
document.removeEventListener("dsh-panel-activate", onSiblingActivate);
|
|
1484
|
+
};
|
|
1086
1485
|
}
|
|
1087
1486
|
|
|
1088
1487
|
function mountSidebarAutoClose() {
|
|
1488
|
+
// Clicking any sidebar row (a session, a project, new chat) returns the
|
|
1489
|
+
// user to the conversation; the take-over view must yield.
|
|
1490
|
+
var SIDEBAR_ROW_SELECTOR = '[class*="sessionRow"], [class*="projectRow"], [class*="searchResultRow"], [class*="searchResultWorkspace"], [class*="newSession"]';
|
|
1089
1491
|
function onClick(event) {
|
|
1090
1492
|
if (!state.open) return;
|
|
1091
1493
|
var target = event.target;
|
|
1092
1494
|
if (!(target instanceof Element)) return;
|
|
1093
1495
|
if (target.closest("[data-dsh-reasoning-entry], [data-dsh-reasoning-view]")) return;
|
|
1094
|
-
setOpen(false);
|
|
1496
|
+
if (target.closest(SIDEBAR_ROW_SELECTOR)) setOpen(false, false);
|
|
1095
1497
|
}
|
|
1096
1498
|
function onKeydown(event) {
|
|
1097
1499
|
if (state.open && event.key === "Escape") {
|
|
@@ -1114,8 +1516,8 @@ window.__ModuleLoader__.load({
|
|
|
1114
1516
|
title: "思考强度配置",
|
|
1115
1517
|
"aria-label": "思考强度",
|
|
1116
1518
|
}, [
|
|
1117
|
-
el("span", { html: icons.brain }),
|
|
1118
|
-
el("span", {
|
|
1519
|
+
el("span", { "data-dsh-reasoning-entry-icon": "", html: icons.brain }),
|
|
1520
|
+
el("span", { "data-dsh-reasoning-entry-label": "", text: "思考强度" }),
|
|
1119
1521
|
]);
|
|
1120
1522
|
entry.addEventListener("click", function () {
|
|
1121
1523
|
toggle();
|
|
@@ -1222,7 +1624,9 @@ window.__ModuleLoader__.load({
|
|
|
1222
1624
|
}
|
|
1223
1625
|
|
|
1224
1626
|
exports.apply = apply;
|
|
1225
|
-
|
|
1627
|
+
// The catalog sync is optional; do not block the sidebar UI on it.
|
|
1628
|
+
// attachConversationSync() waits for modelDirectories independently.
|
|
1629
|
+
exports.inject = [];
|
|
1226
1630
|
return module.exports;
|
|
1227
1631
|
},
|
|
1228
1632
|
});
|