agentlang 0.0.3 → 0.0.4
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 +12 -0
- 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 +80 -18
- package/out/language/generated/ast.d.ts.map +1 -1
- package/out/language/generated/ast.js +119 -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 +831 -238
- 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 +995 -331
- 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 +148 -29
- package/out/runtime/loader.js.map +1 -1
- package/out/runtime/module.d.ts +48 -5
- package/out/runtime/module.d.ts.map +1 -1
- package/out/runtime/module.js +200 -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 +282 -30
- 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/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 +4 -0
- package/out/runtime/util.d.ts.map +1 -1
- package/out/runtime/util.js +16 -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 +15 -0
- package/src/cli/main.ts +6 -12
- package/src/language/agentlang.langium +31 -10
- package/src/language/generated/ast.ts +212 -44
- package/src/language/generated/grammar.ts +831 -238
- 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 +159 -30
- package/src/runtime/module.ts +243 -10
- package/src/runtime/modules/ai.ts +52 -28
- package/src/runtime/modules/auth.ts +330 -38
- 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/state.ts +11 -1
- package/src/runtime/util.ts +17 -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,19 @@ export function isAfterTriggerDefinition(item: unknown): item is AfterTriggerDef
|
|
|
170
190
|
return reflection.isInstance(item, AfterTriggerDefinition);
|
|
171
191
|
}
|
|
172
192
|
|
|
193
|
+
export interface AgentDefinition extends langium.AstNode {
|
|
194
|
+
readonly $container: ModuleDefinition;
|
|
195
|
+
readonly $type: 'AgentDefinition';
|
|
196
|
+
body?: CrudMapBody;
|
|
197
|
+
name: string;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export const AgentDefinition = 'AgentDefinition';
|
|
201
|
+
|
|
202
|
+
export function isAgentDefinition(item: unknown): item is AgentDefinition {
|
|
203
|
+
return reflection.isInstance(item, AgentDefinition);
|
|
204
|
+
}
|
|
205
|
+
|
|
173
206
|
export interface AliasSpec extends langium.AstNode {
|
|
174
207
|
readonly $container: RuntimeHint;
|
|
175
208
|
readonly $type: 'AliasSpec';
|
|
@@ -277,13 +310,13 @@ export function isCompositeUniqueDefinition(item: unknown): item is CompositeUni
|
|
|
277
310
|
}
|
|
278
311
|
|
|
279
312
|
export interface CrudMap extends langium.AstNode {
|
|
280
|
-
readonly $container: Pattern
|
|
313
|
+
readonly $container: Pattern;
|
|
281
314
|
readonly $type: 'CrudMap';
|
|
282
|
-
|
|
315
|
+
body?: CrudMapBody;
|
|
283
316
|
into?: SelectIntoSpec;
|
|
284
317
|
name: QueryId | string;
|
|
285
|
-
properties: Array<PropertyDefinition>;
|
|
286
318
|
relationships: Array<RelationshipPattern>;
|
|
319
|
+
upsert?: '@upsert';
|
|
287
320
|
}
|
|
288
321
|
|
|
289
322
|
export const CrudMap = 'CrudMap';
|
|
@@ -292,6 +325,19 @@ export function isCrudMap(item: unknown): item is CrudMap {
|
|
|
292
325
|
return reflection.isInstance(item, CrudMap);
|
|
293
326
|
}
|
|
294
327
|
|
|
328
|
+
export interface CrudMapBody extends langium.AstNode {
|
|
329
|
+
readonly $container: AgentDefinition | CrudMap;
|
|
330
|
+
readonly $type: 'CrudMapBody';
|
|
331
|
+
attributes: Array<SetAttribute>;
|
|
332
|
+
properties: Array<PropertyDefinition>;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
export const CrudMapBody = 'CrudMapBody';
|
|
336
|
+
|
|
337
|
+
export function isCrudMapBody(item: unknown): item is CrudMapBody {
|
|
338
|
+
return reflection.isInstance(item, CrudMapBody);
|
|
339
|
+
}
|
|
340
|
+
|
|
295
341
|
export interface Delete extends langium.AstNode {
|
|
296
342
|
readonly $container: Pattern;
|
|
297
343
|
readonly $type: 'Delete';
|
|
@@ -316,6 +362,18 @@ export function isElse(item: unknown): item is Else {
|
|
|
316
362
|
return reflection.isInstance(item, Else);
|
|
317
363
|
}
|
|
318
364
|
|
|
365
|
+
export interface EntityActionsDefinitions extends langium.AstNode {
|
|
366
|
+
readonly $container: RecordExtraDefinition;
|
|
367
|
+
readonly $type: 'EntityActionsDefinitions';
|
|
368
|
+
entries: Array<ActionEntry>;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
export const EntityActionsDefinitions = 'EntityActionsDefinitions';
|
|
372
|
+
|
|
373
|
+
export function isEntityActionsDefinitions(item: unknown): item is EntityActionsDefinitions {
|
|
374
|
+
return reflection.isInstance(item, EntityActionsDefinitions);
|
|
375
|
+
}
|
|
376
|
+
|
|
319
377
|
export interface EntityDefinition extends langium.AstNode {
|
|
320
378
|
readonly $container: ModuleDefinition;
|
|
321
379
|
readonly $type: 'EntityDefinition';
|
|
@@ -629,7 +687,6 @@ export interface Pattern extends langium.AstNode {
|
|
|
629
687
|
if?: If;
|
|
630
688
|
literal?: Literal;
|
|
631
689
|
purge?: Purge;
|
|
632
|
-
upsert?: Upsert;
|
|
633
690
|
}
|
|
634
691
|
|
|
635
692
|
export const Pattern = 'Pattern';
|
|
@@ -652,7 +709,7 @@ export function isPrePostTriggerDefinition(item: unknown): item is PrePostTrigge
|
|
|
652
709
|
}
|
|
653
710
|
|
|
654
711
|
export interface PropertyDefinition extends langium.AstNode {
|
|
655
|
-
readonly $container: AttributeDefinition |
|
|
712
|
+
readonly $container: AttributeDefinition | CrudMapBody | RelationshipDefinition;
|
|
656
713
|
readonly $type: 'PropertyDefinition';
|
|
657
714
|
name: TaggedId;
|
|
658
715
|
value?: KvPairs;
|
|
@@ -716,7 +773,7 @@ export function isRbacOpr(item: unknown): item is RbacOpr {
|
|
|
716
773
|
export interface RbacRolesSpec extends langium.AstNode {
|
|
717
774
|
readonly $container: RbacSpecEntry;
|
|
718
775
|
readonly $type: 'RbacRolesSpec';
|
|
719
|
-
roles: Array<string>;
|
|
776
|
+
roles: Array<'*' | string>;
|
|
720
777
|
}
|
|
721
778
|
|
|
722
779
|
export const RbacRolesSpec = 'RbacRolesSpec';
|
|
@@ -780,6 +837,7 @@ export function isRecordDefinition(item: unknown): item is RecordDefinition {
|
|
|
780
837
|
export interface RecordExtraDefinition extends langium.AstNode {
|
|
781
838
|
readonly $container: RecordSchemaDefinition;
|
|
782
839
|
readonly $type: 'RecordExtraDefinition';
|
|
840
|
+
actions?: EntityActionsDefinitions;
|
|
783
841
|
meta?: MetaDefinition;
|
|
784
842
|
prePost?: PrePostTriggerDefinition;
|
|
785
843
|
rbacSpec?: RbacSpecDefinition;
|
|
@@ -859,6 +917,57 @@ export function isRelNodes(item: unknown): item is RelNodes {
|
|
|
859
917
|
return reflection.isInstance(item, RelNodes);
|
|
860
918
|
}
|
|
861
919
|
|
|
920
|
+
export interface ResolverDefinition extends langium.AstNode {
|
|
921
|
+
readonly $container: ModuleDefinition;
|
|
922
|
+
readonly $type: 'ResolverDefinition';
|
|
923
|
+
methods: Array<ResolverMethodSpec>;
|
|
924
|
+
name: string;
|
|
925
|
+
paths: Array<string>;
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
export const ResolverDefinition = 'ResolverDefinition';
|
|
929
|
+
|
|
930
|
+
export function isResolverDefinition(item: unknown): item is ResolverDefinition {
|
|
931
|
+
return reflection.isInstance(item, ResolverDefinition);
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
export interface ResolverFnName extends langium.AstNode {
|
|
935
|
+
readonly $container: ResolverMethodSpec;
|
|
936
|
+
readonly $type: 'ResolverFnName';
|
|
937
|
+
name: Ref | string;
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
export const ResolverFnName = 'ResolverFnName';
|
|
941
|
+
|
|
942
|
+
export function isResolverFnName(item: unknown): item is ResolverFnName {
|
|
943
|
+
return reflection.isInstance(item, ResolverFnName);
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
export interface ResolverMethodName extends langium.AstNode {
|
|
947
|
+
readonly $container: ResolverMethodSpec;
|
|
948
|
+
readonly $type: 'ResolverMethodName';
|
|
949
|
+
name: 'create' | 'delete' | 'onSubscription' | 'query' | 'subscribe' | 'update' | 'upsert';
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
export const ResolverMethodName = 'ResolverMethodName';
|
|
953
|
+
|
|
954
|
+
export function isResolverMethodName(item: unknown): item is ResolverMethodName {
|
|
955
|
+
return reflection.isInstance(item, ResolverMethodName);
|
|
956
|
+
}
|
|
957
|
+
|
|
958
|
+
export interface ResolverMethodSpec extends langium.AstNode {
|
|
959
|
+
readonly $container: ResolverDefinition;
|
|
960
|
+
readonly $type: 'ResolverMethodSpec';
|
|
961
|
+
fn: ResolverFnName;
|
|
962
|
+
key: ResolverMethodName;
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
export const ResolverMethodSpec = 'ResolverMethodSpec';
|
|
966
|
+
|
|
967
|
+
export function isResolverMethodSpec(item: unknown): item is ResolverMethodSpec {
|
|
968
|
+
return reflection.isInstance(item, ResolverMethodSpec);
|
|
969
|
+
}
|
|
970
|
+
|
|
862
971
|
export interface RuntimeHint extends langium.AstNode {
|
|
863
972
|
readonly $container: Statement;
|
|
864
973
|
readonly $type: 'RuntimeHint';
|
|
@@ -898,7 +1007,7 @@ export function isSelectIntoSpec(item: unknown): item is SelectIntoSpec {
|
|
|
898
1007
|
}
|
|
899
1008
|
|
|
900
1009
|
export interface SetAttribute extends langium.AstNode {
|
|
901
|
-
readonly $container:
|
|
1010
|
+
readonly $container: CrudMapBody;
|
|
902
1011
|
readonly $type: 'SetAttribute';
|
|
903
1012
|
name: QueryId;
|
|
904
1013
|
op?: '<' | '<=' | '<>' | '=' | '>' | '>=' | 'between' | 'in' | 'like';
|
|
@@ -962,18 +1071,6 @@ export function isTriggerEntry(item: unknown): item is TriggerEntry {
|
|
|
962
1071
|
return reflection.isInstance(item, TriggerEntry);
|
|
963
1072
|
}
|
|
964
1073
|
|
|
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
1074
|
export interface WorkflowDefinition extends langium.AstNode {
|
|
978
1075
|
readonly $container: ModuleDefinition;
|
|
979
1076
|
readonly $type: 'WorkflowDefinition';
|
|
@@ -988,7 +1085,9 @@ export function isWorkflowDefinition(item: unknown): item is WorkflowDefinition
|
|
|
988
1085
|
}
|
|
989
1086
|
|
|
990
1087
|
export type AgentlangAstType = {
|
|
1088
|
+
ActionEntry: ActionEntry
|
|
991
1089
|
AfterTriggerDefinition: AfterTriggerDefinition
|
|
1090
|
+
AgentDefinition: AgentDefinition
|
|
992
1091
|
AliasSpec: AliasSpec
|
|
993
1092
|
ArrayLiteral: ArrayLiteral
|
|
994
1093
|
AsyncFnCall: AsyncFnCall
|
|
@@ -999,9 +1098,11 @@ export type AgentlangAstType = {
|
|
|
999
1098
|
CatchSpec: CatchSpec
|
|
1000
1099
|
CompositeUniqueDefinition: CompositeUniqueDefinition
|
|
1001
1100
|
CrudMap: CrudMap
|
|
1101
|
+
CrudMapBody: CrudMapBody
|
|
1002
1102
|
Definition: Definition
|
|
1003
1103
|
Delete: Delete
|
|
1004
1104
|
Else: Else
|
|
1105
|
+
EntityActionsDefinitions: EntityActionsDefinitions
|
|
1005
1106
|
EntityDefinition: EntityDefinition
|
|
1006
1107
|
EnumSpec: EnumSpec
|
|
1007
1108
|
EventDefinition: EventDefinition
|
|
@@ -1045,6 +1146,10 @@ export type AgentlangAstType = {
|
|
|
1045
1146
|
RelNodes: RelNodes
|
|
1046
1147
|
RelationshipDefinition: RelationshipDefinition
|
|
1047
1148
|
RelationshipPattern: RelationshipPattern
|
|
1149
|
+
ResolverDefinition: ResolverDefinition
|
|
1150
|
+
ResolverFnName: ResolverFnName
|
|
1151
|
+
ResolverMethodName: ResolverMethodName
|
|
1152
|
+
ResolverMethodSpec: ResolverMethodSpec
|
|
1048
1153
|
RuntimeHint: RuntimeHint
|
|
1049
1154
|
SchemaDefinition: SchemaDefinition
|
|
1050
1155
|
SelectIntoEntry: SelectIntoEntry
|
|
@@ -1054,18 +1159,25 @@ export type AgentlangAstType = {
|
|
|
1054
1159
|
Statement: Statement
|
|
1055
1160
|
TriggerDefinition: TriggerDefinition
|
|
1056
1161
|
TriggerEntry: TriggerEntry
|
|
1057
|
-
Upsert: Upsert
|
|
1058
1162
|
WorkflowDefinition: WorkflowDefinition
|
|
1059
1163
|
}
|
|
1060
1164
|
|
|
1061
1165
|
export class AgentlangAstReflection extends langium.AbstractAstReflection {
|
|
1062
1166
|
|
|
1063
1167
|
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,
|
|
1168
|
+
return [ActionEntry, AfterTriggerDefinition, AgentDefinition, 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
1169
|
}
|
|
1066
1170
|
|
|
1067
1171
|
protected override computeIsSubtype(subtype: string, supertype: string): boolean {
|
|
1068
1172
|
switch (subtype) {
|
|
1173
|
+
case AgentDefinition:
|
|
1174
|
+
case RelationshipDefinition:
|
|
1175
|
+
case ResolverDefinition:
|
|
1176
|
+
case SchemaDefinition:
|
|
1177
|
+
case StandaloneStatement:
|
|
1178
|
+
case WorkflowDefinition: {
|
|
1179
|
+
return this.isSubtype(Definition, supertype);
|
|
1180
|
+
}
|
|
1069
1181
|
case BinExpr:
|
|
1070
1182
|
case PrimExpr: {
|
|
1071
1183
|
return this.isSubtype(Expr, supertype);
|
|
@@ -1084,12 +1196,6 @@ export class AgentlangAstReflection extends langium.AbstractAstReflection {
|
|
|
1084
1196
|
case NotExpr: {
|
|
1085
1197
|
return this.isSubtype(PrimExpr, supertype);
|
|
1086
1198
|
}
|
|
1087
|
-
case RelationshipDefinition:
|
|
1088
|
-
case SchemaDefinition:
|
|
1089
|
-
case StandaloneStatement:
|
|
1090
|
-
case WorkflowDefinition: {
|
|
1091
|
-
return this.isSubtype(Definition, supertype);
|
|
1092
|
-
}
|
|
1093
1199
|
default: {
|
|
1094
1200
|
return false;
|
|
1095
1201
|
}
|
|
@@ -1107,6 +1213,15 @@ export class AgentlangAstReflection extends langium.AbstractAstReflection {
|
|
|
1107
1213
|
|
|
1108
1214
|
getTypeMetaData(type: string): langium.TypeMetaData {
|
|
1109
1215
|
switch (type) {
|
|
1216
|
+
case ActionEntry: {
|
|
1217
|
+
return {
|
|
1218
|
+
name: ActionEntry,
|
|
1219
|
+
properties: [
|
|
1220
|
+
{ name: 'event' },
|
|
1221
|
+
{ name: 'name' }
|
|
1222
|
+
]
|
|
1223
|
+
};
|
|
1224
|
+
}
|
|
1110
1225
|
case AfterTriggerDefinition: {
|
|
1111
1226
|
return {
|
|
1112
1227
|
name: AfterTriggerDefinition,
|
|
@@ -1115,6 +1230,15 @@ export class AgentlangAstReflection extends langium.AbstractAstReflection {
|
|
|
1115
1230
|
]
|
|
1116
1231
|
};
|
|
1117
1232
|
}
|
|
1233
|
+
case AgentDefinition: {
|
|
1234
|
+
return {
|
|
1235
|
+
name: AgentDefinition,
|
|
1236
|
+
properties: [
|
|
1237
|
+
{ name: 'body' },
|
|
1238
|
+
{ name: 'name' }
|
|
1239
|
+
]
|
|
1240
|
+
};
|
|
1241
|
+
}
|
|
1118
1242
|
case AliasSpec: {
|
|
1119
1243
|
return {
|
|
1120
1244
|
name: AliasSpec,
|
|
@@ -1193,11 +1317,20 @@ export class AgentlangAstReflection extends langium.AbstractAstReflection {
|
|
|
1193
1317
|
return {
|
|
1194
1318
|
name: CrudMap,
|
|
1195
1319
|
properties: [
|
|
1196
|
-
{ name: '
|
|
1320
|
+
{ name: 'body' },
|
|
1197
1321
|
{ name: 'into' },
|
|
1198
1322
|
{ name: 'name' },
|
|
1199
|
-
{ name: '
|
|
1200
|
-
{ name: '
|
|
1323
|
+
{ name: 'relationships', defaultValue: [] },
|
|
1324
|
+
{ name: 'upsert' }
|
|
1325
|
+
]
|
|
1326
|
+
};
|
|
1327
|
+
}
|
|
1328
|
+
case CrudMapBody: {
|
|
1329
|
+
return {
|
|
1330
|
+
name: CrudMapBody,
|
|
1331
|
+
properties: [
|
|
1332
|
+
{ name: 'attributes', defaultValue: [] },
|
|
1333
|
+
{ name: 'properties', defaultValue: [] }
|
|
1201
1334
|
]
|
|
1202
1335
|
};
|
|
1203
1336
|
}
|
|
@@ -1217,6 +1350,14 @@ export class AgentlangAstReflection extends langium.AbstractAstReflection {
|
|
|
1217
1350
|
]
|
|
1218
1351
|
};
|
|
1219
1352
|
}
|
|
1353
|
+
case EntityActionsDefinitions: {
|
|
1354
|
+
return {
|
|
1355
|
+
name: EntityActionsDefinitions,
|
|
1356
|
+
properties: [
|
|
1357
|
+
{ name: 'entries', defaultValue: [] }
|
|
1358
|
+
]
|
|
1359
|
+
};
|
|
1360
|
+
}
|
|
1220
1361
|
case EntityDefinition: {
|
|
1221
1362
|
return {
|
|
1222
1363
|
name: EntityDefinition,
|
|
@@ -1439,8 +1580,7 @@ export class AgentlangAstReflection extends langium.AbstractAstReflection {
|
|
|
1439
1580
|
{ name: 'fullTextSearch' },
|
|
1440
1581
|
{ name: 'if' },
|
|
1441
1582
|
{ name: 'literal' },
|
|
1442
|
-
{ name: 'purge' }
|
|
1443
|
-
{ name: 'upsert' }
|
|
1583
|
+
{ name: 'purge' }
|
|
1444
1584
|
]
|
|
1445
1585
|
};
|
|
1446
1586
|
}
|
|
@@ -1543,6 +1683,7 @@ export class AgentlangAstReflection extends langium.AbstractAstReflection {
|
|
|
1543
1683
|
return {
|
|
1544
1684
|
name: RecordExtraDefinition,
|
|
1545
1685
|
properties: [
|
|
1686
|
+
{ name: 'actions' },
|
|
1546
1687
|
{ name: 'meta' },
|
|
1547
1688
|
{ name: 'prePost' },
|
|
1548
1689
|
{ name: 'rbacSpec' },
|
|
@@ -1597,6 +1738,41 @@ export class AgentlangAstReflection extends langium.AbstractAstReflection {
|
|
|
1597
1738
|
]
|
|
1598
1739
|
};
|
|
1599
1740
|
}
|
|
1741
|
+
case ResolverDefinition: {
|
|
1742
|
+
return {
|
|
1743
|
+
name: ResolverDefinition,
|
|
1744
|
+
properties: [
|
|
1745
|
+
{ name: 'methods', defaultValue: [] },
|
|
1746
|
+
{ name: 'name' },
|
|
1747
|
+
{ name: 'paths', defaultValue: [] }
|
|
1748
|
+
]
|
|
1749
|
+
};
|
|
1750
|
+
}
|
|
1751
|
+
case ResolverFnName: {
|
|
1752
|
+
return {
|
|
1753
|
+
name: ResolverFnName,
|
|
1754
|
+
properties: [
|
|
1755
|
+
{ name: 'name' }
|
|
1756
|
+
]
|
|
1757
|
+
};
|
|
1758
|
+
}
|
|
1759
|
+
case ResolverMethodName: {
|
|
1760
|
+
return {
|
|
1761
|
+
name: ResolverMethodName,
|
|
1762
|
+
properties: [
|
|
1763
|
+
{ name: 'name' }
|
|
1764
|
+
]
|
|
1765
|
+
};
|
|
1766
|
+
}
|
|
1767
|
+
case ResolverMethodSpec: {
|
|
1768
|
+
return {
|
|
1769
|
+
name: ResolverMethodSpec,
|
|
1770
|
+
properties: [
|
|
1771
|
+
{ name: 'fn' },
|
|
1772
|
+
{ name: 'key' }
|
|
1773
|
+
]
|
|
1774
|
+
};
|
|
1775
|
+
}
|
|
1600
1776
|
case RuntimeHint: {
|
|
1601
1777
|
return {
|
|
1602
1778
|
name: RuntimeHint,
|
|
@@ -1668,14 +1844,6 @@ export class AgentlangAstReflection extends langium.AbstractAstReflection {
|
|
|
1668
1844
|
]
|
|
1669
1845
|
};
|
|
1670
1846
|
}
|
|
1671
|
-
case Upsert: {
|
|
1672
|
-
return {
|
|
1673
|
-
name: Upsert,
|
|
1674
|
-
properties: [
|
|
1675
|
-
{ name: 'pattern' }
|
|
1676
|
-
]
|
|
1677
|
-
};
|
|
1678
|
-
}
|
|
1679
1847
|
case WorkflowDefinition: {
|
|
1680
1848
|
return {
|
|
1681
1849
|
name: WorkflowDefinition,
|