ai-database 2.0.2 → 2.1.3

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 (114) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/LICENSE +21 -0
  3. package/README.md +667 -1
  4. package/dist/actions.d.ts +247 -0
  5. package/dist/actions.d.ts.map +1 -0
  6. package/dist/actions.js +260 -0
  7. package/dist/actions.js.map +1 -0
  8. package/dist/ai-promise-db.d.ts +37 -2
  9. package/dist/ai-promise-db.d.ts.map +1 -1
  10. package/dist/ai-promise-db.js +530 -92
  11. package/dist/ai-promise-db.js.map +1 -1
  12. package/dist/constants.d.ts +16 -0
  13. package/dist/constants.d.ts.map +1 -0
  14. package/dist/constants.js +16 -0
  15. package/dist/constants.js.map +1 -0
  16. package/dist/events.d.ts +153 -0
  17. package/dist/events.d.ts.map +1 -0
  18. package/dist/events.js +154 -0
  19. package/dist/events.js.map +1 -0
  20. package/dist/index.d.ts +11 -2
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +20 -2
  23. package/dist/index.js.map +1 -1
  24. package/dist/memory-provider.d.ts +145 -2
  25. package/dist/memory-provider.d.ts.map +1 -1
  26. package/dist/memory-provider.js +569 -13
  27. package/dist/memory-provider.js.map +1 -1
  28. package/dist/schema/cascade.d.ts +104 -0
  29. package/dist/schema/cascade.d.ts.map +1 -0
  30. package/dist/schema/cascade.js +547 -0
  31. package/dist/schema/cascade.js.map +1 -0
  32. package/dist/schema/dependency-graph.d.ts +133 -0
  33. package/dist/schema/dependency-graph.d.ts.map +1 -0
  34. package/dist/schema/dependency-graph.js +355 -0
  35. package/dist/schema/dependency-graph.js.map +1 -0
  36. package/dist/schema/generation-context.d.ts +202 -0
  37. package/dist/schema/generation-context.d.ts.map +1 -0
  38. package/dist/schema/generation-context.js +393 -0
  39. package/dist/schema/generation-context.js.map +1 -0
  40. package/dist/schema/index.d.ts +201 -0
  41. package/dist/schema/index.d.ts.map +1 -0
  42. package/dist/schema/index.js +1221 -0
  43. package/dist/schema/index.js.map +1 -0
  44. package/dist/schema/parse.d.ts +225 -0
  45. package/dist/schema/parse.d.ts.map +1 -0
  46. package/dist/schema/parse.js +740 -0
  47. package/dist/schema/parse.js.map +1 -0
  48. package/dist/schema/provider.d.ts +177 -0
  49. package/dist/schema/provider.d.ts.map +1 -0
  50. package/dist/schema/provider.js +258 -0
  51. package/dist/schema/provider.js.map +1 -0
  52. package/dist/schema/resolve.d.ts +87 -0
  53. package/dist/schema/resolve.d.ts.map +1 -0
  54. package/dist/schema/resolve.js +549 -0
  55. package/dist/schema/resolve.js.map +1 -0
  56. package/dist/schema/semantic.d.ts +54 -0
  57. package/dist/schema/semantic.d.ts.map +1 -0
  58. package/dist/schema/semantic.js +335 -0
  59. package/dist/schema/semantic.js.map +1 -0
  60. package/dist/schema/types.d.ts +528 -0
  61. package/dist/schema/types.d.ts.map +1 -0
  62. package/dist/schema/types.js +9 -0
  63. package/dist/schema/types.js.map +1 -0
  64. package/dist/schema/union-fallback.d.ts +219 -0
  65. package/dist/schema/union-fallback.d.ts.map +1 -0
  66. package/dist/schema/union-fallback.js +325 -0
  67. package/dist/schema/union-fallback.js.map +1 -0
  68. package/dist/schema/verb-derivation.d.ts +167 -0
  69. package/dist/schema/verb-derivation.d.ts.map +1 -0
  70. package/dist/schema/verb-derivation.js +281 -0
  71. package/dist/schema/verb-derivation.js.map +1 -0
  72. package/dist/schema.d.ts +25 -867
  73. package/dist/schema.d.ts.map +1 -1
  74. package/dist/schema.js +45 -1124
  75. package/dist/schema.js.map +1 -1
  76. package/dist/semantic.d.ts +175 -0
  77. package/dist/semantic.d.ts.map +1 -0
  78. package/dist/semantic.js +338 -0
  79. package/dist/semantic.js.map +1 -0
  80. package/dist/type-guards.d.ts +167 -0
  81. package/dist/type-guards.d.ts.map +1 -0
  82. package/dist/type-guards.js +247 -0
  83. package/dist/type-guards.js.map +1 -0
  84. package/dist/types.d.ts +14 -0
  85. package/dist/types.d.ts.map +1 -1
  86. package/dist/types.js.map +1 -1
  87. package/dist/validation.d.ts +168 -0
  88. package/dist/validation.d.ts.map +1 -0
  89. package/dist/validation.js +667 -0
  90. package/dist/validation.js.map +1 -0
  91. package/package.json +21 -12
  92. package/.turbo/turbo-build.log +0 -5
  93. package/TESTING.md +0 -410
  94. package/TEST_SUMMARY.md +0 -250
  95. package/TODO.md +0 -128
  96. package/src/ai-promise-db.ts +0 -1243
  97. package/src/authorization.ts +0 -1102
  98. package/src/durable-clickhouse.ts +0 -596
  99. package/src/durable-promise.ts +0 -582
  100. package/src/execution-queue.ts +0 -608
  101. package/src/index.test.ts +0 -868
  102. package/src/index.ts +0 -337
  103. package/src/linguistic.ts +0 -404
  104. package/src/memory-provider.test.ts +0 -1036
  105. package/src/memory-provider.ts +0 -1119
  106. package/src/schema.test.ts +0 -1254
  107. package/src/schema.ts +0 -2296
  108. package/src/tests.ts +0 -725
  109. package/src/types.ts +0 -1177
  110. package/test/README.md +0 -153
  111. package/test/edge-cases.test.ts +0 -646
  112. package/test/provider-resolution.test.ts +0 -402
  113. package/tsconfig.json +0 -9
  114. package/vitest.config.ts +0 -19
