hyntx 2.4.0 → 2.6.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.
@@ -0,0 +1,389 @@
1
+ #!/usr/bin/env node
2
+ import { existsSync, readFileSync, mkdirSync, writeFileSync, chmodSync } from 'fs';
3
+ import { homedir } from 'os';
4
+ import { join, dirname } from 'path';
5
+ import chalk from 'chalk';
6
+
7
+ // src/utils/logger-base.ts
8
+ var BaseLogger = class {
9
+ warnings = [];
10
+ verboseEnabled = false;
11
+ /**
12
+ * Enables or disables verbose (debug) mode.
13
+ *
14
+ * @param enabled - Whether to enable verbose mode
15
+ */
16
+ setVerbose(enabled) {
17
+ this.verboseEnabled = enabled;
18
+ }
19
+ /**
20
+ * Returns whether verbose mode is enabled.
21
+ *
22
+ * @returns true if verbose mode is enabled
23
+ */
24
+ isVerbose() {
25
+ return this.verboseEnabled;
26
+ }
27
+ /**
28
+ * Logs an error message to stderr.
29
+ *
30
+ * @param message - Error message
31
+ * @param context - Optional context (e.g., file name, operation)
32
+ */
33
+ error(message, context) {
34
+ const prefix = context ? `[${context}] ` : "";
35
+ process.stderr.write(`ERROR: ${prefix}${message}
36
+ `);
37
+ }
38
+ /**
39
+ * Logs a warning message to stderr.
40
+ *
41
+ * @param message - Warning message
42
+ * @param context - Optional context (e.g., file name, operation)
43
+ */
44
+ warn(message, context) {
45
+ const prefix = context ? `[${context}] ` : "";
46
+ process.stderr.write(`WARN: ${prefix}${message}
47
+ `);
48
+ }
49
+ /**
50
+ * Logs an info message to stderr.
51
+ *
52
+ * @param message - Info message
53
+ */
54
+ info(message) {
55
+ process.stderr.write(`INFO: ${message}
56
+ `);
57
+ }
58
+ /**
59
+ * Logs a debug message to stderr (only when verbose mode is enabled).
60
+ *
61
+ * @param message - Debug message
62
+ * @param context - Optional context
63
+ */
64
+ debug(message, context) {
65
+ if (this.verboseEnabled) {
66
+ const prefix = context ? `[${context}] ` : "";
67
+ process.stderr.write(`[DEBUG] ${prefix}${message}
68
+ `);
69
+ }
70
+ }
71
+ /**
72
+ * Collects a warning for later reporting.
73
+ * Use this for non-fatal issues that should be displayed at the end of execution.
74
+ *
75
+ * @param message - Warning message
76
+ * @param context - Optional context (e.g., file name, operation)
77
+ */
78
+ collectWarning(message, context) {
79
+ this.warnings.push({ message, context });
80
+ }
81
+ /**
82
+ * Returns all collected warnings.
83
+ *
84
+ * @returns Array of collected warnings
85
+ */
86
+ getWarnings() {
87
+ return [...this.warnings];
88
+ }
89
+ /**
90
+ * Returns the number of collected warnings.
91
+ *
92
+ * @returns Warning count
93
+ */
94
+ getWarningCount() {
95
+ return this.warnings.length;
96
+ }
97
+ /**
98
+ * Clears all collected warnings.
99
+ */
100
+ clearWarnings() {
101
+ this.warnings = [];
102
+ }
103
+ /**
104
+ * Reports all collected warnings to stderr and clears them.
105
+ * Does nothing if there are no warnings.
106
+ */
107
+ reportWarnings() {
108
+ if (this.warnings.length === 0) {
109
+ return;
110
+ }
111
+ process.stderr.write(`
112
+ \u26A0\uFE0F ${String(this.warnings.length)} warning(s):
113
+ `);
114
+ for (const warning of this.warnings) {
115
+ const prefix = warning.context ? `[${warning.context}] ` : "";
116
+ process.stderr.write(` - ${prefix}${warning.message}
117
+ `);
118
+ }
119
+ this.clearWarnings();
120
+ }
121
+ /**
122
+ * Formats collected warnings as plain text (without ANSI colors).
123
+ * Useful for JSON output or testing.
124
+ *
125
+ * @returns Array of formatted warning strings
126
+ */
127
+ formatWarnings() {
128
+ return this.warnings.map((w) => {
129
+ const prefix = w.context ? `[${w.context}] ` : "";
130
+ return `${prefix}${w.message}`;
131
+ });
132
+ }
133
+ };
134
+ var logger = new BaseLogger();
135
+
136
+ // src/utils/logger.ts
137
+ var CliLogger = class extends BaseLogger {
138
+ /**
139
+ * Logs an error message to stderr with red coloring.
140
+ *
141
+ * @param message - Error message
142
+ * @param context - Optional context (e.g., file name, operation)
143
+ */
144
+ error(message, context) {
145
+ const prefix = context ? `[${context}] ` : "";
146
+ process.stderr.write(chalk.red(`ERROR: ${prefix}${message}
147
+ `));
148
+ }
149
+ /**
150
+ * Logs a warning message to stderr with yellow coloring.
151
+ *
152
+ * @param message - Warning message
153
+ * @param context - Optional context (e.g., file name, operation)
154
+ */
155
+ warn(message, context) {
156
+ const prefix = context ? `[${context}] ` : "";
157
+ process.stderr.write(chalk.yellow(`WARN: ${prefix}${message}
158
+ `));
159
+ }
160
+ /**
161
+ * Logs an info message to stderr with blue coloring.
162
+ *
163
+ * @param message - Info message
164
+ */
165
+ info(message) {
166
+ process.stderr.write(chalk.blue(`INFO: ${message}
167
+ `));
168
+ }
169
+ /**
170
+ * Logs a debug message to stderr with gray coloring (only when verbose mode is enabled).
171
+ *
172
+ * @param message - Debug message
173
+ * @param context - Optional context
174
+ */
175
+ debug(message, context) {
176
+ if (this.isVerbose()) {
177
+ const prefix = context ? `[${context}] ` : "";
178
+ process.stderr.write(chalk.gray(`[DEBUG] ${prefix}${message}
179
+ `));
180
+ }
181
+ }
182
+ /**
183
+ * Reports all collected warnings to stderr with yellow coloring and clears them.
184
+ * Does nothing if there are no warnings.
185
+ */
186
+ reportWarnings() {
187
+ const warnings = this.getWarnings();
188
+ if (warnings.length === 0) {
189
+ return;
190
+ }
191
+ process.stderr.write(
192
+ chalk.yellow(`
193
+ \u26A0\uFE0F ${String(warnings.length)} warning(s):
194
+ `)
195
+ );
196
+ for (const warning of warnings) {
197
+ const prefix = warning.context ? `[${warning.context}] ` : "";
198
+ process.stderr.write(chalk.yellow(` - ${prefix}${warning.message}
199
+ `));
200
+ }
201
+ this.clearWarnings();
202
+ }
203
+ };
204
+ var logger2 = new CliLogger();
205
+
206
+ // src/utils/shell-config.ts
207
+ var START_MARKER = "# >>> hyntx config >>>";
208
+ var END_MARKER = "# <<< hyntx config <<<";
209
+ function findMarkerPositions(content) {
210
+ const startIndex = content.indexOf(START_MARKER);
211
+ const endIndex = content.indexOf(END_MARKER);
212
+ if (startIndex === -1 && endIndex === -1) {
213
+ return { startIndex: -1, endIndex: -1, isValid: true };
214
+ }
215
+ if (startIndex !== -1 && endIndex === -1) {
216
+ return { startIndex, endIndex: -1, isValid: false, issue: "missing_end" };
217
+ }
218
+ if (startIndex === -1 && endIndex !== -1) {
219
+ return { startIndex: -1, endIndex, isValid: false, issue: "missing_start" };
220
+ }
221
+ if (startIndex > endIndex) {
222
+ return { startIndex, endIndex, isValid: false, issue: "wrong_order" };
223
+ }
224
+ return { startIndex, endIndex, isValid: true };
225
+ }
226
+ function removeMalformedMarkers(content, positions) {
227
+ let result = content;
228
+ if (positions.issue === "wrong_order") {
229
+ const startLineEnd = result.indexOf("\n", positions.startIndex);
230
+ const before = result.slice(0, positions.endIndex);
231
+ const after = result.slice(
232
+ startLineEnd !== -1 ? startLineEnd + 1 : result.length
233
+ );
234
+ result = before.trimEnd() + (after ? "\n" + after : "");
235
+ } else {
236
+ const markerIndex = positions.startIndex !== -1 ? positions.startIndex : positions.endIndex;
237
+ const marker = positions.startIndex !== -1 ? START_MARKER : END_MARKER;
238
+ const lineStart = result.lastIndexOf("\n", markerIndex - 1) + 1;
239
+ const lineEnd = result.indexOf("\n", markerIndex + marker.length);
240
+ result = result.slice(0, lineStart) + result.slice(lineEnd !== -1 ? lineEnd + 1 : result.length);
241
+ }
242
+ return result.trimEnd();
243
+ }
244
+ function detectShellConfigFile() {
245
+ const home = homedir();
246
+ const shell = process.env["SHELL"] ?? "";
247
+ if (shell.includes("zsh")) {
248
+ return {
249
+ shellType: "zsh",
250
+ configFile: join(home, ".zshrc")
251
+ };
252
+ }
253
+ if (shell.includes("bash")) {
254
+ return {
255
+ shellType: "bash",
256
+ configFile: join(home, ".bashrc")
257
+ };
258
+ }
259
+ if (shell.includes("fish")) {
260
+ return {
261
+ shellType: "fish",
262
+ configFile: join(home, ".config", "fish", "config.fish")
263
+ };
264
+ }
265
+ const defaultShell = process.platform === "darwin" ? "zsh" : "bash";
266
+ return {
267
+ shellType: defaultShell,
268
+ configFile: join(home, `.${defaultShell}rc`)
269
+ };
270
+ }
271
+ function generateEnvExports(config) {
272
+ const lines = [];
273
+ if (config.services.length > 0) {
274
+ lines.push(`export HYNTX_SERVICES=${config.services.join(",")}`);
275
+ }
276
+ if (config.reminder) {
277
+ lines.push(`export HYNTX_REMINDER=${config.reminder}`);
278
+ }
279
+ if (config.services.includes("ollama")) {
280
+ if (config.ollama.model) {
281
+ lines.push(`export HYNTX_OLLAMA_MODEL=${config.ollama.model}`);
282
+ }
283
+ if (config.ollama.host) {
284
+ lines.push(`export HYNTX_OLLAMA_HOST=${config.ollama.host}`);
285
+ }
286
+ }
287
+ if (config.services.includes("anthropic") && config.anthropic.apiKey) {
288
+ lines.push(`export HYNTX_ANTHROPIC_MODEL=${config.anthropic.model}`);
289
+ lines.push(`export HYNTX_ANTHROPIC_KEY=${config.anthropic.apiKey}`);
290
+ }
291
+ if (config.services.includes("google") && config.google.apiKey) {
292
+ lines.push(`export HYNTX_GOOGLE_MODEL=${config.google.model}`);
293
+ lines.push(`export HYNTX_GOOGLE_KEY=${config.google.apiKey}`);
294
+ }
295
+ return lines;
296
+ }
297
+ function updateShellConfig(configFile, exports$1) {
298
+ const exportLines = exports$1.map((line) => ` ${line}`).join("\n");
299
+ const configBlock = `${START_MARKER}
300
+ ${exportLines}
301
+
302
+ # Uncomment to enable periodic reminders:
303
+ # hyntx --check-reminder 2>/dev/null
304
+ ${END_MARKER}
305
+ `;
306
+ try {
307
+ let content = "";
308
+ let action = "created";
309
+ if (existsSync(configFile)) {
310
+ content = readFileSync(configFile, "utf-8");
311
+ action = "updated";
312
+ }
313
+ const positions = findMarkerPositions(content);
314
+ if (positions.startIndex === -1 && positions.endIndex === -1) {
315
+ const separator = content && !content.endsWith("\n") ? "\n\n" : "\n";
316
+ content = `${content}${separator}${configBlock}`;
317
+ } else if (positions.isValid) {
318
+ const before = content.slice(0, positions.startIndex);
319
+ const after = content.slice(positions.endIndex + END_MARKER.length);
320
+ const beforeTrimmed = before.endsWith("\n") ? before.slice(0, -1) : before;
321
+ content = `${beforeTrimmed}
322
+ ${configBlock}${after}`.trim() + "\n";
323
+ } else {
324
+ logger2.collectWarning(
325
+ `Found malformed Hyntx block in ${configFile} (${positions.issue ?? "unknown"}). Rebuilding configuration.`,
326
+ "shell-config"
327
+ );
328
+ const cleanedContent = removeMalformedMarkers(content, positions);
329
+ const separator = cleanedContent && !cleanedContent.endsWith("\n") ? "\n\n" : "\n";
330
+ content = `${cleanedContent}${separator}${configBlock}`;
331
+ }
332
+ try {
333
+ mkdirSync(dirname(configFile), { recursive: true });
334
+ } catch (error) {
335
+ if (error instanceof Error && !error.message.includes("EEXIST") && !error.code?.includes("EEXIST")) {
336
+ logger2.debug(
337
+ `Directory creation note: ${error.message}`,
338
+ "shell-config"
339
+ );
340
+ }
341
+ }
342
+ writeFileSync(configFile, content, "utf-8");
343
+ try {
344
+ chmodSync(configFile, 384);
345
+ } catch (error) {
346
+ const errorMessage = error instanceof Error ? error.message : "Unknown error";
347
+ logger2.collectWarning(
348
+ `Could not set restrictive permissions on ${configFile}: ${errorMessage}`,
349
+ "shell-config"
350
+ );
351
+ }
352
+ return {
353
+ success: true,
354
+ shellFile: configFile,
355
+ message: `Configuration ${action === "created" ? "saved to" : "updated in"} ${configFile}`,
356
+ action
357
+ };
358
+ } catch (error) {
359
+ return {
360
+ success: false,
361
+ shellFile: configFile,
362
+ message: `Failed to update ${configFile}: ${error instanceof Error ? error.message : String(error)}`,
363
+ action: "failed"
364
+ };
365
+ }
366
+ }
367
+ function saveConfigToShell(config) {
368
+ const { configFile } = detectShellConfigFile();
369
+ const exports$1 = generateEnvExports(config);
370
+ return updateShellConfig(configFile, exports$1);
371
+ }
372
+ function getManualInstructions(config) {
373
+ const { configFile } = detectShellConfigFile();
374
+ const exports$1 = generateEnvExports(config);
375
+ const instructions = [
376
+ `Add this to your ${configFile}:`,
377
+ "",
378
+ ...exports$1.map((line) => ` ${line}`),
379
+ "",
380
+ "# Uncomment to enable periodic reminders:",
381
+ "# hyntx --check-reminder 2>/dev/null",
382
+ "",
383
+ `Then reload your shell:`,
384
+ ` source ${configFile}`
385
+ ];
386
+ return instructions.join("\n");
387
+ }
388
+
389
+ export { detectShellConfigFile, findMarkerPositions, generateEnvExports, getManualInstructions, logger, logger2, removeMalformedMarkers, saveConfigToShell, updateShellConfig };
package/dist/cli.d.ts CHANGED
@@ -1,4 +1,212 @@
1
- import { P as PatternSeverity, A as AnalysisResult, E as ExtractedPrompt, R as RulesConfig, L as LogReadResult, a as AnalysisProvider, b as ProjectContext } from './index-B6r9mP1J.js';
1
+ /**
2
+ * Hyntx - TypeScript Type Definitions
3
+ *
4
+ * This module contains all shared type definitions for the Hyntx system.
5
+ * All types are designed to be composable and type-safe.
6
+ */
7
+
8
+ /**
9
+ * Data extracted from Claude Code messages.
10
+ * Contains the sanitized prompt and metadata.
11
+ */
12
+ type ExtractedPrompt = {
13
+ readonly content: string;
14
+ readonly timestamp: string;
15
+ readonly sessionId: string;
16
+ readonly project: string;
17
+ readonly date: string;
18
+ };
19
+ /**
20
+ * Result of reading logs from the filesystem.
21
+ */
22
+ type LogReadResult = {
23
+ readonly prompts: readonly ExtractedPrompt[];
24
+ readonly warnings: readonly string[];
25
+ };
26
+ /**
27
+ * Before/after rewrite example for a pattern.
28
+ * Shows concrete improvement for a detected issue.
29
+ */
30
+ type BeforeAfter = {
31
+ readonly before: string;
32
+ readonly after: string;
33
+ };
34
+ /**
35
+ * Severity levels for detected patterns.
36
+ */
37
+ type PatternSeverity = 'low' | 'medium' | 'high';
38
+ /**
39
+ * Detected improvement pattern from analysis.
40
+ * Each pattern includes concrete examples and actionable suggestions.
41
+ */
42
+ type AnalysisPattern = {
43
+ readonly id: string;
44
+ readonly name: string;
45
+ readonly frequency: number;
46
+ readonly severity: PatternSeverity;
47
+ readonly examples: readonly string[];
48
+ readonly suggestion: string;
49
+ readonly beforeAfter: BeforeAfter;
50
+ };
51
+ /**
52
+ * Statistics from the analysis.
53
+ */
54
+ type AnalysisStats = {
55
+ readonly totalPrompts: number;
56
+ readonly promptsWithIssues: number;
57
+ readonly overallScore: number;
58
+ };
59
+ /**
60
+ * Complete analysis result from a provider.
61
+ * Contains patterns, statistics, and top suggestion.
62
+ */
63
+ type AnalysisResult = {
64
+ readonly date: string;
65
+ readonly patterns: readonly AnalysisPattern[];
66
+ readonly stats: AnalysisStats;
67
+ readonly topSuggestion: string;
68
+ };
69
+ /**
70
+ * Context limits for each provider.
71
+ * Used for intelligent batching of prompts.
72
+ */
73
+ type ProviderLimits = {
74
+ readonly maxTokensPerBatch: number;
75
+ readonly maxPromptsPerBatch?: number;
76
+ readonly prioritization: 'longest-first' | 'chronological';
77
+ };
78
+ /**
79
+ * Configuration for a single analysis rule.
80
+ * Allows enabling/disabling rules and overriding their severity.
81
+ */
82
+ type RuleConfig = {
83
+ readonly enabled?: boolean;
84
+ readonly severity?: PatternSeverity;
85
+ };
86
+ /**
87
+ * Configuration for all analysis rules.
88
+ * Maps rule IDs to their configuration.
89
+ */
90
+ type RulesConfig = Record<string, RuleConfig>;
91
+ /**
92
+ * Project-specific context information.
93
+ * Loaded from .hyntxrc.json files to provide additional context during analysis.
94
+ */
95
+ type ProjectContext = {
96
+ readonly role?: string;
97
+ readonly techStack?: readonly string[];
98
+ readonly domain?: string;
99
+ readonly guidelines?: readonly string[];
100
+ readonly projectType?: string;
101
+ };
102
+ /**
103
+ * Interface for AI analysis providers.
104
+ * All providers must implement this interface.
105
+ */
106
+ type AnalysisProvider = {
107
+ readonly name: string;
108
+ isAvailable(): Promise<boolean>;
109
+ analyze(prompts: readonly string[], date: string, context?: ProjectContext): Promise<AnalysisResult>;
110
+ getBatchLimits?(): ProviderLimits;
111
+ };
112
+ /**
113
+ * Descriptive statistics for a dataset.
114
+ * Provides comprehensive statistical measures beyond simple averages.
115
+ */
116
+ type DescriptiveStats = {
117
+ readonly count: number;
118
+ readonly mean: number;
119
+ readonly median: number;
120
+ readonly stdDev: number;
121
+ readonly variance: number;
122
+ readonly min: number;
123
+ readonly max: number;
124
+ readonly range: number;
125
+ readonly percentiles: {
126
+ readonly p25: number;
127
+ readonly p50: number;
128
+ readonly p75: number;
129
+ readonly p90: number;
130
+ readonly p95: number;
131
+ };
132
+ readonly skewness: number;
133
+ readonly kurtosis: number;
134
+ };
135
+ /**
136
+ * A single cluster from clustering analysis.
137
+ */
138
+ type Cluster = {
139
+ readonly id: number;
140
+ readonly indices: readonly number[];
141
+ readonly size: number;
142
+ };
143
+ /**
144
+ * A labeled cluster with interpretation.
145
+ */
146
+ type LabeledCluster = Cluster & {
147
+ readonly label: string;
148
+ readonly keywords: readonly string[];
149
+ readonly representativePrompt: string;
150
+ readonly dominantIssue?: string;
151
+ };
152
+ /**
153
+ * Complete cluster analysis with labeled clusters.
154
+ */
155
+ type ClusterAnalysis = {
156
+ readonly clusters: readonly LabeledCluster[];
157
+ readonly metrics: {
158
+ readonly silhouetteScore: number;
159
+ readonly inertia: number;
160
+ readonly optimalK: number;
161
+ };
162
+ readonly summary: {
163
+ readonly totalPrompts: number;
164
+ readonly avgClusterSize: number;
165
+ readonly largestCluster: number;
166
+ readonly smallestCluster: number;
167
+ };
168
+ };
169
+ /**
170
+ * Result of trend analysis using linear regression.
171
+ */
172
+ type TrendAnalysis = {
173
+ readonly slope: number;
174
+ readonly intercept: number;
175
+ readonly rSquared: number;
176
+ readonly direction: 'improving' | 'stable' | 'declining';
177
+ readonly confidence: 'high' | 'medium' | 'low';
178
+ readonly projectedScore: (days: number) => number;
179
+ };
180
+ /**
181
+ * Enhanced statistics extending the basic AnalysisStats.
182
+ * Backward compatible - all enhanced fields are optional.
183
+ */
184
+ type EnhancedAnalysisStats = AnalysisStats & {
185
+ readonly descriptive?: DescriptiveStats;
186
+ readonly specificity?: {
187
+ readonly mean: number;
188
+ readonly distribution: readonly number[];
189
+ };
190
+ readonly lexical?: {
191
+ readonly avgComplexity: number;
192
+ readonly avgWordCount: number;
193
+ };
194
+ readonly timing?: {
195
+ readonly analysisStarted: number;
196
+ readonly analysisCompleted: number;
197
+ readonly durationMs: number;
198
+ readonly tokensProcessed: number;
199
+ };
200
+ };
201
+ /**
202
+ * Enhanced analysis result with optional data science features.
203
+ * Backward compatible - all enhanced fields are optional.
204
+ */
205
+ type EnhancedAnalysisResult = AnalysisResult & {
206
+ readonly enhancedStats?: EnhancedAnalysisStats;
207
+ readonly clusters?: ClusterAnalysis;
208
+ readonly trend?: TrendAnalysis;
209
+ };
2
210
 
