dsh-plugin-dev-kb 1.0.7 → 1.0.9

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.
Files changed (169) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.en.md +144 -0
  3. package/README.md +21 -7
  4. package/kb/INDEX.md +19 -5
  5. package/kb/README.md +11 -10
  6. package/kb/extra/AGENTS.md +4 -4
  7. package/kb/extra/cookbook/adding-a-vendored-package.md +2 -2
  8. package/kb/extra/cookbook/adding-a-vendored-package.zh.md +2 -2
  9. package/kb/extra/deepseek-llm-api-wire-extensions.md +159 -0
  10. package/kb/extra/deepseek-llm-api-wire-extensions.zh.md +159 -0
  11. package/kb/extra/development.md +8 -14
  12. package/kb/extra/development.zh.md +8 -14
  13. package/kb/extra/event-producer-consumer.md +47 -41
  14. package/kb/extra/event-producer-consumer.zh.md +47 -41
  15. package/kb/extra/glossary.md +1 -1
  16. package/kb/extra/glossary.zh.md +1 -1
  17. package/kb/extra/graph-atlas.md +0 -2
  18. package/kb/extra/graph-atlas.zh.md +0 -2
  19. package/kb/extra/i18n/README.md +4 -4
  20. package/kb/extra/i18n/README.zh.md +4 -4
  21. package/kb/extra/module-graph.md +680 -413
  22. package/kb/extra/module-graph.zh.md +681 -414
  23. package/kb/extra/postmortem/0001-acp-default-export-drops-inject.md +2 -2
  24. package/kb/extra/postmortem/0001-acp-default-export-drops-inject.zh.md +2 -2
  25. package/kb/extra/postmortem/0002-js-expression-disabled-filesystem-tools.md +2 -2
  26. package/kb/extra/postmortem/0002-js-expression-disabled-filesystem-tools.zh.md +2 -2
  27. package/kb/extra/postmortem/0003-web-agent-gui-feedback-loop.md +2 -2
  28. package/kb/extra/postmortem/0003-web-agent-gui-feedback-loop.zh.md +2 -2
  29. package/kb/extra/postmortem/0004-landlock-partial-notice-misclassified-child-failures.md +1 -1
  30. package/kb/extra/postmortem/0004-landlock-partial-notice-misclassified-child-failures.zh.md +1 -1
  31. package/kb/extra/rescope.md +2 -2
  32. package/kb/extra/rescope.zh.md +2 -2
  33. package/kb/extra/subsystems/agent-team.md +24 -1
  34. package/kb/extra/subsystems/agent-team.zh.md +24 -1
  35. package/kb/extra/subsystems/attachment.md +12 -4
  36. package/kb/extra/subsystems/attachment.zh.md +12 -4
  37. package/kb/extra/subsystems/extensions.md +18 -0
  38. package/kb/extra/subsystems/extensions.zh.md +18 -0
  39. package/kb/extra/subsystems/feedback.md +2 -2
  40. package/kb/extra/subsystems/feedback.zh.md +2 -2
  41. package/kb/extra/subsystems/todo.md +32 -0
  42. package/kb/extra/subsystems/todo.zh.md +32 -0
  43. package/kb/extra/subsystems/webhook.md +70 -0
  44. package/kb/extra/subsystems/webhook.zh.md +70 -0
  45. package/kb/extra/testing.md +11 -10
  46. package/kb/extra/testing.zh.md +8 -7
  47. package/kb/meta/search-index.json +269 -161
  48. package/kb/meta/site-pages.txt +182 -168
  49. package/kb/meta/source.json +5 -5
  50. package/kb/meta/topics.md +14 -6
  51. package/kb/site/develop/basic/publish.md +2 -2
  52. package/kb/site/develop/basic/tool.md +1 -1
  53. package/kb/site/develop/cordis-tutorial/07-into-the-harness.md +4 -4
  54. package/kb/site/develop/framework/events.md +1 -1
  55. package/kb/site/develop/practice/dynamic-cordis.md +17 -0
  56. package/kb/site/develop/practice/llm-adapter.md +3 -3
  57. package/kb/site/en/develop/basic/publish.md +2 -2
  58. package/kb/site/en/develop/basic/tool.md +1 -1
  59. package/kb/site/en/develop/cordis-tutorial/07-into-the-harness.md +4 -4
  60. package/kb/site/en/develop/framework/events.md +1 -1
  61. package/kb/site/en/develop/practice/dynamic-cordis.md +17 -0
  62. package/kb/site/en/develop/practice/llm-adapter.md +3 -3
  63. package/kb/site/en/guide/github-review.md +104 -0
  64. package/kb/site/en/guide/mcp-memory.md +103 -0
  65. package/kb/site/en/guide/python-sdk.md +80 -34
  66. package/kb/site/en/guide/schedule.md +21 -0
  67. package/kb/site/en/reference/agent-lifecycle.md +1 -1
  68. package/kb/{extra → site/en/reference}/api-gateway.md +11 -9
  69. package/kb/site/en/reference/capability-seams.md +115 -67
  70. package/kb/site/en/reference/config-catalog.md +358 -164
  71. package/kb/site/en/reference/cookbook/adding-a-package.md +2 -2
  72. package/kb/site/en/reference/cookbook/adding-a-settings-card.md +2 -2
  73. package/kb/site/en/reference/cookbook/adding-a-tool.md +11 -4
  74. package/kb/site/en/reference/cookbook/adding-an-llm-adapter.md +1 -1
  75. package/kb/site/en/reference/cookbook/extension-cookbook.md +6 -6
  76. package/kb/site/en/reference/cordis-api/inherited.md +1 -1
  77. package/kb/site/en/reference/cordis-primer.md +2 -1
  78. package/kb/site/en/reference/index.md +19 -7
  79. package/kb/site/en/reference/persistence-catalog.md +91 -44
  80. package/kb/site/en/reference/subsystems/approval.md +10 -10
  81. package/kb/site/en/reference/subsystems/client-modules.md +58 -16
  82. package/kb/site/en/reference/subsystems/code-runtime.md +3 -3
  83. package/kb/site/en/reference/subsystems/compaction.md +2 -2
  84. package/kb/site/en/reference/{cookbook/adding-a-conversation-node.md → subsystems/conversation.md} +43 -24
  85. package/kb/site/en/reference/subsystems/core.md +70 -12
  86. package/kb/site/en/reference/subsystems/credentials.md +43 -3
  87. package/kb/site/en/reference/subsystems/filesystem.md +12 -2
  88. package/kb/site/en/reference/subsystems/index.md +6 -1
  89. package/kb/site/en/reference/subsystems/jobs.md +1 -1
  90. package/kb/site/en/reference/subsystems/llm-streaming.md +132 -11
  91. package/kb/site/en/reference/subsystems/permission-presets.md +1 -1
  92. package/kb/site/en/reference/subsystems/persistence.md +22 -3
  93. package/kb/site/en/reference/subsystems/plan.md +1 -1
  94. package/kb/site/en/reference/subsystems/session-projection.md +74 -33
  95. package/kb/site/en/reference/subsystems/session-query.md +9 -1
  96. package/kb/site/en/reference/subsystems/session-reference.md +28 -7
  97. package/kb/site/en/reference/subsystems/session-telemetry.md +2 -3
  98. package/kb/site/en/reference/subsystems/session.md +260 -41
  99. package/kb/site/en/reference/subsystems/settings.md +78 -1
  100. package/kb/site/en/reference/subsystems/skills.md +23 -0
  101. package/kb/site/en/reference/subsystems/slots.md +177 -0
  102. package/kb/site/en/reference/subsystems/spill.md +2 -2
  103. package/kb/site/en/reference/subsystems/storage.md +9 -1
  104. package/kb/site/en/reference/subsystems/subagent.md +90 -23
  105. package/kb/site/en/reference/subsystems/system-prompt.md +4 -4
  106. package/kb/site/en/reference/subsystems/token-meter.md +25 -10
  107. package/kb/site/en/reference/subsystems/tools.md +39 -39
  108. package/kb/site/en/reference/subsystems/typert.md +44 -37
  109. package/kb/site/en/reference/subsystems/user-questions.md +33 -33
  110. package/kb/site/en/reference/subsystems/web-client.md +98 -0
  111. package/kb/site/en/reference/subsystems/web-server.md +11 -5
  112. package/kb/site/en/reference/subsystems/web.md +7 -1
  113. package/kb/site/en/reference/subsystems/workspace.md +95 -2
  114. package/kb/site/en/reference/tool-catalog.md +76 -18
  115. package/kb/site/en/reference/tool-execution-pipeline.md +1 -1
  116. package/kb/site/guide/github-review.md +104 -0
  117. package/kb/site/guide/mcp-memory.md +103 -0
  118. package/kb/site/guide/python-sdk.md +87 -41
  119. package/kb/site/guide/schedule.md +21 -0
  120. package/kb/site/reference/agent-lifecycle.md +1 -1
  121. package/kb/{extra/api-gateway.zh.md → site/reference/api-gateway.md} +11 -9
  122. package/kb/site/reference/capability-seams.md +115 -67
  123. package/kb/site/reference/config-catalog.md +357 -163
  124. package/kb/site/reference/cookbook/adding-a-package.md +2 -2
  125. package/kb/site/reference/cookbook/adding-a-settings-card.md +2 -2
  126. package/kb/site/reference/cookbook/adding-a-tool.md +11 -4
  127. package/kb/site/reference/cookbook/adding-an-llm-adapter.md +1 -1
  128. package/kb/site/reference/cookbook/extension-cookbook.md +6 -6
  129. package/kb/site/reference/cordis-api/inherited.md +1 -1
  130. package/kb/site/reference/cordis-primer.md +2 -1
  131. package/kb/site/reference/index.md +19 -7
  132. package/kb/site/reference/persistence-catalog.md +87 -40
  133. package/kb/site/reference/subsystems/approval.md +10 -10
  134. package/kb/site/reference/subsystems/client-modules.md +58 -16
  135. package/kb/site/reference/subsystems/code-runtime.md +3 -3
  136. package/kb/site/reference/subsystems/compaction.md +2 -2
  137. package/kb/site/reference/{cookbook/adding-a-conversation-node.md → subsystems/conversation.md} +43 -24
  138. package/kb/site/reference/subsystems/core.md +70 -12
  139. package/kb/site/reference/subsystems/credentials.md +43 -3
  140. package/kb/site/reference/subsystems/filesystem.md +12 -2
  141. package/kb/site/reference/subsystems/index.md +6 -1
  142. package/kb/site/reference/subsystems/jobs.md +1 -1
  143. package/kb/site/reference/subsystems/llm-streaming.md +132 -11
  144. package/kb/site/reference/subsystems/persistence.md +22 -3
  145. package/kb/site/reference/subsystems/plan.md +1 -1
  146. package/kb/site/reference/subsystems/session-projection.md +74 -33
  147. package/kb/site/reference/subsystems/session-query.md +9 -1
  148. package/kb/site/reference/subsystems/session-reference.md +28 -7
  149. package/kb/site/reference/subsystems/session-telemetry.md +2 -3
  150. package/kb/site/reference/subsystems/session.md +260 -41
  151. package/kb/site/reference/subsystems/settings.md +78 -1
  152. package/kb/site/reference/subsystems/skills.md +23 -0
  153. package/kb/site/reference/subsystems/slots.md +177 -0
  154. package/kb/site/reference/subsystems/spill.md +2 -2
  155. package/kb/site/reference/subsystems/storage.md +9 -1
  156. package/kb/site/reference/subsystems/subagent.md +90 -23
  157. package/kb/site/reference/subsystems/system-prompt.md +4 -4
  158. package/kb/site/reference/subsystems/token-meter.md +25 -10
  159. package/kb/site/reference/subsystems/tools.md +39 -39
  160. package/kb/site/reference/subsystems/typert.md +44 -37
  161. package/kb/site/reference/subsystems/user-questions.md +33 -33
  162. package/kb/site/reference/subsystems/web-client.md +98 -0
  163. package/kb/site/reference/subsystems/web-server.md +11 -5
  164. package/kb/site/reference/subsystems/web.md +7 -1
  165. package/kb/site/reference/subsystems/workspace.md +95 -2
  166. package/kb/site/reference/tool-catalog.md +76 -18
  167. package/kb/site/reference/tool-execution-pipeline.md +1 -1
  168. package/package.json +11 -3
  169. package/skills/dsh-plugin-dev-kb.md +8 -6