package/CHANGELOG.md CHANGED
@@ -1,5 +1,53 @@
1
1
  # ai-database
2
2
 
3
+ ## 2.1.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Documentation and testing improvements
8
+ - Add deterministic AI testing suite with self-validating patterns
9
+ - Apply StoryBrand narrative to all package READMEs
10
+ - Update TESTING.md with four principles of deterministic AI testing
11
+ - Fix duplicate examples package name conflict
12
+
13
+ - Updated dependencies
14
+ - ai-functions@2.1.3
15
+
16
+ ## 2.1.1
17
+
18
+ ### Patch Changes
19
+
20
+ - 6beb531: Add TDD RED phase tests for type system unification
21
+ - ai-functions: Add tests for AIFunction<Output, Input> generic order flip
22
+ - ai-workflows: Add tests for EventHandler<TOutput, TInput> order and OnProxy/EveryProxy autocomplete
23
+ - ai-database: Existing package - no changes in this release
24
+ - @primitives/types: New shared types package with failing tests for RED phase
25
+
26
+ These tests document the expected behavior for the GREEN phase implementation where generic type parameters will be reordered to put Output first (matching Promise<T> convention).
27
+
28
+ - Updated dependencies [6beb531]
29
+ - ai-functions@2.1.1
30
+
31
+ ## 2.1.0
32
+
33
+ ### Minor Changes
34
+
35
+ - **Natural Language Query Execution**: Wire up tagged template literal handler (`db.Lead\`query\``) and `db.ask()`method for natural language database queries. Supports AI-powered query generation via`setNLQueryGenerator()` with fallback to keyword search.
36
+
37
+ - **Schema Input Validation**: Comprehensive validation for entity names, field names, field types, and operator syntax. Prevents SQL injection, XSS, and provides helpful error messages. Throws `SchemaValidationError` with error codes and paths for programmatic handling.
38
+
39
+ ### Patch Changes
40
+
41
+ - Fixed TypeScript build error in parse.ts operator validation
42
+
43
+ ## 2.0.3
44
+
45
+ ### Patch Changes
46
+
47
+ - Updated dependencies
48
+ - rpc.do@0.2.0
49
+ - ai-functions@2.0.3
50
+
3
51
  ## 2.0.2
4
52
 
5
53
  ### Patch Changes
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 .org.ai
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.