@mrclrchtr/supi-code-intelligence 6.0.0 → 6.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 (71) hide show
  1. package/README.md +3 -1
  2. package/node_modules/@mrclrchtr/supi-code-runtime/README.md +2 -0
  3. package/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
  4. package/node_modules/@mrclrchtr/supi-code-runtime/src/capability/types.ts +5 -0
  5. package/node_modules/@mrclrchtr/supi-core/README.md +2 -0
  6. package/node_modules/@mrclrchtr/supi-core/package.json +1 -1
  7. package/node_modules/@mrclrchtr/supi-lsp/README.md +7 -1
  8. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/README.md +2 -0
  9. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
  10. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/capability/types.ts +5 -0
  11. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/README.md +2 -0
  12. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/package.json +1 -1
  13. package/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-jsonrpc/package.json +1 -1
  14. package/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-languageserver-protocol/lib/common/protocol.colorProvider.d.ts +1 -1
  15. package/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-languageserver-protocol/lib/common/protocol.d.ts +2 -2
  16. package/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-languageserver-protocol/lib/common/protocol.fileOperations.d.ts +9 -9
  17. package/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-languageserver-protocol/package.json +3 -3
  18. package/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-languageserver-types/lib/esm/main.d.ts +2 -2
  19. package/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-languageserver-types/lib/esm/main.js +1 -1
  20. package/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-languageserver-types/lib/umd/main.d.ts +2 -2
  21. package/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-languageserver-types/lib/umd/main.js +1 -1
  22. package/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-languageserver-types/package.json +1 -1
  23. package/node_modules/@mrclrchtr/supi-lsp/package.json +3 -3
  24. package/node_modules/@mrclrchtr/supi-lsp/src/api.ts +2 -0
  25. package/node_modules/@mrclrchtr/supi-lsp/src/client/client.ts +6 -0
  26. package/node_modules/@mrclrchtr/supi-lsp/src/config/server-config.ts +8 -0
  27. package/node_modules/@mrclrchtr/supi-lsp/src/config/types.ts +1 -0
  28. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-project-info.ts +6 -3
  29. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager.ts +582 -26
  30. package/node_modules/@mrclrchtr/supi-lsp/src/provider/lsp-semantic-provider.ts +2 -3
  31. package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-diagnostic-surface.ts +10 -0
  32. package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-registry.ts +36 -9
  33. package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-transition-debug.ts +2 -0
  34. package/node_modules/@mrclrchtr/supi-lsp/src/session/workspace-lsp-runtime.ts +4 -2
  35. package/node_modules/@mrclrchtr/supi-tree-sitter/README.md +2 -0
  36. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/README.md +2 -0
  37. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
  38. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/capability/types.ts +5 -0
  39. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/README.md +2 -0
  40. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/package.json +1 -1
  41. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.wasm +0 -0
  42. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.wasm.map +4 -4
  43. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/package.json +1 -1
  44. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.wasm +0 -0
  45. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.wasm.map +4 -4
  46. package/node_modules/@mrclrchtr/supi-tree-sitter/package.json +3 -3
  47. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/kotlin/tree-sitter-kotlin.wasm.json +1 -1
  48. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/sql/tree-sitter-sql.wasm.json +1 -1
  49. package/package.json +5 -5
  50. package/src/analysis/health/recovery.ts +4 -0
  51. package/src/analysis/health/server-status.ts +64 -0
  52. package/src/analysis/health/signals.ts +1 -0
  53. package/src/analysis/provider.ts +2 -1
  54. package/src/analysis/target/symbol.ts +28 -16
  55. package/src/analysis/target/types.ts +1 -0
  56. package/src/session/find-workflow.ts +5 -12
  57. package/src/session/health-refresh.ts +6 -2
  58. package/src/session/health-types.ts +8 -2
  59. package/src/session/health-workflow.ts +5 -1
  60. package/src/session/semantic-demand.ts +36 -0
  61. package/src/session/target-workflow.ts +9 -12
  62. package/src/tool/code_health/guidance.ts +2 -2
  63. package/src/tool/code_health/markdown.ts +15 -3
  64. package/src/tool/code_health/result.ts +14 -5
  65. package/src/tool/code_health/spec.ts +2 -1
  66. package/src/tool/code_health/tui.ts +24 -3
  67. package/src/tool/result/errors.ts +1 -0
  68. package/src/tool/result/types.ts +6 -0
  69. package/src/ui/footer.ts +7 -5
  70. package/src/ui/status-command.ts +31 -0
  71. package/src/ui/status-overlay.ts +69 -23
