dsh-plugin-dev-kb 1.8.0 → 1.8.1

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 (229) hide show
  1. package/CHANGELOG.md +186 -178
  2. package/README.en.md +172 -172
  3. package/README.md +183 -183
  4. package/kb/INDEX.md +236 -234
  5. package/kb/README.md +88 -88
  6. package/kb/extra/AGENTS.md +77 -77
  7. package/kb/extra/deepseek-llm-api-wire-extensions.md +162 -162
  8. package/kb/extra/deepseek-llm-api-wire-extensions.zh.md +162 -162
  9. package/kb/extra/defensive-patterns/package-surface.md +233 -232
  10. package/kb/extra/defensive-patterns/package-surface.zh.md +233 -232
  11. package/kb/extra/defensive-patterns/remote-and-api.md +117 -117
  12. package/kb/extra/defensive-patterns/remote-and-api.zh.md +117 -117
  13. package/kb/extra/development.md +221 -221
  14. package/kb/extra/development.zh.md +228 -228
  15. package/kb/extra/event-producer-consumer.md +133 -123
  16. package/kb/extra/event-producer-consumer.zh.md +135 -125
  17. package/kb/extra/module-graph.md +1961 -1888
  18. package/kb/extra/module-graph.zh.md +1963 -1890
  19. package/kb/extra/persistence-changes/2026-11-05-timeline-priority-notice.md +60 -0
  20. package/kb/extra/persistence-changes/2026-11-05-timeline-priority-notice.zh.md +60 -0
  21. package/kb/extra/persistence-changes/README.md +92 -92
  22. package/kb/extra/persistence-changes/README.zh.md +92 -92
  23. package/kb/extra/persistence-changes/historical-formats/README.md +75 -75
  24. package/kb/extra/persistence-changes/historical-formats/README.zh.md +75 -75
  25. package/kb/extra/persistence-changes/releases/README.md +103 -103
  26. package/kb/extra/persistence-changes/releases/README.zh.md +103 -103
  27. package/kb/extra/rescope.md +55 -55
  28. package/kb/extra/rescope.zh.md +55 -55
  29. package/kb/extra/subsystems/boot.md +631 -621
  30. package/kb/extra/subsystems/boot.zh.md +631 -621
  31. package/kb/extra/subsystems/computer-use.md +179 -137
  32. package/kb/extra/subsystems/computer-use.zh.md +179 -137
  33. package/kb/extra/subsystems/extensions.md +387 -384
  34. package/kb/extra/subsystems/extensions.zh.md +387 -384
  35. package/kb/extra/subsystems/feedback.md +418 -400
  36. package/kb/extra/subsystems/feedback.zh.md +418 -400
  37. package/kb/extra/subsystems/forge.md +2169 -1226
  38. package/kb/extra/subsystems/forge.zh.md +2171 -1226
  39. package/kb/extra/subsystems/liveshare.md +167 -158
  40. package/kb/extra/subsystems/liveshare.zh.md +167 -158
  41. package/kb/extra/subsystems/mcp.md +237 -234
  42. package/kb/extra/subsystems/mcp.zh.md +237 -234
  43. package/kb/extra/subsystems/office-kit.md +122 -0
  44. package/kb/extra/subsystems/office-kit.zh.md +122 -0
  45. package/kb/extra/subsystems/working-directory.md +95 -64
  46. package/kb/extra/subsystems/working-directory.zh.md +95 -64
  47. package/kb/extra/subsystems/worktrees.md +187 -127
  48. package/kb/extra/subsystems/worktrees.zh.md +187 -127
  49. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/python-ptc-sandbox/guide.md +21 -21
  50. package/kb/extra/upgrade-guide/v0.2.1-alpha.1/python-ptc-sandbox/guide.zh.md +21 -21
  51. package/kb/extra/upgrade-guide/v0.2.1-rc.4/sandbox-unsupported-policy-error/guide.md +18 -0
  52. package/kb/extra/upgrade-guide/v0.2.1-rc.4/sandbox-unsupported-policy-error/guide.zh.md +18 -0
  53. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/llm-error-builtin-codes/guide.md +18 -0
  54. package/kb/extra/upgrade-guide/v0.2.2-alpha.2/llm-error-builtin-codes/guide.zh.md +18 -0
  55. package/kb/extra/upgrade-guide/v0.2.2-alpha.3/office-kit-package/guide.md +34 -0
  56. package/kb/extra/upgrade-guide/v0.2.2-alpha.3/office-kit-package/guide.zh.md +34 -0
  57. package/kb/extra/upgrade-guide/v0.2.2-alpha.3/office-operation-tools/guide.md +49 -0
  58. package/kb/extra/upgrade-guide/v0.2.2-alpha.3/office-operation-tools/guide.zh.md +49 -0
  59. package/kb/extra/upgrade-guide/v0.2.2-alpha.3/office-skill-resources/guide.md +36 -0
  60. package/kb/extra/upgrade-guide/v0.2.2-alpha.3/office-skill-resources/guide.zh.md +36 -0
  61. package/kb/extra/upgrade-guide/v0.2.2-rc.1/account-notification-fields/guide.md +26 -0
  62. package/kb/extra/upgrade-guide/v0.2.2-rc.1/account-notification-fields/guide.zh.md +26 -0
  63. package/kb/extra/upgrade-guide/v0.2.2-rc.1/account-remote-provider/guide.md +22 -0
  64. package/kb/extra/upgrade-guide/v0.2.2-rc.1/account-remote-provider/guide.zh.md +22 -0
  65. package/kb/extra/upgrade-guide/v0.2.2-rc.1/archive-worktrees/guide.md +21 -0
  66. package/kb/extra/upgrade-guide/v0.2.2-rc.1/archive-worktrees/guide.zh.md +21 -0
  67. package/kb/extra/upgrade-guide/v0.2.2-rc.1/attachment-error-codes/guide.md +23 -0
  68. package/kb/extra/upgrade-guide/v0.2.2-rc.1/attachment-error-codes/guide.zh.md +23 -0
  69. package/kb/extra/upgrade-guide/v0.2.2-rc.1/cua-ax-read-limits/guide.md +20 -0
  70. package/kb/extra/upgrade-guide/v0.2.2-rc.1/cua-ax-read-limits/guide.zh.md +20 -0
  71. package/kb/extra/upgrade-guide/v0.2.2-rc.1/cua-hover-ax-only/guide.md +18 -0
  72. package/kb/extra/upgrade-guide/v0.2.2-rc.1/cua-hover-ax-only/guide.zh.md +18 -0
  73. package/kb/extra/upgrade-guide/v0.2.2-rc.1/cua-native-platform/guide.md +23 -0
  74. package/kb/extra/upgrade-guide/v0.2.2-rc.1/cua-native-platform/guide.zh.md +23 -0
  75. package/kb/extra/upgrade-guide/v0.2.2-rc.1/dsh-doc-skill/guide.md +35 -0
  76. package/kb/extra/upgrade-guide/v0.2.2-rc.1/dsh-doc-skill/guide.zh.md +35 -0
  77. package/kb/extra/upgrade-guide/v0.2.2-rc.1/forge-change-request-overview/guide.md +26 -0
  78. package/kb/extra/upgrade-guide/v0.2.2-rc.1/forge-change-request-overview/guide.zh.md +26 -0
  79. package/kb/extra/upgrade-guide/v0.2.2-rc.1/forge-pinned-diff/guide.md +26 -0
  80. package/kb/extra/upgrade-guide/v0.2.2-rc.1/forge-pinned-diff/guide.zh.md +26 -0
  81. package/kb/extra/upgrade-guide/v0.2.2-rc.1/forge-review-reads/guide.md +19 -0
  82. package/kb/extra/upgrade-guide/v0.2.2-rc.1/forge-review-reads/guide.zh.md +19 -0
  83. package/kb/extra/upgrade-guide/v0.2.2-rc.1/package-export-cleanup/guide.md +26 -0
  84. package/kb/extra/upgrade-guide/v0.2.2-rc.1/package-export-cleanup/guide.zh.md +26 -0
  85. package/kb/extra/upgrade-guide/v0.2.2-rc.1/plugin-update-method/guide.md +22 -0
  86. package/kb/extra/upgrade-guide/v0.2.2-rc.1/plugin-update-method/guide.zh.md +22 -0
  87. package/kb/extra/upgrade-guide/v0.2.2-rc.1/ptc-bootstrap-protocol/guide.md +25 -0
  88. package/kb/extra/upgrade-guide/v0.2.2-rc.1/ptc-bootstrap-protocol/guide.zh.md +25 -0
  89. package/kb/extra/upgrade-guide/v0.2.2-rc.1/ptc-inspect-output/guide.md +48 -0
  90. package/kb/extra/upgrade-guide/v0.2.2-rc.1/ptc-inspect-output/guide.zh.md +48 -0
  91. package/kb/extra/upgrade-guide/v0.2.2-rc.1/ptc-scoped-repl-default/guide.md +45 -0
  92. package/kb/extra/upgrade-guide/v0.2.2-rc.1/ptc-scoped-repl-default/guide.zh.md +45 -0
  93. package/kb/extra/upgrade-guide/v0.2.2-rc.1/runtime-context-reminders/guide.md +19 -0
  94. package/kb/extra/upgrade-guide/v0.2.2-rc.1/runtime-context-reminders/guide.zh.md +19 -0
  95. package/kb/extra/upgrade-guide/v0.2.2-rc.1/session-append-overloads/guide.md +17 -0
  96. package/kb/extra/upgrade-guide/v0.2.2-rc.1/session-append-overloads/guide.zh.md +17 -0
  97. package/kb/extra/upgrade-guide/v0.2.2-rc.1/subagent-interrupt-default/guide.md +27 -0
  98. package/kb/extra/upgrade-guide/v0.2.2-rc.1/subagent-interrupt-default/guide.zh.md +27 -0
  99. package/kb/extra/upgrade-guide/v0.2.2-rc.1/terminal-backend-cleanup-error/guide.md +20 -0
  100. package/kb/extra/upgrade-guide/v0.2.2-rc.1/terminal-backend-cleanup-error/guide.zh.md +20 -0
  101. package/kb/extra/upgrade-guide/v0.2.2-rc.1/terminal-bundle-sidebar-backend/guide.md +19 -0
  102. package/kb/extra/upgrade-guide/v0.2.2-rc.1/terminal-bundle-sidebar-backend/guide.zh.md +19 -0
  103. package/kb/extra/upgrade-guide/v0.2.2-rc.1/web-fetch-transport-error-codes/guide.md +18 -0
  104. package/kb/extra/upgrade-guide/v0.2.2-rc.1/web-fetch-transport-error-codes/guide.zh.md +18 -0
  105. package/kb/extra/upgrade-guide/v0.2.2-rc.1/web-search-billing/guide.md +41 -0
  106. package/kb/extra/upgrade-guide/v0.2.2-rc.1/web-search-billing/guide.zh.md +41 -0
  107. package/kb/extra/upgrade-guide/v0.2.2-rc.1/window-drag-regions/guide.md +21 -0
  108. package/kb/extra/upgrade-guide/v0.2.2-rc.1/window-drag-regions/guide.zh.md +21 -0
  109. package/kb/extra/upgrade-guide/v0.2.2-rc.2/client-module-metadata/guide.md +29 -0
  110. package/kb/extra/upgrade-guide/v0.2.2-rc.2/client-module-metadata/guide.zh.md +29 -0
  111. package/kb/extra/upgrade-guide/v0.2.2-rc.2/connection-page-peer/guide.md +25 -0
  112. package/kb/extra/upgrade-guide/v0.2.2-rc.2/connection-page-peer/guide.zh.md +25 -0
  113. package/kb/extra/upgrade-guide/v0.2.2-rc.2/cordis-root-and-intercept-metadata/guide.md +31 -0
  114. package/kb/extra/upgrade-guide/v0.2.2-rc.2/cordis-root-and-intercept-metadata/guide.zh.md +31 -0
  115. package/kb/extra/upgrade-guide/v0.2.2-rc.2/cua-agents-without-preset/guide.md +24 -0
  116. package/kb/extra/upgrade-guide/v0.2.2-rc.2/cua-agents-without-preset/guide.zh.md +24 -0
  117. package/kb/extra/upgrade-guide/v0.2.2-rc.2/cua-macos-provider/guide.md +24 -0
  118. package/kb/extra/upgrade-guide/v0.2.2-rc.2/cua-macos-provider/guide.zh.md +24 -0
  119. package/kb/extra/upgrade-guide/v0.2.2-rc.2/cua-partial-observations/guide.md +19 -0
  120. package/kb/extra/upgrade-guide/v0.2.2-rc.2/cua-partial-observations/guide.zh.md +19 -0
  121. package/kb/extra/upgrade-guide/v0.2.2-rc.2/deepseek-files-timeout/guide.md +15 -0
  122. package/kb/extra/upgrade-guide/v0.2.2-rc.2/deepseek-files-timeout/guide.zh.md +15 -0
  123. package/kb/extra/upgrade-guide/v0.2.2-rc.2/experimental-tool-error-codes/guide.md +28 -0
  124. package/kb/extra/upgrade-guide/v0.2.2-rc.2/experimental-tool-error-codes/guide.zh.md +28 -0
  125. package/kb/extra/upgrade-guide/v0.2.2-rc.2/package-export-cleanup/guide.md +36 -0
  126. package/kb/extra/upgrade-guide/v0.2.2-rc.2/package-export-cleanup/guide.zh.md +36 -0
  127. package/kb/extra/upgrade-guide/v0.2.2-rc.2/python-ptc-removal/guide.md +22 -0
  128. package/kb/extra/upgrade-guide/v0.2.2-rc.2/python-ptc-removal/guide.zh.md +22 -0
  129. package/kb/extra/upgrade-guide/v0.2.2-rc.2/session-status-package/guide.md +31 -0
  130. package/kb/extra/upgrade-guide/v0.2.2-rc.2/session-status-package/guide.zh.md +31 -0
  131. package/kb/extra/upgrade-guide/v0.2.2-rc.2/shared-search-filter/guide.md +18 -0
  132. package/kb/extra/upgrade-guide/v0.2.2-rc.2/shared-search-filter/guide.zh.md +18 -0
  133. package/kb/extra/upgrade-guide/v0.2.2-rc.2/shell-fs-tool-error-codes/guide.md +30 -0
  134. package/kb/extra/upgrade-guide/v0.2.2-rc.2/shell-fs-tool-error-codes/guide.zh.md +30 -0
  135. package/kb/extra/web-styling.md +57 -57
  136. package/kb/extra/web-styling.zh.md +57 -57
  137. package/kb/meta/search-index.json +4508 -3980
  138. package/kb/meta/source.json +18 -18
  139. package/kb/site/develop/practice/llm-adapter.md +192 -192
  140. package/kb/site/en/develop/practice/llm-adapter.md +192 -192
  141. package/kb/site/en/guide/desktop-uninstall-cleanup.md +63 -0
  142. package/kb/site/en/guide/plugin-market.md +153 -151
  143. package/kb/site/en/guide/providers.md +234 -234
  144. package/kb/site/en/guide/quickstart.md +35 -34
  145. package/kb/site/en/reference/capability-seams.md +789 -767
  146. package/kb/site/en/reference/config-catalog.md +5432 -5128
  147. package/kb/site/en/reference/cookbook/adding-a-package.md +175 -175
  148. package/kb/site/en/reference/cookbook/adding-a-tool.md +105 -104
  149. package/kb/site/en/reference/cookbook/extension-cookbook.md +178 -135
  150. package/kb/site/en/reference/cordis-api/context.md +373 -369
  151. package/kb/site/en/reference/cordis-api/fiber.md +457 -433
  152. package/kb/site/en/reference/cordis-api/inherited.md +44 -44
  153. package/kb/site/en/reference/cordis-api/service.md +118 -107
  154. package/kb/site/en/reference/experimental-persistence-catalog.md +36 -23
  155. package/kb/site/en/reference/index.md +174 -174
  156. package/kb/site/en/reference/persistence-catalog.md +9453 -9432
  157. package/kb/site/en/reference/subsystems/compaction.md +288 -288
  158. package/kb/site/en/reference/subsystems/core.md +1172 -1171
  159. package/kb/site/en/reference/subsystems/credentials.md +526 -497
  160. package/kb/site/en/reference/subsystems/filesystem.md +708 -708
  161. package/kb/site/en/reference/subsystems/index.md +82 -82
  162. package/kb/site/en/reference/subsystems/llm-streaming.md +1290 -1288
  163. package/kb/site/en/reference/subsystems/lsp.md +230 -206
  164. package/kb/site/en/reference/subsystems/persistence.md +451 -432
  165. package/kb/site/en/reference/subsystems/plan.md +91 -91
  166. package/kb/site/en/reference/subsystems/ptc-runtime.md +295 -261
  167. package/kb/site/en/reference/subsystems/sandbox.md +250 -232
  168. package/kb/site/en/reference/subsystems/session-query.md +525 -515
  169. package/kb/site/en/reference/subsystems/session-reference.md +231 -229
  170. package/kb/site/en/reference/subsystems/session.md +1478 -1431
  171. package/kb/site/en/reference/subsystems/sidebar-right.md +165 -165
  172. package/kb/site/en/reference/subsystems/skills.md +356 -356
  173. package/kb/site/en/reference/subsystems/slots.md +235 -231
  174. package/kb/site/en/reference/subsystems/terminal.md +188 -188
  175. package/kb/site/en/reference/subsystems/tools.md +902 -891
  176. package/kb/site/en/reference/subsystems/user-questions.md +330 -327
  177. package/kb/site/en/reference/subsystems/web-client.md +161 -104
  178. package/kb/site/en/reference/subsystems/web-server.md +434 -351
  179. package/kb/site/en/reference/subsystems/web.md +268 -268
  180. package/kb/site/en/reference/subsystems/workflow.md +287 -282
  181. package/kb/site/en/reference/subsystems/workspace.md +743 -651
  182. package/kb/site/en/reference/tool-catalog.md +2867 -2704
  183. package/kb/site/guide/desktop-uninstall-cleanup.md +63 -0
  184. package/kb/site/guide/plugin-market.md +153 -151
  185. package/kb/site/guide/providers.md +234 -234
  186. package/kb/site/guide/quickstart.md +35 -34
  187. package/kb/site/reference/capability-seams.md +789 -767
  188. package/kb/site/reference/config-catalog.md +5432 -5128
  189. package/kb/site/reference/cookbook/adding-a-package.md +175 -175
  190. package/kb/site/reference/cookbook/adding-a-tool.md +107 -106
  191. package/kb/site/reference/cookbook/extension-cookbook.md +182 -139
  192. package/kb/site/reference/cordis-api/context.md +373 -369
  193. package/kb/site/reference/cordis-api/fiber.md +459 -435
  194. package/kb/site/reference/cordis-api/inherited.md +44 -44
  195. package/kb/site/reference/cordis-api/service.md +118 -107
  196. package/kb/site/reference/experimental-persistence-catalog.md +36 -23
  197. package/kb/site/reference/index.md +178 -178
  198. package/kb/site/reference/persistence-catalog.md +9453 -9432
  199. package/kb/site/reference/subsystems/compaction.md +288 -288
  200. package/kb/site/reference/subsystems/core.md +1184 -1183
  201. package/kb/site/reference/subsystems/credentials.md +526 -497
  202. package/kb/site/reference/subsystems/filesystem.md +708 -708
  203. package/kb/site/reference/subsystems/index.md +82 -82
  204. package/kb/site/reference/subsystems/llm-streaming.md +1296 -1294
  205. package/kb/site/reference/subsystems/lsp.md +230 -206
  206. package/kb/site/reference/subsystems/persistence.md +451 -432
  207. package/kb/site/reference/subsystems/plan.md +91 -91
  208. package/kb/site/reference/subsystems/ptc-runtime.md +295 -261
  209. package/kb/site/reference/subsystems/sandbox.md +250 -232
  210. package/kb/site/reference/subsystems/session-query.md +525 -515
  211. package/kb/site/reference/subsystems/session-reference.md +231 -229
  212. package/kb/site/reference/subsystems/session.md +1482 -1435
  213. package/kb/site/reference/subsystems/sidebar-right.md +165 -165
  214. package/kb/site/reference/subsystems/skills.md +356 -356
  215. package/kb/site/reference/subsystems/slots.md +239 -235
  216. package/kb/site/reference/subsystems/terminal.md +188 -188
  217. package/kb/site/reference/subsystems/tools.md +902 -891
  218. package/kb/site/reference/subsystems/user-questions.md +330 -327
  219. package/kb/site/reference/subsystems/web-client.md +161 -104
  220. package/kb/site/reference/subsystems/web-server.md +434 -351
  221. package/kb/site/reference/subsystems/web.md +268 -268
  222. package/kb/site/reference/subsystems/workflow.md +287 -282
  223. package/kb/site/reference/subsystems/workspace.md +743 -651
  224. package/kb/site/reference/tool-catalog.md +2872 -2709
  225. package/lib/index.js +359 -359
  226. package/package.json +68 -68
  227. package/skills/dsh-plugin-dev-kb.md +71 -70
  228. package/kb/extra/subsystems/office-to-pdf.md +0 -87
  229. package/kb/extra/subsystems/office-to-pdf.zh.md +0 -87
