dsh-context-compression-improved 0.5.7 → 0.5.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/package.json +16 -17
- package/packages/selector/dsh.plugin.json +1 -1
- package/packages/selector/lib/client.d.ts +59 -0
- package/packages/selector/lib/client.js +1012 -17
- package/packages/selector/lib/{advisor-state.js → config.js} +816 -65
- package/packages/selector/lib/index.d.ts +13 -1
- package/packages/selector/lib/index.js +295 -3
- package/packages/selector/lib/pruner.d.ts +65 -0
- package/packages/selector/lib/pruner.js +497 -262
- package/packages/selector/lib/style.css +42 -0
- package/packages/selector/src/client/CompressionProfileControls.tsx +67 -0
- package/packages/selector/src/client/CompressionProfileSelector.module.css +29 -0
- package/packages/selector/src/client/CompressionProfileSelector.tsx +2 -0
- package/packages/selector/src/client/decode.ts +10 -2
- package/packages/selector/src/client/index.ts +62 -0
- package/packages/selector/src/client/locales/de.ts +43 -0
- package/packages/selector/src/client/locales/es.ts +43 -0
- package/packages/selector/src/client/locales/fr.ts +43 -0
- package/packages/selector/src/client/locales/it.ts +43 -0
- package/packages/selector/src/client/locales/ja.ts +43 -0
- package/packages/selector/src/client/locales/ko.ts +43 -0
- package/packages/selector/src/client/locales/ru.ts +43 -0
- package/packages/selector/src/client/locales.ts +86 -0
- package/packages/selector/src/client/monitor-fab.ts +336 -0
- package/packages/selector/src/client/savings-card.tsx +150 -0
- package/packages/selector/src/client/settings-section.tsx +18 -2
- package/packages/selector/src/index.ts +215 -5
- package/packages/selector/src/profiles.ts +37 -0
- package/packages/selector/src/pruner/state.ts +7 -0
- package/packages/selector/src/pruner.ts +337 -3
- package/packages/selector/src/runtime/audit.ts +17 -0
- package/packages/selector/src/runtime/config.ts +52 -2
- package/packages/selector/src/runtime/monitor.ts +235 -0
- package/packages/selector/src/runtime/retrieve.ts +24 -2
- package/packages/selector/src/runtime/savings.ts +337 -0
- package/packages/selector/src/runtime/summary-command.ts +127 -0
- package/packages/selector/src/runtime/tokenpilot/advisor-prompt.ts +46 -1
- package/packages/selector/src/runtime/tokenpilot/advisor-state.ts +55 -0
- package/packages/selector/src/runtime/tokenpilot/intent-fold.ts +53 -0
- package/packages/selector/src/runtime/tokenpilot/intent-gate.ts +65 -0
- package/packages/selector/src/runtime/tokenpilot/intent-input-mask.ts +125 -0
- package/packages/selector/src/runtime/tokenpilot/intent-range.ts +37 -0
- package/packages/selector/src/runtime/types.ts +19 -0
- package/packages/selector/tests/auto-compact.client.spec.tsx +2 -1
- package/packages/selector/tests/code-skeleton.client.spec.ts +3 -2
- package/packages/selector/tests/custom-contract.client.spec.ts +3 -2
- package/packages/selector/tests/estimator-channel.client.spec.tsx +1 -0
- package/packages/selector/tests/estimator-route-registration.host.spec.ts +10 -4
- package/packages/selector/tests/monitor-fab.client.spec.ts +138 -0
- package/packages/selector/tests/preset-options-write.client.spec.ts +1 -0
- package/packages/selector/tests/profiles.client.spec.tsx +4 -2
- package/packages/selector/tests/runtime/audit.spec.ts +1 -0
- package/packages/selector/tests/runtime/intent-gate.spec.ts +62 -0
- package/packages/selector/tests/runtime/intent-summary.spec.ts +156 -0
- package/packages/selector/tests/runtime/monitor.spec.ts +301 -0
- package/packages/selector/tests/runtime/savings.spec.ts +120 -0
- package/packages/selector/tests/runtime/summary-command.spec.ts +154 -0
- package/packages/selector/tests/settings-seat.client.spec.ts +19 -7
- package/scripts/packed-install-e2e.mjs +1 -1
- package/scripts/verify-release.mjs +2 -1
|
@@ -60,6 +60,24 @@ window.__ModuleLoader__.load({
|
|
|
60
60
|
const enabled = value.enabled;
|
|
61
61
|
return typeof enabled === "boolean" ? { enabled } : void 0;
|
|
62
62
|
}
|
|
63
|
+
/** Browser-safe mirror of the runtime intentSummary section (absent inherits off). */
|
|
64
|
+
function decodeIntentSummarySettings(value) {
|
|
65
|
+
if (value === void 0) return { enabled: false };
|
|
66
|
+
if (!isPlainRecord(value)) return void 0;
|
|
67
|
+
const keys = Object.keys(value);
|
|
68
|
+
if (keys.length !== 1 || keys[0] !== "enabled") return void 0;
|
|
69
|
+
const enabled = value.enabled;
|
|
70
|
+
return typeof enabled === "boolean" ? { enabled } : void 0;
|
|
71
|
+
}
|
|
72
|
+
/** Browser-safe mirror of the runtime monitorPanel section (absent inherits hidden). */
|
|
73
|
+
function decodeMonitorPanelSettings(value) {
|
|
74
|
+
if (value === void 0) return { enabled: false };
|
|
75
|
+
if (!isPlainRecord(value)) return void 0;
|
|
76
|
+
const keys = Object.keys(value);
|
|
77
|
+
if (keys.length !== 1 || keys[0] !== "enabled") return void 0;
|
|
78
|
+
const enabled = value.enabled;
|
|
79
|
+
return typeof enabled === "boolean" ? { enabled } : void 0;
|
|
80
|
+
}
|
|
63
81
|
/**
|
|
64
82
|
* Browser mirror of the runtime presetOptions section: absent inherits the
|
|
65
83
|
* preset defaults (decodes to `undefined`); present values must be a plain
|
|
@@ -285,7 +303,7 @@ window.__ModuleLoader__.load({
|
|
|
285
303
|
}
|
|
286
304
|
//#endregion
|
|
287
305
|
//#region \0dsh-context-compression-css:466eb745356d-CompressionProfileSelector.module.css.mjs
|
|
288
|
-
const css = ".rLocJG_settingsSection{max-width:720px;color:var(--dsw-alias-label-primary);flex-direction:column;gap:12px;display:flex}.rLocJG_settingsTitle{color:var(--dsw-alias-label-primary);margin:0;font-size:16px;font-weight:500;line-height:24px}.rLocJG_settingsDescription{color:var(--dsw-alias-label-tertiary);margin:0;font-size:14px;line-height:22px}.rLocJG_root{width:100%}.rLocJG_profileGrid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;display:grid}.rLocJG_profileCard{border:1px solid var(--dsw-alias-border-l2);min-height:112px;color:var(--dsw-alias-label-primary);cursor:pointer;text-align:left;background:0 0;border-radius:10px;flex-direction:column;gap:8px;padding:14px;display:flex}.rLocJG_profileCard:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}.rLocJG_profileCard[aria-pressed=true]{border-color:var(--dsw-alias-label-primary)}.rLocJG_profileCard:active:not(:disabled){transform:scale(.99)}.rLocJG_profileCard:disabled{cursor:default;opacity:.6}.rLocJG_profileCard:focus-visible{outline-offset:2px;outline:2px solid}.rLocJG_profileCardTop{align-items:center;gap:8px;display:flex}.rLocJG_profileCardTitle{font-size:14px;font-weight:500;line-height:20px}.rLocJG_profileCurrent{background:var(--dsw-alias-label-primary);color:var(--dsw-alias-bg-base);border-radius:999px;padding:1px 6px;font-size:10px;line-height:14px}.rLocJG_profileCardDetail{color:var(--dsw-alias-label-secondary);font-size:12px;line-height:18px}.rLocJG_button{border:1px solid var(--dsw-alias-border-l2);width:100%;min-height:34px;color:var(--dsw-alias-label-primary);cursor:pointer;text-align:left;background:0 0;border-radius:10px;align-items:center;gap:8px;padding:6px 8px;display:flex}.rLocJG_button:hover{background:var(--dsw-alias-interactive-bg-hover)}.rLocJG_button:disabled{cursor:default;opacity:.6}.rLocJG_copy{flex:1;min-width:0}.rLocJG_label{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:14px}.rLocJG_value{text-overflow:ellipsis;white-space:nowrap;font-size:13px;line-height:17px;overflow:hidden}.rLocJG_chevron{color:var(--dsw-alias-label-secondary);flex:none}.rLocJG_menuCopy{flex-direction:column;gap:2px;min-width:220px;display:flex}.rLocJG_menuTitle{font-size:13px;line-height:17px}.rLocJG_menuDetail{white-space:normal;max-width:290px;color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:15px}.rLocJG_error{color:var(--dsw-alias-state-error-primary);padding:4px 8px 0;font-size:11px;line-height:15px}.rLocJG_unavailable{color:var(--dsw-alias-label-tertiary);padding:4px 8px 0;font-size:11px;line-height:15px}.rLocJG_settingsHint{color:var(--dsw-alias-label-secondary);padding:4px 8px 0;font-size:11px;line-height:15px}.rLocJG_pricing{color:var(--dsw-alias-label-tertiary);padding:4px 8px 0;font-size:11px;line-height:15px}.rLocJG_custom{border-top:1px solid var(--dsw-alias-border-l2);margin-top:16px;padding:16px 0 0}.rLocJG_customTitle{margin:0 0 6px;font-size:13px;line-height:17px}.rLocJG_customNote{color:var(--dsw-alias-label-tertiary);margin:4px 0;font-size:11px;line-height:15px}.rLocJG_stage{border:0;border-top:1px solid var(--dsw-alias-border-l2);margin:12px 0 0;padding:12px 0 0}.rLocJG_stageToggle{align-items:center;gap:6px;font-size:12px;line-height:16px;display:inline-flex}.rLocJG_fieldGrid{grid-template-columns:1fr;gap:8px;display:grid}.rLocJG_field{min-width:0;color:var(--dsw-alias-label-secondary);flex-direction:column;gap:4px;margin-top:8px;font-size:11px;line-height:15px;display:flex}.rLocJG_field input,.rLocJG_field select{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-base);width:100%;min-width:0;min-height:30px;color:var(--dsw-alias-label-primary);border-radius:7px;padding:4px 6px}.rLocJG_field input:focus-visible,.rLocJG_field select:focus-visible,.rLocJG_actions button:focus-visible{outline-offset:2px;outline:2px solid}.rLocJG_actions{flex-wrap:wrap;gap:8px;margin-top:10px;display:flex}.rLocJG_actions button{border:1px solid var(--dsw-alias-border-l2);min-height:30px;color:var(--dsw-alias-label-primary);background:0 0;border-radius:7px;padding:4px 8px}.rLocJG_actions button:active:not(:disabled){transform:scale(.98)}.rLocJG_actions button:disabled{opacity:.6}@media (width<=560px){.rLocJG_profileGrid{grid-template-columns:1fr}}.rLocJG_autoCompact{border:1px solid #80808059;border-radius:8px;margin-top:24px;padding:16px}.rLocJG_autoCompactTitle{margin:0 0 8px;font-size:15px;font-weight:600}.rLocJG_autoCompactRisk{opacity:.9;margin:8px 0 0;font-size:12px}";
|
|
306
|
+
const css = ".rLocJG_settingsSection{max-width:720px;color:var(--dsw-alias-label-primary);flex-direction:column;gap:12px;display:flex}.rLocJG_settingsTitle{color:var(--dsw-alias-label-primary);margin:0;font-size:16px;font-weight:500;line-height:24px}.rLocJG_settingsDescription{color:var(--dsw-alias-label-tertiary);margin:0;font-size:14px;line-height:22px}.rLocJG_root{width:100%}.rLocJG_profileGrid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;display:grid}.rLocJG_profileCard{border:1px solid var(--dsw-alias-border-l2);min-height:112px;color:var(--dsw-alias-label-primary);cursor:pointer;text-align:left;background:0 0;border-radius:10px;flex-direction:column;gap:8px;padding:14px;display:flex}.rLocJG_profileCard:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}.rLocJG_profileCard[aria-pressed=true]{border-color:var(--dsw-alias-label-primary)}.rLocJG_profileCard:active:not(:disabled){transform:scale(.99)}.rLocJG_profileCard:disabled{cursor:default;opacity:.6}.rLocJG_profileCard:focus-visible{outline-offset:2px;outline:2px solid}.rLocJG_profileCardTop{align-items:center;gap:8px;display:flex}.rLocJG_profileCardTitle{font-size:14px;font-weight:500;line-height:20px}.rLocJG_profileCurrent{background:var(--dsw-alias-label-primary);color:var(--dsw-alias-bg-base);border-radius:999px;padding:1px 6px;font-size:10px;line-height:14px}.rLocJG_profileCardDetail{color:var(--dsw-alias-label-secondary);font-size:12px;line-height:18px}.rLocJG_button{border:1px solid var(--dsw-alias-border-l2);width:100%;min-height:34px;color:var(--dsw-alias-label-primary);cursor:pointer;text-align:left;background:0 0;border-radius:10px;align-items:center;gap:8px;padding:6px 8px;display:flex}.rLocJG_button:hover{background:var(--dsw-alias-interactive-bg-hover)}.rLocJG_button:disabled{cursor:default;opacity:.6}.rLocJG_copy{flex:1;min-width:0}.rLocJG_label{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:14px}.rLocJG_value{text-overflow:ellipsis;white-space:nowrap;font-size:13px;line-height:17px;overflow:hidden}.rLocJG_chevron{color:var(--dsw-alias-label-secondary);flex:none}.rLocJG_menuCopy{flex-direction:column;gap:2px;min-width:220px;display:flex}.rLocJG_menuTitle{font-size:13px;line-height:17px}.rLocJG_menuDetail{white-space:normal;max-width:290px;color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:15px}.rLocJG_error{color:var(--dsw-alias-state-error-primary);padding:4px 8px 0;font-size:11px;line-height:15px}.rLocJG_unavailable{color:var(--dsw-alias-label-tertiary);padding:4px 8px 0;font-size:11px;line-height:15px}.rLocJG_settingsHint{color:var(--dsw-alias-label-secondary);padding:4px 8px 0;font-size:11px;line-height:15px}.rLocJG_pricing{color:var(--dsw-alias-label-tertiary);padding:4px 8px 0;font-size:11px;line-height:15px}.rLocJG_custom{border-top:1px solid var(--dsw-alias-border-l2);margin-top:16px;padding:16px 0 0}.rLocJG_customTitle{margin:0 0 6px;font-size:13px;line-height:17px}.rLocJG_customNote{color:var(--dsw-alias-label-tertiary);margin:4px 0;font-size:11px;line-height:15px}.rLocJG_stage{border:0;border-top:1px solid var(--dsw-alias-border-l2);margin:12px 0 0;padding:12px 0 0}.rLocJG_stageToggle{align-items:center;gap:6px;font-size:12px;line-height:16px;display:inline-flex}.rLocJG_fieldGrid{grid-template-columns:1fr;gap:8px;display:grid}.rLocJG_field{min-width:0;color:var(--dsw-alias-label-secondary);flex-direction:column;gap:4px;margin-top:8px;font-size:11px;line-height:15px;display:flex}.rLocJG_field input,.rLocJG_field select{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-base);width:100%;min-width:0;min-height:30px;color:var(--dsw-alias-label-primary);border-radius:7px;padding:4px 6px}.rLocJG_field input:focus-visible,.rLocJG_field select:focus-visible,.rLocJG_actions button:focus-visible{outline-offset:2px;outline:2px solid}.rLocJG_actions{flex-wrap:wrap;gap:8px;margin-top:10px;display:flex}.rLocJG_actions button{border:1px solid var(--dsw-alias-border-l2);min-height:30px;color:var(--dsw-alias-label-primary);background:0 0;border-radius:7px;padding:4px 8px}.rLocJG_actions button:active:not(:disabled){transform:scale(.98)}.rLocJG_actions button:disabled{opacity:.6}@media (width<=560px){.rLocJG_profileGrid{grid-template-columns:1fr}}.rLocJG_autoCompact{border:1px solid #80808059;border-radius:8px;margin-top:24px;padding:16px}.rLocJG_autoCompactTitle{margin:0 0 8px;font-size:15px;font-weight:600}.rLocJG_autoCompactRisk{opacity:.9;margin:8px 0 0;font-size:12px}.rLocJG_savingsCard{border:1px solid #ffffff1a;border-radius:8px;flex-direction:column;gap:4px;margin-top:14px;padding:10px 12px;display:flex}.rLocJG_savingsRow{justify-content:space-between;align-items:baseline;gap:12px;display:flex}.rLocJG_savingsNetPositive strong{color:#30d158}.rLocJG_savingsNetNegative strong{color:#ff9f0a}.rLocJG_savingsMuted{opacity:.66;font-size:.92em}.rLocJG_savingsBreakdown{border-top:1px solid #ffffff14;margin-top:4px;padding-top:4px}.rLocJG_savingsNote{opacity:.5;margin-top:4px;font-size:.85em}";
|
|
289
307
|
const tagId = "dsh-context-compression-improved/CompressionProfileSelector.module.css";
|
|
290
308
|
if (typeof document !== "undefined" && document.querySelector(`style[data-plugin-css="${tagId}"]`) === null) {
|
|
291
309
|
const tag = document.createElement("style");
|
|
@@ -320,6 +338,13 @@ window.__ModuleLoader__.load({
|
|
|
320
338
|
"profileCurrent": "rLocJG_profileCurrent",
|
|
321
339
|
"profileGrid": "rLocJG_profileGrid",
|
|
322
340
|
"root": "rLocJG_root",
|
|
341
|
+
"savingsBreakdown": "rLocJG_savingsBreakdown",
|
|
342
|
+
"savingsCard": "rLocJG_savingsCard",
|
|
343
|
+
"savingsMuted": "rLocJG_savingsMuted",
|
|
344
|
+
"savingsNetNegative": "rLocJG_savingsNetNegative",
|
|
345
|
+
"savingsNetPositive": "rLocJG_savingsNetPositive",
|
|
346
|
+
"savingsNote": "rLocJG_savingsNote",
|
|
347
|
+
"savingsRow": "rLocJG_savingsRow",
|
|
323
348
|
"settingsDescription": "rLocJG_settingsDescription",
|
|
324
349
|
"settingsHint": "rLocJG_settingsHint",
|
|
325
350
|
"settingsSection": "rLocJG_settingsSection",
|
|
@@ -708,10 +733,84 @@ window.__ModuleLoader__.load({
|
|
|
708
733
|
});
|
|
709
734
|
}
|
|
710
735
|
/**
|
|
711
|
-
* The
|
|
712
|
-
*
|
|
713
|
-
*
|
|
736
|
+
* The turn-tail intent summary fold gate. Same deliberately minimal shape as
|
|
737
|
+
* the code-skeleton gate: an on/off select with its own save path; the fold
|
|
738
|
+
* itself is gated by the growth constants and the per-session /ctx-summary
|
|
739
|
+
* override, none of which belong in this card.
|
|
714
740
|
*/
|
|
741
|
+
function IntentSummaryControls({ value, disabled, save, settle, t }) {
|
|
742
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
743
|
+
className: _dsh_context_compression_css_466eb745356d_CompressionProfileSelector_module_css_default.autoCompact,
|
|
744
|
+
"aria-labelledby": "context-compression-intentsummary-title",
|
|
745
|
+
children: [
|
|
746
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
|
|
747
|
+
id: "context-compression-intentsummary-title",
|
|
748
|
+
className: _dsh_context_compression_css_466eb745356d_CompressionProfileSelector_module_css_default.autoCompactTitle,
|
|
749
|
+
children: t("intentSummary.title")
|
|
750
|
+
}),
|
|
751
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
752
|
+
className: _dsh_context_compression_css_466eb745356d_CompressionProfileSelector_module_css_default.customNote,
|
|
753
|
+
children: t("intentSummary.description")
|
|
754
|
+
}),
|
|
755
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
756
|
+
className: _dsh_context_compression_css_466eb745356d_CompressionProfileSelector_module_css_default.field,
|
|
757
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("intentSummary.enabled") }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
758
|
+
value: value ? "on" : "off",
|
|
759
|
+
disabled,
|
|
760
|
+
onChange: (event) => {
|
|
761
|
+
settle(() => save(event.currentTarget.value === "on"));
|
|
762
|
+
},
|
|
763
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
764
|
+
value: "on",
|
|
765
|
+
children: t("intentSummary.enabled.on")
|
|
766
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
767
|
+
value: "off",
|
|
768
|
+
children: t("intentSummary.enabled.off")
|
|
769
|
+
})]
|
|
770
|
+
})]
|
|
771
|
+
})
|
|
772
|
+
]
|
|
773
|
+
});
|
|
774
|
+
}
|
|
775
|
+
/**
|
|
776
|
+
* Visibility switch of the floating compression-monitor panel (FAB). The
|
|
777
|
+
* panel itself is a body-level overlay driven by the monitor route; this card
|
|
778
|
+
* only decides whether it mounts.
|
|
779
|
+
*/
|
|
780
|
+
function MonitorPanelControls({ value, disabled, save, settle, t }) {
|
|
781
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
782
|
+
className: _dsh_context_compression_css_466eb745356d_CompressionProfileSelector_module_css_default.autoCompact,
|
|
783
|
+
"aria-labelledby": "context-compression-monitorpanel-title",
|
|
784
|
+
children: [
|
|
785
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
|
|
786
|
+
id: "context-compression-monitorpanel-title",
|
|
787
|
+
className: _dsh_context_compression_css_466eb745356d_CompressionProfileSelector_module_css_default.autoCompactTitle,
|
|
788
|
+
children: t("monitorPanel.title")
|
|
789
|
+
}),
|
|
790
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
791
|
+
className: _dsh_context_compression_css_466eb745356d_CompressionProfileSelector_module_css_default.customNote,
|
|
792
|
+
children: t("monitorPanel.description")
|
|
793
|
+
}),
|
|
794
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
795
|
+
className: _dsh_context_compression_css_466eb745356d_CompressionProfileSelector_module_css_default.field,
|
|
796
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("monitorPanel.enabled") }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
797
|
+
value: value ? "on" : "off",
|
|
798
|
+
disabled,
|
|
799
|
+
onChange: (event) => {
|
|
800
|
+
settle(() => save(event.currentTarget.value === "on"));
|
|
801
|
+
},
|
|
802
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
803
|
+
value: "on",
|
|
804
|
+
children: t("monitorPanel.enabled.on")
|
|
805
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
806
|
+
value: "off",
|
|
807
|
+
children: t("monitorPanel.enabled.off")
|
|
808
|
+
})]
|
|
809
|
+
})]
|
|
810
|
+
})
|
|
811
|
+
]
|
|
812
|
+
});
|
|
813
|
+
}
|
|
715
814
|
function CodeSkeletonControls({ value, disabled, save, settle, t }) {
|
|
716
815
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
717
816
|
className: _dsh_context_compression_css_466eb745356d_CompressionProfileSelector_module_css_default.autoCompact,
|
|
@@ -1024,6 +1123,189 @@ window.__ModuleLoader__.load({
|
|
|
1024
1123
|
});
|
|
1025
1124
|
}
|
|
1026
1125
|
//#endregion
|
|
1126
|
+
//#region src/client/savings-card.tsx
|
|
1127
|
+
/**
|
|
1128
|
+
* 节省统计卡片(设置分节内,只读):净/毛/抵消 + 分项条。
|
|
1129
|
+
* 数据源 = `/api/.../savings` 只读快照路由(忙 2s / 闲 5s 自调度轮询,
|
|
1130
|
+
* 失败静默——统计卡片永不打扰设置页主功能)。
|
|
1131
|
+
*
|
|
1132
|
+
* @module dsh-context-compression-improved/client/savings-card
|
|
1133
|
+
*/
|
|
1134
|
+
const SAVINGS_ROUTE = "/api/dsh-context-compression-improved/savings";
|
|
1135
|
+
function fmt(n) {
|
|
1136
|
+
return n.toLocaleString("en-US");
|
|
1137
|
+
}
|
|
1138
|
+
/** 节省统计卡片:口径分列(精确 tokenizer vs chars/4 估算),永不混算。 */
|
|
1139
|
+
function SavingsCard({ t }) {
|
|
1140
|
+
const [snap, setSnap] = (0, react.useState)(null);
|
|
1141
|
+
const stopped = (0, react.useRef)(false);
|
|
1142
|
+
(0, react.useEffect)(() => {
|
|
1143
|
+
stopped.current = false;
|
|
1144
|
+
const tick = async () => {
|
|
1145
|
+
try {
|
|
1146
|
+
const response = await fetch(SAVINGS_ROUTE, { headers: { "cache-control": "no-cache" } });
|
|
1147
|
+
if (response.ok) {
|
|
1148
|
+
const data = await response.json();
|
|
1149
|
+
if (data?.startedAt !== void 0 && !stopped.current) setSnap(data);
|
|
1150
|
+
}
|
|
1151
|
+
} catch {}
|
|
1152
|
+
if (!stopped.current) setTimeout(tick, 5e3);
|
|
1153
|
+
};
|
|
1154
|
+
tick();
|
|
1155
|
+
return () => {
|
|
1156
|
+
stopped.current = true;
|
|
1157
|
+
};
|
|
1158
|
+
}, []);
|
|
1159
|
+
if (snap === null || snap.gross.exact + snap.gross.estimated === 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1160
|
+
className: _dsh_context_compression_css_466eb745356d_CompressionProfileSelector_module_css_default.pricing,
|
|
1161
|
+
children: t("savings.empty")
|
|
1162
|
+
});
|
|
1163
|
+
const hasExact = snap.gross.exact > 0 || snap.offsets.exact > 0;
|
|
1164
|
+
const hasEstimated = snap.gross.estimated > 0 || snap.offsets.estimated > 0;
|
|
1165
|
+
const netTone = snap.net.exact + snap.net.estimated >= 0 ? _dsh_context_compression_css_466eb745356d_CompressionProfileSelector_module_css_default.savingsNetPositive : _dsh_context_compression_css_466eb745356d_CompressionProfileSelector_module_css_default.savingsNetNegative;
|
|
1166
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1167
|
+
className: `${_dsh_context_compression_css_466eb745356d_CompressionProfileSelector_module_css_default.savingsCard}`,
|
|
1168
|
+
"data-testid": "savings-card",
|
|
1169
|
+
children: [
|
|
1170
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1171
|
+
className: _dsh_context_compression_css_466eb745356d_CompressionProfileSelector_module_css_default.savingsRow,
|
|
1172
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("savings.title") })
|
|
1173
|
+
}),
|
|
1174
|
+
hasExact ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1175
|
+
className: `${_dsh_context_compression_css_466eb745356d_CompressionProfileSelector_module_css_default.savingsRow} ${netTone}`,
|
|
1176
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("savings.netExact") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: fmt(snap.net.exact) })]
|
|
1177
|
+
}) : null,
|
|
1178
|
+
hasEstimated ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1179
|
+
className: _dsh_context_compression_css_466eb745356d_CompressionProfileSelector_module_css_default.savingsRow,
|
|
1180
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("savings.netEstimated") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: fmt(snap.net.estimated) })]
|
|
1181
|
+
}) : null,
|
|
1182
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1183
|
+
className: _dsh_context_compression_css_466eb745356d_CompressionProfileSelector_module_css_default.savingsRow,
|
|
1184
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1185
|
+
className: _dsh_context_compression_css_466eb745356d_CompressionProfileSelector_module_css_default.savingsMuted,
|
|
1186
|
+
children: t("savings.gross")
|
|
1187
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
1188
|
+
className: _dsh_context_compression_css_466eb745356d_CompressionProfileSelector_module_css_default.savingsMuted,
|
|
1189
|
+
children: [
|
|
1190
|
+
hasExact ? `✓ ${fmt(snap.gross.exact)}` : "",
|
|
1191
|
+
hasExact && hasEstimated ? " · " : "",
|
|
1192
|
+
hasEstimated ? `≈ ${fmt(snap.gross.estimated)}` : ""
|
|
1193
|
+
]
|
|
1194
|
+
})]
|
|
1195
|
+
}),
|
|
1196
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1197
|
+
className: _dsh_context_compression_css_466eb745356d_CompressionProfileSelector_module_css_default.savingsRow,
|
|
1198
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1199
|
+
className: _dsh_context_compression_css_466eb745356d_CompressionProfileSelector_module_css_default.savingsMuted,
|
|
1200
|
+
children: t("savings.offsets")
|
|
1201
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
1202
|
+
className: _dsh_context_compression_css_466eb745356d_CompressionProfileSelector_module_css_default.savingsMuted,
|
|
1203
|
+
children: [
|
|
1204
|
+
hasExact ? `−${fmt(snap.offsets.exact)}` : "",
|
|
1205
|
+
hasExact && hasEstimated ? " · " : "",
|
|
1206
|
+
hasEstimated ? `−${fmt(snap.offsets.estimated)}` : ""
|
|
1207
|
+
]
|
|
1208
|
+
})]
|
|
1209
|
+
}),
|
|
1210
|
+
snap.usage !== void 0 && snap.usage.requests > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
1211
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1212
|
+
className: _dsh_context_compression_css_466eb745356d_CompressionProfileSelector_module_css_default.savingsRow,
|
|
1213
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1214
|
+
className: _dsh_context_compression_css_466eb745356d_CompressionProfileSelector_module_css_default.savingsMuted,
|
|
1215
|
+
children: t("savings.requests")
|
|
1216
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1217
|
+
className: _dsh_context_compression_css_466eb745356d_CompressionProfileSelector_module_css_default.savingsMuted,
|
|
1218
|
+
children: fmt(snap.usage.requests)
|
|
1219
|
+
})]
|
|
1220
|
+
}),
|
|
1221
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1222
|
+
className: _dsh_context_compression_css_466eb745356d_CompressionProfileSelector_module_css_default.savingsRow,
|
|
1223
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1224
|
+
className: _dsh_context_compression_css_466eb745356d_CompressionProfileSelector_module_css_default.savingsMuted,
|
|
1225
|
+
children: t("savings.cacheHit")
|
|
1226
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1227
|
+
className: _dsh_context_compression_css_466eb745356d_CompressionProfileSelector_module_css_default.savingsMuted,
|
|
1228
|
+
children: snap.usage.cacheHitRate === null ? "–" : `${Math.round(snap.usage.cacheHitRate * 100)}%`
|
|
1229
|
+
})]
|
|
1230
|
+
}),
|
|
1231
|
+
snap.pricing?.actualCost !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1232
|
+
className: _dsh_context_compression_css_466eb745356d_CompressionProfileSelector_module_css_default.savingsRow,
|
|
1233
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1234
|
+
className: _dsh_context_compression_css_466eb745356d_CompressionProfileSelector_module_css_default.savingsMuted,
|
|
1235
|
+
children: t("savings.actualCost")
|
|
1236
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
1237
|
+
className: _dsh_context_compression_css_466eb745356d_CompressionProfileSelector_module_css_default.savingsMuted,
|
|
1238
|
+
children: [
|
|
1239
|
+
snap.pricing.currency,
|
|
1240
|
+
" ",
|
|
1241
|
+
snap.pricing.actualCost
|
|
1242
|
+
]
|
|
1243
|
+
})]
|
|
1244
|
+
}) : null,
|
|
1245
|
+
snap.pricing?.estimatedSavedCost !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1246
|
+
className: _dsh_context_compression_css_466eb745356d_CompressionProfileSelector_module_css_default.savingsRow,
|
|
1247
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1248
|
+
className: _dsh_context_compression_css_466eb745356d_CompressionProfileSelector_module_css_default.savingsMuted,
|
|
1249
|
+
children: t("savings.savedMoney")
|
|
1250
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
1251
|
+
className: _dsh_context_compression_css_466eb745356d_CompressionProfileSelector_module_css_default.savingsMuted,
|
|
1252
|
+
children: [
|
|
1253
|
+
snap.pricing.currency,
|
|
1254
|
+
" ",
|
|
1255
|
+
snap.pricing.estimatedSavedCost
|
|
1256
|
+
]
|
|
1257
|
+
})]
|
|
1258
|
+
}) : null
|
|
1259
|
+
] }) : null,
|
|
1260
|
+
snap.perSession !== void 0 && snap.perSession.length > 1 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1261
|
+
className: _dsh_context_compression_css_466eb745356d_CompressionProfileSelector_module_css_default.savingsBreakdown,
|
|
1262
|
+
children: snap.perSession.slice(0, 5).map((row) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1263
|
+
className: _dsh_context_compression_css_466eb745356d_CompressionProfileSelector_module_css_default.savingsRow,
|
|
1264
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
1265
|
+
className: _dsh_context_compression_css_466eb745356d_CompressionProfileSelector_module_css_default.savingsMuted,
|
|
1266
|
+
children: [
|
|
1267
|
+
t("savings.perSession"),
|
|
1268
|
+
" · ",
|
|
1269
|
+
row.sessionId.slice(0, 8),
|
|
1270
|
+
"…",
|
|
1271
|
+
row.requests > 0 ? ` · ${t("savings.cacheHit")} ${row.cacheHitRate === null ? "–" : `${Math.round(row.cacheHitRate * 100)}%`}` : ""
|
|
1272
|
+
]
|
|
1273
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1274
|
+
className: _dsh_context_compression_css_466eb745356d_CompressionProfileSelector_module_css_default.savingsMuted,
|
|
1275
|
+
children: fmt(row.net.exact)
|
|
1276
|
+
})]
|
|
1277
|
+
}, row.sessionId))
|
|
1278
|
+
}) : null,
|
|
1279
|
+
snap.perComponent.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1280
|
+
className: _dsh_context_compression_css_466eb745356d_CompressionProfileSelector_module_css_default.savingsBreakdown,
|
|
1281
|
+
children: snap.perComponent.slice(0, 6).map((row) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1282
|
+
className: _dsh_context_compression_css_466eb745356d_CompressionProfileSelector_module_css_default.savingsRow,
|
|
1283
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
1284
|
+
className: _dsh_context_compression_css_466eb745356d_CompressionProfileSelector_module_css_default.savingsMuted,
|
|
1285
|
+
children: [
|
|
1286
|
+
row.kind === "offset" ? "−" : "+",
|
|
1287
|
+
" ",
|
|
1288
|
+
row.component,
|
|
1289
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("small", { children: [
|
|
1290
|
+
" (",
|
|
1291
|
+
row.basis === "exact-tokenizer" ? t("savings.basisExact") : t("savings.basisEstimated"),
|
|
1292
|
+
")"
|
|
1293
|
+
] })
|
|
1294
|
+
]
|
|
1295
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1296
|
+
className: _dsh_context_compression_css_466eb745356d_CompressionProfileSelector_module_css_default.savingsMuted,
|
|
1297
|
+
children: fmt(row.tokens)
|
|
1298
|
+
})]
|
|
1299
|
+
}, `${row.kind}:${row.component}:${row.basis}`))
|
|
1300
|
+
}) : null,
|
|
1301
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1302
|
+
className: _dsh_context_compression_css_466eb745356d_CompressionProfileSelector_module_css_default.savingsNote,
|
|
1303
|
+
children: t("savings.basisNote")
|
|
1304
|
+
})
|
|
1305
|
+
]
|
|
1306
|
+
});
|
|
1307
|
+
}
|
|
1308
|
+
//#endregion
|
|
1027
1309
|
//#region src/client/settings-section.tsx
|
|
1028
1310
|
/**
|
|
1029
1311
|
* Full-page Settings surface backed by the same durable selector state.
|
|
@@ -1036,7 +1318,7 @@ window.__ModuleLoader__.load({
|
|
|
1036
1318
|
function ContextCompressionSettingsSection(props) {
|
|
1037
1319
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SettingsCompressionProfileControls, { ...props });
|
|
1038
1320
|
}
|
|
1039
|
-
function SettingsCompressionProfileControls({ useCompression, select, saveCustom, resetCustom, saveAutoCompact, saveCodeSkeleton, savePresetOptions, t }) {
|
|
1321
|
+
function SettingsCompressionProfileControls({ useCompression, select, saveCustom, resetCustom, saveAutoCompact, saveCodeSkeleton, saveIntentSummary, saveMonitorPanel, savePresetOptions, t }) {
|
|
1040
1322
|
const state = useCompression((snapshot) => snapshot);
|
|
1041
1323
|
const [saving, setSaving] = (0, react.useState)(false);
|
|
1042
1324
|
const [saveError, setSaveError] = (0, react.useState)(null);
|
|
@@ -1123,6 +1405,20 @@ window.__ModuleLoader__.load({
|
|
|
1123
1405
|
settle,
|
|
1124
1406
|
t
|
|
1125
1407
|
}),
|
|
1408
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IntentSummaryControls, {
|
|
1409
|
+
value: state.value?.intentSummary?.enabled ?? false,
|
|
1410
|
+
disabled: busy || !state.writable || false,
|
|
1411
|
+
save: saveIntentSummary,
|
|
1412
|
+
settle,
|
|
1413
|
+
t
|
|
1414
|
+
}),
|
|
1415
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(MonitorPanelControls, {
|
|
1416
|
+
value: state.value?.monitorPanel?.enabled ?? false,
|
|
1417
|
+
disabled: busy || !state.writable || false,
|
|
1418
|
+
save: saveMonitorPanel,
|
|
1419
|
+
settle,
|
|
1420
|
+
t
|
|
1421
|
+
}),
|
|
1126
1422
|
current !== "tokenpilot-inspired" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(EstimatorInactiveNotice, {
|
|
1127
1423
|
profile: t(`profile.${current}`),
|
|
1128
1424
|
t
|
|
@@ -1133,6 +1429,7 @@ window.__ModuleLoader__.load({
|
|
|
1133
1429
|
settle,
|
|
1134
1430
|
t
|
|
1135
1431
|
}),
|
|
1432
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SavingsCard, { t }),
|
|
1136
1433
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1137
1434
|
className: _dsh_context_compression_css_466eb745356d_CompressionProfileSelector_module_css_default.pricing,
|
|
1138
1435
|
children: t("pricing.disclosure")
|
|
@@ -1160,7 +1457,7 @@ window.__ModuleLoader__.load({
|
|
|
1160
1457
|
/**
|
|
1161
1458
|
* Decode one stored context-compression settings document with exactly the
|
|
1162
1459
|
* runtime schema's strictness: a plain object with only `profile`, `custom`,
|
|
1163
|
-
* `autoCompact`, and `
|
|
1460
|
+
* `autoCompact`, `codeSkeleton`, and `intentSummary` keys, a supported profile, a valid Custom
|
|
1164
1461
|
* document canonicalized to v3 exactly as the runtime resolver would, a
|
|
1165
1462
|
* strictly-shaped autoCompact section (absent inherits the 80% default), and
|
|
1166
1463
|
* a strictly-shaped codeSkeleton gate (absent inherits off). Anything else
|
|
@@ -1169,17 +1466,21 @@ window.__ModuleLoader__.load({
|
|
|
1169
1466
|
*/
|
|
1170
1467
|
function decodeSettings(value) {
|
|
1171
1468
|
if (!isPlainRecord(value)) return void 0;
|
|
1172
|
-
if (Object.keys(value).some((key) => key !== "profile" && key !== "custom" && key !== "autoCompact" && key !== "codeSkeleton" && key !== "presetOptions")) return;
|
|
1469
|
+
if (Object.keys(value).some((key) => key !== "profile" && key !== "custom" && key !== "autoCompact" && key !== "codeSkeleton" && key !== "intentSummary" && key !== "monitorPanel" && key !== "presetOptions")) return;
|
|
1173
1470
|
const profile = value.profile;
|
|
1174
1471
|
const custom = value.custom;
|
|
1175
1472
|
const autoCompact = decodeAutoCompactSettings(value.autoCompact);
|
|
1176
1473
|
const codeSkeleton = decodeCodeSkeletonSettings(value.codeSkeleton);
|
|
1474
|
+
const intentSummary = decodeIntentSummarySettings(value.intentSummary);
|
|
1475
|
+
const monitorPanel = decodeMonitorPanelSettings(value.monitorPanel);
|
|
1177
1476
|
const presetOptions = decodePresetOptionsSettings(value.presetOptions);
|
|
1178
|
-
return typeof profile === "string" && COMPRESSION_PROFILES.includes(profile) && isCustomCompressionPolicy(custom) && autoCompact !== void 0 && codeSkeleton !== void 0 ? {
|
|
1477
|
+
return typeof profile === "string" && COMPRESSION_PROFILES.includes(profile) && isCustomCompressionPolicy(custom) && autoCompact !== void 0 && codeSkeleton !== void 0 && intentSummary !== void 0 && monitorPanel !== void 0 ? {
|
|
1179
1478
|
profile,
|
|
1180
1479
|
custom: canonicalizeCustomPolicy(custom),
|
|
1181
1480
|
autoCompact,
|
|
1182
1481
|
codeSkeleton,
|
|
1482
|
+
intentSummary,
|
|
1483
|
+
...monitorPanel === void 0 ? {} : { monitorPanel },
|
|
1183
1484
|
...presetOptions === void 0 ? {} : { presetOptions }
|
|
1184
1485
|
} : void 0;
|
|
1185
1486
|
}
|
|
@@ -1249,6 +1550,34 @@ window.__ModuleLoader__.load({
|
|
|
1249
1550
|
"codeSkeleton.enabled": "代码骨架压缩",
|
|
1250
1551
|
"codeSkeleton.enabled.on": "开",
|
|
1251
1552
|
"codeSkeleton.enabled.off": "关(默认)",
|
|
1553
|
+
"intentSummary.title": "回合末意图摘要(转向尾部压缩)",
|
|
1554
|
+
"intentSummary.description": "开启后,回合收尾阶段把本次消费的增量按语义角色折叠为意图摘要块:读类工具结果压成单行目标/规模记录,写类保留骨架头与逐字错误行,于下一次压力回合经既有折叠管线落地;仅当增长门控通过(活跃表面 >45% 且距上次折叠增长 >50K token)才触发。修改只影响新会话;当前会话可用 /ctx-summary off|on|status 临时覆盖。",
|
|
1555
|
+
"intentSummary.enabled": "回合末意图摘要",
|
|
1556
|
+
"intentSummary.enabled.on": "开",
|
|
1557
|
+
"intentSummary.enabled.off": "关(默认)",
|
|
1558
|
+
"monitor.fab.title": "压缩监控",
|
|
1559
|
+
"monitor.panel.title": "压缩监控",
|
|
1560
|
+
"monitor.panel.net": "净节省",
|
|
1561
|
+
"monitor.panel.gross": "毛节省",
|
|
1562
|
+
"monitor.panel.offsets": "抵消",
|
|
1563
|
+
"monitor.panel.context": "上下文占用",
|
|
1564
|
+
"monitor.panel.suggest": "上下文占用已达 {pct}%——临近灾难性遗忘区,建议压缩或裁剪历史",
|
|
1565
|
+
"monitor.panel.cacheHit": "缓存命中率",
|
|
1566
|
+
"monitor.panel.cost": "成本(实际 / 省估)",
|
|
1567
|
+
"monitor.panel.intent": "意图摘要",
|
|
1568
|
+
"monitor.panel.overrideHint": "会话覆盖",
|
|
1569
|
+
"monitor.panel.resume": "恢复",
|
|
1570
|
+
"monitor.panel.disable": "停用",
|
|
1571
|
+
"monitor.panel.stateOn": "开",
|
|
1572
|
+
"monitor.panel.stateOff": "关",
|
|
1573
|
+
"monitor.panel.gateUnknown": "未评估",
|
|
1574
|
+
"monitor.panel.lastFold": "最近折叠",
|
|
1575
|
+
"monitor.panel.stale": "快照不可达——显示上次数据",
|
|
1576
|
+
"monitorPanel.title": "压缩监控悬浮面板",
|
|
1577
|
+
"monitorPanel.description": "开启后,输入区旁出现可拖拽的悬浮球,点开即监控当前压缩状态:净节省(精确口径)、缓存命中率、成本估算、回合末意图摘要门控与最近抵消;面板内可临时覆盖当前会话的意图摘要开关。账本为进程内口径(宿主重启归零)。",
|
|
1578
|
+
"monitorPanel.enabled": "悬浮面板",
|
|
1579
|
+
"monitorPanel.enabled.on": "开",
|
|
1580
|
+
"monitorPanel.enabled.off": "关(默认)",
|
|
1252
1581
|
"custom.title": "Custom 策略",
|
|
1253
1582
|
"custom.settingsHint": "具体参数请前往“设置 > 上下文压缩选择器”中编辑。",
|
|
1254
1583
|
"custom.sessionScope": "保存后的修改会在当前压缩运行时随后首次观察某个 Session 时生效;已被该运行时观察的 Session 继续使用其冻结策略。",
|
|
@@ -1279,7 +1608,21 @@ window.__ModuleLoader__.load({
|
|
|
1279
1608
|
"custom.tailTrim.warning": "TailTrim 只在精确 tokenizer 可用时,把一个完整、已结束且非错误的纯工具组替换为可恢复引用;它与 History 共用近期工具调用数、工具结果尾窗和最小回收参数。它会改写已发送前缀,可能降低缓存命中。",
|
|
1280
1609
|
"custom.save": "保存 Custom 策略",
|
|
1281
1610
|
"custom.reset": "重置 Custom 策略",
|
|
1282
|
-
"custom.invalid": "Custom 策略参数无效。"
|
|
1611
|
+
"custom.invalid": "Custom 策略参数无效。",
|
|
1612
|
+
"savings.title": "节省统计(本进程)",
|
|
1613
|
+
"savings.netExact": "净节省(精确口径)",
|
|
1614
|
+
"savings.netEstimated": "净节省(估算口径)",
|
|
1615
|
+
"savings.gross": "毛节省(压缩落盘时)",
|
|
1616
|
+
"savings.offsets": "负节省(压缩后再读全文的抵消)",
|
|
1617
|
+
"savings.empty": "尚无压缩记录——发生首次裁剪后这里会显示净节省。",
|
|
1618
|
+
"savings.basisExact": "精确",
|
|
1619
|
+
"savings.basisEstimated": "估算",
|
|
1620
|
+
"savings.basisNote": "口径分列不混算:精确 = DeepSeek tokenizer;估算 = chars/4。先取骨架后取全文会计负节省(净额可能为负)。",
|
|
1621
|
+
"savings.requests": "请求轮次",
|
|
1622
|
+
"savings.cacheHit": "缓存命中率",
|
|
1623
|
+
"savings.actualCost": "实际成本(官方牌价)",
|
|
1624
|
+
"savings.savedMoney": "估算节省金额(按输入价)",
|
|
1625
|
+
"savings.perSession": "会话"
|
|
1283
1626
|
};
|
|
1284
1627
|
/** English copy matching every simplified Chinese selector key. */
|
|
1285
1628
|
const en = {
|
|
@@ -1345,6 +1688,34 @@ window.__ModuleLoader__.load({
|
|
|
1345
1688
|
"codeSkeleton.enabled": "Code skeleton compression",
|
|
1346
1689
|
"codeSkeleton.enabled.on": "On",
|
|
1347
1690
|
"codeSkeleton.enabled.off": "Off (default)",
|
|
1691
|
+
"intentSummary.title": "Turn-tail intent summary",
|
|
1692
|
+
"intentSummary.description": "When on, the turn-boundary postflight folds the consumed increment into intent-summary blocks by semantic role: read-class tool results become one-line target/scale records and write-class keep skeleton heads plus verbatim error lines, landing on the next pressure round through the ordinary fold pipeline. Only fires when the growth gate passes (live surface >45% and >50K tokens grown since the last fold). Applies to new sessions; override the current one with /ctx-summary off|on|status.",
|
|
1693
|
+
"intentSummary.enabled": "Turn-tail intent summary",
|
|
1694
|
+
"intentSummary.enabled.on": "On",
|
|
1695
|
+
"intentSummary.enabled.off": "Off (default)",
|
|
1696
|
+
"monitor.fab.title": "Compression monitor",
|
|
1697
|
+
"monitor.panel.title": "Compression monitor",
|
|
1698
|
+
"monitor.panel.net": "Net savings",
|
|
1699
|
+
"monitor.panel.gross": "Gross savings",
|
|
1700
|
+
"monitor.panel.offsets": "Offsets",
|
|
1701
|
+
"monitor.panel.context": "Context occupancy",
|
|
1702
|
+
"monitor.panel.suggest": "Context occupancy reached {pct}% — nearing the catastrophic-forgetting zone; consider compressing or trimming history",
|
|
1703
|
+
"monitor.panel.cacheHit": "Cache hit rate",
|
|
1704
|
+
"monitor.panel.cost": "Cost (actual / saved est.)",
|
|
1705
|
+
"monitor.panel.intent": "Intent summary",
|
|
1706
|
+
"monitor.panel.overrideHint": "Session override",
|
|
1707
|
+
"monitor.panel.resume": "Resume",
|
|
1708
|
+
"monitor.panel.disable": "Disable",
|
|
1709
|
+
"monitor.panel.stateOn": "on",
|
|
1710
|
+
"monitor.panel.stateOff": "off",
|
|
1711
|
+
"monitor.panel.gateUnknown": "not evaluated yet",
|
|
1712
|
+
"monitor.panel.lastFold": "Last fold",
|
|
1713
|
+
"monitor.panel.stale": "Snapshot unreachable — showing last data",
|
|
1714
|
+
"monitorPanel.title": "Compression monitor panel",
|
|
1715
|
+
"monitorPanel.description": "When on, a draggable floating bubble appears next to the input area — open it to watch live compression state: net savings (exact basis), cache hit rate, cost estimate, the turn-tail intent-summary gate and recent offsets. The panel can temporarily override the current session's intent-summary switch. The ledger is per-process (reset when the host restarts).",
|
|
1716
|
+
"monitorPanel.enabled": "Monitor panel",
|
|
1717
|
+
"monitorPanel.enabled.on": "On",
|
|
1718
|
+
"monitorPanel.enabled.off": "Off (default)",
|
|
1348
1719
|
"custom.title": "Custom policy",
|
|
1349
1720
|
"custom.settingsHint": "Edit detailed parameters in Settings > Context compression selector.",
|
|
1350
1721
|
"custom.sessionScope": "Saved changes apply when the current compression runtime next observes a Session for the first time. A Session already observed by that runtime keeps its frozen policy.",
|
|
@@ -1375,7 +1746,21 @@ window.__ModuleLoader__.load({
|
|
|
1375
1746
|
"custom.tailTrim.warning": "TailTrim requires the exact tokenizer and replaces at most one complete, finished, non-error tool-only group with a recoverable reference. It shares Protected recent tool calls, Protected recent tool-result tail, and Minimum reclaim with History. It rewrites a sent prefix and may reduce cache hits.",
|
|
1376
1747
|
"custom.save": "Save Custom policy",
|
|
1377
1748
|
"custom.reset": "Reset Custom policy",
|
|
1378
|
-
"custom.invalid": "Custom policy values are invalid."
|
|
1749
|
+
"custom.invalid": "Custom policy values are invalid.",
|
|
1750
|
+
"savings.title": "Savings (this process)",
|
|
1751
|
+
"savings.netExact": "Net saved (exact basis)",
|
|
1752
|
+
"savings.netEstimated": "Net saved (estimated basis)",
|
|
1753
|
+
"savings.gross": "Gross saved (at publish time)",
|
|
1754
|
+
"savings.offsets": "Offsets (compressed content re-read in full)",
|
|
1755
|
+
"savings.empty": "No compression yet — net savings appear after the first reduction lands.",
|
|
1756
|
+
"savings.basisExact": "exact",
|
|
1757
|
+
"savings.basisEstimated": "estimated",
|
|
1758
|
+
"savings.basisNote": "Bases are reported separately, never merged: exact = DeepSeek tokenizer; estimated = chars/4. A skeleton followed by a full read counts as negative savings (net can go below zero).",
|
|
1759
|
+
"savings.requests": "Requests",
|
|
1760
|
+
"savings.cacheHit": "Cache hit rate",
|
|
1761
|
+
"savings.actualCost": "Actual cost (official prices)",
|
|
1762
|
+
"savings.savedMoney": "Estimated saved cost (input price)",
|
|
1763
|
+
"savings.perSession": "Session"
|
|
1379
1764
|
};
|
|
1380
1765
|
//#endregion
|
|
1381
1766
|
//#region src/client/locales/de.ts
|
|
@@ -1443,6 +1828,34 @@ window.__ModuleLoader__.load({
|
|
|
1443
1828
|
"codeSkeleton.enabled": "Code-Skelettkomprimierung",
|
|
1444
1829
|
"codeSkeleton.enabled.on": "Ein",
|
|
1445
1830
|
"codeSkeleton.enabled.off": "Aus (Standard)",
|
|
1831
|
+
"intentSummary.title": "Abschluss-Zusammenfassung (Turn-Tail)",
|
|
1832
|
+
"intentSummary.description": "Aktiviert faltet der Turn-Abschluss den verbrauchten Zuwachs nach semantischen Rollen zu Intent-Zusammenfassungsblöcken: Lese-Tool-Ergebnisse werden zu Einzeilern mit Ziel/Umfang, die Schreibklasse behält Skelettköpfe plus wörtliche Fehlerzeilen; die Landung erfolgt in der nächsten Druckrunde über die gewöhnliche Falt-Pipeline. Zündet nur, wenn die Wachstumsschwelle passiert ist (live Oberfläche >45 % und >50K Token seit der letzten Faltung). Gilt für neue Sitzungen; die aktuelle lässt sich mit /ctx-summary off|on|status übersteuern.",
|
|
1833
|
+
"intentSummary.enabled": "Abschluss-Zusammenfassung",
|
|
1834
|
+
"intentSummary.enabled.on": "Ein",
|
|
1835
|
+
"intentSummary.enabled.off": "Aus (Standard)",
|
|
1836
|
+
"monitor.fab.title": "Komprimierungs-Monitor",
|
|
1837
|
+
"monitor.panel.title": "Komprimierungs-Monitor",
|
|
1838
|
+
"monitor.panel.net": "Nettoeinsparung",
|
|
1839
|
+
"monitor.panel.gross": "Bruttoeinsparung",
|
|
1840
|
+
"monitor.panel.offsets": "Ausgleiche",
|
|
1841
|
+
"monitor.panel.context": "Kontextbelegung",
|
|
1842
|
+
"monitor.panel.suggest": "Kontextbelegung bei {pct}% — nahe der katastrophalen Vergessenszone; Komprimieren oder Kürzen des Verlaufs empfohlen",
|
|
1843
|
+
"monitor.panel.cacheHit": "Cache-Trefferquote",
|
|
1844
|
+
"monitor.panel.cost": "Kosten (ist / gespart gesch.)",
|
|
1845
|
+
"monitor.panel.intent": "Intent-Zusammenfassung",
|
|
1846
|
+
"monitor.panel.overrideHint": "Sitzungs-Übersteuerung",
|
|
1847
|
+
"monitor.panel.resume": "Fortsetzen",
|
|
1848
|
+
"monitor.panel.disable": "Deaktivieren",
|
|
1849
|
+
"monitor.panel.stateOn": "ein",
|
|
1850
|
+
"monitor.panel.stateOff": "aus",
|
|
1851
|
+
"monitor.panel.gateUnknown": "noch nicht bewertet",
|
|
1852
|
+
"monitor.panel.lastFold": "Letzte Faltung",
|
|
1853
|
+
"monitor.panel.stale": "Snapshot nicht erreichbar — letzte Daten",
|
|
1854
|
+
"monitorPanel.title": "Komprimierungs-Monitorpanel",
|
|
1855
|
+
"monitorPanel.description": "Aktiviert erscheint neben dem Eingabebereich eine ziehbare Schwebekugel — öffne sie, um den Live-Komprimierungszustand zu beobachten: Nettoeinsparung (exakte Basis), Cache-Trefferquote, Kostenschätzung, das Turn-Tail-Gate und letzte Ausgleiche. Das Panel kann den Intent-Zusammenfassungsschalter der aktuellen Sitzung temporär übersteuern. Das Konto ist prozesslokal (Reset bei Host-Neustart).",
|
|
1856
|
+
"monitorPanel.enabled": "Monitorpanel",
|
|
1857
|
+
"monitorPanel.enabled.on": "Ein",
|
|
1858
|
+
"monitorPanel.enabled.off": "Aus (Standard)",
|
|
1446
1859
|
"custom.title": "Eigene Strategie",
|
|
1447
1860
|
"custom.settingsHint": "Detaillierte Parameter unter Einstellungen > Kontextkomprimierung wählen bearbeiten.",
|
|
1448
1861
|
"custom.sessionScope": "Gespeicherte Änderungen greifen, wenn die aktuelle Compression-Runtime eine Sitzung zum ersten Mal beobachtet. Eine von dieser Runtime bereits beobachtete Sitzung behält ihre eingefrorene Strategie.",
|
|
@@ -1473,7 +1886,21 @@ window.__ModuleLoader__.load({
|
|
|
1473
1886
|
"custom.tailTrim.warning": "TailTrim erfordert den exakten Tokenizer und ersetzt höchstens eine vollständige, abgeschlossene, fehlerfreie Gruppe nur aus Tools durch eine wiederherstellbare Referenz. Es teilt sich mit History die geschützten letzten Tool-Aufrufe, das geschützte neue Ende der Tool-Ergebnisse und die Mindest-Freigabe. Es schreibt ein gesendetes Präfix um und kann Cache-Treffer verringern.",
|
|
1474
1887
|
"custom.save": "Eigene Strategie speichern",
|
|
1475
1888
|
"custom.reset": "Eigene Strategie zurücksetzen",
|
|
1476
|
-
"custom.invalid": "Werte der eigenen Strategie sind ungültig."
|
|
1889
|
+
"custom.invalid": "Werte der eigenen Strategie sind ungültig.",
|
|
1890
|
+
"savings.title": "Einsparungen (dieser Prozess)",
|
|
1891
|
+
"savings.netExact": "Netto gespeichert (exakte Basis)",
|
|
1892
|
+
"savings.netEstimated": "Netto gespeichert (geschätzte Basis)",
|
|
1893
|
+
"savings.gross": "Brutto gespeichert (bei Veröffentlichung)",
|
|
1894
|
+
"savings.offsets": "Abschläge (komprimiert, später vollständig gelesen)",
|
|
1895
|
+
"savings.empty": "Noch keine Komprimierung — Nettoeinsparungen erscheinen nach der ersten Reduktion.",
|
|
1896
|
+
"savings.basisExact": "exakt",
|
|
1897
|
+
"savings.basisEstimated": "geschätzt",
|
|
1898
|
+
"savings.basisNote": "Basen werden getrennt ausgewiesen, nie gemischt: exakt = DeepSeek-Tokenizer; geschätzt = chars/4. Erst Skelett, dann Volltext zählt als negative Einsparung (Netto kann unter null fallen).",
|
|
1899
|
+
"savings.requests": "Requests",
|
|
1900
|
+
"savings.cacheHit": "Cache hit rate",
|
|
1901
|
+
"savings.actualCost": "Actual cost (official prices)",
|
|
1902
|
+
"savings.savedMoney": "Estimated saved cost (input price)",
|
|
1903
|
+
"savings.perSession": "Session"
|
|
1477
1904
|
};
|
|
1478
1905
|
//#endregion
|
|
1479
1906
|
//#region src/client/locales/es.ts
|
|
@@ -1541,6 +1968,34 @@ window.__ModuleLoader__.load({
|
|
|
1541
1968
|
"codeSkeleton.enabled": "Compresión de esqueleto del código",
|
|
1542
1969
|
"codeSkeleton.enabled.on": "Activado",
|
|
1543
1970
|
"codeSkeleton.enabled.off": "Desactivado (predeterminado)",
|
|
1971
|
+
"intentSummary.title": "Resumen de intención al cierre del turno",
|
|
1972
|
+
"intentSummary.description": "Al activarlo, el postflight de cierre de turno pliega el incremento consumido en bloques de resumen de intención por rol semántico: los resultados de herramientas de lectura se convierten en registros de una línea con objetivo/escala y los de escritura conservan la cabecera de esqueleto más las líneas de error textuales; aterriza en la siguiente ronda de presión por el conducto de plegado normal. Solo se dispara si se supera la puerta de crecimiento (superficie activa >45 % y >50K tokens desde el último plegado). Aplica a sesiones nuevas; la actual se gobierna con /ctx-summary off|on|status.",
|
|
1973
|
+
"intentSummary.enabled": "Resumen de intención al cierre",
|
|
1974
|
+
"intentSummary.enabled.on": "Sí",
|
|
1975
|
+
"intentSummary.enabled.off": "No (predeterminado)",
|
|
1976
|
+
"monitor.fab.title": "Monitor de compresión",
|
|
1977
|
+
"monitor.panel.title": "Monitor de compresión",
|
|
1978
|
+
"monitor.panel.net": "Ahorro neto",
|
|
1979
|
+
"monitor.panel.gross": "Ahorro bruto",
|
|
1980
|
+
"monitor.panel.offsets": "Compensaciones",
|
|
1981
|
+
"monitor.panel.context": "Ocupación del contexto",
|
|
1982
|
+
"monitor.panel.suggest": "La ocupación del contexto alcanzó el {pct} % — cerca de la zona de olvido catastrófico; se recomienda comprimir o recortar el historial",
|
|
1983
|
+
"monitor.panel.cacheHit": "Tasa de acierto de caché",
|
|
1984
|
+
"monitor.panel.cost": "Coste (real / ahorro est.)",
|
|
1985
|
+
"monitor.panel.intent": "Resumen de intención",
|
|
1986
|
+
"monitor.panel.overrideHint": "Invalidación de sesión",
|
|
1987
|
+
"monitor.panel.resume": "Reanudar",
|
|
1988
|
+
"monitor.panel.disable": "Desactivar",
|
|
1989
|
+
"monitor.panel.stateOn": "sí",
|
|
1990
|
+
"monitor.panel.stateOff": "no",
|
|
1991
|
+
"monitor.panel.gateUnknown": "aún sin evaluar",
|
|
1992
|
+
"monitor.panel.lastFold": "Último plegado",
|
|
1993
|
+
"monitor.panel.stale": "Instantánea inalcanzable — se muestran los últimos datos",
|
|
1994
|
+
"monitorPanel.title": "Panel de monitor de compresión",
|
|
1995
|
+
"monitorPanel.description": "Al activarlo, junto al área de entrada aparece una burbuja flotante arrastrable — ábrela para observar el estado de compresión en vivo: ahorro neto (base exacta), tasa de acierto de caché, estimación de coste, la puerta de resumen de intención del turno y compensaciones recientes. El panel puede invalidar temporalmente el interruptor de resumen de intención de la sesión actual. El libro es por proceso (se reinicia al rearrancar el host).",
|
|
1996
|
+
"monitorPanel.enabled": "Panel de monitor",
|
|
1997
|
+
"monitorPanel.enabled.on": "Sí",
|
|
1998
|
+
"monitorPanel.enabled.off": "No (predeterminado)",
|
|
1544
1999
|
"custom.title": "Política personalizada",
|
|
1545
2000
|
"custom.settingsHint": "Edita los parámetros detallados en Ajustes > Selector de compresión de contexto.",
|
|
1546
2001
|
"custom.sessionScope": "Los cambios guardados se aplican cuando el runtime de compresión actual observa una Session por primera vez. Una Session ya observada por ese runtime conserva su política congelada.",
|
|
@@ -1571,7 +2026,21 @@ window.__ModuleLoader__.load({
|
|
|
1571
2026
|
"custom.tailTrim.warning": "TailTrim requiere el tokenizador exacto y sustituye como máximo un grupo completo, terminado y sin errores compuesto solo por herramientas por una referencia recuperable. Comparte con History las llamadas a herramientas recientes protegidas, la cola reciente de resultados de herramientas protegida y la recuperación mínima. Reescribe un prefijo enviado y puede reducir los aciertos de caché.",
|
|
1572
2027
|
"custom.save": "Guardar la política personalizada",
|
|
1573
2028
|
"custom.reset": "Restablecer la política personalizada",
|
|
1574
|
-
"custom.invalid": "Los valores de la política personalizada no son válidos."
|
|
2029
|
+
"custom.invalid": "Los valores de la política personalizada no son válidos.",
|
|
2030
|
+
"savings.title": "Ahorro (este proceso)",
|
|
2031
|
+
"savings.netExact": "Ahorro neto (base exacta)",
|
|
2032
|
+
"savings.netEstimated": "Ahorro neto (base estimada)",
|
|
2033
|
+
"savings.gross": "Ahorro bruto (al publicar)",
|
|
2034
|
+
"savings.offsets": "Compensaciones (contenido comprimido y luego releído completo)",
|
|
2035
|
+
"savings.empty": "Aún sin compresión: el ahorro neto aparece tras la primera reducción.",
|
|
2036
|
+
"savings.basisExact": "exacta",
|
|
2037
|
+
"savings.basisEstimated": "estimada",
|
|
2038
|
+
"savings.basisNote": "Las bases se informan por separado, nunca mezcladas: exacta = tokenizador DeepSeek; estimada = chars/4. Esqueleto seguido de lectura completa cuenta como ahorro negativo (el neto puede ser negativo).",
|
|
2039
|
+
"savings.requests": "Anfragen",
|
|
2040
|
+
"savings.cacheHit": "Cache-Trefferquote",
|
|
2041
|
+
"savings.actualCost": "Tatsächliche Kosten (offizielle Preise)",
|
|
2042
|
+
"savings.savedMoney": "Geschätzte Einsparung (Eingabepreis)",
|
|
2043
|
+
"savings.perSession": "Sitzung"
|
|
1575
2044
|
};
|
|
1576
2045
|
//#endregion
|
|
1577
2046
|
//#region src/client/locales/fr.ts
|
|
@@ -1639,6 +2108,34 @@ window.__ModuleLoader__.load({
|
|
|
1639
2108
|
"codeSkeleton.enabled": "Compression du code en squelette",
|
|
1640
2109
|
"codeSkeleton.enabled.on": "Activé",
|
|
1641
2110
|
"codeSkeleton.enabled.off": "Désactivé (par défaut)",
|
|
2111
|
+
"intentSummary.title": "Résumé d'intention en fin de tour",
|
|
2112
|
+
"intentSummary.description": "Activé, le postflight de fin de tour plie l'incrément consommé en blocs de résumé d'intention par rôle sémantique : les résultats d'outils de lecture deviennent des enregistrements une-ligne objectif/échelle, les écrits gardent la tête de squelette plus les lignes d'erreur verbatim ; l'atterrissage se fait au prochain tour de pression via le pipeline de pliage habituel. Ne se déclenche que si la porte de croissance passe (surface active >45 % et >50K tokens depuis le dernier pliage). S'applique aux nouvelles sessions ; la session courante se pilote avec /ctx-summary off|on|status.",
|
|
2113
|
+
"intentSummary.enabled": "Résumé d'intention en fin de tour",
|
|
2114
|
+
"intentSummary.enabled.on": "Activé",
|
|
2115
|
+
"intentSummary.enabled.off": "Désactivé (par défaut)",
|
|
2116
|
+
"monitor.fab.title": "Monitor de compression",
|
|
2117
|
+
"monitor.panel.title": "Monitor de compression",
|
|
2118
|
+
"monitor.panel.net": "Économie nette",
|
|
2119
|
+
"monitor.panel.gross": "Économie brute",
|
|
2120
|
+
"monitor.panel.offsets": "Compensations",
|
|
2121
|
+
"monitor.panel.context": "Occupation du contexte",
|
|
2122
|
+
"monitor.panel.suggest": "Occupation du contexte à {pct} % — zone de perte de contexte imminente ; pensez à lancer une compression ou à réduire les anciens échanges",
|
|
2123
|
+
"monitor.panel.cacheHit": "Taux de réussite du cache",
|
|
2124
|
+
"monitor.panel.cost": "Coût (réel / écon. est.)",
|
|
2125
|
+
"monitor.panel.intent": "Résumé d'intention",
|
|
2126
|
+
"monitor.panel.overrideHint": "Priorité de session",
|
|
2127
|
+
"monitor.panel.resume": "Reprendre",
|
|
2128
|
+
"monitor.panel.disable": "Désactiver",
|
|
2129
|
+
"monitor.panel.stateOn": "activé",
|
|
2130
|
+
"monitor.panel.stateOff": "désactivé",
|
|
2131
|
+
"monitor.panel.gateUnknown": "pas encore évalué",
|
|
2132
|
+
"monitor.panel.lastFold": "Dernier pliage",
|
|
2133
|
+
"monitor.panel.stale": "Instantané injoignable — dernières données",
|
|
2134
|
+
"monitorPanel.title": "Panneau de monitorage de compression",
|
|
2135
|
+
"monitorPanel.description": "Activé, une bulle flottante déplaçable apparaît près de la zone de saisie — ouvrez-la pour observer l'état de compression en direct : économie nette (base exacte), taux de réussite du cache, estimation de coût, la porte de résumé d'intention du tour et les compensations récentes. Le panneau peut contourner temporairement l'interrupteur de résumé d'intention de la session courante. Le registre est propre au processus (remis à zéro au redémarrage de l'hôte).",
|
|
2136
|
+
"monitorPanel.enabled": "Panneau de monitorage",
|
|
2137
|
+
"monitorPanel.enabled.on": "Activé",
|
|
2138
|
+
"monitorPanel.enabled.off": "Désactivé (par défaut)",
|
|
1642
2139
|
"custom.title": "Stratégie personnalisée",
|
|
1643
2140
|
"custom.settingsHint": "Modifiez les paramètres détaillés dans Réglages > Sélecteur de compression du contexte.",
|
|
1644
2141
|
"custom.sessionScope": "Les changements enregistrés s’appliquent quand le runtime de compression actuel observe une Session pour la première fois. Une Session déjà observée par ce runtime garde sa stratégie figée.",
|
|
@@ -1669,7 +2166,21 @@ window.__ModuleLoader__.load({
|
|
|
1669
2166
|
"custom.tailTrim.warning": "TailTrim exige le tokenizer exact et remplace au plus un groupe complet, terminé et sans erreur, composé uniquement d’outils, par une référence récupérable. Il partage avec History les appels d’outils récents protégés, la fin récente des résultats d’outils protégée et la récupération minimale. Il réécrit un préfixe envoyé et peut réduire les hits de cache.",
|
|
1670
2167
|
"custom.save": "Enregistrer la stratégie personnalisée",
|
|
1671
2168
|
"custom.reset": "Réinitialiser la stratégie personnalisée",
|
|
1672
|
-
"custom.invalid": "Valeurs de la stratégie personnalisée invalides."
|
|
2169
|
+
"custom.invalid": "Valeurs de la stratégie personnalisée invalides.",
|
|
2170
|
+
"savings.title": "Économies (ce processus)",
|
|
2171
|
+
"savings.netExact": "Économie nette (base exacte)",
|
|
2172
|
+
"savings.netEstimated": "Économie nette (base estimée)",
|
|
2173
|
+
"savings.gross": "Économie brute (à la publication)",
|
|
2174
|
+
"savings.offsets": "Compensations (contenu compressé puis relu intégralement)",
|
|
2175
|
+
"savings.empty": "Aucune compression pour l’instant — l’économie nette apparaît après la première réduction.",
|
|
2176
|
+
"savings.basisExact": "exacte",
|
|
2177
|
+
"savings.basisEstimated": "estimée",
|
|
2178
|
+
"savings.basisNote": "Les bases sont présentées séparément, jamais mélangées : exacte = tokenizer DeepSeek ; estimée = chars/4. Un squelette suivi d’une lecture complète compte comme économie négative (le net peut être négatif).",
|
|
2179
|
+
"savings.requests": "Solicitudes",
|
|
2180
|
+
"savings.cacheHit": "Tasa de aciertos de caché",
|
|
2181
|
+
"savings.actualCost": "Coste real (precios oficiales)",
|
|
2182
|
+
"savings.savedMoney": "Ahorro estimado (precio de entrada)",
|
|
2183
|
+
"savings.perSession": "Sesión"
|
|
1673
2184
|
};
|
|
1674
2185
|
//#endregion
|
|
1675
2186
|
//#region src/client/locales/it.ts
|
|
@@ -1737,6 +2248,34 @@ window.__ModuleLoader__.load({
|
|
|
1737
2248
|
"codeSkeleton.enabled": "Compressione a scheletro del codice",
|
|
1738
2249
|
"codeSkeleton.enabled.on": "Attivato",
|
|
1739
2250
|
"codeSkeleton.enabled.off": "Disattivato (predefinito)",
|
|
2251
|
+
"intentSummary.title": "Riepilogo di intento a fine turno",
|
|
2252
|
+
"intentSummary.description": "Quando attivo, il postflight di fine turno piega l'incremento consumato in blocchi di riepilogo di intento per ruolo semantico: i risultati degli strumenti di lettura diventano record a riga singola obiettivo/scala, quelli di scrittura mantengono la testa dello scheletro più le righe di errore testuali; atterra al prossimo round di pressione tramite la pipeline di piegatura ordinaria. Si attiva solo se la soglia di crescita passa (superficie attiva >45% e >50K token dall'ultima piegatura). Vale per le nuove sessioni; quella corrente si governa con /ctx-summary off|on|status.",
|
|
2253
|
+
"intentSummary.enabled": "Riepilogo di intento a fine turno",
|
|
2254
|
+
"intentSummary.enabled.on": "On",
|
|
2255
|
+
"intentSummary.enabled.off": "Disattivato (predefinito)",
|
|
2256
|
+
"monitorPanel.title": "Pannello di monitoraggio compressione",
|
|
2257
|
+
"monitor.fab.title": "Monitor compressione",
|
|
2258
|
+
"monitor.panel.title": "Monitor compressione",
|
|
2259
|
+
"monitor.panel.net": "Risparmio netto",
|
|
2260
|
+
"monitor.panel.gross": "Risparmio lordo",
|
|
2261
|
+
"monitor.panel.offsets": "Compensazioni",
|
|
2262
|
+
"monitor.panel.context": "Occupazione del contesto",
|
|
2263
|
+
"monitor.panel.suggest": "Occupazione del contesto al {pct}% — vicini alla zona di dimenticanza catastrofica; consigliato comprimere o tagliare la cronologia",
|
|
2264
|
+
"monitor.panel.cacheHit": "Tasso di hit della cache",
|
|
2265
|
+
"monitor.panel.cost": "Costo (effettivo / stimo)",
|
|
2266
|
+
"monitor.panel.intent": "Riepilogo di intento",
|
|
2267
|
+
"monitor.panel.overrideHint": "Override di sessione",
|
|
2268
|
+
"monitor.panel.resume": "Riprendi",
|
|
2269
|
+
"monitor.panel.disable": "Disattiva",
|
|
2270
|
+
"monitor.panel.stateOn": "on",
|
|
2271
|
+
"monitor.panel.stateOff": "off",
|
|
2272
|
+
"monitor.panel.gateUnknown": "non ancora valutato",
|
|
2273
|
+
"monitor.panel.lastFold": "Ultima piegatura",
|
|
2274
|
+
"monitor.panel.stale": "Snapshot non raggiungibile — ultimi dati",
|
|
2275
|
+
"monitorPanel.description": "Quando attivo, accanto all'area di input appare una bolla flottante trascinabile — aprila per osservare lo stato di compressione in tempo reale: risparmio netto (base esatta), tasso di hit della cache, stima dei costi, la soglia del riepilogo di intento del turno e le compensazioni recenti. Il pannello può ignorare temporaneamente l'interruttore del riepilogo di intento della sessione corrente. Il registro è per processo (azzerato al riavvio dell'host).",
|
|
2276
|
+
"monitorPanel.enabled": "Pannello di monitoraggio",
|
|
2277
|
+
"monitorPanel.enabled.on": "On",
|
|
2278
|
+
"monitorPanel.enabled.off": "Off (predefinito)",
|
|
1740
2279
|
"custom.title": "Politica personalizzata",
|
|
1741
2280
|
"custom.settingsHint": "Modifica i parametri dettagliati in Impostazioni > Selettore di compressione del contesto.",
|
|
1742
2281
|
"custom.sessionScope": "Le modifiche salvate si applicano quando l’attuale runtime di compressione osserva una Sessione per la prima volta. Una Sessione già osservata da quel runtime mantiene la sua politica congelata.",
|
|
@@ -1767,7 +2306,21 @@ window.__ModuleLoader__.load({
|
|
|
1767
2306
|
"custom.tailTrim.warning": "TailTrim richiede il tokenizer esatto e sostituisce al massimo un gruppo completo, concluso e senza errori composto solo da tool con un riferimento recuperabile. Condivide con History le chiamate ai tool recenti protette, la coda recente dei risultati dei tool protetta e il recupero minimo. Riscrive un prefisso inviato e può ridurre i hit della cache.",
|
|
1768
2307
|
"custom.save": "Salva la politica personalizzata",
|
|
1769
2308
|
"custom.reset": "Reimposta la politica personalizzata",
|
|
1770
|
-
"custom.invalid": "I valori della politica personalizzata non sono validi."
|
|
2309
|
+
"custom.invalid": "I valori della politica personalizzata non sono validi.",
|
|
2310
|
+
"savings.title": "Risparmi (questo processo)",
|
|
2311
|
+
"savings.netExact": "Risparmio netto (base esatta)",
|
|
2312
|
+
"savings.netEstimated": "Risparmio netto (base stimata)",
|
|
2313
|
+
"savings.gross": "Risparmio lordo (alla pubblicazione)",
|
|
2314
|
+
"savings.offsets": "Compensazioni (contenuto compresso e poi riletto per intero)",
|
|
2315
|
+
"savings.empty": "Nessuna compressione — il risparmio netto appare dopo la prima riduzione.",
|
|
2316
|
+
"savings.basisExact": "esatta",
|
|
2317
|
+
"savings.basisEstimated": "stimata",
|
|
2318
|
+
"savings.basisNote": "Le basi sono riportate separatamente, mai miste: esatta = tokenizer DeepSeek; stimata = chars/4. Uno scheletro seguito dalla lettura completa conta come risparmio negativo (il netto può scendere sotto zero).",
|
|
2319
|
+
"savings.requests": "Requêtes",
|
|
2320
|
+
"savings.cacheHit": "Taux de cache",
|
|
2321
|
+
"savings.actualCost": "Coût réel (tarifs officiels)",
|
|
2322
|
+
"savings.savedMoney": "Économie estimée (prix d’entrée)",
|
|
2323
|
+
"savings.perSession": "Session"
|
|
1771
2324
|
};
|
|
1772
2325
|
//#endregion
|
|
1773
2326
|
//#region src/client/locales/ja.ts
|
|
@@ -1835,6 +2388,34 @@ window.__ModuleLoader__.load({
|
|
|
1835
2388
|
"codeSkeleton.enabled": "コードスケルトン圧縮",
|
|
1836
2389
|
"codeSkeleton.enabled.on": "オン",
|
|
1837
2390
|
"codeSkeleton.enabled.off": "オフ(既定)",
|
|
2391
|
+
"intentSummary.title": "ターン末尾インテント要約",
|
|
2392
|
+
"intentSummary.description": "有効にすると、ターン境界のポストフライトが消費済み増分を意味役割ごとにインテント要約ブロックへ折り畳みます。読み系ツール結果は目標/規模の 1 行レコードに、書き系は骨格ヘッダーと逐語エラー行を保持し、次の圧力ラウンドで通常の折り畳みパイプラインを通じて着地します。成長ゲート(ライブ表面 >45%、前回の折り畳みから >50K トークン増)を通過したときだけ発火します。変更は新セッションに適用され、現セッションは /ctx-summary off|on|status で上書きできます。",
|
|
2393
|
+
"intentSummary.enabled": "ターン末尾インテント要約",
|
|
2394
|
+
"intentSummary.enabled.on": "オン",
|
|
2395
|
+
"intentSummary.enabled.off": "オフ(既定)",
|
|
2396
|
+
"monitor.fab.title": "圧縮モニター",
|
|
2397
|
+
"monitor.panel.title": "圧縮モニター",
|
|
2398
|
+
"monitor.panel.net": "正味節約",
|
|
2399
|
+
"monitor.panel.gross": "総節約",
|
|
2400
|
+
"monitor.panel.offsets": "相殺",
|
|
2401
|
+
"monitor.panel.context": "コンテキスト占有",
|
|
2402
|
+
"monitor.panel.suggest": "コンテキスト占有が {pct}% に達しました——壊滅的忘却ゾーンに近づいています。圧縮または履歴の削減を推奨",
|
|
2403
|
+
"monitor.panel.cacheHit": "キャッシュ ヒット率",
|
|
2404
|
+
"monitor.panel.cost": "コスト(実績 / 節約概算)",
|
|
2405
|
+
"monitor.panel.intent": "インテント要約",
|
|
2406
|
+
"monitor.panel.overrideHint": "セッション上書き",
|
|
2407
|
+
"monitor.panel.resume": "再開",
|
|
2408
|
+
"monitor.panel.disable": "停止",
|
|
2409
|
+
"monitor.panel.stateOn": "オン",
|
|
2410
|
+
"monitor.panel.stateOff": "オフ",
|
|
2411
|
+
"monitor.panel.gateUnknown": "未評価",
|
|
2412
|
+
"monitor.panel.lastFold": "最後の折り畳み",
|
|
2413
|
+
"monitor.panel.stale": "スナップショット到達不能——前回データを表示",
|
|
2414
|
+
"monitorPanel.title": "圧縮モニター パネル",
|
|
2415
|
+
"monitorPanel.description": "有効にすると、入力欄のそばにドラッグできるフローティング バブルが現れます。開くとライブの圧縮状態を監視できます。正味節約(正確 basis)、キャッシュ ヒット率、コスト概算、ターン末尾インテント要約ゲート、最近の相殺。パネルから現セッションのインテント要約スイッチを一時的に上書きできます。台帳はプロセス単位(ホスト再起動でリセット)。",
|
|
2416
|
+
"monitorPanel.enabled": "モニター パネル",
|
|
2417
|
+
"monitorPanel.enabled.on": "オン",
|
|
2418
|
+
"monitorPanel.enabled.off": "オフ(既定)",
|
|
1838
2419
|
"custom.title": "カスタムポリシー",
|
|
1839
2420
|
"custom.settingsHint": "詳細パラメーターは「設定 > コンテキスト圧縮セレクター」で編集してください。",
|
|
1840
2421
|
"custom.sessionScope": "保存した変更は、現在の圧縮ランタイムが次に Session を初めて観測したときに適用されます。そのランタイムに既に観測された Session は凍結済みポリシーを使い続けます。",
|
|
@@ -1865,7 +2446,21 @@ window.__ModuleLoader__.load({
|
|
|
1865
2446
|
"custom.tailTrim.warning": "TailTrim は正確なトークナイザーが必要で、完全で終了済みかつエラーでないツールのみのグループを 1 つだけ回復可能な参照へ置き換えます。History と「保護する直近ツール呼び出し数」「保護するツール結果テール」「最小回収量」を共有します。送信済みプレフィックスを書き換えるため、キャッシュ命中が下がる可能性があります。",
|
|
1866
2447
|
"custom.save": "カスタムポリシーを保存",
|
|
1867
2448
|
"custom.reset": "カスタムポリシーをリセット",
|
|
1868
|
-
"custom.invalid": "カスタムポリシーの値が不正です。"
|
|
2449
|
+
"custom.invalid": "カスタムポリシーの値が不正です。",
|
|
2450
|
+
"savings.title": "節約統計(このプロセス)",
|
|
2451
|
+
"savings.netExact": "純節約(正確口径)",
|
|
2452
|
+
"savings.netEstimated": "純節約(推定口径)",
|
|
2453
|
+
"savings.gross": "総節約(圧縮確定時)",
|
|
2454
|
+
"savings.offsets": "相殺(圧縮後に全文再読)",
|
|
2455
|
+
"savings.empty": "まだ圧縮がありません。最初の削減後に純節約が表示されます。",
|
|
2456
|
+
"savings.basisExact": "正確",
|
|
2457
|
+
"savings.basisEstimated": "推定",
|
|
2458
|
+
"savings.basisNote": "口径は分列し混算しません:正確 = DeepSeek トークナイザー、推定 = chars/4。スケルトン後に全文を読むと負の節約として計上されます(純額はマイナスになり得ます)。",
|
|
2459
|
+
"savings.requests": "Richieste",
|
|
2460
|
+
"savings.cacheHit": "Tasso di cache",
|
|
2461
|
+
"savings.actualCost": "Costo reale (prezzi ufficiali)",
|
|
2462
|
+
"savings.savedMoney": "Risparmio stimato (prezzo di input)",
|
|
2463
|
+
"savings.perSession": "Sessione"
|
|
1869
2464
|
};
|
|
1870
2465
|
//#endregion
|
|
1871
2466
|
//#region src/client/locales/ko.ts
|
|
@@ -1933,6 +2528,34 @@ window.__ModuleLoader__.load({
|
|
|
1933
2528
|
"codeSkeleton.enabled": "코드 스켈레톤 압축",
|
|
1934
2529
|
"codeSkeleton.enabled.on": "켬",
|
|
1935
2530
|
"codeSkeleton.enabled.off": "끔(기본값)",
|
|
2531
|
+
"intentSummary.title": "턴 말머리 인텐트 요약",
|
|
2532
|
+
"intentSummary.description": "켜면 턴 경계 포스트플라이트가 소비된 증분을 의미 역할별 인텐트 요약 블록으로 접습니다. 읽기 도구 결과는 목표/규모 한 줄 레코드가 되고 쓰기는 골격 헤더와 원문 오류 줄을 유지하며, 다음 압력 라운드에서 기존 접기 파이프라인을 통해 착지합니다. 성장 게이트(라이브 표면 >45%, 마지막 접기 이후 >50K 토큰 증가)를 통과할 때만 발동합니다. 새 세션에 적용되며, 현재 세션은 /ctx-summary off|on|status 로 임시 전환할 수 있습니다.",
|
|
2533
|
+
"intentSummary.enabled": "턴 말머리 인텐트 요약",
|
|
2534
|
+
"intentSummary.enabled.on": "켜기",
|
|
2535
|
+
"intentSummary.enabled.off": "끔(기본값)",
|
|
2536
|
+
"monitor.fab.title": "압축 모니터",
|
|
2537
|
+
"monitor.panel.title": "압축 모니터",
|
|
2538
|
+
"monitor.panel.net": "순 절감",
|
|
2539
|
+
"monitor.panel.gross": "총 절감",
|
|
2540
|
+
"monitor.panel.offsets": "상쇄",
|
|
2541
|
+
"monitor.panel.context": "컨텍스트 점유",
|
|
2542
|
+
"monitor.panel.suggest": "컨텍스트 점유가 {pct}%에 도달——치명적 망각 구간에 근접, 압축이나 기록 정리를 권장",
|
|
2543
|
+
"monitor.panel.cacheHit": "캐시 적중률",
|
|
2544
|
+
"monitor.panel.cost": "비용 (실제 / 절감 추정)",
|
|
2545
|
+
"monitor.panel.intent": "인텐트 요약",
|
|
2546
|
+
"monitor.panel.overrideHint": "세션 재정의",
|
|
2547
|
+
"monitor.panel.resume": "재개",
|
|
2548
|
+
"monitor.panel.disable": "중지",
|
|
2549
|
+
"monitor.panel.stateOn": "켬",
|
|
2550
|
+
"monitor.panel.stateOff": "끔",
|
|
2551
|
+
"monitor.panel.gateUnknown": "아직 평가 안 됨",
|
|
2552
|
+
"monitor.panel.lastFold": "마지막 접기",
|
|
2553
|
+
"monitor.panel.stale": "스냅샷 도달 불가——이전 데이터 표시",
|
|
2554
|
+
"monitorPanel.title": "압축 모니터 패널",
|
|
2555
|
+
"monitorPanel.description": "켜면 입력 영역 옆에 드래그 가능한 플로팅 버블이 나타납니다. 열면 라이브 압축 상태를 볼 수 있습니다. 순 절감(정확 기준), 캐시 적중률, 비용 추정, 턴 말머리 인텐트 요약 게이트, 최근 상쇄. 패널에서 현재 세션의 인텐트 요약 스위치를 임시로 전환할 수 있습니다. 장부는 프로세스 단위(호스트 재시작 시 초기화).",
|
|
2556
|
+
"monitorPanel.enabled": "모니터 패널",
|
|
2557
|
+
"monitorPanel.enabled.on": "켜기",
|
|
2558
|
+
"monitorPanel.enabled.off": "끄기(기본)",
|
|
1936
2559
|
"custom.title": "커스텀 정책",
|
|
1937
2560
|
"custom.settingsHint": "세부 파라미터는 「설정 > 컨텍스트 압축 셀렉터」에서 편집하세요.",
|
|
1938
2561
|
"custom.sessionScope": "저장된 변경 사항은 현재 압축 런타임이 Session을 처음 관측하는 시점에 적용됩니다. 해당 런타임이 이미 관측한 Session은 동결된 정책을 계속 사용합니다.",
|
|
@@ -1963,7 +2586,21 @@ window.__ModuleLoader__.load({
|
|
|
1963
2586
|
"custom.tailTrim.warning": "TailTrim은 정확한 토크나이저를 필요로 하며, 완결되고 오류 없는 도구 전용 그룹 하나를 복구 가능한 참조로 대체합니다. History와 「보호하는 최근 도구 호출 수」「보호하는 도구 결과 테일」「최소 회수량」을 공유합니다. 전송 접두사를 재작성하므로 캐시 적중이 낮아질 수 있습니다.",
|
|
1964
2587
|
"custom.save": "커스텀 정책 저장",
|
|
1965
2588
|
"custom.reset": "커스텀 정책 초기화",
|
|
1966
|
-
"custom.invalid": "커스텀 정책 값이 올바르지 않습니다."
|
|
2589
|
+
"custom.invalid": "커스텀 정책 값이 올바르지 않습니다.",
|
|
2590
|
+
"savings.title": "절감 통계(이 프로세스)",
|
|
2591
|
+
"savings.netExact": "순 절감(정확 기준)",
|
|
2592
|
+
"savings.netEstimated": "순 절감(추정 기준)",
|
|
2593
|
+
"savings.gross": "총 절감(게시 시점)",
|
|
2594
|
+
"savings.offsets": "상쇄(압축 후 전체 재판돈)",
|
|
2595
|
+
"savings.empty": "아직 압축이 없습니다. 첫 번째 축소 후 순 절감이 표시됩니다.",
|
|
2596
|
+
"savings.basisExact": "정확",
|
|
2597
|
+
"savings.basisEstimated": "추정",
|
|
2598
|
+
"savings.basisNote": "기준은 분리 표기하며 혼합하지 않습니다: 정확 = DeepSeek 토크나이저, 추정 = chars/4. 스켈레톤 후 전체 판독은 음의 절감으로 계산됩니다(순액은 마이너스 가능).",
|
|
2599
|
+
"savings.requests": "リクエスト数",
|
|
2600
|
+
"savings.cacheHit": "キャッシュ ヒット率",
|
|
2601
|
+
"savings.actualCost": "実際コスト(公式価格)",
|
|
2602
|
+
"savings.savedMoney": "推定節約額(入力価格)",
|
|
2603
|
+
"savings.perSession": "セッション"
|
|
1967
2604
|
};
|
|
1968
2605
|
//#endregion
|
|
1969
2606
|
//#region src/client/locales/ru.ts
|
|
@@ -2031,6 +2668,34 @@ window.__ModuleLoader__.load({
|
|
|
2031
2668
|
"codeSkeleton.enabled": "Скелетное сжатие кода",
|
|
2032
2669
|
"codeSkeleton.enabled.on": "Вкл",
|
|
2033
2670
|
"codeSkeleton.enabled.off": "Выкл (по умолчанию)",
|
|
2671
|
+
"intentSummary.title": "Итог намерения в конце хода",
|
|
2672
|
+
"intentSummary.description": "При включении постфлайт на границе хода сворачивает потреблённый прирост в блоки итогов намерения по семантическим ролям: результаты читающих инструментов становятся однострочными записями цель/масштаб, пишущие сохраняют заголовок скелета и дословные строки ошибок; приземляется в следующем раунде давления через обычный конвейер свёртки. Срабатывает только при прохождении шлюза роста (активная поверхность >45% и >50K токенов с последней свёртки). Действует на новые сессии; текущую можно переключить командой /ctx-summary off|on|status.",
|
|
2673
|
+
"intentSummary.enabled": "Итог намерения в конце хода",
|
|
2674
|
+
"intentSummary.enabled.on": "Вкл",
|
|
2675
|
+
"intentSummary.enabled.off": "Выкл (по умолчанию)",
|
|
2676
|
+
"monitor.fab.title": "Монитор сжатия",
|
|
2677
|
+
"monitor.panel.title": "Монитор сжатия",
|
|
2678
|
+
"monitor.panel.net": "Чистая экономия",
|
|
2679
|
+
"monitor.panel.gross": "Валовая экономия",
|
|
2680
|
+
"monitor.panel.offsets": "Компенсации",
|
|
2681
|
+
"monitor.panel.context": "Заполнение контекста",
|
|
2682
|
+
"monitor.panel.suggest": "Заполнение контекста достигло {pct}% — близко к зоне катастрофического забывания; рекомендуется сжать или обрезать историю",
|
|
2683
|
+
"monitor.panel.cacheHit": "Процент попаданий кэша",
|
|
2684
|
+
"monitor.panel.cost": "Стоимость (факт / эконом. оценка)",
|
|
2685
|
+
"monitor.panel.intent": "Итог намерения",
|
|
2686
|
+
"monitor.panel.overrideHint": "Приоритет сессии",
|
|
2687
|
+
"monitor.panel.resume": "Возобновить",
|
|
2688
|
+
"monitor.panel.disable": "Отключить",
|
|
2689
|
+
"monitor.panel.stateOn": "вкл",
|
|
2690
|
+
"monitor.panel.stateOff": "выкл",
|
|
2691
|
+
"monitor.panel.gateUnknown": "ещё не оценено",
|
|
2692
|
+
"monitor.panel.lastFold": "Последняя свёртка",
|
|
2693
|
+
"monitor.panel.stale": "Снимок недоступен — показаны последние данные",
|
|
2694
|
+
"monitorPanel.title": "Панель мониторинга сжатия",
|
|
2695
|
+
"monitorPanel.description": "При включении рядом с областью ввода появляется перетаскиваемый плавающий шарик — откройте его, чтобы следить за состоянием сжатия в реальном времени: чистая экономия (точная база), процент попаданий кэша, оценка стоимости, шлюз итогов намерения хода и последние компенсации. Панель может временно переключить тумблер итогов намерения текущей сессии. Реестр живёт в процессе (обнуляется при перезапуске хоста).",
|
|
2696
|
+
"monitorPanel.enabled": "Панель мониторинга",
|
|
2697
|
+
"monitorPanel.enabled.on": "Вкл",
|
|
2698
|
+
"monitorPanel.enabled.off": "Выкл (по умолчанию)",
|
|
2034
2699
|
"custom.title": "Пользовательская стратегия",
|
|
2035
2700
|
"custom.settingsHint": "Подробные параметры — в «Настройки > Выбор сжатия контекста».",
|
|
2036
2701
|
"custom.sessionScope": "Сохранённые изменения применяются, когда текущий runtime сжатия впервые наблюдает Session. Session, уже наблюдаемая этим runtime, сохраняет свою замороженную стратегию.",
|
|
@@ -2061,7 +2726,21 @@ window.__ModuleLoader__.load({
|
|
|
2061
2726
|
"custom.tailTrim.warning": "TailTrim требует точный токенизатор и заменяет максимум одну полную, завершённую, без ошибок группу только из инструментов на восстанавливаемую ссылку. Он использует общие с History защищённые недавние вызовы инструментов, защищённый недавний хвост результатов инструментов и минимальное освобождение. Он переписывает отправленный префикс и может снизить попадания в кэш.",
|
|
2062
2727
|
"custom.save": "Сохранить пользовательскую стратегию",
|
|
2063
2728
|
"custom.reset": "Сбросить пользовательскую стратегию",
|
|
2064
|
-
"custom.invalid": "Значения пользовательской стратегии недопустимы."
|
|
2729
|
+
"custom.invalid": "Значения пользовательской стратегии недопустимы.",
|
|
2730
|
+
"savings.title": "Экономия (этот процесс)",
|
|
2731
|
+
"savings.netExact": "Чистая экономия (точная база)",
|
|
2732
|
+
"savings.netEstimated": "Чистая экономия (оценочная база)",
|
|
2733
|
+
"savings.gross": "Валовая экономия (при публикации)",
|
|
2734
|
+
"savings.offsets": "Компенсации (сжатый контент затем прочитан полностью)",
|
|
2735
|
+
"savings.empty": "Сжатия пока не было — чистая экономия появится после первого сокращения.",
|
|
2736
|
+
"savings.basisExact": "точно",
|
|
2737
|
+
"savings.basisEstimated": "оценка",
|
|
2738
|
+
"savings.basisNote": "Базы приводятся раздельно и не смешиваются: точно = токенизатор DeepSeek; оценка = chars/4. Скелет с последующим полным чтением учитывается как отрицательная экономия (чистая может уйти в минус).",
|
|
2739
|
+
"savings.requests": "요청 수",
|
|
2740
|
+
"savings.cacheHit": "캐시 적중률",
|
|
2741
|
+
"savings.actualCost": "실제 비용(공식 가격)",
|
|
2742
|
+
"savings.savedMoney": "추정 절감액(입력 가격)",
|
|
2743
|
+
"savings.perSession": "세션"
|
|
2065
2744
|
};
|
|
2066
2745
|
//#endregion
|
|
2067
2746
|
//#region src/client/preset-options.ts
|
|
@@ -2140,6 +2819,280 @@ window.__ModuleLoader__.load({
|
|
|
2140
2819
|
});
|
|
2141
2820
|
}
|
|
2142
2821
|
//#endregion
|
|
2822
|
+
//#region src/client/monitor-fab.ts
|
|
2823
|
+
/**
|
|
2824
|
+
* 压缩监控浮动球 + 面板(task: cci-monitor-fab;骨架整编自 pm 撤下的
|
|
2825
|
+
* `longtask-fab.ts` — d29bcb1^, VANILLA DOM overlay 模式: FAB + 面板
|
|
2826
|
+
* appendChild 到 document.body, position:fixed + JS 内联定位, Pointer Events
|
|
2827
|
+
* 拖拽 + localStorage 持久化 + 视口夹紧)。
|
|
2828
|
+
*
|
|
2829
|
+
* cci 客户端纪律:
|
|
2830
|
+
* - body 级直挂 = 幂等单例,应用生命周期存续,不做 dispose(页面刷新自然回收);
|
|
2831
|
+
* - 回声环过滤:自有节点带 `dsh-cci-parasite` 类,不参与宿主面板探测;
|
|
2832
|
+
* - 数据面: `/api/.../monitor` 忙 2s / 闲 5s 自调度轮询(savings 卡同口径),
|
|
2833
|
+
* fetch 失败静默降级 + 陈旧标记——监控面板永不打扰主流程;
|
|
2834
|
+
* - 动作面: 仅会话覆盖(POST,复用 /ctx-summary 状态机),不做压缩执行。
|
|
2835
|
+
*
|
|
2836
|
+
* 显隐: `enabledOf()`(设置文档 monitorPanel.enabled)为总闸;总闸开才显示球;
|
|
2837
|
+
* 净节省为负时「点亮」呼吸态(负节省警示)。v1 监控全会话聚合(savings 卡同
|
|
2838
|
+
* 口径),覆盖作用于默认会话;会话级绑定待 cci 有输入栏座位后另行接线。
|
|
2839
|
+
*/
|
|
2840
|
+
const FAB_ID = "dsh-cci-monitor-fab";
|
|
2841
|
+
const PANEL_ID = "dsh-cci-monitor-panel";
|
|
2842
|
+
const STYLE_ID = "dsh-cci-monitor-style";
|
|
2843
|
+
const PARASITE = "dsh-cci-parasite";
|
|
2844
|
+
const POS_KEY = "dsh.cci.monitor.pos";
|
|
2845
|
+
const num = (v) => typeof v === "number" && Number.isFinite(v) ? v : 0;
|
|
2846
|
+
function initMonitorFab(deps) {
|
|
2847
|
+
if (document.getElementById(FAB_ID) !== null) return;
|
|
2848
|
+
const { t } = deps;
|
|
2849
|
+
const style = document.createElement("style");
|
|
2850
|
+
style.id = STYLE_ID;
|
|
2851
|
+
style.textContent = `
|
|
2852
|
+
#${FAB_ID} { position: fixed; z-index: 9999; width: 42px; height: 42px; border-radius: 50%;
|
|
2853
|
+
background: rgba(30,30,32,.72); backdrop-filter: blur(22px) saturate(180%);
|
|
2854
|
+
border: 1px solid rgba(255,255,255,.14); box-shadow: 0 8px 24px rgba(0,0,0,.4);
|
|
2855
|
+
color: #f5f5f7; font-size: 18px; line-height: 40px; text-align: center; cursor: grab;
|
|
2856
|
+
touch-action: none; user-select: none; display: none; transition: transform .18s; }
|
|
2857
|
+
#${FAB_ID}:hover { transform: scale(1.08); }
|
|
2858
|
+
#${FAB_ID}.lit { display: block; box-shadow: 0 0 0 5px rgba(255,159,10,.28), 0 8px 24px rgba(0,0,0,.4);
|
|
2859
|
+
animation: dsh-cci-mon-breathe 2.4s ease-in-out infinite; }
|
|
2860
|
+
@keyframes dsh-cci-mon-breathe { 0%,100% { box-shadow: 0 0 0 4px rgba(255,159,10,.18), 0 8px 24px rgba(0,0,0,.4); }
|
|
2861
|
+
50% { box-shadow: 0 0 0 8px rgba(255,159,10,.32), 0 8px 24px rgba(0,0,0,.4); } }
|
|
2862
|
+
#${PANEL_ID} { position: fixed; z-index: 9998; width: 336px; border-radius: 14px;
|
|
2863
|
+
background: rgba(28,28,30,.78); backdrop-filter: blur(26px) saturate(180%);
|
|
2864
|
+
border: 1px solid rgba(255,255,255,.12); box-shadow: 0 14px 44px rgba(0,0,0,.55);
|
|
2865
|
+
color: #f5f5f7; font-size: 12.5px; opacity: 0; pointer-events: none;
|
|
2866
|
+
transform: translateY(10px) scale(.92); transform-origin: 88% 100%;
|
|
2867
|
+
transition: opacity .22s cubic-bezier(.16,.8,.3,1.05), transform .22s cubic-bezier(.16,.8,.3,1.1); }
|
|
2868
|
+
#${PANEL_ID}.open { opacity: 1; pointer-events: auto; transform: none; }
|
|
2869
|
+
#${PANEL_ID} h4 { margin: 0; padding: 10px 14px 8px; font-size: 13px; cursor: grab;
|
|
2870
|
+
touch-action: none; user-select: none; border-bottom: 1px solid rgba(255,255,255,.09); }
|
|
2871
|
+
#${PANEL_ID} .row { display: flex; align-items: center; gap: 8px; padding: 6px 14px; }
|
|
2872
|
+
#${PANEL_ID} .row.label { width: 108px; flex: none; color: rgba(245,245,247,.55); }
|
|
2873
|
+
#${PANEL_ID} .muted { color: rgba(245,245,247,.55); }
|
|
2874
|
+
#${PANEL_ID} .neg { color: #ff9f0a; }
|
|
2875
|
+
#${PANEL_ID} button { font: inherit; border-radius: 8px; border: 1px solid rgba(255,255,255,.18);
|
|
2876
|
+
background: rgba(10,132,255,.85); color: #fff; padding: 4px 10px; cursor: pointer; }
|
|
2877
|
+
#${PANEL_ID} button.ghost { background: transparent; }
|
|
2878
|
+
#${PANEL_ID} button:disabled { opacity: .45; cursor: default; }
|
|
2879
|
+
#${PANEL_ID} .stale { padding: 4px 14px 8px; color: #ffd60a; display: none; }
|
|
2880
|
+
#${PANEL_ID} .hint { margin: 0; padding: 8px 14px; color: #ffd60a; display: none;
|
|
2881
|
+
border-bottom: 1px solid rgba(255,255,255,.09); }
|
|
2882
|
+
#${PANEL_ID} .hint.show { display: block; }
|
|
2883
|
+
#${PANEL_ID} .stale.show { display: block; }
|
|
2884
|
+
#${PANEL_ID} .recent { max-height: 132px; overflow: auto; padding: 2px 14px 8px;
|
|
2885
|
+
color: rgba(245,245,247,.8); white-space: pre-wrap; }
|
|
2886
|
+
`;
|
|
2887
|
+
document.head.appendChild(style);
|
|
2888
|
+
const fab = document.createElement("div");
|
|
2889
|
+
fab.id = FAB_ID;
|
|
2890
|
+
fab.className = PARASITE;
|
|
2891
|
+
fab.textContent = "📉";
|
|
2892
|
+
fab.title = t("monitor.fab.title");
|
|
2893
|
+
const panel = document.createElement("div");
|
|
2894
|
+
panel.id = PANEL_ID;
|
|
2895
|
+
panel.className = PARASITE;
|
|
2896
|
+
panel.hidden = true;
|
|
2897
|
+
panel.innerHTML = `
|
|
2898
|
+
<h4>${t("monitor.panel.title")}</h4>
|
|
2899
|
+
<div class="hint" data-hint></div>
|
|
2900
|
+
<div class="row"><span class="label">${t("monitor.panel.net")}</span><span data-net>–</span></div>
|
|
2901
|
+
<div class="row"><span class="label">${t("monitor.panel.gross")}</span><span data-gross class="muted">–</span></div>
|
|
2902
|
+
<div class="row"><span class="label">${t("monitor.panel.offsets")}</span><span data-offsets class="muted">–</span></div>
|
|
2903
|
+
<div class="row"><span class="label">${t("monitor.panel.context")}</span><div class="bar"><i data-ctxbar></i></div><span data-ctxpct class="muted">–</span></div>
|
|
2904
|
+
<div class="row"><span class="label">${t("monitor.panel.cacheHit")}</span><span data-cache class="muted">–</span></div>
|
|
2905
|
+
<div class="row"><span class="label">${t("monitor.panel.cost")}</span><span data-cost class="muted">–</span></div>
|
|
2906
|
+
<div class="row"><span class="label">${t("monitor.panel.intent")}</span><span data-intent class="muted">–</span></div>
|
|
2907
|
+
<div class="row"><span class="label">${t("monitor.panel.overrideHint")}</span>
|
|
2908
|
+
<button data-overon>${t("monitor.panel.resume")}</button>
|
|
2909
|
+
<button data-overoff class="ghost">${t("monitor.panel.disable")}</button></div>
|
|
2910
|
+
<div class="row muted" data-fold style="display:none"></div>
|
|
2911
|
+
<div class="stale" data-stale>${t("monitor.panel.stale")}</div>
|
|
2912
|
+
<div class="recent" data-recent></div>
|
|
2913
|
+
`;
|
|
2914
|
+
document.body.append(fab, panel);
|
|
2915
|
+
let pos;
|
|
2916
|
+
try {
|
|
2917
|
+
pos = JSON.parse(localStorage.getItem(POS_KEY) ?? "null") ?? {
|
|
2918
|
+
x: Math.max(8, window.innerWidth - 66),
|
|
2919
|
+
y: Math.max(8, Math.round(window.innerHeight * .6))
|
|
2920
|
+
};
|
|
2921
|
+
} catch {
|
|
2922
|
+
pos = {
|
|
2923
|
+
x: Math.max(8, window.innerWidth - 66),
|
|
2924
|
+
y: Math.max(8, Math.round(window.innerHeight * .6))
|
|
2925
|
+
};
|
|
2926
|
+
}
|
|
2927
|
+
const clamp = (p) => ({
|
|
2928
|
+
x: Math.max(8, Math.min(window.innerWidth - 50, p.x)),
|
|
2929
|
+
y: Math.max(8, Math.min(window.innerHeight - 50, p.y))
|
|
2930
|
+
});
|
|
2931
|
+
const place = () => {
|
|
2932
|
+
pos = clamp(pos);
|
|
2933
|
+
fab.style.left = `${pos.x}px`;
|
|
2934
|
+
fab.style.top = `${pos.y}px`;
|
|
2935
|
+
};
|
|
2936
|
+
place();
|
|
2937
|
+
window.addEventListener("resize", place);
|
|
2938
|
+
const makeDrag = (el, key) => {
|
|
2939
|
+
let active = false;
|
|
2940
|
+
let moved = false;
|
|
2941
|
+
let origin = {
|
|
2942
|
+
x: 0,
|
|
2943
|
+
y: 0
|
|
2944
|
+
};
|
|
2945
|
+
el.addEventListener("pointerdown", (e) => {
|
|
2946
|
+
active = true;
|
|
2947
|
+
moved = false;
|
|
2948
|
+
origin = {
|
|
2949
|
+
x: e.clientX,
|
|
2950
|
+
y: e.clientY
|
|
2951
|
+
};
|
|
2952
|
+
el.setPointerCapture(e.pointerId);
|
|
2953
|
+
});
|
|
2954
|
+
el.addEventListener("pointermove", (e) => {
|
|
2955
|
+
if (!active) return;
|
|
2956
|
+
const next = clamp({
|
|
2957
|
+
x: pos.x + e.clientX - origin.x,
|
|
2958
|
+
y: pos.y + e.clientY - origin.y
|
|
2959
|
+
});
|
|
2960
|
+
if (Math.abs(next.x - pos.x) > 2 || Math.abs(next.y - pos.y) > 2) moved = true;
|
|
2961
|
+
pos = key === "fab" ? next : pos;
|
|
2962
|
+
if (key === "fab") place();
|
|
2963
|
+
});
|
|
2964
|
+
el.addEventListener("pointerup", () => {
|
|
2965
|
+
active = false;
|
|
2966
|
+
if (moved && key === "fab") try {
|
|
2967
|
+
localStorage.setItem(POS_KEY, JSON.stringify(pos));
|
|
2968
|
+
} catch {}
|
|
2969
|
+
});
|
|
2970
|
+
el.addEventListener("pointercancel", () => {
|
|
2971
|
+
active = false;
|
|
2972
|
+
});
|
|
2973
|
+
};
|
|
2974
|
+
let suppressClick = false;
|
|
2975
|
+
makeDrag(fab, "fab");
|
|
2976
|
+
let open = false;
|
|
2977
|
+
fab.addEventListener("click", () => {
|
|
2978
|
+
if (suppressClick) {
|
|
2979
|
+
suppressClick = false;
|
|
2980
|
+
return;
|
|
2981
|
+
}
|
|
2982
|
+
open = !open;
|
|
2983
|
+
if (open) {
|
|
2984
|
+
panel.hidden = false;
|
|
2985
|
+
const px = Math.max(8, Math.min(window.innerWidth - 344, pos.x - 300));
|
|
2986
|
+
const py = pos.y - 300 < 8 ? pos.y + 46 : Math.max(8, pos.y - 300);
|
|
2987
|
+
panel.style.left = `${px}px`;
|
|
2988
|
+
panel.style.top = `${py}px`;
|
|
2989
|
+
panel.offsetHeight;
|
|
2990
|
+
panel.classList.add("open");
|
|
2991
|
+
} else {
|
|
2992
|
+
panel.classList.remove("open");
|
|
2993
|
+
setTimeout(() => {
|
|
2994
|
+
panel.hidden = true;
|
|
2995
|
+
}, 240);
|
|
2996
|
+
}
|
|
2997
|
+
});
|
|
2998
|
+
makeDrag(panel.querySelector("h4"), "panel");
|
|
2999
|
+
let stale = false;
|
|
3000
|
+
let busyAction = false;
|
|
3001
|
+
const fmtTokens = (n) => num(n).toLocaleString("en-US");
|
|
3002
|
+
const render = (snap) => {
|
|
3003
|
+
const net = num(snap.net?.exact) + num(snap.net?.estimated);
|
|
3004
|
+
const netEl = panel.querySelector("[data-net]");
|
|
3005
|
+
netEl.textContent = `${fmtTokens(snap.net?.exact)}${num(snap.net?.estimated) > 0 ? ` (+${fmtTokens(snap.net?.estimated)} est)` : ""}`;
|
|
3006
|
+
netEl.classList.toggle("neg", net < 0);
|
|
3007
|
+
const suggest = snap.suggestion?.suggest === true;
|
|
3008
|
+
fab.classList.toggle("lit", suggest || net < 0);
|
|
3009
|
+
const hint = panel.querySelector("[data-hint]");
|
|
3010
|
+
if (suggest) {
|
|
3011
|
+
const pct = typeof snap.suggestion?.occupancyPct === "number" ? Math.round(snap.suggestion.occupancyPct * 100) : null;
|
|
3012
|
+
hint.textContent = t("monitor.panel.suggest").replace("{pct}", String(pct ?? "–"));
|
|
3013
|
+
hint.classList.add("show");
|
|
3014
|
+
} else hint.classList.remove("show");
|
|
3015
|
+
panel.querySelector("[data-gross]").textContent = fmtTokens(snap.gross?.exact);
|
|
3016
|
+
panel.querySelector("[data-offsets]").textContent = `-${fmtTokens(snap.offsets?.exact)}`;
|
|
3017
|
+
const ctxBar = panel.querySelector("[data-ctxbar]");
|
|
3018
|
+
const ctxPct = panel.querySelector("[data-ctxpct]");
|
|
3019
|
+
const ctxPctNum = typeof snap.context?.pct === "number" ? snap.context.pct : null;
|
|
3020
|
+
if (ctxPctNum === null) {
|
|
3021
|
+
ctxBar.style.width = "0%";
|
|
3022
|
+
ctxPct.textContent = "–";
|
|
3023
|
+
} else {
|
|
3024
|
+
ctxBar.style.width = `${Math.min(100, Math.round(ctxPctNum * 100))}%`;
|
|
3025
|
+
ctxBar.parentElement?.classList.toggle("hot", ctxPctNum >= .7);
|
|
3026
|
+
ctxPct.textContent = `${Math.round(ctxPctNum * 100)}%`;
|
|
3027
|
+
}
|
|
3028
|
+
const hit = snap.usage?.cacheHitRate;
|
|
3029
|
+
panel.querySelector("[data-cache]").textContent = typeof hit === "number" ? `${Math.round(hit * 100)}%` : "–";
|
|
3030
|
+
const pricing = snap.pricing;
|
|
3031
|
+
panel.querySelector("[data-cost]").textContent = pricing?.actualCost === void 0 && pricing?.estimatedSavedCost === void 0 ? "–" : `${pricing?.actualCost ?? "–"} / -${pricing?.estimatedSavedCost ?? "–"} ${String(pricing?.currency ?? "")}`.trim();
|
|
3032
|
+
const intentEl = panel.querySelector("[data-intent]");
|
|
3033
|
+
const override = snap.intent?.override;
|
|
3034
|
+
const observed = snap.intent?.observedEnabled;
|
|
3035
|
+
intentEl.textContent = override === "on" || override === "off" ? `${t("monitor.panel.overridePrefix")} ${override === "on" ? t("monitor.panel.stateOn") : t("monitor.panel.stateOff")}` : observed === void 0 ? t("monitor.panel.gateUnknown") : observed ? t("monitor.panel.stateOn") : t("monitor.panel.stateOff");
|
|
3036
|
+
const fold = snap.intent?.lastFold;
|
|
3037
|
+
const foldEl = panel.querySelector("[data-fold]");
|
|
3038
|
+
if (fold !== void 0 && fold !== null && typeof fold === "object") {
|
|
3039
|
+
foldEl.style.display = "";
|
|
3040
|
+
foldEl.textContent = `${t("monitor.panel.lastFold")} turn ${String(fold.turn ?? "–")}, seq ${String(fold.startSeq ?? "–")}..${String(fold.endSeq ?? "–")}`;
|
|
3041
|
+
} else foldEl.style.display = "none";
|
|
3042
|
+
const recent = Array.isArray(snap.recentOffsets) ? snap.recentOffsets.slice(0, 3) : [];
|
|
3043
|
+
panel.querySelector("[data-recent]").textContent = recent.length === 0 ? t("savings.empty") : recent.map((entry) => {
|
|
3044
|
+
const e = entry;
|
|
3045
|
+
return `${String(e.component ?? "–")}: ${fmtTokens(e.tokens)}`;
|
|
3046
|
+
}).join("\n");
|
|
3047
|
+
for (const [selector, action] of [["[data-overon]", "on"], ["[data-overoff]", "off"]]) panel.querySelector(selector).disabled = busyAction || override === action;
|
|
3048
|
+
};
|
|
3049
|
+
const markStale = (isStale) => {
|
|
3050
|
+
stale = isStale;
|
|
3051
|
+
panel.querySelector("[data-stale]").classList.toggle("show", stale);
|
|
3052
|
+
};
|
|
3053
|
+
const tick = async () => {
|
|
3054
|
+
const enabled = deps.enabledOf();
|
|
3055
|
+
fab.style.display = enabled ? "block" : "none";
|
|
3056
|
+
if (!enabled) {
|
|
3057
|
+
if (open) {
|
|
3058
|
+
open = false;
|
|
3059
|
+
panel.classList.remove("open");
|
|
3060
|
+
panel.hidden = true;
|
|
3061
|
+
}
|
|
3062
|
+
setTimeout(tick, 5e3);
|
|
3063
|
+
return;
|
|
3064
|
+
}
|
|
3065
|
+
try {
|
|
3066
|
+
const snap = await deps.fetchSnapshot(deps.sessionIdOf());
|
|
3067
|
+
markStale(false);
|
|
3068
|
+
render(snap);
|
|
3069
|
+
} catch {
|
|
3070
|
+
markStale(true);
|
|
3071
|
+
}
|
|
3072
|
+
setTimeout(tick, open ? 2e3 : 5e3);
|
|
3073
|
+
};
|
|
3074
|
+
setTimeout(tick, deps.initialDelayMs ?? 1500);
|
|
3075
|
+
const wireOverride = (selector, action) => {
|
|
3076
|
+
panel.querySelector(selector)?.addEventListener("click", async () => {
|
|
3077
|
+
if (busyAction) return;
|
|
3078
|
+
busyAction = true;
|
|
3079
|
+
try {
|
|
3080
|
+
await deps.applyOverride(deps.sessionIdOf(), action);
|
|
3081
|
+
const sid = deps.sessionIdOf();
|
|
3082
|
+
const snap = await deps.fetchSnapshot(sid);
|
|
3083
|
+
markStale(false);
|
|
3084
|
+
render(snap);
|
|
3085
|
+
} catch {
|
|
3086
|
+
markStale(true);
|
|
3087
|
+
} finally {
|
|
3088
|
+
busyAction = false;
|
|
3089
|
+
}
|
|
3090
|
+
});
|
|
3091
|
+
};
|
|
3092
|
+
wireOverride("[data-overon]", "on");
|
|
3093
|
+
wireOverride("[data-overoff]", "off");
|
|
3094
|
+
}
|
|
3095
|
+
//#endregion
|
|
2143
3096
|
//#region src/client/index.ts
|
|
2144
3097
|
const inject = [
|
|
2145
3098
|
"slots",
|
|
@@ -2203,11 +3156,38 @@ window.__ModuleLoader__.load({
|
|
|
2203
3156
|
} catch (error) {
|
|
2204
3157
|
console.warn(`[dsh-context-compression-improved] locale "${language.id}" registration failed:`, error);
|
|
2205
3158
|
}
|
|
3159
|
+
const tNav = ctx.locale?.bind?.(NS) ?? ((key) => key);
|
|
3160
|
+
let readMonitorPanelEnabled = () => false;
|
|
3161
|
+
let latestSessionId;
|
|
3162
|
+
try {
|
|
3163
|
+
initMonitorFab({
|
|
3164
|
+
t: tNav,
|
|
3165
|
+
sessionIdOf: () => latestSessionId,
|
|
3166
|
+
enabledOf: () => readMonitorPanelEnabled(),
|
|
3167
|
+
fetchSnapshot: async (sessionId) => {
|
|
3168
|
+
const query = sessionId === void 0 ? "" : `?sessionId=${encodeURIComponent(sessionId)}`;
|
|
3169
|
+
const response = await fetch(`/api/dsh-context-compression-improved/monitor${query}`, { headers: { "cache-control": "no-cache" } });
|
|
3170
|
+
if (!response.ok) throw new Error(`monitor snapshot ${response.status}`);
|
|
3171
|
+
return await response.json();
|
|
3172
|
+
},
|
|
3173
|
+
applyOverride: async (sessionId, action) => {
|
|
3174
|
+
const query = sessionId === void 0 ? "" : `?sessionId=${encodeURIComponent(sessionId)}`;
|
|
3175
|
+
await fetch(`/api/dsh-context-compression-improved/monitor${query}`, {
|
|
3176
|
+
method: "POST",
|
|
3177
|
+
headers: { "content-type": "application/json" },
|
|
3178
|
+
body: JSON.stringify({ action })
|
|
3179
|
+
});
|
|
3180
|
+
}
|
|
3181
|
+
});
|
|
3182
|
+
} catch (error) {
|
|
3183
|
+
console.warn("[dsh-context-compression-improved] 监控浮动球挂载失败(不影响设置分节):", error);
|
|
3184
|
+
}
|
|
2206
3185
|
const injected = () => {
|
|
2207
3186
|
const scope = ctx.settingsScope.bind({
|
|
2208
3187
|
namespace: NS,
|
|
2209
3188
|
decode: decodeSettings
|
|
2210
3189
|
});
|
|
3190
|
+
readMonitorPanelEnabled = () => scope.getSnapshot().value?.monitorPanel?.enabled ?? false;
|
|
2211
3191
|
const writeAndConfirm = async (write, accepts) => {
|
|
2212
3192
|
const beforeRevision = scope.getSnapshot().revision;
|
|
2213
3193
|
await write();
|
|
@@ -2221,6 +3201,8 @@ window.__ModuleLoader__.load({
|
|
|
2221
3201
|
resetCustom: () => writeAndConfirm(() => scope.set("custom", structuredClone(DEFAULT_CUSTOM_COMPRESSION_POLICY)), (settings) => isCustomCompressionPolicy(settings.custom) && sameCustomPolicy(settings.custom, DEFAULT_CUSTOM_COMPRESSION_POLICY)),
|
|
2222
3202
|
saveAutoCompact: (thresholdPercent) => writeAndConfirm(() => scope.set("autoCompact", { thresholdPercent }), (settings) => settings.autoCompact.thresholdPercent === thresholdPercent),
|
|
2223
3203
|
saveCodeSkeleton: (enabled) => writeAndConfirm(() => scope.set("codeSkeleton", { enabled }), (settings) => settings.codeSkeleton.enabled === enabled),
|
|
3204
|
+
saveIntentSummary: (enabled) => writeAndConfirm(() => scope.set("intentSummary", { enabled }), (settings) => settings.intentSummary.enabled === enabled),
|
|
3205
|
+
saveMonitorPanel: (enabled) => writeAndConfirm(() => scope.set("monitorPanel", { enabled }), (settings) => settings.monitorPanel?.enabled === enabled),
|
|
2224
3206
|
savePresetOptions: (options) => {
|
|
2225
3207
|
const ops = planPresetOptionsOps(scope.getSnapshot().value?.presetOptions, options);
|
|
2226
3208
|
if (ops.length === 0) return Promise.resolve();
|
|
@@ -2240,6 +3222,19 @@ window.__ModuleLoader__.load({
|
|
|
2240
3222
|
} catch (error) {
|
|
2241
3223
|
console.warn("[dsh-context-compression-improved] settings.section 注册失败(新宿主已收编):", error);
|
|
2242
3224
|
}
|
|
3225
|
+
try {
|
|
3226
|
+
ctx.slots.inject("conversation.input.left", () => ctx.slots.register({
|
|
3227
|
+
name: "conversation.input.left",
|
|
3228
|
+
id: "context-compression-session-bind",
|
|
3229
|
+
order: 170,
|
|
3230
|
+
inject: (sessionId) => {
|
|
3231
|
+
latestSessionId = sessionId;
|
|
3232
|
+
return {};
|
|
3233
|
+
}
|
|
3234
|
+
}, () => null));
|
|
3235
|
+
} catch (error) {
|
|
3236
|
+
console.warn("[dsh-context-compression-improved] conversation.input.left 注册失败(旧宿主无该槽,浮动面板保持聚合口径):", error);
|
|
3237
|
+
}
|
|
2243
3238
|
}
|
|
2244
3239
|
//#endregion
|
|
2245
3240
|
exports.apply = apply;
|