dsh-context-compression-improved 0.9.8 → 0.9.9

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.
Files changed (68) hide show
  1. package/.agents/plans/improve/checklist.md +32 -0
  2. package/.agents/plans/improve/findings.md +102 -0
  3. package/.agents/plans/improve/spec.md +53 -0
  4. package/.agents/plans/improve/tasks.md +70 -0
  5. package/CHANGELOG.md +4 -0
  6. package/README.md +14 -2
  7. package/README.zh.md +14 -2
  8. package/package.json +1 -1
  9. package/packages/selector/dsh.plugin.json +1 -1
  10. package/packages/selector/lib/client.d.ts +16 -0
  11. package/packages/selector/lib/client.js +396 -117
  12. package/packages/selector/lib/index.js +829 -10
  13. package/packages/selector/lib/invariant.js +2 -1
  14. package/packages/selector/lib/pruner.d.ts +1 -1
  15. package/packages/selector/lib/pruner.js +77 -983
  16. package/packages/selector/lib/savings-integral.js +4515 -0
  17. package/packages/selector/lib/tail-trim.js +2 -90
  18. package/packages/selector/lib/tool-result.js +150 -0
  19. package/packages/selector/package.json +8 -4
  20. package/packages/selector/src/client/index.ts +15 -12
  21. package/packages/selector/src/client/locales/de.ts +20 -4
  22. package/packages/selector/src/client/locales/es.ts +20 -4
  23. package/packages/selector/src/client/locales/fr.ts +20 -4
  24. package/packages/selector/src/client/locales/it.ts +20 -4
  25. package/packages/selector/src/client/locales/ja.ts +20 -4
  26. package/packages/selector/src/client/locales/ko.ts +20 -4
  27. package/packages/selector/src/client/locales/ru.ts +20 -4
  28. package/packages/selector/src/client/locales.ts +40 -8
  29. package/packages/selector/src/client/monitor-fab.ts +80 -10
  30. package/packages/selector/src/client/savings-card.tsx +159 -40
  31. package/packages/selector/src/index.ts +236 -1
  32. package/packages/selector/src/pruner.ts +54 -8
  33. package/packages/selector/src/runtime/audit.ts +17 -0
  34. package/packages/selector/src/runtime/display-prefs.ts +98 -0
  35. package/packages/selector/src/runtime/monitor.ts +75 -0
  36. package/packages/selector/src/runtime/panel-command.ts +213 -0
  37. package/packages/selector/src/runtime/retrieve.ts +31 -12
  38. package/packages/selector/src/runtime/savings-integral.ts +117 -0
  39. package/packages/selector/src/runtime/savings-projection.ts +3 -0
  40. package/packages/selector/src/runtime/savings-verify.ts +446 -0
  41. package/packages/selector/src/runtime/savings.ts +122 -13
  42. package/packages/selector/src/runtime/session-file-decode.ts +523 -0
  43. package/packages/selector/src/runtime/stats-backfill.ts +541 -0
  44. package/packages/selector/src/runtime/stats-db.ts +492 -0
  45. package/packages/selector/src/runtime/stats-schema.ts +123 -0
  46. package/packages/selector/src/runtime/stats-sync.ts +302 -0
  47. package/packages/selector/tests/estimator-route-registration.host.spec.ts +7 -4
  48. package/packages/selector/tests/monitor-fab.client.spec.ts +83 -1
  49. package/packages/selector/tests/runtime/fixtures/session-v4-dump.jsonl +46 -0
  50. package/packages/selector/tests/runtime/monitor.spec.ts +53 -0
  51. package/packages/selector/tests/runtime/panel-command.spec.ts +101 -0
  52. package/packages/selector/tests/runtime/public/public-runtime.spec.ts +0 -1
  53. package/packages/selector/tests/runtime/savings-accounting.spec.ts +291 -0
  54. package/packages/selector/tests/runtime/savings-integral.spec.ts +169 -0
  55. package/packages/selector/tests/runtime/savings-verify.spec.ts +226 -0
  56. package/packages/selector/tests/runtime/session-file-decode.spec.ts +281 -0
  57. package/packages/selector/tests/runtime/stats-backfill-scheduler.spec.ts +167 -0
  58. package/packages/selector/tests/runtime/stats-backfill.spec.ts +327 -0
  59. package/packages/selector/tests/runtime/stats-db.spec.ts +361 -0
  60. package/packages/selector/tests/runtime/stats-privacy.spec.ts +55 -0
  61. package/packages/selector/tests/runtime/stats-sync.spec.ts +278 -0
  62. package/packages/selector/tests/savings-sessions.client.spec.tsx +140 -0
  63. package/packages/selector/tests/settings-seat.client.spec.ts +15 -15
  64. package/pnpm-workspace.yaml +4 -0
  65. package/scripts/verify-release.mjs +5 -2
  66. package/vitest.config.ts +8 -0
  67. package/packages/selector/lib/config.js +0 -1777
  68. package/packages/selector/lib/host-generation.js +0 -62
@@ -1,4 +1,4 @@
1
- import { r as hostGenerationSnapshot } from "./host-generation.js";
1
+ import { n as viewToolResult, s as sessionEvents, t as compressionMessageSource } from "./tool-result.js";
2
2
  //#region src/compat/llm-messages.ts
3
3
  /** Recursive `Object.freeze` over own enumerable properties (arrays included). */
4
4
  function deepFreeze(value) {
@@ -23,94 +23,6 @@ function createUserMessage(input) {
23
23
  }));
