sandboxedjs 0.1.19 → 0.1.21
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 +2 -16
- package/bin/sandboxedjs.mjs +1 -1
- package/dist/index.cjs +113 -356
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +37 -74
- package/dist/index.d.ts +37 -74
- package/dist/index.js +113 -356
- package/dist/index.js.map +1 -1
- package/package.json +2 -3
package/dist/index.d.cts
CHANGED
|
@@ -1289,51 +1289,50 @@ declare class Shell {
|
|
|
1289
1289
|
}
|
|
1290
1290
|
|
|
1291
1291
|
/**
|
|
1292
|
-
* The
|
|
1293
|
-
*
|
|
1292
|
+
* The CPython runtime: Pyodide, wired to the container the same way
|
|
1293
|
+
* the other runtimes are — filesystem, argv, environment and standard streams.
|
|
1294
1294
|
*
|
|
1295
|
-
*
|
|
1296
|
-
*
|
|
1297
|
-
*
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
declare const PYTHON_VERSION = "3.4.0";
|
|
1301
|
-
/**
|
|
1302
|
-
* Which interpreter `python3` is.
|
|
1295
|
+
* This is real CPython, so `sqlite3`, `dataclasses`, `decimal`, `typing` and
|
|
1296
|
+
* the rest of the standard library are present, and `micropip` can install
|
|
1297
|
+
* pure-Python wheels.
|
|
1298
|
+
*
|
|
1299
|
+
* CPython keeps its own library inside the Emscripten filesystem, so:
|
|
1303
1300
|
*
|
|
1304
|
-
*
|
|
1305
|
-
*
|
|
1301
|
+
* - the container is mounted subtree by subtree rather than over `/`, so
|
|
1302
|
+
* Pyodide's standard-library files survive;
|
|
1303
|
+
* - an interpreter costs roughly a second and a half to start, so one is kept
|
|
1304
|
+
* per container and each program is run in a fresh namespace instead.
|
|
1306
1305
|
*/
|
|
1307
|
-
|
|
1308
|
-
interface
|
|
1309
|
-
/** Interpreter to run. Defaults to `auto`. */
|
|
1310
|
-
engine?: PythonEngine;
|
|
1311
|
-
/** Where Pyodide's assets live; only a browser needs to say. */
|
|
1312
|
-
indexURL?: string;
|
|
1313
|
-
/** URL of the Pyodide ES module, for a browser with no bundler. */
|
|
1314
|
-
pyodideURL?: string;
|
|
1306
|
+
|
|
1307
|
+
interface CPythonOptions {
|
|
1315
1308
|
/**
|
|
1316
|
-
*
|
|
1317
|
-
*
|
|
1318
|
-
* Emscripten resolves the binary against the script's own directory, which
|
|
1319
|
-
* is right in Node and wrong in a browser: a bundler rewrites the loader to
|
|
1320
|
-
* a hashed chunk, the guess lands on a path the dev server answers with
|
|
1321
|
-
* `index.html`, and instantiation dies on `expected magic word 00 61 73 6d,
|
|
1322
|
-
* found 3c 21 64 6f` — the first four bytes of `<!doctype`.
|
|
1323
|
-
*
|
|
1324
|
-
* Every bundler spells "give me the URL of this asset" differently, so the
|
|
1325
|
-
* host supplies it rather than this module trying to detect one:
|
|
1309
|
+
* Where Pyodide's own assets live.
|
|
1326
1310
|
*
|
|
1327
|
-
*
|
|
1328
|
-
*
|
|
1329
|
-
* await createContainer({ pod, python: { wasmUrl: wasm } });
|
|
1330
|
-
* ```
|
|
1311
|
+
* Node resolves them from the installed package, so this is only needed in a
|
|
1312
|
+
* browser, where they are served or taken from a CDN.
|
|
1331
1313
|
*/
|
|
1332
|
-
|
|
1314
|
+
indexURL?: string;
|
|
1315
|
+
/**
|
|
1316
|
+
* URL of the Pyodide ES module, for hosts that cannot resolve the package by
|
|
1317
|
+
* name — a browser without a bundler, typically.
|
|
1318
|
+
*/
|
|
1319
|
+
moduleURL?: string;
|
|
1320
|
+
}
|
|
1321
|
+
declare function configureCPython(options?: CPythonOptions): void;
|
|
1322
|
+
/** True when this host can start CPython at all. */
|
|
1323
|
+
declare function isCPythonAvailable(): Promise<boolean>;
|
|
1324
|
+
|
|
1325
|
+
/** The existing Python CLI surface, backed exclusively by CPython/Pyodide. */
|
|
1326
|
+
|
|
1327
|
+
declare const PYTHON_VERSION = "3.13";
|
|
1328
|
+
interface PythonOptions {
|
|
1329
|
+
/** Where Pyodide's assets live; only a browser normally needs this. */
|
|
1330
|
+
indexURL?: string;
|
|
1331
|
+
/** URL of pyodide.mjs, for browsers without package resolution. */
|
|
1332
|
+
pyodideURL?: string;
|
|
1333
1333
|
}
|
|
1334
1334
|
declare function configurePython(options?: PythonOptions): void;
|
|
1335
|
-
|
|
1336
|
-
declare function isPythonAvailable(): Promise<boolean>;
|
|
1335
|
+
declare const isPythonAvailable: typeof isCPythonAvailable;
|
|
1337
1336
|
|
|
1338
1337
|
/**
|
|
1339
1338
|
* A promise-based filesystem façade for host code, shaped like `fs/promises`
|
|
@@ -2016,42 +2015,6 @@ declare function buildRootfs(vfs: Vfs, opts?: RootfsOptions): void;
|
|
|
2016
2015
|
|
|
2017
2016
|
declare const NODE_VERSION = "v22.12.0";
|
|
2018
2017
|
|
|
2019
|
-
/**
|
|
2020
|
-
* The CPython runtime: Pyodide, wired to the container the same way
|
|
2021
|
-
* MicroPython is — filesystem, argv, environment and standard streams.
|
|
2022
|
-
*
|
|
2023
|
-
* This is real CPython, so `sqlite3`, `dataclasses`, `decimal`, `typing` and
|
|
2024
|
-
* the rest of the standard library are present, and `micropip` can install
|
|
2025
|
-
* pure-Python wheels. MicroPython remains for hosts that do not want a 13 MB
|
|
2026
|
-
* interpreter: see `configurePython`.
|
|
2027
|
-
*
|
|
2028
|
-
* Two things differ from the MicroPython path, and both are forced by CPython
|
|
2029
|
-
* keeping its own library inside the Emscripten filesystem:
|
|
2030
|
-
*
|
|
2031
|
-
* - the container is mounted subtree by subtree rather than over `/`, so
|
|
2032
|
-
* `/lib/python314.zip` survives;
|
|
2033
|
-
* - an interpreter costs roughly a second and a half to start, so one is kept
|
|
2034
|
-
* per container and each program is run in a fresh namespace instead.
|
|
2035
|
-
*/
|
|
2036
|
-
|
|
2037
|
-
interface CPythonOptions {
|
|
2038
|
-
/**
|
|
2039
|
-
* Where Pyodide's own assets live.
|
|
2040
|
-
*
|
|
2041
|
-
* Node resolves them from the installed package, so this is only needed in a
|
|
2042
|
-
* browser, where they are served or taken from a CDN.
|
|
2043
|
-
*/
|
|
2044
|
-
indexURL?: string;
|
|
2045
|
-
/**
|
|
2046
|
-
* URL of the Pyodide ES module, for hosts that cannot resolve the package by
|
|
2047
|
-
* name — a browser without a bundler, typically.
|
|
2048
|
-
*/
|
|
2049
|
-
moduleURL?: string;
|
|
2050
|
-
}
|
|
2051
|
-
declare function configureCPython(options?: CPythonOptions): void;
|
|
2052
|
-
/** True when this host can start CPython at all. */
|
|
2053
|
-
declare function isCPythonAvailable(): Promise<boolean>;
|
|
2054
|
-
|
|
2055
2018
|
/**
|
|
2056
2019
|
* Package managers: `npm`/`npx`/`yarn`/`pnpm` on top of Nodepod's installer,
|
|
2057
2020
|
* and an `apt`-shaped front end for the things a container image would ship.
|
|
@@ -2077,4 +2040,4 @@ declare const NPM_VERSION = "10.9.0";
|
|
|
2077
2040
|
* ```
|
|
2078
2041
|
*/
|
|
2079
2042
|
|
|
2080
|
-
export { ArithError, BufferSink, type CPythonOptions, CallbackSink, type Command, CommandRegistry, Container, ContainerFs, type ContainerOptions, type ContextInit, type Cred, type DirEntry, ERRNO, type Env, type ErrnoCode, type ExecContext, type ExecOptions, type ExecResult, type FileData, FileInput, FileOutput, type GroupEntry, type HttpResponse, IncompleteInputError, type InputStream, type Job, KERNEL_NAME, KERNEL_RELEASE, Kernel, type KernelOptions, type ListeningPort, type MountEntry, NODE_VERSION, NPM_VERSION, type NetInterface, type NetworkOptions, NetworkStack, NullInput, NullOutput, OS_RELEASE, type OutputStream, PYTHON_VERSION, type PasswdEntry, Pipe, Process, type ProcessKind, type ProcessOptions, type ProcessState, ProcessTable, type
|
|
2043
|
+
export { ArithError, BufferSink, type CPythonOptions, CallbackSink, type Command, CommandRegistry, Container, ContainerFs, type ContainerOptions, type ContextInit, type Cred, type DirEntry, ERRNO, type Env, type ErrnoCode, type ExecContext, type ExecOptions, type ExecResult, type FileData, FileInput, FileOutput, type GroupEntry, type HttpResponse, IncompleteInputError, type InputStream, type Job, KERNEL_NAME, KERNEL_RELEASE, Kernel, type KernelOptions, type ListeningPort, type MountEntry, NODE_VERSION, NPM_VERSION, type NetInterface, type NetworkOptions, NetworkStack, NullInput, NullOutput, OS_RELEASE, type OutputStream, PYTHON_VERSION, type PasswdEntry, Pipe, Process, type ProcessKind, type ProcessOptions, type ProcessState, ProcessTable, type PythonOptions, ROOT_CRED, type ResolvedExecutable, type RootfsOptions, type RunOptions, type RunResult, SIGNALS, SIGNAL_NAMES, Session, type SessionInit, type SessionResult, type SessionRunOptions, Shell, ShellExit, type ShellIO, type ShellInit, Lexer as ShellLexer, type ShellOptions, ShellSyntaxError, type SpawnHandle, Stats, type Stdio, SysError, TeeOutput, Terminal, type TerminalOptions, UserDatabase, Variables, Vfs, type VirtualNode, type VirtualProvider, type WriteOptions, allCommands, applyChmod, braceExpand, buildRootfs, builtinNames, captureStdio, configureCPython, configurePython, createContainer, createContext, createContainer as default, defineCommand, evalArith, exitCodeForSignal, expandPrompt, expandWord, expandWords, fnmatch, formatMode, getBuiltin, glob, globToRegex, hasMagic, installUserland, isBuiltinName, isCPythonAvailable, isPythonAvailable, isSysError, makeCred, normalizeSignal, octalMode, parse as parseShell, parseUmask, path as posixPath, resetPidCounter, shellQuote, strerror, unameInfo };
|
package/dist/index.d.ts
CHANGED
|
@@ -1289,51 +1289,50 @@ declare class Shell {
|
|
|
1289
1289
|
}
|
|
1290
1290
|
|
|
1291
1291
|
/**
|
|
1292
|
-
* The
|
|
1293
|
-
*
|
|
1292
|
+
* The CPython runtime: Pyodide, wired to the container the same way
|
|
1293
|
+
* the other runtimes are — filesystem, argv, environment and standard streams.
|
|
1294
1294
|
*
|
|
1295
|
-
*
|
|
1296
|
-
*
|
|
1297
|
-
*
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
declare const PYTHON_VERSION = "3.4.0";
|
|
1301
|
-
/**
|
|
1302
|
-
* Which interpreter `python3` is.
|
|
1295
|
+
* This is real CPython, so `sqlite3`, `dataclasses`, `decimal`, `typing` and
|
|
1296
|
+
* the rest of the standard library are present, and `micropip` can install
|
|
1297
|
+
* pure-Python wheels.
|
|
1298
|
+
*
|
|
1299
|
+
* CPython keeps its own library inside the Emscripten filesystem, so:
|
|
1303
1300
|
*
|
|
1304
|
-
*
|
|
1305
|
-
*
|
|
1301
|
+
* - the container is mounted subtree by subtree rather than over `/`, so
|
|
1302
|
+
* Pyodide's standard-library files survive;
|
|
1303
|
+
* - an interpreter costs roughly a second and a half to start, so one is kept
|
|
1304
|
+
* per container and each program is run in a fresh namespace instead.
|
|
1306
1305
|
*/
|
|
1307
|
-
|
|
1308
|
-
interface
|
|
1309
|
-
/** Interpreter to run. Defaults to `auto`. */
|
|
1310
|
-
engine?: PythonEngine;
|
|
1311
|
-
/** Where Pyodide's assets live; only a browser needs to say. */
|
|
1312
|
-
indexURL?: string;
|
|
1313
|
-
/** URL of the Pyodide ES module, for a browser with no bundler. */
|
|
1314
|
-
pyodideURL?: string;
|
|
1306
|
+
|
|
1307
|
+
interface CPythonOptions {
|
|
1315
1308
|
/**
|
|
1316
|
-
*
|
|
1317
|
-
*
|
|
1318
|
-
* Emscripten resolves the binary against the script's own directory, which
|
|
1319
|
-
* is right in Node and wrong in a browser: a bundler rewrites the loader to
|
|
1320
|
-
* a hashed chunk, the guess lands on a path the dev server answers with
|
|
1321
|
-
* `index.html`, and instantiation dies on `expected magic word 00 61 73 6d,
|
|
1322
|
-
* found 3c 21 64 6f` — the first four bytes of `<!doctype`.
|
|
1323
|
-
*
|
|
1324
|
-
* Every bundler spells "give me the URL of this asset" differently, so the
|
|
1325
|
-
* host supplies it rather than this module trying to detect one:
|
|
1309
|
+
* Where Pyodide's own assets live.
|
|
1326
1310
|
*
|
|
1327
|
-
*
|
|
1328
|
-
*
|
|
1329
|
-
* await createContainer({ pod, python: { wasmUrl: wasm } });
|
|
1330
|
-
* ```
|
|
1311
|
+
* Node resolves them from the installed package, so this is only needed in a
|
|
1312
|
+
* browser, where they are served or taken from a CDN.
|
|
1331
1313
|
*/
|
|
1332
|
-
|
|
1314
|
+
indexURL?: string;
|
|
1315
|
+
/**
|
|
1316
|
+
* URL of the Pyodide ES module, for hosts that cannot resolve the package by
|
|
1317
|
+
* name — a browser without a bundler, typically.
|
|
1318
|
+
*/
|
|
1319
|
+
moduleURL?: string;
|
|
1320
|
+
}
|
|
1321
|
+
declare function configureCPython(options?: CPythonOptions): void;
|
|
1322
|
+
/** True when this host can start CPython at all. */
|
|
1323
|
+
declare function isCPythonAvailable(): Promise<boolean>;
|
|
1324
|
+
|
|
1325
|
+
/** The existing Python CLI surface, backed exclusively by CPython/Pyodide. */
|
|
1326
|
+
|
|
1327
|
+
declare const PYTHON_VERSION = "3.13";
|
|
1328
|
+
interface PythonOptions {
|
|
1329
|
+
/** Where Pyodide's assets live; only a browser normally needs this. */
|
|
1330
|
+
indexURL?: string;
|
|
1331
|
+
/** URL of pyodide.mjs, for browsers without package resolution. */
|
|
1332
|
+
pyodideURL?: string;
|
|
1333
1333
|
}
|
|
1334
1334
|
declare function configurePython(options?: PythonOptions): void;
|
|
1335
|
-
|
|
1336
|
-
declare function isPythonAvailable(): Promise<boolean>;
|
|
1335
|
+
declare const isPythonAvailable: typeof isCPythonAvailable;
|
|
1337
1336
|
|
|
1338
1337
|
/**
|
|
1339
1338
|
* A promise-based filesystem façade for host code, shaped like `fs/promises`
|
|
@@ -2016,42 +2015,6 @@ declare function buildRootfs(vfs: Vfs, opts?: RootfsOptions): void;
|
|
|
2016
2015
|
|
|
2017
2016
|
declare const NODE_VERSION = "v22.12.0";
|
|
2018
2017
|
|
|
2019
|
-
/**
|
|
2020
|
-
* The CPython runtime: Pyodide, wired to the container the same way
|
|
2021
|
-
* MicroPython is — filesystem, argv, environment and standard streams.
|
|
2022
|
-
*
|
|
2023
|
-
* This is real CPython, so `sqlite3`, `dataclasses`, `decimal`, `typing` and
|
|
2024
|
-
* the rest of the standard library are present, and `micropip` can install
|
|
2025
|
-
* pure-Python wheels. MicroPython remains for hosts that do not want a 13 MB
|
|
2026
|
-
* interpreter: see `configurePython`.
|
|
2027
|
-
*
|
|
2028
|
-
* Two things differ from the MicroPython path, and both are forced by CPython
|
|
2029
|
-
* keeping its own library inside the Emscripten filesystem:
|
|
2030
|
-
*
|
|
2031
|
-
* - the container is mounted subtree by subtree rather than over `/`, so
|
|
2032
|
-
* `/lib/python314.zip` survives;
|
|
2033
|
-
* - an interpreter costs roughly a second and a half to start, so one is kept
|
|
2034
|
-
* per container and each program is run in a fresh namespace instead.
|
|
2035
|
-
*/
|
|
2036
|
-
|
|
2037
|
-
interface CPythonOptions {
|
|
2038
|
-
/**
|
|
2039
|
-
* Where Pyodide's own assets live.
|
|
2040
|
-
*
|
|
2041
|
-
* Node resolves them from the installed package, so this is only needed in a
|
|
2042
|
-
* browser, where they are served or taken from a CDN.
|
|
2043
|
-
*/
|
|
2044
|
-
indexURL?: string;
|
|
2045
|
-
/**
|
|
2046
|
-
* URL of the Pyodide ES module, for hosts that cannot resolve the package by
|
|
2047
|
-
* name — a browser without a bundler, typically.
|
|
2048
|
-
*/
|
|
2049
|
-
moduleURL?: string;
|
|
2050
|
-
}
|
|
2051
|
-
declare function configureCPython(options?: CPythonOptions): void;
|
|
2052
|
-
/** True when this host can start CPython at all. */
|
|
2053
|
-
declare function isCPythonAvailable(): Promise<boolean>;
|
|
2054
|
-
|
|
2055
2018
|
/**
|
|
2056
2019
|
* Package managers: `npm`/`npx`/`yarn`/`pnpm` on top of Nodepod's installer,
|
|
2057
2020
|
* and an `apt`-shaped front end for the things a container image would ship.
|
|
@@ -2077,4 +2040,4 @@ declare const NPM_VERSION = "10.9.0";
|
|
|
2077
2040
|
* ```
|
|
2078
2041
|
*/
|
|
2079
2042
|
|
|
2080
|
-
export { ArithError, BufferSink, type CPythonOptions, CallbackSink, type Command, CommandRegistry, Container, ContainerFs, type ContainerOptions, type ContextInit, type Cred, type DirEntry, ERRNO, type Env, type ErrnoCode, type ExecContext, type ExecOptions, type ExecResult, type FileData, FileInput, FileOutput, type GroupEntry, type HttpResponse, IncompleteInputError, type InputStream, type Job, KERNEL_NAME, KERNEL_RELEASE, Kernel, type KernelOptions, type ListeningPort, type MountEntry, NODE_VERSION, NPM_VERSION, type NetInterface, type NetworkOptions, NetworkStack, NullInput, NullOutput, OS_RELEASE, type OutputStream, PYTHON_VERSION, type PasswdEntry, Pipe, Process, type ProcessKind, type ProcessOptions, type ProcessState, ProcessTable, type
|
|
2043
|
+
export { ArithError, BufferSink, type CPythonOptions, CallbackSink, type Command, CommandRegistry, Container, ContainerFs, type ContainerOptions, type ContextInit, type Cred, type DirEntry, ERRNO, type Env, type ErrnoCode, type ExecContext, type ExecOptions, type ExecResult, type FileData, FileInput, FileOutput, type GroupEntry, type HttpResponse, IncompleteInputError, type InputStream, type Job, KERNEL_NAME, KERNEL_RELEASE, Kernel, type KernelOptions, type ListeningPort, type MountEntry, NODE_VERSION, NPM_VERSION, type NetInterface, type NetworkOptions, NetworkStack, NullInput, NullOutput, OS_RELEASE, type OutputStream, PYTHON_VERSION, type PasswdEntry, Pipe, Process, type ProcessKind, type ProcessOptions, type ProcessState, ProcessTable, type PythonOptions, ROOT_CRED, type ResolvedExecutable, type RootfsOptions, type RunOptions, type RunResult, SIGNALS, SIGNAL_NAMES, Session, type SessionInit, type SessionResult, type SessionRunOptions, Shell, ShellExit, type ShellIO, type ShellInit, Lexer as ShellLexer, type ShellOptions, ShellSyntaxError, type SpawnHandle, Stats, type Stdio, SysError, TeeOutput, Terminal, type TerminalOptions, UserDatabase, Variables, Vfs, type VirtualNode, type VirtualProvider, type WriteOptions, allCommands, applyChmod, braceExpand, buildRootfs, builtinNames, captureStdio, configureCPython, configurePython, createContainer, createContext, createContainer as default, defineCommand, evalArith, exitCodeForSignal, expandPrompt, expandWord, expandWords, fnmatch, formatMode, getBuiltin, glob, globToRegex, hasMagic, installUserland, isBuiltinName, isCPythonAvailable, isPythonAvailable, isSysError, makeCred, normalizeSignal, octalMode, parse as parseShell, parseUmask, path as posixPath, resetPidCounter, shellQuote, strerror, unameInfo };
|