@blaxel/core 0.2.67-preview.87 → 0.2.67-preview.88

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.
@@ -32,22 +32,27 @@ class BlAgent {
32
32
  return this.internalUrl;
33
33
  return this.externalUrl;
34
34
  }
35
- async call(url, input) {
35
+ async call(url, input, headers = {}, params = {}) {
36
36
  let body = input;
37
37
  if (typeof body != "string") {
38
38
  body = JSON.stringify(body);
39
39
  }
40
- const response = await fetch(url, {
40
+ const fetchUrl = new URL(url.toString());
41
+ for (const [key, value] of Object.entries(params)) {
42
+ fetchUrl.searchParams.set(key, value);
43
+ }
44
+ const response = await fetch(fetchUrl, {
41
45
  method: "POST",
42
46
  headers: {
43
47
  ...settings.headers,
44
48
  "Content-Type": "application/json",
49
+ ...headers,
45
50
  },
46
51
  body,
47
52
  });
48
53
  return response;
49
54
  }
50
- async run(input) {
55
+ async run(input, headers = {}, params = {}) {
51
56
  logger.debug(`Agent Calling: ${this.agentName}`);
52
57
  const span = startSpan(this.agentName, {
53
58
  attributes: {
@@ -58,7 +63,7 @@ class BlAgent {
58
63
  isRoot: false,
59
64
  });
60
65
  try {
61
- const response = await this.call(this.url, input);
66
+ const response = await this.call(this.url, input, headers, params);
62
67
  span.setAttribute("agent.run.result", await response.text());
63
68
  return await response.text();
64
69
  }
@@ -69,7 +74,7 @@ class BlAgent {
69
74
  throw err;
70
75
  }
71
76
  try {
72
- const response = await this.call(this.fallbackUrl, input);
77
+ const response = await this.call(this.fallbackUrl, input, headers, params);
73
78
  span.setAttribute("agent.run.result", await response.text());
74
79
  return await response.text();
75
80
  }
@@ -3,8 +3,8 @@ import { authentication } from "../authentication/index.js";
3
3
  import { env } from "../common/env.js";
4
4
  import { fs, os, path } from "../common/node.js";
5
5
  // Build info - these placeholders are replaced at build time by build:replace-imports
6
- const BUILD_VERSION = "0.2.67-preview.87";
7
- const BUILD_COMMIT = "24af83338eb730bbfcfc66a38761b7ad503bc69e";
6
+ const BUILD_VERSION = "0.2.67-preview.88";
7
+ const BUILD_COMMIT = "5357b4855456af1c4f172b8489f4f5c520c79a24";
8
8
  const BUILD_SENTRY_DSN = "https://fd5e60e1c9820e1eef5ccebb84a07127@o4508714045276160.ingest.us.sentry.io/4510465864564736";
9
9
  // Cache for config.yaml tracking value
10
10
  let configTrackingValue = null;
@@ -15,7 +15,7 @@ export class SandboxProcess extends SandboxAction {
15
15
  console.error("Stream error:", err);
16
16
  }
17
17
  };
18
- void (async () => {
18
+ const done = (async () => {
19
19
  try {
20
20
  const headers = this.sandbox.forceUrl ? this.sandbox.headers : settings.headers;
21
21
  const stream = await fetch(`${this.url}/process/${identifier}/logs/stream`, {
@@ -70,6 +70,7 @@ export class SandboxProcess extends SandboxAction {
70
70
  })();
71
71
  return {
72
72
  close: () => controller.abort(),
73
+ wait: () => done,
73
74
  };
74
75
  }
75
76
  async exec(process) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blaxel/core",
3
- "version": "0.2.67-preview.87",
3
+ "version": "0.2.67-preview.88",
4
4
  "description": "Blaxel Core SDK for TypeScript",
5
5
  "license": "MIT",
6
6
  "author": "Blaxel, INC (https://blaxel.ai)",