@deepseek-ai/dsh-session-turn-outline 0.1.2-alpha.3 → 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 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/session/session-turn-outline/README.md
5
- README.md: e02345d01ed4d31a3e20fd3e28d5b90d451618bb
6
- README.zh.md: d60e70e4b6f72da076f8fca6c9942815448f92e4
5
+ README.md: 55d99579368d8db1e8cd2c0a571b44739e6006c4
6
+ README.zh.md: 80e4436729b3f9943052e750ab441eeb404ddc4c
package/README.md CHANGED
@@ -71,6 +71,7 @@ The unit is a pure fold over committed session events. `turn/start` — not the
71
71
  | [`src/index.ts`](src/index.ts) | Plugin entry: `inject`, unit registration on the mounting fiber |
72
72
  | [`src/projection.ts`](src/projection.ts) | The fold: entry append, preview fill, wire view |
73
73
  | [`src/types.ts`](src/types.ts) | One home of the `turnOutline` projection-key declaration and entry types |
74
+ | — | No runtime invariant companion is published: the package owns one pure projection fold, `session-projection` schema-validates its served values, and re-folding the same log would duplicate the implementation instead of comparing independently maintained observations; session and agent-loop own turn-boundary ordering. |
74
75
 
75
76
  ### Fold rules
76
77
 
package/README.zh.md CHANGED
@@ -71,6 +71,7 @@ wire 值是按 `turn` 严格递增的完整条目数组(整值规则):消
71
71
  | [`src/index.ts`](src/index.ts) | 插件入口:`inject`、在挂载 fiber 上注册单元 |
72
72
  | [`src/projection.ts`](src/projection.ts) | 折叠:条目追加、预览填充、wire 视图 |
73
73
  | [`src/types.ts`](src/types.ts) | `turnOutline` 投影键声明与条目类型的唯一归属 |
74
+ | — | 不发布运行时不变式伴生入口:本包仅拥有一个纯投影折叠,`session-projection` 会对其对外值执行 schema 校验;用同一实现重新折叠同一日志只会复制实现,无法比较独立维护的观测,而轮次边界顺序由 session 与 agent-loop 负责。 |
74
75
 
75
76
  ### 折叠规则
76
77
 
package/lib/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { z } from "zod";
2
+ import { SessionSeq } from "@deepseek-ai/dsh-session";
2
3
  //#region lib/types/projection.js
3
4
  /**
4
5
  * The `turnOutline` projection unit: a pure fold of `turn/start` boundaries,
@@ -48,7 +49,7 @@ function preview(content, limit) {
48
49
  }
49
50
  const turnOutlineEntriesSchema = z.array(z.object({
50
51
  turn: z.number().int().nonnegative(),
51
- seq: z.number().int().nonnegative(),
52
+ seq: z.number().int().nonnegative().transform(SessionSeq),
52
53
  prompt: z.string().max(PROMPT_PREVIEW_LIMIT),
53
54
  response: z.string().max(RESPONSE_PREVIEW_LIMIT)
54
55
  }).strict()).superRefine((turns, context) => {
@@ -19,7 +19,7 @@
19
19
  * @module @deepseek-ai/dsh-session-turn-outline/projection
20
20
  */
21
21
  import { z } from 'zod';
22
- import type { SessionEvent } from '@deepseek-ai/dsh-session';
22
+ import { type SessionEvent } from '@deepseek-ai/dsh-session';
23
23
  import type { TurnOutlineEntry, TurnOutlineState } from './types.ts';
24
24
  /** The `turnOutline` unit registered on `ctx.sessionProjections` (exported for the unit spec). */