@@ -5,7 +5,7 @@ outline: [2,3]
5
5
 
6
6
  # 会话投影
7
7
 
8
- 会话投影 seam 是一项[能力 seam](../capability-seams.md):领域 host 插件经由它向客户端载体供给按会话的日志派生状态的当前全量值;三方分别是 Service Definition 与注册表([dsh-session-projection](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/session/session-projection),`ctx.sessionProjections`)、领域贡献方(每个领域注册一个纯单元)与载体([dsh-host-apiproxy](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/host/apiproxy) 的历史尾页与 `session/projection` 推送帧)。它是一项可选能力,不属于 agent loop(智能体循环)主干。框架负责驱动,领域负责计算:注册表只订阅一次 `session/event`,并把每个已提交事件折叠进每个单元;领域不持有任何订阅,客户端也从不折叠领域事件——它们收到的是成品值。设计权威:[session-projection RFC](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/proposed/architecture/2026-07-27-session-projection-and-command-log.zh.md);驱动、缓存与变更流约定:[包 README](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/session/session-projection/README.zh.md)。
8
+ 会话投影 seam 是一项[能力 seam](../capability-seams.md):领域 host 插件经由它向客户端载体供给按会话的日志派生状态的当前全量值;三方分别是 Service Definition 与注册表([dsh-session-projection](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/session/session-projection),`ctx.sessionProjections`)、领域贡献方(每个领域注册一个纯单元)与载体([dsh-session-controller](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/api/session-controller) 的历史尾页与 `session/projection` 推送帧)。它是一项可选能力,不属于 agent loop(智能体循环)主干。框架负责驱动,领域负责计算:注册表只订阅一次 `session/event`,并把每个已提交事件折叠进每个单元;领域不持有任何订阅,客户端也从不折叠领域事件——它们收到的是成品值。设计权威:[session-projection RFC](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/proposed/architecture/2026-07-27-session-projection-and-command-log.zh.md);驱动、缓存与变更流约定:[包 README](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/session/session-projection/README.zh.md)。
9
9
 
