agentlang 0.0.66 → 0.0.68

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 (59) hide show
  1. package/README.md +9 -9
  2. package/out/api/http.d.ts.map +1 -1
  3. package/out/api/http.js +2 -1
  4. package/out/api/http.js.map +1 -1
  5. package/out/cli/main.d.ts.map +1 -1
  6. package/out/cli/main.js +7 -1
  7. package/out/cli/main.js.map +1 -1
  8. package/out/language/generated/ast.d.ts +1 -1
  9. package/out/language/generated/ast.d.ts.map +1 -1
  10. package/out/language/generated/ast.js +2 -1
  11. package/out/language/generated/ast.js.map +1 -1
  12. package/out/language/generated/grammar.js +1 -1
  13. package/out/language/main.cjs +2 -2
  14. package/out/language/main.cjs.map +2 -2
  15. package/out/runtime/defs.d.ts +58 -0
  16. package/out/runtime/defs.d.ts.map +1 -1
  17. package/out/runtime/defs.js +172 -0
  18. package/out/runtime/defs.js.map +1 -1
  19. package/out/runtime/exec-graph.d.ts +17 -0
  20. package/out/runtime/exec-graph.d.ts.map +1 -0
  21. package/out/runtime/exec-graph.js +434 -0
  22. package/out/runtime/exec-graph.js.map +1 -0
  23. package/out/runtime/interpreter.d.ts +38 -3
  24. package/out/runtime/interpreter.d.ts.map +1 -1
  25. package/out/runtime/interpreter.js +165 -73
  26. package/out/runtime/interpreter.js.map +1 -1
  27. package/out/runtime/module.d.ts +1 -0
  28. package/out/runtime/module.d.ts.map +1 -1
  29. package/out/runtime/module.js +14 -6
  30. package/out/runtime/module.js.map +1 -1
  31. package/out/runtime/modules/ai.d.ts +0 -1
  32. package/out/runtime/modules/ai.d.ts.map +1 -1
  33. package/out/runtime/modules/ai.js +0 -1
  34. package/out/runtime/modules/ai.js.map +1 -1
  35. package/out/runtime/modules/auth.d.ts.map +1 -1
  36. package/out/runtime/modules/auth.js +13 -13
  37. package/out/runtime/modules/auth.js.map +1 -1
  38. package/out/runtime/resolvers/interface.d.ts +1 -0
  39. package/out/runtime/resolvers/interface.d.ts.map +1 -1
  40. package/out/runtime/resolvers/interface.js +5 -0
  41. package/out/runtime/resolvers/interface.js.map +1 -1
  42. package/out/utils/runtime.d.ts +1 -0
  43. package/out/utils/runtime.d.ts.map +1 -1
  44. package/out/utils/runtime.js +4 -0
  45. package/out/utils/runtime.js.map +1 -1
  46. package/package.json +180 -156
  47. package/src/api/http.ts +2 -1
  48. package/src/cli/main.ts +8 -1
  49. package/src/language/agentlang.langium +3 -2
  50. package/src/language/generated/ast.ts +3 -3
  51. package/src/language/generated/grammar.ts +1 -1
  52. package/src/runtime/defs.ts +210 -0
  53. package/src/runtime/exec-graph.ts +518 -0
  54. package/src/runtime/interpreter.ts +202 -81
  55. package/src/runtime/module.ts +15 -6
  56. package/src/runtime/modules/ai.ts +0 -2
  57. package/src/runtime/modules/auth.ts +25 -18
  58. package/src/runtime/resolvers/interface.ts +5 -0
  59. package/src/utils/runtime.ts +6 -0
