agentlang 0.9.4 → 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 (105) hide show
  1. package/out/api/http.js +8 -2
  2. package/out/api/http.js.map +1 -1
  3. package/out/extension/main.cjs +253 -253
  4. package/out/extension/main.cjs.map +2 -2
  5. package/out/language/generated/ast.d.ts +1997 -151
  6. package/out/language/generated/ast.d.ts.map +1 -1
  7. package/out/language/generated/ast.js +2113 -1263
  8. package/out/language/generated/ast.js.map +1 -1
  9. package/out/language/generated/grammar.d.ts +1 -1
  10. package/out/language/generated/grammar.d.ts.map +1 -1
  11. package/out/language/generated/grammar.js +649 -762
  12. package/out/language/generated/grammar.js.map +1 -1
  13. package/out/language/generated/module.d.ts +1 -1
  14. package/out/language/generated/module.js +1 -1
  15. package/out/language/main.cjs +6401 -4072
  16. package/out/language/main.cjs.map +4 -4
  17. package/out/language/parser.js +8 -8
  18. package/out/language/parser.js.map +1 -1
  19. package/out/runtime/agents/common.d.ts +7 -1
  20. package/out/runtime/agents/common.d.ts.map +1 -1
  21. package/out/runtime/agents/common.js +101 -0
  22. package/out/runtime/agents/common.js.map +1 -1
  23. package/out/runtime/agents/impl/anthropic.js +4 -4
  24. package/out/runtime/agents/impl/anthropic.js.map +1 -1
  25. package/out/runtime/agents/impl/openai.js +4 -4
  26. package/out/runtime/agents/impl/openai.js.map +1 -1
  27. package/out/runtime/auth/defs.d.ts +1 -1
  28. package/out/runtime/auth/defs.js +1 -1
  29. package/out/runtime/defs.d.ts +1 -1
  30. package/out/runtime/defs.js +1 -1
  31. package/out/runtime/exec-graph.d.ts.map +1 -1
  32. package/out/runtime/exec-graph.js +5 -0
  33. package/out/runtime/exec-graph.js.map +1 -1
  34. package/out/runtime/interpreter.d.ts +4 -0
  35. package/out/runtime/interpreter.d.ts.map +1 -1
  36. package/out/runtime/interpreter.js +20 -4
  37. package/out/runtime/interpreter.js.map +1 -1
  38. package/out/runtime/loader.d.ts.map +1 -1
  39. package/out/runtime/loader.js +43 -6
  40. package/out/runtime/loader.js.map +1 -1
  41. package/out/runtime/module.d.ts +18 -3
  42. package/out/runtime/module.d.ts.map +1 -1
  43. package/out/runtime/module.js +62 -4
  44. package/out/runtime/module.js.map +1 -1
  45. package/out/runtime/modules/ai.d.ts +18 -2
  46. package/out/runtime/modules/ai.d.ts.map +1 -1
  47. package/out/runtime/modules/ai.js +271 -21
  48. package/out/runtime/modules/ai.js.map +1 -1
  49. package/out/runtime/modules/auth.d.ts.map +1 -1
  50. package/out/runtime/modules/auth.js +11 -5
  51. package/out/runtime/modules/auth.js.map +1 -1
  52. package/out/runtime/resolvers/interface.d.ts +1 -1
  53. package/out/runtime/resolvers/interface.d.ts.map +1 -1
  54. package/out/runtime/resolvers/interface.js.map +1 -1
  55. package/out/runtime/resolvers/sqldb/database.d.ts +1 -0
  56. package/out/runtime/resolvers/sqldb/database.d.ts.map +1 -1
  57. package/out/runtime/resolvers/sqldb/database.js +19 -10
  58. package/out/runtime/resolvers/sqldb/database.js.map +1 -1
  59. package/out/runtime/resolvers/sqldb/impl.d.ts +1 -1
  60. package/out/runtime/resolvers/sqldb/impl.d.ts.map +1 -1
  61. package/out/runtime/resolvers/sqldb/impl.js +2 -2
  62. package/out/runtime/resolvers/sqldb/impl.js.map +1 -1
  63. package/out/runtime/state.d.ts +37 -367
  64. package/out/runtime/state.d.ts.map +1 -1
  65. package/out/runtime/state.js +3 -0
  66. package/out/runtime/state.js.map +1 -1
  67. package/out/setupClassic.d.ts +98 -0
  68. package/out/setupClassic.d.ts.map +1 -0
  69. package/out/setupClassic.js +38 -0
  70. package/out/setupClassic.js.map +1 -0
  71. package/out/setupCommon.d.ts +2 -0
  72. package/out/setupCommon.d.ts.map +1 -0
  73. package/out/setupCommon.js +33 -0
  74. package/out/setupCommon.js.map +1 -0
  75. package/out/setupExtended.d.ts +40 -0
  76. package/out/setupExtended.d.ts.map +1 -0
  77. package/out/setupExtended.js +67 -0
  78. package/out/setupExtended.js.map +1 -0
  79. package/out/syntaxes/agentlang.monarch.js +4 -4
  80. package/out/syntaxes/agentlang.monarch.js.map +1 -1
  81. package/out/utils/runtime.d.ts +7 -6
  82. package/out/utils/runtime.d.ts.map +1 -1
  83. package/package.json +185 -187
  84. package/src/api/http.ts +8 -2
  85. package/src/language/agentlang.langium +8 -2
  86. package/src/language/generated/ast.ts +2204 -1322
  87. package/src/language/generated/grammar.ts +649 -762
  88. package/src/language/generated/module.ts +1 -1
  89. package/src/language/parser.ts +8 -8
  90. package/src/runtime/agents/common.ts +107 -0
  91. package/src/runtime/agents/impl/anthropic.ts +4 -4
  92. package/src/runtime/agents/impl/openai.ts +4 -4
  93. package/src/runtime/auth/defs.ts +1 -1
  94. package/src/runtime/defs.ts +1 -1
  95. package/src/runtime/exec-graph.ts +4 -0
  96. package/src/runtime/interpreter.ts +23 -4
  97. package/src/runtime/loader.ts +43 -4
  98. package/src/runtime/module.ts +80 -3
  99. package/src/runtime/modules/ai.ts +391 -19
  100. package/src/runtime/modules/auth.ts +11 -5
  101. package/src/runtime/resolvers/interface.ts +1 -1
  102. package/src/runtime/resolvers/sqldb/database.ts +20 -11
  103. package/src/runtime/resolvers/sqldb/impl.ts +3 -3
  104. package/src/runtime/state.ts +4 -0
  105. package/src/syntaxes/agentlang.monarch.ts +4 -4
