dsh-livebench-panel 0.1.21 → 0.2.1

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/lib/client.js CHANGED
@@ -489,7 +489,10 @@ window.__ModuleLoader__.load({
489
489
  disabled: busy || !config?.available || sel.models.length === 0,
490
490
  }, `开始评测(${sel.models.length} 个模型并发)`),
491
491
  running && h("button", { className: c("btn") + " " + c("btnDanger") + " " + c("btnBar"), onClick: onStop }, "停止全部"),
492
- h("button", { className: c("btnGhost") + " " + c("btn") + " " + c("btnBar"), onClick: () => { loadConfig(); loadResults(); } }, "刷新"),
492
+ h("button", { className: c("btnGhost") + " " + c("btn") + " " + c("btnBar"), onClick: async () => {
493
+ try { await api("/clear", { method: "POST" }); } catch { /* ignore */ }
494
+ loadConfig(); loadResults(); refreshStatus();
495
+ } }, "刷新"),
493
496
  ),
494
497
  startError !== null && h("p", { className: c("error") }, startError),
495
498
  ),
package/lib/index.js CHANGED
@@ -103,7 +103,7 @@ const RELEASES = [
103
103
  /** Sane cap so a runaway run cannot eat memory with its log. */
104
104
  const LOG_MAX_LINES = 600;
105
105
  /** One evaluation at a time per model, but several models may run concurrently. */
106
- const MAX_CONCURRENT_RUNS = 6;
106
+ const MAX_CONCURRENT_RUNS = 9;
107
107
 
108
108
  /** Resolve the profile directory from the config-tree anchor (plugin-market pattern). */
109
109
  function resolveProfileDir(ctx) {
@@ -875,6 +875,26 @@ function apply(ctx) {
875
875
  },
876
876
  }), `${name}: stop route`);
877
877
 
878
+ ctx.effect(() => ctx.webServer.register({
879
+ kind: "exact",
880
+ path: `${API}/clear`,
881
+ handler: async (req, res) => {
882
+ if (req.method !== "POST") {
883
+ sendJson(res, 405, { ok: false, error: "method not allowed" });
884
+ return;
885
+ }
886
+ if (!originAllowed(req)) {
887
+ sendJson(res, 403, { ok: false, error: "forbidden origin" });
888
+ return;
889
+ }
890
+ let removed = 0;
891
+ for (const [id, r] of [...runs]) {
892
+ if (r.exitCode !== null) { runs.delete(id); removed += 1; }
893
+ }
894
+ sendJson(res, 200, { ok: true, removed });
895
+ },
896
+ }), `${name}: clear route`);
897
+
878
898
  ctx.effect(() => ctx.webServer.register({
879
899
  kind: "exact",
880
900
  path: `${API}/results`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-livebench-panel",
3
- "version": "0.1.21",
3
+ "version": "0.2.1",
4
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
5
  "license": "MIT",
6
6
  "type": "module",