@mrclrchtr/supi-code-intelligence 11.2.0 → 11.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.
- package/CHANGELOG.md +19 -0
- package/README.md +16 -6
- package/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-code-runtime/src/capability/types.ts +3 -1
- package/node_modules/@mrclrchtr/supi-code-runtime/src/query-result.ts +9 -0
- package/node_modules/@mrclrchtr/supi-core/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-core/src/child-web-tools.ts +110 -0
- package/node_modules/@mrclrchtr/supi-core/src/session.ts +11 -0
- package/node_modules/@mrclrchtr/supi-lsp/README.md +39 -2
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/capability/types.ts +3 -1
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/query-result.ts +9 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/child-web-tools.ts +110 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/session.ts +11 -0
- package/node_modules/@mrclrchtr/supi-lsp/package.json +3 -3
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-collection.ts +11 -4
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostics.ts +77 -6
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-input-admission.ts +149 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-typescript-project.ts +40 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client.ts +151 -44
- package/node_modules/@mrclrchtr/supi-lsp/src/diagnostics/evidence.ts +2 -2
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-workspace-symbol.ts +157 -23
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager.ts +254 -56
- package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-registry.ts +19 -2
- package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-rename.ts +1 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/session/workspace-lsp-runtime.ts +5 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/README.md +2 -2
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/capability/types.ts +3 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/query-result.ts +9 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/child-web-tools.ts +110 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/session.ts +11 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/package.json +3 -3
- package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/tsx/tree-sitter-tsx.wasm +0 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/tsx/tree-sitter-tsx.wasm.json +5 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/typescript/tree-sitter-typescript.wasm +0 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/typescript/tree-sitter-typescript.wasm.json +5 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/call-sites.ts +40 -25
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/callees.ts +2 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/worker/call-context.ts +44 -0
- package/package.json +6 -5
- package/src/analysis/health/server-status.ts +6 -2
- package/src/analysis/search/exclusions.ts +47 -0
- package/src/analysis/search/paths.ts +32 -9
- package/src/analysis/target/anchored-structural.ts +3 -8
- package/src/analysis/target/anchored.ts +4 -20
- package/src/analysis/target/identity.ts +1 -1
- package/src/analysis/target/latex-label-container.ts +6 -6
- package/src/analysis/target/latex-section-anchor.ts +6 -6
- package/src/analysis/target/resolution.ts +18 -0
- package/src/analysis/target/symbol.ts +39 -11
- package/src/analysis/target/types.ts +6 -1
- package/src/extension.ts +17 -11
- package/src/session/graph/collect.ts +1 -10
- package/src/session/graph-types.ts +2 -0
- package/src/session/graph-workflow.ts +1 -0
- package/src/session/inspect/collect.ts +8 -2
- package/src/session/inspect/file-point.ts +2 -3
- package/src/session/inspect-workflow.ts +1 -1
- package/src/session/orientation/collect.ts +54 -16
- package/src/session/orientation/context-sections.ts +2 -3
- package/src/session/orientation/facts.ts +9 -1
- package/src/session/orientation-types.ts +3 -0
- package/src/session/orientation-workflow.ts +18 -5
- package/src/session/refactor-identity.ts +76 -0
- package/src/session/refactor-workflow.ts +11 -14
- package/src/session/target-store.ts +3 -18
- package/src/session/target-workflow.ts +33 -16
- package/src/substrate/lsp/recovery.ts +5 -5
- package/src/tool/code_find/render.ts +8 -4
- package/src/tool/code_find/result.ts +78 -6
- package/src/tool/code_find/spec.ts +4 -3
- package/src/tool/code_find/structured.ts +25 -9
- package/src/tool/code_graph/details.ts +1 -0
- package/src/tool/code_graph/display.ts +1 -1
- package/src/tool/code_graph/guidance.ts +1 -1
- package/src/tool/code_graph/markdown.ts +11 -6
- package/src/tool/code_graph/read-next.ts +38 -9
- package/src/tool/code_graph/reference-selection.ts +30 -0
- package/src/tool/code_graph/result.ts +25 -118
- package/src/tool/code_graph/section.ts +133 -0
- package/src/tool/code_graph/spec.ts +3 -3
- package/src/tool/code_graph/structured.ts +17 -6
- package/src/tool/code_health/display-paths.ts +92 -0
- package/src/tool/code_health/file-scope-markdown.ts +3 -2
- package/src/tool/code_health/result.ts +4 -2
- package/src/tool/code_health/spec.ts +3 -3
- package/src/tool/code_health/structured-schema.ts +44 -44
- package/src/tool/code_inspect/spec.ts +5 -1
- package/src/tool/code_inspect/structured.ts +1 -2
- package/src/tool/code_orientation/execute.ts +1 -1
- package/src/tool/code_orientation/result.ts +22 -5
- package/src/tool/code_orientation/structured-schema.ts +46 -36
- package/src/tool/code_orientation/structured-workspace.ts +2 -1
- package/src/tool/code_orientation/structured.ts +6 -12
- package/src/tool/code_orientation/workspace-format.ts +2 -5
- package/src/tool/code_orientation/workspace-sections.ts +3 -2
- package/src/tool/code_refactor_apply/result.ts +1 -1
- package/src/tool/code_refactor_plan/result.ts +2 -1
- package/src/tool/code_refactor_plan/structured.ts +2 -3
- package/src/tool/code_resolve/markdown.ts +6 -30
- package/src/tool/code_resolve/result.ts +24 -11
- package/src/tool/code_resolve/structured.ts +7 -9
- package/src/tool/result/refactor.ts +8 -5
- package/src/tool/result/structured.ts +8 -5
- package/src/tool/result/types.ts +18 -14
- package/src/tool/schemas.ts +5 -5
- package/src/ui/status-command.ts +37 -1
- package/src/ui/status-overlay.ts +70 -51
- package/src/ui/status-presentation.ts +108 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [11.3.0]
|
|
4
|
+
|
|
5
|
+
- Added package-specific release notes for code navigation, diagnostics, and refactoring.
|
|
6
|
+
- Capped `code_graph` reference results distribute sites across files, with matching source-reading suggestions.
|
|
7
|
+
- Fixed transient navigation failures when parallel requests first access different files, while retaining freshness checks.
|
|
8
|
+
- Rename and code-action planning now coordinate concurrent first file accesses without blocking parallel reads or weakening edit freshness checks.
|
|
9
|
+
- Scoped symbol queries no longer become incomplete solely because generated results were excluded outside the requested scope; ambiguous or genuinely incomplete evidence still requires explicit selection.
|
|
10
|
+
- Symbol queries scoped to an explicitly selected generated file or directory no longer report a false "Symbol not found" before the server has loaded that scope.
|
|
11
|
+
- Semantic symbol search with the TypeScript 6 or earlier server (tsserver) no longer reports existing symbols as missing at session start when a root config file, such as a dotfile excluded by `tsconfig.json`, sorts first; `code_find` and symbol targets now find them without opening a file first, and report an incomplete search instead of "not found" when no project file could be loaded.
|
|
12
|
+
- Symbol targets no longer require choosing from a single candidate when the only gap is an automatically excluded generated copy, such as a `dist/*.d.ts` declaration; the target resolves and notes the excluded path. Route failures and coverage gaps still require explicit selection. `code_graph` shows the same target notes, and semantic `code_find` reports an exact count and a null `partialReason` for such results while still disclosing the excluded paths in `automaticPathExclusion`.
|
|
13
|
+
- When a language server exits during startup, `code_health` and the status overlay now show the server's own error output instead of a transport error such as `write EPIPE` ([#570](https://github.com/mrclrchtr/supi/issues/570)).
|
|
14
|
+
- The status inspector adds **Refresh health** (`h` or F6), which runs the same bounded recovery and diagnostic refresh as `code_health({ refresh: true })` and reports its outcome separately from diagnostic confirmation ([#371](https://github.com/mrclrchtr/supi/issues/371)). Expanded file details now use only that file's diagnostic evidence, and a clean summary requires every requested tracked file to be confirmed.
|
|
15
|
+
- Health output distinguishes files without a compatible configured language server from configured servers that fail to start, and keeps a startup failure's explanation on later requests without retrying the server. Ownership roots outside the workspace are shown as absolute paths.
|
|
16
|
+
- An exact-file `code_health` refresh no longer rejects healthy routes for files outside the workspace or in automatically excluded paths.
|
|
17
|
+
- `code_graph` relations stay complete when only the display cap hides rows, and source paths use one canonical form across all code tools.
|
|
18
|
+
- `code_graph` callees and calls no longer report type-only `import("...")` references as calls, and TypeScript import types inside generic call arguments now parse correctly.
|
|
19
|
+
- `code_refactor_plan` omits edits that would leave text unchanged; a refactor with no real changes, such as renaming a symbol to its current name, no longer produces an applicable plan.
|
package/README.md
CHANGED
|
@@ -77,11 +77,11 @@ code_health({ scope: "packages/api/src/index.ts", refresh: true })
|
|
|
77
77
|
Important tool rules:
|
|
78
78
|
|
|
79
79
|
- **Resolve:** new target handles require semantic readiness. A comment or whitespace point is not a symbol; use `code_inspect` there. Handles are session-local and become stale when file contents change. Resolve the symbol again rather than reuse a stale handle. Symbol queries put case-sensitive exact-name matches first, before the display cap. Provider order stays unchanged within exact-name and other matches. An incomplete provider result never selects a target automatically.
|
|
80
|
-
- **Graph:** relations are `references` (default), `callees`, and `implements`. Use `["all"]` for all three. Callee depth is `direct` by default; `deep` includes nested scopes, not transitive calls. Callees match source shape, not symbol identity. Counts include each distinct call site; repeated expressions share one agent-output row with all shown line/column coordinates. Each relation reports its counts and limits once. Provider-limited results have unknown totals; invalid locations are disclosed separately. Callee previews shorten receiver argument lists from syntax without changing grouping by the full expression. Matching previews get local expression numbers so distinct source expressions remain clear. Unavailable references and implementations keep the provider reason. If no provider exists, the result names that gap. Unavailable callees keep the provider reason and a source-inspection next step. Ambiguous targets ask for candidate selection, not input correction. Candidate limits retain exact totals, or unknown totals when the provider returns partial data. Agent output and both transcript views disclose omissions. Only shown candidates receive target handles. The human transcript shows the resolved target and per-relation evidence types and status. The expanded view groups up to 20 sites per relation by file, without a duplicate Markdown body. If this display limit hides returned sites, the transcript links to a temporary file with all returned evidence. This file does not include evidence beyond `maxResults`, and its path does not add text to an otherwise complete agent result. Merged read ranges use neutral guidance.
|
|
80
|
+
- **Graph:** relations are `references` (default), `callees`, and `implements`. Use `["all"]` for all three. Callee depth is `direct` by default; `deep` includes nested scopes, not transitive calls. Callees match source shape, not symbol identity. Counts include each distinct call site; repeated expressions share one agent-output row with all shown line/column coordinates. Each relation reports its counts and limits once. Relation status describes evidence collection, not display size: a fully collected relation remains `complete` when `maxResults` hides sites; `shownCount`, `totalCount`, and `omittedCount` disclose that cap. Actual evidence gaps remain `partial`, and unavailable capabilities remain `unavailable`. Capped references select one site per file per round in stable file/source order, then display the selected sites grouped by file; `maxResults` still counts individual references, not files. This distributes the available slots without ranking semantic importance or promising that every file is represented. Provider-limited results have unknown totals; invalid locations are disclosed separately. Callee previews shorten receiver argument lists from syntax without changing grouping by the full expression. Matching previews get local expression numbers so distinct source expressions remain clear. Unavailable references and implementations keep the provider reason. If no provider exists, the result names that gap. Unavailable callees keep the provider reason and a source-inspection next step. Ambiguous targets ask for candidate selection, not input correction. Candidate limits retain exact totals, or unknown totals when the provider returns partial data. Agent output and both transcript views disclose omissions. Only shown candidates receive target handles. The human transcript shows the resolved target and per-relation evidence types and status. The expanded view groups up to 20 sites per relation by file, without a duplicate Markdown body. If this display limit hides returned sites, the transcript links to a temporary file with all returned evidence. This file does not include evidence beyond `maxResults`, and its path does not add text to an otherwise complete agent result. Reference read-next suggestions use selected sites and prefer different files not already covered by the target recommendation. Merged read ranges use neutral guidance.
|
|
81
81
|
- **Find:** AST mode requires `kind`: `definition`, `import`, `export`, `call`, `type`, `interface`, `class`, `method`, or `enum`. Semantic mode does not accept `kind`. A supplied `scope` is a non-empty array.
|
|
82
82
|
- **Health:** `include` accepts `diagnostics` and `servers` (both by default); `level` is `summary` (default) or `detailed`. Server inventory and route counts remain workspace-wide, even with a diagnostic scope. A diagnostic snapshot does not prove that the whole workspace is clean. Tsconfig and jsconfig coverage applies only to TypeScript and JavaScript-family files; other-language files have no `Tsconfig` label.
|
|
83
83
|
|
|
84
|
-
`code_health({ refresh: true })` retries failed startup and exhausted process-crash routes in scope, with at most one attempt per route per call. It collects fresh diagnostic evidence and reports recovery separately from diagnostic confirmation. A broad maintenance attempt can include active tracked files outside a requested directory, but the diagnostic result keeps the requested directory and tracked-file boundary. The report labels maintenance evidence separately from result coverage. A later refresh can retry a failed route. Reports show up to 16 route entries per recovery list and disclose omitted entries. Use an exact file scope when a route reports `use-exact-file`.
|
|
84
|
+
`code_health({ refresh: true })` retries failed startup and exhausted process-crash routes in scope, with at most one attempt per route per call. It collects fresh diagnostic evidence and reports recovery separately from diagnostic confirmation. A broad maintenance attempt can include active tracked files outside a requested directory, but the diagnostic result keeps the requested directory and tracked-file boundary. The report labels maintenance evidence separately from result coverage. A later refresh can retry a failed route. Reports show up to 16 route entries per recovery list and disclose omitted entries. Use an exact file scope when a route reports `use-exact-file`. Exact-file refresh, like other explicit file queries, can route external or automatically excluded files; it does not include them in later automatic discovery. File health distinguishes a missing compatible server configuration from a configured route that cannot start; neither establishes diagnostic confirmation. A retained initial-start failure keeps its startup-failure explanation on subsequent non-refresh requests, without triggering another startup attempt.
|
|
85
85
|
|
|
86
86
|
### Structured codemode results
|
|
87
87
|
|
|
@@ -98,9 +98,17 @@ All eight tools declare native output schemas and return JSON-serializable `stru
|
|
|
98
98
|
| Refactor Plan | `planId`, operation, safe target facts, every exact edit in `edits`, file/edit counts, provenance, and `nextAction` |
|
|
99
99
|
| Refactor Apply | Explicit `kind: "applied"`, changed `files` with per-file counts, and total file/edit counts |
|
|
100
100
|
|
|
101
|
-
Check `kind` before consuming evidence. Invalid input and candidate selection remain corrective returned outcomes; real execution/capability failures and cancellation throw. Internal providers, target records, fingerprints, mutation authority, and session state are not exposed. Apply recovery
|
|
101
|
+
Check `kind` before consuming evidence. Invalid input and candidate selection remain corrective returned outcomes; real execution/capability failures and cancellation throw. Internal providers, target records, fingerprints, mutation authority, and session state are not exposed. Apply recovery consumes original document identities in `details.data.recoveryFiles`, independently of display paths and script data.
|
|
102
102
|
|
|
103
|
-
Limits belong to their representation. Inspect
|
|
103
|
+
Limits belong to their representation. Inspect's `maxResults` caps each definition and diagnostic list, not syntax or hover text. Orientation native records retain the focus, ordering, `maxResults`, and collection limits even when text budgets hide descriptions or navigation rows. A captured snapshot describes the same observation; reading it does not refresh facts. Health returns all collected diagnostic-file/server entries, with at most three error/warning messages per file in detailed mode; neither a complete returned list nor successful maintenance proves workspace-wide diagnostic completeness. Plan returns every edit even when text previews only five. Text-preview omission counts do not describe these complete native lists. Evidence metadata preserves exact versus unknown totals and partial reasons.
|
|
104
|
+
|
|
105
|
+
Source and navigation locations use workspace-relative paths inside the canonical workspace and canonical absolute paths outside it, consistently in text, native records, and transcript details. Symlink aliases follow the same rule; missing files use normalized paths with any existing ancestors resolved. This display policy does not change target identity, search scope, or mutation authority. Orientation context-definition entries expose local `file` locations; non-file provider URIs remain `uri` observations with explicit unavailable filesystem navigation rather than fabricated paths. Original document identities used for post-Apply synchronization are retained separately from display paths. Technical ownership roots, focus-relative inventory records, project-relative declaration identities, declared values, user-input echoes, commands, and captured-result metadata keep their own semantics. Health renders ownership roots relative when lexically inside the workspace and absolute outside, without resolving symlinks or merging alias routes. Server inventory identities remain unchanged; current and retained recovery reports use the same readable labels, including in the status inspector.
|
|
106
|
+
|
|
107
|
+
Resolve and symbol-focused Orientation expose `targets[].resolution` only for the current anchored request. Reusing a target does not replay earlier request coordinates or snap notes; symbol queries, file discovery, and handle lookups omit that metadata. Handles remain stable while target evidence can improve across requests. Across providers, `snapped` is true exactly when the requested and resolved coordinates differ, including normalization from inside an identifier to its name anchor. Resolve and Orientation share the same resolution notes; a coordinate adjustment does not imply a declaration-header request.
|
|
108
|
+
|
|
109
|
+
Semantic exclusion examples distinguish the original `observedPath` rejected by policy from its navigable `canonicalPath`. A retained match and an excluded alias can refer to the same canonical source. Find exposes both fields in `automaticPathExclusion.examples`; candidate limitation messages use the same labeled explanation. Display canonicalization alone does not change exclusion counts, search completeness, or provider failure reasons. Scoped semantic searches count policy exclusions against completeness only when they may affect the requested scope; proven-disjoint excluded siblings do not force an otherwise unique target into disambiguation. When policy exclusions are the only gap (`exclusionOnly` metadata), a unique in-policy candidate resolves and the result notes the excluded paths; `code_graph` repeats those target notes, and semantic Find counts the in-policy matches exactly while keeping the exclusion disclosure. Route failures and coverage gaps still require explicit candidate selection.
|
|
110
|
+
|
|
111
|
+
Orientation groups equivalent syntax-recovery warnings by source, reason, and error ranges, listing all affected operations once. Native recovery facts retain every per-operation observation; distinct warnings remain separate.
|
|
104
112
|
|
|
105
113
|
Source points, target positions, Inspect source coordinates, and Orientation source-item coordinates use one-based lines and UTF-16 columns. Refactor edit ranges and Orientation provider ranges (hover, definitions, diagnostics), like syntax-recovery ranges, use zero-based lines and UTF-16 columns; range ends are exclusive. Health messages use one-based lines.
|
|
106
114
|
|
|
@@ -243,11 +251,13 @@ In interactive Pi, open the status overlay:
|
|
|
243
251
|
/supi-ci-status
|
|
244
252
|
```
|
|
245
253
|
|
|
246
|
-
The inspector shows semantic and structural readiness, error and warning counts, diagnostic confirmation evidence, server routes and roots, negotiated operation support, capability warnings, and active code tools. The **Diagnostic files** list includes tracked filenames even when clean; unconfirmed, failed, removed, skipped, and unavailable files are labeled separately. Diagnostic counts describe tracked files, not a workspace-wide check;
|
|
254
|
+
The inspector shows semantic and structural readiness, error and warning counts, diagnostic confirmation evidence, server routes and roots, negotiated operation support, capability warnings, and active code tools. The **Diagnostic files** list includes tracked filenames even when clean; unconfirmed, failed, removed, skipped, and unavailable files are labeled separately. Exact requested, confirmed, unconfirmed, failed, and removed counts remain visible alongside messages. Expanded details use the selected file's own evidence, not workspace-wide confirmation. Unconfirmed evidence does not establish staleness. Diagnostic counts describe tracked files, not a workspace-wide check; ready servers do not establish file coverage. Zero requested files means **No tracked diagnostic evidence**, unless diagnostics are unavailable. A clean summary names the confirmed tracked-file count and requires positive coverage, every requested file confirmed, no unconfirmed/failed/removed files, and no errors or warnings.
|
|
247
255
|
|
|
248
256
|
Use Up/Down (or `j`/`k`) to scroll the entire inspector, Page Up/Page Down to scroll by page, and Home/End to jump to the beginning/end. Use Tab/Shift+Tab to select the next/previous diagnostic file and Enter or Space to expand it. Press `c` or F5 to **Check diagnostics**: discover automatically eligible source files and request diagnostics for up to 32 files under one 30-second deadline. The result reports the selected range, remaining files in the pass, and discovery or time limits. Check again to continue the next batch; after the final batch, another check starts a new pass. This is bounded file coverage, not a whole-project guarantee. Closing the inspector cancels its wait and prevents further file requests; already-dispatched shared LSP work can settle independently.
|
|
249
257
|
|
|
250
|
-
Press `
|
|
258
|
+
Press `h` (or F6) to **Refresh health**: run the existing workspace-scoped session health workflow with diagnostics and servers under the same 60-second caller deadline as `code_health`. This uses existing bounded source discovery/tracking and route recovery policy; it does not enroll the whole workspace or guarantee recovery. After the workflow returns, one passive snapshot owns the current diagnostic, file, and server view. A separate interaction-local outcome reports completion, failure or unavailability, elapsed time, relevant route outcomes, and source-discovery limits. Action completion is not diagnostic confirmation. A workflow or snapshot-collection exception retains the previous coherent view and identifies the failed stage.
|
|
259
|
+
|
|
260
|
+
Press `r` to reload the passive snapshot, `a` to collapse details, and Escape to close. Opening, rendering, expanding details, and reloading do not enroll files, start or retry routes, or request fresh diagnostics. Only one reload, check, or health action runs at a time; scrolling and details remain usable while the spinner runs. Closing aborts the caller's wait and prevents subsequent snapshot collection or late UI updates; shared LSP work may still settle independently. Scrolling, Tab, confirmation, and cancel actions honor Pi's configured keybindings. Configured actions take priority over `c`/F5 and `h`/F6; the inspector advertises an available shortcut for each action, or marks it unbound. The viewport adjusts to terminal size, with controls kept visible.
|
|
251
261
|
|
|
252
262
|
The inspector does not replace the footer or add editor widgets. The extension's separate LSP footer contribution remains active. Outside the interactive terminal, use `code_health`.
|
|
253
263
|
|
|
@@ -77,7 +77,9 @@ export interface SemanticProvider {
|
|
|
77
77
|
): Promise<CodeQueryResult<DocumentCodeSymbol[]>>;
|
|
78
78
|
/**
|
|
79
79
|
* Collect workspace symbols from routes that can contribute within the
|
|
80
|
-
* optional
|
|
80
|
+
* optional path scopes. Completeness is relative to those scopes, but data
|
|
81
|
+
* may include out-of-scope rows; consumers must filter rows themselves.
|
|
82
|
+
* Policy exclusions proven outside every scope do not make the query partial.
|
|
81
83
|
*/
|
|
82
84
|
workspaceSymbols(
|
|
83
85
|
query: string,
|
|
@@ -3,8 +3,17 @@ export interface CodeQueryPartialMetadata {
|
|
|
3
3
|
/** Automatic path-policy evidence removed from a collected result. */
|
|
4
4
|
readonly automaticPathExclusion?: {
|
|
5
5
|
readonly excludedCount: number;
|
|
6
|
+
/** Observed policy paths, not canonical navigation paths; retain aliases when presenting exclusions. */
|
|
6
7
|
readonly examples: readonly string[];
|
|
7
8
|
};
|
|
9
|
+
/**
|
|
10
|
+
* True when automatic path-policy exclusions are the only reason the result
|
|
11
|
+
* is partial: every contributing provider branch completed and no coverage
|
|
12
|
+
* gap was observed. Excluded rows matched paths the workspace policy treats
|
|
13
|
+
* as out of automatic scope, so the retained rows are the complete in-policy
|
|
14
|
+
* answer.
|
|
15
|
+
*/
|
|
16
|
+
readonly exclusionOnly?: boolean;
|
|
8
17
|
}
|
|
9
18
|
|
|
10
19
|
/**
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
// Session-provided Web tools for SuPi child sessions (Agent Runs and Reviewer Sessions).
|
|
2
|
+
//
|
|
3
|
+
// The loaded supi-web extension answers a synchronous request on the parent event bus.
|
|
4
|
+
// Consumers never depend on supi-web; when it is absent or provides no tools, the
|
|
5
|
+
// request returns undefined and the child simply lacks Web tools.
|
|
6
|
+
|
|
7
|
+
import type { ExtensionAPI, ExtensionFactory } from "@earendil-works/pi-coding-agent";
|
|
8
|
+
|
|
9
|
+
/** Web tools that child sessions may receive when the containing session provides them. */
|
|
10
|
+
export const CHILD_WEB_TOOL_NAMES = [
|
|
11
|
+
"web_fetch_md",
|
|
12
|
+
"web_search",
|
|
13
|
+
"web_docs_search",
|
|
14
|
+
"web_docs_fetch",
|
|
15
|
+
] as const;
|
|
16
|
+
|
|
17
|
+
/** One session-provided Web tool name. */
|
|
18
|
+
export type ChildWebToolName = (typeof CHILD_WEB_TOOL_NAMES)[number];
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Web tools currently callable in the containing session plus a child-only extension
|
|
22
|
+
* factory that registers them. The factory must not capture the parent session; it may
|
|
23
|
+
* capture plain data such as the containing session's configuration directory.
|
|
24
|
+
*/
|
|
25
|
+
export interface ChildWebToolProvision {
|
|
26
|
+
readonly toolNames: readonly ChildWebToolName[];
|
|
27
|
+
/** Register the requested subset of `toolNames` in a child session. */
|
|
28
|
+
readonly createFactory: (toolNames: readonly ChildWebToolName[]) => ExtensionFactory;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** Plain containing-session data supplied with a child Web tool request. */
|
|
32
|
+
export interface ChildWebToolsRequestContext {
|
|
33
|
+
/**
|
|
34
|
+
* Working directory whose SuPi configuration governs Web settings such as Firecrawl.
|
|
35
|
+
* Children with a different cwd (for example a frozen Review Workspace) keep this policy.
|
|
36
|
+
*/
|
|
37
|
+
readonly configCwd: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
type EventBusLike = Pick<ExtensionAPI["events"], "on" | "emit">;
|
|
41
|
+
|
|
42
|
+
const REQUEST_CHANNEL = "supi:child-web-tools:request";
|
|
43
|
+
const RESPONSE_CHANNEL = "supi:child-web-tools:response";
|
|
44
|
+
|
|
45
|
+
interface ChildWebToolsRequest extends ChildWebToolsRequestContext {
|
|
46
|
+
readonly requestId: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
interface ChildWebToolsResponse {
|
|
50
|
+
readonly requestId: string;
|
|
51
|
+
readonly provision: ChildWebToolProvision;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
let nextRequestId = 0;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Answer child Web tool requests on the parent event bus. The callback must be synchronous
|
|
58
|
+
* because Pi's event bus does not await listeners. Returns an unsubscribe function.
|
|
59
|
+
*/
|
|
60
|
+
export function provideChildWebTools(
|
|
61
|
+
events: EventBusLike,
|
|
62
|
+
resolve: (context: ChildWebToolsRequestContext) => ChildWebToolProvision | undefined,
|
|
63
|
+
): () => void {
|
|
64
|
+
return events.on(REQUEST_CHANNEL, (data) => {
|
|
65
|
+
const request = data as Partial<ChildWebToolsRequest> | undefined;
|
|
66
|
+
if (typeof request?.requestId !== "string" || typeof request.configCwd !== "string") return;
|
|
67
|
+
const { requestId, configCwd } = request;
|
|
68
|
+
const provision = resolve({ configCwd });
|
|
69
|
+
if (!provision || provision.toolNames.length === 0) return;
|
|
70
|
+
events.emit(RESPONSE_CHANNEL, { requestId, provision } satisfies ChildWebToolsResponse);
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** Capture the Web tools the containing session currently provides, if any. */
|
|
75
|
+
export function requestChildWebTools(
|
|
76
|
+
events: EventBusLike,
|
|
77
|
+
context: ChildWebToolsRequestContext,
|
|
78
|
+
): ChildWebToolProvision | undefined {
|
|
79
|
+
const requestId = `child-web-${process.pid}-${++nextRequestId}`;
|
|
80
|
+
let provision: ChildWebToolProvision | undefined;
|
|
81
|
+
const unsubscribe = events.on(RESPONSE_CHANNEL, (data) => {
|
|
82
|
+
const response = data as Partial<ChildWebToolsResponse> | undefined;
|
|
83
|
+
if (response?.requestId === requestId && response.provision) provision = response.provision;
|
|
84
|
+
});
|
|
85
|
+
try {
|
|
86
|
+
events.emit(REQUEST_CHANNEL, { requestId, ...context } satisfies ChildWebToolsRequest);
|
|
87
|
+
} finally {
|
|
88
|
+
unsubscribe();
|
|
89
|
+
}
|
|
90
|
+
return provision;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Return the Web tools callable in a session under Pi's exposure rules: active `direct`
|
|
95
|
+
* tools, plus registered `codemode` and `deferred` tools. `model-only` and `hidden`
|
|
96
|
+
* tools are not callable.
|
|
97
|
+
*/
|
|
98
|
+
export function callableChildWebToolNames(
|
|
99
|
+
pi: Pick<ExtensionAPI, "getAllTools" | "getActiveTools">,
|
|
100
|
+
): ChildWebToolName[] {
|
|
101
|
+
const active = new Set(pi.getActiveTools());
|
|
102
|
+
const exposures = new Map(
|
|
103
|
+
pi.getAllTools().map((tool) => [tool.name, tool.exposure ?? "direct"] as const),
|
|
104
|
+
);
|
|
105
|
+
return CHILD_WEB_TOOL_NAMES.filter((name) => {
|
|
106
|
+
const exposure = exposures.get(name);
|
|
107
|
+
if (exposure === "direct") return active.has(name);
|
|
108
|
+
return exposure === "codemode" || exposure === "deferred";
|
|
109
|
+
});
|
|
110
|
+
}
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
// supi-core session domain — session utilities and registries.
|
|
2
2
|
|
|
3
|
+
export type {
|
|
4
|
+
ChildWebToolName,
|
|
5
|
+
ChildWebToolProvision,
|
|
6
|
+
ChildWebToolsRequestContext,
|
|
7
|
+
} from "./child-web-tools.ts";
|
|
8
|
+
export {
|
|
9
|
+
CHILD_WEB_TOOL_NAMES,
|
|
10
|
+
callableChildWebToolNames,
|
|
11
|
+
provideChildWebTools,
|
|
12
|
+
requestChildWebTools,
|
|
13
|
+
} from "./child-web-tools.ts";
|
|
3
14
|
export { createRegistry, createSessionStateRegistry } from "./registry-utils.ts";
|
|
4
15
|
export type {
|
|
5
16
|
SessionCapabilitySkill,
|
|
@@ -64,6 +64,8 @@ A configured route is not a ready server. Features depend on the active server,
|
|
|
64
64
|
|
|
65
65
|
The [operation-support model](src/config/operation-support.ts) separates server advertisement from SuPi planning limits. A server can advertise an action that SuPi cannot safely turn into a plan.
|
|
66
66
|
|
|
67
|
+
Workspace-symbol scopes select contributing routes and bound query completeness; returned data can still contain out-of-scope rows, which consumers must filter. An automatic-policy exclusion does not make a scoped query partial when both its observed path and physical identity are proven outside every requested scope. In-scope exclusions, aliases that may overlap, unresolved paths, and contributing route failures remain partial. Unscoped queries retain all exclusion evidence. Partial metadata sets `exclusionOnly` when policy exclusions are the only gap, with no route failure or inferred-project coverage gap. Explicitly selected excluded files and directories remain inspectable; when a scoped query returns no row inside any scope, warm-up may open files inside those selected scopes so a server that only indexes opened documents can report them. Automatic path rules and target-uniqueness checks are unchanged.
|
|
68
|
+
|
|
67
69
|
### Reference-server acceptance
|
|
68
70
|
|
|
69
71
|
The [Code Intelligence acceptance suite](../supi-code-intelligence/__tests__/acceptance/language-baseline-harness.ts) exercises public tools against real servers for TypeScript, JavaScript, Python, Java, Go, Rust, C, and C++. Its [pinned Linux/macOS configuration](../../scripts/language-baseline/pins.json) is separate from the built-in route matrix. Qualification remains pending until both pinned CI jobs pass. Missing test prerequisites are failures, not skipped passes.
|
|
@@ -161,6 +163,22 @@ Protocol support is separate from the configured mode. A server may support pull
|
|
|
161
163
|
|
|
162
164
|
The LSP 3.18 specification adds `Diagnostic.message` markup content, guarded by the client capability `textDocument.diagnostic.markupMessageSupport`; SuPi's validator already accepts plaintext and markdown messages but does not advertise the capability. Other 3.18 features (snippet text edits, inline completion, folding-range refresh, multi-range formatting) are outside the diagnostic surface and are not implemented.
|
|
163
165
|
|
|
166
|
+
### Texlab diagnostic verification
|
|
167
|
+
|
|
168
|
+
Verified binary: **Texlab 5.26.0**. This separate verification does not revise the historical audit above or qualify other Texlab versions. The probe advertised pull support, opened a document with a syntax error, and then corrected and saved it.
|
|
169
|
+
|
|
170
|
+
| Protocol check | Observed result |
|
|
171
|
+
|---|---|
|
|
172
|
+
| Static `diagnosticProvider` | Not advertised |
|
|
173
|
+
| Dynamic `textDocument/diagnostic` registration | None observed |
|
|
174
|
+
| Explicit `textDocument/diagnostic` request | JSON-RPC `-32601` (`method not found`) |
|
|
175
|
+
| `publishDiagnostics` | Publications without a document version |
|
|
176
|
+
| Syntax error → corrected document | Error publication followed by empty publications |
|
|
177
|
+
|
|
178
|
+
Texlab supplies useful diagnostics through ambient push. SuPi shows observed errors as partial evidence and removes them after a correcting publication, but an empty publication does not confirm a completed clean check. `code_health` therefore keeps the file unconfirmed. A `push-settle` timeout ends the bounded observation window; it is not a failed diagnostic request or proof that Texlab is unresponsive. Longer waits, repeated publications, and restarts do not establish completion.
|
|
179
|
+
|
|
180
|
+
The [installed Texlab integration test](__tests__/integration/client.integration.texlab.test.ts) covers routing, the absence of a diagnostic provider/request adapter, and unconfirmed coverage. It runs when `texlab` is installed. See [ADR 0022](../../docs/adr/0022-request-confirmed-lsp-agnostic-diagnostics.md) for the unchanged evidence policy.
|
|
181
|
+
|
|
164
182
|
### Diagnostic evidence policy
|
|
165
183
|
|
|
166
184
|
See [`ADR 0022`](../../docs/adr/0022-request-confirmed-lsp-agnostic-diagnostics.md) for the decision record. SuPi uses one shared diagnostic engine with optional internal request adapters. It selects one source for each file:
|
|
@@ -185,11 +203,13 @@ Refresh and file collection share synchronization, evidence-revision, deadline,
|
|
|
185
203
|
|
|
186
204
|
Caller cancellation or deadline stops only that caller's wait. Explicit diagnostic requests use an owned transport lifetime: supersession drops queued jobs and stops future adapter phases but does not cancel an active protocol request. The route stays occupied until actual settlement or connection disposal. The owner timeout attempts protocol cancellation but does not prove that the backend stopped. The owner bound is at least 30 seconds (or a larger collection budget). A result from an obsolete document generation is discarded. Ordinary semantic requests still pass caller cancellation to the protocol transport.
|
|
187
205
|
|
|
206
|
+
First document enrollment is admitted between semantic query and refactor-planning attempts on the same current client. Each attempt covers input synchronization, its RPCs, and final acceptance; reads can still run concurrently. A refactor attempt retains admission through `prepareRename`/`rename` or `codeAction`/`resolve` and verified snapshot capture, but releases it before retries and the rename workflow's own cross-file enrollment. FIFO admission prevents later reads from overtaking a waiting first open. At most 32 operations may wait; excess demand fails rather than growing an unbounded queue. Waiting preserves the caller's original signal and absolute deadline, and interrupted operations are removed before they can open a document. Disk content is read after admission. First opens for semantic or refactor demand also discard the caller's original parameters after a known input change; ordinary tracking can still adopt fresh content. Tracked-document updates, closes, workspace changes, and lifecycle invalidation do not wait: they still invalidate active evidence and discard queued request parameters. Closing a file cancels its queued opens, and stopping a client discards its queued work. Admission does not span retries, project warm-up, or whole tool/refactor workflows. Diagnostic transport ownership and confirmation remain separate and unchanged.
|
|
207
|
+
|
|
188
208
|
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.
|
|
189
209
|
|
|
190
210
|
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).
|
|
191
211
|
|
|
192
|
-
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.
|
|
212
|
+
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. Recovery skips documents closed or already reopened on the replacement and checks client ownership before reading or restoring failed state.
|
|
193
213
|
|
|
194
214
|
Server readiness follows LSP work-done progress: a created progress token is pending and never blocks readiness; an observed `begin` marks active work and makes the client not ready until its `end` or the bounded per-token timeout.
|
|
195
215
|
|
|
@@ -233,7 +253,7 @@ Set `code-intelligence.exclude` in project or global SuPi configuration. A proje
|
|
|
233
253
|
|
|
234
254
|
An old `lsp.exclude` value is a migration error. Move it to `code-intelligence.exclude`; SuPi does not edit personal configuration for you.
|
|
235
255
|
|
|
236
|
-
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.
|
|
256
|
+
An exact semantic request or exact-file health refresh can still route an excluded or external file when a compatible server is available. Explicit refresh can retry that file's failed route without applying automatic-discovery exclusions. Original route and document identities are preserved; display-path canonicalization does not merge alias routes. This does not add the file to automatic work. Configured diagnostic suppression still applies to diagnostic output.
|
|
237
257
|
|
|
238
258
|
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.
|
|
239
259
|
|
|
@@ -272,6 +292,23 @@ Server settings use one snapshot for the active workspace runtime:
|
|
|
272
292
|
- SuPi validates the JSON object shape, not server-specific setting names or values.
|
|
273
293
|
- Saved changes apply after reload or restart. A saved value does not prove that the server accepted it.
|
|
274
294
|
|
|
295
|
+
TypeScript and JavaScript servers format code-action edits, such as organize imports, with their own defaults (4-space indentation) unless settings say otherwise. SuPi does not infer formatting from Biome, Prettier, or EditorConfig. Both the `typescript-language-server` and native TS 7 backends read `typescript.format` / `javascript.format`:
|
|
296
|
+
|
|
297
|
+
```json
|
|
298
|
+
{
|
|
299
|
+
"lsp": {
|
|
300
|
+
"servers": {
|
|
301
|
+
"typescript": {
|
|
302
|
+
"settings": {
|
|
303
|
+
"typescript": { "format": { "indentSize": 2, "tabSize": 2, "convertTabsToSpaces": true } },
|
|
304
|
+
"javascript": { "format": { "indentSize": 2, "tabSize": 2, "convertTabsToSpaces": true } }
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
```
|
|
311
|
+
|
|
275
312
|
File types do not include a leading dot. If `rootMarkers` is omitted, the server uses the session root.
|
|
276
313
|
|
|
277
314
|
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.
|
|
@@ -77,7 +77,9 @@ export interface SemanticProvider {
|
|
|
77
77
|
): Promise<CodeQueryResult<DocumentCodeSymbol[]>>;
|
|
78
78
|
/**
|
|
79
79
|
* Collect workspace symbols from routes that can contribute within the
|
|
80
|
-
* optional
|
|
80
|
+
* optional path scopes. Completeness is relative to those scopes, but data
|
|
81
|
+
* may include out-of-scope rows; consumers must filter rows themselves.
|
|
82
|
+
* Policy exclusions proven outside every scope do not make the query partial.
|
|
81
83
|
*/
|
|
82
84
|
workspaceSymbols(
|
|
83
85
|
query: string,
|
|
@@ -3,8 +3,17 @@ export interface CodeQueryPartialMetadata {
|
|
|
3
3
|
/** Automatic path-policy evidence removed from a collected result. */
|
|
4
4
|
readonly automaticPathExclusion?: {
|
|
5
5
|
readonly excludedCount: number;
|
|
6
|
+
/** Observed policy paths, not canonical navigation paths; retain aliases when presenting exclusions. */
|
|
6
7
|
readonly examples: readonly string[];
|
|
7
8
|
};
|
|
9
|
+
/**
|
|
10
|
+
* True when automatic path-policy exclusions are the only reason the result
|
|
11
|
+
* is partial: every contributing provider branch completed and no coverage
|
|
12
|
+
* gap was observed. Excluded rows matched paths the workspace policy treats
|
|
13
|
+
* as out of automatic scope, so the retained rows are the complete in-policy
|
|
14
|
+
* answer.
|
|
15
|
+
*/
|
|
16
|
+
readonly exclusionOnly?: boolean;
|
|
8
17
|
}
|
|
9
18
|
|
|
10
19
|
/**
|
package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/child-web-tools.ts
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
// Session-provided Web tools for SuPi child sessions (Agent Runs and Reviewer Sessions).
|
|
2
|
+
//
|
|
3
|
+
// The loaded supi-web extension answers a synchronous request on the parent event bus.
|
|
4
|
+
// Consumers never depend on supi-web; when it is absent or provides no tools, the
|
|
5
|
+
// request returns undefined and the child simply lacks Web tools.
|
|
6
|
+
|
|
7
|
+
import type { ExtensionAPI, ExtensionFactory } from "@earendil-works/pi-coding-agent";
|
|
8
|
+
|
|
9
|
+
/** Web tools that child sessions may receive when the containing session provides them. */
|
|
10
|
+
export const CHILD_WEB_TOOL_NAMES = [
|
|
11
|
+
"web_fetch_md",
|
|
12
|
+
"web_search",
|
|
13
|
+
"web_docs_search",
|
|
14
|
+
"web_docs_fetch",
|
|
15
|
+
] as const;
|
|
16
|
+
|
|
17
|
+
/** One session-provided Web tool name. */
|
|
18
|
+
export type ChildWebToolName = (typeof CHILD_WEB_TOOL_NAMES)[number];
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Web tools currently callable in the containing session plus a child-only extension
|
|
22
|
+
* factory that registers them. The factory must not capture the parent session; it may
|
|
23
|
+
* capture plain data such as the containing session's configuration directory.
|
|
24
|
+
*/
|
|
25
|
+
export interface ChildWebToolProvision {
|
|
26
|
+
readonly toolNames: readonly ChildWebToolName[];
|
|
27
|
+
/** Register the requested subset of `toolNames` in a child session. */
|
|
28
|
+
readonly createFactory: (toolNames: readonly ChildWebToolName[]) => ExtensionFactory;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** Plain containing-session data supplied with a child Web tool request. */
|
|
32
|
+
export interface ChildWebToolsRequestContext {
|
|
33
|
+
/**
|
|
34
|
+
* Working directory whose SuPi configuration governs Web settings such as Firecrawl.
|
|
35
|
+
* Children with a different cwd (for example a frozen Review Workspace) keep this policy.
|
|
36
|
+
*/
|
|
37
|
+
readonly configCwd: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
type EventBusLike = Pick<ExtensionAPI["events"], "on" | "emit">;
|
|
41
|
+
|
|
42
|
+
const REQUEST_CHANNEL = "supi:child-web-tools:request";
|
|
43
|
+
const RESPONSE_CHANNEL = "supi:child-web-tools:response";
|
|
44
|
+
|
|
45
|
+
interface ChildWebToolsRequest extends ChildWebToolsRequestContext {
|
|
46
|
+
readonly requestId: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
interface ChildWebToolsResponse {
|
|
50
|
+
readonly requestId: string;
|
|
51
|
+
readonly provision: ChildWebToolProvision;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
let nextRequestId = 0;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Answer child Web tool requests on the parent event bus. The callback must be synchronous
|
|
58
|
+
* because Pi's event bus does not await listeners. Returns an unsubscribe function.
|
|
59
|
+
*/
|
|
60
|
+
export function provideChildWebTools(
|
|
61
|
+
events: EventBusLike,
|
|
62
|
+
resolve: (context: ChildWebToolsRequestContext) => ChildWebToolProvision | undefined,
|
|
63
|
+
): () => void {
|
|
64
|
+
return events.on(REQUEST_CHANNEL, (data) => {
|
|
65
|
+
const request = data as Partial<ChildWebToolsRequest> | undefined;
|
|
66
|
+
if (typeof request?.requestId !== "string" || typeof request.configCwd !== "string") return;
|
|
67
|
+
const { requestId, configCwd } = request;
|
|
68
|
+
const provision = resolve({ configCwd });
|
|
69
|
+
if (!provision || provision.toolNames.length === 0) return;
|
|
70
|
+
events.emit(RESPONSE_CHANNEL, { requestId, provision } satisfies ChildWebToolsResponse);
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** Capture the Web tools the containing session currently provides, if any. */
|
|
75
|
+
export function requestChildWebTools(
|
|
76
|
+
events: EventBusLike,
|
|
77
|
+
context: ChildWebToolsRequestContext,
|
|
78
|
+
): ChildWebToolProvision | undefined {
|
|
79
|
+
const requestId = `child-web-${process.pid}-${++nextRequestId}`;
|
|
80
|
+
let provision: ChildWebToolProvision | undefined;
|
|
81
|
+
const unsubscribe = events.on(RESPONSE_CHANNEL, (data) => {
|
|
82
|
+
const response = data as Partial<ChildWebToolsResponse> | undefined;
|
|
83
|
+
if (response?.requestId === requestId && response.provision) provision = response.provision;
|
|
84
|
+
});
|
|
85
|
+
try {
|
|
86
|
+
events.emit(REQUEST_CHANNEL, { requestId, ...context } satisfies ChildWebToolsRequest);
|
|
87
|
+
} finally {
|
|
88
|
+
unsubscribe();
|
|
89
|
+
}
|
|
90
|
+
return provision;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Return the Web tools callable in a session under Pi's exposure rules: active `direct`
|
|
95
|
+
* tools, plus registered `codemode` and `deferred` tools. `model-only` and `hidden`
|
|
96
|
+
* tools are not callable.
|
|
97
|
+
*/
|
|
98
|
+
export function callableChildWebToolNames(
|
|
99
|
+
pi: Pick<ExtensionAPI, "getAllTools" | "getActiveTools">,
|
|
100
|
+
): ChildWebToolName[] {
|
|
101
|
+
const active = new Set(pi.getActiveTools());
|
|
102
|
+
const exposures = new Map(
|
|
103
|
+
pi.getAllTools().map((tool) => [tool.name, tool.exposure ?? "direct"] as const),
|
|
104
|
+
);
|
|
105
|
+
return CHILD_WEB_TOOL_NAMES.filter((name) => {
|
|
106
|
+
const exposure = exposures.get(name);
|
|
107
|
+
if (exposure === "direct") return active.has(name);
|
|
108
|
+
return exposure === "codemode" || exposure === "deferred";
|
|
109
|
+
});
|
|
110
|
+
}
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
// supi-core session domain — session utilities and registries.
|
|
2
2
|
|
|
3
|
+
export type {
|
|
4
|
+
ChildWebToolName,
|
|
5
|
+
ChildWebToolProvision,
|
|
6
|
+
ChildWebToolsRequestContext,
|
|
7
|
+
} from "./child-web-tools.ts";
|
|
8
|
+
export {
|
|
9
|
+
CHILD_WEB_TOOL_NAMES,
|
|
10
|
+
callableChildWebToolNames,
|
|
11
|
+
provideChildWebTools,
|
|
12
|
+
requestChildWebTools,
|
|
13
|
+
} from "./child-web-tools.ts";
|
|
3
14
|
export { createRegistry, createSessionStateRegistry } from "./registry-utils.ts";
|
|
4
15
|
export type {
|
|
5
16
|
SessionCapabilitySkill,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mrclrchtr/supi-lsp",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.3.0",
|
|
4
4
|
"description": "Language Server Protocol runtime for SuPi code intelligence",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"vscode-jsonrpc": "^10.0.0",
|
|
39
39
|
"vscode-languageserver-protocol": "^3.18.5",
|
|
40
40
|
"vscode-languageserver-types": "^3.18.5",
|
|
41
|
-
"@mrclrchtr/supi-core": "11.
|
|
42
|
-
"@mrclrchtr/supi-code-runtime": "11.
|
|
41
|
+
"@mrclrchtr/supi-core": "11.3.0",
|
|
42
|
+
"@mrclrchtr/supi-code-runtime": "11.3.0"
|
|
43
43
|
},
|
|
44
44
|
"bundledDependencies": [
|
|
45
45
|
"@mrclrchtr/supi-code-runtime",
|
|
@@ -95,10 +95,17 @@ async function collectPushOnlyEvidence(
|
|
|
95
95
|
? partialCodeQuery(diagnostics, TENTATIVE_PUSH_UNAVAILABLE_REASON)
|
|
96
96
|
: unavailableCodeQuery(TENTATIVE_PUSH_UNAVAILABLE_REASON);
|
|
97
97
|
}
|
|
98
|
-
|
|
99
|
-
options.cachedDiagnostics,
|
|
100
|
-
|
|
101
|
-
|
|
98
|
+
if (push === "released") {
|
|
99
|
+
return incompleteDiagnosticResult(options.cachedDiagnostics, "released");
|
|
100
|
+
}
|
|
101
|
+
return options.cachedDiagnostics
|
|
102
|
+
? partialCodeQuery(
|
|
103
|
+
options.cachedDiagnostics,
|
|
104
|
+
`${TENTATIVE_PUSH_UNAVAILABLE_REASON} Retained cached diagnostics are partial evidence.`,
|
|
105
|
+
)
|
|
106
|
+
: unavailableCodeQuery(
|
|
107
|
+
`${TENTATIVE_PUSH_UNAVAILABLE_REASON} No current publication was observed.`,
|
|
108
|
+
);
|
|
102
109
|
}
|
|
103
110
|
|
|
104
111
|
/** Collect one request report without using an ambient push as confirmation. */
|