@blaxel/core 0.2.0-preview5 → 0.2.1-dev.46
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 +1 -31
- package/dist/client/sdk.gen.js +2 -112
- package/dist/client/types.gen.d.ts +0 -122
- package/dist/common/internal.d.ts +1 -1
- package/dist/common/internal.js +6 -3
- package/dist/common/settings.d.ts +0 -2
- package/dist/common/settings.js +0 -9
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/sandbox/action.d.ts +4 -4
- package/dist/sandbox/action.js +34 -16
- package/dist/sandbox/client/sdk.gen.d.ts +1 -1
- package/dist/sandbox/client/types.gen.d.ts +11 -14
- package/dist/sandbox/filesystem.d.ts +20 -0
- package/dist/sandbox/filesystem.js +124 -7
- package/dist/sandbox/process.d.ts +15 -0
- package/dist/sandbox/process.js +114 -8
- package/dist/sandbox/sandbox.d.ts +1 -5
- package/dist/sandbox/sandbox.js +0 -6
- package/dist/telemetry/telemetry.d.ts +0 -1
- package/dist/telemetry/telemetry.js +0 -14
- package/package.json +1 -3
- package/dist/jobs/index.d.ts +0 -1
- package/dist/jobs/index.js +0 -17
- package/dist/jobs/jobs.d.ts +0 -10
- package/dist/jobs/jobs.js +0 -42
- package/dist/mcp/server/http.d.ts +0 -8
- package/dist/mcp/server/http.js +0 -16
- package/dist/mcp/server/index.d.ts +0 -4
- package/dist/mcp/server/index.js +0 -21
- package/dist/mcp/server/websocket.d.ts +0 -24
- package/dist/mcp/server/websocket.js +0 -213
- package/dist/sandbox/session.d.ts +0 -21
- package/dist/sandbox/session.js +0 -97
- package/dist/sandbox/types.d.ts +0 -15
- package/dist/sandbox/types.js +0 -2
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,
|
|
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
|
|
@@ -111,36 +111,6 @@ export declare const listIntegrationConnectionModels: <ThrowOnError extends bool
|
|
|
111
111
|
* Returns a model for an integration connection by ID.
|
|
112
112
|
*/
|
|
113
113
|
export declare const getIntegrationConnectionModel: <ThrowOnError extends boolean = false>(options: Options<GetIntegrationConnectionModelData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<unknown, unknown, ThrowOnError>;
|
|
114
|
-
/**
|
|
115
|
-
* List jobs
|
|
116
|
-
* Returns a list of all jobs in the workspace.
|
|
117
|
-
*/
|
|
118
|
-
export declare const listJobs: <ThrowOnError extends boolean = false>(options?: Options<ListJobsData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen.js").Job[], unknown, ThrowOnError>;
|
|
119
|
-
/**
|
|
120
|
-
* Create job
|
|
121
|
-
* Creates a job.
|
|
122
|
-
*/
|
|
123
|
-
export declare const createJob: <ThrowOnError extends boolean = false>(options: Options<CreateJobData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen.js").Job, unknown, ThrowOnError>;
|
|
124
|
-
/**
|
|
125
|
-
* Delete job
|
|
126
|
-
* Deletes a job by name.
|
|
127
|
-
*/
|
|
128
|
-
export declare const deleteJob: <ThrowOnError extends boolean = false>(options: Options<DeleteJobData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen.js").Job, unknown, ThrowOnError>;
|
|
129
|
-
/**
|
|
130
|
-
* Get job
|
|
131
|
-
* Returns a job by name.
|
|
132
|
-
*/
|
|
133
|
-
export declare const getJob: <ThrowOnError extends boolean = false>(options: Options<GetJobData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen.js").Model, unknown, ThrowOnError>;
|
|
134
|
-
/**
|
|
135
|
-
* Create or update job
|
|
136
|
-
* Update a job by name.
|
|
137
|
-
*/
|
|
138
|
-
export declare const updateJob: <ThrowOnError extends boolean = false>(options: Options<UpdateJobData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen.js").Job, unknown, ThrowOnError>;
|
|
139
|
-
/**
|
|
140
|
-
* List job revisions
|
|
141
|
-
* Returns revisions for a job by name.
|
|
142
|
-
*/
|
|
143
|
-
export declare const listJobRevisions: <ThrowOnError extends boolean = false>(options: Options<ListJobRevisionsData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen.js").RevisionMetadata[], unknown, ThrowOnError>;
|
|
144
114
|
/**
|
|
145
115
|
* List knowledgebases
|
|
146
116
|
* Returns a list of all knowledgebases in the workspace.
|
package/dist/client/sdk.gen.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
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 =
|
|
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.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
|
|
@@ -390,116 +390,6 @@ const getIntegrationConnectionModel = (options) => {
|
|
|
390
390
|
});
|
|
391
391
|
};
|
|
392
392
|
exports.getIntegrationConnectionModel = getIntegrationConnectionModel;
|
|
393
|
-
/**
|
|
394
|
-
* List jobs
|
|
395
|
-
* Returns a list of all jobs in the workspace.
|
|
396
|
-
*/
|
|
397
|
-
const listJobs = (options) => {
|
|
398
|
-
return (options?.client ?? client_gen_1.client).get({
|
|
399
|
-
security: [
|
|
400
|
-
{
|
|
401
|
-
scheme: 'bearer',
|
|
402
|
-
type: 'http'
|
|
403
|
-
}
|
|
404
|
-
],
|
|
405
|
-
url: '/jobs',
|
|
406
|
-
...options
|
|
407
|
-
});
|
|
408
|
-
};
|
|
409
|
-
exports.listJobs = listJobs;
|
|
410
|
-
/**
|
|
411
|
-
* Create job
|
|
412
|
-
* Creates a job.
|
|
413
|
-
*/
|
|
414
|
-
const createJob = (options) => {
|
|
415
|
-
return (options.client ?? client_gen_1.client).post({
|
|
416
|
-
security: [
|
|
417
|
-
{
|
|
418
|
-
scheme: 'bearer',
|
|
419
|
-
type: 'http'
|
|
420
|
-
}
|
|
421
|
-
],
|
|
422
|
-
url: '/jobs',
|
|
423
|
-
...options,
|
|
424
|
-
headers: {
|
|
425
|
-
'Content-Type': 'application/json',
|
|
426
|
-
...options?.headers
|
|
427
|
-
}
|
|
428
|
-
});
|
|
429
|
-
};
|
|
430
|
-
exports.createJob = createJob;
|
|
431
|
-
/**
|
|
432
|
-
* Delete job
|
|
433
|
-
* Deletes a job by name.
|
|
434
|
-
*/
|
|
435
|
-
const deleteJob = (options) => {
|
|
436
|
-
return (options.client ?? client_gen_1.client).delete({
|
|
437
|
-
security: [
|
|
438
|
-
{
|
|
439
|
-
scheme: 'bearer',
|
|
440
|
-
type: 'http'
|
|
441
|
-
}
|
|
442
|
-
],
|
|
443
|
-
url: '/jobs/{jobId}',
|
|
444
|
-
...options
|
|
445
|
-
});
|
|
446
|
-
};
|
|
447
|
-
exports.deleteJob = deleteJob;
|
|
448
|
-
/**
|
|
449
|
-
* Get job
|
|
450
|
-
* Returns a job by name.
|
|
451
|
-
*/
|
|
452
|
-
const getJob = (options) => {
|
|
453
|
-
return (options.client ?? client_gen_1.client).get({
|
|
454
|
-
security: [
|
|
455
|
-
{
|
|
456
|
-
scheme: 'bearer',
|
|
457
|
-
type: 'http'
|
|
458
|
-
}
|
|
459
|
-
],
|
|
460
|
-
url: '/jobs/{jobId}',
|
|
461
|
-
...options
|
|
462
|
-
});
|
|
463
|
-
};
|
|
464
|
-
exports.getJob = getJob;
|
|
465
|
-
/**
|
|
466
|
-
* Create or update job
|
|
467
|
-
* Update a job by name.
|
|
468
|
-
*/
|
|
469
|
-
const updateJob = (options) => {
|
|
470
|
-
return (options.client ?? client_gen_1.client).put({
|
|
471
|
-
security: [
|
|
472
|
-
{
|
|
473
|
-
scheme: 'bearer',
|
|
474
|
-
type: 'http'
|
|
475
|
-
}
|
|
476
|
-
],
|
|
477
|
-
url: '/jobs/{jobId}',
|
|
478
|
-
...options,
|
|
479
|
-
headers: {
|
|
480
|
-
'Content-Type': 'application/json',
|
|
481
|
-
...options?.headers
|
|
482
|
-
}
|
|
483
|
-
});
|
|
484
|
-
};
|
|
485
|
-
exports.updateJob = updateJob;
|
|
486
|
-
/**
|
|
487
|
-
* List job revisions
|
|
488
|
-
* Returns revisions for a job by name.
|
|
489
|
-
*/
|
|
490
|
-
const listJobRevisions = (options) => {
|
|
491
|
-
return (options.client ?? client_gen_1.client).get({
|
|
492
|
-
security: [
|
|
493
|
-
{
|
|
494
|
-
scheme: 'bearer',
|
|
495
|
-
type: 'http'
|
|
496
|
-
}
|
|
497
|
-
],
|
|
498
|
-
url: '/jobs/{jobId}/revisions',
|
|
499
|
-
...options
|
|
500
|
-
});
|
|
501
|
-
};
|
|
502
|
-
exports.listJobRevisions = listJobRevisions;
|
|
503
393
|
/**
|
|
504
394
|
* List knowledgebases
|
|
505
395
|
* Returns a list of all knowledgebases in the workspace.
|
|
@@ -639,22 +639,6 @@ export type IntegrationRepository = {
|
|
|
639
639
|
*/
|
|
640
640
|
url?: string;
|
|
641
641
|
};
|
|
642
|
-
/**
|
|
643
|
-
* Job
|
|
644
|
-
*/
|
|
645
|
-
export type Job = {
|
|
646
|
-
events?: CoreEvents;
|
|
647
|
-
metadata?: Metadata;
|
|
648
|
-
spec?: JobSpec;
|
|
649
|
-
/**
|
|
650
|
-
* Job status
|
|
651
|
-
*/
|
|
652
|
-
status?: string;
|
|
653
|
-
};
|
|
654
|
-
/**
|
|
655
|
-
* Job specification
|
|
656
|
-
*/
|
|
657
|
-
export type JobSpec = CoreSpec & unknown;
|
|
658
642
|
/**
|
|
659
643
|
* Knowledgebase
|
|
660
644
|
*/
|
|
@@ -1640,10 +1624,6 @@ export type Runtime = {
|
|
|
1640
1624
|
* The Docker image for the deployment
|
|
1641
1625
|
*/
|
|
1642
1626
|
image?: string;
|
|
1643
|
-
/**
|
|
1644
|
-
* The maximum number of retries for the deployment
|
|
1645
|
-
*/
|
|
1646
|
-
maxRetries?: number;
|
|
1647
1627
|
/**
|
|
1648
1628
|
* The minimum number of replicas for the deployment. Can be 0 or 1 (in which case the deployment is always running in at least one location).
|
|
1649
1629
|
*/
|
|
@@ -1764,10 +1744,6 @@ export type ServerlessConfig = {
|
|
|
1764
1744
|
configuration?: {
|
|
1765
1745
|
[key: string]: unknown;
|
|
1766
1746
|
};
|
|
1767
|
-
/**
|
|
1768
|
-
* The maximum number of retries for the deployment
|
|
1769
|
-
*/
|
|
1770
|
-
maxRetries?: number;
|
|
1771
1747
|
/**
|
|
1772
1748
|
* The minimum number of replicas for the deployment. Can be 0 or 1 (in which case the deployment is always running in at least one location).
|
|
1773
1749
|
*/
|
|
@@ -2549,104 +2525,6 @@ export type GetIntegrationConnectionModelResponses = {
|
|
|
2549
2525
|
*/
|
|
2550
2526
|
200: unknown;
|
|
2551
2527
|
};
|
|
2552
|
-
export type ListJobsData = {
|
|
2553
|
-
body?: never;
|
|
2554
|
-
path?: never;
|
|
2555
|
-
query?: never;
|
|
2556
|
-
url: '/jobs';
|
|
2557
|
-
};
|
|
2558
|
-
export type ListJobsResponses = {
|
|
2559
|
-
/**
|
|
2560
|
-
* successful operation
|
|
2561
|
-
*/
|
|
2562
|
-
200: Array<Job>;
|
|
2563
|
-
};
|
|
2564
|
-
export type ListJobsResponse = ListJobsResponses[keyof ListJobsResponses];
|
|
2565
|
-
export type CreateJobData = {
|
|
2566
|
-
body: Job;
|
|
2567
|
-
path?: never;
|
|
2568
|
-
query?: never;
|
|
2569
|
-
url: '/jobs';
|
|
2570
|
-
};
|
|
2571
|
-
export type CreateJobResponses = {
|
|
2572
|
-
/**
|
|
2573
|
-
* successful operation
|
|
2574
|
-
*/
|
|
2575
|
-
200: Job;
|
|
2576
|
-
};
|
|
2577
|
-
export type CreateJobResponse = CreateJobResponses[keyof CreateJobResponses];
|
|
2578
|
-
export type DeleteJobData = {
|
|
2579
|
-
body?: never;
|
|
2580
|
-
path: {
|
|
2581
|
-
/**
|
|
2582
|
-
* Name of the job
|
|
2583
|
-
*/
|
|
2584
|
-
jobId: string;
|
|
2585
|
-
};
|
|
2586
|
-
query?: never;
|
|
2587
|
-
url: '/jobs/{jobId}';
|
|
2588
|
-
};
|
|
2589
|
-
export type DeleteJobResponses = {
|
|
2590
|
-
/**
|
|
2591
|
-
* successful operation
|
|
2592
|
-
*/
|
|
2593
|
-
200: Job;
|
|
2594
|
-
};
|
|
2595
|
-
export type DeleteJobResponse = DeleteJobResponses[keyof DeleteJobResponses];
|
|
2596
|
-
export type GetJobData = {
|
|
2597
|
-
body?: never;
|
|
2598
|
-
path: {
|
|
2599
|
-
/**
|
|
2600
|
-
* Name of the job
|
|
2601
|
-
*/
|
|
2602
|
-
jobId: string;
|
|
2603
|
-
};
|
|
2604
|
-
query?: never;
|
|
2605
|
-
url: '/jobs/{jobId}';
|
|
2606
|
-
};
|
|
2607
|
-
export type GetJobResponses = {
|
|
2608
|
-
/**
|
|
2609
|
-
* successful operation
|
|
2610
|
-
*/
|
|
2611
|
-
200: Model;
|
|
2612
|
-
};
|
|
2613
|
-
export type GetJobResponse = GetJobResponses[keyof GetJobResponses];
|
|
2614
|
-
export type UpdateJobData = {
|
|
2615
|
-
body: Job;
|
|
2616
|
-
path: {
|
|
2617
|
-
/**
|
|
2618
|
-
* Name of the job
|
|
2619
|
-
*/
|
|
2620
|
-
jobId: string;
|
|
2621
|
-
};
|
|
2622
|
-
query?: never;
|
|
2623
|
-
url: '/jobs/{jobId}';
|
|
2624
|
-
};
|
|
2625
|
-
export type UpdateJobResponses = {
|
|
2626
|
-
/**
|
|
2627
|
-
* successful operation
|
|
2628
|
-
*/
|
|
2629
|
-
200: Job;
|
|
2630
|
-
};
|
|
2631
|
-
export type UpdateJobResponse = UpdateJobResponses[keyof UpdateJobResponses];
|
|
2632
|
-
export type ListJobRevisionsData = {
|
|
2633
|
-
body?: never;
|
|
2634
|
-
path: {
|
|
2635
|
-
/**
|
|
2636
|
-
* Name of the job
|
|
2637
|
-
*/
|
|
2638
|
-
jobId: string;
|
|
2639
|
-
};
|
|
2640
|
-
query?: never;
|
|
2641
|
-
url: '/jobs/{jobId}/revisions';
|
|
2642
|
-
};
|
|
2643
|
-
export type ListJobRevisionsResponses = {
|
|
2644
|
-
/**
|
|
2645
|
-
* successful operation
|
|
2646
|
-
*/
|
|
2647
|
-
200: Array<RevisionMetadata>;
|
|
2648
|
-
};
|
|
2649
|
-
export type ListJobRevisionsResponse = ListJobRevisionsResponses[keyof ListJobRevisionsResponses];
|
|
2650
2528
|
export type ListKnowledgebasesData = {
|
|
2651
2529
|
body?: never;
|
|
2652
2530
|
path?: never;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function getAlphanumericLimitedHash(input: string, maxSize
|
|
1
|
+
export declare function getAlphanumericLimitedHash(input: string, maxSize: number): string;
|
|
2
2
|
export declare function getGlobalUniqueHash(workspace: string, type: string, name: string): string;
|
package/dist/common/internal.js
CHANGED
|
@@ -6,9 +6,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.getAlphanumericLimitedHash = getAlphanumericLimitedHash;
|
|
7
7
|
exports.getGlobalUniqueHash = getGlobalUniqueHash;
|
|
8
8
|
const crypto_1 = __importDefault(require("crypto"));
|
|
9
|
-
function getAlphanumericLimitedHash(input, maxSize
|
|
10
|
-
const hash = crypto_1.default.createHash(
|
|
11
|
-
|
|
9
|
+
function getAlphanumericLimitedHash(input, maxSize) {
|
|
10
|
+
const hash = crypto_1.default.createHash("sha256").update(input).digest("base64");
|
|
11
|
+
const alphanumeric = hash.replace(/[^a-z0-9]+/g, "");
|
|
12
|
+
return alphanumeric.length > maxSize
|
|
13
|
+
? alphanumeric.substring(0, maxSize)
|
|
14
|
+
: alphanumeric;
|
|
12
15
|
}
|
|
13
16
|
function getGlobalUniqueHash(workspace, type, name) {
|
|
14
17
|
const globalUniqueName = `${workspace}-${type}-${name}`;
|
package/dist/common/settings.js
CHANGED
|
@@ -72,20 +72,11 @@ class Settings {
|
|
|
72
72
|
return env_js_1.env.BL_TYPE || "agents";
|
|
73
73
|
}
|
|
74
74
|
get runInternalHostname() {
|
|
75
|
-
if (!this.generation) {
|
|
76
|
-
return "";
|
|
77
|
-
}
|
|
78
75
|
return env_js_1.env.BL_RUN_INTERNAL_HOSTNAME || "";
|
|
79
76
|
}
|
|
80
77
|
get runInternalProtocol() {
|
|
81
78
|
return env_js_1.env.BL_RUN_INTERNAL_PROTOCOL || "https";
|
|
82
79
|
}
|
|
83
|
-
get blCloud() {
|
|
84
|
-
return env_js_1.env.BL_CLOUD === "true";
|
|
85
|
-
}
|
|
86
|
-
get generation() {
|
|
87
|
-
return env_js_1.env.BL_GENERATION || "";
|
|
88
|
-
}
|
|
89
80
|
get loggerType() {
|
|
90
81
|
return env_js_1.env.BL_LOGGER || "http";
|
|
91
82
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,6 @@ export * from "./common/errors.js";
|
|
|
7
7
|
export * from "./common/internal.js";
|
|
8
8
|
export * from "./common/logger.js";
|
|
9
9
|
export * from "./common/settings.js";
|
|
10
|
-
export * from "./jobs/index.js";
|
|
11
10
|
export * from "./mcp/index.js";
|
|
12
11
|
export * from "./models/index.js";
|
|
13
12
|
export * from "./sandbox/index.js";
|
package/dist/index.js
CHANGED
|
@@ -23,7 +23,6 @@ __exportStar(require("./common/errors.js"), exports);
|
|
|
23
23
|
__exportStar(require("./common/internal.js"), exports);
|
|
24
24
|
__exportStar(require("./common/logger.js"), exports);
|
|
25
25
|
__exportStar(require("./common/settings.js"), exports);
|
|
26
|
-
__exportStar(require("./jobs/index.js"), exports);
|
|
27
26
|
__exportStar(require("./mcp/index.js"), exports);
|
|
28
27
|
__exportStar(require("./models/index.js"), exports);
|
|
29
28
|
__exportStar(require("./sandbox/index.js"), exports);
|
package/dist/sandbox/action.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Sandbox } from "../client/index.js";
|
|
2
2
|
export declare class ResponseError extends Error {
|
|
3
3
|
response: Response;
|
|
4
4
|
data: unknown;
|
|
@@ -6,14 +6,14 @@ export declare class ResponseError extends Error {
|
|
|
6
6
|
constructor(response: Response, data: unknown, error: unknown);
|
|
7
7
|
}
|
|
8
8
|
export declare class SandboxAction {
|
|
9
|
-
|
|
10
|
-
constructor(sandbox:
|
|
9
|
+
private sandbox;
|
|
10
|
+
constructor(sandbox: Sandbox);
|
|
11
11
|
get name(): string;
|
|
12
12
|
get fallbackUrl(): string | null;
|
|
13
13
|
get externalUrl(): string;
|
|
14
14
|
get internalUrl(): string;
|
|
15
|
-
get client(): import("@hey-api/client-fetch").Client;
|
|
16
15
|
get forcedUrl(): string | null;
|
|
17
16
|
get url(): string;
|
|
18
17
|
handleResponseError(response: Response, data: unknown, error: unknown): void;
|
|
18
|
+
websocket(path: string): WebSocket | null;
|
|
19
19
|
}
|
package/dist/sandbox/action.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SandboxAction = exports.ResponseError = void 0;
|
|
4
|
-
const client_fetch_1 = require("@hey-api/client-fetch");
|
|
5
4
|
const process_1 = require("process");
|
|
6
5
|
const internal_js_1 = require("../common/internal.js");
|
|
7
6
|
const settings_js_1 = require("../common/settings.js");
|
|
8
|
-
const client_gen_js_1 = require("./client/client.gen.js");
|
|
9
7
|
class ResponseError extends Error {
|
|
10
8
|
response;
|
|
11
9
|
data;
|
|
@@ -52,18 +50,7 @@ class SandboxAction {
|
|
|
52
50
|
const hash = (0, internal_js_1.getGlobalUniqueHash)(settings_js_1.settings.workspace, "sandbox", this.name);
|
|
53
51
|
return `${settings_js_1.settings.runInternalProtocol}://bl-${settings_js_1.settings.env}-${hash}.${settings_js_1.settings.runInternalHostname}`;
|
|
54
52
|
}
|
|
55
|
-
get client() {
|
|
56
|
-
if (this.sandbox.forceUrl) {
|
|
57
|
-
return (0, client_fetch_1.createClient)({
|
|
58
|
-
baseUrl: this.sandbox.forceUrl,
|
|
59
|
-
headers: this.sandbox.headers,
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
return client_gen_js_1.client;
|
|
63
|
-
}
|
|
64
53
|
get forcedUrl() {
|
|
65
|
-
if (this.sandbox.forceUrl)
|
|
66
|
-
return this.sandbox.forceUrl;
|
|
67
54
|
const envVar = this.name.replace(/-/g, "_").toUpperCase();
|
|
68
55
|
const envName = `BL_SANDBOX_${envVar}_URL`;
|
|
69
56
|
if (process_1.env[envName]) {
|
|
@@ -74,9 +61,8 @@ class SandboxAction {
|
|
|
74
61
|
get url() {
|
|
75
62
|
if (this.forcedUrl)
|
|
76
63
|
return this.forcedUrl;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
// if (settings.runInternalHostname) return this.internalUrl;
|
|
64
|
+
if (settings_js_1.settings.runInternalHostname)
|
|
65
|
+
return this.internalUrl;
|
|
80
66
|
return this.externalUrl;
|
|
81
67
|
}
|
|
82
68
|
handleResponseError(response, data, error) {
|
|
@@ -84,5 +70,37 @@ class SandboxAction {
|
|
|
84
70
|
throw new ResponseError(response, data, error);
|
|
85
71
|
}
|
|
86
72
|
}
|
|
73
|
+
websocket(path) {
|
|
74
|
+
let ws = null;
|
|
75
|
+
// Build ws:// or wss:// URL from baseUrl
|
|
76
|
+
let baseUrl = this.url.replace(/^http/, 'ws');
|
|
77
|
+
if (baseUrl.endsWith('/'))
|
|
78
|
+
baseUrl = baseUrl.slice(0, -1);
|
|
79
|
+
const wsUrl = `${baseUrl}/ws/${path}?token=${settings_js_1.settings.token}`;
|
|
80
|
+
// Use isomorphic WebSocket: browser or Node.js
|
|
81
|
+
let WS = undefined;
|
|
82
|
+
if (typeof globalThis.WebSocket !== 'undefined') {
|
|
83
|
+
WS = globalThis.WebSocket;
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
try {
|
|
87
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
88
|
+
WS = require('ws');
|
|
89
|
+
}
|
|
90
|
+
catch {
|
|
91
|
+
WS = undefined;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
if (!WS)
|
|
95
|
+
throw new Error('WebSocket is not available in this environment');
|
|
96
|
+
try {
|
|
97
|
+
ws = typeof WS === 'function' ? new WS(wsUrl) : new WS(wsUrl);
|
|
98
|
+
}
|
|
99
|
+
catch (err) {
|
|
100
|
+
console.error('WebSocket connection error:', err);
|
|
101
|
+
throw err;
|
|
102
|
+
}
|
|
103
|
+
return ws;
|
|
104
|
+
}
|
|
87
105
|
}
|
|
88
106
|
exports.SandboxAction = SandboxAction;
|
|
@@ -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
|
};
|
|
@@ -56,17 +58,12 @@ export type ProcessResponse = {
|
|
|
56
58
|
status?: string;
|
|
57
59
|
workingDir?: string;
|
|
58
60
|
};
|
|
59
|
-
export type
|
|
60
|
-
message?: string;
|
|
61
|
+
export type Subdirectory = {
|
|
61
62
|
path?: string;
|
|
62
63
|
};
|
|
63
|
-
export type
|
|
64
|
-
|
|
64
|
+
export type SuccessResponse = {
|
|
65
|
+
message?: string;
|
|
65
66
|
path?: string;
|
|
66
|
-
/**
|
|
67
|
-
* @name Subdirectories
|
|
68
|
-
*/
|
|
69
|
-
subdirectories?: Array<Directory>;
|
|
70
67
|
};
|
|
71
68
|
export type DeleteFilesystemByPathData = {
|
|
72
69
|
body?: never;
|
|
@@ -14,7 +14,27 @@ export declare class SandboxFileSystem extends SandboxAction {
|
|
|
14
14
|
rm(path: string, recursive?: boolean): Promise<SuccessResponse>;
|
|
15
15
|
ls(path: string): Promise<Directory>;
|
|
16
16
|
cp(source: string, destination: string): Promise<CopyResponse>;
|
|
17
|
+
/**
|
|
18
|
+
* Watch for changes in a directory. Calls the callback with the changed file path (and optionally its content).
|
|
19
|
+
* Returns a handle with a close() method to stop watching.
|
|
20
|
+
* @param path Directory to watch
|
|
21
|
+
* @param callback Function called on each change: (filePath, content?)
|
|
22
|
+
* @param withContent If true, also fetches and passes the file content (default: false)
|
|
23
|
+
*/
|
|
17
24
|
watch(path: string, callback: (filePath: string, content?: string) => void | Promise<void>, options?: {
|
|
25
|
+
ws?: boolean;
|
|
26
|
+
onError?: (error: Error) => void;
|
|
27
|
+
withContent: boolean;
|
|
28
|
+
}): {
|
|
29
|
+
close: () => void;
|
|
30
|
+
};
|
|
31
|
+
wsWatch(path: string, callback: (filePath: string, content?: string) => void | Promise<void>, options?: {
|
|
32
|
+
onError?: (error: Error) => void;
|
|
33
|
+
withContent: boolean;
|
|
34
|
+
}): {
|
|
35
|
+
close: () => void;
|
|
36
|
+
};
|
|
37
|
+
sseWatch(path: string, callback: (filePath: string, content?: string) => void | Promise<void>, options?: {
|
|
18
38
|
onError?: (error: Error) => void;
|
|
19
39
|
withContent: boolean;
|
|
20
40
|
}): {
|