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
@@ -1,206 +1,230 @@
1
- ---
2
- editSource: "docs/subsystems/lsp.md"
3
- rawMarkdownPath: "en/reference/subsystems/lsp.md"
4
- outline: [2,3]
5
- ---
6
-
7
- # LSP navigation
8
-
9
- The LSP seam — a [capability seam](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/glossary.md#capability-seam) exposing semantic code navigation on one `ctx.lsp` service, split across packages: Service Definition ([dsh-lsp](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/lsp/lsp), `ctx.lsp` + the provider registry), a generic Service Provider ([dsh-lsp-stdio](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/lsp/lsp-stdio), a configured stdio language-server host), and Consumer ([dsh-tool-lsp](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/lsp/tool-lsp), the `lsp` tool schema). LSP is **one optional capability**, not part of the agent-loop spine — so its vocabulary lives here, not in [core.md](./core.md). A provider swap does not change how the model asks for navigation.
10
-
11
- Source: [`packages/lsp/lsp/src/types.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/lsp/lsp/src/types.ts)
12
-
13
- ## Operations and coordinates
14
-
15
- The seam and model expose exactly four semantic queries; the union is closed, so adding one is a compile-enforced change across the seam, providers, and the tool. Positions and ranges are zero-based UTF-16, matching the protocol; the model-facing tool owns the one-based cursor convention and converts on the way in and out.
16
-
17
- ```ts type-equiv
18
- /**
19
- * The four semantic queries the seam and model expose. A closed union: adding an operation is a
20
- * compile-enforced change across the seam, providers, and the tool. Symbols and call hierarchy are
21
- * not operations here; they need different schemas.
22
- */
23
- type LspOperation = 'goToDefinition' | 'findReferences' | 'goToImplementation' | 'hover'
24
- ```
25
-
26
- ```ts type-equiv
27
- /** A zero-based UTF-16 cursor coordinate, matching the LSP wire convention. */
28
- interface LspPosition {
29
- /** Zero-based line. */
30
- readonly line: number
31
- /** Zero-based UTF-16 code-unit offset within the line. */
32
- readonly character: number
33
- }
34
- ```
35
-
36
- ```ts type-equiv
37
- /** A zero-based UTF-16 half-open range `[start, end)`. */
38
- interface LspRange {
39
- readonly start: LspPosition
40
- readonly end: LspPosition
41
- }
42
- ```
43
-
44
- ## Request
45
-
46
- Every field is required: `workspaceRoot` is caller-supplied, `languageId` comes from the provider's registration (not the request), and consumers own timeouts and result limits — so no field needs implementation defaulting and there is no `resolve()` step. The provider receives the caller's request plus the derived `languageId`, which only synchronizes the transient document and never participates in selection.
47
-
48
- ```ts type-equiv
49
- /**
50
- * A caller's normalized query. Every field is required: `workspaceRoot` is caller-supplied,
51
- * `languageId` comes from the provider registration (not here), and consumers own timeouts and
52
- * result limits — so no field needs implementation defaulting and there is no `resolve()` step.
53
- */
54
- interface LspQueryRequest {
55
- /** Which semantic query to run. */
56
- readonly operation: LspOperation
57
- /** The source file to query (relative to `workspaceRoot` or absolute; the provider canonicalizes). */
58
- readonly filePath: string
59
- /** The zero-based UTF-16 cursor position to query at. */
60
- readonly position: LspPosition
61
- /** The workspace root the provider resolves against and indexes; required, never defaulted. */
62
- readonly workspaceRoot: string
63
- }
64
- ```
65
-
66
- ```ts type-equiv
67
- /**
68
- * A request as a provider receives it: the caller's {@link LspQueryRequest} plus the `languageId`
69
- * the seam derived from the provider's extension mapping. The language id only synchronizes the
70
- * transient document; it does not participate in selection.
71
- */
72
- interface LspProviderQuery extends LspQueryRequest {
73
- /** The LSP language id for `filePath`, from this provider's extension mapping. */
74
- readonly languageId: string
75
- }
76
- ```
77
-
78
- ## Result
79
-
80
- A CLOSED discriminated union: navigation operations normalize to `locations`, `hover` to content or `null`. Consumers `switch` on `kind` to exhaustiveness so a new arm breaks compilation until handled. `findReferences` always includes declarations — the provider enforces this internally, so callers get no flag. The `locations` variant carries `resolvedWorkspaceUri`, the provider's canonical workspace `file:` URI. A caller relativizing location URIs uses that coordinate rather than applying host-platform path rules to the possibly-symlinked request root.
81
-
82
- ```ts type-equiv
83
- /** One resolved location: a document URI and the range within it. */
84
- interface LspLocation {
85
- /** The target document URI (`file:` or otherwise), verbatim from the server. */
86
- readonly uri: string
87
- /** The range within the target document. */
88
- readonly range: LspRange
89
- }
90
- ```
91
-
92
- ```ts type-equiv
93
- /** Normalized hover content, or `null` for no hover at the position. */
94
- interface LspHover {
95
- /** The normalized hover text (markdown or plaintext, provider-joined). */
96
- readonly contents: string
97
- /** The range the hover applies to, when the server supplied one. */
98
- readonly range?: LspRange
99
- }
100
- ```
101
-
102
- ```ts type-equiv
103
- /**
104
- * The closed result union. Navigation operations (`goToDefinition`, `findReferences`,
105
- * `goToImplementation`) normalize to `locations`; `hover` normalizes to content or `null`.
106
- * Consumers `switch` on `kind` to exhaustiveness so a new arm breaks compilation until handled.
107
- *
108
- * The `locations` variant carries `resolvedWorkspaceUri`: the provider's canonical `file:` URI for
109
- * the request's workspace root. A caller that relativizes location URIs MUST use this, not parse the
110
- * request's possibly symlinked process path with host-platform rules; the execution platform may
111
- * differ from the caller's.
112
- */
113
- type LspQueryResult =
114
- | { readonly kind: 'locations'; readonly locations: readonly LspLocation[]; readonly resolvedWorkspaceUri: string }
115
- | { readonly kind: 'hover'; readonly hover: LspHover | null }
116
- ```
117
-
118
- ## Provider and service
119
-
120
- A provider owns a stable branded `id` and an exclusive lowercase leading-dot extension map. `registerProvider` reserves the id and every extension atomically — an invalid or conflicting registration publishes nothing — and its disposer releases all reservations. Selection is per query and order-independent; no match throws `LspError` `LSP_UNAVAILABLE`. The seam exposes no protocol types, process/document controls, or generic JSON-RPC escape hatch.
121
-
122
- ```ts type-equiv
123
- /**
124
- * A language-server backend registered on `ctx.lsp`. Each provider owns a stable {@link
125
- * LspProviderId} and an extension-to-language-id map (lowercase, leading-dot keys).
126
- * `findReferences` always includes declarations — the provider enforces this internally; callers
127
- * get no flag.
128
- */
129
- interface LspProvider {
130
- /** Stable provider identity, reserved atomically with the extension mappings. */
131
- readonly id: LspProviderId
132
- /** Lowercase leading-dot extension → LSP language id (e.g. `{ '.ts': 'typescript' }`). */
133
- readonly extensionToLanguage: Readonly<Record<string, string>>
134
- /**
135
- * Run one query. The seam has already selected this provider and derived `languageId`.
136
- * @param request - the resolved provider query (caller request + derived language id).
137
- * @param signal - optional cancellation; the provider stops its own work when it aborts.
138
- * @returns the normalized, closed-union result.
139
- */
140
- query(request: LspProviderQuery, signal?: AbortSignal): Promise<LspQueryResult>
141
- }
142
- ```
143
-
144
- ```ts type-equiv
145
- /**
146
- * The LSP capability seam (`ctx.lsp`). Owns provider registration/selection and normalized query
147
- * execution; exposes exactly the four operations and no protocol escape hatch.
148
- */
149
- interface LspService {
150
- /**
151
- * Register a provider, atomically reserving its id and every normalized extension. Any conflict
152
- * or invalid input publishes nothing and throws `LspError`; the returned disposer releases all
153
- * reservations. Disposed with the calling fiber.
154
- * @param provider - the backend to register.
155
- * @returns a synchronous disposer releasing the id and all extension reservations.
156
- */
157
- registerProvider(provider: LspProvider): () => void
158
- /**
159
- * Select a provider by the file's extension and run one query. Selection is per-query and
160
- * order-independent; no match throws `LspError` `LSP_UNAVAILABLE`.
161
- * @param request - the normalized query.
162
- * @param signal - optional cancellation forwarded to the selected provider.
163
- * @returns the normalized, closed-union result.
164
- */
165
- query(request: LspQueryRequest, signal?: AbortSignal): Promise<LspQueryResult>
166
- }
167
- ```
168
-
169
- `LspProviderId` is the seam's branded id (`Branded<'LspProviderId'>` from [dsh-brand](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/util/brand)); `LspError` extends `HarnessError` with stable codes such as `LSP_INVALID_PROVIDER`, `LSP_CONFLICT`, `LSP_UNAVAILABLE`, `LSP_DISPOSED`, `LSP_UNSUPPORTED_OPERATION`, and `LSP_MALFORMED_RESPONSE`, which callers route on instead of parsing `message`.
170
-
171
- <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
172
-
173
- <a id="cordis-surface"></a>
174
-
175
- ## Cordis API
176
-
177
- 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).
178
-
179
- <a id="ctxlsp--lspservice"></a>
180
-
181
- ### `ctx.lsp` — `LspService`
182
-
183
- The LSP capability seam (`ctx.lsp`). Owns provider registration/selection and normalized query execution; exposes exactly the four operations and no protocol escape hatch.
184
-
185
- ```ts cordis-catalog
186
- /**
187
- * Register a provider, atomically reserving its id and every normalized extension. Any conflict
188
- * or invalid input publishes nothing and throws `LspError`; the returned disposer releases all
189
- * reservations. Disposed with the calling fiber.
190
- * @param provider - the backend to register.
191
- * @returns a synchronous disposer releasing the id and all extension reservations.
192
- */
193
- registerProvider(provider: LspProvider): () => void
194
-
195
- /**
196
- * Select a provider by the file's extension and run one query. Selection is per-query and
197
- * order-independent; no match throws `LspError` `LSP_UNAVAILABLE`.
198
- * @param request - the normalized query.
199
- * @param signal - optional cancellation forwarded to the selected provider.
200
- * @returns the normalized, closed-union result.
201
- */
202
- query(request: LspQueryRequest, signal?: AbortSignal): Promise<LspQueryResult>
203
- ```
204
-
205
- Source: [`packages/lsp/lsp/src/types.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/lsp/lsp/src/types.ts)
206
- <!-- END GENERATED cordis-surface -->
1
+ ---
2
+ editSource: "docs/subsystems/lsp.md"
3
+ rawMarkdownPath: "en/reference/subsystems/lsp.md"
4
+ outline: [2,3]
5
+ ---
6
+
7
+ # LSP navigation
8
+
9
+ The LSP seam — a [capability seam](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/glossary.md#capability-seam) exposing semantic code navigation on one `ctx.lsp` service, split across packages: Service Definition ([dsh-lsp](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/lsp/lsp), `ctx.lsp` + the provider registry), a generic Service Provider ([dsh-lsp-stdio](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/lsp/lsp-stdio), a configured stdio language-server host), and Consumer ([dsh-tool-lsp](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/lsp/tool-lsp), the `lsp` tool schema). LSP is **one optional capability**, not part of the agent-loop spine — so its vocabulary lives here, not in [core.md](./core.md). A provider swap does not change how the model asks for navigation.
10
+
11
+ Source: [`packages/lsp/lsp/src/types.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/lsp/lsp/src/types.ts)
12
+
13
+ ## Operations and coordinates
14
+
15
+ The seam and model expose exactly four semantic queries; the union is closed, so adding one is a compile-enforced change across the seam, providers, and the tool. Positions and ranges are zero-based UTF-16, matching the protocol; the model-facing tool owns the one-based cursor convention and converts on the way in and out.
16
+
17
+ ```ts type-equiv
18
+ /**
19
+ * The four semantic queries the seam and model expose. A closed union: adding an operation is a
20
+ * compile-enforced change across the seam, providers, and the tool. Symbols and call hierarchy are
21
+ * not operations here; they need different schemas.
22
+ */
23
+ type LspOperation = 'goToDefinition' | 'findReferences' | 'goToImplementation' | 'hover'
24
+ ```
25
+
26
+ ```ts type-equiv
27
+ /** A zero-based UTF-16 cursor coordinate, matching the LSP wire convention. */
28
+ interface LspPosition {
29
+ /** Zero-based line. */
30
+ readonly line: number
31
+ /** Zero-based UTF-16 code-unit offset within the line. */
32
+ readonly character: number
33
+ }
34
+ ```
35
+
36
+ ```ts type-equiv
37
+ /** A zero-based UTF-16 half-open range `[start, end)`. */
38
+ interface LspRange {
39
+ readonly start: LspPosition
40
+ readonly end: LspPosition
41
+ }
42
+ ```
43
+
44
+ ## Request
45
+
46
+ Every field is required: `workspaceRoot` is caller-supplied, `languageId` comes from the provider's registration (not the request), and consumers own timeouts and result limits — so no field needs implementation defaulting and there is no `resolve()` step. The provider receives the caller's request plus the derived `languageId`, which only synchronizes the transient document and never participates in selection.
47
+
48
+ ```ts type-equiv
49
+ /**
50
+ * A caller's normalized query. Every field is required: `workspaceRoot` is caller-supplied,
51
+ * `languageId` comes from the provider registration (not here), and consumers own timeouts and
52
+ * result limits — so no field needs implementation defaulting and there is no `resolve()` step.
53
+ */
54
+ interface LspQueryRequest {
55
+ /** Which semantic query to run. */
56
+ readonly operation: LspOperation
57
+ /** The source file to query (relative to `workspaceRoot` or absolute; the provider canonicalizes). */
58
+ readonly filePath: string
59
+ /** The zero-based UTF-16 cursor position to query at. */
60
+ readonly position: LspPosition
61
+ /** The workspace root the provider resolves against and indexes; required, never defaulted. */
62
+ readonly workspaceRoot: string
63
+ }
64
+ ```
65
+
66
+ ```ts type-equiv
67
+ /**
68
+ * A request as a provider receives it: the caller's {@link LspQueryRequest} plus the `languageId`
69
+ * the seam derived from the provider's extension mapping. The language id only synchronizes the
70
+ * transient document; it does not participate in selection.
71
+ */
72
+ interface LspProviderQuery extends LspQueryRequest {
73
+ /** The LSP language id for `filePath`, from this provider's extension mapping. */
74
+ readonly languageId: string
75
+ }
76
+ ```
77
+
78
+ ## Result
79
+
80
+ A CLOSED discriminated union: navigation operations normalize to `locations`, `hover` to content or `null`. Consumers `switch` on `kind` to exhaustiveness so a new arm breaks compilation until handled. `findReferences` always includes declarations — the provider enforces this internally, so callers get no flag. The `locations` variant carries `resolvedWorkspaceUri`, the provider's canonical workspace `file:` URI. A caller relativizing location URIs uses that coordinate rather than applying host-platform path rules to the possibly-symlinked request root.
81
+
82
+ ```ts type-equiv
83
+ /** One resolved location: a document URI and the range within it. */
84
+ interface LspLocation {
85
+ /** The target document URI (`file:` or otherwise), verbatim from the server. */
86
+ readonly uri: string
87
+ /** The range within the target document. */
88
+ readonly range: LspRange
89
+ }
90
+ ```
91
+
92
+ ```ts type-equiv
93
+ /** Normalized hover content, or `null` for no hover at the position. */
94
+ interface LspHover {
95
+ /** The normalized hover text (markdown or plaintext, provider-joined). */
96
+ readonly contents: string
97
+ /** The range the hover applies to, when the server supplied one. */
98
+ readonly range?: LspRange
99
+ }
100
+ ```
101
+
102
+ ```ts type-equiv
103
+ /**
104
+ * The closed result union. Navigation operations (`goToDefinition`, `findReferences`,
105
+ * `goToImplementation`) normalize to `locations`; `hover` normalizes to content or `null`.
106
+ * Consumers `switch` on `kind` to exhaustiveness so a new arm breaks compilation until handled.
107
+ *
108
+ * The `locations` variant carries `resolvedWorkspaceUri`: the provider's canonical `file:` URI for
109
+ * the request's workspace root. A caller that relativizes location URIs MUST use this, not parse the
110
+ * request's possibly symlinked process path with host-platform rules; the execution platform may
111
+ * differ from the caller's.
112
+ */
113
+ type LspQueryResult =
114
+ | { readonly kind: 'locations'; readonly locations: readonly LspLocation[]; readonly resolvedWorkspaceUri: string }
115
+ | { readonly kind: 'hover'; readonly hover: LspHover | null }
116
+ ```
117
+
118
+ ## Provider and service
119
+
120
+ A provider owns a stable branded `id` and an exclusive lowercase leading-dot extension map. `registerProvider` reserves the id and every extension atomically — an invalid or conflicting registration publishes nothing — and its disposer releases all reservations. Selection is per query and order-independent; no match throws `LspError` `LSP_UNAVAILABLE`. The seam exposes no protocol types, process/document controls, or generic JSON-RPC escape hatch.
121
+
122
+ ```ts type-equiv
123
+ /**
124
+ * A language-server backend registered on `ctx.lsp`. Each provider owns a stable {@link
125
+ * LspProviderId} and an extension-to-language-id map (lowercase, leading-dot keys).
126
+ * `findReferences` always includes declarations — the provider enforces this internally; callers
127
+ * get no flag.
128
+ */
129
+ interface LspProvider {
130
+ /** Stable provider identity, reserved atomically with the extension mappings. */
131
+ readonly id: LspProviderId
132
+ /** Lowercase leading-dot extension → LSP language id (e.g. `{ '.ts': 'typescript' }`). */
133
+ readonly extensionToLanguage: Readonly<Record<string, string>>
134
+ /**
135
+ * Run one query. The seam has already selected this provider and derived `languageId`.
136
+ * @param request - the resolved provider query (caller request + derived language id).
137
+ * @param signal - optional cancellation; the provider stops its own work when it aborts.
138
+ * @returns the normalized, closed-union result.
139
+ */
140
+ query(request: LspProviderQuery, signal?: AbortSignal): Promise<LspQueryResult>
141
+ }
142
+ ```
143
+
144
+ ```ts type-equiv
145
+ /**
146
+ * The LSP capability seam (`ctx.lsp`). Owns provider registration/selection and normalized query
147
+ * execution; exposes exactly the four operations and no protocol escape hatch.
148
+ */
149
+ interface LspService {
150
+ /**
151
+ * Register a provider, atomically reserving its id and every normalized extension. Any conflict
152
+ * or invalid input publishes nothing and throws `LspError`; the returned disposer releases all
153
+ * reservations. Disposed with the calling fiber.
154
+ * @param provider - the backend to register.
155
+ * @returns a synchronous disposer releasing the id and all extension reservations.
156
+ */
157
+ registerProvider(provider: LspProvider): () => void
158
+ /**
159
+ * Select a provider by the file's extension and run one query. Selection is per-query and
160
+ * order-independent; no match throws `LspError` `LSP_UNAVAILABLE`.
161
+ * @param request - the normalized query.
162
+ * @param signal - optional cancellation forwarded to the selected provider.
163
+ * @returns the normalized, closed-union result.
164
+ */
165
+ query(request: LspQueryRequest, signal?: AbortSignal): Promise<LspQueryResult>
166
+ }
167
+ ```
168
+
169
+ `LspProviderId` is the seam's branded id (`Branded<'LspProviderId'>` from [dsh-brand](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/util/brand)); `LspError` extends `HarnessError` with the stable codes listed under [Failures](#failures), which callers route on instead of parsing `message`.
170
+
171
+ <a id="failures"></a>
172
+ ## Failures
173
+
174
+ Every expected failure of an `lsp` tool call is a `HarnessError` whose `name` and `code` the tool result keeps in `error.info`. `LspError` sets `name` to `LspError`; its `code` stays open because providers and consumers add codes, so consumers tolerate codes they do not know. Invalid tool arguments fail as `ToolArgsError` `INVALID_ARGS`, and caller cancellation as `AbortError`. Workspace and source reads keep the filesystem provider's `FsError` code, such as `FS_NOT_FOUND`, `FS_NOT_REGULAR_FILE`, or `FS_NOT_TEXT`, and prefix the LSP operand to its message; the stdio provider adds `FS_NOT_DIRECTORY` for a non-directory workspace and `FS_TOO_LARGE` for a source over `maxDocumentBytes`. A coded query failure whose server teardown also fails keeps the query failure's `name` and `code` and appends the teardown failure to its message; a query failure without a code, such as a cancellation, surfaces with the teardown failure as an `AggregateError` without `error.info`.
175
+
176
+ | Code | Raised by | Meaning | Consumer action |
177
+ |---|---|---|---|
178
+ | `LSP_INVALID_PROVIDER` | Seam | A registration has an empty id or language id, no extensions, or an invalid extension | Fix the registration |
179
+ | `LSP_CONFLICT` | Seam | The provider id or an extension is already registered | Remove the duplicate registration |
180
+ | `LSP_UNAVAILABLE` | Seam | No provider handles the file's extension | Query a supported file or add a provider |
181
+ | `LSP_WORKSPACE_REQUIRED` | `lsp` tool | The call has no Agent Session workspace | Call the tool from an Agent Session |
182
+ | `LSP_DISPOSED` | Provider | The provider or its server instance was disposed | Retry after the provider is mounted again |
183
+ | `LSP_UNSUPPORTED_OPERATION` | Provider | The server lacks the operation or transient open/close synchronization | Choose another operation or server |
184
+ | `LSP_MALFORMED_RESPONSE` | Provider | The server's `initialize` or query result violates the protocol | Report the server defect |
185
+ | `LSP_FILE_OUTSIDE_WORKSPACE` | Stdio provider | The source resolves outside the canonical workspace | Query a file inside the workspace |
186
+ | `LSP_UNSUPPORTED_ENCODING` | Stdio provider | The server negotiated a position encoding other than UTF-16 | Use a server that supports UTF-16 |
187
+ | `LSP_SPAWN_FAILED` | Stdio provider | The subprocess provider failed to launch or run the server; a provider `HarnessError` keeps its own `name` and `code` instead | Fix the server command or installation |
188
+ | `LSP_SERVER_EXITED` | Stdio provider | The server exited or closed its stdin; after an exit, the message carries the retained stderr tail | Retry later; inspect the stderr tail when it repeats |
189
+ | `LSP_PROTOCOL_ERROR` | Stdio provider | The server's output broke base-protocol framing or JSON | Report the server defect |
190
+ | `LSP_MESSAGE_TOO_LARGE` | Stdio provider | A server message exceeded `maxMessageBytes` | Narrow the query or raise `maxMessageBytes` |
191
+ | `LSP_SERVER_ERROR` | Stdio provider | The server answered with a JSON-RPC error; the message carries its numeric code and text | Act on the server's message |
192
+
193
+ After a transport failure (`LSP_SPAWN_FAILED`, `LSP_SERVER_EXITED`, `LSP_PROTOCOL_ERROR`, or `LSP_MESSAGE_TOO_LARGE`), the stdio provider retries the read-only query once on a fresh process when the failed process tears down cleanly.
194
+
195
+ <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
196
+
197
+ <a id="cordis-surface"></a>
198
+
199
+ ## Cordis API
200
+
201
+ 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).
202
+
203
+ <a id="ctxlsp--lspservice"></a>
204
+
205
+ ### `ctx.lsp` — `LspService`
206
+
207
+ The LSP capability seam (`ctx.lsp`). Owns provider registration/selection and normalized query execution; exposes exactly the four operations and no protocol escape hatch.
208
+
209
+ ```ts cordis-catalog
210
+ /**
211
+ * Register a provider, atomically reserving its id and every normalized extension. Any conflict
212
+ * or invalid input publishes nothing and throws `LspError`; the returned disposer releases all
213
+ * reservations. Disposed with the calling fiber.
214
+ * @param provider - the backend to register.
215
+ * @returns a synchronous disposer releasing the id and all extension reservations.
216
+ */
217
+ registerProvider(provider: LspProvider): () => void
218
+
219
+ /**
220
+ * Select a provider by the file's extension and run one query. Selection is per-query and
221
+ * order-independent; no match throws `LspError` `LSP_UNAVAILABLE`.
222
+ * @param request - the normalized query.
223
+ * @param signal - optional cancellation forwarded to the selected provider.
224
+ * @returns the normalized, closed-union result.
225
+ */
226
+ query(request: LspQueryRequest, signal?: AbortSignal): Promise<LspQueryResult>
227
+ ```
228
+
229
+ Source: [`packages/lsp/lsp/src/types.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/lsp/lsp/src/types.ts)
230
+ <!-- END GENERATED cordis-surface -->