@mrclrchtr/supi-code-intelligence 7.4.0 → 8.0.1

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 (74) hide show
  1. package/README.md +6 -6
  2. package/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
  3. package/node_modules/@mrclrchtr/supi-code-runtime/src/api.ts +1 -1
  4. package/node_modules/@mrclrchtr/supi-code-runtime/src/query-result.ts +22 -4
  5. package/node_modules/@mrclrchtr/supi-core/package.json +1 -1
  6. package/node_modules/@mrclrchtr/supi-core/src/config/config.ts +110 -0
  7. package/node_modules/@mrclrchtr/supi-core/src/config.ts +6 -1
  8. package/node_modules/@mrclrchtr/supi-core/src/settings/settings-schema.ts +2 -1
  9. package/node_modules/@mrclrchtr/supi-lsp/README.md +29 -6
  10. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
  11. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/api.ts +1 -1
  12. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/query-result.ts +22 -4
  13. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/package.json +1 -1
  14. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/config/config.ts +110 -0
  15. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/config.ts +6 -1
  16. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/settings/settings-schema.ts +2 -1
  17. package/node_modules/@mrclrchtr/supi-lsp/package.json +3 -3
  18. package/node_modules/@mrclrchtr/supi-lsp/src/api.ts +25 -3
  19. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-host.ts +2 -1
  20. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-refresh.ts +5 -2
  21. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostics.ts +39 -6
  22. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-document-sync.ts +82 -12
  23. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-semantic-input-barrier.ts +28 -5
  24. package/node_modules/@mrclrchtr/supi-lsp/src/client/client.ts +606 -30
  25. package/node_modules/@mrclrchtr/supi-lsp/src/config/capabilities.ts +9 -0
  26. package/node_modules/@mrclrchtr/supi-lsp/src/config/config.ts +69 -8
  27. package/node_modules/@mrclrchtr/supi-lsp/src/config/operation-support.ts +196 -0
  28. package/node_modules/@mrclrchtr/supi-lsp/src/config/server-config.ts +15 -0
  29. package/node_modules/@mrclrchtr/supi-lsp/src/config/types.ts +9 -1
  30. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-project-info.ts +2 -0
  31. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-workspace-symbol.ts +31 -2
  32. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager.ts +72 -2
  33. package/node_modules/@mrclrchtr/supi-lsp/src/provider/lsp-refactor-provider.ts +9 -43
  34. package/node_modules/@mrclrchtr/supi-lsp/src/provider/refactor-planning.ts +102 -50
  35. package/node_modules/@mrclrchtr/supi-lsp/src/provider/semantic-edit-normalizer.ts +49 -3
  36. package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-controller.ts +78 -18
  37. package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-registry.ts +46 -2
  38. package/node_modules/@mrclrchtr/supi-lsp/src/session/workspace-lsp-runtime.ts +14 -0
  39. package/node_modules/@mrclrchtr/supi-lsp/src/workspace-path-policy.ts +30 -4
  40. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
  41. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/api.ts +1 -1
  42. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/query-result.ts +22 -4
  43. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/package.json +1 -1
  44. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/config/config.ts +110 -0
  45. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/config.ts +6 -1
  46. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/settings/settings-schema.ts +2 -1
  47. package/node_modules/@mrclrchtr/supi-tree-sitter/package.json +3 -3
  48. package/package.json +5 -5
  49. package/src/analysis/capability/capability-warnings.ts +64 -25
  50. package/src/analysis/health/server-status.ts +23 -1
  51. package/src/analysis/health/signals.ts +1 -0
  52. package/src/analysis/search/ast-scan.ts +42 -8
  53. package/src/analysis/search/pattern.ts +4 -0
  54. package/src/config.ts +64 -34
  55. package/src/extension.ts +29 -10
  56. package/src/headless.ts +1 -0
  57. package/src/session/find-types.ts +2 -1
  58. package/src/session/find-workflow.ts +5 -0
  59. package/src/session/health-types.ts +3 -0
  60. package/src/session/health-workflow.ts +10 -1
  61. package/src/session/session.ts +34 -2
  62. package/src/substrate/lsp/lifecycle.ts +2 -0
  63. package/src/substrate/lsp/recovery.ts +3 -3
  64. package/src/substrate/lsp/settings.ts +191 -108
  65. package/src/substrate/workspace-provider-host.ts +50 -12
  66. package/src/tool/code_find/markdown.ts +12 -0
  67. package/src/tool/code_find/render.ts +20 -0
  68. package/src/tool/code_find/result.ts +3 -0
  69. package/src/tool/code_health/markdown.ts +3 -0
  70. package/src/tool/code_health/result.ts +3 -1
  71. package/src/tool/result/types.ts +3 -1
  72. package/src/ui/status-command.ts +54 -6
  73. package/src/ui/status-overlay.ts +5 -0
  74. package/node_modules/@mrclrchtr/supi-lsp/src/config/lsp-settings.ts +0 -22
