@mrclrchtr/supi-code-intelligence 12.0.0 → 14.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 (307) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/README.md +7 -5
  3. package/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
  4. package/node_modules/@mrclrchtr/supi-code-runtime/src/query-result.ts +10 -0
  5. package/node_modules/@mrclrchtr/supi-core/package.json +3 -1
  6. package/node_modules/@mrclrchtr/supi-core/src/api.ts +4 -0
  7. package/node_modules/@mrclrchtr/supi-core/src/context/context-tag.ts +1 -1
  8. package/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +78 -13
  9. package/node_modules/@mrclrchtr/supi-core/src/footer-registry.ts +41 -9
  10. package/node_modules/@mrclrchtr/supi-core/src/retired-packages.ts +152 -0
  11. package/node_modules/@mrclrchtr/supi-core/src/session.ts +3 -0
  12. package/node_modules/@mrclrchtr/supi-core/src/shell-hints.ts +46 -0
  13. package/node_modules/@mrclrchtr/supi-core/src/side-run.ts +46 -0
  14. package/node_modules/@mrclrchtr/supi-core/src/spill.ts +93 -0
  15. package/node_modules/@mrclrchtr/supi-lsp/README.md +6 -2
  16. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
  17. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/query-result.ts +10 -0
  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 +78 -13
  22. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/footer-registry.ts +41 -9
  23. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/retired-packages.ts +152 -0
  24. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/session.ts +3 -0
  25. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/shell-hints.ts +46 -0
  26. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/side-run.ts +46 -0
  27. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/spill.ts +93 -0
  28. package/node_modules/@mrclrchtr/supi-lsp/package.json +8 -8
  29. package/node_modules/@mrclrchtr/supi-lsp/src/api.ts +1 -0
  30. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-cache.ts +102 -47
  31. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-host.ts +8 -0
  32. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-refresh.ts +20 -1
  33. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-request.ts +4 -1
  34. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-timing.ts +14 -1
  35. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-typescript.ts +8 -1
  36. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostics.ts +50 -4
  37. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-disk-stamp.ts +60 -0
  38. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-document-state.ts +3 -0
  39. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-document-sync.ts +21 -1
  40. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-file-state.ts +17 -3
  41. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-input-admission.ts +7 -1
  42. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-semantic-input-barrier.ts +53 -4
  43. package/node_modules/@mrclrchtr/supi-lsp/src/client/client.ts +12 -3
  44. package/node_modules/@mrclrchtr/supi-lsp/src/client/transport.ts +24 -8
  45. package/node_modules/@mrclrchtr/supi-lsp/src/config/server-config.ts +5 -0
  46. package/node_modules/@mrclrchtr/supi-lsp/src/config/tsconfig-extends.ts +2 -1
  47. package/node_modules/@mrclrchtr/supi-lsp/src/config/tsconfig-path.ts +2 -2
  48. package/node_modules/@mrclrchtr/supi-lsp/src/config/tsconfig-scope.ts +17 -5
  49. package/node_modules/@mrclrchtr/supi-lsp/src/config/typescript-module.ts +17 -0
  50. package/node_modules/@mrclrchtr/supi-lsp/src/debug-telemetry.ts +64 -0
  51. package/node_modules/@mrclrchtr/supi-lsp/src/diagnostics/evidence.ts +42 -0
  52. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-client-state.ts +2 -17
  53. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-project-info.ts +3 -0
  54. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-removal-ledger.ts +52 -0
  55. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-typescript-coverage.ts +27 -2
  56. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-workspace-symbol.ts +16 -112
  57. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager.ts +561 -103
  58. package/node_modules/@mrclrchtr/supi-lsp/src/manager/typescript-file-local.ts +6 -1
  59. package/node_modules/@mrclrchtr/supi-lsp/src/manager/workspace-symbol-collection.ts +163 -0
  60. package/node_modules/@mrclrchtr/supi-lsp/src/manager/workspace-symbol-row-limit.ts +72 -0
  61. package/node_modules/@mrclrchtr/supi-lsp/src/provider/lsp-semantic-provider.ts +6 -1
  62. package/node_modules/@mrclrchtr/supi-lsp/src/provider/semantic-symbol-mapper.ts +13 -3
  63. package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-controller.ts +11 -0
  64. package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-diagnostic-surface.ts +11 -0
  65. package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-diagnostics.ts +1 -0
  66. package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-registry.ts +53 -9
  67. package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-transition-debug.ts +11 -1
  68. package/node_modules/@mrclrchtr/supi-lsp/src/session/workspace-lsp-runtime.ts +2 -0
  69. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
  70. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/query-result.ts +10 -0
  71. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/package.json +3 -1
  72. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/api.ts +4 -0
  73. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/context/context-tag.ts +1 -1
  74. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +78 -13
  75. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/footer-registry.ts +41 -9
  76. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/retired-packages.ts +152 -0
  77. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/session.ts +3 -0
  78. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/shell-hints.ts +46 -0
  79. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/side-run.ts +46 -0
  80. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/spill.ts +93 -0
  81. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.cjs +50 -75
  82. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.cjs.map +2 -2
  83. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.js +50 -75
  84. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.js.map +2 -2
  85. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.wasm +0 -0
  86. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.wasm.map +6 -6
  87. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/package.json +1 -1
  88. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.cjs +50 -75
  89. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.cjs.map +2 -2
  90. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.cts +7 -7
  91. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.cts.map +1 -1
  92. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.ts +7 -7
  93. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.ts.map +1 -1
  94. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.js +50 -75
  95. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.js.map +2 -2
  96. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.wasm +0 -0
  97. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.wasm.map +5 -5
  98. package/node_modules/@mrclrchtr/supi-tree-sitter/package.json +5 -5
  99. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/kotlin/tree-sitter-kotlin.wasm.json +1 -1
  100. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/latex/tree-sitter-latex.wasm.json +1 -1
  101. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/sql/tree-sitter-sql.wasm +0 -0
  102. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/sql/tree-sitter-sql.wasm.json +3 -3
  103. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/tsx/tree-sitter-tsx.wasm.json +1 -1
  104. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/typescript/tree-sitter-typescript.wasm.json +1 -1
  105. package/node_modules/@mrclrchtr/supi-tree-sitter/src/session/structural-worker-client.ts +1 -1
  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 +32 -9
  230. package/src/analysis/health/signals.ts +1 -0
  231. package/src/analysis/instruction-files.ts +11 -7
  232. package/src/analysis/search/exclusions.ts +18 -4
  233. package/src/analysis/search/pattern.ts +3 -3
  234. package/src/analysis/target/anchored.ts +3 -6
  235. package/src/analysis/target/file-outline-omissions.ts +17 -2
  236. package/src/analysis/target/symbol-selection.ts +100 -0
  237. package/src/analysis/target/symbol.ts +83 -49
  238. package/src/analysis/target/types.ts +12 -10
  239. package/src/analysis/workspace/cmake-parser.ts +207 -0
  240. package/src/analysis/workspace/cmake.ts +141 -0
  241. package/src/analysis/workspace/maven.ts +310 -0
  242. package/src/analysis/workspace/membership.ts +100 -26
  243. package/src/analysis/workspace/metadata.ts +6 -1
  244. package/src/analysis/workspace/observe.ts +6 -0
  245. package/src/analysis/workspace/types.ts +11 -3
  246. package/src/app/app.ts +37 -21
  247. package/src/diagnostics/coverage.ts +49 -0
  248. package/src/diagnostics/evidence.ts +10 -2
  249. package/src/extension.ts +1 -2
  250. package/src/headless.ts +4 -2
  251. package/src/session/health-types.ts +2 -0
  252. package/src/session/health-workflow.ts +6 -0
  253. package/src/session/input/common.ts +1 -1
  254. package/src/session/orientation/collect.ts +42 -7
  255. package/src/session/orientation/context-facts.ts +3 -3
  256. package/src/session/orientation/context-sections.ts +13 -15
  257. package/src/session/orientation/facts.ts +5 -8
  258. package/src/session/orientation-types.ts +5 -0
  259. package/src/session/orientation-workflow.ts +12 -17
  260. package/src/session/target-workflow.ts +38 -25
  261. package/src/tool/code_find/render.ts +10 -11
  262. package/src/tool/code_find/result.ts +11 -8
  263. package/src/tool/code_graph/display.ts +5 -6
  264. package/src/tool/code_graph/format.ts +8 -24
  265. package/src/tool/code_graph/result.ts +16 -75
  266. package/src/tool/code_graph/section.ts +21 -33
  267. package/src/tool/code_graph/structured.ts +3 -0
  268. package/src/tool/code_graph/tui.ts +10 -5
  269. package/src/tool/code_health/diagnostic-tui.ts +49 -0
  270. package/src/tool/code_health/guidance.ts +27 -0
  271. package/src/tool/code_health/markdown.ts +63 -9
  272. package/src/tool/code_health/result.ts +20 -9
  273. package/src/tool/code_health/structured-schema.ts +15 -0
  274. package/src/tool/code_health/structured.ts +9 -1
  275. package/src/tool/code_health/tui.ts +33 -40
  276. package/src/tool/code_inspect/result.ts +23 -18
  277. package/src/tool/code_inspect/structured.ts +2 -19
  278. package/src/tool/code_orientation/markdown.ts +6 -1
  279. package/src/tool/code_orientation/result.ts +53 -100
  280. package/src/tool/code_orientation/structured-schema.ts +16 -12
  281. package/src/tool/code_orientation/structured-workspace.ts +13 -7
  282. package/src/tool/code_orientation/structured.ts +31 -39
  283. package/src/tool/code_orientation/workspace-format.ts +4 -10
  284. package/src/tool/code_orientation/workspace-instructions.ts +4 -5
  285. package/src/tool/code_orientation/workspace-observations.ts +2 -2
  286. package/src/tool/code_orientation/workspace-output.ts +16 -7
  287. package/src/tool/code_orientation/workspace-projects.ts +7 -10
  288. package/src/tool/code_orientation/workspace-sections.ts +13 -19
  289. package/src/tool/code_resolve/markdown.ts +4 -46
  290. package/src/tool/code_resolve/result.ts +45 -73
  291. package/src/tool/code_resolve/structured.ts +6 -1
  292. package/src/tool/infra/truncate.ts +2 -16
  293. package/src/tool/result/candidate-selection.ts +157 -0
  294. package/src/tool/result/display.ts +41 -45
  295. package/src/tool/result/errors.ts +1 -0
  296. package/src/tool/result/model-budget.ts +26 -1
  297. package/src/tool/result/refactor.ts +11 -8
  298. package/src/tool/result/structured.ts +2 -1
  299. package/src/tool/result/types.ts +9 -8
  300. package/src/tool/schemas.ts +15 -20
  301. package/src/ui/footer.ts +147 -44
  302. package/src/ui/status-overlay.ts +13 -8
  303. package/src/ui/status-presentation.ts +4 -7
  304. package/src/ui/tui/candidate-selection.ts +40 -95
  305. package/src/ui/tui/common.ts +16 -70
  306. package/src/ui/tui/display.ts +6 -24
  307. package/src/tool/result/candidate-row.ts +0 -49
