@mrclrchtr/supi-code-intelligence 10.0.0 → 11.0.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 +77 -21
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/LICENSE +21 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/README.md +743 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/index.js +17 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/lib/constants.js +184 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/lib/parse.js +1425 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/lib/picomatch.js +361 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/lib/scan.js +403 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/lib/utils.js +72 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/package.json +83 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/posix.js +3 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/package.json +4 -1
- package/node_modules/@mrclrchtr/supi-code-runtime/src/api.ts +11 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/src/file-associations.ts +190 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/src/types.ts +22 -0
- package/node_modules/@mrclrchtr/supi-core/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-lsp/README.md +88 -2
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/LICENSE +21 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/README.md +743 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/index.js +17 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/lib/constants.js +184 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/lib/parse.js +1425 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/lib/picomatch.js +361 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/lib/scan.js +403 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/lib/utils.js +72 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/package.json +83 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/posix.js +3 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/package.json +4 -1
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/api.ts +11 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/file-associations.ts +190 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/types.ts +22 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-lsp/package.json +3 -3
- package/node_modules/@mrclrchtr/supi-lsp/src/api.ts +1 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-host.ts +3 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostics.ts +6 -4
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-request-enrollment.ts +66 -22
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-semantic-input-barrier.ts +37 -5
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client.ts +136 -43
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager.ts +261 -22
- package/node_modules/@mrclrchtr/supi-lsp/src/provider/refactor-planning.ts +13 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/provider/semantic-edit-discovery.ts +151 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/provider/semantic-edit-normalizer.ts +97 -129
- package/node_modules/@mrclrchtr/supi-lsp/src/provider/semantic-edit-protocol.ts +132 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-controller.ts +8 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-registry.ts +7 -20
- package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-rename.ts +172 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/session/workspace-lsp-runtime.ts +14 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/utils.ts +12 -11
- package/node_modules/@mrclrchtr/supi-tree-sitter/README.md +63 -17
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/LICENSE +21 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/README.md +743 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/index.js +17 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/lib/constants.js +184 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/lib/parse.js +1425 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/lib/picomatch.js +361 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/lib/scan.js +403 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/lib/utils.js +72 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/package.json +83 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/posix.js +3 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/package.json +4 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/api.ts +11 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/file-associations.ts +190 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/types.ts +22 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/package.json +3 -3
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/language.ts +16 -10
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/operation-support.ts +13 -6
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/provider/tree-sitter-provider.ts +19 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/session/runtime-controller.ts +18 -4
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/session/session.ts +10 -3
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/session/structural-worker-client.ts +17 -2
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/session/structural-worker-process.ts +22 -5
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/session/structural-worker-protocol.ts +36 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/syntax-errors.ts +73 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/syntax-node.ts +4 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/call-sites.ts +15 -9
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/callees.ts +24 -15
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/exports.ts +8 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/imports.ts +233 -7
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/node-at.ts +7 -3
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/outline-expansion.ts +78 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/outline-jvm.ts +25 -4
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/outline-nested.ts +390 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/outline.ts +49 -28
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/types.ts +16 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/worker/process-host.mjs +61 -24
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/worker/runtime.ts +44 -10
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/worker/service.ts +13 -9
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/worker/worker-main.ts +15 -2
- package/package.json +5 -5
- package/src/analysis/refactor/apply.ts +35 -14
- package/src/analysis/relations/callees.ts +9 -2
- package/src/analysis/relations/implementations.ts +7 -2
- package/src/analysis/search/pattern-analysis.ts +90 -12
- package/src/analysis/search/pattern.ts +1 -0
- package/src/analysis/target/anchored-structural.ts +1 -0
- package/src/analysis/target/discovery.ts +29 -0
- package/src/analysis/target/file.ts +19 -9
- package/src/analysis/target/types.ts +5 -0
- package/src/config.ts +46 -7
- package/src/session/graph/collect.ts +2 -2
- package/src/session/graph-types.ts +6 -0
- package/src/session/inspect/collect.ts +35 -20
- package/src/session/inspect-types.ts +9 -2
- package/src/session/orientation/collect.ts +90 -18
- package/src/session/orientation/context-sections.ts +22 -1
- package/src/session/orientation/gather.ts +46 -6
- package/src/session/orientation-types.ts +7 -1
- package/src/session/refactor-plans.ts +17 -0
- package/src/session/refactor-workflow.ts +13 -6
- package/src/session/target-store.ts +5 -0
- package/src/session/target-workflow.ts +3 -0
- package/src/substrate/workspace-provider-host.ts +22 -2
- package/src/tool/code_find/markdown.ts +17 -4
- package/src/tool/code_find/result.ts +17 -3
- package/src/tool/code_graph/details.ts +2 -0
- package/src/tool/code_graph/display.ts +1 -0
- package/src/tool/code_graph/format.ts +1 -0
- package/src/tool/code_graph/result.ts +32 -6
- package/src/tool/code_inspect/markdown.ts +15 -1
- package/src/tool/code_inspect/result.ts +11 -0
- package/src/tool/code_orientation/result.ts +4 -2
- package/src/tool/code_resolve/markdown.ts +34 -14
- package/src/tool/code_resolve/result.ts +7 -3
- package/src/tool/result/types.ts +20 -2
- package/src/ui/tui/display.ts +2 -1
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/ignore/LICENSE-MIT +0 -21
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/ignore/README.md +0 -501
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/ignore/index.d.ts +0 -81
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/ignore/index.js +0 -1566
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/ignore/legacy.js +0 -1346
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/ignore/package.json +0 -93
|
@@ -129,6 +129,7 @@ function graphSectionDetails(
|
|
|
129
129
|
? { ...calls.enclosingScope, file: toDisplayPath(cwd, calls.enclosingScope.file) }
|
|
130
130
|
: null,
|
|
131
131
|
depth: calls?.depth ?? null,
|
|
132
|
+
recovery: calls?.recovery ?? null,
|
|
132
133
|
fileGroups,
|
|
133
134
|
};
|
|
134
135
|
}
|
|
@@ -147,15 +148,32 @@ function assembleGraphSection(section: GraphSection, maxResults: number): Assemb
|
|
|
147
148
|
partialReason: section.data.partialReason,
|
|
148
149
|
}),
|
|
149
150
|
};
|
|
150
|
-
case "callees":
|
|
151
|
+
case "callees": {
|
|
152
|
+
const evidence = section.data.recovery
|
|
153
|
+
? createPartialEvidenceList({
|
|
154
|
+
key: "callees.calls",
|
|
155
|
+
items: [...section.data.calls],
|
|
156
|
+
maxResults,
|
|
157
|
+
partialReason: "provider-limited",
|
|
158
|
+
})
|
|
159
|
+
: createEvidenceList({
|
|
160
|
+
key: "callees.calls",
|
|
161
|
+
items: [...section.data.calls],
|
|
162
|
+
maxResults,
|
|
163
|
+
});
|
|
151
164
|
return {
|
|
152
165
|
...section,
|
|
153
|
-
evidence:
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
166
|
+
evidence: section.data.recovery
|
|
167
|
+
? {
|
|
168
|
+
...evidence,
|
|
169
|
+
metadata: {
|
|
170
|
+
...evidence.metadata,
|
|
171
|
+
partialMessage: recoveryMessage(section.data.recovery),
|
|
172
|
+
},
|
|
173
|
+
}
|
|
174
|
+
: evidence,
|
|
158
175
|
};
|
|
176
|
+
}
|
|
159
177
|
case "implements":
|
|
160
178
|
return {
|
|
161
179
|
...section,
|
|
@@ -192,6 +210,14 @@ function createRelationEvidenceList<T>(params: {
|
|
|
192
210
|
};
|
|
193
211
|
}
|
|
194
212
|
|
|
213
|
+
function recoveryMessage(recovery: NonNullable<CalleeGraphSection["data"]["recovery"]>): string {
|
|
214
|
+
const locations = recovery.errorRanges.map(
|
|
215
|
+
(range) => `L${range.start.line + 1}:${range.start.character + 1}`,
|
|
216
|
+
);
|
|
217
|
+
const suffix = locations.length > 0 ? ` Error locations: ${locations.join(", ")}.` : "";
|
|
218
|
+
return `${recovery.file}: ${recovery.reason}${suffix}`;
|
|
219
|
+
}
|
|
220
|
+
|
|
195
221
|
function evidenceTotal(evidence: EvidenceList<unknown>): number {
|
|
196
222
|
return evidence.metadata.totalCount ?? evidence.metadata.shownCount;
|
|
197
223
|
}
|
|
@@ -30,6 +30,7 @@ function renderNode(
|
|
|
30
30
|
return;
|
|
31
31
|
}
|
|
32
32
|
appendPartial(lines, observation);
|
|
33
|
+
appendSyntaxRecovery(lines, observation.recovery);
|
|
33
34
|
const node = observation.data;
|
|
34
35
|
if (!node) {
|
|
35
36
|
lines.push("_No syntax node at this point._", "");
|
|
@@ -60,13 +61,14 @@ function renderEnclosingSymbol(
|
|
|
60
61
|
return;
|
|
61
62
|
}
|
|
62
63
|
appendPartial(lines, observation);
|
|
64
|
+
appendSyntaxRecovery(lines, observation.recovery);
|
|
63
65
|
const symbol = observation.data;
|
|
64
66
|
if (!symbol) {
|
|
65
67
|
lines.push("_No provider-reported declaration encloses this point._", "");
|
|
66
68
|
return;
|
|
67
69
|
}
|
|
68
70
|
lines.push(
|
|
69
|
-
`- \`${symbol.name}\` (${symbol.kind}) L${symbol.startLine}:${symbol.startCharacter}–L${symbol.endLine}:${symbol.endCharacter}`,
|
|
71
|
+
`- \`${symbol.name}\` (${symbol.nativeKind ?? symbol.kind}) L${symbol.startLine}:${symbol.startCharacter}–L${symbol.endLine}:${symbol.endCharacter}`,
|
|
70
72
|
"",
|
|
71
73
|
);
|
|
72
74
|
}
|
|
@@ -125,6 +127,18 @@ function renderDiagnostics(lines: string[], assembly: InspectResultAssembly): vo
|
|
|
125
127
|
lines.push("");
|
|
126
128
|
}
|
|
127
129
|
|
|
130
|
+
function appendSyntaxRecovery(
|
|
131
|
+
lines: string[],
|
|
132
|
+
recovery: InspectObservation<unknown>["recovery"],
|
|
133
|
+
): void {
|
|
134
|
+
if (!recovery) return;
|
|
135
|
+
const locations = recovery.errorRanges.map(
|
|
136
|
+
(range) => `L${range.start.line + 1}:${range.start.character + 1}`,
|
|
137
|
+
);
|
|
138
|
+
const suffix = locations.length > 0 ? ` Error locations: ${locations.join(", ")}.` : "";
|
|
139
|
+
lines.push(`_Recovered syntax in \`${recovery.file}\`.${suffix}_`, "");
|
|
140
|
+
}
|
|
141
|
+
|
|
128
142
|
function appendUnavailable(lines: string[], observation: InspectObservation<unknown>): boolean {
|
|
129
143
|
if (observation.kind !== "unavailable") return false;
|
|
130
144
|
lines.push(`_Unavailable — ${observation.reason}_`, "");
|
|
@@ -296,6 +296,17 @@ function sectionDetails<T>(
|
|
|
296
296
|
capability: source.capability,
|
|
297
297
|
},
|
|
298
298
|
],
|
|
299
|
+
...(recoveryDetails(observation) ? { recovery: recoveryDetails(observation) } : {}),
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
function recoveryDetails(
|
|
304
|
+
observation: InspectObservation<unknown>,
|
|
305
|
+
): InspectSectionDetails["recovery"] | undefined {
|
|
306
|
+
if (observation.kind !== "partial" || !observation.recovery) return undefined;
|
|
307
|
+
return {
|
|
308
|
+
file: observation.recovery.file,
|
|
309
|
+
errorRanges: [...observation.recovery.errorRanges],
|
|
299
310
|
};
|
|
300
311
|
}
|
|
301
312
|
|
|
@@ -138,8 +138,9 @@ function orientationDisplaySection(section: OrientationSectionData): ToolDisplay
|
|
|
138
138
|
totalCount: items.length,
|
|
139
139
|
omittedCount: 0,
|
|
140
140
|
partialReason:
|
|
141
|
-
section.
|
|
142
|
-
section.
|
|
141
|
+
section.evidenceLists.find((evidence) => evidence.partialReason)?.partialReason ??
|
|
142
|
+
(section.reason ? "provider-limited" : null),
|
|
143
|
+
...(section.reason ? { partialMessage: section.reason } : {}),
|
|
143
144
|
format: formatOrientationItem,
|
|
144
145
|
});
|
|
145
146
|
}
|
|
@@ -179,6 +180,7 @@ function toDetailsSection(section: OrientationSectionData): OrientationSectionDe
|
|
|
179
180
|
confidence: section.confidence,
|
|
180
181
|
provenance: section.provenance.map((provenance) => ({ ...provenance })),
|
|
181
182
|
evidenceLists: section.evidenceLists.map((evidence) => ({ ...evidence })),
|
|
183
|
+
...(section.errorRanges ? { errorRanges: [...section.errorRanges] } : {}),
|
|
182
184
|
};
|
|
183
185
|
}
|
|
184
186
|
|
|
@@ -32,7 +32,8 @@ function renderResolved(
|
|
|
32
32
|
cwd: string,
|
|
33
33
|
): string {
|
|
34
34
|
const relFile = relative(cwd, target.file) || target.file;
|
|
35
|
-
const
|
|
35
|
+
const displayKind = target.nativeKind ?? target.kind;
|
|
36
|
+
const kind = displayKind ? ` \`${displayKind}\`` : "";
|
|
36
37
|
const name = target.name ? ` **${target.name}**${kind}` : "";
|
|
37
38
|
const lines = [
|
|
38
39
|
`Resolved${name}:`,
|
|
@@ -70,24 +71,43 @@ function renderTargetGroup(details: ResolveDetails): string {
|
|
|
70
71
|
`- Discovery provenance: \`${discovery}\``,
|
|
71
72
|
];
|
|
72
73
|
appendUnknownHierarchyDisclosure(lines, details.groupUnknownNestingCount ?? 0);
|
|
74
|
+
appendGroupRecoveryDisclosure(lines, details);
|
|
73
75
|
lines.push("");
|
|
74
|
-
|
|
75
|
-
lines.push("No declarations were reported for this file.");
|
|
76
|
-
} else {
|
|
77
|
-
lines.push(declarationCountHeading(details.targetCount), "");
|
|
78
|
-
for (const target of details.targets) {
|
|
79
|
-
const kind = target.kind ? ` (\`${target.kind}\`)` : "";
|
|
80
|
-
const container = target.container ? ` in \`${target.container}\`` : "";
|
|
81
|
-
lines.push(
|
|
82
|
-
`- **${target.name ?? "anonymous"}**${kind}${container} — \`${target.file}:${target.displayLine}:${target.displayCharacter}\``,
|
|
83
|
-
` Target ID: \`${target.targetId}\` (${target.anchorKind} anchor, ${target.confidence}, provenance: ${target.provenance.join("+")})`,
|
|
84
|
-
);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
76
|
+
appendTargetGroupItems(lines, details);
|
|
87
77
|
appendDisclosure(lines, details);
|
|
88
78
|
return lines.join("\n");
|
|
89
79
|
}
|
|
90
80
|
|
|
81
|
+
function appendTargetGroupItems(lines: string[], details: ResolveDetails): void {
|
|
82
|
+
if (details.targets.length === 0) {
|
|
83
|
+
lines.push(
|
|
84
|
+
details.groupPartialReason
|
|
85
|
+
? "No declarations were collected before structural recovery limited discovery."
|
|
86
|
+
: "No declarations were reported for this file.",
|
|
87
|
+
);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
lines.push(declarationCountHeading(details.targetCount), "");
|
|
91
|
+
for (const target of details.targets) {
|
|
92
|
+
const displayKind = target.nativeKind ?? target.kind;
|
|
93
|
+
const kind = displayKind ? ` (\`${displayKind}\`)` : "";
|
|
94
|
+
const container = target.container ? ` in \`${target.container}\`` : "";
|
|
95
|
+
lines.push(
|
|
96
|
+
`- **${target.name ?? "anonymous"}**${kind}${container} — \`${target.file}:${target.displayLine}:${target.displayCharacter}\``,
|
|
97
|
+
` Target ID: \`${target.targetId}\` (${target.anchorKind} anchor, ${target.confidence}, provenance: ${target.provenance.join("+")})`,
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function appendGroupRecoveryDisclosure(lines: string[], details: ResolveDetails): void {
|
|
103
|
+
if (!details.groupPartialReason) return;
|
|
104
|
+
const locations = (details.groupErrorRanges ?? []).map(
|
|
105
|
+
(range) => `L${range.start.line + 1}:${range.start.character + 1}`,
|
|
106
|
+
);
|
|
107
|
+
const errors = locations.length ? ` Error locations: ${locations.join(", ")}.` : "";
|
|
108
|
+
lines.push(`- Partial discovery: ${details.groupPartialReason}${errors}`);
|
|
109
|
+
}
|
|
110
|
+
|
|
91
111
|
function declarationCountHeading(count: number): string {
|
|
92
112
|
return `**${count} declaration${count === 1 ? "" : "s"} discovered**`;
|
|
93
113
|
}
|
|
@@ -125,13 +125,14 @@ function projectTargetGroup(
|
|
|
125
125
|
totalCount: outcome.totalCount,
|
|
126
126
|
shownCount: outcome.targets.length,
|
|
127
127
|
omittedCount: outcome.omittedCount,
|
|
128
|
-
partialReason: null,
|
|
128
|
+
partialReason: outcome.partial ? ("provider-limited" as const) : null,
|
|
129
|
+
partialMessage: outcome.partial?.reason,
|
|
129
130
|
},
|
|
130
131
|
};
|
|
131
132
|
return {
|
|
132
133
|
key: "resolve.target-group",
|
|
133
134
|
title: "Target group",
|
|
134
|
-
status: "complete",
|
|
135
|
+
status: outcome.partial ? "partial" : "complete",
|
|
135
136
|
items: evidence.items,
|
|
136
137
|
confidence: outcome.confidence,
|
|
137
138
|
evidence: evidence.metadata,
|
|
@@ -140,6 +141,8 @@ function projectTargetGroup(
|
|
|
140
141
|
groupFile: relative(cwd, outcome.file) || outcome.file,
|
|
141
142
|
groupDiscoveryProvenance: [...outcome.discoveryProvenance],
|
|
142
143
|
groupUnknownNestingCount: outcome.unknownNestingCount,
|
|
144
|
+
groupPartialReason: outcome.partial?.reason ?? null,
|
|
145
|
+
groupErrorRanges: outcome.partial?.errorRanges,
|
|
143
146
|
confidence: outcome.confidence,
|
|
144
147
|
targetCount: outcome.totalCount,
|
|
145
148
|
omittedCount: evidence.metadata.omittedCount,
|
|
@@ -234,6 +237,7 @@ function toTargetDetails(target: Readonly<TargetStoreEntry>, cwd: string) {
|
|
|
234
237
|
displayCharacter: target.displayCharacter,
|
|
235
238
|
name: target.name,
|
|
236
239
|
kind: target.kind,
|
|
240
|
+
...(target.nativeKind ? { nativeKind: target.nativeKind } : {}),
|
|
237
241
|
container: target.container,
|
|
238
242
|
anchorKind: target.anchorKind,
|
|
239
243
|
confidence: target.confidence,
|
|
@@ -252,7 +256,7 @@ function resolveDisplaySections(details: ResolveDetails): ToolDisplaySection[] {
|
|
|
252
256
|
totalCount: details.targetCount,
|
|
253
257
|
omittedCount: details.omittedCount,
|
|
254
258
|
format: (target) =>
|
|
255
|
-
`${target.name ?? "anonymous"} (${target.kind ?? "unknown"}) — ${target.file}:${target.displayLine}:${target.displayCharacter} [${target.targetId}]`,
|
|
259
|
+
`${target.name ?? "anonymous"} (${target.nativeKind ?? target.kind ?? "unknown"}) — ${target.file}:${target.displayLine}:${target.displayCharacter} [${target.targetId}]`,
|
|
256
260
|
}),
|
|
257
261
|
];
|
|
258
262
|
}
|
package/src/tool/result/types.ts
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
CodeQueryPartialMetadata,
|
|
3
|
+
ConfidenceMode,
|
|
4
|
+
SourceRange,
|
|
5
|
+
} from "@mrclrchtr/supi-code-runtime/api";
|
|
2
6
|
import type { CapabilityWarningReport } from "../../analysis/capability/capability-warnings.ts";
|
|
3
7
|
import type { EvidenceListMetadata } from "../../analysis/evidence.ts";
|
|
4
8
|
import type { InstructionFilesMetadata } from "../../analysis/instruction-files.ts";
|
|
5
9
|
import type { ReadNextItem } from "../../analysis/read-next.ts";
|
|
6
|
-
import type {
|
|
10
|
+
import type {
|
|
11
|
+
StructuredFailure,
|
|
12
|
+
StructuredMatch,
|
|
13
|
+
StructuredScanSummary,
|
|
14
|
+
} from "../../analysis/search/pattern.ts";
|
|
7
15
|
import type {
|
|
8
16
|
HealthDiagnosticObservation,
|
|
9
17
|
HealthRefreshState,
|
|
@@ -92,6 +100,10 @@ export interface SearchDetails {
|
|
|
92
100
|
changedFiles?: readonly string[];
|
|
93
101
|
/** Present for AST mode; declares the operation-specific source-file universe and completeness. */
|
|
94
102
|
scan?: StructuredScanSummary;
|
|
103
|
+
/** Source-mapped structural matches returned by AST mode. */
|
|
104
|
+
astMatches?: readonly StructuredMatch[];
|
|
105
|
+
/** Per-file structural failures, including available syntax recovery ranges. */
|
|
106
|
+
structuralFailures?: readonly StructuredFailure[];
|
|
95
107
|
/** Structured disclosure for semantic results removed by the automatic path policy. */
|
|
96
108
|
automaticPathExclusion?: CodeQueryPartialMetadata["automaticPathExclusion"];
|
|
97
109
|
}
|
|
@@ -114,6 +126,9 @@ export interface ResolveDetails {
|
|
|
114
126
|
groupDiscoveryProvenance?: readonly TargetProviderProvenance[];
|
|
115
127
|
/** Complete-group declarations whose providers could not establish nesting. */
|
|
116
128
|
groupUnknownNestingCount?: number;
|
|
129
|
+
/** Provider recovery that makes this target group incomplete. */
|
|
130
|
+
groupPartialReason?: string | null;
|
|
131
|
+
groupErrorRanges?: readonly SourceRange[];
|
|
117
132
|
/** Strict provider kind that produced a near-match result. */
|
|
118
133
|
requestedKind?: TargetSymbolKind;
|
|
119
134
|
confidence: ConfidenceMode;
|
|
@@ -132,6 +147,7 @@ export interface ResolveDetails {
|
|
|
132
147
|
displayCharacter: number;
|
|
133
148
|
name: string | null;
|
|
134
149
|
kind: string | null;
|
|
150
|
+
nativeKind?: string;
|
|
135
151
|
container: string | null;
|
|
136
152
|
anchorKind: AnchorKind;
|
|
137
153
|
confidence: ConfidenceMode;
|
|
@@ -163,6 +179,7 @@ export interface OrientationSectionDetails {
|
|
|
163
179
|
confidence: ConfidenceMode;
|
|
164
180
|
provenance: ResultProvenance[];
|
|
165
181
|
evidenceLists: EvidenceListMetadata[];
|
|
182
|
+
errorRanges?: readonly SourceRange[];
|
|
166
183
|
}
|
|
167
184
|
|
|
168
185
|
/** Structured details metadata for code_orientation results. */
|
|
@@ -213,6 +230,7 @@ export interface InspectSectionDetails {
|
|
|
213
230
|
itemCount: number;
|
|
214
231
|
confidence: ConfidenceMode;
|
|
215
232
|
provenance: ResultProvenance[];
|
|
233
|
+
recovery?: { file: string; errorRanges: readonly SourceRange[] };
|
|
216
234
|
}
|
|
217
235
|
|
|
218
236
|
/** Structured details metadata for code_inspect results. */
|
package/src/ui/tui/display.ts
CHANGED
|
@@ -25,7 +25,8 @@ function formatDisplayBounds(section: ToolDisplaySection): string {
|
|
|
25
25
|
const reason = section.partialReason
|
|
26
26
|
? `; more may exist — ${section.partialReason}`
|
|
27
27
|
: "; partial";
|
|
28
|
-
|
|
28
|
+
const message = section.partialMessage ? `; ${section.partialMessage}` : "";
|
|
29
|
+
return ` (${section.shownCount}${omitted}${reason}${message})`;
|
|
29
30
|
}
|
|
30
31
|
if (section.omittedCount && section.omittedCount > 0) {
|
|
31
32
|
return ` (${section.shownCount} of ${section.totalCount}; ${section.omittedCount} omitted)`;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
Copyright (c) 2013 Kael Zhang <i@kael.me>, contributors
|
|
2
|
-
http://kael.me/
|
|
3
|
-
|
|
4
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
|
5
|
-
a copy of this software and associated documentation files (the
|
|
6
|
-
"Software"), to deal in the Software without restriction, including
|
|
7
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
|
8
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
|
9
|
-
permit persons to whom the Software is furnished to do so, subject to
|
|
10
|
-
the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be
|
|
13
|
-
included in all copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
16
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
17
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
18
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
19
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
20
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
21
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|