@schemyx/mcp 0.1.0 → 0.1.1
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 +76 -2
- package/dist/backend-client.d.ts +1 -17
- package/dist/backend-client.js +15 -91
- package/dist/backend-client.js.map +1 -1
- package/dist/client/backend-client.d.ts +17 -0
- package/dist/client/backend-client.js +97 -0
- package/dist/client/backend-client.js.map +1 -0
- package/dist/client/local-theme-source.d.ts +19 -0
- package/dist/client/local-theme-source.js +737 -0
- package/dist/client/local-theme-source.js.map +1 -0
- package/dist/client/mcp-client.d.ts +15 -0
- package/dist/client/mcp-client.js +46 -0
- package/dist/client/mcp-client.js.map +1 -0
- package/dist/codebase-scanner/backend.d.ts +12 -0
- package/dist/codebase-scanner/backend.js +814 -0
- package/dist/codebase-scanner/backend.js.map +1 -0
- package/dist/codebase-scanner/bundle.d.ts +81 -0
- package/dist/codebase-scanner/bundle.js +2177 -0
- package/dist/codebase-scanner/bundle.js.map +1 -0
- package/dist/codebase-scanner/constants.d.ts +26 -0
- package/dist/codebase-scanner/constants.js +230 -0
- package/dist/codebase-scanner/constants.js.map +1 -0
- package/dist/codebase-scanner/extractors.d.ts +187 -0
- package/dist/codebase-scanner/extractors.js +2600 -0
- package/dist/codebase-scanner/extractors.js.map +1 -0
- package/dist/codebase-scanner/files.d.ts +16 -0
- package/dist/codebase-scanner/files.js +233 -0
- package/dist/codebase-scanner/files.js.map +1 -0
- package/dist/codebase-scanner/index.d.ts +217 -0
- package/dist/codebase-scanner/index.js +387 -0
- package/dist/codebase-scanner/index.js.map +1 -0
- package/dist/codebase-scanner/recipes.d.ts +74 -0
- package/dist/codebase-scanner/recipes.js +585 -0
- package/dist/codebase-scanner/recipes.js.map +1 -0
- package/dist/codebase-scanner/storage.d.ts +19 -0
- package/dist/codebase-scanner/storage.js +103 -0
- package/dist/codebase-scanner/storage.js.map +1 -0
- package/dist/codebase-scanner/types.d.ts +522 -0
- package/dist/codebase-scanner/types.js +3 -0
- package/dist/codebase-scanner/types.js.map +1 -0
- package/dist/codebase-scanner/utils.d.ts +37 -0
- package/dist/codebase-scanner/utils.js +259 -0
- package/dist/codebase-scanner/utils.js.map +1 -0
- package/dist/codebase-scanner.d.ts +1 -0
- package/dist/codebase-scanner.js +18 -0
- package/dist/codebase-scanner.js.map +1 -0
- package/dist/config.d.ts +1 -2
- package/dist/config.js +15 -37
- package/dist/config.js.map +1 -1
- package/dist/local-theme-source.d.ts +1 -0
- package/dist/local-theme-source.js +18 -0
- package/dist/local-theme-source.js.map +1 -0
- package/dist/main.js +3 -3
- package/dist/main.js.map +1 -1
- package/dist/mcp-client.d.ts +1 -0
- package/dist/mcp-client.js +18 -0
- package/dist/mcp-client.js.map +1 -0
- package/dist/prompts.d.ts +1 -7
- package/dist/prompts.js +15 -52
- package/dist/prompts.js.map +1 -1
- package/dist/server/index.d.ts +4 -0
- package/dist/server/index.js +163 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/prompts.d.ts +7 -0
- package/dist/server/prompts.js +55 -0
- package/dist/server/prompts.js.map +1 -0
- package/dist/server/tool-definitions.d.ts +22 -0
- package/dist/server/tool-definitions.js +531 -0
- package/dist/server/tool-definitions.js.map +1 -0
- package/dist/server.d.ts +3 -3
- package/dist/server.js +33 -0
- package/dist/server.js.map +1 -1
- package/dist/shared/config.d.ts +2 -0
- package/dist/shared/config.js +54 -0
- package/dist/shared/config.js.map +1 -0
- package/dist/shared/text.d.ts +14 -0
- package/dist/shared/text.js +33 -0
- package/dist/shared/text.js.map +1 -0
- package/dist/shared/types.d.ts +118 -0
- package/dist/shared/types.js +3 -0
- package/dist/shared/types.js.map +1 -0
- package/dist/shared/uri.d.ts +6 -0
- package/dist/shared/uri.js +24 -0
- package/dist/shared/uri.js.map +1 -0
- package/dist/style-recipes.d.ts +1 -0
- package/dist/style-recipes.js +18 -0
- package/dist/style-recipes.js.map +1 -0
- package/dist/text.d.ts +1 -14
- package/dist/text.js +15 -30
- package/dist/text.js.map +1 -1
- package/dist/theme/style-recipes.d.ts +26 -0
- package/dist/theme/style-recipes.js +129 -0
- package/dist/theme/style-recipes.js.map +1 -0
- package/dist/tool-definitions.d.ts +1 -11
- package/dist/tool-definitions.js +15 -127
- package/dist/tool-definitions.js.map +1 -1
- package/dist/types.d.ts +1 -106
- package/dist/types.js +15 -0
- package/dist/types.js.map +1 -1
- package/dist/uri.d.ts +1 -6
- package/dist/uri.js +15 -21
- package/dist/uri.js.map +1 -1
- package/package.json +5 -2
|
@@ -0,0 +1,522 @@
|
|
|
1
|
+
import type { bundleSchemaVersion, graphSchemaVersion, indexSchemaVersion, recipeGroups, recipeSchemaVersion } from './constants';
|
|
2
|
+
export type CodebaseProjectType = 'frontend' | 'backend' | 'full' | 'custom';
|
|
3
|
+
export type RecipeGroup = (typeof recipeGroups)[number];
|
|
4
|
+
export type RecipeStatus = 'approved' | 'inferred' | 'needs_review' | 'stale';
|
|
5
|
+
export type Confidence = 'high' | 'medium' | 'low' | 'inferred';
|
|
6
|
+
export type ContextDepth = 'brief' | 'standard' | 'deep';
|
|
7
|
+
export type PatternReuseDecision = 'prefer' | 'allow' | 'avoid' | 'review';
|
|
8
|
+
export interface PatternScores {
|
|
9
|
+
appearances: number;
|
|
10
|
+
files: number;
|
|
11
|
+
routes: number;
|
|
12
|
+
owners: string[];
|
|
13
|
+
structuralSimilarity: number;
|
|
14
|
+
styleSimilarity: number;
|
|
15
|
+
behaviorSimilarity: number;
|
|
16
|
+
canonical: number;
|
|
17
|
+
oneOffRisk: number;
|
|
18
|
+
}
|
|
19
|
+
export interface PatternDecision {
|
|
20
|
+
reuse: PatternReuseDecision;
|
|
21
|
+
scope: string;
|
|
22
|
+
reason: string;
|
|
23
|
+
}
|
|
24
|
+
export interface ScanArgs {
|
|
25
|
+
projectType?: unknown;
|
|
26
|
+
rootPath?: unknown;
|
|
27
|
+
includePaths?: unknown;
|
|
28
|
+
excludePaths?: unknown;
|
|
29
|
+
outputDir?: unknown;
|
|
30
|
+
maxFiles?: unknown;
|
|
31
|
+
dryRun?: unknown;
|
|
32
|
+
}
|
|
33
|
+
export interface ListArgs {
|
|
34
|
+
rootPath?: unknown;
|
|
35
|
+
outputDir?: unknown;
|
|
36
|
+
query?: unknown;
|
|
37
|
+
group?: unknown;
|
|
38
|
+
limit?: unknown;
|
|
39
|
+
cursor?: unknown;
|
|
40
|
+
depth?: unknown;
|
|
41
|
+
}
|
|
42
|
+
export interface SearchArgs extends ListArgs {
|
|
43
|
+
key?: unknown;
|
|
44
|
+
kind?: unknown;
|
|
45
|
+
status?: unknown;
|
|
46
|
+
confidence?: unknown;
|
|
47
|
+
}
|
|
48
|
+
export interface GetArgs {
|
|
49
|
+
rootPath?: unknown;
|
|
50
|
+
outputDir?: unknown;
|
|
51
|
+
key?: unknown;
|
|
52
|
+
includeDeps?: unknown;
|
|
53
|
+
includeUsedBy?: unknown;
|
|
54
|
+
maxRelated?: unknown;
|
|
55
|
+
depth?: unknown;
|
|
56
|
+
}
|
|
57
|
+
export interface ContextPackArgs {
|
|
58
|
+
rootPath?: unknown;
|
|
59
|
+
outputDir?: unknown;
|
|
60
|
+
key?: unknown;
|
|
61
|
+
task?: unknown;
|
|
62
|
+
depth?: unknown;
|
|
63
|
+
maxItems?: unknown;
|
|
64
|
+
tokenBudget?: unknown;
|
|
65
|
+
includeSource?: unknown;
|
|
66
|
+
}
|
|
67
|
+
export interface GraphArgs {
|
|
68
|
+
rootPath?: unknown;
|
|
69
|
+
outputDir?: unknown;
|
|
70
|
+
key?: unknown;
|
|
71
|
+
kinds?: unknown;
|
|
72
|
+
edgeTypes?: unknown;
|
|
73
|
+
direction?: unknown;
|
|
74
|
+
radius?: unknown;
|
|
75
|
+
limitNodes?: unknown;
|
|
76
|
+
limitEdges?: unknown;
|
|
77
|
+
cursor?: unknown;
|
|
78
|
+
}
|
|
79
|
+
export interface ReviewArgs {
|
|
80
|
+
rootPath?: unknown;
|
|
81
|
+
outputDir?: unknown;
|
|
82
|
+
status?: unknown;
|
|
83
|
+
type?: unknown;
|
|
84
|
+
group?: unknown;
|
|
85
|
+
limit?: unknown;
|
|
86
|
+
cursor?: unknown;
|
|
87
|
+
}
|
|
88
|
+
export interface FreshnessArgs {
|
|
89
|
+
rootPath?: unknown;
|
|
90
|
+
outputDir?: unknown;
|
|
91
|
+
keys?: unknown;
|
|
92
|
+
includeChangedFiles?: unknown;
|
|
93
|
+
limit?: unknown;
|
|
94
|
+
}
|
|
95
|
+
export interface ReadFileArgs {
|
|
96
|
+
rootPath?: unknown;
|
|
97
|
+
outputDir?: unknown;
|
|
98
|
+
key?: unknown;
|
|
99
|
+
path?: unknown;
|
|
100
|
+
maxBytes?: unknown;
|
|
101
|
+
}
|
|
102
|
+
export interface AnalyzedFile {
|
|
103
|
+
relPath: string;
|
|
104
|
+
key: string;
|
|
105
|
+
kind: string;
|
|
106
|
+
layer: string;
|
|
107
|
+
language: string;
|
|
108
|
+
size: number;
|
|
109
|
+
imports: string[];
|
|
110
|
+
exports: string[];
|
|
111
|
+
symbols: string[];
|
|
112
|
+
functions: string[];
|
|
113
|
+
classes: string[];
|
|
114
|
+
types: string[];
|
|
115
|
+
constants: string[];
|
|
116
|
+
components: string[];
|
|
117
|
+
componentProps: Record<string, string[]>;
|
|
118
|
+
hooks: string[];
|
|
119
|
+
routes: string[];
|
|
120
|
+
apiHandlers: string[];
|
|
121
|
+
controllers: string[];
|
|
122
|
+
services: string[];
|
|
123
|
+
modules: string[];
|
|
124
|
+
models: string[];
|
|
125
|
+
modelFields: Record<string, string[]>;
|
|
126
|
+
cssVariables: string[];
|
|
127
|
+
cssVariableValues: CssVariableValue[];
|
|
128
|
+
cssRules: CssRuleDetail[];
|
|
129
|
+
cssClasses: string[];
|
|
130
|
+
classReferences: string[];
|
|
131
|
+
classExpressions: ClassExpression[];
|
|
132
|
+
cssIds: string[];
|
|
133
|
+
cssVariableReferences: string[];
|
|
134
|
+
tailwindUtilities: string[];
|
|
135
|
+
componentStyleDefinitions: ComponentStyleDefinition[];
|
|
136
|
+
themeTokens: ThemeToken[];
|
|
137
|
+
inlineStyles: InlineStyle[];
|
|
138
|
+
dependencies: string[];
|
|
139
|
+
jsxElements: string[];
|
|
140
|
+
uiElements: UiElement[];
|
|
141
|
+
apiCalls: string[];
|
|
142
|
+
envVars: string[];
|
|
143
|
+
tests: string[];
|
|
144
|
+
docsHeadings: string[];
|
|
145
|
+
configKeys: string[];
|
|
146
|
+
templateIncludes: string[];
|
|
147
|
+
authHints: string[];
|
|
148
|
+
middleware: string[];
|
|
149
|
+
jobs: string[];
|
|
150
|
+
events: string[];
|
|
151
|
+
backendEndpointContracts: BackendEndpointContract[];
|
|
152
|
+
backendOperations: BackendOperationContract[];
|
|
153
|
+
backendSideEffects: BackendSideEffect[];
|
|
154
|
+
backendErrors: BackendErrorContract[];
|
|
155
|
+
backendLogging: BackendLoggingContract[];
|
|
156
|
+
sourceHash: string;
|
|
157
|
+
summary: string;
|
|
158
|
+
tags: string[];
|
|
159
|
+
}
|
|
160
|
+
export interface BackendEndpointParam {
|
|
161
|
+
name: string;
|
|
162
|
+
source: 'body' | 'query' | 'path' | 'request' | 'response' | 'current-user' | 'unknown';
|
|
163
|
+
type?: string;
|
|
164
|
+
required?: boolean;
|
|
165
|
+
decorator?: string;
|
|
166
|
+
}
|
|
167
|
+
export interface BackendAuthPolicy {
|
|
168
|
+
required: boolean;
|
|
169
|
+
public: boolean;
|
|
170
|
+
guards: string[];
|
|
171
|
+
roles: string[];
|
|
172
|
+
permissions: string[];
|
|
173
|
+
hints: string[];
|
|
174
|
+
confidence: Confidence;
|
|
175
|
+
}
|
|
176
|
+
export interface BackendValidationContract {
|
|
177
|
+
bodyType?: string;
|
|
178
|
+
queryType?: string;
|
|
179
|
+
pathParams: BackendEndpointParam[];
|
|
180
|
+
decorators: string[];
|
|
181
|
+
confidence: Confidence;
|
|
182
|
+
}
|
|
183
|
+
export interface BackendServiceCall {
|
|
184
|
+
receiver: string;
|
|
185
|
+
method: string;
|
|
186
|
+
await: boolean;
|
|
187
|
+
line: number;
|
|
188
|
+
kind: 'service' | 'repository' | 'client' | 'provider' | 'unknown';
|
|
189
|
+
}
|
|
190
|
+
export interface BackendSideEffect {
|
|
191
|
+
kind: 'database-write' | 'email' | 'queue' | 'event' | 'cookie' | 'header' | 'external-api' | 'file' | 'cache' | 'unknown';
|
|
192
|
+
target?: string;
|
|
193
|
+
operation?: string;
|
|
194
|
+
line: number;
|
|
195
|
+
confidence: Confidence;
|
|
196
|
+
}
|
|
197
|
+
export interface BackendErrorContract {
|
|
198
|
+
kind: string;
|
|
199
|
+
message?: string;
|
|
200
|
+
statusCode?: number;
|
|
201
|
+
line: number;
|
|
202
|
+
}
|
|
203
|
+
export interface BackendLoggingContract {
|
|
204
|
+
level: 'log' | 'warn' | 'error' | 'debug' | 'verbose';
|
|
205
|
+
message?: string;
|
|
206
|
+
line: number;
|
|
207
|
+
}
|
|
208
|
+
export interface BackendEndpointContract {
|
|
209
|
+
framework: string;
|
|
210
|
+
method: string;
|
|
211
|
+
path: string;
|
|
212
|
+
fullPath?: string;
|
|
213
|
+
handler: string;
|
|
214
|
+
handlerName?: string;
|
|
215
|
+
controller?: string;
|
|
216
|
+
line: number;
|
|
217
|
+
decorators: string[];
|
|
218
|
+
params: BackendEndpointParam[];
|
|
219
|
+
request: {
|
|
220
|
+
bodyType?: string;
|
|
221
|
+
queryType?: string;
|
|
222
|
+
pathParams: BackendEndpointParam[];
|
|
223
|
+
usesRequest: boolean;
|
|
224
|
+
usesResponse: boolean;
|
|
225
|
+
};
|
|
226
|
+
response: {
|
|
227
|
+
type?: string;
|
|
228
|
+
statusCodes: number[];
|
|
229
|
+
returns: string[];
|
|
230
|
+
};
|
|
231
|
+
auth: BackendAuthPolicy;
|
|
232
|
+
validation: BackendValidationContract;
|
|
233
|
+
serviceCalls: BackendServiceCall[];
|
|
234
|
+
repositoryCalls: BackendServiceCall[];
|
|
235
|
+
sideEffects: BackendSideEffect[];
|
|
236
|
+
errors: BackendErrorContract[];
|
|
237
|
+
logging: BackendLoggingContract[];
|
|
238
|
+
risk: string[];
|
|
239
|
+
}
|
|
240
|
+
export interface BackendOperationContract {
|
|
241
|
+
framework: string;
|
|
242
|
+
owner: string;
|
|
243
|
+
ownerKind: 'controller' | 'service' | 'module' | 'unknown';
|
|
244
|
+
name: string;
|
|
245
|
+
signature: string;
|
|
246
|
+
line: number;
|
|
247
|
+
params: BackendEndpointParam[];
|
|
248
|
+
returnType?: string;
|
|
249
|
+
serviceCalls: BackendServiceCall[];
|
|
250
|
+
repositoryCalls: BackendServiceCall[];
|
|
251
|
+
sideEffects: BackendSideEffect[];
|
|
252
|
+
errors: BackendErrorContract[];
|
|
253
|
+
logging: BackendLoggingContract[];
|
|
254
|
+
risk: string[];
|
|
255
|
+
}
|
|
256
|
+
export interface UiElement {
|
|
257
|
+
index: number;
|
|
258
|
+
kind: string;
|
|
259
|
+
tag: string;
|
|
260
|
+
originalTag: string;
|
|
261
|
+
line: number;
|
|
262
|
+
depth?: number;
|
|
263
|
+
parentIndex?: number;
|
|
264
|
+
parentKind?: string;
|
|
265
|
+
parentTag?: string;
|
|
266
|
+
parentClasses?: string[];
|
|
267
|
+
parentClassGroups?: Record<string, string[]>;
|
|
268
|
+
layoutRole?: string;
|
|
269
|
+
label?: string;
|
|
270
|
+
classes: string[];
|
|
271
|
+
defaultClasses?: string[];
|
|
272
|
+
conditionalClasses?: string[];
|
|
273
|
+
decorativeAccentClasses?: string[];
|
|
274
|
+
classSource?: string;
|
|
275
|
+
classGroups?: Record<string, string[]>;
|
|
276
|
+
responsiveClasses?: string[];
|
|
277
|
+
stateClasses?: string[];
|
|
278
|
+
childSummary?: UiElementChildSummary[];
|
|
279
|
+
id?: string;
|
|
280
|
+
role?: string;
|
|
281
|
+
type?: string;
|
|
282
|
+
href?: string;
|
|
283
|
+
action?: string;
|
|
284
|
+
method?: string;
|
|
285
|
+
props?: Record<string, string>;
|
|
286
|
+
variants?: Record<string, string>;
|
|
287
|
+
evidence: string;
|
|
288
|
+
}
|
|
289
|
+
export interface UiElementChildSummary {
|
|
290
|
+
index: number;
|
|
291
|
+
kind: string;
|
|
292
|
+
tag: string;
|
|
293
|
+
originalTag: string;
|
|
294
|
+
layoutRole?: string;
|
|
295
|
+
classes: string[];
|
|
296
|
+
defaultClasses?: string[];
|
|
297
|
+
conditionalClasses?: string[];
|
|
298
|
+
label?: string;
|
|
299
|
+
}
|
|
300
|
+
export interface ConnectedPatternEvidence {
|
|
301
|
+
path: string;
|
|
302
|
+
line?: number;
|
|
303
|
+
component?: string;
|
|
304
|
+
route?: string;
|
|
305
|
+
key?: string;
|
|
306
|
+
label?: string;
|
|
307
|
+
sourceHash: string;
|
|
308
|
+
}
|
|
309
|
+
export interface ConnectedPatternInstance {
|
|
310
|
+
domain: 'frontend' | 'backend' | 'data';
|
|
311
|
+
concept: string;
|
|
312
|
+
signature: string;
|
|
313
|
+
summary: string;
|
|
314
|
+
file: AnalyzedFile;
|
|
315
|
+
root?: {
|
|
316
|
+
kind?: string;
|
|
317
|
+
tag?: string;
|
|
318
|
+
layoutRole?: string;
|
|
319
|
+
classes?: string[];
|
|
320
|
+
defaultClasses?: string[];
|
|
321
|
+
conditionalClasses?: string[];
|
|
322
|
+
decorativeAccentClasses?: string[];
|
|
323
|
+
classGroups?: Record<string, string[]>;
|
|
324
|
+
};
|
|
325
|
+
children?: Array<Record<string, unknown>>;
|
|
326
|
+
graphKeys: string[];
|
|
327
|
+
tags: string[];
|
|
328
|
+
evidence: ConnectedPatternEvidence;
|
|
329
|
+
value: Record<string, unknown>;
|
|
330
|
+
baseWeight: number;
|
|
331
|
+
}
|
|
332
|
+
export interface ConnectedPatternCluster {
|
|
333
|
+
domain: 'frontend' | 'backend' | 'data';
|
|
334
|
+
concept: string;
|
|
335
|
+
signature: string;
|
|
336
|
+
key: string;
|
|
337
|
+
name: string;
|
|
338
|
+
summary: string;
|
|
339
|
+
score: number;
|
|
340
|
+
confidence: Confidence;
|
|
341
|
+
status: RecipeStatus;
|
|
342
|
+
instances: ConnectedPatternInstance[];
|
|
343
|
+
tags: string[];
|
|
344
|
+
dependencies: string[];
|
|
345
|
+
value: Record<string, unknown>;
|
|
346
|
+
}
|
|
347
|
+
export interface CssVariableValue {
|
|
348
|
+
name: string;
|
|
349
|
+
value: string;
|
|
350
|
+
selector?: string;
|
|
351
|
+
line: number;
|
|
352
|
+
}
|
|
353
|
+
export interface CssDeclaration {
|
|
354
|
+
property: string;
|
|
355
|
+
value: string;
|
|
356
|
+
}
|
|
357
|
+
export interface CssRuleDetail {
|
|
358
|
+
selector: string;
|
|
359
|
+
declarations: CssDeclaration[];
|
|
360
|
+
line: number;
|
|
361
|
+
}
|
|
362
|
+
export interface ClassExpression {
|
|
363
|
+
kind: 'attribute' | 'helper' | 'variant-definition' | 'string-literal';
|
|
364
|
+
raw: string;
|
|
365
|
+
classes: string[];
|
|
366
|
+
defaultClasses?: string[];
|
|
367
|
+
conditionalClasses?: string[];
|
|
368
|
+
line: number;
|
|
369
|
+
target?: string;
|
|
370
|
+
}
|
|
371
|
+
export interface ClassSourceAnalysis {
|
|
372
|
+
classes: string[];
|
|
373
|
+
defaultClasses: string[];
|
|
374
|
+
conditionalClasses: string[];
|
|
375
|
+
decorativeAccentClasses: string[];
|
|
376
|
+
}
|
|
377
|
+
export interface StringLiteralRange {
|
|
378
|
+
value: string;
|
|
379
|
+
start: number;
|
|
380
|
+
end: number;
|
|
381
|
+
}
|
|
382
|
+
export interface ComponentStyleDefinition {
|
|
383
|
+
name: string;
|
|
384
|
+
kind: 'cva' | 'variant-object' | 'class-map';
|
|
385
|
+
line: number;
|
|
386
|
+
baseClasses: string[];
|
|
387
|
+
variants: Record<string, Record<string, string[]>>;
|
|
388
|
+
defaultVariants: Record<string, string>;
|
|
389
|
+
classes: string[];
|
|
390
|
+
source: string;
|
|
391
|
+
}
|
|
392
|
+
export interface ThemeToken {
|
|
393
|
+
path: string;
|
|
394
|
+
value: string;
|
|
395
|
+
type: 'color' | 'size' | 'font' | 'shadow' | 'radius' | 'spacing' | 'unknown';
|
|
396
|
+
line?: number;
|
|
397
|
+
}
|
|
398
|
+
export interface InlineStyle {
|
|
399
|
+
tag?: string;
|
|
400
|
+
line: number;
|
|
401
|
+
raw: string;
|
|
402
|
+
properties: CssDeclaration[];
|
|
403
|
+
}
|
|
404
|
+
export interface RegistryEntry {
|
|
405
|
+
key: string;
|
|
406
|
+
group: RecipeGroup;
|
|
407
|
+
summary: string;
|
|
408
|
+
tags: string[];
|
|
409
|
+
dependencies: string[];
|
|
410
|
+
usedBy: string[];
|
|
411
|
+
confidence: Confidence;
|
|
412
|
+
status: RecipeStatus;
|
|
413
|
+
path?: string;
|
|
414
|
+
value: Record<string, unknown>;
|
|
415
|
+
}
|
|
416
|
+
export interface GraphNode {
|
|
417
|
+
k: string;
|
|
418
|
+
kind: string;
|
|
419
|
+
name: string;
|
|
420
|
+
path?: string;
|
|
421
|
+
language?: string;
|
|
422
|
+
framework?: string;
|
|
423
|
+
facets?: Record<string, unknown>;
|
|
424
|
+
source?: SourceInfo;
|
|
425
|
+
}
|
|
426
|
+
export interface GraphEdge {
|
|
427
|
+
from: string;
|
|
428
|
+
to: string;
|
|
429
|
+
type: string;
|
|
430
|
+
confidence?: Confidence;
|
|
431
|
+
source?: SourceInfo;
|
|
432
|
+
}
|
|
433
|
+
export interface SourceInfo {
|
|
434
|
+
extractor: string;
|
|
435
|
+
confidence: Confidence;
|
|
436
|
+
evidence: string[];
|
|
437
|
+
path?: string;
|
|
438
|
+
hash?: string;
|
|
439
|
+
}
|
|
440
|
+
export interface ReviewItem {
|
|
441
|
+
id: string;
|
|
442
|
+
type: 'duplicate_key' | 'concept_collision' | 'role_collision' | 'stale_approval' | 'low_confidence' | 'missing_rule';
|
|
443
|
+
status: 'open' | 'resolved';
|
|
444
|
+
group?: string;
|
|
445
|
+
s: string;
|
|
446
|
+
candidates: string[];
|
|
447
|
+
}
|
|
448
|
+
export interface CodebaseBundle {
|
|
449
|
+
scanId: string;
|
|
450
|
+
generatedAt: string;
|
|
451
|
+
rootPath: string;
|
|
452
|
+
projectType: CodebaseProjectType;
|
|
453
|
+
files: AnalyzedFile[];
|
|
454
|
+
entries: RegistryEntry[];
|
|
455
|
+
nodes: GraphNode[];
|
|
456
|
+
edges: GraphEdge[];
|
|
457
|
+
reviewItems: ReviewItem[];
|
|
458
|
+
detected: {
|
|
459
|
+
languages: string[];
|
|
460
|
+
frameworks: string[];
|
|
461
|
+
};
|
|
462
|
+
}
|
|
463
|
+
export interface CodebaseManifest {
|
|
464
|
+
v: typeof bundleSchemaVersion;
|
|
465
|
+
scanId: string;
|
|
466
|
+
rootName: string;
|
|
467
|
+
projectType: CodebaseProjectType;
|
|
468
|
+
generatedAt: string;
|
|
469
|
+
localOnly: true;
|
|
470
|
+
schema: {
|
|
471
|
+
graph: typeof graphSchemaVersion;
|
|
472
|
+
index: typeof indexSchemaVersion;
|
|
473
|
+
recipe: typeof recipeSchemaVersion;
|
|
474
|
+
};
|
|
475
|
+
extractors: Array<{
|
|
476
|
+
id: string;
|
|
477
|
+
version: string;
|
|
478
|
+
}>;
|
|
479
|
+
stats: {
|
|
480
|
+
files: number;
|
|
481
|
+
nodes: number;
|
|
482
|
+
edges: number;
|
|
483
|
+
recipes: number;
|
|
484
|
+
reviewItems: number;
|
|
485
|
+
};
|
|
486
|
+
paths: {
|
|
487
|
+
nodes: string;
|
|
488
|
+
edges: string;
|
|
489
|
+
groups: string;
|
|
490
|
+
aliases: string;
|
|
491
|
+
terms: string;
|
|
492
|
+
review: string;
|
|
493
|
+
};
|
|
494
|
+
}
|
|
495
|
+
export interface RecipeRecord {
|
|
496
|
+
k: string;
|
|
497
|
+
g: RecipeGroup;
|
|
498
|
+
d: string[];
|
|
499
|
+
u: string[];
|
|
500
|
+
s: string;
|
|
501
|
+
t: string[];
|
|
502
|
+
p?: string;
|
|
503
|
+
confidence: Confidence;
|
|
504
|
+
status: RecipeStatus;
|
|
505
|
+
v: Record<string, unknown>;
|
|
506
|
+
}
|
|
507
|
+
export interface SearchMatch {
|
|
508
|
+
k: string;
|
|
509
|
+
g: string;
|
|
510
|
+
kind: string;
|
|
511
|
+
name?: string;
|
|
512
|
+
s: string;
|
|
513
|
+
t: string[];
|
|
514
|
+
d: string[];
|
|
515
|
+
u: string[];
|
|
516
|
+
p: string | null;
|
|
517
|
+
confidence: Confidence;
|
|
518
|
+
status: RecipeStatus;
|
|
519
|
+
score: number;
|
|
520
|
+
scores?: PatternScores;
|
|
521
|
+
decision?: PatternDecision;
|
|
522
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/codebase-scanner/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { CodebaseProjectType } from './types';
|
|
2
|
+
export declare function stringArrayValue(value: unknown): string[];
|
|
3
|
+
export declare function toJsonLines(values: unknown[]): string;
|
|
4
|
+
export declare function estimateTokens(value: unknown): number;
|
|
5
|
+
export declare function cursorToOffset(value: unknown): number;
|
|
6
|
+
export declare function lineNumberAt(content: string, index: number): number;
|
|
7
|
+
export declare function truncate(value: string, maxLength: number): string;
|
|
8
|
+
export declare function classBase(className: string): string;
|
|
9
|
+
export declare function pathTerms(relPath: string): string[];
|
|
10
|
+
export declare function toKebabCase(value: string): string;
|
|
11
|
+
export declare function resolveRootPath(value: unknown): string;
|
|
12
|
+
export declare function resolveOutputDir(rootPath: string, value: string): string;
|
|
13
|
+
export declare function resolveInsideRoot(rootPath: string, value: string): string;
|
|
14
|
+
export declare function isInsideRoot(rootPath: string, fullPath: string): boolean;
|
|
15
|
+
export declare function pathExists(filePath: string): Promise<boolean>;
|
|
16
|
+
export declare function requiredProjectType(value: unknown): CodebaseProjectType;
|
|
17
|
+
export declare function requiredStringArg(value: unknown, name: string): string;
|
|
18
|
+
export declare function stringArg(value: unknown): string | undefined;
|
|
19
|
+
export declare function stringArrayArg(value: unknown): string[];
|
|
20
|
+
export declare function numberArg(value: unknown, fallback: number, min: number, max: number): number;
|
|
21
|
+
export declare function toRegistryKey(group: string, value: string): string;
|
|
22
|
+
export declare function toPosixPath(value: string): string;
|
|
23
|
+
export declare function stripLeadingDot(value: string): string;
|
|
24
|
+
export declare function stripQuery(value: string): string;
|
|
25
|
+
export declare function unique<T>(values: T[]): T[];
|
|
26
|
+
export declare function uniqueBy<T>(values: T[], keyFn: (value: T) => string): T[];
|
|
27
|
+
export declare function groupBy<T>(values: T[], keyFn: (value: T) => string): Map<string, T[]>;
|
|
28
|
+
export declare function isPascalCase(value: string): boolean;
|
|
29
|
+
export declare function isRelativeImport(value: string): boolean;
|
|
30
|
+
export declare function resolveImportPath(fromRelPath: string, importValue: string, relPaths: Set<string>, rootPath: string): string | undefined;
|
|
31
|
+
export declare function matchingNames(names: string[], value: string): string[];
|
|
32
|
+
export declare function readAttr(attrs: string, name: string): string | undefined;
|
|
33
|
+
export declare function titleCase(value: string): string;
|
|
34
|
+
export declare function toPascalCase(value: string): string;
|
|
35
|
+
export declare function escapeRegExp(value: string): string;
|
|
36
|
+
export declare function shortHash(value: string): string;
|
|
37
|
+
export declare function clampPatternScore(value: number): number;
|