@nakafa/aksara-contracts 0.49.0 → 0.51.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.
Files changed (105) hide show
  1. package/dist/artifact/integrity.d.ts +15 -2
  2. package/dist/artifact/integrity.js +3 -15
  3. package/dist/artifact/limits.js +3 -4
  4. package/dist/artifact/source.js +4 -8
  5. package/dist/artifact/spec.d.ts +30 -10
  6. package/dist/assessment/hash.d.ts +251 -213
  7. package/dist/assessment/item.d.ts +44 -7
  8. package/dist/assessment/item.js +19 -9
  9. package/dist/assessment/joint.d.ts +62 -0
  10. package/dist/assessment/joint.js +85 -0
  11. package/dist/assessment/paper.d.ts +22 -2
  12. package/dist/assessment/profile.d.ts +6 -0
  13. package/dist/assessment/scoring.d.ts +55 -2
  14. package/dist/assessment/scoring.js +63 -8
  15. package/dist/assessment/stimulus.d.ts +3 -3
  16. package/dist/assessment/stimulus.js +2 -2
  17. package/dist/errors.d.ts +3 -1
  18. package/dist/graph/family.d.ts +6 -2
  19. package/dist/graph/identity.d.ts +3 -1
  20. package/dist/hash/digest.d.ts +10 -0
  21. package/dist/hash/digest.js +40 -0
  22. package/dist/hash/stream.d.ts +12 -0
  23. package/dist/hash/stream.js +27 -0
  24. package/dist/hash/text.d.ts +3 -1
  25. package/dist/hash/text.js +2 -15
  26. package/dist/locale.d.ts +9 -0
  27. package/dist/locale.js +25 -1
  28. package/dist/preview/auth.d.ts +4 -2
  29. package/dist/preview/auth.js +26 -12
  30. package/dist/program/snapshot/digest.d.ts +3 -1
  31. package/dist/program/snapshot/digest.js +14 -22
  32. package/dist/program/snapshot/hash.d.ts +6 -2
  33. package/dist/program/snapshot/hash.js +10 -21
  34. package/dist/projection/digest.d.ts +11 -9
  35. package/dist/projection/digest.js +23 -32
  36. package/dist/projection/hash.d.ts +222 -2
  37. package/dist/projection/hash.js +6 -8
  38. package/dist/projection/verify.d.ts +16 -6
  39. package/dist/question/item.d.ts +3 -1
  40. package/dist/question/item.js +3 -1
  41. package/dist/quran/notes.d.ts +3 -1
  42. package/dist/quran/provenance.d.ts +6 -2
  43. package/dist/quran/provenance.js +8 -15
  44. package/dist/quran/snapshot/digest.d.ts +9 -5
  45. package/dist/quran/snapshot/digest.js +33 -41
  46. package/dist/quran/snapshot/hash.d.ts +3 -1
  47. package/dist/quran/snapshot/hash.js +9 -15
  48. package/dist/quran/snapshot/row/hash.d.ts +3 -1
  49. package/dist/quran/snapshot/row/hash.js +2 -8
  50. package/dist/release/digest.d.ts +10 -8
  51. package/dist/release/digest.js +22 -31
  52. package/dist/release/hash.d.ts +3 -1
  53. package/dist/release/hash.js +3 -8
  54. package/dist/release/items.d.ts +25 -9
  55. package/dist/release/items.js +12 -3
  56. package/dist/release/policy.d.ts +3 -1
  57. package/dist/release/result/digest.d.ts +23 -13
  58. package/dist/release/result/digest.js +20 -29
  59. package/dist/release/rollback/digest.d.ts +16 -10
  60. package/dist/release/rollback/digest.js +25 -32
  61. package/dist/release/route/digest.d.ts +10 -8
  62. package/dist/release/route/digest.js +22 -31
  63. package/dist/release/route/verify.d.ts +16 -6
  64. package/dist/release/route/verify.js +8 -2
  65. package/dist/release/snapshot/evidence/requirement.d.ts +3 -1
  66. package/dist/release/snapshot/evidence/tryout.d.ts +1 -1
  67. package/dist/release/snapshot/evidence/tryout.js +1 -1
  68. package/dist/release/snapshot/evidence.d.ts +1 -1
  69. package/dist/release/snapshot/verify.d.ts +19 -7
  70. package/dist/release/snapshot/verify.js +20 -18
  71. package/dist/release/verify.d.ts +9 -3
  72. package/dist/renderer/compatibility.d.ts +6 -2
  73. package/dist/renderer/compatibility.js +3 -1
  74. package/dist/renderer/contract.d.ts +9 -3
  75. package/dist/renderer/contract.js +3 -1
  76. package/dist/runtime/error.d.ts +3 -1
  77. package/dist/runtime/protected/verify.d.ts +1 -1
  78. package/dist/runtime/verify.d.ts +2 -2
  79. package/dist/runtime/verify.js +2 -1
  80. package/dist/signature/key.d.ts +21 -0
  81. package/dist/signature/key.js +104 -0
  82. package/dist/signature/spec.d.ts +18 -6
  83. package/dist/signature/spec.js +16 -4
  84. package/dist/transport/request.d.ts +728 -728
  85. package/dist/transport/response.d.ts +26 -26
  86. package/dist/tryout/canonical.d.ts +11 -1
  87. package/dist/tryout/canonical.js +6 -10
  88. package/dist/tryout/closure/accounting.d.ts +3 -1
  89. package/dist/tryout/digest.d.ts +12 -6
  90. package/dist/tryout/digest.js +21 -14
  91. package/dist/tryout/hash/catalog.d.ts +228 -3
  92. package/dist/tryout/hash/catalog.js +5 -7
  93. package/dist/tryout/hash/content.d.ts +113 -2
  94. package/dist/tryout/hash/content.js +10 -8
  95. package/dist/tryout/hash/placement.d.ts +236 -5
  96. package/dist/tryout/hash/placement.js +7 -8
  97. package/dist/tryout/runtime/hash.d.ts +3 -1
  98. package/dist/tryout/runtime/hash.js +3 -1
  99. package/dist/tryout/runtime/source.d.ts +3 -1
  100. package/dist/tryout/runtime/verify.d.ts +13 -5
  101. package/dist/tryout/runtime/verify.js +1 -1
  102. package/dist/tryout/scoring.d.ts +3 -1
  103. package/dist/tryout/snapshot/hash.d.ts +45 -4
  104. package/dist/tryout/snapshot/hash.js +9 -7
  105. package/package.json +22 -2
