@mrclrchtr/supi-code-intelligence 11.1.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 +41 -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 +81 -7
- 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/node_modules/semver/LICENSE +15 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/README.md +680 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/bin/semver.js +195 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/classes/comparator.js +143 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/classes/index.js +7 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/classes/range.js +577 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/classes/semver.js +350 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/clean.js +8 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/cmp.js +54 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/coerce.js +62 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/compare-build.js +9 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/compare-loose.js +5 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/compare.js +7 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/diff.js +60 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/eq.js +5 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/gt.js +5 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/gte.js +5 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/inc.js +21 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/lt.js +5 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/lte.js +5 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/major.js +5 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/minor.js +5 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/neq.js +5 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/parse.js +18 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/patch.js +5 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/prerelease.js +8 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/rcompare.js +5 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/rsort.js +5 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/satisfies.js +12 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/sort.js +5 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/truncate.js +48 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/valid.js +8 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/index.js +93 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/internal/constants.js +37 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/internal/debug.js +11 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/internal/identifiers.js +29 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/internal/lrucache.js +42 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/internal/parse-options.js +17 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/internal/re.js +223 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/package.json +78 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/preload.js +4 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/range.bnf +17 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/ranges/gtr.js +6 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/ranges/intersects.js +9 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/ranges/ltr.js +6 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/ranges/max-satisfying.js +27 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/ranges/min-satisfying.js +26 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/ranges/min-version.js +63 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/ranges/outside.js +82 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/ranges/simplify.js +49 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/ranges/subset.js +249 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/ranges/to-comparators.js +10 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/ranges/valid.js +13 -0
- package/node_modules/@mrclrchtr/supi-lsp/package.json +5 -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 +174 -49
- package/node_modules/@mrclrchtr/supi-lsp/src/config/config.ts +53 -2
- package/node_modules/@mrclrchtr/supi-lsp/src/config/operation-support.ts +19 -4
- package/node_modules/@mrclrchtr/supi-lsp/src/config/server-config.ts +22 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/config/typescript-launch.ts +276 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/diagnostics/evidence.ts +2 -2
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-project-info.ts +22 -10
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-workspace-symbol.ts +157 -23
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager.ts +306 -75
- package/node_modules/@mrclrchtr/supi-lsp/src/provider/refactor-planning.ts +4 -3
- package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-controller.ts +2 -2
- 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/scanner.ts +27 -15
- 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/capability/capability-warnings.ts +18 -12
- package/src/analysis/health/check.ts +115 -0
- package/src/analysis/health/diagnostics.ts +3 -0
- package/src/analysis/health/file-scope.ts +2 -3
- package/src/analysis/health/semantic-state.ts +38 -0
- package/src/analysis/health/server-status.ts +14 -2
- package/src/analysis/health/signals.ts +2 -0
- package/src/analysis/health/status.ts +82 -0
- package/src/analysis/refactor/apply.ts +17 -8
- 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/health-types.ts +7 -0
- package/src/session/health-workflow.ts +8 -43
- 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 +184 -20
- package/src/session/orientation/context-facts.ts +27 -2
- package/src/session/orientation/context-sections.ts +49 -3
- package/src/session/orientation/facts.ts +132 -0
- package/src/session/orientation/gather.ts +98 -11
- package/src/session/orientation/workspace-context.ts +16 -6
- package/src/session/orientation-types.ts +8 -0
- package/src/session/orientation-workflow.ts +20 -6
- package/src/session/refactor-identity.ts +76 -0
- package/src/session/refactor-plans.ts +5 -2
- package/src/session/refactor-workflow.ts +15 -17
- 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/guidance.ts +1 -1
- 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/markdown.ts +12 -2
- package/src/tool/code_health/result.ts +18 -3
- package/src/tool/code_health/spec.ts +5 -3
- package/src/tool/code_health/structured-schema.ts +250 -0
- package/src/tool/code_health/structured.ts +256 -0
- package/src/tool/code_inspect/result.ts +11 -5
- package/src/tool/code_inspect/spec.ts +7 -1
- package/src/tool/code_inspect/structured.ts +231 -0
- package/src/tool/code_orientation/execute.ts +1 -1
- package/src/tool/code_orientation/result.ts +31 -8
- package/src/tool/code_orientation/spec.ts +2 -0
- package/src/tool/code_orientation/structured-schema.ts +617 -0
- package/src/tool/code_orientation/structured-workspace.ts +194 -0
- package/src/tool/code_orientation/structured.ts +189 -0
- package/src/tool/code_orientation/workspace-format.ts +2 -5
- package/src/tool/code_orientation/workspace-observations.ts +81 -0
- package/src/tool/code_orientation/workspace-output.ts +5 -0
- package/src/tool/code_orientation/workspace-projects.ts +16 -31
- package/src/tool/code_orientation/workspace-sections.ts +46 -32
- package/src/tool/code_refactor_apply/execute.ts +1 -1
- package/src/tool/code_refactor_apply/result.ts +14 -6
- package/src/tool/code_refactor_apply/spec.ts +2 -0
- package/src/tool/code_refactor_apply/structured.ts +49 -0
- package/src/tool/code_refactor_plan/result.ts +18 -9
- package/src/tool/code_refactor_plan/spec.ts +2 -0
- package/src/tool/code_refactor_plan/structured.ts +127 -0
- 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 +12 -6
- package/src/ui/status-command.ts +147 -322
- package/src/ui/status-overlay.ts +584 -421
- package/src/ui/status-presentation.ts +108 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { FileEdit } from "@mrclrchtr/supi-code-runtime/api";
|
|
2
2
|
import { createEvidenceList, type EvidenceList } from "../../analysis/evidence.ts";
|
|
3
3
|
import type { ApplyResult } from "../../analysis/refactor/apply.ts";
|
|
4
|
+
import { toDisplayPath } from "../../analysis/search/paths.ts";
|
|
4
5
|
import type { RefactorPlan } from "../../session/refactor-plans.ts";
|
|
5
6
|
import { assembledNextQueries, assembleToolResult, type ToolResultAssembly } from "./assembly.ts";
|
|
6
7
|
import { createToolDisplaySection } from "./display.ts";
|
|
@@ -29,10 +30,10 @@ export interface RefactorApplyResultAssembly {
|
|
|
29
30
|
readonly displaySections: readonly ToolDisplaySection[];
|
|
30
31
|
}
|
|
31
32
|
|
|
32
|
-
function formatEdit(edit: FileEdit): string {
|
|
33
|
+
function formatEdit(edit: FileEdit, cwd: string): string {
|
|
33
34
|
const range = edit.range;
|
|
34
35
|
const replacement = edit.newText.replace(/\n/g, " ↵ ");
|
|
35
|
-
return `${edit.file} L${range.start.line + 1}:${range.start.character + 1} → L${range.end.line + 1}:${range.end.character + 1}: ${replacement}`;
|
|
36
|
+
return `${toDisplayPath(cwd, edit.file)} L${range.start.line + 1}:${range.start.character + 1} → L${range.end.line + 1}:${range.end.character + 1}: ${replacement}`;
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
/** Assemble a bounded refactor plan and all facts needed by its renderers. */
|
|
@@ -82,7 +83,7 @@ export function assembleRefactorPlanDetails(
|
|
|
82
83
|
totalCount: edits.metadata.totalCount,
|
|
83
84
|
omittedCount: edits.metadata.omittedCount,
|
|
84
85
|
partialReason: edits.metadata.partialReason,
|
|
85
|
-
format: formatEdit,
|
|
86
|
+
format: (edit) => formatEdit(edit, cwd),
|
|
86
87
|
}),
|
|
87
88
|
],
|
|
88
89
|
details: {
|
|
@@ -100,6 +101,7 @@ export function assembleRefactorPlanDetails(
|
|
|
100
101
|
export function assembleRefactorApplyDetails(
|
|
101
102
|
applyResult: ApplyResult,
|
|
102
103
|
plan: Readonly<RefactorPlan>,
|
|
104
|
+
cwd: string,
|
|
103
105
|
): RefactorApplyResultAssembly {
|
|
104
106
|
const candidateCount = applyResult.kind === "applied" ? applyResult.totalEdits : 0;
|
|
105
107
|
const evidenceSource = plan.evidenceSource ?? "semantic";
|
|
@@ -133,7 +135,8 @@ export function assembleRefactorApplyDetails(
|
|
|
133
135
|
provenance,
|
|
134
136
|
});
|
|
135
137
|
|
|
136
|
-
const
|
|
138
|
+
const recoveryFiles = [...new Set(plan.edits.edits.map((edit) => edit.file))];
|
|
139
|
+
const changedFiles = recoveryFiles.map((file) => toDisplayPath(cwd, file));
|
|
137
140
|
|
|
138
141
|
return {
|
|
139
142
|
assembled,
|
|
@@ -156,7 +159,7 @@ export function assembleRefactorApplyDetails(
|
|
|
156
159
|
omittedCount: assembled.totals.omittedCount,
|
|
157
160
|
evidenceLists: [...assembled.evidenceLists],
|
|
158
161
|
nextQueries: assembledNextQueries(assembled),
|
|
159
|
-
...(applyResult.kind === "applied" ? { changedFiles } : {}),
|
|
162
|
+
...(applyResult.kind === "applied" ? { changedFiles, recoveryFiles } : {}),
|
|
160
163
|
},
|
|
161
164
|
};
|
|
162
165
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { StringEnum } from "@earendil-works/pi-ai";
|
|
2
1
|
import { Type } from "typebox";
|
|
3
2
|
|
|
4
3
|
/** Collection confidence, independent of result completeness. */
|
|
5
|
-
export const ConfidenceSchema =
|
|
4
|
+
export const ConfidenceSchema = Type.Enum(["semantic", "structural", "heuristic", "unavailable"], {
|
|
5
|
+
type: "string",
|
|
6
|
+
});
|
|
6
7
|
|
|
7
8
|
/** Canonical evidence counts; null totals mean collection could not establish completeness. */
|
|
8
9
|
export const EvidenceListSchema = Type.Object(
|
|
@@ -34,16 +35,18 @@ export const NavigationTargetSchema = Type.Object(
|
|
|
34
35
|
file: Type.String(),
|
|
35
36
|
line: Type.Integer(),
|
|
36
37
|
character: Type.Integer(),
|
|
37
|
-
anchorKind:
|
|
38
|
+
anchorKind: Type.Enum(["name", "declaration"], { type: "string" }),
|
|
38
39
|
container: Type.Optional(Type.Union([Type.String(), Type.Null()])),
|
|
39
40
|
confidence: Type.Optional(ConfidenceSchema),
|
|
40
|
-
provenance: Type.Optional(
|
|
41
|
+
provenance: Type.Optional(
|
|
42
|
+
Type.Array(Type.Enum(["semantic", "structural"], { type: "string" })),
|
|
43
|
+
),
|
|
41
44
|
resolution: Type.Optional(
|
|
42
45
|
Type.Object({
|
|
43
46
|
requested: Type.Object({ line: Type.Integer(), character: Type.Integer() }),
|
|
44
47
|
resolved: Type.Object({ line: Type.Integer(), character: Type.Integer() }),
|
|
45
48
|
snapped: Type.Boolean(),
|
|
46
|
-
source:
|
|
49
|
+
source: Type.Enum(["semantic", "structural", "structural-identifier"], { type: "string" }),
|
|
47
50
|
}),
|
|
48
51
|
),
|
|
49
52
|
},
|
package/src/tool/result/types.ts
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
CodeQueryPartialMetadata,
|
|
3
|
-
ConfidenceMode,
|
|
4
|
-
SourceRange,
|
|
5
|
-
} from "@mrclrchtr/supi-code-runtime/api";
|
|
1
|
+
import type { ConfidenceMode, SourceRange } from "@mrclrchtr/supi-code-runtime/api";
|
|
6
2
|
import type { CapabilityWarningReport } from "../../analysis/capability/capability-warnings.ts";
|
|
7
3
|
import type { EvidenceListMetadata } from "../../analysis/evidence.ts";
|
|
8
4
|
import type { InstructionFilesMetadata } from "../../analysis/instruction-files.ts";
|
|
9
5
|
import type { ReadNextItem } from "../../analysis/read-next.ts";
|
|
6
|
+
import type { AutomaticPathExclusionDisplay } from "../../analysis/search/exclusions.ts";
|
|
10
7
|
import type {
|
|
11
8
|
StructuredFailure,
|
|
12
9
|
StructuredMatch,
|
|
@@ -75,23 +72,26 @@ export interface ToolDisplaySection {
|
|
|
75
72
|
export type AnchoredResolutionSource = "semantic" | "structural" | "structural-identifier";
|
|
76
73
|
|
|
77
74
|
/**
|
|
78
|
-
*
|
|
75
|
+
* Immutable resolution metadata for the current anchored request, not target history.
|
|
76
|
+
* Symbol, file, and handle selectors do not inherit an earlier request's metadata.
|
|
79
77
|
*
|
|
80
78
|
* Records the requested coordinate, the resolved anchor coordinate, whether
|
|
81
79
|
* the resolved anchor differs from the request (a snap), and the
|
|
82
|
-
* provider-backed evidence source.
|
|
80
|
+
* provider-backed evidence source. Normalizing an interior identifier position
|
|
81
|
+
* to its name anchor is a snap even when the symbol match is exact.
|
|
82
|
+
* Structured details always carry this when
|
|
83
83
|
* a target was resolved from coordinates; markdown surfaces a note only when
|
|
84
84
|
* the resolution was non-obvious (snapped or degraded).
|
|
85
85
|
*/
|
|
86
86
|
export interface AnchoredResolutionMetadata {
|
|
87
87
|
/** The 1-based coordinate the caller requested. */
|
|
88
|
-
requested: { line: number; character: number };
|
|
88
|
+
readonly requested: { readonly line: number; readonly character: number };
|
|
89
89
|
/** The 1-based anchor coordinate the target was resolved to. */
|
|
90
|
-
resolved: { line: number; character: number };
|
|
90
|
+
readonly resolved: { readonly line: number; readonly character: number };
|
|
91
91
|
/** Whether the resolved anchor differs from the requested coordinate. */
|
|
92
|
-
snapped: boolean;
|
|
92
|
+
readonly snapped: boolean;
|
|
93
93
|
/** Provider-backed evidence source that identified the target. */
|
|
94
|
-
source: AnchoredResolutionSource;
|
|
94
|
+
readonly source: AnchoredResolutionSource;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
/** Structured details metadata for relationship and pattern results. */
|
|
@@ -102,8 +102,10 @@ export interface SearchDetails {
|
|
|
102
102
|
omittedCount: number;
|
|
103
103
|
evidenceLists?: EvidenceListMetadata[];
|
|
104
104
|
nextQueries: string[];
|
|
105
|
-
/**
|
|
105
|
+
/** Display paths successfully changed by `code_refactor_apply`; never use as document identities. */
|
|
106
106
|
changedFiles?: readonly string[];
|
|
107
|
+
/** Original provider document paths for post-Apply synchronization; never render or canonicalize. */
|
|
108
|
+
recoveryFiles?: readonly string[];
|
|
107
109
|
/** Present for AST mode; declares the operation-specific source-file universe and completeness. */
|
|
108
110
|
scan?: StructuredScanSummary;
|
|
109
111
|
/** Source-mapped structural matches returned by AST mode. */
|
|
@@ -111,7 +113,7 @@ export interface SearchDetails {
|
|
|
111
113
|
/** Per-file structural failures, including available syntax recovery ranges. */
|
|
112
114
|
structuralFailures?: readonly StructuredFailure[];
|
|
113
115
|
/** Structured disclosure for semantic results removed by the automatic path policy. */
|
|
114
|
-
automaticPathExclusion?:
|
|
116
|
+
automaticPathExclusion?: AutomaticPathExclusionDisplay;
|
|
115
117
|
}
|
|
116
118
|
|
|
117
119
|
// Canonical disambiguation candidate — re-exported from resolution/types.ts
|
|
@@ -158,7 +160,7 @@ export interface ResolveDetails {
|
|
|
158
160
|
anchorKind: AnchorKind;
|
|
159
161
|
confidence: ConfidenceMode;
|
|
160
162
|
provenance: readonly TargetProviderProvenance[];
|
|
161
|
-
/** Resolution
|
|
163
|
+
/** Resolution observation for this anchored request only. */
|
|
162
164
|
resolution?: AnchoredResolutionMetadata;
|
|
163
165
|
}>;
|
|
164
166
|
/** Disambiguation candidates from the resolve service. */
|
|
@@ -211,6 +213,8 @@ export interface ContextDetails {
|
|
|
211
213
|
* File paths are absolute; compute relative paths at render time.
|
|
212
214
|
*/
|
|
213
215
|
target?: TargetStoreEntry;
|
|
216
|
+
/** Resolution observation for this anchored focus only. */
|
|
217
|
+
resolution?: AnchoredResolutionMetadata;
|
|
214
218
|
/**
|
|
215
219
|
* Bounded candidates with targetIds when target selection is ambiguous or
|
|
216
220
|
* has a Symbol-kind mismatch. No task sections are rendered in that case.
|
package/src/tool/schemas.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { StringEnum } from "@earendil-works/pi-ai";
|
|
2
1
|
import { type TSchema, Type } from "typebox";
|
|
3
2
|
import {
|
|
4
3
|
PUBLIC_REFACTOR_OPERATION_NAMES,
|
|
@@ -46,7 +45,8 @@ const SymbolTargetParam = Type.Object(
|
|
|
46
45
|
query: QueryParam,
|
|
47
46
|
scope: Type.Optional(ScopeParam),
|
|
48
47
|
symbolKind: Type.Optional(
|
|
49
|
-
|
|
48
|
+
Type.Enum(TARGET_SYMBOL_KINDS, {
|
|
49
|
+
type: "string",
|
|
50
50
|
description: "LSP SymbolKind filter; omit when uncertain.",
|
|
51
51
|
}),
|
|
52
52
|
),
|
|
@@ -85,7 +85,7 @@ export const ResolveTargetParam = exactOneSelector(
|
|
|
85
85
|
|
|
86
86
|
export const GraphTargetParam = exactOneSelector(
|
|
87
87
|
{
|
|
88
|
-
handle: Type.String({ description: "Target handle
|
|
88
|
+
handle: Type.String({ description: "Target handle from a previous code tool result." }),
|
|
89
89
|
anchor: SourcePointParam,
|
|
90
90
|
symbol: SymbolTargetParam,
|
|
91
91
|
},
|
|
@@ -94,7 +94,7 @@ export const GraphTargetParam = exactOneSelector(
|
|
|
94
94
|
|
|
95
95
|
const OrientationTargetParam = exactOneSelector(
|
|
96
96
|
{
|
|
97
|
-
handle: Type.String({ description: "Target handle
|
|
97
|
+
handle: Type.String({ description: "Target handle from a previous code tool result." }),
|
|
98
98
|
anchor: SourcePointParam,
|
|
99
99
|
symbol: SymbolTargetParam,
|
|
100
100
|
},
|
|
@@ -114,7 +114,7 @@ export const OrientationFocusParam = exactOneSelector(
|
|
|
114
114
|
|
|
115
115
|
export const RefactorTargetParam = exactOneSelector(
|
|
116
116
|
{
|
|
117
|
-
handle: Type.String({ description: "Target handle
|
|
117
|
+
handle: Type.String({ description: "Target handle from a previous code tool result." }),
|
|
118
118
|
anchor: SourcePointParam,
|
|
119
119
|
},
|
|
120
120
|
"Exactly one refactor target.",
|
|
@@ -147,7 +147,13 @@ const RefactorOperationProperties = {
|
|
|
147
147
|
{ additionalProperties: false },
|
|
148
148
|
),
|
|
149
149
|
update_imports: Type.Object({}, { additionalProperties: false }),
|
|
150
|
-
delete_dead_code: Type.Object(
|
|
150
|
+
delete_dead_code: Type.Object(
|
|
151
|
+
{},
|
|
152
|
+
{
|
|
153
|
+
additionalProperties: false,
|
|
154
|
+
description: "Remove server-supported unused code; support may be limited to unused imports.",
|
|
155
|
+
},
|
|
156
|
+
),
|
|
151
157
|
} satisfies Record<PublicRefactorOperationName, TSchema>;
|
|
152
158
|
|
|
153
159
|
export const RefactorOperationParam = exactOneSelector(
|