@deepseek-ai/dsh-session-snapshot 0.1.2-alpha.2 → 0.1.2-alpha.4
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.i18n.yaml +2 -2
- package/README.md +3 -3
- package/README.zh.md +3 -3
- package/lib/index.js +5 -5
- package/package.json +15 -22
- package/lib/invariant.js +0 -23
- package/lib/types/invariant.d.ts +0 -16
package/README.i18n.yaml
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
3
|
# after editing either side, bring the other along and re-record with:
|
|
4
4
|
# pnpm run verify-translation-pairing --write packages/test-support/session-snapshot/README.md
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: 0e099dba28f45031bdaa3c187f3e3ffce5b3b2b9
|
|
6
|
+
README.zh.md: f81b3038b14b94716f4f045aee2d70daa27930dc
|
package/README.md
CHANGED
|
@@ -87,7 +87,7 @@ A scenario requiring a non-Windows host declares `posixOnly`, which skips its ru
|
|
|
87
87
|
### What can go wrong
|
|
88
88
|
|
|
89
89
|
- **A fixture guard rejects the committed files** — orphan scenario dirs, missing files, multiple pins for one header class, duplicate sidecar content, unscrubbed JSONL headers, and malformed pinning headers all fail the suite before comparisons run.
|
|
90
|
-
- **The session harvest needs raw JSONL mode** — snapshot configs set the JSONL backend's `compression: 'none'`; compressed JSONL
|
|
90
|
+
- **The session harvest needs raw JSONL mode** — snapshot configs set the JSONL backend's `compression: 'none'`; compressed JSONL has no snapshot-harvest path.
|
|
91
91
|
- **Built mode needs current artifacts** — run `pnpm run build` before selecting `DSH_EXAMPLE_MODE=lib`; source mode remains the zero-build path.
|
|
92
92
|
|
|
93
93
|
-----
|
|
@@ -116,7 +116,7 @@ The shared core owns manifests, workspace setup/comparison, typed identity mappi
|
|
|
116
116
|
| [`src/workspace.ts`](src/workspace.ts) | Scenario workspace setup and complete expected-state comparison |
|
|
117
117
|
| [`src/suite.ts`](src/suite.ts) | Scenario-table suite factory, fixture guards, record/refresh write-back |
|
|
118
118
|
| [`src/index.ts`](src/index.ts) | Package entry re-exporting the four layers |
|
|
119
|
-
|
|
|
119
|
+
| — | No runtime invariant companion is published; this test-support package owns no production event stream or mutable data; consuming test suites exercise its behavior. |
|
|
120
120
|
|
|
121
121
|
### Data flow
|
|
122
122
|
|
|
@@ -154,7 +154,7 @@ None; this package neither assembles nor sends a provider request.
|
|
|
154
154
|
|
|
155
155
|
These limits define when the kit needs special care. They are current package constraints, not a task backlog.
|
|
156
156
|
|
|
157
|
-
- **Session harvest requires raw JSONL mode** — `runScenario` collects persisted `.jsonl` logs, so snapshot configs set the JSONL backend's `compression: 'none'`; compressed JSONL
|
|
157
|
+
- **Session harvest requires raw JSONL mode** — `runScenario` collects persisted `.jsonl` logs, so snapshot configs set the JSONL backend's `compression: 'none'`; compressed JSONL has no snapshot-harvest path.
|
|
158
158
|
- **Built mode requires current artifacts** — run `pnpm run build` before selecting `DSH_EXAMPLE_MODE=lib`; source mode remains the zero-build path.
|
|
159
159
|
- **ACP remains for protocol behavior** — cancellation and permission round trips whose stimulus is the ACP client stay on that adapter; assembled one-shot and persistent-control behavior uses headless and SDK adapters.
|
|
160
160
|
|
package/README.zh.md
CHANGED
|
@@ -87,7 +87,7 @@ defineAcpSnapshotSuite({
|
|
|
87
87
|
### 可能出什么问题
|
|
88
88
|
|
|
89
89
|
- **fixture 保护拒绝已提交文件**——遗留场景目录、缺失文件、一个 header 类别包含多个 pin、重复的伴随文件内容、未擦除的 JSONL header 与格式错误的 pin header 都会在比较运行前使套件失败。
|
|
90
|
-
- **会话收集需要原始 JSONL mode**——快照配置使用 JSONL 后端的 `compression: 'none'`;压缩 JSONL
|
|
90
|
+
- **会话收集需要原始 JSONL mode**——快照配置使用 JSONL 后端的 `compression: 'none'`;压缩 JSONL 没有快照收集路径。
|
|
91
91
|
- **构建 mode 需要当前产物**——选择 `DSH_EXAMPLE_MODE=lib` 前先运行 `pnpm run build`;源 mode 仍是零构建路径。
|
|
92
92
|
|
|
93
93
|
-----
|
|
@@ -116,7 +116,7 @@ defineAcpSnapshotSuite({
|
|
|
116
116
|
| [`src/workspace.ts`](src/workspace.ts) | 场景 workspace 设置与完整预期状态比较 |
|
|
117
117
|
| [`src/suite.ts`](src/suite.ts) | 场景表套件工厂、fixture 保护、录制/刷新回写 |
|
|
118
118
|
| [`src/index.ts`](src/index.ts) | 再导出四个层的包入口 |
|
|
119
|
-
|
|
|
119
|
+
| — | 不发布运行时不变式伴生入口;消费它的测试套件会检验该工具包。 |
|
|
120
120
|
|
|
121
121
|
### 数据流
|
|
122
122
|
|
|
@@ -154,7 +154,7 @@ defineAcpSnapshotSuite({
|
|
|
154
154
|
|
|
155
155
|
这些限制说明何时需要对该工具包特别小心。它们是当前包约束,不是任务积压。
|
|
156
156
|
|
|
157
|
-
- **会话收集需要原始 JSONL mode**——`runScenario` 收集持久化 `.jsonl` 日志,因此快照配置使用 JSONL 后端的 `compression: 'none'`;压缩 JSONL
|
|
157
|
+
- **会话收集需要原始 JSONL mode**——`runScenario` 收集持久化 `.jsonl` 日志,因此快照配置使用 JSONL 后端的 `compression: 'none'`;压缩 JSONL 没有快照收集路径。
|
|
158
158
|
- **构建 mode 需要当前产物**——选择 `DSH_EXAMPLE_MODE=lib` 前先运行 `pnpm run build`;源 mode 仍是零构建路径。
|
|
159
159
|
- **ACP 继续覆盖协议行为**——刺激来自 ACP 客户端的取消与权限往返留在该适配器;组装式一次性行为与持久控制行为使用 headless 与 SDK 适配器。
|
|
160
160
|
|
package/lib/index.js
CHANGED
|
@@ -12,7 +12,7 @@ import { pathToFileURL } from "node:url";
|
|
|
12
12
|
import * as yaml from "js-yaml";
|
|
13
13
|
import { entryListSchema } from "@deepseek-ai/cordis-plugin-include";
|
|
14
14
|
import { resolveExampleLaunch } from "@deepseek-ai/dsh-loader-smoke";
|
|
15
|
-
import { decodeSeqRanges, decodeStorageRecord, packChunkRuns } from "@deepseek-ai/dsh-session";
|
|
15
|
+
import { SessionLogOffset, SessionSeq, decodeSeqRanges, decodeStorageRecord, packChunkRuns } from "@deepseek-ai/dsh-session";
|
|
16
16
|
import { isSurfaceEligibleType } from "@deepseek-ai/dsh-session/surface";
|
|
17
17
|
//#region lib/types/identity.js
|
|
18
18
|
/** Relationship-preserving identity redaction for committed session snapshots. */
|
|
@@ -1197,7 +1197,7 @@ function normalizeSessionLog(rawLog, ctx, options = {}) {
|
|
|
1197
1197
|
function repackSessionSnapshot(rawLog) {
|
|
1198
1198
|
const lines = rawLog.split("\n").filter((line) => line.trim().length > 0);
|
|
1199
1199
|
const header = lines.shift();
|
|
1200
|
-
let nextSeq = 0;
|
|
1200
|
+
let nextSeq = SessionLogOffset(0);
|
|
1201
1201
|
return [
|
|
1202
1202
|
header,
|
|
1203
1203
|
...packChunkRuns(lines.flatMap((line) => {
|
|
@@ -1208,15 +1208,15 @@ function repackSessionSnapshot(rawLog) {
|
|
|
1208
1208
|
seq0: nextSeq,
|
|
1209
1209
|
time0: 0
|
|
1210
1210
|
});
|
|
1211
|
-
nextSeq
|
|
1211
|
+
nextSeq = SessionLogOffset(nextSeq + decoded.length);
|
|
1212
1212
|
return decoded;
|
|
1213
1213
|
}
|
|
1214
1214
|
const event = {
|
|
1215
1215
|
...record,
|
|
1216
|
-
seq: nextSeq,
|
|
1216
|
+
seq: SessionSeq(nextSeq),
|
|
1217
1217
|
time: 0
|
|
1218
1218
|
};
|
|
1219
|
-
nextSeq
|
|
1219
|
+
nextSeq = SessionLogOffset(nextSeq + 1);
|
|
1220
1220
|
return [event];
|
|
1221
1221
|
})).map((stored) => {
|
|
1222
1222
|
const projected = { ...stored };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-session-snapshot",
|
|
3
3
|
"description": "Session-log snapshot core with an ACP protocol adapter, expected-output normalization, and fixture invariants",
|
|
4
|
-
"version": "0.1.2-alpha.
|
|
4
|
+
"version": "0.1.2-alpha.4",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -18,16 +18,11 @@
|
|
|
18
18
|
"types": "./lib/types/index.d.ts",
|
|
19
19
|
"default": "./lib/index.js"
|
|
20
20
|
},
|
|
21
|
-
"./invariant": {
|
|
22
|
-
"types": "./lib/types/invariant.d.ts",
|
|
23
|
-
"default": "./lib/invariant.js"
|
|
24
|
-
},
|
|
25
21
|
"./src/*": "./src/*",
|
|
26
22
|
"./package.json": "./package.json"
|
|
27
23
|
},
|
|
28
24
|
"files": [
|
|
29
25
|
"lib/index.js",
|
|
30
|
-
"lib/invariant.js",
|
|
31
26
|
"lib/types/**/*.d.ts"
|
|
32
27
|
],
|
|
33
28
|
"license": "MIT",
|
|
@@ -35,27 +30,25 @@
|
|
|
35
30
|
"@agentclientprotocol/sdk": "1.4.0",
|
|
36
31
|
"js-yaml": "^4.2.0",
|
|
37
32
|
"vitest": "^4.1.8",
|
|
38
|
-
"@deepseek-ai/
|
|
39
|
-
"@deepseek-ai/
|
|
33
|
+
"@deepseek-ai/dsh-loader-smoke": "0.1.2-alpha.4",
|
|
34
|
+
"@deepseek-ai/cordis-plugin-include": "1.0.7"
|
|
40
35
|
},
|
|
41
36
|
"peerDependencies": {
|
|
42
|
-
"@deepseek-ai/
|
|
43
|
-
"@deepseek-ai/
|
|
44
|
-
"@deepseek-ai/dsh-session": "^0.1.2-alpha.2"
|
|
37
|
+
"@deepseek-ai/dsh-session": "^0.1.2-alpha.4",
|
|
38
|
+
"@deepseek-ai/cordis": "^4.0.2"
|
|
45
39
|
},
|
|
46
40
|
"devDependencies": {
|
|
47
41
|
"@types/js-yaml": "^4.0.9",
|
|
48
42
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
49
|
-
"@deepseek-ai/dsh-agent": "^0.1.2-alpha.
|
|
50
|
-
"@deepseek-ai/dsh-
|
|
51
|
-
"@deepseek-ai/dsh-
|
|
52
|
-
"@deepseek-ai/dsh-
|
|
53
|
-
"@deepseek-ai/dsh-
|
|
54
|
-
"@deepseek-ai/dsh-
|
|
55
|
-
"@deepseek-ai/dsh-subagent": "^0.1.2-alpha.
|
|
56
|
-
"@deepseek-ai/dsh-tools": "^0.1.2-alpha.
|
|
57
|
-
"@deepseek-ai/dsh-
|
|
58
|
-
"@deepseek-ai/dsh-
|
|
59
|
-
"@deepseek-ai/dsh-invariants": "^0.1.2-alpha.2"
|
|
43
|
+
"@deepseek-ai/dsh-agent-loop": "^0.1.2-alpha.4",
|
|
44
|
+
"@deepseek-ai/dsh-compaction": "^0.1.2-alpha.4",
|
|
45
|
+
"@deepseek-ai/dsh-llm": "^0.1.2-alpha.4",
|
|
46
|
+
"@deepseek-ai/dsh-sandbox": "^0.1.2-alpha.4",
|
|
47
|
+
"@deepseek-ai/dsh-session": "^0.1.2-alpha.4",
|
|
48
|
+
"@deepseek-ai/dsh-sandbox-policy": "^0.1.2-alpha.4",
|
|
49
|
+
"@deepseek-ai/dsh-subagent": "^0.1.2-alpha.4",
|
|
50
|
+
"@deepseek-ai/dsh-tools": "^0.1.2-alpha.4",
|
|
51
|
+
"@deepseek-ai/dsh-user-questions": "^0.1.2-alpha.4",
|
|
52
|
+
"@deepseek-ai/dsh-agent": "^0.1.2-alpha.4"
|
|
60
53
|
}
|
|
61
54
|
}
|
package/lib/invariant.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
//#region lib/types/invariant.js
|
|
2
|
-
/**
|
|
3
|
-
* Package-owned invariant companion for `@deepseek-ai/dsh-session-snapshot`.
|
|
4
|
-
* @module @deepseek-ai/dsh-session-snapshot/invariant
|
|
5
|
-
*/
|
|
6
|
-
const PACKAGE_NAME = "@deepseek-ai/dsh-session-snapshot";
|
|
7
|
-
/** Cordis companion plugin name. */
|
|
8
|
-
const name = "session-snapshot-invariant";
|
|
9
|
-
/** Service required before the companion can reserve package ownership. */
|
|
10
|
-
const inject = ["invariants"];
|
|
11
|
-
/**
|
|
12
|
-
* No runtime invariant: this test-support package owns no production event stream or mutable data;
|
|
13
|
-
* consuming test suites exercise its behavior.
|
|
14
|
-
*/
|
|
15
|
-
const install = () => {};
|
|
16
|
-
/**
|
|
17
|
-
* Register this package's invariant companion.
|
|
18
|
-
* @param ctx - Cordis context carrying the invariant service.
|
|
19
|
-
* @returns the installed registration's disposer after setup succeeds.
|
|
20
|
-
*/
|
|
21
|
-
const apply = (ctx) => Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install));
|
|
22
|
-
//#endregion
|
|
23
|
-
export { apply, inject, name };
|
package/lib/types/invariant.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Package-owned invariant companion for `@deepseek-ai/dsh-session-snapshot`.
|
|
3
|
-
* @module @deepseek-ai/dsh-session-snapshot/invariant
|
|
4
|
-
*/
|
|
5
|
-
import type { Context } from '@deepseek-ai/cordis';
|
|
6
|
-
/** Cordis companion plugin name. */
|
|
7
|
-
export declare const name = "session-snapshot-invariant";
|
|
8
|
-
/** Service required before the companion can reserve package ownership. */
|
|
9
|
-
export declare const inject: string[];
|
|
10
|
-
/**
|
|
11
|
-
* Register this package's invariant companion.
|
|
12
|
-
* @param ctx - Cordis context carrying the invariant service.
|
|
13
|
-
* @returns the installed registration's disposer after setup succeeds.
|
|
14
|
-
*/
|
|
15
|
-
export declare const apply: (ctx: Context) => Promise<() => void>;
|
|
16
|
-
//# sourceMappingURL=invariant.d.ts.map
|