@mrclrchtr/supi-code-intelligence 1.16.1 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (344) hide show
  1. package/README.md +373 -63
  2. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/package.json +6 -1
  3. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/abort-utils.ts +31 -0
  4. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/api.ts +8 -0
  5. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config/config-settings.ts +10 -4
  6. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config.ts +1 -0
  7. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/footer-registry.ts +1 -1
  8. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/index.ts +6 -0
  9. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/model-selection.ts +134 -0
  10. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-registry.ts +9 -2
  11. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-ui.ts +109 -4
  12. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings-ui.ts +5 -1
  13. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/spinner-frames.ts +11 -0
  14. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/status-spinner.ts +68 -0
  15. package/node_modules/@mrclrchtr/supi-code-runtime/package.json +3 -2
  16. package/node_modules/@mrclrchtr/supi-code-runtime/src/api.ts +7 -0
  17. package/node_modules/@mrclrchtr/supi-code-runtime/src/capability/types.ts +56 -2
  18. package/node_modules/@mrclrchtr/supi-code-runtime/src/evidence-badge.ts +40 -0
  19. package/node_modules/@mrclrchtr/supi-code-runtime/src/index.ts +5 -0
  20. package/node_modules/@mrclrchtr/supi-code-runtime/src/types.ts +76 -3
  21. package/node_modules/@mrclrchtr/supi-code-runtime/src/workspace/runtime.ts +37 -2
  22. package/node_modules/@mrclrchtr/supi-core/package.json +6 -1
  23. package/node_modules/@mrclrchtr/supi-core/src/abort-utils.ts +31 -0
  24. package/node_modules/@mrclrchtr/supi-core/src/api.ts +8 -0
  25. package/node_modules/@mrclrchtr/supi-core/src/config/config-settings.ts +10 -4
  26. package/node_modules/@mrclrchtr/supi-core/src/config.ts +1 -0
  27. package/node_modules/@mrclrchtr/supi-core/src/footer-registry.ts +1 -1
  28. package/node_modules/@mrclrchtr/supi-core/src/index.ts +6 -0
  29. package/node_modules/@mrclrchtr/supi-core/src/model-selection.ts +134 -0
  30. package/node_modules/@mrclrchtr/supi-core/src/settings/settings-registry.ts +9 -2
  31. package/node_modules/@mrclrchtr/supi-core/src/settings/settings-ui.ts +109 -4
  32. package/node_modules/@mrclrchtr/supi-core/src/settings-ui.ts +5 -1
  33. package/node_modules/@mrclrchtr/supi-core/src/spinner-frames.ts +11 -0
  34. package/node_modules/@mrclrchtr/supi-core/src/status-spinner.ts +68 -0
  35. package/node_modules/@mrclrchtr/supi-lsp/README.md +44 -56
  36. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/package.json +6 -1
  37. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/abort-utils.ts +31 -0
  38. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/api.ts +8 -0
  39. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config/config-settings.ts +10 -4
  40. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config.ts +1 -0
  41. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/footer-registry.ts +1 -1
  42. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/index.ts +6 -0
  43. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/model-selection.ts +134 -0
  44. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-registry.ts +9 -2
  45. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-ui.ts +109 -4
  46. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings-ui.ts +5 -1
  47. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/spinner-frames.ts +11 -0
  48. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/status-spinner.ts +68 -0
  49. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/package.json +3 -2
  50. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/api.ts +7 -0
  51. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/capability/types.ts +56 -2
  52. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/evidence-badge.ts +40 -0
  53. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/index.ts +5 -0
  54. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/types.ts +76 -3
  55. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/workspace/runtime.ts +37 -2
  56. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/package.json +6 -1
  57. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/abort-utils.ts +31 -0
  58. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/api.ts +8 -0
  59. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/config/config-settings.ts +10 -4
  60. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/config.ts +1 -0
  61. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/footer-registry.ts +1 -1
  62. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/index.ts +6 -0
  63. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/model-selection.ts +134 -0
  64. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/settings/settings-registry.ts +9 -2
  65. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/settings/settings-ui.ts +109 -4
  66. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/settings-ui.ts +5 -1
  67. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/spinner-frames.ts +11 -0
  68. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/status-spinner.ts +68 -0
  69. package/node_modules/@mrclrchtr/supi-lsp/package.json +4 -31
  70. package/node_modules/@mrclrchtr/supi-lsp/src/api.ts +27 -0
  71. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-refresh.ts +5 -0
  72. package/node_modules/@mrclrchtr/supi-lsp/src/client/client.ts +246 -1
  73. package/node_modules/@mrclrchtr/supi-lsp/src/client/transport.ts +4 -0
  74. package/node_modules/@mrclrchtr/supi-lsp/src/config/capabilities.ts +3 -0
  75. package/node_modules/@mrclrchtr/supi-lsp/src/config/config.ts +4 -2
  76. package/node_modules/@mrclrchtr/supi-lsp/src/config/lsp-settings.ts +102 -0
  77. package/node_modules/@mrclrchtr/supi-lsp/src/config/server-actions.ts +59 -0
  78. package/node_modules/@mrclrchtr/supi-lsp/src/config/server-config.ts +4 -0
  79. package/node_modules/@mrclrchtr/supi-lsp/src/index.ts +11 -0
  80. package/node_modules/@mrclrchtr/supi-lsp/src/manager/capability-index.ts +1 -1
  81. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-project-info.ts +2 -1
  82. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager.ts +115 -26
  83. package/node_modules/@mrclrchtr/supi-lsp/src/provider/lsp-semantic-provider.ts +177 -134
  84. package/node_modules/@mrclrchtr/supi-lsp/src/provider/refactor-planning.ts +214 -0
  85. package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-controller.ts +320 -0
  86. package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-registration.ts +26 -5
  87. package/node_modules/@mrclrchtr/supi-lsp/src/session/service-registry.ts +81 -4
  88. package/node_modules/@mrclrchtr/supi-lsp/src/summary.ts +2 -0
  89. package/node_modules/@mrclrchtr/supi-tree-sitter/README.md +18 -37
  90. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/package.json +6 -1
  91. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/abort-utils.ts +31 -0
  92. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/api.ts +8 -0
  93. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config/config-settings.ts +10 -4
  94. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config.ts +1 -0
  95. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/footer-registry.ts +1 -1
  96. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/index.ts +6 -0
  97. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/model-selection.ts +134 -0
  98. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-registry.ts +9 -2
  99. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-ui.ts +109 -4
  100. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings-ui.ts +5 -1
  101. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/spinner-frames.ts +11 -0
  102. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/status-spinner.ts +68 -0
  103. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/package.json +3 -2
  104. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/api.ts +7 -0
  105. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/capability/types.ts +56 -2
  106. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/evidence-badge.ts +40 -0
  107. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/index.ts +5 -0
  108. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/types.ts +76 -3
  109. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/workspace/runtime.ts +37 -2
  110. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/package.json +6 -1
  111. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/abort-utils.ts +31 -0
  112. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/api.ts +8 -0
  113. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/config/config-settings.ts +10 -4
  114. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/config.ts +1 -0
  115. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/footer-registry.ts +1 -1
  116. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/index.ts +6 -0
  117. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/model-selection.ts +134 -0
  118. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/settings/settings-registry.ts +9 -2
  119. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/settings/settings-ui.ts +109 -4
  120. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/settings-ui.ts +5 -1
  121. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/spinner-frames.ts +11 -0
  122. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/status-spinner.ts +68 -0
  123. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/LICENSE +21 -0
  124. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/README.md +265 -0
  125. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.cjs +4661 -0
  126. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.cjs.map +7 -0
  127. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.js +4605 -0
  128. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.js.map +7 -0
  129. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.wasm +0 -0
  130. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.wasm.map +57 -0
  131. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/package.json +100 -0
  132. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.cjs +4063 -0
  133. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.cjs.map +7 -0
  134. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.cts +1025 -0
  135. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.cts.map +58 -0
  136. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.ts +1025 -0
  137. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.ts.map +58 -0
  138. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.js +4007 -0
  139. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.js.map +7 -0
  140. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.wasm +0 -0
  141. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.wasm.map +55 -0
  142. package/node_modules/@mrclrchtr/supi-tree-sitter/package.json +6 -12
  143. package/node_modules/@mrclrchtr/supi-tree-sitter/src/api.ts +29 -0
  144. package/node_modules/@mrclrchtr/supi-tree-sitter/src/index.ts +28 -0
  145. package/node_modules/@mrclrchtr/supi-tree-sitter/src/language.ts +5 -0
  146. package/node_modules/@mrclrchtr/supi-tree-sitter/src/provider/tree-sitter-provider.ts +14 -2
  147. package/node_modules/@mrclrchtr/supi-tree-sitter/src/session/runtime-controller.ts +157 -0
  148. package/node_modules/@mrclrchtr/supi-tree-sitter/src/session/session.ts +8 -1
  149. package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/call-sites.ts +86 -0
  150. package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/callees.ts +35 -16
  151. package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/structure.ts +1 -0
  152. package/node_modules/@mrclrchtr/supi-tree-sitter/src/types.ts +10 -0
  153. package/package.json +14 -9
  154. package/src/{model.ts → analysis/architecture/discovery.ts} +15 -72
  155. package/src/analysis/architecture/model.ts +76 -0
  156. package/src/analysis/brief/directory.ts +324 -0
  157. package/src/analysis/brief/enrich.ts +157 -0
  158. package/src/analysis/brief/file.ts +84 -0
  159. package/src/analysis/brief/inventory.ts +177 -0
  160. package/src/analysis/brief/main.ts +176 -0
  161. package/src/analysis/brief/models.ts +75 -0
  162. package/src/{brief.ts → analysis/brief/public-brief.ts} +21 -26
  163. package/src/analysis/brief/summarize.ts +208 -0
  164. package/src/analysis/brief/types.ts +27 -0
  165. package/src/{use-case/generate-brief.ts → analysis/brief/use-case.ts} +67 -144
  166. package/src/analysis/coverage/coverage-warnings.ts +224 -0
  167. package/src/analysis/evidence.ts +91 -0
  168. package/src/{semantic-action-helpers.ts → analysis/helpers.ts} +4 -4
  169. package/src/analysis/provider.ts +186 -0
  170. package/src/analysis/read-next.ts +126 -0
  171. package/src/analysis/readiness.ts +73 -0
  172. package/src/{refactor → analysis/refactor}/safety.ts +1 -1
  173. package/src/{use-case/support/semantic-references.ts → analysis/references/semantic-refs.ts} +58 -26
  174. package/src/analysis/search/pattern.ts +345 -0
  175. package/src/analysis/search/ripgrep.ts +473 -0
  176. package/src/{git-context.ts → analysis/signals/git.ts} +20 -7
  177. package/src/{prioritization-signals.ts → analysis/signals/project.ts} +33 -19
  178. package/src/analysis/target/anchored.ts +349 -0
  179. package/src/analysis/target/bridge.ts +152 -0
  180. package/src/analysis/target/file-resolution.ts +125 -0
  181. package/src/{targeting/resolve-file.ts → analysis/target/file.ts} +40 -20
  182. package/src/{planner → analysis/target}/planner.ts +30 -20
  183. package/src/{targeting → analysis/target}/query.ts +17 -3
  184. package/src/analysis/target/resolve-common.ts +115 -0
  185. package/src/analysis/target/service.ts +229 -0
  186. package/src/analysis/target/symbol.ts +196 -0
  187. package/src/{targeting → analysis/target}/types.ts +17 -1
  188. package/src/analysis/tests/likely-tests.ts +174 -0
  189. package/src/analysis/tests/test-discovery.ts +540 -0
  190. package/src/analysis/tests/vitest.ts +87 -0
  191. package/src/api.ts +34 -41
  192. package/src/app/app.ts +125 -0
  193. package/src/app/manager.ts +65 -0
  194. package/src/extension.ts +132 -1
  195. package/src/index.ts +1 -57
  196. package/src/session/refactor-plans.ts +82 -0
  197. package/src/session/session.ts +300 -0
  198. package/src/session/target-store.ts +293 -0
  199. package/src/substrate/lsp/diagnostic-injection.ts +218 -0
  200. package/src/substrate/lsp/lifecycle.ts +66 -0
  201. package/src/substrate/lsp/overrides.ts +132 -0
  202. package/src/substrate/lsp/recovery.ts +55 -0
  203. package/src/substrate/lsp/settings.ts +286 -0
  204. package/src/substrate/lsp/state.ts +46 -0
  205. package/src/substrate/lsp/utils.ts +17 -0
  206. package/src/substrate/tree-sitter/lifecycle.ts +52 -0
  207. package/src/tool/find/execute.ts +118 -0
  208. package/src/{presentation/markdown/pattern.ts → tool/find/markdown.ts} +102 -53
  209. package/src/{use-case/generate-pattern.ts → tool/find/orchestrate.ts} +67 -33
  210. package/src/tool/find/semantic-search.ts +114 -0
  211. package/src/tool/find/tui.ts +39 -0
  212. package/src/tool/graph/callees.ts +87 -0
  213. package/src/tool/graph/calls-md.ts +54 -0
  214. package/src/tool/graph/collect-relation.ts +371 -0
  215. package/src/tool/graph/execute.ts +95 -0
  216. package/src/tool/graph/implementations-md.ts +79 -0
  217. package/src/tool/graph/implementations.ts +76 -0
  218. package/src/tool/graph/markdown-base.ts +243 -0
  219. package/src/tool/graph/orchestrate.ts +285 -0
  220. package/src/tool/graph/references-md.ts +34 -0
  221. package/src/tool/graph/references.ts +81 -0
  222. package/src/tool/graph/tui.ts +120 -0
  223. package/src/tool/graph/types.ts +97 -0
  224. package/src/tool/guidance.ts +96 -49
  225. package/src/tool/health/execute.ts +76 -0
  226. package/src/tool/health/markdown.ts +280 -0
  227. package/src/tool/health/orchestrate.ts +159 -0
  228. package/src/tool/health/sections/diagnostics.ts +182 -0
  229. package/src/tool/health/sections/recovery.ts +89 -0
  230. package/src/tool/health/sections/signals.ts +89 -0
  231. package/src/tool/health/tui.ts +137 -0
  232. package/src/tool/impact/analysis.ts +247 -0
  233. package/src/tool/impact/change-set-impact.ts +151 -0
  234. package/src/tool/impact/execute.ts +98 -0
  235. package/src/tool/impact/file-level-impact.ts +81 -0
  236. package/src/tool/impact/markdown.ts +283 -0
  237. package/src/tool/impact/orchestrate.ts +97 -0
  238. package/src/tool/impact/result.ts +21 -0
  239. package/src/tool/impact/single-impact.ts +89 -0
  240. package/src/tool/impact/tui.ts +39 -0
  241. package/src/tool/impact/types.ts +34 -0
  242. package/src/tool/infra/cross-field.ts +335 -0
  243. package/src/tool/infra/error-results.ts +199 -0
  244. package/src/tool/infra/pipeline.ts +311 -0
  245. package/src/tool/infra/progress.ts +21 -0
  246. package/src/tool/infra/readiness-message.ts +5 -0
  247. package/src/tool/infra/truncate.ts +49 -0
  248. package/src/tool/inspect/execute.ts +76 -0
  249. package/src/tool/inspect/markdown.ts +169 -0
  250. package/src/tool/inspect/orchestrate.ts +156 -0
  251. package/src/tool/inspect/tui.ts +36 -0
  252. package/src/tool/orientation/deps.ts +63 -0
  253. package/src/tool/orientation/execute.ts +50 -0
  254. package/src/tool/orientation/markdown.ts +35 -0
  255. package/src/tool/orientation/mode.ts +88 -0
  256. package/src/tool/orientation/orchestrate.ts +478 -0
  257. package/src/tool/orientation/precise-target.ts +257 -0
  258. package/src/tool/orientation/tui.ts +131 -0
  259. package/src/{refactor/apply-workspace-edit.ts → tool/refactor-apply/apply.ts} +39 -16
  260. package/src/tool/refactor-apply/execute.ts +20 -0
  261. package/src/tool/refactor-apply/markdown.ts +118 -0
  262. package/src/tool/refactor-apply/orchestrate.ts +89 -0
  263. package/src/tool/refactor-apply/tui.ts +51 -0
  264. package/src/tool/refactor-plan/execute.ts +73 -0
  265. package/src/tool/refactor-plan/markdown.ts +118 -0
  266. package/src/tool/refactor-plan/orchestrate.ts +363 -0
  267. package/src/tool/refactor-plan/tui.ts +42 -0
  268. package/src/tool/register.ts +123 -0
  269. package/src/tool/resolve/execute.ts +82 -0
  270. package/src/tool/resolve/markdown.ts +150 -0
  271. package/src/tool/resolve/orchestrate.ts +134 -0
  272. package/src/tool/resolve/tui.ts +40 -0
  273. package/src/tool/schemas.ts +337 -0
  274. package/src/tool/specs.ts +257 -0
  275. package/src/types/details.ts +188 -0
  276. package/src/types/execution.ts +60 -0
  277. package/src/types/index.ts +28 -0
  278. package/src/{intent/types.ts → types/tool-names.ts} +15 -14
  279. package/src/ui/footer.ts +52 -0
  280. package/src/ui/markdown/brief.ts +218 -0
  281. package/src/ui/markdown/gather.ts +177 -0
  282. package/src/{use-case/build-overview.ts → ui/markdown/overview-data.ts} +2 -2
  283. package/src/{presentation → ui}/markdown/overview.ts +2 -2
  284. package/src/ui/markdown/types.ts +80 -0
  285. package/{node_modules/@mrclrchtr/supi-lsp/src/ui/renderer.ts → src/ui/message-renderer.ts} +11 -10
  286. package/src/ui/status-command.ts +260 -0
  287. package/src/ui/status-overlay.ts +500 -0
  288. package/src/ui/tui/common.ts +220 -0
  289. package/src/ui/tui/index.ts +37 -0
  290. package/node_modules/@mrclrchtr/supi-lsp/src/extension.ts +0 -1
  291. package/node_modules/@mrclrchtr/supi-lsp/src/format.ts +0 -373
  292. package/node_modules/@mrclrchtr/supi-lsp/src/handlers/diagnostic-injection.ts +0 -182
  293. package/node_modules/@mrclrchtr/supi-lsp/src/handlers/session-lifecycle.ts +0 -149
  294. package/node_modules/@mrclrchtr/supi-lsp/src/handlers/status-command.ts +0 -38
  295. package/node_modules/@mrclrchtr/supi-lsp/src/handlers/workspace-recovery.ts +0 -92
  296. package/node_modules/@mrclrchtr/supi-lsp/src/lsp.ts +0 -37
  297. package/node_modules/@mrclrchtr/supi-lsp/src/session/lsp-state.ts +0 -93
  298. package/node_modules/@mrclrchtr/supi-lsp/src/session/settings-registration.ts +0 -296
  299. package/node_modules/@mrclrchtr/supi-lsp/src/session/tree-persist.ts +0 -75
  300. package/node_modules/@mrclrchtr/supi-lsp/src/tool/guidance.ts +0 -69
  301. package/node_modules/@mrclrchtr/supi-lsp/src/tool/names.ts +0 -27
  302. package/node_modules/@mrclrchtr/supi-lsp/src/tool/overrides.ts +0 -204
  303. package/node_modules/@mrclrchtr/supi-lsp/src/tool/register-tools.ts +0 -69
  304. package/node_modules/@mrclrchtr/supi-lsp/src/tool/service-actions.ts +0 -399
  305. package/node_modules/@mrclrchtr/supi-lsp/src/tool/tool-specs.ts +0 -248
  306. package/node_modules/@mrclrchtr/supi-lsp/src/ui/ui.ts +0 -360
  307. package/node_modules/@mrclrchtr/supi-lsp/src/workspace-change.ts +0 -40
  308. package/node_modules/@mrclrchtr/supi-tree-sitter/src/extension.ts +0 -1
  309. package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/formatting.ts +0 -104
  310. package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/guidance.ts +0 -35
  311. package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/handlers.ts +0 -196
  312. package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/register-tools.ts +0 -107
  313. package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/tool-specs.ts +0 -117
  314. package/node_modules/@mrclrchtr/supi-tree-sitter/src/tree-sitter.ts +0 -47
  315. package/src/brief-focused.ts +0 -563
  316. package/src/code-intelligence.ts +0 -70
  317. package/src/pattern-structured.ts +0 -194
  318. package/src/presentation/markdown/affected.ts +0 -170
  319. package/src/presentation/markdown/brief.ts +0 -174
  320. package/src/presentation/markdown/map.ts +0 -54
  321. package/src/presentation/markdown/refactor.ts +0 -27
  322. package/src/presentation/markdown/relations.ts +0 -121
  323. package/src/resolve-target.ts +0 -130
  324. package/src/search-helpers.ts +0 -303
  325. package/src/substrates/types.ts +0 -30
  326. package/src/target-resolution.ts +0 -122
  327. package/src/targeting/resolve-anchored.ts +0 -80
  328. package/src/targeting/resolve-symbol.ts +0 -110
  329. package/src/tool/execute-affected.ts +0 -71
  330. package/src/tool/execute-brief.ts +0 -59
  331. package/src/tool/execute-map.ts +0 -35
  332. package/src/tool/execute-pattern.ts +0 -29
  333. package/src/tool/execute-refactor.ts +0 -101
  334. package/src/tool/execute-relations.ts +0 -79
  335. package/src/tool/register-tools.ts +0 -32
  336. package/src/tool/tool-specs.ts +0 -190
  337. package/src/tool/validation.ts +0 -43
  338. package/src/types.ts +0 -169
  339. package/src/use-case/generate-affected.ts +0 -297
  340. package/src/use-case/generate-map.ts +0 -176
  341. package/src/use-case/generate-relations.ts +0 -438
  342. package/src/use-case/types.ts +0 -43
  343. package/src/workspace/request-context.ts +0 -139
  344. /package/src/{query-params.ts → tool/params.ts} +0 -0
