agentlang 0.10.1 → 0.10.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 (178) hide show
  1. package/README.md +7 -14
  2. package/out/api/http.d.ts +4 -0
  3. package/out/api/http.d.ts.map +1 -1
  4. package/out/api/http.js +307 -26
  5. package/out/api/http.js.map +1 -1
  6. package/out/cli/main.d.ts.map +1 -1
  7. package/out/cli/main.js +3 -0
  8. package/out/cli/main.js.map +1 -1
  9. package/out/extension/main.cjs +250 -250
  10. package/out/extension/main.cjs.map +2 -2
  11. package/out/language/agentlang-validator.d.ts.map +1 -1
  12. package/out/language/agentlang-validator.js +4 -0
  13. package/out/language/agentlang-validator.js.map +1 -1
  14. package/out/language/error-reporter.d.ts +53 -0
  15. package/out/language/error-reporter.d.ts.map +1 -0
  16. package/out/language/error-reporter.js +879 -0
  17. package/out/language/error-reporter.js.map +1 -0
  18. package/out/language/generated/ast.d.ts +77 -2
  19. package/out/language/generated/ast.d.ts.map +1 -1
  20. package/out/language/generated/ast.js +60 -0
  21. package/out/language/generated/ast.js.map +1 -1
  22. package/out/language/generated/grammar.d.ts.map +1 -1
  23. package/out/language/generated/grammar.js +342 -206
  24. package/out/language/generated/grammar.js.map +1 -1
  25. package/out/language/main.cjs +901 -710
  26. package/out/language/main.cjs.map +3 -3
  27. package/out/language/parser.d.ts +4 -2
  28. package/out/language/parser.d.ts.map +1 -1
  29. package/out/language/parser.js +58 -99
  30. package/out/language/parser.js.map +1 -1
  31. package/out/language/syntax.d.ts +16 -0
  32. package/out/language/syntax.d.ts.map +1 -1
  33. package/out/language/syntax.js +66 -27
  34. package/out/language/syntax.js.map +1 -1
  35. package/out/runtime/api.d.ts +2 -0
  36. package/out/runtime/api.d.ts.map +1 -1
  37. package/out/runtime/api.js +25 -0
  38. package/out/runtime/api.js.map +1 -1
  39. package/out/runtime/datefns.d.ts +34 -0
  40. package/out/runtime/datefns.d.ts.map +1 -0
  41. package/out/runtime/datefns.js +82 -0
  42. package/out/runtime/datefns.js.map +1 -0
  43. package/out/runtime/defs.d.ts +1 -0
  44. package/out/runtime/defs.d.ts.map +1 -1
  45. package/out/runtime/defs.js +2 -1
  46. package/out/runtime/defs.js.map +1 -1
  47. package/out/runtime/document-retriever.d.ts +24 -0
  48. package/out/runtime/document-retriever.d.ts.map +1 -0
  49. package/out/runtime/document-retriever.js +258 -0
  50. package/out/runtime/document-retriever.js.map +1 -0
  51. package/out/runtime/embeddings/chunker.d.ts +18 -0
  52. package/out/runtime/embeddings/chunker.d.ts.map +1 -1
  53. package/out/runtime/embeddings/chunker.js +47 -15
  54. package/out/runtime/embeddings/chunker.js.map +1 -1
  55. package/out/runtime/embeddings/openai.d.ts.map +1 -1
  56. package/out/runtime/embeddings/openai.js +22 -9
  57. package/out/runtime/embeddings/openai.js.map +1 -1
  58. package/out/runtime/embeddings/provider.d.ts +1 -0
  59. package/out/runtime/embeddings/provider.d.ts.map +1 -1
  60. package/out/runtime/embeddings/provider.js +20 -1
  61. package/out/runtime/embeddings/provider.js.map +1 -1
  62. package/out/runtime/exec-graph.d.ts.map +1 -1
  63. package/out/runtime/exec-graph.js +22 -3
  64. package/out/runtime/exec-graph.js.map +1 -1
  65. package/out/runtime/integration-client.d.ts +21 -0
  66. package/out/runtime/integration-client.d.ts.map +1 -0
  67. package/out/runtime/integration-client.js +112 -0
  68. package/out/runtime/integration-client.js.map +1 -0
  69. package/out/runtime/integrations.d.ts.map +1 -1
  70. package/out/runtime/integrations.js +20 -9
  71. package/out/runtime/integrations.js.map +1 -1
  72. package/out/runtime/interpreter.d.ts +10 -0
  73. package/out/runtime/interpreter.d.ts.map +1 -1
  74. package/out/runtime/interpreter.js +221 -22
  75. package/out/runtime/interpreter.js.map +1 -1
  76. package/out/runtime/loader.d.ts.map +1 -1
  77. package/out/runtime/loader.js +70 -7
  78. package/out/runtime/loader.js.map +1 -1
  79. package/out/runtime/logger.d.ts.map +1 -1
  80. package/out/runtime/logger.js +8 -1
  81. package/out/runtime/logger.js.map +1 -1
  82. package/out/runtime/module.d.ts +18 -0
  83. package/out/runtime/module.d.ts.map +1 -1
  84. package/out/runtime/module.js +91 -3
  85. package/out/runtime/module.js.map +1 -1
  86. package/out/runtime/modules/ai.d.ts +16 -5
  87. package/out/runtime/modules/ai.d.ts.map +1 -1
  88. package/out/runtime/modules/ai.js +286 -88
  89. package/out/runtime/modules/ai.js.map +1 -1
  90. package/out/runtime/modules/core.d.ts.map +1 -1
  91. package/out/runtime/modules/core.js +5 -1
  92. package/out/runtime/modules/core.js.map +1 -1
  93. package/out/runtime/monitor.d.ts +6 -0
  94. package/out/runtime/monitor.d.ts.map +1 -1
  95. package/out/runtime/monitor.js +21 -1
  96. package/out/runtime/monitor.js.map +1 -1
  97. package/out/runtime/relgraph.d.ts.map +1 -1
  98. package/out/runtime/relgraph.js +7 -3
  99. package/out/runtime/relgraph.js.map +1 -1
  100. package/out/runtime/resolvers/interface.d.ts +7 -2
  101. package/out/runtime/resolvers/interface.d.ts.map +1 -1
  102. package/out/runtime/resolvers/interface.js +17 -3
  103. package/out/runtime/resolvers/interface.js.map +1 -1
  104. package/out/runtime/resolvers/sqldb/database.d.ts +2 -0
  105. package/out/runtime/resolvers/sqldb/database.d.ts.map +1 -1
  106. package/out/runtime/resolvers/sqldb/database.js +142 -126
  107. package/out/runtime/resolvers/sqldb/database.js.map +1 -1
  108. package/out/runtime/resolvers/sqldb/dbutil.d.ts.map +1 -1
  109. package/out/runtime/resolvers/sqldb/dbutil.js +25 -4
  110. package/out/runtime/resolvers/sqldb/dbutil.js.map +1 -1
  111. package/out/runtime/resolvers/sqldb/impl.d.ts +2 -1
  112. package/out/runtime/resolvers/sqldb/impl.d.ts.map +1 -1
  113. package/out/runtime/resolvers/sqldb/impl.js +24 -7
  114. package/out/runtime/resolvers/sqldb/impl.js.map +1 -1
  115. package/out/runtime/resolvers/vector/lancedb-store.d.ts +16 -0
  116. package/out/runtime/resolvers/vector/lancedb-store.d.ts.map +1 -0
  117. package/out/runtime/resolvers/vector/lancedb-store.js +159 -0
  118. package/out/runtime/resolvers/vector/lancedb-store.js.map +1 -0
  119. package/out/runtime/resolvers/vector/types.d.ts +32 -0
  120. package/out/runtime/resolvers/vector/types.d.ts.map +1 -0
  121. package/out/runtime/resolvers/vector/types.js +2 -0
  122. package/out/runtime/resolvers/vector/types.js.map +1 -0
  123. package/out/runtime/services/documentFetcher.d.ts.map +1 -1
  124. package/out/runtime/services/documentFetcher.js +21 -6
  125. package/out/runtime/services/documentFetcher.js.map +1 -1
  126. package/out/runtime/state.d.ts +19 -1
  127. package/out/runtime/state.d.ts.map +1 -1
  128. package/out/runtime/state.js +36 -1
  129. package/out/runtime/state.js.map +1 -1
  130. package/out/runtime/util.d.ts +3 -2
  131. package/out/runtime/util.d.ts.map +1 -1
  132. package/out/runtime/util.js +13 -2
  133. package/out/runtime/util.js.map +1 -1
  134. package/out/syntaxes/agentlang.monarch.js +1 -1
  135. package/out/syntaxes/agentlang.monarch.js.map +1 -1
  136. package/out/test-harness.d.ts +36 -0
  137. package/out/test-harness.d.ts.map +1 -0
  138. package/out/test-harness.js +341 -0
  139. package/out/test-harness.js.map +1 -0
  140. package/package.json +22 -19
  141. package/src/api/http.ts +336 -38
  142. package/src/cli/main.ts +3 -0
  143. package/src/language/agentlang-validator.ts +3 -0
  144. package/src/language/agentlang.langium +6 -2
  145. package/src/language/error-reporter.ts +1028 -0
  146. package/src/language/generated/ast.ts +94 -1
  147. package/src/language/generated/grammar.ts +342 -206
  148. package/src/language/parser.ts +64 -101
  149. package/src/language/syntax.ts +79 -24
  150. package/src/runtime/api.ts +36 -0
  151. package/src/runtime/datefns.ts +112 -0
  152. package/src/runtime/defs.ts +2 -1
  153. package/src/runtime/document-retriever.ts +311 -0
  154. package/src/runtime/embeddings/chunker.ts +52 -14
  155. package/src/runtime/embeddings/openai.ts +27 -9
  156. package/src/runtime/embeddings/provider.ts +22 -1
  157. package/src/runtime/exec-graph.ts +23 -2
  158. package/src/runtime/integration-client.ts +158 -0
  159. package/src/runtime/integrations.ts +20 -11
  160. package/src/runtime/interpreter.ts +221 -15
  161. package/src/runtime/loader.ts +83 -5
  162. package/src/runtime/logger.ts +12 -1
  163. package/src/runtime/module.ts +104 -3
  164. package/src/runtime/modules/ai.ts +341 -107
  165. package/src/runtime/modules/core.ts +5 -1
  166. package/src/runtime/monitor.ts +27 -1
  167. package/src/runtime/relgraph.ts +7 -3
  168. package/src/runtime/resolvers/interface.ts +23 -3
  169. package/src/runtime/resolvers/sqldb/database.ts +158 -130
  170. package/src/runtime/resolvers/sqldb/dbutil.ts +28 -6
  171. package/src/runtime/resolvers/sqldb/impl.ts +25 -7
  172. package/src/runtime/resolvers/vector/lancedb-store.ts +187 -0
  173. package/src/runtime/resolvers/vector/types.ts +39 -0
  174. package/src/runtime/services/documentFetcher.ts +21 -6
  175. package/src/runtime/state.ts +40 -1
  176. package/src/runtime/util.ts +19 -2
  177. package/src/syntaxes/agentlang.monarch.ts +1 -1
  178. package/src/test-harness.ts +423 -0
