@mrclrchtr/supi-code-intelligence 1.8.0 → 1.9.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 (159) hide show
  1. package/README.md +17 -1
  2. package/node_modules/@mrclrchtr/supi-code-runtime/README.md +13 -0
  3. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/README.md +97 -0
  4. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/package.json +53 -0
  5. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/api.ts +30 -0
  6. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config/config-settings.ts +76 -0
  7. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config/config.ts +186 -0
  8. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config.ts +11 -0
  9. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/context/context-messages.ts +119 -0
  10. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/context/context-provider-registry.ts +36 -0
  11. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/context/context-tag.ts +31 -0
  12. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/context.ts +16 -0
  13. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +255 -0
  14. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/index.ts +30 -0
  15. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/path-utils.ts +40 -0
  16. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/path.ts +2 -0
  17. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/project-roots.ts +170 -0
  18. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/project.ts +15 -0
  19. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/registry-utils.ts +86 -0
  20. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/session-utils.ts +29 -0
  21. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/session.ts +4 -0
  22. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-command.ts +15 -0
  23. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-registry.ts +41 -0
  24. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-ui.ts +226 -0
  25. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings-ui.ts +2 -0
  26. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings.ts +9 -0
  27. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/substrate-types.ts +11 -0
  28. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/terminal.ts +60 -0
  29. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/tool-framework.ts +116 -0
  30. package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/types.ts +2 -0
  31. package/node_modules/@mrclrchtr/supi-code-runtime/package.json +40 -0
  32. package/node_modules/@mrclrchtr/supi-code-runtime/src/api.ts +35 -0
  33. package/node_modules/@mrclrchtr/supi-code-runtime/src/capability/types.ts +68 -0
  34. package/node_modules/@mrclrchtr/supi-code-runtime/src/index.ts +31 -0
  35. package/node_modules/@mrclrchtr/supi-code-runtime/src/types.ts +110 -0
  36. package/node_modules/@mrclrchtr/supi-code-runtime/src/workspace/context.ts +41 -0
  37. package/node_modules/@mrclrchtr/supi-code-runtime/src/workspace/runtime.ts +170 -0
  38. package/node_modules/@mrclrchtr/supi-core/README.md +3 -13
  39. package/node_modules/@mrclrchtr/supi-core/package.json +1 -7
  40. package/node_modules/@mrclrchtr/supi-lsp/README.md +20 -2
  41. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/README.md +13 -0
  42. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/README.md +97 -0
  43. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/package.json +57 -0
  44. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/api.ts +30 -0
  45. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config/config-settings.ts +76 -0
  46. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config/config.ts +186 -0
  47. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config.ts +11 -0
  48. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/context/context-messages.ts +119 -0
  49. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/context/context-provider-registry.ts +36 -0
  50. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/context/context-tag.ts +31 -0
  51. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/context.ts +16 -0
  52. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +255 -0
  53. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/index.ts +30 -0
  54. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/path-utils.ts +40 -0
  55. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/path.ts +2 -0
  56. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/project-roots.ts +170 -0
  57. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/project.ts +15 -0
  58. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/registry-utils.ts +86 -0
  59. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/session-utils.ts +29 -0
  60. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/session.ts +4 -0
  61. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-command.ts +15 -0
  62. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-registry.ts +41 -0
  63. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-ui.ts +226 -0
  64. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings-ui.ts +2 -0
  65. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings.ts +9 -0
  66. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/substrate-types.ts +11 -0
  67. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/terminal.ts +60 -0
  68. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/tool-framework.ts +116 -0
  69. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/types.ts +2 -0
  70. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/package.json +40 -0
  71. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/api.ts +35 -0
  72. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/capability/types.ts +68 -0
  73. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/index.ts +31 -0
  74. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/types.ts +110 -0
  75. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/workspace/context.ts +41 -0
  76. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/workspace/runtime.ts +170 -0
  77. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/README.md +3 -13
  78. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/package.json +1 -7
  79. package/node_modules/@mrclrchtr/supi-lsp/package.json +9 -6
  80. package/node_modules/@mrclrchtr/supi-lsp/src/handlers/session-lifecycle.ts +17 -7
  81. package/node_modules/@mrclrchtr/supi-lsp/src/lsp.ts +3 -1
  82. package/node_modules/@mrclrchtr/supi-lsp/src/manager/capability-index.ts +24 -0
  83. package/node_modules/@mrclrchtr/supi-lsp/src/manager/client-pool.ts +33 -0
  84. package/node_modules/@mrclrchtr/supi-lsp/src/manager/diagnostic-store.ts +51 -0
  85. package/node_modules/@mrclrchtr/supi-lsp/src/manager/recovery-coordinator.ts +37 -0
  86. package/node_modules/@mrclrchtr/supi-lsp/src/manager/workspace-router.ts +44 -0
  87. package/node_modules/@mrclrchtr/supi-lsp/src/provider/lsp-semantic-provider.ts +156 -0
  88. package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-registration.ts +39 -0
  89. package/node_modules/@mrclrchtr/supi-lsp/src/tool/register-tools.ts +0 -1
  90. package/node_modules/@mrclrchtr/supi-tree-sitter/README.md +18 -1
  91. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/README.md +13 -0
  92. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/README.md +97 -0
  93. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/package.json +57 -0
  94. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/api.ts +30 -0
  95. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config/config-settings.ts +76 -0
  96. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config/config.ts +186 -0
  97. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config.ts +11 -0
  98. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/context/context-messages.ts +119 -0
  99. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/context/context-provider-registry.ts +36 -0
  100. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/context/context-tag.ts +31 -0
  101. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/context.ts +16 -0
  102. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +255 -0
  103. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/index.ts +30 -0
  104. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/path-utils.ts +40 -0
  105. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/path.ts +2 -0
  106. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/project-roots.ts +170 -0
  107. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/project.ts +15 -0
  108. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/registry-utils.ts +86 -0
  109. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/session-utils.ts +29 -0
  110. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/session.ts +4 -0
  111. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-command.ts +15 -0
  112. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-registry.ts +41 -0
  113. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-ui.ts +226 -0
  114. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings-ui.ts +2 -0
  115. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings.ts +9 -0
  116. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/substrate-types.ts +11 -0
  117. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/terminal.ts +60 -0
  118. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/tool-framework.ts +116 -0
  119. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/types.ts +2 -0
  120. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/package.json +40 -0
  121. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/api.ts +35 -0
  122. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/capability/types.ts +68 -0
  123. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/index.ts +31 -0
  124. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/types.ts +110 -0
  125. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/workspace/context.ts +41 -0
  126. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/workspace/runtime.ts +170 -0
  127. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/README.md +3 -13
  128. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/package.json +1 -7
  129. package/node_modules/@mrclrchtr/supi-tree-sitter/package.json +9 -6
  130. package/node_modules/@mrclrchtr/supi-tree-sitter/src/provider/tree-sitter-provider.ts +144 -0
  131. package/node_modules/@mrclrchtr/supi-tree-sitter/src/session/runtime-registration.ts +37 -0
  132. package/node_modules/@mrclrchtr/supi-tree-sitter/src/tree-sitter.ts +18 -8
  133. package/package.json +8 -6
  134. package/src/api.ts +31 -16
  135. package/src/brief-focused.ts +2 -2
  136. package/src/brief.ts +2 -2
  137. package/src/code-intelligence.ts +13 -1
  138. package/src/index.ts +29 -16
  139. package/src/{architecture.ts → model.ts} +20 -61
  140. package/src/presentation/markdown/brief.ts +2 -2
  141. package/src/substrates/types.ts +22 -105
  142. package/src/targeting/resolve-file.ts +4 -7
  143. package/src/tool/execute-affected.ts +25 -1
  144. package/src/tool/execute-brief.ts +5 -4
  145. package/src/tool/execute-pattern.ts +4 -3
  146. package/src/tool/execute-relations.ts +22 -1
  147. package/src/types.ts +101 -3
  148. package/src/use-case/build-overview.ts +1 -1
  149. package/src/use-case/generate-affected.ts +25 -7
  150. package/src/use-case/generate-brief.ts +31 -14
  151. package/src/use-case/generate-pattern.ts +9 -9
  152. package/src/use-case/generate-relations.ts +66 -20
  153. package/src/use-case/types.ts +3 -3
  154. package/src/workspace/request-context.ts +139 -0
  155. package/node_modules/@mrclrchtr/supi-core/src/extension.ts +0 -1
  156. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/extension.ts +0 -1
  157. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/extension.ts +0 -1
  158. package/src/substrates/lsp-adapter.ts +0 -197
  159. package/src/substrates/tree-sitter-adapter.ts +0 -173