package/README.md CHANGED
@@ -121,7 +121,7 @@ Operation support is narrower than grammar support. AST import and export search
121
121
  ### Search and output limits
122
122
 
123
123
  - An AST search has a 5,000 eligible-file limit and a 10-second deadline shared by file enumeration and analysis. These are not tool-call settings.
124
- - Below directory roots, AST search excludes hidden entries, dependency/build/cache directories, symlinks, non-regular files, and files unsupported by the requested operation. It does **not** read `.gitignore`. Explicit roots are resolved and honored, including symlink roots. See the [scan policy](src/analysis/search/ast-scan.ts) for the exact directory list.
124
+ - Below directory roots, AST search excludes hidden entries, dependency/build/cache directories, symlinks, non-regular files, configured `code-intelligence.exclude` paths, and files unsupported by the requested operation. It does **not** read `.gitignore`. Explicit roots are resolved and honored, including excluded paths and symlink roots. See the [scan policy](src/analysis/search/ast-scan.ts) for the exact directory list.
125
125
  - An exact file that does not support the requested AST operation is invalid. Results disclose policy exclusions, interrupted scans, provider limits, and omitted matches. No matches do not mean that unsupported files were searched.
126
126
  - Tool text is truncated at Pi's default 2,000 lines or 50 KB. When this occurs, the full text is written to a temporary file and its path is returned. Result-list limits still apply to that full text.
127
127
 
@@ -148,7 +148,7 @@ Project values override global values, which override defaults. Project configur
148
148
  |---|---|---|
149
149
  | `code-intelligence.overviewEnabled` | `true` | Add the hidden overview; the choice is fixed for the session |
150
150
  | `code-intelligence.instructionFileNames` | `["CLAUDE.md", "AGENTS.md"]` | Ordered plain filenames for directory instruction discovery |
151
- | `lsp.exclude` | `[]` | Gitignore-style patterns for automatic LSP work, not exact-file requests |
151
+ | `code-intelligence.exclude` | `[]` | Gitignore-style patterns for automatic LSP and broad AST work, not exact requests |
152
152
  | `lsp.servers.<language>.enabled` | Enabled unless `false` | Disable a language server |
153
153
 
154
154
  Example `.pi/supi/config.json`:
