@xyo-network/wasm 6.0.8 → 6.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -38,10 +38,12 @@ bun add {{name}}
38
38
 
39
39
  See the [LICENSE](LICENSE) file for license rights and limitations (LGPL-3.0-only).
40
40
 
41
+ ## Credits
41
42
 
43
+ [Made with 🔥 and ❄️ by XYO Foundation](https://xyo.network)
42
44
 
43
- [logo]: https://cdn.xy.company/img/brand/XYO_full_colored.png
44
45
  [npm-badge]: https://img.shields.io/npm/v/@xyo-network/wasm.svg
45
46
  [npm-link]: https://www.npmjs.com/package/@xyo-network/wasm
46
47
  [license-badge]: https://img.shields.io/npm/l/@xyo-network/wasm.svg
47
48
  [license-link]: https://github.com/xylabs/sdk-js/blob/main/LICENSE
49
+ [logo]: https://cdn.xy.company/img/brand/XYO_full_colored.png
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/wasm",
3
- "version": "6.0.8",
3
+ "version": "6.1.0",
4
4
  "description": "Primary SDK for using XYO Protocol 2.0",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -36,14 +36,10 @@
36
36
  "devDependencies": {
37
37
  "@opentelemetry/api": "^1.9.1",
38
38
  "@opentelemetry/sdk-trace-base": "^2.7.1",
39
- "@xylabs/sdk-js": "~6.0.6",
40
- "@xylabs/tsconfig": "~8.1.10",
41
- "@xylabs/vitest-extended": "^6.0.6",
39
+ "@xylabs/sdk-js": "^6.1.0",
40
+ "@xylabs/tsconfig": "~8.1.20",
41
+ "@xylabs/vitest-extended": "^6.1.0",
42
42
  "async-mutex": "^0.5.0",
43
- "bn.js": "^5.2.3",
44
- "buffer": "^6.0.3",
45
- "ethers": "^6.16.0",
46
- "pako": "^2.1",
47
43
  "typescript": "~6.0.3",
48
44
  "vite": "^8.0.16",
49
45
  "vitest": "~4.1.8",
@@ -54,10 +50,6 @@
54
50
  "@opentelemetry/sdk-trace-base": "^2.7",
55
51
  "@xylabs/sdk-js": "^6.0",
56
52
  "async-mutex": "^0.5",
57
- "bn.js": "^5.2",
58
- "buffer": "^6.0",
59
- "ethers": "^6.16",
60
- "pako": "^2.1",
61
53
  "zod": "^4.4"
62
54
  },
63
55
  "engines": {
@@ -1,110 +0,0 @@
1
- export declare const WasmFeatureDetectors: {
2
- readonly bigInt: () => Promise<boolean>;
3
- readonly bulkMemory: () => Promise<boolean>;
4
- readonly exceptions: () => Promise<boolean>;
5
- readonly extendedConst: () => Promise<boolean>;
6
- readonly gc: () => Promise<boolean>;
7
- readonly memory64: () => Promise<boolean>;
8
- readonly multiValue: () => Promise<boolean>;
9
- readonly mutableGlobals: () => Promise<boolean>;
10
- readonly referenceTypes: () => {
11
- new (executor: (resolve: (value: boolean | PromiseLike<boolean>) => void, reject: (reason?: any) => void) => void): Promise<boolean>;
12
- all<T>(values: Iterable<T | PromiseLike<T>>): Promise<Awaited<T>[]>;
13
- all<T extends readonly unknown[] | []>(values: T): Promise<{ -readonly [P in keyof T]: Awaited<T[P]>; }>;
14
- race<T>(values: Iterable<T | PromiseLike<T>>): Promise<Awaited<T>>;
15
- race<T extends readonly unknown[] | []>(values: T): Promise<Awaited<T[number]>>;
16
- readonly prototype: Promise<any>;
17
- reject<T = never>(reason?: any): Promise<T>;
18
- resolve(): Promise<void>;
19
- resolve<T>(value: T): Promise<Awaited<T>>;
20
- resolve<T>(value: T | PromiseLike<T>): Promise<Awaited<T>>;
21
- allSettled<T extends readonly unknown[] | []>(values: T): Promise<{ -readonly [P in keyof T]: PromiseSettledResult<Awaited<T[P]>>; }>;
22
- allSettled<T>(values: Iterable<T | PromiseLike<T>>): Promise<PromiseSettledResult<Awaited<T>>[]>;
23
- any<T extends readonly unknown[] | []>(values: T): Promise<Awaited<T[number]>>;
24
- any<T>(values: Iterable<T | PromiseLike<T>>): Promise<Awaited<T>>;
25
- withResolvers<T>(): PromiseWithResolvers<T>;
26
- try<T, U extends unknown[]>(callbackFn: (...args: U) => T | PromiseLike<T>, ...args: U): Promise<Awaited<T>>;
27
- readonly [Symbol.species]: PromiseConstructor;
28
- };
29
- readonly relaxedSimd: () => Promise<boolean>;
30
- readonly saturatedFloatToInt: () => Promise<boolean>;
31
- readonly signExtensions: () => Promise<boolean>;
32
- readonly simd: () => Promise<boolean>;
33
- readonly streamingCompilation: () => Promise<boolean>;
34
- readonly tailCall: () => Promise<boolean>;
35
- readonly threads: () => Promise<boolean>;
36
- };
37
- export type WasmFeature = keyof typeof WasmFeatureDetectors;
38
- export declare class WasmSupport {
39
- protected desiredFeatures: WasmFeature[];
40
- private _allowWasm;
41
- private _featureSupport;
42
- private _forceWasm;
43
- private _isInitialized;
44
- private _isWasmFeatureSetSupported;
45
- /**
46
- * Instance constructor for use where async instantiation
47
- * is not possible. Where possible, prefer the static
48
- * create method over use of this constructor directly
49
- * as no initialization (feature detection) is able to
50
- * be done here
51
- * @param desiredFeatures The desired feature set
52
- */
53
- constructor(desiredFeatures: WasmFeature[]);
54
- /**
55
- * Is Wasm allowed
56
- */
57
- get allowWasm(): boolean;
58
- /**
59
- * Whether or not to allow WASM usage
60
- */
61
- set allowWasm(v: boolean);
62
- /**
63
- * Whether or not Wasm should be used based on the desired
64
- * feature set, initialization state, or force-use settings
65
- */
66
- get canUseWasm(): boolean;
67
- /**
68
- * Returns a object containing a property for each desired wasm feature
69
- * with a boolean value indicating whether or not the feature is supported
70
- */
71
- get featureSupport(): Readonly<Partial<Record<WasmFeature, boolean>>>;
72
- /**
73
- * Force use of Wasm
74
- */
75
- get forceWasm(): boolean;
76
- /**
77
- * Whether or not to force Wasm usage
78
- */
79
- set forceWasm(v: boolean);
80
- /**
81
- * Whether or not Wasm is supported based
82
- * on the desired feature set
83
- */
84
- get isDesiredFeatureSetSupported(): boolean;
85
- /**
86
- * Whether or not Wasm detection has been run
87
- * for the desired feature set
88
- */
89
- get isInitialized(): boolean;
90
- /**
91
- * Static creation & async initialization for use where
92
- * async instantiation is possible
93
- * @param desiredFeatures The desired feature set
94
- * @returns An initialized instance of the class with detection
95
- * for the desired feature set
96
- */
97
- static create(desiredFeatures: WasmFeature[]): Promise<WasmSupport>;
98
- /**
99
- * Checks for specific wasm features
100
- * @param features The list of features to check for
101
- * @returns True if all the features are supported, false otherwise
102
- */
103
- featureCheck(features: WasmFeature[]): Promise<boolean>;
104
- /**
105
- * Does feature detection for the desired feature set
106
- */
107
- initialize(): Promise<void>;
108
- protected detectDesiredFeatures(): Promise<void>;
109
- }
110
- //# sourceMappingURL=WasmSupport.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WasmSupport.d.ts","sourceRoot":"","sources":["../../src/WasmSupport.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,oBAAoB;;;;;;;;;;iGAoCiB,CAAC;;qEAkBvB,CAC5B;;;;;;;;4EAlBK,CAAE;;;;;iDAQJ,GAAC;;;;;;;;;;CA5BM,CAAA;AAIV,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,oBAAoB,CAAA;AAE3D,qBAAa,WAAW;IACtB,SAAS,CAAC,eAAe,EAAE,WAAW,EAAE,CAAA;IAExC,OAAO,CAAC,UAAU,CAAO;IACzB,OAAO,CAAC,eAAe,CAA4C;IACnE,OAAO,CAAC,UAAU,CAAQ;IAC1B,OAAO,CAAC,cAAc,CAAQ;IAC9B,OAAO,CAAC,0BAA0B,CAAQ;IAE1C;;;;;;;OAOG;gBACS,eAAe,EAAE,WAAW,EAAE;IAI1C;;OAEG;IACH,IAAI,SAAS,IAAI,OAAO,CAEvB;IAED;;OAEG;IACH,IAAI,SAAS,CAAC,CAAC,EAAE,OAAO,EAEvB;IAED;;;OAGG;IACH,IAAI,UAAU,IAAI,OAAO,CASxB;IAED;;;OAGG;IACH,IAAI,cAAc,IAAI,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC,CAEpE;IAED;;OAEG;IACH,IAAI,SAAS,IAAI,OAAO,CAEvB;IAED;;OAEG;IACH,IAAI,SAAS,CAAC,CAAC,EAAE,OAAO,EAEvB;IAED;;;OAGG;IACH,IAAI,4BAA4B,IAAI,OAAO,CAE1C;IAED;;;OAGG;IACH,IAAI,aAAa,IAAI,OAAO,CAE3B;IAED;;;;;;OAMG;WACU,MAAM,CAAC,eAAe,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC;IAMzE;;;;OAIG;IACG,YAAY,CAAC,QAAQ,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;IAK7D;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;cAMjB,qBAAqB,IAAI,OAAO,CAAC,IAAI,CAAC;CAOvD"}
@@ -1,2 +0,0 @@
1
- export * from './WasmSupport.ts';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA"}
@@ -1,177 +0,0 @@
1
- // src/wasmFeatureDetect.ts
2
- var validate = (bytes) => Promise.resolve(WebAssembly.validate(new Uint8Array(bytes)));
3
- var bigInt = async () => {
4
- try {
5
- const mod = new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 6, 1, 96, 1, 126, 1, 126, 3, 2, 1, 0, 7, 5, 1, 1, 98, 0, 0, 10, 6, 1, 4, 0, 32, 0, 11]);
6
- const { instance } = await WebAssembly.instantiate(mod);
7
- const fn = instance.exports.b;
8
- return fn(0n) === 0n;
9
- } catch {
10
- return false;
11
- }
12
- };
13
- var bulkMemory = () => validate([0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 0, 0, 3, 2, 1, 0, 5, 3, 1, 0, 1, 10, 14, 1, 12, 0, 65, 0, 65, 0, 65, 0, 252, 10, 0, 0, 11]);
14
- var exceptions = () => validate([0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 0, 0, 3, 2, 1, 0, 10, 8, 1, 6, 0, 6, 64, 25, 11, 11]);
15
- var extendedConst = () => validate([0, 97, 115, 109, 1, 0, 0, 0, 5, 3, 1, 0, 1, 11, 9, 1, 0, 65, 1, 65, 2, 106, 11, 0]);
16
- var gc = () => validate([0, 97, 115, 109, 1, 0, 0, 0, 1, 5, 1, 95, 1, 120, 0]);
17
- var memory64 = () => validate([0, 97, 115, 109, 1, 0, 0, 0, 5, 3, 1, 4, 1]);
18
- var multiValue = () => validate([0, 97, 115, 109, 1, 0, 0, 0, 1, 6, 1, 96, 0, 2, 127, 127, 3, 2, 1, 0, 10, 8, 1, 6, 0, 65, 0, 65, 0, 11]);
19
- var mutableGlobals = () => validate([0, 97, 115, 109, 1, 0, 0, 0, 2, 8, 1, 1, 97, 1, 98, 3, 127, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 5, 1, 1, 97, 3, 1]);
20
- var relaxedSimd = () => validate([0, 97, 115, 109, 1, 0, 0, 0, 1, 5, 1, 96, 0, 1, 123, 3, 2, 1, 0, 10, 15, 1, 13, 0, 65, 1, 253, 15, 65, 2, 253, 15, 253, 128, 2, 11]);
21
- var saturatedFloatToInt = () => validate([0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 0, 0, 3, 2, 1, 0, 10, 12, 1, 10, 0, 67, 0, 0, 0, 0, 252, 0, 26, 11]);
22
- var signExtensions = () => validate([0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 0, 0, 3, 2, 1, 0, 10, 8, 1, 6, 0, 65, 0, 192, 26, 11]);
23
- var simd = () => validate([0, 97, 115, 109, 1, 0, 0, 0, 1, 5, 1, 96, 0, 1, 123, 3, 2, 1, 0, 10, 10, 1, 8, 0, 65, 0, 253, 15, 253, 98, 11]);
24
- var streamingCompilation = () => Promise.resolve("compileStreaming" in WebAssembly);
25
- var tailCall = () => validate([0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 0, 0, 3, 2, 1, 0, 10, 6, 1, 4, 0, 18, 0, 11]);
26
- var threads = async () => {
27
- try {
28
- const sharedAvailable = typeof MessageChannel !== "undefined" && (() => {
29
- try {
30
- new MessageChannel().port1.postMessage(new SharedArrayBuffer(1));
31
- return true;
32
- } catch {
33
- return false;
34
- }
35
- })();
36
- if (!sharedAvailable) return false;
37
- return WebAssembly.validate(new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 0, 0, 3, 2, 1, 0, 5, 4, 1, 3, 1, 1, 10, 11, 1, 9, 0, 65, 0, 254, 16, 2, 0, 26, 11]));
38
- } catch {
39
- return false;
40
- }
41
- };
42
-
43
- // src/WasmSupport.ts
44
- import { isTruthy } from "@xylabs/sdk-js";
45
- var WasmFeatureDetectors = {
46
- bigInt,
47
- bulkMemory,
48
- exceptions,
49
- extendedConst,
50
- gc,
51
- memory64,
52
- multiValue,
53
- mutableGlobals,
54
- referenceTypes: () => Promise,
55
- relaxedSimd,
56
- saturatedFloatToInt,
57
- signExtensions,
58
- simd,
59
- streamingCompilation,
60
- tailCall,
61
- threads
62
- };
63
- var WasmSupport = class _WasmSupport {
64
- desiredFeatures;
65
- _allowWasm = true;
66
- _featureSupport = {};
67
- _forceWasm = false;
68
- _isInitialized = false;
69
- _isWasmFeatureSetSupported = false;
70
- /**
71
- * Instance constructor for use where async instantiation
72
- * is not possible. Where possible, prefer the static
73
- * create method over use of this constructor directly
74
- * as no initialization (feature detection) is able to
75
- * be done here
76
- * @param desiredFeatures The desired feature set
77
- */
78
- constructor(desiredFeatures) {
79
- this.desiredFeatures = desiredFeatures;
80
- }
81
- /**
82
- * Is Wasm allowed
83
- */
84
- get allowWasm() {
85
- return this._allowWasm;
86
- }
87
- /**
88
- * Whether or not to allow WASM usage
89
- */
90
- set allowWasm(v) {
91
- this._allowWasm = v;
92
- }
93
- /**
94
- * Whether or not Wasm should be used based on the desired
95
- * feature set, initialization state, or force-use settings
96
- */
97
- get canUseWasm() {
98
- return (
99
- // Just force WASM
100
- this._forceWasm || this._allowWasm && !this._isInitialized || this._allowWasm && this._isInitialized && this._isWasmFeatureSetSupported
101
- );
102
- }
103
- /**
104
- * Returns a object containing a property for each desired wasm feature
105
- * with a boolean value indicating whether or not the feature is supported
106
- */
107
- get featureSupport() {
108
- return { ...this._featureSupport };
109
- }
110
- /**
111
- * Force use of Wasm
112
- */
113
- get forceWasm() {
114
- return this._forceWasm;
115
- }
116
- /**
117
- * Whether or not to force Wasm usage
118
- */
119
- set forceWasm(v) {
120
- this._forceWasm = v;
121
- }
122
- /**
123
- * Whether or not Wasm is supported based
124
- * on the desired feature set
125
- */
126
- get isDesiredFeatureSetSupported() {
127
- return this._isWasmFeatureSetSupported;
128
- }
129
- /**
130
- * Whether or not Wasm detection has been run
131
- * for the desired feature set
132
- */
133
- get isInitialized() {
134
- return this._isInitialized;
135
- }
136
- /**
137
- * Static creation & async initialization for use where
138
- * async instantiation is possible
139
- * @param desiredFeatures The desired feature set
140
- * @returns An initialized instance of the class with detection
141
- * for the desired feature set
142
- */
143
- static async create(desiredFeatures) {
144
- const instance = new _WasmSupport(desiredFeatures);
145
- await instance.initialize();
146
- return instance;
147
- }
148
- /**
149
- * Checks for specific wasm features
150
- * @param features The list of features to check for
151
- * @returns True if all the features are supported, false otherwise
152
- */
153
- async featureCheck(features) {
154
- const results = await Promise.all(features.map((feature) => WasmFeatureDetectors[feature]).map(async (detector) => await detector()));
155
- return results.every(Boolean);
156
- }
157
- /**
158
- * Does feature detection for the desired feature set
159
- */
160
- async initialize() {
161
- if (this._isInitialized) return;
162
- await this.detectDesiredFeatures();
163
- this._isInitialized = true;
164
- }
165
- async detectDesiredFeatures() {
166
- for (const desiredFeature of this.desiredFeatures) {
167
- const detector = WasmFeatureDetectors[desiredFeature];
168
- this._featureSupport[desiredFeature] = isTruthy(await detector());
169
- }
170
- this._isWasmFeatureSetSupported = Object.values(this._featureSupport).every(Boolean);
171
- }
172
- };
173
- export {
174
- WasmFeatureDetectors,
175
- WasmSupport
176
- };
177
- //# sourceMappingURL=index.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/wasmFeatureDetect.ts", "../../src/WasmSupport.ts"],
4
- "sourcesContent": ["/*\n * Vendored from wasm-feature-detect (MIT, https://github.com/GoogleChromeLabs/wasm-feature-detect)\n * Each detector validates a small precompiled WASM module that exercises one feature.\n */\n\nconst validate = (bytes: number[]): Promise<boolean> => Promise.resolve(WebAssembly.validate(new Uint8Array(bytes)))\n\nexport const bigInt = async (): Promise<boolean> => {\n try {\n const mod = new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 6, 1, 96, 1, 126, 1, 126, 3, 2, 1, 0, 7, 5, 1, 1, 98, 0, 0, 10, 6, 1, 4, 0, 32, 0, 11])\n const { instance } = await WebAssembly.instantiate(mod)\n const fn = instance.exports.b as (x: bigint) => bigint\n return fn(0n) === 0n\n } catch {\n return false\n }\n}\n\nexport const bulkMemory = (): Promise<boolean> => validate([0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 0, 0, 3, 2, 1, 0, 5, 3, 1, 0, 1, 10, 14, 1, 12, 0, 65, 0, 65, 0, 65, 0, 252, 10, 0, 0, 11])\n\nexport const exceptions = (): Promise<boolean> => validate([0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 0, 0, 3, 2, 1, 0, 10, 8, 1, 6, 0, 6, 64, 25, 11, 11])\n\nexport const extendedConst = (): Promise<boolean> => validate([0, 97, 115, 109, 1, 0, 0, 0, 5, 3, 1, 0, 1, 11, 9, 1, 0, 65, 1, 65, 2, 106, 11, 0])\n\nexport const gc = (): Promise<boolean> => validate([0, 97, 115, 109, 1, 0, 0, 0, 1, 5, 1, 95, 1, 120, 0])\n\nexport const memory64 = (): Promise<boolean> => validate([0, 97, 115, 109, 1, 0, 0, 0, 5, 3, 1, 4, 1])\n\nexport const multiValue = (): Promise<boolean> => validate([0, 97, 115, 109, 1, 0, 0, 0, 1, 6, 1, 96, 0, 2, 127, 127, 3, 2, 1, 0, 10, 8, 1, 6, 0, 65, 0, 65, 0, 11])\n\nexport const mutableGlobals = (): Promise<boolean> => validate([0, 97, 115, 109, 1, 0, 0, 0, 2, 8, 1, 1, 97, 1, 98, 3, 127, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 5, 1, 1, 97, 3, 1])\n\nexport const relaxedSimd = (): Promise<boolean> => validate([0, 97, 115, 109, 1, 0, 0, 0, 1, 5, 1, 96, 0, 1, 123, 3, 2, 1, 0, 10, 15, 1, 13, 0, 65, 1, 253, 15, 65, 2, 253, 15, 253, 128, 2, 11])\n\nexport const saturatedFloatToInt = (): Promise<boolean> => validate([0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 0, 0, 3, 2, 1, 0, 10, 12, 1, 10, 0, 67, 0, 0, 0, 0, 252, 0, 26, 11])\n\nexport const signExtensions = (): Promise<boolean> => validate([0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 0, 0, 3, 2, 1, 0, 10, 8, 1, 6, 0, 65, 0, 192, 26, 11])\n\nexport const simd = (): Promise<boolean> => validate([0, 97, 115, 109, 1, 0, 0, 0, 1, 5, 1, 96, 0, 1, 123, 3, 2, 1, 0, 10, 10, 1, 8, 0, 65, 0, 253, 15, 253, 98, 11])\n\nexport const streamingCompilation = (): Promise<boolean> => Promise.resolve('compileStreaming' in WebAssembly)\n\nexport const tailCall = (): Promise<boolean> => validate([0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 0, 0, 3, 2, 1, 0, 10, 6, 1, 4, 0, 18, 0, 11])\n\nexport const threads = async (): Promise<boolean> => {\n try {\n const sharedAvailable = typeof MessageChannel !== 'undefined'\n && (() => {\n try {\n new MessageChannel().port1.postMessage(new SharedArrayBuffer(1))\n return true\n } catch {\n return false\n }\n })()\n if (!sharedAvailable) return false\n return WebAssembly.validate(new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 0, 0, 3, 2, 1, 0, 5, 4, 1, 3, 1, 1, 10, 11, 1, 9, 0, 65, 0, 254, 16, 2, 0, 26, 11]))\n } catch {\n return false\n }\n}\n", "import {\n bigInt,\n bulkMemory,\n exceptions,\n extendedConst,\n gc,\n memory64,\n multiValue,\n mutableGlobals,\n relaxedSimd,\n saturatedFloatToInt,\n signExtensions,\n simd,\n streamingCompilation,\n tailCall,\n threads,\n} from './wasmFeatureDetect.ts'\n\nexport const WasmFeatureDetectors = {\n bigInt: bigInt,\n bulkMemory: bulkMemory,\n exceptions: exceptions,\n extendedConst: extendedConst,\n gc: gc,\n memory64: memory64,\n multiValue: multiValue,\n mutableGlobals: mutableGlobals,\n referenceTypes: () => Promise<boolean>,\n relaxedSimd: relaxedSimd,\n saturatedFloatToInt: saturatedFloatToInt,\n signExtensions: signExtensions,\n simd: simd,\n streamingCompilation: streamingCompilation,\n tailCall: tailCall,\n threads: threads,\n} as const\n\nimport { isTruthy } from '@xylabs/sdk-js'\n\nexport type WasmFeature = keyof typeof WasmFeatureDetectors\n\nexport class WasmSupport {\n protected desiredFeatures: WasmFeature[]\n\n private _allowWasm = true\n private _featureSupport: Partial<Record<WasmFeature, boolean>> = {}\n private _forceWasm = false\n private _isInitialized = false\n private _isWasmFeatureSetSupported = false\n\n /**\n * Instance constructor for use where async instantiation\n * is not possible. Where possible, prefer the static\n * create method over use of this constructor directly\n * as no initialization (feature detection) is able to\n * be done here\n * @param desiredFeatures The desired feature set\n */\n constructor(desiredFeatures: WasmFeature[]) {\n this.desiredFeatures = desiredFeatures\n }\n\n /**\n * Is Wasm allowed\n */\n get allowWasm(): boolean {\n return this._allowWasm\n }\n\n /**\n * Whether or not to allow WASM usage\n */\n set allowWasm(v: boolean) {\n this._allowWasm = v\n }\n\n /**\n * Whether or not Wasm should be used based on the desired\n * feature set, initialization state, or force-use settings\n */\n get canUseWasm(): boolean {\n return (\n // Just force WASM\n this._forceWasm\n // Or if we haven't checked be optimistic\n || (this._allowWasm && !this._isInitialized)\n // Or if we have checked and WASM is not supported, be realistic\n || (this._allowWasm && this._isInitialized && this._isWasmFeatureSetSupported)\n )\n }\n\n /**\n * Returns a object containing a property for each desired wasm feature\n * with a boolean value indicating whether or not the feature is supported\n */\n get featureSupport(): Readonly<Partial<Record<WasmFeature, boolean>>> {\n return { ...this._featureSupport }\n }\n\n /**\n * Force use of Wasm\n */\n get forceWasm(): boolean {\n return this._forceWasm\n }\n\n /**\n * Whether or not to force Wasm usage\n */\n set forceWasm(v: boolean) {\n this._forceWasm = v\n }\n\n /**\n * Whether or not Wasm is supported based\n * on the desired feature set\n */\n get isDesiredFeatureSetSupported(): boolean {\n return this._isWasmFeatureSetSupported\n }\n\n /**\n * Whether or not Wasm detection has been run\n * for the desired feature set\n */\n get isInitialized(): boolean {\n return this._isInitialized\n }\n\n /**\n * Static creation & async initialization for use where\n * async instantiation is possible\n * @param desiredFeatures The desired feature set\n * @returns An initialized instance of the class with detection\n * for the desired feature set\n */\n static async create(desiredFeatures: WasmFeature[]): Promise<WasmSupport> {\n const instance = new WasmSupport(desiredFeatures)\n await instance.initialize()\n return instance\n }\n\n /**\n * Checks for specific wasm features\n * @param features The list of features to check for\n * @returns True if all the features are supported, false otherwise\n */\n async featureCheck(features: WasmFeature[]): Promise<boolean> {\n const results = await Promise.all(features.map(feature => WasmFeatureDetectors[feature]).map(async detector => await detector()))\n return results.every(Boolean)\n }\n\n /**\n * Does feature detection for the desired feature set\n */\n async initialize(): Promise<void> {\n if (this._isInitialized) return\n await this.detectDesiredFeatures()\n this._isInitialized = true\n }\n\n protected async detectDesiredFeatures(): Promise<void> {\n for (const desiredFeature of this.desiredFeatures) {\n const detector = WasmFeatureDetectors[desiredFeature]\n this._featureSupport[desiredFeature] = isTruthy(await detector())\n }\n this._isWasmFeatureSetSupported = Object.values(this._featureSupport).every(Boolean)\n }\n}\n"],
5
- "mappings": ";AAKA,IAAM,WAAW,CAAC,UAAsC,QAAQ,QAAQ,YAAY,SAAS,IAAI,WAAW,KAAK,CAAC,CAA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AA,EASA,aAAa,OAAO,iBAAsD;AACxE,UAAM,WAAW,IAAI,aAAY,eAAe;AAChD,UAAM,SAAS,WAAW;AAC1B,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,aAAa,UAA2C;AAC5D,UAAM,UAAU,MAAM,QAAQ,IAAI,SAAS,IAAI,aAAW,qBAAqB,OAAO,CAAC,EAAE,IAAI,OAAM,aAAY,MAAM,SAAS,CAAC,CAAC;AAChI,WAAO,QAAQ,MAAM,OAAO;AAAA,EAC9B;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,aAA4B;AAChC,QAAI,KAAK,eAAgB;AACzB,UAAM,KAAK,sBAAsB;AACjC,SAAK,iBAAiB;AAAA,EACxB;AAAA,EAEA,MAAgB,wBAAuC;AACrD,eAAW,kBAAkB,KAAK,iBAAiB;AACjD,YAAM,WAAW,qBAAqB,cAAc;AACpD,WAAK,gBAAgB,cAAc,IAAI,SAAS,MAAM,SAAS,CAAC;AAAA,IAClE;AACA,SAAK,6BAA6B,OAAO,OAAO,KAAK,eAAe,EAAE,MAAM,OAAO;AAAA,EACrF;AACF;",
6
- "names": []
7
- }
@@ -1,16 +0,0 @@
1
- export declare const bigInt: () => Promise<boolean>;
2
- export declare const bulkMemory: () => Promise<boolean>;
3
- export declare const exceptions: () => Promise<boolean>;
4
- export declare const extendedConst: () => Promise<boolean>;
5
- export declare const gc: () => Promise<boolean>;
6
- export declare const memory64: () => Promise<boolean>;
7
- export declare const multiValue: () => Promise<boolean>;
8
- export declare const mutableGlobals: () => Promise<boolean>;
9
- export declare const relaxedSimd: () => Promise<boolean>;
10
- export declare const saturatedFloatToInt: () => Promise<boolean>;
11
- export declare const signExtensions: () => Promise<boolean>;
12
- export declare const simd: () => Promise<boolean>;
13
- export declare const streamingCompilation: () => Promise<boolean>;
14
- export declare const tailCall: () => Promise<boolean>;
15
- export declare const threads: () => Promise<boolean>;
16
- //# sourceMappingURL=wasmFeatureDetect.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"wasmFeatureDetect.d.ts","sourceRoot":"","sources":["../../src/wasmFeatureDetect.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,MAAM,QAAa,OAAO,CAAC,OAAO,CAS9C,CAAA;AAED,eAAO,MAAM,UAAU,QAAO,OAAO,CAAC,OAAO,CAAoJ,CAAA;AAEjM,eAAO,MAAM,UAAU,QAAO,OAAO,CAAC,OAAO,CAA8G,CAAA;AAE3J,eAAO,MAAM,aAAa,QAAO,OAAO,CAAC,OAAO,CAAkG,CAAA;AAElJ,eAAO,MAAM,EAAE,QAAO,OAAO,CAAC,OAAO,CAAoE,CAAA;AAEzG,eAAO,MAAM,QAAQ,QAAO,OAAO,CAAC,OAAO,CAA2D,CAAA;AAEtG,eAAO,MAAM,UAAU,QAAO,OAAO,CAAC,OAAO,CAAuH,CAAA;AAEpK,eAAO,MAAM,cAAc,QAAO,OAAO,CAAC,OAAO,CAAgI,CAAA;AAEjL,eAAO,MAAM,WAAW,QAAO,OAAO,CAAC,OAAO,CAAmJ,CAAA;AAEjM,eAAO,MAAM,mBAAmB,QAAO,OAAO,CAAC,OAAO,CAA6H,CAAA;AAEnL,eAAO,MAAM,cAAc,QAAO,OAAO,CAAC,OAAO,CAA+G,CAAA;AAEhK,eAAO,MAAM,IAAI,QAAO,OAAO,CAAC,OAAO,CAA8H,CAAA;AAErK,eAAO,MAAM,oBAAoB,QAAO,OAAO,CAAC,OAAO,CAAuD,CAAA;AAE9G,eAAO,MAAM,QAAQ,QAAO,OAAO,CAAC,OAAO,CAAsG,CAAA;AAEjJ,eAAO,MAAM,OAAO,QAAa,OAAO,CAAC,OAAO,CAgB/C,CAAA"}
@@ -1,110 +0,0 @@
1
- export declare const WasmFeatureDetectors: {
2
- readonly bigInt: () => Promise<boolean>;
3
- readonly bulkMemory: () => Promise<boolean>;
4
- readonly exceptions: () => Promise<boolean>;
5
- readonly extendedConst: () => Promise<boolean>;
6
- readonly gc: () => Promise<boolean>;
7
- readonly memory64: () => Promise<boolean>;
8
- readonly multiValue: () => Promise<boolean>;
9
- readonly mutableGlobals: () => Promise<boolean>;
10
- readonly referenceTypes: () => {
11
- new (executor: (resolve: (value: boolean | PromiseLike<boolean>) => void, reject: (reason?: any) => void) => void): Promise<boolean>;
12
- all<T>(values: Iterable<T | PromiseLike<T>>): Promise<Awaited<T>[]>;
13
- all<T extends readonly unknown[] | []>(values: T): Promise<{ -readonly [P in keyof T]: Awaited<T[P]>; }>;
14
- race<T>(values: Iterable<T | PromiseLike<T>>): Promise<Awaited<T>>;
15
- race<T extends readonly unknown[] | []>(values: T): Promise<Awaited<T[number]>>;
16
- readonly prototype: Promise<any>;
17
- reject<T = never>(reason?: any): Promise<T>;
18
- resolve(): Promise<void>;
19
- resolve<T>(value: T): Promise<Awaited<T>>;
20
- resolve<T>(value: T | PromiseLike<T>): Promise<Awaited<T>>;
21
- allSettled<T extends readonly unknown[] | []>(values: T): Promise<{ -readonly [P in keyof T]: PromiseSettledResult<Awaited<T[P]>>; }>;
22
- allSettled<T>(values: Iterable<T | PromiseLike<T>>): Promise<PromiseSettledResult<Awaited<T>>[]>;
23
- any<T extends readonly unknown[] | []>(values: T): Promise<Awaited<T[number]>>;
24
- any<T>(values: Iterable<T | PromiseLike<T>>): Promise<Awaited<T>>;
25
- withResolvers<T>(): PromiseWithResolvers<T>;
26
- try<T, U extends unknown[]>(callbackFn: (...args: U) => T | PromiseLike<T>, ...args: U): Promise<Awaited<T>>;
27
- readonly [Symbol.species]: PromiseConstructor;
28
- };
29
- readonly relaxedSimd: () => Promise<boolean>;
30
- readonly saturatedFloatToInt: () => Promise<boolean>;
31
- readonly signExtensions: () => Promise<boolean>;
32
- readonly simd: () => Promise<boolean>;
33
- readonly streamingCompilation: () => Promise<boolean>;
34
- readonly tailCall: () => Promise<boolean>;
35
- readonly threads: () => Promise<boolean>;
36
- };
37
- export type WasmFeature = keyof typeof WasmFeatureDetectors;
38
- export declare class WasmSupport {
39
- protected desiredFeatures: WasmFeature[];
40
- private _allowWasm;
41
- private _featureSupport;
42
- private _forceWasm;
43
- private _isInitialized;
44
- private _isWasmFeatureSetSupported;
45
- /**
46
- * Instance constructor for use where async instantiation
47
- * is not possible. Where possible, prefer the static
48
- * create method over use of this constructor directly
49
- * as no initialization (feature detection) is able to
50
- * be done here
51
- * @param desiredFeatures The desired feature set
52
- */
53
- constructor(desiredFeatures: WasmFeature[]);
54
- /**
55
- * Is Wasm allowed
56
- */
57
- get allowWasm(): boolean;
58
- /**
59
- * Whether or not to allow WASM usage
60
- */
61
- set allowWasm(v: boolean);
62
- /**
63
- * Whether or not Wasm should be used based on the desired
64
- * feature set, initialization state, or force-use settings
65
- */
66
- get canUseWasm(): boolean;
67
- /**
68
- * Returns a object containing a property for each desired wasm feature
69
- * with a boolean value indicating whether or not the feature is supported
70
- */
71
- get featureSupport(): Readonly<Partial<Record<WasmFeature, boolean>>>;
72
- /**
73
- * Force use of Wasm
74
- */
75
- get forceWasm(): boolean;
76
- /**
77
- * Whether or not to force Wasm usage
78
- */
79
- set forceWasm(v: boolean);
80
- /**
81
- * Whether or not Wasm is supported based
82
- * on the desired feature set
83
- */
84
- get isDesiredFeatureSetSupported(): boolean;
85
- /**
86
- * Whether or not Wasm detection has been run
87
- * for the desired feature set
88
- */
89
- get isInitialized(): boolean;
90
- /**
91
- * Static creation & async initialization for use where
92
- * async instantiation is possible
93
- * @param desiredFeatures The desired feature set
94
- * @returns An initialized instance of the class with detection
95
- * for the desired feature set
96
- */
97
- static create(desiredFeatures: WasmFeature[]): Promise<WasmSupport>;
98
- /**
99
- * Checks for specific wasm features
100
- * @param features The list of features to check for
101
- * @returns True if all the features are supported, false otherwise
102
- */
103
- featureCheck(features: WasmFeature[]): Promise<boolean>;
104
- /**
105
- * Does feature detection for the desired feature set
106
- */
107
- initialize(): Promise<void>;
108
- protected detectDesiredFeatures(): Promise<void>;
109
- }
110
- //# sourceMappingURL=WasmSupport.d.ts.map
@@ -1 +0,0 @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G,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;cAMjB,qBAAqB,IAAI,OAAO,CAAC,IAAI,CAAC;CAOvD"}
@@ -1,2 +0,0 @@
1
- export * from './WasmSupport.ts';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA"}
@@ -1,177 +0,0 @@
1
- // src/wasmFeatureDetect.ts
2
- var validate = (bytes) => Promise.resolve(WebAssembly.validate(new Uint8Array(bytes)));
3
- var bigInt = async () => {
4
- try {
5
- const mod = new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 6, 1, 96, 1, 126, 1, 126, 3, 2, 1, 0, 7, 5, 1, 1, 98, 0, 0, 10, 6, 1, 4, 0, 32, 0, 11]);
6
- const { instance } = await WebAssembly.instantiate(mod);
7
- const fn = instance.exports.b;
8
- return fn(0n) === 0n;
9
- } catch {
10
- return false;
11
- }
12
- };
13
- var bulkMemory = () => validate([0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 0, 0, 3, 2, 1, 0, 5, 3, 1, 0, 1, 10, 14, 1, 12, 0, 65, 0, 65, 0, 65, 0, 252, 10, 0, 0, 11]);
14
- var exceptions = () => validate([0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 0, 0, 3, 2, 1, 0, 10, 8, 1, 6, 0, 6, 64, 25, 11, 11]);
15
- var extendedConst = () => validate([0, 97, 115, 109, 1, 0, 0, 0, 5, 3, 1, 0, 1, 11, 9, 1, 0, 65, 1, 65, 2, 106, 11, 0]);
16
- var gc = () => validate([0, 97, 115, 109, 1, 0, 0, 0, 1, 5, 1, 95, 1, 120, 0]);
17
- var memory64 = () => validate([0, 97, 115, 109, 1, 0, 0, 0, 5, 3, 1, 4, 1]);
18
- var multiValue = () => validate([0, 97, 115, 109, 1, 0, 0, 0, 1, 6, 1, 96, 0, 2, 127, 127, 3, 2, 1, 0, 10, 8, 1, 6, 0, 65, 0, 65, 0, 11]);
19
- var mutableGlobals = () => validate([0, 97, 115, 109, 1, 0, 0, 0, 2, 8, 1, 1, 97, 1, 98, 3, 127, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 5, 1, 1, 97, 3, 1]);
20
- var relaxedSimd = () => validate([0, 97, 115, 109, 1, 0, 0, 0, 1, 5, 1, 96, 0, 1, 123, 3, 2, 1, 0, 10, 15, 1, 13, 0, 65, 1, 253, 15, 65, 2, 253, 15, 253, 128, 2, 11]);
21
- var saturatedFloatToInt = () => validate([0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 0, 0, 3, 2, 1, 0, 10, 12, 1, 10, 0, 67, 0, 0, 0, 0, 252, 0, 26, 11]);
22
- var signExtensions = () => validate([0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 0, 0, 3, 2, 1, 0, 10, 8, 1, 6, 0, 65, 0, 192, 26, 11]);
23
- var simd = () => validate([0, 97, 115, 109, 1, 0, 0, 0, 1, 5, 1, 96, 0, 1, 123, 3, 2, 1, 0, 10, 10, 1, 8, 0, 65, 0, 253, 15, 253, 98, 11]);
24
- var streamingCompilation = () => Promise.resolve("compileStreaming" in WebAssembly);
25
- var tailCall = () => validate([0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 0, 0, 3, 2, 1, 0, 10, 6, 1, 4, 0, 18, 0, 11]);
26
- var threads = async () => {
27
- try {
28
- const sharedAvailable = typeof MessageChannel !== "undefined" && (() => {
29
- try {
30
- new MessageChannel().port1.postMessage(new SharedArrayBuffer(1));
31
- return true;
32
- } catch {
33
- return false;
34
- }
35
- })();
36
- if (!sharedAvailable) return false;
37
- return WebAssembly.validate(new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 0, 0, 3, 2, 1, 0, 5, 4, 1, 3, 1, 1, 10, 11, 1, 9, 0, 65, 0, 254, 16, 2, 0, 26, 11]));
38
- } catch {
39
- return false;
40
- }
41
- };
42
-
43
- // src/WasmSupport.ts
44
- import { isTruthy } from "@xylabs/sdk-js";
45
- var WasmFeatureDetectors = {
46
- bigInt,
47
- bulkMemory,
48
- exceptions,
49
- extendedConst,
50
- gc,
51
- memory64,
52
- multiValue,
53
- mutableGlobals,
54
- referenceTypes: () => Promise,
55
- relaxedSimd,
56
- saturatedFloatToInt,
57
- signExtensions,
58
- simd,
59
- streamingCompilation,
60
- tailCall,
61
- threads
62
- };
63
- var WasmSupport = class _WasmSupport {
64
- desiredFeatures;
65
- _allowWasm = true;
66
- _featureSupport = {};
67
- _forceWasm = false;
68
- _isInitialized = false;
69
- _isWasmFeatureSetSupported = false;
70
- /**
71
- * Instance constructor for use where async instantiation
72
- * is not possible. Where possible, prefer the static
73
- * create method over use of this constructor directly
74
- * as no initialization (feature detection) is able to
75
- * be done here
76
- * @param desiredFeatures The desired feature set
77
- */
78
- constructor(desiredFeatures) {
79
- this.desiredFeatures = desiredFeatures;
80
- }
81
- /**
82
- * Is Wasm allowed
83
- */
84
- get allowWasm() {
85
- return this._allowWasm;
86
- }
87
- /**
88
- * Whether or not to allow WASM usage
89
- */
90
- set allowWasm(v) {
91
- this._allowWasm = v;
92
- }
93
- /**
94
- * Whether or not Wasm should be used based on the desired
95
- * feature set, initialization state, or force-use settings
96
- */
97
- get canUseWasm() {
98
- return (
99
- // Just force WASM
100
- this._forceWasm || this._allowWasm && !this._isInitialized || this._allowWasm && this._isInitialized && this._isWasmFeatureSetSupported
101
- );
102
- }
103
- /**
104
- * Returns a object containing a property for each desired wasm feature
105
- * with a boolean value indicating whether or not the feature is supported
106
- */
107
- get featureSupport() {
108
- return { ...this._featureSupport };
109
- }
110
- /**
111
- * Force use of Wasm
112
- */
113
- get forceWasm() {
114
- return this._forceWasm;
115
- }
116
- /**
117
- * Whether or not to force Wasm usage
118
- */
119
- set forceWasm(v) {
120
- this._forceWasm = v;
121
- }
122
- /**
123
- * Whether or not Wasm is supported based
124
- * on the desired feature set
125
- */
126
- get isDesiredFeatureSetSupported() {
127
- return this._isWasmFeatureSetSupported;
128
- }
129
- /**
130
- * Whether or not Wasm detection has been run
131
- * for the desired feature set
132
- */
133
- get isInitialized() {
134
- return this._isInitialized;
135
- }
136
- /**
137
- * Static creation & async initialization for use where
138
- * async instantiation is possible
139
- * @param desiredFeatures The desired feature set
140
- * @returns An initialized instance of the class with detection
141
- * for the desired feature set
142
- */
143
- static async create(desiredFeatures) {
144
- const instance = new _WasmSupport(desiredFeatures);
145
- await instance.initialize();
146
- return instance;
147
- }
148
- /**
149
- * Checks for specific wasm features
150
- * @param features The list of features to check for
151
- * @returns True if all the features are supported, false otherwise
152
- */
153
- async featureCheck(features) {
154
- const results = await Promise.all(features.map((feature) => WasmFeatureDetectors[feature]).map(async (detector) => await detector()));
155
- return results.every(Boolean);
156
- }
157
- /**
158
- * Does feature detection for the desired feature set
159
- */
160
- async initialize() {
161
- if (this._isInitialized) return;
162
- await this.detectDesiredFeatures();
163
- this._isInitialized = true;
164
- }
165
- async detectDesiredFeatures() {
166
- for (const desiredFeature of this.desiredFeatures) {
167
- const detector = WasmFeatureDetectors[desiredFeature];
168
- this._featureSupport[desiredFeature] = isTruthy(await detector());
169
- }
170
- this._isWasmFeatureSetSupported = Object.values(this._featureSupport).every(Boolean);
171
- }
172
- };
173
- export {
174
- WasmFeatureDetectors,
175
- WasmSupport
176
- };
177
- //# sourceMappingURL=index.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/wasmFeatureDetect.ts", "../../src/WasmSupport.ts"],
4
- "sourcesContent": ["/*\n * Vendored from wasm-feature-detect (MIT, https://github.com/GoogleChromeLabs/wasm-feature-detect)\n * Each detector validates a small precompiled WASM module that exercises one feature.\n */\n\nconst validate = (bytes: number[]): Promise<boolean> => Promise.resolve(WebAssembly.validate(new Uint8Array(bytes)))\n\nexport const bigInt = async (): Promise<boolean> => {\n try {\n const mod = new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 6, 1, 96, 1, 126, 1, 126, 3, 2, 1, 0, 7, 5, 1, 1, 98, 0, 0, 10, 6, 1, 4, 0, 32, 0, 11])\n const { instance } = await WebAssembly.instantiate(mod)\n const fn = instance.exports.b as (x: bigint) => bigint\n return fn(0n) === 0n\n } catch {\n return false\n }\n}\n\nexport const bulkMemory = (): Promise<boolean> => validate([0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 0, 0, 3, 2, 1, 0, 5, 3, 1, 0, 1, 10, 14, 1, 12, 0, 65, 0, 65, 0, 65, 0, 252, 10, 0, 0, 11])\n\nexport const exceptions = (): Promise<boolean> => validate([0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 0, 0, 3, 2, 1, 0, 10, 8, 1, 6, 0, 6, 64, 25, 11, 11])\n\nexport const extendedConst = (): Promise<boolean> => validate([0, 97, 115, 109, 1, 0, 0, 0, 5, 3, 1, 0, 1, 11, 9, 1, 0, 65, 1, 65, 2, 106, 11, 0])\n\nexport const gc = (): Promise<boolean> => validate([0, 97, 115, 109, 1, 0, 0, 0, 1, 5, 1, 95, 1, 120, 0])\n\nexport const memory64 = (): Promise<boolean> => validate([0, 97, 115, 109, 1, 0, 0, 0, 5, 3, 1, 4, 1])\n\nexport const multiValue = (): Promise<boolean> => validate([0, 97, 115, 109, 1, 0, 0, 0, 1, 6, 1, 96, 0, 2, 127, 127, 3, 2, 1, 0, 10, 8, 1, 6, 0, 65, 0, 65, 0, 11])\n\nexport const mutableGlobals = (): Promise<boolean> => validate([0, 97, 115, 109, 1, 0, 0, 0, 2, 8, 1, 1, 97, 1, 98, 3, 127, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 5, 1, 1, 97, 3, 1])\n\nexport const relaxedSimd = (): Promise<boolean> => validate([0, 97, 115, 109, 1, 0, 0, 0, 1, 5, 1, 96, 0, 1, 123, 3, 2, 1, 0, 10, 15, 1, 13, 0, 65, 1, 253, 15, 65, 2, 253, 15, 253, 128, 2, 11])\n\nexport const saturatedFloatToInt = (): Promise<boolean> => validate([0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 0, 0, 3, 2, 1, 0, 10, 12, 1, 10, 0, 67, 0, 0, 0, 0, 252, 0, 26, 11])\n\nexport const signExtensions = (): Promise<boolean> => validate([0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 0, 0, 3, 2, 1, 0, 10, 8, 1, 6, 0, 65, 0, 192, 26, 11])\n\nexport const simd = (): Promise<boolean> => validate([0, 97, 115, 109, 1, 0, 0, 0, 1, 5, 1, 96, 0, 1, 123, 3, 2, 1, 0, 10, 10, 1, 8, 0, 65, 0, 253, 15, 253, 98, 11])\n\nexport const streamingCompilation = (): Promise<boolean> => Promise.resolve('compileStreaming' in WebAssembly)\n\nexport const tailCall = (): Promise<boolean> => validate([0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 0, 0, 3, 2, 1, 0, 10, 6, 1, 4, 0, 18, 0, 11])\n\nexport const threads = async (): Promise<boolean> => {\n try {\n const sharedAvailable = typeof MessageChannel !== 'undefined'\n && (() => {\n try {\n new MessageChannel().port1.postMessage(new SharedArrayBuffer(1))\n return true\n } catch {\n return false\n }\n })()\n if (!sharedAvailable) return false\n return WebAssembly.validate(new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 0, 0, 3, 2, 1, 0, 5, 4, 1, 3, 1, 1, 10, 11, 1, 9, 0, 65, 0, 254, 16, 2, 0, 26, 11]))\n } catch {\n return false\n }\n}\n", "import {\n bigInt,\n bulkMemory,\n exceptions,\n extendedConst,\n gc,\n memory64,\n multiValue,\n mutableGlobals,\n relaxedSimd,\n saturatedFloatToInt,\n signExtensions,\n simd,\n streamingCompilation,\n tailCall,\n threads,\n} from './wasmFeatureDetect.ts'\n\nexport const WasmFeatureDetectors = {\n bigInt: bigInt,\n bulkMemory: bulkMemory,\n exceptions: exceptions,\n extendedConst: extendedConst,\n gc: gc,\n memory64: memory64,\n multiValue: multiValue,\n mutableGlobals: mutableGlobals,\n referenceTypes: () => Promise<boolean>,\n relaxedSimd: relaxedSimd,\n saturatedFloatToInt: saturatedFloatToInt,\n signExtensions: signExtensions,\n simd: simd,\n streamingCompilation: streamingCompilation,\n tailCall: tailCall,\n threads: threads,\n} as const\n\nimport { isTruthy } from '@xylabs/sdk-js'\n\nexport type WasmFeature = keyof typeof WasmFeatureDetectors\n\nexport class WasmSupport {\n protected desiredFeatures: WasmFeature[]\n\n private _allowWasm = true\n private _featureSupport: Partial<Record<WasmFeature, boolean>> = {}\n private _forceWasm = false\n private _isInitialized = false\n private _isWasmFeatureSetSupported = false\n\n /**\n * Instance constructor for use where async instantiation\n * is not possible. Where possible, prefer the static\n * create method over use of this constructor directly\n * as no initialization (feature detection) is able to\n * be done here\n * @param desiredFeatures The desired feature set\n */\n constructor(desiredFeatures: WasmFeature[]) {\n this.desiredFeatures = desiredFeatures\n }\n\n /**\n * Is Wasm allowed\n */\n get allowWasm(): boolean {\n return this._allowWasm\n }\n\n /**\n * Whether or not to allow WASM usage\n */\n set allowWasm(v: boolean) {\n this._allowWasm = v\n }\n\n /**\n * Whether or not Wasm should be used based on the desired\n * feature set, initialization state, or force-use settings\n */\n get canUseWasm(): boolean {\n return (\n // Just force WASM\n this._forceWasm\n // Or if we haven't checked be optimistic\n || (this._allowWasm && !this._isInitialized)\n // Or if we have checked and WASM is not supported, be realistic\n || (this._allowWasm && this._isInitialized && this._isWasmFeatureSetSupported)\n )\n }\n\n /**\n * Returns a object containing a property for each desired wasm feature\n * with a boolean value indicating whether or not the feature is supported\n */\n get featureSupport(): Readonly<Partial<Record<WasmFeature, boolean>>> {\n return { ...this._featureSupport }\n }\n\n /**\n * Force use of Wasm\n */\n get forceWasm(): boolean {\n return this._forceWasm\n }\n\n /**\n * Whether or not to force Wasm usage\n */\n set forceWasm(v: boolean) {\n this._forceWasm = v\n }\n\n /**\n * Whether or not Wasm is supported based\n * on the desired feature set\n */\n get isDesiredFeatureSetSupported(): boolean {\n return this._isWasmFeatureSetSupported\n }\n\n /**\n * Whether or not Wasm detection has been run\n * for the desired feature set\n */\n get isInitialized(): boolean {\n return this._isInitialized\n }\n\n /**\n * Static creation & async initialization for use where\n * async instantiation is possible\n * @param desiredFeatures The desired feature set\n * @returns An initialized instance of the class with detection\n * for the desired feature set\n */\n static async create(desiredFeatures: WasmFeature[]): Promise<WasmSupport> {\n const instance = new WasmSupport(desiredFeatures)\n await instance.initialize()\n return instance\n }\n\n /**\n * Checks for specific wasm features\n * @param features The list of features to check for\n * @returns True if all the features are supported, false otherwise\n */\n async featureCheck(features: WasmFeature[]): Promise<boolean> {\n const results = await Promise.all(features.map(feature => WasmFeatureDetectors[feature]).map(async detector => await detector()))\n return results.every(Boolean)\n }\n\n /**\n * Does feature detection for the desired feature set\n */\n async initialize(): Promise<void> {\n if (this._isInitialized) return\n await this.detectDesiredFeatures()\n this._isInitialized = true\n }\n\n protected async detectDesiredFeatures(): Promise<void> {\n for (const desiredFeature of this.desiredFeatures) {\n const detector = WasmFeatureDetectors[desiredFeature]\n this._featureSupport[desiredFeature] = isTruthy(await detector())\n }\n this._isWasmFeatureSetSupported = Object.values(this._featureSupport).every(Boolean)\n }\n}\n"],
5
- "mappings": ";AAKA,IAAM,WAAW,CAAC,UAAsC,QAAQ,QAAQ,YAAY,SAAS,IAAI,WAAW,KAAK,CAAC,CAAC;AAE5G,IAAM,SAAS,YAA8B;AAClD,MAAI;AACF,UAAM,MAAM,IAAI,WAAW,CAAC,GAAG,IAAI,KAAK,KAAK,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,GAAG,KAAK,GAAG,KAAK,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,GAAG,GAAG,IAAI,GAAG,GAAG,GAAG,GAAG,IAAI,GAAG,EAAE,CAAC;AAClJ,UAAM,EAAE,SAAS,IAAI,MAAM,YAAY,YAAY,GAAG;AACtD,UAAM,KAAK,SAA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AKA,MAAM,aAA4B;AAChC,QAAI,KAAK,eAAgB;AACzB,UAAM,KAAK,sBAAsB;AACjC,SAAK,iBAAiB;AAAA,EACxB;AAAA,EAEA,MAAgB,wBAAuC;AACrD,eAAW,kBAAkB,KAAK,iBAAiB;AACjD,YAAM,WAAW,qBAAqB,cAAc;AACpD,WAAK,gBAAgB,cAAc,IAAI,SAAS,MAAM,SAAS,CAAC;AAAA,IAClE;AACA,SAAK,6BAA6B,OAAO,OAAO,KAAK,eAAe,EAAE,MAAM,OAAO;AAAA,EACrF;AACF;",
6
- "names": []
7
- }
@@ -1,16 +0,0 @@
1
- export declare const bigInt: () => Promise<boolean>;
2
- export declare const bulkMemory: () => Promise<boolean>;
3
- export declare const exceptions: () => Promise<boolean>;
4
- export declare const extendedConst: () => Promise<boolean>;
5
- export declare const gc: () => Promise<boolean>;
6
- export declare const memory64: () => Promise<boolean>;
7
- export declare const multiValue: () => Promise<boolean>;
8
- export declare const mutableGlobals: () => Promise<boolean>;
9
- export declare const relaxedSimd: () => Promise<boolean>;
10
- export declare const saturatedFloatToInt: () => Promise<boolean>;
11
- export declare const signExtensions: () => Promise<boolean>;
12
- export declare const simd: () => Promise<boolean>;
13
- export declare const streamingCompilation: () => Promise<boolean>;
14
- export declare const tailCall: () => Promise<boolean>;
15
- export declare const threads: () => Promise<boolean>;
16
- //# sourceMappingURL=wasmFeatureDetect.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"wasmFeatureDetect.d.ts","sourceRoot":"","sources":["../../src/wasmFeatureDetect.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,MAAM,QAAa,OAAO,CAAC,OAAO,CAS9C,CAAA;AAED,eAAO,MAAM,UAAU,QAAO,OAAO,CAAC,OAAO,CAAoJ,CAAA;AAEjM,eAAO,MAAM,UAAU,QAAO,OAAO,CAAC,OAAO,CAA8G,CAAA;AAE3J,eAAO,MAAM,aAAa,QAAO,OAAO,CAAC,OAAO,CAAkG,CAAA;AAElJ,eAAO,MAAM,EAAE,QAAO,OAAO,CAAC,OAAO,CAAoE,CAAA;AAEzG,eAAO,MAAM,QAAQ,QAAO,OAAO,CAAC,OAAO,CAA2D,CAAA;AAEtG,eAAO,MAAM,UAAU,QAAO,OAAO,CAAC,OAAO,CAAuH,CAAA;AAEpK,eAAO,MAAM,cAAc,QAAO,OAAO,CAAC,OAAO,CAAgI,CAAA;AAEjL,eAAO,MAAM,WAAW,QAAO,OAAO,CAAC,OAAO,CAAmJ,CAAA;AAEjM,eAAO,MAAM,mBAAmB,QAAO,OAAO,CAAC,OAAO,CAA6H,CAAA;AAEnL,eAAO,MAAM,cAAc,QAAO,OAAO,CAAC,OAAO,CAA+G,CAAA;AAEhK,eAAO,MAAM,IAAI,QAAO,OAAO,CAAC,OAAO,CAA8H,CAAA;AAErK,eAAO,MAAM,oBAAoB,QAAO,OAAO,CAAC,OAAO,CAAuD,CAAA;AAE9G,eAAO,MAAM,QAAQ,QAAO,OAAO,CAAC,OAAO,CAAsG,CAAA;AAEjJ,eAAO,MAAM,OAAO,QAAa,OAAO,CAAC,OAAO,CAgB/C,CAAA"}