@blaxel/core 0.2.20-preview.45 → 0.2.20

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.
@@ -1,6 +1,7 @@
1
1
  import { Sandbox } from "../../client/types.gen.js";
2
2
  import { SandboxAction } from "../action.js";
3
3
  import { DeleteProcessByIdentifierKillResponse, DeleteProcessByIdentifierResponse, GetProcessByIdentifierResponse, GetProcessResponse, PostProcessResponse, ProcessRequest } from "../client/index.js";
4
+ import { ProcessRequestWithLog } from "../types.js";
4
5
  export declare class SandboxProcess extends SandboxAction {
5
6
  constructor(sandbox: Sandbox);
6
7
  streamLogs(identifier: string, options: {
@@ -10,7 +11,7 @@ export declare class SandboxProcess extends SandboxAction {
10
11
  }): {
11
12
  close: () => void;
12
13
  };
13
- exec(process: ProcessRequest, onLog?: (log: string) => void): Promise<PostProcessResponse>;
14
+ exec(process: ProcessRequest | ProcessRequestWithLog): Promise<PostProcessResponse>;
14
15
  wait(identifier: string, { maxWait, interval }?: {
15
16
  maxWait?: number;
16
17
  interval?: number;
@@ -61,7 +61,12 @@ class SandboxProcess extends action_js_1.SandboxAction {
61
61
  close: () => controller.abort(),
62
62
  };
63
63
  }
64
- async exec(process, onLog) {
64
+ async exec(process) {
65
+ let onLog;
66
+ if ('onLog' in process && process.onLog) {
67
+ onLog = process.onLog;
68
+ delete process.onLog;
69
+ }
65
70
  // Store original wait_for_completion setting
66
71
  const shouldWaitForCompletion = process.waitForCompletion;
67
72
  // Always start process without wait_for_completion to avoid server-side blocking
@@ -1,4 +1,5 @@
1
1
  import { Port, Sandbox } from "../client/types.gen";
2
+ import { ProcessRequest } from "./client";
2
3
  export interface SessionCreateOptions {
3
4
  expiresAt?: Date;
4
5
  responseHeaders?: Record<string, string>;
@@ -28,3 +29,6 @@ export type SandboxCreateConfiguration = {
28
29
  };
29
30
  export declare function normalizePorts(ports?: (Port | Record<string, any>)[]): Port[] | undefined;
30
31
  export declare function normalizeEnvs(envs?: EnvVar[]): EnvVar[] | undefined;
32
+ export type ProcessRequestWithLog = ProcessRequest & {
33
+ onLog?: (log: string) => void;
34
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blaxel/core",
3
- "version": "0.2.20-preview.45",
3
+ "version": "0.2.20",
4
4
  "description": "Blaxel Core SDK for TypeScript",
5
5
  "license": "MIT",
6
6
  "author": "Blaxel, INC (https://blaxel.ai)",