dsh-livebench-panel 0.1.12 → 0.1.14

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.
Files changed (2) hide show
  1. package/lib/client.js +35 -40
  2. package/package.json +43 -43
package/lib/client.js CHANGED
@@ -92,7 +92,7 @@ window.__ModuleLoader__.load({
92
92
  function LiveBenchView() {
93
93
  const [config, setConfig] = useState(null);
94
94
  const [configError, setConfigError] = useState(null);
95
- const [sel, setSel] = useState({ models: [], reasoning: "default", cats: [], tasks: [], release: "2024-11-25", begin: "", end: "", maxTokens: "32000" });
95
+ const [sel, setSel] = useState({ models: [], efforts: {}, cats: [], tasks: [], release: "2024-11-25", begin: "", end: "", maxTokens: "32000" });
96
96
  const [modelDdOpen, setModelDdOpen] = useState(false);
97
97
  const modelDdRef = useRef(null);
98
98
  const [busy, setBusy] = useState(false);
@@ -171,10 +171,6 @@ window.__ModuleLoader__.load({
171
171
  return () => clearInterval(timer);
172
172
  }, [refreshStatus, loadResults]);
173
173
 
174
- useEffect(() => {
175
- if (logRef.current) logRef.current.scrollTop = logRef.current.scrollHeight;
176
- }, [log]);
177
-
178
174
  const categories = useMemo(() => (config ? Object.keys(config.tasks) : []), [config]);
179
175
  // 有效题数:LiveBench 会丢弃「发布晚于所选 release」和「在所选 release
180
176
  // 前已退役」的题目,这里按题目桶 (发布日, 移除日) 精确复算。
@@ -203,24 +199,14 @@ window.__ModuleLoader__.load({
203
199
  const next = list.includes(value) ? list.filter((v) => v !== value) : [...list, value];
204
200
  return { ...prev, [key]: next };
205
201
  });
206
- // 已选模型(provider::model 值列表)的解析与 effort 并集
202
+ // 已选模型(provider::model 值列表)的解析与 per-model effort
207
203
  const selectedModelEntries = useMemo(() => sel.models.map((value) => {
208
204
  const [pid, ...rest] = value.split("::");
209
205
  const mid = rest.join("::");
210
206
  const provider = config?.providers.find((p) => p.id === pid) ?? null;
211
207
  const model = provider?.models.find((m) => m.id === mid) ?? null;
212
- return { providerId: pid, modelId: mid, efforts: model?.efforts ?? [] };
208
+ return { providerId: pid, modelId: mid, modelValue: value, efforts: model?.efforts ?? [] };
213
209
  }).filter((entry) => entry.modelId !== ""), [sel.models, config]);
214
- const effortOptions = useMemo(() => {
215
- const seen = new Set();
216
- const union = [];
217
- for (const entry of selectedModelEntries) {
218
- for (const e of entry.efforts) {
219
- if (!seen.has(e)) { seen.add(e); union.push({ value: e, label: e === "off" ? "off(关闭思考)" : e }); }
220
- }
221
- }
222
- return union;
223
- }, [selectedModelEntries]);
224
210
 
225
211
  const onStart = async () => {
226
212
  setStartError(null);
@@ -243,7 +229,8 @@ window.__ModuleLoader__.load({
243
229
  }
244
230
  setBusy(true);
245
231
  try {
246
- // 每个 selected 模型并发启动一个评测(服务端有并发上限保护)
232
+ // 每个 selected 模型并发启动一个评测(服务端有并发上限保护),
233
+ // 推理强度按各模型在次级下拉中的选择逐个下发
247
234
  const failures = [];
248
235
  const launches = selectedModelEntries.map(async (entry) => {
249
236
  const payload = await api("/start", {
@@ -252,7 +239,7 @@ window.__ModuleLoader__.load({
252
239
  body: JSON.stringify({
253
240
  provider: entry.providerId,
254
241
  model: entry.modelId,
255
- reasoningEffort: sel.reasoning,
242
+ reasoningEffort: sel.efforts[entry.modelValue] ?? "default",
256
243
  benchNames,
257
244
  release: sel.release,
258
245
  begin: sel.begin,
@@ -412,10 +399,8 @@ window.__ModuleLoader__.load({
412
399
  : `已选 ${sel.models.length} 个模型`),
413
400
  modelDdOpen && h("div", {
414
401
  style: {
415
- position: "absolute", zIndex: 30, top: "calc(100% + 4px)", left: 0, right: 0,
416
- maxHeight: "320px", overflowY: "auto", border: "1px solid var(--dsw-alias-border-l2)",
402
+ marginTop: "6px", maxHeight: "340px", overflowY: "auto", border: "1px solid var(--dsw-alias-border-l2)",
417
403
  borderRadius: "8px", background: "var(--dsw-alias-bg-layer-1)", padding: "6px",
418
- boxShadow: "var(--dsw-shadow-lv1, 0 4px 16px rgba(0,0,0,.25))",
419
404
  },
420
405
  },
421
406
  (config?.providers ?? []).map((p) => h("div", { key: p.id, style: { marginBottom: "4px" } },
@@ -424,26 +409,36 @@ window.__ModuleLoader__.load({
424
409
  p.models.map((m) => {
425
410
  const value = p.id + "::" + m.id;
426
411
  const checked = sel.models.includes(value);
427
- return h("label", {
428
- key: value,
429
- style: { display: "flex", alignItems: "center", gap: "6px", padding: "3px 4px", cursor: "pointer", borderRadius: "6px" },
430
- },
431
- h("input", { type: "checkbox", checked, onChange: () => {
432
- setSel((prev) => {
433
- const set = new Set(prev.models);
434
- if (set.has(value)) set.delete(value); else set.add(value);
435
- return { ...prev, models: [...set] };
436
- });
437
- } }),
438
- h("span", { style: { fontSize: "12.5px" } }, m.name));
412
+ return h("div", { key: value, style: { borderBottom: "1px solid var(--dsw-alias-border-l2)", padding: "3px 4px" } },
413
+ h("div", {
414
+ style: { display: "flex", alignItems: "center", gap: "8px", cursor: "pointer" },
415
+ onClick: () => {
416
+ setSel((prev) => {
417
+ const set = new Set(prev.models);
418
+ const nextEfforts = { ...prev.efforts };
419
+ if (set.has(value)) { set.delete(value); delete nextEfforts[value]; }
420
+ else set.add(value);
421
+ return { ...prev, models: [...set], efforts: nextEfforts };
422
+ });
423
+ },
424
+ },
425
+ h("input", { type: "checkbox", checked, readOnly: true, style: { cursor: "pointer" } }),
426
+ h("span", { style: { fontSize: "12.5px", flex: 1 } }, m.name)),
427
+ checked && m.efforts.length > 0 && h("div", { style: { display: "flex", alignItems: "center", gap: "6px", padding: "4px 0 2px 26px" } },
428
+ h("span", { style: { fontSize: "11px", color: "var(--dsw-alias-label-tertiary)", whiteSpace: "nowrap" } }, "推理强度"),
429
+ h("select", {
430
+ className: c("select"), style: { height: "28px", fontSize: "12px", flex: 1 },
431
+ value: sel.efforts[value] ?? "default",
432
+ onClick: (event) => event.stopPropagation(),
433
+ onChange: (event) => {
434
+ const v = event.target.value;
435
+ setSel((prev) => ({ ...prev, efforts: { ...prev.efforts, [value]: v } }));
436
+ },
437
+ },
438
+ h("option", { value: "default" }, "(模型默认)"),
439
+ m.efforts.map((e) => h("option", { key: e, value: e }, e === "off" ? "off(关闭思考)" : e)))));
439
440
  }))),
440
441
  ),
441
- h("div", { className: c("field") },
442
- h("label", { className: c("label") }, "推理强度"),
443
- h("select", { className: c("select"), value: sel.reasoning, onChange: setField("reasoning"), disabled: effortOptions.length === 0 },
444
- h("option", { value: "default" }, effortOptions.length === 0 ? "(按模型默认)" : "(模型默认)"),
445
- effortOptions.map((e) => h("option", { key: e.value, value: e.value }, e.label))),
446
- ),
447
442
  h("div", { className: c("field") },
448
443
  h("label", { className: c("label") }, "题集 release"),
449
444
  h("select", { className: c("select"), value: sel.release, onChange: setField("release") },
package/package.json CHANGED
@@ -1,43 +1,43 @@
1
- {
2
- "name": "dsh-livebench-panel",
3
- "version": "0.1.12",
4
- "description": "DSH web plugin: a LiveBench tab in the Trajectory view (right of 对话/轨迹). Run LiveBench evaluations against every model configured in the DeepSeek Harness — pick provider/model, category, task, release and question range from dropdowns, watch progress, and read scores in place.",
5
- "license": "MIT",
6
- "type": "module",
7
- "main": "lib/index.js",
8
- "exports": {
9
- ".": "./lib/index.js",
10
- "./client": "./lib/client.js",
11
- "./cordis.patch.yml": "./cordis.patch.yml",
12
- "./package.json": "./package.json"
13
- },
14
- "engines": {
15
- "node": ">=20"
16
- },
17
- "files": [
18
- "lib",
19
- "cordis.patch.yml",
20
- "README.md"
21
- ],
22
- "keywords": [
23
- "dsh-plugin",
24
- "deepseek-harness",
25
- "livebench",
26
- "benchmark",
27
- "evaluation"
28
- ],
29
- "dsh": {
30
- "bundle": {
31
- "patch": "./cordis.patch.yml"
32
- },
33
- "client": {
34
- "platform": "web",
35
- "inject": [
36
- "@deepseek-ai/dsh-client-runtime",
37
- "@deepseek-ai/dsh-client-locale",
38
- "@deepseek-ai/dsh-client-ui-slots",
39
- "@deepseek-ai/dsh-client-ui-conversation"
40
- ]
41
- }
42
- }
43
- }
1
+ {
2
+ "name": "dsh-livebench-panel",
3
+ "version": "0.1.14",
4
+ "description": "DSH web plugin: a LiveBench tab in the Trajectory view (right of 对话/轨迹). Run LiveBench evaluations against every model configured in the DeepSeek Harness — pick provider/model, category, task, release and question range from dropdowns, watch progress, and read scores in place.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "main": "lib/index.js",
8
+ "exports": {
9
+ ".": "./lib/index.js",
10
+ "./client": "./lib/client.js",
11
+ "./cordis.patch.yml": "./cordis.patch.yml",
12
+ "./package.json": "./package.json"
13
+ },
14
+ "engines": {
15
+ "node": ">=20"
16
+ },
17
+ "files": [
18
+ "lib",
19
+ "cordis.patch.yml",
20
+ "README.md"
21
+ ],
22
+ "keywords": [
23
+ "dsh-plugin",
24
+ "deepseek-harness",
25
+ "livebench",
26
+ "benchmark",
27
+ "evaluation"
28
+ ],
29
+ "dsh": {
30
+ "bundle": {
31
+ "patch": "./cordis.patch.yml"
32
+ },
33
+ "client": {
34
+ "platform": "web",
35
+ "inject": [
36
+ "@deepseek-ai/dsh-client-runtime",
37
+ "@deepseek-ai/dsh-client-locale",
38
+ "@deepseek-ai/dsh-client-ui-slots",
39
+ "@deepseek-ai/dsh-client-ui-conversation"
40
+ ]
41
+ }
42
+ }
43
+ }