modal 0.3.9 → 0.3.10

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.cjs CHANGED
@@ -38391,7 +38391,9 @@ var Sandbox2 = class {
38391
38391
  const taskId = await this.#getTaskId();
38392
38392
  const resp = await client.containerExec({
38393
38393
  taskId,
38394
- command
38394
+ command,
38395
+ workdir: options?.workdir,
38396
+ timeoutSecs: options?.timeout ? options.timeout / 1e3 : 0
38395
38397
  });
38396
38398
  return new ContainerProcess(resp.execId, options);
38397
38399
  }
package/dist/index.d.cts CHANGED
@@ -139,9 +139,16 @@ type StdioBehavior = "pipe" | "ignore";
139
139
  type StreamMode = "text" | "binary";
140
140
  /** Options to configure a `Sandbox.exec()` operation. */
141
141
  type ExecOptions = {
142
+ /** Specifies text or binary encoding for input and output streams. */
142
143
  mode?: StreamMode;
144
+ /** Whether to pipe or ignore standard output. */
143
145
  stdout?: StdioBehavior;
146
+ /** Whether to pipe or ignore standard error. */
144
147
  stderr?: StdioBehavior;
148
+ /** Working directory to run the command in. */
149
+ workdir?: string;
150
+ /** Timeout for the process in milliseconds. Defaults to 0 (no timeout). */
151
+ timeout?: number;
145
152
  };
146
153
  /** Sandboxes are secure, isolated containers in Modal that boot in seconds. */
147
154
  declare class Sandbox {
package/dist/index.d.ts CHANGED
@@ -139,9 +139,16 @@ type StdioBehavior = "pipe" | "ignore";
139
139
  type StreamMode = "text" | "binary";
140
140
  /** Options to configure a `Sandbox.exec()` operation. */
141
141
  type ExecOptions = {
142
+ /** Specifies text or binary encoding for input and output streams. */
142
143
  mode?: StreamMode;
144
+ /** Whether to pipe or ignore standard output. */
143
145
  stdout?: StdioBehavior;
146
+ /** Whether to pipe or ignore standard error. */
144
147
  stderr?: StdioBehavior;
148
+ /** Working directory to run the command in. */
149
+ workdir?: string;
150
+ /** Timeout for the process in milliseconds. Defaults to 0 (no timeout). */
151
+ timeout?: number;
145
152
  };
146
153
  /** Sandboxes are secure, isolated containers in Modal that boot in seconds. */
147
154
  declare class Sandbox {
package/dist/index.js CHANGED
@@ -38344,7 +38344,9 @@ var Sandbox2 = class {
38344
38344
  const taskId = await this.#getTaskId();
38345
38345
  const resp = await client.containerExec({
38346
38346
  taskId,
38347
- command
38347
+ command,
38348
+ workdir: options?.workdir,
38349
+ timeoutSecs: options?.timeout ? options.timeout / 1e3 : 0
38348
38350
  });
38349
38351
  return new ContainerProcess(resp.execId, options);
38350
38352
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "modal",
3
- "version": "0.3.9",
3
+ "version": "0.3.10",
4
4
  "description": "Modal client library for JavaScript",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://modal.com/docs",