@superatomai/sdk-node 0.0.31-mds → 0.0.32-mds
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 +942 -942
- package/dist/index.js +21 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +21 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -4177,8 +4177,12 @@ var PromptLoader = class {
|
|
|
4177
4177
|
"postgres": "postgresql",
|
|
4178
4178
|
"postgresql": "postgresql",
|
|
4179
4179
|
"mssql": "mssql",
|
|
4180
|
-
"mysql": "postgresql"
|
|
4180
|
+
"mysql": "postgresql",
|
|
4181
4181
|
// MySQL uses similar rules to PostgreSQL
|
|
4182
|
+
"excel": "duckdb",
|
|
4183
|
+
// Excel sources use DuckDB engine
|
|
4184
|
+
"csv": "duckdb"
|
|
4185
|
+
// CSV sources use DuckDB engine
|
|
4182
4186
|
};
|
|
4183
4187
|
const dbType = typeMap[sourceType] || "postgresql";
|
|
4184
4188
|
if (this.databaseRulesCache.has(dbType)) {
|
|
@@ -4240,6 +4244,20 @@ var PromptLoader = class {
|
|
|
4240
4244
|
- Use \`GETDATE()\` for current timestamp
|
|
4241
4245
|
- Use \`CAST()\` or \`CONVERT()\` for type casting
|
|
4242
4246
|
- Use \`OUTPUT INSERTED.*\` instead of \`RETURNING\`
|
|
4247
|
+
- NULL values: Use \`NULL\` keyword without quotes`;
|
|
4248
|
+
}
|
|
4249
|
+
if (dbType === "duckdb") {
|
|
4250
|
+
return `**Database Type: DuckDB**
|
|
4251
|
+
|
|
4252
|
+
**SQL Query Rules:**
|
|
4253
|
+
- Use \`LIMIT N\` for row limiting (e.g., \`SELECT * FROM table LIMIT 32\`)
|
|
4254
|
+
- NEVER cast INTERVAL to INTEGER/DOUBLE \u2014 use \`DATE_DIFF('day', start, end)\` for date differences
|
|
4255
|
+
- ALWAYS quote date units: \`DATE_DIFF('day', ...)\`, \`DATE_PART('year', ...)\` \u2014 bare \`day\`/\`month\`/\`year\` will be treated as column names
|
|
4256
|
+
- Use \`TRY_STRPTIME(col, format)\` to parse date strings safely
|
|
4257
|
+
- Use \`TRY_CAST(col AS type)\` for safe type conversions
|
|
4258
|
+
- Use \`true\` / \`false\` for boolean values
|
|
4259
|
+
- Use \`||\` for string concatenation
|
|
4260
|
+
- Use \`NOW()\` for current timestamp
|
|
4243
4261
|
- NULL values: Use \`NULL\` keyword without quotes`;
|
|
4244
4262
|
}
|
|
4245
4263
|
return `**Database Type: PostgreSQL**
|
|
@@ -7327,9 +7345,10 @@ This source has a large schema. The top tables are shown in detail above, but no
|
|
|
7327
7345
|
Even if a table appears in the detailed schema above, search_schema returns sample values that help you write correct WHERE filters.
|
|
7328
7346
|
**Never skip the search step \u2014 it prevents failed queries and retries.**`;
|
|
7329
7347
|
}
|
|
7348
|
+
const displaySourceType = sourceType === "excel" || sourceType === "csv" ? `${sourceType} \u2014 uses DuckDB SQL engine` : sourceType;
|
|
7330
7349
|
const prompts = await promptLoader.loadPrompts("agent-source-query", {
|
|
7331
7350
|
SOURCE_NAME: sourceName,
|
|
7332
|
-
SOURCE_TYPE:
|
|
7351
|
+
SOURCE_TYPE: displaySourceType,
|
|
7333
7352
|
FULL_SCHEMA: fullSchema,
|
|
7334
7353
|
DATABASE_RULES: databaseRules,
|
|
7335
7354
|
ROW_LIMIT_SYNTAX: rowLimitInstruction,
|