dsh-reasoning-distill 0.1.4 → 0.1.5
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 +6 -0
- package/README.md +17 -5
- package/lib/client/index.js +60 -60
- package/package.json +9 -2
- package/scripts/probe-inplace-durability.mjs +20 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
本插件的版本变更记录。
|
|
4
4
|
|
|
5
|
+
## 0.1.5
|
|
6
|
+
|
|
7
|
+
- **适配 DSH `0.2.0-rc.1` ~ `0.2.1-rc.1`**:in-place 补丁在每个版本上 `--apply` → `--check` → `--revert` 全部通过(回退后工作树逐字节干净),打过补丁的包 `tsc -b` 通过,持久化探针(none / zstd)通过;兼容范围写进 `dsh.compatibility.dshReleases`。
|
|
8
|
+
- `scripts/probe-inplace-durability.mjs` 同时适配 jsonl 后端的两种导出形态:`0.2.1-alpha.2` 及以前是 default export 的提供者类,`0.2.1-alpha.3` 起是 `name` + `apply` 的 Cordis 插件。
|
|
9
|
+
- README 开头补充「版本与安装方式」:可能适配的版本范围、已知可运行 in-place 的版本(`0.2.1-alpha.1`、`0.2.1-alpha.5`),以及「想要全部功能与最佳体验请用从源码构建的 DSH」。
|
|
10
|
+
|
|
5
11
|
## 0.1.4
|
|
6
12
|
|
|
7
13
|
- **in-place 宿主补丁现在自动适配 `0.2.1-alpha.1` ~ `0.2.1-alpha.5`**:同一个编辑点可以带多组完整锚点,脚本按宿主实际形态挑**恰好匹配的一组**;一组都不匹配、或有多组命中,仍然整体拒绝、不做部分写入。
|
package/README.md
CHANGED
|
@@ -4,6 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
> 插件**默认关闭**,装好后需要在「设置 → 思考压缩」里选中一个改写后端并手动打开总开关。
|
|
6
6
|
|
|
7
|
+
> **版本与安装方式(先看这里)**
|
|
8
|
+
>
|
|
9
|
+
> - **可能适配的 DSH 版本**:`0.2.0-rc.1` ~ `0.2.1-rc.1`。这一范围内的补丁、类型与语义都逐版本验证过,明细见下文「经过测试的 DSH 版本」。
|
|
10
|
+
> - **已知可以正常运行 in-place 后端**的版本:`0.2.1-alpha.1`、`0.2.1-alpha.5`。
|
|
11
|
+
> - **想要全部功能与最佳体验,请使用从源码构建的 DSH**(clone 官方仓库后从源码运行或构建)。**从 npm 直接下载的版本**和**第三方打包版**(例如 dsh-desktop)无法给宿主源码打补丁,in-place 后端用不了,只能退而使用 message-edit。
|
|
12
|
+
|
|
7
13
|
---
|
|
8
14
|
|
|
9
15
|
## 一、它做什么
|
|
@@ -36,11 +42,17 @@
|
|
|
36
42
|
|
|
37
43
|
#### 经过测试的 DSH 版本
|
|
38
44
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
45
|
+
分三档看,别把"补丁能打上"当成"整套在真实会话里跑过":
|
|
46
|
+
|
|
47
|
+
| 档位 | 覆盖的版本 | 做到了什么 |
|
|
48
|
+
| --- | --- | --- |
|
|
49
|
+
| 已知可运行 in-place | `0.2.1-alpha.1`、`0.2.1-alpha.5` | alpha.1 是本插件开发机(补丁已长期在真实会话中使用);alpha.5 是反馈该问题的用户所在版本,补丁与插件均确认可用 |
|
|
50
|
+
| 完整启动 | `0.2.1-rc.1` | 独立 clone 全量构建后装入插件并启动 `web`,插件的安装页与报告页路由都能正常应答 |
|
|
51
|
+
| 补丁 + 类型 + 语义 | `0.2.0-rc.1`、`0.2.0-rc.2`、`0.2.1-alpha.1`~`0.2.1-alpha.5`、`0.2.1-rc.1` | 独立 clone 上逐版本 `--apply` → `--check` → `--revert`(回退后工作树逐字节干净)、打过补丁的包 `tsc -b` 通过、持久化探针 `scripts/probe-inplace-durability.mjs` 通过(none 与 zstd)、插件依赖的宿主 API 兼容探针通过 |
|
|
52
|
+
|
|
53
|
+
- 也就是说:**在 0.2.x 范围内,in-place 补丁与插件的宿主 API 都有逐版本实测依据**;其中 `0.2.1-alpha.1` 与 `0.2.1-alpha.5` 已知可正常运行 in-place,完整启动验证过的是 `0.2.1-rc.1`。其余版本请先在可回退的环境里试。
|
|
54
|
+
- 版本差异最大的一处:`packages/session/session-persistence-jsonl/src/storage.ts` 的 `install()` 从 `0.2.1-alpha.3` 起改成了 generator effect + 闭包变量(`writers` 取代 `this.writers`,在 generator 内部 `this` 已不是那个实例)。补丁脚本为此处带**两份锚点**,会按宿主实际形态自动选择匹配的那份。
|
|
55
|
+
- `scripts/probe-inplace-durability.mjs` 同时适配了 jsonl 后端的两种导出形态:`0.2.1-alpha.2` 及以前 default export 提供者类,`0.2.1-alpha.3` 起是 `name` + `apply` 的 Cordis 插件。
|
|
44
56
|
|
|
45
57
|
### 旧后端 `message-edit`(保留兼容,不推荐)
|
|
46
58
|
|
package/lib/client/index.js
CHANGED
|
@@ -1335,48 +1335,48 @@ window.__ModuleLoader__.load({
|
|
|
1335
1335
|
document.head.appendChild(tag);
|
|
1336
1336
|
}
|
|
1337
1337
|
var Settings_module_css_default = {
|
|
1338
|
-
"
|
|
1339
|
-
"
|
|
1340
|
-
"
|
|
1341
|
-
"
|
|
1338
|
+
"prompt": "jP3NOa_prompt",
|
|
1339
|
+
"modalBody": "jP3NOa_modalBody",
|
|
1340
|
+
"modeCards": "jP3NOa_modeCards",
|
|
1341
|
+
"pickerItem": "jP3NOa_pickerItem",
|
|
1342
|
+
"note": "jP3NOa_note",
|
|
1342
1343
|
"iconButton": "jP3NOa_iconButton",
|
|
1343
|
-
"secondary": "jP3NOa_secondary",
|
|
1344
1344
|
"peakBox": "jP3NOa_peakBox",
|
|
1345
|
+
"search": "jP3NOa_search",
|
|
1346
|
+
"installEntry": "jP3NOa_installEntry",
|
|
1347
|
+
"checks": "jP3NOa_checks",
|
|
1348
|
+
"itemBody": "jP3NOa_itemBody",
|
|
1349
|
+
"error": "jP3NOa_error",
|
|
1350
|
+
"picker": "jP3NOa_picker",
|
|
1351
|
+
"page": "jP3NOa_page",
|
|
1345
1352
|
"item": "jP3NOa_item",
|
|
1346
|
-
"field": "jP3NOa_field",
|
|
1347
|
-
"pickerPanel": "jP3NOa_pickerPanel",
|
|
1348
|
-
"sectionHeading": "jP3NOa_sectionHeading",
|
|
1349
|
-
"installBlock": "jP3NOa_installBlock",
|
|
1350
1353
|
"badge": "jP3NOa_badge",
|
|
1351
|
-
"
|
|
1352
|
-
"note": "jP3NOa_note",
|
|
1353
|
-
"priceGrid": "jP3NOa_priceGrid",
|
|
1354
|
-
"prompt": "jP3NOa_prompt",
|
|
1354
|
+
"modal": "jP3NOa_modal",
|
|
1355
1355
|
"rule": "jP3NOa_rule",
|
|
1356
|
-
"
|
|
1357
|
-
"
|
|
1356
|
+
"modalHead": "jP3NOa_modalHead",
|
|
1357
|
+
"sectionHeading": "jP3NOa_sectionHeading",
|
|
1358
|
+
"pickerPanel": "jP3NOa_pickerPanel",
|
|
1359
|
+
"installProgress": "jP3NOa_installProgress",
|
|
1360
|
+
"route": "jP3NOa_route",
|
|
1358
1361
|
"steps": "jP3NOa_steps",
|
|
1359
|
-
"header": "jP3NOa_header",
|
|
1360
|
-
"error": "jP3NOa_error",
|
|
1361
|
-
"picker": "jP3NOa_picker",
|
|
1362
|
-
"muted": "jP3NOa_muted",
|
|
1363
|
-
"section": "jP3NOa_section",
|
|
1364
|
-
"installEntry": "jP3NOa_installEntry",
|
|
1365
|
-
"primary": "jP3NOa_primary",
|
|
1366
|
-
"search": "jP3NOa_search",
|
|
1367
|
-
"modalBody": "jP3NOa_modalBody",
|
|
1368
1362
|
"logBox": "jP3NOa_logBox",
|
|
1369
|
-
"
|
|
1370
|
-
"pickerItem": "jP3NOa_pickerItem",
|
|
1363
|
+
"actions": "jP3NOa_actions",
|
|
1371
1364
|
"modeCard": "jP3NOa_modeCard",
|
|
1372
|
-
"
|
|
1373
|
-
"
|
|
1374
|
-
"
|
|
1375
|
-
"
|
|
1376
|
-
"log": "jP3NOa_log",
|
|
1377
|
-
"checks": "jP3NOa_checks",
|
|
1365
|
+
"installBlock": "jP3NOa_installBlock",
|
|
1366
|
+
"secondary": "jP3NOa_secondary",
|
|
1367
|
+
"toggle": "jP3NOa_toggle",
|
|
1368
|
+
"primary": "jP3NOa_primary",
|
|
1378
1369
|
"preview": "jP3NOa_preview",
|
|
1379
|
-
"
|
|
1370
|
+
"log": "jP3NOa_log",
|
|
1371
|
+
"section": "jP3NOa_section",
|
|
1372
|
+
"muted": "jP3NOa_muted",
|
|
1373
|
+
"backendOptions": "jP3NOa_backendOptions",
|
|
1374
|
+
"pickerList": "jP3NOa_pickerList",
|
|
1375
|
+
"priceGrid": "jP3NOa_priceGrid",
|
|
1376
|
+
"holidayBox": "jP3NOa_holidayBox",
|
|
1377
|
+
"header": "jP3NOa_header",
|
|
1378
|
+
"field": "jP3NOa_field",
|
|
1379
|
+
"modalBackdrop": "jP3NOa_modalBackdrop"
|
|
1380
1380
|
};
|
|
1381
1381
|
//#endregion
|
|
1382
1382
|
//#region src/client/InstallBackend.tsx
|
|
@@ -2789,41 +2789,41 @@ window.__ModuleLoader__.load({
|
|
|
2789
2789
|
document.head.appendChild(tag);
|
|
2790
2790
|
}
|
|
2791
2791
|
var View_module_css_default = {
|
|
2792
|
-
"
|
|
2793
|
-
"
|
|
2794
|
-
"
|
|
2795
|
-
"
|
|
2796
|
-
"
|
|
2792
|
+
"sessionInfo": "_7CZWHG_sessionInfo",
|
|
2793
|
+
"headerTrigger": "_7CZWHG_headerTrigger",
|
|
2794
|
+
"popupList": "_7CZWHG_popupList",
|
|
2795
|
+
"summary": "_7CZWHG_summary",
|
|
2796
|
+
"page": "_7CZWHG_page",
|
|
2797
2797
|
"textBlock": "_7CZWHG_textBlock",
|
|
2798
|
-
"activityDotBlocked": "_7CZWHG_activityDotBlocked",
|
|
2799
|
-
"activityWhy": "_7CZWHG_activityWhy",
|
|
2800
|
-
"activity": "_7CZWHG_activity",
|
|
2801
|
-
"positive": "_7CZWHG_positive",
|
|
2802
2798
|
"metric": "_7CZWHG_metric",
|
|
2803
|
-
"
|
|
2804
|
-
"
|
|
2805
|
-
"summary": "_7CZWHG_summary",
|
|
2799
|
+
"activity": "_7CZWHG_activity",
|
|
2800
|
+
"facts": "_7CZWHG_facts",
|
|
2806
2801
|
"muted": "_7CZWHG_muted",
|
|
2802
|
+
"secondary": "_7CZWHG_secondary",
|
|
2807
2803
|
"entryTitle": "_7CZWHG_entryTitle",
|
|
2808
|
-
"
|
|
2809
|
-
"
|
|
2810
|
-
"
|
|
2811
|
-
"
|
|
2812
|
-
"blockedBanner": "_7CZWHG_blockedBanner",
|
|
2813
|
-
"error": "_7CZWHG_error",
|
|
2814
|
-
"entry": "_7CZWHG_entry",
|
|
2815
|
-
"popupHead": "_7CZWHG_popupHead",
|
|
2804
|
+
"popupActions": "_7CZWHG_popupActions",
|
|
2805
|
+
"popupFacts": "_7CZWHG_popupFacts",
|
|
2806
|
+
"activityDot": "_7CZWHG_activityDot",
|
|
2807
|
+
"activeRow": "_7CZWHG_activeRow",
|
|
2816
2808
|
"activityLabel": "_7CZWHG_activityLabel",
|
|
2817
|
-
"
|
|
2809
|
+
"positive": "_7CZWHG_positive",
|
|
2810
|
+
"note": "_7CZWHG_note",
|
|
2811
|
+
"section": "_7CZWHG_section",
|
|
2812
|
+
"activityWhy": "_7CZWHG_activityWhy",
|
|
2813
|
+
"negative": "_7CZWHG_negative",
|
|
2814
|
+
"header": "_7CZWHG_header",
|
|
2815
|
+
"activityDotBlocked": "_7CZWHG_activityDotBlocked",
|
|
2816
|
+
"sessionRow": "_7CZWHG_sessionRow",
|
|
2817
|
+
"popupRow": "_7CZWHG_popupRow",
|
|
2818
2818
|
"actions": "_7CZWHG_actions",
|
|
2819
|
+
"blockedBanner": "_7CZWHG_blockedBanner",
|
|
2819
2820
|
"entryBody": "_7CZWHG_entryBody",
|
|
2820
|
-
"
|
|
2821
|
-
"
|
|
2822
|
-
"sessionInfo": "_7CZWHG_sessionInfo",
|
|
2821
|
+
"popup": "_7CZWHG_popup",
|
|
2822
|
+
"error": "_7CZWHG_error",
|
|
2823
2823
|
"rdPulse": "_7CZWHG_rdPulse",
|
|
2824
|
-
"
|
|
2825
|
-
"
|
|
2826
|
-
"
|
|
2824
|
+
"iconButton": "_7CZWHG_iconButton",
|
|
2825
|
+
"popupHead": "_7CZWHG_popupHead",
|
|
2826
|
+
"entry": "_7CZWHG_entry"
|
|
2827
2827
|
};
|
|
2828
2828
|
//#endregion
|
|
2829
2829
|
//#region src/client/ActivityChip.tsx
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-reasoning-distill",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Distill over-long model reasoning into its useful core and replay the distilled version on every later request, with a per-session cost report.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -62,7 +62,14 @@
|
|
|
62
62
|
},
|
|
63
63
|
"compatibility": {
|
|
64
64
|
"dshReleases": {
|
|
65
|
-
"0.2.
|
|
65
|
+
"0.2.0-rc.1": "compatible",
|
|
66
|
+
"0.2.0-rc.2": "compatible",
|
|
67
|
+
"0.2.1-alpha.1": "compatible",
|
|
68
|
+
"0.2.1-alpha.2": "compatible",
|
|
69
|
+
"0.2.1-alpha.3": "compatible",
|
|
70
|
+
"0.2.1-alpha.4": "compatible",
|
|
71
|
+
"0.2.1-alpha.5": "compatible",
|
|
72
|
+
"0.2.1-rc.1": "compatible"
|
|
66
73
|
},
|
|
67
74
|
"node": ">=20"
|
|
68
75
|
}
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
import { Context } from '@deepseek-ai/cordis'
|
|
26
26
|
import SessionStore, { SessionId } from '@deepseek-ai/dsh-session'
|
|
27
|
-
import
|
|
27
|
+
import * as jsonlPersistence from '@deepseek-ai/dsh-session-persistence-jsonl'
|
|
28
28
|
import { createMessage } from '@deepseek-ai/dsh-llm'
|
|
29
29
|
import { mkdtemp, readFile, rm } from 'node:fs/promises'
|
|
30
30
|
import { tmpdir } from 'node:os'
|
|
@@ -44,11 +44,28 @@ function check(label, ok, detail) {
|
|
|
44
44
|
|
|
45
45
|
const root = await mkdtemp(join(tmpdir(), 'dsh-inplace-probe-'))
|
|
46
46
|
|
|
47
|
+
/**
|
|
48
|
+
* The jsonl backend as something this host can mount, in either shape it has shipped.
|
|
49
|
+
*
|
|
50
|
+
* Up to 0.2.1-alpha.2 the package default-exported the provider class; from 0.2.1-alpha.3 it is a
|
|
51
|
+
* plain Cordis plugin (a module-level name + apply, with its Config no longer a static member).
|
|
52
|
+
* The probe adapts instead of pinning one tag, so a checkout at any covered 0.2.x release can be
|
|
53
|
+
* verified with this one file.
|
|
54
|
+
* @returns the plugin value ctx.plugin accepts.
|
|
55
|
+
*/
|
|
56
|
+
function jsonlPlugin() {
|
|
57
|
+
if (typeof jsonlPersistence.default === 'function') return jsonlPersistence.default
|
|
58
|
+
if (typeof jsonlPersistence.apply === 'function') {
|
|
59
|
+
return { name: jsonlPersistence.name, apply: jsonlPersistence.apply }
|
|
60
|
+
}
|
|
61
|
+
throw new Error('dsh-session-persistence-jsonl exports neither a default plugin nor apply()')
|
|
62
|
+
}
|
|
63
|
+
|
|
47
64
|
/** Mount one SessionStore + jsonl backend over the shared root. */
|
|
48
65
|
async function boot() {
|
|
49
66
|
const ctx = new Context()
|
|
50
67
|
await ctx.plugin(SessionStore)
|
|
51
|
-
await ctx.plugin(
|
|
68
|
+
await ctx.plugin(jsonlPlugin(), { root, compression: COMPRESSION })
|
|
52
69
|
return ctx
|
|
53
70
|
}
|
|
54
71
|
|
|
@@ -146,7 +163,7 @@ try {
|
|
|
146
163
|
|
|
147
164
|
// A fresh context over the same root: what a restarted process would see.
|
|
148
165
|
fresh = new Context()
|
|
149
|
-
await fresh.plugin(
|
|
166
|
+
await fresh.plugin(jsonlPlugin(), { root, compression: COMPRESSION })
|
|
150
167
|
const onDisk = storedReasoning(await storedEvents(fresh, session.id))
|
|
151
168
|
check('a restarted reader sees the rewrite on disk', onDisk === REWRITTEN, String(onDisk))
|
|
152
169
|
if (COMPRESSION === 'none') {
|