@@ -157,10 +157,10 @@ Example `.pi/supi/config.json`:
157
157
  {
158
158
  "code-intelligence": {
159
159
  "overviewEnabled": false,
160
- "instructionFileNames": ["AGENTS.md", "CLAUDE.md"]
160
+ "instructionFileNames": ["AGENTS.md", "CLAUDE.md"],
161
+ "exclude": ["generated/**"]
161
162
  },
162
163
  "lsp": {
163
- "exclude": ["generated/**"],
164
164
  "servers": {
165
165
  "python": { "enabled": false }
166
166
  }
@@ -168,13 +168,13 @@ Example `.pi/supi/config.json`:
168
168
  }
169
169
  ```
170
170
 
171
- Use `typescript`, `python`, `rust`, `go`, `c`, `ruby`, `java`, `kotlin`, `bash`, `html`, `sql`, or `r` for built-in server keys (`cpp` aliases `c`). Server command and routing overrides are defined in the [LSP configuration reference](../supi-lsp/README.md#custom-server-configuration). `.pi-lsp.json` is not read. Restart Pi after server configuration changes. Only the boolean `true` enables the overview; non-boolean values do not enable it.
171
+ Use `typescript`, `python`, `rust`, `go`, `c`, `ruby`, `java`, `kotlin`, `bash`, `html`, `sql`, or `r` for built-in server keys (`cpp` aliases `c`). Server command and routing overrides are defined in the [LSP configuration reference](../supi-lsp/README.md#custom-server-configuration). `.pi-lsp.json` is not read. Only the boolean `true` enables the overview; non-boolean values do not enable it. The shared exclusion list uses gitignore syntax and project-over-global replacement. An explicit project `[]` clears configured patterns. `/supi-settings` shows the config path and says to reload or restart Pi after saving. Saved exclusions apply after reload or restart; exact file and explicitly selected directory requests remain available. An old `lsp.exclude` value reports a migration error and is not used.
172
172
 
173
173
  Directory orientation checks the path from the workspace root to the focused directory. It selects the first valid configured instruction file per directory, skips files already loaded by Pi or shown on the active branch, and shows at most 200 lines per file. Resolved instruction paths must stay inside the workspace. These snippets are tool output, not additions to Pi's system prompt.
174
174
 
175
175
  ## Privacy and security
176
176
 
177
- Pi extensions run with your system permissions; this package is not a sandbox. Language servers run as local processes and receive source files. Review server commands and project configuration before trusting a project. `lsp.exclude` and AST scan exclusions are not access controls.
177
+ Pi extensions run with your system permissions; this package is not a sandbox. Language servers run as local processes and receive source files. Review server commands and project configuration before trusting a project. `code-intelligence.exclude` and AST scan exclusions are not access controls.
178
178
 
179
179
  Tool results and the hidden overview enter Pi's model context and can be saved in session history. They can contain source text, paths, manifest data, diagnostics, and instruction-file contents. Truncated tool results and graph display overflow also leave full returned text in local temporary files. These files are not durable session storage and can be removed by system cleanup. “Hidden” means not displayed in the transcript, not hidden from the model.
180
180
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrclrchtr/supi-code-runtime",
3
- "version": "7.4.0",
3
+ "version": "8.0.1",
4
4
  "description": "Shared workspace context and capability contracts for code intelligence",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -14,7 +14,7 @@ export type {
14
14
  StructuralProvider,
15
15
  StructuralResult,
16
16
  } from "./capability/types.ts";
17
- export type { CodeQueryResult } from "./query-result.ts";
17
+ export type { CodeQueryPartialMetadata, CodeQueryResult } from "./query-result.ts";
18
18
  // Shared query-result constructors and contract
19
19
  export {
20
20
  completedCodeQuery,
@@ -1,3 +1,12 @@
1
+ /** Structured metadata for a partial query result. */
2
+ export interface CodeQueryPartialMetadata {
3
+ /** Automatic path-policy evidence removed from a collected result. */
4
+ readonly automaticPathExclusion?: {
5
+ readonly excludedCount: number;
6
+ readonly examples: readonly string[];
7
+ };
8
+ }
9
+
1
10
  /**
2
11
  * Result of a read-only code-provider query.
3
12
  *
@@ -8,7 +17,12 @@
8
17
  */
9
18
  export type CodeQueryResult<T> =
10
19
  | { readonly kind: "completed"; readonly data: T }
11
- | { readonly kind: "partial"; readonly data: T; readonly reason: string }
20
+ | {
21
+ readonly kind: "partial";
22
+ readonly data: T;
23
+ readonly reason: string;
24
+ readonly metadata?: CodeQueryPartialMetadata;
25
+ }
12
26
  | { readonly kind: "unavailable"; readonly reason: string };
13
27
 
14
28
  /** Construct a successfully completed code-query result, including empty data. */
@@ -17,8 +31,12 @@ export function completedCodeQuery<T>(data: T): CodeQueryResult<T> {
17
31
  }
18
32
 
19
33
  /** Construct a usable but incomplete code-query result. */
20
- export function partialCodeQuery<T>(data: T, reason: string): CodeQueryResult<T> {
21
- return { kind: "partial", data, reason };
34
+ export function partialCodeQuery<T>(
35
+ data: T,
36
+ reason: string,
37
+ metadata?: CodeQueryPartialMetadata,
38
+ ): CodeQueryResult<T> {
39
+ return { kind: "partial", data, reason, ...(metadata ? { metadata } : {}) };
22
40
  }
23
41
 
24
42
  /** Construct a code-query result that could not be established. */
@@ -35,7 +53,7 @@ export function mapCodeQueryResult<T, U>(
35
53
  case "completed":
36
54
  return completedCodeQuery(map(result.data));
37
55
  case "partial":
38
- return partialCodeQuery(map(result.data), result.reason);
56
+ return partialCodeQuery(map(result.data), result.reason, result.metadata);
39
57
  case "unavailable":
40
58
  return unavailableCodeQuery(result.reason);
41
59
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrclrchtr/supi-core",
3
- "version": "7.4.0",
3
+ "version": "8.0.1",
4
4
  "description": "Shared settings, configuration, reporting, and session infrastructure",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -70,6 +70,116 @@ export interface SupiConfigOptions {
70
70
  homeDir?: string;
71
71
  }
72
72
 
73
+ /** Options for loading automatic code-intelligence exclusions. */
74
+ export interface AutomaticExclusionOptions extends SupiConfigOptions {
75
+ /** Whether the project config is trusted and can apply. Defaults to true. */
76
+ projectTrusted?: boolean;
77
+ }
78
+
79
+ /**
80
+ * Load the one configured exclusion list shared by automatic LSP work and
81
+ * broad AST searches.
82
+ *
83
+ * Project values replace global values. An explicit empty project list clears
84
+ * the global list. The old `lsp.exclude` key is rejected in every applicable
85
+ * scope so automatic work cannot start without its former protection.
86
+ */
87
+ export function loadAutomaticExclusionPatterns(
88
+ cwd: string,
89
+ options: AutomaticExclusionOptions = {},
90
+ ): readonly string[] {
91
+ const projectTrusted = options.projectTrusted !== false;
92
+ const globalCodeIntelligence = loadSupiConfigSectionForScope("code-intelligence", cwd, {
93
+ scope: "global",
94
+ homeDir: options.homeDir,
95
+ });
96
+ const projectCodeIntelligence = projectTrusted
97
+ ? loadSupiConfigSectionForScope("code-intelligence", cwd, { scope: "project" })
98
+ : null;
99
+ const globalLsp = loadSupiConfigSectionForScope("lsp", cwd, {
100
+ scope: "global",
101
+ homeDir: options.homeDir,
102
+ });
103
+ const projectLsp = projectTrusted
104
+ ? loadSupiConfigSectionForScope("lsp", cwd, { scope: "project" })
105
+ : null;
106
+
107
+ const legacyPath = findLegacyExclusionPath(cwd, options, globalLsp, projectLsp);
108
+ if (legacyPath) {
109
+ throw new Error(
110
+ `Unsupported ${legacyPath.scope} configuration at ${legacyPath.path}: "lsp.exclude" was removed. Move its value to "code-intelligence.exclude". Automatic LSP and broad AST work did not start; reload after migration.`,
111
+ );
112
+ }
113
+
114
+ const source = findExclusionSource(cwd, options, {
115
+ projectTrusted,
116
+ globalCodeIntelligence,
117
+ projectCodeIntelligence,
118
+ });
119
+ return validateExclusionSource(source);
120
+ }
121
+
122
+ interface ExclusionSource {
123
+ value: unknown;
124
+ path: string;
125
+ }
126
+
127
+ interface LegacyExclusionPath {
128
+ scope: "global" | "project";
129
+ path: string;
130
+ }
131
+
132
+ function findLegacyExclusionPath(
133
+ cwd: string,
134
+ options: AutomaticExclusionOptions,
135
+ globalLsp: Record<string, unknown> | null,
136
+ projectLsp: Record<string, unknown> | null,
137
+ ): LegacyExclusionPath | null {
138
+ if (globalLsp && Object.hasOwn(globalLsp, "exclude")) {
139
+ return { scope: "global", path: getSupiConfigPath("global", cwd, options) };
140
+ }
141
+ if (projectLsp && Object.hasOwn(projectLsp, "exclude")) {
142
+ return { scope: "project", path: getSupiConfigPath("project", cwd) };
143
+ }
144
+ return null;
145
+ }
146
+
147
+ function findExclusionSource(
148
+ cwd: string,
149
+ options: AutomaticExclusionOptions,
150
+ sections: {
151
+ projectTrusted: boolean;
152
+ globalCodeIntelligence: Record<string, unknown> | null;
153
+ projectCodeIntelligence: Record<string, unknown> | null;
154
+ },
155
+ ): ExclusionSource | null {
156
+ const { projectTrusted, globalCodeIntelligence, projectCodeIntelligence } = sections;
157
+ if (
158
+ projectTrusted &&
159
+ projectCodeIntelligence &&
160
+ Object.hasOwn(projectCodeIntelligence, "exclude")
161
+ ) {
162
+ return { value: projectCodeIntelligence.exclude, path: getSupiConfigPath("project", cwd) };
163
+ }
164
+ if (globalCodeIntelligence && Object.hasOwn(globalCodeIntelligence, "exclude")) {
165
+ return {
166
+ value: globalCodeIntelligence.exclude,
167
+ path: getSupiConfigPath("global", cwd, options),
168
+ };
169
+ }
170
+ return null;
171
+ }
172
+
173
+ function validateExclusionSource(source: ExclusionSource | null): readonly string[] {
174
+ if (!source) return Object.freeze([]);
175
+ if (!Array.isArray(source.value) || !source.value.every((entry) => typeof entry === "string")) {
176
+ throw new Error(
177
+ `Invalid "code-intelligence.exclude" in ${source.path}: expected an array of gitignore-style strings. Automatic LSP and broad AST work did not start.`,
178
+ );
179
+ }
180
+ return Object.freeze([...source.value]);
181
+ }
182
+
73
183
  /**
74
184
  * Load and merge config for a given extension section.
75
185
  *
@@ -1,7 +1,12 @@
1
1
  // supi-core config domain — config loading.
2
- export type { SupiConfigLocation, SupiConfigOptions } from "./config/config.ts";
2
+ export type {
3
+ AutomaticExclusionOptions,
4
+ SupiConfigLocation,
5
+ SupiConfigOptions,
6
+ } from "./config/config.ts";
3
7
  export {
4
8
  getSupiConfigPath,
9
+ loadAutomaticExclusionPatterns,
5
10
  loadSupiConfig,
6
11
  loadSupiConfigForScope,
7
12
  loadSupiConfigSectionForScope,
@@ -151,6 +151,7 @@ export interface CustomField extends BaseField {
151
151
  cwd: string,
152
152
  action: SettingsAction,
153
153
  helpers: ConfigHelpers,
154
+ ctx?: ExtensionContext,
154
155
  ) => void | Promise<void>;
155
156
  }
156
157
 
@@ -404,7 +405,7 @@ async function applyConfigAction(
404
405
  const helpers = createConfigHelpers(options.section, scope, cwd, options.homeDir);
405
406
  let storedValue: unknown;
406
407
  if (field.kind === "custom") {
407
- await field.persist(scope, cwd, action, helpers);
408
+ await field.persist(scope, cwd, action, helpers, ctx);
408
409
  storedValue = action.kind === "set" ? action.value : undefined;
409
410
  } else if (action.kind === "set") {
410
411
  storedValue = parseTypedValue(action.value, field);
@@ -46,7 +46,7 @@ SuPi advertises static and dynamic pull support. It advertises server-requested
46
46
 
47
47
  A server gets pull diagnostics when it declares a valid `diagnosticProvider` during initialization. A server also gets pull diagnostics after it registers `textDocument/diagnostic`. The pull support stays active until the server removes the registration. SuPi validates registration parameters. Invalid parameters do not enable pull support. SuPi ignores other registration methods.
48
48
 
49
- When a server sends `workspace/diagnostic/refresh`, SuPi returns `null` immediately. It then invalidates diagnostic evidence only and refreshes the owning client's tracked documents in the background. Unchanged open documents keep their input synchronization; SuPi sends no no-op `didChange`, `didClose`, or `didOpen`. It uses native pull or the tested TypeScript request adapter when available. Push-only routes keep partial or unconfirmed evidence. Actual disk changes use the normal document synchronization path. Overlapping refresh requests share one active pass and one newer pending demand; an active diagnostic transport stays owned until it settles. The refresh covers open, cached, and failed tracked documents. SuPi does not add workspace-wide `workspace/diagnostic` pulls.
49
+ When a server sends `workspace/diagnostic/refresh`, SuPi returns `null` immediately. It then invalidates diagnostic evidence only and refreshes the owning client's tracked documents in the background. Unchanged open documents keep their input synchronization; SuPi sends no no-op `didChange`, `didClose`, or `didOpen`. It uses native pull or the tested TypeScript request adapter when available. Push-only routes keep partial or unconfirmed evidence. Actual disk changes use the normal document synchronization path, followed by one `didSave` when the server requested saves; repeated observations of the same content send no duplicate save. Overlapping refresh requests share one active pass and one newer pending demand; an active diagnostic transport stays owned until it settles. The refresh covers open, cached, and failed tracked documents. SuPi does not add workspace-wide `workspace/diagnostic` pulls.
50
50
 
51
51
  Protocol support is separate from the configured mode. A server may support pull diagnostics and still use SuPi's push mode because the built-in configuration does not enable pull mode.
52
52
 
@@ -108,25 +108,27 @@ Gopls pull diagnostics stay opt-in while golang/go#70199 is open; without the op
108
108
 
109
109
  Automatic LSP work uses one path policy that does not change for each workspace runtime. It covers project discovery, route startup, warm-up, sentinel and source-file lists, created-file tracking, runtime guidance, and diagnostic summaries not tied to one request.
110
110
 
111
- The policy excludes these directories by default: `.git`, `.cache`, `.pi`, `.pnpm`, `node_modules`, `dist`, `build`, `out`, `coverage`, `.next`, `.nuxt`, `.turbo`, and `__pycache__`. It also applies `lsp.exclude` patterns and root or nested `.gitignore` rules. Patterns use gitignore syntax, including rules relative to each directory and `!` rules. Built-in exclusions cannot be enabled again. Symbolic-link directories are not visited. Other dot-directories, such as `.github` and `.storybook`, remain allowed.
111
+ The policy excludes these directories by default: `.git`, `.cache`, `.pi`, `.pnpm`, `node_modules`, `dist`, `build`, `out`, `coverage`, `.next`, `.nuxt`, `.turbo`, and `__pycache__`. It also applies `code-intelligence.exclude` patterns and root or nested `.gitignore` rules. Patterns use gitignore syntax, including rules relative to each directory and `!` rules. Built-in exclusions cannot be enabled again. Symbolic-link directories are not visited. Other dot-directories, such as `.github` and `.storybook`, remain allowed.
112
112
 
113
- Set `lsp.exclude` in project or global SuPi configuration:
113
+ Set `code-intelligence.exclude` in project or global SuPi configuration. A project list replaces the global list; `[]` clears configured patterns. Use `/supi-settings` to edit this shared list when the settings extension is installed. Reload or restart Pi after saving:
114
114
 
115
115
  ```json
116
116
  {
117
- "lsp": {
117
+ "code-intelligence": {
118
118
  "exclude": ["generated/**", "!generated/keep.ts"]
119
119
  }
120
120
  }
121
121
  ```
122
122
 
123
+ An old `lsp.exclude` value is a migration error. Move it to `code-intelligence.exclude`; SuPi does not edit personal configuration for you.
124
+
123
125
  An exact semantic request can still route an excluded file when a compatible server is available. This does not add the file to automatic work. Configured diagnostic suppression still applies to diagnostic output.
124
126
 
125
127
  Tsconfig and jsconfig filtering applies only to TypeScript and JavaScript-family files (`.ts`, `.tsx`, `.mts`, `.cts`, `.js`, `.jsx`, `.mjs`, and `.cjs`). Other-language diagnostics are not filtered by a nearby TypeScript or JavaScript project config. Automatic path exclusions and configured diagnostic suppression still apply. A single-file health result omits the `Tsconfig` coverage line for other languages.
126
128
 
127
129
  ### Custom server configuration
128
130
 
129
- A custom server needs a command and at least one file type:
131
+ A custom server needs a command and at least one file type. Advanced server settings are JSON objects. They replace inherited settings as a whole; `initializationOptions` remains a separate initialize value:
130
132
 
131
133
  ```json
132
134
  {
@@ -137,6 +139,7 @@ A custom server needs a command and at least one file type:
137
139
  "args": ["--stdio"],
138
140
  "fileTypes": ["custom"],
139
141
  "env": { "CUSTOM_LSP_LOG": "debug" },
142
+ "settings": { "custom": { "mode": "project" } },
140
143
  "initializationOptions": { "mode": "project" }
141
144
  }
142
145
  }
@@ -144,6 +147,14 @@ A custom server needs a command and at least one file type:
144
147
  }
