agentlang 0.8.6 → 0.8.7
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/out/language/agentlang-validator.d.ts +1 -2
- package/out/language/agentlang-validator.d.ts.map +1 -1
- package/out/language/agentlang-validator.js +0 -39
- package/out/language/agentlang-validator.js.map +1 -1
- package/out/language/main.cjs +0 -27
- package/out/language/main.cjs.map +3 -3
- package/out/runtime/loader.d.ts +1 -1
- package/out/runtime/loader.d.ts.map +1 -1
- package/out/runtime/loader.js +20 -11
- package/out/runtime/loader.js.map +1 -1
- package/out/runtime/resolvers/sqldb/dbutil.d.ts +1 -1
- package/out/runtime/resolvers/sqldb/dbutil.d.ts.map +1 -1
- package/out/runtime/resolvers/sqldb/dbutil.js +4 -4
- package/out/runtime/resolvers/sqldb/dbutil.js.map +1 -1
- package/out/runtime/resolvers/sqldb/impl.js +5 -5
- package/out/runtime/resolvers/sqldb/impl.js.map +1 -1
- package/out/runtime/util.d.ts.map +1 -1
- package/out/runtime/util.js +13 -11
- package/out/runtime/util.js.map +1 -1
- package/package.json +1 -1
- package/src/language/agentlang-validator.ts +1 -51
- package/src/runtime/loader.ts +25 -11
- package/src/runtime/resolvers/sqldb/dbutil.ts +4 -4
- package/src/runtime/resolvers/sqldb/impl.ts +5 -5
- package/src/runtime/util.ts +12 -10
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ValidationAcceptor } from 'langium';
|
|
2
|
-
import {
|
|
2
|
+
import { SchemaDefinition } from './generated/ast.js';
|
|
3
3
|
import type { AgentlangServices } from './agentlang-module.js';
|
|
4
4
|
/**
|
|
5
5
|
* Register custom validation checks.
|
|
@@ -9,7 +9,6 @@ export declare function registerValidationChecks(services: AgentlangServices): v
|
|
|
9
9
|
* Implementation of custom validations.
|
|
10
10
|
*/
|
|
11
11
|
export declare class AgentlangValidator {
|
|
12
|
-
checkUniqueDefs(module: ModuleDefinition, accept: ValidationAcceptor): void;
|
|
13
12
|
checkUniqueAttributes(def: SchemaDefinition, accept: ValidationAcceptor): void;
|
|
14
13
|
}
|
|
15
14
|
//# sourceMappingURL=agentlang-validator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agentlang-validator.d.ts","sourceRoot":"","sources":["../../src/language/agentlang-validator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAoB,MAAM,SAAS,CAAC;AACpE,OAAO,
|
|
1
|
+
{"version":3,"file":"agentlang-validator.d.ts","sourceRoot":"","sources":["../../src/language/agentlang-validator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAoB,MAAM,SAAS,CAAC;AACpE,OAAO,EAAyC,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC7F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/D;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,iBAAiB,QAOnE;AAED;;GAEG;AACH,qBAAa,kBAAkB;IAC7B,qBAAqB,CAAC,GAAG,EAAE,gBAAgB,EAAE,MAAM,EAAE,kBAAkB,GAAG,IAAI;CAiB/E"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { isStandaloneStatement, } from './generated/ast.js';
|
|
2
1
|
/**
|
|
3
2
|
* Register custom validation checks.
|
|
4
3
|
*/
|
|
@@ -6,7 +5,6 @@ export function registerValidationChecks(services) {
|
|
|
6
5
|
const registry = services.validation.ValidationRegistry;
|
|
7
6
|
const validator = services.validation.AgentlangValidator;
|
|
8
7
|
const checks = {
|
|
9
|
-
ModuleDefinition: validator.checkUniqueDefs,
|
|
10
8
|
SchemaDefinition: validator.checkUniqueAttributes,
|
|
11
9
|
};
|
|
12
10
|
registry.register(checks, validator);
|
|
@@ -15,43 +13,6 @@ export function registerValidationChecks(services) {
|
|
|
15
13
|
* Implementation of custom validations.
|
|
16
14
|
*/
|
|
17
15
|
export class AgentlangValidator {
|
|
18
|
-
// our new validation function for defs
|
|
19
|
-
checkUniqueDefs(module, accept) {
|
|
20
|
-
// create a set of visited functions
|
|
21
|
-
// and report an error when we see one we've already seen
|
|
22
|
-
const reported = new Set();
|
|
23
|
-
module.defs.forEach(d => {
|
|
24
|
-
let n;
|
|
25
|
-
if (!isStandaloneStatement(d)) {
|
|
26
|
-
if (d.$type === 'PublicWorkflowDefinition' ||
|
|
27
|
-
d.$type === 'PublicAgentDefinition' ||
|
|
28
|
-
d.$type === 'PublicEventDefinition') {
|
|
29
|
-
n = d.def.name;
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
n = d.name;
|
|
33
|
-
}
|
|
34
|
-
if (d.$type != 'WorkflowDefinition' &&
|
|
35
|
-
d.$type != 'FlowDefinition' &&
|
|
36
|
-
d.$type != 'PublicWorkflowDefinition' &&
|
|
37
|
-
d.$type != 'ScenarioDefinition' &&
|
|
38
|
-
d.$type != 'DirectiveDefinition' &&
|
|
39
|
-
d.$type != 'GlossaryEntryDefinition' &&
|
|
40
|
-
reported.has(n)) {
|
|
41
|
-
accept('error', `Definition has non-unique name '${n}'.`, {
|
|
42
|
-
node: d,
|
|
43
|
-
property: 'name',
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
if (d.$type != 'FlowDefinition' &&
|
|
47
|
-
d.$type != 'ScenarioDefinition' &&
|
|
48
|
-
d.$type != 'DirectiveDefinition' &&
|
|
49
|
-
d.$type != 'GlossaryEntryDefinition') {
|
|
50
|
-
reported.add(n);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
16
|
checkUniqueAttributes(def, accept) {
|
|
56
17
|
// create a set of visited functions
|
|
57
18
|
// and report an error when we see one we've already seen
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agentlang-validator.js","sourceRoot":"","sources":["../../src/language/agentlang-validator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"agentlang-validator.js","sourceRoot":"","sources":["../../src/language/agentlang-validator.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,UAAU,wBAAwB,CAAC,QAA2B;IAClE,MAAM,QAAQ,GAAG,QAAQ,CAAC,UAAU,CAAC,kBAAkB,CAAC;IACxD,MAAM,SAAS,GAAG,QAAQ,CAAC,UAAU,CAAC,kBAAkB,CAAC;IACzD,MAAM,MAAM,GAAuC;QACjD,gBAAgB,EAAE,SAAS,CAAC,qBAAqB;KAClD,CAAC;IACF,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AACvC,CAAC;AAED;;GAEG;AACH,MAAM,OAAO,kBAAkB;IAC7B,qBAAqB,CAAC,GAAqB,EAAE,MAA0B;QACrE,oCAAoC;QACpC,yDAAyD;QACzD,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAE,CAAC;QAC3B,IAAI,GAAG,CAAC,KAAK,KAAK,uBAAuB,EAAE,CAAC;YAC1C,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC;QAChB,CAAC;QACD,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAsB,EAAE,EAAE;YACvD,IAAI,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;gBACzB,MAAM,CAAC,OAAO,EAAE,IAAI,GAAG,CAAC,IAAI,uCAAuC,CAAC,CAAC,IAAI,IAAI,EAAE;oBAC7E,IAAI,EAAE,CAAC;oBACP,QAAQ,EAAE,MAAM;iBACjB,CAAC,CAAC;YACL,CAAC;YACD,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QACvB,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
|
package/out/language/main.cjs
CHANGED
|
@@ -31052,9 +31052,6 @@ var SelectIntoEntry = "SelectIntoEntry";
|
|
|
31052
31052
|
var SelectIntoSpec = "SelectIntoSpec";
|
|
31053
31053
|
var SetAttribute = "SetAttribute";
|
|
31054
31054
|
var StandaloneStatement = "StandaloneStatement";
|
|
31055
|
-
function isStandaloneStatement(item) {
|
|
31056
|
-
return reflection2.isInstance(item, StandaloneStatement);
|
|
31057
|
-
}
|
|
31058
31055
|
var Statement = "Statement";
|
|
31059
31056
|
var ThenSpec = "ThenSpec";
|
|
31060
31057
|
var ThrowError = "ThrowError";
|
|
@@ -39481,35 +39478,11 @@ function registerValidationChecks(services) {
|
|
|
39481
39478
|
const registry = services.validation.ValidationRegistry;
|
|
39482
39479
|
const validator = services.validation.AgentlangValidator;
|
|
39483
39480
|
const checks = {
|
|
39484
|
-
ModuleDefinition: validator.checkUniqueDefs,
|
|
39485
39481
|
SchemaDefinition: validator.checkUniqueAttributes
|
|
39486
39482
|
};
|
|
39487
39483
|
registry.register(checks, validator);
|
|
39488
39484
|
}
|
|
39489
39485
|
var AgentlangValidator = class {
|
|
39490
|
-
// our new validation function for defs
|
|
39491
|
-
checkUniqueDefs(module2, accept) {
|
|
39492
|
-
const reported = /* @__PURE__ */ new Set();
|
|
39493
|
-
module2.defs.forEach((d) => {
|
|
39494
|
-
let n;
|
|
39495
|
-
if (!isStandaloneStatement(d)) {
|
|
39496
|
-
if (d.$type === "PublicWorkflowDefinition" || d.$type === "PublicAgentDefinition" || d.$type === "PublicEventDefinition") {
|
|
39497
|
-
n = d.def.name;
|
|
39498
|
-
} else {
|
|
39499
|
-
n = d.name;
|
|
39500
|
-
}
|
|
39501
|
-
if (d.$type != "WorkflowDefinition" && d.$type != "FlowDefinition" && d.$type != "PublicWorkflowDefinition" && d.$type != "ScenarioDefinition" && d.$type != "DirectiveDefinition" && d.$type != "GlossaryEntryDefinition" && reported.has(n)) {
|
|
39502
|
-
accept("error", `Definition has non-unique name '${n}'.`, {
|
|
39503
|
-
node: d,
|
|
39504
|
-
property: "name"
|
|
39505
|
-
});
|
|
39506
|
-
}
|
|
39507
|
-
if (d.$type != "FlowDefinition" && d.$type != "ScenarioDefinition" && d.$type != "DirectiveDefinition" && d.$type != "GlossaryEntryDefinition") {
|
|
39508
|
-
reported.add(n);
|
|
39509
|
-
}
|
|
39510
|
-
}
|
|
39511
|
-
});
|
|
39512
|
-
}
|
|
39513
39486
|
checkUniqueAttributes(def, accept) {
|
|
39514
39487
|
const reported = /* @__PURE__ */ new Set();
|
|
39515
39488
|
if (def.$type === "PublicEventDefinition") {
|