25
25
  export declare const turnOutlineProjectionDefinition: {
@@ -19,6 +19,7 @@
19
19
  * @module @deepseek-ai/dsh-session-turn-outline/projection
20
20
  */
21
21
  import { z } from 'zod';
22
+ import { SessionSeq } from '@deepseek-ai/dsh-session';
22
23
  /** Prompt budget: one rail-card line (13px over ~276px), ASCII worst case included. */
23
24
  const PROMPT_PREVIEW_LIMIT = 50;
24
25
  /** Response budget: three rail-card lines (12px over ~276px). */
@@ -52,7 +53,7 @@ function preview(content, limit) {
52
53
  }
53
54
  const turnOutlineEntriesSchema = z.array(z.object({
54
55
  turn: z.number().int().nonnegative(),
55
- seq: z.number().int().nonnegative(),
56
+ seq: z.number().int().nonnegative().transform(SessionSeq),
56
57
  prompt: z.string().max(PROMPT_PREVIEW_LIMIT),
57
58
  response: z.string().max(RESPONSE_PREVIEW_LIMIT),
58
59
  }).strict()).superRefine((turns, context) => {
@@ -6,13 +6,14 @@
6
6
  *
7
7
  * @module @deepseek-ai/dsh-session-turn-outline/types
8
8
  */
9
+ import type { SessionSeq } from '@deepseek-ai/dsh-session/types';
9
10
  export {};
10
11
  /** One started turn's outline facts, independent of what a client has paged in. */
11
12
  export interface TurnOutlineEntry {
12
13
  /** Host-assigned turn number (the `turn/start` payload). */
13
14
  readonly turn: number;
14
15
  /** The turn's `turn/start` event seq — paging a window back through this seq loads the whole turn. */
15
- readonly seq: number;
16
+ readonly seq: SessionSeq;
16
17
  /** Bounded first-human-prompt preview (one rail-card line); `''` until an eligible prompt lands. */
17
18
  readonly prompt: string;
18
19
  /** Bounded final-response preview (up to three rail-card lines); `''` until the turn ends with assistant text. */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-session-turn-outline",
3
3
  "description": "Whole-log turn outline projection (turnOutline) for the DeepSeek Harness",
4
- "version": "0.1.2-alpha.3",
4
+ "version": "0.1.2-alpha.4",
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"
@@ -35,28 +31,25 @@
35
31
  },
36
32
  "files": [
37
33
  "lib/index.js",
38
- "lib/invariant.js",
39
34
  "lib/types/**/*.js",
40
35
  "lib/types/**/*.d.ts"
41
36
  ],
42
37
  "license": "MIT",
43
38
  "peerDependencies": {
44
39
  "@deepseek-ai/cordis": "^4.0.2",
45
- "@deepseek-ai/dsh-invariants": "^0.1.2-alpha.3",
46
- "@deepseek-ai/dsh-session-projection": "^0.1.2-alpha.3",
47
- "@deepseek-ai/dsh-session": "^0.1.2-alpha.3",
48
- "@deepseek-ai/dsh-llm": "^0.1.2-alpha.3"
40
+ "@deepseek-ai/dsh-llm": "^0.1.2-alpha.4",
41
+ "@deepseek-ai/dsh-session": "^0.1.2-alpha.4",
42
+ "@deepseek-ai/dsh-session-projection": "^0.1.2-alpha.4"
49
43
  },
50
44
  "dependencies": {
51
45
  "zod": "^4.4.3"
52
46
  },
53
47
  "devDependencies": {
54
- "@deepseek-ai/cordis": "^4.0.2",
55
48
  "@deepseek-ai/cordis-plugin-include": "^1.0.7",
56
- "@deepseek-ai/dsh-llm": "^0.1.2-alpha.3",
57
- "@deepseek-ai/dsh-session": "^0.1.2-alpha.3",
58
- "@deepseek-ai/dsh-session-projection": "^0.1.2-alpha.3",
49
+ "@deepseek-ai/cordis": "^4.0.2",
59
50
  "@deepseek-ai/cordis-plugin-loader": "^1.0.3",
60
- "@deepseek-ai/dsh-invariants": "^0.1.2-alpha.3"
51
+ "@deepseek-ai/dsh-session": "^0.1.2-alpha.4",
52
+ "@deepseek-ai/dsh-llm": "^0.1.2-alpha.4",
53
+ "@deepseek-ai/dsh-session-projection": "^0.1.2-alpha.4"
61
54
  }
62
55
  }
package/lib/invariant.js DELETED
@@ -1,28 +0,0 @@
1
- //#region lib/types/invariant.js
2
- /**
3
- * Package-owned invariant companion for `@deepseek-ai/dsh-session-turn-outline`.
4
- * @module @deepseek-ai/dsh-session-turn-outline/invariant
5
- */
6
- const PACKAGE_NAME = "@deepseek-ai/dsh-session-turn-outline";
7
- /** Cordis companion plugin name. */
8
- const name = "session-turn-outline-invariant";
9
- /** Service required before the companion can reserve package ownership. */
10
- const inject = ["invariants"];
11
- /**
12
- * No runtime invariant: the package owns a single pure projection fold whose
13
- * wire payload is schema-validated by the projection registry at every
14
- * snapshot and change-feed emission (including the strictly-increasing turn
15
- * order the fold maintains), and the event relations the fold relies on
16
- * (host-assigned monotonic turn numbers on `turn/start`, the turn's prompt
17
- * `user/message` logged after its boundary) are owned and runtime-checked by
18
- * dsh-agent-loop and the session surface, not here.
19
- */
20
- const install = () => {};
21
- /**
22
- * Register this package's invariant companion.
23
- * @param ctx - Cordis context carrying the invariant service.
24
- * @returns the installed registration's disposer after setup succeeds.
25
- */
26
- const apply = (ctx) => Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install));
27
- //#endregion
28
- export { apply, inject, name };
@@ -1,16 +0,0 @@
1
- /**
2
- * Package-owned invariant companion for `@deepseek-ai/dsh-session-turn-outline`.
3
- * @module @deepseek-ai/dsh-session-turn-outline/invariant
4
- */
5
- import type { Context } from '@deepseek-ai/cordis';
6
- /** Cordis companion plugin name. */
7
- export declare const name = "session-turn-outline-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
@@ -1,27 +0,0 @@
1
- /**
2
- * Package-owned invariant companion for `@deepseek-ai/dsh-session-turn-outline`.
3
- * @module @deepseek-ai/dsh-session-turn-outline/invariant
4
- */
5
- const PACKAGE_NAME = '@deepseek-ai/dsh-session-turn-outline';
6
- /** Cordis companion plugin name. */
7
- export const name = 'session-turn-outline-invariant';
8
- /** Service required before the companion can reserve package ownership. */
9
- export const inject = ['invariants'];
10
- /**
11
- * No runtime invariant: the package owns a single pure projection fold whose
12
- * wire payload is schema-validated by the projection registry at every
13
- * snapshot and change-feed emission (including the strictly-increasing turn
14
- * order the fold maintains), and the event relations the fold relies on
15
- * (host-assigned monotonic turn numbers on `turn/start`, the turn's prompt
16
- * `user/message` logged after its boundary) are owned and runtime-checked by
17
- * dsh-agent-loop and the session surface, not here.
18
- */
19
- const install = () => { };
20
- /**
21
- * Register this package's invariant companion.
22
- * @param ctx - Cordis context carrying the invariant service.
23
- * @returns the installed registration's disposer after setup succeeds.
24
- */
25
- export const apply = (ctx) => Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install));
26
- /* jscpd:ignore-end */
27
- //# sourceMappingURL=invariant.js.map