24
24
  }
25
25
  //#endregion
26
- //#region src/runtime/session-events.ts
27
- /**
28
- * Read one immutable Session event snapshot.
29
- *
30
- * Harness rc.2 exposed `events`; Alpha 5 replaced it with the public
31
- * `snapshotEvents()` method. Prefer the new API when present and retain the
32
- * old accessor as the compatibility fallback for already-supported hosts.
33
- */
34
- function sessionEvents(session) {
35
- const snapshot = session.snapshotEvents;
36
- if (typeof snapshot === "function") return snapshot.call(session);
37
- return session.events ?? [];
38
- }
39
- /**
40
- * Resolve one surface-node seq to its event. 0.1.5 surface nodes are
41
- * positional and may replace earlier ranges, so a node's seq is not
42
- * guaranteed to equal the snapshot array index: always resolve by seq.
43
- */
44
- function eventBySeq(events, seq) {
45
- return events[Number(seq)];
46
- }
47
- //#endregion
48
- //#region src/compat/tool-result.ts
49
- /**
50
- * Tool-result envelope adapter (audit N2: three-axis relocation, not a
51
- * single-axis unwrap) + legacy message-source kind escape (audit B6).
52
- *
53
- * Three-axis mapping, main's own comment as evidence
54
- * (pruner/session.ts: "0.1.7-rc.2: isError moved from the result block onto
55
- * the message itself"):
56
- *
57
- * semantics Gen D (0.1.7-rc.2+ / 0.2.0) Gen A/B/C (0.1.0–0.1.5)
58
- * content blocks message.content message.content[0].content
59
- * error location message.isError message.content[0].isError
60
- * call id message.toolCallId message.source.callId
61
- *
62
- * Every consumer must take the whole triple from viewToolResult(); touching
63
- * a single axis inline is how the isError/callId axes get silently dropped.
64
- * A strict legacy signature overrides the generation flag per message (the
65
- * 0.1.7-rc.1 envelope shape was only load-verified, not session-verified —
66
- * this makes a wrong flag self-correcting instead of silently misreading).
67
- */
68
- /** Strict signature of the enveloped (0.1.x) tool/result message. */
69
- function envelopedShape(content) {
70
- return Array.isArray(content) && content.length === 1 && typeof content[0] === "object" && content[0] !== null && content[0].type === "tool-result" && Array.isArray(content[0].content);
71
- }
72
- function viewToolResult(message, generation) {
73
- const gen = generation ?? hostGenerationSnapshot();
74
- const content = message.content;
75
- if (envelopedShape(content)) {
76
- const wrapper = content[0];
77
- return {
78
- blocks: wrapper.content,
79
- isError: wrapper.isError === true,
80
- callId: typeof message.source?.callId === "string" ? message.source.callId : void 0
81
- };
82
- }
83
- if (gen === "legacy") {
84
- const wrapper = Array.isArray(content) ? content[0] : void 0;
85
- if (wrapper && typeof wrapper === "object" && Array.isArray(wrapper.content)) return {
86
- blocks: wrapper.content,
87
- isError: wrapper.isError === true,
88
- callId: typeof message.source?.callId === "string" ? message.source.callId : void 0
89
- };
90
- }
91
- return {
92
- blocks: Array.isArray(content) ? content : [],
93
- isError: message.isError === true,
94
- callId: typeof message.toolCallId === "string" ? message.toolCallId : gen === "legacy" && typeof message.source?.callId === "string" ? message.source.callId : void 0
95
- };
96
- }
97
- /**
98
- * Per-producer source kind, generation-gated. Modern hosts accept the
99
- * producer-declared kind (declared in pruner.ts's `MessageSourceMap`
100
- * augmentation); 0.1.x hosts only know the shared `{ kind: 'plugin' }` kind
101
- * — the dev bed's dsh-llm@0.2.0-rc.1 type face has no such member (audit B6,
102
- * empirically confirmed), so the legacy object escapes through `as never`
103
- * HERE and nowhere else.
104
- */
105
- const PLUGIN_ID = "dsh-context-compression-improved";
106
- function compressionMessageSource(generation) {
107
- if ((generation ?? hostGenerationSnapshot()) === "legacy") return {
108
- kind: "plugin",
109
- plugin: PLUGIN_ID
110
- };
111
- return { kind: "dsh-context-compression" };
112
- }
113
- //#endregion
114
26
  //#region src/runtime/tail-trim.ts
115
27
  /** Plugin-owned TailTrim publication protocol over official Session events. */
116
28
  const TAIL_TRIM_REF_PATTERN = /^session:\/\/([^/]+)\/tailtrim\/(\d+)$/;
@@ -231,4 +143,4 @@ function sameNumbers(left, right) {
231
143
  return left !== void 0 && left.length === right.length && left.every((value, index) => value === right[index]);
232
144
  }
233
145
  //#endregion
