@mrclrchtr/supi-code-intelligence 6.2.0 → 6.3.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 (51) hide show
  1. package/README.md +2 -0
  2. package/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
  3. package/node_modules/@mrclrchtr/supi-core/package.json +1 -1
  4. package/node_modules/@mrclrchtr/supi-lsp/README.md +2 -0
  5. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
  6. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/package.json +1 -1
  7. package/node_modules/@mrclrchtr/supi-lsp/node_modules/ignore/README.md +52 -0
  8. package/node_modules/@mrclrchtr/supi-lsp/node_modules/ignore/index.js +785 -129
  9. package/node_modules/@mrclrchtr/supi-lsp/node_modules/ignore/legacy.js +660 -98
  10. package/node_modules/@mrclrchtr/supi-lsp/node_modules/ignore/package.json +10 -4
  11. package/node_modules/@mrclrchtr/supi-lsp/package.json +3 -3
  12. package/node_modules/@mrclrchtr/supi-lsp/src/api.ts +6 -2
  13. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-process-crash-report.ts +106 -0
  14. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-workspace-recovery.ts +4 -4
  15. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager.ts +348 -99
  16. package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-diagnostics.ts +43 -15
  17. package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-registry.ts +23 -32
  18. package/node_modules/@mrclrchtr/supi-lsp/src/session/workspace-lsp-runtime.ts +4 -4
  19. package/node_modules/@mrclrchtr/supi-lsp/src/summary.ts +1 -1
  20. package/node_modules/@mrclrchtr/supi-lsp/src/workspace-path-policy.ts +18 -9
  21. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
  22. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/package.json +1 -1
  23. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/README.md +29 -1
  24. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.cjs +99 -19
  25. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.cjs.map +4 -4
  26. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.js +94 -18
  27. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.js.map +4 -4
  28. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.wasm +0 -0
  29. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.wasm.map +14 -14
  30. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/package.json +13 -8
  31. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.cjs +97 -19
  32. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.cjs.map +4 -4
  33. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.cts +28 -8
  34. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.cts.map +1 -1
  35. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.ts +28 -8
  36. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.ts.map +1 -1
  37. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.js +92 -18
  38. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.js.map +4 -4
  39. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.wasm +0 -0
  40. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.wasm.map +17 -17
  41. package/node_modules/@mrclrchtr/supi-tree-sitter/package.json +7 -4
  42. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/kotlin/tree-sitter-kotlin.wasm +0 -0
  43. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/kotlin/tree-sitter-kotlin.wasm.json +2 -2
  44. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/sql/tree-sitter-sql.wasm +0 -0
  45. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/sql/tree-sitter-sql.wasm.json +2 -2
  46. package/package.json +5 -5
  47. package/src/session/health-refresh.ts +4 -2
  48. package/src/session/health-types.ts +3 -3
  49. package/src/substrate/lsp/settings.ts +2 -1
  50. package/src/tool/code_health/refresh-outcome.ts +37 -7
  51. package/src/tool/code_health/refresh-status.ts +58 -12
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ignore",
3
- "version": "7.0.6",
3
+ "version": "7.0.8",
4
4
  "description": "Ignore is a manager and filter for .gitignore rules, the one used by eslint, gitbook and many others.",
5
5
  "types": "index.d.ts",
6
6
  "files": [
@@ -25,9 +25,15 @@
25
25
  "test:mjs:16": "ts-node --compilerOptions '{\"moduleResolution\": \"Node16\", \"module\": \"Node16\"}' ./test/import/simple.mjs && babel -o ./test/import/simple-mjs.js ./test/import/simple.mjs && node ./test/import/simple-mjs.js",
26
26
 
27
27
  "===================== cases =======================": "",
28
- "test:cases": "npm run tap test/*.test.js -- --coverage",
28
+ "test:cases": "npm run tap test/*.test.js -- --coverage --100",
29
29
  "tap": "tap --reporter classic",
30
30
 
31
+ "=================== benchmark =====================": "",
32
+ "benchmark": "node benchmark",
33
+
34
+ "==================== compat =======================": "",
35
+ "compat": "node compat && node compat --win32",
36
+
31
37
  "===================== debug =======================": "",
32
38
  "test:git": "npm run tap test/git-check-ignore.test.js",
33
39
  "test:ignore": "npm run tap test/ignore.test.js",
@@ -35,13 +41,13 @@
35
41
  "test:others": "npm run tap test/others.test.js",
36
42
  "test:no-coverage": "npm run tap test/*.test.js -- --no-check-coverage",
37
43
 
38
- "test": "npm run lint && npm run ts && npm run build && npm run test:cases",
44
+ "test": "npm run lint && npm run ts && npm run build && npm run test:cases && npm run compat",
39
45
  "test:win32": "IGNORE_TEST_WIN32=1 npm run test",
40
46
  "report": "tap --coverage-report=html"
41
47
  },
