@mrclrchtr/supi-code-intelligence 11.4.0 → 13.0.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 (330) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/README.md +17 -9
  3. package/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
  4. package/node_modules/@mrclrchtr/supi-code-runtime/src/api.ts +1 -0
  5. package/node_modules/@mrclrchtr/supi-code-runtime/src/types.ts +51 -23
  6. package/node_modules/@mrclrchtr/supi-core/package.json +3 -1
  7. package/node_modules/@mrclrchtr/supi-core/src/api.ts +4 -0
  8. package/node_modules/@mrclrchtr/supi-core/src/context/context-tag.ts +1 -1
  9. package/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +22 -3
  10. package/node_modules/@mrclrchtr/supi-core/src/retired-packages.ts +152 -0
  11. package/node_modules/@mrclrchtr/supi-core/src/session.ts +1 -0
  12. package/node_modules/@mrclrchtr/supi-core/src/shell-hints.ts +46 -0
  13. package/node_modules/@mrclrchtr/supi-core/src/spill.ts +93 -0
  14. package/node_modules/@mrclrchtr/supi-lsp/README.md +21 -16
  15. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
  16. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/api.ts +1 -0
  17. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/types.ts +51 -23
  18. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/package.json +3 -1
  19. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/api.ts +4 -0
  20. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/context/context-tag.ts +1 -1
  21. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +22 -3
  22. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/retired-packages.ts +152 -0
  23. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/session.ts +1 -0
  24. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/shell-hints.ts +46 -0
  25. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/spill.ts +93 -0
  26. package/node_modules/@mrclrchtr/supi-lsp/package.json +8 -8
  27. package/node_modules/@mrclrchtr/supi-lsp/src/api.ts +3 -2
  28. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-cache.ts +102 -47
  29. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-capabilities.ts +13 -3
  30. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-host.ts +8 -0
  31. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-refresh.ts +15 -1
  32. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-request.ts +1 -1
  33. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostics.ts +71 -13
  34. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-disk-stamp.ts +60 -0
  35. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-document-state.ts +3 -0
  36. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-document-sync.ts +28 -6
  37. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-edit-capture.ts +258 -0
  38. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-file-state.ts +17 -3
  39. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-semantic-input-barrier.ts +53 -4
  40. package/node_modules/@mrclrchtr/supi-lsp/src/client/client.ts +75 -14
  41. package/node_modules/@mrclrchtr/supi-lsp/src/config/capabilities.ts +8 -0
  42. package/node_modules/@mrclrchtr/supi-lsp/src/config/operation-support.ts +48 -79
  43. package/node_modules/@mrclrchtr/supi-lsp/src/config/tsconfig-extends.ts +2 -1
  44. package/node_modules/@mrclrchtr/supi-lsp/src/config/tsconfig-path.ts +2 -2
  45. package/node_modules/@mrclrchtr/supi-lsp/src/config/tsconfig-scope.ts +14 -5
  46. package/node_modules/@mrclrchtr/supi-lsp/src/config/typescript-module.ts +17 -0
  47. package/node_modules/@mrclrchtr/supi-lsp/src/diagnostics/evidence.ts +42 -0
  48. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-client-state.ts +2 -17
  49. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-removal-ledger.ts +52 -0
  50. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager.ts +43 -21
  51. package/node_modules/@mrclrchtr/supi-lsp/src/manager/typescript-file-local.ts +6 -1
  52. package/node_modules/@mrclrchtr/supi-lsp/src/provider/lsp-refactor-provider.ts +21 -35
  53. package/node_modules/@mrclrchtr/supi-lsp/src/provider/lsp-semantic-provider.ts +6 -1
  54. package/node_modules/@mrclrchtr/supi-lsp/src/provider/refactor-command-capture.ts +139 -0
  55. package/node_modules/@mrclrchtr/supi-lsp/src/provider/refactor-planning.ts +202 -47
  56. package/node_modules/@mrclrchtr/supi-lsp/src/provider/semantic-symbol-mapper.ts +13 -3
  57. package/node_modules/@mrclrchtr/supi-lsp/src/session/route-boundary.ts +26 -0
  58. package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-diagnostic-surface.ts +11 -0
  59. package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-diagnostics.ts +1 -0
  60. package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-registry.ts +74 -14
  61. package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-rename.ts +3 -0
  62. package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-transition-debug.ts +11 -1
  63. package/node_modules/@mrclrchtr/supi-lsp/src/session/workspace-lsp-runtime.ts +24 -1
  64. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
  65. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/api.ts +1 -0
  66. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/types.ts +51 -23
  67. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/package.json +3 -1
  68. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/api.ts +4 -0
  69. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/context/context-tag.ts +1 -1
  70. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +22 -3
  71. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/retired-packages.ts +152 -0
  72. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/session.ts +1 -0
  73. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/shell-hints.ts +46 -0
  74. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/spill.ts +93 -0
  75. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.cjs +50 -75
  76. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.cjs.map +2 -2
  77. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.js +50 -75
  78. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.js.map +2 -2
  79. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.wasm +0 -0
  80. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.wasm.map +6 -6
  81. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/package.json +1 -1
  82. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.cjs +50 -75
  83. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.cjs.map +2 -2
  84. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.cts +7 -7
  85. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.cts.map +1 -1
  86. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.ts +7 -7
  87. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.ts.map +1 -1
  88. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.js +50 -75
  89. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.js.map +2 -2
  90. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.wasm +0 -0
  91. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.wasm.map +5 -5
  92. package/node_modules/@mrclrchtr/supi-tree-sitter/package.json +5 -5
  93. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/kotlin/tree-sitter-kotlin.wasm.json +1 -1
  94. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/latex/tree-sitter-latex.wasm.json +1 -1
  95. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/sql/tree-sitter-sql.wasm.json +1 -1
  96. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/tsx/tree-sitter-tsx.wasm.json +1 -1
  97. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/typescript/tree-sitter-typescript.wasm.json +1 -1
  98. package/node_modules/@mrclrchtr/supi-tree-sitter/src/coordinates.ts +16 -2
  99. package/node_modules/@mrclrchtr/supi-tree-sitter/src/session/structural-worker-client.ts +4 -3
  100. package/node_modules/@mrclrchtr/supi-tree-sitter/src/syntax-errors.ts +2 -0
  101. package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/call-range.ts +94 -0
  102. package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/call-sites.ts +26 -6
  103. package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/callees.ts +6 -3
  104. package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/exports.ts +13 -4
  105. package/node_modules/@mrclrchtr/supi-tree-sitter/src/worker/runtime.ts +1 -9
  106. package/node_modules/fast-xml-parser/CHANGELOG.md +886 -0
  107. package/node_modules/fast-xml-parser/LICENSE +21 -0
  108. package/node_modules/fast-xml-parser/README.md +204 -0
  109. package/node_modules/fast-xml-parser/lib/fxbuilder.min.js +2 -0
  110. package/node_modules/fast-xml-parser/lib/fxbuilder.min.js.map +1 -0
  111. package/node_modules/fast-xml-parser/lib/fxp.cjs +1 -0
  112. package/node_modules/fast-xml-parser/lib/fxp.d.cts +774 -0
  113. package/node_modules/fast-xml-parser/lib/fxp.min.js +2 -0
  114. package/node_modules/fast-xml-parser/lib/fxp.min.js.map +1 -0
  115. package/node_modules/fast-xml-parser/lib/fxparser.min.js +2 -0
  116. package/node_modules/fast-xml-parser/lib/fxparser.min.js.map +1 -0
  117. package/node_modules/fast-xml-parser/lib/fxvalidator.min.js +2 -0
  118. package/node_modules/fast-xml-parser/lib/fxvalidator.min.js.map +1 -0
  119. package/node_modules/fast-xml-parser/node_modules/@nodable/entities/README.md +92 -0
  120. package/node_modules/fast-xml-parser/node_modules/@nodable/entities/package.json +57 -0
  121. package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/EntityDecoder.js +644 -0
  122. package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/EntityEncoder.js +239 -0
  123. package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/all-entities.js +53 -0
  124. package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/entities.js +1139 -0
  125. package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/entityTries.js +60 -0
  126. package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/index.d.ts +358 -0
  127. package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/index.js +29 -0
  128. package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/CHANGELOG.md +52 -0
  129. package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/LICENSE +21 -0
  130. package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/README.md +77 -0
  131. package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/lib/fxb.cjs +1 -0
  132. package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/lib/fxb.d.cts +270 -0
  133. package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/lib/fxb.min.js +2 -0
  134. package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/lib/fxb.min.js.map +1 -0
  135. package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/package.json +77 -0
  136. package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/fxb.d.ts +270 -0
  137. package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/fxb.js +609 -0
  138. package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/ignoreAttributes.js +18 -0
  139. package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/orderedJs2Xml.js +360 -0
  140. package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/prettifyJs2Xml.js +0 -0
  141. package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/util.js +23 -0
  142. package/node_modules/fast-xml-parser/node_modules/is-unsafe/LICENSE +21 -0
  143. package/node_modules/fast-xml-parser/node_modules/is-unsafe/README.md +632 -0
  144. package/node_modules/fast-xml-parser/node_modules/is-unsafe/package.json +56 -0
  145. package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/html.js +102 -0
  146. package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/log.js +98 -0
  147. package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/nosql.js +114 -0
  148. package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/redos.js +60 -0
  149. package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/shell.js +105 -0
  150. package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/sql-strict.js +47 -0
  151. package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/sql.js +95 -0
  152. package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/svg.js +81 -0
  153. package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/xml.js +79 -0
  154. package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/index.cjs +27 -0
  155. package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/index.d.ts +103 -0
  156. package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/index.js +292 -0
  157. package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/util/decode-entities.js +48 -0
  158. package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/LICENSE +21 -0
  159. package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/README.md +947 -0
  160. package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/lib/pem.cjs +1 -0
  161. package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/lib/pem.d.cts +725 -0
  162. package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/lib/pem.min.js +2 -0
  163. package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/lib/pem.min.js.map +1 -0
  164. package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/package.json +79 -0
  165. package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/src/Expression.js +232 -0
  166. package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/src/ExpressionSet.js +225 -0
  167. package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/src/Matcher.js +663 -0
  168. package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/src/index.d.ts +589 -0
  169. package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/src/index.js +30 -0
  170. package/node_modules/fast-xml-parser/node_modules/strnum/CHANGELOG.md +63 -0
  171. package/node_modules/fast-xml-parser/node_modules/strnum/LICENSE +21 -0
  172. package/node_modules/fast-xml-parser/node_modules/strnum/README.md +113 -0
  173. package/node_modules/fast-xml-parser/node_modules/strnum/node_modules/anynum/LICENSE +21 -0
  174. package/node_modules/fast-xml-parser/node_modules/strnum/node_modules/anynum/README.md +142 -0
  175. package/node_modules/fast-xml-parser/node_modules/strnum/node_modules/anynum/anynum.js +135 -0
  176. package/node_modules/fast-xml-parser/node_modules/strnum/node_modules/anynum/digitTable.js +116 -0
  177. package/node_modules/fast-xml-parser/node_modules/strnum/node_modules/anynum/package.json +42 -0
  178. package/node_modules/fast-xml-parser/node_modules/strnum/package.json +36 -0
  179. package/node_modules/fast-xml-parser/node_modules/strnum/strnum.js +176 -0
  180. package/node_modules/fast-xml-parser/node_modules/xml-naming/LICENSE +21 -0
  181. package/node_modules/fast-xml-parser/node_modules/xml-naming/README.md +287 -0
  182. package/node_modules/fast-xml-parser/node_modules/xml-naming/package.json +56 -0
  183. package/node_modules/fast-xml-parser/node_modules/xml-naming/src/index.d.ts +108 -0
  184. package/node_modules/fast-xml-parser/node_modules/xml-naming/src/index.js +382 -0
  185. package/node_modules/fast-xml-parser/package.json +93 -0
  186. package/node_modules/fast-xml-parser/src/cli/cli.js +97 -0
  187. package/node_modules/fast-xml-parser/src/cli/man.js +17 -0
  188. package/node_modules/fast-xml-parser/src/cli/read.js +43 -0
  189. package/node_modules/fast-xml-parser/src/fxp.d.ts +754 -0
  190. package/node_modules/fast-xml-parser/src/fxp.js +14 -0
  191. package/node_modules/fast-xml-parser/src/ignoreAttributes.js +18 -0
  192. package/node_modules/fast-xml-parser/src/util.js +61 -0
  193. package/node_modules/fast-xml-parser/src/v6/CharsSymbol.js +16 -0
  194. package/node_modules/fast-xml-parser/src/v6/EntitiesParser.js +106 -0
  195. package/node_modules/fast-xml-parser/src/v6/OptionsBuilder.js +61 -0
  196. package/node_modules/fast-xml-parser/src/v6/OutputBuilders/BaseOutputBuilder.js +69 -0
  197. package/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsArrBuilder.js +103 -0
  198. package/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsMinArrBuilder.js +100 -0
  199. package/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsObjBuilder.js +154 -0
  200. package/node_modules/fast-xml-parser/src/v6/OutputBuilders/ParserOptionsBuilder.js +94 -0
  201. package/node_modules/fast-xml-parser/src/v6/Report.js +0 -0
  202. package/node_modules/fast-xml-parser/src/v6/TagPath.js +81 -0
  203. package/node_modules/fast-xml-parser/src/v6/TagPathMatcher.js +13 -0
  204. package/node_modules/fast-xml-parser/src/v6/XMLParser.js +83 -0
  205. package/node_modules/fast-xml-parser/src/v6/Xml2JsParser.js +235 -0
  206. package/node_modules/fast-xml-parser/src/v6/XmlPartReader.js +210 -0
  207. package/node_modules/fast-xml-parser/src/v6/XmlSpecialTagsReader.js +111 -0
  208. package/node_modules/fast-xml-parser/src/v6/inputSource/BufferSource.js +116 -0
  209. package/node_modules/fast-xml-parser/src/v6/inputSource/StringSource.js +121 -0
  210. package/node_modules/fast-xml-parser/src/v6/valueParsers/EntitiesParser.js +105 -0
  211. package/node_modules/fast-xml-parser/src/v6/valueParsers/booleanParser.js +22 -0
  212. package/node_modules/fast-xml-parser/src/v6/valueParsers/booleanParserExt.js +19 -0
  213. package/node_modules/fast-xml-parser/src/v6/valueParsers/currency.js +38 -0
  214. package/node_modules/fast-xml-parser/src/v6/valueParsers/join.js +13 -0
  215. package/node_modules/fast-xml-parser/src/v6/valueParsers/number.js +14 -0
  216. package/node_modules/fast-xml-parser/src/v6/valueParsers/trim.js +6 -0
  217. package/node_modules/fast-xml-parser/src/validator.js +518 -0
  218. package/node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js +6 -0
  219. package/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js +426 -0
  220. package/node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js +164 -0
  221. package/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js +907 -0
  222. package/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js +77 -0
  223. package/node_modules/fast-xml-parser/src/xmlparser/node2json.js +177 -0
  224. package/node_modules/fast-xml-parser/src/xmlparser/xmlNode.js +54 -0
  225. package/package.json +10 -8
  226. package/src/analysis/evidence.ts +331 -73
  227. package/src/analysis/health/diagnostics.ts +66 -18
  228. package/src/analysis/health/evidence-reason.ts +44 -0
  229. package/src/analysis/health/server-status.ts +41 -12
  230. package/src/analysis/search/pattern.ts +3 -3
  231. package/src/analysis/target/anchored-structural.ts +4 -1
  232. package/src/analysis/target/anchored.ts +3 -6
  233. package/src/analysis/target/symbol.ts +42 -48
  234. package/src/analysis/target/types.ts +4 -9
  235. package/src/analysis/workspace/cmake-parser.ts +207 -0
  236. package/src/analysis/workspace/cmake.ts +141 -0
  237. package/src/analysis/workspace/maven.ts +310 -0
  238. package/src/analysis/workspace/membership.ts +100 -26
  239. package/src/analysis/workspace/metadata.ts +6 -1
  240. package/src/analysis/workspace/observe.ts +6 -0
  241. package/src/analysis/workspace/types.ts +11 -3
  242. package/src/diagnostics/coverage.ts +49 -0
  243. package/src/diagnostics/evidence.ts +10 -2
  244. package/src/session/find-types.ts +8 -4
  245. package/src/session/find-workflow.ts +11 -16
  246. package/src/session/health-workflow.ts +6 -0
  247. package/src/session/input/common.ts +1 -1
  248. package/src/session/input/health-refactor.ts +48 -34
  249. package/src/session/input/workflows.ts +45 -46
  250. package/src/session/inspect/file-point.ts +2 -2
  251. package/src/session/inspect-types.ts +1 -1
  252. package/src/session/inspect-workflow.ts +3 -3
  253. package/src/session/orientation/collect.ts +42 -7
  254. package/src/session/orientation/context-facts.ts +3 -3
  255. package/src/session/orientation/context-sections.ts +13 -15
  256. package/src/session/orientation/facts.ts +5 -8
  257. package/src/session/orientation-workflow.ts +4 -19
  258. package/src/session/refactor-file-actions.ts +122 -0
  259. package/src/session/refactor-plan-pipeline.ts +152 -0
  260. package/src/session/refactor-plans.ts +18 -15
  261. package/src/session/refactor-types.ts +24 -12
  262. package/src/session/refactor-workflow.ts +68 -243
  263. package/src/session/target-workflow.ts +25 -18
  264. package/src/tool/code_find/execute.ts +6 -7
  265. package/src/tool/code_find/result.ts +5 -7
  266. package/src/tool/code_find/spec.ts +9 -16
  267. package/src/tool/code_find/tui.ts +12 -6
  268. package/src/tool/code_graph/display.ts +5 -6
  269. package/src/tool/code_graph/format.ts +8 -24
  270. package/src/tool/code_graph/result.ts +16 -75
  271. package/src/tool/code_graph/section.ts +21 -33
  272. package/src/tool/code_graph/spec.ts +6 -0
  273. package/src/tool/code_graph/tui.ts +10 -5
  274. package/src/tool/code_health/diagnostic-tui.ts +49 -0
  275. package/src/tool/code_health/guidance.ts +27 -0
  276. package/src/tool/code_health/markdown.ts +60 -8
  277. package/src/tool/code_health/result.ts +20 -9
  278. package/src/tool/code_health/spec.ts +6 -0
  279. package/src/tool/code_health/structured-schema.ts +18 -4
  280. package/src/tool/code_health/structured.ts +22 -18
  281. package/src/tool/code_health/tui.ts +33 -40
  282. package/src/tool/code_inspect/execute.ts +1 -1
  283. package/src/tool/code_inspect/markdown.ts +33 -6
  284. package/src/tool/code_inspect/result.ts +24 -19
  285. package/src/tool/code_inspect/spec.ts +14 -6
  286. package/src/tool/code_inspect/structured.ts +4 -21
  287. package/src/tool/code_inspect/tui.ts +2 -2
  288. package/src/tool/code_orientation/result.ts +53 -100
  289. package/src/tool/code_orientation/spec.ts +8 -0
  290. package/src/tool/code_orientation/structured-schema.ts +16 -12
  291. package/src/tool/code_orientation/structured-workspace.ts +13 -7
  292. package/src/tool/code_orientation/structured.ts +31 -39
  293. package/src/tool/code_orientation/workspace-format.ts +4 -10
  294. package/src/tool/code_orientation/workspace-instructions.ts +4 -5
  295. package/src/tool/code_orientation/workspace-observations.ts +2 -2
  296. package/src/tool/code_orientation/workspace-output.ts +16 -7
  297. package/src/tool/code_orientation/workspace-projects.ts +7 -10
  298. package/src/tool/code_orientation/workspace-sections.ts +13 -19
  299. package/src/tool/code_refactor_apply/result.ts +2 -1
  300. package/src/tool/code_refactor_apply/spec.ts +7 -0
  301. package/src/tool/code_refactor_plan/execute.ts +0 -2
  302. package/src/tool/code_refactor_plan/result.ts +23 -13
  303. package/src/tool/code_refactor_plan/spec.ts +8 -2
  304. package/src/tool/code_refactor_plan/structured.ts +59 -12
  305. package/src/tool/code_refactor_plan/tui.ts +14 -17
  306. package/src/tool/code_resolve/markdown.ts +5 -47
  307. package/src/tool/code_resolve/result.ts +43 -72
  308. package/src/tool/code_resolve/spec.ts +6 -0
  309. package/src/tool/infra/truncate.ts +2 -16
  310. package/src/tool/namespace.ts +14 -0
  311. package/src/tool/refactor-markdown.ts +55 -15
  312. package/src/tool/register.ts +3 -0
  313. package/src/tool/result/candidate-selection.ts +141 -0
  314. package/src/tool/result/display.ts +41 -45
  315. package/src/tool/result/errors.ts +1 -0
  316. package/src/tool/result/model-budget.ts +26 -1
  317. package/src/tool/result/refactor-preview.ts +118 -0
  318. package/src/tool/result/refactor-unavailable.ts +16 -0
  319. package/src/tool/result/refactor.ts +19 -10
  320. package/src/tool/result/structured.ts +2 -1
  321. package/src/tool/result/types.ts +9 -8
  322. package/src/tool/schemas.ts +76 -38
  323. package/src/tool/specs.ts +3 -0
  324. package/src/ui/footer.ts +2 -4
  325. package/src/ui/status-overlay.ts +1 -1
  326. package/src/ui/status-presentation.ts +4 -7
  327. package/src/ui/tui/candidate-selection.ts +40 -95
  328. package/src/ui/tui/common.ts +16 -70
  329. package/src/ui/tui/display.ts +6 -24
  330. package/src/tool/result/candidate-row.ts +0 -49
