@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/dist/index.js CHANGED
@@ -4237,8 +4237,12 @@ var PromptLoader = class {
4237
4237
  "postgres": "postgresql",
4238
4238
  "postgresql": "postgresql",
4239
4239
  "mssql": "mssql",
4240
- "mysql": "postgresql"
4240
+ "mysql": "postgresql",
4241
4241
  // MySQL uses similar rules to PostgreSQL
4242
+ "excel": "duckdb",
4243
+ // Excel sources use DuckDB engine
4244
+ "csv": "duckdb"
4245
+ // CSV sources use DuckDB engine
4242
4246
  };
4243
4247
  const dbType = typeMap[sourceType] || "postgresql";
4244
4248
  if (this.databaseRulesCache.has(dbType)) {
@@ -4300,6 +4304,20 @@ var PromptLoader = class {
4300
4304
  - Use \`GETDATE()\` for current timestamp
4301
4305
  - Use \`CAST()\` or \`CONVERT()\` for type casting
4302
4306
  - Use \`OUTPUT INSERTED.*\` instead of \`RETURNING\`
4307
+ - NULL values: Use \`NULL\` keyword without quotes`;
4308
+ }
4309
+ if (dbType === "duckdb") {
4310
+ return `**Database Type: DuckDB**
4311
+
4312
+ **SQL Query Rules:**
4313
+ - Use \`LIMIT N\` for row limiting (e.g., \`SELECT * FROM table LIMIT 32\`)
4314
+ - NEVER cast INTERVAL to INTEGER/DOUBLE \u2014 use \`DATE_DIFF('day', start, end)\` for date differences
4315
+ - ALWAYS quote date units: \`DATE_DIFF('day', ...)\`, \`DATE_PART('year', ...)\` \u2014 bare \`day\`/\`month\`/\`year\` will be treated as column names
4316
+ - Use \`TRY_STRPTIME(col, format)\` to parse date strings safely
4317
+ - Use \`TRY_CAST(col AS type)\` for safe type conversions
4318
+ - Use \`true\` / \`false\` for boolean values
4319
+ - Use \`||\` for string concatenation
4320
+ - Use \`NOW()\` for current timestamp
4303
4321
  - NULL values: Use \`NULL\` keyword without quotes`;
4304
4322
  }
4305
4323
  return `**Database Type: PostgreSQL**
@@ -7387,9 +7405,10 @@ This source has a large schema. The top tables are shown in detail above, but no
7387
7405
  Even if a table appears in the detailed schema above, search_schema returns sample values that help you write correct WHERE filters.
7388
7406
  **Never skip the search step \u2014 it prevents failed queries and retries.**`;
7389
7407
  }
7408
+ const displaySourceType = sourceType === "excel" || sourceType === "csv" ? `${sourceType} \u2014 uses DuckDB SQL engine` : sourceType;
7390
7409
  const prompts = await promptLoader.loadPrompts("agent-source-query", {
7391
7410
  SOURCE_NAME: sourceName,
7392
- SOURCE_TYPE: sourceType,
7411
+ SOURCE_TYPE: displaySourceType,
7393
7412
  FULL_SCHEMA: fullSchema,
7394
7413
  DATABASE_RULES: databaseRules,
7395
7414
  ROW_LIMIT_SYNTAX: rowLimitInstruction,