42
48
  "repository": {
43
49
  "type": "git",
44
- "url": "git@github.com:kaelzhang/node-ignore.git"
50
+ "url": "https://github.com/kaelzhang/node-ignore.git"
45
51
  },
46
52
  "keywords": [
47
53
  "ignore",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrclrchtr/supi-lsp",
3
- "version": "6.2.0",
3
+ "version": "6.3.0",
4
4
  "description": "Language Server Protocol runtime for SuPi code intelligence",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -37,8 +37,8 @@
37
37
  "vscode-jsonrpc": "^9.0.0",
38
38
  "vscode-languageserver-protocol": "^3.18.0",
39
39
  "vscode-languageserver-types": "^3.18.0",
40
- "@mrclrchtr/supi-code-runtime": "6.2.0",
41
- "@mrclrchtr/supi-core": "6.2.0"
40
+ "@mrclrchtr/supi-code-runtime": "6.3.0",
41
+ "@mrclrchtr/supi-core": "6.3.0"
42
42
  },
43
43
  "bundledDependencies": [
44
44
  "@mrclrchtr/supi-code-runtime",
@@ -56,7 +56,10 @@ export type {
56
56
  DiagnosticEvidenceSummary,
57
57
  OutstandingDiagnosticSummaryEntry,
58
58
  ProcessCrashDiagnosticDemand,
59
- ProcessCrashRecoverySummary,
59
+ ProcessCrashRecoveryEntry,
60
+ ProcessCrashRecoveryNextAction,
61
+ ProcessCrashRecoveryOutcome,
62
+ ProcessCrashRecoveryReport,
60
63
  RecoverDiagnosticsResult,
61
64
  RoutedMutationResponse,
62
65
  SemanticReadinessResult,
@@ -69,8 +72,9 @@ export type {
69
72
  } from "./session/runtime-registry.ts";
70
73
  export {
71
74
  clearWorkspaceLspRuntime,
72
- emptyProcessCrashRecoverySummary,
75
+ emptyProcessCrashRecoveryReport,
73
76
  getWorkspaceLspRuntime,
77
+ MAX_PROCESS_CRASH_RECOVERY_ENTRIES,
74
78
  setWorkspaceLspRuntimeState,
75
79
  waitForWorkspaceLspRuntime,
76
80
  } from "./session/runtime-registry.ts";
@@ -0,0 +1,106 @@
1
+ import * as path from "node:path";
2
+ import {
3
+ MAX_PROCESS_CRASH_RECOVERY_ENTRIES,
4
+ type ProcessCrashRecoveryEntry,
5
+ type ProcessCrashRecoveryNextAction,
6
+ type ProcessCrashRecoveryOutcome,
7
+ type ProcessCrashRecoveryReport,
8
+ } from "../session/runtime-diagnostics.ts";
9
+
10
+ /** One route result before its root is projected to a workspace-relative path. */
11
+ export interface ProcessCrashRecoveryRouteResult {
12
+ readonly name: string;
13
+ readonly root: string;
14
+ readonly outcome: ProcessCrashRecoveryOutcome;
15
+ /** The caught Error.message from a failed replacement, when available. */
16
+ readonly failureMessage?: string;
17
+ }
18
+
19
+ /** Maximum failure detail retained in a process-crash report. */
20
+ export const MAX_PROCESS_CRASH_FAILURE_MESSAGE_LENGTH = 512;
21
+
22
+ const OUTCOME_ORDER: Record<ProcessCrashRecoveryOutcome, number> = {
23
+ "recovery-failed": 0,
24
+ "recovery-exhausted": 1,
25
+ "skipped-no-retained-file": 2,
26
+ recovered: 3,
27
+ };
28
+
29
+ /** Build the bounded, deterministic report for one process-crash demand. */
30
+ export function buildProcessCrashRecoveryReport(
31
+ routes: readonly ProcessCrashRecoveryRouteResult[],
32
+ cwd: string,
33
+ ): ProcessCrashRecoveryReport {
34
+ const entries = routes.map((route) => toReportEntry(route, cwd)).sort(compareEntries);
35
+ const visibleEntries = entries.slice(0, MAX_PROCESS_CRASH_RECOVERY_ENTRIES);
36
+
37
+ return {
38
+ recoveredRoutes: countRoutes(routes, "recovered"),
39
+ skippedRoutes: countRoutes(routes, "skipped-no-retained-file"),
40
+ failedRoutes: countRoutes(routes, "recovery-failed"),
41
+ exhaustedRoutes: countRoutes(routes, "recovery-exhausted"),
42
+ entries: visibleEntries,
43
+ omittedEntries: Math.max(0, entries.length - visibleEntries.length),
44
+ };
45
+ }
46
+
47
+ /** Limit one caught Error.message without retaining other error fields. */
48
+ export function boundProcessCrashFailureMessage(message: string): string {
49
+ if (message.length <= MAX_PROCESS_CRASH_FAILURE_MESSAGE_LENGTH) return message;
50
+ return `${message.slice(0, MAX_PROCESS_CRASH_FAILURE_MESSAGE_LENGTH - 1)}…`;
51
+ }
52
+
53
+ function toReportEntry(
54
+ route: ProcessCrashRecoveryRouteResult,
55
+ cwd: string,
56
+ ): ProcessCrashRecoveryEntry {
57
+ const action = nextAction(route.outcome);
58
+ const entry: ProcessCrashRecoveryEntry = {
59
+ name: route.name,
60
+ root: relativeRoot(cwd, route.root),
61
+ outcome: route.outcome,
62
+ ...(action ? { nextAction: action } : {}),
63
+ ...(route.outcome === "recovery-failed" && route.failureMessage
64
+ ? { failureMessage: boundProcessCrashFailureMessage(route.failureMessage) }
65
+ : {}),
66
+ };
67
+ return entry;
68
+ }
69
+
70
+ function relativeRoot(cwd: string, root: string): string {
71
+ return (path.relative(path.resolve(cwd), path.resolve(cwd, root)) || ".").replaceAll("\\", "/");
72
+ }
73
+
74
+ function nextAction(outcome: ProcessCrashRecoveryOutcome): ProcessCrashRecoveryNextAction | null {
75
+ switch (outcome) {
76
+ case "skipped-no-retained-file":
77
+ return "use-exact-file";
78
+ case "recovery-failed":
79
+ case "recovery-exhausted":
80
+ return "reload-workspace";
81
+ case "recovered":
82
+ return null;
83
+ }
84
+ }
85
+
86
+ function compareEntries(
87
+ first: ProcessCrashRecoveryEntry,
88
+ second: ProcessCrashRecoveryEntry,
89
+ ): number {
90
+ return (
91
+ OUTCOME_ORDER[first.outcome] - OUTCOME_ORDER[second.outcome] ||
92
+ compareStrings(first.root, second.root) ||
93
+ compareStrings(first.name, second.name)
94
+ );
95
+ }
96
+
97
+ function compareStrings(first: string, second: string): number {
98
+ return first < second ? -1 : first > second ? 1 : 0;
99
+ }
100
+
101
+ function countRoutes(
102
+ routes: readonly ProcessCrashRecoveryRouteResult[],
103
+ outcome: ProcessCrashRecoveryOutcome,
104
+ ): number {
105
+ return routes.filter((route) => route.outcome === outcome).length;
106
+ }
@@ -17,8 +17,8 @@ import {
17
17
  type StaleDiagnosticAssessment,
18
18
  } from "../diagnostics/stale-diagnostics.ts";
19
19
  import {
20
- emptyProcessCrashRecoverySummary,
21
- type ProcessCrashRecoverySummary,
20
+ emptyProcessCrashRecoveryReport,
21
+ type ProcessCrashRecoveryReport,
22
22
  type WorkspaceDiagnosticReport,
23
23
  } from "../session/runtime-diagnostics.ts";
24
24
 
@@ -28,7 +28,7 @@ export interface WorkspaceRecoveryResult {
28
28
  /** Clients restarted by stale-diagnostic recovery, not process-crash recovery. */
29
29
  restartedClients: number;
30
30
  /** No process-crash demand is handled by this generic recovery pass. */
31
- processCrashRecovery: ProcessCrashRecoverySummary;
31
+ processCrashRecovery: ProcessCrashRecoveryReport;
32
32
  /** Server names of the active clients targeted by this pass, for telemetry identity. */
33
33
  attemptedServers: string[];
34
34
  /** Server names of the clients restarted during this pass, for telemetry identity. */
@@ -164,7 +164,7 @@ export async function recoverWorkspaceDiagnostics(
164
164
  return {
165
165
  attemptedClients,
166
166
  restartedClients,
167
- processCrashRecovery: emptyProcessCrashRecoverySummary(),
167
+ processCrashRecovery: emptyProcessCrashRecoveryReport(),
168
168
  attemptedServers,
169
169
  restartedServers: restartServerNames,
170
170
  ...(restartReason ? { restartReason } : {}),