@deepseek-ai/dsh-session-store 0.0.0-stage → 0.2.3-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/LICENSE +21 -0
- package/README.i18n.yaml +106 -0
- package/README.md +274 -2
- package/README.zh.md +275 -0
- package/lib/index.js +1371 -0
- package/lib/types/index.d.ts +228 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index.js.map +1 -0
- package/lib/types/preparation.d.ts +33 -0
- package/lib/types/preparation.d.ts.map +1 -0
- package/lib/types/preparation.js.map +1 -0
- package/lib/types/request-header.d.ts +50 -0
- package/lib/types/request-header.d.ts.map +1 -0
- package/lib/types/request-header.js.map +1 -0
- package/lib/types/surface.d.ts +66 -0
- package/lib/types/surface.d.ts.map +1 -0
- package/lib/types/surface.js.map +1 -0
- package/lib/types/tool-history.d.ts +89 -0
- package/lib/types/tool-history.d.ts.map +1 -0
- package/lib/types/tool-history.js.map +1 -0
- package/lib/types/validation.d.ts +36 -0
- package/lib/types/validation.d.ts.map +1 -0
- package/lib/types/validation.js.map +1 -0
- package/locale/de.json +6 -0
- package/locale/en.json +5 -0
- package/locale/es.json +6 -0
- package/locale/fr.json +6 -0
- package/locale/ja.json +6 -0
- package/locale/pt.json +6 -0
- package/locale/ru.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +50 -3
- package/src/index.ts +773 -0
- package/src/preparation.ts +49 -0
- package/src/request-header.ts +85 -0
- package/src/surface.ts +446 -0
- package/src/tool-history.ts +345 -0
- package/src/validation.ts +75 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Complete session log validation without constructing a Session.
|
|
3
|
+
* @module @deepseek-ai/dsh-session-store/validation
|
|
4
|
+
*/
|
|
5
|
+
import { SessionLogOffset } from '@deepseek-ai/dsh-session';
|
|
6
|
+
import type { SessionEvent, SessionHeader, SessionMessageProjection, SessionSeedEventState } from '@deepseek-ai/dsh-session';
|
|
7
|
+
import { SurfaceManager } from './surface.ts';
|
|
8
|
+
/**
|
|
9
|
+
* Replay validated events through the surface in order and push each accepted event into `log`, which `surface` reads.
|
|
10
|
+
* Each event passes the surface transition before it enters `log`.
|
|
11
|
+
* @param events - events accepted by `checkSessionLog`.
|
|
12
|
+
* @param log - empty log that `surface` was constructed over.
|
|
13
|
+
* @param surface - incremental surface validator carrying the message interpreters.
|
|
14
|
+
* @throws on the first invalid surface transition; `log` then holds the accepted prefix.
|
|
15
|
+
*/
|
|
16
|
+
export declare function replaySurfaceEvents(events: readonly SessionEvent[], log: SessionEvent[], surface: SurfaceManager): void;
|
|
17
|
+
/**
|
|
18
|
+
* Validate a header and event log without constructing a Session. It runs the
|
|
19
|
+
* two stages Session construction runs: first the structural checks on the
|
|
20
|
+
* header, event envelopes, sequences, and inherited cut, then surface replay
|
|
21
|
+
* in event order. Because the stages do not interleave, a log with several
|
|
22
|
+
* invalid points can report a different first error than an interleaved
|
|
23
|
+
* per-event check.
|
|
24
|
+
* Without `eventState` the checks use the borrowed seed mode: events and header
|
|
25
|
+
* are copied before validation. With it they validate and deeply freeze
|
|
26
|
+
* `header` in place and leave events uncopied.
|
|
27
|
+
* Embedded Assistant streams are not replayed.
|
|
28
|
+
* @param header - header whose `id` is the Session identity.
|
|
29
|
+
* @param events - seed events; omitted means no seed.
|
|
30
|
+
* @param inheritedEventCount - exact fork-inherited prefix length; required when `header.isSeeded`.
|
|
31
|
+
* @param eventState - aliasing state of adopted events; omitted for borrowed events.
|
|
32
|
+
* @param projections - message interpreters for plugin-owned events.
|
|
33
|
+
* @throws on the first invalid header field, event envelope, sequence, or inherited cut, then on the first invalid surface transition.
|
|
34
|
+
*/
|
|
35
|
+
export declare function validateSessionLog(header: SessionHeader, events?: readonly SessionEvent[], inheritedEventCount?: SessionLogOffset, eventState?: SessionSeedEventState, projections?: readonly SessionMessageProjection[]): void;
|
|
36
|
+
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/validation.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAmB,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAC5E,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,wBAAwB,EAAE,qBAAqB,EAA8B,MAAM,0BAA0B,CAAA;AACxJ,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAoB7C;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,SAAS,YAAY,EAAE,EAC/B,GAAG,EAAE,YAAY,EAAE,EACnB,OAAO,EAAE,cAAc,GACtB,IAAI,CAKN;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,aAAa,EACrB,MAAM,CAAC,EAAE,SAAS,YAAY,EAAE,EAChC,mBAAmB,CAAC,EAAE,gBAAgB,EACtC,UAAU,CAAC,EAAE,qBAAqB,EAClC,WAAW,GAAE,SAAS,wBAAwB,EAAO,GACpD,IAAI,CAIN"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../src/validation.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAE5E,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAE7C;;;;;;GAMG;AACH,SAAS,kBAAkB,CAAC,KAAmB,EAAE,KAAa,EAAE,OAAmC;IACjG,4EAA4E;IAC5E,wEAAwE;IACxE,2DAA2D;IAC3D,IAAI,CAAC;QACH,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAA;IAC7B,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,+BAA+B,KAAK,KAAK,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,0BAA0B,EAAE,CAAC,CAAA;IACjI,CAAC;AACH,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CACjC,MAA+B,EAC/B,GAAmB,EACnB,OAAuB;IAEvB,KAAK,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC;QAC9C,kBAAkB,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,CAAA;QACzC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IACjB,CAAC;AACH,CAAC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,kBAAkB,CAChC,MAAqB,EACrB,MAAgC,EAChC,mBAAsC,EACtC,UAAkC,EAClC,cAAmD,EAAE;IAErD,MAAM,OAAO,GAAG,eAAe,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,mBAAmB,EAAE,UAAU,IAAI,UAAU,CAAC,CAAA;IACzG,MAAM,GAAG,GAAmB,EAAE,CAAA;IAC9B,mBAAmB,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,cAAc,CAAC,GAAG,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAA;AACrG,CAAC"}
|
package/locale/de.json
ADDED
package/locale/es.json
ADDED
package/locale/fr.json
ADDED
package/locale/ja.json
ADDED
package/locale/pt.json
ADDED
package/locale/ru.json
ADDED
package/locale/zh.json
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,53 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-session-store",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"description": "Event-sourced session store for the DeepSeek Harness: the plugin that provides ctx.sessions",
|
|
4
|
+
"version": "0.2.3-alpha.4",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/deepseek-ai/deepseek-harness.git",
|
|
11
|
+
"directory": "packages/core/session-store"
|
|
12
|
+
},
|
|
13
|
+
"type": "module",
|
|
14
|
+
"main": "lib/index.js",
|
|
15
|
+
"types": "lib/types/index.d.ts",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./lib/types/index.d.ts",
|
|
19
|
+
"default": "./lib/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./src/*": "./src/*",
|
|
22
|
+
"./package.json": "./package.json",
|
|
23
|
+
"./locale/*.json": "./locale/*.json"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"locale/*.json",
|
|
27
|
+
"lib/index.js",
|
|
28
|
+
"lib/types/**/*.d.ts",
|
|
29
|
+
"lib/types/**/*.d.ts.map",
|
|
30
|
+
"lib/**/*.js.map",
|
|
31
|
+
"src"
|
|
32
|
+
],
|
|
33
|
+
"license": "MIT",
|
|
34
|
+
"peerDependencies": {
|
|
35
|
+
"@deepseek-ai/dsh-scope": "0.2.3-alpha.4",
|
|
36
|
+
"@deepseek-ai/dsh-session": "0.2.3-alpha.4",
|
|
37
|
+
"@deepseek-ai/dsh-session-data": "0.2.3-alpha.4",
|
|
38
|
+
"@deepseek-ai/cordis": "~4.2.0-alpha.3"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@deepseek-ai/dsh-agent-loop-testkit": "0.2.3-alpha.4",
|
|
42
|
+
"@deepseek-ai/dsh-brand": "0.2.3-alpha.4",
|
|
43
|
+
"@deepseek-ai/dsh-scope": "0.2.3-alpha.4",
|
|
44
|
+
"@deepseek-ai/dsh-session": "0.2.3-alpha.4",
|
|
45
|
+
"@deepseek-ai/dsh-session-data": "0.2.3-alpha.4",
|
|
46
|
+
"@deepseek-ai/dsh-typert-registry": "0.2.3-alpha.4",
|
|
47
|
+
"@deepseek-ai/cordis": "~4.2.0-alpha.3"
|
|
48
|
+
},
|
|
49
|
+
"dependencies": {
|
|
50
|
+
"@deepseek-ai/dsh-llm": "0.2.3-alpha.4",
|
|
51
|
+
"@deepseek-ai/dsh-util-values": "0.2.3-alpha.4"
|
|
52
|
+
}
|
|
6
53
|
}
|