234
- export { validatePublishedTailTrim as a, eventBySeq as c, freezeMessage as d, tailTrimStub as i, sessionEvents as l, tailTrimMessage as n, compressionMessageSource as o, tailTrimRef as r, viewToolResult as s, parseTailTrimRef as t, createUserMessage as u };
146
+ export { validatePublishedTailTrim as a, tailTrimStub as i, tailTrimMessage as n, createUserMessage as o, tailTrimRef as r, freezeMessage as s, parseTailTrimRef as t };
@@ -0,0 +1,150 @@
1
+ //#region src/runtime/session-events.ts
2
+ /**
3
+ * Read one immutable Session event snapshot.
4
+ *
5
+ * Harness rc.2 exposed `events`; Alpha 5 replaced it with the public
6
+ * `snapshotEvents()` method. Prefer the new API when present and retain the
7
+ * old accessor as the compatibility fallback for already-supported hosts.
8
+ */
9
+ function sessionEvents(session) {
10
+ const snapshot = session.snapshotEvents;
11
+ if (typeof snapshot === "function") return snapshot.call(session);
12
+ return session.events ?? [];
13
+ }
14
+ /**
15
+ * Resolve one surface-node seq to its event. 0.1.5 surface nodes are
16
+ * positional and may replace earlier ranges, so a node's seq is not
17
+ * guaranteed to equal the snapshot array index: always resolve by seq.
18
+ */
19
+ function eventBySeq(events, seq) {
20
+ return events[Number(seq)];
21
+ }
22
+ //#endregion
23
+ //#region src/compat/host-generation.ts
24
+ let cached;
25
+ /**
26
+ * Pure classifier from a RESOLVED settings service face. A service that still
27
+ * exposes `register` is a pre-0.1.7 host (0.1.0–0.1.5 lines, dsh-settings pack
28
+ * evidence — verified on the real 0.1.0-rc.2 host: `register(ns, schema,
29
+ * options)` at dsh-settings/lib/index.js:311); from 0.1.7-rc.1 the service
30
+ * drops register entirely and settings live in the loader-managed entry
31
+ * config.
32
+ */
33
+ function classifySettingsFace(settings) {
34
+ return typeof settings?.register === "function" ? "legacy" : "modern";
35
+ }
36
+ /**
37
+ * Probe the host generation from the settings service face.
38
+ *
39
+ * A verdict is only CACHED from a resolved service object. Rows compose
40
+ * before host services on every line (measured: the wire-time probe on a real
41
+ * 0.1.0-rc.2 cell saw no settings service yet and the old code cached
42
+ * 'modern' forever — the legacy lease arm went dead on the exact line it was
43
+ * built for). While the service is absent the answer is a provisional
44
+ * 'modern' and deliberately uncached, so the definitive
45
+ * `noteResolvedSettingsService` evidence can still flip it.
46
+ */
47
+ function detectHostGeneration(ctx) {
48
+ if (cached !== void 0) return cached;
49
+ let settings;
50
+ try {
51
+ settings = ctx.get("settings");
52
+ } catch {
53
+ return "modern";
54
+ }
55
+ if (settings === null || typeof settings !== "object") return "modern";
56
+ cached = classifySettingsFace(settings);
57
+ return cached;
58
+ }
59
+ /**
60
+ * Definitive verdict from the resolved service (evidence observed, not
61
+ * guessed): the settings inject callback calls this once the service has
62
+ * actually composed. Always (re)writes the cache — a provisional earlier
63
+ * verdict must not survive real evidence.
64
+ */
65
+ function noteResolvedSettingsService(settings) {
66
+ cached = classifySettingsFace(settings);
67
+ return cached;
68
+ }
69
+ /**
70
+ * Server-plane snapshot for code paths that hold no ctx (the tool-result
71
+ * adapters). The bridge's inject callback has already noted the resolved
72
+ * service by the time any session message flows, so this reads real evidence
73
+ * on every line; without it the only safe answer is the provisional default.
74
+ */
75
+ function hostGenerationSnapshot() {
76
+ return cached ?? "modern";
77
+ }
78
+ function compatLog(ctx, level = "info") {
79
+ if (detectHostGeneration(ctx) === "legacy") return (message, ...rest) => console[level](`[dsh-context-compression-improved] ${message}`, ...rest);
80
+ const sink = ctx.logger?.[level]?.bind(ctx.logger) ?? ((...rest) => console[level](...rest));
81
+ return (message, ...rest) => sink(`[dsh-context-compression-improved] ${message}`, ...rest);
82
+ }
83
+ //#endregion
84
+ //#region src/compat/tool-result.ts
85
+ /**
86
+ * Tool-result envelope adapter (audit N2: three-axis relocation, not a
87
+ * single-axis unwrap) + legacy message-source kind escape (audit B6).
88
+ *
89
+ * Three-axis mapping, main's own comment as evidence
90
+ * (pruner/session.ts: "0.1.7-rc.2: isError moved from the result block onto
91
+ * the message itself"):
92
+ *
93
+ * semantics Gen D (0.1.7-rc.2+ / 0.2.0) Gen A/B/C (0.1.0–0.1.5)
94
+ * content blocks message.content message.content[0].content
95
+ * error location message.isError message.content[0].isError
96
+ * call id message.toolCallId message.source.callId
97
+ *
98
+ * Every consumer must take the whole triple from viewToolResult(); touching
99
+ * a single axis inline is how the isError/callId axes get silently dropped.
100
+ * A strict legacy signature overrides the generation flag per message (the
101
+ * 0.1.7-rc.1 envelope shape was only load-verified, not session-verified —
102
+ * this makes a wrong flag self-correcting instead of silently misreading).
103
+ */
104
+ /** Strict signature of the enveloped (0.1.x) tool/result message. */
105
+ function envelopedShape(content) {
106
+ return Array.isArray(content) && content.length === 1 && typeof content[0] === "object" && content[0] !== null && content[0].type === "tool-result" && Array.isArray(content[0].content);
107
+ }
108
+ function viewToolResult(message, generation) {
109
+ const gen = generation ?? hostGenerationSnapshot();
110
+ const content = message.content;
111
+ if (envelopedShape(content)) {
112
+ const wrapper = content[0];
113
+ return {
114
+ blocks: wrapper.content,
115
+ isError: wrapper.isError === true,
116
+ callId: typeof message.source?.callId === "string" ? message.source.callId : void 0
117
+ };
118
+ }
119
+ if (gen === "legacy") {
120
+ const wrapper = Array.isArray(content) ? content[0] : void 0;
121
+ if (wrapper && typeof wrapper === "object" && Array.isArray(wrapper.content)) return {
122
+ blocks: wrapper.content,
123
+ isError: wrapper.isError === true,
124
+ callId: typeof message.source?.callId === "string" ? message.source.callId : void 0
125
+ };
126
+ }
127
+ return {
128
+ blocks: Array.isArray(content) ? content : [],
129
+ isError: message.isError === true,
130
+ callId: typeof message.toolCallId === "string" ? message.toolCallId : gen === "legacy" && typeof message.source?.callId === "string" ? message.source.callId : void 0
131
+ };
132
+ }
133
+ /**
134
+ * Per-producer source kind, generation-gated. Modern hosts accept the
135
+ * producer-declared kind (declared in pruner.ts's `MessageSourceMap`
136
+ * augmentation); 0.1.x hosts only know the shared `{ kind: 'plugin' }` kind
137
+ * — the dev bed's dsh-llm@0.2.0-rc.1 type face has no such member (audit B6,
138
+ * empirically confirmed), so the legacy object escapes through `as never`
139
+ * HERE and nowhere else.
140
+ */
141
+ const PLUGIN_ID = "dsh-context-compression-improved";
142
+ function compressionMessageSource(generation) {
143
+ if ((generation ?? hostGenerationSnapshot()) === "legacy") return {
144
+ kind: "plugin",
145
+ plugin: PLUGIN_ID
146
+ };
147
+ return { kind: "dsh-context-compression" };
148
+ }
149
+ //#endregion
150
+ export { noteResolvedSettingsService as a, detectHostGeneration as i, viewToolResult as n, eventBySeq as o, compatLog as r, sessionEvents as s, compressionMessageSource as t };
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-context-compression-improved",
3
- "version": "0.9.8",
3
+ "version": "0.9.9-beta.0",
4
4
  "description": "One-install context-compression selector bundle for DeepSeek Harness",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -47,7 +47,10 @@
