sandboxedjs 0.1.55 → 0.1.56
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 +5 -2
- package/dist/index.cjs +20 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +20 -1
- package/dist/index.js.map +1 -1
- package/dist/python/python.data +278 -268
- package/dist/python/python.js +1 -1
- package/dist/python/python.wasm +0 -0
- package/dist/python/runtime.json +3 -3
- package/dist/python/wheels/index.json +42 -0
- package/dist/python/wheels/pydantic_core-2.23.2-cp313-cp313-emscripten_5_0_6_wasm32.whl +0 -0
- package/dist/python/wheels/pydantic_core-2.46.5-cp313-cp313-emscripten_5_0_6_wasm32.whl +0 -0
- package/dist/python/wheels/sbx_c_probe-1.0.0-cp313-cp313-emscripten_5_0_6_wasm32.whl +0 -0
- package/dist/python/wheels/sbx_rust_probe-1.0.0-cp313-cp313-emscripten_5_0_6_wasm32.whl +0 -0
- package/dist/python-abi.cjs +6 -0
- package/dist/python-abi.cjs.map +1 -1
- package/dist/python-abi.d.cts +2 -0
- package/dist/python-abi.d.ts +2 -0
- package/dist/python-abi.js +6 -0
- package/dist/python-abi.js.map +1 -1
- package/dist/python-worker.js +80 -5
- package/dist/python-worker.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -977,8 +977,11 @@ Honest list of what does not work:
|
|
|
977
977
|
that `request()` talks to directly, so servers work; raw sockets do not.
|
|
978
978
|
- **Python is source-built CPython/WASM.** Each program gets its own interpreter
|
|
979
979
|
process worker. Pure-Python wheels install normally; native extensions must
|
|
980
|
-
be linked or published for Emscripten.
|
|
981
|
-
|
|
980
|
+
be linked or published for Emscripten. The bundled wheel index includes the
|
|
981
|
+
ABI-matched `pydantic-core` builds required by Pydantic 2, so FastAPI resolves
|
|
982
|
+
against Pydantic 2 by default. Virtual environments and CPython's real pip
|
|
983
|
+
are not implemented; the sandbox `pip` installs into one shared site-packages
|
|
984
|
+
directory, so use a fresh container for dependency isolation.
|
|
982
985
|
- **No real sockets.** HTTP servers work through the request proxy; raw TCP/UDP does not.
|
|
983
986
|
- **No real processes.** Processes are cooperative async tasks: `kill -9` cannot interrupt a
|
|
984
987
|
tight synchronous loop, and `SIGSTOP` only marks state.
|
package/dist/index.cjs
CHANGED
|
@@ -17935,7 +17935,15 @@ var bundledManifest = {
|
|
|
17935
17935
|
persistence: "memory"
|
|
17936
17936
|
}
|
|
17937
17937
|
};
|
|
17938
|
-
var
|
|
17938
|
+
var bundledWheelIndex = new URL(
|
|
17939
|
+
(typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)).includes("/src/runtime/python/") ? "../../../dist/python/wheels/" : "./python/wheels/",
|
|
17940
|
+
(typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))
|
|
17941
|
+
).href;
|
|
17942
|
+
var config = {
|
|
17943
|
+
backend: "sbx-cpython-wasm",
|
|
17944
|
+
manifest: bundledManifest,
|
|
17945
|
+
wheelIndex: bundledWheelIndex
|
|
17946
|
+
};
|
|
17939
17947
|
function setPythonBackend(options) {
|
|
17940
17948
|
if (options.wheelIndex !== void 0) config.wheelIndex = options.wheelIndex;
|
|
17941
17949
|
if (options.manifest !== void 0) config.manifest = validateManifest(options.manifest);
|
|
@@ -20404,6 +20412,17 @@ environments. A package with no usable wheel is an error, never a silent skip.`,
|
|
|
20404
20412
|
}
|
|
20405
20413
|
const cache = /* @__PURE__ */ new Map();
|
|
20406
20414
|
const request = async (url, timeoutMs, read) => {
|
|
20415
|
+
if (url.startsWith("file:")) {
|
|
20416
|
+
try {
|
|
20417
|
+
const [{ readFile }, { fileURLToPath: fileURLToPath2 }] = await Promise.all([
|
|
20418
|
+
nodeBuiltin("fs/promises"),
|
|
20419
|
+
nodeBuiltin("url")
|
|
20420
|
+
]);
|
|
20421
|
+
return await read(new Response(await readFile(fileURLToPath2(url))));
|
|
20422
|
+
} catch (error) {
|
|
20423
|
+
throw new Error(`could not read bundled wheel asset ${url}: ${error.message}`);
|
|
20424
|
+
}
|
|
20425
|
+
}
|
|
20407
20426
|
const controller = new AbortController();
|
|
20408
20427
|
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
20409
20428
|
try {
|