@lynn123411/dsh-subagent-judge-dispatch 0.6.6 → 0.6.7

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
@@ -52,10 +52,72 @@ __export(index_exports, {
52
52
  });
53
53
  module.exports = __toCommonJS(index_exports);
54
54
 
55
- // src/client/settings/ui.tsx
55
+ // src/enablement.ts
56
+ var DEFAULT_ENABLED = true;
57
+ var SETTINGS_NAMESPACE = "dsh-subagent-judge-dispatch";
58
+ function enabledFor(overrides, fallback, sessionId) {
59
+ if (sessionId === void 0 || overrides === null || typeof overrides !== "object" || !Object.hasOwn(overrides, sessionId)) return fallback;
60
+ const choice = overrides[sessionId];
61
+ return typeof choice === "boolean" ? choice : fallback;
62
+ }
63
+
64
+ // src/client/SessionToggle.tsx
56
65
  var import_react = require("react");
57
- var React = __toESM(require("react"), 1);
58
66
  var import_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
67
+ var import_jsx_runtime = require("react/jsx-runtime");
68
+ var MODEL_OPTIONS_SLOT = "conversation.input.model.options";
69
+ function SessionToggle(props) {
70
+ const { sessionId, useSession, useSessions } = props;
71
+ const addressedChild = useSession((snapshot) => snapshot.subagent !== null);
72
+ const listedChild = useSessions((state) => state.byId[sessionId]?.origin === "subagent");
73
+ if (addressedChild || listedChild) return null;
74
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RootSessionToggle, { ...props }, sessionId);
75
+ }
76
+ function RootSessionToggle({ sessionId, form, locked, reportFailure, t }) {
77
+ const [snapshot, setSnapshot] = (0, import_react.useState)(() => form.getSnapshot());
78
+ const [pending, setPending] = (0, import_react.useState)(false);
79
+ (0, import_react.useEffect)(() => {
80
+ const sync = () => setSnapshot(form.getSnapshot());
81
+ sync();
82
+ return form.subscribe(sync);
83
+ }, [form]);
84
+ if (snapshot.status !== "ready" || snapshot.value === void 0) return null;
85
+ const fallback = typeof snapshot.value.enabled === "boolean" ? snapshot.value.enabled : DEFAULT_ENABLED;
86
+ const enabled = enabledFor(snapshot.value.sessionOverrides, fallback, sessionId);
87
+ async function select(next) {
88
+ setPending(true);
89
+ try {
90
+ const path = ["sessionOverrides", sessionId];
91
+ const base = snapshot.base;
92
+ const afterUnset = enabledFor(base?.sessionOverrides, fallback, sessionId);
93
+ const accepted = await form.mutate([next === fallback && next === afterUnset ? { op: "unset", path } : { op: "set", path, value: next }]);
94
+ if (!accepted) reportFailure(t("sessionToggle.failed"));
95
+ } catch {
96
+ reportFailure(t("sessionToggle.failed"));
97
+ } finally {
98
+ setSnapshot(form.getSnapshot());
99
+ setPending(false);
100
+ }
101
+ }
102
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-judge-session-toggle", children: [
103
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: t("sessionToggle.label") }),
104
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
105
+ import_dsh_client_ui_primitives.Switch,
106
+ {
107
+ className: "dsh-judge-session-switch",
108
+ checked: enabled,
109
+ disabled: locked || pending || !snapshot.writable,
110
+ label: t("sessionToggle.label"),
111
+ onChange: select
112
+ }
113
+ )
114
+ ] });
115
+ }
116
+
117
+ // src/client/settings/ui.tsx
118
+ var import_react2 = require("react");
119
+ var React = __toESM(require("react"), 1);
120
+ var import_dsh_client_ui_primitives2 = require("@deepseek-ai/dsh-client-ui-primitives");
59
121
 
60
122
  // src/client/settings/plugin-page.ts
61
123
  var BUNDLE_NAME = "@lynn123411/dsh-subagent-judge-dispatch";
