@blaxel/core 0.2.0-preview2 → 0.2.0-preview4
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/client/sdk.gen.d.ts +4 -9
- package/dist/client/sdk.gen.js +3 -3
- package/dist/client/types.gen.d.ts +126 -38
- package/dist/common/env.js +3 -7
- package/dist/mcp/server/http.d.ts +8 -0
- package/dist/mcp/server/http.js +16 -0
- package/dist/mcp/server/index.d.ts +4 -0
- package/dist/mcp/server/index.js +21 -0
- package/dist/mcp/server/websocket.d.ts +24 -0
- package/dist/mcp/server/websocket.js +213 -0
- package/dist/sandbox/client/sdk.gen.d.ts +1 -1
- package/dist/sandbox/client/types.gen.d.ts +11 -14
- package/dist/sandbox/filesystem.js +3 -0
- package/dist/sandbox/preview.d.ts +19 -1
- package/dist/sandbox/preview.js +65 -1
- package/package.json +3 -1
package/dist/client/sdk.gen.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch';
|
|
2
|
-
import type { ListAgentsData, CreateAgentData, DeleteAgentData, GetAgentData, UpdateAgentData, ListAgentRevisionsData, GetConfigurationData, ListFunctionsData, CreateFunctionData, DeleteFunctionData, GetFunctionData, UpdateFunctionData, ListFunctionRevisionsData, GetIntegrationData, ListIntegrationConnectionsData, CreateIntegrationConnectionData, DeleteIntegrationConnectionData, GetIntegrationConnectionData, UpdateIntegrationConnectionData, GetIntegrationConnectionModelEndpointConfigurationsData, ListIntegrationConnectionModelsData, GetIntegrationConnectionModelData, ListKnowledgebasesData, CreateKnowledgebaseData, DeleteKnowledgebaseData, GetKnowledgebaseData, UpdateKnowledgebaseData, ListKnowledgebaseRevisionsData, ListLocationsData, ListMcpHubDefinitionsData, ListModelsData, CreateModelData, DeleteModelData, GetModelData, UpdateModelData, ListModelRevisionsData, ListPoliciesData, CreatePolicyData, DeletePolicyData, GetPolicyData, UpdatePolicyData, ListPrivateClustersData, CreatePrivateClusterData, DeletePrivateClusterData, GetPrivateClusterData, UpdatePrivateClusterData, GetPrivateClusterHealthData, UpdatePrivateClusterHealthData, ListAllPendingInvitationsData, ListSandboxHubDefinitionsData, ListSandboxesData, CreateSandboxData, DeleteSandboxData, GetSandboxData, UpdateSandboxData, ListSandboxPreviewsData, CreateSandboxPreviewData, DeleteSandboxPreviewData, GetSandboxPreviewData, UpdateSandboxPreviewData,
|
|
2
|
+
import type { ListAgentsData, CreateAgentData, DeleteAgentData, GetAgentData, UpdateAgentData, ListAgentRevisionsData, GetConfigurationData, ListFunctionsData, CreateFunctionData, DeleteFunctionData, GetFunctionData, UpdateFunctionData, ListFunctionRevisionsData, GetIntegrationData, ListIntegrationConnectionsData, CreateIntegrationConnectionData, DeleteIntegrationConnectionData, GetIntegrationConnectionData, UpdateIntegrationConnectionData, GetIntegrationConnectionModelEndpointConfigurationsData, ListIntegrationConnectionModelsData, GetIntegrationConnectionModelData, ListKnowledgebasesData, CreateKnowledgebaseData, DeleteKnowledgebaseData, GetKnowledgebaseData, UpdateKnowledgebaseData, ListKnowledgebaseRevisionsData, ListLocationsData, ListMcpHubDefinitionsData, ListModelsData, CreateModelData, DeleteModelData, GetModelData, UpdateModelData, ListModelRevisionsData, ListPoliciesData, CreatePolicyData, DeletePolicyData, GetPolicyData, UpdatePolicyData, ListPrivateClustersData, CreatePrivateClusterData, DeletePrivateClusterData, GetPrivateClusterData, UpdatePrivateClusterData, GetPrivateClusterHealthData, UpdatePrivateClusterHealthData, ListAllPendingInvitationsData, ListSandboxHubDefinitionsData, ListSandboxesData, CreateSandboxData, DeleteSandboxData, GetSandboxData, UpdateSandboxData, ListSandboxPreviewsData, CreateSandboxPreviewData, DeleteSandboxPreviewData, GetSandboxPreviewData, UpdateSandboxPreviewData, ListSandboxPreviewTokensData, CreateSandboxPreviewTokenData, DeleteSandboxPreviewTokenData, StartSandboxData, StopSandboxData, GetWorkspaceServiceAccountsData, CreateWorkspaceServiceAccountData, DeleteWorkspaceServiceAccountData, UpdateWorkspaceServiceAccountData, ListApiKeysForServiceAccountData, CreateApiKeyForServiceAccountData, DeleteApiKeyForServiceAccountData, ListTemplatesData, GetTemplateData, GetTemplateContentsData, GetTemplateFileContentsData, ListWorkspaceUsersData, InviteWorkspaceUserData, RemoveWorkspaceUserData, UpdateWorkspaceUserRoleData, ListWorkspacesData, CreateWorspaceData, DeleteWorkspaceData, GetWorkspaceData, UpdateWorkspaceData, DeclineWorkspaceInvitationData, AcceptWorkspaceInvitationData, LeaveWorkspaceData, CheckWorkspaceAvailabilityData } from './types.gen.js';
|
|
3
3
|
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = ClientOptions<TData, ThrowOnError> & {
|
|
4
4
|
/**
|
|
5
5
|
* You can provide a client instance returned by `createClient()` instead of
|
|
@@ -70,7 +70,7 @@ export declare const listFunctionRevisions: <ThrowOnError extends boolean = fals
|
|
|
70
70
|
* List integrations connections
|
|
71
71
|
* Returns integration information by name.
|
|
72
72
|
*/
|
|
73
|
-
export declare const getIntegration: <ThrowOnError extends boolean = false>(options: Options<GetIntegrationData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<
|
|
73
|
+
export declare const getIntegration: <ThrowOnError extends boolean = false>(options: Options<GetIntegrationData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen.js").Integration, unknown, ThrowOnError>;
|
|
74
74
|
/**
|
|
75
75
|
* List integrations connections
|
|
76
76
|
* Returns a list of all connections integrations in the workspace.
|
|
@@ -290,17 +290,12 @@ export declare const updateSandboxPreview: <ThrowOnError extends boolean = false
|
|
|
290
290
|
* Get tokens for Sandbox Preview
|
|
291
291
|
* Gets tokens for a Sandbox Preview.
|
|
292
292
|
*/
|
|
293
|
-
export declare const
|
|
294
|
-
created_at?: string;
|
|
295
|
-
name?: string;
|
|
296
|
-
}[], unknown, ThrowOnError>;
|
|
293
|
+
export declare const listSandboxPreviewTokens: <ThrowOnError extends boolean = false>(options: Options<ListSandboxPreviewTokensData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen.js").PreviewToken[], unknown, ThrowOnError>;
|
|
297
294
|
/**
|
|
298
295
|
* Create token for Sandbox Preview
|
|
299
296
|
* Creates a token for a Sandbox Preview.
|
|
300
297
|
*/
|
|
301
|
-
export declare const createSandboxPreviewToken: <ThrowOnError extends boolean = false>(options: Options<CreateSandboxPreviewTokenData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<
|
|
302
|
-
token?: string;
|
|
303
|
-
}, unknown, ThrowOnError>;
|
|
298
|
+
export declare const createSandboxPreviewToken: <ThrowOnError extends boolean = false>(options: Options<CreateSandboxPreviewTokenData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen.js").PreviewToken, unknown, ThrowOnError>;
|
|
304
299
|
/**
|
|
305
300
|
* Delete token for Sandbox Preview
|
|
306
301
|
* Deletes a token for a Sandbox Preview by name.
|
package/dist/client/sdk.gen.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.listSandboxHubDefinitions = exports.listAllPendingInvitations = exports.updatePrivateClusterHealth = exports.getPrivateClusterHealth = exports.updatePrivateCluster = exports.getPrivateCluster = exports.deletePrivateCluster = exports.createPrivateCluster = exports.listPrivateClusters = exports.updatePolicy = exports.getPolicy = exports.deletePolicy = exports.createPolicy = exports.listPolicies = exports.listModelRevisions = exports.updateModel = exports.getModel = exports.deleteModel = exports.createModel = exports.listModels = exports.listMcpHubDefinitions = exports.listLocations = exports.listKnowledgebaseRevisions = exports.updateKnowledgebase = exports.getKnowledgebase = exports.deleteKnowledgebase = exports.createKnowledgebase = exports.listKnowledgebases = exports.getIntegrationConnectionModel = exports.listIntegrationConnectionModels = exports.getIntegrationConnectionModelEndpointConfigurations = exports.updateIntegrationConnection = exports.getIntegrationConnection = exports.deleteIntegrationConnection = exports.createIntegrationConnection = exports.listIntegrationConnections = exports.getIntegration = exports.listFunctionRevisions = exports.updateFunction = exports.getFunction = exports.deleteFunction = exports.createFunction = exports.listFunctions = exports.getConfiguration = exports.listAgentRevisions = exports.updateAgent = exports.getAgent = exports.deleteAgent = exports.createAgent = exports.listAgents = void 0;
|
|
5
|
-
exports.checkWorkspaceAvailability = exports.leaveWorkspace = exports.acceptWorkspaceInvitation = exports.declineWorkspaceInvitation = exports.updateWorkspace = exports.getWorkspace = exports.deleteWorkspace = exports.createWorspace = exports.listWorkspaces = exports.updateWorkspaceUserRole = exports.removeWorkspaceUser = exports.inviteWorkspaceUser = exports.listWorkspaceUsers = exports.getTemplateFileContents = exports.getTemplateContents = exports.getTemplate = exports.listTemplates = exports.deleteApiKeyForServiceAccount = exports.createApiKeyForServiceAccount = exports.listApiKeysForServiceAccount = exports.updateWorkspaceServiceAccount = exports.deleteWorkspaceServiceAccount = exports.createWorkspaceServiceAccount = exports.getWorkspaceServiceAccounts = exports.stopSandbox = exports.startSandbox = exports.deleteSandboxPreviewToken = exports.createSandboxPreviewToken = exports.
|
|
5
|
+
exports.checkWorkspaceAvailability = exports.leaveWorkspace = exports.acceptWorkspaceInvitation = exports.declineWorkspaceInvitation = exports.updateWorkspace = exports.getWorkspace = exports.deleteWorkspace = exports.createWorspace = exports.listWorkspaces = exports.updateWorkspaceUserRole = exports.removeWorkspaceUser = exports.inviteWorkspaceUser = exports.listWorkspaceUsers = exports.getTemplateFileContents = exports.getTemplateContents = exports.getTemplate = exports.listTemplates = exports.deleteApiKeyForServiceAccount = exports.createApiKeyForServiceAccount = exports.listApiKeysForServiceAccount = exports.updateWorkspaceServiceAccount = exports.deleteWorkspaceServiceAccount = exports.createWorkspaceServiceAccount = exports.getWorkspaceServiceAccounts = exports.stopSandbox = exports.startSandbox = exports.deleteSandboxPreviewToken = exports.createSandboxPreviewToken = exports.listSandboxPreviewTokens = exports.updateSandboxPreview = exports.getSandboxPreview = exports.deleteSandboxPreview = exports.createSandboxPreview = exports.listSandboxPreviews = exports.updateSandbox = exports.getSandbox = exports.deleteSandbox = exports.createSandbox = exports.listSandboxes = void 0;
|
|
6
6
|
const client_gen_1 = require("./client.gen");
|
|
7
7
|
/**
|
|
8
8
|
* List all agents
|
|
@@ -1065,7 +1065,7 @@ exports.updateSandboxPreview = updateSandboxPreview;
|
|
|
1065
1065
|
* Get tokens for Sandbox Preview
|
|
1066
1066
|
* Gets tokens for a Sandbox Preview.
|
|
1067
1067
|
*/
|
|
1068
|
-
const
|
|
1068
|
+
const listSandboxPreviewTokens = (options) => {
|
|
1069
1069
|
return (options.client ?? client_gen_1.client).get({
|
|
1070
1070
|
security: [
|
|
1071
1071
|
{
|
|
@@ -1077,7 +1077,7 @@ const getSandboxPreviewTokens = (options) => {
|
|
|
1077
1077
|
...options
|
|
1078
1078
|
});
|
|
1079
1079
|
};
|
|
1080
|
-
exports.
|
|
1080
|
+
exports.listSandboxPreviewTokens = listSandboxPreviewTokens;
|
|
1081
1081
|
/**
|
|
1082
1082
|
* Create token for Sandbox Preview
|
|
1083
1083
|
* Creates a token for a Sandbox Preview.
|
|
@@ -419,6 +419,32 @@ export type HistogramStats = {
|
|
|
419
419
|
*/
|
|
420
420
|
p99?: number;
|
|
421
421
|
};
|
|
422
|
+
/**
|
|
423
|
+
* Integration
|
|
424
|
+
*/
|
|
425
|
+
export type Integration = {
|
|
426
|
+
/**
|
|
427
|
+
* Integration additional infos
|
|
428
|
+
*/
|
|
429
|
+
additionalInfos?: {
|
|
430
|
+
[key: string]: string;
|
|
431
|
+
};
|
|
432
|
+
endpoints?: IntegrationEndpoints;
|
|
433
|
+
headers?: IntegrationHeaders;
|
|
434
|
+
/**
|
|
435
|
+
* Integration name
|
|
436
|
+
*/
|
|
437
|
+
name?: string;
|
|
438
|
+
/**
|
|
439
|
+
* Integration organizations
|
|
440
|
+
*/
|
|
441
|
+
organizations?: Array<IntegrationOrganization>;
|
|
442
|
+
params?: IntegrationQueryParams;
|
|
443
|
+
/**
|
|
444
|
+
* Integration repositories
|
|
445
|
+
*/
|
|
446
|
+
repositories?: Array<IntegrationRepository>;
|
|
447
|
+
};
|
|
422
448
|
/**
|
|
423
449
|
* Integration Connection
|
|
424
450
|
*/
|
|
@@ -452,6 +478,62 @@ export type IntegrationConnectionSpec = {
|
|
|
452
478
|
};
|
|
453
479
|
};
|
|
454
480
|
export type IntegrationConnectionsList = Array<string>;
|
|
481
|
+
/**
|
|
482
|
+
* Integration endpoint
|
|
483
|
+
*/
|
|
484
|
+
export type IntegrationEndpoint = {
|
|
485
|
+
/**
|
|
486
|
+
* Integration endpoint body
|
|
487
|
+
*/
|
|
488
|
+
body?: string;
|
|
489
|
+
/**
|
|
490
|
+
* Integration endpoint ignore models
|
|
491
|
+
*/
|
|
492
|
+
ignoreModels?: Array<unknown>;
|
|
493
|
+
/**
|
|
494
|
+
* Integration endpoint method
|
|
495
|
+
*/
|
|
496
|
+
method?: string;
|
|
497
|
+
/**
|
|
498
|
+
* Integration endpoint models
|
|
499
|
+
*/
|
|
500
|
+
models?: Array<unknown>;
|
|
501
|
+
/**
|
|
502
|
+
* Integration endpoint stream key
|
|
503
|
+
*/
|
|
504
|
+
streamKey?: string;
|
|
505
|
+
streamToken?: IntegrationEndpointToken;
|
|
506
|
+
token?: IntegrationEndpointToken;
|
|
507
|
+
};
|
|
508
|
+
/**
|
|
509
|
+
* Integration endpoint token
|
|
510
|
+
*/
|
|
511
|
+
export type IntegrationEndpointToken = {
|
|
512
|
+
/**
|
|
513
|
+
* Integration endpoint token received
|
|
514
|
+
*/
|
|
515
|
+
received?: string;
|
|
516
|
+
/**
|
|
517
|
+
* Integration endpoint token sent
|
|
518
|
+
*/
|
|
519
|
+
sent?: string;
|
|
520
|
+
/**
|
|
521
|
+
* Integration endpoint token total
|
|
522
|
+
*/
|
|
523
|
+
total?: string;
|
|
524
|
+
};
|
|
525
|
+
/**
|
|
526
|
+
* Integration endpoints
|
|
527
|
+
*/
|
|
528
|
+
export type IntegrationEndpoints = {
|
|
529
|
+
[key: string]: IntegrationEndpoint;
|
|
530
|
+
};
|
|
531
|
+
/**
|
|
532
|
+
* Integration headers
|
|
533
|
+
*/
|
|
534
|
+
export type IntegrationHeaders = {
|
|
535
|
+
[key: string]: string;
|
|
536
|
+
};
|
|
455
537
|
/**
|
|
456
538
|
* Model obtained from an external authentication provider, such as HuggingFace, OpenAI, etc...
|
|
457
539
|
*/
|
|
@@ -505,6 +587,33 @@ export type IntegrationModel = {
|
|
|
505
587
|
*/
|
|
506
588
|
trending_score?: number;
|
|
507
589
|
};
|
|
590
|
+
/**
|
|
591
|
+
* Integration organization
|
|
592
|
+
*/
|
|
593
|
+
export type IntegrationOrganization = {
|
|
594
|
+
/**
|
|
595
|
+
* Provider organization avatar URL
|
|
596
|
+
*/
|
|
597
|
+
avatar_url?: string;
|
|
598
|
+
/**
|
|
599
|
+
* Provider organization display name
|
|
600
|
+
*/
|
|
601
|
+
displayName?: string;
|
|
602
|
+
/**
|
|
603
|
+
* Provider organization ID
|
|
604
|
+
*/
|
|
605
|
+
id?: string;
|
|
606
|
+
/**
|
|
607
|
+
* Provider organization name
|
|
608
|
+
*/
|
|
609
|
+
name?: string;
|
|
610
|
+
};
|
|
611
|
+
/**
|
|
612
|
+
* Integration query params
|
|
613
|
+
*/
|
|
614
|
+
export type IntegrationQueryParams = {
|
|
615
|
+
[key: string]: string;
|
|
616
|
+
};
|
|
508
617
|
/**
|
|
509
618
|
* Integration repository
|
|
510
619
|
*/
|
|
@@ -801,6 +910,10 @@ export type Metrics = {
|
|
|
801
910
|
rpsPerCode?: {
|
|
802
911
|
[key: string]: unknown;
|
|
803
912
|
};
|
|
913
|
+
/**
|
|
914
|
+
* Metrics for sandboxes
|
|
915
|
+
*/
|
|
916
|
+
sandboxes?: unknown;
|
|
804
917
|
};
|
|
805
918
|
/**
|
|
806
919
|
* Logical object representing a model
|
|
@@ -1105,6 +1218,10 @@ export type PreviewSpec = {
|
|
|
1105
1218
|
* Port of the preview
|
|
1106
1219
|
*/
|
|
1107
1220
|
port?: number;
|
|
1221
|
+
/**
|
|
1222
|
+
* Prefix URL
|
|
1223
|
+
*/
|
|
1224
|
+
prefixUrl?: string;
|
|
1108
1225
|
/**
|
|
1109
1226
|
* Whether the preview is public
|
|
1110
1227
|
*/
|
|
@@ -1159,13 +1276,9 @@ export type PreviewTokenSpec = {
|
|
|
1159
1276
|
*/
|
|
1160
1277
|
expiresAt?: string;
|
|
1161
1278
|
/**
|
|
1162
|
-
*
|
|
1163
|
-
*/
|
|
1164
|
-
jwt?: string;
|
|
1165
|
-
/**
|
|
1166
|
-
* Whether the token is public
|
|
1279
|
+
* Token
|
|
1167
1280
|
*/
|
|
1168
|
-
|
|
1281
|
+
token?: string;
|
|
1169
1282
|
};
|
|
1170
1283
|
/**
|
|
1171
1284
|
* A private cluster where models can be located on.
|
|
@@ -1621,18 +1734,6 @@ export type SandboxSpec = CoreSpec & unknown;
|
|
|
1621
1734
|
* Name of a Sandbox definition
|
|
1622
1735
|
*/
|
|
1623
1736
|
export type SandboxStoreDefinitionName = unknown;
|
|
1624
|
-
/**
|
|
1625
|
-
* Micro VM for running agentic tasks
|
|
1626
|
-
*/
|
|
1627
|
-
export type Sandboxes = {
|
|
1628
|
-
events?: CoreEvents;
|
|
1629
|
-
metadata?: Metadata;
|
|
1630
|
-
spec?: SandboxSpec;
|
|
1631
|
-
/**
|
|
1632
|
-
* Sandbox status
|
|
1633
|
-
*/
|
|
1634
|
-
status?: string;
|
|
1635
|
-
};
|
|
1636
1737
|
/**
|
|
1637
1738
|
* Configuration for a serverless deployment
|
|
1638
1739
|
*/
|
|
@@ -2286,8 +2387,9 @@ export type GetIntegrationResponses = {
|
|
|
2286
2387
|
/**
|
|
2287
2388
|
* successful operation
|
|
2288
2389
|
*/
|
|
2289
|
-
200:
|
|
2390
|
+
200: Integration;
|
|
2290
2391
|
};
|
|
2392
|
+
export type GetIntegrationResponse = GetIntegrationResponses[keyof GetIntegrationResponses];
|
|
2291
2393
|
export type ListIntegrationConnectionsData = {
|
|
2292
2394
|
body?: never;
|
|
2293
2395
|
path?: never;
|
|
@@ -3131,7 +3233,7 @@ export type UpdateSandboxPreviewResponses = {
|
|
|
3131
3233
|
200: Preview;
|
|
3132
3234
|
};
|
|
3133
3235
|
export type UpdateSandboxPreviewResponse = UpdateSandboxPreviewResponses[keyof UpdateSandboxPreviewResponses];
|
|
3134
|
-
export type
|
|
3236
|
+
export type ListSandboxPreviewTokensData = {
|
|
3135
3237
|
body?: never;
|
|
3136
3238
|
path: {
|
|
3137
3239
|
/**
|
|
@@ -3146,22 +3248,13 @@ export type GetSandboxPreviewTokensData = {
|
|
|
3146
3248
|
query?: never;
|
|
3147
3249
|
url: '/sandboxes/{sandboxName}/previews/{previewName}/tokens';
|
|
3148
3250
|
};
|
|
3149
|
-
export type
|
|
3251
|
+
export type ListSandboxPreviewTokensResponses = {
|
|
3150
3252
|
/**
|
|
3151
3253
|
* successful operation
|
|
3152
3254
|
*/
|
|
3153
|
-
200: Array<
|
|
3154
|
-
/**
|
|
3155
|
-
* When the token was created
|
|
3156
|
-
*/
|
|
3157
|
-
created_at?: string;
|
|
3158
|
-
/**
|
|
3159
|
-
* The name of the token
|
|
3160
|
-
*/
|
|
3161
|
-
name?: string;
|
|
3162
|
-
}>;
|
|
3255
|
+
200: Array<PreviewToken>;
|
|
3163
3256
|
};
|
|
3164
|
-
export type
|
|
3257
|
+
export type ListSandboxPreviewTokensResponse = ListSandboxPreviewTokensResponses[keyof ListSandboxPreviewTokensResponses];
|
|
3165
3258
|
export type CreateSandboxPreviewTokenData = {
|
|
3166
3259
|
body: PreviewToken;
|
|
3167
3260
|
path: {
|
|
@@ -3181,12 +3274,7 @@ export type CreateSandboxPreviewTokenResponses = {
|
|
|
3181
3274
|
/**
|
|
3182
3275
|
* successful operation
|
|
3183
3276
|
*/
|
|
3184
|
-
200:
|
|
3185
|
-
/**
|
|
3186
|
-
* The generated token for the preview
|
|
3187
|
-
*/
|
|
3188
|
-
token?: string;
|
|
3189
|
-
};
|
|
3277
|
+
200: PreviewToken;
|
|
3190
3278
|
};
|
|
3191
3279
|
export type CreateSandboxPreviewTokenResponse = CreateSandboxPreviewTokenResponses[keyof CreateSandboxPreviewTokenResponses];
|
|
3192
3280
|
export type DeleteSandboxPreviewTokenData = {
|
package/dist/common/env.js
CHANGED
|
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.env = void 0;
|
|
7
7
|
/* eslint-disable */
|
|
8
|
+
const dotenv_1 = __importDefault(require("dotenv"));
|
|
8
9
|
const toml_1 = __importDefault(require("toml"));
|
|
9
10
|
const node_js_1 = require("./node.js");
|
|
10
11
|
const secretEnv = {};
|
|
@@ -20,13 +21,8 @@ if (node_js_1.fs !== null) {
|
|
|
20
21
|
catch (error) { }
|
|
21
22
|
try {
|
|
22
23
|
const secretFile = node_js_1.fs.readFileSync(".env", "utf8");
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
const [key, value] = line.split("=");
|
|
28
|
-
secretEnv[key] = value;
|
|
29
|
-
});
|
|
24
|
+
const parsed = dotenv_1.default.parse(secretFile);
|
|
25
|
+
Object.assign(secretEnv, parsed);
|
|
30
26
|
}
|
|
31
27
|
catch (error) { }
|
|
32
28
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Transport } from "@modelcontextprotocol/sdk/shared/transport.js";
|
|
2
|
+
import { JSONRPCMessage } from "@modelcontextprotocol/sdk/types.js";
|
|
3
|
+
export declare class BlaxelHttpMcpServerTransport implements Transport {
|
|
4
|
+
private server;
|
|
5
|
+
constructor(port: number);
|
|
6
|
+
start(): Promise<void>;
|
|
7
|
+
send(msg: JSONRPCMessage): Promise<void>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BlaxelHttpMcpServerTransport = void 0;
|
|
4
|
+
const streamableHttp_js_1 = require("@modelcontextprotocol/sdk/server/streamableHttp.js");
|
|
5
|
+
class BlaxelHttpMcpServerTransport {
|
|
6
|
+
server;
|
|
7
|
+
constructor(port) {
|
|
8
|
+
this.server = new streamableHttp_js_1.StreamableHTTPServerTransport({ port });
|
|
9
|
+
}
|
|
10
|
+
async start() {
|
|
11
|
+
await this.server.start();
|
|
12
|
+
}
|
|
13
|
+
async send(msg) {
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.BlaxelHttpMcpServerTransport = BlaxelHttpMcpServerTransport;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.BlaxelMcpServerTransport = void 0;
|
|
18
|
+
__exportStar(require("./http.js"), exports);
|
|
19
|
+
__exportStar(require("./websocket.js"), exports);
|
|
20
|
+
const websocket_js_1 = require("./websocket.js");
|
|
21
|
+
exports.BlaxelMcpServerTransport = websocket_js_1.BlaxelWebsocketMcpServerTransport;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Transport } from "@modelcontextprotocol/sdk/shared/transport.js";
|
|
2
|
+
interface JSONRPCMessage {
|
|
3
|
+
jsonrpc: "2.0";
|
|
4
|
+
id?: string | number;
|
|
5
|
+
method?: string;
|
|
6
|
+
params?: Record<string, unknown>;
|
|
7
|
+
}
|
|
8
|
+
export declare class BlaxelWebsocketMcpServerTransport implements Transport {
|
|
9
|
+
private port;
|
|
10
|
+
private wss;
|
|
11
|
+
private clients;
|
|
12
|
+
onclose?: () => void;
|
|
13
|
+
onerror?: (err: Error) => void;
|
|
14
|
+
private messageHandler?;
|
|
15
|
+
onconnection?: (clientId: string) => void;
|
|
16
|
+
ondisconnection?: (clientId: string) => void;
|
|
17
|
+
set onmessage(handler: ((message: JSONRPCMessage) => void) | undefined);
|
|
18
|
+
constructor(port?: number);
|
|
19
|
+
start(): Promise<void>;
|
|
20
|
+
send(msg: JSONRPCMessage): Promise<void>;
|
|
21
|
+
broadcast(msg: JSONRPCMessage): Promise<void>;
|
|
22
|
+
close(): Promise<void>;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.BlaxelWebsocketMcpServerTransport = void 0;
|
|
37
|
+
const uuid_1 = require("uuid");
|
|
38
|
+
const ws_1 = __importStar(require("ws"));
|
|
39
|
+
const env_js_1 = require("../../common/env.js");
|
|
40
|
+
const logger_js_1 = require("../../common/logger.js");
|
|
41
|
+
const telemetry_js_1 = require("../../telemetry/telemetry.js");
|
|
42
|
+
const spans = new Map();
|
|
43
|
+
class BlaxelWebsocketMcpServerTransport {
|
|
44
|
+
port;
|
|
45
|
+
wss;
|
|
46
|
+
clients = new Map();
|
|
47
|
+
onclose;
|
|
48
|
+
onerror;
|
|
49
|
+
messageHandler;
|
|
50
|
+
onconnection;
|
|
51
|
+
ondisconnection;
|
|
52
|
+
set onmessage(handler) {
|
|
53
|
+
this.messageHandler = handler
|
|
54
|
+
? (msg, clientId) => {
|
|
55
|
+
if (!("id" in msg)) {
|
|
56
|
+
return handler(msg);
|
|
57
|
+
}
|
|
58
|
+
return handler({
|
|
59
|
+
...msg,
|
|
60
|
+
id: clientId + ":" + msg.id,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
: undefined;
|
|
64
|
+
}
|
|
65
|
+
constructor(port) {
|
|
66
|
+
this.port = port ?? parseInt(env_js_1.env.BL_SERVER_PORT ?? "8080", 10);
|
|
67
|
+
this.wss = new ws_1.WebSocketServer({ port: this.port });
|
|
68
|
+
}
|
|
69
|
+
async start() {
|
|
70
|
+
logger_js_1.logger.info("Starting WebSocket Server on port " + this.port);
|
|
71
|
+
this.wss.on("connection", (ws) => {
|
|
72
|
+
const clientId = (0, uuid_1.v4)();
|
|
73
|
+
this.clients.set(clientId, {
|
|
74
|
+
ws,
|
|
75
|
+
});
|
|
76
|
+
this.onconnection?.(clientId);
|
|
77
|
+
ws.on("message", (data) => {
|
|
78
|
+
const span = (0, telemetry_js_1.startSpan)("message", {
|
|
79
|
+
attributes: {
|
|
80
|
+
"mcp.client.id": clientId,
|
|
81
|
+
"span.type": "mcp.message",
|
|
82
|
+
},
|
|
83
|
+
isRoot: false,
|
|
84
|
+
});
|
|
85
|
+
try {
|
|
86
|
+
const msg = JSON.parse(data.toString());
|
|
87
|
+
this.messageHandler?.(msg, clientId);
|
|
88
|
+
if ("method" in msg && "id" in msg && "params" in msg) {
|
|
89
|
+
span.setAttributes({
|
|
90
|
+
"mcp.message.parsed": true,
|
|
91
|
+
"mcp.method": msg.method,
|
|
92
|
+
"mcp.messageId": msg.id,
|
|
93
|
+
"mcp.toolName": msg.params?.name,
|
|
94
|
+
});
|
|
95
|
+
spans.set(clientId + ":" + msg.id, span);
|
|
96
|
+
}
|
|
97
|
+
// Handle msg.id safely
|
|
98
|
+
const msgId = msg.id ? String(msg.id) : "";
|
|
99
|
+
const [cId, parsedMsgId] = msgId.split(":");
|
|
100
|
+
msg.id = parsedMsgId ? parseInt(parsedMsgId) : undefined;
|
|
101
|
+
// Use optional chaining for safe access
|
|
102
|
+
const client = this.clients.get(cId ?? "");
|
|
103
|
+
if (client?.ws?.readyState === ws_1.default.OPEN) {
|
|
104
|
+
const msgSpan = spans.get(cId + ":" + (msg.id ?? ""));
|
|
105
|
+
try {
|
|
106
|
+
client.ws.send(JSON.stringify(msg));
|
|
107
|
+
if (msgSpan) {
|
|
108
|
+
msgSpan.setAttributes({
|
|
109
|
+
"mcp.message.response_sent": true,
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
catch (err) {
|
|
114
|
+
if (msgSpan) {
|
|
115
|
+
msgSpan.setStatus("error"); // Error status
|
|
116
|
+
msgSpan.recordException(err);
|
|
117
|
+
}
|
|
118
|
+
throw err;
|
|
119
|
+
}
|
|
120
|
+
finally {
|
|
121
|
+
if (msgSpan) {
|
|
122
|
+
msgSpan.end();
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
this.clients.delete(cId);
|
|
128
|
+
this.ondisconnection?.(cId);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
catch (err) {
|
|
132
|
+
if (err instanceof Error) {
|
|
133
|
+
span.setStatus("error"); // Error status
|
|
134
|
+
span.recordException(err);
|
|
135
|
+
this.onerror?.(err);
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
this.onerror?.(new Error(`Failed to parse message: ${String(err)}`));
|
|
139
|
+
}
|
|
140
|
+
span.end();
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
ws.on("close", () => {
|
|
144
|
+
this.clients.delete(clientId);
|
|
145
|
+
this.ondisconnection?.(clientId);
|
|
146
|
+
});
|
|
147
|
+
ws.on("error", (err) => {
|
|
148
|
+
this.onerror?.(err);
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
return Promise.resolve();
|
|
152
|
+
}
|
|
153
|
+
async send(msg) {
|
|
154
|
+
const [cId, msgId] = msg.id ? String(msg.id).split(":") : [];
|
|
155
|
+
msg.id = parseInt(msgId);
|
|
156
|
+
const data = JSON.stringify(msg);
|
|
157
|
+
const deadClients = [];
|
|
158
|
+
if (cId) {
|
|
159
|
+
// Send to specific client
|
|
160
|
+
const client = this.clients.get(cId);
|
|
161
|
+
if (client?.ws?.readyState === ws_1.default.OPEN) {
|
|
162
|
+
const msgSpan = spans.get(cId + ":" + msg.id);
|
|
163
|
+
try {
|
|
164
|
+
client.ws.send(data);
|
|
165
|
+
if (msgSpan) {
|
|
166
|
+
msgSpan.setAttributes({
|
|
167
|
+
"mcp.message.response_sent": true,
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
catch (err) {
|
|
172
|
+
if (msgSpan) {
|
|
173
|
+
msgSpan.setStatus("error"); // Error status
|
|
174
|
+
msgSpan.recordException(err);
|
|
175
|
+
}
|
|
176
|
+
throw err;
|
|
177
|
+
}
|
|
178
|
+
finally {
|
|
179
|
+
if (msgSpan) {
|
|
180
|
+
msgSpan.end();
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
this.clients.delete(cId);
|
|
186
|
+
this.ondisconnection?.(cId);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
for (const [id, client] of this.clients.entries()) {
|
|
190
|
+
if (client.ws.readyState !== ws_1.default.OPEN) {
|
|
191
|
+
deadClients.push(id);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
// Cleanup dead clients
|
|
195
|
+
deadClients.forEach((id) => {
|
|
196
|
+
this.clients.delete(id);
|
|
197
|
+
this.ondisconnection?.(id);
|
|
198
|
+
});
|
|
199
|
+
return Promise.resolve();
|
|
200
|
+
}
|
|
201
|
+
async broadcast(msg) {
|
|
202
|
+
return this.send(msg);
|
|
203
|
+
}
|
|
204
|
+
async close() {
|
|
205
|
+
return new Promise((resolve) => {
|
|
206
|
+
this.wss.close(() => {
|
|
207
|
+
this.clients.clear();
|
|
208
|
+
resolve();
|
|
209
|
+
});
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
exports.BlaxelWebsocketMcpServerTransport = BlaxelWebsocketMcpServerTransport;
|
|
@@ -22,7 +22,7 @@ export declare const deleteFilesystemByPath: <ThrowOnError extends boolean = fal
|
|
|
22
22
|
* Get file or directory information
|
|
23
23
|
* Get content of a file or listing of a directory
|
|
24
24
|
*/
|
|
25
|
-
export declare const getFilesystemByPath: <ThrowOnError extends boolean = false>(options: Options<GetFilesystemByPathData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").
|
|
25
|
+
export declare const getFilesystemByPath: <ThrowOnError extends boolean = false>(options: Options<GetFilesystemByPathData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").Directory | import("./types.gen").FileWithContent, import("./types.gen").ErrorResponse, ThrowOnError>;
|
|
26
26
|
/**
|
|
27
27
|
* Create or update file or directory
|
|
28
28
|
* Create or update a file or directory
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
export type Directory = {
|
|
2
|
+
files?: Array<File>;
|
|
3
|
+
path?: string;
|
|
4
|
+
/**
|
|
5
|
+
* @name Subdirectories
|
|
6
|
+
*/
|
|
7
|
+
subdirectories?: Array<Subdirectory>;
|
|
8
|
+
};
|
|
1
9
|
export type ErrorResponse = {
|
|
2
10
|
error?: string;
|
|
3
11
|
};
|
|
@@ -6,9 +14,6 @@ export type File = {
|
|
|
6
14
|
lastModified?: string;
|
|
7
15
|
owner?: string;
|
|
8
16
|
path?: string;
|
|
9
|
-
/**
|
|
10
|
-
* swagger:strfmt string
|
|
11
|
-
*/
|
|
12
17
|
permissions?: string;
|
|
13
18
|
size?: number;
|
|
14
19
|
};
|
|
@@ -23,9 +28,6 @@ export type FileWithContent = {
|
|
|
23
28
|
lastModified?: string;
|
|
24
29
|
owner?: string;
|
|
25
30
|
path?: string;
|
|
26
|
-
/**
|
|
27
|
-
* swagger:strfmt string
|
|
28
|
-
*/
|
|
29
31
|
permissions?: string;
|
|
30
32
|
size?: number;
|
|
31
33
|
};
|
|
@@ -57,17 +59,12 @@ export type ProcessResponse = {
|
|
|
57
59
|
status?: string;
|
|
58
60
|
workingDir?: string;
|
|
59
61
|
};
|
|
60
|
-
export type
|
|
61
|
-
message?: string;
|
|
62
|
+
export type Subdirectory = {
|
|
62
63
|
path?: string;
|
|
63
64
|
};
|
|
64
|
-
export type
|
|
65
|
-
|
|
65
|
+
export type SuccessResponse = {
|
|
66
|
+
message?: string;
|
|
66
67
|
path?: string;
|
|
67
|
-
/**
|
|
68
|
-
* @name Subdirectories
|
|
69
|
-
*/
|
|
70
|
-
subdirectories?: Array<Directory>;
|
|
71
68
|
};
|
|
72
69
|
export type DeleteFilesystemByPathData = {
|
|
73
70
|
body?: never;
|
|
@@ -1,6 +1,24 @@
|
|
|
1
|
-
import { Preview, Sandbox } from "../client/index.js";
|
|
1
|
+
import { Preview, PreviewToken, Sandbox } from "../client/index.js";
|
|
2
|
+
export declare class SandboxPreviewToken {
|
|
3
|
+
private previewToken;
|
|
4
|
+
constructor(previewToken: PreviewToken);
|
|
5
|
+
get value(): string;
|
|
6
|
+
get expiresAt(): string | Date;
|
|
7
|
+
}
|
|
8
|
+
export declare class SandboxPreviewTokens {
|
|
9
|
+
private preview;
|
|
10
|
+
constructor(preview: Preview);
|
|
11
|
+
get previewName(): string;
|
|
12
|
+
get resourceName(): string;
|
|
13
|
+
create(expiresAt: Date): Promise<SandboxPreviewToken>;
|
|
14
|
+
list(): Promise<SandboxPreviewToken[]>;
|
|
15
|
+
delete(tokenName: string): Promise<{
|
|
16
|
+
message?: string;
|
|
17
|
+
}>;
|
|
18
|
+
}
|
|
2
19
|
export declare class SandboxPreview {
|
|
3
20
|
private preview;
|
|
21
|
+
tokens: SandboxPreviewTokens;
|
|
4
22
|
constructor(preview: Preview);
|
|
5
23
|
get name(): string;
|
|
6
24
|
get metadata(): import("../client/types.gen.js").PreviewMetadata | undefined;
|
package/dist/sandbox/preview.js
CHANGED
|
@@ -1,11 +1,75 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SandboxPreviews = exports.SandboxPreview = void 0;
|
|
3
|
+
exports.SandboxPreviews = exports.SandboxPreview = exports.SandboxPreviewTokens = exports.SandboxPreviewToken = void 0;
|
|
4
4
|
const index_js_1 = require("../client/index.js");
|
|
5
|
+
class SandboxPreviewToken {
|
|
6
|
+
previewToken;
|
|
7
|
+
constructor(previewToken) {
|
|
8
|
+
this.previewToken = previewToken;
|
|
9
|
+
}
|
|
10
|
+
get value() {
|
|
11
|
+
return this.previewToken.spec?.token ?? "";
|
|
12
|
+
}
|
|
13
|
+
get expiresAt() {
|
|
14
|
+
return this.previewToken.spec?.expiresAt ?? new Date();
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.SandboxPreviewToken = SandboxPreviewToken;
|
|
18
|
+
class SandboxPreviewTokens {
|
|
19
|
+
preview;
|
|
20
|
+
constructor(preview) {
|
|
21
|
+
this.preview = preview;
|
|
22
|
+
}
|
|
23
|
+
get previewName() {
|
|
24
|
+
return this.preview.metadata?.name ?? "";
|
|
25
|
+
}
|
|
26
|
+
get resourceName() {
|
|
27
|
+
return this.preview.metadata?.resourceName ?? "";
|
|
28
|
+
}
|
|
29
|
+
async create(expiresAt) {
|
|
30
|
+
const { data } = await (0, index_js_1.createSandboxPreviewToken)({
|
|
31
|
+
path: {
|
|
32
|
+
sandboxName: this.resourceName,
|
|
33
|
+
previewName: this.previewName,
|
|
34
|
+
},
|
|
35
|
+
body: {
|
|
36
|
+
spec: {
|
|
37
|
+
expiresAt: expiresAt.toISOString(),
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
throwOnError: true,
|
|
41
|
+
});
|
|
42
|
+
return new SandboxPreviewToken(data);
|
|
43
|
+
}
|
|
44
|
+
async list() {
|
|
45
|
+
const { data } = await (0, index_js_1.listSandboxPreviewTokens)({
|
|
46
|
+
path: {
|
|
47
|
+
sandboxName: this.resourceName,
|
|
48
|
+
previewName: this.previewName,
|
|
49
|
+
},
|
|
50
|
+
throwOnError: true,
|
|
51
|
+
});
|
|
52
|
+
return data.map((token) => new SandboxPreviewToken(token));
|
|
53
|
+
}
|
|
54
|
+
async delete(tokenName) {
|
|
55
|
+
const { data } = await (0, index_js_1.deleteSandboxPreviewToken)({
|
|
56
|
+
path: {
|
|
57
|
+
sandboxName: this.resourceName,
|
|
58
|
+
previewName: this.previewName,
|
|
59
|
+
tokenName,
|
|
60
|
+
},
|
|
61
|
+
throwOnError: true,
|
|
62
|
+
});
|
|
63
|
+
return data;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
exports.SandboxPreviewTokens = SandboxPreviewTokens;
|
|
5
67
|
class SandboxPreview {
|
|
6
68
|
preview;
|
|
69
|
+
tokens;
|
|
7
70
|
constructor(preview) {
|
|
8
71
|
this.preview = preview;
|
|
72
|
+
this.tokens = new SandboxPreviewTokens(this);
|
|
9
73
|
}
|
|
10
74
|
get name() {
|
|
11
75
|
return this.preview.metadata?.name ?? "";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blaxel/core",
|
|
3
|
-
"version": "0.2.0-
|
|
3
|
+
"version": "0.2.0-preview4",
|
|
4
4
|
"description": "Blaxel Core SDK for TypeScript",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Blaxel, INC (https://blaxel.ai)",
|
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
"@hey-api/client-fetch": "^0.10.0",
|
|
57
57
|
"@modelcontextprotocol/sdk": "^1.11.0",
|
|
58
58
|
"crypto": "^1.0.1",
|
|
59
|
+
"dotenv": "^16.5.0",
|
|
59
60
|
"jwt-decode": "^4.0.0",
|
|
60
61
|
"toml": "^3.0.0",
|
|
61
62
|
"uuid": "^11.1.0",
|
|
@@ -71,6 +72,7 @@
|
|
|
71
72
|
},
|
|
72
73
|
"scripts": {
|
|
73
74
|
"lint": "eslint src/",
|
|
75
|
+
"dev": "tsc --watch",
|
|
74
76
|
"build": "tsc"
|
|
75
77
|
}
|
|
76
78
|
}
|