@blaxel/core 0.2.67-preview.86 → 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.
@@ -35,22 +35,27 @@ class BlAgent {
35
35
  return this.internalUrl;
36
36
  return this.externalUrl;
37
37
  }
38
- async call(url, input) {
38
+ async call(url, input, headers = {}, params = {}) {
39
39
  let body = input;
40
40
  if (typeof body != "string") {
41
41
  body = JSON.stringify(body);
42
42
  }
43
- const response = await fetch(url, {
43
+ const fetchUrl = new URL(url.toString());
44
+ for (const [key, value] of Object.entries(params)) {
45
+ fetchUrl.searchParams.set(key, value);
46
+ }
47
+ const response = await fetch(fetchUrl, {
44
48
  method: "POST",
45
49
  headers: {
46
50
  ...settings_js_1.settings.headers,
47
51
  "Content-Type": "application/json",
52
+ ...headers,
48
53
  },
49
54
  body,
50
55
  });
51
56
  return response;
52
57
  }
53
- async run(input) {
58
+ async run(input, headers = {}, params = {}) {
54
59
  logger_js_1.logger.debug(`Agent Calling: ${this.agentName}`);
55
60
  const span = (0, telemetry_js_1.startSpan)(this.agentName, {
56
61
  attributes: {
@@ -61,7 +66,7 @@ class BlAgent {
61
66
  isRoot: false,
62
67
  });
63
68
  try {
64
- const response = await this.call(this.url, input);
69
+ const response = await this.call(this.url, input, headers, params);
65
70
  span.setAttribute("agent.run.result", await response.text());
66
71
  return await response.text();
67
72
  }
@@ -72,7 +77,7 @@ class BlAgent {
72
77
  throw err;
73
78
  }
74
79
  try {
75
- const response = await this.call(this.fallbackUrl, input);
80
+ const response = await this.call(this.fallbackUrl, input, headers, params);
76
81
  span.setAttribute("agent.run.result", await response.text());
77
82
  return await response.text();
78
83
  }
@@ -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.67-preview.86";
13
- const BUILD_COMMIT = "6481867264ce786d817ad4ad11a30da64ec28cf7";
12
+ const BUILD_VERSION = "0.2.67-preview.88";
13
+ const BUILD_COMMIT = "5357b4855456af1c4f172b8489f4f5c520c79a24";
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;
@@ -18,7 +18,7 @@ class SandboxProcess extends action_js_1.SandboxAction {
18
18
  console.error("Stream error:", err);
19
19
  }
20
20
  };
21
- void (async () => {
21
+ const done = (async () => {
22
22
  try {
23
23
  const headers = this.sandbox.forceUrl ? this.sandbox.headers : settings_js_1.settings.headers;
24
24
  const stream = await fetch(`${this.url}/process/${identifier}/logs/stream`, {
@@ -73,6 +73,7 @@ class SandboxProcess extends action_js_1.SandboxAction {
73
73
  })();
74
74
  return {
75
75
  close: () => controller.abort(),
76
+ wait: () => done,
76
77
  };
77
78
  }
78
79
  async exec(process) {
@@ -7,8 +7,8 @@ declare class BlAgent {
7
7
  get internalUrl(): import("url").URL;
8
8
  get forcedUrl(): import("url").URL | null;
9
9
  get url(): import("url").URL;
10
- call(url: URL, input: Record<string, unknown> | string | undefined): Promise<Response>;
11
- run(input: Record<string, unknown> | string | undefined): Promise<string>;
10
+ call(url: URL, input: Record<string, unknown> | string | undefined, headers?: Record<string, string>, params?: Record<string, string>): Promise<Response>;
11
+ run(input: Record<string, unknown> | string | undefined, headers?: Record<string, string>, params?: Record<string, string>): Promise<string>;
12
12
  }
13
13
  export declare const blAgent: (agentName: string) => BlAgent;
14
14
  export declare const getAgentMetadata: (agent: string) => Promise<Agent | null>;
@@ -731,10 +731,6 @@ export type FunctionSpec = {
731
731
  * When true, the function is publicly accessible without authentication. Only available for mk3 generation.
732
732
  */
733
733
  public?: boolean;
734
- /**
735
- * Base64-encoded API reference for MCP code mode
736
- */
737
- reference?: string;
738
734
  revision?: RevisionConfiguration;
739
735
  runtime?: FunctionRuntime;
740
736
  triggers?: Triggers;
@@ -753,10 +749,6 @@ export type FunctionSpecWritable = {
753
749
  * When true, the function is publicly accessible without authentication. Only available for mk3 generation.
754
750
  */
755
751
  public?: boolean;
756
- /**
757
- * Base64-encoded API reference for MCP code mode
758
- */
759
- reference?: string;
760
752
  revision?: RevisionConfiguration;
761
753
  runtime?: FunctionRuntime;
762
754
  triggers?: TriggersWritable;
@@ -11,6 +11,7 @@ export declare class SandboxProcess extends SandboxAction {
11
11
  onError?: (error: Error) => void;
12
12
  }): {
13
13
  close: () => void;
14
+ wait: () => Promise<void>;
14
15
  };
15
16
  exec(process: ProcessRequest | ProcessRequestWithLog): Promise<PostProcessResponse | ProcessResponseWithLog>;
16
17
  private execWithStreaming;