@@ -99,7 +161,6 @@ function isSelectableRow(row) {
99
161
  var JUDGE_API_KEY_REF = "SUBAGENT_JUDGE_API_KEY";
100
162
 
101
163
  // src/client/settings/store.ts
102
- var SETTINGS_NAMESPACE = "dsh-subagent-judge-dispatch";
103
164
  var ALLOWED_MODELS_NAMESPACE = "subagent-model-selection-settings";
104
165
  var LOG_ROUTE_PATH = "/api/dsh-subagent-judge-dispatch/log";
105
166
  var PREVIEW_ROUTE_PATH = "/api/dsh-subagent-judge-dispatch/preview";
@@ -313,7 +374,7 @@ var DispatchCardStore = class {
313
374
  state = {
314
375
  available: false,
315
376
  writable: false,
316
- enabled: true,
377
+ enabled: DEFAULT_ENABLED,
317
378
  logEnabled: true,
318
379
  endpointUrl: "",
319
380
  judgeModel: "",
@@ -321,7 +382,7 @@ var DispatchCardStore = class {
321
382
  models: [],
322
383
  catalogRead: false,
323
384
  committed: {
324
- enabled: true,
385
+ enabled: DEFAULT_ENABLED,
325
386
  logEnabled: true,
326
387
  endpointUrl: "",
327
388
  judgeModel: "",
@@ -430,7 +491,7 @@ var DispatchCardStore = class {
430
491
  if (value === void 0) return;
431
492
  const rows = Array.isArray(value.rows) ? value.rows.map(readRow) : [];
432
493
  const committed = {
433
- enabled: typeof value.enabled === "boolean" ? value.enabled : true,
494
+ enabled: typeof value.enabled === "boolean" ? value.enabled : DEFAULT_ENABLED,
434
495
  logEnabled: typeof value.logEnabled === "boolean" ? value.logEnabled : true,
435
496
  endpointUrl: typeof value.endpointUrl === "string" ? value.endpointUrl : "",
436
497
  judgeModel: typeof value.judgeModel === "string" ? value.judgeModel : "",
@@ -547,13 +608,11 @@ var DispatchCardStore = class {
547
608
  void this.commit("rows");
548
609
  }
549
610
  /**
550
- * Write one section's staged edits as one revision-fenced batch.
611
+ * Write one section's staged edits as one batch.
551
612
  *
552
- * Commits are queued rather than overlapped: the Host fences each write on a
553
- * revision, and two controls left in quick succession would otherwise have the
554
- * second write fenced against a revision the first one just replaced. The queue
555
- * also makes a write read the drafts as they stand when it runs, so a burst of
556
- * edits coalesces into the fewest writes that still land the latest value.
613
+ * The card queues commits so each one reads the latest drafts and committed
614
+ * values after the previous commit settles. The shared form orders these
615
+ * writes with the session menu's writes and supplies their revision fences.
557
616
  *
558
617
  * The judgement section also writes a typed key, so leaving the key field and
559
618
  * leaving the endpoint field are one kind of gesture. The type rows are written
@@ -618,7 +677,7 @@ var DispatchCardStore = class {
618
677
  }
619
678
  if (failure === "" && ops.length > 0) {
620
679
  try {
621
- const landed = await form.mutate(ops, form.getSnapshot().revision);
680
+ const landed = await form.mutate(ops);
622
681
  if (!landed) failure = this.translate("write.refused");
623
682
  } catch (error) {
624
683
  failure = error instanceof Error && error.message !== "" ? error.message : this.translate("write.invalid");
@@ -730,8 +789,10 @@ var NS = "subagentjudgedispatch";
730
789
  var en = {
731
790
  "tab.design": "Design",
732
791
  "tab.log": "Log",
733
- "switch.rewrite.title": "Rewrite subagent model and effort",
734
- "switch.rewrite.desc": "Every subagent is judged once when it is delegated. While this is off, nothing is judged and nothing is logged.",
792
+ "switch.rewrite.title": "Enable judge dispatch by default",
793
+ "switch.rewrite.desc": "Applies to conversations without their own choice in the model menu.",
794
+ "sessionToggle.label": "Subagent judge dispatch",
795
+ "sessionToggle.failed": "Could not save judge dispatch for this conversation.",
735
796
  "switch.log.title": "Record the log",
736
797
  "switch.log.desc": "Write every judgement to a file under the DSH home, so it survives a restart.",
737
798
  "judge.title": "Judgement service",
@@ -842,8 +903,10 @@ var en = {
842
903
  var zh = {
843
904
  "tab.design": "\u8BBE\u8BA1",
844
905
  "tab.log": "\u65E5\u5FD7",
845
- "switch.rewrite.title": "\u6539\u5199\u5B50\u4EE3\u7406\u7684\u6A21\u578B\u4E0E\u5F3A\u5EA6",
846
- "switch.rewrite.desc": "\u6BCF\u4E2A\u5B50\u4EE3\u7406\u5728\u6D3E\u5DE5\u90A3\u4E00\u523B\u5224\u65AD\u4E00\u6B21\u3002\u8FD9\u4E2A\u5F00\u5173\u5173\u7740\u65F6\u4E0D\u5224\u65AD\uFF0C\u4E5F\u4E0D\u8BB0\u65E5\u5FD7\u3002",
906
+ "switch.rewrite.title": "\u9ED8\u8BA4\u5F00\u542F\u5224\u65AD\u5F0F\u5B50\u4EE3\u7406\u6307\u6D3E",
907
+ "switch.rewrite.desc": "\u4F1A\u8BDD\u5728\u6A21\u578B\u83DC\u5355\u4E2D\u6CA1\u6709\u5355\u72EC\u8BBE\u7F6E\u65F6\uFF0C\u4F7F\u7528\u6B64\u9ED8\u8BA4\u503C\u3002",
908
+ "sessionToggle.label": "\u5224\u65AD\u5F0F\u5B50\u4EE3\u7406\u6307\u6D3E",
909
+ "sessionToggle.failed": "\u672C\u4F1A\u8BDD\u7684\u5224\u65AD\u5F0F\u5B50\u4EE3\u7406\u6307\u6D3E\u8BBE\u7F6E\u672A\u80FD\u4FDD\u5B58\u3002",
847
910
  "switch.log.title": "\u8BB0\u5F55\u65E5\u5FD7",
848
911
  "switch.log.desc": "\u628A\u6BCF\u6B21\u5224\u65AD\u5199\u8FDB DSH \u5BB6\u76EE\u5F55\u91CC\u7684\u4E00\u4E2A\u6587\u4EF6\uFF0C\u91CD\u542F\u4E4B\u540E\u7167\u6837\u5728\u3002",
849
912
  "judge.title": "\u5224\u65AD\u670D\u52A1",
@@ -956,7 +1019,7 @@ function apply(ctx) {
956
1019
  }
957
1020
 
958
1021
  // src/client/settings/ui.tsx
959
- var import_jsx_runtime = require("react/jsx-runtime");
1022
+ var import_jsx_runtime2 = require("react/jsx-runtime");
960
1023
  var IMPORT_ERROR_KEYS = {
961
1024
  rows: {
962
1025
  json: "rows.importBadJson",
@@ -974,16 +1037,34 @@ function withSamples(text, samples) {
974
1037
  return text.split(/(\{\w+\})/g).map((part, index) => {
975
1038
  const name2 = /^\{\w+\}$/.test(part) ? part.slice(1, -1) : "";
976
1039
  const sample = name2 === "" ? void 0 : samples[name2];
977
- return sample === void 0 ? part : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", { children: sample }, index);
1040
+ return sample === void 0 ? part : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("code", { children: sample }, index);
978
1041
  });
979
1042
  }
980
1043
  function LogCell({ text, hint }) {
981
1044
  const label = hint === void 0 || hint === "" ? text : hint;
982
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.Tooltip, { label, side: "top", portal: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dsh-judge-cell-clip", children: text }) });
1045
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives2.Tooltip, { label, side: "top", portal: true, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dsh-judge-cell-clip", children: text }) });
983
1046
  }
984
1047
  var CARD_CSS = `
985
1048
  .dsh-judge-card { display: flex; flex-direction: column; gap: 16px; box-sizing: border-box; width: 100%; color: var(--dsw-alias-label-primary); }
986
1049
  .dsh-judge-panel { display: flex; flex-direction: column; gap: 16px; }
1050
+ .dsh-judge-session-toggle {
1051
+ position: relative;
1052
+ display: flex;
1053
+ align-items: center;
1054
+ justify-content: space-between;
1055
+ gap: 16px;
1056
+ min-height: 34px;
1057
+ padding: 0 8px;
1058
+ border-radius: var(--dsw-radius-md);
1059
+ color: var(--dsw-alias-label-primary);
1060
+ font: var(--dsw-font-xs-13);
1061
+ }
1062
+ .dsh-judge-session-toggle .dsh-judge-session-switch { position: static; }
1063
+ .dsh-judge-session-switch::after { content: ''; position: absolute; inset: 0; border-radius: var(--dsw-radius-md); }
1064
+ .dsh-judge-session-toggle:has(.dsh-judge-session-switch:focus-visible) { background: var(--dsw-alias-interactive-bg-hover); }
1065
+ @media (hover: hover) {
1066
+ .dsh-judge-session-toggle:has(.dsh-judge-session-switch:not(:disabled)):hover { background: var(--dsw-alias-interactive-bg-hover); }
1067
+ }
987
1068
  .dsh-judge-section {
988
1069
  display: flex;
989
1070
  flex-direction: column;
@@ -1088,21 +1169,21 @@ var STYLE_ID = "dsh-subagent-judge-dispatch-styles";
1088
1169
  var PLUGIN_NAME = "@lynn123411/dsh-subagent-judge-dispatch";
1089
1170
  function JudgeDispatchPanel(props) {
1090
1171
  const { t } = props;
1091
- const [state, setState] = (0, import_react.useState)(() => dispatchCardStore.getState());
1092
- const [tab, setTab] = (0, import_react.useState)("design");
1172
+ const [state, setState] = (0, import_react2.useState)(() => dispatchCardStore.getState());
1173
+ const [tab, setTab] = (0, import_react2.useState)("design");
1093
1174
  const dragIndex = React.useRef(null);
1094
- const [preview, setPreview] = (0, import_react.useState)(null);
1095
- const [previewOpen, setPreviewOpen] = (0, import_react.useState)(false);
1096
- const [probing, setProbing] = (0, import_react.useState)(false);
1097
- const [probeResult, setProbeResult] = (0, import_react.useState)(null);
1098
- const [detail, setDetail] = (0, import_react.useState)(null);
1099
- const [openMenu, setOpenMenu] = (0, import_react.useState)(null);
1100
- const [importSection, setImportSection] = (0, import_react.useState)(null);
1101
- const [importText, setImportText] = (0, import_react.useState)("");
1102
- const [importError, setImportError] = (0, import_react.useState)("");
1103
- const [copyNote, setCopyNote] = (0, import_react.useState)(null);
1104
- const [logCopyResult, setLogCopyResult] = (0, import_react.useState)(null);
1105
- (0, import_react.useEffect)(() => {
1175
+ const [preview, setPreview] = (0, import_react2.useState)(null);
1176
+ const [previewOpen, setPreviewOpen] = (0, import_react2.useState)(false);
1177
+ const [probing, setProbing] = (0, import_react2.useState)(false);
1178
+ const [probeResult, setProbeResult] = (0, import_react2.useState)(null);
1179
+ const [detail, setDetail] = (0, import_react2.useState)(null);
1180
+ const [openMenu, setOpenMenu] = (0, import_react2.useState)(null);
1181
+ const [importSection, setImportSection] = (0, import_react2.useState)(null);
1182
+ const [importText, setImportText] = (0, import_react2.useState)("");
1183
+ const [importError, setImportError] = (0, import_react2.useState)("");
1184
+ const [copyNote, setCopyNote] = (0, import_react2.useState)(null);
1185
+ const [logCopyResult, setLogCopyResult] = (0, import_react2.useState)(null);
1186
+ (0, import_react2.useEffect)(() => {
1106
1187
  setState(dispatchCardStore.getState());
1107
1188
  const unsubscribe = dispatchCardStore.subscribe(() => setState(dispatchCardStore.getState()));
1108
1189
  return () => {
@@ -1110,7 +1191,7 @@ function JudgeDispatchPanel(props) {
1110
1191
  void dispatchCardStore.flush();
1111
1192
  };
1112
1193
  }, []);
1113
- (0, import_react.useEffect)(() => {
1194
+ (0, import_react2.useEffect)(() => {
1114
1195
  if (tab === "log") void dispatchCardStore.refreshLog();
1115
1196
  }, [tab]);
1116
1197
  const reasonText = (reason) => t(`reason.${reason ?? "other"}`) || t("reason.unknown");
@@ -1126,11 +1207,11 @@ function JudgeDispatchPanel(props) {
1126
1207
  setPreviewOpen(true);
1127
1208
  };
1128
1209
  const exportRows = async () => {
1129
- const copied = await (0, import_dsh_client_ui_primitives.writeClipboard)(exportRowsJson(state.rows));
1210
+ const copied = await (0, import_dsh_client_ui_primitives2.writeClipboard)(exportRowsJson(state.rows));
1130
1211
  setCopyNote({ ok: copied, text: t(copied ? "rows.exported" : "rows.exportFailed"), section: "rows" });
1131
1212
  };
1132
1213
  const exportJudge = async () => {
1133
- const copied = await (0, import_dsh_client_ui_primitives.writeClipboard)(exportJudgeJson(state));
1214
+ const copied = await (0, import_dsh_client_ui_primitives2.writeClipboard)(exportJudgeJson(state));
1134
1215
  setCopyNote({ ok: copied, text: t(copied ? "judge.exported" : "judge.exportFailed"), section: "judge" });
1135
1216
  };
1136
1217
  const openImport = (section) => {
@@ -1164,12 +1245,12 @@ function JudgeDispatchPanel(props) {
1164
1245
  };
1165
1246
  const commitJudge = () => void dispatchCardStore.commit("judge");
1166
1247
  const commitRows = () => void dispatchCardStore.commit("rows");
1167
- const failure = (section) => state.writeFailed === section && state.writeError !== "" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-judge-note-bad", role: "alert", children: t("write.failed").replace("{error}", state.writeError) }) : null;
1248
+ const failure = (section) => state.writeFailed === section && state.writeError !== "" ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-note-bad", role: "alert", children: t("write.failed").replace("{error}", state.writeError) }) : null;
1168
1249
  const row = (draft, index) => {
1169
1250
  const efforts = dispatchCardStore.effortsFor(draft);
1170
1251
  const usable = dispatchCardStore.rowUsable(draft);
1171
1252
  const catalogOffersEffort = state.catalogRead && efforts.length > 0;
1172
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
1253
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
1173
1254
  "tr",
1174
1255
  {
1175
1256
  className: usable && draft.enabled ? void 0 : "dsh-judge-row-off",
@@ -1183,7 +1264,7 @@ function JudgeDispatchPanel(props) {
1183
1264
  setOpenMenu(null);
1184
1265
  },
1185
1266
  children: [
1186
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", { className: "dsh-judge-col-drag", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1267
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("td", { className: "dsh-judge-col-drag", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1187
1268
  "button",
1188
1269
  {
1189
1270
  type: "button",
@@ -1208,9 +1289,9 @@ function JudgeDispatchPanel(props) {
1208
1289
  children: "\u283F"
1209
1290
  }
1210
1291
  ) }),
1211
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("td", { children: [
1212
- rowHints(state.rows, index, t).map((hint) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dsh-judge-off", children: hint }, hint)),
1213
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1292
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("td", { children: [
1293
+ rowHints(state.rows, index, t).map((hint) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dsh-judge-off", children: hint }, hint)),
1294
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1214
1295
  "textarea",
1215
1296
  {
1216
1297
  className: "dsh-judge-field dsh-judge-description",
@@ -1224,12 +1305,12 @@ function JudgeDispatchPanel(props) {
1224
1305
  }
1225
1306
  )
1226
1307
  ] }),
1227
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1228
- import_dsh_client_ui_primitives.Menu,
1308
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("td", { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1309
+ import_dsh_client_ui_primitives2.Menu,
1229
1310
  {
1230
1311
  open: openMenu?.index === index && openMenu.kind === "model",
1231
- anchor: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1232
- import_dsh_client_ui_primitives.Input,
1312
+ anchor: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1313
+ import_dsh_client_ui_primitives2.Input,
1233
1314
  {
1234
1315
  type: "text",
1235
1316
  className: "dsh-judge-field",
@@ -1263,12 +1344,12 @@ function JudgeDispatchPanel(props) {
1263
1344
  portal: true
1264
1345
  }
1265
1346
  ) }),
1266
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", { children: catalogOffersEffort ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1267
- import_dsh_client_ui_primitives.Menu,
1347
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("td", { children: catalogOffersEffort ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1348
+ import_dsh_client_ui_primitives2.Menu,
1268
1349
  {
1269
1350
  open: openMenu?.index === index && openMenu.kind === "effort",
1270
- anchor: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1271
- import_dsh_client_ui_primitives.Input,
1351
+ anchor: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1352
+ import_dsh_client_ui_primitives2.Input,
1272
1353
  {
1273
1354
  type: "text",
1274
1355
  className: "dsh-judge-field",
@@ -1296,8 +1377,8 @@ function JudgeDispatchPanel(props) {
1296
1377
  className: "dsh-judge-field-wrap",
1297
1378
  portal: true
1298
1379
  }
1299
- ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1300
- import_dsh_client_ui_primitives.Input,
1380
+ ) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1381
+ import_dsh_client_ui_primitives2.Input,
1301
1382
  {
1302
1383
  type: "text",
1303
1384
  className: "dsh-judge-field",
@@ -1308,9 +1389,9 @@ function JudgeDispatchPanel(props) {
1308
1389
  onBlur: commitRows
1309
1390
  }
1310
1391
  ) }),
1311
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", { className: "dsh-judge-col-actions", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-judge-cell-actions", children: [
1312
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1313
- import_dsh_client_ui_primitives.Switch,
1392
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("td", { className: "dsh-judge-col-actions", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-cell-actions", children: [
1393
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1394
+ import_dsh_client_ui_primitives2.Switch,
1314
1395
  {
1315
1396
  checked: draft.enabled,
1316
1397
  onChange: (next) => dispatchCardStore.toggleRow(index, next),
@@ -1318,8 +1399,8 @@ function JudgeDispatchPanel(props) {
1318
1399
  disabled: !state.writable
1319
1400
  }
1320
1401
  ),
1321
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1322
- import_dsh_client_ui_primitives.Button,
1402
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1403
+ import_dsh_client_ui_primitives2.Button,
1323
1404
  {
1324
1405
  variant: "outline",
1325
1406
  size: "sm",
@@ -1334,15 +1415,15 @@ function JudgeDispatchPanel(props) {
1334
1415
  index
1335
1416
  );
1336
1417
  };
1337
- const design = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-judge-panel", children: [
1338
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-judge-section", children: [
1339
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-judge-head", children: [
1340
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dsh-judge-title", children: t("judge.title") }),
1341
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-judge-actions-group", children: [
1342
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.Button, { variant: "outline", size: "sm", onClick: () => openImport("judge"), children: t("judge.importOpen") }),
1343
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.Button, { variant: "outline", size: "sm", onClick: () => void exportJudge(), children: t("judge.export") }),
1344
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1345
- import_dsh_client_ui_primitives.Button,
1418
+ const design = /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-panel", children: [
1419
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-section", children: [
1420
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-head", children: [
1421
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dsh-judge-title", children: t("judge.title") }),
1422
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-actions-group", children: [
1423
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives2.Button, { variant: "outline", size: "sm", onClick: () => openImport("judge"), children: t("judge.importOpen") }),
1424
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives2.Button, { variant: "outline", size: "sm", onClick: () => void exportJudge(), children: t("judge.export") }),
1425
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1426
+ import_dsh_client_ui_primitives2.Button,
1346
1427
  {
1347
1428
  variant: "outline",
1348
1429
  size: "sm",
@@ -1353,14 +1434,14 @@ function JudgeDispatchPanel(props) {
1353
1434
  )
1354
1435
  ] })
1355
1436
  ] }),
1356
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-judge-desc", children: t("judge.desc") }),
1357
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-judge-row", children: [
1358
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-judge-row-info", children: [
1359
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-judge-row-title", children: t("switch.rewrite.title") }),
1360
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-judge-row-hint", children: t("switch.rewrite.desc") })
1437
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-desc", children: t("judge.desc") }),
1438
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-row", children: [
1439
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-row-info", children: [
1440
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-row-title", children: t("switch.rewrite.title") }),
1441
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-row-hint", children: t("switch.rewrite.desc") })
1361
1442
  ] }),
1362
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1363
- import_dsh_client_ui_primitives.Switch,
1443
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1444
+ import_dsh_client_ui_primitives2.Switch,
1364
1445
  {
1365
1446
  checked: state.enabled,
1366
1447
  onChange: (next) => dispatchCardStore.toggle("enabled", next),
@@ -1369,13 +1450,13 @@ function JudgeDispatchPanel(props) {
1369
1450
  }
1370
1451
  )
1371
1452
  ] }),
1372
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-judge-row", children: [
1373
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-judge-row-info", children: [
1374
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-judge-row-title", children: t("switch.log.title") }),
1375
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-judge-row-hint", children: t("switch.log.desc") })
1453
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-row", children: [
1454
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-row-info", children: [
1455
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-row-title", children: t("switch.log.title") }),
1456
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-row-hint", children: t("switch.log.desc") })
1376
1457
  ] }),
1377
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1378
- import_dsh_client_ui_primitives.Switch,
1458
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1459
+ import_dsh_client_ui_primitives2.Switch,
1379
1460
  {
1380
1461
  checked: state.logEnabled,
1381
1462
  onChange: (next) => dispatchCardStore.toggle("logEnabled", next),
@@ -1384,13 +1465,13 @@ function JudgeDispatchPanel(props) {
1384
1465
  }
1385
1466
  )
1386
1467
  ] }),
1387
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-judge-row", children: [
1388
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-judge-row-info", children: [
1389
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-judge-row-title", children: t("judge.endpoint") }),
1390
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-judge-row-hint", children: t("judge.endpointDesc") })
1468
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-row", children: [
1469
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-row-info", children: [
1470
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-row-title", children: t("judge.endpoint") }),
1471
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-row-hint", children: t("judge.endpointDesc") })
1391
1472
  ] }),
1392
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-judge-row-field", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1393
- import_dsh_client_ui_primitives.Input,
1473
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-row-field", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1474
+ import_dsh_client_ui_primitives2.Input,
1394
1475
  {
1395
1476
  type: "text",
1396
1477
  className: "dsh-judge-field",
@@ -1403,13 +1484,13 @@ function JudgeDispatchPanel(props) {
1403
1484
  }
1404
1485
  ) })
1405
1486
  ] }),
1406
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-judge-row", children: [
1407
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-judge-row-info", children: [
1408
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-judge-row-title", children: t("judge.model") }),
1409
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-judge-row-hint", children: t("judge.modelDesc") })
1487
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-row", children: [
1488
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-row-info", children: [
1489
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-row-title", children: t("judge.model") }),
1490
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-row-hint", children: t("judge.modelDesc") })
1410
1491
  ] }),
1411
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-judge-row-field", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1412
- import_dsh_client_ui_primitives.Input,
1492
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-row-field", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1493
+ import_dsh_client_ui_primitives2.Input,
1413
1494
  {
1414
1495
  type: "text",
1415
1496
  className: "dsh-judge-field",
@@ -1422,14 +1503,14 @@ function JudgeDispatchPanel(props) {
1422
1503
  }
1423
1504
  ) })
1424
1505
  ] }),
1425
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-judge-row", children: [
1426
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-judge-row-info", children: [
1427
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-judge-row-title", children: t("judge.key") }),
1428
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-judge-row-hint", children: withSamples(t("judge.keyDesc"), { ref: JUDGE_API_KEY_REF, path: CREDENTIALS_PATH }) })
1506
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-row", children: [
1507
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-row-info", children: [
1508
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-row-title", children: t("judge.key") }),
1509
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-row-hint", children: withSamples(t("judge.keyDesc"), { ref: JUDGE_API_KEY_REF, path: CREDENTIALS_PATH }) })
1429
1510
  ] }),
1430
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-judge-row-field", children: [
1431
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1432
- import_dsh_client_ui_primitives.Input,
1511
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-row-field", children: [
1512
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1513
+ import_dsh_client_ui_primitives2.Input,
1433
1514
  {
1434
1515
  type: "password",
1435
1516
  autoComplete: "new-password",
@@ -1447,30 +1528,30 @@ function JudgeDispatchPanel(props) {
1447
1528
  }
1448
1529
  }
1449
1530
  ),
1450
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-judge-key-line", children: [
1451
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.Tag, { tone: state.key.configured ? "success" : "warning", children: t(state.key.configured ? "judge.keySet" : "judge.keyUnset") }),
1452
- state.key.unavailable && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dsh-judge-hint", children: t("judge.keyUnavailable") }),
1453
- state.key.failed && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dsh-judge-note-bad", role: "alert", children: t("judge.keyFailed").replace("{error}", state.key.error || t("write.invalid")) })
1531
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-key-line", children: [
1532
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives2.Tag, { tone: state.key.configured ? "success" : "warning", children: t(state.key.configured ? "judge.keySet" : "judge.keyUnset") }),
1533
+ state.key.unavailable && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dsh-judge-hint", children: t("judge.keyUnavailable") }),
1534
+ state.key.failed && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dsh-judge-note-bad", role: "alert", children: t("judge.keyFailed").replace("{error}", state.key.error || t("write.invalid")) })
1454
1535
  ] })
1455
1536
  ] })
1456
1537
  ] }),
1457
- probeResult !== null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: probeResult.ok ? "dsh-judge-note-ok" : "dsh-judge-note-bad", children: probeResult.ok ? t("judge.probeOk").replace("{latency}", String(probeResult.latencyMs)) : t("judge.probeFail").replace("{reason}", reasonText(probeResult.reason)) }),
1458
- copyNote !== null && copyNote.section === "judge" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: copyNote.ok ? "dsh-judge-note-ok" : "dsh-judge-note-bad", role: "status", children: copyNote.text }),
1538
+ probeResult !== null && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: probeResult.ok ? "dsh-judge-note-ok" : "dsh-judge-note-bad", children: probeResult.ok ? t("judge.probeOk").replace("{latency}", String(probeResult.latencyMs)) : t("judge.probeFail").replace("{reason}", reasonText(probeResult.reason)) }),
1539
+ copyNote !== null && copyNote.section === "judge" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: copyNote.ok ? "dsh-judge-note-ok" : "dsh-judge-note-bad", role: "status", children: copyNote.text }),
1459
1540
  failure("judge")
1460
1541
  ] }),
1461
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-judge-section", children: [
1462
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-judge-head", children: [
1463
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dsh-judge-title", children: t("rows.title") }),
1464
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-judge-actions-group", children: [
1465
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.Button, { variant: "outline", size: "sm", onClick: () => openImport("rows"), children: t("rows.importOpen") }),
1466
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.Button, { variant: "outline", size: "sm", onClick: () => void exportRows(), children: t("rows.export") }),
1467
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.Button, { variant: "outline", size: "sm", onClick: () => dispatchCardStore.addRow(), children: t("rows.add") })
1542
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-section", children: [
1543
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-head", children: [
1544
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dsh-judge-title", children: t("rows.title") }),
1545
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-actions-group", children: [
1546
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives2.Button, { variant: "outline", size: "sm", onClick: () => openImport("rows"), children: t("rows.importOpen") }),
1547
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives2.Button, { variant: "outline", size: "sm", onClick: () => void exportRows(), children: t("rows.export") }),
1548
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives2.Button, { variant: "outline", size: "sm", onClick: () => dispatchCardStore.addRow(), children: t("rows.add") })
1468
1549
  ] })
1469
1550
  ] }),
1470
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-judge-dependency", children: [
1471
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dsh-judge-desc", children: t("rows.dependsOn") }),
1472
- dispatchCardStore.canOpenOfficialSettings() && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1473
- import_dsh_client_ui_primitives.Button,
1551
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-dependency", children: [
1552
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dsh-judge-desc", children: t("rows.dependsOn") }),
1553
+ dispatchCardStore.canOpenOfficialSettings() && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1554
+ import_dsh_client_ui_primitives2.Button,
1474
1555
  {
1475
1556
  variant: "ghost",
1476
1557
  size: "sm",
@@ -1480,62 +1561,62 @@ function JudgeDispatchPanel(props) {
1480
1561
  }
1481
1562
  )
1482
1563
  ] }),
1483
- state.models.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-judge-off", children: t("rows.allowedEmpty") }),
1484
- state.rows.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-judge-desc", children: t("rows.empty") }),
1485
- state.rows.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("table", { className: "dsh-judge-table", children: [
1486
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("tr", { children: [
1487
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("th", { className: "dsh-judge-col-drag" }),
1488
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("th", { children: t("rows.colType") }),
1489
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("th", { className: "dsh-judge-col-model", children: t("rows.colModel") }),
1490
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("th", { className: "dsh-judge-col-effort", children: t("rows.colEffort") }),
1491
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("th", { className: "dsh-judge-col-actions" })
1564
+ state.models.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-off", children: t("rows.allowedEmpty") }),
1565
+ state.rows.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-desc", children: t("rows.empty") }),
1566
+ state.rows.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("table", { className: "dsh-judge-table", children: [
1567
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("tr", { children: [
1568
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("th", { className: "dsh-judge-col-drag" }),
1569
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("th", { children: t("rows.colType") }),
1570
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("th", { className: "dsh-judge-col-model", children: t("rows.colModel") }),
1571
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("th", { className: "dsh-judge-col-effort", children: t("rows.colEffort") }),
1572
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("th", { className: "dsh-judge-col-actions" })
1492
1573
  ] }) }),
1493
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tbody", { children: state.rows.map((draft, index) => row(draft, index)) })
1574
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("tbody", { children: state.rows.map((draft, index) => row(draft, index)) })
1494
1575
  ] }),
1495
- copyNote !== null && copyNote.section === "rows" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: copyNote.ok ? "dsh-judge-note-ok" : "dsh-judge-note-bad", role: "status", children: copyNote.text }),
1576
+ copyNote !== null && copyNote.section === "rows" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: copyNote.ok ? "dsh-judge-note-ok" : "dsh-judge-note-bad", role: "status", children: copyNote.text }),
1496
1577
  failure("rows")
1497
1578
  ] }),
1498
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-judge-footer", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.Button, { variant: "outline", size: "sm", onClick: () => void openPreview(), children: t("preview.open") }) })
1579
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-footer", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives2.Button, { variant: "outline", size: "sm", onClick: () => void openPreview(), children: t("preview.open") }) })
1499
1580
  ] });
1500
- const log = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-judge-panel", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-judge-section", children: [
1501
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-judge-head", children: [
1502
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dsh-judge-title", children: t("log.title") }),
1503
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-judge-actions-group", children: [
1504
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.Button, { variant: "outline", size: "sm", onClick: () => void (0, import_dsh_client_ui_primitives.writeClipboard)(t("log.analysisPrompt")).then(setLogCopyResult), children: t("log.copyAnalysis") }),
1505
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.Button, { variant: "outline", size: "sm", onClick: () => void dispatchCardStore.refreshLog(), children: t("log.refresh") })
1581
+ const log = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-panel", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-section", children: [
1582
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-head", children: [
1583
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dsh-judge-title", children: t("log.title") }),
1584
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-actions-group", children: [
1585
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives2.Button, { variant: "outline", size: "sm", onClick: () => void (0, import_dsh_client_ui_primitives2.writeClipboard)(t("log.analysisPrompt")).then(setLogCopyResult), children: t("log.copyAnalysis") }),
1586
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives2.Button, { variant: "outline", size: "sm", onClick: () => void dispatchCardStore.refreshLog(), children: t("log.refresh") })
1506
1587
  ] })
1507
1588
  ] }),
1508
- logCopyResult !== null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: logCopyResult ? "dsh-judge-note-ok" : "dsh-judge-note-bad", role: "status", children: t(logCopyResult ? "log.analysisCopied" : "log.analysisCopyFailed") }),
1509
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-judge-desc", children: t("log.desc") }),
1510
- state.logFailed && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-judge-note-bad", children: t("log.loadFailed") }),
1511
- state.logLoaded && state.log.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-judge-desc", children: t("log.empty") }),
1512
- state.log.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-judge-log", children: [
1513
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-judge-log-row dsh-judge-log-head", children: [
1514
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: t("log.colResult") }),
1515
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: t("log.colChoice") }),
1516
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: t("log.colParent") }),
1517
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: t("log.colChild") }),
1518
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: t("log.colTime") }),
1519
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: t("log.colLatency") })
1589
+ logCopyResult !== null && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: logCopyResult ? "dsh-judge-note-ok" : "dsh-judge-note-bad", role: "status", children: t(logCopyResult ? "log.analysisCopied" : "log.analysisCopyFailed") }),
1590
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-desc", children: t("log.desc") }),
1591
+ state.logFailed && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-note-bad", children: t("log.loadFailed") }),
1592
+ state.logLoaded && state.log.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-desc", children: t("log.empty") }),
1593
+ state.log.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-log", children: [
1594
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-log-row dsh-judge-log-head", children: [
1595
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: t("log.colResult") }),
1596
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: t("log.colChoice") }),
1597
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: t("log.colParent") }),
1598
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: t("log.colChild") }),
1599
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: t("log.colTime") }),
1600
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: t("log.colLatency") })
1520
1601
  ] }),
1521
1602
  state.log.map((entry, index) => {
1522
1603
  const result = entry.typeId === null ? {
1523
1604
  text: t("log.resultInherited"),
1524
1605
  hint: entry.reason === void 0 ? "" : reasonText(entry.reason)
1525
1606
  } : { text: t("log.resultJudged").replace("{id}", String(entry.typeId)), hint: "" };
1526
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
1607
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
1527
1608
  "button",
1528
1609
  {
1529
1610
  type: "button",
1530
1611
  className: "dsh-judge-log-row",
1531
1612
  onClick: () => setDetail(entry),
1532
1613
  children: [
1533
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LogCell, { text: result.text, hint: result.hint }),
1534
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LogCell, { text: describeModel(entry) || "\u2014", hint: describeChoice(entry) }),
1535
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LogCell, { text: entry.parentTitle || "\u2014" }),
1536
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LogCell, { text: entry.childLabel || "\u2014" }),
1537
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: new Date(entry.at).toLocaleTimeString() }),
1538
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: t("ms").replace("{value}", String(entry.latencyMs)) })
1614
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(LogCell, { text: result.text, hint: result.hint }),
1615
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(LogCell, { text: describeModel(entry) || "\u2014", hint: describeChoice(entry) }),
1616
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(LogCell, { text: entry.parentTitle || "\u2014" }),
1617
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(LogCell, { text: entry.childLabel || "\u2014" }),
1618
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: new Date(entry.at).toLocaleTimeString() }),
1619
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: t("ms").replace("{value}", String(entry.latencyMs)) })
1539
1620
  ]
1540
1621
  },
1541
1622
  index
@@ -1543,9 +1624,9 @@ function JudgeDispatchPanel(props) {
1543
1624
  })
1544
1625
  ] })
1545
1626
  ] }) });
1546
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-judge-card", children: [
1547
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1548
- import_dsh_client_ui_primitives.SegmentedTabs,
1627
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-card", children: [
1628
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1629
+ import_dsh_client_ui_primitives2.SegmentedTabs,
1549
1630
  {
1550
1631
  items: [
1551
1632
  { value: "design", label: t("tab.design"), id: "judge-tab-design", panelId: "judge-panel-design" },
@@ -1560,8 +1641,8 @@ function JudgeDispatchPanel(props) {
1560
1641
  }
1561
1642
  ),
1562
1643
  tab === "design" ? design : log,
1563
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
1564
- import_dsh_client_ui_primitives.Modal,
1644
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
1645
+ import_dsh_client_ui_primitives2.Modal,
1565
1646
  {
1566
1647
  open: previewOpen,
1567
1648
  onClose: () => setPreviewOpen(false),
@@ -1569,13 +1650,13 @@ function JudgeDispatchPanel(props) {
1569
1650
  closeLabel: t("preview.close"),
1570
1651
  className: "dsh-judge-modal",
1571
1652
  children: [
1572
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-judge-desc", children: t("preview.desc") }),
1573
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-judge-prompt", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.CodeBlock, { code: preview ?? "", copyLabel: t("preview.copy"), copiedLabel: t("preview.copied") }) })
1653
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-desc", children: t("preview.desc") }),
1654
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-prompt", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives2.CodeBlock, { code: preview ?? "", copyLabel: t("preview.copy"), copiedLabel: t("preview.copied") }) })
1574
1655
  ]
1575
1656
  }
1576
1657
  ),
1577
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
1578
- import_dsh_client_ui_primitives.Modal,
1658
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
1659
+ import_dsh_client_ui_primitives2.Modal,
1579
1660
  {
1580
1661
  open: importSection !== null,
1581
1662
  onClose: closeImport,
@@ -1583,12 +1664,12 @@ function JudgeDispatchPanel(props) {
1583
1664
  closeLabel: t(importSection === "judge" ? "judge.importClose" : "rows.importClose"),
1584
1665
  description: t(importSection === "judge" ? "judge.importDesc" : "rows.importDesc"),
1585
1666
  className: "dsh-judge-modal",
1586
- footer: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
1587
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.Button, { variant: "outline", size: "sm", onClick: closeImport, children: t(importSection === "judge" ? "judge.importCancel" : "rows.importCancel") }),
1588
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.Button, { variant: "primary", size: "sm", onClick: applyImport, children: t(importSection === "judge" ? "judge.importApply" : "rows.importApply") })
1667
+ footer: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
1668
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives2.Button, { variant: "outline", size: "sm", onClick: closeImport, children: t(importSection === "judge" ? "judge.importCancel" : "rows.importCancel") }),
1669
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives2.Button, { variant: "primary", size: "sm", onClick: applyImport, children: t(importSection === "judge" ? "judge.importApply" : "rows.importApply") })
1589
1670
  ] }),
1590
1671
  children: [
1591
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1672
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1592
1673
  "textarea",
1593
1674
  {
1594
1675
  className: "dsh-judge-paste",
@@ -1603,12 +1684,12 @@ function JudgeDispatchPanel(props) {
1603
1684
  }
1604
1685
  }
1605
1686
  ),
1606
- importError !== "" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-judge-note-bad", role: "alert", children: importError })
1687
+ importError !== "" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-note-bad", role: "alert", children: importError })
1607
1688
  ]
1608
1689
  }
1609
1690
  ),
1610
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1611
- import_dsh_client_ui_primitives.Modal,
1691
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1692
+ import_dsh_client_ui_primitives2.Modal,
1612
1693
  {
1613
1694
  open: detail !== null,
1614
1695
  onClose: () => setDetail(null),
@@ -1616,8 +1697,8 @@ function JudgeDispatchPanel(props) {
1616
1697
  closeLabel: t("log.promptClose"),
1617
1698
  description: t("log.promptDesc"),
1618
1699
  className: "dsh-judge-modal",
1619
- children: detail !== null && (detail.prompt === "" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-judge-desc", children: t("log.promptEmpty") }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-judge-prompt", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1620
- import_dsh_client_ui_primitives.CodeBlock,
1700
+ children: detail !== null && (detail.prompt === "" ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-desc", children: t("log.promptEmpty") }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-prompt", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1701
+ import_dsh_client_ui_primitives2.CodeBlock,
1621
1702
  {
1622
1703
  code: detail.prompt,
1623
1704
  copyLabel: t("preview.copy"),
@@ -1670,6 +1751,12 @@ var inject = ["slots", "configForms", "remote", "remote.session", "remote.creden
1670
1751
  function apply2(ctx) {
1671
1752
  injectCardStyles();
1672
1753
  apply(ctx);
1754
+ ctx.slots.inject(MODEL_OPTIONS_SLOT, () => ctx.slots.register({
1755
+ name: MODEL_OPTIONS_SLOT,
1756
+ id: "subagent-judge-dispatch-enabled",
1757
+ locale: NS,
1758
+ inject: () => ({ form: ctx.configForms.get(SETTINGS_NAMESPACE) })
1759
+ }, SessionToggle));
1673
1760
  ctx.effect(
1674
1761
  () => {
1675
1762
  setupSettingsUi(ctx);