47
47
  },
48
48
  "bundle": {
49
49
  "patch": "./cordis.patch.yml"
50
- }
50
+ },
51
+ "pluginDependencies": [
52
+ "dsh-reference-session-collector"
53
+ ]
51
54
  },
52
55
  "scripts": {
53
56
  "bundle": "tsdown --config tsdown.config.ts && tsdown --config tsdown.client.config.ts",
@@ -80,12 +83,13 @@
80
83
  "publishConfig": {
81
84
  "access": "public",
82
85
  "registry": "https://registry.npmjs.org",
83
- "tag": "latest"
86
+ "tag": "beta"
84
87
  },
85
88
  "dependencies": {
86
89
  "@deepseek-ai/schemastery": "3.18.4",
87
90
  "@huggingface/tokenizers": "0.1.3",
88
- "js-yaml": "^4.3.2"
91
+ "js-yaml": "^4.3.2",
92
+ "dsh-reference-session-collector": ">=0.2.0-beta.0 <0.3.0"
89
93
  },
90
94
  "peerDependencies": {
91
95
  "@deepseek-ai/cordis": ">=4.0.1 <5",
@@ -137,12 +137,15 @@ let nativeMonitorReady = false
137
137
 
138
138
  /** 浮动监控面板(FAB): body 级幂等单例。enabled 读数走双臂 scope 的投影缓存。 */
139
139
  let readMonitorPanelEnabled = (): boolean => monitorPanelEnabledCache
140
- // 浮动面板会话绑定:跟随输入栏座位的 inject 回调(裸 sessionId,pm longtask 同款)。
141
- let latestSessionId: string | undefined
140
+ // 「当前页面会话」绑定:conversation.input.left 是 session 作用域槽
141
+ // (ui-conversation contract slots.ts:201),组件每换会话拿到响应式
142
+ // sessionId prop——之前只消费 inject 回调(inject 面只在装载时发一次)
143
+ // 才陈旧。组件 prop 是活指针;无会话视图时回退运行时/最近压缩指针。
144
+ let clientViewSessionId: string | undefined
142
145
  try {
143
146
  initMonitorFab({
144
147
  t: tNav,
145
- sessionIdOf: () => latestSessionId,
148
+ sessionIdOf: () => clientViewSessionId,
146
149
  enabledOf: () => readMonitorPanelEnabled(),
147
150
  fetchSnapshot: async (sessionId) => {
148
151
  const query = sessionId === undefined ? '' : `?sessionId=${encodeURIComponent(sessionId)}`
@@ -377,21 +380,21 @@ let readMonitorPanelEnabled = (): boolean => monitorPanelEnabledCache
377
380
  console.warn('[dsh-context-compression-improved] settings.section 注册失败(宿主无该槽,静默缺席):', error)
378
381
  }
379
382
 
380
- // 输入栏左座(0.1.5+ 宿主):组件刻意空渲染——注册此座位只为接收宿主的
381
- // sessionId 注入回调,供浮动监控面板绑定会话(pm longtask 同款)。旧宿主
382
- // 未声明该槽时激活期会抛错,try/catch 守卫(同上双槽冗余先例)。
383
+ // 输入栏左座(conversation.input.left = session 作用域槽,ui-conversation
384
+ // contract slots.ts:201):不可见组件只消费 sessionId 标准 prop——该 prop 由
385
+ // 宿主按「当前页面所在会话」响应式下发,是绑定当前视图的正规通道。
386
+ // (inject 回调只在装载时发一次,不能作绑定源——陈旧绑定教训。)
383
387
  try {
384
388
  ctx.slots.inject('conversation.input.left', () => ctx.slots.register({
385
389
  name: 'conversation.input.left',
386
390
  id: 'context-compression-session-bind',
387
391
  order: 170,
388
- inject: (sessionId: string) => {
389
- latestSessionId = sessionId
390
- return {}
391
- },
392
- }, () => null))
392
+ }, (props: { sessionId?: string }) => {
393
+ clientViewSessionId = typeof props?.sessionId === 'string' && props.sessionId !== '' ? props.sessionId : undefined
394
+ return null
395
+ }))
393
396
  } catch (error) {
394
- console.warn('[dsh-context-compression-improved] conversation.input.left 注册失败(旧宿主无该槽,浮动面板保持聚合口径):', error)
397
+ console.warn('[dsh-context-compression-improved] conversation.input.left 注册失败(旧宿主无该槽,浮动面板回退运行时指针):', error)
395
398
  }
396
399
 
397
400
  // Bundle 详情页设置卡(0.1.7+):plugins.bundle.config keyed 槽,key=包名整卡平铺
@@ -71,9 +71,17 @@ export const de = {
71
71
  'intentSummary.enabled.off': 'Aus (Standard)',
72
72
  'monitor.fab.title': 'Komprimierungs-Monitor',
73
73
  'monitor.panel.title': 'Komprimierungs-Monitor',
74
- 'monitor.panel.net': 'Nettoeinsparung',
75
- 'monitor.panel.gross': 'Bruttoeinsparung',
76
- 'monitor.panel.offsets': 'Ausgleiche',
74
+ 'monitor.panel.net': 'Sitzung Netto Δ',
75
+ 'monitor.panel.gross': 'Sitzung Brutto Δ',
76
+ 'monitor.panel.offsets': 'Ausgleiche Δ',
77
+ 'monitor.panel.totalNet': 'Gesamt netto (alle)',
78
+ 'monitor.panel.totalGross': 'Gesamt brutto (alle)',
79
+ 'monitor.panel.totalOffsets': 'Gesamt Ausgleiche (alle)',
80
+ 'monitor.panel.compositionBackfill': 'Backfill-Schätzung',
81
+ 'monitor.panel.cumulative': 'Kumuliert (N Calls)',
82
+ 'monitor.panel.money': 'Geldschätzung',
83
+ 'monitor.panel.composition': 'Einsparung nach Pfad',
84
+ 'monitor.panel.compositionScope': 'Zuletzt komprimierte Sitzung',
77
85
  'monitor.panel.context': 'Kontextbelegung',
78
86
  'monitor.panel.suggest': 'Kontextbelegung bei {pct}% — nahe der katastrophalen Vergessenszone; Komprimieren oder Kürzen des Verlaufs empfohlen',
79
87
  'monitor.panel.cacheHit': 'Cache-Trefferquote',
@@ -89,7 +97,7 @@ export const de = {
89
97
  'monitor.panel.lastFold': 'Letzte Faltung',
90
98
  'monitor.panel.stale': 'Snapshot nicht erreichbar — letzte Daten',
91
99
  'monitorPanel.title': 'Komprimierungs-Monitorpanel',
92
- '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).',
100
+ '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. Statistiken werden in SQLite persistiert und überstehen Host-Neustarts.',
93
101
  'monitorPanel.enabled': 'Monitorpanel',
94
102
  'monitorPanel.enabled.on': 'Ein',
95
103
  'monitorPanel.enabled.off': 'Aus (Standard)',
@@ -138,5 +146,13 @@ export const de = {
138
146
  'savings.actualCost': 'Actual cost (official prices)',
139
147
  'savings.savedMoney': 'Estimated saved cost (input price)',
140
148
  'savings.perSession': 'Session',
149
+ 'savings.focus': "Fokus",
150
+ 'savings.degraded': "Persistierung degradiert — Statistiken nur im Speicher",
151
+ 'savings.persisted': "Persistiert",
152
+ 'savings.pageNext': "Weiter",
153
+ 'savings.pagePrev': "Zurück",
154
+ 'savings.sessions': "Sitzungskonto",
155
+ 'savings.money': "Geld gespart (cache-gewichtet)",
156
+ 'savings.cumulative': "Kumuliert (über N Calls)",
141
157
 
142
158
  } satisfies Record<ContextCompressionLocaleKey, string>
@@ -71,9 +71,17 @@ export const es = {
71
71
  'intentSummary.enabled.off': 'No (predeterminado)',
72
72
  'monitor.fab.title': 'Monitor de compresión',
73
73
  'monitor.panel.title': 'Monitor de compresión',
74
- 'monitor.panel.net': 'Ahorro neto',
75
- 'monitor.panel.gross': 'Ahorro bruto',
76
- 'monitor.panel.offsets': 'Compensaciones',
74
+ 'monitor.panel.net': 'Sesión neto Δ',
75
+ 'monitor.panel.gross': 'Sesión bruto Δ',
76
+ 'monitor.panel.offsets': 'Compensaciones Δ',
77
+ 'monitor.panel.totalNet': 'Neto total (todo)',
78
+ 'monitor.panel.totalGross': 'Bruto total (todo)',
79
+ 'monitor.panel.totalOffsets': 'Compensaciones totales',
80
+ 'monitor.panel.compositionBackfill': 'est. retroactiva',
81
+ 'monitor.panel.cumulative': 'Acumulado (N llamadas)',
82
+ 'monitor.panel.money': 'Est. de ahorro',
83
+ 'monitor.panel.composition': 'Cómo ahorra (por ruta)',
84
+ 'monitor.panel.compositionScope': 'Sesión comprimida reciente',
77
85
  'monitor.panel.context': 'Ocupación del contexto',
78
86
  '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',
79
87
  'monitor.panel.cacheHit': 'Tasa de acierto de caché',
@@ -89,7 +97,7 @@ export const es = {
89
97
  'monitor.panel.lastFold': 'Último plegado',
90
98
  'monitor.panel.stale': 'Instantánea inalcanzable — se muestran los últimos datos',
91
99
  'monitorPanel.title': 'Panel de monitor de compresión',
92
- '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).',
100
+ '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. Las estadísticas se persisten en SQLite y sobreviven al reinicio del host.',
93
101
  'monitorPanel.enabled': 'Panel de monitor',
94
102
  'monitorPanel.enabled.on': 'Sí',
95
103
  'monitorPanel.enabled.off': 'No (predeterminado)',
@@ -138,5 +146,13 @@ export const es = {
138
146
  'savings.actualCost': 'Tatsächliche Kosten (offizielle Preise)',
139
147
  'savings.savedMoney': 'Geschätzte Einsparung (Eingabepreis)',
140
148
  'savings.perSession': 'Sitzung',
149
+ 'savings.focus': "foco",
150
+ 'savings.degraded': "Persistencia degradada — estadísticas solo en memoria",
151
+ 'savings.persisted': "Persistido",
152
+ 'savings.pageNext': "Siguiente",
153
+ 'savings.pagePrev': "Anterior",
154
+ 'savings.sessions': "Libro de sesiones",
155
+ 'savings.money': "Dinero ahorrado (ponderado por caché)",
156
+ 'savings.cumulative': "Acumulado (en N llamadas)",
141
157
 
142
158
  } satisfies Record<ContextCompressionLocaleKey, string>
@@ -71,9 +71,17 @@ export const fr = {
71
71
  'intentSummary.enabled.off': 'Désactivé (par défaut)',
72
72
  'monitor.fab.title': 'Monitor de compression',
73
73
  'monitor.panel.title': 'Monitor de compression',
74
- 'monitor.panel.net': 'Économie nette',
75
- 'monitor.panel.gross': 'Économie brute',
76
- 'monitor.panel.offsets': 'Compensations',
74
+ 'monitor.panel.net': 'Session net Δ',
75
+ 'monitor.panel.gross': 'Session brut Δ',
76
+ 'monitor.panel.offsets': 'Compensations Δ',
77
+ 'monitor.panel.totalNet': 'Net total (tout)',
78
+ 'monitor.panel.totalGross': 'Brut total (tout)',
79
+ 'monitor.panel.totalOffsets': 'Compensations totales',
80
+ 'monitor.panel.compositionBackfill': 'est. rétroactif',
81
+ 'monitor.panel.cumulative': 'Cumul (N appels)',
82
+ 'monitor.panel.money': 'Est. économies',
83
+ 'monitor.panel.composition': 'Économies par chemin',
84
+ 'monitor.panel.compositionScope': 'Dernière session compressée',
77
85
  'monitor.panel.context': 'Occupation du contexte',
78
86
  'monitor.panel.suggest': 'Occupation du contexte à {pct} % — zone de perte de contexte imminente ; pensez à lancer une compression ou à réduire les anciens échanges',
79
87
  'monitor.panel.cacheHit': 'Taux de réussite du cache',
@@ -89,7 +97,7 @@ export const fr = {
89
97
  'monitor.panel.lastFold': 'Dernier pliage',
90
98
  'monitor.panel.stale': 'Instantané injoignable — dernières données',
91
99
  'monitorPanel.title': 'Panneau de monitorage de compression',
92
- '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).',
100
+ '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. Les statistiques sont persistées en SQLite et survivent au redémarrage de l\'hôte.',
93
101
  'monitorPanel.enabled': 'Panneau de monitorage',
94
102
  'monitorPanel.enabled.on': 'Activé',
95
103
  'monitorPanel.enabled.off': 'Désactivé (par défaut)',
@@ -138,5 +146,13 @@ export const fr = {
138
146
  'savings.actualCost': 'Coste real (precios oficiales)',
139
147
  'savings.savedMoney': 'Ahorro estimado (precio de entrada)',
140
148
  'savings.perSession': 'Sesión',
149
+ 'savings.focus': "focus",
150
+ 'savings.degraded': "Persistance dégradée — statistiques en mémoire uniquement",
151
+ 'savings.persisted': "Persisté",
152
+ 'savings.pageNext': "Suivant",
153
+ 'savings.pagePrev': "Précédent",
154
+ 'savings.sessions': "Registre des sessions",
155
+ 'savings.money': "Argent économisé (pondéré cache)",
156
+ 'savings.cumulative': "Cumulé (sur N appels)",
141
157
 
142
158
  } satisfies Record<ContextCompressionLocaleKey, string>
@@ -71,9 +71,17 @@ export const it = {
71
71
  'intentSummary.enabled.off': 'Off (predefinito)',
72
72
  'monitor.fab.title': 'Monitor compressione',
73
73
  'monitor.panel.title': 'Monitor compressione',
74
- 'monitor.panel.net': 'Risparmio netto',
75
- 'monitor.panel.gross': 'Risparmio lordo',
76
- 'monitor.panel.offsets': 'Compensazioni',
74
+ 'monitor.panel.net': 'Sessione netto Δ',
75
+ 'monitor.panel.gross': 'Sessione lordo Δ',
76
+ 'monitor.panel.offsets': 'Compensazioni Δ',
77
+ 'monitor.panel.totalNet': 'Netto totale (tutto)',
78
+ 'monitor.panel.totalGross': 'Lordo totale (tutto)',
79
+ 'monitor.panel.totalOffsets': 'Compensazioni totali',
80
+ 'monitor.panel.compositionBackfill': 'stima retroattiva',
81
+ 'monitor.panel.cumulative': 'Cumulato (N chiamate)',
82
+ 'monitor.panel.money': 'Stima risparmio',
83
+ 'monitor.panel.composition': 'Come risparmia (per percorso)',
84
+ 'monitor.panel.compositionScope': 'Sessione compressa recente',
77
85
  'monitor.panel.context': 'Occupazione del contesto',
78
86
  'monitor.panel.suggest': 'Occupazione del contesto al {pct}% — vicini alla zona di dimenticanza catastrofica; consigliato comprimere o tagliare la cronologia',
79
87
  'monitor.panel.cacheHit': 'Tasso di hit della cache',
@@ -89,7 +97,7 @@ export const it = {
89
97
  'monitor.panel.lastFold': 'Ultima piegatura',
90
98
  'monitor.panel.stale': 'Snapshot non raggiungibile — ultimi dati',
91
99
  'monitorPanel.title': 'Pannello di monitoraggio compressione',
92
- '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).',
100
+ '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. Le statistiche sono persistite in SQLite e sopravvivono al riavvio dell\'host.',
93
101
  'monitorPanel.enabled': 'Pannello di monitoraggio',
94
102
  'monitorPanel.enabled.on': 'On',
95
103
  'monitorPanel.enabled.off': 'Off (predefinito)',
@@ -138,5 +146,13 @@ export const it = {
138
146
  'savings.actualCost': 'Coût réel (tarifs officiels)',
139
147
  'savings.savedMoney': 'Économie estimée (prix d’entrée)',
140
148
  'savings.perSession': 'Session',
149
+ 'savings.focus': "focus",
150
+ 'savings.degraded': "Persistenza degradata — statistiche solo in memoria",
151
+ 'savings.persisted': "Persistito",
152
+ 'savings.pageNext': "Avanti",
153
+ 'savings.pagePrev': "Indietro",
154
+ 'savings.sessions': "Registro sessioni",
155
+ 'savings.money': "Denaro risparmiato (ponderato cache)",
156
+ 'savings.cumulative': "Cumulato (su N chiamate)",
141
157
 
142
158
  } satisfies Record<ContextCompressionLocaleKey, string>
@@ -71,9 +71,17 @@ export const ja = {
71
71
  'intentSummary.enabled.off': 'オフ(既定)',
72
72
  'monitor.fab.title': '圧縮モニター',
73
73
  'monitor.panel.title': '圧縮モニター',
74
- 'monitor.panel.net': '正味節約',
75
- 'monitor.panel.gross': '総節約',
76
- 'monitor.panel.offsets': '相殺',
74
+ 'monitor.panel.net': 'セッション純節約 Δ',
75
+ 'monitor.panel.gross': 'セッション粗節約 Δ',
76
+ 'monitor.panel.offsets': '再検索相殺 Δ',
77
+ 'monitor.panel.totalNet': '総純節約(全セッション)',
78
+ 'monitor.panel.totalGross': '総粗節約(全セッション)',
79
+ 'monitor.panel.totalOffsets': '総相殺(全セッション)',
80
+ 'monitor.panel.compositionBackfill': 'バックフィル推定',
81
+ 'monitor.panel.cumulative': '累計(N call)',
82
+ 'monitor.panel.money': '節約見積',
83
+ 'monitor.panel.composition': '内訳(圧縮経路別)',
84
+ 'monitor.panel.compositionScope': '最新の圧縮セッション',
77
85
  'monitor.panel.context': 'コンテキスト占有',
78
86
  'monitor.panel.suggest': 'コンテキスト占有が {pct}% に達しました——壊滅的忘却ゾーンに近づいています。圧縮または履歴の削減を推奨',
79
87
  'monitor.panel.cacheHit': 'キャッシュ ヒット率',
@@ -89,7 +97,7 @@ export const ja = {
89
97
  'monitor.panel.lastFold': '最後の折り畳み',
90
98
  'monitor.panel.stale': 'スナップショット到達不能——前回データを表示',
91
99
  'monitorPanel.title': '圧縮モニター パネル',
92
- 'monitorPanel.description': '有効にすると、入力欄のそばにドラッグできるフローティング バブルが現れます。開くとライブの圧縮状態を監視できます。正味節約(正確 basis)、キャッシュ ヒット率、コスト概算、ターン末尾インテント要約ゲート、最近の相殺。パネルから現セッションのインテント要約スイッチを一時的に上書きできます。台帳はプロセス単位(ホスト再起動でリセット)。',
100
+ 'monitorPanel.description': '有効にすると、入力欄のそばにドラッグできるフローティング バブルが現れます。開くとライブの圧縮状態を監視できます。正味節約(正確 basis)、キャッシュ ヒット率、コスト概算、ターン末尾インテント要約ゲート、最近の相殺。パネルから現セッションのインテント要約スイッチを一時的に上書きできます。統計は SQLite に永続化され、ホスト再起動後も保持されます。',
93
101
  'monitorPanel.enabled': 'モニター パネル',
94
102
  'monitorPanel.enabled.on': 'オン',
95
103
  'monitorPanel.enabled.off': 'オフ(既定)',
@@ -138,5 +146,13 @@ export const ja = {
138
146
  'savings.actualCost': 'Costo reale (prezzi ufficiali)',
139
147
  'savings.savedMoney': 'Risparmio stimato (prezzo di input)',
140
148
  'savings.perSession': 'Sessione',
149
+ 'savings.focus': "フォーカス",
150
+ 'savings.degraded': "永続化が降級中 — 統計はメモリのみ",
151
+ 'savings.persisted': "永続化済み",
152
+ 'savings.pageNext': "次へ",
153
+ 'savings.pagePrev': "前へ",
154
+ 'savings.sessions': "セッション台帳",
155
+ 'savings.money': "節約金額(キャッシュ加重)",
156
+ 'savings.cumulative': "累計(N コール)",
141
157
 
142
158
  } satisfies Record<ContextCompressionLocaleKey, string>
@@ -71,9 +71,17 @@ export const ko = {
71
71
  'intentSummary.enabled.off': '끄기(기본)',
72
72
  'monitor.fab.title': '압축 모니터',
73
73
  'monitor.panel.title': '압축 모니터',
74
- 'monitor.panel.net': '순 절감',
75
- 'monitor.panel.gross': '총 절감',
76
- 'monitor.panel.offsets': '상쇄',
74
+ 'monitor.panel.net': '세션 순절감 Δ',
75
+ 'monitor.panel.gross': '세션 총절감 Δ',
76
+ 'monitor.panel.offsets': '재검색 상쇄 Δ',
77
+ 'monitor.panel.totalNet': '총 순절감(전체)',
78
+ 'monitor.panel.totalGross': '전체 총절감',
79
+ 'monitor.panel.totalOffsets': '전체 상쇄',
80
+ 'monitor.panel.compositionBackfill': '백필 추정',
81
+ 'monitor.panel.cumulative': '누적(N call)',
82
+ 'monitor.panel.money': '절감 추정',
83
+ 'monitor.panel.composition': '절감 내역(경로별)',
84
+ 'monitor.panel.compositionScope': '최근 압축 세션',
77
85
  'monitor.panel.context': '컨텍스트 점유',
78
86
  'monitor.panel.suggest': '컨텍스트 점유가 {pct}%에 도달——치명적 망각 구간에 근접, 압축이나 기록 정리를 권장',
79
87
  'monitor.panel.cacheHit': '캐시 적중률',
@@ -89,7 +97,7 @@ export const ko = {
89
97
  'monitor.panel.lastFold': '마지막 접기',
90
98
  'monitor.panel.stale': '스냅샷 도달 불가——이전 데이터 표시',
91
99
  'monitorPanel.title': '압축 모니터 패널',
92
- 'monitorPanel.description': '켜면 입력 영역 옆에 드래그 가능한 플로팅 버블이 나타납니다. 열면 라이브 압축 상태를 볼 수 있습니다. 순 절감(정확 기준), 캐시 적중률, 비용 추정, 턴 말머리 인텐트 요약 게이트, 최근 상쇄. 패널에서 현재 세션의 인텐트 요약 스위치를 임시로 전환할 수 있습니다. 장부는 프로세스 단위(호스트 재시작 시 초기화).',
100
+ 'monitorPanel.description': '켜면 입력 영역 옆에 드래그 가능한 플로팅 버블이 나타납니다. 열면 라이브 압축 상태를 볼 수 있습니다. 순 절감(정확 기준), 캐시 적중률, 비용 추정, 턴 말머리 인텐트 요약 게이트, 최근 상쇄. 패널에서 현재 세션의 인텐트 요약 스위치를 임시로 전환할 수 있습니다. 통계는 SQLite에 영속화되어 호스트 재시작 후에도 유지됩니다.',
93
101
  'monitorPanel.enabled': '모니터 패널',
94
102
  'monitorPanel.enabled.on': '켜기',
95
103
  'monitorPanel.enabled.off': '끄기(기본)',
@@ -138,5 +146,13 @@ export const ko = {
138
146
  'savings.actualCost': '実際コスト(公式価格)',
139
147
  'savings.savedMoney': '推定節約額(入力価格)',
140
148
  'savings.perSession': 'セッション',
149
+ 'savings.focus': "포커스",
150
+ 'savings.degraded': "영속화 강등 — 통계는 메모리만",
151
+ 'savings.persisted': "영속화됨",
152
+ 'savings.pageNext': "다음",
153
+ 'savings.pagePrev': "이전",
154
+ 'savings.sessions': "세션 장부",
155
+ 'savings.money': "절약 금액(캐시 가중)",
156
+ 'savings.cumulative': "누적(N회 호출)",
141
157
 
142
158
  } satisfies Record<ContextCompressionLocaleKey, string>