@@ -0,0 +1,46 @@
1
+ // Side-run signal shared over `pi.events`.
2
+ //
3
+ // A side run is agent work whose result the session will not continue from,
4
+ // such as a run on a branch that is abandoned afterwards. Listeners use the
5
+ // signal to skip work tied to the run's result, for example prompt suggestions.
6
+
7
+ import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
8
+
9
+ /** Event emitted on `pi.events` when a side run starts. Payload: {@link SideRunEvent}. */
10
+ export const SIDE_RUN_START_EVENT = "supi:side-run:start";
11
+
12
+ /** Event emitted on `pi.events` when a side run ends. Payload: {@link SideRunEvent}. */
13
+ export const SIDE_RUN_END_EVENT = "supi:side-run:end";
14
+
15
+ /** Payload of {@link SIDE_RUN_START_EVENT} and {@link SIDE_RUN_END_EVENT}. */
16
+ export interface SideRunEvent {
17
+ /** Emitting package, such as `supi-debug`. */
18
+ readonly source: string;
19
+ }
20
+
21
+ /**
22
+ * Run `run` as a side run: emit {@link SIDE_RUN_START_EVENT} before it and
23
+ * {@link SIDE_RUN_END_EVENT} after it, also when it throws.
24
+ *
25
+ * After a session replacement or reload the captured `pi` is stale and its
26
+ * `events.emit` throws. That end signal is dropped instead of masking the
27
+ * run's result; listeners reset their side-run state on `session_start` and
28
+ * `session_shutdown`.
29
+ */
30
+ export async function runSideRun<T>(
31
+ pi: Pick<ExtensionAPI, "events">,
32
+ source: string,
33
+ run: () => Promise<T>,
34
+ ): Promise<T> {
35
+ const payload: SideRunEvent = { source };
36
+ pi.events.emit(SIDE_RUN_START_EVENT, payload);
37
+ try {
38
+ return await run();
39
+ } finally {
40
+ try {
41
+ pi.events.emit(SIDE_RUN_END_EVENT, payload);
42
+ } catch {
43
+ // Stale extension instance after session replacement; see JSDoc.
44
+ }
45
+ }
46
+ }
@@ -0,0 +1,93 @@
1
+ // supi-core spill domain — create-only temp files for full tool output (#597).
2
+ //
3
+ // SuPi never deletes spill files. Instead, it writes few of them: one private base directory per
4
+ // user, content-addressed names, and reuse for identical content. The OS temp purge owns their
5
+ // lifetime, so paths returned to the model stay readable for the session.
6
+
7
+ import { createHash, randomBytes } from "node:crypto";
8
+ import { lstatSync, mkdirSync, mkdtempSync, renameSync, writeFileSync } from "node:fs";
9
+ import { tmpdir } from "node:os";
10
+ import { extname, join } from "node:path";
11
+
12
+ /** Input for {@link writeSpillFile}. */
13
+ export interface SpillFileOptions {
14
+ /** Producer id used as sub-directory, e.g. `"agent"`. Lowercase letters, digits, and dashes. */
15
+ owner: string;
16
+ /** Descriptive file name, e.g. `"snapshot.md"`. The content hash is inserted before the extension. */
17
+ name: string;
18
+ /** Full content to persist: text (written as UTF-8) or raw bytes. */
19
+ content: string | Uint8Array;
20
+ }
21
+
22
+ const SEGMENT = /^[a-z0-9][a-z0-9-]*$/;
23
+ const FILE_NAME = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
24
+
25
+ /**
26
+ * Persist full output that did not fit inline and return its absolute path.
27
+ *
28
+ * Layout: `$TMPDIR/supi-<uid>/<owner>/<stem>-<sha256 prefix><ext>`. Identical content maps to the
29
+ * same file, which is reused. Both directories must be real directories owned by the current
30
+ * user without group/other access; otherwise the file falls back to a fresh `mkdtemp`
31
+ * directory, as before. Files are created with mode `0600` and published atomically by rename.
32
+ */
33
+ export function writeSpillFile({ owner, name, content }: SpillFileOptions): string {
34
+ if (!SEGMENT.test(owner)) throw new Error(`Invalid spill owner: ${owner}`);
35
+ if (!FILE_NAME.test(name)) throw new Error(`Invalid spill file name: ${name}`);
36
+ const extension = extname(name);
37
+ const stem = name.slice(0, name.length - extension.length);
38
+ const hash = createHash("sha256").update(content).digest("hex").slice(0, 32);
39
+ const fileName = `${stem}-${hash}${extension}`;
40
+
41
+ const directory = privateSpillDirectory(owner);
42
+ if (!directory) {
43
+ const fallback = join(mkdtempSync(join(tmpdir(), `supi-${owner}-`)), fileName);
44
+ writeFileSync(fallback, content, { encoding: "utf8", mode: 0o600, flag: "wx" });
45
+ return fallback;
46
+ }
47
+
48
+ const target = join(directory, fileName);
49
+ if (isRegularFile(target)) return target;
50
+ const staging = join(directory, `.${fileName}.${process.pid}.${randomBytes(4).toString("hex")}`);
51
+ writeFileSync(staging, content, { encoding: "utf8", mode: 0o600, flag: "wx" });
52
+ // Atomic publish; a concurrent writer of the same hash replaces it with identical bytes.
53
+ renameSync(staging, target);
54
+ return target;
55
+ }
56
+
57
+ /** Return the validated private spill directory for `owner`, or undefined when it is unsafe. */
58
+ function privateSpillDirectory(owner: string): string | undefined {
59
+ const uid = process.getuid?.();
60
+ const base = join(tmpdir(), uid === undefined ? "supi" : `supi-${uid}`);
61
+ if (!ensurePrivateDirectory(base, uid)) return undefined;
62
+ const directory = join(base, owner);
63
+ return ensurePrivateDirectory(directory, uid) ? directory : undefined;
64
+ }
65
+
66
+ /**
67
+ * Create `path` with mode `0700` if missing, then accept it only when it is a real directory
68
+ * (not a symlink) owned by `uid` with no group/other permissions. Never modifies or removes an
69
+ * existing entry. Ownership and mode checks are skipped where POSIX ids are unavailable.
70
+ */
71
+ function ensurePrivateDirectory(path: string, uid: number | undefined): boolean {
72
+ try {
73
+ mkdirSync(path, { mode: 0o700 });
74
+ } catch (error) {
75
+ if ((error as NodeJS.ErrnoException).code !== "EEXIST") return false;
76
+ }
77
+ try {
78
+ const stats = lstatSync(path);
79
+ if (!stats.isDirectory() || stats.isSymbolicLink()) return false;
80
+ if (uid === undefined) return true;
81
+ return stats.uid === uid && (stats.mode & 0o077) === 0;
82
+ } catch {
83
+ return false;
84
+ }
85
+ }
86
+
87
+ function isRegularFile(path: string): boolean {
88
+ try {
89
+ return lstatSync(path).isFile();
90
+ } catch {
91
+ return false;
92
+ }
93
+ }
@@ -64,6 +64,8 @@ A configured route is not a ready server. Features depend on the active server,
64
64
 
