billion-context-dsh 0.2.5 → 0.2.7
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 +2 -2
- package/README.md +2 -2
- package/dist/index.js +17 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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.7**) 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 ⭐:
|
|
@@ -150,7 +150,7 @@ A walkthrough of the ACP philosophy this project inherits — how active context
|
|
|
150
150
|
| `decompress` | Restore a previously compressed block's original content (read-only); accepts the `bN` ref shown by acp_status or a compaction id |
|
|
151
151
|
| `search_context` | Search compressed block summaries and originals by keyword (acp-kernel hybrid retrieval: stemming + CJK bigrams + fuzzy); hits link back to the owning block |
|
|
152
152
|
| `acp_status` | CONTEXT BREAKDOWN (tool/text/summaries shares of the visible total) + compressed-block ledger + nudge decision line; no context-window rows. Drilldown supported: `scope:"compressed"` per block, `scope:"uncompressed"` + `view:"messages"`/`"ranges"` per message/range, with `tool` filter, `sort` order and `limit` cap. Drilldown row refs are kernel ids (mN) — feed them straight to `compress` as `startSeq`/`endSeq` (auto-mapped to the live surface seq); `Surface:` seqs work too |
|
|
153
|
-
| `/acp` | status / compress / decompress from the command bar |
|
|
153
|
+
| `/acp` | status / compress / decompress from the command bar; status also shows human-side window info (estimated context, window source, compressed-block ledger, and **nudge arbitration** — `nudge: idle/ACTIVE — reason` plus how many tokens remain until the next nudge, decided by the same kernel turn as the nudge path) |
|
|
154
154
|
|
|
155
155
|
## Upstream & credits
|
|
156
156
|
|
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.7**)仍处于开发中的测试版。[DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 本身也处于**公开测试版**阶段。**请勿将两者用于工程化 / 生产环境**——预期会有破坏性变更与粗糙之处。
|
|
7
7
|
|
|
8
8
|
<p align="center">
|
|
9
9
|
<strong>衷心感谢以下项目——请给它们一个 ⭐:</strong>
|
|
@@ -151,7 +151,7 @@ DSH 的每个模型请求都派生自其 append-only 会话日志(*surface*)
|
|
|
151
151
|
| `decompress` | 恢复已压缩块的原始内容(只读);接受 acp_status 显示的 `bN` 或 compaction id |
|
|
152
152
|
| `search_context` | 按关键词搜索压缩块摘要与原文(acp-kernel hybrid 检索:词干化 + CJK bigram + 模糊);命中回链所属块 |
|
|
153
153
|
| `acp_status` | CONTEXT BREAKDOWN(tool/text/summaries 占可见总量)+ 压缩块账本 + nudge 决策行;不含上下文窗口。支持钻取:`scope:"compressed"` 逐块、`scope:"uncompressed"` + `view:"messages"`/`"ranges"` 逐消息/区间,`tool` 过滤、`sort` 排序、`limit` 截断。钻取行 ref 是内核 mN——可直接作为 `compress` 的 `startSeq`/`endSeq`(自动映射为 live surface seq);`Surface:` 的 seq 同样可用 |
|
|
154
|
-
| `/acp` | 从命令栏执行 status / compress / decompress |
|
|
154
|
+
| `/acp` | 从命令栏执行 status / compress / decompress;status 额外展示 human-side 窗口信息(estimated context、context window 来源、压缩账本、**nudge 仲裁**——`nudge: idle/ACTIVE — reason` 及距下一次 nudge 还差多少 token,与 nudge 路径同一内核判定) |
|
|
155
155
|
|
|
156
156
|
## 上游项目与致谢
|
|
157
157
|
|
package/dist/index.js
CHANGED
|
@@ -4242,8 +4242,9 @@ async function statusText(env, agent) {
|
|
|
4242
4242
|
const session = agent.session;
|
|
4243
4243
|
const ledger = rebuildBlockLedger(session.events);
|
|
4244
4244
|
const totalTokens = ledger.reduce((sum, block) => sum + block.shadowedTokenCount, 0);
|
|
4245
|
-
const coreMessages =
|
|
4246
|
-
const
|
|
4245
|
+
const coreMessages = allLogMessages(session);
|
|
4246
|
+
const surfaceMessages = eventsToCoreMessages(surfaceEventsOf(session));
|
|
4247
|
+
const estimated = resolveTokenCount(agent, surfaceMessages);
|
|
4247
4248
|
const window = env.windowFor === void 0 ? { limit: env.modelContextLimit, source: "explicit" } : await env.windowFor(agent);
|
|
4248
4249
|
const limit = window.limit;
|
|
4249
4250
|
const lines = [
|
|
@@ -4253,7 +4254,20 @@ async function statusText(env, agent) {
|
|
|
4253
4254
|
` estimated context: ${estimated} / ${limit} (${Math.round(estimated / limit * 100)}%)`,
|
|
4254
4255
|
` context window: ${limit} (${windowSourceLabel(window)})`
|
|
4255
4256
|
];
|
|
4256
|
-
|
|
4257
|
+
const state = structuredClone(env.store.stateFor(session));
|
|
4258
|
+
const config = kernelConfigFor({ ...env, modelContextLimit: limit });
|
|
4259
|
+
const turn = env.kernel.processTurn({ messages: coreMessages, state, config, tokenCount: estimated });
|
|
4260
|
+
const nudge = turn.nudge;
|
|
4261
|
+
if (nudge !== void 0) {
|
|
4262
|
+
const label = nudge.shouldInject ? nudge.tier !== null ? `ACTIVE [T${nudge.tier}]` : "ACTIVE" : "idle";
|
|
4263
|
+
lines.push(` nudge: ${label} \u2014 ${nudge.reason}`);
|
|
4264
|
+
if (!nudge.shouldInject) {
|
|
4265
|
+
const maxPct = config.nudge.maxContextLimitPct;
|
|
4266
|
+
const toNudge = Math.max(0, Math.round(maxPct * limit - estimated));
|
|
4267
|
+
lines.push(` next nudge: ~${toNudge.toLocaleString()} tokens to go (usage ${Math.round(nudge.contextUsage * 100)}% \u2192 ${Math.round(maxPct * 100)}% line)`);
|
|
4268
|
+
}
|
|
4269
|
+
}
|
|
4270
|
+
for (const block of ledger) {
|
|
4257
4271
|
const tier = block.tier > 1 ? ` [T${block.tier}]` : "";
|
|
4258
4272
|
lines.push(` - ${block.blockId.slice(0, 8)}${tier}: seqs ${block.start}..${block.end} \u2014 ${block.summary.slice(0, 80)}`);
|
|
4259
4273
|
}
|