package/package.json CHANGED
@@ -1,158 +1,182 @@
1
1
  {
2
- "name": "agentlang",
3
- "description": "Please enter a brief description here",
4
- "version": "0.0.66",
5
- "files": ["bin", "out", "src"],
6
- "type": "module",
7
- "scripts": {
8
- "install:pnpm": "pnpm install --prefer-offline",
9
- "build": "tsc -b tsconfig.src.json && tsc -b tsconfig.declarations.json && node esbuild.mjs",
10
- "build:ts": "tsc -b tsconfig.src.json",
11
- "build:vite": "vite build --emptyOutDir",
12
- "watch": "concurrently -n tsc,esbuild -c blue,yellow \"tsc -b tsconfig.src.json --watch\" \"node esbuild.mjs --watch\"",
13
- "lint": "eslint . --ext .ts",
14
- "lint:fix": "eslint . --ext .ts --fix",
15
- "format": "prettier --write \"src/**/*.{js,ts,tsx,json,md}\"",
16
- "format:check": "prettier --check \"src/**/*.{js,ts,tsx,json,md}\"",
17
- "langium:generate": "langium generate",
18
- "langium:generate:production": "langium generate --mode=production",
19
- "langium:watch": "langium generate --watch",
20
- "vscode:prepublish": "npm run build && npm run lint",
21
- "build:web": "npm run build",
22
- "bundle": "vite build",
23
- "bundle:serve": "http-server ./dist --port 5175",
24
- "dev": "vite",
25
- "dev:debug": "vite --debug --force",
26
- "serve": "npm run dev",
27
- "test": "vitest run",
28
- "test:verbose": "VITEST_VERBOSE=true vitest run",
29
- "test:debug": "DEBUG=true vitest run"
30
- },
31
- "dependencies": {
32
- "@aws-sdk/client-cognito-identity": "^3.828.0",
33
- "@aws-sdk/client-cognito-identity-provider": "^3.828.0",
34
- "@aws-sdk/credential-providers": "^3.828.0",
35
- "@codingame/monaco-vscode-editor-service-override": "^17.1.0",
36
- "@codingame/monaco-vscode-keybindings-service-override": "^17.1.0",
37
- "@isomorphic-git/lightning-fs": "^4.6.1",
38
- "@langchain/anthropic": "^0.3.25",
39
- "@langchain/core": "^0.3.59",
40
- "@langchain/openai": "^0.5.18",
41
- "@types/express": "^5.0.1",
42
- "amazon-cognito-identity-js": "^6.3.15",
43
- "aws-jwt-verify": "^5.1.0",
44
- "bcryptjs": "^3.0.2",
45
- "buffer": "^6.0.3",
46
- "chalk": "~5.3.0",
47
- "commander": "~11.0.0",
48
- "dotenv": "^16.5.0",
49
- "express": "^5.1.0",
50
- "fs-extra": "^11.3.0",
51
- "generator-langium": "^3.0.0",
52
- "jsonwebtoken": "^9.0.2",
53
- "jwk-to-pem": "^2.0.7",
54
- "langchain": "^0.3.28",
55
- "langium": "^3.5.0",
56
- "monaco-editor": "~0.52.0",
57
- "monaco-editor-wrapper": "^6.7.0",
58
- "node-fetch": "^2.7.0",
59
- "openapi-client-axios": "^7.6.0",
60
- "pg": "^8.16.1",
61
- "pgvector": "^0.2.1",
62
- "sqlite3": "^5.1.7",
63
- "typeorm": "^0.3.25",
64
- "vscode-languageclient": "^9.0.1",
65
- "vscode-languageserver": "^9.0.1",
66
- "winston": "^3.17.0",
67
- "winston-daily-rotate-file": "^5.0.0",
68
- "zod": "^3.25.55",
69
- "sql.js": "^1.13.0"
70
- },
71
- "overrides": {
72
- "semver": "^7.5.3",
73
- "trim-newlines": ">=3.0.1"
74
- },
75
- "devDependencies": {
76
- "@codingame/esbuild-import-meta-url-plugin": "~1.0.2",
77
- "@eslint/js": "^9.26.0",
78
- "@types/cookie-parser": "^1.4.9",
79
- "@types/node": "^18.19.110",
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
- "http-server": "~14.1.1",
88
- "langium-cli": "^3.5.0",
89
- "monaco-languageclient": "^9.7.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.23.0",
96
- "vitest": "^3.1.3",
97
- "vscode-languageclient": "^9.0.1",
98
- "vscode-uri": "^3.1.0",
99
- "@types/sql.js": "^1.4.9"
100
- },
101
- "volta": {
102
- "node": ">=20.0.0",
103
- "npm": ">=10.8.2"
104
- },
105
- "displayName": "agentlang",
106
- "engines": {
107
- "vscode": "^1.67.0",
108
- "node": ">=20.0.0"
109
- },
110
- "categories": ["Programming Languages"],
111
- "contributes": {
112
- "languages": [
113
- {
114
- "id": "agentlang",
115
- "aliases": ["Agentlang", "agentlang"],
116
- "extensions": [".al"],
117
- "configuration": "./language-configuration.json"
118
- }
119
- ],
120
- "grammars": [
121
- {
122
- "language": "agentlang",
123
- "scopeName": "source.agentlang",
124
- "path": "syntaxes/agentlang.tmLanguage.json"
125
- }
126
- ]
127
- },
128
- "activationEvents": ["onLanguage:agentlang"],
129
- "main": "./out/extension/main.cjs",
130
- "types": "./out/index.d.ts",
131
- "exports": {
132
- ".": {
133
- "types": "./out/index.d.ts",
134
- "import": "./out/extension/main.cjs",
135
- "require": "./out/extension/main.cjs"
136
- },
137
- "./browser": {
138
- "types": "./out/browser.d.ts",
139
- "import": "./out/browser.js",
140
- "default": "./out/browser.js"
141
- },
142
- "./src/*": {
143
- "types": "./out/*.d.ts",
144
- "import": "./out/*.js",
145
- "require": "./out/*.js",
146
- "default": "./out/*.js"
147
- },
148
- "./out/*": "./out/*"
149
- },
150
- "bin": {
151
- "agentlang-cli": "./bin/cli.js"
152
- },
153
- "lint-staged": {
154
- "*.{js,ts,tsx}": ["eslint --fix --cache", "prettier --write"],
155
- "*.{json,md,yml,yaml}": ["prettier --write"]
156
- },
157
- "packageManager": "pnpm@10.13.1+sha512.37ebf1a5c7a30d5fabe0c5df44ee8da4c965ca0c5af3dbab28c3a1681b70a256218d05c81c9c0dcf767ef6b8551eb5b960042b9ed4300c59242336377e01cfad"
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.0.68",
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": ["bin", "out", "src", "LICENSE"],
26
+ "type": "module",
27
+ "publishConfig": {
28
+ "access": "public",
29
+ "registry": "https://registry.npmjs.org/"
30
+ },
31
+ "scripts": {
32
+ "install:pnpm": "pnpm install --prefer-offline",
33
+ "build": "tsc -b tsconfig.src.json && tsc -b tsconfig.declarations.json && node esbuild.mjs",
34
+ "build:ts": "tsc -b tsconfig.src.json",
35
+ "build:vite": "vite build --emptyOutDir",
36
+ "watch": "concurrently -n tsc,esbuild -c blue,yellow \"tsc -b tsconfig.src.json --watch\" \"node esbuild.mjs --watch\"",
37
+ "lint": "eslint . --ext .ts",
38
+ "lint:fix": "eslint . --ext .ts --fix",
39
+ "format": "prettier --write \"src/**/*.{js,ts,tsx,json,md}\"",
40
+ "format:check": "prettier --check \"src/**/*.{js,ts,tsx,json,md}\"",
41
+ "langium:generate": "langium generate",
42
+ "langium:generate:production": "langium generate --mode=production",
43
+ "langium:watch": "langium generate --watch",
44
+ "vscode:prepublish": "npm run build && npm run lint",
45
+ "build:web": "npm run build",
46
+ "bundle": "vite build",
47
+ "bundle:serve": "http-server ./dist --port 5175",
48
+ "dev": "vite",
49
+ "dev:debug": "vite --debug --force",
50
+ "serve": "npm run dev",
51
+ "test": "vitest run",
52
+ "test:verbose": "VITEST_VERBOSE=true vitest run",
53
+ "test:debug": "DEBUG=true vitest run"
54
+ },
55
+ "dependencies": {
56
+ "@aws-sdk/client-cognito-identity": "^3.828.0",
57
+ "@aws-sdk/client-cognito-identity-provider": "^3.828.0",
58
+ "@aws-sdk/credential-providers": "^3.828.0",
59
+ "@codingame/monaco-vscode-editor-service-override": "^17.1.0",
60
+ "@codingame/monaco-vscode-keybindings-service-override": "^17.1.0",
61
+ "@isomorphic-git/lightning-fs": "^4.6.1",
62
+ "@langchain/anthropic": "^0.3.25",
63
+ "@langchain/core": "^0.3.59",
64
+ "@langchain/openai": "^0.5.18",
65
+ "@types/express": "^5.0.1",
66
+ "amazon-cognito-identity-js": "^6.3.15",
67
+ "aws-jwt-verify": "^5.1.0",
68
+ "bcryptjs": "^3.0.2",
69
+ "buffer": "^6.0.3",
70
+ "chalk": "~5.3.0",
71
+ "commander": "~11.0.0",
72
+ "dotenv": "^16.5.0",
73
+ "express": "^5.1.0",
74
+ "fs-extra": "^11.3.0",
75
+ "generator-langium": "^3.0.0",
76
+ "jsonwebtoken": "^9.0.2",
77
+ "jwk-to-pem": "^2.0.7",
78
+ "langchain": "^0.3.28",
79
+ "langium": "^3.5.0",
80
+ "monaco-editor": "~0.52.0",
81
+ "monaco-editor-wrapper": "^6.7.0",
82
+ "node-fetch": "^2.7.0",
83
+ "openapi-client-axios": "^7.6.0",
84
+ "pg": "^8.16.1",
85
+ "pgvector": "^0.2.1",
86
+ "sqlite3": "^5.1.7",
87
+ "typeorm": "^0.3.25",
88
+ "vscode-languageclient": "^9.0.1",
89
+ "vscode-languageserver": "^9.0.1",
90
+ "winston": "^3.17.0",
91
+ "winston-daily-rotate-file": "^5.0.0",
92
+ "zod": "^3.25.55",
93
+ "sql.js": "^1.13.0"
94
+ },
95
+ "overrides": {
96
+ "semver": "^7.5.3",
97
+ "trim-newlines": ">=3.0.1"
98
+ },
99
+ "devDependencies": {
100
+ "@codingame/esbuild-import-meta-url-plugin": "~1.0.2",
101
+ "@eslint/js": "^9.26.0",
102
+ "@types/cookie-parser": "^1.4.9",
103
+ "@types/node": "^18.19.110",
104
+ "@types/vscode": "^1.100.0",
105
+ "@typescript-eslint/eslint-plugin": "~8.32.1",
106
+ "@typescript-eslint/parser": "~8.32.1",
107
+ "brace-expansion": ">=2.0.2",
108
+ "concurrently": "~8.2.1",
109
+ "esbuild": "^0.25.4",
110
+ "eslint": "~9.26.0",
111
+ "http-server": "~14.1.1",
112
+ "langium-cli": "^3.5.0",
113
+ "monaco-languageclient": "^9.7.0",
114
+ "nodemon": "^3.1.10",
115
+ "prettier": "^3.5.3",
116
+ "typescript": "^5.8.3",
117
+ "typescript-eslint": "^8.32.1",
118
+ "vite": "^6.3.5",
119
+ "vite-plugin-node-polyfills": "^0.23.0",
120
+ "vitest": "^3.1.3",
121
+ "vscode-languageclient": "^9.0.1",
122
+ "vscode-uri": "^3.1.0",
123
+ "@types/sql.js": "^1.4.9"
124
+ },
125
+ "volta": {
126
+ "node": ">=20.0.0",
127
+ "npm": ">=10.8.2"
128
+ },
129
+ "displayName": "agentlang",
130
+ "engines": {
131
+ "vscode": "^1.67.0",
132
+ "node": ">=20.0.0"
133
+ },
134
+ "categories": ["Programming Languages"],
135
+ "contributes": {
136
+ "languages": [
137
+ {
138
+ "id": "agentlang",
139
+ "aliases": ["Agentlang", "agentlang"],
140
+ "extensions": [".al"],
141
+ "configuration": "./language-configuration.json"
142
+ }
143
+ ],
144
+ "grammars": [
145
+ {
146
+ "language": "agentlang",
147
+ "scopeName": "source.agentlang",
148
+ "path": "syntaxes/agentlang.tmLanguage.json"
149
+ }
150
+ ]
151
+ },
152
+ "activationEvents": ["onLanguage:agentlang"],
153
+ "main": "./out/extension/main.cjs",
154
+ "types": "./out/index.d.ts",
155
+ "exports": {
156
+ ".": {
157
+ "types": "./out/index.d.ts",
158
+ "import": "./out/extension/main.cjs",
159
+ "require": "./out/extension/main.cjs"
160
+ },
161
+ "./browser": {
162
+ "types": "./out/browser.d.ts",
163
+ "import": "./out/browser.js",
164
+ "default": "./out/browser.js"
165
+ },
166
+ "./src/*": {
167
+ "types": "./out/*.d.ts",
168
+ "import": "./out/*.js",
169
+ "require": "./out/*.js",
170
+ "default": "./out/*.js"
171
+ },
172
+ "./out/*": "./out/*"
173
+ },
174
+ "bin": {
175
+ "agentlang-cli": "./bin/cli.js"
176
+ },
177
+ "lint-staged": {
178
+ "*.{js,ts,tsx}": ["eslint --fix --cache", "prettier --write"],
179
+ "*.{json,md,yml,yaml}": ["prettier --write"]
180
+ },
181
+ "packageManager": "pnpm@10.13.1+sha512.37ebf1a5c7a30d5fabe0c5df44ee8da4c965ca0c5af3dbab28c3a1681b70a256218d05c81c9c0dcf767ef6b8551eb5b960042b9ed4300c59242336377e01cfad"
158
182
  }
