sandboxedjs 0.1.53 → 0.1.55

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/index.d.cts CHANGED
@@ -1,8 +1,8 @@
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-B--ykWn3.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-B--ykWn3.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';
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-CY_hS650.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-CY_hS650.cjs';
3
+ import { V as Vfs, C as Cred, R as RuntimeVolume, a as VirtualTcpNetwork, b as RuntimeHttpResponse, S as SpawnChild, c as SyncSpawn, d as VolumeStat, e as VolumeStats, f as RuntimePod, g as RuntimePackageInstaller, h as ChildSpawnConfig, i as ChildHandle, j as RuntimeProcess, k as RuntimeSocketPeer, l as RuntimeConnection } from './contracts-CVgctitO.cjs';
4
+ export { D as DirEntry, m as ROOT_CRED, n as RuntimeProcessManager, o as RuntimeProcessResult, p as Stats, q as VirtualNode, r as VirtualProvider, W as WriteOptions, s as applyChmod, t as createChildProcessModule, u as formatMode, v as makeCred, w as octalMode, x as parseUmask } from './contracts-CVgctitO.cjs';
5
+ import { M as MemoryVolume, a as MemoryVolumeSnapshotEntry } from './memory-volume-DlMSAh-K.cjs';
6
6
  import EventEmitter from 'events/events.js';
7
7
  import streamModule from 'stream-browserify';
8
8
 
@@ -697,10 +697,12 @@ declare class VirtualHttpServer extends EventEmitter {
697
697
  setTimeout(_milliseconds: number, callback?: () => void): this;
698
698
  }
699
699
  declare class VirtualHttpRouter {
700
+ private readonly sockets?;
700
701
  private readonly servers;
701
702
  /** Notified when a server begins listening, for `onServerReady`. */
702
703
  onListen: ((port: number) => void) | undefined;
703
704
  onClose: ((port: number) => void) | undefined;
705
+ constructor(sockets?: VirtualTcpNetwork | undefined);
704
706
  register(port: number, server: VirtualHttpServer, owner: string): void;
705
707
  unregister(port: number, server: VirtualHttpServer): void;
706
708
  /** Whether anything in this container is listening on `port`. */
@@ -1028,6 +1030,7 @@ declare class LocalRuntimePod implements RuntimePod {
1028
1030
  readonly packages: RuntimePackageInstaller;
1029
1031
  readonly instanceId: string;
1030
1032
  protected readonly router: VirtualHttpRouter;
1033
+ readonly sockets: VirtualTcpNetwork;
1031
1034
  readonly proxy: {
1032
1035
  activePorts: (_instanceId?: string) => number[];
1033
1036
  };
@@ -1091,11 +1094,13 @@ declare class LocalRuntimePod implements RuntimePod {
1091
1094
  * costing a handful of empty turns.
1092
1095
  */
1093
1096
  private settle;
1094
- request(_port: number, _init?: Record<string, unknown>): Promise<RuntimeHttpResponse>;
1097
+ request(port: number, init?: Record<string, unknown>): Promise<RuntimeHttpResponse>;
1095
1098
  connect(port: number, init: Record<string, unknown>, peer: RuntimeSocketPeer): RuntimeConnection | null;
1096
1099
  snapshot(): MemoryVolumeSnapshotEntry[];
1097
1100
  restore(snapshot: unknown): Promise<void>;
1098
1101
  teardown(): void;
1102
+ /** HTTP/1.1 client path for a server implemented outside the JS runtime. */
1103
+ private requestTcp;
1099
1104
  private seed;
1100
1105
  private assertActive;
1101
1106
  }
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
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-BSW6jjlq.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-BSW6jjlq.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';
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-BAgb9I06.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-BAgb9I06.js';
3
+ import { V as Vfs, C as Cred, R as RuntimeVolume, a as VirtualTcpNetwork, b as RuntimeHttpResponse, S as SpawnChild, c as SyncSpawn, d as VolumeStat, e as VolumeStats, f as RuntimePod, g as RuntimePackageInstaller, h as ChildSpawnConfig, i as ChildHandle, j as RuntimeProcess, k as RuntimeSocketPeer, l as RuntimeConnection } from './contracts-CVgctitO.js';
4
+ export { D as DirEntry, m as ROOT_CRED, n as RuntimeProcessManager, o as RuntimeProcessResult, p as Stats, q as VirtualNode, r as VirtualProvider, W as WriteOptions, s as applyChmod, t as createChildProcessModule, u as formatMode, v as makeCred, w as octalMode, x as parseUmask } from './contracts-CVgctitO.js';
5
+ import { M as MemoryVolume, a as MemoryVolumeSnapshotEntry } from './memory-volume-CWuWScIs.js';
6
6
  import EventEmitter from 'events/events.js';
7
7
  import streamModule from 'stream-browserify';
8
8
 
@@ -697,10 +697,12 @@ declare class VirtualHttpServer extends EventEmitter {
697
697
  setTimeout(_milliseconds: number, callback?: () => void): this;
698
698
  }
699
699
  declare class VirtualHttpRouter {
700
+ private readonly sockets?;
700
701
  private readonly servers;
701
702
  /** Notified when a server begins listening, for `onServerReady`. */
702
703
  onListen: ((port: number) => void) | undefined;
703
704
  onClose: ((port: number) => void) | undefined;
705
+ constructor(sockets?: VirtualTcpNetwork | undefined);
704
706
  register(port: number, server: VirtualHttpServer, owner: string): void;
705
707
  unregister(port: number, server: VirtualHttpServer): void;
706
708
  /** Whether anything in this container is listening on `port`. */
@@ -1028,6 +1030,7 @@ declare class LocalRuntimePod implements RuntimePod {
1028
1030
  readonly packages: RuntimePackageInstaller;
1029
1031
  readonly instanceId: string;
1030
1032
  protected readonly router: VirtualHttpRouter;
1033
+ readonly sockets: VirtualTcpNetwork;
1031
1034
  readonly proxy: {
1032
1035
  activePorts: (_instanceId?: string) => number[];
1033
1036
  };
@@ -1091,11 +1094,13 @@ declare class LocalRuntimePod implements RuntimePod {
1091
1094
  * costing a handful of empty turns.
1092
1095
  */
1093
1096
  private settle;
1094
- request(_port: number, _init?: Record<string, unknown>): Promise<RuntimeHttpResponse>;
1097
+ request(port: number, init?: Record<string, unknown>): Promise<RuntimeHttpResponse>;
1095
1098
  connect(port: number, init: Record<string, unknown>, peer: RuntimeSocketPeer): RuntimeConnection | null;
1096
1099
  snapshot(): MemoryVolumeSnapshotEntry[];
1097
1100
  restore(snapshot: unknown): Promise<void>;
1098
1101
  teardown(): void;
1102
+ /** HTTP/1.1 client path for a server implemented outside the JS runtime. */
1103
+ private requestTcp;
1099
1104
  private seed;
1100
1105
  private assertActive;
1101
1106
  }