@mrclrchtr/supi-code-intelligence 4.10.0 → 6.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 (269) hide show
  1. package/README.md +4 -3
  2. package/node_modules/@mrclrchtr/supi-code-runtime/README.md +2 -0
  3. package/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
  4. package/node_modules/@mrclrchtr/supi-code-runtime/src/api.ts +9 -0
  5. package/node_modules/@mrclrchtr/supi-code-runtime/src/capability/types.ts +53 -13
  6. package/node_modules/@mrclrchtr/supi-code-runtime/src/request-control.ts +47 -0
  7. package/node_modules/@mrclrchtr/supi-code-runtime/src/types.ts +13 -1
  8. package/node_modules/@mrclrchtr/supi-core/README.md +2 -0
  9. package/node_modules/@mrclrchtr/supi-core/package.json +2 -2
  10. package/node_modules/@mrclrchtr/supi-core/src/api.ts +1 -1
  11. package/node_modules/@mrclrchtr/supi-core/src/config/config.ts +31 -0
  12. package/node_modules/@mrclrchtr/supi-core/src/config.ts +2 -0
  13. package/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +19 -6
  14. package/node_modules/@mrclrchtr/supi-core/src/debug.ts +9 -0
  15. package/node_modules/@mrclrchtr/supi-core/src/index.ts +1 -1
  16. package/node_modules/@mrclrchtr/supi-core/src/settings/settings-registry.ts +3 -0
  17. package/node_modules/@mrclrchtr/supi-lsp/README.md +111 -5
  18. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/README.md +2 -0
  19. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
  20. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/api.ts +9 -0
  21. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/capability/types.ts +53 -13
  22. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/request-control.ts +47 -0
  23. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/types.ts +13 -1
  24. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/README.md +2 -0
  25. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/package.json +2 -2
  26. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/api.ts +1 -1
  27. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/config/config.ts +31 -0
  28. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/config.ts +2 -0
  29. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +19 -6
  30. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/debug.ts +9 -0
  31. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/index.ts +1 -1
  32. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/settings/settings-registry.ts +3 -0
  33. package/node_modules/@mrclrchtr/supi-lsp/package.json +7 -6
  34. package/node_modules/@mrclrchtr/supi-lsp/src/api.ts +22 -1
  35. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-cache.ts +245 -0
  36. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-capabilities.ts +78 -0
  37. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-collection.ts +171 -0
  38. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-evidence.ts +413 -0
  39. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-host.ts +15 -0
  40. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-publication.ts +214 -0
  41. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-pull.ts +62 -0
  42. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-refresh.ts +690 -0
  43. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-request.ts +9 -0
  44. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-timing.ts +97 -16
  45. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-waiters.ts +206 -0
  46. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostics.ts +448 -298
  47. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-document-state.ts +70 -0
  48. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-document-sync.ts +231 -0
  49. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-file-state.ts +25 -0
  50. package/node_modules/@mrclrchtr/supi-lsp/src/client/client.ts +529 -119
  51. package/node_modules/@mrclrchtr/supi-lsp/src/client/transport.ts +161 -33
  52. package/node_modules/@mrclrchtr/supi-lsp/src/config/capabilities.ts +12 -3
  53. package/node_modules/@mrclrchtr/supi-lsp/src/config/config.ts +5 -5
  54. package/node_modules/@mrclrchtr/supi-lsp/src/config/defaults.json +1 -1
  55. package/node_modules/@mrclrchtr/supi-lsp/src/config/server-config.ts +3 -0
  56. package/node_modules/@mrclrchtr/supi-lsp/src/config/tsconfig-extends.ts +68 -0
  57. package/node_modules/@mrclrchtr/supi-lsp/src/config/tsconfig-path.ts +8 -0
  58. package/node_modules/@mrclrchtr/supi-lsp/src/config/tsconfig-scope.ts +176 -24
  59. package/node_modules/@mrclrchtr/supi-lsp/src/debug-telemetry.ts +45 -0
  60. package/node_modules/@mrclrchtr/supi-lsp/src/diagnostics/evidence.ts +42 -0
  61. package/node_modules/@mrclrchtr/supi-lsp/src/diagnostics/workspace-sentinels.ts +46 -10
  62. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-client-state.ts +79 -9
  63. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-diagnostics.ts +17 -7
  64. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-workspace-recovery.ts +350 -26
  65. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-workspace-symbol.ts +5 -2
  66. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager.ts +586 -96
  67. package/node_modules/@mrclrchtr/supi-lsp/src/provider/lsp-refactor-provider.ts +130 -0
  68. package/node_modules/@mrclrchtr/supi-lsp/src/provider/lsp-semantic-provider.ts +45 -329
  69. package/node_modules/@mrclrchtr/supi-lsp/src/provider/refactor-planning.ts +57 -120
  70. package/node_modules/@mrclrchtr/supi-lsp/src/provider/semantic-edit-normalizer.ts +320 -0
  71. package/node_modules/@mrclrchtr/supi-lsp/src/provider/semantic-symbol-mapper.ts +207 -0
  72. package/node_modules/@mrclrchtr/supi-lsp/src/session/readiness.ts +72 -2
  73. package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-controller.ts +151 -26
  74. package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-diagnostic-surface.ts +42 -0
  75. package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-diagnostics.ts +92 -0
  76. package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-registry.ts +165 -118
  77. package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-transition-debug.ts +49 -0
  78. package/node_modules/@mrclrchtr/supi-lsp/src/session/workspace-lsp-runtime.ts +102 -0
  79. package/node_modules/@mrclrchtr/supi-tree-sitter/README.md +17 -7
  80. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/README.md +2 -0
  81. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
  82. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/api.ts +9 -0
  83. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/capability/types.ts +53 -13
  84. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/request-control.ts +47 -0
  85. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/types.ts +13 -1
  86. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/README.md +2 -0
  87. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/package.json +2 -2
  88. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/api.ts +1 -1
  89. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/config/config.ts +31 -0
  90. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/config.ts +2 -0
  91. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +19 -6
  92. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/debug.ts +9 -0
  93. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/index.ts +1 -1
  94. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/settings/settings-registry.ts +3 -0
  95. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/jiti/LICENSE +21 -0
  96. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/jiti/README.md +258 -0
  97. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/jiti/dist/babel.cjs +257 -0
  98. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/jiti/dist/jiti.cjs +1 -0
  99. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/jiti/lib/jiti-cli.mjs +34 -0
  100. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/jiti/lib/jiti-hooks.mjs +124 -0
  101. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/jiti/lib/jiti-native.mjs +121 -0
  102. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/jiti/lib/jiti-register.d.mts +1 -0
  103. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/jiti/lib/jiti-register.mjs +4 -0
  104. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/jiti/lib/jiti-static.mjs +23 -0
  105. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/jiti/lib/jiti.cjs +30 -0
  106. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/jiti/lib/jiti.d.cts +8 -0
  107. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/jiti/lib/jiti.d.mts +8 -0
  108. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/jiti/lib/jiti.mjs +29 -0
  109. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/jiti/lib/types.d.ts +420 -0
  110. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/jiti/package.json +146 -0
  111. package/node_modules/@mrclrchtr/supi-tree-sitter/package.json +6 -3
  112. package/node_modules/@mrclrchtr/supi-tree-sitter/src/api.ts +0 -9
  113. package/node_modules/@mrclrchtr/supi-tree-sitter/src/index.ts +0 -8
  114. package/node_modules/@mrclrchtr/supi-tree-sitter/src/provider/tree-sitter-provider.ts +16 -12
  115. package/node_modules/@mrclrchtr/supi-tree-sitter/src/session/runtime-controller.ts +65 -87
  116. package/node_modules/@mrclrchtr/supi-tree-sitter/src/session/session.ts +47 -95
  117. package/node_modules/@mrclrchtr/supi-tree-sitter/src/session/structural-timing.ts +147 -0
  118. package/node_modules/@mrclrchtr/supi-tree-sitter/src/session/structural-worker-client-lifecycle.ts +39 -0
  119. package/node_modules/@mrclrchtr/supi-tree-sitter/src/session/structural-worker-client.ts +561 -0
  120. package/node_modules/@mrclrchtr/supi-tree-sitter/src/session/structural-worker-message-size.ts +24 -0
  121. package/node_modules/@mrclrchtr/supi-tree-sitter/src/session/structural-worker-protocol.ts +452 -0
  122. package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/call-sites.ts +4 -2
  123. package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/callees.ts +12 -4
  124. package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/exports.ts +4 -2
  125. package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/imports.ts +4 -2
  126. package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/node-at.ts +5 -3
  127. package/node_modules/@mrclrchtr/supi-tree-sitter/src/types.ts +33 -12
  128. package/node_modules/@mrclrchtr/supi-tree-sitter/src/worker/blocking-test-bootstrap.mjs +34 -0
  129. package/node_modules/@mrclrchtr/supi-tree-sitter/src/worker/bootstrap.mjs +8 -0
  130. package/node_modules/@mrclrchtr/supi-tree-sitter/src/worker/parsed-file-store-helpers.ts +23 -0
  131. package/node_modules/@mrclrchtr/supi-tree-sitter/src/worker/parsed-file-store.ts +400 -0
  132. package/node_modules/@mrclrchtr/supi-tree-sitter/src/worker/request-control.ts +48 -0
  133. package/node_modules/@mrclrchtr/supi-tree-sitter/src/worker/runtime-parser-helpers.ts +24 -0
  134. package/node_modules/@mrclrchtr/supi-tree-sitter/src/worker/runtime-query-helpers.ts +43 -0
  135. package/node_modules/@mrclrchtr/supi-tree-sitter/src/worker/runtime.ts +421 -0
  136. package/node_modules/@mrclrchtr/supi-tree-sitter/src/worker/service.ts +116 -0
  137. package/node_modules/@mrclrchtr/supi-tree-sitter/src/worker/worker-main.ts +201 -0
  138. package/package.json +5 -5
  139. package/src/analysis/health/diagnostics.ts +221 -77
  140. package/src/analysis/health/file-scope.ts +184 -0
  141. package/src/analysis/health/recovery.ts +14 -3
  142. package/src/analysis/provider.ts +58 -0
  143. package/src/analysis/readiness.ts +34 -9
  144. package/src/analysis/refactor/apply.ts +45 -1
  145. package/src/analysis/refactor/mutation-authority.ts +143 -0
  146. package/src/analysis/relations/callees.ts +9 -1
  147. package/src/analysis/relations/types.ts +5 -2
  148. package/src/analysis/search/ast-scan-timing.ts +9 -2
  149. package/src/analysis/search/ast-scan.ts +5 -2
  150. package/src/analysis/search/deadline.ts +2 -2
  151. package/src/analysis/search/pattern-analysis.ts +54 -33
  152. package/src/analysis/search/pattern.ts +18 -3
  153. package/src/analysis/target/anchored.ts +20 -11
  154. package/src/analysis/target/file.ts +18 -11
  155. package/src/analysis/target/identity.ts +19 -3
  156. package/src/analysis/target/symbol.ts +36 -15
  157. package/src/api.ts +4 -0
  158. package/src/config.ts +35 -1
  159. package/src/diagnostics/evidence.ts +51 -0
  160. package/src/extension.ts +57 -14
  161. package/src/overview/overview-data.ts +9 -2
  162. package/src/overview/overview.ts +49 -30
  163. package/src/overview/types.ts +2 -0
  164. package/src/session/capability-adapter.ts +12 -3
  165. package/src/session/find-types.ts +2 -2
  166. package/src/session/find-workflow.ts +20 -9
  167. package/src/session/graph/collect.ts +18 -2
  168. package/src/session/graph-workflow.ts +19 -12
  169. package/src/session/health-refresh.ts +175 -0
  170. package/src/session/health-types.ts +43 -15
  171. package/src/session/health-workflow.ts +69 -54
  172. package/src/session/input/workflows.ts +2 -2
  173. package/src/session/inspect/collect.ts +20 -3
  174. package/src/session/inspect-workflow.ts +12 -6
  175. package/src/session/orientation/collect.ts +12 -3
  176. package/src/session/orientation/context-facts.ts +3 -1
  177. package/src/session/orientation/context-sections.ts +20 -7
  178. package/src/session/orientation/gather.ts +17 -11
  179. package/src/session/orientation-types.ts +4 -1
  180. package/src/session/orientation-workflow.ts +23 -10
  181. package/src/session/refactor-plans.ts +2 -0
  182. package/src/session/refactor-workflow.ts +61 -15
  183. package/src/session/session.ts +29 -2
  184. package/src/session/target-workflow.ts +54 -23
  185. package/src/session/workflow-control.ts +7 -3
  186. package/src/substrate/lsp/lifecycle.ts +26 -46
  187. package/src/substrate/lsp/maintenance.ts +284 -28
  188. package/src/substrate/lsp/recovery.ts +11 -5
  189. package/src/substrate/lsp/state.ts +2 -2
  190. package/src/substrate/workspace-provider-host.ts +25 -3
  191. package/src/tool/{find → code_find}/execute.ts +2 -16
  192. package/src/tool/code_find/guidance.ts +8 -0
  193. package/src/tool/{find → code_find}/render.ts +21 -4
  194. package/src/tool/{result/find.ts → code_find/result.ts} +78 -9
  195. package/src/tool/code_find/spec.ts +37 -0
  196. package/src/tool/code_find/tui.ts +41 -0
  197. package/src/tool/code_graph/execute.ts +24 -0
  198. package/src/tool/code_graph/guidance.ts +6 -0
  199. package/src/tool/{graph → code_graph}/markdown.ts +1 -1
  200. package/src/tool/{result/graph.ts → code_graph/result.ts} +111 -3
  201. package/src/tool/code_graph/spec.ts +39 -0
  202. package/src/tool/code_graph/tui.ts +117 -0
  203. package/src/tool/{health → code_health}/execute.ts +2 -13
  204. package/src/tool/code_health/guidance.ts +8 -0
  205. package/src/tool/{health → code_health}/markdown.ts +119 -27
  206. package/src/tool/code_health/refresh-status.ts +105 -0
  207. package/src/tool/{result/health.ts → code_health/result.ts} +80 -3
  208. package/src/tool/code_health/spec.ts +41 -0
  209. package/src/tool/{health → code_health}/tui.ts +95 -98
  210. package/src/tool/{inspect → code_inspect}/execute.ts +2 -16
  211. package/src/tool/code_inspect/guidance.ts +6 -0
  212. package/src/tool/{inspect → code_inspect}/markdown.ts +1 -1
  213. package/src/tool/{result/inspect.ts → code_inspect/result.ts} +143 -2
  214. package/src/tool/code_inspect/spec.ts +25 -0
  215. package/src/tool/code_inspect/tui.ts +44 -0
  216. package/src/tool/code_orientation/execute.ts +25 -0
  217. package/src/tool/code_orientation/guidance.ts +9 -0
  218. package/src/tool/{orientation → code_orientation}/markdown.ts +1 -1
  219. package/src/tool/code_orientation/result.ts +248 -0
  220. package/src/tool/code_orientation/spec.ts +25 -0
  221. package/src/tool/{orientation → code_orientation}/tui.ts +51 -35
  222. package/src/tool/code_refactor_apply/execute.ts +17 -0
  223. package/src/tool/code_refactor_apply/guidance.ts +5 -0
  224. package/src/tool/{refactor-apply/execute.ts → code_refactor_apply/result.ts} +8 -11
  225. package/src/tool/code_refactor_apply/spec.ts +26 -0
  226. package/src/tool/code_refactor_apply/tui.ts +73 -0
  227. package/src/tool/code_refactor_plan/execute.ts +27 -0
  228. package/src/tool/code_refactor_plan/guidance.ts +8 -0
  229. package/src/tool/{refactor-plan/execute.ts → code_refactor_plan/result.ts} +13 -22
  230. package/src/tool/code_refactor_plan/spec.ts +25 -0
  231. package/src/tool/code_refactor_plan/tui.ts +54 -0
  232. package/src/tool/code_resolve/execute.ts +19 -0
  233. package/src/tool/code_resolve/guidance.ts +8 -0
  234. package/src/tool/{resolve → code_resolve}/markdown.ts +1 -1
  235. package/src/tool/{result/resolve.ts → code_resolve/result.ts} +79 -29
  236. package/src/tool/code_resolve/spec.ts +25 -0
  237. package/src/tool/code_resolve/tui.ts +60 -0
  238. package/src/tool/guidance.ts +71 -52
  239. package/src/tool/infra/truncate.ts +40 -0
  240. package/src/tool/infra/workflow-control.ts +8 -0
  241. package/src/tool/{refactor-plan/markdown.ts → refactor-markdown.ts} +4 -7
  242. package/src/tool/register.ts +105 -88
  243. package/src/tool/result/display.ts +107 -0
  244. package/src/tool/result/errors.ts +20 -17
  245. package/src/tool/result/refactor.ts +37 -8
  246. package/src/tool/result/types.ts +20 -0
  247. package/src/tool/schemas.ts +26 -157
  248. package/src/tool/specs.ts +40 -126
  249. package/src/types/execution.ts +18 -5
  250. package/src/types/index.ts +8 -1
  251. package/src/ui/status-command.ts +5 -3
  252. package/src/ui/status-overlay.ts +4 -0
  253. package/src/ui/tui/common.ts +108 -10
  254. package/src/ui/tui/display.ts +48 -0
  255. package/node_modules/@mrclrchtr/supi-tree-sitter/src/session/runtime.ts +0 -351
  256. package/src/tool/find/tui.ts +0 -39
  257. package/src/tool/graph/execute.ts +0 -62
  258. package/src/tool/graph/tui.ts +0 -104
  259. package/src/tool/inspect/tui.ts +0 -36
  260. package/src/tool/orientation/execute.ts +0 -62
  261. package/src/tool/refactor-apply/tui.ts +0 -55
  262. package/src/tool/refactor-plan/tui.ts +0 -41
  263. package/src/tool/resolve/execute.ts +0 -36
  264. package/src/tool/resolve/tui.ts +0 -42
  265. package/src/tool/result/orientation.ts +0 -132
  266. /package/src/tool/{find → code_find}/ast-kinds.ts +0 -0
  267. /package/src/tool/{find → code_find}/markdown.ts +0 -0
  268. /package/src/tool/{find → code_find}/modes.ts +0 -0
  269. /package/src/tool/{health → code_health}/semantic-state.ts +0 -0
