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,495 @@
1
+ # Filesystem
2
+
3
+ English | [中文](filesystem.zh.md)
4
+
5
+ The optional filesystem capability has four parts: [dsh-fs](../../packages/fs/fs) owns `ctx.fs` and atomic text operations with optional guards, [dsh-fs-local](../../packages/fs/fs-local) implements local disk, [dsh-fs-observation-policy](../../packages/fs/fs-observation-policy) records observed presence or absence and adds freshness rules through events rather than a service, and [dsh-tool-fs](../../packages/fs/tool-fs) directly executes model-facing read/write/edit calls and renders windows. It is outside the agent-loop spine; alternate backends do not change policy or tool schemas.
6
+
7
+ `dsh-fs-observation-policy` is optional. Without it, the `FileSystem` Service Definition, a provider, and the `dsh-tool-fs` Consumer form the complete, unconstrained filesystem seam: `write` unconditionally creates or overwrites, and `edit` unconditionally replaces literal text. The policy plugin changes these operations by deciding the `fs/*` waterfalls. Removing it does not break the tool because the tool calls `ctx.fs` and dispatches events; it does not call policy methods. A deployment that loads `dsh-tool-fs` is expected to also load `dsh-fs-observation-policy` so the default behavior is read-before-write/edit.
8
+
9
+ Provider source: [`packages/fs/fs/src/types.ts`](../../packages/fs/fs/src/types.ts) and [`packages/fs/fs/src/index.ts`](../../packages/fs/fs/src/index.ts). Policy source: [`packages/fs/fs-observation-policy/src/types.ts`](../../packages/fs/fs-observation-policy/src/types.ts). Read-rendering source: [`packages/fs/tool-fs/src/read-render.ts`](../../packages/fs/tool-fs/src/read-render.ts).
10
+
11
+ ## Target identity and metadata (provider contract)
12
+
13
+ Every operation resolves a user-supplied path to an opaque backend target first. Consumers may display `displayPath`, but must not parse `targetKey` (a branded opaque id) or assume it is a local absolute path.
14
+
15
+ Consumers that share the filesystem's execution world obtain cross-capability coordinates through the provider instead of interpreting that identity: `processPath(target)` returns the canonical absolute path a subprocess can open, `fileUrl(target)` returns its provider-platform `file:` URI, and `contains(parent, child)` tests canonical identity or descendant containment.
16
+
17
+ ```ts type-equiv
18
+ /**
19
+ * A path resolved by a backend into a stable identity. `resolve()` produces
20
+ * this; every other operation takes it.
21
+ */
22
+ interface FsTarget {
23
+ /** Opaque key for stale guards and target lookup. */
24
+ targetKey: FsTargetKey
25
+ /**
26
+ * Path for model/UI-facing output. May be a local absolute path,
27
+ * workspace-relative path, or remote URI depending on the backend.
28
+ */
29
+ displayPath: string
30
+ }
31
+ ```
32
+
33
+ The backend owns file-version tokens — the freshness token a write/edit guards against. The policy plugin stores them for stale checks; consumers do not interpret them. Both ids are branded opaque strings.
34
+
35
+ ```ts type-equiv
36
+ /**
37
+ * Opaque key for stale guards and target lookup. The local backend uses a
38
+ * realpath-like string; a remote backend might use a workspace URI or file id.
39
+ * Consumers MUST NOT parse it or assume it is a local absolute path.
40
+ */
41
+ type FsTargetKey = Branded<'FsTargetKey'>
42
+ ```
43
+
44
+ ```ts type-equiv
45
+ /**
46
+ * Opaque file-version token — the freshness token a write/edit guards against.
47
+ * The local backend derives it from high-resolution stat identity and freshness
48
+ * fields; a remote backend might use a revision id. The policy layer records it
49
+ * for stale checks; consumers may display related metadata but MUST NOT
50
+ * interpret this token.
51
+ */
52
+ type FsVersion = Branded<'FsVersion'>
53
+ ```
54
+
55
+ `stat` returns metadata (never content), or `undefined` when the target is absent. `type` lets consumers reject directories and special files before reading, and `size` lets text consumers choose `readText` vs `streamText` without probing by failure. A text consumer applies its own retention ceiling while consuming `streamText`. Raw-byte consumers use `readBytes(target, signal, maxBytes)`; its required complete-content cap makes a known or discovered overflow fail with `FS_TOO_LARGE` instead of truncating or buffering without a bound.
56
+
57
+ ```ts type-equiv
58
+ /**
59
+ * Metadata about a target — what {@link FileSystem.stat} returns. Lets the
60
+ * policy layer reject directories/special files before reading and choose
61
+ * `readText` vs `streamText` from `size` without probing by failure. `version`
62
+ * is the freshness token. `undefined` from `stat` means the target is absent.
63
+ */
64
+ interface FsInfo {
65
+ /** Opaque freshness token of the target right now. */
66
+ version: FsVersion
67
+ /** Whether the target is a regular file, a directory, or something else. */
68
+ type: 'file' | 'directory' | 'other'
69
+ /** Byte size of a regular file, when the backend can report it. */
70
+ size?: number
71
+ }
72
+ ```
73
+
74
+ `lstat` is the path-level no-follow metadata primitive. It takes a path instead of an `FsTarget` because `resolve` intentionally follows symlinks to produce stable identity; consumers that need trust-boundary checks can call `lstat` first and reject `symlink` before resolving.
75
+
76
+ ```ts type-equiv
77
+ /**
78
+ * Metadata about a path without following the final path component when it is a
79
+ * symbolic link. Unlike {@link FsInfo}, this path-level probe can report
80
+ * `symlink` so consumers with trust-boundary rules can reject repository-owned
81
+ * links before resolving a target.
82
+ */
83
+ interface FsPathInfo {
84
+ /** Opaque freshness token of the path entry right now. */
85
+ version: FsVersion
86
+ /** Whether the path entry is a regular file, directory, symlink, or other. */
87
+ type: 'file' | 'directory' | 'symlink' | 'other'
88
+ /** Byte size of the path entry, when the backend can report it. */
89
+ size?: number
90
+ }
91
+ ```
92
+
93
+ `listDir` returns direct child entries in stable name order. Each entry carries the child basename, type, resolved target, and cheap metadata when the backend can report it. It must not read file contents, so `size` is only for regular files and `version` is metadata-derived. Broken or disappeared children may be returned as `other` without metadata; permission or backend I/O failures while listing or resolving child metadata fail the whole listing with `FS_PERMISSION_DENIED` or `FS_IO_ERROR`.
94
+
95
+ ```ts type-equiv
96
+ /**
97
+ * One direct child returned by {@link FileSystem.listDir}. Listing returns
98
+ * metadata and resolved targets only; it must not read file contents.
99
+ */
100
+ interface FsDirEntry {
101
+ /** Basename of the child inside the listed directory. */
102
+ name: string
103
+ /** Whether the child is a regular file, a directory, or something else. */
104
+ type: 'file' | 'directory' | 'other'
105
+ /** Resolved child target for follow-up operations. */
106
+ target: FsTarget
107
+ /** Opaque freshness token when the backend can report metadata cheaply. */
108
+ version?: FsVersion
109
+ /** Byte size of a regular file, when the backend can report it. */
110
+ size?: number
111
+ }
112
+ ```
113
+
114
+ ## Write and edit guards (provider contract)
115
+
116
+ Both `writeText` and `editText` take their version guard OPTIONALLY: omit it for an unconditional (bare-provider) mutation, supply it to guard. `writeText`'s guard is an `FsWriteIntent` — `createIfAbsent` creates a missing target and rejects an existing one with `FS_NOT_OBSERVED`, including a target that appears after the provider's initial probe because publication itself must be no-replace; `replaceIfVersion` replaces only when the target exists at the observed version, else `FS_STALE_VERSION`. Omitting `expected` unconditionally creates-or-overwrites. The union itself carries only the two guarded intents; "no guard" is expressed by omission, so write and edit both use the same optional `expected` field.
117
+
118
+ ```ts type-equiv
119
+ /**
120
+ * Guarded write intent. `createIfAbsent` rejects an existing target with
121
+ * `FS_NOT_OBSERVED`; `replaceIfVersion` rejects absence or mismatch with
122
+ * `FS_STALE_VERSION`. Omitting the intent from `writeText` means unconditional
123
+ * create-or-overwrite, not a third union arm.
124
+ */
125
+ type FsWriteIntent =
126
+ | { kind: 'createIfAbsent' }
127
+ | { kind: 'replaceIfVersion'; version: FsVersion }
128
+ ```
129
+
130
+ ```ts type-equiv
131
+ /** Outcome of a full-file write. */
132
+ interface FsWriteOutcome {
133
+ /** Whether the write created a new file or replaced an existing one. */
134
+ operation: 'create' | 'update'
135
+ /** Opaque version of the file after the write. */
136
+ version: FsVersion
137
+ /**
138
+ * The file's content BEFORE the write, or `null` when the file did not exist
139
+ * (a create) or the backend declined a contextual basis (for example, a
140
+ * binary/non-UTF-8 prior file or either overwrite side reaching its exclusive limit).
141
+ * LF-normalized storage text (the diff basis), never a diff — a consumer
142
+ * computes the result-time contextual diff from `before`/`after` when
143
+ * `before` is present, else falls back to a whole-file diff.
144
+ */
145
+ before: string | null
146
+ /** The file's content AFTER the write, LF-normalized to share `before`'s diff basis. */
147
+ after: string
148
+ }
149
+ ```
150
+
151
+ `editText` is a provider-level mutation, not a `read` plus `write` composed elsewhere. When guarded it verifies the expected version BEFORE literal matching (so a stale edit reports `FS_STALE_VERSION`, not a match failure against newer content); unguarded it edits the current content. Either way it applies the replacement and writes atomically — keeping matching, line-ending handling, the stale check, and atomic replacement inside one mutation critical section — and a missing target reports `FS_STALE_VERSION` on both paths.
152
+
153
+ ```ts type-equiv
154
+ /** A literal-replacement edit request. */
155
+ interface FsEditRequest {
156
+ /** Literal non-empty text to replace. Must match exactly (after line-ending normalization). */
157
+ oldString: string
158
+ /** Literal replacement text. An empty string deletes the matched text. */
159
+ newString: string
160
+ /** Replace every match instead of requiring exactly one. */
161
+ replaceAll: boolean
162
+ }
163
+ ```
164
+
165
+ ```ts type-equiv
166
+ /** Outcome of a literal edit. */
167
+ interface FsEditOutcome {
168
+ /** Opaque version of the file after the edit. */
169
+ version: FsVersion
170
+ /**
171
+ * The file's content BEFORE the edit. Raw storage text (LF-normalized by the
172
+ * backend), never a diff — a consumer computes the result-time contextual diff
173
+ * (the applied hunk with context) from `before`/`after`.
174
+ */
175
+ before: string
176
+ /** The file's content AFTER the edit. */
177
+ after: string
178
+ }
179
+ ```
180
+
181
+ ## The fs policy events (provider contract vocabulary)
182
+
183
+ `dsh-fs` owns three events the tool dispatches and the policy plugin listens for, so the emitter (`dsh-tool-fs`) and the listener (`dsh-fs-observation-policy`) share a vocabulary without the emitter depending on the policy plugin. They carry only `dsh-fs` vocabulary plus an opaque `object` actor — no model-facing concepts and no agent/session owner structure.
184
+
185
+ `fs/write-intent` and `fs/edit-intent` are **single-slot decision waterfalls**: the tool dispatches each with a default thunk returning `undefined` (the bare provider), and a listener fully decides without calling `next()`. The slot is first-wins by registration order — the policy plugin owning it is a deployment convention, not an enforced invariant. `fs/observed` is a fire-and-forget recording event carrying an `FsObservation`: present at a version or confirmed absent. It is dispatched with a plain `ctx.emit`; its listener MUST be synchronous and side-effect-only, because the tool does NOT guard the emit — a throwing listener can replace a read error or surface as the tool's `isError` result after a mutation already succeeded. The generated [cordis surface](#cordis-surface) below shows the exact signatures.
186
+
187
+ ```ts type-equiv
188
+ /**
189
+ * One authoritative observation of a target. A present observation carries the
190
+ * version used by guarded replacement; an absent observation authorizes only a
191
+ * guarded create, never an edit.
192
+ */
193
+ type FsObservation =
194
+ | { readonly kind: 'present'; readonly version: FsVersion }
195
+ | { readonly kind: 'absent' }
196
+ ```
197
+
198
+ ## Execution context (policy plugin)
199
+
200
+ The policy plugin needs just enough execution context to derive the observed-state owner by narrowing the opaque `object` actor the `fs/*` events carry. `ToolExecution` has the required fields, so `dsh-tool-fs` passes its execution object through as the actor without making `dsh-fs-observation-policy` import the tool, agent, or session packages.
201
+
202
+ ```ts type-equiv
203
+ /**
204
+ * Minimal structural view of a tool execution the policy plugin needs to derive
205
+ * an observed-state owner. `@deepseek-ai/dsh-tools`' `ToolExecution` contains
206
+ * these fields, so the tool passes its `exec` straight through as the opaque
207
+ * `object` actor on the `fs/*` events; this plugin narrows that actor to
208
+ * `FsObservationActor` without importing `dsh-tools`, `dsh-agent`, or `dsh-session`.
209
+ *
210
+ * The owner is `agent.session` when present. It is treated as an opaque object
211
+ * identity (a `WeakMap` key); this package never reads any of its fields.
212
+ */
213
+ interface FsObservationActor {
214
+ /** The agent on whose behalf the call runs, when there is one. */
215
+ agent?: {
216
+ /** The session that owns observed-file state, used as an opaque key. */
217
+ session?: object
218
+ }
219
+ }
220
+ ```
221
+
222
+ ## Read outcome (consumer / read rendering)
223
+
224
+ A text read is bounded by line window, byte cap, and backend limits. After the byte cap is reached, scanning continues without retaining more lines so `totalLines` remains exact. The result the model-facing `read` tool renders is purely presentational; there is no `full`/`partial` view — authorization is freshness-based (the tool emits a present `fs/observed` directly with the stat's version), so any windowed read can authorize a later write/edit when the file is unchanged. A metadata miss emits an absent observation before the tool returns `FS_NOT_FOUND`, allowing a later guarded write to recreate an externally deleted target without authorizing edit. `dsh-tool-fs`, the executor that owns the read, implements read windowing and constructs this result; the policy plugin does not.
225
+
226
+ ```ts type-equiv
227
+ /** Outcome of a bounded text read — what {@link formatReadOutput} renders. */
228
+ interface FileReadOutcome {
229
+ /** 1-based first line requested. */
230
+ offset: number
231
+ /** Returned lines, already numbered. */
232
+ lines: FileTextLine[]
233
+ /** Exact total line count in the file. */
234
+ totalLines: number
235
+ /** Whether selected output hit the byte cap. */
236
+ truncatedByBytes?: true
237
+ }
238
+ ```
239
+
240
+ ## Observed-file state (policy plugin)
241
+
242
+ Observed state is a `WeakMap<owner, Map<targetKey, FsObservation>>` held inside the `dsh-fs-observation-policy` plugin. Missing map entry means unseen; `{ kind: 'absent' }` means a `read` or `str_replace_editor` `view`, `str_replace`, or `insert` metadata miss confirmed absence; `{ kind: 'present', version }` means a read, write, or edit observed that version. The write decision maps unseen and absent to `createIfAbsent`, while present maps to `replaceIfVersion`; the edit decision maps unseen to `FS_NOT_OBSERVED`, absent to `FS_NOT_FOUND`, and present to its version guard. The owner is derived from the event actor (normally `exec.agent.session`), treated as opaque and never read. Disposal drops everything (HMR safety), and the policy performs no filesystem I/O.
243
+
244
+ ## Error taxonomy (provider contract)
245
+
246
+ Filesystem failures use stable `FsErrorCode` strings carried by `FsError` (`HarnessError`). The tool registry preserves `{ name, code }` on error results, so retry, permission, and UI layers can branch without parsing text.
247
+
248
+ ```ts type-equiv
249
+ /**
250
+ * Stable, machine-routable codes for filesystem failures. Carried on
251
+ * {@link FsError}; the tool registry exposes `{ name, code }` on `isError`
252
+ * results so retry/permission/UI layers can branch without parsing messages.
253
+ */
254
+ type FsErrorCode =
255
+ | 'FS_NOT_FOUND'
256
+ | 'FS_NOT_DIRECTORY'
257
+ | 'FS_NOT_TEXT'
258
+ | 'FS_NOT_REGULAR_FILE'
259
+ | 'FS_TOO_LARGE'
260
+ | 'FS_PERMISSION_DENIED'
261
+ | 'FS_SANDBOX_DENIED'
262
+ | 'FS_IO_ERROR'
263
+ | 'FS_STALE_VERSION'
264
+ | 'FS_NOT_OBSERVED'
265
+ | 'FS_AMBIGUOUS_EDIT'
266
+ | 'FS_EDIT_NOT_FOUND'
267
+ | 'FS_ABORTED'
268
+ ```
269
+
270
+ `FS_NOT_DIRECTORY`, `FS_PERMISSION_DENIED`, and `FS_IO_ERROR` are used by directory listing to distinguish an existing non-directory target, a denied listing, and an unexpected backend I/O failure. `FS_SANDBOX_DENIED` is a POLICY refusal from a sandbox-enforcing backend (`dsh-fs-sandbox`) — the mode fence denied a write/edit — distinct from `FS_PERMISSION_DENIED` (the host kernel refusing). `FS_NOT_OBSERVED` means the policy plugin has no prior-observation record for this owner (or a `createIfAbsent` hit an existing file). `FS_NOT_FOUND` also represents an edit rejected from confirmed absence. `FS_STALE_VERSION` means the backend version no longer matches the observed one (or the provider itself receives an edit for a missing target). Freshness authorization has no partial/full distinction, so there is no `FS_PARTIAL_OBSERVATION`.
271
+
272
+ ## No timeouts on file IO
273
+
274
+ `read`/`write`/`edit` take **no** `timeoutMs`, and the provider contract arms no deadline — unlike bash and web (which consume [`@deepseek-ai/dsh-timeout`](../../packages/util/timeout/README.md)) and the subprocess-backed `glob`/`grep` (whose declared `timeoutMs` is enforced by `@deepseek-ai/dsh-tool-call-timeout-policy`): those are process-backed, where a deadline can really kill the work. A local syscall is best-effort-abortable at most — a timeout could not force an in-progress `fsync`/`rename` to stop, so a `timeoutMs` here would be a deadline the seam cannot enforce, and an implicit default in the exact place explicit-over-implicit forbids. Cancellation still propagates through the tool-execution signal for best-effort abort at syscall boundaries.
275
+
276
+ ## The service and the plugin
277
+
278
+ `FileSystem` (`ctx.fs`, abstract) owns the provider primitives: `resolve`, `processPath`, `fileUrl`, `contains`, `stat`, `lstat`, `readText`, `streamText`, `readBytes`, `listDir`, `writeText`, and `editText`. `dsh-fs-observation-policy` registers **no service** — it is a plugin that adds policy through the `fs/*` event gate: it decides the write/edit intent waterfalls from unseen/absent/present state and records `FsObservation` values. The executor is `dsh-tool-fs`: it reads/writes/edits through `ctx.fs`, dispatches the waterfalls, and emits the recording event. The generated [`ctx.fs` section](#ctxfs--filesystem-abstract-seam) below shows the exact signatures.
279
+
280
+ <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
281
+
282
+ <a id="cordis-surface"></a>
283
+
284
+ ## Cordis API
285
+
286
+ 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).
287
+
288
+ <a id="ctxfs--filesystem-abstract-seam"></a>
289
+
290
+ ### `ctx.fs` — `FileSystem` (abstract seam)
291
+
292
+ Abstract filesystem provider. Targets must preserve identity across aliases; reads expose regular UTF-8 text or typed errors, listings are stable and content-free, and mutations are atomic. Optional guards add stale protection without changing the unguarded provider contract.
293
+
294
+ ```ts cordis-catalog
295
+ /**
296
+ * Resolve a model/plugin-supplied path into a stable {@link FsTarget}. May perform I/O (a
297
+ * remote/sandboxed backend may need a round-trip to map a path to a stable identity), hence
298
+ * async even though the local backend only normalizes + realpaths.
299
+ *
300
+ * @param path - the path to resolve; relative paths resolve against `opts.cwd`.
301
+ * @param opts - optional cwd override and cancellation signal.
302
+ * @returns the stable target; the same file yields the same `targetKey`.
303
+ */
304
+ abstract resolve(path: string, opts?: { cwd?: string; signal?: AbortSignal }): Promise<FsTarget>
305
+
306
+ /**
307
+ * Return the canonical absolute path a subprocess in this filesystem's
308
+ * execution world can open. The path is deliberately separate from
309
+ * {@link FsTarget.targetKey}: consumers may pass this value to another OS
310
+ * capability, but must continue treating the target key as opaque.
311
+ * @param target - the resolved target whose process path is required.
312
+ * @returns an absolute path in the backend's execution world.
313
+ */
314
+ abstract processPath(target: FsTarget): string
315
+
316
+ /**
317
+ * Return the canonical `file:` URI for a target in this filesystem's
318
+ * execution world. Backends own URI encoding because the host platform may
319
+ * differ from the execution platform.
320
+ * @param target - the resolved target to encode.
321
+ * @returns the target's canonical file URI.
322
+ */
323
+ abstract fileUrl(target: FsTarget): string
324
+
325
+ /**
326
+ * Test canonical containment without exposing or parsing backend target
327
+ * keys. Both targets must come from this provider.
328
+ * @param parent - canonical directory target.
329
+ * @param child - canonical candidate target.
330
+ * @returns true when `child` is `parent` or a descendant of it.
331
+ */
332
+ abstract contains(parent: FsTarget, child: FsTarget): boolean
333
+
334
+ /**
335
+ * Return target metadata, or `undefined` when the target does not exist.
336
+ * @param target - the resolved target to stat.
337
+ * @param signal - aborts the metadata round-trip.
338
+ * @returns metadata only, never content; undefined for an absent target.
339
+ */
340
+ abstract stat(target: FsTarget, signal?: AbortSignal): Promise<FsInfo | undefined>
341
+
342
+ /**
343
+ * Return path metadata without following the final path component when it is a
344
+ * symbolic link. This is intentionally path-shaped, not target-shaped:
345
+ * {@link resolve} follows symlinks to produce the stable identity used by
346
+ * normal reads/writes, while `lstat` lets a consumer reject the path itself
347
+ * before that follow happens.
348
+ *
349
+ * `opts.cwd` follows {@link resolve}'s cwd rules. `undefined` means the path is
350
+ * absent.
351
+ * @param path - the path to inspect; relative paths resolve against `opts.cwd`.
352
+ * @param opts - `cwd` overrides the backend's default base for relative paths.
353
+ * @param signal - aborts the metadata round-trip.
354
+ * @returns metadata only, never content; undefined for an absent path.
355
+ */
356
+ abstract lstat(path: string, opts?: { cwd?: string }, signal?: AbortSignal): Promise<FsPathInfo | undefined>
357
+
358
+ /**
359
+ * Read the whole regular text file as a single decoded string.
360
+ * @param target - the resolved target to read.
361
+ * @param signal - aborts the read.
362
+ * @returns the full decoded UTF-8 content.
363
+ */
364
+ abstract readText(target: FsTarget, signal?: AbortSignal): Promise<string>
365
+
366
+ /**
367
+ * Stream the whole regular text file as decoded text chunks (same text
368
+ * semantics as {@link readText}, for large files). The backend owns
369
+ * cross-chunk UTF-8 decoding and binary rejection so the policy layer never
370
+ * touches raw bytes.
371
+ * @param target - the resolved target to read.
372
+ * @param signal - aborts the stream, including between chunks.
373
+ * @returns the chunk iterable, decoded and validated like {@link readText}.
374
+ */
375
+ abstract streamText(target: FsTarget, signal?: AbortSignal): Promise<AsyncIterable<string>>
376
+
377
+ /**
378
+ * Read the whole regular file as raw bytes with no decoding or binary
379
+ * rejection. The bound lives at this seam so a backend can never buffer an
380
+ * unbounded file: a target known or discovered to exceed `maxBytes` fails
381
+ * with `FS_TOO_LARGE` instead of returning a truncated result.
382
+ * @param target - the resolved target to read.
383
+ * @param signal - aborts the read.
384
+ * @param maxBytes - inclusive byte cap on the complete content.
385
+ * @returns the full raw content, at most `maxBytes` long.
386
+ */
387
+ abstract readBytes(target: FsTarget, signal: AbortSignal | undefined, maxBytes: number): Promise<Uint8Array>
388
+
389
+ /**
390
+ * List direct children of a directory in stable name order. Returns resolved
391
+ * child targets plus cheap metadata only; never reads file contents.
392
+ * @param target - the resolved directory target.
393
+ * @param signal - aborts the listing.
394
+ * @returns one entry per direct child, in stable name order.
395
+ */
396
+ abstract listDir(target: FsTarget, signal?: AbortSignal): Promise<FsDirEntry[]>
397
+
398
+ /**
399
+ * Atomically create or replace UTF-8 text. `expected` guards intent and
400
+ * staleness; omission allows unconditional overwrite.
401
+ * @param target - the resolved target to write.
402
+ * @param content - the full new file content.
403
+ * @param expected - the write intent guarding the write; omit for unconditional.
404
+ * @param signal - aborts before atomic publication takes effect.
405
+ * @param sandboxPolicy - the per-call mode and workspace root this write
406
+ * runs under; a sandboxing backend fences the write by it, the bare backend
407
+ * ignores it. Omit to leave the backend its own default.
408
+ * @returns the outcome, including the version the write produced.
409
+ */
410
+ abstract writeText( target: FsTarget, content: string, expected?: FsWriteIntent, signal?: AbortSignal, sandboxPolicy?: SandboxExecutionPolicy, ): Promise<FsWriteOutcome>
411
+
412
+ /**
413
+ * Atomically edit literal text. When supplied, the version guard is checked
414
+ * before matching so stale content reports `FS_STALE_VERSION`; omission edits
415
+ * the current content without a freshness precondition.
416
+ * @param target - the resolved target to edit.
417
+ * @param edit - the literal search/replace request.
418
+ * @param expected - the version guard; omit for an unconditional edit.
419
+ * @param signal - aborts before atomic publication takes effect.
420
+ * @param sandboxPolicy - the per-call mode and workspace root this edit runs
421
+ * under; a sandboxing backend fences the edit by it, the bare backend
422
+ * ignores it. Omit to leave the backend its own default.
423
+ * @returns the outcome, including the version the edit produced.
424
+ */
425
+ abstract editText( target: FsTarget, edit: FsEditRequest, expected?: { version: FsVersion }, signal?: AbortSignal, sandboxPolicy?: SandboxExecutionPolicy, ): Promise<FsEditOutcome>
426
+ ```
427
+
428
+ Types: [SandboxExecutionPolicy](sandbox.md)
429
+
430
+ Source: [`packages/fs/fs/src/index.ts:86`](../../packages/fs/fs/src/index.ts)
431
+
432
+ <a id="fs-events"></a>
433
+
434
+ ### `fs/*` events
435
+
436
+ <a id="fsedit-intent--waterfall"></a>
437
+
438
+ #### `fs/edit-intent` — waterfall
439
+
440
+ Single-slot decision for the next FileSystem.editText. Calling `next()` yields an unconditional edit; the first returned guard wins.
441
+
442
+ ```ts cordis-catalog
443
+ /**
444
+ * Single-slot decision for the next {@link FileSystem.editText}. Calling
445
+ * `next()` yields an unconditional edit; the first returned guard wins.
446
+ * @param target - the resolved target about to be edited.
447
+ * @param actor - the opaque tool-execution context the decider keys off.
448
+ * @mode waterfall
449
+ */
450
+ 'fs/edit-intent'(target: FsTarget, actor: object | undefined, next: () => { version: FsVersion } | undefined | Promise<{ version: FsVersion } | undefined>): Promise<{ version: FsVersion } | undefined>
451
+ ```
452
+
453
+ Source: [`packages/fs/fs/src/index.ts:66`](../../packages/fs/fs/src/index.ts)
454
+
455
+ <a id="fsobserved--emit"></a>
456
+
457
+ #### `fs/observed` — emit
458
+
459
+ Record an authoritative positive or negative observation. Listeners must be synchronous recorders: throws fail the tool call and returned promises are not awaited.
460
+
461
+ ```ts cordis-catalog
462
+ /**
463
+ * Record an authoritative positive or negative observation. Listeners must
464
+ * be synchronous recorders: throws fail the tool call and returned promises
465
+ * are not awaited.
466
+ * @param target - the target whose presence or absence was observed.
467
+ * @param observation - present with its version, or confirmed absent.
468
+ * @param actor - the observing tool-execution context; undefined records nothing useful.
469
+ * @mode emit
470
+ */
471
+ 'fs/observed'(target: FsTarget, observation: FsObservation, actor: object | undefined): void
472
+ ```
473
+
474
+ Source: [`packages/fs/fs/src/index.ts:76`](../../packages/fs/fs/src/index.ts)
475
+
476
+ <a id="fswrite-intent--waterfall"></a>
477
+
478
+ #### `fs/write-intent` — waterfall
479
+
480
+ Single-slot decision for the next FileSystem.writeText. Calling `next()` yields the bare provider's unconditional write; the first listener that returns an intent owns the decision rather than composing with peers.
481
+
482
+ ```ts cordis-catalog
483
+ /**
484
+ * Single-slot decision for the next {@link FileSystem.writeText}. Calling
485
+ * `next()` yields the bare provider's unconditional write; the first listener
486
+ * that returns an intent owns the decision rather than composing with peers.
487
+ * @param target - the resolved target about to be written.
488
+ * @param actor - the opaque tool-execution context the decider keys off.
489
+ * @mode waterfall
490
+ */
491
+ 'fs/write-intent'(target: FsTarget, actor: object | undefined, next: () => FsWriteIntent | undefined | Promise<FsWriteIntent | undefined>): Promise<FsWriteIntent | undefined>
492
+ ```
493
+
494
+ Source: [`packages/fs/fs/src/index.ts:58`](../../packages/fs/fs/src/index.ts)
495
+ <!-- END GENERATED cordis-surface -->