@deepseek-ai/dsh-session-log-deepseek 0.2.0-rc.2 → 0.2.1-alpha.1

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-session-log-deepseek",
3
3
  "description": "Incremental lossless session-log request extension for the official DeepSeek LLM API",
4
- "version": "0.2.0-rc.2",
4
+ "version": "0.2.1-alpha.1",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -18,10 +18,6 @@
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
  "./types": {
26
22
  "types": "./lib/types/types.d.ts",
27
23
  "default": "./lib/types/types.js"
@@ -31,35 +27,32 @@
31
27
  },
32
28
  "files": [
33
29
  "lib/index.js",
34
- "lib/invariant.js",
35
30
  "lib/types/**/*.js",
36
31
  "lib/types/**/*.d.ts"
37
32
  ],
38
33
  "license": "MIT",
39
34
  "dependencies": {
40
- "@deepseek-ai/dsh-brand": "0.2.0-rc.2",
41
- "@deepseek-ai/dsh-util-values": "0.2.0-rc.2",
42
- "@deepseek-ai/schemastery": "~3.18.4"
35
+ "@deepseek-ai/dsh-util-values": "0.2.1-alpha.1",
36
+ "@deepseek-ai/dsh-brand": "0.2.1-alpha.1",
37
+ "@deepseek-ai/schemastery": "~3.18.5-alpha.1"
43
38
  },
44
39
  "peerDependencies": {
45
- "@deepseek-ai/cordis": "~4.0.4",
46
- "@deepseek-ai/dsh-session": "0.2.0-rc.2",
47
- "@deepseek-ai/dsh-deepseek-llm-api-extensions": "0.2.0-rc.2",
48
- "@deepseek-ai/dsh-invariants": "0.2.0-rc.2"
40
+ "@deepseek-ai/dsh-deepseek-llm-api-extensions": "0.2.1-alpha.1",
41
+ "@deepseek-ai/cordis": "~4.0.5-alpha.1",
42
+ "@deepseek-ai/dsh-session": "0.2.1-alpha.1"
49
43
  },
50
44
  "devDependencies": {
51
- "@deepseek-ai/cordis": "~4.0.4",
52
- "@deepseek-ai/cordis-plugin-include": "~1.0.9",
53
- "@deepseek-ai/cordis-plugin-loader": "~1.0.5",
54
- "@deepseek-ai/dsh-command-feedback": "0.2.0-rc.2",
55
- "@deepseek-ai/dsh-deepseek-llm-api-extensions": "0.2.0-rc.2",
56
- "@deepseek-ai/dsh-invariants": "0.2.0-rc.2",
57
- "@deepseek-ai/dsh-llm": "0.2.0-rc.2",
58
- "@deepseek-ai/dsh-llm-deepseek-api-key": "0.2.0-rc.2",
59
- "@deepseek-ai/dsh-llm-mock-server": "0.2.0-rc.2",
60
- "@deepseek-ai/dsh-message-feedback": "0.2.0-rc.2",
61
- "@deepseek-ai/dsh-llm-deepseek": "0.2.0-rc.2",
62
- "@deepseek-ai/dsh-session-persistence-jsonl": "0.2.0-rc.2",
63
- "@deepseek-ai/dsh-session": "0.2.0-rc.2"
45
+ "@deepseek-ai/cordis": "~4.0.5-alpha.1",
46
+ "@deepseek-ai/cordis-plugin-include": "~1.0.10-alpha.1",
47
+ "@deepseek-ai/cordis-plugin-loader": "~1.0.6-alpha.1",
48
+ "@deepseek-ai/dsh-command-feedback": "0.2.1-alpha.1",
49
+ "@deepseek-ai/dsh-deepseek-llm-api-extensions": "0.2.1-alpha.1",
50
+ "@deepseek-ai/dsh-llm": "0.2.1-alpha.1",
51
+ "@deepseek-ai/dsh-llm-deepseek": "0.2.1-alpha.1",
52
+ "@deepseek-ai/dsh-llm-deepseek-api-key": "0.2.1-alpha.1",
53
+ "@deepseek-ai/dsh-llm-mock-server": "0.2.1-alpha.1",
54
+ "@deepseek-ai/dsh-session": "0.2.1-alpha.1",
55
+ "@deepseek-ai/dsh-session-persistence-jsonl": "0.2.1-alpha.1",
56
+ "@deepseek-ai/dsh-message-feedback": "0.2.1-alpha.1"
64
57
  }