@@ -0,0 +1,110 @@
1
+ /**
2
+ * Canonical shared types for the SuPi code-understanding stack.
3
+ *
4
+ * These types are package-agnostic and used across supi-lsp, supi-tree-sitter,
5
+ * and supi-code-intelligence for communicating code analysis results,
6
+ * capability availability, and structural data shapes.
7
+ */
8
+
9
+ // ── Position and location types ────────────────────────────────────────
10
+
11
+ /** 0-based LSP position. */
12
+ export interface CodePosition {
13
+ line: number;
14
+ character: number;
15
+ }
16
+
17
+ /** A source range spanning two CodePositions. */
18
+ export interface SourceRange {
19
+ start: CodePosition;
20
+ end: CodePosition;
21
+ }
22
+
23
+ /** A code location (file URI + range). */
24
+ export interface CodeLocation {
25
+ uri: string;
26
+ range: SourceRange;
27
+ }
28
+
29
+ // ── Symbol types ───────────────────────────────────────────────────────
30
+
31
+ /** A discovered symbol / declaration. */
32
+ export interface CodeSymbol {
33
+ name: string;
34
+ kind: string;
35
+ file: string;
36
+ line: number;
37
+ character: number;
38
+ container?: string | null;
39
+ }
40
+
41
+ // ── Result types ───────────────────────────────────────────────────────
42
+
43
+ /**
44
+ * Discriminated result union for provider operations.
45
+ *
46
+ * Used primarily by structural (tree-sitter-backed) operations that
47
+ * have explicit error and unsupported-language states. Semantic operations
48
+ * use `null` to signal absence.
49
+ */
50
+ export type CodeResult<T> =
51
+ | { kind: "success"; data: T }
52
+ | { kind: "unsupported-language"; file: string; message: string }
53
+ | { kind: "file-access-error"; file: string; message: string }
54
+ | { kind: "validation-error"; message: string }
55
+ | { kind: "runtime-error"; message: string }
56
+ | { kind: "unavailable"; message: string };
57
+
58
+ /** Result confidence classification. */
59
+ export type ConfidenceMode = "semantic" | "structural" | "heuristic" | "unavailable";
60
+
61
+ // ── Structural data shapes (value types, range-flattened) ──────────────
62
+
63
+ export interface OutlineData {
64
+ name: string;
65
+ kind: string;
66
+ startLine: number;
67
+ startCharacter: number;
68
+ endLine: number;
69
+ endCharacter: number;
70
+ children?: OutlineData[];
71
+ }
72
+
73
+ export interface ExportData {
74
+ name: string;
75
+ kind: string;
76
+ startLine: number;
77
+ startCharacter: number;
78
+ endLine: number;
79
+ endCharacter: number;
80
+ moduleSpecifier?: string;
81
+ }
82
+
83
+ export interface ImportData {
84
+ moduleSpecifier: string;
85
+ startLine: number;
86
+ startCharacter: number;
87
+ endLine: number;
88
+ endCharacter: number;
89
+ }
90
+
91
+ export interface NodeAtData {
92
+ type: string;
93
+ startLine: number;
94
+ startCharacter: number;
95
+ endLine: number;
96
+ endCharacter: number;
97
+ text: string;
98
+ ancestry: Array<{
99
+ type: string;
100
+ startLine: number;
101
+ startCharacter: number;
102
+ endLine: number;
103
+ endCharacter: number;
104
+ }>;
105
+ }
106
+
107
+ export interface CalleesData {
108
+ enclosingScope: { name: string; startLine: number; endLine: number };
109
+ callees: Array<{ name: string; startLine: number }>;
110
+ }
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Typed request context helper for consumers that need a convenient view
3
+ * of the capability state for a workspace cwd.
4
+ *
5
+ * This is the primary way that `supi-code-intelligence` reads capability
6
+ * state from the shared runtime. Substrates register providers through
7
+ * {@link WorkspaceRuntime} directly.
8
+ */
9
+
10
+ import type { CapabilityState, SemanticProvider, StructuralProvider } from "../capability/types.ts";
11
+ import type { WorkspaceRuntime } from "./runtime.ts";
12
+
13
+ /**
14
+ * A workspace-scoped request context that provides access to active
15
+ * semantic and structural capabilities along with their availability
16
+ * state and the cached project model.
17
+ */
18
+ export interface WorkspaceContext {
19
+ /** The working directory this context is scoped to. */
20
+ cwd: string;
21
+ /** Semantic analysis capability state and provider. */
22
+ semantic: { state: CapabilityState; provider: SemanticProvider | null };
23
+ /** Structural analysis capability state and provider. */
24
+ structural: { state: CapabilityState; provider: StructuralProvider | null };
25
+ }
26
+
27
+ /**
28
+ * Create a typed workspace context from the shared runtime.
29
+ *
30
+ * @param cwd - The working directory for this context.
31
+ * @param runtime - The shared workspace runtime instance.
32
+ * @returns A snapshot of the capability state for this workspace.
33
+ */
34
+ export function createWorkspaceContext(cwd: string, runtime: WorkspaceRuntime): WorkspaceContext {
35
+ const ws = runtime.getWorkspace(cwd);
36
+ return {
37
+ cwd,
38
+ semantic: ws.semantic,
39
+ structural: ws.structural,
40
+ };
41
+ }
@@ -0,0 +1,170 @@
1
+ /**
2
+ * Workspace-scoped capability registry.
3
+ *
4
+ * Substrates (LSP, tree-sitter) register their capabilities per cwd
5
+ * at session startup. Code-intelligence reads capability state from
6
+ * this registry instead of maintaining a local provider composition
7
+ * layer.
8
+ *
9
+ * Capabilities are independent: registering a semantic provider does not
10
+ * affect an already-registered structural provider for the same cwd.
11
+ */
12
+
13
+ import type { CapabilityState, SemanticProvider, StructuralProvider } from "../capability/types.ts";
14
+
15
+ // ── Public types ───────────────────────────────────────────────────────
16
+
17
+ /**
18
+ * The combined capability state for a workspace.
19
+ * Each capability slot includes both the availability state and the
20
+ * provider instance (null when not ready).
21
+ */
22
+ export interface WorkspaceCapabilities {
23
+ semantic: { state: CapabilityState; provider: SemanticProvider | null };
24
+ structural: { state: CapabilityState; provider: StructuralProvider | null };
25
+ }
26
+
27
+ // ── Defaults ───────────────────────────────────────────────────────────
28
+
29
+ const DEFAULT_UNAVAILABLE_REASON = "No provider registered for this workspace";
30
+
31
+ function createDefaultCapabilities(): WorkspaceCapabilities {
32
+ return {
33
+ semantic: {
34
+ state: { kind: "unavailable", reason: DEFAULT_UNAVAILABLE_REASON },
35
+ provider: null,
36
+ },
37
+ structural: {
38
+ state: { kind: "unavailable", reason: DEFAULT_UNAVAILABLE_REASON },
39
+ provider: null,
40
+ },
41
+ };
42
+ }
43
+
44
+ // ── Runtime ────────────────────────────────────────────────────────────
45
+
46
+ /**
47
+ * Workspace-scoped capability registry keyed by cwd/project root.
48
+ *
49
+ * Each workspace stores independent capability state for semantic
50
+ * (LSP-backed) and structural (tree-sitter-backed) analysis. Substrates
51
+ * register their capabilities at session start; consumers read them
52
+ * as needed.
53
+ *
54
+ * The registry is intentionally unopinionated about which capabilities
55
+ * are required — a workspace may have only semantic, only structural,
56
+ * both, or neither.
57
+ */
58
+ export class WorkspaceRuntime {
59
+ readonly #workspaces = new Map<string, WorkspaceCapabilities>();
60
+
61
+ /**
62
+ * Get the capability state for a workspace cwd.
63
+ * Returns a default "unavailable" state if the workspace
64
+ * has never been registered.
65
+ */
66
+ getWorkspace(cwd: string): WorkspaceCapabilities {
67
+ return this.#workspaces.get(cwd) ?? createDefaultCapabilities();
68
+ }
69
+
70
+ /**
71
+ * Register a semantic provider for a workspace.
72
+ * Replaces any existing semantic provider for the same cwd
73
+ * without affecting the structural provider.
74
+ */
75
+ registerSemantic(cwd: string, provider: SemanticProvider): void {
76
+ const existing = this.#workspaces.get(cwd);
77
+ if (existing) {
78
+ existing.semantic = { state: { kind: "ready" }, provider };
79
+ } else {
80
+ this.#workspaces.set(cwd, {
81
+ semantic: { state: { kind: "ready" }, provider },
82
+ structural: createDefaultCapabilities().structural,
83
+ });
84
+ }
85
+ }
86
+
87
+ /**
88
+ * Register a structural provider for a workspace.
89
+ * Replaces any existing structural provider for the same cwd
90
+ * without affecting the semantic provider.
91
+ */
92
+ registerStructural(cwd: string, provider: StructuralProvider): void {
93
+ const existing = this.#workspaces.get(cwd);
94
+ if (existing) {
95
+ existing.structural = { state: { kind: "ready" }, provider };
96
+ } else {
97
+ this.#workspaces.set(cwd, {
98
+ semantic: createDefaultCapabilities().semantic,
99
+ structural: { state: { kind: "ready" }, provider },
100
+ });
101
+ }
102
+ }
103
+
104
+ /**
105
+ * Remove all capability state for a single workspace cwd.
106
+ */
107
+ clearWorkspace(cwd: string): void {
108
+ this.#workspaces.delete(cwd);
109
+ }
110
+
111
+ /**
112
+ * Clear only the semantic capability slot for a workspace.
113
+ * Leaves the structural slot untouched.
114
+ */
115
+ clearSemantic(cwd: string): void {
116
+ const ws = this.#workspaces.get(cwd);
117
+ if (!ws) return;
118
+ ws.semantic = createDefaultCapabilities().semantic;
119
+ // If both slots are now unavailable, remove the entire entry
120
+ if (ws.semantic.state.kind === "unavailable" && ws.structural.state.kind === "unavailable") {
121
+ this.#workspaces.delete(cwd);
122
+ }
123
+ }
124
+
125
+ /**
126
+ * Clear only the structural capability slot for a workspace.
127
+ * Leaves the semantic slot untouched.
128
+ */
129
+ clearStructural(cwd: string): void {
130
+ const ws = this.#workspaces.get(cwd);
131
+ if (!ws) return;
132
+ ws.structural = createDefaultCapabilities().structural;
133
+ // If both slots are now unavailable, remove the entire entry
134
+ if (ws.semantic.state.kind === "unavailable" && ws.structural.state.kind === "unavailable") {
135
+ this.#workspaces.delete(cwd);
136
+ }
137
+ }
138
+
139
+ /**
140
+ * Remove all capability state for every workspace.
141
+ */
142
+ clearAll(): void {
143
+ this.#workspaces.clear();
144
+ }
145
+ }
146
+
147
+ // ── Default singleton ───────────────────────────────────────────────────
148
+
149
+ const RUNTIME_SYMBOL = Symbol.for("@mrclrchtr/supi-code-runtime/default-runtime");
150
+
151
+ /**
152
+ * Get the shared default workspace runtime instance.
153
+ *
154
+ * Backed by `globalThis` + `Symbol.for` so that all jiti module instances
155
+ * (even duplicate loads through separate `node_modules` paths) share the
156
+ * same WorkspaceRuntime. Without this, standalone installs where
157
+ * `supi-lsp`, `supi-tree-sitter`, and `supi-code-intelligence` each bundle
158
+ * their own copy of `@mrclrchtr/supi-code-runtime` would get separate
159
+ * runtimes — LSP/tree-sitter would register capabilities into one while
160
+ * code-intelligence reads from another.
161
+ */
162
+ export function getDefaultWorkspaceRuntime(): WorkspaceRuntime {
163
+ const g = globalThis as Record<symbol, unknown>;
164
+ let runtime = g[RUNTIME_SYMBOL] as WorkspaceRuntime | undefined;
165
+ if (!runtime) {
166
+ runtime = new WorkspaceRuntime();
167
+ g[RUNTIME_SYMBOL] = runtime;
168
+ }
169
+ return runtime;
170
+ }
@@ -1,29 +1,20 @@
1
+ ![SuPi](assets/logo.png)
2
+
1
3
  # @mrclrchtr/supi-core