65
65
  The [operation-support model](src/config/operation-support.ts) separates server advertisement from SuPi planning limits. A server can advertise an action that SuPi cannot safely turn into a plan.
66
66
 
67
+ A TypeScript server answers `workspace/symbol` from loaded projects only. One pass per TypeScript route opens one source file per project root (up to 96 roots). It starts in the background once the route is ready after startup; shutdown and a route restart abort it. While it runs, the route's `ProjectServerInfo` carries `loadingProjects: true` and `ready` is unchanged; a lifecycle transition is published when the pass starts and when it ends. The opened files stay tracked documents, so diagnostic refreshes include them even in a session that never runs a symbol query. A query that arrives during the pass waits for it, and a query that finds no recorded pass runs one for its scope before it collects. Later queries reuse the pass until the route restarts or a project config changes. A project config change during a pass leaves it unrecorded, and a query that ran that pass is partial. Roots past the limit and a native-server answer at its 256-row limit make the result partial; tsserver has no row limit. A cut answer that provably holds every declaration of the queried name (the server sorts exact names first) carries `metadata.rowLimit.exactNamesComplete: true`, so exact-name target selection stays possible; every row-limited result carries `metadata.rowLimit`. Other servers are warmed only until one row answers the request.
68
+
67
69
  Workspace-symbol scopes select contributing routes and bound query completeness; returned data can still contain out-of-scope rows, which consumers must filter. An automatic-policy exclusion does not make a scoped query partial when both its observed path and physical identity are proven outside every requested scope. In-scope exclusions, aliases that may overlap, unresolved paths, and contributing route failures remain partial. Unscoped queries retain all exclusion evidence. Partial metadata sets `exclusionOnly` when policy exclusions are the only gap, with no route failure or inferred-project coverage gap. Explicitly selected excluded files and directories remain inspectable; when a scoped query returns no row inside any scope, warm-up may open files inside those selected scopes so a server that only indexes opened documents can report them. Automatic path rules and target-uniqueness checks are unchanged.
