agentlang 0.9.5 → 0.9.6

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 (77) 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 +80 -3
  4. package/out/language/generated/ast.d.ts.map +1 -1
  5. package/out/language/generated/ast.js +62 -1
  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 +432 -218
  9. package/out/language/generated/grammar.js.map +1 -1
  10. package/out/language/main.cjs +1133 -2510
  11. package/out/language/main.cjs.map +4 -4
  12. package/out/language/parser.js +8 -8
  13. package/out/language/parser.js.map +1 -1
  14. package/out/runtime/agents/common.d.ts +7 -1
  15. package/out/runtime/agents/common.d.ts.map +1 -1
  16. package/out/runtime/agents/common.js +101 -0
  17. package/out/runtime/agents/common.js.map +1 -1
  18. package/out/runtime/agents/impl/anthropic.js +4 -4
  19. package/out/runtime/agents/impl/anthropic.js.map +1 -1
  20. package/out/runtime/agents/impl/openai.js +4 -4
  21. package/out/runtime/agents/impl/openai.js.map +1 -1
  22. package/out/runtime/exec-graph.d.ts.map +1 -1
  23. package/out/runtime/exec-graph.js +5 -0
  24. package/out/runtime/exec-graph.js.map +1 -1
  25. package/out/runtime/interpreter.d.ts +4 -0
  26. package/out/runtime/interpreter.d.ts.map +1 -1
  27. package/out/runtime/interpreter.js +20 -4
  28. package/out/runtime/interpreter.js.map +1 -1
  29. package/out/runtime/loader.d.ts.map +1 -1
  30. package/out/runtime/loader.js +42 -5
  31. package/out/runtime/loader.js.map +1 -1
  32. package/out/runtime/module.d.ts +18 -3
  33. package/out/runtime/module.d.ts.map +1 -1
  34. package/out/runtime/module.js +62 -4
  35. package/out/runtime/module.js.map +1 -1
  36. package/out/runtime/modules/ai.d.ts +18 -2
  37. package/out/runtime/modules/ai.d.ts.map +1 -1
  38. package/out/runtime/modules/ai.js +271 -21
  39. package/out/runtime/modules/ai.js.map +1 -1
  40. package/out/runtime/modules/auth.d.ts.map +1 -1
  41. package/out/runtime/modules/auth.js +11 -5
  42. package/out/runtime/modules/auth.js.map +1 -1
  43. package/out/runtime/resolvers/interface.d.ts +1 -1
  44. package/out/runtime/resolvers/interface.d.ts.map +1 -1
  45. package/out/runtime/resolvers/interface.js.map +1 -1
  46. package/out/runtime/resolvers/sqldb/database.d.ts.map +1 -1
  47. package/out/runtime/resolvers/sqldb/database.js +17 -9
  48. package/out/runtime/resolvers/sqldb/database.js.map +1 -1
  49. package/out/runtime/resolvers/sqldb/impl.d.ts +1 -1
  50. package/out/runtime/resolvers/sqldb/impl.d.ts.map +1 -1
  51. package/out/runtime/resolvers/sqldb/impl.js +2 -2
  52. package/out/runtime/resolvers/sqldb/impl.js.map +1 -1
  53. package/out/runtime/state.d.ts +1 -0
  54. package/out/runtime/state.d.ts.map +1 -1
  55. package/out/runtime/state.js +3 -0
  56. package/out/runtime/state.js.map +1 -1
  57. package/out/syntaxes/agentlang.monarch.js +1 -1
  58. package/out/syntaxes/agentlang.monarch.js.map +1 -1
  59. package/package.json +1 -1
  60. package/src/language/agentlang.langium +8 -2
  61. package/src/language/generated/ast.ts +97 -3
  62. package/src/language/generated/grammar.ts +432 -218
  63. package/src/language/parser.ts +8 -8
  64. package/src/runtime/agents/common.ts +107 -0
  65. package/src/runtime/agents/impl/anthropic.ts +4 -4
  66. package/src/runtime/agents/impl/openai.ts +4 -4
  67. package/src/runtime/exec-graph.ts +4 -0
  68. package/src/runtime/interpreter.ts +23 -4
  69. package/src/runtime/loader.ts +42 -3
  70. package/src/runtime/module.ts +80 -3
  71. package/src/runtime/modules/ai.ts +391 -19
  72. package/src/runtime/modules/auth.ts +11 -5
  73. package/src/runtime/resolvers/interface.ts +1 -1
  74. package/src/runtime/resolvers/sqldb/database.ts +18 -10
  75. package/src/runtime/resolvers/sqldb/impl.ts +3 -3
  76. package/src/runtime/state.ts +4 -0
  77. package/src/syntaxes/agentlang.monarch.ts +1 -1
@@ -3,7 +3,7 @@
3
3
  * DO NOT EDIT MANUALLY!
4
4
  ******************************************************************************/
