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,5 +1,5 @@
|
|
|
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
|
|
package/src/language/parser.ts
CHANGED
|
@@ -190,13 +190,17 @@ function introspectPattern(pat: Pattern): BasePattern {
|
|
|
190
190
|
function isQueryPattern(pat: Pattern): boolean {
|
|
191
191
|
if (pat.crudMap) {
|
|
192
192
|
const crudMap: CrudMap = pat.crudMap;
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
(
|
|
196
|
-
crudMap.attributes.
|
|
193
|
+
const r = crudMap.name.endsWith(QuerySuffix);
|
|
194
|
+
if (!r && crudMap.body) {
|
|
195
|
+
return (
|
|
196
|
+
crudMap.body.attributes.length > 0 &&
|
|
197
|
+
crudMap.body.attributes.every((v: SetAttribute) => {
|
|
197
198
|
return v.name.endsWith(QuerySuffix);
|
|
198
|
-
})
|
|
199
|
-
|
|
199
|
+
})
|
|
200
|
+
);
|
|
201
|
+
} else {
|
|
202
|
+
return r;
|
|
203
|
+
}
|
|
200
204
|
}
|
|
201
205
|
return false;
|
|
202
206
|
}
|
|
@@ -240,7 +244,7 @@ function introspectExpression(expr: Expr | Expr): BasePattern {
|
|
|
240
244
|
function introspectQueryPattern(crudMap: CrudMap): CrudPattern {
|
|
241
245
|
if (crudMap) {
|
|
242
246
|
const cp: CrudPattern = new CrudPattern(crudMap.name);
|
|
243
|
-
crudMap.attributes.forEach((sa: SetAttribute) => {
|
|
247
|
+
crudMap.body?.attributes.forEach((sa: SetAttribute) => {
|
|
244
248
|
cp.addAttribute(sa.name, introspectExpression(sa.value), sa.op);
|
|
245
249
|
});
|
|
246
250
|
crudMap.relationships.forEach((rp: RelationshipPattern) => {
|
|
@@ -255,7 +259,7 @@ function introspectQueryPattern(crudMap: CrudMap): CrudPattern {
|
|
|
255
259
|
function introspectCreatePattern(crudMap: CrudMap): CrudPattern {
|
|
256
260
|
if (crudMap) {
|
|
257
261
|
const cp: CrudPattern = new CrudPattern(crudMap.name);
|
|
258
|
-
crudMap.attributes.forEach((sa: SetAttribute) => {
|
|
262
|
+
crudMap.body?.attributes.forEach((sa: SetAttribute) => {
|
|
259
263
|
if (!cp.isQueryUpdate && sa.name.endsWith(QuerySuffix)) {
|
|
260
264
|
cp.isQueryUpdate = true;
|
|
261
265
|
}
|
|
@@ -46,7 +46,7 @@ Other than the create-pattern for entities and events, some of the most useful p
|
|
|
46
46
|
To lookup all instances of an entity, use the syntax: '{EntityName?: {}}'.
|
|
47
47
|
2. Update - e.g: '{Erp/Employee {employeeId? "56392e13-0d9a-42f7-b556-0d7cd9468a24", firstName "Joe"}}'. This pattern updates the firstName of the employee
|
|
48
48
|
with the given employeeId.
|
|
49
|
-
3. Upsert - e.g:
|
|
49
|
+
3. Upsert - e.g: '{Erp/Employee {employeeId "56392e13-0d9a-42f7-b556-0d7cd9468a24", firstName "Joe"}, @upsert}'. The 'upsert' pattern will create a new
|
|
50
50
|
instance, if the instance does not already exist.
|
|
51
51
|
4. Delete - e.g: delete '{Erp/Employee {employeeId? "56392e13-0d9a-42f7-b556-0d7cd9468a24"}}'
|
|
52
52
|
|