package/src/api/http.ts CHANGED
@@ -14,7 +14,7 @@ import {
14
14
  getModuleNames,
15
15
  Record,
16
16
  } from '../runtime/module.js';
17
- import { evaluate, parseAndEvaluateStatement, Result } from '../runtime/interpreter.js';
17
+ import { parseAndEvaluateStatement, Result } from '../runtime/interpreter.js';
18
18
  import { ApplicationSpec } from '../runtime/loader.js';
19
19
  import { logger } from '../runtime/logger.js';
20
20
  import { requireAuth, verifySession } from '../runtime/modules/auth.js';
@@ -30,6 +30,7 @@ import {
30
30
  walkDownInstancePath,
31
31
  } from '../runtime/util.js';
32
32
  import { BadRequestError, PathAttributeNameQuery, UnauthorisedError } from '../runtime/defs.js';
33
+ import { evaluate } from '../runtime/interpreter.js';
33
34
 
34
35
  export function startServer(appSpec: ApplicationSpec, port: number, host?: string) {
35
36
  const app = express();
package/src/cli/main.ts CHANGED
@@ -20,12 +20,13 @@ import { Module } from '../runtime/module.js';
20
20
  import { ModuleDefinition } from '../language/generated/ast.js';
21
21
  import { Config } from '../runtime/state.js';
22
22
  import { prepareIntegrations } from '../runtime/integrations.js';
23
- import { isNodeEnv } from '../utils/runtime.js';
23
+ import { isExecGraphEnabled, isNodeEnv } from '../utils/runtime.js';
24
24
  import { OpenAPIClientAxios } from 'openapi-client-axios';
25
25
  import { registerOpenApiModule } from '../runtime/openapi.js';
26
26
  import { initDatabase } from '../runtime/resolvers/sqldb/database.js';
27
27
  import { runInitFunctions } from '../runtime/util.js';
28
28
  import { startServer } from '../api/http.js';
29
+ import { enableExecutionGraph } from '../runtime/exec-graph.js';
29
30
 
30
31
  const __dirname = url.fileURLToPath(new URL('.', import.meta.url));
31
32
 
@@ -89,7 +90,13 @@ export async function runPostInitTasks(appSpec?: ApplicationSpec, config?: Confi
89
90
  if (appSpec) startServer(appSpec, config?.service?.port || 8080, config?.service?.host);
90
91
  }
91
92
 
93
+ let execGraphEnabled = false;
94
+
92
95
  export async function runPreInitTasks(): Promise<boolean> {
96
+ if (!execGraphEnabled && isExecGraphEnabled()) {
97
+ enableExecutionGraph();
98
+ execGraphEnabled = true;
99
+ }
93
100
  let result: boolean = true;
94
101
  await loadCoreModules().catch((reason: any) => {
95
102
  const msg = `Failed to load core modules - ${reason.toString()}`;
@@ -100,7 +100,8 @@ WorkflowHeaderTag returns string: '@after' | '@before';
100
100
 
101
101
  WorkflowHeaderPrefix returns string: 'create' | 'update' | 'delete';
102
102
 
103
- Pattern: expr=Expr | crudMap=CrudMap | if=If | forEach=ForEach | delete=Delete | purge=Purge | fullTextSearch=FullTextSearch | return=Return;
103
+ Pattern: expr=Expr | crudMap=CrudMap | if=If | forEach=ForEach | delete=Delete | purge=Purge
104
+ | fullTextSearch=FullTextSearch | return=Return;
104
105
 
105
106
  Statement: pattern=Pattern hints+=RuntimeHint*;
106
107
 
@@ -127,7 +128,7 @@ SelectIntoEntry: alias=ID attribute=Ref;
127
128
 
128
129
  FullTextSearch: '{' name=QueryId query=Literal options=MapLiteral? '}';
129
130
 
130
- Return: 'return' pat=Pattern;
131
+ Return: 'return' pattern=Pattern;
131
132
 
132
133
  AgentDefinition: 'agent' name=GenericName (body=GenericDefBody? | '{''}');
133
134
 
@@ -3,7 +3,7 @@
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 = {
@@ -1082,7 +1082,7 @@ export function isResolverMethodSpec(item: unknown): item is ResolverMethodSpec
1082
1082
  export interface Return extends langium.AstNode {
1083
1083
  readonly $container: Pattern;
1084
1084
  readonly $type: 'Return';
1085
- pat: Pattern;
1085
+ pattern: Pattern;
1086
1086
  }
1087
1087
 
1088
1088
  export const Return = 'Return';
@@ -1994,7 +1994,7 @@ export class AgentlangAstReflection extends langium.AbstractAstReflection {
1994
1994
  return {
1995
1995
  name: Return,
1996
1996
  properties: [
1997
- { name: 'pat' }
1997
+ { name: 'pattern' }
1998
1998
  ]
1999
1999
  };
2000
2000
  }
@@ -3734,7 +3734,7 @@ export const AgentlangGrammar = (): Grammar => loadedAgentlangGrammar ?? (loaded
3734
3734
  },
3735
3735
  {
3736
3736
  "$type": "Assignment",
3737
- "feature": "pat",
3737
+ "feature": "pattern",
3738
3738
  "operator": "=",
3739
3739
  "terminal": {
3740
3740
  "$type": "RuleCall",