dsh-model-switch 0.4.43 → 0.4.44
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/CHANGELOG.md +13 -0
- package/cordis.patch.yml +7 -0
- package/lib/auto-review-BbfitRtw.js +1067 -0
- package/lib/auto-review.js +1 -1
- package/lib/client.js +184 -9
- package/lib/compaction.js +1 -1
- package/lib/index.js +11 -3
- package/lib/prime-memory-compat.js +204 -0
- package/lib/session-route-D8izd8Zd.js +279 -0
- package/lib/session-title.js +1 -1
- package/lib/subagent-runtime.js +1 -1
- package/lib/types/client/ModelSwitchSettings.d.ts +2 -1
- package/lib/types/client/locales.d.ts +6 -2
- package/lib/types/client-contract.d.ts +9 -0
- package/lib/types/host-settings.d.ts +7 -0
- package/lib/types/prime-memory-compat.d.ts +87 -0
- package/lib/types/prime-memory-route.d.ts +75 -0
- package/lib/types/provider-group.d.ts +4 -1
- package/lib/types/session-route.d.ts +16 -1
- package/package.json +5 -1
package/lib/auto-review.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as bindAutoReviewSessionCorrelation, c as installToolCallSafetyNet, d as resolveSessionAutoReviewRoute, f as reviewLlm, i as autoReviewStatus, l as isReviewerInfrastructureFailure, n as autoReviewGate, o as defensivePermissionPresets, p as reviewScope, r as autoReviewRouteOf, s as inject, t as apply, u as name } from "./auto-review-
|
|
1
|
+
import { a as bindAutoReviewSessionCorrelation, c as installToolCallSafetyNet, d as resolveSessionAutoReviewRoute, f as reviewLlm, i as autoReviewStatus, l as isReviewerInfrastructureFailure, n as autoReviewGate, o as defensivePermissionPresets, p as reviewScope, r as autoReviewRouteOf, s as inject, t as apply, u as name } from "./auto-review-BbfitRtw.js";
|
|
2
2
|
export { apply, autoReviewGate, autoReviewRouteOf, autoReviewStatus, bindAutoReviewSessionCorrelation, defensivePermissionPresets, inject, installToolCallSafetyNet, isReviewerInfrastructureFailure, name, resolveSessionAutoReviewRoute, reviewLlm, reviewScope };
|
package/lib/client.js
CHANGED
|
@@ -391,6 +391,11 @@ window.__ModuleLoader__.load({
|
|
|
391
391
|
provider: "titleProvider",
|
|
392
392
|
model: "titleModel"
|
|
393
393
|
});
|
|
394
|
+
/** Distillation route handed to the memory plugin when it follows its own default. */
|
|
395
|
+
const MEMORY_SETTINGS_FIELDS = Object.freeze({
|
|
396
|
+
provider: "memoryProvider",
|
|
397
|
+
model: "memoryModel"
|
|
398
|
+
});
|
|
394
399
|
function deriveSubagentSettings(settings) {
|
|
395
400
|
return {
|
|
396
401
|
mode: settings.subagentMode,
|
|
@@ -429,6 +434,12 @@ window.__ModuleLoader__.load({
|
|
|
429
434
|
...settings.titleModel === void 0 ? {} : { model: settings.titleModel }
|
|
430
435
|
};
|
|
431
436
|
}
|
|
437
|
+
function deriveMemorySettings(settings) {
|
|
438
|
+
return {
|
|
439
|
+
...settings.memoryProvider === void 0 ? {} : { provider: settings.memoryProvider },
|
|
440
|
+
...settings.memoryModel === void 0 ? {} : { model: settings.memoryModel }
|
|
441
|
+
};
|
|
442
|
+
}
|
|
432
443
|
/** Whether both fields of a model route form a complete pair; an incomplete pair stays off. */
|
|
433
444
|
function routePairConfigured(route) {
|
|
434
445
|
return route !== void 0 && (route.provider ?? "").trim() !== "" && (route.model ?? "").trim() !== "";
|
|
@@ -661,7 +672,9 @@ window.__ModuleLoader__.load({
|
|
|
661
672
|
"subagentModel",
|
|
662
673
|
"subagentReasoningEffort",
|
|
663
674
|
"titleProvider",
|
|
664
|
-
"titleModel"
|
|
675
|
+
"titleModel",
|
|
676
|
+
"memoryProvider",
|
|
677
|
+
"memoryModel"
|
|
665
678
|
]);
|
|
666
679
|
/** Own data property, so a literal '__proto__' provider id can never touch a prototype. */
|
|
667
680
|
function setKey(target, key, value) {
|
|
@@ -736,7 +749,9 @@ window.__ModuleLoader__.load({
|
|
|
736
749
|
subagentModel: group.subagentModel ?? "",
|
|
737
750
|
subagentReasoningEffort: group.subagentReasoningEffort ?? "",
|
|
738
751
|
titleProvider: group.titleProvider ?? "",
|
|
739
|
-
titleModel: group.titleModel ?? ""
|
|
752
|
+
titleModel: group.titleModel ?? "",
|
|
753
|
+
memoryProvider: group.memoryProvider ?? "",
|
|
754
|
+
memoryModel: group.memoryModel ?? ""
|
|
740
755
|
};
|
|
741
756
|
}
|
|
742
757
|
/**
|
|
@@ -772,6 +787,10 @@ window.__ModuleLoader__.load({
|
|
|
772
787
|
subagent: {
|
|
773
788
|
provider: "subagentProvider",
|
|
774
789
|
model: "subagentModel"
|
|
790
|
+
},
|
|
791
|
+
memory: {
|
|
792
|
+
provider: "memoryProvider",
|
|
793
|
+
model: "memoryModel"
|
|
775
794
|
}
|
|
776
795
|
});
|
|
777
796
|
/** A non-blank string; blank values behave exactly like an absent field. */
|
|
@@ -1071,7 +1090,7 @@ window.__ModuleLoader__.load({
|
|
|
1071
1090
|
}
|
|
1072
1091
|
//#endregion
|
|
1073
1092
|
//#region \0dsh-css:src/client/ModelSwitchSettings.module.css.mjs
|
|
1074
|
-
const css$2 = ".djvrPG_section{max-width:720px;color:var(--dsw-alias-label-primary);flex-direction:column;gap:12px;display:flex;container-type:inline-size}.djvrPG_title{margin:0;font-size:16px;font-weight:500;line-height:24px}.djvrPG_intro{color:var(--dsw-alias-label-tertiary);margin:0;font-size:14px;line-height:22px}.djvrPG_saved{color:var(--dsw-alias-state-success-primary);align-items:center;gap:6px;margin:0;font-size:12px;line-height:18px;display:flex}.djvrPG_savedDot{background:currentColor;border-radius:50%;width:7px;height:7px}.djvrPG_group{flex-direction:column;gap:8px;margin-top:8px;display:flex}.djvrPG_groupLabel{color:var(--dsw-alias-label-tertiary);margin:0 2px;font-size:12px;font-weight:500;line-height:18px}.djvrPG_routeCard{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-module-platform);border-radius:10px;list-style:none;overflow:hidden}.djvrPG_routeCardUnavailable{opacity:.72}.djvrPG_routeHeader{width:100%;min-height:68px;color:inherit;font:inherit;text-align:left;cursor:pointer;background:0 0;border:0;justify-content:space-between;align-items:center;gap:16px;padding:12px 14px;display:flex}.djvrPG_routeHeader:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-2px}.djvrPG_routeHeader:disabled{cursor:default}.djvrPG_routeIcon{width:18px;height:18px;color:var(--dsw-alias-label-primary);flex:none;display:block}.djvrPG_routeCopy{flex-direction:column;flex:1;gap:4px;min-width:0;display:flex}.djvrPG_routeName{color:var(--dsw-alias-label-primary);align-items:center;gap:8px;font-size:14px;font-weight:600;line-height:20px;display:flex}.djvrPG_routeSummary{color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;font-size:13px;line-height:18px;overflow:hidden}.djvrPG_badge{background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-label-secondary);border-radius:999px;flex:none;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px}.djvrPG_badgeWarn{color:var(--dsw-alias-state-warn-label)}.djvrPG_chevron{width:18px;height:18px;color:var(--dsw-alias-label-primary);flex:none;transition:transform .16s}.djvrPG_routeCardOpen .djvrPG_chevron{transform:rotate(180deg)}.djvrPG_cardBody{border-top:1px solid var(--dsw-alias-border-l2);padding:16px 14px 18px}.djvrPG_formGrid{grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px;display:grid}.djvrPG_field{flex-direction:column;gap:6px;min-width:0;display:flex}.djvrPG_fieldFull{grid-column:1/-1}.djvrPG_fieldLabel{color:var(--dsw-alias-label-secondary);font-size:12px;font-weight:500;line-height:18px}.djvrPG_input{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l2);appearance:none;background-color:var(--dsw-alias-bg-layer-1);width:100%;height:32px;color:var(--dsw-alias-label-primary);font:inherit;background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%2381858C' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\");background-position:right 10px center;background-repeat:no-repeat;border-radius:8px;padding:0 32px 0 10px;font-size:14px;line-height:22px}.djvrPG_textInput{background-image:none;padding-right:10px}.djvrPG_input:focus{border-color:var(--dsw-alias-brand-primary);outline:none}.djvrPG_input:disabled{opacity:.6;cursor:default}.djvrPG_hint{color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px;line-height:18px}.djvrPG_warning{color:var(--dsw-alias-state-warn-label)}.djvrPG_message{flex:1;min-width:0}.djvrPG_cardFooter{border-top:1px solid var(--dsw-alias-border-l2);justify-content:flex-end;align-items:center;gap:8px;margin-top:14px;padding:12px 0 0;display:flex}.djvrPG_button{box-sizing:border-box;height:36px;font:inherit;cursor:pointer;border-radius:18px;justify-content:center;align-items:center;padding:0 14px;font-size:14px;line-height:22px;display:inline-flex}.djvrPG_secondaryButton{border:1px solid var(--dsw-alias-border-l2);color:var(--dsw-alias-label-primary);background:0 0}.djvrPG_secondaryButton:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover-solid)}.djvrPG_primaryButton{background:var(--dsw-alias-button-primary-fill);color:var(--dsw-alias-label-primary-foreground);border:0}.djvrPG_primaryButton:hover:not(:disabled){background:var(--dsw-alias-button-primary-hover)}.djvrPG_button:disabled{opacity:.4;cursor:default}.djvrPG_button:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}@container (width<=420px){.djvrPG_formGrid{grid-template-columns:1fr}.djvrPG_cardFooter .djvrPG_button{flex:1}}.djvrPG_routeHeaderRow{align-items:center;gap:8px;padding-right:14px;display:flex}.djvrPG_routeHeaderRow .djvrPG_routeHeader{flex:1;min-width:0}.djvrPG_rowCard{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-module-platform);border-radius:10px;align-items:flex-start;gap:16px;padding:14px 16px;display:flex}.djvrPG_rowCopy{flex:1;gap:4px;min-width:0;display:grid}.djvrPG_rowTitle{color:var(--dsw-alias-label-primary);font-size:14px;font-weight:600;line-height:20px}.djvrPG_switch{background:var(--dsw-alias-bg-layer-1);width:40px;height:24px;box-shadow:inset 0 0 0 1px var(--dsw-alias-border-l2);cursor:pointer;border:0;border-radius:999px;flex:none;padding:0;position:relative}.djvrPG_switchOn{background:var(--dsw-alias-button-primary-fill);box-shadow:none}.djvrPG_switch i{background:var(--dsw-alias-label-primary-foreground);pointer-events:none;border-radius:50%;width:18px;height:18px;transition:left .16s;position:absolute;top:3px;left:3px}.djvrPG_switchOn i{left:19px}.djvrPG_switch:disabled{opacity:.4;cursor:default}.djvrPG_switch:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}@media (prefers-reduced-motion:reduce){.djvrPG_chevron,.djvrPG_switch i{transition:none}}.djvrPG_allowToolbar{flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:10px;display:flex}.djvrPG_allowToolbar .djvrPG_input{flex:220px;width:auto;padding-right:10px}.djvrPG_allowList{flex-direction:column;gap:6px;margin:0 0 12px;padding:0;list-style:none;display:flex}.djvrPG_allowRow{border:1px solid var(--dsw-alias-border-l2);background-color:var(--dsw-alias-bg-layer-1);border-radius:8px;align-items:center;gap:10px;padding:6px 10px;display:flex}.djvrPG_allowLabel{cursor:default;flex:auto;align-items:center;gap:8px;min-width:0;display:flex}.djvrPG_allowLabel input{width:14px;height:14px;accent-color:var(--dsw-alias-brand-primary);flex:none}.djvrPG_allowName{color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;font-size:12px;line-height:18px;overflow:hidden}.djvrPG_allowSource{color:var(--dsw-alias-label-secondary);flex:none;align-items:center;gap:4px;font-size:12px;line-height:18px;display:flex}.djvrPG_allowDot{opacity:.6}.djvrPG_allowRepo{color:var(--dsw-alias-brand-primary);text-decoration:none}.djvrPG_allowRepo:hover{text-decoration:underline}";
|
|
1093
|
+
const css$2 = ".djvrPG_section{max-width:720px;color:var(--dsw-alias-label-primary);flex-direction:column;gap:12px;display:flex;container-type:inline-size}.djvrPG_title{margin:0;font-size:16px;font-weight:500;line-height:24px}.djvrPG_intro{color:var(--dsw-alias-label-tertiary);margin:0;font-size:14px;line-height:22px}.djvrPG_saved{color:var(--dsw-alias-state-success-primary);align-items:center;gap:6px;margin:0;font-size:12px;line-height:18px;display:flex}.djvrPG_savedDot{background:currentColor;border-radius:50%;width:7px;height:7px}.djvrPG_group{flex-direction:column;gap:8px;margin-top:8px;display:flex}.djvrPG_groupLabel{color:var(--dsw-alias-label-tertiary);margin:0 2px;font-size:12px;font-weight:500;line-height:18px}.djvrPG_routeCard{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-module-platform);border-radius:10px;list-style:none;overflow:hidden}.djvrPG_routeCardUnavailable{opacity:.72}.djvrPG_routeHeader{width:100%;min-height:68px;color:inherit;font:inherit;text-align:left;cursor:pointer;background:0 0;border:0;justify-content:space-between;align-items:center;gap:16px;padding:12px 14px;display:flex}.djvrPG_routeHeader:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-2px}.djvrPG_routeHeader:disabled{cursor:default}.djvrPG_routeIcon{width:18px;height:18px;color:var(--dsw-alias-label-primary);flex:none;display:block}.djvrPG_routeCopy{flex-direction:column;flex:1;gap:4px;min-width:0;display:flex}.djvrPG_routeName{color:var(--dsw-alias-label-primary);align-items:center;gap:8px;font-size:14px;font-weight:600;line-height:20px;display:flex}.djvrPG_routeSummary{color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;font-size:13px;line-height:18px;overflow:hidden}.djvrPG_badge{background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-label-secondary);border-radius:999px;flex:none;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px}.djvrPG_badgeWarn{color:var(--dsw-alias-state-warn-label)}.djvrPG_chevron{width:18px;height:18px;color:var(--dsw-alias-label-primary);flex:none;transition:transform .16s}.djvrPG_routeCardOpen .djvrPG_chevron{transform:rotate(180deg)}.djvrPG_cardBody{border-top:1px solid var(--dsw-alias-border-l2);padding:16px 14px 18px}.djvrPG_formGrid{grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px;display:grid}.djvrPG_field{flex-direction:column;gap:6px;min-width:0;display:flex}.djvrPG_fieldFull{grid-column:1/-1}.djvrPG_fieldLabel{color:var(--dsw-alias-label-secondary);font-size:12px;font-weight:500;line-height:18px}.djvrPG_input{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l2);appearance:none;background-color:var(--dsw-alias-bg-layer-1);width:100%;height:32px;color:var(--dsw-alias-label-primary);font:inherit;background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%2381858C' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\");background-position:right 10px center;background-repeat:no-repeat;border-radius:8px;padding:0 32px 0 10px;font-size:14px;line-height:22px}.djvrPG_textInput{background-image:none;padding-right:10px}.djvrPG_input:focus{border-color:var(--dsw-alias-brand-primary);outline:none}.djvrPG_input:disabled{opacity:.6;cursor:default}.djvrPG_hint{color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px;line-height:18px}.djvrPG_warning{color:var(--dsw-alias-state-warn-label)}.djvrPG_message{flex:1;min-width:0}.djvrPG_cardFooter{border-top:1px solid var(--dsw-alias-border-l2);justify-content:flex-end;align-items:center;gap:8px;margin-top:14px;padding:12px 0 0;display:flex}.djvrPG_button{box-sizing:border-box;height:36px;font:inherit;cursor:pointer;border-radius:18px;justify-content:center;align-items:center;padding:0 14px;font-size:14px;line-height:22px;display:inline-flex}.djvrPG_secondaryButton{border:1px solid var(--dsw-alias-border-l2);color:var(--dsw-alias-label-primary);background:0 0}.djvrPG_secondaryButton:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover-solid)}.djvrPG_primaryButton{background:var(--dsw-alias-button-primary-fill);color:var(--dsw-alias-label-primary-foreground);border:0}.djvrPG_primaryButton:hover:not(:disabled){background:var(--dsw-alias-button-primary-hover)}.djvrPG_button:disabled{opacity:.4;cursor:default}.djvrPG_button:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}@container (width<=420px){.djvrPG_formGrid{grid-template-columns:1fr}.djvrPG_cardFooter .djvrPG_button{flex:1}}.djvrPG_routeHeaderRow{align-items:center;gap:8px;padding-right:14px;display:flex}.djvrPG_routeHeaderRow .djvrPG_routeHeader{flex:1;min-width:0}.djvrPG_rowCard{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-module-platform);border-radius:10px;align-items:flex-start;gap:16px;padding:14px 16px;display:flex}.djvrPG_rowCard:has(+.djvrPG_formGrid){border-bottom-color:#0000;border-bottom-right-radius:0;border-bottom-left-radius:0}.djvrPG_rowCard:has(+.djvrPG_formGrid) .djvrPG_hint{display:none}.djvrPG_rowCard+.djvrPG_formGrid{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-module-platform);border-top:0;border-bottom-right-radius:10px;border-bottom-left-radius:10px;margin-top:-1px;padding:0 16px 14px}.djvrPG_formGrid+.djvrPG_rowCard{margin-top:14px}.djvrPG_rowCopy{flex:1;gap:4px;min-width:0;display:grid}.djvrPG_rowTitle{color:var(--dsw-alias-label-primary);font-size:14px;font-weight:600;line-height:20px}.djvrPG_switch{background:var(--dsw-alias-bg-layer-1);width:40px;height:24px;box-shadow:inset 0 0 0 1px var(--dsw-alias-border-l2);cursor:pointer;border:0;border-radius:999px;flex:none;padding:0;position:relative}.djvrPG_switchOn{background:var(--dsw-alias-button-primary-fill);box-shadow:none}.djvrPG_switch i{background:var(--dsw-alias-label-primary-foreground);pointer-events:none;border-radius:50%;width:18px;height:18px;transition:left .16s;position:absolute;top:3px;left:3px}.djvrPG_switchOn i{left:19px}.djvrPG_switch:disabled{opacity:.4;cursor:default}.djvrPG_switch:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}@media (prefers-reduced-motion:reduce){.djvrPG_chevron,.djvrPG_switch i{transition:none}}.djvrPG_allowToolbar{flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:10px;display:flex}.djvrPG_allowToolbar .djvrPG_input{flex:220px;width:auto;padding-right:10px}.djvrPG_allowList{flex-direction:column;gap:6px;margin:0 0 12px;padding:0;list-style:none;display:flex}.djvrPG_allowRow{border:1px solid var(--dsw-alias-border-l2);background-color:var(--dsw-alias-bg-layer-1);border-radius:8px;align-items:center;gap:10px;padding:6px 10px;display:flex}.djvrPG_allowLabel{cursor:default;flex:auto;align-items:center;gap:8px;min-width:0;display:flex}.djvrPG_allowLabel input{width:14px;height:14px;accent-color:var(--dsw-alias-brand-primary);flex:none}.djvrPG_allowName{color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;font-size:12px;line-height:18px;overflow:hidden}.djvrPG_allowSource{color:var(--dsw-alias-label-secondary);flex:none;align-items:center;gap:4px;font-size:12px;line-height:18px;display:flex}.djvrPG_allowDot{opacity:.6}.djvrPG_allowRepo{color:var(--dsw-alias-brand-primary);text-decoration:none}.djvrPG_allowRepo:hover{text-decoration:underline}";
|
|
1075
1094
|
const tagId$2 = "dsh-model-switch/ModelSwitchSettings.module.css";
|
|
1076
1095
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$2) + "]") === null) {
|
|
1077
1096
|
const tag = document.createElement("style");
|
|
@@ -1303,6 +1322,22 @@ window.__ModuleLoader__.load({
|
|
|
1303
1322
|
stroke: "currentColor"
|
|
1304
1323
|
})]
|
|
1305
1324
|
});
|
|
1325
|
+
if (kind === "memory") return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
1326
|
+
width: "18",
|
|
1327
|
+
height: "18",
|
|
1328
|
+
viewBox: "0 0 18 18",
|
|
1329
|
+
fill: "none",
|
|
1330
|
+
"aria-hidden": "true",
|
|
1331
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
1332
|
+
d: "M4.5 3.5h9v11h-9z",
|
|
1333
|
+
stroke: "currentColor",
|
|
1334
|
+
strokeLinejoin: "round"
|
|
1335
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
1336
|
+
d: "M7 6.5h4M7 9h4M7 11.5h2.5",
|
|
1337
|
+
stroke: "currentColor",
|
|
1338
|
+
strokeLinecap: "round"
|
|
1339
|
+
})]
|
|
1340
|
+
});
|
|
1306
1341
|
return null;
|
|
1307
1342
|
}
|
|
1308
1343
|
function RouteCard({ title, summary, hint, note, icon, open, onToggle, disabled = false, badge, badgeWarn = false, trailing, expandable = true, children }) {
|
|
@@ -1515,6 +1550,7 @@ window.__ModuleLoader__.load({
|
|
|
1515
1550
|
const autoReview = props.useAutoReviewSettings((value) => value);
|
|
1516
1551
|
const compaction = props.useCompactionSettings((value) => value);
|
|
1517
1552
|
const sessionTitle = props.useTitleSettings((value) => value);
|
|
1553
|
+
const memory = props.useMemorySettings((value) => value);
|
|
1518
1554
|
const switchSettings = props.useSwitchSettings((value) => value);
|
|
1519
1555
|
const [open, setOpen] = (0, react.useState)();
|
|
1520
1556
|
const [subagentDraft, setSubagentDraft, resetSubagent] = useDraft(subagent);
|
|
@@ -1523,6 +1559,7 @@ window.__ModuleLoader__.load({
|
|
|
1523
1559
|
const [autoReviewDraft, setAutoReviewDraft, resetAutoReview] = useDraft(autoReview);
|
|
1524
1560
|
const [compactionDraft, setCompactionDraft, resetCompaction] = useDraft(compaction);
|
|
1525
1561
|
const [titleDraft, setTitleDraft, resetTitle] = useDraft(sessionTitle);
|
|
1562
|
+
const [memoryDraft, setMemoryDraft, resetMemory] = useDraft(memory);
|
|
1526
1563
|
const [busy, setBusy] = (0, react.useState)();
|
|
1527
1564
|
const [message, setMessage] = (0, react.useState)();
|
|
1528
1565
|
const [groupProvider, setGroupProvider] = (0, react.useState)("");
|
|
@@ -1574,6 +1611,7 @@ window.__ModuleLoader__.load({
|
|
|
1574
1611
|
autoReview: capabilityGroupPins(providerGroups, "autoReview"),
|
|
1575
1612
|
compaction: capabilityGroupPins(providerGroups, "compaction"),
|
|
1576
1613
|
title: capabilityGroupPins(providerGroups, "title"),
|
|
1614
|
+
memory: capabilityGroupPins(providerGroups, "memory"),
|
|
1577
1615
|
subagent: capabilityGroupPins(providerGroups, "subagent")
|
|
1578
1616
|
};
|
|
1579
1617
|
/**
|
|
@@ -1705,6 +1743,7 @@ window.__ModuleLoader__.load({
|
|
|
1705
1743
|
const compactionChoices = deriveRouteChoices(groups, compactionDraft);
|
|
1706
1744
|
const compactionOn = routePairConfigured(compaction.value);
|
|
1707
1745
|
const titleChoices = deriveRouteChoices(groups, titleDraft);
|
|
1746
|
+
const memoryChoices = deriveRouteChoices(groups, memoryDraft);
|
|
1708
1747
|
const titleOn = routePairConfigured(sessionTitle.value);
|
|
1709
1748
|
const catalogSeed = firstCatalogRoute(groups);
|
|
1710
1749
|
const synced = [
|
|
@@ -1986,10 +2025,12 @@ window.__ModuleLoader__.load({
|
|
|
1986
2025
|
const groupCompaction = groupDraft === void 0 ? void 0 : draftPair(groupDraft.compactProvider, groupDraft.compactModel);
|
|
1987
2026
|
const groupAutoReview = groupDraft === void 0 ? void 0 : draftPair(groupDraft.autoReviewProvider, groupDraft.autoReviewModel);
|
|
1988
2027
|
const groupTitle = groupDraft === void 0 ? void 0 : draftPair(groupDraft.titleProvider, groupDraft.titleModel);
|
|
2028
|
+
const groupMemory = groupDraft === void 0 ? void 0 : draftPair(groupDraft.memoryProvider, groupDraft.memoryModel);
|
|
1989
2029
|
const groupSubagent = groupDraft === void 0 ? void 0 : draftPair(groupDraft.subagentProvider, groupDraft.subagentModel);
|
|
1990
2030
|
const groupCompactionChoices = deriveRouteChoices(groups, groupCompaction);
|
|
1991
2031
|
const groupAutoReviewChoices = deriveRouteChoices(groups, groupAutoReview);
|
|
1992
2032
|
const groupTitleChoices = deriveRouteChoices(groups, groupTitle);
|
|
2033
|
+
const groupMemoryChoices = deriveRouteChoices(groups, groupMemory);
|
|
1993
2034
|
const groupSubagentChoices = deriveRouteChoices(groups, groupSubagent);
|
|
1994
2035
|
const groupSubMatched = matchCatalogModel(groups.find((group) => group.id === (groupDraft?.subagentProvider ?? ""))?.models ?? [], groupDraft?.subagentModel ?? "");
|
|
1995
2036
|
const groupSubEfforts = (() => {
|
|
@@ -2042,6 +2083,16 @@ window.__ModuleLoader__.load({
|
|
|
2042
2083
|
titleModel: model
|
|
2043
2084
|
};
|
|
2044
2085
|
}
|
|
2086
|
+
if (kind === "memory") {
|
|
2087
|
+
const provider = active.memoryProvider ?? catalogSeed?.provider;
|
|
2088
|
+
const model = active.memoryModel ?? catalogSeed?.model;
|
|
2089
|
+
if (provider === void 0 || model === void 0) return draft;
|
|
2090
|
+
return {
|
|
2091
|
+
...draft,
|
|
2092
|
+
memoryProvider: provider,
|
|
2093
|
+
memoryModel: model
|
|
2094
|
+
};
|
|
2095
|
+
}
|
|
2045
2096
|
const provider = active.subagentProvider ?? catalogSeed?.provider;
|
|
2046
2097
|
const model = active.subagentModel ?? catalogSeed?.model;
|
|
2047
2098
|
if (provider === void 0 || model === void 0) return draft;
|
|
@@ -2072,6 +2123,11 @@ window.__ModuleLoader__.load({
|
|
|
2072
2123
|
titleProvider: "",
|
|
2073
2124
|
titleModel: ""
|
|
2074
2125
|
};
|
|
2126
|
+
if (kind === "memory") return {
|
|
2127
|
+
...draft,
|
|
2128
|
+
memoryProvider: "",
|
|
2129
|
+
memoryModel: ""
|
|
2130
|
+
};
|
|
2075
2131
|
return {
|
|
2076
2132
|
...draft,
|
|
2077
2133
|
subagentProvider: "",
|
|
@@ -2540,6 +2596,66 @@ window.__ModuleLoader__.load({
|
|
|
2540
2596
|
onSave: saveTitle
|
|
2541
2597
|
})
|
|
2542
2598
|
] })
|
|
2599
|
+
}),
|
|
2600
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(RouteCard, {
|
|
2601
|
+
title: props.t("memory"),
|
|
2602
|
+
summary: memoryDraft === void 0 ? props.t("loading") : routePairConfigured(memoryDraft) ? routeName(groups, memoryDraft) : props.t("memoryFollow"),
|
|
2603
|
+
hint: props.t("memoryHelp"),
|
|
2604
|
+
note: groupNote(props.t, groupPins.memory),
|
|
2605
|
+
icon: "memory",
|
|
2606
|
+
open: open === "memory",
|
|
2607
|
+
onToggle: () => {
|
|
2608
|
+
toggle("memory");
|
|
2609
|
+
},
|
|
2610
|
+
children: memoryDraft === void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2611
|
+
className: ModelSwitchSettings_module_css_default.hint,
|
|
2612
|
+
children: props.t("loading")
|
|
2613
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
2614
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2615
|
+
className: ModelSwitchSettings_module_css_default.hint,
|
|
2616
|
+
children: props.t("memoryRouteHelp")
|
|
2617
|
+
}),
|
|
2618
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2619
|
+
className: ModelSwitchSettings_module_css_default.formGrid,
|
|
2620
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
|
|
2621
|
+
label: props.t("provider"),
|
|
2622
|
+
value: memoryDraft.provider ?? "",
|
|
2623
|
+
disabled: busy !== void 0 || !memory.writable,
|
|
2624
|
+
choices: memoryChoices.providers,
|
|
2625
|
+
onChange: (provider) => {
|
|
2626
|
+
const first = groups.find((group) => group.id === provider)?.models[0];
|
|
2627
|
+
setMemoryDraft({
|
|
2628
|
+
provider,
|
|
2629
|
+
...first === void 0 ? {} : { model: first.id }
|
|
2630
|
+
});
|
|
2631
|
+
}
|
|
2632
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
|
|
2633
|
+
label: props.t("model"),
|
|
2634
|
+
value: memoryDraft.model ?? "",
|
|
2635
|
+
disabled: busy !== void 0 || !memory.writable,
|
|
2636
|
+
choices: memoryChoices.models,
|
|
2637
|
+
onChange: (model) => {
|
|
2638
|
+
setMemoryDraft({
|
|
2639
|
+
...memoryDraft,
|
|
2640
|
+
model
|
|
2641
|
+
});
|
|
2642
|
+
}
|
|
2643
|
+
})]
|
|
2644
|
+
}),
|
|
2645
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Actions, {
|
|
2646
|
+
t: props.t,
|
|
2647
|
+
busy: busy === "memory",
|
|
2648
|
+
disabled: busy !== void 0 || !memory.writable,
|
|
2649
|
+
...message?.route === "memory" ? { message: message.text } : {},
|
|
2650
|
+
onCancel: () => {
|
|
2651
|
+
resetMemory();
|
|
2652
|
+
setMessage(void 0);
|
|
2653
|
+
},
|
|
2654
|
+
onSave: () => {
|
|
2655
|
+
run("memory", () => props.saveCapability("memory", pairOps(memoryDraft)));
|
|
2656
|
+
}
|
|
2657
|
+
})
|
|
2658
|
+
] })
|
|
2543
2659
|
})
|
|
2544
2660
|
]
|
|
2545
2661
|
}),
|
|
@@ -2896,6 +3012,55 @@ window.__ModuleLoader__.load({
|
|
|
2896
3012
|
}
|
|
2897
3013
|
})]
|
|
2898
3014
|
}),
|
|
3015
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3016
|
+
className: ModelSwitchSettings_module_css_default.rowCard,
|
|
3017
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3018
|
+
className: ModelSwitchSettings_module_css_default.rowCopy,
|
|
3019
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3020
|
+
className: ModelSwitchSettings_module_css_default.rowTitle,
|
|
3021
|
+
children: props.t("memory")
|
|
3022
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
3023
|
+
className: ModelSwitchSettings_module_css_default.hint,
|
|
3024
|
+
children: groupMemory === void 0 ? props.t("memoryFollow") : routeName(groups, groupMemory)
|
|
3025
|
+
})]
|
|
3026
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InstantSwitch, {
|
|
3027
|
+
checked: groupMemory !== void 0,
|
|
3028
|
+
disabled: groupControlsDisabled || groupMemory === void 0 && catalogSeed === void 0,
|
|
3029
|
+
label: props.t("memory"),
|
|
3030
|
+
onChange: (value) => {
|
|
3031
|
+
if (value) enableGroupCapability("memory");
|
|
3032
|
+
else disableGroupCapability("memory");
|
|
3033
|
+
}
|
|
3034
|
+
})]
|
|
3035
|
+
}),
|
|
3036
|
+
groupMemory === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3037
|
+
className: ModelSwitchSettings_module_css_default.formGrid,
|
|
3038
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
|
|
3039
|
+
label: props.t("provider"),
|
|
3040
|
+
value: groupMemory.provider,
|
|
3041
|
+
disabled: groupControlsDisabled,
|
|
3042
|
+
choices: groupMemoryChoices.providers,
|
|
3043
|
+
onChange: (provider) => {
|
|
3044
|
+
const first = groups.find((item) => item.id === provider)?.models[0];
|
|
3045
|
+
setGroupDraft((draft) => draft === void 0 ? draft : {
|
|
3046
|
+
...draft,
|
|
3047
|
+
memoryProvider: provider,
|
|
3048
|
+
memoryModel: first?.id ?? ""
|
|
3049
|
+
});
|
|
3050
|
+
}
|
|
3051
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
|
|
3052
|
+
label: props.t("model"),
|
|
3053
|
+
value: groupMemory.model,
|
|
3054
|
+
disabled: groupControlsDisabled,
|
|
3055
|
+
choices: groupMemoryChoices.models,
|
|
3056
|
+
onChange: (model) => {
|
|
3057
|
+
setGroupDraft((draft) => draft === void 0 ? draft : {
|
|
3058
|
+
...draft,
|
|
3059
|
+
memoryModel: model
|
|
3060
|
+
});
|
|
3061
|
+
}
|
|
3062
|
+
})]
|
|
3063
|
+
}),
|
|
2899
3064
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2900
3065
|
className: ModelSwitchSettings_module_css_default.rowCard,
|
|
2901
3066
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -3036,11 +3201,15 @@ window.__ModuleLoader__.load({
|
|
|
3036
3201
|
titleFollow: "跟随会话模型",
|
|
3037
3202
|
titleHelp: "为官方自动命名(新会话首条消息后生成标题)指定模型;关闭(两个字段都留空)时命名跟随当前会话模型。",
|
|
3038
3203
|
titleRouteHelp: "命名请求固定使用这里的 Provider/模型(不带推理强度);关闭时跟随会话模型。保存后立即对下一次命名生效,不会中断正在进行的命名,会话日志记录的也是实际使用的模型。",
|
|
3204
|
+
memory: "记忆蒸馏模型",
|
|
3205
|
+
memoryFollow: "跟随记忆插件默认",
|
|
3206
|
+
memoryHelp: "为 dsh-prime-memory 的记忆蒸馏指定路由;两个字段都留空时跟随该插件自己的默认模型。",
|
|
3207
|
+
memoryRouteHelp: "按部署默认供应商的配置组解析;该供应商没有组时使用这里填写的平面默认。只改它的内存配置,不写入它的设置。",
|
|
3039
3208
|
providerGroups: "供应商配置组",
|
|
3040
3209
|
providerGroupsCard: "按供应商预设路由",
|
|
3041
3210
|
providerGroupsSummary: "使用该供应商的会话自动采用对应组",
|
|
3042
|
-
providerGroupsHelp: "
|
|
3043
|
-
providerGroupsBodyHelp: "
|
|
3211
|
+
providerGroupsHelp: "为压缩、自动审查、会话命名、记忆蒸馏与子代理按供应商分别保存路由。",
|
|
3212
|
+
providerGroupsBodyHelp: "每个供应商保存一组压缩、自动审查、会话命名与子代理路由。会话自身的供应商与该组一致时,这五项能力(含记忆蒸馏)按组实时解析,未固定项回落到上方卡片里的全局设置。切换某个会话的模型不会写入任何全局设置,因此不同供应商的多个会话并行时互不影响,会话中切换供应商后下一次调用也会立即跟随新供应商的配置组。",
|
|
3044
3213
|
providerGroupPick: "选择供应商以编辑其配置组。",
|
|
3045
3214
|
providerGroupDelete: "删除该组",
|
|
3046
3215
|
groupOverridesLabel: "组覆盖:{pins};无组时用上方默认值",
|
|
@@ -3119,11 +3288,15 @@ window.__ModuleLoader__.load({
|
|
|
3119
3288
|
titleFollow: "Follows the session model",
|
|
3120
3289
|
titleHelp: "Pick the model used to name new sessions automatically (right after the first prompt). When off (both fields empty), naming follows the session model.",
|
|
3121
3290
|
titleRouteHelp: "Naming requests use exactly this provider/model (no reasoning effort); when off they follow the session model. A saved change applies to the very next title, never interrupts a running one, and the session log records the route actually used.",
|
|
3291
|
+
memory: "Memory distillation model",
|
|
3292
|
+
memoryFollow: "Follows the memory plugin default",
|
|
3293
|
+
memoryHelp: "Pin the distillation route for dsh-prime-memory. Both fields empty keeps that plugin on its own default model.",
|
|
3294
|
+
memoryRouteHelp: "Resolved from the deployment default provider group; without a group the flat pair here applies. Applied in memory only, never written into that plugin settings.",
|
|
3122
3295
|
providerGroups: "Provider groups",
|
|
3123
3296
|
providerGroupsCard: "Per-provider route presets",
|
|
3124
3297
|
providerGroupsSummary: "Sessions using that provider adopt this group",
|
|
3125
|
-
providerGroupsHelp: "Save compaction, auto-review, session-naming, and subagent routes per provider.",
|
|
3126
|
-
providerGroupsBodyHelp: "Each provider stores one route group for compaction, auto review, session naming, and subagents. A session running on that provider resolves all
|
|
3298
|
+
providerGroupsHelp: "Save compaction, auto-review, session-naming, memory distillation, and subagent routes per provider.",
|
|
3299
|
+
providerGroupsBodyHelp: "Each provider stores one route group for compaction, auto review, session naming, and subagents. A session running on that provider resolves all five capabilities (memory distillation included) from the group and falls back to the cards above when a row is off. Switching a session’s model writes no global setting, so parallel sessions on different providers never affect each other, and mid-session provider switches take effect on the very next call.",
|
|
3127
3300
|
providerGroupPick: "Pick a provider to edit its group.",
|
|
3128
3301
|
providerGroupDelete: "Delete group",
|
|
3129
3302
|
groupOverridesLabel: "Group overrides: {pins}; without a group the default above applies",
|
|
@@ -4839,7 +5012,7 @@ window.__ModuleLoader__.load({
|
|
|
4839
5012
|
};
|
|
4840
5013
|
//#endregion
|
|
4841
5014
|
//#region \0dsh-css:src/client/picker/PlanReviewCard.module.css.mjs
|
|
4842
|
-
const css = ".BylfoW_frame{padding:6px calc(var(--dsh-composer-side-clearance) + 16px) 10px;justify-content:center;display:flex}.BylfoW_card{width:100%;max-width:var(--dsh-chat-content-width);border:1px solid var(--dsw-alias-state-warn-secondary);background:var(--dsw-specific-input-major);max-height:min(60vh,520px);box-shadow:var(--dsw-shadow-lv2);color:var(--dsw-alias-label-primary);--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2);border-radius:20px;flex-direction:column;display:flex;overflow:visible}.BylfoW_card,.BylfoW_card *{box-sizing:border-box}.BylfoW_strip{background:var(--dsw-alias-state-warn-tertiary);color:var(--dsw-alias-state-warn-primary);border-radius:20px 20px 0 0;flex-shrink:0;align-items:center;gap:8px;padding:10px 16px;font-size:13px;line-height:18px;display:flex}.BylfoW_dot{background:var(--dsw-alias-state-warn-primary);border-radius:50%;width:8px;height:8px}.BylfoW_stripTitle{flex:none;font-weight:600}.BylfoW_previewLink{color:inherit;font:inherit;cursor:pointer;opacity:.85;background:0 0;border:0;flex:none;align-items:center;gap:4px;padding:0;display:inline-flex}.BylfoW_previewLink:hover{opacity:1;text-decoration:underline}.BylfoW_previewLink:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:3px}.BylfoW_headerPicker{flex:0 auto;align-items:center;min-width:0;max-width:55%;margin-left:auto;display:flex}.BylfoW_headerPicker>*{min-width:0;max-width:100%}.BylfoW_body{overscroll-behavior:contain;flex:auto;min-height:0;padding:12px 16px 4px;font-size:14px;line-height:22px;overflow-y:auto}.BylfoW_summary{min-width:0}.BylfoW_summaryTitle{text-overflow:ellipsis;white-space:nowrap;margin:0;font-size:15px;font-weight:500;line-height:22px;overflow:hidden}.BylfoW_summaryText{-webkit-line-clamp:2;color:var(--dsw-alias-label-secondary);-webkit-box-orient:vertical;margin:8px 0 0;font-size:14px;line-height:24px;display:-webkit-box;overflow:hidden}.BylfoW_footer{z-index:2;flex-direction:column;flex-shrink:0;gap:6px;padding:8px 16px 12px;display:flex;position:relative;overflow:visible}.BylfoW_feedback{min-height:0;color:var(--dsw-alias-state-error-primary);font-size:11px;line-height:16px}.BylfoW_feedback:empty{display:none}.BylfoW_feedbackRow{align-items:center;gap:8px;min-width:0;display:flex}.BylfoW_feedbackInput{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-specific-input-minor);min-width:0;height:32px;color:var(--dsw-alias-label-primary);font:var(--dsw-font-xs-13);border-radius:8px;flex:auto;padding:0 10px}.BylfoW_feedbackInput::placeholder{color:var(--dsw-alias-label-tertiary)}.BylfoW_feedbackInput:disabled{opacity:.6}.BylfoW_bar{flex-wrap:nowrap;justify-content:space-between;align-items:center;gap:12px;min-width:0;min-height:32px;display:flex}.BylfoW_picker{flex:16rem;min-width:0;max-width:16rem}.BylfoW_pickerError{color:var(--dsw-alias-state-error-primary);overflow-wrap:anywhere;flex-wrap:wrap;align-items:center;gap:6px;font-size:12px;display:flex}.BylfoW_actions{flex-wrap:
|
|
5015
|
+
const css = ".BylfoW_frame{padding:6px calc(var(--dsh-composer-side-clearance) + 16px) 10px;justify-content:center;display:flex}.BylfoW_card{width:100%;max-width:var(--dsh-chat-content-width);border:1px solid var(--dsw-alias-state-warn-secondary);background:var(--dsw-specific-input-major);max-height:min(60vh,520px);box-shadow:var(--dsw-shadow-lv2);color:var(--dsw-alias-label-primary);--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2);border-radius:20px;flex-direction:column;display:flex;overflow:visible}.BylfoW_card,.BylfoW_card *{box-sizing:border-box}.BylfoW_strip{background:var(--dsw-alias-state-warn-tertiary);color:var(--dsw-alias-state-warn-primary);border-radius:20px 20px 0 0;flex-shrink:0;align-items:center;gap:8px;padding:10px 16px;font-size:13px;line-height:18px;display:flex}.BylfoW_dot{background:var(--dsw-alias-state-warn-primary);border-radius:50%;width:8px;height:8px}.BylfoW_stripTitle{flex:none;font-weight:600}.BylfoW_previewLink{color:inherit;font:inherit;cursor:pointer;opacity:.85;background:0 0;border:0;flex:none;align-items:center;gap:4px;padding:0;display:inline-flex}.BylfoW_previewLink:hover{opacity:1;text-decoration:underline}.BylfoW_previewLink:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:3px}.BylfoW_headerPicker{flex:0 auto;align-items:center;min-width:0;max-width:55%;margin-left:auto;display:flex}.BylfoW_headerPicker>*{min-width:0;max-width:100%}.BylfoW_body{overscroll-behavior:contain;flex:auto;min-height:0;padding:12px 16px 4px;font-size:14px;line-height:22px;overflow-y:auto}.BylfoW_summary{min-width:0}.BylfoW_summaryTitle{text-overflow:ellipsis;white-space:nowrap;margin:0;font-size:15px;font-weight:500;line-height:22px;overflow:hidden}.BylfoW_summaryText{-webkit-line-clamp:2;color:var(--dsw-alias-label-secondary);-webkit-box-orient:vertical;margin:8px 0 0;font-size:14px;line-height:24px;display:-webkit-box;overflow:hidden}.BylfoW_footer{z-index:2;flex-direction:column;flex-shrink:0;gap:6px;padding:8px 16px 12px;display:flex;position:relative;overflow:visible}.BylfoW_feedback{min-height:0;color:var(--dsw-alias-state-error-primary);font-size:11px;line-height:16px}.BylfoW_feedback:empty{display:none}.BylfoW_feedbackRow{align-items:center;gap:8px;min-width:0;display:flex}.BylfoW_feedbackInput{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-specific-input-minor);min-width:0;height:32px;color:var(--dsw-alias-label-primary);font:var(--dsw-font-xs-13);border-radius:8px;flex:auto;padding:0 10px}.BylfoW_feedbackInput::placeholder{color:var(--dsw-alias-label-tertiary)}.BylfoW_feedbackInput:disabled{opacity:.6}.BylfoW_bar{flex-wrap:nowrap;justify-content:space-between;align-items:center;gap:12px;min-width:0;min-height:32px;display:flex}.BylfoW_picker{flex:16rem;min-width:0;max-width:16rem}.BylfoW_pickerError{color:var(--dsw-alias-state-error-primary);overflow-wrap:anywhere;flex-wrap:wrap;align-items:center;gap:6px;font-size:12px;display:flex}.BylfoW_actions{flex-wrap:wrap;flex:0 auto;justify-content:flex-end;align-items:center;gap:8px;min-width:0;margin-left:auto;display:flex}.BylfoW_discuss,.BylfoW_keep,.BylfoW_goalRun,.BylfoW_approve,.BylfoW_recover{white-space:nowrap;flex:0 auto;min-width:0;height:32px;min-height:32px;padding:0 10px}.BylfoW_discuss,.BylfoW_recover{color:var(--dsw-alias-label-secondary)}.BylfoW_discuss:hover:not(:disabled),.BylfoW_recover:hover:not(:disabled){color:var(--dsw-alias-label-primary)}.BylfoW_approve{flex-shrink:0;padding:0 12px}@media (width<=720px){.BylfoW_frame{padding-right:max(10px, env(safe-area-inset-right));padding-bottom:max(10px, env(safe-area-inset-bottom));padding-left:max(10px, env(safe-area-inset-left))}.BylfoW_card{border-radius:16px}.BylfoW_strip,.BylfoW_body,.BylfoW_footer{padding-left:12px;padding-right:12px}.BylfoW_strip{flex-wrap:wrap;gap:6px}.BylfoW_headerPicker{flex:100%;max-width:100%;margin-left:0}.BylfoW_bar{justify-content:flex-end;gap:6px}.BylfoW_actions{flex:100%;justify-content:flex-end;gap:6px;min-width:0}.BylfoW_discuss,.BylfoW_keep,.BylfoW_goalRun,.BylfoW_approve,.BylfoW_recover{overflow-wrap:anywhere;white-space:normal;flex:1 1 0;min-width:0;height:auto;padding:4px;line-height:14px}.BylfoW_feedbackInput{height:auto;min-height:32px}}";
|
|
4843
5016
|
const tagId = "dsh-model-switch/PlanReviewCard.module.css";
|
|
4844
5017
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
|
|
4845
5018
|
const tag = document.createElement("style");
|
|
@@ -5729,6 +5902,7 @@ window.__ModuleLoader__.load({
|
|
|
5729
5902
|
const autoReview = deriveConfigForm(owned, deriveAutoReviewSettings, AUTO_REVIEW_SETTINGS_FIELDS);
|
|
5730
5903
|
const compaction = deriveConfigForm(owned, deriveCompactionSettings, COMPACTION_SETTINGS_FIELDS);
|
|
5731
5904
|
const sessionTitle = deriveConfigForm(owned, deriveTitleSettings, TITLE_SETTINGS_FIELDS);
|
|
5905
|
+
const memory = deriveConfigForm(owned, deriveMemorySettings, MEMORY_SETTINGS_FIELDS);
|
|
5732
5906
|
const connectionRpc = (() => {
|
|
5733
5907
|
try {
|
|
5734
5908
|
const rpc = ctx.get("connection", false)?.rpc;
|
|
@@ -5767,12 +5941,13 @@ window.__ModuleLoader__.load({
|
|
|
5767
5941
|
autoReviewSettings: autoReview,
|
|
5768
5942
|
compactionSettings: compaction,
|
|
5769
5943
|
titleSettings: sessionTitle,
|
|
5944
|
+
memorySettings: memory,
|
|
5770
5945
|
switchSettings: owned
|
|
5771
5946
|
},
|
|
5772
5947
|
capabilities: RUNTIME_CAPABILITIES,
|
|
5773
5948
|
saveSubagent: (ops) => subagent.mutate(ops),
|
|
5774
5949
|
saveCapability: (route, ops) => {
|
|
5775
|
-
return (route === "search" ? search : route === "image" ? image : route === "compaction" ? compaction : route === "title" ? sessionTitle : autoReview).mutate(ops);
|
|
5950
|
+
return (route === "search" ? search : route === "image" ? image : route === "compaction" ? compaction : route === "title" ? sessionTitle : route === "memory" ? memory : autoReview).mutate(ops);
|
|
5776
5951
|
},
|
|
5777
5952
|
saveReviewAllowlist: async ({ enabled, tools }) => {
|
|
5778
5953
|
if (!await owned.mutate([{
|
package/lib/compaction.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as sessionProviderOf, i as resolveCapabilityRoute } from "./session-route-D8izd8Zd.js";
|
|
2
2
|
//#region lib/types/compaction.js
|
|
3
3
|
/** Official compaction row this module supersedes. */
|
|
4
4
|
const OFFICIAL_COMPACTION_ROW = "compaction-basic";
|
package/lib/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { s as normalizeProviderGroups } from "./session-route-D8izd8Zd.js";
|
|
2
2
|
import { r as resolveToolSource, t as DEFAULT_READ_ONLY_TOOLS } from "./tool-allowlist-DlzB5GlQ.js";
|
|
3
|
-
import { i as autoReviewStatus } from "./auto-review-
|
|
3
|
+
import { i as autoReviewStatus } from "./auto-review-BbfitRtw.js";
|
|
4
4
|
import { ModelSwitchAdapterRegistry } from "./adapter-registry.js";
|
|
5
5
|
import { automodeCompatView } from "./automode-compat.js";
|
|
6
6
|
import { createRequire } from "node:module";
|
|
@@ -36,6 +36,8 @@ const Config = z.object({
|
|
|
36
36
|
compactModel: z.string().volatile(),
|
|
37
37
|
titleProvider: z.string().volatile(),
|
|
38
38
|
titleModel: z.string().volatile(),
|
|
39
|
+
memoryProvider: z.string().volatile(),
|
|
40
|
+
memoryModel: z.string().volatile(),
|
|
39
41
|
providerGroups: z.array(z.object({
|
|
40
42
|
provider: z.string().default(""),
|
|
41
43
|
compactProvider: z.string().default(""),
|
|
@@ -46,7 +48,9 @@ const Config = z.object({
|
|
|
46
48
|
subagentModel: z.string().default(""),
|
|
47
49
|
subagentReasoningEffort: z.string().default(""),
|
|
48
50
|
titleProvider: z.string().default(""),
|
|
49
|
-
titleModel: z.string().default("")
|
|
51
|
+
titleModel: z.string().default(""),
|
|
52
|
+
memoryProvider: z.string().default(""),
|
|
53
|
+
memoryModel: z.string().default("")
|
|
50
54
|
})).default([]).volatile()
|
|
51
55
|
});
|
|
52
56
|
function readConfig(config) {
|
|
@@ -65,6 +69,8 @@ function readConfig(config) {
|
|
|
65
69
|
const compactModel = config.compactModel.get();
|
|
66
70
|
const titleProvider = config.titleProvider.get();
|
|
67
71
|
const titleModel = config.titleModel.get();
|
|
72
|
+
const memoryProvider = config.memoryProvider.get();
|
|
73
|
+
const memoryModel = config.memoryModel.get();
|
|
68
74
|
const providerGroups = normalizeProviderGroups(config.providerGroups.get());
|
|
69
75
|
return {
|
|
70
76
|
subagentMode: config.subagentMode.get(),
|
|
@@ -83,6 +89,8 @@ function readConfig(config) {
|
|
|
83
89
|
...compactModel === void 0 || compactModel === "" ? {} : { compactModel },
|
|
84
90
|
...titleProvider === void 0 || titleProvider === "" ? {} : { titleProvider },
|
|
85
91
|
...titleModel === void 0 || titleModel === "" ? {} : { titleModel },
|
|
92
|
+
...memoryProvider === void 0 || memoryProvider === "" ? {} : { memoryProvider },
|
|
93
|
+
...memoryModel === void 0 || memoryModel === "" ? {} : { memoryModel },
|
|
86
94
|
...Object.keys(providerGroups).length === 0 ? {} : { providerGroups }
|
|
87
95
|
};
|
|
88
96
|
}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { r as memoryRouteOf } from "./session-route-D8izd8Zd.js";
|
|
2
|
+
//#region lib/types/prime-memory-route.js
|
|
3
|
+
/**
|
|
4
|
+
* Model Switch's adapter to `dsh-prime-memory`'s distillation route.
|
|
5
|
+
*
|
|
6
|
+
* prime-memory owns its distillation route: a `distillChain` in the volatile
|
|
7
|
+
* `live` settings section (`distillProvider`/`distillModel` before 0.x chains
|
|
8
|
+
* existed), read through its own settings handle and committed with
|
|
9
|
+
* `ctx.settings.update('dsh-memory', { live })` — a volatile-only commit that
|
|
10
|
+
* does not remount the plugin. This module only builds the write Model Switch
|
|
11
|
+
* offers; it never runs a distillation call, never rewrites the plugin, and
|
|
12
|
+
* never changes a route the user did not ask to change.
|
|
13
|
+
*
|
|
14
|
+
* All functions here are pure.
|
|
15
|
+
*/
|
|
16
|
+
/** The loader row id prime-memory is composed under (fixed by its bundle patch). */
|
|
17
|
+
const PRIME_MEMORY_ENTRY_ID = "dsh-memory";
|
|
18
|
+
/** The package name that identifies the row; the authoritative identity. */
|
|
19
|
+
const PRIME_MEMORY_PACKAGE = "dsh-prime-memory";
|
|
20
|
+
/** A non-blank string; blank values behave exactly like an absent field. */
|
|
21
|
+
function present(value) {
|
|
22
|
+
return typeof value === "string" && value.trim() !== "";
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Whether one loader entry is prime-memory.
|
|
26
|
+
*
|
|
27
|
+
* The package name wins over the row id: a profile layer may rename the row,
|
|
28
|
+
* while an unrelated row could recycle the id.
|
|
29
|
+
* @param entry - the loader entry to test.
|
|
30
|
+
* @returns True for prime-memory's row.
|
|
31
|
+
*/
|
|
32
|
+
function isPrimeMemoryRow(entry) {
|
|
33
|
+
const name = entry?.options?.name;
|
|
34
|
+
if (present(name)) return name === PRIME_MEMORY_PACKAGE;
|
|
35
|
+
return entry?.options?.id === PRIME_MEMORY_ENTRY_ID;
|
|
36
|
+
}
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region lib/types/prime-memory-compat.js
|
|
39
|
+
/**
|
|
40
|
+
* Adapt `dsh-prime-memory`'s distillation route to this plugin's route.
|
|
41
|
+
*
|
|
42
|
+
* The memory plugin resolves its distillation route as
|
|
43
|
+
* `config.llm.provider/model` → its own runtime chain → the deployment default
|
|
44
|
+
* model. Model Switch owns the deployment's per-provider routes, so this adapter
|
|
45
|
+
* fills the FIRST tier with the route this plugin resolved — but only while that
|
|
46
|
+
* row is still following its own default:
|
|
47
|
+
*
|
|
48
|
+
* - a deliberate `provider`/`model` in the row's config is never overwritten
|
|
49
|
+
* (`user-set`), and neither is a route this adapter wrote earlier unless it
|
|
50
|
+
* matches what it wrote (`adopted`);
|
|
51
|
+
* - an empty Model Switch route means "leave it alone" (`no-route`);
|
|
52
|
+
* - nothing is persisted: the row's live config object is patched in memory, so
|
|
53
|
+
* the memory plugin's own settings page keeps showing "follow the default
|
|
54
|
+
* model" and a restart simply re-applies this adapter.
|
|
55
|
+
*
|
|
56
|
+
* The route itself is provider-group based: the group of the deployment default
|
|
57
|
+
* provider (read from the `agent-default-model` row), falling back to the flat
|
|
58
|
+
* memory pair.
|
|
59
|
+
*/
|
|
60
|
+
/** Row name and dependencies, mirroring the sibling adapter row. */
|
|
61
|
+
const name = "model-switch-prime-memory-compat";
|
|
62
|
+
const inject = ["loader", "modelSwitch"];
|
|
63
|
+
/** The state the settings page reads. */
|
|
64
|
+
const primeMemoryCompatStatus = { installed: false };
|
|
65
|
+
/** Read a value as a plain record. */
|
|
66
|
+
function asRecord(value) {
|
|
67
|
+
return value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
68
|
+
}
|
|
69
|
+
/** A non-blank string. */
|
|
70
|
+
function text(value) {
|
|
71
|
+
return typeof value === "string" ? value.trim() : "";
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Decide the config one memory row should run with.
|
|
75
|
+
*
|
|
76
|
+
* Pure and side-effect free so the policy is unit-testable.
|
|
77
|
+
* @param config - the row's current config (any JSON-ish value).
|
|
78
|
+
* @param route - this plugin's distillation route; an incomplete pair counts as unset.
|
|
79
|
+
* @param adoptedRoute - a `provider/model` this adapter wrote on an earlier pass.
|
|
80
|
+
* @returns The config to install, whether it changed, and what was applied.
|
|
81
|
+
*/
|
|
82
|
+
function planPrimeMemoryRoute(config, route, adoptedRoute) {
|
|
83
|
+
const base = asRecord(config);
|
|
84
|
+
if (base === void 0) return {
|
|
85
|
+
config: {},
|
|
86
|
+
changed: false,
|
|
87
|
+
skipped: "no-route"
|
|
88
|
+
};
|
|
89
|
+
const llm = asRecord(base.llm) ?? {};
|
|
90
|
+
const declaredProvider = text(llm.provider);
|
|
91
|
+
const declaredModel = text(llm.model);
|
|
92
|
+
const declaredRoute = declaredProvider !== "" && declaredModel !== "" ? `${declaredProvider}/${declaredModel}` : void 0;
|
|
93
|
+
if (!(declaredRoute !== void 0 && adoptedRoute !== void 0 && declaredRoute === adoptedRoute) && (declaredProvider !== "" || declaredModel !== "")) return {
|
|
94
|
+
config: base,
|
|
95
|
+
changed: false,
|
|
96
|
+
skipped: "user-set"
|
|
97
|
+
};
|
|
98
|
+
const provider = text(route?.provider);
|
|
99
|
+
const model = text(route?.model);
|
|
100
|
+
if (provider === "" || model === "") return {
|
|
101
|
+
config: base,
|
|
102
|
+
changed: false,
|
|
103
|
+
skipped: "no-route"
|
|
104
|
+
};
|
|
105
|
+
return {
|
|
106
|
+
config: {
|
|
107
|
+
...base,
|
|
108
|
+
llm: {
|
|
109
|
+
...llm,
|
|
110
|
+
provider,
|
|
111
|
+
model
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
changed: true,
|
|
115
|
+
route: `${provider}/${model}`
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
/** The `agent-default-model` row's provider: the deployment default. */
|
|
119
|
+
function defaultProviderOf(loader) {
|
|
120
|
+
if (typeof loader?.entries !== "function") return void 0;
|
|
121
|
+
for (const entry of loader.entries()) {
|
|
122
|
+
if (entry.options?.id !== "agent-default-model") continue;
|
|
123
|
+
const provider = text(asRecord(entry.options?.config)?.provider);
|
|
124
|
+
if (provider !== "") return provider;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
/** Replace the row's route-consuming config in memory (never a profile write). */
|
|
128
|
+
function install(entry, config) {
|
|
129
|
+
const options = entry.options;
|
|
130
|
+
Object.defineProperty(options, "config", {
|
|
131
|
+
value: config,
|
|
132
|
+
enumerable: true,
|
|
133
|
+
writable: true,
|
|
134
|
+
configurable: true
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Install the adapter for the whole profile.
|
|
139
|
+
*
|
|
140
|
+
* Adapts on activation, on every `loader/patch-context`, and again whenever this
|
|
141
|
+
* plugin's settings change, so a saved route reaches a row that is already live.
|
|
142
|
+
* @param ctx - this row's context.
|
|
143
|
+
* @param loader - the loader service, when present.
|
|
144
|
+
* @param routeOf - resolves this plugin's distillation route for one settings snapshot.
|
|
145
|
+
* @returns The disposer and a replay hook.
|
|
146
|
+
*/
|
|
147
|
+
function installPrimeMemoryCompat(ctx, loader, routeOf) {
|
|
148
|
+
/** What this adapter wrote per row, so it may rewrite its own value only. */
|
|
149
|
+
const adopted = /* @__PURE__ */ new WeakMap();
|
|
150
|
+
const applying = (entry) => {
|
|
151
|
+
const route = routeOf();
|
|
152
|
+
const plan = planPrimeMemoryRoute(entry.options?.config, route, adopted.get(entry));
|
|
153
|
+
primeMemoryCompatStatus.installed = true;
|
|
154
|
+
if (plan.route !== void 0) {
|
|
155
|
+
install(entry, plan.config);
|
|
156
|
+
adopted.set(entry, plan.route);
|
|
157
|
+
primeMemoryCompatStatus.route = plan.route;
|
|
158
|
+
delete primeMemoryCompatStatus.routeSkipped;
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
primeMemoryCompatStatus.routeSkipped = plan.skipped;
|
|
162
|
+
if (plan.skipped === "user-set") primeMemoryCompatStatus.route = void 0;
|
|
163
|
+
};
|
|
164
|
+
if (typeof loader?.entries === "function") {
|
|
165
|
+
for (const entry of loader.entries()) if (isPrimeMemoryRow(entry)) applying(entry);
|
|
166
|
+
}
|
|
167
|
+
const dispose = ctx.on("loader/patch-context", function(first, second) {
|
|
168
|
+
const nextFn = typeof first === "function" ? first : second;
|
|
169
|
+
const candidate = typeof first === "function" ? this : first;
|
|
170
|
+
if (isPrimeMemoryRow(candidate)) applying(candidate);
|
|
171
|
+
return nextFn === void 0 ? void 0 : nextFn();
|
|
172
|
+
});
|
|
173
|
+
/** Re-adapt every live row (settings changed under us). */
|
|
174
|
+
const replay = () => {
|
|
175
|
+
let any = false;
|
|
176
|
+
for (const entry of loader?.entries?.() ?? []) {
|
|
177
|
+
if (!isPrimeMemoryRow(entry)) continue;
|
|
178
|
+
any = true;
|
|
179
|
+
applying(entry);
|
|
180
|
+
}
|
|
181
|
+
return any;
|
|
182
|
+
};
|
|
183
|
+
return {
|
|
184
|
+
dispose,
|
|
185
|
+
replay
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Row entry point: adapt the memory plugin on activation and on remount.
|
|
190
|
+
* @param ctx - this row's context.
|
|
191
|
+
*/
|
|
192
|
+
function apply(ctx) {
|
|
193
|
+
const loader = ctx.get("loader", false);
|
|
194
|
+
const routeOf = () => memoryRouteOf(ctx.modelSwitch.currentSettings(), defaultProviderOf(loader));
|
|
195
|
+
const adapter = installPrimeMemoryCompat(ctx, loader, routeOf);
|
|
196
|
+
ctx.effect(function* () {
|
|
197
|
+
yield adapter.dispose;
|
|
198
|
+
yield ctx.on("model-switch/settings-update", () => {
|
|
199
|
+
if (adapter.replay()) ctx.logger.info("model-switch: re-applied the dsh-prime-memory distillation route after a settings change");
|
|
200
|
+
});
|
|
201
|
+
}, "model-switch: keep the dsh-prime-memory route aligned with the settings");
|
|
202
|
+
}
|
|
203
|
+
//#endregion
|
|
204
|
+
export { apply, inject, installPrimeMemoryCompat, name, planPrimeMemoryRoute, primeMemoryCompatStatus };
|