dsh-plugin-om 0.0.62 → 0.0.63
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 +34 -17
- package/cordis.patch.yml +2 -0
- package/dist/client/eval-model-register.d.ts +5 -2
- package/dist/client/eval-model-register.d.ts.map +1 -1
- package/dist/client/index.d.ts +2 -1
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/locales.d.ts +3 -5
- package/dist/client/locales.d.ts.map +1 -1
- package/dist/client/om-config-controller.d.ts +3 -4
- package/dist/client/om-config-controller.d.ts.map +1 -1
- package/dist/client.js +32 -26
- package/dist/client.js.map +1 -1
- package/dist/compaction-eval/index.d.ts +8 -0
- package/dist/compaction-eval/index.d.ts.map +1 -0
- package/dist/compaction-eval/index.mjs +206 -0
- package/dist/compaction-eval-command.d.ts +6 -3
- package/dist/compaction-eval-command.d.ts.map +1 -1
- package/dist/compress.d.ts +1 -1
- package/dist/compress.d.ts.map +1 -1
- package/dist/config.d.ts +4 -8
- package/dist/config.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +38 -307
- package/dist/recompress.d.ts +5 -3
- package/dist/recompress.d.ts.map +1 -1
- package/dist/skill/compaction-eval/scripts/compress.mjs +21 -14
- package/dist/skill/compaction-eval/scripts/view.mjs +21 -14
- package/dist/system-reminder.d.ts +2 -2
- package/dist/system-reminder.d.ts.map +1 -1
- package/dist/utils-D-cEbiTF.mjs +89 -0
- package/locale/compaction-eval/en.json +6 -0
- package/locale/compaction-eval/zh.json +6 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +9 -1
package/README.md
CHANGED
|
@@ -6,12 +6,13 @@
|
|
|
6
6
|
|
|
7
7
|
## 功能
|
|
8
8
|
|
|
9
|
+
- 单包两行,包根行提供压缩、`/om-recompress` 与全部浏览器界面,评估行提供 `/om-compaction-eval`,各行在插件页单独启停
|
|
9
10
|
- 自动压缩主会话历史,history 块累计过大时在后台把较早的块归档为 archived-history 块
|
|
10
11
|
- 归档块保留用户消息和已处理的提问,相邻用户消息之间的模型内容压成一句话并附 recall 检索关键词
|
|
11
12
|
- 归档在后台运行,不阻塞会话,同一会话同时只运行一个,完成后由下一个 pre-step 提交
|
|
12
13
|
- 被归档块中的 skill 按名称去重,提交时以手动引用 skill 的形式重新注入
|
|
13
14
|
- 观察压缩触发时立即开始后台预压缩,结果持久化到会话日志,新增完整消息达到 `tailMessageCount` 后注入,重启后直接采纳已有结果
|
|
14
|
-
-
|
|
15
|
+
- 以 system-reminder 消息要求模型在本会话中用 1-2 句话记录中间结论与下一步规划,记录后继续任务,最终输出另行构建
|
|
15
16
|
- 表层缺少同 kind 进度提醒时补发,不比较文本内容
|
|
16
17
|
- 最近真实用户消息、非空模型文本、`ask_user_question` 调用或进度提醒之后,开启 `progressReminderIdleEnabled` 且表层活动累计至少 `progressReminderIdleSteps`(默认 4)个已结束模型 step、工具调用超过 `progressReminderIdleToolCalls`(默认 10)次时重发,并要求立刻输出记录
|
|
17
18
|
- 完整消息定义写在 history 与 archived-history 块顶注释和 recall 工具描述中
|
|
@@ -31,13 +32,15 @@
|
|
|
31
32
|
- 压缩会话记录显示在子智能体列表,标题为 `OM会话(起点-终点)-观察/反思`,重压缩与失败各追加后缀,随父会话 Session 日志一起下载
|
|
32
33
|
- 在浏览器中显示压缩结果、错误和降级警告
|
|
33
34
|
- 压缩卡片可换模型重压缩,可多选模型和思考等级,一次提交按组合并行运行,超出并发上限的排队,进行中显示所用模型,结果只写入压缩会话记录,用于对比不同模型的压缩效果
|
|
34
|
-
- 提供 `/om-compaction-eval`
|
|
35
|
+
- 提供 `/om-compaction-eval` 命令,由评估行提供,在同工作区新建会话,可选模型与思考等级,不带参数时弹出模型面板,由新会话按随包发布的评估文档分析本会话的压缩结果
|
|
35
36
|
|
|
36
37
|
## 安装
|
|
37
38
|
|
|
38
39
|
要求 DSH 0.2.1-rc.2 或更高版本。
|
|
39
40
|
|
|
40
|
-
|
|
41
|
+
包根行服务端必需 `llm` 和 `tokenMeter`。`tools`、`sessions` 和 `commands` 缺失时,对应的 `recall`、压缩会话记录和 `/om-recompress` 停用并输出 warning,压缩照常运行。评估行只依赖 `commands`。
|
|
42
|
+
|
|
43
|
+
安装后插件页出现 `dsh-plugin-om` 和 `dsh-plugin-om-compaction-eval` 两行,可单独启停。
|
|
41
44
|
|
|
42
45
|
```sh
|
|
43
46
|
dsh plugin --profile <profile> add dsh-plugin-om
|
|
@@ -53,17 +56,19 @@ pnpm 11 安装失败时,在 profile 的 `pnpm-workspace.yaml` 中设置 `allow
|
|
|
53
56
|
|
|
54
57
|
## 配置
|
|
55
58
|
|
|
56
|
-
在 WebUI
|
|
59
|
+
在 WebUI 插件侧边栏打开目标行的配置页,或编辑 `$DSH_HOME/profiles/<profile>/cordis.patch.yml`。配置支持热更新,`$DSH_HOME` 默认为 `~/.dsh`。
|
|
57
60
|
|
|
58
61
|
```yaml
|
|
59
62
|
- id: dsh-plugin-om
|
|
60
63
|
config:
|
|
61
64
|
observeThresholdTokens: 35000
|
|
65
|
+
recompressConcurrency: 2
|
|
62
66
|
```
|
|
63
67
|
|
|
68
|
+
包根行 `dsh-plugin-om` 配置:
|
|
69
|
+
|
|
64
70
|
| 配置项 | 默认值 | 说明 |
|
|
65
71
|
| --- | --- | --- |
|
|
66
|
-
| `omEnabled` | `true` | 是否启用自动压缩,关闭后进度提醒也不再注入 |
|
|
67
72
|
| `observeThresholdTokens` | `35000` | 观察压缩阈值 |
|
|
68
73
|
| `reflectThresholdTokens` | `80000` | 归档阈值,尾部保留合计不超过其三分之一的 history 块 |
|
|
69
74
|
| `tailMessageCount` | `20` | 触发后保留的完整消息数 |
|
|
@@ -76,7 +81,7 @@ pnpm 11 安装失败时,在 profile 的 `pnpm-workspace.yaml` 中设置 `allow
|
|
|
76
81
|
| `compressSkipReasoning` | `true` | 是否忽略 reasoning |
|
|
77
82
|
| `rateLimitWaitMs` | `60000` | 429 与 5xx 重试前的等待毫秒数,`0` 表示不等待 |
|
|
78
83
|
| `recompressConcurrency` | `2` | 重压缩同时运行的上限,至少为 `1`,超出的排队 |
|
|
79
|
-
| `progressReminderEnabled` | `true` |
|
|
84
|
+
| `progressReminderEnabled` | `true` | 是否注入进度提醒 |
|
|
80
85
|
| `progressReminderIdleEnabled` | `false` | 长期无记录时是否重发进度提醒,关闭后仅在提醒缺失时补发 |
|
|
81
86
|
| `progressReminderIdleSteps` | `4` | 无记录的已结束 step 数达到该值才重发,至少为 `1` |
|
|
82
87
|
| `progressReminderIdleToolCalls` | `10` | 无记录期间工具调用数超过该值才重发,至少为 `0` |
|
|
@@ -84,6 +89,10 @@ pnpm 11 安装失败时,在 profile 的 `pnpm-workspace.yaml` 中设置 `allow
|
|
|
84
89
|
|
|
85
90
|
配置页在依赖项关闭时隐藏关联项:语义增强关闭隐藏 `modelDir`,长期无记录时重发关闭隐藏两个重发阈值。
|
|
86
91
|
|
|
92
|
+
评估行 `dsh-plugin-om-compaction-eval` 没有配置项。
|
|
93
|
+
|
|
94
|
+
旧版写在包根行上的 `omEnabled` 会被忽略,停止压缩直接关闭 `dsh-plugin-om` 行。`/om-compaction-eval` 迁到评估行,关闭评估行即停用该命令。
|
|
95
|
+
|
|
87
96
|
`observeThresholdTokens` 和 `reflectThresholdTokens` 按主模型真实 token 计。较小的观察阈值更早节省上下文,较大的阈值提供更多摘要信息。只有 reasoning 包含关键决策时才需将 `compressSkipReasoning` 设为 `false`。
|
|
88
97
|
|
|
89
98
|
[机制说明与成本计算器](https://fanethedivine.github.io/dsh-plugin-om/)可估算不同配置的 token 成本。
|
|
@@ -118,11 +127,14 @@ Claude 的 thinking 签名绑定其前全部内容,宿主也未开放 `drop_bl
|
|
|
118
127
|
|
|
119
128
|
## 命令
|
|
120
129
|
|
|
121
|
-
| 命令 | 作用 |
|
|
122
|
-
| --- | --- |
|
|
123
|
-
| `/om-
|
|
130
|
+
| 命令 | 提供行 | 作用 |
|
|
131
|
+
| --- | --- | --- |
|
|
132
|
+
| `/om-recompress <compactionId> <provider> <model> [思考等级]` | `dsh-plugin-om` | 用另一模型重放一次已有压缩,结果只写入压缩会话记录 |
|
|
133
|
+
| `/om-compaction-eval [provider/model [思考等级]]` | `dsh-plugin-om-compaction-eval` | ai分析OM结果 |
|
|
134
|
+
|
|
135
|
+
命令只在对应行启用时注册。
|
|
124
136
|
|
|
125
|
-
|
|
137
|
+
评估命令在会话中执行后,插件按 `workspaceId` 在同工作区新建会话,找不到工作区时按 `cwd` 新建,再选择模型并投递首条消息。模型与思考等级默认沿用当前会话,参数 `provider/model [思考等级]` 可覆盖,只给模型时思考等级用模型默认。消息只给评估文档路径、工作区路径与工作区 id、被分析会话 id,评估步骤由文档决定。浏览器监听到命令成功后跳转到新会话,其他客户端在会话列表中打开它。
|
|
126
138
|
|
|
127
139
|
评估文档与脚本随包发布在 `dist/skill/compaction-eval`。脚本是自包含 `.mjs`,用户环境只需 Node,不需要安装插件依赖。评估产物写系统临时目录 `om-compaction-eval/`,不写工作区。
|
|
128
140
|
|
|
@@ -134,6 +146,8 @@ Claude 的 thinking 签名绑定其前全部内容,宿主也未开放 `drop_bl
|
|
|
134
146
|
- insert:
|
|
135
147
|
- id: dsh-plugin-om-dev
|
|
136
148
|
name: file:///<repo>/dist/index.mjs
|
|
149
|
+
- id: dsh-plugin-om-compaction-eval-dev
|
|
150
|
+
name: file:///<repo>/dist/compaction-eval/index.mjs
|
|
137
151
|
```
|
|
138
152
|
|
|
139
153
|
开启热更新时,在同一文件启用 `hmr` 并监听 `dist`。仓库路径含 `.dsh`(如 worktree)时去掉默认忽略的 `**/.*`:
|
|
@@ -167,9 +181,10 @@ Claude 的 thinking 签名绑定其前全部内容,宿主也未开放 `drop_bl
|
|
|
167
181
|
## 文件地图
|
|
168
182
|
|
|
169
183
|
```text
|
|
170
|
-
cordis.patch.yml # bundle patch
|
|
184
|
+
cordis.patch.yml # bundle patch,按顺序插入包根行与评估组件行
|
|
185
|
+
locale/ # 包根与评估行的中英文展示元信息
|
|
171
186
|
src/
|
|
172
|
-
├── index.ts #
|
|
187
|
+
├── index.ts # 包根入口:注册 recall 工具与 /om-recompress,接线自动压缩和提醒补发
|
|
173
188
|
├── system-reminder.ts # 进度提醒:system-reminder 消息的构造与缺失时补发
|
|
174
189
|
├── thinking-binding.ts # llm/stream 中间件:剥离 OM 压缩前生成的 Claude thinking 签名
|
|
175
190
|
├── config.ts # 配置默认值与宽松合并,未知键忽略、非法值回退默认
|
|
@@ -196,19 +211,21 @@ src/
|
|
|
196
211
|
├── compress.ts # 两级自动压缩:观察打标记与到期注入、归档触发与提交、失败传播与生命周期事件
|
|
197
212
|
├── reflect.ts # 后台归档:进程内任务注册表、尾部保留块选择与失败重试判定
|
|
198
213
|
├── precompress.ts # 后台预压缩:进程内任务注册表、结果信封持久化与重启采纳
|
|
199
|
-
├── recompress.ts # 换模型重压缩:按压缩 id
|
|
214
|
+
├── recompress.ts # 换模型重压缩:按压缩 id 重放视图并落盘记录,附命令构建
|
|
200
215
|
├── recompress-gate.ts # 重压缩并发信号量:按配置上限排队许可
|
|
201
216
|
├── compaction-eval-command.ts # OM 结果评估命令:定位评估文档、新建同工作区会话并投递首条消息
|
|
217
|
+
├── compaction-eval/index.ts # 评估行入口:注册 /om-compaction-eval
|
|
202
218
|
├── eval-session-text.ts # 评估命令文本契约:命令名与描述、首条消息、成功文本与其反解
|
|
203
|
-
└── client/ # 浏览器客户端 bundle
|
|
204
|
-
├── index.ts #
|
|
205
|
-
├── om-config-controller.ts #
|
|
206
|
-
├── OmConfigCard.tsx #
|
|
219
|
+
└── client/ # 浏览器客户端 bundle:压缩卡片、包根配置页与评估行门控
|
|
220
|
+
├── index.ts # 注册卡片与渲染器,为包根注册配置页,按评估行启用状态门控模型面板
|
|
221
|
+
├── om-config-controller.ts # 包根配置页的字段布局、宿主配置表单、草稿和原子保存
|
|
222
|
+
├── OmConfigCard.tsx # 按字段布局渲染的双语配置控件
|
|
207
223
|
├── definition.ts # 压缩卡片定义:生命周期事件、检查点替换与警告事件
|
|
208
224
|
├── OmCompactionCard.tsx # 压缩结果与错误卡片,可跳转轨迹与诊断子会话
|
|
209
225
|
├── OmRecompressMenu.tsx # 重压缩模型多选菜单,复用宿主会话模型目录
|
|
210
226
|
├── recompress-inject.ts # 装配模型目录与命令通道
|
|
211
227
|
├── recompress-run.ts # 重压缩命令行拼装、组合展开与结果归一化
|
|
228
|
+
├── eval-model-register.tsx # 评估命令模型面板:装饰命令并在评估组件行启用时可用
|
|
212
229
|
├── compaction-eval-jump.ts # 监听命令执行结果,跳转到评估命令新建的会话
|
|
213
230
|
├── OmWarningCard.tsx # 功能降级警告行
|
|
214
231
|
├── format.ts # 统计数字紧凑格式化
|
package/cordis.patch.yml
CHANGED
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
* 导出 registerEvalModelPanel。
|
|
6
6
|
*/
|
|
7
7
|
import type { Context } from '@deepseek-ai/cordis';
|
|
8
|
-
/**
|
|
9
|
-
|
|
8
|
+
/**
|
|
9
|
+
* 在 commandUi 与 modelDirectories 都就绪后注册装饰;任一服务缺失则不挂载。
|
|
10
|
+
* available 由调用方提供,评估组件行停用期间面板不可用。
|
|
11
|
+
*/
|
|
12
|
+
export declare function registerEvalModelPanel(ctx: Context, available: () => boolean): void;
|
|
10
13
|
//# sourceMappingURL=eval-model-register.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eval-model-register.d.ts","sourceRoot":"","sources":["../../src/client/eval-model-register.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAcnD
|
|
1
|
+
{"version":3,"file":"eval-model-register.d.ts","sourceRoot":"","sources":["../../src/client/eval-model-register.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAcnD;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,GAAG,IAAI,CAyDnF"}
|
package/dist/client/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 浏览器客户端入口:注册压缩卡片、功能降级警告及 WebUI 插件行配置页,
|
|
3
3
|
* 并监听本浏览器的命令执行结果,把 /om-compaction-eval 新建的会话跳转过去。
|
|
4
|
-
*
|
|
4
|
+
* 浏览器代码只在包根行加载;配置页只在宿主提供包根命名空间时挂载,
|
|
5
|
+
* 评估模型面板按评估组件行是否启用门控。
|
|
5
6
|
*/
|
|
6
7
|
import type { Context } from '@deepseek-ai/cordis';
|
|
7
8
|
/** 必需服务:聊天节点槽、会话定义、双语 locale、宿主配置表单与会话跳转。 */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AA6BnD,6CAA6C;AAC7C,eAAO,MAAM,MAAM,UAAsE,CAAC;AAyB1F,0BAA0B;AAC1B,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAqDxC"}
|
package/dist/client/locales.d.ts
CHANGED
|
@@ -70,16 +70,14 @@ export declare const zh: {
|
|
|
70
70
|
readonly 'config.compressReasoningEffort.hint': "压缩请求的思考等级;留空使用模型默认值。";
|
|
71
71
|
readonly 'config.compressSkipReasoning': "忽略思考内容";
|
|
72
72
|
readonly 'config.compressSkipReasoning.hint': "压缩时不将历史 reasoning 纳入参考。";
|
|
73
|
-
readonly 'config.rateLimitWaitMs': "限流等待毫秒数";
|
|
74
|
-
readonly 'config.rateLimitWaitMs.hint': "429 限流后的冷却时间;0 表示不等待。";
|
|
75
73
|
readonly 'config.recompressConcurrency': "重压缩并发数";
|
|
76
74
|
readonly 'config.recompressConcurrency.hint': "换模型重压缩同时运行的上限,至少为 1;超出的排队等待。";
|
|
75
|
+
readonly 'config.rateLimitWaitMs': "限流等待毫秒数";
|
|
76
|
+
readonly 'config.rateLimitWaitMs.hint': "429 限流后的冷却时间;0 表示不等待。";
|
|
77
77
|
readonly 'config.modelDir': "嵌入模型目录";
|
|
78
78
|
readonly 'config.modelDir.hint': "本地语义增强使用的嵌入模型目录。";
|
|
79
|
-
readonly 'config.omEnabled': "自动压缩";
|
|
80
|
-
readonly 'config.omEnabled.hint': "启用观察压缩和摘要反思合并;关闭后进度提醒也不再注入。";
|
|
81
79
|
readonly 'config.progressReminderEnabled': "进度提醒";
|
|
82
|
-
readonly 'config.progressReminderEnabled.hint': "
|
|
80
|
+
readonly 'config.progressReminderEnabled.hint': "向主会话注入进度提醒,要求模型持续输出记录。";
|
|
83
81
|
readonly 'config.progressReminderIdleEnabled': "长期无记录时重发";
|
|
84
82
|
readonly 'config.progressReminderIdleEnabled.hint': "模型长期只调用工具不输出记录时重发提醒;关闭后仅在提醒缺失时补发。";
|
|
85
83
|
readonly 'config.progressReminderIdleSteps': "重发步数";
|
|
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsFL,CAAC;AAEX,qCAAqC;AACrC,eAAO,MAAM,EAAE,EAAE,MAAM,CAAC,MAAM,OAAO,EAAE,EAAE,MAAM,CA6F9C,CAAC;AAEF,OAAO,QAAQ,kCAAkC,CAAC;IAChD,UAAU,kBAAkB;QAC1B,mDAAmD;QACnD,eAAe,EAAE,MAAM,OAAO,EAAE,CAAC;KAClC;CACF"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
/** WebUI 行配置表单:字段顺序、严格整数/布尔解析与
|
|
1
|
+
/** WebUI 行配置表单:字段顺序、严格整数/布尔解析与 17 项草稿的宿主原子提交。 */
|
|
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';
|
|
5
5
|
/** 由宿主提供的插件条目配置命名空间。 */
|
|
6
6
|
export declare const CONFIG_NS = "dsh-plugin-om";
|
|
7
|
+
/** 评估组件行的配置命名空间(该行无配置项,命名空间仅用于启用门控)。 */
|
|
8
|
+
export declare const EVAL_NS = "dsh-plugin-om-compaction-eval";
|
|
7
9
|
/** 完整表单字段及控件类别,顺序即面板顺序:父开关在前,其控制的细节紧随其后。 */
|
|
8
10
|
export declare const OM_CONFIG_FIELDS: readonly [{
|
|
9
|
-
readonly name: "omEnabled";
|
|
10
|
-
readonly kind: "boolean";
|
|
11
|
-
}, {
|
|
12
11
|
readonly name: "observeThresholdTokens";
|
|
13
12
|
readonly kind: "integer";
|
|
14
13
|
}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"om-config-controller.d.ts","sourceRoot":"","sources":["../../src/client/om-config-controller.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,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,wBAAwB;AACxB,eAAO,MAAM,SAAS,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"om-config-controller.d.ts","sourceRoot":"","sources":["../../src/client/om-config-controller.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,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,wBAAwB;AACxB,eAAO,MAAM,SAAS,kBAAkB,CAAC;AAEzC,wCAAwC;AACxC,eAAO,MAAM,OAAO,kCAAkC,CAAC;AAQvD,4CAA4C;AAC5C,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkBwB,CAAC;AAoCtD,wBAAwB;AACxB,MAAM,WAAW,iBAAkB,SAAQ,iBAAiB;IAC1D,MAAM,EAAE,SAAS,GAAG,OAAO,GAAG,aAAa,CAAC;IAC5C,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC,MAAM,YAAY,EAAE,kBAAkB,CAAC,CAAC;CACxD;AAED,yBAAyB;AACzB,MAAM,WAAW,gBAAiB,SAAQ,mBAAmB;IAC3D,KAAK,EAAE;QAAE,YAAY,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAA;KAAE,CAAC;CAC3D;AAED,yBAAyB;AACzB,qBAAa,kBAAkB;IAKjB,OAAO,CAAC,QAAQ,CAAC,KAAK;IAJlC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA2C;IAChE,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAmC;IACzD,OAAO,CAAC,QAAQ,CAAS;gBAEI,KAAK,EAAE,iBAAiB,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IAgB5E,wBAAwB;IACxB,OAAO,CAAC,UAAU;IAWlB,4BAA4B;IAC5B,MAAM,IAAI,gBAAgB;IAI1B,gBAAgB;IAChB,OAAO,IAAI,IAAI;CAGhB"}
|
package/dist/client.js
CHANGED
|
@@ -541,16 +541,14 @@ window.__ModuleLoader__.load({
|
|
|
541
541
|
"config.compressReasoningEffort.hint": "压缩请求的思考等级;留空使用模型默认值。",
|
|
542
542
|
"config.compressSkipReasoning": "忽略思考内容",
|
|
543
543
|
"config.compressSkipReasoning.hint": "压缩时不将历史 reasoning 纳入参考。",
|
|
544
|
-
"config.rateLimitWaitMs": "限流等待毫秒数",
|
|
545
|
-
"config.rateLimitWaitMs.hint": "429 限流后的冷却时间;0 表示不等待。",
|
|
546
544
|
"config.recompressConcurrency": "重压缩并发数",
|
|
547
545
|
"config.recompressConcurrency.hint": "换模型重压缩同时运行的上限,至少为 1;超出的排队等待。",
|
|
546
|
+
"config.rateLimitWaitMs": "限流等待毫秒数",
|
|
547
|
+
"config.rateLimitWaitMs.hint": "429 限流后的冷却时间;0 表示不等待。",
|
|
548
548
|
"config.modelDir": "嵌入模型目录",
|
|
549
549
|
"config.modelDir.hint": "本地语义增强使用的嵌入模型目录。",
|
|
550
|
-
"config.omEnabled": "自动压缩",
|
|
551
|
-
"config.omEnabled.hint": "启用观察压缩和摘要反思合并;关闭后进度提醒也不再注入。",
|
|
552
550
|
"config.progressReminderEnabled": "进度提醒",
|
|
553
|
-
"config.progressReminderEnabled.hint": "
|
|
551
|
+
"config.progressReminderEnabled.hint": "向主会话注入进度提醒,要求模型持续输出记录。",
|
|
554
552
|
"config.progressReminderIdleEnabled": "长期无记录时重发",
|
|
555
553
|
"config.progressReminderIdleEnabled.hint": "模型长期只调用工具不输出记录时重发提醒;关闭后仅在提醒缺失时补发。",
|
|
556
554
|
"config.progressReminderIdleSteps": "重发步数",
|
|
@@ -628,16 +626,14 @@ window.__ModuleLoader__.load({
|
|
|
628
626
|
"config.compressReasoningEffort.hint": "Reasoning effort for compression; blank uses the model default.",
|
|
629
627
|
"config.compressSkipReasoning": "Skip reasoning",
|
|
630
628
|
"config.compressSkipReasoning.hint": "Exclude historical reasoning from compression references.",
|
|
631
|
-
"config.rateLimitWaitMs": "Rate-limit wait in milliseconds",
|
|
632
|
-
"config.rateLimitWaitMs.hint": "Cooldown after a 429 response; zero skips the wait.",
|
|
633
629
|
"config.recompressConcurrency": "Recompression concurrency",
|
|
634
630
|
"config.recompressConcurrency.hint": "Maximum concurrent model-switch recompressions, at least one; extra runs wait in a queue.",
|
|
631
|
+
"config.rateLimitWaitMs": "Rate-limit wait in milliseconds",
|
|
632
|
+
"config.rateLimitWaitMs.hint": "Cooldown after a 429 response; zero skips the wait.",
|
|
635
633
|
"config.modelDir": "Embedding model directory",
|
|
636
634
|
"config.modelDir.hint": "Directory containing the local semantic-enhancement embedding model.",
|
|
637
|
-
"config.omEnabled": "Automatic compaction",
|
|
638
|
-
"config.omEnabled.hint": "Enable observation and reflection of summaries. Turning it off also stops progress reminders.",
|
|
639
635
|
"config.progressReminderEnabled": "Progress reminder",
|
|
640
|
-
"config.progressReminderEnabled.hint": "Inject a progress reminder asking the model to keep writing notes.
|
|
636
|
+
"config.progressReminderEnabled.hint": "Inject a progress reminder asking the model to keep writing notes.",
|
|
641
637
|
"config.progressReminderIdleEnabled": "Resend when silent",
|
|
642
638
|
"config.progressReminderIdleEnabled.hint": "Resend the reminder when the model only calls tools without notes; off resends only when it is missing.",
|
|
643
639
|
"config.progressReminderIdleSteps": "Resend step count",
|
|
@@ -887,8 +883,11 @@ window.__ModuleLoader__.load({
|
|
|
887
883
|
}
|
|
888
884
|
//#endregion
|
|
889
885
|
//#region src/client/eval-model-register.tsx
|
|
890
|
-
/**
|
|
891
|
-
|
|
886
|
+
/**
|
|
887
|
+
* 在 commandUi 与 modelDirectories 都就绪后注册装饰;任一服务缺失则不挂载。
|
|
888
|
+
* available 由调用方提供,评估组件行停用期间面板不可用。
|
|
889
|
+
*/
|
|
890
|
+
function registerEvalModelPanel(ctx, available) {
|
|
892
891
|
const t = ctx.locale.bind(NS);
|
|
893
892
|
ctx.inject(["commandUi", "modelDirectories"], (scope) => {
|
|
894
893
|
const directories = scope.modelDirectories;
|
|
@@ -925,7 +924,7 @@ window.__ModuleLoader__.load({
|
|
|
925
924
|
scope.effect(() => {
|
|
926
925
|
const dispose = scope.commandUi.decorate({
|
|
927
926
|
name: EVAL_COMMAND_NAME,
|
|
928
|
-
available
|
|
927
|
+
available,
|
|
929
928
|
ui: {
|
|
930
929
|
kind: "action",
|
|
931
930
|
run: (session) => open(session.sessionId)
|
|
@@ -1519,12 +1518,10 @@ window.__ModuleLoader__.load({
|
|
|
1519
1518
|
//#region src/client/om-config-controller.ts
|
|
1520
1519
|
/** 由宿主提供的插件条目配置命名空间。 */
|
|
1521
1520
|
const CONFIG_NS = "dsh-plugin-om";
|
|
1521
|
+
/** 评估组件行的配置命名空间(该行无配置项,命名空间仅用于启用门控)。 */
|
|
1522
|
+
const EVAL_NS = "dsh-plugin-om-compaction-eval";
|
|
1522
1523
|
/** 完整表单字段及控件类别,顺序即面板顺序:父开关在前,其控制的细节紧随其后。 */
|
|
1523
1524
|
const OM_CONFIG_FIELDS = [
|
|
1524
|
-
{
|
|
1525
|
-
name: "omEnabled",
|
|
1526
|
-
kind: "boolean"
|
|
1527
|
-
},
|
|
1528
1525
|
{
|
|
1529
1526
|
name: "observeThresholdTokens",
|
|
1530
1527
|
kind: "integer"
|
|
@@ -1878,8 +1875,22 @@ window.__ModuleLoader__.load({
|
|
|
1878
1875
|
"configForms",
|
|
1879
1876
|
"uiWorkspace"
|
|
1880
1877
|
];
|
|
1878
|
+
/** 行的配置命名空间是否被宿主服务,即该行是否启用。 */
|
|
1879
|
+
function rowServed(ctx, ns) {
|
|
1880
|
+
return ctx.configForms.describe().getSnapshot().view?.namespaces.some((item) => item.ns === ns) ?? false;
|
|
1881
|
+
}
|
|
1882
|
+
/** 在宿主服务该行命名空间期间注册行配置页;槽键为 <包名>#<行 id>。 */
|
|
1883
|
+
function registerRowConfig(ctx, ns, page) {
|
|
1884
|
+
return ctx.configForms.whileServed([ns], () => ctx.slots.inject("plugins.row.config", () => ctx.slots.register({
|
|
1885
|
+
name: "plugins.row.config",
|
|
1886
|
+
key: `dsh-plugin-om#${ns}`,
|
|
1887
|
+
locale: NS,
|
|
1888
|
+
inject: () => page.inject()
|
|
1889
|
+
}, OmConfigCard)));
|
|
1890
|
+
}
|
|
1881
1891
|
/** 挂载压缩卡片、警告行和可配置的插件行。 */
|
|
1882
1892
|
function apply(ctx) {
|
|
1893
|
+
ctx.configForms.describe().ensure();
|
|
1883
1894
|
ctx.effect(() => ctx.locale.register(NS, {
|
|
1884
1895
|
zh,
|
|
1885
1896
|
en
|
|
@@ -1887,7 +1898,7 @@ window.__ModuleLoader__.load({
|
|
|
1887
1898
|
ctx.effect(() => ctx.uiConversation.events.register(omCompactionDefinition), "dsh-plugin-om: compaction definition");
|
|
1888
1899
|
ctx.effect(() => ctx.uiConversation.events.register(omWarningDefinition), "dsh-plugin-om: om warning definition");
|
|
1889
1900
|
ctx.effect(() => registerCompactionEvalJump(ctx), "dsh-plugin-om: compaction eval jump");
|
|
1890
|
-
registerEvalModelPanel(ctx);
|
|
1901
|
+
registerEvalModelPanel(ctx, () => rowServed(ctx, EVAL_NS));
|
|
1891
1902
|
ctx.slots.inject("conversation.chat.node", () => ctx.slots.register({
|
|
1892
1903
|
name: "conversation.chat.node",
|
|
1893
1904
|
key: "om-compaction",
|
|
@@ -1907,14 +1918,9 @@ window.__ModuleLoader__.load({
|
|
|
1907
1918
|
key: "om-warning",
|
|
1908
1919
|
locale: NS
|
|
1909
1920
|
}, OmWarningCard));
|
|
1910
|
-
const
|
|
1911
|
-
ctx.effect(() => () =>
|
|
1912
|
-
ctx.effect(() => ctx
|
|
1913
|
-
name: "plugins.row.config",
|
|
1914
|
-
key: "dsh-plugin-om#dsh-plugin-om",
|
|
1915
|
-
locale: NS,
|
|
1916
|
-
inject: () => card.inject()
|
|
1917
|
-
}, OmConfigCard))), "dsh-plugin-om: row configuration");
|
|
1921
|
+
const page = new OmConfigController(ctx.configForms.get(CONFIG_NS));
|
|
1922
|
+
ctx.effect(() => () => page.dispose(), "dsh-plugin-om: config form subscription");
|
|
1923
|
+
ctx.effect(() => registerRowConfig(ctx, CONFIG_NS, page), "dsh-plugin-om: row configuration");
|
|
1918
1924
|
}
|
|
1919
1925
|
//#endregion
|
|
1920
1926
|
exports.apply = apply;
|