dsh-llm-verifier 0.1.2 → 0.1.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/lib/client.js CHANGED
@@ -10,46 +10,87 @@ window.__ModuleLoader__.load({
10
10
  //#region src/client.tsx
11
11
  const NS = "llm-verifier";
12
12
  const shell = {
13
+ width: "100%",
14
+ maxWidth: 720,
13
15
  display: "flex",
14
16
  flexDirection: "column",
15
- gap: 18,
16
- padding: "8px 4px 32px",
17
- color: "var(--dsw-text-primary)"
17
+ gap: 12,
18
+ padding: "0 0 32px",
19
+ color: "var(--dsw-alias-label-primary)"
20
+ };
21
+ const settingsHeading = {
22
+ margin: 0,
23
+ fontSize: 16,
24
+ fontWeight: 500,
25
+ lineHeight: "24px",
26
+ color: "var(--dsw-alias-label-primary)"
27
+ };
28
+ const settingsIntro = {
29
+ margin: 0,
30
+ fontSize: 14,
31
+ lineHeight: "22px",
32
+ color: "var(--dsw-alias-label-tertiary)"
18
33
  };
19
- const card = {
34
+ const group = {
35
+ width: "100%",
20
36
  display: "flex",
21
37
  flexDirection: "column",
22
- gap: 0,
23
- padding: "16px 16px 0",
24
- border: "1px solid var(--dsw-alias-border-l2, rgba(255, 255, 255, 0.16))",
25
- borderRadius: 12,
26
- background: "var(--dsw-alias-bg-module, rgba(20, 31, 57, 0.42))",
27
- overflow: "hidden"
38
+ borderTop: "1px solid var(--dsw-alias-border-l2)"
28
39
  };
29
- const sectionTitle = {
30
- display: "flex",
31
- gap: 10,
32
- alignItems: "center",
33
- padding: "0 0 12px",
34
- borderBottom: "1px solid var(--dsw-alias-border-l2, rgba(255, 255, 255, 0.16))"
40
+ const groupTitle = {
41
+ margin: 0,
42
+ padding: "18px 0 8px",
43
+ fontSize: 14,
44
+ fontWeight: 500,
45
+ lineHeight: "22px",
46
+ color: "var(--dsw-alias-label-primary)"
35
47
  };
36
48
  const row = {
49
+ minHeight: 64,
37
50
  display: "grid",
38
- gridTemplateColumns: "minmax(150px, 1fr) minmax(220px, 1.4fr)",
39
- gap: 18,
51
+ gridTemplateColumns: "minmax(180px, 1fr) minmax(230px, 288px)",
52
+ gap: 24,
40
53
  alignItems: "center",
41
- padding: "14px 0",
42
- borderBottom: "1px solid var(--dsw-alias-border-l2, rgba(255, 255, 255, 0.16))"
54
+ padding: "12px 0",
55
+ borderBottom: "1px solid var(--dsw-alias-border-l2)"
43
56
  };
44
57
  const selectStyle = {
58
+ boxSizing: "border-box",
45
59
  width: "100%",
46
- minHeight: 38,
47
- padding: "0 12px",
48
- borderRadius: 10,
49
- color: "var(--dsw-text-primary)",
50
- background: "var(--dsw-surface-sunken)",
51
- border: "1px solid var(--dsw-alias-border-l2, rgba(255, 255, 255, 0.16))"
60
+ height: 36,
61
+ padding: "0 34px 0 12px",
62
+ borderRadius: 8,
63
+ color: "var(--dsw-alias-label-primary)",
64
+ background: "var(--dsw-alias-bg-input)",
65
+ border: "1px solid var(--dsw-alias-border-l2)",
66
+ font: "inherit",
67
+ fontSize: 14,
68
+ lineHeight: "22px",
69
+ outline: "none"
52
70
  };
71
+ const toggleStyle = (enabled) => ({
72
+ position: "relative",
73
+ justifySelf: "end",
74
+ width: 40,
75
+ height: 22,
76
+ padding: 0,
77
+ border: 0,
78
+ borderRadius: 999,
79
+ cursor: "pointer",
80
+ transition: "background .15s ease",
81
+ background: enabled ? "var(--dsw-alias-state-success-primary)" : "var(--dsw-alias-bg-input)"
82
+ });
83
+ const toggleThumbStyle = (enabled) => ({
84
+ position: "absolute",
85
+ top: 3,
86
+ left: enabled ? 21 : 3,
87
+ width: 16,
88
+ height: 16,
89
+ borderRadius: "50%",
90
+ background: "var(--dsw-static-neutral-00, #fff)",
91
+ boxShadow: "0 1px 3px rgba(0,0,0,.28)",
92
+ transition: "left .15s ease"
93
+ });
53
94
  const dashboardCard = {
54
95
  border: "1px solid var(--dsw-alias-border-l2, rgba(255,255,255,.13))",
55
96
  background: "color-mix(in srgb, var(--dsw-alias-bg-module, #171925) 88%, transparent)",
@@ -77,8 +118,16 @@ window.__ModuleLoader__.load({
77
118
  }
78
119
  function values(view) {
79
120
  const v = record(view.value);
121
+ const mode = v.autoVerifyMode === "manual" || v.autoVerifyMode === "strict" ? v.autoVerifyMode : "smart";
80
122
  return {
81
123
  enabled: v.enabled !== false,
124
+ autoVerifyMode: mode,
125
+ autoVerifyThreshold: Number(v.autoVerifyThreshold ?? .65),
126
+ autoVerifyRepeats: Number(v.autoVerifyRepeats ?? 1),
127
+ autoVerifyMinToolCalls: Number(v.autoVerifyMinToolCalls ?? 3),
128
+ autoVerifyMaxChars: Number(v.autoVerifyMaxChars ?? 8e4),
129
+ autoVerifyMaxPerTask: Number(v.autoVerifyMaxPerTask ?? 2),
130
+ autoVerifyMaxPerSession: Number(v.autoVerifyMaxPerSession ?? 8),
82
131
  provider: String(v.provider ?? ""),
83
132
  model: String(v.model ?? ""),
84
133
  ...typeof v.reasoningEffort === "string" ? { reasoningEffort: v.reasoningEffort } : {},
@@ -95,17 +144,32 @@ window.__ModuleLoader__.load({
95
144
  return error instanceof Error ? error.message : String(error);
96
145
  }
97
146
  function Label({ title, help }) {
98
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
99
- style: { fontWeight: 600 },
100
- children: title
101
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
102
- style: {
103
- fontSize: 12,
104
- color: "var(--dsw-text-secondary)",
105
- marginTop: 3
106
- },
107
- children: help
108
- })] });
147
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
148
+ style: { minWidth: 0 },
149
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
150
+ style: {
151
+ fontSize: 14,
152
+ fontWeight: 400,
153
+ lineHeight: "22px",
154
+ color: "var(--dsw-alias-label-primary)"
155
+ },
156
+ children: title
157
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
158
+ style: {
159
+ fontSize: 12,
160
+ lineHeight: "18px",
161
+ color: "var(--dsw-alias-label-tertiary)",
162
+ marginTop: 2
163
+ },
164
+ children: help
165
+ })]
166
+ });
167
+ }
168
+ function GroupTitle({ children }) {
169
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
170
+ style: groupTitle,
171
+ children
172
+ });
109
173
  }
