agentlang 0.0.40 → 0.0.51

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 (80) hide show
  1. package/out/extension/main.cjs +250 -250
  2. package/out/extension/main.cjs.map +2 -2
  3. package/out/language/generated/ast.d.ts +57 -21
  4. package/out/language/generated/ast.d.ts.map +1 -1
  5. package/out/language/generated/ast.js +80 -26
  6. package/out/language/generated/ast.js.map +1 -1
  7. package/out/language/generated/grammar.d.ts.map +1 -1
  8. package/out/language/generated/grammar.js +337 -115
  9. package/out/language/generated/grammar.js.map +1 -1
  10. package/out/language/main.cjs +900 -637
  11. package/out/language/main.cjs.map +3 -3
  12. package/out/language/syntax.d.ts +7 -0
  13. package/out/language/syntax.d.ts.map +1 -1
  14. package/out/language/syntax.js +16 -0
  15. package/out/language/syntax.js.map +1 -1
  16. package/out/runtime/agents/common.d.ts +9 -1
  17. package/out/runtime/agents/common.d.ts.map +1 -1
  18. package/out/runtime/agents/common.js +83 -1
  19. package/out/runtime/agents/common.js.map +1 -1
  20. package/out/runtime/agents/registry.js +3 -1
  21. package/out/runtime/agents/registry.js.map +1 -1
  22. package/out/runtime/auth/cognito.js +1 -1
  23. package/out/runtime/defs.d.ts +1 -0
  24. package/out/runtime/defs.d.ts.map +1 -1
  25. package/out/runtime/defs.js +1 -0
  26. package/out/runtime/defs.js.map +1 -1
  27. package/out/runtime/interpreter.d.ts +5 -0
  28. package/out/runtime/interpreter.d.ts.map +1 -1
  29. package/out/runtime/interpreter.js +81 -9
  30. package/out/runtime/interpreter.js.map +1 -1
  31. package/out/runtime/loader.d.ts.map +1 -1
  32. package/out/runtime/loader.js +111 -40
  33. package/out/runtime/loader.js.map +1 -1
  34. package/out/runtime/module.d.ts +24 -2
  35. package/out/runtime/module.d.ts.map +1 -1
  36. package/out/runtime/module.js +103 -12
  37. package/out/runtime/module.js.map +1 -1
  38. package/out/runtime/modules/ai.d.ts +9 -0
  39. package/out/runtime/modules/ai.d.ts.map +1 -1
  40. package/out/runtime/modules/ai.js +50 -9
  41. package/out/runtime/modules/ai.js.map +1 -1
  42. package/out/runtime/modules/auth.d.ts.map +1 -1
  43. package/out/runtime/modules/auth.js.map +1 -1
  44. package/out/runtime/modules/core.d.ts +1 -0
  45. package/out/runtime/modules/core.d.ts.map +1 -1
  46. package/out/runtime/modules/core.js +15 -5
  47. package/out/runtime/modules/core.js.map +1 -1
  48. package/out/runtime/resolvers/authinfo.d.ts +8 -0
  49. package/out/runtime/resolvers/authinfo.d.ts.map +1 -0
  50. package/out/runtime/resolvers/authinfo.js +14 -0
  51. package/out/runtime/resolvers/authinfo.js.map +1 -0
  52. package/out/runtime/resolvers/interface.d.ts +1 -7
  53. package/out/runtime/resolvers/interface.d.ts.map +1 -1
  54. package/out/runtime/resolvers/interface.js +3 -16
  55. package/out/runtime/resolvers/interface.js.map +1 -1
  56. package/out/runtime/resolvers/sqldb/database.d.ts +3 -1
  57. package/out/runtime/resolvers/sqldb/database.d.ts.map +1 -1
  58. package/out/runtime/resolvers/sqldb/database.js +72 -3
  59. package/out/runtime/resolvers/sqldb/database.js.map +1 -1
  60. package/out/syntaxes/agentlang.monarch.js +3 -3
  61. package/out/syntaxes/agentlang.monarch.js.map +1 -1
  62. package/package.json +156 -153
  63. package/src/language/agentlang.langium +12 -4
  64. package/src/language/generated/ast.ts +144 -49
  65. package/src/language/generated/grammar.ts +337 -115
  66. package/src/language/syntax.ts +21 -0
  67. package/src/runtime/agents/common.ts +91 -1
  68. package/src/runtime/agents/registry.ts +3 -3
  69. package/src/runtime/auth/cognito.ts +3 -3
  70. package/src/runtime/defs.ts +1 -0
  71. package/src/runtime/interpreter.ts +117 -8
  72. package/src/runtime/loader.ts +113 -39
  73. package/src/runtime/module.ts +123 -13
  74. package/src/runtime/modules/ai.ts +67 -11
  75. package/src/runtime/modules/auth.ts +6 -1
  76. package/src/runtime/modules/core.ts +16 -4
  77. package/src/runtime/resolvers/authinfo.ts +14 -0
  78. package/src/runtime/resolvers/interface.ts +2 -19
  79. package/src/runtime/resolvers/sqldb/database.ts +76 -3
  80. package/src/syntaxes/agentlang.monarch.ts +3 -3
