@deepseek-ai/dsh-session-reference 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/README.i18n.yaml CHANGED
@@ -36,14 +36,14 @@
36
36
  en: 5c7712ca91eaae1c
37
37
  zh: 2d923b605afa7a88
38
38
  /deepseek-ai-dsh-session-reference/understand-the-implementation/source-map:
39
- en: 3a91f258bdfbe488
40
- zh: 80301b5d6b218389
39
+ en: 7c7b413082507150
40
+ zh: 0229eb73d441b305
41
41
  /deepseek-ai-dsh-session-reference/understand-the-implementation/main-flow:
42
42
  en: 019e5e19f9b3d7fd
43
43
  zh: 52ccf291f53d41fc
44
44
  /deepseek-ai-dsh-session-reference/further-exploration:
45
- en: ea488621aa03e4fd
46
- zh: 205ba9e3197d7b30
45
+ en: 2b0244f6ac3626d2
46
+ zh: 88ef45b405a8b8a2
47
47
  /deepseek-ai-dsh-session-reference/model-experience:
48
48
  en: 215e7ba838619b7b
49
49
  zh: a311da3843709f90
package/README.md CHANGED
@@ -83,7 +83,6 @@ The budget uses the provider and model captured after `system-prompt/assemble` c
83
83
  | [`src/serialization.ts`](src/serialization.ts) | Tag-safe JSON escaping for snapshot payloads |
84
84
  | [`src/spill.ts`](src/spill.ts) | Full transcript serialization and model-visible omission notices |
85
85
  | [`src/types.ts`](src/types.ts) | `SessionReferenceInput`/`Candidate` and source types |
86
- | — | No runtime invariant companion is published; preparation returns immutable per-call snapshots validated while they are built, and the agent/session layers own durable context admission, freezing, and replay. |
87
86
 
88
87
  ### Main flow
89
88
 
@@ -99,7 +98,7 @@ The outer `agent/pre-step` listener accepts the step, parses canonical mentions
99
98
  Read these pages when the package-level contract is not enough. They move from the shared reference surface to the design decision and the read service behind it.
100
99
 
101
100
  - [Session-reference subsystem](../../../docs/subsystems/session-reference.md) — canonical URIs, projection rules, and the stable error taxonomy.
102
- - [Session-reference spill reuse](../../../.agents/notes/implemented/bug-fix/2026-09-05-session-reference-spill-reuse.md) — snapshot identity, omission notices, storage ownership, and alternatives.
101
+ - [historical Session-reference spill reuse](../../../.agents/notes/archived/bug-fix/2026-09-05-session-reference-spill-reuse.md) — snapshot identity, omission notices, storage ownership, and alternatives.
103
102
  - [Session-query subsystem](../../../docs/subsystems/session-query.md) — the read service that supplies session surfaces.
104
103
  - [Context group map](../README.md) — sibling request-context packages.
