@deepagents/text2sql 0.6.0 → 0.8.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.
Files changed (50) hide show
  1. package/dist/index.d.ts +1 -0
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +1121 -453
  4. package/dist/index.js.map +4 -4
  5. package/dist/lib/adapters/mysql/column-stats.mysql.grounding.d.ts +14 -0
  6. package/dist/lib/adapters/mysql/column-stats.mysql.grounding.d.ts.map +1 -0
  7. package/dist/lib/adapters/mysql/column-values.mysql.grounding.d.ts +22 -0
  8. package/dist/lib/adapters/mysql/column-values.mysql.grounding.d.ts.map +1 -0
  9. package/dist/lib/adapters/mysql/constraint.mysql.grounding.d.ts +13 -0
  10. package/dist/lib/adapters/mysql/constraint.mysql.grounding.d.ts.map +1 -0
  11. package/dist/lib/adapters/mysql/index.d.ts +44 -0
  12. package/dist/lib/adapters/mysql/index.d.ts.map +1 -0
  13. package/dist/lib/adapters/mysql/index.js +1597 -0
  14. package/dist/lib/adapters/mysql/index.js.map +7 -0
  15. package/dist/lib/adapters/mysql/indexes.mysql.grounding.d.ts +13 -0
  16. package/dist/lib/adapters/mysql/indexes.mysql.grounding.d.ts.map +1 -0
  17. package/dist/lib/adapters/mysql/info.mysql.grounding.d.ts +13 -0
  18. package/dist/lib/adapters/mysql/info.mysql.grounding.d.ts.map +1 -0
  19. package/dist/lib/adapters/mysql/mysql.d.ts +33 -0
  20. package/dist/lib/adapters/mysql/mysql.d.ts.map +1 -0
  21. package/dist/lib/adapters/mysql/row-count.mysql.grounding.d.ts +13 -0
  22. package/dist/lib/adapters/mysql/row-count.mysql.grounding.d.ts.map +1 -0
  23. package/dist/lib/adapters/mysql/table.mysql.grounding.d.ts +21 -0
  24. package/dist/lib/adapters/mysql/table.mysql.grounding.d.ts.map +1 -0
  25. package/dist/lib/adapters/mysql/view.mysql.grounding.d.ts +18 -0
  26. package/dist/lib/adapters/mysql/view.mysql.grounding.d.ts.map +1 -0
  27. package/dist/lib/agents/bi.agent.d.ts +14 -0
  28. package/dist/lib/agents/bi.agent.d.ts.map +1 -0
  29. package/dist/lib/agents/chat1.agent.d.ts.map +1 -1
  30. package/dist/lib/agents/chat2.agent.d.ts.map +1 -1
  31. package/dist/lib/agents/developer.agent.d.ts +31 -0
  32. package/dist/lib/agents/developer.agent.d.ts.map +1 -0
  33. package/dist/lib/agents/question.agent.d.ts +1 -1
  34. package/dist/lib/agents/question.agent.d.ts.map +1 -1
  35. package/dist/lib/agents/sql.agent.d.ts +14 -32
  36. package/dist/lib/agents/sql.agent.d.ts.map +1 -1
  37. package/dist/lib/agents/text2sql.agent.d.ts.map +1 -1
  38. package/dist/lib/checkpoint.d.ts.map +1 -1
  39. package/dist/lib/sql.d.ts +42 -0
  40. package/dist/lib/sql.d.ts.map +1 -1
  41. package/dist/lib/synthesis/extractors/sql-extractor.d.ts.map +1 -1
  42. package/dist/lib/synthesis/index.js +267 -164
  43. package/dist/lib/synthesis/index.js.map +3 -3
  44. package/dist/lib/synthesis/synthesizers/breadth-evolver.d.ts.map +1 -1
  45. package/dist/lib/synthesis/synthesizers/depth-evolver.d.ts.map +1 -1
  46. package/dist/lib/synthesis/synthesizers/schema-synthesizer.d.ts.map +1 -1
  47. package/dist/lib/synthesis/synthesizers/styles.d.ts +2 -2
  48. package/dist/lib/synthesis/synthesizers/styles.d.ts.map +1 -1
  49. package/dist/lib/teach/teachings.d.ts.map +1 -1
  50. package/package.json +9 -3