@@ -198,7 +198,7 @@ export declare const verifyContentRuntimeEvidenceExchange: (input: {
198
198
  } | {
199
199
  readonly code: "CONTENT_RUNTIME_INTERNAL" | "CONTENT_RUNTIME_INVALID" | "CONTENT_RUNTIME_RESPONSE_TOO_LARGE" | "CONTENT_RUNTIME_UNAUTHORIZED";
200
200
  readonly kind: "failure";
201
- }, import("../artifact/spec.js").ArtifactCompiledByteLengthMismatchError | import("../artifact/spec.js").ArtifactHashComputationError | import("../artifact/spec.js").ArtifactHashMismatchError | import("../artifact/spec.js").ArtifactPayloadFieldByteLimitError | import("../artifact/spec.js").ArtifactRendererComponentMissingError | import("../artifact/spec.js").ArtifactRendererDomainUnpublishedError | import("../artifact/spec.js").ArtifactSourceHashComputationError | import("../artifact/spec.js").ArtifactSourceHashMismatchError | import("../artifact/spec.js").ArtifactVerificationByteLimitError | import("../artifact/spec.js").ArtifactVerificationDecodeError | ContentRuntimeMismatchError | import("../errors.js").ContractDecodeError | import("../signature/spec.js").PublicKeyParseError | import("../signature/spec.js").PublicKeyTypeError | import("#contracts/release/verify").ReleaseBundleVerificationDecodeError | import("../release/hash.js").ReleaseHashComputationError | import("#contracts/release/verify").ReleaseManifestHashMismatchError | import("#contracts/release/verify").ReleaseVerificationDecodeError | import("../renderer/contract.js").RendererDomainCapabilityMissingError | import("../renderer/contract.js").RendererManifestHashComputeError | import("../renderer/contract.js").RendererManifestHashMismatchError | import("../signature/spec.js").SignatureCheckError | import("../signature/spec.js").SignatureInvalidError | import("../signature/spec.js").SigningKeyNotFoundError | import("../signature/spec.js").SigningKeyResolutionError, import("../signature/spec.js").ContentVerificationKeyResolver>;
201
+ }, import("../artifact/spec.js").ArtifactCompiledByteLengthMismatchError | import("../artifact/spec.js").ArtifactHashComputationError | import("../artifact/spec.js").ArtifactHashMismatchError | import("../artifact/spec.js").ArtifactPayloadFieldByteLimitError | import("../artifact/spec.js").ArtifactRendererComponentMissingError | import("../artifact/spec.js").ArtifactRendererDomainUnpublishedError | import("../artifact/spec.js").ArtifactSourceHashComputationError | import("../artifact/spec.js").ArtifactSourceHashMismatchError | import("../artifact/spec.js").ArtifactVerificationByteLimitError | import("../artifact/spec.js").ArtifactVerificationDecodeError | import("#contracts/projection/hash").ContentProjectionHashError | ContentRuntimeMismatchError | import("../errors.js").ContractDecodeError | import("../signature/spec.js").PublicKeyParseError | import("../signature/spec.js").PublicKeyTypeError | import("#contracts/release/verify").ReleaseBundleVerificationDecodeError | import("../release/hash.js").ReleaseHashComputationError | import("#contracts/release/verify").ReleaseManifestHashMismatchError | import("#contracts/release/verify").ReleaseVerificationDecodeError | import("../renderer/contract.js").RendererDomainCapabilityMissingError | import("../renderer/contract.js").RendererManifestHashComputeError | import("../renderer/contract.js").RendererManifestHashMismatchError | import("../signature/spec.js").SignatureCheckError | import("../signature/spec.js").SignatureInvalidError | import("../signature/spec.js").SigningKeyNotFoundError | import("../signature/spec.js").SigningKeyResolutionError, import("../signature/spec.js").ContentVerificationKeyResolver>;
202
202
  /**
203
203
  * Verifies independently signed runtime values selected for one exact request.
204
204
  *
@@ -398,4 +398,4 @@ export declare const verifyContentRuntimeExchange: (input: {
398
398
  } | {
399
399
  readonly code: "CONTENT_RUNTIME_INTERNAL" | "CONTENT_RUNTIME_INVALID" | "CONTENT_RUNTIME_RESPONSE_TOO_LARGE" | "CONTENT_RUNTIME_UNAUTHORIZED";
400
400
  readonly kind: "failure";
401
- }, import("../artifact/spec.js").ArtifactCompiledByteLengthMismatchError | import("../artifact/spec.js").ArtifactHashComputationError | import("../artifact/spec.js").ArtifactHashMismatchError | import("../artifact/spec.js").ArtifactPayloadFieldByteLimitError | import("../artifact/spec.js").ArtifactRendererComponentMissingError | import("../artifact/spec.js").ArtifactRendererDomainUnpublishedError | import("../artifact/spec.js").ArtifactSourceHashComputationError | import("../artifact/spec.js").ArtifactSourceHashMismatchError | import("../artifact/spec.js").ArtifactVerificationByteLimitError | import("../artifact/spec.js").ArtifactVerificationDecodeError | ContentRuntimeMismatchError | import("../errors.js").ContractDecodeError | import("../signature/spec.js").PublicKeyParseError | import("../signature/spec.js").PublicKeyTypeError | import("#contracts/release/verify").ReleaseBundleVerificationDecodeError | import("../release/hash.js").ReleaseHashComputationError | import("#contracts/release/verify").ReleaseManifestHashMismatchError | import("#contracts/release/verify").ReleaseVerificationDecodeError | import("../renderer/contract.js").RendererDomainCapabilityMissingError | import("../renderer/contract.js").RendererManifestHashComputeError | import("../renderer/contract.js").RendererManifestHashMismatchError | import("../signature/spec.js").SignatureCheckError | import("../signature/spec.js").SignatureInvalidError | import("../signature/spec.js").SigningKeyNotFoundError | import("../signature/spec.js").SigningKeyResolutionError, import("../signature/spec.js").ContentVerificationKeyResolver>;
401
+ }, import("../artifact/spec.js").ArtifactCompiledByteLengthMismatchError | import("../artifact/spec.js").ArtifactHashComputationError | import("../artifact/spec.js").ArtifactHashMismatchError | import("../artifact/spec.js").ArtifactPayloadFieldByteLimitError | import("../artifact/spec.js").ArtifactRendererComponentMissingError | import("../artifact/spec.js").ArtifactRendererDomainUnpublishedError | import("../artifact/spec.js").ArtifactSourceHashComputationError | import("../artifact/spec.js").ArtifactSourceHashMismatchError | import("../artifact/spec.js").ArtifactVerificationByteLimitError | import("../artifact/spec.js").ArtifactVerificationDecodeError | import("#contracts/projection/hash").ContentProjectionHashError | ContentRuntimeMismatchError | import("../errors.js").ContractDecodeError | import("../signature/spec.js").PublicKeyParseError | import("../signature/spec.js").PublicKeyTypeError | import("#contracts/release/verify").ReleaseBundleVerificationDecodeError | import("../release/hash.js").ReleaseHashComputationError | import("#contracts/release/verify").ReleaseManifestHashMismatchError | import("#contracts/release/verify").ReleaseVerificationDecodeError | import("../renderer/contract.js").RendererDomainCapabilityMissingError | import("../renderer/contract.js").RendererManifestHashComputeError | import("../renderer/contract.js").RendererManifestHashMismatchError | import("../signature/spec.js").SignatureCheckError | import("../signature/spec.js").SignatureInvalidError | import("../signature/spec.js").SigningKeyNotFoundError | import("../signature/spec.js").SigningKeyResolutionError, import("../signature/spec.js").ContentVerificationKeyResolver>;
@@ -43,7 +43,8 @@ const verifyPublicIdentity = Effect.fn("AksaraContracts.verifyPublicIdentity")(f
43
43
  if (!hasProjectionSourcePath(response.projection, response.sourcePath)) {
44
44
  return yield* new ContentRuntimeMismatchError({ reason: "sourcePath" });
45
45
  }
46
- if (response.projectionHash !== hashContentProjection(response.projection)) {
46
+ const projectionHash = yield* hashContentProjection(response.projection);
47
+ if (response.projectionHash !== projectionHash) {
47
48
  return yield* new ContentRuntimeMismatchError({
48
49
  reason: "projectionHash",
49
50
  });
@@ -0,0 +1,21 @@
1
+ import { Effect, Schema } from "effect";
2
+ declare const Ed25519KeyError_base: Schema.Class<Ed25519KeyError, Schema.TaggedStruct<"Ed25519KeyError", {
3
+ readonly stage: Schema.Literals<readonly ["derive", "import", "sign"]>;
4
+ }>, import("effect/Cause").YieldableError & {
5
+ readonly brand: unique symbol;
6
+ }>;
7
+ /** An Ed25519 key could not be generated, imported from PEM, derived as a public key, or used to sign. */
8
+ export declare class Ed25519KeyError extends Ed25519KeyError_base {
9
+ }
10
+ /** Reads the 32 raw public-key bytes from the `x` member of an exported Ed25519 JSON Web Key. */
11
+ export declare const ed25519PublicKeyBytes: (x: string | undefined) => Effect.Effect<Uint8Array<ArrayBufferLike>, Ed25519KeyError, never>;
12
+ /** Derives the SPKI PEM public key of one Ed25519 PKCS#8 private key PEM. */
13
+ export declare const ed25519PublicKeyPem: (privateKeyPem: string) => Effect.Effect<string, Ed25519KeyError, never>;
14
+ /** Generates one Ed25519 key pair as PKCS#8 and SPKI PEM text, from a random seed. */
15
+ export declare const generateEd25519KeyPem: () => Effect.Effect<{
16
+ privateKeyPem: string;
17
+ publicKeyPem: string;
18
+ }, Ed25519KeyError, never>;
19
+ /** Signs the UTF-8 bytes of one canonical message with an unencrypted Ed25519 PKCS#8 PEM private key, returning the unpadded base64url signature. */
20
+ export declare const signEd25519Message: (privateKeyPem: string, message: string) => Effect.Effect<string & import("effect/Brand").Brand<"@NakafaAI/AksaraEd25519Signature">, Ed25519KeyError, never>;
21
+ export {};
@@ -0,0 +1,104 @@
1
+ import { Effect, Schema } from "effect";
2
+ import { Base64, Base64Url } from "effect/encoding";
3
+ import { webCryptoService } from "#contracts/hash/digest";
4
+ import { Ed25519SignatureSchema } from "#contracts/ids";
5
+ /** The DER prefix of one PKCS#8 Ed25519 private key, before its 32-byte seed. */
6
+ const ED25519_PKCS8_HEADER = Uint8Array.of(0x30, 0x2e, 0x02, 0x01, 0x00, 0x30, 0x05, 0x06, 0x03, 0x2b, 0x65, 0x70, 0x04, 0x22, 0x04, 0x20);
7
+ const ED25519_SEED_BYTES = 32;
8
+ const PRIVATE_KEY_HEADER = "-----BEGIN PRIVATE KEY-----\n";
9
+ const PRIVATE_KEY_FOOTER = "-----END PRIVATE KEY-----";
10
+ const PUBLIC_KEY_HEADER = "-----BEGIN PUBLIC KEY-----\n";
11
+ const PUBLIC_KEY_FOOTER = "-----END PUBLIC KEY-----";
12
+ /** The DER header that wraps one 32-byte Ed25519 public key as SubjectPublicKeyInfo. */
13
+ const ED25519_SPKI_HEADER = Uint8Array.of(0x30, 0x2a, 0x30, 0x05, 0x06, 0x03, 0x2b, 0x65, 0x70, 0x03, 0x21, 0x00);
14
+ const ED25519_PUBLIC_KEY_BYTES = 32;
15
+ /** PEM bodies wrap base64 text at this many characters per line. */
16
+ const PEM_LINE_LENGTH = 64;
17
+ /** An Ed25519 key could not be generated, imported from PEM, derived as a public key, or used to sign. */
18
+ export class Ed25519KeyError extends Schema.TaggedError()("Ed25519KeyError", {
19
+ stage: Schema.Literals(["derive", "import", "sign"]),
20
+ }) {
21
+ }
22
+ /** Decodes the DER bytes of one unencrypted PKCS#8 private key PEM. */
23
+ function decodePrivateKeyPem(privateKeyPem) {
24
+ const pem = privateKeyPem.replaceAll("\r\n", "\n");
25
+ const end = pem.trimEnd();
26
+ if (!(pem.startsWith(PRIVATE_KEY_HEADER) && end.endsWith(PRIVATE_KEY_FOOTER))) {
27
+ return Effect.fail(new Ed25519KeyError({ stage: "import" }));
28
+ }
29
+ const body = end
30
+ .slice(PRIVATE_KEY_HEADER.length, end.length - PRIVATE_KEY_FOOTER.length)
31
+ .replaceAll("\n", "");
32
+ return Effect.fromResult(Base64.decode(body)).pipe(Effect.mapError(() => new Ed25519KeyError({ stage: "import" })));
33
+ }
34
+ /** Imports one Ed25519 PKCS#8 key through Web Crypto, extractable only when asked. */
35
+ function importPkcs8(der, extractable) {
36
+ return Effect.tryPromise({
37
+ catch: () => new Ed25519KeyError({ stage: "import" }),
38
+ try: () => globalThis.crypto.subtle.importKey("pkcs8", new Uint8Array(der), { name: "Ed25519" }, extractable, ["sign"]),
39
+ });
40
+ }
41
+ /** Encodes DER bytes as PEM text with 64-character lines, the layout that Node writes. */
42
+ function encodePem(der, header, footer) {
43
+ const base64 = Base64.encode(der);
44
+ let body = "";
45
+ for (let offset = 0; offset < base64.length; offset += PEM_LINE_LENGTH) {
46
+ body += `${base64.slice(offset, offset + PEM_LINE_LENGTH)}\n`;
47
+ }
48
+ return `${header}${body}${footer}\n`;
49
+ }
50
+ /** Imports one unencrypted Ed25519 PKCS#8 PEM private key as a non-extractable signing key. */
51
+ const importPrivateKey = Effect.fn("AksaraContracts.importEd25519PrivateKey")(function* (privateKeyPem) {
52
+ const der = yield* decodePrivateKeyPem(privateKeyPem);
53
+ return yield* importPkcs8(der, false);
54
+ });
55
+ /** Reads the 32 raw public-key bytes from the `x` member of an exported Ed25519 JSON Web Key. */
56
+ export const ed25519PublicKeyBytes = Effect.fn("AksaraContracts.ed25519PublicKeyBytes")(function* (x) {
57
+ const bytes = yield* Effect.fromResult(Base64Url.decode(x ?? "")).pipe(Effect.mapError(() => new Ed25519KeyError({ stage: "derive" })));
58
+ if (bytes.byteLength !== ED25519_PUBLIC_KEY_BYTES) {
59
+ return yield* new Ed25519KeyError({ stage: "derive" });
60
+ }
61
+ return bytes;
62
+ });
63
+ /** Derives the SPKI PEM public key of one Ed25519 PKCS#8 private key PEM. */
64
+ export const ed25519PublicKeyPem = Effect.fn("AksaraContracts.ed25519PublicKeyPem")(function* (privateKeyPem) {
65
+ const der = yield* decodePrivateKeyPem(privateKeyPem);
66
+ const key = yield* importPkcs8(der, true);
67
+ const jwk = yield* Effect.tryPromise({
68
+ catch: () => new Ed25519KeyError({ stage: "derive" }),
69
+ try: () => globalThis.crypto.subtle.exportKey("jwk", key),
70
+ });
71
+ const publicKey = yield* ed25519PublicKeyBytes(jwk.x);
72
+ const spki = new Uint8Array(ED25519_SPKI_HEADER.byteLength + ED25519_PUBLIC_KEY_BYTES);
73
+ spki.set(ED25519_SPKI_HEADER);
74
+ spki.set(publicKey, ED25519_SPKI_HEADER.byteLength);
75
+ return encodePem(spki, PUBLIC_KEY_HEADER, PUBLIC_KEY_FOOTER);
76
+ });
77
+ /** Generates one Ed25519 key pair as PKCS#8 and SPKI PEM text, from a random seed. */
78
+ export const generateEd25519KeyPem = Effect.fn("AksaraContracts.generateEd25519KeyPem")(function* () {
79
+ const seed = yield* webCryptoService
80
+ .randomBytes(ED25519_SEED_BYTES)
81
+ .pipe(Effect.orDie);
82
+ const der = new Uint8Array(ED25519_PKCS8_HEADER.byteLength + seed.byteLength);
83
+ der.set(ED25519_PKCS8_HEADER);
84
+ der.set(seed, ED25519_PKCS8_HEADER.byteLength);
85
+ const privateKeyPem = encodePem(der, PRIVATE_KEY_HEADER, PRIVATE_KEY_FOOTER);
86
+ return {
87
+ privateKeyPem,
88
+ publicKeyPem: yield* ed25519PublicKeyPem(privateKeyPem),
89
+ };
90
+ });
91
+ /** Signs one exact message with an imported Ed25519 key, returning the raw 64-byte signature. */
92
+ const signBytes = Effect.fn("AksaraContracts.signEd25519")(function* (privateKey, message) {
93
+ const signature = yield* Effect.tryPromise({
94
+ catch: () => new Ed25519KeyError({ stage: "sign" }),
95
+ try: () => globalThis.crypto.subtle.sign("Ed25519", privateKey, new Uint8Array(message)),
96
+ });
97
+ return new Uint8Array(signature);
98
+ });
99
+ /** Signs the UTF-8 bytes of one canonical message with an unencrypted Ed25519 PKCS#8 PEM private key, returning the unpadded base64url signature. */
100
+ export const signEd25519Message = Effect.fn("AksaraContracts.signEd25519Message")(function* (privateKeyPem, message) {
101
+ const privateKey = yield* importPrivateKey(privateKeyPem);
102
+ const signature = yield* signBytes(privateKey, new TextEncoder().encode(message));
103
+ return Ed25519SignatureSchema.make(Base64Url.encode(signature));
104
+ });
@@ -5,41 +5,53 @@ export declare const ContentSignatureSubjectSchema: Schema.Literals<readonly ["a
5
5
  export type ContentSignatureSubject = typeof ContentSignatureSubjectSchema.Type;
6
6
  declare const SigningKeyNotFoundError_base: Schema.Class<SigningKeyNotFoundError, Schema.TaggedStruct<"SigningKeyNotFoundError", {
7
7
  readonly keyId: Schema.brand<Schema.String, "@NakafaAI/AksaraSigningKeyId">;
8
- }>, import("effect/Cause").YieldableError>;
8
+ }>, import("effect/Cause").YieldableError & {
9
+ readonly brand: unique symbol;
10
+ }>;
9
11
  /** No trusted public key exists for the requested key identifier. */