110
174
  function compact(value) {
111
175
  return new Intl.NumberFormat("zh-CN", {
@@ -212,15 +276,27 @@ window.__ModuleLoader__.load({
212
276
  if (!loaded || !draft) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
213
277
  style: shell,
214
278
  children: [
215
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", { children: "LLM Verifier" }),
216
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: error ?? "正在读取 DSH 模型和设置…" }),
217
- error && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
279
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", {
280
+ style: settingsHeading,
281
+ children: "LLM Verifier"
282
+ }),
283
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
284
+ style: settingsIntro,
285
+ children: error ?? "正在读取 DSH 模型和设置…"
286
+ }),
287
+ error && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
288
+ variant: "outline",
218
289
  onClick: () => void load(),
219
290
  children: "重试"
220
- })
291
+ }) })
221
292
  ]
222
293
  });
223
294
  const numeric = (key, min = 0) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Input, {
295
+ style: {
296
+ width: "100%",
297
+ height: 36,
298
+ borderRadius: 8
299
+ },
224
300
  type: "number",
225
301
  min,
226
302
  value: String(draft[key]),
@@ -229,66 +305,135 @@ window.__ModuleLoader__.load({
229
305
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
230
306
  style: shell,
231
307
  children: [
232
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", {
233
- style: { margin: "0 0 6px" },
308
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", {
309
+ style: settingsHeading,
234
310
  children: "LLM Verifier"
235
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
236
- style: {
237
- margin: 0,
238
- color: "var(--dsw-text-secondary)"
239
- },
240
- children: "选择任意已在 DSH「模型」页配置并启用的模型作为独立裁判。设置实时生效。"
241
- })] }),
242
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
243
- style: card,
311
+ }),
312
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
313
+ style: settingsIntro,
314
+ children: "选择已在 DSH「模型」中配置的模型作为独立裁判。修改后点击页面底部的保存按钮生效。"
315
+ }),
316
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
317
+ style: group,
244
318
  children: [
245
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
246
- style: sectionTitle,
247
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.StateDot, { state: draft.enabled ? "done" : "error" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: "工具开关" })]
248
- }),
319
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(GroupTitle, { children: "工具" }),
249
320
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
250
321
  style: row,
