hyntx 1.0.0 → 1.1.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.
- package/dist/index.d.ts +39 -8
- package/dist/index.js +1130 -214
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
package/dist/index.d.ts
CHANGED
|
@@ -41,6 +41,17 @@ type AnalysisResult = {
|
|
|
41
41
|
readonly stats: AnalysisStats;
|
|
42
42
|
readonly topSuggestion: string;
|
|
43
43
|
};
|
|
44
|
+
/**
|
|
45
|
+
* Project-specific context information.
|
|
46
|
+
* Loaded from .hyntxrc.json files to provide additional context during analysis.
|
|
47
|
+
*/
|
|
48
|
+
type ProjectContext = {
|
|
49
|
+
readonly role?: string;
|
|
50
|
+
readonly techStack?: readonly string[];
|
|
51
|
+
readonly domain?: string;
|
|
52
|
+
readonly guidelines?: readonly string[];
|
|
53
|
+
readonly projectType?: string;
|
|
54
|
+
};
|
|
44
55
|
/**
|
|
45
56
|
* Interface for AI analysis providers.
|
|
46
57
|
* All providers must implement this interface.
|
|
@@ -48,7 +59,7 @@ type AnalysisResult = {
|
|
|
48
59
|
type AnalysisProvider = {
|
|
49
60
|
readonly name: string;
|
|
50
61
|
isAvailable(): Promise<boolean>;
|
|
51
|
-
analyze(prompts: readonly string[], date: string): Promise<AnalysisResult>;
|
|
62
|
+
analyze(prompts: readonly string[], date: string, context?: ProjectContext): Promise<AnalysisResult>;
|
|
52
63
|
};
|
|
53
64
|
|
|
54
65
|
/**
|
|
@@ -65,6 +76,10 @@ type ParsedArgs = {
|
|
|
65
76
|
readonly date: string;
|
|
66
77
|
readonly help: boolean;
|
|
67
78
|
readonly version: boolean;
|
|
79
|
+
readonly verbose: boolean;
|
|
80
|
+
readonly checkConfig: boolean;
|
|
81
|
+
readonly format?: 'terminal' | 'json';
|
|
82
|
+
readonly compact?: boolean;
|
|
68
83
|
};
|
|
69
84
|
/**
|
|
70
85
|
* Parses command-line arguments.
|
|
@@ -81,50 +96,66 @@ declare function showHelp(): void;
|
|
|
81
96
|
* Displays version information and exits.
|
|
82
97
|
*/
|
|
83
98
|
declare function showVersion(): void;
|
|
99
|
+
/**
|
|
100
|
+
* Runs configuration health check and exits.
|
|
101
|
+
*
|
|
102
|
+
* Validates all configured providers and tests their connectivity.
|
|
103
|
+
* Exits with 0 if all providers are valid, 1 if any issues found.
|
|
104
|
+
*/
|
|
105
|
+
declare function runConfigCheck(): Promise<void>;
|
|
84
106
|
/**
|
|
85
107
|
* Checks if this is the first run and runs setup if needed.
|
|
108
|
+
*
|
|
109
|
+
* @param isJsonMode - Whether JSON output mode is active
|
|
86
110
|
*/
|
|
87
|
-
declare function checkAndRunSetup(): Promise<void>;
|
|
111
|
+
declare function checkAndRunSetup(isJsonMode: boolean): Promise<void>;
|
|
88
112
|
/**
|
|
89
113
|
* Reads logs for the specified date with a spinner.
|
|
90
114
|
*
|
|
91
115
|
* @param date - Date to read logs for
|
|
116
|
+
* @param isJsonMode - Whether JSON output mode is active
|
|
92
117
|
* @returns Array of prompt strings
|
|
93
118
|
*/
|
|
94
|
-
declare function readLogsWithSpinner(date: string): Promise<readonly string[]>;
|
|
119
|
+
declare function readLogsWithSpinner(date: string, isJsonMode: boolean): Promise<readonly string[]>;
|
|
95
120
|
/**
|
|
96
121
|
* Connects to an available provider with automatic fallback.
|
|
97
122
|
*
|
|
98
123
|
* Uses the multi-provider factory to get the first available provider
|
|
99
124
|
* from the configured services list, with fallback support.
|
|
100
125
|
*
|
|
126
|
+
* @param isJsonMode - Whether JSON output mode is active
|
|
101
127
|
* @returns Available provider instance
|
|
102
128
|
*/
|
|
103
|
-
declare function connectProviderWithSpinner(): Promise<AnalysisProvider>;
|
|
129
|
+
declare function connectProviderWithSpinner(isJsonMode: boolean): Promise<AnalysisProvider>;
|
|
104
130
|
/**
|
|
105
131
|
* Analyzes prompts with progress tracking.
|
|
106
132
|
*
|
|
107
133
|
* @param provider - Analysis provider
|
|
108
134
|
* @param prompts - Array of prompt strings
|
|
109
135
|
* @param date - Date context
|
|
136
|
+
* @param context - Optional project context
|
|
137
|
+
* @param isJsonMode - Whether JSON output mode is active
|
|
110
138
|
* @returns Analysis result
|
|
111
139
|
*/
|
|
112
|
-
declare function analyzeWithProgress(provider: AnalysisProvider, prompts: readonly string[], date: string): Promise<AnalysisResult>;
|
|
140
|
+
declare function analyzeWithProgress(provider: AnalysisProvider, prompts: readonly string[], date: string, context: ProjectContext | undefined, isJsonMode: boolean): Promise<AnalysisResult>;
|
|
113
141
|
/**
|
|
114
142
|
* Displays analysis results.
|
|
115
143
|
*
|
|
116
144
|
* @param result - Analysis result
|
|
145
|
+
* @param format - Output format
|
|
146
|
+
* @param compact - Whether to use compact JSON (only relevant for JSON format)
|
|
117
147
|
*/
|
|
118
|
-
declare function displayResults(result: AnalysisResult): void;
|
|
148
|
+
declare function displayResults(result: AnalysisResult, format: 'terminal' | 'json', compact: boolean): void;
|
|
119
149
|
/**
|
|
120
150
|
* Handles errors and exits with appropriate code.
|
|
121
151
|
*
|
|
122
152
|
* @param error - Error to handle
|
|
153
|
+
* @param isJsonMode - Whether JSON output mode is active
|
|
123
154
|
*/
|
|
124
|
-
declare function handleError(error: Error): void;
|
|
155
|
+
declare function handleError(error: Error, isJsonMode: boolean): void;
|
|
125
156
|
/**
|
|
126
157
|
* Main entry point for the CLI.
|
|
127
158
|
*/
|
|
128
159
|
declare function main(): Promise<void>;
|
|
129
160
|
|
|
130
|
-
export { analyzeWithProgress, checkAndRunSetup, connectProviderWithSpinner, displayResults, handleError, main, parseArguments, readLogsWithSpinner, showHelp, showVersion };
|
|
161
|
+
export { analyzeWithProgress, checkAndRunSetup, connectProviderWithSpinner, displayResults, handleError, main, parseArguments, readLogsWithSpinner, runConfigCheck, showHelp, showVersion };
|