dsh-hypatia-auto-memory 2.1.1 → 2.2.0
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 -1
- package/README.zh-CN.md +2 -0
- package/icon.svg +17 -0
- package/lib/client.js +523 -519
- package/lib/client.js.map +1 -1
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +6 -2
- package/src/client/SettingsCard.module.css +106 -88
- package/src/client/SettingsCard.tsx +450 -442
- package/src/client/index.tsx +8 -4
- package/src/client/locales.ts +4 -2
package/lib/client.js
CHANGED
|
@@ -176,7 +176,7 @@ window.__ModuleLoader__.load({
|
|
|
176
176
|
}
|
|
177
177
|
//#endregion
|
|
178
178
|
//#region \0dsh-hypatia-css:/home/runner/work/dsh-hypatia-auto-memory/dsh-hypatia-auto-memory/src/client/SettingsCard.module.css.mjs
|
|
179
|
-
const css$1 = ".YVNYya_card{border:.5px solid var(--dsw-alias-border-l4);background:var(--dsw-alias-bg-layer-2)
|
|
179
|
+
const css$1 = ".YVNYya_card{border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-lg);background:var(--dsw-alias-bg-layer-2);--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2)}.YVNYya_header{align-items:center;gap:12px;padding:12px 16px;display:flex}.YVNYya_toggle{min-width:0;color:inherit;font:inherit;text-align:left;cursor:pointer;background:0 0;border:0;flex:1;align-items:center;gap:8px;padding:0;display:flex}.YVNYya_toggle:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:2px}.YVNYya_toggle>.YVNYya_chevron{transform:rotate(-90deg)}.YVNYya_toggle[aria-expanded=true]>.YVNYya_chevron{transform:none}.YVNYya_chevron{color:var(--dsw-alias-label-tertiary);flex:none}.YVNYya_sectionName{color:var(--dsw-alias-label-primary);font-size:14px;font-weight:500;line-height:20px}.YVNYya_headText{flex-direction:column;flex:1;gap:4px;min-width:0;display:flex}.YVNYya_name{color:var(--dsw-alias-label-primary);font-size:14px;font-weight:500;line-height:20px}.YVNYya_description{color:var(--dsw-alias-label-tertiary);font-size:13px;line-height:1.5}.YVNYya_pending,.YVNYya_failedPill{corner-shape:round;background:var(--dsw-alias-bg-module-platform);white-space:nowrap;border-radius:999px;flex:none;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px}.YVNYya_pending{color:var(--dsw-alias-label-secondary)}.YVNYya_failedPill{color:var(--dsw-alias-state-error-primary)}.YVNYya_body{border-top:.5px solid var(--dsw-alias-border-l2);margin:0 16px;padding-bottom:8px}.YVNYya_body[hidden]{display:none}.YVNYya_status,.YVNYya_hint,.YVNYya_advancedHint{color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px;line-height:1.5}.YVNYya_status{padding:12px 16px}.YVNYya_field{gap:6px;padding:12px 0;display:grid}.YVNYya_field+.YVNYya_field,.YVNYya_field+.YVNYya_group,.YVNYya_group+.YVNYya_field{border-top:.5px solid var(--dsw-alias-border-l2)}.YVNYya_group{padding:12px 0}.YVNYya_groupTitle{color:var(--dsw-alias-label-primary);margin:0;font-size:13px;font-weight:500;line-height:1.5}.YVNYya_limitsTitle{border-top:.5px solid var(--dsw-alias-border-l2);color:var(--dsw-alias-label-primary);margin:16px 0 0;padding-top:12px;font-size:13px;font-weight:500;line-height:1.5}.YVNYya_limitsTitle+.YVNYya_hint{margin-top:4px}.YVNYya_pairedFields{border-top:.5px solid var(--dsw-alias-border-l2)}.YVNYya_fieldHead{align-items:center;gap:8px;display:flex}.YVNYya_label{min-width:0;color:var(--dsw-alias-label-primary);flex:1;font-size:13px;font-weight:500;line-height:1.5}.YVNYya_reset{color:var(--dsw-alias-label-secondary);cursor:pointer;font:inherit;background:0 0;border:0;padding:0;font-size:12px;line-height:1.5}.YVNYya_reset:hover:not(:disabled){color:var(--dsw-alias-label-primary)}.YVNYya_reset:disabled{cursor:default}.YVNYya_input{box-sizing:border-box;width:100%;min-width:0;display:flex}.YVNYya_select{box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);width:100%;min-width:0;height:32px;color:var(--dsw-alias-label-primary);font:inherit;background:0 0;padding:0 8px;font-size:13px}.YVNYya_select:disabled{opacity:.5}.YVNYya_select:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:1px}.YVNYya_warning{color:var(--dsw-alias-state-error-primary);margin:0;font-size:12px;line-height:1.5}.YVNYya_pairedFields{grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:16px;margin:4px 0;padding:4px 0;display:grid}.YVNYya_pairedFields .YVNYya_field{min-width:0}.YVNYya_modelSelection{gap:10px;padding:12px 0;display:grid}.YVNYya_notice{color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px;line-height:1.5}.YVNYya_catalogError{color:var(--dsw-alias-state-error-primary);justify-content:space-between;align-items:center;gap:12px;font-size:12px;line-height:1.5;display:flex}.YVNYya_catalogError button{color:var(--dsw-alias-brand-primary);cursor:pointer;font:inherit;background:0 0;border:0;padding:0}.YVNYya_catalogError button:focus-visible,.YVNYya_reset:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:1px}.YVNYya_models{border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-sm);gap:6px;min-width:0;max-height:280px;margin:0;padding:10px;display:grid;overflow:auto}.YVNYya_models legend{color:var(--dsw-alias-label-secondary);padding:0 4px;font-size:12px}.YVNYya_modelGroup{gap:6px;display:grid}.YVNYya_modelGroup+.YVNYya_modelGroup{border-top:.5px solid var(--dsw-alias-border-l3);margin-top:4px;padding-top:10px}.YVNYya_providerName{color:var(--dsw-alias-label-tertiary);padding:0 6px;font-size:11px;font-weight:500}.YVNYya_model{border-radius:var(--dsw-radius-xs);cursor:pointer;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:8px;min-width:0;padding:6px;display:grid}.YVNYya_model:hover{background:var(--dsw-alias-bg-layer-4)}.YVNYya_selectedRow{border-radius:var(--dsw-radius-xs);align-items:center;gap:8px;min-width:0;padding:6px;display:flex}.YVNYya_selectedRow:hover{background:var(--dsw-alias-bg-layer-4)}.YVNYya_order{min-width:16px;color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;text-align:right;font-size:11px}.YVNYya_selectedText{flex:auto;min-width:0}.YVNYya_effort{border:.5px solid var(--dsw-alias-border-l4);max-width:132px;color:var(--dsw-alias-label-secondary);cursor:pointer;font:inherit;background:0 0;border-radius:5px;flex:none;padding:2px 4px;font-size:12px}.YVNYya_effort:disabled{cursor:default;opacity:.5}.YVNYya_effort:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:1px}.YVNYya_rowActions{align-items:center;gap:2px;display:flex}.YVNYya_move{border:.5px solid var(--dsw-alias-border-l4);width:22px;height:22px;color:var(--dsw-alias-label-secondary);cursor:pointer;font:inherit;background:0 0;border-radius:5px;padding:0;font-size:12px;line-height:1}.YVNYya_move:hover:not(:disabled){background:var(--dsw-alias-bg-layer-4);color:var(--dsw-alias-label-primary)}.YVNYya_move:disabled{cursor:default;opacity:.4}.YVNYya_move:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:1px}.YVNYya_modelName,.YVNYya_route{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.YVNYya_modelName{color:var(--dsw-alias-label-primary);font-size:13px}.YVNYya_route{color:var(--dsw-alias-label-tertiary);margin-top:2px;font-size:11px}.YVNYya_unavailable{color:var(--dsw-alias-label-tertiary);font-size:11px}.YVNYya_advancedHint{border-top:.5px solid var(--dsw-alias-border-l2);padding-top:12px}@media (width<=480px){.YVNYya_pairedFields{grid-template-columns:minmax(0,1fr);gap:0}.YVNYya_pairedFields .YVNYya_field+.YVNYya_field{border-top:.5px solid var(--dsw-alias-border-l2)}}";
|
|
180
180
|
const tagId$1 = "dsh-hypatia-auto-memory/SettingsCard.module.css";
|
|
181
181
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$1) + "]") === null) {
|
|
182
182
|
const tag = document.createElement("style");
|
|
@@ -190,12 +190,12 @@ window.__ModuleLoader__.load({
|
|
|
190
190
|
"body": "YVNYya_body",
|
|
191
191
|
"card": "YVNYya_card",
|
|
192
192
|
"catalogError": "YVNYya_catalogError",
|
|
193
|
+
"chevron": "YVNYya_chevron",
|
|
193
194
|
"description": "YVNYya_description",
|
|
194
195
|
"effort": "YVNYya_effort",
|
|
195
|
-
"
|
|
196
|
+
"failedPill": "YVNYya_failedPill",
|
|
196
197
|
"field": "YVNYya_field",
|
|
197
198
|
"fieldHead": "YVNYya_fieldHead",
|
|
198
|
-
"footer": "YVNYya_footer",
|
|
199
199
|
"group": "YVNYya_group",
|
|
200
200
|
"groupTitle": "YVNYya_groupTitle",
|
|
201
201
|
"headText": "YVNYya_headText",
|
|
@@ -216,17 +216,15 @@ window.__ModuleLoader__.load({
|
|
|
216
216
|
"pairedFields": "YVNYya_pairedFields",
|
|
217
217
|
"pending": "YVNYya_pending",
|
|
218
218
|
"providerName": "YVNYya_providerName",
|
|
219
|
-
"readOnly": "YVNYya_readOnly",
|
|
220
219
|
"reset": "YVNYya_reset",
|
|
221
220
|
"route": "YVNYya_route",
|
|
222
221
|
"rowActions": "YVNYya_rowActions",
|
|
222
|
+
"sectionName": "YVNYya_sectionName",
|
|
223
223
|
"select": "YVNYya_select",
|
|
224
224
|
"selectedRow": "YVNYya_selectedRow",
|
|
225
225
|
"selectedText": "YVNYya_selectedText",
|
|
226
226
|
"status": "YVNYya_status",
|
|
227
|
-
"
|
|
228
|
-
"switchOn": "YVNYya_switchOn",
|
|
229
|
-
"switchThumb": "YVNYya_switchThumb",
|
|
227
|
+
"toggle": "YVNYya_toggle",
|
|
230
228
|
"unavailable": "YVNYya_unavailable",
|
|
231
229
|
"warning": "YVNYya_warning"
|
|
232
230
|
};
|
|
@@ -241,6 +239,7 @@ window.__ModuleLoader__.load({
|
|
|
241
239
|
unavailable: "当前上下文不可用 {ns} 设置。",
|
|
242
240
|
title: "Hypatia Auto Memory",
|
|
243
241
|
description: "自动将对话轮次记录到 Hypatia,并在新内容足够多时通过独立模型路由进行后台整合。",
|
|
242
|
+
configSection: "配置",
|
|
244
243
|
enable: "启用自动记忆",
|
|
245
244
|
autoApprove: "自动批准模型发起的 hypatia 命令",
|
|
246
245
|
autoApproveHint: "仅限不含管道、重定向、命令串联的纯 hypatia 调用;插件自身的写入不经过此路径。关闭后模型每次检索都会弹出批准框。保存后采集器会自动重启以应用新值。",
|
|
@@ -288,10 +287,10 @@ window.__ModuleLoader__.load({
|
|
|
288
287
|
recallPreload: "召回:会话开始时预加载规则与禁忌",
|
|
289
288
|
advancedHint: "高级字段(二进制、收集器上限、队列调优)可在「设置 → 插件」的本插件页,或 profile patch 的 {ns} 条目 config 下编辑。",
|
|
290
289
|
reset: "重置",
|
|
291
|
-
discard: "放弃",
|
|
292
290
|
save: "保存",
|
|
293
291
|
saving: "保存中…",
|
|
294
292
|
saveFailed: "保存失败:{message}",
|
|
293
|
+
saveFailedShort: "保存失败",
|
|
295
294
|
readOnly: "只读:当前上下文不可写入设置文档。",
|
|
296
295
|
unsaved: "未保存",
|
|
297
296
|
viewMemory: "记忆",
|
|
@@ -352,6 +351,7 @@ window.__ModuleLoader__.load({
|
|
|
352
351
|
unavailable: "{ns} settings are not available in this context.",
|
|
353
352
|
title: "Hypatia Auto Memory",
|
|
354
353
|
description: "Auto-memory logs conversation turns into Hypatia and runs background consolidation on a dedicated model route.",
|
|
354
|
+
configSection: "Configuration",
|
|
355
355
|
enable: "Enable auto-memory",
|
|
356
356
|
autoApprove: "Auto-approve the agent's own hypatia commands",
|
|
357
357
|
autoApproveHint: "Only plain hypatia calls with no pipe, redirect or chaining; this plugin's own writes never take that path. With it off, every retrieval raises an approval prompt. Saving a change restarts the collector to apply it.",
|
|
@@ -399,10 +399,10 @@ window.__ModuleLoader__.load({
|
|
|
399
399
|
recallPreload: "Recall: preload rules & taboos at session start",
|
|
400
400
|
advancedHint: "Advanced fields (binaries, collector caps, queue tuning) can be edited in Settings → Plugins under this plugin, or under the {ns} entry's config in the profile patch.",
|
|
401
401
|
reset: "Reset",
|
|
402
|
-
discard: "Discard",
|
|
403
402
|
save: "Save",
|
|
404
403
|
saving: "Saving…",
|
|
405
404
|
saveFailed: "Save failed: {message}",
|
|
405
|
+
saveFailedShort: "Save failed",
|
|
406
406
|
readOnly: "Read-only: settings document is not writable in this context.",
|
|
407
407
|
unsaved: "Unsaved",
|
|
408
408
|
viewMemory: "Memory",
|
|
@@ -463,8 +463,11 @@ window.__ModuleLoader__.load({
|
|
|
463
463
|
* Configuration card for the `hypatia-auto-memory` namespace, rendered on
|
|
464
464
|
* whichever seat the harness offers (see `plugin-card-seat.ts`).
|
|
465
465
|
*
|
|
466
|
-
* The card
|
|
467
|
-
*
|
|
466
|
+
* The card is a disclosure over the harness's own settings form: the header
|
|
467
|
+
* folds it (collapsed by default where the page already names the plugin), and
|
|
468
|
+
* the frame inside — read-only notice, controls, save, failure line — is
|
|
469
|
+
* `SettingsForm` with the shared `Switch`, so only the fields this plugin
|
|
470
|
+
* invents are drawn here. Edits are staged until Save, as the form expects.
|
|
468
471
|
*/
|
|
469
472
|
const DEFAULT_CONSOLIDATION = {
|
|
470
473
|
models: [],
|
|
@@ -504,7 +507,9 @@ window.__ModuleLoader__.load({
|
|
|
504
507
|
function same(a, b) {
|
|
505
508
|
return JSON.stringify(a) === JSON.stringify(b);
|
|
506
509
|
}
|
|
507
|
-
function SettingsCard({ scope, loadModelCatalog, loadShelfInventory, t }) {
|
|
510
|
+
function SettingsCard({ scope, loadModelCatalog, loadShelfInventory, seat, t }) {
|
|
511
|
+
const bodyId = (0, react.useId)();
|
|
512
|
+
const [open, setOpen] = (0, react.useState)(seat === "settings-tab");
|
|
508
513
|
const { snap, value } = useScopeValue(scope);
|
|
509
514
|
const disabled = !snap.writable;
|
|
510
515
|
const base = (0, react.useMemo)(() => snap.base ?? {}, [snap.base]);
|
|
@@ -776,585 +781,583 @@ window.__ModuleLoader__.load({
|
|
|
776
781
|
"aria-label": t("title"),
|
|
777
782
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
778
783
|
className: SettingsCard_module_css_default.header,
|
|
779
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
784
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
785
|
+
type: "button",
|
|
786
|
+
className: SettingsCard_module_css_default.toggle,
|
|
787
|
+
"aria-expanded": open,
|
|
788
|
+
"aria-controls": bodyId,
|
|
789
|
+
onClick: () => {
|
|
790
|
+
setOpen((value) => !value);
|
|
791
|
+
},
|
|
792
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutlineRegular, {
|
|
793
|
+
className: SettingsCard_module_css_default.chevron,
|
|
794
|
+
size: 12,
|
|
795
|
+
"aria-hidden": "true"
|
|
796
|
+
}), seat === "settings-tab" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
797
|
+
className: SettingsCard_module_css_default.headText,
|
|
798
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
799
|
+
className: SettingsCard_module_css_default.name,
|
|
800
|
+
children: t("title")
|
|
801
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
802
|
+
className: SettingsCard_module_css_default.description,
|
|
803
|
+
children: t("description")
|
|
804
|
+
})]
|
|
805
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
806
|
+
className: SettingsCard_module_css_default.sectionName,
|
|
807
|
+
children: t("configSection")
|
|
787
808
|
})]
|
|
788
|
-
}),
|
|
809
|
+
}), error !== null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
810
|
+
className: SettingsCard_module_css_default.failedPill,
|
|
811
|
+
children: t("saveFailedShort")
|
|
812
|
+
}) : dirty ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
789
813
|
className: SettingsCard_module_css_default.pending,
|
|
790
814
|
children: t("unsaved")
|
|
791
815
|
}) : null]
|
|
792
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.
|
|
816
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
793
817
|
className: SettingsCard_module_css_default.body,
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
type: "button",
|
|
821
|
-
role: "switch",
|
|
822
|
-
"aria-checked": draft.enabled ?? true,
|
|
823
|
-
"aria-label": t("enable"),
|
|
824
|
-
className: `${SettingsCard_module_css_default.switch} ${draft.enabled ?? true ? SettingsCard_module_css_default.switchOn : ""}`,
|
|
825
|
-
disabled,
|
|
826
|
-
onClick: () => setDraft((current) => ({
|
|
827
|
-
...current,
|
|
828
|
-
enabled: !(current.enabled ?? true)
|
|
829
|
-
})),
|
|
830
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: SettingsCard_module_css_default.switchThumb })
|
|
831
|
-
})]
|
|
832
|
-
}),
|
|
833
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
834
|
-
className: SettingsCard_module_css_default.field,
|
|
835
|
-
children: [
|
|
836
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
818
|
+
id: bodyId,
|
|
819
|
+
hidden: !open,
|
|
820
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_deepseek_ai_dsh_client_ui_primitives.SettingsForm, {
|
|
821
|
+
labels: {
|
|
822
|
+
unavailable: t("unavailable", { ns: NS }),
|
|
823
|
+
readOnly: t("readOnly"),
|
|
824
|
+
saveFailed: t("saveFailed", { message: error ?? "" }),
|
|
825
|
+
save: t("save"),
|
|
826
|
+
saving: t("saving")
|
|
827
|
+
},
|
|
828
|
+
state: {
|
|
829
|
+
available: true,
|
|
830
|
+
writable: snap.writable,
|
|
831
|
+
dirty,
|
|
832
|
+
invalid: false,
|
|
833
|
+
saving,
|
|
834
|
+
failed: error !== null
|
|
835
|
+
},
|
|
836
|
+
onSave: () => {
|
|
837
|
+
save();
|
|
838
|
+
},
|
|
839
|
+
onDiscard: discard,
|
|
840
|
+
children: [
|
|
841
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
842
|
+
className: SettingsCard_module_css_default.field,
|
|
843
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
837
844
|
className: SettingsCard_module_css_default.fieldHead,
|
|
838
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("
|
|
845
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
839
846
|
className: SettingsCard_module_css_default.label,
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
}), (draft.autoApprove ?? true) !== (base.autoApprove ?? true) ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
847
|
+
children: t("enable")
|
|
848
|
+
}), draft.enabled !== (base.enabled ?? true) ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
843
849
|
type: "button",
|
|
844
850
|
className: SettingsCard_module_css_default.reset,
|
|
845
851
|
disabled,
|
|
846
852
|
onClick: () => setDraft((current) => ({
|
|
847
853
|
...current,
|
|
848
|
-
|
|
854
|
+
enabled: base.enabled ?? true
|
|
849
855
|
})),
|
|
850
856
|
children: t("reset")
|
|
851
857
|
}) : null]
|
|
852
|
-
}),
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
type: "button",
|
|
856
|
-
role: "switch",
|
|
857
|
-
"aria-checked": draft.autoApprove ?? true,
|
|
858
|
-
"aria-label": t("autoApprove"),
|
|
859
|
-
className: `${SettingsCard_module_css_default.switch} ${draft.autoApprove ?? true ? SettingsCard_module_css_default.switchOn : ""}`,
|
|
858
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Switch, {
|
|
859
|
+
checked: draft.enabled ?? true,
|
|
860
|
+
label: t("enable"),
|
|
860
861
|
disabled,
|
|
861
|
-
|
|
862
|
+
onChange: (enabled) => setDraft((current) => ({
|
|
862
863
|
...current,
|
|
863
|
-
|
|
864
|
-
}))
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
864
|
+
enabled
|
|
865
|
+
}))
|
|
866
|
+
})]
|
|
867
|
+
}),
|
|
868
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
869
|
+
className: SettingsCard_module_css_default.field,
|
|
870
|
+
children: [
|
|
871
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
872
|
+
className: SettingsCard_module_css_default.fieldHead,
|
|
873
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
874
|
+
className: SettingsCard_module_css_default.label,
|
|
875
|
+
children: t("autoApprove")
|
|
876
|
+
}), (draft.autoApprove ?? true) !== (base.autoApprove ?? true) ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
877
|
+
type: "button",
|
|
878
|
+
className: SettingsCard_module_css_default.reset,
|
|
879
|
+
disabled,
|
|
880
|
+
onClick: () => setDraft((current) => ({
|
|
881
|
+
...current,
|
|
882
|
+
autoApprove: base.autoApprove ?? true
|
|
883
|
+
})),
|
|
884
|
+
children: t("reset")
|
|
885
|
+
}) : null]
|
|
886
|
+
}),
|
|
887
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Switch, {
|
|
888
|
+
checked: draft.autoApprove ?? true,
|
|
889
|
+
label: t("autoApprove"),
|
|
885
890
|
disabled,
|
|
886
|
-
|
|
887
|
-
...current,
|
|
888
|
-
shelf: baseShelf
|
|
889
|
-
})),
|
|
890
|
-
children: t("reset")
|
|
891
|
-
}) : null]
|
|
892
|
-
}),
|
|
893
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("select", {
|
|
894
|
-
id: "ham-shelf",
|
|
895
|
-
className: SettingsCard_module_css_default.select,
|
|
896
|
-
value: draftShelf,
|
|
897
|
-
disabled: disabled || saving,
|
|
898
|
-
onChange: (event) => {
|
|
899
|
-
const shelf = event.target.value;
|
|
900
|
-
setDraft((current) => ({
|
|
891
|
+
onChange: (autoApprove) => setDraft((current) => ({
|
|
901
892
|
...current,
|
|
902
|
-
|
|
903
|
-
}))
|
|
904
|
-
},
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
children:
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
893
|
+
autoApprove
|
|
894
|
+
}))
|
|
895
|
+
}),
|
|
896
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
897
|
+
className: SettingsCard_module_css_default.hint,
|
|
898
|
+
children: t("autoApproveHint")
|
|
899
|
+
})
|
|
900
|
+
]
|
|
901
|
+
}),
|
|
902
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
903
|
+
className: SettingsCard_module_css_default.field,
|
|
904
|
+
children: [
|
|
905
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
906
|
+
className: SettingsCard_module_css_default.fieldHead,
|
|
907
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
908
|
+
className: SettingsCard_module_css_default.label,
|
|
909
|
+
htmlFor: "ham-shelf",
|
|
910
|
+
children: t("shelf")
|
|
911
|
+
}), draftShelf !== baseShelf ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
912
|
+
type: "button",
|
|
913
|
+
className: SettingsCard_module_css_default.reset,
|
|
914
|
+
disabled,
|
|
915
|
+
onClick: () => setDraft((current) => ({
|
|
916
|
+
...current,
|
|
917
|
+
shelf: baseShelf
|
|
918
|
+
})),
|
|
919
|
+
children: t("reset")
|
|
920
|
+
}) : null]
|
|
921
|
+
}),
|
|
922
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("select", {
|
|
923
|
+
id: "ham-shelf",
|
|
924
|
+
className: SettingsCard_module_css_default.select,
|
|
925
|
+
value: draftShelf,
|
|
926
|
+
disabled: disabled || saving,
|
|
927
|
+
onChange: (event) => {
|
|
928
|
+
const shelf = event.target.value;
|
|
929
|
+
setDraft((current) => ({
|
|
930
|
+
...current,
|
|
931
|
+
shelf
|
|
932
|
+
}));
|
|
927
933
|
},
|
|
928
|
-
children:
|
|
929
|
-
|
|
930
|
-
}) : null,
|
|
931
|
-
shelfStatus === "ready" && shelfListingError !== "" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
932
|
-
className: SettingsCard_module_css_default.notice,
|
|
933
|
-
role: "status",
|
|
934
|
-
children: t("shelfListingFailed", { message: shelfListingError })
|
|
935
|
-
}) : null,
|
|
936
|
-
shelfStatus === "ready" && shelfListingError === "" && chosen !== void 0 && (!chosen.listed || !chosen.connected) ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
937
|
-
className: SettingsCard_module_css_default.warning,
|
|
938
|
-
role: "status",
|
|
939
|
-
children: t(chosen.listed ? "shelfDisconnectedWarning" : "shelfNotListedWarning", { shelf: chosen.name })
|
|
940
|
-
}) : null,
|
|
941
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
942
|
-
className: SettingsCard_module_css_default.hint,
|
|
943
|
-
children: t("shelfHint")
|
|
944
|
-
})
|
|
945
|
-
]
|
|
946
|
-
}),
|
|
947
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
948
|
-
className: SettingsCard_module_css_default.group,
|
|
949
|
-
"aria-labelledby": "ham-consolidation-title",
|
|
950
|
-
children: [
|
|
951
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
|
|
952
|
-
id: "ham-consolidation-title",
|
|
953
|
-
className: SettingsCard_module_css_default.groupTitle,
|
|
954
|
-
children: t("consolidationTitle")
|
|
955
|
-
}),
|
|
956
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
957
|
-
className: SettingsCard_module_css_default.hint,
|
|
958
|
-
children: t("modelSelectionHint")
|
|
959
|
-
}),
|
|
960
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
961
|
-
className: SettingsCard_module_css_default.modelSelection,
|
|
962
|
-
children: [
|
|
963
|
-
catalogStatus === "loading" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
964
|
-
className: SettingsCard_module_css_default.notice,
|
|
965
|
-
role: "status",
|
|
966
|
-
children: t("modelCatalogLoading")
|
|
967
|
-
}) : null,
|
|
968
|
-
catalogStatus === "error" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
969
|
-
className: SettingsCard_module_css_default.catalogError,
|
|
970
|
-
role: "alert",
|
|
971
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("modelCatalogFailed") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
972
|
-
type: "button",
|
|
973
|
-
disabled: saving,
|
|
974
|
-
onClick: () => {
|
|
975
|
-
loadCatalog();
|
|
976
|
-
},
|
|
977
|
-
children: t("retry")
|
|
978
|
-
})]
|
|
979
|
-
}) : null,
|
|
980
|
-
catalogPartial ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
981
|
-
className: SettingsCard_module_css_default.notice,
|
|
982
|
-
children: t("modelCatalogPartial")
|
|
983
|
-
}) : null,
|
|
984
|
-
candidates.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("fieldset", {
|
|
985
|
-
className: SettingsCard_module_css_default.models,
|
|
986
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("legend", { children: t("selectedModels") }), selectedModels.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
987
|
-
className: SettingsCard_module_css_default.notice,
|
|
988
|
-
children: t("selectedModelsEmpty")
|
|
989
|
-
}) : selectedModels.map((candidate, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
990
|
-
className: SettingsCard_module_css_default.selectedRow,
|
|
991
|
-
children: [
|
|
992
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
993
|
-
className: SettingsCard_module_css_default.order,
|
|
994
|
-
children: index + 1
|
|
995
|
-
}),
|
|
996
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
997
|
-
className: SettingsCard_module_css_default.selectedText,
|
|
998
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
999
|
-
className: SettingsCard_module_css_default.modelName,
|
|
1000
|
-
children: candidate.modelName
|
|
1001
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1002
|
-
className: SettingsCard_module_css_default.route,
|
|
1003
|
-
children: `${candidate.providerName} · ${candidate.provider}/${candidate.model}`
|
|
1004
|
-
})]
|
|
1005
|
-
}),
|
|
1006
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("select", {
|
|
1007
|
-
className: SettingsCard_module_css_default.effort,
|
|
1008
|
-
"aria-label": `${t("reasoningEffort")}: ${candidate.modelName}`,
|
|
1009
|
-
title: candidate.reasoning === void 0 ? t("reasoningUnavailable") : routeDefaultLabel(candidate) ?? t("reasoningFollowPurpose"),
|
|
1010
|
-
value: candidate.reasoningEffort ?? "",
|
|
1011
|
-
disabled: disabled || saving || candidate.reasoning === void 0,
|
|
1012
|
-
onChange: (event) => setModelEffort(index, event.target.value === "" ? void 0 : event.target.value),
|
|
1013
|
-
children: reasoningEffortChoices(candidate.reasoning, candidate.reasoningEffort).map((choice) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
1014
|
-
value: choice.effort ?? "",
|
|
1015
|
-
children: effortChoiceLabel(choice)
|
|
1016
|
-
}, choice.key))
|
|
1017
|
-
}),
|
|
1018
|
-
!candidate.available ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1019
|
-
className: SettingsCard_module_css_default.unavailable,
|
|
1020
|
-
children: t("modelUnavailable")
|
|
1021
|
-
}) : null,
|
|
1022
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
1023
|
-
className: SettingsCard_module_css_default.rowActions,
|
|
1024
|
-
children: [
|
|
1025
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1026
|
-
type: "button",
|
|
1027
|
-
className: SettingsCard_module_css_default.move,
|
|
1028
|
-
title: t("moveUp"),
|
|
1029
|
-
"aria-label": `${t("moveUp")}: ${candidate.modelName}`,
|
|
1030
|
-
disabled: disabled || saving || index === 0,
|
|
1031
|
-
onClick: () => moveModel(index, index - 1),
|
|
1032
|
-
children: "↑"
|
|
1033
|
-
}),
|
|
1034
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1035
|
-
type: "button",
|
|
1036
|
-
className: SettingsCard_module_css_default.move,
|
|
1037
|
-
title: t("moveDown"),
|
|
1038
|
-
"aria-label": `${t("moveDown")}: ${candidate.modelName}`,
|
|
1039
|
-
disabled: disabled || saving || index === selectedModels.length - 1,
|
|
1040
|
-
onClick: () => moveModel(index, index + 1),
|
|
1041
|
-
children: "↓"
|
|
1042
|
-
}),
|
|
1043
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1044
|
-
type: "button",
|
|
1045
|
-
className: SettingsCard_module_css_default.move,
|
|
1046
|
-
title: t("remove"),
|
|
1047
|
-
"aria-label": `${t("remove")}: ${candidate.modelName}`,
|
|
1048
|
-
disabled: disabled || saving,
|
|
1049
|
-
onClick: () => toggleModel(candidate),
|
|
1050
|
-
children: "×"
|
|
1051
|
-
})
|
|
1052
|
-
]
|
|
1053
|
-
})
|
|
1054
|
-
]
|
|
1055
|
-
}, candidate.key))]
|
|
1056
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("fieldset", {
|
|
1057
|
-
className: SettingsCard_module_css_default.models,
|
|
934
|
+
children: choices.map((choice) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("option", {
|
|
935
|
+
value: choice.name,
|
|
1058
936
|
children: [
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1063
|
-
className: SettingsCard_module_css_default.providerName,
|
|
1064
|
-
children: group.providerName
|
|
1065
|
-
}), group.candidates.map(renderCandidate)]
|
|
1066
|
-
}, provider)),
|
|
1067
|
-
unavailable.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1068
|
-
className: SettingsCard_module_css_default.modelGroup,
|
|
1069
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1070
|
-
className: SettingsCard_module_css_default.providerName,
|
|
1071
|
-
children: t("unavailableModels")
|
|
1072
|
-
}), unavailable.map(renderCandidate)]
|
|
1073
|
-
}) : null
|
|
937
|
+
choice.name,
|
|
938
|
+
choice.path !== "" ? ` — ${choice.path}` : "",
|
|
939
|
+
!choice.listed ? t("shelfOptionStatus", { status: t("shelfNotListed") }) : !choice.connected ? t("shelfOptionStatus", { status: t("shelfDisconnected") }) : ""
|
|
1074
940
|
]
|
|
1075
|
-
}
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
children:
|
|
1092
|
-
className: SettingsCard_module_css_default.label,
|
|
1093
|
-
htmlFor: "ham-checkEveryTurns",
|
|
1094
|
-
children: t("checkEveryTurns")
|
|
1095
|
-
}), consolidation.checkEveryTurns !== (base.consolidation?.checkEveryTurns ?? DEFAULT_CONSOLIDATION.checkEveryTurns) ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1096
|
-
type: "button",
|
|
1097
|
-
className: SettingsCard_module_css_default.reset,
|
|
1098
|
-
disabled,
|
|
1099
|
-
onClick: () => updateConsolidation({ checkEveryTurns: base.consolidation?.checkEveryTurns ?? DEFAULT_CONSOLIDATION.checkEveryTurns }),
|
|
1100
|
-
children: t("reset")
|
|
1101
|
-
}) : null]
|
|
1102
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Input, {
|
|
1103
|
-
id: "ham-checkEveryTurns",
|
|
1104
|
-
className: SettingsCard_module_css_default.input,
|
|
1105
|
-
type: "number",
|
|
1106
|
-
min: 1,
|
|
1107
|
-
value: consolidation.checkEveryTurns,
|
|
1108
|
-
disabled,
|
|
1109
|
-
onChange: (event) => updateConsolidation({ checkEveryTurns: Number(event.target.value) })
|
|
1110
|
-
})]
|
|
1111
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1112
|
-
className: SettingsCard_module_css_default.field,
|
|
1113
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1114
|
-
className: SettingsCard_module_css_default.fieldHead,
|
|
1115
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
1116
|
-
className: SettingsCard_module_css_default.label,
|
|
1117
|
-
htmlFor: "ham-minNewTokens",
|
|
1118
|
-
children: t("minNewTokens")
|
|
1119
|
-
}), consolidation.minNewTokens !== (base.consolidation?.minNewTokens ?? DEFAULT_CONSOLIDATION.minNewTokens) ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1120
|
-
type: "button",
|
|
1121
|
-
className: SettingsCard_module_css_default.reset,
|
|
1122
|
-
disabled,
|
|
1123
|
-
onClick: () => updateConsolidation({ minNewTokens: base.consolidation?.minNewTokens ?? DEFAULT_CONSOLIDATION.minNewTokens }),
|
|
1124
|
-
children: t("reset")
|
|
1125
|
-
}) : null]
|
|
1126
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Input, {
|
|
1127
|
-
id: "ham-minNewTokens",
|
|
1128
|
-
className: SettingsCard_module_css_default.input,
|
|
1129
|
-
type: "number",
|
|
1130
|
-
min: 0,
|
|
1131
|
-
value: consolidation.minNewTokens,
|
|
1132
|
-
disabled,
|
|
1133
|
-
onChange: (event) => updateConsolidation({ minNewTokens: Number(event.target.value) })
|
|
1134
|
-
})]
|
|
1135
|
-
})]
|
|
1136
|
-
}),
|
|
1137
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1138
|
-
className: SettingsCard_module_css_default.pairedFields,
|
|
1139
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1140
|
-
className: SettingsCard_module_css_default.field,
|
|
1141
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1142
|
-
className: SettingsCard_module_css_default.fieldHead,
|
|
1143
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
1144
|
-
className: SettingsCard_module_css_default.label,
|
|
1145
|
-
htmlFor: "ham-cascadeBatchSize",
|
|
1146
|
-
children: t("cascadeBatchSize")
|
|
1147
|
-
}), (consolidation.cascade?.batchSize ?? DEFAULT_CONSOLIDATION.cascade.batchSize) !== (base.consolidation?.cascade?.batchSize ?? DEFAULT_CONSOLIDATION.cascade.batchSize) ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1148
|
-
type: "button",
|
|
1149
|
-
className: SettingsCard_module_css_default.reset,
|
|
1150
|
-
disabled,
|
|
1151
|
-
onClick: () => updateConsolidation({ cascade: {
|
|
1152
|
-
...consolidation.cascade ?? DEFAULT_CONSOLIDATION.cascade,
|
|
1153
|
-
batchSize: base.consolidation?.cascade?.batchSize ?? DEFAULT_CONSOLIDATION.cascade.batchSize
|
|
1154
|
-
} }),
|
|
1155
|
-
children: t("reset")
|
|
1156
|
-
}) : null]
|
|
1157
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Input, {
|
|
1158
|
-
id: "ham-cascadeBatchSize",
|
|
1159
|
-
className: SettingsCard_module_css_default.input,
|
|
1160
|
-
type: "number",
|
|
1161
|
-
min: 2,
|
|
1162
|
-
value: consolidation.cascade?.batchSize ?? DEFAULT_CONSOLIDATION.cascade.batchSize,
|
|
1163
|
-
disabled,
|
|
1164
|
-
onChange: (event) => updateConsolidation({ cascade: {
|
|
1165
|
-
...consolidation.cascade ?? DEFAULT_CONSOLIDATION.cascade,
|
|
1166
|
-
batchSize: Number(event.target.value)
|
|
1167
|
-
} })
|
|
941
|
+
}, choice.name))
|
|
942
|
+
}),
|
|
943
|
+
shelfStatus === "loading" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
944
|
+
className: SettingsCard_module_css_default.notice,
|
|
945
|
+
role: "status",
|
|
946
|
+
children: t("shelfLoading")
|
|
947
|
+
}) : null,
|
|
948
|
+
shelfStatus === "error" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
949
|
+
className: SettingsCard_module_css_default.catalogError,
|
|
950
|
+
role: "alert",
|
|
951
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("shelfLoadFailed") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
952
|
+
type: "button",
|
|
953
|
+
disabled: saving,
|
|
954
|
+
onClick: () => {
|
|
955
|
+
loadShelves();
|
|
956
|
+
},
|
|
957
|
+
children: t("retry")
|
|
1168
958
|
})]
|
|
1169
|
-
})
|
|
1170
|
-
|
|
959
|
+
}) : null,
|
|
960
|
+
shelfStatus === "ready" && shelfListingError !== "" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
961
|
+
className: SettingsCard_module_css_default.notice,
|
|
962
|
+
role: "status",
|
|
963
|
+
children: t("shelfListingFailed", { message: shelfListingError })
|
|
964
|
+
}) : null,
|
|
965
|
+
shelfStatus === "ready" && shelfListingError === "" && chosen !== void 0 && (!chosen.listed || !chosen.connected) ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
966
|
+
className: SettingsCard_module_css_default.warning,
|
|
967
|
+
role: "status",
|
|
968
|
+
children: t(chosen.listed ? "shelfDisconnectedWarning" : "shelfNotListedWarning", { shelf: chosen.name })
|
|
969
|
+
}) : null,
|
|
970
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
971
|
+
className: SettingsCard_module_css_default.hint,
|
|
972
|
+
children: t("shelfHint")
|
|
973
|
+
})
|
|
974
|
+
]
|
|
975
|
+
}),
|
|
976
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
977
|
+
className: SettingsCard_module_css_default.group,
|
|
978
|
+
"aria-labelledby": "ham-consolidation-title",
|
|
979
|
+
children: [
|
|
980
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
|
|
981
|
+
id: "ham-consolidation-title",
|
|
982
|
+
className: SettingsCard_module_css_default.groupTitle,
|
|
983
|
+
children: t("consolidationTitle")
|
|
984
|
+
}),
|
|
985
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
986
|
+
className: SettingsCard_module_css_default.hint,
|
|
987
|
+
children: t("modelSelectionHint")
|
|
988
|
+
}),
|
|
989
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
990
|
+
className: SettingsCard_module_css_default.modelSelection,
|
|
991
|
+
children: [
|
|
992
|
+
catalogStatus === "loading" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
993
|
+
className: SettingsCard_module_css_default.notice,
|
|
994
|
+
role: "status",
|
|
995
|
+
children: t("modelCatalogLoading")
|
|
996
|
+
}) : null,
|
|
997
|
+
catalogStatus === "error" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
998
|
+
className: SettingsCard_module_css_default.catalogError,
|
|
999
|
+
role: "alert",
|
|
1000
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("modelCatalogFailed") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1001
|
+
type: "button",
|
|
1002
|
+
disabled: saving,
|
|
1003
|
+
onClick: () => {
|
|
1004
|
+
loadCatalog();
|
|
1005
|
+
},
|
|
1006
|
+
children: t("retry")
|
|
1007
|
+
})]
|
|
1008
|
+
}) : null,
|
|
1009
|
+
catalogPartial ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
1010
|
+
className: SettingsCard_module_css_default.notice,
|
|
1011
|
+
children: t("modelCatalogPartial")
|
|
1012
|
+
}) : null,
|
|
1013
|
+
candidates.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("fieldset", {
|
|
1014
|
+
className: SettingsCard_module_css_default.models,
|
|
1015
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("legend", { children: t("selectedModels") }), selectedModels.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
1016
|
+
className: SettingsCard_module_css_default.notice,
|
|
1017
|
+
children: t("selectedModelsEmpty")
|
|
1018
|
+
}) : selectedModels.map((candidate, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1019
|
+
className: SettingsCard_module_css_default.selectedRow,
|
|
1020
|
+
children: [
|
|
1021
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1022
|
+
className: SettingsCard_module_css_default.order,
|
|
1023
|
+
children: index + 1
|
|
1024
|
+
}),
|
|
1025
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
1026
|
+
className: SettingsCard_module_css_default.selectedText,
|
|
1027
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1028
|
+
className: SettingsCard_module_css_default.modelName,
|
|
1029
|
+
children: candidate.modelName
|
|
1030
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1031
|
+
className: SettingsCard_module_css_default.route,
|
|
1032
|
+
children: `${candidate.providerName} · ${candidate.provider}/${candidate.model}`
|
|
1033
|
+
})]
|
|
1034
|
+
}),
|
|
1035
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("select", {
|
|
1036
|
+
className: SettingsCard_module_css_default.effort,
|
|
1037
|
+
"aria-label": `${t("reasoningEffort")}: ${candidate.modelName}`,
|
|
1038
|
+
title: candidate.reasoning === void 0 ? t("reasoningUnavailable") : routeDefaultLabel(candidate) ?? t("reasoningFollowPurpose"),
|
|
1039
|
+
value: candidate.reasoningEffort ?? "",
|
|
1040
|
+
disabled: disabled || saving || candidate.reasoning === void 0,
|
|
1041
|
+
onChange: (event) => setModelEffort(index, event.target.value === "" ? void 0 : event.target.value),
|
|
1042
|
+
children: reasoningEffortChoices(candidate.reasoning, candidate.reasoningEffort).map((choice) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
1043
|
+
value: choice.effort ?? "",
|
|
1044
|
+
children: effortChoiceLabel(choice)
|
|
1045
|
+
}, choice.key))
|
|
1046
|
+
}),
|
|
1047
|
+
!candidate.available ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1048
|
+
className: SettingsCard_module_css_default.unavailable,
|
|
1049
|
+
children: t("modelUnavailable")
|
|
1050
|
+
}) : null,
|
|
1051
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
1052
|
+
className: SettingsCard_module_css_default.rowActions,
|
|
1053
|
+
children: [
|
|
1054
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1055
|
+
type: "button",
|
|
1056
|
+
className: SettingsCard_module_css_default.move,
|
|
1057
|
+
title: t("moveUp"),
|
|
1058
|
+
"aria-label": `${t("moveUp")}: ${candidate.modelName}`,
|
|
1059
|
+
disabled: disabled || saving || index === 0,
|
|
1060
|
+
onClick: () => moveModel(index, index - 1),
|
|
1061
|
+
children: "↑"
|
|
1062
|
+
}),
|
|
1063
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1064
|
+
type: "button",
|
|
1065
|
+
className: SettingsCard_module_css_default.move,
|
|
1066
|
+
title: t("moveDown"),
|
|
1067
|
+
"aria-label": `${t("moveDown")}: ${candidate.modelName}`,
|
|
1068
|
+
disabled: disabled || saving || index === selectedModels.length - 1,
|
|
1069
|
+
onClick: () => moveModel(index, index + 1),
|
|
1070
|
+
children: "↓"
|
|
1071
|
+
}),
|
|
1072
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1073
|
+
type: "button",
|
|
1074
|
+
className: SettingsCard_module_css_default.move,
|
|
1075
|
+
title: t("remove"),
|
|
1076
|
+
"aria-label": `${t("remove")}: ${candidate.modelName}`,
|
|
1077
|
+
disabled: disabled || saving,
|
|
1078
|
+
onClick: () => toggleModel(candidate),
|
|
1079
|
+
children: "×"
|
|
1080
|
+
})
|
|
1081
|
+
]
|
|
1082
|
+
})
|
|
1083
|
+
]
|
|
1084
|
+
}, candidate.key))]
|
|
1085
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("fieldset", {
|
|
1086
|
+
className: SettingsCard_module_css_default.models,
|
|
1087
|
+
children: [
|
|
1088
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("legend", { children: t("availableModels") }),
|
|
1089
|
+
[...availableGroups].map(([provider, group]) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1090
|
+
className: SettingsCard_module_css_default.modelGroup,
|
|
1091
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1092
|
+
className: SettingsCard_module_css_default.providerName,
|
|
1093
|
+
children: group.providerName
|
|
1094
|
+
}), group.candidates.map(renderCandidate)]
|
|
1095
|
+
}, provider)),
|
|
1096
|
+
unavailable.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1097
|
+
className: SettingsCard_module_css_default.modelGroup,
|
|
1098
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1099
|
+
className: SettingsCard_module_css_default.providerName,
|
|
1100
|
+
children: t("unavailableModels")
|
|
1101
|
+
}), unavailable.map(renderCandidate)]
|
|
1102
|
+
}) : null
|
|
1103
|
+
]
|
|
1104
|
+
})] }) : catalogStatus === "ready" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
1105
|
+
className: SettingsCard_module_css_default.notice,
|
|
1106
|
+
children: t("modelCatalogEmpty")
|
|
1107
|
+
}) : null,
|
|
1108
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
1109
|
+
className: SettingsCard_module_css_default.hint,
|
|
1110
|
+
children: t("reasoningBudgetHint")
|
|
1111
|
+
})
|
|
1112
|
+
]
|
|
1113
|
+
}),
|
|
1114
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1115
|
+
className: SettingsCard_module_css_default.pairedFields,
|
|
1171
1116
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1172
|
-
className: SettingsCard_module_css_default.
|
|
1173
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.
|
|
1174
|
-
className: SettingsCard_module_css_default.
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1117
|
+
className: SettingsCard_module_css_default.field,
|
|
1118
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1119
|
+
className: SettingsCard_module_css_default.fieldHead,
|
|
1120
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
1121
|
+
className: SettingsCard_module_css_default.label,
|
|
1122
|
+
htmlFor: "ham-checkEveryTurns",
|
|
1123
|
+
children: t("checkEveryTurns")
|
|
1124
|
+
}), consolidation.checkEveryTurns !== (base.consolidation?.checkEveryTurns ?? DEFAULT_CONSOLIDATION.checkEveryTurns) ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1125
|
+
type: "button",
|
|
1126
|
+
className: SettingsCard_module_css_default.reset,
|
|
1127
|
+
disabled,
|
|
1128
|
+
onClick: () => updateConsolidation({ checkEveryTurns: base.consolidation?.checkEveryTurns ?? DEFAULT_CONSOLIDATION.checkEveryTurns }),
|
|
1129
|
+
children: t("reset")
|
|
1130
|
+
}) : null]
|
|
1131
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Input, {
|
|
1132
|
+
id: "ham-checkEveryTurns",
|
|
1133
|
+
className: SettingsCard_module_css_default.input,
|
|
1134
|
+
type: "number",
|
|
1135
|
+
min: 1,
|
|
1136
|
+
value: consolidation.checkEveryTurns,
|
|
1180
1137
|
disabled,
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Input, {
|
|
1185
|
-
id: "ham-dedupMaxDistance",
|
|
1186
|
-
className: SettingsCard_module_css_default.input,
|
|
1187
|
-
type: "number",
|
|
1188
|
-
min: 0,
|
|
1189
|
-
step: .05,
|
|
1190
|
-
value: consolidation.dedupMaxDistance ?? DEFAULT_CONSOLIDATION.dedupMaxDistance,
|
|
1191
|
-
disabled,
|
|
1192
|
-
onChange: (event) => updateConsolidation({ dedupMaxDistance: Number(event.target.value) })
|
|
1193
|
-
})]
|
|
1194
|
-
})]
|
|
1195
|
-
}),
|
|
1196
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
1197
|
-
className: SettingsCard_module_css_default.hint,
|
|
1198
|
-
children: t("cascadeHint")
|
|
1199
|
-
}),
|
|
1200
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h4", {
|
|
1201
|
-
className: SettingsCard_module_css_default.limitsTitle,
|
|
1202
|
-
children: t("limitsTitle")
|
|
1203
|
-
}),
|
|
1204
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
1205
|
-
className: SettingsCard_module_css_default.hint,
|
|
1206
|
-
children: t("limitsHint")
|
|
1207
|
-
}),
|
|
1208
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1209
|
-
className: SettingsCard_module_css_default.pairedFields,
|
|
1210
|
-
children: [
|
|
1211
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1138
|
+
onChange: (event) => updateConsolidation({ checkEveryTurns: Number(event.target.value) })
|
|
1139
|
+
})]
|
|
1140
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1212
1141
|
className: SettingsCard_module_css_default.field,
|
|
1213
1142
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1214
1143
|
className: SettingsCard_module_css_default.fieldHead,
|
|
1215
1144
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
1216
1145
|
className: SettingsCard_module_css_default.label,
|
|
1217
|
-
htmlFor: "ham-
|
|
1218
|
-
children: t("
|
|
1219
|
-
}), consolidation.
|
|
1146
|
+
htmlFor: "ham-minNewTokens",
|
|
1147
|
+
children: t("minNewTokens")
|
|
1148
|
+
}), consolidation.minNewTokens !== (base.consolidation?.minNewTokens ?? DEFAULT_CONSOLIDATION.minNewTokens) ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1220
1149
|
type: "button",
|
|
1221
1150
|
className: SettingsCard_module_css_default.reset,
|
|
1222
1151
|
disabled,
|
|
1223
|
-
onClick: () => updateConsolidation({
|
|
1152
|
+
onClick: () => updateConsolidation({ minNewTokens: base.consolidation?.minNewTokens ?? DEFAULT_CONSOLIDATION.minNewTokens }),
|
|
1224
1153
|
children: t("reset")
|
|
1225
1154
|
}) : null]
|
|
1226
1155
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Input, {
|
|
1227
|
-
id: "ham-
|
|
1156
|
+
id: "ham-minNewTokens",
|
|
1228
1157
|
className: SettingsCard_module_css_default.input,
|
|
1229
1158
|
type: "number",
|
|
1230
|
-
min:
|
|
1231
|
-
|
|
1232
|
-
value: consolidation.maxInputTokens,
|
|
1159
|
+
min: 0,
|
|
1160
|
+
value: consolidation.minNewTokens,
|
|
1233
1161
|
disabled,
|
|
1234
|
-
onChange: (event) => updateConsolidation({
|
|
1162
|
+
onChange: (event) => updateConsolidation({ minNewTokens: Number(event.target.value) })
|
|
1235
1163
|
})]
|
|
1236
|
-
})
|
|
1237
|
-
|
|
1164
|
+
})]
|
|
1165
|
+
}),
|
|
1166
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1167
|
+
className: SettingsCard_module_css_default.pairedFields,
|
|
1168
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1238
1169
|
className: SettingsCard_module_css_default.field,
|
|
1239
1170
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1240
1171
|
className: SettingsCard_module_css_default.fieldHead,
|
|
1241
1172
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
1242
1173
|
className: SettingsCard_module_css_default.label,
|
|
1243
|
-
htmlFor: "ham-
|
|
1244
|
-
children: t("
|
|
1245
|
-
}), consolidation.
|
|
1174
|
+
htmlFor: "ham-cascadeBatchSize",
|
|
1175
|
+
children: t("cascadeBatchSize")
|
|
1176
|
+
}), (consolidation.cascade?.batchSize ?? DEFAULT_CONSOLIDATION.cascade.batchSize) !== (base.consolidation?.cascade?.batchSize ?? DEFAULT_CONSOLIDATION.cascade.batchSize) ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1246
1177
|
type: "button",
|
|
1247
1178
|
className: SettingsCard_module_css_default.reset,
|
|
1248
1179
|
disabled,
|
|
1249
|
-
onClick: () => updateConsolidation({
|
|
1180
|
+
onClick: () => updateConsolidation({ cascade: {
|
|
1181
|
+
...consolidation.cascade ?? DEFAULT_CONSOLIDATION.cascade,
|
|
1182
|
+
batchSize: base.consolidation?.cascade?.batchSize ?? DEFAULT_CONSOLIDATION.cascade.batchSize
|
|
1183
|
+
} }),
|
|
1250
1184
|
children: t("reset")
|
|
1251
1185
|
}) : null]
|
|
1252
1186
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Input, {
|
|
1253
|
-
id: "ham-
|
|
1187
|
+
id: "ham-cascadeBatchSize",
|
|
1254
1188
|
className: SettingsCard_module_css_default.input,
|
|
1255
1189
|
type: "number",
|
|
1256
|
-
min:
|
|
1257
|
-
|
|
1258
|
-
value: consolidation.maxOutputTokens,
|
|
1190
|
+
min: 2,
|
|
1191
|
+
value: consolidation.cascade?.batchSize ?? DEFAULT_CONSOLIDATION.cascade.batchSize,
|
|
1259
1192
|
disabled,
|
|
1260
|
-
onChange: (event) => updateConsolidation({
|
|
1193
|
+
onChange: (event) => updateConsolidation({ cascade: {
|
|
1194
|
+
...consolidation.cascade ?? DEFAULT_CONSOLIDATION.cascade,
|
|
1195
|
+
batchSize: Number(event.target.value)
|
|
1196
|
+
} })
|
|
1261
1197
|
})]
|
|
1262
|
-
}),
|
|
1263
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1198
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1264
1199
|
className: SettingsCard_module_css_default.field,
|
|
1265
1200
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1266
1201
|
className: SettingsCard_module_css_default.fieldHead,
|
|
1267
1202
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
1268
1203
|
className: SettingsCard_module_css_default.label,
|
|
1269
|
-
htmlFor: "ham-
|
|
1270
|
-
children: t("
|
|
1271
|
-
}), consolidation.
|
|
1204
|
+
htmlFor: "ham-dedupMaxDistance",
|
|
1205
|
+
children: t("dedupMaxDistance")
|
|
1206
|
+
}), (consolidation.dedupMaxDistance ?? DEFAULT_CONSOLIDATION.dedupMaxDistance) !== (base.consolidation?.dedupMaxDistance ?? DEFAULT_CONSOLIDATION.dedupMaxDistance) ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1272
1207
|
type: "button",
|
|
1273
1208
|
className: SettingsCard_module_css_default.reset,
|
|
1274
1209
|
disabled,
|
|
1275
|
-
onClick: () => updateConsolidation({
|
|
1210
|
+
onClick: () => updateConsolidation({ dedupMaxDistance: base.consolidation?.dedupMaxDistance ?? DEFAULT_CONSOLIDATION.dedupMaxDistance }),
|
|
1276
1211
|
children: t("reset")
|
|
1277
1212
|
}) : null]
|
|
1278
1213
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Input, {
|
|
1279
|
-
id: "ham-
|
|
1214
|
+
id: "ham-dedupMaxDistance",
|
|
1280
1215
|
className: SettingsCard_module_css_default.input,
|
|
1281
1216
|
type: "number",
|
|
1282
|
-
min:
|
|
1283
|
-
|
|
1284
|
-
value: consolidation.
|
|
1217
|
+
min: 0,
|
|
1218
|
+
step: .05,
|
|
1219
|
+
value: consolidation.dedupMaxDistance ?? DEFAULT_CONSOLIDATION.dedupMaxDistance,
|
|
1285
1220
|
disabled,
|
|
1286
|
-
onChange: (event) => updateConsolidation({
|
|
1221
|
+
onChange: (event) => updateConsolidation({ dedupMaxDistance: Number(event.target.value) })
|
|
1287
1222
|
})]
|
|
1288
|
-
})
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1223
|
+
})]
|
|
1224
|
+
}),
|
|
1225
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
1226
|
+
className: SettingsCard_module_css_default.hint,
|
|
1227
|
+
children: t("cascadeHint")
|
|
1228
|
+
}),
|
|
1229
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h4", {
|
|
1230
|
+
className: SettingsCard_module_css_default.limitsTitle,
|
|
1231
|
+
children: t("limitsTitle")
|
|
1232
|
+
}),
|
|
1233
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
1234
|
+
className: SettingsCard_module_css_default.hint,
|
|
1235
|
+
children: t("limitsHint")
|
|
1236
|
+
}),
|
|
1237
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1238
|
+
className: SettingsCard_module_css_default.pairedFields,
|
|
1239
|
+
children: [
|
|
1240
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1241
|
+
className: SettingsCard_module_css_default.field,
|
|
1242
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1243
|
+
className: SettingsCard_module_css_default.fieldHead,
|
|
1244
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
1245
|
+
className: SettingsCard_module_css_default.label,
|
|
1246
|
+
htmlFor: "ham-maxInputTokens",
|
|
1247
|
+
children: t("maxInputTokens")
|
|
1248
|
+
}), consolidation.maxInputTokens !== (base.consolidation?.maxInputTokens ?? DEFAULT_CONSOLIDATION.maxInputTokens) ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1249
|
+
type: "button",
|
|
1250
|
+
className: SettingsCard_module_css_default.reset,
|
|
1251
|
+
disabled,
|
|
1252
|
+
onClick: () => updateConsolidation({ maxInputTokens: base.consolidation?.maxInputTokens ?? DEFAULT_CONSOLIDATION.maxInputTokens }),
|
|
1253
|
+
children: t("reset")
|
|
1254
|
+
}) : null]
|
|
1255
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Input, {
|
|
1256
|
+
id: "ham-maxInputTokens",
|
|
1257
|
+
className: SettingsCard_module_css_default.input,
|
|
1258
|
+
type: "number",
|
|
1259
|
+
min: 1e3,
|
|
1260
|
+
step: 1e3,
|
|
1261
|
+
value: consolidation.maxInputTokens,
|
|
1262
|
+
disabled,
|
|
1263
|
+
onChange: (event) => updateConsolidation({ maxInputTokens: Number(event.target.value) })
|
|
1264
|
+
})]
|
|
1265
|
+
}),
|
|
1266
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1267
|
+
className: SettingsCard_module_css_default.field,
|
|
1268
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1269
|
+
className: SettingsCard_module_css_default.fieldHead,
|
|
1270
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
1271
|
+
className: SettingsCard_module_css_default.label,
|
|
1272
|
+
htmlFor: "ham-maxOutputTokens",
|
|
1273
|
+
children: t("maxOutputTokens")
|
|
1274
|
+
}), consolidation.maxOutputTokens !== (base.consolidation?.maxOutputTokens ?? DEFAULT_CONSOLIDATION.maxOutputTokens) ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1275
|
+
type: "button",
|
|
1276
|
+
className: SettingsCard_module_css_default.reset,
|
|
1277
|
+
disabled,
|
|
1278
|
+
onClick: () => updateConsolidation({ maxOutputTokens: base.consolidation?.maxOutputTokens ?? DEFAULT_CONSOLIDATION.maxOutputTokens }),
|
|
1279
|
+
children: t("reset")
|
|
1280
|
+
}) : null]
|
|
1281
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Input, {
|
|
1282
|
+
id: "ham-maxOutputTokens",
|
|
1283
|
+
className: SettingsCard_module_css_default.input,
|
|
1284
|
+
type: "number",
|
|
1285
|
+
min: 200,
|
|
1286
|
+
step: 200,
|
|
1287
|
+
value: consolidation.maxOutputTokens,
|
|
1288
|
+
disabled,
|
|
1289
|
+
onChange: (event) => updateConsolidation({ maxOutputTokens: Number(event.target.value) })
|
|
1290
|
+
})]
|
|
1291
|
+
}),
|
|
1292
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1293
|
+
className: SettingsCard_module_css_default.field,
|
|
1294
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1295
|
+
className: SettingsCard_module_css_default.fieldHead,
|
|
1296
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
1297
|
+
className: SettingsCard_module_css_default.label,
|
|
1298
|
+
htmlFor: "ham-maxWorkUnitsPerRun",
|
|
1299
|
+
children: t("maxWorkUnitsPerRun")
|
|
1300
|
+
}), consolidation.maxWorkUnitsPerRun !== (base.consolidation?.maxWorkUnitsPerRun ?? DEFAULT_CONSOLIDATION.maxWorkUnitsPerRun) ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1301
|
+
type: "button",
|
|
1302
|
+
className: SettingsCard_module_css_default.reset,
|
|
1303
|
+
disabled,
|
|
1304
|
+
onClick: () => updateConsolidation({ maxWorkUnitsPerRun: base.consolidation?.maxWorkUnitsPerRun ?? DEFAULT_CONSOLIDATION.maxWorkUnitsPerRun }),
|
|
1305
|
+
children: t("reset")
|
|
1306
|
+
}) : null]
|
|
1307
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Input, {
|
|
1308
|
+
id: "ham-maxWorkUnitsPerRun",
|
|
1309
|
+
className: SettingsCard_module_css_default.input,
|
|
1310
|
+
type: "number",
|
|
1311
|
+
min: 1,
|
|
1312
|
+
max: 10,
|
|
1313
|
+
value: consolidation.maxWorkUnitsPerRun,
|
|
1314
|
+
disabled,
|
|
1315
|
+
onChange: (event) => updateConsolidation({ maxWorkUnitsPerRun: Number(event.target.value) })
|
|
1316
|
+
})]
|
|
1317
|
+
})
|
|
1318
|
+
]
|
|
1319
|
+
})
|
|
1320
|
+
]
|
|
1321
|
+
}),
|
|
1322
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1323
|
+
className: SettingsCard_module_css_default.field,
|
|
1324
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1325
|
+
className: SettingsCard_module_css_default.fieldHead,
|
|
1326
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1327
|
+
className: SettingsCard_module_css_default.label,
|
|
1328
|
+
children: t("recallPreload")
|
|
1329
|
+
}), (recall.preloadRulesTaboos ?? true) !== (base.recall?.preloadRulesTaboos ?? true) ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1330
|
+
type: "button",
|
|
1331
|
+
className: SettingsCard_module_css_default.reset,
|
|
1332
|
+
disabled,
|
|
1333
|
+
onClick: () => setDraft((current) => ({
|
|
1334
|
+
...current,
|
|
1335
|
+
recall: {
|
|
1336
|
+
...current.recall ?? { preloadRulesTaboos: true },
|
|
1337
|
+
preloadRulesTaboos: base.recall?.preloadRulesTaboos ?? true
|
|
1338
|
+
}
|
|
1339
|
+
})),
|
|
1340
|
+
children: t("reset")
|
|
1341
|
+
}) : null]
|
|
1342
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Switch, {
|
|
1343
|
+
checked: recall.preloadRulesTaboos ?? true,
|
|
1344
|
+
label: t("recallPreload"),
|
|
1304
1345
|
disabled,
|
|
1305
|
-
|
|
1346
|
+
onChange: (preloadRulesTaboos) => setDraft((current) => ({
|
|
1306
1347
|
...current,
|
|
1307
1348
|
recall: {
|
|
1308
1349
|
...current.recall ?? { preloadRulesTaboos: true },
|
|
1309
|
-
preloadRulesTaboos
|
|
1350
|
+
preloadRulesTaboos
|
|
1310
1351
|
}
|
|
1311
|
-
}))
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
className: `${SettingsCard_module_css_default.switch} ${recall.preloadRulesTaboos ?? true ? SettingsCard_module_css_default.switchOn : ""}`,
|
|
1321
|
-
disabled,
|
|
1322
|
-
onClick: () => setDraft((current) => ({
|
|
1323
|
-
...current,
|
|
1324
|
-
recall: {
|
|
1325
|
-
...current.recall ?? { preloadRulesTaboos: true },
|
|
1326
|
-
preloadRulesTaboos: !(current.recall?.preloadRulesTaboos ?? true)
|
|
1327
|
-
}
|
|
1328
|
-
})),
|
|
1329
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: SettingsCard_module_css_default.switchThumb })
|
|
1330
|
-
})]
|
|
1331
|
-
}),
|
|
1332
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
1333
|
-
className: SettingsCard_module_css_default.advancedHint,
|
|
1334
|
-
children: t("advancedHint", { ns: NS })
|
|
1335
|
-
}),
|
|
1336
|
-
error ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
1337
|
-
className: SettingsCard_module_css_default.error,
|
|
1338
|
-
role: "status",
|
|
1339
|
-
children: t("saveFailed", { message: error })
|
|
1340
|
-
}) : null,
|
|
1341
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1342
|
-
className: SettingsCard_module_css_default.footer,
|
|
1343
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
1344
|
-
variant: "outline",
|
|
1345
|
-
size: "sm",
|
|
1346
|
-
disabled: !dirty || saving,
|
|
1347
|
-
onClick: discard,
|
|
1348
|
-
children: t("discard")
|
|
1349
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
1350
|
-
variant: "primary",
|
|
1351
|
-
size: "sm",
|
|
1352
|
-
disabled: saveBlocked,
|
|
1353
|
-
onClick: save,
|
|
1354
|
-
children: saving ? t("saving") : t("save")
|
|
1355
|
-
})]
|
|
1356
|
-
})
|
|
1357
|
-
]
|
|
1352
|
+
}))
|
|
1353
|
+
})]
|
|
1354
|
+
}),
|
|
1355
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
1356
|
+
className: SettingsCard_module_css_default.advancedHint,
|
|
1357
|
+
children: t("advancedHint", { ns: NS })
|
|
1358
|
+
})
|
|
1359
|
+
]
|
|
1360
|
+
})
|
|
1358
1361
|
})]
|
|
1359
1362
|
});
|
|
1360
1363
|
}
|
|
@@ -2307,10 +2310,11 @@ window.__ModuleLoader__.load({
|
|
|
2307
2310
|
};
|
|
2308
2311
|
};
|
|
2309
2312
|
const loadShelfInventory = fetchShelves;
|
|
2310
|
-
const renderCard = (props) => (0, react.createElement)(SettingsCard, {
|
|
2313
|
+
const renderCard = (seat) => (props) => (0, react.createElement)(SettingsCard, {
|
|
2311
2314
|
scope: form,
|
|
2312
2315
|
loadModelCatalog,
|
|
2313
2316
|
loadShelfInventory,
|
|
2317
|
+
seat,
|
|
2314
2318
|
...props
|
|
2315
2319
|
});
|
|
2316
2320
|
const unregister = ctx.effect(() => configForms.whileServed([NS], () => installPluginCard(ctx, {
|
|
@@ -2318,13 +2322,13 @@ window.__ModuleLoader__.load({
|
|
|
2318
2322
|
name: BUNDLE_CONFIG_SEAT,
|
|
2319
2323
|
key: BUNDLE_NAME,
|
|
2320
2324
|
locale: NS
|
|
2321
|
-
}, renderCard),
|
|
2325
|
+
}, renderCard("official")),
|
|
2322
2326
|
settingsTab: () => ctx.slots.register({
|
|
2323
2327
|
name: SETTINGS_TAB_SEAT,
|
|
2324
2328
|
id: NS,
|
|
2325
2329
|
label: () => t("title"),
|
|
2326
2330
|
locale: NS
|
|
2327
|
-
}, renderCard),
|
|
2331
|
+
}, renderCard("settings-tab")),
|
|
2328
2332
|
onRefused: (seat, error) => {
|
|
2329
2333
|
console.warn(`[${BUNDLE_NAME}] configuration card refused by slot "${seat}"`, error);
|
|
2330
2334
|
}
|