10
10
  源码:[`packages/session/session-projection/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/session/session-projection/src/index.ts)
11
11
 
@@ -31,10 +31,11 @@ interface ProjectionDefinition<
31
31
  /** Validates persisted state before it seeds a fold. */
32
32
  stateSchema: ZodType<S>
33
33
  /**
34
- * State for the empty log.
34
+ * State for the empty log and its immutable Session metadata.
35
+ * @param header - immutable metadata for the Session being projected.
35
36
  * @returns the initial state.
36
37
  */
37
- init(): NoInfer<S>
38
+ init(header: SessionHeader): NoInfer<S>
38
39
  /**
39
40
  * Pure transition: previous state + one committed event → next state. A
40
41
  * unit uninterested in an event MUST return the same state reference — an
@@ -73,7 +74,7 @@ interface ProjectionDefinition<
73
74
  /**
74
75
  * One consistent read cut over every registered client-visible unit for one session.
75
76
  * `asOfSeq` is the shared watermark — the seq of the last event every value
76
- * reflects (`-1` for an empty log, mirroring `session/subscribed.lastSeq`).
77
+ * reflects (`-1` for an empty log).
77
78
  */
78
79
  interface ProjectionSnapshot {
79
80
  /** Seq of the last event the values reflect; -1 for an empty log. */
@@ -101,7 +102,7 @@ type ProjectionChangeListener = (
101
102
 
102
103
  ## 注册表:`ctx.sessionProjections`
103
104
 
104
- `SessionProjectionRegistry`([签名](#ctxsessionprojections--sessionprojectionregistry))拥有驱动权:一份 `session/event` 订阅、对每个已注册单元即时调用 `apply`,以及每会话每单元的水位线(watermark)cell。cell 惰性构建:在事件流过之后才注册的单元,或比注册表更早的会话,都在首次触达(事件或读取)时从 `init` 出发在内存日志上折叠。注册是一个 effect,其 disposer 随调用方 fiber 走:领域插件卸载后,其 key(连同缓存的 cell)从后续驱动与快照中消失,客户端将其读作能力缺失;key 重复直接 throw。领域插件在 `ctx.inject(['sessionProjections'], …)` 下注册,因此不带注册表的 headless 组装完全不受影响。
105
+ `SessionProjectionRegistry`([签名](#ctxsessionprojections--sessionprojectionregistry))拥有驱动权:一份 `session/event` 订阅、对每个已注册单元即时调用 `apply`,以及每会话每单元的水位线(watermark)cell。cell 惰性构建:在事件流过之后才注册的单元,或比注册表更早的会话,都在首次触达(事件或读取)时从 `init` 出发在内存日志上折叠。注册是一个 effect,其 disposer 随调用方 fiber 走:领域插件卸载后,其 key(连同缓存的 cell)从后续驱动与快照中消失,客户端将其读作能力缺失;key 以不同 `stateVersion` 重复时直接 throw,同版本注册方则共享一个单元并被计数。领域插件在 `ctx.inject(['sessionProjections'], …)` 下注册,因此不带注册表的 headless 组装完全不受影响。
105
106
 
106
107
  <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
107
108
 
@@ -115,49 +116,63 @@ Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnp
115
116
 
116
117
  ### `ctx.sessionProjectionCache` — `SessionProjectionCache`
117
118
 
118
- The persisted projection cache service. Opens the `session_projcache` domain at init, checkpoints live sessions on a throttled write-behind (count/interval triggers from Config) plus two mandatory points — `turn/end` and session disposal (the live-to-cold moment) — and serves the cold-read ladder: cached row, persistence `readFrom` tail, registry `restore`, durable write-back. Every durable write is fail-soft: failures log a warning and the cache self-heals on the next write or cold read.
119
+ The persisted projection cache service. Opens the `session_projcache` domain at init, checkpoints live sessions on a throttled write-behind (count/interval triggers from Config) plus three mandatory points — session creation, `turn/end`, and session disposal (the live-to-cold moment) — and serves the cached rows for a session header. Every durable write is fail-soft: failures log a warning and the cache self-heals on the next write.
119
120
 
120
121
  ```ts cordis-catalog
121
122
  /**
122
123
  * The zero-I/O listing read: whole values viewed straight from the stored
123
- * rows (version-matching keys only), each cut carried with its watermark
124
- * so a client value store can seed under its higher-seq-wins rule — as
125
- * stale as the last durable checkpoint but never wrong, and never from an
124
+ * rows (version-matching keys only), each cut carried with its watermark so
125
+ * a client value store can seed under its higher-seq-wins rule — as stale
126
+ * as the last durable checkpoint but never wrong, and never from an
126
127
  * unrelated log (the caller's header is the identity witness). Fresher
127
- * paths (the history tail baseline, {@link coldSnapshot}) supersede these
128
- * values whenever a session is actually opened.
128
+ * paths (the history tail baseline) supersede these values whenever a
129
+ * session is actually opened.
129
130
  * @param meta - the listed session's header (identity witness; no log read).
131
+ * @param keys - optional projection keys required by the caller's audience.
130
132
  * @returns the cut (`asOfSeq` = lowest served-row watermark), or
131
133
  * `undefined` when no usable row exists for this lifecycle.
132
134
  */
133
- cachedSnapshot(meta: SessionHeader): ProjectionSnapshot | undefined
135
+ cachedSnapshot( meta: SessionHeader, keys?: readonly Extract<keyof SessionProjectionMap, string>[], ): ProjectionSnapshot | undefined
134
136
 
135
137
  /**
136
- * Durably checkpoint one live session NOW (both mandatory points call
138
+ * Hydrate projection cells for an already-prepared Session without another
139
+ * persistence read. The cache seeds matching rows; the supplied exact log
140
+ * advances every unit to the observation cut. No checkpoint is written
141
+ * because the logical observation may contain recovery events not yet durable.
142
+ * @param session - exact unpublished Session retained by persistence.
143
+ * @param meta - observed lifecycle header.
144
+ * @param events - exact logical event prefix represented by the observation.
145
+ * @returns all projection values at the event cut.
146
+ */
147
+ hydratePrepared( session: Session, meta: SessionHeader, events: readonly SessionEvent[], ): ProjectionSnapshot
148
+
149
+ /**
150
+ * Durably checkpoint one live session NOW (all mandatory points call
137
151
  * this; tests and carriers may too). The registry cut is snapshotted at
138
- * this boundary (states are live references), then the whole record is
139
- * replaced. NOT fail-soft — callers on the fail-soft paths contain it.
152
+ * this boundary (states are live references), then the session's record is
153
+ * replaced on the domain's write chain. NOT fail-soft — callers on the
154
+ * fail-soft paths contain it.
140
155
  * @param session - the live session to checkpoint.
141
156
  * @returns resolution after durability and event emission.
142
157
  */
143
158
  async write(session: Session): Promise<void>
144
159
 
145
160
  /**
146
- * Cold-read one persisted session's projections with zero full-log load:
147
- * cached rows + a persistence `readFrom` tail from the registry's restore
148
- * floor, refolded by the registry and written back (fail-soft) so the next
149
- * cold read starts closer. A cache row invalidated by a shrunk log
150
- * (crash-repair truncation) triggers one full re-read from seq 0 the
151
- * ladder's slow rung, still no crash. Rejects when the session has no
152
- * persisted log (`not found` from the persistence seam).
153
- * @param id - the persisted session to read.
154
- * @param signal - optional cancellation for the persistence reads.
155
- * @returns the snapshot cut at the stored log end.
161
+ * Cold-read one session's projections from its complete log. Each unit is
162
+ * seeded from the identity-checked cached rows the registry skips `apply`
163
+ * for the already-folded prefix (events at or below the row's `seq`) and
164
+ * the refreshed checkpoint is written back (fail-soft, fire-and-forget), so
165
+ * the first cold read creates the cache row and later ones seed from it.
166
+ * The caller supplies the complete log in seq order: this service never
167
+ * consults the persistence layer.
168
+ * @param meta - the stored session header (identity witness).
169
+ * @param events - the session's complete log, in seq order.
170
+ * @returns the projection cut at the log end.
156
171
  */
157
- async coldSnapshot(id: SessionId, signal?: AbortSignal): Promise<ProjectionSnapshot>
172
+ coldSnapshot(meta: SessionHeader, events: readonly SessionEvent[]): ProjectionSnapshot
158
173
  ```
159
174
 
160
- Types: [Session](./session.md) · [SessionHeader](./persistence.md) · [SessionId](./core.md)
175
+ Types: [Session](./session.md) · [SessionEvent](./session.md) · [SessionHeader](./persistence.md)
161
176
 
162
177
  Source: [`packages/session/session-projection-cache/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/session/session-projection-cache/src/index.ts)
