billion-context-dsh 0.2.18 → 0.2.19
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 +44 -26
- package/dist/index.js.map +1 -1
- package/dist/region.d.ts +13 -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.19**) 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 ⭐:
|
|
@@ -98,7 +98,7 @@ This only installs the package into your project/global store; it does **not** t
|
|
|
98
98
|
**Install from the git source (`github:` spec — the form the plugin store shows).** The prebuilt `dist/` artifacts are committed to this repository, so a git-source install also works out of the box — **no build step needed**, and pnpm 11's default build-script blocking (`allowBuilds`) never applies to this package:
|
|
99
99
|
|
|
100
100
|
```bash
|
|
101
|
-
dsh plugin --profile web add github:Tyan66666/billion-context-dsh#v0.2.
|
|
101
|
+
dsh plugin --profile web add github:Tyan66666/billion-context-dsh#v0.2.19
|
|
102
102
|
```
|
|
103
103
|
|
|
104
104
|
Prefer a `#<tag>` ref to get artifacts identical to that npm release; without a ref you get the latest default-branch build. Only building the repo yourself (`npm run build`) requires approving build scripts. Background and trade-offs: [docs/git-source-install-design.md](docs/git-source-install-design.md) (issue #92).
|
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.19**)仍处于开发中的测试版。[DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 本身也处于**公开测试版**阶段。**请勿将两者用于工程化 / 生产环境**——预期会有破坏性变更与粗糙之处。
|
|
7
7
|
|
|
8
8
|
<p align="center">
|
|
9
9
|
<strong>衷心感谢以下项目——请给它们一个 ⭐:</strong>
|
|
@@ -97,7 +97,7 @@ npm install billion-context-dsh
|
|
|
97
97
|
**git 源安装(`github:` 规格,插件商店展示的形态)。** 预构建产物 `dist/` 已提交到仓库,从 git 源安装同样开箱即用——**无需任何构建步骤**,pnpm 11 默认拦截构建脚本(`allowBuilds`)的机制对这个包不构成障碍:
|
|
98
98
|
|
|
99
99
|
```bash
|
|
100
|
-
dsh plugin --profile web add github:Tyan66666/billion-context-dsh#v0.2.
|
|
100
|
+
dsh plugin --profile web add github:Tyan66666/billion-context-dsh#v0.2.19
|
|
101
101
|
```
|
|
102
102
|
|
|
103
103
|
建议带 `#<tag>` 安装,拿到与对应 npm 版本完全一致的产物;不带 ref 则装默认分支的最新构建。只有 clone 仓库自行从源码构建(`npm run build`)才需要放行构建。背景与方案取舍见 [docs/git-source-install-design.md](docs/git-source-install-design.md)(issue #92)。
|
package/dist/index.js
CHANGED
|
@@ -2881,7 +2881,7 @@ function assertNoActiveCompaction(events) {
|
|
|
2881
2881
|
else if (event.type === "compaction/end") active = false;
|
|
2882
2882
|
}
|
|
2883
2883
|
if (active) {
|
|
2884
|
-
|
|
2884
|
+
console.warn("billion-context-dsh: clearing stale compaction flag \u2014 found a compaction/start with no matching compaction/end");
|
|
2885
2885
|
}
|
|
2886
2886
|
}
|
|
2887
2887
|
function hasPlainRef(session, seq) {
|
|
@@ -3012,31 +3012,49 @@ function runCompactionTransaction(session, input) {
|
|
|
3012
3012
|
const turn = findOpenTurn(sessionEventsOf(session));
|
|
3013
3013
|
const compactionId = CompactionId(randomUUID());
|
|
3014
3014
|
const seqs = [];
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3015
|
+
if (input.start > input.end) {
|
|
3016
|
+
throw new Error(`billion-context-dsh: reversed range ${input.start}..${input.end}`);
|
|
3017
|
+
}
|
|
3018
|
+
if (eventAtOf(session, input.start) === void 0 || eventAtOf(session, input.end) === void 0) {
|
|
3019
|
+
const failedEdge = eventAtOf(session, input.start) === void 0 ? input.start : input.end;
|
|
3020
|
+
throw new Error(
|
|
3021
|
+
`billion-context-dsh: seq ${input.start}..${input.end} not in the current surface \u2014 edge seq ${failedEdge} is not in this session's log. Surface seqs are sparse message nodes (only user/message, assistant/message, tool/result events); consult acp_status for the current surface range`
|
|
3022
|
+
);
|
|
3023
|
+
}
|
|
3024
|
+
try {
|
|
3025
|
+
seqs.push(session.append("compaction/start", { compactionId, turn }).seq);
|
|
3026
|
+
seqs.push(session.append("compaction/summary", {
|
|
3027
|
+
compactionId,
|
|
3028
|
+
summary: input.summary,
|
|
3029
|
+
shadowedRange: { start: input.start, end: input.end },
|
|
3030
|
+
shadowedSeqs: [...input.shadowedSeqs],
|
|
3031
|
+
shadowedTokenCount: input.shadowedTokenCount,
|
|
3032
|
+
provider: input.provider,
|
|
3033
|
+
model: input.model,
|
|
3034
|
+
tier: input.tier ?? 1,
|
|
3035
|
+
...input.kernelBlockId === void 0 ? {} : { kernelBlockId: input.kernelBlockId },
|
|
3036
|
+
...input.topic === void 0 ? {} : { topic: input.topic },
|
|
3037
|
+
...input.parentBlockIds === void 0 || input.parentBlockIds.length === 0 ? {} : { parentBlockIds: [...input.parentBlockIds] },
|
|
3038
|
+
...input.directMessageIds === void 0 ? {} : { directMessageIds: [...input.directMessageIds] },
|
|
3039
|
+
...input.effectiveMessageIds === void 0 ? {} : { effectiveMessageIds: [...input.effectiveMessageIds] }
|
|
3040
|
+
}).seq);
|
|
3041
|
+
const message = createUserMessage({
|
|
3042
|
+
content: input.summary,
|
|
3043
|
+
source: compactCheckpointSource(compactionId)
|
|
3044
|
+
});
|
|
3045
|
+
seqs.push(session.append("user/message", message, {
|
|
3046
|
+
surfaceOp: { op: "replace", start: input.start, end: input.end },
|
|
3047
|
+
sourceEventSeqs: [...input.shadowedSeqs]
|
|
3048
|
+
}).seq);
|
|
3049
|
+
seqs.push(session.append("compaction/end", { compactionId, turn }).seq);
|
|
3050
|
+
} catch (error) {
|
|
3051
|
+
try {
|
|
3052
|
+
session.append("compaction/end", { compactionId, turn });
|
|
3053
|
+
} catch (compensateError) {
|
|
3054
|
+
console.warn("billion-context-dsh: failed to write a compensating compaction/end", compensateError);
|
|
3055
|
+
}
|
|
3056
|
+
throw error;
|
|
3057
|
+
}
|
|
3040
3058
|
return { compactionId, seqs };
|
|
3041
3059
|
}
|
|
3042
3060
|
function summarySeqOfCompaction(events, compactionId) {
|