billion-context-dsh 0.2.11 → 0.2.12
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.en.md +40 -11
- package/README.md +39 -11
- package/cordis.patch.yml +29 -8
- package/package.json +3 -2
package/README.en.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
[English](./README.en.md) | [中文](./README.md)
|
|
4
4
|
|
|
5
5
|
> **⚠️ Beta notice — not for production use**
|
|
6
|
-
> This project (**v0.2.
|
|
6
|
+
> This project (**v0.2.12**) is a work-in-progress beta. The [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) itself is also in **public beta**. **Do not use either in engineering / production environments** — expect breaking changes and rough edges.
|
|
7
7
|
|
|
8
8
|
<p align="center">
|
|
9
9
|
<strong>Built with gratitude on top of these projects</strong> — please give them a ⭐:
|
|
@@ -53,25 +53,53 @@ This is the DeepSeek Harness port of [billion-context-pi](https://github.com/ran
|
|
|
53
53
|
|
|
54
54
|
> 💡 **Want DeepSeek Harness to install it for you?** This repo itself runs on DSH: hand [docs/INSTALL.md](docs/INSTALL.md) to an agent in a session and it will read the guide, inspect your profile, wire the composition, and verify the mount. Two preconditions: ① the config lives under `~/.dsh`, so you approve one file-permission prompt; ② afterwards ask it to call `acp_status` as proof.
|
|
55
55
|
|
|
56
|
+
**Path A (recommended): one-command install via the DSH store / `dsh plugin` (bundle) — globally active right after install, zero configuration.**
|
|
57
|
+
|
|
58
|
+
Click install in DSH's plugin store, or run:
|
|
59
|
+
|
|
56
60
|
```bash
|
|
57
|
-
|
|
61
|
+
dsh plugin --profile web add billion-context-dsh
|
|
58
62
|
```
|
|
59
63
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
64
|
+
The command installs the package and automatically layers this package's bundle patch ([cordis.patch.yml](cordis.patch.yml)) into the profile's composition. The patch does two things:
|
|
65
|
+
|
|
66
|
+
- **Disables the host `compaction-basic`** — so two backends do not both register `ctx.compaction` in the same realm (modern DSH web bundles already ship this disable; the row is an idempotent safety net that holds on every supported DSH);
|
|
67
|
+
- **Mounts the ACP engine at the HOST plane** — the four model tools (`compress` / `decompress` / `search_context` / `acp_status`), the `/acp` command, the advisory nudge, and the ACP guidance section reach **EVERY mode** of the profile (standard / code / minimal / cordis / custom presets). Window auto-detection and the tools/command/nudge defaults are all on — **no manual configuration needed**.
|
|
68
|
+
|
|
69
|
+
Restart `dsh` afterwards (bundle layers are composed at startup), open a new session, and verify: ask the model to call `acp_status`, or run `/acp status`. Shipped presets (standard / code / cordis) keep their realm-local `compaction-basic` fallback (automatic pressure compression still runs there; the ACP tools and nudge coexist); minimal and presets without a compaction realm use this engine directly.
|
|
70
|
+
|
|
71
|
+
> **DSH version compatibility.** The package declares the peer range
|
|
72
|
+
> `^0.1.0-rc.6 || ^0.1.1-rc.1` for `@deepseek-ai/dsh-compaction`, covering both the
|
|
73
|
+
> `0.1.0-rc.x` and `0.1.1-rc.x` release lines (including the current DSH release;
|
|
74
|
+
> the seam's `src/` is unchanged from `0.1.0-rc.6` to `0.1.1-rc.2`, so the public
|
|
75
|
+
> API is identical). The range is two `||` clauses **on purpose**: npm
|
|
76
|
+
> (node-semver) only lets a prerelease version satisfy a range that carries a
|
|
77
|
+
> comparator on the SAME `[major, minor, patch]` tuple as the candidate, so a lone
|
|
78
|
+
> `^0.1.0-rc.6` can never match `0.1.1-rc.x` (issue #68) — older releases fail to
|
|
79
|
+
> install on DSH 0.1.1-rc.x; upgrade to a release containing this fix.
|
|
80
|
+
|
|
81
|
+
**Path B: plain `npm install` (package only — a composition row is required).**
|
|
63
82
|
|
|
64
83
|
```bash
|
|
65
|
-
|
|
84
|
+
npm install billion-context-dsh
|
|
66
85
|
```
|
|
67
86
|
|
|
68
|
-
|
|
69
|
-
(such as `modelContextLimit` / `prompts`), keep the hand-written composition row — the
|
|
70
|
-
bundle patch ([cordis.patch.yml](cordis.patch.yml)) only inserts the default row without `config`.
|
|
87
|
+
This only installs the package into your project/global store; it does **not** touch any profile — add a composition row as shown below or the engine never mounts.
|
|
71
88
|
|
|
72
|
-
|
|
89
|
+
## Scope & customization
|
|
90
|
+
|
|
91
|
+
Two audiences: ① Path B (plain npm install) users, who must write a composition row; ② Path A users who want custom `config` (the bundle already ships sane defaults — override them with a SAME-ID row).
|
|
92
|
+
|
|
93
|
+
**Custom `config` (Path A bundle users).** Append a `compaction-acp` row with `config:` to your profile patch (e.g. `~/.dsh/profiles/web/cordis.patch.yml`) — the same-id row overrides the bundle's default row:
|
|
94
|
+
|
|
95
|
+
```yaml
|
|
96
|
+
- id: compaction-acp
|
|
97
|
+
name: 'billion-context-dsh'
|
|
98
|
+
config:
|
|
99
|
+
modelContextLimit: 128000 # optional; omit to auto-detect the model's real window (fallback 128000)
|
|
100
|
+
```
|
|
73
101
|
|
|
74
|
-
**Global — host plane, every mode** (recommended).
|
|
102
|
+
**Global — host plane, every mode** (recommended). This is what Path A's bundle already does; plain-npm users add all of the following (bundle users skip the first two rows):
|
|
75
103
|
|
|
76
104
|
```yaml
|
|
77
105
|
# ACP as the global compaction backend: four model tools + `/acp` command +
|
|
@@ -79,6 +107,7 @@ That's it. Then add a composition row where a compaction backend is expected —
|
|
|
79
107
|
# (standard / code / minimal / cordis / custom presets).
|
|
80
108
|
# Must also disable the host compaction-basic: two backends providing
|
|
81
109
|
# `ctx.compaction` in the same realm collide.
|
|
110
|
+
# (The bundle install already ships these two rows.)
|
|
82
111
|
- id: compaction-basic
|
|
83
112
|
disabled: true
|
|
84
113
|
|
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
[中文](./README.md) | [English](./README.en.md)
|
|
4
4
|
|
|
5
5
|
> **⚠️ 测试版声明——请勿用于生产环境**
|
|
6
|
-
> 本项目(**v0.2.
|
|
6
|
+
> 本项目(**v0.2.12**)仍处于开发中的测试版。[DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 本身也处于**公开测试版**阶段。**请勿将两者用于工程化 / 生产环境**——预期会有破坏性变更与粗糙之处。
|
|
7
7
|
|
|
8
8
|
<p align="center">
|
|
9
9
|
<strong>衷心感谢以下项目——请给它们一个 ⭐:</strong>
|
|
@@ -56,30 +56,58 @@
|
|
|
56
56
|
> 你的 profile、编辑组合配置并验证挂载。前提:① 配置写在 `~/.dsh` 下,需要
|
|
57
57
|
> 你批准一次文件权限;② 装完让它调用 `acp_status` 自证。
|
|
58
58
|
|
|
59
|
+
**方式一(推荐):DSH 商店 / `dsh plugin` 一键装(bundle)——装完即全局生效,零配置。**
|
|
60
|
+
|
|
61
|
+
在 DSH 的插件商店里点安装,或命令行执行:
|
|
62
|
+
|
|
59
63
|
```bash
|
|
60
|
-
|
|
64
|
+
dsh plugin --profile web add billion-context-dsh
|
|
61
65
|
```
|
|
62
66
|
|
|
63
|
-
|
|
64
|
-
|
|
67
|
+
命令内部会装包并把本包的 bundle 补丁([cordis.patch.yml](cordis.patch.yml))自动挂进该 profile 的层栈。补丁做了两件事:
|
|
68
|
+
|
|
69
|
+
- **禁用 host 的 `compaction-basic`**——避免同一 realm 内两个后端同时注册 `ctx.compaction` 冲突(现代 DSH 的 web bundle 已自带该禁用,此行为幂等兜底,任何受支持版本下都成立);
|
|
70
|
+
- **把 ACP 引擎挂到 host 平面**——四种模型工具(`compress` / `decompress` / `search_context` / `acp_status`)、`/acp` 命令、nudge、ACP 提示词段对该 profile 的**所有模式**(standard / code / minimal / cordis / 自定义预设)生效。窗口自动探测、工具/命令/nudge 默认全开,**无需任何手工配置**。
|
|
71
|
+
|
|
72
|
+
装完**重启 `dsh`**(bundle 层在启动时组合),新开会话即可用——让模型调用 `acp_status` 或执行 `/acp status` 自证。shipped 预设(standard / code / cordis)内部的 realm 级 `compaction-basic` 自动压缩兜底仍然保留(这些模式里"自动摘要"照旧,ACP 工具与 nudge 并存);minimal 等不带 compaction realm 的预设直接使用本引擎。
|
|
73
|
+
|
|
74
|
+
> **与 DSH 版本的兼容性。** 包声明 peer 依赖 `@deepseek-ai/dsh-compaction` 为
|
|
75
|
+
> `^0.1.0-rc.6 || ^0.1.1-rc.1`,同时覆盖 `0.1.0-rc.x` 与 `0.1.1-rc.x` 两条 rc 线
|
|
76
|
+
> (含当前最新 DSH release;从 `0.1.0-rc.6` 到 `0.1.1-rc.2`,seam 的 `src/` 源码
|
|
77
|
+
> 零改动,公开 API 完全一致)。范围写成两个并集子句是**有意为之**:npm
|
|
78
|
+
> (node-semver)的预发布匹配规则要求 range 里存在与候选版本**相同
|
|
79
|
+
> `[major, minor, patch]` 元组**的比较器,单一 `^0.1.0-rc.6` 永远匹配不了
|
|
80
|
+
> `0.1.1-rc.x`(issue #68)——因此旧发布的包在 DSH 0.1.1-rc.x 上装不上,
|
|
81
|
+
> 升级到含本次修复的新版本即可。
|
|
82
|
+
|
|
83
|
+
**方式二:纯 `npm install`(只装包,需要手写组合行)。**
|
|
65
84
|
|
|
66
85
|
```bash
|
|
67
|
-
|
|
86
|
+
npm install billion-context-dsh
|
|
68
87
|
```
|
|
69
88
|
|
|
70
|
-
|
|
71
|
-
`modelContextLimit` / `prompts`)时仍建议手写组合行——bundle 补丁
|
|
72
|
-
([cordis.patch.yml](cordis.patch.yml))只插入无 `config` 的默认行。
|
|
89
|
+
这只把包装进你的项目/全局,**不会**触碰任何 profile——请按下方「两种生效范围与自定义」手写组合行,引擎才会挂载。
|
|
73
90
|
|
|
74
|
-
|
|
91
|
+
## 两种生效范围与自定义
|
|
92
|
+
|
|
93
|
+
本节服务于两类人:① 方式二(纯 npm 安装,必须手写组合行);② 方式一用户想自定义 `config`(bundle 已有默认行为,只需用**同 id** 行覆盖)。
|
|
94
|
+
|
|
95
|
+
**自定义 config(方式一 bundle 用户)。** 在你的 profile 补丁(如 `~/.dsh/profiles/web/cordis.patch.yml`)里追加一个 `compaction-acp` 行并附 `config:`——同 id 行覆盖 bundle 的默认行:
|
|
96
|
+
|
|
97
|
+
```yaml
|
|
98
|
+
- id: compaction-acp
|
|
99
|
+
name: 'billion-context-dsh'
|
|
100
|
+
config:
|
|
101
|
+
modelContextLimit: 128000 # 可选;省略时自动探测模型真实窗口(回退 128000)
|
|
102
|
+
```
|
|
75
103
|
|
|
76
|
-
**全局生效(host
|
|
104
|
+
**全局生效(host 平面,所有模式)——推荐**。这是方式一 bundle 的默认行为;纯 npm 安装的用户在 profile 补丁中追加以下全部内容(bundle 用户跳过前两行):
|
|
77
105
|
|
|
78
106
|
```yaml
|
|
79
107
|
# ACP 作为全局压缩后端:四个模型工具 + `/acp` 命令 + nudge + ACP 提示词段,
|
|
80
108
|
# 对所有模式(standard / code / minimal / cordis / 自定义预设)生效。
|
|
81
109
|
# 必须同时禁用 host 的 compaction-basic:同一 realm 内两个后端同时
|
|
82
|
-
# provide `ctx.compaction`
|
|
110
|
+
# provide `ctx.compaction` 会冲突。(bundle 安装已自动带上这两行。)
|
|
83
111
|
- id: compaction-basic
|
|
84
112
|
disabled: true
|
|
85
113
|
|
package/cordis.patch.yml
CHANGED
|
@@ -1,11 +1,32 @@
|
|
|
1
|
-
# dsh bundle patch:
|
|
1
|
+
# dsh bundle patch: makes billion-context-dsh ACTIVE right after a one-command
|
|
2
|
+
# install — the plugin store and `dsh plugin --profile web add
|
|
3
|
+
# billion-context-dsh` both run the same command, and this file (declared in
|
|
4
|
+
# package.json as `dsh.bundle.patch`) becomes a layer of the profile's
|
|
5
|
+
# composition automatically. No manual configuration is needed.
|
|
2
6
|
#
|
|
3
|
-
#
|
|
4
|
-
#
|
|
5
|
-
#
|
|
6
|
-
#
|
|
7
|
-
#
|
|
8
|
-
#
|
|
7
|
+
# Two rows land in the profile's composition root:
|
|
8
|
+
# 1. `compaction-basic` disabled — the host's own auto-compaction backend
|
|
9
|
+
# would otherwise register `ctx.compaction` at the root realm too, and
|
|
10
|
+
# only one provider per realm may own that service name. (On dsh
|
|
11
|
+
# 0.1.0-rc.6+ the web-app bundle already ships this disable; the row is
|
|
12
|
+
# idempotent and keeps the plugin self-sufficient on every supported DSH.)
|
|
13
|
+
# 2. `compaction-acp` — the ACP engine, mounted at the HOST plane, so its
|
|
14
|
+
# model tools (`compress`, `decompress`, `search_context`, `acp_status`),
|
|
15
|
+
# the `/acp` command, the advisory nudge, and the guidance section reach
|
|
16
|
+
# EVERY mode (standard / code / minimal / cordis / custom presets) of the
|
|
17
|
+
# profile the plugin was installed into.
|
|
18
|
+
#
|
|
19
|
+
# No `config` is set on purpose: the context window is auto-detected from the
|
|
20
|
+
# model API (fallback 128000) and the built-in prompt copy is used. Users who
|
|
21
|
+
# want custom config write a SAME-ID `compaction-acp` row in their profile's
|
|
22
|
+
# own `cordis.patch.yml` — it overrides this row (see README).
|
|
23
|
+
#
|
|
24
|
+
# Shipped presets (standard / code / cordis) keep their realm-local
|
|
25
|
+
# compaction-basic fallback (automatic pressure compression); minimal and
|
|
26
|
+
# presets without a compaction realm use the host ACP engine directly.
|
|
27
|
+
- id: compaction-basic
|
|
28
|
+
disabled: true
|
|
29
|
+
|
|
9
30
|
- insert:
|
|
10
31
|
- id: compaction-acp
|
|
11
|
-
name: 'billion-context-dsh'
|
|
32
|
+
name: 'billion-context-dsh'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "billion-context-dsh",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.12",
|
|
4
4
|
"description": "Active Context Pruning (ACP) for the DeepSeek Harness — model-driven context management as a CompactionEngine backend.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"deepseek",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
50
|
-
"@deepseek-ai/dsh-compaction": "^0.1.0-rc.6"
|
|
50
|
+
"@deepseek-ai/dsh-compaction": "^0.1.0-rc.6 || ^0.1.1-rc.1"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"acp-kernel": "0.0.29",
|
|
@@ -62,6 +62,7 @@
|
|
|
62
62
|
"@deepseek-ai/dsh-tools": "0.1.0-rc.6",
|
|
63
63
|
"@deepseek-ai/schemastery": "3.18.1",
|
|
64
64
|
"@types/node": "^26.1.2",
|
|
65
|
+
"semver": "^7.7.1",
|
|
65
66
|
"tsup": "^8.5.1",
|
|
66
67
|
"tsx": "^4.23.1",
|
|
67
68
|
"typescript": "^7.0.2"
|