163
178
 
@@ -195,7 +210,8 @@ register< K extends Exclude<keyof SessionProjectionStateMap, keyof SessionProjec
195
210
  onChanged(listener: ProjectionChangeListener): () => void
196
211
 
197
212
  /**
198
- * Read one unit's current host state without computing unrelated views.
213
+ * Read one unit's current host state after materializing every registered
214
+ * unit at the Session cursor. Unrelated wire views are not produced.
199
215
  * The returned value is live; callers must not mutate it.
200
216
  * @param session - the session whose state is read.
201
217
  * @param key - the registered unit key.
@@ -209,9 +225,20 @@ stateOf<K extends keyof SessionProjectionStateMap>( session: Session, key: K, ):
209
225
  * Fully synchronous — every value and `asOfSeq` reflect the same log
210
226
  * position. Each value passes its unit's `viewSchema` before leaving.
211
227
  * @param session - the session whose projection values are read.
212
- * @returns the snapshot; `values` is empty when no client-visible unit is registered.
228
+ * @param keys - optional client-visible outputs; state materialization remains complete.
229
+ * @returns the snapshot; `values` is empty when no selected client-visible unit is registered.
213
230
  */
214
- snapshot(session: Session): ProjectionSnapshot
231
+ snapshot( session: Session, keys?: readonly Extract<keyof SessionProjectionMap, string>[], ): ProjectionSnapshot
232
+
233
+ /**
234
+ * Read only already-materialized client-visible cells without folding history.
235
+ * Values may trail the live Session and are therefore hints, not a complete
236
+ * baseline. Missing cells are omitted.
237
+ * @param session - attached Session whose cached cells are inspected.
238
+ * @param keys - optional wire keys to view.
239
+ * @returns the lowest common cached cut, or `undefined` when no wire cell exists.
240
+ */
241
+ cachedSnapshot( session: Session, keys?: readonly Extract<keyof SessionProjectionMap, string>[], ): ProjectionSnapshot | undefined
215
242
 
