@agntn/registries 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/README.md +26 -3
  2. package/dist/THIRD-PARTY-LICENSES.md +36 -0
  3. package/dist/_chunks/cache.mjs +15 -0
  4. package/dist/{cache/index.mjs.map → _chunks/cache.mjs.map} +1 -1
  5. package/dist/{commands/cache.mjs → _chunks/cache2.mjs} +6 -8
  6. package/dist/_chunks/cache2.mjs.map +1 -0
  7. package/dist/{cache → _chunks}/cached-registry.mjs +12 -8
  8. package/dist/_chunks/cached-registry.mjs.map +1 -0
  9. package/dist/{commands → _chunks}/deps.mjs +19 -13
  10. package/dist/_chunks/deps.mjs.map +1 -0
  11. package/dist/_chunks/helpers.mjs +53 -19
  12. package/dist/_chunks/helpers.mjs.map +1 -1
  13. package/dist/_chunks/index.d.mts +9 -23
  14. package/dist/_chunks/index.d.mts.map +1 -1
  15. package/dist/_chunks/index2.d.mts +181 -0
  16. package/dist/_chunks/index2.d.mts.map +1 -0
  17. package/dist/_chunks/index3.d.mts +188 -0
  18. package/dist/_chunks/index3.d.mts.map +1 -0
  19. package/dist/_chunks/info.mjs +105 -0
  20. package/dist/_chunks/info.mjs.map +1 -0
  21. package/dist/_chunks/libs/typebox.mjs +278 -0
  22. package/dist/_chunks/libs/typebox.mjs.map +1 -0
  23. package/dist/_chunks/lockfile.mjs +183 -0
  24. package/dist/_chunks/lockfile.mjs.map +1 -0
  25. package/dist/_chunks/maintainers.mjs +53 -0
  26. package/dist/_chunks/maintainers.mjs.map +1 -0
  27. package/dist/_chunks/mcp.mjs +15 -0
  28. package/dist/_chunks/mcp.mjs.map +1 -0
  29. package/dist/_chunks/registries.mjs +514 -245
  30. package/dist/_chunks/registries.mjs.map +1 -1
  31. package/dist/_chunks/registry.d.mts +121 -10
  32. package/dist/_chunks/registry.d.mts.map +1 -1
  33. package/dist/_chunks/registry.mjs +121 -31
  34. package/dist/_chunks/registry.mjs.map +1 -1
  35. package/dist/{commands → _chunks}/shared.mjs +15 -8
  36. package/dist/_chunks/shared.mjs.map +1 -0
  37. package/dist/_chunks/tool-operations.mjs +63 -0
  38. package/dist/_chunks/tool-operations.mjs.map +1 -0
  39. package/dist/_chunks/version.mjs +4 -0
  40. package/dist/_chunks/version.mjs.map +1 -0
  41. package/dist/{commands → _chunks}/versions.mjs +10 -9
  42. package/dist/_chunks/versions.mjs.map +1 -0
  43. package/dist/ai.d.mts +4 -4
  44. package/dist/ai.mjs +0 -1
  45. package/dist/ai.mjs.map +1 -1
  46. package/dist/cache/index.d.mts +3 -23
  47. package/dist/cache/index.mjs +4 -11
  48. package/dist/cli.mjs +9 -7
  49. package/dist/cli.mjs.map +1 -1
  50. package/dist/index.d.mts +4 -56
  51. package/dist/index.mjs +4 -7
  52. package/dist/mcp.d.mts +7 -0
  53. package/dist/mcp.d.mts.map +1 -0
  54. package/dist/mcp.mjs +155 -0
  55. package/dist/mcp.mjs.map +1 -0
  56. package/dist/registries/index.d.mts +0 -1
  57. package/dist/registries/index.mjs +0 -1
  58. package/dist/tool-operations.d.mts +36 -0
  59. package/dist/tool-operations.d.mts.map +1 -0
  60. package/dist/tool-operations.mjs +5 -0
  61. package/package.json +55 -9
  62. package/packages/omp/extensions/registries.ts +112 -0
  63. package/packages/pi/extensions/registries.ts +125 -0
  64. package/dist/_chunks/errors.d.mts +0 -90
  65. package/dist/_chunks/errors.d.mts.map +0 -1
  66. package/dist/_chunks/purl.mjs +0 -200
  67. package/dist/_chunks/purl.mjs.map +0 -1
  68. package/dist/_chunks/types.d.mts +0 -73
  69. package/dist/_chunks/types.d.mts.map +0 -1
  70. package/dist/cache/cached-registry.d.mts +0 -35
  71. package/dist/cache/cached-registry.d.mts.map +0 -1
  72. package/dist/cache/cached-registry.mjs.map +0 -1
  73. package/dist/cache/index.d.mts.map +0 -1
  74. package/dist/cache/lockfile.d.mts +0 -50
  75. package/dist/cache/lockfile.d.mts.map +0 -1
  76. package/dist/cache/lockfile.mjs +0 -68
  77. package/dist/cache/lockfile.mjs.map +0 -1
  78. package/dist/cache/paths.d.mts +0 -11
  79. package/dist/cache/paths.d.mts.map +0 -1
  80. package/dist/cache/paths.mjs +0 -26
  81. package/dist/cache/paths.mjs.map +0 -1
  82. package/dist/cache/storage.d.mts +0 -22
  83. package/dist/cache/storage.d.mts.map +0 -1
  84. package/dist/cache/storage.mjs +0 -40
  85. package/dist/cache/storage.mjs.map +0 -1
  86. package/dist/commands/cache.d.mts +0 -7
  87. package/dist/commands/cache.d.mts.map +0 -1
  88. package/dist/commands/cache.mjs.map +0 -1
  89. package/dist/commands/deps.d.mts +0 -23
  90. package/dist/commands/deps.d.mts.map +0 -1
  91. package/dist/commands/deps.mjs.map +0 -1
  92. package/dist/commands/info.d.mts +0 -26
  93. package/dist/commands/info.d.mts.map +0 -1
  94. package/dist/commands/info.mjs +0 -54
  95. package/dist/commands/info.mjs.map +0 -1
  96. package/dist/commands/maintainers.d.mts +0 -23
  97. package/dist/commands/maintainers.d.mts.map +0 -1
  98. package/dist/commands/maintainers.mjs +0 -46
  99. package/dist/commands/maintainers.mjs.map +0 -1
  100. package/dist/commands/shared.d.mts +0 -27
  101. package/dist/commands/shared.d.mts.map +0 -1
  102. package/dist/commands/shared.mjs.map +0 -1
  103. package/dist/commands/versions.d.mts +0 -31
  104. package/dist/commands/versions.d.mts.map +0 -1
  105. package/dist/commands/versions.mjs.map +0 -1
  106. package/dist/core/index.d.mts +0 -4
  107. package/dist/core/index.mjs +0 -3
  108. package/dist/index.d.mts.map +0 -1
  109. package/dist/types.d.mts +0 -3
  110. package/dist/types.mjs +0 -1
