@mrclrchtr/supi-code-intelligence 11.0.1 → 11.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 (100) hide show
  1. package/README.md +41 -4
  2. package/gradle-helper/README.md +48 -0
  3. package/gradle-helper/build.sh +73 -0
  4. package/gradle-helper/lib/gradle-tooling-api-9.4.0.jar +0 -0
  5. package/gradle-helper/lib/slf4j-api-2.0.17.jar +0 -0
  6. package/gradle-helper/lib/slf4j-simple-2.0.17.jar +0 -0
  7. package/gradle-helper/lib/supi-gradle-observation.jar +0 -0
  8. package/gradle-helper/licenses/DEPENDENCIES.md +11 -0
  9. package/gradle-helper/licenses/LICENSE-gradle-tooling-api.txt +422 -0
  10. package/gradle-helper/licenses/LICENSE-slf4j.txt +21 -0
  11. package/gradle-helper/licenses/NOTICE-gradle.txt +21 -0
  12. package/gradle-helper/src/GradleObservation.java +597 -0
  13. package/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
  14. package/node_modules/@mrclrchtr/supi-core/package.json +1 -1
  15. package/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +41 -1
  16. package/node_modules/@mrclrchtr/supi-lsp/README.md +1 -1
  17. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
  18. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/package.json +1 -1
  19. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +41 -1
  20. package/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-jsonrpc/README.md +5 -0
  21. package/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-jsonrpc/lib/browser/ril.js +8 -0
  22. package/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-jsonrpc/lib/common/connection.js +7 -2
  23. package/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-jsonrpc/lib/common/ral.d.ts +8 -0
  24. package/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-jsonrpc/lib/node/main.d.ts +14 -0
  25. package/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-jsonrpc/lib/node/main.js +6 -4
  26. package/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-jsonrpc/lib/node/ril.js +5 -1
  27. package/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-jsonrpc/package.json +4 -2
  28. package/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-languageserver-protocol/package.json +4 -3
  29. package/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-languageserver-types/lib/esm/main.js +2 -2
  30. package/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-languageserver-types/lib/umd/main.js +2 -2
  31. package/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-languageserver-types/package.json +2 -1
  32. package/node_modules/@mrclrchtr/supi-lsp/package.json +6 -6
  33. package/node_modules/@mrclrchtr/supi-lsp/src/client/client.ts +21 -0
  34. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager.ts +1 -1
  35. package/node_modules/@mrclrchtr/supi-tree-sitter/README.md +1 -0
  36. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
  37. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/package.json +1 -1
  38. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +41 -1
  39. package/node_modules/@mrclrchtr/supi-tree-sitter/package.json +5 -3
  40. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/tsx/LICENSE +21 -0
  41. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/tsx/tree-sitter-tsx.wasm +0 -0
  42. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/tsx/tree-sitter-tsx.wasm.json +19 -2
  43. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/typescript/LICENSE +21 -0
  44. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/typescript/tree-sitter-typescript.wasm +0 -0
  45. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/typescript/tree-sitter-typescript.wasm.json +19 -2
  46. package/node_modules/ignore/README.md +36 -10
  47. package/node_modules/ignore/index.d.ts +3 -2
  48. package/node_modules/ignore/index.js +57 -53
  49. package/node_modules/ignore/legacy.js +50 -46
  50. package/node_modules/ignore/package.json +1 -1
  51. package/package.json +11 -6
  52. package/src/analysis/gradle/query.ts +273 -0
  53. package/src/analysis/gradle/runtime.ts +173 -0
  54. package/src/analysis/gradle/types.ts +65 -0
  55. package/src/analysis/read-next.ts +1 -4
  56. package/src/analysis/refactor/apply.ts +2 -2
  57. package/src/analysis/refactor/mutation-authority.ts +4 -1
  58. package/src/analysis/search/ast-scan.ts +143 -18
  59. package/src/analysis/workspace/safe-path.ts +14 -2
  60. package/src/analysis/workspace/types.ts +2 -0
  61. package/src/extension.ts +10 -1
  62. package/src/gradle/consent.ts +279 -0
  63. package/src/headless.ts +3 -0
  64. package/src/overview/collect.ts +11 -3
  65. package/src/session/orientation/workspace-context.ts +49 -28
  66. package/src/session/orientation-types.ts +11 -1
  67. package/src/session/orientation-workflow.ts +2 -0
  68. package/src/session/session.ts +8 -0
  69. package/src/tool/code_find/execute.ts +1 -1
  70. package/src/tool/code_find/markdown.ts +24 -17
  71. package/src/tool/code_find/result.ts +18 -5
  72. package/src/tool/code_find/spec.ts +2 -0
  73. package/src/tool/code_find/structured.ts +161 -0
  74. package/src/tool/code_graph/result.ts +32 -15
  75. package/src/tool/code_graph/spec.ts +2 -0
  76. package/src/tool/code_graph/structured.ts +142 -0
  77. package/src/tool/code_health/markdown.ts +5 -15
  78. package/src/tool/code_inspect/markdown.ts +19 -11
  79. package/src/tool/code_inspect/result.ts +1 -0
  80. package/src/tool/code_orientation/directory-navigation.ts +66 -0
  81. package/src/tool/code_orientation/gradle-sections.ts +68 -0
  82. package/src/tool/code_orientation/markdown.ts +19 -8
  83. package/src/tool/code_orientation/result.ts +89 -11
  84. package/src/tool/code_orientation/workspace-format.ts +2 -1
  85. package/src/tool/code_orientation/workspace-output.ts +40 -13
  86. package/src/tool/code_orientation/workspace-projects.ts +170 -50
  87. package/src/tool/code_orientation/workspace-sections.ts +3 -1
  88. package/src/tool/code_resolve/markdown.ts +4 -10
  89. package/src/tool/code_resolve/result.ts +2 -0
  90. package/src/tool/code_resolve/spec.ts +2 -0
  91. package/src/tool/code_resolve/structured.ts +103 -0
  92. package/src/tool/infra/truncate.ts +12 -4
  93. package/src/tool/register.ts +10 -6
  94. package/src/tool/result/display.ts +17 -0
  95. package/src/tool/result/model-budget.ts +195 -0
  96. package/src/tool/result/structured.ts +62 -0
  97. package/src/tool/result/types.ts +10 -2
  98. package/src/tool/specs.ts +2 -0
  99. package/src/types/execution.ts +5 -1
  100. package/src/ui/tui/display.ts +10 -4