216
243
  /**
217
244
  * State-level checkpoint of every persisted unit for one session, read
@@ -255,9 +282,10 @@ restoreFloor(checkpoint: ProjectionCheckpoint): number | undefined
255
282
  * fuller read path refolds it). The zero-I/O rung of the read ladder —
256
283
  * values are as stale as their rows, never wrong.
257
284
  * @param checkpoint - persisted rows for one session (possibly stale or empty).
285
+ * @param keys - optional wire keys to view.
258
286
  * @returns whole values per key with a usable row; empty when none.
259
287
  */
260
- viewCheckpoint(checkpoint: ProjectionCheckpoint): Partial<SessionProjectionMap>
288
+ viewCheckpoint( checkpoint: ProjectionCheckpoint, keys?: readonly Extract<keyof SessionProjectionMap, string>[], ): Partial<SessionProjectionMap>
261
289
 
262
290
  /**
263
291
  * Cold read: fold every persisted unit over a stored log suffix, seeding
@@ -277,14 +305,27 @@ viewCheckpoint(checkpoint: ProjectionCheckpoint): Partial<SessionProjectionMap>
277
305
  * @param checkpoint - persisted rows for one session (possibly stale or empty).
278
306
  * @param events - the stored events with `seq >= baseSeq`, in seq order.
279
307
  * @param baseSeq - the seq `events` starts at (its first event's seq when non-empty).
308
+ * @param header - immutable metadata for the Session being restored.
280
309
  * @returns the snapshot cut at the supplied log end (`asOfSeq` is the last
281
310
  * supplied event's seq, `baseSeq - 1` for an empty tail) plus the
282
311
  * refreshed checkpoint rows at that cut, ready for a durable write-back.
283
312
  */
