@action-state-group/capsule-viewer 0.27.0 → 0.27.1
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/browser.d.ts +1 -0
- package/dist/browser.js +5 -0
- package/dist/browser.js.map +1 -1
- package/dist/deal-standalone-report.d.ts +25 -0
- package/dist/deal-standalone-report.js +272 -0
- package/dist/deal-standalone-report.js.map +1 -0
- package/dist/evidence-graph.iife.js +239 -86
- package/dist/receipt-core.generated.js +55 -7
- package/dist/receipt-core.generated.js.map +1 -1
- package/dist/receipt.js +2 -0
- package/dist/receipt.js.map +1 -1
- package/dist/viewer-build.js +1 -1
- package/package.json +1 -1
|
@@ -1344,12 +1344,12 @@ var EvidenceGraph = (() => {
|
|
|
1344
1344
|
encoders[Type.float.major] = encodeFloat;
|
|
1345
1345
|
return encoders;
|
|
1346
1346
|
}
|
|
1347
|
-
function objectToTokens(
|
|
1348
|
-
const typ = is(
|
|
1347
|
+
function objectToTokens(obj2, options = {}, refStack) {
|
|
1348
|
+
const typ = is(obj2);
|
|
1349
1349
|
const customTypeEncoder = options && options.typeEncoders && /** @type {OptionalTypeEncoder} */
|
|
1350
1350
|
options.typeEncoders[typ] || typeEncoders[typ];
|
|
1351
1351
|
if (typeof customTypeEncoder === "function") {
|
|
1352
|
-
const tokens = customTypeEncoder(
|
|
1352
|
+
const tokens = customTypeEncoder(obj2, typ, options, refStack);
|
|
1353
1353
|
if (tokens != null) {
|
|
1354
1354
|
return tokens;
|
|
1355
1355
|
}
|
|
@@ -1358,7 +1358,7 @@ var EvidenceGraph = (() => {
|
|
|
1358
1358
|
if (!typeEncoder) {
|
|
1359
1359
|
throw new Error(`${encodeErrPrefix} unsupported type: ${typ}`);
|
|
1360
1360
|
}
|
|
1361
|
-
return typeEncoder(
|
|
1361
|
+
return typeEncoder(obj2, typ, options, refStack);
|
|
1362
1362
|
}
|
|
1363
1363
|
function sortMapEntries(entries, options) {
|
|
1364
1364
|
const mapSorter2 = (
|
|
@@ -1605,18 +1605,18 @@ var EvidenceGraph = (() => {
|
|
|
1605
1605
|
* @param {object|any[]} obj
|
|
1606
1606
|
* @param {Reference|undefined} parent
|
|
1607
1607
|
*/
|
|
1608
|
-
constructor(
|
|
1609
|
-
this.obj =
|
|
1608
|
+
constructor(obj2, parent2) {
|
|
1609
|
+
this.obj = obj2;
|
|
1610
1610
|
this.parent = parent2;
|
|
1611
1611
|
}
|
|
1612
1612
|
/**
|
|
1613
1613
|
* @param {object|any[]} obj
|
|
1614
1614
|
* @returns {boolean}
|
|
1615
1615
|
*/
|
|
1616
|
-
includes(
|
|
1616
|
+
includes(obj2) {
|
|
1617
1617
|
let p = this;
|
|
1618
1618
|
do {
|
|
1619
|
-
if (p.obj ===
|
|
1619
|
+
if (p.obj === obj2) {
|
|
1620
1620
|
return true;
|
|
1621
1621
|
}
|
|
1622
1622
|
} while (p = p.parent);
|
|
@@ -1627,11 +1627,11 @@ var EvidenceGraph = (() => {
|
|
|
1627
1627
|
* @param {object|any[]} obj
|
|
1628
1628
|
* @returns {Reference}
|
|
1629
1629
|
*/
|
|
1630
|
-
static createCheck(stack,
|
|
1631
|
-
if (stack && stack.includes(
|
|
1630
|
+
static createCheck(stack, obj2) {
|
|
1631
|
+
if (stack && stack.includes(obj2)) {
|
|
1632
1632
|
throw new Error(`${encodeErrPrefix} object contains circular references`);
|
|
1633
1633
|
}
|
|
1634
|
-
return new _Ref(
|
|
1634
|
+
return new _Ref(obj2, stack);
|
|
1635
1635
|
}
|
|
1636
1636
|
};
|
|
1637
1637
|
simpleTokens = {
|
|
@@ -1650,13 +1650,13 @@ var EvidenceGraph = (() => {
|
|
|
1650
1650
|
* @param {Reference} [_refStack]
|
|
1651
1651
|
* @returns {TokenOrNestedTokens}
|
|
1652
1652
|
*/
|
|
1653
|
-
number(
|
|
1654
|
-
if (!Number.isInteger(
|
|
1655
|
-
return new Token(Type.float,
|
|
1656
|
-
} else if (
|
|
1657
|
-
return new Token(Type.uint,
|
|
1653
|
+
number(obj2, _typ, _options, _refStack) {
|
|
1654
|
+
if (!Number.isInteger(obj2) || !Number.isSafeInteger(obj2)) {
|
|
1655
|
+
return new Token(Type.float, obj2);
|
|
1656
|
+
} else if (obj2 >= 0) {
|
|
1657
|
+
return new Token(Type.uint, obj2);
|
|
1658
1658
|
} else {
|
|
1659
|
-
return new Token(Type.negint,
|
|
1659
|
+
return new Token(Type.negint, obj2);
|
|
1660
1660
|
}
|
|
1661
1661
|
},
|
|
1662
1662
|
/**
|
|
@@ -1666,11 +1666,11 @@ var EvidenceGraph = (() => {
|
|
|
1666
1666
|
* @param {Reference} [_refStack]
|
|
1667
1667
|
* @returns {TokenOrNestedTokens}
|
|
1668
1668
|
*/
|
|
1669
|
-
bigint(
|
|
1670
|
-
if (
|
|
1671
|
-
return new Token(Type.uint,
|
|
1669
|
+
bigint(obj2, _typ, _options, _refStack) {
|
|
1670
|
+
if (obj2 >= BigInt(0)) {
|
|
1671
|
+
return new Token(Type.uint, obj2);
|
|
1672
1672
|
} else {
|
|
1673
|
-
return new Token(Type.negint,
|
|
1673
|
+
return new Token(Type.negint, obj2);
|
|
1674
1674
|
}
|
|
1675
1675
|
},
|
|
1676
1676
|
/**
|
|
@@ -1680,8 +1680,8 @@ var EvidenceGraph = (() => {
|
|
|
1680
1680
|
* @param {Reference} [_refStack]
|
|
1681
1681
|
* @returns {TokenOrNestedTokens}
|
|
1682
1682
|
*/
|
|
1683
|
-
Uint8Array(
|
|
1684
|
-
return new Token(Type.bytes,
|
|
1683
|
+
Uint8Array(obj2, _typ, _options, _refStack) {
|
|
1684
|
+
return new Token(Type.bytes, obj2);
|
|
1685
1685
|
},
|
|
1686
1686
|
/**
|
|
1687
1687
|
* @param {any} obj
|
|
@@ -1690,8 +1690,8 @@ var EvidenceGraph = (() => {
|
|
|
1690
1690
|
* @param {Reference} [_refStack]
|
|
1691
1691
|
* @returns {TokenOrNestedTokens}
|
|
1692
1692
|
*/
|
|
1693
|
-
string(
|
|
1694
|
-
return new Token(Type.string,
|
|
1693
|
+
string(obj2, _typ, _options, _refStack) {
|
|
1694
|
+
return new Token(Type.string, obj2);
|
|
1695
1695
|
},
|
|
1696
1696
|
/**
|
|
1697
1697
|
* @param {any} obj
|
|
@@ -1700,8 +1700,8 @@ var EvidenceGraph = (() => {
|
|
|
1700
1700
|
* @param {Reference} [_refStack]
|
|
1701
1701
|
* @returns {TokenOrNestedTokens}
|
|
1702
1702
|
*/
|
|
1703
|
-
boolean(
|
|
1704
|
-
return
|
|
1703
|
+
boolean(obj2, _typ, _options, _refStack) {
|
|
1704
|
+
return obj2 ? simpleTokens.true : simpleTokens.false;
|
|
1705
1705
|
},
|
|
1706
1706
|
/**
|
|
1707
1707
|
* @param {any} _obj
|
|
@@ -1730,8 +1730,8 @@ var EvidenceGraph = (() => {
|
|
|
1730
1730
|
* @param {Reference} [_refStack]
|
|
1731
1731
|
* @returns {TokenOrNestedTokens}
|
|
1732
1732
|
*/
|
|
1733
|
-
ArrayBuffer(
|
|
1734
|
-
return new Token(Type.bytes, new Uint8Array(
|
|
1733
|
+
ArrayBuffer(obj2, _typ, _options, _refStack) {
|
|
1734
|
+
return new Token(Type.bytes, new Uint8Array(obj2));
|
|
1735
1735
|
},
|
|
1736
1736
|
/**
|
|
1737
1737
|
* @param {any} obj
|
|
@@ -1740,8 +1740,8 @@ var EvidenceGraph = (() => {
|
|
|
1740
1740
|
* @param {Reference} [_refStack]
|
|
1741
1741
|
* @returns {TokenOrNestedTokens}
|
|
1742
1742
|
*/
|
|
1743
|
-
DataView(
|
|
1744
|
-
return new Token(Type.bytes, new Uint8Array(
|
|
1743
|
+
DataView(obj2, _typ, _options, _refStack) {
|
|
1744
|
+
return new Token(Type.bytes, new Uint8Array(obj2.buffer, obj2.byteOffset, obj2.byteLength));
|
|
1745
1745
|
},
|
|
1746
1746
|
/**
|
|
1747
1747
|
* @param {any} obj
|
|
@@ -1750,23 +1750,23 @@ var EvidenceGraph = (() => {
|
|
|
1750
1750
|
* @param {Reference} [refStack]
|
|
1751
1751
|
* @returns {TokenOrNestedTokens}
|
|
1752
1752
|
*/
|
|
1753
|
-
Array(
|
|
1754
|
-
if (!
|
|
1753
|
+
Array(obj2, _typ, options, refStack) {
|
|
1754
|
+
if (!obj2.length) {
|
|
1755
1755
|
if (options.addBreakTokens === true) {
|
|
1756
1756
|
return [simpleTokens.emptyArray, new Token(Type.break)];
|
|
1757
1757
|
}
|
|
1758
1758
|
return simpleTokens.emptyArray;
|
|
1759
1759
|
}
|
|
1760
|
-
refStack = Ref.createCheck(refStack,
|
|
1760
|
+
refStack = Ref.createCheck(refStack, obj2);
|
|
1761
1761
|
const entries = [];
|
|
1762
1762
|
let i = 0;
|
|
1763
|
-
for (const e of
|
|
1763
|
+
for (const e of obj2) {
|
|
1764
1764
|
entries[i++] = objectToTokens(e, options, refStack);
|
|
1765
1765
|
}
|
|
1766
1766
|
if (options.addBreakTokens) {
|
|
1767
|
-
return [new Token(Type.array,
|
|
1767
|
+
return [new Token(Type.array, obj2.length), entries, new Token(Type.break)];
|
|
1768
1768
|
}
|
|
1769
|
-
return [new Token(Type.array,
|
|
1769
|
+
return [new Token(Type.array, obj2.length), entries];
|
|
1770
1770
|
},
|
|
1771
1771
|
/**
|
|
1772
1772
|
* @param {any} obj
|
|
@@ -1775,18 +1775,18 @@ var EvidenceGraph = (() => {
|
|
|
1775
1775
|
* @param {Reference} [refStack]
|
|
1776
1776
|
* @returns {TokenOrNestedTokens}
|
|
1777
1777
|
*/
|
|
1778
|
-
Object(
|
|
1778
|
+
Object(obj2, typ, options, refStack) {
|
|
1779
1779
|
const isMap = typ !== "Object";
|
|
1780
|
-
const keys = isMap ?
|
|
1781
|
-
const maxLength = isMap ?
|
|
1780
|
+
const keys = isMap ? obj2.keys() : Object.keys(obj2);
|
|
1781
|
+
const maxLength = isMap ? obj2.size : keys.length;
|
|
1782
1782
|
let entries;
|
|
1783
1783
|
if (maxLength) {
|
|
1784
1784
|
entries = new Array(maxLength);
|
|
1785
|
-
refStack = Ref.createCheck(refStack,
|
|
1785
|
+
refStack = Ref.createCheck(refStack, obj2);
|
|
1786
1786
|
const skipUndefined = !isMap && options.ignoreUndefinedProperties;
|
|
1787
1787
|
let i = 0;
|
|
1788
1788
|
for (const key of keys) {
|
|
1789
|
-
const value = isMap ?
|
|
1789
|
+
const value = isMap ? obj2.get(key) : obj2[key];
|
|
1790
1790
|
if (skipUndefined && value === void 0) {
|
|
1791
1791
|
continue;
|
|
1792
1792
|
}
|
|
@@ -1822,10 +1822,10 @@ var EvidenceGraph = (() => {
|
|
|
1822
1822
|
* @param {Reference} [refStack]
|
|
1823
1823
|
* @returns {TokenOrNestedTokens}
|
|
1824
1824
|
*/
|
|
1825
|
-
Tagged(
|
|
1825
|
+
Tagged(obj2, _typ, options, refStack) {
|
|
1826
1826
|
return [
|
|
1827
|
-
new Token(Type.tag,
|
|
1828
|
-
objectToTokens(
|
|
1827
|
+
new Token(Type.tag, obj2.tag),
|
|
1828
|
+
objectToTokens(obj2.value, options, refStack)
|
|
1829
1829
|
];
|
|
1830
1830
|
}
|
|
1831
1831
|
};
|
|
@@ -1870,7 +1870,7 @@ var EvidenceGraph = (() => {
|
|
|
1870
1870
|
function tokenToMap(token, tokeniser, options) {
|
|
1871
1871
|
const useMaps = options.useMaps === true;
|
|
1872
1872
|
const rejectDuplicateMapKeys = options.rejectDuplicateMapKeys === true;
|
|
1873
|
-
const
|
|
1873
|
+
const obj2 = useMaps ? void 0 : {};
|
|
1874
1874
|
const m = useMaps ? /* @__PURE__ */ new Map() : void 0;
|
|
1875
1875
|
for (let i = 0; i < token.value; i++) {
|
|
1876
1876
|
const key = tokensToObject(tokeniser, options);
|
|
@@ -1887,7 +1887,7 @@ var EvidenceGraph = (() => {
|
|
|
1887
1887
|
throw new Error(`${decodeErrPrefix} non-string keys not supported (got ${typeof key})`);
|
|
1888
1888
|
}
|
|
1889
1889
|
if (rejectDuplicateMapKeys) {
|
|
1890
|
-
if (useMaps && m.has(key) || !useMaps && Object.hasOwn(
|
|
1890
|
+
if (useMaps && m.has(key) || !useMaps && Object.hasOwn(obj2, key)) {
|
|
1891
1891
|
throw new Error(`${decodeErrPrefix} found repeat map key "${key}"`);
|
|
1892
1892
|
}
|
|
1893
1893
|
}
|
|
@@ -1898,12 +1898,12 @@ var EvidenceGraph = (() => {
|
|
|
1898
1898
|
if (useMaps) {
|
|
1899
1899
|
m.set(key, value);
|
|
1900
1900
|
} else if (key === "__proto__") {
|
|
1901
|
-
Object.defineProperty(
|
|
1901
|
+
Object.defineProperty(obj2, key, { value, configurable: true, enumerable: true, writable: true });
|
|
1902
1902
|
} else {
|
|
1903
|
-
|
|
1903
|
+
obj2[key] = value;
|
|
1904
1904
|
}
|
|
1905
1905
|
}
|
|
1906
|
-
return useMaps ? m :
|
|
1906
|
+
return useMaps ? m : obj2;
|
|
1907
1907
|
}
|
|
1908
1908
|
function* tokenToMapEntries(token, tokeniser, options) {
|
|
1909
1909
|
for (let i = 0; i < token.value; i++) {
|
|
@@ -5129,6 +5129,7 @@ var EvidenceGraph = (() => {
|
|
|
5129
5129
|
conversationStatus: () => conversationStatus,
|
|
5130
5130
|
createPresentationRegistry: () => createPresentationRegistry,
|
|
5131
5131
|
createSectionRegistry: () => createSectionRegistry,
|
|
5132
|
+
dealStandaloneReport: () => dealStandaloneReport,
|
|
5132
5133
|
disclosureOf: () => disclosureOf,
|
|
5133
5134
|
ed25519Available: () => ed25519Available,
|
|
5134
5135
|
historyViewHtml: () => historyViewHtml,
|
|
@@ -10742,8 +10743,8 @@ ${body}
|
|
|
10742
10743
|
const offsetMinutes = designator === void 0 || designator === "Z" || designator === "z" ? 0 : (designator.startsWith("-") ? -1 : 1) * (Number(designator.slice(1, 3)) * 60 + Number(designator.slice(4, 6)));
|
|
10743
10744
|
if (Math.abs(offsetMinutes) > 23 * 60 + 59)
|
|
10744
10745
|
return void 0;
|
|
10745
|
-
const
|
|
10746
|
-
return Math.floor(
|
|
10746
|
+
const instant2 = midnight + ((hour * 60 + minute) * 60 + second) * 1e3 - offsetMinutes * 6e4;
|
|
10747
|
+
return Math.floor(instant2 / 864e5);
|
|
10747
10748
|
};
|
|
10748
10749
|
var recordTimes = (record) => {
|
|
10749
10750
|
const sealTime = asString2(record.timestamp);
|
|
@@ -17865,13 +17866,13 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
|
|
|
17865
17866
|
}
|
|
17866
17867
|
function builtCommit() {
|
|
17867
17868
|
if (false) return void 0;
|
|
17868
|
-
return commitPrefix("
|
|
17869
|
+
return commitPrefix("3897a3681a97fd4d0ada231384d2b77d0f7e24e0");
|
|
17869
17870
|
}
|
|
17870
17871
|
var commit = builtCommit();
|
|
17871
17872
|
var unreleased = false;
|
|
17872
17873
|
var VIEWER_BUILD = {
|
|
17873
17874
|
viewer: "@action-state-group/capsule-viewer",
|
|
17874
|
-
viewerVersion: "0.27.
|
|
17875
|
+
viewerVersion: "0.27.1",
|
|
17875
17876
|
verifier: "@action-state-group/agent-action-capsule",
|
|
17876
17877
|
verifierVersion: "0.16.0",
|
|
17877
17878
|
cllVersion: "0.4.0",
|
|
@@ -26134,18 +26135,18 @@ ${key}`);
|
|
|
26134
26135
|
return block;
|
|
26135
26136
|
}
|
|
26136
26137
|
function backfillOnly(document2) {
|
|
26137
|
-
const
|
|
26138
|
-
if (!
|
|
26138
|
+
const isObj6 = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
26139
|
+
if (!isObj6(document2) || !isObj6(document2["coverage_report"])) return false;
|
|
26139
26140
|
const requirements = document2["coverage_report"]["requirements"];
|
|
26140
26141
|
if (!Array.isArray(requirements)) return false;
|
|
26141
26142
|
let records = 0;
|
|
26142
26143
|
for (const requirement of requirements) {
|
|
26143
|
-
if (!
|
|
26144
|
+
if (!isObj6(requirement)) return false;
|
|
26144
26145
|
const list2 = requirement["sources"];
|
|
26145
26146
|
if (list2 === void 0) continue;
|
|
26146
26147
|
if (!Array.isArray(list2)) return false;
|
|
26147
26148
|
for (const source of list2) {
|
|
26148
|
-
if (!
|
|
26149
|
+
if (!isObj6(source)) return false;
|
|
26149
26150
|
const { contemporaneous_count: live, backfilled_count: back } = source;
|
|
26150
26151
|
const total = source["record_count"];
|
|
26151
26152
|
if (live !== 0 || !Number.isSafeInteger(total) || total < 0 || back !== total)
|
|
@@ -26308,28 +26309,28 @@ ${pad.repeat(depth)}`;
|
|
|
26308
26309
|
var COMPLIANCE_KEY_V1 = "eu-ai-act-compliance/v1";
|
|
26309
26310
|
var COMPLIANCE_KEY_V2 = "eu-ai-act-obligations-report/v2";
|
|
26310
26311
|
function readFinding(value, key) {
|
|
26311
|
-
const
|
|
26312
|
-
const id = str2(
|
|
26313
|
-
const ownerDue = str2(
|
|
26312
|
+
const obj2 = object12(value);
|
|
26313
|
+
const id = str2(obj2?.id);
|
|
26314
|
+
const ownerDue = str2(obj2?.owner_due);
|
|
26314
26315
|
if (key === COMPLIANCE_KEY_V2) {
|
|
26315
|
-
const observed = str2(
|
|
26316
|
+
const observed = str2(obj2?.observed);
|
|
26316
26317
|
if (id === void 0 || observed === void 0 || ownerDue === void 0)
|
|
26317
26318
|
return void 0;
|
|
26318
26319
|
return { id, observed, ownerDue };
|
|
26319
26320
|
}
|
|
26320
|
-
const severity = str2(
|
|
26321
|
-
const recommendation = str2(
|
|
26321
|
+
const severity = str2(obj2?.severity);
|
|
26322
|
+
const recommendation = str2(obj2?.recommendation);
|
|
26322
26323
|
if (id === void 0 || severity === void 0 || recommendation === void 0 || ownerDue === void 0)
|
|
26323
26324
|
return void 0;
|
|
26324
26325
|
return { id, severity, recommendation, ownerDue };
|
|
26325
26326
|
}
|
|
26326
26327
|
function readRow(value, key) {
|
|
26327
|
-
const
|
|
26328
|
-
const criterionId = str2(
|
|
26329
|
-
const name = str2(
|
|
26328
|
+
const obj2 = object12(value);
|
|
26329
|
+
const criterionId = str2(obj2?.criterion_id);
|
|
26330
|
+
const name = str2(obj2?.name);
|
|
26330
26331
|
if (criterionId === void 0 || name === void 0) return void 0;
|
|
26331
|
-
const notEvaluableNote = str2(
|
|
26332
|
-
const finding =
|
|
26332
|
+
const notEvaluableNote = str2(obj2?.not_evaluable_note);
|
|
26333
|
+
const finding = obj2?.finding === void 0 ? void 0 : readFinding(obj2.finding, key);
|
|
26333
26334
|
return {
|
|
26334
26335
|
criterionId,
|
|
26335
26336
|
name,
|
|
@@ -26338,23 +26339,23 @@ ${pad.repeat(depth)}`;
|
|
|
26338
26339
|
};
|
|
26339
26340
|
}
|
|
26340
26341
|
function readApplicability(value) {
|
|
26341
|
-
const
|
|
26342
|
-
const status2 =
|
|
26343
|
-
const note = str2(
|
|
26342
|
+
const obj2 = object12(value);
|
|
26343
|
+
const status2 = obj2?.status === "in_force" || obj2?.status === "future" ? obj2.status : void 0;
|
|
26344
|
+
const note = str2(obj2?.note);
|
|
26344
26345
|
if (status2 === void 0 || note === void 0) return void 0;
|
|
26345
26346
|
return { status: status2, note };
|
|
26346
26347
|
}
|
|
26347
26348
|
function readObligation(value, extension) {
|
|
26348
|
-
const
|
|
26349
|
-
const key = str2(
|
|
26350
|
-
const article = str2(
|
|
26351
|
-
const title = str2(
|
|
26352
|
-
const plain2 = str2(
|
|
26353
|
-
const method = str2(
|
|
26354
|
-
const applicability = readApplicability(
|
|
26349
|
+
const obj2 = object12(value);
|
|
26350
|
+
const key = str2(obj2?.key);
|
|
26351
|
+
const article = str2(obj2?.article);
|
|
26352
|
+
const title = str2(obj2?.title);
|
|
26353
|
+
const plain2 = str2(obj2?.plain);
|
|
26354
|
+
const method = str2(obj2?.method);
|
|
26355
|
+
const applicability = readApplicability(obj2?.applicability);
|
|
26355
26356
|
if (key === void 0 || article === void 0 || title === void 0 || plain2 === void 0 || method === void 0 || applicability === void 0)
|
|
26356
26357
|
return void 0;
|
|
26357
|
-
const rows = Array.isArray(
|
|
26358
|
+
const rows = Array.isArray(obj2?.rows) ? obj2.rows.flatMap((r) => {
|
|
26358
26359
|
const row2 = readRow(r, extension);
|
|
26359
26360
|
return row2 === void 0 ? [] : [row2];
|
|
26360
26361
|
}) : [];
|
|
@@ -26363,18 +26364,18 @@ ${pad.repeat(depth)}`;
|
|
|
26363
26364
|
article,
|
|
26364
26365
|
title,
|
|
26365
26366
|
plain: plain2,
|
|
26366
|
-
judgedTerms: strArray(
|
|
26367
|
+
judgedTerms: strArray(obj2?.judged_terms),
|
|
26367
26368
|
applicability,
|
|
26368
26369
|
method,
|
|
26369
26370
|
rows
|
|
26370
26371
|
};
|
|
26371
26372
|
}
|
|
26372
26373
|
function readQualityProtocol(value) {
|
|
26373
|
-
const
|
|
26374
|
-
if (
|
|
26375
|
-
const protocol = str2(
|
|
26376
|
-
const cadence = str2(
|
|
26377
|
-
const note = str2(
|
|
26374
|
+
const obj2 = object12(value);
|
|
26375
|
+
if (obj2 === void 0) return void 0;
|
|
26376
|
+
const protocol = str2(obj2.protocol);
|
|
26377
|
+
const cadence = str2(obj2.cadence);
|
|
26378
|
+
const note = str2(obj2.note);
|
|
26378
26379
|
if (protocol === void 0 && cadence === void 0 && note === void 0)
|
|
26379
26380
|
return void 0;
|
|
26380
26381
|
return {
|
|
@@ -29741,6 +29742,158 @@ ${pad.repeat(depth)}`;
|
|
|
29741
29742
|
}
|
|
29742
29743
|
}
|
|
29743
29744
|
|
|
29745
|
+
// src/deal-standalone-report.ts
|
|
29746
|
+
var DEAL_V0 = "x-deal-v0";
|
|
29747
|
+
var DEAL_V1 = "x-deal-v1";
|
|
29748
|
+
var STANDALONE = "x-deal-report/v0";
|
|
29749
|
+
var POINTER = "sealed_report";
|
|
29750
|
+
var REPORT_ACTION = "capsulectl-deal-report";
|
|
29751
|
+
var STEP_TYPES = /* @__PURE__ */ new Set(["deal_step", "step_completed", "step_failed"]);
|
|
29752
|
+
var COPY_AUDIENCES = /* @__PURE__ */ new Set(["counterparty", "adjudicator", "keep"]);
|
|
29753
|
+
var isObj5 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
29754
|
+
var obj = (value) => isObj5(value) ? value : {};
|
|
29755
|
+
async function dealStandaloneReport(bundle) {
|
|
29756
|
+
const value = obj(bundle);
|
|
29757
|
+
const extensions2 = obj(value["extensions"]);
|
|
29758
|
+
if (!(STANDALONE in extensions2) || DEAL_V1 in extensions2) return null;
|
|
29759
|
+
if (!ed25519Available()) return null;
|
|
29760
|
+
return await standaloneReportHolds(value, extensions2) ? "pass" : "fail";
|
|
29761
|
+
}
|
|
29762
|
+
async function standaloneReportHolds(value, extensions2) {
|
|
29763
|
+
const section = extensions2[DEAL_V0];
|
|
29764
|
+
if (!isObj5(section) || Object.keys(section).length !== 1) return false;
|
|
29765
|
+
const id = section[POINTER];
|
|
29766
|
+
const x = extensions2[STANDALONE];
|
|
29767
|
+
if (typeof id !== "string" || !isObj5(x) || Object.keys(x).length !== 2)
|
|
29768
|
+
return false;
|
|
29769
|
+
const record = x["record"];
|
|
29770
|
+
const input = x["agent_input"];
|
|
29771
|
+
if (!isObj5(record) || !isObj5(input) || record["capsule_id"] !== id || record["action_id"] !== REPORT_ACTION)
|
|
29772
|
+
return false;
|
|
29773
|
+
const reportKey = await verifiedProducerKey(record);
|
|
29774
|
+
if (reportKey === void 0) return false;
|
|
29775
|
+
const last = await lastStepRecord(value);
|
|
29776
|
+
if (last === void 0) return false;
|
|
29777
|
+
if (await verifiedProducerKey(last) !== reportKey) return false;
|
|
29778
|
+
const capsule = {};
|
|
29779
|
+
for (const [k, v] of Object.entries(record))
|
|
29780
|
+
if (k !== "signature" && k !== "key_id") capsule[k] = v;
|
|
29781
|
+
const disclosed = await verifyDisclosureEnvelope({
|
|
29782
|
+
capsule,
|
|
29783
|
+
disclosures: { agent_input: input }
|
|
29784
|
+
});
|
|
29785
|
+
if (!disclosed.ok || disclosed.disclosuresMatched !== 1) return false;
|
|
29786
|
+
const logId = obj(value["completeness_certificate"])["log_id"];
|
|
29787
|
+
if (typeof logId !== "string" || !logId.startsWith("deal/")) return false;
|
|
29788
|
+
const audience = input["audience"];
|
|
29789
|
+
if (input["type"] !== "deal_report" || input["profile"] !== DEAL_V0 || typeof audience !== "string" || !COPY_AUDIENCES.has(audience) || input["deal_id"] !== logId.slice("deal/".length))
|
|
29790
|
+
return false;
|
|
29791
|
+
const checkpoint = obj(value["checkpoint"]);
|
|
29792
|
+
const bound = input["deal_checkpoint"];
|
|
29793
|
+
if (!isObj5(bound) || Object.keys(bound).length !== 3) return false;
|
|
29794
|
+
const boundSize = jsonUint(bound["mmr_size"]);
|
|
29795
|
+
const size = jsonUint(checkpoint["mmr_size"]);
|
|
29796
|
+
if (bound["log_id"] !== logId || boundSize === void 0 || size === void 0 || boundSize !== size || bound["root"] !== checkpoint["root"])
|
|
29797
|
+
return false;
|
|
29798
|
+
const records = Array.isArray(value["records"]) ? value["records"] : [];
|
|
29799
|
+
if (records.some((r) => obj(r)["action_id"] === REPORT_ACTION)) return false;
|
|
29800
|
+
const asOf = instant(obj(obj(input["report"])["lifecycle"])["as_of"]);
|
|
29801
|
+
const signed = instant(checkpoint["timestamp"]);
|
|
29802
|
+
return asOf !== void 0 && signed !== void 0 && asOf === signed;
|
|
29803
|
+
}
|
|
29804
|
+
async function verifiedProducerKey(record) {
|
|
29805
|
+
const id = record["capsule_id"];
|
|
29806
|
+
const signature2 = hexBytes2(record["signature"]);
|
|
29807
|
+
const key = record["key_id"];
|
|
29808
|
+
if (typeof id !== "string" || id === "" || signature2 === void 0)
|
|
29809
|
+
return void 0;
|
|
29810
|
+
if (typeof key !== "string" || hexBytes2(key) === void 0) return void 0;
|
|
29811
|
+
const result3 = await verifyProducerEnvelope(id, signature2);
|
|
29812
|
+
if (!result3.ok || result3.publicKey === void 0) return void 0;
|
|
29813
|
+
const verified = Array.from(
|
|
29814
|
+
result3.publicKey,
|
|
29815
|
+
(b) => b.toString(16).padStart(2, "0")
|
|
29816
|
+
).join("");
|
|
29817
|
+
return verified === key.toLowerCase() ? key : void 0;
|
|
29818
|
+
}
|
|
29819
|
+
async function lastStepRecord(value) {
|
|
29820
|
+
const memberships2 = obj(
|
|
29821
|
+
obj(value["completeness_certificate"])["memberships"]
|
|
29822
|
+
);
|
|
29823
|
+
const records = Array.isArray(value["records"]) ? value["records"] : [];
|
|
29824
|
+
let last;
|
|
29825
|
+
let lastSeq = 0n;
|
|
29826
|
+
for (const raw of records) {
|
|
29827
|
+
const record = obj(raw);
|
|
29828
|
+
const type = (await recordHeader(value, record))?.["record_type"];
|
|
29829
|
+
if (typeof type !== "string" || !STEP_TYPES.has(type)) continue;
|
|
29830
|
+
const id = record["capsule_id"];
|
|
29831
|
+
if (typeof id !== "string") continue;
|
|
29832
|
+
const seq = jsonUint(obj(obj(memberships2[id])["log_coordinates"])["seq"]);
|
|
29833
|
+
if (seq !== void 0 && seq > lastSeq) {
|
|
29834
|
+
last = record;
|
|
29835
|
+
lastSeq = seq;
|
|
29836
|
+
}
|
|
29837
|
+
}
|
|
29838
|
+
return last;
|
|
29839
|
+
}
|
|
29840
|
+
async function recordHeader(value, record) {
|
|
29841
|
+
const embedded = record["evidence_record_header"];
|
|
29842
|
+
if (isObj5(embedded)) return embedded;
|
|
29843
|
+
const id = record["capsule_id"];
|
|
29844
|
+
if (typeof id !== "string" || id === "") return void 0;
|
|
29845
|
+
const disclosed = obj(obj(value["disclosures"])[id])["agent_input"];
|
|
29846
|
+
if (!isObj5(disclosed)) return void 0;
|
|
29847
|
+
const capsule = {};
|
|
29848
|
+
for (const [k, v] of Object.entries(record))
|
|
29849
|
+
if (k !== "signature" && k !== "key_id") capsule[k] = v;
|
|
29850
|
+
const checked = await verifyDisclosureEnvelope({
|
|
29851
|
+
capsule,
|
|
29852
|
+
disclosures: { agent_input: disclosed }
|
|
29853
|
+
});
|
|
29854
|
+
return checked.ok && checked.disclosuresMatched === 1 ? disclosed : void 0;
|
|
29855
|
+
}
|
|
29856
|
+
function jsonUint(value) {
|
|
29857
|
+
return typeof value === "number" && Number.isSafeInteger(value) && value >= 0 && !Object.is(value, -0) ? BigInt(value) : void 0;
|
|
29858
|
+
}
|
|
29859
|
+
function hexBytes2(value) {
|
|
29860
|
+
if (typeof value !== "string" || value.length % 2 !== 0 || !/^[0-9a-fA-F]*$/u.test(value))
|
|
29861
|
+
return void 0;
|
|
29862
|
+
const out = new Uint8Array(value.length / 2);
|
|
29863
|
+
for (let i = 0; i < out.length; i++)
|
|
29864
|
+
out[i] = parseInt(value.slice(2 * i, 2 * i + 2), 16);
|
|
29865
|
+
return out;
|
|
29866
|
+
}
|
|
29867
|
+
function instant(value) {
|
|
29868
|
+
if (typeof value !== "string") return void 0;
|
|
29869
|
+
const m = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(?:(Z)|([+-])(\d{2}):(\d{2}))$/u.exec(
|
|
29870
|
+
value
|
|
29871
|
+
);
|
|
29872
|
+
if (m === null) return void 0;
|
|
29873
|
+
const [, y, mo, d, h, mi, s, frac, z, sign, oh, om] = m;
|
|
29874
|
+
const fields2 = [y, mo, d, h, mi, s].map(Number);
|
|
29875
|
+
const [year, month, day, hour, minute, second] = fields2;
|
|
29876
|
+
if (month < 1 || month > 12 || day < 1 || day > civil(year, month + 1, 0).getUTCDate() || hour > 23 || minute > 59 || second > 59)
|
|
29877
|
+
return void 0;
|
|
29878
|
+
let offset = 0;
|
|
29879
|
+
if (z === void 0) {
|
|
29880
|
+
const offHour = Number(oh);
|
|
29881
|
+
const offMinute = Number(om);
|
|
29882
|
+
if (offHour > 23 || offMinute > 59) return void 0;
|
|
29883
|
+
offset = (sign === "-" ? -1 : 1) * (offHour * 60 + offMinute) * 60;
|
|
29884
|
+
}
|
|
29885
|
+
const at = civil(year, month, day);
|
|
29886
|
+
at.setUTCHours(hour, minute, second, 0);
|
|
29887
|
+
const seconds = BigInt(at.getTime() / 1e3) - BigInt(offset);
|
|
29888
|
+
const nanos = (frac ?? "").slice(0, 9).padEnd(9, "0");
|
|
29889
|
+
return `${seconds}.${nanos}`;
|
|
29890
|
+
}
|
|
29891
|
+
function civil(year, month, day) {
|
|
29892
|
+
const at = /* @__PURE__ */ new Date(0);
|
|
29893
|
+
at.setUTCFullYear(year, month - 1, day);
|
|
29894
|
+
return at;
|
|
29895
|
+
}
|
|
29896
|
+
|
|
29744
29897
|
// src/wording/history-view.en.json
|
|
29745
29898
|
var history_view_en_default = {
|
|
29746
29899
|
wording_pack_version: "0",
|