2
4
 
3
5
  Shared infrastructure for SuPi extensions.
4
6
 
5
- This package is mainly for extension authors. It gives you a common config system, settings plumbing, context helpers, registries, and a small extension surface that registers `/supi-settings`.
7
+ This is a **pure library** it does not register any pi commands or tools. The `/supi-settings` command is now available through `@mrclrchtr/supi-settings`.
6
8
 
7
9
  ## Install
8
10
 
9
- ### As a dependency for another extension
10
-
11
11
  ```bash
12
12
  pnpm add @mrclrchtr/supi-core
13
13
  ```
14
14
 
15
- ### As a pi package
16
-
17
- ```bash
18
- pi install npm:@mrclrchtr/supi-core
19
- ```
20
-
21
- Installing it as a pi package adds the minimal `/supi-settings` extension surface.
22
-
23
15
  ## Package surfaces
24
16
 
25
17
  - `@mrclrchtr/supi-core/api` — reusable helpers for other packages and extensions
26
- - `@mrclrchtr/supi-core/extension` — minimal pi extension that registers `/supi-settings`
27
18
 
28
19
  ## What you get from the API
29
20
 
@@ -101,7 +92,6 @@ const message = wrapExtensionContext("my-extension", "hello", {
101
92
  ## Source
102
93
 
103
94
  - `src/api.ts` — exported library surface
104
- - `src/extension.ts` — minimal `/supi-settings` entrypoint
105
95
  - `src/config.ts` — shared config loading and writing
106
96
  - `src/config-settings.ts` — config-backed settings registration helper
107
97
  - `src/settings-ui.ts` — shared settings overlay
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrclrchtr/supi-core",
3
- "version": "1.8.0",
3
+ "version": "1.9.0",
4
4
  "description": "SuPi core — shared infrastructure for SuPi extensions (XML context tags, config system)",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -40,7 +40,6 @@
40
40
  "./config": "./src/config.ts",
41
41
  "./context": "./src/context.ts",
42
42
  "./debug": "./src/debug-registry.ts",
43
- "./extension": "./src/extension.ts",
44
43
  "./package.json": "./package.json",
45
44
  "./path": "./src/path.ts",
46
45
  "./project": "./src/project.ts",
@@ -50,10 +49,5 @@
50
49
  "./terminal": "./src/terminal.ts",
51
50
  "./tool-framework": "./src/tool-framework.ts",
52
51
  "./types": "./src/types.ts"
53
- },
54
- "pi": {
55
- "extensions": [
56
- "./src/extension.ts"
57
- ]
58
52
  }
59
53
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrclrchtr/supi-lsp",
3
- "version": "1.8.0",
3
+ "version": "1.9.0",
4
4
  "description": "SuPi LSP extension — Language Server Protocol integration for pi",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -26,9 +26,11 @@
26
26
  "vscode-jsonrpc": "^8.2.1",
27
27
  "vscode-languageserver-protocol": "^3.17.5",
28
28
  "vscode-languageserver-types": "^3.17.5",
29
- "@mrclrchtr/supi-core": "1.8.0"
29
+ "@mrclrchtr/supi-code-runtime": "1.9.0",
30
+ "@mrclrchtr/supi-core": "1.9.0"
30
31
  },