10
12
  export declare class SigningKeyNotFoundError extends SigningKeyNotFoundError_base {
11
13
  }
12
14
  declare const SigningKeyResolutionError_base: Schema.Class<SigningKeyResolutionError, Schema.TaggedStruct<"SigningKeyResolutionError", {
13
15
  readonly keyId: Schema.brand<Schema.String, "@NakafaAI/AksaraSigningKeyId">;
14
- }>, import("effect/Cause").YieldableError>;
16
+ }>, import("effect/Cause").YieldableError & {
17
+ readonly brand: unique symbol;
18
+ }>;
15
19
  /** The trusted key source could not resolve the requested public key. */
16
20
  export declare class SigningKeyResolutionError extends SigningKeyResolutionError_base {
17
21
  }
18
22
  declare const PublicKeyParseError_base: Schema.Class<PublicKeyParseError, Schema.TaggedStruct<"PublicKeyParseError", {
19
23
  readonly keyId: Schema.brand<Schema.String, "@NakafaAI/AksaraSigningKeyId">;
20
24
  readonly subject: Schema.Literals<readonly ["artifact", "release", "tryout-runtime-bundle"]>;
21
- }>, import("effect/Cause").YieldableError>;
25
+ }>, import("effect/Cause").YieldableError & {
26
+ readonly brand: unique symbol;
27
+ }>;
22
28
  /** A resolved public key could not be parsed without exposing its contents. */
