@mrclrchtr/supi-code-intelligence 0.1.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 (146) hide show
  1. package/README.md +212 -0
  2. package/node_modules/@mrclrchtr/supi-core/README.md +90 -0
  3. package/node_modules/@mrclrchtr/supi-core/package.json +30 -0
  4. package/node_modules/@mrclrchtr/supi-core/src/config-settings.ts +76 -0
  5. package/node_modules/@mrclrchtr/supi-core/src/config.ts +186 -0
  6. package/node_modules/@mrclrchtr/supi-core/src/context-messages.ts +119 -0
  7. package/node_modules/@mrclrchtr/supi-core/src/context-provider-registry.ts +36 -0
  8. package/node_modules/@mrclrchtr/supi-core/src/context-tag.ts +31 -0
  9. package/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +255 -0
  10. package/node_modules/@mrclrchtr/supi-core/src/index.ts +83 -0
  11. package/node_modules/@mrclrchtr/supi-core/src/project-roots.ts +170 -0
  12. package/node_modules/@mrclrchtr/supi-core/src/registry-utils.ts +54 -0
  13. package/node_modules/@mrclrchtr/supi-core/src/session-utils.ts +29 -0
  14. package/node_modules/@mrclrchtr/supi-core/src/settings-command.ts +15 -0
  15. package/node_modules/@mrclrchtr/supi-core/src/settings-registry.ts +41 -0
  16. package/node_modules/@mrclrchtr/supi-core/src/settings-ui.ts +226 -0
  17. package/node_modules/@mrclrchtr/supi-core/src/terminal.ts +60 -0
  18. package/node_modules/@mrclrchtr/supi-lsp/README.md +112 -0
  19. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/README.md +90 -0
  20. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/package.json +30 -0
  21. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/config-settings.ts +76 -0
  22. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/config.ts +186 -0
  23. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/context-messages.ts +119 -0
  24. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/context-provider-registry.ts +36 -0
  25. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/context-tag.ts +31 -0
  26. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +255 -0
  27. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/index.ts +83 -0
  28. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/project-roots.ts +170 -0
  29. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/registry-utils.ts +54 -0
  30. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/session-utils.ts +29 -0
  31. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/settings-command.ts +15 -0
  32. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/settings-registry.ts +41 -0
  33. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/settings-ui.ts +226 -0
  34. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/terminal.ts +60 -0
  35. package/node_modules/@mrclrchtr/supi-lsp/package.json +45 -0
  36. package/node_modules/@mrclrchtr/supi-lsp/src/capabilities.ts +62 -0
  37. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-refresh.ts +229 -0
  38. package/node_modules/@mrclrchtr/supi-lsp/src/client/client.ts +545 -0
  39. package/node_modules/@mrclrchtr/supi-lsp/src/client/transport.ts +192 -0
  40. package/node_modules/@mrclrchtr/supi-lsp/src/config.ts +143 -0
  41. package/node_modules/@mrclrchtr/supi-lsp/src/defaults.json +82 -0
  42. package/node_modules/@mrclrchtr/supi-lsp/src/diagnostics/diagnostic-augmentation.ts +82 -0
  43. package/node_modules/@mrclrchtr/supi-lsp/src/diagnostics/diagnostic-display.ts +68 -0
  44. package/node_modules/@mrclrchtr/supi-lsp/src/diagnostics/diagnostic-summary.ts +73 -0
  45. package/node_modules/@mrclrchtr/supi-lsp/src/diagnostics/diagnostics.ts +98 -0
  46. package/node_modules/@mrclrchtr/supi-lsp/src/diagnostics/stale-diagnostics.ts +47 -0
  47. package/node_modules/@mrclrchtr/supi-lsp/src/diagnostics/suppression-diagnostics.ts +58 -0
  48. package/node_modules/@mrclrchtr/supi-lsp/src/format.ts +359 -0
  49. package/node_modules/@mrclrchtr/supi-lsp/src/guidance.ts +163 -0
  50. package/node_modules/@mrclrchtr/supi-lsp/src/index.ts +17 -0
  51. package/node_modules/@mrclrchtr/supi-lsp/src/lsp-state.ts +82 -0
  52. package/node_modules/@mrclrchtr/supi-lsp/src/lsp.ts +470 -0
  53. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-client-state.ts +34 -0
  54. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-diagnostics.ts +139 -0
  55. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-helpers.ts +39 -0
  56. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-project-info.ts +46 -0
  57. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-types.ts +39 -0
  58. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-workspace-recovery.ts +83 -0
  59. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-workspace-symbol.ts +18 -0
  60. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager.ts +550 -0
  61. package/node_modules/@mrclrchtr/supi-lsp/src/overrides.ts +173 -0
  62. package/node_modules/@mrclrchtr/supi-lsp/src/pattern-matcher.ts +197 -0
  63. package/node_modules/@mrclrchtr/supi-lsp/src/renderer.ts +120 -0
  64. package/node_modules/@mrclrchtr/supi-lsp/src/scanner.ts +153 -0
  65. package/node_modules/@mrclrchtr/supi-lsp/src/search-fallback.ts +98 -0
  66. package/node_modules/@mrclrchtr/supi-lsp/src/service-registry.ts +153 -0
  67. package/node_modules/@mrclrchtr/supi-lsp/src/settings-registration.ts +292 -0
  68. package/node_modules/@mrclrchtr/supi-lsp/src/summary.ts +153 -0
  69. package/node_modules/@mrclrchtr/supi-lsp/src/tool-actions.ts +430 -0
  70. package/node_modules/@mrclrchtr/supi-lsp/src/tree-persist.ts +48 -0
  71. package/node_modules/@mrclrchtr/supi-lsp/src/tsconfig-scope.ts +156 -0
  72. package/node_modules/@mrclrchtr/supi-lsp/src/types.ts +409 -0
  73. package/node_modules/@mrclrchtr/supi-lsp/src/ui.ts +358 -0
  74. package/node_modules/@mrclrchtr/supi-lsp/src/utils.ts +122 -0
  75. package/node_modules/@mrclrchtr/supi-lsp/src/workspace-sentinels.ts +114 -0
  76. package/node_modules/@mrclrchtr/supi-tree-sitter/README.md +97 -0
  77. package/node_modules/@mrclrchtr/supi-tree-sitter/package.json +67 -0
  78. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/.gitkeep +0 -0
  79. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/bash/tree-sitter-bash.wasm +0 -0
  80. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/bash/tree-sitter-bash.wasm.json +7 -0
  81. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/c/tree-sitter-c.wasm +0 -0
  82. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/c/tree-sitter-c.wasm.json +7 -0
  83. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/cpp/tree-sitter-cpp.wasm +0 -0
  84. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/cpp/tree-sitter-cpp.wasm.json +7 -0
  85. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/go/tree-sitter-go.wasm +0 -0
  86. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/go/tree-sitter-go.wasm.json +7 -0
  87. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/html/tree-sitter-html.wasm +0 -0
  88. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/html/tree-sitter-html.wasm.json +7 -0
  89. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/java/tree-sitter-java.wasm +0 -0
  90. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/java/tree-sitter-java.wasm.json +7 -0
  91. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/javascript/tree-sitter-javascript.wasm +0 -0
  92. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/javascript/tree-sitter-javascript.wasm.json +7 -0
  93. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/kotlin/tree-sitter-kotlin.wasm +0 -0
  94. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/kotlin/tree-sitter-kotlin.wasm.json +12 -0
  95. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/python/tree-sitter-python.wasm +0 -0
  96. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/python/tree-sitter-python.wasm.json +7 -0
  97. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/r/tree-sitter-r.wasm +0 -0
  98. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/r/tree-sitter-r.wasm.json +7 -0
  99. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/ruby/tree-sitter-ruby.wasm +0 -0
  100. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/ruby/tree-sitter-ruby.wasm.json +7 -0
  101. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/rust/tree-sitter-rust.wasm +0 -0
  102. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/rust/tree-sitter-rust.wasm.json +7 -0
  103. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/sql/tree-sitter-sql.wasm +0 -0
  104. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/sql/tree-sitter-sql.wasm.json +19 -0
  105. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/tsx/tree-sitter-tsx.wasm +0 -0
  106. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/tsx/tree-sitter-tsx.wasm.json +7 -0
  107. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/typescript/tree-sitter-typescript.wasm +0 -0
  108. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/typescript/tree-sitter-typescript.wasm.json +7 -0
  109. package/node_modules/@mrclrchtr/supi-tree-sitter/scripts/generate-kotlin-wasm.mjs +126 -0
  110. package/node_modules/@mrclrchtr/supi-tree-sitter/scripts/generate-sql-wasm.mjs +144 -0
  111. package/node_modules/@mrclrchtr/supi-tree-sitter/scripts/vendor-wasm.mjs +151 -0
  112. package/node_modules/@mrclrchtr/supi-tree-sitter/src/callees.ts +343 -0
  113. package/node_modules/@mrclrchtr/supi-tree-sitter/src/coordinates.ts +108 -0
  114. package/node_modules/@mrclrchtr/supi-tree-sitter/src/exports.ts +315 -0
  115. package/node_modules/@mrclrchtr/supi-tree-sitter/src/formatting.ts +104 -0
  116. package/node_modules/@mrclrchtr/supi-tree-sitter/src/imports.ts +42 -0
  117. package/node_modules/@mrclrchtr/supi-tree-sitter/src/index.ts +16 -0
  118. package/node_modules/@mrclrchtr/supi-tree-sitter/src/language.ts +116 -0
  119. package/node_modules/@mrclrchtr/supi-tree-sitter/src/node-at.ts +96 -0
  120. package/node_modules/@mrclrchtr/supi-tree-sitter/src/outline.ts +287 -0
  121. package/node_modules/@mrclrchtr/supi-tree-sitter/src/runtime.ts +237 -0
  122. package/node_modules/@mrclrchtr/supi-tree-sitter/src/session.ts +112 -0
  123. package/node_modules/@mrclrchtr/supi-tree-sitter/src/structure.ts +7 -0
  124. package/node_modules/@mrclrchtr/supi-tree-sitter/src/syntax-node.ts +13 -0
  125. package/node_modules/@mrclrchtr/supi-tree-sitter/src/tree-sitter.ts +306 -0
  126. package/node_modules/@mrclrchtr/supi-tree-sitter/src/types.ts +146 -0
  127. package/package.json +47 -0
  128. package/src/actions/affected-action.ts +310 -0
  129. package/src/actions/brief-action.ts +242 -0
  130. package/src/actions/callees-action.ts +134 -0
  131. package/src/actions/callers-action.ts +215 -0
  132. package/src/actions/implementations-action.ts +190 -0
  133. package/src/actions/index-action.ts +187 -0
  134. package/src/actions/pattern-action.ts +232 -0
  135. package/src/architecture.ts +367 -0
  136. package/src/brief-focused.ts +383 -0
  137. package/src/brief.ts +228 -0
  138. package/src/code-intelligence.ts +122 -0
  139. package/src/git-context.ts +65 -0
  140. package/src/guidance.ts +39 -0
  141. package/src/index.ts +28 -0
  142. package/src/resolve-target.ts +104 -0
  143. package/src/search-helpers.ts +283 -0
  144. package/src/target-resolution.ts +368 -0
  145. package/src/tool-actions.ts +109 -0
  146. package/src/types.ts +57 -0
