sandboxedjs 0.1.48 → 0.1.49
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/dist/agent.d.cts +2 -1
- package/dist/agent.d.ts +2 -1
- package/dist/{container-DyRF-bY0.d.cts → container-DBMPLbUu.d.ts} +103 -410
- package/dist/{container-DyRF-bY0.d.ts → container-Dg8NwBc7.d.cts} +103 -410
- package/dist/index.cjs +2335 -306
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +20 -65
- package/dist/index.d.ts +20 -65
- package/dist/index.js +2331 -305
- package/dist/index.js.map +1 -1
- package/dist/memory-volume-CTOXNJ6n.d.ts +66 -0
- package/dist/memory-volume-DCzGZFJb.d.cts +66 -0
- package/dist/python/python.data +16026 -66
- package/dist/python/python.js +2 -0
- package/dist/python/python.wasm +0 -0
- package/dist/python/python.worker.js +87 -0
- package/dist/python/runtime.json +34 -0
- package/dist/python-abi.cjs +2892 -0
- package/dist/python-abi.cjs.map +1 -0
- package/dist/python-abi.d.cts +645 -0
- package/dist/python-abi.d.ts +645 -0
- package/dist/python-abi.js +2839 -0
- package/dist/python-abi.js.map +1 -0
- package/dist/python-worker.js +865 -0
- package/dist/python-worker.js.map +1 -0
- package/dist/rolldown-wasi-worker.js +5 -1
- package/dist/rolldown-wasi-worker.js.map +1 -1
- package/dist/vfs-DzEcPbMY.d.cts +427 -0
- package/dist/vfs-DzEcPbMY.d.ts +427 -0
- package/package.json +8 -3
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { S as Shell, a as ShellIO, b as Session,
|
|
2
|
-
export { B as BufferSink,
|
|
1
|
+
import { S as Shell, a as ShellIO, b as Session, N as Node, c as Command, K as Kernel, E as ExecContext, O as OutputStream, C as Container, d as createContainer } from './container-Dg8NwBc7.cjs';
|
|
2
|
+
export { B as BufferSink, e as CPythonOptions, f as CallbackSink, g as CommandRegistry, h as ContainerFs, i as ContainerOptions, j as ContextInit, k as Env, l as ExecOptions, m as ExecResult, F as FileData, n as FileInput, o as FileOutput, G as GroupEntry, H as HttpResponse, I as InputStream, J as Job, p as KernelOptions, L as ListeningPort, M as MANIFEST_FORMAT, q as MANIFEST_SCHEMA_VERSION, r as MountEntry, s as NetInterface, t as NetworkOptions, u as NetworkStack, v as NullInput, w as NullOutput, P as PYTHON_VERSION, x as PasswdEntry, y as Pipe, z as Process, A as ProcessKind, D as ProcessOptions, Q as ProcessState, R as ProcessTable, T as PythonCapabilities, U as PythonOptions, V as PythonProfile, W as PythonRuntimeManifest, X as ResolvedExecutable, Y as RunOptions, Z as RunResult, _ as SessionInit, $ as SessionResult, a0 as SessionRunOptions, a1 as ShellExit, a2 as ShellInit, a3 as ShellOptions, a4 as SpawnHandle, a5 as Stdio, a6 as TeeOutput, a7 as UserDatabase, a8 as Variables, a9 as braceExpand, aa as captureStdio, ab as configureCPython, ac as configurePython, ad as createContext, ae as defineCommand, af as expandWord, ag as expandWords, ah as isCPythonAvailable, ai as isPythonAvailable, aj as resetPidCounter, ak as shellQuote, al as validateManifest } from './container-Dg8NwBc7.cjs';
|
|
3
|
+
import { V as Vfs, C as Cred, R as RuntimeVolume, a as RuntimeHttpResponse, S as SpawnChild, b as SyncSpawn, c as VolumeStat, d as VolumeStats, e as RuntimePod, f as RuntimePackageInstaller, g as ChildSpawnConfig, h as ChildHandle, i as RuntimeProcess, j as RuntimeSocketPeer, k as RuntimeConnection } from './vfs-DzEcPbMY.cjs';
|
|
4
|
+
export { D as DirEntry, l as ROOT_CRED, m as RuntimeProcessManager, n as RuntimeProcessResult, o as Stats, p as VirtualNode, q as VirtualProvider, W as WriteOptions, r as applyChmod, s as createChildProcessModule, t as formatMode, u as makeCred, v as octalMode, w as parseUmask } from './vfs-DzEcPbMY.cjs';
|
|
5
|
+
import { M as MemoryVolume, a as MemoryVolumeSnapshotEntry } from './memory-volume-DCzGZFJb.cjs';
|
|
3
6
|
import EventEmitter from 'events/events.js';
|
|
4
7
|
import streamModule from 'stream-browserify';
|
|
5
8
|
|
|
@@ -419,69 +422,6 @@ declare const NODE_VERSION = "v22.12.0";
|
|
|
419
422
|
|
|
420
423
|
declare const NPM_VERSION = "10.9.0";
|
|
421
424
|
|
|
422
|
-
type NodeKind = "file" | "directory" | "symlink";
|
|
423
|
-
interface MemoryVolumeSnapshotEntry {
|
|
424
|
-
path: string;
|
|
425
|
-
ino: number;
|
|
426
|
-
kind: NodeKind;
|
|
427
|
-
mode: number;
|
|
428
|
-
uid: number;
|
|
429
|
-
gid: number;
|
|
430
|
-
nlink: number;
|
|
431
|
-
data: number[];
|
|
432
|
-
target: string;
|
|
433
|
-
atimeMs: number;
|
|
434
|
-
mtimeMs: number;
|
|
435
|
-
ctimeMs: number;
|
|
436
|
-
birthtimeMs: number;
|
|
437
|
-
}
|
|
438
|
-
/** Browser-safe, synchronous in-memory filesystem used by the new runtime. */
|
|
439
|
-
declare class MemoryVolume implements RuntimeVolume {
|
|
440
|
-
private readonly entries;
|
|
441
|
-
private nextIno;
|
|
442
|
-
constructor();
|
|
443
|
-
readFileSync(path: string): Uint8Array;
|
|
444
|
-
writeFileSync(path: string, data: string | Uint8Array): void;
|
|
445
|
-
appendFileSync(path: string, data: string | Uint8Array): void;
|
|
446
|
-
readdirSync(path: string): string[];
|
|
447
|
-
lstatSync(path: string): VolumeStat;
|
|
448
|
-
readlinkSync(path: string): string;
|
|
449
|
-
mkdirSync(path: string, options?: {
|
|
450
|
-
mode?: number;
|
|
451
|
-
}): void;
|
|
452
|
-
rmdirSync(path: string): void;
|
|
453
|
-
unlinkSync(path: string): void;
|
|
454
|
-
renameSync(from: string, to: string): void;
|
|
455
|
-
symlinkSync(target: string, path: string): void;
|
|
456
|
-
linkSync(existing: string, path: string): void;
|
|
457
|
-
truncateSync(path: string, length?: number): void;
|
|
458
|
-
chmodSync(path: string, mode: number): void;
|
|
459
|
-
lchmodSync(path: string, mode: number): void;
|
|
460
|
-
chownSync(path: string, uid: number, gid: number): void;
|
|
461
|
-
lchownSync(path: string, uid: number, gid: number): void;
|
|
462
|
-
utimesSync(path: string, atime: Date, mtime: Date): void;
|
|
463
|
-
getStats(): VolumeStats;
|
|
464
|
-
snapshot(): MemoryVolumeSnapshotEntry[];
|
|
465
|
-
restore(snapshot: MemoryVolumeSnapshotEntry[]): void;
|
|
466
|
-
/** Serializable representation used by RuntimePod snapshots. */
|
|
467
|
-
export(): Array<{
|
|
468
|
-
path: string;
|
|
469
|
-
kind: NodeKind;
|
|
470
|
-
mode: number;
|
|
471
|
-
uid: number;
|
|
472
|
-
gid: number;
|
|
473
|
-
data?: number[];
|
|
474
|
-
target?: string;
|
|
475
|
-
}>;
|
|
476
|
-
private setMode;
|
|
477
|
-
private setOwner;
|
|
478
|
-
private key;
|
|
479
|
-
private required;
|
|
480
|
-
private requireParent;
|
|
481
|
-
private inode;
|
|
482
|
-
private touchChanged;
|
|
483
|
-
}
|
|
484
|
-
|
|
485
425
|
/**
|
|
486
426
|
* How a specifier was requested. Node resolves the same package differently
|
|
487
427
|
* for the two, and a dual package depends on that: `is-promise` exports a
|
|
@@ -1091,6 +1031,21 @@ declare class LocalRuntimePod implements RuntimePod {
|
|
|
1091
1031
|
readonly proxy: {
|
|
1092
1032
|
activePorts: (_instanceId?: string) => number[];
|
|
1093
1033
|
};
|
|
1034
|
+
/**
|
|
1035
|
+
* Bind a port to a server that is not a JavaScript one.
|
|
1036
|
+
*
|
|
1037
|
+
* The request is flattened to bytes and headers before it crosses the
|
|
1038
|
+
* boundary, because the far side is a different language and a Node stream
|
|
1039
|
+
* object cannot go there. What comes back is a complete response; streaming
|
|
1040
|
+
* is a later protocol, and pretending to stream over a buffered path would
|
|
1041
|
+
* only move the surprise.
|
|
1042
|
+
*/
|
|
1043
|
+
serveExternal(port: number, owner: string, handler: (request: {
|
|
1044
|
+
method: string;
|
|
1045
|
+
path: string;
|
|
1046
|
+
headers: Record<string, string>;
|
|
1047
|
+
body: Uint8Array;
|
|
1048
|
+
}) => Promise<RuntimeHttpResponse>): () => void;
|
|
1094
1049
|
/**
|
|
1095
1050
|
* Mutable on purpose: a container replaces `spawn` so that children resolve
|
|
1096
1051
|
* against the kernel's PATH. Left alone, it runs `node` and reports anything
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { S as Shell, a as ShellIO, b as Session,
|
|
2
|
-
export { B as BufferSink,
|
|
1
|
+
import { S as Shell, a as ShellIO, b as Session, N as Node, c as Command, K as Kernel, E as ExecContext, O as OutputStream, C as Container, d as createContainer } from './container-DBMPLbUu.js';
|
|
2
|
+
export { B as BufferSink, e as CPythonOptions, f as CallbackSink, g as CommandRegistry, h as ContainerFs, i as ContainerOptions, j as ContextInit, k as Env, l as ExecOptions, m as ExecResult, F as FileData, n as FileInput, o as FileOutput, G as GroupEntry, H as HttpResponse, I as InputStream, J as Job, p as KernelOptions, L as ListeningPort, M as MANIFEST_FORMAT, q as MANIFEST_SCHEMA_VERSION, r as MountEntry, s as NetInterface, t as NetworkOptions, u as NetworkStack, v as NullInput, w as NullOutput, P as PYTHON_VERSION, x as PasswdEntry, y as Pipe, z as Process, A as ProcessKind, D as ProcessOptions, Q as ProcessState, R as ProcessTable, T as PythonCapabilities, U as PythonOptions, V as PythonProfile, W as PythonRuntimeManifest, X as ResolvedExecutable, Y as RunOptions, Z as RunResult, _ as SessionInit, $ as SessionResult, a0 as SessionRunOptions, a1 as ShellExit, a2 as ShellInit, a3 as ShellOptions, a4 as SpawnHandle, a5 as Stdio, a6 as TeeOutput, a7 as UserDatabase, a8 as Variables, a9 as braceExpand, aa as captureStdio, ab as configureCPython, ac as configurePython, ad as createContext, ae as defineCommand, af as expandWord, ag as expandWords, ah as isCPythonAvailable, ai as isPythonAvailable, aj as resetPidCounter, ak as shellQuote, al as validateManifest } from './container-DBMPLbUu.js';
|
|
3
|
+
import { V as Vfs, C as Cred, R as RuntimeVolume, a as RuntimeHttpResponse, S as SpawnChild, b as SyncSpawn, c as VolumeStat, d as VolumeStats, e as RuntimePod, f as RuntimePackageInstaller, g as ChildSpawnConfig, h as ChildHandle, i as RuntimeProcess, j as RuntimeSocketPeer, k as RuntimeConnection } from './vfs-DzEcPbMY.js';
|
|
4
|
+
export { D as DirEntry, l as ROOT_CRED, m as RuntimeProcessManager, n as RuntimeProcessResult, o as Stats, p as VirtualNode, q as VirtualProvider, W as WriteOptions, r as applyChmod, s as createChildProcessModule, t as formatMode, u as makeCred, v as octalMode, w as parseUmask } from './vfs-DzEcPbMY.js';
|
|
5
|
+
import { M as MemoryVolume, a as MemoryVolumeSnapshotEntry } from './memory-volume-CTOXNJ6n.js';
|
|
3
6
|
import EventEmitter from 'events/events.js';
|
|
4
7
|
import streamModule from 'stream-browserify';
|
|
5
8
|
|
|
@@ -419,69 +422,6 @@ declare const NODE_VERSION = "v22.12.0";
|
|
|
419
422
|
|
|
420
423
|
declare const NPM_VERSION = "10.9.0";
|
|
421
424
|
|
|
422
|
-
type NodeKind = "file" | "directory" | "symlink";
|
|
423
|
-
interface MemoryVolumeSnapshotEntry {
|
|
424
|
-
path: string;
|
|
425
|
-
ino: number;
|
|
426
|
-
kind: NodeKind;
|
|
427
|
-
mode: number;
|
|
428
|
-
uid: number;
|
|
429
|
-
gid: number;
|
|
430
|
-
nlink: number;
|
|
431
|
-
data: number[];
|
|
432
|
-
target: string;
|
|
433
|
-
atimeMs: number;
|
|
434
|
-
mtimeMs: number;
|
|
435
|
-
ctimeMs: number;
|
|
436
|
-
birthtimeMs: number;
|
|
437
|
-
}
|
|
438
|
-
/** Browser-safe, synchronous in-memory filesystem used by the new runtime. */
|
|
439
|
-
declare class MemoryVolume implements RuntimeVolume {
|
|
440
|
-
private readonly entries;
|
|
441
|
-
private nextIno;
|
|
442
|
-
constructor();
|
|
443
|
-
readFileSync(path: string): Uint8Array;
|
|
444
|
-
writeFileSync(path: string, data: string | Uint8Array): void;
|
|
445
|
-
appendFileSync(path: string, data: string | Uint8Array): void;
|
|
446
|
-
readdirSync(path: string): string[];
|
|
447
|
-
lstatSync(path: string): VolumeStat;
|
|
448
|
-
readlinkSync(path: string): string;
|
|
449
|
-
mkdirSync(path: string, options?: {
|
|
450
|
-
mode?: number;
|
|
451
|
-
}): void;
|
|
452
|
-
rmdirSync(path: string): void;
|
|
453
|
-
unlinkSync(path: string): void;
|
|
454
|
-
renameSync(from: string, to: string): void;
|
|
455
|
-
symlinkSync(target: string, path: string): void;
|
|
456
|
-
linkSync(existing: string, path: string): void;
|
|
457
|
-
truncateSync(path: string, length?: number): void;
|
|
458
|
-
chmodSync(path: string, mode: number): void;
|
|
459
|
-
lchmodSync(path: string, mode: number): void;
|
|
460
|
-
chownSync(path: string, uid: number, gid: number): void;
|
|
461
|
-
lchownSync(path: string, uid: number, gid: number): void;
|
|
462
|
-
utimesSync(path: string, atime: Date, mtime: Date): void;
|
|
463
|
-
getStats(): VolumeStats;
|
|
464
|
-
snapshot(): MemoryVolumeSnapshotEntry[];
|
|
465
|
-
restore(snapshot: MemoryVolumeSnapshotEntry[]): void;
|
|
466
|
-
/** Serializable representation used by RuntimePod snapshots. */
|
|
467
|
-
export(): Array<{
|
|
468
|
-
path: string;
|
|
469
|
-
kind: NodeKind;
|
|
470
|
-
mode: number;
|
|
471
|
-
uid: number;
|
|
472
|
-
gid: number;
|
|
473
|
-
data?: number[];
|
|
474
|
-
target?: string;
|
|
475
|
-
}>;
|
|
476
|
-
private setMode;
|
|
477
|
-
private setOwner;
|
|
478
|
-
private key;
|
|
479
|
-
private required;
|
|
480
|
-
private requireParent;
|
|
481
|
-
private inode;
|
|
482
|
-
private touchChanged;
|
|
483
|
-
}
|
|
484
|
-
|
|
485
425
|
/**
|
|
486
426
|
* How a specifier was requested. Node resolves the same package differently
|
|
487
427
|
* for the two, and a dual package depends on that: `is-promise` exports a
|
|
@@ -1091,6 +1031,21 @@ declare class LocalRuntimePod implements RuntimePod {
|
|
|
1091
1031
|
readonly proxy: {
|
|
1092
1032
|
activePorts: (_instanceId?: string) => number[];
|
|
1093
1033
|
};
|
|
1034
|
+
/**
|
|
1035
|
+
* Bind a port to a server that is not a JavaScript one.
|
|
1036
|
+
*
|
|
1037
|
+
* The request is flattened to bytes and headers before it crosses the
|
|
1038
|
+
* boundary, because the far side is a different language and a Node stream
|
|
1039
|
+
* object cannot go there. What comes back is a complete response; streaming
|
|
1040
|
+
* is a later protocol, and pretending to stream over a buffered path would
|
|
1041
|
+
* only move the surprise.
|
|
1042
|
+
*/
|
|
1043
|
+
serveExternal(port: number, owner: string, handler: (request: {
|
|
1044
|
+
method: string;
|
|
1045
|
+
path: string;
|
|
1046
|
+
headers: Record<string, string>;
|
|
1047
|
+
body: Uint8Array;
|
|
1048
|
+
}) => Promise<RuntimeHttpResponse>): () => void;
|
|
1094
1049
|
/**
|
|
1095
1050
|
* Mutable on purpose: a container replaces `spawn` so that children resolve
|
|
1096
1051
|
* against the kernel's PATH. Left alone, it runs `node` and reports anything
|