251
322
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Label, {
252
323
  title: "启用 Verifier 工具",
253
- help: draft.enabled ? "四个 verifier 工具可被 Agent 调用,每次调用会向裁判模型发起请求。" : "已停用:Agent 调用 verifier 工具会立即返回错误,不产生任何模型请求。"
324
+ help: draft.enabled ? "允许 Agent 调用四个 verifier 工具并向裁判模型发起请求。" : "停用后,所有 verifier 工具都会立即返回错误。"
254
325
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
326
+ type: "button",
327
+ role: "switch",
328
+ "aria-checked": draft.enabled,
329
+ "aria-label": "启用 Verifier 工具",
255
330
  onClick: () => patch("enabled", !draft.enabled),
256
- style: {
257
- width: 80,
258
- height: 32,
259
- borderRadius: 16,
260
- border: "1px solid var(--dsw-alias-border-l2, rgba(255,255,255,0.16))",
261
- background: draft.enabled ? "var(--dsw-success, #2f9e5b)" : "var(--dsw-surface-sunken)",
262
- color: "#fff",
263
- cursor: "pointer",
264
- fontSize: 13,
265
- fontWeight: 600
266
- },
267
- children: draft.enabled ? "已启用" : "已停用"
331
+ style: toggleStyle(draft.enabled),
332
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { style: toggleThumbStyle(draft.enabled) })
268
333
  })]
269
334
  }),
270
- !draft.enabled && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
335
+ !draft.enabled && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
271
336
  style: {
272
- padding: "0 0 14px",
337
+ margin: "8px 0 0",
273
338
  fontSize: 12,
274
- color: "var(--dsw-state-warn-primary, #d9a441)"
339
+ lineHeight: "18px",
340
+ color: "var(--dsw-alias-state-warn-label)"
275
341
  },
276
- children: "⚠ 当前停用 verifier_compare / verifier_select / verifier_track / verifier_current_session 四个工具"
342
+ children: "verifier_compare、verifier_select、verifier_track 和 verifier_current_session 当前不可用。"
277
343
  })
278
344
  ]
279
345
  }),
280
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
281
- style: card,
346
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
347
+ style: group,
282
348
  children: [
349
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(GroupTitle, { children: "自动验收" }),
350
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
351
+ style: row,
352
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Label, {
353
+ title: "调用策略",
354
+ help: "手动仅暴露工具;智能在复杂且有真实证据的任务结束前验收;严格对任何已完成的写入、执行或远程操作进行验收。"
355
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
356
+ style: selectStyle,
357
+ value: draft.autoVerifyMode,
358
+ onChange: (e) => patch("autoVerifyMode", e.target.value),
359
+ children: [
360
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
361
+ value: "manual",
362
+ children: "手动"
363
+ }),
364
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
365
+ value: "smart",
366
+ children: "智能(推荐)"
367
+ }),
368
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
369
+ value: "strict",
370
+ children: "严格"
371
+ })
372
+ ]
373
+ })]
374
+ }),
283
375
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
284
- style: sectionTitle,
285
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.StateDot, { state: "done" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: "裁判模型" })]
376
+ style: row,
377
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Label, {
378
+ title: "通过阈值",
379
+ help: "会话证据分数达到该值且胜过空工作基线才允许结束;范围 0–1。"
380
+ }), numeric("autoVerifyThreshold", 0)]
286
381
  }),
