@moltzap/identity 2026.902.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 (81) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +19 -0
  3. package/README.md +31 -0
  4. package/bin/moltzap-registry +9 -0
  5. package/dist/agent-card.d.ts +69 -0
  6. package/dist/agent-card.d.ts.map +1 -0
  7. package/dist/agent-card.js +257 -0
  8. package/dist/agent-card.js.map +1 -0
  9. package/dist/agent-key.d.ts +77 -0
  10. package/dist/agent-key.d.ts.map +1 -0
  11. package/dist/agent-key.js +251 -0
  12. package/dist/agent-key.js.map +1 -0
  13. package/dist/authenticated-http.d.ts +44 -0
  14. package/dist/authenticated-http.d.ts.map +1 -0
  15. package/dist/authenticated-http.js +226 -0
  16. package/dist/authenticated-http.js.map +1 -0
  17. package/dist/canonical-json.d.ts +40 -0
  18. package/dist/canonical-json.d.ts.map +1 -0
  19. package/dist/canonical-json.js +399 -0
  20. package/dist/canonical-json.js.map +1 -0
  21. package/dist/http-errors.d.ts +115 -0
  22. package/dist/http-errors.d.ts.map +1 -0
  23. package/dist/http-errors.js +55 -0
  24. package/dist/http-errors.js.map +1 -0
  25. package/dist/http-signature.d.ts +60 -0
  26. package/dist/http-signature.d.ts.map +1 -0
  27. package/dist/http-signature.js +337 -0
  28. package/dist/http-signature.js.map +1 -0
  29. package/dist/identifiers.d.ts +32 -0
  30. package/dist/identifiers.d.ts.map +1 -0
  31. package/dist/identifiers.js +55 -0
  32. package/dist/identifiers.js.map +1 -0
  33. package/dist/index.d.ts +33 -0
  34. package/dist/index.d.ts.map +1 -0
  35. package/dist/index.js +34 -0
  36. package/dist/index.js.map +1 -0
  37. package/dist/registry/admission.d.ts +27 -0
  38. package/dist/registry/admission.d.ts.map +1 -0
  39. package/dist/registry/admission.js +107 -0
  40. package/dist/registry/admission.js.map +1 -0
  41. package/dist/registry/client.d.ts +20 -0
  42. package/dist/registry/client.d.ts.map +1 -0
  43. package/dist/registry/client.js +250 -0
  44. package/dist/registry/client.js.map +1 -0
  45. package/dist/registry/contract.d.ts +213 -0
  46. package/dist/registry/contract.d.ts.map +1 -0
  47. package/dist/registry/contract.js +132 -0
  48. package/dist/registry/contract.js.map +1 -0
  49. package/dist/registry/http.d.ts +27 -0
  50. package/dist/registry/http.d.ts.map +1 -0
  51. package/dist/registry/http.js +258 -0
  52. package/dist/registry/http.js.map +1 -0
  53. package/dist/registry/migrations/0001_registry.d.ts +6 -0
  54. package/dist/registry/migrations/0001_registry.d.ts.map +1 -0
  55. package/dist/registry/migrations/0001_registry.js +36 -0
  56. package/dist/registry/migrations/0001_registry.js.map +1 -0
  57. package/dist/registry/rpc.d.ts +138 -0
  58. package/dist/registry/rpc.d.ts.map +1 -0
  59. package/dist/registry/rpc.js +85 -0
  60. package/dist/registry/rpc.js.map +1 -0
  61. package/dist/registry/server.d.ts +52 -0
  62. package/dist/registry/server.d.ts.map +1 -0
  63. package/dist/registry/server.js +157 -0
  64. package/dist/registry/server.js.map +1 -0
  65. package/dist/registry/storage.d.ts +62 -0
  66. package/dist/registry/storage.d.ts.map +1 -0
  67. package/dist/registry/storage.js +341 -0
  68. package/dist/registry/storage.js.map +1 -0
  69. package/dist/registry.d.ts +34 -0
  70. package/dist/registry.d.ts.map +1 -0
  71. package/dist/registry.js +13 -0
  72. package/dist/registry.js.map +1 -0
  73. package/dist/signed-message.d.ts +54 -0
  74. package/dist/signed-message.d.ts.map +1 -0
  75. package/dist/signed-message.js +289 -0
  76. package/dist/signed-message.js.map +1 -0
  77. package/dist/version.d.ts +4 -0
  78. package/dist/version.d.ts.map +1 -0
  79. package/dist/version.js +4 -0
  80. package/dist/version.js.map +1 -0
  81. package/package.json +139 -0