@@ -3,7 +3,7 @@
3
3
  * DO NOT EDIT MANUALLY!
4
4
  ******************************************************************************/
5
5
 
6
-
6
+ /* eslint-disable */
7
7
  import * as langium from 'langium';
8
8
 
9
9
  export const AgentlangTerminals = {
@@ -25,6 +25,7 @@ export type AgentlangKeywordNames =
25
25
  | "+"
26
26
  | ","
27
27
  | "-"
28
+ | "-->"
28
29
  | "."
29
30
  | "/"
30
31
  | ":"
@@ -71,6 +72,7 @@ export type AgentlangKeywordNames =
71
72
  | "event"
72
73
  | "extends"
73
74
  | "false"
75
+ | "flow"
74
76
  | "for"
75
77
  | "if"
76
78
  | "import"
@@ -120,7 +122,7 @@ export function isDecimal(item: unknown): item is Decimal {
120
122
  return typeof item === 'number';
121
123
  }
122
124
 
123
- export type Definition = AgentDefinition | RelationshipDefinition | ResolverDefinition | SchemaDefinition | StandaloneStatement | WorkflowDefinition;
125
+ export type Definition = AgentDefinition | FlowDefinition | RelationshipDefinition | ResolverDefinition | SchemaDefinition | StandaloneStatement | WorkflowDefinition;
124
126
 
125
127
  export const Definition = 'Definition';
126
128
 
@@ -219,22 +221,10 @@ export function isAfterTriggerDefinition(item: unknown): item is AfterTriggerDef
219
221
  return reflection.isInstance(item, AfterTriggerDefinition);
220
222
  }
221
223
 
222
- export interface AgentDefBody extends langium.AstNode {
223
- readonly $container: AgentDefinition;
224
- readonly $type: 'AgentDefBody';
225
- attributes: Array<AgentPropertyDef>;
226
- }
227
-
228
- export const AgentDefBody = 'AgentDefBody';
229
-
230
- export function isAgentDefBody(item: unknown): item is AgentDefBody {
231
- return reflection.isInstance(item, AgentDefBody);
232
- }
233
-
234
224
  export interface AgentDefinition extends langium.AstNode {
235
225
  readonly $container: ModuleDefinition;
236
226
  readonly $type: 'AgentDefinition';
237
- body?: AgentDefBody;
227
+ body?: GenericDefBody;
238
228
  name: GenericName;
239
229
  }
240
230
 
@@ -244,19 +234,6 @@ export function isAgentDefinition(item: unknown): item is AgentDefinition {
244
234
  return reflection.isInstance(item, AgentDefinition);
245
235
  }
246
236
 
247
- export interface AgentPropertyDef extends langium.AstNode {
248
- readonly $container: AgentDefBody;
249
- readonly $type: 'AgentPropertyDef';
250
- name: string;
251
- value: Literal;
252
- }
253
-
254
- export const AgentPropertyDef = 'AgentPropertyDef';
255
-
256
- export function isAgentPropertyDef(item: unknown): item is AgentPropertyDef {
257
- return reflection.isInstance(item, AgentPropertyDef);
258
- }
259
-
260
237
  export interface AliasSpec extends langium.AstNode {
261
238
  readonly $container: RuntimeHint;
262
239
  readonly $type: 'AliasSpec';
@@ -363,6 +340,19 @@ export function isCompositeUniqueDefinition(item: unknown): item is CompositeUni
363
340
  return reflection.isInstance(item, CompositeUniqueDefinition);
364
341
  }
365
342
 
