@deepagents/text2sql 0.10.1 → 0.11.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 (98) hide show
  1. package/README.md +32 -41
  2. package/dist/index.d.ts +1 -6
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +2338 -2395
  5. package/dist/index.js.map +4 -4
  6. package/dist/lib/adapters/adapter.d.ts +13 -1
  7. package/dist/lib/adapters/adapter.d.ts.map +1 -1
  8. package/dist/lib/adapters/groundings/abstract.grounding.d.ts +19 -3
  9. package/dist/lib/adapters/groundings/abstract.grounding.d.ts.map +1 -1
  10. package/dist/lib/adapters/groundings/column-stats.grounding.d.ts +1 -2
  11. package/dist/lib/adapters/groundings/column-stats.grounding.d.ts.map +1 -1
  12. package/dist/lib/adapters/groundings/column-values.grounding.d.ts +1 -2
  13. package/dist/lib/adapters/groundings/column-values.grounding.d.ts.map +1 -1
  14. package/dist/lib/adapters/groundings/constraint.grounding.d.ts +1 -1
  15. package/dist/lib/adapters/groundings/constraint.grounding.d.ts.map +1 -1
  16. package/dist/lib/adapters/groundings/index.js +15 -222
  17. package/dist/lib/adapters/groundings/index.js.map +3 -3
  18. package/dist/lib/adapters/groundings/indexes.grounding.d.ts +1 -1
  19. package/dist/lib/adapters/groundings/indexes.grounding.d.ts.map +1 -1
  20. package/dist/lib/adapters/groundings/info.grounding.d.ts +1 -1
  21. package/dist/lib/adapters/groundings/info.grounding.d.ts.map +1 -1
  22. package/dist/lib/adapters/groundings/report.grounding.d.ts +1 -1
  23. package/dist/lib/adapters/groundings/report.grounding.d.ts.map +1 -1
  24. package/dist/lib/adapters/groundings/row-count.grounding.d.ts +1 -1
  25. package/dist/lib/adapters/groundings/row-count.grounding.d.ts.map +1 -1
  26. package/dist/lib/adapters/groundings/table.grounding.d.ts +3 -3
  27. package/dist/lib/adapters/groundings/table.grounding.d.ts.map +1 -1
  28. package/dist/lib/adapters/groundings/view.grounding.d.ts +1 -1
  29. package/dist/lib/adapters/groundings/view.grounding.d.ts.map +1 -1
  30. package/dist/lib/adapters/mysql/index.js +343 -315
  31. package/dist/lib/adapters/mysql/index.js.map +4 -4
  32. package/dist/lib/adapters/postgres/index.js +385 -357
  33. package/dist/lib/adapters/postgres/index.js.map +4 -4
  34. package/dist/lib/adapters/spreadsheet/index.js +290 -223
  35. package/dist/lib/adapters/spreadsheet/index.js.map +4 -4
  36. package/dist/lib/adapters/sqlite/index.js +307 -279
  37. package/dist/lib/adapters/sqlite/index.js.map +4 -4
  38. package/dist/lib/adapters/sqlserver/index.js +383 -355
  39. package/dist/lib/adapters/sqlserver/index.js.map +4 -4
  40. package/dist/lib/agents/developer.agent.d.ts +33 -23
  41. package/dist/lib/agents/developer.agent.d.ts.map +1 -1
  42. package/dist/lib/agents/sql.agent.d.ts +4 -4
  43. package/dist/lib/agents/sql.agent.d.ts.map +1 -1
  44. package/dist/lib/agents/teachables.agent.d.ts +2 -2
  45. package/dist/lib/agents/teachables.agent.d.ts.map +1 -1
  46. package/dist/lib/agents/text2sql.agent.d.ts +18 -71
  47. package/dist/lib/agents/text2sql.agent.d.ts.map +1 -1
  48. package/dist/lib/fragments/schema.d.ts +214 -0
  49. package/dist/lib/fragments/schema.d.ts.map +1 -0
  50. package/dist/lib/instructions.d.ts +29 -2
  51. package/dist/lib/instructions.d.ts.map +1 -1
  52. package/dist/lib/instructions.js +336 -319
  53. package/dist/lib/instructions.js.map +4 -4
  54. package/dist/lib/sql.d.ts +13 -103
  55. package/dist/lib/sql.d.ts.map +1 -1
  56. package/dist/lib/synthesis/extractors/base-contextual-extractor.d.ts +2 -2
  57. package/dist/lib/synthesis/extractors/base-contextual-extractor.d.ts.map +1 -1
  58. package/dist/lib/synthesis/extractors/message-extractor.d.ts +1 -2
  59. package/dist/lib/synthesis/extractors/message-extractor.d.ts.map +1 -1
  60. package/dist/lib/synthesis/extractors/sql-extractor.d.ts.map +1 -1
  61. package/dist/lib/synthesis/index.js +1794 -572
  62. package/dist/lib/synthesis/index.js.map +4 -4
  63. package/dist/lib/synthesis/synthesizers/depth-evolver.d.ts.map +1 -1
  64. package/dist/lib/synthesis/synthesizers/persona-generator.d.ts +7 -17
  65. package/dist/lib/synthesis/synthesizers/persona-generator.d.ts.map +1 -1
  66. package/dist/lib/synthesis/synthesizers/schema-synthesizer.d.ts +2 -2
  67. package/dist/lib/synthesis/synthesizers/schema-synthesizer.d.ts.map +1 -1
  68. package/dist/lib/synthesis/synthesizers/teachings-generator.d.ts +8 -20
  69. package/dist/lib/synthesis/synthesizers/teachings-generator.d.ts.map +1 -1
  70. package/dist/lib/teach/teachings.d.ts +2 -2
  71. package/dist/lib/teach/teachings.d.ts.map +1 -1
  72. package/package.json +4 -3
  73. package/dist/lib/agents/chat1.agent.d.ts +0 -50
  74. package/dist/lib/agents/chat1.agent.d.ts.map +0 -1
  75. package/dist/lib/agents/chat2.agent.d.ts +0 -68
  76. package/dist/lib/agents/chat2.agent.d.ts.map +0 -1
  77. package/dist/lib/agents/chat3.agent.d.ts +0 -80
  78. package/dist/lib/agents/chat3.agent.d.ts.map +0 -1
  79. package/dist/lib/agents/chat4.agent.d.ts +0 -88
  80. package/dist/lib/agents/chat4.agent.d.ts.map +0 -1
  81. package/dist/lib/history/history.d.ts +0 -41
  82. package/dist/lib/history/history.d.ts.map +0 -1
  83. package/dist/lib/history/memory.history.d.ts +0 -5
  84. package/dist/lib/history/memory.history.d.ts.map +0 -1
  85. package/dist/lib/history/sqlite.history.d.ts +0 -15
  86. package/dist/lib/history/sqlite.history.d.ts.map +0 -1
  87. package/dist/lib/memory/memory.prompt.d.ts +0 -3
  88. package/dist/lib/memory/memory.prompt.d.ts.map +0 -1
  89. package/dist/lib/memory/memory.store.d.ts +0 -5
  90. package/dist/lib/memory/memory.store.d.ts.map +0 -1
  91. package/dist/lib/memory/sqlite.store.d.ts +0 -14
  92. package/dist/lib/memory/sqlite.store.d.ts.map +0 -1
  93. package/dist/lib/memory/store.d.ts +0 -40
  94. package/dist/lib/memory/store.d.ts.map +0 -1
  95. package/dist/lib/teach/teachables.d.ts +0 -648
  96. package/dist/lib/teach/teachables.d.ts.map +0 -1
  97. package/dist/lib/teach/xml.d.ts +0 -6
  98. package/dist/lib/teach/xml.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"depth-evolver.d.ts","sourceRoot":"","sources":["../../../../src/lib/synthesis/synthesizers/depth-evolver.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,KAAK,UAAU,EAAyB,MAAM,mBAAmB,CAAC;AAE3E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAEzD,OAAO,EAAE,KAAK,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE/D;;;GAGG;AACH,MAAM,MAAM,cAAc,GACtB,iBAAiB,GACjB,YAAY,GACZ,UAAU,GACV,eAAe,GACf,cAAc,CAAC;AA6CnB,MAAM,WAAW,mBAAmB;IAClC,UAAU,CAAC,EAAE,cAAc,EAAE,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAiFD;;;;;;;;GAQG;AACH,qBAAa,YAAa,SAAQ,YAAY;;IAS1C,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,OAAO,CAAC;IARlB;;;;OAIG;gBAEO,MAAM,EAAE,YAAY,GAAG,aAAa,EAAE,EACtC,OAAO,EAAE,OAAO,EAChB,OAAO,CAAC,EAAE,mBAAmB,YAAA;IAMvC;;;OAGG;IACI,OAAO,IAAI,cAAc,CAAC,aAAa,EAAE,CAAC;CA4ElD"}