65
58
  }
package/lib/invariant.js DELETED
@@ -1,52 +0,0 @@
1
- import { SessionSeq } from "@deepseek-ai/dsh-session";
2
- //#region lib/types/invariant.js
3
- /** Package-owned invariants for DeepSeek session-log acceptance watermarks. */
4
- const PACKAGE_NAME = "@deepseek-ai/dsh-session-log-deepseek";
5
- /** Cordis companion plugin name. */
6
- const name = "session-log-deepseek-invariant";
7
- /** Service required before the companion can reserve package ownership. */
8
- const inject = ["invariants"];
9
- /** Validate one acceptance watermark against its containing event and session. */
10
- function validateDeliveryAccepted(session, event, fail) {
11
- const { sessionId, throughSeq } = event.data;
12
- const acceptedFormatVersion = event.data.sessionFormatVersion ?? 0;
13
- if (!Number.isSafeInteger(acceptedFormatVersion) || acceptedFormatVersion < 0 || Object.is(acceptedFormatVersion, -0)) fail(`session-log-deepseek/delivery-accepted sessionFormatVersion must be a non-negative safe integer, got ${String(acceptedFormatVersion)}`);
14
- if (acceptedFormatVersion !== session.header.version) return;
15
- const inherited = session.header.parentSession !== void 0 && !session.isOwnSeq(event.seq);
16
- if (sessionId !== session.id && !inherited) fail("a non-inherited session-log-deepseek/delivery-accepted event must name its containing session");
17
- let acceptedSeq;
18
- try {
19
- acceptedSeq = SessionSeq(throughSeq);
20
- } catch {
21
- fail(`session-log-deepseek/delivery-accepted throughSeq must identify an earlier event, got ${throughSeq} at seq ${event.seq}`);
22
- }
23
- if (acceptedSeq >= event.seq) fail(`session-log-deepseek/delivery-accepted throughSeq must identify an earlier event, got ${throughSeq} at seq ${event.seq}`);
24
- }
25
- /** Validate acceptance watermarks already present in one Session. */
26
- function validateSession(session, fail) {
27
- for (const event of session.snapshotEvents()) if (event.type === "session-log-deepseek/delivery-accepted") validateDeliveryAccepted(session, event, fail);
28
- }
29
- /** Validate one live session-event dispatch. */
30
- function validateDispatched(args, fail) {
31
- const [session, event] = args;
32
- if (event.type === "session-log-deepseek/delivery-accepted") validateDeliveryAccepted(session, event, fail);
33
- }
34
- /** Install validation for restored, newly created, and newly appended watermarks. */
35
- const install = Object.assign((ctx, fail) => {
36
- const validateExisting = (session) => {
37
- validateSession(session, fail);
38
- };
39
- ctx.sessions.list().forEach(validateExisting);
40
- ctx.on("session/created", validateExisting, { global: true });
41
- ctx.on("internal/dispatch", (_mode, eventName, args) => {
42
- if (eventName === "session/event") validateDispatched(args, fail);
43
- }, { global: true });
44
- }, { inject: ["sessions"] });
45
- /**
46
- * Register this package's invariant companion.
47
- * @param ctx - Cordis context carrying the invariant service.
48
- * @returns the installed registration's disposer after setup succeeds.
49
- */
50
- const apply = (ctx) => Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install));
51
- //#endregion
52
- export { apply, inject, name };
@@ -1,13 +0,0 @@
1
- /** Package-owned invariants for DeepSeek session-log acceptance watermarks. */
2
- import type { Context } from '@deepseek-ai/cordis';
3
- /** Cordis companion plugin name. */
4
- export declare const name = "session-log-deepseek-invariant";
5
- /** Service required before the companion can reserve package ownership. */
6
- export declare const inject: string[];
7
- /**
8
- * Register this package's invariant companion.
9
- * @param ctx - Cordis context carrying the invariant service.
10
- * @returns the installed registration's disposer after setup succeeds.
11
- */
12
- export declare const apply: (ctx: Context) => Promise<() => void>;
13
- //# sourceMappingURL=invariant.d.ts.map
@@ -1,66 +0,0 @@
1
- /** Package-owned invariants for DeepSeek session-log acceptance watermarks. */
2
- import { SessionSeq } from '@deepseek-ai/dsh-session';
3
- const PACKAGE_NAME = '@deepseek-ai/dsh-session-log-deepseek';
4
- /** Cordis companion plugin name. */
5
- export const name = 'session-log-deepseek-invariant';
6
- /** Service required before the companion can reserve package ownership. */
7
- export const inject = ['invariants'];
8
- /** Validate one acceptance watermark against its containing event and session. */
9
- function validateDeliveryAccepted(session, event, fail) {
10
- const { sessionId, throughSeq } = event.data;
11
- const acceptedFormatVersion = event.data.sessionFormatVersion ?? 0;
12
- if (!Number.isSafeInteger(acceptedFormatVersion)
13
- || acceptedFormatVersion < 0
14
- || Object.is(acceptedFormatVersion, -0)) {
15
- fail('session-log-deepseek/delivery-accepted sessionFormatVersion must be a non-negative safe integer'
16
- + `, got ${String(acceptedFormatVersion)}`);
17
- }
18
- if (acceptedFormatVersion !== session.header.version)
19
- return;
20
- const inherited = session.header.parentSession !== undefined
21
- && !session.isOwnSeq(event.seq);
22
- if (sessionId !== session.id && !inherited) {
23
- fail('a non-inherited session-log-deepseek/delivery-accepted event must name its containing session');
24
- }
25
- let acceptedSeq;
26
- try {
27
- acceptedSeq = SessionSeq(throughSeq);
28
- }
29
- catch {
30
- fail(`session-log-deepseek/delivery-accepted throughSeq must identify an earlier event, got ${throughSeq} at seq ${event.seq}`);
31
- }
32
- if (acceptedSeq >= event.seq) {
33
- fail(`session-log-deepseek/delivery-accepted throughSeq must identify an earlier event, got ${throughSeq} at seq ${event.seq}`);
34
- }
35
- }
36
- /** Validate acceptance watermarks already present in one Session. */
37
- function validateSession(session, fail) {
38
- // oxlint-disable-next-line typescript/no-deprecated -- Existing Session history read; migration deferred.
39
- for (const event of session.snapshotEvents()) {
40
- if (event.type === 'session-log-deepseek/delivery-accepted')
41
- validateDeliveryAccepted(session, event, fail);
42
- }
43
- }
44
- /** Validate one live session-event dispatch. */
45
- function validateDispatched(args, fail) {
46
- const [session, event] = args;
47
- if (event.type === 'session-log-deepseek/delivery-accepted')
48
- validateDeliveryAccepted(session, event, fail);
49
- }
50
- /** Install validation for restored, newly created, and newly appended watermarks. */
51
- const install = Object.assign((ctx, fail) => {
52
- const validateExisting = (session) => { validateSession(session, fail); };
53
- ctx.sessions.list().forEach(validateExisting);
54
- ctx.on('session/created', validateExisting, { global: true });
55
- ctx.on('internal/dispatch', (_mode, eventName, args) => {
56
- if (eventName === 'session/event')
57
- validateDispatched(args, fail);
58
- }, { global: true });
59
- }, { inject: ['sessions'] });
60
- /**
61
- * Register this package's invariant companion.
62
- * @param ctx - Cordis context carrying the invariant service.
63
- * @returns the installed registration's disposer after setup succeeds.
64
- */
65
- export const apply = (ctx) => Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install));
66
- //# sourceMappingURL=invariant.js.map