343
+ export interface ConditionalFlowStep extends langium.AstNode {
344
+ readonly $container: FlowEntry;
345
+ readonly $type: 'ConditionalFlowStep';
346
+ expr: string;
347
+ next: GenericName;
348
+ }
349
+
350
+ export const ConditionalFlowStep = 'ConditionalFlowStep';
351
+
352
+ export function isConditionalFlowStep(item: unknown): item is ConditionalFlowStep {
353
+ return reflection.isInstance(item, ConditionalFlowStep);
354
+ }
355
+
366
356
  export interface CrudMap extends langium.AstNode {
367
357
  readonly $container: Pattern;
368
358
  readonly $type: 'CrudMap';
@@ -482,6 +472,45 @@ export function isExtendsClause(item: unknown): item is ExtendsClause {
482
472
  return reflection.isInstance(item, ExtendsClause);
483
473
  }
484
474
 
475
+ export interface FlowDefBody extends langium.AstNode {
476
+ readonly $container: FlowDefinition;
477
+ readonly $type: 'FlowDefBody';
478
+ entries: Array<FlowEntry>;
479
+ }
480
+
481
+ export const FlowDefBody = 'FlowDefBody';
482
+
483
+ export function isFlowDefBody(item: unknown): item is FlowDefBody {
484
+ return reflection.isInstance(item, FlowDefBody);
485
+ }
486
+
487
+ export interface FlowDefinition extends langium.AstNode {
488
+ readonly $container: ModuleDefinition;
489
+ readonly $type: 'FlowDefinition';
490
+ body?: FlowDefBody;
491
+ name: GenericName;
492
+ }
493
+
494
+ export const FlowDefinition = 'FlowDefinition';
495
+
496
+ export function isFlowDefinition(item: unknown): item is FlowDefinition {
497
+ return reflection.isInstance(item, FlowDefinition);
498
+ }
499
+
500
+ export interface FlowEntry extends langium.AstNode {
501
+ readonly $container: FlowDefBody;
502
+ readonly $type: 'FlowEntry';
503
+ cond?: ConditionalFlowStep;
504
+ next?: GenericName;
505
+ root: GenericName;
506
+ }
507
+
508
+ export const FlowEntry = 'FlowEntry';
509
+
510
+ export function isFlowEntry(item: unknown): item is FlowEntry {
511
+ return reflection.isInstance(item, FlowEntry);
512
+ }
513
+
485
514
  export interface FnCall extends langium.AstNode {
486
515
  readonly $container: AsyncFnCall | Literal;
487
516
  readonly $type: 'FnCall';
@@ -523,6 +552,31 @@ export function isFullTextSearch(item: unknown): item is FullTextSearch {
523
552
  return reflection.isInstance(item, FullTextSearch);
524
553
  }
525
554
 
555
+ export interface GenericDefBody extends langium.AstNode {
556
+ readonly $container: AgentDefinition;
557
+ readonly $type: 'GenericDefBody';
558
+ attributes: Array<GenericPropertyDef>;
559
+ }
560
+
561
+ export const GenericDefBody = 'GenericDefBody';
562
+
563
+ export function isGenericDefBody(item: unknown): item is GenericDefBody {
564
+ return reflection.isInstance(item, GenericDefBody);
565
+ }
566
+
567
+ export interface GenericPropertyDef extends langium.AstNode {
568
+ readonly $container: GenericDefBody;
569
+ readonly $type: 'GenericPropertyDef';
570
+ name: string;
571
+ value: Literal;
572
+ }
573
+
574
+ export const GenericPropertyDef = 'GenericPropertyDef';
575
+
576
+ export function isGenericPropertyDef(item: unknown): item is GenericPropertyDef {
577
+ return reflection.isInstance(item, GenericPropertyDef);
578
+ }
579
+
526
580
  export interface Group extends langium.AstNode {
527
581
  readonly $container: AttributeDefinition | BinExpr | FnCall | Group | If | MapEntry | NegExpr | NotExpr | Pattern | SetAttribute;
528
582
  readonly $type: 'Group';
@@ -601,7 +655,7 @@ export function isKvPairs(item: unknown): item is KvPairs {
601
655
  }
602
656
 
603
657
  export interface Literal extends langium.AstNode {
604
- readonly $container: AgentPropertyDef | AttributeDefinition | BinExpr | CrudMap | FnCall | FullTextSearch | Group | If | KvPair | MapEntry | NegExpr | NotExpr | Pattern | SetAttribute;
658
+ readonly $container: AttributeDefinition | BinExpr | CrudMap | FnCall | FullTextSearch | GenericPropertyDef | Group | If | KvPair | MapEntry | NegExpr | NotExpr | Pattern | SetAttribute;
605
659
  readonly $type: 'Literal';
606
660
  array?: ArrayLiteral;
607
661
  asyncFnCall?: AsyncFnCall;
@@ -1184,9 +1238,7 @@ export function isWorkflowHeader(item: unknown): item is WorkflowHeader {
1184
1238
  export type AgentlangAstType = {
1185
1239
  ActionEntry: ActionEntry
1186
1240
  AfterTriggerDefinition: AfterTriggerDefinition
1187
- AgentDefBody: AgentDefBody
1188
1241
  AgentDefinition: AgentDefinition
1189
- AgentPropertyDef: AgentPropertyDef
1190
1242
  AliasSpec: AliasSpec
1191
1243
  ArrayLiteral: ArrayLiteral
1192
1244
  AsyncFnCall: AsyncFnCall
@@ -1196,6 +1248,7 @@ export type AgentlangAstType = {
1196
1248
  BinExpr: BinExpr
1197
1249
  CatchSpec: CatchSpec
1198
1250
  CompositeUniqueDefinition: CompositeUniqueDefinition
1251
+ ConditionalFlowStep: ConditionalFlowStep
1199
1252
  CrudMap: CrudMap
1200
1253
  CrudMapBody: CrudMapBody
1201
1254
  Definition: Definition
@@ -1207,9 +1260,14 @@ export type AgentlangAstType = {
1207
1260
  EventDefinition: EventDefinition
1208
1261
  Expr: Expr
1209
1262
  ExtendsClause: ExtendsClause
1263
+ FlowDefBody: FlowDefBody
1264
+ FlowDefinition: FlowDefinition
1265
+ FlowEntry: FlowEntry
1210
1266
  FnCall: FnCall
1211
1267
  ForEach: ForEach
1212
1268
  FullTextSearch: FullTextSearch
1269
+ GenericDefBody: GenericDefBody
1270
+ GenericPropertyDef: GenericPropertyDef
1213
1271
  Group: Group
1214
1272
  Handler: Handler
1215
1273
  If: If
@@ -1267,12 +1325,13 @@ export type AgentlangAstType = {
1267
1325
  export class AgentlangAstReflection extends langium.AbstractAstReflection {
1268
1326
 
1269
1327
  getAllTypes(): string[] {
1270
- return [ActionEntry, AfterTriggerDefinition, AgentDefBody, AgentDefinition, AgentPropertyDef, AliasSpec, ArrayLiteral, AsyncFnCall, AttributeDefinition, AttributeValueExpression, BeforeTriggerDefinition, BinExpr, CatchSpec, CompositeUniqueDefinition, CrudMap, CrudMapBody, Definition, Delete, Else, EntityActionsDefinitions, EntityDefinition, EnumSpec, EventDefinition, Expr, ExtendsClause, FnCall, ForEach, FullTextSearch, Group, Handler, If, Import, KvPair, KvPairs, Literal, MapEntry, MapKey, MapLiteral, MetaDefinition, ModuleDefinition, NegExpr, NodeDefinition, NotExpr, OneOfSpec, Pattern, PrePostTriggerDefinition, PrimExpr, PropertyDefinition, Purge, RbacAllowSpec, RbacExpressionSpec, RbacOpr, RbacRolesSpec, RbacSpecDefinition, RbacSpecEntries, RbacSpecEntry, RecordDefinition, RecordExtraDefinition, RecordSchemaDefinition, RefSpec, RelNodes, RelationshipDefinition, RelationshipPattern, ResolverDefinition, ResolverFnName, ResolverMethodName, ResolverMethodSpec, Return, RuntimeHint, SchemaDefinition, SelectIntoEntry, SelectIntoSpec, SetAttribute, StandaloneStatement, Statement, ThenSpec, TriggerDefinition, TriggerEntry, WorkflowDefinition, WorkflowHeader];
1328
+ return [ActionEntry, AfterTriggerDefinition, AgentDefinition, AliasSpec, ArrayLiteral, AsyncFnCall, AttributeDefinition, AttributeValueExpression, BeforeTriggerDefinition, BinExpr, CatchSpec, CompositeUniqueDefinition, ConditionalFlowStep, CrudMap, CrudMapBody, Definition, Delete, Else, EntityActionsDefinitions, EntityDefinition, EnumSpec, EventDefinition, Expr, ExtendsClause, FlowDefBody, FlowDefinition, FlowEntry, FnCall, ForEach, FullTextSearch, GenericDefBody, GenericPropertyDef, Group, Handler, If, Import, KvPair, KvPairs, Literal, MapEntry, MapKey, MapLiteral, MetaDefinition, ModuleDefinition, NegExpr, NodeDefinition, NotExpr, OneOfSpec, Pattern, PrePostTriggerDefinition, PrimExpr, PropertyDefinition, Purge, RbacAllowSpec, RbacExpressionSpec, RbacOpr, RbacRolesSpec, RbacSpecDefinition, RbacSpecEntries, RbacSpecEntry, RecordDefinition, RecordExtraDefinition, RecordSchemaDefinition, RefSpec, RelNodes, RelationshipDefinition, RelationshipPattern, ResolverDefinition, ResolverFnName, ResolverMethodName, ResolverMethodSpec, Return, RuntimeHint, SchemaDefinition, SelectIntoEntry, SelectIntoSpec, SetAttribute, StandaloneStatement, Statement, ThenSpec, TriggerDefinition, TriggerEntry, WorkflowDefinition, WorkflowHeader];
1271
1329
  }
1272
1330
 
1273
1331
  protected override computeIsSubtype(subtype: string, supertype: string): boolean {
1274
1332
  switch (subtype) {
1275
1333
  case AgentDefinition:
1334
+ case FlowDefinition:
1276
1335
  case RelationshipDefinition:
1277
1336
  case ResolverDefinition:
1278
1337
  case SchemaDefinition:
@@ -1332,14 +1391,6 @@ export class AgentlangAstReflection extends langium.AbstractAstReflection {
1332
1391
  ]
1333
1392
  };
1334
1393
  }
1335
- case AgentDefBody: {
1336
- return {
1337
- name: AgentDefBody,
1338
- properties: [
1339
- { name: 'attributes', defaultValue: [] }
1340
- ]
1341
- };
1342
- }
1343
1394
  case AgentDefinition: {
1344
1395
  return {
1345
1396
  name: AgentDefinition,
@@ -1349,15 +1400,6 @@ export class AgentlangAstReflection extends langium.AbstractAstReflection {
1349
1400
  ]
1350
1401
  };
1351
1402
  }
1352
- case AgentPropertyDef: {
1353
- return {
1354
- name: AgentPropertyDef,
1355
- properties: [
1356
- { name: 'name' },
1357
- { name: 'value' }
1358
- ]
1359
- };
1360
- }
1361
1403
  case AliasSpec: {
1362
1404
  return {
1363
1405
  name: AliasSpec,
@@ -1432,6 +1474,15 @@ export class AgentlangAstReflection extends langium.AbstractAstReflection {
1432
1474
  ]
1433
1475
  };
1434
1476
  }
1477
+ case ConditionalFlowStep: {
1478
+ return {
1479
+ name: ConditionalFlowStep,
1480
+ properties: [
1481
+ { name: 'expr' },
1482
+ { name: 'next' }
1483
+ ]
1484
+ };
1485
+ }
1435
1486
  case CrudMap: {
1436
1487
  return {
1437
1488
  name: CrudMap,
@@ -1515,6 +1566,33 @@ export class AgentlangAstReflection extends langium.AbstractAstReflection {
1515
1566
  ]
1516
1567
  };
1517
1568
  }
1569
+ case FlowDefBody: {
1570
+ return {
1571
+ name: FlowDefBody,
1572
+ properties: [
1573
+ { name: 'entries', defaultValue: [] }
1574
+ ]
1575
+ };
1576
+ }
1577
+ case FlowDefinition: {
1578
+ return {
1579
+ name: FlowDefinition,
1580
+ properties: [
1581
+ { name: 'body' },
1582
+ { name: 'name' }
1583
+ ]
1584
+ };
1585
+ }
1586
+ case FlowEntry: {
1587
+ return {
1588
+ name: FlowEntry,
1589
+ properties: [
1590
+ { name: 'cond' },
1591
+ { name: 'next' },
1592
+ { name: 'root' }
1593
+ ]
1594
+ };
1595
+ }
1518
1596
  case FnCall: {
1519
1597
  return {
1520
1598
  name: FnCall,
@@ -1544,6 +1622,23 @@ export class AgentlangAstReflection extends langium.AbstractAstReflection {
1544
1622
  ]
1545
1623
  };
1546
1624
  }
1625
+ case GenericDefBody: {
1626
+ return {
1627
+ name: GenericDefBody,
1628
+ properties: [
1629
+ { name: 'attributes', defaultValue: [] }
1630
+ ]
1631
+ };
1632
+ }
1633
+ case GenericPropertyDef: {
1634
+ return {
1635
+ name: GenericPropertyDef,
1636
+ properties: [
1637
+ { name: 'name' },
1638
+ { name: 'value' }
1639
+ ]
1640
+ };
1641
+ }
1547
1642
  case Group: {
1548
1643
  return {
1549
1644
  name: Group,