@buoy-design/cli 0.3.32 → 0.3.34

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 (61) hide show
  1. package/dist/commands/check.d.ts.sync-conflict-20260305-170128-6PCZ3ZU.map +1 -0
  2. package/dist/commands/check.sync-conflict-20260305-155016-6PCZ3ZU.d.ts +26 -0
  3. package/dist/commands/check.sync-conflict-20260305-155016-6PCZ3ZU.d.ts.map +1 -0
  4. package/dist/commands/check.sync-conflict-20260305-155016-6PCZ3ZU.js +438 -0
  5. package/dist/commands/check.sync-conflict-20260305-155016-6PCZ3ZU.js.map +1 -0
  6. package/dist/commands/dock.sync-conflict-20260309-191923-6PCZ3ZU.js +1006 -0
  7. package/dist/commands/show.d.ts.map +1 -1
  8. package/dist/commands/show.d.ts.sync-conflict-20260306-165917-6PCZ3ZU.map +1 -0
  9. package/dist/commands/show.js +6 -0
  10. package/dist/commands/show.js.map +1 -1
  11. package/dist/commands/show.sync-conflict-20260305-140755-6PCZ3ZU.js +1735 -0
  12. package/dist/commands/show.sync-conflict-20260309-130326-6PCZ3ZU.d.ts +11 -0
  13. package/dist/commands/show.sync-conflict-20260309-130326-6PCZ3ZU.d.ts.map +1 -0
  14. package/dist/commands/show.sync-conflict-20260309-130326-6PCZ3ZU.js +1735 -0
  15. package/dist/commands/show.sync-conflict-20260309-130326-6PCZ3ZU.js.map +1 -0
  16. package/dist/config/loader.js +1 -1
  17. package/dist/config/loader.js.map +1 -1
  18. package/dist/config/loader.js.sync-conflict-20260309-033512-6PCZ3ZU.map +1 -0
  19. package/dist/config/loader.sync-conflict-20260307-175208-6PCZ3ZU.d.ts +8 -0
  20. package/dist/config/loader.sync-conflict-20260307-175208-6PCZ3ZU.d.ts.map +1 -0
  21. package/dist/config/loader.sync-conflict-20260307-175208-6PCZ3ZU.js +162 -0
  22. package/dist/config/loader.sync-conflict-20260307-175208-6PCZ3ZU.js.map +1 -0
  23. package/dist/config/schema.d.ts.sync-conflict-20260309-154654-6PCZ3ZU.map +1 -0
  24. package/dist/config/schema.sync-conflict-20260309-135703-6PCZ3ZU.js +214 -0
  25. package/dist/detect/frameworks.js.sync-conflict-20260306-123756-6PCZ3ZU.map +1 -0
  26. package/dist/detect/monorepo-patterns.js.sync-conflict-20260309-155400-6PCZ3ZU.map +1 -0
  27. package/dist/hooks/index.d.ts.sync-conflict-20260306-220901-6PCZ3ZU.map +1 -0
  28. package/dist/output/formatters.js.sync-conflict-20260306-134702-6PCZ3ZU.map +1 -0
  29. package/dist/output/formatters.sync-conflict-20260306-180804-6PCZ3ZU.js +867 -0
  30. package/dist/output/formatters.sync-conflict-20260307-131418-5SN2GZG.d.ts +29 -0
  31. package/dist/output/formatters.sync-conflict-20260307-131418-5SN2GZG.d.ts.map +1 -0
  32. package/dist/output/formatters.sync-conflict-20260307-131418-5SN2GZG.js +867 -0
  33. package/dist/output/formatters.sync-conflict-20260307-131418-5SN2GZG.js.map +1 -0
  34. package/dist/output/formatters.sync-conflict-20260307-143122-5SN2GZG.d.ts +29 -0
  35. package/dist/output/formatters.sync-conflict-20260307-143122-5SN2GZG.d.ts.map +1 -0
  36. package/dist/output/formatters.sync-conflict-20260307-143122-5SN2GZG.js +867 -0
  37. package/dist/output/formatters.sync-conflict-20260307-143122-5SN2GZG.js.map +1 -0
  38. package/dist/output/index.sync-conflict-20260309-222859-6PCZ3ZU.js +5 -0
  39. package/dist/output/reporters.d.sync-conflict-20260309-193820-6PCZ3ZU.ts +38 -0
  40. package/dist/output/reporters.d.ts.sync-conflict-20260306-193811-6PCZ3ZU.map +1 -0
  41. package/dist/output/reporters.sync-conflict-20260309-030558-6PCZ3ZU.js +182 -0
  42. package/dist/output/reports.d.ts.sync-conflict-20260307-172149-6PCZ3ZU.map +1 -0
  43. package/dist/output/reports.js.sync-conflict-20260305-161643-6PCZ3ZU.map +1 -0
  44. package/dist/output/reports.sync-conflict-20260305-211951-6PCZ3ZU.js +393 -0
  45. package/dist/output/visuals.d.ts +53 -0
  46. package/dist/output/visuals.d.ts.map +1 -0
  47. package/dist/output/visuals.js +194 -0
  48. package/dist/output/visuals.js.map +1 -0
  49. package/dist/services/drift-analysis.d.sync-conflict-20260306-151016-6PCZ3ZU.ts +194 -0
  50. package/dist/services/drift-analysis.d.ts.sync-conflict-20260307-175904-6PCZ3ZU.map +1 -0
  51. package/dist/services/drift-analysis.sync-conflict-20260309-133811-6PCZ3ZU.d.ts +194 -0
  52. package/dist/services/drift-analysis.sync-conflict-20260309-133811-6PCZ3ZU.d.ts.map +1 -0
  53. package/dist/services/drift-analysis.sync-conflict-20260309-133811-6PCZ3ZU.js +1022 -0
  54. package/dist/services/drift-analysis.sync-conflict-20260309-133811-6PCZ3ZU.js.map +1 -0
  55. package/dist/services/skill-export.d.ts.sync-conflict-20260309-171021-6PCZ3ZU.map +1 -0
  56. package/dist/services/skill-export.sync-conflict-20260309-144621-6PCZ3ZU.d.ts +109 -0
  57. package/dist/services/skill-export.sync-conflict-20260309-144621-6PCZ3ZU.d.ts.map +1 -0
  58. package/dist/services/skill-export.sync-conflict-20260309-144621-6PCZ3ZU.js +737 -0
  59. package/dist/services/skill-export.sync-conflict-20260309-144621-6PCZ3ZU.js.map +1 -0
  60. package/package.json +14 -14
  61. package/LICENSE +0 -21
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/commands/check.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,OAAO,KAAK,EAAE,WAAW,EAAoC,MAAM,mBAAmB,CAAC;AAyBvF,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,MAAM,GAAG,aAAa,CAAC;AAoB3D;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,WAAW,EAAE,EACrB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC1E,MAAM,CA0DR;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,MAAM,EAAE,CAgBzC;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CA4B9D;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,WAAW,EAClB,WAAW,EAAE,MAAM,EAAE,GACpB,OAAO,CAgBT;AAgBD,wBAAgB,kBAAkB,IAAI,OAAO,CA2U5C"}
@@ -0,0 +1,26 @@
1
+ import { Command } from "commander";
2
+ import type { DriftSignal } from "@buoy-design/core";
3
+ export type OutputFormat = "text" | "json" | "ai-feedback";
4
+ /**
5
+ * Format drift signals as AI-friendly JSON feedback
6
+ */
7
+ export declare function formatAiFeedback(drifts: DriftSignal[], exitCode: number, summary: {
8
+ critical: number;
9
+ warning: number;
10
+ info: number;
11
+ total: number;
12
+ }): string;
13
+ /**
14
+ * Get list of staged files from git
15
+ */
16
+ export declare function getStagedFiles(): string[];
17
+ /**
18
+ * Filter files to only include scannable extensions
19
+ */
20
+ export declare function filterScannableFiles(files: string[]): string[];
21
+ /**
22
+ * Check if a drift signal is from a staged file
23
+ */
24
+ export declare function isFromStagedFile(drift: DriftSignal, stagedFiles: string[]): boolean;
25
+ export declare function createCheckCommand(): Command;
26
+ //# sourceMappingURL=check.sync-conflict-20260305-155016-6PCZ3ZU.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check.sync-conflict-20260305-155016-6PCZ3ZU.d.ts","sourceRoot":"","sources":["../../src/commands/check.sync-conflict-20260305-155016-6PCZ3ZU.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,OAAO,KAAK,EAAE,WAAW,EAAoC,MAAM,mBAAmB,CAAC;AAyBvF,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,MAAM,GAAG,aAAa,CAAC;AAoB3D;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,WAAW,EAAE,EACrB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC1E,MAAM,CA0DR;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,MAAM,EAAE,CAgBzC;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CA4B9D;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,WAAW,EAClB,WAAW,EAAE,MAAM,EAAE,GACpB,OAAO,CAgBT;AAgBD,wBAAgB,kBAAkB,IAAI,OAAO,CA2U5C"}
@@ -0,0 +1,438 @@
1
+ // apps/cli/src/commands/check.ts
2
+ import { Command } from "commander";
3
+ import chalk from "chalk";
4
+ import { loadConfig, getConfigPath } from "../config/loader.js";
5
+ import { buildAutoConfig } from "../config/auto-detect.js";
6
+ import { execSync } from "node:child_process";
7
+ import { DriftAnalysisService, hasDriftsAboveThreshold, calculateDriftSummary, } from "../services/drift-analysis.js";
8
+ import { formatUpgradeHint } from "../utils/upgrade-hints.js";
9
+ import { generatePRCommentPreview } from "../output/pr-comment-preview.js";
10
+ import { isLoggedIn, submitScanReport, getGitMetadata, } from "../cloud/index.js";
11
+ import { ScanOrchestrator } from "../scan/orchestrator.js";
12
+ import { calculateHealthScorePillar } from "@buoy-design/core";
13
+ import { gatherHealthMetrics } from "./show.js";
14
+ import { summaryBox, separator, highlight, driftSeverityIcon, } from "../output/visuals.js";
15
+ /**
16
+ * Generate a copy-paste ready diff snippet for a drift fix
17
+ */
18
+ function generateFixSnippet(file, line, oldValue, newValue) {
19
+ const location = line ? `${file}:${line}` : file;
20
+ const lines = [`// ${location}`];
21
+ if (oldValue) {
22
+ lines.push(`- ${oldValue}`);
23
+ }
24
+ lines.push(`+ ${newValue}`);
25
+ return lines.join("\n");
26
+ }
27
+ /**
28
+ * Format drift signals as AI-friendly JSON feedback
29
+ */
30
+ export function formatAiFeedback(drifts, exitCode, summary) {
31
+ const issues = drifts.map((drift) => {
32
+ const location = drift.source.location || "";
33
+ const [file, lineStr, colStr] = location.split(":");
34
+ // Extract fix suggestion from details if available
35
+ const suggestions = drift.details?.suggestions;
36
+ const firstSuggestion = suggestions?.[0];
37
+ const oldValue = drift.details?.actual;
38
+ const fix = firstSuggestion
39
+ ? {
40
+ type: "replace",
41
+ old: oldValue,
42
+ new: firstSuggestion,
43
+ snippet: generateFixSnippet(file || drift.source.entityName, lineStr ? parseInt(lineStr, 10) : undefined, oldValue, firstSuggestion),
44
+ }
45
+ : undefined;
46
+ return {
47
+ file: file || drift.source.entityName,
48
+ line: lineStr ? parseInt(lineStr, 10) : undefined,
49
+ column: colStr ? parseInt(colStr, 10) : undefined,
50
+ type: drift.type,
51
+ severity: drift.severity,
52
+ message: drift.message,
53
+ entity: drift.source.entityName,
54
+ current: drift.details?.actual,
55
+ suggested: firstSuggestion || drift.details?.expected,
56
+ fix,
57
+ };
58
+ });
59
+ const output = {
60
+ passed: exitCode === 0,
61
+ issues,
62
+ summary: {
63
+ total: summary.total,
64
+ critical: summary.critical,
65
+ warning: summary.warning,
66
+ info: summary.info,
67
+ fixable: issues.filter((i) => i.fix).length,
68
+ },
69
+ instructions: exitCode === 0
70
+ ? "All checks passed. Code is design system compliant."
71
+ : [
72
+ "Design system violations detected.",
73
+ "Fix each issue by replacing the current value with the suggested token.",
74
+ "Re-run `buoy drift check` after making changes to verify fixes.",
75
+ ].join(" "),
76
+ };
77
+ return JSON.stringify(output, null, 2);
78
+ }
79
+ /**
80
+ * Get list of staged files from git
81
+ */
82
+ export function getStagedFiles() {
83
+ try {
84
+ const output = execSync("git diff --cached --name-only --diff-filter=ACMR", {
85
+ encoding: "utf-8",
86
+ stdio: ["pipe", "pipe", "pipe"],
87
+ });
88
+ return output
89
+ .split("\n")
90
+ .map((f) => f.trim())
91
+ .filter(Boolean);
92
+ }
93
+ catch {
94
+ return [];
95
+ }
96
+ }
97
+ /**
98
+ * Filter files to only include scannable extensions
99
+ */
100
+ export function filterScannableFiles(files) {
101
+ const scannableExtensions = [
102
+ // React/JS
103
+ ".tsx",
104
+ ".jsx",
105
+ ".ts",
106
+ ".js",
107
+ // Vue
108
+ ".vue",
109
+ // Svelte
110
+ ".svelte",
111
+ // Angular
112
+ ".component.ts",
113
+ // Templates
114
+ ".blade.php",
115
+ ".erb",
116
+ ".twig",
117
+ ".njk",
118
+ ".html",
119
+ // Tokens
120
+ ".css",
121
+ ".scss",
122
+ ".json",
123
+ ];
124
+ return files.filter((file) => scannableExtensions.some((ext) => file.endsWith(ext)));
125
+ }
126
+ /**
127
+ * Check if a drift signal is from a staged file
128
+ */
129
+ export function isFromStagedFile(drift, stagedFiles) {
130
+ const location = drift.source.location;
131
+ if (!location)
132
+ return true; // Include drifts without location
133
+ // Extract file path from location (format: "path/to/file.tsx:line")
134
+ const filePath = location.split(":")[0];
135
+ // Check if the file path matches any staged file
136
+ if (!filePath)
137
+ return true;
138
+ return stagedFiles.some((stagedFile) => filePath === stagedFile ||
139
+ filePath.endsWith(`/${stagedFile}`) ||
140
+ stagedFile.endsWith(`/${filePath}`));
141
+ }
142
+ /**
143
+ * Calculate a simple maturity score based on tokens and drift
144
+ */
145
+ function calculateMaturityScore(tokenCount, driftCount) {
146
+ // Base score from having tokens
147
+ let score = Math.min(50, tokenCount * 5); // Up to 50 points for tokens
148
+ // Penalty for drift
149
+ const driftPenalty = Math.min(50, driftCount * 2);
150
+ score += 50 - driftPenalty; // 50 points base minus drift penalty
151
+ return Math.max(0, Math.min(100, score));
152
+ }
153
+ export function createCheckCommand() {
154
+ const cmd = new Command("check")
155
+ .description("Fast drift check for pre-commit hooks")
156
+ .option("--fail-on <severity>", "Exit 1 if drift at this severity or higher: critical, warning, info, none", "critical")
157
+ .option("--staged", "Only check staged files (for pre-commit hooks)")
158
+ .option("--quiet", "Suppress all output except errors")
159
+ .option("-v, --verbose", "Show detailed output")
160
+ .option("--format <format>", "Output format: text, json, ai-feedback", "text")
161
+ .option("--json", "Output as JSON (shorthand for --format json)")
162
+ .option("--preview-comment", "Preview what a PR comment would look like")
163
+ .option("--report", "Report results to Buoy Cloud (requires login)")
164
+ .option("--repo <repo>", "Repository name (owner/repo) for cloud reporting")
165
+ .option("--pr <number>", "PR number for cloud reporting", parseInt)
166
+ .action(async (options) => {
167
+ // --json is shorthand for --format json
168
+ if (options.json) {
169
+ options.format = "json";
170
+ }
171
+ const log = options.quiet
172
+ ? () => { }
173
+ : options.verbose
174
+ ? console.error.bind(console)
175
+ : () => { };
176
+ try {
177
+ log("Loading configuration...");
178
+ const existingConfigPath = getConfigPath();
179
+ let config;
180
+ if (existingConfigPath) {
181
+ const loaded = await loadConfig();
182
+ config = loaded.config;
183
+ if (options.verbose) {
184
+ log(`Using config: ${existingConfigPath}`);
185
+ }
186
+ }
187
+ else {
188
+ const auto = await buildAutoConfig(process.cwd());
189
+ config = auto.config;
190
+ log("No config found, using auto-detected settings");
191
+ }
192
+ // Get staged files if --staged flag is used
193
+ let stagedFiles = [];
194
+ if (options.staged) {
195
+ stagedFiles = getStagedFiles();
196
+ const scannableStaged = filterScannableFiles(stagedFiles);
197
+ if (scannableStaged.length === 0) {
198
+ log("No scannable files staged, skipping check");
199
+ process.exit(0);
200
+ }
201
+ log(`Checking ${scannableStaged.length} staged file(s)...`);
202
+ }
203
+ log("Scanning for drift...");
204
+ // Use consolidated drift analysis service
205
+ const service = new DriftAnalysisService(config);
206
+ const result = await service.analyze({
207
+ onProgress: log,
208
+ includeIgnored: false,
209
+ });
210
+ let drifts = result.drifts;
211
+ // Filter to staged files only if --staged is used
212
+ if (options.staged && stagedFiles.length > 0) {
213
+ drifts = drifts.filter((d) => isFromStagedFile(d, stagedFiles));
214
+ }
215
+ // Determine exit code using shared utility
216
+ const failOn = options.failOn;
217
+ let exitCode = hasDriftsAboveThreshold(drifts, failOn) ? 1 : 0;
218
+ // Summary counts using shared utility
219
+ const summary = calculateDriftSummary(drifts);
220
+ // Health threshold check (health.failBelow)
221
+ let healthScore = null;
222
+ let healthFailed = false;
223
+ const failBelow = config.health?.failBelow;
224
+ if (failBelow != null) {
225
+ log("Calculating health score...");
226
+ const dummySpinner = { text: "" };
227
+ const healthMetrics = await gatherHealthMetrics(config, dummySpinner, true);
228
+ const healthResult = calculateHealthScorePillar(healthMetrics);
229
+ healthScore = healthResult.score;
230
+ if (healthScore !== null && healthScore < failBelow) {
231
+ healthFailed = true;
232
+ exitCode = 1;
233
+ }
234
+ }
235
+ // Cloud reporting if --report flag is used
236
+ if (options.report) {
237
+ if (!isLoggedIn()) {
238
+ if (!options.quiet) {
239
+ console.error("Error: Not logged in. Run `buoy ahoy login` first.");
240
+ }
241
+ }
242
+ else if (!options.repo) {
243
+ if (!options.quiet) {
244
+ console.error("Error: --repo is required for cloud reporting.");
245
+ }
246
+ }
247
+ else {
248
+ log("Reporting to Buoy Cloud...");
249
+ // Get git metadata
250
+ const gitMeta = getGitMetadata(process.cwd());
251
+ // Scan for tokens and components to include in report
252
+ const orchestrator = new ScanOrchestrator(config, process.cwd());
253
+ const scanStart = Date.now();
254
+ const scanResults = await orchestrator.scan({
255
+ onProgress: log,
256
+ });
257
+ const scanDuration = Date.now() - scanStart;
258
+ // Convert drift signals to report format
259
+ const driftSignals = drifts.map((d) => {
260
+ const location = d.source.location || "";
261
+ const [file, lineStr, colStr] = location.split(":");
262
+ const suggestions = d.details?.suggestions;
263
+ const firstSuggestion = suggestions?.[0];
264
+ const actual = d.details?.actual;
265
+ return {
266
+ type: d.type,
267
+ severity: d.severity,
268
+ file: file || d.source.entityName,
269
+ line: lineStr ? parseInt(lineStr, 10) : 1,
270
+ column: colStr ? parseInt(colStr, 10) : undefined,
271
+ value: actual || '',
272
+ message: d.message,
273
+ suggestion: firstSuggestion ? {
274
+ token: firstSuggestion,
275
+ value: firstSuggestion,
276
+ confidence: 0.8,
277
+ replacement: firstSuggestion,
278
+ } : undefined,
279
+ };
280
+ });
281
+ // Build report input
282
+ const reportInput = {
283
+ repo: options.repo,
284
+ commitSha: gitMeta.commitSha || 'unknown',
285
+ branch: gitMeta.branch,
286
+ prNumber: options.pr,
287
+ scanDuration,
288
+ tokens: scanResults.tokens.map((t) => ({
289
+ name: t.name,
290
+ value: typeof t.value === 'object' ? JSON.stringify(t.value) : String(t.value),
291
+ source: t.source.type,
292
+ })),
293
+ components: scanResults.components.map((c) => ({
294
+ name: c.name,
295
+ path: 'path' in c.source ? c.source.path : c.id,
296
+ source: c.source.type,
297
+ })),
298
+ sources: [], // TODO: detect intent sources
299
+ driftSignals,
300
+ maturityScore: calculateMaturityScore(scanResults.tokens.length, drifts.length),
301
+ };
302
+ const reportResult = await submitScanReport(reportInput);
303
+ if (reportResult.success) {
304
+ log(`Reported to Buoy Cloud (${reportResult.scanId})`);
305
+ // Output PR comment if available
306
+ if (reportResult.prComment?.shouldComment && !options.quiet) {
307
+ console.log("");
308
+ console.log("--- PR Comment ---");
309
+ console.log(reportResult.prComment.body);
310
+ console.log("--- End PR Comment ---");
311
+ }
312
+ }
313
+ else {
314
+ if (!options.quiet) {
315
+ console.error(`Cloud report failed: ${reportResult.error}`);
316
+ }
317
+ }
318
+ }
319
+ }
320
+ // Handle --preview-comment flag
321
+ if (options.previewComment) {
322
+ console.log(generatePRCommentPreview(drifts, summary));
323
+ process.exit(exitCode);
324
+ return;
325
+ }
326
+ // Output based on format
327
+ const format = options.format;
328
+ if (format === "ai-feedback") {
329
+ console.log(formatAiFeedback(drifts, exitCode, summary));
330
+ process.exit(exitCode);
331
+ return;
332
+ }
333
+ if (format === "json") {
334
+ const jsonOutput = {
335
+ passed: exitCode === 0,
336
+ drifts: drifts.map((d) => ({
337
+ id: d.id,
338
+ type: d.type,
339
+ severity: d.severity,
340
+ message: d.message,
341
+ source: d.source,
342
+ details: d.details,
343
+ })),
344
+ summary,
345
+ };
346
+ if (failBelow != null) {
347
+ jsonOutput.health = {
348
+ score: healthScore,
349
+ threshold: failBelow,
350
+ passed: !healthFailed,
351
+ };
352
+ }
353
+ console.log(JSON.stringify(jsonOutput, null, 2));
354
+ process.exit(exitCode);
355
+ return;
356
+ }
357
+ // Default text format
358
+ if (!options.quiet) {
359
+ // Use real health score if available, otherwise estimate from drift density
360
+ const componentCount = result.components?.length ?? 0;
361
+ const displayScore = healthScore ?? (componentCount > 0
362
+ ? Math.max(0, Math.min(100, Math.round(100 - (drifts.length / componentCount) * 100)))
363
+ : calculateMaturityScore(0, drifts.length));
364
+ // Show the framed summary box
365
+ console.log("");
366
+ console.log(summaryBox({
367
+ score: displayScore,
368
+ components: componentCount,
369
+ tokens: 0,
370
+ drifts: summary,
371
+ }));
372
+ console.log("");
373
+ if (exitCode === 0) {
374
+ if (summary.total === 0) {
375
+ console.log(highlight.success("\u2714") + " No drift detected");
376
+ }
377
+ else {
378
+ console.log(highlight.success("\u2714") +
379
+ ` Check passed (${summary.total} drift${summary.total !== 1 ? "s" : ""} below threshold)`);
380
+ }
381
+ }
382
+ else {
383
+ console.log(highlight.error("\u2717") + " Drift detected");
384
+ console.log("");
385
+ console.log(` ${driftSeverityIcon.critical} Critical: ${summary.critical}`);
386
+ console.log(` ${driftSeverityIcon.warning} Warning: ${summary.warning}`);
387
+ console.log(` ${chalk.blue("i")} Info: ${summary.info}`);
388
+ if (options.verbose) {
389
+ console.log("");
390
+ console.log(separator());
391
+ for (const drift of drifts.slice(0, 10)) {
392
+ const icon = driftSeverityIcon[drift.severity] ??
393
+ chalk.blue("i");
394
+ const loc = drift.source.location
395
+ ? highlight.dim(` (${drift.source.location})`)
396
+ : "";
397
+ console.log(` ${icon} ${drift.source.entityName}: ${drift.message}${loc}`);
398
+ }
399
+ if (drifts.length > 10) {
400
+ console.log(highlight.dim(` ... and ${drifts.length - 10} more`));
401
+ }
402
+ }
403
+ console.log("");
404
+ console.log(highlight.info("i") +
405
+ " Run " +
406
+ highlight.info("`buoy show drift`") +
407
+ " for details");
408
+ }
409
+ // Show health score when threshold is configured
410
+ if (failBelow != null && healthScore !== null) {
411
+ console.log("");
412
+ if (healthFailed) {
413
+ console.log(highlight.error("\u2717") + ` Health score ${healthScore}/100 is below threshold ${failBelow}`);
414
+ }
415
+ else {
416
+ console.log(highlight.success("\u2714") + ` Health score ${healthScore}/100 (threshold: ${failBelow})`);
417
+ }
418
+ }
419
+ // Show upgrade hint when check fails
420
+ const hint = formatUpgradeHint('after-check-fail');
421
+ if (hint) {
422
+ console.log('');
423
+ console.log(hint);
424
+ }
425
+ }
426
+ process.exit(exitCode);
427
+ }
428
+ catch (err) {
429
+ const message = err instanceof Error ? err.message : String(err);
430
+ if (!options.quiet) {
431
+ console.error(`Error: ${message}`);
432
+ }
433
+ process.exit(1);
434
+ }
435
+ });
436
+ return cmd;
437
+ }
438
+ //# sourceMappingURL=check.sync-conflict-20260305-155016-6PCZ3ZU.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check.sync-conflict-20260305-155016-6PCZ3ZU.js","sourceRoot":"","sources":["../../src/commands/check.sync-conflict-20260305-155016-6PCZ3ZU.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAG3D,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAA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