@blaxel/core 0.2.57-dev.31 → 0.2.57-dev.32

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.
@@ -9,8 +9,8 @@ const index_js_1 = require("../authentication/index.js");
9
9
  const env_js_1 = require("../common/env.js");
10
10
  const node_js_1 = require("../common/node.js");
11
11
  // Build info - these placeholders are replaced at build time by build:replace-imports
12
- const BUILD_VERSION = "0.2.57-dev.31";
13
- const BUILD_COMMIT = "68a090397bc0a76709b4179c59ee74c61a6edbd4";
12
+ const BUILD_VERSION = "0.2.57-dev.32";
13
+ const BUILD_COMMIT = "dd5f12817bd716653ab610c6a1e0bae65d1f53be";
14
14
  const BUILD_SENTRY_DSN = "https://fd5e60e1c9820e1eef5ccebb84a07127@o4508714045276160.ingest.us.sentry.io/4510465864564736";
15
15
  // Cache for config.yaml tracking value
16
16
  let configTrackingValue = null;
@@ -137,7 +137,7 @@ class SandboxProcess extends action_js_1.SandboxAction {
137
137
  throw new Error(`Failed to execute process: ${errorText}`);
138
138
  }
139
139
  const contentType = response.headers.get('Content-Type') || '';
140
- const isStreaming = contentType.includes('text/plain') || contentType.includes('text/event-stream');
140
+ const isStreaming = contentType.includes('application/x-ndjson');
141
141
  // Fallback: server doesn't support streaming, use legacy approach
142
142
  if (!isStreaming) {
143
143
  const data = await response.json();
@@ -187,27 +187,30 @@ class SandboxProcess extends action_js_1.SandboxAction {
187
187
  const lines = buffer.split(/\r?\n/);
188
188
  buffer = lines.pop();
189
189
  for (const line of lines) {
190
- if (!line || line.startsWith('[keepalive]')) {
191
- continue;
192
- }
193
- if (line.startsWith('stdout:')) {
194
- const content = line.slice(7);
195
- options.onStdout?.(content);
196
- options.onLog?.(content);
197
- }
198
- else if (line.startsWith('stderr:')) {
199
- const content = line.slice(7);
200
- options.onStderr?.(content);
201
- options.onLog?.(content);
202
- }
203
- else if (line.startsWith('result:')) {
204
- const jsonStr = line.slice(7);
205
- try {
206
- result = JSON.parse(jsonStr);
207
- }
208
- catch {
209
- throw new Error(`Failed to parse result JSON: ${jsonStr}`);
210
- }
190
+ const parsed = JSON.parse(line);
191
+ switch (parsed.type) {
192
+ case 'stdout':
193
+ if (parsed.data) {
194
+ options.onStdout?.(parsed.data);
195
+ options.onLog?.(parsed.data);
196
+ }
197
+ break;
198
+ case 'stderr':
199
+ if (parsed.data) {
200
+ options.onStderr?.(parsed.data);
201
+ options.onLog?.(parsed.data);
202
+ }
203
+ break;
204
+ case 'result':
205
+ try {
206
+ result = JSON.parse(parsed.data);
207
+ }
208
+ catch {
209
+ throw new Error(`Failed to parse result JSON: ${parsed.data}`);
210
+ }
211
+ break;
212
+ default:
213
+ break;
211
214
  }
212
215
  }
213
216
  }