@schemyx/mcp 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/README.md +79 -2
  2. package/dist/backend-client.d.ts +1 -17
  3. package/dist/backend-client.js +15 -91
  4. package/dist/backend-client.js.map +1 -1
  5. package/dist/client/backend-client.d.ts +17 -0
  6. package/dist/client/backend-client.js +97 -0
  7. package/dist/client/backend-client.js.map +1 -0
  8. package/dist/client/local-theme-source.d.ts +19 -0
  9. package/dist/client/local-theme-source.js +737 -0
  10. package/dist/client/local-theme-source.js.map +1 -0
  11. package/dist/client/mcp-client.d.ts +15 -0
  12. package/dist/client/mcp-client.js +46 -0
  13. package/dist/client/mcp-client.js.map +1 -0
  14. package/dist/codebase-scanner/backend.d.ts +12 -0
  15. package/dist/codebase-scanner/backend.js +814 -0
  16. package/dist/codebase-scanner/backend.js.map +1 -0
  17. package/dist/codebase-scanner/bundle.d.ts +315 -0
  18. package/dist/codebase-scanner/bundle.js +5195 -0
  19. package/dist/codebase-scanner/bundle.js.map +1 -0
  20. package/dist/codebase-scanner/constants.d.ts +26 -0
  21. package/dist/codebase-scanner/constants.js +231 -0
  22. package/dist/codebase-scanner/constants.js.map +1 -0
  23. package/dist/codebase-scanner/database.d.ts +8 -0
  24. package/dist/codebase-scanner/database.js +1252 -0
  25. package/dist/codebase-scanner/database.js.map +1 -0
  26. package/dist/codebase-scanner/extractors.d.ts +241 -0
  27. package/dist/codebase-scanner/extractors.js +3513 -0
  28. package/dist/codebase-scanner/extractors.js.map +1 -0
  29. package/dist/codebase-scanner/files.d.ts +16 -0
  30. package/dist/codebase-scanner/files.js +250 -0
  31. package/dist/codebase-scanner/files.js.map +1 -0
  32. package/dist/codebase-scanner/index.d.ts +217 -0
  33. package/dist/codebase-scanner/index.js +387 -0
  34. package/dist/codebase-scanner/index.js.map +1 -0
  35. package/dist/codebase-scanner/recipes.d.ts +74 -0
  36. package/dist/codebase-scanner/recipes.js +743 -0
  37. package/dist/codebase-scanner/recipes.js.map +1 -0
  38. package/dist/codebase-scanner/storage.d.ts +19 -0
  39. package/dist/codebase-scanner/storage.js +103 -0
  40. package/dist/codebase-scanner/storage.js.map +1 -0
  41. package/dist/codebase-scanner/types.d.ts +743 -0
  42. package/dist/codebase-scanner/types.js +3 -0
  43. package/dist/codebase-scanner/types.js.map +1 -0
  44. package/dist/codebase-scanner/utils.d.ts +37 -0
  45. package/dist/codebase-scanner/utils.js +259 -0
  46. package/dist/codebase-scanner/utils.js.map +1 -0
  47. package/dist/codebase-scanner.d.ts +1 -0
  48. package/dist/codebase-scanner.js +18 -0
  49. package/dist/codebase-scanner.js.map +1 -0
  50. package/dist/config.d.ts +1 -2
  51. package/dist/config.js +15 -37
  52. package/dist/config.js.map +1 -1
  53. package/dist/local-theme-source.d.ts +1 -0
  54. package/dist/local-theme-source.js +18 -0
  55. package/dist/local-theme-source.js.map +1 -0
  56. package/dist/main.js +3 -3
  57. package/dist/main.js.map +1 -1
  58. package/dist/mcp-client.d.ts +1 -0
  59. package/dist/mcp-client.js +18 -0
  60. package/dist/mcp-client.js.map +1 -0
  61. package/dist/prompts.d.ts +1 -7
  62. package/dist/prompts.js +15 -52
  63. package/dist/prompts.js.map +1 -1
  64. package/dist/server/index.d.ts +4 -0
  65. package/dist/server/index.js +163 -0
  66. package/dist/server/index.js.map +1 -0
  67. package/dist/server/prompts.d.ts +7 -0
  68. package/dist/server/prompts.js +55 -0
  69. package/dist/server/prompts.js.map +1 -0
  70. package/dist/server/tool-definitions.d.ts +22 -0
  71. package/dist/server/tool-definitions.js +531 -0
  72. package/dist/server/tool-definitions.js.map +1 -0
  73. package/dist/server.d.ts +3 -3
  74. package/dist/server.js +33 -0
  75. package/dist/server.js.map +1 -1
  76. package/dist/shared/config.d.ts +2 -0
  77. package/dist/shared/config.js +54 -0
  78. package/dist/shared/config.js.map +1 -0
  79. package/dist/shared/text.d.ts +14 -0
  80. package/dist/shared/text.js +33 -0
  81. package/dist/shared/text.js.map +1 -0
  82. package/dist/shared/types.d.ts +118 -0
  83. package/dist/shared/types.js +3 -0
  84. package/dist/shared/types.js.map +1 -0
  85. package/dist/shared/uri.d.ts +6 -0
  86. package/dist/shared/uri.js +24 -0
  87. package/dist/shared/uri.js.map +1 -0
  88. package/dist/style-recipes.d.ts +1 -0
  89. package/dist/style-recipes.js +18 -0
  90. package/dist/style-recipes.js.map +1 -0
  91. package/dist/text.d.ts +1 -14
  92. package/dist/text.js +15 -30
  93. package/dist/text.js.map +1 -1
  94. package/dist/theme/style-recipes.d.ts +26 -0
  95. package/dist/theme/style-recipes.js +129 -0
  96. package/dist/theme/style-recipes.js.map +1 -0
  97. package/dist/tool-definitions.d.ts +1 -11
  98. package/dist/tool-definitions.js +15 -127
  99. package/dist/tool-definitions.js.map +1 -1
  100. package/dist/types.d.ts +1 -106
  101. package/dist/types.js +15 -0
  102. package/dist/types.js.map +1 -1
  103. package/dist/uri.d.ts +1 -6
  104. package/dist/uri.js +15 -21
  105. package/dist/uri.js.map +1 -1
  106. package/package.json +5 -2
