@lynn123411/dsh-subagent-judge-dispatch 0.6.5 → 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/README.md +4 -3
- package/lib/client.js +279 -176
- package/lib/client.js.map +4 -4
- package/lib/index.js +37 -23
- package/lib/index.js.map +3 -3
- package/package.json +4 -1
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/
|
|
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:
|
|
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:
|
|
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 :
|
|
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
|
|
611
|
+
* Write one section's staged edits as one batch.
|
|
551
612
|
*
|
|
552
|
-
*
|
|
553
|
-
*
|
|
554
|
-
*
|
|
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
|
|
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": "
|
|
734
|
-
"switch.rewrite.desc": "
|
|
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": "\
|
|
846
|
-
"switch.rewrite.desc": "\
|
|
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
|
|
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,
|
|
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,
|
|
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;
|
|
@@ -1007,6 +1088,21 @@ var CARD_CSS = `
|
|
|
1007
1088
|
\u6240\u4EE5\u8981\u6491\u7684\u662F\u5B83\uFF0C\u53EA\u7ED9 input \u5199\u5BBD\u5EA6\u6CA1\u7528\u3002 */
|
|
1008
1089
|
.dsh-judge-field { display: flex; box-sizing: border-box; width: 100%; min-width: 0; }
|
|
1009
1090
|
.dsh-judge-field input { box-sizing: border-box; width: 100%; min-width: 0; }
|
|
1091
|
+
.dsh-judge-description {
|
|
1092
|
+
field-sizing: content;
|
|
1093
|
+
display: block;
|
|
1094
|
+
min-height: 32px;
|
|
1095
|
+
max-height: 40vh;
|
|
1096
|
+
resize: vertical;
|
|
1097
|
+
padding: 6px 10px;
|
|
1098
|
+
border: 0.5px solid var(--dsw-alias-border-l3);
|
|
1099
|
+
border-radius: var(--dsw-radius-md);
|
|
1100
|
+
background: var(--dsw-alias-bg-layer-1);
|
|
1101
|
+
color: inherit;
|
|
1102
|
+
font: inherit;
|
|
1103
|
+
line-height: 1.4;
|
|
1104
|
+
}
|
|
1105
|
+
.dsh-judge-description:focus-visible { outline: 2px solid var(--dsw-alias-state-business-primary); outline-offset: -2px; }
|
|
1010
1106
|
.dsh-judge-key-line { display: flex; align-items: center; gap: 8px; box-sizing: border-box; width: 100%; }
|
|
1011
1107
|
.dsh-judge-off { display: block; color: var(--dsw-alias-state-warn-label); font: var(--dsw-font-xxxs-11); }
|
|
1012
1108
|
/* \u6807\u9898\u884C\u53F3\u7AEF\u7684\u4E00\u7EC4\u52A8\u4F5C\uFF1A\u8BD5\u901A\u3001\u5BFC\u5165\u3001\u5BFC\u51FA\u3001\u52A0\u4E00\u884C\u90FD\u6392\u5728\u8FD9\u91CC\u3002 */
|
|
@@ -1073,21 +1169,21 @@ var STYLE_ID = "dsh-subagent-judge-dispatch-styles";
|
|
|
1073
1169
|
var PLUGIN_NAME = "@lynn123411/dsh-subagent-judge-dispatch";
|
|
1074
1170
|
function JudgeDispatchPanel(props) {
|
|
1075
1171
|
const { t } = props;
|
|
1076
|
-
const [state, setState] = (0,
|
|
1077
|
-
const [tab, setTab] = (0,
|
|
1172
|
+
const [state, setState] = (0, import_react2.useState)(() => dispatchCardStore.getState());
|
|
1173
|
+
const [tab, setTab] = (0, import_react2.useState)("design");
|
|
1078
1174
|
const dragIndex = React.useRef(null);
|
|
1079
|
-
const [preview, setPreview] = (0,
|
|
1080
|
-
const [previewOpen, setPreviewOpen] = (0,
|
|
1081
|
-
const [probing, setProbing] = (0,
|
|
1082
|
-
const [probeResult, setProbeResult] = (0,
|
|
1083
|
-
const [detail, setDetail] = (0,
|
|
1084
|
-
const [openMenu, setOpenMenu] = (0,
|
|
1085
|
-
const [importSection, setImportSection] = (0,
|
|
1086
|
-
const [importText, setImportText] = (0,
|
|
1087
|
-
const [importError, setImportError] = (0,
|
|
1088
|
-
const [copyNote, setCopyNote] = (0,
|
|
1089
|
-
const [logCopyResult, setLogCopyResult] = (0,
|
|
1090
|
-
(0,
|
|
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)(() => {
|
|
1091
1187
|
setState(dispatchCardStore.getState());
|
|
1092
1188
|
const unsubscribe = dispatchCardStore.subscribe(() => setState(dispatchCardStore.getState()));
|
|
1093
1189
|
return () => {
|
|
@@ -1095,7 +1191,7 @@ function JudgeDispatchPanel(props) {
|
|
|
1095
1191
|
void dispatchCardStore.flush();
|
|
1096
1192
|
};
|
|
1097
1193
|
}, []);
|
|
1098
|
-
(0,
|
|
1194
|
+
(0, import_react2.useEffect)(() => {
|
|
1099
1195
|
if (tab === "log") void dispatchCardStore.refreshLog();
|
|
1100
1196
|
}, [tab]);
|
|
1101
1197
|
const reasonText = (reason) => t(`reason.${reason ?? "other"}`) || t("reason.unknown");
|
|
@@ -1111,11 +1207,11 @@ function JudgeDispatchPanel(props) {
|
|
|
1111
1207
|
setPreviewOpen(true);
|
|
1112
1208
|
};
|
|
1113
1209
|
const exportRows = async () => {
|
|
1114
|
-
const copied = await (0,
|
|
1210
|
+
const copied = await (0, import_dsh_client_ui_primitives2.writeClipboard)(exportRowsJson(state.rows));
|
|
1115
1211
|
setCopyNote({ ok: copied, text: t(copied ? "rows.exported" : "rows.exportFailed"), section: "rows" });
|
|
1116
1212
|
};
|
|
1117
1213
|
const exportJudge = async () => {
|
|
1118
|
-
const copied = await (0,
|
|
1214
|
+
const copied = await (0, import_dsh_client_ui_primitives2.writeClipboard)(exportJudgeJson(state));
|
|
1119
1215
|
setCopyNote({ ok: copied, text: t(copied ? "judge.exported" : "judge.exportFailed"), section: "judge" });
|
|
1120
1216
|
};
|
|
1121
1217
|
const openImport = (section) => {
|
|
@@ -1149,12 +1245,12 @@ function JudgeDispatchPanel(props) {
|
|
|
1149
1245
|
};
|
|
1150
1246
|
const commitJudge = () => void dispatchCardStore.commit("judge");
|
|
1151
1247
|
const commitRows = () => void dispatchCardStore.commit("rows");
|
|
1152
|
-
const failure = (section) => state.writeFailed === section && state.writeError !== "" ? /* @__PURE__ */ (0,
|
|
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;
|
|
1153
1249
|
const row = (draft, index) => {
|
|
1154
1250
|
const efforts = dispatchCardStore.effortsFor(draft);
|
|
1155
1251
|
const usable = dispatchCardStore.rowUsable(draft);
|
|
1156
1252
|
const catalogOffersEffort = state.catalogRead && efforts.length > 0;
|
|
1157
|
-
return /* @__PURE__ */ (0,
|
|
1253
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
1158
1254
|
"tr",
|
|
1159
1255
|
{
|
|
1160
1256
|
className: usable && draft.enabled ? void 0 : "dsh-judge-row-off",
|
|
@@ -1168,7 +1264,7 @@ function JudgeDispatchPanel(props) {
|
|
|
1168
1264
|
setOpenMenu(null);
|
|
1169
1265
|
},
|
|
1170
1266
|
children: [
|
|
1171
|
-
/* @__PURE__ */ (0,
|
|
1267
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("td", { className: "dsh-judge-col-drag", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1172
1268
|
"button",
|
|
1173
1269
|
{
|
|
1174
1270
|
type: "button",
|
|
@@ -1193,13 +1289,14 @@ function JudgeDispatchPanel(props) {
|
|
|
1193
1289
|
children: "\u283F"
|
|
1194
1290
|
}
|
|
1195
1291
|
) }),
|
|
1196
|
-
/* @__PURE__ */ (0,
|
|
1197
|
-
rowHints(state.rows, index, t).map((hint) => /* @__PURE__ */ (0,
|
|
1198
|
-
/* @__PURE__ */ (0,
|
|
1199
|
-
|
|
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)(
|
|
1295
|
+
"textarea",
|
|
1200
1296
|
{
|
|
1201
|
-
|
|
1202
|
-
|
|
1297
|
+
className: "dsh-judge-field dsh-judge-description",
|
|
1298
|
+
rows: 2,
|
|
1299
|
+
readOnly: !state.writable,
|
|
1203
1300
|
value: draft.description,
|
|
1204
1301
|
placeholder: t("rows.descriptionPlaceholder"),
|
|
1205
1302
|
"aria-label": `${t("rows.colDescription")} ${index + 1}`,
|
|
@@ -1208,17 +1305,17 @@ function JudgeDispatchPanel(props) {
|
|
|
1208
1305
|
}
|
|
1209
1306
|
)
|
|
1210
1307
|
] }),
|
|
1211
|
-
/* @__PURE__ */ (0,
|
|
1212
|
-
|
|
1308
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("td", { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1309
|
+
import_dsh_client_ui_primitives2.Menu,
|
|
1213
1310
|
{
|
|
1214
1311
|
open: openMenu?.index === index && openMenu.kind === "model",
|
|
1215
|
-
anchor: /* @__PURE__ */ (0,
|
|
1216
|
-
|
|
1312
|
+
anchor: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1313
|
+
import_dsh_client_ui_primitives2.Input,
|
|
1217
1314
|
{
|
|
1218
1315
|
type: "text",
|
|
1219
1316
|
className: "dsh-judge-field",
|
|
1220
1317
|
readOnly: true,
|
|
1221
|
-
value: draft.model
|
|
1318
|
+
value: draft.model,
|
|
1222
1319
|
placeholder: t("rows.modelPlaceholder"),
|
|
1223
1320
|
"aria-label": `${t("rows.colModel")} ${index + 1}`,
|
|
1224
1321
|
"aria-haspopup": "listbox",
|
|
@@ -1231,7 +1328,7 @@ function JudgeDispatchPanel(props) {
|
|
|
1231
1328
|
{ type: "label", id: "model", text: t("rows.colModel") },
|
|
1232
1329
|
...state.models.length === 0 ? [] : state.models.map((option) => ({
|
|
1233
1330
|
id: routeKey(option.provider, option.model),
|
|
1234
|
-
label: `${option.provider}/${option.
|
|
1331
|
+
label: `${option.provider}/${option.model}`
|
|
1235
1332
|
}))
|
|
1236
1333
|
],
|
|
1237
1334
|
selectedId: draft.model === "" ? void 0 : routeKey(draft.provider, draft.model),
|
|
@@ -1247,12 +1344,12 @@ function JudgeDispatchPanel(props) {
|
|
|
1247
1344
|
portal: true
|
|
1248
1345
|
}
|
|
1249
1346
|
) }),
|
|
1250
|
-
/* @__PURE__ */ (0,
|
|
1251
|
-
|
|
1347
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("td", { children: catalogOffersEffort ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1348
|
+
import_dsh_client_ui_primitives2.Menu,
|
|
1252
1349
|
{
|
|
1253
1350
|
open: openMenu?.index === index && openMenu.kind === "effort",
|
|
1254
|
-
anchor: /* @__PURE__ */ (0,
|
|
1255
|
-
|
|
1351
|
+
anchor: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1352
|
+
import_dsh_client_ui_primitives2.Input,
|
|
1256
1353
|
{
|
|
1257
1354
|
type: "text",
|
|
1258
1355
|
className: "dsh-judge-field",
|
|
@@ -1280,8 +1377,8 @@ function JudgeDispatchPanel(props) {
|
|
|
1280
1377
|
className: "dsh-judge-field-wrap",
|
|
1281
1378
|
portal: true
|
|
1282
1379
|
}
|
|
1283
|
-
) : /* @__PURE__ */ (0,
|
|
1284
|
-
|
|
1380
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1381
|
+
import_dsh_client_ui_primitives2.Input,
|
|
1285
1382
|
{
|
|
1286
1383
|
type: "text",
|
|
1287
1384
|
className: "dsh-judge-field",
|
|
@@ -1292,9 +1389,9 @@ function JudgeDispatchPanel(props) {
|
|
|
1292
1389
|
onBlur: commitRows
|
|
1293
1390
|
}
|
|
1294
1391
|
) }),
|
|
1295
|
-
/* @__PURE__ */ (0,
|
|
1296
|
-
/* @__PURE__ */ (0,
|
|
1297
|
-
|
|
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,
|
|
1298
1395
|
{
|
|
1299
1396
|
checked: draft.enabled,
|
|
1300
1397
|
onChange: (next) => dispatchCardStore.toggleRow(index, next),
|
|
@@ -1302,8 +1399,8 @@ function JudgeDispatchPanel(props) {
|
|
|
1302
1399
|
disabled: !state.writable
|
|
1303
1400
|
}
|
|
1304
1401
|
),
|
|
1305
|
-
/* @__PURE__ */ (0,
|
|
1306
|
-
|
|
1402
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1403
|
+
import_dsh_client_ui_primitives2.Button,
|
|
1307
1404
|
{
|
|
1308
1405
|
variant: "outline",
|
|
1309
1406
|
size: "sm",
|
|
@@ -1318,15 +1415,15 @@ function JudgeDispatchPanel(props) {
|
|
|
1318
1415
|
index
|
|
1319
1416
|
);
|
|
1320
1417
|
};
|
|
1321
|
-
const design = /* @__PURE__ */ (0,
|
|
1322
|
-
/* @__PURE__ */ (0,
|
|
1323
|
-
/* @__PURE__ */ (0,
|
|
1324
|
-
/* @__PURE__ */ (0,
|
|
1325
|
-
/* @__PURE__ */ (0,
|
|
1326
|
-
/* @__PURE__ */ (0,
|
|
1327
|
-
/* @__PURE__ */ (0,
|
|
1328
|
-
/* @__PURE__ */ (0,
|
|
1329
|
-
|
|
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,
|
|
1330
1427
|
{
|
|
1331
1428
|
variant: "outline",
|
|
1332
1429
|
size: "sm",
|
|
@@ -1337,14 +1434,14 @@ function JudgeDispatchPanel(props) {
|
|
|
1337
1434
|
)
|
|
1338
1435
|
] })
|
|
1339
1436
|
] }),
|
|
1340
|
-
/* @__PURE__ */ (0,
|
|
1341
|
-
/* @__PURE__ */ (0,
|
|
1342
|
-
/* @__PURE__ */ (0,
|
|
1343
|
-
/* @__PURE__ */ (0,
|
|
1344
|
-
/* @__PURE__ */ (0,
|
|
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") })
|
|
1345
1442
|
] }),
|
|
1346
|
-
/* @__PURE__ */ (0,
|
|
1347
|
-
|
|
1443
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1444
|
+
import_dsh_client_ui_primitives2.Switch,
|
|
1348
1445
|
{
|
|
1349
1446
|
checked: state.enabled,
|
|
1350
1447
|
onChange: (next) => dispatchCardStore.toggle("enabled", next),
|
|
@@ -1353,13 +1450,13 @@ function JudgeDispatchPanel(props) {
|
|
|
1353
1450
|
}
|
|
1354
1451
|
)
|
|
1355
1452
|
] }),
|
|
1356
|
-
/* @__PURE__ */ (0,
|
|
1357
|
-
/* @__PURE__ */ (0,
|
|
1358
|
-
/* @__PURE__ */ (0,
|
|
1359
|
-
/* @__PURE__ */ (0,
|
|
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") })
|
|
1360
1457
|
] }),
|
|
1361
|
-
/* @__PURE__ */ (0,
|
|
1362
|
-
|
|
1458
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1459
|
+
import_dsh_client_ui_primitives2.Switch,
|
|
1363
1460
|
{
|
|
1364
1461
|
checked: state.logEnabled,
|
|
1365
1462
|
onChange: (next) => dispatchCardStore.toggle("logEnabled", next),
|
|
@@ -1368,13 +1465,13 @@ function JudgeDispatchPanel(props) {
|
|
|
1368
1465
|
}
|
|
1369
1466
|
)
|
|
1370
1467
|
] }),
|
|
1371
|
-
/* @__PURE__ */ (0,
|
|
1372
|
-
/* @__PURE__ */ (0,
|
|
1373
|
-
/* @__PURE__ */ (0,
|
|
1374
|
-
/* @__PURE__ */ (0,
|
|
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") })
|
|
1375
1472
|
] }),
|
|
1376
|
-
/* @__PURE__ */ (0,
|
|
1377
|
-
|
|
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,
|
|
1378
1475
|
{
|
|
1379
1476
|
type: "text",
|
|
1380
1477
|
className: "dsh-judge-field",
|
|
@@ -1387,13 +1484,13 @@ function JudgeDispatchPanel(props) {
|
|
|
1387
1484
|
}
|
|
1388
1485
|
) })
|
|
1389
1486
|
] }),
|
|
1390
|
-
/* @__PURE__ */ (0,
|
|
1391
|
-
/* @__PURE__ */ (0,
|
|
1392
|
-
/* @__PURE__ */ (0,
|
|
1393
|
-
/* @__PURE__ */ (0,
|
|
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") })
|
|
1394
1491
|
] }),
|
|
1395
|
-
/* @__PURE__ */ (0,
|
|
1396
|
-
|
|
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,
|
|
1397
1494
|
{
|
|
1398
1495
|
type: "text",
|
|
1399
1496
|
className: "dsh-judge-field",
|
|
@@ -1406,14 +1503,14 @@ function JudgeDispatchPanel(props) {
|
|
|
1406
1503
|
}
|
|
1407
1504
|
) })
|
|
1408
1505
|
] }),
|
|
1409
|
-
/* @__PURE__ */ (0,
|
|
1410
|
-
/* @__PURE__ */ (0,
|
|
1411
|
-
/* @__PURE__ */ (0,
|
|
1412
|
-
/* @__PURE__ */ (0,
|
|
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 }) })
|
|
1413
1510
|
] }),
|
|
1414
|
-
/* @__PURE__ */ (0,
|
|
1415
|
-
/* @__PURE__ */ (0,
|
|
1416
|
-
|
|
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,
|
|
1417
1514
|
{
|
|
1418
1515
|
type: "password",
|
|
1419
1516
|
autoComplete: "new-password",
|
|
@@ -1431,30 +1528,30 @@ function JudgeDispatchPanel(props) {
|
|
|
1431
1528
|
}
|
|
1432
1529
|
}
|
|
1433
1530
|
),
|
|
1434
|
-
/* @__PURE__ */ (0,
|
|
1435
|
-
/* @__PURE__ */ (0,
|
|
1436
|
-
state.key.unavailable && /* @__PURE__ */ (0,
|
|
1437
|
-
state.key.failed && /* @__PURE__ */ (0,
|
|
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")) })
|
|
1438
1535
|
] })
|
|
1439
1536
|
] })
|
|
1440
1537
|
] }),
|
|
1441
|
-
probeResult !== null && /* @__PURE__ */ (0,
|
|
1442
|
-
copyNote !== null && copyNote.section === "judge" && /* @__PURE__ */ (0,
|
|
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 }),
|
|
1443
1540
|
failure("judge")
|
|
1444
1541
|
] }),
|
|
1445
|
-
/* @__PURE__ */ (0,
|
|
1446
|
-
/* @__PURE__ */ (0,
|
|
1447
|
-
/* @__PURE__ */ (0,
|
|
1448
|
-
/* @__PURE__ */ (0,
|
|
1449
|
-
/* @__PURE__ */ (0,
|
|
1450
|
-
/* @__PURE__ */ (0,
|
|
1451
|
-
/* @__PURE__ */ (0,
|
|
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") })
|
|
1452
1549
|
] })
|
|
1453
1550
|
] }),
|
|
1454
|
-
/* @__PURE__ */ (0,
|
|
1455
|
-
/* @__PURE__ */ (0,
|
|
1456
|
-
dispatchCardStore.canOpenOfficialSettings() && /* @__PURE__ */ (0,
|
|
1457
|
-
|
|
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,
|
|
1458
1555
|
{
|
|
1459
1556
|
variant: "ghost",
|
|
1460
1557
|
size: "sm",
|
|
@@ -1464,62 +1561,62 @@ function JudgeDispatchPanel(props) {
|
|
|
1464
1561
|
}
|
|
1465
1562
|
)
|
|
1466
1563
|
] }),
|
|
1467
|
-
state.models.length === 0 && /* @__PURE__ */ (0,
|
|
1468
|
-
state.rows.length === 0 && /* @__PURE__ */ (0,
|
|
1469
|
-
state.rows.length > 0 && /* @__PURE__ */ (0,
|
|
1470
|
-
/* @__PURE__ */ (0,
|
|
1471
|
-
/* @__PURE__ */ (0,
|
|
1472
|
-
/* @__PURE__ */ (0,
|
|
1473
|
-
/* @__PURE__ */ (0,
|
|
1474
|
-
/* @__PURE__ */ (0,
|
|
1475
|
-
/* @__PURE__ */ (0,
|
|
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" })
|
|
1476
1573
|
] }) }),
|
|
1477
|
-
/* @__PURE__ */ (0,
|
|
1574
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("tbody", { children: state.rows.map((draft, index) => row(draft, index)) })
|
|
1478
1575
|
] }),
|
|
1479
|
-
copyNote !== null && copyNote.section === "rows" && /* @__PURE__ */ (0,
|
|
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 }),
|
|
1480
1577
|
failure("rows")
|
|
1481
1578
|
] }),
|
|
1482
|
-
/* @__PURE__ */ (0,
|
|
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") }) })
|
|
1483
1580
|
] });
|
|
1484
|
-
const log = /* @__PURE__ */ (0,
|
|
1485
|
-
/* @__PURE__ */ (0,
|
|
1486
|
-
/* @__PURE__ */ (0,
|
|
1487
|
-
/* @__PURE__ */ (0,
|
|
1488
|
-
/* @__PURE__ */ (0,
|
|
1489
|
-
/* @__PURE__ */ (0,
|
|
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") })
|
|
1490
1587
|
] })
|
|
1491
1588
|
] }),
|
|
1492
|
-
logCopyResult !== null && /* @__PURE__ */ (0,
|
|
1493
|
-
/* @__PURE__ */ (0,
|
|
1494
|
-
state.logFailed && /* @__PURE__ */ (0,
|
|
1495
|
-
state.logLoaded && state.log.length === 0 && /* @__PURE__ */ (0,
|
|
1496
|
-
state.log.length > 0 && /* @__PURE__ */ (0,
|
|
1497
|
-
/* @__PURE__ */ (0,
|
|
1498
|
-
/* @__PURE__ */ (0,
|
|
1499
|
-
/* @__PURE__ */ (0,
|
|
1500
|
-
/* @__PURE__ */ (0,
|
|
1501
|
-
/* @__PURE__ */ (0,
|
|
1502
|
-
/* @__PURE__ */ (0,
|
|
1503
|
-
/* @__PURE__ */ (0,
|
|
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") })
|
|
1504
1601
|
] }),
|
|
1505
1602
|
state.log.map((entry, index) => {
|
|
1506
1603
|
const result = entry.typeId === null ? {
|
|
1507
1604
|
text: t("log.resultInherited"),
|
|
1508
1605
|
hint: entry.reason === void 0 ? "" : reasonText(entry.reason)
|
|
1509
1606
|
} : { text: t("log.resultJudged").replace("{id}", String(entry.typeId)), hint: "" };
|
|
1510
|
-
return /* @__PURE__ */ (0,
|
|
1607
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
1511
1608
|
"button",
|
|
1512
1609
|
{
|
|
1513
1610
|
type: "button",
|
|
1514
1611
|
className: "dsh-judge-log-row",
|
|
1515
1612
|
onClick: () => setDetail(entry),
|
|
1516
1613
|
children: [
|
|
1517
|
-
/* @__PURE__ */ (0,
|
|
1518
|
-
/* @__PURE__ */ (0,
|
|
1519
|
-
/* @__PURE__ */ (0,
|
|
1520
|
-
/* @__PURE__ */ (0,
|
|
1521
|
-
/* @__PURE__ */ (0,
|
|
1522
|
-
/* @__PURE__ */ (0,
|
|
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)) })
|
|
1523
1620
|
]
|
|
1524
1621
|
},
|
|
1525
1622
|
index
|
|
@@ -1527,9 +1624,9 @@ function JudgeDispatchPanel(props) {
|
|
|
1527
1624
|
})
|
|
1528
1625
|
] })
|
|
1529
1626
|
] }) });
|
|
1530
|
-
return /* @__PURE__ */ (0,
|
|
1531
|
-
/* @__PURE__ */ (0,
|
|
1532
|
-
|
|
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,
|
|
1533
1630
|
{
|
|
1534
1631
|
items: [
|
|
1535
1632
|
{ value: "design", label: t("tab.design"), id: "judge-tab-design", panelId: "judge-panel-design" },
|
|
@@ -1544,8 +1641,8 @@ function JudgeDispatchPanel(props) {
|
|
|
1544
1641
|
}
|
|
1545
1642
|
),
|
|
1546
1643
|
tab === "design" ? design : log,
|
|
1547
|
-
/* @__PURE__ */ (0,
|
|
1548
|
-
|
|
1644
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
1645
|
+
import_dsh_client_ui_primitives2.Modal,
|
|
1549
1646
|
{
|
|
1550
1647
|
open: previewOpen,
|
|
1551
1648
|
onClose: () => setPreviewOpen(false),
|
|
@@ -1553,13 +1650,13 @@ function JudgeDispatchPanel(props) {
|
|
|
1553
1650
|
closeLabel: t("preview.close"),
|
|
1554
1651
|
className: "dsh-judge-modal",
|
|
1555
1652
|
children: [
|
|
1556
|
-
/* @__PURE__ */ (0,
|
|
1557
|
-
/* @__PURE__ */ (0,
|
|
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") }) })
|
|
1558
1655
|
]
|
|
1559
1656
|
}
|
|
1560
1657
|
),
|
|
1561
|
-
/* @__PURE__ */ (0,
|
|
1562
|
-
|
|
1658
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
1659
|
+
import_dsh_client_ui_primitives2.Modal,
|
|
1563
1660
|
{
|
|
1564
1661
|
open: importSection !== null,
|
|
1565
1662
|
onClose: closeImport,
|
|
@@ -1567,12 +1664,12 @@ function JudgeDispatchPanel(props) {
|
|
|
1567
1664
|
closeLabel: t(importSection === "judge" ? "judge.importClose" : "rows.importClose"),
|
|
1568
1665
|
description: t(importSection === "judge" ? "judge.importDesc" : "rows.importDesc"),
|
|
1569
1666
|
className: "dsh-judge-modal",
|
|
1570
|
-
footer: /* @__PURE__ */ (0,
|
|
1571
|
-
/* @__PURE__ */ (0,
|
|
1572
|
-
/* @__PURE__ */ (0,
|
|
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") })
|
|
1573
1670
|
] }),
|
|
1574
1671
|
children: [
|
|
1575
|
-
/* @__PURE__ */ (0,
|
|
1672
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1576
1673
|
"textarea",
|
|
1577
1674
|
{
|
|
1578
1675
|
className: "dsh-judge-paste",
|
|
@@ -1587,12 +1684,12 @@ function JudgeDispatchPanel(props) {
|
|
|
1587
1684
|
}
|
|
1588
1685
|
}
|
|
1589
1686
|
),
|
|
1590
|
-
importError !== "" && /* @__PURE__ */ (0,
|
|
1687
|
+
importError !== "" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-note-bad", role: "alert", children: importError })
|
|
1591
1688
|
]
|
|
1592
1689
|
}
|
|
1593
1690
|
),
|
|
1594
|
-
/* @__PURE__ */ (0,
|
|
1595
|
-
|
|
1691
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1692
|
+
import_dsh_client_ui_primitives2.Modal,
|
|
1596
1693
|
{
|
|
1597
1694
|
open: detail !== null,
|
|
1598
1695
|
onClose: () => setDetail(null),
|
|
@@ -1600,8 +1697,8 @@ function JudgeDispatchPanel(props) {
|
|
|
1600
1697
|
closeLabel: t("log.promptClose"),
|
|
1601
1698
|
description: t("log.promptDesc"),
|
|
1602
1699
|
className: "dsh-judge-modal",
|
|
1603
|
-
children: detail !== null && (detail.prompt === "" ? /* @__PURE__ */ (0,
|
|
1604
|
-
|
|
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,
|
|
1605
1702
|
{
|
|
1606
1703
|
code: detail.prompt,
|
|
1607
1704
|
copyLabel: t("preview.copy"),
|
|
@@ -1654,6 +1751,12 @@ var inject = ["slots", "configForms", "remote", "remote.session", "remote.creden
|
|
|
1654
1751
|
function apply2(ctx) {
|
|
1655
1752
|
injectCardStyles();
|
|
1656
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));
|
|
1657
1760
|
ctx.effect(
|
|
1658
1761
|
() => {
|
|
1659
1762
|
setupSettingsUi(ctx);
|