@veraanchor/verifier 0.0.0-stage → 0.1.0
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/CHANGELOG.md +22 -0
- package/CONTRIBUTING.md +33 -0
- package/LICENSE +21 -0
- package/NOTICE +4 -0
- package/README.md +263 -2
- package/SECURITY.md +21 -0
- package/dist/cli/commandV1.d.ts +5 -0
- package/dist/cli/commandV1.d.ts.map +1 -0
- package/dist/cli/commandV1.js +440 -0
- package/dist/cli/commandV1.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +5 -0
- package/dist/cli.js.map +1 -0
- package/dist/contracts/verification.d.ts +77 -0
- package/dist/contracts/verification.d.ts.map +1 -0
- package/dist/contracts/verification.js +6 -0
- package/dist/contracts/verification.js.map +1 -0
- package/dist/crypto/sha3.d.ts +15 -0
- package/dist/crypto/sha3.d.ts.map +1 -0
- package/dist/crypto/sha3.js +27 -0
- package/dist/crypto/sha3.js.map +1 -0
- package/dist/crypto/streamSha3.d.ts +26 -0
- package/dist/crypto/streamSha3.d.ts.map +1 -0
- package/dist/crypto/streamSha3.js +52 -0
- package/dist/crypto/streamSha3.js.map +1 -0
- package/dist/hf/hashContractV1.d.ts +48 -0
- package/dist/hf/hashContractV1.d.ts.map +1 -0
- package/dist/hf/hashContractV1.js +185 -0
- package/dist/hf/hashContractV1.js.map +1 -0
- package/dist/index.d.ts +80 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +57 -0
- package/dist/index.js.map +1 -0
- package/dist/merkle/membership.d.ts +30 -0
- package/dist/merkle/membership.d.ts.map +1 -0
- package/dist/merkle/membership.js +105 -0
- package/dist/merkle/membership.js.map +1 -0
- package/dist/policy/contractV1.d.ts +37 -0
- package/dist/policy/contractV1.d.ts.map +1 -0
- package/dist/policy/contractV1.js +2 -0
- package/dist/policy/contractV1.js.map +1 -0
- package/dist/policy/evaluateV1.d.ts +24 -0
- package/dist/policy/evaluateV1.d.ts.map +1 -0
- package/dist/policy/evaluateV1.js +320 -0
- package/dist/policy/evaluateV1.js.map +1 -0
- package/dist/profiles/dataset/sourceV1.d.ts +22 -0
- package/dist/profiles/dataset/sourceV1.d.ts.map +1 -0
- package/dist/profiles/dataset/sourceV1.js +73 -0
- package/dist/profiles/dataset/sourceV1.js.map +1 -0
- package/dist/profiles/dataset/v1.d.ts +39 -0
- package/dist/profiles/dataset/v1.d.ts.map +1 -0
- package/dist/profiles/dataset/v1.js +362 -0
- package/dist/profiles/dataset/v1.js.map +1 -0
- package/dist/profiles/execution/contractV1.d.ts +279 -0
- package/dist/profiles/execution/contractV1.d.ts.map +1 -0
- package/dist/profiles/execution/contractV1.js +364 -0
- package/dist/profiles/execution/contractV1.js.map +1 -0
- package/dist/profiles/execution/independentStandardsV1.d.ts +44 -0
- package/dist/profiles/execution/independentStandardsV1.d.ts.map +1 -0
- package/dist/profiles/execution/independentStandardsV1.js +336 -0
- package/dist/profiles/execution/independentStandardsV1.js.map +1 -0
- package/dist/profiles/execution/reasonCodesV1.d.ts +30 -0
- package/dist/profiles/execution/reasonCodesV1.d.ts.map +1 -0
- package/dist/profiles/execution/reasonCodesV1.js +20 -0
- package/dist/profiles/execution/reasonCodesV1.js.map +1 -0
- package/dist/profiles/execution/recomputationV1.d.ts +11 -0
- package/dist/profiles/execution/recomputationV1.d.ts.map +1 -0
- package/dist/profiles/execution/recomputationV1.js +144 -0
- package/dist/profiles/execution/recomputationV1.js.map +1 -0
- package/dist/profiles/execution/rulesV1.d.ts +6 -0
- package/dist/profiles/execution/rulesV1.d.ts.map +1 -0
- package/dist/profiles/execution/rulesV1.js +855 -0
- package/dist/profiles/execution/rulesV1.js.map +1 -0
- package/dist/profiles/execution/standardsPlanV1.d.ts +18 -0
- package/dist/profiles/execution/standardsPlanV1.d.ts.map +1 -0
- package/dist/profiles/execution/standardsPlanV1.js +16 -0
- package/dist/profiles/execution/standardsPlanV1.js.map +1 -0
- package/dist/profiles/execution/verificationV1.d.ts +28 -0
- package/dist/profiles/execution/verificationV1.d.ts.map +1 -0
- package/dist/profiles/execution/verificationV1.js +188 -0
- package/dist/profiles/execution/verificationV1.js.map +1 -0
- package/dist/profiles/ingest/sourceV1.d.ts +36 -0
- package/dist/profiles/ingest/sourceV1.d.ts.map +1 -0
- package/dist/profiles/ingest/sourceV1.js +99 -0
- package/dist/profiles/ingest/sourceV1.js.map +1 -0
- package/dist/profiles/ingest/v1.d.ts +65 -0
- package/dist/profiles/ingest/v1.d.ts.map +1 -0
- package/dist/profiles/ingest/v1.js +477 -0
- package/dist/profiles/ingest/v1.js.map +1 -0
- package/dist/profiles/sourceV1Helpers.d.ts +48 -0
- package/dist/profiles/sourceV1Helpers.d.ts.map +1 -0
- package/dist/profiles/sourceV1Helpers.js +141 -0
- package/dist/profiles/sourceV1Helpers.js.map +1 -0
- package/dist/reports/coreV1.d.ts +7 -0
- package/dist/reports/coreV1.d.ts.map +1 -0
- package/dist/reports/coreV1.js +195 -0
- package/dist/reports/coreV1.js.map +1 -0
- package/dist/reports/portableV1.d.ts +48 -0
- package/dist/reports/portableV1.d.ts.map +1 -0
- package/dist/reports/portableV1.js +279 -0
- package/dist/reports/portableV1.js.map +1 -0
- package/dist/reports/validationV1.d.ts +19 -0
- package/dist/reports/validationV1.d.ts.map +1 -0
- package/dist/reports/validationV1.js +441 -0
- package/dist/reports/validationV1.js.map +1 -0
- package/dist/resolvers/executionMirrorV1.d.ts +15 -0
- package/dist/resolvers/executionMirrorV1.d.ts.map +1 -0
- package/dist/resolvers/executionMirrorV1.js +206 -0
- package/dist/resolvers/executionMirrorV1.js.map +1 -0
- package/dist/resolvers/explorerExecutionV1.d.ts +17 -0
- package/dist/resolvers/explorerExecutionV1.d.ts.map +1 -0
- package/dist/resolvers/explorerExecutionV1.js +61 -0
- package/dist/resolvers/explorerExecutionV1.js.map +1 -0
- package/dist/resolvers/explorerPublicV1.d.ts +37 -0
- package/dist/resolvers/explorerPublicV1.d.ts.map +1 -0
- package/dist/resolvers/explorerPublicV1.js +210 -0
- package/dist/resolvers/explorerPublicV1.js.map +1 -0
- package/dist/resolvers/explorerPublicationV1.d.ts +20 -0
- package/dist/resolvers/explorerPublicationV1.d.ts.map +1 -0
- package/dist/resolvers/explorerPublicationV1.js +195 -0
- package/dist/resolvers/explorerPublicationV1.js.map +1 -0
- package/dist/resolvers/explorerTransportV1.d.ts +17 -0
- package/dist/resolvers/explorerTransportV1.d.ts.map +1 -0
- package/dist/resolvers/explorerTransportV1.js +112 -0
- package/dist/resolvers/explorerTransportV1.js.map +1 -0
- package/dist/resolvers/hcs11MirrorV1.d.ts +49 -0
- package/dist/resolvers/hcs11MirrorV1.d.ts.map +1 -0
- package/dist/resolvers/hcs11MirrorV1.js +293 -0
- package/dist/resolvers/hcs11MirrorV1.js.map +1 -0
- package/dist/resolvers/hcs13MirrorV1.d.ts +35 -0
- package/dist/resolvers/hcs13MirrorV1.d.ts.map +1 -0
- package/dist/resolvers/hcs13MirrorV1.js +72 -0
- package/dist/resolvers/hcs13MirrorV1.js.map +1 -0
- package/dist/resolvers/hcs1MirrorV1.d.ts +28 -0
- package/dist/resolvers/hcs1MirrorV1.d.ts.map +1 -0
- package/dist/resolvers/hcs1MirrorV1.js +220 -0
- package/dist/resolvers/hcs1MirrorV1.js.map +1 -0
- package/dist/resolvers/hcs26MirrorV1.d.ts +67 -0
- package/dist/resolvers/hcs26MirrorV1.d.ts.map +1 -0
- package/dist/resolvers/hcs26MirrorV1.js +218 -0
- package/dist/resolvers/hcs26MirrorV1.js.map +1 -0
- package/dist/resolvers/hcs26RegistryMirrorV1.d.ts +26 -0
- package/dist/resolvers/hcs26RegistryMirrorV1.d.ts.map +1 -0
- package/dist/resolvers/hcs26RegistryMirrorV1.js +200 -0
- package/dist/resolvers/hcs26RegistryMirrorV1.js.map +1 -0
- package/dist/resolvers/hcs2MirrorV1.d.ts +26 -0
- package/dist/resolvers/hcs2MirrorV1.d.ts.map +1 -0
- package/dist/resolvers/hcs2MirrorV1.js +196 -0
- package/dist/resolvers/hcs2MirrorV1.js.map +1 -0
- package/dist/resolvers/hederaMirrorV1.d.ts +22 -0
- package/dist/resolvers/hederaMirrorV1.d.ts.map +1 -0
- package/dist/resolvers/hederaMirrorV1.js +338 -0
- package/dist/resolvers/hederaMirrorV1.js.map +1 -0
- package/dist/standards/hcs/hcs11V1.d.ts +51 -0
- package/dist/standards/hcs/hcs11V1.d.ts.map +1 -0
- package/dist/standards/hcs/hcs11V1.js +289 -0
- package/dist/standards/hcs/hcs11V1.js.map +1 -0
- package/dist/standards/hcs/hcs13V1.d.ts +39 -0
- package/dist/standards/hcs/hcs13V1.d.ts.map +1 -0
- package/dist/standards/hcs/hcs13V1.js +114 -0
- package/dist/standards/hcs/hcs13V1.js.map +1 -0
- package/dist/standards/hcs/hcs14V1.d.ts +35 -0
- package/dist/standards/hcs/hcs14V1.d.ts.map +1 -0
- package/dist/standards/hcs/hcs14V1.js +168 -0
- package/dist/standards/hcs/hcs14V1.js.map +1 -0
- package/dist/standards/hcs/hcs1V1.d.ts +30 -0
- package/dist/standards/hcs/hcs1V1.d.ts.map +1 -0
- package/dist/standards/hcs/hcs1V1.js +140 -0
- package/dist/standards/hcs/hcs1V1.js.map +1 -0
- package/dist/standards/hcs/hcs26V1.d.ts +58 -0
- package/dist/standards/hcs/hcs26V1.d.ts.map +1 -0
- package/dist/standards/hcs/hcs26V1.js +339 -0
- package/dist/standards/hcs/hcs26V1.js.map +1 -0
- package/dist/standards/hcs/hcs2V1.d.ts +36 -0
- package/dist/standards/hcs/hcs2V1.d.ts.map +1 -0
- package/dist/standards/hcs/hcs2V1.js +181 -0
- package/dist/standards/hcs/hcs2V1.js.map +1 -0
- package/dist/standards/hcs/jsonCanonicalV1.d.ts +15 -0
- package/dist/standards/hcs/jsonCanonicalV1.d.ts.map +1 -0
- package/dist/standards/hcs/jsonCanonicalV1.js +160 -0
- package/dist/standards/hcs/jsonCanonicalV1.js.map +1 -0
- package/dist/triangulation/compareV1.d.ts +50 -0
- package/dist/triangulation/compareV1.d.ts.map +1 -0
- package/dist/triangulation/compareV1.js +236 -0
- package/dist/triangulation/compareV1.js.map +1 -0
- package/dist/triangulation/executionPlanV1.d.ts +39 -0
- package/dist/triangulation/executionPlanV1.d.ts.map +1 -0
- package/dist/triangulation/executionPlanV1.js +208 -0
- package/dist/triangulation/executionPlanV1.js.map +1 -0
- package/dist/triangulation/executionPublicV1.d.ts +22 -0
- package/dist/triangulation/executionPublicV1.d.ts.map +1 -0
- package/dist/triangulation/executionPublicV1.js +39 -0
- package/dist/triangulation/executionPublicV1.js.map +1 -0
- package/dist/triangulation/messageObservationV1.d.ts +26 -0
- package/dist/triangulation/messageObservationV1.d.ts.map +1 -0
- package/dist/triangulation/messageObservationV1.js +69 -0
- package/dist/triangulation/messageObservationV1.js.map +1 -0
- package/dist/triangulation/publicV1.d.ts +29 -0
- package/dist/triangulation/publicV1.d.ts.map +1 -0
- package/dist/triangulation/publicV1.js +170 -0
- package/dist/triangulation/publicV1.js.map +1 -0
- package/dist/verification/sourceIntentV1.d.ts +15 -0
- package/dist/verification/sourceIntentV1.d.ts.map +1 -0
- package/dist/verification/sourceIntentV1.js +206 -0
- package/dist/verification/sourceIntentV1.js.map +1 -0
- package/docs/cli-v0.1.md +237 -0
- package/docs/conformance.md +38 -0
- package/docs/threat-model.md +37 -0
- package/docs/verification-semantics.md +65 -0
- package/examples/README.md +35 -0
- package/examples/dataset-offline.mjs +58 -0
- package/examples/dataset-policy.mjs +59 -0
- package/package.json +65 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sha3.js","sourceRoot":"","sources":["../../src/crypto/sha3.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,MAAM,SAAS,GAAG,kBAAkB,CAAC;AASrC,MAAM,UAAU,uBAAuB,CAAC,KAAc;IACpD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACxD,MAAM,IAAI,SAAS,CAAC,yDAAyD,CAAC,CAAC;IACjF,CAAC;IACD,OAAO,KAAK,CAAC,WAAW,EAAE,CAAC;AAC7B,CAAC;AAED,6EAA6E;AAC7E,MAAM,UAAU,WAAW,CAAC,KAAiB;IAC3C,IAAI,CAAC,CAAC,KAAK,YAAY,UAAU,CAAC,EAAE,CAAC;QACnC,MAAM,IAAI,SAAS,CAAC,mCAAmC,CAAC,CAAC;IAC3D,CAAC;IACD,OAAO,UAAU,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC5D,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,KAGlC;IACA,MAAM,QAAQ,GAAG,uBAAuB,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;IAChE,MAAM,QAAQ,GAAG,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC1C,MAAM,OAAO,GAAG,QAAQ,KAAK,QAAQ,CAAC;IACtC,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;QAClC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,iBAAiB;QAC/C,eAAe,EAAE,QAAQ;QACzB,eAAe,EAAE,QAAQ;KAC1B,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type DigestVerificationResult } from "./sha3.js";
|
|
2
|
+
/** Byte chunks from a caller-owned source (including Node readable streams). */
|
|
3
|
+
export type ByteChunkSource = Iterable<Uint8Array> | AsyncIterable<Uint8Array>;
|
|
4
|
+
export type Sha3_512StreamHashResult = Readonly<{
|
|
5
|
+
digest: string;
|
|
6
|
+
bytes_hashed: number;
|
|
7
|
+
}>;
|
|
8
|
+
export type Sha3_512StreamVerificationResult = DigestVerificationResult & Readonly<{
|
|
9
|
+
bytes_hashed: number;
|
|
10
|
+
}>;
|
|
11
|
+
/**
|
|
12
|
+
* SHA3-512 over the exact byte stream, with constant auxiliary memory.
|
|
13
|
+
* No canonicalization, framing, filesystem access, or network requests.
|
|
14
|
+
* The source owns chunk buffering and cancellation.
|
|
15
|
+
*/
|
|
16
|
+
export declare function sha3_512Stream(source: ByteChunkSource, options?: Readonly<{
|
|
17
|
+
max_bytes?: number;
|
|
18
|
+
}>): Promise<Sha3_512StreamHashResult>;
|
|
19
|
+
/** Verify a stream against an independently supplied SHA3-512 commitment. */
|
|
20
|
+
export declare function verifySha3_512Stream(input: Readonly<{
|
|
21
|
+
source: ByteChunkSource;
|
|
22
|
+
expected_digest: string;
|
|
23
|
+
expected_bytes?: number;
|
|
24
|
+
max_bytes?: number;
|
|
25
|
+
}>): Promise<Sha3_512StreamVerificationResult>;
|
|
26
|
+
//# sourceMappingURL=streamSha3.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"streamSha3.d.ts","sourceRoot":"","sources":["../../src/crypto/streamSha3.ts"],"names":[],"mappings":"AACA,OAAO,EAA2B,KAAK,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAEnF,gFAAgF;AAChF,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC,UAAU,CAAC,GAAG,aAAa,CAAC,UAAU,CAAC,CAAC;AAE/E,MAAM,MAAM,wBAAwB,GAAG,QAAQ,CAAC;IAC9C,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC,CAAC;AAEH,MAAM,MAAM,gCAAgC,GAAG,wBAAwB,GACrE,QAAQ,CAAC;IAAE,YAAY,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AASrC;;;;GAIG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,eAAe,EACvB,OAAO,GAAE,QAAQ,CAAC;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAM,GAC7C,OAAO,CAAC,wBAAwB,CAAC,CAoBnC;AAED,6EAA6E;AAC7E,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,QAAQ,CAAC;IACd,MAAM,EAAE,eAAe,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC,GACD,OAAO,CAAC,gCAAgC,CAAC,CAwB3C"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { normalizeSha3_512Digest } from "./sha3.js";
|
|
3
|
+
function safeByteCount(value, name) {
|
|
4
|
+
if (!Number.isSafeInteger(value) || value < 0) {
|
|
5
|
+
throw new TypeError(`${name} must be a non-negative safe integer`);
|
|
6
|
+
}
|
|
7
|
+
return value;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* SHA3-512 over the exact byte stream, with constant auxiliary memory.
|
|
11
|
+
* No canonicalization, framing, filesystem access, or network requests.
|
|
12
|
+
* The source owns chunk buffering and cancellation.
|
|
13
|
+
*/
|
|
14
|
+
export async function sha3_512Stream(source, options = {}) {
|
|
15
|
+
const maxBytes = options.max_bytes === undefined
|
|
16
|
+
? Number.MAX_SAFE_INTEGER
|
|
17
|
+
: safeByteCount(options.max_bytes, "max_bytes");
|
|
18
|
+
const hash = createHash("sha3-512");
|
|
19
|
+
let bytesHashed = 0;
|
|
20
|
+
for await (const chunk of source) {
|
|
21
|
+
if (!(chunk instanceof Uint8Array)) {
|
|
22
|
+
throw new TypeError("SHA3-512 stream chunks must be Uint8Array");
|
|
23
|
+
}
|
|
24
|
+
if (chunk.byteLength > maxBytes - bytesHashed) {
|
|
25
|
+
throw new RangeError("SHA3-512 stream exceeds max_bytes");
|
|
26
|
+
}
|
|
27
|
+
hash.update(chunk);
|
|
28
|
+
bytesHashed += chunk.byteLength;
|
|
29
|
+
}
|
|
30
|
+
return Object.freeze({ digest: hash.digest("hex"), bytes_hashed: bytesHashed });
|
|
31
|
+
}
|
|
32
|
+
/** Verify a stream against an independently supplied SHA3-512 commitment. */
|
|
33
|
+
export async function verifySha3_512Stream(input) {
|
|
34
|
+
const expected = normalizeSha3_512Digest(input.expected_digest);
|
|
35
|
+
const expectedBytes = input.expected_bytes === undefined
|
|
36
|
+
? undefined
|
|
37
|
+
: safeByteCount(input.expected_bytes, "expected_bytes");
|
|
38
|
+
const { digest, bytes_hashed } = await sha3_512Stream(input.source, input.max_bytes === undefined ? undefined : { max_bytes: input.max_bytes });
|
|
39
|
+
const reasonCode = digest !== expected
|
|
40
|
+
? "DIGEST_MISMATCH"
|
|
41
|
+
: expectedBytes !== undefined && bytes_hashed !== expectedBytes
|
|
42
|
+
? "BYTE_COUNT_MISMATCH"
|
|
43
|
+
: null;
|
|
44
|
+
return Object.freeze({
|
|
45
|
+
outcome: reasonCode === null ? "pass" : "fail",
|
|
46
|
+
reason_code: reasonCode,
|
|
47
|
+
expected_digest: expected,
|
|
48
|
+
computed_digest: digest,
|
|
49
|
+
bytes_hashed,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=streamSha3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"streamSha3.js","sourceRoot":"","sources":["../../src/crypto/streamSha3.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,uBAAuB,EAAiC,MAAM,WAAW,CAAC;AAanF,SAAS,aAAa,CAAC,KAAc,EAAE,IAAY;IACjD,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,IAAK,KAAgB,GAAG,CAAC,EAAE,CAAC;QAC1D,MAAM,IAAI,SAAS,CAAC,GAAG,IAAI,sCAAsC,CAAC,CAAC;IACrE,CAAC;IACD,OAAO,KAAe,CAAC;A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Y,EAAE,GAAG,MAAM,cAAc,CACnD,KAAK,CAAC,MAAM,EACZ,KAAK,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,CAC3E,CAAC;IACF,MAAM,UAAU,GACd,MAAM,KAAK,QAAQ;QACjB,CAAC,CAAC,iBAAiB;QACnB,CAAC,CAAC,aAAa,KAAK,SAAS,IAAI,YAAY,KAAK,aAAa;YAC7D,CAAC,CAAC,qBAAqB;YACvB,CAAC,CAAC,IAAI,CAAC;IAEb,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,OAAO,EAAE,UAAU,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;QAC9C,WAAW,EAAE,UAAU;QACvB,eAAe,EAAE,QAAQ;QACzB,eAAe,EAAE,MAAM;QACvB,YAAY;KACb,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { ExpectedCommitment, VerificationOutcome } from "../contracts/verification.js";
|
|
2
|
+
/** HF v1 hashing is distinct from Core's unframed canonical-object hashes. */
|
|
3
|
+
export declare const HF_V1_CONTRACT_ID: "hf-contract-v1";
|
|
4
|
+
export declare const HF_V1_FRAME_ID: "hf:frame:v1";
|
|
5
|
+
export declare const HF_V1_CANONICAL_JSON_ID: "hf:canonical-json:v1";
|
|
6
|
+
export declare const MAX_HF_V1_PAYLOAD_BYTES: number;
|
|
7
|
+
type JsonMaterial = Readonly<{
|
|
8
|
+
material: "json";
|
|
9
|
+
value: unknown;
|
|
10
|
+
}>;
|
|
11
|
+
type RawMaterial = Readonly<{
|
|
12
|
+
material: "raw";
|
|
13
|
+
bytes: Uint8Array;
|
|
14
|
+
}>;
|
|
15
|
+
type Utf8Material = Readonly<{
|
|
16
|
+
material: "utf8";
|
|
17
|
+
text: string;
|
|
18
|
+
}>;
|
|
19
|
+
export type HfV1Material = JsonMaterial | RawMaterial | Utf8Material;
|
|
20
|
+
export type HfV1HashInput = HfV1Material & Readonly<{
|
|
21
|
+
domain: string;
|
|
22
|
+
}>;
|
|
23
|
+
export type HfV1ExpectedCommitment = Extract<ExpectedCommitment, {
|
|
24
|
+
contract: "hf-contract-v1";
|
|
25
|
+
}>;
|
|
26
|
+
export type HfV1DigestVerificationResult = Readonly<{
|
|
27
|
+
outcome: Extract<VerificationOutcome, "pass" | "fail">;
|
|
28
|
+
reason_code: string | null;
|
|
29
|
+
contract: typeof HF_V1_CONTRACT_ID;
|
|
30
|
+
material: HfV1Material["material"];
|
|
31
|
+
domain: string;
|
|
32
|
+
expected_digest: string;
|
|
33
|
+
computed_digest: string | null;
|
|
34
|
+
}>;
|
|
35
|
+
/** Strict HF canonical-json:v1 bytes; UTF-16 key ordering, no lossy sentinels. */
|
|
36
|
+
export declare function canonicalizeHfV1Json(value: unknown): Uint8Array;
|
|
37
|
+
export declare function normalizeHfV1Domain(domain: string): string;
|
|
38
|
+
/** frame = 'hf:frame:v1' || 0x00 || u16be(domain length) || domain || u32be(payload length) || payload. */
|
|
39
|
+
export declare function frameHfV1(domain: string, payload: Uint8Array): Uint8Array;
|
|
40
|
+
/** SHA3-512 over exact HF v1 framed bytes; returns lowercase hex. */
|
|
41
|
+
export declare function hashHfV1(input: HfV1HashInput): string;
|
|
42
|
+
/** Caller expectation selects both framing domain and material encoding. */
|
|
43
|
+
export declare function verifyHfV1Digest(input: Readonly<{
|
|
44
|
+
expected: HfV1ExpectedCommitment;
|
|
45
|
+
evidence: HfV1Material;
|
|
46
|
+
}>): HfV1DigestVerificationResult;
|
|
47
|
+
export {};
|
|
48
|
+
//# sourceMappingURL=hashContractV1.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hashContractV1.d.ts","sourceRoot":"","sources":["../../src/hf/hashContractV1.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,EAAE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AAkF;AAClF,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,UAAU,CAkE/D;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAK1D;AAED,2GAA2G;AAC3G,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,GAAG,UAAU,CAkBzE;AA0BD,qEAAqE;AACrE,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,CAGrD;AAED,4EAA4E;AAC5E,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,QAAQ,CAAC;IAC/C,QAAQ,EAAE,sBAAsB,CAAC;IACjC,QAAQ,EAAE,YAAY,CAAC;CACxB,CAAC,GAAG,4BAA4B,CAgChC"}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { normalizeSha3_512Digest, sha3_512Hex } from "../crypto/sha3.js";
|
|
2
|
+
/** HF v1 hashing is distinct from Core's unframed canonical-object hashes. */
|
|
3
|
+
export const HF_V1_CONTRACT_ID = "hf-contract-v1";
|
|
4
|
+
export const HF_V1_FRAME_ID = "hf:frame:v1";
|
|
5
|
+
export const HF_V1_CANONICAL_JSON_ID = "hf:canonical-json:v1";
|
|
6
|
+
// SDK-specific resource ceilings; these are not claims about a producer's limits.
|
|
7
|
+
export const MAX_HF_V1_PAYLOAD_BYTES = 16 * 1024 * 1024;
|
|
8
|
+
const MAX_JSON_DEPTH = 64;
|
|
9
|
+
const MAX_JSON_KEYS = 200_000;
|
|
10
|
+
const MAX_JSON_ARRAY_LENGTH = 200_000;
|
|
11
|
+
const DOMAIN_RE = /^[a-z0-9][a-z0-9._:/-]{0,63}$/;
|
|
12
|
+
const FRAME_MAGIC = Buffer.from(HF_V1_FRAME_ID, "utf8");
|
|
13
|
+
function chargeBudget(budget, bytes) {
|
|
14
|
+
budget.used += bytes;
|
|
15
|
+
if (budget.used > MAX_HF_V1_PAYLOAD_BYTES) {
|
|
16
|
+
throw new RangeError("HF v1 canonical JSON exceeds SDK byte limit");
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function quoted(value) {
|
|
20
|
+
return JSON.stringify(value);
|
|
21
|
+
}
|
|
22
|
+
function plainObject(value) {
|
|
23
|
+
const prototype = Object.getPrototypeOf(value);
|
|
24
|
+
return prototype === Object.prototype || prototype === null;
|
|
25
|
+
}
|
|
26
|
+
/** Strict HF canonical-json:v1 bytes; UTF-16 key ordering, no lossy sentinels. */
|
|
27
|
+
export function canonicalizeHfV1Json(value) {
|
|
28
|
+
const seen = new WeakSet();
|
|
29
|
+
const budget = { used: 0 };
|
|
30
|
+
let keys = 0;
|
|
31
|
+
function walk(node, depth) {
|
|
32
|
+
if (depth > MAX_JSON_DEPTH)
|
|
33
|
+
throw new TypeError("HF v1 JSON nesting limit exceeded");
|
|
34
|
+
if (node === null) {
|
|
35
|
+
chargeBudget(budget, 4);
|
|
36
|
+
return "null";
|
|
37
|
+
}
|
|
38
|
+
if (typeof node === "string") {
|
|
39
|
+
const result = quoted(node);
|
|
40
|
+
chargeBudget(budget, Buffer.byteLength(result, "utf8"));
|
|
41
|
+
return result;
|
|
42
|
+
}
|
|
43
|
+
if (typeof node === "boolean") {
|
|
44
|
+
chargeBudget(budget, node ? 4 : 5);
|
|
45
|
+
return node ? "true" : "false";
|
|
46
|
+
}
|
|
47
|
+
if (typeof node === "number") {
|
|
48
|
+
if (!Number.isFinite(node))
|
|
49
|
+
throw new TypeError("HF v1 JSON numbers must be finite");
|
|
50
|
+
const result = JSON.stringify(node);
|
|
51
|
+
chargeBudget(budget, result.length);
|
|
52
|
+
return result;
|
|
53
|
+
}
|
|
54
|
+
if (typeof node === "bigint") {
|
|
55
|
+
const result = quoted(node.toString(10));
|
|
56
|
+
chargeBudget(budget, Buffer.byteLength(result, "utf8"));
|
|
57
|
+
return result;
|
|
58
|
+
}
|
|
59
|
+
if (typeof node !== "object") {
|
|
60
|
+
throw new TypeError(`HF v1 JSON unsupported type: ${typeof node}`);
|
|
61
|
+
}
|
|
62
|
+
if (node instanceof Uint8Array || !Array.isArray(node) && !plainObject(node)) {
|
|
63
|
+
throw new TypeError("HF v1 JSON accepts only plain objects, arrays and scalar values");
|
|
64
|
+
}
|
|
65
|
+
if (seen.has(node))
|
|
66
|
+
throw new TypeError("HF v1 JSON repeated or circular object reference");
|
|
67
|
+
seen.add(node);
|
|
68
|
+
if (Array.isArray(node)) {
|
|
69
|
+
if (node.length > MAX_JSON_ARRAY_LENGTH) {
|
|
70
|
+
throw new RangeError("HF v1 JSON array exceeds SDK limit");
|
|
71
|
+
}
|
|
72
|
+
chargeBudget(budget, node.length ? node.length + 1 : 2);
|
|
73
|
+
const parts = [];
|
|
74
|
+
for (let i = 0; i < node.length; i++)
|
|
75
|
+
parts.push(walk(node[i], depth + 1));
|
|
76
|
+
return `[${parts.join(",")}]`;
|
|
77
|
+
}
|
|
78
|
+
const object = node;
|
|
79
|
+
const sorted = Object.keys(object).sort();
|
|
80
|
+
keys += sorted.length;
|
|
81
|
+
if (keys > MAX_JSON_KEYS)
|
|
82
|
+
throw new RangeError("HF v1 JSON key count exceeds SDK limit");
|
|
83
|
+
chargeBudget(budget, sorted.length ? sorted.length + 1 : 2);
|
|
84
|
+
const entries = [];
|
|
85
|
+
for (const key of sorted) {
|
|
86
|
+
const field = quoted(key);
|
|
87
|
+
chargeBudget(budget, Buffer.byteLength(field, "utf8") + 1);
|
|
88
|
+
entries.push(`${field}:${walk(object[key], depth + 1)}`);
|
|
89
|
+
}
|
|
90
|
+
return `{${entries.join(",")}}`;
|
|
91
|
+
}
|
|
92
|
+
return Buffer.from(walk(value, 0), "utf8");
|
|
93
|
+
}
|
|
94
|
+
export function normalizeHfV1Domain(domain) {
|
|
95
|
+
if (typeof domain !== "string")
|
|
96
|
+
throw new TypeError("HF v1 domain must be a string");
|
|
97
|
+
const normalized = domain.trim();
|
|
98
|
+
if (!DOMAIN_RE.test(normalized))
|
|
99
|
+
throw new TypeError("Invalid HF v1 domain");
|
|
100
|
+
return normalized;
|
|
101
|
+
}
|
|
102
|
+
/** frame = 'hf:frame:v1' || 0x00 || u16be(domain length) || domain || u32be(payload length) || payload. */
|
|
103
|
+
export function frameHfV1(domain, payload) {
|
|
104
|
+
const normalized = normalizeHfV1Domain(domain);
|
|
105
|
+
if (!(payload instanceof Uint8Array))
|
|
106
|
+
throw new TypeError("HF v1 payload must be bytes");
|
|
107
|
+
if (payload.byteLength > MAX_HF_V1_PAYLOAD_BYTES) {
|
|
108
|
+
throw new RangeError("HF v1 payload exceeds SDK byte limit");
|
|
109
|
+
}
|
|
110
|
+
const domainBytes = Buffer.from(normalized, "utf8");
|
|
111
|
+
const header = Buffer.alloc(FRAME_MAGIC.length + 1 + 2 + domainBytes.length + 4);
|
|
112
|
+
let offset = 0;
|
|
113
|
+
FRAME_MAGIC.copy(header, offset);
|
|
114
|
+
offset += FRAME_MAGIC.length;
|
|
115
|
+
header[offset++] = 0;
|
|
116
|
+
header.writeUInt16BE(domainBytes.length, offset);
|
|
117
|
+
offset += 2;
|
|
118
|
+
domainBytes.copy(header, offset);
|
|
119
|
+
offset += domainBytes.length;
|
|
120
|
+
header.writeUInt32BE(payload.byteLength, offset);
|
|
121
|
+
return Buffer.concat([header, Buffer.from(payload)]);
|
|
122
|
+
}
|
|
123
|
+
function payloadBytes(material) {
|
|
124
|
+
switch (material.material) {
|
|
125
|
+
case "json":
|
|
126
|
+
return canonicalizeHfV1Json(material.value);
|
|
127
|
+
case "utf8": {
|
|
128
|
+
if (typeof material.text !== "string") {
|
|
129
|
+
throw new TypeError("HF v1 UTF-8 material must be a string");
|
|
130
|
+
}
|
|
131
|
+
const bytes = Buffer.from(material.text, "utf8");
|
|
132
|
+
if (bytes.byteLength > MAX_HF_V1_PAYLOAD_BYTES) {
|
|
133
|
+
throw new RangeError("HF v1 text exceeds SDK byte limit");
|
|
134
|
+
}
|
|
135
|
+
return bytes;
|
|
136
|
+
}
|
|
137
|
+
case "raw":
|
|
138
|
+
if (!(material.bytes instanceof Uint8Array)) {
|
|
139
|
+
throw new TypeError("HF v1 raw material must be bytes");
|
|
140
|
+
}
|
|
141
|
+
return material.bytes;
|
|
142
|
+
default:
|
|
143
|
+
throw new TypeError("Unsupported HF v1 material kind");
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
/** SHA3-512 over exact HF v1 framed bytes; returns lowercase hex. */
|
|
147
|
+
export function hashHfV1(input) {
|
|
148
|
+
const framed = frameHfV1(input.domain, payloadBytes(input));
|
|
149
|
+
return sha3_512Hex(framed);
|
|
150
|
+
}
|
|
151
|
+
/** Caller expectation selects both framing domain and material encoding. */
|
|
152
|
+
export function verifyHfV1Digest(input) {
|
|
153
|
+
if (!input?.expected || input.expected.kind !== "digest" || input.expected.contract !== HF_V1_CONTRACT_ID) {
|
|
154
|
+
throw new TypeError("Expected an hf-contract-v1 digest commitment");
|
|
155
|
+
}
|
|
156
|
+
const expected = normalizeSha3_512Digest(input.expected.digest);
|
|
157
|
+
const domain = normalizeHfV1Domain(input.expected.domain);
|
|
158
|
+
const material = input.expected.material;
|
|
159
|
+
if (material !== "json" && material !== "raw" && material !== "utf8") {
|
|
160
|
+
throw new TypeError("Unsupported HF v1 material kind");
|
|
161
|
+
}
|
|
162
|
+
if (!input.evidence || input.evidence.material !== material) {
|
|
163
|
+
return Object.freeze({
|
|
164
|
+
outcome: "fail",
|
|
165
|
+
reason_code: "HF_MATERIAL_MISMATCH",
|
|
166
|
+
contract: HF_V1_CONTRACT_ID,
|
|
167
|
+
material,
|
|
168
|
+
domain,
|
|
169
|
+
expected_digest: expected,
|
|
170
|
+
computed_digest: null,
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
const computed = hashHfV1({ ...input.evidence, domain });
|
|
174
|
+
const match = expected === computed;
|
|
175
|
+
return Object.freeze({
|
|
176
|
+
outcome: match ? "pass" : "fail",
|
|
177
|
+
reason_code: match ? null : "DIGEST_MISMATCH",
|
|
178
|
+
contract: HF_V1_CONTRACT_ID,
|
|
179
|
+
material,
|
|
180
|
+
domain,
|
|
181
|
+
expected_digest: expected,
|
|
182
|
+
computed_digest: computed,
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
//# sourceMappingURL=hashContractV1.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hashContractV1.js","sourceRoot":"","sources":["../../src/hf/hashContractV1.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEzE,8EAA8E;AAC9E,MAAM,CAAC,MAAM,iBAAiB,GAAG,gBAAyB,CAAC;AAC3D,MAAM,CAAC,MAAM,cAAc,GAAG,aAAsB,CAAC;AACrD,MAAM,CAAC,MAAM,uBAAuB,GAAG,sBAA+B,CAAC;AAEvE,kFAAkF;AAClF,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AACxD,MAAM,cAAc,GAAG,EAAE,CAAC;AAC1B,MAAM,aAAa,GAAG,OAAO,CAAC;AAC9B,MAAM,qBAAqB,GAAG,OAAO,CAAC;AACtC,MAAM,SAAS,GAAG,+BAA+B,CAAC;AAClD,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;AAqBxD,SAAS,YAAY,CAAC,MAAwB,EAAE,KAAa;IAC3D,MAAM,CAAC,IAAI,IAAI,KAAK,CAAC;IACrB,IAAI,MAAM,CAAC,IAAI,GAAG,uBAAuB,EAAE,CAAC;QAC1C,MAAM,IAAI,UAAU,CAAC,6CAA6C,CAAC,CAAC;IACtE,CAAC;AACH,CAAC;AAED,SAAS,MAAM,CAAC,KAAa;IAC3B,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC;AAED,SAAS,WAAW,CAAC,KAAa;IAChC,MAAM,SAAS,GAAY,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC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AC,CAAC,IAAI,CAAC,CAAC,CAAC,iBAAiB;QAC7C,QAAQ,EAAE,iBAAiB;QAC3B,QAAQ;QACR,MAAM;QACN,eAAe,EAAE,QAAQ;QACzB,eAAe,EAAE,QAAQ;KAC1B,CAAC,CAAC;AACL,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public entry point for read-only verification contracts
|
|
3
|
+
* and offline cryptographic verification primitives.
|
|
4
|
+
*/
|
|
5
|
+
export type * from "./contracts/verification.js";
|
|
6
|
+
export { normalizeSha3_512Digest, sha3_512Hex, verifySha3_512Bytes, } from "./crypto/sha3.js";
|
|
7
|
+
export type { DigestVerificationResult } from "./crypto/sha3.js";
|
|
8
|
+
export { MAX_MERKLE_PROOF_STEPS, verifyMerkleMembership, } from "./merkle/membership.js";
|
|
9
|
+
export type { MerkleMembershipInput, MerkleMembershipResult, MerkleProofStep, } from "./merkle/membership.js";
|
|
10
|
+
export { HF_V1_CANONICAL_JSON_ID, HF_V1_CONTRACT_ID, HF_V1_FRAME_ID, MAX_HF_V1_PAYLOAD_BYTES, canonicalizeHfV1Json, frameHfV1, hashHfV1, normalizeHfV1Domain, verifyHfV1Digest, } from "./hf/hashContractV1.js";
|
|
11
|
+
export type { HfV1DigestVerificationResult, HfV1ExpectedCommitment, HfV1HashInput, HfV1Material, } from "./hf/hashContractV1.js";
|
|
12
|
+
export { sha3_512Stream, verifySha3_512Stream } from "./crypto/streamSha3.js";
|
|
13
|
+
export type { ByteChunkSource, Sha3_512StreamHashResult, Sha3_512StreamVerificationResult, } from "./crypto/streamSha3.js";
|
|
14
|
+
export { verifyDatasetV1Bundle, verifyDatasetV1Receipt } from "./profiles/dataset/v1.js";
|
|
15
|
+
export type { DatasetV1BundleComputed, DatasetV1Mismatch, DatasetV1ReceiptComputed, DatasetV1VerificationResult, } from "./profiles/dataset/v1.js";
|
|
16
|
+
export { verifyIngestV1Bundle, verifyIngestV1Receipt, verifyIngestV1Pair } from "./profiles/ingest/v1.js";
|
|
17
|
+
export type { IngestV1BundleComputed, IngestV1Mismatch, IngestV1ReceiptComputed, IngestV1Result, } from "./profiles/ingest/v1.js";
|
|
18
|
+
export { verifyDatasetV1Sources } from "./profiles/dataset/sourceV1.js";
|
|
19
|
+
export type { DatasetV1SourceInput, DatasetV1SourceResult } from "./profiles/dataset/sourceV1.js";
|
|
20
|
+
export { verifyIngestV1Sources } from "./profiles/ingest/sourceV1.js";
|
|
21
|
+
export type { IngestV1SourceInput, IngestV1SourceMaterial, IngestV1SourceResult } from "./profiles/ingest/sourceV1.js";
|
|
22
|
+
export type { SourceV1File, SourceV1Limits, SourceV1Mismatch } from "./profiles/sourceV1Helpers.js";
|
|
23
|
+
export { verifyDatasetV1WithIntent, verifyIngestV1WithIntent } from "./verification/sourceIntentV1.js";
|
|
24
|
+
export type { DatasetV1IntentInput, IngestV1IntentInput } from "./verification/sourceIntentV1.js";
|
|
25
|
+
export { compareEvidenceTriangulationV1 } from "./triangulation/compareV1.js";
|
|
26
|
+
export type { TriangulationFactPlanV1, TriangulationFactResultV1, TriangulationRelationshipId, TriangulationRelationshipPlanV1, TriangulationRelationshipResultV1, TriangulationV1Input, TriangulationV1Result, } from "./triangulation/compareV1.js";
|
|
27
|
+
export { observeCoreMessageBindingV1, observeMirrorMessageV1 } from "./triangulation/messageObservationV1.js";
|
|
28
|
+
export type { CoreMessageBindingV1Input, MirrorMessageV1Input } from "./triangulation/messageObservationV1.js";
|
|
29
|
+
export { resolveExplorerDatasetV1, resolveExplorerIngestV1, resolveExplorerMerkleRootV1, } from "./resolvers/explorerPublicV1.js";
|
|
30
|
+
export type { ExplorerDatasetV1Request, ExplorerIngestV1Request, ExplorerMerkleRootV1Request, ExplorerPublicRecordV1, ExplorerPublicationV1, } from "./resolvers/explorerPublicV1.js";
|
|
31
|
+
export { resolveExplorerDatasetPublicationV1, resolveExplorerIngestPublicationV1, resolveExplorerMerkleRootPublicationV1, } from "./resolvers/explorerPublicationV1.js";
|
|
32
|
+
export type { ExplorerPublicationDisclosureV1, ExplorerPublishedEvidenceV1 } from "./resolvers/explorerPublicationV1.js";
|
|
33
|
+
export type { ExplorerPublicTransportV1 } from "./resolvers/explorerTransportV1.js";
|
|
34
|
+
export { resolveHederaPublicationV1 } from "./resolvers/hederaMirrorV1.js";
|
|
35
|
+
export type { HederaMirrorV1Config, HederaPublicationObservationV1 } from "./resolvers/hederaMirrorV1.js";
|
|
36
|
+
export { triangulateDatasetV1, triangulateIngestV1 } from "./triangulation/publicV1.js";
|
|
37
|
+
export type { PublicTriangulationV1Config, PublicTriangulationV1Result, PublicIngestTriangulationV1Input } from "./triangulation/publicV1.js";
|
|
38
|
+
export { canonicalizeExecutionVerificationValue, computeExecutionDomainSeparatedSha3_512, executionTimestampNanos, hederaConsensusTimestampNanos, } from "./profiles/execution/recomputationV1.js";
|
|
39
|
+
export { verifyExecutionV1WithIntent } from "./profiles/execution/verificationV1.js";
|
|
40
|
+
export type { ExecutionV1Input, ExecutionV1Profile, ExecutionV1Report } from "./profiles/execution/verificationV1.js";
|
|
41
|
+
export type { PublicExecutionStandardsEvidence, PublicExecutionVerificationMaterial } from "./profiles/execution/contractV1.js";
|
|
42
|
+
export { MAX_HCS1_V1_CHUNKS, MAX_HCS1_V1_FILE_BYTES, parseHcs1ReferenceV1, verifyHcs1ContentV1 } from "./standards/hcs/hcs1V1.js";
|
|
43
|
+
export type { Hcs1V1ContentInput, Hcs1V1ContentOptions, Hcs1V1ContentResult } from "./standards/hcs/hcs1V1.js";
|
|
44
|
+
export { resolveHcs1FileV1 } from "./resolvers/hcs1MirrorV1.js";
|
|
45
|
+
export type { Hcs1MirrorV1Config, Hcs1MirrorV1Request, Hcs1MirrorV1Result } from "./resolvers/hcs1MirrorV1.js";
|
|
46
|
+
export { parseHcs2MemoV1, parseHcs2RegisterV1, verifyHcs2RegisterV1, Hcs2V1Error } from "./standards/hcs/hcs2V1.js";
|
|
47
|
+
export type { Hcs2V1Memo, Hcs2V1Register, Hcs2V1VerificationInput, Hcs2V1VerificationResult } from "./standards/hcs/hcs2V1.js";
|
|
48
|
+
export { resolveHcs2RegisterV1 } from "./resolvers/hcs2MirrorV1.js";
|
|
49
|
+
export type { Hcs2MirrorV1Request, Hcs2MirrorV1Result } from "./resolvers/hcs2MirrorV1.js";
|
|
50
|
+
export { Hcs14V1Error, parseHcs14DidUaidV1, buildHcs14DidUaidV1, verifyHcs14DidBindingV1 } from "./standards/hcs/hcs14V1.js";
|
|
51
|
+
export type { Hcs14DidUaidV1, Hcs14BindingV1Result } from "./standards/hcs/hcs14V1.js";
|
|
52
|
+
export { Hcs11V1Error, MAX_HCS11_V1_PROFILE_BYTES, parseHcs11AccountMemoV1, parseHcs11AiAgentProfileV1, verifyHcs11AiAgentProfileV1 } from "./standards/hcs/hcs11V1.js";
|
|
53
|
+
export type { Hcs11V1Memo, Hcs11V1Profile, Hcs11V1Input, Hcs11V1Result } from "./standards/hcs/hcs11V1.js";
|
|
54
|
+
export { resolveHcs11ProfileV1 } from "./resolvers/hcs11MirrorV1.js";
|
|
55
|
+
export type { Hcs11MirrorV1Request, Hcs11MirrorV1Result } from "./resolvers/hcs11MirrorV1.js";
|
|
56
|
+
export { Hcs13V1Error, MAX_HCS13_V1_SCHEMA_BYTES, buildHcs13ReferenceV1, parseHcs13ReferenceV1, finalizeHcs13SchemaV1, parseHcs13SchemaV1, verifyHcs13SchemaV1 } from "./standards/hcs/hcs13V1.js";
|
|
57
|
+
export type { Hcs13ReferenceV1, Hcs13SchemaV1, Hcs13SchemaVerificationV1 } from "./standards/hcs/hcs13V1.js";
|
|
58
|
+
export { Hcs26V1Error, MAX_HCS26_V1_MANIFEST_BYTES, parseHcs26MemoV1, parseHcs26DiscoveryRegisterV1, parseHcs26DiscoveryUpdateV1, parseHcs26VersionRegisterV1, finalizeHcs26SkillManifestV1, parseHcs26SkillManifestV1, verifyHcs26SkillVersionV1 } from "./standards/hcs/hcs26V1.js";
|
|
59
|
+
export type { Hcs26MemoV1, Hcs26VersionRegisterV1, Hcs26SkillManifestV1, Hcs26VersionVerificationV1 } from "./standards/hcs/hcs26V1.js";
|
|
60
|
+
export { resolveHcs13SchemaV1 } from "./resolvers/hcs13MirrorV1.js";
|
|
61
|
+
export type { Hcs13MirrorV1Request, Hcs13MirrorV1Result } from "./resolvers/hcs13MirrorV1.js";
|
|
62
|
+
export { resolveHcs26SkillVersionV1 } from "./resolvers/hcs26MirrorV1.js";
|
|
63
|
+
export type { Hcs26MirrorV1Request, Hcs26MirrorV1Result, Hcs26ManifestFileResolutionV1, Hcs26ManifestFilesResolutionV1 } from "./resolvers/hcs26MirrorV1.js";
|
|
64
|
+
export { verifyExecutionWithIndependentStandardsV1 } from "./profiles/execution/independentStandardsV1.js";
|
|
65
|
+
export type { IndependentStandardsV1Item, IndependentStandardsV1Report } from "./profiles/execution/independentStandardsV1.js";
|
|
66
|
+
export { resolveExplorerExecutionV1 } from "./resolvers/explorerExecutionV1.js";
|
|
67
|
+
export type { ExplorerExecutionV1Request, ExplorerExecutionV1Result } from "./resolvers/explorerExecutionV1.js";
|
|
68
|
+
export { resolveExecutionHederaV1 } from "./resolvers/executionMirrorV1.js";
|
|
69
|
+
export type { ExecutionMirrorV1Result } from "./resolvers/executionMirrorV1.js";
|
|
70
|
+
export { triangulatePublicExecutionV1 } from "./triangulation/executionPublicV1.js";
|
|
71
|
+
export type { PublicExecutionTriangulationV1Config, PublicExecutionTriangulationV1Result } from "./triangulation/executionPublicV1.js";
|
|
72
|
+
export { VERIFICATION_CORE_SCHEMA_VERSION, canonicalizeVerificationCoreV1, computeVerificationCoreDigestV1 } from "./reports/coreV1.js";
|
|
73
|
+
export { PORTABLE_VERIFICATION_REPORT_SCHEMA_VERSION, createPortableVerificationReportV1, canonicalizePortableVerificationReportV1, computePortableVerificationReportDigestV1 } from "./reports/portableV1.js";
|
|
74
|
+
export type { PortableVerificationReportV1, PortableVerificationReportV1Input } from "./reports/portableV1.js";
|
|
75
|
+
export { validatePortableVerificationReportV1, comparePortableVerificationReportsV1 } from "./reports/validationV1.js";
|
|
76
|
+
export type { PortableVerificationReportValidationV1, PortableVerificationReportComparisonV1 } from "./reports/validationV1.js";
|
|
77
|
+
export { VERIFICATION_POLICY_SCHEMA_VERSION } from "./policy/contractV1.js";
|
|
78
|
+
export type { VerificationPolicyAssuranceV1, VerificationPolicyV1, VerificationPolicyRequirementV1, VerificationPolicyDecisionV1, VerificationPolicyWorkflowV1 } from "./policy/contractV1.js";
|
|
79
|
+
export { assessPortableVerificationPolicyV1, verifyDatasetWithPolicyV1, verifyIngestWithPolicyV1, verifyExecutionWithPolicyV1, triangulateDatasetWithPolicyV1, triangulateIngestWithPolicyV1, triangulateExecutionWithPolicyV1, verifyExecutionStandardsWithPolicyV1 } from "./policy/evaluateV1.js";
|
|
80
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,mBAAmB,6BAA6B,CAAC;AAEjD,OAAO,EACL,uBAAuB,EACvB,WAAW,EACX,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAEjE,OAAO,EACL,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,wBAAwB,CAAC;AAEhC,YAAY,EACV,qBAAqB,EACrB,sBAAsB,EACtB,eAAe,GAChB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,cAAc,EACd,uBAAuB,EACvB,oBAAoB,EACpB,SAAS,EACT,QAAQ,EACR,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EACV,4BAA4B,EAC5B,sBAAsB,EACtB,aAAa,EACb,YAAY,GACb,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,cA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AA2B,CAAC;AAGhI,OAAO,EAAE,kCAAkC,EAAE,MAAM,wBAAwB,CAAC;AAC5E,YAAY,EAAE,6BAA6B,EAAE,oBAAoB,EAAE,+BAA+B,EAChG,4BAA4B,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAC7F,OAAO,EAAE,kCAAkC,EAAE,yBAAyB,EACpE,wBAAwB,EAAE,2BAA2B,EACrD,8BAA8B,EAAE,6BAA6B,EAC7D,gCAAgC,EAAE,oCAAoC,EAAE,MAAM,wBAAwB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public entry point for read-only verification contracts
|
|
3
|
+
* and offline cryptographic verification primitives.
|
|
4
|
+
*/
|
|
5
|
+
export { normalizeSha3_512Digest, sha3_512Hex, verifySha3_512Bytes, } from "./crypto/sha3.js";
|
|
6
|
+
export { MAX_MERKLE_PROOF_STEPS, verifyMerkleMembership, } from "./merkle/membership.js";
|
|
7
|
+
export { HF_V1_CANONICAL_JSON_ID, HF_V1_CONTRACT_ID, HF_V1_FRAME_ID, MAX_HF_V1_PAYLOAD_BYTES, canonicalizeHfV1Json, frameHfV1, hashHfV1, normalizeHfV1Domain, verifyHfV1Digest, } from "./hf/hashContractV1.js";
|
|
8
|
+
export { sha3_512Stream, verifySha3_512Stream } from "./crypto/streamSha3.js";
|
|
9
|
+
export { verifyDatasetV1Bundle, verifyDatasetV1Receipt } from "./profiles/dataset/v1.js";
|
|
10
|
+
export { verifyIngestV1Bundle, verifyIngestV1Receipt, verifyIngestV1Pair } from "./profiles/ingest/v1.js";
|
|
11
|
+
export { verifyDatasetV1Sources } from "./profiles/dataset/sourceV1.js";
|
|
12
|
+
export { verifyIngestV1Sources } from "./profiles/ingest/sourceV1.js";
|
|
13
|
+
export { verifyDatasetV1WithIntent, verifyIngestV1WithIntent } from "./verification/sourceIntentV1.js";
|
|
14
|
+
export { compareEvidenceTriangulationV1 } from "./triangulation/compareV1.js";
|
|
15
|
+
export { observeCoreMessageBindingV1, observeMirrorMessageV1 } from "./triangulation/messageObservationV1.js";
|
|
16
|
+
export { resolveExplorerDatasetV1, resolveExplorerIngestV1, resolveExplorerMerkleRootV1, } from "./resolvers/explorerPublicV1.js";
|
|
17
|
+
export { resolveExplorerDatasetPublicationV1, resolveExplorerIngestPublicationV1, resolveExplorerMerkleRootPublicationV1, } from "./resolvers/explorerPublicationV1.js";
|
|
18
|
+
export { resolveHederaPublicationV1 } from "./resolvers/hederaMirrorV1.js";
|
|
19
|
+
export { triangulateDatasetV1, triangulateIngestV1 } from "./triangulation/publicV1.js";
|
|
20
|
+
// Deterministic primitives for supported SAGE execution evidence.
|
|
21
|
+
// These are not themselves acceptance or identity verification.
|
|
22
|
+
export { canonicalizeExecutionVerificationValue, computeExecutionDomainSeparatedSha3_512, executionTimestampNanos, hederaConsensusTimestampNanos, } from "./profiles/execution/recomputationV1.js";
|
|
23
|
+
// Independent offline SAGE execution profile; rule outcomes are SDK-native findings.
|
|
24
|
+
export { verifyExecutionV1WithIntent } from "./profiles/execution/verificationV1.js";
|
|
25
|
+
// Supported pinned HCS-1 file integrity and independent Mirror observation.
|
|
26
|
+
export { MAX_HCS1_V1_CHUNKS, MAX_HCS1_V1_FILE_BYTES, parseHcs1ReferenceV1, verifyHcs1ContentV1 } from "./standards/hcs/hcs1V1.js";
|
|
27
|
+
export { resolveHcs1FileV1 } from "./resolvers/hcs1MirrorV1.js";
|
|
28
|
+
// Pinned HCS-2 historical registry entry checks; independent of VA evidence production.
|
|
29
|
+
export { parseHcs2MemoV1, parseHcs2RegisterV1, verifyHcs2RegisterV1, Hcs2V1Error } from "./standards/hcs/hcs2V1.js";
|
|
30
|
+
export { resolveHcs2RegisterV1 } from "./resolvers/hcs2MirrorV1.js";
|
|
31
|
+
// Pinned open HCS-14 DID-backed UAID structural binding; no DID controller authentication.
|
|
32
|
+
export { Hcs14V1Error, parseHcs14DidUaidV1, buildHcs14DidUaidV1, verifyHcs14DidBindingV1 } from "./standards/hcs/hcs14V1.js";
|
|
33
|
+
// Pinned open HCS-11 AI-agent profile integrity and reference checks; no account ownership assertion.
|
|
34
|
+
export { Hcs11V1Error, MAX_HCS11_V1_PROFILE_BYTES, parseHcs11AccountMemoV1, parseHcs11AiAgentProfileV1, verifyHcs11AiAgentProfileV1 } from "./standards/hcs/hcs11V1.js";
|
|
35
|
+
// Account -> current HCS-11 memo -> optional historical HCS-2 -> HCS-1 -> HCS-11/HCS-14.
|
|
36
|
+
export { resolveHcs11ProfileV1 } from "./resolvers/hcs11MirrorV1.js";
|
|
37
|
+
// Open pinned HCS-13 schema references and canonical document integrity (offline).
|
|
38
|
+
export { Hcs13V1Error, MAX_HCS13_V1_SCHEMA_BYTES, buildHcs13ReferenceV1, parseHcs13ReferenceV1, finalizeHcs13SchemaV1, parseHcs13SchemaV1, verifyHcs13SchemaV1 } from "./standards/hcs/hcs13V1.js";
|
|
39
|
+
// Open pinned HCS-26 discovery/version registers and SKILL.json integrity (offline).
|
|
40
|
+
export { Hcs26V1Error, MAX_HCS26_V1_MANIFEST_BYTES, parseHcs26MemoV1, parseHcs26DiscoveryRegisterV1, parseHcs26DiscoveryUpdateV1, parseHcs26VersionRegisterV1, finalizeHcs26SkillManifestV1, parseHcs26SkillManifestV1, verifyHcs26SkillVersionV1 } from "./standards/hcs/hcs26V1.js";
|
|
41
|
+
// Historical HCS-13 HCS-2 registration -> HCS-1 schema resolution.
|
|
42
|
+
export { resolveHcs13SchemaV1 } from "./resolvers/hcs13MirrorV1.js";
|
|
43
|
+
// Historical HCS-26 discovery -> version registration -> HCS-1 skill manifest + declared files.
|
|
44
|
+
export { resolveHcs26SkillVersionV1 } from "./resolvers/hcs26MirrorV1.js";
|
|
45
|
+
// SDK-owned online integration: exact HCS-11/14, HCS-13 and HCS-26 reference
|
|
46
|
+
// observations augment the offline SAGE report without trusting producer summaries.
|
|
47
|
+
export { verifyExecutionWithIndependentStandardsV1 } from "./profiles/execution/independentStandardsV1.js";
|
|
48
|
+
export { resolveExplorerExecutionV1 } from "./resolvers/explorerExecutionV1.js";
|
|
49
|
+
export { resolveExecutionHederaV1 } from "./resolvers/executionMirrorV1.js";
|
|
50
|
+
export { triangulatePublicExecutionV1 } from "./triangulation/executionPublicV1.js";
|
|
51
|
+
export { VERIFICATION_CORE_SCHEMA_VERSION, canonicalizeVerificationCoreV1, computeVerificationCoreDigestV1 } from "./reports/coreV1.js";
|
|
52
|
+
export { PORTABLE_VERIFICATION_REPORT_SCHEMA_VERSION, createPortableVerificationReportV1, canonicalizePortableVerificationReportV1, computePortableVerificationReportDigestV1 } from "./reports/portableV1.js";
|
|
53
|
+
export { validatePortableVerificationReportV1, comparePortableVerificationReportsV1 } from "./reports/validationV1.js";
|
|
54
|
+
// Exact policy evaluation. Saved reports remain unauthenticated and cannot grant allow.
|
|
55
|
+
export { VERIFICATION_POLICY_SCHEMA_VERSION } from "./policy/contractV1.js";
|
|
56
|
+
export { assessPortableVerificationPolicyV1, verifyDatasetWithPolicyV1, verifyIngestWithPolicyV1, verifyExecutionWithPolicyV1, triangulateDatasetWithPolicyV1, triangulateIngestWithPolicyV1, triangulateExecutionWithPolicyV1, verifyExecutionStandardsWithPolicyV1 } from "./policy/evaluateV1.js";
|
|
57
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EACL,uBAAuB,EACvB,WAAW,EACX,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;AAI1B,OAAO,EACL,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,wBAAwB,CAAC;AAQhC,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,cAAc,EACd,uBAAuB,EACvB,oBAAoB,EACpB,SAAS,EACT,QAAQ,EACR,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,wBAAwB,CAAC;AAQhC,OAAO,E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,wCAAwC,EAAE,yCAAyC,EAAE,MAAM,yBAAyB,CAAC;AAGvH,OAAO,EAAE,oCAAoC,EAAE,oCAAoC,EAAE,MAAM,2BAA2B,CAAC;AAGvH,wFAAwF;AACxF,OAAO,EAAE,kCAAkC,EAAE,MAAM,wBAAwB,CAAC;AAG5E,OAAO,EAAE,kCAAkC,EAAE,yBAAyB,EACpE,wBAAwB,EAAE,2BAA2B,EACrD,8BAA8B,EAAE,6BAA6B,EAC7D,gCAAgC,EAAE,oCAAoC,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ExpectedCommitment, VerificationOutcome } from "../contracts/verification.js";
|
|
2
|
+
export declare const MAX_MERKLE_PROOF_STEPS = 64;
|
|
3
|
+
export type MerkleProofStep = Readonly<{
|
|
4
|
+
position: "left" | "right";
|
|
5
|
+
hash: string;
|
|
6
|
+
}>;
|
|
7
|
+
export type MerkleMembershipInput = Readonly<{
|
|
8
|
+
/** This commitment must come from the caller's trusted expectations. */
|
|
9
|
+
expected: Extract<ExpectedCommitment, {
|
|
10
|
+
kind: "merkle-root";
|
|
11
|
+
}>;
|
|
12
|
+
proof: Readonly<{
|
|
13
|
+
/** Stored leaf digest; v2 applies a separate leaf-node hash. */
|
|
14
|
+
leaf_hash: string;
|
|
15
|
+
leaf_index: number;
|
|
16
|
+
path: readonly MerkleProofStep[];
|
|
17
|
+
}>;
|
|
18
|
+
}>;
|
|
19
|
+
export type MerkleMembershipResult = Readonly<{
|
|
20
|
+
outcome: Extract<VerificationOutcome, "pass" | "fail" | "unsupported">;
|
|
21
|
+
reason_code: string | null;
|
|
22
|
+
expected_root: string;
|
|
23
|
+
computed_root: string | null;
|
|
24
|
+
}>;
|
|
25
|
+
/**
|
|
26
|
+
* Verify membership against a separately trusted root, algorithm, and leaf count.
|
|
27
|
+
* This establishes a mathematical commitment relationship, not ledger authenticity.
|
|
28
|
+
*/
|
|
29
|
+
export declare function verifyMerkleMembership(input: MerkleMembershipInput): MerkleMembershipResult;
|
|
30
|
+
//# sourceMappingURL=membership.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"membership.d.ts","sourceRoot":"","sources":["../../src/merkle/membership.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAG5F,eAAO,MAAM,sBAAsB,KAAK,CAAC;AAEzC,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC;IACrC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;CACd,CAAC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,QAAQ,CAAC;IAC3C,wEAAwE;IACxE,QAAQ,EAAE,OAAO,CAAC,kBAAkB,EAAE;QAAE,IAAI,EAAE,aAAa,CAAA;KAAE,CAAC,CAAC;IAC/D,KAAK,EAAE,QAAQ,CAAC;QACd,gEAAgE;QAChE,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,IAAI,EAAE,SAAS,eAAe,EAAE,CAAC;KAClC,CAAC,CAAC;CACJ,CAAC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,QAAQ,CAAC;IAC5C,OAAO,EAAE,OAAO,CAAC,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,aAAa,CAAC,CAAC;IACvE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B,CAAC,CAAC;AA6EH;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,qBAAqB,GAAG,sBAAsB,CA6C3F"}
|