dsh-reasoning-distill 0.1.7 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  本插件的版本变更记录。
4
4
 
5
+ ## 0.1.8
6
+
7
+ - **调整初始配置**:刚安装时默认规则里的「对可续接子代理启用」「附带工具调用结果」「压缩最终回答轮」现在默认关闭。新建的逐模型规则同样以一个全关的初始层开始(三种会话类型全关,上述三项也显式关闭),不会因为现有默认规则把它们开着而自动继承为开。
8
+ - 面板提示与 README 的默认值说明同步更新;已有存储配置不迁移。
9
+
5
10
  ## 0.1.7
6
11
 
7
12
  - **调整内置蒸馏提示词**:明确要求保留原思考中正确且有效的推理过程,而不是直接跳到结论。可以压缩措辞、合并重复、删除噪音,但不能省略有效的推导步骤;只保留结论的短版本视为错误。自我纠正时保留纠正后的整条推理线(结论、证据与有效步骤),只丢弃被放弃的尝试。
package/README.md CHANGED
@@ -154,14 +154,14 @@ node scripts/dsh-inplace-patch.mjs --check # 打全了输出 PATCHED
154
154
  | 选项 | 含义 |
155
155
  | --- | --- |
156
156
  | 对主对话启用(`enabled`) | 该模型在主对话里是否压缩。 |
157
- | 对可续接子代理启用(`continuableSubagents`) | 是否也压缩可续聊子代理(如队友)。默认开,因为它们会持续重发思考。 |
157
+ | 对可续接子代理启用(`continuableSubagents`) | 是否也压缩可续聊子代理(如队友)。默认关;需要时再打开。 |
158
158
  | 对一次性子代理启用(`oneShotSubagents`) | 是否压缩跑完即结束的一次性委派。默认关,因为它的最终回答之后没有任何请求会重放这次压缩。 |
159
159
  | 最大生效深度(`continuableMaxDepth` / `oneShotMaxDepth`) | 两个子代理开关各自带一个深度上限:比该深度更深的子孙代理不再压缩,0 表示不限制。 |
160
160
  | 触发阈值(`thresholdTokens`) | 一步思考估算超过多少 token 才触发,默认 4000。 |
161
161
  | 按上下文占用限制触发(`contextCap` / `maxContextPercent`) | 默认开、60%。该模型的上下文占用超过这个比例时,即使单步思考达到阈值也不再压缩——否则压缩刚生效、没几轮就被宿主内置的上下文整体压缩收走,白花一次蒸馏的钱。占用比例用宿主自己的 token 计量与上下文窗口计算,和内置上下文压缩触发读的是同一个值,整段压缩后会自动变短。关闭时不看占用比例(与旧行为一致),比例输入框会变灰。 |
162
162
  | 最低节省(`minSavedTokens`) | 压缩结果至少要比原文省这么多 token 才采用,默认 600;未达到时原文保持不变,但这次蒸馏的开销照样计入。 |
163
- | 附带工具调用结果(`includeToolResults`) | 交给蒸馏模型的上下文里是否附上该步工具调用的结果;工具调用本身始终附带。 |
164
- | 压缩最终回答轮(`includeFinalTurns`) | 是否压缩没有工具调用的收尾步(最终回答)。 |
163
+ | 附带工具调用结果(`includeToolResults`) | 交给蒸馏模型的上下文里是否附上该步工具调用的结果;工具调用本身始终附带。默认关(刚安装的默认规则与新建的逐模型规则都是关的)。 |
164
+ | 压缩最终回答轮(`includeFinalTurns`) | 是否压缩没有工具调用的收尾步(最终回答)。默认关(同上)。 |
165
165
  | 超时(`timeoutMs`) | 蒸馏必须在这个时间内完成;到点就放弃这次压缩(原文不动、不记账),下一步只等这么久。0 = 不设限,一直等到出结果。 |
166
166
  | 背景块长度上限(`maxInputChars`) | 交给蒸馏模型的单个上下文块(例如一条工具结果)的字符上限,0 = 不限。 |
167
167
  | 蒸馏结果长度上限(`maxOutputChars`) | 实际采用并重放的压缩结果字符上限,0 = 不限。 |
