modelfusion 0.135.0 → 0.136.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/index.cjs +20 -2
- package/index.cjs.map +1 -1
- package/index.js +27 -2
- package/index.js.map +1 -1
- package/internal/index.cjs +10 -1
- package/internal/index.cjs.map +1 -1
- package/internal/index.js +18 -1
- package/internal/index.js.map +1 -1
- package/node/index.cjs +184 -0
- package/node/index.cjs.map +1 -0
- package/node/index.d.cts +92 -0
- package/node/index.d.ts +92 -0
- package/node/index.js +147 -0
- package/node/index.js.map +1 -0
- package/package.json +7 -1
package/index.cjs
CHANGED
@@ -757,7 +757,16 @@ function detectRuntime() {
|
|
757
757
|
var runStorage;
|
758
758
|
async function ensureLoaded() {
|
759
759
|
if (detectRuntime() === "node" && !runStorage) {
|
760
|
-
|
760
|
+
let AsyncLocalStorage;
|
761
|
+
try {
|
762
|
+
AsyncLocalStorage = (await import("async_hooks")).AsyncLocalStorage;
|
763
|
+
} catch (error) {
|
764
|
+
try {
|
765
|
+
AsyncLocalStorage = require("async_hooks").AsyncLocalStorage;
|
766
|
+
} catch (error2) {
|
767
|
+
throw new Error(`Failed to load 'async_hooks' module dynamically.`);
|
768
|
+
}
|
769
|
+
}
|
761
770
|
runStorage = new AsyncLocalStorage();
|
762
771
|
}
|
763
772
|
return Promise.resolve();
|
@@ -4755,7 +4764,16 @@ async function createSimpleWebSocket(url) {
|
|
4755
4764
|
return new WebSocket(url);
|
4756
4765
|
}
|
4757
4766
|
case "node": {
|
4758
|
-
|
4767
|
+
let WebSocket2;
|
4768
|
+
try {
|
4769
|
+
WebSocket2 = (await import("ws")).default;
|
4770
|
+
} catch (error) {
|
4771
|
+
try {
|
4772
|
+
WebSocket2 = require("ws");
|
4773
|
+
} catch (error2) {
|
4774
|
+
throw new Error(`Failed to load 'ws' module dynamically.`);
|
4775
|
+
}
|
4776
|
+
}
|
4759
4777
|
return new WebSocket2(url);
|
4760
4778
|
}
|
4761
4779
|
default: {
|