382
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
383
+ style: row,
384
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Label, {
385
+ title: "自动评估轮次",
386
+ help: "每项标准的自动评分重复次数;1 为低成本初筛。"
387
+ }), numeric("autoVerifyRepeats", 1)]
388
+ }),
389
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
390
+ style: row,
391
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Label, {
392
+ title: "智能模式最少工具调用",
393
+ help: "达到此工具证据数量且包含写入/执行类操作时才自动验收。"
394
+ }), numeric("autoVerifyMinToolCalls", 1)]
395
+ }),
396
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
397
+ style: row,
398
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Label, {
399
+ title: "最大证据字符",
400
+ help: "发送给裁判前保留的最近会话证据字符数。"
401
+ }), numeric("autoVerifyMaxChars", 1e3)]
402
+ }),
403
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
404
+ style: row,
405
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Label, {
406
+ title: "每任务最多验收",
407
+ help: "低分反馈后允许再次验收的次数上限,防止循环。"
408
+ }), numeric("autoVerifyMaxPerTask", 1)]
409
+ }),
410
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
411
+ style: row,
412
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Label, {
413
+ title: "每会话最多验收",
414
+ help: "同一会话中的自动验收总预算。"
415
+ }), numeric("autoVerifyMaxPerSession", 1)]
416
+ }),
417
+ draft.autoVerifyMode !== "manual" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
418
+ style: {
419
+ margin: "8px 0 0",
420
+ fontSize: 12,
421
+ lineHeight: "18px",
422
+ color: "var(--dsw-alias-state-warn-label)"
423
+ },
424
+ children: "自动验收会将脱敏后的任务、Assistant 轨迹与真实工具输出发送给所选裁判模型;未通过时会自动要求 Agent 修复并重新验证。"
425
+ })
426
+ ]
427
+ }),
428
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
429
+ style: group,
430
+ children: [
431
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(GroupTitle, { children: "裁判模型" }),
287
432
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
288
433
  style: row,
289
434
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Label, {
290
435
  title: "供应商",
291
- help: "只显示当前 DSH 中可路由的供应商"
436
+ help: "当前 DSH 中可路由的模型供应商。"
292
437
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("select", {
293
438
  style: selectStyle,
294
439
  value: draft.provider,
@@ -318,7 +463,7 @@ window.__ModuleLoader__.load({
318
463
  style: row,
319
464
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Label, {
320
465
  title: "模型",
321
- help: "模型目录来自 DSH adapter,选择结果会持久化"
466
+ help: "用作裁判的具体模型。"
322
467
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("select", {
323
468
  style: selectStyle,
324
469
  value: draft.model,
@@ -345,7 +490,7 @@ window.__ModuleLoader__.load({
345
490
  style: row,
346
491
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Label, {
347
492
  title: "推理强度",
348
- help: "由所选模型 adapter 声明;留空使用模型默认值"
493
+ help: "留空时使用所选模型的默认值。"
349
494
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
350
495
  style: selectStyle,
351
496
  value: draft.reasoningEffort ?? "",
@@ -363,101 +508,117 @@ window.__ModuleLoader__.load({
363
508
  style: row,
364
509
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Label, {
365
510
  title: "最大输出 Token",
366
- help: "每个裁判请求的输出上限"
511
+ help: "单次裁判请求允许生成的最大 Token 数。"
367
512
  }), numeric("maxTokens", 1)]
368
513
  })
369
514
  ]
370
515
  }),
371
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
372
- style: card,
516
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
517
+ style: group,
373
518
  children: [
374
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
375
- style: sectionTitle,
376
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: "执行控制" })
377
- }),
519
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(GroupTitle, { children: "执行" }),
378
520
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
379
521
  style: row,
380
522
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Label, {
381
523
  title: "最大并发",
382
- help: "所有 verifier 工具共享的请求并发上限"
524
+ help: "所有 verifier 工具共享的请求并发上限。"
383
525
  }), numeric("maxConcurrency", 1)]
384
526
  }),
385
527
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
386
528
  style: row,
