@mrclrchtr/supi-lsp 4.10.0 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/README.md +111 -5
  2. package/node_modules/@mrclrchtr/supi-code-runtime/README.md +2 -0
  3. package/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
  4. package/node_modules/@mrclrchtr/supi-code-runtime/src/api.ts +9 -0
  5. package/node_modules/@mrclrchtr/supi-code-runtime/src/capability/types.ts +53 -13
  6. package/node_modules/@mrclrchtr/supi-code-runtime/src/request-control.ts +47 -0
  7. package/node_modules/@mrclrchtr/supi-code-runtime/src/types.ts +13 -1
  8. package/node_modules/@mrclrchtr/supi-core/README.md +2 -0
  9. package/node_modules/@mrclrchtr/supi-core/package.json +2 -2
  10. package/node_modules/@mrclrchtr/supi-core/src/api.ts +1 -1
  11. package/node_modules/@mrclrchtr/supi-core/src/config/config.ts +31 -0
  12. package/node_modules/@mrclrchtr/supi-core/src/config.ts +2 -0
  13. package/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +19 -6
  14. package/node_modules/@mrclrchtr/supi-core/src/debug.ts +9 -0
  15. package/node_modules/@mrclrchtr/supi-core/src/index.ts +1 -1
  16. package/node_modules/@mrclrchtr/supi-core/src/settings/settings-registry.ts +3 -0
  17. package/package.json +7 -6
  18. package/src/api.ts +22 -1
  19. package/src/client/client-diagnostic-cache.ts +245 -0
  20. package/src/client/client-diagnostic-capabilities.ts +78 -0
  21. package/src/client/client-diagnostic-collection.ts +171 -0
  22. package/src/client/client-diagnostic-evidence.ts +413 -0
  23. package/src/client/client-diagnostic-host.ts +15 -0
  24. package/src/client/client-diagnostic-publication.ts +214 -0
  25. package/src/client/client-diagnostic-pull.ts +62 -0
  26. package/src/client/client-diagnostic-refresh.ts +690 -0
  27. package/src/client/client-diagnostic-request.ts +9 -0
  28. package/src/client/client-diagnostic-timing.ts +97 -16
  29. package/src/client/client-diagnostic-waiters.ts +206 -0
  30. package/src/client/client-diagnostics.ts +448 -298
  31. package/src/client/client-document-state.ts +70 -0
  32. package/src/client/client-document-sync.ts +231 -0
  33. package/src/client/client-file-state.ts +25 -0
  34. package/src/client/client.ts +529 -119
  35. package/src/client/transport.ts +161 -33
  36. package/src/config/capabilities.ts +12 -3
  37. package/src/config/config.ts +5 -5
  38. package/src/config/defaults.json +1 -1
  39. package/src/config/server-config.ts +3 -0
  40. package/src/config/tsconfig-extends.ts +68 -0
  41. package/src/config/tsconfig-path.ts +8 -0
  42. package/src/config/tsconfig-scope.ts +176 -24
  43. package/src/debug-telemetry.ts +45 -0
  44. package/src/diagnostics/evidence.ts +42 -0
  45. package/src/diagnostics/workspace-sentinels.ts +46 -10
  46. package/src/manager/manager-client-state.ts +79 -9
  47. package/src/manager/manager-diagnostics.ts +17 -7
  48. package/src/manager/manager-workspace-recovery.ts +350 -26
  49. package/src/manager/manager-workspace-symbol.ts +5 -2
  50. package/src/manager/manager.ts +586 -96
  51. package/src/provider/lsp-refactor-provider.ts +130 -0
  52. package/src/provider/lsp-semantic-provider.ts +45 -329
  53. package/src/provider/refactor-planning.ts +57 -120
  54. package/src/provider/semantic-edit-normalizer.ts +320 -0
  55. package/src/provider/semantic-symbol-mapper.ts +207 -0
  56. package/src/session/readiness.ts +72 -2
  57. package/src/session/runtime-controller.ts +151 -26
  58. package/src/session/runtime-diagnostic-surface.ts +42 -0
  59. package/src/session/runtime-diagnostics.ts +92 -0
  60. package/src/session/runtime-registry.ts +165 -118
  61. package/src/session/runtime-transition-debug.ts +49 -0
  62. package/src/session/workspace-lsp-runtime.ts +102 -0