@@ -49,6 +49,7 @@ export type AgentlangKeywordNames =
49
49
  | "@catch"
50
50
  | "@desc"
51
51
  | "@distinct"
52
+ | "@empty"
52
53
  | "@enum"
53
54
  | "@expr"
54
55
  | "@from"
@@ -58,7 +59,9 @@ export type AgentlangKeywordNames =
58
59
  | "@into"
59
60
  | "@join"
60
61
  | "@left_join"
62
+ | "@limit"
61
63
  | "@meta"
64
+ | "@offset"
62
65
  | "@oneof"
63
66
  | "@orderBy"
64
67
  | "@public"
@@ -586,6 +589,21 @@ export function isElse(item: unknown): item is Else {
586
589
  return reflection.isInstance(item, Else.$type);
587
590
  }
588
591
 
592
+ export interface EmptySpec extends langium.AstNode {
593
+ readonly $container: RuntimeHint;
594
+ readonly $type: 'EmptySpec';
595
+ stmt: Statement;
596
+ }
597
+
598
+ export const EmptySpec = {
599
+ $type: 'EmptySpec',
600
+ stmt: 'stmt'
601
+ } as const;
602
+
603
+ export function isEmptySpec(item: unknown): item is EmptySpec {
604
+ return reflection.isInstance(item, EmptySpec.$type);
605
+ }
606
+
589
607
  export interface EntityActionsDefinitions extends langium.AstNode {
590
608
  readonly $container: RecordExtraDefinition;
591
609
  readonly $type: 'EntityActionsDefinitions';
@@ -1013,6 +1031,21 @@ export function isKvPairs(item: unknown): item is KvPairs {
1013
1031
  return reflection.isInstance(item, KvPairs.$type);
1014
1032
  }
1015
1033
 
1034
+ export interface LimitClause extends langium.AstNode {
1035
+ readonly $container: QueryOption;
1036
+ readonly $type: 'LimitClause';
1037
+ value: number;
1038
+ }
1039
+
1040
+ export const LimitClause = {
1041
+ $type: 'LimitClause',
1042
+ value: 'value'
1043
+ } as const;
1044
+
1045
+ export function isLimitClause(item: unknown): item is LimitClause {
1046
+ return reflection.isInstance(item, LimitClause.$type);
1047
+ }
1048
+
1016
1049
  export interface Literal extends langium.AstNode {
1017
1050
  readonly $container: AttributeDefinition | BinExpr | CaseEntry | CrudMap | FnCall | FullTextSearch | GenericPropertyDef | Group | If | KvPair | MapEntry | NegExpr | NotExpr | Pattern | SetAttribute | ThrowError | WhereSpecClause;
1018
1051
  readonly $type: 'Literal';
@@ -1175,6 +1208,21 @@ export function isNotExpr(item: unknown): item is NotExpr {
1175
1208
  return reflection.isInstance(item, NotExpr.$type);
1176
1209
  }
1177
1210
 
1211
+ export interface OffsetClause extends langium.AstNode {
1212
+ readonly $container: QueryOption;
1213
+ readonly $type: 'OffsetClause';
1214
+ value: number;
1215
+ }
1216
+
1217
+ export const OffsetClause = {
1218
+ $type: 'OffsetClause',
1219
+ value: 'value'
1220
+ } as const;
1221
+
1222
+ export function isOffsetClause(item: unknown): item is OffsetClause {
1223
+ return reflection.isInstance(item, OffsetClause.$type);
1224
+ }
1225
+
1178
1226
  export interface OneOfSpec extends langium.AstNode {
1179
1227
  readonly $container: AttributeDefinition;
1180
1228
  readonly $type: 'OneOfSpec';
@@ -1363,6 +1411,8 @@ export interface QueryOption extends langium.AstNode {
1363
1411
  groupByClause?: GroupByClause;
1364
1412
  into?: SelectIntoSpec;
1365
1413
  join?: JoinSpec;
1414
+ limitClause?: LimitClause;
1415
+ offsetClause?: OffsetClause;
1366
1416
  orderByClause?: OrderByClause;
1367
1417
  upsert?: '@upsert';
1368
1418
  where?: WhereSpec;
@@ -1374,6 +1424,8 @@ export const QueryOption = {
1374
1424
  groupByClause: 'groupByClause',
1375
1425
  into: 'into',
1376
1426
  join: 'join',
1427
+ limitClause: 'limitClause',
1428
+ offsetClause: 'offsetClause',
1377
1429
  orderByClause: 'orderByClause',
1378
1430
  upsert: 'upsert',
1379
1431
  where: 'where'
@@ -1744,6 +1796,7 @@ export interface RuntimeHint extends langium.AstNode {
1744
1796
  readonly $type: 'RuntimeHint';
1745
1797
  aliasSpec?: AliasSpec;
1746
1798
  catchSpec?: CatchSpec;
1799
+ emptySpec?: EmptySpec;
1747
1800
  thenSpec?: ThenSpec;
1748
1801
  }
1749
1802
 
@@ -1751,6 +1804,7 @@ export const RuntimeHint = {
1751
1804
  $type: 'RuntimeHint',
1752
1805
  aliasSpec: 'aliasSpec',
1753
1806
  catchSpec: 'catchSpec',
1807
+ emptySpec: 'emptySpec',
1754
1808
  thenSpec: 'thenSpec'
1755
1809
  } as const;
1756
1810
 
@@ -1864,7 +1918,7 @@ export function isStandaloneStatement(item: unknown): item is StandaloneStatemen
1864
1918
  }
1865
1919
 
1866
1920
  export interface Statement extends langium.AstNode {
1867
- readonly $container: ArrayLiteral | CaseEntry | ConditionalFlowStep | Else | FlowEntry | ForEach | Handler | If | StandaloneStatement | ThenSpec | WorkflowDefinition;
1921
+ readonly $container: ArrayLiteral | CaseEntry | ConditionalFlowStep | Else | EmptySpec | FlowEntry | ForEach | Handler | If | StandaloneStatement | ThenSpec | WorkflowDefinition;
1868
1922
  readonly $type: 'Statement';
1869
1923
  hints: Array<RuntimeHint>;
1870
1924
  pattern: Pattern;
@@ -2102,6 +2156,7 @@ export type AgentlangAstType = {
2102
2156
  Delete: Delete
2103
2157
  DirectiveDefinition: DirectiveDefinition
2104
2158
  Else: Else
2159
+ EmptySpec: EmptySpec
2105
2160
  EntityActionsDefinitions: EntityActionsDefinitions
2106
2161
  EntityDefinition: EntityDefinition
2107
2162
  EnumSpec: EnumSpec
@@ -2127,6 +2182,7 @@ export type AgentlangAstType = {
2127
2182
  JoinSpec: JoinSpec
2128
2183
  KvPair: KvPair
2129
2184
  KvPairs: KvPairs
2185
+ LimitClause: LimitClause
2130
2186
  Literal: Literal
2131
2187
  MapEntry: MapEntry
2132
2188
  MapKey: MapKey
@@ -2136,6 +2192,7 @@ export type AgentlangAstType = {
2136
2192
  NegExpr: NegExpr
2137
2193
  NodeDefinition: NodeDefinition
2138
2194
  NotExpr: NotExpr
2195
+ OffsetClause: OffsetClause
2139
2196
  OneOfSpec: OneOfSpec
2140
2197
  OrderByClause: OrderByClause
2141
2198
  Pattern: Pattern
@@ -2517,6 +2574,15 @@ export class AgentlangAstReflection extends langium.AbstractAstReflection {
2517
2574
  },
2518
2575
  superTypes: []
2519
2576
  },
2577
+ EmptySpec: {
2578
+ name: EmptySpec.$type,
2579
+ properties: {
2580
+ stmt: {
2581
+ name: EmptySpec.stmt
2582
+ }
2583
+ },
2584
+ superTypes: []
2585
+ },
2520
2586
  EntityActionsDefinitions: {
2521
2587
  name: EntityActionsDefinitions.$type,
2522
2588
  properties: {
@@ -2820,6 +2886,15 @@ export class AgentlangAstReflection extends langium.AbstractAstReflection {
2820
2886
  },
2821
2887
  superTypes: []
2822
2888
  },
2889
+ LimitClause: {
2890
+ name: LimitClause.$type,
2891
+ properties: {
2892
+ value: {
2893
+ name: LimitClause.value
2894
+ }
2895
+ },
2896
+ superTypes: []
2897
+ },
2823
2898
  Literal: {
2824
2899
  name: Literal.$type,
2825
2900
  properties: {
@@ -2946,6 +3021,15 @@ export class AgentlangAstReflection extends langium.AbstractAstReflection {
2946
3021
  },
2947
3022
  superTypes: [PrimExpr.$type]
2948
3023
  },
3024
+ OffsetClause: {
3025
+ name: OffsetClause.$type,
3026
+ properties: {
3027
+ value: {
3028
+ name: OffsetClause.value
3029
+ }
3030
+ },
3031
+ superTypes: []
3032
+ },
2949
3033
  OneOfSpec: {
2950
3034
  name: OneOfSpec.$type,
2951
3035
  properties: {
@@ -3085,6 +3169,12 @@ export class AgentlangAstReflection extends langium.AbstractAstReflection {
3085
3169
  join: {
3086
3170
  name: QueryOption.join
3087
3171
  },
3172
+ limitClause: {
3173
+ name: QueryOption.limitClause
3174
+ },
3175
+ offsetClause: {
3176
+ name: QueryOption.offsetClause
3177
+ },
3088
3178
  orderByClause: {
3089
3179
  name: QueryOption.orderByClause
3090
3180
  },
@@ -3361,6 +3451,9 @@ export class AgentlangAstReflection extends langium.AbstractAstReflection {
3361
3451
  catchSpec: {
3362
3452
  name: RuntimeHint.catchSpec
3363
3453
  },
3454
+ emptySpec: {
3455
+ name: RuntimeHint.emptySpec
3456
+ },
3364
3457
  thenSpec: {
3365
3458
  name: RuntimeHint.thenSpec
3366
3459
  }