387
529
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Label, {
388
530
  title: "最多重试",
389
- help: "短暂网络、限流和服务端错误的重试次数"
531
+ help: "限流、超时和短暂网络错误的重试次数。"
390
532
  }), numeric("maxRetries", 0)]
391
533
  }),
392
534
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
393
535
  style: row,
394
536
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Label, {
395
- title: "请求超时(毫秒)",
396
- help: "单个模型请求的超时时间"
537
+ title: "请求超时",
538
+ help: "单次模型请求的超时时间,单位为毫秒。"
397
539
  }), numeric("timeoutMs", 1)]
398
540
  }),
399
541
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
400
542
  style: row,
401
543
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Label, {
402
544
  title: "缓存条目上限",
403
- help: "持久评分缓存保留的最大条目数"
545
+ help: "本地持久评分缓存保留的最大条目数。"
404
546
  }), numeric("cacheMaxEntries", 1)]
405
547
  })
406
548
  ]
407
549
  }),
408
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
409
- style: card,
550
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
551
+ style: group,
410
552
  children: [
411
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
412
- style: sectionTitle,
413
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: "费用估算(每百万 Token,USD)" })
414
- }),
553
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(GroupTitle, { children: "费用估算" }),
415
554
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
416
555
  style: row,
417
556
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Label, {
418
557
  title: "输入价格",
419
- help: "仅用于结果中的 estimatedCostUsd"
558
+ help: "每百万输入 Token 的美元价格,仅用于统计估算。"
420
559
  }), numeric("estimatedInputUsdPerMillion", 0)]
421
560
  }),
422
561
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
423
562
  style: row,
424
563
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Label, {
425
564
  title: "输出价格",
426
- help: "仅用于结果中的 estimatedCostUsd"
565
+ help: "每百万输出 Token 的美元价格,仅用于统计估算。"
427
566
  }), numeric("estimatedOutputUsdPerMillion", 0)]
428
567
  })
429
568
  ]
430
569
  }),
431
570
  loaded.failures.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
432
571
  style: {
433
- ...card,
434
- borderColor: "var(--dsw-alias-state-warn-primary, #d9a441)",
435
- paddingBottom: 16
572
+ padding: "10px 12px",
573
+ borderRadius: 8,
574
+ background: "var(--dsw-alias-state-warn-bg)",
575
+ color: "var(--dsw-alias-state-warn-label)",
576
+ fontSize: 12,
577
+ lineHeight: "18px"
436
578
  },
437
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: "部分模型目录读取失败" }), loaded.failures.map((x) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: x }, x))]
579
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
580
+ style: {
581
+ fontWeight: 500,
582
+ marginBottom: 3
583
+ },
584
+ children: "部分模型目录读取失败"
585
+ }), loaded.failures.map((x) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: x }, x))]
438
586
  }),
439
- error && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
440
- style: { color: "var(--dsw-danger)" },
587
+ error && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
588
+ style: {
589
+ margin: 0,
590
+ fontSize: 12,
591
+ lineHeight: "18px",
592
+ color: "var(--dsw-alias-state-error-primary)"
593
+ },
441
594
  children: error
442
595
  }),
443
- saved && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
444
- style: { color: "var(--dsw-success)" },
445
- children: "已保存,后续 verifier 调用将使用新设置。"
596
+ saved && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
597
+ style: {
598
+ margin: 0,
599
+ fontSize: 12,
600
+ lineHeight: "18px",
601
+ color: "var(--dsw-alias-state-success-primary)"
602
+ },
603
+ children: "设置已保存。"
446
604
  }),
447
605
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
448
606
  style: {
449
607
  display: "flex",
450
- gap: 10
608
+ justifyContent: "flex-end",
609
+ gap: 8,
610
+ paddingTop: 4
451
611
  },
452
612
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
453
- disabled: busy || !loaded.writable,
454
- onClick: () => void save(),
455
- children: busy ? "保存中…" : "保存设置"
456
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
457
613
  variant: "outline",
458
614
  disabled: busy,
459
615
  onClick: () => void load(),
460
616
  children: "重新载入"
617
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
618
+ variant: "primary",
619
+ disabled: busy || !loaded.writable,
620
+ onClick: () => void save(),
621
+ children: busy ? "保存中…" : "保存设置"
461
622
  })]
462
623
  })
463
624
  ]