68
70
 
69
71
  ### Reference-server acceptance
@@ -203,7 +205,7 @@ Refresh and file collection share synchronization, evidence-revision, deadline,
203
205
 
204
206
  Caller cancellation or deadline stops only that caller's wait. Explicit diagnostic requests use an owned transport lifetime: supersession drops queued jobs and stops future adapter phases but does not cancel an active protocol request. The route stays occupied until actual settlement or connection disposal. The owner timeout attempts protocol cancellation but does not prove that the backend stopped. The owner bound is at least 30 seconds (or a larger collection budget). A result from an obsolete document generation is discarded. Ordinary semantic requests still pass caller cancellation to the protocol transport.
205
207
 
206
- First document enrollment is admitted between semantic query and refactor-planning attempts on the same current client. Each attempt covers input synchronization, its RPCs, and final acceptance; reads can still run concurrently. A refactor attempt retains admission through `prepareRename`/`rename` or `codeAction`/`resolve` and verified snapshot capture, but releases it before retries and the rename workflow's own cross-file enrollment. FIFO admission prevents later reads from overtaking a waiting first open. At most 32 operations may wait; excess demand fails rather than growing an unbounded queue. Waiting preserves the caller's original signal and absolute deadline, and interrupted operations are removed before they can open a document. Disk content is read after admission. First opens for semantic or refactor demand also discard the caller's original parameters after a known input change; ordinary tracking can still adopt fresh content. Tracked-document updates, closes, workspace changes, and lifecycle invalidation do not wait: they still invalidate active evidence and discard queued request parameters. Closing a file cancels its queued opens, and stopping a client discards its queued work. Admission does not span retries, project warm-up, or whole tool/refactor workflows. Diagnostic transport ownership and confirmation remain separate and unchanged.
208
+ First document enrollment is admitted between semantic query and refactor-planning attempts on the same current client. Each attempt covers input synchronization, its RPCs, and final acceptance; reads can still run concurrently. A refactor attempt retains admission through `prepareRename`/`rename` or `codeAction`/`resolve` and verified snapshot capture, but releases it before retries and the rename workflow's own cross-file enrollment. FIFO admission prevents later reads from overtaking a waiting first open. At most 1,024 operations may wait; excess demand fails rather than growing an unbounded queue, and the query result names that cause. First opens dispatch one at a time, so the bound limits waiting memory, not server load. Waiting preserves the caller's original signal and absolute deadline, and interrupted operations are removed before they can open a document. Disk content is read after admission. First opens for semantic or refactor demand also discard the caller's original parameters after a known input change; ordinary tracking can still adopt fresh content. Tracked-document updates, closes, workspace changes, and lifecycle invalidation do not wait: they still invalidate active evidence and discard queued request parameters. Closing a file cancels its queued opens, and stopping a client discards its queued work. Admission does not span retries, project warm-up, or whole tool/refactor workflows. Diagnostic transport ownership and confirmation remain separate and unchanged.
207
209
 
