@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,3 +1,5 @@
1
+ ![SuPi](assets/logo.png)
2
+
1
3
  # @mrclrchtr/supi-lsp
2
4
 
3
5
  Adds Language Server Protocol support to the [pi coding agent](https://github.com/earendil-works/pi).
@@ -14,8 +16,6 @@ For local development:
14
16
  pi install ./packages/supi-lsp
15
17
  ```
16
18
 
17
- After editing the source, run `/reload`.
18
-
19
19
  ## What you get
20
20
 
21
21
  After install, pi gets **10 focused expert tools** for semantic language-server analysis:
@@ -32,6 +32,10 @@ After install, pi gets **10 focused expert tools** for semantic language-server
32
32
  - `lsp_recover` — refresh stale diagnostics after workspace changes
33
33
  - `/lsp-status` — inspect detected servers, roots, open files, and diagnostics
34
34
 
35
+ ![LSP status overlay](https://raw.githubusercontent.com/mrclrchtr/supi/main/screenshots/supi-lsp-status.png)
36
+
37
+ ![LSP hover in action](https://raw.githubusercontent.com/mrclrchtr/supi/main/screenshots/supi-lsp-hover.png)
38
+
35
39
  Coordinates use **1-based** line and character positions.
36
40
 
37
41
  ## Automatic behavior
@@ -61,10 +65,24 @@ Config lives in the standard SuPi config files:
61
65
  - global: `~/.pi/agent/supi/config.json`
62
66
  - project: `.pi/supi/config.json`
63
67
 
68
+ ## Architecture
69
+
70
+ `@mrclrchtr/supi-lsp` is the **semantic substrate** in SuPi's code-understanding stack.
71
+ It depends on `@mrclrchtr/supi-core` and `@mrclrchtr/supi-code-runtime` for shared
72
+ contracts, and provides a session-scoped LSP service that publishes semantic and
73
+ diagnostic capabilities into the shared workspace runtime.
74
+
75
+ ```text
76
+ supi-code-runtime ← shared contracts + workspace runtime
77
+
78
+ supi-lsp ← LSP client + session-scoped service + runtime capabilities
79
+ ```
80
+
64
81
  ## Package surfaces
65
82
 
66
83
  - `@mrclrchtr/supi-lsp/api` — reusable session-scoped LSP service and related types
67
84
  - `@mrclrchtr/supi-lsp/extension` — pi extension entrypoint
85
+ - `@mrclrchtr/supi-lsp/provider/lsp-semantic-provider` — shared SemanticProvider adapter
68
86
 
69
87
  Example:
70
88
 
@@ -0,0 +1,13 @@
1
+ # @mrclrchtr/supi-code-runtime
2
+
3
+ Shared workspace context, capability contracts, and canonical types for the SuPi code-understanding stack.
4
+
5
+ This is a **library-only package** — it has no pi extension surface, no user-facing tools, and no UI. It provides the shared abstractions that `supi-lsp`, `supi-tree-sitter`, and `supi-code-intelligence` use to communicate capability availability.
6
+
7
+ ## Package surfaces
8
+
9
+ - `@mrclrchtr/supi-code-runtime/api` — shared canonical types, capability interfaces, workspace runtime registry, and typed request context
10
+
11
+ ## License
12
+
13
+ MIT
@@ -0,0 +1,97 @@
1
+ ![SuPi](assets/logo.png)
2
+
3
+ # @mrclrchtr/supi-core
4
+
5
+ Shared infrastructure for SuPi extensions.
6
+
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`.
8
+
9
+ ## Install
10
+
11
+ ```bash
12
+ pnpm add @mrclrchtr/supi-core
13
+ ```
14
+
15
+ ## Package surfaces
16
+
17
+ - `@mrclrchtr/supi-core/api` — reusable helpers for other packages and extensions
18
+
19
+ ## What you get from the API
20
+
21
+ ### Config helpers
22
+
23
+ - `loadSupiConfig()` — merged config with resolution order `defaults <- global <- project`
24
+ - `loadSupiConfigForScope()` — load one scope at a time for settings UIs
25
+ - `writeSupiConfig()` — persist values
26
+ - `removeSupiConfigKey()` — remove a key or override
27
+
28
+ Config file locations:
29
+
30
+ - global: `~/.pi/agent/supi/config.json`
31
+ - project: `.pi/supi/config.json`
32
+
33
+ ### Settings helpers
34
+
35
+ - `registerSettings()` — register an arbitrary settings section
36
+ - `registerConfigSettings()` — register a config-backed settings section with scoped persistence helpers
37
+ - `registerSettingsCommand()` — register `/supi-settings`
38
+ - `openSettingsOverlay()` — open the shared settings UI directly
39
+ - `createInputSubmenu()` — helper for simple text-entry submenus
40
+
41
+ The built-in settings UI supports:
42
+
43
+ - project/global scope toggle
44
+ - grouped extension sections
45
+ - searchable setting lists
46
+
47
+ ### Context helpers
48
+
49
+ - `wrapExtensionContext()` — wrap injected text in SuPi's `<extension-context>` tag
50
+ - `findLastUserMessageIndex()`
51
+ - `getContextToken()`
52
+ - `getPromptContent()`
53
+ - `pruneAndReorderContextMessages()`
54
+ - `restorePromptContent()`
55
+
56
+ ### Shared registries
57
+
58
+ - context-provider registry for `/supi-context`
59
+ - debug-event registry for producers that want shared debug capture
60
+ - settings registry used by `/supi-settings`
61
+
62
+ ### Project and session helpers
63
+
64
+ - project-root detection and directory walking helpers such as `findProjectRoot()` and `walkProject()`
65
+ - active-branch session helper: `getActiveBranchEntries()`
66
+ - terminal helpers such as `formatTitle()`, `signalWaiting()`, and `signalDone()`
67
+
68
+ ## Example
69
+
70
+ ```ts
71
+ import { loadSupiConfig, registerConfigSettings, wrapExtensionContext } from "@mrclrchtr/supi-core/api";
72
+
73
+ const config = loadSupiConfig("my-extension", process.cwd(), {
74
+ enabled: true,
75
+ });
76
+
77
+ registerConfigSettings({
78
+ id: "my-extension",
79
+ label: "My Extension",
80
+ section: "my-extension",
81
+ defaults: { enabled: true },
82
+ buildItems: () => [],
83
+ persistChange: () => {},
84
+ });
85
+
86
+ const message = wrapExtensionContext("my-extension", "hello", {
87
+ file: "CLAUDE.md",
88
+ turn: 1,
89
+ });
90
+ ```
91
+
92
+ ## Source
93
+
94
+ - `src/api.ts` — exported library surface
95
+ - `src/config.ts` — shared config loading and writing
96
+ - `src/config-settings.ts` — config-backed settings registration helper
97
+ - `src/settings-ui.ts` — shared settings overlay
@@ -0,0 +1,57 @@
1
+ {
2
+ "name": "@mrclrchtr/supi-core",
3
+ "version": "1.9.0",
4
+ "description": "SuPi core — shared infrastructure for SuPi extensions (XML context tags, config system)",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/mrclrchtr/supi.git"
9
+ },
10
+ "publishConfig": {
11
+ "access": "public"
12
+ },
13
+ "keywords": [
14
+ "pi",
15
+ "pi-coding-agent"
16
+ ],
17
+ "files": [
18
+ "src/**/*.ts",
19
+ "!__tests__"
20
+ ],
21
+ "peerDependencies": {
22
+ "@earendil-works/pi-coding-agent": "*",
23
+ "@earendil-works/pi-tui": "*",
24
+ "typebox": "*"
25
+ },
26
+ "peerDependenciesMeta": {
27
+ "@earendil-works/pi-coding-agent": {
28
+ "optional": true
29
+ },
30
+ "@earendil-works/pi-tui": {
31
+ "optional": true
32
+ },
33
+ "typebox": {
34
+ "optional": true
35
+ }
36
+ },
37
+ "devDependencies": {
38
+ "@types/node": "25.9.1",
39
+ "vitest": "4.1.7"
40
+ },
41
+ "main": "src/api.ts",
42
+ "exports": {
43
+ "./api": "./src/api.ts",
44
+ "./config": "./src/config.ts",
45
+ "./context": "./src/context.ts",
46
+ "./debug": "./src/debug-registry.ts",
47
+ "./package.json": "./package.json",
48
+ "./path": "./src/path.ts",
49
+ "./project": "./src/project.ts",
50
+ "./session": "./src/session.ts",
51
+ "./settings": "./src/settings.ts",
52
+ "./settings-ui": "./src/settings-ui.ts",
53
+ "./terminal": "./src/terminal.ts",
54
+ "./tool-framework": "./src/tool-framework.ts",
55
+ "./types": "./src/types.ts"
56
+ }
57
+ }
@@ -0,0 +1,30 @@
1
+ // supi-core — shared infrastructure for SuPi extensions.
2
+ // Provides XML context tag wrapping, unified config system, context-message utilities,
3
+ // settings registry for supi-wide TUI settings, and a shared tool-spec/registration framework.
4
+ //
5
+ // Convenience barrel — re-exports all domain entry points.
6
+ // For lighter imports, use one of the domain subpaths directly
7
+ // (e.g. @mrclrchtr/supi-core/config, @mrclrchtr/supi-core/context).
8
+
9
+ // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
10
+ export * from "./config.ts";
11
+ // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
12
+ export * from "./context.ts";
13
+ // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
14
+ export * from "./debug-registry.ts";
15
+ // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
16
+ export * from "./path.ts";
17
+ // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
18
+ export * from "./project.ts";
19
+ // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
20
+ export * from "./session.ts";
21
+ // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
22
+ export * from "./settings.ts";
23
+ // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
24
+ export * from "./settings-ui.ts";
25
+ // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
26
+ export * from "./terminal.ts";
27
+ // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
28
+ export * from "./tool-framework.ts";
29
+ // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
30
+ export * from "./types.ts";