23
29
  export declare class PublicKeyParseError extends PublicKeyParseError_base {
24
30
  }
25
31
  declare const PublicKeyTypeError_base: Schema.Class<PublicKeyTypeError, Schema.TaggedStruct<"PublicKeyTypeError", {
26
32
  readonly keyId: Schema.brand<Schema.String, "@NakafaAI/AksaraSigningKeyId">;
27
33
  readonly subject: Schema.Literals<readonly ["artifact", "release", "tryout-runtime-bundle"]>;
28
- }>, import("effect/Cause").YieldableError>;
34
+ }>, import("effect/Cause").YieldableError & {
35
+ readonly brand: unique symbol;
36
+ }>;
29
37
  /** A resolved public key is not an Ed25519 verification key. */
30
38
  export declare class PublicKeyTypeError extends PublicKeyTypeError_base {
31
39
  }
32
40
  declare const SignatureCheckError_base: Schema.Class<SignatureCheckError, Schema.TaggedStruct<"SignatureCheckError", {
33
41
  readonly keyId: Schema.brand<Schema.String, "@NakafaAI/AksaraSigningKeyId">;
34
42
  readonly subject: Schema.Literals<readonly ["artifact", "release", "tryout-runtime-bundle"]>;
35
- }>, import("effect/Cause").YieldableError>;
43
+ }>, import("effect/Cause").YieldableError & {
44
+ readonly brand: unique symbol;
45
+ }>;
36
46
  /** Web Crypto could not complete an Ed25519 verification operation. */
