@mrclrchtr/supi-code-intelligence 11.1.0 → 11.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 +29 -4
- package/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-core/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-lsp/README.md +42 -5
- 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-core/package.json +1 -1
- 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.ts +23 -5
- 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/manager/manager-project-info.ts +22 -10
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager.ts +52 -19
- 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/scanner.ts +27 -15
- 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-core/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/package.json +3 -3
- package/package.json +5 -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 +8 -0
- 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/session/health-types.ts +7 -0
- package/src/session/health-workflow.ts +8 -43
- package/src/session/orientation/collect.ts +138 -12
- package/src/session/orientation/context-facts.ts +27 -2
- package/src/session/orientation/context-sections.ts +47 -0
- package/src/session/orientation/facts.ts +124 -0
- package/src/session/orientation/gather.ts +98 -11
- package/src/session/orientation/workspace-context.ts +16 -6
- package/src/session/orientation-types.ts +5 -0
- package/src/session/orientation-workflow.ts +3 -2
- package/src/session/refactor-plans.ts +5 -2
- package/src/session/refactor-workflow.ts +4 -3
- package/src/tool/code_find/guidance.ts +1 -1
- package/src/tool/code_health/markdown.ts +12 -2
- package/src/tool/code_health/result.ts +15 -2
- package/src/tool/code_health/spec.ts +2 -0
- 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 +2 -0
- package/src/tool/code_inspect/structured.ts +232 -0
- package/src/tool/code_orientation/result.ts +10 -4
- package/src/tool/code_orientation/spec.ts +2 -0
- package/src/tool/code_orientation/structured-schema.ts +607 -0
- package/src/tool/code_orientation/structured-workspace.ts +193 -0
- package/src/tool/code_orientation/structured.ts +195 -0
- 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 +43 -30
- package/src/tool/code_refactor_apply/execute.ts +1 -1
- package/src/tool/code_refactor_apply/result.ts +13 -5
- 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 +16 -8
- package/src/tool/code_refactor_plan/spec.ts +2 -0
- package/src/tool/code_refactor_plan/structured.ts +128 -0
- package/src/tool/schemas.ts +7 -1
- package/src/ui/status-command.ts +110 -321
- package/src/ui/status-overlay.ts +564 -420
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
import { StringEnum } from "@earendil-works/pi-ai";
|
|
2
|
+
import { type Static, type TSchema, Type } from "typebox";
|
|
3
|
+
import type { InspectObservation } from "../../session/inspect-types.ts";
|
|
4
|
+
import { ConfidenceSchema, EvidenceListSchema, RecoveryRangeSchema } from "../result/structured.ts";
|
|
5
|
+
import type { InspectResultAssembly } from "./result.ts";
|
|
6
|
+
|
|
7
|
+
const PositionRange = {
|
|
8
|
+
startLine: Type.Integer(),
|
|
9
|
+
startCharacter: Type.Integer(),
|
|
10
|
+
endLine: Type.Integer(),
|
|
11
|
+
endCharacter: Type.Integer(),
|
|
12
|
+
};
|
|
13
|
+
const NodeSchema = Type.Object(
|
|
14
|
+
{
|
|
15
|
+
type: Type.String(),
|
|
16
|
+
text: Type.String(),
|
|
17
|
+
...PositionRange,
|
|
18
|
+
ancestry: Type.Array(
|
|
19
|
+
Type.Object({ type: Type.String(), ...PositionRange }, { additionalProperties: false }),
|
|
20
|
+
),
|
|
21
|
+
},
|
|
22
|
+
{ additionalProperties: false },
|
|
23
|
+
);
|
|
24
|
+
const SymbolSchema = Type.Object(
|
|
25
|
+
{
|
|
26
|
+
name: Type.String(),
|
|
27
|
+
kind: Type.String(),
|
|
28
|
+
nativeKind: Type.Optional(Type.String()),
|
|
29
|
+
...PositionRange,
|
|
30
|
+
},
|
|
31
|
+
{ additionalProperties: false },
|
|
32
|
+
);
|
|
33
|
+
const DefinitionSchema = Type.Object(
|
|
34
|
+
{ file: Type.String(), line: Type.Integer(), character: Type.Integer() },
|
|
35
|
+
{ additionalProperties: false },
|
|
36
|
+
);
|
|
37
|
+
const DiagnosticSchema = Type.Object(
|
|
38
|
+
{
|
|
39
|
+
line: Type.Integer(),
|
|
40
|
+
character: Type.Integer(),
|
|
41
|
+
endLine: Type.Integer(),
|
|
42
|
+
endCharacter: Type.Integer(),
|
|
43
|
+
severity: Type.Number(),
|
|
44
|
+
message: Type.String(),
|
|
45
|
+
},
|
|
46
|
+
{ additionalProperties: false },
|
|
47
|
+
);
|
|
48
|
+
const ProvenanceSchema = Type.Object(
|
|
49
|
+
{ source: StringEnum(["semantic", "structural"]), capability: Type.String() },
|
|
50
|
+
{ additionalProperties: false },
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
function observationSchema<T extends TSchema>(data: T) {
|
|
54
|
+
return Type.Union([
|
|
55
|
+
Type.Object({ kind: Type.Literal("completed"), data }, { additionalProperties: false }),
|
|
56
|
+
Type.Object(
|
|
57
|
+
{
|
|
58
|
+
kind: Type.Literal("partial"),
|
|
59
|
+
data,
|
|
60
|
+
reason: Type.String(),
|
|
61
|
+
recovery: Type.Optional(
|
|
62
|
+
Type.Object(
|
|
63
|
+
{ file: Type.String(), errorRanges: Type.Array(RecoveryRangeSchema) },
|
|
64
|
+
{ additionalProperties: false },
|
|
65
|
+
),
|
|
66
|
+
),
|
|
67
|
+
},
|
|
68
|
+
{ additionalProperties: false },
|
|
69
|
+
),
|
|
70
|
+
Type.Object(
|
|
71
|
+
{ kind: Type.Literal("unavailable"), reason: Type.String() },
|
|
72
|
+
{ additionalProperties: false },
|
|
73
|
+
),
|
|
74
|
+
]);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** Point facts use one-based UTF-16 coordinates; syntax recovery ranges remain zero-based. */
|
|
78
|
+
export const InspectOutputSchema = Type.Union([
|
|
79
|
+
Type.Object(
|
|
80
|
+
{
|
|
81
|
+
kind: Type.Literal("completed"),
|
|
82
|
+
point: Type.Object(
|
|
83
|
+
{ file: Type.String(), line: Type.Integer(), character: Type.Integer() },
|
|
84
|
+
{ additionalProperties: false },
|
|
85
|
+
),
|
|
86
|
+
confidence: ConfidenceSchema,
|
|
87
|
+
diagnosticWindow: Type.Object(
|
|
88
|
+
{ startLine: Type.Integer(), endLine: Type.Integer() },
|
|
89
|
+
{ additionalProperties: false },
|
|
90
|
+
),
|
|
91
|
+
sections: Type.Object(
|
|
92
|
+
{
|
|
93
|
+
node: observationSchema(Type.Union([NodeSchema, Type.Null()])),
|
|
94
|
+
enclosingSymbol: observationSchema(Type.Union([SymbolSchema, Type.Null()])),
|
|
95
|
+
hover: observationSchema(Type.Union([Type.String(), Type.Null()])),
|
|
96
|
+
definition: observationSchema(Type.Array(DefinitionSchema)),
|
|
97
|
+
diagnostics: observationSchema(Type.Array(DiagnosticSchema)),
|
|
98
|
+
},
|
|
99
|
+
{ additionalProperties: false },
|
|
100
|
+
),
|
|
101
|
+
evidenceLists: Type.Array(EvidenceListSchema),
|
|
102
|
+
provenance: Type.Array(ProvenanceSchema),
|
|
103
|
+
nextQueries: Type.Array(Type.String()),
|
|
104
|
+
},
|
|
105
|
+
{ additionalProperties: false },
|
|
106
|
+
),
|
|
107
|
+
Type.Object(
|
|
108
|
+
{
|
|
109
|
+
kind: Type.Literal("invalid-input"),
|
|
110
|
+
message: Type.String(),
|
|
111
|
+
nextQueries: Type.Array(Type.String()),
|
|
112
|
+
},
|
|
113
|
+
{ additionalProperties: false },
|
|
114
|
+
),
|
|
115
|
+
]);
|
|
116
|
+
|
|
117
|
+
function observation<T, U>(value: InspectObservation<T>, project: (data: T) => U) {
|
|
118
|
+
if (value.kind === "unavailable") return { kind: value.kind, reason: value.reason };
|
|
119
|
+
if (value.kind === "completed") return { kind: value.kind, data: project(value.data) };
|
|
120
|
+
return {
|
|
121
|
+
kind: value.kind,
|
|
122
|
+
data: project(value.data),
|
|
123
|
+
reason: value.reason,
|
|
124
|
+
...(value.recovery
|
|
125
|
+
? {
|
|
126
|
+
recovery: {
|
|
127
|
+
file: value.recovery.file,
|
|
128
|
+
errorRanges: value.recovery.errorRanges.map(({ start, end }) => ({
|
|
129
|
+
start: { line: start.line, character: start.character },
|
|
130
|
+
end: { line: end.line, character: end.character },
|
|
131
|
+
})),
|
|
132
|
+
},
|
|
133
|
+
}
|
|
134
|
+
: {}),
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/** Assemble script data from the same bounded evidence as direct inspection, never UI text. */
|
|
139
|
+
export function structuredInspectResult(
|
|
140
|
+
assembly: InspectResultAssembly,
|
|
141
|
+
): Static<typeof InspectOutputSchema> {
|
|
142
|
+
const { data, assembled } = assembly;
|
|
143
|
+
return {
|
|
144
|
+
kind: "completed",
|
|
145
|
+
point: { file: data.relPath, line: data.line, character: data.character },
|
|
146
|
+
confidence: data.confidence,
|
|
147
|
+
diagnosticWindow: {
|
|
148
|
+
startLine: data.diagnosticWindow.startLine,
|
|
149
|
+
endLine: data.diagnosticWindow.endLine,
|
|
150
|
+
},
|
|
151
|
+
sections: {
|
|
152
|
+
node: observation(data.sections.node, (node) =>
|
|
153
|
+
node
|
|
154
|
+
? {
|
|
155
|
+
type: node.type,
|
|
156
|
+
text: node.text,
|
|
157
|
+
startLine: node.startLine,
|
|
158
|
+
startCharacter: node.startCharacter,
|
|
159
|
+
endLine: node.endLine,
|
|
160
|
+
endCharacter: node.endCharacter,
|
|
161
|
+
ancestry: node.ancestry.map(
|
|
162
|
+
({ type, startLine, startCharacter, endLine, endCharacter }) => ({
|
|
163
|
+
type,
|
|
164
|
+
startLine,
|
|
165
|
+
startCharacter,
|
|
166
|
+
endLine,
|
|
167
|
+
endCharacter,
|
|
168
|
+
}),
|
|
169
|
+
),
|
|
170
|
+
}
|
|
171
|
+
: null,
|
|
172
|
+
),
|
|
173
|
+
enclosingSymbol: observation(data.sections.enclosingSymbol, (symbol) =>
|
|
174
|
+
symbol
|
|
175
|
+
? {
|
|
176
|
+
name: symbol.name,
|
|
177
|
+
kind: symbol.kind,
|
|
178
|
+
...(symbol.nativeKind === undefined ? {} : { nativeKind: symbol.nativeKind }),
|
|
179
|
+
startLine: symbol.startLine,
|
|
180
|
+
startCharacter: symbol.startCharacter,
|
|
181
|
+
endLine: symbol.endLine,
|
|
182
|
+
endCharacter: symbol.endCharacter,
|
|
183
|
+
}
|
|
184
|
+
: null,
|
|
185
|
+
),
|
|
186
|
+
hover: observation(data.sections.hover, (hover) => hover),
|
|
187
|
+
definition: observation(data.sections.definition, () =>
|
|
188
|
+
assembly.displayedDefinitions.map(({ file, line, character }) => ({
|
|
189
|
+
file,
|
|
190
|
+
line,
|
|
191
|
+
character,
|
|
192
|
+
})),
|
|
193
|
+
),
|
|
194
|
+
diagnostics: observation(data.sections.diagnostics, () =>
|
|
195
|
+
assembly.displayedDiagnostics.map(
|
|
196
|
+
({ line, character, endLine, endCharacter, severity, message }) => ({
|
|
197
|
+
line,
|
|
198
|
+
character,
|
|
199
|
+
endLine,
|
|
200
|
+
endCharacter,
|
|
201
|
+
severity,
|
|
202
|
+
message,
|
|
203
|
+
}),
|
|
204
|
+
),
|
|
205
|
+
),
|
|
206
|
+
},
|
|
207
|
+
evidenceLists: assembled.evidenceLists.map(
|
|
208
|
+
({
|
|
209
|
+
key,
|
|
210
|
+
totalCount,
|
|
211
|
+
shownCount,
|
|
212
|
+
omittedCount,
|
|
213
|
+
partialReason,
|
|
214
|
+
partialMessage,
|
|
215
|
+
invalidLocationCount,
|
|
216
|
+
}) => ({
|
|
217
|
+
key,
|
|
218
|
+
totalCount,
|
|
219
|
+
shownCount,
|
|
220
|
+
omittedCount,
|
|
221
|
+
partialReason,
|
|
222
|
+
...(partialMessage === undefined ? {} : { partialMessage }),
|
|
223
|
+
...(invalidLocationCount === undefined ? {} : { invalidLocationCount }),
|
|
224
|
+
}),
|
|
225
|
+
),
|
|
226
|
+
provenance: assembled.provenance.map(({ source, capability }) => ({
|
|
227
|
+
source: source as "semantic" | "structural",
|
|
228
|
+
capability: capability ?? "",
|
|
229
|
+
})),
|
|
230
|
+
nextQueries: [...assembly.details.nextQueries],
|
|
231
|
+
};
|
|
232
|
+
}
|
|
@@ -267,6 +267,7 @@ function uniqueProvenance(sections: readonly OrientationSectionData[]) {
|
|
|
267
267
|
import type { CodeIntelResult, CodeIntelToolExecCtx } from "../../types/index.ts";
|
|
268
268
|
import { contextErrorResult } from "../result/errors.ts";
|
|
269
269
|
import { renderOrientationResult } from "./markdown.ts";
|
|
270
|
+
import { structuredOrientation } from "./structured.ts";
|
|
270
271
|
import { prepareWorkspaceOutput } from "./workspace-output.ts";
|
|
271
272
|
|
|
272
273
|
type OrientationOutcome = Awaited<ReturnType<CodeIntelToolExecCtx["session"]["orient"]>>;
|
|
@@ -312,6 +313,7 @@ export function finishOrientationResult(outcome: OrientationOutcome): CodeIntelR
|
|
|
312
313
|
});
|
|
313
314
|
return {
|
|
314
315
|
content: lines.join("\n"),
|
|
316
|
+
structuredContent: structuredOrientation(outcome),
|
|
315
317
|
details: {
|
|
316
318
|
type: "context",
|
|
317
319
|
data: details,
|
|
@@ -332,10 +334,13 @@ function invalidOrientationResult(
|
|
|
332
334
|
const message = rejection
|
|
333
335
|
? `Requested focus ${JSON.stringify(rejection.requestedPath)} traverses a symbolic link: ${JSON.stringify(rejection.blockedPath)}. Orientation does not follow symbolic links.\n\n${recovery}`
|
|
334
336
|
: outcome.message;
|
|
335
|
-
return
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
337
|
+
return {
|
|
338
|
+
...contextErrorResult(`**Error:** ${message}`, {
|
|
339
|
+
nextQueries: rejection ? [recovery] : ["Choose an existing path, module, or precise target"],
|
|
340
|
+
message,
|
|
341
|
+
}),
|
|
342
|
+
structuredContent: structuredOrientation(outcome),
|
|
343
|
+
};
|
|
339
344
|
}
|
|
340
345
|
|
|
341
346
|
function finishCompletedOrientation(data: OrientationResultData): CodeIntelResult {
|
|
@@ -343,6 +348,7 @@ function finishCompletedOrientation(data: OrientationResultData): CodeIntelResul
|
|
|
343
348
|
const assembly = assembleOrientationResult(navigation?.data ?? data);
|
|
344
349
|
return {
|
|
345
350
|
content: navigation?.content ?? renderOrientationResult(assembly),
|
|
351
|
+
structuredContent: structuredOrientation({ kind: "completed", data }, navigation?.snapshotPath),
|
|
346
352
|
details: {
|
|
347
353
|
type: "context",
|
|
348
354
|
data: assembly.details,
|
|
@@ -2,6 +2,7 @@ import { Type } from "typebox";
|
|
|
2
2
|
import type { CodeIntelToolExecCtx } from "../../types/index.ts";
|
|
3
3
|
import { MaxResultsParam, OrientationFocusParam } from "../schemas.ts";
|
|
4
4
|
import { executeOrientationTool } from "./execute.ts";
|
|
5
|
+
import { OrientationOutputSchema } from "./structured-schema.ts";
|
|
5
6
|
import { renderOrientationCall, renderOrientationResult } from "./tui.ts";
|
|
6
7
|
|
|
7
8
|
export const CODE_ORIENTATION_TOOL_NAME = "code_orientation";
|
|
@@ -11,6 +12,7 @@ export const CODE_ORIENTATION_TOOL_LABEL = "Code Orientation";
|
|
|
11
12
|
export const codeOrientationSpec = {
|
|
12
13
|
name: CODE_ORIENTATION_TOOL_NAME,
|
|
13
14
|
label: CODE_ORIENTATION_TOOL_LABEL,
|
|
15
|
+
outputSchema: OrientationOutputSchema,
|
|
14
16
|
parameters: Type.Object(
|
|
15
17
|
{
|
|
16
18
|
focus: Type.Optional(OrientationFocusParam),
|