208
210
  If another request first opens a document during an active semantic or diagnostic request, the client can synchronize and repeat the request once. The retry retains the caller's original signal and deadline. Content, workspace, close, and lifecycle changes still reject stale results. A diagnostic retry collects new request evidence; it does not promote an old cache. This retry is not route recovery. A second enrollment during the retry still rejects the result. Semantic failure reasons state whether the retry failed or was exhausted. The bounded `request.retry` debug event records the retry reason and outcome with the public call's opaque operation ID, when supplied. A completed RPC alone does not establish accepted semantic evidence.
209
211
 
@@ -377,7 +379,9 @@ Retained and persisted LSP debug events may identify local workspaces, servers,
377
379
  - `method` — exact LSP method, e.g. `textDocument/hover`
378
380
  - `root` — server root, absolute where present
379
381
 
380
- `runtime.transition` events carry `cwd` and a bounded `servers` array (name, status, ready, and an optional process-crash status reason; at most 16 entries) alongside the aggregate counts. `readiness.*` events carry `cwd`, `server`, and `root`; their messages and data never embed raw progress-token values. `request.timing` events carry the exact `method`, `server`, and `cwd`, plus the JSON-RPC error code: the server-reported code for failed requests, and the defined constant `-32095` (`LSP_REQUEST_TIMEOUT_ERROR_CODE`) for local timeouts; cancellations carry no code. `diagnostics.timing` events carry `cwd`, `server`, and a workspace-relative `file` for `sync-file` operations; `refresh-open` stays aggregate. Their `collection` value identifies the source, such as `pull`, `typescript`, `mixed`, or `push`. `diagnostics.publication` keeps bounded publication counts for observation; a count or late publication does not promote confirmation. `runtime.recovery` events carry `cwd`, bounded server and route-root identity, an outcome, and elapsed time for process-crash recovery. Diagnostic recovery events keep their existing bounded attempted/restarted server names. `capability.transition` events fire only on semantic ready↔pending transitions and carry `cwd` and the ready state — never for initialize, registration, or unregistration traffic. Code-intelligence events (`code-operation.*`, `workflow.timing`, `ast-scan.timing`) carry `cwd` only.
382
+ `runtime.transition` events carry `cwd` and a bounded `servers` array (name, status, ready, and an optional process-crash status reason; at most 16 entries) alongside the aggregate counts. `readiness.*` events carry `cwd`, `server`, and `root`; their messages and data never embed raw progress-token values. `request.timing` events carry the exact `method`, `server`, and `cwd`, plus the JSON-RPC error code: the server-reported code for failed requests, and the defined constant `-32095` (`LSP_REQUEST_TIMEOUT_ERROR_CODE`) for local timeouts; cancellations carry no code. Batch operations do not record one `request.timing` event per completed request: a `refresh-open` diagnostic pass and an all-roots workspace-symbol warm-up pass report their completed requests as `requests` on their own event, keyed by method with `count`, `totalMs`, and `maxMs`. Their failed, timed-out, and cancelled requests still record individual `request.timing` events. `diagnostics.timing` events carry `cwd`, `server`, and a workspace-relative `file` for `sync-file` operations; `refresh-open` stays aggregate. Their `collection` value identifies the source, such as `pull`, `typescript`, `mixed`, or `push`. `diagnostics.publication` keeps bounded publication counts for observation; a count or late publication does not promote confirmation. `runtime.recovery` events carry `cwd`, bounded server and route-root identity, an outcome, and elapsed time for process-crash recovery. Diagnostic recovery events keep their existing bounded attempted/restarted server names. `capability.transition` events fire only on semantic ready↔pending transitions and carry `cwd` and the ready state — never for initialize, registration, or unregistration traffic. Code-intelligence events (`code-operation.*`, `workflow.timing`, `ast-scan.timing`) carry `cwd` only.
383
+
384
+ `document.open-failed` is a `warning` recorded when a routed client could not open a file, with `server`, a workspace-relative `file`, and the bounded `reason` (for example a full input admission queue); the caller only receives an unavailable result. `workspace-symbol.warm-pass` is an `info` summary of one all-roots warm-up pass: `server`, `roots`, `loadedRoots`, `inferredProbes`, `failedProbes`, `limited`, `elapsedMs`, and `requests`. Per-file `workspace-symbol.warm-probe` events stay at `debug` level and are not persisted; an all-roots pass records them only for probes that did not load a root (`open-failed`, `probe-unavailable`, `inferred`, `excluded`). `excluded` is a native TypeScript probe of a file its nearest project config excludes; the summary counts it under `inferredProbes`. The pass publishes one `tracked-files` `runtime.transition` for all files it opened, not one per file.
381
385
 
