dsh-wdx-relief 0.6.0 → 0.7.0
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 +11 -0
- package/README.md +4 -3
- package/README.zh.md +4 -3
- package/client/client.js +133 -282
- package/cordis.patch.yml +1 -3
- package/docs/DETAIL.md +9 -5
- package/docs/DETAIL.zh.md +9 -5
- package/docs/guide.md +26 -34
- package/index.js +5 -29
- package/package.json +1 -1
- package/src/recap.js +3 -1
- package/src/style.js +8 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.7.0 — 2026-11-18
|
|
4
|
+
|
|
5
|
+
- 新增 **ELI5 模式**(默认开启):设置页「回复方式」分组里一个开关,打开时向 system prompt 注入「默认用 ELI5 的方式和我说话,如果我要求则深入讲解」,关掉后这句完全不出现。
|
|
6
|
+
- 新字段 `eli5`(默认 `true`,volatile),与长度、便于行动、回复风格互相独立。
|
|
7
|
+
- `buildStylePrompt` 的顺序:长度 → 便于行动 → ELI5 → 风格 → 自定义指令。
|
|
8
|
+
- 设置页瘦身:可见控件从 6 组 21 项收到 4 组(功能 / 输入框上的一行 / 回复方式 / 工具调用守卫)+ 高级折叠,顶层只剩 10 项。
|
|
9
|
+
- 删掉 `recapTiming`(状态耗时)、`recapReasoning`(思考预览)、`recapPlacement`(显示位置)、`recapMinTurns`、`recapCooldownTurns`、`recapSimilarityThreshold`、`recapMaxWords`:行为固定为原先的默认(一行固定在输入框上方、每轮更新、阈值 0.9、词预算 40),旧 profile 里的旧值不再生效。
|
|
10
|
+
- `recapModelChain` 与工具守卫的语言 / 每轮上限 / 诊断日志收进「高级」折叠;「自定义指令」并入「回复方式」组,「待跟进」与预测同放「功能」组。
|
|
11
|
+
- 「便于行动」删掉与 ELI5 重复的「术语先用白话说明」,解释深度交给 ELI5 开关。
|
|
12
|
+
- 输入框上方的一行不再注册 `conversation.composer.dock`,只保留上方位置。
|
|
13
|
+
|
|
3
14
|
## 0.6.0 — 2026-11-17
|
|
4
15
|
|
|
5
16
|
- 新增 **工具调用泄漏守卫**(默认开启):模型把工具调用直接写成正文(strata serve 常见的 `<tool_call>` / `<function=NAME>` / `<parameter=NAME>`,以及 `<invoke>` / `antml:` 信封)、这一步没有任何工具卡、turn 却像「已完成」一样结束时,当场检测并在同一轮内注入纠正让模型用小块重发。
|
package/README.md
CHANGED
|
@@ -8,18 +8,19 @@ A small collection of features that reduce the everyday mental load of using DSH
|
|
|
8
8
|
## Features
|
|
9
9
|
|
|
10
10
|
- **Next-message prediction**: after a turn, grey text guesses what you'll send next; press <kbd>Tab</kbd> to accept. Typing hides it, <kbd>Esc</kbd> dismisses it.
|
|
11
|
-
- **The line above the input** (on by default): shows turn by turn "what this turn is doing and where it is". By default it shows
|
|
11
|
+
- **The line above the input** (on by default): shows turn by turn "what this turn is doing and where it is", always above the composer. By default it shows the semantic recap (one cheap model call per turn); the local activity feed makes zero model calls and can be enabled in settings. This line never enters the model context. Generated recaps stay in the WDX Relief panel on the right.
|
|
12
12
|
- **WDX Relief page** (right sidebar, on by default): appears in the right sidebar's tool list just like WDX Git. It has three tabs: "Follow-ups" (default) lists things past sessions reminded you about that you haven't handled; click an item to jump back to that session, and the "×" on each clears unwanted suggestions (undoable; cleared records stay local). "Session review" looks back at every recap line generated in this session. "Ask aside" stays out of the main context.
|
|
13
13
|
- **Ask aside**: the tab's input is a rounded card like the composer, with a model picker for the aside at the bottom (only the model icon when narrow) and a circular send button on the right. The Q&A stays in the panel: it is not written to the session or the command log, does not enter the model context, and does not change the main session's model.
|
|
14
14
|
- **Reply style**: length **short / standard / detailed**; style **default / professional / friendly / blunt / follow my style**; up to 2000 characters of custom instructions.
|
|
15
|
-
- **Action-first** (on by default): result and next step first; one sentence when one suffices
|
|
15
|
+
- **Action-first** (on by default): result and next step first; one sentence when one suffices; keeps risks, failure conditions, and work you've already authorized.
|
|
16
|
+
- **ELI5 mode** (on by default): injects one line, "talk to me like I'm 5 by default; go deeper when I ask"; turning it off removes that line entirely.
|
|
16
17
|
- **Tool-call leak guard** (on by default): when the model writes a tool call as literal text (`<tool_call>` / `<invoke>` envelope), the step produces no tool card, yet the turn closes normally, the guard detects it on the spot and injects a correction in the same turn so the model reissues the call. The damaged step is also voided on the model-visible surface, and a forked session gets a one-time brief telling it not to imitate broken history. Derived from `@irwdone/dsh-tool-call-leak-fix` (MIT). It can be switched on/off and tuned under "Tool-call guard" in the plugin settings.
|
|
17
18
|
|
|
18
19
|
## Requirements
|
|
19
20
|
|
|
20
21
|
- DSH Web profile; the plugin depends on the `connection`, `sessions`, and `tools` services.
|
|
21
22
|
- A default model configured. Prediction sends the last few turns to the current default model as a prompt; Ask aside uses the current session model by default and can be switched to another model at the bottom of the panel; Follow-ups sends one tail fragment from recent sessions for a merge decision. None of the three writes to the session log or triggers the agent loop.
|
|
22
|
-
- The semantic recap
|
|
23
|
+
- The semantic recap starts after 3 user turns and updates every turn: it tries your configured cheap-model chain first, then picks a cheap model automatically, then falls back to the current default model; on model failure it falls back to a local short concatenation. The activity feed makes no model calls.
|
|
23
24
|
|
|
24
25
|
## Install
|
|
25
26
|
|
package/README.zh.md
CHANGED
|
@@ -8,18 +8,19 @@
|
|
|
8
8
|
## 功能
|
|
9
9
|
|
|
10
10
|
- **输入框下一句预测**:对话结束后用灰字猜你接下来要发的话,<kbd>Tab</kbd> 填入;打字隐藏,<kbd>Esc</kbd> 忽略。
|
|
11
|
-
-
|
|
11
|
+
- **输入框上的一行**(默认开启):逐轮显示「这一轮在做什么、到哪了」,固定放在输入框上方。默认显示语义摘要(每轮用一次便宜模型);活动流水本地生成、零模型调用,可在设置里打开。这一行永不进入模型上下文,生成过的摘要会留在右侧 WDX Relief 面板里。
|
|
12
12
|
- **WDX Relief 页面**(右侧栏,默认开启):和 WDX Git 一样出现在右侧栏的工具列表里。页面用三个 Tab:默认是「待跟进」,把过去会话里提醒过你、但你还没处理的事列成清单,点条目跳回原会话,每条的「×」可以清掉不想要的建议(可撤销,清掉记录只存在本地);「会话回顾」回看这个会话生成过的每一行摘要;「旁问」不进入主上下文。
|
|
13
13
|
- **旁问**:Tab 里的输入框和 composer 一样是圆角卡片,底部可以选旁问专用模型(窄的时候只显示模型图标)、右侧圆形按钮发送;问答只留在面板里,不写会话、不写命令日志,也不进入模型上下文,不改变主会话模型。
|
|
14
14
|
- **回复风格**:长度 **短 / 标准 / 详细**;风格 **默认 / 专业 / 亲和 / 直接 / 跟随我的风格**;可加最多 2000 字的自定义指令。
|
|
15
|
-
-
|
|
15
|
+
- **便于行动**(默认开启):先给结果和下一步;能一句说清的不写一段;保留风险、失败条件和已授权该做的工作。
|
|
16
|
+
- **ELI5 模式**(默认开启):注入一句「默认用 ELI5 的方式和我说话,如果我要求则深入讲解」;关掉后这句完全不出现。
|
|
16
17
|
- **工具调用泄漏守卫**(默认开启):模型把工具调用直接写成正文(`<tool_call>` / `<invoke>` 信封)、这一步没有任何工具卡、turn 却正常结束时,当场检测并在同一轮内注入纠正让模型重发;损坏的那一步还会在模型可见面上被作废,fork 出去的会话首步会收到一份「历史里的坏样本不要模仿」简报。可在设置页「工具调用守卫」分组里开关、改提示语言和每轮上限。源自 `@irwdone/dsh-tool-call-leak-fix`(MIT)。
|
|
17
18
|
|
|
18
19
|
## 运行要求
|
|
19
20
|
|
|
20
21
|
- DSH Web profile;插件依赖 `connection`、`sessions` 与 `tools` 服务。
|
|
21
22
|
- 已配置默认模型。预测会把最近几轮对话作为 prompt 发给当前默认模型;旁问默认用当前会话模型,也可以在面板底部切到别的模型;「待跟进」会把近期会话的尾部片段发一次,做归并判断。三者都不写入会话日志、不触发 agent loop。
|
|
22
|
-
-
|
|
23
|
+
- 语义摘要从第 3 轮用户消息后开始、每轮更新,先按你配置的便宜模型链尝试,再自动挑便宜模型,最后退回当前默认模型;模型失败时退回本地短拼接。活动流水不调用模型。
|
|
23
24
|
|
|
24
25
|
## 安装
|
|
25
26
|
|
package/client/client.js
CHANGED
|
@@ -42,7 +42,6 @@ window.__ModuleLoader__.load({
|
|
|
42
42
|
var BTW_PATH = '/api/wdx-relief/btw'
|
|
43
43
|
var DISMISS_PATH = '/api/wdx-relief/today/dismiss'
|
|
44
44
|
var RESTORE_PATH = '/api/wdx-relief/today/restore'
|
|
45
|
-
var RECAP_PLACEMENTS = ['above', 'below']
|
|
46
45
|
var TOOLREPAIR_LANGS = ['zh', 'en']
|
|
47
46
|
var MAX_CUSTOM_CHARS = 2000
|
|
48
47
|
var SWITCH = primitives && primitives.Switch
|
|
@@ -90,8 +89,6 @@ window.__ModuleLoader__.load({
|
|
|
90
89
|
'.wdxt-row{box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l1);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-label-secondary);min-height:28px;align-items:center;gap:6px;padding:4px 6px 4px 10px;font-size:12px;line-height:18px;display:flex}',
|
|
91
90
|
'.wdxt-seg{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}',
|
|
92
91
|
'.wdxt-activity{color:var(--dsw-alias-label-tertiary);flex:0 1 auto;max-width:46%}',
|
|
93
|
-
'.wdxt-time{color:var(--dsw-alias-label-caption);font-variant-numeric:tabular-nums;flex:none}',
|
|
94
|
-
'.wdxt-reason{color:var(--dsw-alias-label-caption);flex:0 1 auto;max-width:34%}',
|
|
95
92
|
'.wdxt-summary{color:var(--dsw-alias-label-secondary);flex:1 1 auto;min-width:0}',
|
|
96
93
|
'.wdxt-sep{color:var(--dsw-alias-border-l3);flex:none}',
|
|
97
94
|
'.wdxt-close{width:16px;height:16px;color:var(--dsw-alias-label-caption);cursor:pointer;opacity:0;background:0 0;border:0;border-radius:999px;flex:none;place-items:center;padding:0;font:inherit;font-size:12px;line-height:1;display:grid}',
|
|
@@ -182,17 +179,18 @@ window.__ModuleLoader__.load({
|
|
|
182
179
|
// -------------------------------------------------------------- locale
|
|
183
180
|
|
|
184
181
|
var zh = {
|
|
185
|
-
'
|
|
186
|
-
'
|
|
187
|
-
'reply.group.
|
|
188
|
-
'reply.group.writing': '写作',
|
|
182
|
+
'settings.intro': '上半部分是各功能开关,下半部分是回复偏好;回复偏好只打进 system prompt,不改变工具权限。',
|
|
183
|
+
'settings.group.features': '功能',
|
|
184
|
+
'reply.group.reply': '回复方式',
|
|
189
185
|
'reply.verbosity.title': '输出详细程度',
|
|
190
186
|
'reply.verbosity.description': '选择回复包含细节的详细程度',
|
|
191
187
|
'reply.verbosity.low': '短',
|
|
192
188
|
'reply.verbosity.medium': '标准',
|
|
193
189
|
'reply.verbosity.high': '详细',
|
|
194
190
|
'reply.actionable.title': '便于行动',
|
|
195
|
-
'reply.actionable.description': '
|
|
191
|
+
'reply.actionable.description': '先给结果和下一步,少铺垫;能一句话说清就不展开;保留风险与失败条件',
|
|
192
|
+
'reply.eli5.title': 'ELI5 模式',
|
|
193
|
+
'reply.eli5.description': '默认用 ELI5 的方式和我说话,如果我要求则深入讲解',
|
|
196
194
|
'reply.style.title': '回复风格',
|
|
197
195
|
'reply.style.description': '选择整体语气和表达方式',
|
|
198
196
|
'reply.style.default': '默认',
|
|
@@ -211,29 +209,13 @@ window.__ModuleLoader__.load({
|
|
|
211
209
|
'settings.title': '显示预测消息',
|
|
212
210
|
'settings.description': '根据对话预测你接下来要发送的消息',
|
|
213
211
|
'settings.turnLine': '输入框上的一行',
|
|
214
|
-
'settings.turnLine.note': '
|
|
212
|
+
'settings.turnLine.note': '这一行只是界面提示,不进入模型上下文;活动流水本地生成,语义摘要会调用一次便宜模型。',
|
|
215
213
|
'settings.recap.title': '语义摘要',
|
|
216
|
-
'settings.recap.description': '
|
|
214
|
+
'settings.recap.description': '每轮用一次便宜模型,写一行「现在到哪」',
|
|
217
215
|
'settings.recapActivity.title': '活动流水',
|
|
218
216
|
'settings.recapActivity.description': '正在读文件、跑命令、改代码;本地生成,零模型调用(默认关闭)',
|
|
219
|
-
'settings.
|
|
220
|
-
'settings.
|
|
221
|
-
'settings.recapReasoning.title': '思考预览',
|
|
222
|
-
'settings.recapReasoning.description': '折叠推理的第一行;本地生成,零模型调用(默认关闭)',
|
|
223
|
-
'settings.recapPlacement.title': '显示位置',
|
|
224
|
-
'settings.recapPlacement.description': '这一行放在输入框上方还是下方',
|
|
225
|
-
'settings.recapPlacement.above': '输入框上方',
|
|
226
|
-
'settings.recapPlacement.below': '输入框下方',
|
|
227
|
-
'settings.recapAdvanced': '高级(一般不用改)',
|
|
228
|
-
'settings.recapAdvancedHide': '收起高级设置',
|
|
229
|
-
'settings.recapMinTurns.title': '从第几轮开始',
|
|
230
|
-
'settings.recapMinTurns.description': '至少经过几轮用户消息才生成语义摘要',
|
|
231
|
-
'settings.recapCooldownTurns.title': '摘要更新间隔',
|
|
232
|
-
'settings.recapCooldownTurns.description': '每隔几轮更新一次;1 表示每轮',
|
|
233
|
-
'settings.recapSimilarityThreshold.title': '沿用旧摘要的阈值',
|
|
234
|
-
'settings.recapSimilarityThreshold.description': '新旧摘要相似度达到这个值就不再改字(0–1)',
|
|
235
|
-
'settings.recapMaxWords.title': '摘要长度',
|
|
236
|
-
'settings.recapMaxWords.description': '词预算;中文按字算',
|
|
217
|
+
'settings.advanced': '高级(一般不用改)',
|
|
218
|
+
'settings.advancedHide': '收起高级设置',
|
|
237
219
|
'settings.recapModelChain.title': '摘要模型链',
|
|
238
220
|
'settings.recapModelChain.description': '按顺序尝试 provider/model;留空自动挑便宜模型,全部失败退回当前默认模型',
|
|
239
221
|
'settings.recapModelChain.placeholder': 'deepseek-v4-flash, deepseek-chat',
|
|
@@ -250,7 +232,6 @@ window.__ModuleLoader__.load({
|
|
|
250
232
|
'settings.toolRepairMaxCorrections.description': '0 表示只标记不自动纠正;默认 2',
|
|
251
233
|
'settings.toolRepairDebugLog.title': '诊断日志',
|
|
252
234
|
'settings.toolRepairDebugLog.description': '输出检测、拦截与修复过程日志(默认关闭)',
|
|
253
|
-
'turn.reasoning': '思考',
|
|
254
235
|
'turn.pending': '还没回复',
|
|
255
236
|
'turn.dismiss': '收起这一行',
|
|
256
237
|
'turn.thinking': '思考中…',
|
|
@@ -318,17 +299,18 @@ window.__ModuleLoader__.load({
|
|
|
318
299
|
}
|
|
319
300
|
|
|
320
301
|
var en = {
|
|
321
|
-
'
|
|
322
|
-
'
|
|
323
|
-
'reply.group.
|
|
324
|
-
'reply.group.writing': 'Writing',
|
|
302
|
+
'settings.intro': 'Feature switches come first, reply preferences after; reply preferences only shape the system prompt and never change tool permissions.',
|
|
303
|
+
'settings.group.features': 'Features',
|
|
304
|
+
'reply.group.reply': 'Reply style',
|
|
325
305
|
'reply.verbosity.title': 'Output detail',
|
|
326
306
|
'reply.verbosity.description': 'How much detail replies should include',
|
|
327
307
|
'reply.verbosity.low': 'Short',
|
|
328
308
|
'reply.verbosity.medium': 'Standard',
|
|
329
309
|
'reply.verbosity.high': 'Detailed',
|
|
330
310
|
'reply.actionable.title': 'Actionable replies',
|
|
331
|
-
'reply.actionable.description': 'Lead with the result and next step;
|
|
311
|
+
'reply.actionable.description': 'Lead with the result and next step; one sentence when one suffices; keep risks and failure conditions',
|
|
312
|
+
'reply.eli5.title': 'ELI5 mode',
|
|
313
|
+
'reply.eli5.description': "Talk to me like I'm 5 by default; go deeper when I ask",
|
|
332
314
|
'reply.style.title': 'Reply style',
|
|
333
315
|
'reply.style.description': 'Choose the overall tone and expression',
|
|
334
316
|
'reply.style.default': 'Default',
|
|
@@ -347,29 +329,13 @@ window.__ModuleLoader__.load({
|
|
|
347
329
|
'settings.title': 'Show predicted messages',
|
|
348
330
|
'settings.description': 'Predict what you might send next based on the conversation',
|
|
349
331
|
'settings.turnLine': 'Line above the composer',
|
|
350
|
-
'settings.turnLine.note': 'This line is UI only and never enters the model context. The
|
|
332
|
+
'settings.turnLine.note': 'This line is UI only and never enters the model context. The activity stream is local; the semantic summary makes one cheap-model call.',
|
|
351
333
|
'settings.recap.title': 'Semantic summary',
|
|
352
|
-
'settings.recap.description': 'Every
|
|
334
|
+
'settings.recap.description': 'Every turn, one cheap-model line describing where things stand',
|
|
353
335
|
'settings.recapActivity.title': 'Activity stream',
|
|
354
336
|
'settings.recapActivity.description': 'Reading files, running commands, editing code; local, no model call (off by default)',
|
|
355
|
-
'settings.
|
|
356
|
-
'settings.
|
|
357
|
-
'settings.recapReasoning.title': 'Thinking preview',
|
|
358
|
-
'settings.recapReasoning.description': 'First line of the folded reasoning; local, no model call (off by default)',
|
|
359
|
-
'settings.recapPlacement.title': 'Placement',
|
|
360
|
-
'settings.recapPlacement.description': 'Show the line above or below the composer',
|
|
361
|
-
'settings.recapPlacement.above': 'Above the composer',
|
|
362
|
-
'settings.recapPlacement.below': 'Below the composer',
|
|
363
|
-
'settings.recapAdvanced': 'Advanced (rarely needed)',
|
|
364
|
-
'settings.recapAdvancedHide': 'Hide advanced settings',
|
|
365
|
-
'settings.recapMinTurns.title': 'Start after',
|
|
366
|
-
'settings.recapMinTurns.description': 'User messages required before a semantic summary starts',
|
|
367
|
-
'settings.recapCooldownTurns.title': 'Update every',
|
|
368
|
-
'settings.recapCooldownTurns.description': 'Turns between summary updates; 1 means every turn',
|
|
369
|
-
'settings.recapSimilarityThreshold.title': 'Keep-when-similar threshold',
|
|
370
|
-
'settings.recapSimilarityThreshold.description': 'Keep the previous line when the new summary is at least this similar (0–1)',
|
|
371
|
-
'settings.recapMaxWords.title': 'Summary length',
|
|
372
|
-
'settings.recapMaxWords.description': 'Word budget; Chinese counts by character',
|
|
337
|
+
'settings.advanced': 'Advanced (rarely needed)',
|
|
338
|
+
'settings.advancedHide': 'Hide advanced settings',
|
|
373
339
|
'settings.recapModelChain.title': 'Summary model chain',
|
|
374
340
|
'settings.recapModelChain.description': 'Try provider/model in order. Empty picks cheap models automatically, then falls back to the current default',
|
|
375
341
|
'settings.recapModelChain.placeholder': 'deepseek-v4-flash, deepseek-chat',
|
|
@@ -386,7 +352,6 @@ window.__ModuleLoader__.load({
|
|
|
386
352
|
'settings.toolRepairMaxCorrections.description': '0 means flag only, never auto-correct; default 2',
|
|
387
353
|
'settings.toolRepairDebugLog.title': 'Diagnostic log',
|
|
388
354
|
'settings.toolRepairDebugLog.description': 'Log detection, denials and repairs (off by default)',
|
|
389
|
-
'turn.reasoning': 'Thinking',
|
|
390
355
|
'turn.pending': 'no reply yet',
|
|
391
356
|
'turn.dismiss': 'Hide this line',
|
|
392
357
|
'turn.thinking': 'Thinking…',
|
|
@@ -942,13 +907,11 @@ window.__ModuleLoader__.load({
|
|
|
942
907
|
/**
|
|
943
908
|
* 输入框上方(或下方)的一行:把「这一轮在做什么」压成一句。
|
|
944
909
|
*
|
|
945
|
-
*
|
|
910
|
+
* 两种语义各自独立开关:
|
|
946
911
|
* - activity:活动流水,读文件 / 跑命令 / 改代码,本地零成本;
|
|
947
|
-
* - timing:这一轮耗时,本地零成本;
|
|
948
|
-
* - reasoning:折叠推理的第一行,本地零成本;
|
|
949
912
|
* - summary:语义摘要,走 Host 的便宜模型链,不进入模型上下文。
|
|
950
913
|
*
|
|
951
|
-
*
|
|
914
|
+
* 前者只读会话事件;后者由 `POST /api/wdx-relief/recap` 生成。
|
|
952
915
|
* 这一行永远不写回会话,也不进入下一次模型请求。
|
|
953
916
|
*/
|
|
954
917
|
|
|
@@ -1212,16 +1175,6 @@ window.__ModuleLoader__.load({
|
|
|
1212
1175
|
}
|
|
1213
1176
|
}
|
|
1214
1177
|
|
|
1215
|
-
function formatDuration(ms) {
|
|
1216
|
-
var seconds = Math.max(0, Math.round((Number(ms) || 0) / 1000))
|
|
1217
|
-
if (seconds < 60) return seconds + 's'
|
|
1218
|
-
var minutes = Math.floor(seconds / 60)
|
|
1219
|
-
var rest = seconds % 60
|
|
1220
|
-
if (minutes < 60) return minutes + 'm ' + (rest < 10 ? '0' : '') + rest + 's'
|
|
1221
|
-
var hours = Math.floor(minutes / 60)
|
|
1222
|
-
return hours + 'h ' + (minutes % 60) + 'm'
|
|
1223
|
-
}
|
|
1224
|
-
|
|
1225
1178
|
/** 最近两个动作连成流水;没有工具时用阶段兜底。 */
|
|
1226
1179
|
function activityText(view, t) {
|
|
1227
1180
|
if (!view || view.turn === 0) return ''
|
|
@@ -1252,28 +1205,17 @@ window.__ModuleLoader__.load({
|
|
|
1252
1205
|
var activity = activityText(view, t)
|
|
1253
1206
|
if (activity !== '') segments.push({ key: 'activity', text: activity, className: 'wdxt-activity' })
|
|
1254
1207
|
}
|
|
1255
|
-
if (settings.timing && (view.running || view.elapsedMs >= 1000)) {
|
|
1256
|
-
segments.push({ key: 'time', text: formatDuration(view.elapsedMs), className: 'wdxt-time' })
|
|
1257
|
-
}
|
|
1258
|
-
if (settings.reasoning && view.reasoning !== '') {
|
|
1259
|
-
var label = tr(t, 'turn.reasoning', '思考')
|
|
1260
|
-
segments.push({ key: 'reasoning', text: label + ':' + view.reasoning, className: 'wdxt-reason' })
|
|
1261
|
-
}
|
|
1262
1208
|
if (settings.summary && summary && summary.text) {
|
|
1263
1209
|
segments.push({ key: 'summary', text: '※ ' + summary.text, className: 'wdxt-summary' })
|
|
1264
1210
|
}
|
|
1265
1211
|
return segments
|
|
1266
1212
|
}
|
|
1267
1213
|
|
|
1268
|
-
function lineSettings(settings
|
|
1214
|
+
function lineSettings(settings) {
|
|
1269
1215
|
var value = (settings && settings.value) || {}
|
|
1270
|
-
var configuredPlacement = value.recapPlacement === 'below' ? 'below' : 'above'
|
|
1271
1216
|
return {
|
|
1272
1217
|
activity: value.recapActivity === true,
|
|
1273
|
-
timing: value.recapTiming === true,
|
|
1274
|
-
reasoning: value.recapReasoning === true,
|
|
1275
1218
|
summary: value.recap !== false,
|
|
1276
|
-
placement: placement === configuredPlacement,
|
|
1277
1219
|
}
|
|
1278
1220
|
}
|
|
1279
1221
|
|
|
@@ -1301,12 +1243,11 @@ window.__ModuleLoader__.load({
|
|
|
1301
1243
|
/**
|
|
1302
1244
|
* 输入框上方 / 下方的一行。
|
|
1303
1245
|
*
|
|
1304
|
-
* 组件本身不写任何状态到会话;activity
|
|
1305
|
-
* summary 来自 Host 的 `recap`
|
|
1246
|
+
* 组件本身不写任何状态到会话;activity 来自事件窗口,
|
|
1247
|
+
* summary 来自 Host 的 `recap` 路由。开关在插件配置里,不进入 prompt。
|
|
1306
1248
|
*/
|
|
1307
1249
|
function TurnRecapDock(props) {
|
|
1308
1250
|
var sessionId = props.sessionId
|
|
1309
|
-
var placement = props.placement
|
|
1310
1251
|
var useSession = props.useSession
|
|
1311
1252
|
var useInput = props.useInput
|
|
1312
1253
|
var useSettings = props.useSettings
|
|
@@ -1318,7 +1259,7 @@ window.__ModuleLoader__.load({
|
|
|
1318
1259
|
var settings = useSettings ? useSettings(function (s) { return s }) : undefined
|
|
1319
1260
|
var draft = typeof input.draft === 'string' ? input.draft : ''
|
|
1320
1261
|
var attachments = Array.isArray(input.attachmentIds) ? input.attachmentIds.length : 0
|
|
1321
|
-
var cfg = lineSettings(settings
|
|
1262
|
+
var cfg = lineSettings(settings)
|
|
1322
1263
|
|
|
1323
1264
|
var [entries, setEntries] = useState([])
|
|
1324
1265
|
var [tick, setTick] = useState(0)
|
|
@@ -1387,7 +1328,6 @@ window.__ModuleLoader__.load({
|
|
|
1387
1328
|
requested.current = ''
|
|
1388
1329
|
return undefined
|
|
1389
1330
|
}
|
|
1390
|
-
if (!cfg.placement) return undefined
|
|
1391
1331
|
if (!sessionId || running || view.turn === 0) return undefined
|
|
1392
1332
|
if (activeSession.current !== sessionId) return undefined
|
|
1393
1333
|
var key = sessionId + ':' + view.turn
|
|
@@ -1401,9 +1341,9 @@ window.__ModuleLoader__.load({
|
|
|
1401
1341
|
// 摘要失败时静默:本地三种信息仍然可用,不打扰主任务。
|
|
1402
1342
|
})
|
|
1403
1343
|
return function () { controller.abort() }
|
|
1404
|
-
}, [cfg.summary,
|
|
1344
|
+
}, [cfg.summary, sessionId, running, view.turn])
|
|
1405
1345
|
|
|
1406
|
-
if (!
|
|
1346
|
+
if (!sessionId) return null
|
|
1407
1347
|
if (draft.trim() !== '' || attachments > 0) return null
|
|
1408
1348
|
|
|
1409
1349
|
// 运行中先展示本地活动;语义摘要只在上一条轮次结束后出现,避免把旧摘要说成这一轮。
|
|
@@ -1429,7 +1369,7 @@ window.__ModuleLoader__.load({
|
|
|
1429
1369
|
onClick: function () { setDismissedTurn(view.turn) },
|
|
1430
1370
|
}, '×'))
|
|
1431
1371
|
|
|
1432
|
-
return h('div', { className: 'wdxt-root', 'data-wdx-turn-line': true, 'data-placement':
|
|
1372
|
+
return h('div', { className: 'wdxt-root', 'data-wdx-turn-line': true, 'data-placement': 'above' }, [
|
|
1433
1373
|
h('div', { className: 'wdxt-row', title: fullTitle }, children),
|
|
1434
1374
|
])
|
|
1435
1375
|
}
|
|
@@ -2288,17 +2228,11 @@ window.__ModuleLoader__.load({
|
|
|
2288
2228
|
{ field: 'enabled', format: booleanText, parse: parseBoolean },
|
|
2289
2229
|
{ field: 'recap', format: booleanText, parse: parseBoolean },
|
|
2290
2230
|
{ field: 'recapActivity', format: booleanText, parse: parseBoolean },
|
|
2291
|
-
{ field: 'recapTiming', format: booleanText, parse: parseBoolean },
|
|
2292
|
-
{ field: 'recapReasoning', format: booleanText, parse: parseBoolean },
|
|
2293
|
-
choiceField('recapPlacement', RECAP_PLACEMENTS, 'above'),
|
|
2294
|
-
numberField('recapMinTurns', 3, 1, 50, 1),
|
|
2295
|
-
numberField('recapCooldownTurns', 1, 1, 50, 1),
|
|
2296
|
-
numberField('recapSimilarityThreshold', 0.9, 0, 1, 0.05),
|
|
2297
|
-
numberField('recapMaxWords', 40, 5, 200, 1),
|
|
2298
2231
|
textField('recapModelChain'),
|
|
2299
2232
|
{ field: 'today', format: booleanText, parse: parseBoolean },
|
|
2300
2233
|
choiceField('verbosity', VERBOSITY_OPTIONS, 'low'),
|
|
2301
2234
|
{ field: 'actionable', format: booleanText, parse: parseBoolean },
|
|
2235
|
+
{ field: 'eli5', format: booleanText, parse: parseBoolean },
|
|
2302
2236
|
{
|
|
2303
2237
|
field: 'style',
|
|
2304
2238
|
format: function (value) {
|
|
@@ -2331,17 +2265,11 @@ window.__ModuleLoader__.load({
|
|
|
2331
2265
|
enabled: model.field('enabled'),
|
|
2332
2266
|
recap: model.field('recap'),
|
|
2333
2267
|
recapActivity: model.field('recapActivity'),
|
|
2334
|
-
recapTiming: model.field('recapTiming'),
|
|
2335
|
-
recapReasoning: model.field('recapReasoning'),
|
|
2336
|
-
recapPlacement: model.field('recapPlacement'),
|
|
2337
|
-
recapMinTurns: model.field('recapMinTurns'),
|
|
2338
|
-
recapCooldownTurns: model.field('recapCooldownTurns'),
|
|
2339
|
-
recapSimilarityThreshold: model.field('recapSimilarityThreshold'),
|
|
2340
|
-
recapMaxWords: model.field('recapMaxWords'),
|
|
2341
2268
|
recapModelChain: model.field('recapModelChain'),
|
|
2342
2269
|
today: model.field('today'),
|
|
2343
2270
|
verbosity: model.field('verbosity'),
|
|
2344
2271
|
actionable: model.field('actionable'),
|
|
2272
|
+
eli5: model.field('eli5'),
|
|
2345
2273
|
style: model.field('style'),
|
|
2346
2274
|
customInstructions: model.field('customInstructions'),
|
|
2347
2275
|
toolRepair: model.field('toolRepair'),
|
|
@@ -2537,28 +2465,25 @@ window.__ModuleLoader__.load({
|
|
|
2537
2465
|
if (props.view === 'summary') return tr(t, 'settings.summary', '预测下一句,输入框上给一行进度;右侧面板整理待跟进的事、回看历史摘要,并可旁问且不污染上下文。')
|
|
2538
2466
|
|
|
2539
2467
|
var useSettings = props.useSettings
|
|
2540
|
-
var
|
|
2468
|
+
var lineAdvancedState = useState(false)
|
|
2469
|
+
var toolAdvancedState = useState(false)
|
|
2541
2470
|
var state = useSettings ? useSettings(function (s) { return s }) : undefined
|
|
2542
2471
|
if (!state) return null
|
|
2543
2472
|
|
|
2544
|
-
var
|
|
2545
|
-
var
|
|
2473
|
+
var lineAdvanced = lineAdvancedState[0]
|
|
2474
|
+
var setLineAdvanced = lineAdvancedState[1]
|
|
2475
|
+
var toolAdvanced = toolAdvancedState[0]
|
|
2476
|
+
var setToolAdvanced = toolAdvancedState[1]
|
|
2546
2477
|
var disabled = state.writable === false || state.saving === true
|
|
2547
2478
|
var emptyField = { text: '', overridden: false, invalid: false }
|
|
2548
2479
|
var enabled = state.enabled || emptyField
|
|
2549
2480
|
var recap = state.recap || emptyField
|
|
2550
2481
|
var recapActivity = state.recapActivity || emptyField
|
|
2551
|
-
var recapTiming = state.recapTiming || emptyField
|
|
2552
|
-
var recapReasoning = state.recapReasoning || emptyField
|
|
2553
|
-
var recapPlacement = state.recapPlacement || emptyField
|
|
2554
|
-
var recapMinTurns = state.recapMinTurns || emptyField
|
|
2555
|
-
var recapCooldownTurns = state.recapCooldownTurns || emptyField
|
|
2556
|
-
var recapSimilarityThreshold = state.recapSimilarityThreshold || emptyField
|
|
2557
|
-
var recapMaxWords = state.recapMaxWords || emptyField
|
|
2558
2482
|
var recapModelChain = state.recapModelChain || emptyField
|
|
2559
2483
|
var todayField = state.today || emptyField
|
|
2560
2484
|
var verbosity = state.verbosity || emptyField
|
|
2561
2485
|
var actionable = state.actionable || emptyField
|
|
2486
|
+
var eli5 = state.eli5 || emptyField
|
|
2562
2487
|
var style = state.style || emptyField
|
|
2563
2488
|
var customInstructions = state.customInstructions || emptyField
|
|
2564
2489
|
var toolRepair = state.toolRepair || emptyField
|
|
@@ -2577,9 +2502,6 @@ window.__ModuleLoader__.load({
|
|
|
2577
2502
|
var verbosityOptions = VERBOSITY_OPTIONS.map(function (id) {
|
|
2578
2503
|
return { id: id, label: tr(t, 'reply.verbosity.' + id, id) }
|
|
2579
2504
|
})
|
|
2580
|
-
var placementOptions = RECAP_PLACEMENTS.map(function (id) {
|
|
2581
|
-
return { id: id, label: tr(t, 'settings.recapPlacement.' + id, id === 'below' ? '输入框下方' : '输入框上方') }
|
|
2582
|
-
})
|
|
2583
2505
|
var toolRepairLangOptions = TOOLREPAIR_LANGS.map(function (id) {
|
|
2584
2506
|
return { id: id, label: tr(t, 'settings.toolRepairLang.' + id, id === 'en' ? 'English' : '中文') }
|
|
2585
2507
|
})
|
|
@@ -2609,7 +2531,7 @@ window.__ModuleLoader__.load({
|
|
|
2609
2531
|
|
|
2610
2532
|
return h('div', { className: 'wdxs-page' }, [
|
|
2611
2533
|
h(PluginStyles, { key: 'style', scope: 'settings' }),
|
|
2612
|
-
h('div', { key: 'intro', className: 'wdxs-intro' }, tr(t, '
|
|
2534
|
+
h('div', { key: 'intro', className: 'wdxs-intro' }, tr(t, 'settings.intro', '上半部分是各功能开关,下半部分是回复偏好;回复偏好只打进 system prompt,不改变工具权限。')),
|
|
2613
2535
|
h(Form, {
|
|
2614
2536
|
key: 'form',
|
|
2615
2537
|
labels: formLabels,
|
|
@@ -2617,8 +2539,8 @@ window.__ModuleLoader__.load({
|
|
|
2617
2539
|
onSave: function () { if (typeof props.save === 'function') props.save() },
|
|
2618
2540
|
onDiscard: function () { if (typeof props.discard === 'function') props.discard() },
|
|
2619
2541
|
}, [
|
|
2620
|
-
h('div', { key: '
|
|
2621
|
-
h('div', { key: 'head', className: 'wdxs-groupHead' }, tr(t, '
|
|
2542
|
+
h('div', { key: 'features', className: 'wdxs-group' }, [
|
|
2543
|
+
h('div', { key: 'head', className: 'wdxs-groupHead' }, tr(t, 'settings.group.features', '功能')),
|
|
2622
2544
|
h(ToggleField, {
|
|
2623
2545
|
key: 'prediction',
|
|
2624
2546
|
t: t,
|
|
@@ -2648,36 +2570,6 @@ window.__ModuleLoader__.load({
|
|
|
2648
2570
|
h('div', { key: 'turnLine', className: 'wdxs-group' }, [
|
|
2649
2571
|
h('div', { key: 'head', className: 'wdxs-groupHead' }, tr(t, 'settings.turnLine', '输入框上的一行')),
|
|
2650
2572
|
h('div', { key: 'note', className: 'wdxs-desc', style: { marginBottom: '8px' } }, tr(t, 'settings.turnLine.note', '')),
|
|
2651
|
-
h(ToggleField, {
|
|
2652
|
-
key: 'recapActivity',
|
|
2653
|
-
t: t,
|
|
2654
|
-
title: tr(t, 'settings.recapActivity.title', '活动流水'),
|
|
2655
|
-
description: tr(t, 'settings.recapActivity.description', ''),
|
|
2656
|
-
field: recapActivity,
|
|
2657
|
-
disabled: disabled,
|
|
2658
|
-
onChange: function (next) { edit('recapActivity', String(next)) },
|
|
2659
|
-
onReset: function () { reset('recapActivity') },
|
|
2660
|
-
}),
|
|
2661
|
-
h(ToggleField, {
|
|
2662
|
-
key: 'recapTiming',
|
|
2663
|
-
t: t,
|
|
2664
|
-
title: tr(t, 'settings.recapTiming.title', '状态耗时'),
|
|
2665
|
-
description: tr(t, 'settings.recapTiming.description', ''),
|
|
2666
|
-
field: recapTiming,
|
|
2667
|
-
disabled: disabled,
|
|
2668
|
-
onChange: function (next) { edit('recapTiming', String(next)) },
|
|
2669
|
-
onReset: function () { reset('recapTiming') },
|
|
2670
|
-
}),
|
|
2671
|
-
h(ToggleField, {
|
|
2672
|
-
key: 'recapReasoning',
|
|
2673
|
-
t: t,
|
|
2674
|
-
title: tr(t, 'settings.recapReasoning.title', '思考预览'),
|
|
2675
|
-
description: tr(t, 'settings.recapReasoning.description', ''),
|
|
2676
|
-
field: recapReasoning,
|
|
2677
|
-
disabled: disabled,
|
|
2678
|
-
onChange: function (next) { edit('recapReasoning', String(next)) },
|
|
2679
|
-
onReset: function () { reset('recapReasoning') },
|
|
2680
|
-
}),
|
|
2681
2573
|
h(ToggleField, {
|
|
2682
2574
|
key: 'recap',
|
|
2683
2575
|
t: t,
|
|
@@ -2688,79 +2580,25 @@ window.__ModuleLoader__.load({
|
|
|
2688
2580
|
onChange: function (next) { edit('recap', String(next)) },
|
|
2689
2581
|
onReset: function () { reset('recap') },
|
|
2690
2582
|
}),
|
|
2691
|
-
h(
|
|
2692
|
-
key: '
|
|
2583
|
+
h(ToggleField, {
|
|
2584
|
+
key: 'recapActivity',
|
|
2693
2585
|
t: t,
|
|
2694
|
-
title: tr(t, 'settings.
|
|
2695
|
-
description: tr(t, 'settings.
|
|
2696
|
-
|
|
2697
|
-
value: recapPlacement.text || 'above',
|
|
2698
|
-
overridden: recapPlacement.overridden === true,
|
|
2586
|
+
title: tr(t, 'settings.recapActivity.title', '活动流水'),
|
|
2587
|
+
description: tr(t, 'settings.recapActivity.description', ''),
|
|
2588
|
+
field: recapActivity,
|
|
2699
2589
|
disabled: disabled,
|
|
2700
|
-
onChange: function (next) { edit('
|
|
2701
|
-
onReset: function () { reset('
|
|
2590
|
+
onChange: function (next) { edit('recapActivity', String(next)) },
|
|
2591
|
+
onReset: function () { reset('recapActivity') },
|
|
2702
2592
|
}),
|
|
2703
2593
|
h('button', {
|
|
2704
2594
|
key: 'advanced',
|
|
2705
2595
|
type: 'button',
|
|
2706
2596
|
className: 'wdxs-advanced',
|
|
2707
|
-
'aria-expanded':
|
|
2708
|
-
onClick: function () {
|
|
2709
|
-
},
|
|
2710
|
-
|
|
2597
|
+
'aria-expanded': lineAdvanced,
|
|
2598
|
+
onClick: function () { setLineAdvanced(function (value) { return !value }) },
|
|
2599
|
+
}, lineAdvanced ? tr(t, 'settings.advancedHide', '收起高级设置') : tr(t, 'settings.advanced', '高级(一般不用改)')),
|
|
2600
|
+
lineAdvanced
|
|
2711
2601
|
? h('div', { key: 'advancedFields' }, [
|
|
2712
|
-
h(NumberField, {
|
|
2713
|
-
key: 'minTurns',
|
|
2714
|
-
t: t,
|
|
2715
|
-
title: tr(t, 'settings.recapMinTurns.title', '从第几轮开始'),
|
|
2716
|
-
description: tr(t, 'settings.recapMinTurns.description', ''),
|
|
2717
|
-
field: recapMinTurns,
|
|
2718
|
-
min: 1,
|
|
2719
|
-
max: 50,
|
|
2720
|
-
step: 1,
|
|
2721
|
-
disabled: disabled,
|
|
2722
|
-
onChange: function (next) { edit('recapMinTurns', next) },
|
|
2723
|
-
onReset: function () { reset('recapMinTurns') },
|
|
2724
|
-
}),
|
|
2725
|
-
h(NumberField, {
|
|
2726
|
-
key: 'cooldownTurns',
|
|
2727
|
-
t: t,
|
|
2728
|
-
title: tr(t, 'settings.recapCooldownTurns.title', '摘要更新间隔'),
|
|
2729
|
-
description: tr(t, 'settings.recapCooldownTurns.description', ''),
|
|
2730
|
-
field: recapCooldownTurns,
|
|
2731
|
-
min: 1,
|
|
2732
|
-
max: 50,
|
|
2733
|
-
step: 1,
|
|
2734
|
-
disabled: disabled,
|
|
2735
|
-
onChange: function (next) { edit('recapCooldownTurns', next) },
|
|
2736
|
-
onReset: function () { reset('recapCooldownTurns') },
|
|
2737
|
-
}),
|
|
2738
|
-
h(NumberField, {
|
|
2739
|
-
key: 'maxWords',
|
|
2740
|
-
t: t,
|
|
2741
|
-
title: tr(t, 'settings.recapMaxWords.title', '摘要长度'),
|
|
2742
|
-
description: tr(t, 'settings.recapMaxWords.description', ''),
|
|
2743
|
-
field: recapMaxWords,
|
|
2744
|
-
min: 5,
|
|
2745
|
-
max: 200,
|
|
2746
|
-
step: 1,
|
|
2747
|
-
disabled: disabled,
|
|
2748
|
-
onChange: function (next) { edit('recapMaxWords', next) },
|
|
2749
|
-
onReset: function () { reset('recapMaxWords') },
|
|
2750
|
-
}),
|
|
2751
|
-
h(NumberField, {
|
|
2752
|
-
key: 'similarity',
|
|
2753
|
-
t: t,
|
|
2754
|
-
title: tr(t, 'settings.recapSimilarityThreshold.title', '沿用旧摘要的阈值'),
|
|
2755
|
-
description: tr(t, 'settings.recapSimilarityThreshold.description', ''),
|
|
2756
|
-
field: recapSimilarityThreshold,
|
|
2757
|
-
min: 0,
|
|
2758
|
-
max: 1,
|
|
2759
|
-
step: 0.05,
|
|
2760
|
-
disabled: disabled,
|
|
2761
|
-
onChange: function (next) { edit('recapSimilarityThreshold', next) },
|
|
2762
|
-
onReset: function () { reset('recapSimilarityThreshold') },
|
|
2763
|
-
}),
|
|
2764
2602
|
h(TextField, {
|
|
2765
2603
|
key: 'modelChain',
|
|
2766
2604
|
t: t,
|
|
@@ -2787,44 +2625,55 @@ window.__ModuleLoader__.load({
|
|
|
2787
2625
|
onChange: function (next) { edit('toolRepair', String(next)) },
|
|
2788
2626
|
onReset: function () { reset('toolRepair') },
|
|
2789
2627
|
}),
|
|
2790
|
-
h(
|
|
2791
|
-
key: '
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2628
|
+
h('button', {
|
|
2629
|
+
key: 'advanced',
|
|
2630
|
+
type: 'button',
|
|
2631
|
+
className: 'wdxs-advanced',
|
|
2632
|
+
'aria-expanded': toolAdvanced,
|
|
2633
|
+
onClick: function () { setToolAdvanced(function (value) { return !value }) },
|
|
2634
|
+
}, toolAdvanced ? tr(t, 'settings.advancedHide', '收起高级设置') : tr(t, 'settings.advanced', '高级(一般不用改)')),
|
|
2635
|
+
toolAdvanced
|
|
2636
|
+
? h('div', { key: 'advancedFields' }, [
|
|
2637
|
+
h(SelectField, {
|
|
2638
|
+
key: 'toolRepairLang',
|
|
2639
|
+
t: t,
|
|
2640
|
+
title: tr(t, 'settings.toolRepairLang.title', '修复提示语言'),
|
|
2641
|
+
description: tr(t, 'settings.toolRepairLang.description', ''),
|
|
2642
|
+
options: toolRepairLangOptions,
|
|
2643
|
+
value: toolRepairLang.text || 'zh',
|
|
2644
|
+
overridden: toolRepairLang.overridden === true,
|
|
2645
|
+
disabled: disabled || toolRepair.text === 'false',
|
|
2646
|
+
onChange: function (next) { edit('toolRepairLang', next) },
|
|
2647
|
+
onReset: function () { reset('toolRepairLang') },
|
|
2648
|
+
}),
|
|
2649
|
+
h(NumberField, {
|
|
2650
|
+
key: 'toolRepairMaxCorrections',
|
|
2651
|
+
t: t,
|
|
2652
|
+
title: tr(t, 'settings.toolRepairMaxCorrections.title', '每轮最多纠正次数'),
|
|
2653
|
+
description: tr(t, 'settings.toolRepairMaxCorrections.description', ''),
|
|
2654
|
+
field: toolRepairMaxCorrections,
|
|
2655
|
+
min: 0,
|
|
2656
|
+
max: 10,
|
|
2657
|
+
step: 1,
|
|
2658
|
+
disabled: disabled || toolRepair.text === 'false',
|
|
2659
|
+
onChange: function (next) { edit('toolRepairMaxCorrections', next) },
|
|
2660
|
+
onReset: function () { reset('toolRepairMaxCorrections') },
|
|
2661
|
+
}),
|
|
2662
|
+
h(ToggleField, {
|
|
2663
|
+
key: 'toolRepairDebugLog',
|
|
2664
|
+
t: t,
|
|
2665
|
+
title: tr(t, 'settings.toolRepairDebugLog.title', '诊断日志'),
|
|
2666
|
+
description: tr(t, 'settings.toolRepairDebugLog.description', ''),
|
|
2667
|
+
field: toolRepairDebugLog,
|
|
2668
|
+
disabled: disabled || toolRepair.text === 'false',
|
|
2669
|
+
onChange: function (next) { edit('toolRepairDebugLog', String(next)) },
|
|
2670
|
+
onReset: function () { reset('toolRepairDebugLog') },
|
|
2671
|
+
}),
|
|
2672
|
+
])
|
|
2673
|
+
: null,
|
|
2825
2674
|
]),
|
|
2826
|
-
h('div', { key: '
|
|
2827
|
-
h('div', { key: 'head', className: 'wdxs-groupHead' }, tr(t, 'reply.group.
|
|
2675
|
+
h('div', { key: 'reply', className: 'wdxs-group' }, [
|
|
2676
|
+
h('div', { key: 'head', className: 'wdxs-groupHead' }, tr(t, 'reply.group.reply', '回复方式')),
|
|
2828
2677
|
h(SelectField, {
|
|
2829
2678
|
key: 'verbosity',
|
|
2830
2679
|
t: t,
|
|
@@ -2837,9 +2686,28 @@ window.__ModuleLoader__.load({
|
|
|
2837
2686
|
onChange: function (next) { edit('verbosity', next) },
|
|
2838
2687
|
onReset: function () { reset('verbosity') },
|
|
2839
2688
|
}),
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2689
|
+
h(SelectField, {
|
|
2690
|
+
key: 'style',
|
|
2691
|
+
t: t,
|
|
2692
|
+
title: tr(t, 'reply.style.title', '回复风格'),
|
|
2693
|
+
description: tr(t, 'reply.style.description', ''),
|
|
2694
|
+
options: styleOptions,
|
|
2695
|
+
value: style.text,
|
|
2696
|
+
overridden: style.overridden === true,
|
|
2697
|
+
disabled: disabled,
|
|
2698
|
+
onChange: function (next) { edit('style', next) },
|
|
2699
|
+
onReset: function () { reset('style') },
|
|
2700
|
+
}),
|
|
2701
|
+
h(ToggleField, {
|
|
2702
|
+
key: 'eli5',
|
|
2703
|
+
t: t,
|
|
2704
|
+
title: tr(t, 'reply.eli5.title', 'ELI5 模式'),
|
|
2705
|
+
description: tr(t, 'reply.eli5.description', ''),
|
|
2706
|
+
field: eli5,
|
|
2707
|
+
disabled: disabled,
|
|
2708
|
+
onChange: function (next) { edit('eli5', String(next)) },
|
|
2709
|
+
onReset: function () { reset('eli5') },
|
|
2710
|
+
}),
|
|
2843
2711
|
h(ToggleField, {
|
|
2844
2712
|
key: 'actionable',
|
|
2845
2713
|
t: t,
|
|
@@ -2850,30 +2718,18 @@ window.__ModuleLoader__.load({
|
|
|
2850
2718
|
onChange: function (next) { edit('actionable', String(next)) },
|
|
2851
2719
|
onReset: function () { reset('actionable') },
|
|
2852
2720
|
}),
|
|
2853
|
-
h(
|
|
2854
|
-
key: '
|
|
2721
|
+
h(CustomTextField, {
|
|
2722
|
+
key: 'custom',
|
|
2855
2723
|
t: t,
|
|
2856
|
-
title: tr(t, 'reply.
|
|
2857
|
-
description: tr(t, 'reply.
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
overridden: style.overridden === true,
|
|
2724
|
+
title: tr(t, 'reply.custom.title', '自定义指令'),
|
|
2725
|
+
description: tr(t, 'reply.custom.description', ''),
|
|
2726
|
+
placeholder: tr(t, 'reply.custom.placeholder', ''),
|
|
2727
|
+
field: customInstructions,
|
|
2861
2728
|
disabled: disabled,
|
|
2862
|
-
onChange: function (next) { edit('
|
|
2863
|
-
onReset: function () { reset('
|
|
2729
|
+
onChange: function (next) { edit('customInstructions', next) },
|
|
2730
|
+
onReset: function () { reset('customInstructions') },
|
|
2864
2731
|
}),
|
|
2865
2732
|
]),
|
|
2866
|
-
h(CustomTextField, {
|
|
2867
|
-
key: 'custom',
|
|
2868
|
-
t: t,
|
|
2869
|
-
title: tr(t, 'reply.custom.title', '自定义指令'),
|
|
2870
|
-
description: tr(t, 'reply.custom.description', ''),
|
|
2871
|
-
placeholder: tr(t, 'reply.custom.placeholder', ''),
|
|
2872
|
-
field: customInstructions,
|
|
2873
|
-
disabled: disabled,
|
|
2874
|
-
onChange: function (next) { edit('customInstructions', next) },
|
|
2875
|
-
onReset: function () { reset('customInstructions') },
|
|
2876
|
-
}),
|
|
2877
2733
|
]),
|
|
2878
2734
|
])
|
|
2879
2735
|
}
|
|
@@ -2950,8 +2806,7 @@ window.__ModuleLoader__.load({
|
|
|
2950
2806
|
}, PredictionOverlay)
|
|
2951
2807
|
})
|
|
2952
2808
|
|
|
2953
|
-
//
|
|
2954
|
-
// (composer.dock)。两个 slot 都注册,组件按配置只渲染其中一个。
|
|
2809
|
+
// 一行固定放在输入框上方(input.dock)。
|
|
2955
2810
|
function readTurnFeed(sessionId) {
|
|
2956
2811
|
try {
|
|
2957
2812
|
var binding = ctx.sessions && typeof ctx.sessions.binding === 'function' ? ctx.sessions.binding(sessionId) : undefined
|
|
@@ -2961,7 +2816,7 @@ window.__ModuleLoader__.load({
|
|
|
2961
2816
|
}
|
|
2962
2817
|
}
|
|
2963
2818
|
|
|
2964
|
-
function registerTurnLine(slot, id
|
|
2819
|
+
function registerTurnLine(slot, id) {
|
|
2965
2820
|
ctx.slots.inject(slot, function () {
|
|
2966
2821
|
return ctx.slots.register({
|
|
2967
2822
|
name: slot,
|
|
@@ -2971,7 +2826,6 @@ window.__ModuleLoader__.load({
|
|
|
2971
2826
|
inject: function (sessionId) {
|
|
2972
2827
|
return {
|
|
2973
2828
|
sessionId: sessionId,
|
|
2974
|
-
placement: placement,
|
|
2975
2829
|
readFeed: readTurnFeed,
|
|
2976
2830
|
hooks: { settings: formSource },
|
|
2977
2831
|
}
|
|
@@ -2980,8 +2834,7 @@ window.__ModuleLoader__.load({
|
|
|
2980
2834
|
})
|
|
2981
2835
|
}
|
|
2982
2836
|
|
|
2983
|
-
registerTurnLine('conversation.input.dock', 'wdx-turn-line-above'
|
|
2984
|
-
registerTurnLine('conversation.composer.dock', 'wdx-turn-line-below', 'below')
|
|
2837
|
+
registerTurnLine('conversation.input.dock', 'wdx-turn-line-above')
|
|
2985
2838
|
|
|
2986
2839
|
ctx.slots.inject('plugins.bundle.config', function () {
|
|
2987
2840
|
return ctx.slots.register({
|
|
@@ -3008,8 +2861,6 @@ window.__ModuleLoader__.load({
|
|
|
3008
2861
|
exports.buildTurnSegments = buildTurnSegments
|
|
3009
2862
|
exports.activityText = activityText
|
|
3010
2863
|
exports.describeToolCall = describeToolCall
|
|
3011
|
-
exports.formatDuration = formatDuration
|
|
3012
|
-
exports.RECAP_PLACEMENTS = RECAP_PLACEMENTS
|
|
3013
2864
|
exports.ReliefPanel = ReliefPanel
|
|
3014
2865
|
exports.ReliefIcon = ReliefIcon
|
|
3015
2866
|
exports.BtwSection = BtwSection
|
package/cordis.patch.yml
CHANGED
package/docs/DETAIL.md
CHANGED
|
@@ -12,10 +12,10 @@ After a turn, grey text in the composer guesses what you are about to send. Pres
|
|
|
12
12
|
|
|
13
13
|
### The line above the input
|
|
14
14
|
|
|
15
|
-
A per-turn line that answers "what is this turn doing, and where is it"
|
|
15
|
+
A per-turn line that answers "what is this turn doing, and where is it", always above the composer:
|
|
16
16
|
|
|
17
|
-
- **Semantic recap** (on by default): a cheap model summarizes the latest turn every
|
|
18
|
-
- **Activity feed
|
|
17
|
+
- **Semantic recap** (on by default): a cheap model summarizes the latest turn every turn.
|
|
18
|
+
- **Activity feed**: generated locally with zero model calls, off by default.
|
|
19
19
|
|
|
20
20
|
The line never enters the model context, and generated recaps are kept in the WDX Relief panel for review.
|
|
21
21
|
|
|
@@ -33,7 +33,11 @@ Length **short / standard / detailed** and style **default / professional / frie
|
|
|
33
33
|
|
|
34
34
|
### Action-first
|
|
35
35
|
|
|
36
|
-
On by default: result and next step first, one sentence when one suffices,
|
|
36
|
+
On by default: result and next step first, one sentence when one suffices, while keeping risks, failure conditions, and work you have already authorized.
|
|
37
|
+
|
|
38
|
+
### ELI5 mode
|
|
39
|
+
|
|
40
|
+
On by default: injects one line, "talk to me like I'm 5 by default; go deeper when I ask". Turning it off removes that line entirely.
|
|
37
41
|
|
|
38
42
|
### Tool-call leak guard
|
|
39
43
|
|
|
@@ -46,7 +50,7 @@ In the DSH sidebar, go to **Plugins → Add plugin**, enter `dsh-wdx-relief`, th
|
|
|
46
50
|
## Requirements and limits
|
|
47
51
|
|
|
48
52
|
- DSH Web profile; the plugin depends on the `connection`, `sessions`, and `tools` services.
|
|
49
|
-
- A default model must be configured. Prediction, the semantic recap, Follow-ups, and Ask aside make model calls; activity feed
|
|
53
|
+
- A default model must be configured. Prediction, the semantic recap, Follow-ups, and Ask aside make model calls; the activity feed does not. The tool-call guard is zero-cost until it fires, then costs at most one extra model step (bounded by the correction limit).
|
|
50
54
|
- Reply style is a soft prompt constraint, not a hard length limit.
|
|
51
55
|
- Recaps are stored locally in `$DSH_HOME/wdx-relief/recaps.json` (up to 300 entries); clearing that file clears the history.
|
|
52
56
|
- Ask aside keeps answers in panel memory only; closing the panel or switching sessions clears them.
|
package/docs/DETAIL.zh.md
CHANGED
|
@@ -12,10 +12,10 @@ WDX Relief 降低 DeepSeek Harness 的日常使用摩擦。七个功能,全部
|
|
|
12
12
|
|
|
13
13
|
### 输入框上的一行
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
逐轮显示「这一轮在做什么、到哪了」,固定放在输入框上方:
|
|
16
16
|
|
|
17
|
-
-
|
|
18
|
-
-
|
|
17
|
+
- **语义摘要**(默认开启):每轮用一次便宜模型概括最近一轮。
|
|
18
|
+
- **活动流水**:本地生成、零模型调用,默认关闭。
|
|
19
19
|
|
|
20
20
|
这一行永不进入模型上下文,生成过的摘要会留在 WDX Relief 面板里。
|
|
21
21
|
|
|
@@ -33,7 +33,11 @@ WDX Relief 降低 DeepSeek Harness 的日常使用摩擦。七个功能,全部
|
|
|
33
33
|
|
|
34
34
|
### 便于行动
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
默认开启:先给结果和下一步,能一句说清的不写一段,同时保留风险、失败条件和已授权该做的工作。
|
|
37
|
+
|
|
38
|
+
### ELI5 模式
|
|
39
|
+
|
|
40
|
+
默认开启:注入一句「默认用 ELI5 的方式和我说话,如果我要求则深入讲解」。关掉后这句完全不出现。
|
|
37
41
|
|
|
38
42
|
### 工具调用泄漏守卫
|
|
39
43
|
|
|
@@ -46,7 +50,7 @@ WDX Relief 降低 DeepSeek Harness 的日常使用摩擦。七个功能,全部
|
|
|
46
50
|
## 运行要求与限制
|
|
47
51
|
|
|
48
52
|
- DSH Web profile;插件依赖 `connection`、`sessions` 与 `tools` 服务。
|
|
49
|
-
-
|
|
53
|
+
- 需要配置默认模型。预测、语义摘要、待跟进、旁问会调用模型;活动流水不调用。工具调用守卫平时零开销,触发时最多多一次模型步(受纠正次数上限约束)。
|
|
50
54
|
- 回复风格是 prompt 软约束,不是硬性长度截断。
|
|
51
55
|
- 摘要存放在本地 `$DSH_HOME/wdx-relief/recaps.json`(最多 300 条);清空该文件即清空历史。
|
|
52
56
|
- 旁问回答只存在面板内存里;关闭面板或切换会话即清空。
|
package/docs/guide.md
CHANGED
|
@@ -31,19 +31,13 @@ HMR 生效。
|
|
|
31
31
|
| 字段 | 默认 | 说明 |
|
|
32
32
|
|---|---|---|
|
|
33
33
|
| `enabled` | `true` | 输入框预测开关 |
|
|
34
|
-
| `recap` | `true` |
|
|
34
|
+
| `recap` | `true` | 语义摘要开关:每轮用一次便宜模型写「现在到哪」 |
|
|
35
35
|
| `recapActivity` | `false` | 活动流水开关:读文件 / 跑命令 / 改代码,本地生成 |
|
|
36
|
-
| `recapTiming` | `false` | 状态耗时开关:这一轮跑了多久,本地生成 |
|
|
37
|
-
| `recapReasoning` | `false` | 思考预览开关:折叠推理的第一行,本地生成 |
|
|
38
|
-
| `recapPlacement` | `above` | `above` / `below`,这一行放在输入框上方还是下方 |
|
|
39
|
-
| `recapMinTurns` | `3` | 至少几轮用户消息后才开始生成语义摘要 |
|
|
40
|
-
| `recapCooldownTurns` | `1` | 每隔几轮更新一次语义摘要;`1` = 每轮(默认每轮都更新,问完下一轮就换新) |
|
|
41
|
-
| `recapSimilarityThreshold` | `0.9` | 新旧摘要相似度达到这个值才沿用旧的一行(调低会更容易出现「没更新」) |
|
|
42
|
-
| `recapMaxWords` | `40` | 摘要词预算;中文按字算 |
|
|
43
36
|
| `recapModelChain` | `''` | 摘要模型链,按顺序尝试 `provider/model`;留空自动挑便宜模型 |
|
|
44
37
|
| `today` | `true` | 右侧栏 WDX Relief 页面里的「待跟进」清单 |
|
|
45
38
|
| `verbosity` | `low` | `low` / `medium` / `high`(旧值 `model` 仍兼容) |
|
|
46
|
-
| `actionable` | `true` |
|
|
39
|
+
| `actionable` | `true` | 便于行动:先结果/下一步、保留风险 |
|
|
40
|
+
| `eli5` | `true` | 默认用 ELI5 的方式说话,用户要求时再深入讲解 |
|
|
47
41
|
| `style` | `default` | `default` / `professional` / `friendly` / `blunt` / `follow` |
|
|
48
42
|
| `customInstructions` | `''` | 最多 2000 字 |
|
|
49
43
|
| `toolRepair` | `true` | 工具调用泄漏守卫总开关 |
|
|
@@ -51,7 +45,7 @@ HMR 生效。
|
|
|
51
45
|
| `toolRepairMaxCorrections` | `2` | 每轮最多自动纠正几次;`0` 关闭自动纠正 |
|
|
52
46
|
| `toolRepairDebugLog` | `false` | 输出工具调用修复的诊断日志 |
|
|
53
47
|
|
|
54
|
-
|
|
48
|
+
「工具调用守卫」分组顶层只有总开关;修复提示语言、每轮最多纠正次数、诊断日志收进「高级」折叠,改动即时生效。
|
|
55
49
|
|
|
56
50
|
旧版本的 `writingStyle` / `baseStyle` 仍保留在 schema 里做迁移:没有 `style` 时,`writingStyle: true` 映射为 `follow`,`baseStyle` 的 professional/friendly/blunt 映射到同名风格;设置页只写新的 `style`。
|
|
57
51
|
|
|
@@ -68,9 +62,6 @@ bundle 层只声明入口和输入层的开关,其余字段由 schema 默认
|
|
|
68
62
|
toolRepairLang: zh
|
|
69
63
|
toolRepairMaxCorrections: 2
|
|
70
64
|
recapActivity: false
|
|
71
|
-
recapTiming: false
|
|
72
|
-
recapReasoning: false
|
|
73
|
-
recapPlacement: above
|
|
74
65
|
today: true
|
|
75
66
|
```
|
|
76
67
|
|
|
@@ -89,25 +80,22 @@ bundle 层只声明入口和输入层的开关,其余字段由 schema 默认
|
|
|
89
80
|
|
|
90
81
|
## 输入框上的一行
|
|
91
82
|
|
|
92
|
-
|
|
83
|
+
这一行是**逐轮**的,不是会话级的;它回答「这一轮在做什么、到哪了」。两个开关,默认只开语义摘要:
|
|
93
84
|
|
|
94
85
|
| 片段 | 来源 | 成本 |
|
|
95
86
|
|---|---|---|
|
|
96
87
|
| 活动流水 | `session.binding.eventSource` 里的 `tool/call`、`tool/result`、步骤事件 | 本地,零调用 |
|
|
97
|
-
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
按 `recapPlacement` 只渲染其中一个,并且只有匹配的那个会发起摘要请求;两边是同一个组件。
|
|
103
|
-
2. 活动 / 耗时 / 思考只读 `ctx.sessions.binding(sessionId).eventSource`;窗口变化时 React
|
|
104
|
-
重算,运行中每秒刷新耗时。**不写会话、不写命令日志、不注入 prompt**。
|
|
88
|
+
| 语义摘要 | `POST /api/wdx-relief/recap`,Host 用便宜模型概括最近一轮 | 每轮一次便宜模型 |
|
|
89
|
+
|
|
90
|
+
1. 固定注册在 `conversation.input.dock`(输入框上方),不再提供上下位置选项。
|
|
91
|
+
2. 活动流水只读 `ctx.sessions.binding(sessionId).eventSource`;窗口变化时 React
|
|
92
|
+
重算。**不写会话、不写命令日志、不注入 prompt**。
|
|
105
93
|
3. 轮次结束后,客户端按 `sessionId + turn` 去重请求一次回顾。Host 只读
|
|
106
|
-
`session.deriveMessages()
|
|
107
|
-
-
|
|
108
|
-
-
|
|
109
|
-
-
|
|
110
|
-
|
|
94
|
+
`session.deriveMessages()`,取最近一轮真人用户/助手文本,门限固定为:
|
|
95
|
+
- 用户消息满 3 轮才开始(`minTurns`);
|
|
96
|
+
- 每轮更新;新摘要与已显示的摘要词集合 Jaccard 相似度 ≥ 0.9 时沿用上一行;
|
|
97
|
+
- 词预算 40,中文按字、英文按词。
|
|
98
|
+
这些阈值不再作为配置暴露。
|
|
111
99
|
4. 模型链先按 `recapModelChain` 里的 `provider/model` 顺序尝试;裸模型 id 会先在默认 provider
|
|
112
100
|
下解析,再查各 provider 的目录。没有配置时,从目录里挑名字带 `flash` / `mini` / `lite` /
|
|
113
101
|
`haiku` 等词的模型,最后退回 `agentDefaultModel.currentSelection()`。某个模型失败(凭据缺失、
|
|
@@ -178,13 +166,17 @@ Host 在 `ctx.systemPrompt` 注册:
|
|
|
178
166
|
}
|
|
179
167
|
```
|
|
180
168
|
|
|
181
|
-
`buildStylePrompt`
|
|
169
|
+
`buildStylePrompt` 只输出生效项:默认开启的长度、便于行动、ELI5 与风格都会写进 prompt,关掉的项不出现;
|
|
170
|
+
开头加一段“只影响表达方式”的说明。自定义指令最多 2000 字;
|
|
182
171
|
`interpolate: false` 让其中的 `{{...}}` 保持字面量,避免 prompt 装配报错。
|
|
183
172
|
|
|
184
173
|
「便于行动」规则改编自 `agent-configs-skills/skills/i-have-adhd`(MIT):开头给结果/下一步、
|
|
185
|
-
按内容比例组织(句 > 段 >
|
|
174
|
+
按内容比例组织(句 > 段 > 清单)、保留风险与失败条件、不复述、
|
|
186
175
|
不把已获授权的工作交回用户。
|
|
187
176
|
|
|
177
|
+
「ELI5 模式」默认开启,只注入一句「默认用 ELI5 的方式和我说话,如果我要求则深入讲解」;
|
|
178
|
+
关掉后这句完全不出现,其余长度、风格、自定义指令不受影响。
|
|
179
|
+
|
|
188
180
|
## 工具调用泄漏守卫
|
|
189
181
|
|
|
190
182
|
解决一类静默失败:模型把工具调用**直接写成正文**(`<tool_call>` / `<function=NAME>` / `<parameter=NAME>`,
|
|
@@ -210,13 +202,13 @@ Host 在 `ctx.systemPrompt` 注册:
|
|
|
210
202
|
- 消息用生产者自有 source kind(`runtime-context` / `plugin:dsh-wdx-relief`),符合 v4 session 格式。
|
|
211
203
|
- 单测:`test/toolCallDetect.test.mjs`(含 strata 样本、JSON 信封、反例)与 `test/toolCallRepair.test.mjs`
|
|
212
204
|
(M2/M3/M4/M7/M9 全链路 mock)。
|
|
213
|
-
-
|
|
214
|
-
`readToolRepairConfig` 读取的键一一对应,保存后 Host 侧下一个事件即按新值生效。
|
|
205
|
+
- 设置页有独立分组「工具调用守卫」:总开关在顶层,修复提示语言、每轮最多纠正次数、诊断日志收在「高级」折叠里;
|
|
206
|
+
客户端表单字段与 `readToolRepairConfig` 读取的键一一对应,保存后 Host 侧下一个事件即按新值生效。
|
|
215
207
|
|
|
216
208
|
## 实机验证记录(DSH 0.2.2-rc.1,历史配置页)
|
|
217
209
|
|
|
218
|
-
- 侧边栏「插件」→ **WDX Relief** bundle
|
|
219
|
-
- 下拉框、开关、textarea 均可写入;关闭再打开设置后保持;`--dump-config` 能看到 `verbosity`、`actionable`、`style`、`customInstructions`;
|
|
210
|
+
- 侧边栏「插件」→ **WDX Relief** bundle 页出现配置区:功能开关(预测、待跟进)、输入框上的一行、回复方式、工具调用守卫;
|
|
211
|
+
- 下拉框、开关、textarea 均可写入;关闭再打开设置后保持;`--dump-config` 能看到 `verbosity`、`actionable`、`eli5`、`style`、`customInstructions`;
|
|
220
212
|
- Settings 导航不再出现「回复」,General 不再出现预测行(已迁移到插件配置);
|
|
221
213
|
- 输入框灰字出现、打字隐藏、清空重现,Tab 真正写入 Lexical;
|
|
222
214
|
- 关闭预测开关后不再发预测请求;
|
|
@@ -243,7 +235,7 @@ Host 在 `ctx.systemPrompt` 注册:
|
|
|
243
235
|
## 已知限制
|
|
244
236
|
|
|
245
237
|
- 回复风格是 prompt 软约束,不是硬截断;复杂任务仍可能写长。
|
|
246
|
-
-
|
|
238
|
+
- 语义摘要依赖一次模型调用;模型失败时退回本地短拼接,且**失败结果不缓存、不写历史**,下一轮会重试。活动流水不受影响。
|
|
247
239
|
- 「会话回顾」历史存在本地 `$DSH_HOME/wdx-relief/recaps.json`,最多 300 条;换机器或清空该文件即清空历史。
|
|
248
240
|
- 旁问只把最近几轮文本作为背景;它不会读取工作区文件,也不会自动带上未提交的改动。
|
|
249
241
|
- 旁问默认使用当前会话模型,也可以在面板底部选别的模型;选择只影响这一次/这一组旁问,不改主会话模型。
|
package/index.js
CHANGED
|
@@ -49,39 +49,11 @@ export const Config = Schema.object({
|
|
|
49
49
|
recap: Schema.boolean()
|
|
50
50
|
.default(true)
|
|
51
51
|
.volatile()
|
|
52
|
-
.description('
|
|
52
|
+
.description('输入框上方那一行的语义摘要:每轮用一次便宜模型写「现在到哪」,不进入模型上下文'),
|
|
53
53
|
recapActivity: Schema.boolean()
|
|
54
54
|
.default(false)
|
|
55
55
|
.volatile()
|
|
56
56
|
.description('输入框上方那一行的活动流水:正在读文件、跑命令、改代码,本地生成,零模型调用'),
|
|
57
|
-
recapTiming: Schema.boolean()
|
|
58
|
-
.default(false)
|
|
59
|
-
.volatile()
|
|
60
|
-
.description('输入框上方那一行的耗时:这一轮跑了多久,本地生成'),
|
|
61
|
-
recapReasoning: Schema.boolean()
|
|
62
|
-
.default(false)
|
|
63
|
-
.volatile()
|
|
64
|
-
.description('输入框上方那一行的思考预览:折叠推理的第一行,本地生成'),
|
|
65
|
-
recapPlacement: Schema.union(['above', 'below'])
|
|
66
|
-
.default('above')
|
|
67
|
-
.volatile()
|
|
68
|
-
.description('这一行放在输入框上方还是下方'),
|
|
69
|
-
recapMinTurns: Schema.number()
|
|
70
|
-
.default(3)
|
|
71
|
-
.volatile()
|
|
72
|
-
.description('至少经过几轮用户消息后才开始生成语义摘要'),
|
|
73
|
-
recapCooldownTurns: Schema.number()
|
|
74
|
-
.default(1)
|
|
75
|
-
.volatile()
|
|
76
|
-
.description('每隔几轮才更新语义摘要;1 表示每轮(默认每轮都更新)'),
|
|
77
|
-
recapSimilarityThreshold: Schema.number()
|
|
78
|
-
.default(0.9)
|
|
79
|
-
.volatile()
|
|
80
|
-
.description('新旧摘要相似度达到这个值时才沿用旧的一行(0–1,默认 0.9)'),
|
|
81
|
-
recapMaxWords: Schema.number()
|
|
82
|
-
.default(40)
|
|
83
|
-
.volatile()
|
|
84
|
-
.description('语义摘要的词预算;中文按字算'),
|
|
85
57
|
recapModelChain: Schema.string()
|
|
86
58
|
.default('')
|
|
87
59
|
.volatile()
|
|
@@ -98,6 +70,10 @@ export const Config = Schema.object({
|
|
|
98
70
|
.default(true)
|
|
99
71
|
.volatile()
|
|
100
72
|
.description('便于行动:先给结果和下一步,少铺垫,保留风险与失败条件'),
|
|
73
|
+
eli5: Schema.boolean()
|
|
74
|
+
.default(true)
|
|
75
|
+
.volatile()
|
|
76
|
+
.description('默认用 ELI5 的方式说话:说人话、少术语,用户要求时再深入讲解'),
|
|
101
77
|
style: Schema.union(STYLE_VALUES)
|
|
102
78
|
.volatile()
|
|
103
79
|
.description('回复风格:default / professional / friendly / blunt / follow'),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-wdx-relief",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Take the friction out of daily DSH work: predicted next messages, a live one-line turn recap above the composer, and sidebar side questions with a composer-style model picker that stay out of the model context.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
package/src/recap.js
CHANGED
|
@@ -301,7 +301,9 @@ function unitRatio(value, fallback) {
|
|
|
301
301
|
return typeof value === 'number' && Number.isFinite(value) && value >= 0 && value <= 1 ? value : fallback
|
|
302
302
|
}
|
|
303
303
|
|
|
304
|
-
/** 把 Config 读取集中在一处,服务和测试都按同一套默认值走。
|
|
304
|
+
/** 把 Config 读取集中在一处,服务和测试都按同一套默认值走。
|
|
305
|
+
* minTurns / cooldownTurns / similarityThreshold / maxWords 已从界面撤掉,
|
|
306
|
+
* 保留读取只为服务层测试;生产里配置没有这些引用,回落到下面的默认值。 */
|
|
305
307
|
export function readRecapConfig(config) {
|
|
306
308
|
return {
|
|
307
309
|
enabled: read(config, 'recap', true) !== false,
|
package/src/style.js
CHANGED
|
@@ -28,12 +28,14 @@ const STYLE_LINES = {
|
|
|
28
28
|
const ACTIONABLE_LINES = [
|
|
29
29
|
'- 便于行动:开头直接给结果或最相关的下一步,不写「好的」「我来看看」之类铺垫;需要用户操作时,把命令、路径或决定放在显眼位置。',
|
|
30
30
|
'- 能一句话说清的,不写成一段;能一段说清的,不列成清单;多步操作用短编号列表,一步对应一个可完成动作;次要信息放后面。',
|
|
31
|
-
'- 不用复杂名词堆砌代替解释:必须使用术语时,先用一句白话说明它是什么、为什么重要。',
|
|
32
31
|
'- 重要细节、风险和失败条件不因精简而省略;出错时直接说症状、已知原因和下一步。',
|
|
33
32
|
'- 不复述用户已说过或上一轮结论;长任务或中断后,用一句话说明已完成什么、当前卡在哪里。',
|
|
34
33
|
'- 已获授权且工具可执行时直接完成,不把本可代办的工作交回用户;全部完成后自然结束。',
|
|
35
34
|
]
|
|
36
35
|
|
|
36
|
+
/** ELI5 解释层的固定句子;默认开启,关掉即完全不出现。 */
|
|
37
|
+
const ELI5_LINE = '默认用 ELI5 的方式和我说话,如果我要求则深入讲解。'
|
|
38
|
+
|
|
37
39
|
const MAX_CUSTOM_CHARS = 2000
|
|
38
40
|
|
|
39
41
|
function read(config, field, fallback) {
|
|
@@ -79,6 +81,10 @@ export function buildStylePrompt(config) {
|
|
|
79
81
|
lines.push(...ACTIONABLE_LINES)
|
|
80
82
|
}
|
|
81
83
|
|
|
84
|
+
if (read(config, 'eli5', true) === true) {
|
|
85
|
+
lines.push(`- ${ELI5_LINE}`)
|
|
86
|
+
}
|
|
87
|
+
|
|
82
88
|
const style = resolveStyle(config)
|
|
83
89
|
if (style !== 'default') {
|
|
84
90
|
lines.push(`- ${STYLE_LINES[style]}`)
|
|
@@ -101,6 +107,7 @@ export function buildStylePrompt(config) {
|
|
|
101
107
|
export const STYLE_DEFAULTS = {
|
|
102
108
|
verbosity: 'low',
|
|
103
109
|
actionable: true,
|
|
110
|
+
eli5: true,
|
|
104
111
|
style: 'default',
|
|
105
112
|
customInstructions: '',
|
|
106
113
|
}
|