dsh-plugin-guide 0.1.0

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 (374) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE.md +26 -0
  3. package/README.es.md +139 -0
  4. package/README.hi.md +138 -0
  5. package/README.md +165 -0
  6. package/README.pt.md +139 -0
  7. package/README.zh-CN.md +164 -0
  8. package/SKILL.md +69 -0
  9. package/cordis.patch.yml +4 -0
  10. package/guide/links.md +92 -0
  11. package/guide/plugin-dev-guide.md +429 -0
  12. package/guide/quick-reference.es.md +176 -0
  13. package/guide/quick-reference.hi.md +176 -0
  14. package/guide/quick-reference.md +176 -0
  15. package/guide/quick-reference.pt.md +176 -0
  16. package/guide/quick-reference.zh-CN.md +175 -0
  17. package/index.js +58 -0
  18. package/package.json +83 -0
  19. package/references/community-ecosystem.md +201 -0
  20. package/references/community-repo-deep-dive.md +695 -0
  21. package/references/cordis-paper-and-community.md +326 -0
  22. package/references/harness-repo.md +654 -0
  23. package/references/official-docs/AGENTS.md +149 -0
  24. package/references/official-docs/BENCHMARK.md +3 -0
  25. package/references/official-docs/CLAUDE.md +1 -0
  26. package/references/official-docs/CONTRIBUTING.i18n.yaml +6 -0
  27. package/references/official-docs/CONTRIBUTING.md +23 -0
  28. package/references/official-docs/CONTRIBUTING.zh.md +23 -0
  29. package/references/official-docs/LICENSE +21 -0
  30. package/references/official-docs/README.i18n.yaml +6 -0
  31. package/references/official-docs/README.md +35 -0
  32. package/references/official-docs/README.zh.md +74 -0
  33. package/references/official-docs/SNAPSHOT.md +16 -0
  34. package/references/official-docs/THIRD_PARTY_NOTICES.md +192 -0
  35. package/references/official-docs/docs/AGENTS.md +75 -0
  36. package/references/official-docs/docs/agent-lifecycle.i18n.yaml +6 -0
  37. package/references/official-docs/docs/agent-lifecycle.md +82 -0
  38. package/references/official-docs/docs/agent-lifecycle.zh.md +84 -0
  39. package/references/official-docs/docs/api-gateway.i18n.yaml +6 -0
  40. package/references/official-docs/docs/api-gateway.md +164 -0
  41. package/references/official-docs/docs/api-gateway.zh.md +164 -0
  42. package/references/official-docs/docs/architecture.i18n.yaml +6 -0
  43. package/references/official-docs/docs/architecture.md +129 -0
  44. package/references/official-docs/docs/architecture.zh.md +133 -0
  45. package/references/official-docs/docs/capability-seams.i18n.yaml +6 -0
  46. package/references/official-docs/docs/capability-seams.md +471 -0
  47. package/references/official-docs/docs/capability-seams.zh.md +473 -0
  48. package/references/official-docs/docs/config-catalog.i18n.yaml +6 -0
  49. package/references/official-docs/docs/config-catalog.md +3151 -0
  50. package/references/official-docs/docs/config-catalog.zh.md +3152 -0
  51. package/references/official-docs/docs/cookbook/adding-a-conversation-node.i18n.yaml +6 -0
  52. package/references/official-docs/docs/cookbook/adding-a-conversation-node.md +233 -0
  53. package/references/official-docs/docs/cookbook/adding-a-conversation-node.zh.md +233 -0
  54. package/references/official-docs/docs/cookbook/adding-a-package.i18n.yaml +6 -0
  55. package/references/official-docs/docs/cookbook/adding-a-package.md +118 -0
  56. package/references/official-docs/docs/cookbook/adding-a-package.zh.md +118 -0
  57. package/references/official-docs/docs/cookbook/adding-a-tool.i18n.yaml +6 -0
  58. package/references/official-docs/docs/cookbook/adding-a-tool.md +94 -0
  59. package/references/official-docs/docs/cookbook/adding-a-tool.zh.md +96 -0
  60. package/references/official-docs/docs/cookbook/adding-a-vendored-package.i18n.yaml +6 -0
  61. package/references/official-docs/docs/cookbook/adding-a-vendored-package.md +59 -0
  62. package/references/official-docs/docs/cookbook/adding-a-vendored-package.zh.md +59 -0
  63. package/references/official-docs/docs/cookbook/adding-an-llm-adapter.i18n.yaml +6 -0
  64. package/references/official-docs/docs/cookbook/adding-an-llm-adapter.md +43 -0
  65. package/references/official-docs/docs/cookbook/adding-an-llm-adapter.zh.md +43 -0
  66. package/references/official-docs/docs/cookbook/extension-cookbook.i18n.yaml +6 -0
  67. package/references/official-docs/docs/cookbook/extension-cookbook.md +129 -0
  68. package/references/official-docs/docs/cookbook/extension-cookbook.zh.md +131 -0
  69. package/references/official-docs/docs/cookbook/maintaining-dsh-code-review.i18n.yaml +6 -0
  70. package/references/official-docs/docs/cookbook/maintaining-dsh-code-review.md +64 -0
  71. package/references/official-docs/docs/cookbook/maintaining-dsh-code-review.zh.md +64 -0
  72. package/references/official-docs/docs/cookbook/responding-to-pr-review-on-a-stack.i18n.yaml +6 -0
  73. package/references/official-docs/docs/cookbook/responding-to-pr-review-on-a-stack.md +32 -0
  74. package/references/official-docs/docs/cookbook/responding-to-pr-review-on-a-stack.zh.md +32 -0
  75. package/references/official-docs/docs/cordis-api/context.i18n.yaml +6 -0
  76. package/references/official-docs/docs/cordis-api/context.md +364 -0
  77. package/references/official-docs/docs/cordis-api/context.zh.md +366 -0
  78. package/references/official-docs/docs/cordis-api/events.i18n.yaml +6 -0
  79. package/references/official-docs/docs/cordis-api/events.md +207 -0
  80. package/references/official-docs/docs/cordis-api/events.zh.md +209 -0
  81. package/references/official-docs/docs/cordis-api/fiber.i18n.yaml +6 -0
  82. package/references/official-docs/docs/cordis-api/fiber.md +375 -0
  83. package/references/official-docs/docs/cordis-api/fiber.zh.md +377 -0
  84. package/references/official-docs/docs/cordis-api/inherited.md +39 -0
  85. package/references/official-docs/docs/cordis-api/registry.i18n.yaml +6 -0
  86. package/references/official-docs/docs/cordis-api/registry.md +152 -0
  87. package/references/official-docs/docs/cordis-api/registry.zh.md +154 -0
  88. package/references/official-docs/docs/cordis-api/service.i18n.yaml +6 -0
  89. package/references/official-docs/docs/cordis-api/service.md +102 -0
  90. package/references/official-docs/docs/cordis-api/service.zh.md +104 -0
  91. package/references/official-docs/docs/cordis-primer.i18n.yaml +6 -0
  92. package/references/official-docs/docs/cordis-primer.md +44 -0
  93. package/references/official-docs/docs/cordis-primer.zh.md +50 -0
  94. package/references/official-docs/docs/cordis-tutorial/01-first-plugin.i18n.yaml +6 -0
  95. package/references/official-docs/docs/cordis-tutorial/01-first-plugin.md +95 -0
  96. package/references/official-docs/docs/cordis-tutorial/01-first-plugin.zh.md +95 -0
  97. package/references/official-docs/docs/cordis-tutorial/02-lifecycle-and-effects.i18n.yaml +6 -0
  98. package/references/official-docs/docs/cordis-tutorial/02-lifecycle-and-effects.md +98 -0
  99. package/references/official-docs/docs/cordis-tutorial/02-lifecycle-and-effects.zh.md +98 -0
  100. package/references/official-docs/docs/cordis-tutorial/03-services.i18n.yaml +6 -0
  101. package/references/official-docs/docs/cordis-tutorial/03-services.md +98 -0
  102. package/references/official-docs/docs/cordis-tutorial/03-services.zh.md +98 -0
  103. package/references/official-docs/docs/cordis-tutorial/04-events.i18n.yaml +6 -0
  104. package/references/official-docs/docs/cordis-tutorial/04-events.md +144 -0
  105. package/references/official-docs/docs/cordis-tutorial/04-events.zh.md +144 -0
  106. package/references/official-docs/docs/cordis-tutorial/05-config.i18n.yaml +6 -0
  107. package/references/official-docs/docs/cordis-tutorial/05-config.md +84 -0
  108. package/references/official-docs/docs/cordis-tutorial/05-config.zh.md +84 -0
  109. package/references/official-docs/docs/cordis-tutorial/06-composition-and-hmr.i18n.yaml +6 -0
  110. package/references/official-docs/docs/cordis-tutorial/06-composition-and-hmr.md +113 -0
  111. package/references/official-docs/docs/cordis-tutorial/06-composition-and-hmr.zh.md +113 -0
  112. package/references/official-docs/docs/cordis-tutorial/07-into-the-harness.i18n.yaml +6 -0
  113. package/references/official-docs/docs/cordis-tutorial/07-into-the-harness.md +107 -0
  114. package/references/official-docs/docs/cordis-tutorial/07-into-the-harness.zh.md +107 -0
  115. package/references/official-docs/docs/cordis-tutorial/index.i18n.yaml +6 -0
  116. package/references/official-docs/docs/cordis-tutorial/index.md +60 -0
  117. package/references/official-docs/docs/cordis-tutorial/index.zh.md +62 -0
  118. package/references/official-docs/docs/defensive-patterns.i18n.yaml +6 -0
  119. package/references/official-docs/docs/defensive-patterns.md +33 -0
  120. package/references/official-docs/docs/defensive-patterns.zh.md +33 -0
  121. package/references/official-docs/docs/development.i18n.yaml +6 -0
  122. package/references/official-docs/docs/development.md +171 -0
  123. package/references/official-docs/docs/development.zh.md +171 -0
  124. package/references/official-docs/docs/event-producer-consumer.i18n.yaml +6 -0
  125. package/references/official-docs/docs/event-producer-consumer.md +76 -0
  126. package/references/official-docs/docs/event-producer-consumer.zh.md +78 -0
  127. package/references/official-docs/docs/glossary.i18n.yaml +6 -0
  128. package/references/official-docs/docs/glossary.md +45 -0
  129. package/references/official-docs/docs/glossary.zh.md +45 -0
  130. package/references/official-docs/docs/graph-atlas.i18n.yaml +6 -0
  131. package/references/official-docs/docs/graph-atlas.md +24 -0
  132. package/references/official-docs/docs/graph-atlas.zh.md +26 -0
  133. package/references/official-docs/docs/i18n/README.i18n.yaml +6 -0
  134. package/references/official-docs/docs/i18n/README.md +60 -0
  135. package/references/official-docs/docs/i18n/README.zh.md +60 -0
  136. package/references/official-docs/docs/i18n/style-samples.md +87 -0
  137. package/references/official-docs/docs/i18n/terminology.md +214 -0
  138. package/references/official-docs/docs/i18n/translation-prompt.md +263 -0
  139. package/references/official-docs/docs/i18n/translation-rules.i18n.yaml +6 -0
  140. package/references/official-docs/docs/i18n/translation-rules.md +69 -0
  141. package/references/official-docs/docs/i18n/translation-rules.zh.md +69 -0
  142. package/references/official-docs/docs/module-graph.i18n.yaml +6 -0
  143. package/references/official-docs/docs/module-graph.md +1638 -0
  144. package/references/official-docs/docs/module-graph.zh.md +1640 -0
  145. package/references/official-docs/docs/persistence-catalog.i18n.yaml +6 -0
  146. package/references/official-docs/docs/persistence-catalog.md +944 -0
  147. package/references/official-docs/docs/persistence-catalog.zh.md +946 -0
  148. package/references/official-docs/docs/postmortem/0001-acp-default-export-drops-inject.i18n.yaml +6 -0
  149. package/references/official-docs/docs/postmortem/0001-acp-default-export-drops-inject.md +113 -0
  150. package/references/official-docs/docs/postmortem/0001-acp-default-export-drops-inject.zh.md +113 -0
  151. package/references/official-docs/docs/postmortem/0002-js-expression-disabled-filesystem-tools.i18n.yaml +6 -0
  152. package/references/official-docs/docs/postmortem/0002-js-expression-disabled-filesystem-tools.md +47 -0
  153. package/references/official-docs/docs/postmortem/0002-js-expression-disabled-filesystem-tools.zh.md +47 -0
  154. package/references/official-docs/docs/postmortem/0003-web-agent-gui-feedback-loop.i18n.yaml +6 -0
  155. package/references/official-docs/docs/postmortem/0003-web-agent-gui-feedback-loop.md +53 -0
  156. package/references/official-docs/docs/postmortem/0003-web-agent-gui-feedback-loop.zh.md +53 -0
  157. package/references/official-docs/docs/postmortem/0004-landlock-partial-notice-misclassified-child-failures.i18n.yaml +6 -0
  158. package/references/official-docs/docs/postmortem/0004-landlock-partial-notice-misclassified-child-failures.md +55 -0
  159. package/references/official-docs/docs/postmortem/0004-landlock-partial-notice-misclassified-child-failures.zh.md +55 -0
  160. package/references/official-docs/docs/postmortem/README.i18n.yaml +6 -0
  161. package/references/official-docs/docs/postmortem/README.md +18 -0
  162. package/references/official-docs/docs/postmortem/README.zh.md +18 -0
  163. package/references/official-docs/docs/rescope.i18n.yaml +6 -0
  164. package/references/official-docs/docs/rescope.md +53 -0
  165. package/references/official-docs/docs/rescope.zh.md +53 -0
  166. package/references/official-docs/docs/subsystems/README.i18n.yaml +6 -0
  167. package/references/official-docs/docs/subsystems/README.md +55 -0
  168. package/references/official-docs/docs/subsystems/README.zh.md +55 -0
  169. package/references/official-docs/docs/subsystems/approval.i18n.yaml +6 -0
  170. package/references/official-docs/docs/subsystems/approval.md +170 -0
  171. package/references/official-docs/docs/subsystems/approval.zh.md +170 -0
  172. package/references/official-docs/docs/subsystems/attachment.i18n.yaml +6 -0
  173. package/references/official-docs/docs/subsystems/attachment.md +115 -0
  174. package/references/official-docs/docs/subsystems/attachment.zh.md +115 -0
  175. package/references/official-docs/docs/subsystems/client-modules.i18n.yaml +6 -0
  176. package/references/official-docs/docs/subsystems/client-modules.md +118 -0
  177. package/references/official-docs/docs/subsystems/client-modules.zh.md +118 -0
  178. package/references/official-docs/docs/subsystems/code-runtime.i18n.yaml +6 -0
  179. package/references/official-docs/docs/subsystems/code-runtime.md +191 -0
  180. package/references/official-docs/docs/subsystems/code-runtime.zh.md +191 -0
  181. package/references/official-docs/docs/subsystems/commands.i18n.yaml +6 -0
  182. package/references/official-docs/docs/subsystems/commands.md +187 -0
  183. package/references/official-docs/docs/subsystems/commands.zh.md +187 -0
  184. package/references/official-docs/docs/subsystems/compaction.i18n.yaml +6 -0
  185. package/references/official-docs/docs/subsystems/compaction.md +238 -0
  186. package/references/official-docs/docs/subsystems/compaction.zh.md +238 -0
  187. package/references/official-docs/docs/subsystems/core.i18n.yaml +6 -0
  188. package/references/official-docs/docs/subsystems/core.md +1070 -0
  189. package/references/official-docs/docs/subsystems/core.zh.md +1078 -0
  190. package/references/official-docs/docs/subsystems/credentials.i18n.yaml +6 -0
  191. package/references/official-docs/docs/subsystems/credentials.md +133 -0
  192. package/references/official-docs/docs/subsystems/credentials.zh.md +133 -0
  193. package/references/official-docs/docs/subsystems/extensions.i18n.yaml +6 -0
  194. package/references/official-docs/docs/subsystems/extensions.md +364 -0
  195. package/references/official-docs/docs/subsystems/extensions.zh.md +364 -0
  196. package/references/official-docs/docs/subsystems/feedback.i18n.yaml +6 -0
  197. package/references/official-docs/docs/subsystems/feedback.md +266 -0
  198. package/references/official-docs/docs/subsystems/feedback.zh.md +266 -0
  199. package/references/official-docs/docs/subsystems/filesystem.i18n.yaml +6 -0
  200. package/references/official-docs/docs/subsystems/filesystem.md +495 -0
  201. package/references/official-docs/docs/subsystems/filesystem.zh.md +495 -0
  202. package/references/official-docs/docs/subsystems/goal.i18n.yaml +6 -0
  203. package/references/official-docs/docs/subsystems/goal.md +277 -0
  204. package/references/official-docs/docs/subsystems/goal.zh.md +277 -0
  205. package/references/official-docs/docs/subsystems/invariants.i18n.yaml +6 -0
  206. package/references/official-docs/docs/subsystems/invariants.md +88 -0
  207. package/references/official-docs/docs/subsystems/invariants.zh.md +88 -0
  208. package/references/official-docs/docs/subsystems/jobs.i18n.yaml +6 -0
  209. package/references/official-docs/docs/subsystems/jobs.md +290 -0
  210. package/references/official-docs/docs/subsystems/jobs.zh.md +290 -0
  211. package/references/official-docs/docs/subsystems/llm-streaming.i18n.yaml +6 -0
  212. package/references/official-docs/docs/subsystems/llm-streaming.md +888 -0
  213. package/references/official-docs/docs/subsystems/llm-streaming.zh.md +894 -0
  214. package/references/official-docs/docs/subsystems/lsp.i18n.yaml +6 -0
  215. package/references/official-docs/docs/subsystems/lsp.md +202 -0
  216. package/references/official-docs/docs/subsystems/lsp.zh.md +202 -0
  217. package/references/official-docs/docs/subsystems/permission-presets.i18n.yaml +6 -0
  218. package/references/official-docs/docs/subsystems/permission-presets.md +131 -0
  219. package/references/official-docs/docs/subsystems/permission-presets.zh.md +131 -0
  220. package/references/official-docs/docs/subsystems/persistence.i18n.yaml +6 -0
  221. package/references/official-docs/docs/subsystems/persistence.md +385 -0
  222. package/references/official-docs/docs/subsystems/persistence.zh.md +385 -0
  223. package/references/official-docs/docs/subsystems/plan.i18n.yaml +6 -0
  224. package/references/official-docs/docs/subsystems/plan.md +87 -0
  225. package/references/official-docs/docs/subsystems/plan.zh.md +87 -0
  226. package/references/official-docs/docs/subsystems/sandbox.i18n.yaml +6 -0
  227. package/references/official-docs/docs/subsystems/sandbox.md +218 -0
  228. package/references/official-docs/docs/subsystems/sandbox.zh.md +218 -0
  229. package/references/official-docs/docs/subsystems/schedule.i18n.yaml +6 -0
  230. package/references/official-docs/docs/subsystems/schedule.md +186 -0
  231. package/references/official-docs/docs/subsystems/schedule.zh.md +186 -0
  232. package/references/official-docs/docs/subsystems/scope.i18n.yaml +6 -0
  233. package/references/official-docs/docs/subsystems/scope.md +59 -0
  234. package/references/official-docs/docs/subsystems/scope.zh.md +59 -0
  235. package/references/official-docs/docs/subsystems/session-projection.i18n.yaml +6 -0
  236. package/references/official-docs/docs/subsystems/session-projection.md +262 -0
  237. package/references/official-docs/docs/subsystems/session-projection.zh.md +262 -0
  238. package/references/official-docs/docs/subsystems/session-query.i18n.yaml +6 -0
  239. package/references/official-docs/docs/subsystems/session-query.md +495 -0
  240. package/references/official-docs/docs/subsystems/session-query.zh.md +495 -0
  241. package/references/official-docs/docs/subsystems/session-reference.i18n.yaml +6 -0
  242. package/references/official-docs/docs/subsystems/session-reference.md +108 -0
  243. package/references/official-docs/docs/subsystems/session-reference.zh.md +108 -0
  244. package/references/official-docs/docs/subsystems/session-telemetry.i18n.yaml +6 -0
  245. package/references/official-docs/docs/subsystems/session-telemetry.md +194 -0
  246. package/references/official-docs/docs/subsystems/session-telemetry.zh.md +194 -0
  247. package/references/official-docs/docs/subsystems/session-title.i18n.yaml +6 -0
  248. package/references/official-docs/docs/subsystems/session-title.md +204 -0
  249. package/references/official-docs/docs/subsystems/session-title.zh.md +204 -0
  250. package/references/official-docs/docs/subsystems/session.i18n.yaml +6 -0
  251. package/references/official-docs/docs/subsystems/session.md +849 -0
  252. package/references/official-docs/docs/subsystems/session.zh.md +851 -0
  253. package/references/official-docs/docs/subsystems/settings.i18n.yaml +6 -0
  254. package/references/official-docs/docs/subsystems/settings.md +310 -0
  255. package/references/official-docs/docs/subsystems/settings.zh.md +310 -0
  256. package/references/official-docs/docs/subsystems/shell.i18n.yaml +6 -0
  257. package/references/official-docs/docs/subsystems/shell.md +303 -0
  258. package/references/official-docs/docs/subsystems/shell.zh.md +303 -0
  259. package/references/official-docs/docs/subsystems/skills.i18n.yaml +6 -0
  260. package/references/official-docs/docs/subsystems/skills.md +331 -0
  261. package/references/official-docs/docs/subsystems/skills.zh.md +331 -0
  262. package/references/official-docs/docs/subsystems/spill.i18n.yaml +6 -0
  263. package/references/official-docs/docs/subsystems/spill.md +117 -0
  264. package/references/official-docs/docs/subsystems/spill.zh.md +117 -0
  265. package/references/official-docs/docs/subsystems/storage.i18n.yaml +6 -0
  266. package/references/official-docs/docs/subsystems/storage.md +229 -0
  267. package/references/official-docs/docs/subsystems/storage.zh.md +229 -0
  268. package/references/official-docs/docs/subsystems/subagent.i18n.yaml +6 -0
  269. package/references/official-docs/docs/subsystems/subagent.md +734 -0
  270. package/references/official-docs/docs/subsystems/subagent.zh.md +736 -0
  271. package/references/official-docs/docs/subsystems/subprocess.i18n.yaml +6 -0
  272. package/references/official-docs/docs/subsystems/subprocess.md +324 -0
  273. package/references/official-docs/docs/subsystems/subprocess.zh.md +324 -0
  274. package/references/official-docs/docs/subsystems/system-prompt.i18n.yaml +6 -0
  275. package/references/official-docs/docs/subsystems/system-prompt.md +207 -0
  276. package/references/official-docs/docs/subsystems/system-prompt.zh.md +207 -0
  277. package/references/official-docs/docs/subsystems/terminal.i18n.yaml +6 -0
  278. package/references/official-docs/docs/subsystems/terminal.md +184 -0
  279. package/references/official-docs/docs/subsystems/terminal.zh.md +184 -0
  280. package/references/official-docs/docs/subsystems/token-meter.i18n.yaml +6 -0
  281. package/references/official-docs/docs/subsystems/token-meter.md +90 -0
  282. package/references/official-docs/docs/subsystems/token-meter.zh.md +90 -0
  283. package/references/official-docs/docs/subsystems/tools.i18n.yaml +6 -0
  284. package/references/official-docs/docs/subsystems/tools.md +720 -0
  285. package/references/official-docs/docs/subsystems/tools.zh.md +720 -0
  286. package/references/official-docs/docs/subsystems/typert.i18n.yaml +6 -0
  287. package/references/official-docs/docs/subsystems/typert.md +336 -0
  288. package/references/official-docs/docs/subsystems/typert.zh.md +336 -0
  289. package/references/official-docs/docs/subsystems/user-questions.i18n.yaml +6 -0
  290. package/references/official-docs/docs/subsystems/user-questions.md +178 -0
  291. package/references/official-docs/docs/subsystems/user-questions.zh.md +178 -0
  292. package/references/official-docs/docs/subsystems/web-server.i18n.yaml +6 -0
  293. package/references/official-docs/docs/subsystems/web-server.md +108 -0
  294. package/references/official-docs/docs/subsystems/web-server.zh.md +108 -0
  295. package/references/official-docs/docs/subsystems/web.i18n.yaml +6 -0
  296. package/references/official-docs/docs/subsystems/web.md +199 -0
  297. package/references/official-docs/docs/subsystems/web.zh.md +199 -0
  298. package/references/official-docs/docs/subsystems/workflow.i18n.yaml +6 -0
  299. package/references/official-docs/docs/subsystems/workflow.md +278 -0
  300. package/references/official-docs/docs/subsystems/workflow.zh.md +278 -0
  301. package/references/official-docs/docs/subsystems/workspace.i18n.yaml +6 -0
  302. package/references/official-docs/docs/subsystems/workspace.md +228 -0
  303. package/references/official-docs/docs/subsystems/workspace.zh.md +228 -0
  304. package/references/official-docs/docs/testing.i18n.yaml +6 -0
  305. package/references/official-docs/docs/testing.md +49 -0
  306. package/references/official-docs/docs/testing.zh.md +49 -0
  307. package/references/official-docs/docs/tool-catalog.i18n.yaml +6 -0
  308. package/references/official-docs/docs/tool-catalog.md +1873 -0
  309. package/references/official-docs/docs/tool-catalog.zh.md +1878 -0
  310. package/references/official-docs/docs/tool-execution-pipeline.i18n.yaml +6 -0
  311. package/references/official-docs/docs/tool-execution-pipeline.md +62 -0
  312. package/references/official-docs/docs/tool-execution-pipeline.zh.md +64 -0
  313. package/references/official-docs/docs/user/develop/basic/config.i18n.yaml +6 -0
  314. package/references/official-docs/docs/user/develop/basic/config.md +106 -0
  315. package/references/official-docs/docs/user/develop/basic/config.zh.md +106 -0
  316. package/references/official-docs/docs/user/develop/basic/index.i18n.yaml +6 -0
  317. package/references/official-docs/docs/user/develop/basic/index.md +144 -0
  318. package/references/official-docs/docs/user/develop/basic/index.zh.md +144 -0
  319. package/references/official-docs/docs/user/develop/basic/publish.i18n.yaml +6 -0
  320. package/references/official-docs/docs/user/develop/basic/publish.md +183 -0
  321. package/references/official-docs/docs/user/develop/basic/publish.zh.md +183 -0
  322. package/references/official-docs/docs/user/develop/basic/tool.i18n.yaml +6 -0
  323. package/references/official-docs/docs/user/develop/basic/tool.md +52 -0
  324. package/references/official-docs/docs/user/develop/basic/tool.zh.md +52 -0
  325. package/references/official-docs/docs/user/develop/framework/events.i18n.yaml +6 -0
  326. package/references/official-docs/docs/user/develop/framework/events.md +143 -0
  327. package/references/official-docs/docs/user/develop/framework/events.zh.md +143 -0
  328. package/references/official-docs/docs/user/develop/framework/index.i18n.yaml +6 -0
  329. package/references/official-docs/docs/user/develop/framework/index.md +137 -0
  330. package/references/official-docs/docs/user/develop/framework/index.zh.md +137 -0
  331. package/references/official-docs/docs/user/develop/framework/service.i18n.yaml +6 -0
  332. package/references/official-docs/docs/user/develop/framework/service.md +148 -0
  333. package/references/official-docs/docs/user/develop/framework/service.zh.md +150 -0
  334. package/references/official-docs/docs/user/develop/practice/index.i18n.yaml +6 -0
  335. package/references/official-docs/docs/user/develop/practice/index.md +155 -0
  336. package/references/official-docs/docs/user/develop/practice/index.zh.md +155 -0
  337. package/references/official-docs/docs/user/develop/practice/llm-adapter.i18n.yaml +6 -0
  338. package/references/official-docs/docs/user/develop/practice/llm-adapter.md +188 -0
  339. package/references/official-docs/docs/user/develop/practice/llm-adapter.zh.md +188 -0
  340. package/references/official-docs/docs/user/guide/index.i18n.yaml +6 -0
  341. package/references/official-docs/docs/user/guide/index.md +30 -0
  342. package/references/official-docs/docs/user/guide/index.zh.md +30 -0
  343. package/references/official-docs/docs/user/guide/providers-custom-form.png +0 -0
  344. package/references/official-docs/docs/user/guide/providers-custom-form.zh.png +0 -0
  345. package/references/official-docs/docs/user/guide/providers-models-page.png +0 -0
  346. package/references/official-docs/docs/user/guide/providers-models-page.zh.png +0 -0
  347. package/references/official-docs/docs/user/guide/providers.i18n.yaml +6 -0
  348. package/references/official-docs/docs/user/guide/providers.md +98 -0
  349. package/references/official-docs/docs/user/guide/providers.zh.md +98 -0
  350. package/references/official-docs/docs/user/guide/python-sdk.i18n.yaml +6 -0
  351. package/references/official-docs/docs/user/guide/python-sdk.md +104 -0
  352. package/references/official-docs/docs/user/guide/python-sdk.zh.md +104 -0
  353. package/references/official-docs/docs/user/index.i18n.yaml +6 -0
  354. package/references/official-docs/docs/user/index.md +11 -0
  355. package/references/official-docs/docs/user/index.zh.md +11 -0
  356. package/references/official-docs/docs/web-styling.i18n.yaml +6 -0
  357. package/references/official-docs/docs/web-styling.md +25 -0
  358. package/references/official-docs/docs/web-styling.zh.md +25 -0
  359. package/references/official-docs/examples/AGENTS.md +20 -0
  360. package/references/official-docs/packages/AGENTS.md +27 -0
  361. package/references/official-docs/packages/README.md +69 -0
  362. package/references/official-docs/vendor/README.md +60 -0
  363. package/references/official-docs/website-docs.ts +524 -0
  364. package/references/sources.md +137 -0
  365. package/references/upstream-cordis.md +594 -0
  366. package/references/website-pages.md +668 -0
  367. package/scripts/archive-discussions.ps1 +154 -0
  368. package/scripts/download-community-articles.ps1 +188 -0
  369. package/scripts/download-community-repos.ps1 +232 -0
  370. package/scripts/download-sources.ps1 +195 -0
  371. package/scripts/gen-topic-snapshot.ps1 +91 -0
  372. package/scripts/install-skill.ps1 +63 -0
  373. package/scripts/sync-official-docs.ps1 +130 -0
  374. package/scripts/verify-kit.ps1 +191 -0
