sandboxedjs 0.2.3 → 0.2.4

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 CHANGED
@@ -1,5 +1,5 @@
1
- import { C as Container } from './container-C9Y8dqos.cjs';
2
- import './contracts-B6SHFjma.cjs';
1
+ import { C as Container } from './container-DJfFjito.cjs';
2
+ import './contracts-CXZ_25-O.cjs';
3
3
 
4
4
  /**
5
5
  * Structural copies of the LangChain Deep Agents backend contract.
package/dist/agent.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { C as Container } from './container-CIE93_Gh.js';
2
- import './contracts-B6SHFjma.js';
1
+ import { C as Container } from './container-C16pCOWC.js';
2
+ import './contracts-CXZ_25-O.js';
3
3
 
4
4
  /**
5
5
  * Structural copies of the LangChain Deep Agents backend contract.
@@ -1,4 +1,4 @@
1
- import { V as Vfs, C as Cred, f as RuntimePod, O as OutboundPolicy, D as DirEntry, p as Stats } from './contracts-B6SHFjma.cjs';
1
+ import { V as Vfs, C as Cred, f as RuntimePod, O as OutboundPolicy, D as DirEntry, p as Stats } from './contracts-CXZ_25-O.js';
2
2
 
3
3
  /**
4
4
  * Byte streams for stdin/stdout/stderr, pipelines and redirections.
@@ -1,4 +1,4 @@
1
- import { V as Vfs, C as Cred, f as RuntimePod, O as OutboundPolicy, D as DirEntry, p as Stats } from './contracts-B6SHFjma.js';
1
+ import { V as Vfs, C as Cred, f as RuntimePod, O as OutboundPolicy, D as DirEntry, p as Stats } from './contracts-CXZ_25-O.cjs';
2
2
 
3
3
  /**
4
4
  * Byte streams for stdin/stdout/stderr, pipelines and redirections.
@@ -482,7 +482,21 @@ declare class VirtualTcpNetwork {
482
482
  /** A connection to a port an in-container server holds without a socket. */
483
483
  private connectToNonSocketServer;
484
484
  hasListener(port: number): boolean;
485
+ /** Ports the container itself listens on, which no guest asked for. */
486
+ private readonly internal;
487
+ /**
488
+ * Ports a guest is serving on.
489
+ *
490
+ * The container's own plumbing listens too — the HTTP egress takes a port
491
+ * like any server — and those are not the guest's. Reported, they reach
492
+ * every consumer of "what is running here": a port picker offers one, a
493
+ * preview opens it, and the reader is looking at an internal endpoint
494
+ * answering that it wanted an absolute URL, with nothing to say what it is
495
+ * or why they are there.
496
+ */
485
497
  ports(): number[];
498
+ /** Keep `port` out of {@link ports}: it belongs to the container, not a guest. */
499
+ markInternal(port: number): void;
486
500
  closeAll(): void;
487
501
  }
488
502
 
@@ -482,7 +482,21 @@ declare class VirtualTcpNetwork {
482
482
  /** A connection to a port an in-container server holds without a socket. */
483
483
  private connectToNonSocketServer;
484
484
  hasListener(port: number): boolean;
485
+ /** Ports the container itself listens on, which no guest asked for. */
486
+ private readonly internal;
487
+ /**
488
+ * Ports a guest is serving on.
489
+ *
490
+ * The container's own plumbing listens too — the HTTP egress takes a port
491
+ * like any server — and those are not the guest's. Reported, they reach
492
+ * every consumer of "what is running here": a port picker offers one, a
493
+ * preview opens it, and the reader is looking at an internal endpoint
494
+ * answering that it wanted an absolute URL, with nothing to say what it is
495
+ * or why they are there.
496
+ */
485
497
  ports(): number[];
498
+ /** Keep `port` out of {@link ports}: it belongs to the container, not a guest. */
499
+ markInternal(port: number): void;
486
500
  closeAll(): void;
487
501
  }
488
502
 
package/dist/index.cjs CHANGED
@@ -21013,7 +21013,7 @@ var wheels_default = {
21013
21013
 
21014
21014
  // package.json
21015
21015
  var package_default = {
21016
- version: "0.2.3"};
21016
+ version: "0.2.4"};
21017
21017
 