382
386
  `ProjectServerInfo.statusReason` is present only for process-crash recovery states: `process-crashed`, `process-crash-recovery-pending`, or `process-crash-recovery-exhausted`. An LSP route is one configured server and workspace root. A route stays in `error` status for all three states.
383
387
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrclrchtr/supi-code-runtime",
3
- "version": "12.0.0",
3
+ "version": "14.0.0",
4
4
  "description": "Shared workspace context and capability contracts for code intelligence",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -14,6 +14,16 @@ export interface CodeQueryPartialMetadata {
14
14
  * answer.
15
15
  */
16
16
  readonly exclusionOnly?: boolean;
17
+ /** A provider cut its answer at a row limit; a narrower scope cannot avoid it. */
18
+ readonly rowLimit?: {
19
+ /**
20
+ * True when every declaration whose name equals the query is still in the
21
+ * result, though partial-name matches may be missing: the provider sorted
22
+ * exact names first. Set only when no provider failed and no coverage gap
23
+ * was observed, so exact-name selection stays sound.
24
+ */
25
+ readonly exactNamesComplete: boolean;
26
+ };
17
27
  }
18
28
 
19
29
  /**
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrclrchtr/supi-core",
3
- "version": "12.0.0",
3
+ "version": "14.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
@@ -16,8 +16,17 @@ export interface DebugRegistryConfig {
16
16
  agentAccess: DebugAgentAccess;
17
17
  /** Whether Agent Run retrospective capture is explicitly enabled. */
18
18
  agentRunRetrospectivesEnabled: boolean;
19
- /** Maximum number of session-local events to keep in memory. */
19
+ /**
20
+ * Maximum number of session-local events to keep in memory. `debug` events
21
+ * are evicted first; higher levels keep at most half of the buffer.
22
+ */
20
23
  maxEvents: number;
24
+ /**
25
+ * Minimum level forwarded to persistence sinks. Lower-level events stay in the
26
+ * live retained buffer only, so high-volume `debug` telemetry does not grow
27
+ * session files.
28
+ */
29
+ persistLevel: DebugLevel;
21
30
  }
22
31
 