1
+ {"version":3,"file":"depth-evolver.d.ts","sourceRoot":"","sources":["../../../../src/lib/synthesis/synthesizers/depth-evolver.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,KAAK,UAAU,EAAyB,MAAM,mBAAmB,CAAC;AAE3E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAEzD,OAAO,EAAE,KAAK,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE/D;;;GAGG;AACH,MAAM,MAAM,cAAc,GACtB,iBAAiB,GACjB,YAAY,GACZ,UAAU,GACV,eAAe,GACf,cAAc,CAAC;AA6CnB,MAAM,WAAW,mBAAmB;IAClC,UAAU,CAAC,EAAE,cAAc,EAAE,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAiFD;;;;;;;;GAQG;AACH,qBAAa,YAAa,SAAQ,YAAY;;IAS1C,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,OAAO,CAAC;IARlB;;;;OAIG;gBAEO,MAAM,EAAE,YAAY,GAAG,aAAa,EAAE,EACtC,OAAO,EAAE,OAAO,EAChB,OAAO,CAAC,EAAE,mBAAmB,YAAA;IAMvC;;;OAGG;IACI,OAAO,IAAI,cAAc,CAAC,aAAa,EAAE,CAAC;CAgFlD"}
@@ -1,5 +1,5 @@
1
1
  import { type AgentModel } from '@deepagents/agent';
2
- import type { Adapter } from '../../adapters/adapter.ts';
2
+ import { type ContextFragment } from '@deepagents/context';
3
3
  import { type NLStyle } from './styles.ts';
4
4
  export interface Persona {
5
5
  role: string;
@@ -11,24 +11,14 @@ export interface PersonaGeneratorOptions {
11
11
  model?: AgentModel;
12
12
  }
13
13
  /**
14
- * PersonaGenerator - Generate relevant personas from database schema.
15
- *
14
+ * Generate personas by analyzing database schema.
16
15
  * Analyzes the schema to infer who would query this database and what
17
16
  * they care about. Generated personas can be used with BreadthEvolver
18
17
  * to create diverse question paraphrases from different perspectives.
18
+ *
19
+ * @param schemaFragments - Schema fragments from adapter.introspect()
20
+ * @param options - Generation options including count and model
21
+ * @returns Array of personas with roles and perspectives
19
22
  */
20
- export declare class PersonaGenerator {
21
- private adapter;
22
- private options?;
23
- /**
24
- * @param adapter - Database adapter for schema introspection
25
- * @param options - Generation options including count and model
26
- */
27
- constructor(adapter: Adapter, options?: PersonaGeneratorOptions | undefined);
28
- /**
29
- * Generates personas by analyzing the database schema to infer user types.
30
- * @returns Array of personas with roles and perspectives
31
- */
32
- generate(): Promise<Persona[]>;
33
- }
23
+ export declare function generatePersonas(schemaFragments: ContextFragment[], options?: PersonaGeneratorOptions): Promise<Persona[]>;
34
24
  //# sourceMappingURL=persona-generator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"persona-generator.d.ts","sourceRoot":"","sources":["../../../../src/lib/synthesis/synthesizers/persona-generator.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,UAAU,EAAyB,MAAM,mBAAmB,CAAC;AAE3E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAc,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAEvD,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,OAAO,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,uBAAuB;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB;AA+GD;;;;;;GAMG;AACH,qBAAa,gBAAgB;IAMzB,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,OAAO,CAAC;IANlB;;;OAGG;gBAEO,OAAO,EAAE,OAAO,EAChB,OAAO,CAAC,EAAE,uBAAuB,YAAA;IAG3C;;;OAGG;IACG,QAAQ,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;CAiBrC"}
1
+ {"version":3,"file":"persona-generator.d.ts","sourceRoot":"","sources":["../../../../src/lib/synthesis/synthesizers/persona-generator.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAEL,KAAK,eAAe,EAOrB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAc,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAEvD,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,OAAO,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,uBAAuB;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB;AAyBD;;;;;;;;;GASG;AACH,wBAAsB,gBAAgB,CACpC,eAAe,EAAE,eAAe,EAAE,EAClC,OAAO,CAAC,EAAE,uBAAuB,GAChC,OAAO,CAAC,OAAO,EAAE,CAAC,CAyFpB"}
@@ -1,14 +1,14 @@
1
1
  import type { AgentModel } from '@deepagents/agent';
2
+ import type { ContextFragment } from '@deepagents/context';
2
3
  import type { Adapter } from '../../adapters/adapter.ts';
3
4
  import { type QuestionComplexity } from '../../agents/question.agent.ts';
4
- import type { Teachables } from '../../teach/teachables.ts';
5
5
  import { type ExtractedPair, PairProducer } from '../types.ts';
6
6
  import type { Persona } from './persona-generator.ts';
7
7
  export interface SchemaSynthesizerOptions {
8
8
  count: number;
9
9
  complexity?: QuestionComplexity | QuestionComplexity[];
10
10
  personas?: Persona[];
11
- teachings?: Teachables[];
11
+ teachings?: ContextFragment[];
12
12
  model?: AgentModel;
13
13
  concurrency?: number;
14
14
  }
@@ -1 +1 @@
1
- {"version":3,"file":"schema-synthesizer.d.ts","sourceRoot":"","sources":["../../../../src/lib/synthesis/synthesizers/schema-synthesizer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EACL,KAAK,kBAAkB,EAExB,MAAM,gCAAgC,CAAC;AAMxC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,KAAK,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEtD,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,kBAAkB,GAAG,kBAAkB,EAAE,CAAC;IACvD,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;IACrB,SAAS,CAAC,EAAE,UAAU,EAAE,CAAC;IACzB,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AACD;;;;;;GAMG;AACH,qBAAa,iBAAkB,SAAQ,YAAY;;IAU/C,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,OAAO;IANjB;;;OAGG;gBAEO,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,wBAAwB;IAW3C;;;;;OAKG;IACI,OAAO,IAAI,cAAc,CAAC,aAAa,EAAE,CAAC;CAmFlD"}
1
+ {"version":3,"file":"schema-synthesizer.d.ts","sourceRoot":"","sources":["../../../../src/lib/synthesis/synthesizers/schema-synthesizer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EACL,KAAK,kBAAkB,EAExB,MAAM,gCAAgC,CAAC;AAMxC,OAAO,EAAE,KAAK,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEtD,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,kBAAkB,GAAG,kBAAkB,EAAE,CAAC;IACvD,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;IACrB,SAAS,CAAC,EAAE,eAAe,EAAE,CAAC;IAC9B,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AACD;;;;;;GAMG;AACH,qBAAa,iBAAkB,SAAQ,YAAY;;IAU/C,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,OAAO;IANjB;;;OAGG;gBAEO,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,wBAAwB;IAW3C;;;;;OAKG;IACI,OAAO,IAAI,cAAc,CAAC,aAAa,EAAE,CAAC;CAuFlD"}
@@ -1,32 +1,20 @@
1
1
  import type { AgentModel } from '@deepagents/agent';
2
- import type { Adapter } from '../../adapters/adapter.ts';
3
- import type { Teachables } from '../../teach/teachables.ts';
2
+ import { type ContextFragment } from '@deepagents/context';
4
3
  export interface TeachingsGeneratorOptions {
5
4
  context?: string;
6
5
  model?: AgentModel;
6
+ maxRetries?: number;
7
7
  }
8
8
  /**
9
- * TeachingsGenerator - Generate domain-specific teachings from database schema.
10
- *
9
+ * Generate domain-specific teachings from database schema.
11
10
  * Analyzes the schema to generate teachings that improve SQL generation accuracy.
12
11
  * Teachings include domain vocabulary, SQL patterns, guardrails, and examples
13
12
  * that help the SQL generator understand the domain and produce semantically
14
13
  * correct queries.
14
+ *
15
+ * @param schemaFragments - Schema fragments from adapter.introspect()
16
+ * @param options - Generation options including context, model, and maxRetries
17
+ * @returns Array of teachings including vocabulary, patterns, and guardrails
15
18
  */
16
- export declare class TeachingsGenerator {
17
- private adapter;
18
- private options?;
19
- /**
20
- * @param adapter - Database adapter for schema introspection
21
- * @param options - Generation options including context and model
22
- */
23
- constructor(adapter: Adapter, options?: TeachingsGeneratorOptions | undefined);
24
- /**
25
- * Generates domain-specific teachings by analyzing the database schema.
26
- * Retries on transient generation errors up to maxRetries attempts.
27
- * @param maxRetries - Maximum retry attempts for transient failures
28
- * @returns Array of teachings including vocabulary, patterns, and guardrails
29
- */
30
- generate(maxRetries?: number): Promise<Teachables[]>;
31
- }
19
+ export declare function generateTeachings(schemaFragments: ContextFragment[], options?: TeachingsGeneratorOptions): Promise<ContextFragment[]>;
32
20
  //# sourceMappingURL=teachings-generator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"teachings-generator.d.ts","sourceRoot":"","sources":["../../../../src/lib/synthesis/synthesizers/teachings-generator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAEzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE5D,MAAM,WAAW,yBAAyB;IACxC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB;AACD;;;;;;;GAOG;AACH,qBAAa,kBAAkB;IAM3B,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,OAAO,CAAC;IANlB;;;OAGG;gBAEO,OAAO,EAAE,OAAO,EAChB,OAAO,CAAC,EAAE,yBAAyB,YAAA;IAG7C;;;;;OAKG;IACG,QAAQ,CAAC,UAAU,SAAI,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;CA4BtD"}
1
+ {"version":3,"file":"teachings-generator.d.ts","sourceRoot":"","sources":["../../../../src/lib/synthesis/synthesizers/teachings-generator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,KAAK,eAAe,EAAe,MAAM,qBAAqB,CAAC;AAIxE,MAAM,WAAW,yBAAyB;IACxC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,iBAAiB,CACrC,eAAe,EAAE,eAAe,EAAE,EAClC,OAAO,CAAC,EAAE,yBAAyB,GAClC,OAAO,CAAC,eAAe,EAAE,CAAC,CAyB5B"}
@@ -1,4 +1,4 @@
1
- import { type Teachables } from './teachables.ts';
1
+ import { type ContextFragment } from '@deepagents/context';
2
2
  export interface TeachingsOptions {
3
3
  /**
4
4
  * Controls date/time clarification behavior:
@@ -7,5 +7,5 @@ export interface TeachingsOptions {
7
7
  */
8
8
  date?: 'strict' | false;
9
9
  }
10
- export declare function guidelines(options?: TeachingsOptions): Teachables[];
10
+ export declare function guidelines(options?: TeachingsOptions): ContextFragment[];
11
11
  //# sourceMappingURL=teachings.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"teachings.d.ts","sourceRoot":"","sources":["../../../src/lib/teach/teachings.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,UAAU,EAMhB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAC;CACzB;AAED,wBAAgB,UAAU,CAAC,OAAO,GAAE,gBAAqB,GAAG,UAAU,EAAE,CA0JvE"}
1
+ {"version":3,"file":"teachings.d.ts","sourceRoot":"","sources":["../../../src/lib/teach/teachings.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,eAAe,EAMrB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAC;CACzB;AAED,wBAAgB,UAAU,CAAC,OAAO,GAAE,gBAAqB,GAAG,eAAe,EAAE,CA0J5E"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deepagents/text2sql",
3
- "version": "0.10.1",
3
+ "version": "0.11.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -82,8 +82,9 @@
82
82
  },
83
83
  "dependencies": {
84
84
  "@ai-sdk/groq": "2.0.26",
85
- "@deepagents/agent": "0.10.1",
86
- "@deepagents/toolbox": "0.10.1",
85
+ "@deepagents/agent": "0.11.0",
86
+ "@deepagents/context": "0.11.0",
87
+ "@deepagents/toolbox": "0.11.0",
87
88
  "ai": "^5.0.102",
88
89
  "autoevals": "^0.0.131",
89
90
  "dedent": "1.7.0",
@@ -1,50 +0,0 @@
1
- import type { Adapter } from '../adapters/adapter.ts';
2
- import type { TeachablesStore } from '../memory/store.ts';
3
- import type { Teachables } from '../teach/teachables.ts';
4
- export type Chat1State = {
5
- /** Database adapter for query execution */
6
- adapter: Adapter;
7
- /** Schema introspection XML */
8
- introspection: string;
9
- /** Teachings/instructions for SQL generation */
10
- instructions: Teachables[];
11
- /** Combined teachings string for the agent prompt */
12
- teachings: string;
13
- /** Optional memory store for user teachables */
14
- memory?: TeachablesStore;
15
- /** User ID for memory operations */
16
- userId?: string;
17
- };
18
- /**
19
- * Result returned by the query_database tool
20
- */
21
- export interface QueryDatabaseResult {
22
- success: boolean;
23
- /** The generated SQL query */
24
- sql?: string;
25
- /** Query results as array of rows */
26
- data?: unknown[];
27
- /** Error message if generation or execution failed */
28
- error?: string;
29
- /** Number of attempts made during SQL generation */
30
- attempts?: number;
31
- }
32
- declare const tools: {
33
- query_database: import("ai").Tool<{
34
- question: string;
35
- reasoning?: string | undefined;
36
- }, QueryDatabaseResult>;
37
- scratchpad: import("ai").Tool<{
38
- reflection: string;
39
- }, string>;
40
- };
41
- /**
42
- * Chat1 Agent - Table Augmented Generation with combined query tool.
43
- *
44
- * This agent receives user questions and uses the query_database tool
45
- * to fetch data. The SQL generation is delegated to the specialized
46
- * sqlQueryAgent via the toSql() function.
47
- */
48
- export declare const chat1Agent: import("@deepagents/agent").Agent<never, Chat1State, Chat1State>;
49
- export { tools as chat1Tools };
50
- //# sourceMappingURL=chat1.agent.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"chat1.agent.d.ts","sourceRoot":"","sources":["../../../src/lib/agents/chat1.agent.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGzD,MAAM,MAAM,UAAU,GAAG;IACvB,2CAA2C;IAC3C,OAAO,EAAE,OAAO,CAAC;IACjB,+BAA+B;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,gDAAgD;IAChD,YAAY,EAAE,UAAU,EAAE,CAAC;IAC3B,qDAAqD;IACrD,SAAS,EAAE,MAAM,CAAC;IAClB,gDAAgD;IAChD,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,oCAAoC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,8BAA8B;IAC9B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,qCAAqC;IACrC,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC;IACjB,sDAAsD;IACtD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oDAAoD;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,QAAA,MAAM,KAAK;;;;;;;;CA8DV,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,kEAUrB,CAAC;AAEH,OAAO,EAAE,KAAK,IAAI,UAAU,EAAE,CAAC"}
@@ -1,68 +0,0 @@
1
- import type { Adapter } from '../adapters/adapter.ts';
2
- import type { TeachablesStore } from '../memory/store.ts';
3
- import type { Teachables } from '../teach/teachables.ts';
4
- export type Chat2State = {
5
- /** Database adapter for query execution */
6
- adapter: Adapter;
7
- /** Schema introspection XML */
8
- introspection: string;
9
- /** Teachings/instructions for SQL generation */
10
- instructions: Teachables[];
11
- /** Combined teachings string for the agent prompt */
12
- teachings: string;
13
- /** Optional memory store for user teachables */
14
- memory?: TeachablesStore;
15
- /** User ID for memory operations */
16
- userId?: string;
17
- };
18
- /**
19
- * Result returned by the generate_sql tool
20
- */
21
- export interface GenerateSqlToolResult {
22
- success: boolean;
23
- /** The generated and validated SQL query */
24
- sql?: string;
25
- /** Error message if generation failed */
26
- error?: string;
27
- /** Number of attempts made during SQL generation */
28
- attempts?: number;
29
- /** Validation errors encountered during generation */
30
- validationErrors?: string[];
31
- }
32
- /**
33
- * Result returned by the execute_sql tool
34
- */
35
- export interface ExecuteSqlToolResult {
36
- success: boolean;
37
- /** Query results as array of rows */
38
- data?: unknown[];
39
- /** Error message if execution failed */
40
- error?: string;
41
- /** Row count of results */
42
- rowCount?: number;
43
- }
44
- declare const tools: {
45
- generate_sql: import("ai").Tool<{
46
- question: string;
47
- reasoning?: string | undefined;
48
- }, GenerateSqlToolResult>;
49
- execute_sql: import("ai").Tool<{
50
- sql: string;
51
- reasoning?: string | undefined;
52
- }, ExecuteSqlToolResult>;
53
- scratchpad: import("ai").Tool<{
54
- reflection: string;
55
- }, string>;
56
- };
57
- /**
58
- * Chat2 Agent - Table Augmented Generation with peek support.
59
- *
60
- * This agent uses separate generate_sql and execute_sql tools,
61
- * allowing it to review the SQL before execution. This enables:
62
- * - Transparency: Agent knows what SQL will be run
63
- * - Control: Agent can refine before executing
64
- * - Explanation: Agent can describe its approach to the user
65
- */
66
- export declare const chat2Agent: import("@deepagents/agent").Agent<never, Chat2State, Chat2State>;
67
- export { tools as chat2Tools };
68
- //# sourceMappingURL=chat2.agent.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"chat2.agent.d.ts","sourceRoot":"","sources":["../../../src/lib/agents/chat2.agent.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGzD,MAAM,MAAM,UAAU,GAAG;IACvB,2CAA2C;IAC3C,OAAO,EAAE,OAAO,CAAC;IACjB,+BAA+B;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,gDAAgD;IAChD,YAAY,EAAE,UAAU,EAAE,CAAC;IAC3B,qDAAqD;IACrD,SAAS,EAAE,MAAM,CAAC;IAClB,gDAAgD;IAChD,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,oCAAoC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,4CAA4C;IAC5C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oDAAoD;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sDAAsD;IACtD,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,qCAAqC;IACrC,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC;IACjB,wCAAwC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2BAA2B;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,QAAA,MAAM,KAAK;;;;;;;;;;;;CAsGV,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,UAAU,kEAkBrB,CAAC;AAEH,OAAO,EAAE,KAAK,IAAI,UAAU,EAAE,CAAC"}
@@ -1,80 +0,0 @@
1
- import type { Adapter } from '../adapters/adapter.ts';
2
- import type { TeachablesStore } from '../memory/store.ts';
3
- import { type Teachables } from '../teach/teachables.ts';
4
- export type Chat3State = {
5
- /** Database adapter for query execution */
6
- adapter: Adapter;
7
- /** Schema introspection XML */
8
- introspection: string;
9
- /** Teachings/instructions for SQL generation */
10
- instructions: Teachables[];
11
- /** Combined teachings string for the agent prompt */
12
- teachings: string;
13
- /** Optional memory store for user teachables */
14
- memory?: TeachablesStore;
15
- /** User ID for memory operations */
16
- userId?: string;
17
- };
18
- /**
19
- * Result from the collaborative query tool
20
- */
21
- export interface CollaborativeQueryResult {
22
- /** Whether a final SQL was produced */
23
- success: boolean;
24
- /** The generated SQL (if success) */
25
- sql?: string;
26
- /** Query results (if executed) */
27
- data?: unknown[];
28
- /** Confidence level of the SQL */
29
- confidence?: 'high' | 'medium' | 'low';
30
- /** Assumptions made during generation */
31
- assumptions?: string[];
32
- /** Clarification question (if needed) */
33
- clarificationNeeded?: string;
34
- /** Context for clarification */
35
- clarificationContext?: string;
36
- /** Options for clarification */
37
- clarificationOptions?: string[];
38
- /** Reason if unanswerable */
39
- unanswerableReason?: string;
40
- /** Suggested alternatives if unanswerable */
41
- suggestions?: string[];
42
- /** Error message if something failed */
43
- error?: string;
44
- }
45
- declare const tools: {
46
- consult_sql_agent: import("ai").Tool<{
47
- question: string;
48
- context?: string | undefined;
49
- previousClarification?: string | undefined;
50
- }, CollaborativeQueryResult>;
51
- execute_sql: import("ai").Tool<{
52
- sql: string;
53
- }, {
54
- success: boolean;
55
- error: string;
56
- data?: undefined;
57
- rowCount?: undefined;
58
- } | {
59
- success: boolean;
60
- data: any[];
61
- rowCount: number | undefined;
62
- error?: undefined;
63
- }>;
64
- scratchpad: import("ai").Tool<{
65
- reflection: string;
66
- }, string>;
67
- };
68
- /**
69
- * Chat3 Agent - Table Augmented Generation with agent collaboration.
70
- *
71
- * This agent collaborates with a specialized SQL agent that can:
72
- * - Express confidence levels
73
- * - Surface assumptions
74
- * - Request clarification
75
- *
76
- * This enables higher quality SQL generation through dialogue.
77
- */
78
- export declare const chat3Agent: import("@deepagents/agent").Agent<never, Chat3State, Chat3State>;
79
- export { tools as chat3Tools };
80
- //# sourceMappingURL=chat3.agent.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"chat3.agent.d.ts","sourceRoot":"","sources":["../../../src/lib/agents/chat3.agent.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EACL,KAAK,UAAU,EAGhB,MAAM,wBAAwB,CAAC;AAEhC,MAAM,MAAM,UAAU,GAAG;IACvB,2CAA2C;IAC3C,OAAO,EAAE,OAAO,CAAC;IACjB,+BAA+B;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,gDAAgD;IAChD,YAAY,EAAE,UAAU,EAAE,CAAC;IAC3B,qDAAqD;IACrD,SAAS,EAAE,MAAM,CAAC;IAClB,gDAAgD;IAChD,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,oCAAoC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAmFF;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,uCAAuC;IACvC,OAAO,EAAE,OAAO,CAAC;IACjB,qCAAqC;IACrC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,kCAAkC;IAClC,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC;IACjB,kCAAkC;IAClC,UAAU,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;IACvC,yCAAyC;IACzC,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,yCAAyC;IACzC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,gCAAgC;IAChC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,gCAAgC;IAChC,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,6BAA6B;IAC7B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,wCAAwC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,QAAA,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;CA8JV,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU,kEAoBrB,CAAC;AAEH,OAAO,EAAE,KAAK,IAAI,UAAU,EAAE,CAAC"}
@@ -1,88 +0,0 @@
1
- import z from 'zod';
2
- import type { Adapter } from '../adapters/adapter.ts';
3
- import type { TeachablesStore } from '../memory/store.ts';
4
- import { type Teachables } from '../teach/teachables.ts';
5
- export type Chat4State = {
6
- /** Database adapter for query execution */
7
- adapter: Adapter;
8
- /** Schema introspection XML */
9
- introspection: string;
10
- /** Teachings/instructions for SQL generation */
11
- instructions: Teachables[];
12
- /** Combined teachings string for the agent prompt */
13
- teachings: string;
14
- /** Optional memory store for user teachables */
15
- memory?: TeachablesStore;
16
- /** User ID for memory operations */
17
- userId?: string;
18
- };
19
- /**
20
- * Schema for question decomposition
21
- */
22
- declare const questionDecompositionSchema: z.ZodObject<{
23
- originalQuestion: z.ZodString;
24
- breakdown: z.ZodArray<z.ZodString>;
25
- entities: z.ZodOptional<z.ZodArray<z.ZodString>>;
26
- filters: z.ZodOptional<z.ZodArray<z.ZodString>>;
27
- aggregation: z.ZodOptional<z.ZodString>;
28
- ambiguities: z.ZodOptional<z.ZodArray<z.ZodString>>;
29
- }, z.core.$strip>;
30
- type QuestionDecomposition = z.infer<typeof questionDecompositionSchema>;
31
- /**
32
- * Result from the decomposed query tool
33
- */
34
- export interface DecomposedQueryResult {
35
- success: boolean;
36
- /** The original question */
37
- question?: string;
38
- /** How the question was decomposed */
39
- decomposition?: QuestionDecomposition;
40
- /** The generated SQL */
41
- sql?: string;
42
- /** Query results */
43
- data?: unknown[];
44
- /** How breakdown components were addressed */
45
- reasoning?: string;
46
- /** Error message if failed */
47
- error?: string;
48
- /** Number of generation attempts */
49
- attempts?: number;
50
- }
51
- declare const tools: {
52
- query_with_decomposition: import("ai").Tool<{
53
- question: string;
54
- breakdown: string[];
55
- entities?: string[] | undefined;
56
- filters?: string[] | undefined;
57
- aggregation?: string | undefined;
58
- ambiguities?: string[] | undefined;
59
- }, DecomposedQueryResult>;
60
- execute_sql: import("ai").Tool<{
61
- sql: string;
62
- }, {
63
- success: boolean;
64
- error: string;
65
- data?: undefined;
66
- rowCount?: undefined;
67
- } | {
68
- success: boolean;
69
- data: any[];
70
- rowCount: number | undefined;
71
- error?: undefined;
72
- }>;
73
- scratchpad: import("ai").Tool<{
74
- reflection: string;
75
- }, string>;
76
- };
77
- /**
78
- * Chat4 Agent - Table Augmented Generation with question decomposition.
79
- *
80
- * This agent breaks down questions into semantic components before
81
- * generating SQL. This approach:
82
- * - Ensures all aspects of the question are addressed
83
- * - Makes the reasoning explicit
84
- * - Helps with complex multi-part questions
85
- */
86
- export declare const chat4Agent: import("@deepagents/agent").Agent<never, Chat4State, Chat4State>;
87
- export { tools as chat4Tools };
88
- //# sourceMappingURL=chat4.agent.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"chat4.agent.d.ts","sourceRoot":"","sources":["../../../src/lib/agents/chat4.agent.ts"],"names":[],"mappings":"AAkBA,OAAO,CAAC,MAAM,KAAK,CAAC;AAKpB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EACL,KAAK,UAAU,EAGhB,MAAM,wBAAwB,CAAC;AAEhC,MAAM,MAAM,UAAU,GAAG;IACvB,2CAA2C;IAC3C,OAAO,EAAE,OAAO,CAAC;IACjB,+BAA+B;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,gDAAgD;IAChD,YAAY,EAAE,UAAU,EAAE,CAAC;IAC3B,qDAAqD;IACrD,SAAS,EAAE,MAAM,CAAC;IAClB,gDAAgD;IAChD,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,oCAAoC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;GAEG;AACH,QAAA,MAAM,2BAA2B;;;;;;;iBAgC/B,CAAC;AAEH,KAAK,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAwDzE;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,4BAA4B;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sCAAsC;IACtC,aAAa,CAAC,EAAE,qBAAqB,CAAC;IACtC,wBAAwB;IACxB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,oBAAoB;IACpB,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC;IACjB,8CAA8C;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8BAA8B;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oCAAoC;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAKD,QAAA,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;CAiLV,CAAC;AAyCF;;;;;;;;GAQG;AACH,eAAO,MAAM,UAAU,kEA2BrB,CAAC;AAEH,OAAO,EAAE,KAAK,IAAI,UAAU,EAAE,CAAC"}
@@ -1,41 +0,0 @@
1
- import type { UIMessage } from 'ai';
2
- export interface Message {
3
- id: string;
4
- chatId: string;
5
- role: string;
6
- createdAt: string | Date;
7
- content: UIMessage;
8
- }
9
- export interface Chat {
10
- id: string;
11
- userId: string;
12
- title?: string | null;
13
- messages: Message[];
14
- }
15
- export interface CreateChatParams {
16
- id: string;
17
- userId: string;
18
- title?: string;
19
- }
20
- export interface UpdateChatParams {
21
- title?: string;
22
- }
23
- export interface CreateMessageParams {
24
- id: string;
25
- chatId: string;
26
- role: string;
27
- content: UIMessage;
28
- createdAt?: Date;
29
- }
30
- export declare abstract class History {
31
- abstract listChats(userId: string): Promise<Chat[]>;
32
- abstract getChat(chatId: string): Promise<Chat | null>;
33
- abstract createChat(chat: CreateChatParams): Promise<Chat>;
34
- abstract upsertChat(chat: CreateChatParams): Promise<Chat>;
35
- abstract deleteChat(chatId: string): Promise<void>;
36
- abstract updateChat(chatId: string, updates: UpdateChatParams): Promise<void>;
37
- abstract addMessage(message: CreateMessageParams): Promise<void>;
38
- abstract upsertMessage(message: CreateMessageParams): Promise<Message>;
39
- abstract deleteMessage(messageId: string): Promise<void>;
40
- }
41
- //# sourceMappingURL=history.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../../src/lib/history/history.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAEpC,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,SAAS,CAAC;CACpB;AAED,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,EAAE,OAAO,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,SAAS,CAAC;IACnB,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB;AAED,8BAAsB,OAAO;IAC3B,QAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IACnD,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;IACtD,QAAQ,CAAC,UAAU,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAC1D,QAAQ,CAAC,UAAU,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAC1D,QAAQ,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAClD,QAAQ,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAC7E,QAAQ,CAAC,UAAU,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAChE,QAAQ,CAAC,aAAa,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;IACtE,QAAQ,CAAC,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CACzD"}
@@ -1,5 +0,0 @@
1
- import { SqliteHistory } from './sqlite.history.ts';
2
- export declare class InMemoryHistory extends SqliteHistory {
3
- constructor();
4
- }
5
- //# sourceMappingURL=memory.history.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"memory.history.d.ts","sourceRoot":"","sources":["../../../src/lib/history/memory.history.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,qBAAa,eAAgB,SAAQ,aAAa;;CAIjD"}
@@ -1,15 +0,0 @@
1
- import { type Chat, type CreateChatParams, type CreateMessageParams, History, type Message, type UpdateChatParams } from './history.ts';
2
- export declare class SqliteHistory extends History {
3
- #private;
4
- constructor(path: string);
5
- listChats(userId: string): Promise<Chat[]>;
6
- getChat(chatId: string): Promise<Chat | null>;
7
- createChat(chat: CreateChatParams): Promise<Chat>;
8
- upsertChat(chat: CreateChatParams): Promise<Chat>;
9
- deleteChat(chatId: string): Promise<void>;
10
- updateChat(chatId: string, updates: UpdateChatParams): Promise<void>;
11
- addMessage(message: CreateMessageParams): Promise<void>;
12
- upsertMessage(message: CreateMessageParams): Promise<Message>;
13
- deleteMessage(messageId: string): Promise<void>;
14
- }
15
- //# sourceMappingURL=sqlite.history.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sqlite.history.d.ts","sourceRoot":"","sources":["../../../src/lib/history/sqlite.history.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,IAAI,EACT,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,OAAO,EACP,KAAK,OAAO,EACZ,KAAK,gBAAgB,EACtB,MAAM,cAAc,CAAC;AAEtB,qBAAa,aAAc,SAAQ,OAAO;;gBAG5B,IAAI,EAAE,MAAM;IAMlB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAM1C,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;IA8C7C,UAAU,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAOjD,UAAU,CAAC,IAAI,EAAE,gBAAgB;IAUjC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIzC,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAQpE,UAAU,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAiBvD,aAAa,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;IAsB7D,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGtD"}
@@ -1,3 +0,0 @@
1
- declare const _default: string;
2
- export default _default;
3
- //# sourceMappingURL=memory.prompt.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"memory.prompt.d.ts","sourceRoot":"","sources":["../../../src/lib/memory/memory.prompt.ts"],"names":[],"mappings":";AAUA,wBA4JE"}
@@ -1,5 +0,0 @@
1
- import { SqliteTeachablesStore } from './sqlite.store.ts';
2
- export declare class InMemoryTeachablesStore extends SqliteTeachablesStore {
3
- constructor();
4
- }
5
- //# sourceMappingURL=memory.store.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"memory.store.d.ts","sourceRoot":"","sources":["../../../src/lib/memory/memory.store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,qBAAa,uBAAwB,SAAQ,qBAAqB;;CAIjE"}
@@ -1,14 +0,0 @@
1
- import { type GeneratedTeachable, type Teachables } from '../teach/teachables.ts';
2
- import { type StoredTeachable, TeachablesStore } from './store.ts';
3
- export declare class SqliteTeachablesStore extends TeachablesStore {
4
- #private;
5
- constructor(path: string);
6
- remember(userId: string, data: GeneratedTeachable): Promise<StoredTeachable>;
7
- recall(userId: string, type?: GeneratedTeachable['type']): Promise<StoredTeachable[]>;
8
- get(id: string): Promise<StoredTeachable | null>;
9
- update(id: string, data: GeneratedTeachable): Promise<StoredTeachable>;
10
- forget(id: string): Promise<void>;
11
- forgetAll(userId: string): Promise<void>;
12
- toTeachables(userId: string): Promise<Teachables[]>;
13
- }
14
- //# sourceMappingURL=sqlite.store.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sqlite.store.d.ts","sourceRoot":"","sources":["../../../src/lib/memory/sqlite.store.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,UAAU,EAEhB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,KAAK,eAAe,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAsBnE,qBAAa,qBAAsB,SAAQ,eAAe;;gBAG5C,IAAI,EAAE,MAAM;IAMlB,QAAQ,CACZ,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,kBAAkB,GACvB,OAAO,CAAC,eAAe,CAAC;IAarB,MAAM,CACV,MAAM,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,kBAAkB,CAAC,MAAM,CAAC,GAChC,OAAO,CAAC,eAAe,EAAE,CAAC;IAkBvB,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC;IAShD,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,eAAe,CAAC;IAYtE,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjC,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIxC,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;CAI1D"}
@@ -1,40 +0,0 @@
1
- import type { GeneratedTeachable, Teachables } from '../teach/teachables.ts';
2
- export interface StoredTeachable {
3
- id: string;
4
- userId: string;
5
- type: GeneratedTeachable['type'];
6
- data: GeneratedTeachable;
7
- createdAt: string;
8
- updatedAt: string;
9
- }
10
- export declare abstract class TeachablesStore {
11
- /**
12
- * Remember a teachable for a user.
13
- */
14
- abstract remember(userId: string, data: GeneratedTeachable): Promise<StoredTeachable>;
15
- /**
16
- * Recall teachables for a user, optionally filtered by type.
17
- */
18
- abstract recall(userId: string, type?: GeneratedTeachable['type']): Promise<StoredTeachable[]>;
19
- /**
20
- * Get a specific teachable by ID.
21
- */
22
- abstract get(id: string): Promise<StoredTeachable | null>;
23
- /**
24
- * Update an existing teachable.
25
- */
26
- abstract update(id: string, data: GeneratedTeachable): Promise<StoredTeachable>;
27
- /**
28
- * Forget (remove) a specific teachable by ID.
29
- */
30
- abstract forget(id: string): Promise<void>;
31
- /**
32
- * Forget all teachables for a user.
33
- */
34
- abstract forgetAll(userId: string): Promise<void>;
35
- /**
36
- * Convert stored teachables to Teachables array for use with toInstructions().
37
- */
38
- abstract toTeachables(userId: string): Promise<Teachables[]>;
39
- }
40
- //# sourceMappingURL=store.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/lib/memory/store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAE7E,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,kBAAkB,CAAC,MAAM,CAAC,CAAC;IACjC,IAAI,EAAE,kBAAkB,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,8BAAsB,eAAe;IACnC;;OAEG;IACH,QAAQ,CAAC,QAAQ,CACf,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,kBAAkB,GACvB,OAAO,CAAC,eAAe,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,MAAM,CACb,MAAM,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,kBAAkB,CAAC,MAAM,CAAC,GAChC,OAAO,CAAC,eAAe,EAAE,CAAC;IAE7B;;OAEG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC;IAEzD;;OAEG;IACH,QAAQ,CAAC,MAAM,CACb,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,kBAAkB,GACvB,OAAO,CAAC,eAAe,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAE1C;;OAEG;IACH,QAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAEjD;;OAEG;IACH,QAAQ,CAAC,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;CAC7D"}