@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,607 @@
|
|
|
1
|
+
// biome-ignore-all lint/style/noExcessiveLinesPerFile: the complete native contract is declared together for auditing
|
|
2
|
+
import { StringEnum } from "@earendil-works/pi-ai";
|
|
3
|
+
import { Type } from "typebox";
|
|
4
|
+
import {
|
|
5
|
+
ConfidenceSchema,
|
|
6
|
+
EvidenceListSchema,
|
|
7
|
+
NavigationTargetSchema,
|
|
8
|
+
ReadNextSchema,
|
|
9
|
+
RecoveryRangeSchema,
|
|
10
|
+
} from "../result/structured.ts";
|
|
11
|
+
|
|
12
|
+
const nullableString = Type.Union([Type.String(), Type.Null()]);
|
|
13
|
+
const coordinate = { description: "One-based line and UTF-16 character; end is exclusive." };
|
|
14
|
+
const SourceItem = Type.Object(
|
|
15
|
+
{
|
|
16
|
+
startLine: Type.Integer(),
|
|
17
|
+
startCharacter: Type.Integer(),
|
|
18
|
+
endLine: Type.Integer(),
|
|
19
|
+
endCharacter: Type.Integer(),
|
|
20
|
+
},
|
|
21
|
+
coordinate,
|
|
22
|
+
);
|
|
23
|
+
const Project = Type.Object(
|
|
24
|
+
{
|
|
25
|
+
id: Type.String(),
|
|
26
|
+
manifestPath: Type.String(),
|
|
27
|
+
kind: StringEnum(["node-package", "python-project", "rust-package", "go-module"]),
|
|
28
|
+
directory: Type.String(),
|
|
29
|
+
name: nullableString,
|
|
30
|
+
nameField: nullableString,
|
|
31
|
+
description: nullableString,
|
|
32
|
+
descriptionField: nullableString,
|
|
33
|
+
},
|
|
34
|
+
{ additionalProperties: false },
|
|
35
|
+
);
|
|
36
|
+
const Relationship = Type.Object(
|
|
37
|
+
{
|
|
38
|
+
from: Type.String(),
|
|
39
|
+
to: Type.String(),
|
|
40
|
+
manifestPath: Type.String(),
|
|
41
|
+
field: Type.String(),
|
|
42
|
+
value: Type.Unknown(),
|
|
43
|
+
},
|
|
44
|
+
{ additionalProperties: false },
|
|
45
|
+
);
|
|
46
|
+
const Provenance = Type.Object(
|
|
47
|
+
{
|
|
48
|
+
source: StringEnum([
|
|
49
|
+
"semantic",
|
|
50
|
+
"structural",
|
|
51
|
+
"filesystem",
|
|
52
|
+
"manifest",
|
|
53
|
+
"configuration",
|
|
54
|
+
"runtime",
|
|
55
|
+
]),
|
|
56
|
+
capability: Type.Optional(Type.String()),
|
|
57
|
+
detail: Type.Optional(Type.String()),
|
|
58
|
+
},
|
|
59
|
+
{ additionalProperties: false },
|
|
60
|
+
);
|
|
61
|
+
const SourceListFields = {
|
|
62
|
+
status: StringEnum(["complete", "partial", "unavailable"]),
|
|
63
|
+
reason: nullableString,
|
|
64
|
+
collectedCount: Type.Integer(),
|
|
65
|
+
omittedCount: Type.Integer(),
|
|
66
|
+
};
|
|
67
|
+
const Observation = Type.Union([
|
|
68
|
+
Type.Object(
|
|
69
|
+
{ status: Type.Literal("complete"), reason: Type.Null() },
|
|
70
|
+
{ additionalProperties: false },
|
|
71
|
+
),
|
|
72
|
+
Type.Object(
|
|
73
|
+
{ status: StringEnum(["partial", "unavailable", "withheld"]), reason: Type.String() },
|
|
74
|
+
{ additionalProperties: false },
|
|
75
|
+
),
|
|
76
|
+
]);
|
|
77
|
+
const ContextDefinitionEntries = {
|
|
78
|
+
entries: Type.Array(
|
|
79
|
+
Type.Object(
|
|
80
|
+
{ uri: Type.String(), range: RecoveryRangeSchema },
|
|
81
|
+
{ additionalProperties: false },
|
|
82
|
+
),
|
|
83
|
+
),
|
|
84
|
+
collectedCount: Type.Integer({
|
|
85
|
+
description: "Collected locations; a partial observation may have an unknown remainder.",
|
|
86
|
+
}),
|
|
87
|
+
omittedCount: Type.Integer({
|
|
88
|
+
description: "Collected locations omitted by the requested selection limit.",
|
|
89
|
+
}),
|
|
90
|
+
};
|
|
91
|
+
const ContextDefinitions = Type.Union([
|
|
92
|
+
Type.Object(
|
|
93
|
+
{ status: Type.Literal("complete"), reason: Type.Null(), ...ContextDefinitionEntries },
|
|
94
|
+
{ additionalProperties: false },
|
|
95
|
+
),
|
|
96
|
+
Type.Object(
|
|
97
|
+
{ status: Type.Literal("partial"), reason: Type.String(), ...ContextDefinitionEntries },
|
|
98
|
+
{ additionalProperties: false },
|
|
99
|
+
),
|
|
100
|
+
Type.Object(
|
|
101
|
+
{ status: StringEnum(["unavailable", "withheld"]), reason: Type.String() },
|
|
102
|
+
{ additionalProperties: false },
|
|
103
|
+
),
|
|
104
|
+
]);
|
|
105
|
+
const Facts = Type.Object(
|
|
106
|
+
{
|
|
107
|
+
fileSizeBytes: Type.Optional(Type.Integer()),
|
|
108
|
+
package: Type.Optional(
|
|
109
|
+
Type.Object(
|
|
110
|
+
{
|
|
111
|
+
name: nullableString,
|
|
112
|
+
description: nullableString,
|
|
113
|
+
manifestPath: Type.String(),
|
|
114
|
+
directory: Type.String(),
|
|
115
|
+
},
|
|
116
|
+
{ additionalProperties: false },
|
|
117
|
+
),
|
|
118
|
+
),
|
|
119
|
+
manifestFields: Type.Optional(
|
|
120
|
+
Type.Array(
|
|
121
|
+
Type.Object(
|
|
122
|
+
{ field: Type.String(), value: Type.Unknown() },
|
|
123
|
+
{ additionalProperties: false },
|
|
124
|
+
),
|
|
125
|
+
),
|
|
126
|
+
),
|
|
127
|
+
dependencies: Type.Optional(
|
|
128
|
+
Type.Array(
|
|
129
|
+
Type.Object(
|
|
130
|
+
{ field: Type.String(), name: Type.String(), value: Type.Unknown() },
|
|
131
|
+
{ additionalProperties: false },
|
|
132
|
+
),
|
|
133
|
+
),
|
|
134
|
+
),
|
|
135
|
+
relationships: Type.Optional(Type.Array(Relationship)),
|
|
136
|
+
outline: Type.Optional(
|
|
137
|
+
Type.Array(
|
|
138
|
+
Type.Object(
|
|
139
|
+
{ ...SourceItem.properties, name: Type.String(), kind: Type.String() },
|
|
140
|
+
{ additionalProperties: false, ...coordinate },
|
|
141
|
+
),
|
|
142
|
+
),
|
|
143
|
+
),
|
|
144
|
+
imports: Type.Optional(
|
|
145
|
+
Type.Array(
|
|
146
|
+
Type.Object(
|
|
147
|
+
{ ...SourceItem.properties, moduleSpecifier: Type.String() },
|
|
148
|
+
{ additionalProperties: false, ...coordinate },
|
|
149
|
+
),
|
|
150
|
+
),
|
|
151
|
+
),
|
|
152
|
+
exports: Type.Optional(
|
|
153
|
+
Type.Array(
|
|
154
|
+
Type.Object(
|
|
155
|
+
{
|
|
156
|
+
...SourceItem.properties,
|
|
157
|
+
name: Type.String(),
|
|
158
|
+
kind: Type.String(),
|
|
159
|
+
moduleSpecifier: Type.Optional(Type.String()),
|
|
160
|
+
},
|
|
161
|
+
{ additionalProperties: false, ...coordinate },
|
|
162
|
+
),
|
|
163
|
+
),
|
|
164
|
+
),
|
|
165
|
+
diagnosticSnapshot: Type.Optional(
|
|
166
|
+
Type.Array(
|
|
167
|
+
Type.Object(
|
|
168
|
+
{
|
|
169
|
+
file: Type.String(),
|
|
170
|
+
total: Type.Integer(),
|
|
171
|
+
errors: Type.Integer(),
|
|
172
|
+
warnings: Type.Integer(),
|
|
173
|
+
},
|
|
174
|
+
{ additionalProperties: false },
|
|
175
|
+
),
|
|
176
|
+
),
|
|
177
|
+
),
|
|
178
|
+
snapshotCurrent: Type.Optional(Type.Boolean()),
|
|
179
|
+
node: Type.Optional(
|
|
180
|
+
Type.Union([
|
|
181
|
+
Type.Null(),
|
|
182
|
+
Type.Object(
|
|
183
|
+
{
|
|
184
|
+
type: Type.String(),
|
|
185
|
+
text: Type.String(),
|
|
186
|
+
startLine: Type.Integer(),
|
|
187
|
+
startCharacter: Type.Integer(),
|
|
188
|
+
endLine: Type.Integer(),
|
|
189
|
+
endCharacter: Type.Integer(),
|
|
190
|
+
ancestry: Type.Array(
|
|
191
|
+
Type.Object(
|
|
192
|
+
{ ...SourceItem.properties, type: Type.String() },
|
|
193
|
+
{ additionalProperties: false, ...coordinate },
|
|
194
|
+
),
|
|
195
|
+
),
|
|
196
|
+
},
|
|
197
|
+
{ additionalProperties: false, ...coordinate },
|
|
198
|
+
),
|
|
199
|
+
]),
|
|
200
|
+
),
|
|
201
|
+
nodeObservation: Type.Optional(Observation),
|
|
202
|
+
hoverObservation: Type.Optional(Observation),
|
|
203
|
+
hover: Type.Optional(
|
|
204
|
+
Type.Union([
|
|
205
|
+
Type.Null(),
|
|
206
|
+
Type.Object(
|
|
207
|
+
{ contents: Type.String(), range: Type.Optional(RecoveryRangeSchema) },
|
|
208
|
+
{ additionalProperties: false },
|
|
209
|
+
),
|
|
210
|
+
]),
|
|
211
|
+
),
|
|
212
|
+
definitions: Type.Optional(
|
|
213
|
+
Type.Array(
|
|
214
|
+
Type.Object(
|
|
215
|
+
{ file: Type.String(), range: RecoveryRangeSchema },
|
|
216
|
+
{ additionalProperties: false },
|
|
217
|
+
),
|
|
218
|
+
),
|
|
219
|
+
),
|
|
220
|
+
contextDefinitions: Type.Optional(ContextDefinitions),
|
|
221
|
+
recovery: Type.Optional(
|
|
222
|
+
Type.Array(
|
|
223
|
+
Type.Object(
|
|
224
|
+
{
|
|
225
|
+
operation: Type.String(),
|
|
226
|
+
file: Type.String(),
|
|
227
|
+
reason: Type.String(),
|
|
228
|
+
errorRanges: Type.Array(RecoveryRangeSchema),
|
|
229
|
+
},
|
|
230
|
+
{ additionalProperties: false },
|
|
231
|
+
),
|
|
232
|
+
),
|
|
233
|
+
),
|
|
234
|
+
sourceContext: Type.Optional(
|
|
235
|
+
Type.Object(
|
|
236
|
+
{
|
|
237
|
+
outline: Type.Object(
|
|
238
|
+
{
|
|
239
|
+
...SourceListFields,
|
|
240
|
+
entries: Type.Array(
|
|
241
|
+
Type.Object(
|
|
242
|
+
{
|
|
243
|
+
name: Type.String(),
|
|
244
|
+
kind: Type.String(),
|
|
245
|
+
startLine: Type.Integer(),
|
|
246
|
+
endLine: Type.Integer(),
|
|
247
|
+
},
|
|
248
|
+
{ additionalProperties: false },
|
|
249
|
+
),
|
|
250
|
+
),
|
|
251
|
+
},
|
|
252
|
+
{ additionalProperties: false },
|
|
253
|
+
),
|
|
254
|
+
imports: Type.Object(
|
|
255
|
+
{
|
|
256
|
+
...SourceListFields,
|
|
257
|
+
entries: Type.Array(
|
|
258
|
+
Type.Object({ moduleSpecifier: Type.String() }, { additionalProperties: false }),
|
|
259
|
+
),
|
|
260
|
+
},
|
|
261
|
+
{ additionalProperties: false },
|
|
262
|
+
),
|
|
263
|
+
exports: Type.Object(
|
|
264
|
+
{
|
|
265
|
+
...SourceListFields,
|
|
266
|
+
entries: Type.Array(
|
|
267
|
+
Type.Object(
|
|
268
|
+
{ name: Type.String(), kind: Type.String() },
|
|
269
|
+
{ additionalProperties: false },
|
|
270
|
+
),
|
|
271
|
+
),
|
|
272
|
+
},
|
|
273
|
+
{ additionalProperties: false },
|
|
274
|
+
),
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
additionalProperties: false,
|
|
278
|
+
description:
|
|
279
|
+
"Best-effort source lists; collectedCount is not a completeness claim when status is partial or unavailable.",
|
|
280
|
+
},
|
|
281
|
+
),
|
|
282
|
+
),
|
|
283
|
+
documentation: Type.Optional(Type.Array(Type.String())),
|
|
284
|
+
diagnostics: Type.Optional(
|
|
285
|
+
Type.Array(
|
|
286
|
+
Type.Object(
|
|
287
|
+
{
|
|
288
|
+
range: RecoveryRangeSchema,
|
|
289
|
+
severity: Type.Union([Type.Integer(), Type.Null()]),
|
|
290
|
+
message: Type.String(),
|
|
291
|
+
source: nullableString,
|
|
292
|
+
code: Type.Union([Type.String(), Type.Number(), Type.Null()]),
|
|
293
|
+
},
|
|
294
|
+
{ additionalProperties: false },
|
|
295
|
+
),
|
|
296
|
+
),
|
|
297
|
+
),
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
additionalProperties: false,
|
|
301
|
+
description:
|
|
302
|
+
"Named observations, not rendered text. Ranges use zero-based UTF-16 positions; source-item coordinates are one-based.",
|
|
303
|
+
},
|
|
304
|
+
);
|
|
305
|
+
const Section = Type.Object(
|
|
306
|
+
{
|
|
307
|
+
key: Type.String(),
|
|
308
|
+
status: StringEnum(["complete", "partial", "unavailable"]),
|
|
309
|
+
reason: nullableString,
|
|
310
|
+
confidence: ConfidenceSchema,
|
|
311
|
+
provenance: Type.Array(Provenance),
|
|
312
|
+
evidenceLists: Type.Array(EvidenceListSchema),
|
|
313
|
+
errorRanges: Type.Optional(Type.Array(RecoveryRangeSchema)),
|
|
314
|
+
facts: Type.Optional(Facts),
|
|
315
|
+
},
|
|
316
|
+
{ additionalProperties: false },
|
|
317
|
+
);
|
|
318
|
+
const Instruction = Type.Object(
|
|
319
|
+
{
|
|
320
|
+
path: Type.String(),
|
|
321
|
+
shownLines: Type.Integer(),
|
|
322
|
+
totalLines: Type.Integer(),
|
|
323
|
+
truncated: Type.Boolean(),
|
|
324
|
+
content: Type.String(),
|
|
325
|
+
},
|
|
326
|
+
{ additionalProperties: false },
|
|
327
|
+
);
|
|
328
|
+
const GradleBase = {
|
|
329
|
+
selectedRoot: Type.String(),
|
|
330
|
+
query: Type.Literal("GradleBuild/BasicGradleProject"),
|
|
331
|
+
runtime: Type.Optional(
|
|
332
|
+
Type.Object(
|
|
333
|
+
{
|
|
334
|
+
kind: StringEnum(["distribution", "installation"]),
|
|
335
|
+
source: Type.String(),
|
|
336
|
+
version: Type.String(),
|
|
337
|
+
},
|
|
338
|
+
{ additionalProperties: false },
|
|
339
|
+
),
|
|
340
|
+
),
|
|
341
|
+
};
|
|
342
|
+
const Gradle = Type.Union([
|
|
343
|
+
Type.Object(
|
|
344
|
+
{
|
|
345
|
+
...GradleBase,
|
|
346
|
+
status: Type.Literal("complete"),
|
|
347
|
+
gradleVersion: Type.String(),
|
|
348
|
+
buildRoot: Type.String(),
|
|
349
|
+
projects: Type.Array(
|
|
350
|
+
Type.Object(
|
|
351
|
+
{
|
|
352
|
+
buildRoot: Type.String(),
|
|
353
|
+
path: Type.String(),
|
|
354
|
+
name: Type.String(),
|
|
355
|
+
directory: Type.String(),
|
|
356
|
+
parentPath: nullableString,
|
|
357
|
+
},
|
|
358
|
+
{ additionalProperties: false },
|
|
359
|
+
),
|
|
360
|
+
),
|
|
361
|
+
includedBuilds: Type.Array(
|
|
362
|
+
Type.Object({ buildRoot: Type.String() }, { additionalProperties: false }),
|
|
363
|
+
),
|
|
364
|
+
},
|
|
365
|
+
{ additionalProperties: false },
|
|
366
|
+
),
|
|
367
|
+
Type.Object(
|
|
368
|
+
{
|
|
369
|
+
...GradleBase,
|
|
370
|
+
status: StringEnum([
|
|
371
|
+
"blocked",
|
|
372
|
+
"unavailable",
|
|
373
|
+
"unsupported",
|
|
374
|
+
"failed",
|
|
375
|
+
"interrupted",
|
|
376
|
+
"timeout",
|
|
377
|
+
"oversized",
|
|
378
|
+
]),
|
|
379
|
+
gradleVersion: Type.Optional(Type.String()),
|
|
380
|
+
stage: StringEnum(["authorization", "prerequisites", "query", "unknown"]),
|
|
381
|
+
reason: Type.String(),
|
|
382
|
+
},
|
|
383
|
+
{ additionalProperties: false },
|
|
384
|
+
),
|
|
385
|
+
]);
|
|
386
|
+
const Workspace = Type.Object(
|
|
387
|
+
{
|
|
388
|
+
root: Type.String(),
|
|
389
|
+
focus: Type.String(),
|
|
390
|
+
directFiles: Type.Array(
|
|
391
|
+
Type.Object(
|
|
392
|
+
{ path: Type.String(), kind: StringEnum(["file", "symlink"]) },
|
|
393
|
+
{ additionalProperties: false },
|
|
394
|
+
),
|
|
395
|
+
),
|
|
396
|
+
directories: Type.Array(
|
|
397
|
+
Type.Object(
|
|
398
|
+
{ path: Type.String(), entryCount: Type.Integer() },
|
|
399
|
+
{ additionalProperties: false },
|
|
400
|
+
),
|
|
401
|
+
),
|
|
402
|
+
extensions: Type.Array(
|
|
403
|
+
Type.Object(
|
|
404
|
+
{ extension: Type.String(), fileCount: Type.Integer() },
|
|
405
|
+
{ additionalProperties: false },
|
|
406
|
+
),
|
|
407
|
+
),
|
|
408
|
+
containingProjects: Type.Array(Project),
|
|
409
|
+
projects: Type.Array(Project),
|
|
410
|
+
memberships: Type.Array(
|
|
411
|
+
Type.Object(
|
|
412
|
+
{
|
|
413
|
+
projectId: Type.String(),
|
|
414
|
+
kind: Type.String(),
|
|
415
|
+
manifestPath: Type.String(),
|
|
416
|
+
field: Type.String(),
|
|
417
|
+
value: Type.String(),
|
|
418
|
+
},
|
|
419
|
+
{ additionalProperties: false },
|
|
420
|
+
),
|
|
421
|
+
),
|
|
422
|
+
declaredPaths: Type.Array(
|
|
423
|
+
Type.Object(
|
|
424
|
+
{
|
|
425
|
+
projectId: Type.String(),
|
|
426
|
+
paths: Type.Array(
|
|
427
|
+
Type.Object(
|
|
428
|
+
{ path: Type.String(), fields: Type.Array(Type.String()) },
|
|
429
|
+
{ additionalProperties: false },
|
|
430
|
+
),
|
|
431
|
+
),
|
|
432
|
+
},
|
|
433
|
+
{ additionalProperties: false },
|
|
434
|
+
),
|
|
435
|
+
),
|
|
436
|
+
relationships: Type.Array(Relationship),
|
|
437
|
+
dependencies: Type.Array(
|
|
438
|
+
Type.Object(
|
|
439
|
+
{
|
|
440
|
+
projectId: Type.String(),
|
|
441
|
+
field: Type.String(),
|
|
442
|
+
name: Type.String(),
|
|
443
|
+
value: Type.Unknown(),
|
|
444
|
+
},
|
|
445
|
+
{ additionalProperties: false },
|
|
446
|
+
),
|
|
447
|
+
),
|
|
448
|
+
workspaceDeclarations: Type.Array(
|
|
449
|
+
Type.Object(
|
|
450
|
+
{
|
|
451
|
+
kind: Type.String(),
|
|
452
|
+
manifestPath: Type.String(),
|
|
453
|
+
directory: Type.String(),
|
|
454
|
+
field: Type.String(),
|
|
455
|
+
patterns: Type.Array(Type.String()),
|
|
456
|
+
excludeField: nullableString,
|
|
457
|
+
excludes: Type.Array(Type.String()),
|
|
458
|
+
},
|
|
459
|
+
{ additionalProperties: false },
|
|
460
|
+
),
|
|
461
|
+
),
|
|
462
|
+
inventory: Type.Object(
|
|
463
|
+
{
|
|
464
|
+
fileCount: Type.Integer(),
|
|
465
|
+
symlinkCount: Type.Integer(),
|
|
466
|
+
source: StringEnum(["git", "filesystem"]),
|
|
467
|
+
exclude: Type.Array(Type.String()),
|
|
468
|
+
includeIgnored: Type.Boolean(),
|
|
469
|
+
symlinks: Type.Literal("not-followed"),
|
|
470
|
+
directoryNamesExcluded: Type.Literal(false),
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
additionalProperties: false,
|
|
474
|
+
description: "Counts refer to the collected inventory, which may be incomplete.",
|
|
475
|
+
},
|
|
476
|
+
),
|
|
477
|
+
collection: Type.Object(
|
|
478
|
+
{
|
|
479
|
+
status: StringEnum(["complete", "partial"]),
|
|
480
|
+
stopReason: StringEnum(["complete", "entry-limit", "deadline"]),
|
|
481
|
+
prioritizedDirectory: nullableString,
|
|
482
|
+
limits: Type.Object(
|
|
483
|
+
{ maxEntries: Type.Integer(), deadline: Type.Union([Type.Number(), Type.Null()]) },
|
|
484
|
+
{ additionalProperties: false },
|
|
485
|
+
),
|
|
486
|
+
errors: Type.Array(
|
|
487
|
+
Type.Object(
|
|
488
|
+
{ stage: Type.String(), path: nullableString, reason: Type.String() },
|
|
489
|
+
{ additionalProperties: false },
|
|
490
|
+
),
|
|
491
|
+
),
|
|
492
|
+
},
|
|
493
|
+
{ additionalProperties: false },
|
|
494
|
+
),
|
|
495
|
+
metadata: Type.Object(
|
|
496
|
+
{
|
|
497
|
+
documents: Type.Array(
|
|
498
|
+
Type.Object(
|
|
499
|
+
{
|
|
500
|
+
path: Type.String(),
|
|
501
|
+
kind: Type.String(),
|
|
502
|
+
status: Type.String(),
|
|
503
|
+
reason: nullableString,
|
|
504
|
+
},
|
|
505
|
+
{ additionalProperties: false },
|
|
506
|
+
),
|
|
507
|
+
),
|
|
508
|
+
issues: Type.Array(
|
|
509
|
+
Type.Object(
|
|
510
|
+
{
|
|
511
|
+
path: Type.String(),
|
|
512
|
+
field: nullableString,
|
|
513
|
+
kind: Type.String(),
|
|
514
|
+
reason: Type.String(),
|
|
515
|
+
},
|
|
516
|
+
{ additionalProperties: false },
|
|
517
|
+
),
|
|
518
|
+
),
|
|
519
|
+
},
|
|
520
|
+
{ additionalProperties: false },
|
|
521
|
+
),
|
|
522
|
+
gradle: Type.Optional(Gradle),
|
|
523
|
+
selections: Type.Array(EvidenceListSchema),
|
|
524
|
+
},
|
|
525
|
+
{
|
|
526
|
+
additionalProperties: false,
|
|
527
|
+
description:
|
|
528
|
+
"root and focus are absolute. Direct inventory paths are relative to focus; project and metadata paths are relative to root. Selection counts exclude text-budget reductions.",
|
|
529
|
+
},
|
|
530
|
+
);
|
|
531
|
+
|
|
532
|
+
const Common = {
|
|
533
|
+
confidence: ConfidenceSchema,
|
|
534
|
+
sections: Type.Array(Section),
|
|
535
|
+
targets: Type.Array(NavigationTargetSchema),
|
|
536
|
+
candidates: Type.Array(
|
|
537
|
+
Type.Object(
|
|
538
|
+
{
|
|
539
|
+
handle: Type.String(),
|
|
540
|
+
name: Type.String(),
|
|
541
|
+
kind: nullableString,
|
|
542
|
+
container: nullableString,
|
|
543
|
+
file: Type.String(),
|
|
544
|
+
line: Type.Integer(),
|
|
545
|
+
character: Type.Integer(),
|
|
546
|
+
rank: Type.Integer(),
|
|
547
|
+
anchorKind: Type.Optional(StringEnum(["name", "declaration"])),
|
|
548
|
+
},
|
|
549
|
+
{ additionalProperties: false, description: "One-based line and UTF-16 character." },
|
|
550
|
+
),
|
|
551
|
+
),
|
|
552
|
+
evidenceLists: Type.Array(EvidenceListSchema),
|
|
553
|
+
nextQueries: Type.Array(Type.String()),
|
|
554
|
+
readNext: Type.Array(ReadNextSchema),
|
|
555
|
+
instructions: Type.Array(Instruction),
|
|
556
|
+
observationLimitations: Type.Array(Type.String()),
|
|
557
|
+
};
|
|
558
|
+
const Snapshot = Type.Object(
|
|
559
|
+
{
|
|
560
|
+
path: Type.String(),
|
|
561
|
+
limitation: Type.Literal("Reading this snapshot does not refresh the captured observation."),
|
|
562
|
+
},
|
|
563
|
+
{ additionalProperties: false },
|
|
564
|
+
);
|
|
565
|
+
|
|
566
|
+
/** Native orientation data. Snapshot paths refer to captured facts, never a fresh observation. */
|
|
567
|
+
export const OrientationOutputSchema = Type.Union([
|
|
568
|
+
Type.Object(
|
|
569
|
+
{
|
|
570
|
+
...Common,
|
|
571
|
+
kind: Type.Literal("completed"),
|
|
572
|
+
focusKind: StringEnum(["workspace", "directory", "module"]),
|
|
573
|
+
focus: Type.Union([Type.String(), Type.Null()]),
|
|
574
|
+
workspace: Workspace,
|
|
575
|
+
snapshot: Type.Optional(Snapshot),
|
|
576
|
+
},
|
|
577
|
+
{ additionalProperties: false },
|
|
578
|
+
),
|
|
579
|
+
Type.Object(
|
|
580
|
+
{
|
|
581
|
+
...Common,
|
|
582
|
+
kind: Type.Literal("completed"),
|
|
583
|
+
focusKind: StringEnum(["file", "symbol"]),
|
|
584
|
+
focus: Type.Union([Type.String(), Type.Null()]),
|
|
585
|
+
},
|
|
586
|
+
{ additionalProperties: false },
|
|
587
|
+
),
|
|
588
|
+
Type.Object({ ...Common, kind: Type.Literal("disambiguation") }, { additionalProperties: false }),
|
|
589
|
+
Type.Object(
|
|
590
|
+
{ ...Common, kind: Type.Literal("kind-mismatch"), requestedKind: Type.String() },
|
|
591
|
+
{ additionalProperties: false },
|
|
592
|
+
),
|
|
593
|
+
Type.Object(
|
|
594
|
+
{
|
|
595
|
+
...Common,
|
|
596
|
+
kind: Type.Literal("invalid-input"),
|
|
597
|
+
message: Type.String(),
|
|
598
|
+
symlinkRejection: Type.Optional(
|
|
599
|
+
Type.Object(
|
|
600
|
+
{ requestedPath: Type.String(), blockedPath: Type.String() },
|
|
601
|
+
{ additionalProperties: false },
|
|
602
|
+
),
|
|
603
|
+
),
|
|
604
|
+
},
|
|
605
|
+
{ additionalProperties: false },
|
|
606
|
+
),
|
|
607
|
+
]);
|