145
148
  ```
146
149
 
150
+ Server settings use one snapshot for the active workspace runtime:
151
+
152
+ - An omitted `settings` field inherits the earlier object. `settings: {}` clears inherited settings.
153
+ - `workspace/configuration` reads that snapshot. A request without a section receives the complete object; an unknown section receives `null`.
154
+ - A configured snapshot is also sent through `workspace/didChangeConfiguration` after initialization.
155
+ - SuPi validates the JSON object shape, not server-specific setting names or values.
156
+ - Saved changes apply after reload or restart. A saved value does not prove that the server accepted it.
157
+
147
158
  File types do not include a leading dot. If `rootMarkers` is omitted, the server uses the session root.
148
159
 
149
160
  Disable one language with `lsp.servers.<language>.enabled: false`. Use `/supi-ci-status` from `@mrclrchtr/supi-code-intelligence` to see detected, running, and missing servers.
@@ -155,6 +166,18 @@ Disable one language with `lsp.servers.<language>.enabled: false`. Use `/supi-ci
155
166
  - explicit ready, pending, inactive, disabled, and unavailable registry states
156
167
  - a `SemanticProvider` adapter for `supi-code-runtime`
157
168
  - precise rename and code-action edit conversion
169
+ - operation-specific code-action kind filters and standard lazy edit resolution
170
+ - negotiated operation support in project-server status
171
+
172
+ Operation-specific planners request `source.organizeImports` for import updates and
173
+ `source.removeUnused` for dead-code removal. They match the returned `CodeAction.kind`,
174
+ not its title. Edit-only actions are validated before planning. Command actions,
175
+ resource operations, snippets, annotations, malformed actions, and stale responses
176
+ stay unavailable. Distinct matching plans return an ambiguous result instead of
177
+ selecting the first action. Rename uses `prepareRename` when the server advertises
178
+ it and otherwise uses direct standard rename. Standard LSP does not provide
179
+ a safe exact extraction-name contract, so `extract_function` and `extract_variable`
180
+ plans report a SuPi planning limitation instead of selecting a generated name.
158
181
 
