sandboxedjs 0.1.83 → 0.1.85

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-B14Q03ng.cjs';
2
- import './contracts-DNkSvBCM.cjs';
1
+ import { C as Container } from './container-BGmhPbSD.cjs';
2
+ import './contracts-BkWBTH8E.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-DtVUncWL.js';
2
- import './contracts-DNkSvBCM.js';
1
+ import { C as Container } from './container-DCwYX_Cx.js';
2
+ import './contracts-BkWBTH8E.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-DNkSvBCM.js';
1
+ import { V as Vfs, C as Cred, f as RuntimePod, O as OutboundPolicy, D as DirEntry, p as Stats } from './contracts-BkWBTH8E.cjs';
2
2
 
3
3
  /**
4
4
  * Byte streams for stdin/stdout/stderr, pipelines and redirections.
@@ -210,6 +210,8 @@ interface ProcessOptions {
210
210
  pgid?: number;
211
211
  sid?: number;
212
212
  stdio?: Partial<Stdio>;
213
+ /** Descriptors above 2, readable and writable from this process's side. */
214
+ fds?: Record<number, InputStream & OutputStream>;
213
215
  tty?: string | null;
214
216
  /** Marks the process as a shell builtin frame rather than a real command. */
215
217
  kind?: ProcessKind;