3
211
  /**
4
212
  * Terminal reporter for analysis results.
@@ -57,6 +265,11 @@ type ParsedArgs = {
57
265
  readonly noCache: boolean;
58
266
  readonly mcpServer: boolean;
59
267
  readonly listRules: boolean;
268
+ readonly analysisMode: 'batch' | 'individual';
269
+ readonly detailedStats: boolean;
270
+ readonly showClusters: boolean;
271
+ readonly trendAnalysis: boolean;
272
+ readonly noEmbeddings: boolean;
60
273
  };
61
274
  /**
62
275
  * Parses command-line arguments.
@@ -162,9 +375,10 @@ declare function readLogsWithSpinner(args: ParsedArgs, isJsonMode: boolean): Pro
162
375
  * from the configured services list, with fallback support.
163
376
  *
164
377
  * @param isJsonMode - Whether JSON output mode is active
378
+ * @param analysisMode - Optional analysis mode override ('batch' or 'individual')
165
379
  * @returns Available provider instance
166
380
  */
167
- declare function connectProviderWithSpinner(isJsonMode: boolean): Promise<AnalysisProvider>;
381
+ declare function connectProviderWithSpinner(isJsonMode: boolean, analysisMode?: 'batch' | 'individual'): Promise<AnalysisProvider>;
168
382
  /**
169
383
  * Analyzes prompts with progress tracking.
170
384
  *
@@ -195,11 +409,12 @@ declare function runWatchMode(provider: AnalysisProvider, args: ParsedArgs, cont
195
409
  /**
196
410
  * Displays analysis results.
197
411
  *
198
- * @param result - Analysis result
412
+ * @param result - Analysis result (can be enhanced)
199
413
  * @param format - Output format
200
414
  * @param compact - Whether to use compact JSON (only relevant for JSON format)
415
+ * @param args - Parsed arguments to determine if enhanced features are enabled
201
416
  */
202
- declare function displayResults(result: AnalysisResult, format: 'terminal' | 'json', compact: boolean): void;
417
+ declare function displayResults(result: AnalysisResult | EnhancedAnalysisResult, format: 'terminal' | 'json', compact: boolean, args?: ParsedArgs): void;
203
418
  /**
204
419
  * Handles errors and exits with appropriate code.
205
420
  *