@@ -92,10 +92,9 @@ export function createLspSemanticProvider(lsp: WorkspaceLspRuntime): SemanticPro
92
92
  async workspaceSymbols(
93
93
  query: string,
94
94
  control?: CodeRequestControl,
95
+ scopes?: readonly string[],
95
96
  ): Promise<CodeQueryResult<CodeSymbol[]>> {
96
- const result = control
97
- ? await lsp.workspaceSymbol(query, control)
98
- : await lsp.workspaceSymbol(query);
97
+ const result = await lsp.workspaceSymbol(query, control, scopes);
99
98
  return mapCodeQueryResult(result, (results) =>
100
99
  results.map((symbol) => toCodeSymbol(symbol as SymbolInformation)),
101
100
  );
@@ -8,6 +8,14 @@ import type {
8
8
  WorkspaceDiagnosticSummaryEntry,
9
9
  } from "./runtime-diagnostics.ts";
10
10
 
11
+ /**
12
+ * Explicit diagnostic demand that can recover previously running crashed
13
+ * routes. Omitted scopes include every route with retained tracked files.
14
+ */
15
+ export interface ProcessCrashDiagnosticDemand {
16
+ readonly scopes?: readonly string[];
17
+ }
18
+
11
19
  /** Diagnostic and recovery operations owned by a workspace LSP runtime. */
12
20
  export interface WorkspaceLspDiagnosticSurface {
13
21
  fileDiagnostics(
@@ -37,6 +45,8 @@ export interface WorkspaceLspDiagnosticSurface {
37
45
  quietMs?: number;
38
46
  /** Evidence from a refresh the caller already completed; skips this pass's own refresh when no watched-file changes apply. */
39
47
  initialEvidence?: DiagnosticEvidenceSummary;
48
+ /** Explicit demand to recover crashed routes with tracked files in scope. */
49
+ processCrashDemand?: ProcessCrashDiagnosticDemand;
40
50
  control?: CodeRequestControl;
41
51
  }): Promise<RecoverDiagnosticsResult>;
42
52
  }
@@ -38,7 +38,10 @@ import type {
38
38
  WorkspaceLspRuntimeState,
39
39
  } from "./workspace-lsp-runtime.ts";
40
40
 
41
- export type { WorkspaceLspDiagnosticSurface } from "./runtime-diagnostic-surface.ts";
41
+ export type {
42
+ ProcessCrashDiagnosticDemand,
43
+ WorkspaceLspDiagnosticSurface,
44
+ } from "./runtime-diagnostic-surface.ts";
42
45
  export type {
43
46
  DiagnosticEvidenceDocument,
44
47
  DiagnosticEvidenceStatus,
@@ -107,7 +110,10 @@ class DefaultWorkspaceLspRuntime implements WorkspaceLspRuntime {
107
110
  control?: CodeRequestControl,
108
111
  ): Promise<CodeQueryResult<Hover | null>> {
109
112
  const resolvedPath = this.resolveFilePath(filePath);
110
- const client = await this.manager.ensureFileOpen(resolvedPath);
113
+ const client = await this.manager.ensureFileOpen(resolvedPath, {
114
+ recoverProcessCrash: true,
115
+ control,
116
+ });
111
117
  if (!client) return unavailableFileQuery("hover", resolvedPath);
112
118
  return client.hover(resolvedPath, position, control);
113
119
  }
@@ -118,7 +124,10 @@ class DefaultWorkspaceLspRuntime implements WorkspaceLspRuntime {
118
124
  control?: CodeRequestControl,
119
125
  ): Promise<CodeQueryResult<Location | Location[] | LocationLink[] | null>> {
120
126
  const resolvedPath = this.resolveFilePath(filePath);
121
- const client = await this.manager.ensureFileOpen(resolvedPath);
127
+ const client = await this.manager.ensureFileOpen(resolvedPath, {
128
+ recoverProcessCrash: true,
129
+ control,
130
+ });
122
131
  if (!client) return unavailableFileQuery("definition", resolvedPath);
123
132
  return client.definition(resolvedPath, position, control);
124
133
  }
@@ -129,7 +138,10 @@ class DefaultWorkspaceLspRuntime implements WorkspaceLspRuntime {
129
138
  control?: CodeRequestControl,
130
139
  ): Promise<CodeQueryResult<Location[]>> {
131
140
  const resolvedPath = this.resolveFilePath(filePath);
132
- const client = await this.manager.ensureFileOpen(resolvedPath);
141
+ const client = await this.manager.ensureFileOpen(resolvedPath, {
142
+ recoverProcessCrash: true,
143
+ control,
144
+ });
133
145
  if (!client) return unavailableFileQuery("references", resolvedPath);
134
146
  return mapCodeQueryResult(
135
147
  await client.references(resolvedPath, position, control),
@@ -143,7 +155,10 @@ class DefaultWorkspaceLspRuntime implements WorkspaceLspRuntime {
143
155
  control?: CodeRequestControl,
144
156
  ): Promise<CodeQueryResult<Location | Location[] | LocationLink[] | null>> {
145
157
  const resolvedPath = this.resolveFilePath(filePath);
146
- const client = await this.manager.ensureFileOpen(resolvedPath);
158
+ const client = await this.manager.ensureFileOpen(resolvedPath, {
159
+ recoverProcessCrash: true,
160
+ control,
161
+ });
147
162
  if (!client) return unavailableFileQuery("implementation", resolvedPath);
148
163
  return client.implementation(resolvedPath, position, control);
149
164
  }
@@ -153,7 +168,10 @@ class DefaultWorkspaceLspRuntime implements WorkspaceLspRuntime {
153
168
  control?: CodeRequestControl,
154
169
  ): Promise<CodeQueryResult<DocumentSymbol[] | SymbolInformation[]>> {
155
170
  const resolvedPath = this.resolveFilePath(filePath);
156
- const client = await this.manager.ensureFileOpen(resolvedPath);
171
+ const client = await this.manager.ensureFileOpen(resolvedPath, {
172
+ recoverProcessCrash: true,
173
+ control,
174
+ });
157
175
  if (!client) return unavailableFileQuery("document symbols", resolvedPath);
158
176
  return mapCodeQueryResult(
159
177
  await client.documentSymbols(resolvedPath, control),
@@ -164,8 +182,9 @@ class DefaultWorkspaceLspRuntime implements WorkspaceLspRuntime {
164
182
  async workspaceSymbol(
165
183
  query: string,
166
184
  control?: CodeRequestControl,
185
+ scopes?: readonly string[],
167
186
  ): Promise<CodeQueryResult<SymbolInformation[] | WorkspaceSymbol[]>> {
168
- return this.manager.workspaceSymbol(query, control);
187
+ return this.manager.workspaceSymbol(query, control, scopes);
169
188
  }
170
189
 
171
190
  async rename(
@@ -175,7 +194,10 @@ class DefaultWorkspaceLspRuntime implements WorkspaceLspRuntime {
175
194
  control?: CodeRequestControl,
176
195
  ): Promise<RoutedMutationResponse<WorkspaceEdit | null> | null> {
177
196
  const resolvedPath = this.resolveFilePath(filePath);
178
- const client = await this.manager.ensureFileOpen(resolvedPath);
197
+ const client = await this.manager.ensureFileOpen(resolvedPath, {
198
+ recoverProcessCrash: true,
199
+ control,
200
+ });
179
201
  if (!client) return null;
180
202
  return {
181
203
  value: await client.rename(resolvedPath, position, newName, control),
@@ -193,7 +215,10 @@ class DefaultWorkspaceLspRuntime implements WorkspaceLspRuntime {
193
215
  control?: CodeRequestControl,
194
216
  ): Promise<RoutedMutationResponse<CodeAction[] | null> | null> {
195
217
  const resolvedPath = this.resolveFilePath(filePath);
196
- const client = await this.manager.ensureFileOpen(resolvedPath);
218
+ const client = await this.manager.ensureFileOpen(resolvedPath, {
219
+ recoverProcessCrash: true,
220
+ control,
221
+ });
197
222
  if (!client) return null;
198
223
 
199
224
  const range = isRange(positionOrRange)
@@ -345,6 +370,8 @@ class DefaultWorkspaceLspRuntime implements WorkspaceLspRuntime {
345
370
  quietMs?: number;
346
371
  /** Evidence from a refresh the caller already completed; skips this pass's own refresh when no watched-file changes apply. */
347
372
  initialEvidence?: DiagnosticEvidenceSummary;
373
+ /** Explicit demand to recover crashed routes with tracked files in scope. */
374
+ processCrashDemand?: import("./runtime-diagnostic-surface.ts").ProcessCrashDiagnosticDemand;
348
375
  control?: CodeRequestControl;
349
376
  }): Promise<RecoverDiagnosticsResult> {
350
377
  const recoveryStartedAt = Date.now();
@@ -8,6 +8,7 @@ export interface TransitionServerEntry {
8
8
  readonly name: string;
9
9
  readonly status: ProjectServerInfo["status"];
10
10
  readonly ready: boolean;
11
+ readonly statusReason?: NonNullable<ProjectServerInfo["statusReason"]>;
11
12
  }
12
13
 
13
14
  /** Bound a project-server snapshot to MAX_SERVERS name/status/ready entries. */
@@ -18,6 +19,7 @@ function boundedServerEntries(
18
19
  name: truncateIdentity(server.name),
19
20
  status: server.status,
20
21
  ready: server.ready,
22
+ ...(server.statusReason ? { statusReason: server.statusReason } : {}),
21
23
  }));
22
24
  }
23
25
 
@@ -40,8 +40,8 @@ export interface RoutedMutationResponse<T> {
40
40
  * diagnostics, and recovery without exposing clients or the mutable manager.
41
41
  * File paths can be absolute or session-cwd-relative. A leading `@` is removed to
42
42
  * match Pi's built-in path-tool convention. Positions use raw 0-based LSP coordinates.
43
- * Provider request control is accepted
44
- * as metadata only in this expansion and is not interpreted by the runtime.
43
+ * Request control is forwarded to the routed client and limits the caller's
44
+ * wait without cancelling shared route recovery.
45
45
  */
46
46
  export interface WorkspaceLspRuntime extends WorkspaceLspDiagnosticSurface {
47
47
  hover(
@@ -68,9 +68,11 @@ export interface WorkspaceLspRuntime extends WorkspaceLspDiagnosticSurface {
68
68
  filePath: string,
69
69
  control?: CodeRequestControl,
70
70
  ): Promise<CodeQueryResult<DocumentSymbol[] | SymbolInformation[]>>;
71
+ /** Collect symbols from routes that can contribute within the optional path scopes. */
71
72
  workspaceSymbol(
72
73
  query: string,
73
74
  control?: CodeRequestControl,
75
+ scopes?: readonly string[],
74
76
  ): Promise<CodeQueryResult<SymbolInformation[] | WorkspaceSymbol[]>>;
75
77
  rename(
76
78
  filePath: string,
@@ -6,6 +6,8 @@
6
6
 
7
7
  # @mrclrchtr/supi-tree-sitter
8
8
 
9
+ [![GitHub stars](https://img.shields.io/github/stars/mrclrchtr/supi)](https://github.com/mrclrchtr/supi/stargazers)
10
+
9
11
  Tree-sitter structural code analysis library for the [pi coding agent](https://github.com/earendil-works/pi).
10
12
 
11
13
  This is a **library-only** package — it has no pi extension surface. Use `@mrclrchtr/supi-code-intelligence`
@@ -6,6 +6,8 @@
6
6
 
7
7
  # @mrclrchtr/supi-code-runtime
8
8
 
9
+ [![GitHub stars](https://img.shields.io/github/stars/mrclrchtr/supi)](https://github.com/mrclrchtr/supi/stargazers)
10
+
9
11
  Shared workspace context, capability contracts, and canonical types for the SuPi code-understanding stack.
10
12
 
11
13
  This is a **library-only package** — it has no pi extension surface, no user-facing tools, and no UI. It is not installed directly — `supi-lsp`, `supi-tree-sitter`, and `supi-code-intelligence` bundle it and use its shared abstractions to communicate capability availability.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrclrchtr/supi-code-runtime",
3
- "version": "6.0.0",
3
+ "version": "6.1.0",
4
4
  "description": "Shared workspace context and capability contracts for code intelligence",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -75,9 +75,14 @@ export interface SemanticProvider {
75
75
  filePath: string,
76
76
  control?: CodeRequestControl,
77
77
  ): Promise<CodeQueryResult<DocumentCodeSymbol[]>>;
78
+ /**
79
+ * Collect workspace symbols from routes that can contribute within the
80
+ * optional canonical path scopes.
81
+ */
78
82
  workspaceSymbols(
79
83
  query: string,
80
84
  control?: CodeRequestControl,
85
+ scopes?: readonly string[],
81
86
  ): Promise<CodeQueryResult<CodeSymbol[]>>;
82
87
 
83
88
  /** Optional definition capability with explicit completed-empty semantics. */
@@ -6,6 +6,8 @@
6
6
 
7
7
  # @mrclrchtr/supi-core
8
8
 
9
+ [![GitHub stars](https://img.shields.io/github/stars/mrclrchtr/supi)](https://github.com/mrclrchtr/supi/stargazers)
10
+
9
11
  Shared infrastructure for SuPi extensions.
10
12
 
11
13
  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`.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrclrchtr/supi-core",
3
- "version": "6.0.0",
3
+ "version": "6.1.0",
4
4
  "description": "Shared settings, configuration, reporting, and session infrastructure",
5
5
  "license": "MIT",
6
6
  "repository": {