@mrclrchtr/supi-code-intelligence 2.0.6 → 2.2.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/README.md +88 -4
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/README.md +32 -23
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/package.json +2 -1
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config/config.ts +22 -8
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config/prompt-surface.ts +357 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config.ts +2 -3
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +0 -5
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/prompt-surface.ts +4 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/scoped-settings-list.ts +372 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-action-menu.ts +101 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-command.ts +1 -1
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-registry.ts +55 -27
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-schema.ts +464 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-submenus.ts +124 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-ui.ts +72 -285
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings-ui.ts +2 -5
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings.ts +27 -5
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/tool-framework.ts +10 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/package.json +2 -2
- package/node_modules/@mrclrchtr/supi-core/README.md +32 -23
- package/node_modules/@mrclrchtr/supi-core/package.json +2 -1
- package/node_modules/@mrclrchtr/supi-core/src/config/config.ts +22 -8
- package/node_modules/@mrclrchtr/supi-core/src/config/prompt-surface.ts +357 -0
- package/node_modules/@mrclrchtr/supi-core/src/config.ts +2 -3
- package/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +0 -5
- package/node_modules/@mrclrchtr/supi-core/src/prompt-surface.ts +4 -0
- package/node_modules/@mrclrchtr/supi-core/src/settings/scoped-settings-list.ts +372 -0
- package/node_modules/@mrclrchtr/supi-core/src/settings/settings-action-menu.ts +101 -0
- package/node_modules/@mrclrchtr/supi-core/src/settings/settings-command.ts +1 -1
- package/node_modules/@mrclrchtr/supi-core/src/settings/settings-registry.ts +55 -27
- package/node_modules/@mrclrchtr/supi-core/src/settings/settings-schema.ts +464 -0
- package/node_modules/@mrclrchtr/supi-core/src/settings/settings-submenus.ts +124 -0
- package/node_modules/@mrclrchtr/supi-core/src/settings/settings-ui.ts +72 -285
- package/node_modules/@mrclrchtr/supi-core/src/settings-ui.ts +2 -5
- package/node_modules/@mrclrchtr/supi-core/src/settings.ts +27 -5
- package/node_modules/@mrclrchtr/supi-core/src/tool-framework.ts +10 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/README.md +32 -23
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/package.json +2 -1
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config/config.ts +22 -8
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config/prompt-surface.ts +357 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config.ts +2 -3
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +0 -5
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/prompt-surface.ts +4 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/scoped-settings-list.ts +372 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-action-menu.ts +101 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-command.ts +1 -1
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-registry.ts +55 -27
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-schema.ts +464 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-submenus.ts +124 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-ui.ts +72 -285
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings-ui.ts +2 -5
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings.ts +27 -5
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/tool-framework.ts +10 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/package.json +2 -2
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/README.md +32 -23
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/package.json +2 -1
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/config/config.ts +22 -8
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/config/prompt-surface.ts +357 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/config.ts +2 -3
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +0 -5
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/prompt-surface.ts +4 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/settings/scoped-settings-list.ts +372 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/settings/settings-action-menu.ts +101 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/settings/settings-command.ts +1 -1
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/settings/settings-registry.ts +55 -27
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/settings/settings-schema.ts +464 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/settings/settings-submenus.ts +124 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/settings/settings-ui.ts +72 -285
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/settings-ui.ts +2 -5
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/settings.ts +27 -5
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/tool-framework.ts +10 -0
- package/node_modules/@mrclrchtr/supi-lsp/package.json +3 -3
- package/node_modules/@mrclrchtr/supi-lsp/src/config/lsp-settings.ts +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/README.md +32 -23
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/package.json +2 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config/config.ts +22 -8
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config/prompt-surface.ts +357 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config.ts +2 -3
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +0 -5
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/prompt-surface.ts +4 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/scoped-settings-list.ts +372 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-action-menu.ts +101 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-command.ts +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-registry.ts +55 -27
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-schema.ts +464 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-submenus.ts +124 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-ui.ts +72 -285
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings-ui.ts +2 -5
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings.ts +27 -5
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/tool-framework.ts +10 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/package.json +2 -2
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/README.md +32 -23
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/package.json +2 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/config/config.ts +22 -8
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/config/prompt-surface.ts +357 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/config.ts +2 -3
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +0 -5
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/prompt-surface.ts +4 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/settings/scoped-settings-list.ts +372 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/settings/settings-action-menu.ts +101 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/settings/settings-command.ts +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/settings/settings-registry.ts +55 -27
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/settings/settings-schema.ts +464 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/settings/settings-submenus.ts +124 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/settings/settings-ui.ts +72 -285
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/settings-ui.ts +2 -5
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/settings.ts +27 -5
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/tool-framework.ts +10 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/package.json +3 -3
- package/package.json +5 -5
- package/src/analysis/evidence.ts +13 -0
- package/src/analysis/instruction-files.ts +194 -0
- package/src/analysis/search/pattern.ts +24 -13
- package/src/analysis/search/ripgrep.ts +92 -7
- package/src/app/app.ts +6 -1
- package/src/config.ts +42 -0
- package/src/extension.ts +9 -1
- package/src/session/capability-adapter.ts +218 -0
- package/src/session/session.ts +106 -1
- package/src/session/target-workflow.ts +430 -0
- package/src/substrate/lsp/diagnostic-injection.ts +0 -15
- package/src/substrate/lsp/settings.ts +101 -175
- package/src/tool/find/execute.ts +23 -10
- package/src/tool/find/orchestrate.ts +67 -54
- package/src/tool/find/semantic-search.ts +30 -16
- package/src/tool/graph/collect-relation.ts +2 -1
- package/src/tool/graph/execute.ts +40 -12
- package/src/tool/graph/markdown-base.ts +5 -37
- package/src/tool/graph/orchestrate.ts +9 -35
- package/src/tool/graph/tui.ts +2 -0
- package/src/tool/guidance.ts +27 -38
- package/src/tool/health/markdown.ts +12 -70
- package/src/tool/health/orchestrate.ts +5 -13
- package/src/tool/impact/analysis.ts +0 -27
- package/src/tool/impact/change-set-impact.ts +3 -2
- package/src/tool/impact/execute.ts +27 -0
- package/src/tool/impact/file-level-impact.ts +3 -2
- package/src/tool/impact/result.ts +2 -21
- package/src/tool/impact/single-impact.ts +3 -2
- package/src/tool/infra/error-results.ts +18 -196
- package/src/tool/infra/pipeline.ts +24 -1
- package/src/tool/inspect/markdown.ts +4 -41
- package/src/tool/inspect/orchestrate.ts +27 -28
- package/src/tool/orientation/mode.ts +53 -2
- package/src/tool/orientation/orchestrate.ts +5 -8
- package/src/tool/orientation/precise-target.ts +65 -69
- package/src/tool/refactor-apply/orchestrate.ts +2 -7
- package/src/tool/refactor-plan/orchestrate.ts +31 -39
- package/src/tool/resolve/markdown.ts +5 -6
- package/src/tool/resolve/orchestrate.ts +7 -103
- package/src/tool/result/errors.ts +199 -0
- package/src/tool/result/find.ts +29 -0
- package/src/tool/result/graph.ts +93 -0
- package/src/tool/result/health.ts +94 -0
- package/src/tool/result/impact.ts +50 -0
- package/src/tool/result/inspect.ts +60 -0
- package/src/tool/result/orientation.ts +30 -0
- package/src/tool/result/refactor.ts +35 -0
- package/src/tool/result/resolve.ts +114 -0
- package/src/tool/result/types.ts +191 -0
- package/src/tool/schemas.ts +39 -28
- package/src/types/details.ts +17 -185
- package/src/ui/tui/common.ts +45 -1
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config/config-settings.ts +0 -188
- package/node_modules/@mrclrchtr/supi-core/src/config/config-settings.ts +0 -188
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config/config-settings.ts +0 -188
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/config/config-settings.ts +0 -188
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config/config-settings.ts +0 -188
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/config/config-settings.ts +0 -188
package/src/tool/guidance.ts
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
//
|
|
3
3
|
// Each code_* tool owns its complete promptGuidelines here.
|
|
4
4
|
// Runtime registration data (name, parameters, run) lives in specs.ts.
|
|
5
|
+
//
|
|
6
|
+
// Cross-tool steering is centralized (authored once on its natural-home tool) and
|
|
7
|
+
// some tools have empty promptGuidelines by design: all code_* tools are always
|
|
8
|
+
// active together, so a steering bullet on one tool is always co-visible. See
|
|
9
|
+
// docs/adr/0013-centralized-code-intelligence-prompt-steering-assumes-all-tools-active.md.
|
|
5
10
|
|
|
6
11
|
import type { CodeIntelligenceToolName } from "../types/index.ts";
|
|
7
12
|
|
|
@@ -19,94 +24,78 @@ export type CodeIntelligenceToolPromptSurfaceMap = Record<
|
|
|
19
24
|
export const CODE_INTELLIGENCE_TOOL_PROMPT_SURFACES: CodeIntelligenceToolPromptSurfaceMap = {
|
|
20
25
|
code_resolve: {
|
|
21
26
|
description:
|
|
22
|
-
"Resolve
|
|
27
|
+
"Resolve references to evidence-backed code targets and stable targetId/spanId handles for follow-up code_* tools. Accepts query/symbol/file or anchored file+line+character; anchored resolution snaps only to real provider-backed symbols, and whitespace/comment/non-symbol points fail with code_inspect guidance. No text-search fallback; ambiguous results return ranked candidates. Truncates at 2000 lines/50KB.",
|
|
23
28
|
promptSnippet: "code_resolve — resolve references into precise targets and target handles",
|
|
24
29
|
promptGuidelines: [
|
|
25
|
-
"Use code_resolve
|
|
26
|
-
"Prefer code_resolve as the entry point before code_orientation, code_graph, code_impact, or code_refactor_plan — its targetId replaces fragile file/line/character coordinates.",
|
|
27
|
-
"When code_resolve returns ambiguous results with ranked candidates, pick one and use file + line + character for follow-up resolution.",
|
|
30
|
+
"Use code_resolve first for ambiguous or symbol-only targets, before graph/impact/refactor/orientation; if resolve returns ranked candidates, narrow with a candidate file + line + character.",
|
|
28
31
|
],
|
|
29
32
|
},
|
|
30
33
|
code_inspect: {
|
|
31
34
|
description:
|
|
32
|
-
"Inspect one
|
|
35
|
+
"Inspect one exact file position for syntax, symbol, hover/definition, nearby diagnostics, and code-action titles. Requires file, line, and character; use for point facts, not broad orientation. Unavailable providers are disclosed; code actions are advisory only. Truncates at 2000 lines/50KB.",
|
|
33
36
|
promptSnippet: "code_inspect — factual point inspection",
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"Prefer code_inspect over code_orientation for point-level facts when no symbol target can be resolved.",
|
|
38
|
-
],
|
|
37
|
+
// No guidelines: selection is steered by code_orientation's bullet plus this
|
|
38
|
+
// self-sufficient description. See ADR 0013 (all code_* tools always active).
|
|
39
|
+
promptGuidelines: [],
|
|
39
40
|
},
|
|
40
41
|
code_orientation: {
|
|
41
42
|
description:
|
|
42
|
-
"
|
|
43
|
+
"Orient around the workspace, module, directory, file, or resolved symbol before surgical work. Omit focus for workspace orientation; use focus for a path/module, or targetId/focus+line+character for symbol orientation. Directory focus may surface local instruction files (CLAUDE.md, AGENTS.md). targetId wins and stale IDs error. Returns landmarks, docs, local diagnostics, and read-next guidance; relations/impact/health belong in code_graph/code_impact/code_health. maxResults caps lists; output is truncated to 2000 lines / 50KB.",
|
|
43
44
|
promptSnippet: "code_orientation — project/module/file/symbol orientation",
|
|
44
45
|
promptGuidelines: [
|
|
45
46
|
"Use `code_orientation({ focus })` for first-pass project/package/directory/file orientation before `bash`/`read`.",
|
|
47
|
+
"Use directory focus (for example `packages/foo`) to surface local instruction files before package work.",
|
|
46
48
|
"Use code_resolve first for bare symbol names, then pass the resulting targetId to code_orientation.",
|
|
47
49
|
"Use code_graph/code_impact/code_health for relations, impact, or full health instead of asking code_orientation for those sections.",
|
|
48
50
|
],
|
|
49
51
|
},
|
|
50
52
|
code_graph: {
|
|
51
53
|
description:
|
|
52
|
-
'
|
|
54
|
+
'Analyze relation evidence for a resolved target or coordinates: references, structural callees, imports/exports, implementations, and tests. Defaults to references; relations:["all"] expands all families. Per-relation substrate failures are disclosed. Callees are syntax/direct-scope source-shape calls, not symbol identity; calleeDepth:"deep" includes nested scopes. Scope narrows by workspace path; targetId from code_resolve is preferred. Truncates at 2000 lines/50KB.',
|
|
53
55
|
promptSnippet: "code_graph — semantic and structural relation graph",
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
"After code_graph, follow up with code_orientation on individual results for type or definition context.",
|
|
58
|
-
'Pass `calleeDepth: "deep"` to include callees from nested function/method/callback scopes (default `"direct"` excludes them).',
|
|
59
|
-
'Suggested relations by target kind: For functions/methods: `["references", "callees", "tests"]` — For interfaces/types/classes/enums: `["references", "implements"]` — For files/modules: `["imports", "exports"]` — For tests: `["tests"]`.',
|
|
60
|
-
],
|
|
56
|
+
// No guidelines: selection is steered by this self-sufficient description plus
|
|
57
|
+
// code_impact's "use code_graph instead of code_impact" bullet. See ADR 0013.
|
|
58
|
+
promptGuidelines: [],
|
|
61
59
|
},
|
|
62
60
|
code_impact: {
|
|
63
61
|
description:
|
|
64
|
-
"Estimate blast radius
|
|
62
|
+
"Estimate blast radius for a resolved target or user-supplied changeSetFiles before editing. changeSetFiles are explicit files, not inferred from git and no line-level diff; change-only requests report insufficient evidence. Uses semantic references plus deterministic test discovery when available; no heuristic search fallback. Output includes read-next guidance; truncates at 2000 lines/50KB.",
|
|
65
63
|
promptSnippet: "code_impact — blast radius and impact",
|
|
66
64
|
promptGuidelines: [
|
|
67
|
-
"Use code_impact
|
|
68
|
-
"Use code_graph instead of code_impact when you only need a plain reference list without impact analysis.",
|
|
65
|
+
"Use code_graph instead of code_impact when you only need a plain reference list.",
|
|
69
66
|
],
|
|
70
67
|
},
|
|
71
68
|
code_find: {
|
|
72
69
|
description:
|
|
73
|
-
'
|
|
70
|
+
'Search code with explicit modes: text literal (default), regex, semantic workspace-symbol, or ast structured. mode:"ast" requires `kind` (definition/import/export/call/type/interface/class/method/enum/test); text/regex/semantic reject kind. Semantic mode uses LSP only and does not silently fall back. AST call matches written call-site names, not by symbol identity; use code_graph references on a resolved target for symbol-identity-aware callers. Truncates at 2000 lines/50KB.',
|
|
74
71
|
promptSnippet: "code_find — unified ranked code search",
|
|
75
72
|
promptGuidelines: [
|
|
76
|
-
"Use code_find
|
|
77
|
-
'code_find with `mode: "ast"` requires `kind` and supports `definition`, `import`, `export`, `call`, `type`, `interface`, `class`, `method`, `enum`, and `test`.',
|
|
78
|
-
'code_find with `mode: "text"`, `mode: "regex"`, or `mode: "semantic"` does not accept `kind`.',
|
|
79
|
-
'code_find with `mode: "semantic"` does not fall back to text search and fails when semantic capability is unavailable.',
|
|
80
|
-
'AST `call` mode matches call-site identifiers by name only; use `code_graph` with `relations: ["references"]` on a resolved target for symbol-identity-aware callers.',
|
|
73
|
+
"Use code_find for explicit text, regex, semantic symbol, or AST search; use code_graph references for symbol-identity callers.",
|
|
81
74
|
],
|
|
82
75
|
},
|
|
83
76
|
code_refactor_plan: {
|
|
84
77
|
description:
|
|
85
|
-
|
|
78
|
+
"Preview a semantic refactor plan and return planId; never mutates files. Supports rename_symbol (rename alias) and extract_function/extract_variable when LSP returns precise edits. Requires targetId or anchored file+line+character, plus operation-specific newName/range. Apply separately with code_refactor_apply. Truncates at 2000 lines/50KB.",
|
|
86
79
|
promptSnippet: "code_refactor_plan — preview a precise workflow refactor plan",
|
|
87
80
|
promptGuidelines: [
|
|
88
|
-
|
|
89
|
-
'Use `operation: "extract_function"` or `"extract_variable"` with a 1-based `range` and `newName` when the LSP advertises precise extract code actions.',
|
|
90
|
-
"code_refactor_plan is a pure planner — it returns a planId. Use code_refactor_apply with that planId to execute.",
|
|
81
|
+
"Use code_refactor_plan to preview rename/extract edits only; mutate later with code_refactor_apply and the returned planId.",
|
|
91
82
|
],
|
|
92
83
|
},
|
|
93
84
|
code_refactor_apply: {
|
|
94
85
|
description:
|
|
95
|
-
"
|
|
86
|
+
"Apply a stored refactor plan by planId. Revalidates plan freshness and file fingerprints before mutating; does not compose new plans. Truncates at 2000 lines/50KB.",
|
|
96
87
|
promptSnippet: "code_refactor_apply — apply a stored refactor plan",
|
|
97
88
|
promptGuidelines: [
|
|
98
|
-
"Use code_refactor_apply
|
|
99
|
-
"Use code_refactor_plan first to obtain a planId, then code_refactor_apply to execute it.",
|
|
89
|
+
"Use code_refactor_apply only with a planId returned by code_refactor_plan.",
|
|
100
90
|
],
|
|
101
91
|
},
|
|
102
92
|
code_health: {
|
|
103
93
|
description:
|
|
104
|
-
"
|
|
94
|
+
"Report workspace health: diagnostics, language-server status, dirty files, coverage, and unused code. Use scope/include/level to narrow; refresh:true recovers stale diagnostics. Missing coverage/unused reports are disclosed. Truncates at 2000 lines/50KB.",
|
|
105
95
|
promptSnippet:
|
|
106
96
|
"code_health — diagnostics, server status, coverage, unused-code, and workspace health",
|
|
107
97
|
promptGuidelines: [
|
|
108
|
-
"Use code_health
|
|
109
|
-
"Pass `refresh: true` to code_health to recover stale diagnostics before checking.",
|
|
98
|
+
"Use code_health for diagnostics/server/dirty/coverage/unused health; pass refresh:true to code_health before relying on stale diagnostics.",
|
|
110
99
|
],
|
|
111
100
|
},
|
|
112
101
|
};
|
|
@@ -5,77 +5,19 @@
|
|
|
5
5
|
* readable markdown sections keyed by requested `include` values.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import type { CoverageWarningReport } from "../../analysis/coverage/coverage-warnings.ts";
|
|
9
|
-
import type { GitContext } from "../../analysis/signals/git.ts";
|
|
10
8
|
import { formatGitContext } from "../../analysis/signals/git.ts";
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export
|
|
22
|
-
|
|
23
|
-
errors: number;
|
|
24
|
-
warnings: number;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export interface HealthCoverageEntry {
|
|
28
|
-
file: string;
|
|
29
|
-
pct: number;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export interface HealthCoverageData {
|
|
33
|
-
available: boolean;
|
|
34
|
-
entries: HealthCoverageEntry[];
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export interface HealthUnusedExportEntry {
|
|
38
|
-
file: string;
|
|
39
|
-
name: string;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export interface HealthUnusedData {
|
|
43
|
-
available: boolean;
|
|
44
|
-
files: string[];
|
|
45
|
-
exports: HealthUnusedExportEntry[];
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/** A suggested code action at a specific diagnostic location. */
|
|
49
|
-
export interface CodeActionSuggestion {
|
|
50
|
-
file: string;
|
|
51
|
-
line: number;
|
|
52
|
-
title: string;
|
|
53
|
-
kind?: string;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export interface HealthData {
|
|
57
|
-
includedSections: HealthSection[];
|
|
58
|
-
lspAvailable: boolean;
|
|
59
|
-
lspStatus: string;
|
|
60
|
-
recovered: boolean;
|
|
61
|
-
/** Structural (tree-sitter) substrate readiness. Undefined when not evaluated. */
|
|
62
|
-
structuralStatus?: string;
|
|
63
|
-
diagnostics: HealthDiagnosticEntry[];
|
|
64
|
-
servers: HealthServerInfo[];
|
|
65
|
-
gitContext: GitContext | null;
|
|
66
|
-
scopeFilter: string | null;
|
|
67
|
-
level: "summary" | "detailed";
|
|
68
|
-
/** Code action suggestions collected from LSP (only populated in detailed mode). */
|
|
69
|
-
codeActions: CodeActionSuggestion[] | null;
|
|
70
|
-
coverage: HealthCoverageData | null;
|
|
71
|
-
unused: HealthUnusedData | null;
|
|
72
|
-
/** Coverage warnings for degraded semantic/structural substrate. Undefined when fully healthy. */
|
|
73
|
-
degradedCoverage?: CoverageWarningReport;
|
|
74
|
-
/** Seconds since diagnostics were last refreshed, or undefined if never refreshed. */
|
|
75
|
-
diagnosticAgeSeconds?: number;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export function renderHealthResult(data: HealthData, cwd: string): string {
|
|
9
|
+
import type { HealthData, HealthResultAssembly } from "../result/health.ts";
|
|
10
|
+
|
|
11
|
+
export type {
|
|
12
|
+
CodeActionSuggestion,
|
|
13
|
+
HealthCoverageData,
|
|
14
|
+
HealthData,
|
|
15
|
+
HealthSection,
|
|
16
|
+
HealthUnusedData,
|
|
17
|
+
} from "../result/health.ts";
|
|
18
|
+
|
|
19
|
+
export function renderHealthResult(result: HealthResultAssembly, cwd: string): string {
|
|
20
|
+
const data = result.data;
|
|
79
21
|
const lines: string[] = ["## Code Health", ""];
|
|
80
22
|
|
|
81
23
|
renderStatusLine(lines, data);
|
|
@@ -15,8 +15,8 @@ import {
|
|
|
15
15
|
gatherCoverageEvalInput,
|
|
16
16
|
} from "../../analysis/coverage/coverage-warnings.ts";
|
|
17
17
|
import { loadPrioritizationSignals } from "../../analysis/signals/project.ts";
|
|
18
|
-
import type { CodeIntelResult
|
|
19
|
-
import type
|
|
18
|
+
import type { CodeIntelResult } from "../../types/index.ts";
|
|
19
|
+
import { assembleHealthResult, type HealthData, type HealthSection } from "../result/health.ts";
|
|
20
20
|
import { renderHealthResult } from "./markdown.ts";
|
|
21
21
|
import { collectCodeActions, collectDiagnostics } from "./sections/diagnostics.ts";
|
|
22
22
|
import {
|
|
@@ -138,22 +138,14 @@ export async function executeHealth(
|
|
|
138
138
|
diagnosticAgeSeconds,
|
|
139
139
|
};
|
|
140
140
|
|
|
141
|
-
const
|
|
142
|
-
const content = renderHealthResult(
|
|
141
|
+
const assembly = assembleHealthResult(data, buildHealthEvidenceLists(gitContext));
|
|
142
|
+
const content = renderHealthResult(assembly, cwd);
|
|
143
143
|
|
|
144
144
|
return {
|
|
145
145
|
content,
|
|
146
146
|
details: {
|
|
147
147
|
type: "health",
|
|
148
|
-
data:
|
|
149
|
-
lspAvailable: data.lspAvailable,
|
|
150
|
-
lspStatus: data.lspStatus,
|
|
151
|
-
recovered: data.recovered,
|
|
152
|
-
structuralStatus: data.structuralStatus,
|
|
153
|
-
diagnosticFileCount: data.diagnostics.length,
|
|
154
|
-
serverCount: data.servers.length,
|
|
155
|
-
evidenceLists,
|
|
156
|
-
} satisfies HealthDetails,
|
|
148
|
+
data: assembly.details,
|
|
157
149
|
},
|
|
158
150
|
};
|
|
159
151
|
}
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
import * as path from "node:path";
|
|
5
5
|
import type { buildArchitectureModel } from "../../analysis/architecture/discovery.ts";
|
|
6
6
|
import { findModuleForPath, getDependents } from "../../analysis/architecture/model.ts";
|
|
7
|
-
import type { EvidenceListMetadata } from "../../analysis/evidence.ts";
|
|
8
7
|
import type { CodeProvider } from "../../analysis/provider.ts";
|
|
9
8
|
import type { ReferenceCollection } from "../../analysis/references/semantic-refs.ts";
|
|
10
9
|
import type { ResolvedTargetData } from "../../analysis/target/types.ts";
|
|
@@ -16,7 +15,6 @@ import {
|
|
|
16
15
|
type TestAnchorMap,
|
|
17
16
|
} from "../../analysis/tests/likely-tests.ts";
|
|
18
17
|
import { buildTestSurfaceDetails } from "../../analysis/tests/test-discovery.ts";
|
|
19
|
-
import type { AffectedDetails, ImpactDetails } from "../../types/index.ts";
|
|
20
18
|
import type { ImpactAnalysis } from "./types.ts";
|
|
21
19
|
|
|
22
20
|
// ── Shared analysis ────────────────────────────────────────────────────
|
|
@@ -220,28 +218,3 @@ export function computeOmittedCount(
|
|
|
220
218
|
): number {
|
|
221
219
|
return externalRefs + Math.max(0, affectedFileCount - (maxResults ?? 8));
|
|
222
220
|
}
|
|
223
|
-
|
|
224
|
-
// biome-ignore lint/complexity/useMaxParams: detail assembly keeps shared counts, queries, and signals explicit for both surfaces
|
|
225
|
-
export function buildDetailsData(
|
|
226
|
-
analysis: ImpactAnalysis,
|
|
227
|
-
directCount: number,
|
|
228
|
-
omittedCount: number,
|
|
229
|
-
nextQueries: string[],
|
|
230
|
-
prioritySignals: AffectedDetails["prioritySignals"],
|
|
231
|
-
evidenceLists: EvidenceListMetadata[] = [],
|
|
232
|
-
): AffectedDetails | ImpactDetails {
|
|
233
|
-
return {
|
|
234
|
-
confidence: analysis.confidence,
|
|
235
|
-
directCount,
|
|
236
|
-
downstreamCount: analysis.downstreamCount,
|
|
237
|
-
riskLevel: analysis.riskLevel,
|
|
238
|
-
checkNext: analysis.checkNext,
|
|
239
|
-
likelyTests: analysis.likelyTests,
|
|
240
|
-
likelyTestCommands: analysis.likelyTestCommands,
|
|
241
|
-
omittedCount,
|
|
242
|
-
evidenceLists,
|
|
243
|
-
nextQueries,
|
|
244
|
-
prioritySignals,
|
|
245
|
-
tests: analysis.tests,
|
|
246
|
-
};
|
|
247
|
-
}
|
|
@@ -10,7 +10,8 @@ import type { ResolvedTargetData } from "../../analysis/target/types.ts";
|
|
|
10
10
|
import type { ChangeSetFileEntry } from "../../analysis/tests/likely-tests.ts";
|
|
11
11
|
import { normalizeChangeSet } from "../../analysis/tests/likely-tests.ts";
|
|
12
12
|
import type { CodeIntelResult } from "../../types/index.ts";
|
|
13
|
-
import {
|
|
13
|
+
import { assembleImpactDetails } from "../result/impact.ts";
|
|
14
|
+
import { analyzeChangeSet, type ChangeSetSemanticImpact } from "./analysis.ts";
|
|
14
15
|
import { renderChangeSetImpact } from "./markdown.ts";
|
|
15
16
|
import { unavailableImpactResult } from "./result.ts";
|
|
16
17
|
import type { ImpactAnalysis, ImpactInput } from "./types.ts";
|
|
@@ -59,7 +60,7 @@ export async function executeChangeSetImpact(
|
|
|
59
60
|
prioritySignals,
|
|
60
61
|
}) + evidenceNote;
|
|
61
62
|
|
|
62
|
-
const detailsData =
|
|
63
|
+
const detailsData = assembleImpactDetails(
|
|
63
64
|
analysis,
|
|
64
65
|
changeSetFiles.length,
|
|
65
66
|
0,
|
|
@@ -30,6 +30,7 @@ export interface CodeImpactToolParams {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
/** Execute the public code_impact tool. */
|
|
33
|
+
// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: target workflow + pipeline orchestration stays together for clarity
|
|
33
34
|
export async function executeImpactTool(
|
|
34
35
|
params: CodeImpactToolParams,
|
|
35
36
|
ctx: CodeIntelToolExecCtx,
|
|
@@ -38,6 +39,32 @@ export async function executeImpactTool(
|
|
|
38
39
|
|
|
39
40
|
const hasChangeSetInputs = (params.changeSetFiles?.length ?? 0) > 0 || Boolean(params.change);
|
|
40
41
|
|
|
42
|
+
// ── Deep seam: resolve targetId through the session target workflow ──
|
|
43
|
+
// Replaces expandTargetId pipeline stage for targetId expansion.
|
|
44
|
+
if (!hasChangeSetInputs && params.targetId) {
|
|
45
|
+
const outcome = await ctx.session.resolveTarget(
|
|
46
|
+
{ targetId: params.targetId },
|
|
47
|
+
{ fileLevelAllowed: false, nameAnchorRequired: false, waitForSemantic: false },
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
if (outcome.kind === "resolved") {
|
|
51
|
+
params.file = outcome.entry.file;
|
|
52
|
+
params.line = outcome.entry.displayLine;
|
|
53
|
+
params.character = outcome.entry.displayCharacter;
|
|
54
|
+
params.symbol = outcome.entry.name ?? undefined;
|
|
55
|
+
} else if (outcome.kind !== "no-target") {
|
|
56
|
+
const msg =
|
|
57
|
+
outcome.kind === "invalid-input"
|
|
58
|
+
? outcome.message
|
|
59
|
+
: outcome.kind === "unavailable"
|
|
60
|
+
? outcome.reason
|
|
61
|
+
: "Target resolution failed. Verify the targetId is valid.";
|
|
62
|
+
return impactErrorResult(msg, {
|
|
63
|
+
nextQueries: ["Use `code_resolve` to resolve a target first"],
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
41
68
|
return runPipe(
|
|
42
69
|
params,
|
|
43
70
|
ctx,
|
|
@@ -8,7 +8,8 @@ import { summarizePrioritySignalsForFiles } from "../../analysis/signals/project
|
|
|
8
8
|
import type { ResolvedTargetGroupData } from "../../analysis/target/types.ts";
|
|
9
9
|
import { buildTestAnchorMap } from "../../analysis/tests/likely-tests.ts";
|
|
10
10
|
import type { CodeIntelResult } from "../../types/index.ts";
|
|
11
|
-
import {
|
|
11
|
+
import { assembleImpactDetails } from "../result/impact.ts";
|
|
12
|
+
import { analyzeReferenceImpact, computeOmittedCount } from "./analysis.ts";
|
|
12
13
|
import { renderImpactFileLevel } from "./markdown.ts";
|
|
13
14
|
import type { ImpactInput } from "./types.ts";
|
|
14
15
|
|
|
@@ -60,7 +61,7 @@ export async function executeFileLevelImpact(
|
|
|
60
61
|
cwd,
|
|
61
62
|
});
|
|
62
63
|
|
|
63
|
-
const detailsData =
|
|
64
|
+
const detailsData = assembleImpactDetails(
|
|
64
65
|
analysis,
|
|
65
66
|
aggregated.refs.length,
|
|
66
67
|
computeOmittedCount(analysis.externalRefs, analysis.affectedFiles.size, input.maxResults),
|
|
@@ -1,21 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export function unavailableImpactResult(content: string, nextQueries: string[]): CodeIntelResult {
|
|
4
|
-
return {
|
|
5
|
-
content,
|
|
6
|
-
details: {
|
|
7
|
-
type: "impact",
|
|
8
|
-
data: {
|
|
9
|
-
confidence: "unavailable",
|
|
10
|
-
directCount: 0,
|
|
11
|
-
downstreamCount: 0,
|
|
12
|
-
riskLevel: "low" as const,
|
|
13
|
-
checkNext: [],
|
|
14
|
-
likelyTests: [],
|
|
15
|
-
likelyTestCommands: [],
|
|
16
|
-
omittedCount: 0,
|
|
17
|
-
nextQueries,
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
}
|
|
1
|
+
/** Compatibility export for impact result assembly. */
|
|
2
|
+
export { unavailableImpactResult } from "../result/impact.ts";
|
|
@@ -10,7 +10,8 @@ import { summarizePrioritySignalsForFiles } from "../../analysis/signals/project
|
|
|
10
10
|
import type { ResolvedTargetData } from "../../analysis/target/types.ts";
|
|
11
11
|
import { buildTestAnchorMap } from "../../analysis/tests/likely-tests.ts";
|
|
12
12
|
import type { CodeIntelResult } from "../../types/index.ts";
|
|
13
|
-
import {
|
|
13
|
+
import { assembleImpactDetails } from "../result/impact.ts";
|
|
14
|
+
import { analyzeReferenceImpact, computeOmittedCount } from "./analysis.ts";
|
|
14
15
|
import { renderImpactSingle } from "./markdown.ts";
|
|
15
16
|
import type { ImpactInput } from "./types.ts";
|
|
16
17
|
|
|
@@ -58,7 +59,7 @@ export async function executeSingleImpact(
|
|
|
58
59
|
items: refs.refs,
|
|
59
60
|
maxResults,
|
|
60
61
|
}).metadata;
|
|
61
|
-
const detailsData =
|
|
62
|
+
const detailsData = assembleImpactDetails(
|
|
62
63
|
analysis,
|
|
63
64
|
refs.refs.length,
|
|
64
65
|
computeOmittedCount(analysis.externalRefs, analysis.affectedFiles.size, input.maxResults),
|