gsd-pi 2.8.3 → 2.10.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 (1162) hide show
  1. package/README.md +2 -1
  2. package/dist/cli.js +5 -0
  3. package/dist/loader.js +1 -1
  4. package/dist/update-check.d.ts +24 -0
  5. package/dist/update-check.js +93 -0
  6. package/node_modules/@gsd/native/package.json +59 -0
  7. package/node_modules/@gsd/native/src/__tests__/clipboard.test.mjs +79 -0
  8. package/node_modules/@gsd/native/src/__tests__/fd.test.mjs +164 -0
  9. package/node_modules/@gsd/native/src/__tests__/glob.test.mjs +237 -0
  10. package/node_modules/@gsd/native/src/__tests__/grep.test.mjs +162 -0
  11. package/node_modules/@gsd/native/src/__tests__/highlight.test.mjs +156 -0
  12. package/node_modules/@gsd/native/src/__tests__/html.test.mjs +98 -0
  13. package/node_modules/@gsd/native/src/__tests__/image.test.mjs +137 -0
  14. package/node_modules/@gsd/native/src/__tests__/ps.test.mjs +109 -0
  15. package/node_modules/@gsd/native/src/__tests__/text.test.mjs +262 -0
  16. package/node_modules/@gsd/native/src/ast/index.ts +12 -0
  17. package/node_modules/@gsd/native/src/ast/types.ts +75 -0
  18. package/node_modules/@gsd/native/src/clipboard/index.ts +40 -0
  19. package/node_modules/@gsd/native/src/clipboard/types.ts +7 -0
  20. package/node_modules/@gsd/native/src/fd/index.ts +35 -0
  21. package/node_modules/@gsd/native/src/fd/types.ts +31 -0
  22. package/node_modules/@gsd/native/src/glob/index.ts +44 -0
  23. package/node_modules/@gsd/native/src/glob/types.ts +53 -0
  24. package/node_modules/@gsd/native/src/grep/index.ts +48 -0
  25. package/node_modules/@gsd/native/src/grep/types.ts +105 -0
  26. package/node_modules/@gsd/native/src/highlight/index.ts +44 -0
  27. package/node_modules/@gsd/native/src/highlight/types.ts +25 -0
  28. package/node_modules/@gsd/native/src/html/index.ts +24 -0
  29. package/node_modules/@gsd/native/src/html/types.ts +7 -0
  30. package/node_modules/@gsd/native/src/image/index.ts +28 -0
  31. package/node_modules/@gsd/native/src/image/types.ts +41 -0
  32. package/node_modules/@gsd/native/src/index.ts +88 -0
  33. package/node_modules/@gsd/native/src/native.ts +94 -0
  34. package/node_modules/@gsd/native/src/ps/index.ts +52 -0
  35. package/node_modules/@gsd/native/src/ps/types.ts +5 -0
  36. package/node_modules/@gsd/native/src/text/index.ts +125 -0
  37. package/node_modules/@gsd/native/src/text/types.ts +29 -0
  38. package/node_modules/@gsd/native/src/ttsr/index.ts +39 -0
  39. package/node_modules/@gsd/native/src/ttsr/types.ts +10 -0
  40. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/client.d.ts +46 -0
  41. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/client.d.ts.map +1 -0
  42. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/client.js +758 -0
  43. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/client.js.map +1 -0
  44. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/config.d.ts +23 -0
  45. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/config.d.ts.map +1 -0
  46. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/config.js +267 -0
  47. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/config.js.map +1 -0
  48. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/defaults.json +456 -0
  49. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/edits.d.ts +17 -0
  50. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/edits.d.ts.map +1 -0
  51. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/edits.js +101 -0
  52. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/edits.js.map +1 -0
  53. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/helpers.d.ts +15 -0
  54. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/helpers.d.ts.map +1 -0
  55. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/helpers.js +46 -0
  56. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/helpers.js.map +1 -0
  57. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/index.d.ts +35 -0
  58. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/index.d.ts.map +1 -0
  59. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/index.js +709 -0
  60. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/index.js.map +1 -0
  61. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/lsp-integration.test.d.ts +2 -0
  62. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/lsp-integration.test.d.ts.map +1 -0
  63. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/lsp-integration.test.js +308 -0
  64. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/lsp-integration.test.js.map +1 -0
  65. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/lsp.md +33 -0
  66. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/lspmux.d.ts +34 -0
  67. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/lspmux.d.ts.map +1 -0
  68. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/lspmux.js +136 -0
  69. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/lspmux.js.map +1 -0
  70. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/types.d.ts +262 -0
  71. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/types.d.ts.map +1 -0
  72. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/types.js +64 -0
  73. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/types.js.map +1 -0
  74. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/utils.d.ts +50 -0
  75. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/utils.d.ts.map +1 -0
  76. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/utils.js +574 -0
  77. package/node_modules/@gsd/pi-coding-agent/dist/core/lsp/utils.js.map +1 -0
  78. package/node_modules/@gsd/pi-coding-agent/dist/core/slash-commands.d.ts.map +1 -1
  79. package/node_modules/@gsd/pi-coding-agent/dist/core/slash-commands.js +1 -0
  80. package/node_modules/@gsd/pi-coding-agent/dist/core/slash-commands.js.map +1 -1
  81. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/find.d.ts +1 -1
  82. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/find.d.ts.map +1 -1
  83. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/find.js +12 -77
  84. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/find.js.map +1 -1
  85. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/hashline-edit.d.ts +60 -0
  86. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/hashline-edit.d.ts.map +1 -0
  87. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/hashline-edit.js +247 -0
  88. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/hashline-edit.js.map +1 -0
  89. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/hashline-read.d.ts +43 -0
  90. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/hashline-read.d.ts.map +1 -0
  91. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/hashline-read.js +146 -0
  92. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/hashline-read.js.map +1 -0
  93. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/hashline.d.ts +114 -0
  94. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/hashline.d.ts.map +1 -0
  95. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/hashline.js +522 -0
  96. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/hashline.js.map +1 -0
  97. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/hashline.test.d.ts +2 -0
  98. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/hashline.test.d.ts.map +1 -0
  99. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/hashline.test.js +376 -0
  100. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/hashline.test.js.map +1 -0
  101. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/index.d.ts +38 -0
  102. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/index.d.ts.map +1 -1
  103. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/index.js +27 -0
  104. package/node_modules/@gsd/pi-coding-agent/dist/core/tools/index.js.map +1 -1
  105. package/node_modules/@gsd/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts +10 -1
  106. package/node_modules/@gsd/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  107. package/node_modules/@gsd/pi-coding-agent/dist/modes/interactive/components/settings-selector.js +2 -2
  108. package/node_modules/@gsd/pi-coding-agent/dist/modes/interactive/components/settings-selector.js.map +1 -1
  109. package/node_modules/@gsd/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  110. package/node_modules/@gsd/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +6 -3
  111. package/node_modules/@gsd/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
  112. package/node_modules/@gsd/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +2 -1
  113. package/node_modules/@gsd/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  114. package/node_modules/@gsd/pi-coding-agent/dist/modes/interactive/interactive-mode.js +54 -10
  115. package/node_modules/@gsd/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
  116. package/node_modules/@gsd/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  117. package/node_modules/@gsd/pi-coding-agent/dist/modes/interactive/theme/theme.js +25 -40
  118. package/node_modules/@gsd/pi-coding-agent/dist/modes/interactive/theme/theme.js.map +1 -1
  119. package/node_modules/@gsd/pi-coding-agent/dist/utils/clipboard-image.d.ts.map +1 -1
  120. package/node_modules/@gsd/pi-coding-agent/dist/utils/clipboard-image.js +17 -21
  121. package/node_modules/@gsd/pi-coding-agent/dist/utils/clipboard-image.js.map +1 -1
  122. package/node_modules/@gsd/pi-coding-agent/dist/utils/clipboard-native.d.ts +7 -6
  123. package/node_modules/@gsd/pi-coding-agent/dist/utils/clipboard-native.d.ts.map +1 -1
  124. package/node_modules/@gsd/pi-coding-agent/dist/utils/clipboard-native.js +7 -13
  125. package/node_modules/@gsd/pi-coding-agent/dist/utils/clipboard-native.js.map +1 -1
  126. package/node_modules/@gsd/pi-coding-agent/dist/utils/clipboard.d.ts.map +1 -1
  127. package/node_modules/@gsd/pi-coding-agent/dist/utils/clipboard.js +3 -56
  128. package/node_modules/@gsd/pi-coding-agent/dist/utils/clipboard.js.map +1 -1
  129. package/node_modules/@gsd/pi-coding-agent/dist/utils/image-convert.d.ts.map +1 -1
  130. package/node_modules/@gsd/pi-coding-agent/dist/utils/image-convert.js +7 -17
  131. package/node_modules/@gsd/pi-coding-agent/dist/utils/image-convert.js.map +1 -1
  132. package/node_modules/@gsd/pi-coding-agent/dist/utils/image-resize.d.ts +1 -2
  133. package/node_modules/@gsd/pi-coding-agent/dist/utils/image-resize.d.ts.map +1 -1
  134. package/node_modules/@gsd/pi-coding-agent/dist/utils/image-resize.js +21 -29
  135. package/node_modules/@gsd/pi-coding-agent/dist/utils/image-resize.js.map +1 -1
  136. package/node_modules/@gsd/pi-coding-agent/package.json +2 -5
  137. package/node_modules/@gsd/pi-coding-agent/src/core/lsp/client.ts +880 -0
  138. package/node_modules/@gsd/pi-coding-agent/src/core/lsp/config.ts +325 -0
  139. package/node_modules/@gsd/pi-coding-agent/src/core/lsp/defaults.json +456 -0
  140. package/node_modules/@gsd/pi-coding-agent/src/core/lsp/edits.ts +109 -0
  141. package/node_modules/@gsd/pi-coding-agent/src/core/lsp/helpers.ts +54 -0
  142. package/node_modules/@gsd/pi-coding-agent/src/core/lsp/index.ts +943 -0
  143. package/node_modules/@gsd/pi-coding-agent/src/core/lsp/lsp-integration.test.ts +407 -0
  144. package/node_modules/@gsd/pi-coding-agent/src/core/lsp/lsp.md +33 -0
  145. package/node_modules/@gsd/pi-coding-agent/src/core/lsp/lspmux.ts +199 -0
  146. package/node_modules/@gsd/pi-coding-agent/src/core/lsp/types.ts +421 -0
  147. package/node_modules/@gsd/pi-coding-agent/src/core/lsp/utils.ts +682 -0
  148. package/node_modules/@gsd/pi-coding-agent/src/core/slash-commands.ts +1 -0
  149. package/node_modules/@gsd/pi-coding-agent/src/core/tools/find.ts +13 -88
  150. package/node_modules/@gsd/pi-coding-agent/src/core/tools/hashline-edit.ts +318 -0
  151. package/node_modules/@gsd/pi-coding-agent/src/core/tools/hashline-read.ts +196 -0
  152. package/node_modules/@gsd/pi-coding-agent/src/core/tools/hashline.test.ts +456 -0
  153. package/node_modules/@gsd/pi-coding-agent/src/core/tools/hashline.ts +594 -0
  154. package/node_modules/@gsd/pi-coding-agent/src/core/tools/index.ts +63 -0
  155. package/node_modules/@gsd/pi-coding-agent/src/modes/interactive/components/settings-selector.ts +2 -2
  156. package/node_modules/@gsd/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +5 -3
  157. package/node_modules/@gsd/pi-coding-agent/src/modes/interactive/interactive-mode.ts +66 -12
  158. package/node_modules/@gsd/pi-coding-agent/src/modes/interactive/theme/theme.ts +26 -42
  159. package/node_modules/@gsd/pi-coding-agent/src/utils/clipboard-image.ts +17 -24
  160. package/node_modules/@gsd/pi-coding-agent/src/utils/clipboard-native.ts +11 -21
  161. package/node_modules/@gsd/pi-coding-agent/src/utils/clipboard.ts +3 -51
  162. package/node_modules/@gsd/pi-coding-agent/src/utils/image-convert.ts +7 -17
  163. package/node_modules/@gsd/pi-coding-agent/src/utils/image-resize.ts +28 -34
  164. package/node_modules/@gsd/pi-tui/dist/autocomplete.d.ts +1 -3
  165. package/node_modules/@gsd/pi-tui/dist/autocomplete.d.ts.map +1 -1
  166. package/node_modules/@gsd/pi-tui/dist/autocomplete.js +16 -95
  167. package/node_modules/@gsd/pi-tui/dist/autocomplete.js.map +1 -1
  168. package/node_modules/@gsd/pi-tui/dist/components/image.d.ts +7 -0
  169. package/node_modules/@gsd/pi-tui/dist/components/image.d.ts.map +1 -1
  170. package/node_modules/@gsd/pi-tui/dist/components/image.js +20 -1
  171. package/node_modules/@gsd/pi-tui/dist/components/image.js.map +1 -1
  172. package/node_modules/@gsd/pi-tui/dist/index.d.ts +1 -1
  173. package/node_modules/@gsd/pi-tui/dist/index.d.ts.map +1 -1
  174. package/node_modules/@gsd/pi-tui/dist/index.js +1 -1
  175. package/node_modules/@gsd/pi-tui/dist/index.js.map +1 -1
  176. package/node_modules/@gsd/pi-tui/dist/terminal-image.d.ts +5 -5
  177. package/node_modules/@gsd/pi-tui/dist/terminal-image.d.ts.map +1 -1
  178. package/node_modules/@gsd/pi-tui/dist/terminal-image.js +9 -120
  179. package/node_modules/@gsd/pi-tui/dist/terminal-image.js.map +1 -1
  180. package/node_modules/@gsd/pi-tui/dist/utils.d.ts +23 -26
  181. package/node_modules/@gsd/pi-tui/dist/utils.d.ts.map +1 -1
  182. package/node_modules/@gsd/pi-tui/dist/utils.js +47 -716
  183. package/node_modules/@gsd/pi-tui/dist/utils.js.map +1 -1
  184. package/node_modules/@gsd/pi-tui/package.json +1 -0
  185. package/node_modules/@gsd/pi-tui/src/autocomplete.ts +17 -112
  186. package/node_modules/@gsd/pi-tui/src/components/image.ts +23 -1
  187. package/node_modules/@gsd/pi-tui/src/index.ts +0 -4
  188. package/node_modules/@gsd/pi-tui/src/terminal-image.ts +9 -135
  189. package/node_modules/@gsd/pi-tui/src/utils.ts +51 -775
  190. package/package.json +4 -1
  191. package/packages/native/package.json +59 -0
  192. package/packages/native/src/__tests__/clipboard.test.mjs +79 -0
  193. package/packages/native/src/__tests__/fd.test.mjs +164 -0
  194. package/packages/native/src/__tests__/glob.test.mjs +237 -0
  195. package/packages/native/src/__tests__/grep.test.mjs +162 -0
  196. package/packages/native/src/__tests__/highlight.test.mjs +156 -0
  197. package/packages/native/src/__tests__/html.test.mjs +98 -0
  198. package/packages/native/src/__tests__/image.test.mjs +137 -0
  199. package/packages/native/src/__tests__/ps.test.mjs +109 -0
  200. package/packages/native/src/__tests__/text.test.mjs +262 -0
  201. package/packages/native/src/ast/index.ts +12 -0
  202. package/packages/native/src/ast/types.ts +75 -0
  203. package/packages/native/src/clipboard/index.ts +40 -0
  204. package/packages/native/src/clipboard/types.ts +7 -0
  205. package/packages/native/src/fd/index.ts +35 -0
  206. package/packages/native/src/fd/types.ts +31 -0
  207. package/packages/native/src/glob/index.ts +44 -0
  208. package/packages/native/src/glob/types.ts +53 -0
  209. package/packages/native/src/grep/index.ts +48 -0
  210. package/packages/native/src/grep/types.ts +105 -0
  211. package/packages/native/src/highlight/index.ts +44 -0
  212. package/packages/native/src/highlight/types.ts +25 -0
  213. package/packages/native/src/html/index.ts +24 -0
  214. package/packages/native/src/html/types.ts +7 -0
  215. package/packages/native/src/image/index.ts +28 -0
  216. package/packages/native/src/image/types.ts +41 -0
  217. package/packages/native/src/index.ts +88 -0
  218. package/packages/native/src/native.ts +94 -0
  219. package/packages/native/src/ps/index.ts +52 -0
  220. package/packages/native/src/ps/types.ts +5 -0
  221. package/packages/native/src/text/index.ts +125 -0
  222. package/packages/native/src/text/types.ts +29 -0
  223. package/packages/native/src/ttsr/index.ts +39 -0
  224. package/packages/native/src/ttsr/types.ts +10 -0
  225. package/packages/native/tsconfig.json +8 -0
  226. package/packages/pi-coding-agent/dist/core/lsp/client.d.ts +46 -0
  227. package/packages/pi-coding-agent/dist/core/lsp/client.d.ts.map +1 -0
  228. package/packages/pi-coding-agent/dist/core/lsp/client.js +758 -0
  229. package/packages/pi-coding-agent/dist/core/lsp/client.js.map +1 -0
  230. package/packages/pi-coding-agent/dist/core/lsp/config.d.ts +23 -0
  231. package/packages/pi-coding-agent/dist/core/lsp/config.d.ts.map +1 -0
  232. package/packages/pi-coding-agent/dist/core/lsp/config.js +267 -0
  233. package/packages/pi-coding-agent/dist/core/lsp/config.js.map +1 -0
  234. package/packages/pi-coding-agent/dist/core/lsp/defaults.json +456 -0
  235. package/packages/pi-coding-agent/dist/core/lsp/edits.d.ts +17 -0
  236. package/packages/pi-coding-agent/dist/core/lsp/edits.d.ts.map +1 -0
  237. package/packages/pi-coding-agent/dist/core/lsp/edits.js +101 -0
  238. package/packages/pi-coding-agent/dist/core/lsp/edits.js.map +1 -0
  239. package/packages/pi-coding-agent/dist/core/lsp/helpers.d.ts +15 -0
  240. package/packages/pi-coding-agent/dist/core/lsp/helpers.d.ts.map +1 -0
  241. package/packages/pi-coding-agent/dist/core/lsp/helpers.js +46 -0
  242. package/packages/pi-coding-agent/dist/core/lsp/helpers.js.map +1 -0
  243. package/packages/pi-coding-agent/dist/core/lsp/index.d.ts +35 -0
  244. package/packages/pi-coding-agent/dist/core/lsp/index.d.ts.map +1 -0
  245. package/packages/pi-coding-agent/dist/core/lsp/index.js +709 -0
  246. package/packages/pi-coding-agent/dist/core/lsp/index.js.map +1 -0
  247. package/packages/pi-coding-agent/dist/core/lsp/lsp-integration.test.d.ts +2 -0
  248. package/packages/pi-coding-agent/dist/core/lsp/lsp-integration.test.d.ts.map +1 -0
  249. package/packages/pi-coding-agent/dist/core/lsp/lsp-integration.test.js +308 -0
  250. package/packages/pi-coding-agent/dist/core/lsp/lsp-integration.test.js.map +1 -0
  251. package/packages/pi-coding-agent/dist/core/lsp/lsp.md +33 -0
  252. package/packages/pi-coding-agent/dist/core/lsp/lspmux.d.ts +34 -0
  253. package/packages/pi-coding-agent/dist/core/lsp/lspmux.d.ts.map +1 -0
  254. package/packages/pi-coding-agent/dist/core/lsp/lspmux.js +136 -0
  255. package/packages/pi-coding-agent/dist/core/lsp/lspmux.js.map +1 -0
  256. package/packages/pi-coding-agent/dist/core/lsp/types.d.ts +262 -0
  257. package/packages/pi-coding-agent/dist/core/lsp/types.d.ts.map +1 -0
  258. package/packages/pi-coding-agent/dist/core/lsp/types.js +64 -0
  259. package/packages/pi-coding-agent/dist/core/lsp/types.js.map +1 -0
  260. package/packages/pi-coding-agent/dist/core/lsp/utils.d.ts +50 -0
  261. package/packages/pi-coding-agent/dist/core/lsp/utils.d.ts.map +1 -0
  262. package/packages/pi-coding-agent/dist/core/lsp/utils.js +574 -0
  263. package/packages/pi-coding-agent/dist/core/lsp/utils.js.map +1 -0
  264. package/packages/pi-coding-agent/dist/core/slash-commands.d.ts.map +1 -1
  265. package/packages/pi-coding-agent/dist/core/slash-commands.js +1 -0
  266. package/packages/pi-coding-agent/dist/core/slash-commands.js.map +1 -1
  267. package/packages/pi-coding-agent/dist/core/tools/find.d.ts +1 -1
  268. package/packages/pi-coding-agent/dist/core/tools/find.d.ts.map +1 -1
  269. package/packages/pi-coding-agent/dist/core/tools/find.js +12 -77
  270. package/packages/pi-coding-agent/dist/core/tools/find.js.map +1 -1
  271. package/packages/pi-coding-agent/dist/core/tools/hashline-edit.d.ts +60 -0
  272. package/packages/pi-coding-agent/dist/core/tools/hashline-edit.d.ts.map +1 -0
  273. package/packages/pi-coding-agent/dist/core/tools/hashline-edit.js +247 -0
  274. package/packages/pi-coding-agent/dist/core/tools/hashline-edit.js.map +1 -0
  275. package/packages/pi-coding-agent/dist/core/tools/hashline-read.d.ts +43 -0
  276. package/packages/pi-coding-agent/dist/core/tools/hashline-read.d.ts.map +1 -0
  277. package/packages/pi-coding-agent/dist/core/tools/hashline-read.js +146 -0
  278. package/packages/pi-coding-agent/dist/core/tools/hashline-read.js.map +1 -0
  279. package/packages/pi-coding-agent/dist/core/tools/hashline.d.ts +114 -0
  280. package/packages/pi-coding-agent/dist/core/tools/hashline.d.ts.map +1 -0
  281. package/packages/pi-coding-agent/dist/core/tools/hashline.js +522 -0
  282. package/packages/pi-coding-agent/dist/core/tools/hashline.js.map +1 -0
  283. package/packages/pi-coding-agent/dist/core/tools/hashline.test.d.ts +2 -0
  284. package/packages/pi-coding-agent/dist/core/tools/hashline.test.d.ts.map +1 -0
  285. package/packages/pi-coding-agent/dist/core/tools/hashline.test.js +376 -0
  286. package/packages/pi-coding-agent/dist/core/tools/hashline.test.js.map +1 -0
  287. package/packages/pi-coding-agent/dist/core/tools/index.d.ts +38 -0
  288. package/packages/pi-coding-agent/dist/core/tools/index.d.ts.map +1 -1
  289. package/packages/pi-coding-agent/dist/core/tools/index.js +27 -0
  290. package/packages/pi-coding-agent/dist/core/tools/index.js.map +1 -1
  291. package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts +10 -1
  292. package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  293. package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.js +2 -2
  294. package/packages/pi-coding-agent/dist/modes/interactive/components/settings-selector.js.map +1 -1
  295. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  296. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +6 -3
  297. package/packages/pi-coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -1
  298. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +2 -1
  299. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  300. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js +54 -10
  301. package/packages/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
  302. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  303. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js +25 -40
  304. package/packages/pi-coding-agent/dist/modes/interactive/theme/theme.js.map +1 -1
  305. package/packages/pi-coding-agent/dist/utils/clipboard-image.d.ts.map +1 -1
  306. package/packages/pi-coding-agent/dist/utils/clipboard-image.js +17 -21
  307. package/packages/pi-coding-agent/dist/utils/clipboard-image.js.map +1 -1
  308. package/packages/pi-coding-agent/dist/utils/clipboard-native.d.ts +7 -6
  309. package/packages/pi-coding-agent/dist/utils/clipboard-native.d.ts.map +1 -1
  310. package/packages/pi-coding-agent/dist/utils/clipboard-native.js +7 -13
  311. package/packages/pi-coding-agent/dist/utils/clipboard-native.js.map +1 -1
  312. package/packages/pi-coding-agent/dist/utils/clipboard.d.ts.map +1 -1
  313. package/packages/pi-coding-agent/dist/utils/clipboard.js +3 -56
  314. package/packages/pi-coding-agent/dist/utils/clipboard.js.map +1 -1
  315. package/packages/pi-coding-agent/dist/utils/image-convert.d.ts.map +1 -1
  316. package/packages/pi-coding-agent/dist/utils/image-convert.js +7 -17
  317. package/packages/pi-coding-agent/dist/utils/image-convert.js.map +1 -1
  318. package/packages/pi-coding-agent/dist/utils/image-resize.d.ts +1 -2
  319. package/packages/pi-coding-agent/dist/utils/image-resize.d.ts.map +1 -1
  320. package/packages/pi-coding-agent/dist/utils/image-resize.js +21 -29
  321. package/packages/pi-coding-agent/dist/utils/image-resize.js.map +1 -1
  322. package/packages/pi-coding-agent/package.json +2 -5
  323. package/packages/pi-coding-agent/src/core/lsp/client.ts +880 -0
  324. package/packages/pi-coding-agent/src/core/lsp/config.ts +325 -0
  325. package/packages/pi-coding-agent/src/core/lsp/defaults.json +456 -0
  326. package/packages/pi-coding-agent/src/core/lsp/edits.ts +109 -0
  327. package/packages/pi-coding-agent/src/core/lsp/helpers.ts +54 -0
  328. package/packages/pi-coding-agent/src/core/lsp/index.ts +943 -0
  329. package/packages/pi-coding-agent/src/core/lsp/lsp-integration.test.ts +407 -0
  330. package/packages/pi-coding-agent/src/core/lsp/lsp.md +33 -0
  331. package/packages/pi-coding-agent/src/core/lsp/lspmux.ts +199 -0
  332. package/packages/pi-coding-agent/src/core/lsp/types.ts +421 -0
  333. package/packages/pi-coding-agent/src/core/lsp/utils.ts +682 -0
  334. package/packages/pi-coding-agent/src/core/slash-commands.ts +1 -0
  335. package/packages/pi-coding-agent/src/core/tools/find.ts +13 -88
  336. package/packages/pi-coding-agent/src/core/tools/hashline-edit.ts +318 -0
  337. package/packages/pi-coding-agent/src/core/tools/hashline-read.ts +196 -0
  338. package/packages/pi-coding-agent/src/core/tools/hashline.test.ts +456 -0
  339. package/packages/pi-coding-agent/src/core/tools/hashline.ts +594 -0
  340. package/packages/pi-coding-agent/src/core/tools/index.ts +63 -0
  341. package/packages/pi-coding-agent/src/modes/interactive/components/settings-selector.ts +2 -2
  342. package/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +5 -3
  343. package/packages/pi-coding-agent/src/modes/interactive/interactive-mode.ts +66 -12
  344. package/packages/pi-coding-agent/src/modes/interactive/theme/theme.ts +26 -42
  345. package/packages/pi-coding-agent/src/utils/clipboard-image.ts +17 -24
  346. package/packages/pi-coding-agent/src/utils/clipboard-native.ts +11 -21
  347. package/packages/pi-coding-agent/src/utils/clipboard.ts +3 -51
  348. package/packages/pi-coding-agent/src/utils/image-convert.ts +7 -17
  349. package/packages/pi-coding-agent/src/utils/image-resize.ts +28 -34
  350. package/packages/pi-tui/dist/autocomplete.d.ts +1 -3
  351. package/packages/pi-tui/dist/autocomplete.d.ts.map +1 -1
  352. package/packages/pi-tui/dist/autocomplete.js +16 -95
  353. package/packages/pi-tui/dist/autocomplete.js.map +1 -1
  354. package/packages/pi-tui/dist/components/image.d.ts +7 -0
  355. package/packages/pi-tui/dist/components/image.d.ts.map +1 -1
  356. package/packages/pi-tui/dist/components/image.js +20 -1
  357. package/packages/pi-tui/dist/components/image.js.map +1 -1
  358. package/packages/pi-tui/dist/index.d.ts +1 -1
  359. package/packages/pi-tui/dist/index.d.ts.map +1 -1
  360. package/packages/pi-tui/dist/index.js +1 -1
  361. package/packages/pi-tui/dist/index.js.map +1 -1
  362. package/packages/pi-tui/dist/terminal-image.d.ts +5 -5
  363. package/packages/pi-tui/dist/terminal-image.d.ts.map +1 -1
  364. package/packages/pi-tui/dist/terminal-image.js +9 -120
  365. package/packages/pi-tui/dist/terminal-image.js.map +1 -1
  366. package/packages/pi-tui/dist/utils.d.ts +23 -26
  367. package/packages/pi-tui/dist/utils.d.ts.map +1 -1
  368. package/packages/pi-tui/dist/utils.js +47 -716
  369. package/packages/pi-tui/dist/utils.js.map +1 -1
  370. package/packages/pi-tui/package.json +1 -0
  371. package/packages/pi-tui/src/autocomplete.ts +17 -112
  372. package/packages/pi-tui/src/components/image.ts +23 -1
  373. package/packages/pi-tui/src/index.ts +0 -4
  374. package/packages/pi-tui/src/terminal-image.ts +9 -135
  375. package/packages/pi-tui/src/utils.ts +51 -775
  376. package/pkg/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  377. package/pkg/dist/modes/interactive/theme/theme.js +25 -40
  378. package/pkg/dist/modes/interactive/theme/theme.js.map +1 -1
  379. package/src/resources/extensions/ask-user-questions.ts +2 -2
  380. package/src/resources/extensions/bg-shell/index.ts +377 -51
  381. package/src/resources/extensions/browser-tools/core.d.ts +205 -0
  382. package/src/resources/extensions/browser-tools/index.ts +2 -2
  383. package/src/resources/extensions/browser-tools/refs.ts +1 -1
  384. package/src/resources/extensions/browser-tools/tools/session.ts +1 -1
  385. package/src/resources/extensions/context7/index.ts +2 -2
  386. package/src/resources/extensions/get-secrets-from-user.ts +3 -2
  387. package/src/resources/extensions/google-search/index.ts +1 -1
  388. package/src/resources/extensions/gsd/auto.ts +41 -4
  389. package/src/resources/extensions/gsd/commands.ts +218 -3
  390. package/src/resources/extensions/gsd/doctor.ts +1 -1
  391. package/src/resources/extensions/gsd/git-service.ts +129 -5
  392. package/src/resources/extensions/gsd/guided-flow.ts +19 -9
  393. package/src/resources/extensions/gsd/index.ts +17 -7
  394. package/src/resources/extensions/gsd/preferences.ts +1 -1
  395. package/src/resources/extensions/gsd/tests/git-service.test.ts +226 -0
  396. package/src/resources/extensions/gsd/tests/migrate-command.test.ts +2 -2
  397. package/src/resources/extensions/gsd/tests/migrate-transformer.test.ts +1 -1
  398. package/src/resources/extensions/gsd/tests/migrate-writer-integration.test.ts +10 -10
  399. package/src/resources/extensions/gsd/tests/next-milestone-id.test.ts +87 -0
  400. package/src/resources/extensions/gsd/tests/worktree.test.ts +352 -0
  401. package/src/resources/extensions/gsd/types.ts +1 -0
  402. package/src/resources/extensions/gsd/worktree.ts +20 -1
  403. package/src/resources/extensions/mac-tools/index.ts +1 -1
  404. package/src/resources/extensions/search-the-web/format.ts +1 -1
  405. package/src/resources/extensions/search-the-web/index.ts +5 -5
  406. package/src/resources/extensions/search-the-web/tool-fetch-page.ts +7 -7
  407. package/src/resources/extensions/search-the-web/tool-llm-context.ts +11 -11
  408. package/src/resources/extensions/search-the-web/tool-search.ts +10 -10
  409. package/src/resources/extensions/shared/interview-ui.ts +2 -2
  410. package/src/resources/extensions/universal-config/discovery.ts +78 -0
  411. package/src/resources/extensions/universal-config/format.ts +160 -0
  412. package/src/resources/extensions/universal-config/index.ts +118 -0
  413. package/src/resources/extensions/universal-config/package.json +11 -0
  414. package/src/resources/extensions/universal-config/scanners.ts +579 -0
  415. package/src/resources/extensions/universal-config/tests/discovery.test.ts +111 -0
  416. package/src/resources/extensions/universal-config/tests/format.test.ts +111 -0
  417. package/src/resources/extensions/universal-config/tests/scanners.test.ts +438 -0
  418. package/src/resources/extensions/universal-config/tools.ts +60 -0
  419. package/src/resources/extensions/universal-config/types.ts +116 -0
  420. package/node_modules/@mariozechner/clipboard/.yarnrc.yml +0 -1
  421. package/node_modules/@mariozechner/clipboard/Cargo.toml +0 -26
  422. package/node_modules/@mariozechner/clipboard/README.md +0 -58
  423. package/node_modules/@mariozechner/clipboard/build.rs +0 -5
  424. package/node_modules/@mariozechner/clipboard/exp.ts +0 -12
  425. package/node_modules/@mariozechner/clipboard/index.d.ts +0 -23
  426. package/node_modules/@mariozechner/clipboard/index.js +0 -317
  427. package/node_modules/@mariozechner/clipboard/package.json +0 -56
  428. package/node_modules/@mariozechner/clipboard/src/lib.rs +0 -191
  429. package/node_modules/@mariozechner/clipboard-darwin-arm64/README.md +0 -3
  430. package/node_modules/@mariozechner/clipboard-darwin-arm64/clipboard.darwin-arm64.node +0 -0
  431. package/node_modules/@mariozechner/clipboard-darwin-arm64/package.json +0 -22
  432. package/node_modules/@mariozechner/clipboard-darwin-universal/README.md +0 -3
  433. package/node_modules/@mariozechner/clipboard-darwin-universal/clipboard.darwin-universal.node +0 -0
  434. package/node_modules/@mariozechner/clipboard-darwin-universal/package.json +0 -19
  435. package/node_modules/ansi-styles/index.d.ts +0 -345
  436. package/node_modules/ansi-styles/index.js +0 -163
  437. package/node_modules/ansi-styles/license +0 -9
  438. package/node_modules/ansi-styles/package.json +0 -56
  439. package/node_modules/ansi-styles/readme.md +0 -152
  440. package/node_modules/any-promise/.jshintrc +0 -4
  441. package/node_modules/any-promise/.npmignore +0 -7
  442. package/node_modules/any-promise/LICENSE +0 -19
  443. package/node_modules/any-promise/README.md +0 -161
  444. package/node_modules/any-promise/implementation.d.ts +0 -3
  445. package/node_modules/any-promise/implementation.js +0 -1
  446. package/node_modules/any-promise/index.d.ts +0 -73
  447. package/node_modules/any-promise/index.js +0 -1
  448. package/node_modules/any-promise/loader.js +0 -78
  449. package/node_modules/any-promise/optional.js +0 -6
  450. package/node_modules/any-promise/package.json +0 -45
  451. package/node_modules/any-promise/register/bluebird.d.ts +0 -1
  452. package/node_modules/any-promise/register/bluebird.js +0 -2
  453. package/node_modules/any-promise/register/es6-promise.d.ts +0 -1
  454. package/node_modules/any-promise/register/es6-promise.js +0 -2
  455. package/node_modules/any-promise/register/lie.d.ts +0 -1
  456. package/node_modules/any-promise/register/lie.js +0 -2
  457. package/node_modules/any-promise/register/native-promise-only.d.ts +0 -1
  458. package/node_modules/any-promise/register/native-promise-only.js +0 -2
  459. package/node_modules/any-promise/register/pinkie.d.ts +0 -1
  460. package/node_modules/any-promise/register/pinkie.js +0 -2
  461. package/node_modules/any-promise/register/promise.d.ts +0 -1
  462. package/node_modules/any-promise/register/promise.js +0 -2
  463. package/node_modules/any-promise/register/q.d.ts +0 -1
  464. package/node_modules/any-promise/register/q.js +0 -2
  465. package/node_modules/any-promise/register/rsvp.d.ts +0 -1
  466. package/node_modules/any-promise/register/rsvp.js +0 -2
  467. package/node_modules/any-promise/register/vow.d.ts +0 -1
  468. package/node_modules/any-promise/register/vow.js +0 -2
  469. package/node_modules/any-promise/register/when.d.ts +0 -1
  470. package/node_modules/any-promise/register/when.js +0 -2
  471. package/node_modules/any-promise/register-shim.js +0 -18
  472. package/node_modules/any-promise/register.d.ts +0 -17
  473. package/node_modules/any-promise/register.js +0 -94
  474. package/node_modules/cli-highlight/LICENSE.txt +0 -15
  475. package/node_modules/cli-highlight/README.md +0 -88
  476. package/node_modules/cli-highlight/bin/highlight +0 -2
  477. package/node_modules/cli-highlight/dist/cli.d.ts +0 -1
  478. package/node_modules/cli-highlight/dist/cli.js +0 -102
  479. package/node_modules/cli-highlight/dist/cli.js.map +0 -1
  480. package/node_modules/cli-highlight/dist/index.d.ts +0 -53
  481. package/node_modules/cli-highlight/dist/index.js +0 -112
  482. package/node_modules/cli-highlight/dist/index.js.map +0 -1
  483. package/node_modules/cli-highlight/dist/test/test.d.ts +0 -1
  484. package/node_modules/cli-highlight/dist/test/test.js +0 -62
  485. package/node_modules/cli-highlight/dist/test/test.js.map +0 -1
  486. package/node_modules/cli-highlight/dist/theme.d.ts +0 -270
  487. package/node_modules/cli-highlight/dist/theme.js +0 -265
  488. package/node_modules/cli-highlight/dist/theme.js.map +0 -1
  489. package/node_modules/cli-highlight/node_modules/chalk/index.d.ts +0 -415
  490. package/node_modules/cli-highlight/node_modules/chalk/license +0 -9
  491. package/node_modules/cli-highlight/node_modules/chalk/package.json +0 -68
  492. package/node_modules/cli-highlight/node_modules/chalk/readme.md +0 -341
  493. package/node_modules/cli-highlight/node_modules/chalk/source/index.js +0 -229
  494. package/node_modules/cli-highlight/node_modules/chalk/source/templates.js +0 -134
  495. package/node_modules/cli-highlight/node_modules/chalk/source/util.js +0 -39
  496. package/node_modules/cli-highlight/package.json +0 -129
  497. package/node_modules/cliui/CHANGELOG.md +0 -121
  498. package/node_modules/cliui/LICENSE.txt +0 -14
  499. package/node_modules/cliui/README.md +0 -141
  500. package/node_modules/cliui/build/index.cjs +0 -302
  501. package/node_modules/cliui/build/lib/index.js +0 -287
  502. package/node_modules/cliui/build/lib/string-utils.js +0 -27
  503. package/node_modules/cliui/index.mjs +0 -13
  504. package/node_modules/cliui/node_modules/ansi-regex/index.d.ts +0 -37
  505. package/node_modules/cliui/node_modules/ansi-regex/index.js +0 -10
  506. package/node_modules/cliui/node_modules/ansi-regex/license +0 -9
  507. package/node_modules/cliui/node_modules/ansi-regex/package.json +0 -55
  508. package/node_modules/cliui/node_modules/ansi-regex/readme.md +0 -78
  509. package/node_modules/cliui/node_modules/strip-ansi/index.d.ts +0 -17
  510. package/node_modules/cliui/node_modules/strip-ansi/index.js +0 -4
  511. package/node_modules/cliui/node_modules/strip-ansi/license +0 -9
  512. package/node_modules/cliui/node_modules/strip-ansi/package.json +0 -54
  513. package/node_modules/cliui/node_modules/strip-ansi/readme.md +0 -46
  514. package/node_modules/cliui/package.json +0 -83
  515. package/node_modules/color-convert/CHANGELOG.md +0 -54
  516. package/node_modules/color-convert/LICENSE +0 -21
  517. package/node_modules/color-convert/README.md +0 -68
  518. package/node_modules/color-convert/conversions.js +0 -839
  519. package/node_modules/color-convert/index.js +0 -81
  520. package/node_modules/color-convert/package.json +0 -48
  521. package/node_modules/color-convert/route.js +0 -97
  522. package/node_modules/color-name/LICENSE +0 -8
  523. package/node_modules/color-name/README.md +0 -11
  524. package/node_modules/color-name/index.js +0 -152
  525. package/node_modules/color-name/package.json +0 -28
  526. package/node_modules/emoji-regex/LICENSE-MIT.txt +0 -20
  527. package/node_modules/emoji-regex/README.md +0 -73
  528. package/node_modules/emoji-regex/es2015/index.js +0 -6
  529. package/node_modules/emoji-regex/es2015/text.js +0 -6
  530. package/node_modules/emoji-regex/index.d.ts +0 -23
  531. package/node_modules/emoji-regex/index.js +0 -6
  532. package/node_modules/emoji-regex/package.json +0 -50
  533. package/node_modules/emoji-regex/text.js +0 -6
  534. package/node_modules/escalade/dist/index.js +0 -22
  535. package/node_modules/escalade/dist/index.mjs +0 -22
  536. package/node_modules/escalade/index.d.mts +0 -11
  537. package/node_modules/escalade/index.d.ts +0 -15
  538. package/node_modules/escalade/license +0 -9
  539. package/node_modules/escalade/package.json +0 -74
  540. package/node_modules/escalade/readme.md +0 -211
  541. package/node_modules/escalade/sync/index.d.mts +0 -9
  542. package/node_modules/escalade/sync/index.d.ts +0 -13
  543. package/node_modules/escalade/sync/index.js +0 -18
  544. package/node_modules/escalade/sync/index.mjs +0 -18
  545. package/node_modules/esprima/ChangeLog +0 -235
  546. package/node_modules/get-caller-file/LICENSE.md +0 -6
  547. package/node_modules/get-caller-file/README.md +0 -41
  548. package/node_modules/get-caller-file/index.d.ts +0 -2
  549. package/node_modules/get-caller-file/index.js +0 -22
  550. package/node_modules/get-caller-file/index.js.map +0 -1
  551. package/node_modules/get-caller-file/package.json +0 -42
  552. package/node_modules/has-flag/index.d.ts +0 -39
  553. package/node_modules/has-flag/index.js +0 -8
  554. package/node_modules/has-flag/license +0 -9
  555. package/node_modules/has-flag/package.json +0 -46
  556. package/node_modules/has-flag/readme.md +0 -89
  557. package/node_modules/highlight.js/LICENSE +0 -29
  558. package/node_modules/highlight.js/README.md +0 -371
  559. package/node_modules/highlight.js/lib/core.js +0 -2517
  560. package/node_modules/highlight.js/lib/highlight.js +0 -2
  561. package/node_modules/highlight.js/lib/index.js +0 -195
  562. package/node_modules/highlight.js/lib/languages/1c.js +0 -521
  563. package/node_modules/highlight.js/lib/languages/abnf.js +0 -103
  564. package/node_modules/highlight.js/lib/languages/accesslog.js +0 -127
  565. package/node_modules/highlight.js/lib/languages/actionscript.js +0 -113
  566. package/node_modules/highlight.js/lib/languages/ada.js +0 -194
  567. package/node_modules/highlight.js/lib/languages/angelscript.js +0 -123
  568. package/node_modules/highlight.js/lib/languages/apache.js +0 -89
  569. package/node_modules/highlight.js/lib/languages/applescript.js +0 -189
  570. package/node_modules/highlight.js/lib/languages/arcade.js +0 -165
  571. package/node_modules/highlight.js/lib/languages/arduino.js +0 -576
  572. package/node_modules/highlight.js/lib/languages/armasm.js +0 -131
  573. package/node_modules/highlight.js/lib/languages/asciidoc.js +0 -303
  574. package/node_modules/highlight.js/lib/languages/aspectj.js +0 -186
  575. package/node_modules/highlight.js/lib/languages/autohotkey.js +0 -84
  576. package/node_modules/highlight.js/lib/languages/autoit.js +0 -183
  577. package/node_modules/highlight.js/lib/languages/avrasm.js +0 -80
  578. package/node_modules/highlight.js/lib/languages/awk.js +0 -73
  579. package/node_modules/highlight.js/lib/languages/axapta.js +0 -179
  580. package/node_modules/highlight.js/lib/languages/bash.js +0 -169
  581. package/node_modules/highlight.js/lib/languages/basic.js +0 -65
  582. package/node_modules/highlight.js/lib/languages/bnf.js +0 -38
  583. package/node_modules/highlight.js/lib/languages/brainfuck.js +0 -46
  584. package/node_modules/highlight.js/lib/languages/c-like.js +0 -501
  585. package/node_modules/highlight.js/lib/languages/c.js +0 -309
  586. package/node_modules/highlight.js/lib/languages/cal.js +0 -104
  587. package/node_modules/highlight.js/lib/languages/capnproto.js +0 -64
  588. package/node_modules/highlight.js/lib/languages/ceylon.js +0 -82
  589. package/node_modules/highlight.js/lib/languages/clean.js +0 -40
  590. package/node_modules/highlight.js/lib/languages/clojure-repl.js +0 -27
  591. package/node_modules/highlight.js/lib/languages/clojure.js +0 -158
  592. package/node_modules/highlight.js/lib/languages/cmake.js +0 -64
  593. package/node_modules/highlight.js/lib/languages/coffeescript.js +0 -356
  594. package/node_modules/highlight.js/lib/languages/coq.js +0 -79
  595. package/node_modules/highlight.js/lib/languages/cos.js +0 -138
  596. package/node_modules/highlight.js/lib/languages/cpp.js +0 -464
  597. package/node_modules/highlight.js/lib/languages/crmsh.js +0 -102
  598. package/node_modules/highlight.js/lib/languages/crystal.js +0 -326
  599. package/node_modules/highlight.js/lib/languages/csharp.js +0 -441
  600. package/node_modules/highlight.js/lib/languages/csp.js +0 -37
  601. package/node_modules/highlight.js/lib/languages/css.js +0 -608
  602. package/node_modules/highlight.js/lib/languages/d.js +0 -271
  603. package/node_modules/highlight.js/lib/languages/dart.js +0 -199
  604. package/node_modules/highlight.js/lib/languages/delphi.js +0 -126
  605. package/node_modules/highlight.js/lib/languages/diff.js +0 -85
  606. package/node_modules/highlight.js/lib/languages/django.js +0 -77
  607. package/node_modules/highlight.js/lib/languages/dns.js +0 -46
  608. package/node_modules/highlight.js/lib/languages/dockerfile.js +0 -34
  609. package/node_modules/highlight.js/lib/languages/dos.js +0 -70
  610. package/node_modules/highlight.js/lib/languages/dsconfig.js +0 -66
  611. package/node_modules/highlight.js/lib/languages/dts.js +0 -153
  612. package/node_modules/highlight.js/lib/languages/dust.js +0 -45
  613. package/node_modules/highlight.js/lib/languages/ebnf.js +0 -53
  614. package/node_modules/highlight.js/lib/languages/elixir.js +0 -259
  615. package/node_modules/highlight.js/lib/languages/elm.js +0 -129
  616. package/node_modules/highlight.js/lib/languages/erb.js +0 -29
  617. package/node_modules/highlight.js/lib/languages/erlang-repl.js +0 -86
  618. package/node_modules/highlight.js/lib/languages/erlang.js +0 -199
  619. package/node_modules/highlight.js/lib/languages/excel.js +0 -64
  620. package/node_modules/highlight.js/lib/languages/fix.js +0 -37
  621. package/node_modules/highlight.js/lib/languages/flix.js +0 -54
  622. package/node_modules/highlight.js/lib/languages/fortran.js +0 -159
  623. package/node_modules/highlight.js/lib/languages/fsharp.js +0 -86
  624. package/node_modules/highlight.js/lib/languages/gams.js +0 -208
  625. package/node_modules/highlight.js/lib/languages/gauss.js +0 -316
  626. package/node_modules/highlight.js/lib/languages/gcode.js +0 -88
  627. package/node_modules/highlight.js/lib/languages/gherkin.js +0 -49
  628. package/node_modules/highlight.js/lib/languages/glsl.js +0 -128
  629. package/node_modules/highlight.js/lib/languages/gml.js +0 -885
  630. package/node_modules/highlight.js/lib/languages/go.js +0 -74
  631. package/node_modules/highlight.js/lib/languages/golo.js +0 -33
  632. package/node_modules/highlight.js/lib/languages/gradle.js +0 -44
  633. package/node_modules/highlight.js/lib/languages/groovy.js +0 -174
  634. package/node_modules/highlight.js/lib/languages/haml.js +0 -117
  635. package/node_modules/highlight.js/lib/languages/handlebars.js +0 -324
  636. package/node_modules/highlight.js/lib/languages/haskell.js +0 -173
  637. package/node_modules/highlight.js/lib/languages/haxe.js +0 -157
  638. package/node_modules/highlight.js/lib/languages/hsp.js +0 -65
  639. package/node_modules/highlight.js/lib/languages/htmlbars.js +0 -352
  640. package/node_modules/highlight.js/lib/languages/http.js +0 -121
  641. package/node_modules/highlight.js/lib/languages/hy.js +0 -109
  642. package/node_modules/highlight.js/lib/languages/inform7.js +0 -70
  643. package/node_modules/highlight.js/lib/languages/ini.js +0 -173
  644. package/node_modules/highlight.js/lib/languages/irpf90.js +0 -141
  645. package/node_modules/highlight.js/lib/languages/isbl.js +0 -3207
  646. package/node_modules/highlight.js/lib/languages/java.js +0 -181
  647. package/node_modules/highlight.js/lib/languages/javascript.js +0 -604
  648. package/node_modules/highlight.js/lib/languages/jboss-cli.js +0 -63
  649. package/node_modules/highlight.js/lib/languages/json.js +0 -63
  650. package/node_modules/highlight.js/lib/languages/julia-repl.js +0 -50
  651. package/node_modules/highlight.js/lib/languages/julia.js +0 -416
  652. package/node_modules/highlight.js/lib/languages/kotlin.js +0 -284
  653. package/node_modules/highlight.js/lib/languages/lasso.js +0 -187
  654. package/node_modules/highlight.js/lib/languages/latex.js +0 -276
  655. package/node_modules/highlight.js/lib/languages/ldif.js +0 -42
  656. package/node_modules/highlight.js/lib/languages/leaf.js +0 -49
  657. package/node_modules/highlight.js/lib/languages/less.js +0 -666
  658. package/node_modules/highlight.js/lib/languages/lisp.js +0 -111
  659. package/node_modules/highlight.js/lib/languages/livecodeserver.js +0 -189
  660. package/node_modules/highlight.js/lib/languages/livescript.js +0 -374
  661. package/node_modules/highlight.js/lib/languages/llvm.js +0 -154
  662. package/node_modules/highlight.js/lib/languages/lsl.js +0 -95
  663. package/node_modules/highlight.js/lib/languages/lua.js +0 -82
  664. package/node_modules/highlight.js/lib/languages/makefile.js +0 -92
  665. package/node_modules/highlight.js/lib/languages/markdown.js +0 -258
  666. package/node_modules/highlight.js/lib/languages/mathematica.js +0 -6797
  667. package/node_modules/highlight.js/lib/languages/matlab.js +0 -106
  668. package/node_modules/highlight.js/lib/languages/maxima.js +0 -417
  669. package/node_modules/highlight.js/lib/languages/mel.js +0 -236
  670. package/node_modules/highlight.js/lib/languages/mercury.js +0 -121
  671. package/node_modules/highlight.js/lib/languages/mipsasm.js +0 -109
  672. package/node_modules/highlight.js/lib/languages/mizar.js +0 -29
  673. package/node_modules/highlight.js/lib/languages/mojolicious.js +0 -36
  674. package/node_modules/highlight.js/lib/languages/monkey.js +0 -89
  675. package/node_modules/highlight.js/lib/languages/moonscript.js +0 -147
  676. package/node_modules/highlight.js/lib/languages/n1ql.js +0 -77
  677. package/node_modules/highlight.js/lib/languages/nginx.js +0 -140
  678. package/node_modules/highlight.js/lib/languages/nim.js +0 -79
  679. package/node_modules/highlight.js/lib/languages/nix.js +0 -65
  680. package/node_modules/highlight.js/lib/languages/node-repl.js +0 -37
  681. package/node_modules/highlight.js/lib/languages/nsis.js +0 -119
  682. package/node_modules/highlight.js/lib/languages/objectivec.js +0 -121
  683. package/node_modules/highlight.js/lib/languages/ocaml.js +0 -82
  684. package/node_modules/highlight.js/lib/languages/openscad.js +0 -81
  685. package/node_modules/highlight.js/lib/languages/oxygene.js +0 -101
  686. package/node_modules/highlight.js/lib/languages/parser3.js +0 -57
  687. package/node_modules/highlight.js/lib/languages/perl.js +0 -515
  688. package/node_modules/highlight.js/lib/languages/pf.js +0 -59
  689. package/node_modules/highlight.js/lib/languages/pgsql.js +0 -630
  690. package/node_modules/highlight.js/lib/languages/php-template.js +0 -54
  691. package/node_modules/highlight.js/lib/languages/php.js +0 -204
  692. package/node_modules/highlight.js/lib/languages/plaintext.js +0 -19
  693. package/node_modules/highlight.js/lib/languages/pony.js +0 -89
  694. package/node_modules/highlight.js/lib/languages/powershell.js +0 -331
  695. package/node_modules/highlight.js/lib/languages/processing.js +0 -58
  696. package/node_modules/highlight.js/lib/languages/profile.js +0 -43
  697. package/node_modules/highlight.js/lib/languages/prolog.js +0 -102
  698. package/node_modules/highlight.js/lib/languages/properties.js +0 -85
  699. package/node_modules/highlight.js/lib/languages/protobuf.js +0 -47
  700. package/node_modules/highlight.js/lib/languages/puppet.js +0 -147
  701. package/node_modules/highlight.js/lib/languages/purebasic.js +0 -101
  702. package/node_modules/highlight.js/lib/languages/python-repl.js +0 -36
  703. package/node_modules/highlight.js/lib/languages/python.js +0 -446
  704. package/node_modules/highlight.js/lib/languages/q.js +0 -37
  705. package/node_modules/highlight.js/lib/languages/qml.js +0 -225
  706. package/node_modules/highlight.js/lib/languages/r.js +0 -231
  707. package/node_modules/highlight.js/lib/languages/reasonml.js +0 -321
  708. package/node_modules/highlight.js/lib/languages/rib.js +0 -37
  709. package/node_modules/highlight.js/lib/languages/roboconf.js +0 -82
  710. package/node_modules/highlight.js/lib/languages/routeros.js +0 -172
  711. package/node_modules/highlight.js/lib/languages/rsl.js +0 -49
  712. package/node_modules/highlight.js/lib/languages/ruby.js +0 -387
  713. package/node_modules/highlight.js/lib/languages/ruleslanguage.js +0 -78
  714. package/node_modules/highlight.js/lib/languages/rust.js +0 -146
  715. package/node_modules/highlight.js/lib/languages/sas.js +0 -133
  716. package/node_modules/highlight.js/lib/languages/scala.js +0 -140
  717. package/node_modules/highlight.js/lib/languages/scheme.js +0 -207
  718. package/node_modules/highlight.js/lib/languages/scilab.js +0 -73
  719. package/node_modules/highlight.js/lib/languages/scss.js +0 -545
  720. package/node_modules/highlight.js/lib/languages/shell.js +0 -30
  721. package/node_modules/highlight.js/lib/languages/smali.js +0 -135
  722. package/node_modules/highlight.js/lib/languages/smalltalk.js +0 -63
  723. package/node_modules/highlight.js/lib/languages/sml.js +0 -81
  724. package/node_modules/highlight.js/lib/languages/sqf.js +0 -448
  725. package/node_modules/highlight.js/lib/languages/sql.js +0 -699
  726. package/node_modules/highlight.js/lib/languages/sql_more.js +0 -183
  727. package/node_modules/highlight.js/lib/languages/stan.js +0 -548
  728. package/node_modules/highlight.js/lib/languages/stata.js +0 -60
  729. package/node_modules/highlight.js/lib/languages/step21.js +0 -66
  730. package/node_modules/highlight.js/lib/languages/stylus.js +0 -609
  731. package/node_modules/highlight.js/lib/languages/subunit.js +0 -51
  732. package/node_modules/highlight.js/lib/languages/swift.js +0 -873
  733. package/node_modules/highlight.js/lib/languages/taggerscript.js +0 -52
  734. package/node_modules/highlight.js/lib/languages/tap.js +0 -55
  735. package/node_modules/highlight.js/lib/languages/tcl.js +0 -115
  736. package/node_modules/highlight.js/lib/languages/thrift.js +0 -51
  737. package/node_modules/highlight.js/lib/languages/tp.js +0 -95
  738. package/node_modules/highlight.js/lib/languages/twig.js +0 -77
  739. package/node_modules/highlight.js/lib/languages/typescript.js +0 -697
  740. package/node_modules/highlight.js/lib/languages/vala.js +0 -61
  741. package/node_modules/highlight.js/lib/languages/vbnet.js +0 -214
  742. package/node_modules/highlight.js/lib/languages/vbscript-html.js +0 -24
  743. package/node_modules/highlight.js/lib/languages/vbscript.js +0 -109
  744. package/node_modules/highlight.js/lib/languages/verilog.js +0 -131
  745. package/node_modules/highlight.js/lib/languages/vhdl.js +0 -71
  746. package/node_modules/highlight.js/lib/languages/vim.js +0 -123
  747. package/node_modules/highlight.js/lib/languages/x86asm.js +0 -163
  748. package/node_modules/highlight.js/lib/languages/xl.js +0 -92
  749. package/node_modules/highlight.js/lib/languages/xml.js +0 -287
  750. package/node_modules/highlight.js/lib/languages/xquery.js +0 -197
  751. package/node_modules/highlight.js/lib/languages/yaml.js +0 -176
  752. package/node_modules/highlight.js/lib/languages/zephir.js +0 -140
  753. package/node_modules/highlight.js/package.json +0 -86
  754. package/node_modules/highlight.js/scss/a11y-dark.scss +0 -99
  755. package/node_modules/highlight.js/scss/a11y-light.scss +0 -99
  756. package/node_modules/highlight.js/scss/agate.scss +0 -108
  757. package/node_modules/highlight.js/scss/an-old-hope.scss +0 -89
  758. package/node_modules/highlight.js/scss/androidstudio.scss +0 -66
  759. package/node_modules/highlight.js/scss/arduino-light.scss +0 -87
  760. package/node_modules/highlight.js/scss/arta.scss +0 -73
  761. package/node_modules/highlight.js/scss/ascetic.scss +0 -45
  762. package/node_modules/highlight.js/scss/atelier-cave-dark.scss +0 -83
  763. package/node_modules/highlight.js/scss/atelier-cave-light.scss +0 -85
  764. package/node_modules/highlight.js/scss/atelier-dune-dark.scss +0 -69
  765. package/node_modules/highlight.js/scss/atelier-dune-light.scss +0 -69
  766. package/node_modules/highlight.js/scss/atelier-estuary-dark.scss +0 -84
  767. package/node_modules/highlight.js/scss/atelier-estuary-light.scss +0 -84
  768. package/node_modules/highlight.js/scss/atelier-forest-dark.scss +0 -69
  769. package/node_modules/highlight.js/scss/atelier-forest-light.scss +0 -69
  770. package/node_modules/highlight.js/scss/atelier-heath-dark.scss +0 -69
  771. package/node_modules/highlight.js/scss/atelier-heath-light.scss +0 -69
  772. package/node_modules/highlight.js/scss/atelier-lakeside-dark.scss +0 -69
  773. package/node_modules/highlight.js/scss/atelier-lakeside-light.scss +0 -69
  774. package/node_modules/highlight.js/scss/atelier-plateau-dark.scss +0 -84
  775. package/node_modules/highlight.js/scss/atelier-plateau-light.scss +0 -84
  776. package/node_modules/highlight.js/scss/atelier-savanna-dark.scss +0 -84
  777. package/node_modules/highlight.js/scss/atelier-savanna-light.scss +0 -84
  778. package/node_modules/highlight.js/scss/atelier-seaside-dark.scss +0 -69
  779. package/node_modules/highlight.js/scss/atelier-seaside-light.scss +0 -69
  780. package/node_modules/highlight.js/scss/atelier-sulphurpool-dark.scss +0 -69
  781. package/node_modules/highlight.js/scss/atelier-sulphurpool-light.scss +0 -69
  782. package/node_modules/highlight.js/scss/atom-one-dark-reasonable.scss +0 -75
  783. package/node_modules/highlight.js/scss/atom-one-dark.scss +0 -96
  784. package/node_modules/highlight.js/scss/atom-one-light.scss +0 -96
  785. package/node_modules/highlight.js/scss/brown-paper.scss +0 -64
  786. package/node_modules/highlight.js/scss/brown-papersq.png +0 -0
  787. package/node_modules/highlight.js/scss/codepen-embed.scss +0 -60
  788. package/node_modules/highlight.js/scss/color-brewer.scss +0 -71
  789. package/node_modules/highlight.js/scss/darcula.scss +0 -74
  790. package/node_modules/highlight.js/scss/dark.scss +0 -63
  791. package/node_modules/highlight.js/scss/default.scss +0 -99
  792. package/node_modules/highlight.js/scss/docco.scss +0 -97
  793. package/node_modules/highlight.js/scss/dracula.scss +0 -76
  794. package/node_modules/highlight.js/scss/far.scss +0 -71
  795. package/node_modules/highlight.js/scss/foundation.scss +0 -89
  796. package/node_modules/highlight.js/scss/github-gist.scss +0 -79
  797. package/node_modules/highlight.js/scss/github.scss +0 -99
  798. package/node_modules/highlight.js/scss/gml.scss +0 -78
  799. package/node_modules/highlight.js/scss/googlecode.scss +0 -89
  800. package/node_modules/highlight.js/scss/gradient-dark.scss +0 -122
  801. package/node_modules/highlight.js/scss/gradient-light.scss +0 -130
  802. package/node_modules/highlight.js/scss/grayscale.scss +0 -101
  803. package/node_modules/highlight.js/scss/gruvbox-dark.scss +0 -108
  804. package/node_modules/highlight.js/scss/gruvbox-light.scss +0 -108
  805. package/node_modules/highlight.js/scss/hopscotch.scss +0 -84
  806. package/node_modules/highlight.js/scss/hybrid.scss +0 -102
  807. package/node_modules/highlight.js/scss/idea.scss +0 -97
  808. package/node_modules/highlight.js/scss/ir-black.scss +0 -73
  809. package/node_modules/highlight.js/scss/isbl-editor-dark.scss +0 -112
  810. package/node_modules/highlight.js/scss/isbl-editor-light.scss +0 -111
  811. package/node_modules/highlight.js/scss/kimbie.dark.scss +0 -74
  812. package/node_modules/highlight.js/scss/kimbie.light.scss +0 -74
  813. package/node_modules/highlight.js/scss/lightfair.scss +0 -88
  814. package/node_modules/highlight.js/scss/lioshi.scss +0 -88
  815. package/node_modules/highlight.js/scss/magula.scss +0 -70
  816. package/node_modules/highlight.js/scss/mono-blue.scss +0 -56
  817. package/node_modules/highlight.js/scss/monokai-sublime.scss +0 -83
  818. package/node_modules/highlight.js/scss/monokai.scss +0 -71
  819. package/node_modules/highlight.js/scss/night-owl.scss +0 -182
  820. package/node_modules/highlight.js/scss/nnfx-dark.scss +0 -106
  821. package/node_modules/highlight.js/scss/nnfx.scss +0 -106
  822. package/node_modules/highlight.js/scss/nord.scss +0 -309
  823. package/node_modules/highlight.js/scss/obsidian.scss +0 -88
  824. package/node_modules/highlight.js/scss/ocean.scss +0 -74
  825. package/node_modules/highlight.js/scss/paraiso-dark.scss +0 -72
  826. package/node_modules/highlight.js/scss/paraiso-light.scss +0 -72
  827. package/node_modules/highlight.js/scss/pojoaque.jpg +0 -0
  828. package/node_modules/highlight.js/scss/pojoaque.scss +0 -83
  829. package/node_modules/highlight.js/scss/purebasic.scss +0 -96
  830. package/node_modules/highlight.js/scss/qtcreator_dark.scss +0 -83
  831. package/node_modules/highlight.js/scss/qtcreator_light.scss +0 -83
  832. package/node_modules/highlight.js/scss/railscasts.scss +0 -106
  833. package/node_modules/highlight.js/scss/rainbow.scss +0 -85
  834. package/node_modules/highlight.js/scss/routeros.scss +0 -108
  835. package/node_modules/highlight.js/scss/school-book.png +0 -0
  836. package/node_modules/highlight.js/scss/school-book.scss +0 -69
  837. package/node_modules/highlight.js/scss/shades-of-purple.scss +0 -96
  838. package/node_modules/highlight.js/scss/solarized-dark.scss +0 -84
  839. package/node_modules/highlight.js/scss/solarized-light.scss +0 -84
  840. package/node_modules/highlight.js/scss/srcery.scss +0 -78
  841. package/node_modules/highlight.js/scss/stackoverflow-dark.scss +0 -78
  842. package/node_modules/highlight.js/scss/stackoverflow-light.scss +0 -78
  843. package/node_modules/highlight.js/scss/sunburst.scss +0 -102
  844. package/node_modules/highlight.js/scss/tomorrow-night-blue.scss +0 -75
  845. package/node_modules/highlight.js/scss/tomorrow-night-bright.scss +0 -74
  846. package/node_modules/highlight.js/scss/tomorrow-night-eighties.scss +0 -74
  847. package/node_modules/highlight.js/scss/tomorrow-night.scss +0 -75
  848. package/node_modules/highlight.js/scss/tomorrow.scss +0 -72
  849. package/node_modules/highlight.js/scss/vs.scss +0 -68
  850. package/node_modules/highlight.js/scss/vs2015.scss +0 -115
  851. package/node_modules/highlight.js/scss/xcode.scss +0 -104
  852. package/node_modules/highlight.js/scss/xt256.scss +0 -92
  853. package/node_modules/highlight.js/scss/zenburn.scss +0 -80
  854. package/node_modules/highlight.js/styles/a11y-dark.css +0 -99
  855. package/node_modules/highlight.js/styles/a11y-light.css +0 -99
  856. package/node_modules/highlight.js/styles/agate.css +0 -108
  857. package/node_modules/highlight.js/styles/an-old-hope.css +0 -89
  858. package/node_modules/highlight.js/styles/androidstudio.css +0 -66
  859. package/node_modules/highlight.js/styles/arduino-light.css +0 -87
  860. package/node_modules/highlight.js/styles/arta.css +0 -73
  861. package/node_modules/highlight.js/styles/ascetic.css +0 -45
  862. package/node_modules/highlight.js/styles/atelier-cave-dark.css +0 -83
  863. package/node_modules/highlight.js/styles/atelier-cave-light.css +0 -85
  864. package/node_modules/highlight.js/styles/atelier-dune-dark.css +0 -69
  865. package/node_modules/highlight.js/styles/atelier-dune-light.css +0 -69
  866. package/node_modules/highlight.js/styles/atelier-estuary-dark.css +0 -84
  867. package/node_modules/highlight.js/styles/atelier-estuary-light.css +0 -84
  868. package/node_modules/highlight.js/styles/atelier-forest-dark.css +0 -69
  869. package/node_modules/highlight.js/styles/atelier-forest-light.css +0 -69
  870. package/node_modules/highlight.js/styles/atelier-heath-dark.css +0 -69
  871. package/node_modules/highlight.js/styles/atelier-heath-light.css +0 -69
  872. package/node_modules/highlight.js/styles/atelier-lakeside-dark.css +0 -69
  873. package/node_modules/highlight.js/styles/atelier-lakeside-light.css +0 -69
  874. package/node_modules/highlight.js/styles/atelier-plateau-dark.css +0 -84
  875. package/node_modules/highlight.js/styles/atelier-plateau-light.css +0 -84
  876. package/node_modules/highlight.js/styles/atelier-savanna-dark.css +0 -84
  877. package/node_modules/highlight.js/styles/atelier-savanna-light.css +0 -84
  878. package/node_modules/highlight.js/styles/atelier-seaside-dark.css +0 -69
  879. package/node_modules/highlight.js/styles/atelier-seaside-light.css +0 -69
  880. package/node_modules/highlight.js/styles/atelier-sulphurpool-dark.css +0 -69
  881. package/node_modules/highlight.js/styles/atelier-sulphurpool-light.css +0 -69
  882. package/node_modules/highlight.js/styles/atom-one-dark-reasonable.css +0 -75
  883. package/node_modules/highlight.js/styles/atom-one-dark.css +0 -96
  884. package/node_modules/highlight.js/styles/atom-one-light.css +0 -96
  885. package/node_modules/highlight.js/styles/brown-paper.css +0 -64
  886. package/node_modules/highlight.js/styles/brown-papersq.png +0 -0
  887. package/node_modules/highlight.js/styles/codepen-embed.css +0 -60
  888. package/node_modules/highlight.js/styles/color-brewer.css +0 -71
  889. package/node_modules/highlight.js/styles/darcula.css +0 -74
  890. package/node_modules/highlight.js/styles/dark.css +0 -63
  891. package/node_modules/highlight.js/styles/default.css +0 -99
  892. package/node_modules/highlight.js/styles/docco.css +0 -97
  893. package/node_modules/highlight.js/styles/dracula.css +0 -76
  894. package/node_modules/highlight.js/styles/far.css +0 -71
  895. package/node_modules/highlight.js/styles/foundation.css +0 -89
  896. package/node_modules/highlight.js/styles/github-gist.css +0 -79
  897. package/node_modules/highlight.js/styles/github.css +0 -99
  898. package/node_modules/highlight.js/styles/gml.css +0 -78
  899. package/node_modules/highlight.js/styles/googlecode.css +0 -89
  900. package/node_modules/highlight.js/styles/gradient-dark.css +0 -122
  901. package/node_modules/highlight.js/styles/gradient-light.css +0 -130
  902. package/node_modules/highlight.js/styles/grayscale.css +0 -101
  903. package/node_modules/highlight.js/styles/gruvbox-dark.css +0 -108
  904. package/node_modules/highlight.js/styles/gruvbox-light.css +0 -108
  905. package/node_modules/highlight.js/styles/hopscotch.css +0 -84
  906. package/node_modules/highlight.js/styles/hybrid.css +0 -102
  907. package/node_modules/highlight.js/styles/idea.css +0 -97
  908. package/node_modules/highlight.js/styles/ir-black.css +0 -73
  909. package/node_modules/highlight.js/styles/isbl-editor-dark.css +0 -112
  910. package/node_modules/highlight.js/styles/isbl-editor-light.css +0 -111
  911. package/node_modules/highlight.js/styles/kimbie.dark.css +0 -74
  912. package/node_modules/highlight.js/styles/kimbie.light.css +0 -74
  913. package/node_modules/highlight.js/styles/lightfair.css +0 -88
  914. package/node_modules/highlight.js/styles/lioshi.css +0 -88
  915. package/node_modules/highlight.js/styles/magula.css +0 -70
  916. package/node_modules/highlight.js/styles/mono-blue.css +0 -56
  917. package/node_modules/highlight.js/styles/monokai-sublime.css +0 -83
  918. package/node_modules/highlight.js/styles/monokai.css +0 -71
  919. package/node_modules/highlight.js/styles/night-owl.css +0 -182
  920. package/node_modules/highlight.js/styles/nnfx-dark.css +0 -106
  921. package/node_modules/highlight.js/styles/nnfx.css +0 -106
  922. package/node_modules/highlight.js/styles/nord.css +0 -309
  923. package/node_modules/highlight.js/styles/obsidian.css +0 -88
  924. package/node_modules/highlight.js/styles/ocean.css +0 -74
  925. package/node_modules/highlight.js/styles/paraiso-dark.css +0 -72
  926. package/node_modules/highlight.js/styles/paraiso-light.css +0 -72
  927. package/node_modules/highlight.js/styles/pojoaque.css +0 -83
  928. package/node_modules/highlight.js/styles/pojoaque.jpg +0 -0
  929. package/node_modules/highlight.js/styles/purebasic.css +0 -96
  930. package/node_modules/highlight.js/styles/qtcreator_dark.css +0 -83
  931. package/node_modules/highlight.js/styles/qtcreator_light.css +0 -83
  932. package/node_modules/highlight.js/styles/railscasts.css +0 -106
  933. package/node_modules/highlight.js/styles/rainbow.css +0 -85
  934. package/node_modules/highlight.js/styles/routeros.css +0 -108
  935. package/node_modules/highlight.js/styles/school-book.css +0 -69
  936. package/node_modules/highlight.js/styles/school-book.png +0 -0
  937. package/node_modules/highlight.js/styles/shades-of-purple.css +0 -96
  938. package/node_modules/highlight.js/styles/solarized-dark.css +0 -84
  939. package/node_modules/highlight.js/styles/solarized-light.css +0 -84
  940. package/node_modules/highlight.js/styles/srcery.css +0 -78
  941. package/node_modules/highlight.js/styles/stackoverflow-dark.css +0 -78
  942. package/node_modules/highlight.js/styles/stackoverflow-light.css +0 -78
  943. package/node_modules/highlight.js/styles/sunburst.css +0 -102
  944. package/node_modules/highlight.js/styles/tomorrow-night-blue.css +0 -75
  945. package/node_modules/highlight.js/styles/tomorrow-night-bright.css +0 -74
  946. package/node_modules/highlight.js/styles/tomorrow-night-eighties.css +0 -74
  947. package/node_modules/highlight.js/styles/tomorrow-night.css +0 -75
  948. package/node_modules/highlight.js/styles/tomorrow.css +0 -72
  949. package/node_modules/highlight.js/styles/vs.css +0 -68
  950. package/node_modules/highlight.js/styles/vs2015.css +0 -115
  951. package/node_modules/highlight.js/styles/xcode.css +0 -104
  952. package/node_modules/highlight.js/styles/xt256.css +0 -92
  953. package/node_modules/highlight.js/styles/zenburn.css +0 -80
  954. package/node_modules/highlight.js/types/index.d.ts +0 -261
  955. package/node_modules/is-fullwidth-code-point/index.d.ts +0 -17
  956. package/node_modules/is-fullwidth-code-point/index.js +0 -50
  957. package/node_modules/is-fullwidth-code-point/license +0 -9
  958. package/node_modules/is-fullwidth-code-point/package.json +0 -42
  959. package/node_modules/is-fullwidth-code-point/readme.md +0 -39
  960. package/node_modules/mz/HISTORY.md +0 -66
  961. package/node_modules/mz/LICENSE +0 -22
  962. package/node_modules/mz/README.md +0 -106
  963. package/node_modules/mz/child_process.js +0 -8
  964. package/node_modules/mz/crypto.js +0 -9
  965. package/node_modules/mz/dns.js +0 -16
  966. package/node_modules/mz/fs.js +0 -62
  967. package/node_modules/mz/index.js +0 -8
  968. package/node_modules/mz/package.json +0 -44
  969. package/node_modules/mz/readline.js +0 -64
  970. package/node_modules/mz/zlib.js +0 -13
  971. package/node_modules/object-assign/index.js +0 -90
  972. package/node_modules/object-assign/license +0 -21
  973. package/node_modules/object-assign/package.json +0 -42
  974. package/node_modules/object-assign/readme.md +0 -61
  975. package/node_modules/parse5/LICENSE +0 -19
  976. package/node_modules/parse5/README.md +0 -38
  977. package/node_modules/parse5/lib/common/doctype.js +0 -162
  978. package/node_modules/parse5/lib/common/error-codes.js +0 -65
  979. package/node_modules/parse5/lib/common/foreign-content.js +0 -265
  980. package/node_modules/parse5/lib/common/html.js +0 -272
  981. package/node_modules/parse5/lib/common/unicode.js +0 -109
  982. package/node_modules/parse5/lib/extensions/error-reporting/mixin-base.js +0 -43
  983. package/node_modules/parse5/lib/extensions/error-reporting/parser-mixin.js +0 -52
  984. package/node_modules/parse5/lib/extensions/error-reporting/preprocessor-mixin.js +0 -24
  985. package/node_modules/parse5/lib/extensions/error-reporting/tokenizer-mixin.js +0 -17
  986. package/node_modules/parse5/lib/extensions/location-info/open-element-stack-mixin.js +0 -35
  987. package/node_modules/parse5/lib/extensions/location-info/parser-mixin.js +0 -222
  988. package/node_modules/parse5/lib/extensions/location-info/tokenizer-mixin.js +0 -146
  989. package/node_modules/parse5/lib/extensions/position-tracking/preprocessor-mixin.js +0 -64
  990. package/node_modules/parse5/lib/index.js +0 -29
  991. package/node_modules/parse5/lib/parser/formatting-element-list.js +0 -181
  992. package/node_modules/parse5/lib/parser/index.js +0 -2956
  993. package/node_modules/parse5/lib/parser/open-element-stack.js +0 -482
  994. package/node_modules/parse5/lib/serializer/index.js +0 -176
  995. package/node_modules/parse5/lib/tokenizer/index.js +0 -2196
  996. package/node_modules/parse5/lib/tokenizer/named-entity-data.js +0 -5
  997. package/node_modules/parse5/lib/tokenizer/preprocessor.js +0 -159
  998. package/node_modules/parse5/lib/tree-adapters/default.js +0 -217
  999. package/node_modules/parse5/lib/utils/merge-options.js +0 -13
  1000. package/node_modules/parse5/lib/utils/mixin.js +0 -39
  1001. package/node_modules/parse5/package.json +0 -35
  1002. package/node_modules/parse5-htmlparser2-tree-adapter/LICENSE +0 -19
  1003. package/node_modules/parse5-htmlparser2-tree-adapter/README.md +0 -34
  1004. package/node_modules/parse5-htmlparser2-tree-adapter/lib/index.js +0 -348
  1005. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/LICENSE +0 -19
  1006. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/README.md +0 -38
  1007. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/common/doctype.js +0 -162
  1008. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/common/error-codes.js +0 -65
  1009. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/common/foreign-content.js +0 -265
  1010. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/common/html.js +0 -272
  1011. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/common/unicode.js +0 -109
  1012. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/extensions/error-reporting/mixin-base.js +0 -43
  1013. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/extensions/error-reporting/parser-mixin.js +0 -52
  1014. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/extensions/error-reporting/preprocessor-mixin.js +0 -24
  1015. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/extensions/error-reporting/tokenizer-mixin.js +0 -17
  1016. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/extensions/location-info/open-element-stack-mixin.js +0 -35
  1017. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/extensions/location-info/parser-mixin.js +0 -223
  1018. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/extensions/location-info/tokenizer-mixin.js +0 -146
  1019. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/extensions/position-tracking/preprocessor-mixin.js +0 -64
  1020. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/index.js +0 -29
  1021. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/parser/formatting-element-list.js +0 -181
  1022. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/parser/index.js +0 -2956
  1023. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/parser/open-element-stack.js +0 -482
  1024. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/serializer/index.js +0 -176
  1025. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/tokenizer/index.js +0 -2196
  1026. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/tokenizer/named-entity-data.js +0 -5
  1027. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/tokenizer/preprocessor.js +0 -159
  1028. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/tree-adapters/default.js +0 -221
  1029. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/utils/merge-options.js +0 -13
  1030. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/lib/utils/mixin.js +0 -39
  1031. package/node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5/package.json +0 -35
  1032. package/node_modules/parse5-htmlparser2-tree-adapter/package.json +0 -27
  1033. package/node_modules/proper-lockfile/CHANGELOG.md +0 -108
  1034. package/node_modules/require-directory/.jshintrc +0 -67
  1035. package/node_modules/require-directory/.npmignore +0 -1
  1036. package/node_modules/require-directory/.travis.yml +0 -3
  1037. package/node_modules/require-directory/LICENSE +0 -22
  1038. package/node_modules/require-directory/README.markdown +0 -184
  1039. package/node_modules/require-directory/index.js +0 -86
  1040. package/node_modules/require-directory/package.json +0 -40
  1041. package/node_modules/source-map/CHANGELOG.md +0 -301
  1042. package/node_modules/string-width/index.d.ts +0 -29
  1043. package/node_modules/string-width/index.js +0 -47
  1044. package/node_modules/string-width/license +0 -9
  1045. package/node_modules/string-width/node_modules/ansi-regex/index.d.ts +0 -37
  1046. package/node_modules/string-width/node_modules/ansi-regex/index.js +0 -10
  1047. package/node_modules/string-width/node_modules/ansi-regex/license +0 -9
  1048. package/node_modules/string-width/node_modules/ansi-regex/package.json +0 -55
  1049. package/node_modules/string-width/node_modules/ansi-regex/readme.md +0 -78
  1050. package/node_modules/string-width/node_modules/strip-ansi/index.d.ts +0 -17
  1051. package/node_modules/string-width/node_modules/strip-ansi/index.js +0 -4
  1052. package/node_modules/string-width/node_modules/strip-ansi/license +0 -9
  1053. package/node_modules/string-width/node_modules/strip-ansi/package.json +0 -54
  1054. package/node_modules/string-width/node_modules/strip-ansi/readme.md +0 -46
  1055. package/node_modules/string-width/package.json +0 -56
  1056. package/node_modules/string-width/readme.md +0 -50
  1057. package/node_modules/supports-color/browser.js +0 -5
  1058. package/node_modules/supports-color/index.js +0 -135
  1059. package/node_modules/supports-color/license +0 -9
  1060. package/node_modules/supports-color/package.json +0 -53
  1061. package/node_modules/supports-color/readme.md +0 -76
  1062. package/node_modules/thenify/History.md +0 -11
  1063. package/node_modules/thenify/LICENSE +0 -22
  1064. package/node_modules/thenify/README.md +0 -120
  1065. package/node_modules/thenify/index.js +0 -77
  1066. package/node_modules/thenify/package.json +0 -31
  1067. package/node_modules/thenify-all/History.md +0 -11
  1068. package/node_modules/thenify-all/LICENSE +0 -22
  1069. package/node_modules/thenify-all/README.md +0 -66
  1070. package/node_modules/thenify-all/index.js +0 -73
  1071. package/node_modules/thenify-all/package.json +0 -34
  1072. package/node_modules/wrap-ansi/index.js +0 -216
  1073. package/node_modules/wrap-ansi/license +0 -9
  1074. package/node_modules/wrap-ansi/node_modules/ansi-regex/index.d.ts +0 -37
  1075. package/node_modules/wrap-ansi/node_modules/ansi-regex/index.js +0 -10
  1076. package/node_modules/wrap-ansi/node_modules/ansi-regex/license +0 -9
  1077. package/node_modules/wrap-ansi/node_modules/ansi-regex/package.json +0 -55
  1078. package/node_modules/wrap-ansi/node_modules/ansi-regex/readme.md +0 -78
  1079. package/node_modules/wrap-ansi/node_modules/strip-ansi/index.d.ts +0 -17
  1080. package/node_modules/wrap-ansi/node_modules/strip-ansi/index.js +0 -4
  1081. package/node_modules/wrap-ansi/node_modules/strip-ansi/license +0 -9
  1082. package/node_modules/wrap-ansi/node_modules/strip-ansi/package.json +0 -54
  1083. package/node_modules/wrap-ansi/node_modules/strip-ansi/readme.md +0 -46
  1084. package/node_modules/wrap-ansi/package.json +0 -62
  1085. package/node_modules/wrap-ansi/readme.md +0 -91
  1086. package/node_modules/y18n/CHANGELOG.md +0 -100
  1087. package/node_modules/y18n/LICENSE +0 -13
  1088. package/node_modules/y18n/README.md +0 -127
  1089. package/node_modules/y18n/build/index.cjs +0 -203
  1090. package/node_modules/y18n/build/lib/cjs.js +0 -6
  1091. package/node_modules/y18n/build/lib/index.js +0 -174
  1092. package/node_modules/y18n/build/lib/platform-shims/node.js +0 -19
  1093. package/node_modules/y18n/index.mjs +0 -8
  1094. package/node_modules/y18n/package.json +0 -70
  1095. package/node_modules/yargs/CHANGELOG.md +0 -88
  1096. package/node_modules/yargs/LICENSE +0 -21
  1097. package/node_modules/yargs/README.md +0 -202
  1098. package/node_modules/yargs/browser.mjs +0 -7
  1099. package/node_modules/yargs/build/index.cjs +0 -2920
  1100. package/node_modules/yargs/build/lib/argsert.js +0 -62
  1101. package/node_modules/yargs/build/lib/command.js +0 -382
  1102. package/node_modules/yargs/build/lib/completion-templates.js +0 -47
  1103. package/node_modules/yargs/build/lib/completion.js +0 -128
  1104. package/node_modules/yargs/build/lib/middleware.js +0 -53
  1105. package/node_modules/yargs/build/lib/parse-command.js +0 -32
  1106. package/node_modules/yargs/build/lib/typings/common-types.js +0 -9
  1107. package/node_modules/yargs/build/lib/typings/yargs-parser-types.js +0 -1
  1108. package/node_modules/yargs/build/lib/usage.js +0 -548
  1109. package/node_modules/yargs/build/lib/utils/apply-extends.js +0 -59
  1110. package/node_modules/yargs/build/lib/utils/is-promise.js +0 -5
  1111. package/node_modules/yargs/build/lib/utils/levenshtein.js +0 -26
  1112. package/node_modules/yargs/build/lib/utils/obj-filter.js +0 -10
  1113. package/node_modules/yargs/build/lib/utils/process-argv.js +0 -17
  1114. package/node_modules/yargs/build/lib/utils/set-blocking.js +0 -12
  1115. package/node_modules/yargs/build/lib/utils/which-module.js +0 -10
  1116. package/node_modules/yargs/build/lib/validation.js +0 -308
  1117. package/node_modules/yargs/build/lib/yargs-factory.js +0 -1143
  1118. package/node_modules/yargs/build/lib/yerror.js +0 -7
  1119. package/node_modules/yargs/helpers/helpers.mjs +0 -10
  1120. package/node_modules/yargs/helpers/index.js +0 -14
  1121. package/node_modules/yargs/helpers/package.json +0 -3
  1122. package/node_modules/yargs/index.cjs +0 -39
  1123. package/node_modules/yargs/index.mjs +0 -8
  1124. package/node_modules/yargs/lib/platform-shims/browser.mjs +0 -92
  1125. package/node_modules/yargs/lib/platform-shims/esm.mjs +0 -67
  1126. package/node_modules/yargs/locales/be.json +0 -46
  1127. package/node_modules/yargs/locales/de.json +0 -46
  1128. package/node_modules/yargs/locales/en.json +0 -51
  1129. package/node_modules/yargs/locales/es.json +0 -46
  1130. package/node_modules/yargs/locales/fi.json +0 -49
  1131. package/node_modules/yargs/locales/fr.json +0 -53
  1132. package/node_modules/yargs/locales/hi.json +0 -49
  1133. package/node_modules/yargs/locales/hu.json +0 -46
  1134. package/node_modules/yargs/locales/id.json +0 -50
  1135. package/node_modules/yargs/locales/it.json +0 -46
  1136. package/node_modules/yargs/locales/ja.json +0 -51
  1137. package/node_modules/yargs/locales/ko.json +0 -49
  1138. package/node_modules/yargs/locales/nb.json +0 -44
  1139. package/node_modules/yargs/locales/nl.json +0 -49
  1140. package/node_modules/yargs/locales/nn.json +0 -44
  1141. package/node_modules/yargs/locales/pirate.json +0 -13
  1142. package/node_modules/yargs/locales/pl.json +0 -49
  1143. package/node_modules/yargs/locales/pt.json +0 -45
  1144. package/node_modules/yargs/locales/pt_BR.json +0 -48
  1145. package/node_modules/yargs/locales/ru.json +0 -46
  1146. package/node_modules/yargs/locales/th.json +0 -46
  1147. package/node_modules/yargs/locales/tr.json +0 -48
  1148. package/node_modules/yargs/locales/zh_CN.json +0 -48
  1149. package/node_modules/yargs/locales/zh_TW.json +0 -47
  1150. package/node_modules/yargs/package.json +0 -122
  1151. package/node_modules/yargs/yargs +0 -9
  1152. package/node_modules/yargs-parser/CHANGELOG.md +0 -263
  1153. package/node_modules/yargs-parser/LICENSE.txt +0 -14
  1154. package/node_modules/yargs-parser/README.md +0 -518
  1155. package/node_modules/yargs-parser/browser.js +0 -29
  1156. package/node_modules/yargs-parser/build/index.cjs +0 -1042
  1157. package/node_modules/yargs-parser/build/lib/index.js +0 -59
  1158. package/node_modules/yargs-parser/build/lib/string-utils.js +0 -65
  1159. package/node_modules/yargs-parser/build/lib/tokenize-arg-string.js +0 -40
  1160. package/node_modules/yargs-parser/build/lib/yargs-parser-types.js +0 -12
  1161. package/node_modules/yargs-parser/build/lib/yargs-parser.js +0 -1037
  1162. package/node_modules/yargs-parser/package.json +0 -87
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/lsp/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,MAAM,MAAM,SAAS,CAAC;AAClC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EACN,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EAEjB,WAAW,EACX,WAAW,EACX,cAAc,EACd,iBAAiB,GACjB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,iBAAiB,EAAkB,UAAU,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAYN,SAAS,GAIT,MAAM,YAAY,CAAC;AACpB,OAAO,EACN,eAAe,EACf,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,SAAS,EACT,sBAAsB,EACtB,gBAAgB,EAChB,gBAAgB,EAChB,wBAAwB,EACxB,oBAAoB,EACpB,+BAA+B,EAC/B,cAAc,EACd,uB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ACvB,IAAI,GAAG,YAAY,cAAc,IAAI,MAAM,EAAE,OAAO,EAAE,CAAC;oBACtD,MAAM,IAAI,cAAc,EAAE,CAAC;gBAC5B,CAAC;gBACD,MAAM,YAAY,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;gBACtE,OAAO;oBACN,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,YAAY,EAAE,EAAE,CAAC;oBAC/D,OAAO,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE;iBAChE,CAAC;YACH,CAAC;QACF,CAAC;KACD,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,aAAa,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC","sourcesContent":["import * as fs from \"node:fs\";\nimport * as fsSync from \"node:fs\";\nimport * as path from \"node:path\";\nimport { spawn } from \"node:child_process\";\nimport { fileURLToPath } from \"node:url\";\nimport type { AgentTool, AgentToolResult, AgentToolUpdateCallback } from \"@gsd/pi-agent-core\";\nimport {\n\tensureFileOpen,\n\tgetActiveClients,\n\tgetOrCreateClient,\n\ttype LspServerStatus,\n\trefreshFile,\n\tsendRequest,\n\tsetIdleTimeout,\n\tWARMUP_TIMEOUT_MS,\n} from \"./client.js\";\nimport { getServersForFile, type LspConfig, loadConfig } from \"./config.js\";\nimport { applyWorkspaceEdit } from \"./edits.js\";\nimport { ToolAbortError, clampTimeout, throwIfAborted } from \"./helpers.js\";\nimport { detectLspmux } from \"./lspmux.js\";\nimport {\n\ttype CodeAction,\n\ttype CodeActionContext,\n\ttype Command,\n\ttype Diagnostic,\n\ttype DocumentSymbol,\n\ttype Hover,\n\ttype Location,\n\ttype LocationLink,\n\ttype LspClient,\n\ttype LspParams,\n\ttype LspToolDetails,\n\tlspSchema,\n\ttype ServerConfig,\n\ttype SymbolInformation,\n\ttype WorkspaceEdit,\n} from \"./types.js\";\nimport {\n\tapplyCodeAction,\n\tcollectGlobMatches,\n\tdedupeWorkspaceSymbols,\n\textractHoverText,\n\tfileToUri,\n\tfilterWorkspaceSymbols,\n\tformatCodeAction,\n\tformatDiagnostic,\n\tformatDiagnosticsSummary,\n\tformatDocumentSymbol,\n\tformatGroupedDiagnosticMessages,\n\tformatLocation,\n\tformatSymbolInformation,\n\tformatWorkspaceEdit,\n\thasGlobPattern,\n\treadLocationContext,\n\tresolveSymbolColumn,\n\tsortDiagnostics,\n\tsymbolKindToIcon,\n\turiToFile,\n} from \"./utils.js\";\n\nexport type { LspServerStatus } from \"./client.js\";\nexport type { LspToolDetails } from \"./types.js\";\nexport { lspSchema } from \"./types.js\";\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\nconst lspDescription = fsSync.readFileSync(path.join(__dirname, \"lsp.md\"), \"utf-8\");\n\n// =============================================================================\n// Warmup API\n// =============================================================================\n\nexport interface LspWarmupResult {\n\tservers: Array<{\n\t\tname: string;\n\t\tstatus: \"ready\" | \"error\";\n\t\tfileTypes: string[];\n\t\terror?: string;\n\t}>;\n}\n\nexport async function warmupLspServers(cwd: string): Promise<LspWarmupResult> {\n\tconst config = loadConfig(cwd);\n\tsetIdleTimeout(config.idleTimeoutMs);\n\tconst servers: LspWarmupResult[\"servers\"] = [];\n\tconst lspServers = getLspServers(config);\n\n\tconst results = await Promise.allSettled(\n\t\tlspServers.map(async ([name, serverConfig]) => {\n\t\t\tconst client = await getOrCreateClient(serverConfig, cwd, serverConfig.warmupTimeoutMs ?? WARMUP_TIMEOUT_MS);\n\t\t\treturn { name, client, fileTypes: serverConfig.fileTypes };\n\t\t}),\n\t);\n\n\tfor (let i = 0; i < results.length; i++) {\n\t\tconst result = results[i];\n\t\tconst [name, serverConfig] = lspServers[i];\n\t\tif (result.status === \"fulfilled\") {\n\t\t\tservers.push({\n\t\t\t\tname: result.value.name,\n\t\t\t\tstatus: \"ready\",\n\t\t\t\tfileTypes: result.value.fileTypes,\n\t\t\t});\n\t\t} else {\n\t\t\tservers.push({\n\t\t\t\tname,\n\t\t\t\tstatus: \"error\",\n\t\t\t\tfileTypes: serverConfig.fileTypes,\n\t\t\t\terror: result.reason?.message ?? String(result.reason),\n\t\t\t});\n\t\t}\n\t}\n\n\treturn { servers };\n}\n\nexport function getLspStatus(): LspServerStatus[] {\n\treturn getActiveClients();\n}\n\n// =============================================================================\n// Internal Helpers\n// =============================================================================\n\nconst configCache = new Map<string, LspConfig>();\n\nfunction getConfig(cwd: string): LspConfig {\n\tlet config = configCache.get(cwd);\n\tif (!config) {\n\t\tconfig = loadConfig(cwd);\n\t\tsetIdleTimeout(config.idleTimeoutMs);\n\t\tconfigCache.set(cwd, config);\n\t}\n\treturn config;\n}\n\nfunction getLspServers(config: LspConfig): Array<[string, ServerConfig]> {\n\treturn Object.entries(config.servers) as Array<[string, ServerConfig]>;\n}\n\nfunction getLspServersForFile(config: LspConfig, filePath: string): Array<[string, ServerConfig]> {\n\treturn getServersForFile(config, filePath);\n}\n\nfunction getLspServerForFile(config: LspConfig, filePath: string): [string, ServerConfig] | null {\n\tconst servers = getLspServersForFile(config, filePath);\n\treturn servers.length > 0 ? servers[0] : null;\n}\n\nconst DIAGNOSTIC_MESSAGE_LIMIT = 50;\nconst SINGLE_DIAGNOSTICS_WAIT_TIMEOUT_MS = 3000;\nconst BATCH_DIAGNOSTICS_WAIT_TIMEOUT_MS = 400;\nconst MAX_GLOB_DIAGNOSTIC_TARGETS = 20;\nconst WORKSPACE_SYMBOL_LIMIT = 200;\n\nfunction limitDiagnosticMessages(messages: string[]): string[] {\n\tif (messages.length <= DIAGNOSTIC_MESSAGE_LIMIT) {\n\t\treturn messages;\n\t}\n\treturn messages.slice(0, DIAGNOSTIC_MESSAGE_LIMIT);\n}\n\nconst LOCATION_CONTEXT_LINES = 1;\nconst REFERENCE_CONTEXT_LIMIT = 50;\n\nfunction normalizeLocationResult(result: Location | Location[] | LocationLink | LocationLink[] | null): Location[] {\n\tif (!result) return [];\n\tconst raw = Array.isArray(result) ? result : [result];\n\treturn raw.flatMap(loc => {\n\t\tif (\"uri\" in loc) {\n\t\t\treturn [loc as Location];\n\t\t}\n\t\tif (\"targetUri\" in loc) {\n\t\t\tconst link = loc as LocationLink;\n\t\t\treturn [{ uri: link.targetUri, range: link.targetSelectionRange ?? link.targetRange }];\n\t\t}\n\t\treturn [];\n\t});\n}\n\nasync function formatLocationWithContext(location: Location, cwd: string): Promise<string> {\n\tconst header = ` ${formatLocation(location, cwd)}`;\n\tconst context = await readLocationContext(\n\t\turiToFile(location.uri),\n\t\tlocation.range.start.line + 1,\n\t\tLOCATION_CONTEXT_LINES,\n\t);\n\tif (context.length === 0) {\n\t\treturn header;\n\t}\n\treturn `${header}\\n${context.map(lineText => ` ${lineText}`).join(\"\\n\")}`;\n}\n\nasync function reloadServer(client: LspClient, serverName: string, signal?: AbortSignal): Promise<string> {\n\tlet output = `Restarted ${serverName}`;\n\tconst reloadMethods = [\"rust-analyzer/reloadWorkspace\", \"workspace/didChangeConfiguration\"];\n\tfor (const method of reloadMethods) {\n\t\ttry {\n\t\t\tawait sendRequest(client, method, method.includes(\"Configuration\") ? { settings: {} } : null, signal);\n\t\t\toutput = `Reloaded ${serverName}`;\n\t\t\tbreak;\n\t\t} catch {\n\t\t\t// Method not supported, try next\n\t\t}\n\t}\n\tif (output.startsWith(\"Restarted\")) {\n\t\tclient.proc.kill();\n\t}\n\treturn output;\n}\n\nasync function waitForDiagnostics(\n\tclient: LspClient,\n\turi: string,\n\ttimeoutMs = 3000,\n\tsignal?: AbortSignal,\n\tminVersion?: number,\n): Promise<Diagnostic[]> {\n\tconst start = Date.now();\n\twhile (Date.now() - start < timeoutMs) {\n\t\tthrowIfAborted(signal);\n\t\tconst diagnostics = client.diagnostics.get(uri);\n\t\tconst versionOk = minVersion === undefined || client.diagnosticsVersion > minVersion;\n\t\tif (diagnostics !== undefined && versionOk) return diagnostics;\n\t\tawait new Promise<void>(resolve => setTimeout(resolve, 100));\n\t}\n\treturn client.diagnostics.get(uri) ?? [];\n}\n\n// =============================================================================\n// Workspace Diagnostics\n// =============================================================================\n\ninterface ProjectType {\n\ttype: \"rust\" | \"typescript\" | \"go\" | \"python\" | \"unknown\";\n\tcommand?: string[];\n\tdescription: string;\n}\n\nfunction detectProjectType(cwd: string): ProjectType {\n\tif (fs.existsSync(path.join(cwd, \"Cargo.toml\"))) {\n\t\treturn { type: \"rust\", command: [\"cargo\", \"check\", \"--message-format=short\"], description: \"Rust (cargo check)\" };\n\t}\n\tif (fs.existsSync(path.join(cwd, \"tsconfig.json\"))) {\n\t\treturn { type: \"typescript\", command: [\"npx\", \"tsc\", \"--noEmit\"], description: \"TypeScript (tsc --noEmit)\" };\n\t}\n\tif (fs.existsSync(path.join(cwd, \"go.mod\"))) {\n\t\treturn { type: \"go\", command: [\"go\", \"build\", \"./...\"], description: \"Go (go build)\" };\n\t}\n\tif (fs.existsSync(path.join(cwd, \"pyproject.toml\")) || fs.existsSync(path.join(cwd, \"pyrightconfig.json\"))) {\n\t\treturn { type: \"python\", command: [\"pyright\"], description: \"Python (pyright)\" };\n\t}\n\treturn { type: \"unknown\", description: \"Unknown project type\" };\n}\n\nasync function runWorkspaceDiagnostics(\n\tcwd: string,\n\tsignal?: AbortSignal,\n): Promise<{ output: string; projectType: ProjectType }> {\n\tthrowIfAborted(signal);\n\tconst projectType = detectProjectType(cwd);\n\tif (!projectType.command) {\n\t\treturn {\n\t\t\toutput: \"Cannot detect project type. Supported: Rust (Cargo.toml), TypeScript (tsconfig.json), Go (go.mod), Python (pyproject.toml)\",\n\t\t\tprojectType,\n\t\t};\n\t}\n\tconst [cmd, ...cmdArgs] = projectType.command;\n\tconst proc = spawn(cmd, cmdArgs, {\n\t\tcwd,\n\t\tstdio: [\"ignore\", \"pipe\", \"pipe\"],\n\t});\n\tconst abortHandler = () => {\n\t\tproc.kill();\n\t};\n\tif (signal) {\n\t\tsignal.addEventListener(\"abort\", abortHandler, { once: true });\n\t}\n\n\ttry {\n\t\tconst stdoutChunks: Buffer[] = [];\n\t\tconst stderrChunks: Buffer[] = [];\n\n\t\tproc.stdout?.on(\"data\", (chunk: Buffer) => stdoutChunks.push(chunk));\n\t\tproc.stderr?.on(\"data\", (chunk: Buffer) => stderrChunks.push(chunk));\n\n\t\tconst exitCode = await new Promise<number>((resolve) => {\n\t\t\tproc.on(\"exit\", (code: number | null) => resolve(code ?? 1));\n\t\t});\n\n\t\tconst stdout = Buffer.concat(stdoutChunks).toString(\"utf-8\");\n\t\tconst stderr = Buffer.concat(stderrChunks).toString(\"utf-8\");\n\n\t\tthrowIfAborted(signal);\n\t\tconst combined = (stdout + stderr).trim();\n\t\tif (!combined) {\n\t\t\treturn { output: \"No issues found\", projectType };\n\t\t}\n\t\tconst lines = combined.split(\"\\n\");\n\t\tif (lines.length > 50) {\n\t\t\treturn { output: `${lines.slice(0, 50).join(\"\\n\")}\\n... and ${lines.length - 50} more lines`, projectType };\n\t\t}\n\t\treturn { output: combined, projectType };\n\t} catch (e: unknown) {\n\t\tif (signal?.aborted) {\n\t\t\tthrow new ToolAbortError();\n\t\t}\n\t\treturn { output: `Failed to run ${projectType.command.join(\" \")}: ${e}`, projectType };\n\t} finally {\n\t\tsignal?.removeEventListener(\"abort\", abortHandler);\n\t}\n}\n\n// =============================================================================\n// Path Resolution\n// =============================================================================\n\nfunction resolveToCwd(file: string, cwd: string): string {\n\treturn path.resolve(cwd, file);\n}\n\n// =============================================================================\n// Tool Factory\n// =============================================================================\n\n/**\n * Create an LSP tool configured for a specific working directory.\n */\nexport function createLspTool(cwd: string): AgentTool<typeof lspSchema, LspToolDetails> {\n\treturn {\n\t\tname: \"lsp\",\n\t\tlabel: \"LSP\",\n\t\tdescription: lspDescription,\n\t\tparameters: lspSchema,\n\n\t\tasync execute(\n\t\t\t_toolCallId: string,\n\t\t\tparams: LspParams,\n\t\t\tsignal?: AbortSignal,\n\t\t\t_onUpdate?: AgentToolUpdateCallback<LspToolDetails>,\n\t\t): Promise<AgentToolResult<LspToolDetails>> {\n\t\t\tconst { action, file, line, symbol, occurrence, query, new_name, apply, timeout } = params;\n\t\t\tconst timeoutSec = clampTimeout(timeout);\n\t\t\tconst timeoutSignal = AbortSignal.timeout(timeoutSec * 1000);\n\t\t\tsignal = signal ? AbortSignal.any([signal, timeoutSignal]) : timeoutSignal;\n\t\t\tthrowIfAborted(signal);\n\n\t\t\tconst config = getConfig(cwd);\n\n\t\t\t// Status action doesn't need a file\n\t\t\tif (action === \"status\") {\n\t\t\t\tconst servers = Object.keys(config.servers);\n\t\t\t\tconst lspmuxState = await detectLspmux();\n\t\t\t\tconst lspmuxStatus = lspmuxState.available\n\t\t\t\t\t? lspmuxState.running\n\t\t\t\t\t\t? \"lspmux: active (multiplexing enabled)\"\n\t\t\t\t\t\t: \"lspmux: installed but server not running\"\n\t\t\t\t\t: \"\";\n\n\t\t\t\tconst serverStatus =\n\t\t\t\t\tservers.length > 0\n\t\t\t\t\t\t? `Active language servers: ${servers.join(\", \")}`\n\t\t\t\t\t\t: \"No language servers configured for this project\";\n\n\t\t\t\tconst output = lspmuxStatus ? `${serverStatus}\\n${lspmuxStatus}` : serverStatus;\n\t\t\t\treturn {\n\t\t\t\t\tcontent: [{ type: \"text\", text: output }],\n\t\t\t\t\tdetails: { action, success: true, request: params },\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t// Diagnostics can be batch or single-file\n\t\t\tif (action === \"diagnostics\") {\n\t\t\t\tif (!file) {\n\t\t\t\t\tconst result = await runWorkspaceDiagnostics(cwd, signal);\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcontent: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\t\t\ttext: `Workspace diagnostics (${result.projectType.description}):\\n${result.output}`,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t\tdetails: { action, success: true, request: params },\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tlet targets: string[];\n\t\t\t\tlet truncatedGlobTargets = false;\n\t\t\t\tif (hasGlobPattern(file)) {\n\t\t\t\t\tconst globMatches = await collectGlobMatches(file, cwd, MAX_GLOB_DIAGNOSTIC_TARGETS);\n\t\t\t\t\ttargets = globMatches.matches;\n\t\t\t\t\ttruncatedGlobTargets = globMatches.truncated;\n\t\t\t\t} else {\n\t\t\t\t\ttargets = [file];\n\t\t\t\t}\n\n\t\t\t\tif (targets.length === 0) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcontent: [{ type: \"text\", text: `No files matched pattern: ${file}` }],\n\t\t\t\t\t\tdetails: { action, success: true, request: params },\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tconst detailed = targets.length > 1 || truncatedGlobTargets;\n\t\t\t\tconst diagnosticsWaitTimeoutMs = detailed\n\t\t\t\t\t? Math.min(BATCH_DIAGNOSTICS_WAIT_TIMEOUT_MS, timeoutSec * 1000)\n\t\t\t\t\t: Math.min(SINGLE_DIAGNOSTICS_WAIT_TIMEOUT_MS, timeoutSec * 1000);\n\t\t\t\tconst results: string[] = [];\n\t\t\t\tconst allServerNames = new Set<string>();\n\t\t\t\tif (truncatedGlobTargets) {\n\t\t\t\t\tresults.push(\n\t\t\t\t\t\t`[W] Pattern matched more than ${MAX_GLOB_DIAGNOSTIC_TARGETS} files; showing first ${MAX_GLOB_DIAGNOSTIC_TARGETS}. Narrow the glob or use workspace diagnostics.`,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tfor (const target of targets) {\n\t\t\t\t\tthrowIfAborted(signal);\n\t\t\t\t\tconst resolved = resolveToCwd(target, cwd);\n\t\t\t\t\tconst servers = getServersForFile(config, resolved);\n\t\t\t\t\tif (servers.length === 0) {\n\t\t\t\t\t\tresults.push(`[E] ${target}: No language server found`);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst uri = fileToUri(resolved);\n\t\t\t\t\tconst relPath = path.relative(cwd, resolved);\n\t\t\t\t\tconst allDiagnostics: Diagnostic[] = [];\n\n\t\t\t\t\tfor (const [serverName, serverConfig] of servers) {\n\t\t\t\t\t\tallServerNames.add(serverName);\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tthrowIfAborted(signal);\n\t\t\t\t\t\t\tconst client = await getOrCreateClient(serverConfig, cwd);\n\t\t\t\t\t\t\tconst minVersion = client.diagnosticsVersion;\n\t\t\t\t\t\t\tawait refreshFile(client, resolved, signal);\n\t\t\t\t\t\t\tconst diagnostics = await waitForDiagnostics(\n\t\t\t\t\t\t\t\tclient,\n\t\t\t\t\t\t\t\turi,\n\t\t\t\t\t\t\t\tdiagnosticsWaitTimeoutMs,\n\t\t\t\t\t\t\t\tsignal,\n\t\t\t\t\t\t\t\tminVersion,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tallDiagnostics.push(...diagnostics);\n\t\t\t\t\t\t} catch (err: unknown) {\n\t\t\t\t\t\t\tif (err instanceof ToolAbortError || signal?.aborted) {\n\t\t\t\t\t\t\t\tthrow err;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Deduplicate\n\t\t\t\t\tconst seen = new Set<string>();\n\t\t\t\t\tconst uniqueDiagnostics: Diagnostic[] = [];\n\t\t\t\t\tfor (const d of allDiagnostics) {\n\t\t\t\t\t\tconst key = `${d.range.start.line}:${d.range.start.character}:${d.range.end.line}:${d.range.end.character}:${d.message}`;\n\t\t\t\t\t\tif (!seen.has(key)) {\n\t\t\t\t\t\t\tseen.add(key);\n\t\t\t\t\t\t\tuniqueDiagnostics.push(d);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tsortDiagnostics(uniqueDiagnostics);\n\n\t\t\t\t\tif (!detailed && targets.length === 1) {\n\t\t\t\t\t\tif (uniqueDiagnostics.length === 0) {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tcontent: [{ type: \"text\", text: \"No diagnostics\" }],\n\t\t\t\t\t\t\t\tdetails: { action, serverName: Array.from(allServerNames).join(\", \"), success: true },\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst summary = formatDiagnosticsSummary(uniqueDiagnostics);\n\t\t\t\t\t\tconst formatted = uniqueDiagnostics.map(d => formatDiagnostic(d, relPath));\n\t\t\t\t\t\tconst output = `${summary}:\\n${formatGroupedDiagnosticMessages(formatted)}`;\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tcontent: [{ type: \"text\", text: output }],\n\t\t\t\t\t\t\tdetails: { action, serverName: Array.from(allServerNames).join(\", \"), success: true },\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\n\t\t\t\t\tif (uniqueDiagnostics.length === 0) {\n\t\t\t\t\t\tresults.push(`OK ${relPath}: no issues`);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst summary = formatDiagnosticsSummary(uniqueDiagnostics);\n\t\t\t\t\t\tresults.push(`[E] ${relPath}: ${summary}`);\n\t\t\t\t\t\tconst formatted = uniqueDiagnostics.map(d => formatDiagnostic(d, relPath));\n\t\t\t\t\t\tresults.push(formatGroupedDiagnosticMessages(formatted));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\tcontent: [{ type: \"text\", text: results.join(\"\\n\") }],\n\t\t\t\t\tdetails: { action, serverName: Array.from(allServerNames).join(\", \"), success: true },\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst requiresFile = !file && action !== \"symbols\" && action !== \"reload\";\n\n\t\t\tif (requiresFile) {\n\t\t\t\treturn {\n\t\t\t\t\tcontent: [{ type: \"text\", text: \"Error: file parameter required for this action\" }],\n\t\t\t\t\tdetails: { action, success: false },\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst resolvedFile = file ? resolveToCwd(file, cwd) : null;\n\n\t\t\t// Workspace symbol search (no file)\n\t\t\tif (action === \"symbols\" && !resolvedFile) {\n\t\t\t\tconst normalizedQuery = query?.trim();\n\t\t\t\tif (!normalizedQuery) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcontent: [{ type: \"text\", text: \"Error: query parameter required for workspace symbol search\" }],\n\t\t\t\t\t\tdetails: { action, success: false, request: params },\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tconst servers = getLspServers(config);\n\t\t\t\tif (servers.length === 0) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcontent: [{ type: \"text\", text: \"No language server found for this action\" }],\n\t\t\t\t\t\tdetails: { action, success: false, request: params },\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tconst aggregatedSymbols: SymbolInformation[] = [];\n\t\t\t\tconst respondingServers = new Set<string>();\n\t\t\t\tfor (const [workspaceServerName, workspaceServerConfig] of servers) {\n\t\t\t\t\tthrowIfAborted(signal);\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst workspaceClient = await getOrCreateClient(workspaceServerConfig, cwd);\n\t\t\t\t\t\tconst workspaceResult = (await sendRequest(\n\t\t\t\t\t\t\tworkspaceClient,\n\t\t\t\t\t\t\t\"workspace/symbol\",\n\t\t\t\t\t\t\t{ query: normalizedQuery },\n\t\t\t\t\t\t\tsignal,\n\t\t\t\t\t\t)) as SymbolInformation[] | null;\n\t\t\t\t\t\tif (!workspaceResult || workspaceResult.length === 0) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\trespondingServers.add(workspaceServerName);\n\t\t\t\t\t\taggregatedSymbols.push(...filterWorkspaceSymbols(workspaceResult, normalizedQuery));\n\t\t\t\t\t} catch (err: unknown) {\n\t\t\t\t\t\tif (err instanceof ToolAbortError || signal?.aborted) {\n\t\t\t\t\t\t\tthrow err;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst dedupedSymbols = dedupeWorkspaceSymbols(aggregatedSymbols);\n\t\t\t\tif (dedupedSymbols.length === 0) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcontent: [{ type: \"text\", text: `No symbols matching \"${normalizedQuery}\"` }],\n\t\t\t\t\t\tdetails: {\n\t\t\t\t\t\t\taction,\n\t\t\t\t\t\t\tserverName: Array.from(respondingServers).join(\", \"),\n\t\t\t\t\t\t\tsuccess: true,\n\t\t\t\t\t\t\trequest: params,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tconst limitedSymbols = dedupedSymbols.slice(0, WORKSPACE_SYMBOL_LIMIT);\n\t\t\t\tconst lines = limitedSymbols.map(s => formatSymbolInformation(s, cwd));\n\t\t\t\tconst truncationLine =\n\t\t\t\t\tdedupedSymbols.length > WORKSPACE_SYMBOL_LIMIT\n\t\t\t\t\t\t? `\\n... ${dedupedSymbols.length - WORKSPACE_SYMBOL_LIMIT} additional symbol(s) omitted`\n\t\t\t\t\t\t: \"\";\n\t\t\t\treturn {\n\t\t\t\t\tcontent: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\t\ttext: `Found ${dedupedSymbols.length} symbol(s) matching \"${normalizedQuery}\":\\n${lines.map(l => ` ${l}`).join(\"\\n\")}${truncationLine}`,\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\tdetails: {\n\t\t\t\t\t\taction,\n\t\t\t\t\t\tserverName: Array.from(respondingServers).join(\", \"),\n\t\t\t\t\t\tsuccess: true,\n\t\t\t\t\t\trequest: params,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t// Reload all servers (no file)\n\t\t\tif (action === \"reload\" && !resolvedFile) {\n\t\t\t\tconst servers = getLspServers(config);\n\t\t\t\tif (servers.length === 0) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcontent: [{ type: \"text\", text: \"No language server found for this action\" }],\n\t\t\t\t\t\tdetails: { action, success: false, request: params },\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tconst outputs: string[] = [];\n\t\t\t\tfor (const [workspaceServerName, workspaceServerConfig] of servers) {\n\t\t\t\t\tthrowIfAborted(signal);\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst workspaceClient = await getOrCreateClient(workspaceServerConfig, cwd);\n\t\t\t\t\t\toutputs.push(await reloadServer(workspaceClient, workspaceServerName, signal));\n\t\t\t\t\t} catch (err: unknown) {\n\t\t\t\t\t\tif (err instanceof ToolAbortError || signal?.aborted) {\n\t\t\t\t\t\t\tthrow err;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst errorMessage = err instanceof Error ? err.message : String(err);\n\t\t\t\t\t\toutputs.push(`Failed to reload ${workspaceServerName}: ${errorMessage}`);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tcontent: [{ type: \"text\", text: outputs.join(\"\\n\") }],\n\t\t\t\t\tdetails: { action, serverName: servers.map(([name]) => name).join(\", \"), success: true, request: params },\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t// File-specific actions\n\t\t\tconst serverInfo = resolvedFile ? getLspServerForFile(config, resolvedFile) : null;\n\t\t\tif (!serverInfo) {\n\t\t\t\treturn {\n\t\t\t\t\tcontent: [{ type: \"text\", text: \"No language server found for this action\" }],\n\t\t\t\t\tdetails: { action, success: false },\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst [serverName, serverConfig] = serverInfo;\n\n\t\t\ttry {\n\t\t\t\tconst client = await getOrCreateClient(serverConfig, cwd);\n\t\t\t\tconst targetFile = resolvedFile;\n\n\t\t\t\tif (targetFile) {\n\t\t\t\t\tawait ensureFileOpen(client, targetFile, signal);\n\t\t\t\t}\n\n\t\t\t\tconst uri = targetFile ? fileToUri(targetFile) : \"\";\n\t\t\t\tconst resolvedLine = line ?? 1;\n\t\t\t\tconst resolvedCharacter = targetFile\n\t\t\t\t\t? await resolveSymbolColumn(targetFile, resolvedLine, symbol, occurrence)\n\t\t\t\t\t: 0;\n\t\t\t\tconst position = { line: resolvedLine - 1, character: resolvedCharacter };\n\n\t\t\t\tlet output: string;\n\n\t\t\t\tswitch (action) {\n\t\t\t\t\tcase \"definition\": {\n\t\t\t\t\t\tconst result = (await sendRequest(\n\t\t\t\t\t\t\tclient,\n\t\t\t\t\t\t\t\"textDocument/definition\",\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttextDocument: { uri },\n\t\t\t\t\t\t\t\tposition,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tsignal,\n\t\t\t\t\t\t)) as Location | Location[] | LocationLink | LocationLink[] | null;\n\n\t\t\t\t\t\tconst locations = normalizeLocationResult(result);\n\n\t\t\t\t\t\tif (locations.length === 0) {\n\t\t\t\t\t\t\toutput = \"No definition found\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst lines = await Promise.all(\n\t\t\t\t\t\t\t\tlocations.map(location => formatLocationWithContext(location, cwd)),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\toutput = `Found ${locations.length} definition(s):\\n${lines.join(\"\\n\")}`;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tcase \"type_definition\": {\n\t\t\t\t\t\tconst result = (await sendRequest(\n\t\t\t\t\t\t\tclient,\n\t\t\t\t\t\t\t\"textDocument/typeDefinition\",\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttextDocument: { uri },\n\t\t\t\t\t\t\t\tposition,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tsignal,\n\t\t\t\t\t\t)) as Location | Location[] | LocationLink | LocationLink[] | null;\n\n\t\t\t\t\t\tconst locations = normalizeLocationResult(result);\n\n\t\t\t\t\t\tif (locations.length === 0) {\n\t\t\t\t\t\t\toutput = \"No type definition found\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst lines = await Promise.all(\n\t\t\t\t\t\t\t\tlocations.map(location => formatLocationWithContext(location, cwd)),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\toutput = `Found ${locations.length} type definition(s):\\n${lines.join(\"\\n\")}`;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tcase \"implementation\": {\n\t\t\t\t\t\tconst result = (await sendRequest(\n\t\t\t\t\t\t\tclient,\n\t\t\t\t\t\t\t\"textDocument/implementation\",\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttextDocument: { uri },\n\t\t\t\t\t\t\t\tposition,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tsignal,\n\t\t\t\t\t\t)) as Location | Location[] | LocationLink | LocationLink[] | null;\n\n\t\t\t\t\t\tconst locations = normalizeLocationResult(result);\n\n\t\t\t\t\t\tif (locations.length === 0) {\n\t\t\t\t\t\t\toutput = \"No implementation found\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst lines = await Promise.all(\n\t\t\t\t\t\t\t\tlocations.map(location => formatLocationWithContext(location, cwd)),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\toutput = `Found ${locations.length} implementation(s):\\n${lines.join(\"\\n\")}`;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tcase \"references\": {\n\t\t\t\t\t\tconst result = (await sendRequest(\n\t\t\t\t\t\t\tclient,\n\t\t\t\t\t\t\t\"textDocument/references\",\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttextDocument: { uri },\n\t\t\t\t\t\t\t\tposition,\n\t\t\t\t\t\t\t\tcontext: { includeDeclaration: true },\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tsignal,\n\t\t\t\t\t\t)) as Location[] | null;\n\n\t\t\t\t\t\tif (!result || result.length === 0) {\n\t\t\t\t\t\t\toutput = \"No references found\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst contextualReferences = result.slice(0, REFERENCE_CONTEXT_LIMIT);\n\t\t\t\t\t\t\tconst plainReferences = result.slice(REFERENCE_CONTEXT_LIMIT);\n\t\t\t\t\t\t\tconst contextualLines = await Promise.all(\n\t\t\t\t\t\t\t\tcontextualReferences.map(location => formatLocationWithContext(location, cwd)),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tconst plainLines = plainReferences.map(location => ` ${formatLocation(location, cwd)}`);\n\t\t\t\t\t\t\tconst lines = plainLines.length\n\t\t\t\t\t\t\t\t? [\n\t\t\t\t\t\t\t\t\t\t...contextualLines,\n\t\t\t\t\t\t\t\t\t\t` ... ${plainLines.length} additional reference(s) shown without context`,\n\t\t\t\t\t\t\t\t\t\t...plainLines,\n\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t: contextualLines;\n\t\t\t\t\t\t\toutput = `Found ${result.length} reference(s):\\n${lines.join(\"\\n\")}`;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tcase \"hover\": {\n\t\t\t\t\t\tconst result = (await sendRequest(\n\t\t\t\t\t\t\tclient,\n\t\t\t\t\t\t\t\"textDocument/hover\",\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttextDocument: { uri },\n\t\t\t\t\t\t\t\tposition,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tsignal,\n\t\t\t\t\t\t)) as Hover | null;\n\n\t\t\t\t\t\tif (!result || !result.contents) {\n\t\t\t\t\t\t\toutput = \"No hover information\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\toutput = extractHoverText(result.contents);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tcase \"code_actions\": {\n\t\t\t\t\t\tconst diagnostics = client.diagnostics.get(uri) ?? [];\n\t\t\t\t\t\tconst context: CodeActionContext = {\n\t\t\t\t\t\t\tdiagnostics,\n\t\t\t\t\t\t\tonly: !apply && query ? [query] : undefined,\n\t\t\t\t\t\t\ttriggerKind: 1,\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tconst result = (await sendRequest(\n\t\t\t\t\t\t\tclient,\n\t\t\t\t\t\t\t\"textDocument/codeAction\",\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttextDocument: { uri },\n\t\t\t\t\t\t\t\trange: { start: position, end: position },\n\t\t\t\t\t\t\t\tcontext,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tsignal,\n\t\t\t\t\t\t)) as (CodeAction | Command)[] | null;\n\n\t\t\t\t\t\tif (!result || result.length === 0) {\n\t\t\t\t\t\t\toutput = \"No code actions available\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (apply === true && query) {\n\t\t\t\t\t\t\tconst normalizedQuery = query.trim();\n\t\t\t\t\t\t\tif (normalizedQuery.length === 0) {\n\t\t\t\t\t\t\t\toutput = \"Error: query parameter required when apply=true for code_actions\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst parsedIndex = /^\\d+$/.test(normalizedQuery) ? Number.parseInt(normalizedQuery, 10) : null;\n\t\t\t\t\t\t\tconst selectedAction = result.find(\n\t\t\t\t\t\t\t\t(actionItem, index) =>\n\t\t\t\t\t\t\t\t\t(parsedIndex !== null && index === parsedIndex) ||\n\t\t\t\t\t\t\t\t\tactionItem.title.toLowerCase().includes(normalizedQuery.toLowerCase()),\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tif (!selectedAction) {\n\t\t\t\t\t\t\t\tconst actionLines = result.map((actionItem, index) => ` ${formatCodeAction(actionItem, index)}`);\n\t\t\t\t\t\t\t\toutput = `No code action matches \"${normalizedQuery}\". Available actions:\\n${actionLines.join(\"\\n\")}`;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst appliedAction = await applyCodeAction(selectedAction, {\n\t\t\t\t\t\t\t\tresolveCodeAction: async (actionItem: CodeAction) =>\n\t\t\t\t\t\t\t\t\t(await sendRequest(client, \"codeAction/resolve\", actionItem, signal)) as CodeAction,\n\t\t\t\t\t\t\t\tapplyWorkspaceEdit: async (edit: WorkspaceEdit) => applyWorkspaceEdit(edit, cwd),\n\t\t\t\t\t\t\t\texecuteCommand: async (commandItem: Command) => {\n\t\t\t\t\t\t\t\t\tawait sendRequest(\n\t\t\t\t\t\t\t\t\t\tclient,\n\t\t\t\t\t\t\t\t\t\t\"workspace/executeCommand\",\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tcommand: commandItem.command,\n\t\t\t\t\t\t\t\t\t\t\targuments: commandItem.arguments ?? [],\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\tsignal,\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tif (!appliedAction) {\n\t\t\t\t\t\t\t\toutput = `Action \"${selectedAction.title}\" has no workspace edit or command to apply`;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst summaryLines: string[] = [];\n\t\t\t\t\t\t\tif (appliedAction.edits.length > 0) {\n\t\t\t\t\t\t\t\tsummaryLines.push(\" Workspace edit:\");\n\t\t\t\t\t\t\t\tsummaryLines.push(...appliedAction.edits.map(item => ` ${item}`));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (appliedAction.executedCommands.length > 0) {\n\t\t\t\t\t\t\t\tsummaryLines.push(\" Executed command(s):\");\n\t\t\t\t\t\t\t\tsummaryLines.push(...appliedAction.executedCommands.map(commandName => ` ${commandName}`));\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\toutput = `Applied \"${appliedAction.title}\":\\n${summaryLines.join(\"\\n\")}`;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst actionLines = result.map((actionItem, index) => ` ${formatCodeAction(actionItem, index)}`);\n\t\t\t\t\t\toutput = `${result.length} code action(s):\\n${actionLines.join(\"\\n\")}`;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tcase \"symbols\": {\n\t\t\t\t\t\tif (!targetFile) {\n\t\t\t\t\t\t\toutput = \"Error: file parameter required for document symbols\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst result = (await sendRequest(\n\t\t\t\t\t\t\tclient,\n\t\t\t\t\t\t\t\"textDocument/documentSymbol\",\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttextDocument: { uri },\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tsignal,\n\t\t\t\t\t\t)) as (DocumentSymbol | SymbolInformation)[] | null;\n\n\t\t\t\t\t\tif (!result || result.length === 0) {\n\t\t\t\t\t\t\toutput = \"No symbols found\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst relPath = path.relative(cwd, targetFile);\n\t\t\t\t\t\t\tif (\"selectionRange\" in result[0]) {\n\t\t\t\t\t\t\t\tconst lines = (result as DocumentSymbol[]).flatMap(s => formatDocumentSymbol(s));\n\t\t\t\t\t\t\t\toutput = `Symbols in ${relPath}:\\n${lines.join(\"\\n\")}`;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tconst lines = (result as SymbolInformation[]).map(s => {\n\t\t\t\t\t\t\t\t\tconst line = s.location.range.start.line + 1;\n\t\t\t\t\t\t\t\t\tconst icon = symbolKindToIcon(s.kind);\n\t\t\t\t\t\t\t\t\treturn `${icon} ${s.name} @ line ${line}`;\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\toutput = `Symbols in ${relPath}:\\n${lines.join(\"\\n\")}`;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tcase \"rename\": {\n\t\t\t\t\t\tif (!new_name) {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tcontent: [{ type: \"text\", text: \"Error: new_name parameter required for rename\" }],\n\t\t\t\t\t\t\t\tdetails: { action, serverName, success: false },\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst result = (await sendRequest(\n\t\t\t\t\t\t\tclient,\n\t\t\t\t\t\t\t\"textDocument/rename\",\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttextDocument: { uri },\n\t\t\t\t\t\t\t\tposition,\n\t\t\t\t\t\t\t\tnewName: new_name,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tsignal,\n\t\t\t\t\t\t)) as WorkspaceEdit | null;\n\n\t\t\t\t\t\tif (!result) {\n\t\t\t\t\t\t\toutput = \"Rename returned no edits\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst shouldApply = apply !== false;\n\t\t\t\t\t\t\tif (shouldApply) {\n\t\t\t\t\t\t\t\tconst applied = await applyWorkspaceEdit(result, cwd);\n\t\t\t\t\t\t\t\toutput = `Applied rename:\\n${applied.map(a => ` ${a}`).join(\"\\n\")}`;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tconst preview = formatWorkspaceEdit(result, cwd);\n\t\t\t\t\t\t\t\toutput = `Rename preview:\\n${preview.map(p => ` ${p}`).join(\"\\n\")}`;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tcase \"reload\": {\n\t\t\t\t\t\toutput = await reloadServer(client, serverName, signal);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\toutput = `Unknown action: ${action}`;\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\tcontent: [{ type: \"text\", text: output }],\n\t\t\t\t\tdetails: { serverName, action, success: true, request: params },\n\t\t\t\t};\n\t\t\t} catch (err: unknown) {\n\t\t\t\tif (err instanceof ToolAbortError || signal?.aborted) {\n\t\t\t\t\tthrow new ToolAbortError();\n\t\t\t\t}\n\t\t\t\tconst errorMessage = err instanceof Error ? err.message : String(err);\n\t\t\t\treturn {\n\t\t\t\t\tcontent: [{ type: \"text\", text: `LSP error: ${errorMessage}` }],\n\t\t\t\t\tdetails: { serverName, action, success: false, request: params },\n\t\t\t\t};\n\t\t\t}\n\t\t},\n\t};\n}\n\n/**\n * Default LSP tool using process.cwd().\n */\nexport const lspTool = createLspTool(process.cwd());\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=lsp-integration.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lsp-integration.test.d.ts","sourceRoot":"","sources":["../../../src/core/lsp/lsp-integration.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,308 @@
1
+ /**
2
+ * Integration test for the LSP tool port.
3
+ *
4
+ * Spins up typescript-language-server against a temp TypeScript project
5
+ * and exercises: initialize, didOpen, hover, definition, references,
6
+ * documentSymbol, diagnostics, and shutdown.
7
+ *
8
+ * Run: node --experimental-strip-types --test src/core/lsp/lsp-integration.test.ts
9
+ * (from packages/pi-coding-agent/)
10
+ */
11
+ import test from "node:test";
12
+ import assert from "node:assert/strict";
13
+ import { spawn } from "node:child_process";
14
+ import * as fs from "node:fs";
15
+ import * as path from "node:path";
16
+ import * as os from "node:os";
17
+ function encodeMessage(msg) {
18
+ const body = JSON.stringify(msg);
19
+ return `Content-Length: ${Buffer.byteLength(body, "utf-8")}\r\n\r\n${body}`;
20
+ }
21
+ /**
22
+ * Minimal LSP harness: spawns a language server, sends requests, collects responses.
23
+ */
24
+ class LspHarness {
25
+ constructor(command, args, cwd) {
26
+ this.nextId = 1;
27
+ this.buffer = Buffer.alloc(0);
28
+ this.pending = new Map();
29
+ this.notifications = [];
30
+ this.proc = spawn(command, args, {
31
+ cwd,
32
+ stdio: ["pipe", "pipe", "pipe"],
33
+ });
34
+ this.proc.stdout.on("data", (chunk) => {
35
+ this.buffer = Buffer.concat([this.buffer, chunk]);
36
+ this.drain();
37
+ });
38
+ this.proc.stderr.on("data", (chunk) => {
39
+ // Swallow stderr (server logs)
40
+ });
41
+ }
42
+ drain() {
43
+ while (true) {
44
+ const headerEnd = this.findHeaderEnd();
45
+ if (headerEnd === -1)
46
+ return;
47
+ const headerText = this.buffer.subarray(0, headerEnd).toString("utf-8");
48
+ const match = headerText.match(/Content-Length:\s*(\d+)/i);
49
+ if (!match)
50
+ return;
51
+ const contentLength = parseInt(match[1], 10);
52
+ const messageStart = headerEnd + 4; // past \r\n\r\n
53
+ const messageEnd = messageStart + contentLength;
54
+ if (this.buffer.length < messageEnd)
55
+ return;
56
+ const body = this.buffer.subarray(messageStart, messageEnd).toString("utf-8");
57
+ this.buffer = Buffer.from(this.buffer.subarray(messageEnd));
58
+ const msg = JSON.parse(body);
59
+ if (msg.id !== undefined && this.pending.has(msg.id)) {
60
+ const p = this.pending.get(msg.id);
61
+ this.pending.delete(msg.id);
62
+ if (msg.error) {
63
+ p.reject(new Error(`LSP error ${msg.error.code}: ${msg.error.message}`));
64
+ }
65
+ else {
66
+ p.resolve(msg.result);
67
+ }
68
+ }
69
+ else if (msg.method) {
70
+ // Server request or notification
71
+ this.notifications.push({ method: msg.method, params: msg.params });
72
+ // Auto-respond to server requests that have an id
73
+ if (msg.id !== undefined) {
74
+ this.respond(msg.id, null);
75
+ }
76
+ }
77
+ }
78
+ }
79
+ findHeaderEnd() {
80
+ for (let i = 0; i < this.buffer.length - 3; i++) {
81
+ if (this.buffer[i] === 13 &&
82
+ this.buffer[i + 1] === 10 &&
83
+ this.buffer[i + 2] === 13 &&
84
+ this.buffer[i + 3] === 10) {
85
+ return i;
86
+ }
87
+ }
88
+ return -1;
89
+ }
90
+ respond(id, result) {
91
+ const msg = { jsonrpc: "2.0", id, result };
92
+ this.proc.stdin.write(encodeMessage(msg));
93
+ }
94
+ async request(method, params, timeoutMs = 15000) {
95
+ const id = this.nextId++;
96
+ const msg = { jsonrpc: "2.0", id, method, params };
97
+ this.proc.stdin.write(encodeMessage(msg));
98
+ return new Promise((resolve, reject) => {
99
+ const timer = setTimeout(() => {
100
+ this.pending.delete(id);
101
+ reject(new Error(`Request ${method} timed out after ${timeoutMs}ms`));
102
+ }, timeoutMs);
103
+ this.pending.set(id, {
104
+ resolve: (v) => {
105
+ clearTimeout(timer);
106
+ resolve(v);
107
+ },
108
+ reject: (e) => {
109
+ clearTimeout(timer);
110
+ reject(e);
111
+ },
112
+ });
113
+ });
114
+ }
115
+ notify(method, params) {
116
+ const msg = { jsonrpc: "2.0", method, params };
117
+ this.proc.stdin.write(encodeMessage(msg));
118
+ }
119
+ getNotifications(method) {
120
+ if (!method)
121
+ return this.notifications;
122
+ return this.notifications.filter((n) => n.method === method);
123
+ }
124
+ async shutdown() {
125
+ try {
126
+ await this.request("shutdown", null, 5000);
127
+ this.notify("exit", null);
128
+ }
129
+ catch {
130
+ // Best effort
131
+ }
132
+ this.proc.kill();
133
+ }
134
+ }
135
+ // ---------------------------------------------------------------------------
136
+ // Test fixtures
137
+ // ---------------------------------------------------------------------------
138
+ function createTempProject() {
139
+ const dir = fs.mkdtempSync(path.join(os.tmpdir(), "lsp-test-"));
140
+ // tsconfig.json
141
+ fs.writeFileSync(path.join(dir, "tsconfig.json"), JSON.stringify({
142
+ compilerOptions: {
143
+ target: "ES2022",
144
+ module: "commonjs",
145
+ strict: true,
146
+ outDir: "./dist",
147
+ rootDir: "./src",
148
+ },
149
+ include: ["src/**/*.ts"],
150
+ }, null, 2));
151
+ // package.json
152
+ fs.writeFileSync(path.join(dir, "package.json"), JSON.stringify({ name: "lsp-test-project", version: "1.0.0" }, null, 2));
153
+ fs.mkdirSync(path.join(dir, "src"));
154
+ // src/math.ts — module with exported functions
155
+ fs.writeFileSync(path.join(dir, "src", "math.ts"), `export function add(a: number, b: number): number {
156
+ return a + b;
157
+ }
158
+
159
+ export function subtract(a: number, b: number): number {
160
+ return a - b;
161
+ }
162
+
163
+ export interface Calculator {
164
+ add(a: number, b: number): number;
165
+ subtract(a: number, b: number): number;
166
+ }
167
+ `);
168
+ // src/main.ts — imports from math, has a type error
169
+ fs.writeFileSync(path.join(dir, "src", "main.ts"), `import { add, subtract, Calculator } from "./math";
170
+
171
+ const result: number = add(1, 2);
172
+ const diff: number = subtract(5, 3);
173
+
174
+ // Intentional type error: string assigned to number
175
+ const bad: number = "not a number";
176
+
177
+ export function compute(calc: Calculator): number {
178
+ return calc.add(1, 2) + calc.subtract(5, 3);
179
+ }
180
+ `);
181
+ return {
182
+ dir,
183
+ cleanup: () => fs.rmSync(dir, { recursive: true, force: true }),
184
+ };
185
+ }
186
+ function fileToUri(filePath) {
187
+ return `file://${path.resolve(filePath)}`;
188
+ }
189
+ // ---------------------------------------------------------------------------
190
+ // Tests
191
+ // ---------------------------------------------------------------------------
192
+ test("LSP integration: typescript-language-server", async (t) => {
193
+ const { dir, cleanup } = createTempProject();
194
+ const mainPath = path.join(dir, "src", "main.ts");
195
+ const mathPath = path.join(dir, "src", "math.ts");
196
+ const mainUri = fileToUri(mainPath);
197
+ const mathUri = fileToUri(mathPath);
198
+ const lsp = new LspHarness("typescript-language-server", ["--stdio"], dir);
199
+ try {
200
+ // ---- Initialize ----
201
+ await t.test("initialize handshake", async () => {
202
+ const result = (await lsp.request("initialize", {
203
+ processId: process.pid,
204
+ rootUri: fileToUri(dir),
205
+ rootPath: dir,
206
+ capabilities: {
207
+ textDocument: {
208
+ hover: { contentFormat: ["markdown", "plaintext"] },
209
+ definition: { linkSupport: true },
210
+ references: {},
211
+ documentSymbol: { hierarchicalDocumentSymbolSupport: true },
212
+ publishDiagnostics: { relatedInformation: true },
213
+ },
214
+ },
215
+ workspaceFolders: [{ uri: fileToUri(dir), name: "test" }],
216
+ }));
217
+ assert.ok(result, "initialize should return a result");
218
+ assert.ok(result.capabilities, "result should have capabilities");
219
+ assert.ok(result.capabilities.hoverProvider !== undefined, "should support hover");
220
+ assert.ok(result.capabilities.definitionProvider !== undefined, "should support definition");
221
+ });
222
+ lsp.notify("initialized", {});
223
+ // Open both files
224
+ const mainContent = fs.readFileSync(mainPath, "utf-8");
225
+ const mathContent = fs.readFileSync(mathPath, "utf-8");
226
+ lsp.notify("textDocument/didOpen", {
227
+ textDocument: { uri: mainUri, languageId: "typescript", version: 1, text: mainContent },
228
+ });
229
+ lsp.notify("textDocument/didOpen", {
230
+ textDocument: { uri: mathUri, languageId: "typescript", version: 1, text: mathContent },
231
+ });
232
+ // Give the server time to index
233
+ await new Promise((r) => setTimeout(r, 3000));
234
+ // ---- Hover ----
235
+ await t.test("hover on 'add' call", async () => {
236
+ const result = (await lsp.request("textDocument/hover", {
237
+ textDocument: { uri: mainUri },
238
+ position: { line: 2, character: 24 }, // on 'add' in "add(1, 2)"
239
+ }));
240
+ assert.ok(result, "hover should return a result");
241
+ assert.ok(result.contents, "hover should have contents");
242
+ const text = JSON.stringify(result.contents);
243
+ assert.ok(text.includes("add") || text.includes("number"), `hover text should mention 'add' or 'number', got: ${text.slice(0, 200)}`);
244
+ });
245
+ // ---- Go to Definition ----
246
+ await t.test("go to definition of 'add'", async () => {
247
+ const result = (await lsp.request("textDocument/definition", {
248
+ textDocument: { uri: mainUri },
249
+ position: { line: 2, character: 24 }, // on 'add'
250
+ }));
251
+ assert.ok(result, "definition should return a result");
252
+ const locations = Array.isArray(result) ? result : [result];
253
+ assert.ok(locations.length > 0, "should find at least one definition");
254
+ // Response can be Location (uri) or LocationLink (targetUri)
255
+ const loc = locations[0];
256
+ const uri = (loc.uri ?? loc.targetUri);
257
+ assert.ok(uri, `definition should have uri or targetUri, got keys: ${Object.keys(loc).join(", ")}`);
258
+ assert.ok(uri.includes("math.ts"), `definition should point to math.ts, got: ${uri}`);
259
+ });
260
+ // ---- References ----
261
+ await t.test("find references of 'add'", async () => {
262
+ const result = (await lsp.request("textDocument/references", {
263
+ textDocument: { uri: mathUri },
264
+ position: { line: 0, character: 16 }, // on 'add' definition
265
+ context: { includeDeclaration: true },
266
+ }));
267
+ assert.ok(result, "references should return a result");
268
+ assert.ok(result.length >= 2, `should find at least 2 references (decl + usage), got ${result.length}`);
269
+ });
270
+ // ---- Document Symbols ----
271
+ await t.test("document symbols in math.ts", async () => {
272
+ const result = (await lsp.request("textDocument/documentSymbol", {
273
+ textDocument: { uri: mathUri },
274
+ }));
275
+ assert.ok(result, "documentSymbol should return a result");
276
+ assert.ok(result.length >= 2, `should find at least 2 symbols, got ${result.length}`);
277
+ const names = result.map((s) => s.name);
278
+ assert.ok(names.includes("add"), `symbols should include 'add', got: ${names.join(", ")}`);
279
+ assert.ok(names.includes("subtract"), `symbols should include 'subtract', got: ${names.join(", ")}`);
280
+ });
281
+ // ---- Diagnostics (published via notification) ----
282
+ await t.test("diagnostics for type error", async () => {
283
+ // Wait a bit more for diagnostics to arrive
284
+ await new Promise((r) => setTimeout(r, 2000));
285
+ const diagNotifications = lsp.getNotifications("textDocument/publishDiagnostics");
286
+ const mainDiags = diagNotifications.filter((n) => n.params.uri === mainUri);
287
+ assert.ok(mainDiags.length > 0, "should receive diagnostics for main.ts");
288
+ const lastDiag = mainDiags[mainDiags.length - 1];
289
+ const diagnostics = lastDiag.params
290
+ .diagnostics;
291
+ // Should catch the type error: string assigned to number
292
+ const typeError = diagnostics.find((d) => d.message.includes("not assignable") || d.message.includes("Type"));
293
+ assert.ok(typeError, `should find type error diagnostic, got: ${diagnostics.map((d) => d.message).join("; ")}`);
294
+ });
295
+ // ---- Shutdown ----
296
+ await t.test("clean shutdown", async () => {
297
+ // Should not throw
298
+ await lsp.shutdown();
299
+ });
300
+ }
301
+ catch (err) {
302
+ await lsp.shutdown().catch(() => { });
303
+ cleanup();
304
+ throw err;
305
+ }
306
+ cleanup();
307
+ });
308
+ //# sourceMappingURL=lsp-integration.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lsp-integration.test.js","sourceRoot":"","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W,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACzF,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,qBAAqB;QACrB,MAAM,CAAC,CAAC,IAAI,CAAC,gBAAgB,EAAE,KAAK,IAAI,EAAE;YACzC,mBAAmB;YACnB,MAAM,GAAG,CAAC,QAAQ,EAAE,CAAC;QACtB,CAAC,CAAC,CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACd,MAAM,GAAG,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;QACrC,OAAO,EAAE,CAAC;QACV,MAAM,GAAG,CAAC;IACX,CAAC;IAED,OAAO,EAAE,CAAC;AACX,CAAC,CAAC,CAAC","sourcesContent":["/**\n * Integration test for the LSP tool port.\n *\n * Spins up typescript-language-server against a temp TypeScript project\n * and exercises: initialize, didOpen, hover, definition, references,\n * documentSymbol, diagnostics, and shutdown.\n *\n * Run: node --experimental-strip-types --test src/core/lsp/lsp-integration.test.ts\n * (from packages/pi-coding-agent/)\n */\nimport test from \"node:test\";\nimport assert from \"node:assert/strict\";\nimport { spawn } from \"node:child_process\";\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport * as os from \"node:os\";\n\n// ---------------------------------------------------------------------------\n// Helpers — lightweight JSON-RPC over stdio (no dependency on our LSP code)\n// ---------------------------------------------------------------------------\n\ninterface JsonRpcRequest {\n\tjsonrpc: \"2.0\";\n\tid: number;\n\tmethod: string;\n\tparams: unknown;\n}\n\ninterface JsonRpcNotification {\n\tjsonrpc: \"2.0\";\n\tmethod: string;\n\tparams?: unknown;\n}\n\ninterface JsonRpcResponse {\n\tjsonrpc: \"2.0\";\n\tid?: number;\n\tresult?: unknown;\n\terror?: { code: number; message: string };\n}\n\nfunction encodeMessage(msg: JsonRpcRequest | JsonRpcNotification | JsonRpcResponse): string {\n\tconst body = JSON.stringify(msg);\n\treturn `Content-Length: ${Buffer.byteLength(body, \"utf-8\")}\\r\\n\\r\\n${body}`;\n}\n\n/**\n * Minimal LSP harness: spawns a language server, sends requests, collects responses.\n */\nclass LspHarness {\n\tprivate proc;\n\tprivate nextId = 1;\n\tprivate buffer = Buffer.alloc(0);\n\tprivate pending = new Map<number, { resolve: (v: unknown) => void; reject: (e: Error) => void }>();\n\tprivate notifications: Array<{ method: string; params: unknown }> = [];\n\n\tconstructor(command: string, args: string[], cwd: string) {\n\t\tthis.proc = spawn(command, args, {\n\t\t\tcwd,\n\t\t\tstdio: [\"pipe\", \"pipe\", \"pipe\"],\n\t\t});\n\n\t\tthis.proc.stdout!.on(\"data\", (chunk: Buffer) => {\n\t\t\tthis.buffer = Buffer.concat([this.buffer, chunk]);\n\t\t\tthis.drain();\n\t\t});\n\n\t\tthis.proc.stderr!.on(\"data\", (chunk: Buffer) => {\n\t\t\t// Swallow stderr (server logs)\n\t\t});\n\t}\n\n\tprivate drain(): void {\n\t\twhile (true) {\n\t\t\tconst headerEnd = this.findHeaderEnd();\n\t\t\tif (headerEnd === -1) return;\n\n\t\t\tconst headerText = this.buffer.subarray(0, headerEnd).toString(\"utf-8\");\n\t\t\tconst match = headerText.match(/Content-Length:\\s*(\\d+)/i);\n\t\t\tif (!match) return;\n\n\t\t\tconst contentLength = parseInt(match[1], 10);\n\t\t\tconst messageStart = headerEnd + 4; // past \\r\\n\\r\\n\n\t\t\tconst messageEnd = messageStart + contentLength;\n\t\t\tif (this.buffer.length < messageEnd) return;\n\n\t\t\tconst body = this.buffer.subarray(messageStart, messageEnd).toString(\"utf-8\");\n\t\t\tthis.buffer = Buffer.from(this.buffer.subarray(messageEnd));\n\n\t\t\tconst msg = JSON.parse(body) as JsonRpcResponse & { method?: string; params?: unknown };\n\n\t\t\tif (msg.id !== undefined && this.pending.has(msg.id)) {\n\t\t\t\tconst p = this.pending.get(msg.id)!;\n\t\t\t\tthis.pending.delete(msg.id);\n\t\t\t\tif (msg.error) {\n\t\t\t\t\tp.reject(new Error(`LSP error ${msg.error.code}: ${msg.error.message}`));\n\t\t\t\t} else {\n\t\t\t\t\tp.resolve(msg.result);\n\t\t\t\t}\n\t\t\t} else if (msg.method) {\n\t\t\t\t// Server request or notification\n\t\t\t\tthis.notifications.push({ method: msg.method, params: msg.params });\n\t\t\t\t// Auto-respond to server requests that have an id\n\t\t\t\tif (msg.id !== undefined) {\n\t\t\t\t\tthis.respond(msg.id, null);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate findHeaderEnd(): number {\n\t\tfor (let i = 0; i < this.buffer.length - 3; i++) {\n\t\t\tif (\n\t\t\t\tthis.buffer[i] === 13 &&\n\t\t\t\tthis.buffer[i + 1] === 10 &&\n\t\t\t\tthis.buffer[i + 2] === 13 &&\n\t\t\t\tthis.buffer[i + 3] === 10\n\t\t\t) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}\n\n\tprivate respond(id: number, result: unknown): void {\n\t\tconst msg: JsonRpcResponse = { jsonrpc: \"2.0\", id, result };\n\t\tthis.proc.stdin!.write(encodeMessage(msg));\n\t}\n\n\tasync request(method: string, params: unknown, timeoutMs = 15000): Promise<unknown> {\n\t\tconst id = this.nextId++;\n\t\tconst msg: JsonRpcRequest = { jsonrpc: \"2.0\", id, method, params };\n\t\tthis.proc.stdin!.write(encodeMessage(msg));\n\n\t\treturn new Promise<unknown>((resolve, reject) => {\n\t\t\tconst timer = setTimeout(() => {\n\t\t\t\tthis.pending.delete(id);\n\t\t\t\treject(new Error(`Request ${method} timed out after ${timeoutMs}ms`));\n\t\t\t}, timeoutMs);\n\n\t\t\tthis.pending.set(id, {\n\t\t\t\tresolve: (v) => {\n\t\t\t\t\tclearTimeout(timer);\n\t\t\t\t\tresolve(v);\n\t\t\t\t},\n\t\t\t\treject: (e) => {\n\t\t\t\t\tclearTimeout(timer);\n\t\t\t\t\treject(e);\n\t\t\t\t},\n\t\t\t});\n\t\t});\n\t}\n\n\tnotify(method: string, params: unknown): void {\n\t\tconst msg: JsonRpcNotification = { jsonrpc: \"2.0\", method, params };\n\t\tthis.proc.stdin!.write(encodeMessage(msg));\n\t}\n\n\tgetNotifications(method?: string): Array<{ method: string; params: unknown }> {\n\t\tif (!method) return this.notifications;\n\t\treturn this.notifications.filter((n) => n.method === method);\n\t}\n\n\tasync shutdown(): Promise<void> {\n\t\ttry {\n\t\t\tawait this.request(\"shutdown\", null, 5000);\n\t\t\tthis.notify(\"exit\", null);\n\t\t} catch {\n\t\t\t// Best effort\n\t\t}\n\t\tthis.proc.kill();\n\t}\n}\n\n// ---------------------------------------------------------------------------\n// Test fixtures\n// ---------------------------------------------------------------------------\n\nfunction createTempProject(): { dir: string; cleanup: () => void } {\n\tconst dir = fs.mkdtempSync(path.join(os.tmpdir(), \"lsp-test-\"));\n\n\t// tsconfig.json\n\tfs.writeFileSync(\n\t\tpath.join(dir, \"tsconfig.json\"),\n\t\tJSON.stringify(\n\t\t\t{\n\t\t\t\tcompilerOptions: {\n\t\t\t\t\ttarget: \"ES2022\",\n\t\t\t\t\tmodule: \"commonjs\",\n\t\t\t\t\tstrict: true,\n\t\t\t\t\toutDir: \"./dist\",\n\t\t\t\t\trootDir: \"./src\",\n\t\t\t\t},\n\t\t\t\tinclude: [\"src/**/*.ts\"],\n\t\t\t},\n\t\t\tnull,\n\t\t\t2,\n\t\t),\n\t);\n\n\t// package.json\n\tfs.writeFileSync(\n\t\tpath.join(dir, \"package.json\"),\n\t\tJSON.stringify({ name: \"lsp-test-project\", version: \"1.0.0\" }, null, 2),\n\t);\n\n\tfs.mkdirSync(path.join(dir, \"src\"));\n\n\t// src/math.ts — module with exported functions\n\tfs.writeFileSync(\n\t\tpath.join(dir, \"src\", \"math.ts\"),\n\t\t`export function add(a: number, b: number): number {\n return a + b;\n}\n\nexport function subtract(a: number, b: number): number {\n return a - b;\n}\n\nexport interface Calculator {\n add(a: number, b: number): number;\n subtract(a: number, b: number): number;\n}\n`,\n\t);\n\n\t// src/main.ts — imports from math, has a type error\n\tfs.writeFileSync(\n\t\tpath.join(dir, \"src\", \"main.ts\"),\n\t\t`import { add, subtract, Calculator } from \"./math\";\n\nconst result: number = add(1, 2);\nconst diff: number = subtract(5, 3);\n\n// Intentional type error: string assigned to number\nconst bad: number = \"not a number\";\n\nexport function compute(calc: Calculator): number {\n return calc.add(1, 2) + calc.subtract(5, 3);\n}\n`,\n\t);\n\n\treturn {\n\t\tdir,\n\t\tcleanup: () => fs.rmSync(dir, { recursive: true, force: true }),\n\t};\n}\n\nfunction fileToUri(filePath: string): string {\n\treturn `file://${path.resolve(filePath)}`;\n}\n\n// ---------------------------------------------------------------------------\n// Tests\n// ---------------------------------------------------------------------------\n\ntest(\"LSP integration: typescript-language-server\", async (t) => {\n\tconst { dir, cleanup } = createTempProject();\n\tconst mainPath = path.join(dir, \"src\", \"main.ts\");\n\tconst mathPath = path.join(dir, \"src\", \"math.ts\");\n\tconst mainUri = fileToUri(mainPath);\n\tconst mathUri = fileToUri(mathPath);\n\n\tconst lsp = new LspHarness(\"typescript-language-server\", [\"--stdio\"], dir);\n\n\ttry {\n\t\t// ---- Initialize ----\n\t\tawait t.test(\"initialize handshake\", async () => {\n\t\t\tconst result = (await lsp.request(\"initialize\", {\n\t\t\t\tprocessId: process.pid,\n\t\t\t\trootUri: fileToUri(dir),\n\t\t\t\trootPath: dir,\n\t\t\t\tcapabilities: {\n\t\t\t\t\ttextDocument: {\n\t\t\t\t\t\thover: { contentFormat: [\"markdown\", \"plaintext\"] },\n\t\t\t\t\t\tdefinition: { linkSupport: true },\n\t\t\t\t\t\treferences: {},\n\t\t\t\t\t\tdocumentSymbol: { hierarchicalDocumentSymbolSupport: true },\n\t\t\t\t\t\tpublishDiagnostics: { relatedInformation: true },\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tworkspaceFolders: [{ uri: fileToUri(dir), name: \"test\" }],\n\t\t\t})) as { capabilities?: Record<string, unknown> };\n\n\t\t\tassert.ok(result, \"initialize should return a result\");\n\t\t\tassert.ok(result.capabilities, \"result should have capabilities\");\n\t\t\tassert.ok(result.capabilities.hoverProvider !== undefined, \"should support hover\");\n\t\t\tassert.ok(result.capabilities.definitionProvider !== undefined, \"should support definition\");\n\t\t});\n\n\t\tlsp.notify(\"initialized\", {});\n\n\t\t// Open both files\n\t\tconst mainContent = fs.readFileSync(mainPath, \"utf-8\");\n\t\tconst mathContent = fs.readFileSync(mathPath, \"utf-8\");\n\n\t\tlsp.notify(\"textDocument/didOpen\", {\n\t\t\ttextDocument: { uri: mainUri, languageId: \"typescript\", version: 1, text: mainContent },\n\t\t});\n\t\tlsp.notify(\"textDocument/didOpen\", {\n\t\t\ttextDocument: { uri: mathUri, languageId: \"typescript\", version: 1, text: mathContent },\n\t\t});\n\n\t\t// Give the server time to index\n\t\tawait new Promise((r) => setTimeout(r, 3000));\n\n\t\t// ---- Hover ----\n\t\tawait t.test(\"hover on 'add' call\", async () => {\n\t\t\tconst result = (await lsp.request(\"textDocument/hover\", {\n\t\t\t\ttextDocument: { uri: mainUri },\n\t\t\t\tposition: { line: 2, character: 24 }, // on 'add' in \"add(1, 2)\"\n\t\t\t})) as { contents?: unknown } | null;\n\n\t\t\tassert.ok(result, \"hover should return a result\");\n\t\t\tassert.ok(result.contents, \"hover should have contents\");\n\t\t\tconst text = JSON.stringify(result.contents);\n\t\t\tassert.ok(\n\t\t\t\ttext.includes(\"add\") || text.includes(\"number\"),\n\t\t\t\t`hover text should mention 'add' or 'number', got: ${text.slice(0, 200)}`,\n\t\t\t);\n\t\t});\n\n\t\t// ---- Go to Definition ----\n\t\tawait t.test(\"go to definition of 'add'\", async () => {\n\t\t\tconst result = (await lsp.request(\"textDocument/definition\", {\n\t\t\t\ttextDocument: { uri: mainUri },\n\t\t\t\tposition: { line: 2, character: 24 }, // on 'add'\n\t\t\t})) as unknown;\n\n\t\t\tassert.ok(result, \"definition should return a result\");\n\t\t\tconst locations = Array.isArray(result) ? result : [result];\n\t\t\tassert.ok(locations.length > 0, \"should find at least one definition\");\n\t\t\t// Response can be Location (uri) or LocationLink (targetUri)\n\t\t\tconst loc = locations[0] as Record<string, unknown>;\n\t\t\tconst uri = (loc.uri ?? loc.targetUri) as string;\n\t\t\tassert.ok(uri, `definition should have uri or targetUri, got keys: ${Object.keys(loc).join(\", \")}`);\n\t\t\tassert.ok(\n\t\t\t\turi.includes(\"math.ts\"),\n\t\t\t\t`definition should point to math.ts, got: ${uri}`,\n\t\t\t);\n\t\t});\n\n\t\t// ---- References ----\n\t\tawait t.test(\"find references of 'add'\", async () => {\n\t\t\tconst result = (await lsp.request(\"textDocument/references\", {\n\t\t\t\ttextDocument: { uri: mathUri },\n\t\t\t\tposition: { line: 0, character: 16 }, // on 'add' definition\n\t\t\t\tcontext: { includeDeclaration: true },\n\t\t\t})) as Array<{ uri: string; range: unknown }> | null;\n\n\t\t\tassert.ok(result, \"references should return a result\");\n\t\t\tassert.ok(result.length >= 2, `should find at least 2 references (decl + usage), got ${result.length}`);\n\t\t});\n\n\t\t// ---- Document Symbols ----\n\t\tawait t.test(\"document symbols in math.ts\", async () => {\n\t\t\tconst result = (await lsp.request(\"textDocument/documentSymbol\", {\n\t\t\t\ttextDocument: { uri: mathUri },\n\t\t\t})) as Array<{ name: string; kind: number }> | null;\n\n\t\t\tassert.ok(result, \"documentSymbol should return a result\");\n\t\t\tassert.ok(result.length >= 2, `should find at least 2 symbols, got ${result.length}`);\n\t\t\tconst names = result.map((s) => s.name);\n\t\t\tassert.ok(names.includes(\"add\"), `symbols should include 'add', got: ${names.join(\", \")}`);\n\t\t\tassert.ok(names.includes(\"subtract\"), `symbols should include 'subtract', got: ${names.join(\", \")}`);\n\t\t});\n\n\t\t// ---- Diagnostics (published via notification) ----\n\t\tawait t.test(\"diagnostics for type error\", async () => {\n\t\t\t// Wait a bit more for diagnostics to arrive\n\t\t\tawait new Promise((r) => setTimeout(r, 2000));\n\n\t\t\tconst diagNotifications = lsp.getNotifications(\"textDocument/publishDiagnostics\");\n\t\t\tconst mainDiags = diagNotifications.filter(\n\t\t\t\t(n) => (n.params as { uri: string }).uri === mainUri,\n\t\t\t);\n\n\t\t\tassert.ok(mainDiags.length > 0, \"should receive diagnostics for main.ts\");\n\n\t\t\tconst lastDiag = mainDiags[mainDiags.length - 1];\n\t\t\tconst diagnostics = (lastDiag.params as { diagnostics: Array<{ message: string; range: unknown }> })\n\t\t\t\t.diagnostics;\n\n\t\t\t// Should catch the type error: string assigned to number\n\t\t\tconst typeError = diagnostics.find(\n\t\t\t\t(d) => d.message.includes(\"not assignable\") || d.message.includes(\"Type\"),\n\t\t\t);\n\t\t\tassert.ok(\n\t\t\t\ttypeError,\n\t\t\t\t`should find type error diagnostic, got: ${diagnostics.map((d) => d.message).join(\"; \")}`,\n\t\t\t);\n\t\t});\n\n\t\t// ---- Shutdown ----\n\t\tawait t.test(\"clean shutdown\", async () => {\n\t\t\t// Should not throw\n\t\t\tawait lsp.shutdown();\n\t\t});\n\t} catch (err) {\n\t\tawait lsp.shutdown().catch(() => {});\n\t\tcleanup();\n\t\tthrow err;\n\t}\n\n\tcleanup();\n});\n"]}
@@ -0,0 +1,33 @@
1
+ Interacts with Language Server Protocol servers for code intelligence.
2
+
3
+ <operations>
4
+ - `diagnostics`: Get errors/warnings for file, glob, or entire workspace (no file)
5
+ - `definition`: Go to symbol definition → file path + position + 3-line source context
6
+ - `type_definition`: Go to symbol type definition → file path + position + 3-line source context
7
+ - `implementation`: Find concrete implementations → file path + position + 3-line source context
8
+ - `references`: Find references → locations with 3-line source context (first 50), remaining location-only
9
+ - `hover`: Get type info and documentation → type signature + docs
10
+ - `symbols`: List symbols in file, or search workspace (with query, no file)
11
+ - `rename`: Rename symbol across codebase → preview or apply edits
12
+ - `code_actions`: List available quick-fixes/refactors/import actions; apply one when `apply: true` and `query` matches title or index
13
+ - `status`: Show active language servers
14
+ - `reload`: Restart the language server
15
+ </operations>
16
+
17
+ <parameters>
18
+ - `file`: File path; for diagnostics it may be a glob pattern (e.g., `src/**/*.ts`)
19
+ - `line`: 1-indexed line number for position-based actions
20
+ - `symbol`: Substring on the target line used to resolve column automatically
21
+ - `occurrence`: 1-indexed match index when `symbol` appears multiple times on the same line
22
+ - `query`: Symbol search query, code-action kind filter (list mode), or code-action selector (apply mode)
23
+ - `new_name`: Required for rename
24
+ - `apply`: Apply edits for rename/code_actions (default true for rename, list mode for code_actions unless explicitly true)
25
+ - `timeout`: Request timeout in seconds (clamped to 5-60, default 20)
26
+ </parameters>
27
+
28
+ <caution>
29
+ - Requires running LSP server for target language
30
+ - Some operations require file to be saved to disk
31
+ - Diagnostics glob mode samples up to 20 files per request to avoid long-running stalls on broad patterns
32
+ - When `symbol` is provided for position-based actions, missing symbols or out-of-bounds `occurrence` values return an explicit error instead of silently falling back
33
+ </caution>
@@ -0,0 +1,34 @@
1
+ /**
2
+ * lspmux integration for LSP server multiplexing.
3
+ *
4
+ * When lspmux is available and running, this module wraps supported LSP server
5
+ * commands to use lspmux client mode, enabling server instance sharing across
6
+ * multiple editor windows.
7
+ *
8
+ * Integration is transparent: if lspmux is unavailable, falls back to direct spawning.
9
+ */
10
+ interface LspmuxConfig {
11
+ instance_timeout?: number;
12
+ gc_interval?: number;
13
+ listen?: [string, number] | string;
14
+ connect?: [string, number] | string;
15
+ log_filters?: string;
16
+ pass_environment?: string[];
17
+ }
18
+ interface LspmuxState {
19
+ available: boolean;
20
+ running: boolean;
21
+ binaryPath: string | null;
22
+ config: LspmuxConfig | null;
23
+ }
24
+ export declare function detectLspmux(): Promise<LspmuxState>;
25
+ export declare function isLspmuxSupported(command: string): boolean;
26
+ export interface LspmuxWrappedCommand {
27
+ command: string;
28
+ args: string[];
29
+ env?: Record<string, string>;
30
+ }
31
+ export declare function wrapWithLspmux(originalCommand: string, originalArgs: string[] | undefined, state: LspmuxState): LspmuxWrappedCommand;
32
+ export declare function getLspmuxCommand(command: string, args?: string[]): Promise<LspmuxWrappedCommand>;
33
+ export {};
34
+ //# sourceMappingURL=lspmux.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lspmux.d.ts","sourceRoot":"","sources":["../../../src/core/lsp/lspmux.ts"],"names":[],"mappings":"AAKA;;;;;;;;GAQG;AAMH,UAAU,YAAY;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC;IACnC,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B;AAED,UAAU,WAAW;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,MAAM,EAAE,YAAY,GAAG,IAAI,CAAC;CAC5B;AA2FD,wBAAsB,YAAY,IAAI,OAAO,CAAC,WAAW,CAAC,CAyBzD;AAMD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAG1D;AAED,MAAM,WAAW,oBAAoB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC7B;AAED,wBAAgB,cAAc,CAC7B,eAAe,EAAE,MAAM,EACvB,YAAY,EAAE,MAAM,EAAE,GAAG,SAAS,EAClC,KAAK,EAAE,WAAW,GAChB,oBAAoB,CAuBtB;AAED,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAGtG"}