@boshu2/vibe-check 1.8.0 → 1.8.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/CLAUDE.md +58 -0
- package/Makefile +43 -6
- package/README.md +80 -27
- package/dist/commands/session.d.ts +9 -0
- package/dist/commands/session.d.ts.map +1 -1
- package/dist/commands/session.js +57 -0
- package/dist/commands/session.js.map +1 -1
- package/dist/commands/watch.d.ts.map +1 -1
- package/dist/commands/watch.js +76 -0
- package/dist/commands/watch.js.map +1 -1
- package/dist/inner-loop/context-amnesia.d.ts +20 -0
- package/dist/inner-loop/context-amnesia.d.ts.map +1 -0
- package/dist/inner-loop/context-amnesia.js +249 -0
- package/dist/inner-loop/context-amnesia.js.map +1 -0
- package/dist/inner-loop/index.d.ts +39 -0
- package/dist/inner-loop/index.d.ts.map +1 -0
- package/dist/inner-loop/index.js +208 -0
- package/dist/inner-loop/index.js.map +1 -0
- package/dist/inner-loop/instruction-drift.d.ts +28 -0
- package/dist/inner-loop/instruction-drift.d.ts.map +1 -0
- package/dist/inner-loop/instruction-drift.js +260 -0
- package/dist/inner-loop/instruction-drift.js.map +1 -0
- package/dist/inner-loop/logging-only.d.ts +30 -0
- package/dist/inner-loop/logging-only.d.ts.map +1 -0
- package/dist/inner-loop/logging-only.js +264 -0
- package/dist/inner-loop/logging-only.js.map +1 -0
- package/dist/inner-loop/tests-passing-lie.d.ts +34 -0
- package/dist/inner-loop/tests-passing-lie.d.ts.map +1 -0
- package/dist/inner-loop/tests-passing-lie.js +213 -0
- package/dist/inner-loop/tests-passing-lie.js.map +1 -0
- package/dist/inner-loop/types.d.ts +111 -0
- package/dist/inner-loop/types.d.ts.map +1 -0
- package/dist/inner-loop/types.js +29 -0
- package/dist/inner-loop/types.js.map +1 -0
- package/docs/FEATURES.md +340 -0
- package/package.json +1 -1
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* "Tests Passing" Lie Detector
|
|
4
|
+
*
|
|
5
|
+
* Detects when AI claims "all tests passing" or "working" but the code
|
|
6
|
+
* actually doesn't work. This is detected through:
|
|
7
|
+
*
|
|
8
|
+
* 1. Inferred: Commit claims success but is immediately followed by fixes
|
|
9
|
+
* 2. Verified: Actually run tests/build and compare to commit claims
|
|
10
|
+
*
|
|
11
|
+
* This is a key "Inner Loop Disaster" in vibe coding.
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.detectTestsPassingLie = detectTestsPassingLie;
|
|
15
|
+
exports.verifyCommit = verifyCommit;
|
|
16
|
+
exports.verifyBuild = verifyBuild;
|
|
17
|
+
const date_fns_1 = require("date-fns");
|
|
18
|
+
const child_process_1 = require("child_process");
|
|
19
|
+
const util_1 = require("util");
|
|
20
|
+
const types_1 = require("./types");
|
|
21
|
+
const execAsync = (0, util_1.promisify)(child_process_1.exec);
|
|
22
|
+
// Patterns that indicate a claim of success
|
|
23
|
+
const SUCCESS_CLAIM_PATTERNS = [
|
|
24
|
+
/\bfix(ed|es)?\b/i,
|
|
25
|
+
/\bworking\b/i,
|
|
26
|
+
/\bdone\b/i,
|
|
27
|
+
/\bcomplete[ds]?\b/i,
|
|
28
|
+
/\bresolve[ds]?\b/i,
|
|
29
|
+
/\bpass(es|ing)?\b/i,
|
|
30
|
+
/\bgreen\b/i,
|
|
31
|
+
/\bsuccessful(ly)?\b/i,
|
|
32
|
+
/\ball\s+tests?\b/i,
|
|
33
|
+
/\bready\b/i,
|
|
34
|
+
/\bshould\s+work/i,
|
|
35
|
+
/\bnow\s+works?\b/i,
|
|
36
|
+
];
|
|
37
|
+
// Patterns that indicate the commit is tentative (not a lie if it fails)
|
|
38
|
+
const TENTATIVE_PATTERNS = [
|
|
39
|
+
/\btry\b/i,
|
|
40
|
+
/\battempt/i,
|
|
41
|
+
/\bmaybe\b/i,
|
|
42
|
+
/\bwip\b/i,
|
|
43
|
+
/\bwork\s*in\s*progress/i,
|
|
44
|
+
/\bexperiment/i,
|
|
45
|
+
/\btest(ing)?\b/i, // Just "testing" something
|
|
46
|
+
/\bdebug/i,
|
|
47
|
+
/\binvestigat/i,
|
|
48
|
+
];
|
|
49
|
+
/**
|
|
50
|
+
* Detect "tests passing" lies through pattern analysis.
|
|
51
|
+
* This is the inferred method that works without running actual tests.
|
|
52
|
+
*/
|
|
53
|
+
function detectTestsPassingLie(events, filesPerCommit, config = {}) {
|
|
54
|
+
const cfg = { ...types_1.DEFAULT_INNER_LOOP_CONFIG, ...config };
|
|
55
|
+
const lies = [];
|
|
56
|
+
if (events.length < 2) {
|
|
57
|
+
return {
|
|
58
|
+
detected: false,
|
|
59
|
+
lies: [],
|
|
60
|
+
totalLies: 0,
|
|
61
|
+
message: 'Not enough commits to detect lies',
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
// Sort by timestamp ascending
|
|
65
|
+
const sorted = [...events].sort((a, b) => a.timestamp.getTime() - b.timestamp.getTime());
|
|
66
|
+
for (let i = 0; i < sorted.length - 1; i++) {
|
|
67
|
+
const commit = sorted[i];
|
|
68
|
+
const claimsSuccess = claimsToBeSuccessful(commit.subject);
|
|
69
|
+
const isTentative = isTentativeCommit(commit.subject);
|
|
70
|
+
// Skip if tentative or doesn't claim success
|
|
71
|
+
if (!claimsSuccess || isTentative)
|
|
72
|
+
continue;
|
|
73
|
+
// Look at following commits within 30 minutes
|
|
74
|
+
const followingCommits = getFollowingCommitsInWindow(sorted, i, 30);
|
|
75
|
+
// Check if followed by fix commits on same files
|
|
76
|
+
const commitFiles = filesPerCommit.get(commit.hash) || [];
|
|
77
|
+
const quickFixes = followingCommits.filter((fc) => {
|
|
78
|
+
if (fc.type !== 'fix')
|
|
79
|
+
return false;
|
|
80
|
+
// Check file overlap
|
|
81
|
+
const fcFiles = filesPerCommit.get(fc.hash) || [];
|
|
82
|
+
const hasOverlap = commitFiles.some((f) => fcFiles.includes(f));
|
|
83
|
+
// Or same scope
|
|
84
|
+
const sameScope = commit.scope && fc.scope === commit.scope;
|
|
85
|
+
return hasOverlap || sameScope;
|
|
86
|
+
});
|
|
87
|
+
if (quickFixes.length > 0) {
|
|
88
|
+
const gap = (0, date_fns_1.differenceInMinutes)(quickFixes[0].timestamp, commit.timestamp);
|
|
89
|
+
lies.push({
|
|
90
|
+
commitHash: commit.hash,
|
|
91
|
+
commitMessage: commit.subject,
|
|
92
|
+
timestamp: commit.timestamp,
|
|
93
|
+
claimedSuccess: true,
|
|
94
|
+
actualResult: 'inferred',
|
|
95
|
+
verificationMethod: 'inferred',
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
const detected = lies.length > 0;
|
|
100
|
+
let message = '';
|
|
101
|
+
if (detected) {
|
|
102
|
+
const lieRate = Math.round((lies.length / events.length) * 100);
|
|
103
|
+
message = `🤥 ${lies.length} "tests passing" lie${lies.length > 1 ? 's' : ''} detected: commits claimed success but required immediate fixes (${lieRate}% lie rate)`;
|
|
104
|
+
}
|
|
105
|
+
return {
|
|
106
|
+
detected,
|
|
107
|
+
lies: lies.slice(0, 10),
|
|
108
|
+
totalLies: lies.length,
|
|
109
|
+
message,
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Verify a specific commit by actually running tests.
|
|
114
|
+
* This requires the repo to be at that commit state.
|
|
115
|
+
*/
|
|
116
|
+
async function verifyCommit(repoPath, commitHash, config = {}) {
|
|
117
|
+
const cfg = { ...types_1.DEFAULT_INNER_LOOP_CONFIG, ...config };
|
|
118
|
+
// Determine test command
|
|
119
|
+
const testCommand = cfg.testCommand || detectTestCommand(repoPath);
|
|
120
|
+
if (!testCommand) {
|
|
121
|
+
return { passed: true, output: 'No test command configured or detected' };
|
|
122
|
+
}
|
|
123
|
+
try {
|
|
124
|
+
const { stdout, stderr } = await execAsync(testCommand, {
|
|
125
|
+
cwd: repoPath,
|
|
126
|
+
timeout: 120000, // 2 minute timeout
|
|
127
|
+
});
|
|
128
|
+
return { passed: true, output: stdout + stderr };
|
|
129
|
+
}
|
|
130
|
+
catch (error) {
|
|
131
|
+
const execError = error;
|
|
132
|
+
return {
|
|
133
|
+
passed: false,
|
|
134
|
+
output: (execError.stdout || '') + (execError.stderr || '') + (execError.message || ''),
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Verify build passes for a commit.
|
|
140
|
+
*/
|
|
141
|
+
async function verifyBuild(repoPath, config = {}) {
|
|
142
|
+
const cfg = { ...types_1.DEFAULT_INNER_LOOP_CONFIG, ...config };
|
|
143
|
+
const buildCommand = cfg.buildCommand || detectBuildCommand(repoPath);
|
|
144
|
+
if (!buildCommand) {
|
|
145
|
+
return { passed: true, output: 'No build command configured or detected' };
|
|
146
|
+
}
|
|
147
|
+
try {
|
|
148
|
+
const { stdout, stderr } = await execAsync(buildCommand, {
|
|
149
|
+
cwd: repoPath,
|
|
150
|
+
timeout: 300000, // 5 minute timeout
|
|
151
|
+
});
|
|
152
|
+
return { passed: true, output: stdout + stderr };
|
|
153
|
+
}
|
|
154
|
+
catch (error) {
|
|
155
|
+
const execError = error;
|
|
156
|
+
return {
|
|
157
|
+
passed: false,
|
|
158
|
+
output: (execError.stdout || '') + (execError.stderr || '') + (execError.message || ''),
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Check if a commit message claims success.
|
|
164
|
+
*/
|
|
165
|
+
function claimsToBeSuccessful(message) {
|
|
166
|
+
return SUCCESS_CLAIM_PATTERNS.some((p) => p.test(message));
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Check if a commit is tentative (WIP, try, experiment, etc.)
|
|
170
|
+
*/
|
|
171
|
+
function isTentativeCommit(message) {
|
|
172
|
+
return TENTATIVE_PATTERNS.some((p) => p.test(message));
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Get commits following a given index within a time window.
|
|
176
|
+
*/
|
|
177
|
+
function getFollowingCommitsInWindow(events, index, windowMinutes) {
|
|
178
|
+
const result = [];
|
|
179
|
+
const baseTime = events[index].timestamp;
|
|
180
|
+
const windowEnd = new Date(baseTime.getTime() + windowMinutes * 60 * 1000);
|
|
181
|
+
for (let i = index + 1; i < events.length; i++) {
|
|
182
|
+
if (events[i].timestamp > windowEnd)
|
|
183
|
+
break;
|
|
184
|
+
result.push(events[i]);
|
|
185
|
+
}
|
|
186
|
+
return result;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Detect test command from project configuration.
|
|
190
|
+
*/
|
|
191
|
+
function detectTestCommand(repoPath) {
|
|
192
|
+
// Common test commands by project type
|
|
193
|
+
// In real implementation, we'd check package.json, Makefile, etc.
|
|
194
|
+
const commands = [
|
|
195
|
+
'npm test',
|
|
196
|
+
'yarn test',
|
|
197
|
+
'pnpm test',
|
|
198
|
+
'make test',
|
|
199
|
+
'cargo test',
|
|
200
|
+
'go test ./...',
|
|
201
|
+
'pytest',
|
|
202
|
+
'python -m pytest',
|
|
203
|
+
];
|
|
204
|
+
// For now, return npm test as default for Node projects
|
|
205
|
+
return 'npm test';
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Detect build command from project configuration.
|
|
209
|
+
*/
|
|
210
|
+
function detectBuildCommand(repoPath) {
|
|
211
|
+
return 'npm run build';
|
|
212
|
+
}
|
|
213
|
+
//# sourceMappingURL=tests-passing-lie.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tests-passing-lie.js","sourceRoot":"","sources":["../../src/inner-loop/tests-passing-lie.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;AAgDH,sDAyEC;AAMD,oCA0BC;AAKD,kCAwBC;AApLD,uCAA+C;AAC/C,iDAAqC;AACrC,+BAAiC;AAEjC,mCAKiB;AAEjB,MAAM,SAAS,GAAG,IAAA,gBAAS,EAAC,oBAAI,CAAC,CAAC;AAElC,4CAA4C;AAC5C,M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EG;AACH,SAAS,kBAAkB,CAAC,QAAgB;IAC1C,OAAO,eAAe,CAAC;AACzB,CAAC"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inner Loop Failure Pattern Types
|
|
3
|
+
*
|
|
4
|
+
* These detect the 4 "Inner Loop Disasters" from vibe coding:
|
|
5
|
+
* 1. "Tests Passing" Lie - AI claims success but code doesn't work
|
|
6
|
+
* 2. Context Amnesia - Forgets instructions, re-does work
|
|
7
|
+
* 3. Instruction Drift - "Improves" things not asked for
|
|
8
|
+
* 4. Debug Loop Spiral - Adds logging instead of fixing
|
|
9
|
+
*/
|
|
10
|
+
export interface TestsPassingLieResult {
|
|
11
|
+
detected: boolean;
|
|
12
|
+
lies: TestsPassingLie[];
|
|
13
|
+
totalLies: number;
|
|
14
|
+
message: string;
|
|
15
|
+
}
|
|
16
|
+
export interface TestsPassingLie {
|
|
17
|
+
commitHash: string;
|
|
18
|
+
commitMessage: string;
|
|
19
|
+
timestamp: Date;
|
|
20
|
+
claimedSuccess: boolean;
|
|
21
|
+
actualResult: 'build_failed' | 'tests_failed' | 'unknown';
|
|
22
|
+
verificationMethod: 'npm_test' | 'npm_build' | 'make_test' | 'inferred';
|
|
23
|
+
}
|
|
24
|
+
export interface ContextAmnesiaResult {
|
|
25
|
+
detected: boolean;
|
|
26
|
+
incidents: ContextAmnesiaIncident[];
|
|
27
|
+
totalIncidents: number;
|
|
28
|
+
totalTimeWasted: number;
|
|
29
|
+
message: string;
|
|
30
|
+
}
|
|
31
|
+
export interface ContextAmnesiaIncident {
|
|
32
|
+
type: 'revert' | 'reimplementation' | 'forgotten_change';
|
|
33
|
+
originalCommit: {
|
|
34
|
+
hash: string;
|
|
35
|
+
message: string;
|
|
36
|
+
timestamp: Date;
|
|
37
|
+
};
|
|
38
|
+
repeatCommit: {
|
|
39
|
+
hash: string;
|
|
40
|
+
message: string;
|
|
41
|
+
timestamp: Date;
|
|
42
|
+
};
|
|
43
|
+
scope: string | null;
|
|
44
|
+
filesAffected: string[];
|
|
45
|
+
gapMinutes: number;
|
|
46
|
+
description: string;
|
|
47
|
+
}
|
|
48
|
+
export interface InstructionDriftResult {
|
|
49
|
+
detected: boolean;
|
|
50
|
+
drifts: InstructionDrift[];
|
|
51
|
+
totalDriftCommits: number;
|
|
52
|
+
totalUnauthorizedFiles: number;
|
|
53
|
+
message: string;
|
|
54
|
+
}
|
|
55
|
+
export interface InstructionDrift {
|
|
56
|
+
commitHash: string;
|
|
57
|
+
commitMessage: string;
|
|
58
|
+
timestamp: Date;
|
|
59
|
+
driftType: 'scope_creep' | 'unrequested_refactor' | 'unrequested_improvement' | 'style_change';
|
|
60
|
+
unauthorizedFiles: string[];
|
|
61
|
+
authorizedScope: string[];
|
|
62
|
+
description: string;
|
|
63
|
+
}
|
|
64
|
+
export interface SessionScope {
|
|
65
|
+
intendedFiles: string[];
|
|
66
|
+
intendedDirs: string[];
|
|
67
|
+
taskDescription?: string;
|
|
68
|
+
startTime: Date;
|
|
69
|
+
}
|
|
70
|
+
export interface LoggingOnlyResult {
|
|
71
|
+
detected: boolean;
|
|
72
|
+
loggingCommits: LoggingOnlyCommit[];
|
|
73
|
+
consecutiveLoggingCount: number;
|
|
74
|
+
totalLoggingCommits: number;
|
|
75
|
+
message: string;
|
|
76
|
+
}
|
|
77
|
+
export interface LoggingOnlyCommit {
|
|
78
|
+
hash: string;
|
|
79
|
+
message: string;
|
|
80
|
+
timestamp: Date;
|
|
81
|
+
loggingStatements: number;
|
|
82
|
+
actualFixes: number;
|
|
83
|
+
isLoggingOnly: boolean;
|
|
84
|
+
loggingPatterns: string[];
|
|
85
|
+
}
|
|
86
|
+
export interface InnerLoopAnalysis {
|
|
87
|
+
testsPassingLie: TestsPassingLieResult;
|
|
88
|
+
contextAmnesia: ContextAmnesiaResult;
|
|
89
|
+
instructionDrift: InstructionDriftResult;
|
|
90
|
+
loggingOnly: LoggingOnlyResult;
|
|
91
|
+
summary: {
|
|
92
|
+
totalIssuesDetected: number;
|
|
93
|
+
criticalIssues: number;
|
|
94
|
+
warningIssues: number;
|
|
95
|
+
overallHealth: 'healthy' | 'warning' | 'critical';
|
|
96
|
+
};
|
|
97
|
+
recommendations: string[];
|
|
98
|
+
}
|
|
99
|
+
export interface InnerLoopConfig {
|
|
100
|
+
runTestsAfterCommit: boolean;
|
|
101
|
+
testCommand?: string;
|
|
102
|
+
buildCommand?: string;
|
|
103
|
+
amnesiaWindowMinutes: number;
|
|
104
|
+
similarityThreshold: number;
|
|
105
|
+
sessionScope?: SessionScope;
|
|
106
|
+
allowedDriftFiles: string[];
|
|
107
|
+
maxConsecutiveLoggingCommits: number;
|
|
108
|
+
loggingPatterns: RegExp[];
|
|
109
|
+
}
|
|
110
|
+
export declare const DEFAULT_INNER_LOOP_CONFIG: InnerLoopConfig;
|
|
111
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/inner-loop/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAQH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,eAAe,EAAE,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,IAAI,CAAC;IAChB,cAAc,EAAE,OAAO,CAAC;IACxB,YAAY,EAAE,cAAc,GAAG,cAAc,GAAG,SAAS,CAAC;IAC1D,kBAAkB,EAAE,UAAU,GAAG,WAAW,GAAG,WAAW,GAAG,UAAU,CAAC;CACzE;AAMD,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,sBAAsB,EAAE,CAAC;IACpC,cAAc,EAAE,MAAM,CAAC;I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|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Inner Loop Failure Pattern Types
|
|
4
|
+
*
|
|
5
|
+
* These detect the 4 "Inner Loop Disasters" from vibe coding:
|
|
6
|
+
* 1. "Tests Passing" Lie - AI claims success but code doesn't work
|
|
7
|
+
* 2. Context Amnesia - Forgets instructions, re-does work
|
|
8
|
+
* 3. Instruction Drift - "Improves" things not asked for
|
|
9
|
+
* 4. Debug Loop Spiral - Adds logging instead of fixing
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.DEFAULT_INNER_LOOP_CONFIG = void 0;
|
|
13
|
+
exports.DEFAULT_INNER_LOOP_CONFIG = {
|
|
14
|
+
runTestsAfterCommit: false,
|
|
15
|
+
amnesiaWindowMinutes: 60,
|
|
16
|
+
similarityThreshold: 0.7,
|
|
17
|
+
allowedDriftFiles: ['package.json', 'package-lock.json', 'tsconfig.json', '.gitignore'],
|
|
18
|
+
maxConsecutiveLoggingCommits: 3,
|
|
19
|
+
loggingPatterns: [
|
|
20
|
+
/console\.(log|error|warn|debug|info)\(/,
|
|
21
|
+
/print\s*\(/,
|
|
22
|
+
/logger\.(log|error|warn|debug|info)\(/,
|
|
23
|
+
/System\.out\.print/,
|
|
24
|
+
/fmt\.Print/,
|
|
25
|
+
/debug!\(/,
|
|
26
|
+
/println!\(/,
|
|
27
|
+
],
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/inner-loop/types.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAuJU,QAAA,yBAAyB,GAAoB;IACxD,mBAAmB,EAAE,KAAK;IAC1B,oBAAoB,EAAE,EAAE;IACxB,mBAAmB,EAAE,GAAG;IACxB,iBAAiB,EAAE,CAAC,cAAc,EAAE,mBAAmB,EAAE,eAAe,EAAE,YAAY,CAAC;IACvF,4BAA4B,EAAE,CAAC;IAC/B,eAAe,EAAE;QACf,wCAAwC;QACxC,YAAY;QACZ,uCAAuC;QACvC,oBAAoB;QACpB,YAAY;QACZ,UAAU;QACV,YAAY;KACb;CACF,CAAC"}
|