agentlang 0.6.0 → 0.6.2
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 +37 -73
- package/out/api/http.d.ts.map +1 -1
- package/out/api/http.js +8 -4
- package/out/api/http.js.map +1 -1
- package/out/language/generated/ast.d.ts +7 -3
- package/out/language/generated/ast.d.ts.map +1 -1
- package/out/language/generated/ast.js +8 -1
- package/out/language/generated/ast.js.map +1 -1
- package/out/language/generated/grammar.d.ts.map +1 -1
- package/out/language/generated/grammar.js +201 -152
- package/out/language/generated/grammar.js.map +1 -1
- package/out/language/main.cjs +206 -153
- package/out/language/main.cjs.map +2 -2
- package/out/language/parser.d.ts.map +1 -1
- package/out/language/parser.js +24 -1
- 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 +3 -0
- package/out/runtime/agents/common.js.map +1 -1
- package/out/runtime/defs.d.ts +1 -0
- package/out/runtime/defs.d.ts.map +1 -1
- package/out/runtime/defs.js +3 -0
- package/out/runtime/defs.js.map +1 -1
- package/out/runtime/interpreter.d.ts +4 -0
- package/out/runtime/interpreter.d.ts.map +1 -1
- package/out/runtime/interpreter.js +61 -10
- package/out/runtime/interpreter.js.map +1 -1
- package/out/runtime/loader.d.ts.map +1 -1
- package/out/runtime/loader.js +6 -2
- package/out/runtime/loader.js.map +1 -1
- package/out/runtime/module.d.ts.map +1 -1
- package/out/runtime/module.js +10 -3
- package/out/runtime/module.js.map +1 -1
- package/out/runtime/modules/ai.d.ts +3 -0
- package/out/runtime/modules/ai.d.ts.map +1 -1
- package/out/runtime/modules/ai.js +33 -8
- package/out/runtime/modules/ai.js.map +1 -1
- package/out/runtime/modules/core.d.ts +1 -1
- package/out/runtime/modules/core.d.ts.map +1 -1
- package/out/runtime/modules/core.js +15 -3
- package/out/runtime/modules/core.js.map +1 -1
- package/out/runtime/util.d.ts +3 -0
- package/out/runtime/util.d.ts.map +1 -1
- package/out/runtime/util.js +14 -0
- package/out/runtime/util.js.map +1 -1
- package/package.json +185 -186
- package/src/api/http.ts +13 -3
- package/src/language/agentlang.langium +8 -6
- package/src/language/generated/ast.ts +16 -4
- package/src/language/generated/grammar.ts +201 -152
- package/src/language/parser.ts +25 -1
- package/src/runtime/agents/common.ts +3 -0
- package/src/runtime/defs.ts +4 -0
- package/src/runtime/interpreter.ts +64 -11
- package/src/runtime/loader.ts +5 -2
- package/src/runtime/module.ts +11 -2
- package/src/runtime/modules/ai.ts +42 -8
- package/src/runtime/modules/core.ts +19 -8
- package/src/runtime/util.ts +18 -0
- package/out/setupClassic.d.ts +0 -98
- package/out/setupClassic.d.ts.map +0 -1
- package/out/setupClassic.js +0 -38
- package/out/setupClassic.js.map +0 -1
- package/out/setupCommon.d.ts +0 -2
- package/out/setupCommon.d.ts.map +0 -1
- package/out/setupCommon.js +0 -33
- package/out/setupCommon.js.map +0 -1
- package/out/setupExtended.d.ts +0 -40
- package/out/setupExtended.d.ts.map +0 -1
- package/out/setupExtended.js +0 -67
- package/out/setupExtended.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,187 +1,186 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
}
|
|
2
|
+
"name": "agentlang",
|
|
3
|
+
"description": "The easiest way to build the most reliable AI agents - enterprise-grade teams of AI agents that collaborate with each other and humans",
|
|
4
|
+
"version": "0.6.2",
|
|
5
|
+
"license": "Sustainable Use License",
|
|
6
|
+
"author": "agentlang-ai",
|
|
7
|
+
"homepage": "https://github.com/agentlang-ai/agentlang#readme",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/agentlang-ai/agentlang.git"
|
|
11
|
+
},
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/agentlang-ai/agentlang/issues"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"agentlang",
|
|
17
|
+
"agents-generation",
|
|
18
|
+
"ai-agents",
|
|
19
|
+
"enterprise",
|
|
20
|
+
"multi-agent",
|
|
21
|
+
"no-code",
|
|
22
|
+
"agent-teams",
|
|
23
|
+
"production-ready"
|
|
24
|
+
],
|
|
25
|
+
"files": [
|
|
26
|
+
"bin",
|
|
27
|
+
"out",
|
|
28
|
+
"src",
|
|
29
|
+
"LICENSE"
|
|
30
|
+
],
|
|
31
|
+
"type": "module",
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public",
|
|
34
|
+
"registry": "https://registry.npmjs.org/"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"@aws-sdk/client-cognito-identity": "^3.828.0",
|
|
38
|
+
"@aws-sdk/client-cognito-identity-provider": "^3.828.0",
|
|
39
|
+
"@aws-sdk/credential-providers": "^3.828.0",
|
|
40
|
+
"@isomorphic-git/lightning-fs": "^4.6.1",
|
|
41
|
+
"@langchain/anthropic": "^0.3.32",
|
|
42
|
+
"@langchain/core": "^0.3.78",
|
|
43
|
+
"@langchain/openai": "^0.6.16",
|
|
44
|
+
"@types/jsonwebtoken": "^9.0.10",
|
|
45
|
+
"@types/multer": "^1.4.5-lts.1",
|
|
46
|
+
"amazon-cognito-identity-js": "^6.3.15",
|
|
47
|
+
"aws-jwt-verify": "^5.1.0",
|
|
48
|
+
"bcryptjs": "^3.0.2",
|
|
49
|
+
"buffer": "^6.0.3",
|
|
50
|
+
"chalk": "~5.3.0",
|
|
51
|
+
"commander": "~11.0.0",
|
|
52
|
+
"express": "^5.1.0",
|
|
53
|
+
"handlebars": "^4.7.8",
|
|
54
|
+
"jsonwebtoken": "^9.0.2",
|
|
55
|
+
"langchain": "^0.3.36",
|
|
56
|
+
"langium": "^3.5.0",
|
|
57
|
+
"multer": "^1.4.5-lts.1",
|
|
58
|
+
"openapi-client-axios": "^7.6.0",
|
|
59
|
+
"pg": "^8.16.1",
|
|
60
|
+
"pgvector": "^0.2.1",
|
|
61
|
+
"sql.js": "^1.13.0",
|
|
62
|
+
"sqlite3": "^5.1.7",
|
|
63
|
+
"typeorm": "^0.3.25",
|
|
64
|
+
"vscode-languageserver": "^9.0.1",
|
|
65
|
+
"winston": "^3.17.0",
|
|
66
|
+
"winston-daily-rotate-file": "^5.0.0",
|
|
67
|
+
"zod": "^3.25.55"
|
|
68
|
+
},
|
|
69
|
+
"overrides": {
|
|
70
|
+
"semver": "^7.5.3",
|
|
71
|
+
"trim-newlines": ">=3.0.1"
|
|
72
|
+
},
|
|
73
|
+
"devDependencies": {
|
|
74
|
+
"@codingame/esbuild-import-meta-url-plugin": "~1.0.2",
|
|
75
|
+
"@eslint/js": "^9.26.0",
|
|
76
|
+
"@types/cookie-parser": "^1.4.9",
|
|
77
|
+
"@types/express": "^5.0.1",
|
|
78
|
+
"@types/node": "^18.19.110",
|
|
79
|
+
"@types/sql.js": "^1.4.9",
|
|
80
|
+
"@types/vscode": "^1.100.0",
|
|
81
|
+
"@typescript-eslint/eslint-plugin": "~8.32.1",
|
|
82
|
+
"@typescript-eslint/parser": "~8.32.1",
|
|
83
|
+
"brace-expansion": ">=2.0.2",
|
|
84
|
+
"concurrently": "~8.2.1",
|
|
85
|
+
"esbuild": "^0.25.4",
|
|
86
|
+
"eslint": "~9.26.0",
|
|
87
|
+
"generator-langium": "^3.0.0",
|
|
88
|
+
"http-server": "~14.1.1",
|
|
89
|
+
"langium-cli": "^3.5.0",
|
|
90
|
+
"nodemon": "^3.1.10",
|
|
91
|
+
"prettier": "^3.5.3",
|
|
92
|
+
"typescript": "^5.8.3",
|
|
93
|
+
"typescript-eslint": "^8.32.1",
|
|
94
|
+
"vite": "^6.3.5",
|
|
95
|
+
"vite-plugin-node-polyfills": "^0.24.0",
|
|
96
|
+
"vitest": "^3.1.3",
|
|
97
|
+
"vscode-languageclient": "^9.0.1",
|
|
98
|
+
"vscode-uri": "^3.1.0"
|
|
99
|
+
},
|
|
100
|
+
"volta": {
|
|
101
|
+
"node": ">=20.0.0",
|
|
102
|
+
"npm": ">=10.8.2"
|
|
103
|
+
},
|
|
104
|
+
"displayName": "agentlang",
|
|
105
|
+
"engines": {
|
|
106
|
+
"vscode": "^1.67.0",
|
|
107
|
+
"node": ">=20.0.0"
|
|
108
|
+
},
|
|
109
|
+
"categories": [
|
|
110
|
+
"Programming Languages"
|
|
111
|
+
],
|
|
112
|
+
"contributes": {
|
|
113
|
+
"languages": [
|
|
114
|
+
{
|
|
115
|
+
"id": "agentlang",
|
|
116
|
+
"aliases": [
|
|
117
|
+
"Agentlang",
|
|
118
|
+
"agentlang"
|
|
119
|
+
],
|
|
120
|
+
"extensions": [
|
|
121
|
+
".al"
|
|
122
|
+
],
|
|
123
|
+
"configuration": "./language-configuration.json"
|
|
124
|
+
}
|
|
125
|
+
],
|
|
126
|
+
"grammars": [
|
|
127
|
+
{
|
|
128
|
+
"language": "agentlang",
|
|
129
|
+
"scopeName": "source.agentlang",
|
|
130
|
+
"path": "syntaxes/agentlang.tmLanguage.json"
|
|
131
|
+
}
|
|
132
|
+
]
|
|
133
|
+
},
|
|
134
|
+
"activationEvents": [
|
|
135
|
+
"onLanguage:agentlang"
|
|
136
|
+
],
|
|
137
|
+
"main": "./out/extension/main.cjs",
|
|
138
|
+
"types": "./out/index.d.ts",
|
|
139
|
+
"exports": {
|
|
140
|
+
".": {
|
|
141
|
+
"types": "./out/index.d.ts",
|
|
142
|
+
"import": "./out/extension/main.cjs",
|
|
143
|
+
"require": "./out/extension/main.cjs"
|
|
144
|
+
},
|
|
145
|
+
"./browser": {
|
|
146
|
+
"types": "./out/browser.d.ts",
|
|
147
|
+
"import": "./out/browser.js",
|
|
148
|
+
"default": "./out/browser.js"
|
|
149
|
+
},
|
|
150
|
+
"./src/*": {
|
|
151
|
+
"types": "./out/*.d.ts",
|
|
152
|
+
"import": "./out/*.js",
|
|
153
|
+
"require": "./out/*.js",
|
|
154
|
+
"default": "./out/*.js"
|
|
155
|
+
},
|
|
156
|
+
"./out/*": "./out/*"
|
|
157
|
+
},
|
|
158
|
+
"bin": {
|
|
159
|
+
"agentlang-cli": "./bin/cli.js"
|
|
160
|
+
},
|
|
161
|
+
"lint-staged": {
|
|
162
|
+
"*.{js,ts,tsx}": [
|
|
163
|
+
"eslint --fix --cache",
|
|
164
|
+
"prettier --write"
|
|
165
|
+
],
|
|
166
|
+
"*.{json,md,yml,yaml}": [
|
|
167
|
+
"prettier --write"
|
|
168
|
+
]
|
|
169
|
+
},
|
|
170
|
+
"scripts": {
|
|
171
|
+
"build": "tsc -b tsconfig.src.json && tsc -b tsconfig.declarations.json && node esbuild.mjs",
|
|
172
|
+
"build:ts": "tsc -b tsconfig.src.json",
|
|
173
|
+
"watch": "concurrently -n tsc,esbuild -c blue,yellow \"tsc -b tsconfig.src.json --watch\" \"node esbuild.mjs --watch\"",
|
|
174
|
+
"lint": "eslint . --ext .ts",
|
|
175
|
+
"lint:fix": "eslint . --ext .ts --fix",
|
|
176
|
+
"format": "prettier --write \"src/**/*.{js,ts,tsx,json,md}\"",
|
|
177
|
+
"format:check": "prettier --check \"src/**/*.{js,ts,tsx,json,md}\"",
|
|
178
|
+
"langium:generate": "langium generate",
|
|
179
|
+
"langium:generate:production": "langium generate --mode=production",
|
|
180
|
+
"langium:watch": "langium generate --watch",
|
|
181
|
+
"vscode:prepublish": "npm run build && npm run lint",
|
|
182
|
+
"dev": "vite",
|
|
183
|
+
"test": "vitest run",
|
|
184
|
+
"test:verbose": "VITEST_VERBOSE=true vitest run"
|
|
185
|
+
}
|
|
186
|
+
}
|
package/src/api/http.ts
CHANGED
|
@@ -36,8 +36,14 @@ import {
|
|
|
36
36
|
DefaultFileHandlingDirectory,
|
|
37
37
|
splitRefs,
|
|
38
38
|
splitFqName,
|
|
39
|
+
escapeSepInPath,
|
|
39
40
|
} from '../runtime/util.js';
|
|
40
|
-
import {
|
|
41
|
+
import {
|
|
42
|
+
BadRequestError,
|
|
43
|
+
isPathAttribute,
|
|
44
|
+
PathAttributeNameQuery,
|
|
45
|
+
UnauthorisedError,
|
|
46
|
+
} from '../runtime/defs.js';
|
|
41
47
|
import { evaluate } from '../runtime/interpreter.js';
|
|
42
48
|
import { Config } from '../runtime/state.js';
|
|
43
49
|
import {
|
|
@@ -225,6 +231,9 @@ function patternFromAttributes(
|
|
|
225
231
|
if (av instanceof Object) {
|
|
226
232
|
av = JSON.stringify(av);
|
|
227
233
|
}
|
|
234
|
+
if (isPathAttribute(n)) {
|
|
235
|
+
av = escapeSepInPath(av);
|
|
236
|
+
}
|
|
228
237
|
attrsStrs.push(`${n} ${av}`);
|
|
229
238
|
});
|
|
230
239
|
return `{${moduleName}/${recName} { ${attrsStrs.join(',\n')} }}`;
|
|
@@ -416,10 +425,11 @@ function queryPatternFromPath(path: string, req: Request): string {
|
|
|
416
425
|
const ns = nameToPath(n);
|
|
417
426
|
const pe = ns.getEntryName();
|
|
418
427
|
const pm = ns.hasModule() ? ns.getModuleName() : moduleName;
|
|
419
|
-
const p = parts.slice(0, parts.length - 2).join('/');
|
|
428
|
+
const p = escapeSepInPath(parts.slice(0, parts.length - 2).join('/'));
|
|
420
429
|
return `{${pm}/${pe} {${PathAttributeNameQuery} "${p}"}, ${relName} {${moduleName}/${entityName}? {}}}`;
|
|
421
430
|
}
|
|
422
431
|
entityName = restoreFqName(entityName);
|
|
432
|
+
path = escapeSepInPath(path);
|
|
423
433
|
if (id === undefined) {
|
|
424
434
|
return `{${moduleName}/${entityName} {${PathAttributeNameQuery}like "${path}%"}}`;
|
|
425
435
|
} else {
|
|
@@ -496,7 +506,7 @@ function createChildPattern(moduleName: string, entityName: string, req: Request
|
|
|
496
506
|
const pinfo = parts.slice(-4);
|
|
497
507
|
const parentFqname = forceAsFqName(pinfo[0], moduleName);
|
|
498
508
|
const relName = forceAsFqName(pinfo[2], moduleName);
|
|
499
|
-
const parentPath = parts.slice(0, parts.length - 2).join('/');
|
|
509
|
+
const parentPath = escapeSepInPath(parts.slice(0, parts.length - 2).join('/'));
|
|
500
510
|
const childFqName = forceAsFqName(pinfo[3], moduleName);
|
|
501
511
|
const cparts = nameToPath(childFqName);
|
|
502
512
|
const childModuleName = cparts.getModuleName();
|
|
@@ -115,9 +115,9 @@ AliasSpec: ('@as' (alias=ID | '[' ( aliases+=ID (',' aliases+=ID)*)+ ']'));
|
|
|
115
115
|
|
|
116
116
|
ThenSpec: '@then' '{' (statements+=Statement (';' statements+=Statement)*)+ '}';
|
|
117
117
|
|
|
118
|
-
CrudMap: '{' (name=QueryId '{''}'
|
|
119
|
-
| (name=QualifiedName '{''}' ',' '@from' source=Literal (',' upsert+='@upsert')?)
|
|
120
|
-
| name=QualifiedName body=CrudMapBody)
|
|
118
|
+
CrudMap: '{' (name=QueryId (':')? '{''}'
|
|
119
|
+
| (name=QualifiedName (':')? '{''}' ',' '@from' source=Literal (',' upsert+='@upsert')?)
|
|
120
|
+
| name=QualifiedName (':')? body=CrudMapBody)
|
|
121
121
|
(',' relationships+=RelationshipPattern (',' relationships+=RelationshipPattern)*)?
|
|
122
122
|
(',' join=JoinSpec)?
|
|
123
123
|
(',' into=SelectIntoSpec)?
|
|
@@ -151,9 +151,11 @@ FlowDefinition: 'flow' name=GenericName (body=FlowDefBody? | '{''}');
|
|
|
151
151
|
|
|
152
152
|
FlowDefBody: '{' (entries+=FlowEntry (entries+=FlowEntry)*)+ '}';
|
|
153
153
|
|
|
154
|
-
FlowEntry: root=GenericName '-->' (cond=ConditionalFlowStep | next=
|
|
154
|
+
FlowEntry: root=GenericName '-->' (cond=ConditionalFlowStep | next=FlowStepSpec);
|
|
155
155
|
|
|
156
|
-
ConditionalFlowStep: expr=STRING next=
|
|
156
|
+
ConditionalFlowStep: expr=STRING next=FlowStepSpec;
|
|
157
|
+
|
|
158
|
+
FlowStepSpec: GenericName | CrudMap;
|
|
157
159
|
|
|
158
160
|
DecisionDefinition: 'decision' name=GenericName (body=DecisionDefBody? | '{''}');
|
|
159
161
|
|
|
@@ -200,7 +202,7 @@ Delete: 'delete' pattern=Pattern;
|
|
|
200
202
|
|
|
201
203
|
Purge: 'purge' pattern=Pattern;
|
|
202
204
|
|
|
203
|
-
SetAttribute: name=QueryId op=SqlComparisonOpr? value=AttributeValueExpression;
|
|
205
|
+
SetAttribute: name=QueryId op=SqlComparisonOpr? (':')? value=AttributeValueExpression;
|
|
204
206
|
|
|
205
207
|
SqlComparisonOpr returns string: ('='|'<>' | '!=' |'<'|'<='|'>'|'>='|'in'|'like'|'between');
|
|
206
208
|
|
|
@@ -156,6 +156,14 @@ export function isExpr(item: unknown): item is Expr {
|
|
|
156
156
|
return reflection.isInstance(item, Expr);
|
|
157
157
|
}
|
|
158
158
|
|
|
159
|
+
export type FlowStepSpec = CrudMap;
|
|
160
|
+
|
|
161
|
+
export const FlowStepSpec = 'FlowStepSpec';
|
|
162
|
+
|
|
163
|
+
export function isFlowStepSpec(item: unknown): item is FlowStepSpec {
|
|
164
|
+
return reflection.isInstance(item, FlowStepSpec);
|
|
165
|
+
}
|
|
166
|
+
|
|
159
167
|
export type GenericName = string;
|
|
160
168
|
|
|
161
169
|
export function isGenericName(item: unknown): item is GenericName {
|
|
@@ -424,7 +432,7 @@ export interface ConditionalFlowStep extends langium.AstNode {
|
|
|
424
432
|
readonly $container: FlowEntry;
|
|
425
433
|
readonly $type: 'ConditionalFlowStep';
|
|
426
434
|
expr: string;
|
|
427
|
-
next:
|
|
435
|
+
next: FlowStepSpec;
|
|
428
436
|
}
|
|
429
437
|
|
|
430
438
|
export const ConditionalFlowStep = 'ConditionalFlowStep';
|
|
@@ -434,7 +442,7 @@ export function isConditionalFlowStep(item: unknown): item is ConditionalFlowSte
|
|
|
434
442
|
}
|
|
435
443
|
|
|
436
444
|
export interface CrudMap extends langium.AstNode {
|
|
437
|
-
readonly $container: Pattern;
|
|
445
|
+
readonly $container: ConditionalFlowStep | FlowEntry | Pattern;
|
|
438
446
|
readonly $type: 'CrudMap';
|
|
439
447
|
body?: CrudMapBody;
|
|
440
448
|
distinct: Array<'@distinct'>;
|
|
@@ -622,7 +630,7 @@ export interface FlowEntry extends langium.AstNode {
|
|
|
622
630
|
readonly $container: FlowDefBody;
|
|
623
631
|
readonly $type: 'FlowEntry';
|
|
624
632
|
cond?: ConditionalFlowStep;
|
|
625
|
-
next?:
|
|
633
|
+
next?: FlowStepSpec;
|
|
626
634
|
root: GenericName;
|
|
627
635
|
}
|
|
628
636
|
|
|
@@ -1486,6 +1494,7 @@ export type AgentlangAstType = {
|
|
|
1486
1494
|
FlowDefBody: FlowDefBody
|
|
1487
1495
|
FlowDefinition: FlowDefinition
|
|
1488
1496
|
FlowEntry: FlowEntry
|
|
1497
|
+
FlowStepSpec: FlowStepSpec
|
|
1489
1498
|
FnCall: FnCall
|
|
1490
1499
|
ForEach: ForEach
|
|
1491
1500
|
FullTextSearch: FullTextSearch
|
|
@@ -1555,7 +1564,7 @@ export type AgentlangAstType = {
|
|
|
1555
1564
|
export class AgentlangAstReflection extends langium.AbstractAstReflection {
|
|
1556
1565
|
|
|
1557
1566
|
getAllTypes(): string[] {
|
|
1558
|
-
return [ActionEntry, AfterTriggerDefinition, AgentDefinition, AgentXtraAttribute, AgentXtraSpec, AliasSpec, ArrayLiteral, AsyncFnCall, AttributeDefinition, AttributeValueExpression, BackoffSpec, BeforeTriggerDefinition, BinExpr, CaseEntry, CatchSpec, CompositeUniqueDefinition, ConditionalFlowStep, CrudMap, CrudMapBody, DecisionDefBody, DecisionDefinition, Definition, Delete, DirectiveDefinition, Else, EntityActionsDefinitions, EntityDefinition, EnumSpec, EventDefinition, Expr, ExtendsClause, FlowDefBody, FlowDefinition, FlowEntry, FnCall, ForEach, FullTextSearch, GenericDefBody, GenericPropertyDef, GlossaryEntryDefinition, Group, Handler, If, Import, JoinSpec, KvPair, KvPairs, Literal, MapEntry, MapKey, MapLiteral, MetaDefinition, ModuleDefinition, NegExpr, NodeDefinition, NotExpr, OneOfSpec, Pattern, PrePostTriggerDefinition, PrimExpr, PropertyDefinition, PublicAgentDefinition, PublicEventDefinition, PublicWorkflowDefinition, Purge, RbacAllowSpec, RbacExpressionSpec, RbacOpr, RbacRolesSpec, RbacSpecDefinition, RbacSpecEntries, RbacSpecEntry, RecordDefinition, RecordExtraDefinition, RecordSchemaDefinition, RefSpec, RelNodes, RelationshipDefinition, RelationshipPattern, ResolverDefinition, ResolverFnName, ResolverMethodName, ResolverMethodSpec, RetryDefinition, Return, RuntimeHint, ScenarioDefinition, SchemaDefinition, SelectIntoEntry, SelectIntoSpec, SetAttribute, StandaloneStatement, Statement, ThenSpec, TriggerDefinition, TriggerEntry, WorkflowDefinition, WorkflowHeader];
|
|
1567
|
+
return [ActionEntry, AfterTriggerDefinition, AgentDefinition, AgentXtraAttribute, AgentXtraSpec, AliasSpec, ArrayLiteral, AsyncFnCall, AttributeDefinition, AttributeValueExpression, BackoffSpec, BeforeTriggerDefinition, BinExpr, CaseEntry, CatchSpec, CompositeUniqueDefinition, ConditionalFlowStep, CrudMap, CrudMapBody, DecisionDefBody, DecisionDefinition, Definition, Delete, DirectiveDefinition, Else, EntityActionsDefinitions, EntityDefinition, EnumSpec, EventDefinition, Expr, ExtendsClause, FlowDefBody, FlowDefinition, FlowEntry, FlowStepSpec, FnCall, ForEach, FullTextSearch, GenericDefBody, GenericPropertyDef, GlossaryEntryDefinition, Group, Handler, If, Import, JoinSpec, KvPair, KvPairs, Literal, MapEntry, MapKey, MapLiteral, MetaDefinition, ModuleDefinition, NegExpr, NodeDefinition, NotExpr, OneOfSpec, Pattern, PrePostTriggerDefinition, PrimExpr, PropertyDefinition, PublicAgentDefinition, PublicEventDefinition, PublicWorkflowDefinition, Purge, RbacAllowSpec, RbacExpressionSpec, RbacOpr, RbacRolesSpec, RbacSpecDefinition, RbacSpecEntries, RbacSpecEntry, RecordDefinition, RecordExtraDefinition, RecordSchemaDefinition, RefSpec, RelNodes, RelationshipDefinition, RelationshipPattern, ResolverDefinition, ResolverFnName, ResolverMethodName, ResolverMethodSpec, RetryDefinition, Return, RuntimeHint, ScenarioDefinition, SchemaDefinition, SelectIntoEntry, SelectIntoSpec, SetAttribute, StandaloneStatement, Statement, ThenSpec, TriggerDefinition, TriggerEntry, WorkflowDefinition, WorkflowHeader];
|
|
1559
1568
|
}
|
|
1560
1569
|
|
|
1561
1570
|
protected override computeIsSubtype(subtype: string, supertype: string): boolean {
|
|
@@ -1580,6 +1589,9 @@ export class AgentlangAstReflection extends langium.AbstractAstReflection {
|
|
|
1580
1589
|
case PrimExpr: {
|
|
1581
1590
|
return this.isSubtype(Expr, supertype);
|
|
1582
1591
|
}
|
|
1592
|
+
case CrudMap: {
|
|
1593
|
+
return this.isSubtype(FlowStepSpec, supertype);
|
|
1594
|
+
}
|
|
1583
1595
|
case EntityDefinition:
|
|
1584
1596
|
case EventDefinition:
|
|
1585
1597
|
case PublicEventDefinition:
|