@vibecheckai/cli 2.5.7 → 2.7.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.
Files changed (159) hide show
  1. package/LICENSE +1 -1
  2. package/dist/bundles/vibecheck-core.js +20 -20
  3. package/dist/commands/secrets-allowlist.js +4 -4
  4. package/dist/commands/secrets-allowlist.js.map +1 -1
  5. package/dist/commands/ship-consolidated.js +193 -193
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +5 -5
  8. package/dist/index.js.map +1 -1
  9. package/dist/init/ci-generator.d.ts +2 -2
  10. package/dist/init/hooks-installer.d.ts +2 -2
  11. package/dist/init/index.d.ts +1 -1
  12. package/dist/init/index.d.ts.map +1 -1
  13. package/dist/init/index.js +2 -2
  14. package/dist/init/index.js.map +1 -1
  15. package/dist/init/templates.d.ts +6 -285
  16. package/dist/init/templates.d.ts.map +1 -1
  17. package/dist/init/templates.js +2 -3
  18. package/dist/init/templates.js.map +1 -1
  19. package/dist/runtime/json-output.d.ts +2 -2
  20. package/package.json +11 -3
  21. package/dist/bundles/guardrail-core.js +0 -25799
  22. package/dist/bundles/guardrail-security.js +0 -208687
  23. package/dist/bundles/guardrail-ship.js +0 -2318
  24. package/dist/commands/autopilot-decision.d.ts +0 -24
  25. package/dist/commands/autopilot-decision.d.ts.map +0 -1
  26. package/dist/commands/autopilot-decision.js +0 -304
  27. package/dist/commands/autopilot-decision.js.map +0 -1
  28. package/dist/commands/autopilot.d.ts +0 -33
  29. package/dist/commands/autopilot.d.ts.map +0 -1
  30. package/dist/commands/autopilot.js +0 -1539
  31. package/dist/commands/autopilot.js.map +0 -1
  32. package/dist/commands/context.d.ts +0 -8
  33. package/dist/commands/context.d.ts.map +0 -1
  34. package/dist/commands/context.js +0 -340
  35. package/dist/commands/context.js.map +0 -1
  36. package/dist/commands/debug.d.ts +0 -78
  37. package/dist/commands/debug.d.ts.map +0 -1
  38. package/dist/commands/debug.js +0 -381
  39. package/dist/commands/debug.js.map +0 -1
  40. package/dist/commands/preview.d.ts +0 -54
  41. package/dist/commands/preview.d.ts.map +0 -1
  42. package/dist/commands/preview.js +0 -352
  43. package/dist/commands/preview.js.map +0 -1
  44. package/dist/commands/quality/check.d.ts +0 -31
  45. package/dist/commands/quality/check.d.ts.map +0 -1
  46. package/dist/commands/quality/check.js +0 -242
  47. package/dist/commands/quality/check.js.map +0 -1
  48. package/dist/commands/quality/index.d.ts +0 -8
  49. package/dist/commands/quality/index.d.ts.map +0 -1
  50. package/dist/commands/quality/index.js +0 -14
  51. package/dist/commands/quality/index.js.map +0 -1
  52. package/dist/commands/quality/setup-quality.d.ts +0 -23
  53. package/dist/commands/quality/setup-quality.d.ts.map +0 -1
  54. package/dist/commands/quality/setup-quality.js +0 -452
  55. package/dist/commands/quality/setup-quality.js.map +0 -1
  56. package/dist/commands/quality/tidy.d.ts +0 -41
  57. package/dist/commands/quality/tidy.d.ts.map +0 -1
  58. package/dist/commands/quality/tidy.js +0 -466
  59. package/dist/commands/quality/tidy.js.map +0 -1
  60. package/dist/commands/quality/utils.d.ts +0 -73
  61. package/dist/commands/quality/utils.d.ts.map +0 -1
  62. package/dist/commands/quality/utils.js +0 -158
  63. package/dist/commands/quality/utils.js.map +0 -1
  64. package/dist/fix/analytics.d.ts +0 -121
  65. package/dist/fix/analytics.d.ts.map +0 -1
  66. package/dist/fix/analytics.js +0 -289
  67. package/dist/fix/analytics.js.map +0 -1
  68. package/dist/fix/audit.d.ts +0 -61
  69. package/dist/fix/audit.d.ts.map +0 -1
  70. package/dist/fix/audit.js +0 -149
  71. package/dist/fix/audit.js.map +0 -1
  72. package/dist/fix/config.d.ts +0 -78
  73. package/dist/fix/config.d.ts.map +0 -1
  74. package/dist/fix/config.js +0 -200
  75. package/dist/fix/config.js.map +0 -1
  76. package/dist/fix/impact.d.ts +0 -74
  77. package/dist/fix/impact.d.ts.map +0 -1
  78. package/dist/fix/impact.js +0 -281
  79. package/dist/fix/impact.js.map +0 -1
  80. package/dist/fix/learning.d.ts +0 -109
  81. package/dist/fix/learning.d.ts.map +0 -1
  82. package/dist/fix/learning.js +0 -296
  83. package/dist/fix/learning.js.map +0 -1
  84. package/dist/fix/metrics.d.ts +0 -106
  85. package/dist/fix/metrics.d.ts.map +0 -1
  86. package/dist/fix/metrics.js +0 -138
  87. package/dist/fix/metrics.js.map +0 -1
  88. package/dist/fix/parallel.d.ts +0 -69
  89. package/dist/fix/parallel.d.ts.map +0 -1
  90. package/dist/fix/parallel.js +0 -203
  91. package/dist/fix/parallel.js.map +0 -1
  92. package/dist/fix/report.d.ts +0 -40
  93. package/dist/fix/report.d.ts.map +0 -1
  94. package/dist/fix/report.js +0 -212
  95. package/dist/fix/report.js.map +0 -1
  96. package/dist/fix/strategy.d.ts +0 -53
  97. package/dist/fix/strategy.d.ts.map +0 -1
  98. package/dist/fix/strategy.js +0 -143
  99. package/dist/fix/strategy.js.map +0 -1
  100. package/dist/fix/templates.d.ts +0 -58
  101. package/dist/fix/templates.d.ts.map +0 -1
  102. package/dist/fix/templates.js +0 -259
  103. package/dist/fix/templates.js.map +0 -1
  104. package/dist/fix/testing.d.ts +0 -68
  105. package/dist/fix/testing.d.ts.map +0 -1
  106. package/dist/fix/testing.js +0 -245
  107. package/dist/fix/testing.js.map +0 -1
  108. package/dist/fix/validation.d.ts +0 -71
  109. package/dist/fix/validation.d.ts.map +0 -1
  110. package/dist/fix/validation.js +0 -267
  111. package/dist/fix/validation.js.map +0 -1
  112. package/dist/fix/visualization.d.ts +0 -73
  113. package/dist/fix/visualization.d.ts.map +0 -1
  114. package/dist/fix/visualization.js +0 -243
  115. package/dist/fix/visualization.js.map +0 -1
  116. package/dist/runtime/cli-errors.d.ts +0 -38
  117. package/dist/runtime/cli-errors.d.ts.map +0 -1
  118. package/dist/runtime/cli-errors.js +0 -354
  119. package/dist/runtime/cli-errors.js.map +0 -1
  120. package/dist/runtime/owner-mode.d.ts +0 -48
  121. package/dist/runtime/owner-mode.d.ts.map +0 -1
  122. package/dist/runtime/owner-mode.js +0 -284
  123. package/dist/runtime/owner-mode.js.map +0 -1
  124. package/dist/scanner/index.d.ts +0 -8
  125. package/dist/scanner/index.d.ts.map +0 -1
  126. package/dist/scanner/index.js +0 -15
  127. package/dist/scanner/index.js.map +0 -1
  128. package/dist/scanner/placeholder-detector.d.ts +0 -56
  129. package/dist/scanner/placeholder-detector.d.ts.map +0 -1
  130. package/dist/scanner/placeholder-detector.js +0 -220
  131. package/dist/scanner/placeholder-detector.js.map +0 -1
  132. package/dist/scanner/route-detector.d.ts +0 -100
  133. package/dist/scanner/route-detector.d.ts.map +0 -1
  134. package/dist/scanner/route-detector.js +0 -455
  135. package/dist/scanner/route-detector.js.map +0 -1
  136. package/dist/scanner/scoring.d.ts +0 -67
  137. package/dist/scanner/scoring.d.ts.map +0 -1
  138. package/dist/scanner/scoring.js +0 -284
  139. package/dist/scanner/scoring.js.map +0 -1
  140. package/dist/ship-baseline.d.ts +0 -56
  141. package/dist/ship-baseline.d.ts.map +0 -1
  142. package/dist/ship-baseline.js +0 -194
  143. package/dist/ship-baseline.js.map +0 -1
  144. package/dist/ship-config.d.ts +0 -91
  145. package/dist/ship-config.d.ts.map +0 -1
  146. package/dist/ship-config.js +0 -133
  147. package/dist/ship-config.js.map +0 -1
  148. package/dist/ship-data-loader.d.ts +0 -70
  149. package/dist/ship-data-loader.d.ts.map +0 -1
  150. package/dist/ship-data-loader.js +0 -301
  151. package/dist/ship-data-loader.js.map +0 -1
  152. package/dist/utils/ai-helpers.d.ts +0 -72
  153. package/dist/utils/ai-helpers.d.ts.map +0 -1
  154. package/dist/utils/ai-helpers.js +0 -339
  155. package/dist/utils/ai-helpers.js.map +0 -1
  156. package/dist/utils/validation.d.ts +0 -34
  157. package/dist/utils/validation.d.ts.map +0 -1
  158. package/dist/utils/validation.js +0 -160
  159. package/dist/utils/validation.js.map +0 -1
