dsh-plugin-guide 0.3.1 → 0.3.3

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 (371) hide show
  1. package/README.es.md +1 -1
  2. package/README.hi.md +1 -1
  3. package/README.md +1 -1
  4. package/README.pt.md +1 -1
  5. package/README.zh.md +1 -1
  6. package/SKILL.md +1 -1
  7. package/dist/dsh-plugin-dev.js +5 -5
  8. package/guide/links.md +1 -1
  9. package/guide/plugin-dev-guide.md +1 -1
  10. package/guide/quick-reference.es.md +2 -2
  11. package/guide/quick-reference.hi.md +1 -1
  12. package/guide/quick-reference.md +2 -2
  13. package/guide/quick-reference.pt.md +2 -2
  14. package/guide/quick-reference.zh-CN.md +2 -2
  15. package/package.json +3 -3
  16. package/references/cordis-paper-and-community.md +1 -1
  17. package/references/official-docs/AGENTS.md +28 -23
  18. package/references/official-docs/README.i18n.yaml +2 -2
  19. package/references/official-docs/README.md +1 -1
  20. package/references/official-docs/README.zh.md +19 -9
  21. package/references/official-docs/SNAPSHOT.md +5 -5
  22. package/references/official-docs/THIRD_PARTY_NOTICES.md +36 -13
  23. package/references/official-docs/docs/AGENTS.md +4 -4
  24. package/references/official-docs/docs/agent-lifecycle.i18n.yaml +2 -2
  25. package/references/official-docs/docs/agent-lifecycle.md +1 -1
  26. package/references/official-docs/docs/agent-lifecycle.zh.md +2 -2
  27. package/references/official-docs/docs/api-gateway.i18n.yaml +2 -2
  28. package/references/official-docs/docs/api-gateway.md +8 -8
  29. package/references/official-docs/docs/api-gateway.zh.md +8 -8
  30. package/references/official-docs/docs/architecture.i18n.yaml +2 -2
  31. package/references/official-docs/docs/architecture.md +25 -8
  32. package/references/official-docs/docs/architecture.zh.md +38 -21
  33. package/references/official-docs/docs/capability-seams.i18n.yaml +2 -2
  34. package/references/official-docs/docs/capability-seams.md +134 -67
  35. package/references/official-docs/docs/capability-seams.zh.md +134 -67
  36. package/references/official-docs/docs/config-catalog.i18n.yaml +2 -2
  37. package/references/official-docs/docs/config-catalog.md +731 -403
  38. package/references/official-docs/docs/config-catalog.zh.md +747 -419
  39. package/references/official-docs/docs/cookbook/adding-a-package.i18n.yaml +2 -2
  40. package/references/official-docs/docs/cookbook/adding-a-package.md +3 -4
  41. package/references/official-docs/docs/cookbook/adding-a-package.zh.md +9 -8
  42. package/references/official-docs/docs/cookbook/{adding-a-conversation-node.i18n.yaml → adding-a-remote-api.i18n.yaml} +3 -3
  43. package/references/official-docs/docs/cookbook/adding-a-remote-api.md +197 -0
  44. package/references/official-docs/docs/cookbook/adding-a-remote-api.zh.md +197 -0
  45. package/references/official-docs/docs/cookbook/adding-a-settings-card.i18n.yaml +6 -0
  46. package/references/official-docs/docs/cookbook/adding-a-settings-card.md +102 -0
  47. package/references/official-docs/docs/cookbook/adding-a-settings-card.zh.md +102 -0
  48. package/references/official-docs/docs/cookbook/adding-a-tool.i18n.yaml +2 -2
  49. package/references/official-docs/docs/cookbook/adding-a-tool.md +11 -4
  50. package/references/official-docs/docs/cookbook/adding-a-tool.zh.md +16 -9
  51. package/references/official-docs/docs/cookbook/adding-a-vendored-package.i18n.yaml +2 -2
  52. package/references/official-docs/docs/cookbook/adding-a-vendored-package.md +2 -2
  53. package/references/official-docs/docs/cookbook/adding-a-vendored-package.zh.md +4 -4
  54. package/references/official-docs/docs/cookbook/adding-an-llm-adapter.i18n.yaml +2 -2
  55. package/references/official-docs/docs/cookbook/adding-an-llm-adapter.md +1 -1
  56. package/references/official-docs/docs/cookbook/adding-an-llm-adapter.zh.md +3 -3
  57. package/references/official-docs/docs/cookbook/extension-cookbook.i18n.yaml +2 -2
  58. package/references/official-docs/docs/cookbook/extension-cookbook.md +9 -8
  59. package/references/official-docs/docs/cookbook/extension-cookbook.zh.md +17 -14
  60. package/references/official-docs/docs/cookbook/maintaining-dsh-code-review.i18n.yaml +1 -1
  61. package/references/official-docs/docs/cookbook/maintaining-dsh-code-review.zh.md +1 -1
  62. package/references/official-docs/docs/cookbook/responding-to-pr-review-on-a-stack.i18n.yaml +1 -1
  63. package/references/official-docs/docs/cookbook/responding-to-pr-review-on-a-stack.zh.md +1 -1
  64. package/references/official-docs/docs/cordis-api/context.i18n.yaml +1 -1
  65. package/references/official-docs/docs/cordis-api/context.zh.md +1 -1
  66. package/references/official-docs/docs/cordis-api/events.i18n.yaml +1 -1
  67. package/references/official-docs/docs/cordis-api/events.zh.md +1 -1
  68. package/references/official-docs/docs/cordis-api/inherited.md +1 -1
  69. package/references/official-docs/docs/cordis-primer.i18n.yaml +2 -2
  70. package/references/official-docs/docs/cordis-primer.md +2 -1
  71. package/references/official-docs/docs/cordis-primer.zh.md +3 -2
  72. package/references/official-docs/docs/cordis-tutorial/01-first-plugin.i18n.yaml +1 -1
  73. package/references/official-docs/docs/cordis-tutorial/01-first-plugin.zh.md +4 -4
  74. package/references/official-docs/docs/cordis-tutorial/02-lifecycle-and-effects.i18n.yaml +1 -1
  75. package/references/official-docs/docs/cordis-tutorial/02-lifecycle-and-effects.zh.md +4 -4
  76. package/references/official-docs/docs/cordis-tutorial/03-services.i18n.yaml +1 -1
  77. package/references/official-docs/docs/cordis-tutorial/03-services.zh.md +4 -4
  78. package/references/official-docs/docs/cordis-tutorial/04-events.i18n.yaml +1 -1
  79. package/references/official-docs/docs/cordis-tutorial/04-events.zh.md +4 -4
  80. package/references/official-docs/docs/cordis-tutorial/05-config.i18n.yaml +1 -1
  81. package/references/official-docs/docs/cordis-tutorial/05-config.zh.md +2 -2
  82. package/references/official-docs/docs/cordis-tutorial/06-composition-and-hmr.i18n.yaml +1 -1
  83. package/references/official-docs/docs/cordis-tutorial/06-composition-and-hmr.zh.md +3 -3
  84. package/references/official-docs/docs/cordis-tutorial/07-into-the-harness.i18n.yaml +2 -2
  85. package/references/official-docs/docs/cordis-tutorial/07-into-the-harness.md +5 -4
  86. package/references/official-docs/docs/cordis-tutorial/07-into-the-harness.zh.md +11 -10
  87. package/references/official-docs/docs/cordis-tutorial/index.i18n.yaml +1 -1
  88. package/references/official-docs/docs/cordis-tutorial/index.zh.md +10 -10
  89. package/references/official-docs/docs/deepseek-llm-api-wire-extensions.i18n.yaml +6 -0
  90. package/references/official-docs/docs/deepseek-llm-api-wire-extensions.md +159 -0
  91. package/references/official-docs/docs/deepseek-llm-api-wire-extensions.zh.md +159 -0
  92. package/references/official-docs/docs/defensive-patterns.i18n.yaml +1 -1
  93. package/references/official-docs/docs/defensive-patterns.zh.md +3 -1
  94. package/references/official-docs/docs/development.i18n.yaml +2 -2
  95. package/references/official-docs/docs/development.md +9 -13
  96. package/references/official-docs/docs/development.zh.md +23 -21
  97. package/references/official-docs/docs/event-producer-consumer.i18n.yaml +2 -2
  98. package/references/official-docs/docs/event-producer-consumer.md +55 -46
  99. package/references/official-docs/docs/event-producer-consumer.zh.md +55 -46
  100. package/references/official-docs/docs/glossary.i18n.yaml +2 -2
  101. package/references/official-docs/docs/glossary.md +1 -1
  102. package/references/official-docs/docs/glossary.zh.md +1 -1
  103. package/references/official-docs/docs/graph-atlas.i18n.yaml +2 -2
  104. package/references/official-docs/docs/graph-atlas.md +0 -2
  105. package/references/official-docs/docs/graph-atlas.zh.md +7 -9
  106. package/references/official-docs/docs/i18n/README.i18n.yaml +2 -2
  107. package/references/official-docs/docs/i18n/README.md +7 -7
  108. package/references/official-docs/docs/i18n/README.zh.md +11 -9
  109. package/references/official-docs/docs/i18n/style-samples.md +3 -3
  110. package/references/official-docs/docs/i18n/translation-prompt.md +3 -3
  111. package/references/official-docs/docs/i18n/translation-rules.i18n.yaml +2 -2
  112. package/references/official-docs/docs/i18n/translation-rules.md +2 -2
  113. package/references/official-docs/docs/i18n/translation-rules.zh.md +3 -3
  114. package/references/official-docs/docs/module-graph.i18n.yaml +2 -2
  115. package/references/official-docs/docs/module-graph.md +660 -909
  116. package/references/official-docs/docs/module-graph.zh.md +662 -911
  117. package/references/official-docs/docs/persistence-catalog.i18n.yaml +2 -2
  118. package/references/official-docs/docs/persistence-catalog.md +185 -53
  119. package/references/official-docs/docs/persistence-catalog.zh.md +193 -61
  120. package/references/official-docs/docs/postmortem/0001-acp-default-export-drops-inject.i18n.yaml +2 -2
  121. package/references/official-docs/docs/postmortem/0001-acp-default-export-drops-inject.md +2 -2
  122. package/references/official-docs/docs/postmortem/0001-acp-default-export-drops-inject.zh.md +3 -3
  123. package/references/official-docs/docs/postmortem/0002-js-expression-disabled-filesystem-tools.i18n.yaml +2 -2
  124. package/references/official-docs/docs/postmortem/0002-js-expression-disabled-filesystem-tools.md +2 -2
  125. package/references/official-docs/docs/postmortem/0002-js-expression-disabled-filesystem-tools.zh.md +2 -2
  126. package/references/official-docs/docs/postmortem/0003-web-agent-gui-feedback-loop.i18n.yaml +2 -2
  127. package/references/official-docs/docs/postmortem/0003-web-agent-gui-feedback-loop.md +2 -2
  128. package/references/official-docs/docs/postmortem/0003-web-agent-gui-feedback-loop.zh.md +2 -2
  129. package/references/official-docs/docs/postmortem/0004-landlock-partial-notice-misclassified-child-failures.i18n.yaml +2 -2
  130. package/references/official-docs/docs/postmortem/0004-landlock-partial-notice-misclassified-child-failures.md +1 -1
  131. package/references/official-docs/docs/postmortem/0004-landlock-partial-notice-misclassified-child-failures.zh.md +2 -2
  132. package/references/official-docs/docs/postmortem/README.i18n.yaml +1 -1
  133. package/references/official-docs/docs/postmortem/README.zh.md +5 -5
  134. package/references/official-docs/docs/rescope.i18n.yaml +2 -2
  135. package/references/official-docs/docs/rescope.md +2 -2
  136. package/references/official-docs/docs/rescope.zh.md +3 -3
  137. package/references/official-docs/docs/subsystems/README.i18n.yaml +2 -2
  138. package/references/official-docs/docs/subsystems/README.md +8 -2
  139. package/references/official-docs/docs/subsystems/README.zh.md +53 -47
  140. package/references/official-docs/docs/subsystems/agent-team.i18n.yaml +6 -0
  141. package/references/official-docs/docs/subsystems/agent-team.md +207 -0
  142. package/references/official-docs/docs/subsystems/agent-team.zh.md +207 -0
  143. package/references/official-docs/docs/subsystems/approval.i18n.yaml +2 -2
  144. package/references/official-docs/docs/subsystems/approval.md +12 -12
  145. package/references/official-docs/docs/subsystems/approval.zh.md +13 -13
  146. package/references/official-docs/docs/subsystems/attachment.i18n.yaml +2 -2
  147. package/references/official-docs/docs/subsystems/attachment.md +90 -7
  148. package/references/official-docs/docs/subsystems/attachment.zh.md +90 -7
  149. package/references/official-docs/docs/subsystems/client-modules.i18n.yaml +2 -2
  150. package/references/official-docs/docs/subsystems/client-modules.md +69 -19
  151. package/references/official-docs/docs/subsystems/client-modules.zh.md +69 -19
  152. package/references/official-docs/docs/subsystems/code-runtime.i18n.yaml +2 -2
  153. package/references/official-docs/docs/subsystems/code-runtime.md +12 -8
  154. package/references/official-docs/docs/subsystems/code-runtime.zh.md +13 -9
  155. package/references/official-docs/docs/subsystems/commands.i18n.yaml +2 -2
  156. package/references/official-docs/docs/subsystems/commands.md +30 -7
  157. package/references/official-docs/docs/subsystems/commands.zh.md +31 -8
  158. package/references/official-docs/docs/subsystems/compaction.i18n.yaml +2 -2
  159. package/references/official-docs/docs/subsystems/compaction.md +14 -14
  160. package/references/official-docs/docs/subsystems/compaction.zh.md +19 -19
  161. package/references/official-docs/docs/subsystems/conversation.i18n.yaml +6 -0
  162. package/references/official-docs/docs/{cookbook/adding-a-conversation-node.md → subsystems/conversation.md} +49 -24
  163. package/references/official-docs/docs/{cookbook/adding-a-conversation-node.zh.md → subsystems/conversation.zh.md} +49 -24
  164. package/references/official-docs/docs/subsystems/core.i18n.yaml +2 -2
  165. package/references/official-docs/docs/subsystems/core.md +114 -36
  166. package/references/official-docs/docs/subsystems/core.zh.md +145 -65
  167. package/references/official-docs/docs/subsystems/credentials.i18n.yaml +2 -2
  168. package/references/official-docs/docs/subsystems/credentials.md +207 -11
  169. package/references/official-docs/docs/subsystems/credentials.zh.md +207 -11
  170. package/references/official-docs/docs/subsystems/extensions.i18n.yaml +2 -2
  171. package/references/official-docs/docs/subsystems/extensions.md +27 -9
  172. package/references/official-docs/docs/subsystems/extensions.zh.md +30 -12
  173. package/references/official-docs/docs/subsystems/feedback.i18n.yaml +2 -2
  174. package/references/official-docs/docs/subsystems/feedback.md +6 -6
  175. package/references/official-docs/docs/subsystems/feedback.zh.md +6 -6
  176. package/references/official-docs/docs/subsystems/filesystem.i18n.yaml +2 -2
  177. package/references/official-docs/docs/subsystems/filesystem.md +17 -7
  178. package/references/official-docs/docs/subsystems/filesystem.zh.md +19 -9
  179. package/references/official-docs/docs/subsystems/goal.i18n.yaml +2 -2
  180. package/references/official-docs/docs/subsystems/goal.md +4 -4
  181. package/references/official-docs/docs/subsystems/goal.zh.md +8 -8
  182. package/references/official-docs/docs/subsystems/invariants.i18n.yaml +2 -2
  183. package/references/official-docs/docs/subsystems/invariants.md +2 -2
  184. package/references/official-docs/docs/subsystems/invariants.zh.md +5 -5
  185. package/references/official-docs/docs/subsystems/jobs.i18n.yaml +2 -2
  186. package/references/official-docs/docs/subsystems/jobs.md +3 -3
  187. package/references/official-docs/docs/subsystems/jobs.zh.md +6 -6
  188. package/references/official-docs/docs/subsystems/llm-streaming.i18n.yaml +2 -2
  189. package/references/official-docs/docs/subsystems/llm-streaming.md +193 -22
  190. package/references/official-docs/docs/subsystems/llm-streaming.zh.md +199 -28
  191. package/references/official-docs/docs/subsystems/lsp.i18n.yaml +2 -2
  192. package/references/official-docs/docs/subsystems/lsp.md +2 -2
  193. package/references/official-docs/docs/subsystems/lsp.zh.md +3 -3
  194. package/references/official-docs/docs/subsystems/permission-presets.i18n.yaml +2 -2
  195. package/references/official-docs/docs/subsystems/permission-presets.md +8 -8
  196. package/references/official-docs/docs/subsystems/permission-presets.zh.md +8 -8
  197. package/references/official-docs/docs/subsystems/persistence.i18n.yaml +2 -2
  198. package/references/official-docs/docs/subsystems/persistence.md +183 -173
  199. package/references/official-docs/docs/subsystems/persistence.zh.md +182 -172
  200. package/references/official-docs/docs/subsystems/plan.i18n.yaml +2 -2
  201. package/references/official-docs/docs/subsystems/plan.md +4 -4
  202. package/references/official-docs/docs/subsystems/plan.zh.md +10 -10
  203. package/references/official-docs/docs/subsystems/sandbox.i18n.yaml +2 -2
  204. package/references/official-docs/docs/subsystems/sandbox.md +5 -3
  205. package/references/official-docs/docs/subsystems/sandbox.zh.md +8 -6
  206. package/references/official-docs/docs/subsystems/schedule.i18n.yaml +2 -2
  207. package/references/official-docs/docs/subsystems/schedule.md +9 -3
  208. package/references/official-docs/docs/subsystems/schedule.zh.md +11 -5
  209. package/references/official-docs/docs/subsystems/scope.i18n.yaml +1 -1
  210. package/references/official-docs/docs/subsystems/scope.zh.md +1 -1
  211. package/references/official-docs/docs/subsystems/session-projection.i18n.yaml +2 -2
  212. package/references/official-docs/docs/subsystems/session-projection.md +148 -75
  213. package/references/official-docs/docs/subsystems/session-projection.zh.md +148 -75
  214. package/references/official-docs/docs/subsystems/session-query.i18n.yaml +2 -2
  215. package/references/official-docs/docs/subsystems/session-query.md +30 -16
  216. package/references/official-docs/docs/subsystems/session-query.zh.md +31 -17
  217. package/references/official-docs/docs/subsystems/session-reference.i18n.yaml +2 -2
  218. package/references/official-docs/docs/subsystems/session-reference.md +94 -7
  219. package/references/official-docs/docs/subsystems/session-reference.zh.md +95 -8
  220. package/references/official-docs/docs/subsystems/session-telemetry.i18n.yaml +2 -2
  221. package/references/official-docs/docs/subsystems/session-telemetry.md +5 -6
  222. package/references/official-docs/docs/subsystems/session-telemetry.zh.md +9 -10
  223. package/references/official-docs/docs/subsystems/session-title.i18n.yaml +2 -2
  224. package/references/official-docs/docs/subsystems/session-title.md +8 -8
  225. package/references/official-docs/docs/subsystems/session-title.zh.md +10 -10
  226. package/references/official-docs/docs/subsystems/session.i18n.yaml +2 -2
  227. package/references/official-docs/docs/subsystems/session.md +376 -71
  228. package/references/official-docs/docs/subsystems/session.zh.md +392 -85
  229. package/references/official-docs/docs/subsystems/settings.i18n.yaml +2 -2
  230. package/references/official-docs/docs/subsystems/settings.md +105 -10
  231. package/references/official-docs/docs/subsystems/settings.zh.md +105 -10
  232. package/references/official-docs/docs/subsystems/shell.i18n.yaml +2 -2
  233. package/references/official-docs/docs/subsystems/shell.md +3 -3
  234. package/references/official-docs/docs/subsystems/shell.zh.md +11 -11
  235. package/references/official-docs/docs/subsystems/skills.i18n.yaml +2 -2
  236. package/references/official-docs/docs/subsystems/skills.md +26 -3
  237. package/references/official-docs/docs/subsystems/skills.zh.md +29 -6
  238. package/references/official-docs/docs/subsystems/slots.i18n.yaml +6 -0
  239. package/references/official-docs/docs/subsystems/slots.md +175 -0
  240. package/references/official-docs/docs/subsystems/slots.zh.md +175 -0
  241. package/references/official-docs/docs/subsystems/spill.i18n.yaml +2 -2
  242. package/references/official-docs/docs/subsystems/spill.md +4 -4
  243. package/references/official-docs/docs/subsystems/spill.zh.md +6 -6
  244. package/references/official-docs/docs/subsystems/storage.i18n.yaml +2 -2
  245. package/references/official-docs/docs/subsystems/storage.md +38 -7
  246. package/references/official-docs/docs/subsystems/storage.zh.md +41 -10
  247. package/references/official-docs/docs/subsystems/subagent.i18n.yaml +2 -2
  248. package/references/official-docs/docs/subsystems/subagent.md +148 -116
  249. package/references/official-docs/docs/subsystems/subagent.zh.md +158 -124
  250. package/references/official-docs/docs/subsystems/subprocess.i18n.yaml +2 -2
  251. package/references/official-docs/docs/subsystems/subprocess.md +3 -3
  252. package/references/official-docs/docs/subsystems/subprocess.zh.md +5 -5
  253. package/references/official-docs/docs/subsystems/system-prompt.i18n.yaml +2 -2
  254. package/references/official-docs/docs/subsystems/system-prompt.md +21 -8
  255. package/references/official-docs/docs/subsystems/system-prompt.zh.md +23 -10
  256. package/references/official-docs/docs/subsystems/terminal.i18n.yaml +2 -2
  257. package/references/official-docs/docs/subsystems/terminal.md +2 -2
  258. package/references/official-docs/docs/subsystems/terminal.zh.md +4 -4
  259. package/references/official-docs/docs/subsystems/todo.i18n.yaml +6 -0
  260. package/references/official-docs/docs/subsystems/todo.md +32 -0
  261. package/references/official-docs/docs/subsystems/todo.zh.md +32 -0
  262. package/references/official-docs/docs/subsystems/token-meter.i18n.yaml +2 -2
  263. package/references/official-docs/docs/subsystems/token-meter.md +29 -14
  264. package/references/official-docs/docs/subsystems/token-meter.zh.md +30 -15
  265. package/references/official-docs/docs/subsystems/tools.i18n.yaml +2 -2
  266. package/references/official-docs/docs/subsystems/tools.md +46 -46
  267. package/references/official-docs/docs/subsystems/tools.zh.md +54 -54
  268. package/references/official-docs/docs/subsystems/typert.i18n.yaml +2 -2
  269. package/references/official-docs/docs/subsystems/typert.md +65 -58
  270. package/references/official-docs/docs/subsystems/typert.zh.md +67 -60
  271. package/references/official-docs/docs/subsystems/user-questions.i18n.yaml +2 -2
  272. package/references/official-docs/docs/subsystems/user-questions.md +35 -35
  273. package/references/official-docs/docs/subsystems/user-questions.zh.md +35 -35
  274. package/references/official-docs/docs/subsystems/web-client.i18n.yaml +6 -0
  275. package/references/official-docs/docs/subsystems/web-client.md +95 -0
  276. package/references/official-docs/docs/subsystems/web-client.zh.md +95 -0
  277. package/references/official-docs/docs/subsystems/web-server.i18n.yaml +2 -2
  278. package/references/official-docs/docs/subsystems/web-server.md +55 -9
  279. package/references/official-docs/docs/subsystems/web-server.zh.md +56 -10
  280. package/references/official-docs/docs/subsystems/web.i18n.yaml +2 -2
  281. package/references/official-docs/docs/subsystems/web.md +14 -7
  282. package/references/official-docs/docs/subsystems/web.zh.md +16 -9
  283. package/references/official-docs/docs/subsystems/webhook.i18n.yaml +6 -0
  284. package/references/official-docs/docs/subsystems/webhook.md +70 -0
  285. package/references/official-docs/docs/subsystems/webhook.zh.md +70 -0
  286. package/references/official-docs/docs/subsystems/workflow.i18n.yaml +2 -2
  287. package/references/official-docs/docs/subsystems/workflow.md +8 -8
  288. package/references/official-docs/docs/subsystems/workflow.zh.md +13 -13
  289. package/references/official-docs/docs/subsystems/workspace.i18n.yaml +2 -2
  290. package/references/official-docs/docs/subsystems/workspace.md +98 -5
  291. package/references/official-docs/docs/subsystems/workspace.zh.md +102 -9
  292. package/references/official-docs/docs/testing.i18n.yaml +2 -2
  293. package/references/official-docs/docs/testing.md +15 -10
  294. package/references/official-docs/docs/testing.zh.md +15 -10
  295. package/references/official-docs/docs/tool-catalog.i18n.yaml +2 -2
  296. package/references/official-docs/docs/tool-catalog.md +413 -61
  297. package/references/official-docs/docs/tool-catalog.zh.md +418 -63
  298. package/references/official-docs/docs/tool-execution-pipeline.i18n.yaml +2 -2
  299. package/references/official-docs/docs/tool-execution-pipeline.md +1 -1
  300. package/references/official-docs/docs/tool-execution-pipeline.zh.md +1 -1
  301. package/references/official-docs/docs/user/develop/basic/config.i18n.yaml +2 -2
  302. package/references/official-docs/docs/user/develop/basic/config.md +1 -1
  303. package/references/official-docs/docs/user/develop/basic/config.zh.md +4 -4
  304. package/references/official-docs/docs/user/develop/basic/index.i18n.yaml +1 -1
  305. package/references/official-docs/docs/user/develop/basic/index.zh.md +5 -5
  306. package/references/official-docs/docs/user/develop/basic/publish.i18n.yaml +2 -2
  307. package/references/official-docs/docs/user/develop/basic/publish.md +3 -3
  308. package/references/official-docs/docs/user/develop/basic/publish.zh.md +7 -7
  309. package/references/official-docs/docs/user/develop/basic/tool.i18n.yaml +2 -2
  310. package/references/official-docs/docs/user/develop/basic/tool.md +3 -3
  311. package/references/official-docs/docs/user/develop/basic/tool.zh.md +4 -4
  312. package/references/official-docs/docs/user/develop/framework/events.i18n.yaml +2 -2
  313. package/references/official-docs/docs/user/develop/framework/events.md +2 -2
  314. package/references/official-docs/docs/user/develop/framework/events.zh.md +3 -3
  315. package/references/official-docs/docs/user/develop/framework/index.i18n.yaml +1 -1
  316. package/references/official-docs/docs/user/develop/framework/index.zh.md +3 -3
  317. package/references/official-docs/docs/user/develop/framework/service.i18n.yaml +2 -2
  318. package/references/official-docs/docs/user/develop/framework/service.md +1 -1
  319. package/references/official-docs/docs/user/develop/framework/service.zh.md +3 -3
  320. package/references/official-docs/docs/user/develop/practice/dynamic-cordis.i18n.yaml +6 -0
  321. package/references/official-docs/docs/user/develop/practice/dynamic-cordis.md +15 -0
  322. package/references/official-docs/docs/user/develop/practice/dynamic-cordis.zh.md +15 -0
  323. package/references/official-docs/docs/user/develop/practice/index.i18n.yaml +2 -2
  324. package/references/official-docs/docs/user/develop/practice/index.md +1 -1
  325. package/references/official-docs/docs/user/develop/practice/index.zh.md +3 -3
  326. package/references/official-docs/docs/user/develop/practice/llm-adapter.i18n.yaml +2 -2
  327. package/references/official-docs/docs/user/develop/practice/llm-adapter.md +4 -3
  328. package/references/official-docs/docs/user/develop/practice/llm-adapter.zh.md +4 -3
  329. package/references/official-docs/docs/user/guide/github-review.i18n.yaml +6 -0
  330. package/references/official-docs/docs/user/guide/github-review.md +102 -0
  331. package/references/official-docs/docs/user/guide/github-review.zh.md +102 -0
  332. package/references/official-docs/docs/user/guide/index.i18n.yaml +2 -2
  333. package/references/official-docs/docs/user/guide/index.md +2 -2
  334. package/references/official-docs/docs/user/guide/index.zh.md +8 -8
  335. package/references/official-docs/docs/user/guide/mcp-memory.i18n.yaml +6 -0
  336. package/references/official-docs/docs/user/guide/mcp-memory.md +101 -0
  337. package/references/official-docs/docs/user/guide/mcp-memory.zh.md +101 -0
  338. package/references/official-docs/docs/user/guide/providers.i18n.yaml +2 -2
  339. package/references/official-docs/docs/user/guide/providers.md +40 -1
  340. package/references/official-docs/docs/user/guide/providers.zh.md +41 -2
  341. package/references/official-docs/docs/user/guide/python-sdk.i18n.yaml +2 -2
  342. package/references/official-docs/docs/user/guide/python-sdk.md +80 -34
  343. package/references/official-docs/docs/user/guide/python-sdk.zh.md +87 -41
  344. package/references/official-docs/docs/user/guide/schedule.i18n.yaml +6 -0
  345. package/references/official-docs/docs/user/guide/schedule.md +21 -0
  346. package/references/official-docs/docs/user/guide/schedule.zh.md +21 -0
  347. package/references/official-docs/docs/web-styling.i18n.yaml +2 -2
  348. package/references/official-docs/docs/web-styling.md +3 -0
  349. package/references/official-docs/docs/web-styling.zh.md +5 -2
  350. package/references/official-docs/packages/AGENTS.md +4 -3
  351. package/references/official-docs/packages/README.md +104 -59
  352. package/references/official-docs/vendor/README.md +1 -0
  353. package/references/official-docs/website-docs.ts +52 -11
  354. package/references/sources.md +2 -2
  355. package/references/website-pages.md +3 -3
  356. package/scripts/download-sources.ps1 +1 -1
  357. package/scripts/sync-official-docs.ps1 +19 -11
  358. package/scripts/verify-kit.ps1 +0 -4
  359. package/templates/js/README.es.md +1 -1
  360. package/templates/js/README.hi.md +1 -1
  361. package/templates/js/README.md +1 -1
  362. package/templates/js/README.pt.md +1 -1
  363. package/templates/js/README.zh.md +1 -1
  364. package/templates/js/package.json +4 -4
  365. package/templates/ts/README.es.md +1 -1
  366. package/templates/ts/README.hi.md +1 -1
  367. package/templates/ts/README.md +1 -1
  368. package/templates/ts/README.pt.md +1 -1
  369. package/templates/ts/README.zh.md +1 -1
  370. package/templates/ts/package.json +4 -4
  371. package/references/official-docs/examples/AGENTS.md +0 -20