@@ -0,0 +1,278 @@
1
+ /** TypeBox instantiation metrics */
2
+ const Metrics = {
3
+ assign: 0,
4
+ create: 0,
5
+ clone: 0,
6
+ discard: 0,
7
+ update: 0
8
+ };
9
+ /** Returns true if this value is an array */
10
+ function IsArray(value) {
11
+ return Array.isArray(value);
12
+ }
13
+ /** Returns true if this value is null */
14
+ function IsNull(value) {
15
+ return IsEqual(value, null);
16
+ }
17
+ /** Returns true if this value is an object */
18
+ function IsObject(value) {
19
+ return IsEqual(typeof value, "object") && !IsNull(value);
20
+ }
21
+ function IsEqual(left, right) {
22
+ return left === right;
23
+ }
24
+ /** Returns true if the value appears to be an instance of a class. */
25
+ function IsClassInstance(value) {
26
+ if (!IsObject(value)) return false;
27
+ const proto = globalThis.Object.getPrototypeOf(value);
28
+ if (IsNull(proto)) return false;
29
+ return IsEqual(typeof proto.constructor, "function") && !(IsEqual(proto.constructor, globalThis.Object) || IsEqual(proto.constructor.name, "Object"));
30
+ }
31
+ /** Returns true if the PropertyKey is Unsafe (ref: prototype-pollution). */
32
+ function IsUnsafePropertyKey(key) {
33
+ return IsEqual(key, "__proto__") || IsEqual(key, "constructor") || IsEqual(key, "prototype");
34
+ }
35
+ /** Returns true if this value has this property key */
36
+ function HasPropertyKey(value, key) {
37
+ return IsUnsafePropertyKey(key) ? Object.prototype.hasOwnProperty.call(value, key) : key in value;
38
+ }
39
+ /** Returns property keys for this object via `Object.getOwnPropertyNames({ ... })` */
40
+ function Keys(value) {
41
+ return Object.getOwnPropertyNames(value);
42
+ }
43
+ /** Returns the property keys for this object via `Object.getOwnPropertySymbols({ ... })` */
44
+ function Symbols(value) {
45
+ return Object.getOwnPropertySymbols(value);
46
+ }
47
+ function IsTypeArray(value) {
48
+ return globalThis.ArrayBuffer.isView(value);
49
+ }
50
+ /** Returns true if the value is a RegExp */
51
+ function IsRegExp(value) {
52
+ return value instanceof globalThis.RegExp;
53
+ }
54
+ /** Returns true if the value is a Set */
55
+ function IsSet(value) {
56
+ return value instanceof globalThis.Set;
57
+ }
58
+ /** Returns true if the value is a Map */
59
+ function IsMap(value) {
60
+ return value instanceof globalThis.Map;
61
+ }
62
+ const settings = {
63
+ immutableTypes: false,
64
+ maxErrors: 8,
65
+ maxInstantiationCount: 128,
66
+ useAcceleration: true,
67
+ exactOptionalPropertyTypes: false,
68
+ enumerableKind: false,
69
+ correctiveParse: false,
70
+ unionPrioritySort: true
71
+ };
72
+ /** Gets current system settings */
73
+ function Get() {
74
+ return settings;
75
+ }
76
+ /** Conditionally freezes the value if `immutableTypes` is true, otherwise no action. */
77
+ function Freeze(value) {
78
+ return Get().immutableTypes ? Object.freeze(value) : value;
79
+ }
80
+ function FromClassInstance(value) {
81
+ return value;
82
+ }
83
+ function IsSchemaObject(value) {
84
+ return HasPropertyKey(value, "~kind") || HasPropertyKey(value, "~unsafe");
85
+ }
86
+ function FromSchemaObject(value) {
87
+ const result = {};
88
+ for (const key of Keys(value)) {
89
+ if (IsUnsafePropertyKey(key)) continue;
90
+ const descriptor = Object.getOwnPropertyDescriptor(value, key);
91
+ descriptor.value = FromValue(descriptor.value);
92
+ if (IsEqual(descriptor.enumerable, true)) result[key] = descriptor.value;
93
+ else Object.defineProperty(result, key, descriptor);
94
+ }
95
+ return result;
96
+ }
97
+ function FromPlainObject(value) {
98
+ const result = {};
99
+ for (const key of Keys(value)) {
100
+ if (IsUnsafePropertyKey(key)) continue;
101
+ result[key] = FromValue(value[key]);
102
+ }
103
+ for (const key of Symbols(value)) result[key] = FromValue(value[key]);
104
+ return result;
105
+ }
106
+ function FromObject(value) {
107
+ return IsClassInstance(value) ? FromClassInstance(value) : IsSchemaObject(value) ? FromSchemaObject(value) : FromPlainObject(value);
108
+ }
109
+ function FromArray(value) {
110
+ return value.map((element) => FromValue(element));
111
+ }
112
+ function FromTypedArray(value) {
113
+ return value.slice();
114
+ }
115
+ function FromRegExp(value) {
116
+ return new RegExp(value.source, value.flags);
117
+ }
118
+ function FromMap(value) {
119
+ return new Map(FromValue([...value.entries()]));
120
+ }
121
+ function FromSet(value) {
122
+ return new Set(FromValue([...value.values()]));
123
+ }
124
+ function FromValue(value) {
125
+ return IsTypeArray(value) ? FromTypedArray(value) : IsRegExp(value) ? FromRegExp(value) : IsMap(value) ? FromMap(value) : IsSet(value) ? FromSet(value) : IsArray(value) ? FromArray(value) : IsObject(value) ? FromObject(value) : value;
126
+ }
127
+ /**
128
+ * Returns a Clone of the given value. This function is similar to structuredClone()
129
+ * but also supports deep cloning instances of Map, Set and TypeArray.
130
+ */
131
+ function Clone(value) {
132
+ Metrics.clone += 1;
133
+ return FromValue(value);
134
+ }
135
+ function MergeHidden(left, right) {
136
+ for (const key of Object.keys(right)) Object.defineProperty(left, key, {
137
+ configurable: true,
138
+ writable: true,
139
+ enumerable: false,
140
+ value: right[key]
141
+ });
142
+ return left;
143
+ }
144
+ function Merge(left, right) {
145
+ return {
146
+ ...left,
147
+ ...right
148
+ };
149
+ }
150
+ /**
151
+ * Creates an object with hidden, enumerable, and optional property sets. This function
152
+ * ensures types are instantiated according to configuration rules for enumerable and
153
+ * non-enumerable properties.
154
+ */
155
+ function Create(hidden, enumerable, options = {}) {
156
+ Metrics.create += 1;
157
+ const withOptions = Merge(enumerable, options);
158
+ return Freeze(Get().enumerableKind ? Merge(withOptions, hidden) : MergeHidden(withOptions, hidden));
159
+ }
160
+ /**
161
+ * Updates a value with new properties while preserving property enumerability. Use this function to modify
162
+ * existing types without altering their configuration.
163
+ */
164
+ function Update(current, hidden, enumerable) {
165
+ Metrics.update += 1;
166
+ const settings = Get();
167
+ const result = Clone(current);
168
+ for (const key of Object.keys(hidden)) Object.defineProperty(result, key, {
169
+ configurable: true,
170
+ writable: true,
171
+ enumerable: settings.enumerableKind,
172
+ value: hidden[key]
173
+ });
174
+ for (const key of Object.keys(enumerable)) Object.defineProperty(result, key, {
175
+ configurable: true,
176
+ enumerable: true,
177
+ writable: true,
178
+ value: enumerable[key]
179
+ });
180
+ return Freeze(result);
181
+ }
182
+ function IsSchema(value) {
183
+ return IsObject(value);
184
+ }
185
+ function AddOptionalOperation(type) {
186
+ return Update(type, { "~optional": true }, {});
187
+ }
188
+ function AddOptionalAction(type, options) {
189
+ return Update(AddOptionalOperation(type), {}, options);
190
+ }
191
+ /** Creates an Array type. */
192
+ function _Array_(items, options) {
193
+ return Create({ "~kind": "Array" }, {
194
+ type: "array",
195
+ items
196
+ }, options);
197
+ }
198
+ /** Applies an AddOptional action to a type. */
199
+ function AddOptional(type, options = {}) {
200
+ return AddOptionalAction(type, options);
201
+ }
202
+ /** Applies an Optional modifier to the given type. */
203
+ function Optional(type) {
204
+ return AddOptional(type);
205
+ }
206
+ /** Returns true if the given value is TOptional */
207
+ function IsOptional(value) {
208
+ return IsSchema(value) && HasPropertyKey(value, "~optional");
209
+ }
210
+ /** Creates a RequiredArray derived from the given TProperties value. */
211
+ function RequiredArray(properties) {
212
+ return Keys(properties).filter((key) => !IsOptional(properties[key]));
213
+ }
214
+ /** Creates an Object type. */
215
+ function _Object_(properties, options = {}) {
216
+ const requiredKeys = RequiredArray(properties);
217
+ const required = requiredKeys.length > 0 ? { required: requiredKeys } : {};
218
+ return Create({ "~kind": "Object" }, {
219
+ type: "object",
220
+ ...required,
221
+ properties
222
+ }, options);
223
+ }
224
+ var ByteMarker;
225
+ (function(ByteMarker) {
226
+ ByteMarker[ByteMarker["Array"] = 0] = "Array";
227
+ ByteMarker[ByteMarker["BigInt"] = 1] = "BigInt";
228
+ ByteMarker[ByteMarker["Boolean"] = 2] = "Boolean";
229
+ ByteMarker[ByteMarker["Date"] = 3] = "Date";
230
+ ByteMarker[ByteMarker["Constructor"] = 4] = "Constructor";
231
+ ByteMarker[ByteMarker["Function"] = 5] = "Function";
232
+ ByteMarker[ByteMarker["Null"] = 6] = "Null";
233
+ ByteMarker[ByteMarker["Number"] = 7] = "Number";
234
+ ByteMarker[ByteMarker["Object"] = 8] = "Object";
235
+ ByteMarker[ByteMarker["RegExp"] = 9] = "RegExp";
236
+ ByteMarker[ByteMarker["String"] = 10] = "String";
237
+ ByteMarker[ByteMarker["Symbol"] = 11] = "Symbol";
238
+ ByteMarker[ByteMarker["TypeArray"] = 12] = "TypeArray";
239
+ ByteMarker[ByteMarker["Undefined"] = 13] = "Undefined";
240
+ })(ByteMarker || (ByteMarker = {}));
241
+ const [Prime, Size] = [BigInt("1099511628211"), BigInt("18446744073709551616")];
242
+ Array.from({ length: 256 }).map((_, i) => BigInt(i));
243
+ const F64 = new Float64Array(1);
244
+ new DataView(F64.buffer);
245
+ new Uint8Array(F64.buffer);
246
+ new TextEncoder();
247
+ const IntegerPattern = "-?(?:0|[1-9][0-9]*)";
248
+ /** Creates a Integer type. */
249
+ function Integer(options) {
250
+ return Create({ "~kind": "Integer" }, { type: "integer" }, options);
251
+ }
252
+ const NumberPattern = "-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?";
253
+ const StringPattern = ".*";
254
+ /** Creates a String type. */
255
+ function String$1(options) {
256
+ return Create({ "~kind": "String" }, { type: "string" }, options);
257
+ }
258
+ const IntegerKey = `^${IntegerPattern}$`;
259
+ `${NumberPattern}`;
260
+ `${StringPattern}`;
261
+ function Range(start, end) {
262
+ return Array.from({ length: end - start + 1 }, (_, i) => String.fromCharCode(start + i));
263
+ }
264
+ const Alpha = [...Range(97, 122), ...Range(65, 90)];
265
+ const Digit = ["0", ...Range(49, 57)];
266
+ const UnderScore = "_";
267
+ const DollarSign = "$";
268
+ [...Digit];
269
+ [...[
270
+ ...Alpha,
271
+ UnderScore,
272
+ DollarSign
273
+ ], ...Digit];
274
+ [...Digit];
275
+ new RegExp(IntegerKey);
276
+ export { _Array_ as a, Optional as i, Integer as n, _Object_ as r, String$1 as t };
277
+
278
+ //# sourceMappingURL=typebox.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typebox.mjs","names":["Settings.Get","Guard.HasPropertyKey","Guard.Keys","Guard.IsUnsafePropertyKey","Guard.IsEqual","Guard.Symbols","Guard.IsClassInstance","GlobalsGuard.IsTypeArray","GlobalsGuard.IsRegExp","GlobalsGuard.IsMap","GlobalsGuard.IsSet","Guard.IsArray","Guard.IsObject","Settings.Get","Settings.Get","Guard.IsObject","Memory.Update","Memory.Create","Guard.HasPropertyKey","Guard.Keys","Memory.Create","Memory.Create","String","Memory.Create","AllowedDigits"],"sources":["../../../node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/system/memory/metrics.mjs","../../../node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/guard/guard.mjs","../../../node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/guard/globals.mjs","../../../node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/system/settings/settings.mjs","../../../node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/system/memory/freeze.mjs","../../../node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/system/memory/clone.mjs","../../../node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/system/memory/create.mjs","../../../node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/system/memory/update.mjs","../../../node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/type/types/schema.mjs","../../../node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/type/engine/optional/instantiate_add.mjs","../../../node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/type/types/array.mjs","../../../node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/type/action/_add_optional.mjs","../../../node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/type/types/_optional.mjs","../../../node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/type/types/properties.mjs","../../../node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/type/types/object.mjs","../../../node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/system/hashing/hash.mjs","../../../node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/type/types/integer.mjs","../../../node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/type/types/number.mjs","../../../node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/type/types/string.mjs","../../../node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/type/types/record.mjs","../../../node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/type/script/token/internal/char.mjs","../../../node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/type/script/token/unsigned_integer.mjs","../../../node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/type/script/token/ident.mjs","../../../node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/type/script/token/unsigned_number.mjs","../../../node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/type/engine/indexed/from_object.mjs"],"sourcesContent":["/** TypeBox instantiation metrics */\nexport const Metrics = {\n assign: 0,\n create: 0,\n clone: 0,\n discard: 0,\n update: 0\n};\n","// deno-fmt-ignore-file\nimport * as String from './string.mjs';\n// --------------------------------------------------------------------------\n// Guards\n// --------------------------------------------------------------------------\n/** Returns true if this value is an array */\nexport function IsArray(value) {\n return Array.isArray(value);\n}\n/** Returns true if this value is bigint */\nexport function IsBigInt(value) {\n return IsEqual(typeof value, 'bigint');\n}\n/** Returns true if this value is a boolean */\nexport function IsBoolean(value) {\n return IsEqual(typeof value, 'boolean');\n}\n/** Returns true if this value is a constructor */\nexport function IsConstructor(value) {\n if (IsUndefined(value) || !IsFunction(value))\n return false;\n const result = Function.prototype.toString.call(value);\n if (/^class\\s/.test(result))\n return true;\n if (/\\[native code\\]/.test(result))\n return true;\n return false;\n}\n/** Returns true if this value is a function */\nexport function IsFunction(value) {\n return IsEqual(typeof value, 'function');\n}\n/** Returns true if this value is integer */\nexport function IsInteger(value) {\n return Number.isInteger(value);\n}\n/** Returns true if this value is null */\nexport function IsNull(value) {\n return IsEqual(value, null);\n}\n/** Returns true if this value is number */\nexport function IsNumber(value) {\n return Number.isFinite(value);\n}\n/** Returns true if this value is an object but not an array */\nexport function IsObjectNotArray(value) {\n return IsObject(value) && !IsArray(value);\n}\n/** Returns true if this value is an object */\nexport function IsObject(value) {\n return IsEqual(typeof value, 'object') && !(IsNull(value));\n}\n/** Returns true if this value is string */\nexport function IsString(value) {\n return IsEqual(typeof value, 'string');\n}\n/** Returns true if this value is symbol */\nexport function IsSymbol(value) {\n return IsEqual(typeof value, 'symbol');\n}\n/** Returns true if this value is undefined */\nexport function IsUndefined(value) {\n return IsEqual(value, undefined);\n}\n// --------------------------------------------------------------------------\n// Relational\n// --------------------------------------------------------------------------\nexport function IsEqual(left, right) {\n return left === right;\n}\nexport function IsGreaterThan(left, right) {\n return left > right;\n}\nexport function IsLessThan(left, right) {\n return left < right;\n}\nexport function IsLessEqualThan(left, right) {\n return left <= right;\n}\nexport function IsGreaterEqualThan(left, right) {\n return left >= right;\n}\n// --------------------------------------------------------------------------\n// MultipleOf\n// --------------------------------------------------------------------------\nexport function IsMultipleOf(dividend, divisor) {\n if (IsBigInt(dividend) || IsBigInt(divisor)) {\n return BigInt(dividend) % BigInt(divisor) === 0n;\n }\n const tolerance = 1e-10;\n if (!IsNumber(dividend))\n return true;\n if (IsInteger(dividend) && (1 / divisor) % 1 === 0)\n return true;\n const mod = dividend % divisor;\n return Math.min(Math.abs(mod), Math.abs(mod - divisor), Math.abs(mod + divisor)) < tolerance;\n}\n// ------------------------------------------------------------------\n// IsClassInstance\n// ------------------------------------------------------------------\n/** Returns true if the value appears to be an instance of a class. */\nexport function IsClassInstance(value) {\n if (!IsObject(value))\n return false;\n const proto = globalThis.Object.getPrototypeOf(value);\n if (IsNull(proto))\n return false;\n return IsEqual(typeof proto.constructor, 'function') &&\n !(IsEqual(proto.constructor, globalThis.Object) ||\n IsEqual(proto.constructor.name, 'Object'));\n}\n// ------------------------------------------------------------------\n// IsValueLike\n// ------------------------------------------------------------------\nexport function IsValueLike(value) {\n return IsBigInt(value) ||\n IsBoolean(value) ||\n IsNull(value) ||\n IsNumber(value) ||\n IsString(value) ||\n IsUndefined(value);\n}\n// --------------------------------------------------------------------------\n// String\n// --------------------------------------------------------------------------\n/** Returns the number of grapheme clusters in the string */\nexport function GraphemeCount(value) {\n return String.GraphemeCount(value);\n}\n/** Returns true if the string has at most the given number of graphemes */\nexport function IsMaxLength(value, length) {\n return String.IsMaxLength(value, length);\n}\n/** Returns true if the string has at least the given number of graphemes */\nexport function IsMinLength(value, length) {\n return String.IsMinLength(value, length);\n}\n// --------------------------------------------------------------------------\n// Array\n// --------------------------------------------------------------------------\n/** Returns true if every element from offset satisfies the callback, short-circuiting on the first failure */\nexport function Every(value, offset, callback) {\n return value.every((item, index) => (index < offset) || callback(item, index));\n}\n/** Returns true if every element from offset satisfies the callback, using exhaustive enumeration */\nexport function EveryAll(value, offset, callback) {\n let result = true;\n value.forEach((item, index) => { if ((index >= offset) && !callback(item, index))\n result = false; });\n return result;\n}\n/** Returns true if some element satisfies the callback, short-circuiting on the first success */\nexport function Some(value, callback) {\n return value.some((value, index) => callback(value, index));\n}\n/** Returns true if some element satisfies the callback, using exhaustive enumeration */\nexport function SomeAll(value, callback) {\n let result = false;\n value.forEach((item, index) => { if (callback(item, index))\n result = true; });\n return result;\n}\n/** Returns the count of elements that satisfy the callback */\nexport function Counted(value, callback) {\n return value.reduce((result, value, index) => callback(value, index) ? ++result : result, 0);\n}\n/** Shifts the left-most element from an array and dispatches to the true arm, or the false arm if empty */\nexport function ShiftLeft(array, true_, false_) {\n return (IsEqual(array.length, 0) ? false_() : true_(array[0], array.slice(1)));\n}\n// --------------------------------------------------------------------------\n// Object\n// --------------------------------------------------------------------------\n/** Returns true if the PropertyKey is Unsafe (ref: prototype-pollution). */\nexport function IsUnsafePropertyKey(key) {\n return IsEqual(key, '__proto__') || IsEqual(key, 'constructor') || IsEqual(key, 'prototype');\n}\n/** Returns true if this value has this property key */\nexport function HasPropertyKey(value, key) {\n return IsUnsafePropertyKey(key) ? Object.prototype.hasOwnProperty.call(value, key) : key in value;\n}\n/** Returns object entries as `[RegExp, Value][]` */\nexport function EntriesRegExp(value) {\n return Keys(value).map((key) => [new RegExp(`^${key}$`), value[key]]);\n}\n/** Returns object entries as `[string, Value][]` */\nexport function Entries(value) {\n return Object.entries(value);\n}\n/** Returns property keys for this object via `Object.getOwnPropertyNames({ ... })` */\nexport function Keys(value) {\n return Object.getOwnPropertyNames(value);\n}\n/** Returns the property keys for this object via `Object.getOwnPropertySymbols({ ... })` */\nexport function Symbols(value) {\n return Object.getOwnPropertySymbols(value);\n}\n/** Returns the property values for the given object via `Object.values()` */\nexport function Values(value) {\n return Object.values(value);\n}\n// ------------------------------------------------------------------\n// IsDeepEqual\n// ------------------------------------------------------------------\nfunction DeepEqualObject(left, right) {\n if (!IsObject(right))\n return false;\n const keys = Keys(left);\n return IsEqual(keys.length, Keys(right).length) &&\n keys.every((key) => IsDeepEqual(left[key], right[key]));\n}\nfunction DeepEqualArray(left, right) {\n return IsArray(right) && IsEqual(left.length, right.length) &&\n left.every((_, index) => IsDeepEqual(left[index], right[index]));\n}\n/** Returns true if left and right values are structurally equal */\nexport function IsDeepEqual(left, right) {\n return (IsArray(left) ? DeepEqualArray(left, right) :\n IsObject(left) ? DeepEqualObject(left, right) :\n IsEqual(left, right));\n}\n","// --------------------------------------------------------------------------\n// Primitives\n// --------------------------------------------------------------------------\nexport function IsBoolean(value) {\n return value instanceof Boolean;\n}\nexport function IsNumber(value) {\n return value instanceof Number;\n}\nexport function IsString(value) {\n return value instanceof String;\n}\n// --------------------------------------------------------------------------\n// TypeArray\n// --------------------------------------------------------------------------\nexport function IsTypeArray(value) {\n return globalThis.ArrayBuffer.isView(value);\n}\n/** Returns true if the value is a Int8Array */\nexport function IsInt8Array(value) {\n return value instanceof globalThis.Int8Array;\n}\n/** Returns true if the value is a Uint8Array */\nexport function IsUint8Array(value) {\n return value instanceof globalThis.Uint8Array;\n}\n/** Returns true if the value is a Uint8ClampedArray */\nexport function IsUint8ClampedArray(value) {\n return value instanceof globalThis.Uint8ClampedArray;\n}\n/** Returns true if the value is a Int16Array */\nexport function IsInt16Array(value) {\n return value instanceof globalThis.Int16Array;\n}\n/** Returns true if the value is a Uint16Array */\nexport function IsUint16Array(value) {\n return value instanceof globalThis.Uint16Array;\n}\n/** Returns true if the value is a Int32Array */\nexport function IsInt32Array(value) {\n return value instanceof globalThis.Int32Array;\n}\n/** Returns true if the value is a Uint32Array */\nexport function IsUint32Array(value) {\n return value instanceof globalThis.Uint32Array;\n}\n/** Returns true if the value is a Float32Array */\nexport function IsFloat32Array(value) {\n return value instanceof globalThis.Float32Array;\n}\n/** Returns true if the value is a Float64Array */\nexport function IsFloat64Array(value) {\n return value instanceof globalThis.Float64Array;\n}\n/** Returns true if the value is a BigInt64Array */\nexport function IsBigInt64Array(value) {\n return value instanceof globalThis.BigInt64Array;\n}\n/** Returns true if the value is a BigUint64Array */\nexport function IsBigUint64Array(value) {\n return value instanceof globalThis.BigUint64Array;\n}\n// ------------------------------------------------------------------\n// RegExp\n// ------------------------------------------------------------------\n/** Returns true if the value is a RegExp */\nexport function IsRegExp(value) {\n return value instanceof globalThis.RegExp;\n}\n// ------------------------------------------------------------------\n// Date\n// ------------------------------------------------------------------\n/** Returns true if the value is a Date */\nexport function IsDate(value) {\n return value instanceof globalThis.Date;\n}\n// ------------------------------------------------------------------\n// Set\n// ------------------------------------------------------------------\n/** Returns true if the value is a Set */\nexport function IsSet(value) {\n return value instanceof globalThis.Set;\n}\n// ------------------------------------------------------------------\n// Map\n// ------------------------------------------------------------------\n/** Returns true if the value is a Map */\nexport function IsMap(value) {\n return value instanceof globalThis.Map;\n}\n","import { Guard } from '../../guard/index.mjs';\n// Internal mutable state\nconst settings = {\n immutableTypes: false,\n maxErrors: 8,\n maxInstantiationCount: 128,\n useAcceleration: true,\n exactOptionalPropertyTypes: false,\n enumerableKind: false,\n correctiveParse: false,\n unionPrioritySort: true\n};\n/** Resets system settings to defaults */\nexport function Reset() {\n settings.immutableTypes = false;\n settings.maxErrors = 8;\n settings.maxInstantiationCount = 128;\n settings.useAcceleration = true;\n settings.exactOptionalPropertyTypes = false;\n settings.enumerableKind = false;\n settings.correctiveParse = false;\n settings.unionPrioritySort = true;\n}\n/** Sets system settings */\nexport function Set(options) {\n for (const key of Guard.Keys(options)) {\n const value = options[key];\n if (value !== undefined) {\n Object.defineProperty(settings, key, { value });\n }\n }\n}\n/** Gets current system settings */\nexport function Get() {\n return settings;\n}\n","// deno-lint-ignore-file no-explicit-any\nimport { Settings } from '../settings/index.mjs';\n/** Conditionally freezes the value if `immutableTypes` is true, otherwise no action. */\nexport function Freeze(value) {\n return Settings.Get().immutableTypes ? Object.freeze(value) : value;\n}\n","// deno-fmt-ignore-file\nimport { Guard, GlobalsGuard } from '../../guard/index.mjs';\nimport { Metrics } from './metrics.mjs';\n// ------------------------------------------------------------------\n// ClassInstance\n//\n// TypeBox does not clone arbitrary class instances. Class instances\n// cannot be safely cloned without potentially breaking private\n// members of the instance.\n//\n// ------------------------------------------------------------------\nfunction FromClassInstance(value) {\n return value; // atomic\n}\n// ------------------------------------------------------------------\n// SchemaObject\n//\n// Schema objects have non-enumerable properties that MUST be preserved \n// on Clone. The following is the optimal path these objects.\n// ------------------------------------------------------------------\nfunction IsSchemaObject(value) {\n return (Guard.HasPropertyKey(value, '~kind') ||\n Guard.HasPropertyKey(value, '~unsafe'));\n}\nfunction FromSchemaObject(value) {\n const result = {};\n for (const key of Guard.Keys(value)) {\n if (Guard.IsUnsafePropertyKey(key))\n continue; // (ignore: prototype-pollution)\n const descriptor = Object.getOwnPropertyDescriptor(value, key); // safe-name!\n descriptor.value = FromValue(descriptor.value);\n if (Guard.IsEqual(descriptor.enumerable, true)) {\n result[key] = descriptor.value;\n }\n else {\n Object.defineProperty(result, key, descriptor);\n }\n }\n return result;\n}\n// ------------------------------------------------------------------\n// PlainObject\n// ------------------------------------------------------------------\nfunction FromPlainObject(value) {\n const result = {};\n for (const key of Guard.Keys(value)) {\n if (Guard.IsUnsafePropertyKey(key))\n continue; // (ignore: prototype-pollution)\n result[key] = FromValue(value[key]);\n }\n for (const key of Guard.Symbols(value)) {\n result[key] = FromValue(value[key]);\n }\n return result;\n}\n// ------------------------------------------------------------------\n// Object\n// ------------------------------------------------------------------\nfunction FromObject(value) {\n return (Guard.IsClassInstance(value) ? FromClassInstance(value) :\n IsSchemaObject(value) ? FromSchemaObject(value) :\n FromPlainObject(value));\n}\n// ------------------------------------------------------------------\n// Array\n// ------------------------------------------------------------------\nfunction FromArray(value) {\n return value.map((element) => FromValue(element));\n}\n// ------------------------------------------------------------------\n// TypeArray\n// ------------------------------------------------------------------\nfunction FromTypedArray(value) {\n return value.slice();\n}\n// ------------------------------------------------------------------\n// RegExp\n// ------------------------------------------------------------------\nfunction FromRegExp(value) {\n return new RegExp(value.source, value.flags);\n}\n// ------------------------------------------------------------------\n// Map\n// ------------------------------------------------------------------\nfunction FromMap(value) {\n return new Map(FromValue([...value.entries()]));\n}\n// ------------------------------------------------------------------\n// Set\n// ------------------------------------------------------------------\nfunction FromSet(value) {\n return new Set(FromValue([...value.values()]));\n}\nfunction FromValue(value) {\n return (GlobalsGuard.IsTypeArray(value) ? FromTypedArray(value) :\n GlobalsGuard.IsRegExp(value) ? FromRegExp(value) :\n GlobalsGuard.IsMap(value) ? FromMap(value) :\n GlobalsGuard.IsSet(value) ? FromSet(value) :\n Guard.IsArray(value) ? FromArray(value) :\n Guard.IsObject(value) ? FromObject(value) :\n value);\n}\n// ------------------------------------------------------------------\n// Clone\n// ------------------------------------------------------------------\n/**\n * Returns a Clone of the given value. This function is similar to structuredClone()\n * but also supports deep cloning instances of Map, Set and TypeArray.\n */\nexport function Clone(value) {\n Metrics.clone += 1;\n return FromValue(value);\n}\n","// deno-lint-ignore-file no-explicit-any\nimport { Settings } from '../settings/index.mjs';\nimport { Metrics } from './metrics.mjs';\nimport { Freeze } from './freeze.mjs';\nfunction MergeHidden(left, right) {\n for (const key of Object.keys(right)) {\n Object.defineProperty(left, key, {\n configurable: true,\n writable: true,\n enumerable: false,\n value: right[key]\n });\n }\n return left;\n}\nfunction Merge(left, right) {\n return { ...left, ...right };\n}\n/**\n * Creates an object with hidden, enumerable, and optional property sets. This function\n * ensures types are instantiated according to configuration rules for enumerable and\n * non-enumerable properties.\n */\nexport function Create(hidden, enumerable, options = {}) {\n Metrics.create += 1;\n const withOptions = Merge(enumerable, options);\n const withHidden = Settings.Get().enumerableKind ? Merge(withOptions, hidden) : MergeHidden(withOptions, hidden);\n return Freeze(withHidden);\n}\n","// deno-lint-ignore-file no-explicit-any\nimport { Settings } from '../settings/index.mjs';\nimport { Metrics } from './metrics.mjs';\nimport { Freeze } from './freeze.mjs';\nimport { Clone } from './clone.mjs';\n/**\n * Updates a value with new properties while preserving property enumerability. Use this function to modify\n * existing types without altering their configuration.\n */\nexport function Update(current, hidden, enumerable) {\n Metrics.update += 1;\n const settings = Settings.Get();\n const result = Clone(current);\n // hidden\n for (const key of Object.keys(hidden)) {\n Object.defineProperty(result, key, {\n configurable: true,\n writable: true,\n enumerable: settings.enumerableKind,\n value: hidden[key]\n });\n }\n // enumerable\n for (const key of Object.keys(enumerable)) {\n Object.defineProperty(result, key, {\n configurable: true,\n enumerable: true,\n writable: true,\n value: enumerable[key]\n });\n }\n return Freeze(result);\n}\n","// deno-lint-ignore-file\n// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// Kind\n// ------------------------------------------------------------------\nexport function IsKind(value, kind) {\n return Guard.IsObject(value) && Guard.HasPropertyKey(value, '~kind') && Guard.IsEqual(value[\"~kind\"], kind);\n}\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\nexport function IsSchema(value) {\n return Guard.IsObject(value);\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../../system/memory/index.mjs';\nimport { InstantiateType } from '../instantiate.mjs';\nfunction AddOptionalOperation(type) {\n return Memory.Update(type, { '~optional': true }, {});\n}\nexport function AddOptionalAction(type, options) {\n const result = Memory.Update(AddOptionalOperation(type), {}, options);\n return result;\n}\nexport function AddOptionalInstantiate(context, state, type, options) {\n const instantiatedType = InstantiateType(context, state, type);\n return AddOptionalAction(instantiatedType, options);\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../system/memory/index.mjs';\nimport { IsKind } from './schema.mjs';\n// ------------------------------------------------------------------\n// Factory\n// ------------------------------------------------------------------\n/** Creates an Array type. */\nexport function _Array_(items, options) {\n return Memory.Create({ '~kind': 'Array' }, { type: 'array', items }, options);\n}\nexport { _Array_ as Array }; // Prevent Collision With Global Scope\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/** Returns true if the given value is a TArray. */\nexport function IsArray(value) {\n return IsKind(value, 'Array');\n}\n// ------------------------------------------------------------------\n// Options\n// ------------------------------------------------------------------\n/** Extracts options from a TArray. */\nexport function ArrayOptions(type) {\n return Memory.Discard(type, ['~kind', 'type', 'items']);\n}\n","// deno-fmt-ignore-file\nimport { Deferred } from '../types/deferred.mjs';\nimport { AddOptionalAction } from '../engine/optional/instantiate_add.mjs';\n/** Creates a deferred AddOptional action. */\nexport function AddOptionalDeferred(type, options = {}) {\n return Deferred('AddOptional', [type], options);\n}\n/** Applies an AddOptional action to a type. */\nexport function AddOptional(type, options = {}) {\n return AddOptionalAction(type, options);\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { IsSchema } from './schema.mjs';\nimport { AddOptional } from '../action/_add_optional.mjs';\n// ------------------------------------------------------------------\n// Factory\n// ------------------------------------------------------------------\n/** Applies an Optional modifier to the given type. */\nexport function Optional(type) {\n return AddOptional(type);\n}\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/** Returns true if the given value is TOptional */\nexport function IsOptional(value) {\n return IsSchema(value) && Guard.HasPropertyKey(value, '~optional');\n}\n","// deno-fmt-ignore-file\nimport { Guard } from '../../guard/index.mjs';\nimport { IsOptional } from './_optional.mjs';\n/** Creates a RequiredArray derived from the given TProperties value. */\nexport function RequiredArray(properties) {\n return Guard.Keys(properties).filter((key) => !IsOptional(properties[key]));\n}\n/** Extracts a tuple of keys from a TProperties value. */\nexport function PropertyKeys(properties) {\n return Guard.Keys(properties);\n}\n/** Extracts a tuple of property values from a TProperties value. */\nexport function PropertyValues(properties) {\n return Guard.Values(properties);\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../system/memory/index.mjs';\nimport { IsKind } from './schema.mjs';\nimport { RequiredArray } from './properties.mjs';\n// ------------------------------------------------------------------\n// Factory\n// ------------------------------------------------------------------\n/** Creates an Object type. */\nexport function _Object_(properties, options = {}) {\n const requiredKeys = RequiredArray(properties);\n const required = requiredKeys.length > 0 ? { required: requiredKeys } : {};\n return Memory.Create({ '~kind': 'Object' }, { type: 'object', ...required, properties }, options);\n}\nexport { _Object_ as Object }; // Prevent Collision With Global Scope\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/** Returns true if the given value is TObject. */\nexport function IsObject(value) {\n return IsKind(value, 'Object');\n}\n// ------------------------------------------------------------------\n// Options\n// ------------------------------------------------------------------\n/** Extracts options from a TObject. */\nexport function ObjectOptions(type) {\n return Memory.Discard(type, ['~kind', 'type', 'properties', 'required']);\n}\n","// deno-fmt-ignore-file\nimport { Unreachable } from '../unreachable/index.mjs';\nimport { Guard, GlobalsGuard } from '../../guard/index.mjs';\n// ------------------------------------------------------------------\n// InstanceKeys\n//\n// Retrieves all enumerable and non-enumerable own property keys \n// and inherited prototype keys (excluding symbols and the 'constructor') \n// from an object instance.\n//\n// This function is useful for differentiating between class instances \n// based on their structural keys rather than relying on the \n// constructor name. It provides a more reliable structural comparison \n// by capturing both own and prototype properties.\n//\n// ------------------------------------------------------------------\nfunction InstanceKeys(value) {\n const propertyKeys = new Set();\n let current = value;\n while (current && current !== Object.prototype) {\n for (const key of Reflect.ownKeys(current)) {\n if (key !== 'constructor' && typeof key !== 'symbol')\n propertyKeys.add(key);\n }\n current = Object.getPrototypeOf(current);\n }\n return [...propertyKeys];\n}\n// ------------------------------------------------------------------\n// IsIEEE754\n//\n// TypeBox guards do not consider +/- Infinity or NaN as valid\n// numbers, but they are valid IEEE754 numbers. We use a special\n// guard to ensure these numbers are considered for hashing.\n//\n// ------------------------------------------------------------------\nfunction IsIEEE754(value) {\n return typeof value === 'number';\n}\n// ------------------------------------------------------------------\n// ByteMarker\n// ------------------------------------------------------------------\nvar ByteMarker;\n(function (ByteMarker) {\n ByteMarker[ByteMarker[\"Array\"] = 0] = \"Array\";\n ByteMarker[ByteMarker[\"BigInt\"] = 1] = \"BigInt\";\n ByteMarker[ByteMarker[\"Boolean\"] = 2] = \"Boolean\";\n ByteMarker[ByteMarker[\"Date\"] = 3] = \"Date\";\n ByteMarker[ByteMarker[\"Constructor\"] = 4] = \"Constructor\";\n ByteMarker[ByteMarker[\"Function\"] = 5] = \"Function\";\n ByteMarker[ByteMarker[\"Null\"] = 6] = \"Null\";\n ByteMarker[ByteMarker[\"Number\"] = 7] = \"Number\";\n ByteMarker[ByteMarker[\"Object\"] = 8] = \"Object\";\n ByteMarker[ByteMarker[\"RegExp\"] = 9] = \"RegExp\";\n ByteMarker[ByteMarker[\"String\"] = 10] = \"String\";\n ByteMarker[ByteMarker[\"Symbol\"] = 11] = \"Symbol\";\n ByteMarker[ByteMarker[\"TypeArray\"] = 12] = \"TypeArray\";\n ByteMarker[ByteMarker[\"Undefined\"] = 13] = \"Undefined\";\n})(ByteMarker || (ByteMarker = {}));\n// ------------------------------------------------------------------\n// State\n// ------------------------------------------------------------------\nlet Accumulator = BigInt('14695981039346656037');\nconst [Prime, Size] = [BigInt('1099511628211'), BigInt('18446744073709551616' /* 2 ^ 64 */)];\nconst Bytes = Array.from({ length: 256 }).map((_, i) => BigInt(i));\nconst F64 = new Float64Array(1);\nconst F64In = new DataView(F64.buffer);\nconst F64Out = new Uint8Array(F64.buffer);\n// ------------------------------------------------------------------\n// Operation\n// ------------------------------------------------------------------\nfunction FNV1A64_OP(byte) {\n Accumulator = Accumulator ^ Bytes[byte];\n Accumulator = (Accumulator * Prime) % Size;\n}\n// ------------------------------------------------------------------\n// Array\n// ------------------------------------------------------------------\nfunction FromArray(value) {\n FNV1A64_OP(ByteMarker.Array);\n for (const item of value) {\n FromValue(item);\n }\n}\n// ------------------------------------------------------------------\n// BigInt\n// ------------------------------------------------------------------\nfunction FromBigInt(value) {\n FNV1A64_OP(ByteMarker.BigInt);\n F64In.setBigInt64(0, value);\n for (const byte of F64Out) {\n FNV1A64_OP(byte);\n }\n}\n// ------------------------------------------------------------------\n// Boolean\n// ------------------------------------------------------------------\nfunction FromBoolean(value) {\n FNV1A64_OP(ByteMarker.Boolean);\n FNV1A64_OP(value ? 1 : 0);\n}\n// ------------------------------------------------------------------\n// Constructor\n// ------------------------------------------------------------------\nfunction FromConstructor(value) {\n FNV1A64_OP(ByteMarker.Constructor);\n FromValue(value.toString());\n}\n// ------------------------------------------------------------------\n// Date\n// ------------------------------------------------------------------\nfunction FromDate(value) {\n FNV1A64_OP(ByteMarker.Date);\n FromValue(value.getTime());\n}\n// ------------------------------------------------------------------\n// Function\n// ------------------------------------------------------------------\nfunction FromFunction(value) {\n FNV1A64_OP(ByteMarker.Function);\n FromValue(value.toString());\n}\n// ------------------------------------------------------------------\n// Null\n// ------------------------------------------------------------------\nfunction FromNull(_value) {\n FNV1A64_OP(ByteMarker.Null);\n}\n// ------------------------------------------------------------------\n// Number | IEEE754\n// ------------------------------------------------------------------\nfunction FromNumber(value) {\n FNV1A64_OP(ByteMarker.Number);\n F64In.setFloat64(0, value, true /* little-endian */);\n for (const byte of F64Out) {\n FNV1A64_OP(byte);\n }\n}\n// ------------------------------------------------------------------\n// Object\n// ------------------------------------------------------------------\nfunction FromObject(value) {\n FNV1A64_OP(ByteMarker.Object);\n for (const key of InstanceKeys(value).sort()) {\n FromValue(key);\n FromValue(value[key]);\n }\n}\n// ------------------------------------------------------------------\n// RegExp\n// ------------------------------------------------------------------\nfunction FromRegExp(value) {\n FNV1A64_OP(ByteMarker.RegExp);\n FromString(value.toString());\n}\n// ------------------------------------------------------------------\n// String\n// ------------------------------------------------------------------\nconst encoder = new TextEncoder();\nfunction FromString(value) {\n FNV1A64_OP(ByteMarker.String);\n for (const byte of encoder.encode(value)) {\n FNV1A64_OP(byte);\n }\n}\n// ------------------------------------------------------------------\n// Symbol\n// ------------------------------------------------------------------\nfunction FromSymbol(value) {\n FNV1A64_OP(ByteMarker.Symbol);\n FromValue(value.toString());\n}\n// ------------------------------------------------------------------\n// TypeArray\n// ------------------------------------------------------------------\nfunction FromTypeArray(value) {\n FNV1A64_OP(ByteMarker.TypeArray);\n const buffer = new Uint8Array(value.buffer);\n for (let i = 0; i < buffer.length; i++) {\n FNV1A64_OP(buffer[i]);\n }\n}\n// ------------------------------------------------------------------\n// Undefined\n// ------------------------------------------------------------------\nfunction FromUndefined(_value) {\n return FNV1A64_OP(ByteMarker.Undefined);\n}\n// ------------------------------------------------------------------\n// Hash\n//\n// deno-coverage-ignore-start - unreachable\n//\n// This function should all JavaScript values so we can't reach the\n// fall-through. We use Unreachable to assert that no values pass\n// through. We will need to handle these should they arise.\n//\n// ------------------------------------------------------------------\nfunction FromValue(value) {\n return (GlobalsGuard.IsTypeArray(value) ? FromTypeArray(value) :\n GlobalsGuard.IsDate(value) ? FromDate(value) :\n GlobalsGuard.IsRegExp(value) ? FromRegExp(value) :\n GlobalsGuard.IsBoolean(value) ? FromBoolean(value.valueOf()) :\n GlobalsGuard.IsString(value) ? FromString(value.valueOf()) :\n GlobalsGuard.IsNumber(value) ? FromNumber(value.valueOf()) :\n IsIEEE754(value) ? FromNumber(value) :\n Guard.IsArray(value) ? FromArray(value) :\n Guard.IsBoolean(value) ? FromBoolean(value) :\n Guard.IsBigInt(value) ? FromBigInt(value) :\n Guard.IsConstructor(value) ? FromConstructor(value) :\n Guard.IsNull(value) ? FromNull(value) :\n Guard.IsObject(value) ? FromObject(value) :\n Guard.IsString(value) ? FromString(value) :\n Guard.IsSymbol(value) ? FromSymbol(value) :\n Guard.IsUndefined(value) ? FromUndefined(value) :\n Guard.IsFunction(value) ? FromFunction(value) :\n Unreachable());\n}\n// deno-coverage-ignore-stop\n// ------------------------------------------------------------------\n// Hash\n// ------------------------------------------------------------------\n/** Generates a FNV1A-64 non cryptographic hash of the given value */\nexport function HashCode(value) {\n Accumulator = BigInt('14695981039346656037');\n FromValue(value);\n return Accumulator;\n}\n/** Generates a FNV1A-64 non cryptographic hash of the given value */\nexport function Hash(value) {\n return HashCode(value).toString(16).padStart(16, '0');\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../system/memory/index.mjs';\nimport { IsKind } from './schema.mjs';\n// ------------------------------------------------------------------\n// Pattern\n// ------------------------------------------------------------------\nexport const IntegerPattern = '-?(?:0|[1-9][0-9]*)';\n// ------------------------------------------------------------------\n// Factory\n// ------------------------------------------------------------------\n/** Creates a Integer type. */\nexport function Integer(options) {\n return Memory.Create({ '~kind': 'Integer' }, { type: 'integer' }, options);\n}\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/** Returns true if the given value is TInteger. */\nexport function IsInteger(value) {\n return IsKind(value, 'Integer');\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../system/memory/index.mjs';\nimport { IsKind } from './schema.mjs';\n// ------------------------------------------------------------------\n// Pattern\n// ------------------------------------------------------------------\nexport const NumberPattern = '-?(?:0|[1-9][0-9]*)(?:\\\\.[0-9]+)?';\n// ------------------------------------------------------------------\n// Factory\n// ------------------------------------------------------------------\n/** Creates a Number type. */\nexport function Number(options) {\n return Memory.Create({ '~kind': 'Number' }, { type: 'number' }, options);\n}\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/** Returns true if the given value is a TNumber. */\nexport function IsNumber(value) {\n return IsKind(value, 'Number');\n}\n","// deno-lint-ignore-file\n// deno-fmt-ignore-file\nimport { Memory } from '../../system/memory/index.mjs';\nimport { IsKind } from './schema.mjs';\n// ------------------------------------------------------------------\n// StringPattern\n// ------------------------------------------------------------------\nexport const StringPattern = '.*';\n// ------------------------------------------------------------------\n// Factory\n// ------------------------------------------------------------------\n/** Creates a String type. */\nexport function String(options) {\n return Memory.Create({ '~kind': 'String' }, { type: 'string' }, options);\n}\n// ------------------------------------------------------------------\n// Guard\n// ------------------------------------------------------------------\n/** Returns true if the given value is TString. */\nexport function IsString(value) {\n return IsKind(value, 'String');\n}\n","// deno-fmt-ignore-file\nimport { Memory } from '../../system/memory/index.mjs';\nimport { Guard } from '../../guard/index.mjs';\nimport { IsKind } from './schema.mjs';\nimport { Integer, IntegerPattern } from './integer.mjs';\nimport { Number, NumberPattern } from './number.mjs';\nimport { String, StringPattern } from './string.mjs';\nimport { Deferred } from './deferred.mjs';\nimport { TemplateLiteralDecodeUnsafe } from '../engine/template_literal/decode.mjs';\nimport { CreateRecord } from '../engine/record/record_create.mjs';\nimport { RecordAction } from '../engine/record/instantiate.mjs';\nexport const IntegerKey = `^${IntegerPattern}$`;\nexport const NumberKey = `^${NumberPattern}$`;\nexport const StringKey = `^${StringPattern}$`;\n/** Represents a deferred Record action. */\nexport function RecordDeferred(key, value, options = {}) {\n return Deferred('Record', [key, value], options);\n}\n// -------------------------------------------------------------------\n// Factory\n// -------------------------------------------------------------------\n/** Creates a Record type. */\nexport function Record(key, value, options = {}) {\n return RecordAction(key, value, options);\n}\n// -------------------------------------------------------------------\n// RecordFromPattern\n// -------------------------------------------------------------------\n/** Creates a Record type from regular expression pattern. */\nexport function RecordFromPattern(pattern, value) {\n return CreateRecord(pattern, value);\n}\n/** Transforms a Record Pattern to a Type */\nexport function RecordPatternToType(pattern) {\n const result = (Guard.IsEqual(pattern, StringKey) ? String() :\n Guard.IsEqual(pattern, IntegerKey) ? Integer() :\n Guard.IsEqual(pattern, NumberKey) ? Number() :\n TemplateLiteralDecodeUnsafe(pattern));\n return result;\n}\n/** Extracts the Pattern from a Record type */\nexport function RecordPattern(type) {\n return Guard.Keys(type.patternProperties)[0];\n}\n/** Extracts the Key from a Record type */\nexport function RecordKey(type) {\n const pattern = RecordPattern(type);\n const result = RecordPatternToType(pattern);\n return result;\n}\n/** Extracts the Value from a Record type */\nexport function RecordValue(type) {\n return type.patternProperties[RecordPattern(type)];\n}\n// -------------------------------------------------------------------\n// Guard\n// -------------------------------------------------------------------\nexport function IsRecord(value) {\n return IsKind(value, 'Record');\n}\n// -------------------------------------------------------------------\n// Options\n// -------------------------------------------------------------------\nexport function RecordOptions(type) {\n return Memory.Discard(type, ['~kind', 'type', 'patternProperties']);\n}\n","// deno-coverage-ignore-start - parsebox tested\n// deno-fmt-ignore-file\n// ------------------------------------------------------------------\n// Range\n// ------------------------------------------------------------------\nfunction Range(start, end) {\n return Array.from({ length: end - start + 1 }, (_, i) => String.fromCharCode(start + i));\n}\nexport const Alpha = [\n ...Range(97, 122), // Lowercase\n ...Range(65, 90) // Uppercase\n];\nexport const Zero = '0';\nexport const NonZero = Range(49, 57); // 1 - 9\nexport const Digit = [Zero, ...NonZero];\n// ------------------------------------------------------------------\n// Characters\n// ------------------------------------------------------------------\nexport const WhiteSpace = ' ';\nexport const NewLine = '\\n';\nexport const TabSpace = '\\t';\nexport const UnderScore = '_';\nexport const Dot = '.';\nexport const DollarSign = '$';\nexport const Hyphen = '-';\n// deno-coverage-ignore-stop\n","// deno-coverage-ignore-start - parsebox tested\n// deno-fmt-ignore-file\nimport { Match } from './internal/match.mjs';\nimport { Trim } from './internal/trim.mjs';\nimport { Take } from './internal/take.mjs';\nimport { Many } from './internal/many.mjs';\nimport { Digit } from './internal/char.mjs';\nimport { Zero } from './internal/char.mjs';\nimport { NonZero } from './internal/char.mjs';\nimport { UnderScore } from './internal/char.mjs';\nfunction TakeNonZero(input) {\n return Take(NonZero, input);\n}\nconst AllowedDigits = [...Digit, UnderScore];\nfunction TakeDigits(input) {\n return Many(AllowedDigits, [UnderScore], input);\n}\nfunction TakeUnsignedInteger(input) {\n return Match(Take([Zero], input), (Zero, ZeroRest) => [Zero, ZeroRest], () => Match(TakeNonZero(input), (NonZero, NonZeroRest) => Match(TakeDigits(NonZeroRest), (Digits, DigitsRest) => [`${NonZero}${Digits}`, DigitsRest], () => []), // fail: did not match Digits\n () => [])); // fail: did not match NonZero\n}\n/** Matches if next is a UnsignedInteger */\nexport function UnsignedInteger(input) {\n return TakeUnsignedInteger(Trim(input));\n}\n// deno-coverage-ignore-stop\n","// deno-coverage-ignore-start - parsebox tested\n// deno-fmt-ignore-file\nimport { Match } from './internal/match.mjs';\nimport { Trim } from './internal/trim.mjs';\nimport { Take } from './internal/take.mjs';\nimport { Alpha } from './internal/char.mjs';\nimport { Digit } from './internal/char.mjs';\nimport { UnderScore } from './internal/char.mjs';\nimport { DollarSign } from './internal/char.mjs';\nconst Initial = [...Alpha, UnderScore, DollarSign];\nfunction TakeInitial(input) {\n return Take(Initial, input);\n}\nconst Remaining = [...Initial, ...Digit];\nfunction TakeRemaining(input, result = '') {\n return Match(Take(Remaining, input), (Remaining, RemainingRest) => TakeRemaining(RemainingRest, `${result}${Remaining}`), () => [result, input]);\n}\nfunction TakeIdent(input) {\n return Match(TakeInitial(input), (Initial, InitialRest) => Match(TakeRemaining(InitialRest), (Remaining, RemainingRest) => [`${Initial}${Remaining}`, RemainingRest], () => []), // fail: did not match Remaining\n () => []); // fail: did not match Initial\n}\n/** Matches if next is an Ident */\nexport function Ident(input) {\n return TakeIdent(Trim(input));\n}\n// deno-coverage-ignore-stop\n","// deno-coverage-ignore-start - parsebox tested\n// deno-fmt-ignore-file\nimport { IsEqual } from './internal/guard.mjs';\nimport { IsMatch, Match } from './internal/match.mjs';\nimport { Trim } from './internal/trim.mjs';\nimport { Take } from './internal/take.mjs';\nimport { Many } from './internal/many.mjs';\nimport { Digit, UnderScore } from './internal/char.mjs';\nimport { Dot } from './internal/char.mjs';\nimport { UnsignedInteger } from './unsigned_integer.mjs';\nconst AllowedDigits = [...Digit, UnderScore];\nfunction IsLeadingDot(input) {\n return IsMatch(Take([Dot], input));\n}\nfunction TakeFractional(input) {\n return Match(Many(AllowedDigits, [UnderScore], input), (Digits, DigitsRest) => IsEqual(Digits, '')\n ? [] // fail: no Digits\n : [Digits, DigitsRest], () => []); // fail: did not match Digits\n}\nfunction LeadingDot(input) {\n return Match(Take([Dot], input), (Dot, DotRest) => Match(TakeFractional(DotRest), (Fractional, FractionalRest) => [`0${Dot}${Fractional}`, FractionalRest], () => []), // fail: did not match Fractional\n () => []); // fail: did not match Dot\n}\nfunction LeadingInteger(input) {\n return Match(UnsignedInteger(input), (Integer, IntegerRest) => Match(Take([Dot], IntegerRest), (Dot, DotRest) => Match(TakeFractional(DotRest), (Fractional, FractionalRest) => [`${Integer}${Dot}${Fractional}`, FractionalRest], () => [`${Integer}`, DotRest]), // fail: did not match Fractional, use Integer\n () => [`${Integer}`, IntegerRest]), // fail: did not match Dot, use Integer\n () => []); // fail: did not match Integer\n}\nfunction TakeUnsignedNumber(input) {\n return (IsLeadingDot(input)\n ? LeadingDot(input)\n : LeadingInteger(input));\n}\n/** Matches if next is a UnsignedNumber */\nexport function UnsignedNumber(input) {\n return TakeUnsignedNumber(Trim(input));\n}\n// deno-coverage-ignore-stop\n","// deno-fmt-ignore-file\nimport { IsNumber } from '../../types/number.mjs';\nimport { Never } from '../../types/never.mjs';\nimport { PropertyKeys } from '../../types/properties.mjs';\nimport { EvaluateUnion } from '../evaluate/evaluate.mjs';\nimport { ToIndexableKeys } from '../indexable/to_indexable_keys.mjs';\nimport { IntegerKey } from '../../types/record.mjs';\nimport { ExpandThis } from '../this/expand_this.mjs';\nfunction IndexProperty(properties, key) {\n const selectedType = key in properties ? properties[key] : Never();\n const result = ExpandThis(properties, selectedType);\n return result;\n}\nfunction IndexProperties(properties, keys) {\n return keys.reduce((result, left) => {\n return [...result, IndexProperty(properties, left)];\n }, []);\n}\nfunction FromIndexer(properties, indexer) {\n const keys = ToIndexableKeys(indexer);\n const variants = IndexProperties(properties, keys);\n const result = EvaluateUnion(variants);\n return result;\n}\nconst NumericKeyPattern = new RegExp(IntegerKey);\nfunction NumericKeys(keys) {\n const result = keys.filter(key => NumericKeyPattern.test(key));\n return result;\n}\nfunction FromIndexerNumber(properties) {\n const keys = PropertyKeys(properties);\n const numericKeys = NumericKeys(keys);\n const variants = IndexProperties(properties, numericKeys);\n const result = EvaluateUnion(variants);\n return result;\n}\nexport function FromObject(properties, indexer) {\n const result = IsNumber(indexer) ? FromIndexerNumber(properties) : FromIndexer(properties, indexer);\n return result;\n}\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21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E5F,MAAa,QAAQ,CACjB,GAAG,MAAM,IAAI,IAAI,EACjB,GAAG,MAAM,IAAI,GAAG,CACnB;AAGD,MAAa,QAAQ,CAFD,KAEQ,GADL,MAAM,IAAI,GAAG,CACG;AAOvC,MAAa,aAAa;AAE1B,MAAa,aAAa;ACVJ,CAAC,GAAG,MAAkB;ACA1B,CAAC,GAJH;CAAC,GAAG;CAAO;CAAY;CAAW,EAInB,GAAG,MAAM;ACHlB,CAAC,GAAG,MAAkB;ACclB,IAAI,OAAO,WAAW"}
@@ -0,0 +1,183 @@
1
+ import { homedir, platform } from "node:os";
2
+ import { join } from "node:path";
3
+ import { createStorage, prefixStorage } from "unstorage";
4
+ import fsDriver from "unstorage/drivers/fs";
5
+ import { hash } from "node:crypto";
6
+ const APP_NAME = "registries";
7
+ /**
8
+ * Resolve the cache directory using the current platform convention.
9
+ *
10
+ * @returns {string} The absolute cache directory path.
11
+ */
12
+ function getCacheDir() {
13
+ const envOverride = process.env["REGISTRIES_CACHE_DIR"];
14
+ if (envOverride) return envOverride;
15
+ const os = platform();
16
+ if (os === "darwin") return join(homedir(), "Library", "Caches", APP_NAME);
17
+ if (os === "win32") {
18
+ const localAppData = process.env["LOCALAPPDATA"];
19
+ if (localAppData) return join(localAppData, APP_NAME, "cache");
20
+ return join(homedir(), "AppData", "Local", APP_NAME, "cache");
21
+ }
22
+ const xdgCache = process.env["XDG_CACHE_HOME"];
23
+ if (xdgCache) return join(xdgCache, APP_NAME);
24
+ return join(homedir(), ".cache", APP_NAME);
25
+ }
26
+ let _storage;
27
+ /**
28
+ * Configure the storage backend before the first cache operation.
29
+ *
30
+ * @param storage - Storage backend to use.
31
+ */
32
+ function configureStorage(storage) {
33
+ _storage = storage;
34
+ }
35
+ /**
36
+ * Get or create the shared storage backend.
37
+ *
38
+ * @returns {Storage} The configured or filesystem-backed storage.
39
+ */
40
+ function getStorage() {
41
+ _storage ??= createStorage({ driver: fsDriver({ base: getCacheDir() }) });
42
+ return _storage;
43
+ }
44
+ /**
45
+ * Get storage scoped to one registry ecosystem.
46
+ *
47
+ * @param ecosystem - Registry ecosystem key.
48
+ * @returns {Storage} Namespaced storage for the ecosystem.
49
+ */
50
+ function getEcosystemStorage(ecosystem) {
51
+ return prefixStorage(getStorage(), ecosystem);
52
+ }
53
+ /**
54
+ * Compute a SHA-256 integrity value for JSON-serializable data.
55
+ *
56
+ * @param value - Value to hash.
57
+ * @returns {string} The prefixed hexadecimal digest.
58
+ */
59
+ function computeIntegrity(value) {
60
+ return `sha256-${hash("sha256", JSON.stringify(value), "hex")}`;
61
+ }
62
+ /** Dispose the storage instance. Call on process exit. */
63
+ async function disposeStorage() {
64
+ if (_storage) {
65
+ await _storage.dispose();
66
+ _storage = void 0;
67
+ }
68
+ }
69
+ /** Clear all cached data. */
70
+ async function clearStorage() {
71
+ await getStorage().clear();
72
+ }
73
+ const LOCKFILE_VERSION = 1;
74
+ const LOCKFILE_KEY = "__lockfile__";
75
+ /** Default TTL per data type (seconds). */
76
+ const DEFAULT_TTL = {
77
+ package: 3600,
78
+ versions: 1800,
79
+ dependencies: 86400,
80
+ maintainers: 86400
81
+ };
82
+ function emptyLockfile() {
83
+ return {
84
+ version: LOCKFILE_VERSION,
85
+ entries: {}
86
+ };
87
+ }
88
+ /**
89
+ * Read the lockfile, falling back to an empty valid structure.
90
+ *
91
+ * @param storage - Optional storage backend.
92
+ * @returns {Promise<Lockfile>} The stored or empty lockfile.
93
+ */
94
+ async function readLockfile(storage) {
95
+ const s = storage ?? getStorage();
96
+ try {
97
+ const data = await s.getItem(LOCKFILE_KEY);
98
+ if (!data || data.version !== LOCKFILE_VERSION) return emptyLockfile();
99
+ return data;
100
+ } catch {
101
+ return emptyLockfile();
102
+ }
103
+ }
104
+ /**
105
+ * Persist the lockfile.
106
+ *
107
+ * @param lockfile - Lockfile to persist.
108
+ * @param storage - Optional storage backend.
109
+ */
110
+ async function writeLockfile(lockfile, storage) {
111
+ await (storage ?? getStorage()).setItem(LOCKFILE_KEY, lockfile);
112
+ }
113
+ /**
114
+ * Build a stable cache key.
115
+ *
116
+ * @param ecosystem - Registry ecosystem.
117
+ * @param name - Package name.
118
+ * @param type - Cached data type.
119
+ * @param version - Optional package version.
120
+ * @returns {string} The cache key.
121
+ */
122
+ function cacheKey(ecosystem, name, type, version) {
123
+ const base = `${ecosystem}:${name}:${type}`;
124
+ return version ? `${base}:${version}` : base;
125
+ }
126
+ /**
127
+ * Check whether a lockfile entry is fresh.
128
+ *
129
+ * @param entry - Entry to inspect.
130
+ * @returns {boolean} Whether the entry is still valid.
131
+ */
132
+ function isFresh(entry) {
133
+ const expiresAt = entry.fetchedAt + entry.ttl * 1e3;
134
+ return Date.now() < expiresAt;
135
+ }
136
+ /**
137
+ * Read a fresh lockfile entry.
138
+ *
139
+ * @param lockfile - Lockfile to inspect.
140
+ * @param key - Cache key.
141
+ * @returns {LockfileEntry | null} The fresh entry, or null.
142
+ */
143
+ function getFreshEntry(lockfile, key) {
144
+ const entry = lockfile.entries[key];
145
+ if (!entry) return null;
146
+ if (!isFresh(entry)) return null;
147
+ return entry;
148
+ }
149
+ /**
150
+ * Upsert an in-memory lockfile entry without persisting it.
151
+ *
152
+ * @param lockfile - Lockfile to mutate.
153
+ * @param entry - Entry to store.
154
+ */
155
+ function setEntry(lockfile, entry) {
156
+ lockfile.entries[entry.key] = entry;
157
+ }
158
+ /**
159
+ * Remove an in-memory lockfile entry.
160
+ *
161
+ * @param lockfile - Lockfile to mutate.
162
+ * @param key - Cache key to remove.
163
+ */
164
+ function removeEntry(lockfile, key) {
165
+ delete lockfile.entries[key];
166
+ }
167
+ /**
168
+ * Remove every stale in-memory entry.
169
+ *
170
+ * @param lockfile - Lockfile to prune.
171
+ * @returns {number} The number of removed entries.
172
+ */
173
+ function pruneStale(lockfile) {
174
+ let removed = 0;
175
+ for (const key of Object.keys(lockfile.entries)) if (!isFresh(lockfile.entries[key])) {
176
+ delete lockfile.entries[key];
177
+ removed++;
178
+ }
179
+ return removed;
180
+ }
181
+ export { pruneStale as a, setEntry as c, computeIntegrity as d, configureStorage as f, getCacheDir as g, getStorage as h, isFresh as i, writeLockfile as l, getEcosystemStorage as m, cacheKey as n, readLockfile as o, disposeStorage as p, getFreshEntry as r, removeEntry as s, DEFAULT_TTL as t, clearStorage as u };
182
+
183
+ //# sourceMappingURL=lockfile.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lockfile.mjs","names":[],"sources":["../../src/cache/paths.ts","../../src/cache/storage.ts","../../src/cache/lockfile.ts"],"sourcesContent":["import { homedir, platform } from \"node:os\";\nimport { join } from \"node:path\";\n\nconst APP_NAME = \"registries\";\n\n/**\n * Resolve the cache directory using the current platform convention.\n *\n * @returns {string} The absolute cache directory path.\n */\nexport function getCacheDir(): string {\n // Explicit override always wins\n const envOverride = process.env[\"REGISTRIES_CACHE_DIR\"];\n if (envOverride) return envOverride;\n\n const os = platform();\n\n if (os === \"darwin\") {\n return join(homedir(), \"Library\", \"Caches\", APP_NAME);\n }\n\n if (os === \"win32\") {\n const localAppData = process.env[\"LOCALAPPDATA\"];\n if (localAppData) return join(localAppData, APP_NAME, \"cache\");\n return join(homedir(), \"AppData\", \"Local\", APP_NAME, \"cache\");\n }\n\n // Linux / FreeBSD / other — XDG Base Directory\n const xdgCache = process.env[\"XDG_CACHE_HOME\"];\n if (xdgCache) return join(xdgCache, APP_NAME);\n return join(homedir(), \".cache\", APP_NAME);\n}\n","import { createStorage, prefixStorage } from \"unstorage\";\nimport fsDriver from \"unstorage/drivers/fs\";\nimport type { Storage } from \"unstorage\";\nimport { getCacheDir } from \"./paths.ts\";\nimport { hash } from \"node:crypto\";\n\nlet _storage: Storage | undefined;\n\n/**\n * Configure the storage backend before the first cache operation.\n *\n * @param storage - Storage backend to use.\n */\nexport function configureStorage(storage: Storage): void {\n _storage = storage;\n}\n\n/**\n * Get or create the shared storage backend.\n *\n * @returns {Storage} The configured or filesystem-backed storage.\n */\nexport function getStorage(): Storage {\n _storage ??= createStorage({\n driver: fsDriver({ base: getCacheDir() }),\n });\n return _storage;\n}\n\n/**\n * Get storage scoped to one registry ecosystem.\n *\n * @param ecosystem - Registry ecosystem key.\n * @returns {Storage} Namespaced storage for the ecosystem.\n */\nexport function getEcosystemStorage(ecosystem: string): Storage {\n return prefixStorage(getStorage(), ecosystem);\n}\n\n/**\n * Compute a SHA-256 integrity value for JSON-serializable data.\n *\n * @param value - Value to hash.\n * @returns {string} The prefixed hexadecimal digest.\n */\nexport function computeIntegrity(value: unknown): string {\n return `sha256-${hash(\"sha256\", JSON.stringify(value), \"hex\")}`;\n}\n\n/** Dispose the storage instance. Call on process exit. */\nexport async function disposeStorage(): Promise<void> {\n if (_storage) {\n await _storage.dispose();\n _storage = undefined;\n }\n}\n\n/** Clear all cached data. */\nexport async function clearStorage(): Promise<void> {\n await getStorage().clear();\n}\n","import type { Storage } from \"unstorage\";\nimport { getStorage } from \"./storage.ts\";\n\nconst LOCKFILE_VERSION = 1;\nconst LOCKFILE_KEY = \"__lockfile__\";\n\n/** Default TTL per data type (seconds). */\nexport const DEFAULT_TTL = {\n package: 3600, // 1 hour — package metadata changes rarely\n versions: 1800, // 30 min — new versions published more often\n dependencies: 86400, // 24 hours — deps of a specific version never change\n maintainers: 86400, // 24 hours\n} as const;\n\nexport type EntryType = keyof typeof DEFAULT_TTL;\n\n/** A single cached entry tracked in the lockfile. */\nexport interface LockfileEntry {\n /** PURL-style key: 'npm:lodash', 'cargo:serde' */\n key: string;\n /** What kind of data: package, versions, dependencies, maintainers */\n type: EntryType;\n /** Unix timestamp (ms) when fetched */\n fetchedAt: number;\n /** TTL in seconds */\n ttl: number;\n /** Latest version at time of caching (for package entries) */\n latestVersion?: string;\n /** Content hash (sha256 of JSON-serialized value) for integrity */\n integrity: string;\n}\n\n/** The full lockfile structure. */\nexport interface Lockfile {\n version: number;\n entries: Record<string, LockfileEntry>;\n}\n\nfunction emptyLockfile(): Lockfile {\n return { version: LOCKFILE_VERSION, entries: {} };\n}\n\n/**\n * Read the lockfile, falling back to an empty valid structure.\n *\n * @param storage - Optional storage backend.\n * @returns {Promise<Lockfile>} The stored or empty lockfile.\n */\nexport async function readLockfile(storage?: Storage): Promise<Lockfile> {\n const s = storage ?? getStorage();\n try {\n const data = await s.getItem<Lockfile>(LOCKFILE_KEY);\n if (!data || data.version !== LOCKFILE_VERSION) return emptyLockfile();\n return data;\n } catch {\n return emptyLockfile();\n }\n}\n\n/**\n * Persist the lockfile.\n *\n * @param lockfile - Lockfile to persist.\n * @param storage - Optional storage backend.\n */\nexport async function writeLockfile(lockfile: Lockfile, storage?: Storage): Promise<void> {\n const s = storage ?? getStorage();\n await s.setItem(LOCKFILE_KEY, lockfile);\n}\n\n/**\n * Build a stable cache key.\n *\n * @param ecosystem - Registry ecosystem.\n * @param name - Package name.\n * @param type - Cached data type.\n * @param version - Optional package version.\n * @returns {string} The cache key.\n */\nexport function cacheKey(\n ecosystem: string,\n name: string,\n type: EntryType,\n version?: string,\n): string {\n const base = `${ecosystem}:${name}:${type}`;\n return version ? `${base}:${version}` : base;\n}\n\n/**\n * Check whether a lockfile entry is fresh.\n *\n * @param entry - Entry to inspect.\n * @returns {boolean} Whether the entry is still valid.\n */\nexport function isFresh(entry: LockfileEntry): boolean {\n const expiresAt = entry.fetchedAt + entry.ttl * 1000;\n return Date.now() < expiresAt;\n}\n\n/**\n * Read a fresh lockfile entry.\n *\n * @param lockfile - Lockfile to inspect.\n * @param key - Cache key.\n * @returns {LockfileEntry | null} The fresh entry, or null.\n */\nexport function getFreshEntry(lockfile: Lockfile, key: string): LockfileEntry | null {\n const entry = lockfile.entries[key];\n if (!entry) return null;\n if (!isFresh(entry)) return null;\n return entry;\n}\n\n/**\n * Upsert an in-memory lockfile entry without persisting it.\n *\n * @param lockfile - Lockfile to mutate.\n * @param entry - Entry to store.\n */\nexport function setEntry(lockfile: Lockfile, entry: LockfileEntry): void {\n lockfile.entries[entry.key] = entry;\n}\n\n/**\n * Remove an in-memory lockfile entry.\n *\n * @param lockfile - Lockfile to mutate.\n * @param key - Cache key to remove.\n */\nexport function removeEntry(lockfile: Lockfile, key: string): void {\n delete lockfile.entries[key];\n}\n\n/**\n * Remove every stale in-memory entry.\n *\n * @param lockfile - Lockfile to prune.\n * @returns {number} The number of removed entries.\n */\nexport function pruneStale(lockfile: Lockfile): number {\n let removed = 0;\n for (const key of Object.keys(lockfile.entries)) {\n if (!isFresh(lockfile.entries[key]!)) {\n delete lockfile.entries[key];\n removed++;\n }\n }\n return removed;\n}\n"],"mappings":";;;;;AAGA,MAAM,WAAW;;;;;;AAOjB,SAAgB,cAAsB;CAEpC,MAAM,cAAc,QAAQ,IAAI;AAChC,KAAI,YAAa,QAAO;CAExB,MAAM,KAAK,UAAU;AAErB,KAAI,OAAO,SACT,QAAO,KAAK,SAAS,EAAE,WAAW,UAAU,SAAS;AAGvD,KAAI,OAAO,SAAS;EAClB,MAAM,eAAe,QAAQ,IAAI;AACjC,MAAI,aAAc,QAAO,KAAK,cAAc,UAAU,QAAQ;AAC9D,SAAO,KAAK,SAAS,EAAE,WAAW,SAAS,UAAU,QAAQ;;CAI/D,MAAM,WAAW,QAAQ,IAAI;AAC7B,KAAI,SAAU,QAAO,KAAK,UAAU,SAAS;AAC7C,QAAO,KAAK,SAAS,EAAE,UAAU,SAAS;;ACxB5C,IAAI;;;;;;AAOJ,SAAgB,iBAAiB,SAAwB;AACvD,YAAW;;;;;;;AAQb,SAAgB,aAAsB;AACpC,cAAa,cAAc,EACzB,QAAQ,SAAS,EAAE,MAAM,aAAa,EAAE,CAAC,EAC1C,CAAC;AACF,QAAO;;;;;;;;AAST,SAAgB,oBAAoB,WAA4B;AAC9D,QAAO,cAAc,YAAY,EAAE,UAAU;;;;;;;;AAS/C,SAAgB,iBAAiB,OAAwB;AACvD,QAAO,UAAU,KAAK,UAAU,KAAK,UAAU,MAAM,EAAE,MAAM;;;AAI/D,eAAsB,iBAAgC;AACpD,KAAI,UAAU;AACZ,QAAM,SAAS,SAAS;AACxB,aAAW,KAAA;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