105
104
  - [Generated configuration catalog](../../../docs/config-catalog.md#deepseek-aidsh-session-reference) — every accepted config field and its source declaration.
package/README.zh.md CHANGED
@@ -83,7 +83,6 @@ kind: "package-reference"
83
83
  | [`src/serialization.ts`](src/serialization.ts) | 快照载荷的标签安全 JSON 转义 |
84
84
  | [`src/spill.ts`](src/spill.ts) | 完整 transcript 序列化与模型可见省略通知 |
85
85
  | [`src/types.ts`](src/types.ts) | `SessionReferenceInput`/`Candidate` 与来源类型 |
86
- | — | 不发布运行时不变式伴生入口;准备过程返回构建时已校验的不可变单次快照;持久上下文的准入、冻结与回放由 agent 层和会话层负责。 |
87
86
 
88
87
  ### 主要流程
89
88
 
@@ -99,7 +98,7 @@ kind: "package-reference"
99
98
  包级约定不够用时阅读以下页面。它们从共享引用表面进入设计决策与其背后的读取服务。
100
99
 
101
100
  - [会话引用子系统](../../../docs/subsystems/session-reference.zh.md)——规范 URI、投影规则与稳定的错误分类体系。
102
- - [会话引用 spill 复用](../../../.agents/notes/implemented/bug-fix/2026-09-05-session-reference-spill-reuse.zh.md)——快照身份、省略通知、存储归属与替代方案。
101
+ - [历史会话引用 spill 复用](../../../.agents/notes/archived/bug-fix/2026-09-05-session-reference-spill-reuse.md)——快照身份、省略通知、存储归属与替代方案。
103
102
  - [会话查询子系统](../../../docs/subsystems/session-query.zh.md)——提供会话表层的读取服务。
104
103
  - [上下文组地图](../README.zh.md)——相邻的请求上下文包。
105
104
  - [生成的配置目录](../../../docs/config-catalog.zh.md#deepseek-aidsh-session-reference)——每个受支持配置字段及其源声明。
@@ -350,6 +350,14 @@ export const TYPERT = {
350
350
  "name": "LlmFailure",
351
351
  "declaration": "export interface LlmFailure {\n readonly message: string;\n readonly code: string;\n readonly status?: number;\n readonly providerRetryAfterMs?: number;\n readonly requestId?: ProviderRequestId;\n readonly offloadImages?: number;\n}"
352
352
  },
353
+ {
354
+ "name": "LlmRetryEventData",
355
+ "declaration": "export type LlmRetryEventData = { retryId: RetryId; turn: number; step: number; provider: string; mode: 'normal'; policyKey: string; retry: number; maxRetries: number; delayMs: number; failure: LlmFailure; } | { retryId: RetryId; turn: number; step: number; provider: string; mode: 'always'; policyKey: string; retry: number; delayMs: number; failure: LlmFailure; };"
356
+ },
357
+ {
358
+ "name": "LlmRetryStartedEventData",
359
+ "declaration": "export interface LlmRetryStartedEventData {\n retryId: RetryId;\n turn: number;\n step: number;\n retry: number;\n}"
360
+ },
353
361
  {
354
362
  "name": "Message",
355
363
  "declaration": "export type Message = MessageRoleMap[keyof MessageRoleMap];"
@@ -392,7 +400,7 @@ export const TYPERT = {
392
400
  },
393
401
  {
394
402
  "name": "MessageSourceMap",
395
- "declaration": "export interface MessageSourceMap {\n user: { kind: 'user'; };\n model: ModelMessageSource;\n tool: ToolMessageSource;\n 'system-prompt': SystemPromptMessageSource;\n 'model-selection': { kind: 'model-selection'; } & ContextFormed;\n 'user-approval': { kind: 'user-approval'; } & ContextFormed;\n 'ptc-mode': { kind: 'ptc-mode'; };\n 'tool-registry': { kind: 'tool-registry'; };\n 'user-rpc': { kind: 'user'; rpcId: SessionRequestId; clientTimeZone?: string; };\n 'agent-message': AgentMessageSource;\n 'subagent-settled': SubagentSettledMessageSource;\n 'skill-invocation': SkillInvocationSource;\n 'cordis-host-runner': { kind: 'cordis-host-runner'; };\n goal: GoalMessageSource;\n schedule: { kind: 'schedule'; } & ContextFormed;\n 'compact-checkpoint': CompactionCheckpointSource;\n 'session-reference': SessionReferenceSource;\n 'user-question-reply': { kind: 'user-question-reply'; callId: ToolCallId; outcome: 'answered'; };\n}"
403
+ "declaration": "export interface MessageSourceMap {\n user: { kind: 'user'; };\n model: ModelMessageSource;\n tool: ToolMessageSource;\n 'system-prompt': SystemPromptMessageSource;\n 'model-selection': { kind: 'model-selection'; } & ContextFormed;\n 'user-approval': { kind: 'user-approval'; } & ContextFormed;\n 'ptc-mode': { kind: 'ptc-mode'; };\n 'tool-registry': { kind: 'tool-registry'; };\n 'user-rpc': { kind: 'user'; rpcId: SessionRequestId; clientTimeZone?: string; };\n 'agent-message': AgentMessageSource;\n 'subagent-settled': SubagentSettledMessageSource;\n 'skill-invocation': SkillInvocationSource;\n 'cordis-host-runner': { kind: 'cordis-host-runner'; };\n 'compact-checkpoint': CompactionCheckpointSource;\n 'user-question-reply': { kind: 'user-question-reply'; callId: ToolCallId; outcome: 'answered'; };\n goal: GoalMessageSource;\n schedule: { kind: 'schedule'; } & ContextFormed;\n 'session-reference': SessionReferenceSource;\n}"
396
404
  },
397
405
  {
398
406
  "name": "ModelMessageSource",
@@ -450,6 +458,10 @@ export const TYPERT = {
450
458
  "name": "RequestHeaderReason",
451
459
  "declaration": "export type RequestHeaderReason = 'initial' | 'resume' | 'change' | 'series';"
452
460
  },
461
+ {
462
+ "name": "RetryId",
463
+ "declaration": "export type RetryId = Branded<'RetryId'>;"
464
+ },
453
465
  {
454
466
  "name": "SandboxMode",
455
467
  "declaration": "export type SandboxMode = 'read-only' | 'workspace-write' | 'danger-full-access';"
@@ -484,7 +496,7 @@ export const TYPERT = {
484
496
  },
485
497
  {
486
498
  "name": "SessionEventMap",
487
- "declaration": "export interface SessionEventMap {\n 'turn/start': { turn: number; };\n 'turn/end': { turn: number; reason: TurnEndReason; };\n 'step/start': { turn: number; step: number; };\n 'step/end': { turn: number; step: number; };\n 'user/message': UserMessage;\n 'developer/message': { turn: number; step: number; message: DeveloperMessage; headerSeq?: SessionSeq; };\n 'system/message': { turn: number; step: number; message: SystemMessage; };\n 'assistant/message': { turn: number; step: number; message: AssistantMessage; stream: AssistantStreamRecord[]; usage?: TokenUsage; interrupted?: true; };\n 'assistant/attempt': { turn: number; step: number; stream: AssistantStreamRecord[]; };\n 'tool/call': { turn: number; step: number; callId: ToolCallId; name: string; arguments: string; };\n 'tool/result': { turn: number; step: number; message: ToolResultMessage; error?: { name: string; code: string; reason?: string; }; meta?: JsonValue; };\n 'request/header': { header: EpochHeader; reason: RequestHeaderReason; startsSeries?: true; };\n 'request/context': RequestContext;\n 'session/end-seed': { inherited?: true; };\n 'agent/inbox/spliced': { target: InboxTarget; start: number; removedCount?: number; inserted: UserMessage[]; outcome?: 'canceled'; };\n 'sandbox/mode': { mode: SandboxMode; source?: 'delegation'; };\n 'approval/asked': { id: ApprovalRequestId; toolName: string; callId?: ToolCallId; reason?: string; };\n 'approval/decided': { id: ApprovalRequestId; outcome: ApprovalOutcome; };\n 'approval/policy': { policy: ApprovalPolicy; source?: 'delegation'; };\n 'tool/ptc-dispatch-start': PtcDispatchStartEventData;\n 'tool/ptc-dispatch': PtcDispatchEventData;\n 'agent-preset/selected': { agentPreset: string; };\n 'command/run': { commandId: CommandId; name: string; args?: string; source: CommandSource; };\n 'command/done': { commandId: CommandId; kind: 'success' | 'error'; text?: string; sourceEventSeq?: import('@deepseek-ai/dsh-session/types').SessionSeq; };\n 'image/offload': { targets: ImageOffloadTarget[]; };\n 'session/title': SessionTitleEventData;\n 'todo/write': { todos: TodoItem[]; };\n 'model/selection': ModelSelection;\n 'subagent/descriptor': SubagentDescriptorData;\n 'permission/preset': { preset: string; };\n 'subagent/catalog': SubagentCatalogEvent;\n 'compaction/start': { compactionId: CompactionId; sourceCommandId?: CommandId; turn: number | null; };\n 'compaction/summary': { compactionId: CompactionId; sourceCommandId?: CommandId; summary: ContentBlock[]; shadowedRange: { start: SessionSeq; end: SessionSeq; }; shadowedSeqs: SessionSeq[]; shadowedTokenCount: number; provider: string; model: string; maxTokens?: number; usage?: TokenUsage; } & ({ rawOutput: ContentBlock[]; llmStreamCall: true; } | { rawOutput?: ContentBlock[]; llmStreamCall?: never; });\n 'compaction/end': { compactionId: CompactionId; sourceCommandId?: CommandId; turn: number | null; error?: string; };\n 'compaction/prune': { shadowedRange: { start: SessionSeq; end: SessionSeq; }; shadowedSeqs: SessionSeq[]; shadowedTokenCount: number; };\n 'feedback/record': FeedbackRecord;\n 'goal/change': GoalChangeMeta;\n 'feedback/message-put': MessageFeedbackPut;\n 'feedback/message-delete': MessageFeedbackDelete;\n 'schedule/change': ScheduleChange;\n}"
499
+ "declaration": "export interface SessionEventMap {\n 'turn/start': { turn: number; };\n 'turn/end': { turn: number; reason: TurnEndReason; };\n 'step/start': { turn: number; step: number; };\n 'step/end': { turn: number; step: number; };\n 'user/message': UserMessage;\n 'developer/message': { turn: number; step: number; message: DeveloperMessage; headerSeq?: SessionSeq; };\n 'system/message': { turn: number; step: number; message: SystemMessage; };\n 'assistant/message': { turn: number; step: number; message: AssistantMessage; stream: AssistantStreamRecord[]; usage?: TokenUsage; interrupted?: true; };\n 'assistant/attempt': { turn: number; step: number; stream: AssistantStreamRecord[]; };\n 'tool/call': { turn: number; step: number; callId: ToolCallId; name: string; arguments: string; };\n 'tool/result': { turn: number; step: number; message: ToolResultMessage; error?: { name: string; code: string; reason?: string; }; meta?: JsonValue; };\n 'request/header': { header: EpochHeader; reason: RequestHeaderReason; startsSeries?: true; };\n 'request/context': RequestContext;\n 'session/end-seed': { inherited?: true; };\n 'agent/inbox/spliced': { target: InboxTarget; start: number; removedCount?: number; inserted: UserMessage[]; outcome?: 'canceled'; };\n 'sandbox/mode': { mode: SandboxMode; source?: 'delegation'; };\n 'approval/asked': { id: ApprovalRequestId; toolName: string; callId?: ToolCallId; reason?: string; };\n 'approval/decided': { id: ApprovalRequestId; outcome: ApprovalOutcome; };\n 'approval/policy': { policy: ApprovalPolicy; source?: 'delegation'; };\n 'tool/ptc-dispatch-start': PtcDispatchStartEventData;\n 'tool/ptc-dispatch': PtcDispatchEventData;\n 'agent-preset/selected': { agentPreset: string; };\n 'command/run': { commandId: CommandId; name: string; args?: string; source: CommandSource; };\n 'command/done': { commandId: CommandId; kind: 'success' | 'error'; text?: string; sourceEventSeq?: import('@deepseek-ai/dsh-session/types').SessionSeq; };\n 'image/offload': { targets: ImageOffloadTarget[]; };\n 'session/title': SessionTitleEventData;\n 'todo/write': { todos: TodoItem[]; };\n 'model/selection': ModelSelection;\n 'subagent/descriptor': SubagentDescriptorData;\n 'permission/preset': { preset: string; };\n 'subagent/catalog': SubagentCatalogEvent;\n 'compaction/start': { compactionId: CompactionId; sourceCommandId?: CommandId; turn: number | null; };\n 'compaction/summary': { compactionId: CompactionId; sourceCommandId?: CommandId; summary: ContentBlock[]; shadowedRange: { start: SessionSeq; end: SessionSeq; }; shadowedSeqs: SessionSeq[]; shadowedTokenCount: number; provider: string; model: string; maxTokens?: number; usage?: TokenUsage; } & ({ rawOutput: ContentBlock[]; llmStreamCall: true; } | { rawOutput?: ContentBlock[]; llmStreamCall?: never; });\n 'compaction/end': { compactionId: CompactionId; sourceCommandId?: CommandId; turn: number | null; error?: string; };\n 'compaction/prune': { shadowedRange: { start: SessionSeq; end: SessionSeq; }; shadowedSeqs: SessionSeq[]; shadowedTokenCount: number; };\n 'feedback/record': FeedbackRecord;\n 'llm/retry': LlmRetryEventData;\n 'llm/retry-started': LlmRetryStartedEventData;\n 'goal/change': GoalChangeMeta;\n 'feedback/message-put': MessageFeedbackPut;\n 'feedback/message-delete': MessageFeedbackDelete;\n 'schedule/change': ScheduleChange;\n}"
488
500
  },
489
501
  {
490
502
  "name": "SessionEventType",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-session-reference",
3
3
  "description": "Cross-session snapshot references and durable untrusted model context (ctx.sessionReferenceResolver)",
4
- "version": "0.2.0-rc.2",
4
+ "version": "0.2.1-alpha.1",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -45,25 +45,25 @@
45
45
  "license": "MIT",
46
46
  "dependencies": {
47
47
  "zod": "^4.4.3",
48
- "@deepseek-ai/dsh-brand": "0.2.0-rc.2",
49
- "@deepseek-ai/dsh-util-values": "0.2.0-rc.2",
50
- "@deepseek-ai/schemastery": "~3.18.4"
48
+ "@deepseek-ai/dsh-brand": "0.2.1-alpha.1",
49
+ "@deepseek-ai/dsh-util-values": "0.2.1-alpha.1",
50
+ "@deepseek-ai/schemastery": "~3.18.5-alpha.1"
51
51
  },
52
52
  "peerDependencies": {
53
- "@deepseek-ai/dsh-agent": "0.2.0-rc.2",
54
- "@deepseek-ai/dsh-compaction": "0.2.0-rc.2",
55
- "@deepseek-ai/cordis": "~4.0.4",
56
- "@deepseek-ai/dsh-llm": "0.2.0-rc.2",
57
- "@deepseek-ai/dsh-output-retention": "0.2.0-rc.2",
58
- "@deepseek-ai/dsh-session": "0.2.0-rc.2",
59
- "@deepseek-ai/dsh-session-projection": "0.2.0-rc.2",
60
- "@deepseek-ai/dsh-session-projection-cache": "0.2.0-rc.2",
61
- "@deepseek-ai/dsh-session-query": "0.2.0-rc.2",
62
- "@deepseek-ai/dsh-session-title": "0.2.0-rc.2",
63
- "@deepseek-ai/dsh-spill": "0.2.0-rc.2",
64
- "@deepseek-ai/dsh-subagent": "0.2.0-rc.2",
65
- "@deepseek-ai/dsh-system-prompt": "0.2.0-rc.2",
66
- "@deepseek-ai/dsh-typert-protocol": "0.2.0-rc.2"
53
+ "@deepseek-ai/cordis": "~4.0.5-alpha.1",
54
+ "@deepseek-ai/dsh-agent": "0.2.1-alpha.1",
55
+ "@deepseek-ai/dsh-compaction": "0.2.1-alpha.1",
56
+ "@deepseek-ai/dsh-llm": "0.2.1-alpha.1",
57
+ "@deepseek-ai/dsh-output-retention": "0.2.1-alpha.1",
58
+ "@deepseek-ai/dsh-session": "0.2.1-alpha.1",
59
+ "@deepseek-ai/dsh-session-projection": "0.2.1-alpha.1",
60
+ "@deepseek-ai/dsh-session-projection-cache": "0.2.1-alpha.1",
61
+ "@deepseek-ai/dsh-session-query": "0.2.1-alpha.1",
62
+ "@deepseek-ai/dsh-session-title": "0.2.1-alpha.1",
63
+ "@deepseek-ai/dsh-spill": "0.2.1-alpha.1",
64
+ "@deepseek-ai/dsh-subagent": "0.2.1-alpha.1",
65
+ "@deepseek-ai/dsh-system-prompt": "0.2.1-alpha.1",
66
+ "@deepseek-ai/dsh-typert-protocol": "0.2.1-alpha.1"
67
67
  },
68
68
  "peerDependenciesMeta": {
69
69
  "@deepseek-ai/dsh-spill": {
@@ -74,26 +74,26 @@
74
74
  }
75
75
  },
76
76
  "devDependencies": {
77
- "@deepseek-ai/cordis": "~4.0.4",
78
- "@deepseek-ai/cordis-plugin-include": "~1.0.9",
79
- "@deepseek-ai/cordis-plugin-loader": "~1.0.5",
80
- "@deepseek-ai/dsh-compaction": "0.2.0-rc.2",
81
- "@deepseek-ai/dsh-agent": "0.2.0-rc.2",
82
- "@deepseek-ai/dsh-llm": "0.2.0-rc.2",
83
- "@deepseek-ai/dsh-fs-local": "0.2.0-rc.2",
84
- "@deepseek-ai/dsh-session": "0.2.0-rc.2",
85
- "@deepseek-ai/dsh-session-projection": "0.2.0-rc.2",
86
- "@deepseek-ai/dsh-session-projection-cache": "0.2.0-rc.2",
87
- "@deepseek-ai/dsh-session-query": "0.2.0-rc.2",
88
- "@deepseek-ai/dsh-session-query-sqlite": "0.2.0-rc.2",
89
- "@deepseek-ai/dsh-session-title": "0.2.0-rc.2",
90
- "@deepseek-ai/dsh-spill": "0.2.0-rc.2",
91
- "@deepseek-ai/dsh-subagent": "0.2.0-rc.2",
92
- "@deepseek-ai/dsh-output-retention": "0.2.0-rc.2",
93
- "@deepseek-ai/dsh-spill-local": "0.2.0-rc.2",
94
- "@deepseek-ai/dsh-system-prompt": "0.2.0-rc.2",
95
- "@deepseek-ai/dsh-tool-fs": "0.2.0-rc.2",
96
- "@deepseek-ai/dsh-tools": "0.2.0-rc.2",
97
- "@deepseek-ai/dsh-typert-protocol": "0.2.0-rc.2"
77
+ "@deepseek-ai/cordis": "~4.0.5-alpha.1",
78
+ "@deepseek-ai/cordis-plugin-include": "~1.0.10-alpha.1",
79
+ "@deepseek-ai/cordis-plugin-loader": "~1.0.6-alpha.1",
80
+ "@deepseek-ai/dsh-agent": "0.2.1-alpha.1",
81
+ "@deepseek-ai/dsh-compaction": "0.2.1-alpha.1",
82
+ "@deepseek-ai/dsh-fs-local": "0.2.1-alpha.1",
83
+ "@deepseek-ai/dsh-llm": "0.2.1-alpha.1",
84
+ "@deepseek-ai/dsh-session-projection": "0.2.1-alpha.1",
85
+ "@deepseek-ai/dsh-output-retention": "0.2.1-alpha.1",
86
+ "@deepseek-ai/dsh-session-projection-cache": "0.2.1-alpha.1",
87
+ "@deepseek-ai/dsh-session-query": "0.2.1-alpha.1",
88
+ "@deepseek-ai/dsh-session-query-sqlite": "0.2.1-alpha.1",
89
+ "@deepseek-ai/dsh-session-title": "0.2.1-alpha.1",
90
+ "@deepseek-ai/dsh-spill": "0.2.1-alpha.1",
91
+ "@deepseek-ai/dsh-subagent": "0.2.1-alpha.1",
92
+ "@deepseek-ai/dsh-spill-local": "0.2.1-alpha.1",
93
+ "@deepseek-ai/dsh-system-prompt": "0.2.1-alpha.1",
94
+ "@deepseek-ai/dsh-session": "0.2.1-alpha.1",
95
+ "@deepseek-ai/dsh-tool-fs": "0.2.1-alpha.1",
96
+ "@deepseek-ai/dsh-tools": "0.2.1-alpha.1",
97
+ "@deepseek-ai/dsh-typert-protocol": "0.2.1-alpha.1"
98
98
  }
99
99
  }