21018
21018
  // src/python/extension-abi.ts
21019
21019
  var EXTENSION_ABI = {
@@ -22328,8 +22328,24 @@ var VirtualTcpNetwork = class {
22328
22328
  hasListener(port) {
22329
22329
  return this.listeners.has(port);
22330
22330
  }
22331
+ /** Ports the container itself listens on, which no guest asked for. */
22332
+ internal = /* @__PURE__ */ new Set();
22333
+ /**
22334
+ * Ports a guest is serving on.
22335
+ *
22336
+ * The container's own plumbing listens too — the HTTP egress takes a port
22337
+ * like any server — and those are not the guest's. Reported, they reach
22338
+ * every consumer of "what is running here": a port picker offers one, a
22339
+ * preview opens it, and the reader is looking at an internal endpoint
22340
+ * answering that it wanted an absolute URL, with nothing to say what it is
22341
+ * or why they are there.
22342
+ */
22331
22343
  ports() {
22332
- return [...this.listeners.keys()].sort((a, b) => a - b);
22344
+ return [...this.listeners.keys()].filter((port) => !this.internal.has(port)).sort((a, b) => a - b);
22345
+ }
22346
+ /** Keep `port` out of {@link ports}: it belongs to the container, not a guest. */
22347
+ markInternal(port) {
22348
+ this.internal.add(port);
22333
22349
  }
22334
22350
  closeAll() {
22335
22351
  for (const listener of [...this.listeners.values()]) this.close(listener);
@@ -23266,6 +23282,7 @@ function ensureHttpEgress(ctx) {
23266
23282
  }
23267
23283
  }
23268
23284
  if (!listener || port === 0) return 0;
23285
+ sockets.markInternal?.(port);
23269
23286
  listeners.set(sockets, port);
23270
23287
  const accepting = listener;
23271
23288
  void (async () => {
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, B as BinaryBackend, d as createContainer } from './container-C9Y8dqos.cjs';
2
- export { e as BinaryExecutionRegistry, f as BinaryInfo, g as BinaryRequest, h as BufferSink, i as CallbackSink, j as CommandRegistry, k as ContainerFs, l as ContainerOptions, m as ContextInit, n as Env, o as ExecOptions, p as ExecResult, q as ExecutionDecision, r as ExecutionTier, F as FileData, s as FileInput, t as FileOutput, G as GroupEntry, H as HttpResponse, I as InputStream, J as Job, u as KernelOptions, L as ListeningPort, M as MANIFEST_FORMAT, v as MANIFEST_SCHEMA_VERSION, w as MountEntry, x as NetInterface, y as NetworkOptions, z as NetworkStack, A as NullInput, D as NullOutput, P as PYTHON_VERSION, Q as PasswdEntry, R as Pipe, T as Preparation, U as PreparedBinary, V as Process, W as ProcessKind, X as ProcessOptions, Y as ProcessState, Z as ProcessTable, _ as PythonCapabilities, $ as PythonOptions, a0 as PythonProfile, a1 as PythonRuntimeManifest, a2 as ResolvedExecutable, a3 as RunOptions, a4 as RunResult, a5 as SessionInit, a6 as SessionResult, a7 as SessionRunOptions, a8 as ShellExit, a9 as ShellInit, aa as ShellOptions, ab as SpawnHandle, ac as Stdio, ad as TeeOutput, ae as UserDatabase, af as Variables, ag as WasmCommandArtifact, ah as WasmTranslator, ai as binaryDigest, aj as braceExpand, ak as captureStdio, al as configurePython, am as createContext, an as createTranslationBackend, ao as createWasmCompatibilityBackend, ap as defineCommand, aq as expandWord, ar as expandWords, as as inspectElf, at as installWasmCommands, au as isElfBinary, av as isPythonAvailable, aw as resetPidCounter, ax as shellQuote, ay as validateManifest } from './container-C9Y8dqos.cjs';
3
- import { V as Vfs, C as Cred, R as RuntimeVolume, a as VirtualTcpNetwork, b as RuntimeHttpResponse, O as OutboundPolicy, S as SpawnChild, c as SyncSpawn, I as IpcTransport, 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-B6SHFjma.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-B6SHFjma.cjs';
5
- import { M as MemoryVolume, a as MemoryVolumeSnapshotEntry } from './memory-volume-CRhXUyCN.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, B as BinaryBackend, d as createContainer } from './container-DJfFjito.cjs';
2
+ export { e as BinaryExecutionRegistry, f as BinaryInfo, g as BinaryRequest, h as BufferSink, i as CallbackSink, j as CommandRegistry, k as ContainerFs, l as ContainerOptions, m as ContextInit, n as Env, o as ExecOptions, p as ExecResult, q as ExecutionDecision, r as ExecutionTier, F as FileData, s as FileInput, t as FileOutput, G as GroupEntry, H as HttpResponse, I as InputStream, J as Job, u as KernelOptions, L as ListeningPort, M as MANIFEST_FORMAT, v as MANIFEST_SCHEMA_VERSION, w as MountEntry, x as NetInterface, y as NetworkOptions, z as NetworkStack, A as NullInput, D as NullOutput, P as PYTHON_VERSION, Q as PasswdEntry, R as Pipe, T as Preparation, U as PreparedBinary, V as Process, W as ProcessKind, X as ProcessOptions, Y as ProcessState, Z as ProcessTable, _ as PythonCapabilities, $ as PythonOptions, a0 as PythonProfile, a1 as PythonRuntimeManifest, a2 as ResolvedExecutable, a3 as RunOptions, a4 as RunResult, a5 as SessionInit, a6 as SessionResult, a7 as SessionRunOptions, a8 as ShellExit, a9 as ShellInit, aa as ShellOptions, ab as SpawnHandle, ac as Stdio, ad as TeeOutput, ae as UserDatabase, af as Variables, ag as WasmCommandArtifact, ah as WasmTranslator, ai as binaryDigest, aj as braceExpand, ak as captureStdio, al as configurePython, am as createContext, an as createTranslationBackend, ao as createWasmCompatibilityBackend, ap as defineCommand, aq as expandWord, ar as expandWords, as as inspectElf, at as installWasmCommands, au as isElfBinary, av as isPythonAvailable, aw as resetPidCounter, ax as shellQuote, ay as validateManifest } from './container-DJfFjito.cjs';
3
+ import { V as Vfs, C as Cred, R as RuntimeVolume, a as VirtualTcpNetwork, b as RuntimeHttpResponse, O as OutboundPolicy, S as SpawnChild, c as SyncSpawn, I as IpcTransport, 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-CXZ_25-O.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-CXZ_25-O.cjs';
5
+ import { M as MemoryVolume, a as MemoryVolumeSnapshotEntry } from './memory-volume-Bp71nqvc.cjs';
6
6
  import EventEmitter from 'events/events.js';
7
7
  import streamModule from 'stream-browserify';
8
8
 
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, B as BinaryBackend, d as createContainer } from './container-CIE93_Gh.js';
2
- export { e as BinaryExecutionRegistry, f as BinaryInfo, g as BinaryRequest, h as BufferSink, i as CallbackSink, j as CommandRegistry, k as ContainerFs, l as ContainerOptions, m as ContextInit, n as Env, o as ExecOptions, p as ExecResult, q as ExecutionDecision, r as ExecutionTier, F as FileData, s as FileInput, t as FileOutput, G as GroupEntry, H as HttpResponse, I as InputStream, J as Job, u as KernelOptions, L as ListeningPort, M as MANIFEST_FORMAT, v as MANIFEST_SCHEMA_VERSION, w as MountEntry, x as NetInterface, y as NetworkOptions, z as NetworkStack, A as NullInput, D as NullOutput, P as PYTHON_VERSION, Q as PasswdEntry, R as Pipe, T as Preparation, U as PreparedBinary, V as Process, W as ProcessKind, X as ProcessOptions, Y as ProcessState, Z as ProcessTable, _ as PythonCapabilities, $ as PythonOptions, a0 as PythonProfile, a1 as PythonRuntimeManifest, a2 as ResolvedExecutable, a3 as RunOptions, a4 as RunResult, a5 as SessionInit, a6 as SessionResult, a7 as SessionRunOptions, a8 as ShellExit, a9 as ShellInit, aa as ShellOptions, ab as SpawnHandle, ac as Stdio, ad as TeeOutput, ae as UserDatabase, af as Variables, ag as WasmCommandArtifact, ah as WasmTranslator, ai as binaryDigest, aj as braceExpand, ak as captureStdio, al as configurePython, am as createContext, an as createTranslationBackend, ao as createWasmCompatibilityBackend, ap as defineCommand, aq as expandWord, ar as expandWords, as as inspectElf, at as installWasmCommands, au as isElfBinary, av as isPythonAvailable, aw as resetPidCounter, ax as shellQuote, ay as validateManifest } from './container-CIE93_Gh.js';
3
- import { V as Vfs, C as Cred, R as RuntimeVolume, a as VirtualTcpNetwork, b as RuntimeHttpResponse, O as OutboundPolicy, S as SpawnChild, c as SyncSpawn, I as IpcTransport, 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-B6SHFjma.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-B6SHFjma.js';
5
- import { M as MemoryVolume, a as MemoryVolumeSnapshotEntry } from './memory-volume-CwiXvRfs.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, B as BinaryBackend, d as createContainer } from './container-C16pCOWC.js';
2
+ export { e as BinaryExecutionRegistry, f as BinaryInfo, g as BinaryRequest, h as BufferSink, i as CallbackSink, j as CommandRegistry, k as ContainerFs, l as ContainerOptions, m as ContextInit, n as Env, o as ExecOptions, p as ExecResult, q as ExecutionDecision, r as ExecutionTier, F as FileData, s as FileInput, t as FileOutput, G as GroupEntry, H as HttpResponse, I as InputStream, J as Job, u as KernelOptions, L as ListeningPort, M as MANIFEST_FORMAT, v as MANIFEST_SCHEMA_VERSION, w as MountEntry, x as NetInterface, y as NetworkOptions, z as NetworkStack, A as NullInput, D as NullOutput, P as PYTHON_VERSION, Q as PasswdEntry, R as Pipe, T as Preparation, U as PreparedBinary, V as Process, W as ProcessKind, X as ProcessOptions, Y as ProcessState, Z as ProcessTable, _ as PythonCapabilities, $ as PythonOptions, a0 as PythonProfile, a1 as PythonRuntimeManifest, a2 as ResolvedExecutable, a3 as RunOptions, a4 as RunResult, a5 as SessionInit, a6 as SessionResult, a7 as SessionRunOptions, a8 as ShellExit, a9 as ShellInit, aa as ShellOptions, ab as SpawnHandle, ac as Stdio, ad as TeeOutput, ae as UserDatabase, af as Variables, ag as WasmCommandArtifact, ah as WasmTranslator, ai as binaryDigest, aj as braceExpand, ak as captureStdio, al as configurePython, am as createContext, an as createTranslationBackend, ao as createWasmCompatibilityBackend, ap as defineCommand, aq as expandWord, ar as expandWords, as as inspectElf, at as installWasmCommands, au as isElfBinary, av as isPythonAvailable, aw as resetPidCounter, ax as shellQuote, ay as validateManifest } from './container-C16pCOWC.js';
3
+ import { V as Vfs, C as Cred, R as RuntimeVolume, a as VirtualTcpNetwork, b as RuntimeHttpResponse, O as OutboundPolicy, S as SpawnChild, c as SyncSpawn, I as IpcTransport, 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-CXZ_25-O.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-CXZ_25-O.js';
5
+ import { M as MemoryVolume, a as MemoryVolumeSnapshotEntry } from './memory-volume-C4xwtIRZ.js';
6
6
  import EventEmitter from 'events/events.js';
7
7
  import streamModule from 'stream-browserify';
8
8
 
package/dist/index.js CHANGED
@@ -20996,7 +20996,7 @@ var wheels_default = {
20996
20996
 
20997
20997
  // package.json
20998
20998
  var package_default = {
20999
- version: "0.2.3"};
20999
+ version: "0.2.4"};
21000
21000
 
21001
21001
  // src/python/extension-abi.ts
21002
21002
  var EXTENSION_ABI = {
@@ -22311,8 +22311,24 @@ var VirtualTcpNetwork = class {
22311
22311
  hasListener(port) {
22312
22312
  return this.listeners.has(port);
22313
22313
  }
22314
+ /** Ports the container itself listens on, which no guest asked for. */
22315
+ internal = /* @__PURE__ */ new Set();
22316
+ /**
22317
+ * Ports a guest is serving on.
22318
+ *
22319
+ * The container's own plumbing listens too — the HTTP egress takes a port
22320
+ * like any server — and those are not the guest's. Reported, they reach
22321
+ * every consumer of "what is running here": a port picker offers one, a
22322
+ * preview opens it, and the reader is looking at an internal endpoint
22323
+ * answering that it wanted an absolute URL, with nothing to say what it is
22324
+ * or why they are there.
22325
+ */
22314
22326
  ports() {
22315
- return [...this.listeners.keys()].sort((a, b) => a - b);
22327
+ return [...this.listeners.keys()].filter((port) => !this.internal.has(port)).sort((a, b) => a - b);
22328
+ }
22329
+ /** Keep `port` out of {@link ports}: it belongs to the container, not a guest. */
22330
+ markInternal(port) {
22331
+ this.internal.add(port);
22316
22332
  }
22317
22333
  closeAll() {
22318
22334
  for (const listener of [...this.listeners.values()]) this.close(listener);
@@ -23249,6 +23265,7 @@ function ensureHttpEgress(ctx) {
23249
23265
  }
23250
23266
  }
23251
23267
  if (!listener || port === 0) return 0;
23268
+ sockets.markInternal?.(port);
23252
23269
  listeners.set(sockets, port);
23253
23270
  const accepting = listener;
23254
23271
  void (async () => {
@@ -1,4 +1,4 @@
1
- import { R as RuntimeVolume, d as VolumeStat, e as VolumeStats } from './contracts-B6SHFjma.cjs';
1
+ import { R as RuntimeVolume, d as VolumeStat, e as VolumeStats } from './contracts-CXZ_25-O.cjs';
2
2
 
3
3
  type NodeKind = "file" | "directory" | "symlink";
4
4
  interface MemoryVolumeSnapshotEntry {
@@ -1,4 +1,4 @@
1
- import { R as RuntimeVolume, d as VolumeStat, e as VolumeStats } from './contracts-B6SHFjma.js';
1
+ import { R as RuntimeVolume, d as VolumeStat, e as VolumeStats } from './contracts-CXZ_25-O.js';
2
2
 
3
3
  type NodeKind = "file" | "directory" | "symlink";
4
4
  interface MemoryVolumeSnapshotEntry {
@@ -1,6 +1,6 @@
1
- import { V as Vfs, C as Cred, a as VirtualTcpNetwork } from './contracts-B6SHFjma.cjs';
2
- export { m as ROOT_CRED, v as makeCred } from './contracts-B6SHFjma.cjs';
3
- export { M as MemoryVolume } from './memory-volume-CRhXUyCN.cjs';
1
+ import { V as Vfs, C as Cred, a as VirtualTcpNetwork } from './contracts-CXZ_25-O.cjs';
2
+ export { m as ROOT_CRED, v as makeCred } from './contracts-CXZ_25-O.cjs';
3
+ export { M as MemoryVolume } from './memory-volume-Bp71nqvc.cjs';
4
4
 
5
5
  /**
6
6
  * Open-file descriptions: the thing a descriptor points *at*.
@@ -1,6 +1,6 @@
1
- import { V as Vfs, C as Cred, a as VirtualTcpNetwork } from './contracts-B6SHFjma.js';
2
- export { m as ROOT_CRED, v as makeCred } from './contracts-B6SHFjma.js';
3
- export { M as MemoryVolume } from './memory-volume-CwiXvRfs.js';
1
+ import { V as Vfs, C as Cred, a as VirtualTcpNetwork } from './contracts-CXZ_25-O.js';
2
+ export { m as ROOT_CRED, v as makeCred } from './contracts-CXZ_25-O.js';
3
+ export { M as MemoryVolume } from './memory-volume-C4xwtIRZ.js';
4
4
 
5
5
  /**
6
6
  * Open-file descriptions: the thing a descriptor points *at*.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sandboxedjs",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "A Linux-like container that runs entirely inside Node.js — POSIX shell, ~140 coreutils, Node.js and Python runtimes, virtual filesystem and networking. No Docker, no VM, no native modules.",
5
5
  "type": "module",
6
6
  "license": "MIT",