dsh-plugin-om 0.0.52 → 0.0.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -2
- package/dist/client/OmCompactionCard.d.ts.map +1 -1
- package/dist/client/definition.d.ts +8 -0
- package/dist/client/definition.d.ts.map +1 -1
- package/dist/client/locales.d.ts +12 -2
- package/dist/client/locales.d.ts.map +1 -1
- package/dist/client/om-config-controller.d.ts +13 -1
- package/dist/client/om-config-controller.d.ts.map +1 -1
- package/dist/client.js +77 -12
- package/dist/client.js.map +1 -1
- package/dist/config.d.ts +16 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/format.d.ts +3 -1
- package/dist/format.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +92 -65
- package/dist/recompress.d.ts +1 -1
- package/dist/recompress.d.ts.map +1 -1
- package/dist/system-reminder.d.ts +14 -4
- package/dist/system-reminder.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
- 自动压缩主会话历史,并在摘要过大时再次合并
|
|
10
10
|
- OM 启用时以 system-reminder 消息要求模型在本会话中用 1-2 句话记录中间结论与下一步规划,记录后继续任务,最终输出另行构建
|
|
11
11
|
- 表层缺少同 kind 进度提醒时补发,不比较文本内容
|
|
12
|
-
-
|
|
12
|
+
- 最近真实用户消息、非空模型文本或进度提醒之后,开启 `progressReminderIdleEnabled` 且表层活动累计至少 `progressReminderIdleSteps`(默认 4)个已结束模型 step、工具调用超过 `progressReminderIdleToolCalls`(默认 10)次时重发,并要求立刻输出记录
|
|
13
13
|
- 完整消息定义写在 history 块顶注释和 recall 工具描述中
|
|
14
14
|
- 通过工具循环生成摘要,保留用户消息和未压缩内容;系统消息不占完整消息 index
|
|
15
15
|
- 保留工具加载的 skill 原文,并在压缩前再次确认
|
|
@@ -60,7 +60,11 @@ pnpm 11 安装失败时,在 profile 的 `pnpm-workspace.yaml` 中设置 `allow
|
|
|
60
60
|
| `compressSkipReasoning` | `true` | 是否忽略 reasoning |
|
|
61
61
|
| `rateLimitWaitMs` | `60000` | 429 后的等待毫秒数,`0` 表示不等待 |
|
|
62
62
|
| `modelDir` | DSH 共享目录 | 嵌入模型目录 |
|
|
63
|
-
| `omEnabled` | `true` |
|
|
63
|
+
| `omEnabled` | `true` | 是否启用自动压缩,关闭后进度提醒也不再注入 |
|
|
64
|
+
| `progressReminderEnabled` | `true` | 是否注入进度提醒,需同时开启 `omEnabled` |
|
|
65
|
+
| `progressReminderIdleEnabled` | `true` | 长期无记录时是否重发进度提醒,关闭后仅在提醒缺失时补发 |
|
|
66
|
+
| `progressReminderIdleSteps` | `4` | 无记录的已结束 step 数达到该值才重发,至少为 `1` |
|
|
67
|
+
| `progressReminderIdleToolCalls` | `10` | 无记录期间工具调用数超过该值才重发,至少为 `0` |
|
|
64
68
|
| `recallEnabled` | `true` | 是否启用原文召回 |
|
|
65
69
|
| `semanticRecallEnabled` | `true` | 是否为 `recall` 启用语义增强,依赖 `recallEnabled` |
|
|
66
70
|
| `debug` | 开发环境启用 | 是否输出步骤日志 |
|
|
@@ -144,5 +148,7 @@ web/ # 机制说明与成本计算器站点
|
|
|
144
148
|
├── src/model.ts # 成本模型
|
|
145
149
|
└── src/components/ # 页面组件与 UI 原语
|
|
146
150
|
.agents/skills/agent-workflow/SKILL.md # 仓库开发工作流
|
|
151
|
+
.agents/skills/clear-branch/SKILL.md # 手动清空除 main 外的分支与 worktree
|
|
152
|
+
.agents/skills/release/SKILL.md # 手动发布并跟踪 CI 与 npm
|
|
147
153
|
.github/workflows/web-deploy.yml # GitHub Pages 部署工作流
|
|
148
154
|
```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OmCompactionCard.d.ts","sourceRoot":"","sources":["../../src/client/OmCompactionCard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,UAA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AAE,MAAM,qBAAqB,CAAC;AAEhF,0EAA0E;AAC1E,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC;IACzC,QAAQ,CAAC,CAAC,EAAE,WAAW,CAAC,eAAe,CAAC,CAAC;IACzC,6CAA6C;IAC7C,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC;IAC/B,8BAA8B;IAC9B,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,CAAC;IACzD,kCAAkC;IAClC,QAAQ,CAAC,UAAU,CAAC,EAAE,kBAAkB,CAAC;IACzC,8CAA8C;IAC9C,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;CACnE;AAiDD,yCAAyC;AACzC,eAAO,MAAM,gBAAgB,sGAO1B,qBAAqB,iCA2NtB,CAAC"}
|
|
@@ -44,6 +44,14 @@ export interface OmCompactionChatData {
|
|
|
44
44
|
readonly summaryCharCount: number | null;
|
|
45
45
|
/** 压缩后的估算 token 数(4 字符 ≈ 1 token),summary 不可用或非法时为 null。 */
|
|
46
46
|
readonly summaryTokenCount: number | null;
|
|
47
|
+
/** 压缩所用 provider;载荷缺失或非法时为 null。 */
|
|
48
|
+
readonly provider: string | null;
|
|
49
|
+
/** 压缩所用模型;载荷缺失或非法时为 null。 */
|
|
50
|
+
readonly model: string | null;
|
|
51
|
+
/** 压缩所用思考等级;未配置或载荷缺失时为 null(卡片显示为默认)。 */
|
|
52
|
+
readonly reasoningEffort: string | null;
|
|
53
|
+
/** 压缩循环耗时(毫秒);载荷缺失或非法时为 null。 */
|
|
54
|
+
readonly durationMs: number | null;
|
|
47
55
|
/** 压缩失败的错误文案(来自 compaction/end 载荷 error);非失败节点为 null。 */
|
|
48
56
|
readonly error: string | null;
|
|
49
57
|
/** 压缩循环落盘的诊断子会话 id(summary 优先、end 回落);缺失时为 null,卡片不显示「查看」。 */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../../src/client/definition.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EACV,iBAAiB,EAEjB,0BAA0B,EAC3B,MAAM,gDAAgD,CAAC;AAExD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAKnE,uCAAuC;AACvC,eAAO,MAAM,oBAAoB,kBAAkB,CAAC;AAEpD,0CAA0C;AAC1C,eAAO,MAAM,oBAAoB,eAAe,CAAC;AAEjD,OAAO,QAAQ,wCAAwC,CAAC;IACtD,UAAU,eAAe;QACvB,sCAAsC;QACtC,eAAe,EAAE,oBAAoB,CAAC;QACtC,+BAA+B;QAC/B,YAAY,EAAE,iBAAiB,CAAC;KACjC;CACF;AAED,wBAAwB;AACxB,MAAM,WAAW,oBAAoB;IACnC,6DAA6D;IAC7D,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,0DAA0D;IAC1D,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,oDAAoD;IACpD,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,GAAG,IAAI,CAAC;IAC7C,4DAA4D;IAC5D,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,gDAAgD;IAChD,QAAQ,CAAC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,0CAA0C;IAC1C,QAAQ,CAAC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,4CAA4C;IAC5C,QAAQ,CAAC,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3C,8BAA8B;IAC9B,QAAQ,CAAC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,6CAA6C;IAC7C,QAAQ,CAAC,gBAAgB,EAAE,MAAM,GAAG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,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,GAAG,SAAS,CAK9E;AAmLD;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,EAAE,0BAA0B,CAAC,iBAAiB,CAqEhF,CAAC;AAEF,+CAA+C;AAC/C,MAAM,WAAW,iBAAiB;IAChC,uCAAuC;IACvC,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,0CAA0C;IAC1C,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,EAAE,0BAmBjC,CAAC"}
|
package/dist/client/locales.d.ts
CHANGED
|
@@ -8,7 +8,9 @@ export declare const NS = "om-compaction";
|
|
|
8
8
|
export declare const zh: {
|
|
9
9
|
readonly compaction: "上下文已压缩";
|
|
10
10
|
readonly 'compaction.completed': "已压缩 {items} 条历史记录(约 {tokens} tokens)";
|
|
11
|
-
readonly 'compaction.stats': "
|
|
11
|
+
readonly 'compaction.stats': "字符 {beforeChars} → {afterChars}";
|
|
12
|
+
readonly 'compaction.stats.sep': ",";
|
|
13
|
+
readonly 'compaction.stats.effortDefault': "默认";
|
|
12
14
|
readonly 'compaction.expand': "点击查看压缩摘要";
|
|
13
15
|
readonly 'compaction.unavailable': "压缩摘要不可用";
|
|
14
16
|
readonly 'compaction.running': "正在压缩上下文…";
|
|
@@ -64,7 +66,15 @@ export declare const zh: {
|
|
|
64
66
|
readonly 'config.modelDir': "嵌入模型目录";
|
|
65
67
|
readonly 'config.modelDir.hint': "本地语义增强使用的嵌入模型目录。";
|
|
66
68
|
readonly 'config.omEnabled': "自动压缩";
|
|
67
|
-
readonly 'config.omEnabled.hint': "
|
|
69
|
+
readonly 'config.omEnabled.hint': "启用观察压缩和摘要反思合并;关闭后进度提醒也不再注入。";
|
|
70
|
+
readonly 'config.progressReminderEnabled': "进度提醒";
|
|
71
|
+
readonly 'config.progressReminderEnabled.hint': "向主会话注入进度提醒,要求模型持续输出记录;需同时开启自动压缩。";
|
|
72
|
+
readonly 'config.progressReminderIdleEnabled': "长期无记录时重发";
|
|
73
|
+
readonly 'config.progressReminderIdleEnabled.hint': "模型长期只调用工具不输出记录时重发提醒;关闭后仅在提醒缺失时补发。";
|
|
74
|
+
readonly 'config.progressReminderIdleSteps': "重发步数";
|
|
75
|
+
readonly 'config.progressReminderIdleSteps.hint': "无记录的已结束步骤数达到此值才重发,至少为 1。";
|
|
76
|
+
readonly 'config.progressReminderIdleToolCalls': "重发工具调用数";
|
|
77
|
+
readonly 'config.progressReminderIdleToolCalls.hint': "无记录期间工具调用数超过此值才重发,至少为 0。";
|
|
68
78
|
readonly 'config.recallEnabled': "原文召回";
|
|
69
79
|
readonly 'config.recallEnabled.hint': "注册召回工具,按消息序号回看原文。";
|
|
70
80
|
readonly 'config.semanticRecallEnabled': "语义增强";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locales.d.ts","sourceRoot":"","sources":["../../src/client/locales.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,iDAAiD;AACjD,eAAO,MAAM,EAAE,kBAAkB,CAAC;AAElC,mEAAmE;AACnE,eAAO,MAAM,EAAE
|
|
1
|
+
{"version":3,"file":"locales.d.ts","sourceRoot":"","sources":["../../src/client/locales.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,iDAAiD;AACjD,eAAO,MAAM,EAAE,kBAAkB,CAAC;AAElC,mEAAmE;AACnE,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8EL,CAAC;AAEX,qCAAqC;AACrC,eAAO,MAAM,EAAE,EAAE,MAAM,CAAC,MAAM,OAAO,EAAE,EAAE,MAAM,CAoF9C,CAAC;AAEF,OAAO,QAAQ,kCAAkC,CAAC;IAChD,UAAU,kBAAkB;QAC1B,mDAAmD;QACnD,eAAe,EAAE,MAAM,OAAO,EAAE,CAAC;KAClC;CACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** WebUI 行配置表单:严格整数/布尔解析与
|
|
1
|
+
/** WebUI 行配置表单:严格整数/布尔解析与 18 项草稿的宿主原子提交。 */
|
|
2
2
|
import type { SnapshotStore } from '@deepseek-ai/dsh-client-store';
|
|
3
3
|
import { type SettingsFieldState, type SettingsFormActions, type SettingsFormScope, type SettingsFormShell } from '@deepseek-ai/dsh-client-ui-primitives';
|
|
4
4
|
import type { PluginConfig } from '../config.ts';
|
|
@@ -38,6 +38,18 @@ export declare const OM_CONFIG_FIELDS: readonly [{
|
|
|
38
38
|
}, {
|
|
39
39
|
readonly name: "omEnabled";
|
|
40
40
|
readonly kind: "boolean";
|
|
41
|
+
}, {
|
|
42
|
+
readonly name: "progressReminderEnabled";
|
|
43
|
+
readonly kind: "boolean";
|
|
44
|
+
}, {
|
|
45
|
+
readonly name: "progressReminderIdleEnabled";
|
|
46
|
+
readonly kind: "boolean";
|
|
47
|
+
}, {
|
|
48
|
+
readonly name: "progressReminderIdleSteps";
|
|
49
|
+
readonly kind: "integer";
|
|
50
|
+
}, {
|
|
51
|
+
readonly name: "progressReminderIdleToolCalls";
|
|
52
|
+
readonly kind: "integer";
|
|
41
53
|
}, {
|
|
42
54
|
readonly name: "recallEnabled";
|
|
43
55
|
readonly kind: "boolean";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"om-config-controller.d.ts","sourceRoot":"","sources":["../../src/client/om-config-controller.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EAExB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EAEvB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,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wBAAwB;IACxB,OAAO,CAAC,UAAU;IAWlB,4BAA4B;IAC5B,MAAM,IAAI,gBAAgB;IAI1B,gBAAgB;IAChB,OAAO,IAAI,IAAI;CAGhB"}
|
package/dist/client.js
CHANGED
|
@@ -91,12 +91,20 @@ window.__ModuleLoader__.load({
|
|
|
91
91
|
}
|
|
92
92
|
return null;
|
|
93
93
|
}
|
|
94
|
+
/** 非空字符串原样返回,其余为 null。 */
|
|
95
|
+
function nonEmptyString(value) {
|
|
96
|
+
return typeof value === "string" && value !== "" ? value : null;
|
|
97
|
+
}
|
|
94
98
|
/** 从 compaction/summary 载荷提取摘要文本与遮蔽统计(载荷非法时各字段回落 null)。 */
|
|
95
99
|
function compactSummaryData(compactionId, summaryMatch, endMatch) {
|
|
96
100
|
let summary = null;
|
|
97
101
|
let shadowedItemCount = null;
|
|
98
102
|
let shadowedTokenCount = null;
|
|
99
103
|
let shadowedCharCount = null;
|
|
104
|
+
let provider = null;
|
|
105
|
+
let model = null;
|
|
106
|
+
let reasoningEffort = null;
|
|
107
|
+
let durationMs = null;
|
|
100
108
|
if (summaryMatch?.event.type === "compaction/summary") {
|
|
101
109
|
const data = summaryMatch.event.data;
|
|
102
110
|
if (Array.isArray(data.summary)) {
|
|
@@ -106,6 +114,10 @@ window.__ModuleLoader__.load({
|
|
|
106
114
|
shadowedItemCount = Array.isArray(data.shadowedSeqs) && data.shadowedSeqs.every((seq) => Number.isSafeInteger(seq) && seq >= 0) ? data.shadowedSeqs.length : null;
|
|
107
115
|
shadowedTokenCount = Number.isSafeInteger(data.shadowedTokenCount) && data.shadowedTokenCount >= 0 ? data.shadowedTokenCount : null;
|
|
108
116
|
shadowedCharCount = data.shadowedCharCount !== void 0 && Number.isSafeInteger(data.shadowedCharCount) && data.shadowedCharCount >= 0 ? data.shadowedCharCount : null;
|
|
117
|
+
provider = nonEmptyString(data.provider);
|
|
118
|
+
model = nonEmptyString(data.model);
|
|
119
|
+
reasoningEffort = nonEmptyString(data.reasoningEffort);
|
|
120
|
+
durationMs = typeof data.durationMs === "number" && Number.isFinite(data.durationMs) && data.durationMs >= 0 ? data.durationMs : null;
|
|
109
121
|
}
|
|
110
122
|
return {
|
|
111
123
|
compactionId,
|
|
@@ -119,6 +131,10 @@ window.__ModuleLoader__.load({
|
|
|
119
131
|
shadowedCharCount,
|
|
120
132
|
summaryCharCount: summary === null ? null : summary.length,
|
|
121
133
|
summaryTokenCount: summary === null ? null : Math.ceil(summary.length / 4),
|
|
134
|
+
provider,
|
|
135
|
+
model,
|
|
136
|
+
reasoningEffort,
|
|
137
|
+
durationMs,
|
|
122
138
|
diagnosticSessionId: diagnosticSessionIdOf(summaryMatch, endMatch)
|
|
123
139
|
};
|
|
124
140
|
}
|
|
@@ -141,6 +157,10 @@ window.__ModuleLoader__.load({
|
|
|
141
157
|
shadowedCharCount: null,
|
|
142
158
|
summaryCharCount: null,
|
|
143
159
|
summaryTokenCount: null,
|
|
160
|
+
provider: null,
|
|
161
|
+
model: null,
|
|
162
|
+
reasoningEffort: null,
|
|
163
|
+
durationMs: null,
|
|
144
164
|
diagnosticSessionId: null
|
|
145
165
|
};
|
|
146
166
|
}
|
|
@@ -163,6 +183,10 @@ window.__ModuleLoader__.load({
|
|
|
163
183
|
shadowedCharCount: null,
|
|
164
184
|
summaryCharCount: null,
|
|
165
185
|
summaryTokenCount: null,
|
|
186
|
+
provider: null,
|
|
187
|
+
model: null,
|
|
188
|
+
reasoningEffort: null,
|
|
189
|
+
durationMs: null,
|
|
166
190
|
diagnosticSessionId: diagnosticSessionIdOf(end)
|
|
167
191
|
};
|
|
168
192
|
}
|
|
@@ -291,7 +315,9 @@ window.__ModuleLoader__.load({
|
|
|
291
315
|
const zh = {
|
|
292
316
|
compaction: "上下文已压缩",
|
|
293
317
|
"compaction.completed": "已压缩 {items} 条历史记录(约 {tokens} tokens)",
|
|
294
|
-
"compaction.stats": "
|
|
318
|
+
"compaction.stats": "字符 {beforeChars} → {afterChars}",
|
|
319
|
+
"compaction.stats.sep": ",",
|
|
320
|
+
"compaction.stats.effortDefault": "默认",
|
|
295
321
|
"compaction.expand": "点击查看压缩摘要",
|
|
296
322
|
"compaction.unavailable": "压缩摘要不可用",
|
|
297
323
|
"compaction.running": "正在压缩上下文…",
|
|
@@ -347,7 +373,15 @@ window.__ModuleLoader__.load({
|
|
|
347
373
|
"config.modelDir": "嵌入模型目录",
|
|
348
374
|
"config.modelDir.hint": "本地语义增强使用的嵌入模型目录。",
|
|
349
375
|
"config.omEnabled": "自动压缩",
|
|
350
|
-
"config.omEnabled.hint": "
|
|
376
|
+
"config.omEnabled.hint": "启用观察压缩和摘要反思合并;关闭后进度提醒也不再注入。",
|
|
377
|
+
"config.progressReminderEnabled": "进度提醒",
|
|
378
|
+
"config.progressReminderEnabled.hint": "向主会话注入进度提醒,要求模型持续输出记录;需同时开启自动压缩。",
|
|
379
|
+
"config.progressReminderIdleEnabled": "长期无记录时重发",
|
|
380
|
+
"config.progressReminderIdleEnabled.hint": "模型长期只调用工具不输出记录时重发提醒;关闭后仅在提醒缺失时补发。",
|
|
381
|
+
"config.progressReminderIdleSteps": "重发步数",
|
|
382
|
+
"config.progressReminderIdleSteps.hint": "无记录的已结束步骤数达到此值才重发,至少为 1。",
|
|
383
|
+
"config.progressReminderIdleToolCalls": "重发工具调用数",
|
|
384
|
+
"config.progressReminderIdleToolCalls.hint": "无记录期间工具调用数超过此值才重发,至少为 0。",
|
|
351
385
|
"config.recallEnabled": "原文召回",
|
|
352
386
|
"config.recallEnabled.hint": "注册召回工具,按消息序号回看原文。",
|
|
353
387
|
"config.semanticRecallEnabled": "语义增强",
|
|
@@ -359,7 +393,9 @@ window.__ModuleLoader__.load({
|
|
|
359
393
|
const en = {
|
|
360
394
|
compaction: "Context compacted",
|
|
361
395
|
"compaction.completed": "Compacted {items} messages (~{tokens} tokens)",
|
|
362
|
-
"compaction.stats": "
|
|
396
|
+
"compaction.stats": "chars {beforeChars} → {afterChars}",
|
|
397
|
+
"compaction.stats.sep": ", ",
|
|
398
|
+
"compaction.stats.effortDefault": "default",
|
|
363
399
|
"compaction.expand": "Click to view summary",
|
|
364
400
|
"compaction.unavailable": "Summary unavailable",
|
|
365
401
|
"compaction.running": "Compressing context…",
|
|
@@ -415,7 +451,15 @@ window.__ModuleLoader__.load({
|
|
|
415
451
|
"config.modelDir": "Embedding model directory",
|
|
416
452
|
"config.modelDir.hint": "Directory containing the local semantic-enhancement embedding model.",
|
|
417
453
|
"config.omEnabled": "Automatic compaction",
|
|
418
|
-
"config.omEnabled.hint": "Enable observation and reflection of summaries.",
|
|
454
|
+
"config.omEnabled.hint": "Enable observation and reflection of summaries. Turning it off also stops progress reminders.",
|
|
455
|
+
"config.progressReminderEnabled": "Progress reminder",
|
|
456
|
+
"config.progressReminderEnabled.hint": "Inject a progress reminder asking the model to keep writing notes. Requires automatic compaction.",
|
|
457
|
+
"config.progressReminderIdleEnabled": "Resend when silent",
|
|
458
|
+
"config.progressReminderIdleEnabled.hint": "Resend the reminder when the model only calls tools without notes; off resends only when it is missing.",
|
|
459
|
+
"config.progressReminderIdleSteps": "Resend step count",
|
|
460
|
+
"config.progressReminderIdleSteps.hint": "Resend once this many finished steps have passed without notes; at least 1.",
|
|
461
|
+
"config.progressReminderIdleToolCalls": "Resend tool-call count",
|
|
462
|
+
"config.progressReminderIdleToolCalls.hint": "Resend only when tool calls without notes exceed this value; at least 0.",
|
|
419
463
|
"config.recallEnabled": "Original-text recall",
|
|
420
464
|
"config.recallEnabled.hint": "Register the recall tool to review original messages by index.",
|
|
421
465
|
"config.semanticRecallEnabled": "Semantic enhancement",
|
|
@@ -426,7 +470,7 @@ window.__ModuleLoader__.load({
|
|
|
426
470
|
//#endregion
|
|
427
471
|
//#region src/format.ts
|
|
428
472
|
/**
|
|
429
|
-
* 紧凑数字格式化(压缩卡片、重压缩记录与压缩日志共用)。零依赖,服务端与浏览器均可引用。导出 formatCompactCount。
|
|
473
|
+
* 紧凑数字格式化(压缩卡片、重压缩记录与压缩日志共用)。零依赖,服务端与浏览器均可引用。导出 formatCompactCount / formatSeconds。
|
|
430
474
|
* <1k 原样;≥1k 用 k;≥1w(万)用 w;≥1M 用 M;保留 1 位小数并去掉末尾 .0。
|
|
431
475
|
*/
|
|
432
476
|
function formatCompactCount(value) {
|
|
@@ -439,6 +483,10 @@ window.__ModuleLoader__.load({
|
|
|
439
483
|
if (value >= 1e3) return `${trim(value / 1e3)}k`;
|
|
440
484
|
return String(value);
|
|
441
485
|
}
|
|
486
|
+
/** 毫秒耗时格式化为一位小数的秒数,如 63.1s。 */
|
|
487
|
+
function formatSeconds(durationMs) {
|
|
488
|
+
return `${(durationMs / 1e3).toFixed(1)}s`;
|
|
489
|
+
}
|
|
442
490
|
//#endregion
|
|
443
491
|
//#region src/client/OmRecompressMenu.tsx
|
|
444
492
|
/**
|
|
@@ -823,13 +871,14 @@ window.__ModuleLoader__.load({
|
|
|
823
871
|
}
|
|
824
872
|
const expandable = data.summary !== null || actions !== null;
|
|
825
873
|
const open = expandable && expanded;
|
|
826
|
-
const stats = data.
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
874
|
+
const stats = data.shadowedCharCount !== null && data.summaryCharCount !== null ? [
|
|
875
|
+
t("compaction.stats", {
|
|
876
|
+
beforeChars: formatCompactCount(data.shadowedCharCount),
|
|
877
|
+
afterChars: formatCompactCount(data.summaryCharCount)
|
|
878
|
+
}),
|
|
879
|
+
...data.durationMs === null ? [] : [formatSeconds(data.durationMs)],
|
|
880
|
+
...data.model === null ? [] : [`${data.provider === null ? "" : `${data.provider}/`}${data.model}(${data.reasoningEffort ?? t("compaction.stats.effortDefault")})`]
|
|
881
|
+
].join(t("compaction.stats.sep")) : data.shadowedItemCount !== null && data.shadowedTokenCount !== null ? t("compaction.completed", {
|
|
833
882
|
items: formatCompactCount(data.shadowedItemCount),
|
|
834
883
|
tokens: formatCompactCount(data.shadowedTokenCount)
|
|
835
884
|
}) : data.summary !== null ? t("compaction.expand") : t("compaction.unavailable");
|
|
@@ -929,6 +978,22 @@ window.__ModuleLoader__.load({
|
|
|
929
978
|
name: "omEnabled",
|
|
930
979
|
kind: "boolean"
|
|
931
980
|
},
|
|
981
|
+
{
|
|
982
|
+
name: "progressReminderEnabled",
|
|
983
|
+
kind: "boolean"
|
|
984
|
+
},
|
|
985
|
+
{
|
|
986
|
+
name: "progressReminderIdleEnabled",
|
|
987
|
+
kind: "boolean"
|
|
988
|
+
},
|
|
989
|
+
{
|
|
990
|
+
name: "progressReminderIdleSteps",
|
|
991
|
+
kind: "integer"
|
|
992
|
+
},
|
|
993
|
+
{
|
|
994
|
+
name: "progressReminderIdleToolCalls",
|
|
995
|
+
kind: "integer"
|
|
996
|
+
},
|
|
932
997
|
{
|
|
933
998
|
name: "recallEnabled",
|
|
934
999
|
kind: "boolean"
|