284
- restore( checkpoint: ProjectionCheckpoint, events: readonly SessionEvent[], baseSeq: number, ): { snapshot: ProjectionSnapshot; checkpoint: ProjectionCheckpoint }
313
+ restore( checkpoint: ProjectionCheckpoint, events: readonly SessionEvent[], baseSeq: number, header: SessionHeader, ): { snapshot: ProjectionSnapshot; checkpoint: ProjectionCheckpoint }
314
+
315
+ /**
316
+ * Restore an exact cut and install its states on the supplied prepared Session.
317
+ * A later publication reuses these cells; ordinary live reads and event drive
318
+ * advance any constructor-owned suffix exactly once.
319
+ * @param session - exact prepared Session that owns the restored log prefix.
320
+ * @param checkpoint - persisted rows for this Session lifecycle.
321
+ * @param events - exact events at the observation cut.
322
+ * @param baseSeq - first supplied event sequence.
323
+ * @returns all projection values at the supplied cut.
324
+ */
325
+ hydrate( session: Session, checkpoint: ProjectionCheckpoint, events: readonly SessionEvent[], baseSeq: number, ): ProjectionSnapshot
285
326
  ```
286
327
 
287
- Types: [Session](./session.md) · [SessionEvent](./session.md)
328
+ Types: [Session](./session.md) · [SessionEvent](./session.md) · [SessionHeader](./persistence.md)
288
329
 
289
330
  Source: [`packages/session/session-projection/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/session/session-projection/src/index.ts)
