@primmel/primmel 1.21.10 → 1.21.11

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.
@@ -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;IA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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;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,CAAC;AAC9C,CAAC;AAED;;;GAGG;AACH,SAAgB,QAAQ,CACtB,QAAgB,EAChB,UAAuB,EAAE;IAEzB,MAAM,OAAO,GAAG,IAAA,6BAAkB,E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AAA;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"}
@@ -11599,14 +11599,14 @@ function rd(e, t) {
11599
11599
  function id(e, t) {
11600
11600
  return `${e}#${t}`;
11601
11601
  }
11602
- function $(e) {
11602
+ function ad(e) {
11603
11603
  return e?.version ?? "";
11604
11604
  }
11605
- function ad(e) {
11605
+ function od(e) {
11606
11606
  let t = [...new Set(e)].sort();
11607
11607
  return t.filter((e) => !t.some((t) => t !== e && e.startsWith(t + ".")));
11608
11608
  }
11609
- function od(e, t, n) {
11609
+ function sd(e, t, n) {
11610
11610
  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
11611
  for (let [e, t] of s) o.has(e) || c.push(t);
11612
11612
  for (let [e, t] of o) {
@@ -11665,12 +11665,12 @@ function od(e, t, n) {
11665
11665
  namespacesSkipped: p
11666
11666
  };
11667
11667
  }
11668
- function sd(e, t) {
11668
+ function cd(e, t) {
11669
11669
  let n = [];
11670
11670
  for (let [t, r] of e) {
11671
11671
  let e = /* @__PURE__ */ new Set([...t.provenance.map((e) => e.basis), ...r.provenance.map((e) => e.basis)]);
11672
11672
  for (let i of [...e].sort()) {
11673
- let e = (e) => ad(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));
11673
+ 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
11674
  if (s.length === 0 && c.length === 0) continue;
11675
11675
  let l = {
11676
11676
  key: t.key,
@@ -11736,21 +11736,21 @@ function sd(e, t) {
11736
11736
  }
11737
11737
  return [...i.values()].sort((e, t) => `${e.doc} ${e.from} ${e.to}`.localeCompare(`${t.doc} ${t.from} ${t.to}`));
11738
11738
  }
11739
- function cd(e, t, n) {
11739
+ function ld(e, t, n) {
11740
11740
  return e.kind !== "texts" || !n.startsWith("spelling:") ? n : n in e.aspects ? n in t.aspects ? `${n} (changed)` : `${n} (removed)` : `${n} (added)`;
11741
11741
  }
11742
- var ld = (e) => typeof e == "object" && !!e && !Array.isArray(e);
11743
- function ud(e, t, n, r) {
11744
- if (ld(t) && ld(n)) {
11742
+ var ud = (e) => typeof e == "object" && !!e && !Array.isArray(e);
11743
+ function dd(e, t, n, r) {
11744
+ if (ud(t) && ud(n)) {
11745
11745
  let i = [.../* @__PURE__ */ new Set([...Object.keys(t), ...Object.keys(n)])].sort();
11746
- for (let a of i) ud(`${e}.${a}`, t[a], n[a], r);
11746
+ for (let a of i) dd(`${e}.${a}`, t[a], n[a], r);
11747
11747
  return;
11748
11748
  }
11749
11749
  Q(t) !== Q(n) && r.push(e);
11750
11750
  }
11751
- function dd(e, t) {
11751
+ function fd(e, t) {
11752
11752
  let n = [.../* @__PURE__ */ new Set([...Object.keys(e.fields), ...Object.keys(t.fields)])].sort(), r = [];
11753
- for (let i of n) ud(i, e.fields[i], t.fields[i], r);
11753
+ for (let i of n) dd(i, e.fields[i], t.fields[i], r);
11754
11754
  let i = [
11755
11755
  "source",
11756
11756
  "sourceRef",
@@ -11763,7 +11763,7 @@ function dd(e, t) {
11763
11763
  return !a.has(r) && (a.add(r), !0);
11764
11764
  });
11765
11765
  }
11766
- function fd(e, t, n = {}) {
11766
+ function pd(e, t, n = {}) {
11767
11767
  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
11768
  added: 0,
11769
11769
  removed: 0,
@@ -11802,17 +11802,17 @@ function fd(e, t, n = {}) {
11802
11802
  id: t.id,
11803
11803
  kind: t.kind,
11804
11804
  tier: t.tier,
11805
- aspects: r.map((e) => cd(t, n, e)).sort(),
11806
- fields: dd(t, n)
11805
+ aspects: r.map((e) => ld(t, n, e)).sort(),
11806
+ fields: fd(t, n)
11807
11807
  }), p[t.tier].changed++);
11808
11808
  }
11809
- let m = od(e, t, n), h = sd(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}@${$(_) || "?"}` : "a"), b = n.bLabel ?? (v?.id ? `${v.id}@${$(v) || "?"}` : "b"), ee = !!_?.id && _.id === v?.id && $(_) !== $(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))];
11809
+ 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
11810
  return {
11811
11811
  aLabel: y,
11812
11812
  bLabel: b,
11813
11813
  editionComparison: ee,
11814
- aVersion: $(_),
11815
- bVersion: $(v),
11814
+ aVersion: ad(_),
11815
+ bVersion: ad(v),
11816
11816
  added: s.sort((e, t) => e.key.localeCompare(t.key)),
11817
11817
  removed: c.sort((e, t) => e.key.localeCompare(t.key)),
11818
11818
  changed: l.sort((e, t) => e.key.localeCompare(t.key)),
@@ -11825,17 +11825,17 @@ function fd(e, t, n = {}) {
11825
11825
  empty: g
11826
11826
  };
11827
11827
  }
11828
- function pd(e) {
11828
+ function md(e) {
11829
11829
  return `[${e.tier}/${e.kind}] ${e.id}`;
11830
11830
  }
11831
- function md(e, t) {
11831
+ function hd(e, t) {
11832
11832
  try {
11833
11833
  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
11834
  if (i.length > 0) return i;
11835
11835
  } catch {}
11836
11836
  return [`from ${e}`, `to ${t}`];
11837
11837
  }
11838
- function hd(e) {
11838
+ function gd(e) {
11839
11839
  let t = [], n = e.editionComparison ? `edition comparison — ${e.aLabel} → ${e.bLabel}` : `model diff — ${e.aLabel} → ${e.bLabel}`;
11840
11840
  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
11841
  for (let n of Ku) {
@@ -11844,21 +11844,21 @@ function hd(e) {
11844
11844
  }
11845
11845
  if (e.added.length > 0) {
11846
11846
  t.push("", "added:");
11847
- for (let n of e.added) t.push(` + ${pd(n)}`);
11847
+ for (let n of e.added) t.push(` + ${md(n)}`);
11848
11848
  }
11849
11849
  if (e.removed.length > 0) {
11850
11850
  t.push("", "removed:");
11851
- for (let n of e.removed) t.push(` - ${pd(n)}`);
11851
+ for (let n of e.removed) t.push(` - ${md(n)}`);
11852
11852
  }
11853
11853
  if (e.changed.length > 0) {
11854
11854
  t.push("", "changed:");
11855
- for (let n of e.changed) t.push(` ~ ${pd(n)} — ${n.aspects.join(", ")} (fields: ${n.fields.join(", ")})`);
11855
+ for (let n of e.changed) t.push(` ~ ${md(n)} — ${n.aspects.join(", ")} (fields: ${n.fields.join(", ")})`);
11856
11856
  }
11857
11857
  if (e.moved.length > 0) {
11858
11858
  t.push("", "moved (re-anchored):");
11859
11859
  for (let n of e.moved) {
11860
- t.push(` > ${pd(n)}`);
11861
- for (let e of md(n.from, n.to)) t.push(` ${e}`);
11860
+ t.push(` > ${md(n)}`);
11861
+ for (let e of hd(n.from, n.to)) t.push(` ${e}`);
11862
11862
  }
11863
11863
  }
11864
11864
  if (e.warnings.length > 0) {
@@ -11882,28 +11882,495 @@ function hd(e) {
11882
11882
  return t.join("\n");
11883
11883
  }
11884
11884
  //#endregion
11885
+ //#region src/operational-state.ts
11886
+ var _d = class extends Error {
11887
+ constructor(e) {
11888
+ super(e), this.name = "StateTrajectoryError";
11889
+ }
11890
+ };
11891
+ function vd(e, t, n) {
11892
+ let r = t.state ?? e.initialState, i = [{
11893
+ state: r,
11894
+ at: t.at,
11895
+ firedBy: ""
11896
+ }];
11897
+ for (let t of n) {
11898
+ if (!t.fires) continue;
11899
+ let n = e.transitions.filter((e) => e.actionName === t.fires);
11900
+ 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`);
11901
+ let a = n.find((e) => e.from === r || e.from === "*");
11902
+ 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(", ")})`);
11903
+ r = a.to, i.push({
11904
+ state: r,
11905
+ at: t.at,
11906
+ firedBy: t.id
11907
+ });
11908
+ }
11909
+ return i;
11910
+ }
11911
+ //#endregion
11912
+ //#region src/runtime.ts
11913
+ function yd(e) {
11914
+ let t = [], n = 0, r = e;
11915
+ for (; n < r.length;) {
11916
+ let e = r[n];
11917
+ if (/\s/.test(e)) {
11918
+ n++;
11919
+ continue;
11920
+ }
11921
+ if (/[0-9]/.test(e) || e === "." && /[0-9]/.test(r[n + 1] ?? "")) {
11922
+ let e = n;
11923
+ for (; e < r.length && /[0-9.]/.test(r[e]);) e++;
11924
+ t.push({
11925
+ t: "num",
11926
+ v: Number(r.slice(n, e))
11927
+ }), n = e;
11928
+ continue;
11929
+ }
11930
+ if (/[A-Za-z_]/.test(e)) {
11931
+ let e = n;
11932
+ for (; e < r.length && /[A-Za-z0-9_]/.test(r[e]);) e++;
11933
+ t.push({
11934
+ t: "id",
11935
+ v: r.slice(n, e)
11936
+ }), n = e;
11937
+ continue;
11938
+ }
11939
+ if (r.startsWith("<=", n) || r.startsWith(">=", n) || r.startsWith("!=", n)) {
11940
+ t.push({
11941
+ t: "op",
11942
+ v: r.slice(n, n + 2)
11943
+ }), n += 2;
11944
+ continue;
11945
+ }
11946
+ if ("+-*/()<>=,.".includes(e)) {
11947
+ t.push({
11948
+ t: "op",
11949
+ v: e
11950
+ }), n++;
11951
+ continue;
11952
+ }
11953
+ throw Error(`runtime: the derivation uses a character the evaluator does not know: "${e}"`);
11954
+ }
11955
+ return t;
11956
+ }
11957
+ var bd = class {
11958
+ toks;
11959
+ constructor(e) {
11960
+ this.toks = e;
11961
+ }
11962
+ pos = 0;
11963
+ peek() {
11964
+ return this.toks[this.pos];
11965
+ }
11966
+ peekAt(e) {
11967
+ return this.toks[this.pos + e];
11968
+ }
11969
+ next() {
11970
+ let e = this.toks[this.pos];
11971
+ if (!e) throw Error("runtime: the derivation ended unexpectedly");
11972
+ return this.pos++, e;
11973
+ }
11974
+ expectOp(e) {
11975
+ let t = this.next();
11976
+ if (t.t !== "op" || t.v !== e) throw Error(`runtime: the derivation expected "${e}"`);
11977
+ }
11978
+ };
11979
+ function xd(e, t) {
11980
+ return Sd(e, t);
11981
+ }
11982
+ function Sd(e, t) {
11983
+ let n = e.peek();
11984
+ if (n && n.t === "id" && n.v === "if") {
11985
+ e.next();
11986
+ let n = Cd(e, t), r = e.next();
11987
+ if (r.t !== "id" || r.v !== "then") throw Error("runtime: the derivation expected \"then\"");
11988
+ let i = Sd(e, t), a = e.next();
11989
+ if (a.t !== "id" || a.v !== "else") throw Error("runtime: the derivation expected \"else\"");
11990
+ let o = Sd(e, t);
11991
+ return n ? i : o;
11992
+ }
11993
+ return Cd(e, t);
11994
+ }
11995
+ function Cd(e, t) {
11996
+ let n = wd(e, t), r = e.peek();
11997
+ if (r && r.t === "op" && [
11998
+ "<=",
11999
+ ">=",
12000
+ "<",
12001
+ ">",
12002
+ "=",
12003
+ "!="
12004
+ ].includes(r.v)) {
12005
+ e.next();
12006
+ let i = wd(e, t);
12007
+ switch (r.v) {
12008
+ case "<=": return +(n <= i);
12009
+ case ">=": return +(n >= i);
12010
+ case "<": return +(n < i);
12011
+ case ">": return +(n > i);
12012
+ case "=": return +(n === i);
12013
+ case "!=": return n === i ? 0 : 1;
12014
+ }
12015
+ }
12016
+ return n;
12017
+ }
12018
+ function wd(e, t) {
12019
+ let n = Td(e, t);
12020
+ for (;;) {
12021
+ let r = e.peek();
12022
+ if (r && r.t === "op" && (r.v === "+" || r.v === "-")) {
12023
+ e.next();
12024
+ let i = Td(e, t);
12025
+ n = r.v === "+" ? n + i : n - i;
12026
+ continue;
12027
+ }
12028
+ return n;
12029
+ }
12030
+ }
12031
+ function Td(e, t) {
12032
+ let n = Ed(e, t);
12033
+ for (;;) {
12034
+ let r = e.peek();
12035
+ if (r && r.t === "op" && (r.v === "*" || r.v === "/")) {
12036
+ e.next();
12037
+ let i = Ed(e, t);
12038
+ n = r.v === "*" ? n * i : n / i;
12039
+ continue;
12040
+ }
12041
+ return n;
12042
+ }
12043
+ }
12044
+ function Ed(e, t) {
12045
+ let n = e.peek();
12046
+ if (n && n.t === "op" && (n.v === "-" || n.v === "+")) {
12047
+ e.next();
12048
+ let r = Ed(e, t);
12049
+ return n.v === "-" ? -r : r;
12050
+ }
12051
+ return Dd(e, t);
12052
+ }
12053
+ function Dd(e, t) {
12054
+ let n = kd(e, t);
12055
+ for (;;) {
12056
+ let t = e.peek();
12057
+ if (t && t.t === "op" && t.v === ".") {
12058
+ e.next();
12059
+ let t = e.next();
12060
+ if (t.t !== "id") throw Error("runtime: the derivation expected a field name");
12061
+ if (typeof n != "object" || !n || Array.isArray(n)) throw Error(`runtime: the derivation reads "${t.v}" off a plain value`);
12062
+ let r = n[t.v];
12063
+ if (r === void 0) throw Error(`runtime: the derivation reads the undeclared field "${t.v}"`);
12064
+ n = r;
12065
+ continue;
12066
+ }
12067
+ return n;
12068
+ }
12069
+ }
12070
+ function Od(e, t) {
12071
+ let n = e.peek(), r = e.peekAt(1), i = e.peekAt(2);
12072
+ return n?.t === "op" && n.v === "(" && r?.t === "id" && i?.t === "op" && i.v === ")" && Array.isArray(t[r.v]);
12073
+ }
12074
+ function kd(e, t) {
12075
+ let n = e.next();
12076
+ if (n.t === "num") return n.v;
12077
+ if (n.t === "id") {
12078
+ if (n.v === "sum" || n.v === "count" || n.v === "average" || (n.v === "min" || n.v === "max") && Od(e, t)) {
12079
+ e.expectOp("(");
12080
+ let r = e.next();
12081
+ e.expectOp(")");
12082
+ let i = t[r.v];
12083
+ if (!Array.isArray(i)) throw Error(`runtime: ${n.v}(...) aggregates a list — "${r.v}" is ${Array.isArray(i) ? "a list" : typeof i}`);
12084
+ let a = i.map(Number);
12085
+ if (n.v === "count") return a.length;
12086
+ if (a.length === 0) throw Error(`runtime: ${n.v}(...) over the empty list "${r.v}"`);
12087
+ 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);
12088
+ }
12089
+ if (n.v === "abs" || n.v === "min" || n.v === "max") {
12090
+ e.expectOp("(");
12091
+ let r = xd(e, t), i = null, a = e.peek();
12092
+ if (a && a.t === "op" && a.v === "," && (e.next(), i = xd(e, t)), e.expectOp(")"), n.v === "abs") return Math.abs(r);
12093
+ if (i === null) throw Error(`runtime: ${n.v} needs two arguments`);
12094
+ return n.v === "min" ? Math.min(r, i) : Math.max(r, i);
12095
+ }
12096
+ if (n.v === "ocl") {
12097
+ e.expectOp("(");
12098
+ let n = xd(e, t);
12099
+ return e.expectOp(")"), n;
12100
+ }
12101
+ if (n.v === "true") return 1;
12102
+ if (n.v === "false") return 0;
12103
+ if (!(n.v in t)) throw Error(`runtime: the derivation names "${n.v}", which the run scope does not bind`);
12104
+ let r = t[n.v];
12105
+ return typeof r == "object" ? r : typeof r == "string" ? Number(r) : r;
12106
+ }
12107
+ if (n.t === "op" && n.v === "(") {
12108
+ let n = xd(e, t);
12109
+ return e.expectOp(")"), n;
12110
+ }
12111
+ throw Error("runtime: the derivation has an unexpected token");
12112
+ }
12113
+ function Ad(e) {
12114
+ return e.type === "TABLE_OPTIONS" || e.type === "TABLE_REFERENCE";
12115
+ }
12116
+ function jd(e, t, n) {
12117
+ if (!Ad(e)) throw Error(`runtime: ${e.id} declares type ${e.type} — the table evaluation takes the TABLE variable family (TABLE_OPTIONS / TABLE_REFERENCE)`);
12118
+ if (e.definition === "") throw Error(`runtime: the table variable ${e.id} carries no definition`);
12119
+ return Md(t, e.definition, n);
12120
+ }
12121
+ function Md(e, t, n) {
12122
+ let r = t.split(",");
12123
+ if (r.length < 3) throw Error(`runtime: the table lookup definition needs tableId,targetCol,matchCol,var — got "${t}"`);
12124
+ let i = e.find((e) => e.id === r[0].trim()), a = Number(r[1].trim());
12125
+ if (!i || Number.isNaN(a)) throw Error(`runtime: the table lookup names "${r[0].trim()}", which no declared table carries`);
12126
+ let o = i.data.slice(1);
12127
+ for (let e = 2; e + 1 < r.length; e += 2) {
12128
+ let t = Number(r[e].trim()), i = String(n[r[e + 1].trim()] ?? "");
12129
+ o = o.filter((e) => String(e[t] ?? "") === i);
12130
+ }
12131
+ if (o.length === 0) throw Error(`runtime: the table lookup over "${r[0].trim()}" matches no row`);
12132
+ let s = o[0][a] ?? "", c = Number(s);
12133
+ return s !== "" && !Number.isNaN(c) ? c : s;
12134
+ }
12135
+ function $(e, t) {
12136
+ let n = new bd(yd(e.replace(/^ocl\{/, "").replace(/\}$/, "").trim())), r = xd(n, t);
12137
+ if (n.peek() !== void 0) throw Error("runtime: the derivation has trailing tokens");
12138
+ return r;
12139
+ }
12140
+ function Nd(e, t) {
12141
+ let n = e.has?.attributes?.[t];
12142
+ return typeof n == "object" && n && "value" in n ? n : n === void 0 ? void 0 : { value: n };
12143
+ }
12144
+ function Pd(e, t) {
12145
+ 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 ?? {};
12146
+ for (let [e, t] of Object.entries(o)) {
12147
+ let n = Number(t);
12148
+ a[e] = Number.isNaN(n) ? String(t) : n;
12149
+ }
12150
+ return a;
12151
+ }
12152
+ function Fd(e, t) {
12153
+ let n = e.instances.find((e) => e.id === t.instance);
12154
+ if (!n) throw Error(`runtime: no instance "${t.instance}" is declared`);
12155
+ let r = n.has?.dimensions?.accuracy_class, i = Pd(e, r), a = {
12156
+ ...i,
12157
+ accuracy_class: i
12158
+ };
12159
+ for (let [e] of Object.entries(n.has?.attributes ?? {})) {
12160
+ let t = Nd(n, e);
12161
+ if (t === void 0) continue;
12162
+ let r = Number(typeof t.value == "object" ? t.value.value : t.value);
12163
+ Number.isNaN(r) || (a[e] = r);
12164
+ }
12165
+ let o = [], s = t.test ? e.conformanceTests.find((e) => e.id === t.test) : void 0;
12166
+ if (s) {
12167
+ for (let e of s.preparation?.entries ?? []) {
12168
+ let t = {};
12169
+ for (let [n, r] of Object.entries(e.args ?? {})) try {
12170
+ t[n] = $(String(r), a);
12171
+ } catch {
12172
+ t[n] = String(r);
12173
+ }
12174
+ o.push({
12175
+ program: "preparation",
12176
+ order: e.order ?? null,
12177
+ drive: e.drive ?? "",
12178
+ args: t,
12179
+ hold: e.hold || void 0
12180
+ });
12181
+ }
12182
+ for (let e of s.stimulus?.entries ?? []) {
12183
+ let t = {};
12184
+ for (let [n, r] of Object.entries(e.args ?? {})) try {
12185
+ t[n] = $(String(r), a);
12186
+ } catch {
12187
+ t[n] = String(r);
12188
+ }
12189
+ o.push({
12190
+ program: "stimulus",
12191
+ order: e.order ?? null,
12192
+ drive: e.drive ?? "",
12193
+ args: t,
12194
+ hold: e.hold || void 0,
12195
+ acceptance: e.acceptance || void 0
12196
+ });
12197
+ }
12198
+ }
12199
+ 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;
12200
+ for (let n of t.inputs) {
12201
+ let r = {
12202
+ ...a,
12203
+ load_v: n.load_v,
12204
+ e_l: n.e_l,
12205
+ indication: n.e_l,
12206
+ reference: 0
12207
+ };
12208
+ for (let t of u) {
12209
+ let i = t.limit, a = i.accepts ? [i.accepts] : [];
12210
+ for (let t of a) {
12211
+ let a = d.find((e) => e.id === t.verdict);
12212
+ if (!a) continue;
12213
+ let o;
12214
+ try {
12215
+ o = $(a.derive, r);
12216
+ } catch {
12217
+ o = NaN;
12218
+ }
12219
+ let s = null, l = (i.expression ?? "").trim();
12220
+ if (l !== "") {
12221
+ let t = e.calculations.find((e) => e.id === l);
12222
+ if (t) try {
12223
+ s = $(t.expression ?? "", r);
12224
+ } catch {
12225
+ s = null;
12226
+ }
12227
+ else try {
12228
+ s = $(l, r);
12229
+ } catch {
12230
+ s = null;
12231
+ }
12232
+ }
12233
+ 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";
12234
+ c.push({
12235
+ id: a.id,
12236
+ derive: a.derive,
12237
+ inputs: {
12238
+ e_l: n.e_l,
12239
+ load_v: n.load_v
12240
+ },
12241
+ value: o,
12242
+ unit: a.unit || void 0,
12243
+ limit: l ? {
12244
+ expression: l,
12245
+ op: u,
12246
+ bound: s ?? NaN
12247
+ } : void 0,
12248
+ outcome: f
12249
+ });
12250
+ }
12251
+ for (let t of i.uses ?? []) {
12252
+ if (!t.startsWith("formula:")) continue;
12253
+ let i = e.calculations.find((e) => e.id === t.slice(8));
12254
+ if (!i?.expression) continue;
12255
+ let a;
12256
+ try {
12257
+ a = $(i.expression, r);
12258
+ } catch {
12259
+ continue;
12260
+ }
12261
+ c.push({
12262
+ id: i.id,
12263
+ derive: i.expression,
12264
+ inputs: {
12265
+ e_l: n.e_l,
12266
+ load_v: n.load_v
12267
+ },
12268
+ value: n.e_l,
12269
+ limit: {
12270
+ expression: i.id,
12271
+ op: "lte",
12272
+ bound: a
12273
+ },
12274
+ outcome: n.e_l <= a ? "pass" : "fail"
12275
+ });
12276
+ }
12277
+ }
12278
+ for (let i of t.verdicts ?? []) {
12279
+ let t = e.verdicts.find((e) => e.id === i);
12280
+ if (!t) continue;
12281
+ let a = { ...r };
12282
+ for (let t of e.calculations) if (!(!t.expression || t.id in a)) try {
12283
+ a[t.id] = $(t.expression, r);
12284
+ } catch {}
12285
+ let o = "indeterminate";
12286
+ try {
12287
+ o = $(t.derive, a) ? "pass" : "fail";
12288
+ } catch {
12289
+ o = "indeterminate";
12290
+ }
12291
+ c.push({
12292
+ id: t.id,
12293
+ derive: t.derive,
12294
+ inputs: {
12295
+ e_l: n.e_l,
12296
+ load_v: n.load_v
12297
+ },
12298
+ value: n.e_l,
12299
+ unit: t.unit || void 0,
12300
+ outcome: o
12301
+ });
12302
+ }
12303
+ }
12304
+ 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;
12305
+ if (m) {
12306
+ let e = [];
12307
+ for (let t of o) {
12308
+ let n = t.drive;
12309
+ n && m.transitions.some((e) => e.actionName === n) && e.push({
12310
+ id: `${t.program}:${t.order ?? ""}`,
12311
+ fires: n,
12312
+ at: String(e.length)
12313
+ });
12314
+ }
12315
+ if (e.length > 0) try {
12316
+ f = vd(m, {
12317
+ state: m.initialState,
12318
+ at: "0"
12319
+ }, e);
12320
+ } catch {
12321
+ f = [];
12322
+ }
12323
+ }
12324
+ let h = [];
12325
+ if (t.evidenceRegistry) {
12326
+ let e = {
12327
+ registry: t.evidenceRegistry,
12328
+ run: t.runId ?? (t.test ? `${t.instance}:${t.test}` : t.instance),
12329
+ values: [...t.inputs.map((e, t) => ({
12330
+ id: `load_v[${t}]`,
12331
+ value: e.load_v,
12332
+ provenance: void 0
12333
+ })), ...c.map((e, t) => ({
12334
+ id: `${e.id}[${t}]`,
12335
+ value: e.value,
12336
+ unit: e.unit,
12337
+ provenance: void 0
12338
+ }))]
12339
+ };
12340
+ h.push(e);
12341
+ }
12342
+ return {
12343
+ instance: t.instance,
12344
+ test: t.test,
12345
+ programs: o,
12346
+ verdicts: c,
12347
+ trajectory: f,
12348
+ evidence: h
12349
+ };
12350
+ }
12351
+ //#endregion
11885
12352
  //#region src/ser-des/index.ts
11886
- function gd(e, t = {}) {
12353
+ function Id(e, t = {}) {
11887
12354
  return m(u(e, Ul, t), Wl);
11888
12355
  }
11889
- function _d(e, t = {}) {
12356
+ function Ld(e, t = {}) {
11890
12357
  let n = u(e, Ul, t);
11891
12358
  return {
11892
12359
  standard: m(n, Wl),
11893
12360
  issues: n.issues
11894
12361
  };
11895
12362
  }
11896
- function vd(e, t = {}) {
11897
- return gd(Jl(e), t);
12363
+ function Rd(e, t = {}) {
12364
+ return Id(Jl(e), t);
11898
12365
  }
11899
- function yd(e, t = {}) {
11900
- return _d(Jl(e), t);
12366
+ function zd(e, t = {}) {
12367
+ return Ld(Jl(e), t);
11901
12368
  }
11902
- function bd(e) {
12369
+ function Bd(e) {
11903
12370
  return Xe(e, Gl);
11904
12371
  }
11905
- function xd(e) {
12372
+ function Vd(e) {
11906
12373
  return Yl(e);
11907
12374
  }
11908
12375
  //#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, fd as diffStandards, Vu as discoverTransitive, bd as dump, wa as dumpPackage, Du as dumpPrm, hu as effectiveUses, rd as elementIndex, hd as formatDiffReport, ou as groupBySourceFile, Pu as isWellFormedMapType, gd as load, vd as loadFile, yd as loadFileWithIssues, au as loadPackage, mu as loadPackageWithIssues, su as loadPackageWithProvenance, Eu as loadPrm, _d as loadWithIssues, 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, xd as validate };
12376
+ 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primmel/primmel",
3
- "version": "1.21.10",
3
+ "version": "1.21.11",
4
4
  "description": "Primmel — parser, types, and serializer for the Primmel modelling language (successor to MMEL)",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",