@@ -235,6 +237,8 @@ declare class Process {
235
237
  stdin: InputStream;
236
238
  stdout: OutputStream;
237
239
  stderr: OutputStream;
240
+ /** Descriptors above 2 the parent handed over, such as Chromium's fds 3 and 4. */
241
+ readonly fds: Map<number, InputStream & OutputStream>;
238
242
  readonly children: Set<Process>;
239
243
  private readonly aborter;
240
244
  private readonly exitWaiters;
@@ -610,6 +614,11 @@ interface RunOptions {
610
614
  tty?: string | null;
611
615
  /** Wall-clock budget; the process is sent SIGKILL when it expires. */
612
616
  timeoutMs?: number;
617
+ /**
618
+ * Descriptors above 2, keyed by number. Each is readable and writable from
619
+ * the child's side, the way an inherited socketpair end is.
620
+ */
621
+ fds?: Record<number, InputStream & OutputStream>;
613
622
  }
614
623
  interface RunResult {
615
624
  exitCode: number;
@@ -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-DNkSvBCM.cjs';
1
+ import { V as Vfs, C as Cred, f as RuntimePod, O as OutboundPolicy, D as DirEntry, p as Stats } from './contracts-BkWBTH8E.js';
2
2
 
3
3
  /**
4
4
  * Byte streams for stdin/stdout/stderr, pipelines and redirections.
@@ -210,6 +210,8 @@ interface ProcessOptions {
210
210
  pgid?: number;
211
211
  sid?: number;
212
212
  stdio?: Partial<Stdio>;
213
+ /** Descriptors above 2, readable and writable from this process's side. */
214
+ fds?: Record<number, InputStream & OutputStream>;
213
215
  tty?: string | null;
214
216
  /** Marks the process as a shell builtin frame rather than a real command. */
215
217
  kind?: ProcessKind;
@@ -235,6 +237,8 @@ declare class Process {
235
237
  stdin: InputStream;
236
238
  stdout: OutputStream;
237
239
  stderr: OutputStream;
240
+ /** Descriptors above 2 the parent handed over, such as Chromium's fds 3 and 4. */
241
+ readonly fds: Map<number, InputStream & OutputStream>;
238
242
  readonly children: Set<Process>;
239
243
  private readonly aborter;
240
244
  private readonly exitWaiters;
@@ -610,6 +614,11 @@ interface RunOptions {
610
614
  tty?: string | null;
611
615
  /** Wall-clock budget; the process is sent SIGKILL when it expires. */
612
616
  timeoutMs?: number;
617
+ /**
618
+ * Descriptors above 2, keyed by number. Each is readable and writable from
619
+ * the child's side, the way an inherited socketpair end is.
620
+ */
621
+ fds?: Record<number, InputStream & OutputStream>;
613
622
  }
614
623
  interface RunResult {
615
624
  exitCode: number;
@@ -14,7 +14,7 @@ interface ChildHandle {
14
14
  pid: number;
15
15
  state: "starting" | "running" | "exited";
16
16
  exitCode: number | undefined;
17
- on(event: "stdout" | "stderr" | "exit" | "rawmode", listener: (...args: any[]) => void): unknown;
17
+ on(event: "stdout" | "stderr" | "exit" | "rawmode" | "fd", listener: (...args: any[]) => void): unknown;
18
18
  exec(): void;
19
19
  sendStdin(data: string): void;
20
20
  /**
@@ -25,6 +25,17 @@ interface ChildHandle {
25
25
  * an end that never comes, and the parent waits on its exit.
26
26
  */
27
27
  endStdin?(): void;
28
+ /**
29
+ * Write to, or close, a descriptor above 2 that the parent asked for with
30
+ * `stdio[n] = "pipe"`. Output on those descriptors arrives as `fd` events
31
+ * carrying `(fd, text)`.
32
+ *
33
+ * Chromium's `--remote-debugging-pipe` is the reason: Playwright speaks the
34
+ * DevTools protocol over fds 3 and 4, and a child without them cannot be
35
+ * driven at all.
36
+ */
37
+ writeFd?(fd: number, data: string): void;
38
+ endFd?(fd: number): void;
28
39
  kill(signal?: string): void;
29
40
  }
30
41
  interface ChildSpawnConfig {
@@ -48,6 +59,8 @@ interface ChildSpawnConfig {
48
59
  * left open on a parent that will never write to it.
49
60
  */
50
61
  stdinIgnored?: boolean;
62
+ /** Descriptors above 2 the parent opened as pipes, e.g. `[3, 4]`. */
63
+ extraPipes?: number[];
51
64
  }
52
65
  type SpawnChild = (config: ChildSpawnConfig) => ChildHandle;
53
66
  /**
@@ -450,8 +463,14 @@ interface RuntimeProcess {
450
463
  * reports the program turning terminal raw mode on or off, which a terminal
451
464
  * needs so that it stops echoing input the program is drawing itself.
452
465
  */
453
- on(event: "output" | "error" | "exit" | "rawmode", listener: (...args: any[]) => void): this;
454
- write(data: string): void;
466
+ /**
467
+ * `raw-output` is optional: a process that sets `rawOutput` emits stdout
468
+ * there as written, bytes included, alongside the decoded `output`.
469
+ */
470
+ on(event: "output" | "raw-output" | "error" | "exit" | "rawmode", listener: (...args: any[]) => void): this;
471
+ readonly rawOutput?: boolean;
472
+ /** Input for the program. Bytes are delivered as bytes: a pipe may carry binary framing. */
473
+ write(data: string | Uint8Array): void;
455
474
  kill(signal?: string): void;
456
475
  }
457
476
  interface RuntimeHttpResponse {
@@ -14,7 +14,7 @@ interface ChildHandle {
14
14
  pid: number;
15
15
  state: "starting" | "running" | "exited";
16
16
  exitCode: number | undefined;
17
- on(event: "stdout" | "stderr" | "exit" | "rawmode", listener: (...args: any[]) => void): unknown;
17
+ on(event: "stdout" | "stderr" | "exit" | "rawmode" | "fd", listener: (...args: any[]) => void): unknown;
18
18
  exec(): void;
19
19
  sendStdin(data: string): void;
20
20
  /**
@@ -25,6 +25,17 @@ interface ChildHandle {
25
25
  * an end that never comes, and the parent waits on its exit.
26
26
  */
27
27
  endStdin?(): void;
28
+ /**
29
+ * Write to, or close, a descriptor above 2 that the parent asked for with
30
+ * `stdio[n] = "pipe"`. Output on those descriptors arrives as `fd` events
31
+ * carrying `(fd, text)`.
32
+ *
33
+ * Chromium's `--remote-debugging-pipe` is the reason: Playwright speaks the
34
+ * DevTools protocol over fds 3 and 4, and a child without them cannot be
35
+ * driven at all.
36
+ */
37
+ writeFd?(fd: number, data: string): void;
38
+ endFd?(fd: number): void;
28
39
  kill(signal?: string): void;
29
40
  }
30
41
  interface ChildSpawnConfig {
@@ -48,6 +59,8 @@ interface ChildSpawnConfig {
48
59
  * left open on a parent that will never write to it.
49
60
  */
50
61
  stdinIgnored?: boolean;
62
+ /** Descriptors above 2 the parent opened as pipes, e.g. `[3, 4]`. */
63
+ extraPipes?: number[];
51
64
  }
52
65
  type SpawnChild = (config: ChildSpawnConfig) => ChildHandle;
53
66
  /**
@@ -450,8 +463,14 @@ interface RuntimeProcess {
450
463
  * reports the program turning terminal raw mode on or off, which a terminal
451
464
  * needs so that it stops echoing input the program is drawing itself.
452
465
  */
453
- on(event: "output" | "error" | "exit" | "rawmode", listener: (...args: any[]) => void): this;
454
- write(data: string): void;
466
+ /**
467
+ * `raw-output` is optional: a process that sets `rawOutput` emits stdout
468
+ * there as written, bytes included, alongside the decoded `output`.
469
+ */
470
+ on(event: "output" | "raw-output" | "error" | "exit" | "rawmode", listener: (...args: any[]) => void): this;
471
+ readonly rawOutput?: boolean;
472
+ /** Input for the program. Bytes are delivered as bytes: a pipe may carry binary framing. */
473
+ write(data: string | Uint8Array): void;
455
474
  kill(signal?: string): void;
456
475
  }
457
476
  interface RuntimeHttpResponse {