package/src/api/http.ts CHANGED
@@ -1051,7 +1051,10 @@ async function handleFileDownload(
1051
1051
  return;
1052
1052
  }
1053
1053
 
1054
- const filename = req.params.filename;
1054
+ let filename = req.params.filename;
1055
+ if (Array.isArray(filename)) {
1056
+ filename = filename[0];
1057
+ }
1055
1058
 
1056
1059
  if (!filename) {
1057
1060
  res.status(400).send({ error: 'Filename is required' });
@@ -1154,7 +1157,10 @@ async function handleFileDelete(
1154
1157
  return;
1155
1158
  }
1156
1159
 
1157
- const filename = req.params.filename;
1160
+ let filename = req.params.filename;
1161
+ if (Array.isArray(filename)) {
1162
+ filename = filename[0];
1163
+ }
1158
1164
 
1159
1165
  if (!filename) {
1160
1166
  res.status(400).send({ error: 'Filename is required' });
@@ -6,7 +6,7 @@ Import: 'import' path=STRING '@as' name=ID;
6
6
 
7
7
  Definition: SchemaDefinition | RelationshipDefinition | WorkflowDefinition | PublicWorkflowDefinition | StandaloneStatement
8
8
  | AgentDefinition | PublicAgentDefinition | ResolverDefinition | FlowDefinition | DecisionDefinition | ScenarioDefinition
9
- | DirectiveDefinition | GlossaryEntryDefinition | RetryDefinition;
9
+ | DirectiveDefinition | GlossaryEntryDefinition | RetryDefinition | AgentEvaluatorDefinition;
10
10
 
11
11
  StandaloneStatement: stmt=Statement;
12
12
 
@@ -94,7 +94,7 @@ Literal: (id=ID | num=Decimal | str=STRING | ref=Ref | bool=Boolean | fnCall=FnC
94
94
 
95
95
  fragment Body: '{' '}' | '{' (statements+=Statement (';' statements+=Statement)*)+ '}' | '{' statements+=Statement ';'+ '}' | statements+=Statement;
96
96
 
97
- WorkflowDefinition: 'workflow' (name=ID | header=WorkflowHeader) Body;
97
+ WorkflowDefinition: 'workflow' (name=ID | header=WorkflowHeader) (directives=WorkflowDirectives)? Body;
98
98
 
99
99
  WorkflowHeader: tag=WorkflowHeaderTag prefix=WorkflowHeaderPrefix ':' name=QualifiedName;
100
100
 
@@ -102,6 +102,10 @@ WorkflowHeaderTag returns string: '@after' | '@before';
102
102
 
103
103
  WorkflowHeaderPrefix returns string: 'create' | 'update' | 'delete';
104
104
 
105
+ WorkflowDirectives: (entries+=WorkflowDirectiveEntry (',' entries+=WorkflowDirectiveEntry)*)+;
106
+
107
+ WorkflowDirectiveEntry: tag='@withRole' '(' value=(ID | STRING) ')';
108
+
105
109
  PublicWorkflowDefinition: '@public' def=WorkflowDefinition;
106
110
 
107
111
  Pattern: expr=Expr | crudMap=CrudMap | if=If | forEach=ForEach | delete=Delete | purge=Purge
@@ -190,6 +194,8 @@ RetryDefinition: 'agentlang/retry' name=ID '{' ('attempts' attempts=Decimal)? ('
190
194
 
191
195
  BackoffSpec: 'backoff' '{' (attributes+=SetAttribute (',' attributes+=SetAttribute)*)+ '}';
192
196
 
197
+ AgentEvaluatorDefinition: 'eval' name=ID '{' '}' | '{' (attributes+=SetAttribute (',' attributes+=SetAttribute)*)+ '}';
198
+
193
199
  ResolverDefinition: 'resolver' name=QualifiedName '[' (paths+=ResolverPathEntry (',' paths+=ResolverPathEntry)*)+ ']'
194
200
  '{' (methods+=ResolverMethodSpec (',' methods+=ResolverMethodSpec)*)+ '}';
195
201