@blaxel/core 0.2.60-preview.48 → 0.2.60

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.
@@ -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.60-preview.48";
7
- const BUILD_COMMIT = "354f57622235d0224db5186f8356b954f15f287f";
6
+ const BUILD_VERSION = "0.2.60";
7
+ const BUILD_COMMIT = "2c502afdeb7e7a53923997003a02788b8b7591d1";
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;
@@ -1,13 +1,13 @@
1
1
  import { Client as ModelContextProtocolClient } from "@modelcontextprotocol/sdk/client/index.js";
2
+ import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
2
3
  import { env } from "../common/env.js";
3
4
  import { getForcedUrl, getGlobalUniqueHash } from "../common/internal.js";
4
5
  import { logger } from "../common/logger.js";
5
6
  import { settings } from "../common/settings.js";
6
- import { authenticate } from "../index.js";
7
+ import { authenticate, SandboxInstance } from "../index.js";
7
8
  import { BlaxelMcpClientTransport } from "../mcp/client.js";
8
9
  import { startSpan } from "../telemetry/telemetry.js";
9
10
  import { schemaToZodSchema } from "./zodSchema.js";
10
- import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
11
11
  const McpToolCache = new Map();
12
12
  export class McpTool {
13
13
  name;
@@ -69,6 +69,17 @@ export class McpTool {
69
69
  this.stopCloseTimer();
70
70
  this.startPromise = this.startPromise || (async () => {
71
71
  await authenticate();
72
+ // Sandbox using run v2 API
73
+ if (this.pluralType == "sandboxes") {
74
+ const sandbox = await SandboxInstance.get(this.name);
75
+ const url = sandbox.metadata.url + "/mcp";
76
+ this.transport = new StreamableHTTPClientTransport(new URL(url), {
77
+ requestInit: { headers: settings.headers },
78
+ });
79
+ await this.client.connect(this.transport);
80
+ logger.debug(`MCP:${this.name}:Connected to sandbox`);
81
+ return;
82
+ }
72
83
  try {
73
84
  logger.debug(`MCP:${this.name}:Connecting::${this.url.toString()}`);
74
85
  this.transport = await this.getTransport();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blaxel/core",
3
- "version": "0.2.60-preview.48",
3
+ "version": "0.2.60",
4
4
  "description": "Blaxel Core SDK for TypeScript",
5
5
  "license": "MIT",
6
6
  "author": "Blaxel, INC (https://blaxel.ai)",