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,207 @@
1
+ # System Prompt Assembly
2
+
3
+ English | [中文](system-prompt.zh.md)
4
+
5
+ The [system-prompt package](../../packages/core/system-prompt) owns the data exchanged between prompt contributors and one assembly call. The package [README](../../packages/core/system-prompt/README.md) documents registration, ordering, scoping, and rendering behavior; this page records the exact cross-package types that plugins implement or pass.
6
+
7
+ Source: [`packages/core/system-prompt/src/index.ts`](../../packages/core/system-prompt/src/index.ts).
8
+
9
+ ## Assembly context
10
+
11
+ `AssembleContext` identifies the scope layer one assembly resolves and may carry the explicit control signal for that request. It is merge-extensible: `dsh-agent` adds the optional live `agent` field, and `assembleContextFor(agent, signal)` sets the explicit fields together. A bare assembly has neither scope nor signal.
12
+
13
+ ```ts type-equiv
14
+ /** Merge-extensible context for one prompt assembly. */
15
+ interface AssembleContext {
16
+ /**
17
+ * Scope whose providers and waterfall listeners participate. When absent,
18
+ * only global providers and subject-less listeners participate.
19
+ */
20
+ scope?: ScopeKey
21
+ /** Explicit control signal for the turn that requested this assembly, when any. */
22
+ signal?: AbortSignal
23
+ }
24
+ ```
25
+
26
+ ## Tool-provider result
27
+
28
+ `ToolProviderResult.schemas` is the model-visible set for the current assembly. `knownNames` is the provider's pre-restriction name universe used to distinguish a configured-name typo from a known tool that is deliberately hidden in this scope.
29
+
30
+ ```ts type-equiv
31
+ /** Tool schemas visible in one assembly and their pre-restriction name set. */
32
+ interface ToolProviderResult {
33
+ /** The schemas this provider contributes to THIS assembly. */
34
+ readonly schemas: readonly ToolSchema[]
35
+ /** The pre-restriction name universe for config validation (defaults to `schemas`' names). */
36
+ readonly knownNames?: readonly string[]
37
+ }
38
+ ```
39
+
40
+ ## Prompt sections
41
+
42
+ `PromptSection` is a readonly same-process registration contract. Its text may be static or resolved from the current assembly context. One effective `complete` section becomes the sole prompt section after cooperative assembly.
43
+
44
+ ```ts type-equiv
45
+ /** One contributed section of the system prompt (registry input). */
46
+ interface PromptSection {
47
+ /** Unique name — a duplicate registration throws (see {@link SystemPrompt.section}). */
48
+ readonly name: string
49
+ /**
50
+ * Sections are concatenated in ascending order. Convention: `-100` is the
51
+ * harness identity, `0` the deployment persona, tool guidance uses 100–199;
52
+ * other negative orders also render before the persona.
53
+ */
54
+ readonly order: number
55
+ /**
56
+ * Static text or a provider evaluated at each assembly with that assembly's
57
+ * {@link AssembleContext}. The text may reference `{{variable}}`s — they are
58
+ * interpolated later, by {@link renderPrompt}.
59
+ */
60
+ readonly text: string | ((context: AssembleContext) => string)
61
+ /**
62
+ * Treat this contribution as the complete system prompt. Assembly still
63
+ * runs the cooperative waterfall so tools, contexts, and variables can be
64
+ * resolved, then restores this exact section as the sole prompt section.
65
+ * More than one effective complete section makes assembly fail.
66
+ */
67
+ readonly complete?: boolean
68
+ }
69
+ ```
70
+
71
+ ## Dynamic prompt context
72
+
73
+ `PromptContext` is the cache-safe counterpart to `PromptSection`. The assembly resolves and orders these contributions, while agent-loop logs their complete current snapshot after retained model history only when it changed or compaction removed it.
74
+
75
+ ```ts type-equiv
76
+ /** Dynamic model context materialized as a durable user-role snapshot. */
77
+ interface PromptContext {
78
+ /** Unique name — a duplicate registration throws (see {@link SystemPrompt.context}). */
79
+ readonly name: string
80
+ /** Contexts are joined in ascending order. */
81
+ readonly order: number
82
+ /** Static text or a provider evaluated for each assembly. Empty text contributes nothing. */
83
+ readonly text: string | ((context: AssembleContext) => string)
84
+ }
85
+ ```
86
+
87
+ <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
88
+
89
+ <a id="cordis-surface"></a>
90
+
91
+ ## Cordis API
92
+
93
+ 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).
94
+
95
+ <a id="ctxsystemprompt--systemprompt"></a>
96
+
97
+ ### `ctx.systemPrompt` — `SystemPrompt`
98
+
99
+ Registry service for the prompt inputs assembled before each model step.
100
+
101
+ ```ts cordis-catalog
102
+ /**
103
+ * Register an ordered prompt section in the calling context's scope. A scoped
104
+ * section shadows a global section with the same name; duplicates within one
105
+ * layer and non-finite orders throw. Registration and disposal emit
106
+ * `system-prompt/change`.
107
+ * @param section - the section to register.
108
+ * @returns the exact Cordis effect disposer.
109
+ */
110
+ section(section: PromptSection): () => void
111
+
112
+ /**
113
+ * Register ordered dynamic context in the calling context's scope. Scoped
114
+ * entries shadow global entries with the same name.
115
+ * @param context - the context contribution to register.
116
+ * @returns the exact Cordis effect disposer.
117
+ */
118
+ context(context: PromptContext): () => void
119
+
120
+ /**
121
+ * Suppress every dynamic runtime-context contribution in the calling
122
+ * context's scope without changing the services that own or enforce those
123
+ * facts. Multiple suppressors remain independently disposable.
124
+ * @returns the exact Cordis effect disposer.
125
+ */
126
+ suppressRuntimeContext(): () => void
127
+
128
+ /**
129
+ * Register a tool-schema provider in the calling context's scope. Global and
130
+ * matching scoped providers both contribute; returning the reserved
131
+ * {@link TOOL_ORDER_REST} name makes assembly fail.
132
+ * @param provider - evaluated for each assembly with its context.
133
+ * @returns the exact Cordis effect disposer.
134
+ */
135
+ tools(provider: (context: AssembleContext) => ToolProviderResult): () => void
136
+
137
+ /**
138
+ * Register a prompt variable in the calling context's scope. Scoped values
139
+ * shadow globals; invalid or duplicate names throw. A provider may return
140
+ * `undefined`, but rendering a section that references that value then fails.
141
+ * @param name - the `[a-z][a-z0-9_]*` reference name.
142
+ * @param provider - evaluated for each assembly.
143
+ * @returns the exact Cordis effect disposer.
144
+ */
145
+ variable(name: string, provider: (context: AssembleContext) => string | undefined): () => void
146
+
147
+ /**
148
+ * Assemble global and scoped providers, detach tool parameters, apply
149
+ * canonical ordering, then run the assembly waterfall. Scoped sections and
150
+ * variables shadow globals. The returned waterfall value is authoritative
151
+ * except that an effective complete section is restored afterwards as the
152
+ * sole prompt section.
153
+ * @param context - the optional scope and plugin-defined assembly fields.
154
+ * @returns the post-waterfall assembly with any complete prompt enforced.
155
+ */
156
+ async assemble(context: AssembleContext = {}): Promise<PromptAssembly>
157
+ ```
158
+
159
+ Source: [`packages/core/system-prompt/src/index.ts:338`](../../packages/core/system-prompt/src/index.ts)
160
+
161
+ <a id="system-prompt-events"></a>
162
+
163
+ ### `system-prompt/*` events
164
+
165
+ <a id="system-promptassemble--waterfall"></a>
166
+
167
+ #### `system-prompt/assemble` — waterfall
168
+
169
+ Expert waterfall over the assembled sections, contexts, tools, and variables. Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): scoped listeners receive only that scope's assemblies. The returned value is authoritative. A supplied signal controls only this explicit assembly request and must not be retained to control later turns. A registered complete section is restored after this waterfall, so listeners cannot add to or replace that scope's system prompt.
170
+
171
+ ```ts cordis-catalog
172
+ /**
173
+ * Expert waterfall over the assembled sections, contexts, tools, and variables.
174
+ * Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): scoped listeners
175
+ * receive only that scope's assemblies. The returned value is authoritative.
176
+ * A supplied signal controls only this explicit assembly request and must not
177
+ * be retained to control later turns. A registered complete section is
178
+ * restored after this waterfall, so listeners cannot add to or replace
179
+ * that scope's system prompt.
180
+ * @param assembly - the mutable assembly built from registered providers.
181
+ * @param context - the caller's per-assembly context.
182
+ * @mode waterfall
183
+ */
184
+ 'system-prompt/assemble'(this: Scoped<SystemPrompt>, assembly: PromptAssembly, context: AssembleContext, next: () => Promise<PromptAssembly>): Promise<PromptAssembly>
185
+ ```
186
+
187
+ Types: [Scoped](scope.md)
188
+
189
+ Source: [`packages/core/system-prompt/src/index.ts:31`](../../packages/core/system-prompt/src/index.ts)
190
+
191
+ <a id="system-promptchange--emit"></a>
192
+
193
+ #### `system-prompt/change` — emit
194
+
195
+ Emitted when any prompt provider changes. This registry notification is unfiltered because a global change affects every scope.
196
+
197
+ ```ts cordis-catalog
198
+ /**
199
+ * Emitted when any prompt provider changes. This registry notification is
200
+ * unfiltered because a global change affects every scope.
201
+ * @mode emit
202
+ */
203
+ 'system-prompt/change'(): void
204
+ ```
205
+
206
+ Source: [`packages/core/system-prompt/src/index.ts:37`](../../packages/core/system-prompt/src/index.ts)
207
+ <!-- END GENERATED cordis-surface -->
@@ -0,0 +1,207 @@
1
+ # 系统提示词组装
2
+
3
+ [English](system-prompt.md) | 中文
4
+
5
+ [system-prompt 包](../../packages/core/system-prompt)负责管理提示词贡献者与一次组装调用之间交换的数据。该包的 [README](../../packages/core/system-prompt/README.md) 记录注册、排序、作用域与渲染行为;本页记录各插件实现或传递的确切跨包类型。
6
+
7
+ 源码:[`packages/core/system-prompt/src/index.ts`](../../packages/core/system-prompt/src/index.ts)。
8
+
9
+ ## 组装上下文
10
+
11
+ `AssembleContext` 标识一次组装所解析的作用域层,并可携带该请求的显式控制信号。它可合并扩展:`dsh-agent` 添加可选字段 `agent`,用于携带当前的 agent(智能体)实例;`assembleContextFor(agent, signal)` 则一起设置这些显式字段。裸组装既没有作用域,也没有信号。
12
+
13
+ ```ts type-equiv
14
+ /** Merge-extensible context for one prompt assembly. */
15
+ interface AssembleContext {
16
+ /**
17
+ * Scope whose providers and waterfall listeners participate. When absent,
18
+ * only global providers and subject-less listeners participate.
19
+ */
20
+ scope?: ScopeKey
21
+ /** Explicit control signal for the turn that requested this assembly, when any. */
22
+ signal?: AbortSignal
23
+ }
24
+ ```
25
+
26
+ ## 工具提供方结果
27
+
28
+ `ToolProviderResult.schemas` 是当前组装中对模型可见的工具 schema 集合。`knownNames` 是提供方在限制前的名称全集,用于区分「配置名拼写错误」与「已知工具在此作用域中被有意隐藏」。
29
+
30
+ ```ts type-equiv
31
+ /** Tool schemas visible in one assembly and their pre-restriction name set. */
32
+ interface ToolProviderResult {
33
+ /** The schemas this provider contributes to THIS assembly. */
34
+ readonly schemas: readonly ToolSchema[]
35
+ /** The pre-restriction name universe for config validation (defaults to `schemas`' names). */
36
+ readonly knownNames?: readonly string[]
37
+ }
38
+ ```
39
+
40
+ ## 提示词段落
41
+
42
+ `PromptSection` 是一份只读的同进程注册约定。其文本可以是静态的,也可以从当前组装上下文动态解析。协作式组装完成后,一个有效的 `complete` 段会成为唯一的提示词段落。
43
+
44
+ ```ts type-equiv
45
+ /** One contributed section of the system prompt (registry input). */
46
+ interface PromptSection {
47
+ /** Unique name — a duplicate registration throws (see {@link SystemPrompt.section}). */
48
+ readonly name: string
49
+ /**
50
+ * Sections are concatenated in ascending order. Convention: `-100` is the
51
+ * harness identity, `0` the deployment persona, tool guidance uses 100–199;
52
+ * other negative orders also render before the persona.
53
+ */
54
+ readonly order: number
55
+ /**
56
+ * Static text or a provider evaluated at each assembly with that assembly's
57
+ * {@link AssembleContext}. The text may reference `{{variable}}`s — they are
58
+ * interpolated later, by {@link renderPrompt}.
59
+ */
60
+ readonly text: string | ((context: AssembleContext) => string)
61
+ /**
62
+ * Treat this contribution as the complete system prompt. Assembly still
63
+ * runs the cooperative waterfall so tools, contexts, and variables can be
64
+ * resolved, then restores this exact section as the sole prompt section.
65
+ * More than one effective complete section makes assembly fail.
66
+ */
67
+ readonly complete?: boolean
68
+ }
69
+ ```
70
+
71
+ ## 动态提示词上下文
72
+
73
+ `PromptContext` 是与 `PromptSection` 对应的缓存安全结构。组装会解析这些贡献并排序;agent loop(智能体循环)仅在完整当前快照发生变化或被压缩(compaction)移除时,才会将其记录在保留的模型历史之后。
74
+
75
+ ```ts type-equiv
76
+ /** Dynamic model context materialized as a durable user-role snapshot. */
77
+ interface PromptContext {
78
+ /** Unique name — a duplicate registration throws (see {@link SystemPrompt.context}). */
79
+ readonly name: string
80
+ /** Contexts are joined in ascending order. */
81
+ readonly order: number
82
+ /** Static text or a provider evaluated for each assembly. Empty text contributes nothing. */
83
+ readonly text: string | ((context: AssembleContext) => string)
84
+ }
85
+ ```
86
+
87
+ <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
88
+
89
+ <a id="cordis-surface"></a>
90
+
91
+ ## Cordis API
92
+
93
+ 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).
94
+
95
+ <a id="ctxsystemprompt--systemprompt"></a>
96
+
97
+ ### `ctx.systemPrompt` — `SystemPrompt`
98
+
99
+ Registry service for the prompt inputs assembled before each model step.
100
+
101
+ ```ts cordis-catalog
102
+ /**
103
+ * Register an ordered prompt section in the calling context's scope. A scoped
104
+ * section shadows a global section with the same name; duplicates within one
105
+ * layer and non-finite orders throw. Registration and disposal emit
106
+ * `system-prompt/change`.
107
+ * @param section - the section to register.
108
+ * @returns the exact Cordis effect disposer.
109
+ */
110
+ section(section: PromptSection): () => void
111
+
112
+ /**
113
+ * Register ordered dynamic context in the calling context's scope. Scoped
114
+ * entries shadow global entries with the same name.
115
+ * @param context - the context contribution to register.
116
+ * @returns the exact Cordis effect disposer.
117
+ */
118
+ context(context: PromptContext): () => void
119
+
120
+ /**
121
+ * Suppress every dynamic runtime-context contribution in the calling
122
+ * context's scope without changing the services that own or enforce those
123
+ * facts. Multiple suppressors remain independently disposable.
124
+ * @returns the exact Cordis effect disposer.
125
+ */
126
+ suppressRuntimeContext(): () => void
127
+
128
+ /**
129
+ * Register a tool-schema provider in the calling context's scope. Global and
130
+ * matching scoped providers both contribute; returning the reserved
131
+ * {@link TOOL_ORDER_REST} name makes assembly fail.
132
+ * @param provider - evaluated for each assembly with its context.
133
+ * @returns the exact Cordis effect disposer.
134
+ */
135
+ tools(provider: (context: AssembleContext) => ToolProviderResult): () => void
136
+
137
+ /**
138
+ * Register a prompt variable in the calling context's scope. Scoped values
139
+ * shadow globals; invalid or duplicate names throw. A provider may return
140
+ * `undefined`, but rendering a section that references that value then fails.
141
+ * @param name - the `[a-z][a-z0-9_]*` reference name.
142
+ * @param provider - evaluated for each assembly.
143
+ * @returns the exact Cordis effect disposer.
144
+ */
145
+ variable(name: string, provider: (context: AssembleContext) => string | undefined): () => void
146
+
147
+ /**
148
+ * Assemble global and scoped providers, detach tool parameters, apply
149
+ * canonical ordering, then run the assembly waterfall. Scoped sections and
150
+ * variables shadow globals. The returned waterfall value is authoritative
151
+ * except that an effective complete section is restored afterwards as the
152
+ * sole prompt section.
153
+ * @param context - the optional scope and plugin-defined assembly fields.
154
+ * @returns the post-waterfall assembly with any complete prompt enforced.
155
+ */
156
+ async assemble(context: AssembleContext = {}): Promise<PromptAssembly>
157
+ ```
158
+
159
+ Source: [`packages/core/system-prompt/src/index.ts:338`](../../packages/core/system-prompt/src/index.ts)
160
+
161
+ <a id="system-prompt-events"></a>
162
+
163
+ ### `system-prompt/*` events
164
+
165
+ <a id="system-promptassemble--waterfall"></a>
166
+
167
+ #### `system-prompt/assemble` — waterfall
168
+
169
+ Expert waterfall over the assembled sections, contexts, tools, and variables. Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): scoped listeners receive only that scope's assemblies. The returned value is authoritative. A supplied signal controls only this explicit assembly request and must not be retained to control later turns. A registered complete section is restored after this waterfall, so listeners cannot add to or replace that scope's system prompt.
170
+
171
+ ```ts cordis-catalog
172
+ /**
173
+ * Expert waterfall over the assembled sections, contexts, tools, and variables.
174
+ * Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): scoped listeners
175
+ * receive only that scope's assemblies. The returned value is authoritative.
176
+ * A supplied signal controls only this explicit assembly request and must not
177
+ * be retained to control later turns. A registered complete section is
178
+ * restored after this waterfall, so listeners cannot add to or replace
179
+ * that scope's system prompt.
180
+ * @param assembly - the mutable assembly built from registered providers.
181
+ * @param context - the caller's per-assembly context.
182
+ * @mode waterfall
183
+ */
184
+ 'system-prompt/assemble'(this: Scoped<SystemPrompt>, assembly: PromptAssembly, context: AssembleContext, next: () => Promise<PromptAssembly>): Promise<PromptAssembly>
185
+ ```
186
+
187
+ Types: [Scoped](scope.md)
188
+
189
+ Source: [`packages/core/system-prompt/src/index.ts:31`](../../packages/core/system-prompt/src/index.ts)
190
+
191
+ <a id="system-promptchange--emit"></a>
192
+
193
+ #### `system-prompt/change` — emit
194
+
195
+ Emitted when any prompt provider changes. This registry notification is unfiltered because a global change affects every scope.
196
+
197
+ ```ts cordis-catalog
198
+ /**
199
+ * Emitted when any prompt provider changes. This registry notification is
200
+ * unfiltered because a global change affects every scope.
201
+ * @mode emit
202
+ */
203
+ 'system-prompt/change'(): void
204
+ ```
205
+
206
+ Source: [`packages/core/system-prompt/src/index.ts:37`](../../packages/core/system-prompt/src/index.ts)
207
+ <!-- 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/terminal.md
5
+ terminal.md: eedf6157b256e83d3b57e07bf738429773b87574
6
+ terminal.zh.md: 3cc2c281e8c2090bb7e92808f932be689fd0b710
@@ -0,0 +1,184 @@
1
+ # Persistent PTY Sessions
2
+
3
+ English | [中文](terminal.zh.md)
4
+
5
+ Types shared by PTY backends, `ctx.terminals`, and the model-facing consumer. The [persistent PTY Agent Note](../../.agents/notes/implemented/feature/2026-07-16-persistent-pty-sessions.md) owns the rationale; this page records the cross-package vocabulary from [`packages/terminal/terminal/src/types.ts`](../../packages/terminal/terminal/src/types.ts).
6
+
7
+ ## Identity and readiness
8
+
9
+ `TerminalSessionId` is a service-minted branded id. Optional names are owner-local display metadata; authorization compares the exact owning `Agent`, not a name or guessed id.
10
+
11
+ `TerminalWaitReason` says why one send returned. It is independent from `TerminalSessionStatus`: silence or timeout may return while the top-level shell remains alive, while `session_exit` means that shell exited rather than an arbitrary foreground child.
12
+
13
+ ```ts type-equiv
14
+ /** Why one interactive send returned control to its caller. */
15
+ type TerminalWaitReason = 'stdin_read' | 'inferred_idle' | 'timeout' | 'session_exit'
16
+ ```
17
+
18
+ ```ts type-equiv
19
+ /** Top-level PTY process status, independent of a send's wait reason. */
20
+ type TerminalSessionStatus =
21
+ | { kind: 'running' }
22
+ | { kind: 'exited'; exitCode: number | null; signal: NodeJS.Signals | null }
23
+ ```
24
+
25
+ ## Backend and live session
26
+
27
+ A backend owns how one registered type starts and detects readiness. `TerminalSessionService` publishes the returned session only after setup succeeds, then owns id authorization and cleanup. A backend that cannot clean partial startup resources rejects with `TerminalBackendCleanupError`, allowing disposal to retain the cleanup failure without replacing the caller's cancellation reason. A backend session owns terminal state and captured-resource quiescence.
28
+
29
+ ```ts type-equiv
30
+ /** Replaceable provider for one PTY session type. */
31
+ interface TerminalBackend {
32
+ /** Stable type selected by {@link TerminalSpawnRequest.type}. */
33
+ readonly type: string
34
+ /** Create an unpublished session or reject after cleaning partial resources; cleanup failure uses {@link TerminalBackendCleanupError}. */
35
+ spawn(spec: TerminalBackendSpawnSpec): Promise<TerminalBackendSession>
36
+ }
37
+ ```
38
+
39
+ ```ts type-equiv
40
+ /** Backend-owned live session retained by {@link TerminalSessionService}. */
41
+ interface TerminalBackendSession {
42
+ /** Initial bounded terminal output returned from `terminal_open`. */
43
+ readonly motd: string
44
+ /** Top-level process id when one exists. */
45
+ readonly pid?: number
46
+ /** Start one exclusive send operation. */
47
+ startSend(request: TerminalSendRequest): TerminalSendOperation
48
+ /** Read one bounded page from retained scrollback. */
49
+ read(request: TerminalReadRequest): TerminalReadResult
50
+ /** Signal the verified foreground process group. */
51
+ signal(signal: TerminalSignal): Promise<TerminalSignalResult>
52
+ /** Observe top-level process status. */
53
+ status(): TerminalSessionStatus
54
+ /** Idempotently close the captured owned process tree and await quiescence. */
55
+ close(reason: string): Promise<void>
56
+ }
57
+ ```
58
+
59
+ ## Send and retained output
60
+
61
+ One live session accepts one active send. Its operation exposes a consuming output cursor for generic background jobs and one terminal result for a foreground caller. `TerminalReadResult` separately pages the bounded session scrollback.
62
+
63
+ ```ts type-equiv
64
+ /** Live backend-owned send; exactly one may be active per PTY session. */
65
+ interface TerminalSendOperation {
66
+ /** Resolves after readiness, timeout, cancellation, or top-level process exit. */
67
+ done: Promise<TerminalSendResult>
68
+ /** Consume output produced since the prior call. */
69
+ readOutput(): TerminalSendRead
70
+ /** Request `SIGINT`; returns false after the operation settled. */
71
+ cancel(): boolean
72
+ }
73
+ ```
74
+
75
+ ```ts type-equiv
76
+ /** Settled result for one foreground or background send. */
77
+ interface TerminalSendResult {
78
+ /** Bounded rendered terminal delta remaining at settlement. */
79
+ viewport: string
80
+ /** Why the wait returned; this does not imply arbitrary child-process exit. */
81
+ waitReason: TerminalWaitReason
82
+ /** Top-level session status observed at settlement. */
83
+ sessionStatus: TerminalSessionStatus
84
+ /** Whether output was dropped from the operation or retained scrollback. */
85
+ truncated: boolean
86
+ }
87
+ ```
88
+
89
+ ## Ownership and durability
90
+
91
+ `TerminalSessionService` attaches one awaited cleanup to the exact owner scope, rejects foreign operations, and keeps sessions alive across backend or tool-plugin reload. PTY state and raw bytes remain process-local. Model input and bounded returned output are durable through the existing `tool/call`, `tool/result`, and task-result paths rather than duplicate PTY session events.
92
+
93
+ <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
94
+
95
+ <a id="cordis-surface"></a>
96
+
97
+ ## Cordis API
98
+
99
+ 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).
100
+
101
+ <a id="ctxterminals--terminalsessionservice"></a>
102
+
103
+ ### `ctx.terminals` — `TerminalSessionService`
104
+
105
+ In-process registry for replaceable PTY backends and exact-Agent sessions.
106
+
107
+ ```ts cordis-catalog
108
+ /**
109
+ * Register one backend type for this effect scope.
110
+ * @param backend - provider with a non-empty unique type.
111
+ * @returns disposer that removes exactly this contribution.
112
+ */
113
+ registerBackend(backend: TerminalBackend): () => void
114
+
115
+ /**
116
+ * List registered backend types in registration order.
117
+ * @returns fresh backend type names.
118
+ */
119
+ listBackends(): string[]
120
+
121
+ /**
122
+ * Create and publish one owner-scoped session after backend setup succeeds.
123
+ * @param owner - exact registered Agent that owns access and cleanup.
124
+ * @param request - backend type plus optional owner-local name and cwd.
125
+ * @param signal - cancellation of unpublished setup.
126
+ * @returns published identity, metadata, status, and MOTD.
127
+ */
128
+ async spawn(owner: Agent, request: TerminalSpawnRequest, signal?: AbortSignal): Promise<TerminalSpawnResult>
129
+
130
+ /**
131
+ * Test whether an exact owner has a published session or unpublished spawn.
132
+ * @param owner - exact live owner to inspect.
133
+ * @returns true across the entire spawn-to-close interval, with no publication gap.
134
+ */
135
+ hasOwnerActivity(owner: Agent): boolean
136
+
137
+ /**
138
+ * Start one exclusive interactive send.
139
+ * @param owner - exact session owner.
140
+ * @param id - target PTY identity.
141
+ * @param request - explicit text, submit behavior, and cancellation.
142
+ * @returns live operation handle for foreground await or task registration.
143
+ */
144
+ startSend(owner: Agent, id: TerminalSessionId, request: TerminalSendRequest): TerminalSendOperation
145
+
146
+ /**
147
+ * Read one bounded scrollback page from an owned session.
148
+ * @param owner - exact session owner.
149
+ * @param id - target PTY identity.
150
+ * @param request - optional newest-relative offset and line count.
151
+ * @returns bounded retained text and pagination metadata.
152
+ */
153
+ read(owner: Agent, id: TerminalSessionId, request: TerminalReadRequest = {}): TerminalReadResult
154
+
155
+ /**
156
+ * Deliver an allowed signal through an owned backend session.
157
+ * @param owner - exact session owner.
158
+ * @param id - target PTY identity.
159
+ * @param signal - allowed POSIX signal name.
160
+ * @returns delivered foreground process-group identity.
161
+ */
162
+ signal(owner: Agent, id: TerminalSessionId, signal: TerminalSignal): Promise<TerminalSignalResult>
163
+
164
+ /**
165
+ * Close one owned session and remove it only after quiescent backend cleanup.
166
+ * @param owner - exact session owner.
167
+ * @param id - target PTY identity.
168
+ * @param reason - diagnostic cleanup reason.
169
+ * @returns true for a newly closed session, false when the same close is already in flight.
170
+ */
171
+ async kill(owner: Agent, id: TerminalSessionId, reason: string = 'model request'): Promise<boolean>
172
+
173
+ /**
174
+ * List fresh snapshots for exactly one owner.
175
+ * @param owner - exact owner whose sessions are visible.
176
+ * @returns owner-visible snapshots in publication order.
177
+ */
178
+ list(owner: Agent): TerminalSessionSnapshot[]
179
+ ```
180
+
181
+ Types: [Agent](core.md)
182
+
183
+ Source: [`packages/terminal/terminal/src/index.ts:105`](../../packages/terminal/terminal/src/index.ts)
184
+ <!-- END GENERATED cordis-surface -->