5
5
 
6
- /* eslint-disable */
6
+
7
7
  import * as langium from 'langium';
8
8
 
9
9
  export const AgentlangTerminals = {
@@ -68,6 +68,7 @@ export type AgentlangKeywordNames =
68
68
  | "@then"
69
69
  | "@upsert"
70
70
  | "@where"
71
+ | "@withRole"
71
72
  | "@with_unique"
72
73
  | "["
73
74
  | "]"
@@ -89,6 +90,7 @@ export type AgentlangKeywordNames =
89
90
  | "else"
90
91
  | "entity"
91
92
  | "error"
93
+ | "eval"
92
94
  | "event"
93
95
  | "extends"
94
96
  | "false"
@@ -176,6 +178,23 @@ export function isAgentDefinition(item: unknown): item is AgentDefinition {
176
178
  return reflection.isInstance(item, AgentDefinition.$type);
177
179
  }
178
180
 
181
+ export interface AgentEvaluatorDefinition extends langium.AstNode {
182
+ readonly $container: ModuleDefinition;
183
+ readonly $type: 'AgentEvaluatorDefinition';
184
+ attributes: Array<SetAttribute>;
185
+ name?: string;
186
+ }
187
+
188
+ export const AgentEvaluatorDefinition = {
189
+ $type: 'AgentEvaluatorDefinition',
190
+ attributes: 'attributes',
191
+ name: 'name'
192
+ } as const;
193
+
194
+ export function isAgentEvaluatorDefinition(item: unknown): item is AgentEvaluatorDefinition {
195
+ return reflection.isInstance(item, AgentEvaluatorDefinition.$type);
196
+ }
197
+
179
198
  export interface AgentXtraAttribute extends langium.AstNode {
180
199
  readonly $container: AgentXtraSpec;
181
200
  readonly $type: 'AgentXtraAttribute' | 'Ref';
@@ -520,7 +539,7 @@ export function isDecisionDefinition(item: unknown): item is DecisionDefinition
520
539
  return reflection.isInstance(item, DecisionDefinition.$type);
521
540
  }
522
541
 
523
- export type Definition = AgentDefinition | DecisionDefinition | DirectiveDefinition | FlowDefinition | GlossaryEntryDefinition | PublicAgentDefinition | PublicWorkflowDefinition | RelationshipDefinition | ResolverDefinition | RetryDefinition | ScenarioDefinition | SchemaDefinition | StandaloneStatement | WorkflowDefinition;
542
+ export type Definition = AgentDefinition | AgentEvaluatorDefinition | DecisionDefinition | DirectiveDefinition | FlowDefinition | GlossaryEntryDefinition | PublicAgentDefinition | PublicWorkflowDefinition | RelationshipDefinition | ResolverDefinition | RetryDefinition | ScenarioDefinition | SchemaDefinition | StandaloneStatement | WorkflowDefinition;
524
543
 
525
544
  export const Definition = {
526
545
  $type: 'Definition'
@@ -1788,7 +1807,7 @@ export function isSelectIntoSpec(item: unknown): item is SelectIntoSpec {
1788
1807
  }
1789
1808
 
1790
1809
  export interface SetAttribute extends langium.AstNode {
1791
- readonly $container: BackoffSpec | CrudMapBody;
1810
+ readonly $container: AgentEvaluatorDefinition | BackoffSpec | CrudMapBody;
1792
1811
  readonly $type: 'SetAttribute';
1793
1812
  aggregate?: AggregateFunctionSpec;
1794
1813
  name: QueryId;
@@ -1959,6 +1978,7 @@ export function isWhereSpecClause(item: unknown): item is WhereSpecClause {
1959
1978
  export interface WorkflowDefinition extends langium.AstNode {
1960
1979
  readonly $container: ModuleDefinition | PublicWorkflowDefinition;
1961
1980
  readonly $type: 'WorkflowDefinition';
1981
+ directives?: WorkflowDirectives;
1962
1982
  header?: WorkflowHeader;
1963
1983
  name?: string;
1964
1984
  statements: Array<Statement>;
@@ -1966,6 +1986,7 @@ export interface WorkflowDefinition extends langium.AstNode {
1966
1986
 
1967
1987
  export const WorkflowDefinition = {
1968
1988
  $type: 'WorkflowDefinition',
1989
+ directives: 'directives',
1969
1990
  header: 'header',
1970
1991
  name: 'name',
1971
1992
  statements: 'statements'
@@ -1975,6 +1996,38 @@ export function isWorkflowDefinition(item: unknown): item is WorkflowDefinition
1975
1996
  return reflection.isInstance(item, WorkflowDefinition.$type);
1976
1997
  }
1977
1998
 
1999
+ export interface WorkflowDirectiveEntry extends langium.AstNode {
2000
+ readonly $container: WorkflowDirectives;
2001
+ readonly $type: 'WorkflowDirectiveEntry';
2002
+ tag: '@withRole';
2003
+ value: STRING | string;
2004
+ }
2005
+
2006
+ export const WorkflowDirectiveEntry = {
2007
+ $type: 'WorkflowDirectiveEntry',
2008
+ tag: 'tag',
2009
+ value: 'value'
2010
+ } as const;
2011
+
2012
+ export function isWorkflowDirectiveEntry(item: unknown): item is WorkflowDirectiveEntry {
2013
+ return reflection.isInstance(item, WorkflowDirectiveEntry.$type);
2014
+ }
2015
+
2016
+ export interface WorkflowDirectives extends langium.AstNode {
2017
+ readonly $container: WorkflowDefinition;
2018
+ readonly $type: 'WorkflowDirectives';
2019
+ entries: Array<WorkflowDirectiveEntry>;
2020
+ }
2021
+
2022
+ export const WorkflowDirectives = {
2023
+ $type: 'WorkflowDirectives',
2024
+ entries: 'entries'
2025
+ } as const;
2026
+
2027
+ export function isWorkflowDirectives(item: unknown): item is WorkflowDirectives {
2028
+ return reflection.isInstance(item, WorkflowDirectives.$type);
2029
+ }
2030
+
1978
2031
  export interface WorkflowHeader extends langium.AstNode {
1979
2032
  readonly $container: WorkflowDefinition;
1980
2033
  readonly $type: 'WorkflowHeader';
@@ -2010,6 +2063,7 @@ export type AgentlangAstType = {
2010
2063
  ActionEntry: ActionEntry
2011
2064
  AfterTriggerDefinition: AfterTriggerDefinition
2012
2065
  AgentDefinition: AgentDefinition
2066
+ AgentEvaluatorDefinition: AgentEvaluatorDefinition
2013
2067
  AgentXtraAttribute: AgentXtraAttribute
2014
2068
  AgentXtraSpec: AgentXtraSpec
2015
2069
  AggregateFunctionSpec: AggregateFunctionSpec
@@ -2112,6 +2166,8 @@ export type AgentlangAstType = {
2112
2166
  WhereSpec: WhereSpec
2113
2167
  WhereSpecClause: WhereSpecClause
2114
2168
  WorkflowDefinition: WorkflowDefinition
2169
+ WorkflowDirectiveEntry: WorkflowDirectiveEntry
2170
+ WorkflowDirectives: WorkflowDirectives
2115
2171
  WorkflowHeader: WorkflowHeader
2116
2172
  }
2117
2173
 
@@ -2150,6 +2206,19 @@ export class AgentlangAstReflection extends langium.AbstractAstReflection {
2150
2206
  },
2151
2207
  superTypes: [Definition.$type]
2152
2208
  },
2209
+ AgentEvaluatorDefinition: {
2210
+ name: AgentEvaluatorDefinition.$type,
2211
+ properties: {
2212
+ attributes: {
2213
+ name: AgentEvaluatorDefinition.attributes,
2214
+ defaultValue: []
2215
+ },
2216
+ name: {
2217
+ name: AgentEvaluatorDefinition.name
2218
+ }
2219
+ },
2220
+ superTypes: [Definition.$type]
2221
+ },
2153
2222
  AgentXtraAttribute: {
2154
2223
  name: AgentXtraAttribute.$type,
2155
2224
  properties: {
@@ -3433,6 +3502,9 @@ export class AgentlangAstReflection extends langium.AbstractAstReflection {
3433
3502
  WorkflowDefinition: {
3434
3503
  name: WorkflowDefinition.$type,
3435
3504
  properties: {
3505
+ directives: {
3506
+ name: WorkflowDefinition.directives
3507
+ },
3436
3508
  header: {
3437
3509
  name: WorkflowDefinition.header
3438
3510
  },
@@ -3446,6 +3518,28 @@ export class AgentlangAstReflection extends langium.AbstractAstReflection {
3446
3518
  },
3447
3519
  superTypes: [Definition.$type]
3448
3520
  },
3521
+ WorkflowDirectiveEntry: {
3522
+ name: WorkflowDirectiveEntry.$type,
3523
+ properties: {
3524
+ tag: {
3525
+ name: WorkflowDirectiveEntry.tag
3526
+ },
3527
+ value: {
3528
+ name: WorkflowDirectiveEntry.value
3529
+ }
3530
+ },
3531
+ superTypes: []
3532
+ },
3533
+ WorkflowDirectives: {
3534
+ name: WorkflowDirectives.$type,
3535
+ properties: {
3536
+ entries: {
3537
+ name: WorkflowDirectives.entries,
3538
+ defaultValue: []
3539
+ }
3540
+ },
3541
+ superTypes: []
3542
+ },
3449
3543
  WorkflowHeader: {
3450
3544
  name: WorkflowHeader.$type,
3451
3545
  properties: {