@fhevm/sdk 1.1.0-alpha.5 → 1.1.0-alpha.6
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/_cjs/core/_version.js +1 -1
- package/_cjs/core/base/bytes.js +2 -1
- package/_cjs/core/base/bytes.js.map +1 -1
- package/_cjs/core/base/environment.js +122 -0
- package/_cjs/core/base/environment.js.map +1 -0
- package/_cjs/core/base/errors/Sha256VerificationError.js +15 -0
- package/_cjs/core/base/errors/Sha256VerificationError.js.map +1 -0
- package/_cjs/core/base/inflate.js +282 -0
- package/_cjs/core/base/inflate.js.map +1 -0
- package/_cjs/core/base/isomorphicFs.js +24 -0
- package/_cjs/core/base/isomorphicFs.js.map +1 -0
- package/_cjs/core/base/isomorphicWorker.js +42 -111
- package/_cjs/core/base/isomorphicWorker.js.map +1 -1
- package/_cjs/core/base/wasm.js +15 -55
- package/_cjs/core/base/wasm.js.map +1 -1
- package/_cjs/core/kms/TransportKeyPair-p.js +0 -4
- package/_cjs/core/kms/TransportKeyPair-p.js.map +1 -1
- package/_cjs/core/kms/createKmsUserDecryptEip712.js +5 -1
- package/_cjs/core/kms/createKmsUserDecryptEip712.js.map +1 -1
- package/_cjs/core/modules/decrypt/module/init-p.js +124 -39
- package/_cjs/core/modules/decrypt/module/init-p.js.map +1 -1
- package/_cjs/core/modules/encrypt/module/init-p.js +148 -45
- package/_cjs/core/modules/encrypt/module/init-p.js.map +1 -1
- package/_cjs/core/runtime/HyperWasmSolver-p.js +4 -4
- package/_cjs/core/runtime/initFhevmEncryptRuntime-p.js +1 -1
- package/_cjs/core/runtime/initFhevmRuntime-p.js +1 -1
- package/_cjs/wasm/tfhe/TfheApi.d.ts +12 -12
- package/_cjs/wasm/tfhe/loadTfheLib.js +11 -11
- package/_cjs/wasm/tfhe/loadTfheLib.js.map +2 -2
- package/_cjs/wasm/tfhe/v1.5.3/startWorkers.js +26 -9
- package/_cjs/wasm/tfhe/v1.5.3/startWorkers.js.map +2 -2
- package/_cjs/wasm/tfhe/v1.5.3/tfhe.d.ts +3 -0
- package/_cjs/wasm/tfhe/{v1.6.1 → v1.6.2}/startWorkers.js +28 -11
- package/_cjs/wasm/tfhe/v1.6.2/startWorkers.js.map +7 -0
- package/{_esm/wasm/tfhe/v1.6.1 → _cjs/wasm/tfhe/v1.6.2}/tfhe-worker.mjs +40 -40
- package/{_esm/wasm/tfhe/v1.6.1 → _cjs/wasm/tfhe/v1.6.2}/tfhe.d.ts +88 -85
- package/_cjs/wasm/tfhe/{v1.6.1 → v1.6.2}/tfhe.js +245 -442
- package/_cjs/wasm/tfhe/v1.6.2/tfhe.js.map +7 -0
- package/_cjs/wasm/tfhe/v1.6.2/tfhe_bg.wasm +0 -0
- package/_cjs/wasm/tfhe/v1.6.2/tfhe_bg.wasm.base64.js +35 -0
- package/_cjs/wasm/tfhe/v1.6.2/tfhe_bg.wasm.base64.js.map +7 -0
- package/_cjs/wasm/tkms/loadKmsLib.js.map +1 -1
- package/_cjs/wasm/wasmBaseUrl.js +8 -19
- package/_cjs/wasm/wasmBaseUrl.js.map +2 -2
- package/_esm/core/_version.js +1 -1
- package/_esm/core/base/bytes.js +2 -1
- package/_esm/core/base/bytes.js.map +1 -1
- package/_esm/core/base/environment.js +164 -0
- package/_esm/core/base/environment.js.map +1 -0
- package/_esm/core/base/errors/Sha256VerificationError.js +11 -0
- package/_esm/core/base/errors/Sha256VerificationError.js.map +1 -0
- package/_esm/core/base/inflate.js +337 -0
- package/_esm/core/base/inflate.js.map +1 -0
- package/_esm/core/base/isomorphicFs.js +21 -0
- package/_esm/core/base/isomorphicFs.js.map +1 -0
- package/_esm/core/base/isomorphicWorker.js +92 -85
- package/_esm/core/base/isomorphicWorker.js.map +1 -1
- package/_esm/core/base/wasm.js +25 -31
- package/_esm/core/base/wasm.js.map +1 -1
- package/_esm/core/kms/TransportKeyPair-p.js +0 -4
- package/_esm/core/kms/TransportKeyPair-p.js.map +1 -1
- package/_esm/core/kms/createKmsUserDecryptEip712.js +5 -1
- package/_esm/core/kms/createKmsUserDecryptEip712.js.map +1 -1
- package/_esm/core/modules/decrypt/module/init-p.js +109 -54
- package/_esm/core/modules/decrypt/module/init-p.js.map +1 -1
- package/_esm/core/modules/encrypt/module/init-p.js +300 -53
- package/_esm/core/modules/encrypt/module/init-p.js.map +1 -1
- package/_esm/core/runtime/HyperWasmSolver-p.js +4 -4
- package/_esm/core/runtime/initFhevmEncryptRuntime-p.js +1 -1
- package/_esm/core/runtime/initFhevmRuntime-p.js +1 -1
- package/_esm/wasm/tfhe/TfheApi.d.ts +12 -12
- package/_esm/wasm/tfhe/loadTfheLib.js +11 -11
- package/_esm/wasm/tfhe/v1.5.3/startWorkers.js +41 -20
- package/_esm/wasm/tfhe/v1.5.3/tfhe.d.ts +3 -0
- package/_esm/wasm/tfhe/{v1.6.1 → v1.6.2}/startWorkers.js +46 -25
- package/{_cjs/wasm/tfhe/v1.6.1 → _esm/wasm/tfhe/v1.6.2}/tfhe-worker.mjs +40 -40
- package/{_types/wasm/tfhe/v1.6.1 → _esm/wasm/tfhe/v1.6.2}/tfhe.d.ts +88 -85
- package/_esm/wasm/tfhe/{v1.6.1 → v1.6.2}/tfhe.js +245 -442
- package/_esm/wasm/tfhe/v1.6.2/tfhe_bg.wasm +0 -0
- package/_esm/wasm/tfhe/v1.6.2/tfhe_bg.wasm.base64.js +7 -0
- package/_esm/wasm/wasmBaseUrl.js +17 -54
- package/_types/core/base/bytes.d.ts.map +1 -1
- package/_types/core/base/environment.d.ts +92 -0
- package/_types/core/base/environment.d.ts.map +1 -0
- package/_types/core/base/errors/Sha256VerificationError.d.ts +14 -0
- package/_types/core/base/errors/Sha256VerificationError.d.ts.map +1 -0
- package/_types/core/base/inflate.d.ts +25 -0
- package/_types/core/base/inflate.d.ts.map +1 -0
- package/_types/core/base/isomorphicFs.d.ts +2 -0
- package/_types/core/base/isomorphicFs.d.ts.map +1 -0
- package/_types/core/base/isomorphicWorker.d.ts +27 -43
- package/_types/core/base/isomorphicWorker.d.ts.map +1 -1
- package/_types/core/base/wasm.d.ts +0 -8
- package/_types/core/base/wasm.d.ts.map +1 -1
- package/_types/core/kms/TransportKeyPair-p.d.ts.map +1 -1
- package/_types/core/kms/createKmsUserDecryptEip712.d.ts.map +1 -1
- package/_types/core/modules/decrypt/module/init-p.d.ts.map +1 -1
- package/_types/core/modules/encrypt/module/init-p.d.ts.map +1 -1
- package/_types/core/types/wasmAssets.d.ts.map +1 -1
- package/_types/wasm/tfhe/TfheApi.d.ts +12 -12
- package/_types/wasm/tfhe/v1.5.3/tfhe.d.ts +3 -0
- package/{wasm/tfhe/v1.6.1 → _types/wasm/tfhe/v1.6.2}/tfhe.d.ts +88 -85
- package/core/_version.ts +1 -1
- package/core/base/bytes.ts +2 -1
- package/core/base/environment.ts +210 -0
- package/core/base/errors/Sha256VerificationError.ts +22 -0
- package/core/base/inflate.ts +373 -0
- package/core/base/isomorphicFs.ts +23 -0
- package/core/base/isomorphicWorker.ts +96 -123
- package/core/base/wasm.ts +28 -35
- package/core/kms/TransportKeyPair-p.ts +0 -5
- package/core/kms/createKmsUserDecryptEip712.ts +8 -1
- package/core/modules/decrypt/module/init-p.ts +148 -59
- package/core/modules/encrypt/module/init-p.ts +368 -63
- package/core/runtime/HyperWasmSolver-p.ts +4 -4
- package/core/runtime/initFhevmEncryptRuntime-p.ts +1 -1
- package/core/runtime/initFhevmRuntime-p.ts +1 -1
- package/core/types/wasmAssets.ts +58 -0
- package/package.json +1 -1
- package/wasm/tfhe/TfheApi.d.ts +12 -12
- package/wasm/tfhe/loadTfheLib.js +11 -11
- package/wasm/tfhe/v1.5.3/startWorkers.js +41 -20
- package/wasm/tfhe/v1.5.3/tfhe.d.ts +3 -0
- package/wasm/tfhe/v1.6.0-dev/startWorkers.js +41 -20
- package/wasm/tfhe/v1.6.0-dev/tfhe.d.ts +3 -0
- package/wasm/tfhe/{v1.6.1 → v1.6.2}/startWorkers.js +46 -25
- package/wasm/tfhe/{v1.6.1 → v1.6.2}/tfhe-worker.mjs +40 -40
- package/{_cjs/wasm/tfhe/v1.6.1 → wasm/tfhe/v1.6.2}/tfhe.d.ts +88 -85
- package/wasm/tfhe/{v1.6.1 → v1.6.2}/tfhe.js +245 -442
- package/wasm/tfhe/v1.6.2/tfhe_bg.wasm +0 -0
- package/wasm/tfhe/v1.6.2/tfhe_bg.wasm.base64.js +7 -0
- package/wasm/wasmBaseUrl.js +17 -54
- package/_cjs/wasm/tfhe/v1.6.1/startWorkers.js.map +0 -7
- package/_cjs/wasm/tfhe/v1.6.1/tfhe.js.map +0 -7
- package/_cjs/wasm/tfhe/v1.6.1/tfhe_bg.wasm +0 -0
- package/_cjs/wasm/tfhe/v1.6.1/tfhe_bg.wasm.base64.js +0 -35
- package/_cjs/wasm/tfhe/v1.6.1/tfhe_bg.wasm.base64.js.map +0 -7
- package/_esm/wasm/tfhe/v1.6.1/tfhe_bg.wasm +0 -0
- package/_esm/wasm/tfhe/v1.6.1/tfhe_bg.wasm.base64.js +0 -7
- package/wasm/tfhe/v1.6.1/tfhe_bg.wasm +0 -0
- package/wasm/tfhe/v1.6.1/tfhe_bg.wasm.base64.js +0 -7
- /package/_cjs/wasm/tfhe/{v1.6.1 → v1.6.2}/tfhe_bg.wasm.base64.d.ts +0 -0
- /package/_esm/wasm/tfhe/{v1.6.1 → v1.6.2}/tfhe_bg.wasm.base64.d.ts +0 -0
- /package/_types/wasm/tfhe/{v1.6.1 → v1.6.2}/tfhe_bg.wasm.base64.d.ts +0 -0
- /package/wasm/tfhe/{v1.6.1 → v1.6.2}/tfhe_bg.wasm.base64.d.ts +0 -0
|
@@ -15,32 +15,32 @@ export type {
|
|
|
15
15
|
ProvenCompactCiphertextList,
|
|
16
16
|
TfheCompactPublicKey,
|
|
17
17
|
ZkComputeLoad,
|
|
18
|
-
} from './v1.6.
|
|
18
|
+
} from './v1.6.2/tfhe.js';
|
|
19
19
|
|
|
20
20
|
/** The subset you actually use - the runtime contract callers depend on. */
|
|
21
21
|
export interface TfheLibApi {
|
|
22
|
-
initAsync: typeof import('./v1.6.
|
|
22
|
+
initAsync: typeof import('./v1.6.2/tfhe.js').initAsync;
|
|
23
23
|
|
|
24
24
|
// --- Free functions used by encrypt/init-p.ts -----------------------------
|
|
25
|
-
init_panic_hook: typeof import('./v1.6.
|
|
26
|
-
initThreadPool: typeof import('./v1.6.
|
|
27
|
-
setWorkerUrlConfig: typeof import('./v1.6.
|
|
28
|
-
getWasmInfo: typeof import('./v1.6.
|
|
25
|
+
init_panic_hook: typeof import('./v1.6.2/tfhe.js').init_panic_hook;
|
|
26
|
+
initThreadPool: typeof import('./v1.6.2/tfhe.js').initThreadPool;
|
|
27
|
+
setWorkerUrlConfig: typeof import('./v1.6.2/tfhe.js').setWorkerUrlConfig;
|
|
28
|
+
getWasmInfo: typeof import('./v1.6.2/tfhe.js').getWasmInfo;
|
|
29
29
|
|
|
30
30
|
// --- Class constructors used as values in encrypt/api-p.ts ----------------
|
|
31
31
|
// These are imported as runtime values: instanceof checks, static methods
|
|
32
32
|
// (safe_deserialize), factory calls (CompactCiphertextList.builder()).
|
|
33
|
-
CompactCiphertextList: typeof import('./v1.6.
|
|
34
|
-
CompactPkeCrs: typeof import('./v1.6.
|
|
35
|
-
ProvenCompactCiphertextList: typeof import('./v1.6.
|
|
36
|
-
TfheCompactPublicKey: typeof import('./v1.6.
|
|
33
|
+
CompactCiphertextList: typeof import('./v1.6.2/tfhe.js').CompactCiphertextList;
|
|
34
|
+
CompactPkeCrs: typeof import('./v1.6.2/tfhe.js').CompactPkeCrs;
|
|
35
|
+
ProvenCompactCiphertextList: typeof import('./v1.6.2/tfhe.js').ProvenCompactCiphertextList;
|
|
36
|
+
TfheCompactPublicKey: typeof import('./v1.6.2/tfhe.js').TfheCompactPublicKey;
|
|
37
37
|
|
|
38
38
|
// --- Enum used as a value (e.g. ZkComputeLoad.Verify) ---------------------
|
|
39
|
-
ZkComputeLoad: typeof import('./v1.6.
|
|
39
|
+
ZkComputeLoad: typeof import('./v1.6.2/tfhe.js').ZkComputeLoad;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
// Default version
|
|
43
|
-
export type TfheVersion = '1.5.3' | '1.6.
|
|
43
|
+
export type TfheVersion = '1.5.3' | '1.6.2';
|
|
44
44
|
|
|
45
45
|
export type TfheWasmBase64 = {
|
|
46
46
|
readonly tfheWasmBase64: string;
|
|
@@ -34,15 +34,15 @@ __export(loadTfheLib_exports, {
|
|
|
34
34
|
tfheAssetsWithVersion: () => tfheAssetsWithVersion
|
|
35
35
|
});
|
|
36
36
|
module.exports = __toCommonJS(loadTfheLib_exports);
|
|
37
|
-
const TFHE_VERSIONS = Object.freeze(["1.5.3", "1.6.
|
|
38
|
-
const DEFAULT_TFHE_VERSION = "1.6.
|
|
37
|
+
const TFHE_VERSIONS = Object.freeze(["1.5.3", "1.6.2"]);
|
|
38
|
+
const DEFAULT_TFHE_VERSION = "1.6.2";
|
|
39
39
|
const _loaders = {
|
|
40
40
|
"1.5.3": () => import("./v1.5.3/tfhe.js"),
|
|
41
|
-
"1.6.
|
|
41
|
+
"1.6.2": () => import("./v1.6.2/tfhe.js")
|
|
42
42
|
};
|
|
43
43
|
const _wasmBase64Loaders = {
|
|
44
44
|
"1.5.3": () => import("./v1.5.3/tfhe_bg.wasm.base64.js"),
|
|
45
|
-
"1.6.
|
|
45
|
+
"1.6.2": () => import("./v1.6.2/tfhe_bg.wasm.base64.js")
|
|
46
46
|
};
|
|
47
47
|
const _assets = Object.freeze({
|
|
48
48
|
"1.5.3": Object.freeze({
|
|
@@ -57,16 +57,16 @@ const _assets = Object.freeze({
|
|
|
57
57
|
sha256: "3f93fe86a8dfa6e25ae5fcfe28d19833219cba8f45f81c6dd05c2f3cc5323c52"
|
|
58
58
|
})
|
|
59
59
|
}),
|
|
60
|
-
"1.6.
|
|
60
|
+
"1.6.2": Object.freeze({
|
|
61
61
|
wasm: Object.freeze({
|
|
62
|
-
filename: "tfhe_bg.v1.6.
|
|
63
|
-
localRelativePath: "./v1.6.
|
|
64
|
-
sha256: "
|
|
62
|
+
filename: "tfhe_bg.v1.6.2.wasm",
|
|
63
|
+
localRelativePath: "./v1.6.2/tfhe_bg.wasm",
|
|
64
|
+
sha256: "ecd1841ad42226629c1a665ba784e073f2e780137f7986b00088c9227acb9760"
|
|
65
65
|
}),
|
|
66
66
|
worker: Object.freeze({
|
|
67
|
-
filename: "tfhe-worker.v1.6.
|
|
68
|
-
localRelativePath: "./v1.6.
|
|
69
|
-
sha256: "
|
|
67
|
+
filename: "tfhe-worker.v1.6.2.mjs",
|
|
68
|
+
localRelativePath: "./v1.6.2/tfhe-worker.mjs",
|
|
69
|
+
sha256: "2c648dd89132bb63d37e8b47c6fe1f53b06abb1389faeb9b3f671eea9a0db5dd"
|
|
70
70
|
})
|
|
71
71
|
})
|
|
72
72
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../../../../../../tmp/fhevm-loaders-
|
|
4
|
-
"sourcesContent": ["// AUTO-GENERATED FROM versionsManifest.js - DO NOT EDIT.\n// Generator: scripts/build/codegen-loaders.mjs\n// Profile: prod\n//\n// Version-selective TFHE loader. Authored as plain ESM .js (not .ts) so the\n// published artifact is byte-identical to source. Types live in the sibling\n// loadTfheLib.d.ts.\n\n////////////////////////////////////////////////////////////////////////////////\n\nexport const TFHE_VERSIONS = Object.freeze(['1.5.3', '1.6.
|
|
3
|
+
"sources": ["../../../../../../../../../../../tmp/fhevm-loaders-4189-1782749083564/tfhe/loadTfheLib.js"],
|
|
4
|
+
"sourcesContent": ["// AUTO-GENERATED FROM versionsManifest.js - DO NOT EDIT.\n// Generator: scripts/build/codegen-loaders.mjs\n// Profile: prod\n//\n// Version-selective TFHE loader. Authored as plain ESM .js (not .ts) so the\n// published artifact is byte-identical to source. Types live in the sibling\n// loadTfheLib.d.ts.\n\n////////////////////////////////////////////////////////////////////////////////\n\nexport const TFHE_VERSIONS = Object.freeze(['1.5.3', '1.6.2']);\nexport const DEFAULT_TFHE_VERSION = '1.6.2';\n\nconst _loaders = {\n '1.5.3': () => import('./v1.5.3/tfhe.js'),\n '1.6.2': () => import('./v1.6.2/tfhe.js'),\n};\n\n////////////////////////////////////////////////////////////////////////////////\n\nconst _wasmBase64Loaders = {\n '1.5.3': () => import('./v1.5.3/tfhe_bg.wasm.base64.js'),\n '1.6.2': () => import('./v1.6.2/tfhe_bg.wasm.base64.js'),\n};\n\n////////////////////////////////////////////////////////////////////////////////\n\nconst _assets = Object.freeze({\n '1.5.3': Object.freeze({\n wasm: Object.freeze({\n filename: 'tfhe_bg.v1.5.3.wasm',\n localRelativePath: './v1.5.3/tfhe_bg.wasm',\n sha256: 'dd349c2e34834527890a80e1b70bf5ee57a02aabb7f65e32a1bca654db9201ec',\n }),\n worker: Object.freeze({\n filename: 'tfhe-worker.v1.5.3.mjs',\n localRelativePath: './v1.5.3/tfhe-worker.mjs',\n sha256: '3f93fe86a8dfa6e25ae5fcfe28d19833219cba8f45f81c6dd05c2f3cc5323c52',\n }),\n }),\n '1.6.2': Object.freeze({\n wasm: Object.freeze({\n filename: 'tfhe_bg.v1.6.2.wasm',\n localRelativePath: './v1.6.2/tfhe_bg.wasm',\n sha256: 'ecd1841ad42226629c1a665ba784e073f2e780137f7986b00088c9227acb9760',\n }),\n worker: Object.freeze({\n filename: 'tfhe-worker.v1.6.2.mjs',\n localRelativePath: './v1.6.2/tfhe-worker.mjs',\n sha256: '2c648dd89132bb63d37e8b47c6fe1f53b06abb1389faeb9b3f671eea9a0db5dd',\n }),\n }),\n});\n\n////////////////////////////////////////////////////////////////////////////////\n\nexport function tfheAssetsWithVersion(version) {\n const assets = _assets[version];\n if (!assets) throw new Error(`unsupported tfhe version: ${version}`);\n return assets;\n}\n\n////////////////////////////////////////////////////////////////////////////////\n\nexport async function loadTfheLib(version) {\n const loader = _loaders[version];\n if (!loader) throw new Error(`unsupported tfhe version: ${version}`);\n return loader();\n}\n\n////////////////////////////////////////////////////////////////////////////////\n\nexport async function loadTfheWasmBase64(version) {\n const loader = _wasmBase64Loaders[version];\n if (!loader) throw new Error(`unsupported tfhe version: ${version}`);\n return loader();\n}\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUO,MAAM,gBAAgB,OAAO,OAAO,CAAC,SAAS,OAAO,CAAC;AACtD,MAAM,uBAAuB;AAEpC,MAAM,WAAW;AAAA,EACf,SAAS,MAAM,OAAO,kBAAkB;AAAA,EACxC,SAAS,MAAM,OAAO,kBAAkB;AAC1C;AAIA,MAAM,qBAAqB;AAAA,EACzB,SAAS,MAAM,OAAO,iCAAiC;AAAA,EACvD,SAAS,MAAM,OAAO,iCAAiC;AACzD;AAIA,MAAM,UAAU,OAAO,OAAO;AAAA,EAC5B,SAAS,OAAO,OAAO;AAAA,IACrB,MAAM,OAAO,OAAO;AAAA,MAClB,UAAU;AAAA,MACV,mBAAmB;AAAA,MACnB,QAAQ;AAAA,IACV,CAAC;AAAA,IACD,QAAQ,OAAO,OAAO;AAAA,MACpB,UAAU;AAAA,MACV,mBAAmB;AAAA,MACnB,QAAQ;AAAA,IACV,CAAC;AAAA,EACH,CAAC;AAAA,EACD,SAAS,OAAO,OAAO;AAAA,IACrB,MAAM,OAAO,OAAO;AAAA,MAClB,UAAU;AAAA,MACV,mBAAmB;AAAA,MACnB,QAAQ;AAAA,IACV,CAAC;AAAA,IACD,QAAQ,OAAO,OAAO;AAAA,MACpB,UAAU;AAAA,MACV,mBAAmB;AAAA,MACnB,QAAQ;AAAA,IACV,CAAC;AAAA,EACH,CAAC;AACH,CAAC;AAIM,SAAS,sBAAsB,SAAS;AAC7C,QAAM,SAAS,QAAQ,OAAO;AAC9B,MAAI,CAAC,OAAQ,OAAM,IAAI,MAAM,6BAA6B,OAAO,EAAE;AACnE,SAAO;AACT;AAIA,eAAsB,YAAY,SAAS;AACzC,QAAM,SAAS,SAAS,OAAO;AAC/B,MAAI,CAAC,OAAQ,OAAM,IAAI,MAAM,6BAA6B,OAAO,EAAE;AACnE,SAAO,OAAO;AAChB;AAIA,eAAsB,mBAAmB,SAAS;AAChD,QAAM,SAAS,mBAAmB,OAAO;AACzC,MAAI,CAAC,OAAQ,OAAM,IAAI,MAAM,6BAA6B,OAAO,EAAE;AACnE,SAAO,OAAO;AAChB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -24,9 +24,6 @@ __export(startWorkers_exports, {
|
|
|
24
24
|
terminateWorkers: () => terminateWorkers
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(startWorkers_exports);
|
|
27
|
-
function __isBrowserLike() {
|
|
28
|
-
return typeof Bun === "undefined" && typeof process === "undefined" && typeof addEventListener === "function" && typeof removeEventListener === "function";
|
|
29
|
-
}
|
|
30
27
|
const __wasmAssetLoadModes = ["embedded-base64", "verified-blob", "precheck-direct-url", "trusted-direct-url", "auto"];
|
|
31
28
|
function __isWasmAssetLoadMode(value) {
|
|
32
29
|
return __wasmAssetLoadModes.includes(value);
|
|
@@ -35,7 +32,7 @@ function __bytesToHex(bytes) {
|
|
|
35
32
|
return [...bytes].map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
36
33
|
}
|
|
37
34
|
async function __sha256(bytes) {
|
|
38
|
-
if (
|
|
35
|
+
if (_isBrowserLike) {
|
|
39
36
|
if (typeof crypto === "undefined" || !crypto.subtle || typeof crypto.subtle.digest !== "function") {
|
|
40
37
|
throw new Error("Web Crypto SHA-256 digest is not available");
|
|
41
38
|
}
|
|
@@ -46,6 +43,8 @@ async function __sha256(bytes) {
|
|
|
46
43
|
const nodeModuleId = `node:${nodeModuleName}`;
|
|
47
44
|
const { createHash } = await import(
|
|
48
45
|
/* @vite-ignore */
|
|
46
|
+
/* webpackIgnore: true */
|
|
47
|
+
/* turbopackIgnore: true */
|
|
49
48
|
nodeModuleId
|
|
50
49
|
);
|
|
51
50
|
return createHash("sha256").update(new Uint8Array(bytes)).digest("hex");
|
|
@@ -67,17 +66,21 @@ async function __fetchAndVerifyWorkerUrlBytes(url, expectedSha256) {
|
|
|
67
66
|
return bytes;
|
|
68
67
|
}
|
|
69
68
|
async function __readWorkerUrlBytes(url) {
|
|
70
|
-
if (!
|
|
69
|
+
if (!_isBrowserLike && url.protocol === "file:") {
|
|
71
70
|
const fsModuleName = "fs/promises";
|
|
72
71
|
const fsModuleId = `node:${fsModuleName}`;
|
|
73
72
|
const urlModuleName = "url";
|
|
74
73
|
const urlModuleId = `node:${urlModuleName}`;
|
|
75
74
|
const { readFile } = await import(
|
|
76
75
|
/* @vite-ignore */
|
|
76
|
+
/* webpackIgnore: true */
|
|
77
|
+
/* turbopackIgnore: true */
|
|
77
78
|
fsModuleId
|
|
78
79
|
);
|
|
79
80
|
const { fileURLToPath } = await import(
|
|
80
81
|
/* @vite-ignore */
|
|
82
|
+
/* webpackIgnore: true */
|
|
83
|
+
/* turbopackIgnore: true */
|
|
81
84
|
urlModuleId
|
|
82
85
|
);
|
|
83
86
|
return await readFile(fileURLToPath(url));
|
|
@@ -102,7 +105,7 @@ async function __newBrowserWorkerFromBlob(blob) {
|
|
|
102
105
|
}
|
|
103
106
|
}
|
|
104
107
|
async function __newIsomorphicWorkerFromUrl(url) {
|
|
105
|
-
if (
|
|
108
|
+
if (_isBrowserLike) {
|
|
106
109
|
return new Worker(url, {
|
|
107
110
|
type: "module",
|
|
108
111
|
name: "wasm_bindgen_worker"
|
|
@@ -112,6 +115,8 @@ async function __newIsomorphicWorkerFromUrl(url) {
|
|
|
112
115
|
const nodeModuleId = `node:${nodeModuleName}`;
|
|
113
116
|
const { Worker: NodeWorker } = await import(
|
|
114
117
|
/* @vite-ignore */
|
|
118
|
+
/* webpackIgnore: true */
|
|
119
|
+
/* turbopackIgnore: true */
|
|
115
120
|
nodeModuleId
|
|
116
121
|
);
|
|
117
122
|
return new NodeWorker(url);
|
|
@@ -121,12 +126,14 @@ async function __newNodeWorkerFromJsCode(jsCode) {
|
|
|
121
126
|
const nodeModuleId = `node:${nodeModuleName}`;
|
|
122
127
|
const { Worker: NodeWorker } = await import(
|
|
123
128
|
/* @vite-ignore */
|
|
129
|
+
/* webpackIgnore: true */
|
|
130
|
+
/* turbopackIgnore: true */
|
|
124
131
|
nodeModuleId
|
|
125
132
|
);
|
|
126
133
|
return { worker: new NodeWorker(jsCode, { eval: true }), blobUrl: void 0 };
|
|
127
134
|
}
|
|
128
135
|
async function __newIsomorphicWorkerFromVerifiedJsCodeBytes(verifiedJsCodeBytes) {
|
|
129
|
-
if (
|
|
136
|
+
if (_isBrowserLike) {
|
|
130
137
|
return await __newBrowserWorkerFromBlob(
|
|
131
138
|
new Blob([verifiedJsCodeBytes], {
|
|
132
139
|
type: "application/javascript"
|
|
@@ -136,7 +143,7 @@ async function __newIsomorphicWorkerFromVerifiedJsCodeBytes(verifiedJsCodeBytes)
|
|
|
136
143
|
return await __newNodeWorkerFromJsCode(Buffer.from(verifiedJsCodeBytes).toString("utf-8"));
|
|
137
144
|
}
|
|
138
145
|
async function __newWorkerFromJsCodeBase64(jsCodeBase64) {
|
|
139
|
-
if (
|
|
146
|
+
if (_isBrowserLike) {
|
|
140
147
|
const blob = new Blob([atob(jsCodeBase64)], {
|
|
141
148
|
type: "application/javascript"
|
|
142
149
|
});
|
|
@@ -203,6 +210,7 @@ let _terminating;
|
|
|
203
210
|
let _configSet = false;
|
|
204
211
|
let _workerUrl = void 0;
|
|
205
212
|
let _wasmAssetLoadMode = "auto";
|
|
213
|
+
let _isBrowserLike = void 0;
|
|
206
214
|
const _workerUrlSha256 = "3f93fe86a8dfa6e25ae5fcfe28d19833219cba8f45f81c6dd05c2f3cc5323c52";
|
|
207
215
|
let _verifiedWorkerUrlBytesPromise = void 0;
|
|
208
216
|
let _logger = void 0;
|
|
@@ -230,7 +238,15 @@ function setWorkerUrlConfig(parameters = {}) {
|
|
|
230
238
|
if (parameters === null || typeof parameters !== "object") {
|
|
231
239
|
throw new TypeError("setWorkerUrlConfig parameters must be an object");
|
|
232
240
|
}
|
|
233
|
-
const {
|
|
241
|
+
const {
|
|
242
|
+
workerUrl = void 0,
|
|
243
|
+
wasmAssetLoadMode = "auto",
|
|
244
|
+
logger = void 0,
|
|
245
|
+
isBrowserLike = void 0
|
|
246
|
+
} = parameters;
|
|
247
|
+
if (typeof isBrowserLike !== "boolean") {
|
|
248
|
+
throw new TypeError("setWorkerUrlConfig: isBrowserLike (boolean) is required");
|
|
249
|
+
}
|
|
234
250
|
if (!__isWasmAssetLoadMode(wasmAssetLoadMode)) {
|
|
235
251
|
throw new TypeError(`wasmAssetLoadMode must be one of: ${__wasmAssetLoadModes.join(", ")}`);
|
|
236
252
|
}
|
|
@@ -247,6 +263,7 @@ function setWorkerUrlConfig(parameters = {}) {
|
|
|
247
263
|
__assertLogger(logger);
|
|
248
264
|
_wasmAssetLoadMode = wasmAssetLoadMode;
|
|
249
265
|
_logger = logger;
|
|
266
|
+
_isBrowserLike = isBrowserLike;
|
|
250
267
|
_configSet = true;
|
|
251
268
|
}
|
|
252
269
|
function __getVerifiedWorkerUrlBytesPromise() {
|