agentlang 0.0.3 → 0.0.5
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.
- package/README.md +16 -47
- package/out/api/http.d.ts.map +1 -1
- package/out/api/http.js +39 -19
- package/out/api/http.js.map +1 -1
- package/out/cli/main.d.ts +1 -3
- package/out/cli/main.d.ts.map +1 -1
- package/out/cli/main.js +6 -12
- package/out/cli/main.js.map +1 -1
- package/out/language/generated/ast.d.ts +98 -19
- package/out/language/generated/ast.d.ts.map +1 -1
- package/out/language/generated/ast.js +144 -26
- package/out/language/generated/ast.js.map +1 -1
- package/out/language/generated/grammar.d.ts +1 -1
- package/out/language/generated/grammar.d.ts.map +1 -1
- package/out/language/generated/grammar.js +1000 -305
- package/out/language/generated/grammar.js.map +1 -1
- package/out/language/generated/module.d.ts +1 -1
- package/out/language/generated/module.js +1 -1
- package/out/language/main.cjs +1097 -312
- package/out/language/main.cjs.map +2 -2
- package/out/language/parser.js +13 -6
- package/out/language/parser.js.map +1 -1
- package/out/runtime/agents/common.d.ts +1 -1
- package/out/runtime/agents/common.d.ts.map +1 -1
- package/out/runtime/agents/common.js +1 -1
- package/out/runtime/auth/cognito.d.ts +4 -1
- package/out/runtime/auth/cognito.d.ts.map +1 -1
- package/out/runtime/auth/cognito.js +540 -73
- package/out/runtime/auth/cognito.js.map +1 -1
- package/out/runtime/auth/defs.d.ts +3 -0
- package/out/runtime/auth/defs.d.ts.map +1 -1
- package/out/runtime/auth/defs.js +17 -1
- package/out/runtime/auth/defs.js.map +1 -1
- package/out/runtime/auth/interface.d.ts +6 -1
- package/out/runtime/auth/interface.d.ts.map +1 -1
- package/out/runtime/defs.d.ts +21 -0
- package/out/runtime/defs.d.ts.map +1 -1
- package/out/runtime/defs.js +35 -0
- package/out/runtime/defs.js.map +1 -1
- package/out/runtime/interpreter.d.ts.map +1 -1
- package/out/runtime/interpreter.js +45 -36
- package/out/runtime/interpreter.js.map +1 -1
- package/out/runtime/loader.d.ts +4 -2
- package/out/runtime/loader.d.ts.map +1 -1
- package/out/runtime/loader.js +164 -29
- package/out/runtime/loader.js.map +1 -1
- package/out/runtime/module.d.ts +49 -5
- package/out/runtime/module.d.ts.map +1 -1
- package/out/runtime/module.js +214 -9
- package/out/runtime/module.js.map +1 -1
- package/out/runtime/modules/ai.d.ts +7 -5
- package/out/runtime/modules/ai.d.ts.map +1 -1
- package/out/runtime/modules/ai.js +50 -24
- package/out/runtime/modules/ai.js.map +1 -1
- package/out/runtime/modules/auth.d.ts +17 -1
- package/out/runtime/modules/auth.d.ts.map +1 -1
- package/out/runtime/modules/auth.js +295 -32
- package/out/runtime/modules/auth.js.map +1 -1
- package/out/runtime/modules/core.d.ts.map +1 -1
- package/out/runtime/modules/core.js +3 -1
- package/out/runtime/modules/core.js.map +1 -1
- package/out/runtime/relgraph.d.ts.map +1 -1
- package/out/runtime/relgraph.js +2 -2
- package/out/runtime/relgraph.js.map +1 -1
- package/out/runtime/resolvers/interface.d.ts +37 -2
- package/out/runtime/resolvers/interface.d.ts.map +1 -1
- package/out/runtime/resolvers/interface.js +103 -5
- package/out/runtime/resolvers/interface.js.map +1 -1
- package/out/runtime/resolvers/registry.d.ts +3 -2
- package/out/runtime/resolvers/registry.d.ts.map +1 -1
- package/out/runtime/resolvers/registry.js +3 -0
- package/out/runtime/resolvers/registry.js.map +1 -1
- package/out/runtime/resolvers/sqldb/database.d.ts +4 -2
- package/out/runtime/resolvers/sqldb/database.d.ts.map +1 -1
- package/out/runtime/resolvers/sqldb/database.js +43 -4
- package/out/runtime/resolvers/sqldb/database.js.map +1 -1
- package/out/runtime/resolvers/sqldb/impl.d.ts.map +1 -1
- package/out/runtime/resolvers/sqldb/impl.js +7 -3
- package/out/runtime/resolvers/sqldb/impl.js.map +1 -1
- package/out/runtime/state.d.ts +31 -3
- package/out/runtime/state.d.ts.map +1 -1
- package/out/runtime/state.js +11 -1
- package/out/runtime/state.js.map +1 -1
- package/out/runtime/util.d.ts +5 -0
- package/out/runtime/util.d.ts.map +1 -1
- package/out/runtime/util.js +27 -0
- package/out/runtime/util.js.map +1 -1
- package/out/syntaxes/agentlang.monarch.js +2 -2
- package/out/syntaxes/agentlang.monarch.js.map +1 -1
- package/out/utils/http.d.ts +2 -0
- package/out/utils/http.d.ts.map +1 -0
- package/out/utils/http.js +5 -0
- package/out/utils/http.js.map +1 -0
- package/package.json +8 -6
- package/src/api/http.ts +41 -17
- package/src/cli/main.ts +6 -12
- package/src/language/agentlang.langium +35 -10
- package/src/language/generated/ast.ts +257 -45
- package/src/language/generated/grammar.ts +1000 -305
- package/src/language/generated/module.ts +1 -1
- package/src/language/parser.ts +12 -8
- package/src/runtime/agents/common.ts +1 -1
- package/src/runtime/auth/cognito.ts +605 -74
- package/src/runtime/auth/defs.ts +17 -1
- package/src/runtime/auth/interface.ts +6 -1
- package/src/runtime/defs.ts +45 -0
- package/src/runtime/interpreter.ts +43 -34
- package/src/runtime/loader.ts +172 -30
- package/src/runtime/module.ts +257 -10
- package/src/runtime/modules/ai.ts +52 -28
- package/src/runtime/modules/auth.ts +343 -40
- package/src/runtime/modules/core.ts +3 -1
- package/src/runtime/relgraph.ts +2 -8
- package/src/runtime/resolvers/interface.ts +141 -6
- package/src/runtime/resolvers/registry.ts +5 -2
- package/src/runtime/resolvers/sqldb/database.ts +55 -4
- package/src/runtime/resolvers/sqldb/impl.ts +8 -7
- package/src/runtime/state.ts +11 -1
- package/src/runtime/util.ts +29 -0
- package/src/syntaxes/agentlang.monarch.ts +2 -2
- package/src/utils/http.ts +5 -0
- package/src/index.ts +0 -29
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/******************************************************************************
|
|
2
|
-
* This file was generated by langium-cli 3.5.
|
|
2
|
+
* This file was generated by langium-cli 3.5.2.
|
|
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 = {
|
|
10
10
|
ID: /(([_a-zA-Z][\w_]*)(\/([_a-zA-Z][\w_]*))?)/,
|
|
11
|
-
STRING: /([
|
|
11
|
+
STRING: /("(((\\([\s\S]))|((?!(((\\|")|\r)|\n))[\s\S]*?))|(\r?\n))*")/,
|
|
12
12
|
INT: /-?[0-9]+/,
|
|
13
13
|
WS: /\s+/,
|
|
14
14
|
ML_COMMENT: /\/\*[\s\S]*?\*\//,
|
|
@@ -36,6 +36,7 @@ export type AgentlangKeywordNames =
|
|
|
36
36
|
| ">="
|
|
37
37
|
| "?"
|
|
38
38
|
| "@"
|
|
39
|
+
| "@actions"
|
|
39
40
|
| "@after"
|
|
40
41
|
| "@async"
|
|
41
42
|
| "@before"
|
|
@@ -45,9 +46,11 @@ export type AgentlangKeywordNames =
|
|
|
45
46
|
| "@oneof"
|
|
46
47
|
| "@rbac"
|
|
47
48
|
| "@ref"
|
|
49
|
+
| "@upsert"
|
|
48
50
|
| "@with_unique"
|
|
49
51
|
| "["
|
|
50
52
|
| "]"
|
|
53
|
+
| "agent"
|
|
51
54
|
| "allow"
|
|
52
55
|
| "and"
|
|
53
56
|
| "as"
|
|
@@ -72,12 +75,16 @@ export type AgentlangKeywordNames =
|
|
|
72
75
|
| "module"
|
|
73
76
|
| "not"
|
|
74
77
|
| "not_found"
|
|
78
|
+
| "onSubscription"
|
|
75
79
|
| "or"
|
|
76
80
|
| "purge"
|
|
81
|
+
| "query"
|
|
77
82
|
| "read"
|
|
78
83
|
| "record"
|
|
79
84
|
| "relationship"
|
|
85
|
+
| "resolver"
|
|
80
86
|
| "roles"
|
|
87
|
+
| "subscribe"
|
|
81
88
|
| "true"
|
|
82
89
|
| "update"
|
|
83
90
|
| "upsert"
|
|
@@ -108,7 +115,7 @@ export function isDecimal(item: unknown): item is Decimal {
|
|
|
108
115
|
return typeof item === 'number';
|
|
109
116
|
}
|
|
110
117
|
|
|
111
|
-
export type Definition = RelationshipDefinition | SchemaDefinition | StandaloneStatement | WorkflowDefinition;
|
|
118
|
+
export type Definition = AgentDefinition | RelationshipDefinition | ResolverDefinition | SchemaDefinition | StandaloneStatement | WorkflowDefinition;
|
|
112
119
|
|
|
113
120
|
export const Definition = 'Definition';
|
|
114
121
|
|
|
@@ -158,6 +165,19 @@ export function isTaggedId(item: unknown): item is TaggedId {
|
|
|
158
165
|
return typeof item === 'string';
|
|
159
166
|
}
|
|
160
167
|
|
|
168
|
+
export interface ActionEntry extends langium.AstNode {
|
|
169
|
+
readonly $container: EntityActionsDefinitions;
|
|
170
|
+
readonly $type: 'ActionEntry';
|
|
171
|
+
event: string;
|
|
172
|
+
name: string;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export const ActionEntry = 'ActionEntry';
|
|
176
|
+
|
|
177
|
+
export function isActionEntry(item: unknown): item is ActionEntry {
|
|
178
|
+
return reflection.isInstance(item, ActionEntry);
|
|
179
|
+
}
|
|
180
|
+
|
|
161
181
|
export interface AfterTriggerDefinition extends langium.AstNode {
|
|
162
182
|
readonly $container: PrePostTriggerDefinition;
|
|
163
183
|
readonly $type: 'AfterTriggerDefinition';
|
|
@@ -170,6 +190,44 @@ export function isAfterTriggerDefinition(item: unknown): item is AfterTriggerDef
|
|
|
170
190
|
return reflection.isInstance(item, AfterTriggerDefinition);
|
|
171
191
|
}
|
|
172
192
|
|
|
193
|
+
export interface AgentDefBody extends langium.AstNode {
|
|
194
|
+
readonly $container: AgentDefinition;
|
|
195
|
+
readonly $type: 'AgentDefBody';
|
|
196
|
+
attributes: Array<AgentPropertyDef>;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export const AgentDefBody = 'AgentDefBody';
|
|
200
|
+
|
|
201
|
+
export function isAgentDefBody(item: unknown): item is AgentDefBody {
|
|
202
|
+
return reflection.isInstance(item, AgentDefBody);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
export interface AgentDefinition extends langium.AstNode {
|
|
206
|
+
readonly $container: ModuleDefinition;
|
|
207
|
+
readonly $type: 'AgentDefinition';
|
|
208
|
+
body?: AgentDefBody;
|
|
209
|
+
name: string;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export const AgentDefinition = 'AgentDefinition';
|
|
213
|
+
|
|
214
|
+
export function isAgentDefinition(item: unknown): item is AgentDefinition {
|
|
215
|
+
return reflection.isInstance(item, AgentDefinition);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
export interface AgentPropertyDef extends langium.AstNode {
|
|
219
|
+
readonly $container: AgentDefBody;
|
|
220
|
+
readonly $type: 'AgentPropertyDef';
|
|
221
|
+
name: string;
|
|
222
|
+
value: Literal;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export const AgentPropertyDef = 'AgentPropertyDef';
|
|
226
|
+
|
|
227
|
+
export function isAgentPropertyDef(item: unknown): item is AgentPropertyDef {
|
|
228
|
+
return reflection.isInstance(item, AgentPropertyDef);
|
|
229
|
+
}
|
|
230
|
+
|
|
173
231
|
export interface AliasSpec extends langium.AstNode {
|
|
174
232
|
readonly $container: RuntimeHint;
|
|
175
233
|
readonly $type: 'AliasSpec';
|
|
@@ -277,13 +335,13 @@ export function isCompositeUniqueDefinition(item: unknown): item is CompositeUni
|
|
|
277
335
|
}
|
|
278
336
|
|
|
279
337
|
export interface CrudMap extends langium.AstNode {
|
|
280
|
-
readonly $container: Pattern
|
|
338
|
+
readonly $container: Pattern;
|
|
281
339
|
readonly $type: 'CrudMap';
|
|
282
|
-
|
|
340
|
+
body?: CrudMapBody;
|
|
283
341
|
into?: SelectIntoSpec;
|
|
284
342
|
name: QueryId | string;
|
|
285
|
-
properties: Array<PropertyDefinition>;
|
|
286
343
|
relationships: Array<RelationshipPattern>;
|
|
344
|
+
upsert?: '@upsert';
|
|
287
345
|
}
|
|
288
346
|
|
|
289
347
|
export const CrudMap = 'CrudMap';
|
|
@@ -292,6 +350,19 @@ export function isCrudMap(item: unknown): item is CrudMap {
|
|
|
292
350
|
return reflection.isInstance(item, CrudMap);
|
|
293
351
|
}
|
|
294
352
|
|
|
353
|
+
export interface CrudMapBody extends langium.AstNode {
|
|
354
|
+
readonly $container: CrudMap;
|
|
355
|
+
readonly $type: 'CrudMapBody';
|
|
356
|
+
attributes: Array<SetAttribute>;
|
|
357
|
+
properties: Array<PropertyDefinition>;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
export const CrudMapBody = 'CrudMapBody';
|
|
361
|
+
|
|
362
|
+
export function isCrudMapBody(item: unknown): item is CrudMapBody {
|
|
363
|
+
return reflection.isInstance(item, CrudMapBody);
|
|
364
|
+
}
|
|
365
|
+
|
|
295
366
|
export interface Delete extends langium.AstNode {
|
|
296
367
|
readonly $container: Pattern;
|
|
297
368
|
readonly $type: 'Delete';
|
|
@@ -316,6 +387,18 @@ export function isElse(item: unknown): item is Else {
|
|
|
316
387
|
return reflection.isInstance(item, Else);
|
|
317
388
|
}
|
|
318
389
|
|
|
390
|
+
export interface EntityActionsDefinitions extends langium.AstNode {
|
|
391
|
+
readonly $container: RecordExtraDefinition;
|
|
392
|
+
readonly $type: 'EntityActionsDefinitions';
|
|
393
|
+
entries: Array<ActionEntry>;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
export const EntityActionsDefinitions = 'EntityActionsDefinitions';
|
|
397
|
+
|
|
398
|
+
export function isEntityActionsDefinitions(item: unknown): item is EntityActionsDefinitions {
|
|
399
|
+
return reflection.isInstance(item, EntityActionsDefinitions);
|
|
400
|
+
}
|
|
401
|
+
|
|
319
402
|
export interface EntityDefinition extends langium.AstNode {
|
|
320
403
|
readonly $container: ModuleDefinition;
|
|
321
404
|
readonly $type: 'EntityDefinition';
|
|
@@ -487,7 +570,7 @@ export function isKvPairs(item: unknown): item is KvPairs {
|
|
|
487
570
|
}
|
|
488
571
|
|
|
489
572
|
export interface Literal extends langium.AstNode {
|
|
490
|
-
readonly $container: AttributeDefinition | BinExpr | FnCall | FullTextSearch | Group | If | KvPair | MapEntry | NegExpr | NotExpr | Pattern | SetAttribute;
|
|
573
|
+
readonly $container: AgentPropertyDef | AttributeDefinition | BinExpr | FnCall | FullTextSearch | Group | If | KvPair | MapEntry | NegExpr | NotExpr | Pattern | SetAttribute;
|
|
491
574
|
readonly $type: 'Literal';
|
|
492
575
|
array?: ArrayLiteral;
|
|
493
576
|
asyncFnCall?: AsyncFnCall;
|
|
@@ -629,7 +712,6 @@ export interface Pattern extends langium.AstNode {
|
|
|
629
712
|
if?: If;
|
|
630
713
|
literal?: Literal;
|
|
631
714
|
purge?: Purge;
|
|
632
|
-
upsert?: Upsert;
|
|
633
715
|
}
|
|
634
716
|
|
|
635
717
|
export const Pattern = 'Pattern';
|
|
@@ -652,7 +734,7 @@ export function isPrePostTriggerDefinition(item: unknown): item is PrePostTrigge
|
|
|
652
734
|
}
|
|
653
735
|
|
|
654
736
|
export interface PropertyDefinition extends langium.AstNode {
|
|
655
|
-
readonly $container: AttributeDefinition |
|
|
737
|
+
readonly $container: AttributeDefinition | CrudMapBody | RelationshipDefinition;
|
|
656
738
|
readonly $type: 'PropertyDefinition';
|
|
657
739
|
name: TaggedId;
|
|
658
740
|
value?: KvPairs;
|
|
@@ -716,7 +798,7 @@ export function isRbacOpr(item: unknown): item is RbacOpr {
|
|
|
716
798
|
export interface RbacRolesSpec extends langium.AstNode {
|
|
717
799
|
readonly $container: RbacSpecEntry;
|
|
718
800
|
readonly $type: 'RbacRolesSpec';
|
|
719
|
-
roles: Array<string>;
|
|
801
|
+
roles: Array<'*' | string>;
|
|
720
802
|
}
|
|
721
803
|
|
|
722
804
|
export const RbacRolesSpec = 'RbacRolesSpec';
|
|
@@ -780,6 +862,7 @@ export function isRecordDefinition(item: unknown): item is RecordDefinition {
|
|
|
780
862
|
export interface RecordExtraDefinition extends langium.AstNode {
|
|
781
863
|
readonly $container: RecordSchemaDefinition;
|
|
782
864
|
readonly $type: 'RecordExtraDefinition';
|
|
865
|
+
actions?: EntityActionsDefinitions;
|
|
783
866
|
meta?: MetaDefinition;
|
|
784
867
|
prePost?: PrePostTriggerDefinition;
|
|
785
868
|
rbacSpec?: RbacSpecDefinition;
|
|
@@ -859,6 +942,57 @@ export function isRelNodes(item: unknown): item is RelNodes {
|
|
|
859
942
|
return reflection.isInstance(item, RelNodes);
|
|
860
943
|
}
|
|
861
944
|
|
|
945
|
+
export interface ResolverDefinition extends langium.AstNode {
|
|
946
|
+
readonly $container: ModuleDefinition;
|
|
947
|
+
readonly $type: 'ResolverDefinition';
|
|
948
|
+
methods: Array<ResolverMethodSpec>;
|
|
949
|
+
name: string;
|
|
950
|
+
paths: Array<string>;
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
export const ResolverDefinition = 'ResolverDefinition';
|
|
954
|
+
|
|
955
|
+
export function isResolverDefinition(item: unknown): item is ResolverDefinition {
|
|
956
|
+
return reflection.isInstance(item, ResolverDefinition);
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
export interface ResolverFnName extends langium.AstNode {
|
|
960
|
+
readonly $container: ResolverMethodSpec;
|
|
961
|
+
readonly $type: 'ResolverFnName';
|
|
962
|
+
name: Ref | string;
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
export const ResolverFnName = 'ResolverFnName';
|
|
966
|
+
|
|
967
|
+
export function isResolverFnName(item: unknown): item is ResolverFnName {
|
|
968
|
+
return reflection.isInstance(item, ResolverFnName);
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
export interface ResolverMethodName extends langium.AstNode {
|
|
972
|
+
readonly $container: ResolverMethodSpec;
|
|
973
|
+
readonly $type: 'ResolverMethodName';
|
|
974
|
+
name: 'create' | 'delete' | 'onSubscription' | 'query' | 'subscribe' | 'update' | 'upsert';
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
export const ResolverMethodName = 'ResolverMethodName';
|
|
978
|
+
|
|
979
|
+
export function isResolverMethodName(item: unknown): item is ResolverMethodName {
|
|
980
|
+
return reflection.isInstance(item, ResolverMethodName);
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
export interface ResolverMethodSpec extends langium.AstNode {
|
|
984
|
+
readonly $container: ResolverDefinition;
|
|
985
|
+
readonly $type: 'ResolverMethodSpec';
|
|
986
|
+
fn: ResolverFnName;
|
|
987
|
+
key: ResolverMethodName;
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
export const ResolverMethodSpec = 'ResolverMethodSpec';
|
|
991
|
+
|
|
992
|
+
export function isResolverMethodSpec(item: unknown): item is ResolverMethodSpec {
|
|
993
|
+
return reflection.isInstance(item, ResolverMethodSpec);
|
|
994
|
+
}
|
|
995
|
+
|
|
862
996
|
export interface RuntimeHint extends langium.AstNode {
|
|
863
997
|
readonly $container: Statement;
|
|
864
998
|
readonly $type: 'RuntimeHint';
|
|
@@ -898,7 +1032,7 @@ export function isSelectIntoSpec(item: unknown): item is SelectIntoSpec {
|
|
|
898
1032
|
}
|
|
899
1033
|
|
|
900
1034
|
export interface SetAttribute extends langium.AstNode {
|
|
901
|
-
readonly $container:
|
|
1035
|
+
readonly $container: CrudMapBody;
|
|
902
1036
|
readonly $type: 'SetAttribute';
|
|
903
1037
|
name: QueryId;
|
|
904
1038
|
op?: '<' | '<=' | '<>' | '=' | '>' | '>=' | 'between' | 'in' | 'like';
|
|
@@ -962,18 +1096,6 @@ export function isTriggerEntry(item: unknown): item is TriggerEntry {
|
|
|
962
1096
|
return reflection.isInstance(item, TriggerEntry);
|
|
963
1097
|
}
|
|
964
1098
|
|
|
965
|
-
export interface Upsert extends langium.AstNode {
|
|
966
|
-
readonly $container: Pattern;
|
|
967
|
-
readonly $type: 'Upsert';
|
|
968
|
-
pattern: CrudMap;
|
|
969
|
-
}
|
|
970
|
-
|
|
971
|
-
export const Upsert = 'Upsert';
|
|
972
|
-
|
|
973
|
-
export function isUpsert(item: unknown): item is Upsert {
|
|
974
|
-
return reflection.isInstance(item, Upsert);
|
|
975
|
-
}
|
|
976
|
-
|
|
977
1099
|
export interface WorkflowDefinition extends langium.AstNode {
|
|
978
1100
|
readonly $container: ModuleDefinition;
|
|
979
1101
|
readonly $type: 'WorkflowDefinition';
|
|
@@ -988,7 +1110,11 @@ export function isWorkflowDefinition(item: unknown): item is WorkflowDefinition
|
|
|
988
1110
|
}
|
|
989
1111
|
|
|
990
1112
|
export type AgentlangAstType = {
|
|
1113
|
+
ActionEntry: ActionEntry
|
|
991
1114
|
AfterTriggerDefinition: AfterTriggerDefinition
|
|
1115
|
+
AgentDefBody: AgentDefBody
|
|
1116
|
+
AgentDefinition: AgentDefinition
|
|
1117
|
+
AgentPropertyDef: AgentPropertyDef
|
|
992
1118
|
AliasSpec: AliasSpec
|
|
993
1119
|
ArrayLiteral: ArrayLiteral
|
|
994
1120
|
AsyncFnCall: AsyncFnCall
|
|
@@ -999,9 +1125,11 @@ export type AgentlangAstType = {
|
|
|
999
1125
|
CatchSpec: CatchSpec
|
|
1000
1126
|
CompositeUniqueDefinition: CompositeUniqueDefinition
|
|
1001
1127
|
CrudMap: CrudMap
|
|
1128
|
+
CrudMapBody: CrudMapBody
|
|
1002
1129
|
Definition: Definition
|
|
1003
1130
|
Delete: Delete
|
|
1004
1131
|
Else: Else
|
|
1132
|
+
EntityActionsDefinitions: EntityActionsDefinitions
|
|
1005
1133
|
EntityDefinition: EntityDefinition
|
|
1006
1134
|
EnumSpec: EnumSpec
|
|
1007
1135
|
EventDefinition: EventDefinition
|
|
@@ -1045,6 +1173,10 @@ export type AgentlangAstType = {
|
|
|
1045
1173
|
RelNodes: RelNodes
|
|
1046
1174
|
RelationshipDefinition: RelationshipDefinition
|
|
1047
1175
|
RelationshipPattern: RelationshipPattern
|
|
1176
|
+
ResolverDefinition: ResolverDefinition
|
|
1177
|
+
ResolverFnName: ResolverFnName
|
|
1178
|
+
ResolverMethodName: ResolverMethodName
|
|
1179
|
+
ResolverMethodSpec: ResolverMethodSpec
|
|
1048
1180
|
RuntimeHint: RuntimeHint
|
|
1049
1181
|
SchemaDefinition: SchemaDefinition
|
|
1050
1182
|
SelectIntoEntry: SelectIntoEntry
|
|
@@ -1054,18 +1186,25 @@ export type AgentlangAstType = {
|
|
|
1054
1186
|
Statement: Statement
|
|
1055
1187
|
TriggerDefinition: TriggerDefinition
|
|
1056
1188
|
TriggerEntry: TriggerEntry
|
|
1057
|
-
Upsert: Upsert
|
|
1058
1189
|
WorkflowDefinition: WorkflowDefinition
|
|
1059
1190
|
}
|
|
1060
1191
|
|
|
1061
1192
|
export class AgentlangAstReflection extends langium.AbstractAstReflection {
|
|
1062
1193
|
|
|
1063
1194
|
getAllTypes(): string[] {
|
|
1064
|
-
return [AfterTriggerDefinition, AliasSpec, ArrayLiteral, AsyncFnCall, AttributeDefinition, AttributeValueExpression, BeforeTriggerDefinition, BinExpr, CatchSpec, CompositeUniqueDefinition, CrudMap, Definition, Delete, Else, 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, RuntimeHint, SchemaDefinition, SelectIntoEntry, SelectIntoSpec, SetAttribute, StandaloneStatement, Statement, TriggerDefinition, TriggerEntry,
|
|
1195
|
+
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, RuntimeHint, SchemaDefinition, SelectIntoEntry, SelectIntoSpec, SetAttribute, StandaloneStatement, Statement, TriggerDefinition, TriggerEntry, WorkflowDefinition];
|
|
1065
1196
|
}
|
|
1066
1197
|
|
|
1067
1198
|
protected override computeIsSubtype(subtype: string, supertype: string): boolean {
|
|
1068
1199
|
switch (subtype) {
|
|
1200
|
+
case AgentDefinition:
|
|
1201
|
+
case RelationshipDefinition:
|
|
1202
|
+
case ResolverDefinition:
|
|
1203
|
+
case SchemaDefinition:
|
|
1204
|
+
case StandaloneStatement:
|
|
1205
|
+
case WorkflowDefinition: {
|
|
1206
|
+
return this.isSubtype(Definition, supertype);
|
|
1207
|
+
}
|
|
1069
1208
|
case BinExpr:
|
|
1070
1209
|
case PrimExpr: {
|
|
1071
1210
|
return this.isSubtype(Expr, supertype);
|
|
@@ -1084,12 +1223,6 @@ export class AgentlangAstReflection extends langium.AbstractAstReflection {
|
|
|
1084
1223
|
case NotExpr: {
|
|
1085
1224
|
return this.isSubtype(PrimExpr, supertype);
|
|
1086
1225
|
}
|
|
1087
|
-
case RelationshipDefinition:
|
|
1088
|
-
case SchemaDefinition:
|
|
1089
|
-
case StandaloneStatement:
|
|
1090
|
-
case WorkflowDefinition: {
|
|
1091
|
-
return this.isSubtype(Definition, supertype);
|
|
1092
|
-
}
|
|
1093
1226
|
default: {
|
|
1094
1227
|
return false;
|
|
1095
1228
|
}
|
|
@@ -1107,6 +1240,15 @@ export class AgentlangAstReflection extends langium.AbstractAstReflection {
|
|
|
1107
1240
|
|
|
1108
1241
|
getTypeMetaData(type: string): langium.TypeMetaData {
|
|
1109
1242
|
switch (type) {
|
|
1243
|
+
case ActionEntry: {
|
|
1244
|
+
return {
|
|
1245
|
+
name: ActionEntry,
|
|
1246
|
+
properties: [
|
|
1247
|
+
{ name: 'event' },
|
|
1248
|
+
{ name: 'name' }
|
|
1249
|
+
]
|
|
1250
|
+
};
|
|
1251
|
+
}
|
|
1110
1252
|
case AfterTriggerDefinition: {
|
|
1111
1253
|
return {
|
|
1112
1254
|
name: AfterTriggerDefinition,
|
|
@@ -1115,6 +1257,32 @@ export class AgentlangAstReflection extends langium.AbstractAstReflection {
|
|
|
1115
1257
|
]
|
|
1116
1258
|
};
|
|
1117
1259
|
}
|
|
1260
|
+
case AgentDefBody: {
|
|
1261
|
+
return {
|
|
1262
|
+
name: AgentDefBody,
|
|
1263
|
+
properties: [
|
|
1264
|
+
{ name: 'attributes', defaultValue: [] }
|
|
1265
|
+
]
|
|
1266
|
+
};
|
|
1267
|
+
}
|
|
1268
|
+
case AgentDefinition: {
|
|
1269
|
+
return {
|
|
1270
|
+
name: AgentDefinition,
|
|
1271
|
+
properties: [
|
|
1272
|
+
{ name: 'body' },
|
|
1273
|
+
{ name: 'name' }
|
|
1274
|
+
]
|
|
1275
|
+
};
|
|
1276
|
+
}
|
|
1277
|
+
case AgentPropertyDef: {
|
|
1278
|
+
return {
|
|
1279
|
+
name: AgentPropertyDef,
|
|
1280
|
+
properties: [
|
|
1281
|
+
{ name: 'name' },
|
|
1282
|
+
{ name: 'value' }
|
|
1283
|
+
]
|
|
1284
|
+
};
|
|
1285
|
+
}
|
|
1118
1286
|
case AliasSpec: {
|
|
1119
1287
|
return {
|
|
1120
1288
|
name: AliasSpec,
|
|
@@ -1193,11 +1361,20 @@ export class AgentlangAstReflection extends langium.AbstractAstReflection {
|
|
|
1193
1361
|
return {
|
|
1194
1362
|
name: CrudMap,
|
|
1195
1363
|
properties: [
|
|
1196
|
-
{ name: '
|
|
1364
|
+
{ name: 'body' },
|
|
1197
1365
|
{ name: 'into' },
|
|
1198
1366
|
{ name: 'name' },
|
|
1199
|
-
{ name: '
|
|
1200
|
-
{ name: '
|
|
1367
|
+
{ name: 'relationships', defaultValue: [] },
|
|
1368
|
+
{ name: 'upsert' }
|
|
1369
|
+
]
|
|
1370
|
+
};
|
|
1371
|
+
}
|
|
1372
|
+
case CrudMapBody: {
|
|
1373
|
+
return {
|
|
1374
|
+
name: CrudMapBody,
|
|
1375
|
+
properties: [
|
|
1376
|
+
{ name: 'attributes', defaultValue: [] },
|
|
1377
|
+
{ name: 'properties', defaultValue: [] }
|
|
1201
1378
|
]
|
|
1202
1379
|
};
|
|
1203
1380
|
}
|
|
@@ -1217,6 +1394,14 @@ export class AgentlangAstReflection extends langium.AbstractAstReflection {
|
|
|
1217
1394
|
]
|
|
1218
1395
|
};
|
|
1219
1396
|
}
|
|
1397
|
+
case EntityActionsDefinitions: {
|
|
1398
|
+
return {
|
|
1399
|
+
name: EntityActionsDefinitions,
|
|
1400
|
+
properties: [
|
|
1401
|
+
{ name: 'entries', defaultValue: [] }
|
|
1402
|
+
]
|
|
1403
|
+
};
|
|
1404
|
+
}
|
|
1220
1405
|
case EntityDefinition: {
|
|
1221
1406
|
return {
|
|
1222
1407
|
name: EntityDefinition,
|
|
@@ -1439,8 +1624,7 @@ export class AgentlangAstReflection extends langium.AbstractAstReflection {
|
|
|
1439
1624
|
{ name: 'fullTextSearch' },
|
|
1440
1625
|
{ name: 'if' },
|
|
1441
1626
|
{ name: 'literal' },
|
|
1442
|
-
{ name: 'purge' }
|
|
1443
|
-
{ name: 'upsert' }
|
|
1627
|
+
{ name: 'purge' }
|
|
1444
1628
|
]
|
|
1445
1629
|
};
|
|
1446
1630
|
}
|
|
@@ -1543,6 +1727,7 @@ export class AgentlangAstReflection extends langium.AbstractAstReflection {
|
|
|
1543
1727
|
return {
|
|
1544
1728
|
name: RecordExtraDefinition,
|
|
1545
1729
|
properties: [
|
|
1730
|
+
{ name: 'actions' },
|
|
1546
1731
|
{ name: 'meta' },
|
|
1547
1732
|
{ name: 'prePost' },
|
|
1548
1733
|
{ name: 'rbacSpec' },
|
|
@@ -1597,6 +1782,41 @@ export class AgentlangAstReflection extends langium.AbstractAstReflection {
|
|
|
1597
1782
|
]
|
|
1598
1783
|
};
|
|
1599
1784
|
}
|
|
1785
|
+
case ResolverDefinition: {
|
|
1786
|
+
return {
|
|
1787
|
+
name: ResolverDefinition,
|
|
1788
|
+
properties: [
|
|
1789
|
+
{ name: 'methods', defaultValue: [] },
|
|
1790
|
+
{ name: 'name' },
|
|
1791
|
+
{ name: 'paths', defaultValue: [] }
|
|
1792
|
+
]
|
|
1793
|
+
};
|
|
1794
|
+
}
|
|
1795
|
+
case ResolverFnName: {
|
|
1796
|
+
return {
|
|
1797
|
+
name: ResolverFnName,
|
|
1798
|
+
properties: [
|
|
1799
|
+
{ name: 'name' }
|
|
1800
|
+
]
|
|
1801
|
+
};
|
|
1802
|
+
}
|
|
1803
|
+
case ResolverMethodName: {
|
|
1804
|
+
return {
|
|
1805
|
+
name: ResolverMethodName,
|
|
1806
|
+
properties: [
|
|
1807
|
+
{ name: 'name' }
|
|
1808
|
+
]
|
|
1809
|
+
};
|
|
1810
|
+
}
|
|
1811
|
+
case ResolverMethodSpec: {
|
|
1812
|
+
return {
|
|
1813
|
+
name: ResolverMethodSpec,
|
|
1814
|
+
properties: [
|
|
1815
|
+
{ name: 'fn' },
|
|
1816
|
+
{ name: 'key' }
|
|
1817
|
+
]
|
|
1818
|
+
};
|
|
1819
|
+
}
|
|
1600
1820
|
case RuntimeHint: {
|
|
1601
1821
|
return {
|
|
1602
1822
|
name: RuntimeHint,
|
|
@@ -1668,14 +1888,6 @@ export class AgentlangAstReflection extends langium.AbstractAstReflection {
|
|
|
1668
1888
|
]
|
|
1669
1889
|
};
|
|
1670
1890
|
}
|
|
1671
|
-
case Upsert: {
|
|
1672
|
-
return {
|
|
1673
|
-
name: Upsert,
|
|
1674
|
-
properties: [
|
|
1675
|
-
{ name: 'pattern' }
|
|
1676
|
-
]
|
|
1677
|
-
};
|
|
1678
|
-
}
|
|
1679
1891
|
case WorkflowDefinition: {
|
|
1680
1892
|
return {
|
|
1681
1893
|
name: WorkflowDefinition,
|