@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
|
@@ -54,13 +54,10 @@ class ClientCredentials extends credentials_js_1.Credentials {
|
|
|
54
54
|
}
|
|
55
55
|
catch (error) {
|
|
56
56
|
if (retry > 0) {
|
|
57
|
-
console.error(`Authentication failed, retrying... (${4 - retry}/3)`, error);
|
|
58
57
|
await this.sleep(1000);
|
|
59
58
|
return this.processWithRetry(retry - 1);
|
|
60
59
|
}
|
|
61
|
-
|
|
62
|
-
const originalMessage = error instanceof Error ? error.message : String(error);
|
|
63
|
-
throw new Error(`Authentication failed after 4 attempts: ${originalMessage}`, { cause: error });
|
|
60
|
+
throw error;
|
|
64
61
|
}
|
|
65
62
|
}
|
|
66
63
|
async process() {
|
|
@@ -5,8 +5,6 @@ exports.getAlphanumericLimitedHash = getAlphanumericLimitedHash;
|
|
|
5
5
|
exports.getGlobalUniqueHash = getGlobalUniqueHash;
|
|
6
6
|
exports.pluralize = pluralize;
|
|
7
7
|
exports.getForcedUrl = getForcedUrl;
|
|
8
|
-
exports.getWorkloadTypeShort = getWorkloadTypeShort;
|
|
9
|
-
exports.generateInternalUrl = generateInternalUrl;
|
|
10
8
|
const env_js_1 = require("./env.js");
|
|
11
9
|
// Pure JS MD5 implementation that matches standard crypto MD5
|
|
12
10
|
function md5(input) {
|
|
@@ -188,41 +186,3 @@ function getForcedUrl(type, name) {
|
|
|
188
186
|
}
|
|
189
187
|
return null;
|
|
190
188
|
}
|
|
191
|
-
function getWorkloadTypeShort(type) {
|
|
192
|
-
const lowerType = type.toLowerCase();
|
|
193
|
-
switch (lowerType) {
|
|
194
|
-
case 'agent':
|
|
195
|
-
case 'agents':
|
|
196
|
-
return 'agt';
|
|
197
|
-
case 'mcp':
|
|
198
|
-
case 'mcps':
|
|
199
|
-
case 'function':
|
|
200
|
-
case 'functions':
|
|
201
|
-
return 'mcp';
|
|
202
|
-
case 'sandbox':
|
|
203
|
-
case 'sandboxes':
|
|
204
|
-
return 'sbx';
|
|
205
|
-
case 'job':
|
|
206
|
-
case 'jobs':
|
|
207
|
-
return 'job';
|
|
208
|
-
case 'model':
|
|
209
|
-
case 'models':
|
|
210
|
-
return 'mdl';
|
|
211
|
-
default:
|
|
212
|
-
// fallback to first 3 letters of type
|
|
213
|
-
return lowerType.substring(0, 3);
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
function generateInternalUrl(workspace, type, name, env, protocol, hostname, blCloud, workspaceId) {
|
|
217
|
-
if (blCloud && workspaceId) {
|
|
218
|
-
// New cloud format: bl-ENV-WORKLOAD_CALLED_NAME-WORKLOAD_TYPE_SHORT-WORKSPACE_ID
|
|
219
|
-
const workloadTypeShort = getWorkloadTypeShort(type);
|
|
220
|
-
const subdomain = `bl-${env}-${name}-${workloadTypeShort}-${workspaceId}`;
|
|
221
|
-
return `${protocol}://${subdomain}.${hostname}`;
|
|
222
|
-
}
|
|
223
|
-
else {
|
|
224
|
-
// Legacy format: bl-ENV-HASH.internalhostname
|
|
225
|
-
const hash = getGlobalUniqueHash(workspace, type, name);
|
|
226
|
-
return `${protocol}://bl-${env}-${hash}.${hostname}`;
|
|
227
|
-
}
|
|
228
|
-
}
|
|
@@ -10,7 +10,7 @@ function getPackageVersion() {
|
|
|
10
10
|
if (typeof require !== "undefined") {
|
|
11
11
|
// Try to require package.json (Node.js only, gracefully fails in browser)
|
|
12
12
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
13
|
-
const packageJson = {"version":"0.2.49-
|
|
13
|
+
const packageJson = {"version":"0.2.49-preview.109","commit":"af8978409f72d59a9d6d6caac2d8ea79642b623e"};
|
|
14
14
|
return packageJson.version || "unknown";
|
|
15
15
|
}
|
|
16
16
|
else {
|
|
@@ -62,7 +62,7 @@ function getCommitHash() {
|
|
|
62
62
|
if (typeof require !== "undefined") {
|
|
63
63
|
// Try to require package.json and look for commit field (set during build)
|
|
64
64
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
65
|
-
const packageJson = {"version":"0.2.49-
|
|
65
|
+
const packageJson = {"version":"0.2.49-preview.109","commit":"af8978409f72d59a9d6d6caac2d8ea79642b623e"};
|
|
66
66
|
// Check for commit in various possible locations
|
|
67
67
|
const commit = packageJson.commit || packageJson.buildInfo?.commit;
|
|
68
68
|
if (commit) {
|
|
@@ -165,9 +165,6 @@ class Settings {
|
|
|
165
165
|
get blCloud() {
|
|
166
166
|
return env_js_1.env.BL_CLOUD === "true";
|
|
167
167
|
}
|
|
168
|
-
get workspaceId() {
|
|
169
|
-
return env_js_1.env.BL_WORKSPACE_ID || "";
|
|
170
|
-
}
|
|
171
168
|
get generation() {
|
|
172
169
|
return env_js_1.env.BL_GENERATION || "";
|
|
173
170
|
}
|
|
@@ -20,8 +20,8 @@ class BlJob {
|
|
|
20
20
|
return new URL(`${settings_js_1.settings.runUrl}/${settings_js_1.settings.workspace}/jobs/${this.jobName}`);
|
|
21
21
|
}
|
|
22
22
|
get internalUrl() {
|
|
23
|
-
const
|
|
24
|
-
return new URL(
|
|
23
|
+
const hash = (0, internal_js_1.getGlobalUniqueHash)(settings_js_1.settings.workspace, "job", this.jobName);
|
|
24
|
+
return new URL(`${settings_js_1.settings.runInternalProtocol}://bl-${settings_js_1.settings.env}-${hash}.${settings_js_1.settings.runInternalHostname}`);
|
|
25
25
|
}
|
|
26
26
|
get forcedUrl() {
|
|
27
27
|
return (0, internal_js_1.getForcedUrl)('job', this.jobName);
|
|
@@ -48,7 +48,8 @@ class SandboxAction {
|
|
|
48
48
|
return this.sandbox.metadata?.url ?? `${settings_js_1.settings.runUrl}/${settings_js_1.settings.workspace}/sandboxes/${this.name}`;
|
|
49
49
|
}
|
|
50
50
|
get internalUrl() {
|
|
51
|
-
|
|
51
|
+
const hash = (0, internal_js_1.getGlobalUniqueHash)(settings_js_1.settings.workspace, "sandbox", this.name);
|
|
52
|
+
return `${settings_js_1.settings.runInternalProtocol}://bl-${settings_js_1.settings.env}-${hash}.${settings_js_1.settings.runInternalHostname}`;
|
|
52
53
|
}
|
|
53
54
|
get client() {
|
|
54
55
|
if (this.sandbox.forceUrl) {
|
|
@@ -58,8 +58,8 @@ class McpTool {
|
|
|
58
58
|
return new URL(`${settings_js_1.settings.runUrl}/${settings_js_1.settings.workspace}/${this.pluralType}/${this.name}`);
|
|
59
59
|
}
|
|
60
60
|
get internalUrl() {
|
|
61
|
-
const
|
|
62
|
-
return new URL(
|
|
61
|
+
const hash = (0, internal_js_1.getGlobalUniqueHash)(settings_js_1.settings.workspace, this.type, this.name);
|
|
62
|
+
return new URL(`${settings_js_1.settings.runInternalProtocol}://bl-${settings_js_1.settings.env}-${hash}.${settings_js_1.settings.runInternalHostname}`);
|
|
63
63
|
}
|
|
64
64
|
get forcedUrl() {
|
|
65
65
|
return (0, internal_js_1.getForcedUrl)(this.type, this.name);
|
|
@@ -2,5 +2,3 @@ export declare function getAlphanumericLimitedHash(input: string, maxSize?: numb
|
|
|
2
2
|
export declare function getGlobalUniqueHash(workspace: string, type: string, name: string): string;
|
|
3
3
|
export declare function pluralize(type: string): string;
|
|
4
4
|
export declare function getForcedUrl(type: string, name: string): import("url").URL | null;
|
|
5
|
-
export declare function getWorkloadTypeShort(type: string): string;
|
|
6
|
-
export declare function generateInternalUrl(workspace: string, type: string, name: string, env: string, protocol: string, hostname: string, blCloud: boolean, workspaceId: string): string;
|