290
331
  <!-- END GENERATED cordis-surface -->
@@ -141,7 +141,7 @@ interface SessionEventSearchDocument extends SessionEventRecord {
141
141
  }
142
142
  ```
143
143
 
144
- `ctx.sessionQuery.filterSessions(filters)` 会对完整的逻辑会话语料库应用 `SessionResultFilter`;`ctx.sessionQuery.filterEvents(sessionId, filters)` 按 seq 升序返回匹配的文档。消息、推理(reasoning)、工具调用和工具结果、被阻止的提示词、待办事项,以及失败和状态详情会纳入语义文本;结构事件和流分片则不会。
144
+ `ctx.sessionQuery.filterSessions(filters)` 会对完整的逻辑会话语料库应用 `SessionResultFilter`;`ctx.sessionQuery.filterEvents(sessionId, filters)` 按 seq 升序返回匹配的文档。消息、工具调用和工具结果、待办事项,以及失败和状态详情会纳入语义文本;推理(reasoning)块、被阻止的提示词、结构事件和流分片则不会。
145
145
 
146
146
  ## 全文搜索结果页
147
147
 
@@ -376,6 +376,14 @@ Unified live-preferred session query service.
376
376
  Exact reads, filters, and traces are backend-independent concrete behavior. A backend implements full-text observation, reconciliation, ranking, cursor generations, and query execution on the same `ctx.sessionQuery` service.
377
377
 
378
378
  ```ts cordis-catalog
379
+ /**
380
+ * Observe one exact live or prepared Session without a persistence listing preflight.
381
+ * @param sessionId - logical Session identity.
382
+ * @param options - cancellation and projection selection for this read.
383
+ * @returns a caller-owned observation lease.
384
+ */
385
+ observeSession( sessionId: SessionId, options: SessionObservationOptions = {}, ): Promise<SessionObservation>
386
+
379
387
  /**
380
388
  * Search the live-preferred logical corpus and group by session.
381
389
  * @param request - query text, metadata filters, page size, and cursor.
@@ -37,7 +37,7 @@ interface SessionReferenceInput {
37
37
  }
38
38
  ```
39
39
 
40
- `SessionReferenceCandidate` 是面向宿主的发现输出。存在最新会话标题时,它的 label 使用该标题;筛选仍只搜索 session id 和 cwd,绝不搜索 transcript(文本记录)。
40
+ `SessionReferenceCandidate` 是面向宿主的发现输出。存在最新会话标题时,它的 label 使用该标题;筛选搜索该 label 以及 session id 和 cwd,绝不搜索 transcript(文本记录)。
41
41
 
42
42
  ```ts type-equiv
43
43
  /** One host-facing candidate from exact session metadata. */
