@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.
Files changed (199) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +41 -6
  3. package/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
  4. package/node_modules/@mrclrchtr/supi-code-runtime/src/capability/types.ts +3 -1
  5. package/node_modules/@mrclrchtr/supi-code-runtime/src/query-result.ts +9 -0
  6. package/node_modules/@mrclrchtr/supi-core/package.json +1 -1
  7. package/node_modules/@mrclrchtr/supi-core/src/child-web-tools.ts +110 -0
  8. package/node_modules/@mrclrchtr/supi-core/src/session.ts +11 -0
  9. package/node_modules/@mrclrchtr/supi-lsp/README.md +81 -7
  10. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
  11. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/capability/types.ts +3 -1
  12. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/query-result.ts +9 -0
  13. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/package.json +1 -1
  14. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/child-web-tools.ts +110 -0
  15. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/session.ts +11 -0
  16. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/LICENSE +15 -0
  17. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/README.md +680 -0
  18. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/bin/semver.js +195 -0
  19. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/classes/comparator.js +143 -0
  20. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/classes/index.js +7 -0
  21. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/classes/range.js +577 -0
  22. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/classes/semver.js +350 -0
  23. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/clean.js +8 -0
  24. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/cmp.js +54 -0
  25. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/coerce.js +62 -0
  26. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/compare-build.js +9 -0
  27. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/compare-loose.js +5 -0
  28. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/compare.js +7 -0
  29. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/diff.js +60 -0
  30. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/eq.js +5 -0
  31. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/gt.js +5 -0
  32. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/gte.js +5 -0
  33. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/inc.js +21 -0
  34. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/lt.js +5 -0
  35. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/lte.js +5 -0
  36. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/major.js +5 -0
  37. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/minor.js +5 -0
  38. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/neq.js +5 -0
  39. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/parse.js +18 -0
  40. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/patch.js +5 -0
  41. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/prerelease.js +8 -0
  42. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/rcompare.js +5 -0
  43. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/rsort.js +5 -0
  44. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/satisfies.js +12 -0
  45. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/sort.js +5 -0
  46. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/truncate.js +48 -0
  47. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/functions/valid.js +8 -0
  48. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/index.js +93 -0
  49. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/internal/constants.js +37 -0
  50. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/internal/debug.js +11 -0
  51. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/internal/identifiers.js +29 -0
  52. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/internal/lrucache.js +42 -0
  53. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/internal/parse-options.js +17 -0
  54. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/internal/re.js +223 -0
  55. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/package.json +78 -0
  56. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/preload.js +4 -0
  57. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/range.bnf +17 -0
  58. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/ranges/gtr.js +6 -0
  59. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/ranges/intersects.js +9 -0
  60. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/ranges/ltr.js +6 -0
  61. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/ranges/max-satisfying.js +27 -0
  62. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/ranges/min-satisfying.js +26 -0
  63. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/ranges/min-version.js +63 -0
  64. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/ranges/outside.js +82 -0
  65. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/ranges/simplify.js +49 -0
  66. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/ranges/subset.js +249 -0
  67. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/ranges/to-comparators.js +10 -0
  68. package/node_modules/@mrclrchtr/supi-lsp/node_modules/semver/ranges/valid.js +13 -0
  69. package/node_modules/@mrclrchtr/supi-lsp/package.json +5 -3
  70. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-collection.ts +11 -4
  71. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostics.ts +77 -6
  72. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-input-admission.ts +149 -0
  73. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-typescript-project.ts +40 -0
  74. package/node_modules/@mrclrchtr/supi-lsp/src/client/client.ts +174 -49
  75. package/node_modules/@mrclrchtr/supi-lsp/src/config/config.ts +53 -2
  76. package/node_modules/@mrclrchtr/supi-lsp/src/config/operation-support.ts +19 -4
  77. package/node_modules/@mrclrchtr/supi-lsp/src/config/server-config.ts +22 -0
  78. package/node_modules/@mrclrchtr/supi-lsp/src/config/typescript-launch.ts +276 -0
  79. package/node_modules/@mrclrchtr/supi-lsp/src/diagnostics/evidence.ts +2 -2
  80. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-project-info.ts +22 -10
  81. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-workspace-symbol.ts +157 -23
  82. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager.ts +306 -75
  83. package/node_modules/@mrclrchtr/supi-lsp/src/provider/refactor-planning.ts +4 -3
  84. package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-controller.ts +2 -2
  85. package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-registry.ts +19 -2
  86. package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-rename.ts +1 -0
  87. package/node_modules/@mrclrchtr/supi-lsp/src/session/scanner.ts +27 -15
  88. package/node_modules/@mrclrchtr/supi-lsp/src/session/workspace-lsp-runtime.ts +5 -1
  89. package/node_modules/@mrclrchtr/supi-tree-sitter/README.md +2 -2
  90. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
  91. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/capability/types.ts +3 -1
  92. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/query-result.ts +9 -0
  93. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/package.json +1 -1
  94. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/child-web-tools.ts +110 -0
  95. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/session.ts +11 -0
  96. package/node_modules/@mrclrchtr/supi-tree-sitter/package.json +3 -3
  97. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/tsx/tree-sitter-tsx.wasm +0 -0
  98. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/tsx/tree-sitter-tsx.wasm.json +5 -1
  99. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/typescript/tree-sitter-typescript.wasm +0 -0
  100. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/typescript/tree-sitter-typescript.wasm.json +5 -1
  101. package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/call-sites.ts +40 -25
  102. package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/callees.ts +2 -0
  103. package/node_modules/@mrclrchtr/supi-tree-sitter/src/worker/call-context.ts +44 -0
  104. package/package.json +6 -5
  105. package/src/analysis/capability/capability-warnings.ts +18 -12
  106. package/src/analysis/health/check.ts +115 -0
  107. package/src/analysis/health/diagnostics.ts +3 -0
  108. package/src/analysis/health/file-scope.ts +2 -3
  109. package/src/analysis/health/semantic-state.ts +38 -0
  110. package/src/analysis/health/server-status.ts +14 -2
  111. package/src/analysis/health/signals.ts +2 -0
  112. package/src/analysis/health/status.ts +82 -0
  113. package/src/analysis/refactor/apply.ts +17 -8
  114. package/src/analysis/search/exclusions.ts +47 -0
  115. package/src/analysis/search/paths.ts +32 -9
  116. package/src/analysis/target/anchored-structural.ts +3 -8
  117. package/src/analysis/target/anchored.ts +4 -20
  118. package/src/analysis/target/identity.ts +1 -1
  119. package/src/analysis/target/latex-label-container.ts +6 -6
  120. package/src/analysis/target/latex-section-anchor.ts +6 -6
  121. package/src/analysis/target/resolution.ts +18 -0
  122. package/src/analysis/target/symbol.ts +39 -11
  123. package/src/analysis/target/types.ts +6 -1
  124. package/src/extension.ts +17 -11
  125. package/src/session/graph/collect.ts +1 -10
  126. package/src/session/graph-types.ts +2 -0
  127. package/src/session/graph-workflow.ts +1 -0
  128. package/src/session/health-types.ts +7 -0
  129. package/src/session/health-workflow.ts +8 -43
  130. package/src/session/inspect/collect.ts +8 -2
  131. package/src/session/inspect/file-point.ts +2 -3
  132. package/src/session/inspect-workflow.ts +1 -1
  133. package/src/session/orientation/collect.ts +184 -20
  134. package/src/session/orientation/context-facts.ts +27 -2
  135. package/src/session/orientation/context-sections.ts +49 -3
  136. package/src/session/orientation/facts.ts +132 -0
  137. package/src/session/orientation/gather.ts +98 -11
  138. package/src/session/orientation/workspace-context.ts +16 -6
  139. package/src/session/orientation-types.ts +8 -0
  140. package/src/session/orientation-workflow.ts +20 -6
  141. package/src/session/refactor-identity.ts +76 -0
  142. package/src/session/refactor-plans.ts +5 -2
  143. package/src/session/refactor-workflow.ts +15 -17
  144. package/src/session/target-store.ts +3 -18
  145. package/src/session/target-workflow.ts +33 -16
  146. package/src/substrate/lsp/recovery.ts +5 -5
  147. package/src/tool/code_find/guidance.ts +1 -1
  148. package/src/tool/code_find/render.ts +8 -4
  149. package/src/tool/code_find/result.ts +78 -6
  150. package/src/tool/code_find/spec.ts +4 -3
  151. package/src/tool/code_find/structured.ts +25 -9
  152. package/src/tool/code_graph/details.ts +1 -0
  153. package/src/tool/code_graph/display.ts +1 -1
  154. package/src/tool/code_graph/guidance.ts +1 -1
  155. package/src/tool/code_graph/markdown.ts +11 -6
  156. package/src/tool/code_graph/read-next.ts +38 -9
  157. package/src/tool/code_graph/reference-selection.ts +30 -0
  158. package/src/tool/code_graph/result.ts +25 -118
  159. package/src/tool/code_graph/section.ts +133 -0
  160. package/src/tool/code_graph/spec.ts +3 -3
  161. package/src/tool/code_graph/structured.ts +17 -6
  162. package/src/tool/code_health/display-paths.ts +92 -0
  163. package/src/tool/code_health/file-scope-markdown.ts +3 -2
  164. package/src/tool/code_health/markdown.ts +12 -2
  165. package/src/tool/code_health/result.ts +18 -3
  166. package/src/tool/code_health/spec.ts +5 -3
  167. package/src/tool/code_health/structured-schema.ts +250 -0
  168. package/src/tool/code_health/structured.ts +256 -0
  169. package/src/tool/code_inspect/result.ts +11 -5
  170. package/src/tool/code_inspect/spec.ts +7 -1
  171. package/src/tool/code_inspect/structured.ts +231 -0
  172. package/src/tool/code_orientation/execute.ts +1 -1
  173. package/src/tool/code_orientation/result.ts +31 -8
  174. package/src/tool/code_orientation/spec.ts +2 -0
  175. package/src/tool/code_orientation/structured-schema.ts +617 -0
  176. package/src/tool/code_orientation/structured-workspace.ts +194 -0
  177. package/src/tool/code_orientation/structured.ts +189 -0
  178. package/src/tool/code_orientation/workspace-format.ts +2 -5
  179. package/src/tool/code_orientation/workspace-observations.ts +81 -0
  180. package/src/tool/code_orientation/workspace-output.ts +5 -0
  181. package/src/tool/code_orientation/workspace-projects.ts +16 -31
  182. package/src/tool/code_orientation/workspace-sections.ts +46 -32
  183. package/src/tool/code_refactor_apply/execute.ts +1 -1
  184. package/src/tool/code_refactor_apply/result.ts +14 -6
  185. package/src/tool/code_refactor_apply/spec.ts +2 -0
  186. package/src/tool/code_refactor_apply/structured.ts +49 -0
  187. package/src/tool/code_refactor_plan/result.ts +18 -9
  188. package/src/tool/code_refactor_plan/spec.ts +2 -0
  189. package/src/tool/code_refactor_plan/structured.ts +127 -0
  190. package/src/tool/code_resolve/markdown.ts +6 -30
  191. package/src/tool/code_resolve/result.ts +24 -11
  192. package/src/tool/code_resolve/structured.ts +7 -9
  193. package/src/tool/result/refactor.ts +8 -5
  194. package/src/tool/result/structured.ts +8 -5
  195. package/src/tool/result/types.ts +18 -14
  196. package/src/tool/schemas.ts +12 -6
  197. package/src/ui/status-command.ts +147 -322
  198. package/src/ui/status-overlay.ts +584 -421
  199. 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 changedFiles = [...new Set(plan.edits.edits.map((edit) => edit.file))];
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 = StringEnum(["semantic", "structural", "heuristic", "unavailable"]);
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: StringEnum(["name", "declaration"]),
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(Type.Array(StringEnum(["semantic", "structural"]))),
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: StringEnum(["semantic", "structural", "structural-identifier"]),
49
+ source: Type.Enum(["semantic", "structural", "structural-identifier"], { type: "string" }),
47
50
  }),
48
51
  ),
49
52
  },
@@ -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
- * Resolution metadata for a target resolved from anchored coordinates.
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. Structured details always carry this when
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
- /** Paths successfully changed by `code_refactor_apply`. */
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?: CodeQueryPartialMetadata["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 provenance — present when the target was resolved from anchored coordinates. */
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.
@@ -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
- StringEnum(TARGET_SYMBOL_KINDS, {
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 returned by code_resolve." }),
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 returned by code_resolve." }),
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 returned by code_resolve." }),
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({}, { additionalProperties: false }),
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(