@lynn123411/dsh-subagent-judge-dispatch 0.6.6 → 0.6.8
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 +24 -23
- package/lib/client.js +275 -250
- package/lib/client.js.map +4 -4
- package/lib/index.js +499 -313
- package/lib/index.js.map +4 -4
- package/package.json +17 -13
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";
|
|
@@ -67,29 +129,6 @@ function setupPluginPage(slots, register) {
|
|
|
67
129
|
return slots.inject(BUNDLE_CONFIG_SLOT, register);
|
|
68
130
|
}
|
|
69
131
|
|
|
70
|
-
// src/client/settings/official-settings.ts
|
|
71
|
-
var SUBAGENT_ITEM_ID = "subagent";
|
|
72
|
-
var OPEN_BUDGET_MS = 1500;
|
|
73
|
-
var OPEN_POLL_MS = 50;
|
|
74
|
-
function createOfficialSettingsOpener(navigation) {
|
|
75
|
-
if (navigation === void 0 || typeof navigation.openList !== "function") return null;
|
|
76
|
-
return () => {
|
|
77
|
-
navigation.openList();
|
|
78
|
-
const deadline = Date.now() + OPEN_BUDGET_MS;
|
|
79
|
-
const press = () => {
|
|
80
|
-
const card = document.querySelector(
|
|
81
|
-
`[data-plugin-item="${SUBAGENT_ITEM_ID}"] button`
|
|
82
|
-
);
|
|
83
|
-
if (card !== null) {
|
|
84
|
-
card.click();
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
if (Date.now() < deadline) setTimeout(press, OPEN_POLL_MS);
|
|
88
|
-
};
|
|
89
|
-
setTimeout(press, 0);
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
|
|
93
132
|
// src/server/judge-prompt.ts
|
|
94
133
|
function isSelectableRow(row) {
|
|
95
134
|
return row.provider.trim() !== "" && row.model.trim() !== "" && row.effort.trim() !== "";
|
|
@@ -99,7 +138,6 @@ function isSelectableRow(row) {
|
|
|
99
138
|
var JUDGE_API_KEY_REF = "SUBAGENT_JUDGE_API_KEY";
|
|
100
139
|
|
|
101
140
|
// src/client/settings/store.ts
|
|
102
|
-
var SETTINGS_NAMESPACE = "dsh-subagent-judge-dispatch";
|
|
103
141
|
var ALLOWED_MODELS_NAMESPACE = "subagent-model-selection-settings";
|
|
104
142
|
var LOG_ROUTE_PATH = "/api/dsh-subagent-judge-dispatch/log";
|
|
105
143
|
var PREVIEW_ROUTE_PATH = "/api/dsh-subagent-judge-dispatch/preview";
|
|
@@ -313,7 +351,7 @@ var DispatchCardStore = class {
|
|
|
313
351
|
state = {
|
|
314
352
|
available: false,
|
|
315
353
|
writable: false,
|
|
316
|
-
enabled:
|
|
354
|
+
enabled: DEFAULT_ENABLED,
|
|
317
355
|
logEnabled: true,
|
|
318
356
|
endpointUrl: "",
|
|
319
357
|
judgeModel: "",
|
|
@@ -321,7 +359,7 @@ var DispatchCardStore = class {
|
|
|
321
359
|
models: [],
|
|
322
360
|
catalogRead: false,
|
|
323
361
|
committed: {
|
|
324
|
-
enabled:
|
|
362
|
+
enabled: DEFAULT_ENABLED,
|
|
325
363
|
logEnabled: true,
|
|
326
364
|
endpointUrl: "",
|
|
327
365
|
judgeModel: "",
|
|
@@ -345,7 +383,6 @@ var DispatchCardStore = class {
|
|
|
345
383
|
credentials = null;
|
|
346
384
|
offForm = null;
|
|
347
385
|
offAllowed = null;
|
|
348
|
-
officialSettingsOpener = null;
|
|
349
386
|
translate = (key) => key;
|
|
350
387
|
/** Bind the Host services; re-binding detaches the previous subscriptions. */
|
|
351
388
|
attach(options) {
|
|
@@ -356,7 +393,6 @@ var DispatchCardStore = class {
|
|
|
356
393
|
this.session = options.session;
|
|
357
394
|
this.remote = options.remote;
|
|
358
395
|
this.credentials = options.credentials;
|
|
359
|
-
this.officialSettingsOpener = options.officialSettingsOpener;
|
|
360
396
|
this.translate = options.t;
|
|
361
397
|
this.state = {
|
|
362
398
|
...this.state,
|
|
@@ -430,7 +466,7 @@ var DispatchCardStore = class {
|
|
|
430
466
|
if (value === void 0) return;
|
|
431
467
|
const rows = Array.isArray(value.rows) ? value.rows.map(readRow) : [];
|
|
432
468
|
const committed = {
|
|
433
|
-
enabled: typeof value.enabled === "boolean" ? value.enabled :
|
|
469
|
+
enabled: typeof value.enabled === "boolean" ? value.enabled : DEFAULT_ENABLED,
|
|
434
470
|
logEnabled: typeof value.logEnabled === "boolean" ? value.logEnabled : true,
|
|
435
471
|
endpointUrl: typeof value.endpointUrl === "string" ? value.endpointUrl : "",
|
|
436
472
|
judgeModel: typeof value.judgeModel === "string" ? value.judgeModel : "",
|
|
@@ -547,13 +583,11 @@ var DispatchCardStore = class {
|
|
|
547
583
|
void this.commit("rows");
|
|
548
584
|
}
|
|
549
585
|
/**
|
|
550
|
-
* Write one section's staged edits as one
|
|
586
|
+
* Write one section's staged edits as one batch.
|
|
551
587
|
*
|
|
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.
|
|
588
|
+
* The card queues commits so each one reads the latest drafts and committed
|
|
589
|
+
* values after the previous commit settles. The shared form orders these
|
|
590
|
+
* writes with the session menu's writes and supplies their revision fences.
|
|
557
591
|
*
|
|
558
592
|
* The judgement section also writes a typed key, so leaving the key field and
|
|
559
593
|
* leaving the endpoint field are one kind of gesture. The type rows are written
|
|
@@ -618,7 +652,7 @@ var DispatchCardStore = class {
|
|
|
618
652
|
}
|
|
619
653
|
if (failure === "" && ops.length > 0) {
|
|
620
654
|
try {
|
|
621
|
-
const landed = await form.mutate(ops
|
|
655
|
+
const landed = await form.mutate(ops);
|
|
622
656
|
if (!landed) failure = this.translate("write.refused");
|
|
623
657
|
} catch (error) {
|
|
624
658
|
failure = error instanceof Error && error.message !== "" ? error.message : this.translate("write.invalid");
|
|
@@ -667,14 +701,6 @@ var DispatchCardStore = class {
|
|
|
667
701
|
return { ok: false, error: message };
|
|
668
702
|
}
|
|
669
703
|
}
|
|
670
|
-
/** Whether this page can open the official setting the type list depends on. */
|
|
671
|
-
canOpenOfficialSettings() {
|
|
672
|
-
return this.officialSettingsOpener !== null;
|
|
673
|
-
}
|
|
674
|
-
/** Open the official setting the type list depends on. */
|
|
675
|
-
openOfficialSettings() {
|
|
676
|
-
this.officialSettingsOpener?.();
|
|
677
|
-
}
|
|
678
704
|
/** Read the runtime log from the Host. */
|
|
679
705
|
async refreshLog() {
|
|
680
706
|
if (this.remote === null) return;
|
|
@@ -730,8 +756,10 @@ var NS = "subagentjudgedispatch";
|
|
|
730
756
|
var en = {
|
|
731
757
|
"tab.design": "Design",
|
|
732
758
|
"tab.log": "Log",
|
|
733
|
-
"switch.rewrite.title": "
|
|
734
|
-
"switch.rewrite.desc": "
|
|
759
|
+
"switch.rewrite.title": "Enable judge dispatch by default",
|
|
760
|
+
"switch.rewrite.desc": "Applies to conversations without their own choice in the model menu.",
|
|
761
|
+
"sessionToggle.label": "Subagent judge dispatch",
|
|
762
|
+
"sessionToggle.failed": "Could not save judge dispatch for this conversation.",
|
|
735
763
|
"switch.log.title": "Record the log",
|
|
736
764
|
"switch.log.desc": "Write every judgement to a file under the DSH home, so it survives a restart.",
|
|
737
765
|
"judge.title": "Judgement service",
|
|
@@ -772,6 +800,7 @@ var en = {
|
|
|
772
800
|
"reason.timeout": "it did not answer within 5 seconds",
|
|
773
801
|
"reason.unmatched": "the answer named no listed type",
|
|
774
802
|
"reason.incomplete": "the selected type is not filled in",
|
|
803
|
+
"reason.unavailable-route": "the selected model or effort is unavailable",
|
|
775
804
|
"reason.other": "other",
|
|
776
805
|
"reason.unknown": "unknown reason",
|
|
777
806
|
"rows.title": "Task types",
|
|
@@ -790,8 +819,7 @@ var en = {
|
|
|
790
819
|
"rows.effortPlaceholder": "Not chosen",
|
|
791
820
|
"rows.incomplete": "Not used",
|
|
792
821
|
"rows.descriptionPlaceholder": "What kind of job is this? Write as much as you like.",
|
|
793
|
-
"rows.dependsOn":
|
|
794
|
-
"rows.dependsOnOpen": "Open",
|
|
822
|
+
"rows.dependsOn": "Under Plugins \u2192 Official \u2192 Subagent, enable model selection and add allowed models. If it is off, the child keeps its original model.",
|
|
795
823
|
"rows.allowedEmpty": "The official setting offers no model yet; fill it in and the options appear here.",
|
|
796
824
|
"rows.importOpen": "Import",
|
|
797
825
|
"rows.export": "Export",
|
|
@@ -817,22 +845,20 @@ var en = {
|
|
|
817
845
|
"write.invalid": "This could not be written.",
|
|
818
846
|
"write.refused": "The host did not accept this write.",
|
|
819
847
|
"log.title": "Judgement log",
|
|
820
|
-
"log.desc": "The most recent
|
|
848
|
+
"log.desc": "The 10 most recent judgements. Open an entry to see its request metrics.",
|
|
821
849
|
"log.empty": "No judgement has run yet.",
|
|
822
850
|
"log.colResult": "Result",
|
|
823
851
|
"log.colChoice": "Choice",
|
|
824
|
-
"log.colParent": "Main agent",
|
|
825
|
-
"log.colChild": "Subagent",
|
|
826
852
|
"log.colTime": "Time",
|
|
827
853
|
"log.colLatency": "Took",
|
|
828
854
|
"log.resultJudged": "Type {id}",
|
|
829
855
|
"log.resultInherited": "No match",
|
|
830
|
-
"log.promptTitle": "
|
|
831
|
-
"log.promptDesc": "
|
|
856
|
+
"log.promptTitle": "Judgement request metrics",
|
|
857
|
+
"log.promptDesc": "Judge model, number of offered choices, and input length.",
|
|
832
858
|
"log.promptClose": "Close",
|
|
833
|
-
"log.promptEmpty": "No request was
|
|
834
|
-
"log.copyAnalysis": "
|
|
835
|
-
"log.analysisPrompt": "Analyze the latest 100
|
|
859
|
+
"log.promptEmpty": "No judge request was attempted.",
|
|
860
|
+
"log.copyAnalysis": "Analyze judgement results",
|
|
861
|
+
"log.analysisPrompt": "Analyze the latest 100 records in dsh-subagent-judge-dispatch/judgements.json under DSH_HOME (default ~/.dsh). Summarize results by type, fallback reasons, and latency. Type numbering can change when the list is edited. Do not infer whether individual tasks were classified correctly from metrics alone.",
|
|
836
862
|
"log.analysisCopied": "Analysis prompt copied.",
|
|
837
863
|
"log.analysisCopyFailed": "Could not copy to the clipboard.",
|
|
838
864
|
"log.refresh": "Refresh",
|
|
@@ -842,8 +868,10 @@ var en = {
|
|
|
842
868
|
var zh = {
|
|
843
869
|
"tab.design": "\u8BBE\u8BA1",
|
|
844
870
|
"tab.log": "\u65E5\u5FD7",
|
|
845
|
-
"switch.rewrite.title": "\
|
|
846
|
-
"switch.rewrite.desc": "\
|
|
871
|
+
"switch.rewrite.title": "\u9ED8\u8BA4\u5F00\u542F\u5224\u65AD\u5F0F\u5B50\u4EE3\u7406\u6307\u6D3E",
|
|
872
|
+
"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",
|
|
873
|
+
"sessionToggle.label": "\u5224\u65AD\u5F0F\u5B50\u4EE3\u7406\u6307\u6D3E",
|
|
874
|
+
"sessionToggle.failed": "\u672C\u4F1A\u8BDD\u7684\u5224\u65AD\u5F0F\u5B50\u4EE3\u7406\u6307\u6D3E\u8BBE\u7F6E\u672A\u80FD\u4FDD\u5B58\u3002",
|
|
847
875
|
"switch.log.title": "\u8BB0\u5F55\u65E5\u5FD7",
|
|
848
876
|
"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
877
|
"judge.title": "\u5224\u65AD\u670D\u52A1",
|
|
@@ -881,9 +909,10 @@ var zh = {
|
|
|
881
909
|
"judge.probeFail": "\u7528\u4E0D\u4E86\uFF1A{reason}",
|
|
882
910
|
"reason.unconfigured": "\u7AEF\u70B9\u5730\u5740\u6216\u5224\u65AD\u6A21\u578B\u8FD8\u6CA1\u586B",
|
|
883
911
|
"reason.unreachable": "\u8FDE\u4E0D\u4E0A\u8FD9\u4E2A\u5730\u5740",
|
|
884
|
-
"reason.timeout": "\
|
|
912
|
+
"reason.timeout": "\u5224\u65AD\u6216\u8DEF\u7EBF\u6821\u9A8C\u8D85\u8FC7 5 \u79D2",
|
|
885
913
|
"reason.unmatched": "\u7B54\u590D\u5BF9\u4E0D\u4E0A\u6E05\u5355",
|
|
886
914
|
"reason.incomplete": "\u9009\u4E2D\u7684\u7C7B\u578B\u6CA1\u586B\u5168",
|
|
915
|
+
"reason.unavailable-route": "\u9009\u4E2D\u7684\u6A21\u578B\u6216\u63A8\u7406\u7B49\u7EA7\u5F53\u524D\u4E0D\u53EF\u7528",
|
|
887
916
|
"reason.other": "\u5176\u4ED6",
|
|
888
917
|
"reason.unknown": "\u539F\u56E0\u4E0D\u660E",
|
|
889
918
|
"rows.title": "\u4EFB\u52A1\u7C7B\u578B",
|
|
@@ -902,8 +931,7 @@ var zh = {
|
|
|
902
931
|
"rows.effortPlaceholder": "\u8FD8\u6CA1\u9009",
|
|
903
932
|
"rows.incomplete": "\u4E0D\u751F\u6548",
|
|
904
933
|
"rows.descriptionPlaceholder": "\u8FD9\u662F\u54EA\u79CD\u6D3B\uFF1F\u5199\u591A\u5C11\u90FD\u884C\u3002",
|
|
905
|
-
"rows.dependsOn": "\
|
|
906
|
-
"rows.dependsOnOpen": "\u53BB\u8BBE\u7F6E",
|
|
934
|
+
"rows.dependsOn": "\u8BF7\u5728\u300C\u63D2\u4EF6 \u2192 \u5B98\u65B9 \u2192 \u5B50\u667A\u80FD\u4F53\u300D\u4E2D\u5F00\u542F\u6A21\u578B\u9009\u62E9\u5E76\u6DFB\u52A0\u5141\u8BB8\u7684\u6A21\u578B\u3002\u5173\u95ED\u65F6\uFF0C\u5B50\u4EE3\u7406\u6CBF\u7528\u539F\u8DEF\u7EBF\u3002",
|
|
907
935
|
"rows.allowedEmpty": "\u5B98\u65B9\u914D\u7F6E\u91CC\u8FD8\u6CA1\u6709\u53EF\u9009\u6A21\u578B\uFF0C\u586B\u4E0A\u4E4B\u540E\u8FD9\u91CC\u624D\u6709\u53EF\u9009\u9879\u3002",
|
|
908
936
|
"rows.importOpen": "\u5BFC\u5165",
|
|
909
937
|
"rows.export": "\u5BFC\u51FA",
|
|
@@ -929,22 +957,20 @@ var zh = {
|
|
|
929
957
|
"write.invalid": "\u8FD9\u6B21\u5199\u5165\u6CA1\u88AB\u63A5\u53D7\u3002",
|
|
930
958
|
"write.refused": "\u5BBF\u4E3B\u6CA1\u6709\u63A5\u53D7\u8FD9\u6B21\u5199\u5165\u3002",
|
|
931
959
|
"log.title": "\u5224\u65AD\u65E5\u5FD7",
|
|
932
|
-
"log.desc": "\u6700\u8FD1 10 \
|
|
960
|
+
"log.desc": "\u663E\u793A\u6700\u8FD1 10 \u6B21\u5224\u65AD\u3002\u70B9\u5F00\u4E00\u884C\u67E5\u770B\u5F53\u6B21\u8BF7\u6C42\u7684\u7EDF\u8BA1\u3002",
|
|
933
961
|
"log.empty": "\u8FD8\u6CA1\u6709\u5224\u65AD\u8FC7\u3002",
|
|
934
962
|
"log.colResult": "\u7ED3\u679C",
|
|
935
963
|
"log.colChoice": "\u9009\u62E9",
|
|
936
|
-
"log.colParent": "\u4E3B\u4EE3\u7406",
|
|
937
|
-
"log.colChild": "\u5B50\u4EE3\u7406",
|
|
938
964
|
"log.colTime": "\u65F6\u95F4",
|
|
939
965
|
"log.colLatency": "\u8017\u65F6",
|
|
940
966
|
"log.resultJudged": "\u7C7B\u578B {id}",
|
|
941
967
|
"log.resultInherited": "\u672A\u5224\u6210",
|
|
942
|
-
"log.promptTitle": "\
|
|
943
|
-
"log.promptDesc": "\
|
|
968
|
+
"log.promptTitle": "\u5224\u65AD\u8BF7\u6C42\u7EDF\u8BA1",
|
|
969
|
+
"log.promptDesc": "\u5224\u65AD\u6A21\u578B\u3001\u53EF\u9009\u7C7B\u578B\u6570\u548C\u8F93\u5165\u957F\u5EA6\u3002",
|
|
944
970
|
"log.promptClose": "\u5173\u95ED",
|
|
945
|
-
"log.promptEmpty": "\u8FD9\u6B21\
|
|
946
|
-
"log.copyAnalysis": "\
|
|
947
|
-
"log.analysisPrompt": "\u8BF7\u5206\u6790 DSH \u5BB6\u76EE\u5F55\uFF08DSH_HOME\uFF0C\u9ED8\u8BA4 ~/.dsh\uFF09\u4E0B dsh-subagent-judge-dispatch/judgements.json \u4E2D\u6700\u8FD1 100 \u6761\u5224\u65AD\
|
|
971
|
+
"log.promptEmpty": "\u8FD9\u6B21\u6CA1\u6709\u5C1D\u8BD5\u53D1\u9001\u5224\u65AD\u8BF7\u6C42\u3002",
|
|
972
|
+
"log.copyAnalysis": "\u5206\u6790\u5224\u65AD\u7ED3\u679C",
|
|
973
|
+
"log.analysisPrompt": "\u8BF7\u5206\u6790 DSH \u5BB6\u76EE\u5F55\uFF08DSH_HOME\uFF0C\u9ED8\u8BA4 ~/.dsh\uFF09\u4E0B dsh-subagent-judge-dispatch/judgements.json \u4E2D\u6700\u8FD1 100 \u6761\u5224\u65AD\u8BB0\u5F55\u3002\u7EDF\u8BA1\u5404\u7C7B\u578B\u7684\u5224\u65AD\u6B21\u6570\u3001\u5931\u8D25\u539F\u56E0\u548C\u8017\u65F6\u3002\u6E05\u5355\u6539\u52A8\u540E\u7C7B\u578B\u7F16\u53F7\u53EF\u80FD\u53D8\u5316\uFF0C\u4EC5\u51ED\u8FD9\u4E9B\u6307\u6807\u65E0\u6CD5\u5224\u65AD\u5355\u4E2A\u4EFB\u52A1\u662F\u5426\u88AB\u6B63\u786E\u5F52\u7C7B\u3002",
|
|
948
974
|
"log.analysisCopied": "\u5DF2\u590D\u5236\u5206\u6790\u63D0\u793A\u8BCD\u3002",
|
|
949
975
|
"log.analysisCopyFailed": "\u590D\u5236\u5230\u526A\u8D34\u677F\u6CA1\u6210\u529F\u3002",
|
|
950
976
|
"log.refresh": "\u5237\u65B0",
|
|
@@ -956,7 +982,7 @@ function apply(ctx) {
|
|
|
956
982
|
}
|
|
957
983
|
|
|
958
984
|
// src/client/settings/ui.tsx
|
|
959
|
-
var
|
|
985
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
960
986
|
var IMPORT_ERROR_KEYS = {
|
|
961
987
|
rows: {
|
|
962
988
|
json: "rows.importBadJson",
|
|
@@ -974,16 +1000,34 @@ function withSamples(text, samples) {
|
|
|
974
1000
|
return text.split(/(\{\w+\})/g).map((part, index) => {
|
|
975
1001
|
const name2 = /^\{\w+\}$/.test(part) ? part.slice(1, -1) : "";
|
|
976
1002
|
const sample = name2 === "" ? void 0 : samples[name2];
|
|
977
|
-
return sample === void 0 ? part : /* @__PURE__ */ (0,
|
|
1003
|
+
return sample === void 0 ? part : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("code", { children: sample }, index);
|
|
978
1004
|
});
|
|
979
1005
|
}
|
|
980
1006
|
function LogCell({ text, hint }) {
|
|
981
1007
|
const label = hint === void 0 || hint === "" ? text : hint;
|
|
982
|
-
return /* @__PURE__ */ (0,
|
|
1008
|
+
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
1009
|
}
|
|
984
1010
|
var CARD_CSS = `
|
|
985
1011
|
.dsh-judge-card { display: flex; flex-direction: column; gap: 16px; box-sizing: border-box; width: 100%; color: var(--dsw-alias-label-primary); }
|
|
986
1012
|
.dsh-judge-panel { display: flex; flex-direction: column; gap: 16px; }
|
|
1013
|
+
.dsh-judge-session-toggle {
|
|
1014
|
+
position: relative;
|
|
1015
|
+
display: flex;
|
|
1016
|
+
align-items: center;
|
|
1017
|
+
justify-content: space-between;
|
|
1018
|
+
gap: 16px;
|
|
1019
|
+
min-height: 34px;
|
|
1020
|
+
padding: 0 8px;
|
|
1021
|
+
border-radius: var(--dsw-radius-md);
|
|
1022
|
+
color: var(--dsw-alias-label-primary);
|
|
1023
|
+
font: var(--dsw-font-xs-13);
|
|
1024
|
+
}
|
|
1025
|
+
.dsh-judge-session-toggle .dsh-judge-session-switch { position: static; }
|
|
1026
|
+
.dsh-judge-session-switch::after { content: ''; position: absolute; inset: 0; border-radius: var(--dsw-radius-md); }
|
|
1027
|
+
.dsh-judge-session-toggle:has(.dsh-judge-session-switch:focus-visible) { background: var(--dsw-alias-interactive-bg-hover); }
|
|
1028
|
+
@media (hover: hover) {
|
|
1029
|
+
.dsh-judge-session-toggle:has(.dsh-judge-session-switch:not(:disabled)):hover { background: var(--dsw-alias-interactive-bg-hover); }
|
|
1030
|
+
}
|
|
987
1031
|
.dsh-judge-section {
|
|
988
1032
|
display: flex;
|
|
989
1033
|
flex-direction: column;
|
|
@@ -1027,11 +1071,7 @@ var CARD_CSS = `
|
|
|
1027
1071
|
/* \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 */
|
|
1028
1072
|
.dsh-judge-actions-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
|
|
1029
1073
|
/* \u4EFB\u52A1\u7C7B\u578B\u90A3\u4E00\u8282\u9876\u90E8\u7684\u4E00\u884C\uFF1A\u4F9D\u8D56\u54EA\u4EFD\u5B98\u65B9\u914D\u7F6E\uFF0C\u4EE5\u53CA\u53BB\u90A3\u91CC\u7684\u5165\u53E3\u3002 */
|
|
1030
|
-
.dsh-judge-dependency { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px; }
|
|
1031
|
-
.dsh-judge-dependency .dsh-judge-desc { max-width: none; }
|
|
1032
1074
|
/* \u5165\u53E3\u6309\u94FE\u63A5\u7684\u6837\u5B50\u8D70\uFF1A\u6CA1\u6709\u6309\u94AE\u7684\u76D2\u5B50\u548C\u5E95\u8272\uFF0C\u53EA\u5728\u60AC\u505C\u65F6\u52A0\u4E0B\u5212\u7EBF\u3002 */
|
|
1033
|
-
.dsh-judge-link { height: auto; padding: 0 2px; color: var(--dsw-alias-link); font: var(--dsw-font-xxs-12); }
|
|
1034
|
-
.dsh-judge-link:hover { color: var(--dsw-alias-link); background: none; text-decoration: underline; }
|
|
1035
1075
|
/* \u5361\u7247\u6700\u4E0B\u9762\u7684\u51FA\u53E3\uFF1A\u53EA\u6709\u9884\u89C8\u8FD9\u4E00\u4EF6\u8DE8\u8282\u7684\u52A8\u4F5C\uFF0C\u9760\u53F3\u4E0E\u4E24\u8282\u7684\u53F3\u8FB9\u7F18\u5BF9\u9F50\u3002 */
|
|
1036
1076
|
.dsh-judge-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
|
|
1037
1077
|
.dsh-judge-hint { color: var(--dsw-alias-label-tertiary); font: var(--dsw-font-xxs-12); }
|
|
@@ -1058,9 +1098,8 @@ var CARD_CSS = `
|
|
|
1058
1098
|
.dsh-judge-row-off .dsh-judge-field { opacity: 0.6; }
|
|
1059
1099
|
.dsh-judge-cell-actions { display: flex; gap: 6px; }
|
|
1060
1100
|
.dsh-judge-log { display: flex; flex-direction: column; gap: 4px; font: var(--dsw-font-xxs-12); }
|
|
1061
|
-
/*
|
|
1062
|
-
|
|
1063
|
-
.dsh-judge-log-row { display: grid; grid-template-columns: 72px minmax(0, 2.2fr) minmax(0, 1.2fr) minmax(0, 1.2fr) 62px 74px; gap: 8px; align-items: center; text-align: left; border: 0; background: none; padding: 6px 4px; border-radius: var(--dsw-radius-sm); cursor: pointer; color: inherit; font: inherit; }
|
|
1101
|
+
/* Allow the model column to shrink so long names can be clipped. */
|
|
1102
|
+
.dsh-judge-log-row { display: grid; grid-template-columns: 72px minmax(0, 1fr) 62px 74px; gap: 8px; align-items: center; text-align: left; border: 0; background: none; padding: 6px 4px; border-radius: var(--dsw-radius-sm); cursor: pointer; color: inherit; font: inherit; }
|
|
1064
1103
|
.dsh-judge-cell-clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
1065
1104
|
.dsh-judge-log-row:hover { background: var(--dsw-alias-interactive-bg-hover); }
|
|
1066
1105
|
.dsh-judge-log-head { font-weight: 600; color: var(--dsw-alias-label-tertiary); cursor: default; }
|
|
@@ -1075,34 +1114,35 @@ var CARD_CSS = `
|
|
|
1075
1114
|
.dsh-judge-paste:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--dsw-alias-state-business-primary); }
|
|
1076
1115
|
`;
|
|
1077
1116
|
function injectCardStyles() {
|
|
1078
|
-
if (typeof document === "undefined") return
|
|
1079
|
-
|
|
1117
|
+
if (typeof document === "undefined" || document.getElementById(STYLE_ID) !== null) return () => {
|
|
1118
|
+
};
|
|
1080
1119
|
const element = document.createElement("style");
|
|
1081
1120
|
element.id = STYLE_ID;
|
|
1082
1121
|
element.dataset.plugin = PLUGIN_NAME;
|
|
1083
1122
|
element.dataset.pluginCss = `${PLUGIN_NAME}/settings/ui`;
|
|
1084
1123
|
element.textContent = CARD_CSS;
|
|
1085
1124
|
document.head.appendChild(element);
|
|
1125
|
+
return () => element.remove();
|
|
1086
1126
|
}
|
|
1087
1127
|
var STYLE_ID = "dsh-subagent-judge-dispatch-styles";
|
|
1088
1128
|
var PLUGIN_NAME = "@lynn123411/dsh-subagent-judge-dispatch";
|
|
1089
1129
|
function JudgeDispatchPanel(props) {
|
|
1090
1130
|
const { t } = props;
|
|
1091
|
-
const [state, setState] = (0,
|
|
1092
|
-
const [tab, setTab] = (0,
|
|
1131
|
+
const [state, setState] = (0, import_react2.useState)(() => dispatchCardStore.getState());
|
|
1132
|
+
const [tab, setTab] = (0, import_react2.useState)("design");
|
|
1093
1133
|
const dragIndex = React.useRef(null);
|
|
1094
|
-
const [preview, setPreview] = (0,
|
|
1095
|
-
const [previewOpen, setPreviewOpen] = (0,
|
|
1096
|
-
const [probing, setProbing] = (0,
|
|
1097
|
-
const [probeResult, setProbeResult] = (0,
|
|
1098
|
-
const [detail, setDetail] = (0,
|
|
1099
|
-
const [openMenu, setOpenMenu] = (0,
|
|
1100
|
-
const [importSection, setImportSection] = (0,
|
|
1101
|
-
const [importText, setImportText] = (0,
|
|
1102
|
-
const [importError, setImportError] = (0,
|
|
1103
|
-
const [copyNote, setCopyNote] = (0,
|
|
1104
|
-
const [logCopyResult, setLogCopyResult] = (0,
|
|
1105
|
-
(0,
|
|
1134
|
+
const [preview, setPreview] = (0, import_react2.useState)(null);
|
|
1135
|
+
const [previewOpen, setPreviewOpen] = (0, import_react2.useState)(false);
|
|
1136
|
+
const [probing, setProbing] = (0, import_react2.useState)(false);
|
|
1137
|
+
const [probeResult, setProbeResult] = (0, import_react2.useState)(null);
|
|
1138
|
+
const [detail, setDetail] = (0, import_react2.useState)(null);
|
|
1139
|
+
const [openMenu, setOpenMenu] = (0, import_react2.useState)(null);
|
|
1140
|
+
const [importSection, setImportSection] = (0, import_react2.useState)(null);
|
|
1141
|
+
const [importText, setImportText] = (0, import_react2.useState)("");
|
|
1142
|
+
const [importError, setImportError] = (0, import_react2.useState)("");
|
|
1143
|
+
const [copyNote, setCopyNote] = (0, import_react2.useState)(null);
|
|
1144
|
+
const [logCopyResult, setLogCopyResult] = (0, import_react2.useState)(null);
|
|
1145
|
+
(0, import_react2.useEffect)(() => {
|
|
1106
1146
|
setState(dispatchCardStore.getState());
|
|
1107
1147
|
const unsubscribe = dispatchCardStore.subscribe(() => setState(dispatchCardStore.getState()));
|
|
1108
1148
|
return () => {
|
|
@@ -1110,7 +1150,7 @@ function JudgeDispatchPanel(props) {
|
|
|
1110
1150
|
void dispatchCardStore.flush();
|
|
1111
1151
|
};
|
|
1112
1152
|
}, []);
|
|
1113
|
-
(0,
|
|
1153
|
+
(0, import_react2.useEffect)(() => {
|
|
1114
1154
|
if (tab === "log") void dispatchCardStore.refreshLog();
|
|
1115
1155
|
}, [tab]);
|
|
1116
1156
|
const reasonText = (reason) => t(`reason.${reason ?? "other"}`) || t("reason.unknown");
|
|
@@ -1126,11 +1166,11 @@ function JudgeDispatchPanel(props) {
|
|
|
1126
1166
|
setPreviewOpen(true);
|
|
1127
1167
|
};
|
|
1128
1168
|
const exportRows = async () => {
|
|
1129
|
-
const copied = await (0,
|
|
1169
|
+
const copied = await (0, import_dsh_client_ui_primitives2.writeClipboard)(exportRowsJson(state.rows));
|
|
1130
1170
|
setCopyNote({ ok: copied, text: t(copied ? "rows.exported" : "rows.exportFailed"), section: "rows" });
|
|
1131
1171
|
};
|
|
1132
1172
|
const exportJudge = async () => {
|
|
1133
|
-
const copied = await (0,
|
|
1173
|
+
const copied = await (0, import_dsh_client_ui_primitives2.writeClipboard)(exportJudgeJson(state));
|
|
1134
1174
|
setCopyNote({ ok: copied, text: t(copied ? "judge.exported" : "judge.exportFailed"), section: "judge" });
|
|
1135
1175
|
};
|
|
1136
1176
|
const openImport = (section) => {
|
|
@@ -1164,12 +1204,12 @@ function JudgeDispatchPanel(props) {
|
|
|
1164
1204
|
};
|
|
1165
1205
|
const commitJudge = () => void dispatchCardStore.commit("judge");
|
|
1166
1206
|
const commitRows = () => void dispatchCardStore.commit("rows");
|
|
1167
|
-
const failure = (section) => state.writeFailed === section && state.writeError !== "" ? /* @__PURE__ */ (0,
|
|
1207
|
+
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
1208
|
const row = (draft, index) => {
|
|
1169
1209
|
const efforts = dispatchCardStore.effortsFor(draft);
|
|
1170
1210
|
const usable = dispatchCardStore.rowUsable(draft);
|
|
1171
1211
|
const catalogOffersEffort = state.catalogRead && efforts.length > 0;
|
|
1172
|
-
return /* @__PURE__ */ (0,
|
|
1212
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
1173
1213
|
"tr",
|
|
1174
1214
|
{
|
|
1175
1215
|
className: usable && draft.enabled ? void 0 : "dsh-judge-row-off",
|
|
@@ -1183,7 +1223,7 @@ function JudgeDispatchPanel(props) {
|
|
|
1183
1223
|
setOpenMenu(null);
|
|
1184
1224
|
},
|
|
1185
1225
|
children: [
|
|
1186
|
-
/* @__PURE__ */ (0,
|
|
1226
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("td", { className: "dsh-judge-col-drag", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1187
1227
|
"button",
|
|
1188
1228
|
{
|
|
1189
1229
|
type: "button",
|
|
@@ -1208,9 +1248,9 @@ function JudgeDispatchPanel(props) {
|
|
|
1208
1248
|
children: "\u283F"
|
|
1209
1249
|
}
|
|
1210
1250
|
) }),
|
|
1211
|
-
/* @__PURE__ */ (0,
|
|
1212
|
-
rowHints(state.rows, index, t).map((hint) => /* @__PURE__ */ (0,
|
|
1213
|
-
/* @__PURE__ */ (0,
|
|
1251
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("td", { children: [
|
|
1252
|
+
rowHints(state.rows, index, t).map((hint) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dsh-judge-off", children: hint }, hint)),
|
|
1253
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1214
1254
|
"textarea",
|
|
1215
1255
|
{
|
|
1216
1256
|
className: "dsh-judge-field dsh-judge-description",
|
|
@@ -1224,12 +1264,12 @@ function JudgeDispatchPanel(props) {
|
|
|
1224
1264
|
}
|
|
1225
1265
|
)
|
|
1226
1266
|
] }),
|
|
1227
|
-
/* @__PURE__ */ (0,
|
|
1228
|
-
|
|
1267
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("td", { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1268
|
+
import_dsh_client_ui_primitives2.Menu,
|
|
1229
1269
|
{
|
|
1230
1270
|
open: openMenu?.index === index && openMenu.kind === "model",
|
|
1231
|
-
anchor: /* @__PURE__ */ (0,
|
|
1232
|
-
|
|
1271
|
+
anchor: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1272
|
+
import_dsh_client_ui_primitives2.Input,
|
|
1233
1273
|
{
|
|
1234
1274
|
type: "text",
|
|
1235
1275
|
className: "dsh-judge-field",
|
|
@@ -1263,12 +1303,12 @@ function JudgeDispatchPanel(props) {
|
|
|
1263
1303
|
portal: true
|
|
1264
1304
|
}
|
|
1265
1305
|
) }),
|
|
1266
|
-
/* @__PURE__ */ (0,
|
|
1267
|
-
|
|
1306
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("td", { children: catalogOffersEffort ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1307
|
+
import_dsh_client_ui_primitives2.Menu,
|
|
1268
1308
|
{
|
|
1269
1309
|
open: openMenu?.index === index && openMenu.kind === "effort",
|
|
1270
|
-
anchor: /* @__PURE__ */ (0,
|
|
1271
|
-
|
|
1310
|
+
anchor: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1311
|
+
import_dsh_client_ui_primitives2.Input,
|
|
1272
1312
|
{
|
|
1273
1313
|
type: "text",
|
|
1274
1314
|
className: "dsh-judge-field",
|
|
@@ -1296,8 +1336,8 @@ function JudgeDispatchPanel(props) {
|
|
|
1296
1336
|
className: "dsh-judge-field-wrap",
|
|
1297
1337
|
portal: true
|
|
1298
1338
|
}
|
|
1299
|
-
) : /* @__PURE__ */ (0,
|
|
1300
|
-
|
|
1339
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1340
|
+
import_dsh_client_ui_primitives2.Input,
|
|
1301
1341
|
{
|
|
1302
1342
|
type: "text",
|
|
1303
1343
|
className: "dsh-judge-field",
|
|
@@ -1308,9 +1348,9 @@ function JudgeDispatchPanel(props) {
|
|
|
1308
1348
|
onBlur: commitRows
|
|
1309
1349
|
}
|
|
1310
1350
|
) }),
|
|
1311
|
-
/* @__PURE__ */ (0,
|
|
1312
|
-
/* @__PURE__ */ (0,
|
|
1313
|
-
|
|
1351
|
+
/* @__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: [
|
|
1352
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1353
|
+
import_dsh_client_ui_primitives2.Switch,
|
|
1314
1354
|
{
|
|
1315
1355
|
checked: draft.enabled,
|
|
1316
1356
|
onChange: (next) => dispatchCardStore.toggleRow(index, next),
|
|
@@ -1318,8 +1358,8 @@ function JudgeDispatchPanel(props) {
|
|
|
1318
1358
|
disabled: !state.writable
|
|
1319
1359
|
}
|
|
1320
1360
|
),
|
|
1321
|
-
/* @__PURE__ */ (0,
|
|
1322
|
-
|
|
1361
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1362
|
+
import_dsh_client_ui_primitives2.Button,
|
|
1323
1363
|
{
|
|
1324
1364
|
variant: "outline",
|
|
1325
1365
|
size: "sm",
|
|
@@ -1334,15 +1374,15 @@ function JudgeDispatchPanel(props) {
|
|
|
1334
1374
|
index
|
|
1335
1375
|
);
|
|
1336
1376
|
};
|
|
1337
|
-
const design = /* @__PURE__ */ (0,
|
|
1338
|
-
/* @__PURE__ */ (0,
|
|
1339
|
-
/* @__PURE__ */ (0,
|
|
1340
|
-
/* @__PURE__ */ (0,
|
|
1341
|
-
/* @__PURE__ */ (0,
|
|
1342
|
-
/* @__PURE__ */ (0,
|
|
1343
|
-
/* @__PURE__ */ (0,
|
|
1344
|
-
/* @__PURE__ */ (0,
|
|
1345
|
-
|
|
1377
|
+
const design = /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-panel", children: [
|
|
1378
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-section", children: [
|
|
1379
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-head", children: [
|
|
1380
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dsh-judge-title", children: t("judge.title") }),
|
|
1381
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-actions-group", children: [
|
|
1382
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives2.Button, { variant: "outline", size: "sm", onClick: () => openImport("judge"), children: t("judge.importOpen") }),
|
|
1383
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives2.Button, { variant: "outline", size: "sm", onClick: () => void exportJudge(), children: t("judge.export") }),
|
|
1384
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1385
|
+
import_dsh_client_ui_primitives2.Button,
|
|
1346
1386
|
{
|
|
1347
1387
|
variant: "outline",
|
|
1348
1388
|
size: "sm",
|
|
@@ -1353,14 +1393,14 @@ function JudgeDispatchPanel(props) {
|
|
|
1353
1393
|
)
|
|
1354
1394
|
] })
|
|
1355
1395
|
] }),
|
|
1356
|
-
/* @__PURE__ */ (0,
|
|
1357
|
-
/* @__PURE__ */ (0,
|
|
1358
|
-
/* @__PURE__ */ (0,
|
|
1359
|
-
/* @__PURE__ */ (0,
|
|
1360
|
-
/* @__PURE__ */ (0,
|
|
1396
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-desc", children: t("judge.desc") }),
|
|
1397
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-row", children: [
|
|
1398
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-row-info", children: [
|
|
1399
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-row-title", children: t("switch.rewrite.title") }),
|
|
1400
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-row-hint", children: t("switch.rewrite.desc") })
|
|
1361
1401
|
] }),
|
|
1362
|
-
/* @__PURE__ */ (0,
|
|
1363
|
-
|
|
1402
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1403
|
+
import_dsh_client_ui_primitives2.Switch,
|
|
1364
1404
|
{
|
|
1365
1405
|
checked: state.enabled,
|
|
1366
1406
|
onChange: (next) => dispatchCardStore.toggle("enabled", next),
|
|
@@ -1369,13 +1409,13 @@ function JudgeDispatchPanel(props) {
|
|
|
1369
1409
|
}
|
|
1370
1410
|
)
|
|
1371
1411
|
] }),
|
|
1372
|
-
/* @__PURE__ */ (0,
|
|
1373
|
-
/* @__PURE__ */ (0,
|
|
1374
|
-
/* @__PURE__ */ (0,
|
|
1375
|
-
/* @__PURE__ */ (0,
|
|
1412
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-row", children: [
|
|
1413
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-row-info", children: [
|
|
1414
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-row-title", children: t("switch.log.title") }),
|
|
1415
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-row-hint", children: t("switch.log.desc") })
|
|
1376
1416
|
] }),
|
|
1377
|
-
/* @__PURE__ */ (0,
|
|
1378
|
-
|
|
1417
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1418
|
+
import_dsh_client_ui_primitives2.Switch,
|
|
1379
1419
|
{
|
|
1380
1420
|
checked: state.logEnabled,
|
|
1381
1421
|
onChange: (next) => dispatchCardStore.toggle("logEnabled", next),
|
|
@@ -1384,13 +1424,13 @@ function JudgeDispatchPanel(props) {
|
|
|
1384
1424
|
}
|
|
1385
1425
|
)
|
|
1386
1426
|
] }),
|
|
1387
|
-
/* @__PURE__ */ (0,
|
|
1388
|
-
/* @__PURE__ */ (0,
|
|
1389
|
-
/* @__PURE__ */ (0,
|
|
1390
|
-
/* @__PURE__ */ (0,
|
|
1427
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-row", children: [
|
|
1428
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-row-info", children: [
|
|
1429
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-row-title", children: t("judge.endpoint") }),
|
|
1430
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-row-hint", children: t("judge.endpointDesc") })
|
|
1391
1431
|
] }),
|
|
1392
|
-
/* @__PURE__ */ (0,
|
|
1393
|
-
|
|
1432
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-row-field", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1433
|
+
import_dsh_client_ui_primitives2.Input,
|
|
1394
1434
|
{
|
|
1395
1435
|
type: "text",
|
|
1396
1436
|
className: "dsh-judge-field",
|
|
@@ -1403,13 +1443,13 @@ function JudgeDispatchPanel(props) {
|
|
|
1403
1443
|
}
|
|
1404
1444
|
) })
|
|
1405
1445
|
] }),
|
|
1406
|
-
/* @__PURE__ */ (0,
|
|
1407
|
-
/* @__PURE__ */ (0,
|
|
1408
|
-
/* @__PURE__ */ (0,
|
|
1409
|
-
/* @__PURE__ */ (0,
|
|
1446
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-row", children: [
|
|
1447
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-row-info", children: [
|
|
1448
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-row-title", children: t("judge.model") }),
|
|
1449
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-row-hint", children: t("judge.modelDesc") })
|
|
1410
1450
|
] }),
|
|
1411
|
-
/* @__PURE__ */ (0,
|
|
1412
|
-
|
|
1451
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-row-field", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1452
|
+
import_dsh_client_ui_primitives2.Input,
|
|
1413
1453
|
{
|
|
1414
1454
|
type: "text",
|
|
1415
1455
|
className: "dsh-judge-field",
|
|
@@ -1422,14 +1462,14 @@ function JudgeDispatchPanel(props) {
|
|
|
1422
1462
|
}
|
|
1423
1463
|
) })
|
|
1424
1464
|
] }),
|
|
1425
|
-
/* @__PURE__ */ (0,
|
|
1426
|
-
/* @__PURE__ */ (0,
|
|
1427
|
-
/* @__PURE__ */ (0,
|
|
1428
|
-
/* @__PURE__ */ (0,
|
|
1465
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-row", children: [
|
|
1466
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-row-info", children: [
|
|
1467
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-row-title", children: t("judge.key") }),
|
|
1468
|
+
/* @__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
1469
|
] }),
|
|
1430
|
-
/* @__PURE__ */ (0,
|
|
1431
|
-
/* @__PURE__ */ (0,
|
|
1432
|
-
|
|
1470
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-row-field", children: [
|
|
1471
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1472
|
+
import_dsh_client_ui_primitives2.Input,
|
|
1433
1473
|
{
|
|
1434
1474
|
type: "password",
|
|
1435
1475
|
autoComplete: "new-password",
|
|
@@ -1447,95 +1487,79 @@ function JudgeDispatchPanel(props) {
|
|
|
1447
1487
|
}
|
|
1448
1488
|
}
|
|
1449
1489
|
),
|
|
1450
|
-
/* @__PURE__ */ (0,
|
|
1451
|
-
/* @__PURE__ */ (0,
|
|
1452
|
-
state.key.unavailable && /* @__PURE__ */ (0,
|
|
1453
|
-
state.key.failed && /* @__PURE__ */ (0,
|
|
1490
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-key-line", children: [
|
|
1491
|
+
/* @__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") }),
|
|
1492
|
+
state.key.unavailable && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dsh-judge-hint", children: t("judge.keyUnavailable") }),
|
|
1493
|
+
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
1494
|
] })
|
|
1455
1495
|
] })
|
|
1456
1496
|
] }),
|
|
1457
|
-
probeResult !== null && /* @__PURE__ */ (0,
|
|
1458
|
-
copyNote !== null && copyNote.section === "judge" && /* @__PURE__ */ (0,
|
|
1497
|
+
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)) }),
|
|
1498
|
+
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
1499
|
failure("judge")
|
|
1460
1500
|
] }),
|
|
1461
|
-
/* @__PURE__ */ (0,
|
|
1462
|
-
/* @__PURE__ */ (0,
|
|
1463
|
-
/* @__PURE__ */ (0,
|
|
1464
|
-
/* @__PURE__ */ (0,
|
|
1465
|
-
/* @__PURE__ */ (0,
|
|
1466
|
-
/* @__PURE__ */ (0,
|
|
1467
|
-
/* @__PURE__ */ (0,
|
|
1501
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-section", children: [
|
|
1502
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-head", children: [
|
|
1503
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dsh-judge-title", children: t("rows.title") }),
|
|
1504
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-actions-group", children: [
|
|
1505
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives2.Button, { variant: "outline", size: "sm", onClick: () => openImport("rows"), children: t("rows.importOpen") }),
|
|
1506
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives2.Button, { variant: "outline", size: "sm", onClick: () => void exportRows(), children: t("rows.export") }),
|
|
1507
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives2.Button, { variant: "outline", size: "sm", onClick: () => dispatchCardStore.addRow(), children: t("rows.add") })
|
|
1468
1508
|
] })
|
|
1469
1509
|
] }),
|
|
1470
|
-
/* @__PURE__ */ (0,
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
}
|
|
1481
|
-
)
|
|
1482
|
-
] }),
|
|
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" })
|
|
1510
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-desc", children: t("rows.dependsOn") }),
|
|
1511
|
+
state.models.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-off", children: t("rows.allowedEmpty") }),
|
|
1512
|
+
state.rows.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-desc", children: t("rows.empty") }),
|
|
1513
|
+
state.rows.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("table", { className: "dsh-judge-table", children: [
|
|
1514
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("tr", { children: [
|
|
1515
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("th", { className: "dsh-judge-col-drag" }),
|
|
1516
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("th", { children: t("rows.colType") }),
|
|
1517
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("th", { className: "dsh-judge-col-model", children: t("rows.colModel") }),
|
|
1518
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("th", { className: "dsh-judge-col-effort", children: t("rows.colEffort") }),
|
|
1519
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("th", { className: "dsh-judge-col-actions" })
|
|
1492
1520
|
] }) }),
|
|
1493
|
-
/* @__PURE__ */ (0,
|
|
1521
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("tbody", { children: state.rows.map((draft, index) => row(draft, index)) })
|
|
1494
1522
|
] }),
|
|
1495
|
-
copyNote !== null && copyNote.section === "rows" && /* @__PURE__ */ (0,
|
|
1523
|
+
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
1524
|
failure("rows")
|
|
1497
1525
|
] }),
|
|
1498
|
-
/* @__PURE__ */ (0,
|
|
1526
|
+
/* @__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
1527
|
] });
|
|
1500
|
-
const log = /* @__PURE__ */ (0,
|
|
1501
|
-
/* @__PURE__ */ (0,
|
|
1502
|
-
/* @__PURE__ */ (0,
|
|
1503
|
-
/* @__PURE__ */ (0,
|
|
1504
|
-
/* @__PURE__ */ (0,
|
|
1505
|
-
/* @__PURE__ */ (0,
|
|
1528
|
+
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: [
|
|
1529
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-head", children: [
|
|
1530
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dsh-judge-title", children: t("log.title") }),
|
|
1531
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-actions-group", children: [
|
|
1532
|
+
/* @__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") }),
|
|
1533
|
+
/* @__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
1534
|
] })
|
|
1507
1535
|
] }),
|
|
1508
|
-
logCopyResult !== null && /* @__PURE__ */ (0,
|
|
1509
|
-
/* @__PURE__ */ (0,
|
|
1510
|
-
state.logFailed && /* @__PURE__ */ (0,
|
|
1511
|
-
state.logLoaded && state.log.length === 0 && /* @__PURE__ */ (0,
|
|
1512
|
-
state.log.length > 0 && /* @__PURE__ */ (0,
|
|
1513
|
-
/* @__PURE__ */ (0,
|
|
1514
|
-
/* @__PURE__ */ (0,
|
|
1515
|
-
/* @__PURE__ */ (0,
|
|
1516
|
-
/* @__PURE__ */ (0,
|
|
1517
|
-
/* @__PURE__ */ (0,
|
|
1518
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: t("log.colTime") }),
|
|
1519
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: t("log.colLatency") })
|
|
1536
|
+
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") }),
|
|
1537
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-desc", children: t("log.desc") }),
|
|
1538
|
+
state.logFailed && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-note-bad", children: t("log.loadFailed") }),
|
|
1539
|
+
state.logLoaded && state.log.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-desc", children: t("log.empty") }),
|
|
1540
|
+
state.log.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-log", children: [
|
|
1541
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-log-row dsh-judge-log-head", children: [
|
|
1542
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: t("log.colResult") }),
|
|
1543
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: t("log.colChoice") }),
|
|
1544
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: t("log.colTime") }),
|
|
1545
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: t("log.colLatency") })
|
|
1520
1546
|
] }),
|
|
1521
1547
|
state.log.map((entry, index) => {
|
|
1522
1548
|
const result = entry.typeId === null ? {
|
|
1523
1549
|
text: t("log.resultInherited"),
|
|
1524
1550
|
hint: entry.reason === void 0 ? "" : reasonText(entry.reason)
|
|
1525
1551
|
} : { text: t("log.resultJudged").replace("{id}", String(entry.typeId)), hint: "" };
|
|
1526
|
-
return /* @__PURE__ */ (0,
|
|
1552
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
1527
1553
|
"button",
|
|
1528
1554
|
{
|
|
1529
1555
|
type: "button",
|
|
1530
1556
|
className: "dsh-judge-log-row",
|
|
1531
1557
|
onClick: () => setDetail(entry),
|
|
1532
1558
|
children: [
|
|
1533
|
-
/* @__PURE__ */ (0,
|
|
1534
|
-
/* @__PURE__ */ (0,
|
|
1535
|
-
/* @__PURE__ */ (0,
|
|
1536
|
-
/* @__PURE__ */ (0,
|
|
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)) })
|
|
1559
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(LogCell, { text: result.text, hint: result.hint }),
|
|
1560
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(LogCell, { text: describeModel(entry) || "\u2014", hint: describeChoice(entry) }),
|
|
1561
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: new Date(entry.at).toLocaleTimeString() }),
|
|
1562
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: t("ms").replace("{value}", String(entry.latencyMs)) })
|
|
1539
1563
|
]
|
|
1540
1564
|
},
|
|
1541
1565
|
index
|
|
@@ -1543,9 +1567,9 @@ function JudgeDispatchPanel(props) {
|
|
|
1543
1567
|
})
|
|
1544
1568
|
] })
|
|
1545
1569
|
] }) });
|
|
1546
|
-
return /* @__PURE__ */ (0,
|
|
1547
|
-
/* @__PURE__ */ (0,
|
|
1548
|
-
|
|
1570
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-judge-card", children: [
|
|
1571
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1572
|
+
import_dsh_client_ui_primitives2.SegmentedTabs,
|
|
1549
1573
|
{
|
|
1550
1574
|
items: [
|
|
1551
1575
|
{ value: "design", label: t("tab.design"), id: "judge-tab-design", panelId: "judge-panel-design" },
|
|
@@ -1560,8 +1584,8 @@ function JudgeDispatchPanel(props) {
|
|
|
1560
1584
|
}
|
|
1561
1585
|
),
|
|
1562
1586
|
tab === "design" ? design : log,
|
|
1563
|
-
/* @__PURE__ */ (0,
|
|
1564
|
-
|
|
1587
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
1588
|
+
import_dsh_client_ui_primitives2.Modal,
|
|
1565
1589
|
{
|
|
1566
1590
|
open: previewOpen,
|
|
1567
1591
|
onClose: () => setPreviewOpen(false),
|
|
@@ -1569,13 +1593,13 @@ function JudgeDispatchPanel(props) {
|
|
|
1569
1593
|
closeLabel: t("preview.close"),
|
|
1570
1594
|
className: "dsh-judge-modal",
|
|
1571
1595
|
children: [
|
|
1572
|
-
/* @__PURE__ */ (0,
|
|
1573
|
-
/* @__PURE__ */ (0,
|
|
1596
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-desc", children: t("preview.desc") }),
|
|
1597
|
+
/* @__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
1598
|
]
|
|
1575
1599
|
}
|
|
1576
1600
|
),
|
|
1577
|
-
/* @__PURE__ */ (0,
|
|
1578
|
-
|
|
1601
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
1602
|
+
import_dsh_client_ui_primitives2.Modal,
|
|
1579
1603
|
{
|
|
1580
1604
|
open: importSection !== null,
|
|
1581
1605
|
onClose: closeImport,
|
|
@@ -1583,12 +1607,12 @@ function JudgeDispatchPanel(props) {
|
|
|
1583
1607
|
closeLabel: t(importSection === "judge" ? "judge.importClose" : "rows.importClose"),
|
|
1584
1608
|
description: t(importSection === "judge" ? "judge.importDesc" : "rows.importDesc"),
|
|
1585
1609
|
className: "dsh-judge-modal",
|
|
1586
|
-
footer: /* @__PURE__ */ (0,
|
|
1587
|
-
/* @__PURE__ */ (0,
|
|
1588
|
-
/* @__PURE__ */ (0,
|
|
1610
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
|
|
1611
|
+
/* @__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") }),
|
|
1612
|
+
/* @__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
1613
|
] }),
|
|
1590
1614
|
children: [
|
|
1591
|
-
/* @__PURE__ */ (0,
|
|
1615
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1592
1616
|
"textarea",
|
|
1593
1617
|
{
|
|
1594
1618
|
className: "dsh-judge-paste",
|
|
@@ -1603,12 +1627,12 @@ function JudgeDispatchPanel(props) {
|
|
|
1603
1627
|
}
|
|
1604
1628
|
}
|
|
1605
1629
|
),
|
|
1606
|
-
importError !== "" && /* @__PURE__ */ (0,
|
|
1630
|
+
importError !== "" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-judge-note-bad", role: "alert", children: importError })
|
|
1607
1631
|
]
|
|
1608
1632
|
}
|
|
1609
1633
|
),
|
|
1610
|
-
/* @__PURE__ */ (0,
|
|
1611
|
-
|
|
1634
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1635
|
+
import_dsh_client_ui_primitives2.Modal,
|
|
1612
1636
|
{
|
|
1613
1637
|
open: detail !== null,
|
|
1614
1638
|
onClose: () => setDetail(null),
|
|
@@ -1616,10 +1640,10 @@ function JudgeDispatchPanel(props) {
|
|
|
1616
1640
|
closeLabel: t("log.promptClose"),
|
|
1617
1641
|
description: t("log.promptDesc"),
|
|
1618
1642
|
className: "dsh-judge-modal",
|
|
1619
|
-
children: detail !== null && (detail.
|
|
1620
|
-
|
|
1643
|
+
children: detail !== null && (detail.metrics === void 0 ? /* @__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)(
|
|
1644
|
+
import_dsh_client_ui_primitives2.CodeBlock,
|
|
1621
1645
|
{
|
|
1622
|
-
code: detail.
|
|
1646
|
+
code: JSON.stringify(detail.metrics, null, 2),
|
|
1623
1647
|
copyLabel: t("preview.copy"),
|
|
1624
1648
|
copiedLabel: t("preview.copied")
|
|
1625
1649
|
}
|
|
@@ -1641,11 +1665,6 @@ function setupSettingsUi(ctx) {
|
|
|
1641
1665
|
remote: createDispatchRemote(),
|
|
1642
1666
|
// The judgement key is written here; its value never rides a response.
|
|
1643
1667
|
credentials: ctx.remote?.credentials ?? null,
|
|
1644
|
-
// The type list's options come from the host's own official setting; this
|
|
1645
|
-
// is the one jump to it the page can make.
|
|
1646
|
-
officialSettingsOpener: createOfficialSettingsOpener(
|
|
1647
|
-
ctx.get?.("pluginNavigation")
|
|
1648
|
-
),
|
|
1649
1668
|
t
|
|
1650
1669
|
});
|
|
1651
1670
|
} catch (error) {
|
|
@@ -1668,8 +1687,14 @@ function setupSettingsUi(ctx) {
|
|
|
1668
1687
|
var name = "@lynn123411/dsh-subagent-judge-dispatch";
|
|
1669
1688
|
var inject = ["slots", "configForms", "remote", "remote.session", "remote.credentials", "locale"];
|
|
1670
1689
|
function apply2(ctx) {
|
|
1671
|
-
injectCardStyles
|
|
1690
|
+
ctx.effect(injectCardStyles, "dsh-subagent-judge-dispatch: card styles");
|
|
1672
1691
|
apply(ctx);
|
|
1692
|
+
ctx.slots.inject(MODEL_OPTIONS_SLOT, () => ctx.slots.register({
|
|
1693
|
+
name: MODEL_OPTIONS_SLOT,
|
|
1694
|
+
id: "subagent-judge-dispatch-enabled",
|
|
1695
|
+
locale: NS,
|
|
1696
|
+
inject: () => ({ form: ctx.configForms.get(SETTINGS_NAMESPACE) })
|
|
1697
|
+
}, SessionToggle));
|
|
1673
1698
|
ctx.effect(
|
|
1674
1699
|
() => {
|
|
1675
1700
|
setupSettingsUi(ctx);
|