@primmel/primmel 1.21.10 → 1.21.12
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/dist/src/ser-des/config/provision.d.ts.map +1 -1
- package/dist/src/ser-des/config/provision.js +59 -16
- package/dist/src/ser-des/config/provision.js.map +1 -1
- package/dist/src/ser-des/index.d.ts +1 -0
- package/dist/src/ser-des/index.d.ts.map +1 -1
- package/dist/src/ser-des/index.js +11 -1
- package/dist/src/ser-des/index.js.map +1 -1
- package/dist-browser/index.mjs +536 -41
- package/dist-cli/primmel.mjs +53 -16
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provision.d.ts","sourceRoot":"","sources":["../../../../src/ser-des/config/provision.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAI5D,eAAO,MAAM,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"provision.d.ts","sourceRoot":"","sources":["../../../../src/ser-des/config/provision.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAI5D,eAAO,MAAM,cAAc,EAAE,MAiF5B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,SAAS,EAAE,mBAAmB,CAUnE,CAAC;AAEJ,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,SAAS,CAsB3C,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.dumpProvision = exports.resolveProvision = exports.parseProvision = void 0;
|
|
4
4
|
const tokenize_1 = require("../tokenize");
|
|
5
|
-
const
|
|
5
|
+
const tokenize_2 = require("../tokenize");
|
|
6
6
|
const resolve_1 = require("../resolve");
|
|
7
7
|
const parseProvision = function (id, data) {
|
|
8
8
|
const result = {
|
|
@@ -15,24 +15,63 @@ const parseProvision = function (id, data) {
|
|
|
15
15
|
ref: [],
|
|
16
16
|
},
|
|
17
17
|
};
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
// The provision's own walk — NOT forEachEntry. The free-form
|
|
19
|
+
// key/value pairs are part of the spec, and a free-form value may be
|
|
20
|
+
// MULTI-TOKEN (`subject claims Sample#data`): the pairwise walk
|
|
21
|
+
// cannot express that (the stray tokens abort the parse and poison
|
|
22
|
+
// everything after). An unknown keyword opens a free-form entry whose
|
|
23
|
+
// value is every token up to the next known keyword, joined;
|
|
24
|
+
// single-token values parse byte-identically to the old form.
|
|
25
|
+
const KNOWN = new Set(['modality', 'condition', 'reference']);
|
|
26
|
+
/** Unwrap one string token: quoted → unescape; brace block → strip the
|
|
27
|
+
* braces; bare → as-is. The string-form of parse-block's unwrapped(). */
|
|
28
|
+
const unwrapToken = (x) => {
|
|
29
|
+
if (x.length >= 2 && x.startsWith('"') && x.endsWith('"')) {
|
|
30
|
+
return (0, tokenize_2.unescapeString)(x.slice(1, -1));
|
|
21
31
|
}
|
|
22
|
-
|
|
23
|
-
|
|
32
|
+
if (x.length >= 2 && x.startsWith('{') && x.endsWith('}')) {
|
|
33
|
+
return (0, tokenize_2.unwrapBlock)(x);
|
|
24
34
|
}
|
|
25
|
-
|
|
26
|
-
|
|
35
|
+
return x;
|
|
36
|
+
};
|
|
37
|
+
const t = (0, tokenize_1.tokenizePackage)(data);
|
|
38
|
+
let i = 0;
|
|
39
|
+
while (i < t.length) {
|
|
40
|
+
const keyword = t[i++];
|
|
41
|
+
if (keyword === 'modality') {
|
|
42
|
+
if (i >= t.length) {
|
|
43
|
+
throw new Error(`Parsing error: provision. ID ${id}: Expecting value for modality`);
|
|
44
|
+
}
|
|
45
|
+
result.modality = t[i++];
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
if (keyword === 'condition') {
|
|
49
|
+
if (i >= t.length) {
|
|
50
|
+
throw new Error(`Parsing error: provision. ID ${id}: Expecting value for condition`);
|
|
51
|
+
}
|
|
52
|
+
result.condition = unwrapToken(t[i++]);
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
if (keyword === 'reference') {
|
|
56
|
+
if (i >= t.length) {
|
|
57
|
+
throw new Error(`Parsing error: provision. ID ${id}: Expecting value for reference`);
|
|
58
|
+
}
|
|
59
|
+
result._relations.ref = (0, tokenize_1.tokenizePackage)(t[i++]);
|
|
60
|
+
continue;
|
|
27
61
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
result.subject.set(command, value());
|
|
62
|
+
// The free-form subject entry.
|
|
63
|
+
const rest = [];
|
|
64
|
+
while (i < t.length && !KNOWN.has(t[i])) {
|
|
65
|
+
rest.push(t[i++]);
|
|
33
66
|
}
|
|
34
|
-
|
|
35
|
-
|
|
67
|
+
if (rest.length === 0) {
|
|
68
|
+
// A trailing bare keyword: a free-form key with an empty value.
|
|
69
|
+
result.subject.set(keyword, '');
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
const value = rest.map(unwrapToken).join(' ');
|
|
73
|
+
result.subject.set(keyword, value);
|
|
74
|
+
}
|
|
36
75
|
return ctx => {
|
|
37
76
|
ctx.provisions[id] = result;
|
|
38
77
|
return ctx;
|
|
@@ -53,7 +92,11 @@ exports.resolveProvision = resolveProvision;
|
|
|
53
92
|
const dumpProvision = function (pro) {
|
|
54
93
|
let out = 'provision ' + pro.id + ' {\n';
|
|
55
94
|
pro.subject.forEach((value, key) => {
|
|
56
|
-
|
|
95
|
+
// A multi-word value dumps QUOTED — bare, it would reparse as
|
|
96
|
+
// several free-form entries. Single-token values stay bare
|
|
97
|
+
// (byte-identical to the corpus).
|
|
98
|
+
const v = value.includes(' ') ? `"${(0, tokenize_1.escapeString)(value)}"` : value;
|
|
99
|
+
out += ' ' + key + ' ' + v + '\n';
|
|
57
100
|
});
|
|
58
101
|
out += ' condition "' + (0, tokenize_1.escapeString)(pro.condition) + '"\n';
|
|
59
102
|
if (pro.modality !== '') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provision.js","sourceRoot":"","sources":["../../../../src/ser-des/config/provision.ts"],"names":[],"mappings":";;;AAEA,0CAA4D;AAC5D,
|
|
1
|
+
{"version":3,"file":"provision.js","sourceRoot":"","sources":["../../../../src/ser-des/config/provision.ts"],"names":[],"mappings":";;;AAEA,0CAA4D;AAC5D,0CAA0D;AAG1D,wCAAgD;AAEzC,MAAM,cAAc,GAAW,UAAU,EAAE,EAAE,IAAI;IACtD,MAAM,MAAM,GAAwB;QAClC,OAAO,EAAE,IAAI,GAAG,EAAkB;QAClC,EAAE,EAAE,EAAE;QACN,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE,EAAE;QACb,GAAG,EAAE,EAAE;QACP,UAAU,EAAE;YACV,GAAG,EAAE,EAAE;SACR;KACF,CAAC;IAEF,6DAA6D;IAC7D,qEAAqE;IACrE,gEAAgE;IAChE,mEAAmE;IACnE,sEAAsE;IACtE,6DAA6D;IAC7D,8DAA8D;IAC9D,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,CAAC,UAAU,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC;IAE9D;8EAC0E;IAC1E,MAAM,WAAW,GAAG,CAAC,CAAS,EAAU,EAAE;QACxC,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAC1D,OAAO,IAAA,yBAAc,EAAC,CAAC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"}
|
|
@@ -52,4 +52,5 @@ export { parseTargetRef, mappingsFromProfile, collectMappings, buildProcessTree,
|
|
|
52
52
|
export { canonical, clauseTextKey, diffStandards, elementIndex, formatDiffReport, normalizeSourceRef, TIER_BY_FIELD, TIER_ORDER, type ChangeEntry, type ClauseDriftKind, type ClauseDriftRow, type ClauseTextIndex, type CoverageDeltaEntry, type DiffElement, type DiffEntry, type MappingDiff, type MappingPairChange, type ModelDiff, type ModelDiffOptions, type MoveEntry, type NormalizedSourceRef, type TierName, type TierTally, } from '../model-diff';
|
|
53
53
|
export { PASSPORT_ACCESS_CLASSES, PASSPORT_CONTENT_CLASSES, PASSPORT_UPI_LEVELS, } from '../types/Passport';
|
|
54
54
|
export { ENDPOINT_ACCESS_SCOPES, ENDPOINT_OPERATION_KINDS, } from '../types/Twin';
|
|
55
|
+
export { executeRun, evaluateExpression, evaluateTableVariable, isTableVariable, lookupTable, type LookupTable, type Run, type RunInput, type RunProgramStep, type RunVerdict, type RunEvidenceRecord, } from '../runtime';
|
|
55
56
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ser-des/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,mBAAmB,CAAC;AAEzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAK/D,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,QAAQ,EACd,MAAM,aAAa,CAAC;AAErB,MAAM,MAAM,WAAW,GAAG,YAAY,CAAC;AAEvC,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,QAAQ,CAAC;IACnB,0DAA0D;IAC1D,MAAM,EAAE,eAAe,EAAE,CAAC;IAC1B;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,WAAW,EAAE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Ae,EAAE,kBAAkB,EAAE,QAAQ,EAAE,CAAC;AAC9D,YAAY,EAAE,UAAU,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAM3E,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,KAAK,QAAQ,GACd,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,OAAO,EACP,SAAS,EACT,YAAY,EACZ,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,cAAc,GACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,SAAS,EACT,aAAa,EACb,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,aAAa,EACb,UAAU,EACV,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACd,KAAK,mBAAmB,EACxB,KAAK,QAAQ,EACb,KAAK,SAAS,GACf,MAAM,eAAe,CAAC;AAMvB,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ser-des/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,mBAAm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ACd,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACd,KAAK,mBAAmB,EACxB,KAAK,QAAQ,EACb,KAAK,SAAS,GACf,MAAM,eAAe,CAAC;AAMvB,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,eAAe,CAAC;AAKvB,OAAO,EACL,UAAU,EACV,kBAAkB,EAClB,qBAAqB,EACrB,eAAe,EACf,WAAW,EACX,KAAK,WAAW,EAChB,KAAK,GAAG,EACR,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,iBAAiB,GACvB,MAAM,YAAY,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ENDPOINT_OPERATION_KINDS = exports.ENDPOINT_ACCESS_SCOPES = exports.PASSPORT_UPI_LEVELS = exports.PASSPORT_CONTENT_CLASSES = exports.PASSPORT_ACCESS_CLASSES = exports.TIER_ORDER = exports.TIER_BY_FIELD = exports.normalizeSourceRef = exports.formatDiffReport = exports.elementIndex = exports.diffStandards = exports.clauseTextKey = exports.canonical = exports.componentIds = exports.applyView = exports.repoMap = exports.discoverTransitive = exports.computeCoverage = exports.buildProcessTree = exports.collectMappings = exports.mappingsFromProfile = exports.parseTargetRef = exports.isWellFormedMapType = exports.parseTypeExpression = exports.PRIMITIVE_TYPES = exports.parseDeclarations = exports.mapProfilesToPrm = exports.prmToMapProfiles = exports.dumpPrm = exports.loadPrm = exports.dumpPackage = exports.CompositionError = exports.readPackageManifest = exports.effectiveUses = exports.packageFiles = exports.groupBySourceFile = exports.loadPackageWithProvenance = exports.loadPackageWithIssues = exports.loadPackage = void 0;
|
|
3
|
+
exports.lookupTable = exports.isTableVariable = exports.evaluateTableVariable = exports.evaluateExpression = exports.executeRun = exports.ENDPOINT_OPERATION_KINDS = exports.ENDPOINT_ACCESS_SCOPES = exports.PASSPORT_UPI_LEVELS = exports.PASSPORT_CONTENT_CLASSES = exports.PASSPORT_ACCESS_CLASSES = exports.TIER_ORDER = exports.TIER_BY_FIELD = exports.normalizeSourceRef = exports.formatDiffReport = exports.elementIndex = exports.diffStandards = exports.clauseTextKey = exports.canonical = exports.componentIds = exports.applyView = exports.repoMap = exports.discoverTransitive = exports.computeCoverage = exports.buildProcessTree = exports.collectMappings = exports.mappingsFromProfile = exports.parseTargetRef = exports.isWellFormedMapType = exports.parseTypeExpression = exports.PRIMITIVE_TYPES = exports.parseDeclarations = exports.mapProfilesToPrm = exports.prmToMapProfiles = exports.dumpPrm = exports.loadPrm = exports.dumpPackage = exports.CompositionError = exports.readPackageManifest = exports.effectiveUses = exports.packageFiles = exports.groupBySourceFile = exports.loadPackageWithProvenance = exports.loadPackageWithIssues = exports.loadPackage = void 0;
|
|
4
4
|
exports.load = load;
|
|
5
5
|
exports.loadWithIssues = loadWithIssues;
|
|
6
6
|
exports.loadFile = loadFile;
|
|
@@ -113,4 +113,14 @@ Object.defineProperty(exports, "PASSPORT_UPI_LEVELS", { enumerable: true, get: f
|
|
|
113
113
|
var Twin_1 = require("../types/Twin");
|
|
114
114
|
Object.defineProperty(exports, "ENDPOINT_ACCESS_SCOPES", { enumerable: true, get: function () { return Twin_1.ENDPOINT_ACCESS_SCOPES; } });
|
|
115
115
|
Object.defineProperty(exports, "ENDPOINT_OPERATION_KINDS", { enumerable: true, get: function () { return Twin_1.ENDPOINT_OPERATION_KINDS; } });
|
|
116
|
+
// The runtime (the execution plane) rides the browser bundle too — the
|
|
117
|
+
// editor's simulator derives and the tick pipeline consume it in the
|
|
118
|
+
// browser. Same rule as above: an export the root index carries but
|
|
119
|
+
// this entry drops never reaches dist-browser.
|
|
120
|
+
var runtime_1 = require("../runtime");
|
|
121
|
+
Object.defineProperty(exports, "executeRun", { enumerable: true, get: function () { return runtime_1.executeRun; } });
|
|
122
|
+
Object.defineProperty(exports, "evaluateExpression", { enumerable: true, get: function () { return runtime_1.evaluateExpression; } });
|
|
123
|
+
Object.defineProperty(exports, "evaluateTableVariable", { enumerable: true, get: function () { return runtime_1.evaluateTableVariable; } });
|
|
124
|
+
Object.defineProperty(exports, "isTableVariable", { enumerable: true, get: function () { return runtime_1.isTableVariable; } });
|
|
125
|
+
Object.defineProperty(exports, "lookupTable", { enumerable: true, get: function () { return runtime_1.lookupTable; } });
|
|
116
126
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ser-des/index.ts"],"names":[],"mappings":";;;AAmCA,oBAGC;AAQD,wCAOC;AAMD,4BAMC;AAKD,gDAMC;AAED,oBAEC;AAiCD,4BAEC;AAlHD,mCAA4B;AAC5B,mCAA4C;AAwHnC,kGAxHA,yBAAiB,OAwHA;AAtH1B,uCAAgC;AAChC,iCAA2B;AAC3B,qCAAyE;AACzE,yCAAgD;AAChD,0CAKqB;AAerB;;;;;;GAMG;AACH,SAAgB,IAAI,CAAC,UAAkB,EAAE,UAAuB,EAAE;IAChE,MAAM,OAAO,GAAG,IAAA,eAAK,EAAC,UAAU,EAAE,sBAAa,EAAE,OAAO,CAAC,CAAC;IAC1D,OAAO,IAAA,iBAAO,EAAC,OAAO,EAAE,wBAAe,CAAC,CAAC;AAC3C,CAAC;AAED;;;;;GAKG;AACH,SAAgB,cAAc,CAC5B,UAAkB,EAClB,UAAuB,EAAE;IAEzB,MAAM,OAAO,GAAG,IAAA,eAAK,EAAC,UAAU,EAAE,sBAAa,EAAE,OAAO,CAAC,CAAC;IAC1D,MAAM,QAAQ,GAAG,IAAA,iBAAO,EAAC,OAAO,EAAE,wBAAe,CAAC,CAAC;IACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE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AAC7B,CAAC;AAYD,qEAAqE;AACrE,oEAAoE;AACpE,qEAAqE;AACrE,oDAAoD;AACpD,0CAKsB;AAJpB,4GAAA,eAAe,OAAA;AACf,gHAAA,mBAAmB,OAAA;AACnB,gHAAA,mBAAmB,OAAA;AAGrB,wDAqB6B;AApB3B,kHAAA,cAAc,OAAA;AACd,uHAAA,mBAAmB,OAAA;AACnB,mHAAA,eAAe,OAAA;AACf,oHAAA,gBAAgB,OAAA;AAChB,mHAAA,eAAe,OAAA;AACf,sHAAA,kBAAkB,OAAA;AAClB,2GAAA,OAAO,OAAA;AACP,6GAAA,SAAS,OAAA;AACT,gHAAA,YAAY,OAAA;AAad,4CAwBuB;AAvBrB,uGAAA,SAAS,OAAA;AACT,2GAAA,aAAa,OAAA;AACb,2GAAA,aAAa,OAAA;AACb,0GAAA,YAAY,OAAA;AACZ,8GAAA,gBAAgB,OAAA;AAChB,gHAAA,kBAAkB,OAAA;AAClB,2GAAA,aAAa,OAAA;AACb,wGAAA,UAAU,OAAA;AAiBZ,wEAAwE;AACxE,wEAAwE;AACxE,uEAAuE;AACvE,uEAAuE;AACvE,oCAAoC;AACpC,8CAI2B;AAHzB,mHAAA,uBAAuB,OAAA;AACvB,oHAAA,wBAAwB,OAAA;AACxB,+GAAA,mBAAmB,OAAA;AAErB,sCAGuB;AAFrB,8GAAA,sBAAsB,OAAA;AACtB,gHAAA,wBAAwB,OAAA;AAE1B,uEAAuE;AACvE,qEAAqE;AACrE,oEAAoE;AACpE,+CAA+C;AAC/C,sCAYoB;AAXlB,qGAAA,UAAU,OAAA;AACV,6GAAA,kBAAkB,OAAA;AAClB,gHAAA,qBAAqB,OAAA;AACrB,0GAAA,eAAe,OAAA;AACf,sGAAA,WAAW,OAAA"}
|
package/dist-browser/index.mjs
CHANGED
|
@@ -2548,11 +2548,38 @@ var Qt = (e, t) => {
|
|
|
2548
2548
|
condition: "",
|
|
2549
2549
|
ref: [],
|
|
2550
2550
|
_relations: { ref: [] }
|
|
2551
|
-
}
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2551
|
+
}, a = /* @__PURE__ */ new Set([
|
|
2552
|
+
"modality",
|
|
2553
|
+
"condition",
|
|
2554
|
+
"reference"
|
|
2555
|
+
]), s = (e) => e.length >= 2 && e.startsWith("\"") && e.endsWith("\"") ? o(e.slice(1, -1)) : e.length >= 2 && e.startsWith("{") && e.endsWith("}") ? i(e) : e, c = r(t), l = 0;
|
|
2556
|
+
for (; l < c.length;) {
|
|
2557
|
+
let t = c[l++];
|
|
2558
|
+
if (t === "modality") {
|
|
2559
|
+
if (l >= c.length) throw Error(`Parsing error: provision. ID ${e}: Expecting value for modality`);
|
|
2560
|
+
n.modality = c[l++];
|
|
2561
|
+
continue;
|
|
2562
|
+
}
|
|
2563
|
+
if (t === "condition") {
|
|
2564
|
+
if (l >= c.length) throw Error(`Parsing error: provision. ID ${e}: Expecting value for condition`);
|
|
2565
|
+
n.condition = s(c[l++]);
|
|
2566
|
+
continue;
|
|
2567
|
+
}
|
|
2568
|
+
if (t === "reference") {
|
|
2569
|
+
if (l >= c.length) throw Error(`Parsing error: provision. ID ${e}: Expecting value for reference`);
|
|
2570
|
+
n._relations.ref = r(c[l++]);
|
|
2571
|
+
continue;
|
|
2572
|
+
}
|
|
2573
|
+
let i = [];
|
|
2574
|
+
for (; l < c.length && !a.has(c[l]);) i.push(c[l++]);
|
|
2575
|
+
if (i.length === 0) {
|
|
2576
|
+
n.subject.set(t, "");
|
|
2577
|
+
break;
|
|
2578
|
+
}
|
|
2579
|
+
let o = i.map(s).join(" ");
|
|
2580
|
+
n.subject.set(t, o);
|
|
2581
|
+
}
|
|
2582
|
+
return (t) => (t.provisions[e] = n, t);
|
|
2556
2583
|
}, rn = function(e, t) {
|
|
2557
2584
|
let n = [];
|
|
2558
2585
|
for (let r of t._relations.ref) {
|
|
@@ -2566,7 +2593,8 @@ var Qt = (e, t) => {
|
|
|
2566
2593
|
}, an = function(e) {
|
|
2567
2594
|
let t = "provision " + e.id + " {\n";
|
|
2568
2595
|
if (e.subject.forEach((e, n) => {
|
|
2569
|
-
|
|
2596
|
+
let r = e.includes(" ") ? `"${s(e)}"` : e;
|
|
2597
|
+
t += " " + n + " " + r + "\n";
|
|
2570
2598
|
}), t += " condition \"" + s(e.condition) + "\"\n", e.modality !== "" && (t += " modality " + e.modality + "\n"), e.ref.length > 0) {
|
|
2571
2599
|
t += " reference {\n";
|
|
2572
2600
|
for (let n of e.ref) t += " " + n.id + "\n";
|
|
@@ -11599,14 +11627,14 @@ function rd(e, t) {
|
|
|
11599
11627
|
function id(e, t) {
|
|
11600
11628
|
return `${e}#${t}`;
|
|
11601
11629
|
}
|
|
11602
|
-
function
|
|
11630
|
+
function ad(e) {
|
|
11603
11631
|
return e?.version ?? "";
|
|
11604
11632
|
}
|
|
11605
|
-
function
|
|
11633
|
+
function od(e) {
|
|
11606
11634
|
let t = [...new Set(e)].sort();
|
|
11607
11635
|
return t.filter((e) => !t.some((t) => t !== e && e.startsWith(t + ".")));
|
|
11608
11636
|
}
|
|
11609
|
-
function
|
|
11637
|
+
function sd(e, t, n) {
|
|
11610
11638
|
let r = n.mappingsA ?? Lu(e), i = n.mappingsB ?? Lu(t), a = (e) => `${e.sourceModel}#${e.source}⇒${e.target}`, o = new Map(r.map((e) => [a(e), e])), s = new Map(i.map((e) => [a(e), e])), c = [], l = [], u = [];
|
|
11611
11639
|
for (let [e, t] of s) o.has(e) || c.push(t);
|
|
11612
11640
|
for (let [e, t] of o) {
|
|
@@ -11665,12 +11693,12 @@ function od(e, t, n) {
|
|
|
11665
11693
|
namespacesSkipped: p
|
|
11666
11694
|
};
|
|
11667
11695
|
}
|
|
11668
|
-
function
|
|
11696
|
+
function cd(e, t) {
|
|
11669
11697
|
let n = [];
|
|
11670
11698
|
for (let [t, r] of e) {
|
|
11671
11699
|
let e = /* @__PURE__ */ new Set([...t.provenance.map((e) => e.basis), ...r.provenance.map((e) => e.basis)]);
|
|
11672
11700
|
for (let i of [...e].sort()) {
|
|
11673
|
-
let e = (e) =>
|
|
11701
|
+
let e = (e) => od(e.provenance.filter((e) => e.basis === i).map((e) => e.clause)).filter((e) => e.length > 0), a = e(t), o = e(r), s = a.filter((e) => !o.includes(e)), c = o.filter((e) => !a.includes(e));
|
|
11674
11702
|
if (s.length === 0 && c.length === 0) continue;
|
|
11675
11703
|
let l = {
|
|
11676
11704
|
key: t.key,
|
|
@@ -11736,21 +11764,21 @@ function sd(e, t) {
|
|
|
11736
11764
|
}
|
|
11737
11765
|
return [...i.values()].sort((e, t) => `${e.doc} ${e.from} ${e.to}`.localeCompare(`${t.doc} ${t.from} ${t.to}`));
|
|
11738
11766
|
}
|
|
11739
|
-
function
|
|
11767
|
+
function ld(e, t, n) {
|
|
11740
11768
|
return e.kind !== "texts" || !n.startsWith("spelling:") ? n : n in e.aspects ? n in t.aspects ? `${n} (changed)` : `${n} (removed)` : `${n} (added)`;
|
|
11741
11769
|
}
|
|
11742
|
-
var
|
|
11743
|
-
function
|
|
11744
|
-
if (
|
|
11770
|
+
var ud = (e) => typeof e == "object" && !!e && !Array.isArray(e);
|
|
11771
|
+
function dd(e, t, n, r) {
|
|
11772
|
+
if (ud(t) && ud(n)) {
|
|
11745
11773
|
let i = [.../* @__PURE__ */ new Set([...Object.keys(t), ...Object.keys(n)])].sort();
|
|
11746
|
-
for (let a of i)
|
|
11774
|
+
for (let a of i) dd(`${e}.${a}`, t[a], n[a], r);
|
|
11747
11775
|
return;
|
|
11748
11776
|
}
|
|
11749
11777
|
Q(t) !== Q(n) && r.push(e);
|
|
11750
11778
|
}
|
|
11751
|
-
function
|
|
11779
|
+
function fd(e, t) {
|
|
11752
11780
|
let n = [.../* @__PURE__ */ new Set([...Object.keys(e.fields), ...Object.keys(t.fields)])].sort(), r = [];
|
|
11753
|
-
for (let i of n)
|
|
11781
|
+
for (let i of n) dd(i, e.fields[i], t.fields[i], r);
|
|
11754
11782
|
let i = [
|
|
11755
11783
|
"source",
|
|
11756
11784
|
"sourceRef",
|
|
@@ -11763,7 +11791,7 @@ function dd(e, t) {
|
|
|
11763
11791
|
return !a.has(r) && (a.add(r), !0);
|
|
11764
11792
|
});
|
|
11765
11793
|
}
|
|
11766
|
-
function
|
|
11794
|
+
function pd(e, t, n = {}) {
|
|
11767
11795
|
let r = [], i = [], a = rd(e, r), o = rd(t, i), s = [], c = [], l = [], u = [], d = [], f = 0, p = Object.fromEntries(Ku.map((e) => [e, {
|
|
11768
11796
|
added: 0,
|
|
11769
11797
|
removed: 0,
|
|
@@ -11802,17 +11830,17 @@ function fd(e, t, n = {}) {
|
|
|
11802
11830
|
id: t.id,
|
|
11803
11831
|
kind: t.kind,
|
|
11804
11832
|
tier: t.tier,
|
|
11805
|
-
aspects: r.map((e) =>
|
|
11806
|
-
fields:
|
|
11833
|
+
aspects: r.map((e) => ld(t, n, e)).sort(),
|
|
11834
|
+
fields: fd(t, n)
|
|
11807
11835
|
}), p[t.tier].changed++);
|
|
11808
11836
|
}
|
|
11809
|
-
let m =
|
|
11837
|
+
let m = sd(e, t, n), h = cd(d, n), g = s.length === 0 && c.length === 0 && l.length === 0 && u.length === 0 && m.added.length === 0 && m.removed.length === 0 && m.changed.length === 0 && m.coverageDelta.length === 0 && h.length === 0, _ = e.packageManifest, v = t.packageManifest, y = n.aLabel ?? (_?.id ? `${_.id}@${ad(_) || "?"}` : "a"), b = n.bLabel ?? (v?.id ? `${v.id}@${ad(v) || "?"}` : "b"), ee = !!_?.id && _.id === v?.id && ad(_) !== ad(v), x = (e, t) => `${e}: duplicate element ${t} — the last declaration wins (a data error the duplicate-id linter owns); this side under-reports`, S = [...r.map((e) => x(y, e)), ...i.map((e) => x(b, e))];
|
|
11810
11838
|
return {
|
|
11811
11839
|
aLabel: y,
|
|
11812
11840
|
bLabel: b,
|
|
11813
11841
|
editionComparison: ee,
|
|
11814
|
-
aVersion:
|
|
11815
|
-
bVersion:
|
|
11842
|
+
aVersion: ad(_),
|
|
11843
|
+
bVersion: ad(v),
|
|
11816
11844
|
added: s.sort((e, t) => e.key.localeCompare(t.key)),
|
|
11817
11845
|
removed: c.sort((e, t) => e.key.localeCompare(t.key)),
|
|
11818
11846
|
changed: l.sort((e, t) => e.key.localeCompare(t.key)),
|
|
@@ -11825,17 +11853,17 @@ function fd(e, t, n = {}) {
|
|
|
11825
11853
|
empty: g
|
|
11826
11854
|
};
|
|
11827
11855
|
}
|
|
11828
|
-
function
|
|
11856
|
+
function md(e) {
|
|
11829
11857
|
return `[${e.tier}/${e.kind}] ${e.id}`;
|
|
11830
11858
|
}
|
|
11831
|
-
function
|
|
11859
|
+
function hd(e, t) {
|
|
11832
11860
|
try {
|
|
11833
11861
|
let n = e ? JSON.parse(e) : {}, r = t ? JSON.parse(t) : {}, i = [.../* @__PURE__ */ new Set([...Object.keys(n), ...Object.keys(r)])].sort().filter((e) => Q(n[e]) !== Q(r[e])).map((e) => `${e}: ${Q(n[e])} → ${Q(r[e])}`);
|
|
11834
11862
|
if (i.length > 0) return i;
|
|
11835
11863
|
} catch {}
|
|
11836
11864
|
return [`from ${e}`, `to ${t}`];
|
|
11837
11865
|
}
|
|
11838
|
-
function
|
|
11866
|
+
function gd(e) {
|
|
11839
11867
|
let t = [], n = e.editionComparison ? `edition comparison — ${e.aLabel} → ${e.bLabel}` : `model diff — ${e.aLabel} → ${e.bLabel}`;
|
|
11840
11868
|
t.push(`primmel diff: ${n}`), t.push(""), t.push(`elements: +${e.added.length} -${e.removed.length} ~${e.changed.length} >${e.moved.length} (${e.unchanged} unchanged)`), t.push(""), t.push("by tier: added removed changed moved unchanged");
|
|
11841
11869
|
for (let n of Ku) {
|
|
@@ -11844,21 +11872,21 @@ function hd(e) {
|
|
|
11844
11872
|
}
|
|
11845
11873
|
if (e.added.length > 0) {
|
|
11846
11874
|
t.push("", "added:");
|
|
11847
|
-
for (let n of e.added) t.push(` + ${
|
|
11875
|
+
for (let n of e.added) t.push(` + ${md(n)}`);
|
|
11848
11876
|
}
|
|
11849
11877
|
if (e.removed.length > 0) {
|
|
11850
11878
|
t.push("", "removed:");
|
|
11851
|
-
for (let n of e.removed) t.push(` - ${
|
|
11879
|
+
for (let n of e.removed) t.push(` - ${md(n)}`);
|
|
11852
11880
|
}
|
|
11853
11881
|
if (e.changed.length > 0) {
|
|
11854
11882
|
t.push("", "changed:");
|
|
11855
|
-
for (let n of e.changed) t.push(` ~ ${
|
|
11883
|
+
for (let n of e.changed) t.push(` ~ ${md(n)} — ${n.aspects.join(", ")} (fields: ${n.fields.join(", ")})`);
|
|
11856
11884
|
}
|
|
11857
11885
|
if (e.moved.length > 0) {
|
|
11858
11886
|
t.push("", "moved (re-anchored):");
|
|
11859
11887
|
for (let n of e.moved) {
|
|
11860
|
-
t.push(` > ${
|
|
11861
|
-
for (let e of
|
|
11888
|
+
t.push(` > ${md(n)}`);
|
|
11889
|
+
for (let e of hd(n.from, n.to)) t.push(` ${e}`);
|
|
11862
11890
|
}
|
|
11863
11891
|
}
|
|
11864
11892
|
if (e.warnings.length > 0) {
|
|
@@ -11882,28 +11910,495 @@ function hd(e) {
|
|
|
11882
11910
|
return t.join("\n");
|
|
11883
11911
|
}
|
|
11884
11912
|
//#endregion
|
|
11913
|
+
//#region src/operational-state.ts
|
|
11914
|
+
var _d = class extends Error {
|
|
11915
|
+
constructor(e) {
|
|
11916
|
+
super(e), this.name = "StateTrajectoryError";
|
|
11917
|
+
}
|
|
11918
|
+
};
|
|
11919
|
+
function vd(e, t, n) {
|
|
11920
|
+
let r = t.state ?? e.initialState, i = [{
|
|
11921
|
+
state: r,
|
|
11922
|
+
at: t.at,
|
|
11923
|
+
firedBy: ""
|
|
11924
|
+
}];
|
|
11925
|
+
for (let t of n) {
|
|
11926
|
+
if (!t.fires) continue;
|
|
11927
|
+
let n = e.transitions.filter((e) => e.actionName === t.fires);
|
|
11928
|
+
if (n.length === 0) throw new _d(`step "${t.id}" fires "${t.fires}", which state machine "${e.entityName}" does not declare as a transition action`);
|
|
11929
|
+
let a = n.find((e) => e.from === r || e.from === "*");
|
|
11930
|
+
if (!a) throw new _d(`step "${t.id}" fires "${t.fires}", but state machine "${e.entityName}" is in state "${r}" — no such transition is enabled (from: ${n.map((e) => e.from).join(", ")})`);
|
|
11931
|
+
r = a.to, i.push({
|
|
11932
|
+
state: r,
|
|
11933
|
+
at: t.at,
|
|
11934
|
+
firedBy: t.id
|
|
11935
|
+
});
|
|
11936
|
+
}
|
|
11937
|
+
return i;
|
|
11938
|
+
}
|
|
11939
|
+
//#endregion
|
|
11940
|
+
//#region src/runtime.ts
|
|
11941
|
+
function yd(e) {
|
|
11942
|
+
let t = [], n = 0, r = e;
|
|
11943
|
+
for (; n < r.length;) {
|
|
11944
|
+
let e = r[n];
|
|
11945
|
+
if (/\s/.test(e)) {
|
|
11946
|
+
n++;
|
|
11947
|
+
continue;
|
|
11948
|
+
}
|
|
11949
|
+
if (/[0-9]/.test(e) || e === "." && /[0-9]/.test(r[n + 1] ?? "")) {
|
|
11950
|
+
let e = n;
|
|
11951
|
+
for (; e < r.length && /[0-9.]/.test(r[e]);) e++;
|
|
11952
|
+
t.push({
|
|
11953
|
+
t: "num",
|
|
11954
|
+
v: Number(r.slice(n, e))
|
|
11955
|
+
}), n = e;
|
|
11956
|
+
continue;
|
|
11957
|
+
}
|
|
11958
|
+
if (/[A-Za-z_]/.test(e)) {
|
|
11959
|
+
let e = n;
|
|
11960
|
+
for (; e < r.length && /[A-Za-z0-9_]/.test(r[e]);) e++;
|
|
11961
|
+
t.push({
|
|
11962
|
+
t: "id",
|
|
11963
|
+
v: r.slice(n, e)
|
|
11964
|
+
}), n = e;
|
|
11965
|
+
continue;
|
|
11966
|
+
}
|
|
11967
|
+
if (r.startsWith("<=", n) || r.startsWith(">=", n) || r.startsWith("!=", n)) {
|
|
11968
|
+
t.push({
|
|
11969
|
+
t: "op",
|
|
11970
|
+
v: r.slice(n, n + 2)
|
|
11971
|
+
}), n += 2;
|
|
11972
|
+
continue;
|
|
11973
|
+
}
|
|
11974
|
+
if ("+-*/()<>=,.".includes(e)) {
|
|
11975
|
+
t.push({
|
|
11976
|
+
t: "op",
|
|
11977
|
+
v: e
|
|
11978
|
+
}), n++;
|
|
11979
|
+
continue;
|
|
11980
|
+
}
|
|
11981
|
+
throw Error(`runtime: the derivation uses a character the evaluator does not know: "${e}"`);
|
|
11982
|
+
}
|
|
11983
|
+
return t;
|
|
11984
|
+
}
|
|
11985
|
+
var bd = class {
|
|
11986
|
+
toks;
|
|
11987
|
+
constructor(e) {
|
|
11988
|
+
this.toks = e;
|
|
11989
|
+
}
|
|
11990
|
+
pos = 0;
|
|
11991
|
+
peek() {
|
|
11992
|
+
return this.toks[this.pos];
|
|
11993
|
+
}
|
|
11994
|
+
peekAt(e) {
|
|
11995
|
+
return this.toks[this.pos + e];
|
|
11996
|
+
}
|
|
11997
|
+
next() {
|
|
11998
|
+
let e = this.toks[this.pos];
|
|
11999
|
+
if (!e) throw Error("runtime: the derivation ended unexpectedly");
|
|
12000
|
+
return this.pos++, e;
|
|
12001
|
+
}
|
|
12002
|
+
expectOp(e) {
|
|
12003
|
+
let t = this.next();
|
|
12004
|
+
if (t.t !== "op" || t.v !== e) throw Error(`runtime: the derivation expected "${e}"`);
|
|
12005
|
+
}
|
|
12006
|
+
};
|
|
12007
|
+
function xd(e, t) {
|
|
12008
|
+
return Sd(e, t);
|
|
12009
|
+
}
|
|
12010
|
+
function Sd(e, t) {
|
|
12011
|
+
let n = e.peek();
|
|
12012
|
+
if (n && n.t === "id" && n.v === "if") {
|
|
12013
|
+
e.next();
|
|
12014
|
+
let n = Cd(e, t), r = e.next();
|
|
12015
|
+
if (r.t !== "id" || r.v !== "then") throw Error("runtime: the derivation expected \"then\"");
|
|
12016
|
+
let i = Sd(e, t), a = e.next();
|
|
12017
|
+
if (a.t !== "id" || a.v !== "else") throw Error("runtime: the derivation expected \"else\"");
|
|
12018
|
+
let o = Sd(e, t);
|
|
12019
|
+
return n ? i : o;
|
|
12020
|
+
}
|
|
12021
|
+
return Cd(e, t);
|
|
12022
|
+
}
|
|
12023
|
+
function Cd(e, t) {
|
|
12024
|
+
let n = wd(e, t), r = e.peek();
|
|
12025
|
+
if (r && r.t === "op" && [
|
|
12026
|
+
"<=",
|
|
12027
|
+
">=",
|
|
12028
|
+
"<",
|
|
12029
|
+
">",
|
|
12030
|
+
"=",
|
|
12031
|
+
"!="
|
|
12032
|
+
].includes(r.v)) {
|
|
12033
|
+
e.next();
|
|
12034
|
+
let i = wd(e, t);
|
|
12035
|
+
switch (r.v) {
|
|
12036
|
+
case "<=": return +(n <= i);
|
|
12037
|
+
case ">=": return +(n >= i);
|
|
12038
|
+
case "<": return +(n < i);
|
|
12039
|
+
case ">": return +(n > i);
|
|
12040
|
+
case "=": return +(n === i);
|
|
12041
|
+
case "!=": return n === i ? 0 : 1;
|
|
12042
|
+
}
|
|
12043
|
+
}
|
|
12044
|
+
return n;
|
|
12045
|
+
}
|
|
12046
|
+
function wd(e, t) {
|
|
12047
|
+
let n = Td(e, t);
|
|
12048
|
+
for (;;) {
|
|
12049
|
+
let r = e.peek();
|
|
12050
|
+
if (r && r.t === "op" && (r.v === "+" || r.v === "-")) {
|
|
12051
|
+
e.next();
|
|
12052
|
+
let i = Td(e, t);
|
|
12053
|
+
n = r.v === "+" ? n + i : n - i;
|
|
12054
|
+
continue;
|
|
12055
|
+
}
|
|
12056
|
+
return n;
|
|
12057
|
+
}
|
|
12058
|
+
}
|
|
12059
|
+
function Td(e, t) {
|
|
12060
|
+
let n = Ed(e, t);
|
|
12061
|
+
for (;;) {
|
|
12062
|
+
let r = e.peek();
|
|
12063
|
+
if (r && r.t === "op" && (r.v === "*" || r.v === "/")) {
|
|
12064
|
+
e.next();
|
|
12065
|
+
let i = Ed(e, t);
|
|
12066
|
+
n = r.v === "*" ? n * i : n / i;
|
|
12067
|
+
continue;
|
|
12068
|
+
}
|
|
12069
|
+
return n;
|
|
12070
|
+
}
|
|
12071
|
+
}
|
|
12072
|
+
function Ed(e, t) {
|
|
12073
|
+
let n = e.peek();
|
|
12074
|
+
if (n && n.t === "op" && (n.v === "-" || n.v === "+")) {
|
|
12075
|
+
e.next();
|
|
12076
|
+
let r = Ed(e, t);
|
|
12077
|
+
return n.v === "-" ? -r : r;
|
|
12078
|
+
}
|
|
12079
|
+
return Dd(e, t);
|
|
12080
|
+
}
|
|
12081
|
+
function Dd(e, t) {
|
|
12082
|
+
let n = kd(e, t);
|
|
12083
|
+
for (;;) {
|
|
12084
|
+
let t = e.peek();
|
|
12085
|
+
if (t && t.t === "op" && t.v === ".") {
|
|
12086
|
+
e.next();
|
|
12087
|
+
let t = e.next();
|
|
12088
|
+
if (t.t !== "id") throw Error("runtime: the derivation expected a field name");
|
|
12089
|
+
if (typeof n != "object" || !n || Array.isArray(n)) throw Error(`runtime: the derivation reads "${t.v}" off a plain value`);
|
|
12090
|
+
let r = n[t.v];
|
|
12091
|
+
if (r === void 0) throw Error(`runtime: the derivation reads the undeclared field "${t.v}"`);
|
|
12092
|
+
n = r;
|
|
12093
|
+
continue;
|
|
12094
|
+
}
|
|
12095
|
+
return n;
|
|
12096
|
+
}
|
|
12097
|
+
}
|
|
12098
|
+
function Od(e, t) {
|
|
12099
|
+
let n = e.peek(), r = e.peekAt(1), i = e.peekAt(2);
|
|
12100
|
+
return n?.t === "op" && n.v === "(" && r?.t === "id" && i?.t === "op" && i.v === ")" && Array.isArray(t[r.v]);
|
|
12101
|
+
}
|
|
12102
|
+
function kd(e, t) {
|
|
12103
|
+
let n = e.next();
|
|
12104
|
+
if (n.t === "num") return n.v;
|
|
12105
|
+
if (n.t === "id") {
|
|
12106
|
+
if (n.v === "sum" || n.v === "count" || n.v === "average" || (n.v === "min" || n.v === "max") && Od(e, t)) {
|
|
12107
|
+
e.expectOp("(");
|
|
12108
|
+
let r = e.next();
|
|
12109
|
+
e.expectOp(")");
|
|
12110
|
+
let i = t[r.v];
|
|
12111
|
+
if (!Array.isArray(i)) throw Error(`runtime: ${n.v}(...) aggregates a list — "${r.v}" is ${Array.isArray(i) ? "a list" : typeof i}`);
|
|
12112
|
+
let a = i.map(Number);
|
|
12113
|
+
if (n.v === "count") return a.length;
|
|
12114
|
+
if (a.length === 0) throw Error(`runtime: ${n.v}(...) over the empty list "${r.v}"`);
|
|
12115
|
+
return n.v === "sum" ? a.reduce((e, t) => e + t, 0) : n.v === "average" ? a.reduce((e, t) => e + t, 0) / a.length : n.v === "min" ? Math.min(...a) : Math.max(...a);
|
|
12116
|
+
}
|
|
12117
|
+
if (n.v === "abs" || n.v === "min" || n.v === "max") {
|
|
12118
|
+
e.expectOp("(");
|
|
12119
|
+
let r = xd(e, t), i = null, a = e.peek();
|
|
12120
|
+
if (a && a.t === "op" && a.v === "," && (e.next(), i = xd(e, t)), e.expectOp(")"), n.v === "abs") return Math.abs(r);
|
|
12121
|
+
if (i === null) throw Error(`runtime: ${n.v} needs two arguments`);
|
|
12122
|
+
return n.v === "min" ? Math.min(r, i) : Math.max(r, i);
|
|
12123
|
+
}
|
|
12124
|
+
if (n.v === "ocl") {
|
|
12125
|
+
e.expectOp("(");
|
|
12126
|
+
let n = xd(e, t);
|
|
12127
|
+
return e.expectOp(")"), n;
|
|
12128
|
+
}
|
|
12129
|
+
if (n.v === "true") return 1;
|
|
12130
|
+
if (n.v === "false") return 0;
|
|
12131
|
+
if (!(n.v in t)) throw Error(`runtime: the derivation names "${n.v}", which the run scope does not bind`);
|
|
12132
|
+
let r = t[n.v];
|
|
12133
|
+
return typeof r == "object" ? r : typeof r == "string" ? Number(r) : r;
|
|
12134
|
+
}
|
|
12135
|
+
if (n.t === "op" && n.v === "(") {
|
|
12136
|
+
let n = xd(e, t);
|
|
12137
|
+
return e.expectOp(")"), n;
|
|
12138
|
+
}
|
|
12139
|
+
throw Error("runtime: the derivation has an unexpected token");
|
|
12140
|
+
}
|
|
12141
|
+
function Ad(e) {
|
|
12142
|
+
return e.type === "TABLE_OPTIONS" || e.type === "TABLE_REFERENCE";
|
|
12143
|
+
}
|
|
12144
|
+
function jd(e, t, n) {
|
|
12145
|
+
if (!Ad(e)) throw Error(`runtime: ${e.id} declares type ${e.type} — the table evaluation takes the TABLE variable family (TABLE_OPTIONS / TABLE_REFERENCE)`);
|
|
12146
|
+
if (e.definition === "") throw Error(`runtime: the table variable ${e.id} carries no definition`);
|
|
12147
|
+
return Md(t, e.definition, n);
|
|
12148
|
+
}
|
|
12149
|
+
function Md(e, t, n) {
|
|
12150
|
+
let r = t.split(",");
|
|
12151
|
+
if (r.length < 3) throw Error(`runtime: the table lookup definition needs tableId,targetCol,matchCol,var — got "${t}"`);
|
|
12152
|
+
let i = e.find((e) => e.id === r[0].trim()), a = Number(r[1].trim());
|
|
12153
|
+
if (!i || Number.isNaN(a)) throw Error(`runtime: the table lookup names "${r[0].trim()}", which no declared table carries`);
|
|
12154
|
+
let o = i.data.slice(1);
|
|
12155
|
+
for (let e = 2; e + 1 < r.length; e += 2) {
|
|
12156
|
+
let t = Number(r[e].trim()), i = String(n[r[e + 1].trim()] ?? "");
|
|
12157
|
+
o = o.filter((e) => String(e[t] ?? "") === i);
|
|
12158
|
+
}
|
|
12159
|
+
if (o.length === 0) throw Error(`runtime: the table lookup over "${r[0].trim()}" matches no row`);
|
|
12160
|
+
let s = o[0][a] ?? "", c = Number(s);
|
|
12161
|
+
return s !== "" && !Number.isNaN(c) ? c : s;
|
|
12162
|
+
}
|
|
12163
|
+
function $(e, t) {
|
|
12164
|
+
let n = new bd(yd(e.replace(/^ocl\{/, "").replace(/\}$/, "").trim())), r = xd(n, t);
|
|
12165
|
+
if (n.peek() !== void 0) throw Error("runtime: the derivation has trailing tokens");
|
|
12166
|
+
return r;
|
|
12167
|
+
}
|
|
12168
|
+
function Nd(e, t) {
|
|
12169
|
+
let n = e.has?.attributes?.[t];
|
|
12170
|
+
return typeof n == "object" && n && "value" in n ? n : n === void 0 ? void 0 : { value: n };
|
|
12171
|
+
}
|
|
12172
|
+
function Pd(e, t) {
|
|
12173
|
+
let n = e.instruments[0]?.dimensions.find((e) => e.id === "accuracy_class"), r = t, i = n?.values.find((e) => e.id === r), a = {}, o = i?.payload ?? {};
|
|
12174
|
+
for (let [e, t] of Object.entries(o)) {
|
|
12175
|
+
let n = Number(t);
|
|
12176
|
+
a[e] = Number.isNaN(n) ? String(t) : n;
|
|
12177
|
+
}
|
|
12178
|
+
return a;
|
|
12179
|
+
}
|
|
12180
|
+
function Fd(e, t) {
|
|
12181
|
+
let n = e.instances.find((e) => e.id === t.instance);
|
|
12182
|
+
if (!n) throw Error(`runtime: no instance "${t.instance}" is declared`);
|
|
12183
|
+
let r = n.has?.dimensions?.accuracy_class, i = Pd(e, r), a = {
|
|
12184
|
+
...i,
|
|
12185
|
+
accuracy_class: i
|
|
12186
|
+
};
|
|
12187
|
+
for (let [e] of Object.entries(n.has?.attributes ?? {})) {
|
|
12188
|
+
let t = Nd(n, e);
|
|
12189
|
+
if (t === void 0) continue;
|
|
12190
|
+
let r = Number(typeof t.value == "object" ? t.value.value : t.value);
|
|
12191
|
+
Number.isNaN(r) || (a[e] = r);
|
|
12192
|
+
}
|
|
12193
|
+
let o = [], s = t.test ? e.conformanceTests.find((e) => e.id === t.test) : void 0;
|
|
12194
|
+
if (s) {
|
|
12195
|
+
for (let e of s.preparation?.entries ?? []) {
|
|
12196
|
+
let t = {};
|
|
12197
|
+
for (let [n, r] of Object.entries(e.args ?? {})) try {
|
|
12198
|
+
t[n] = $(String(r), a);
|
|
12199
|
+
} catch {
|
|
12200
|
+
t[n] = String(r);
|
|
12201
|
+
}
|
|
12202
|
+
o.push({
|
|
12203
|
+
program: "preparation",
|
|
12204
|
+
order: e.order ?? null,
|
|
12205
|
+
drive: e.drive ?? "",
|
|
12206
|
+
args: t,
|
|
12207
|
+
hold: e.hold || void 0
|
|
12208
|
+
});
|
|
12209
|
+
}
|
|
12210
|
+
for (let e of s.stimulus?.entries ?? []) {
|
|
12211
|
+
let t = {};
|
|
12212
|
+
for (let [n, r] of Object.entries(e.args ?? {})) try {
|
|
12213
|
+
t[n] = $(String(r), a);
|
|
12214
|
+
} catch {
|
|
12215
|
+
t[n] = String(r);
|
|
12216
|
+
}
|
|
12217
|
+
o.push({
|
|
12218
|
+
program: "stimulus",
|
|
12219
|
+
order: e.order ?? null,
|
|
12220
|
+
drive: e.drive ?? "",
|
|
12221
|
+
args: t,
|
|
12222
|
+
hold: e.hold || void 0,
|
|
12223
|
+
acceptance: e.acceptance || void 0
|
|
12224
|
+
});
|
|
12225
|
+
}
|
|
12226
|
+
}
|
|
12227
|
+
let c = [], l = [...t.requirement ? [t.requirement] : [], ...s?.targets ?? []], u = e.requirements.filter((e) => l.includes(e.id)).flatMap((e) => e.limit ? [e] : []), d = e.verdicts;
|
|
12228
|
+
for (let n of t.inputs) {
|
|
12229
|
+
let r = {
|
|
12230
|
+
...a,
|
|
12231
|
+
load_v: n.load_v,
|
|
12232
|
+
e_l: n.e_l,
|
|
12233
|
+
indication: n.e_l,
|
|
12234
|
+
reference: 0
|
|
12235
|
+
};
|
|
12236
|
+
for (let t of u) {
|
|
12237
|
+
let i = t.limit, a = i.accepts ? [i.accepts] : [];
|
|
12238
|
+
for (let t of a) {
|
|
12239
|
+
let a = d.find((e) => e.id === t.verdict);
|
|
12240
|
+
if (!a) continue;
|
|
12241
|
+
let o;
|
|
12242
|
+
try {
|
|
12243
|
+
o = $(a.derive, r);
|
|
12244
|
+
} catch {
|
|
12245
|
+
o = NaN;
|
|
12246
|
+
}
|
|
12247
|
+
let s = null, l = (i.expression ?? "").trim();
|
|
12248
|
+
if (l !== "") {
|
|
12249
|
+
let t = e.calculations.find((e) => e.id === l);
|
|
12250
|
+
if (t) try {
|
|
12251
|
+
s = $(t.expression ?? "", r);
|
|
12252
|
+
} catch {
|
|
12253
|
+
s = null;
|
|
12254
|
+
}
|
|
12255
|
+
else try {
|
|
12256
|
+
s = $(l, r);
|
|
12257
|
+
} catch {
|
|
12258
|
+
s = null;
|
|
12259
|
+
}
|
|
12260
|
+
}
|
|
12261
|
+
let u = t.op ?? "lte", f = Number.isNaN(o) || s === null ? "indeterminate" : u === "lte" ? o <= s ? "pass" : "fail" : u === "lt" ? o < s ? "pass" : "fail" : u === "gte" ? o >= s ? "pass" : "fail" : u === "gt" ? o > s ? "pass" : "fail" : o === s ? "pass" : "fail";
|
|
12262
|
+
c.push({
|
|
12263
|
+
id: a.id,
|
|
12264
|
+
derive: a.derive,
|
|
12265
|
+
inputs: {
|
|
12266
|
+
e_l: n.e_l,
|
|
12267
|
+
load_v: n.load_v
|
|
12268
|
+
},
|
|
12269
|
+
value: o,
|
|
12270
|
+
unit: a.unit || void 0,
|
|
12271
|
+
limit: l ? {
|
|
12272
|
+
expression: l,
|
|
12273
|
+
op: u,
|
|
12274
|
+
bound: s ?? NaN
|
|
12275
|
+
} : void 0,
|
|
12276
|
+
outcome: f
|
|
12277
|
+
});
|
|
12278
|
+
}
|
|
12279
|
+
for (let t of i.uses ?? []) {
|
|
12280
|
+
if (!t.startsWith("formula:")) continue;
|
|
12281
|
+
let i = e.calculations.find((e) => e.id === t.slice(8));
|
|
12282
|
+
if (!i?.expression) continue;
|
|
12283
|
+
let a;
|
|
12284
|
+
try {
|
|
12285
|
+
a = $(i.expression, r);
|
|
12286
|
+
} catch {
|
|
12287
|
+
continue;
|
|
12288
|
+
}
|
|
12289
|
+
c.push({
|
|
12290
|
+
id: i.id,
|
|
12291
|
+
derive: i.expression,
|
|
12292
|
+
inputs: {
|
|
12293
|
+
e_l: n.e_l,
|
|
12294
|
+
load_v: n.load_v
|
|
12295
|
+
},
|
|
12296
|
+
value: n.e_l,
|
|
12297
|
+
limit: {
|
|
12298
|
+
expression: i.id,
|
|
12299
|
+
op: "lte",
|
|
12300
|
+
bound: a
|
|
12301
|
+
},
|
|
12302
|
+
outcome: n.e_l <= a ? "pass" : "fail"
|
|
12303
|
+
});
|
|
12304
|
+
}
|
|
12305
|
+
}
|
|
12306
|
+
for (let i of t.verdicts ?? []) {
|
|
12307
|
+
let t = e.verdicts.find((e) => e.id === i);
|
|
12308
|
+
if (!t) continue;
|
|
12309
|
+
let a = { ...r };
|
|
12310
|
+
for (let t of e.calculations) if (!(!t.expression || t.id in a)) try {
|
|
12311
|
+
a[t.id] = $(t.expression, r);
|
|
12312
|
+
} catch {}
|
|
12313
|
+
let o = "indeterminate";
|
|
12314
|
+
try {
|
|
12315
|
+
o = $(t.derive, a) ? "pass" : "fail";
|
|
12316
|
+
} catch {
|
|
12317
|
+
o = "indeterminate";
|
|
12318
|
+
}
|
|
12319
|
+
c.push({
|
|
12320
|
+
id: t.id,
|
|
12321
|
+
derive: t.derive,
|
|
12322
|
+
inputs: {
|
|
12323
|
+
e_l: n.e_l,
|
|
12324
|
+
load_v: n.load_v
|
|
12325
|
+
},
|
|
12326
|
+
value: n.e_l,
|
|
12327
|
+
unit: t.unit || void 0,
|
|
12328
|
+
outcome: o
|
|
12329
|
+
});
|
|
12330
|
+
}
|
|
12331
|
+
}
|
|
12332
|
+
let f = [], p = e.subjects.find((e) => e.id === n.of || e.extends === n.of)?.has?.state ?? "", m = p ? e.stateMachines.find((e) => e.id === p || e.entityName === p) : void 0;
|
|
12333
|
+
if (m) {
|
|
12334
|
+
let e = [];
|
|
12335
|
+
for (let t of o) {
|
|
12336
|
+
let n = t.drive;
|
|
12337
|
+
n && m.transitions.some((e) => e.actionName === n) && e.push({
|
|
12338
|
+
id: `${t.program}:${t.order ?? ""}`,
|
|
12339
|
+
fires: n,
|
|
12340
|
+
at: String(e.length)
|
|
12341
|
+
});
|
|
12342
|
+
}
|
|
12343
|
+
if (e.length > 0) try {
|
|
12344
|
+
f = vd(m, {
|
|
12345
|
+
state: m.initialState,
|
|
12346
|
+
at: "0"
|
|
12347
|
+
}, e);
|
|
12348
|
+
} catch {
|
|
12349
|
+
f = [];
|
|
12350
|
+
}
|
|
12351
|
+
}
|
|
12352
|
+
let h = [];
|
|
12353
|
+
if (t.evidenceRegistry) {
|
|
12354
|
+
let e = {
|
|
12355
|
+
registry: t.evidenceRegistry,
|
|
12356
|
+
run: t.runId ?? (t.test ? `${t.instance}:${t.test}` : t.instance),
|
|
12357
|
+
values: [...t.inputs.map((e, t) => ({
|
|
12358
|
+
id: `load_v[${t}]`,
|
|
12359
|
+
value: e.load_v,
|
|
12360
|
+
provenance: void 0
|
|
12361
|
+
})), ...c.map((e, t) => ({
|
|
12362
|
+
id: `${e.id}[${t}]`,
|
|
12363
|
+
value: e.value,
|
|
12364
|
+
unit: e.unit,
|
|
12365
|
+
provenance: void 0
|
|
12366
|
+
}))]
|
|
12367
|
+
};
|
|
12368
|
+
h.push(e);
|
|
12369
|
+
}
|
|
12370
|
+
return {
|
|
12371
|
+
instance: t.instance,
|
|
12372
|
+
test: t.test,
|
|
12373
|
+
programs: o,
|
|
12374
|
+
verdicts: c,
|
|
12375
|
+
trajectory: f,
|
|
12376
|
+
evidence: h
|
|
12377
|
+
};
|
|
12378
|
+
}
|
|
12379
|
+
//#endregion
|
|
11885
12380
|
//#region src/ser-des/index.ts
|
|
11886
|
-
function
|
|
12381
|
+
function Id(e, t = {}) {
|
|
11887
12382
|
return m(u(e, Ul, t), Wl);
|
|
11888
12383
|
}
|
|
11889
|
-
function
|
|
12384
|
+
function Ld(e, t = {}) {
|
|
11890
12385
|
let n = u(e, Ul, t);
|
|
11891
12386
|
return {
|
|
11892
12387
|
standard: m(n, Wl),
|
|
11893
12388
|
issues: n.issues
|
|
11894
12389
|
};
|
|
11895
12390
|
}
|
|
11896
|
-
function
|
|
11897
|
-
return
|
|
12391
|
+
function Rd(e, t = {}) {
|
|
12392
|
+
return Id(Jl(e), t);
|
|
11898
12393
|
}
|
|
11899
|
-
function
|
|
11900
|
-
return
|
|
12394
|
+
function zd(e, t = {}) {
|
|
12395
|
+
return Ld(Jl(e), t);
|
|
11901
12396
|
}
|
|
11902
|
-
function
|
|
12397
|
+
function Bd(e) {
|
|
11903
12398
|
return Xe(e, Gl);
|
|
11904
12399
|
}
|
|
11905
|
-
function
|
|
12400
|
+
function Vd(e) {
|
|
11906
12401
|
return Yl(e);
|
|
11907
12402
|
}
|
|
11908
12403
|
//#endregion
|
|
11909
|
-
export { X as CompositionError, Da as ENDPOINT_ACCESS_SCOPES, Ea as ENDPOINT_OPERATION_KINDS, ic as PASSPORT_ACCESS_CLASSES, rc as PASSPORT_CONTENT_CLASSES, ac as PASSPORT_UPI_LEVELS, Au as PRIMITIVE_TYPES, qu as TIER_BY_FIELD, Ku as TIER_ORDER, Wu as applyView, Ru as buildProcessTree, Q as canonical, id as clauseTextKey, Lu as collectMappings, Gu as componentIds, Bu as computeCoverage,
|
|
12404
|
+
export { X as CompositionError, Da as ENDPOINT_ACCESS_SCOPES, Ea as ENDPOINT_OPERATION_KINDS, ic as PASSPORT_ACCESS_CLASSES, rc as PASSPORT_CONTENT_CLASSES, ac as PASSPORT_UPI_LEVELS, Au as PRIMITIVE_TYPES, qu as TIER_BY_FIELD, Ku as TIER_ORDER, Wu as applyView, Ru as buildProcessTree, Q as canonical, id as clauseTextKey, Lu as collectMappings, Gu as componentIds, Bu as computeCoverage, pd as diffStandards, Vu as discoverTransitive, Bd as dump, wa as dumpPackage, Du as dumpPrm, hu as effectiveUses, rd as elementIndex, $ as evaluateExpression, jd as evaluateTableVariable, Fd as executeRun, gd as formatDiffReport, ou as groupBySourceFile, Ad as isTableVariable, Pu as isWellFormedMapType, Id as load, Rd as loadFile, zd as loadFileWithIssues, au as loadPackage, mu as loadPackageWithIssues, su as loadPackageWithProvenance, Eu as loadPrm, Ld as loadWithIssues, Md as lookupTable, ku as mapProfilesToPrm, Iu as mappingsFromProfile, Yu as normalizeSourceRef, iu as packageFiles, d as parseDeclarations, Fu as parseTargetRef, Nu as parseTypeExpression, Ou as prmToMapProfiles, fu as readPackageManifest, Hu as repoMap, Vd as validate };
|
package/dist-cli/primmel.mjs
CHANGED
|
@@ -4720,22 +4720,58 @@ var parseProvision = function(id, data) {
|
|
|
4720
4720
|
ref: []
|
|
4721
4721
|
}
|
|
4722
4722
|
};
|
|
4723
|
-
|
|
4724
|
-
|
|
4725
|
-
(
|
|
4726
|
-
|
|
4727
|
-
|
|
4728
|
-
|
|
4729
|
-
|
|
4730
|
-
|
|
4731
|
-
|
|
4732
|
-
|
|
4733
|
-
|
|
4723
|
+
const KNOWN = /* @__PURE__ */ new Set(["modality", "condition", "reference"]);
|
|
4724
|
+
const unwrapToken = (x) => {
|
|
4725
|
+
if (x.length >= 2 && x.startsWith('"') && x.endsWith('"')) {
|
|
4726
|
+
return unescapeString(x.slice(1, -1));
|
|
4727
|
+
}
|
|
4728
|
+
if (x.length >= 2 && x.startsWith("{") && x.endsWith("}")) {
|
|
4729
|
+
return unwrapBlock(x);
|
|
4730
|
+
}
|
|
4731
|
+
return x;
|
|
4732
|
+
};
|
|
4733
|
+
const t = tokenizePackage(data);
|
|
4734
|
+
let i = 0;
|
|
4735
|
+
while (i < t.length) {
|
|
4736
|
+
const keyword = t[i++];
|
|
4737
|
+
if (keyword === "modality") {
|
|
4738
|
+
if (i >= t.length) {
|
|
4739
|
+
throw new Error(
|
|
4740
|
+
`Parsing error: provision. ID ${id}: Expecting value for modality`
|
|
4741
|
+
);
|
|
4734
4742
|
}
|
|
4735
|
-
|
|
4736
|
-
|
|
4737
|
-
|
|
4738
|
-
|
|
4743
|
+
result.modality = t[i++];
|
|
4744
|
+
continue;
|
|
4745
|
+
}
|
|
4746
|
+
if (keyword === "condition") {
|
|
4747
|
+
if (i >= t.length) {
|
|
4748
|
+
throw new Error(
|
|
4749
|
+
`Parsing error: provision. ID ${id}: Expecting value for condition`
|
|
4750
|
+
);
|
|
4751
|
+
}
|
|
4752
|
+
result.condition = unwrapToken(t[i++]);
|
|
4753
|
+
continue;
|
|
4754
|
+
}
|
|
4755
|
+
if (keyword === "reference") {
|
|
4756
|
+
if (i >= t.length) {
|
|
4757
|
+
throw new Error(
|
|
4758
|
+
`Parsing error: provision. ID ${id}: Expecting value for reference`
|
|
4759
|
+
);
|
|
4760
|
+
}
|
|
4761
|
+
result._relations.ref = tokenizePackage(t[i++]);
|
|
4762
|
+
continue;
|
|
4763
|
+
}
|
|
4764
|
+
const rest = [];
|
|
4765
|
+
while (i < t.length && !KNOWN.has(t[i])) {
|
|
4766
|
+
rest.push(t[i++]);
|
|
4767
|
+
}
|
|
4768
|
+
if (rest.length === 0) {
|
|
4769
|
+
result.subject.set(keyword, "");
|
|
4770
|
+
break;
|
|
4771
|
+
}
|
|
4772
|
+
const value = rest.map(unwrapToken).join(" ");
|
|
4773
|
+
result.subject.set(keyword, value);
|
|
4774
|
+
}
|
|
4739
4775
|
return (ctx) => {
|
|
4740
4776
|
ctx.provisions[id] = result;
|
|
4741
4777
|
return ctx;
|
|
@@ -4754,7 +4790,8 @@ var resolveProvision = function(ctx, unresolved) {
|
|
|
4754
4790
|
var dumpProvision = function(pro) {
|
|
4755
4791
|
let out = "provision " + pro.id + " {\n";
|
|
4756
4792
|
pro.subject.forEach((value, key) => {
|
|
4757
|
-
|
|
4793
|
+
const v = value.includes(" ") ? `"${escapeString(value)}"` : value;
|
|
4794
|
+
out += " " + key + " " + v + "\n";
|
|
4758
4795
|
});
|
|
4759
4796
|
out += ' condition "' + escapeString(pro.condition) + '"\n';
|
|
4760
4797
|
if (pro.modality !== "") {
|
package/package.json
CHANGED