@happyvertical/smrt-core 0.56.0 → 0.56.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +6 -0
- package/agents/browser-entry.md +5 -0
- package/agents/generators.md +61 -0
- package/agents/object-runtime.md +17 -0
- package/dist/browser.d.ts +2 -0
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +3 -1
- package/dist/cookbook/engine/commands.d.ts.map +1 -1
- package/dist/cookbook/engine/commands.js +12 -0
- package/dist/cookbook/engine/commands.js.map +1 -1
- package/dist/cookbook/engine/defaults.d.ts.map +1 -1
- package/dist/cookbook/engine/defaults.js +8 -0
- package/dist/cookbook/engine/defaults.js.map +1 -1
- package/dist/cookbook/engine/document.d.ts +4 -0
- package/dist/cookbook/engine/document.d.ts.map +1 -1
- package/dist/cookbook/engine/document.js +11 -3
- package/dist/cookbook/engine/document.js.map +1 -1
- package/dist/cookbook/engine/engine.d.ts.map +1 -1
- package/dist/cookbook/engine/engine.js +3 -1
- package/dist/cookbook/engine/engine.js.map +1 -1
- package/dist/cookbook/engine/schemas.d.ts.map +1 -1
- package/dist/cookbook/engine/schemas.js +8 -0
- package/dist/cookbook/engine/schemas.js.map +1 -1
- package/dist/cookbook/engine/types.d.ts +5 -1
- package/dist/cookbook/engine/types.d.ts.map +1 -1
- package/dist/cookbook/engine/types.js.map +1 -1
- package/dist/generators/index.d.ts +1 -0
- package/dist/generators/index.d.ts.map +1 -1
- package/dist/generators/index.js +2 -1
- package/dist/generators/mcp-runtime-template.d.ts +3 -0
- package/dist/generators/mcp-runtime-template.d.ts.map +1 -1
- package/dist/generators/mcp-runtime-template.js +30 -4
- package/dist/generators/mcp-runtime-template.js.map +1 -1
- package/dist/generators/mcp.d.ts +5 -0
- package/dist/generators/mcp.d.ts.map +1 -1
- package/dist/generators/mcp.js +78 -7
- package/dist/generators/mcp.js.map +1 -1
- package/dist/generators.js +2 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/interceptors.d.ts +7 -0
- package/dist/interceptors.d.ts.map +1 -1
- package/dist/interceptors.js +15 -1
- package/dist/interceptors.js.map +1 -1
- package/dist/manifest/browser-capability.generated.d.ts.map +1 -1
- package/dist/manifest/browser-capability.generated.js +47 -5
- package/dist/manifest/browser-capability.generated.js.map +1 -1
- package/dist/manifest/index.js +1 -1
- package/dist/manifest/manifest-loader.d.ts.map +1 -1
- package/dist/manifest/manifest-loader.js +1 -2
- package/dist/manifest/manifest-loader.js.map +1 -1
- package/dist/manifest/static-manifest.js +1 -1
- package/dist/manifest/static-manifest.js.map +1 -1
- package/dist/manifest/store.js +1 -1
- package/dist/manifest.json +1 -1
- package/dist/mcp-serializer.d.ts +38 -0
- package/dist/mcp-serializer.d.ts.map +1 -0
- package/dist/mcp-serializer.js +60 -0
- package/dist/mcp-serializer.js.map +1 -0
- package/dist/object.d.ts +1 -0
- package/dist/object.d.ts.map +1 -1
- package/dist/object.js +44 -13
- package/dist/object.js.map +1 -1
- package/dist/registry/collection-exposure.d.ts +99 -0
- package/dist/registry/collection-exposure.d.ts.map +1 -0
- package/dist/registry/collection-exposure.js +135 -0
- package/dist/registry/collection-exposure.js.map +1 -0
- package/dist/registry/types.d.ts +13 -0
- package/dist/registry/types.d.ts.map +1 -1
- package/dist/registry.d.ts +8 -1
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +76 -3
- package/dist/registry.js.map +1 -1
- package/dist/scanner/manifest-generator.d.ts +14 -0
- package/dist/scanner/manifest-generator.d.ts.map +1 -1
- package/dist/scanner/manifest-generator.js +66 -13
- package/dist/scanner/manifest-generator.js.map +1 -1
- package/dist/smrt-knowledge.json +13 -11
- package/dist/utils/import-project-vite.js +1 -1
- package/dist/utils/import-workspace-module.js +1 -1
- package/dist/utils/sha256.js +2 -2
- package/dist/vite-plugin/dev-plane-route.js +1 -1
- package/dist/vite-plugin/import-build-aware.js +1 -1
- package/dist/vite-plugin/index.js +2 -2
- package/dist/vite-plugin/resources-route.js +1 -1
- package/dist/vite-plugin/sveltekit-generator.d.ts.map +1 -1
- package/dist/vite-plugin/sveltekit-generator.js +5 -1
- package/dist/vite-plugin/sveltekit-generator.js.map +1 -1
- package/package.json +16 -10
- package/dist/node_modules/.pnpm/@noble_hashes@2.4.0/node_modules/@noble/hashes/_md.js +0 -169
- package/dist/node_modules/.pnpm/@noble_hashes@2.4.0/node_modules/@noble/hashes/_md.js.map +0 -1
- package/dist/node_modules/.pnpm/@noble_hashes@2.4.0/node_modules/@noble/hashes/_u64.js +0 -13
- package/dist/node_modules/.pnpm/@noble_hashes@2.4.0/node_modules/@noble/hashes/_u64.js.map +0 -1
- package/dist/node_modules/.pnpm/@noble_hashes@2.4.0/node_modules/@noble/hashes/sha2.js +0 -198
- package/dist/node_modules/.pnpm/@noble_hashes@2.4.0/node_modules/@noble/hashes/sha2.js.map +0 -1
- package/dist/node_modules/.pnpm/@noble_hashes@2.4.0/node_modules/@noble/hashes/utils.js +0 -243
- package/dist/node_modules/.pnpm/@noble_hashes@2.4.0/node_modules/@noble/hashes/utils.js.map +0 -1
- package/dist/node_modules/.pnpm/balanced-match@4.0.4/node_modules/balanced-match/dist/esm/index.js +0 -51
- package/dist/node_modules/.pnpm/balanced-match@4.0.4/node_modules/balanced-match/dist/esm/index.js.map +0 -1
- package/dist/node_modules/.pnpm/brace-expansion@5.0.11/node_modules/brace-expansion/dist/esm/index.js +0 -202
- package/dist/node_modules/.pnpm/brace-expansion@5.0.11/node_modules/brace-expansion/dist/esm/index.js.map +0 -1
- package/dist/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/assert-valid-pattern.js +0 -10
- package/dist/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/assert-valid-pattern.js.map +0 -1
- package/dist/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/ast.js +0 -514
- package/dist/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/ast.js.map +0 -1
- package/dist/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/brace-expressions.js +0 -124
- package/dist/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/brace-expressions.js.map +0 -1
- package/dist/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/escape.js +0 -21
- package/dist/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/escape.js.map +0 -1
- package/dist/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/index.js +0 -629
- package/dist/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/index.js.map +0 -1
- package/dist/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/unescape.js +0 -28
- package/dist/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/unescape.js.map +0 -1
|
@@ -1,243 +0,0 @@
|
|
|
1
|
-
//#region ../../node_modules/.pnpm/@noble+hashes@2.4.0/node_modules/@noble/hashes/utils.js
|
|
2
|
-
/**
|
|
3
|
-
* Checks if something is Uint8Array. Be careful: nodejs Buffer will return true.
|
|
4
|
-
* @param a - value to test
|
|
5
|
-
* @returns `true` when the value is a Uint8Array-compatible view.
|
|
6
|
-
* @example
|
|
7
|
-
* Check whether a value is a Uint8Array-compatible view.
|
|
8
|
-
* ```ts
|
|
9
|
-
* isBytes(new Uint8Array([1, 2, 3]));
|
|
10
|
-
* ```
|
|
11
|
-
*/
|
|
12
|
-
function isBytes(a) {
|
|
13
|
-
return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array" && "BYTES_PER_ELEMENT" in a && a.BYTES_PER_ELEMENT === 1;
|
|
14
|
-
}
|
|
15
|
-
var atitle = (title) => title ? `"${title}" ` : "";
|
|
16
|
-
/**
|
|
17
|
-
* Asserts something is a non-negative integer.
|
|
18
|
-
* @param n - number to validate
|
|
19
|
-
* @param title - label included in thrown errors
|
|
20
|
-
* @returns The validated number.
|
|
21
|
-
* @throws On wrong argument types. {@link TypeError}
|
|
22
|
-
* @throws On wrong argument ranges or values. {@link RangeError}
|
|
23
|
-
* @example
|
|
24
|
-
* Validate a non-negative integer option.
|
|
25
|
-
* ```ts
|
|
26
|
-
* anumber(32, 'length');
|
|
27
|
-
* ```
|
|
28
|
-
*/
|
|
29
|
-
function anumber(n, title = "") {
|
|
30
|
-
if (typeof n !== "number") throw new TypeError(atitle(title) + "expected number, got " + typeof n);
|
|
31
|
-
if (!Number.isSafeInteger(n) || n < 0) throw new RangeError(atitle(title) + "expected integer >= 0, got " + n);
|
|
32
|
-
return n;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Asserts something is Uint8Array.
|
|
36
|
-
* @param value - value to validate
|
|
37
|
-
* @param length - optional exact length constraint
|
|
38
|
-
* @param title - label included in thrown errors
|
|
39
|
-
* @returns The validated byte array.
|
|
40
|
-
* @throws On wrong argument types. {@link TypeError}
|
|
41
|
-
* @throws On wrong argument ranges or values. {@link RangeError}
|
|
42
|
-
* @example
|
|
43
|
-
* Validate that a value is a byte array.
|
|
44
|
-
* ```ts
|
|
45
|
-
* abytes(new Uint8Array([1, 2, 3]));
|
|
46
|
-
* ```
|
|
47
|
-
*/
|
|
48
|
-
function abytes(value, length, title = "") {
|
|
49
|
-
if (isBytes(value) && (length === void 0 || value.length === length)) return value;
|
|
50
|
-
if (length !== void 0) anumber(length, "length");
|
|
51
|
-
const bytes = isBytes(value);
|
|
52
|
-
const ofLen = length !== void 0 ? ` of length ${length}` : "";
|
|
53
|
-
const got = bytes ? `length=${value.length}` : `type=${typeof value}`;
|
|
54
|
-
const message = atitle(title) + "expected Uint8Array" + ofLen + ", got " + got;
|
|
55
|
-
if (!bytes) throw new TypeError(message);
|
|
56
|
-
throw new RangeError(message);
|
|
57
|
-
}
|
|
58
|
-
var aobject = (value, label) => {
|
|
59
|
-
if (value === null || typeof value !== "object" || Array.isArray(value)) throw new TypeError((label === "object" ? "" : `"${label}" `) + "expected object, got type=" + typeof value);
|
|
60
|
-
};
|
|
61
|
-
var aopts = (value, label) => {
|
|
62
|
-
aobject(value, label);
|
|
63
|
-
const proto = Object.getPrototypeOf(value);
|
|
64
|
-
if (proto !== Object.prototype && proto !== null) throw new TypeError(`"${label}" expected plain object`);
|
|
65
|
-
if (Object.hasOwn(value, "__proto__")) throw new TypeError(`"${label}.__proto__" is not allowed`);
|
|
66
|
-
};
|
|
67
|
-
/**
|
|
68
|
-
* Asserts a hash instance has not been destroyed or finished.
|
|
69
|
-
* @param instance - hash instance to validate
|
|
70
|
-
* @param checkFinished - whether to reject finalized instances
|
|
71
|
-
* @throws If the hash instance has already been destroyed or finalized. {@link Error}
|
|
72
|
-
* @example
|
|
73
|
-
* Validate that a hash instance is still usable.
|
|
74
|
-
* ```ts
|
|
75
|
-
* import { aexists } from '@noble/hashes/utils.js';
|
|
76
|
-
* import { sha256 } from '@noble/hashes/sha2.js';
|
|
77
|
-
* const hash = sha256.create();
|
|
78
|
-
* aexists(hash);
|
|
79
|
-
* ```
|
|
80
|
-
*/
|
|
81
|
-
function aexists(instance, checkFinished = true) {
|
|
82
|
-
if (instance.destroyed) throw new Error("hash was destroyed");
|
|
83
|
-
if (checkFinished && instance.finished) throw new Error("digest() was already called");
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Asserts output is a sufficiently-sized byte array.
|
|
87
|
-
* @param out - destination buffer
|
|
88
|
-
* @param instance - hash instance providing output length
|
|
89
|
-
* Oversized buffers are allowed; downstream code only promises to fill the first `outputLen` bytes.
|
|
90
|
-
* @throws On wrong argument types. {@link TypeError}
|
|
91
|
-
* @throws On wrong argument ranges or values. {@link RangeError}
|
|
92
|
-
* @example
|
|
93
|
-
* Validate a caller-provided digest buffer.
|
|
94
|
-
* ```ts
|
|
95
|
-
* import { aoutput } from '@noble/hashes/utils.js';
|
|
96
|
-
* import { sha256 } from '@noble/hashes/sha2.js';
|
|
97
|
-
* const hash = sha256.create();
|
|
98
|
-
* aoutput(new Uint8Array(hash.outputLen), hash);
|
|
99
|
-
* ```
|
|
100
|
-
*/
|
|
101
|
-
function aoutput(out, instance) {
|
|
102
|
-
abytes(out, void 0, "output");
|
|
103
|
-
const min = instance.outputLen;
|
|
104
|
-
if (!(out.length >= min)) throw new RangeError("\"output\" expected length >= " + min);
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Zeroizes typed arrays in place. Warning: JS provides no guarantees.
|
|
108
|
-
* @param arrays - arrays to overwrite with zeros
|
|
109
|
-
* @example
|
|
110
|
-
* Zeroize sensitive buffers in place.
|
|
111
|
-
* ```ts
|
|
112
|
-
* clean(new Uint8Array([1, 2, 3]));
|
|
113
|
-
* ```
|
|
114
|
-
*/
|
|
115
|
-
function clean(...arrays) {
|
|
116
|
-
for (let i = 0; i < arrays.length; i++) arrays[i].fill(0);
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Creates a DataView for byte-level manipulation.
|
|
120
|
-
* @param arr - source typed array
|
|
121
|
-
* @returns DataView over the same buffer region.
|
|
122
|
-
* @example
|
|
123
|
-
* Create a DataView over an existing buffer.
|
|
124
|
-
* ```ts
|
|
125
|
-
* createView(new Uint8Array(4));
|
|
126
|
-
* ```
|
|
127
|
-
*/
|
|
128
|
-
function createView(arr) {
|
|
129
|
-
return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Rotate-right operation for uint32 values.
|
|
133
|
-
* @param word - source word
|
|
134
|
-
* @param shift - shift amount in bits
|
|
135
|
-
* @returns Rotated word.
|
|
136
|
-
* @example
|
|
137
|
-
* Rotate a 32-bit word to the right.
|
|
138
|
-
* ```ts
|
|
139
|
-
* rotr(0x12345678, 8);
|
|
140
|
-
* ```
|
|
141
|
-
*/
|
|
142
|
-
function rotr(word, shift) {
|
|
143
|
-
return word << 32 - shift | word >>> shift;
|
|
144
|
-
}
|
|
145
|
-
var hasHexBuiltin = /* @__PURE__ */ (() => typeof Uint8Array.from([]).toHex === "function" && typeof Uint8Array.fromHex === "function")();
|
|
146
|
-
var hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, "0"));
|
|
147
|
-
/**
|
|
148
|
-
* Convert byte array to hex string.
|
|
149
|
-
* Uses the built-in function when available and assumes it matches the tested
|
|
150
|
-
* fallback semantics.
|
|
151
|
-
* @param bytes - bytes to encode
|
|
152
|
-
* @returns Lowercase hexadecimal string.
|
|
153
|
-
* @throws On wrong argument types. {@link TypeError}
|
|
154
|
-
* @example
|
|
155
|
-
* Convert bytes to lowercase hexadecimal.
|
|
156
|
-
* ```ts
|
|
157
|
-
* bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])); // 'cafe0123'
|
|
158
|
-
* ```
|
|
159
|
-
*/
|
|
160
|
-
function bytesToHex(bytes) {
|
|
161
|
-
abytes(bytes);
|
|
162
|
-
if (hasHexBuiltin) return bytes.toHex();
|
|
163
|
-
let hex = "";
|
|
164
|
-
for (let i = 0; i < bytes.length; i++) hex += hexes[bytes[i]];
|
|
165
|
-
return hex;
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* Merges default options and passed options.
|
|
169
|
-
* @param defaults - base option object
|
|
170
|
-
* @param opts - user overrides
|
|
171
|
-
* @param title - label included in thrown override errors
|
|
172
|
-
* @returns Fresh merged option object with a null prototype.
|
|
173
|
-
* @throws On wrong argument types. {@link TypeError}
|
|
174
|
-
* @example
|
|
175
|
-
* Merge user overrides onto default options.
|
|
176
|
-
* ```ts
|
|
177
|
-
* checkOpts({ dkLen: 32 }, { asyncTick: 10 });
|
|
178
|
-
* ```
|
|
179
|
-
*/
|
|
180
|
-
function checkOpts(defaults, opts, title = "opts") {
|
|
181
|
-
aopts(defaults, "defaults");
|
|
182
|
-
if (opts !== void 0) aopts(opts, title);
|
|
183
|
-
return Object.assign(Object.create(null), defaults, opts);
|
|
184
|
-
}
|
|
185
|
-
/**
|
|
186
|
-
* Creates a callable hash function from a stateful class constructor.
|
|
187
|
-
* @param hashCons - hash constructor or factory
|
|
188
|
-
* @param info - optional metadata such as DER OID
|
|
189
|
-
* @returns Frozen callable hash wrapper with `.create()`.
|
|
190
|
-
* Wrapper construction eagerly calls `hashCons(undefined)` once to read
|
|
191
|
-
* `outputLen` / `blockLen`, so constructor side effects happen at module
|
|
192
|
-
* init time.
|
|
193
|
-
* @throws On wrong argument types. {@link TypeError}
|
|
194
|
-
* @example
|
|
195
|
-
* Wrap a stateful hash constructor into a callable helper.
|
|
196
|
-
* ```ts
|
|
197
|
-
* import { createHasher } from '@noble/hashes/utils.js';
|
|
198
|
-
* import { sha256 } from '@noble/hashes/sha2.js';
|
|
199
|
-
* const wrapped = createHasher(sha256.create, { oid: sha256.oid });
|
|
200
|
-
* wrapped(new Uint8Array([1]));
|
|
201
|
-
* ```
|
|
202
|
-
*/
|
|
203
|
-
function createHasher(hashCons, info = {}) {
|
|
204
|
-
if (typeof hashCons !== "function") throw new TypeError("\"hashCons\" expected function, got type=" + typeof hashCons);
|
|
205
|
-
info = checkOpts({}, info, "info");
|
|
206
|
-
const hashC = (msg, opts) => hashCons(opts).update(msg).digest();
|
|
207
|
-
const tmp = hashCons(void 0);
|
|
208
|
-
hashC.outputLen = tmp.outputLen;
|
|
209
|
-
hashC.blockLen = tmp.blockLen;
|
|
210
|
-
hashC.canXOF = tmp.canXOF;
|
|
211
|
-
hashC.create = (opts) => hashCons(opts);
|
|
212
|
-
Object.assign(hashC, info);
|
|
213
|
-
return Object.freeze(hashC);
|
|
214
|
-
}
|
|
215
|
-
/**
|
|
216
|
-
* Creates OID metadata for NIST hashes with prefix `06 09 60 86 48 01 65 03 04 02`.
|
|
217
|
-
* @param suffix - final OID byte for the selected hash.
|
|
218
|
-
* The helper accepts any byte even though only the documented NIST hash
|
|
219
|
-
* suffixes are meaningful downstream.
|
|
220
|
-
* @returns Object containing the DER-encoded OID.
|
|
221
|
-
* @example
|
|
222
|
-
* Build OID metadata for a NIST hash.
|
|
223
|
-
* ```ts
|
|
224
|
-
* oidNist(0x01);
|
|
225
|
-
* ```
|
|
226
|
-
*/
|
|
227
|
-
var oidNist = (suffix) => ({ oid: Uint8Array.from([
|
|
228
|
-
6,
|
|
229
|
-
9,
|
|
230
|
-
96,
|
|
231
|
-
134,
|
|
232
|
-
72,
|
|
233
|
-
1,
|
|
234
|
-
101,
|
|
235
|
-
3,
|
|
236
|
-
4,
|
|
237
|
-
2,
|
|
238
|
-
suffix
|
|
239
|
-
]) });
|
|
240
|
-
//#endregion
|
|
241
|
-
export { abytes, aexists, anumber, aoutput, bytesToHex, checkOpts, clean, createHasher, createView, isBytes, oidNist, rotr };
|
|
242
|
-
|
|
243
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":[],"sources":["../../../../../../../../../node_modules/.pnpm/@noble+hashes@2.4.0/node_modules/@noble/hashes/utils.js"],"sourcesContent":["/**\n * Checks if something is Uint8Array. Be careful: nodejs Buffer will return true.\n * @param a - value to test\n * @returns `true` when the value is a Uint8Array-compatible view.\n * @example\n * Check whether a value is a Uint8Array-compatible view.\n * ```ts\n * isBytes(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport function isBytes(a) {\n // Plain `instanceof Uint8Array` is too strict for some Buffer / proxy / cross-realm cases.\n // The fallback still requires a real ArrayBuffer view, so plain\n // JSON-deserialized `{ constructor: ... }` spoofing is rejected, and\n // `BYTES_PER_ELEMENT === 1` keeps the fallback on byte-oriented views.\n return (a instanceof Uint8Array ||\n (ArrayBuffer.isView(a) &&\n a.constructor.name === 'Uint8Array' &&\n 'BYTES_PER_ELEMENT' in a &&\n a.BYTES_PER_ELEMENT === 1));\n}\n// Shared error-message prefix builder. Only called on throw paths, so assert\n// success paths never pay for the string concatenation.\nconst atitle = (title) => (title ? `\"${title}\" ` : '');\n/**\n * Asserts something is a non-negative integer.\n * @param n - number to validate\n * @param title - label included in thrown errors\n * @returns The validated number.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * Validate a non-negative integer option.\n * ```ts\n * anumber(32, 'length');\n * ```\n */\nexport function anumber(n, title = '') {\n if (typeof n !== 'number')\n throw new TypeError(atitle(title) + 'expected number, got ' + typeof n);\n if (!Number.isSafeInteger(n) || n < 0)\n throw new RangeError(atitle(title) + 'expected integer >= 0, got ' + n);\n return n;\n}\n/**\n * Asserts something is a boolean.\n * @param value - value to validate\n * @param title - label included in thrown errors\n * @returns The validated boolean.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Validate a boolean option.\n * ```ts\n * abool(true, 'enableXOF');\n * ```\n */\nexport function abool(value, title = '') {\n if (typeof value !== 'boolean')\n throw new TypeError(atitle(title) + 'expected boolean, got type=' + typeof value);\n return value;\n}\n/**\n * Asserts something is Uint8Array.\n * @param value - value to validate\n * @param length - optional exact length constraint\n * @param title - label included in thrown errors\n * @returns The validated byte array.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * Validate that a value is a byte array.\n * ```ts\n * abytes(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport function abytes(value, length, title = '') {\n // Success path first: this runs at the start of every update() / digestInto(), and the\n // common `abytes(data)` form must not pay for length handling it does not use.\n if (isBytes(value) && (length === undefined || value.length === length))\n return value;\n // Error path: recompute freely to build the exact message.\n if (length !== undefined)\n anumber(length, 'length');\n const bytes = isBytes(value);\n const ofLen = length !== undefined ? ` of length ${length}` : '';\n const got = bytes ? `length=${value.length}` : `type=${typeof value}`;\n const message = atitle(title) + 'expected Uint8Array' + ofLen + ', got ' + got;\n if (!bytes)\n throw new TypeError(message);\n throw new RangeError(message);\n}\n/**\n * Copies bytes into a fresh Uint8Array.\n * Buffer-style slices can alias the same backing store, so callers that need ownership should copy.\n * @param bytes - source bytes to clone\n * @returns Freshly allocated copy of `bytes`.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Clone a byte array before mutating it.\n * ```ts\n * const copy = copyBytes(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport function copyBytes(bytes) {\n // `Uint8Array.from(...)` would also accept arrays / other typed arrays. Keep this helper strict\n // because callers use it at byte-validation boundaries before mutating the detached copy.\n return Uint8Array.from(abytes(bytes));\n}\n/**\n * Asserts something is a wrapped hash constructor.\n * @param h - hash constructor to validate\n * @throws On wrong argument types or invalid hash wrapper shape. {@link TypeError}\n * @throws On invalid hash metadata ranges or values. {@link RangeError}\n * @throws If the hash metadata allows empty outputs or block sizes. {@link Error}\n * @example\n * Validate a callable hash wrapper.\n * ```ts\n * import { ahash } from '@noble/hashes/utils.js';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * ahash(sha256);\n * ```\n */\nexport function ahash(h) {\n if (typeof h !== 'function' || typeof h.create !== 'function')\n throw new TypeError('expected hash wrapped by utils.createHasher');\n anumber(h.outputLen);\n anumber(h.blockLen);\n // HMAC and KDF callers treat these as real byte lengths; allowing zero lets fake wrappers pass\n // validation and can produce empty outputs instead of failing fast.\n if (h.outputLen < 1 || h.blockLen < 1)\n throw new Error('hash blockLen / outputLen must be >= 1');\n}\nconst aobject = (value, label) => {\n if (value === null || typeof value !== 'object' || Array.isArray(value))\n throw new TypeError((label === 'object' ? '' : `\"${label}\" `) + 'expected object, got type=' + typeof value);\n};\nconst aopts = (value, label) => {\n aobject(value, label);\n const proto = Object.getPrototypeOf(value);\n if (proto !== Object.prototype && proto !== null)\n throw new TypeError(`\"${label}\" expected plain object`);\n // Object.assign() treats an own \"__proto__\" source key as a write to the target's legacy\n // prototype setter. Reject it before merging so inherited option values cannot be injected.\n if (Object.hasOwn(value, '__proto__'))\n throw new TypeError(`\"${label}.__proto__\" is not allowed`);\n};\n/**\n * Asserts a hash instance has not been destroyed or finished.\n * @param instance - hash instance to validate\n * @param checkFinished - whether to reject finalized instances\n * @throws If the hash instance has already been destroyed or finalized. {@link Error}\n * @example\n * Validate that a hash instance is still usable.\n * ```ts\n * import { aexists } from '@noble/hashes/utils.js';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * const hash = sha256.create();\n * aexists(hash);\n * ```\n */\nexport function aexists(instance, checkFinished = true) {\n // Runs on every update()/digestInto(); the flags are library-owned booleans, so only their\n // truthiness is checked - re-validating their type per call was pure hot-path overhead.\n if (instance.destroyed)\n throw new Error('hash was destroyed');\n if (checkFinished && instance.finished)\n throw new Error('digest() was already called');\n}\n/**\n * Asserts output is a sufficiently-sized byte array.\n * @param out - destination buffer\n * @param instance - hash instance providing output length\n * Oversized buffers are allowed; downstream code only promises to fill the first `outputLen` bytes.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * Validate a caller-provided digest buffer.\n * ```ts\n * import { aoutput } from '@noble/hashes/utils.js';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * const hash = sha256.create();\n * aoutput(new Uint8Array(hash.outputLen), hash);\n * ```\n */\nexport function aoutput(out, instance) {\n abytes(out, undefined, 'output');\n // `outputLen` is a library-owned readonly number; the negated comparison keeps failing fast\n // when it is missing/NaN (comparisons with undefined/NaN are false) without an anumber() call.\n const min = instance.outputLen;\n if (!(out.length >= min)) {\n throw new RangeError('\"output\" expected length >= ' + min);\n }\n}\n/**\n * Casts a typed array view to Uint8Array.\n * @param arr - source typed array\n * @returns Uint8Array view over the same buffer.\n * @example\n * Reinterpret a typed array as bytes.\n * ```ts\n * u8(new Uint32Array([1, 2]));\n * ```\n */\nexport function u8(arr) {\n return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);\n}\n/**\n * Casts a typed array view to Uint32Array.\n * `arr.byteOffset` must already be 4-byte aligned or the platform\n * Uint32Array constructor will throw.\n * @param arr - source typed array\n * @returns Uint32Array view over the same buffer.\n * @example\n * Reinterpret a byte array as 32-bit words.\n * ```ts\n * u32(new Uint8Array(8));\n * ```\n */\nexport function u32(arr) {\n return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));\n}\n/**\n * Zeroizes typed arrays in place. Warning: JS provides no guarantees.\n * @param arrays - arrays to overwrite with zeros\n * @example\n * Zeroize sensitive buffers in place.\n * ```ts\n * clean(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport function clean(...arrays) {\n for (let i = 0; i < arrays.length; i++) {\n arrays[i].fill(0);\n }\n}\n/**\n * Creates a DataView for byte-level manipulation.\n * @param arr - source typed array\n * @returns DataView over the same buffer region.\n * @example\n * Create a DataView over an existing buffer.\n * ```ts\n * createView(new Uint8Array(4));\n * ```\n */\nexport function createView(arr) {\n return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);\n}\n/**\n * Rotate-right operation for uint32 values.\n * @param word - source word\n * @param shift - shift amount in bits\n * @returns Rotated word.\n * @example\n * Rotate a 32-bit word to the right.\n * ```ts\n * rotr(0x12345678, 8);\n * ```\n */\nexport function rotr(word, shift) {\n return (word << (32 - shift)) | (word >>> shift);\n}\n/**\n * Rotate-left operation for uint32 values.\n * @param word - source word\n * @param shift - shift amount in bits\n * @returns Rotated word.\n * @example\n * Rotate a 32-bit word to the left.\n * ```ts\n * rotl(0x12345678, 8);\n * ```\n */\nexport function rotl(word, shift) {\n return (word << shift) | ((word >>> (32 - shift)) >>> 0);\n}\n/** Whether the current platform is little-endian. */\nexport const isLE = /* @__PURE__ */ (() => new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44)();\n/**\n * Byte-swap operation for uint32 values.\n * @param word - source word\n * @returns Word with reversed byte order.\n * @example\n * Reverse the byte order of a 32-bit word.\n * ```ts\n * byteSwap(0x11223344);\n * ```\n */\nexport function byteSwap(word) {\n return (((word << 24) & 0xff000000) |\n ((word << 8) & 0xff0000) |\n ((word >>> 8) & 0xff00) |\n ((word >>> 24) & 0xff));\n}\n/**\n * Conditionally byte-swaps one 32-bit word on big-endian platforms.\n * @param n - source word\n * @returns Original or byte-swapped word depending on platform endianness.\n * @example\n * Normalize a 32-bit word for host endianness.\n * ```ts\n * swap8IfBE(0x11223344);\n * ```\n */\nexport const swap8IfBE = isLE\n ? (n) => n\n : (n) => byteSwap(n) >>> 0;\n/**\n * Byte-swaps every word of a Uint32Array in place.\n * @param arr - array to mutate\n * @returns The same array after mutation; callers pass live state arrays here.\n * @example\n * Reverse the byte order of every word in place.\n * ```ts\n * byteSwap32(new Uint32Array([0x11223344]));\n * ```\n */\nexport function byteSwap32(arr) {\n for (let i = 0; i < arr.length; i++) {\n arr[i] = byteSwap(arr[i]);\n }\n return arr;\n}\n/**\n * Conditionally byte-swaps a Uint32Array on big-endian platforms.\n * @param u - array to normalize for host endianness\n * @returns Original or byte-swapped array depending on platform endianness.\n * On big-endian runtimes this mutates `u` in place via `byteSwap32(...)`.\n * @example\n * Normalize a word array for host endianness.\n * ```ts\n * swap32IfBE(new Uint32Array([0x11223344]));\n * ```\n */\nexport const swap32IfBE = isLE\n ? (u) => u\n : byteSwap32;\n// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex\nconst hasHexBuiltin = /* @__PURE__ */ (() => \n// @ts-ignore\ntypeof Uint8Array.from([]).toHex === 'function' && typeof Uint8Array.fromHex === 'function')();\n// Array where index 0xf0 (240) is mapped to string 'f0'\nconst hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0'));\n/**\n * Convert byte array to hex string.\n * Uses the built-in function when available and assumes it matches the tested\n * fallback semantics.\n * @param bytes - bytes to encode\n * @returns Lowercase hexadecimal string.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Convert bytes to lowercase hexadecimal.\n * ```ts\n * bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])); // 'cafe0123'\n * ```\n */\nexport function bytesToHex(bytes) {\n abytes(bytes);\n // @ts-ignore\n if (hasHexBuiltin)\n return bytes.toHex();\n // pre-caching improves the speed 6x\n let hex = '';\n for (let i = 0; i < bytes.length; i++) {\n hex += hexes[bytes[i]];\n }\n return hex;\n}\n// Strict ASCII nibble parser: non-ASCII hex lookalikes are rejected as undefined.\n// ASCII codes: '0'..'9' = 48..57, 'A'..'F' = 65..70, 'a'..'f' = 97..102.\n// prettier-ignore\nfunction asciiToBase16(ch) {\n return ch >= 48 && ch <= 57 ? ch - 48 // '2' => 50-48\n : ch >= 65 && ch <= 70 ? ch - (65 - 10) // 'B' => 66-(65-10)\n : ch >= 97 && ch <= 102 ? ch - (97 - 10) // 'b' => 98-(97-10)\n : undefined;\n}\n/**\n * Convert hex string to byte array. Uses built-in function, when available.\n * @param hex - hexadecimal string to decode\n * @returns Decoded bytes.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * Decode lowercase hexadecimal into bytes.\n * ```ts\n * hexToBytes('cafe0123'); // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])\n * ```\n */\nexport function hexToBytes(hex) {\n if (typeof hex !== 'string')\n throw new TypeError('hex string expected, got ' + typeof hex);\n if (hasHexBuiltin) {\n try {\n return Uint8Array.fromHex(hex);\n }\n catch (error) {\n if (error instanceof SyntaxError)\n throw new RangeError(error.message);\n throw error;\n }\n }\n const hl = hex.length;\n const al = hl / 2;\n if (hl % 2)\n throw new RangeError('hex string expected, got unpadded hex of length ' + hl);\n const array = new Uint8Array(al);\n for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) {\n const n1 = asciiToBase16(hex.charCodeAt(hi)); // parse first char, multiply it by 16\n const n2 = asciiToBase16(hex.charCodeAt(hi + 1)); // parse second char\n if (n1 === undefined || n2 === undefined) {\n const char = hex[hi] + hex[hi + 1];\n throw new RangeError('hex string expected, got non-hex character \"' + char + '\" at index ' + hi);\n }\n array[ai] = n1 * 16 + n2; // example: 'A9' => 10*16 + 9\n }\n return array;\n}\n/**\n * Yields to the host task scheduler so timers, I/O, and rendering can make progress.\n * Uses the Web Scheduling API when available or `setTimeout` as a cross-platform fallback.\n * Host-task yields are much slower than microtasks (roughly 1ms with the timer fallback), so\n * async loops should use `asyncTick >= 10` to amortize scheduling overhead to about 10% while\n * still allowing other event-loop work to proceed.\n * @param onReject - optional cleanup invoked only if the host yield fails\n * @example\n * Yield to the next scheduler tick.\n * ```ts\n * await nextTick();\n * ```\n */\nexport function nextTick(onReject) {\n const host = globalThis;\n if (typeof host.scheduler?.yield === 'function') {\n const promise = host.scheduler.yield();\n // Keep the original scheduler rejection; this handler exists only for cleanup.\n if (onReject)\n promise.catch(onReject);\n return promise;\n }\n return new Promise((resolve) => host.setTimeout(resolve, 0));\n}\n/**\n * Returns control to the host event loop every `tick` milliseconds to avoid blocking long loops.\n * @param iters - number of loop iterations to run\n * @param tick - maximum time slice in milliseconds\n * @param cb - callback executed on each iteration\n * @param onReject - optional cleanup invoked only if a host yield fails\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * Run a loop that periodically yields back to the event loop.\n * ```ts\n * await asyncLoop(2, 0, () => {});\n * ```\n */\nexport async function asyncLoop(iters, tick, cb, onReject) {\n anumber(iters, 'iters');\n anumber(tick, 'tick');\n if (typeof cb !== 'function')\n throw new TypeError('callback must be a function');\n // Callback is synchronous by contract; asyncLoop only yields between sync work windows.\n let ts = Date.now();\n for (let i = 0; i < iters; i++) {\n cb(i);\n // Date.now() is not monotonic, so in case if clock goes backwards we return return control too\n const diff = Date.now() - ts;\n if (diff >= 0 && diff < tick)\n continue;\n await nextTick(onReject);\n // Track only synchronous work time; scheduler delay after yielding is outside our budget.\n ts = Date.now();\n }\n}\n/**\n * Converts string to bytes using UTF8 encoding.\n * Built-in doesn't validate input to be string: we do the check.\n * Non-ASCII details are delegated to the platform `TextEncoder`.\n * @param str - string to encode\n * @returns UTF-8 encoded bytes.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Encode a string as UTF-8 bytes.\n * ```ts\n * utf8ToBytes('abc'); // Uint8Array.from([97, 98, 99])\n * ```\n */\nexport function utf8ToBytes(str) {\n if (typeof str !== 'string')\n throw new TypeError('string expected');\n const encoded = new TextEncoder().encode(str);\n try {\n // Copy into the current realm for Firefox extension contexts. Callers that own the returned\n // buffer can then wipe it independently of TextEncoder's temporary result.\n return new Uint8Array(encoded); // https://bugzil.la/1681809\n }\n finally {\n clean(encoded);\n }\n}\n/**\n * Helper for KDFs: consumes Uint8Array or string.\n * String inputs are UTF-8 encoded; byte-array inputs stay aliased to the caller buffer.\n * @param data - user-provided KDF input\n * @param errorTitle - label included in thrown errors\n * @returns Byte representation of the input.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Normalize KDF input to bytes.\n * ```ts\n * kdfInputToBytes('password');\n * ```\n */\nexport function kdfInputToBytes(data, errorTitle = '') {\n if (typeof data === 'string')\n return utf8ToBytes(data);\n return abytes(data, undefined, errorTitle);\n}\n/**\n * Copies several Uint8Arrays into one.\n * @param arrays - arrays to concatenate\n * @returns Concatenated byte array.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Concatenate multiple byte arrays.\n * ```ts\n * concatBytes(new Uint8Array([1]), new Uint8Array([2]));\n * ```\n */\nexport function concatBytes(...arrays) {\n let sum = 0;\n for (let i = 0; i < arrays.length; i++) {\n const a = arrays[i];\n abytes(a);\n sum += a.length;\n }\n const res = new Uint8Array(sum);\n for (let i = 0, pad = 0; i < arrays.length; i++) {\n const a = arrays[i];\n res.set(a, pad);\n pad += a.length;\n }\n return res;\n}\n/**\n * Validates declared required and optional field types on a plain object.\n * This walks field schemas and formats detailed errors, so avoid it on hot paths; use direct\n * one-line guards such as `abytes()`, `abool()`, or `anumber()` instead.\n * @param object - object to validate\n * @param fields - map of required field names to expected types\n * @param optFields - map of optional field names to expected types\n * @param title - label included in thrown errors\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Validate required and optional option fields.\n * ```ts\n * validateObject({ N: 1024, dkLen: 32 }, { N: 'number' }, { dkLen: 'number' });\n * ```\n */\nexport const validateObject = (object, fields = {}, optFields = {}, title = 'object') => {\n aobject(object, title);\n aobject(fields, 'fields');\n aobject(optFields, 'optFields');\n function checkField(fieldName, expectedType, isOpt) {\n const label = title === 'object' ? `param \"${String(fieldName)}\"` : `\"${title}.${String(fieldName)}\"`;\n // Config fields must be explicit own properties. Optional inherited values are rejected too\n // because callers keep reading the same options object after validation.\n const val = object[fieldName];\n // Runtime objects such as Field instances intentionally satisfy required method slots\n // via their shared prototype.\n if (!Object.hasOwn(object, fieldName) &&\n (isOpt ? val !== undefined : expectedType !== 'function')) {\n throw new TypeError(`${label} is invalid: expected own property`);\n }\n if (isOpt && val === undefined)\n return;\n const current = typeof val;\n if (current !== expectedType || val === null)\n throw new TypeError(`${label} is invalid: expected ${expectedType}, got ${current}`);\n }\n const iter = (f, isOpt) => Object.entries(f).forEach(([k, v]) => checkField(k, v, isOpt));\n iter(fields, false);\n iter(optFields, true);\n};\n/**\n * Merges default options and passed options.\n * @param defaults - base option object\n * @param opts - user overrides\n * @param title - label included in thrown override errors\n * @returns Fresh merged option object with a null prototype.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Merge user overrides onto default options.\n * ```ts\n * checkOpts({ dkLen: 32 }, { asyncTick: 10 });\n * ```\n */\nexport function checkOpts(defaults, opts, title = 'opts') {\n aopts(defaults, 'defaults');\n if (opts !== undefined)\n aopts(opts, title);\n // Callers read optional fields directly, so omitted values must not fall through to ambient\n // Object.prototype pollution (for example a forged `dkLen` changing SHAKE's default output).\n const merged = Object.assign(Object.create(null), defaults, opts);\n return merged;\n}\n/**\n * Creates a callable hash function from a stateful class constructor.\n * @param hashCons - hash constructor or factory\n * @param info - optional metadata such as DER OID\n * @returns Frozen callable hash wrapper with `.create()`.\n * Wrapper construction eagerly calls `hashCons(undefined)` once to read\n * `outputLen` / `blockLen`, so constructor side effects happen at module\n * init time.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Wrap a stateful hash constructor into a callable helper.\n * ```ts\n * import { createHasher } from '@noble/hashes/utils.js';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * const wrapped = createHasher(sha256.create, { oid: sha256.oid });\n * wrapped(new Uint8Array([1]));\n * ```\n */\nexport function createHasher(hashCons, info = {}) {\n if (typeof hashCons !== 'function')\n throw new TypeError('\"hashCons\" expected function, got type=' + typeof hashCons);\n info = checkOpts({}, info, 'info');\n const hashC = (msg, opts) => hashCons(opts)\n .update(msg)\n .digest();\n const tmp = hashCons(undefined);\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.canXOF = tmp.canXOF;\n hashC.create = (opts) => hashCons(opts);\n Object.assign(hashC, info);\n return Object.freeze(hashC);\n}\n/**\n * Cryptographically secure PRNG backed by `crypto.getRandomValues`.\n * @param bytesLength - number of random bytes to generate\n * @returns Random bytes.\n * The platform `getRandomValues()` implementation still defines any\n * single-call length cap, and this helper rejects oversize requests\n * with a stable library `RangeError` instead of host-specific errors.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @throws If the current runtime does not provide `crypto.getRandomValues`. {@link Error}\n * @example\n * Generate a fresh random key or nonce.\n * ```ts\n * const key = randomBytes(16);\n * ```\n */\nexport function randomBytes(bytesLength = 32) {\n // Match the repo's other length-taking helpers instead of relying on Uint8Array coercion.\n anumber(bytesLength, 'bytesLength');\n const cr = typeof globalThis === 'object' ? globalThis.crypto : null;\n if (typeof cr?.getRandomValues !== 'function')\n throw new Error('crypto.getRandomValues must be defined');\n // Web Cryptography API Level 2 §10.1.1:\n // if `byteLength > 65536`, throw `QuotaExceededError`.\n // Keep the guard explicit so callers can see the quota in code\n // instead of discovering it by reading the spec or host errors.\n // This wrapper surfaces the same quota as a stable library RangeError.\n if (bytesLength > 65536)\n throw new RangeError(`\"bytesLength\" expected <= 65536, got ${bytesLength}`);\n return cr.getRandomValues(new Uint8Array(bytesLength));\n}\n/**\n * Creates OID metadata for NIST hashes with prefix `06 09 60 86 48 01 65 03 04 02`.\n * @param suffix - final OID byte for the selected hash.\n * The helper accepts any byte even though only the documented NIST hash\n * suffixes are meaningful downstream.\n * @returns Object containing the DER-encoded OID.\n * @example\n * Build OID metadata for a NIST hash.\n * ```ts\n * oidNist(0x01);\n * ```\n */\nexport const oidNist = (suffix) => ({\n // Current NIST hashAlgs suffixes used here fit in one DER subidentifier octet.\n // Larger suffix values would need base-128 OID encoding and a different length byte.\n oid: Uint8Array.from([0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, suffix]),\n});\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;AAUA,SAAgB,QAAQ,GAAG;CAKvB,OAAQ,aAAa,cAChB,YAAY,OAAO,CAAC,KACjB,EAAE,YAAY,SAAS,gBACvB,uBAAuB,KACvB,EAAE,sBAAsB;AACpC;AAGA,IAAM,UAAU,UAAW,QAAQ,IAAI,MAAM,MAAM;;;;;;;;;;;;;;AAcnD,SAAgB,QAAQ,GAAG,QAAQ,IAAI;CACnC,IAAI,OAAO,MAAM,UACb,MAAM,IAAI,UAAU,OAAO,KAAK,IAAI,0BAA0B,OAAO,CAAC;CAC1E,IAAI,CAAC,OAAO,cAAc,CAAC,KAAK,IAAI,GAChC,MAAM,IAAI,WAAW,OAAO,KAAK,IAAI,gCAAgC,CAAC;CAC1E,OAAO;AACX;;;;;;;;;;;;;;;AAgCA,SAAgB,OAAO,OAAO,QAAQ,QAAQ,IAAI;CAG9C,IAAI,QAAQ,KAAK,MAAM,WAAW,KAAA,KAAa,MAAM,WAAW,SAC5D,OAAO;CAEX,IAAI,WAAW,KAAA,GACX,QAAQ,QAAQ,QAAQ;CAC5B,MAAM,QAAQ,QAAQ,KAAK;CAC3B,MAAM,QAAQ,WAAW,KAAA,IAAY,cAAc,WAAW;CAC9D,MAAM,MAAM,QAAQ,UAAU,MAAM,WAAW,QAAQ,OAAO;CAC9D,MAAM,UAAU,OAAO,KAAK,IAAI,wBAAwB,QAAQ,WAAW;CAC3E,IAAI,CAAC,OACD,MAAM,IAAI,UAAU,OAAO;CAC/B,MAAM,IA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anced-match@4.0.4/node_modules/balanced-match/dist/esm/index.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
//#region ../../node_modules/.pnpm/balanced-match@4.0.4/node_modules/balanced-match/dist/esm/index.js
|
|
2
|
-
var balanced = (a, b, str) => {
|
|
3
|
-
const ma = a instanceof RegExp ? maybeMatch(a, str) : a;
|
|
4
|
-
const mb = b instanceof RegExp ? maybeMatch(b, str) : b;
|
|
5
|
-
const r = ma !== null && mb != null && range(ma, mb, str);
|
|
6
|
-
return r && {
|
|
7
|
-
start: r[0],
|
|
8
|
-
end: r[1],
|
|
9
|
-
pre: str.slice(0, r[0]),
|
|
10
|
-
body: str.slice(r[0] + ma.length, r[1]),
|
|
11
|
-
post: str.slice(r[1] + mb.length)
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
var maybeMatch = (reg, str) => {
|
|
15
|
-
const m = str.match(reg);
|
|
16
|
-
return m ? m[0] : null;
|
|
17
|
-
};
|
|
18
|
-
var range = (a, b, str) => {
|
|
19
|
-
let begs, beg, left, right = void 0, result;
|
|
20
|
-
let ai = str.indexOf(a);
|
|
21
|
-
let bi = str.indexOf(b, ai + 1);
|
|
22
|
-
let i = ai;
|
|
23
|
-
if (ai >= 0 && bi > 0) {
|
|
24
|
-
if (a === b) return [ai, bi];
|
|
25
|
-
begs = [];
|
|
26
|
-
left = str.length;
|
|
27
|
-
while (i >= 0 && !result) {
|
|
28
|
-
if (i === ai) {
|
|
29
|
-
begs.push(i);
|
|
30
|
-
ai = str.indexOf(a, i + 1);
|
|
31
|
-
} else if (begs.length === 1) {
|
|
32
|
-
const r = begs.pop();
|
|
33
|
-
if (r !== void 0) result = [r, bi];
|
|
34
|
-
} else {
|
|
35
|
-
beg = begs.pop();
|
|
36
|
-
if (beg !== void 0 && beg < left) {
|
|
37
|
-
left = beg;
|
|
38
|
-
right = bi;
|
|
39
|
-
}
|
|
40
|
-
bi = str.indexOf(b, i + 1);
|
|
41
|
-
}
|
|
42
|
-
i = ai < bi && ai >= 0 ? ai : bi;
|
|
43
|
-
}
|
|
44
|
-
if (begs.length && right !== void 0) result = [left, right];
|
|
45
|
-
}
|
|
46
|
-
return result;
|
|
47
|
-
};
|
|
48
|
-
//#endregion
|
|
49
|
-
export { balanced, range };
|
|
50
|
-
|
|
51
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/balanced-match@4.0.4/node_modules/balanced-match/dist/esm/index.js"],"sourcesContent":["export const balanced = (a, b, str) => {\n const ma = a instanceof RegExp ? maybeMatch(a, str) : a;\n const mb = b instanceof RegExp ? maybeMatch(b, str) : b;\n const r = ma !== null && mb != null && range(ma, mb, str);\n return (r && {\n start: r[0],\n end: r[1],\n pre: str.slice(0, r[0]),\n body: str.slice(r[0] + ma.length, r[1]),\n post: str.slice(r[1] + mb.length),\n });\n};\nconst maybeMatch = (reg, str) => {\n const m = str.match(reg);\n return m ? m[0] : null;\n};\nexport const range = (a, b, str) => {\n let begs, beg, left, right = undefined, result;\n let ai = str.indexOf(a);\n let bi = str.indexOf(b, ai + 1);\n let i = ai;\n if (ai >= 0 && bi > 0) {\n if (a === b) {\n return [ai, bi];\n }\n begs = [];\n left = str.length;\n while (i >= 0 && !result) {\n if (i === ai) {\n begs.push(i);\n ai = str.indexOf(a, i + 1);\n }\n else if (begs.length === 1) {\n const r = begs.pop();\n if (r !== undefined)\n result = [r, bi];\n }\n else {\n beg = begs.pop();\n if (beg !== undefined && beg < left) {\n left = beg;\n right = bi;\n }\n bi = str.indexOf(b, i + 1);\n }\n i = ai < bi && ai >= 0 ? ai : bi;\n }\n if (begs.length && right !== undefined) {\n result = [left, right];\n }\n }\n return result;\n};\n//# sourceMappingURL=index.js.map"],"x_google_ignoreList":[0],"mappings":";AAAA,IAAa,YAAY,GAAG,GAAG,QAAQ;CACnC,MAAM,KAAK,aAAa,SAAS,WAAW,GAAG,GAAG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KAAA,GACzB,SAAS,CAAC,MAAM,KAAK;CAE7B;CACA,OAAO;AACX"}
|
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
import { balanced } from "../../../../../balanced-match@4.0.4/node_modules/balanced-match/dist/esm/index.js";
|
|
2
|
-
//#region ../../node_modules/.pnpm/brace-expansion@5.0.11/node_modules/brace-expansion/dist/esm/index.js
|
|
3
|
-
var escSlash = "\0SLASH" + Math.random() + "\0";
|
|
4
|
-
var escOpen = "\0OPEN" + Math.random() + "\0";
|
|
5
|
-
var escClose = "\0CLOSE" + Math.random() + "\0";
|
|
6
|
-
var escComma = "\0COMMA" + Math.random() + "\0";
|
|
7
|
-
var escPeriod = "\0PERIOD" + Math.random() + "\0";
|
|
8
|
-
var escSlashPattern = new RegExp(escSlash, "g");
|
|
9
|
-
var escOpenPattern = new RegExp(escOpen, "g");
|
|
10
|
-
var escClosePattern = new RegExp(escClose, "g");
|
|
11
|
-
var escCommaPattern = new RegExp(escComma, "g");
|
|
12
|
-
var escPeriodPattern = new RegExp(escPeriod, "g");
|
|
13
|
-
var slashPattern = /\\\\/g;
|
|
14
|
-
var openPattern = /\\{/g;
|
|
15
|
-
var closePattern = /\\}/g;
|
|
16
|
-
var commaPattern = /\\,/g;
|
|
17
|
-
var periodPattern = /\\\./g;
|
|
18
|
-
var EXPANSION_MAX = 1e5;
|
|
19
|
-
var EXPANSION_MAX_LENGTH = 4e6;
|
|
20
|
-
var EXPANSION_MAX_DEPTH = 1e3;
|
|
21
|
-
function numeric(str) {
|
|
22
|
-
return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0);
|
|
23
|
-
}
|
|
24
|
-
function escapeBraces(str) {
|
|
25
|
-
return str.replace(slashPattern, escSlash).replace(openPattern, escOpen).replace(closePattern, escClose).replace(commaPattern, escComma).replace(periodPattern, escPeriod);
|
|
26
|
-
}
|
|
27
|
-
function unescapeBraces(str) {
|
|
28
|
-
return str.replace(escSlashPattern, "\\").replace(escOpenPattern, "{").replace(escClosePattern, "}").replace(escCommaPattern, ",").replace(escPeriodPattern, ".");
|
|
29
|
-
}
|
|
30
|
-
function pushAll(target, items) {
|
|
31
|
-
for (let i = 0; i < items.length; i++) target.push(items[i]);
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Basically just str.split(","), but handling cases
|
|
35
|
-
* where we have nested braced sections, which should be
|
|
36
|
-
* treated as individual members, like {a,{b,c},d}
|
|
37
|
-
*/
|
|
38
|
-
function parseCommaParts(str) {
|
|
39
|
-
const parts = [];
|
|
40
|
-
let carry = "";
|
|
41
|
-
for (;;) {
|
|
42
|
-
const m = balanced("{", "}", str);
|
|
43
|
-
if (!m) {
|
|
44
|
-
const tail = str.split(",");
|
|
45
|
-
tail[0] = carry + tail[0];
|
|
46
|
-
pushAll(parts, tail);
|
|
47
|
-
return parts;
|
|
48
|
-
}
|
|
49
|
-
const { pre, body, post } = m;
|
|
50
|
-
const p = pre.split(",");
|
|
51
|
-
p[0] = carry + p[0];
|
|
52
|
-
p[p.length - 1] += "{" + body + "}";
|
|
53
|
-
if (!post.length) {
|
|
54
|
-
pushAll(parts, p);
|
|
55
|
-
return parts;
|
|
56
|
-
}
|
|
57
|
-
carry = p.pop();
|
|
58
|
-
pushAll(parts, p);
|
|
59
|
-
str = post;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
function expand(str, options = {}) {
|
|
63
|
-
if (!str) return [];
|
|
64
|
-
const { max = EXPANSION_MAX, maxLength = EXPANSION_MAX_LENGTH, maxDepth = EXPANSION_MAX_DEPTH } = options;
|
|
65
|
-
if (str.slice(0, 2) === "{}") str = "\\{\\}" + str.slice(2);
|
|
66
|
-
return expand_(escapeBraces(str), max, maxLength, maxDepth, 0, true).map(unescapeBraces);
|
|
67
|
-
}
|
|
68
|
-
function embrace(str) {
|
|
69
|
-
return "{" + str + "}";
|
|
70
|
-
}
|
|
71
|
-
function isPadded(el) {
|
|
72
|
-
return /^-?0\d/.test(el);
|
|
73
|
-
}
|
|
74
|
-
function lte(i, y) {
|
|
75
|
-
return i <= y;
|
|
76
|
-
}
|
|
77
|
-
function gte(i, y) {
|
|
78
|
-
return i >= y;
|
|
79
|
-
}
|
|
80
|
-
function combine(acc, pre, values, max, maxLength, dropEmpties) {
|
|
81
|
-
const out = [];
|
|
82
|
-
let length = 0;
|
|
83
|
-
for (let a = 0; a < acc.length; a++) for (let v = 0; v < values.length; v++) {
|
|
84
|
-
if (out.length >= max) return out;
|
|
85
|
-
const expansion = acc[a] + pre + values[v];
|
|
86
|
-
if (dropEmpties && !expansion) continue;
|
|
87
|
-
if (length + expansion.length > maxLength) return out;
|
|
88
|
-
out.push(expansion);
|
|
89
|
-
length += expansion.length;
|
|
90
|
-
}
|
|
91
|
-
return out;
|
|
92
|
-
}
|
|
93
|
-
function expandSequence(body, isAlphaSequence, max, maxLength) {
|
|
94
|
-
const n = body.split(/\.\./);
|
|
95
|
-
const N = [];
|
|
96
|
-
/* c8 ignore start */
|
|
97
|
-
if (n[0] === void 0 || n[1] === void 0) return N;
|
|
98
|
-
/* c8 ignore stop */
|
|
99
|
-
const x = numeric(n[0]);
|
|
100
|
-
const y = numeric(n[1]);
|
|
101
|
-
const width = Math.max(n[0].length, n[1].length);
|
|
102
|
-
let incr = n.length === 3 && n[2] !== void 0 ? Math.max(Math.abs(numeric(n[2])), 1) : 1;
|
|
103
|
-
let test = lte;
|
|
104
|
-
if (y < x) {
|
|
105
|
-
incr *= -1;
|
|
106
|
-
test = gte;
|
|
107
|
-
}
|
|
108
|
-
const pad = n.some(isPadded);
|
|
109
|
-
let length = 0;
|
|
110
|
-
for (let i = x; test(i, y) && N.length < max; i += incr) {
|
|
111
|
-
let c;
|
|
112
|
-
if (isAlphaSequence) {
|
|
113
|
-
c = String.fromCharCode(i);
|
|
114
|
-
if (c === "\\") c = "";
|
|
115
|
-
} else {
|
|
116
|
-
c = String(i);
|
|
117
|
-
if (pad) {
|
|
118
|
-
const need = width - c.length;
|
|
119
|
-
if (need > 0) {
|
|
120
|
-
const z = new Array(need + 1).join("0");
|
|
121
|
-
if (i < 0) c = "-" + z + c.slice(1);
|
|
122
|
-
else c = z + c;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
if (length + c.length > maxLength) break;
|
|
127
|
-
N.push(c);
|
|
128
|
-
length += c.length;
|
|
129
|
-
}
|
|
130
|
-
return N;
|
|
131
|
-
}
|
|
132
|
-
function expand_(str, max, maxLength, maxDepth, depth, isTop) {
|
|
133
|
-
if (depth > maxDepth) return [str];
|
|
134
|
-
let acc = [""];
|
|
135
|
-
let dropEmpties = false;
|
|
136
|
-
let firstGroup = true;
|
|
137
|
-
for (;;) {
|
|
138
|
-
const m = balanced("{", "}", str);
|
|
139
|
-
if (!m) return combine(acc, str, [""], max, maxLength, dropEmpties);
|
|
140
|
-
const pre = m.pre;
|
|
141
|
-
if (/\$$/.test(pre)) {
|
|
142
|
-
acc = combine(acc, pre + "{" + m.body + "}", [""], max, maxLength, dropEmpties && !m.post.length);
|
|
143
|
-
firstGroup = false;
|
|
144
|
-
if (!m.post.length) break;
|
|
145
|
-
str = m.post;
|
|
146
|
-
continue;
|
|
147
|
-
}
|
|
148
|
-
const isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
|
|
149
|
-
const isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
|
|
150
|
-
const isSequence = isNumericSequence || isAlphaSequence;
|
|
151
|
-
const isOptions = m.body.indexOf(",") >= 0;
|
|
152
|
-
if (!isSequence && !isOptions) {
|
|
153
|
-
if (m.post.match(/,(?!,).*\}/)) {
|
|
154
|
-
str = m.pre + "{" + m.body + escClose + m.post;
|
|
155
|
-
isTop = true;
|
|
156
|
-
continue;
|
|
157
|
-
}
|
|
158
|
-
return combine(acc, pre + "{" + m.body + "}" + m.post, [""], max, maxLength, dropEmpties);
|
|
159
|
-
}
|
|
160
|
-
if (firstGroup) {
|
|
161
|
-
dropEmpties = isTop && !isSequence;
|
|
162
|
-
firstGroup = false;
|
|
163
|
-
}
|
|
164
|
-
let values;
|
|
165
|
-
if (isSequence) values = expandSequence(m.body, isAlphaSequence, max, maxLength);
|
|
166
|
-
else {
|
|
167
|
-
let n = parseCommaParts(m.body);
|
|
168
|
-
if (n.length === 1 && n[0] !== void 0) {
|
|
169
|
-
n = expand_(n[0], max, maxLength, maxDepth, depth + 1, false).map(embrace);
|
|
170
|
-
/* c8 ignore start */
|
|
171
|
-
if (n.length === 1) {
|
|
172
|
-
acc = combine(acc, pre + n[0], [""], max, maxLength, dropEmpties && !m.post.length);
|
|
173
|
-
if (!m.post.length) break;
|
|
174
|
-
str = m.post;
|
|
175
|
-
continue;
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
let dropsEmpties = dropEmpties && !m.post.length && !pre;
|
|
179
|
-
for (let d = 0; dropsEmpties && d < acc.length; d++) if (acc[d]) dropsEmpties = false;
|
|
180
|
-
values = [];
|
|
181
|
-
let valuesLength = 0;
|
|
182
|
-
outer: for (let j = 0; j < n.length; j++) {
|
|
183
|
-
const expanded = expand_(n[j], max, maxLength, maxDepth, depth + 1, false);
|
|
184
|
-
for (let k = 0; k < expanded.length; k++) {
|
|
185
|
-
const v = expanded[k];
|
|
186
|
-
if (dropsEmpties && !v) continue;
|
|
187
|
-
if (values.length >= max || valuesLength + v.length > maxLength) break outer;
|
|
188
|
-
values.push(v);
|
|
189
|
-
valuesLength += v.length;
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
acc = combine(acc, pre, values, max, maxLength, dropEmpties && !m.post.length);
|
|
194
|
-
if (!m.post.length) break;
|
|
195
|
-
str = m.post;
|
|
196
|
-
}
|
|
197
|
-
return acc;
|
|
198
|
-
}
|
|
199
|
-
//#endregion
|
|
200
|
-
export { EXPANSION_MAX, EXPANSION_MAX_DEPTH, EXPANSION_MAX_LENGTH, expand };
|
|
201
|
-
|
|
202
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/brace-expansion@5.0.11/node_modules/brace-expansion/dist/esm/index.js"],"sourcesContent":["import { balanced } from 'balanced-match';\nconst escSlash = '\\0SLASH' + Math.random() + '\\0';\nconst escOpen = '\\0OPEN' + Math.random() + '\\0';\nconst escClose = '\\0CLOSE' + Math.random() + '\\0';\nconst escComma = '\\0COMMA' + Math.random() + '\\0';\nconst escPeriod = '\\0PERIOD' + Math.random() + '\\0';\nconst escSlashPattern = new RegExp(escSlash, 'g');\nconst escOpenPattern = new RegExp(escOpen, 'g');\nconst escClosePattern = new RegExp(escClose, 'g');\nconst escCommaPattern = new RegExp(escComma, 'g');\nconst escPeriodPattern = new RegExp(escPeriod, 'g');\nconst slashPattern = /\\\\\\\\/g;\nconst openPattern = /\\\\{/g;\nconst closePattern = /\\\\}/g;\nconst commaPattern = /\\\\,/g;\nconst periodPattern = /\\\\\\./g;\nexport const EXPANSION_MAX = 100_000;\n// `EXPANSION_MAX` caps the *number* of expansions, but not their length. An\n// input like `'{a,b}'.repeat(1500)` stays under that count - its output is\n// truncated to 100k results - while making every result ~1500 characters\n// long. The result set, and the intermediate arrays built while combining\n// brace sets, then grow large enough to exhaust memory and crash the process\n// (CVE-2026-14257). `EXPANSION_MAX_LENGTH` bounds the total number of\n// characters the accumulator may hold at any point, so memory stays flat no\n// matter how many brace groups are chained. The limit sits well above any\n// realistic expansion (100k results hitting `EXPANSION_MAX` measure ~1M\n// characters) so legitimate input is unaffected.\nexport const EXPANSION_MAX_LENGTH = 4_000_000;\n// `expand_` recurses once per level of brace *nesting* - both when expanding a\n// set's comma members and when re-wrapping a set whose body is a single part.\n// The CVE-2026-14257 fix made the *tail* iterative (recursion on `m.post`, one\n// level per chained group), which left nesting depth unbounded: about 3,100\n// levels of `{{{...a,b...}}}` - only ~6KB of input - exhausted the native stack\n// and crashed the process. `EXPANSION_MAX_DEPTH` bounds how deep the parser\n// will follow nesting. It sits far above any realistic pattern and well below\n// the depth at which the stack runs out.\nexport const EXPANSION_MAX_DEPTH = 1_000;\nfunction numeric(str) {\n return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0);\n}\nfunction escapeBraces(str) {\n return str\n .replace(slashPattern, escSlash)\n .replace(openPattern, escOpen)\n .replace(closePattern, escClose)\n .replace(commaPattern, escComma)\n .replace(periodPattern, escPeriod);\n}\nfunction unescapeBraces(str) {\n return str\n .replace(escSlashPattern, '\\\\')\n .replace(escOpenPattern, '{')\n .replace(escClosePattern, '}')\n .replace(escCommaPattern, ',')\n .replace(escPeriodPattern, '.');\n}\n// Like `target.push(...items)` but doesn't overflow the stack\nfunction pushAll(target, items) {\n for (let i = 0; i < items.length; i++) {\n target.push(items[i]);\n }\n}\n/**\n * Basically just str.split(\",\"), but handling cases\n * where we have nested braced sections, which should be\n * treated as individual members, like {a,{b,c},d}\n */\nfunction parseCommaParts(str) {\n const parts = [];\n // Walk the brace groups iteratively. Recursing on `post` once per group let a\n // chain of them exhaust the stack - the parsing-side counterpart to\n // the `expand_` overflow fixed for CVE-2026-14257, and not something `max` or\n // `maxLength` can bound, since it happens before expansion.\n //\n // The part the next chunk continues\n let carry = '';\n for (;;) {\n const m = balanced('{', '}', str);\n if (!m) {\n const tail = str.split(',');\n tail[0] = carry + tail[0];\n pushAll(parts, tail);\n return parts;\n }\n const { pre, body, post } = m;\n const p = pre.split(',');\n p[0] = carry + p[0];\n p[p.length - 1] += '{' + body + '}';\n if (!post.length) {\n pushAll(parts, p);\n return parts;\n }\n carry = p.pop();\n pushAll(parts, p);\n str = post;\n }\n}\nexport function expand(str, options = {}) {\n if (!str) {\n return [];\n }\n const { max = EXPANSION_MAX, maxLength = EXPANSION_MAX_LENGTH, maxDepth = EXPANSION_MAX_DEPTH, } = options;\n // I don't know why Bash 4.3 does this, but it does.\n // Anything starting with {} will have the first two bytes preserved\n // but *only* at the top level, so {},a}b will not expand to anything,\n // but a{},b}c will be expanded to [a}c,abc].\n // One could argue that this is a bug in Bash, but since the goal of\n // this module is to match Bash's rules, we escape a leading {}\n if (str.slice(0, 2) === '{}') {\n str = '\\\\{\\\\}' + str.slice(2);\n }\n return expand_(escapeBraces(str), max, maxLength, maxDepth, 0, true).map(unescapeBraces);\n}\nfunction embrace(str) {\n return '{' + str + '}';\n}\nfunction isPadded(el) {\n return /^-?0\\d/.test(el);\n}\nfunction lte(i, y) {\n return i <= y;\n}\nfunction gte(i, y) {\n return i >= y;\n}\n// Build `{ acc[a] + pre + values[v] }` for every combination, capping the\n// number of results at `max` and the total number of characters at `maxLength`.\n// This is the one place output grows, so bounding it here keeps the single\n// accumulator - and therefore memory - flat regardless of how many brace groups\n// are combined (CVE-2026-14257).\nfunction combine(acc, pre, values, max, maxLength, dropEmpties) {\n const out = [];\n let length = 0;\n for (let a = 0; a < acc.length; a++) {\n for (let v = 0; v < values.length; v++) {\n if (out.length >= max)\n return out;\n const expansion = acc[a] + pre + values[v];\n // Bash drops empty results at the top level. Skip them before they count\n // against `max`, so `max` bounds the number of *kept* results.\n if (dropEmpties && !expansion)\n continue;\n if (length + expansion.length > maxLength)\n return out;\n out.push(expansion);\n length += expansion.length;\n }\n }\n return out;\n}\n// The expansion values of a single numeric (`1..5`) or alphabetic (`a..e..2`)\n// sequence body.\nfunction expandSequence(body, isAlphaSequence, max, maxLength) {\n const n = body.split(/\\.\\./);\n const N = [];\n // A sequence body always splits into two or three parts, but the compiler\n // can't know that.\n /* c8 ignore start */\n if (n[0] === undefined || n[1] === undefined) {\n return N;\n }\n /* c8 ignore stop */\n const x = numeric(n[0]);\n const y = numeric(n[1]);\n const width = Math.max(n[0].length, n[1].length);\n let incr = n.length === 3 && n[2] !== undefined ?\n Math.max(Math.abs(numeric(n[2])), 1)\n : 1;\n let test = lte;\n const reverse = y < x;\n if (reverse) {\n incr *= -1;\n test = gte;\n }\n const pad = n.some(isPadded);\n let length = 0;\n for (let i = x; test(i, y) && N.length < max; i += incr) {\n let c;\n if (isAlphaSequence) {\n c = String.fromCharCode(i);\n if (c === '\\\\') {\n c = '';\n }\n }\n else {\n c = String(i);\n if (pad) {\n const need = width - c.length;\n if (need > 0) {\n const z = new Array(need + 1).join('0');\n if (i < 0) {\n c = '-' + z + c.slice(1);\n }\n else {\n c = z + c;\n }\n }\n }\n }\n if (length + c.length > maxLength)\n break;\n N.push(c);\n length += c.length;\n }\n return N;\n}\nfunction expand_(str, max, maxLength, maxDepth, depth, isTop) {\n // Too deeply nested to keep following: treat the rest as literal, the same\n // way a group that cannot expand is already handled. Truncating rather than\n // throwing keeps `expand` total, matching `max` and `maxLength`.\n if (depth > maxDepth) {\n return [str];\n }\n // Consume the string's top-level brace groups left to right, threading a\n // running set of combined prefixes (`acc`). Expanding the tail iteratively -\n // rather than recursing on `m.post` once per group - keeps the native stack\n // depth constant, so deeply chained input (`'{a,b}'.repeat(3000)`) can no\n // longer overflow the stack, and leaves a single accumulator whose size\n // `maxLength` bounds directly (CVE-2026-14257).\n let acc = [''];\n // Bash drops empty results, but only when the *first* top-level group is a\n // comma set - a sequence like `{a..\\}` may legitimately yield ''. The drop\n // is on the final strings, so it is applied to whichever `combine` produces\n // them (the one with no brace set left in the tail).\n let dropEmpties = false;\n let firstGroup = true;\n for (;;) {\n const m = balanced('{', '}', str);\n // No brace set left: the rest of the string is literal.\n if (!m) {\n return combine(acc, str, [''], max, maxLength, dropEmpties);\n }\n // no need to expand pre, since it is guaranteed to be free of brace-sets\n const pre = m.pre;\n if (/\\$$/.test(pre)) {\n acc = combine(acc, pre + '{' + m.body + '}', [''], max, maxLength, dropEmpties && !m.post.length);\n firstGroup = false;\n if (!m.post.length)\n break;\n str = m.post;\n continue;\n }\n const isNumericSequence = /^-?\\d+\\.\\.-?\\d+(?:\\.\\.-?\\d+)?$/.test(m.body);\n const isAlphaSequence = /^[a-zA-Z]\\.\\.[a-zA-Z](?:\\.\\.-?\\d+)?$/.test(m.body);\n const isSequence = isNumericSequence || isAlphaSequence;\n const isOptions = m.body.indexOf(',') >= 0;\n if (!isSequence && !isOptions) {\n // {a},b}\n if (m.post.match(/,(?!,).*\\}/)) {\n str = m.pre + '{' + m.body + escClose + m.post;\n isTop = true;\n continue;\n }\n // Nothing here expands, so the whole remaining string is literal.\n return combine(acc, pre + '{' + m.body + '}' + m.post, [''], max, maxLength, dropEmpties);\n }\n if (firstGroup) {\n dropEmpties = isTop && !isSequence;\n firstGroup = false;\n }\n let values;\n if (isSequence) {\n values = expandSequence(m.body, isAlphaSequence, max, maxLength);\n }\n else {\n let n = parseCommaParts(m.body);\n if (n.length === 1 && n[0] !== undefined) {\n // x{{a,b}}y ==> x{a}y x{b}y\n n = expand_(n[0], max, maxLength, maxDepth, depth + 1, false).map(embrace);\n //XXX is this necessary? Can't seem to hit it in tests.\n /* c8 ignore start */\n if (n.length === 1) {\n acc = combine(acc, pre + n[0], [''], max, maxLength, dropEmpties && !m.post.length);\n if (!m.post.length)\n break;\n str = m.post;\n continue;\n }\n /* c8 ignore stop */\n }\n // Values that `combine` is going to drop as empty produce no result, so\n // they must not count against `max` - otherwise `{a,,b}` with `max: 2`\n // would stop at `['a', '']` and yield one result instead of two. Skipping\n // them outright keeps `values` bounded while leaving `max` a bound on\n // *kept* results.\n let dropsEmpties = dropEmpties && !m.post.length && !pre;\n for (let d = 0; dropsEmpties && d < acc.length; d++) {\n if (acc[d]) {\n dropsEmpties = false;\n }\n }\n values = [];\n let valuesLength = 0;\n outer: for (let j = 0; j < n.length; j++) {\n const expanded = expand_(n[j], max, maxLength, maxDepth, depth + 1, false);\n for (let k = 0; k < expanded.length; k++) {\n const v = expanded[k];\n if (dropsEmpties && !v)\n continue;\n if (values.length >= max ||\n valuesLength + v.length > maxLength) {\n break outer;\n }\n values.push(v);\n valuesLength += v.length;\n }\n }\n }\n acc = combine(acc, pre, values, max, maxLength, dropEmpties && !m.post.length);\n if (!m.post.length)\n break;\n str = m.post;\n }\n return acc;\n}\n//# sourceMappingURL=index.js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
|
-
//#region ../../node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/assert-valid-pattern.js
|
|
2
|
-
var MAX_PATTERN_LENGTH = 1024 * 64;
|
|
3
|
-
var assertValidPattern = (pattern) => {
|
|
4
|
-
if (typeof pattern !== "string") throw new TypeError("invalid pattern");
|
|
5
|
-
if (pattern.length > MAX_PATTERN_LENGTH) throw new TypeError("pattern is too long");
|
|
6
|
-
};
|
|
7
|
-
//#endregion
|
|
8
|
-
export { assertValidPattern };
|
|
9
|
-
|
|
10
|
-
//# sourceMappingURL=assert-valid-pattern.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"assert-valid-pattern.js","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/assert-valid-pattern.js"],"sourcesContent":["const MAX_PATTERN_LENGTH = 1024 * 64;\nexport const assertValidPattern = (pattern) => {\n if (typeof pattern !== 'string') {\n throw new TypeError('invalid pattern');\n }\n if (pattern.length > MAX_PATTERN_LENGTH) {\n throw new TypeError('pattern is too long');\n }\n};\n//# sourceMappingURL=assert-valid-pattern.js.map"],"x_google_ignoreList":[0],"mappings":";AAAA,IAAM,qBAAqB,OAAO;AAClC,IAAa,sBAAsB,YAAY;CAC3C,IAAI,OAAO,YAAY,UACnB,MAAM,IAAI,UAAU,iBAAiB;CAEzC,IAAI,QAAQ,SAAS,oBACjB,MAAM,IAAI,UAAU,qBAAqB;AAEjD"}
|