@@ -0,0 +1,186 @@
1
+ # 仅限 Session 内的 Schedule
2
+
3
+ [English](schedule.md) | 中文
4
+
5
+ Schedule 拥有持久提醒;这些提醒会作为普通的后续对话轮次返回原 live Session。[持久 Schedule Agent Note](../../.agents/notes/implemented/feature/2026-08-05-durable-web-schedule.md) 负责持久化与生命周期决策,[对话式交付](../../.agents/notes/implemented/simplification/2026-08-09-conversational-schedule-delivery.md) 负责无回执边界,[显式时区边界](../../.agents/notes/implemented/simplification/2026-08-09-explicit-schedule-time-zone.md) 负责浏览器本地解释,[有界固定速率 Schedule](../../.agents/notes/implemented/simplification/2026-08-09-bounded-fixed-rate-schedule.md) 负责重复调度。本页记录 [`packages/schedule/schedule/src/types.ts`](../../packages/schedule/schedule/src/types.ts) 中的持久数据形状和面向模型的数据形状;[包 README](../../packages/schedule/schedule/README.md) 负责组合、工具行为与确切的提醒 framing。
6
+
7
+ ## 持久记录
8
+
9
+ `ScheduleId` 是[品牌化 id](core.md#branded-ids),在单个 Session 内唯一且绝不复用。版本 1 支持正的安全整数 `after_seconds` 延时、显式的绝对 `at` 目标,或至少五分钟的安全整数 `every_seconds` 间隔。创建操作会将每个初始目标规范化为使用四位年份的 RFC 3339 UTC `scheduledAt`;`after` 记录会保留提交的延时,`at` 记录只存储结果时点,`every` 记录则保留固定间隔和下一个目标。
10
+
11
+ ```ts type-equiv
12
+ /** Durable one-shot reminder created from a positive delay. */
13
+ interface AfterScheduleRecord {
14
+ /** Session-local stable identity. */
15
+ readonly id: ScheduleId
16
+ /** Rule discriminator for a delayed one-shot reminder. */
17
+ readonly kind: 'after'
18
+ /** Trimmed reminder content supplied at creation. */
19
+ readonly prompt: string
20
+ /** Positive safe-integer delay accepted at creation. */
21
+ readonly afterSeconds: number
22
+ /** Four-digit-year RFC 3339 UTC target. */
23
+ readonly scheduledAt: string
24
+ }
25
+ ```
26
+
27
+ ```ts type-equiv
28
+ /** Durable one-shot reminder created from an absolute instant. */
29
+ interface AtScheduleRecord {
30
+ /** Session-local stable identity. */
31
+ readonly id: ScheduleId
32
+ /** Rule discriminator for an absolute one-shot reminder. */
33
+ readonly kind: 'at'
34
+ /** Trimmed reminder content supplied at creation. */
35
+ readonly prompt: string
36
+ /** Four-digit-year RFC 3339 UTC target. */
37
+ readonly scheduledAt: string
38
+ }
39
+ ```
40
+
41
+ ```ts type-equiv
42
+ /** Durable fixed-rate reminder whose next target remains creation-anchor-aligned. */
43
+ interface EveryScheduleRecord {
44
+ /** Session-local stable identity. */
45
+ readonly id: ScheduleId
46
+ /** Rule discriminator for a fixed-rate recurring reminder. */
47
+ readonly kind: 'every'
48
+ /** Trimmed reminder content supplied at creation. */
49
+ readonly prompt: string
50
+ /** Fixed safe-integer interval, never below five minutes. */
51
+ readonly everySeconds: number
52
+ /** Earliest anchor-aligned occurrence not yet dispatched. */
53
+ readonly scheduledAt: string
54
+ }
55
+ ```
56
+
57
+ ```ts type-equiv
58
+ /** One-shot record variants that terminate on an id-only dispatch. */
59
+ type OneShotScheduleRecord = AfterScheduleRecord | AtScheduleRecord
60
+ ```
61
+
62
+ ```ts type-equiv
63
+ /** The v1 durable reminder record union. */
64
+ type ScheduleRecord = OneShotScheduleRecord | EveryScheduleRecord
65
+ ```
66
+
67
+ ## 绝对时间输入
68
+
69
+ `at` 选择器可以是严格且带偏移量的 RFC 3339 字符串,也可以是精确的本地日历对象。本地形式让这种解释在工具边界保持显式:
70
+
71
+ ```ts type-equiv
72
+ /** Structured local-calendar input accepted by `schedule_create`. */
73
+ interface LocalAtInput {
74
+ /** Four-digit ISO calendar date. */
75
+ readonly date: string
76
+ /** Local wall-clock time with optional one-to-three digit milliseconds. */
77
+ readonly time: string
78
+ /** Explicit UTC or IANA Area/Location zone. */
79
+ readonly time_zone: string
80
+ }
81
+ ```
82
+
83
+ ```ts type-equiv
84
+ /** Absolute selector accepted by `schedule_create`. */
85
+ type AtInput = string | LocalAtInput
86
+ ```
87
+
88
+ 官方 Web overlay 会为每条提示词采样浏览器的 IANA 时区。当 open turn 只有一个无歧义的浏览器时区时,Time-context 会告诉模型按该请求本地时区解释未明确限定时区的自然语言日期和时间;provenance 混合或缺失时,则告诉模型询问用户。该指引不是持久 Session 默认值:模型仍必须在字符串形式中传入偏移量,或在本地形式中传入 `time_zone`;Schedule 绝不会读取浏览器、Session、进程或模型上下文。
89
+
90
+ Schedule 会拒绝无效偏移量与时区、不带偏移量的字符串、非未来目标,以及落在夏令时缺口内的本地时间。遇到夏令时重叠时,会选择第一次出现的较早时点。创建成功后只存储规范化后的 UTC `scheduledAt`,因此回放绝不依赖环境时区状态。
91
+
92
+ ## 固定速率输入与补偿
93
+
94
+ `every_seconds` 是每条记录单独拥有且至少为 300 秒的间隔,以创建时间为锚点。它只提供固定速率重复调度:协议不包含日历规则或 Cron 表达式、重复调度时区、共享冷却时间或跨记录准入门禁。
95
+
96
+ 如果一个 Session 在多个目标到期期间处于 cold 或 busy 状态,一条 Every 记录只会贡献其中最新的一次到期触发。dispatch 会直接将记录推进到 dispatch 判断时刻之后第一个与创建锚点对齐的目标,而不会枚举、持久化或回放错过的间隔。如果下一个目标无法落在四位数年份的 UTC 范围内,最后一次 dispatch 将终结该记录。
97
+
98
+ 当多条彼此不同的 Every 记录均已到期,且没有一次性提醒到期时,每条记录都会向同一个 follow-up 批次贡献一次触发,并按目标时间和创建顺序排列。每条 Every 记录的状态互相独立,但该获准批次中的所有 dispatch 都使用同一个判断时刻。批处理限制模型轮次数量;五分钟下限限制每条记录的 timer 频率。
99
+
100
+ ## 持久变更与回放
101
+
102
+ 版本 1 的 `schedule/change` 会话事件是 Schedule 唯一的持久权威。create 保存完整记录,delete 是终结性且仅含 id 的转换。一次性提醒的 dispatch 同样是终结性且仅含 id。Every dispatch 携带用于选择最新到期触发的墙钟判断时刻,通常推进活动记录而不终结它。dispatch 表示 follow-up 已同步入队,而不表示模型答复成功或用户已读取答复。
103
+
104
+ ```ts type-equiv
105
+ /** Creates one durable reminder record. */
106
+ interface ScheduleCreateChange {
107
+ readonly version: 1
108
+ readonly operation: 'create'
109
+ readonly schedule: ScheduleRecord
110
+ }
111
+ ```
112
+
113
+ ```ts type-equiv
114
+ /** Deletes one currently active reminder. */
115
+ interface ScheduleDeleteChange {
116
+ readonly version: 1
117
+ readonly operation: 'delete'
118
+ readonly id: ScheduleId
119
+ }
120
+ ```
121
+
122
+ ```ts type-equiv
123
+ /** Records that one active one-shot reminder entered the durable dispatch history. */
124
+ interface OneShotScheduleDispatchChange {
125
+ readonly version: 1
126
+ readonly operation: 'dispatch'
127
+ readonly id: ScheduleId
128
+ }
129
+ ```
130
+
131
+ ```ts type-equiv
132
+ /** Records one fixed-rate decision and advances directly past missed occurrences. */
133
+ interface EveryScheduleDispatchChange {
134
+ readonly version: 1
135
+ readonly operation: 'dispatch'
136
+ readonly id: ScheduleId
137
+ /** Wall-clock decision time used to select the latest due occurrence. */
138
+ readonly acceptedAt: string
139
+ }
140
+ ```
141
+
142
+ ```ts type-equiv
143
+ /** Durable dispatch shapes supported by the current rule set. */
144
+ type ScheduleDispatchChange = OneShotScheduleDispatchChange | EveryScheduleDispatchChange
145
+ ```
146
+
147
+ ```ts type-equiv
148
+ /** Strict version-1 durable Schedule mutation union. */
149
+ type ScheduleChange = ScheduleCreateChange | ScheduleDeleteChange | ScheduleDispatchChange
150
+ ```
151
+
152
+ 严格 decoder 与 fold 会拒绝未知版本、额外字段、复用 id、不匹配的一次性提醒或 Every dispatch 形状,以及针对非活动记录的 delete 或 dispatch 转换。普通 Session 折叠完整事件流。fork 只折叠 `SessionHeader.seedLength` 位置及其后的事件,因此保留历史,但不会接管父 Session 的活动提醒。`schedule/change` 声明和源码位置也编入[持久化目录](../persistence-catalog.md#schedulechange--log-only)。
153
+
154
+ ## 活动视图与管理
155
+
156
+ 工具值将持久记录与根据当前墙钟派生的交付状态组合起来。`session-local` 表示原 Session 必须处于 live 状态:不存在外部通知渠道或 cold Session scheduler。
157
+
158
+ ```ts type-equiv
159
+ /** Current delivery timing derived from the durable record and wall clock. */
160
+ type ScheduleState = 'scheduled' | 'overdue'
161
+ ```
162
+
163
+ ```ts type-equiv
164
+ /** Fixed v1 delivery boundary: the original session must be live. */
165
+ type ScheduleDeliveryMode = 'session-local'
166
+ ```
167
+
168
+ ```ts type-equiv
169
+ /** Complete model-facing view of one active reminder. */
170
+ type ScheduleView = ScheduleRecord & {
171
+ /** Whether the target remains in the future. */
172
+ readonly state: ScheduleState
173
+ /** Reminder delivery never leaves the owning session. */
174
+ readonly deliveryMode: ScheduleDeliveryMode
175
+ }
176
+ ```
177
+
178
+ 生成的[工具目录](../tool-catalog.md#deepseek-aidsh-schedule)负责 `schedule_create`、`schedule_list` 和 `schedule_delete` 的参数与结果 schema。一条 Agent-scoped 队列将管理调用与到期工作串行化。每次读取或判断都会先等待共享的 Session 持久化 barrier;create 与实际执行的 delete 在追加后还会再次等待。barrier 失败会报告 `persistence_uncertain`,而不是猜测 eager write 是否已提交。其他稳定错误代码是 `invalid_prompt`、`invalid_selector`、`invalid_rule`、`invalid_time_zone`、`not_future`、`time_out_of_range`、`frequency_too_high`、`corrupt_schedule_log` 和 `internal_error`。
179
+
180
+ ## Live 交付
181
+
182
+ 进程内 owner 根据持久 fold 派生最早的 timer,并在每次有界等待后重新读取墙钟。cold Session 不执行任何工作;重新打开后会重建 timer,并使已经过去的目标进入 overdue 状态。到期的一次性提醒享有优先级,每次只进入一个后续轮次。当没有一次性提醒到期时,所有 overdue 的 Every 记录会组成上述单个批次。
183
+
184
+ 到期工作会先等待 Agent 完全 idle 并认领 maintenance phase,再重新折叠状态、采样本次判断、将一个 `followup()` 排入队列,并追加对应的 dispatch 变更。它绝不会调用 `steer()`,也绝不会中断当前轮次。
185
+
186
+ 获得准入的一次性提醒或固定速率批次会启动一个普通的后续轮次,且只通过普通对话 transcript(文本记录)出现;Schedule 不提供独立的持久 Web 回执或浏览器渲染器。如果 framing 构造或同步队列准入失败,则不会记录 dispatch,提醒仍保持活动。队列准入后、持久 dispatch 前的狭窄崩溃窗口可能使提醒内容在恢复后重复,因此该边界提供的是尽力而为的至少一次交付,而非恰好一次交付。
@@ -0,0 +1,6 @@
1
+ # Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
2
+ # side as of the last confirmed-consistent state. Both languages carry equal authority;
3
+ # after editing either side, bring the other along and re-record with:
4
+ # pnpm run verify-translation-pairing --write docs/subsystems/scope.md
5
+ scope.md: c425217de224839d719da213e33f58bd2e6bf002
6
+ scope.zh.md: 546226a23f8218d2f1b50ce970c6cc11d9626e27
@@ -0,0 +1,59 @@
1
+ # Scoped Registration
2
+
3
+ English | [中文](scope.zh.md)
4
+
5
+ The [scope package](../../packages/core/scope) supplies the identity, carrier, and scoped-layer vocabulary that makes one registration context mean both per-agent visibility and shared lifetime ownership. It is a library primitive rather than a Cordis service; the [agent-scope runtime-design Agent Note](../../.agents/notes/implemented/architecture/2026-07-12-agent-scope-runtime-design.md#scope-routing-one-opaque-key-selects-one-layer) owns the lifecycle rationale, the [shared-storage Agent Note](../../.agents/notes/implemented/architecture/2026-07-12-scoped-layers-store.md) owns the registry-layer decision, and the package [README](../../packages/core/scope/README.md) owns the callable API and filtering semantics.
6
+
7
+ Sources: [`packages/core/scope/src/index.ts`](../../packages/core/scope/src/index.ts) and [`packages/core/scope/src/store.ts`](../../packages/core/scope/src/store.ts).
8
+
9
+ ## Identity and dispatch carrier
10
+
11
+ `ScopeKey` is an opaque object identity. The shipped loop uses the live `Agent` object as its own key, but the primitive never inspects the object.
12
+
13
+ ```ts type-equiv
14
+ /** An opaque, identity-compared scope key. */
15
+ type ScopeKey = object
16
+ ```
17
+
18
+ `Scoped<T>` is the compile-time brand on the opaque routing receiver returned by `scopeTarget(base, key)`. Scope-filtered event declarations require this carrier as their `this` type, while the real event subject remains an explicit argument.
19
+
20
+ ```ts type-equiv
21
+ /**
22
+ * A routing-only event receiver built by {@link scopeTarget}. The type
23
+ * parameter records the subject type for dispatch checking; the carrier does
24
+ * not expose the subject's properties. Event payloads carry the real subject.
25
+ */
26
+ type Scoped<T extends object> = object & { readonly [ScopedBrand]: T }
27
+ ```
28
+
29
+ ## Owned registration context
30
+
31
+ `Scope` pairs the tagged registration context with two teardown paths. `rawDispose` preserves the exact Cordis disposer identity needed by an ordered composite effect; `dispose()` is the public shared quiescence boundary for direct and racing callers.
32
+
33
+ ```ts type-equiv
34
+ /** A minted registration scope and its quiescent disposal boundaries. */
35
+ interface Scope {
36
+ /** Context through which scope-owned registrations are made. */
37
+ ctx: Context
38
+ /** Exact Cordis disposer, used when nesting this scope in an ordered composite effect. */
39
+ rawDispose: () => Promise<void> | void
40
+ /** Dispose every scope-owned registration; racing calls await the same completion. */
41
+ dispose(): Promise<void>
42
+ }
43
+ ```
44
+
45
+ ## Scoped registry layer
46
+
47
+ `ScopeLayer` represents one registry's complete contribution at the global or exact-scope level. A concrete layer may aggregate multiple named and anonymous tables; whole-layer emptiness lets `ScopedLayers` reclaim scoped state without discarding a sibling table.
48
+
49
+ ```ts type-equiv
50
+ /** One scope's aggregate contribution to a registry. */
51
+ interface ScopeLayer {
52
+ /** Whether every table in this layer is empty. */
53
+ isEmpty(): boolean
54
+ }
55
+ ```
56
+
57
+ `ScopedLayers<L>` owns the eager global layer and lazily created exact-scope layers. Reads do not create layers: `peek(undefined)` means no overlay, while `merge()` materializes insertion-ordered global named entries followed by scoped shadows. Registrations use one context for both visibility and Cordis effect ownership, collect one synchronous undo before optional notification, return Cordis's exact disposer, and reclaim a scoped layer only when its complete `ScopeLayer` is empty.
58
+
59
+ `NamedEntries<V>` supplies insertion-ordered lookup and live iteration with caller-owned duplicate errors. `AnonymousEntries<V>` gives every append a unique identity so equal values remain independent. Iteration stays live within one nonempty table generation; draining the table detaches existing iterators from later insertions. Both return idempotent exact-entry undos; the shared `EntryValues` implementation interface is not public.
@@ -0,0 +1,59 @@
1
+ # 作用域注册
2
+
3
+ [English](scope.md) | 中文
4
+
5
+ [scope 包](../../packages/core/scope)提供身份、载体与作用域层词汇,使同一注册上下文同时表达每个 agent(智能体)的可见性和共享生命周期所有权。它是库原语,而不是 Cordis 服务;生命周期设计理由由 [agent-scope 运行时设计 Agent Note](../../.agents/notes/implemented/architecture/2026-07-12-agent-scope-runtime-design.md#scope-routing-one-opaque-key-selects-one-layer)规定,注册表层决策由[共享存储 Agent Note](../../.agents/notes/implemented/architecture/2026-07-12-scoped-layers-store.md)规定,可调用 API 与过滤语义则由包 [README](../../packages/core/scope/README.md)规定。
6
+
7
+ 源码:[`packages/core/scope/src/index.ts`](../../packages/core/scope/src/index.ts) 与 [`packages/core/scope/src/store.ts`](../../packages/core/scope/src/store.ts)。
8
+
9
+ ## 身份标识与分发载体
10
+
11
+ `ScopeKey` 是一个不透明的对象身份标识。已交付的 agent loop(智能体循环)使用活跃的 `Agent` 对象作为自身的 key,但该原语从不检视该对象。
12
+
13
+ ```ts type-equiv
14
+ /** An opaque, identity-compared scope key. */
15
+ type ScopeKey = object
16
+ ```
17
+
18
+ `Scoped<T>` 是编译期品牌标记,标注在 `scopeTarget(base, key)` 返回的不透明路由接收器上。作用域过滤的事件声明要求以此载体作为 `this` 类型,而真正的事件主体仍作为显式参数传入。
19
+
20
+ ```ts type-equiv
21
+ /**
22
+ * A routing-only event receiver built by {@link scopeTarget}. The type
23
+ * parameter records the subject type for dispatch checking; the carrier does
24
+ * not expose the subject's properties. Event payloads carry the real subject.
25
+ */
26
+ type Scoped<T extends object> = object & { readonly [ScopedBrand]: T }
27
+ ```
28
+
29
+ ## 拥有所有权的注册上下文
30
+
31
+ `Scope` 将带标签的注册上下文与两个拆卸接口配对。`rawDispose` 保留有序复合 effect 所需的 Cordis disposer 的确切身份;`dispose()` 是面向直接调用方和竞态调用方的公共完全停稳边界。
32
+
33
+ ```ts type-equiv
34
+ /** A minted registration scope and its quiescent disposal boundaries. */
35
+ interface Scope {
36
+ /** Context through which scope-owned registrations are made. */
37
+ ctx: Context
38
+ /** Exact Cordis disposer, used when nesting this scope in an ordered composite effect. */
39
+ rawDispose: () => Promise<void> | void
40
+ /** Dispose every scope-owned registration; racing calls await the same completion. */
41
+ dispose(): Promise<void>
42
+ }
43
+ ```
44
+
45
+ ## 带作用域的注册表层
46
+
47
+ `ScopeLayer` 表示一个注册表在全局或确切作用域层级的完整贡献。具体 layer 可以聚合多个具名与匿名 table;整个 layer 为空时,`ScopedLayers` 可以回收带作用域状态,而不会丢弃兄弟 table。
48
+
49
+ ```ts type-equiv
50
+ /** One scope's aggregate contribution to a registry. */
51
+ interface ScopeLayer {
52
+ /** Whether every table in this layer is empty. */
53
+ isEmpty(): boolean
54
+ }
55
+ ```
56
+
57
+ `ScopedLayers<L>` 拥有立即创建的全局 layer,以及惰性创建的确切作用域 layer。读取不会创建 layer:`peek(undefined)` 表示不存在作用域覆盖层,而 `merge()` 会依次物化按插入顺序排列的全局具名条目和带作用域的遮蔽项。注册使用同一个上下文表示可见性与 Cordis effect 所有权,在可选通知前取得一个同步撤销函数,返回 Cordis 的原始 disposer,并且只在带作用域 layer 的完整 `ScopeLayer` 为空时回收它。
58
+
59
+ `NamedEntries<V>` 提供按插入顺序的查找和动态迭代,重复项错误由调用方处理。`AnonymousEntries<V>` 为每次 append 分配唯一标识,因此值相等的条目仍彼此独立。在同一轮非空 table 生命周期内,迭代器可以观察后续变化;table 被清空后,现有迭代器不会再观察后续插入。两者都返回幂等、精确对应相应条目的撤销函数;共享实现接口 `EntryValues` 不对外公开。
@@ -0,0 +1,6 @@
1
+ # Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
2
+ # side as of the last confirmed-consistent state. Both languages carry equal authority;
3
+ # after editing either side, bring the other along and re-record with:
4
+ # pnpm run verify-translation-pairing --write docs/subsystems/session-projection.md
5
+ session-projection.md: 281e7630eed6480de07a66bf7050798c83396f77
6
+ session-projection.zh.md: bc1448e8baa0f38b3a9ffed1c6005e8905c93bcd
@@ -0,0 +1,262 @@
1
+ # Session Projections
2
+
3
+ English | [中文](session-projection.zh.md)
4
+
5
+ The session-projection seam — a [capability seam](../capability-seams.md) through which domain host plugins serve whole current values of log-derived per-session state to client carriers: the Service Definition and registry ([dsh-session-projection](../../packages/session/session-projection), `ctx.sessionProjections`), domain contributors (each registering one pure unit), and carriers ([dsh-host-apiproxy](../../packages/host/apiproxy)'s history tail page and `session/projection` push frame). It is one optional capability, not part of the agent-loop spine. The framework drives, the domain computes: the registry subscribes to `session/event` once and folds every committed event through every unit; domains hold no subscriptions and clients never fold domain events — they receive finished values. Design authority: the [session-projection RFC](../../.agents/notes/proposed/architecture/2026-07-27-session-projection-and-command-log.md); drive/cache/feed contracts: the [package README](../../packages/session/session-projection/README.md).
6
+
7
+ Source: [`packages/session/session-projection/src/index.ts`](../../packages/session/session-projection/src/index.ts)
8
+
9
+ ## The unit
10
+
11
+ `SessionProjectionMap` is the merge-extensible type table for the whole chain (host unit, wire block, client hook); values are wire-JSON whole values, and rendering belongs to the slot system, never this layer. A domain contributes one `ProjectionDefinition` per key:
12
+
13
+ ```ts type-equiv
14
+ /**
15
+ * One domain's state-driven computation unit: three pure synchronous
16
+ * functions plus declarations — never an opaque getter. The framework drives
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
20
+ * `state` MUST be plain JSON (the persisted-cache precondition).
21
+ */
22
+ interface ProjectionDefinition<K extends keyof SessionProjectionMap, S> {
23
+ /** The projection key this unit owns (its `SessionProjectionMap` entry). */
24
+ key: K
25
+ /** Validates the wire payload (`view` output) before it leaves the host. */
26
+ schema: ZodType<SessionProjectionMap[K]>
27
+ /**
28
+ * State for the empty log.
29
+ * @returns the initial state.
30
+ */
31
+ init(): S
32
+ /**
33
+ * Pure transition: previous state + one committed event → next state. A
34
+ * unit uninterested in an event MUST return the same state reference — an
35
+ * unchanged reference (`Object.is`) produces zero downstream work.
36
+ * @param state - the state covering all prior events.
37
+ * @param event - the next committed session event.
38
+ * @returns the next state (same reference when the event is not the unit's).
39
+ */
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]
47
+ /**
48
+ * Persisted-cache invalidation version: bump whenever the serialized state fields or the
49
+ * fold semantics change, so persisted `(sessionId, key, ver, seq, val)`
50
+ * rows from an older unit are discarded instead of being forward-applied
51
+ * into garbage. Non-negative integer.
52
+ */
53
+ stateVersion: number
54
+ }
55
+ ```
56
+
57
+ The whole-value event rule is load-bearing: a state-carrying log event carries the complete post-change state, never a bare delta — it keeps every transition trivially cheap and every served value self-describing (last-wins for consumers).
58
+
59
+ ## The snapshot and the change feed
60
+
61
+ ```ts type-equiv
62
+ /**
63
+ * One consistent read cut over every registered unit for one session.
64
+ * `asOfSeq` is the shared watermark — the seq of the last event every value
65
+ * reflects (`-1` for an empty log, mirroring `session/subscribed.lastSeq`).
66
+ */
67
+ interface ProjectionSnapshot {
68
+ /** Seq of the last event the values reflect; -1 for an empty log. */
69
+ asOfSeq: number
70
+ /** Whole current value per registered key. */
71
+ values: Partial<SessionProjectionMap>
72
+ }
73
+ ```
74
+
75
+ ```ts type-equiv
76
+ /**
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).
80
+ */
81
+ type ProjectionChangeListener = (
82
+ session: Session,
83
+ key: Extract<keyof SessionProjectionMap, string>,
84
+ value: unknown,
85
+ seq: number,
86
+ ) => void
87
+ ```
88
+
89
+ `snapshot(session)` is fully synchronous: a carrier reads it in the same tick as its page slice, so `asOfSeq` covers both reads at one sequence number. Every value passes its unit's schema before return; an accidentally async `view` returns a Promise, which schema validation rejects. The change feed fires once per unit whose state *reference* changed for each committed event; `apply` must return the same reference when its state did not change.
90
+
91
+ ## The registry: `ctx.sessionProjections`
92
+
93
+ `SessionProjectionRegistry` ([signatures](#ctxsessionprojections--sessionprojectionregistry)) owns the drive: one `session/event` subscription, eager `apply` over every registered unit, and per-session per-unit watermark cells. 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 whose disposer rides the calling fiber: an unloaded domain plugin's key (with its cached cells) disappears from subsequent drives and snapshots, and clients read that as capability absence; duplicate keys throw. Domain plugins register under `ctx.inject(['sessionProjections'], …)` so headless assemblies without the registry stay unaffected.
94
+
95
+ <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
96
+
97
+ <a id="cordis-surface"></a>
98
+
99
+ ## Cordis API
100
+
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).
102
+
103
+ <a id="ctxsessionprojectioncache--sessionprojectioncache"></a>
104
+
105
+ ### `ctx.sessionProjectionCache` — `SessionProjectionCache`
106
+
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.
108
+
109
+ ```ts cordis-catalog
110
+ /**
111
+ * 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
115
+ * 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.
118
+ * @param meta - the listed session's header (identity witness; no log read).
119
+ * @returns the cut (`asOfSeq` = lowest served-row watermark), or
120
+ * `undefined` when no usable row exists for this lifecycle.
121
+ */
122
+ cachedSnapshot(meta: SessionHeader): ProjectionSnapshot | undefined
123
+
124
+ /**
125
+ * Durably checkpoint one live session NOW (both mandatory points call
126
+ * 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.
129
+ * @param session - the live session to checkpoint.
130
+ * @returns resolution after durability and event emission.
131
+ */
132
+ async write(session: Session): Promise<void>
133
+
134
+ /**
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.
145
+ */
146
+ async coldSnapshot(id: SessionId, signal?: AbortSignal): Promise<ProjectionSnapshot>
147
+ ```
148
+
149
+ Types: [Session](session.md) · [SessionHeader](persistence.md) · [SessionId](core.md)
150
+
151
+ Source: [`packages/session/session-projection-cache/src/index.ts:71`](../../packages/session/session-projection-cache/src/index.ts)
152
+
153
+ <a id="ctxsessionprojections--sessionprojectionregistry"></a>
154
+
155
+ ### `ctx.sessionProjections` — `SessionProjectionRegistry`
156
+
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.
158
+
159
+ ```ts cordis-catalog
160
+ /**
161
+ * Register one domain's unit. The registration is an effect on the calling
162
+ * context's fiber: disposing the fiber (or calling the returned disposer)
163
+ * removes the key — and the unit's cached cells — from subsequent drives
164
+ * and snapshots.
165
+ * @param definition - key, state schema, pure unit functions, and stateVersion.
166
+ * @returns the exact disposer that unregisters this unit.
167
+ */
168
+ register<K extends keyof SessionProjectionMap, S>(definition: ProjectionDefinition<K, S>): () => void
169
+
170
+ /**
171
+ * Subscribe to the change feed. The registration is an effect on the
172
+ * calling context's fiber.
173
+ * @param listener - called once per unit whose state reference changed, per committed event.
174
+ * @returns the exact disposer that unsubscribes.
175
+ */
176
+ onChanged(listener: ProjectionChangeListener): () => void
177
+
178
+ /**
179
+ * One consistent cut over every registered unit for one session, read from
180
+ * the watermark cache (missing cells fold lazily over the in-memory log).
181
+ * Fully synchronous — every value and `asOfSeq` reflect the same log
182
+ * position. Each value passes its unit's schema before leaving.
183
+ * @param session - the session whose projection values are read.
184
+ * @returns the snapshot; `values` is empty when no unit is registered.
185
+ */
186
+ snapshot(session: Session): ProjectionSnapshot
187
+
188
+ /**
189
+ * State-level checkpoint of every registered unit for one session, read
190
+ * from the watermark cache (missing cells fold lazily over the in-memory
191
+ * log). This is the write side of the persisted projection cache: the
192
+ * returned rows are the `(key → {ver, seq, val})` part of the durable
193
+ * `(sessionId, key, ver, seq, val)`
194
+ * rows. Every `val` is a DETACHED structured clone — never the live
195
+ * cell reference: the watermark cache is this registry's authoritative
196
+ * mutable state, and a caller reaching the live reference could corrupt
197
+ * every subsequent snapshot and frame through it (plain JSON by the unit
198
+ * contract, so the clone is total).
199
+ * @param session - the session whose unit states are checkpointed.
200
+ * @returns one row per registered key; empty when no unit is registered.
201
+ */
202
+ checkpoint(session: Session): ProjectionCheckpoint
203
+
204
+ /**
205
+ * The stored seq a {@link restore} tail read over `checkpoint` must start
206
+ * at: one event BELOW the lowest usable watermark (a row is usable when
207
+ * its `ver` matches the live unit's `stateVersion`; an absent or mismatched row
208
+ * pulls the floor to `0` — that key must refold the full log). The
209
+ * one-below anchor is load-bearing: the tail then proves how far the
210
+ * stored log still extends, so {@link restore} can detect a log that
211
+ * shrank below a row's watermark (crash-repair truncation) instead of
212
+ * serving the stale row as current — an empty tail read from the anchor
213
+ * yields an end below every watermark and the restore rejects for a full
214
+ * re-read.
215
+ * @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).
219
+ */
220
+ restoreFloor(checkpoint: ProjectionCheckpoint): number | undefined
221
+
222
+ /**
223
+ * 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
226
+ * absent (a cold or listing consumer treats it as not-yet-available and a
227
+ * fuller read path refolds it). The zero-I/O rung of the read ladder —
228
+ * values are as stale as their rows, never wrong.
229
+ * @param checkpoint - persisted rows for one session (possibly stale or empty).
230
+ * @returns whole values per key with a usable row; empty when none.
231
+ */
232
+ viewCheckpoint(checkpoint: ProjectionCheckpoint): Partial<SessionProjectionMap>
233
+
234
+ /**
235
+ * Cold read: fold every registered unit over a stored log suffix, seeding
236
+ * each from its checkpoint row when usable — the one read recipe (cached
237
+ * 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
240
+ * `baseSeq`; the floor's one-below anchor makes the supplied end honest,
241
+ * so a shrunk log is detected here. A row is usable iff its
242
+ * `ver` matches the live unit's `stateVersion`, it does not predate `baseSeq`
243
+ * (`seq >= baseSeq - 1`), and it does not claim events past the
244
+ * supplied end (`seq <= endSeq`); an unusable row is discarded
245
+ * and its key refolds from `init` — which is only sound over the full
246
+ * log, so a discarded row with `baseSeq > 0` throws (the caller re-reads
247
+ * from seq 0, e.g. after a crash-repair truncation shrank the log below
248
+ * a row's watermark).
249
+ * @param checkpoint - persisted rows for one session (possibly stale or empty).
250
+ * @param events - the stored events with `seq >= baseSeq`, in seq order.
251
+ * @param baseSeq - the seq `events` starts at (its first event's seq when non-empty).
252
+ * @returns the snapshot cut at the supplied log end (`asOfSeq` is the last
253
+ * supplied event's seq, `baseSeq - 1` for an empty tail) plus the
254
+ * refreshed checkpoint rows at that cut, ready for a durable write-back.
255
+ */
256
+ restore(checkpoint: ProjectionCheckpoint, events: readonly SessionEvent[], baseSeq: number): { snapshot: ProjectionSnapshot; checkpoint: ProjectionCheckpoint }
257
+ ```
258
+
259
+ Types: [Session](session.md) · [SessionEvent](session.md)
260
+
261
+ Source: [`packages/session/session-projection/src/index.ts:171`](../../packages/session/session-projection/src/index.ts)
262
+ <!-- END GENERATED cordis-surface -->