@aiwayds/dsh-dcp 0.1.1 → 0.2.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/README.md CHANGED
@@ -16,28 +16,33 @@ dsh 自带三层压缩里,`compaction-basic` 每次压缩都要付一次 LLM
16
16
 
17
17
  ## 快速开始
18
18
 
19
+ **用我们的 TUI(`dsh-tui-pi`)?什么都不用做。** `dsh-tui-pi` ≥ 0.4.2 依赖 `@aiwayds/dsh-dcp`,并在它自己的 `cordis.patch.yml` 里自动挂载(禁用 compaction-basic + 插入 dsh-dcp):
20
+
19
21
  ```bash
20
- # 1. 获取插件(二选一)
21
- # A. npm 包(分发用):
22
+ npm i @aiwayds/dsh-tui-pi # 重启 dsh 即可,dcp 开箱即用,无需手动配置
23
+ ```
24
+
25
+ **独立使用(非 tui 环境)** —— npm 只把包装进 node_modules,**挂载(写 patch 条目)不在 npm 行为里**,除非宿主 bundle(如 dsh-tui-pi)自带挂载。不装 tui 就得手动写:
26
+
27
+ ```bash
28
+ # 1. 安装
22
29
  npm i @aiwayds/dsh-dcp
23
- # B. 源码(本地挂载推荐,见下):
24
- git clone git@github.com:fan56/dsh-dcp.git ~/github/dsh-dcp
25
- cd ~/github/dsh-dcp && npm install
26
-
27
- # 2. 挂载:在 ~/.dsh/cordis.patch.yml 追加(name 用绝对路径最稳)
28
- # - id: compaction-basic
29
- # disabled: true
30
- # - insert:
31
- # - id: dsh-dcp
32
- # name: /Users/<you>/github/dsh-dcp/lib/index.js
33
- # config:
34
- # thresholdRatio: 0.7
35
- # language: zh
30
+ # 或源码:git clone git@github.com:fan56/dsh-dcp.git && cd dsh-dcp && npm install
31
+
32
+ # 2. 手动挂载:在 ~/.dsh/cordis.patch.yml 追加
33
+ - id: compaction-basic
34
+ disabled: true
35
+ - insert:
36
+ - id: dsh-dcp
37
+ name: '@aiwayds/dsh-dcp' # 包装进 profile 后用裸包名即可(与 tui-pi 一致)
38
+ config:
39
+ thresholdRatio: 0.7
40
+ language: zh
36
41
 
37
42
  # 3. 重启 dsh,输入 /dcp 验证
38
43
  ```
39
44
 
40
- > **为什么挂载用绝对路径而不是 `name: @aiwayds/dsh-dcp`**:当前 harness 的 loader 对裸包名从 dsh 安装目录解析(`boot()` 未传 `bareModuleBaseUrl`),不从 profile 的 node_modules 解析——所以把包装进 profile 也不会被 patch 的 `name` 找到。绝对路径(或把包装进 dsh 自身 node_modules)是可靠方式;npm 包的价值在版本化分发。
45
+ > 挂载名用**裸包名**(`@aiwayds/dsh-dcp`)即可——只要它装进了 profile 的 node_modules(`dsh plugin add` 或 profile package.json 依赖),loader 就能像解析 tui-pi 一样找到它;用**绝对路径**指向源码入口同样可行。
41
46
 
42
47
  `/compact` 命令、自动压力触发、overflow 恢复、UI 的 checkpoint 卡片照常工作——它们只依赖 `ctx.compaction` 接口,与本后端无关。
43
48
 
@@ -0,0 +1,16 @@
1
+ # dsh-dcp bundle patch: mounts dsh-dcp as the compaction backend.
2
+ #
3
+ # Adding this package to a profile's bundles (dsh plugin add @aiwayds/dsh-dcp,
4
+ # or listing it under dsh.profile.bundles) applies this patch automatically —
5
+ # the default LLM summarizer (compaction-basic) is disabled and dsh-dcp is
6
+ # inserted alongside it. Standalone use therefore needs NO manual
7
+ # cordis.patch.yml editing.
8
+
9
+ - id: compaction-basic
10
+ disabled: true
11
+ - insert:
12
+ - id: dsh-dcp
13
+ name: '@aiwayds/dsh-dcp'
14
+ config:
15
+ thresholdRatio: 0.7
16
+ language: zh
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiwayds/dsh-dcp",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "description": "Deterministic context-pruning compaction backend for dsh (DeepSeek Harness) — zero-LLM summaries, /dcp command, works out of the box. Design references Opencode-DCP/opencode-dynamic-context-pruning.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -14,7 +14,8 @@
14
14
  "lib",
15
15
  "README.md",
16
16
  "LICENSE",
17
- "cordis.patch.example.yml"
17
+ "cordis.patch.example.yml",
18
+ "cordis.patch.yml"
18
19
  ],
19
20
  "scripts": {
20
21
  "test": "node --test"
@@ -63,5 +64,10 @@
63
64
  "@deepseek-ai/dsh-llm": "0.1.0-rc.6",
64
65
  "@deepseek-ai/dsh-session": "0.1.0-rc.6",
65
66
  "@deepseek-ai/dsh-token-meter": "0.1.0-rc.6"
67
+ },
68
+ "dsh": {
69
+ "bundle": {
70
+ "patch": "./cordis.patch.yml"
71
+ }
66
72
  }
67
73
  }