@@ -1,220 +0,0 @@
1
- "use strict";
2
- /**
3
- * Placeholder Detector with Rule-Tiered Approach
4
- *
5
- * Implements sophisticated placeholder detection with multiple confidence levels:
6
- * - Ignore list (safe): HTML placeholder attributes by default
7
- * - High-confidence: UI text nodes, mock responses
8
- * - Medium-confidence: "placeholder" in variable names or comments
9
- */
10
- Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.PlaceholderDetector = void 0;
12
- class PlaceholderDetector {
13
- constructor(config = {}) {
14
- this.config = {
15
- countInputPlaceholders: config.countInputPlaceholders ?? false,
16
- ignorePatterns: config.ignorePatterns ?? [],
17
- };
18
- }
19
- /**
20
- * Detect placeholders in source code
21
- */
22
- async detectPlaceholders(filePath, content) {
23
- const findings = [];
24
- const lines = content.split('\n');
25
- for (let lineNum = 0; lineNum < lines.length; lineNum++) {
26
- const line = lines[lineNum];
27
- const lineContent = line.trim();
28
- // Skip empty lines
29
- if (!lineContent)
30
- continue;
31
- // High-confidence patterns: UI text nodes and mock responses
32
- const highConfidenceFindings = this.detectHighConfidence(filePath, lineNum + 1, lineContent, line);
33
- findings.push(...highConfidenceFindings);
34
- // Medium-confidence patterns: comments and variable names
35
- if (!this.config.countInputPlaceholders) {
36
- // Skip HTML placeholder attributes unless explicitly enabled
37
- if (this.isHtmlPlaceholderAttribute(lineContent)) {
38
- continue;
39
- }
40
- }
41
- else {
42
- // Count HTML placeholder attributes if enabled
43
- const htmlFindings = this.detectHtmlPlaceholderAttributes(filePath, lineNum + 1, lineContent, line);
44
- findings.push(...htmlFindings);
45
- }
46
- const mediumConfidenceFindings = this.detectMediumConfidence(filePath, lineNum + 1, lineContent, line);
47
- findings.push(...mediumConfidenceFindings);
48
- }
49
- // Filter out ignored patterns
50
- return findings.filter((finding) => {
51
- return !this.config.ignorePatterns.some((pattern) => pattern.test(finding.match));
52
- });
53
- }
54
- /**
55
- * High-confidence placeholders: UI text nodes and mock responses
56
- */
57
- detectHighConfidence(filePath, lineNum, lineContent, originalLine) {
58
- const findings = [];
59
- // UI text patterns
60
- const uiTextPatterns = [
61
- /["'`]Coming\s+soon["'`]/i,
62
- /["'`]Todo\s+App["'`]/i,
63
- /["'`]Chart\s+Placeholder/i,
64
- /["'`]Placeholder\.\.\.["'`]/i,
65
- /["'`]TODO:.*["'`]/i,
66
- /["'`]FIXME:.*["'`]/i,
67
- ];
68
- for (const pattern of uiTextPatterns) {
69
- const matches = this.findAllMatches(lineContent, pattern);
70
- for (const match of matches) {
71
- findings.push({
72
- type: 'ui_text',
73
- file: filePath,
74
- line: lineNum,
75
- column: match.index,
76
- match: match.text,
77
- confidence: 'high',
78
- snippet: originalLine.trim(),
79
- });
80
- }
81
- }
82
- // Mock response patterns
83
- const mockResponsePatterns = [
84
- /"success":\s*true.*"TODO"/i,
85
- /"success":\s*true.*"FIXME"/i,
86
- /"mock":\s*true/i,
87
- /"isMock":\s*true/i,
88
- /mockData\s*[:=]/i,
89
- /lorem\s+ipsum/i,
90
- ];
91
- for (const pattern of mockResponsePatterns) {
92
- const matches = this.findAllMatches(lineContent, pattern);
93
- for (const match of matches) {
94
- findings.push({
95
- type: 'mock_response',
96
- file: filePath,
97
- line: lineNum,
98
- column: match.index,
99
- match: match.text,
100
- confidence: 'high',
101
- snippet: originalLine.trim(),
102
- });
103
- }
104
- }
105
- return findings;
106
- }
107
- /**
108
- * Medium-confidence placeholders: comments and variable names
109
- */
110
- detectMediumConfidence(filePath, lineNum, lineContent, originalLine) {
111
- const findings = [];
112
- // Comment patterns (medium confidence)
113
- const commentPatterns = [
114
- /\/\/.*\bplaceholder\b/i,
115
- /\/\*.*\bplaceholder\b.*\*\//i,
116
- /\/\/.*TODO:/i,
117
- /\/\/.*FIXME:/i,
118
- ];
119
- for (const pattern of commentPatterns) {
120
- const matches = this.findAllMatches(lineContent, pattern);
121
- for (const match of matches) {
122
- findings.push({
123
- type: 'comment',
124
- file: filePath,
125
- line: lineNum,
126
- column: match.index,
127
- match: match.text,
128
- confidence: 'medium',
129
- snippet: originalLine.trim(),
130
- });
131
- }
132
- }
133
- // Variable name patterns (medium confidence)
134
- const variablePatterns = [
135
- /\bplaceholder[A-Z]\w*/i,
136
- /\bplaceholder\w*[:=]/i,
137
- ];
138
- for (const pattern of variablePatterns) {
139
- const matches = this.findAllMatches(lineContent, pattern);
140
- for (const match of matches) {
141
- findings.push({
142
- type: 'variable',
143
- file: filePath,
144
- line: lineNum,
145
- column: match.index,
146
- match: match.text,
147
- confidence: 'medium',
148
- snippet: originalLine.trim(),
149
- });
150
- }
151
- }
152
- return findings;
153
- }
154
- /**
155
- * Detect HTML placeholder attributes
156
- */
157
- detectHtmlPlaceholderAttributes(filePath, lineNum, lineContent, originalLine) {
158
- const findings = [];
159
- // HTML placeholder attribute pattern
160
- const htmlPlaceholderPattern = /placeholder\s*=\s*["']([^"']+)["']/gi;
161
- let match;
162
- while ((match = htmlPlaceholderPattern.exec(lineContent)) !== null) {
163
- const placeholderValue = match[1];
164
- // Only flag if the placeholder value looks like actual placeholder text
165
- // (not user-facing labels like "Enter your email")
166
- if (/placeholder|coming soon|todo|fixme|mock|lorem/i.test(placeholderValue)) {
167
- findings.push({
168
- type: 'html_attribute',
169
- file: filePath,
170
- line: lineNum,
171
- column: match.index,
172
- match: match[0],
173
- confidence: 'high',
174
- snippet: originalLine.trim(),
175
- });
176
- }
177
- }
178
- return findings;
179
- }
180
- /**
181
- * Check if line is an HTML placeholder attribute
182
- */
183
- isHtmlPlaceholderAttribute(lineContent) {
184
- return /<input[^>]*placeholder\s*=/i.test(lineContent);
185
- }
186
- /**
187
- * Find all matches in a string with their indices
188
- */
189
- findAllMatches(text, pattern) {
190
- const matches = [];
191
- let match;
192
- const globalPattern = new RegExp(pattern.source, pattern.flags + 'g');
193
- while ((match = globalPattern.exec(text)) !== null) {
194
- matches.push({
195
- text: match[0],
196
- index: match.index,
197
- });
198
- }
199
- return matches;
200
- }
201
- /**
202
- * Count placeholders by type
203
- */
204
- static countByType(findings) {
205
- const counts = {
206
- ui_text: 0,
207
- html_attribute: 0,
208
- mock_response: 0,
209
- comment: 0,
210
- variable: 0,
211
- total: findings.length,
212
- };
213
- for (const finding of findings) {
214
- counts[finding.type] = (counts[finding.type] || 0) + 1;
215
- }
216
- return counts;
217
- }
218
- }
219
- exports.PlaceholderDetector = PlaceholderDetector;
220
- //# sourceMappingURL=placeholder-detector.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"placeholder-detector.js","sourceRoot":"","sources":["../../src/scanner/placeholder-detector.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAmBH,MAAa,mBAAmB;IAG9B,YAAY,SAAoC,EAAE;QAChD,IAAI,CAAC,MAAM,GAAG;YACZ,sBAAsB,EAAE,MAAM,CAAC,sBAAsB,IAAI,KAAK;YAC9D,cAAc,EAAE,MAAM,CAAC,cAAc,IAAI,EAAE;SAC5C,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,kBAAkB,CACtB,QAAgB,EAChB,OAAe;QAEf,MAAM,QAAQ,GAAyB,EAAE,CAAC;QAC1C,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAElC,KAAK,IAAI,OAAO,GAAG,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,CAAC;YACxD,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;YAC5B,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;YAEhC,mBAAmB;YACnB,IAAI,CAAC,WAAW;gBAAE,SAAS;YAE3B,6DAA6D;YAC7D,MAAM,sBAAsB,GAAG,IAAI,CAAC,oBAAoB,CACtD,QAAQ,EACR,OAAO,GAAG,CAAC,EACX,WAAW,EACX,IAAI,CACL,CAAC;YACF,QAAQ,CAAC,IAAI,CAAC,GAAG,sBAAsB,CAAC,CAAC;YAEzC,0DAA0D;YAC1D,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,sBAAsB,EAAE,CAAC;gBACxC,6DAA6D;gBAC7D,IAAI,IAAI,CAAC,0BAA0B,CAAC,WAAW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,EAAE,CAAC;YACX,KAAK,EAAE,QAAQ,CAAC,MAAM;SACvB,CAAC;QAEF,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC/B,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QACzD,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAnRD,kDAmRC"}
@@ -1,100 +0,0 @@
1
- /**
2
- * Route Detector for Client-Side Routers
3
- *
4
- * Detects routes in various routing frameworks:
5
- * - Next.js/Remix (file-based routing)
6
- * - React Router (component-based)
7
- * - Wouter (lightweight router)
8
- * - Generic route inference mode
9
- */
10
- export interface RouteInfo {
11
- path: string;
12
- file?: string;
13
- line?: number;
14
- method?: string;
15
- dynamic?: boolean;
16
- params?: string[];
17
- source: 'file_based' | 'component' | 'config' | 'inferred';
18
- }
19
- export interface RouteDetectionResult {
20
- routes: RouteInfo[];
21
- framework: string;
22
- confidence: 'high' | 'medium' | 'low';
23
- message?: string;
24
- hints?: string[];
25
- }
26
- export interface RouteDetectorConfig {
27
- projectPath: string;
28
- framework?: string;
29
- /** Custom route hints from config */
30
- routeHints?: Array<{
31
- path: string;
32
- file?: string;
33
- description?: string;
34
- }>;
35
- }
36
- export declare class RouteDetector {
37
- private config;
38
- constructor(config: RouteDetectorConfig);
39
- /**
40
- * Detect routes in the project
41
- */
42
- detectRoutes(): Promise<RouteDetectionResult>;
43
- /**
44
- * Detect routes based on detected framework
45
- */
46
- private detectFrameworkRoutes;
47
- /**
48
- * Detect Next.js file-based routes
49
- */
50
- private detectNextJSRoutes;
51
- /**
52
- * Detect Remix routes
53
- */
54
- private detectRemixRoutes;
55
- /**
56
- * Detect component-based routes (React Router, Wouter)
57
- */
58
- private detectComponentRoutes;
59
- /**
60
- * Generic route inference mode
61
- */
62
- private detectGenericRoutes;
63
- /**
64
- * Detect router framework from dependencies
65
- */
66
- private detectRouterFramework;
67
- /**
68
- * Check if a string looks like a route path
69
- */
70
- private looksLikeRoute;
71
- /**
72
- * Extract route parameters from path
73
- */
74
- private extractRouteParams;
75
- /**
76
- * Parse route array from config
77
- */
78
- private parseRouteArray;
79
- /**
80
- * Find route files in directory (for file-based routing)
81
- */
82
- private findRouteFiles;
83
- /**
84
- * Convert file path to route path
85
- */
86
- private filePathToRoute;
87
- /**
88
- * Find all source files in project
89
- */
90
- private findSourceFiles;
91
- /**
92
- * Get all files recursively
93
- */
94
- private getAllFiles;
95
- /**
96
- * Deduplicate routes
97
- */
98
- private deduplicateRoutes;
99
- }
100
- //# sourceMappingURL=route-detector.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"route-detector.d.ts","sourceRoot":"","sources":["../../src/scanner/route-detector.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,YAAY,GAAG,WAAW,GAAG,QAAQ,GAAG,UAAU,CAAC;CAC5D;AAED,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qCAAqC;IACrC,UAAU,CAAC,EAAE,KAAK,CAAC;QACj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