dsh-plugin-dev-kb 1.4.0 → 1.5.2

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 (415) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.en.md +6 -6
  3. package/README.md +10 -5
  4. package/kb/INDEX.md +8 -4
  5. package/kb/extra/AGENTS.md +4 -3
  6. package/kb/extra/agent-lifecycle.md +91 -0
  7. package/kb/extra/agent-lifecycle.zh.md +93 -0
  8. package/kb/extra/api-gateway.md +172 -0
  9. package/kb/extra/api-gateway.zh.md +178 -0
  10. package/kb/extra/architecture.md +165 -0
  11. package/kb/extra/architecture.zh.md +169 -0
  12. package/kb/extra/capability-seams.md +714 -0
  13. package/kb/extra/capability-seams.zh.md +716 -0
  14. package/kb/extra/cli-help.md +203 -0
  15. package/kb/extra/cli-help.zh.md +205 -0
  16. package/kb/extra/config-catalog.md +4801 -0
  17. package/kb/extra/config-catalog.zh.md +4803 -0
  18. package/kb/extra/cookbook/adding-a-package.md +170 -0
  19. package/kb/extra/cookbook/adding-a-package.zh.md +170 -0
  20. package/kb/extra/cookbook/adding-a-plugin-preview.md +52 -0
  21. package/kb/extra/cookbook/adding-a-plugin-preview.zh.md +52 -0
  22. package/kb/extra/cookbook/adding-a-session-format-version.md +7 -5
  23. package/kb/extra/cookbook/adding-a-session-format-version.zh.md +7 -5
  24. package/kb/extra/cookbook/adding-a-settings-card.md +72 -0
  25. package/kb/extra/cookbook/adding-a-settings-card.zh.md +72 -0
  26. package/kb/extra/cookbook/adding-a-tool.md +101 -0
  27. package/kb/extra/cookbook/adding-a-tool.zh.md +103 -0
  28. package/kb/extra/cookbook/adding-an-llm-adapter.md +43 -0
  29. package/kb/extra/cookbook/adding-an-llm-adapter.zh.md +43 -0
  30. package/kb/extra/cookbook/extension-cookbook.md +132 -0
  31. package/kb/extra/cookbook/extension-cookbook.zh.md +136 -0
  32. package/kb/extra/cookbook/reviewing-persistence-type-changes.md +11 -9
  33. package/kb/extra/cookbook/reviewing-persistence-type-changes.zh.md +11 -9
  34. package/kb/extra/cordis-api/context.md +364 -0
  35. package/kb/extra/cordis-api/context.zh.md +366 -0
  36. package/kb/extra/cordis-api/events.md +207 -0
  37. package/kb/extra/cordis-api/events.zh.md +209 -0
  38. package/kb/extra/cordis-api/fiber.md +375 -0
  39. package/kb/extra/cordis-api/fiber.zh.md +377 -0
  40. package/kb/extra/cordis-api/inherited.md +38 -0
  41. package/kb/extra/cordis-api/registry.md +152 -0
  42. package/kb/extra/cordis-api/registry.zh.md +154 -0
  43. package/kb/extra/cordis-api/service.md +102 -0
  44. package/kb/extra/cordis-api/service.zh.md +104 -0
  45. package/kb/extra/cordis-tutorial/01-first-plugin.md +95 -0
  46. package/kb/extra/cordis-tutorial/01-first-plugin.zh.md +95 -0
  47. package/kb/extra/cordis-tutorial/02-lifecycle-and-effects.md +98 -0
  48. package/kb/extra/cordis-tutorial/02-lifecycle-and-effects.zh.md +98 -0
  49. package/kb/extra/cordis-tutorial/03-services.md +98 -0
  50. package/kb/extra/cordis-tutorial/03-services.zh.md +98 -0
  51. package/kb/extra/cordis-tutorial/04-events.md +144 -0
  52. package/kb/extra/cordis-tutorial/04-events.zh.md +144 -0
  53. package/kb/extra/cordis-tutorial/05-config.md +111 -0
  54. package/kb/extra/cordis-tutorial/05-config.zh.md +111 -0
  55. package/kb/extra/cordis-tutorial/06-composition-and-hmr.md +113 -0
  56. package/kb/extra/cordis-tutorial/06-composition-and-hmr.zh.md +113 -0
  57. package/kb/extra/cordis-tutorial/07-into-the-harness.md +108 -0
  58. package/kb/extra/cordis-tutorial/07-into-the-harness.zh.md +108 -0
  59. package/kb/extra/cordis-tutorial/index.md +60 -0
  60. package/kb/extra/cordis-tutorial/index.zh.md +62 -0
  61. package/kb/extra/deepseek-llm-api-wire-extensions.md +5 -5
  62. package/kb/extra/deepseek-llm-api-wire-extensions.zh.md +5 -5
  63. package/kb/extra/defensive-patterns/README.md +25 -0
  64. package/kb/extra/defensive-patterns/README.zh.md +27 -0
  65. package/kb/extra/defensive-patterns/client-components.md +493 -0
  66. package/kb/extra/defensive-patterns/client-components.zh.md +495 -0
  67. package/kb/extra/defensive-patterns/conversation-and-session.md +316 -0
  68. package/kb/extra/defensive-patterns/conversation-and-session.zh.md +316 -0
  69. package/kb/extra/defensive-patterns/general.md +222 -0
  70. package/kb/extra/defensive-patterns/general.zh.md +252 -0
  71. package/kb/extra/defensive-patterns/package-surface.md +231 -0
  72. package/kb/extra/defensive-patterns/package-surface.zh.md +231 -0
  73. package/kb/extra/defensive-patterns/remote-and-api.md +115 -0
  74. package/kb/extra/defensive-patterns/remote-and-api.zh.md +115 -0
  75. package/kb/extra/development.md +31 -11
  76. package/kb/extra/development.zh.md +32 -11
  77. package/kb/extra/event-producer-consumer.md +40 -39
  78. package/kb/extra/event-producer-consumer.zh.md +40 -39
  79. package/kb/extra/experimental-persistence-catalog.md +17 -0
  80. package/kb/extra/experimental-persistence-catalog.zh.md +17 -0
  81. package/kb/extra/glossary.md +1 -0
  82. package/kb/extra/glossary.zh.md +1 -0
  83. package/kb/extra/i18n/style-samples.md +2 -2
  84. package/kb/extra/i18n/terminology.md +1 -0
  85. package/kb/extra/module-graph.md +274 -195
  86. package/kb/extra/module-graph.zh.md +274 -195
  87. package/kb/extra/persistence-catalog.md +9140 -0
  88. package/kb/extra/persistence-catalog.zh.md +9142 -0
  89. package/kb/extra/persistence-changes/2026-09-13-working-directory.md +48 -0
  90. package/kb/extra/persistence-changes/2026-09-13-working-directory.zh.md +48 -0
  91. package/kb/extra/persistence-changes/2026-09-16-session-format-v4.md +2 -2
  92. package/kb/extra/persistence-changes/2026-09-16-session-format-v4.zh.md +2 -2
  93. package/kb/extra/persistence-changes/2026-09-19-external-subagent-catalog.md +48 -0
  94. package/kb/extra/persistence-changes/2026-09-19-external-subagent-catalog.zh.md +48 -0
  95. package/kb/extra/persistence-changes/2026-09-30-job-session-lifecycle.md +52 -0
  96. package/kb/extra/persistence-changes/2026-09-30-job-session-lifecycle.zh.md +52 -0
  97. package/kb/extra/persistence-changes/2026-10-05-ptc-operation-metadata.md +48 -0
  98. package/kb/extra/persistence-changes/2026-10-05-ptc-operation-metadata.zh.md +48 -0
  99. package/kb/extra/persistence-changes/2026-10-05-working-directory-attribution.md +60 -0
  100. package/kb/extra/persistence-changes/2026-10-05-working-directory-attribution.zh.md +60 -0
  101. package/kb/extra/persistence-changes/2026-10-07-title-reasoning-effort.md +48 -0
  102. package/kb/extra/persistence-changes/2026-10-07-title-reasoning-effort.zh.md +48 -0
  103. package/kb/extra/persistence-changes/2026-10-13-deepseek-search-thinking.md +48 -0
  104. package/kb/extra/persistence-changes/2026-10-13-deepseek-search-thinking.zh.md +48 -0
  105. package/kb/extra/persistence-changes/2026-10-13-user-rpc-principal.md +60 -0
  106. package/kb/extra/persistence-changes/2026-10-13-user-rpc-principal.zh.md +60 -0
  107. package/kb/extra/persistence-changes/README.md +12 -10
  108. package/kb/extra/persistence-changes/README.zh.md +12 -10
  109. package/kb/extra/persistence-changes/historical-formats/README.md +1 -1
  110. package/kb/extra/persistence-changes/historical-formats/README.zh.md +1 -1
  111. package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.2.md +50 -50
  112. package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.2.zh.md +50 -50
  113. package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.3.md +14 -14
  114. package/kb/extra/persistence-changes/releases/dsh-v0.0.1-rc.3.zh.md +14 -14
  115. package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.7.md +3 -3
  116. package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.7.zh.md +3 -3
  117. package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.8.md +10 -10
  118. package/kb/extra/persistence-changes/releases/dsh-v0.1.0-rc.8.zh.md +10 -10
  119. package/kb/extra/persistence-changes/releases/dsh-v0.1.1-rc.1.md +3 -3
  120. package/kb/extra/persistence-changes/releases/dsh-v0.1.1-rc.1.zh.md +3 -3
  121. package/kb/extra/persistence-changes/releases/dsh-v0.1.1-rc.2.md +13 -13
  122. package/kb/extra/persistence-changes/releases/dsh-v0.1.1-rc.2.zh.md +13 -13
  123. package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.1.md +63 -63
  124. package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.1.zh.md +63 -63
  125. package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.2.md +54 -54
  126. package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.2.zh.md +54 -54
  127. package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.4.md +7 -7
  128. package/kb/extra/persistence-changes/releases/dsh-v0.1.2-alpha.4.zh.md +7 -7
  129. package/kb/extra/persistence-changes/releases/dsh-v0.1.3-alpha.1.md +27 -27
  130. package/kb/extra/persistence-changes/releases/dsh-v0.1.3-alpha.1.zh.md +27 -27
  131. package/kb/extra/persistence-changes/releases/dsh-v0.1.3-alpha.2.md +4 -4
  132. package/kb/extra/persistence-changes/releases/dsh-v0.1.3-alpha.2.zh.md +4 -4
  133. package/kb/extra/persistence-changes/releases/dsh-v0.1.5-alpha.1.md +27 -27
  134. package/kb/extra/persistence-changes/releases/dsh-v0.1.5-alpha.1.zh.md +27 -27
  135. package/kb/extra/persistence-changes/releases/dsh-v0.1.5-alpha.2.md +7 -7
  136. package/kb/extra/persistence-changes/releases/dsh-v0.1.5-alpha.2.zh.md +7 -7
  137. package/kb/extra/session-format-status.md +6 -6
  138. package/kb/extra/session-format-status.zh.md +6 -6
  139. package/kb/extra/subsystems/README.md +76 -0
  140. package/kb/extra/subsystems/README.zh.md +76 -0
  141. package/kb/extra/subsystems/agent-team.md +10 -10
  142. package/kb/extra/subsystems/agent-team.zh.md +10 -10
  143. package/kb/extra/subsystems/approval.md +170 -0
  144. package/kb/extra/subsystems/approval.zh.md +170 -0
  145. package/kb/extra/subsystems/boot.md +128 -4
  146. package/kb/extra/subsystems/boot.zh.md +128 -4
  147. package/kb/extra/subsystems/claude-code-mods.md +1 -1
  148. package/kb/extra/subsystems/claude-code-mods.zh.md +1 -1
  149. package/kb/extra/subsystems/client-modules.md +198 -0
  150. package/kb/extra/subsystems/client-modules.zh.md +198 -0
  151. package/kb/extra/subsystems/client-resources.md +92 -0
  152. package/kb/extra/subsystems/client-resources.zh.md +92 -0
  153. package/kb/extra/subsystems/commands.md +223 -0
  154. package/kb/extra/subsystems/commands.zh.md +223 -0
  155. package/kb/extra/subsystems/compaction.md +284 -0
  156. package/kb/extra/subsystems/compaction.zh.md +284 -0
  157. package/kb/extra/subsystems/computer-use.md +3 -0
  158. package/kb/extra/subsystems/computer-use.zh.md +3 -0
  159. package/kb/extra/subsystems/conversation.md +301 -0
  160. package/kb/extra/subsystems/conversation.zh.md +303 -0
  161. package/kb/extra/subsystems/core.md +1113 -0
  162. package/kb/extra/subsystems/core.zh.md +1125 -0
  163. package/kb/extra/subsystems/credentials.md +493 -0
  164. package/kb/extra/subsystems/credentials.zh.md +493 -0
  165. package/kb/extra/subsystems/filesystem.md +530 -0
  166. package/kb/extra/subsystems/filesystem.zh.md +530 -0
  167. package/kb/extra/subsystems/goal.md +313 -0
  168. package/kb/extra/subsystems/goal.zh.md +313 -0
  169. package/kb/extra/subsystems/jobs.md +554 -0
  170. package/kb/extra/subsystems/jobs.zh.md +554 -0
  171. package/kb/extra/subsystems/llm-streaming.md +1196 -0
  172. package/kb/extra/subsystems/llm-streaming.zh.md +1202 -0
  173. package/kb/extra/subsystems/lsp.md +202 -0
  174. package/kb/extra/subsystems/lsp.zh.md +202 -0
  175. package/kb/extra/subsystems/permission-presets.md +167 -0
  176. package/kb/extra/subsystems/permission-presets.zh.md +167 -0
  177. package/kb/extra/subsystems/persistence.md +418 -0
  178. package/kb/extra/subsystems/persistence.zh.md +418 -0
  179. package/kb/extra/subsystems/plan.md +87 -0
  180. package/kb/extra/subsystems/plan.zh.md +87 -0
  181. package/kb/extra/subsystems/product-telemetry.md +4 -2
  182. package/kb/extra/subsystems/product-telemetry.zh.md +4 -2
  183. package/kb/extra/subsystems/ptc-runtime.md +250 -0
  184. package/kb/extra/subsystems/ptc-runtime.zh.md +250 -0
  185. package/kb/extra/subsystems/sandbox.md +221 -0
  186. package/kb/extra/subsystems/sandbox.zh.md +221 -0
  187. package/kb/extra/subsystems/schedule.md +550 -0
  188. package/kb/extra/subsystems/schedule.zh.md +550 -0
  189. package/kb/extra/subsystems/scope.md +59 -0
  190. package/kb/extra/subsystems/scope.zh.md +61 -0
  191. package/kb/extra/subsystems/session-projection.md +356 -0
  192. package/kb/extra/subsystems/session-projection.zh.md +356 -0
  193. package/kb/extra/subsystems/session-query.md +511 -0
  194. package/kb/extra/subsystems/session-query.zh.md +511 -0
  195. package/kb/extra/subsystems/session-reference.md +224 -0
  196. package/kb/extra/subsystems/session-reference.zh.md +224 -0
  197. package/kb/extra/subsystems/session-telemetry.md +212 -0
  198. package/kb/extra/subsystems/session-telemetry.zh.md +212 -0
  199. package/kb/extra/subsystems/session-title.md +213 -0
  200. package/kb/extra/subsystems/session-title.zh.md +213 -0
  201. package/kb/extra/subsystems/session.md +1339 -0
  202. package/kb/extra/subsystems/session.zh.md +1343 -0
  203. package/kb/extra/subsystems/settings.md +155 -0
  204. package/kb/extra/subsystems/settings.zh.md +155 -0
  205. package/kb/extra/subsystems/shell.md +314 -0
  206. package/kb/extra/subsystems/shell.zh.md +314 -0
  207. package/kb/extra/subsystems/sidebar-right.md +160 -0
  208. package/kb/extra/subsystems/sidebar-right.zh.md +160 -0
  209. package/kb/extra/subsystems/skills.md +352 -0
  210. package/kb/extra/subsystems/skills.zh.md +352 -0
  211. package/kb/extra/subsystems/slots.md +200 -0
  212. package/kb/extra/subsystems/slots.zh.md +204 -0
  213. package/kb/extra/subsystems/spill.md +124 -0
  214. package/kb/extra/subsystems/spill.zh.md +124 -0
  215. package/kb/extra/subsystems/ssh.md +22 -11
  216. package/kb/extra/subsystems/ssh.zh.md +22 -11
  217. package/kb/extra/subsystems/storage.md +259 -0
  218. package/kb/extra/subsystems/storage.zh.md +259 -0
  219. package/kb/extra/subsystems/subagent.md +686 -0
  220. package/kb/extra/subsystems/subagent.zh.md +688 -0
  221. package/kb/extra/subsystems/subprocess.md +321 -0
  222. package/kb/extra/subsystems/subprocess.zh.md +321 -0
  223. package/kb/extra/subsystems/system-prompt.md +254 -0
  224. package/kb/extra/subsystems/system-prompt.zh.md +254 -0
  225. package/kb/extra/subsystems/terminal.md +184 -0
  226. package/kb/extra/subsystems/terminal.zh.md +184 -0
  227. package/kb/extra/subsystems/token-meter.md +106 -0
  228. package/kb/extra/subsystems/token-meter.zh.md +106 -0
  229. package/kb/extra/subsystems/tools.md +747 -0
  230. package/kb/extra/subsystems/tools.zh.md +747 -0
  231. package/kb/extra/subsystems/translation.md +103 -0
  232. package/kb/extra/subsystems/translation.zh.md +103 -0
  233. package/kb/extra/subsystems/typert.md +690 -0
  234. package/kb/extra/subsystems/typert.zh.md +690 -0
  235. package/kb/extra/subsystems/user-questions.md +307 -0
  236. package/kb/extra/subsystems/user-questions.zh.md +307 -0
  237. package/kb/extra/subsystems/web-client.md +100 -0
  238. package/kb/extra/subsystems/web-client.zh.md +100 -0
  239. package/kb/extra/subsystems/web-server.md +302 -0
  240. package/kb/extra/subsystems/web-server.zh.md +302 -0
  241. package/kb/extra/subsystems/web.md +206 -0
  242. package/kb/extra/subsystems/web.zh.md +206 -0
  243. package/kb/extra/subsystems/webhook.md +1 -1
  244. package/kb/extra/subsystems/webhook.zh.md +1 -1
  245. package/kb/extra/subsystems/workflow.md +278 -0
  246. package/kb/extra/subsystems/workflow.zh.md +278 -0
  247. package/kb/extra/subsystems/working-directory.md +64 -0
  248. package/kb/extra/subsystems/working-directory.zh.md +64 -0
  249. package/kb/extra/subsystems/workspace.md +647 -0
  250. package/kb/extra/subsystems/workspace.zh.md +647 -0
  251. package/kb/extra/subsystems/worktrees.md +76 -0
  252. package/kb/extra/subsystems/worktrees.zh.md +76 -0
  253. package/kb/extra/testing.md +1 -1
  254. package/kb/extra/testing.zh.md +1 -1
  255. package/kb/extra/tool-catalog.md +2824 -0
  256. package/kb/extra/tool-catalog.zh.md +2832 -0
  257. package/kb/extra/tool-execution-pipeline.md +65 -0
  258. package/kb/extra/tool-execution-pipeline.zh.md +67 -0
  259. package/kb/extra/ui-radius.md +6 -4
  260. package/kb/extra/ui-radius.zh.md +6 -4
  261. package/kb/extra/upgrade-guide/v0.2.0-rc.2/bundled-python-tests/guide.md +18 -0
  262. package/kb/extra/upgrade-guide/v0.2.0-rc.2/bundled-python-tests/guide.zh.md +18 -0
  263. package/kb/extra/upgrade-guide/v0.2.0-rc.2/primary-runtime-python-aliases/guide.md +18 -0
  264. package/kb/extra/upgrade-guide/v0.2.0-rc.2/primary-runtime-python-aliases/guide.zh.md +18 -0
  265. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/deepseek-model-discovery/guide.md +17 -0
  266. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/deepseek-model-discovery/guide.zh.md +17 -0
  267. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/desktop-test-auth-popup/guide.md +18 -0
  268. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/desktop-test-auth-popup/guide.zh.md +18 -0
  269. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/experimental-package-composition/guide.md +28 -0
  270. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/experimental-package-composition/guide.zh.md +28 -0
  271. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/instruction-home-override/guide.md +20 -0
  272. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/instruction-home-override/guide.zh.md +20 -0
  273. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/job-id-identity/guide.md +18 -0
  274. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/job-id-identity/guide.zh.md +18 -0
  275. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/jsonl-persistence-plugin/guide.md +18 -0
  276. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/jsonl-persistence-plugin/guide.zh.md +18 -0
  277. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/mock-messages-events/guide.md +17 -0
  278. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/mock-messages-events/guide.zh.md +17 -0
  279. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/native-subagent-bundle-tools/guide.md +31 -0
  280. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/native-subagent-bundle-tools/guide.zh.md +31 -0
  281. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/new-session-generations/guide.md +20 -0
  282. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/new-session-generations/guide.zh.md +20 -0
  283. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/plugin-option-placement/guide.md +20 -0
  284. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/plugin-option-placement/guide.zh.md +20 -0
  285. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/python-optional-resources/guide.md +18 -0
  286. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/python-optional-resources/guide.zh.md +18 -0
  287. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/python-ptc-sandbox/guide.md +21 -0
  288. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/python-ptc-sandbox/guide.zh.md +21 -0
  289. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/session-title-adapters/guide.md +18 -0
  290. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/session-title-adapters/guide.zh.md +18 -0
  291. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/session-title-provider-strategy/guide.md +20 -0
  292. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/session-title-provider-strategy/guide.zh.md +20 -0
  293. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/ssh-helper-launch/guide.md +19 -0
  294. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/ssh-helper-launch/guide.zh.md +19 -0
  295. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/subagent-activations/guide.md +59 -0
  296. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/subagent-activations/guide.zh.md +59 -0
  297. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/subagent-preset-composition/guide.md +21 -0
  298. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/subagent-preset-composition/guide.zh.md +21 -0
  299. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/team-direct-inbox/guide.md +21 -0
  300. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/team-direct-inbox/guide.zh.md +21 -0
  301. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/terminal-command-labels/guide.md +18 -0
  302. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/terminal-command-labels/guide.zh.md +18 -0
  303. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/tool-presentation-mode/guide.md +21 -0
  304. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/tool-presentation-mode/guide.zh.md +21 -0
  305. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/web-listener-trust-config/guide.md +36 -0
  306. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/web-listener-trust-config/guide.zh.md +36 -0
  307. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/working-directory/guide.md +25 -0
  308. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/working-directory/guide.zh.md +25 -0
  309. package/kb/extra/upgrade-guide/v0.2.1-alpha.2/deepseek-account-identity-watch/guide.md +18 -0
  310. package/kb/extra/upgrade-guide/v0.2.1-alpha.2/deepseek-account-identity-watch/guide.zh.md +18 -0
  311. package/kb/extra/upgrade-guide/v0.2.1-alpha.2/deepseek-account-model-catalog/guide.md +27 -0
  312. package/kb/extra/upgrade-guide/v0.2.1-alpha.2/deepseek-account-model-catalog/guide.zh.md +27 -0
  313. package/kb/extra/upgrade-guide/v0.2.1-alpha.2/desktop-font-size-shortcuts/guide.md +18 -0
  314. package/kb/extra/upgrade-guide/v0.2.1-alpha.2/desktop-font-size-shortcuts/guide.zh.md +18 -0
  315. package/kb/extra/upgrade-guide/v0.2.1-alpha.2/from-default-profile-replaces-target/guide.md +20 -0
  316. package/kb/extra/upgrade-guide/v0.2.1-alpha.2/from-default-profile-replaces-target/guide.zh.md +20 -0
  317. package/kb/extra/upgrade-guide/v0.2.1-alpha.2/operator-connect/guide.md +18 -0
  318. package/kb/extra/upgrade-guide/v0.2.1-alpha.2/operator-connect/guide.zh.md +18 -0
  319. package/kb/extra/upgrade-guide/v0.2.1-alpha.2/pi-ai-azure-provider/guide.md +19 -0
  320. package/kb/extra/upgrade-guide/v0.2.1-alpha.2/pi-ai-azure-provider/guide.zh.md +19 -0
  321. package/kb/extra/upgrade-guide/v0.2.1-alpha.2/pi-ai-model-discovery/guide.md +17 -0
  322. package/kb/extra/upgrade-guide/v0.2.1-alpha.2/pi-ai-model-discovery/guide.zh.md +17 -0
  323. package/kb/extra/upgrade-guide/v0.2.1-alpha.2/plugin-install-over-installed/guide.md +20 -0
  324. package/kb/extra/upgrade-guide/v0.2.1-alpha.2/plugin-install-over-installed/guide.zh.md +20 -0
  325. package/kb/extra/upgrade-guide/v0.2.1-alpha.2/sdk-minimal-image-compaction/guide.md +32 -0
  326. package/kb/extra/upgrade-guide/v0.2.1-alpha.2/sdk-minimal-image-compaction/guide.zh.md +32 -0
  327. package/kb/extra/upgrade-guide/v0.2.1-alpha.2/stored-credentials-precedence/guide.md +25 -0
  328. package/kb/extra/upgrade-guide/v0.2.1-alpha.2/stored-credentials-precedence/guide.zh.md +25 -0
  329. package/kb/extra/upgrade-guide/v0.2.1-alpha.3/plugin-engines-dsh/guide.md +21 -0
  330. package/kb/extra/upgrade-guide/v0.2.1-alpha.3/plugin-engines-dsh/guide.zh.md +21 -0
  331. package/kb/extra/upgrade-guide/v0.2.1-alpha.4/account-notification-fields/guide.md +18 -0
  332. package/kb/extra/upgrade-guide/v0.2.1-alpha.4/account-notification-fields/guide.zh.md +18 -0
  333. package/kb/meta/search-index.json +1932 -366
  334. package/kb/meta/source.json +9 -8
  335. package/kb/site/develop/basic/publish.md +3 -1
  336. package/kb/site/en/develop/basic/publish.md +3 -1
  337. package/kb/site/en/guide/github-review.md +7 -10
  338. package/kb/site/en/guide/plugin-market.md +151 -0
  339. package/kb/site/en/guide/providers.md +27 -4
  340. package/kb/site/en/guide/public-deployments.md +10 -6
  341. package/kb/site/en/guide/python-sdk.md +8 -9
  342. package/kb/site/en/reference/api-gateway.md +10 -3
  343. package/kb/site/en/reference/capability-seams.md +71 -24
  344. package/kb/site/en/reference/config-catalog.md +452 -191
  345. package/kb/site/en/reference/experimental-persistence-catalog.md +20 -0
  346. package/kb/site/en/reference/index.md +11 -12
  347. package/kb/site/en/reference/persistence-catalog.md +552 -192
  348. package/kb/site/en/reference/subsystems/client-modules.md +14 -0
  349. package/kb/site/en/reference/subsystems/conversation.md +14 -0
  350. package/kb/site/en/reference/subsystems/core.md +3 -1
  351. package/kb/site/en/reference/subsystems/credentials.md +13 -12
  352. package/kb/site/en/reference/subsystems/index.md +4 -1
  353. package/kb/site/en/reference/subsystems/jobs.md +62 -7
  354. package/kb/site/en/reference/subsystems/llm-streaming.md +82 -15
  355. package/kb/site/en/reference/subsystems/persistence.md +2 -0
  356. package/kb/site/en/reference/subsystems/plan.md +1 -1
  357. package/kb/site/en/reference/subsystems/ptc-runtime.md +24 -6
  358. package/kb/site/en/reference/subsystems/session-query.md +2 -0
  359. package/kb/site/en/reference/subsystems/session-title.md +14 -5
  360. package/kb/site/en/reference/subsystems/session.md +59 -14
  361. package/kb/site/en/reference/subsystems/sidebar-right.md +2 -0
  362. package/kb/site/en/reference/subsystems/skills.md +2 -2
  363. package/kb/site/en/reference/subsystems/slots.md +80 -83
  364. package/kb/site/en/reference/subsystems/subagent.md +175 -247
  365. package/kb/site/en/reference/subsystems/system-prompt.md +32 -2
  366. package/kb/site/en/reference/subsystems/tools.md +3 -3
  367. package/kb/site/en/reference/subsystems/typert.md +222 -17
  368. package/kb/site/en/reference/subsystems/web-client.md +1 -1
  369. package/kb/site/en/reference/subsystems/web-server.md +87 -11
  370. package/kb/site/en/reference/subsystems/web.md +2 -2
  371. package/kb/site/en/reference/subsystems/workflow.md +1 -1
  372. package/kb/site/en/reference/subsystems/workspace.md +25 -37
  373. package/kb/site/en/reference/tool-catalog.md +156 -51
  374. package/kb/site/guide/github-review.md +7 -10
  375. package/kb/site/guide/plugin-market.md +151 -0
  376. package/kb/site/guide/providers.md +27 -4
  377. package/kb/site/guide/public-deployments.md +10 -6
  378. package/kb/site/guide/python-sdk.md +8 -9
  379. package/kb/site/reference/api-gateway.md +16 -3
  380. package/kb/site/reference/capability-seams.md +71 -24
  381. package/kb/site/reference/config-catalog.md +452 -191
  382. package/kb/site/reference/experimental-persistence-catalog.md +20 -0
  383. package/kb/site/reference/index.md +11 -12
  384. package/kb/site/reference/persistence-catalog.md +552 -192
  385. package/kb/site/reference/subsystems/client-modules.md +14 -0
  386. package/kb/site/reference/subsystems/conversation.md +16 -0
  387. package/kb/site/reference/subsystems/core.md +5 -1
  388. package/kb/site/reference/subsystems/credentials.md +13 -12
  389. package/kb/site/reference/subsystems/index.md +4 -1
  390. package/kb/site/reference/subsystems/jobs.md +62 -7
  391. package/kb/site/reference/subsystems/llm-streaming.md +82 -15
  392. package/kb/site/reference/subsystems/persistence.md +2 -0
  393. package/kb/site/reference/subsystems/plan.md +1 -1
  394. package/kb/site/reference/subsystems/ptc-runtime.md +24 -6
  395. package/kb/site/reference/subsystems/scope.md +2 -0
  396. package/kb/site/reference/subsystems/session-query.md +2 -0
  397. package/kb/site/reference/subsystems/session-title.md +14 -5
  398. package/kb/site/reference/subsystems/session.md +59 -14
  399. package/kb/site/reference/subsystems/sidebar-right.md +2 -0
  400. package/kb/site/reference/subsystems/skills.md +2 -2
  401. package/kb/site/reference/subsystems/slots.md +84 -83
  402. package/kb/site/reference/subsystems/subagent.md +177 -251
  403. package/kb/site/reference/subsystems/system-prompt.md +32 -2
  404. package/kb/site/reference/subsystems/tools.md +3 -3
  405. package/kb/site/reference/subsystems/typert.md +222 -17
  406. package/kb/site/reference/subsystems/web-client.md +1 -1
  407. package/kb/site/reference/subsystems/web-server.md +87 -11
  408. package/kb/site/reference/subsystems/web.md +2 -2
  409. package/kb/site/reference/subsystems/workflow.md +1 -1
  410. package/kb/site/reference/subsystems/workspace.md +25 -37
  411. package/kb/site/reference/tool-catalog.md +160 -55
  412. package/package.json +2 -2
  413. package/skills/dsh-dev-sandbox.md +70 -0
  414. package/kb/extra/defensive-patterns.md +0 -33
  415. package/kb/extra/defensive-patterns.zh.md +0 -35
