hyntx 1.0.0 → 1.2.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/README.md +5 -8
- package/dist/index.d.ts +118 -11
- package/dist/index.js +2417 -425
- package/package.json +16 -8
- package/dist/index.js.map +0 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
[](LICENSE)
|
|
7
7
|
[](https://nodejs.org/)
|
|
8
8
|
|
|
9
|
-
>
|
|
9
|
+
> 🚧 **NOT READY FOR USE**: This project is under active development. The published npm package does not produce output yet. Check back for updates.
|
|
10
10
|
|
|
11
11
|
## What is Hyntx?
|
|
12
12
|
|
|
@@ -34,8 +34,6 @@ Think of it as a **retrospective code review for your prompts**.
|
|
|
34
34
|
|
|
35
35
|
## Installation
|
|
36
36
|
|
|
37
|
-
> **Note**: Hyntx is not yet ready for use. The installation instructions below are for reference only. See [ROADMAP.md](ROADMAP.md) for development status.
|
|
38
|
-
|
|
39
37
|
### NPM (Global)
|
|
40
38
|
|
|
41
39
|
```bash
|
|
@@ -349,7 +347,7 @@ Make sure you've used Claude Code at least once. Logs are stored in:
|
|
|
349
347
|
|
|
350
348
|
```bash
|
|
351
349
|
# Clone the repository
|
|
352
|
-
git clone https://github.com/
|
|
350
|
+
git clone https://github.com/jmlweb/hyntx.git
|
|
353
351
|
cd hyntx
|
|
354
352
|
|
|
355
353
|
# Install dependencies
|
|
@@ -409,7 +407,7 @@ Contributions are welcome! Please:
|
|
|
409
407
|
|
|
410
408
|
## Roadmap
|
|
411
409
|
|
|
412
|
-
For detailed development roadmap, planned features, and implementation status, see [ROADMAP.md](ROADMAP.md).
|
|
410
|
+
For detailed development roadmap, planned features, and implementation status, see [docs/ROADMAP.md](docs/ROADMAP.md).
|
|
413
411
|
|
|
414
412
|
## License
|
|
415
413
|
|
|
@@ -423,9 +421,8 @@ MIT License - see [LICENSE](LICENSE) file for details.
|
|
|
423
421
|
|
|
424
422
|
## Support
|
|
425
423
|
|
|
426
|
-
- **Issues**: [GitHub Issues](https://github.com/
|
|
427
|
-
- **Discussions**: [GitHub Discussions](https://github.com/
|
|
428
|
-
- **Email**: your-email@example.com
|
|
424
|
+
- **Issues**: [GitHub Issues](https://github.com/jmlweb/hyntx/issues)
|
|
425
|
+
- **Discussions**: [GitHub Discussions](https://github.com/jmlweb/hyntx/discussions)
|
|
429
426
|
|
|
430
427
|
---
|
|
431
428
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Data extracted from Claude Code messages.
|
|
3
|
+
* Contains the sanitized prompt and metadata.
|
|
4
|
+
*/
|
|
5
|
+
type ExtractedPrompt = {
|
|
6
|
+
readonly content: string;
|
|
7
|
+
readonly timestamp: string;
|
|
8
|
+
readonly sessionId: string;
|
|
9
|
+
readonly project: string;
|
|
10
|
+
readonly date: string;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Result of reading logs from the filesystem.
|
|
14
|
+
*/
|
|
15
|
+
type LogReadResult = {
|
|
16
|
+
readonly prompts: readonly ExtractedPrompt[];
|
|
17
|
+
readonly warnings: readonly string[];
|
|
18
|
+
};
|
|
1
19
|
/**
|
|
2
20
|
* Before/after rewrite example for a pattern.
|
|
3
21
|
* Shows concrete improvement for a detected issue.
|
|
@@ -41,6 +59,17 @@ type AnalysisResult = {
|
|
|
41
59
|
readonly stats: AnalysisStats;
|
|
42
60
|
readonly topSuggestion: string;
|
|
43
61
|
};
|
|
62
|
+
/**
|
|
63
|
+
* Project-specific context information.
|
|
64
|
+
* Loaded from .hyntxrc.json files to provide additional context during analysis.
|
|
65
|
+
*/
|
|
66
|
+
type ProjectContext = {
|
|
67
|
+
readonly role?: string;
|
|
68
|
+
readonly techStack?: readonly string[];
|
|
69
|
+
readonly domain?: string;
|
|
70
|
+
readonly guidelines?: readonly string[];
|
|
71
|
+
readonly projectType?: string;
|
|
72
|
+
};
|
|
44
73
|
/**
|
|
45
74
|
* Interface for AI analysis providers.
|
|
46
75
|
* All providers must implement this interface.
|
|
@@ -48,7 +77,7 @@ type AnalysisResult = {
|
|
|
48
77
|
type AnalysisProvider = {
|
|
49
78
|
readonly name: string;
|
|
50
79
|
isAvailable(): Promise<boolean>;
|
|
51
|
-
analyze(prompts: readonly string[], date: string): Promise<AnalysisResult>;
|
|
80
|
+
analyze(prompts: readonly string[], date: string, context?: ProjectContext): Promise<AnalysisResult>;
|
|
52
81
|
};
|
|
53
82
|
|
|
54
83
|
/**
|
|
@@ -63,8 +92,24 @@ type AnalysisProvider = {
|
|
|
63
92
|
*/
|
|
64
93
|
type ParsedArgs = {
|
|
65
94
|
readonly date: string;
|
|
95
|
+
readonly from?: string;
|
|
96
|
+
readonly to?: string;
|
|
97
|
+
readonly project?: string;
|
|
98
|
+
readonly output?: string;
|
|
99
|
+
readonly dryRun: boolean;
|
|
100
|
+
readonly checkReminder: boolean;
|
|
66
101
|
readonly help: boolean;
|
|
67
102
|
readonly version: boolean;
|
|
103
|
+
readonly verbose: boolean;
|
|
104
|
+
readonly checkConfig: boolean;
|
|
105
|
+
readonly format: 'terminal' | 'json';
|
|
106
|
+
readonly compact: boolean;
|
|
107
|
+
readonly compareWith?: string;
|
|
108
|
+
readonly compareWeek: boolean;
|
|
109
|
+
readonly compareMonth: boolean;
|
|
110
|
+
readonly history: boolean;
|
|
111
|
+
readonly historySummary: boolean;
|
|
112
|
+
readonly noHistory: boolean;
|
|
68
113
|
};
|
|
69
114
|
/**
|
|
70
115
|
* Parses command-line arguments.
|
|
@@ -73,6 +118,52 @@ type ParsedArgs = {
|
|
|
73
118
|
* @throws Error if arguments are invalid
|
|
74
119
|
*/
|
|
75
120
|
declare function parseArguments(): ParsedArgs;
|
|
121
|
+
/**
|
|
122
|
+
* Validates parsed arguments for logical conflicts and requirements.
|
|
123
|
+
*
|
|
124
|
+
* @param args - Parsed arguments to validate
|
|
125
|
+
* @throws Error if arguments are invalid or conflicting
|
|
126
|
+
*/
|
|
127
|
+
declare function validateArguments(args: ParsedArgs): void;
|
|
128
|
+
/**
|
|
129
|
+
* Gets the output file path for a given date.
|
|
130
|
+
* For multi-day scenarios, appends the date to the filename.
|
|
131
|
+
*
|
|
132
|
+
* @param basePath - Base output path from args
|
|
133
|
+
* @param date - Date string (YYYY-MM-DD) or undefined for single-day
|
|
134
|
+
* @returns Adjusted output file path
|
|
135
|
+
*/
|
|
136
|
+
declare function getOutputFilePath(basePath: string, date?: string): string;
|
|
137
|
+
/**
|
|
138
|
+
* Writes a single analysis result to a file.
|
|
139
|
+
*
|
|
140
|
+
* @param filePath - File path to write to
|
|
141
|
+
* @param result - Analysis result
|
|
142
|
+
* @param format - Output format ('md' or 'json')
|
|
143
|
+
* @param compact - Whether to use compact JSON (only for json format)
|
|
144
|
+
* @throws Error if write fails
|
|
145
|
+
*/
|
|
146
|
+
declare function writeOutputFile(filePath: string, result: AnalysisResult, format: 'md' | 'json', compact: boolean): Promise<void>;
|
|
147
|
+
/**
|
|
148
|
+
* Writes multi-day results to a JSON array file.
|
|
149
|
+
*
|
|
150
|
+
* @param filePath - File path to write to
|
|
151
|
+
* @param results - Array of analysis results
|
|
152
|
+
* @param compact - Whether to use compact JSON
|
|
153
|
+
* @throws Error if write fails
|
|
154
|
+
*/
|
|
155
|
+
declare function writeMultiDayJsonOutput(filePath: string, results: readonly AnalysisResult[], compact: boolean): Promise<void>;
|
|
156
|
+
/**
|
|
157
|
+
* Displays a dry-run summary without performing analysis.
|
|
158
|
+
*
|
|
159
|
+
* @param prompts - Array of extracted prompts
|
|
160
|
+
* @param args - Parsed arguments
|
|
161
|
+
*/
|
|
162
|
+
declare function displayDryRunSummary(prompts: readonly ExtractedPrompt[], args: ParsedArgs): void;
|
|
163
|
+
/**
|
|
164
|
+
* Displays reminder status and exits.
|
|
165
|
+
*/
|
|
166
|
+
declare function showReminderStatus(): void;
|
|
76
167
|
/**
|
|
77
168
|
* Displays help message and exits.
|
|
78
169
|
*/
|
|
@@ -81,50 +172,66 @@ declare function showHelp(): void;
|
|
|
81
172
|
* Displays version information and exits.
|
|
82
173
|
*/
|
|
83
174
|
declare function showVersion(): void;
|
|
175
|
+
/**
|
|
176
|
+
* Runs configuration health check and exits.
|
|
177
|
+
*
|
|
178
|
+
* Validates all configured providers and tests their connectivity.
|
|
179
|
+
* Exits with 0 if all providers are valid, 1 if any issues found.
|
|
180
|
+
*/
|
|
181
|
+
declare function runConfigCheck(): Promise<void>;
|
|
84
182
|
/**
|
|
85
183
|
* Checks if this is the first run and runs setup if needed.
|
|
184
|
+
*
|
|
185
|
+
* @param isJsonMode - Whether JSON output mode is active
|
|
86
186
|
*/
|
|
87
|
-
declare function checkAndRunSetup(): Promise<void>;
|
|
187
|
+
declare function checkAndRunSetup(isJsonMode: boolean): Promise<void>;
|
|
88
188
|
/**
|
|
89
|
-
* Reads logs
|
|
189
|
+
* Reads logs with filters from parsed arguments.
|
|
90
190
|
*
|
|
91
|
-
* @param
|
|
92
|
-
* @
|
|
191
|
+
* @param args - Parsed command-line arguments
|
|
192
|
+
* @param isJsonMode - Whether JSON output mode is active
|
|
193
|
+
* @returns Log read result with prompts and warnings
|
|
93
194
|
*/
|
|
94
|
-
declare function readLogsWithSpinner(
|
|
195
|
+
declare function readLogsWithSpinner(args: ParsedArgs, isJsonMode: boolean): Promise<LogReadResult>;
|
|
95
196
|
/**
|
|
96
197
|
* Connects to an available provider with automatic fallback.
|
|
97
198
|
*
|
|
98
199
|
* Uses the multi-provider factory to get the first available provider
|
|
99
200
|
* from the configured services list, with fallback support.
|
|
100
201
|
*
|
|
202
|
+
* @param isJsonMode - Whether JSON output mode is active
|
|
101
203
|
* @returns Available provider instance
|
|
102
204
|
*/
|
|
103
|
-
declare function connectProviderWithSpinner(): Promise<AnalysisProvider>;
|
|
205
|
+
declare function connectProviderWithSpinner(isJsonMode: boolean): Promise<AnalysisProvider>;
|
|
104
206
|
/**
|
|
105
207
|
* Analyzes prompts with progress tracking.
|
|
106
208
|
*
|
|
107
209
|
* @param provider - Analysis provider
|
|
108
210
|
* @param prompts - Array of prompt strings
|
|
109
211
|
* @param date - Date context
|
|
212
|
+
* @param context - Optional project context
|
|
213
|
+
* @param isJsonMode - Whether JSON output mode is active
|
|
110
214
|
* @returns Analysis result
|
|
111
215
|
*/
|
|
112
|
-
declare function analyzeWithProgress(provider: AnalysisProvider, prompts: readonly string[], date: string): Promise<AnalysisResult>;
|
|
216
|
+
declare function analyzeWithProgress(provider: AnalysisProvider, prompts: readonly string[], date: string, context: ProjectContext | undefined, isJsonMode: boolean): Promise<AnalysisResult>;
|
|
113
217
|
/**
|
|
114
218
|
* Displays analysis results.
|
|
115
219
|
*
|
|
116
220
|
* @param result - Analysis result
|
|
221
|
+
* @param format - Output format
|
|
222
|
+
* @param compact - Whether to use compact JSON (only relevant for JSON format)
|
|
117
223
|
*/
|
|
118
|
-
declare function displayResults(result: AnalysisResult): void;
|
|
224
|
+
declare function displayResults(result: AnalysisResult, format: 'terminal' | 'json', compact: boolean): void;
|
|
119
225
|
/**
|
|
120
226
|
* Handles errors and exits with appropriate code.
|
|
121
227
|
*
|
|
122
228
|
* @param error - Error to handle
|
|
229
|
+
* @param isJsonMode - Whether JSON output mode is active
|
|
123
230
|
*/
|
|
124
|
-
declare function handleError(error: Error): void;
|
|
231
|
+
declare function handleError(error: Error, isJsonMode: boolean): void;
|
|
125
232
|
/**
|
|
126
233
|
* Main entry point for the CLI.
|
|
127
234
|
*/
|
|
128
235
|
declare function main(): Promise<void>;
|
|
129
236
|
|
|
130
|
-
export { analyzeWithProgress, checkAndRunSetup, connectProviderWithSpinner, displayResults, handleError, main, parseArguments, readLogsWithSpinner, showHelp, showVersion };
|
|
237
|
+
export { analyzeWithProgress, checkAndRunSetup, connectProviderWithSpinner, displayDryRunSummary, displayResults, getOutputFilePath, handleError, main, parseArguments, readLogsWithSpinner, runConfigCheck, showHelp, showReminderStatus, showVersion, validateArguments, writeMultiDayJsonOutput, writeOutputFile };
|