31
32
  "bundledDependencies": [
33
+ "@mrclrchtr/supi-code-runtime",
32
34
  "@mrclrchtr/supi-core",
33
35
  "vscode-jsonrpc",
34
36
  "vscode-languageserver-protocol",
@@ -56,14 +58,15 @@
56
58
  },
57
59
  "pi": {
58
60
  "extensions": [
59
- "./src/extension.ts",
60
- "node_modules/@mrclrchtr/supi-core/src/extension.ts"
61
- ]
61
+ "./src/extension.ts"
62
+ ],
63
+ "image": "https://raw.githubusercontent.com/mrclrchtr/supi/main/packages/supi-lsp/assets/logo.png"
62
64
  },
63
65
  "main": "src/api.ts",
64
66
  "exports": {
65
67
  "./api": "./src/api.ts",
66
68
  "./extension": "./src/extension.ts",
67
- "./package.json": "./package.json"
69
+ "./package.json": "./package.json",
70
+ "./provider/lsp-semantic-provider": "./src/provider/lsp-semantic-provider.ts"
68
71
  }
69
72
  }
@@ -8,6 +8,7 @@ import type {
8
8
  ExtensionContext,
9
9
  SessionStartEvent,
10
10
  } from "@earendil-works/pi-coding-agent";
11
+ import type { WorkspaceRuntime } from "@mrclrchtr/supi-code-runtime/api";
11
12
  import { loadConfig, resolveLanguageAlias } from "../config/config.ts";
