@blaxel/core 0.2.49-dev.211 → 0.2.49-preview.109
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.
- package/dist/cjs/.tsbuildinfo +1 -1
- package/dist/cjs/agents/index.js +2 -2
- package/dist/cjs/authentication/clientcredentials.js +1 -4
- package/dist/cjs/common/internal.js +0 -40
- package/dist/cjs/common/settings.js +2 -5
- package/dist/cjs/jobs/jobs.js +2 -2
- package/dist/cjs/sandbox/action.js +2 -1
- package/dist/cjs/tools/mcpTool.js +2 -2
- package/dist/cjs/types/common/internal.d.ts +0 -2
- package/dist/cjs/types/common/settings.d.ts +0 -1
- package/dist/cjs-browser/.tsbuildinfo +1 -1
- package/dist/cjs-browser/agents/index.js +2 -2
- package/dist/cjs-browser/authentication/clientcredentials.js +1 -4
- package/dist/cjs-browser/common/internal.js +0 -40
- package/dist/cjs-browser/common/settings.js +2 -5
- package/dist/cjs-browser/jobs/jobs.js +2 -2
- package/dist/cjs-browser/sandbox/action.js +2 -1
- package/dist/cjs-browser/tools/mcpTool.js +2 -2
- package/dist/cjs-browser/types/common/internal.d.ts +0 -2
- package/dist/cjs-browser/types/common/settings.d.ts +0 -1
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/agents/index.js +3 -3
- package/dist/esm/authentication/clientcredentials.js +1 -4
- package/dist/esm/common/internal.js +0 -38
- package/dist/esm/common/settings.js +2 -5
- package/dist/esm/jobs/jobs.js +3 -3
- package/dist/esm/sandbox/action.js +3 -2
- package/dist/esm/tools/mcpTool.js +3 -3
- package/dist/esm-browser/.tsbuildinfo +1 -1
- package/dist/esm-browser/agents/index.js +3 -3
- package/dist/esm-browser/authentication/clientcredentials.js +1 -4
- package/dist/esm-browser/common/internal.js +0 -38
- package/dist/esm-browser/common/settings.js +2 -5
- package/dist/esm-browser/jobs/jobs.js +3 -3
- package/dist/esm-browser/sandbox/action.js +3 -2
- package/dist/esm-browser/tools/mcpTool.js +3 -3
- package/package.json +2 -2
|
@@ -180,41 +180,3 @@ export function getForcedUrl(type, name) {
|
|
|
180
180
|
}
|
|
181
181
|
return null;
|
|
182
182
|
}
|
|
183
|
-
export function getWorkloadTypeShort(type) {
|
|
184
|
-
const lowerType = type.toLowerCase();
|
|
185
|
-
switch (lowerType) {
|
|
186
|
-
case 'agent':
|
|
187
|
-
case 'agents':
|
|
188
|
-
return 'agt';
|
|
189
|
-
case 'mcp':
|
|
190
|
-
case 'mcps':
|
|
191
|
-
case 'function':
|
|
192
|
-
case 'functions':
|
|
193
|
-
return 'mcp';
|
|
194
|
-
case 'sandbox':
|
|
195
|
-
case 'sandboxes':
|
|
196
|
-
return 'sbx';
|
|
197
|
-
case 'job':
|
|
198
|
-
case 'jobs':
|
|
199
|
-
return 'job';
|
|
200
|
-
case 'model':
|
|
201
|
-
case 'models':
|
|
202
|
-
return 'mdl';
|
|
203
|
-
default:
|
|
204
|
-
// fallback to first 3 letters of type
|
|
205
|
-
return lowerType.substring(0, 3);
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
export function generateInternalUrl(workspace, type, name, env, protocol, hostname, blCloud, workspaceId) {
|
|
209
|
-
if (blCloud && workspaceId) {
|
|
210
|
-
// New cloud format: bl-ENV-WORKLOAD_CALLED_NAME-WORKLOAD_TYPE_SHORT-WORKSPACE_ID
|
|
211
|
-
const workloadTypeShort = getWorkloadTypeShort(type);
|
|
212
|
-
const subdomain = `bl-${env}-${name}-${workloadTypeShort}-${workspaceId}`;
|
|
213
|
-
return `${protocol}://${subdomain}.${hostname}`;
|
|
214
|
-
}
|
|
215
|
-
else {
|
|
216
|
-
// Legacy format: bl-ENV-HASH.internalhostname
|
|
217
|
-
const hash = getGlobalUniqueHash(workspace, type, name);
|
|
218
|
-
return `${protocol}://bl-${env}-${hash}.${hostname}`;
|
|
219
|
-
}
|
|
220
|
-
}
|
|
@@ -7,7 +7,7 @@ function getPackageVersion() {
|
|
|
7
7
|
if (typeof require !== "undefined") {
|
|
8
8
|
// Try to require package.json (Node.js only, gracefully fails in browser)
|
|
9
9
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
10
|
-
const packageJson = {"version":"0.2.49-
|
|
10
|
+
const packageJson = {"version":"0.2.49-preview.109","commit":"af8978409f72d59a9d6d6caac2d8ea79642b623e"};
|
|
11
11
|
return packageJson.version || "unknown";
|
|
12
12
|
}
|
|
13
13
|
else {
|
|
@@ -59,7 +59,7 @@ function getCommitHash() {
|
|
|
59
59
|
if (typeof require !== "undefined") {
|
|
60
60
|
// Try to require package.json and look for commit field (set during build)
|
|
61
61
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
62
|
-
const packageJson = {"version":"0.2.49-
|
|
62
|
+
const packageJson = {"version":"0.2.49-preview.109","commit":"af8978409f72d59a9d6d6caac2d8ea79642b623e"};
|
|
63
63
|
// Check for commit in various possible locations
|
|
64
64
|
const commit = packageJson.commit || packageJson.buildInfo?.commit;
|
|
65
65
|
if (commit) {
|
|
@@ -162,9 +162,6 @@ class Settings {
|
|
|
162
162
|
get blCloud() {
|
|
163
163
|
return env.BL_CLOUD === "true";
|
|
164
164
|
}
|
|
165
|
-
get workspaceId() {
|
|
166
|
-
return env.BL_WORKSPACE_ID || "";
|
|
167
|
-
}
|
|
168
165
|
get generation() {
|
|
169
166
|
return env.BL_GENERATION || "";
|
|
170
167
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getForcedUrl, getGlobalUniqueHash } from "../common/internal.js";
|
|
2
2
|
import { logger } from "../common/logger.js";
|
|
3
3
|
import { settings } from "../common/settings.js";
|
|
4
4
|
import { startSpan } from '../telemetry/telemetry.js';
|
|
@@ -17,8 +17,8 @@ class BlJob {
|
|
|
17
17
|
return new URL(`${settings.runUrl}/${settings.workspace}/jobs/${this.jobName}`);
|
|
18
18
|
}
|
|
19
19
|
get internalUrl() {
|
|
20
|
-
const
|
|
21
|
-
return new URL(
|
|
20
|
+
const hash = getGlobalUniqueHash(settings.workspace, "job", this.jobName);
|
|
21
|
+
return new URL(`${settings.runInternalProtocol}://bl-${settings.env}-${hash}.${settings.runInternalHostname}`);
|
|
22
22
|
}
|
|
23
23
|
get forcedUrl() {
|
|
24
24
|
return getForcedUrl('job', this.jobName);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createClient } from "@hey-api/client-fetch";
|
|
2
|
-
import {
|
|
2
|
+
import { getForcedUrl, getGlobalUniqueHash } from "../common/internal.js";
|
|
3
3
|
import { settings } from "../common/settings.js";
|
|
4
4
|
import { client as defaultClient } from "./client/client.gen.js";
|
|
5
5
|
export class ResponseError extends Error {
|
|
@@ -44,7 +44,8 @@ export class SandboxAction {
|
|
|
44
44
|
return this.sandbox.metadata?.url ?? `${settings.runUrl}/${settings.workspace}/sandboxes/${this.name}`;
|
|
45
45
|
}
|
|
46
46
|
get internalUrl() {
|
|
47
|
-
|
|
47
|
+
const hash = getGlobalUniqueHash(settings.workspace, "sandbox", this.name);
|
|
48
|
+
return `${settings.runInternalProtocol}://bl-${settings.env}-${hash}.${settings.runInternalHostname}`;
|
|
48
49
|
}
|
|
49
50
|
get client() {
|
|
50
51
|
if (this.sandbox.forceUrl) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Client as ModelContextProtocolClient } from "@modelcontextprotocol/sdk/client/index.js";
|
|
2
2
|
import { env } from "../common/env.js";
|
|
3
|
-
import {
|
|
3
|
+
import { getForcedUrl, getGlobalUniqueHash } from "../common/internal.js";
|
|
4
4
|
import { logger } from "../common/logger.js";
|
|
5
5
|
import { settings } from "../common/settings.js";
|
|
6
6
|
import { authenticate } from "../index.js";
|
|
@@ -55,8 +55,8 @@ export class McpTool {
|
|
|
55
55
|
return new URL(`${settings.runUrl}/${settings.workspace}/${this.pluralType}/${this.name}`);
|
|
56
56
|
}
|
|
57
57
|
get internalUrl() {
|
|
58
|
-
const
|
|
59
|
-
return new URL(
|
|
58
|
+
const hash = getGlobalUniqueHash(settings.workspace, this.type, this.name);
|
|
59
|
+
return new URL(`${settings.runInternalProtocol}://bl-${settings.env}-${hash}.${settings.runInternalHostname}`);
|
|
60
60
|
}
|
|
61
61
|
get forcedUrl() {
|
|
62
62
|
return getForcedUrl(this.type, this.name);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blaxel/core",
|
|
3
|
-
"version": "0.2.49-
|
|
3
|
+
"version": "0.2.49-preview.109",
|
|
4
4
|
"description": "Blaxel Core SDK for TypeScript",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Blaxel, INC (https://blaxel.ai)",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"vite": "^5.2.0",
|
|
75
75
|
"vitest": "^1.5.0"
|
|
76
76
|
},
|
|
77
|
-
"commit": "
|
|
77
|
+
"commit": "af8978409f72d59a9d6d6caac2d8ea79642b623e",
|
|
78
78
|
"scripts": {
|
|
79
79
|
"lint": "eslint src/",
|
|
80
80
|
"dev": "tsc --watch",
|