@@ -14,6 +14,8 @@ export interface DebugRegistryConfig {
14
14
  enabled: boolean;
15
15
  /** What the agent-callable debug tool may return. */
16
16
  agentAccess: DebugAgentAccess;
17
+ /** Whether Agent Run retrospective capture is explicitly enabled. */
18
+ agentRunRetrospectivesEnabled: boolean;
17
19
  /** Maximum number of session-local events to keep in memory. */
18
20
  maxEvents: number;
19
21
  }
@@ -21,6 +23,7 @@ export interface DebugRegistryConfig {
21
23
  export const DEBUG_REGISTRY_DEFAULTS: DebugRegistryConfig = {
22
24
  enabled: false,
23
25
  agentAccess: "sanitized",
26
+ agentRunRetrospectivesEnabled: false,
24
27
  maxEvents: 100,
25
28
  };
26
29
 
@@ -75,6 +78,9 @@ export interface DebugEventQueryResult {
75
78
  /** Receives a sanitized event whenever the registry records one. */
76
79
  export type DebugEventListener = (event: DebugEventView) => void;
77
80
 
81
+ /** Receives sanitized events for persistence; separate from ordinary event subscriptions. */
82
+ export type DebugPersistenceSink = (event: DebugEventView) => void;
83
+
78
84
  export interface DebugSummary {
79
85
  total: number;
80
86
  byLevel: Partial<Record<DebugLevel, number>>;
@@ -85,6 +91,7 @@ interface DebugRegistryState {
85
91
  config: DebugRegistryConfig;
86
92
  events: DebugEvent[];
87
93
  listeners: Set<DebugEventListener>;
94
+ persistenceSinks: Set<DebugPersistenceSink>;
88
95
  nextId: number;
89
96
  }
90
97
 
@@ -111,13 +118,15 @@ function getState(): DebugRegistryState {
111
118
  config: cloneConfig(DEBUG_REGISTRY_DEFAULTS),
112
119
  events: [],
113
120
  listeners: new Set(),
121
+ persistenceSinks: new Set(),
114
122
  nextId: 1,
115
123
  };
116
124
  (globalThis as Record<symbol, unknown>)[REGISTRY_KEY] = state;
117
125
  }
118
126
  // Keep the shared registry compatible with extension reloads that reuse an
119
- // instance created before listeners existed.
127
+ // instance created before listener sets existed.
120
128
  if (!state.listeners) state.listeners = new Set();
129
+ if (!state.persistenceSinks) state.persistenceSinks = new Set();
121
130
  return state;
122
131
  }
123
132
 
@@ -200,6 +209,19 @@ export function isDebugRegistryEnabled(): boolean {
200
209
  return getState().config.enabled;
201
210
  }
202
211
 
212
+ /**
213
+ * Return whether a retrospective can be captured: Debug and its explicit opt-in
214
+ * must be enabled, and at least one persistence sink must be registered.
215
+ */
216
+ export function canRecordAgentRunRetrospective(): boolean {
217
+ const state = getState();
218
+ return (
219
+ state.config.enabled &&
220
+ state.config.agentRunRetrospectivesEnabled &&
221
+ state.persistenceSinks.size > 0
222
+ );
223
+ }
224
+
203
225
  /** Best-effort redaction helper for data exposed through sanitized debug views. */
204
226
  export function redactDebugData<T>(value: T): T {
205
227
  return redactValue(value, 8) as T;
@@ -226,6 +248,16 @@ export function subscribeDebugEvents(listener: DebugEventListener): () => void {
226
248
  return () => state.listeners.delete(listener);
227
249
  }
228
250
 
251
+ /**
252
+ * Register a sanitized event persistence sink. Sinks are tracked separately from
253
+ * ordinary listeners so eligibility checks only succeed when logging is active.
254
+ */
255
+ export function subscribeDebugPersistence(sink: DebugPersistenceSink): () => void {
256
+ const state = getState();
257
+ state.persistenceSinks.add(sink);
258
+ return () => state.persistenceSinks.delete(sink);
259
+ }
260
+
229
261
  /** Record a session-local debug event if debugging is enabled. */
230
262
  export function recordDebugEvent(input: DebugEventInput): DebugEvent | null {
231
263
  const state = getState();
@@ -251,6 +283,13 @@ export function recordDebugEvent(input: DebugEventInput): DebugEvent | null {
251
283
  // Debug-event consumers must not alter producer behavior.
252
284
  }
253
285
  }
286
+ for (const sink of state.persistenceSinks) {
287
+ try {
288
+ sink(toSanitizedView(event));
289
+ } catch {
290
+ // Persistence failures must not alter producer behavior.
291
+ }
292
+ }
254
293
  return {
255
294
  ...event,
256
295
  data: event.data === undefined ? undefined : redactDebugData(event.data),
@@ -309,5 +348,6 @@ export function resetDebugRegistry(): void {
309
348
  state.config = cloneConfig(DEBUG_REGISTRY_DEFAULTS);
310
349
  state.events = [];
311
350
  state.listeners.clear();
351
+ state.persistenceSinks.clear();
312
352
  state.nextId = 1;
313
353
  }
@@ -153,7 +153,7 @@ Caller cancellation or deadline stops only that caller's wait. Explicit diagnost
153
153
 
154
154
  If another request first opens a document during an active semantic or diagnostic request, the client can synchronize and repeat the request once. The retry retains the caller's original signal and deadline. Content, workspace, close, and lifecycle changes still reject stale results. A diagnostic retry collects new request evidence; it does not promote an old cache. This retry is not route recovery. A second enrollment during the retry still rejects the result. Semantic failure reasons state whether the retry failed or was exhausted. The bounded `request.retry` debug event records the retry reason and outcome with the public call's opaque operation ID, when supplied. A completed RPC alone does not establish accepted semantic evidence.
155
155
 
156
- A read-only semantic request can also retry once after an LSP `ContentModified` error (`-32801`). This retry shares the same one-retry budget as enrollment; it does not add another try. The client keeps the original request parameters and checks changes from the first failed input revision. It runs the full input sync before retry and checks current inputs before it accepts a result. An enrollment is still the only input change that can permit a retry. A content, workspace, close, lifecycle, or retirement change blocks it. Client replacement, caller cancellation, and a deadline also block retry. The post-request check rejects a result if inputs change while that attempt runs. This error-code retry applies only to read-only semantic requests. Diagnostics, rename, code actions, and refactors keep the default policy and do not retry `ContentModified`. See the [LSP 3.17 message-ordering rule](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#messageOrdering), the [retry guard](src/client/client-request-enrollment.ts), and the [client query path](src/client/client.ts).
156
+ A read-only semantic request can also retry once after an LSP `ContentModified` error (`-32801`). This retry shares the same one-retry budget as enrollment; it does not add another try. Before this protocol retry, the client waits 100 ms so an immediate retry does not race the same server analysis. The wait is cancellable, respects the original absolute deadline, and does not delay enrollment-only retries. The client keeps the original request parameters and checks changes from the first failed input revision. It runs the full input sync before retry and checks current inputs before it accepts a result. An enrollment is still the only input change that can permit a retry. A content, workspace, close, lifecycle, or retirement change blocks it. Client replacement, caller cancellation, and a deadline also block retry. The post-request check rejects a result if inputs change while that attempt runs. This error-code retry applies only to read-only semantic requests. Diagnostics, rename, code actions, and refactors keep the default policy and do not retry `ContentModified`. See the [LSP 3.17 message-ordering rule](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#messageOrdering), the [retry guard](src/client/client-request-enrollment.ts), and the [client query path](src/client/client.ts).
157
157
 
158
158
  Diagnostic collection does not close and reopen a document to obtain confirmation. It does not send a no-op `didChange` for that purpose. Refresh retains unchanged documents and their current server state, and resynchronizes changed or invalidated documents. A client restart may reopen tracked documents to restore client state; that is recovery, not diagnostic confirmation.
159
159
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrclrchtr/supi-code-runtime",
3
- "version": "11.0.1",
3
+ "version": "11.1.0",
4
4
  "description": "Shared workspace context and capability contracts for code intelligence",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrclrchtr/supi-core",
3
- "version": "11.0.1",
3
+ "version": "11.1.0",
4
4
  "description": "Shared settings, configuration, reporting, and session infrastructure",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -14,6 +14,8 @@ export interface DebugRegistryConfig {
14
14
  enabled: boolean;
15
15
  /** What the agent-callable debug tool may return. */
16
16
  agentAccess: DebugAgentAccess;
17
+ /** Whether Agent Run retrospective capture is explicitly enabled. */
18
+ agentRunRetrospectivesEnabled: boolean;
17
19
  /** Maximum number of session-local events to keep in memory. */
18
20
  maxEvents: number;
19
21
  }
@@ -21,6 +23,7 @@ export interface DebugRegistryConfig {
21
23
  export const DEBUG_REGISTRY_DEFAULTS: DebugRegistryConfig = {
22
24
  enabled: false,
23
25
  agentAccess: "sanitized",
26
+ agentRunRetrospectivesEnabled: false,
24
27
  maxEvents: 100,
25
28
  };
26
29
 
@@ -75,6 +78,9 @@ export interface DebugEventQueryResult {
75
78
  /** Receives a sanitized event whenever the registry records one. */
76
79
  export type DebugEventListener = (event: DebugEventView) => void;
77
80
 
81
+ /** Receives sanitized events for persistence; separate from ordinary event subscriptions. */
82
+ export type DebugPersistenceSink = (event: DebugEventView) => void;
83
+
78
84
  export interface DebugSummary {
79
85
  total: number;
80
86
  byLevel: Partial<Record<DebugLevel, number>>;
@@ -85,6 +91,7 @@ interface DebugRegistryState {
85
91
  config: DebugRegistryConfig;
86
92
  events: DebugEvent[];
87
93
  listeners: Set<DebugEventListener>;
94
+ persistenceSinks: Set<DebugPersistenceSink>;
88
95
  nextId: number;
89
96
  }
90
97
 
@@ -111,13 +118,15 @@ function getState(): DebugRegistryState {
111
118
  config: cloneConfig(DEBUG_REGISTRY_DEFAULTS),
112
119
  events: [],
113
120
  listeners: new Set(),
121
+ persistenceSinks: new Set(),
114
122
  nextId: 1,
115
123
  };
116
124
  (globalThis as Record<symbol, unknown>)[REGISTRY_KEY] = state;
117
125
  }
118
126
  // Keep the shared registry compatible with extension reloads that reuse an
119
- // instance created before listeners existed.
127
+ // instance created before listener sets existed.
120
128
  if (!state.listeners) state.listeners = new Set();
129
+ if (!state.persistenceSinks) state.persistenceSinks = new Set();
121
130
  return state;
122
131
  }
123
132
 
@@ -200,6 +209,19 @@ export function isDebugRegistryEnabled(): boolean {
200
209
  return getState().config.enabled;
201
210
  }
202
211
 
212
+ /**
213
+ * Return whether a retrospective can be captured: Debug and its explicit opt-in
214
+ * must be enabled, and at least one persistence sink must be registered.
215
+ */
216
+ export function canRecordAgentRunRetrospective(): boolean {
217
+ const state = getState();
218
+ return (
219
+ state.config.enabled &&
220
+ state.config.agentRunRetrospectivesEnabled &&
221
+ state.persistenceSinks.size > 0
222
+ );
223
+ }
224
+
203
225
  /** Best-effort redaction helper for data exposed through sanitized debug views. */
204
226
  export function redactDebugData<T>(value: T): T {
205
227
  return redactValue(value, 8) as T;
@@ -226,6 +248,16 @@ export function subscribeDebugEvents(listener: DebugEventListener): () => void {
226
248
  return () => state.listeners.delete(listener);
227
249
  }
228
250
 
251
+ /**
252
+ * Register a sanitized event persistence sink. Sinks are tracked separately from
253
+ * ordinary listeners so eligibility checks only succeed when logging is active.
254
+ */
255
+ export function subscribeDebugPersistence(sink: DebugPersistenceSink): () => void {
256
+ const state = getState();
257
+ state.persistenceSinks.add(sink);
258
+ return () => state.persistenceSinks.delete(sink);
259
+ }
260
+
229
261
  /** Record a session-local debug event if debugging is enabled. */
230
262
  export function recordDebugEvent(input: DebugEventInput): DebugEvent | null {
231
263
  const state = getState();
@@ -251,6 +283,13 @@ export function recordDebugEvent(input: DebugEventInput): DebugEvent | null {
251
283
  // Debug-event consumers must not alter producer behavior.
252
284
  }
253
285
  }
286
+ for (const sink of state.persistenceSinks) {
287
+ try {
288
+ sink(toSanitizedView(event));
289
+ } catch {
290
+ // Persistence failures must not alter producer behavior.
291
+ }
292
+ }
254
293
  return {
255
294
  ...event,
256
295
  data: event.data === undefined ? undefined : redactDebugData(event.data),
@@ -309,5 +348,6 @@ export function resetDebugRegistry(): void {
309
348
  state.config = cloneConfig(DEBUG_REGISTRY_DEFAULTS);
310
349
  state.events = [];
311
350
  state.listeners.clear();
351
+ state.persistenceSinks.clear();
312
352
  state.nextId = 1;
313
353
  }
@@ -6,6 +6,11 @@
6
6
 
7
7
  This npm module implements the base messaging protocol spoken between a VSCode language server and a VSCode language client.
8
8
 
9
+ The Node.js entry point requires Node.js 14.17.0 or newer. The runtime abstraction layer exposes
10
+ `RAL().crypto.randomUUID()` for cryptographically generated v4 UUIDs. The browser implementation
11
+ uses native `crypto.randomUUID()` when available and falls back to `crypto.getRandomValues()`,
12
+ including in non-secure contexts. Custom RAL implementations must provide this capability.
13
+
9
14
  The npm module can also be used standalone to establish a [JSON-RPC](http://www.jsonrpc.org/) channel between
10
15
  a client and a server. Below an example how to setup a JSON-RPC connection. First the client side.
11
16
 
@@ -145,6 +145,14 @@ class PromiseImpl {
145
145
  exports.PromiseImpl = PromiseImpl;
146
146
  const _textEncoder = new TextEncoder();
147
147
  const _ril = Object.freeze({
148
+ crypto: Object.freeze({
149
+ randomUUID() {
150
+ if (typeof globalThis.crypto.randomUUID === 'function') {
151
+ return globalThis.crypto.randomUUID();
152
+ }
153
+ return '10000000-1000-4000-8000-100000000000'.replace(/[018]/g, c => (+c ^ (globalThis.crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (+c / 4)))).toString(16));
154
+ }
155
+ }),
148
156
  messageBuffer: Object.freeze({
149
157
  create: (encoding) => new MessageBuffer(encoding)
150
158
  }),
@@ -418,11 +418,16 @@ function createMessageConnection(messageReader, messageWriter, _logger, options)
418
418
  }
419
419
  finally {
420
420
  if (result instanceof Promise) {
421
+ // Both settlements must release the parallelism slot. Written as
422
+ // .then(...).catch(...) the rejection path skipped the decrement, so
423
+ // one failed dispatch left `inFlight` permanently elevated and
424
+ // triggerMessageQueue() bailed out forever after.
421
425
  result.then(() => {
422
- inFlight--;
423
- triggerMessageQueue();
424
426
  }).catch((error) => {
425
427
  logger.error(`Processing message queue failed: ${error.toString()}`);
428
+ }).finally(() => {
429
+ inFlight--;
430
+ triggerMessageQueue();
426
431
  });
427
432
  }
428
433
  else {
@@ -42,7 +42,15 @@ interface _WritableStream {
42
42
  }
43
43
  interface _DuplexStream extends _ReadableStream, _WritableStream {
44
44
  }
45
+ /**
46
+ * Runtime abstraction implemented by this npm module.
47
+ * External implementations are not supported. Changes to this interface do not
48
+ * require a major version bump.
49
+ */
45
50
  interface RAL {
51
+ readonly crypto: {
52
+ randomUUID(): string;
53
+ };
46
54
  readonly applicationJson: {
47
55
  readonly encoder: ContentTypeEncoder;
48
56
  readonly decoder: ContentTypeDecoder;
@@ -46,12 +46,26 @@ export declare class StreamMessageWriter extends WriteableStreamMessageWriter {
46
46
  export declare function generateRandomPipeName(): string;
47
47
  export interface PipeTransport {
48
48
  onConnected(): Promise<[MessageReader, MessageWriter]>;
49
+ /**
50
+ * Closes the underlying server if a client hasn't connected yet. Callers
51
+ * should invoke this if they abandon the transport before `onConnected`
52
+ * resolves (for example because the server process failed to start) to
53
+ * avoid leaking the listening pipe.
54
+ */
55
+ close(): void;
49
56
  }
50
57
  export declare function createClientPipeTransport(pipeName: string, encoding?: RAL.MessageBufferEncoding): Promise<PipeTransport>;
51
58
  export declare function createServerPipeTransport(pipeName: string, encoding?: RAL.MessageBufferEncoding): [MessageReader, MessageWriter];
52
59
  export interface SocketTransport {
53
60
  port(): number;
54
61
  onConnected(): Promise<[MessageReader, MessageWriter]>;
62
+ /**
63
+ * Closes the underlying server if a client hasn't connected yet. Callers
64
+ * should invoke this if they abandon the transport before `onConnected`
65
+ * resolves (for example because the server process failed to start) to
66
+ * avoid leaking the listening socket.
67
+ */
68
+ close(): void;
55
69
  }
56
70
  export declare function createClientSocketTransport(port: number, encoding?: RAL.MessageBufferEncoding): Promise<SocketTransport>;
57
71
  export declare function createServerSocketTransport(port: number, encoding?: RAL.MessageBufferEncoding): [MessageReader, MessageWriter];
@@ -84,7 +84,7 @@ class IPCMessageWriter extends api_1.AbstractMessageWriter {
84
84
  this.errorCount = 0;
85
85
  const eventEmitter = this.process;
86
86
  eventEmitter.on('error', (error) => this.fireError(error));
87
- eventEmitter.on('close', () => this.fireClose);
87
+ eventEmitter.on('close', () => this.fireClose());
88
88
  }
89
89
  write(msg) {
90
90
  try {
@@ -119,7 +119,7 @@ class PortMessageReader extends api_1.AbstractMessageReader {
119
119
  constructor(port) {
120
120
  super();
121
121
  this.onData = new api_1.Emitter;
122
- port.on('close', () => this.fireClose);
122
+ port.on('close', () => this.fireClose());
123
123
  port.on('error', (error) => this.fireError(error));
124
124
  port.on('message', (message) => {
125
125
  this.onData.fire(message);
@@ -227,7 +227,8 @@ function createClientPipeTransport(pipeName, encoding = 'utf-8') {
227
227
  server.listen(pipeName, () => {
228
228
  server.removeListener('error', reject);
229
229
  resolve({
230
- onConnected: () => { return connected; }
230
+ onConnected: () => { return connected; },
231
+ close: () => { server.close(); }
231
232
  });
232
233
  });
233
234
  });
@@ -263,7 +264,8 @@ function createClientSocketTransport(port, encoding = 'utf-8') {
263
264
  const boundPort = address.port;
264
265
  resolve({
265
266
  port: () => boundPort,
266
- onConnected: () => { return connected; }
267
+ onConnected: () => { return connected; },
268
+ close: () => { server.close(); }
267
269
  });
268
270
  });
269
271
  });
@@ -5,6 +5,7 @@
5
5
  * ------------------------------------------------------------------------------------------ */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  const util_1 = require("util");
8
+ const crypto_1 = require("crypto");
8
9
  const api_1 = require("../common/api");
9
10
  class MessageBuffer extends api_1.AbstractMessageBuffer {
10
11
  static emptyBuffer = Buffer.allocUnsafe(0);
@@ -30,7 +31,7 @@ class MessageBuffer extends api_1.AbstractMessageBuffer {
30
31
  return buffer instanceof Buffer ? buffer : Buffer.from(buffer);
31
32
  }
32
33
  else {
33
- return buffer instanceof Buffer ? buffer.slice(0, length) : Buffer.from(buffer, 0, length);
34
+ return buffer instanceof Buffer ? buffer.slice(0, length) : Buffer.from(buffer.subarray(0, length));
34
35
  }
35
36
  }
36
37
  allocNative(length) {
@@ -99,6 +100,9 @@ class WritableStreamWrapper {
99
100
  }
100
101
  }
101
102
  const _ril = Object.freeze({
103
+ crypto: Object.freeze({
104
+ randomUUID: () => (0, crypto_1.randomUUID)()
105
+ }),
102
106
  messageBuffer: Object.freeze({
103
107
  create: (encoding) => new MessageBuffer(encoding)
104
108
  }),
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "vscode-jsonrpc",
3
3
  "description": "A json rpc implementation over streams",
4
- "version": "9.0.3",
4
+ "version": "10.0.0",
5
5
  "author": "Microsoft Corporation",
6
6
  "license": "MIT",
7
+ "homepage": "https://github.com/microsoft/vscode-languageserver-node/tree/main/jsonrpc",
7
8
  "repository": {
8
9
  "type": "git",
9
10
  "url": "https://github.com/Microsoft/vscode-languageserver-node.git",
@@ -13,7 +14,7 @@
13
14
  "url": "https://github.com/Microsoft/vscode-languageserver-node/issues"
14
15
  },
15
16
  "engines": {
16
- "node": ">=14.0.0"
17
+ "node": ">=14.17.0"
17
18
  },
18
19
  "exports": {
19
20
  ".": {
@@ -31,6 +32,7 @@
31
32
  },
32
33
  "devDependencies": {
33
34
  "@types/msgpack-lite": "^0.1.12",
35
+ "@types/node": "22.13.14",
34
36
  "msgpack-lite": "^0.1.26"
35
37
  },
36
38
  "scripts": {
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "vscode-languageserver-protocol",
3
3
  "description": "VSCode Language Server Protocol implementation",
4
- "version": "3.18.4",
4
+ "version": "3.18.5",
5
5
  "author": "Microsoft Corporation",
6
6
  "license": "MIT",
7
+ "homepage": "https://github.com/microsoft/vscode-languageserver-node/tree/main/protocol",
7
8
  "repository": {
8
9
  "type": "git",
9
10
  "url": "https://github.com/Microsoft/vscode-languageserver-node.git",
@@ -27,8 +28,8 @@
27
28
  }
28
29
  },
29
30
  "dependencies": {
30
- "vscode-jsonrpc": "9.0.3",
31
- "vscode-languageserver-types": "3.18.4"
31
+ "vscode-jsonrpc": "10.0.0",
32
+ "vscode-languageserver-types": "3.18.5"
32
33
  },
33
34
  "scripts": {
34
35
  "prepublishOnly": "npm run all:publish",
@@ -222,7 +222,7 @@ export var ColorPresentation;
222
222
  function is(value) {
223
223
  const candidate = value;
224
224
  return Is.objectLiteral(candidate) && Is.string(candidate.label)
225
- && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate))
225
+ && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate.textEdit))
226
226
  && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is));
227
227
  }
228
228
  ColorPresentation.is = is;
@@ -279,7 +279,7 @@ export var FoldingRange;
279
279
  */
280
280
  function is(value) {
281
281
  const candidate = value;
282
- return Is.objectLiteral(candidate) && Is.uinteger(candidate.startLine) && Is.uinteger(candidate.startLine)
282
+ return Is.objectLiteral(candidate) && Is.uinteger(candidate.startLine) && Is.uinteger(candidate.endLine)
283
283
  && (Is.undefined(candidate.startCharacter) || Is.uinteger(candidate.startCharacter))
284
284
  && (Is.undefined(candidate.endCharacter) || Is.uinteger(candidate.endCharacter))
285
285
  && (Is.undefined(candidate.kind) || Is.string(candidate.kind));
@@ -233,7 +233,7 @@
233
233
  function is(value) {
234
234
  var candidate = value;
235
235
  return Is.objectLiteral(candidate) && Is.string(candidate.label)
236
- && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate))
236
+ && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate.textEdit))
237
237
  && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is));
238
238
  }
239
239
  ColorPresentation.is = is;
@@ -290,7 +290,7 @@
290
290
  */
291
291
  function is(value) {
292
292
  var candidate = value;
293
- return Is.objectLiteral(candidate) && Is.uinteger(candidate.startLine) && Is.uinteger(candidate.startLine)
293
+ return Is.objectLiteral(candidate) && Is.uinteger(candidate.startLine) && Is.uinteger(candidate.endLine)
294
294
  && (Is.undefined(candidate.startCharacter) || Is.uinteger(candidate.startCharacter))
295
295
  && (Is.undefined(candidate.endCharacter) || Is.uinteger(candidate.endCharacter))
296
296
  && (Is.undefined(candidate.kind) || Is.string(candidate.kind));
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "vscode-languageserver-types",
3
3
  "description": "Types used by the Language server for node",
4
- "version": "3.18.4",
4
+ "version": "3.18.5",
5
5
  "author": "Microsoft Corporation",
6
6
  "license": "MIT",
7
+ "homepage": "https://github.com/microsoft/vscode-languageserver-node/tree/main/types",
7
8
  "repository": {
8
9
  "type": "git",
9
10
  "url": "https://github.com/Microsoft/vscode-languageserver-node.git",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrclrchtr/supi-lsp",
3
- "version": "11.0.1",
3
+ "version": "11.1.0",
4
4
  "description": "Language Server Protocol runtime for SuPi code intelligence",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -34,11 +34,11 @@
34
34
  "dependencies": {
35
35
  "ignore": "^7.0.5",
36
36
  "typescript": "6.0.3",
37
- "vscode-jsonrpc": "^9.0.0",
38
- "vscode-languageserver-protocol": "^3.18.0",
39
- "vscode-languageserver-types": "^3.18.0",
40
- "@mrclrchtr/supi-code-runtime": "11.0.1",
41
- "@mrclrchtr/supi-core": "11.0.1"
37
+ "vscode-jsonrpc": "^10.0.0",
38
+ "vscode-languageserver-protocol": "^3.18.5",
39
+ "vscode-languageserver-types": "^3.18.5",
40
+ "@mrclrchtr/supi-code-runtime": "11.1.0",
41
+ "@mrclrchtr/supi-core": "11.1.0"
42
42
  },
43
43
  "bundledDependencies": [
44
44
  "@mrclrchtr/supi-code-runtime",
@@ -82,6 +82,9 @@ import { SemanticInputSynchronizationError } from "./client-semantic-input-error
82
82
  import { JsonRpcClient, JsonRpcRequestError } from "./transport.ts";
83
83
 
84
84
  const SHUTDOWN_TIMEOUT_MS = 5_000;
85
+ // ContentModified can outlive the server's progress notifications. Yield before
86
+ // spending the single retry instead of immediately racing the same analysis.
87
+ const CONTENT_MODIFIED_RETRY_DELAY_MS = 100;
85
88
 
86
89
  /** Bounded stderr tail kept for startup-failure error messages. */
87
90
  const STDERR_TAIL_MAX_CHARS = 4_000;
@@ -1498,6 +1501,9 @@ export class LspClient {
1498
1501
  for (;;) {
1499
1502
  const attempt: SemanticRequestAttemptState = { inputRevision: undefined };
1500
1503
  try {
1504
+ if (retryGuard.retryReason === "content-modified") {
1505
+ await this.waitForContentModifiedRetry(control);
1506
+ }
1501
1507
  const data = await this.runSemanticRequestAttempt<T>({
1502
1508
  method,
1503
1509
  params,
@@ -1515,6 +1521,21 @@ export class LspClient {
1515
1521
  }
1516
1522
  }
1517
1523
 
1524
+ /** Pause only the protocol retry, without extending the caller's deadline. */
1525
+ private async waitForContentModifiedRetry(control?: CodeRequestControl): Promise<void> {
1526
+ let timer: ReturnType<typeof setTimeout> | undefined;
1527
+ try {
1528
+ await raceRequestControl(
1529
+ new Promise<void>((resolve) => {
1530
+ timer = setTimeout(resolve, CONTENT_MODIFIED_RETRY_DELAY_MS);
1531
+ }),
1532
+ control,
1533
+ );
1534
+ } finally {
1535
+ if (timer) clearTimeout(timer);
1536
+ }
1537
+ }
1538
+
1518
1539
  /** Return only when another attempt is permitted; retain the cause when retry stops. */
1519
1540
  private prepareSemanticRetry(options: {
1520
1541
  method: string;
@@ -2975,7 +2975,7 @@ export class LspManager {
2975
2975
  control?: CodeRequestControl,
2976
2976
  ): Promise<{ kind: "enrolled" } | { kind: "unavailable"; reason: string }> {
2977
2977
  throwIfCodeRequestInterrupted(control);
2978
- const files = [...new Set(filePaths)].sort();
2978
+ const files = [...new Set(filePaths)].sort((a, b) => (a < b ? -1 : a > b ? 1 : 0));
2979
2979
  const routeKey = clientKey(client.name, client.root);
2980
2980
  if (this.clients.get(routeKey) !== client) {
2981
2981
  return { kind: "unavailable", reason: "The semantic route changed during rename planning." };
@@ -82,6 +82,7 @@ The `type` filter accepts `class`, `interface`, `type`, `enum`, `struct`, `union
82
82
  ### Extraction limits
83
83
 
84
84
  - TS/JS, Python, Java, Go, Rust, and C/C++ outlines include nested named declarations and members. They are not complete indexes of local variables, parameters, or anonymous expressions. Other languages retain their existing extraction depth. HTML outlines list only elements with non-empty `id` attributes. SQL outlines list supported `CREATE` declarations and first-level table/type members. LaTeX outlines list section headings and selected command, environment, label, acronym, glossary-entry, and color definitions.
85
+ - TypeScript and TSX use [checked build-time grammar patches](scripts/generate-typescript-wasm.mjs) for type-only star re-exports and arrays of qualified import types such as `import("node:fs").Dirent[]`. Runtime parsing retains the original source and coordinates; other grammar gaps still report recovered syntax.
85
86
  - JavaScript-family imports collect `import` statements, not CommonJS `require()` calls. Exports collect file-level `export` statements, including TypeScript `export =`; they do not collect `module.exports` assignments or nested namespace exports. An eligible `.cjs` file can therefore return no imports or exports.
86
87
  - Python imports retain `import`/`from` module targets, including relative prefixes. Java imports retain ordinary/static targets. Go imports retain single/grouped paths. Rust imports retain explicit `use` paths, `extern crate`, and external `mod` names; inline module bodies are not imports. C/C++ imports retain literal quoted and angle-bracket include targets. Grouped paths use explicit syntax only; no files or bindings are resolved. Conditional directives are written evidence, not proof of active dependencies. Dynamic loaders, computed targets, and C++20 module imports remain outside extraction support.
87
88
  - LaTeX imports include package, class, source, and bibliography directives. Bibliography directives can refer to `.bib` files, but the grammar does not parse those files.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrclrchtr/supi-code-runtime",
3
- "version": "11.0.1",
3
+ "version": "11.1.0",
4
4
  "description": "Shared workspace context and capability contracts for code intelligence",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrclrchtr/supi-core",
3
- "version": "11.0.1",
3
+ "version": "11.1.0",
4
4
  "description": "Shared settings, configuration, reporting, and session infrastructure",
5
5
  "license": "MIT",
6
6
  "repository": {