@@ -0,0 +1,743 @@
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
+ databaseModels: DatabaseModelContract[];
127
+ databaseEnums: DatabaseEnumContract[];
128
+ databaseMigrations: DatabaseMigrationContract[];
129
+ databaseAccesses: DatabaseAccessContract[];
130
+ cssVariables: string[];
131
+ cssVariableValues: CssVariableValue[];
132
+ cssRules: CssRuleDetail[];
133
+ cssClasses: string[];
134
+ classReferences: string[];
135
+ classExpressions: ClassExpression[];
136
+ cssIds: string[];
137
+ cssVariableReferences: string[];
138
+ tailwindUtilities: string[];
139
+ componentStyleDefinitions: ComponentStyleDefinition[];
140
+ themeTokens: ThemeToken[];
141
+ inlineStyles: InlineStyle[];
142
+ dependencies: string[];
143
+ jsxElements: string[];
144
+ uiElements: UiElement[];
145
+ apiCalls: string[];
146
+ envVars: string[];
147
+ tests: string[];
148
+ docsHeadings: string[];
149
+ configKeys: string[];
150
+ templateIncludes: string[];
151
+ authHints: string[];
152
+ middleware: string[];
153
+ jobs: string[];
154
+ events: string[];
155
+ backendEndpointContracts: BackendEndpointContract[];
156
+ backendOperations: BackendOperationContract[];
157
+ backendSideEffects: BackendSideEffect[];
158
+ backendErrors: BackendErrorContract[];
159
+ backendLogging: BackendLoggingContract[];
160
+ sourceHash: string;
161
+ summary: string;
162
+ tags: string[];
163
+ }
164
+ export type DatabaseProvider = 'prisma' | 'sql' | 'drizzle' | 'typeorm' | 'sequelize' | 'mongoose' | 'django' | 'rails' | 'laravel' | 'generic-orm';
165
+ export type DatabaseModelKind = 'model' | 'table' | 'collection';
166
+ export type DatabaseAccessOperation = 'read' | 'create' | 'update' | 'delete' | 'upsert' | 'write' | 'aggregate' | 'transaction' | 'raw-sql' | 'unknown';
167
+ export interface DatabaseFieldContract {
168
+ name: string;
169
+ type?: string;
170
+ databaseName?: string;
171
+ required?: boolean;
172
+ optional?: boolean;
173
+ list?: boolean;
174
+ id?: boolean;
175
+ unique?: boolean;
176
+ indexed?: boolean;
177
+ generated?: boolean;
178
+ updatedAt?: boolean;
179
+ default?: string;
180
+ enumName?: string;
181
+ nativeType?: string;
182
+ relation?: {
183
+ model?: string;
184
+ name?: string;
185
+ fields: string[];
186
+ references: string[];
187
+ onDelete?: string;
188
+ onUpdate?: string;
189
+ };
190
+ line: number;
191
+ source: DatabaseProvider;
192
+ raw?: string;
193
+ }
194
+ export interface DatabaseIndexContract {
195
+ kind: 'primary' | 'unique' | 'index' | 'foreign';
196
+ name?: string;
197
+ fields: string[];
198
+ references?: {
199
+ table: string;
200
+ fields: string[];
201
+ };
202
+ line: number;
203
+ }
204
+ export interface DatabaseRelationContract {
205
+ fromModel: string;
206
+ fromFields: string[];
207
+ toModel: string;
208
+ toFields: string[];
209
+ name?: string;
210
+ onDelete?: string;
211
+ onUpdate?: string;
212
+ line: number;
213
+ confidence: Confidence;
214
+ }
215
+ export interface DatabaseModelContract {
216
+ name: string;
217
+ tableName?: string;
218
+ kind: DatabaseModelKind;
219
+ provider: DatabaseProvider;
220
+ framework?: string;
221
+ fields: DatabaseFieldContract[];
222
+ fieldNames: string[];
223
+ primaryKey: string[];
224
+ uniqueFields: string[][];
225
+ indexes: DatabaseIndexContract[];
226
+ relations: DatabaseRelationContract[];
227
+ enumRefs: string[];
228
+ map?: string;
229
+ line: number;
230
+ confidence: Confidence;
231
+ sourcePath: string;
232
+ }
233
+ export interface DatabaseEnumContract {
234
+ name: string;
235
+ values: string[];
236
+ provider: DatabaseProvider;
237
+ map?: string;
238
+ line: number;
239
+ confidence: Confidence;
240
+ sourcePath: string;
241
+ }
242
+ export interface DatabaseMigrationOperation {
243
+ kind: 'create-table' | 'alter-table' | 'drop-table' | 'create-index' | 'drop-index' | 'create-enum' | 'drop-enum' | 'insert-seed' | 'update-data' | 'delete-data' | 'raw-sql' | 'unknown';
244
+ target?: string;
245
+ fields?: string[];
246
+ columns?: string[];
247
+ references?: {
248
+ table: string;
249
+ columns: string[];
250
+ };
251
+ name?: string;
252
+ destructive?: boolean;
253
+ line: number;
254
+ statement?: string;
255
+ }
256
+ export interface DatabaseMigrationContract {
257
+ name: string;
258
+ path: string;
259
+ provider: DatabaseProvider;
260
+ operations: DatabaseMigrationOperation[];
261
+ creates: string[];
262
+ alters: string[];
263
+ drops: string[];
264
+ indexes: string[];
265
+ enums: string[];
266
+ seedLike: boolean;
267
+ destructive: boolean;
268
+ confidence: Confidence;
269
+ }
270
+ export interface DatabaseAccessContract {
271
+ operation: DatabaseAccessOperation;
272
+ model?: string;
273
+ table?: string;
274
+ receiver?: string;
275
+ method?: string;
276
+ framework: DatabaseProvider;
277
+ line: number;
278
+ fields: string[];
279
+ whereFields: string[];
280
+ relationHints: string[];
281
+ transactional?: boolean;
282
+ raw?: boolean;
283
+ confidence: Confidence;
284
+ risk: string[];
285
+ }
286
+ export interface BackendEndpointParam {
287
+ name: string;
288
+ source: 'body' | 'query' | 'path' | 'request' | 'response' | 'current-user' | 'unknown';
289
+ type?: string;
290
+ required?: boolean;
291
+ decorator?: string;
292
+ }
293
+ export interface BackendAuthPolicy {
294
+ required: boolean;
295
+ public: boolean;
296
+ guards: string[];
297
+ roles: string[];
298
+ permissions: string[];
299
+ hints: string[];
300
+ confidence: Confidence;
301
+ }
302
+ export interface BackendValidationContract {
303
+ bodyType?: string;
304
+ queryType?: string;
305
+ pathParams: BackendEndpointParam[];
306
+ decorators: string[];
307
+ confidence: Confidence;
308
+ }
309
+ export interface BackendServiceCall {
310
+ receiver: string;
311
+ method: string;
312
+ await: boolean;
313
+ line: number;
314
+ kind: 'service' | 'repository' | 'client' | 'provider' | 'unknown';
315
+ }
316
+ export interface BackendSideEffect {
317
+ kind: 'database-write' | 'email' | 'queue' | 'event' | 'cookie' | 'header' | 'external-api' | 'file' | 'cache' | 'unknown';
318
+ target?: string;
319
+ operation?: string;
320
+ line: number;
321
+ confidence: Confidence;
322
+ }
323
+ export interface BackendErrorContract {
324
+ kind: string;
325
+ message?: string;
326
+ statusCode?: number;
327
+ line: number;
328
+ }
329
+ export interface BackendLoggingContract {
330
+ level: 'log' | 'warn' | 'error' | 'debug' | 'verbose';
331
+ message?: string;
332
+ line: number;
333
+ }
334
+ export interface BackendEndpointContract {
335
+ framework: string;
336
+ method: string;
337
+ path: string;
338
+ fullPath?: string;
339
+ handler: string;
340
+ handlerName?: string;
341
+ controller?: string;
342
+ line: number;
343
+ decorators: string[];
344
+ params: BackendEndpointParam[];
345
+ request: {
346
+ bodyType?: string;
347
+ queryType?: string;
348
+ pathParams: BackendEndpointParam[];
349
+ usesRequest: boolean;
350
+ usesResponse: boolean;
351
+ };
352
+ response: {
353
+ type?: string;
354
+ statusCodes: number[];
355
+ returns: string[];
356
+ };
357
+ auth: BackendAuthPolicy;
358
+ validation: BackendValidationContract;
359
+ serviceCalls: BackendServiceCall[];
360
+ repositoryCalls: BackendServiceCall[];
361
+ sideEffects: BackendSideEffect[];
362
+ errors: BackendErrorContract[];
363
+ logging: BackendLoggingContract[];
364
+ risk: string[];
365
+ }
366
+ export interface BackendOperationContract {
367
+ framework: string;
368
+ owner: string;
369
+ ownerKind: 'controller' | 'service' | 'module' | 'unknown';
370
+ name: string;
371
+ signature: string;
372
+ line: number;
373
+ params: BackendEndpointParam[];
374
+ returnType?: string;
375
+ serviceCalls: BackendServiceCall[];
376
+ repositoryCalls: BackendServiceCall[];
377
+ sideEffects: BackendSideEffect[];
378
+ errors: BackendErrorContract[];
379
+ logging: BackendLoggingContract[];
380
+ risk: string[];
381
+ }
382
+ export interface UiLayoutSafety {
383
+ wrapClasses: string[];
384
+ overflowClasses: string[];
385
+ minSizeClasses: string[];
386
+ maxSizeClasses: string[];
387
+ fitClasses: string[];
388
+ flexBehaviorClasses: string[];
389
+ layoutSafetyClasses: string[];
390
+ }
391
+ export interface UiResponsiveProfile {
392
+ breakpoints: Record<string, string[]>;
393
+ layoutClasses: string[];
394
+ typographyClasses: string[];
395
+ spacingClasses: string[];
396
+ sizingClasses: string[];
397
+ visibilityClasses: string[];
398
+ stateClasses: string[];
399
+ }
400
+ export interface UiScaleProfile {
401
+ typographyClasses: string[];
402
+ spacingClasses: string[];
403
+ sizingClasses: string[];
404
+ gapClasses: string[];
405
+ maxWidthClasses: string[];
406
+ lineHeightClasses: string[];
407
+ }
408
+ export interface UiSemanticProfile {
409
+ roles: string[];
410
+ isCompound: boolean;
411
+ hasIcon: boolean;
412
+ hasDivider: boolean;
413
+ hasImage: boolean;
414
+ hasMultipleTextStyles: boolean;
415
+ textStyleCount: number;
416
+ childCount: number;
417
+ }
418
+ export interface UiRoleSignature {
419
+ role: string;
420
+ roleGroup: string;
421
+ scale: string;
422
+ density: string;
423
+ surface: string;
424
+ layout: string;
425
+ flags: string[];
426
+ exactClassFacts: string[];
427
+ childRoles?: string[];
428
+ childKinds?: string[];
429
+ }
430
+ export interface UiContract {
431
+ identity: Record<string, unknown>;
432
+ semantics: Record<string, unknown>;
433
+ visual: Record<string, unknown>;
434
+ layout: Record<string, unknown>;
435
+ responsiveVariants: Record<string, unknown>;
436
+ interactionVariants: Record<string, unknown>;
437
+ safetyRules: Record<string, unknown>;
438
+ sourceEvidence: Record<string, unknown>;
439
+ }
440
+ export interface UiRelationships {
441
+ parentContext?: unknown;
442
+ childStructureContract?: unknown;
443
+ compoundStructure?: unknown;
444
+ graphKeys: string[];
445
+ }
446
+ export interface UiElement {
447
+ index: number;
448
+ kind: string;
449
+ tag: string;
450
+ originalTag: string;
451
+ line: number;
452
+ depth?: number;
453
+ parentIndex?: number;
454
+ parentKind?: string;
455
+ parentTag?: string;
456
+ parentClasses?: string[];
457
+ parentClassGroups?: Record<string, string[]>;
458
+ layoutRole?: string;
459
+ label?: string;
460
+ classes: string[];
461
+ defaultClasses?: string[];
462
+ conditionalClasses?: string[];
463
+ decorativeAccentClasses?: string[];
464
+ classSource?: string;
465
+ classGroups?: Record<string, string[]>;
466
+ responsiveClasses?: string[];
467
+ stateClasses?: string[];
468
+ layoutSafety?: UiLayoutSafety;
469
+ responsiveProfile?: UiResponsiveProfile;
470
+ scaleProfile?: UiScaleProfile;
471
+ semanticProfile?: UiSemanticProfile;
472
+ roleSignature?: UiRoleSignature;
473
+ childSummary?: UiElementChildSummary[];
474
+ id?: string;
475
+ role?: string;
476
+ type?: string;
477
+ href?: string;
478
+ action?: string;
479
+ method?: string;
480
+ props?: Record<string, string>;
481
+ variants?: Record<string, string>;
482
+ styleHelper?: string;
483
+ styleHelperVariants?: Record<string, string>;
484
+ evidence: string;
485
+ }
486
+ export interface UiElementChildSummary {
487
+ index: number;
488
+ kind: string;
489
+ tag: string;
490
+ originalTag: string;
491
+ layoutRole?: string;
492
+ classes: string[];
493
+ defaultClasses?: string[];
494
+ conditionalClasses?: string[];
495
+ layoutSafety?: UiLayoutSafety;
496
+ responsiveProfile?: UiResponsiveProfile;
497
+ scaleProfile?: UiScaleProfile;
498
+ semanticRole?: string;
499
+ semanticProfile?: UiSemanticProfile;
500
+ roleSignature?: UiRoleSignature;
501
+ props?: Record<string, string>;
502
+ variants?: Record<string, string>;
503
+ styleHelper?: string;
504
+ styleHelperVariants?: Record<string, string>;
505
+ label?: string;
506
+ }
507
+ export interface ConnectedPatternEvidence {
508
+ path: string;
509
+ line?: number;
510
+ component?: string;
511
+ route?: string;
512
+ key?: string;
513
+ label?: string;
514
+ sourceHash: string;
515
+ }
516
+ export interface ConnectedPatternInstance {
517
+ domain: 'frontend' | 'backend' | 'data';
518
+ concept: string;
519
+ signature: string;
520
+ summary: string;
521
+ file: AnalyzedFile;
522
+ root?: {
523
+ kind?: string;
524
+ tag?: string;
525
+ layoutRole?: string;
526
+ classes?: string[];
527
+ defaultClasses?: string[];
528
+ conditionalClasses?: string[];
529
+ decorativeAccentClasses?: string[];
530
+ classGroups?: Record<string, string[]>;
531
+ layoutSafety?: UiLayoutSafety;
532
+ responsiveProfile?: UiResponsiveProfile;
533
+ scaleProfile?: UiScaleProfile;
534
+ semanticProfile?: UiSemanticProfile;
535
+ roleSignature?: UiRoleSignature;
536
+ uiContract?: UiContract;
537
+ };
538
+ children?: Array<Record<string, unknown>>;
539
+ graphKeys: string[];
540
+ tags: string[];
541
+ evidence: ConnectedPatternEvidence;
542
+ value: Record<string, unknown>;
543
+ baseWeight: number;
544
+ }
545
+ export interface ConnectedPatternCluster {
546
+ domain: 'frontend' | 'backend' | 'data';
547
+ concept: string;
548
+ signature: string;
549
+ key: string;
550
+ name: string;
551
+ summary: string;
552
+ score: number;
553
+ confidence: Confidence;
554
+ status: RecipeStatus;
555
+ instances: ConnectedPatternInstance[];
556
+ tags: string[];
557
+ dependencies: string[];
558
+ value: Record<string, unknown>;
559
+ }
560
+ export interface CssVariableValue {
561
+ name: string;
562
+ value: string;
563
+ selector?: string;
564
+ line: number;
565
+ }
566
+ export interface CssDeclaration {
567
+ property: string;
568
+ value: string;
569
+ }
570
+ export interface CssRuleDetail {
571
+ selector: string;
572
+ declarations: CssDeclaration[];
573
+ line: number;
574
+ media?: string;
575
+ }
576
+ export interface ClassExpression {
577
+ kind: 'attribute' | 'helper' | 'variant-definition' | 'string-literal';
578
+ raw: string;
579
+ classes: string[];
580
+ defaultClasses?: string[];
581
+ conditionalClasses?: string[];
582
+ line: number;
583
+ target?: string;
584
+ styleHelper?: string;
585
+ styleHelperVariants?: Record<string, string>;
586
+ }
587
+ export interface ClassSourceAnalysis {
588
+ classes: string[];
589
+ defaultClasses: string[];
590
+ conditionalClasses: string[];
591
+ decorativeAccentClasses: string[];
592
+ }
593
+ export interface ClassHelperUsage {
594
+ name: string;
595
+ variantProps: Record<string, string>;
596
+ call: string;
597
+ }
598
+ export interface StringLiteralRange {
599
+ value: string;
600
+ start: number;
601
+ end: number;
602
+ }
603
+ export interface ComponentStyleDefinition {
604
+ name: string;
605
+ kind: 'cva' | 'variant-object' | 'class-map';
606
+ line: number;
607
+ baseClasses: string[];
608
+ variants: Record<string, Record<string, string[]>>;
609
+ defaultVariants: Record<string, string>;
610
+ classes: string[];
611
+ source: string;
612
+ }
613
+ export interface ThemeToken {
614
+ path: string;
615
+ value: string;
616
+ type: 'color' | 'size' | 'font' | 'shadow' | 'radius' | 'spacing' | 'unknown';
617
+ line?: number;
618
+ }
619
+ export interface InlineStyle {
620
+ tag?: string;
621
+ line: number;
622
+ raw: string;
623
+ properties: CssDeclaration[];
624
+ }
625
+ export interface RegistryEntry {
626
+ key: string;
627
+ group: RecipeGroup;
628
+ summary: string;
629
+ tags: string[];
630
+ dependencies: string[];
631
+ usedBy: string[];
632
+ confidence: Confidence;
633
+ status: RecipeStatus;
634
+ path?: string;
635
+ value: Record<string, unknown>;
636
+ }
637
+ export interface GraphNode {
638
+ k: string;
639
+ kind: string;
640
+ name: string;
641
+ path?: string;
642
+ language?: string;
643
+ framework?: string;
644
+ facets?: Record<string, unknown>;
645
+ source?: SourceInfo;
646
+ }
647
+ export interface GraphEdge {
648
+ from: string;
649
+ to: string;
650
+ type: string;
651
+ confidence?: Confidence;
652
+ source?: SourceInfo;
653
+ }
654
+ export interface SourceInfo {
655
+ extractor: string;
656
+ confidence: Confidence;
657
+ evidence: string[];
658
+ path?: string;
659
+ hash?: string;
660
+ }
661
+ export interface ReviewItem {
662
+ id: string;
663
+ type: 'duplicate_key' | 'concept_collision' | 'role_collision' | 'stale_approval' | 'low_confidence' | 'missing_rule';
664
+ status: 'open' | 'resolved';
665
+ group?: string;
666
+ s: string;
667
+ candidates: string[];
668
+ }
669
+ export interface CodebaseBundle {
670
+ scanId: string;
671
+ generatedAt: string;
672
+ rootPath: string;
673
+ projectType: CodebaseProjectType;
674
+ files: AnalyzedFile[];
675
+ entries: RegistryEntry[];
676
+ nodes: GraphNode[];
677
+ edges: GraphEdge[];
678
+ reviewItems: ReviewItem[];
679
+ detected: {
680
+ languages: string[];
681
+ frameworks: string[];
682
+ };
683
+ }
684
+ export interface CodebaseManifest {
685
+ v: typeof bundleSchemaVersion;
686
+ scanId: string;
687
+ rootName: string;
688
+ projectType: CodebaseProjectType;
689
+ generatedAt: string;
690
+ localOnly: true;
691
+ schema: {
692
+ graph: typeof graphSchemaVersion;
693
+ index: typeof indexSchemaVersion;
694
+ recipe: typeof recipeSchemaVersion;
695
+ };
696
+ extractors: Array<{
697
+ id: string;
698
+ version: string;
699
+ }>;
700
+ stats: {
701
+ files: number;
702
+ nodes: number;
703
+ edges: number;
704
+ recipes: number;
705
+ reviewItems: number;
706
+ };
707
+ paths: {
708
+ nodes: string;
709
+ edges: string;
710
+ groups: string;
711
+ aliases: string;
712
+ terms: string;
713
+ review: string;
714
+ };
715
+ }
716
+ export interface RecipeRecord {
717
+ k: string;
718
+ g: RecipeGroup;
719
+ d: string[];
720
+ u: string[];
721
+ s: string;
722
+ t: string[];
723
+ p?: string;
724
+ confidence: Confidence;
725
+ status: RecipeStatus;
726
+ v: Record<string, unknown>;
727
+ }
728
+ export interface SearchMatch {
729
+ k: string;
730
+ g: string;
731
+ kind: string;
732
+ name?: string;
733
+ s: string;
734
+ t: string[];
735
+ d: string[];
736
+ u: string[];
737
+ p: string | null;
738
+ confidence: Confidence;
739
+ status: RecipeStatus;
740
+ score: number;
741
+ scores?: PatternScores;
742
+ decision?: PatternDecision;
743
+ }