@@ -0,0 +1,136 @@
1
+ # 实操手册:扩展插件形态
2
+
3
+ [English](extension-cookbook.md) | 中文
4
+
5
+ harness 扩展的参考模式。代码片段省略了 import 和辅助实现,无法直接复制运行。具体编写路径见[包检查清单](adding-a-package.zh.md)、[第一个工具教程](../user/develop/basic/tool.zh.md)、[工具参考](adding-a-tool.zh.md)、[LLM(大语言模型)适配器指南](adding-an-llm-adapter.zh.md)和 [Session 格式版本教程](adding-a-session-format-version.zh.md);系统与扩展点映射由[架构文档](../architecture.zh.md)负责。
6
+
7
+ ## 工具插件
8
+
9
+ 工具在 `ctx.tools` 上注册。带注解的 `defineTool` 示例(类型化的 `execute` 参数、结果构造、`run_in_background` 模式)见 [adding-a-tool.md](adding-a-tool.zh.md)——该指南是工具定义的真源。`ctx.tools.register()` 也直接接受原始 JSON Schema `ToolDefinition`(MCP 来源的工具就是这样到达的);`defineTool` 是第一方工具使用的类型化辅助函数。
10
+
11
+ <a id="a-hook-plugin-permission-gate-example"></a>
12
+
13
+ ## 钩子插件(以权限门禁为例)
14
+
15
+ 这个权限门禁是钩子插件的一个示例。它从 `tools/pre-execute` 门禁返回一个类型化的决策,用于允许或拒绝一次调用;沙箱、权限和 plan-mode 插件都可以使用该扩展点。钩子插件也可以拦截其他扩展点,本身并不等同于权限门禁。「原生钩子」是在拦截点上运行的普通 Cordis 插件,不需要外部协议。
16
+
17
+ ```ts
18
+ import type { Context } from '@deepseek-ai/cordis'
19
+ import type { PreToolDecision, ToolExecution } from '@deepseek-ai/dsh-tools'
20
+
21
+ declare function isAllowed(exec: ToolExecution): Promise<boolean>
22
+
23
+ export const name = 'permission-gate'
24
+
25
+ export function apply(ctx: Context) {
26
+ ctx.on('tools/pre-execute', async (exec, next): Promise<PreToolDecision> => {
27
+ if (!(await isAllowed(exec))) {
28
+ return { kind: 'deny', reason: 'Denied by policy.' }
29
+ }
30
+ return next()
31
+ })
32
+ }
33
+ ```
34
+
35
+ 这个 waterfall(瀑布式事件)是可重排的策略层。当不变式需要单调的最终拒绝时使用 `ctx.tools.guard()`;当插件需要包裹分发生命周期时(超时/重试/指标;仅 `exec.signal` 可替换)使用 `tools/execute`;显式结果变换使用 `tools/post-execute`;对不可变最终结果的受限观察使用 `tools/result`。选择规则见[添加工具指南](adding-a-tool.zh.md#execution-policy-and-observation)。
36
+
37
+ ## UI 插件
38
+
39
+ UI 插件把持久 `session/event` record(Assistant settlement、轮次/步骤边界与工具活动)和用于实时 token 呈现的瞬态 `agent/assistant-stream` frame 组合起来,并通过 `agent.followup()` / `agent.steer()` 将输入驱动回去。如果浏览器插件要向内建 Web Client 贡献业务行,则应注册 `ConversationNodeDefinition` 与 keyed Chat renderer;具体约定见 [Conversation 子系统参考](../subsystems/conversation.zh.md)。
40
+
41
+ ```ts
42
+ import type { Context } from '@deepseek-ai/cordis'
43
+ import { brandString } from '@deepseek-ai/dsh-brand'
44
+ import { createUserMessage } from '@deepseek-ai/dsh-llm'
45
+ import type { SessionId } from '@deepseek-ai/dsh-session'
46
+
47
+ declare function render(text: string): void
48
+ declare function onUserInput(handler: (text: string) => void): void
49
+
50
+ export const name = 'my-ui'
51
+ export const inject = ['agents']
52
+
53
+ export function apply(ctx: Context) {
54
+ ctx.on('agent/assistant-stream', ({ frame }) => {
55
+ if (frame.type === 'chunk' && frame.chunk.type === 'text-delta') {
56
+ render(frame.chunk.text)
57
+ }
58
+ })
59
+ onUserInput(text => ctx.agents.get(brandString<SessionId>('client-session'))?.followup(createUserMessage({
60
+ content: [{ type: 'text', text }],
61
+ source: { kind: 'user' },
62
+ })))
63
+ }
64
+ ```
65
+
66
+ ## 外部协议驱动
67
+
68
+ *协议驱动*将协议对端接入 `ctx.agents`;它可以服务于 UI 或自动化客户端。stdio 驱动拥有 stdout,通过工厂创建或恢复 agent(智能体),并将协议请求映射为 `followup()` 或 `cancel()`。底层提示词请求返回其持久入队回执;它不会通过关联 `MessageId` 与 `turn/end` 获得结果。整个 agent 的状态应单独发布。自动化方法可以从回执等待到下一次 idle,并概括这一显式拥有的区间;UI 通常则会持续观察开放式事件流。通过 `AgentHandle.dispose()` 拆除 agent,以使 dispose(资源释放)达到完全停稳。
69
+
70
+ [`packages/acp/acp`](../../packages/acp/acp) 是仅面向自动化的完整示例:它通过 ACP(Agent Client Protocol)JSON-RPC stdio 提供全新文本会话,发出已提交的助手文本,并为其拥有的 agent 注册一次性机器权限应答器。其 [README](../../packages/acp/acp/README.zh.md) 定义确切的方法、事件顺序和生命周期约定。
71
+
72
+ ```ts
73
+ import type { Context } from '@deepseek-ai/cordis'
74
+ import { expandAssistantStream } from '@deepseek-ai/dsh-llm'
75
+
76
+ export const name = 'my-protocol-bridge'
77
+ export const inject = ['agents', 'sessions', 'sessionPersistence']
78
+
79
+ export function apply(ctx: Context) {
80
+ // Publish every committed Assistant text delta to the client.
81
+ ctx.on('session/event', (_session, event) => {
82
+ if (event.type === 'assistant/message' || event.type === 'assistant/attempt') {
83
+ for (const { chunk } of expandAssistantStream(event.data.stream)) {
84
+ if (chunk.type === 'text-delta') {
85
+ // sendToClient({ kind: 'message_chunk', text: chunk.text })
86
+ }
87
+ }
88
+ }
89
+ })
90
+ // Inbound "prompt": create/resume an agent, feed it, and return its enqueue receipt.
91
+ // Whole-agent status is a separate notification; no turn end belongs to this prompt.
92
+ // Teardown reaches quiescence via AgentHandle.dispose() (stop + await exit).
93
+ }
94
+ ```
95
+
96
+ ## 可运行的组装示例
97
+
98
+ 交付应用通过 `packages/bundle/*/cordis.patch.yml` 提供 profile 层,产品 `dsh` 启动器通过具名 profile 负责 Web、ACP、SDK 与一次性 headless 执行。可选的用户 overlay 位于 `apps/cli/config/examples/`;profile 集成测试位于 `apps/cli/tests/profiles/`,包专属 Loader 组合则留在对应包的测试目录中。
99
+
100
+ <a id="the-feature--mechanism-map"></a>
101
+
102
+ ## 功能→机制映射
103
+
104
+ 每个产品功能都映射到一个文档化扩展点上的监听器——微内核声明由此可验证([微内核 reference](../architecture.zh.md))。没有任何一行修改循环本身。
105
+
106
+ `system-prompt/assemble` 是一个专家协作式的整体装配变换:其返回的装配结果具有权威性,因此监听器作者有责任保留活跃的 PTC mode 和结构化输出协议的贡献。对于需要在展示、查找和执行之间保持对齐的工具过滤,优先使用 `ctx.tools.restrict()`。
107
+
108
+ | 产品功能 | 插件机制 |
109
+ |---|---|
110
+ | 钩子系统(用户级 + 项目级) | `agent/created`、`agent/pre-step`、`agent/request`、`tools/pre-execute`、`tools/post-execute` 和 `agent/turn-stopping` 上的监听器;waterfall 返回类型化决策,`agent/turn-stopping` 则可通过 steering(中途引导)触发下一步;`dsh-hooks-claude-code` / `dsh-hooks-codex` 桥接器将钩子配置文件映射到这些扩展点上 |
111
+ | `/goal` | `ctx.goals` 管理持久状态,`dsh-goal-round-driver` 通过公共 `Agent` 调度同会话 Round,独立的命令/工具生产方分别提供人类/模型控制 |
112
+ | `/loop` | 在 `turn/end` 会话事件上 `followup()` 下一次迭代;或强制继续 |
113
+ | 动态工作流 | `ctx.workflowEngine` + PTC 工作流引擎 + `workflow` 工具;结构化的进程内子任务通过作用域化的提示词/工具注册、单调工具守卫、最终 `tools/result` 提交(包括外层 `run_code`)和结构化输出执行的单调 `concludeTurn()` 标记来强制输出 |
114
+ | 排队消息 + steering | 核心 `Agent.followup()` / `Agent.steer()` |
115
+ | 上下文压缩(context compaction)(自动 + 手动) | `ctx.compaction` seam + `dsh-compaction-basic`;自动压力检查运行在串行 `agent/pre-step`,标准的溢出恢复机制运行在 `agent/request-error`,手动调用方使用同一个压缩服务([压缩 参考](../../packages/compaction/compaction/README.zh.md)) |
116
+ | 系统提示词可配置性 | `ctx.systemPrompt.section()`,支持排序与作用域局部覆盖 |
117
+ | AGENTS.md(根目录) | 一个读取该文件的 section 提供方 |
118
+ | AGENTS.md(子目录,按需触发)+ 文件变更通知 | 从 watcher / 工具结果监听器调用 `agent.inject()` |
119
+ | 内置工具 | `ctx.tools.register()`;schema 自动流入装配——`dsh-tool-*` 系列(bash、fs、web、subagent、todo)是已交付的示例 |
120
+ | ToolSearch / 渐进式披露 | 当可见集变化时替换一个作用域化的 `ctx.tools.restrict()` 注册;注册表保持展示、查找和执行三者对齐 |
121
+ | 工具截止时间 / 重试 / 指标 | 用 `tools/execute` 包裹核心分发;包装层可替换 `exec.signal`、委托执行,并在同一词法生命周期内检视规范化结果 |
122
+ | 最终工具结果指标 / 审计 / 捕获 | 用 `tools/result` 观察不可变的权威结果;仅当插件需要变换结果或附加上下文时才使用 `tools/post-execute` |
123
+ | 单调终端轮次策略 | 从成功的终端工具调用 `ToolExecution.concludeTurn()`;同一响应中后续工具调用仍可由守卫阻止,循环在该步骤后停止 |
124
+ | 子进程沙箱(landlock / sandbox-exec) | 通过 `dsh-bash-sandbox` 使用 `ctx.sandbox` 后端;能力级别的拒绝使用 `tools/pre-execute` |
125
+ | 权限系统 / AskUserQuestion | 从 `tools/pre-execute` 返回 `ask` 并通过 `ctx.approval` 应答;为普通用户提问注册一个独立的面向模型的 ask 工具 |
126
+ | Plan mode | [`@deepseek-ai/dsh-plan-mode`](../../packages/plan/plan-mode/README.zh.md):落日志的 `plan/mode` 状态、`plan:policy` 引导段、`/plan [message]` 入口、`/plan off` 直接退出,以及经用户评审的 `exit_plan_mode` 出口;强制约束留在独立的沙箱/审批轴上 |
127
+ | subagent 委派 | `ctx.subagents` 提供方注册表(`dsh-subagent-spawn-in-process`/`dsh-subagent-fork-in-process`/`dsh-subagent-acp`/`dsh-subagent-codex`/`dsh-subagent-claude-code`/`dsh-subagent-dsh-sdk`)+ `dsh-tool-subagent` 向模型暴露一个已配置的提供方 |
128
+ | MCP | 每个服务器一个插件:发现工具 → `ctx.tools.register()` |
129
+ | skill(技能) | section + 工具注册;调用时通过 `inject()` 注入 skill 内容 |
130
+ | 记忆 | section 提供方 + 工具 |
131
+ | 定时任务(cron) | 插件注册面向模型的调度工具;定时器到期后通过 `followup(…, {source: {kind: 'schedule'}})` 投递 |
132
+ | UI(GUI;CLI(命令行界面)输出 JSONL) | 监听 `agent/assistant-stream` 的实时 chunk,并监听 `session/event` 的持久 settlement、边界与工具活动;输入 → `followup()` |
133
+ | Web Client Chat 业务节点 | 注册 `ConversationNodeDefinition` 与 `conversation.chat.node` keyed renderer |
134
+ | 遥测 / 可回放 trace | `session/event` → JSONL;回放 = `sessions.create(id, { seed })` |
135
+ | 模型适配器 | 通过 `registerAdapter` 注册 `LlmAdapter` 子类(`dsh-llm-deepseek`、`dsh-llm-pi-ai`) |
136
+ | 插件热重载 | 每个注册都是一个 `ctx.effect` → 随仓库提供的 HMR(热模块替换)直接生效 |
@@ -31,7 +31,7 @@ pnpm --silent run verify-persistence-changes --json
31
31
 
32
32
  Use `--silent` when consuming JSON: pnpm otherwise appends lifecycle failure text to stdout. Failed commands still exit with code 1.
33
33
 
34
- Read the reported root, path, change kind, and version requirement. A referenced type can affect several event digests; inspect every affected root. Until the history covers the new schemas, verification fails. A stale generated inventory also fails verification; the recording command refreshes it. If `changes` is empty after reordering fields or union alternatives, run `pnpm run gen-persistence-catalog` and repeat the check. An unchanged digest needs no new acknowledgement even when copied declarations or source locations produce a catalog diff.
34
+ Read the reported root, path, change kind, and compatibility-review requirement. A referenced type can affect several event digests; inspect every affected root. Until the history covers the new schemas, verification fails. A stale generated inventory also fails verification; the recording command refreshes it. If `changes` is empty after reordering fields or union alternatives, run `pnpm run gen-persistence-catalog` and repeat the check. An unchanged digest needs no new acknowledgement even when copied declarations or source locations produce a catalog diff.
35
35
 
36
36
  To review a PR independently of its acknowledgement history, save the base and head inventories as local JSON files and run:
37
37
 
@@ -39,6 +39,8 @@ To review a PR independently of its acknowledgement history, save the base and h
39
39
  pnpm --silent run persistence-review --before .artifacts/base.schema.json --after docs/persistence-schema.json
40
40
  ```
41
41
 
42
+ A recorded decision does not hide the transition from this comparison. `--check` only compares current source with acknowledged history; after recording, it cannot replace a base/head review or establish that a human reviewed the change.
43
+
42
44
  Record the commits supplying those files with the report. Add `--json` for structured output. This read-only comparison groups shared changes with their affected roots and uses actual literal `kind`/`form` values instead of union positions. Ambiguous alternatives remain separate additions and removals. Its compatibility section copies every root's authoritative classifier result; the structural explanation does not replace acknowledgement checks. Current catalog labels and declaration names are descriptive metadata; structural anchors and fingerprints identify types.
43
45
 
44
46
  The current machine inventory stores complete graphs in `roots`. A `types` entry contains `digest`, `names`, and `sources`, plus an explicit `schema` when roots cannot reconstruct that graph exactly. Readers resolve omitted graphs from root subgraphs by digest and validate explicit graphs directly, preserving every type and its metadata. Historical full entries remain readable. `formatVersion` identifies normalization rules; storage compaction does not change root fingerprints or require an acknowledgement.
@@ -46,7 +48,7 @@ The current machine inventory stores complete graphs in `roots`. A `types` entry
46
48
  <a id="acknowledge"></a>
47
49
  ## 1. Record the change
48
50
 
49
- Check the [accepted baseline](../session-format-status.md#finalization-record) first. Preserve its locked records. Record backward-compatible evolution in a new same-version acknowledgement; implement a higher writer version before recording a breaking change.
51
+ Check the [accepted baseline](../session-format-status.md#finalization-record) first and preserve its locked records. Assess both reader directions under the [compatibility rules](../persistence-changes/README.md#compatibility-rules). A structural difference can remain same-version with evidence of safe interpretation or refusal; it does not automatically require a higher writer version.
50
52
 
51
53
  Write a local JSON file containing `en` and `zh`, each with `summary`, `compatibility`, and `verification` strings. The following input describes an exercised required-to-optional hook audit field change. Replace the explanation and test evidence with facts about your change; the CLI does not establish these claims.
52
54
 
@@ -57,12 +59,12 @@ Save the input as `.artifacts/persistence-change.prose.json`, creating the ignor
57
59
  "en": {
58
60
  "summary": "Makes the persisted hook audit decision optional.",
59
61
  "compatibility": "Existing records remain valid. Hook execution consumes HookOutput instead of replaying this audit field. Producers still write decisions, and absence does not imply pass.",
60
- "verification": "pnpm exec vitest run packages/hooks/hook-protocol/tests/events.spec.ts: 10 tests passed."
62
+ "verification": "pnpm exec vitest run packages/experimental/hook-protocol/tests/events.spec.ts: 10 tests passed."
61
63
  },
62
64
  "zh": {
63
65
  "summary": "将持久化的钩子审计决策改为可选。",
64
66
  "compatibility": "已有记录仍然有效。钩子执行消费 HookOutput,不回放此审计字段。写入方仍然记录决策,缺失不代表 pass。",
65
- "verification": "pnpm exec vitest run packages/hooks/hook-protocol/tests/events.spec.ts:10 个测试通过。"
67
+ "verification": "pnpm exec vitest run packages/experimental/hook-protocol/tests/events.spec.ts:10 个测试通过。"
66
68
  }
67
69
  }
68
70
  ```
@@ -73,9 +75,9 @@ Use a date and descriptive slug in place of this example id:
73
75
  pnpm --silent run persistence-changes --record 2026-09-11-poc-optional --prose .artifacts/persistence-change.prose.json --json
74
76
  ```
75
77
 
76
- The command validates the history and paired prose, infers the minimum version decision, and checks any required header increase before writing. It generates the record pair, complete after schemas, both catalogs, the machine inventory, and pairing records. Review the explanations and returned `changes`, `roots`, and `files` before committing. Omitting `--prose` creates unfinished drafts that verification rejects until their explanations are completed.
78
+ The command validates the history and paired prose, infers established same-version decisions, and checks explicit compatibility decisions before writing. It generates the record pair, complete after schemas, both catalogs, the machine inventory, and pairing records. Review the explanations and returned `changes`, `roots`, and `files` before committing. Omitting `--prose` creates unfinished drafts that verification rejects until their explanations are completed.
77
79
 
78
- Inference follows the [fixed compatibility rules](../persistence-changes/README.md#compatibility-rules); it never changes source or relaxes them. If a bump is required, first follow [adding a Session format version](adding-a-session-format-version.md). The record must include its own increasing `SessionHeader.version` transition; an unrelated historical bump cannot authorize it. Routine changes never create another baseline.
80
+ For a change marked `requiresCompatibilityReview`, explain both reader directions in the acknowledgement’s Compatibility section and record executed checks in Verification. Supply `--decision same-version` when that evidence supports keeping the version; recording or updating a flagged change with an unchanged header version and no explicit decision fails with `decision-required`. Structural differences alone do not infer a bump. An actual header version increase can infer `version-bump`. If an effective discriminator cannot prevent unsafe interpretation, follow [adding a Session format version](adding-a-session-format-version.md) and select `--decision version-bump`. That record must include its own increasing `SessionHeader.version` transition; an unrelated historical bump cannot authorize it. Routine changes never create another baseline.
79
81
 
80
82
  <a id="verify"></a>
81
83
  ## 2. Check, commit, and push
@@ -99,14 +101,14 @@ If source changes after recording, review the compatibility explanation and refr
99
101
  pnpm --silent run persistence-changes --update 2026-09-11-poc-optional --prose .artifacts/persistence-change.prose.json --json
100
102
  ```
101
103
 
102
- The command refreshes the machine declaration, schemas, catalogs, and pairing. Without `--prose`, it preserves the existing explanation. Update refuses the initial baseline, records that another record depends on, and finalized checkpoint records. Outside finalized checkpoints, the tree does not infer review acceptance: preserve accepted history and create a successor instead.
104
+ The command refreshes the machine declaration, schemas, catalogs, and pairing. Without `--prose`, it preserves the existing explanation. Reassess that explanation against the complete transition and supply `--decision same-version` for any flagged same-version update. Update refuses the initial baseline, records that another record depends on, and finalized checkpoint records. Outside finalized checkpoints, the tree does not infer review acceptance: preserve accepted history and create a successor instead.
103
105
 
104
106
  When integration creates competing terminal records, update the unaccepted record against the remaining history, then reassess the resulting diff. An unrelated root's acknowledgement does not need refreshing. The [mechanism decision](../../.agents/notes/implemented/process/2026-09-11-persistence-type-history.md) explains why complete snapshots and per-root predecessors are retained.
105
107
 
106
- An explicit `--decision` remains a checked assertion. For an existing property's value-type change, the following deliberately wrong assertion fails before writing:
108
+ For an existing property value-type change requiring review, first revise the prose file’s Compatibility and Verification sections to explain the actual new transition and its executed checks. Do not reuse the earlier required-to-optional explanation for a different change. Then update the record with that prose and the explicit same-version choice:
107
109
 
108
110
  ```sh
109
- pnpm --silent run persistence-changes --update 2026-09-11-poc-optional --decision same-version --json
111
+ pnpm --silent run persistence-changes --update 2026-09-11-poc-optional --decision same-version --prose .artifacts/persistence-change.prose.json --json
110
112
  ```
111
113
 
112
114
  <a id="dev-note"></a>
@@ -31,7 +31,7 @@ pnpm --silent run verify-persistence-changes --json
31
31
 
32
32
  消费 JSON 时使用 `--silent`:否则 pnpm 会把生命周期失败文本追加到标准输出。失败命令仍以退出码 1 结束。
33
33
 
34
- 阅读报告中的根、路径、变更种类和版本要求。被引用类型可能影响多个事件摘要;检查每个受影响的根。在历史覆盖新 schema 之前,验证会失败。陈旧生成清单也会导致验证失败;记录命令会刷新它。若重排字段或联合类型分支后 `changes` 为空,运行 `pnpm run gen-persistence-catalog` 并重新检查。即使复制的声明或源码位置产生目录 diff,未变的摘要也无需新增确认记录。
34
+ 阅读报告中的根、路径、变更种类和兼容性评审要求。被引用类型可能影响多个事件摘要;检查每个受影响的根。在历史覆盖新 schema 之前,验证会失败。陈旧生成清单也会导致验证失败;记录命令会刷新它。若重排字段或联合类型分支后 `changes` 为空,运行 `pnpm run gen-persistence-catalog` 并重新检查。即使复制的声明或源码位置产生目录 diff,未变的摘要也无需新增确认记录。
35
35
 
36
36
  要独立于确认历史评审 PR,先将 base 和 head 的目录保存为本地 JSON 文件,再运行:
37
37
 
@@ -39,6 +39,8 @@ pnpm --silent run verify-persistence-changes --json
39
39
  pnpm --silent run persistence-review --before .artifacts/base.schema.json --after docs/persistence-schema.json
40
40
  ```
41
41
 
42
+ 记录决策不会使转换从此比较中消失。`--check` 仅比较当前源码与已确认历史;记录完成后,它不能替代 base/head 评审,也不能证明人类已评审该变更。
43
+
42
44
  在报告旁记录这些文件对应的 commit。添加 `--json` 可获取结构化输出。此只读比较将共享变更与受影响的根类型归组,使用实际字面量 `kind`/`form` 值代替联合类型位置。无法唯一匹配的候选项保留为独立的新增与删除。兼容性部分复制每个根类型的权威分类结果;结构说明不替代确认检查。当前目录标签和声明名称是描述元数据;结构锚点和指纹标识类型。
43
45
 
44
46
  当前机器清单在 `roots` 中保存完整图。每个 `types` 条目包含 `digest`、`names` 和 `sources`;若根无法精确重建该图,条目还会保存显式 `schema`。读取器按摘要从根的子图恢复省略的图,并直接验证显式图,保留每个类型及其元数据。历史完整条目仍然可读。`formatVersion` 标识规范化规则;存储压缩不改变根指纹,也不需要确认记录。
@@ -46,7 +48,7 @@ pnpm --silent run persistence-review --before .artifacts/base.schema.json --afte
46
48
  <a id="acknowledge"></a>
47
49
  ## 1. 记录变更
48
50
 
49
- 先检查[已接受基线](../session-format-status.zh.md#finalization-record),保留其锁定记录。向后兼容的演进使用新的同版本确认记录;记录破坏性变更之前,先实现更高的写入器版本。
51
+ 先检查[已接受基线](../session-format-status.zh.md#finalization-record),保留其锁定记录。按[兼容性规则](../persistence-changes/README.zh.md#compatibility-rules)评估两个读取方向。若有安全解释或拒绝的证据,结构差异可以保留同一版本,不会自动要求更高的写入器版本。
50
52
 
51
53
  编写包含 `en` 和 `zh` 的本地 JSON 文件,两者分别包含 `summary`、`compatibility` 和 `verification` 字符串。以下输入描述一个经过验证的钩子审计字段从必选改为可选的变更。用你所做变更的事实替换说明和测试证据;CLI(命令行界面)不会证明这些声明。
52
54
 
@@ -57,12 +59,12 @@ pnpm --silent run persistence-review --before .artifacts/base.schema.json --afte
57
59
  "en": {
58
60
  "summary": "Makes the persisted hook audit decision optional.",
59
61
  "compatibility": "Existing records remain valid. Hook execution consumes HookOutput instead of replaying this audit field. Producers still write decisions, and absence does not imply pass.",
60
- "verification": "pnpm exec vitest run packages/hooks/hook-protocol/tests/events.spec.ts: 10 tests passed."
62
+ "verification": "pnpm exec vitest run packages/experimental/hook-protocol/tests/events.spec.ts: 10 tests passed."
61
63
  },
62
64
  "zh": {
63
65
  "summary": "将持久化的钩子审计决策改为可选。",
64
66
  "compatibility": "已有记录仍然有效。钩子执行消费 HookOutput,不回放此审计字段。写入方仍然记录决策,缺失不代表 pass。",
65
- "verification": "pnpm exec vitest run packages/hooks/hook-protocol/tests/events.spec.ts:10 个测试通过。"
67
+ "verification": "pnpm exec vitest run packages/experimental/hook-protocol/tests/events.spec.ts:10 个测试通过。"
66
68
  }
67
69
  }
68
70
  ```
@@ -73,9 +75,9 @@ pnpm --silent run persistence-review --before .artifacts/base.schema.json --afte
73
75
  pnpm --silent run persistence-changes --record 2026-09-11-poc-optional --prose .artifacts/persistence-change.prose.json --json
74
76
  ```
75
77
 
76
- 命令在写入前验证历史和双语说明、推断最低版本决策,并检查所需的头部版本递增。它生成记录对、完整的变更后 schema、两份目录、机器清单和配对记录。提交前审阅说明及返回的 `changes`、`roots` 和 `files`。省略 `--prose` 会创建未完成草稿,验证将拒绝它们,直到说明补齐。
78
+ 命令在写入前验证历史与双语说明、推断已明确允许的同版本决策,并检查显式兼容性决策。它生成记录对、完整的 after schema、两个目录、机器清单与配对记录。提交前检查说明及返回的 `changes`、`roots`、`files`。省略 `--prose` 会生成未完成草稿;说明填写完成前,验证会拒绝它们。
77
79
 
78
- 推断遵循[固定兼容性规则](../persistence-changes/README.zh.md#compatibility-rules),不会更改源码或放宽规则。需要升版本时,先遵循[添加会话格式版本](adding-a-session-format-version.zh.md)。记录必须包含其自身的 `SessionHeader.version` 递增转换;无关的历史升版本不能授权它。日常变更不创建另一条基线。
80
+ 对于标为 `requiresCompatibilityReview` 的变更,在确认记录的兼容性部分说明两个方向的读取器行为,并在验证部分记录已执行的检查。证据支持保持版本时,提供 `--decision same-version`;记录或更新被标记的变更时,若头版本未变且缺少显式决策,会以 `decision-required` 失败。仅凭结构差异不会推断升版本。实际头版本递增可以推断出 `version-bump`。若有效判别信息无法阻止不安全解释,遵循[添加会话格式版本](adding-a-session-format-version.zh.md),并选择 `--decision version-bump`。该记录必须包含自身的 `SessionHeader.version` 递增转换;无关的历史升版本不能授权它。日常变更不创建另一条基线。
79
81
 
80
82
  <a id="verify"></a>
81
83
  ## 2. 检查、提交并推送
@@ -99,14 +101,14 @@ pnpm run doc-sync
99
101
  pnpm --silent run persistence-changes --update 2026-09-11-poc-optional --prose .artifacts/persistence-change.prose.json --json
100
102
  ```
101
103
 
102
- 命令刷新机器声明、schema、目录和配对。没有 `--prose` 时,它保留已有说明。更新会拒绝初始基线、其他记录所依赖的记录,以及已被定稿检查点锁定的记录。定稿检查点之外,目录不会推断审阅接受状态:保留已接受历史,并创建后继。
104
+ 命令刷新机器声明、schema、目录和配对。没有 `--prose` 时,它保留已有说明。根据完整转换重新评估说明,并为任何被标记的同版本更新提供 `--decision same-version`。更新会拒绝初始基线、其他记录所依赖的记录,以及已被定稿检查点锁定的记录。定稿检查点之外,目录不会推断审阅接受状态:保留已接受历史,并创建后继。
103
105
 
104
106
  集成产生竞争末端记录时,根据剩余历史更新尚未接受的记录,再重新评估最终差异。无关根的确认无需刷新。[机制决策](../../.agents/notes/implemented/process/2026-09-11-persistence-type-history.zh.md)解释为何保留完整快照和逐根前驱。
105
107
 
106
- 显式 `--decision` 仍是受检查的断言。若已有属性的值类型发生变化,下面这个故意错误的断言会在写入前失败:
108
+ 若已有属性的值类型变化需要评审,先修改说明文件中的兼容性与验证部分,解释实际的新转换及已执行检查。不要为不同变更复用先前必选改可选的说明。然后使用该说明与显式同版本选择更新记录:
107
109
 
108
110
  ```sh
109
- pnpm --silent run persistence-changes --update 2026-09-11-poc-optional --decision same-version --json
111
+ pnpm --silent run persistence-changes --update 2026-09-11-poc-optional --decision same-version --prose .artifacts/persistence-change.prose.json --json
110
112
  ```
111
113
 
112
114
  <a id="dev-note"></a>
@@ -0,0 +1,364 @@
1
+ <!-- Generated by scripts/gen-cordis-catalog.ts — do not edit by hand.
2
+ Run `pnpm run gen-cordis-catalog` to regenerate. -->
3
+
4
+ # Context
5
+
6
+ The context is the core Cordis object: every service, event, and lifecycle API is reached through `ctx`. Event methods are documented on [Events](events.md), effects and the current fiber on [Fiber](fiber.md), and plugin loading on [Registry](registry.md).
7
+
8
+ Root and child dependency containers for Cordis plugins.
9
+
10
+ A context is a proxy: normal property reads go through the service resolver, while `extend()`, `isolate()`, and `intercept()` create scoped child contexts without mutating their parent.
11
+
12
+ [Source](../../vendor/cordis/src/context.ts#L42)
13
+
14
+ ### ctx.extend(meta?)
15
+
16
+ ```ts cordis-catalog
17
+ /**
18
+ * Create a child context with extra metadata on top of the current scope.
19
+ *
20
+ * The child prototypally inherits every property of this context; own
21
+ * properties of `meta` shadow the inherited ones. The parent is not mutated.
22
+ *
23
+ * @param meta — own properties (including symbol keys) to define on the child.
24
+ * @returns a child context inheriting from this one.
25
+ */
26
+ extend(meta = {}): this
27
+ ```
28
+
29
+ Create a child context with extra metadata on top of the current scope.
30
+
31
+ The child prototypally inherits every property of this context; own properties of `meta` shadow the inherited ones. The parent is not mutated.
32
+
33
+ - `meta` — own properties (including symbol keys) to define on the child.
34
+
35
+ **Returns** a child context inheriting from this one.
36
+
37
+ [Source](../../vendor/cordis/src/context.ts#L99)
38
+
39
+ ### ctx.isolate(name, label?)
40
+
41
+ ```ts cordis-catalog
42
+ /**
43
+ * Create a child context with an independent service scope for `name`.
44
+ *
45
+ * Below the returned context, reads and writes of the service `name`
46
+ * resolve against the new label instead of the parent's, so a different
47
+ * implementation can be provided without affecting the parent scope.
48
+ * Passing the same `label` to two `isolate()` calls joins their scopes.
49
+ *
50
+ * @param name — the service name to isolate.
51
+ * @param label — scope label to join; defaults to a fresh unique symbol.
52
+ * @returns a child context whose `name` service resolves in the new scope.
53
+ */
54
+ isolate(name: string, label?: symbol)
55
+ ```
56
+
57
+ Create a child context with an independent service scope for `name`.
58
+
59
+ Below the returned context, reads and writes of the service `name` resolve against the new label instead of the parent's, so a different implementation can be provided without affecting the parent scope. Passing the same `label` to two `isolate()` calls joins their scopes.
60
+
61
+ - `name` — the service name to isolate.
62
+ - `label` — scope label to join; defaults to a fresh unique symbol.
63
+
64
+ **Returns** a child context whose `name` service resolves in the new scope.
65
+
66
+ [Source](../../vendor/cordis/src/context.ts#L121)
67
+
68
+ ### ctx.intercept(name, config)
69
+
70
+ ```ts cordis-catalog
71
+ /**
72
+ * Add service-specific intercept config for plugins started below this
73
+ * context.
74
+ *
75
+ * Plugins loaded under the returned context see `config` merged into the
76
+ * service's resolved config (ancestor entries first; see
77
+ * `Service[symbols.resolveConfig]`). The parent context is not affected.
78
+ *
79
+ * @param name — the service name whose config to intercept.
80
+ * @param config — the intercept config to merge for that service.
81
+ * @returns a child context carrying the additional intercept entry.
82
+ */
83
+ intercept<K extends InjectKey>(name: K, config: Context[K] extends { [symbols.config]: infer T } ? T : never): this
84
+ intercept(name: string, config: any): this
85
+ ```
86
+
87
+ Add service-specific intercept config for plugins started below this context.
88
+
89
+ Plugins loaded under the returned context see `config` merged into the service's resolved config (ancestor entries first; see `Service[symbols.resolveConfig]`). The parent context is not affected.
90
+
91
+ - `name` — the service name whose config to intercept.
92
+ - `config` — the intercept config to merge for that service.
93
+
94
+ **Returns** a child context carrying the additional intercept entry.
95
+
96
+ [Source](../../vendor/cordis/src/context.ts#L139)
97
+
98
+ ### ctx.root
99
+
100
+ ```ts cordis-catalog
101
+ /** The root context of the application (every child context shares it). @experimental */
102
+ root: this
103
+ ```
104
+
105
+ The root context of the application (every child context shares it). @experimental
106
+
107
+ [Source](../../vendor/cordis/src/context.ts#L22)
108
+
109
+ ### ctx.baseUrl
110
+
111
+ ```ts cordis-catalog
112
+ /** Base URL used to resolve relative plugin/module specifiers, if the runtime sets one. */
113
+ baseUrl?: string
114
+ ```
115
+
116
+ Base URL used to resolve relative plugin/module specifiers, if the runtime sets one.
117
+
118
+ [Source](../../vendor/cordis/src/context.ts#L24)
119
+
120
+ ### ctx.events
121
+
122
+ ```ts cordis-catalog
123
+ /** The event bus. Its methods are also mixed onto `ctx` (`ctx.on`, `ctx.emit`, ...). */
124
+ events: EventsService
125
+ ```
126
+
127
+ The event bus. Its methods are also mixed onto `ctx` (`ctx.on`, `ctx.emit`, ...).
128
+
129
+ [Source](../../vendor/cordis/src/context.ts#L26)
130
+
131
+ ### ctx.logger
132
+
133
+ ```ts cordis-catalog
134
+ /** The logging service. Call `ctx.logger(name)` for a named logger. */
135
+ logger: LoggerService
136
+ ```
137
+
138
+ The logging service. Call `ctx.logger(name)` for a named logger.
139
+
140
+ [Source](../../vendor/cordis/src/context.ts#L28)
141
+
142
+ ### ctx.reflect
143
+
144
+ ```ts cordis-catalog
145
+ /** The reflection layer backing the context proxy (`ctx.get`, `ctx.provide`, ...). */
146
+ reflect: ReflectService
147
+ ```
148
+
149
+ The reflection layer backing the context proxy (`ctx.get`, `ctx.provide`, ...).
150
+
151
+ [Source](../../vendor/cordis/src/context.ts#L30)
152
+
153
+ ### ctx.registry
154
+
155
+ ```ts cordis-catalog
156
+ /** The plugin registry. Its methods are mixed onto `ctx` (`ctx.plugin`, `ctx.inject`). */
157
+ registry: RegistryService
158
+ ```
159
+
160
+ The plugin registry. Its methods are mixed onto `ctx` (`ctx.plugin`, `ctx.inject`).
161
+
162
+ [Source](../../vendor/cordis/src/context.ts#L32)
163
+
164
+ ## Static members
165
+
166
+ ### Context.effect
167
+
168
+ ```ts cordis-catalog
169
+ /** Symbol key under which a disposer exposes its {@link EffectMeta} diagnostics tree. */
170
+ static readonly effect: unique symbol
171
+ ```
172
+
173
+ Symbol key under which a disposer exposes its EffectMeta diagnostics tree.
174
+
175
+ [Source](../../vendor/cordis/src/context.ts#L44)
176
+
177
+ ### Context.filter
178
+
179
+ ```ts cordis-catalog
180
+ /** Symbol key for a context's listener filter, consulted on every event dispatch. */
181
+ static readonly filter: unique symbol
182
+ ```
183
+
184
+ Symbol key for a context's listener filter, consulted on every event dispatch.
185
+
186
+ [Source](../../vendor/cordis/src/context.ts#L46)
187
+
188
+ ### Context.isolate
189
+
190
+ ```ts cordis-catalog
191
+ /** Symbol key of the isolation map (see the `Context[symbols.isolate]` property). */
192
+ static readonly isolate: unique symbol
193
+ ```
194
+
195
+ Symbol key of the isolation map (see the `Context[symbols.isolate]` property).
196
+
197
+ [Source](../../vendor/cordis/src/context.ts#L48)
198
+
199
+ ### Context.intercept
200
+
201
+ ```ts cordis-catalog
202
+ /** Symbol key of the intercept map (see the `Context[symbols.intercept]` property). */
203
+ static readonly intercept: unique symbol
204
+ ```
205
+
206
+ Symbol key of the intercept map (see the `Context[symbols.intercept]` property).
207
+
208
+ [Source](../../vendor/cordis/src/context.ts#L50)
209
+
210
+ ### Context.is(value)
211
+
212
+ ```ts cordis-catalog
213
+ /**
214
+ * Returns true for Cordis context proxies and context prototypes.
215
+ *
216
+ * Works across realms and across multiple copies of cordis, because the
217
+ * brand is keyed by a global symbol rather than by `instanceof`.
218
+ *
219
+ * @param value — the value to test.
220
+ * @returns `true` if `value` is a Cordis context, narrowing its type.
221
+ */
222
+ static is(value: any): value is Context
223
+ ```
224
+
225
+ Returns true for Cordis context proxies and context prototypes.
226
+
227
+ Works across realms and across multiple copies of cordis, because the brand is keyed by a global symbol rather than by `instanceof`.
228
+
229
+ - `value` — the value to test.
230
+
231
+ **Returns** `true` if `value` is a Cordis context, narrowing its type.
232
+
233
+ [Source](../../vendor/cordis/src/context.ts#L61)
234
+
235
+ ## Service store and mixins
236
+
237
+ ### ctx.get(name, strict?)
238
+
239
+ ```ts cordis-catalog
240
+ /**
241
+ * Read a service from the store without the inject requirement.
242
+ *
243
+ * @param name — the service name.
244
+ * @param strict — when `true` (default), only return implementations
245
+ * whose providing fiber is currently active.
246
+ * @returns the service value, or `undefined` when not (yet) provided.
247
+ */
248
+ get<K extends string & keyof this>(name: K, strict?: boolean): undefined | this[K]
249
+ get(name: string, strict?: boolean): any
250
+ ```
251
+
252
+ Read a service from the store without the inject requirement.
253
+
254
+ - `name` — the service name.
255
+ - `strict` — when `true` (default), only return implementations whose providing fiber is currently active.
256
+
257
+ **Returns** the service value, or `undefined` when not (yet) provided.
258
+
259
+ [Source](../../vendor/cordis/src/reflect.ts#L17)
260
+
261
+ ### ctx.set(name, value)
262
+
263
+ ```ts cordis-catalog
264
+ /**
265
+ * Overwrite a provided service's value.
266
+ *
267
+ * Only the fiber that provided the service may set it; setting an
268
+ * unprovided name throws.
269
+ *
270
+ * @param name — the service name.
271
+ * @param value — the new service value.
272
+ */
273
+ set<K extends string & keyof this>(name: K, value: undefined | this[K]): void
274
+ set(name: string, value: any): void
275
+ ```
276
+
277
+ Overwrite a provided service's value.
278
+
279
+ Only the fiber that provided the service may set it; setting an unprovided name throws.
280
+
281
+ - `name` — the service name.
282
+ - `value` — the new service value.
283
+
284
+ [Source](../../vendor/cordis/src/reflect.ts#L29)
285
+
286
+ ### ctx.provide(name, value)
287
+
288
+ ```ts cordis-catalog
289
+ /**
290
+ * Register a service implementation owned by the current fiber.
291
+ *
292
+ * The service becomes visible to dependents in the same isolation scope
293
+ * once the fiber is active; it is unregistered (waking dependents) when
294
+ * the returned disposer runs or the fiber unloads. Throws if the name is
295
+ * already provided in this scope or declared as an accessor.
296
+ *
297
+ * @param name — the service name.
298
+ * @param value — the service value.
299
+ * @returns a disposer that unregisters the service.
300
+ */
301
+ provide<K extends string & keyof this>(name: K, value: undefined | this[K]): () => void
302
+ provide(name: string, value?: any): () => void
303
+ ```
304
+
305
+ Register a service implementation owned by the current fiber.
306
+
307
+ The service becomes visible to dependents in the same isolation scope once the fiber is active; it is unregistered (waking dependents) when the returned disposer runs or the fiber unloads. Throws if the name is already provided in this scope or declared as an accessor.
308
+
309
+ - `name` — the service name.
310
+ - `value` — the service value.
311
+
312
+ **Returns** a disposer that unregisters the service.
313
+
314
+ [Source](../../vendor/cordis/src/reflect.ts#L44)
315
+
316
+ ### ctx.accessor(name, options)
317
+
318
+ ```ts cordis-catalog
319
+ /**
320
+ * Define a computed context property backed by get/set hooks.
321
+ *
322
+ * The accessor is removed when the current fiber unloads. Throws if the
323
+ * name is already declared.
324
+ *
325
+ * @param name — the context property name.
326
+ * @param options — the `get` hook and optional `set` hook.
327
+ */
328
+ accessor(name: string, options: Omit<Property.Accessor, 'type'>): void
329
+ ```
330
+
331
+ Define a computed context property backed by get/set hooks.
332
+
333
+ The accessor is removed when the current fiber unloads. Throws if the name is already declared.
334
+
335
+ - `name` — the context property name.
336
+ - `options` — the `get` hook and optional `set` hook.
337
+
338
+ [Source](../../vendor/cordis/src/reflect.ts#L56)
339
+
340
+ ### ctx.mixin(name, mixins)
341
+
342
+ ```ts cordis-catalog
343
+ /**
344
+ * Expose selected members of a service directly on `ctx`.
345
+ *
346
+ * Each mixed-in key becomes an accessor that forwards to the service
347
+ * (binding methods to it), so e.g. `ctx.on` forwards to `ctx.events.on`.
348
+ * Mixins are removed when the current fiber unloads.
349
+ *
350
+ * @param name — the context property holding the source service.
351
+ * @param mixins — keys to forward, or a source-key → ctx-key map.
352
+ */
353
+ mixin<K extends string & keyof this>(name: K, mixins: (keyof this & keyof this[K])[] | Dict<string>): void
354
+ mixin<T extends {}>(source: T, mixins: (keyof this & keyof T)[] | Dict<string>): void
355
+ ```
356
+
357
+ Expose selected members of a service directly on `ctx`.
358
+
359
+ Each mixed-in key becomes an accessor that forwards to the service (binding methods to it), so e.g. `ctx.on` forwards to `ctx.events.on`. Mixins are removed when the current fiber unloads.
360
+
361
+ - `name` — the context property holding the source service.
362
+ - `mixins` — keys to forward, or a source-key → ctx-key map.
363
+
364
+ [Source](../../vendor/cordis/src/reflect.ts#L67)