@@ -1,22 +1,19 @@
1
1
  import { StringEnum } from "@earendil-works/pi-ai";
2
2
  import { type TSchema, Type } from "typebox";
3
3
  import { TARGET_SYMBOL_KINDS } from "../session/target-input.ts";
4
- import type { CodeIntelligenceToolName } from "../types/index.ts";
5
- import { CODE_FIND_AST_KINDS } from "./find/ast-kinds.ts";
6
- import { CODE_FIND_MODES } from "./find/modes.ts";
7
4
 
8
- const ScopeParam = Type.String({
5
+ export const ScopeParam = Type.String({
9
6
  description: "Workspace-relative file or directory scope.",
10
7
  });
11
- const FindScopeParam = Type.Array(
8
+ export const FindScopeParam = Type.Array(
12
9
  Type.String({ description: "Workspace-relative search scope." }),
13
10
  {
14
11
  description: "One or more workspace-relative search scopes.",
15
12
  minItems: 1,
16
13
  },
17
14
  );
18
- const FileParam = Type.String({ description: "Target file path." });
19
- const QueryParam = Type.String({
15
+ const FileParam = Type.String({ description: "File path." });
16
+ export const QueryParam = Type.String({
20
17
  description: "Human or code reference to resolve or search for.",
21
18
  minLength: 1,
22
19
  });
@@ -25,14 +22,14 @@ const CharacterParam = Type.Integer({
25
22
  description: "1-based UTF-16 column.",
26
23
  minimum: 1,
27
24
  });
28
- const MaxResultsParam = Type.Integer({
25
+ export const MaxResultsParam = Type.Integer({
29
26
  description: "Maximum displayed results.",
30
27
  minimum: 1,
31
28
  });
32
29
 
33
- const SourcePointParam = Type.Object(
30
+ export const SourcePointParam = Type.Object(
34
31
  { file: FileParam, line: LineParam, character: CharacterParam },
35
- { description: "A precise 1-based source point.", additionalProperties: false },
32
+ { additionalProperties: false },
36
33
  );
37
34
 
38
35
  const SymbolTargetParam = Type.Object(
@@ -41,12 +38,12 @@ const SymbolTargetParam = Type.Object(
41
38
  scope: Type.Optional(ScopeParam),
42
39
  symbolKind: Type.Optional(
43
40
  StringEnum(TARGET_SYMBOL_KINDS, {
44
- description: "Exact provider-reported LSP SymbolKind filter; omit when uncertain.",
41
+ description: "LSP SymbolKind filter; omit when uncertain.",
45
42
  }),
46
43
  ),
47
44
  },
48
45
  {
49
- description: "Semantic symbol query and optional workspace-relative scope.",
46
+ description: "Semantic symbol query.",
50
47
  additionalProperties: false,
51
48
  },
52
49
  );
@@ -68,22 +65,22 @@ function exactOneSelector(properties: Record<string, TSchema>, description: stri
68
65
  });
69
66
  }
70
67
 
71
- const ResolveTargetParam = exactOneSelector(
68
+ export const ResolveTargetParam = exactOneSelector(
72
69
  {
73
70
  anchor: SourcePointParam,
74
71
  symbol: SymbolTargetParam,
75
72
  file: FileParam,
76
73
  },
77
- "Exactly one target source: provider-backed anchor, semantic symbol query, or file declaration group.",
74
+ "Exactly one: anchor, symbol query, or file declaration group.",
78
75
  );
79
76
 
80
- const GraphTargetParam = exactOneSelector(
77
+ export const GraphTargetParam = exactOneSelector(
81
78
  {
82
79
  handle: Type.String({ description: "Target handle returned by code_resolve." }),
83
80
  anchor: SourcePointParam,
84
81
  symbol: SymbolTargetParam,
85
82
  },
86
- "Exactly one graph target: handle, provider-backed anchor, or semantic symbol query.",
83
+ "Exactly one graph target.",
87
84
  );
88
85
 
89
86
  const OrientationTargetParam = exactOneSelector(
@@ -92,10 +89,10 @@ const OrientationTargetParam = exactOneSelector(
92
89
  anchor: SourcePointParam,
93
90
  symbol: SymbolTargetParam,
94
91
  },
95
- "Exactly one precise Orientation target: handle, provider-backed anchor, or semantic symbol query.",
92
+ "Exactly one Orientation target.",
96
93
  );
97
94
 
98
- const OrientationFocusParam = exactOneSelector(
95
+ export const OrientationFocusParam = exactOneSelector(
99
96
  {
100
97
  path: Type.String({
101
98
  description: "Workspace-relative project, package, directory, or file path.",
@@ -103,15 +100,15 @@ const OrientationFocusParam = exactOneSelector(
103
100
  module: Type.String({ description: "Discovered module name." }),
104
101
  target: OrientationTargetParam,
105
102
  },
106
- "Exactly one Orientation focus: path, discovered module, or precise target.",
103
+ "Exactly one Orientation focus.",
107
104
  );
108
105
 
109
- const RefactorTargetParam = exactOneSelector(
106
+ export const RefactorTargetParam = exactOneSelector(
110
107
  {
111
108
  handle: Type.String({ description: "Target handle returned by code_resolve." }),
112
109
  anchor: SourcePointParam,
113
110
  },
114
- "Exactly one refactor target: handle or provider-backed anchor.",
111
+ "Exactly one refactor target.",
115
112
  );
116
113
 
117
114
  const RangeParam = Type.Object(
@@ -125,153 +122,25 @@ const RangeParam = Type.Object(
125
122
  { additionalProperties: false },
126
123
  ),
127
124
  },
128
- { description: "1-based selected source range.", additionalProperties: false },
125
+ { additionalProperties: false },
129
126
  );
130
127
 
131
128
  const NewNameParam = Type.String({ description: "New symbol name.", minLength: 1 });
132
129
 
133
- const RefactorOperationParam = exactOneSelector(
130
+ export const RefactorOperationParam = exactOneSelector(
134
131
  {
135
- rename_symbol: Type.Object(
136
- { newName: NewNameParam },
137
- { description: "Rename a semantic symbol.", additionalProperties: false },
138
- ),
132
+ rename_symbol: Type.Object({ newName: NewNameParam }, { additionalProperties: false }),
139
133
  extract_function: Type.Object(
140
134
  { newName: NewNameParam, range: RangeParam },
141
- { description: "Extract the selected range into a function.", additionalProperties: false },
135
+ { additionalProperties: false },
142
136
  ),
143
137
  extract_variable: Type.Object(
144
138
  { newName: NewNameParam, range: RangeParam },
145
- { description: "Extract the selected range into a variable.", additionalProperties: false },
146
- ),
147
- },
148
- "Exactly one precise refactor operation.",
149
- );
150
-
151
- /** Resolve one target or enumerate a file declaration group as session-scoped handles. */
152
- export const CodeResolveParameters = Type.Object(
153
- {
154
- target: ResolveTargetParam,
155
- maxResults: Type.Optional(MaxResultsParam),
156
- },
157
- { additionalProperties: false },
158
- );
159
-
160
- /** Inspect one precise point. */
161
- export const CodeInspectParameters = Type.Object(
162
- {
163
- point: SourcePointParam,
164
- maxResults: Type.Optional(MaxResultsParam),
165
- },
166
- { additionalProperties: false },
167
- );
168
-
169
- /** Orient around the workspace or one exact focus. */
170
- export const CodeOrientationParameters = Type.Object(
171
- {
172
- focus: Type.Optional(OrientationFocusParam),
173
- maxResults: Type.Optional(MaxResultsParam),
174
- },
175
- { additionalProperties: false },
176
- );
177
-
178
- /** Unified structural and semantic code search. */
179
- export const CodeFindParameters = Type.Object(
180
- {
181
- query: QueryParam,
182
- scope: Type.Optional(FindScopeParam),
183
- mode: StringEnum(CODE_FIND_MODES, {
184
- description: 'Required code-aware search mode. mode:"ast" requires `kind`.',
185
- }),
186
- kind: Type.Optional(
187
- StringEnum(CODE_FIND_AST_KINDS, {
188
- description: 'AST kind; only valid with mode:"ast".',
189
- }),
190
- ),
191
- maxResults: Type.Optional(MaxResultsParam),
192
- },
193
- { additionalProperties: false },
194
- );
195
-
196
- /** Provider-backed and explicitly structural relations for one target. */
197
- export const CodeGraphParameters = Type.Object(
198
- {
199
- target: GraphTargetParam,
200
- relations: Type.Optional(
201
- Type.Array(StringEnum(["all", "references", "callees", "implements"]), {
202
- description:
203
- 'Requested relations; defaults to ["references"]. "all" must be the only item.',
204
- minItems: 1,
205
- uniqueItems: true,
206
- }),
207
- ),
208
- maxResults: Type.Optional(MaxResultsParam),
209
- calleeDepth: Type.Optional(
210
- StringEnum(["direct", "deep"], {
211
- description: '`"direct"` excludes nested scopes; `"deep"` includes them.',
212
- }),
213
- ),
214
- },
215
- { additionalProperties: false },
216
- );
217
-
218
- /** Preview one precise semantic refactor without mutating files. */
219
- export const CodeRefactorParameters = Type.Object(
220
- {
221
- target: RefactorTargetParam,
222
- operation: RefactorOperationParam,
223
- },
224
- { additionalProperties: false },
225
- );
226
-
227
- /** Apply a stored plan after freshness and fingerprint validation. */
228
- export const CodeApplyParameters = Type.Object(
229
- {
230
- planId: Type.String({
231
- description: "Stored plan identifier returned by code_refactor_plan.",
232
- minLength: 1,
233
- }),
234
- },
235
- { additionalProperties: false },
236
- );
237
-
238
- /** Report evidence-backed workspace health signals. */
239
- export const CodeHealthParameters = Type.Object(
240
- {
241
- scope: Type.Optional(ScopeParam),
242
- refresh: Type.Optional(
243
- Type.Boolean({
244
- description:
245
- "Attempt workspace-runtime diagnostic recovery before collecting health data; the result reports the established attempt outcome.",
246
- }),
247
- ),
248
- include: Type.Optional(
249
- Type.Array(
250
- StringEnum(["diagnostics", "servers"], {
251
- description: "Live health signals to include.",
252
- }),
253
- { description: "Requested health-signal sections.", uniqueItems: true },
254
- ),
255
- ),
256
- level: Type.Optional(
257
- StringEnum(["summary", "detailed"], {
258
- description: "Detail level for the health report.",
259
- }),
139
+ { additionalProperties: false },
260
140
  ),
261
141
  },
262
- { additionalProperties: false },
142
+ "Exactly one refactor operation.",
263
143
  );
264
144
 
265
- export type WorkflowCodeToolSchemaKey = CodeIntelligenceToolName;
266
-
267
- /** Code intelligence tool schemas keyed by public tool name. */
268
- export const CODE_INTELLIGENCE_TOOL_SCHEMAS = {
269
- code_resolve: CodeResolveParameters,
270
- code_inspect: CodeInspectParameters,
271
- code_orientation: CodeOrientationParameters,
272
- code_find: CodeFindParameters,
273
- code_graph: CodeGraphParameters,
274
- code_refactor_plan: CodeRefactorParameters,
275
- code_refactor_apply: CodeApplyParameters,
276
- code_health: CodeHealthParameters,
277
- } as const satisfies Record<CodeIntelligenceToolName, TSchema>;
145
+ // Per-tool parameter objects live in each tool's spec.ts; this module keeps the
146
+ // shared parameter vocabulary for the eight-tool family.
package/src/tool/specs.ts CHANGED
@@ -1,36 +1,29 @@
1
+ import type { Component } from "@earendil-works/pi-tui";
1
2
  import type { TSchema } from "typebox";
2
- import {
3
- DEFAULT_AST_SCAN_MAX_FILES,
4
- DEFAULT_AST_SCAN_TIMEOUT_MS,
5
- } from "../analysis/search/ast-scan.ts";
6
3
  import type {
7
4
  CodeIntelligenceToolName,
8
5
  CodeIntelResult,
9
6
  CodeIntelToolExecCtx,
10
7
  } from "../types/index.ts";
11
- import { executeFindTool } from "./find/execute.ts";
12
- import { executeGraphTool } from "./graph/execute.ts";
13
- import { executeHealthTool } from "./health/execute.ts";
14
- import { executeInspectTool } from "./inspect/execute.ts";
15
- import { executeOrientationTool } from "./orientation/execute.ts";
16
- import { executeRefactorApplyTool } from "./refactor-apply/execute.ts";
17
- import { executeRefactorPlanTool } from "./refactor-plan/execute.ts";
18
- import { executeResolveTool } from "./resolve/execute.ts";
19
- import {
20
- CodeApplyParameters,
21
- CodeFindParameters,
22
- CodeGraphParameters,
23
- CodeHealthParameters,
24
- CodeInspectParameters,
25
- CodeOrientationParameters,
26
- CodeRefactorParameters,
27
- CodeResolveParameters,
28
- } from "./schemas.ts";
8
+ import { codeFindSpec } from "./code_find/spec.ts";
9
+ import { codeGraphSpec } from "./code_graph/spec.ts";
10
+ import { codeHealthSpec } from "./code_health/spec.ts";
11
+ import { codeInspectSpec } from "./code_inspect/spec.ts";
12
+ import { codeOrientationSpec } from "./code_orientation/spec.ts";
13
+ import { codeRefactorApplySpec } from "./code_refactor_apply/spec.ts";
14
+ import { codeRefactorPlanSpec } from "./code_refactor_plan/spec.ts";
15
+ import { codeResolveSpec } from "./code_resolve/spec.ts";
29
16
 
30
- /** Substrate families that power a tool's implementation. */
31
- export type ToolSubstrate = "semantic" | "structural" | "search" | "diagnostics";
17
+ /**
18
+ * Canonical registration spec for one public code-intelligence tool.
19
+ *
20
+ * Model-facing prose is not part of the spec: descriptions, snippets, and
21
+ * guidelines live in each tool's `guidance.ts`, parameter mechanics live in
22
+ * each tool's `spec.ts` over the shared vocabulary in `schemas.ts`.
23
+ */
24
+ // biome-ignore lint/suspicious/noExplicitAny: pi render call/result signatures vary per tool
25
+ export type CodeToolRendererFn = (...args: any[]) => Component;
32
26
 
33
- /** Canonical registration spec for one public code-intelligence tool. */
34
27
  export interface CodeIntelligenceToolDefinitionSpec {
35
28
  name: CodeIntelligenceToolName;
36
29
  label: string;
@@ -38,109 +31,30 @@ export interface CodeIntelligenceToolDefinitionSpec {
38
31
  maxLines?: number;
39
32
  maxBytes?: number;
40
33
  run: (params: unknown, ctx: CodeIntelToolExecCtx) => Promise<CodeIntelResult> | CodeIntelResult;
41
- purpose: string;
42
- schemaDocs: string;
43
- substrates: ToolSubstrate[];
44
- nonGoals: string[];
34
+ renderCall?: CodeToolRendererFn;
35
+ renderResult?: CodeToolRendererFn;
45
36
  }
46
37
 
47
38
  /** Single source of truth for the surviving eight-tool family. */
48
39
  export const CODE_INTELLIGENCE_TOOL_SPECS = [
49
- {
50
- name: "code_resolve",
51
- label: "Code Resolve",
52
- parameters: CodeResolveParameters,
53
- run: (params, ctx) =>
54
- executeResolveTool(params as Parameters<typeof executeResolveTool>[0], ctx),
55
- purpose:
56
- "Resolve an anchor/symbol into handles or enumerate a file's declarations as a Target group.",
57
- schemaDocs: "Requires one exact target selector: anchor, symbol, or file.",
58
- substrates: ["semantic", "structural"],
59
- nonGoals: [
60
- "Handles do not persist across sessions.",
61
- "No text-search or structural-only target creation fallback.",
62
- ],
63
- },
64
- {
65
- name: "code_inspect",
66
- label: "Code Inspect",
67
- parameters: CodeInspectParameters,
68
- run: (params, ctx) =>
69
- executeInspectTool(params as Parameters<typeof executeInspectTool>[0], ctx),
70
- purpose: "Inspect one exact source point with semantic, structural, and diagnostic facts.",
71
- schemaDocs: "Requires point.file, point.line, and point.character.",
72
- substrates: ["semantic", "structural", "diagnostics"],
73
- nonGoals: ["Does not apply code actions."],
74
- },
75
- {
76
- name: "code_orientation",
77
- label: "Code Orientation",
78
- parameters: CodeOrientationParameters,
79
- run: (params, ctx) =>
80
- executeOrientationTool(params as Parameters<typeof executeOrientationTool>[0], ctx),
81
- purpose: "Orient around the workspace or one exact path, module, or target focus.",
82
- schemaDocs: "Omitted focus means workspace; otherwise focus is an exact-one selector.",
83
- substrates: ["semantic", "structural", "diagnostics"],
84
- nonGoals: ["Relation evidence belongs to code_graph.", "Health belongs to code_health."],
85
- },
86
- {
87
- name: "code_graph",
88
- label: "Code Graph",
89
- parameters: CodeGraphParameters,
90
- run: (params, ctx) => executeGraphTool(params as Parameters<typeof executeGraphTool>[0], ctx),
91
- purpose: "Collect references, structural callees, and implementations for one exact target.",
92
- schemaDocs:
93
- "Target is handle, anchor, or symbol; all expands to the three surviving relations.",
94
- substrates: ["semantic", "structural"],
95
- nonGoals: ["No inferred tests.", "No file-level import/export inventories."],
96
- },
97
- {
98
- name: "code_find",
99
- label: "Code Find",
100
- parameters: CodeFindParameters,
101
- run: (params, ctx) => executeFindTool(params as Parameters<typeof executeFindTool>[0], ctx),
102
- purpose: "Search structural source shape or semantic workspace symbols explicitly.",
103
- schemaDocs: `Requires query and ast/semantic mode; scope is optional and AST mode requires kind. AST enumeration uses a shared ${DEFAULT_AST_SCAN_TIMEOUT_MS / 1_000}-second deadline, a ${DEFAULT_AST_SCAN_MAX_FILES}-file cap, and canonical scope deduplication.`,
104
- substrates: ["semantic", "structural"],
105
- nonGoals: [
106
- "No literal or regex text search; use PI grep when active.",
107
- "No natural-language retrieval.",
108
- "No silent mode fallback.",
109
- ],
110
- },
111
- {
112
- name: "code_health",
113
- label: "Code Health",
114
- parameters: CodeHealthParameters,
115
- run: (params, ctx) => executeHealthTool(params as Parameters<typeof executeHealthTool>[0], ctx),
116
- purpose: "Report live diagnostic, runtime, and structural health observations.",
117
- schemaDocs: "Optional scope, refresh, include, and level; diagnostics and servers are default.",
118
- substrates: ["semantic", "structural", "diagnostics"],
119
- nonGoals: [
120
- "Does not run tests or verification commands.",
121
- "Does not load precomputed coverage or unused-code reports.",
122
- ],
123
- },
124
- {
125
- name: "code_refactor_plan",
126
- label: "Code Refactor Plan",
127
- parameters: CodeRefactorParameters,
128
- run: (params, ctx) =>
129
- executeRefactorPlanTool(params as Parameters<typeof executeRefactorPlanTool>[0], ctx),
130
- purpose: "Create a precise, non-mutating semantic refactor plan.",
131
- schemaDocs: "Requires one handle/anchor target and one exact operation payload.",
132
- substrates: ["semantic"],
133
- nonGoals: ["Never mutates files.", "No heuristic text edits."],
134
- },
135
- {
136
- name: "code_refactor_apply",
137
- label: "Code Refactor Apply",
138
- parameters: CodeApplyParameters,
139
- run: (params, ctx) =>
140
- executeRefactorApplyTool(params as Parameters<typeof executeRefactorApplyTool>[0], ctx),
141
- purpose: "Apply one stored, fingerprint-checked refactor plan.",
142
- schemaDocs: "Requires the planId returned by code_refactor_plan.",
143
- substrates: ["structural"],
144
- nonGoals: ["Does not compose plans.", "Does not bypass freshness checks."],
145
- },
40
+ codeResolveSpec,
41
+ codeInspectSpec,
42
+ codeOrientationSpec,
43
+ codeGraphSpec,
44
+ codeFindSpec,
45
+ codeHealthSpec,
46
+ codeRefactorPlanSpec,
47
+ codeRefactorApplySpec,
146
48
  ] as const satisfies readonly CodeIntelligenceToolDefinitionSpec[];
49
+
50
+ /** Code intelligence tool schemas keyed by public tool name. */
51
+ export const CODE_INTELLIGENCE_TOOL_SCHEMAS = {
52
+ code_resolve: codeResolveSpec.parameters,
53
+ code_inspect: codeInspectSpec.parameters,
54
+ code_orientation: codeOrientationSpec.parameters,
55
+ code_find: codeFindSpec.parameters,
56
+ code_graph: codeGraphSpec.parameters,
57
+ code_refactor_plan: codeRefactorPlanSpec.parameters,
58
+ code_refactor_apply: codeRefactorApplySpec.parameters,
59
+ code_health: codeHealthSpec.parameters,
60
+ } as const satisfies Record<CodeIntelligenceToolName, TSchema>;
@@ -6,6 +6,9 @@ import type {
6
6
  InspectDetails,
7
7
  ResolveDetails,
8
8
  SearchDetails,
9
+ ToolDisplaySection,
10
+ ToolOutputTruncationDetails,
11
+ ToolResultStatus,
9
12
  } from "../tool/result/types.ts";
10
13
 
11
14
  /**
@@ -26,6 +29,8 @@ import type {
26
29
  */
27
30
  export interface CodeIntelToolExecCtx {
28
31
  cwd: string;
32
+ /** Opaque identity for Debug Events directly owned by this public Tool call. */
33
+ operationId?: string;
29
34
  /** Abort signal from the agent runtime; forward to long-running subprocesses. */
30
35
  signal?: AbortSignal;
31
36
  /** Progress callback; long-running executors emit coarse beats, not chatty ones. */
@@ -39,13 +44,21 @@ export interface CodeIntelToolExecCtx {
39
44
  session: WorkspaceCodeIntelligenceSession;
40
45
  }
41
46
 
47
+ /** Shared metadata attached to one persisted Code Intelligence result. */
48
+ export interface CodeIntelResultDetails {
49
+ status?: ToolResultStatus;
50
+ message?: string;
51
+ displaySections?: readonly ToolDisplaySection[];
52
+ truncation?: ToolOutputTruncationDetails;
53
+ }
54
+
42
55
  /** Tool result shape returned by executeAction. */
43
56
  export interface CodeIntelResult {
44
57
  content: string;
45
58
  details?:
46
- | { type: "context"; data: ContextDetails }
47
- | { type: "inspect"; data: InspectDetails }
48
- | { type: "search"; data: SearchDetails }
49
- | { type: "resolve"; data: ResolveDetails }
50
- | { type: "health"; data: HealthDetails };
59
+ | (CodeIntelResultDetails & { type: "context"; data: ContextDetails })
60
+ | (CodeIntelResultDetails & { type: "inspect"; data: InspectDetails })
61
+ | (CodeIntelResultDetails & { type: "search"; data: SearchDetails })
62
+ | (CodeIntelResultDetails & { type: "resolve"; data: ResolveDetails })
63
+ | (CodeIntelResultDetails & { type: "health"; data: HealthDetails });
51
64
  }
@@ -8,7 +8,11 @@ export {
8
8
 
9
9
  // ── Execution context and result ────────────────────────────────────────
10
10
 
11
- export type { CodeIntelResult, CodeIntelToolExecCtx } from "./execution.ts";
11
+ export type {
12
+ CodeIntelResult,
13
+ CodeIntelResultDetails,
14
+ CodeIntelToolExecCtx,
15
+ } from "./execution.ts";
12
16
 
13
17
  // ── Detail types ────────────────────────────────────────────────────────
14
18
 
@@ -23,4 +27,7 @@ export type {
23
27
  OrientationSectionDetails,
24
28
  ResolveDetails,
25
29
  SearchDetails,
30
+ ToolDisplaySection,
31
+ ToolOutputTruncationDetails,
32
+ ToolResultStatus,
26
33
  } from "../tool/result/types.ts";
@@ -52,7 +52,7 @@ export function registerCiStatusCommand(pi: ExtensionAPI): void {
52
52
  fetchDetailedDiagnostics: async (maxSeverity) => {
53
53
  const lspState = getWorkspaceLspRuntime(ctx.cwd);
54
54
  if (lspState.kind !== "ready") return [];
55
- return lspState.runtime.getOutstandingDiagnostics(maxSeverity);
55
+ return lspState.runtime.getOutstandingDiagnostics(maxSeverity).entries;
56
56
  },
57
57
  onRefresh: async () => {
58
58
  const fresh = await gatherCiStatusData(ctx.cwd, pi);
@@ -95,10 +95,11 @@ async function gatherCiStatusData(cwd: string, pi: ExtensionAPI): Promise<CiStat
95
95
  const semanticAvailable = servers.some(
96
96
  (server) => server.status === "running" && server.ready === true,
97
97
  );
98
- const diagnostics =
98
+ const diagnosticSnapshot =
99
99
  lspState.kind === "ready" && semanticAvailable
100
100
  ? lspState.runtime.getOutstandingDiagnosticSummary(1)
101
- : [];
101
+ : { entries: [], current: false };
102
+ const diagnostics = diagnosticSnapshot.entries;
102
103
  const semanticState = deriveSemanticCapabilityState(workspace, lspState, semanticAvailable);
103
104
 
104
105
  // Sort: errors desc, warnings desc, info desc, hints desc
@@ -123,6 +124,7 @@ async function gatherCiStatusData(cwd: string, pi: ExtensionAPI): Promise<CiStat
123
124
  diagnostics,
124
125
  serverInventoryAvailable,
125
126
  semanticAvailable,
127
+ diagnosticSnapshotCurrent: diagnosticSnapshot.current,
126
128
  capabilities: {
127
129
  semantic: semanticState,
128
130
  structural: {
@@ -37,6 +37,8 @@ export interface CiStatusData {
37
37
  serverInventoryAvailable: boolean;
38
38
  /** Whether diagnostics and semantic absence claims are currently supported. */
39
39
  semanticAvailable: boolean;
40
+ /** Whether tracked-file diagnostic counts prove the current document and workspace state. */
41
+ diagnosticSnapshotCurrent: boolean;
40
42
  /** Sorted: errors desc, then warnings desc, then info desc, then hints desc. */
41
43
  diagnostics: OutstandingDiagnosticSummaryEntry[];
42
44
  capabilities: {
@@ -373,6 +375,8 @@ export class CiStatusDialog {
373
375
  const t = this.theme;
374
376
  if (!this.data.semanticAvailable) {
375
377
  container.addChild(new Text(t.fg("dim", " (diagnostics unavailable)"), 1, 0));
378
+ } else if (!this.data.diagnosticSnapshotCurrent) {
379
+ container.addChild(new Text(t.fg("warning", " diagnostic snapshot is stale"), 1, 0));
376
380
  } else {
377
381
  container.addChild(new Text(t.fg("success", " ✓ no issues"), 1, 0));
378
382
  }