@@ -2,33 +2,38 @@
2
2
 
3
3
  [English](session-projection.md) | 中文
4
4
 
5
- 会话投影 seam 是一项[能力 seam](../capability-seams.md):领域 host 插件经由它向客户端载体供给按会话的日志派生状态的当前全量值;三方分别是 Service Definition 与注册表([dsh-session-projection](../../packages/session/session-projection),`ctx.sessionProjections`)、领域贡献方(每个领域注册一个纯单元)与载体([dsh-host-apiproxy](../../packages/host/apiproxy) 的历史尾页与 `session/projection` 推送帧)。它是一项可选能力,不属于 agent loop(智能体循环)主干。框架负责驱动,领域负责计算:注册表只订阅一次 `session/event`,并把每个已提交事件折叠进每个单元;领域不持有任何订阅,客户端也从不折叠领域事件——它们收到的是成品值。设计权威:[session-projection RFC](../../.agents/notes/proposed/architecture/2026-07-27-session-projection-and-command-log.md);驱动、缓存与变更流约定:[包 README](../../packages/session/session-projection/README.md)。
5
+ 会话投影 seam 是一项[能力 seam](../capability-seams.zh.md):领域 host 插件经由它向客户端载体供给按会话的日志派生状态的当前全量值;三方分别是 Service Definition 与注册表([dsh-session-projection](../../packages/session/session-projection),`ctx.sessionProjections`)、领域贡献方(每个领域注册一个纯单元)与载体([dsh-session-controller](../../packages/api/session-controller) 的历史尾页与 `session/projection` 推送帧)。它是一项可选能力,不属于 agent loop(智能体循环)主干。框架负责驱动,领域负责计算:注册表只订阅一次 `session/event`,并把每个已提交事件折叠进每个单元;领域不持有任何订阅,客户端也从不折叠领域事件——它们收到的是成品值。设计权威:[session-projection RFC](../../.agents/notes/proposed/architecture/2026-07-27-session-projection-and-command-log.zh.md);驱动、缓存与变更流约定:[包 README](../../packages/session/session-projection/README.zh.md)。
6
6
 
