nttp 1.4.9 → 1.4.11
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 +171 -297
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/errors.d.ts +99 -6
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +173 -11
- package/dist/errors.js.map +1 -1
- package/dist/executor.d.ts.map +1 -1
- package/dist/executor.js +73 -12
- package/dist/executor.js.map +1 -1
- package/dist/intent.d.ts.map +1 -1
- package/dist/intent.js +125 -17
- package/dist/intent.js.map +1 -1
- package/dist/llm.d.ts +25 -0
- package/dist/llm.d.ts.map +1 -1
- package/dist/llm.js +25 -0
- package/dist/llm.js.map +1 -1
- package/package.json +1 -1
package/dist/errors.d.ts
CHANGED
|
@@ -1,35 +1,128 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Custom error classes for NTTP application.
|
|
3
|
-
*
|
|
3
|
+
* Enhanced with Claude 4.x best practices: clear explanations and actionable suggestions.
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* Error thrown when intent parsing fails.
|
|
7
|
+
*
|
|
8
|
+
* This error occurs when the LLM cannot understand the natural language query
|
|
9
|
+
* or cannot map it to a valid database operation.
|
|
10
|
+
*
|
|
11
|
+
* Common causes:
|
|
12
|
+
* - Query references unknown tables or fields
|
|
13
|
+
* - Query is too ambiguous or vague
|
|
14
|
+
* - LLM API is unavailable or quota exceeded
|
|
15
|
+
*
|
|
16
|
+
* Suggested fixes:
|
|
17
|
+
* - Simplify your query (e.g., "show users" instead of complex phrasing)
|
|
18
|
+
* - Ensure table/field names match your database schema
|
|
19
|
+
* - Check LLM API key and quota
|
|
20
|
+
* - Try a more explicit query (e.g., "list all products" instead of "products")
|
|
7
21
|
*/
|
|
8
22
|
export declare class IntentParseError extends Error {
|
|
9
|
-
|
|
23
|
+
readonly suggestions: string[];
|
|
24
|
+
constructor(message: string, suggestions?: string[]);
|
|
25
|
+
private static formatMessage;
|
|
26
|
+
private static getDefaultSuggestions;
|
|
10
27
|
}
|
|
11
28
|
/**
|
|
12
29
|
* Error thrown when SQL generation fails.
|
|
30
|
+
*
|
|
31
|
+
* This error occurs when the LLM cannot generate valid SQL from the parsed intent,
|
|
32
|
+
* or when the generated SQL fails safety validation.
|
|
33
|
+
*
|
|
34
|
+
* Common causes:
|
|
35
|
+
* - Complex query requires table relationships not in schema
|
|
36
|
+
* - Generated SQL violates safety rules (e.g., attempted UPDATE/DELETE)
|
|
37
|
+
* - Schema description is incomplete or incorrect
|
|
38
|
+
* - LLM hallucinated invalid SQL syntax
|
|
39
|
+
*
|
|
40
|
+
* Suggested fixes:
|
|
41
|
+
* - Ensure your database schema is complete and accurate
|
|
42
|
+
* - Try a simpler query with fewer joins
|
|
43
|
+
* - Check that the LLM model supports structured outputs
|
|
44
|
+
* - Verify the intent was parsed correctly (use explain() method)
|
|
13
45
|
*/
|
|
14
46
|
export declare class SQLGenerationError extends Error {
|
|
15
|
-
|
|
47
|
+
readonly suggestions: string[];
|
|
48
|
+
constructor(message: string, suggestions?: string[]);
|
|
49
|
+
private static formatMessage;
|
|
50
|
+
private static getDefaultSuggestions;
|
|
16
51
|
}
|
|
17
52
|
/**
|
|
18
53
|
* Error thrown when SQL execution fails.
|
|
54
|
+
*
|
|
55
|
+
* This error occurs when the database rejects the generated SQL query.
|
|
56
|
+
*
|
|
57
|
+
* Common causes:
|
|
58
|
+
* - Database connection issues
|
|
59
|
+
* - Table or column doesn't exist (schema mismatch)
|
|
60
|
+
* - Type mismatch in WHERE clause (e.g., string vs integer)
|
|
61
|
+
* - Database permissions insufficient for SELECT
|
|
62
|
+
* - Syntax error in generated SQL
|
|
63
|
+
*
|
|
64
|
+
* Suggested fixes:
|
|
65
|
+
* - Verify database connection is active
|
|
66
|
+
* - Ensure schema matches actual database structure
|
|
67
|
+
* - Check database user has SELECT permissions
|
|
68
|
+
* - Examine the generated SQL for syntax errors
|
|
69
|
+
* - Try regenerating with forceNewSchema option
|
|
19
70
|
*/
|
|
20
71
|
export declare class SQLExecutionError extends Error {
|
|
21
|
-
|
|
72
|
+
readonly sql?: string;
|
|
73
|
+
readonly suggestions: string[];
|
|
74
|
+
constructor(message: string, sql?: string, suggestions?: string[]);
|
|
75
|
+
private static formatMessage;
|
|
76
|
+
private static getDefaultSuggestions;
|
|
22
77
|
}
|
|
23
78
|
/**
|
|
24
79
|
* Error thrown when LLM API calls fail.
|
|
80
|
+
*
|
|
81
|
+
* This error occurs when communication with the LLM provider fails.
|
|
82
|
+
*
|
|
83
|
+
* Common causes:
|
|
84
|
+
* - Invalid or expired API key
|
|
85
|
+
* - Rate limit or quota exceeded
|
|
86
|
+
* - Network connectivity issues
|
|
87
|
+
* - LLM provider service outage
|
|
88
|
+
* - Request timeout
|
|
89
|
+
*
|
|
90
|
+
* Suggested fixes:
|
|
91
|
+
* - Verify API key is correct and active
|
|
92
|
+
* - Check API quota and rate limits with provider
|
|
93
|
+
* - Ensure network connectivity to LLM provider
|
|
94
|
+
* - Wait and retry (automatic retry with backoff is already applied)
|
|
95
|
+
* - Check LLM provider status page for outages
|
|
25
96
|
*/
|
|
26
97
|
export declare class LLMError extends Error {
|
|
27
|
-
|
|
98
|
+
readonly suggestions: string[];
|
|
99
|
+
constructor(message: string, suggestions?: string[]);
|
|
100
|
+
private static formatMessage;
|
|
101
|
+
private static getDefaultSuggestions;
|
|
28
102
|
}
|
|
29
103
|
/**
|
|
30
104
|
* Error thrown when cache operations fail.
|
|
105
|
+
*
|
|
106
|
+
* This error occurs when the caching system encounters an issue.
|
|
107
|
+
*
|
|
108
|
+
* Common causes:
|
|
109
|
+
* - Redis connection failed (if using Redis L1 cache)
|
|
110
|
+
* - Redis authentication error
|
|
111
|
+
* - Network issues with Redis server
|
|
112
|
+
* - Embedding API failure (if using L2 semantic cache)
|
|
113
|
+
* - Out of memory for in-memory caches
|
|
114
|
+
*
|
|
115
|
+
* Suggested fixes:
|
|
116
|
+
* - Verify Redis server is running (if using Redis)
|
|
117
|
+
* - Check REDIS_URL format: redis://host:port
|
|
118
|
+
* - Ensure Redis authentication credentials are correct
|
|
119
|
+
* - Check OpenAI API key for embeddings (if L2 enabled)
|
|
120
|
+
* - Reduce cache size limits if memory is constrained
|
|
31
121
|
*/
|
|
32
122
|
export declare class CacheError extends Error {
|
|
33
|
-
|
|
123
|
+
readonly suggestions: string[];
|
|
124
|
+
constructor(message: string, suggestions?: string[]);
|
|
125
|
+
private static formatMessage;
|
|
126
|
+
private static getDefaultSuggestions;
|
|
34
127
|
}
|
|
35
128
|
//# sourceMappingURL=errors.d.ts.map
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,gBAAiB,SAAQ,KAAK;IACzC,SAAgB,WAAW,EAAE,MAAM,EAAE,CAAC;gBAE1B,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE;IAQnD,OAAO,CAAC,MAAM,CAAC,aAAa;IAK5B,OAAO,CAAC,MAAM,CAAC,qBAAqB;CAQrC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,kBAAmB,SAAQ,KAAK;IAC3C,SAAgB,WAAW,EAAE,MAAM,EAAE,CAAC;gBAE1B,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE;IAQnD,OAAO,CAAC,MAAM,CAAC,aAAa;IAK5B,OAAO,CAAC,MAAM,CAAC,qBAAqB;CAQrC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;IAC1C,SAAgB,GAAG,CAAC,EAAE,MAAM,CAAC;IAC7B,SAAgB,WAAW,EAAE,MAAM,EAAE,CAAC;gBAE1B,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE;IASjE,OAAO,CAAC,MAAM,CAAC,aAAa;IAU5B,OAAO,CAAC,MAAM,CAAC,qBAAqB;CASrC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,QAAS,SAAQ,KAAK;IACjC,SAAgB,WAAW,EAAE,MAAM,EAAE,CAAC;gBAE1B,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE;IAQnD,OAAO,CAAC,MAAM,CAAC,aAAa;IAK5B,OAAO,CAAC,MAAM,CAAC,qBAAqB;CASrC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,UAAW,SAAQ,KAAK;IACnC,SAAgB,WAAW,EAAE,MAAM,EAAE,CAAC;gBAE1B,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE;IAQnD,OAAO,CAAC,MAAM,CAAC,aAAa;IAK5B,OAAO,CAAC,MAAM,CAAC,qBAAqB;CASrC"}
|
package/dist/errors.js
CHANGED
|
@@ -1,55 +1,217 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Custom error classes for NTTP application.
|
|
3
|
-
*
|
|
3
|
+
* Enhanced with Claude 4.x best practices: clear explanations and actionable suggestions.
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* Error thrown when intent parsing fails.
|
|
7
|
+
*
|
|
8
|
+
* This error occurs when the LLM cannot understand the natural language query
|
|
9
|
+
* or cannot map it to a valid database operation.
|
|
10
|
+
*
|
|
11
|
+
* Common causes:
|
|
12
|
+
* - Query references unknown tables or fields
|
|
13
|
+
* - Query is too ambiguous or vague
|
|
14
|
+
* - LLM API is unavailable or quota exceeded
|
|
15
|
+
*
|
|
16
|
+
* Suggested fixes:
|
|
17
|
+
* - Simplify your query (e.g., "show users" instead of complex phrasing)
|
|
18
|
+
* - Ensure table/field names match your database schema
|
|
19
|
+
* - Check LLM API key and quota
|
|
20
|
+
* - Try a more explicit query (e.g., "list all products" instead of "products")
|
|
7
21
|
*/
|
|
8
22
|
export class IntentParseError extends Error {
|
|
9
|
-
|
|
10
|
-
|
|
23
|
+
suggestions;
|
|
24
|
+
constructor(message, suggestions) {
|
|
25
|
+
const enhancedMessage = IntentParseError.formatMessage(message, suggestions);
|
|
26
|
+
super(enhancedMessage);
|
|
11
27
|
this.name = 'IntentParseError';
|
|
28
|
+
this.suggestions = suggestions || IntentParseError.getDefaultSuggestions();
|
|
12
29
|
Object.setPrototypeOf(this, IntentParseError.prototype);
|
|
13
30
|
}
|
|
31
|
+
static formatMessage(message, suggestions) {
|
|
32
|
+
const suggestionList = suggestions || IntentParseError.getDefaultSuggestions();
|
|
33
|
+
return `${message}\n\nSuggested fixes:\n${suggestionList.map(s => ` • ${s}`).join('\n')}`;
|
|
34
|
+
}
|
|
35
|
+
static getDefaultSuggestions() {
|
|
36
|
+
return [
|
|
37
|
+
'Simplify your query (e.g., "show users" instead of complex phrasing)',
|
|
38
|
+
'Ensure table/field names match your database schema',
|
|
39
|
+
'Try a more explicit query (e.g., "list all products")',
|
|
40
|
+
'Check if LLM API key is valid and has quota available',
|
|
41
|
+
];
|
|
42
|
+
}
|
|
14
43
|
}
|
|
15
44
|
/**
|
|
16
45
|
* Error thrown when SQL generation fails.
|
|
46
|
+
*
|
|
47
|
+
* This error occurs when the LLM cannot generate valid SQL from the parsed intent,
|
|
48
|
+
* or when the generated SQL fails safety validation.
|
|
49
|
+
*
|
|
50
|
+
* Common causes:
|
|
51
|
+
* - Complex query requires table relationships not in schema
|
|
52
|
+
* - Generated SQL violates safety rules (e.g., attempted UPDATE/DELETE)
|
|
53
|
+
* - Schema description is incomplete or incorrect
|
|
54
|
+
* - LLM hallucinated invalid SQL syntax
|
|
55
|
+
*
|
|
56
|
+
* Suggested fixes:
|
|
57
|
+
* - Ensure your database schema is complete and accurate
|
|
58
|
+
* - Try a simpler query with fewer joins
|
|
59
|
+
* - Check that the LLM model supports structured outputs
|
|
60
|
+
* - Verify the intent was parsed correctly (use explain() method)
|
|
17
61
|
*/
|
|
18
62
|
export class SQLGenerationError extends Error {
|
|
19
|
-
|
|
20
|
-
|
|
63
|
+
suggestions;
|
|
64
|
+
constructor(message, suggestions) {
|
|
65
|
+
const enhancedMessage = SQLGenerationError.formatMessage(message, suggestions);
|
|
66
|
+
super(enhancedMessage);
|
|
21
67
|
this.name = 'SQLGenerationError';
|
|
68
|
+
this.suggestions = suggestions || SQLGenerationError.getDefaultSuggestions();
|
|
22
69
|
Object.setPrototypeOf(this, SQLGenerationError.prototype);
|
|
23
70
|
}
|
|
71
|
+
static formatMessage(message, suggestions) {
|
|
72
|
+
const suggestionList = suggestions || SQLGenerationError.getDefaultSuggestions();
|
|
73
|
+
return `${message}\n\nSuggested fixes:\n${suggestionList.map(s => ` • ${s}`).join('\n')}`;
|
|
74
|
+
}
|
|
75
|
+
static getDefaultSuggestions() {
|
|
76
|
+
return [
|
|
77
|
+
'Ensure your database schema is complete and accurate',
|
|
78
|
+
'Try a simpler query with fewer joins or filters',
|
|
79
|
+
'Verify the intent was parsed correctly (use explain() method)',
|
|
80
|
+
'Check that the LLM model supports your database dialect',
|
|
81
|
+
];
|
|
82
|
+
}
|
|
24
83
|
}
|
|
25
84
|
/**
|
|
26
85
|
* Error thrown when SQL execution fails.
|
|
86
|
+
*
|
|
87
|
+
* This error occurs when the database rejects the generated SQL query.
|
|
88
|
+
*
|
|
89
|
+
* Common causes:
|
|
90
|
+
* - Database connection issues
|
|
91
|
+
* - Table or column doesn't exist (schema mismatch)
|
|
92
|
+
* - Type mismatch in WHERE clause (e.g., string vs integer)
|
|
93
|
+
* - Database permissions insufficient for SELECT
|
|
94
|
+
* - Syntax error in generated SQL
|
|
95
|
+
*
|
|
96
|
+
* Suggested fixes:
|
|
97
|
+
* - Verify database connection is active
|
|
98
|
+
* - Ensure schema matches actual database structure
|
|
99
|
+
* - Check database user has SELECT permissions
|
|
100
|
+
* - Examine the generated SQL for syntax errors
|
|
101
|
+
* - Try regenerating with forceNewSchema option
|
|
27
102
|
*/
|
|
28
103
|
export class SQLExecutionError extends Error {
|
|
29
|
-
|
|
30
|
-
|
|
104
|
+
sql;
|
|
105
|
+
suggestions;
|
|
106
|
+
constructor(message, sql, suggestions) {
|
|
107
|
+
const enhancedMessage = SQLExecutionError.formatMessage(message, sql, suggestions);
|
|
108
|
+
super(enhancedMessage);
|
|
31
109
|
this.name = 'SQLExecutionError';
|
|
110
|
+
this.sql = sql;
|
|
111
|
+
this.suggestions = suggestions || SQLExecutionError.getDefaultSuggestions();
|
|
32
112
|
Object.setPrototypeOf(this, SQLExecutionError.prototype);
|
|
33
113
|
}
|
|
114
|
+
static formatMessage(message, sql, suggestions) {
|
|
115
|
+
let formatted = message;
|
|
116
|
+
if (sql) {
|
|
117
|
+
formatted += `\n\nGenerated SQL:\n${sql}`;
|
|
118
|
+
}
|
|
119
|
+
const suggestionList = suggestions || SQLExecutionError.getDefaultSuggestions();
|
|
120
|
+
formatted += `\n\nSuggested fixes:\n${suggestionList.map(s => ` • ${s}`).join('\n')}`;
|
|
121
|
+
return formatted;
|
|
122
|
+
}
|
|
123
|
+
static getDefaultSuggestions() {
|
|
124
|
+
return [
|
|
125
|
+
'Verify database connection is active (check DATABASE_URL)',
|
|
126
|
+
'Ensure schema matches actual database structure',
|
|
127
|
+
'Check database user has SELECT permissions on the table',
|
|
128
|
+
'Examine the generated SQL for syntax errors',
|
|
129
|
+
'Try regenerating with forceNewSchema: true option',
|
|
130
|
+
];
|
|
131
|
+
}
|
|
34
132
|
}
|
|
35
133
|
/**
|
|
36
134
|
* Error thrown when LLM API calls fail.
|
|
135
|
+
*
|
|
136
|
+
* This error occurs when communication with the LLM provider fails.
|
|
137
|
+
*
|
|
138
|
+
* Common causes:
|
|
139
|
+
* - Invalid or expired API key
|
|
140
|
+
* - Rate limit or quota exceeded
|
|
141
|
+
* - Network connectivity issues
|
|
142
|
+
* - LLM provider service outage
|
|
143
|
+
* - Request timeout
|
|
144
|
+
*
|
|
145
|
+
* Suggested fixes:
|
|
146
|
+
* - Verify API key is correct and active
|
|
147
|
+
* - Check API quota and rate limits with provider
|
|
148
|
+
* - Ensure network connectivity to LLM provider
|
|
149
|
+
* - Wait and retry (automatic retry with backoff is already applied)
|
|
150
|
+
* - Check LLM provider status page for outages
|
|
37
151
|
*/
|
|
38
152
|
export class LLMError extends Error {
|
|
39
|
-
|
|
40
|
-
|
|
153
|
+
suggestions;
|
|
154
|
+
constructor(message, suggestions) {
|
|
155
|
+
const enhancedMessage = LLMError.formatMessage(message, suggestions);
|
|
156
|
+
super(enhancedMessage);
|
|
41
157
|
this.name = 'LLMError';
|
|
158
|
+
this.suggestions = suggestions || LLMError.getDefaultSuggestions();
|
|
42
159
|
Object.setPrototypeOf(this, LLMError.prototype);
|
|
43
160
|
}
|
|
161
|
+
static formatMessage(message, suggestions) {
|
|
162
|
+
const suggestionList = suggestions || LLMError.getDefaultSuggestions();
|
|
163
|
+
return `${message}\n\nSuggested fixes:\n${suggestionList.map(s => ` • ${s}`).join('\n')}`;
|
|
164
|
+
}
|
|
165
|
+
static getDefaultSuggestions() {
|
|
166
|
+
return [
|
|
167
|
+
'Verify API key is correct (check ANTHROPIC_API_KEY, OPENAI_API_KEY, etc.)',
|
|
168
|
+
'Check API quota and rate limits with your provider',
|
|
169
|
+
'Ensure network connectivity to the LLM provider',
|
|
170
|
+
'Wait a moment and retry (automatic backoff already applied)',
|
|
171
|
+
'Check provider status page for service outages',
|
|
172
|
+
];
|
|
173
|
+
}
|
|
44
174
|
}
|
|
45
175
|
/**
|
|
46
176
|
* Error thrown when cache operations fail.
|
|
177
|
+
*
|
|
178
|
+
* This error occurs when the caching system encounters an issue.
|
|
179
|
+
*
|
|
180
|
+
* Common causes:
|
|
181
|
+
* - Redis connection failed (if using Redis L1 cache)
|
|
182
|
+
* - Redis authentication error
|
|
183
|
+
* - Network issues with Redis server
|
|
184
|
+
* - Embedding API failure (if using L2 semantic cache)
|
|
185
|
+
* - Out of memory for in-memory caches
|
|
186
|
+
*
|
|
187
|
+
* Suggested fixes:
|
|
188
|
+
* - Verify Redis server is running (if using Redis)
|
|
189
|
+
* - Check REDIS_URL format: redis://host:port
|
|
190
|
+
* - Ensure Redis authentication credentials are correct
|
|
191
|
+
* - Check OpenAI API key for embeddings (if L2 enabled)
|
|
192
|
+
* - Reduce cache size limits if memory is constrained
|
|
47
193
|
*/
|
|
48
194
|
export class CacheError extends Error {
|
|
49
|
-
|
|
50
|
-
|
|
195
|
+
suggestions;
|
|
196
|
+
constructor(message, suggestions) {
|
|
197
|
+
const enhancedMessage = CacheError.formatMessage(message, suggestions);
|
|
198
|
+
super(enhancedMessage);
|
|
51
199
|
this.name = 'CacheError';
|
|
200
|
+
this.suggestions = suggestions || CacheError.getDefaultSuggestions();
|
|
52
201
|
Object.setPrototypeOf(this, CacheError.prototype);
|
|
53
202
|
}
|
|
203
|
+
static formatMessage(message, suggestions) {
|
|
204
|
+
const suggestionList = suggestions || CacheError.getDefaultSuggestions();
|
|
205
|
+
return `${message}\n\nSuggested fixes:\n${suggestionList.map(s => ` • ${s}`).join('\n')}`;
|
|
206
|
+
}
|
|
207
|
+
static getDefaultSuggestions() {
|
|
208
|
+
return [
|
|
209
|
+
'Verify Redis server is running (if using Redis)',
|
|
210
|
+
'Check REDIS_URL format: redis://host:port',
|
|
211
|
+
'Ensure Redis authentication credentials are correct',
|
|
212
|
+
'Verify OpenAI API key for embeddings (if L2 cache enabled)',
|
|
213
|
+
'Try disabling cache temporarily to isolate the issue',
|
|
214
|
+
];
|
|
215
|
+
}
|
|
54
216
|
}
|
|
55
217
|
//# sourceMappingURL=errors.js.map
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAA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AC,EAAE;IACV,OAAO,CAAC,GAAG;IACX,OAAO,CAAC,KAAK;IACb,OAAO,CAAC,OAAO,CAAC;IAChB,OAAO,CAAC,OAAO,CAAC;IAPlB,OAAO,CAAC,YAAY,CAAe;gBAGzB,EAAE,EAAE,IAAI,EACR,GAAG,EAAE,UAAU,EACf,KAAK,EAAE,WAAW,EAClB,OAAO,CAAC,GAAE,UAAU,GAAG,eAAe,aAAA,EACtC,OAAO,CAAC,EAAE,aAAa,YAAA;IAGjC;;OAEG;IACG,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;IA4I9D;;OAEG;IACG,SAAS,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;IAkEhE;;OAEG;IACG,WAAW,CACf,MAAM,EAAE,MAAM,EACd,iBAAiB,EAAE,MAAM,GACxB,OAAO,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,SAAS,EAAE,CAAA;KAAE,CAAC;IAwChD;;OAEG;YACW,UAAU;IAqBxB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAuBzB;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAiB9B;;OAEG;IACH,OAAO,CAAC,cAAc;IAkBtB;;OAEG;IACH,OAAO,CAAC,gBAAgB;CAOzB"}
|
package/dist/executor.js
CHANGED
|
@@ -26,33 +26,94 @@ const SQL_GENERATION_JSON_SCHEMA = {
|
|
|
26
26
|
additionalProperties: false,
|
|
27
27
|
};
|
|
28
28
|
/**
|
|
29
|
-
* System prompt for SQL generation.
|
|
29
|
+
* System prompt for SQL generation with Claude 4.x best practices.
|
|
30
|
+
* Enhanced with context, safety reasoning, and model self-knowledge.
|
|
30
31
|
*/
|
|
31
|
-
const SQL_GENERATION_SYSTEM_PROMPT = `You are an expert SQL generator.
|
|
32
|
-
|
|
32
|
+
const SQL_GENERATION_SYSTEM_PROMPT = `You are an expert SQL generator specializing in safe, read-only database queries. Your role is critical for security: you translate user intents into SQL while preventing any data modification or security vulnerabilities.
|
|
33
|
+
|
|
34
|
+
WHY THIS MATTERS:
|
|
35
|
+
- User data protection: Generated queries must never modify, delete, or corrupt data
|
|
36
|
+
- Security: Parameterized queries prevent SQL injection attacks
|
|
37
|
+
- Performance: Proper limits prevent resource exhaustion
|
|
38
|
+
- Reliability: Type-safe queries ensure consistent results
|
|
33
39
|
|
|
34
40
|
{schema}
|
|
35
41
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
-
|
|
39
|
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
+
CORE REQUIREMENTS (all must be satisfied):
|
|
43
|
+
|
|
44
|
+
1. SAFETY - Generate ONLY read-only SELECT queries
|
|
45
|
+
WHY: Write operations could corrupt user data or violate security policies
|
|
46
|
+
- ✅ Allowed: SELECT, WITH (for CTEs)
|
|
47
|
+
- ❌ Forbidden: UPDATE, DELETE, DROP, ALTER, INSERT, CREATE, TRUNCATE
|
|
48
|
+
- Rationale: Even accidental data modification could cause irreversible damage
|
|
49
|
+
|
|
50
|
+
2. PARAMETERIZATION - Use ? placeholders for ALL dynamic values
|
|
51
|
+
WHY: Prevents SQL injection attacks that could expose or delete all data
|
|
52
|
+
- ✅ Correct: "WHERE status = ?" with params: ["active"]
|
|
53
|
+
- ❌ Dangerous: "WHERE status = 'active'" (vulnerable to injection)
|
|
54
|
+
- Rationale: Parameterized queries ensure values are safely escaped
|
|
55
|
+
|
|
56
|
+
3. LIMITS - Always include LIMIT clause (max 1000)
|
|
57
|
+
WHY: Prevents accidental full table scans that could crash the database
|
|
58
|
+
- Default: Use intent.limit if provided, otherwise 100
|
|
59
|
+
- Maximum: Never exceed 1000 rows
|
|
60
|
+
- Rationale: Large result sets consume excessive memory and network bandwidth
|
|
61
|
+
|
|
62
|
+
4. JOINS - Use explicit JOINs for table relationships
|
|
63
|
+
WHY: Explicit joins are more readable and prevent accidental cross joins
|
|
64
|
+
- Prefer: INNER JOIN, LEFT JOIN with ON conditions
|
|
65
|
+
- Avoid: Implicit joins via WHERE (e.g., FROM a, b WHERE a.id = b.id)
|
|
42
66
|
|
|
43
|
-
|
|
67
|
+
5. TYPE SAFETY - Match filter types to schema column types
|
|
68
|
+
WHY: Type mismatches cause query failures or unexpected results
|
|
69
|
+
- Integers: Use numeric literals, not strings
|
|
70
|
+
- Dates: Use proper date formats
|
|
71
|
+
- Booleans: Use TRUE/FALSE or 1/0 based on database
|
|
72
|
+
|
|
73
|
+
RESPONSE FORMAT:
|
|
74
|
+
Return valid JSON with exactly these fields:
|
|
44
75
|
{
|
|
45
76
|
"sql": "SELECT ... FROM ... WHERE ... LIMIT ?",
|
|
46
77
|
"params": [value1, value2, ...]
|
|
47
78
|
}
|
|
48
79
|
|
|
49
|
-
|
|
80
|
+
EXAMPLES WITH REASONING:
|
|
81
|
+
|
|
82
|
+
Example 1 - Simple list query:
|
|
50
83
|
Intent: {"entity": "users", "operation": "list", "filters": {"status": "active"}, "limit": 10}
|
|
84
|
+
Thought process:
|
|
85
|
+
- Entity is "users" → SELECT FROM users
|
|
86
|
+
- Filter on status → WHERE status = ? (parameterized)
|
|
87
|
+
- Limit specified → LIMIT ?
|
|
88
|
+
- Both values go in params array
|
|
51
89
|
Response: {"sql": "SELECT * FROM users WHERE status = ? LIMIT ?", "params": ["active", 10]}
|
|
52
90
|
|
|
91
|
+
Example 2 - Count with filter:
|
|
53
92
|
Intent: {"entity": "orders", "operation": "count", "filters": {"status": "pending"}}
|
|
93
|
+
Thought process:
|
|
94
|
+
- Count operation → SELECT COUNT(*) as count
|
|
95
|
+
- Filter on status → WHERE status = ? (parameterized)
|
|
96
|
+
- No limit specified, but COUNT returns single row (limit not needed)
|
|
54
97
|
Response: {"sql": "SELECT COUNT(*) as count FROM orders WHERE status = ?", "params": ["pending"]}
|
|
55
|
-
|
|
98
|
+
|
|
99
|
+
Example 3 - Join with sort:
|
|
100
|
+
Intent: {"entity": "orders", "operation": "list", "filters": {}, "limit": 20, "sort": "created_at:desc"}
|
|
101
|
+
Thought process:
|
|
102
|
+
- Entity is orders → SELECT FROM orders
|
|
103
|
+
- No filters → No WHERE clause
|
|
104
|
+
- Sort specified → ORDER BY created_at DESC
|
|
105
|
+
- Limit specified → LIMIT ?
|
|
106
|
+
Response: {"sql": "SELECT * FROM orders ORDER BY created_at DESC LIMIT ?", "params": [20]}
|
|
107
|
+
|
|
108
|
+
Example 4 - Specific fields:
|
|
109
|
+
Intent: {"entity": "users", "operation": "list", "filters": {}, "fields": ["id", "email", "name"], "limit": 50}
|
|
110
|
+
Thought process:
|
|
111
|
+
- Specific fields requested → SELECT id, email, name (not *)
|
|
112
|
+
- No filters → No WHERE clause
|
|
113
|
+
- Limit specified → LIMIT ?
|
|
114
|
+
Response: {"sql": "SELECT id, email, name FROM users LIMIT ?", "params": [50]}
|
|
115
|
+
|
|
116
|
+
Your expertise ensures users can query their data safely and efficiently.`;
|
|
56
117
|
/**
|
|
57
118
|
* Service for executing queries and managing SQL generation.
|
|
58
119
|
*/
|
package/dist/executor.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../src/executor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,MAAM,MAAM,QAAQ,CAAC;AAU5B,OAAO,EACN,kBAAkB,EAClB,iBAAiB,EACjB,QAAQ,GACR,MAAM,aAAa,CAAC;AAOrB;;GAEG;AACH,MAAM,0BAA0B,GAAG;IACjC,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,GAAG,EAAE;YACH,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,0BAA0B;SACxC;QACD,MAAM,EAAE;YACN,IAAI,EAAE,OAAO;YACb,KAAK,EAAE;gBACL,IAAI,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC;aACzD;YACD,WAAW,EAAE,8BAA8B;SAC5C;KACF;IACD,QAAQ,EAAE,CAAC,K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