@@ -0,0 +1,409 @@
1
+ // LSP protocol types — minimal subset needed for our client.
2
+ // Based on the Language Server Protocol specification.
3
+ // biome-ignore-all lint/nursery/noExcessiveLinesPerFile: protocol types are intentionally centralized in one catalog file.
4
+
5
+ // ── Positions & Ranges ────────────────────────────────────────────────
6
+
7
+ /** 0-based line and character offset. */
8
+ export interface Position {
9
+ line: number;
10
+ character: number;
11
+ }
12
+
13
+ export interface Range {
14
+ start: Position;
15
+ end: Position;
16
+ }
17
+
18
+ export interface Location {
19
+ uri: string;
20
+ range: Range;
21
+ }
22
+
23
+ export interface LocationLink {
24
+ originSelectionRange?: Range;
25
+ targetUri: string;
26
+ targetRange: Range;
27
+ targetSelectionRange: Range;
28
+ }
29
+
30
+ // ── Text Edits ────────────────────────────────────────────────────────
31
+
32
+ export interface TextEdit {
33
+ range: Range;
34
+ newText: string;
35
+ }
36
+
37
+ export interface TextDocumentEdit {
38
+ textDocument: { uri: string; version?: number | null };
39
+ edits: TextEdit[];
40
+ }
41
+
42
+ export interface WorkspaceEdit {
43
+ changes?: Record<string, TextEdit[]>;
44
+ documentChanges?: TextDocumentEdit[];
45
+ }
46
+
47
+ // ── Diagnostics ───────────────────────────────────────────────────────
48
+
49
+ export const DiagnosticSeverity = {
50
+ Error: 1,
51
+ Warning: 2,
52
+ Information: 3,
53
+ Hint: 4,
54
+ } as const;
55
+ export type DiagnosticSeverity = (typeof DiagnosticSeverity)[keyof typeof DiagnosticSeverity];
56
+
57
+ export interface DiagnosticRelatedInformation {
58
+ location: Location;
59
+ message: string;
60
+ }
61
+
62
+ export interface Diagnostic {
63
+ range: Range;
64
+ severity?: DiagnosticSeverity;
65
+ code?: number | string;
66
+ codeDescription?: { href: string };
67
+ source?: string;
68
+ message: string;
69
+ relatedInformation?: DiagnosticRelatedInformation[];
70
+ }
71
+
72
+ // ── Hover ─────────────────────────────────────────────────────────────
73
+
74
+ export interface MarkupContent {
75
+ kind: "plaintext" | "markdown";
76
+ value: string;
77
+ }
78
+
79
+ export type MarkedString = string | { language: string; value: string };
80
+
81
+ export interface Hover {
82
+ contents: MarkupContent | MarkedString | MarkedString[];
83
+ range?: Range;
84
+ }
85
+
86
+ // ── Symbols ───────────────────────────────────────────────────────────
87
+
88
+ export const SymbolKind = {
89
+ File: 1,
90
+ Module: 2,
91
+ Namespace: 3,
92
+ Package: 4,
93
+ Class: 5,
94
+ Method: 6,
95
+ Property: 7,
96
+ Field: 8,
97
+ Constructor: 9,
98
+ Enum: 10,
99
+ Interface: 11,
100
+ Function: 12,
101
+ Variable: 13,
102
+ Constant: 14,
103
+ String: 15,
104
+ Number: 16,
105
+ Boolean: 17,
106
+ Array: 18,
107
+ Object: 19,
108
+ Key: 20,
109
+ Null: 21,
110
+ EnumMember: 22,
111
+ Struct: 23,
112
+ Event: 24,
113
+ Operator: 25,
114
+ TypeParameter: 26,
115
+ } as const;
116
+ export type SymbolKind = (typeof SymbolKind)[keyof typeof SymbolKind];
117
+
118
+ export interface DocumentSymbol {
119
+ name: string;
120
+ detail?: string;
121
+ kind: SymbolKind;
122
+ range: Range;
123
+ selectionRange: Range;
124
+ children?: DocumentSymbol[];
125
+ }
126
+
127
+ export interface SymbolInformation {
128
+ name: string;
129
+ kind: SymbolKind;
130
+ location: Location;
131
+ containerName?: string;
132
+ }
133
+
134
+ export interface WorkspaceSymbol {
135
+ name: string;
136
+ kind: SymbolKind;
137
+ location: Location;
138
+ containerName?: string;
139
+ /** LSP 3.17+ extra data for resolve support */
140
+ data?: unknown;
141
+ }
142
+
143
+ // ── Code Actions ──────────────────────────────────────────────────────
144
+
145
+ export interface CodeActionContext {
146
+ diagnostics: Diagnostic[];
147
+ only?: string[];
148
+ }
149
+
150
+ export interface Command {
151
+ title: string;
152
+ command: string;
153
+ arguments?: unknown[];
154
+ }
155
+
156
+ export interface CodeAction {
157
+ title: string;
158
+ kind?: string;
159
+ diagnostics?: Diagnostic[];
160
+ isPreferred?: boolean;
161
+ edit?: WorkspaceEdit;
162
+ command?: Command;
163
+ }
164
+
165
+ // ── Publish Diagnostics ───────────────────────────────────────────────
166
+
167
+ export interface PublishDiagnosticsParams {
168
+ uri: string;
169
+ version?: number;
170
+ diagnostics: Diagnostic[];
171
+ }
172
+
173
+ export const FileChangeType = {
174
+ Created: 1,
175
+ Changed: 2,
176
+ Deleted: 3,
177
+ } as const;
178
+ export type FileChangeType = (typeof FileChangeType)[keyof typeof FileChangeType];
179
+
180
+ export interface FileEvent {
181
+ uri: string;
182
+ type: FileChangeType;
183
+ }
184
+
185
+ export interface DidChangeWatchedFilesParams {
186
+ changes: FileEvent[];
187
+ }
188
+
189
+ // ── LSP 3.17 Pull Diagnostics ─────────────────────────────────────────
190
+
191
+ export interface DocumentDiagnosticParams {
192
+ textDocument: TextDocumentIdentifier;
193
+ identifier?: string;
194
+ previousResultId?: string;
195
+ workDoneToken?: unknown;
196
+ partialResultToken?: unknown;
197
+ }
198
+
199
+ /** LSP 3.17 document diagnostic report shape used by textDocument/diagnostic. */
200
+ export type DocumentDiagnosticReport =
201
+ | RelatedFullDocumentDiagnosticReport
202
+ | RelatedUnchangedDocumentDiagnosticReport;
203
+
204
+ /** Full document diagnostic report, optionally carrying related document reports. */
205
+ export interface RelatedFullDocumentDiagnosticReport extends FullDocumentDiagnosticReport {
206
+ relatedDocuments?: Record<
207
+ string,
208
+ FullDocumentDiagnosticReport | UnchangedDocumentDiagnosticReport
209
+ >;
210
+ }
211
+
212
+ /** Unchanged document diagnostic report, optionally carrying related document reports. */
213
+ export interface RelatedUnchangedDocumentDiagnosticReport
214
+ extends UnchangedDocumentDiagnosticReport {
215
+ relatedDocuments?: Record<
216
+ string,
217
+ FullDocumentDiagnosticReport | UnchangedDocumentDiagnosticReport
218
+ >;
219
+ }
220
+
221
+ /** Full diagnostic payload for a document. */
222
+ export interface FullDocumentDiagnosticReport {
223
+ kind: "full";
224
+ resultId?: string;
225
+ items: Diagnostic[];
226
+ }
227
+
228
+ /** Result-id-only report indicating a document's diagnostics are unchanged. */
229
+ export interface UnchangedDocumentDiagnosticReport {
230
+ kind: "unchanged";
231
+ resultId: string;
232
+ }
233
+
234
+ /** Client capability for pull diagnostics. */
235
+ export interface ClientDiagnosticCapabilities {
236
+ dynamicRegistration?: boolean;
237
+ relatedDocumentSupport?: boolean;
238
+ }
239
+
240
+ // ── Initialize ────────────────────────────────────────────────────────
241
+
242
+ export interface InitializeParams {
243
+ processId: number | null;
244
+ rootUri: string | null;
245
+ capabilities: ClientCapabilities;
246
+ initializationOptions?: unknown;
247
+ }
248
+
249
+ export interface ClientCapabilities {
250
+ textDocument?: {
251
+ synchronization?: {
252
+ didSave?: boolean;
253
+ dynamicRegistration?: boolean;
254
+ };
255
+ hover?: {
256
+ contentFormat?: string[];
257
+ dynamicRegistration?: boolean;
258
+ };
259
+ definition?: {
260
+ dynamicRegistration?: boolean;
261
+ linkSupport?: boolean;
262
+ };
263
+ references?: {
264
+ dynamicRegistration?: boolean;
265
+ };
266
+ documentSymbol?: {
267
+ dynamicRegistration?: boolean;
268
+ hierarchicalDocumentSymbolSupport?: boolean;
269
+ };
270
+ rename?: {
271
+ dynamicRegistration?: boolean;
272
+ prepareSupport?: boolean;
273
+ };
274
+ codeAction?: {
275
+ dynamicRegistration?: boolean;
276
+ codeActionLiteralSupport?: {
277
+ codeActionKind: { valueSet: string[] };
278
+ };
279
+ };
280
+ publishDiagnostics?: {
281
+ relatedInformation?: boolean;
282
+ versionSupport?: boolean;
283
+ };
284
+ /** LSP 3.17+ pull diagnostic capability */
285
+ diagnostic?: ClientDiagnosticCapabilities;
286
+ };
287
+ workspace?: {
288
+ workspaceFolders?: boolean;
289
+ diagnostics?: {
290
+ refreshSupport?: boolean;
291
+ };
292
+ };
293
+ }
294
+
295
+ export interface InitializeResult {
296
+ capabilities: ServerCapabilities;
297
+ }
298
+
299
+ export interface ServerCapabilities {
300
+ textDocumentSync?: number | { openClose?: boolean; change?: number };
301
+ hoverProvider?: boolean;
302
+ definitionProvider?: boolean;
303
+ referencesProvider?: boolean;
304
+ documentSymbolProvider?: boolean;
305
+ workspaceSymbolProvider?: boolean;
306
+ renameProvider?: boolean | { prepareProvider?: boolean };
307
+ codeActionProvider?: boolean | { codeActionKinds?: string[] };
308
+ implementationProvider?: boolean;
309
+ /** LSP 3.17+ pull diagnostic support */
310
+ diagnosticProvider?:
311
+ | boolean
312
+ | {
313
+ /** Document diagnostic provider */
314
+ documentIdentifierProvider?: boolean | { workDoneProgress?: boolean };
315
+ /** Workspace diagnostic provider */
316
+ workspaceDiagnostics?: boolean | { workDoneProgress?: boolean };
317
+ /** Identifier for result sets */
318
+ identifierSet?: boolean;
319
+ /** Inter-file dependency support */
320
+ interFileDependencies?: boolean;
321
+ /** Workspace-wide multi-file support */
322
+ workspaceDiagnosticsSupport?: boolean;
323
+ };
324
+ }
325
+
326
+ // ── Text Document Items ───────────────────────────────────────────────
327
+
328
+ export interface TextDocumentIdentifier {
329
+ uri: string;
330
+ }
331
+
332
+ export interface TextDocumentItem {
333
+ uri: string;
334
+ languageId: string;
335
+ version: number;
336
+ text: string;
337
+ }
338
+
339
+ export interface VersionedTextDocumentIdentifier {
340
+ uri: string;
341
+ version: number;
342
+ }
343
+
344
+ export interface TextDocumentPositionParams {
345
+ textDocument: TextDocumentIdentifier;
346
+ position: Position;
347
+ }
348
+
349
+ // ── JSON-RPC ──────────────────────────────────────────────────────────
350
+
351
+ export interface JsonRpcRequest {
352
+ jsonrpc: "2.0";
353
+ id: number;
354
+ method: string;
355
+ params?: unknown;
356
+ }
357
+
358
+ export interface JsonRpcResponse {
359
+ jsonrpc: "2.0";
360
+ id: number;
361
+ result?: unknown;
362
+ error?: { code: number; message: string; data?: unknown };
363
+ }
364
+
365
+ export interface JsonRpcNotification {
366
+ jsonrpc: "2.0";
367
+ method: string;
368
+ params?: unknown;
369
+ }
370
+
371
+ export type JsonRpcMessage = JsonRpcRequest | JsonRpcResponse | JsonRpcNotification;
372
+
373
+ // ── Server Configuration ──────────────────────────────────────────────
374
+
375
+ export interface ServerConfig {
376
+ command: string;
377
+ args?: string[];
378
+ fileTypes: string[];
379
+ rootMarkers: string[];
380
+ enabled?: boolean;
381
+ initializationOptions?: unknown;
382
+ }
383
+
384
+ /** LSP configuration keyed by language name (e.g. `typescript`, `python`). */
385
+ export interface LspConfig {
386
+ servers: Record<string, ServerConfig>;
387
+ }
388
+
389
+ export interface DetectedProjectServer {
390
+ name: string;
391
+ root: string;
392
+ fileTypes: string[];
393
+ }
394
+
395
+ export interface ProjectServerInfo extends DetectedProjectServer {
396
+ status: "running" | "error" | "unavailable";
397
+ supportedActions: string[];
398
+ openFiles: string[];
399
+ }
400
+
401
+ /** A language whose source files are present but the server binary is missing. */
402
+ export interface MissingServer {
403
+ /** Language name (e.g. "python", "rust"). */
404
+ name: string;
405
+ /** Server command that was not found on PATH. */
406
+ command: string;
407
+ /** File extensions found in the project (subset of server.fileTypes). */
408
+ foundExtensions: string[];
409
+ }