7
7
  源码:[`packages/session/session-projection/src/index.ts`](../../packages/session/session-projection/src/index.ts)
8
8
 
9
9
  ## 投影单元
10
10
 
11
- `SessionProjectionMap` 是整条链路(host 侧单元、协议块、客户端钩子)的 merge-extensible 类型表;值是协议层 JSON 全量值,渲染归 slot 体系管,永远不归本层。领域为每个 key 贡献一个 `ProjectionDefinition`:
11
+ `SessionProjectionStateMap` host 侧折叠状态的 merge-extensible 类型表,`SessionProjectionMap` 则继续表示客户端可见的全量值。领域为每个状态 key 贡献一个 `ProjectionDefinition`;`wire` 块使该 key 对客户端可见,渲染归 slot 体系管,永远不归本层:
12
12
 
13
13
  ```ts type-equiv
14
14
  /**
15
- * One domain's state-driven computation unit: three pure synchronous
16
- * functions plus declarations — never an opaque getter. The framework drives
15
+ * One domain's state-driven computation unit: a pure synchronous fold plus
16
+ * declarations and an optional client view — never an opaque getter. The framework drives
17
17
  * `apply` on every committed session event; the domain holds no
18
- * subscriptions and owns only the mathematics. All three functions MUST be
19
- * synchronous (an async unit would tear the carriers' consistency cut) and
18
+ * subscriptions and owns only the computation. All functions MUST be
19
+ * synchronous (an async unit would tear the carriers' consistency cut), and
20
20
  * `state` MUST be plain JSON (the persisted-cache precondition).
21
21
  */
22
- interface ProjectionDefinition<K extends keyof SessionProjectionMap, S> {
23
- /** The projection key this unit owns (its `SessionProjectionMap` entry). */
22
+ interface ProjectionDefinition<
23
+ K extends keyof SessionProjectionStateMap,
24
+ S extends SessionProjectionStateMap[K] = SessionProjectionStateMap[K],
25
+ > {
26
+ /** The projection key this unit owns (its `SessionProjectionStateMap` entry). */
24
27
  key: K
25
- /** Validates the wire payload (`view` output) before it leaves the host. */
26
- schema: ZodType<SessionProjectionMap[K]>
28
+ /** Validates persisted state before it seeds a fold. */
29
+ stateSchema: ZodType<S>
27
30
  /**
28
- * State for the empty log.
31
+ * State for the empty log and its immutable Session metadata.
32
+ * @param header - immutable metadata for the Session being projected.
33
+ * @param inheritedEventCount - exact fork-inherited prefix length.
29
34
  * @returns the initial state.
30
35
  */
31
- init(): S
36
+ init(header: SessionHeader, inheritedEventCount: SessionLogOffset): NoInfer<S>
32
37
  /**
33
38
  * Pure transition: previous state + one committed event → next state. A
34
39
  * unit uninterested in an event MUST return the same state reference — an
@@ -37,13 +42,21 @@ interface ProjectionDefinition<K extends keyof SessionProjectionMap, S> {
37
42
  * @param event - the next committed session event.
38
43
  * @returns the next state (same reference when the event is not the unit's).
39
44
  */
40
- apply(state: S, event: SessionEvent): S
41
- /**
42
- * State wire payload (the read-side projection).
43
- * @param state - the current state.
44
- * @returns the whole current value for this unit's key.
45
- */
46
- view(state: S): SessionProjectionMap[K]
45
+ apply(state: NoInfer<S>, event: SessionEvent): NoInfer<S>
46
+ /** Client view. Omit for host-only units. */
47
+ wire?: K extends keyof SessionProjectionMap ? {
48
+ /** Validates the wire payload before it leaves the host. */
49
+ viewSchema: ZodType<SessionProjectionMap[K]>
50
+ /**
51
+ * State → wire payload (the read-side projection). The live drive keeps
52
+ * the two latest raw results and compares them with `Object.is`; an
53
+ * object-valued view must reuse its reference to suppress publication
54
+ * across internal-only state changes.
55
+ * @param state - the current state.
56
+ * @returns the whole current value for this unit's key.
57
+ */
58
+ view(state: NoInfer<S>): SessionProjectionMap[K]
59
+ } : never
47
60
  /**
48
61
  * Persisted-cache invalidation version: bump whenever the serialized state fields or the
49
62
  * fold semantics change, so persisted `(sessionId, key, ver, seq, val)`
@@ -60,37 +73,37 @@ interface ProjectionDefinition<K extends keyof SessionProjectionMap, S> {
60
73
 
61
74
  ```ts type-equiv