12
13
  import { clearTsconfigCache } from "../config/tsconfig-scope.ts";
13
14
  import { scanWorkspaceSentinels } from "../diagnostics/workspace-sentinels.ts";
@@ -18,6 +19,10 @@ import {
18
19
  type LspRuntimeState,
19
20
  refreshProjectServers,
20
21
  } from "../session/lsp-state.ts";
22
+ import {
23
+ registerLspCapabilities,
24
+ unregisterLspCapabilities,
25
+ } from "../session/runtime-registration.ts";
21
26
  import {
22
27
  scanMissingServers,
23
28
  scanProjectCapabilities,
@@ -38,11 +43,15 @@ import { updateLspUi } from "../ui/ui.ts";
38
43
  * Register session lifecycle handlers (start, shutdown, and agent-end cleanup).
39
44
  *
40
45
  * - `session_start`: initialises the LspManager, starts detected servers, wires
41
- * dynamic tool guidance, and syncs UI state.
46
+ * dynamic tool guidance, publishes runtime capabilities, and syncs UI state.
42
47
  * - `session_shutdown`: tears down the manager and clears runtime state.
43
48
  * - `agent_end`: refreshes project-server info and updates the LSP status UI.
44
49
  */
45
- export function registerSessionLifecycleHandlers(pi: ExtensionAPI, state: LspRuntimeState): void {
50
+ export function registerSessionLifecycleHandlers(
51
+ pi: ExtensionAPI,
52
+ state: LspRuntimeState,
53
+ runtime: WorkspaceRuntime,
54
+ ): void {
46
55
  // biome-ignore lint/complexity/noExcessiveCognitiveComplexity: session_start orchestrates setup, server detection, settings, and persistence.
47
56
  pi.on("session_start", async (_event: SessionStartEvent, ctx: ExtensionContext) => {
48
57
  if (state.manager) {
@@ -100,10 +109,9 @@ export function registerSessionLifecycleHandlers(pi: ExtensionAPI, state: LspRun
100
109
  state.lastDiagnosticsFingerprint = null;
101
110
  state.currentContextToken = null;
102
111
  state.lspActive = true;
103
- setSessionLspServiceState(cwd, {
104
- kind: "ready",
105
- service: new SessionLspService(state.manager),
106
- });
112
+ const service = new SessionLspService(state.manager);
113
+ setSessionLspServiceState(cwd, { kind: "ready", service });
114
+ registerLspCapabilities(runtime, cwd, service);
107
115
  registerLspTools(pi, buildLspToolPromptSurfaces(state.projectServers, cwd));
108
116
  ensureLspToolsActive(pi);
109
117
  persistLspActiveState(pi, state);
@@ -113,7 +121,9 @@ export function registerSessionLifecycleHandlers(pi: ExtensionAPI, state: LspRun
113
121
  pi.on("session_shutdown", async () => {
114
122
  clearTsconfigCache();
115
123
  if (state.manager) {
116
- clearSessionLspService(state.manager.getCwd());
124
+ const cwd = state.manager.getCwd();
125
+ unregisterLspCapabilities(runtime, cwd);
126
+ clearSessionLspService(cwd);
117
127
  await state.manager.shutdownAll();
118
128
  state.manager = null;
119
129
  }
@@ -3,6 +3,7 @@
3
3
  // modules so each orchestration concern lives in its own file.
4
4
 
5
5
  import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
6
+ import { getDefaultWorkspaceRuntime } from "@mrclrchtr/supi-code-runtime/api";
6
7
  import { registerDiagnosticInjectionHandlers } from "./handlers/diagnostic-injection.ts";
7
8
  import { registerSessionLifecycleHandlers } from "./handlers/session-lifecycle.ts";
8
9
  import { registerLspStatusCommand } from "./handlers/status-command.ts";
@@ -18,6 +19,7 @@ import { registerLspMessageRenderer } from "./ui/renderer.ts";
18
19
  export default function lspExtension(pi: ExtensionAPI) {
19
20
  registerLspSettings();
20
21
  const state = createRuntimeState();
22
+ const runtime = getDefaultWorkspaceRuntime();
21
23
 
22
24
  registerLspAwareToolOverrides(pi, {
23
25
  getInlineSeverity: () => state.inlineSeverity,
@@ -26,7 +28,7 @@ export default function lspExtension(pi: ExtensionAPI) {
26
28
  });
27
29
 
28
30
  registerLspTools(pi, defaultLspToolPromptSurfaces);
29
- registerSessionLifecycleHandlers(pi, state);
31
+ registerSessionLifecycleHandlers(pi, state, runtime);
30
32
  registerDiagnosticInjectionHandlers(pi, state);
31
33
  registerWorkspaceRecoveryHandler(pi, state);
32
34
  registerTreePersistHandlers(pi, state);
@@ -0,0 +1,24 @@
1
+ // Capability index — indexes and queries server capabilities.
2
+
3
+ import type { ServerCapabilities } from "../config/types.ts";
4
+ import { getSupportedLspServerActions } from "../tool/tool-specs.ts";
5
+ import type { LspManager } from "./manager.ts";
6
+
7
+ /**
8
+ * Indexes and queries what each server supports.
9
+ */
10
+ export interface CapabilityIndex {
11
+ /** Get the list of supported LSP actions for a server's capabilities. */
12
+ getSupportedActions(capabilities: ServerCapabilities | null | undefined): string[];
13
+ }
14
+
15
+ /**
16
+ * Create a CapabilityIndex for a workspace.
17
+ */
18
+ export function createCapabilityIndex(_manager: LspManager): CapabilityIndex {
19
+ return {
20
+ getSupportedActions(capabilities) {
21
+ return getSupportedLspServerActions(capabilities);
22
+ },
23
+ };
24
+ }
@@ -0,0 +1,33 @@
1
+ // Client pool — manages LSP client lifecycle (start, stop, reconnect).
2
+
3
+ import type { LspManager } from "./manager.ts";
4
+
5
+ /**
6
+ * Manages the lifecycle of LSP client instances for a workspace.
7
+ * Currently delegates to LspManager; the extraction will grow
8
+ * as responsibilities are migrated from manager.ts.
9
+ */
10
+ export interface ClientPool {
11
+ /**
12
+ * Ensure a file has an active client and return it.
13
+ * Returns null if no server can serve the file.
14
+ */
15
+ ensureFileOpen(filePath: string): ReturnType<LspManager["ensureFileOpen"]>;
16
+
17
+ /** Shut down all active clients. */
18
+ shutdownAll(): Promise<void>;
19
+ }
20
+
21
+ /**
22
+ * Create a ClientPool backed by LspManager.
23
+ */
24
+ export function createClientPool(manager: LspManager): ClientPool {
25
+ return {
26
+ async ensureFileOpen(filePath: string) {
27
+ return manager.ensureFileOpen(filePath);
28
+ },
29
+ async shutdownAll() {
30
+ return manager.shutdownAll();
31
+ },
32
+ };
33
+ }
@@ -0,0 +1,51 @@
1
+ // Diagnostic store — stores, aggregates, and queries diagnostics.
2
+
3
+ import type { Diagnostic } from "../config/types.ts";
4
+ import type { LspManager } from "./manager.ts";
5
+
6
+ /**
7
+ * Stores and queries diagnostics per file.
8
+ * Currently delegates to LspManager methods.
9
+ */
10
+ export interface DiagnosticStore {
11
+ /** Get workspace diagnostic summary grouped by file. */
12
+ getDiagnosticSummary(): Array<{ file: string; errors: number; warnings: number }>;
13
+
14
+ /** Get outstanding diagnostics at or above severity. */
15
+ getOutstandingDiagnostics(
16
+ maxSeverity?: number,
17
+ ): Array<{ file: string; diagnostics: Diagnostic[] }>;
18
+
19
+ /** Get outstanding diagnostic summary grouped by file. */
20
+ getOutstandingDiagnosticSummary(maxSeverity?: number): Array<{
21
+ file: string;
22
+ total: number;
23
+ errors: number;
24
+ warnings: number;
25
+ information: number;
26
+ hints: number;
27
+ }>;
28
+
29
+ /** Sync a file and return its diagnostics. */
30
+ syncAndGetDiagnostics(filePath: string, maxSeverity?: number): Promise<Diagnostic[] | null>;
31
+ }
32
+
33
+ /**
34
+ * Create a DiagnosticStore backed by LspManager.
35
+ */
36
+ export function createDiagnosticStore(manager: LspManager): DiagnosticStore {
37
+ return {
38
+ getDiagnosticSummary() {
39
+ return manager.getDiagnosticSummary();
40
+ },
41
+ getOutstandingDiagnostics(maxSeverity = 1) {
42
+ return manager.getOutstandingDiagnostics(maxSeverity);
43
+ },
44
+ getOutstandingDiagnosticSummary(maxSeverity = 1) {
45
+ return manager.getOutstandingDiagnosticSummary(maxSeverity);
46
+ },
47
+ async syncAndGetDiagnostics(filePath: string, maxSeverity = 4) {
48
+ return manager.syncFileAndGetDiagnostics(filePath, maxSeverity);
49
+ },
50
+ };
51
+ }
@@ -0,0 +1,37 @@
1
+ // Recovery coordinator — orchestrates stale diagnostic recovery.
2
+
3
+ import type { LspManager } from "./manager.ts";
4
+
5
+ /**
6
+ * Orchestrates stale diagnostic detection and recovery.
7
+ */
8
+ export interface RecoveryCoordinator {
9
+ /**
10
+ * Trigger a workspace-wide diagnostics refresh.
11
+ * Returns info about refreshed/restarted clients and stale assessment.
12
+ */
13
+ recover(options?: {
14
+ restartIfStillStale?: boolean;
15
+ maxWaitMs?: number;
16
+ quietMs?: number;
17
+ }): Promise<{
18
+ refreshedClients: number;
19
+ restartedClients: number;
20
+ staleAssessment: {
21
+ suspected: boolean;
22
+ matchedFiles: Array<{ file: string; diagnostics: unknown[] }>;
23
+ warning: string | null;
24
+ };
25
+ }>;
26
+ }
27
+
28
+ /**
29
+ * Create a RecoveryCoordinator backed by LspManager.
30
+ */
31
+ export function createRecoveryCoordinator(manager: LspManager): RecoveryCoordinator {
32
+ return {
33
+ async recover(options) {
34
+ return manager.recoverWorkspaceDiagnostics(options);
35
+ },
36
+ };
37
+ }