@@ -48,6 +48,12 @@ interface SessionReferenceCandidate {
48
48
  label: string
49
49
  /** Source session working directory, when recorded. */
50
50
  cwd?: string
51
+ /**
52
+ * True when {@link SessionReferenceCandidate.cwd} is recorded and equals the
53
+ * requesting agent's. Hosts that only surface a distinguishing location
54
+ * read this instead of comparing paths they never received.
55
+ */
56
+ sameWorkspace: boolean
51
57
  /** Source session creation time in Unix epoch milliseconds. */
52
58
  createdAt: number
53
59
  }
@@ -116,21 +122,32 @@ Host capability for cancellable file-reference discovery.
116
122
  * @returns deterministic path-only candidates.
117
123
  */
118
124
  abstract list( agent: Agent, query: string, signal: AbortSignal, ): Promise<FileReferenceCandidate[]>
125
+ ```
126
+
127
+ Types: [Agent](./core.md)
128
+
129
+ Source: [`packages/context/file-reference/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/context/file-reference/src/index.ts)
130
+
131
+ <a id="ctxsessionfilereferences--sessionfilereferences"></a>
119
132
 
133
+ ### `ctx.sessionFileReferences` — `SessionFileReferences`
134
+
135
+ Host Remote adapter over the composed file-reference provider.
136
+
137
+ ```ts cordis-catalog
120
138
  /**
121
- * Remote face of {@link list}; the decorator cannot mark the abstract
122
- * member, so this concrete adapter carries the identical contract.
123
- * @param agent - target agent whose session cwd bounds discovery.
139
+ * List file and directory candidates for one Agent's working directory.
140
+ * @param agent - target Agent resolved from the Session identity on the wire.
124
141
  * @param query - path text following `@` or `@"`.
125
142
  * @param signal - caller cancellation.
126
- * @returns deterministic path-only candidates.
143
+ * @returns deterministic path-only candidates from the composed provider.
127
144
  */
128
- @Remote('list') remoteExportList( agent: Agent, query: string, signal: AbortSignal, ): Promise<FileReferenceCandidate[]>
145
+ @Remote list( agent: Agent, query: string, signal: AbortSignal, ): Promise<FileReferenceCandidate[]>
129
146
  ```
130
147
 
131
148
  Types: [Agent](./core.md)
132
149
 
133
- Source: [`packages/context/file-reference/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/context/file-reference/src/index.ts)
150
+ Source: [`packages/api/session-controller/src/file-references.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/api/session-controller/src/file-references.ts)
134
151
 
135
152
  <a id="ctxsessionreferenceresolver--sessionreferenceresolver"></a>
136
153
 
@@ -141,6 +158,10 @@ Exact-read consumer that prepares immutable cross-session message context.
141
158
  ```ts cordis-catalog
142
159
  /**
143
160
  * List reference candidates, ranked by working-directory affinity.
161
+ *
162
+ * Discovery runs at keystroke rate, so a title only ever comes from a
163
+ * projection read: see {@link SessionReferenceResolver.projectedTitle} for
164
+ * which sessions can answer one and which fall back to their id.
144
165
  * @param agent - target agent; self is excluded and its cwd drives ranking.
145
166
  * @param query - optional case-insensitive session-id/cwd/title substring.
146
167
  * @param limit - optional positive result cap.
@@ -67,9 +67,8 @@ interface SessionTelemetryRecord {
67
67
  /**
68
68
  * Deployment-selected session-sharing policy disclosed by a mounted
69
69
  * {@link SessionTelemetryBackend} backend to human-facing acknowledgement surfaces (the
70
- * `/feedback` command's confirmation text). The seam owns the vocabulary so
71
- * any backend can disclose a policy without depending on the OTel package;
72
- * the values mirror the OTel backend's serialized `SessionTelemetryMode` choices.
70
+ * `/feedback` command's confirmation text). The Service Definition owns the
71
+ * vocabulary so consumers and backends do not depend on a specific provider.
73
72
  */
74
73
  type SessionTelemetrySharingStatus = 'full' | 'feedback-only' | 'disabled'
75
74
  ```