hyntx 0.0.1 → 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/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/hyntx.svg)](https://www.npmjs.com/package/hyntx)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
7
- [![Node.js](https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen.svg)](https://nodejs.org/)
7
+ [![Node.js](https://img.shields.io/badge/node-%3E%3D22.0.0-brightgreen.svg)](https://nodejs.org/)
8
8
 
9
9
  > **🚧 NOT READY FOR USE**: Hyntx is currently **under active development** and **not yet ready for production use**. The tool is not functional at this time. This README describes the planned features and functionality. For the current development status, implementation progress, and what's actually working, please see the [ROADMAP.md](ROADMAP.md).
10
10
 
@@ -317,7 +317,7 @@ Hyntx takes your privacy seriously:
317
317
 
318
318
  ## Requirements
319
319
 
320
- - **Node.js**: 18.0.0 or higher
320
+ - **Node.js**: 22.0.0 or higher
321
321
  - **Claude Code**: Must have Claude Code installed and used
322
322
  - **AI Provider**: Ollama (local) or Anthropic/Google API key
323
323
 
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,58 +59,9 @@ 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>;
52
- };
53
- /**
54
- * Ollama provider configuration.
55
- */
56
- type OllamaConfig = {
57
- readonly model: string;
58
- readonly host: string;
62
+ analyze(prompts: readonly string[], date: string, context?: ProjectContext): Promise<AnalysisResult>;
59
63
  };
60
64
 
61
- /**
62
- * Ollama AI provider implementation.
63
- *
64
- * This module provides integration with local Ollama instances for prompt analysis.
65
- * Features include:
66
- * - Availability checking with timeout and model verification
67
- * - Retry logic with exponential backoff for network errors
68
- * - Support for both raw JSON and markdown-wrapped responses
69
- */
70
-
71
- /**
72
- * Ollama provider for local AI analysis.
73
- * Implements the AnalysisProvider interface for Ollama instances.
74
- */
75
- declare class OllamaProvider implements AnalysisProvider {
76
- readonly name = "Ollama";
77
- private readonly config;
78
- /**
79
- * Creates a new OllamaProvider instance.
80
- *
81
- * @param config - Ollama configuration with model and host
82
- */
83
- constructor(config: OllamaConfig);
84
- /**
85
- * Checks if the Ollama service is available and has the required model.
86
- * Uses a 3-second timeout to avoid hanging on unreachable services.
87
- *
88
- * @returns Promise that resolves to true if available, false otherwise
89
- */
90
- isAvailable(): Promise<boolean>;
91
- /**
92
- * Analyzes prompts using the Ollama service.
93
- * Implements retry logic with exponential backoff for network errors.
94
- *
95
- * @param prompts - Array of prompt strings to analyze
96
- * @param date - Date context for the analysis
97
- * @returns Promise resolving to AnalysisResult
98
- * @throws Error if analysis fails after retries or if response is invalid
99
- */
100
- analyze(prompts: readonly string[], date: string): Promise<AnalysisResult>;
101
- }
102
-
103
65
  /**
104
66
  * Hyntx - CLI Entry Point
105
67
  *
@@ -114,6 +76,10 @@ type ParsedArgs = {
114
76
  readonly date: string;
115
77
  readonly help: boolean;
116
78
  readonly version: boolean;
79
+ readonly verbose: boolean;
80
+ readonly checkConfig: boolean;
81
+ readonly format?: 'terminal' | 'json';
82
+ readonly compact?: boolean;
117
83
  };
118
84
  /**
119
85
  * Parses command-line arguments.
@@ -130,47 +96,66 @@ declare function showHelp(): void;
130
96
  * Displays version information and exits.
131
97
  */
132
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>;
133
106
  /**
134
107
  * Checks if this is the first run and runs setup if needed.
108
+ *
109
+ * @param isJsonMode - Whether JSON output mode is active
135
110
  */
136
- declare function checkAndRunSetup(): Promise<void>;
111
+ declare function checkAndRunSetup(isJsonMode: boolean): Promise<void>;
137
112
  /**
138
113
  * Reads logs for the specified date with a spinner.
139
114
  *
140
115
  * @param date - Date to read logs for
116
+ * @param isJsonMode - Whether JSON output mode is active
141
117
  * @returns Array of prompt strings
142
118
  */
143
- declare function readLogsWithSpinner(date: string): Promise<readonly string[]>;
119
+ declare function readLogsWithSpinner(date: string, isJsonMode: boolean): Promise<readonly string[]>;
144
120
  /**
145
- * Connects to the Ollama provider with availability check.
121
+ * Connects to an available provider with automatic fallback.
122
+ *
123
+ * Uses the multi-provider factory to get the first available provider
124
+ * from the configured services list, with fallback support.
146
125
  *
147
- * @returns OllamaProvider instance
126
+ * @param isJsonMode - Whether JSON output mode is active
127
+ * @returns Available provider instance
148
128
  */
149
- declare function connectProviderWithSpinner(): Promise<OllamaProvider>;
129
+ declare function connectProviderWithSpinner(isJsonMode: boolean): Promise<AnalysisProvider>;
150
130
  /**
151
131
  * Analyzes prompts with progress tracking.
152
132
  *
153
133
  * @param provider - Analysis provider
154
134
  * @param prompts - Array of prompt strings
155
135
  * @param date - Date context
136
+ * @param context - Optional project context
137
+ * @param isJsonMode - Whether JSON output mode is active
156
138
  * @returns Analysis result
157
139
  */
158
- declare function analyzeWithProgress(provider: OllamaProvider, 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>;
159
141
  /**
160
142
  * Displays analysis results.
161
143
  *
162
144
  * @param result - Analysis result
145
+ * @param format - Output format
146
+ * @param compact - Whether to use compact JSON (only relevant for JSON format)
163
147
  */
164
- declare function displayResults(result: AnalysisResult): void;
148
+ declare function displayResults(result: AnalysisResult, format: 'terminal' | 'json', compact: boolean): void;
165
149
  /**
166
150
  * Handles errors and exits with appropriate code.
167
151
  *
168
152
  * @param error - Error to handle
153
+ * @param isJsonMode - Whether JSON output mode is active
169
154
  */
170
- declare function handleError(error: Error): void;
155
+ declare function handleError(error: Error, isJsonMode: boolean): void;
171
156
  /**
172
157
  * Main entry point for the CLI.
173
158
  */
174
159
  declare function main(): Promise<void>;
175
160
 
176
- export { analyzeWithProgress, checkAndRunSetup, connectProviderWithSpinner, displayResults, handleError, main, parseArguments, readLogsWithSpinner, showHelp, showVersion };
161
+ export { analyzeWithProgress, checkAndRunSetup, connectProviderWithSpinner, displayResults, handleError, main, parseArguments, readLogsWithSpinner, runConfigCheck, showHelp, showVersion };