@@ -0,0 +1,40 @@
1
+ /** @file Exact canonical JSON parsing and encoding for identity boundaries. */
2
+ import { Effect, Schema } from "effect";
3
+ type JsonValue = null | boolean | number | string | readonly JsonValue[] | {
4
+ readonly [key: string]: JsonValue;
5
+ };
6
+ declare const CanonicalJsonError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
7
+ readonly _tag: "CanonicalJsonError";
8
+ } & Readonly<A>;
9
+ /** Canonical JSON decoding or encoding failed without exposing its cause. */
10
+ export declare class CanonicalJsonError extends CanonicalJsonError_base {
11
+ }
12
+ /**
13
+ * Parses already-bounded bytes and returns a value only when the original
14
+ * bytes are the value's canonical UTF-8 representation.
15
+ *
16
+ * @param bytes Bounded candidate representation.
17
+ * @returns The parsed JSON value.
18
+ * @failure CanonicalJsonError when UTF-8, JSON, domain, or canonical-byte
19
+ * validation fails.
20
+ */
21
+ export declare const parseCanonicalJson: (bytes: Uint8Array) => Effect.Effect<JsonValue, CanonicalJsonError>;
22
+ /**
23
+ * Decodes canonical JSON bytes through one exact domain Schema.
24
+ *
25
+ * @param schema Closed domain Schema.
26
+ * @param bytes Bounded canonical JSON bytes.
27
+ * @returns The decoded domain value.
28
+ * @failure CanonicalJsonError when representation or domain validation fails.
29
+ */
30
+ export declare const decodeCanonicalJson: <A, I, R>(schema: Schema.Schema<A, I, R>, bytes: Uint8Array) => Effect.Effect<A, CanonicalJsonError, R>;
31
+ /**
32
+ * Encodes a JSON-domain value as canonical UTF-8 bytes.
33
+ *
34
+ * @param value Candidate JSON-domain value.
35
+ * @returns Canonical UTF-8 bytes.
36
+ * @failure CanonicalJsonError when the value is outside the JSON domain.
37
+ */
38
+ export declare const encodeCanonicalJson: (value: unknown) => Effect.Effect<Uint8Array, CanonicalJsonError>;
39
+ export {};
40
+ //# sourceMappingURL=canonical-json.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"canonical-json.d.ts","sourceRoot":"","sources":["../src/canonical-json.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAG/E,OAAO,EAAQ,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAkB9C,KAAK,SAAS,GACV,IAAI,GACJ,OAAO,GACP,MAAM,GACN,MAAM,GACN,SAAS,SAAS,EAAE,GACpB;IAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;;;;AAmZ1C,6EAA6E;AAC7E,qBAAa,kBAAmB,SAAQ,uBAEvC;CAAG;AAiCJ;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,UACtB,UAAU,KAChB,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,kBAAkB,CAwBE,CAAC;AAEjD;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,GAAI,CAAC,EAAE,CAAC,EAAE,CAAC,UACjC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,SACvB,UAAU,KAChB,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,kBAAkB,EAAE,CAAC,CAStC,CAAC;AAEJ;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,UACvB,OAAO,KACb,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,kBAAkB,CAY5C,CAAC"}
@@ -0,0 +1,399 @@
1
+ /** @file Exact canonical JSON parsing and encoding for identity boundaries. */
2
+ import canonicalize from "canonicalize";
3
+ import { Data, Effect, Schema } from "effect";
4
+ import { types as nodeTypes } from "node:util";
5
+ const MAXIMUM_CONTAINER_DEPTH = 16;
6
+ const MAXIMUM_ARRAY_INDEX = 4_294_967_294;
7
+ const utf8Decoder = new TextDecoder("utf-8", { fatal: true });
8
+ const utf8Encoder = new TextEncoder();
9
+ const createObject = Object.create;
10
+ const defineProperty = Object.defineProperty;
11
+ const freezeObject = Object.freeze;
12
+ const getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
13
+ const getPrototypeOf = Object.getPrototypeOf;
14
+ const numberFrom = Number;
15
+ const numberIsFinite = Number.isFinite;
16
+ const numberIsInteger = Number.isInteger;
17
+ const ownKeys = Reflect.ownKeys;
18
+ const invalidJsonSnapshot = () => ({ valid: false });
19
+ const validJsonSnapshot = (value) => ({
20
+ valid: true,
21
+ value,
22
+ });
23
+ const isHighSurrogate = (codeUnit) => codeUnit >= 0xd800 && codeUnit <= 0xdbff;
24
+ const isLowSurrogate = (codeUnit) => codeUnit >= 0xdc00 && codeUnit <= 0xdfff;
25
+ const hasWellFormedUnicode = (value) => {
26
+ if (typeof value !== "string") {
27
+ return false;
28
+ }
29
+ for (let index = 0; index < value.length; index += 1) {
30
+ const codeUnit = value.charCodeAt(index);
31
+ if (isLowSurrogate(codeUnit)) {
32
+ return false;
33
+ }
34
+ if (!isHighSurrogate(codeUnit)) {
35
+ continue;
36
+ }
37
+ index += 1;
38
+ if (index >= value.length || !isLowSurrogate(value.charCodeAt(index))) {
39
+ return false;
40
+ }
41
+ }
42
+ return true;
43
+ };
44
+ const arrayConstructor = Array;
45
+ const arrayIsArray = Array.isArray;
46
+ const arrayPrototype = Array.prototype;
47
+ const jsonObject = JSON;
48
+ const objectConstructor = Object;
49
+ const objectPrototype = Object.prototype;
50
+ const setConstructor = Set;
51
+ const setPrototype = Set.prototype;
52
+ const isPlainRecord = (value) => {
53
+ const prototype = getPrototypeOf(value);
54
+ return prototype === objectPrototype || prototype === null;
55
+ };
56
+ const findArrayIteratorPrototype = () => {
57
+ const candidate = getPrototypeOf([][Symbol.iterator]());
58
+ if (candidate === null || typeof candidate !== "object") {
59
+ return objectPrototype;
60
+ }
61
+ return candidate;
62
+ };
63
+ const arrayIteratorPrototype = findArrayIteratorPrototype();
64
+ const captureCanonicalizerDependency = (owner, property) => {
65
+ const descriptor = getOwnPropertyDescriptor(owner, property);
66
+ const dependency = descriptor === undefined
67
+ ? { descriptorFound: false, owner, property }
68
+ : {
69
+ descriptor,
70
+ descriptorFound: true,
71
+ owner,
72
+ property,
73
+ };
74
+ return freezeObject(dependency);
75
+ };
76
+ const canonicalizerDependencies = [
77
+ captureCanonicalizerDependency(globalThis, "Array"),
78
+ captureCanonicalizerDependency(arrayConstructor, "isArray"),
79
+ captureCanonicalizerDependency(arrayConstructor, "prototype"),
80
+ captureCanonicalizerDependency(arrayConstructor, Symbol.species),
81
+ captureCanonicalizerDependency(arrayPrototype, "constructor"),
82
+ captureCanonicalizerDependency(arrayPrototype, Symbol.iterator),
83
+ captureCanonicalizerDependency(arrayPrototype, "join"),
84
+ captureCanonicalizerDependency(arrayPrototype, "map"),
85
+ captureCanonicalizerDependency(arrayPrototype, "push"),
86
+ captureCanonicalizerDependency(arrayPrototype, "sort"),
87
+ captureCanonicalizerDependency(arrayIteratorPrototype, "next"),
88
+ captureCanonicalizerDependency(globalThis, "isFinite"),
89
+ captureCanonicalizerDependency(globalThis, "isNaN"),
90
+ captureCanonicalizerDependency(globalThis, "JSON"),
91
+ captureCanonicalizerDependency(jsonObject, "parse"),
92
+ captureCanonicalizerDependency(jsonObject, "stringify"),
93
+ captureCanonicalizerDependency(globalThis, "Object"),
94
+ captureCanonicalizerDependency(objectConstructor, "keys"),
95
+ captureCanonicalizerDependency(objectConstructor, "prototype"),
96
+ captureCanonicalizerDependency(globalThis, "Set"),
97
+ captureCanonicalizerDependency(setConstructor, "prototype"),
98
+ captureCanonicalizerDependency(setPrototype, "add"),
99
+ captureCanonicalizerDependency(setPrototype, "delete"),
100
+ captureCanonicalizerDependency(setPrototype, "has"),
101
+ ];
102
+ const hasMatchingDataDescriptor = (current, expected) => {
103
+ if (!("value" in current) || !("value" in expected)) {
104
+ return false;
105
+ }
106
+ return (current.value === expected.value && current.writable === expected.writable);
107
+ };
108
+ const hasMatchingAccessorDescriptor = (current, expected) => {
109
+ if ("value" in current || "value" in expected) {
110
+ return false;
111
+ }
112
+ return current.get === expected.get && current.set === expected.set;
113
+ };
114
+ const hasExpectedDescriptor = (dependency) => {
115
+ if (!dependency.descriptorFound) {
116
+ return false;
117
+ }
118
+ const current = getOwnPropertyDescriptor(dependency.owner, dependency.property);
119
+ if (current === undefined) {
120
+ return false;
121
+ }
122
+ if (current.configurable !== dependency.descriptor.configurable ||
123
+ current.enumerable !== dependency.descriptor.enumerable) {
124
+ return false;
125
+ }
126
+ return "value" in dependency.descriptor
127
+ ? hasMatchingDataDescriptor(current, dependency.descriptor)
128
+ : hasMatchingAccessorDescriptor(current, dependency.descriptor);
129
+ };
130
+ const hasExpectedCanonicalizerPrototypeChain = () => {
131
+ if (getOwnPropertyDescriptor(arrayPrototype, "toJSON") !== undefined) {
132
+ return false;
133
+ }
134
+ if (getOwnPropertyDescriptor(objectPrototype, "toJSON") !== undefined) {
135
+ return false;
136
+ }
137
+ if (getPrototypeOf(arrayPrototype) !== objectPrototype) {
138
+ return false;
139
+ }
140
+ if (getPrototypeOf(objectPrototype) !== null) {
141
+ return false;
142
+ }
143
+ return getPrototypeOf(setPrototype) === objectPrototype;
144
+ };
145
+ const isArrayIndexName = (key) => {
146
+ const numericKey = numberFrom(key);
147
+ if (!numberIsInteger(numericKey)) {
148
+ return false;
149
+ }
150
+ if (numericKey < 0 || numericKey > MAXIMUM_ARRAY_INDEX) {
151
+ return false;
152
+ }
153
+ return `${numericKey}` === key;
154
+ };
155
+ const hasIndexedPrototypeProperty = (prototype) => {
156
+ const keys = ownKeys(prototype);
157
+ let index = 0;
158
+ while (index < keys.length) {
159
+ const key = keys[index];
160
+ if (typeof key === "string" && isArrayIndexName(key)) {
161
+ return true;
162
+ }
163
+ index += 1;
164
+ }
165
+ return false;
166
+ };
167
+ const canonicalizeRuntimeIsIntact = () => {
168
+ let index = 0;
169
+ // Index traversal cannot be bypassed by replacing the iterator that the
170
+ // canonicalizer itself uses.
171
+ while (index < canonicalizerDependencies.length) {
172
+ const dependency = canonicalizerDependencies[index];
173
+ if (dependency === undefined || !hasExpectedDescriptor(dependency)) {
174
+ return false;
175
+ }
176
+ index += 1;
177
+ }
178
+ if (!hasExpectedCanonicalizerPrototypeChain()) {
179
+ return false;
180
+ }
181
+ // The canonicalizer creates ordinary arrays through assignment and push,
182
+ // so inherited index properties could intercept its internal writes.
183
+ if (hasIndexedPrototypeProperty(arrayPrototype)) {
184
+ return false;
185
+ }
186
+ return !hasIndexedPrototypeProperty(objectPrototype);
187
+ };
188
+ const readArrayLength = (value) => {
189
+ const descriptor = getOwnPropertyDescriptor(value, "length");
190
+ if (descriptor === undefined) {
191
+ return undefined;
192
+ }
193
+ if (descriptor.enumerable === true || !("value" in descriptor)) {
194
+ return undefined;
195
+ }
196
+ return typeof descriptor.value === "number" ? descriptor.value : undefined;
197
+ };
198
+ const snapshotJsonArray = (value, context, visit) => {
199
+ const length = readArrayLength(value);
200
+ if (length === undefined) {
201
+ return invalidJsonSnapshot();
202
+ }
203
+ // Parsed JSON arrays own only length and one enumerable data property
204
+ // per index, so other shapes never reach the canonicalizer.
205
+ if (ownKeys(value).length !== length + 1) {
206
+ return invalidJsonSnapshot();
207
+ }
208
+ const snapshot = [];
209
+ for (let index = 0; index < length; index += 1) {
210
+ const descriptor = getOwnPropertyDescriptor(value, String(index));
211
+ if (descriptor === undefined ||
212
+ descriptor.enumerable !== true ||
213
+ !("value" in descriptor)) {
214
+ return invalidJsonSnapshot();
215
+ }
216
+ const item = visit(descriptor.value, context);
217
+ if (!item.valid) {
218
+ return invalidJsonSnapshot();
219
+ }
220
+ defineProperty(snapshot, String(index), {
221
+ configurable: false,
222
+ enumerable: true,
223
+ value: item.value,
224
+ writable: false,
225
+ });
226
+ }
227
+ return validJsonSnapshot(freezeObject(snapshot));
228
+ };
229
+ const snapshotJsonRecord = (value, context, visit) => {
230
+ // eslint-disable-next-line agent-code-guard/require-assertion-rationale -- Object.create(null) produces the exact string-indexed record populated only through validated data descriptors below.
231
+ const snapshot = createObject(null);
232
+ const keys = ownKeys(value);
233
+ let index = 0;
234
+ // Index traversal keeps validation independent of ambient array iteration.
235
+ while (index < keys.length) {
236
+ const key = keys[index];
237
+ if (typeof key !== "string" || !hasWellFormedUnicode(key)) {
238
+ return invalidJsonSnapshot();
239
+ }
240
+ const descriptor = getOwnPropertyDescriptor(value, key);
241
+ if (descriptor === undefined ||
242
+ descriptor.enumerable !== true ||
243
+ !("value" in descriptor)) {
244
+ return invalidJsonSnapshot();
245
+ }
246
+ const member = visit(descriptor.value, context);
247
+ if (!member.valid) {
248
+ return invalidJsonSnapshot();
249
+ }
250
+ defineProperty(snapshot, key, {
251
+ configurable: false,
252
+ enumerable: true,
253
+ value: member.value,
254
+ writable: false,
255
+ });
256
+ index += 1;
257
+ }
258
+ return validJsonSnapshot(freezeObject(snapshot));
259
+ };
260
+ const snapshotJsonContainer = (value, context, visit) => {
261
+ const nextDepth = context.containerDepth + 1;
262
+ // A Proxy can execute arbitrary code during reflection, so it is not a
263
+ // JSON data container and fails before any trap is consulted.
264
+ if (nextDepth > MAXIMUM_CONTAINER_DEPTH ||
265
+ context.ancestors.has(value) ||
266
+ nodeTypes.isProxy(value)) {
267
+ return invalidJsonSnapshot();
268
+ }
269
+ context.ancestors.add(value);
270
+ const nestedContext = { ...context, containerDepth: nextDepth };
271
+ try {
272
+ if (arrayIsArray(value)) {
273
+ return snapshotJsonArray(value, nestedContext, visit);
274
+ }
275
+ return isPlainRecord(value)
276
+ ? snapshotJsonRecord(value, nestedContext, visit)
277
+ : invalidJsonSnapshot();
278
+ }
279
+ finally {
280
+ context.ancestors.delete(value);
281
+ }
282
+ };
283
+ const visitJsonValue = (value, context) => {
284
+ if (value === null || typeof value === "boolean") {
285
+ return validJsonSnapshot(value);
286
+ }
287
+ if (typeof value === "number") {
288
+ return numberIsFinite(value)
289
+ ? validJsonSnapshot(value)
290
+ : invalidJsonSnapshot();
291
+ }
292
+ if (typeof value === "string") {
293
+ return hasWellFormedUnicode(value)
294
+ ? validJsonSnapshot(value)
295
+ : invalidJsonSnapshot();
296
+ }
297
+ return typeof value === "object"
298
+ ? snapshotJsonContainer(value, context, visitJsonValue)
299
+ : invalidJsonSnapshot();
300
+ };
301
+ const snapshotJsonValue = (root) => {
302
+ // Callers can supply hostile reflection traps. Snapshotting converts
303
+ // those inputs into either inert data or an ordinary validation failure.
304
+ try {
305
+ return visitJsonValue(root, {
306
+ ancestors: new Set(),
307
+ containerDepth: 0,
308
+ });
309
+ // eslint-disable-next-line agent-code-guard/bare-catch -- The snapshot boundary converts hostile reflection into ordinary validation failure. #ignore-sloppy-code-next-line[bare-catch]: The function returns an invalid snapshot.
310
+ }
311
+ catch {
312
+ return invalidJsonSnapshot();
313
+ }
314
+ };
315
+ const jsonValueSchema = Schema.Unknown.pipe(Schema.filter((value) => snapshotJsonValue(value).valid, {
316
+ identifier: "CanonicalJsonValue",
317
+ description: "JSON value with well-formed Unicode and bounded container depth",
318
+ }));
319
+ const jsonTextSchema = Schema.parseJson(jsonValueSchema);
320
+ /** Canonical JSON decoding or encoding failed without exposing its cause. */
321
+ export class CanonicalJsonError extends Data.TaggedError("CanonicalJsonError") {
322
+ }
323
+ const canonicalBytes = (value) => Effect.try({
324
+ try: () => {
325
+ return canonicalizeRuntimeIsIntact() ? canonicalize(value) : undefined;
326
+ },
327
+ catch: () => new CanonicalJsonError(),
328
+ }).pipe(Effect.flatMap((text) => text === undefined
329
+ ? Effect.fail(new CanonicalJsonError())
330
+ : Effect.succeed(utf8Encoder.encode(text))));
331
+ // eslint-disable-next-line @typescript-eslint/unbound-method -- Capturing the intrinsic prevents candidate arrays from replacing the comparison method.
332
+ const everyByte = Uint8Array.prototype.every;
333
+ const sameBytes = (left, right) => {
334
+ try {
335
+ return (everyByte.call(left, (byte, index) => byte === right[index]) &&
336
+ everyByte.call(right, (byte, index) => byte === left[index]));
337
+ // eslint-disable-next-line agent-code-guard/bare-catch -- Detached or exotic typed arrays are non-canonical inputs, not defects. #ignore-sloppy-code-next-line[bare-catch]: The comparison returns false.
338
+ }
339
+ catch {
340
+ return false;
341
+ }
342
+ };
343
+ /**
344
+ * Parses already-bounded bytes and returns a value only when the original
345
+ * bytes are the value's canonical UTF-8 representation.
346
+ *
347
+ * @param bytes Bounded candidate representation.
348
+ * @returns The parsed JSON value.
349
+ * @failure CanonicalJsonError when UTF-8, JSON, domain, or canonical-byte
350
+ * validation fails.
351
+ */
352
+ export const parseCanonicalJson = (bytes) => Effect.gen(function* () {
353
+ if (!canonicalizeRuntimeIsIntact()) {
354
+ return yield* new CanonicalJsonError();
355
+ }
356
+ const text = yield* Effect.try({
357
+ try: () => utf8Decoder.decode(bytes),
358
+ catch: () => new CanonicalJsonError(),
359
+ });
360
+ const parsed = yield* Schema.decodeUnknown(jsonTextSchema)(text).pipe(Effect.catchTag("ParseError", () => Effect.fail(new CanonicalJsonError())));
361
+ const snapshot = snapshotJsonValue(parsed);
362
+ if (!snapshot.valid) {
363
+ return yield* new CanonicalJsonError();
364
+ }
365
+ const value = snapshot.value;
366
+ const encoded = yield* canonicalBytes(value);
367
+ if (!sameBytes(bytes, encoded)) {
368
+ return yield* new CanonicalJsonError();
369
+ }
370
+ return value;
371
+ }).pipe(Effect.withSpan("parseCanonicalJson"));
372
+ /**
373
+ * Decodes canonical JSON bytes through one exact domain Schema.
374
+ *
375
+ * @param schema Closed domain Schema.
376
+ * @param bytes Bounded canonical JSON bytes.
377
+ * @returns The decoded domain value.
378
+ * @failure CanonicalJsonError when representation or domain validation fails.
379
+ */
380
+ export const decodeCanonicalJson = (schema, bytes) => parseCanonicalJson(bytes).pipe(Effect.flatMap(Schema.decodeUnknown(schema, {
381
+ exact: true,
382
+ onExcessProperty: "error",
383
+ })), Effect.catchTag("ParseError", () => Effect.fail(new CanonicalJsonError())));
384
+ /**
385
+ * Encodes a JSON-domain value as canonical UTF-8 bytes.
386
+ *
387
+ * @param value Candidate JSON-domain value.
388
+ * @returns Canonical UTF-8 bytes.
389
+ * @failure CanonicalJsonError when the value is outside the JSON domain.
390
+ */
391
+ export const encodeCanonicalJson = (value) => Effect.sync(() => {
392
+ if (!canonicalizeRuntimeIsIntact()) {
393
+ return invalidJsonSnapshot();
394
+ }
395
+ return snapshotJsonValue(value);
396
+ }).pipe(Effect.flatMap((snapshot) => snapshot.valid
397
+ ? canonicalBytes(snapshot.value)
398
+ : Effect.fail(new CanonicalJsonError())));
399
+ //# sourceMapp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,CAAC,QAAQ,EAAE,EAAE,CAC1B,QAAQ,CAAC,KAAK;IACZ,CAAC,CAAC,cAAc,CAAC,QAAQ,CAAC,KAAK,CAAC;IAChC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,kBAAkB,EAAE,CAAC,CAC1C,CACF,CAAC"}
@@ -0,0 +1,115 @@
1
+ /** @file Closed HTTP envelope failures and their exact response projections. */
2
+ import { Schema } from "effect";
3
+ declare const MalformedRequestError_base: Schema.TaggedErrorClass<MalformedRequestError, "MalformedRequestError", {
4
+ readonly _tag: Schema.tag<"MalformedRequestError">;
5
+ }>;
6
+ /** The request representation is not valid for the selected operation. */
7
+ export declare class MalformedRequestError extends MalformedRequestError_base {
8
+ }
9
+ declare const AuthenticationFailedError_base: Schema.TaggedErrorClass<AuthenticationFailedError, "AuthenticationFailedError", {
10
+ readonly _tag: Schema.tag<"AuthenticationFailedError">;
11
+ }>;
12
+ /** The request does not prove the required identity or admission authority. */
13
+ export declare class AuthenticationFailedError extends AuthenticationFailedError_base {
14
+ }
15
+ declare const RouteNotFoundError_base: Schema.TaggedErrorClass<RouteNotFoundError, "RouteNotFoundError", {
16
+ readonly _tag: Schema.tag<"RouteNotFoundError">;
17
+ }>;
18
+ /** No exact HTTP route owns the request target. */
19
+ export declare class RouteNotFoundError extends RouteNotFoundError_base {
20
+ }
21
+ declare const MethodNotAllowedError_base: Schema.TaggedErrorClass<MethodNotAllowedError, "MethodNotAllowedError", {
22
+ readonly _tag: Schema.tag<"MethodNotAllowedError">;
23
+ }>;
24
+ /** The selected route does not accept the request method. */
25
+ export declare class MethodNotAllowedError extends MethodNotAllowedError_base {
26
+ }
27
+ declare const VersionMismatchError_base: Schema.TaggedErrorClass<VersionMismatchError, "VersionMismatchError", {
28
+ readonly _tag: Schema.tag<"VersionMismatchError">;
29
+ }>;
30
+ /** The request carries a different MoltZap compatibility value. */
31
+ export declare class VersionMismatchError extends VersionMismatchError_base {
32
+ }
33
+ declare const PayloadTooLargeError_base: Schema.TaggedErrorClass<PayloadTooLargeError, "PayloadTooLargeError", {
34
+ readonly _tag: Schema.tag<"PayloadTooLargeError">;
35
+ }>;
36
+ /** The received body exceeds the selected route's derived representation cap. */
37
+ export declare class PayloadTooLargeError extends PayloadTooLargeError_base {
38
+ }
39
+ declare const UnsupportedMediaTypeError_base: Schema.TaggedErrorClass<UnsupportedMediaTypeError, "UnsupportedMediaTypeError", {
40
+ readonly _tag: Schema.tag<"UnsupportedMediaTypeError">;
41
+ }>;
42
+ /** The selected route cannot consume the request content framing. */
43
+ export declare class UnsupportedMediaTypeError extends UnsupportedMediaTypeError_base {
44
+ }
45
+ declare const OverloadedError_base: Schema.TaggedErrorClass<OverloadedError, "OverloadedError", {
46
+ readonly _tag: Schema.tag<"OverloadedError">;
47
+ }>;
48
+ /** A finite immediate resource permit is unavailable. */
49
+ export declare class OverloadedError extends OverloadedError_base {
50
+ }
51
+ declare const UnavailableError_base: Schema.TaggedErrorClass<UnavailableError, "UnavailableError", {
52
+ readonly _tag: Schema.tag<"UnavailableError">;
53
+ }>;
54
+ /** A required service or durable operation cannot currently complete. */
55
+ export declare class UnavailableError extends UnavailableError_base {
56
+ }
57
+ declare const InternalServerError_base: Schema.TaggedErrorClass<InternalServerError, "InternalServerError", {
58
+ readonly _tag: Schema.tag<"InternalServerError">;
59
+ }>;
60
+ /** An unexpected implementation failure prevented a closed result. */
61
+ export declare class InternalServerError extends InternalServerError_base {
62
+ }
63
+ /** Closed failures represented by the shared HTTP error envelope. */
64
+ export type HttpEnvelopeError = MalformedRequestError | AuthenticationFailedError | RouteNotFoundError | MethodNotAllowedError | VersionMismatchError | PayloadTooLargeError | UnsupportedMediaTypeError | OverloadedError | UnavailableError | InternalServerError;
65
+ declare const mappings: Readonly<{
66
+ readonly MalformedRequestError: {
67
+ readonly status: 400;
68
+ readonly code: "malformed";
69
+ };
70
+ readonly AuthenticationFailedError: {
71
+ readonly status: 401;
72
+ readonly code: "authentication_failed";
73
+ };
74
+ readonly RouteNotFoundError: {
75
+ readonly status: 404;
76
+ readonly code: "not_found";
77
+ };
78
+ readonly MethodNotAllowedError: {
79
+ readonly status: 405;
80
+ readonly code: "method_not_allowed";
81
+ };
82
+ readonly VersionMismatchError: {
83
+ readonly status: 412;
84
+ readonly code: "version_mismatch";
85
+ };
86
+ readonly PayloadTooLargeError: {
87
+ readonly status: 413;
88
+ readonly code: "payload_too_large";
89
+ };
90
+ readonly UnsupportedMediaTypeError: {
91
+ readonly status: 415;
92
+ readonly code: "unsupported_media_type";
93
+ };
94
+ readonly OverloadedError: {
95
+ readonly status: 429;
96
+ readonly code: "overloaded";
97
+ };
98
+ readonly UnavailableError: {
99
+ readonly status: 503;
100
+ readonly code: "unavailable";
101
+ };
102
+ readonly InternalServerError: {
103
+ readonly status: 500;
104
+ readonly code: "internal";
105
+ };
106
+ }>;
107
+ /**
108
+ * Private HTTP status and body-code projection for a shared error.
109
+ *
110
+ * @param error Recognized closed HTTP failure.
111
+ * @returns Its exact status and stable body code.
112
+ */
113
+ export declare const httpEnvelope: (error: HttpEnvelopeError) => (typeof mappings)[keyof typeof mappings];
114
+ export {};
115
+ //# sourceMappingURL=http-errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http-errors.d.ts","sourceRoot":"","sources":["../src/http-errors.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAEhF,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;;;;AAEhC,0EAA0E;AAC1E,qBAAa,qBAAsB,SAAQ,0BAG1C;CAAG;;;;AAEJ,+EAA+E;AAC/E,qBAAa,yBAA0B,SAAQ,8BAG9C;CAAG;;;;AAEJ,mDAAmD;AACnD,qBAAa,kBAAmB,SAAQ,uBAGvC;CAAG;;;;AAEJ,6DAA6D;AAC7D,qBAAa,qBAAsB,SAAQ,0BAG1C;CAAG;;;;AAEJ,mEAAmE;AACnE,qBAAa,oBAAqB,SAAQ,yBAGzC;CAAG;;;;AAEJ,iFAAiF;AACjF,qBAAa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. */
2
+ import { Schema } from "effect";
3
+ /** The request representation is not valid for the selected operation. */
4
+ export class MalformedRequestError extends Schema.TaggedError()("MalformedRequestError", {}) {
5
+ }
6
+ /** The request does not prove the required identity or admission authority. */
7
+ export class AuthenticationFailedError extends Schema.TaggedError()("AuthenticationFailedError", {}) {
8
+ }
9
+ /** No exact HTTP route owns the request target. */
10
+ export class RouteNotFoundError extends Schema.TaggedError()("RouteNotFoundError", {}) {
11
+ }
12
+ /** The selected route does not accept the request method. */
13
+ export class MethodNotAllowedError extends Schema.TaggedError()("MethodNotAllowedError", {}) {
14
+ }
15
+ /** The request carries a different MoltZap compatibility value. */
16
+ export class VersionMismatchError extends Schema.TaggedError()("VersionMismatchError", {}) {
17
+ }
18
+ /** The received body exceeds the selected route's derived representation cap. */
19
+ export class PayloadTooLargeError extends Schema.TaggedError()("PayloadTooLargeError", {}) {
20
+ }
21
+ /** The selected route cannot consume the request content framing. */
22
+ export class UnsupportedMediaTypeError extends Schema.TaggedError()("UnsupportedMediaTypeError", {}) {
23
+ }
24
+ /** A finite immediate resource permit is unavailable. */
25
+ export class OverloadedError extends Schema.TaggedError()("OverloadedError", {}) {
26
+ }
27
+ /** A required service or durable operation cannot currently complete. */
28
+ export class UnavailableError extends Schema.TaggedError()("UnavailableError", {}) {
29
+ }
30
+ /** An unexpected implementation failure prevented a closed result. */
31
+ export class InternalServerError extends Schema.TaggedError()("InternalServerError", {}) {
32
+ }
33
+ const mappings = Object.freeze({
34
+ MalformedRequestError: { status: 400, code: "malformed" },
35
+ AuthenticationFailedError: { status: 401, code: "authentication_failed" },
36
+ RouteNotFoundError: { status: 404, code: "not_found" },
37
+ MethodNotAllowedError: { status: 405, code: "method_not_allowed" },
38
+ VersionMismatchError: { status: 412, code: "version_mismatch" },
39
+ PayloadTooLargeError: { status: 413, code: "payload_too_large" },
40
+ UnsupportedMediaTypeError: {
41
+ status: 415,
42
+ code: "unsupported_media_type",
43
+ },
44
+ OverloadedError: { status: 429, code: "overloaded" },
45
+ UnavailableError: { status: 503, code: "unavailable" },
46
+ InternalServerError: { status: 500, code: "internal" },
47
+ });
48
+ /**
49
+ * Private HTTP status and body-code projection for a shared error.
50
+ *
51
+ * @param error Recognized closed HTTP failure.
52
+ * @returns Its exact status and stable body code.
53
+ */
54
+ export const httpEnvelope = (error) => mappings[error._tag];
55
+ //# sourceMappingURL=http-errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http-errors.js","sourceRoot":"","sources":["../src/http-errors.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAEhF,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,0EAA0E;AAC1E,MAAM,OAAO,qBAAsB,SAAQ,MAAM,CAAC,WAAW,EAAyB,CACpF,uBAAuB,EACvB,EAAE,CACH;CAAG;AAEJ,+EAA+E;AAC/E,MAAM,OAAO,yBAA0B,SAAQ,MAAM,CAAC,WAAW,EAA6B,CAC5F,2BAA2B,EAC3B,EAAE,CACH;CAAG;AAEJ,mDAAmD;AACnD,MAAM,OAAO,kBAAmB,SAAQ,MAAM,CAAC,WAAW,EAAsB,CAC9E,oBAAoB,EACpB,EAAE,CACH;CAAG;AAEJ,6DAA6D;AAC7D,MAAM,OAAO,qBAAsB,SAAQ,MAAM,CAAC,WAAW,EAAyB,CACpF,uBAAuB,EACvB,EAAE,CACH;CAAG;AAEJ,mEAAmE;AACnE,MAAM,OAAO,oBAAqB,SAAQ,MAAM,CAAC,WAAW,EAAwB,CAClF,sBAAsB,EACtB,EAAE,CACH;CAAG;AAEJ,iFAAiF;AACjF,MAAM,OAAO,oBAAqB,SAAQ,MAAM,CAAC,WAAW,EAAwB,CAClF,sBAAsB,EACtB,EAAE,CACH;CAAG;AAEJ,qEAAqE;AACrE,MAAM,OAAO,yBAA0B,SAAQ,MAAM,CAAC,WAAW,EAA6B,CAC5F,2BAA2B,EAC3B,EAAE,CACH;CAAG;AAEJ,yDAAyD;AACzD,MAAM,OAAO,eAAgB,SAAQ,MAAM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