@deepagents/text2sql 7.42.3 → 7.43.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.
@@ -1912,6 +1912,7 @@ function isAstLike(value) {
1912
1912
  }
1913
1913
 
1914
1914
  // packages/text2sql/src/lib/adapters/postgres/postgres-parser-workaround.ts
1915
+ import z7 from "zod";
1915
1916
  var TYPE_BEFORE_LITERAL = /(?<type>(?:pg_catalog\.)?[A-Za-z_][A-Za-z0-9_$]*(?:\s+(?:varying|precision))?(?:\s*\(\s*\d+(?:\s*,\s*\d+)?\s*\))?(?:\s+(?:with|without)\s+time\s+zone)?)\s*$/i;
1916
1917
  var TIME_ZONE_SUFFIX = /^\s+time\s+zone\s+/i;
1917
1918
  var TIME_BEFORE_SUFFIX = /(?<type>time(?:stamp)?(?:\s*\(\s*\d+\s*\))?)\s+(?<qualifier>with|without)$/i;
@@ -1934,14 +1935,12 @@ function recoverPostgresTypedLiteralParserGap(sql, error) {
1934
1935
  return null;
1935
1936
  return prefix.slice(0, typeMatch.index) + `CAST(${sql.slice(literalStart, literalEnd)} AS ${parserType(type)})` + sql.slice(literalEnd);
1936
1937
  }
1938
+ var parserSyntaxError = z7.object({
1939
+ location: z7.object({ start: z7.object({ offset: z7.number() }) })
1940
+ });
1937
1941
  function parserErrorOffset(error) {
1938
- if (typeof error !== "object" || error === null) return null;
1939
- const location = Reflect.get(error, "location");
1940
- if (typeof location !== "object" || location === null) return null;
1941
- const start = Reflect.get(location, "start");
1942
- if (typeof start !== "object" || start === null) return null;
1943
- const offset = Reflect.get(start, "offset");
1944
- return typeof offset === "number" ? offset : null;
1942
+ const parsed = parserSyntaxError.safeParse(error);
1943
+ return parsed.success ? parsed.data.location.start.offset : null;
1945
1944
  }
1946
1945
  function findLiteralEnd(sql, start) {
1947
1946
  if (sql[start] !== "'") {
@@ -2114,9 +2113,9 @@ var Postgres = class extends Adapter {
2114
2113
  };
2115
2114
 
2116
2115
  // packages/text2sql/src/lib/adapters/postgres/row-count.postgres.grounding.ts
2117
- import { z as z7 } from "zod";
2118
- var estimateRow = z7.object({ estimate: numericValue.nullable() });
2119
- var countRow = z7.object({ count: numericValue.nullable() });
2116
+ import { z as z8 } from "zod";
2117
+ var estimateRow = z8.object({ estimate: numericValue.nullable() });
2118
+ var countRow = z8.object({ count: numericValue.nullable() });
2120
2119
  var PostgresRowCountGrounding = class extends RowCountGrounding {
2121
2120
  #adapter;
2122
2121
  constructor(adapter, config = {}) {
@@ -2156,24 +2155,24 @@ var PostgresRowCountGrounding = class extends RowCountGrounding {
2156
2155
  };
2157
2156
 
2158
2157
  // packages/text2sql/src/lib/adapters/postgres/table.postgres.grounding.ts
2159
- import { z as z9 } from "zod";
2158
+ import { z as z10 } from "zod";
2160
2159
 
2161
2160
  // packages/text2sql/src/lib/adapters/postgres/postgres-rows.ts
2162
- import { z as z8 } from "zod";
2163
- var columnRow = z8.object({
2164
- column_name: z8.string().nullable(),
2165
- data_type: z8.string().nullable()
2161
+ import { z as z9 } from "zod";
2162
+ var columnRow = z9.object({
2163
+ column_name: z9.string().nullable(),
2164
+ data_type: z9.string().nullable()
2166
2165
  });
2167
2166
 
2168
2167
  // packages/text2sql/src/lib/adapters/postgres/table.postgres.grounding.ts
2169
- var relationshipRow = z9.object({
2170
- constraint_name: z9.string(),
2171
- table_schema: z9.string(),
2172
- table_name: z9.string(),
2173
- column_name: z9.string(),
2174
- foreign_table_schema: z9.string(),
2175
- foreign_table_name: z9.string(),
2176
- foreign_column_name: z9.string()
2168
+ var relationshipRow = z10.object({
2169
+ constraint_name: z10.string(),
2170
+ table_schema: z10.string(),
2171
+ table_name: z10.string(),
2172
+ column_name: z10.string(),
2173
+ foreign_table_schema: z10.string(),
2174
+ foreign_table_name: z10.string(),
2175
+ foreign_column_name: z10.string()
2177
2176
  });
2178
2177
  var PostgresTableGrounding = class extends TableGrounding {
2179
2178
  #adapter;