billion-context-dsh 0.1.8 → 0.1.9

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.
Files changed (3) hide show
  1. package/README.en.md +16 -1
  2. package/README.md +16 -1
  3. package/package.json +2 -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.1.8**) 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.
6
+ > This project (**v0.1.9**) 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 ⭐:
@@ -76,6 +76,20 @@ That's it. Then add a composition row where a compaction backend is expected —
76
76
  modelContextLimit: 128000 # optional; omit to auto-detect the model's real window (fallback 128000)
77
77
  ```
78
78
 
79
+ **(Optional) Custom prompt copy — `config.prompts`.** Every model-visible prompt (normal/emergency nudge opener, tier line, range table, the ACP system-prompt section, the four tool descriptions) ships with built-in copy that you can override per slot through the composition row's `config`. Templates support named placeholders (e.g. `{pct}` for nudges, `{surface}` for the range table) and are **validated at construction**: a misspelled placeholder fails engine startup (fail-fast) instead of leaking a literal `{pct}` into the model context:
80
+
81
+ ```yaml
82
+ config:
83
+ modelContextLimit: 128000
84
+ prompts:
85
+ nudge:
86
+ normal: 'Context usage is at {pct}%. This is a suggestion, not a requirement — you decide.' # custom nudge opener
87
+ tools:
88
+ acpStatus: 'Report the ACP block ledger: compressed blocks, reclaimed tokens, and current context pressure.' # custom tool description
89
+ ```
90
+
91
+ See [docs/configurable-prompts-design.md](docs/configurable-prompts-design.md) for the full slot list, per-slot placeholders, and the empty-string/`null` semantics. Deployments that omit `prompts` behave exactly as before (default copy byte-identical).
92
+
79
93
  **Per-mode — an agent preset's `compaction` realm.** First *disable (or delete) the realm's existing `dsh-compaction-basic` row*, then mount this engine — two backends cannot coexist in the same realm:
80
94
 
81
95
  ```yaml
@@ -151,6 +165,7 @@ This project reuses `acp-kernel`'s compression core and `billion-context-pi`'s d
151
165
  | `autoTools` | `true` | Register the four model tools on `ctx.tools` |
152
166
  | `autoCommand` | `true` | Register the `/acp` command on `ctx.commands` |
153
167
  | `autoNudge` | `true` | Inject the nudge into `agent/pre-step` |
168
+ | `prompts` | — | (optional) Custom prompt copy: per-slot overrides for nudge / range table / system prompt / tool descriptions (template + named placeholders, validated at construction; see “Custom prompt copy” above and [docs/configurable-prompts-design.md](docs/configurable-prompts-design.md)) |
154
169
 
155
170
  ## Development
156
171
 
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  [中文](./README.md) | [English](./README.en.md)
4
4
 
5
5
  > **⚠️ 测试版声明——请勿用于生产环境**
6
- > 本项目(**v0.1.8**)仍处于开发中的测试版。[DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 本身也处于**公开测试版**阶段。**请勿将两者用于工程化 / 生产环境**——预期会有破坏性变更与粗糙之处。
6
+ > 本项目(**v0.1.9**)仍处于开发中的测试版。[DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 本身也处于**公开测试版**阶段。**请勿将两者用于工程化 / 生产环境**——预期会有破坏性变更与粗糙之处。
7
7
 
8
8
  <p align="center">
9
9
  <strong>衷心感谢以下项目——请给它们一个 ⭐:</strong>
@@ -78,6 +78,20 @@ npm install billion-context-dsh
78
78
  modelContextLimit: 128000 # 可选;省略时自动探测模型真实窗口(回退 128000)
79
79
  ```
80
80
 
81
+ **(可选)自定义提示词文案 —— `config.prompts`。** 所有模型可见的提示词(普通/紧急 nudge 首句、tier 蒸馏行、范围表、ACP system prompt 段、四个工具描述)默认是内置文案,可通过组合行的 `config` 按槽位覆盖。模板支持命名占位符(如 nudge 的 `{pct}`、范围表的 `{surface}`),**构造期校验**:占位符拼写错误会在引擎启动时抛错(fail-fast),而不是把字面 `{pct}` 漏进模型上下文:
82
+
83
+ ```yaml
84
+ config:
85
+ modelContextLimit: 128000
86
+ prompts:
87
+ nudge:
88
+ normal: '上下文使用率 {pct}%。这是建议而非命令——由你决定是否压缩。' # 中文 nudge 首句
89
+ tools:
90
+ acpStatus: '报告 ACP 块账本:压缩块数、回收 token、当前上下文压力。' # 自定义工具描述
91
+ ```
92
+
93
+ 可配置槽位清单、每槽可用占位符、空串/`null` 语义见 [docs/configurable-prompts-design.md](docs/configurable-prompts-design.md)。未配置 `prompts` 的部署行为与以往完全一致(默认文案逐字节不变)。
94
+
81
95
  **单模式生效(agent preset 的 `compaction` realm)**。先在该 realm 内*禁用(或删除)原有的 `dsh-compaction-basic` 行*,再插入本引擎——同一 realm 内两个后端不能并存:
82
96
 
83
97
  ```yaml
@@ -153,6 +167,7 @@ DSH 的每个模型请求都派生自其 append-only 会话日志(*surface*)
153
167
  | `autoTools` | `true` | 在 `ctx.tools` 注册四个模型工具 |
154
168
  | `autoCommand` | `true` | 在 `ctx.commands` 注册 `/acp` 命令 |
155
169
  | `autoNudge` | `true` | 当内核建议时向 `agent/pre-step` 注入 nudge |
170
+ | `prompts` | — | (可选)自定义提示词文案:nudge / 范围表 / system prompt / 工具描述按槽位覆盖(模板 + 命名占位符,构造期校验;见上文「自定义提示词文案」与 [docs/configurable-prompts-design.md](docs/configurable-prompts-design.md)) |
156
171
 
157
172
  ## 开发
158
173
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "billion-context-dsh",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "Active Context Pruning (ACP) for the DeepSeek Harness — model-driven context management as a CompactionEngine backend.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -28,7 +28,7 @@
28
28
  "test": "node --import tsx --test tests/*.test.ts"
29
29
  },
30
30
  "dependencies": {
31
- "acp-kernel": "0.0.23"
31
+ "acp-kernel": "0.0.24"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "@deepseek-ai/cordis": "^4.0.1",