@@ -341,7 +341,7 @@ window.__ModuleLoader__.load({
341
341
  "settings.maxDepth": "最大生效深度",
342
342
  "settings.maxDepthHint": "两个子代理开关各自带一个深度上限:超过该深度的子孙代理不再压缩(填 0 = 不限制)。深度由宿主持久化在会话 header 上,重启后续接仍按同一深度判定。",
343
343
  "settings.subagentsLocked": "当前后端(另开分支会话)无法承接委派:交接会打断子代理的委派关系,因此这两条子代理开关已被关闭并锁定。换成不做分支的后端即可重新开启。",
344
- "settings.kindsHint": "三种会话各自独立开关;宿主用 header.origin 与 subagent/descriptor 的 mode 区分它们。可续接子代理(如队友)会持续重发思考,默认开;一次性委派跑完即返回,最终回答的压缩没有任何请求会重放它,默认关。",
344
+ "settings.kindsHint": "三种会话各自独立开关;宿主用 header.origin 与 subagent/descriptor 的 mode 区分它们。可续接子代理(如队友)会持续重发思考,需要时再打开,默认关;一次性委派跑完即返回,最终回答的压缩没有任何请求会重放它,默认也关。",
345
345
  "settings.ruleIdle": "三种会话都未启用时,该规则的其他设置不会生效(届时会锁定)。",
346
346
  "settings.master": "启用思考压缩",
347
347
  "settings.default": "默认规则",
@@ -560,7 +560,7 @@ window.__ModuleLoader__.load({
560
560
  "settings.maxDepth": "Max depth",
561
561
  "settings.maxDepthHint": "Each subagent switch carries its own depth cap: children nested deeper than this are left alone (0 = no limit). The depth is persisted on the session header, so a resumed child is judged at the same depth.",
562
562
  "settings.subagentsLocked": "The selected backend forks the conversation to apply a rewrite, which a delegation cannot follow: a hand-off inside a subagent would end its turn without an answer, so both subagent switches are pinned off. Select a backend that does not branch to enable them again.",
563
- "settings.kindsHint": "The three session kinds have independent switches; the host separates them by header.origin and the subagent/descriptor mode. Continuable children (teammates) keep replaying their reasoning, so they are on by default; a terminal one-shot delegation is never resumed, so its final answer pays for a distillation nothing replays, and it is off by default.",
563
+ "settings.kindsHint": "The three session kinds have independent switches; the host separates them by header.origin and the subagent/descriptor mode. Continuable children (teammates) keep replaying their reasoning, so turn them on when needed (off by default); a terminal one-shot delegation is never resumed, so its final answer pays for a distillation nothing replays, and it is off by default.",
564
564
  "settings.ruleIdle": "With all three session kinds off, the rest of this rule cannot take effect and is locked.",
565
565
  "settings.default": "Default rule",
566
566
  "settings.models": "Per-model rules",
@@ -759,7 +759,7 @@ window.__ModuleLoader__.load({
759
759
  */
760
760
  const FALLBACK_RULE = {
761
761
  enabled: true,
762
- continuableSubagents: true,
762
+ continuableSubagents: false,
763
763
  continuableMaxDepth: 0,
764
764
  oneShotSubagents: false,
765
765
  oneShotMaxDepth: 0,
@@ -767,8 +767,8 @@ window.__ModuleLoader__.load({
767
767
  contextCap: true,
768
768
  maxContextPercent: 60,
769
769
  minSavedTokens: 600,
770
- includeToolResults: true,
771
- includeFinalTurns: true,
770
+ includeToolResults: false,
771
+ includeFinalTurns: false,
772
772
  timeoutMs: 0,
773
773
  maxInputChars: 0,
774
774
  maxOutputChars: 0,
@@ -806,6 +806,22 @@ window.__ModuleLoader__.load({
806
806
  //#endregion
807
807
  //#region src/client/ops.ts
808
808
  /**
809
+ * Initial stored layer for a model the user just added.
810
+ *
811
+ * The entry starts inert: no session kind is enabled, and the optional extras —
812
+ * subagent distillation, attaching tool-call results, and compressing final
813
+ * answers — are stated off rather than inherited, so adding a model can never
814
+ * start paying for work the user did not ask for. Every field stays editable and
815
+ * the remaining fields still inherit from the default rule.
816
+ */
817
+ const NEW_MODEL_RULE = {
818
+ enabled: false,
819
+ continuableSubagents: false,
820
+ oneShotSubagents: false,
821
+ includeToolResults: false,
822
+ includeFinalTurns: false
823
+ };
824
+ /**
809
825
  * Whether a rule decides nothing because all three session kinds are off, in
810
826
  * which case the rest of its fields are locked in the panel.
811
827
  * @param rule - the rule being edited.
@@ -1343,49 +1359,49 @@ window.__ModuleLoader__.load({
1343
1359
  document.head.appendChild(tag);
1344
1360
  }
1345
1361
  var Settings_module_css_default = {
1346
- "secondary": "jP3NOa_secondary",
1347
- "backendOptions": "jP3NOa_backendOptions",
1348
- "installProgress": "jP3NOa_installProgress",
1349
- "itemBody": "jP3NOa_itemBody",
1350
- "preview": "jP3NOa_preview",
1351
- "modalHead": "jP3NOa_modalHead",
1352
- "installBlock": "jP3NOa_installBlock",
1353
- "priceGrid": "jP3NOa_priceGrid",
1354
- "muted": "jP3NOa_muted",
1355
- "error": "jP3NOa_error",
1362
+ "pickerList": "jP3NOa_pickerList",
1363
+ "primary": "jP3NOa_primary",
1364
+ "modalBackdrop": "jP3NOa_modalBackdrop",
1356
1365
  "modal": "jP3NOa_modal",
1357
1366
  "modalBody": "jP3NOa_modalBody",
1358
- "steps": "jP3NOa_steps",
1359
- "logBox": "jP3NOa_logBox",
1360
- "search": "jP3NOa_search",
1361
- "pickerItem": "jP3NOa_pickerItem",
1362
1367
  "log": "jP3NOa_log",
1368
+ "prompt": "jP3NOa_prompt",
1369
+ "actions": "jP3NOa_actions",
1370
+ "note": "jP3NOa_note",
1371
+ "badge": "jP3NOa_badge",
1372
+ "preview": "jP3NOa_preview",
1373
+ "error": "jP3NOa_error",
1363
1374
  "pickerPanel": "jP3NOa_pickerPanel",
1364
- "iconButton": "jP3NOa_iconButton",
1365
- "rule": "jP3NOa_rule",
1366
- "holidayBox": "jP3NOa_holidayBox",
1367
- "checks": "jP3NOa_checks",
1368
- "capBox": "jP3NOa_capBox",
1369
- "field": "jP3NOa_field",
1370
- "item": "jP3NOa_item",
1371
- "primary": "jP3NOa_primary",
1375
+ "pickerItem": "jP3NOa_pickerItem",
1372
1376
  "installEntry": "jP3NOa_installEntry",
1373
- "prompt": "jP3NOa_prompt",
1377
+ "modeCards": "jP3NOa_modeCards",
1374
1378
  "toggle": "jP3NOa_toggle",
1375
- "sectionHeading": "jP3NOa_sectionHeading",
1376
- "modalBackdrop": "jP3NOa_modalBackdrop",
1377
1379
  "modeCard": "jP3NOa_modeCard",
1378
- "picker": "jP3NOa_picker",
1379
- "badge": "jP3NOa_badge",
1380
- "page": "jP3NOa_page",
1381
- "pickerList": "jP3NOa_pickerList",
1380
+ "sectionHeading": "jP3NOa_sectionHeading",
1381
+ "itemBody": "jP3NOa_itemBody",
1382
+ "installProgress": "jP3NOa_installProgress",
1383
+ "muted": "jP3NOa_muted",
1382
1384
  "header": "jP3NOa_header",
1383
- "actions": "jP3NOa_actions",
1384
- "peakBox": "jP3NOa_peakBox",
1385
- "modeCards": "jP3NOa_modeCards",
1386
- "route": "jP3NOa_route",
1387
1385
  "section": "jP3NOa_section",
1388
- "note": "jP3NOa_note"
1386
+ "page": "jP3NOa_page",
1387
+ "checks": "jP3NOa_checks",
1388
+ "iconButton": "jP3NOa_iconButton",
1389
+ "priceGrid": "jP3NOa_priceGrid",
1390
+ "logBox": "jP3NOa_logBox",
1391
+ "route": "jP3NOa_route",
1392
+ "search": "jP3NOa_search",
1393
+ "secondary": "jP3NOa_secondary",
1394
+ "peakBox": "jP3NOa_peakBox",
1395
+ "holidayBox": "jP3NOa_holidayBox",
1396
+ "backendOptions": "jP3NOa_backendOptions",
1397
+ "rule": "jP3NOa_rule",
1398
+ "item": "jP3NOa_item",
1399
+ "installBlock": "jP3NOa_installBlock",
1400
+ "modalHead": "jP3NOa_modalHead",
1401
+ "steps": "jP3NOa_steps",
1402
+ "field": "jP3NOa_field",
1403
+ "picker": "jP3NOa_picker",
1404
+ "capBox": "jP3NOa_capBox"
1389
1405
  };
1390
1406
  //#endregion
1391
1407
  //#region src/client/InstallBackend.tsx
@@ -2559,11 +2575,7 @@ window.__ModuleLoader__.load({
2559
2575
  ...current,
2560
2576
  models: {
2561
2577
  ...current.models,
2562
- [model.id]: {
2563
- enabled: false,
2564
- continuableSubagents: false,
2565
- oneShotSubagents: false
2566
- }
2578
+ [model.id]: { ...NEW_MODEL_RULE }
2567
2579
  }
2568
2580
  }))
2569
2581
  }),
@@ -2822,41 +2834,41 @@ window.__ModuleLoader__.load({
2822
2834
  document.head.appendChild(tag);
2823
2835
  }
2824
2836
  var View_module_css_default = {
2825
- "entry": "_7CZWHG_entry",
2826
- "metric": "_7CZWHG_metric",
2827
- "activityDot": "_7CZWHG_activityDot",
2828
- "popupActions": "_7CZWHG_popupActions",
2829
- "activeRow": "_7CZWHG_activeRow",
2830
- "activityLabel": "_7CZWHG_activityLabel",
2837
+ "summary": "_7CZWHG_summary",
2838
+ "textBlock": "_7CZWHG_textBlock",
2839
+ "secondary": "_7CZWHG_secondary",
2831
2840
  "facts": "_7CZWHG_facts",
2832
- "error": "_7CZWHG_error",
2833
- "entryBody": "_7CZWHG_entryBody",
2841
+ "positive": "_7CZWHG_positive",
2834
2842
  "section": "_7CZWHG_section",
2843
+ "activity": "_7CZWHG_activity",
2844
+ "metric": "_7CZWHG_metric",
2845
+ "entryBody": "_7CZWHG_entryBody",
2835
2846
  "negative": "_7CZWHG_negative",
2836
- "popupList": "_7CZWHG_popupList",
2837
- "sessionInfo": "_7CZWHG_sessionInfo",
2838
- "rdPulse": "_7CZWHG_rdPulse",
2839
- "activityWhy": "_7CZWHG_activityWhy",
2847
+ "activityDot": "_7CZWHG_activityDot",
2848
+ "muted": "_7CZWHG_muted",
2849
+ "activityLabel": "_7CZWHG_activityLabel",
2850
+ "popup": "_7CZWHG_popup",
2851
+ "activeRow": "_7CZWHG_activeRow",
2852
+ "note": "_7CZWHG_note",
2840
2853
  "popupRow": "_7CZWHG_popupRow",
2841
- "positive": "_7CZWHG_positive",
2842
- "sessionRow": "_7CZWHG_sessionRow",
2843
- "summary": "_7CZWHG_summary",
2844
- "headerTrigger": "_7CZWHG_headerTrigger",
2854
+ "activityDotBlocked": "_7CZWHG_activityDotBlocked",
2855
+ "activityWhy": "_7CZWHG_activityWhy",
2856
+ "popupList": "_7CZWHG_popupList",
2845
2857
  "popupFacts": "_7CZWHG_popupFacts",
2846
- "iconButton": "_7CZWHG_iconButton",
2847
- "muted": "_7CZWHG_muted",
2848
- "activity": "_7CZWHG_activity",
2849
- "secondary": "_7CZWHG_secondary",
2850
2858
  "popupHead": "_7CZWHG_popupHead",
2851
- "note": "_7CZWHG_note",
2852
- "actions": "_7CZWHG_actions",
2853
2859
  "blockedBanner": "_7CZWHG_blockedBanner",
2854
- "entryTitle": "_7CZWHG_entryTitle",
2860
+ "rdPulse": "_7CZWHG_rdPulse",
2861
+ "entry": "_7CZWHG_entry",
2862
+ "sessionInfo": "_7CZWHG_sessionInfo",
2863
+ "iconButton": "_7CZWHG_iconButton",
2855
2864
  "header": "_7CZWHG_header",
2856
- "textBlock": "_7CZWHG_textBlock",
2857
- "popup": "_7CZWHG_popup",
2858
- "activityDotBlocked": "_7CZWHG_activityDotBlocked",
2859
- "page": "_7CZWHG_page"
2865
+ "headerTrigger": "_7CZWHG_headerTrigger",
2866
+ "entryTitle": "_7CZWHG_entryTitle",
2867
+ "page": "_7CZWHG_page",
2868
+ "sessionRow": "_7CZWHG_sessionRow",
2869
+ "error": "_7CZWHG_error",
2870
+ "popupActions": "_7CZWHG_popupActions",
2871
+ "actions": "_7CZWHG_actions"
2860
2872
  };
2861
2873
  //#endregion
2862
2874
  //#region src/client/ActivityChip.tsx