37
47
  export declare class SignatureCheckError extends SignatureCheckError_base {
38
48
  }
39
49
  declare const SignatureInvalidError_base: Schema.Class<SignatureInvalidError, Schema.TaggedStruct<"SignatureInvalidError", {
40
50
  readonly keyId: Schema.brand<Schema.String, "@NakafaAI/AksaraSigningKeyId">;
41
51
  readonly subject: Schema.Literals<readonly ["artifact", "release", "tryout-runtime-bundle"]>;
42
- }>, import("effect/Cause").YieldableError>;
52
+ }>, import("effect/Cause").YieldableError & {
53
+ readonly brand: unique symbol;
54
+ }>;
43
55
  /** The signature does not authenticate the supplied canonical bytes. */
44
56
  export declare class SignatureInvalidError extends SignatureInvalidError_base {
45
57
  }
@@ -13,16 +13,28 @@ export class SigningKeyNotFoundError extends Schema.TaggedError()("SigningKeyNot
13
13
  export class SigningKeyResolutionError extends Schema.TaggedError()("SigningKeyResolutionError", { keyId: SigningKeyIdSchema }) {
14
14
  }
15
15
  /** A resolved public key could not be parsed without exposing its contents. */
16
- export class PublicKeyParseError extends Schema.TaggedError()("PublicKeyParseError", { keyId: SigningKeyIdSchema, subject: ContentSignatureSubjectSchema }) {
16
+ export class PublicKeyParseError extends Schema.TaggedError()("PublicKeyParseError", {
17
+ keyId: SigningKeyIdSchema,
18
+ subject: ContentSignatureSubjectSchema,
19
+ }) {
17
20
  }
18
21
  /** A resolved public key is not an Ed25519 verification key. */
19
- export class PublicKeyTypeError extends Schema.TaggedError()("PublicKeyTypeError", { keyId: SigningKeyIdSchema, subject: ContentSignatureSubjectSchema }) {
22
+ export class PublicKeyTypeError extends Schema.TaggedError()("PublicKeyTypeError", {
23
+ keyId: SigningKeyIdSchema,
24
+ subject: ContentSignatureSubjectSchema,
25
+ }) {
20
26
  }
21
27
  /** Web Crypto could not complete an Ed25519 verification operation. */
22
- export class SignatureCheckError extends Schema.TaggedError()("SignatureCheckError", { keyId: SigningKeyIdSchema, subject: ContentSignatureSubjectSchema }) {
28
+ export class SignatureCheckError extends Schema.TaggedError()("SignatureCheckError", {
29
+ keyId: SigningKeyIdSchema,
30
+ subject: ContentSignatureSubjectSchema,
31
+ }) {
23
32
  }
24
33
  /** The signature does not authenticate the supplied canonical bytes. */
25
- export class SignatureInvalidError extends Schema.TaggedError()("SignatureInvalidError", { keyId: SigningKeyIdSchema, subject: ContentSignatureSubjectSchema }) {
34
+ export class SignatureInvalidError extends Schema.TaggedError()("SignatureInvalidError", {
35
+ keyId: SigningKeyIdSchema,
36
+ subject: ContentSignatureSubjectSchema,
37
+ }) {
26
38
  }
27
39
  /** Server-side trust seam for resolving reviewed Ed25519 public keys. */
28
40
  export class ContentVerificationKeyResolver extends Context.Service()("@nakafa/aksara-contracts/signature/spec/ContentVerificationKeyResolver") {