@@ -0,0 +1,102 @@
1
+ import type { CodeQueryResult, CodeRequestControl } from "@mrclrchtr/supi-code-runtime/api";
2
+ import type {
3
+ CodeAction,
4
+ DocumentSymbol,
5
+ FileEvent,
6
+ Hover,
7
+ Location,
8
+ LocationLink,
9
+ Position,
10
+ ProjectServerInfo,
11
+ Range,
12
+ SymbolInformation,
13
+ WorkspaceEdit,
14
+ WorkspaceSymbol,
15
+ } from "../config/types.ts";
16
+ import type { WorkspaceLspDiagnosticSurface } from "./runtime-diagnostic-surface.ts";
17
+
18
+ export type WorkspaceLspRuntimeState =
19
+ | { kind: "ready"; runtime: WorkspaceLspRuntime }
20
+ | { kind: "inactive"; runtime: WorkspaceLspRuntime }
21
+ | { kind: "pending" }
22
+ | { kind: "disabled" }
23
+ | { kind: "unavailable"; reason: string };
24
+
25
+ export type SemanticReadinessResult =
26
+ | { kind: "ready" }
27
+ | { kind: "timeout" }
28
+ | { kind: "unavailable"; reason: string };
29
+
30
+ /** One mutation response and the exact provider roots from its semantic route. */
31
+ export interface RoutedMutationResponse<T> {
32
+ /** Provider response from the routed client. */
33
+ readonly value: T;
34
+ /** Roots that the routed client owns for this mutation response. */
35
+ readonly authorizedMutationRoots: readonly string[];
36
+ }
37
+
38
+ /**
39
+ * Workspace-scoped LSP interface that owns routing, readiness, semantic operations,
40
+ * diagnostics, and recovery without exposing clients or the mutable manager.
41
+ * File paths can be absolute or session-cwd-relative. A leading `@` is removed to
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.
45
+ */
46
+ export interface WorkspaceLspRuntime extends WorkspaceLspDiagnosticSurface {
47
+ hover(
48
+ filePath: string,
49
+ position: Position,
50
+ control?: CodeRequestControl,
51
+ ): Promise<CodeQueryResult<Hover | null>>;
52
+ definition(
53
+ filePath: string,
54
+ position: Position,
55
+ control?: CodeRequestControl,
56
+ ): Promise<CodeQueryResult<Location | Location[] | LocationLink[] | null>>;
57
+ references(
58
+ filePath: string,
59
+ position: Position,
60
+ control?: CodeRequestControl,
61
+ ): Promise<CodeQueryResult<Location[]>>;
62
+ implementation(
63
+ filePath: string,
64
+ position: Position,
65
+ control?: CodeRequestControl,
66
+ ): Promise<CodeQueryResult<Location | Location[] | LocationLink[] | null>>;
67
+ documentSymbols(
68
+ filePath: string,
69
+ control?: CodeRequestControl,
70
+ ): Promise<CodeQueryResult<DocumentSymbol[] | SymbolInformation[]>>;
71
+ workspaceSymbol(
72
+ query: string,
73
+ control?: CodeRequestControl,
74
+ ): Promise<CodeQueryResult<SymbolInformation[] | WorkspaceSymbol[]>>;
75
+ rename(
76
+ filePath: string,
77
+ position: Position,
78
+ newName: string,
79
+ control?: CodeRequestControl,
80
+ ): Promise<RoutedMutationResponse<WorkspaceEdit | null> | null>;
81
+ codeActions(
82
+ filePath: string,
83
+ positionOrRange: Position | Range,
84
+ control?: CodeRequestControl,
85
+ ): Promise<RoutedMutationResponse<CodeAction[] | null> | null>;
86
+ getOpenDocumentVersion(filePath: string): number | null;
87
+ waitUntilReadyForFile(
88
+ filePath: string,
89
+ options?: { timeoutMs?: number },
90
+ control?: CodeRequestControl,
91
+ ): Promise<SemanticReadinessResult>;
92
+ waitUntilReadyForWorkspace(
93
+ options?: { timeoutMs?: number },
94
+ control?: CodeRequestControl,
95
+ ): Promise<SemanticReadinessResult>;
96
+ getProjectServers(): ProjectServerInfo[];
97
+ isSupportedSourceFile(filePath: string): boolean;
98
+ trackFile(filePath: string): Promise<boolean>;
99
+ closeFile(filePath: string): void;
100
+ pruneMissingFiles(): readonly string[];
101
+ noteWorkspaceChanges(changes: FileEvent[]): void;
102
+ }