@@ -0,0 +1,14 @@
1
+ import type { Adapter, ColumnStats } from '../adapter.ts';
2
+ import { ColumnStatsGrounding, type ColumnStatsGroundingConfig } from '../groundings/column-stats.grounding.ts';
3
+ import type { Column } from '../groundings/column-values.grounding.ts';
4
+ /**
5
+ * MySQL/MariaDB implementation of ColumnStatsGrounding.
6
+ *
7
+ * Collects min/max/null statistics for numeric, date, and boolean columns.
8
+ */
9
+ export declare class MysqlColumnStatsGrounding extends ColumnStatsGrounding {
10
+ #private;
11
+ constructor(adapter: Adapter, config?: ColumnStatsGroundingConfig);
12
+ protected collectStats(tableName: string, column: Column): Promise<ColumnStats | undefined>;
13
+ }
14
+ //# sourceMappingURL=column-stats.mysql.grounding.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"column-stats.mysql.grounding.d.ts","sourceRoot":"","sources":["../../../../src/lib/adapters/mysql/column-stats.mysql.grounding.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EACL,oBAAoB,EACpB,KAAK,0BAA0B,EAChC,MAAM,yCAAyC,CAAC;AACjD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0CAA0C,CAAC;AAQvE;;;;GAIG;AACH,qBAAa,yBAA0B,SAAQ,oBAAoB;;gBAGrD,OAAO,EAAE,OAAO,EAAE,MAAM,GAAE,0BAA+B;cAK5C,YAAY,CACnC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC;CA4EpC"}
@@ -0,0 +1,22 @@
1
+ import type { Adapter } from '../adapter.ts';
2
+ import { type Column, ColumnValuesGrounding, type ColumnValuesGroundingConfig } from '../groundings/column-values.grounding.ts';
3
+ /**
4
+ * MySQL/MariaDB implementation of ColumnValuesGrounding.
5
+ *
6
+ * Detects:
7
+ * 1. Native ENUM types - parses values from COLUMN_TYPE
8
+ * 2. Low cardinality columns - via data scan
9
+ */
10
+ export declare class MysqlColumnValuesGrounding extends ColumnValuesGrounding {
11
+ #private;
12
+ constructor(adapter: Adapter, config?: ColumnValuesGroundingConfig);
13
+ /**
14
+ * Detect native MySQL ENUM types and extract their values.
15
+ */
16
+ protected collectEnumValues(tableName: string, column: Column): Promise<string[] | undefined>;
17
+ /**
18
+ * Collect distinct values for low cardinality columns.
19
+ */
20
+ protected collectLowCardinality(tableName: string, column: Column): Promise<string[] | undefined>;
21
+ }
22
+ //# sourceMappingURL=column-values.mysql.grounding.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"column-values.mysql.grounding.d.ts","sourceRoot":"","sources":["../../../../src/lib/adapters/mysql/column-values.mysql.grounding.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EACL,KAAK,MAAM,EACX,qBAAqB,EACrB,KAAK,2BAA2B,EACjC,MAAM,0CAA0C,CAAC;AAMlD;;;;;;GAMG;AACH,qBAAa,0BAA2B,SAAQ,qBAAqB;;gBAGvD,OAAO,EAAE,OAAO,EAAE,MAAM,GAAE,2BAAgC;IAKtE;;OAEG;cACsB,iBAAiB,CACxC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,EAAE,GAAG,SAAS,CAAC;IAuBhC;;OAEG;cACsB,qBAAqB,CAC5C,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,EAAE,GAAG,SAAS,CAAC;CAoFjC"}
@@ -0,0 +1,13 @@
1
+ import type { Adapter, TableConstraint } from '../adapter.ts';
2
+ import { ConstraintGrounding, type ConstraintGroundingConfig } from '../groundings/constraint.grounding.ts';
3
+ /**
4
+ * MySQL/MariaDB implementation of ConstraintGrounding.
5
+ *
6
+ * Collects PRIMARY KEY, FOREIGN KEY, UNIQUE, NOT_NULL, DEFAULT, and CHECK constraints.
7
+ */
8
+ export declare class MysqlConstraintGrounding extends ConstraintGrounding {
9
+ #private;
10
+ constructor(adapter: Adapter, config?: ConstraintGroundingConfig);
11
+ protected getConstraints(tableName: string): Promise<TableConstraint[]>;
12
+ }
13
+ //# sourceMappingURL=constraint.mysql.grounding.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constraint.mysql.grounding.d.ts","sourceRoot":"","sources":["../../../../src/lib/adapters/mysql/constraint.mysql.grounding.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EACL,mBAAmB,EACnB,KAAK,yBAAyB,EAC/B,MAAM,uCAAuC,CAAC;AAsB/C;;;;GAIG;AACH,qBAAa,wBAAyB,SAAQ,mBAAmB;;gBAGnD,OAAO,EAAE,OAAO,EAAE,MAAM,GAAE,yBAA8B;cAK3C,cAAc,CACrC,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,eAAe,EAAE,CAAC;CAkL9B"}
@@ -0,0 +1,44 @@
1
+ import { type Adapter } from '../adapter.ts';
2
+ import { type ColumnStatsGroundingConfig } from '../groundings/column-stats.grounding.ts';
3
+ import { type ColumnValuesGroundingConfig } from '../groundings/column-values.grounding.ts';
4
+ import { type ConstraintGroundingConfig } from '../groundings/constraint.grounding.ts';
5
+ import { type IndexesGroundingConfig } from '../groundings/indexes.grounding.ts';
6
+ import { type InfoGroundingConfig } from '../groundings/info.grounding.ts';
7
+ import { ReportGrounding, type ReportGroundingConfig } from '../groundings/report.grounding.ts';
8
+ import { type RowCountGroundingConfig } from '../groundings/row-count.grounding.ts';
9
+ import { type TableGroundingConfig } from '../groundings/table.grounding.ts';
10
+ import type { ViewGroundingConfig } from '../groundings/view.grounding.ts';
11
+ import { MysqlColumnStatsGrounding } from './column-stats.mysql.grounding.ts';
12
+ import { MysqlColumnValuesGrounding } from './column-values.mysql.grounding.ts';
13
+ import { MysqlConstraintGrounding } from './constraint.mysql.grounding.ts';
14
+ import { MysqlIndexesGrounding } from './indexes.mysql.grounding.ts';
15
+ import { MysqlInfoGrounding } from './info.mysql.grounding.ts';
16
+ import { Mariadb } from './mysql.ts';
17
+ import { MysqlRowCountGrounding } from './row-count.mysql.grounding.ts';
18
+ import { MysqlTableGrounding } from './table.mysql.grounding.ts';
19
+ import { MysqlViewGrounding } from './view.mysql.grounding.ts';
20
+ export * from './mysql.ts';
21
+ export declare function tables(config?: TableGroundingConfig): (adapter: Adapter) => MysqlTableGrounding;
22
+ export declare function info(config?: InfoGroundingConfig): (adapter: Adapter) => MysqlInfoGrounding;
23
+ export declare function views(config?: ViewGroundingConfig): (adapter: Adapter) => MysqlViewGrounding;
24
+ export declare function columnStats(config?: ColumnStatsGroundingConfig): (adapter: Adapter) => MysqlColumnStatsGrounding;
25
+ export declare function columnValues(config?: ColumnValuesGroundingConfig): (adapter: Adapter) => MysqlColumnValuesGrounding;
26
+ export declare function indexes(config?: IndexesGroundingConfig): (adapter: Adapter) => MysqlIndexesGrounding;
27
+ export declare function rowCount(config?: RowCountGroundingConfig): (adapter: Adapter) => MysqlRowCountGrounding;
28
+ export declare function constraints(config?: ConstraintGroundingConfig): (adapter: Adapter) => MysqlConstraintGrounding;
29
+ export declare function report(config?: ReportGroundingConfig): (adapter: Adapter) => ReportGrounding;
30
+ declare const _default: {
31
+ tables: typeof tables;
32
+ info: typeof info;
33
+ views: typeof views;
34
+ columnStats: typeof columnStats;
35
+ columnValues: typeof columnValues;
36
+ indexes: typeof indexes;
37
+ rowCount: typeof rowCount;
38
+ constraints: typeof constraints;
39
+ report: typeof report;
40
+ Mysql: typeof Mariadb;
41
+ Mariadb: typeof Mariadb;
42
+ };
43
+ export default _default;
44
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/adapters/mysql/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AAC1F,OAAO,EAAE,KAAK,2BAA2B,EAAE,MAAM,0CAA0C,CAAC;AAC5F,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AACvF,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AACjF,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAA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