@@ -18,6 +18,8 @@ import {
18
18
  import { resolveToolPath as resolveSessionPath } from "@mrclrchtr/supi-core/path";
19
19
  import { createSessionStateRegistry } from "@mrclrchtr/supi-core/session";
20
20
  import { CodeActionTriggerKind } from "vscode-languageserver-types";
21
+ import type { CommandEditCaptureResult } from "../client/client-edit-capture.ts";
22
+ import { advertisedCodeActionKinds } from "../config/operation-support.ts";
21
23
  import type {
22
24
  CodeAction,
23
25
  Diagnostic,
@@ -39,7 +41,12 @@ import type {
39
41
  WorkspaceSentinelSyncResult,
40
42
  } from "../diagnostics/workspace-sentinels.ts";
41
43
  import type { LspManager } from "../manager/manager.ts";
44
+ import {
45
+ COMMAND_ONLY_ACTION_REASON,
46
+ captureEligibleActions,
47
+ } from "../provider/refactor-command-capture.ts";
42
48
  import { raceReadinessValue } from "./readiness.ts";
49
+ import { outsideRouteRootReason } from "./route-boundary.ts";
43
50
  import type {
44
51
  DiagnosticEvidenceSummary,
45
52
  ProcessCrashRecoveryReport,
@@ -49,6 +56,7 @@ import type {
49
56
  import { runRoutedRename } from "./runtime-rename.ts";
50
57
  import type {
51
58
  BulkTrackFilesResult,
59
+ RoutedCodeActionResponse,
52
60
  RoutedMutationResponse,
53
61
  SemanticReadinessResult,
54
62
  WorkspaceCodeActionRequestOptions,
@@ -56,12 +64,16 @@ import type {
56
64
  WorkspaceLspRuntimeState,
57
65
  } from "./workspace-lsp-runtime.ts";
58
66
 
67
+ /** Upper bound for a server command run to capture its pushed edit. */
68
+ const COMMAND_CAPTURE_TIMEOUT_MS = 10_000;
69
+
59
70
  export type {
60
71
  ProcessCrashDiagnosticDemand,
61
72
  WorkspaceLspDiagnosticSurface,
62
73
  } from "./runtime-diagnostic-surface.ts";
63
74
  export {
64
75
  type DiagnosticEvidenceDocument,
76
+ type DiagnosticEvidenceReason,
65
77
  type DiagnosticEvidenceStatus,
66
78
  type DiagnosticEvidenceSummary,
67
79
  emptyProcessCrashRecoveryReport,
@@ -84,6 +96,7 @@ export {
84
96
  export type {
85
97
  BulkTrackFileOutcome,
86
98
  BulkTrackFilesResult,
99
+ RoutedCodeActionResponse,
87
100
  RoutedMutationDocumentSnapshot,
88
101
  RoutedMutationResponse,
89
102
  SemanticReadinessResult,
@@ -288,12 +301,43 @@ class DefaultWorkspaceLspRuntime implements WorkspaceLspRuntime {
288
301
  return this.manager.getOpenDocumentVersion(this.resolveFilePath(filePath));
289
302
  }
290
303
 
304
+ getOpenDocumentContent(filePath: string): string | null {
305
+ return this.manager.getOpenDocumentContent(this.resolveFilePath(filePath));
306
+ }
307
+
308
+ async captureCodeActionEdit(
309
+ filePath: string,
310
+ action: CodeAction,
311
+ control?: CodeRequestControl,
312
+ ): Promise<RoutedMutationResponse<CommandEditCaptureResult | null> | null> {
313
+ const resolvedPath = this.resolveFilePath(filePath);
314
+ const client = await this.manager.ensureFileOpen(resolvedPath, {
315
+ recoverProcessCrash: true,
316
+ protectInputs: true,
317
+ control,
318
+ });
319
+ if (!client) return null;
320
+ const authorizedMutationRoots = [client.root];
321
+ const outside = outsideRouteRootReason(resolvedPath, client.root);
322
+ if (outside) return { value: null, authorizedMutationRoots, reason: outside };
323
+ const listed = client.serverCapabilities?.executeCommandProvider?.commands;
324
+ const [eligible] = captureEligibleActions([action], Array.isArray(listed) ? listed : undefined);
325
+ if (!eligible) {
326
+ return { value: null, authorizedMutationRoots, reason: COMMAND_ONLY_ACTION_REASON };
327
+ }
328
+ const value = await client.captureCommandEdits(eligible.command, {
329
+ timeoutMs: COMMAND_CAPTURE_TIMEOUT_MS,
330
+ ...(control ? { control } : {}),
331
+ });
332
+ return { value, authorizedMutationRoots };
333
+ }
334
+
291
335
  async codeActions(
292
336
  filePath: string,
293
337
  positionOrRange: Position | Range,
294
338
  control?: CodeRequestControl,
295
339
  options?: WorkspaceCodeActionRequestOptions,
296
- ): Promise<RoutedMutationResponse<CodeAction[] | null> | null> {
340
+ ): Promise<RoutedCodeActionResponse | null> {
297
341
  const resolvedPath = this.resolveFilePath(filePath);
298
342
  const client = await this.manager.ensureFileOpen(resolvedPath, {
299
343
  recoverProcessCrash: true,
@@ -301,6 +345,10 @@ class DefaultWorkspaceLspRuntime implements WorkspaceLspRuntime {
301
345
  control,
302
346
  });
303
347
  if (!client) return null;
348
+ const outside = outsideRouteRootReason(resolvedPath, client.root);
349
+ if (outside) {
350
+ return { value: null, authorizedMutationRoots: [client.root], reason: outside };
351
+ }
304
352
 
305
353
  const range = isRange(positionOrRange)
306
354
  ? positionOrRange
@@ -315,21 +363,23 @@ class DefaultWorkspaceLspRuntime implements WorkspaceLspRuntime {
315
363
  triggerKind: options?.triggerKind ?? CodeActionTriggerKind.Invoked,
316
364
  ...(options?.only ? { only: [...options.only] } : {}),
317
365
  };
366
+ const advertisedKinds = advertisedCodeActionKinds(client.serverCapabilities ?? null);
367
+ const advertisedCommands = client.serverCapabilities?.executeCommandProvider?.commands;
368
+ const routed = {
369
+ authorizedMutationRoots: [client.root],
370
+ ...(advertisedKinds ? { advertisedKinds } : {}),
371
+ ...(Array.isArray(advertisedCommands) ? { advertisedCommands } : {}),
372
+ };
318
373
  if (typeof client.codeActionsDetailed === "function") {
319
374
  const result = await client.codeActionsDetailed(resolvedPath, range, context, control);
320
- return {
321
- value: result.kind === "completed" ? result.data : null,
322
- authorizedMutationRoots: [client.root],
323
- ...(result.kind === "unavailable"
324
- ? { reason: result.reason }
325
- : result.data === null
326
- ? { reason: "LSP server returned no code actions." }
327
- : {}),
328
- };
375
+ // A completed `null` result means the server has no actions here (LSP spec).
376
+ return result.kind === "completed"
377
+ ? { ...routed, value: result.data ?? [] }
378
+ : { ...routed, value: null, reason: result.reason };
329
379
  }
330
380
  return {
331
- value: await client.codeActions(resolvedPath, range, context, control),
332
- authorizedMutationRoots: [client.root],
381
+ ...routed,
382
+ value: (await client.codeActions(resolvedPath, range, context, control)) ?? [],
333
383
  };
334
384
  }
335
385
 
@@ -530,6 +580,16 @@ class DefaultWorkspaceLspRuntime implements WorkspaceLspRuntime {
530
580
  return this.manager.getOutstandingDiagnosticSummarySnapshot(maxSeverity);
531
581
  }
532
582
 
583
+ /** Return retained tracked-file removals without consuming them. */
584
+ peekRemovedTrackedFiles(scope: string | null = null): readonly string[] {
585
+ return this.manager.peekRemovedTrackedFiles(scope);
586
+ }
587
+
588
+ /** Forget retained removals that a delivered report has shown. */
589
+ acknowledgeRemovedTrackedFiles(files: readonly string[]): void {
590
+ this.manager.acknowledgeRemovedTrackedFiles(files);
591
+ }
592
+
533
593
  /** Retry failed routes and run a workspace-wide diagnostic recovery pass. */
534
594
  async recoverDiagnostics(options?: {
535
595
  restartIfStillStale?: boolean;
@@ -547,7 +607,7 @@ class DefaultWorkspaceLspRuntime implements WorkspaceLspRuntime {
547
607
  const outcome = result.refreshFailureReason ? "failed" : "completed";
548
608
  recordDebugEvent({
549
609
  source: "lsp",
550
- level: "debug",
610
+ level: outcome === "failed" ? "warning" : "info",
551
611
  category: "runtime.recovery",
552
612
  message: `LSP diagnostic recovery ${outcome}`,
553
613
  cwd: truncateIdentity(this.manager.getCwd()),
@@ -573,7 +633,7 @@ class DefaultWorkspaceLspRuntime implements WorkspaceLspRuntime {
573
633
  if (isCodeRequestInterruption(error, options?.control)) {
574
634
  recordDebugEvent({
575
635
  source: "lsp",
576
- level: "debug",
636
+ level: "info",
577
637
  category: "runtime.recovery",
578
638
  message: "LSP diagnostic recovery cancelled",
579
639
  cwd: truncateIdentity(this.manager.getCwd()),
@@ -5,6 +5,7 @@ import type { SemanticInputDocumentSnapshot } from "../client/client-semantic-in
5
5
  import type { Position, WorkspaceEdit } from "../config/types.ts";
6
6
  import type { LspManager } from "../manager/manager.ts";
7
7
  import { discoverSemanticEditFiles } from "../provider/semantic-edit-discovery.ts";
8
+ import { outsideRouteRootReason } from "./route-boundary.ts";
8
9
  import type {
9
10
  RoutedMutationDocumentSnapshot,
10
11
  RoutedMutationResponse,
@@ -26,6 +27,8 @@ export async function runRoutedRename(options: {
26
27
  });
27
28
  if (!client) return null;
28
29
  const authorizedMutationRoots = [client.root];
30
+ const outside = outsideRouteRootReason(file, client.root);
31
+ if (outside) return { value: null, authorizedMutationRoots, reason: outside };
29
32
 
30
33
  if (typeof client.renameDetailedWithSnapshots === "function") {
31
34
  return renameWithSnapshots({
@@ -1,4 +1,5 @@
1
1
  import {
2
+ type DebugLevel,
2
3
  recordDebugEvent,
3
4
  truncateDebugIdentity as truncateIdentity,
4
5
  } from "@mrclrchtr/supi-core/debug";
@@ -26,6 +27,15 @@ function boundedServerEntries(
26
27
  }));
27
28
  }
28
29
 
30
+ /**
31
+ * Crashes warn; rare recovery and retirement snapshots are `info` so they persist
32
+ * by default. Frequent startup, readiness, and tracked-file transitions stay `debug`.
33
+ */
34
+ function transitionLevel(kind: LspRuntimeTransition["kind"]): DebugLevel {
35
+ if (kind === "crash") return "warning";
36
+ return kind === "recovery" || kind === "retirement" ? "info" : "debug";
37
+ }
38
+
29
39
  /** Record bounded aggregate telemetry for one runtime transition. */
30
40
  export function recordLspRuntimeTransition(cwd: string, transition: LspRuntimeTransition): void {
31
41
  const readyClients = transition.projectServers.filter(
@@ -37,7 +47,7 @@ export function recordLspRuntimeTransition(cwd: string, transition: LspRuntimeTr
37
47
  );
38
48
  recordDebugEvent({
39
49
  source: "lsp",
40
- level: transition.kind === "crash" ? "warning" : "debug",
50
+ level: transitionLevel(transition.kind),
41
51
  category: "runtime.transition",
42
52
  message: `LSP runtime transition: ${transition.kind}`,
43
53
  cwd: truncateIdentity(cwd),
@@ -1,4 +1,5 @@
1
1
  import type { CodeQueryResult, CodeRequestControl } from "@mrclrchtr/supi-code-runtime/api";
2
+ import type { CommandEditCaptureResult } from "../client/client-edit-capture.ts";
2
3
  import type {
3
4
  CodeAction,
4
5
  CodeActionContext,
@@ -80,6 +81,14 @@ export interface RoutedMutationResponse<T> {
80
81
  readonly reason?: string;
81
82
  }
82
83
 
84
+ /** One code-action response with the routed server's negotiated kinds. */
85
+ export interface RoutedCodeActionResponse extends RoutedMutationResponse<CodeAction[] | null> {
86
+ /** Negotiated `codeActionProvider.codeActionKinds`; undefined when the server did not narrow them. */
87
+ readonly advertisedKinds?: readonly string[];
88
+ /** Negotiated `executeCommandProvider.commands`; undefined when the server lists none. */
89
+ readonly advertisedCommands?: readonly string[];
90
+ }
91
+
83
92
  /** Extra protocol context for one explicit code-action request. */
84
93
  export interface WorkspaceCodeActionRequestOptions {
85
94
  /** Operation-specific CodeActionKind filters. */
@@ -164,8 +173,22 @@ export interface WorkspaceLspRuntime extends WorkspaceLspDiagnosticSurface {
164
173
  positionOrRange: Position | Range,
165
174
  control?: CodeRequestControl,
166
175
  options?: WorkspaceCodeActionRequestOptions,
167
- ): Promise<RoutedMutationResponse<CodeAction[] | null> | null>;
176
+ ): Promise<RoutedCodeActionResponse | null>;
177
+ /**
178
+ * Run the command of one command-only code action on the client routed to
179
+ * `filePath` and capture the single edit the server pushes. No pushed edit is
180
+ * applied. The runtime enforces eligibility itself: a `refactor*`,
181
+ * `source.organizeImports*`, or `source.fixAll*` kind, and a command the
182
+ * server lists when it lists any; other actions are unavailable unrun.
183
+ */
184
+ captureCodeActionEdit(
185
+ filePath: string,
186
+ action: CodeAction,
187
+ control?: CodeRequestControl,
188
+ ): Promise<RoutedMutationResponse<CommandEditCaptureResult | null> | null>;
168
189
  getOpenDocumentVersion(filePath: string): number | null;
190
+ /** Text last synchronized to the server for an open document, or null when not open. */
191
+ getOpenDocumentContent(filePath: string): string | null;
169
192
  /**
170
193
  * Wait for file readiness; an explicit refresh may make one shared route
171
194
  * retry for this call without changing ordinary request recovery limits.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrclrchtr/supi-code-runtime",
3
- "version": "11.4.0",
3
+ "version": "13.0.0",
4
4
  "description": "Shared workspace context and capability contracts for code intelligence",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -60,6 +60,7 @@ export type {
60
60
  ImportData,
61
61
  NodeAtData,
62
62
  OutlineData,
63
+ RefactorActionIdentity,
63
64
  RefactorOperation,
64
65
  RefactorRequest,
65
66
  RefactorResult,
@@ -193,31 +193,53 @@ export interface WorkspaceEdit {
193
193
  }
194
194
 
195
195
  /**
196
- * Supported refactor operation names for the current semantic planning path.
197
- */
198
- export type RefactorOperation =
199
- | "rename_symbol"
200
- | "extract_function"
201
- | "extract_variable"
202
- | "rename_file"
203
- | "move_file"
204
- | "update_imports"
205
- | "delete_dead_code";
206
-
207
- /**
208
- * Operation-aware refactor planning request.
196
+ * Operation-aware refactor planning request. Each operation carries only the
197
+ * scope it needs:
209
198
  *
210
- * Consumers provide a target file/position plus operation-specific options.
211
- * File/resource operations remain requestable so providers can reject them
212
- * explicitly and honestly until shared workspace-edit resource ops exist.
199
+ * - `rename_symbol`: one symbol position and the new name.
200
+ * - `code_action`: one file range and a CodeActionKind prefix under `refactor`.
201
+ * - `source_action`: one whole file and a CodeActionKind prefix under `source`.
202
+ *
203
+ * `kind` matches the requested kind and its dotted sub-kinds. `title`, when
204
+ * present, selects one action by its exact title.
213
205
  */
214
- export interface RefactorRequest {
215
- operation: RefactorOperation;
216
- file: string;
217
- position: CodePosition;
218
- range?: SourceRange;
219
- newName?: string;
220
- destination?: string;
206
+ export type RefactorRequest =
207
+ | {
208
+ operation: "rename_symbol";
209
+ file: string;
210
+ position: CodePosition;
211
+ newName: string;
212
+ }
213
+ | {
214
+ operation: "code_action";
215
+ file: string;
216
+ range: SourceRange;
217
+ kind: string;
218
+ title?: string;
219
+ }
220
+ | {
221
+ operation: "source_action";
222
+ file: string;
223
+ kind: string;
224
+ title?: string;
225
+ };
226
+
227
+ /** Supported refactor operation names. */
228
+ export type RefactorOperation = RefactorRequest["operation"];
229
+
230
+ /** The code action selected for a precise code- or source-action plan. */
231
+ export interface RefactorActionIdentity {
232
+ /** Server-reported CodeActionKind. */
233
+ kind: string;
234
+ /** Server-reported action title. */
235
+ title: string;
236
+ /**
237
+ * How the edits were obtained: `edit` from the action itself (after
238
+ * `codeAction/resolve` when needed), or `captured-command` from the single
239
+ * `workspace/applyEdit` the server pushed while running the action's command.
240
+ * Captured edits were refused, never applied.
241
+ */
242
+ provenance?: "edit" | "captured-command";
221
243
  }
222
244
 
223
245
  /**
@@ -228,6 +250,10 @@ export interface DisambiguationCandidate {
228
250
  file?: string;
229
251
  line?: number;
230
252
  character?: number;
253
+ /** Server-reported CodeActionKind, for code-action candidates. */
254
+ kind?: string;
255
+ /** Exact action title to pass back as `title`, for code-action candidates. */
256
+ title?: string;
231
257
  }
232
258
 
233
259
  /**
@@ -241,6 +267,8 @@ export type RefactorResult =
241
267
  | {
242
268
  kind: "precise";
243
269
  edits: WorkspaceEdit;
270
+ /** The selected code action, for code- and source-action plans. */
271
+ action?: RefactorActionIdentity;
244
272
  /** Provider roots authorized by the semantic route. Consumers canonicalize before storage. */
245
273
  authorizedMutationRoots: string[];
246
274
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrclrchtr/supi-core",
3
- "version": "11.4.0",
3
+ "version": "13.0.0",
4
4
  "description": "Shared settings, configuration, reporting, and session infrastructure",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -63,8 +63,10 @@
63
63
  "./project": "./src/project.ts",
64
64
  "./prompt-surface": "./src/prompt-surface.ts",
65
65
  "./report": "./src/report.ts",
66
+ "./retired-packages": "./src/retired-packages.ts",
66
67
  "./session": "./src/session.ts",
67
68
  "./settings": "./src/settings.ts",
69
+ "./spill": "./src/spill.ts",
68
70
  "./spinner-frames": "./src/spinner-frames.ts",
69
71
  "./status-spinner": "./src/status-spinner.ts",
70
72
  "./terminal": "./src/terminal.ts",
@@ -29,10 +29,14 @@ export * from "./prompt-surface.ts";
29
29
  // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
30
30
  export * from "./report.ts";
31
31
  // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
32
+ export * from "./retired-packages.ts";
33
+ // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
32
34
  export * from "./session.ts";
33
35
  // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
34
36
  export * from "./settings.ts";
35
37
  // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
38
+ export * from "./spill.ts";
39
+ // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
36
40
  export * from "./spinner-frames.ts";
37
41
  // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
38
42
  export * from "./status-spinner.ts";
@@ -8,7 +8,7 @@
8
8
  /**
9
9
  * Wrap content in an `<extension-context>` XML tag.
10
10
  *
11
- * @param source - Extension identifier (e.g. "supi-claude-md", "supi-lsp")
11
+ * @param source - Extension identifier (e.g. "supi-lsp")
12
12
  * @param content - The text content to wrap
13
13
  * @param attrs - Optional additional attributes (rendered as key="value")
14
14
  * @returns Formatted XML string
@@ -18,6 +18,12 @@ export interface DebugRegistryConfig {
18
18
  agentRunRetrospectivesEnabled: boolean;
19
19
  /** Maximum number of session-local events to keep in memory. */
20
20
  maxEvents: number;
21
+ /**
22
+ * Minimum level forwarded to persistence sinks. Lower-level events stay in the
23
+ * live retained buffer only, so high-volume `debug` telemetry does not grow
24
+ * session files.
25
+ */
26
+ persistLevel: DebugLevel;
21
27
  }
22
28
 
23
29
  export const DEBUG_REGISTRY_DEFAULTS: DebugRegistryConfig = {
@@ -25,8 +31,11 @@ export const DEBUG_REGISTRY_DEFAULTS: DebugRegistryConfig = {
25
31
  agentAccess: "sanitized",
26
32
  agentRunRetrospectivesEnabled: false,
27
33
  maxEvents: 100,
34
+ persistLevel: "info",
28
35
  };
29
36
 
37
+ const DEBUG_LEVEL_RANK: Record<DebugLevel, number> = { debug: 0, info: 1, warning: 2, error: 3 };
38
+
30
39
  export interface DebugEventInput {
31
40
  /** Opaque identity for events directly owned by one public Tool call. */
32
41
  operationId?: string;
@@ -150,6 +159,10 @@ export function isDebugLevel(value: unknown): value is DebugLevel {
150
159
  return value === "debug" || value === "info" || value === "warning" || value === "error";
151
160
  }
152
161
 
162
+ function shouldPersist(state: DebugRegistryState, level: DebugLevel): boolean {
163
+ return DEBUG_LEVEL_RANK[level] >= DEBUG_LEVEL_RANK[state.config.persistLevel];
164
+ }
165
+
153
166
  /** Return whether a value has the exact 16-byte base64url Debug Operation ID form. */
154
167
  export function isDebugOperationId(value: unknown): value is string {
155
168
  return typeof value === "string" && DEBUG_OPERATION_ID_RE.test(value);
@@ -194,6 +207,9 @@ export function configureDebugRegistry(config: Partial<DebugRegistryConfig>): De
194
207
  ...state.config,
195
208
  ...config,
196
209
  maxEvents: normalizeMaxEvents(config.maxEvents ?? state.config.maxEvents),
210
+ persistLevel: isDebugLevel(config.persistLevel)
211
+ ? config.persistLevel
212
+ : state.config.persistLevel,
197
213
  };
198
214
  trimToMaxEvents(state);
199
215
  return getDebugRegistryConfig();
@@ -211,14 +227,16 @@ export function isDebugRegistryEnabled(): boolean {
211
227
 
212
228
  /**
213
229
  * Return whether a retrospective can be captured: Debug and its explicit opt-in
214
- * must be enabled, and at least one persistence sink must be registered.
230
+ * must be enabled, at least one persistence sink must be registered, and the
231
+ * persistence threshold must admit `info` events.
215
232
  */
216
233
  export function canRecordAgentRunRetrospective(): boolean {
217
234
  const state = getState();
218
235
  return (
219
236
  state.config.enabled &&
220
237
  state.config.agentRunRetrospectivesEnabled &&
221
- state.persistenceSinks.size > 0
238
+ state.persistenceSinks.size > 0 &&
239
+ shouldPersist(state, "info")
222
240
  );
223
241
  }
224
242
 
@@ -283,7 +301,8 @@ export function recordDebugEvent(input: DebugEventInput): DebugEvent | null {
283
301
  // Debug-event consumers must not alter producer behavior.
284
302
  }
285
303
  }
286
- for (const sink of state.persistenceSinks) {
304
+ const sinks = shouldPersist(state, event.level) ? state.persistenceSinks : [];
305
+ for (const sink of sinks) {
287
306
  try {
288
307
  sink(toSanitizedView(event));
289
308
  } catch {
@@ -0,0 +1,152 @@
1
+ // supi-core retired-packages domain — warn when a retired SuPi package is still declared.
2
+ //
3
+ // Retired packages keep loading after an upgrade until the user removes them, and their
4
+ // surfaces can shadow the package that absorbed them. Detection reads the declared Pi
5
+ // packages per scope, the same view `pi remove` acts on, and never infers identity from paths.
6
+
7
+ import type {
8
+ ExtensionAPI,
9
+ ExtensionContext,
10
+ PackageSource,
11
+ } from "@earendil-works/pi-coding-agent";
12
+ import { SettingsManager } from "@earendil-works/pi-coding-agent";
13
+ import { recordDebugEvent } from "./debug-registry.ts";
14
+
15
+ /** A retired npm package and the package that now ships its features. */
16
+ export interface RetiredPackage {
17
+ /** npm package name, e.g. `"@mrclrchtr/supi-cache"`. */
18
+ name: string;
19
+ /** npm package name that absorbed it, e.g. `"@mrclrchtr/supi-debug"`. */
20
+ replacement: string;
21
+ }
22
+
23
+ /** Pi settings scope of a package declaration. */
24
+ export type PackageDeclarationScope = "user" | "project";
25
+
26
+ /** One declaration of a retired package found in Pi settings. */
27
+ export interface RetiredPackageDeclaration {
28
+ package: RetiredPackage;
29
+ scope: PackageDeclarationScope;
30
+ /** Exact command that removes this declaration. */
31
+ removeCommand: string;
32
+ }
33
+
34
+ /** Declared Pi packages per scope. Omit `project` when the project is not trusted. */
35
+ export interface DeclaredPackages {
36
+ user: readonly PackageSource[];
37
+ project?: readonly PackageSource[];
38
+ }
39
+
40
+ /** Options for {@link warnRetiredPackages}. */
41
+ export interface WarnRetiredPackagesOptions {
42
+ /** Debug event source, e.g. `"supi-debug"`. */
43
+ source: string;
44
+ /** Override Pi's agent directory (tests). */
45
+ agentDir?: string;
46
+ }
47
+
48
+ const WARNED_KEY = Symbol.for("@mrclrchtr/supi-core/retired-packages-warned");
49
+ const NPM_PREFIX = "npm:";
50
+ const NPM_NAME_RE = /^(@[^/\s]+\/[^@\s]+|[^@\s]+)(?:@.+)?$/;
51
+
52
+ /** npm package name of a Pi package source, ignoring version pins; `undefined` for non-npm sources. */
53
+ export function npmPackageName(source: PackageSource): string | undefined {
54
+ const value = (typeof source === "string" ? source : source.source).trim();
55
+ if (!value.startsWith(NPM_PREFIX)) return undefined;
56
+ return NPM_NAME_RE.exec(value.slice(NPM_PREFIX.length).trim())?.[1];
57
+ }
58
+
59
+ /** Find declarations of retired packages, project scope first (Pi's load precedence). */
60
+ export function findRetiredPackageDeclarations(
61
+ declared: DeclaredPackages,
62
+ retired: readonly RetiredPackage[],
63
+ ): RetiredPackageDeclaration[] {
64
+ const scopes: Array<[PackageDeclarationScope, readonly PackageSource[] | undefined]> = [
65
+ ["project", declared.project],
66
+ ["user", declared.user],
67
+ ];
68
+ const found: RetiredPackageDeclaration[] = [];
69
+ for (const [scope, sources] of scopes) {
70
+ const names = new Set((sources ?? []).map(npmPackageName));
71
+ for (const pkg of retired) {
72
+ if (!names.has(pkg.name)) continue;
73
+ const local = scope === "project" ? " --local" : "";
74
+ found.push({ package: pkg, scope, removeCommand: `pi remove npm:${pkg.name}${local}` });
75
+ }
76
+ }
77
+ return found;
78
+ }
79
+
80
+ /** Format one bounded, actionable warning for one retired package. */
81
+ export function formatRetiredPackageWarning(
82
+ pkg: RetiredPackage,
83
+ declarations: readonly RetiredPackageDeclaration[],
84
+ ): string {
85
+ const commands = declarations.map((declaration) => ` ${declaration.removeCommand}`);
86
+ return [
87
+ `${pkg.name} is retired; ${pkg.replacement} now ships its features, and the old package can override them. Remove it:`,
88
+ ...commands,
89
+ ].join("\n");
90
+ }
91
+
92
+ function warnedNames(): Set<string> {
93
+ const store = globalThis as Record<symbol, Set<string> | undefined>;
94
+ store[WARNED_KEY] ??= new Set();
95
+ return store[WARNED_KEY];
96
+ }
97
+
98
+ function readDeclaredPackages(
99
+ ctx: Pick<ExtensionContext, "cwd" | "isProjectTrusted">,
100
+ agentDir: string | undefined,
101
+ ): DeclaredPackages {
102
+ const projectTrusted = ctx.isProjectTrusted();
103
+ const settings = SettingsManager.create(ctx.cwd, agentDir, { projectTrusted });
104
+ return {
105
+ user: settings.getGlobalSettings().packages ?? [],
106
+ ...(projectTrusted ? { project: settings.getProjectSettings().packages ?? [] } : {}),
107
+ };
108
+ }
109
+
110
+ /**
111
+ * Warn once per Pi process for each retired package that is still declared in user or
112
+ * trusted project settings. Shows a UI warning, or writes to stderr without UI, and records
113
+ * a `retired-package` Debug event. Never throws; unreadable settings skip the check.
114
+ */
115
+ export function warnRetiredPackages(
116
+ pi: ExtensionAPI,
117
+ retired: readonly RetiredPackage[],
118
+ options: WarnRetiredPackagesOptions,
119
+ ): void {
120
+ pi.on("session_start", (_event, ctx) => {
121
+ const warned = warnedNames();
122
+ const pending = retired.filter((pkg) => !warned.has(pkg.name));
123
+ if (pending.length === 0) return;
124
+
125
+ let declarations: RetiredPackageDeclaration[];
126
+ try {
127
+ declarations = findRetiredPackageDeclarations(
128
+ readDeclaredPackages(ctx, options.agentDir),
129
+ pending,
130
+ );
131
+ } catch {
132
+ return;
133
+ }
134
+
135
+ for (const pkg of pending) {
136
+ const matches = declarations.filter((declaration) => declaration.package === pkg);
137
+ if (matches.length === 0) continue;
138
+ warned.add(pkg.name);
139
+ const message = formatRetiredPackageWarning(pkg, matches);
140
+ if (ctx.hasUI) ctx.ui.notify(message, "warning");
141
+ else process.stderr.write(`${message}\n`);
142
+ recordDebugEvent({
143
+ source: options.source,
144
+ level: "warning",
145
+ category: "retired-package",
146
+ message: `${pkg.name} is retired but still declared`,
147
+ cwd: ctx.cwd,
148
+ data: { name: pkg.name, replacement: pkg.replacement, scopes: matches.map((m) => m.scope) },
149
+ });
150
+ }
151
+ });
152
+ }
@@ -56,3 +56,4 @@ export {
56
56
  createSessionNameTracker,
57
57
  getActiveBranchEntries,
58
58
  } from "./session-utils.ts";
59
+ export { BSD_SED_HINT, BSD_SED_HINT_MARKER, registerShellHints } from "./shell-hints.ts";