62
75
  /**
63
- * One consistent read cut over every registered unit for one session.
76
+ * One consistent read cut over every registered client-visible unit for one session.
64
77
  * `asOfSeq` is the shared watermark — the seq of the last event every value
65
- * reflects (`-1` for an empty log, mirroring `session/subscribed.lastSeq`).
78
+ * reflects (`-1` for an empty log).
66
79
  */
67
80
  interface ProjectionSnapshot {
68
81
  /** Seq of the last event the values reflect; -1 for an empty log. */
69
- asOfSeq: number
70
- /** Whole current value per registered key. */
82
+ asOfSeq: SessionSeqCursor
83
+ /** Whole current client value per registered key. */
71
84
  values: Partial<SessionProjectionMap>
72
85
  }
73
86
  ```
74
87
 
75
88
  ```ts type-equiv
76
89
  /**
77
- * Change-feed listener: one unit's value changed for one session. `value` is
78
- * the schema-validated `view` output; `seq` is the unit's watermark at
79
- * emission (the seq of the event that caused the change).
90
+ * Change-feed listener: one unit's raw `view` result changed by `Object.is`
91
+ * for one session. `value` is the schema-validated output; `seq` is the
92
+ * unit's watermark at emission (the seq of the event that caused the change).
80
93
  */