23
32
  export const DEBUG_REGISTRY_DEFAULTS: DebugRegistryConfig = {
@@ -25,8 +34,11 @@ export const DEBUG_REGISTRY_DEFAULTS: DebugRegistryConfig = {
25
34
  agentAccess: "sanitized",
26
35
  agentRunRetrospectivesEnabled: false,
27
36
  maxEvents: 100,
37
+ persistLevel: "info",
28
38
  };
29
39
 
40
+ const DEBUG_LEVEL_RANK: Record<DebugLevel, number> = { debug: 0, info: 1, warning: 2, error: 3 };
41
+
30
42
  export interface DebugEventInput {
31
43
  /** Opaque identity for events directly owned by one public Tool call. */
32
44
  operationId?: string;
@@ -137,12 +149,51 @@ function normalizeMaxEvents(value: number): number {
137
149
  return Math.floor(value);
138
150
  }
139
151
 
152
+ function isSummary(event: DebugEvent): boolean {
153
+ return event.level !== "debug";
154
+ }
155
+
156
+ function groupKey(event: DebugEvent): string {
157
+ return `${event.source}\u0000${event.category}`;
158
+ }
159
+
160
+ /**
161
+ * Return the index of the oldest event in the largest source/category group of
162
+ * one tier, so a high-volume category evicts its own events before rare ones.
163
+ */
164
+ function evictionIndex(events: readonly DebugEvent[], summaryTier: boolean): number {
165
+ const counts = new Map<string, number>();
166
+ let largest = 0;
167
+ for (const event of events) {
168
+ if (isSummary(event) !== summaryTier) continue;
169
+ const key = groupKey(event);
170
+ const count = (counts.get(key) ?? 0) + 1;
171
+ counts.set(key, count);
172
+ largest = Math.max(largest, count);
173
+ }
174
+ return events.findIndex(
175
+ (event) => isSummary(event) === summaryTier && counts.get(groupKey(event)) === largest,
176
+ );
177
+ }
178
+
179
+ /**
180
+ * Evict down to `maxEvents`. A `debug` event goes first, so high-volume
181
+ * timings cannot push out a summary recorded moments earlier. Higher-level
182
+ * events keep at most half the buffer; past that one of them goes instead, so
183
+ * recent `debug` events stay visible too. Within the chosen tier, the oldest
184
+ * event of the largest source/category group goes, so one flooding category
185
+ * such as `request.timing` cannot push out every other category.
186
+ */
140
187
  function trimToMaxEvents(state: DebugRegistryState): void {
141
188
  const maxEvents = normalizeMaxEvents(state.config.maxEvents);
142
- if (state.events.length <= maxEvents) {
143
- return;
189
+ const summaryShare = Math.floor(maxEvents / 2);
190
+ let summaries = state.events.filter(isSummary).length;
191
+ while (state.events.length > maxEvents) {
192
+ const evictSummary = summaries > summaryShare;
193
+ const index = evictionIndex(state.events, evictSummary);
194
+ if (evictSummary) summaries--;
195
+ state.events.splice(Math.max(index, 0), 1);
144
196
  }
145
- state.events.splice(0, state.events.length - maxEvents);
146
197
  }
147
198
 
148
199
  /** Return whether a debug level is recognized by the registry. */
@@ -150,6 +201,10 @@ export function isDebugLevel(value: unknown): value is DebugLevel {
150
201
  return value === "debug" || value === "info" || value === "warning" || value === "error";
151
202
  }
152
203
 
204
+ function shouldPersist(state: DebugRegistryState, level: DebugLevel): boolean {
205
+ return DEBUG_LEVEL_RANK[level] >= DEBUG_LEVEL_RANK[state.config.persistLevel];
206
+ }
207
+
153
208
  /** Return whether a value has the exact 16-byte base64url Debug Operation ID form. */
154
209
  export function isDebugOperationId(value: unknown): value is string {
155
210
  return typeof value === "string" && DEBUG_OPERATION_ID_RE.test(value);
@@ -194,6 +249,9 @@ export function configureDebugRegistry(config: Partial<DebugRegistryConfig>): De
194
249
  ...state.config,
195
250
  ...config,
196
251
  maxEvents: normalizeMaxEvents(config.maxEvents ?? state.config.maxEvents),
252
+ persistLevel: isDebugLevel(config.persistLevel)
253
+ ? config.persistLevel
254
+ : state.config.persistLevel,
197
255
  };
198
256
  trimToMaxEvents(state);
199
257
  return getDebugRegistryConfig();
@@ -210,16 +268,22 @@ export function isDebugRegistryEnabled(): boolean {
210
268
  }
211
269
 
212
270
  /**
213
- * 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.
271
+ * Return whether an event at `level` would reach the session file now: Debug
272
+ * must be enabled, at least one persistence sink must be registered, and the
273
+ * persistence threshold must admit the level.
215
274
  */
216
- export function canRecordAgentRunRetrospective(): boolean {
275
+ export function canPersistDebugEvent(level: DebugLevel = "info"): boolean {
217
276
  const state = getState();
218
- return (
219
- state.config.enabled &&
220
- state.config.agentRunRetrospectivesEnabled &&
221
- state.persistenceSinks.size > 0
222
- );
277
+ return state.config.enabled && state.persistenceSinks.size > 0 && shouldPersist(state, level);
278
+ }
279
+
280
+ /**
281
+ * Return whether a retrospective can be captured: an `info` event must be
282
+ * persistable (see {@link canPersistDebugEvent}) and the explicit Agent Run
283
+ * retrospective opt-in must be enabled.
284
+ */
285
+ export function canRecordAgentRunRetrospective(): boolean {
286
+ return getState().config.agentRunRetrospectivesEnabled && canPersistDebugEvent("info");
223
287
  }
224
288
 
225
289
  /** Best-effort redaction helper for data exposed through sanitized debug views. */
@@ -283,7 +347,8 @@ export function recordDebugEvent(input: DebugEventInput): DebugEvent | null {
283
347
  // Debug-event consumers must not alter producer behavior.
284
348
  }
285
349
  }
286
- for (const sink of state.persistenceSinks) {
350
+ const sinks = shouldPersist(state, event.level) ? state.persistenceSinks : [];
351
+ for (const sink of sinks) {
287
352
  try {
288
353
  sink(toSanitizedView(event));
289
354
  } catch {
@@ -1,9 +1,8 @@
1
1
  // Shared footer contribution registry for SuPi extensions.
2
2
  //
3
- // Extensions register pre-styled text chunks with a placement hint
4
- // ("stats" for the metrics line, "status" for the extension status line).
5
- // The custom footer in supi-extras reads these contributions and renders them
6
- // alongside the built-in metrics. Extensions can use PI's status API as a
3
+ // Extensions register text chunks with a placement hint. The custom footer in
4
+ // supi-extras reads these contributions and renders them alongside the
5
+ // built-in metrics. Extensions can use PI's status API with the same key as a
7
6
  // fallback when the custom footer is not installed.
8
7
 
9
8
  import { createRegistry } from "./registry-utils.ts";
@@ -11,8 +10,33 @@ import { createRegistry } from "./registry-utils.ts";
11
10
  /** Event emitted when a dynamic footer contribution needs a new render. */
12
11
  export const FOOTER_INVALIDATE_EVENT = "supi:footer:invalidate";
13
12
 
14
- /** Where the contribution should appear in the footer. */
15
- export type FooterPlacement = "stats" | "stats-end" | "status";
13
+ /**
14
+ * Where the contribution should appear in the footer.
15
+ *
16
+ * - `path-end`: right side of the workspace line (path and Git), for workspace state
17
+ * - `stats`: inside the cache section of the session line
18
+ * - `stats-end`: own sections after context usage on the session line
19
+ * - `model-start`: right side of the session line, before the model name
20
+ * - `status`: extension status line below the footer
21
+ */
22
+ export type FooterPlacement = "path-end" | "stats" | "stats-end" | "model-start" | "status";
23
+
24
+ /** Icon set selected by the footer `icons` setting. */
25
+ export type FooterGlyphMode = "nerd" | "unicode" | "ascii";
26
+
27
+ /**
28
+ * Theme color names accepted by {@link FooterRenderContext.style}.
29
+ * Matches the Pi `ThemeColor` names SuPi contributions use.
30
+ */
31
+ export type FooterColor = "accent" | "dim" | "muted" | "text" | "success" | "warning" | "error";
32
+
33
+ /** Render inputs supplied by the custom footer. */
34
+ export interface FooterRenderContext {
35
+ /** Apply a theme color. */
36
+ style: (color: FooterColor, text: string) => string;
37
+ /** Resolved icon mode; contributions choose matching glyphs. */
38
+ glyphMode: FooterGlyphMode;
39
+ }
16
40
 
17
41
  /** A single footer contribution registered by an extension. */
18
42
  export interface FooterContribution {
@@ -21,15 +45,18 @@ export interface FooterContribution {
21
45
  * A same-key Pi status is treated as this contribution's built-in-footer fallback.
22
46
  */
23
47
  key: string;
24
- /** Which footer line this belongs on. */
48
+ /** Which footer area this belongs to. */
25
49
  placement: FooterPlacement;
26
50
  /**
27
51
  * Sort order within the placement (lower values render further left). Default: 100.
28
52
  * Priority 0 is reserved for the turn cache-hit part so it stays adjacent to CH.
29
53
  */
30
54
  priority?: number;
31
- /** Return the pre-styled text for this contribution. Called on every render. */
32
- render: () => string;
55
+ /**
56
+ * Return the text for this contribution; empty hides it. Called on every render.
57
+ * Callers without a footer context (for example tests) may omit `ctx`.
58
+ */
59
+ render: (ctx?: FooterRenderContext) => string;
33
60
  }
34
61
 
35
62
  const registry = createRegistry<FooterContribution>("footer-contributions");
@@ -57,6 +84,11 @@ export const footerContributions = {
57
84
  .sort(sortByPriority);
58
85
  },
59
86
 
87
+ /** Get every registered contribution regardless of placement. */
88
+ getAll(): FooterContribution[] {
89
+ return registry.getAll();
90
+ },
91
+
60
92
  /** Remove all contributions (primarily for tests). */
61
93
  clear(): void {
62
94
  registry.clear();
@@ -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,6 @@ 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";
60
+ export type { SideRunEvent } from "./side-run.ts";
61
+ export { runSideRun, SIDE_RUN_END_EVENT, SIDE_RUN_START_EVENT } from "./side-run.ts";