159
182
  Clients, `LspManager`, and the default runtime implementation remain internal.
160
183
 
@@ -164,7 +187,7 @@ Clients, `LspManager`, and the default runtime implementation remain internal.
164
187
 
165
188
  - language-server detection and startup
166
189
  - shutdown
167
- - settings and missing-server inventory
190
+ - server configuration and missing-server inventory
168
191
  - publishing workspace runtime state and aggregate lifecycle transitions
169
192
  - projecting concrete client readiness into semantic capability state
170
193
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrclrchtr/supi-code-runtime",
3
- "version": "7.4.0",
3
+ "version": "8.0.1",
4
4
  "description": "Shared workspace context and capability contracts for code intelligence",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -14,7 +14,7 @@ export type {
14
14
  StructuralProvider,
15
15
  StructuralResult,
16
16
  } from "./capability/types.ts";
17
- export type { CodeQueryResult } from "./query-result.ts";
17
+ export type { CodeQueryPartialMetadata, CodeQueryResult } from "./query-result.ts";
18
18
  // Shared query-result constructors and contract
19
19
  export {
20
20
  completedCodeQuery,
@@ -1,3 +1,12 @@
1
+ /** Structured metadata for a partial query result. */
2
+ export interface CodeQueryPartialMetadata {
3
+ /** Automatic path-policy evidence removed from a collected result. */
4
+ readonly automaticPathExclusion?: {
5
+ readonly excludedCount: number;
6
+ readonly examples: readonly string[];
7
+ };
8
+ }
9
+
1
10
  /**
2
11
  * Result of a read-only code-provider query.
3
12
  *
@@ -8,7 +17,12 @@
8
17
  */
9
18
  export type CodeQueryResult<T> =
10
19
  | { readonly kind: "completed"; readonly data: T }
11
- | { readonly kind: "partial"; readonly data: T; readonly reason: string }
20
+ | {
21
+ readonly kind: "partial";
22
+ readonly data: T;
23
+ readonly reason: string;
24
+ readonly metadata?: CodeQueryPartialMetadata;
25
+ }
12
26
  | { readonly kind: "unavailable"; readonly reason: string };
13
27
 
14
28
  /** Construct a successfully completed code-query result, including empty data. */
@@ -17,8 +31,12 @@ export function completedCodeQuery<T>(data: T): CodeQueryResult<T> {
17
31
  }
18
32
 
19
33
  /** Construct a usable but incomplete code-query result. */
20
- export function partialCodeQuery<T>(data: T, reason: string): CodeQueryResult<T> {
21
- return { kind: "partial", data, reason };
34
+ export function partialCodeQuery<T>(
35
+ data: T,
36
+ reason: string,
37
+ metadata?: CodeQueryPartialMetadata,
38
+ ): CodeQueryResult<T> {
39
+ return { kind: "partial", data, reason, ...(metadata ? { metadata } : {}) };
22
40
  }
23
41
 
24
42
  /** Construct a code-query result that could not be established. */
@@ -35,7 +53,7 @@ export function mapCodeQueryResult<T, U>(
35
53
  case "completed":
36
54
  return completedCodeQuery(map(result.data));
37
55
  case "partial":
38
- return partialCodeQuery(map(result.data), result.reason);
56
+ return partialCodeQuery(map(result.data), result.reason, result.metadata);
39
57
  case "unavailable":
40
58
  return unavailableCodeQuery(result.reason);
41
59
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrclrchtr/supi-core",
3
- "version": "7.4.0",
3
+ "version": "8.0.1",
4
4
  "description": "Shared settings, configuration, reporting, and session infrastructure",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -70,6 +70,116 @@ export interface SupiConfigOptions {
70
70
  homeDir?: string;
71
71
  }
72
72
 
73
+ /** Options for loading automatic code-intelligence exclusions. */
74
+ export interface AutomaticExclusionOptions extends SupiConfigOptions {
75
+ /** Whether the project config is trusted and can apply. Defaults to true. */
76
+ projectTrusted?: boolean;
77
+ }
78
+
79
+ /**
80
+ * Load the one configured exclusion list shared by automatic LSP work and
81
+ * broad AST searches.
82
+ *
83
+ * Project values replace global values. An explicit empty project list clears
84
+ * the global list. The old `lsp.exclude` key is rejected in every applicable
85
+ * scope so automatic work cannot start without its former protection.
86
+ */
87
+ export function loadAutomaticExclusionPatterns(
88
+ cwd: string,
89
+ options: AutomaticExclusionOptions = {},
90
+ ): readonly string[] {
91
+ const projectTrusted = options.projectTrusted !== false;
92
+ const globalCodeIntelligence = loadSupiConfigSectionForScope("code-intelligence", cwd, {
93
+ scope: "global",
94
+ homeDir: options.homeDir,
95
+ });
96
+ const projectCodeIntelligence = projectTrusted
97
+ ? loadSupiConfigSectionForScope("code-intelligence", cwd, { scope: "project" })
98
+ : null;
99
+ const globalLsp = loadSupiConfigSectionForScope("lsp", cwd, {
100
+ scope: "global",
101
+ homeDir: options.homeDir,
102
+ });
103
+ const projectLsp = projectTrusted
104
+ ? loadSupiConfigSectionForScope("lsp", cwd, { scope: "project" })
105
+ : null;
106
+
107
+ const legacyPath = findLegacyExclusionPath(cwd, options, globalLsp, projectLsp);
108
+ if (legacyPath) {
109
+ throw new Error(
110
+ `Unsupported ${legacyPath.scope} configuration at ${legacyPath.path}: "lsp.exclude" was removed. Move its value to "code-intelligence.exclude". Automatic LSP and broad AST work did not start; reload after migration.`,
111
+ );
112
+ }
113
+
114
+ const source = findExclusionSource(cwd, options, {
115
+ projectTrusted,
116
+ globalCodeIntelligence,
117
+ projectCodeIntelligence,
118
+ });
119
+ return validateExclusionSource(source);
120
+ }
121
+
122
+ interface ExclusionSource {
123
+ value: unknown;
124
+ path: string;
125
+ }
126
+
127
+ interface LegacyExclusionPath {
128
+ scope: "global" | "project";
129
+ path: string;
130
+ }
131
+
132
+ function findLegacyExclusionPath(
133
+ cwd: string,
134
+ options: AutomaticExclusionOptions,
135
+ globalLsp: Record<string, unknown> | null,
136
+ projectLsp: Record<string, unknown> | null,
137
+ ): LegacyExclusionPath | null {
138
+ if (globalLsp && Object.hasOwn(globalLsp, "exclude")) {
139
+ return { scope: "global", path: getSupiConfigPath("global", cwd, options) };
140
+ }
141
+ if (projectLsp && Object.hasOwn(projectLsp, "exclude")) {
142
+ return { scope: "project", path: getSupiConfigPath("project", cwd) };
143
+ }
144
+ return null;
145
+ }
146
+
147
+ function findExclusionSource(
148
+ cwd: string,
149
+ options: AutomaticExclusionOptions,
150
+ sections: {
151
+ projectTrusted: boolean;
152
+ globalCodeIntelligence: Record<string, unknown> | null;
153
+ projectCodeIntelligence: Record<string, unknown> | null;
154
+ },
155
+ ): ExclusionSource | null {
156
+ const { projectTrusted, globalCodeIntelligence, projectCodeIntelligence } = sections;
157
+ if (
158
+ projectTrusted &&
159
+ projectCodeIntelligence &&
160
+ Object.hasOwn(projectCodeIntelligence, "exclude")
161
+ ) {
162
+ return { value: projectCodeIntelligence.exclude, path: getSupiConfigPath("project", cwd) };
163
+ }
164
+ if (globalCodeIntelligence && Object.hasOwn(globalCodeIntelligence, "exclude")) {
165
+ return {
166
+ value: globalCodeIntelligence.exclude,
167
+ path: getSupiConfigPath("global", cwd, options),
168
+ };
169
+ }
170
+ return null;
171
+ }
172
+
173
+ function validateExclusionSource(source: ExclusionSource | null): readonly string[] {
174
+ if (!source) return Object.freeze([]);
175
+ if (!Array.isArray(source.value) || !source.value.every((entry) => typeof entry === "string")) {
176
+ throw new Error(
177
+ `Invalid "code-intelligence.exclude" in ${source.path}: expected an array of gitignore-style strings. Automatic LSP and broad AST work did not start.`,
178
+ );
179
+ }
180
+ return Object.freeze([...source.value]);
181
+ }
182
+
73
183
  /**
74
184
  * Load and merge config for a given extension section.
75
185
  *
@@ -1,7 +1,12 @@
1
1
  // supi-core config domain — config loading.
2
- export type { SupiConfigLocation, SupiConfigOptions } from "./config/config.ts";
2
+ export type {
3
+ AutomaticExclusionOptions,
4
+ SupiConfigLocation,
5
+ SupiConfigOptions,
6
+ } from "./config/config.ts";
3
7
  export {
4
8
  getSupiConfigPath,
9
+ loadAutomaticExclusionPatterns,
5
10
  loadSupiConfig,
6
11
  loadSupiConfigForScope,
7
12
  loadSupiConfigSectionForScope,
@@ -151,6 +151,7 @@ export interface CustomField extends BaseField {
151
151
  cwd: string,
152
152
  action: SettingsAction,
153
153
  helpers: ConfigHelpers,
154
+ ctx?: ExtensionContext,
154
155
  ) => void | Promise<void>;
155
156
  }
156
157
 
@@ -404,7 +405,7 @@ async function applyConfigAction(
404
405
  const helpers = createConfigHelpers(options.section, scope, cwd, options.homeDir);
405
406
  let storedValue: unknown;
406
407
  if (field.kind === "custom") {
407
- await field.persist(scope, cwd, action, helpers);
408
+ await field.persist(scope, cwd, action, helpers, ctx);
408
409
  storedValue = action.kind === "set" ? action.value : undefined;
409
410
  } else if (action.kind === "set") {
410
411
  storedValue = parseTypedValue(action.value, field);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrclrchtr/supi-lsp",
3
- "version": "7.4.0",
3
+ "version": "8.0.1",
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-core": "7.4.0",
41
- "@mrclrchtr/supi-code-runtime": "7.4.0"
40
+ "@mrclrchtr/supi-code-runtime": "8.0.1",
41
+ "@mrclrchtr/supi-core": "8.0.1"
42
42
  },
43
43
  "bundledDependencies": [
44
44
  "@mrclrchtr/supi-code-runtime",