@@ -1,6 +1,7 @@
1
1
  // supi-core config domain — config loading and config-settings helpers.
2
2
  export type { SupiConfigLocation, SupiConfigOptions } from "./config/config.ts";
3
3
  export {
4
+ loadSectionConfig,
4
5
  loadSupiConfig,
5
6
  loadSupiConfigForScope,
6
7
  readJsonFile,
@@ -8,7 +8,7 @@
8
8
  import { createRegistry } from "./registry-utils.ts";
9
9
 
10
10
  /** Where the contribution should appear in the footer. */
11
- export type FooterPlacement = "stats" | "status";
11
+ export type FooterPlacement = "stats" | "stats-end" | "status";
12
12
 
13
13
  /** A single footer contribution registered by an extension. */
14
14
  export interface FooterContribution {
@@ -6,6 +6,8 @@
6
6
  // For lighter imports, use one of the domain subpaths directly
7
7
  // (e.g. @mrclrchtr/supi-core/config, @mrclrchtr/supi-core/context).
8
8
 
9
+ // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
10
+ export * from "./abort-utils.ts";
9
11
  // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
10
12
  export * from "./config.ts";
11
13
  // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
@@ -15,6 +17,8 @@ export * from "./debug-registry.ts";
15
17
  // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
16
18
  export * from "./footer-registry.ts";
17
19
  // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
20
+ export * from "./model-selection.ts";
21
+ // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
18
22
  export * from "./path.ts";
19
23
  // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
20
24
  export * from "./project.ts";
@@ -27,6 +31,8 @@ export * from "./settings.ts";
27
31
  // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
28
32
  export * from "./settings-ui.ts";
29
33
  // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
34
+ export * from "./status-spinner.ts";
35
+ // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
30
36
  export * from "./terminal.ts";
31
37
  // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
32
38
  export * from "./tool-framework.ts";
@@ -0,0 +1,134 @@
1
+ /**
2
+ * Shared model-selection helpers for SuPi extensions.
3
+ *
4
+ * Provides scoped-model listing using PI's `enabledModels` configuration,
5
+ * matching the same semantics as the `@mrclrchtr/supi-review` model picker.
6
+ *
7
+ * @module
8
+ */
9
+
10
+ import type { Model } from "@earendil-works/pi-ai";
11
+ import { type ExtensionContext, SettingsManager } from "@earendil-works/pi-coding-agent";
12
+
13
+ // ── Types ──────────────────────────────────────────────────────────────────
14
+
15
+ /** A selectable model entry with display metadata. */
16
+ export interface ModelSelection {
17
+ /** Canonical `provider/model-id` string. */
18
+ canonicalId: string;
19
+ /** Provider name, e.g. `"anthropic"`. */
20
+ provider: string;
21
+ /** Model id, e.g. `"claude-sonnet-4-5"`. */
22
+ id: string;
23
+ // biome-ignore lint/suspicious/noExplicitAny: Model<any> is pi's canonical type
24
+ model: Model<any>;
25
+ /** Human-readable label (model name or canonicalId). */
26
+ label: string;
27
+ /** Optional description (canonicalId when different from label). */
28
+ description?: string;
29
+ /** Whether this model is the current session model. */
30
+ isCurrent: boolean;
31
+ }
32
+
33
+ // ── Helpers ────────────────────────────────────────────────────────────────
34
+
35
+ /** Build the canonical `provider/model-id` string. */
36
+ export function toCanonicalModelId(
37
+ model: Pick<NonNullable<ExtensionContext["model"]>, "provider" | "id">,
38
+ ): string {
39
+ return `${model.provider}/${model.id}`;
40
+ }
41
+
42
+ /**
43
+ * List selectable models from PI's scoped model configuration.
44
+ *
45
+ * Only models that match the configured `enabledModels` patterns are offered.
46
+ * The current session model is included only when it is inside that scoped set.
47
+ * Returns an empty array when no scoped model patterns are configured.
48
+ */
49
+ export function getSelectableModels(
50
+ ctx: Pick<ExtensionContext, "cwd" | "modelRegistry" | "model">,
51
+ enabledModelPatterns = SettingsManager.create(ctx.cwd).getEnabledModels(),
52
+ ): ModelSelection[] {
53
+ if (!enabledModelPatterns || enabledModelPatterns.length === 0) {
54
+ return [];
55
+ }
56
+
57
+ const byCanonicalId = new Map<string, ModelSelection>();
58
+ const availableModels = filterByEnabledModels(
59
+ enabledModelPatterns,
60
+ ctx.modelRegistry.getAvailable(),
61
+ );
62
+
63
+ const addModel = (
64
+ // biome-ignore lint/suspicious/noExplicitAny: Model<any> is pi's canonical type
65
+ model: Model<any>,
66
+ isCurrent: boolean,
67
+ ) => {
68
+ const canonicalId = toCanonicalModelId(model);
69
+ const existing = byCanonicalId.get(canonicalId);
70
+ if (existing) {
71
+ if (isCurrent) existing.isCurrent = true;
72
+ return;
73
+ }
74
+
75
+ byCanonicalId.set(canonicalId, {
76
+ canonicalId,
77
+ provider: model.provider,
78
+ id: model.id,
79
+ model,
80
+ label: model.name ?? canonicalId,
81
+ description: canonicalId,
82
+ isCurrent,
83
+ });
84
+ };
85
+
86
+ if (ctx.model && matchModelPatterns(ctx.model, enabledModelPatterns)) {
87
+ addModel(ctx.model, true);
88
+ }
89
+
90
+ for (const model of availableModels) {
91
+ addModel(
92
+ model,
93
+ ctx.model ? toCanonicalModelId(model) === toCanonicalModelId(ctx.model) : false,
94
+ );
95
+ }
96
+
97
+ return Array.from(byCanonicalId.values()).sort((a, b) => {
98
+ if (a.isCurrent !== b.isCurrent) return a.isCurrent ? -1 : 1;
99
+ return a.canonicalId.localeCompare(b.canonicalId);
100
+ });
101
+ }
102
+
103
+ // ── Private helpers ────────────────────────────────────────────────────────
104
+
105
+ function filterByEnabledModels<T extends { provider: string; id: string }>(
106
+ patterns: string[],
107
+ models: T[],
108
+ ): T[] {
109
+ return models.filter((model) => matchModelPatterns(model, patterns));
110
+ }
111
+
112
+ function matchModelPatterns(model: { provider: string; id: string }, patterns: string[]): boolean {
113
+ return patterns.some((pattern) => matchModelPattern(model, pattern));
114
+ }
115
+
116
+ function matchModelPattern(model: { provider: string; id: string }, pattern: string): boolean {
117
+ const canonicalId = `${model.provider}/${model.id}`;
118
+ if (pattern.includes("/")) {
119
+ return simpleGlobMatch(canonicalId, pattern);
120
+ }
121
+ return simpleGlobMatch(model.id, pattern) || simpleGlobMatch(canonicalId, pattern);
122
+ }
123
+
124
+ function simpleGlobMatch(text: string, pattern: string): boolean {
125
+ if (!pattern.includes("*") && !pattern.includes("?")) {
126
+ return text.toLowerCase() === pattern.toLowerCase();
127
+ }
128
+
129
+ const regex = pattern
130
+ .replace(/[.+^${}()|[\]\\]/g, "\\$&")
131
+ .replace(/\*/g, ".*")
132
+ .replace(/\?/g, ".");
133
+ return new RegExp(`^${regex}$`, "i").test(text);
134
+ }
@@ -3,6 +3,7 @@
3
3
  // Extensions declare their settings via `registerSettings()` during their
4
4
  // factory function. The generic settings UI reads them via `getRegisteredSettings()`.
5
5
 
6
+ import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
6
7
  import type { SettingItem } from "@earendil-works/pi-tui";
7
8
  import { createRegistry } from "../registry-utils.ts";
8
9
 
@@ -14,9 +15,15 @@ export interface SettingsSection {
14
15
  /** Human-readable label shown in the UI */
15
16
  label: string;
16
17
  /** Load current SettingItem[] for the given scope */
17
- loadValues: (scope: SettingsScope, cwd: string) => SettingItem[];
18
+ loadValues: (scope: SettingsScope, cwd: string, ctx?: ExtensionContext) => SettingItem[];
18
19
  /** Persist a change back to config */
19
- persistChange: (scope: SettingsScope, cwd: string, settingId: string, value: string) => void;
20
+ persistChange: (
21
+ scope: SettingsScope,
22
+ cwd: string,
23
+ settingId: string,
24
+ value: string,
25
+ ctx?: ExtensionContext,
26
+ ) => void;
20
27
  }
21
28
 
22
29
  const registry = createRegistry<SettingsSection>("settings-registry");
@@ -10,10 +10,14 @@ import {
10
10
  Input,
11
11
  Key,
12
12
  matchesKey,
13
+ type SelectItem,
14
+ SelectList,
15
+ type SelectListTheme,
13
16
  type SettingItem,
14
17
  SettingsList,
15
18
  Text,
16
19
  } from "@earendil-works/pi-tui";
20
+ import { getSelectableModels } from "../model-selection.ts";
17
21
  import {
18
22
  getRegisteredSettings,
19
23
  type SettingsScope,
@@ -84,10 +88,11 @@ function buildFlatItems(
84
88
  sections: SettingsSection[],
85
89
  scope: SettingsScope,
86
90
  cwd: string,
91
+ ctx?: ExtensionContext,
87
92
  ): SettingItem[] {
88
93
  const items: SettingItem[] = [];
89
94
  for (const section of sections) {
90
- const sectionItems = section.loadValues(scope, cwd);
95
+ const sectionItems = section.loadValues(scope, cwd, ctx);
91
96
  for (const item of sectionItems) {
92
97
  items.push({
93
98
  ...item,
@@ -115,6 +120,7 @@ function findSectionAndId(
115
120
  // ── Component ────────────────────────────────────────────────
116
121
 
117
122
  interface SettingsOverlayDeps {
123
+ ctx: ExtensionContext;
118
124
  state: OverlayState;
119
125
  container: Container;
120
126
  settingsList: SettingsList | null;
@@ -125,15 +131,21 @@ interface SettingsOverlayDeps {
125
131
 
126
132
  function createSettingsList(deps: SettingsOverlayDeps): SettingsList {
127
133
  const sections = getRegisteredSettings();
128
- const items = buildFlatItems(sections, deps.state.scope, deps.state.cwd);
134
+ const items = buildFlatItems(sections, deps.state.scope, deps.state.cwd, deps.ctx);
129
135
  const onChange = (flatId: string, newValue: string) => {
130
136
  const found = findSectionAndId(sections, flatId);
131
137
  if (found) {
132
- found.section.persistChange(deps.state.scope, deps.state.cwd, found.itemId, newValue);
138
+ found.section.persistChange(
139
+ deps.state.scope,
140
+ deps.state.cwd,
141
+ found.itemId,
142
+ newValue,
143
+ deps.ctx,
144
+ );
133
145
  }
134
146
  // Re-read all values to reflect persisted changes, but keep the list
135
147
  // instance (and its selectedIndex) intact.
136
- const updatedItems = buildFlatItems(sections, deps.state.scope, deps.state.cwd);
148
+ const updatedItems = buildFlatItems(sections, deps.state.scope, deps.state.cwd, deps.ctx);
137
149
  for (const updated of updatedItems) {
138
150
  const existing = items.find((i) => i.id === updated.id);
139
151
  if (existing && existing.currentValue !== updated.currentValue) {
@@ -182,6 +194,98 @@ function handleScopeToggle(deps: SettingsOverlayDeps): void {
182
194
  deps.tui.requestRender();
183
195
  }
184
196
 
197
+ /** Minimal SelectList theme — uses identity so the parent SettingsList provides styling context. */
198
+ const PASSTHROUGH_THEME: SelectListTheme = {
199
+ selectedPrefix: (text) => `› ${text}`,
200
+ selectedText: (text) => text,
201
+ description: (text) => text,
202
+ scrollInfo: (text) => text,
203
+ noMatch: (text) => text,
204
+ };
205
+
206
+ /**
207
+ * Create a model picker submenu for settings.
208
+ *
209
+ * Shows a scrollable list of selectable models from the scoped model set,
210
+ * with the current session model annotated `[current]`. The first entry is
211
+ * always `"disabled"`.
212
+ *
213
+ * @param currentValue - Currently configured canonical model id or `"disabled"`.
214
+ * @param done - Callback invoked with the selected value, or undefined on cancel.
215
+ * @param ctx - Extension context for model listing. When undefined, only
216
+ * `"disabled"` is offered.
217
+ */
218
+ export function createModelPickerSubmenu(
219
+ currentValue: string,
220
+ done: (selectedValue?: string) => void,
221
+ ctx?: ExtensionContext,
222
+ ): {
223
+ render: (width: number) => string[];
224
+ invalidate: () => void;
225
+ handleInput: (data: string) => boolean;
226
+ } {
227
+ const items = buildModelItems(ctx);
228
+
229
+ const initialIndex =
230
+ currentValue === "disabled"
231
+ ? 0
232
+ : Math.max(
233
+ 0,
234
+ items.findIndex((item) => item.value === currentValue),
235
+ );
236
+
237
+ const container = new Container();
238
+ container.addChild(new Text(" Select suggestion model", 1, 0));
239
+ container.addChild(new Text("", 1, 0));
240
+
241
+ const selectList = new SelectList(items, Math.min(items.length, 15), PASSTHROUGH_THEME);
242
+
243
+ if (initialIndex >= 0) {
244
+ selectList.setSelectedIndex(initialIndex);
245
+ }
246
+
247
+ selectList.onSelect = (item) => done(item.value);
248
+ selectList.onCancel = () => done();
249
+
250
+ container.addChild(selectList);
251
+ container.addChild(new Text(" ↑↓ navigate • enter select • esc cancel", 1, 0));
252
+
253
+ return {
254
+ render: (width: number) => container.render(width),
255
+ invalidate: () => container.invalidate(),
256
+ handleInput: (data: string) => {
257
+ selectList.handleInput(data);
258
+ return true;
259
+ },
260
+ };
261
+ }
262
+
263
+ /** Build selectable model items with "disabled" first. */
264
+ function buildModelItems(ctx?: ExtensionContext): SelectItem[] {
265
+ const items: SelectItem[] = [
266
+ {
267
+ value: "disabled",
268
+ label: "disabled",
269
+ description: "No prompt suggestions",
270
+ },
271
+ ];
272
+
273
+ if (!ctx) return items;
274
+
275
+ const models = getSelectableModels(ctx);
276
+
277
+ for (const model of models) {
278
+ const suffix = model.isCurrent ? " [current]" : "";
279
+ items.push({
280
+ value: model.canonicalId,
281
+ label: `${model.canonicalId}${suffix}`,
282
+ description: model.label !== model.canonicalId ? model.label : undefined,
283
+ });
284
+ }
285
+
286
+ return items;
287
+ }
288
+
185
289
  // ── Entry point ──────────────────────────────────────────────
186
290
 
187
291
  export function openSettingsOverlay(ctx: ExtensionContext): void {
@@ -196,6 +300,7 @@ export function openSettingsOverlay(ctx: ExtensionContext): void {
196
300
  const container = new Container();
197
301
 
198
302
  const deps: SettingsOverlayDeps = {
303
+ ctx,
199
304
  state,
200
305
  container,
201
306
  settingsList: null,
@@ -1,2 +1,6 @@
1
1
  // supi-core settings-ui domain — settings TUI components (imports pi-tui at runtime, heavy).
2
- export { createInputSubmenu, openSettingsOverlay } from "./settings/settings-ui.ts";
2
+ export {
3
+ createInputSubmenu,
4
+ createModelPickerSubmenu,
5
+ openSettingsOverlay,
6
+ } from "./settings/settings-ui.ts";
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Shared UI constants for SuPi extensions.
3
+ *
4
+ * @module
5
+ */
6
+
7
+ /** Braille spinner frames used across SuPi extensions for animated loaders. */
8
+ export const BRAILLE_SPINNER_FRAMES = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
9
+
10
+ /** Tick interval (ms) shared by all braille-spinner consumers. */
11
+ export const SPINNER_INTERVAL_MS = 80;
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Lightweight status-bar spinner for SuPi extensions.
3
+ *
4
+ * Manages a setInterval-based animated spinner that writes to
5
+ * `ctx.ui.setStatus`. Each tick advances the frame and re-renders
6
+ * with the current message.
7
+ *
8
+ * @module
9
+ */
10
+
11
+ import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
12
+ import { BRAILLE_SPINNER_FRAMES, SPINNER_INTERVAL_MS } from "./spinner-frames.ts";
13
+
14
+ /**
15
+ * Manages an animated braille spinner on the status bar.
16
+ *
17
+ * Usage:
18
+ * ```ts
19
+ * const spinner = new StatusSpinner(ctx, "my-package");
20
+ * spinner.start("generating…");
21
+ * // later
22
+ * spinner.stop();
23
+ * ```
24
+ */
25
+ export class StatusSpinner {
26
+ private interval: ReturnType<typeof setInterval> | null = null;
27
+ private frame = 0;
28
+ private currentMessage = "";
29
+
30
+ constructor(
31
+ private ctx: ExtensionContext,
32
+ private source: string,
33
+ private frames: readonly string[] = BRAILLE_SPINNER_FRAMES,
34
+ ) {}
35
+
36
+ /** Start the spinner with the given message. Overwrites any active spinner. */
37
+ start(message: string): void {
38
+ this.stop();
39
+ this.currentMessage = message;
40
+ this.render();
41
+
42
+ this.interval = setInterval(() => {
43
+ this.frame++;
44
+ this.render();
45
+ }, SPINNER_INTERVAL_MS);
46
+ }
47
+
48
+ /** Update the display message without resetting the spinner. */
49
+ update(message: string): void {
50
+ this.currentMessage = message;
51
+ }
52
+
53
+ /** Stop the spinner and clear the status. */
54
+ stop(): void {
55
+ if (this.interval !== null) {
56
+ clearInterval(this.interval);
57
+ this.interval = null;
58
+ }
59
+ this.ctx.ui.setStatus(this.source, "");
60
+ }
61
+
62
+ // ── Private ──────────────────────────────────────────────────────────
63
+
64
+ private render(): void {
65
+ const icon = this.frames[this.frame % this.frames.length];
66
+ this.ctx.ui.setStatus(this.source, `${icon} ${this.currentMessage}`);
67
+ }
68
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrclrchtr/supi-code-runtime",
3
- "version": "1.16.1",
3
+ "version": "2.0.1",
4
4
  "description": "SuPi code-runtime — shared workspace context, capability contracts, and canonical types for the code-understanding stack",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -23,12 +23,13 @@
23
23
  "workspace-context",
24
24
  "provider-api"
25
25
  ],
26
+ "type": "module",
26
27
  "files": [
27
28
  "src/**/*.ts",
28
29
  "!__tests__"
29
30
  ],
30
31
  "dependencies": {
31
- "@mrclrchtr/supi-core": "1.16.1"
32
+ "@mrclrchtr/supi-core": "2.0.1"
32
33
  },
33
34
  "bundledDependencies": [
34
35
  "@mrclrchtr/supi-core"
@@ -13,9 +13,13 @@ export type {
13
13
  StructuralProvider,
14
14
  StructuralResult,
15
15
  } from "./capability/types.ts";
16
+ // Evidence display
17
+ export { type EvidenceBadgeInput, formatEvidenceBadge } from "./evidence-badge.ts";
16
18
  // Shared canonical types
17
19
  export type {
20
+ CalleeDepth,
18
21
  CalleesData,
22
+ CallSite,
19
23
  CodeLocation,
20
24
  CodePosition,
21
25
  CodeResult,
@@ -27,10 +31,13 @@ export type {
27
31
  ImportData,
28
32
  NodeAtData,
29
33
  OutlineData,
34
+ RefactorOperation,
35
+ RefactorRequest,
30
36
  RefactorResult,
31
37
  SourceRange,
32
38
  WorkspaceEdit,
33
39
  } from "./types.ts";
40
+ export { normalizeRefactorOperation } from "./types.ts";
34
41
  export type { WorkspaceContext } from "./workspace/context.ts";
35
42
  // Workspace context
36
43
  export { createWorkspaceContext } from "./workspace/context.ts";
@@ -5,7 +5,9 @@
5
5
  */
6
6
 
7
7
  import type {
8
+ CalleeDepth,
8
9
  CalleesData,
10
+ CallSite,
9
11
  CodeLocation,
10
12
  CodePosition,
11
13
  CodeResult,
@@ -14,7 +16,9 @@ import type {
14
16
  ImportData,
15
17
  NodeAtData,
16
18
  OutlineData,
19
+ RefactorRequest,
17
20
  RefactorResult,
21
+ SourceRange,
18
22
  } from "../types.ts";
19
23
 
20
24
  // ── Availability state ─────────────────────────────────────────────────
@@ -49,17 +53,60 @@ export interface SemanticProvider {
49
53
  documentSymbols(filePath: string): Promise<CodeSymbol[] | null>;
50
54
  workspaceSymbols(query: string): Promise<CodeSymbol[] | null>;
51
55
 
56
+ /**
57
+ * Optional definition capability. Returns the definition location(s) for
58
+ * the symbol at the given position. When the provider cannot produce
59
+ * definition info, returns `null`.
60
+ */
61
+ definition?(filePath: string, position: CodePosition): Promise<CodeLocation[] | null>;
62
+
63
+ /**
64
+ * Optional hover capability. Returns a simplified type/signature info
65
+ * shape that does not depend on vscode-languageserver-types. When the
66
+ * provider cannot produce hover info (unavailable, unsupported file,
67
+ * no result at the given position), returns `null`.
68
+ */
69
+ hover?(
70
+ filePath: string,
71
+ position: CodePosition,
72
+ ): Promise<{ contents: string; range?: SourceRange } | null>;
73
+
74
+ /**
75
+ * Optional operation-aware refactor capability.
76
+ *
77
+ * This is the preferred planning entrypoint for higher-level tools because it
78
+ * lets the provider choose the honest substrate path per operation (rename,
79
+ * organize imports, dead-code cleanup, etc.) without exposing that branching
80
+ * to callers.
81
+ */
82
+ refactor?(request: RefactorRequest): Promise<RefactorResult>;
83
+
52
84
  /**
53
85
  * Optional rename capability. When present, the provider supports
54
- * precise semantic rename operations.
86
+ * precise semantic symbol-rename operations.
87
+ *
88
+ * Kept as a low-level substrate helper for compatibility while the public
89
+ * tool surface still exposes a legacy `rename` alias.
55
90
  */
56
91
  rename?(file: string, position: CodePosition, newName: string): Promise<RefactorResult>;
57
92
 
58
93
  /**
59
94
  * Optional code actions capability. When present, the provider
60
95
  * supports code-action-based refactors.
96
+ *
97
+ * Kept as a low-level substrate helper and for lightweight introspection.
61
98
  */
62
99
  codeActions?(file: string, position: CodePosition): Promise<RefactorResult[]>;
100
+
101
+ /**
102
+ * Optional lightweight code action titles for display purposes.
103
+ * Returns simplified title/kind pairs at the given position.
104
+ * When the provider cannot produce code actions, returns `null`.
105
+ */
106
+ codeActionTitles?(
107
+ file: string,
108
+ position: CodePosition,
109
+ ): Promise<Array<{ title: string; kind?: string }> | null>;
63
110
  }
64
111
 
65
112
  /**
@@ -70,11 +117,18 @@ export interface SemanticProvider {
70
117
  * and runtime error states.
71
118
  */
72
119
  export interface StructuralProvider {
73
- calleesAt(file: string, line: number, character: number): Promise<CodeResult<CalleesData>>;
120
+ calleesAt(
121
+ file: string,
122
+ line: number,
123
+ character: number,
124
+ depth?: CalleeDepth,
125
+ ): Promise<CodeResult<CalleesData>>;
74
126
  exports(file: string): Promise<CodeResult<ExportData[]>>;
75
127
  outline(file: string): Promise<CodeResult<OutlineData[]>>;
76
128
  imports(file: string): Promise<CodeResult<ImportData[]>>;
77
129
  nodeAt(file: string, line: number, character: number): Promise<CodeResult<NodeAtData>>;
130
+ /** Find all call-site identifiers in a file. Returns name + start line for each match. */
131
+ callSites(file: string): Promise<CodeResult<CallSite[]>>;
78
132
  }
79
133
 
80
134
  /** Convenience alias for `CodeResult` used in structural contexts. */
@@ -0,0 +1,40 @@
1
+ /**
2
+ * TUI-facing evidence badge string formatter.
3
+ *
4
+ * Pure string formatting — no pi-tui dependency. Consumes evidence
5
+ * completeness metadata and produces compact human-readable badges.
6
+ */
7
+
8
+ /** Metadata describing how many evidence atoms were shown vs exist. */
9
+ export interface EvidenceBadgeInput {
10
+ shownCount: number;
11
+ totalCount: number | null;
12
+ omittedCount: number | null;
13
+ partialReason: string | null;
14
+ /** Human-readable label for the badge, e.g. "references", "symbols". */
15
+ label: string;
16
+ }
17
+
18
+ /**
19
+ * Format a compact evidence completeness badge.
20
+ *
21
+ * | Input | Output |
22
+ * |------------------------------------------------------|---------------------------------------|
23
+ * | shown=12, total=12, omitted=0, label="references" | `12 references` |
24
+ * | shown=8, total=20, omitted=12, label="symbols" | `8 of 20 symbols (12 omitted)` |
25
+ * | shown=5, total=null, reason="timeout", label="matches" | `5 matches — timeout` |
26
+ */
27
+ export function formatEvidenceBadge(input: EvidenceBadgeInput): string {
28
+ const { shownCount, totalCount, omittedCount, partialReason, label } = input;
29
+
30
+ if (totalCount === null) {
31
+ const reasonSuffix = partialReason ? ` — ${partialReason}` : "";
32
+ return `${shownCount} ${label}${reasonSuffix}`;
33
+ }
34
+
35
+ if (omittedCount !== null && omittedCount > 0) {
36
+ return `${shownCount} of ${totalCount} ${label} (${omittedCount} omitted)`;
37
+ }
38
+
39
+ return `${shownCount} ${label}`;
40
+ }
@@ -6,7 +6,9 @@
6
6
  */
7
7
 
8
8
  export type {
9
+ CalleeDepth,
9
10
  CalleesData,
11
+ CallSite,
10
12
  CapabilityState,
11
13
  CodeLocation,
12
14
  CodePosition,
@@ -17,6 +19,8 @@ export type {
17
19
  ImportData,
18
20
  NodeAtData,
19
21
  OutlineData,
22
+ RefactorOperation,
23
+ RefactorRequest,
20
24
  SemanticProvider,
21
25
  SourceRange,
22
26
  StructuralProvider,
@@ -27,5 +31,6 @@ export type {
27
31
  export {
28
32
  createWorkspaceContext,
29
33
  getDefaultWorkspaceRuntime,
34
+ normalizeRefactorOperation,
30
35
  WorkspaceRuntime,
31
36
  } from "./api.ts";