@action-state-group/capsule-viewer 0.27.0 → 0.27.2
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-view.js +5 -0
- package/dist/evidence-graph-view.js.map +1 -1
- package/dist/evidence-graph.iife.js +291 -138
- package/dist/history-view.d.ts +1 -0
- package/dist/history-view.iife.js +10 -11
- package/dist/history-view.iife.js.sha256 +1 -1
- package/dist/history-view.js +15 -5
- package/dist/history-view.js.map +1 -1
- package/dist/receipt-core.generated.js +106 -17
- package/dist/receipt-core.generated.js.map +1 -1
- package/dist/receipt.d.ts +7 -1
- package/dist/receipt.js +27 -5
- package/dist/receipt.js.map +1 -1
- package/dist/viewer-build.js +1 -1
- package/dist/wording/history-view.en.json +5 -4
- 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);
|
|
@@ -13390,6 +13391,158 @@ ${body}
|
|
|
13390
13391
|
};
|
|
13391
13392
|
}
|
|
13392
13393
|
|
|
13394
|
+
// src/deal-standalone-report.ts
|
|
13395
|
+
var DEAL_V0 = "x-deal-v0";
|
|
13396
|
+
var DEAL_V1 = "x-deal-v1";
|
|
13397
|
+
var STANDALONE = "x-deal-report/v0";
|
|
13398
|
+
var POINTER = "sealed_report";
|
|
13399
|
+
var REPORT_ACTION = "capsulectl-deal-report";
|
|
13400
|
+
var STEP_TYPES = /* @__PURE__ */ new Set(["deal_step", "step_completed", "step_failed"]);
|
|
13401
|
+
var COPY_AUDIENCES = /* @__PURE__ */ new Set(["counterparty", "adjudicator", "keep"]);
|
|
13402
|
+
var isObj = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
13403
|
+
var obj = (value) => isObj(value) ? value : {};
|
|
13404
|
+
async function dealStandaloneReport(bundle) {
|
|
13405
|
+
const value = obj(bundle);
|
|
13406
|
+
const extensions2 = obj(value["extensions"]);
|
|
13407
|
+
if (!(STANDALONE in extensions2) || DEAL_V1 in extensions2) return null;
|
|
13408
|
+
if (!ed25519Available()) return null;
|
|
13409
|
+
return await standaloneReportHolds(value, extensions2) ? "pass" : "fail";
|
|
13410
|
+
}
|
|
13411
|
+
async function standaloneReportHolds(value, extensions2) {
|
|
13412
|
+
const section = extensions2[DEAL_V0];
|
|
13413
|
+
if (!isObj(section) || Object.keys(section).length !== 1) return false;
|
|
13414
|
+
const id = section[POINTER];
|
|
13415
|
+
const x = extensions2[STANDALONE];
|
|
13416
|
+
if (typeof id !== "string" || !isObj(x) || Object.keys(x).length !== 2)
|
|
13417
|
+
return false;
|
|
13418
|
+
const record = x["record"];
|
|
13419
|
+
const input = x["agent_input"];
|
|
13420
|
+
if (!isObj(record) || !isObj(input) || record["capsule_id"] !== id || record["action_id"] !== REPORT_ACTION)
|
|
13421
|
+
return false;
|
|
13422
|
+
const reportKey = await verifiedProducerKey(record);
|
|
13423
|
+
if (reportKey === void 0) return false;
|
|
13424
|
+
const last = await lastStepRecord(value);
|
|
13425
|
+
if (last === void 0) return false;
|
|
13426
|
+
if (await verifiedProducerKey(last) !== reportKey) return false;
|
|
13427
|
+
const capsule = {};
|
|
13428
|
+
for (const [k, v] of Object.entries(record))
|
|
13429
|
+
if (k !== "signature" && k !== "key_id") capsule[k] = v;
|
|
13430
|
+
const disclosed = await verifyDisclosureEnvelope({
|
|
13431
|
+
capsule,
|
|
13432
|
+
disclosures: { agent_input: input }
|
|
13433
|
+
});
|
|
13434
|
+
if (!disclosed.ok || disclosed.disclosuresMatched !== 1) return false;
|
|
13435
|
+
const logId = obj(value["completeness_certificate"])["log_id"];
|
|
13436
|
+
if (typeof logId !== "string" || !logId.startsWith("deal/")) return false;
|
|
13437
|
+
const audience = input["audience"];
|
|
13438
|
+
if (input["type"] !== "deal_report" || input["profile"] !== DEAL_V0 || typeof audience !== "string" || !COPY_AUDIENCES.has(audience) || input["deal_id"] !== logId.slice("deal/".length))
|
|
13439
|
+
return false;
|
|
13440
|
+
const checkpoint = obj(value["checkpoint"]);
|
|
13441
|
+
const bound = input["deal_checkpoint"];
|
|
13442
|
+
if (!isObj(bound) || Object.keys(bound).length !== 3) return false;
|
|
13443
|
+
const boundSize = jsonUint(bound["mmr_size"]);
|
|
13444
|
+
const size = jsonUint(checkpoint["mmr_size"]);
|
|
13445
|
+
if (bound["log_id"] !== logId || boundSize === void 0 || size === void 0 || boundSize !== size || bound["root"] !== checkpoint["root"])
|
|
13446
|
+
return false;
|
|
13447
|
+
const records = Array.isArray(value["records"]) ? value["records"] : [];
|
|
13448
|
+
if (records.some((r) => obj(r)["action_id"] === REPORT_ACTION)) return false;
|
|
13449
|
+
const asOf = instant(obj(obj(input["report"])["lifecycle"])["as_of"]);
|
|
13450
|
+
const signed = instant(checkpoint["timestamp"]);
|
|
13451
|
+
return asOf !== void 0 && signed !== void 0 && asOf === signed;
|
|
13452
|
+
}
|
|
13453
|
+
async function verifiedProducerKey(record) {
|
|
13454
|
+
const id = record["capsule_id"];
|
|
13455
|
+
const signature2 = hexBytes2(record["signature"]);
|
|
13456
|
+
const key = record["key_id"];
|
|
13457
|
+
if (typeof id !== "string" || id === "" || signature2 === void 0)
|
|
13458
|
+
return void 0;
|
|
13459
|
+
if (typeof key !== "string" || hexBytes2(key) === void 0) return void 0;
|
|
13460
|
+
const result3 = await verifyProducerEnvelope(id, signature2);
|
|
13461
|
+
if (!result3.ok || result3.publicKey === void 0) return void 0;
|
|
13462
|
+
const verified = Array.from(
|
|
13463
|
+
result3.publicKey,
|
|
13464
|
+
(b) => b.toString(16).padStart(2, "0")
|
|
13465
|
+
).join("");
|
|
13466
|
+
return verified === key.toLowerCase() ? key : void 0;
|
|
13467
|
+
}
|
|
13468
|
+
async function lastStepRecord(value) {
|
|
13469
|
+
const memberships2 = obj(
|
|
13470
|
+
obj(value["completeness_certificate"])["memberships"]
|
|
13471
|
+
);
|
|
13472
|
+
const records = Array.isArray(value["records"]) ? value["records"] : [];
|
|
13473
|
+
let last;
|
|
13474
|
+
let lastSeq = 0n;
|
|
13475
|
+
for (const raw of records) {
|
|
13476
|
+
const record = obj(raw);
|
|
13477
|
+
const type = (await recordHeader(value, record))?.["record_type"];
|
|
13478
|
+
if (typeof type !== "string" || !STEP_TYPES.has(type)) continue;
|
|
13479
|
+
const id = record["capsule_id"];
|
|
13480
|
+
if (typeof id !== "string") continue;
|
|
13481
|
+
const seq = jsonUint(obj(obj(memberships2[id])["log_coordinates"])["seq"]);
|
|
13482
|
+
if (seq !== void 0 && seq > lastSeq) {
|
|
13483
|
+
last = record;
|
|
13484
|
+
lastSeq = seq;
|
|
13485
|
+
}
|
|
13486
|
+
}
|
|
13487
|
+
return last;
|
|
13488
|
+
}
|
|
13489
|
+
async function recordHeader(value, record) {
|
|
13490
|
+
const embedded = record["evidence_record_header"];
|
|
13491
|
+
if (isObj(embedded)) return embedded;
|
|
13492
|
+
const id = record["capsule_id"];
|
|
13493
|
+
if (typeof id !== "string" || id === "") return void 0;
|
|
13494
|
+
const disclosed = obj(obj(value["disclosures"])[id])["agent_input"];
|
|
13495
|
+
if (!isObj(disclosed)) return void 0;
|
|
13496
|
+
const capsule = {};
|
|
13497
|
+
for (const [k, v] of Object.entries(record))
|
|
13498
|
+
if (k !== "signature" && k !== "key_id") capsule[k] = v;
|
|
13499
|
+
const checked = await verifyDisclosureEnvelope({
|
|
13500
|
+
capsule,
|
|
13501
|
+
disclosures: { agent_input: disclosed }
|
|
13502
|
+
});
|
|
13503
|
+
return checked.ok && checked.disclosuresMatched === 1 ? disclosed : void 0;
|
|
13504
|
+
}
|
|
13505
|
+
function jsonUint(value) {
|
|
13506
|
+
return typeof value === "number" && Number.isSafeInteger(value) && value >= 0 && !Object.is(value, -0) ? BigInt(value) : void 0;
|
|
13507
|
+
}
|
|
13508
|
+
function hexBytes2(value) {
|
|
13509
|
+
if (typeof value !== "string" || value.length % 2 !== 0 || !/^[0-9a-fA-F]*$/u.test(value))
|
|
13510
|
+
return void 0;
|
|
13511
|
+
const out = new Uint8Array(value.length / 2);
|
|
13512
|
+
for (let i = 0; i < out.length; i++)
|
|
13513
|
+
out[i] = parseInt(value.slice(2 * i, 2 * i + 2), 16);
|
|
13514
|
+
return out;
|
|
13515
|
+
}
|
|
13516
|
+
function instant(value) {
|
|
13517
|
+
if (typeof value !== "string") return void 0;
|
|
13518
|
+
const m = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(?:(Z)|([+-])(\d{2}):(\d{2}))$/u.exec(
|
|
13519
|
+
value
|
|
13520
|
+
);
|
|
13521
|
+
if (m === null) return void 0;
|
|
13522
|
+
const [, y, mo, d, h, mi, s, frac, z, sign, oh, om] = m;
|
|
13523
|
+
const fields2 = [y, mo, d, h, mi, s].map(Number);
|
|
13524
|
+
const [year, month, day, hour, minute, second] = fields2;
|
|
13525
|
+
if (month < 1 || month > 12 || day < 1 || day > civil(year, month + 1, 0).getUTCDate() || hour > 23 || minute > 59 || second > 59)
|
|
13526
|
+
return void 0;
|
|
13527
|
+
let offset = 0;
|
|
13528
|
+
if (z === void 0) {
|
|
13529
|
+
const offHour = Number(oh);
|
|
13530
|
+
const offMinute = Number(om);
|
|
13531
|
+
if (offHour > 23 || offMinute > 59) return void 0;
|
|
13532
|
+
offset = (sign === "-" ? -1 : 1) * (offHour * 60 + offMinute) * 60;
|
|
13533
|
+
}
|
|
13534
|
+
const at = civil(year, month, day);
|
|
13535
|
+
at.setUTCHours(hour, minute, second, 0);
|
|
13536
|
+
const seconds = BigInt(at.getTime() / 1e3) - BigInt(offset);
|
|
13537
|
+
const nanos = (frac ?? "").slice(0, 9).padEnd(9, "0");
|
|
13538
|
+
return `${seconds}.${nanos}`;
|
|
13539
|
+
}
|
|
13540
|
+
function civil(year, month, day) {
|
|
13541
|
+
const at = /* @__PURE__ */ new Date(0);
|
|
13542
|
+
at.setUTCFullYear(year, month - 1, day);
|
|
13543
|
+
return at;
|
|
13544
|
+
}
|
|
13545
|
+
|
|
13393
13546
|
// src/builtin-manifests.ts
|
|
13394
13547
|
var BUILTIN_MANIFEST_REPORT_ROWS = Object.freeze(
|
|
13395
13548
|
{
|
|
@@ -13552,7 +13705,7 @@ ${body}
|
|
|
13552
13705
|
var BUILTIN_SECTION_MANIFESTS = Object.freeze([BUILTIN_MANIFEST_COMPOSED]);
|
|
13553
13706
|
|
|
13554
13707
|
// src/chart-spec.ts
|
|
13555
|
-
var
|
|
13708
|
+
var isObj2 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
13556
13709
|
var ChartRefusal = class extends Error {
|
|
13557
13710
|
reason;
|
|
13558
13711
|
pointer;
|
|
@@ -13602,7 +13755,7 @@ ${body}
|
|
|
13602
13755
|
);
|
|
13603
13756
|
}
|
|
13604
13757
|
function readDay(value, at) {
|
|
13605
|
-
if (
|
|
13758
|
+
if (isObj2(value)) {
|
|
13606
13759
|
onlyKeys(value, ["year", "month", "date", "utc"], at);
|
|
13607
13760
|
const { year, month, date, utc } = value;
|
|
13608
13761
|
if (utc === true && Number.isInteger(year) && Number.isInteger(month) && Number.isInteger(date)) {
|
|
@@ -13618,7 +13771,7 @@ ${body}
|
|
|
13618
13771
|
);
|
|
13619
13772
|
}
|
|
13620
13773
|
function readPredicate(value, at) {
|
|
13621
|
-
need(
|
|
13774
|
+
need(isObj2(value), void 0, at, "a predicate object");
|
|
13622
13775
|
const p = value;
|
|
13623
13776
|
for (const kind of ["and", "or"])
|
|
13624
13777
|
if (Object.hasOwn(p, kind)) {
|
|
@@ -13704,7 +13857,7 @@ ${body}
|
|
|
13704
13857
|
function resolveField(header, path2) {
|
|
13705
13858
|
let at = header;
|
|
13706
13859
|
for (const name of path2.split(".")) {
|
|
13707
|
-
if (!
|
|
13860
|
+
if (!isObj2(at) || !Object.hasOwn(at, name)) return MISSING;
|
|
13708
13861
|
at = at[name];
|
|
13709
13862
|
}
|
|
13710
13863
|
return at;
|
|
@@ -13743,7 +13896,7 @@ ${body}
|
|
|
13743
13896
|
}
|
|
13744
13897
|
}
|
|
13745
13898
|
function readChannel(value, at) {
|
|
13746
|
-
need(
|
|
13899
|
+
need(isObj2(value), void 0, at, "an encoding object");
|
|
13747
13900
|
const c = value;
|
|
13748
13901
|
onlyKeys(c, ["field", "type", "aggregate", "timeUnit", "title"], at);
|
|
13749
13902
|
const type = need(
|
|
@@ -13796,7 +13949,7 @@ ${body}
|
|
|
13796
13949
|
return out;
|
|
13797
13950
|
}
|
|
13798
13951
|
function readWindow(value, at) {
|
|
13799
|
-
need(
|
|
13952
|
+
need(isObj2(value), void 0, at, "{field, from, to}");
|
|
13800
13953
|
const w = value;
|
|
13801
13954
|
onlyKeys(w, ["field", "from", "to"], at);
|
|
13802
13955
|
const field = readField(w.field, pointerOf(at, "field"));
|
|
@@ -13821,11 +13974,11 @@ ${body}
|
|
|
13821
13974
|
return { field, from, to };
|
|
13822
13975
|
}
|
|
13823
13976
|
function readStatement(value, at) {
|
|
13824
|
-
need(
|
|
13977
|
+
need(isObj2(value), void 0, at, "an object");
|
|
13825
13978
|
const s = value;
|
|
13826
13979
|
onlyKeys(s, ["population", "window", "runs", "values"], at);
|
|
13827
13980
|
const pop = s.population;
|
|
13828
|
-
need(
|
|
13981
|
+
need(isObj2(pop), void 0, pointerOf(at, "population"), "{count}");
|
|
13829
13982
|
onlyKeys(pop, ["count"], pointerOf(at, "population"));
|
|
13830
13983
|
const count2 = pop.count;
|
|
13831
13984
|
need(
|
|
@@ -13840,7 +13993,7 @@ ${body}
|
|
|
13840
13993
|
if (Object.hasOwn(s, "runs")) {
|
|
13841
13994
|
const r = s.runs;
|
|
13842
13995
|
const rat = pointerOf(at, "runs");
|
|
13843
|
-
need(
|
|
13996
|
+
need(isObj2(r), void 0, rat, "{filter, field}");
|
|
13844
13997
|
onlyKeys(r, ["filter", "field"], rat);
|
|
13845
13998
|
out.runs = {
|
|
13846
13999
|
filter: readPredicate(r.filter, pointerOf(rat, "filter")),
|
|
@@ -13856,7 +14009,7 @@ ${body}
|
|
|
13856
14009
|
);
|
|
13857
14010
|
values.forEach((v, i) => {
|
|
13858
14011
|
const vat = pointerOf(pointerOf(at, "values"), i);
|
|
13859
|
-
need(
|
|
14012
|
+
need(isObj2(v), void 0, vat, "a group object");
|
|
13860
14013
|
onlyKeys(v, [...CHANNELS, "not_run"], vat);
|
|
13861
14014
|
if (Object.hasOwn(v, "not_run"))
|
|
13862
14015
|
need(
|
|
@@ -13879,7 +14032,7 @@ ${body}
|
|
|
13879
14032
|
}
|
|
13880
14033
|
return void 0;
|
|
13881
14034
|
}
|
|
13882
|
-
if (
|
|
14035
|
+
if (isObj2(value))
|
|
13883
14036
|
for (const [k, v] of Object.entries(value)) {
|
|
13884
14037
|
const found = inexactNumber(v, pointerOf(at, k));
|
|
13885
14038
|
if (found !== void 0) return found;
|
|
@@ -13887,7 +14040,7 @@ ${body}
|
|
|
13887
14040
|
return void 0;
|
|
13888
14041
|
}
|
|
13889
14042
|
function readChartSpec(value) {
|
|
13890
|
-
need(
|
|
14043
|
+
need(isObj2(value), void 0, "", "a Vega-Lite object");
|
|
13891
14044
|
const inexact = inexactNumber(value, "");
|
|
13892
14045
|
if (inexact !== void 0)
|
|
13893
14046
|
refuse(
|
|
@@ -13912,11 +14065,11 @@ ${body}
|
|
|
13912
14065
|
);
|
|
13913
14066
|
need(spec.$schema === SCHEMA, void 0, "/$schema", SCHEMA);
|
|
13914
14067
|
const data = spec.data;
|
|
13915
|
-
need(
|
|
14068
|
+
need(isObj2(data), void 0, "/data", '{"name": "dataset"}');
|
|
13916
14069
|
onlyKeys(data, ["name"], "/data");
|
|
13917
14070
|
need(data.name === "dataset", void 0, "/data/name", '"dataset"');
|
|
13918
14071
|
let mark;
|
|
13919
|
-
if (
|
|
14072
|
+
if (isObj2(spec.mark)) {
|
|
13920
14073
|
onlyKeys(spec.mark, ["type"], "/mark");
|
|
13921
14074
|
mark = need(
|
|
13922
14075
|
MARKS.includes(spec.mark.type),
|
|
@@ -13941,7 +14094,7 @@ ${body}
|
|
|
13941
14094
|
);
|
|
13942
14095
|
spec.transform.forEach((t, i) => {
|
|
13943
14096
|
const at = pointerOf("/transform", i);
|
|
13944
|
-
need(
|
|
14097
|
+
need(isObj2(t), void 0, at, "{filter: predicate}");
|
|
13945
14098
|
onlyKeys(t, ["filter"], at);
|
|
13946
14099
|
need(
|
|
13947
14100
|
Object.hasOwn(t, "filter"),
|
|
@@ -13953,7 +14106,7 @@ ${body}
|
|
|
13953
14106
|
});
|
|
13954
14107
|
}
|
|
13955
14108
|
const encoding = spec.encoding;
|
|
13956
|
-
need(
|
|
14109
|
+
need(isObj2(encoding), void 0, "/encoding", "an object");
|
|
13957
14110
|
onlyKeys(encoding, CHANNELS, "/encoding");
|
|
13958
14111
|
const channels = {};
|
|
13959
14112
|
for (const name of CHANNELS)
|
|
@@ -13963,7 +14116,7 @@ ${body}
|
|
|
13963
14116
|
pointerOf("/encoding", name)
|
|
13964
14117
|
);
|
|
13965
14118
|
const usermeta = spec.usermeta;
|
|
13966
|
-
need(
|
|
14119
|
+
need(isObj2(usermeta), void 0, "/usermeta", "{capsule: statement}");
|
|
13967
14120
|
onlyKeys(usermeta, ["capsule"], "/usermeta");
|
|
13968
14121
|
const statement = readStatement(
|
|
13969
14122
|
usermeta.capsule,
|
|
@@ -14040,9 +14193,9 @@ ${body}
|
|
|
14040
14193
|
refuse("chart-dataset-invalid", "the dataset plan has no nodes");
|
|
14041
14194
|
const out = [];
|
|
14042
14195
|
for (const node of nodes) {
|
|
14043
|
-
if (!
|
|
14196
|
+
if (!isObj2(node) || node.operator !== "traditional.window") continue;
|
|
14044
14197
|
const p = node.params;
|
|
14045
|
-
if (!
|
|
14198
|
+
if (!isObj2(p) || typeof p.field !== "string" || !isCalendarDate(p.from) || !isCalendarDate(p.to))
|
|
14046
14199
|
refuse(
|
|
14047
14200
|
"chart-dataset-invalid",
|
|
14048
14201
|
"a window node of the dataset plan has no {field, from, to}"
|
|
@@ -14328,12 +14481,12 @@ ${body}
|
|
|
14328
14481
|
}
|
|
14329
14482
|
|
|
14330
14483
|
// src/report-view.ts
|
|
14331
|
-
var
|
|
14484
|
+
var isObj3 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
14332
14485
|
var refuse2 = (reason, message, pointer) => {
|
|
14333
14486
|
throw new ChartRefusal(reason, message, pointer);
|
|
14334
14487
|
};
|
|
14335
14488
|
var ID = /^[a-z][a-z0-9_]{0,31}$/u;
|
|
14336
|
-
var isView = (value) =>
|
|
14489
|
+
var isView = (value) => isObj3(value) && Object.hasOwn(value, "view");
|
|
14337
14490
|
var keyChannel = (chart) => chart.keys.find((k) => k !== "x");
|
|
14338
14491
|
function onlyKeys2(value, allowed, at) {
|
|
14339
14492
|
for (const key of Object.keys(value))
|
|
@@ -14347,7 +14500,7 @@ ${body}
|
|
|
14347
14500
|
var ROLES = ["activity", "judgment", "adjudication"];
|
|
14348
14501
|
var CLASSES = ["good", "bad", "open"];
|
|
14349
14502
|
function readEntry(value, at, seen, lane = false) {
|
|
14350
|
-
if (!
|
|
14503
|
+
if (!isObj3(value))
|
|
14351
14504
|
return refuse2("view-unsupported-member", `${at} must be an object`, at);
|
|
14352
14505
|
onlyKeys2(
|
|
14353
14506
|
value,
|
|
@@ -14387,7 +14540,7 @@ ${body}
|
|
|
14387
14540
|
}
|
|
14388
14541
|
if (value.classes !== void 0) {
|
|
14389
14542
|
const c = value.classes;
|
|
14390
|
-
if (!
|
|
14543
|
+
if (!isObj3(c) || Object.keys(c).length === 0)
|
|
14391
14544
|
refuse2(
|
|
14392
14545
|
"view-unsupported-member",
|
|
14393
14546
|
`${at}/classes must be a non-empty object`,
|
|
@@ -14565,7 +14718,7 @@ ${body}
|
|
|
14565
14718
|
};
|
|
14566
14719
|
}
|
|
14567
14720
|
function checkView(value, dataset) {
|
|
14568
|
-
if (!
|
|
14721
|
+
if (!isObj3(value))
|
|
14569
14722
|
return refuse2("view-unsupported-member", "a view must be an object", "");
|
|
14570
14723
|
const kind = value.view;
|
|
14571
14724
|
const checkOne = (id, spec, at) => {
|
|
@@ -14740,7 +14893,7 @@ ${body}
|
|
|
14740
14893
|
}
|
|
14741
14894
|
|
|
14742
14895
|
// src/chart-dataset.ts
|
|
14743
|
-
var
|
|
14896
|
+
var isObj4 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
14744
14897
|
var RECORD_HEADER_MEMBER = "evidence_record_header";
|
|
14745
14898
|
var DATASET_VERSION = "evidence-dataset-v0";
|
|
14746
14899
|
var HEX642 = /^[0-9a-f]{64}$/u;
|
|
@@ -14749,15 +14902,15 @@ ${body}
|
|
|
14749
14902
|
};
|
|
14750
14903
|
function digestRef(value, what) {
|
|
14751
14904
|
if (value === void 0) return void 0;
|
|
14752
|
-
if (!
|
|
14905
|
+
if (!isObj4(value) || value.digest_alg !== "SHA-256" || typeof value.digest !== "string" || !HEX642.test(value.digest))
|
|
14753
14906
|
return invalid(`${what} is not {digest_alg: "SHA-256", digest: <64-hex>}`);
|
|
14754
14907
|
return value.digest;
|
|
14755
14908
|
}
|
|
14756
14909
|
function resultDocument2(context, result3) {
|
|
14757
14910
|
const member = disclosureOf(context, result3.capsuleId, result3.member);
|
|
14758
|
-
if (member.state !== "disclosed" || !
|
|
14911
|
+
if (member.state !== "disclosed" || !isObj4(member.payload)) return void 0;
|
|
14759
14912
|
const document2 = result3.form === "book" ? member.payload.statement : member.payload;
|
|
14760
|
-
return
|
|
14913
|
+
return isObj4(document2) ? document2 : void 0;
|
|
14761
14914
|
}
|
|
14762
14915
|
async function digestOf(value) {
|
|
14763
14916
|
try {
|
|
@@ -14771,7 +14924,7 @@ ${body}
|
|
|
14771
14924
|
async function documentsByDigest(context) {
|
|
14772
14925
|
const found = /* @__PURE__ */ new Map();
|
|
14773
14926
|
const consider = async (value) => {
|
|
14774
|
-
if (!
|
|
14927
|
+
if (!isObj4(value) || value.dataset_version === void 0 && !(isObj4(value.header) && value.header.ir_version !== void 0))
|
|
14775
14928
|
return;
|
|
14776
14929
|
const digest2 = await digestOf(value);
|
|
14777
14930
|
if (digest2 !== void 0) found.set(digest2, value);
|
|
@@ -14781,10 +14934,10 @@ ${body}
|
|
|
14781
14934
|
const disclosed = disclosureOf(context, record.capsule_id, member);
|
|
14782
14935
|
if (disclosed.state !== "disclosed") continue;
|
|
14783
14936
|
await consider(disclosed.payload);
|
|
14784
|
-
if (
|
|
14937
|
+
if (isObj4(disclosed.payload)) await consider(disclosed.payload.statement);
|
|
14785
14938
|
}
|
|
14786
14939
|
const inline = record[RECORD_HEADER_MEMBER];
|
|
14787
|
-
if (
|
|
14940
|
+
if (isObj4(inline)) await consider(inline.statement);
|
|
14788
14941
|
}
|
|
14789
14942
|
return found;
|
|
14790
14943
|
}
|
|
@@ -14792,7 +14945,7 @@ ${body}
|
|
|
14792
14945
|
const found = /* @__PURE__ */ new Map();
|
|
14793
14946
|
for (const record of context.records) {
|
|
14794
14947
|
const inline = record[RECORD_HEADER_MEMBER];
|
|
14795
|
-
if (
|
|
14948
|
+
if (isObj4(inline)) {
|
|
14796
14949
|
const digest3 = await digestOf(inline);
|
|
14797
14950
|
if (digest3 !== void 0)
|
|
14798
14951
|
found.set(digest3, { header: inline, recordId: record.capsule_id });
|
|
@@ -14800,7 +14953,7 @@ ${body}
|
|
|
14800
14953
|
}
|
|
14801
14954
|
const digest2 = committedDigest(record, "agent_input");
|
|
14802
14955
|
const disclosed = disclosureOf(context, record.capsule_id, "agent_input");
|
|
14803
|
-
if (digest2 !== void 0 && disclosed.state === "disclosed" &&
|
|
14956
|
+
if (digest2 !== void 0 && disclosed.state === "disclosed" && isObj4(disclosed.payload))
|
|
14804
14957
|
found.set(digest2, {
|
|
14805
14958
|
header: disclosed.payload,
|
|
14806
14959
|
recordId: record.capsule_id
|
|
@@ -14831,7 +14984,7 @@ ${body}
|
|
|
14831
14984
|
const rows = [];
|
|
14832
14985
|
let last = -1;
|
|
14833
14986
|
for (const raw of dataset.rows) {
|
|
14834
|
-
if (!
|
|
14987
|
+
if (!isObj4(raw) || Object.keys(raw).sort().join(",") !== "digest,digest_alg,record_type,seq" || !Number.isSafeInteger(raw.seq) || raw.seq <= last || typeof raw.record_type !== "string" || raw.digest_alg !== "SHA-256" || typeof raw.digest !== "string" || !HEX642.test(raw.digest))
|
|
14835
14988
|
return invalid(
|
|
14836
14989
|
"a dataset row is not {seq, record_type, digest_alg, digest}, in seq order"
|
|
14837
14990
|
);
|
|
@@ -17215,12 +17368,12 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
|
|
|
17215
17368
|
var MAX_LABELS = 8;
|
|
17216
17369
|
var MAX_LABEL = 60;
|
|
17217
17370
|
var EXTENSION = /^x-[a-z0-9][a-z0-9._-]*$/u;
|
|
17218
|
-
var
|
|
17371
|
+
var isObj5 = (v) => v !== null && typeof v === "object" && !Array.isArray(v);
|
|
17219
17372
|
function str(value, max) {
|
|
17220
17373
|
return typeof value === "string" && value.length > 0 && value.length <= max ? value : void 0;
|
|
17221
17374
|
}
|
|
17222
17375
|
function readScope(value) {
|
|
17223
|
-
if (!
|
|
17376
|
+
if (!isObj5(value)) return void 0;
|
|
17224
17377
|
const pack = str(value.pack, 120);
|
|
17225
17378
|
const salting = str(value.salting, 60);
|
|
17226
17379
|
const saltId = str(value.salt_id, 120);
|
|
@@ -17229,7 +17382,7 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
|
|
|
17229
17382
|
return { pack, tier: value.tier, salting, saltId };
|
|
17230
17383
|
}
|
|
17231
17384
|
function readEntry2(value, grouped) {
|
|
17232
|
-
if (!
|
|
17385
|
+
if (!isObj5(value)) return void 0;
|
|
17233
17386
|
const labels = value.request_labels;
|
|
17234
17387
|
if (!Array.isArray(labels) || labels.length > MAX_LABELS || labels.some((l) => str(l, MAX_LABEL) === void 0))
|
|
17235
17388
|
return void 0;
|
|
@@ -17242,7 +17395,7 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
|
|
|
17242
17395
|
let halves;
|
|
17243
17396
|
if (value.halves !== void 0) {
|
|
17244
17397
|
const h = value.halves;
|
|
17245
|
-
if (!
|
|
17398
|
+
if (!isObj5(h) || !Number.isSafeInteger(h.present) || !Number.isSafeInteger(h.of) || h.present < 0 || h.of < 1 || h.present > h.of)
|
|
17246
17399
|
return void 0;
|
|
17247
17400
|
halves = { present: h.present, of: h.of };
|
|
17248
17401
|
}
|
|
@@ -17268,13 +17421,13 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
|
|
|
17268
17421
|
};
|
|
17269
17422
|
}
|
|
17270
17423
|
function readSubjectHistory(document2) {
|
|
17271
|
-
if (!
|
|
17424
|
+
if (!isObj5(document2)) return void 0;
|
|
17272
17425
|
const found = Object.entries(document2).filter(
|
|
17273
|
-
([key, member]) => EXTENSION.test(key) &&
|
|
17426
|
+
([key, member]) => EXTENSION.test(key) && isObj5(member) && isObj5(member.subject_history)
|
|
17274
17427
|
);
|
|
17275
17428
|
if (found.length !== 1) return void 0;
|
|
17276
17429
|
const block = found[0][1].subject_history;
|
|
17277
|
-
if (!
|
|
17430
|
+
if (!isObj5(block.conversations)) return void 0;
|
|
17278
17431
|
const scope = readScope(block.handle_scope);
|
|
17279
17432
|
const operator = scope?.tier === "operator";
|
|
17280
17433
|
const grouped = operator || scope?.tier === "shared" && scope.salting === "per-share";
|
|
@@ -17865,13 +18018,13 @@ ${s} .check .steps{margin:12px 0 0;padding-left:20px;font-size:14px;line-height:
|
|
|
17865
18018
|
}
|
|
17866
18019
|
function builtCommit() {
|
|
17867
18020
|
if (false) return void 0;
|
|
17868
|
-
return commitPrefix("
|
|
18021
|
+
return commitPrefix("c6bb35516b0733b9cd070c632bf6d7efc05c83b9");
|
|
17869
18022
|
}
|
|
17870
18023
|
var commit = builtCommit();
|
|
17871
18024
|
var unreleased = false;
|
|
17872
18025
|
var VIEWER_BUILD = {
|
|
17873
18026
|
viewer: "@action-state-group/capsule-viewer",
|
|
17874
|
-
viewerVersion: "0.27.
|
|
18027
|
+
viewerVersion: "0.27.2",
|
|
17875
18028
|
verifier: "@action-state-group/agent-action-capsule",
|
|
17876
18029
|
verifierVersion: "0.16.0",
|
|
17877
18030
|
cllVersion: "0.4.0",
|
|
@@ -26134,18 +26287,18 @@ ${key}`);
|
|
|
26134
26287
|
return block;
|
|
26135
26288
|
}
|
|
26136
26289
|
function backfillOnly(document2) {
|
|
26137
|
-
const
|
|
26138
|
-
if (!
|
|
26290
|
+
const isObj6 = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
26291
|
+
if (!isObj6(document2) || !isObj6(document2["coverage_report"])) return false;
|
|
26139
26292
|
const requirements = document2["coverage_report"]["requirements"];
|
|
26140
26293
|
if (!Array.isArray(requirements)) return false;
|
|
26141
26294
|
let records = 0;
|
|
26142
26295
|
for (const requirement of requirements) {
|
|
26143
|
-
if (!
|
|
26296
|
+
if (!isObj6(requirement)) return false;
|
|
26144
26297
|
const list2 = requirement["sources"];
|
|
26145
26298
|
if (list2 === void 0) continue;
|
|
26146
26299
|
if (!Array.isArray(list2)) return false;
|
|
26147
26300
|
for (const source of list2) {
|
|
26148
|
-
if (!
|
|
26301
|
+
if (!isObj6(source)) return false;
|
|
26149
26302
|
const { contemporaneous_count: live, backfilled_count: back } = source;
|
|
26150
26303
|
const total = source["record_count"];
|
|
26151
26304
|
if (live !== 0 || !Number.isSafeInteger(total) || total < 0 || back !== total)
|
|
@@ -26308,28 +26461,28 @@ ${pad.repeat(depth)}`;
|
|
|
26308
26461
|
var COMPLIANCE_KEY_V1 = "eu-ai-act-compliance/v1";
|
|
26309
26462
|
var COMPLIANCE_KEY_V2 = "eu-ai-act-obligations-report/v2";
|
|
26310
26463
|
function readFinding(value, key) {
|
|
26311
|
-
const
|
|
26312
|
-
const id = str2(
|
|
26313
|
-
const ownerDue = str2(
|
|
26464
|
+
const obj2 = object12(value);
|
|
26465
|
+
const id = str2(obj2?.id);
|
|
26466
|
+
const ownerDue = str2(obj2?.owner_due);
|
|
26314
26467
|
if (key === COMPLIANCE_KEY_V2) {
|
|
26315
|
-
const observed = str2(
|
|
26468
|
+
const observed = str2(obj2?.observed);
|
|
26316
26469
|
if (id === void 0 || observed === void 0 || ownerDue === void 0)
|
|
26317
26470
|
return void 0;
|
|
26318
26471
|
return { id, observed, ownerDue };
|
|
26319
26472
|
}
|
|
26320
|
-
const severity = str2(
|
|
26321
|
-
const recommendation = str2(
|
|
26473
|
+
const severity = str2(obj2?.severity);
|
|
26474
|
+
const recommendation = str2(obj2?.recommendation);
|
|
26322
26475
|
if (id === void 0 || severity === void 0 || recommendation === void 0 || ownerDue === void 0)
|
|
26323
26476
|
return void 0;
|
|
26324
26477
|
return { id, severity, recommendation, ownerDue };
|
|
26325
26478
|
}
|
|
26326
26479
|
function readRow(value, key) {
|
|
26327
|
-
const
|
|
26328
|
-
const criterionId = str2(
|
|
26329
|
-
const name = str2(
|
|
26480
|
+
const obj2 = object12(value);
|
|
26481
|
+
const criterionId = str2(obj2?.criterion_id);
|
|
26482
|
+
const name = str2(obj2?.name);
|
|
26330
26483
|
if (criterionId === void 0 || name === void 0) return void 0;
|
|
26331
|
-
const notEvaluableNote = str2(
|
|
26332
|
-
const finding =
|
|
26484
|
+
const notEvaluableNote = str2(obj2?.not_evaluable_note);
|
|
26485
|
+
const finding = obj2?.finding === void 0 ? void 0 : readFinding(obj2.finding, key);
|
|
26333
26486
|
return {
|
|
26334
26487
|
criterionId,
|
|
26335
26488
|
name,
|
|
@@ -26338,23 +26491,23 @@ ${pad.repeat(depth)}`;
|
|
|
26338
26491
|
};
|
|
26339
26492
|
}
|
|
26340
26493
|
function readApplicability(value) {
|
|
26341
|
-
const
|
|
26342
|
-
const status2 =
|
|
26343
|
-
const note = str2(
|
|
26494
|
+
const obj2 = object12(value);
|
|
26495
|
+
const status2 = obj2?.status === "in_force" || obj2?.status === "future" ? obj2.status : void 0;
|
|
26496
|
+
const note = str2(obj2?.note);
|
|
26344
26497
|
if (status2 === void 0 || note === void 0) return void 0;
|
|
26345
26498
|
return { status: status2, note };
|
|
26346
26499
|
}
|
|
26347
26500
|
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(
|
|
26501
|
+
const obj2 = object12(value);
|
|
26502
|
+
const key = str2(obj2?.key);
|
|
26503
|
+
const article = str2(obj2?.article);
|
|
26504
|
+
const title = str2(obj2?.title);
|
|
26505
|
+
const plain2 = str2(obj2?.plain);
|
|
26506
|
+
const method = str2(obj2?.method);
|
|
26507
|
+
const applicability = readApplicability(obj2?.applicability);
|
|
26355
26508
|
if (key === void 0 || article === void 0 || title === void 0 || plain2 === void 0 || method === void 0 || applicability === void 0)
|
|
26356
26509
|
return void 0;
|
|
26357
|
-
const rows = Array.isArray(
|
|
26510
|
+
const rows = Array.isArray(obj2?.rows) ? obj2.rows.flatMap((r) => {
|
|
26358
26511
|
const row2 = readRow(r, extension);
|
|
26359
26512
|
return row2 === void 0 ? [] : [row2];
|
|
26360
26513
|
}) : [];
|
|
@@ -26363,18 +26516,18 @@ ${pad.repeat(depth)}`;
|
|
|
26363
26516
|
article,
|
|
26364
26517
|
title,
|
|
26365
26518
|
plain: plain2,
|
|
26366
|
-
judgedTerms: strArray(
|
|
26519
|
+
judgedTerms: strArray(obj2?.judged_terms),
|
|
26367
26520
|
applicability,
|
|
26368
26521
|
method,
|
|
26369
26522
|
rows
|
|
26370
26523
|
};
|
|
26371
26524
|
}
|
|
26372
26525
|
function readQualityProtocol(value) {
|
|
26373
|
-
const
|
|
26374
|
-
if (
|
|
26375
|
-
const protocol = str2(
|
|
26376
|
-
const cadence = str2(
|
|
26377
|
-
const note = str2(
|
|
26526
|
+
const obj2 = object12(value);
|
|
26527
|
+
if (obj2 === void 0) return void 0;
|
|
26528
|
+
const protocol = str2(obj2.protocol);
|
|
26529
|
+
const cadence = str2(obj2.cadence);
|
|
26530
|
+
const note = str2(obj2.note);
|
|
26378
26531
|
if (protocol === void 0 && cadence === void 0 && note === void 0)
|
|
26379
26532
|
return void 0;
|
|
26380
26533
|
return {
|
|
@@ -28816,6 +28969,7 @@ ${pad.repeat(depth)}`;
|
|
|
28816
28969
|
return "unreadable";
|
|
28817
28970
|
}
|
|
28818
28971
|
const context = await buildVerifiedBundleContext(bundle);
|
|
28972
|
+
if (await dealStandaloneReport(bundle) === "fail") return "unverified";
|
|
28819
28973
|
const registry = options.registry ?? defaultRegistry;
|
|
28820
28974
|
const resolution = await registry.resolve(
|
|
28821
28975
|
context,
|
|
@@ -29793,8 +29947,8 @@ ${pad.repeat(depth)}`;
|
|
|
29793
29947
|
"hero.unreadable": "This page could not read the answer, so it shows none of it.",
|
|
29794
29948
|
"hero.deals.one": "{n} deal, newest first",
|
|
29795
29949
|
"hero.deals.other": "{n} deals, newest first",
|
|
29796
|
-
"hero.deals.picked.one": "1 deal {name} picked \xB7
|
|
29797
|
-
"hero.deals.picked.other": "{n} deals {name} picked \xB7
|
|
29950
|
+
"hero.deals.picked.one": "1 deal {name} picked \xB7 this side's record, not confirmed outcomes",
|
|
29951
|
+
"hero.deals.picked.other": "{n} deals {name} picked \xB7 this side's record, not confirmed outcomes",
|
|
29798
29952
|
"hero.none.deals": "There are no deals in this store yet.",
|
|
29799
29953
|
"chip.signatures.pass": "Checkpoint signatures check",
|
|
29800
29954
|
"chip.signatures.pass.all": "Every signature checks",
|
|
@@ -29835,8 +29989,9 @@ ${pad.repeat(depth)}`;
|
|
|
29835
29989
|
"callout.heading": "What this does not show",
|
|
29836
29990
|
"callout.checkpoints": "These checkpoints show when this node's log was cut and how much it holds. They don't show what any exchange said or how it went, and this is not a judgment of the node.",
|
|
29837
29991
|
"callout.checkpoints.time": "The exact time of each exchange. Checkpoint times are rounded to the minute, and each side of an exchange gets its own checkpoint, so two can share a time.",
|
|
29838
|
-
"callout.deals": "
|
|
29839
|
-
"callout.deals.
|
|
29992
|
+
"callout.deals": "Each deal's outcome here is what this side recorded, not a confirmed outcome.",
|
|
29993
|
+
"callout.deals.named": "Each deal's outcome here is what {name} recorded, not a confirmed outcome.",
|
|
29994
|
+
"callout.deals.picked": "{name} picked these; it isn't every deal. Each outcome is what {name}'s side recorded, not a confirmed outcome.",
|
|
29840
29995
|
"shares.heading": "What this node shares",
|
|
29841
29996
|
"shares.summary": "With anyone who asks: a summary of its checkpoints, meaning how much it has recorded and when, and nothing about any exchange.",
|
|
29842
29997
|
"shares.standard.on": "With anyone: the Service History.",
|
|
@@ -30429,6 +30584,8 @@ ${pad.repeat(depth)}`;
|
|
|
30429
30584
|
r.refuse(`${path2}.id`, "is listed twice");
|
|
30430
30585
|
if (id && status2) checks.push({ id, status: status2, unregistered });
|
|
30431
30586
|
});
|
|
30587
|
+
if (kind === "deal" && !checks.some((x) => x.id === "deal_report"))
|
|
30588
|
+
checks.push({ id: "deal_report", status: "not_run" });
|
|
30432
30589
|
} else r.refuse("input.checks", "is not a list");
|
|
30433
30590
|
const periods = [];
|
|
30434
30591
|
if ("periods" in o) {
|
|
@@ -30591,6 +30748,7 @@ ${pad.repeat(depth)}`;
|
|
|
30591
30748
|
const witnessFailed = statusOf("witness") === "fail";
|
|
30592
30749
|
const secondFailed = statusOf("second_signature") === "fail";
|
|
30593
30750
|
const lockChecked = kind === "checkpoint" ? statusOf("checkpoint_signatures") === "pass" && statusOf("checkpoint_chain") === "pass" && statusOf("consistency") === "pass" : dealRecorded;
|
|
30751
|
+
const personTitle = kind !== "checkpoint" && reader !== "owner" && audienceKind !== "shared";
|
|
30594
30752
|
let title;
|
|
30595
30753
|
if (kind === "checkpoint")
|
|
30596
30754
|
title = stream !== void 0 ? say("header.title.stream", { node: short2(node ?? ""), stream }) : say("header.title.node", { node: short2(node ?? "") });
|
|
@@ -30778,12 +30936,7 @@ ${pad.repeat(depth)}`;
|
|
|
30778
30936
|
el13(
|
|
30779
30937
|
"ul",
|
|
30780
30938
|
{ class: "cvh-stamps" },
|
|
30781
|
-
dealRecorded ? stamp("stamp.recorded", true, "passed", null) :
|
|
30782
|
-
"stamp.recorded",
|
|
30783
|
-
false,
|
|
30784
|
-
"not_checked",
|
|
30785
|
-
say("slot.unchecked")
|
|
30786
|
-
),
|
|
30939
|
+
dealRecorded ? stamp("stamp.recorded", true, "passed", null) : null,
|
|
30787
30940
|
...slotStamps(x)
|
|
30788
30941
|
)
|
|
30789
30942
|
);
|
|
@@ -30842,7 +30995,7 @@ ${pad.repeat(depth)}`;
|
|
|
30842
30995
|
el13(
|
|
30843
30996
|
"p",
|
|
30844
30997
|
null,
|
|
30845
|
-
kind === "checkpoint" ? say("callout.checkpoints") : picked ? say("callout.deals.picked", { name: name ?? "" }) : say("callout.deals")
|
|
30998
|
+
kind === "checkpoint" ? say("callout.checkpoints") : picked ? say("callout.deals.picked", { name: name ?? "" }) : personTitle ? say("callout.deals.named", { name: name ?? "" }) : say("callout.deals")
|
|
30846
30999
|
),
|
|
30847
31000
|
kind === "checkpoint" && rows.length > 0 ? el13("p", null, say("callout.checkpoints.time")) : null
|
|
30848
31001
|
) : null;
|