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,108 @@
1
+ # 会话引用
2
+
3
+ [English](session-reference.md) | 中文
4
+
5
+ 结构化的跨会话引用请求与准备后的消息上下文。[包约定](../../packages/context/session-reference) 定义规范 URI、当前表层投影、标签安全的 JSON 与字节保留、稳定错误和不可信的模型提示词。宿主适配器使用这些类型,而不会把各自 UI 的提及语法传入 agent(智能体)核心。
6
+
7
+ 来源:[`packages/context/session-reference/src/types.ts`](../../packages/context/session-reference/src/types.ts)
8
+
9
+ ## 输入与候选项
10
+
11
+ `SessionReferenceInput` 是与宿主无关的选择。id 具有权威性;label 是随快照携带的显示元数据。
12
+
13
+ ```ts type-equiv
14
+ /** One source session selected by a host. */
15
+ interface SessionReferenceInput {
16
+ /** Opaque source session identity. */
17
+ sessionId: SessionId
18
+ /** Optional user-facing mention label. */
19
+ label?: string
20
+ }
21
+ ```
22
+
23
+ `SessionReferenceCandidate` 是面向宿主的发现输出。存在最新会话标题时,它的 label 使用该标题;筛选仍只搜索 session id 和 cwd,绝不搜索 transcript(文本记录)。
24
+
25
+ ```ts type-equiv
26
+ /** One host-facing candidate from exact session metadata. */
27
+ interface SessionReferenceCandidate {
28
+ /** Opaque source session identity. */
29
+ sessionId: SessionId
30
+ /** Latest log-backed title, falling back to the opaque session id. */
31
+ label: string
32
+ /** Source session working directory, when recorded. */
33
+ cwd?: string
34
+ /** Source session creation time in Unix epoch milliseconds. */
35
+ createdAt: number
36
+ }
37
+ ```
38
+
39
+ ## 准备后的消息
40
+
41
+ 准备过程保留可读的当前消息内容,并最多返回一个聚合上下文。
42
+
43
+ ```ts type-equiv
44
+ /** Direct message content and optional referenced-session context. */
45
+ interface PreparedReferencedMessage {
46
+ /** Readable message content after host mention tokens are removed. */
47
+ content: ContentBlock[]
48
+ /** Aggregated untrusted snapshot, absent when the message has no references. */
49
+ additionalContext?: UserMessage
50
+ }
51
+ ```
52
+
53
+ ## 错误
54
+
55
+ `SessionReferenceError.code` 区分无效配置或输入、自引用、数量限制、源读取失败、预算失败和取消。宿主协议会把这些 code 映射到各自的错误封装,无需检查提示词字节。
56
+
57
+ ```ts type-equiv
58
+ /** Stable failure codes exposed to host adapters. */
59
+ type SessionReferenceErrorCode =
60
+ | 'SESSION_REFERENCE_INVALID_CONFIG'
61
+ | 'SESSION_REFERENCE_INVALID_REFERENCE'
62
+ | 'SESSION_REFERENCE_SELF_REFERENCE'
63
+ | 'SESSION_REFERENCE_TOO_MANY'
64
+ | 'SESSION_REFERENCE_READ_FAILED'
65
+ | 'SESSION_REFERENCE_BUDGET_EXCEEDED'
66
+ | 'SESSION_REFERENCE_CANCELLED'
67
+ ```
68
+
69
+ <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
70
+
71
+ <a id="cordis-surface"></a>
72
+
73
+ ## Cordis API
74
+
75
+ 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).
76
+
77
+ <a id="ctxsessionreferenceresolver--sessionreferenceresolver"></a>
78
+
79
+ ### `ctx.sessionReferenceResolver` — `SessionReferenceResolver`
80
+
81
+ Exact-read consumer that prepares immutable cross-session message context.
82
+
83
+ ```ts cordis-catalog
84
+ /**
85
+ * List reference candidates, ranked by working-directory affinity.
86
+ * @param agent - target agent; self is excluded and its cwd drives ranking.
87
+ * @param query - optional case-insensitive session-id/cwd/title substring.
88
+ * @param limit - optional positive result cap.
89
+ * @param signal - optional cancellation boundary for host autocomplete teardown.
90
+ * @returns candidates labeled by latest title or, when absent, session id.
91
+ */
92
+ async listCandidates( agent: Agent, query: string = '', limit: number = this.config.candidateLimit, signal?: AbortSignal, ): Promise<SessionReferenceCandidate[]>
93
+
94
+ /**
95
+ * Snapshot all references before enqueue and return one aggregated durable context.
96
+ * @param agent - target agent; references to it are rejected.
97
+ * @param content - already host-normalized readable message content.
98
+ * @param references - structured source sessions in mention order.
99
+ * @param signal - optional cancellation boundary for host request teardown.
100
+ * @returns detached content and optional referenced-session context.
101
+ */
102
+ async prepare( agent: Agent, content: ContentBlock[], references: SessionReferenceInput[], signal?: AbortSignal, ): Promise<PreparedReferencedMessage>
103
+ ```
104
+
105
+ Types: [Agent](core.md) · [ContentBlock](llm-streaming.md)
106
+
107
+ Source: [`packages/context/session-reference/src/index.ts:70`](../../packages/context/session-reference/src/index.ts)
108
+ <!-- END GENERATED cordis-surface -->
@@ -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-telemetry.md
5
+ session-telemetry.md: dd00e428c3ecb1e0158be09cce83d1a262ab0c62
6
+ session-telemetry.zh.md: 835fc0ff2f2daa1f4ac90fe615a62aa36f7fe41d
@@ -0,0 +1,194 @@
1
+ # SessionTelemetryBackend
2
+
3
+ English | [中文](session-telemetry.zh.md)
4
+
5
+ Outbound session reporting is split as a [capability seam](../capability-seams.md): the Service Definition and capture coordinator ([dsh-session-telemetry](../../packages/session/session-telemetry), `ctx.sessionTelemetry`) own the capture points, fixed chunk projection, `session-telemetry/record` redaction waterfall, handoff cursor, and minimal backend contract; the Service Provider a deployment loads ([dsh-session-telemetry-otel](../../packages/session/session-telemetry-otel)) is the OpenTelemetry JS SDK's log pipeline configured verbatim. It is one optional capability, not part of the agent-loop spine, and nothing here reaches a model request. The boundary axiom — the harness's aspect ends at `emit()`; batching, retry, queueing, and loss policy belong to the reporting SDK — and the rejected alternatives are pinned in the [revival Agent Note](../../.agents/notes/implemented/feature/2026-07-23-session-telemetry-otel-revival.md); the capture points, cursor, and projection contracts live in the [Service Definition README](../../packages/session/session-telemetry/README.md).
6
+
7
+ Source: [`packages/session/session-telemetry/src/index.ts`](../../packages/session/session-telemetry/src/index.ts)
8
+
9
+ ## The logical record
10
+
11
+ ```ts type-equiv
12
+ /**
13
+ * Severity of a telemetry record, pre-mapped at capture so a receiver can
14
+ * alert with zero configuration: `error` for events whose own outcome flag
15
+ * says so (the tool-result block's `isError`, `turn/end` error reasons) and for
16
+ * `agent-error` operational records. Captured events otherwise default to
17
+ * `info`; `warn` remains available to `session-telemetry/record` policies and
18
+ * backends.
19
+ */
20
+ type SessionTelemetrySeverity = 'info' | 'warn' | 'error'
21
+ ```
22
+
23
+ ```ts type-equiv
24
+ /**
25
+ * One logical record handed to a backend — the capture contract's whole outbound
26
+ * vocabulary. Ledger records mirror session-log events one-to-one;
27
+ * operational records (`channel: 'ops'`) carry the two signals with no log
28
+ * home (`agent-error`, `shutdown`) and deliberately omit `event.seq`-style
29
+ * identity so they can never be mistaken for ledger rows.
30
+ */
31
+ interface SessionTelemetryRecord {
32
+ /** Ledger (session-log mirror) or ops (operational signal) channel; backends keep the two under separate instrumentation scopes. */
33
+ channel: 'ledger' | 'ops'
34
+ /** Unix epoch milliseconds — the source event's append time for ledger records, the emission time for ops records. */
35
+ time: number
36
+ /** Pre-mapped alerting severity; see {@link SessionTelemetrySeverity}. */
37
+ severity: SessionTelemetrySeverity
38
+ /**
39
+ * Identity attributes, deliberately minimal: ledger records carry
40
+ * `session.id`, `event.type`, `event.seq`, plus `session.cwd` /
41
+ * `session.parent_id` / `session.seed_length` when the header has them;
42
+ * ops records carry `telemetry.op`, `session.id`, and (for `agent-error`)
43
+ * `agent.id`, `turn`, `step`, `error.name`. Anything recoverable from the
44
+ * body is intentionally NOT duplicated here.
45
+ */
46
+ attributes: Record<string, string | number>
47
+ /**
48
+ * The complete payload: a deep copy of the session event's `data` for
49
+ * ledger records (JSON-serializable by `Session.append`'s own
50
+ * validation), or the op payload for ops records. Never mutated after
51
+ * handoff.
52
+ */
53
+ body: unknown
54
+ }
55
+ ```
56
+
57
+ Only the first `assistant/chunk` of each `(turn, step)` ships — the stream-started signal; the rest drop at capture, so `seq` gaps are routine on the wire and never a loss signal. Every other [session event](session.md) type, including plugin-merged ones the seam never heard of, passes through whole. Delivery is best-effort: the cursor marks handed-off, not delivered, records can be lost (crash, reload window) and duplicated (cursor-less re-adoption, SDK retries), so receivers dedupe ledger records on `(session.id, event.seq)`; ops records deliberately omit that identity — they are signals to alert on, not entries to sum, and tolerate duplicates instead.
58
+
59
+ ## The sharing disclosure
60
+
61
+ The seam's acknowledgement contract (owned by the [Service Definition README's sharing-disclosure section](../../packages/session/session-telemetry/README.md#the-sharing-disclosure)): every backend discloses its deployment-selected sharing policy through the required abstract `sharing` member on `ctx.sessionTelemetry`, and consumers render "not configured" only when no telemetry service is mounted. The disclosure states the current policy, never delivery or retention — handoff is the non-blocking enqueue, and batching, retry, and loss policy stay the reporting SDK's.
62
+
63
+ ```ts type-equiv
64
+ /**
65
+ * Deployment-selected session-sharing policy disclosed by a mounted
66
+ * {@link SessionTelemetryBackend} backend to human-facing acknowledgement surfaces (the
67
+ * `/feedback` command's confirmation text). The seam owns the vocabulary so
68
+ * any backend can disclose a policy without depending on the OTel package;
69
+ * the values mirror the OTel backend's serialized `SessionTelemetryMode` choices.
70
+ */
71
+ type SessionTelemetrySharingStatus = 'full' | 'feedback-only' | 'disabled'
72
+ ```
73
+
74
+ ## The backend contract
75
+
76
+ ```ts type-equiv
77
+ /**
78
+ * The minimum backend contract the coordinator requires. {@link SessionTelemetryBackend} is
79
+ * its service-registered form; tests compose the coordinator with a bare
80
+ * implementation of this interface.
81
+ */
82
+ interface SessionTelemetrySink {
83
+ /**
84
+ * Hand one record to the backend's pipeline. MUST be a non-blocking
85
+ * enqueue — the coordinator calls this synchronously from the
86
+ * `session/event` hot path or an explicit canonical-log capture, so anything
87
+ * slower than a queue push would tax the agent loop or feedback handling.
88
+ * Errors thrown here are contained by the coordinator and logged; they
89
+ * never reach the loop.
90
+ * @param record - the logical record to report; owned by the backend after the call.
91
+ */
92
+ emit(record: SessionTelemetryRecord): void
93
+ /**
94
+ * Optional hint that a turn ended. A backend may forward it to its SDK's
95
+ * flush so records are exported after each turn. Called
96
+ * fire-and-forget; implementations must not block and must not throw
97
+ * meaningfully (the coordinator contains exceptions). Most backends should
98
+ * leave this unimplemented and let their SDK's own batching cadence govern
99
+ * export timing: a backend that does implement it owns the interaction
100
+ * between its concurrent flushes and {@link shutdown}'s drain (the OTel
101
+ * backend leaves it unimplemented for exactly that hazard — see the
102
+ * revival Agent Note).
103
+ */
104
+ flush?(): void
105
+ /**
106
+ * Forward the fiber's disposal to the SDK: flush whatever is queued and
107
+ * reach quiescence, per the SDK's own shutdown contract. Everything
108
+ * emitted before this call must still be delivered — including records
109
+ * enqueued while a {@link flush} hint is in flight, so a backend whose SDK
110
+ * guards against concurrent flushes orders behind the outstanding one (the
111
+ * coordinator emits its dispose-time `shutdown` markers immediately before
112
+ * calling this). Awaited by the coordinator's dispose; a rejection is
113
+ * logged as a warning and never fails application teardown.
114
+ * The coordinator captures dispose-time shutdown markers immediately before
115
+ * this call for live capture; on-demand capture creates no ops records.
116
+ * @returns resolves when the backend's pipeline has quiesced.
117
+ */
118
+ shutdown(): Promise<void>
119
+ }
120
+ ```
121
+
122
+ `SessionTelemetryBackend` (`ctx.sessionTelemetry`, [signatures](#ctxsessiontelemetry--sessiontelemetrybackend-abstract-seam)) is the contract's loadable form — one implementation per context, duplicate load throws — and a backend composes the seam's `SessionTelemetryCoordinator` in its constructor to install the capture side.
123
+
124
+ ## The redact waterfall: `session-telemetry/record`
125
+
126
+ Every record passes the `session-telemetry/record` [waterfall](../cordis-primer.md#cordis-waterfall-semantics) between projection and `emit()` ([event entry](#session-telemetryrecord--waterfall)). The seam ships NO rules of its own: with no listener mounted, records reach the backend exactly as captured, so exported data is precisely as clean as the rules a deployment mounts. Listeners stack by transforming `next()`'s return value; returning without `next()` replaces everything beneath; a throwing listener withholds that one record fail-closed inside the coordinator's containment. Redaction applies to the exported copy only — the canonical session log is never rewritten.
127
+
128
+ <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
129
+
130
+ <a id="cordis-surface"></a>
131
+
132
+ ## Cordis API
133
+
134
+ 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).
135
+
136
+ <a id="ctxsessiontelemetry--sessiontelemetrybackend-abstract-seam"></a>
137
+
138
+ ### `ctx.sessionTelemetry` — `SessionTelemetryBackend` (abstract seam)
139
+
140
+ Loadable form of the backend contract: one implementation per context — the cordis `Service` registration under the `telemetry` key throws on a duplicate, cordis' standard behavior. A backend composes a SessionTelemetryCoordinator in its constructor to install the capture side.
141
+
142
+ ```ts cordis-catalog
143
+ /**
144
+ * See {@link SessionTelemetrySink.emit} — that declaration is the contract's one home.
145
+ * @param record - the logical record to report; owned by the backend after the call.
146
+ */
147
+ abstract emit(record: SessionTelemetryRecord): void
148
+
149
+ /** See {@link SessionTelemetrySink.flush}. */
150
+ flush?(): void
151
+
152
+ /**
153
+ * See {@link SessionTelemetrySink.shutdown}.
154
+ * @returns resolves when the backend's pipeline has quiesced.
155
+ */
156
+ abstract shutdown(): Promise<void>
157
+ ```
158
+
159
+ Source: [`packages/session/session-telemetry/src/index.ts:148`](../../packages/session/session-telemetry/src/index.ts)
160
+
161
+ <a id="session-telemetry-events"></a>
162
+
163
+ ### `session-telemetry/*` events
164
+
165
+ <a id="session-telemetryrecord--waterfall"></a>
166
+
167
+ #### `session-telemetry/record` — waterfall
168
+
169
+ Transform one outbound record before it reaches the backend. This waterfall is the Service Definition's redaction extension point. It ships NO rules of its own: the innermost `next()` passes the record through unchanged, and with no listener mounted records reach the backend as captured, so exported data is exactly as clean as the rules a deployment mounts. Listeners stack by transforming `next()`'s return value; returning without `next()` replaces everything beneath. Dispatched synchronously on the capture hot path inside the coordinator's containment: a throwing listener withholds that one record (fail-closed) and never reaches the agent loop. Live capture dispatches at append time; on-demand capture dispatches while reading the canonical log. Redaction applies to the exported copy only; the canonical session log is never rewritten.
170
+
171
+ ```ts cordis-catalog
172
+ /**
173
+ * Transform one outbound record before it reaches the backend. This
174
+ * waterfall is the Service Definition's redaction extension point. It ships NO rules
175
+ * of its own: the
176
+ * innermost `next()` passes the record through unchanged, and with no
177
+ * listener mounted records reach the backend as captured, so exported
178
+ * data is exactly as clean as the rules a deployment mounts. Listeners
179
+ * stack by transforming `next()`'s return value; returning without
180
+ * `next()` replaces everything beneath. Dispatched synchronously on the
181
+ * capture hot path inside the coordinator's containment: a throwing
182
+ * listener withholds that one record (fail-closed) and never reaches the
183
+ * agent loop. Live capture dispatches at append time; on-demand capture
184
+ * dispatches while reading the canonical log. Redaction applies to the
185
+ * exported copy only; the canonical session log is never rewritten.
186
+ * @param record - the candidate record, already the coordinator's own deep
187
+ * copy; listeners return a (possibly new) record and must not mutate it.
188
+ * @mode waterfall
189
+ */
190
+ 'session-telemetry/record'(record: SessionTelemetryRecord, next: () => SessionTelemetryRecord): SessionTelemetryRecord
191
+ ```
192
+
193
+ Source: [`packages/session/session-telemetry/src/index.ts:43`](../../packages/session/session-telemetry/src/index.ts)
194
+ <!-- END GENERATED cordis-surface -->
@@ -0,0 +1,194 @@
1
+ # 遥测(telemetry)
2
+
3
+ [English](session-telemetry.md) | 中文
4
+
5
+ 对外的会话上报拆分为一项[能力 seam](../capability-seams.md):Service Definition 与捕获协调器([dsh-session-telemetry](../../packages/session/session-telemetry),`ctx.sessionTelemetry`)拥有捕获点、固定分片投影、`session-telemetry/record` 脱敏 waterfall(瀑布式事件)、handoff 游标与最小后端约定;部署方加载的 Service Provider([dsh-session-telemetry-otel](../../packages/session/session-telemetry-otel))则是原样配置的 OpenTelemetry JS SDK 日志流水线。它是一项可选能力,不属于 agent loop(智能体循环)主干,这里也没有任何内容会进入模型请求。边界公理(harness 的职责止于 `emit()`;批处理、重试、排队与丢失策略都属于上报 SDK)连同被否决的替代方案,均已在[复活 Agent Note](../../.agents/notes/implemented/feature/2026-07-23-session-telemetry-otel-revival.md)中定案;捕获点、游标与投影的约定见 [Service Definition README](../../packages/session/session-telemetry/README.md)。
6
+
7
+ 源码:[`packages/session/session-telemetry/src/index.ts`](../../packages/session/session-telemetry/src/index.ts)
8
+
9
+ ## 逻辑记录
10
+
11
+ ```ts type-equiv
12
+ /**
13
+ * Severity of a telemetry record, pre-mapped at capture so a receiver can
14
+ * alert with zero configuration: `error` for events whose own outcome flag
15
+ * says so (the tool-result block's `isError`, `turn/end` error reasons) and for
16
+ * `agent-error` operational records. Captured events otherwise default to
17
+ * `info`; `warn` remains available to `session-telemetry/record` policies and
18
+ * backends.
19
+ */
20
+ type SessionTelemetrySeverity = 'info' | 'warn' | 'error'
21
+ ```
22
+
23
+ ```ts type-equiv
24
+ /**
25
+ * One logical record handed to a backend — the capture contract's whole outbound
26
+ * vocabulary. Ledger records mirror session-log events one-to-one;
27
+ * operational records (`channel: 'ops'`) carry the two signals with no log
28
+ * home (`agent-error`, `shutdown`) and deliberately omit `event.seq`-style
29
+ * identity so they can never be mistaken for ledger rows.
30
+ */
31
+ interface SessionTelemetryRecord {
32
+ /** Ledger (session-log mirror) or ops (operational signal) channel; backends keep the two under separate instrumentation scopes. */
33
+ channel: 'ledger' | 'ops'
34
+ /** Unix epoch milliseconds — the source event's append time for ledger records, the emission time for ops records. */
35
+ time: number
36
+ /** Pre-mapped alerting severity; see {@link SessionTelemetrySeverity}. */
37
+ severity: SessionTelemetrySeverity
38
+ /**
39
+ * Identity attributes, deliberately minimal: ledger records carry
40
+ * `session.id`, `event.type`, `event.seq`, plus `session.cwd` /
41
+ * `session.parent_id` / `session.seed_length` when the header has them;
42
+ * ops records carry `telemetry.op`, `session.id`, and (for `agent-error`)
43
+ * `agent.id`, `turn`, `step`, `error.name`. Anything recoverable from the
44
+ * body is intentionally NOT duplicated here.
45
+ */
46
+ attributes: Record<string, string | number>
47
+ /**
48
+ * The complete payload: a deep copy of the session event's `data` for
49
+ * ledger records (JSON-serializable by `Session.append`'s own
50
+ * validation), or the op payload for ops records. Never mutated after
51
+ * handoff.
52
+ */
53
+ body: unknown
54
+ }
55
+ ```
56
+
57
+ 每个 `(turn, step)` 只发出第一条 `assistant/chunk`,即「流已开始」的信号;其余分片在捕获时丢弃,因此传输中的 `seq` 缺口是常态,绝不是数据丢失的信号。其他所有[会话事件](session.md)类型都会完整透传,包括该 seam 从未听说过、由插件合并进来的事件类型。投递是尽力而为的:游标标记的是「已交接」而非「已送达」,记录可能丢失(崩溃、重载窗口)也可能重复(无游标的重新接管、SDK 重试),因此接收端对 ledger 记录基于 `(session.id, event.seq)` 去重;ops 记录刻意省略这类标识——它们是用于告警的信号,而非用于累加的条目,重复被容忍而非被去重。
58
+
59
+ ## 共享披露
60
+
61
+ 该 seam 的确认契约(归属 [Service Definition README 的共享披露段](../../packages/session/session-telemetry/README.md#the-sharing-disclosure)):每个后端都通过 `ctx.sessionTelemetry` 上必需的抽象 `sharing` 成员披露其部署级共享策略,消费方只有在未挂载任何遥测服务时才渲染「未配置」。披露只陈述当前策略,绝不承诺投递或留存——交接是非阻塞入队,批处理、重试与丢失策略仍归上报 SDK。
62
+
63
+ ```ts type-equiv
64
+ /**
65
+ * Deployment-selected session-sharing policy disclosed by a mounted
66
+ * {@link SessionTelemetryBackend} backend to human-facing acknowledgement surfaces (the
67
+ * `/feedback` command's confirmation text). The seam owns the vocabulary so
68
+ * any backend can disclose a policy without depending on the OTel package;
69
+ * the values mirror the OTel backend's serialized `SessionTelemetryMode` choices.
70
+ */
71
+ type SessionTelemetrySharingStatus = 'full' | 'feedback-only' | 'disabled'
72
+ ```
73
+
74
+ ## 后端约定
75
+
76
+ ```ts type-equiv
77
+ /**
78
+ * The minimum backend contract the coordinator requires. {@link SessionTelemetryBackend} is
79
+ * its service-registered form; tests compose the coordinator with a bare
80
+ * implementation of this interface.
81
+ */
82
+ interface SessionTelemetrySink {
83
+ /**
84
+ * Hand one record to the backend's pipeline. MUST be a non-blocking
85
+ * enqueue — the coordinator calls this synchronously from the
86
+ * `session/event` hot path or an explicit canonical-log capture, so anything
87
+ * slower than a queue push would tax the agent loop or feedback handling.
88
+ * Errors thrown here are contained by the coordinator and logged; they
89
+ * never reach the loop.
90
+ * @param record - the logical record to report; owned by the backend after the call.
91
+ */
92
+ emit(record: SessionTelemetryRecord): void
93
+ /**
94
+ * Optional hint that a turn ended. A backend may forward it to its SDK's
95
+ * flush so records are exported after each turn. Called
96
+ * fire-and-forget; implementations must not block and must not throw
97
+ * meaningfully (the coordinator contains exceptions). Most backends should
98
+ * leave this unimplemented and let their SDK's own batching cadence govern
99
+ * export timing: a backend that does implement it owns the interaction
100
+ * between its concurrent flushes and {@link shutdown}'s drain (the OTel
101
+ * backend leaves it unimplemented for exactly that hazard — see the
102
+ * revival Agent Note).
103
+ */
104
+ flush?(): void
105
+ /**
106
+ * Forward the fiber's disposal to the SDK: flush whatever is queued and
107
+ * reach quiescence, per the SDK's own shutdown contract. Everything
108
+ * emitted before this call must still be delivered — including records
109
+ * enqueued while a {@link flush} hint is in flight, so a backend whose SDK
110
+ * guards against concurrent flushes orders behind the outstanding one (the
111
+ * coordinator emits its dispose-time `shutdown` markers immediately before
112
+ * calling this). Awaited by the coordinator's dispose; a rejection is
113
+ * logged as a warning and never fails application teardown.
114
+ * The coordinator captures dispose-time shutdown markers immediately before
115
+ * this call for live capture; on-demand capture creates no ops records.
116
+ * @returns resolves when the backend's pipeline has quiesced.
117
+ */
118
+ shutdown(): Promise<void>
119
+ }
120
+ ```
121
+
122
+ `SessionTelemetryBackend`(`ctx.sessionTelemetry`,[签名](#ctxsessiontelemetry--sessiontelemetrybackend-abstract-seam))是该约定的可加载形态:每个上下文只允许一个实现,重复加载会抛出异常;后端在其构造函数中组合 seam 的 `SessionTelemetryCoordinator`,以此装配捕获侧。
123
+
124
+ ## 脱敏 waterfall:`session-telemetry/record`
125
+
126
+ 每条记录在投影与 `emit()` 之间都要经过 `session-telemetry/record` [waterfall](../cordis-primer.md#cordis-waterfall-semantics)([事件条目](#session-telemetryrecord--waterfall))。seam 自身不带任何规则:未挂载监听器时,记录以捕获时的原样到达后端;导出数据能干净到什么程度,恰恰取决于部署方挂载了什么规则。监听器通过变换 `next()` 的返回值来堆叠;不调用 `next()` 就返回,即替换其下方的全部逻辑;抛出异常的监听器会在协调器的隔离范围内以 fail-closed 方式扣下这一条记录。脱敏只作用于导出副本;权威会话日志永不改写。
127
+
128
+ <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
129
+
130
+ <a id="cordis-surface"></a>
131
+
132
+ ## Cordis API
133
+
134
+ 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).
135
+
136
+ <a id="ctxsessiontelemetry--sessiontelemetrybackend-abstract-seam"></a>
137
+
138
+ ### `ctx.sessionTelemetry` — `SessionTelemetryBackend` (abstract seam)
139
+
140
+ Loadable form of the backend contract: one implementation per context — the cordis `Service` registration under the `telemetry` key throws on a duplicate, cordis' standard behavior. A backend composes a SessionTelemetryCoordinator in its constructor to install the capture side.
141
+
142
+ ```ts cordis-catalog
143
+ /**
144
+ * See {@link SessionTelemetrySink.emit} — that declaration is the contract's one home.
145
+ * @param record - the logical record to report; owned by the backend after the call.
146
+ */
147
+ abstract emit(record: SessionTelemetryRecord): void
148
+
149
+ /** See {@link SessionTelemetrySink.flush}. */
150
+ flush?(): void
151
+
152
+ /**
153
+ * See {@link SessionTelemetrySink.shutdown}.
154
+ * @returns resolves when the backend's pipeline has quiesced.
155
+ */
156
+ abstract shutdown(): Promise<void>
157
+ ```
158
+
159
+ Source: [`packages/session/session-telemetry/src/index.ts:148`](../../packages/session/session-telemetry/src/index.ts)
160
+
161
+ <a id="session-telemetry-events"></a>
162
+
163
+ ### `session-telemetry/*` events
164
+
165
+ <a id="session-telemetryrecord--waterfall"></a>
166
+
167
+ #### `session-telemetry/record` — waterfall
168
+
169
+ Transform one outbound record before it reaches the backend. This waterfall is the Service Definition's redaction extension point. It ships NO rules of its own: the innermost `next()` passes the record through unchanged, and with no listener mounted records reach the backend as captured, so exported data is exactly as clean as the rules a deployment mounts. Listeners stack by transforming `next()`'s return value; returning without `next()` replaces everything beneath. Dispatched synchronously on the capture hot path inside the coordinator's containment: a throwing listener withholds that one record (fail-closed) and never reaches the agent loop. Live capture dispatches at append time; on-demand capture dispatches while reading the canonical log. Redaction applies to the exported copy only; the canonical session log is never rewritten.
170
+
171
+ ```ts cordis-catalog
172
+ /**
173
+ * Transform one outbound record before it reaches the backend. This
174
+ * waterfall is the Service Definition's redaction extension point. It ships NO rules
175
+ * of its own: the
176
+ * innermost `next()` passes the record through unchanged, and with no
177
+ * listener mounted records reach the backend as captured, so exported
178
+ * data is exactly as clean as the rules a deployment mounts. Listeners
179
+ * stack by transforming `next()`'s return value; returning without
180
+ * `next()` replaces everything beneath. Dispatched synchronously on the
181
+ * capture hot path inside the coordinator's containment: a throwing
182
+ * listener withholds that one record (fail-closed) and never reaches the
183
+ * agent loop. Live capture dispatches at append time; on-demand capture
184
+ * dispatches while reading the canonical log. Redaction applies to the
185
+ * exported copy only; the canonical session log is never rewritten.
186
+ * @param record - the candidate record, already the coordinator's own deep
187
+ * copy; listeners return a (possibly new) record and must not mutate it.
188
+ * @mode waterfall
189
+ */
190
+ 'session-telemetry/record'(record: SessionTelemetryRecord, next: () => SessionTelemetryRecord): SessionTelemetryRecord
191
+ ```
192
+
193
+ Source: [`packages/session/session-telemetry/src/index.ts:43`](../../packages/session/session-telemetry/src/index.ts)
194
+ <!-- END GENERATED cordis-surface -->
@@ -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-title.md
5
+ session-title.md: 6952cd7289861e1f83e76ef7ae9a115a404ee671
6
+ session-title.zh.md: 37442e258325e23fe6d3b288dd8c680efd2d0ca4