package/package.json CHANGED
@@ -1,68 +1,68 @@
1
- {
2
- "name": "dsh-plugin-dev-kb",
3
- "description": "dsh 插件辅助:① dsh-plugin-dev-kb 技能 = DeepSeek Harness 官方文档站完整 Markdown 镜像(中英双语 192 页)+ 439 篇仓库补充开发参考 + 主题导航与 634 文件全量搜索索引;② dsh-dev-sandbox 技能 = 自建独立沙箱 profile 开发沙箱工作流(沙箱名由 agent 按任务自定),开发中的插件隔离运行,agent 自主启动/重启/冒烟验证,插件崩了不影响主力 dsh;③ dsh_kb_search 工具 = 知识库本地打分检索,一次调用返回命中文件 + 行号 + 上下文片段。零运行时依赖。",
4
- "version": "1.8.0",
5
- "type": "module",
6
- "main": "lib/index.js",
7
- "exports": {
8
- ".": "./lib/index.js",
9
- "./package.json": "./package.json"
10
- },
11
- "files": [
12
- "lib",
13
- "docs",
14
- "kb",
15
- "skills",
16
- "scripts",
17
- "cordis.patch.yml",
18
- "README.md",
19
- "README.en.md",
20
- "CHANGELOG.md",
21
- "LICENSE"
22
- ],
23
- "scripts": {
24
- "selfcheck": "node scripts/selfcheck.mjs",
25
- "rebuild-index": "node scripts/rebuild-index.mjs",
26
- "refresh-kb": "node scripts/refresh-kb.mjs",
27
- "smoke": "node scripts/smoke.mjs"
28
- },
29
- "keywords": [
30
- "dsh",
31
- "dsh-plugin",
32
- "deepseek",
33
- "harness",
34
- "cordis",
35
- "plugin",
36
- "knowledge",
37
- "knowledge-base",
38
- "documentation",
39
- "official-docs",
40
- "documentation-mirror",
41
- "kb",
42
- "plugin-development",
43
- "agent-skills",
44
- "skills",
45
- "retrieval",
46
- "rag"
47
- ],
48
- "repository": {
49
- "type": "git",
50
- "url": "git+https://github.com/Pasumao/dsh-plugin-dev-kb.git"
51
- },
52
- "homepage": "https://github.com/Pasumao/dsh-plugin-dev-kb",
53
- "bugs": {
54
- "url": "https://github.com/Pasumao/dsh-plugin-dev-kb/issues"
55
- },
56
- "license": "MIT",
57
- "peerDependencies": {
58
- "@deepseek-ai/cordis": "^4.0.1"
59
- },
60
- "engines": {
61
- "node": ">=18"
62
- },
63
- "dsh": {
64
- "bundle": {
65
- "patch": "./cordis.patch.yml"
66
- }
67
- }
68
- }
1
+ {
2
+ "name": "dsh-plugin-dev-kb",
3
+ "description": "dsh 插件辅助:① dsh-plugin-dev-kb 技能 = DeepSeek Harness 官方文档站完整 Markdown 镜像(中英双语 192 页)+ 439 篇仓库补充开发参考 + 主题导航与 634 文件全量搜索索引;② dsh-dev-sandbox 技能 = 自建独立沙箱 profile 开发沙箱工作流(沙箱名由 agent 按任务自定),开发中的插件隔离运行,agent 自主启动/重启/冒烟验证,插件崩了不影响主力 dsh;③ dsh_kb_search 工具 = 知识库本地打分检索,一次调用返回命中文件 + 行号 + 上下文片段。零运行时依赖。",
4
+ "version": "1.8.1",
5
+ "type": "module",
6
+ "main": "lib/index.js",
7
+ "exports": {
8
+ ".": "./lib/index.js",
9
+ "./package.json": "./package.json"
10
+ },
11
+ "files": [
12
+ "lib",
13
+ "docs",
14
+ "kb",
15
+ "skills",
16
+ "scripts",
17
+ "cordis.patch.yml",
18
+ "README.md",
19
+ "README.en.md",
20
+ "CHANGELOG.md",
21
+ "LICENSE"
22
+ ],
23
+ "scripts": {
24
+ "selfcheck": "node scripts/selfcheck.mjs",
25
+ "rebuild-index": "node scripts/rebuild-index.mjs",
26
+ "refresh-kb": "node scripts/refresh-kb.mjs",
27
+ "smoke": "node scripts/smoke.mjs"
28
+ },
29
+ "keywords": [
30
+ "dsh",
31
+ "dsh-plugin",
32
+ "deepseek",
33
+ "harness",
34
+ "cordis",
35
+ "plugin",
36
+ "knowledge",
37
+ "knowledge-base",
38
+ "documentation",
39
+ "official-docs",
40
+ "documentation-mirror",
41
+ "kb",
42
+ "plugin-development",
43
+ "agent-skills",
44
+ "skills",
45
+ "retrieval",
46
+ "rag"
47
+ ],
48
+ "repository": {
49
+ "type": "git",
50
+ "url": "git+https://github.com/Pasumao/dsh-plugin-dev-kb.git"
51
+ },
52
+ "homepage": "https://github.com/Pasumao/dsh-plugin-dev-kb",
53
+ "bugs": {
54
+ "url": "https://github.com/Pasumao/dsh-plugin-dev-kb/issues"
55
+ },
56
+ "license": "MIT",
57
+ "peerDependencies": {
58
+ "@deepseek-ai/cordis": "^4.0.1"
59
+ },
60
+ "engines": {
61
+ "node": ">=18"
62
+ },
63
+ "dsh": {
64
+ "bundle": {
65
+ "patch": "./cordis.patch.yml"
66
+ }
67
+ }
68
+ }
@@ -1,70 +1,71 @@
1
- ---
2
- name: dsh-plugin-dev-kb
3
- description: DeepSeek Harness 官方文档知识库的使用指南:知识库位置与结构、按任务场景的阅读路径、检索策略。写 dsh 插件 / Tool / 配置 / 服务 / 事件 / 打包发布 / LLM 适配器时先加载本技能定位文档。注意:本技能仅限 dsh(DeepSeek Harness)插件开发;写 NoneBot 插件时请加载 nonebot-plugin-dev-kb,勿用本技能。
4
- whenToUse: 开发 dsh 插件、查询 dsh 能力与 API、写 Tool、配置 cordis.yml、扩展 Harness 时
5
- ---
6
- # dsh 插件开发知识库使用指南(dsh-plugin-dev-kb)
7
-
8
- 本插件内置 DeepSeek Harness 官方文档的完整镜像,供插件开发时快速定位与检索。
9
-
10
- ## 0. 知识库位置
11
-
12
- - **知识库根**:`{{KB_ROOT}}`(插件挂载时由 lib/index.js 自动替换为插件内 kb/ 目录的实际绝对路径,可直接 read/glob/grep;正斜杠路径,跨机器/安装位置始终有效)
13
- - 数据来源:官方文档站点(VitePress)的仓库原始 Markdown,链接已按站点路由重写,与线上站点逐字一致(见 `kb/meta/source.json` 的 commit)
14
-
15
- ## 1. 目录结构
16
-
17
- ```
18
- kb/
19
- ├── site/ 线上站点完整镜像(中英双语 192 页,优先读这里)
20
- │ ├── guide/ 入门:quickstart / providers / python-sdk / github-review / schedule / mcp-memory / network-proxy / public-deployments
21
- │ ├── develop/ basic(第一个插件/tool/config/publish)、framework(生命周期/服务/事件)、
22
- │ │ practice(能力分层/LLM适配器/动态装配)、cordis-tutorial(7章)
23
- │ ├── reference/ index(架构)、cordis-primer、capability-seams、agent-lifecycle、
24
- │ │ config-catalog、tool-catalog、api-gateway、cordis-api/(6)、cookbook/(5)、subsystems/(46)
25
- │ └── en/ 英文站镜像(结构与中文站一致)
26
- ├── extra/ 仓库内未发布到站点的补充文档(468 篇):glossary、defensive-patterns、
27
- │ module-graph、testing、postmortem/、i18n/、cookbook 与 subsystems 扩展、
28
- │ upgrade-guide/(各版本升级指南)、persistence-changes/(持久化格式变更)
29
- ├── meta/
30
- │ ├── topics.md ★ 主题导航:任务场景 → 要读的文件(先用这个)
31
- │ ├── search-index.json 全量检索索引(663 文件:path/url/title/字符数)
32
- │ ├── source.json 来源信息(commit/时间/统计)
33
- │ └── site-pages.txt 线上站点页面清单
34
- ├── INDEX.md 全部 站点 URL ↔ 本地文件 对照
35
- └── README.md 知识库总览与更新方法
36
- ```
37
-
38
- ## 2. 使用流程(从快到慢,优先用工具)
39
-
40
- 1. **dsh_kb_search 工具检索(首选)**:调用本插件的 `dsh_kb_search` 工具,一次拿到命中文件路径 + 行号 + 上下文片段。参数:`query`(关键词,空白分词;空或 `"topics"` 返回主题导航)、`scope`(`api` = 只搜 API 签名/目录类文档,查 `ctx.*` API 用)、`lang`(默认 zh)、`maxResults`。输出自带**版本横幅**(宿主 dsh 版本 vs 知识库 master 快照 + 对应 upgrade-guide 路径),横幅提示版本差异时务必读指南。
41
- 2. **dsh_kb_read 工具按行号窗口读原文(1.8.0 起,次选)**:拿到 path + 命中行号后用 `dsh_kb_read`(参数 `path` / `offset` / `limit`)带行号窗口读上下文,输出自动提示中英对照路径与续读位置;替代通用 read 工具,防大文件整读。
42
- 3. **文件工具兜底**(工具不可用时):读 `{{KB_ROOT}}/meta/topics.md` 按主题找文件;或对 `{{KB_ROOT}}/meta/search-index.json` / `{{KB_ROOT}}/site/` 用 grep 定位。
43
- 4. **按 URL 反查**:已知线上页面 URL 时,在 `{{KB_ROOT}}/INDEX.md` 查对应本地文件。
44
-
45
- ## 3. 阅读原则
46
-
47
- - **中文优先**:默认读 `site/` 下中文文件;需要英文原文时读 `site/en/` 对应路径。
48
- - **大文件局部读**:`reference/config-catalog.md`、`reference/tool-catalog.md`、`extra/module-graph.md`、`reference/subsystems/session.md` 等超过 100KB,先用 grep 定位再 read 局部,禁止整读。
49
- - **代码示例可直接引用**:文档中的 `apply(ctx)` 插件骨架、`ctx.tools.register`、`inject` 声明等可直接用于新代码;但需注意知识库是 commit 快照,若与当前安装版本 API 不一致,以实际安装包为准。
50
- - **常见检索关键词**:`ctx.effect`、`ctx.on`、`ctx.tools.register`、`inject`、`Service Definition`、`cordis.yml`、`SessionEventMap`、`Branded`。
51
-
52
- ## 4. 插件开发高频路径速查
53
-
54
- | 任务 | 先读 |
55
- | --- | --- |
56
- | 写第一个插件 | `site/develop/basic/index.md` |
57
- | 开发 Tool | `site/develop/basic/tool.md` + `site/reference/cookbook/adding-a-tool.md` |
58
- | 插件配置 | `site/develop/basic/config.md` |
59
- | 服务与依赖 | `site/develop/framework/service.md` |
60
- | 事件监听 | `site/develop/framework/events.md` |
61
- | 打包发布 | `site/develop/basic/publish.md` |
62
- | LLM 适配器 | `site/develop/practice/llm-adapter.md` |
63
- | 能力扩展 | `site/develop/practice/index.md` + `site/reference/capability-seams.md` |
64
- | 动态装配 Cordis | `site/develop/practice/dynamic-cordis.md` |
65
- | API Gateway / Remote 方法 | `site/reference/api-gateway.md` |
66
- | 子系统能力 | `site/reference/subsystems/index.md` → 对应子系统页 |
67
-
68
- ## 5. 更新知识库
69
-
70
- 见 `kb/README.md` 的更新方法(重新克隆 `deepseek-ai/deepseek-harness` 并运行站点投影器)。
1
+ ---
2
+ name: dsh-plugin-dev-kb
3
+ description: DeepSeek Harness 官方文档知识库的使用指南:知识库位置与结构、按任务场景的阅读路径、检索策略。写 dsh 插件 / Tool / 配置 / 服务 / 事件 / 打包发布 / LLM 适配器时先加载本技能定位文档。注意:本技能仅限 dsh(DeepSeek Harness)插件开发;写 NoneBot 插件时请加载 nonebot-plugin-dev-kb,勿用本技能。
4
+ whenToUse: 开发 dsh 插件、查询 dsh 能力与 API、写 Tool、配置 cordis.yml、扩展 Harness 时
5
+ ---
6
+ # dsh 插件开发知识库使用指南(dsh-plugin-dev-kb)
7
+
8
+ 本插件内置 DeepSeek Harness 官方文档的完整镜像,供插件开发时快速定位与检索。
9
+
10
+ ## 0. 知识库位置
11
+
12
+ - **知识库根**:`{{KB_ROOT}}`(插件挂载时由 lib/index.js 自动替换为插件内 kb/ 目录的实际绝对路径,可直接 read/glob/grep;正斜杠路径,跨机器/安装位置始终有效)
13
+ - 数据来源:官方文档站点(VitePress)的仓库原始 Markdown,链接已按站点路由重写,与线上站点逐字一致(见 `kb/meta/source.json` 的 commit)
14
+
15
+ ## 1. 目录结构
16
+
17
+ ```
18
+ kb/
19
+ ├── site/ 线上站点完整镜像(中英双语 194 页,优先读这里)
20
+ │ ├── guide/ 入门:quickstart / providers / python-sdk / github-review / schedule / mcp-memory / network-proxy / public-deployments
21
+ │ ├── develop/ basic(第一个插件/tool/config/publish)、framework(生命周期/服务/事件)、
22
+ │ │ practice(能力分层/LLM适配器/动态装配)、cordis-tutorial(7章)
23
+ │ ├── reference/ index(架构)、cordis-primer、capability-seams、agent-lifecycle、
24
+ │ │ config-catalog、tool-catalog、api-gateway、cordis-api/(6)、cookbook/(5)、subsystems/(46+,含 office-kit)、
25
+ │ │ guide/(含 desktop-uninstall-cleanup)
26
+ │ └── en/ 英文站镜像(结构与中文站一致)
27
+ ├── extra/ 仓库内未发布到站点的补充文档(554 篇):glossary、defensive-patterns、
28
+ │ module-graph、testing、postmortem/、i18n/、cookbook 与 subsystems 扩展、
29
+ │ upgrade-guide/(各版本升级指南)、persistence-changes/(持久化格式变更)
30
+ ├── meta/
31
+ │ ├── topics.md ★ 主题导航:任务场景 → 要读的文件(先用这个)
32
+ │ ├── search-index.json 全量检索索引(751 文件:path/url/title/字符数)
33
+ │ ├── source.json 来源信息(commit/时间/统计)
34
+ │ └── site-pages.txt 线上站点页面清单
35
+ ├── INDEX.md 全部 站点 URL ↔ 本地文件 对照
36
+ └── README.md 知识库总览与更新方法
37
+ ```
38
+
39
+ ## 2. 使用流程(从快到慢,优先用工具)
40
+
41
+ 1. **dsh_kb_search 工具检索(首选)**:调用本插件的 `dsh_kb_search` 工具,一次拿到命中文件路径 + 行号 + 上下文片段。参数:`query`(关键词,空白分词;空或 `"topics"` 返回主题导航)、`scope`(`api` = 只搜 API 签名/目录类文档,查 `ctx.*` API 用)、`lang`(默认 zh)、`maxResults`。输出自带**版本横幅**(宿主 dsh 版本 vs 知识库 master 快照 + 对应 upgrade-guide 路径),横幅提示版本差异时务必读指南。
42
+ 2. **dsh_kb_read 工具按行号窗口读原文(1.8.0 起,次选)**:拿到 path + 命中行号后用 `dsh_kb_read`(参数 `path` / `offset` / `limit`)带行号窗口读上下文,输出自动提示中英对照路径与续读位置;替代通用 read 工具,防大文件整读。
43
+ 3. **文件工具兜底**(工具不可用时):读 `{{KB_ROOT}}/meta/topics.md` 按主题找文件;或对 `{{KB_ROOT}}/meta/search-index.json` / `{{KB_ROOT}}/site/` 用 grep 定位。
44
+ 4. **按 URL 反查**:已知线上页面 URL 时,在 `{{KB_ROOT}}/INDEX.md` 查对应本地文件。
45
+
46
+ ## 3. 阅读原则
47
+
48
+ - **中文优先**:默认读 `site/` 下中文文件;需要英文原文时读 `site/en/` 对应路径。
49
+ - **大文件局部读**:`reference/config-catalog.md`、`reference/tool-catalog.md`、`extra/module-graph.md`、`reference/subsystems/session.md` 等超过 100KB,先用 grep 定位再 read 局部,禁止整读。
50
+ - **代码示例可直接引用**:文档中的 `apply(ctx)` 插件骨架、`ctx.tools.register`、`inject` 声明等可直接用于新代码;但需注意知识库是 commit 快照,若与当前安装版本 API 不一致,以实际安装包为准。
51
+ - **常见检索关键词**:`ctx.effect`、`ctx.on`、`ctx.tools.register`、`inject`、`Service Definition`、`cordis.yml`、`SessionEventMap`、`Branded`。
52
+
53
+ ## 4. 插件开发高频路径速查
54
+
55
+ | 任务 | 先读 |
56
+ | --- | --- |
57
+ | 写第一个插件 | `site/develop/basic/index.md` |
58
+ | 开发 Tool | `site/develop/basic/tool.md` + `site/reference/cookbook/adding-a-tool.md` |
59
+ | 插件配置 | `site/develop/basic/config.md` |
60
+ | 服务与依赖 | `site/develop/framework/service.md` |
61
+ | 事件监听 | `site/develop/framework/events.md` |
62
+ | 打包发布 | `site/develop/basic/publish.md` |
63
+ | LLM 适配器 | `site/develop/practice/llm-adapter.md` |
64
+ | 能力扩展 | `site/develop/practice/index.md` + `site/reference/capability-seams.md` |
65
+ | 动态装配 Cordis | `site/develop/practice/dynamic-cordis.md` |
66
+ | API Gateway / Remote 方法 | `site/reference/api-gateway.md` |
67
+ | 子系统能力 | `site/reference/subsystems/index.md` → 对应子系统页 |
68
+
69
+ ## 5. 更新知识库
70
+
71
+ 见 `kb/README.md` 的更新方法(重新克隆 `deepseek-ai/deepseek-harness` 并运行站点投影器)。
@@ -1,87 +0,0 @@
1
- # Office to PDF
2
-
3
- English | [中文](office-to-pdf.zh.md)
4
-
5
- The [document package family](../../packages/document/README.md) converts Office files to PDFs on the Node Host. Consumers authorize source reads and own presentation; the shared provider owns conversion, bounded admission, and transient PDF reuse. This subsystem creates no model-facing tool or Session event.
6
-
7
- ## Ownership
8
-
9
- | Owner | Responsibility |
10
- |---|---|
11
- | [office-to-pdf](../../packages/document/office-to-pdf/README.md) | `ctx.officeToPdf`: shared LibreOffice conversion, bounded admission, and PDF caching |
12
- | [Web bundle](../../packages/bundle/web-app/README.md) | One configurable conversion provider shared by Host consumers |
13
- | [Office preview Client](../../packages/client/ui-sidebar-documentpreview/README.md#office-preview) | Office extension selection, PDF reuse, and missing-font notices |
14
-
15
- ## Requests and results
16
-
17
- [`OfficeToPdfRequest`](../../packages/document/office-to-pdf/src/types.ts) contains an already-authorized source key/version, optional stat size, a deferred `read(signal, maxBytes)` callback, foreground/background priority, and a `OfficeExtension`: `doc`, `docx`, `xls`, `xlsx`, `ppt`, or `pptx`. `OfficeToPdf.convert(request, signal?)` returns one complete PDF result. Cancellation follows the caller and provider lifetimes; validation, output, and engine failures reject with a classified `OfficeToPdfError`.
18
-
19
- `OfficeToPdfPriority` is `foreground` for requested preview/QA and `background` for speculation. `OfficeSourceKey` brands the caller-owned authorized source locator. `OfficeToPdfGeneration` brands a provider lifetime, and `OfficeToPdfKey` brands its content identity; neither opaque value is parsed by consumers.
20
-
21
- | Result field | Meaning |
22
- |---|---|
23
- | `pdf` | Caller-owned `Uint8Array` containing the complete PDF |
24
- | `missingFonts` | Requested document font families unavailable to this conversion |
25
- | `cacheKey` | Opaque converter generation plus extension/source-content identity |
26
- | `generation` | Provider lifetime; replacement invalidates cached PDF reuse |
27
-
28
- The provider admits the deferred read before allocating source bytes, shares conversions by content identity, and removes its private scratch directory before returning. Returned PDF bytes remain valid after provider disposal. Source and PDF bytes do not enter Session storage. Consumers can use [Workspace Files](../../packages/api/workspace-files/README.md) for authorized bounded reads.
29
-
30
- ## Preview reads
31
-
32
- `RenderedDocumentBytes` carries workspace file metadata, native PDF `data`, `missingFonts`, and `generation`; the original source identity accompanies the converted PDF.
33
-
34
- The `officeToPdf.render` Remote method checks source authorization and versions through the Session's [Workspace Files](../../packages/api/workspace-files/README.md) service. After conversion admission, `fs.readBytes` supplies raw input within the reserved byte capacity; Office input limits govern this read. The binary Remote projects the PDF into a multipart attachment and restores an `ArrayBuffer`-backed `Uint8Array` on the Client. Source access failures pass through; size and engine failures expose a classified reason without diagnostics. Conversion does not activate an Agent or append events.
35
-
36
- The `api/remotes` assembly mounts the conversion service's generated Remote descriptor. The shared Document Preview package registers Office formats with complete-byte loading and its existing PDF.js Worker. Each preview read rechecks renderer generation, source authorization, and version before sharing an in-flight conversion or cached PDF. Connection resets and plugin disposal cancel requests and clear cached bytes. Missing services show localized configuration guidance.
37
-
38
- ## Engine selection and limits
39
-
40
- The external [`@deepseek-ai/libreoffice-kit`](https://github.com/deepseek-ai/dsh-libreoffice-kit) Node API selects its precompiled engines. The kit has an independent version and release workflow, defined by the [release ownership decision](../../.agents/notes/implemented/architecture/2026-09-14-independent-libreoffice-kit.md). Application builds install the published npm packages. Application packaging requires the target’s declared native engine, or Node WASM when the kit declares no native engine for that target. The [platform engine reference](../../packages/document/office-to-pdf/README.md) defines installation and packaging. Invalid metadata, missing required assets, and conversion errors reject without switching engines. Conversion uses disk input and output paths on the Host, with no browser conversion engine or font RPC.
41
-
42
- The [Host provider configuration](../../packages/document/office-to-pdf/README.md#use-this-package) owns concurrency, deadlines, input/output limits, archive limits, image resolution, and font access. Native/WASM implementation and asset distribution belong to the kit workspace. System LibreOffice discovery, runtime engine downloads, persistent PDF caching, and model-facing rendering are outside this provider.
43
-
44
- <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
45
-
46
- <a id="cordis-surface"></a>
47
-
48
- ## Cordis API
49
-
50
- 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`) — the language sides differ only in locale-specific paired document paths. 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).
51
-
52
- <a id="ctxofficetopdf--officetopdf"></a>
53
-
54
- ### `ctx.officeToPdf` — `OfficeToPdf`
55
-
56
- A provider lifetime owns all converters, queued calls, and temporary files.
57
-
58
- ```ts cordis-catalog
59
- /**
60
- * Convert Office bytes without modifying the source or writing Session events.
61
- * @param request - authorized metadata and deferred bounded source read.
62
- * @param signal - caller cancellation; provider disposal also stops active work.
63
- * @returns caller-owned PDF bytes after conversion and scratch cleanup settle; canceled readers reject independently.
64
- * @throws {OfficeToPdfError} Invalid input, unusable output, or engine failure; cancellation rejects with its reason.
65
- */
66
- convert(request: OfficeToPdfRequest, signal?: AbortSignal): Promise<OfficeToPdfResult>
67
-
68
- /**
69
- * Read and convert one Office file using the Session's ordinary filesystem authorization.
70
- * @param workspaceFileScope - Session header lookup shared with workspaceFiles.
71
- * @param path - absolute or workspace-relative Office path.
72
- * @param priority - foreground preview or speculative background work.
73
- * @param signal - Remote cancellation; disposal also cancels outstanding reads and conversions.
74
- * @returns complete PDF bytes with original source identity and missing font families.
75
- */
76
- @Remote async render( workspaceFileScope: WorkspaceFileScope, path: string, priority: OfficeToPdfPriority, signal: AbortSignal, ): Promise<RenderedDocumentBytes>
77
-
78
- /**
79
- * Read the current rendering generation before reusing a Client PDF.
80
- * @param signal - Remote caller cancellation.
81
- * @returns provider lifetime, replaced with rendering, font, or engine configuration.
82
- */
83
- @Remote('generation') getGeneration(signal: AbortSignal): OfficeToPdfGeneration
84
- ```
85
-
86
- Source: [`packages/document/office-to-pdf/src/index.ts`](../../packages/document/office-to-pdf/src/index.ts)
87
- <!-- END GENERATED cordis-surface -->
@@ -1,87 +0,0 @@
1
- # Office 转 PDF
2
-
3
- [English](office-to-pdf.md) | 中文
4
-
5
- [document 包族](../../packages/document/README.zh.md) 在 Node 宿主上将 Office 文件转换为 PDF。消费者负责源文件读取授权与展示;共享提供方负责转换、有界准入和临时 PDF 复用。此子系统不创建面向模型的工具或 Session 事件。
6
-
7
- ## 所有权
8
-
9
- | 所有者 | 职责 |
10
- |---|---|
11
- | [office-to-pdf](../../packages/document/office-to-pdf/README.zh.md) | `ctx.officeToPdf`:共享 LibreOffice 转换、有界准入和 PDF 缓存 |
12
- | [Web bundle](../../packages/bundle/web-app/README.zh.md) | 由宿主消费者共享的单个可配置转换提供方 |
13
- | [Office 预览 Client](../../packages/client/ui-sidebar-documentpreview/README.zh.md#office-preview) | Office 扩展名选择、PDF 复用和缺失字体提示 |
14
-
15
- ## 请求和结果
16
-
17
- [`OfficeToPdfRequest`](../../packages/document/office-to-pdf/src/types.ts)包含已授权的源键与版本、可选 stat 大小、延迟的 `read(signal, maxBytes)` 回调、前台或后台优先级以及 `OfficeExtension`:`doc`、`docx`、`xls`、`xlsx`、`ppt` 或 `pptx`。`OfficeToPdf.convert(request, signal?)` 返回一个完整 PDF 结果。取消遵循调用方和提供方生命周期;校验、输出和引擎失败以分类的 `OfficeToPdfError` 拒绝。
18
-
19
- `OfficeToPdfPriority` 对请求的预览或 QA 使用 `foreground`,对推测工作使用 `background`。`OfficeSourceKey` 为调用方拥有的已授权源定位符增加品牌类型。`OfficeToPdfGeneration` 表示提供方生命周期,`OfficeToPdfKey` 表示其内容身份;消费者不解析这两种不透明值。
20
-
21
- | 结果字段 | 含义 |
22
- |---|---|
23
- | `pdf` | 调用方拥有的 `Uint8Array`,包含完整 PDF |
24
- | `missingFonts` | 本次转换无法使用的文档请求字体名称 |
25
- | `cacheKey` | 不透明的转换 generation 加扩展名与源内容身份 |
26
- | `generation` | 提供方生命周期;替换后缓存 PDF 不再可复用 |
27
-
28
- 提供方先准入延迟读取,再分配源文件字节;按内容身份共享转换,并在返回前删除私有临时目录。返回的 PDF 字节在提供方释放后仍有效。源文件和 PDF 字节不会进入 Session 存储。消费者可通过[工作区文件](../../packages/api/workspace-files/README.zh.md)执行已授权的有界读取。
29
-
30
- ## 预览读取
31
-
32
- `RenderedDocumentBytes` 携带工作区文件元数据、原生 PDF `data`、`missingFonts` 和 `generation`;转换后的 PDF 附带原始源文件身份。
33
-
34
- `officeToPdf.render` Remote 方法通过 Session 的[工作区文件](../../packages/api/workspace-files/README.zh.md)服务检查源文件授权与版本。取得转换容量后,`fs.readBytes` 在预留字节容量内提供原始输入;该读取受 Office 输入上限约束。二进制 Remote 将 PDF 投影为 multipart 附件,并在 Client 恢复为由 `ArrayBuffer` 支撑的 `Uint8Array`。源访问失败直接传递;大小和引擎失败只暴露分类原因,不含诊断信息。转换不激活 Agent 或追加事件。
35
-
36
- `api/remotes` 挂载转换服务生成的 Remote 描述符。共享文档预览包使用完整字节加载和现有 PDF.js Worker 注册 Office 格式。每次预览读取都会重新检查渲染 generation、源文件授权和版本,再共享进行中的转换或缓存 PDF。连接重置和插件卸载会取消请求并清空缓存字节。缺少服务时显示本地化配置引导。
37
-
38
- ## 引擎选择和限制
39
-
40
- 外部 [`@deepseek-ai/libreoffice-kit`](https://github.com/deepseek-ai/dsh-libreoffice-kit) Node API 选择其预编译引擎。kit 独立维护版本和发布流程,具体归属由[发布归属决策](../../.agents/notes/implemented/architecture/2026-09-14-independent-libreoffice-kit.zh.md)定义。应用构建时安装已发布的 npm 包。应用打包要求目标已声明的原生引擎;kit 未为该目标声明原生引擎时使用 Node WASM。[平台引擎参考](../../packages/document/office-to-pdf/README.zh.md)定义安装和打包规则。元数据无效、必需资源缺失和转换错误都会拒绝请求,不切换引擎。转换在 Host 使用磁盘输入输出路径,不使用浏览器转换引擎或字体 RPC。
41
-
42
- [Host 提供方配置](../../packages/document/office-to-pdf/README.zh.md#use-this-package)负责并发、期限、输入输出上限、归档上限、图像分辨率和字体访问。原生/WASM 实现和资产分发属于 kit 工作区。系统 LibreOffice 探测、运行时引擎下载、持久 PDF 缓存和面向模型的渲染不属于此提供方。
43
-
44
- <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
45
-
46
- <a id="cordis-surface"></a>
47
-
48
- ## Cordis API
49
-
50
- 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`) — the language sides differ only in locale-specific paired document paths. Signature blocks use a `ts cordis-catalog` fence and keep the original source JSDoc; dispatch modes are defined in the [primer](../cordis-primer.zh.md#dispatch-modes), and the framework-inherited `ctx` API lives in [cordis-api/inherited.md](../cordis-api/inherited.md).
51
-
52
- <a id="ctxofficetopdf--officetopdf"></a>
53
-
54
- ### `ctx.officeToPdf` — `OfficeToPdf`
55
-
56
- A provider lifetime owns all converters, queued calls, and temporary files.
57
-
58
- ```ts cordis-catalog
59
- /**
60
- * Convert Office bytes without modifying the source or writing Session events.
61
- * @param request - authorized metadata and deferred bounded source read.
62
- * @param signal - caller cancellation; provider disposal also stops active work.
63
- * @returns caller-owned PDF bytes after conversion and scratch cleanup settle; canceled readers reject independently.
64
- * @throws {OfficeToPdfError} Invalid input, unusable output, or engine failure; cancellation rejects with its reason.
65
- */
66
- convert(request: OfficeToPdfRequest, signal?: AbortSignal): Promise<OfficeToPdfResult>
67
-
68
- /**
69
- * Read and convert one Office file using the Session's ordinary filesystem authorization.
70
- * @param workspaceFileScope - Session header lookup shared with workspaceFiles.
71
- * @param path - absolute or workspace-relative Office path.
72
- * @param priority - foreground preview or speculative background work.
73
- * @param signal - Remote cancellation; disposal also cancels outstanding reads and conversions.
74
- * @returns complete PDF bytes with original source identity and missing font families.
75
- */
76
- @Remote async render( workspaceFileScope: WorkspaceFileScope, path: string, priority: OfficeToPdfPriority, signal: AbortSignal, ): Promise<RenderedDocumentBytes>
77
-
78
- /**
79
- * Read the current rendering generation before reusing a Client PDF.
80
- * @param signal - Remote caller cancellation.
81
- * @returns provider lifetime, replaced with rendering, font, or engine configuration.
82
- */
83
- @Remote('generation') getGeneration(signal: AbortSignal): OfficeToPdfGeneration
84
- ```
85
-
86
- Source: [`packages/document/office-to-pdf/src/index.ts`](../../packages/document/office-to-pdf/src/index.ts)
87
- <!-- END GENERATED cordis-surface -->