81
94
  type ProjectionChangeListener = (
82
95
  session: Session,
83
96
  key: Extract<keyof SessionProjectionMap, string>,
84
97
  value: unknown,
85
- seq: number,
98
+ seq: SessionSeq,
86
99
  ) => void
87
100
  ```
88
101
 
89
- `snapshot(session)` 完全同步:载体在切出页面切片的同一 tick 内读取它,因此 `asOfSeq` 使两次读取使用同一个序号。每个值在返回前都会通过其单元的 schema 校验;如果 `view` 被误写为异步函数,它会返回 Promise,schema 校验将拒绝该值。对于每个已提交事件,变更流会为每个状态*引用*已变化的单元触发一次;状态未变时,`apply` 必须返回同一引用。
102
+ `snapshot(session)` 完全同步:载体在切出页面切片的同一 tick 内读取它,因此 `asOfSeq` 使两次读取使用同一个序号。它只返回客户端视图,并在返回前通过各单元的 `viewSchema` 校验。`stateOf(session, key)` 可在不计算无关视图的情况下读取一份实时 host 状态;调用方不得修改这一借用引用。state 引用变化时,注册表计算并缓存一次原始 view;只有该结果通过 `Object.is` 判定为变化时才触发变更流,对象 view 若要在仅内部 state 变化时抑制发布就必须保留引用。
90
103
 
91
104
  ## 注册表:`ctx.sessionProjections`
92
105
 
93
- `SessionProjectionRegistry`([签名](#ctxsessionprojections--sessionprojectionregistry))拥有驱动权:一份 `session/event` 订阅、对每个已注册单元即时调用 `apply`,以及每会话每单元的水位线(watermark)cell。cell 惰性构建:在事件流过之后才注册的单元,或比注册表更早的会话,都在首次触达(事件或读取)时从 `init` 出发在内存日志上折叠。注册是一个 effect,其 disposer 随调用方 fiber 走:领域插件卸载后,其 key(连同缓存的 cell)从后续驱动与快照中消失,客户端将其读作能力缺失;key 重复直接 throw。领域插件在 `ctx.inject(['sessionProjections'], …)` 下注册,因此不带注册表的 headless 组装完全不受影响。
106
+ `SessionProjectionRegistry`([签名](#ctxsessionprojections--sessionprojectionregistry))拥有驱动权:一份 `session/event` 订阅、对每个已注册单元即时调用 `apply`,以及每会话每单元的水位线(watermark)cell。cell 惰性构建:在事件流过之后才注册的单元,或比注册表更早的会话,都在首次触达(事件或读取)时从 `init` 出发在内存日志上折叠。注册是一个 effect,其 disposer 随调用方 fiber 走:领域插件卸载后,其 key(连同缓存的 cell)从后续驱动与快照中消失,客户端将其读作能力缺失;key 以不同 `stateVersion` 重复时直接 throw,同版本注册方则共享一个单元并被计数。领域插件在 `ctx.inject(['sessionProjections'], …)` 下注册,因此不带注册表的 headless 组装完全不受影响。
94
107
 
95
108
  <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
96
109
 
@@ -98,63 +111,79 @@ type ProjectionChangeListener = (
98
111
 
99
112
  ## Cordis API
100
113
 
101
- Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnpm run verify-cordis-catalog` in doc-sync; regenerate with `pnpm run gen-cordis-catalog`) — this section is byte-identical in both language sides of the page. Signature blocks use a `ts cordis-catalog` fence and keep the original source JSDoc; dispatch modes are defined in the [primer](../cordis-primer.md#dispatch-modes), and the framework-inherited `ctx` API lives in [cordis-api/inherited.md](../cordis-api/inherited.md).
114
+ Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnpm run verify-cordis-catalog` in doc-sync; regenerate with `pnpm run gen-cordis-catalog`) — the language sides differ only in locale-specific paired document paths. Signature blocks use a `ts cordis-catalog` fence and keep the original source JSDoc; dispatch modes are defined in the [primer](../cordis-primer.zh.md#dispatch-modes), and the framework-inherited `ctx` API lives in [cordis-api/inherited.md](../cordis-api/inherited.md).
102
115
 
103
116
  <a id="ctxsessionprojectioncache--sessionprojectioncache"></a>
104
117
 
105
118
  ### `ctx.sessionProjectionCache` — `SessionProjectionCache`
106
119
 
107
- 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.
120
+ 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.
108
121
 
109
122
  ```ts cordis-catalog
110
123
  /**
111
124
  * The zero-I/O listing read: whole values viewed straight from the stored
112
- * rows (version-matching keys only), each cut carried with its watermark
113
- * so a client value store can seed under its higher-seq-wins rule — as
114
- * stale as the last durable checkpoint but never wrong, and never from an
125
+ * rows (version-matching keys only), each cut carried with its watermark so
126
+ * a client value store can seed under its higher-seq-wins rule — as stale
127
+ * as the last durable checkpoint but never wrong, and never from an
115
128
  * unrelated log (the caller's header is the identity witness). Fresher
116
- * paths (the history tail baseline, {@link coldSnapshot}) supersede these
117
- * values whenever a session is actually opened.
129
+ * paths (the history tail baseline) supersede these values whenever a
130
+ * session is actually opened.
118
131
  * @param meta - the listed session's header (identity witness; no log read).
132
+ * @param inheritedEventCount - exact inherited prefix length that completes
133
+ * the checkpoint identity.
134
+ * @param keys - optional projection keys required by the caller's audience.
119
135
  * @returns the cut (`asOfSeq` = lowest served-row watermark), or
120
136
  * `undefined` when no usable row exists for this lifecycle.
121
137
  */
122
- cachedSnapshot(meta: SessionHeader): ProjectionSnapshot | undefined
138
+ cachedSnapshot( meta: SessionHeader, inheritedEventCount: SessionLogOffset, keys?: readonly Extract<keyof SessionProjectionMap, string>[], ): ProjectionSnapshot | undefined
139
+
140
+ /**
141
+ * Hydrate projection cells for an already-prepared Session without another
142
+ * persistence read. The cache seeds matching rows; the supplied exact log
143
+ * advances every unit to the observation cut. No checkpoint is written
144
+ * because the logical observation may contain recovery events not yet durable.
145
+ * @param session - exact unpublished Session retained by persistence.
146
+ * @param events - exact logical event prefix represented by the observation.
147
+ * @returns all projection values at the event cut.
148
+ */
149
+ hydratePrepared( session: Session, events: readonly SessionEvent[], ): ProjectionSnapshot
123
150
 
124
151
  /**
125
- * Durably checkpoint one live session NOW (both mandatory points call
152
+ * Durably checkpoint one live session NOW (all mandatory points call
126
153
  * this; tests and carriers may too). The registry cut is snapshotted at
127
- * this boundary (states are live references), then the whole record is
128
- * replaced. NOT fail-soft — callers on the fail-soft paths contain it.
154
+ * this boundary (states are live references), then the session's record is
155
+ * replaced on the domain's write chain. NOT fail-soft — callers on the
156
+ * fail-soft paths contain it.
129
157
  * @param session - the live session to checkpoint.
130
158
  * @returns resolution after durability and event emission.
131
159
  */
132
160
  async write(session: Session): Promise<void>
133
161
 
134
162
  /**
135
- * Cold-read one persisted session's projections with zero full-log load:
136
- * cached rows + a persistence `readFrom` tail from the registry's restore
137
- * floor, refolded by the registry and written back (fail-soft) so the next
138
- * cold read starts closer. A cache row invalidated by a shrunk log
139
- * (crash-repair truncation) triggers one full re-read from seq 0 the
140
- * ladder's slow rung, still no crash. Rejects when the session has no
141
- * persisted log (`not found` from the persistence seam).
142
- * @param id - the persisted session to read.
143
- * @param signal - optional cancellation for the persistence reads.
144
- * @returns the snapshot cut at the stored log end.
163
+ * Cold-read one session's projections from its complete log. Each unit is
164
+ * seeded from the identity-checked cached rows the registry skips `apply`
165
+ * for the already-folded prefix (events at or below the row's `seq`) and
166
+ * the refreshed checkpoint is written back (fail-soft, fire-and-forget), so
167
+ * the first cold read creates the cache row and later ones seed from it.
168
+ * The caller supplies the complete log in seq order: this service never
169
+ * consults the persistence layer.
170
+ * @param meta - the stored session header (identity witness).
171
+ * @param inheritedEventCount - exact inherited prefix length for projection initialization and identity.
172
+ * @param events - the session's complete log, in seq order.
173
+ * @returns the projection cut at the log end.
145
174
  */
146
- async coldSnapshot(id: SessionId, signal?: AbortSignal): Promise<ProjectionSnapshot>
175
+ coldSnapshot( meta: SessionHeader, inheritedEventCount: SessionLogOffset, events: readonly SessionEvent[], ): ProjectionSnapshot
147
176
  ```
148
177
 
149
- Types: [Session](session.md) · [SessionHeader](persistence.md) · [SessionId](core.md)
178
+ Types: [Session](session.zh.md) · [SessionEvent](session.zh.md) · [SessionHeader](persistence.zh.md) · [SessionLogOffset](session.zh.md)
150
179
 
151
- Source: [`packages/session/session-projection-cache/src/index.ts:71`](../../packages/session/session-projection-cache/src/index.ts)
180
+ Source: [`packages/session/session-projection-cache/src/index.ts`](../../packages/session/session-projection-cache/src/index.ts)
152
181
 
153
182
  <a id="ctxsessionprojections--sessionprojectionregistry"></a>
154
183
 
155
184
  ### `ctx.sessionProjections` — `SessionProjectionRegistry`
156
185
 
157
- `ctx.sessionProjections`: the projection unit table and its drive. The service subscribes to `session/event` once; every committed event passes every registered unit's `apply` (eager drive), and a changed state reference notifies the change feed with the schema-validated view. Cells build lazily — a unit registered after events flowed, or a session older than the registry, folds `init` over the in-memory log on first touch (event or read). Registration is an effect (disposer rides the calling fiber): an unloaded domain plugin's key disappears from snapshots and clients read it as capability absence. Domain plugins register under `ctx.inject(['sessionProjections'], …)` so headless assemblies without the registry stay unaffected. Registrants sharing a key share one unit and are counted: the same tool package mounted in N agent presets registers N times, and the key survives until the last one unloads.
186
+ `ctx.sessionProjections`: the projection unit table and its drive. The service subscribes to `session/event` once; every committed event passes every registered unit's `apply` (eager drive). A changed state reference computes the next client view; the change feed is notified only when its raw result changes by `Object.is`. Cells build lazily — a unit registered after events flowed, or a session older than the registry, folds `init` over the in-memory log on first touch (event or read). Registration is an effect (disposer rides the calling fiber): an unloaded domain plugin's key disappears from snapshots and clients read it as capability absence. A host reader either declares `sessionProjections` in its plugin `inject` or fails explicitly when the registry or required key is absent. Contributors may preserve optional registration through `ctx.inject(['sessionProjections'], ...)`. Registrants sharing a key share one unit and are counted: the same tool package mounted in N agent presets registers N times, and the key survives until the last one unloads.
158
187
 
159
188
  ```ts cordis-catalog
160
189
  /**
@@ -165,28 +194,57 @@ Source: [`packages/session/session-projection-cache/src/index.ts:71`](../../pack
165
194
  * @param definition - key, state schema, pure unit functions, and stateVersion.
166
195
  * @returns the exact disposer that unregisters this unit.
167
196
  */
168
- register<K extends keyof SessionProjectionMap, S>(definition: ProjectionDefinition<K, S>): () => void
197
+ register< K extends keyof SessionProjectionMap, S extends SessionProjectionStateMap[K], >( definition: Omit<ProjectionDefinition<K, S>, 'wire'> & { wire: NonNullable<ProjectionDefinition<K, S>['wire']> }, ): () => void
198
+
199
+ /**
200
+ * Register one host-only unit. Its state is omitted from client snapshots
201
+ * and always checkpointed like every other unit.
202
+ * @param definition - key, state schema, pure unit functions, and stateVersion.
203
+ * @returns the exact disposer that unregisters this unit.
204
+ */
205
+ register< K extends Exclude<keyof SessionProjectionStateMap, keyof SessionProjectionMap>, S extends SessionProjectionStateMap[K], >( definition: Omit<ProjectionDefinition<K, S>, 'wire'>, ): () => void
169
206
 
170
207
  /**
171
208
  * Subscribe to the change feed. The registration is an effect on the
172
209
  * calling context's fiber.
173
- * @param listener - called once per unit whose state reference changed, per committed event.
210
+ * @param listener - called once per client-visible unit whose raw view changed by `Object.is`, per committed event.
174
211
  * @returns the exact disposer that unsubscribes.
175
212
  */
176
213
  onChanged(listener: ProjectionChangeListener): () => void
177
214
 
178
215
  /**
179
- * One consistent cut over every registered unit for one session, read from
216
+ * Read one unit's current host state after materializing every registered
217
+ * unit at the Session cursor. Unrelated wire views are not produced.
218
+ * The returned value is live; callers must not mutate it.
219
+ * @param session - the session whose state is read.
220
+ * @param key - the registered unit key.
221
+ * @returns current state, or `undefined` when the key is not registered.
222
+ */
223
+ stateOf<K extends keyof SessionProjectionStateMap>( session: Session, key: K, ): SessionProjectionStateMap[K] | undefined
224
+
225
+ /**
226
+ * One consistent cut over every registered client-visible unit for one session, read from
180
227
  * the watermark cache (missing cells fold lazily over the in-memory log).
181
228
  * Fully synchronous — every value and `asOfSeq` reflect the same log
182
- * position. Each value passes its unit's schema before leaving.
229
+ * position. Each value passes its unit's `viewSchema` before leaving.
183
230
  * @param session - the session whose projection values are read.
184
- * @returns the snapshot; `values` is empty when no unit is registered.
231
+ * @param keys - optional client-visible outputs; state materialization remains complete.
232
+ * @returns the snapshot; `values` is empty when no selected client-visible unit is registered.
185
233
  */
186
- snapshot(session: Session): ProjectionSnapshot
234
+ snapshot( session: Session, keys?: readonly Extract<keyof SessionProjectionMap, string>[], ): ProjectionSnapshot
187
235
 
188
236
  /**
189
- * State-level checkpoint of every registered unit for one session, read
237
+ * Read only already-materialized client-visible cells without folding history.
238
+ * Values may trail the live Session and are therefore hints, not a complete
239
+ * baseline. Missing cells are omitted.
240
+ * @param session - attached Session whose cached cells are inspected.
241
+ * @param keys - optional wire keys to view.
242
+ * @returns the lowest common cached cut, or `undefined` when no wire cell exists.
243
+ */
244
+ cachedSnapshot( session: Session, keys?: readonly Extract<keyof SessionProjectionMap, string>[], ): ProjectionSnapshot | undefined
245
+
246
+ /**
247
+ * State-level checkpoint of every persisted unit for one session, read
190
248
  * from the watermark cache (missing cells fold lazily over the in-memory
191
249
  * log). This is the write side of the persisted projection cache: the
192
250
  * returned rows are the `(key → {ver, seq, val})` part of the durable
@@ -197,7 +255,7 @@ snapshot(session: Session): ProjectionSnapshot
197
255
  * every subsequent snapshot and frame through it (plain JSON by the unit
198
256
  * contract, so the clone is total).
199
257
  * @param session - the session whose unit states are checkpointed.
200
- * @returns one row per registered key; empty when no unit is registered.
258
+ * @returns one row per registered key.
201
259
  */
202
260
  checkpoint(session: Session): ProjectionCheckpoint
203
261
 
@@ -213,30 +271,31 @@ checkpoint(session: Session): ProjectionCheckpoint
213
271
  * yields an end below every watermark and the restore rejects for a full
214
272
  * re-read.
215
273
  * @param checkpoint - persisted rows for one session (possibly stale or empty).
216
- * @returns the seq to hand the persistence `readFrom`, or `undefined`
217
- * when no unit is registered (no read needed — {@link restore} would
218
- * serve empty values regardless).
274
+ * @returns the offset for the stored-log suffix read (`SessionHandle.read`),
275
+ * or `undefined` when no unit is registered (no read needed —
276
+ * {@link restore} would serve empty values regardless).
219
277
  */
220
- restoreFloor(checkpoint: ProjectionCheckpoint): number | undefined
278
+ restoreFloor(checkpoint: ProjectionCheckpoint): SessionLogOffset | undefined
221
279
 
222
280
  /**
223
281
  * View a checkpoint's rows without any log read: for every registered
224
- * unit whose row's `ver` matches, serve the schema-validated
225
- * `view` of the stored state; mismatched or absent rows leave their key
282
+ * client-visible unit whose row's `ver` matches, serve the schema-validated
283
+ * `view` of the schema-validated stored state; mismatched, malformed, or absent rows leave their key
226
284
  * absent (a cold or listing consumer treats it as not-yet-available and a
227
285
  * fuller read path refolds it). The zero-I/O rung of the read ladder —
228
286
  * values are as stale as their rows, never wrong.
229
287
  * @param checkpoint - persisted rows for one session (possibly stale or empty).
288
+ * @param keys - optional wire keys to view.
230
289
  * @returns whole values per key with a usable row; empty when none.
231
290
  */
232
- viewCheckpoint(checkpoint: ProjectionCheckpoint): Partial<SessionProjectionMap>
291
+ viewCheckpoint( checkpoint: ProjectionCheckpoint, keys?: readonly Extract<keyof SessionProjectionMap, string>[], ): Partial<SessionProjectionMap>
233
292
 
234
293
  /**
235
- * Cold read: fold every registered unit over a stored log suffix, seeding
294
+ * Cold read: fold every persisted unit over a stored log suffix, seeding
236
295
  * each from its checkpoint row when usable — the one read recipe (cached
237
296
  * state + forward tail replay + `view`) applied without a live `Session`.
238
- * Call with the events returned by a persistence
239
- * `readFrom(id, restoreFloor(checkpoint))` and that same floor as
297
+ * Call with the stored events at or past `restoreFloor(checkpoint)` (a
298
+ * `SessionHandle.read` slice) and that same floor as
240
299
  * `baseSeq`; the floor's one-below anchor makes the supplied end honest,
241
300
  * so a shrunk log is detected here. A row is usable iff its
242
301
  * `ver` matches the live unit's `stateVersion`, it does not predate `baseSeq`
@@ -249,14 +308,28 @@ viewCheckpoint(checkpoint: ProjectionCheckpoint): Partial<SessionProjectionMap>
249
308
  * @param checkpoint - persisted rows for one session (possibly stale or empty).
250
309
  * @param events - the stored events with `seq >= baseSeq`, in seq order.
251
310
  * @param baseSeq - the seq `events` starts at (its first event's seq when non-empty).
311
+ * @param header - immutable metadata for the Session being restored.
312
+ * @param inheritedEventCount - exact fork-inherited prefix length supplied to unit initialization.
252
313
  * @returns the snapshot cut at the supplied log end (`asOfSeq` is the last
253
314
  * supplied event's seq, `baseSeq - 1` for an empty tail) plus the
254
315
  * refreshed checkpoint rows at that cut, ready for a durable write-back.
255
316
  */
256
- restore(checkpoint: ProjectionCheckpoint, events: readonly SessionEvent[], baseSeq: number): { snapshot: ProjectionSnapshot; checkpoint: ProjectionCheckpoint }
317
+ restore( checkpoint: ProjectionCheckpoint, events: readonly SessionEvent[], baseSeq: SessionLogOffset, header: SessionHeader, inheritedEventCount: SessionLogOffset, ): { snapshot: ProjectionSnapshot; checkpoint: ProjectionCheckpoint }
318
+
319
+ /**
320
+ * Restore an exact cut and install its states on the supplied prepared Session.
321
+ * A later publication reuses these cells; ordinary live reads and event drive
322
+ * advance any constructor-owned suffix exactly once.
323
+ * @param session - exact prepared Session that owns the restored log prefix.
324
+ * @param checkpoint - persisted rows for this Session lifecycle.
325
+ * @param events - exact events at the observation cut.
326
+ * @param baseSeq - first supplied event sequence.
327
+ * @returns all projection values at the supplied cut.
328
+ */
329
+ hydrate( session: Session, checkpoint: ProjectionCheckpoint, events: readonly SessionEvent[], baseSeq: SessionLogOffset, ): ProjectionSnapshot
257
330
  ```
258
331
 
259
- Types: [Session](session.md) · [SessionEvent](session.md)
332
+ Types: [Session](session.zh.md) · [SessionEvent](session.zh.md) · [SessionHeader](persistence.zh.md) · [SessionLogOffset](session.zh.md)
260
333
 
261
- Source: [`packages/session/session-projection/src/index.ts:171`](../../packages/session/session-projection/src/index.ts)
334
+ Source: [`packages/session/session-projection/src/index.ts`](../../packages/session/session-projection/src/index.ts)
262
335
  <!-- END GENERATED cordis-surface -->
@@ -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 docs/subsystems/session-query.md
5
- session-query.md: 6ddde5b8a19ebc65952b5a24003c48f55ff5a244
6
- session-query.zh.md: b7d4ab4910c99c9f77c17f0279f2d4fd3c336659
5
+ session-query.md: 1cf3dff325db76485a0afca4ca1a882a4ff175b8
6
+ session-query.zh.md: 2b8504dfb9ec8ee25d925135dbc99fa7beaede98
@@ -22,7 +22,7 @@ interface SessionRecord {
22
22
  header: SessionHeader
23
23
  /** Whether the id currently exists in `ctx.sessions`. */
24
24
  live: boolean
25
- /** Whether the active persistence backend currently materializes the id. */
25
+ /** Whether the active persistence backend currently lists the id, including a created-but-unmaterialized session it already observes. */
26
26
  persisted: boolean
27
27
  }
28
28
  ```
@@ -34,7 +34,9 @@ interface SessionRecord {
34
34
  interface SessionLogSnapshot {
35
35
  /** Cloned session header selected from the same observation as `events`. */
36
36
  session: SessionHeader
37
- /** Cloned contiguous raw events after persistence repair and replay validation. */
37
+ /** Exact number of fork-inherited events in the observed log. */
38
+ inheritedEventCount: SessionLogOffset
39
+ /** Cloned contiguous raw events after in-memory interrupted-turn balancing and replay validation. */
38
40
  events: SessionEvent[]
39
41
  }
40
42
  ```
@@ -44,8 +46,10 @@ interface SessionLogSnapshot {
44
46
  interface SessionSurfaceSnapshot {
45
47
  /** Cloned session header selected from the same corpus observation as `events`. */
46
48
  session: SessionHeader
49
+ /** Exact number of fork-inherited events in the observed log. */
50
+ inheritedEventCount: SessionLogOffset
47
51
  /** Highest raw-log seq included in the observation, or `null` for an empty log. */
48
- capturedThroughSeq: number | null
52
+ capturedThroughSeq: OptionalSessionSeq
49
53
  /** Cloned current surface events in model-history order. */
50
54
  events: SurfaceEvent[]
51
55
  }
@@ -90,7 +94,7 @@ interface SessionEventRecord {
90
94
  /** Session that owns the event. */
91
95
  sessionId: SessionId
92
96
  /** Monotonic event seq within the session. */
93
- seq: number
97
+ seq: SessionSeq
94
98
  /** Discriminant of the session event. */
95
99
  type: SessionEventType
96
100
  /** Event timestamp in Unix epoch milliseconds. */
@@ -138,7 +142,7 @@ interface SessionEventSearchDocument extends SessionEventRecord {
138
142
  }
139
143
  ```
140
144
 
141
- `ctx.sessionQuery.filterSessions(filters)` applies `SessionResultFilter` to the complete logical corpus; `ctx.sessionQuery.filterEvents(sessionId, filters)` returns matching documents in ascending seq order. Messages, reasoning, tool calls/results, blocked prompts, todos, and failure/status detail contribute semantic text; structural events and stream chunks do not.
145
+ `ctx.sessionQuery.filterSessions(filters)` applies `SessionResultFilter` to the complete logical corpus; `ctx.sessionQuery.filterEvents(sessionId, filters)` returns matching documents in ascending seq order. Messages, tool calls/results, todos, and failure/status detail contribute semantic text; reasoning blocks, blocked prompts, structural events, and stream chunks do not.
142
146
 
143
147
  ## Full-text search pages
144
148
 
@@ -266,7 +270,7 @@ interface SessionEventReadRequest {
266
270
  /** Session that owns the target event. */
267
271
  sessionId: SessionId
268
272
  /** Target event seq. */
269
- seq: number
273
+ seq: SessionSeq
270
274
  /** Number of preceding raw events to include. */
271
275
  before?: number
272
276
  /** Number of following raw events to include. */
@@ -279,14 +283,16 @@ interface SessionEventReadRequest {
279
283
  interface SessionEventWindow {
280
284
  /** Cloned header for the live-preferred source read. */
281
285
  session: SessionHeader
286
+ /** Exact number of fork-inherited events in the observed log. */
287
+ inheritedEventCount: SessionLogOffset
282
288
  /** Full cloned target event. */
283
289
  target: SessionEvent
284
290
  /** Full cloned events from `startSeq` through `endSeq`. */
285
291
  events: SessionEvent[]
286
292
  /** First seq included in `events`. */
287
- startSeq: number
293
+ startSeq: SessionSeq
288
294
  /** Last seq included in `events`. */
289
- endSeq: number
295
+ endSeq: SessionSeq
290
296
  }
291
297
  ```
292
298
 
@@ -300,7 +306,7 @@ interface SessionEventTraceRequest {
300
306
  /** Session that owns the target event. */
301
307
  sessionId: SessionId
302
308
  /** Target event seq. */
303
- seq: number
309
+ seq: SessionSeq
304
310
  }
305
311
  ```
306
312
 
@@ -310,15 +316,15 @@ interface SessionEventTrace {
310
316
  /** Lightweight target record. */
311
317
  target: SessionEventRecord
312
318
  /** Immediate positional replacement event, when the target was shadowed. */
313
- replacedBy?: number
319
+ replacedBy?: SessionSeq
314
320
  /** Positional replacers from the immediate replacement to the final replacement. */
315
- replacementChain: number[]
321
+ replacementChain: SessionSeq[]
316
322
  /** Surface nodes directly removed when the target itself performed a replacement. */
317
- replacedEventSeqs: number[]
323
+ replacedEventSeqs: SessionSeq[]
318
324
  /** Earlier events cited directly as sources, in their recorded order. */
319
- sourceEventSeqs: number[]
325
+ sourceEventSeqs: SessionSeq[]
320
326
  /** Later events that directly cite the target as a source, in log order. */
321
- derivedEventSeqs: number[]
327
+ derivedEventSeqs: SessionSeq[]
322
328
  }
323
329
  ```
324
330
 
@@ -362,7 +368,7 @@ type SessionQueryErrorCode =
362
368
 
363
369
  ## Cordis API
364
370
 
365
- Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnpm run verify-cordis-catalog` in doc-sync; regenerate with `pnpm run gen-cordis-catalog`) — this section is byte-identical in both language sides of the page. Signature blocks use a `ts cordis-catalog` fence and keep the original source JSDoc; dispatch modes are defined in the [primer](../cordis-primer.md#dispatch-modes), and the framework-inherited `ctx` API lives in [cordis-api/inherited.md](../cordis-api/inherited.md).
371
+ Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnpm run verify-cordis-catalog` in doc-sync; regenerate with `pnpm run gen-cordis-catalog`) — the language sides differ only in locale-specific paired document paths. Signature blocks use a `ts cordis-catalog` fence and keep the original source JSDoc; dispatch modes are defined in the [primer](../cordis-primer.md#dispatch-modes), and the framework-inherited `ctx` API lives in [cordis-api/inherited.md](../cordis-api/inherited.md).
366
372
 
367
373
  <a id="ctxsessionquery--sessionqueryengine-abstract-seam"></a>
368
374
 
@@ -373,6 +379,14 @@ Unified live-preferred session query service.
373
379
  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.
374
380
 
375
381
  ```ts cordis-catalog
382
+ /**
383
+ * Observe one exact live or prepared Session without a persistence listing preflight.
384
+ * @param sessionId - logical Session identity.
385
+ * @param options - cancellation and projection selection for this read.
386
+ * @returns a caller-owned observation lease.
387
+ */
388
+ observeSession( sessionId: SessionId, options: SessionObservationOptions = {}, ): Promise<SessionObservation>
389
+
376
390
  /**
377
391
  * Search the live-preferred logical corpus and group by session.
378
392
  * @param request - query text, metadata filters, page size, and cursor.
@@ -491,5 +505,5 @@ async readEvent(request: SessionEventReadRequest, signal?: AbortSignal): Promise
491
505
 
492
506
  Types: [SessionId](core.md) · [SessionTitleSnapshot](session-title.md)
493
507
 
494
- Source: [`packages/session-query/session-query/src/index.ts:81`](../../packages/session-query/session-query/src/index.ts)
508
+ Source: [`packages/session-query/session-query/src/index.ts`](../../packages/session-query/session-query/src/index.ts)
495
509
  <!-- END GENERATED cordis-surface -->