@blaxel/core 0.2.28 → 0.2.29-dev.178
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 +1 -213
- package/dist/sandbox/action.js +4 -2
- package/dist/sandbox/process/process.d.ts +2 -1
- package/dist/sandbox/process/process.js +70 -6
- package/dist/sandbox/sandbox.d.ts +3 -1
- package/dist/sandbox/sandbox.js +9 -4
- package/package.json +1 -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, ListCustomDomainsData, CreateCustomDomainData, DeleteCustomDomainData, GetCustomDomainData, UpdateCustomDomainData, VerifyCustomDomainData, ListFunctionsData, CreateFunctionData, DeleteFunctionData, GetFunctionData, UpdateFunctionData, ListFunctionRevisionsData, GetIntegrationData, ListIntegrationConnectionsData, CreateIntegrationConnectionData, DeleteIntegrationConnectionData, GetIntegrationConnectionData, UpdateIntegrationConnectionData, GetIntegrationConnectionModelEndpointConfigurationsData, ListIntegrationConnectionModelsData, GetIntegrationConnectionModelData, ListJobsData, CreateJobData, DeleteJobData, GetJobData, UpdateJobData, ListJobRevisionsData,
|
|
2
|
+
import type { ListAgentsData, CreateAgentData, DeleteAgentData, GetAgentData, UpdateAgentData, ListAgentRevisionsData, GetConfigurationData, ListCustomDomainsData, CreateCustomDomainData, DeleteCustomDomainData, GetCustomDomainData, UpdateCustomDomainData, VerifyCustomDomainData, ListFunctionsData, CreateFunctionData, DeleteFunctionData, GetFunctionData, UpdateFunctionData, ListFunctionRevisionsData, GetIntegrationData, ListIntegrationConnectionsData, CreateIntegrationConnectionData, DeleteIntegrationConnectionData, GetIntegrationConnectionData, UpdateIntegrationConnectionData, GetIntegrationConnectionModelEndpointConfigurationsData, ListIntegrationConnectionModelsData, GetIntegrationConnectionModelData, ListJobsData, CreateJobData, DeleteJobData, GetJobData, UpdateJobData, ListJobRevisionsData, ListLocationsData, ListMcpHubDefinitionsData, ListModelsData, CreateModelData, DeleteModelData, GetModelData, UpdateModelData, ListModelRevisionsData, ListPoliciesData, CreatePolicyData, DeletePolicyData, GetPolicyData, UpdatePolicyData, ListPrivateClustersData, CreatePrivateClusterData, DeletePrivateClusterData, GetPrivateClusterData, UpdatePrivateClusterData, GetPrivateClusterHealthData, UpdatePrivateClusterHealthData, ListAllPendingInvitationsData, ListPublicIpsData, 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, 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
|
|
@@ -165,36 +165,6 @@ export declare const updateJob: <ThrowOnError extends boolean = false>(options:
|
|
|
165
165
|
* Returns revisions for a job by name.
|
|
166
166
|
*/
|
|
167
167
|
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>;
|
|
168
|
-
/**
|
|
169
|
-
* List knowledgebases
|
|
170
|
-
* Returns a list of all knowledgebases in the workspace.
|
|
171
|
-
*/
|
|
172
|
-
export declare const listKnowledgebases: <ThrowOnError extends boolean = false>(options?: Options<ListKnowledgebasesData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen.js").Knowledgebase[], unknown, ThrowOnError>;
|
|
173
|
-
/**
|
|
174
|
-
* Create knowledgebase
|
|
175
|
-
* Creates an knowledgebase.
|
|
176
|
-
*/
|
|
177
|
-
export declare const createKnowledgebase: <ThrowOnError extends boolean = false>(options: Options<CreateKnowledgebaseData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen.js").Knowledgebase, unknown, ThrowOnError>;
|
|
178
|
-
/**
|
|
179
|
-
* Delete knowledgebase
|
|
180
|
-
* Deletes an knowledgebase by Name.
|
|
181
|
-
*/
|
|
182
|
-
export declare const deleteKnowledgebase: <ThrowOnError extends boolean = false>(options: Options<DeleteKnowledgebaseData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen.js").Knowledgebase, unknown, ThrowOnError>;
|
|
183
|
-
/**
|
|
184
|
-
* Get knowledgebase
|
|
185
|
-
* Returns an knowledgebase by Name.
|
|
186
|
-
*/
|
|
187
|
-
export declare const getKnowledgebase: <ThrowOnError extends boolean = false>(options: Options<GetKnowledgebaseData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen.js").Knowledgebase, unknown, ThrowOnError>;
|
|
188
|
-
/**
|
|
189
|
-
* Update knowledgebase
|
|
190
|
-
* Updates an knowledgebase.
|
|
191
|
-
*/
|
|
192
|
-
export declare const updateKnowledgebase: <ThrowOnError extends boolean = false>(options: Options<UpdateKnowledgebaseData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen.js").Knowledgebase, unknown, ThrowOnError>;
|
|
193
|
-
/**
|
|
194
|
-
* List knowledgebase revisions
|
|
195
|
-
* Returns revisions for a knowledgebase by name.
|
|
196
|
-
*/
|
|
197
|
-
export declare const listKnowledgebaseRevisions: <ThrowOnError extends boolean = false>(options: Options<ListKnowledgebaseRevisionsData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen.js").RevisionMetadata[], unknown, ThrowOnError>;
|
|
198
168
|
/**
|
|
199
169
|
* List locations
|
|
200
170
|
* Returns a list of all locations available with status.
|
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.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 = exports.listSandboxHubDefinitions = exports.listPublicIps = exports.listAllPendingInvitations = exports.updatePrivateClusterHealth = exports.getPrivateClusterHealth = exports.updatePrivateCluster = exports.getPrivateCluster =
|
|
4
|
+
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.listJobRevisions = exports.updateJob = exports.getJob = exports.deleteJob = exports.createJob = exports.listJobs = 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.verifyCustomDomain = exports.updateCustomDomain = exports.getCustomDomain = exports.deleteCustomDomain = exports.createCustomDomain = exports.listCustomDomains = 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.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 = exports.listSandboxHubDefinitions = exports.listPublicIps = exports.listAllPendingInvitations = exports.updatePrivateClusterHealth = exports.getPrivateClusterHealth = exports.updatePrivateCluster = exports.getPrivateCluster = void 0;
|
|
6
6
|
const client_gen_1 = require("./client.gen");
|
|
7
7
|
/**
|
|
8
8
|
* List all agents
|
|
@@ -604,116 +604,6 @@ const listJobRevisions = (options) => {
|
|
|
604
604
|
});
|
|
605
605
|
};
|
|
606
606
|
exports.listJobRevisions = listJobRevisions;
|
|
607
|
-
/**
|
|
608
|
-
* List knowledgebases
|
|
609
|
-
* Returns a list of all knowledgebases in the workspace.
|
|
610
|
-
*/
|
|
611
|
-
const listKnowledgebases = (options) => {
|
|
612
|
-
return (options?.client ?? client_gen_1.client).get({
|
|
613
|
-
security: [
|
|
614
|
-
{
|
|
615
|
-
scheme: 'bearer',
|
|
616
|
-
type: 'http'
|
|
617
|
-
}
|
|
618
|
-
],
|
|
619
|
-
url: '/knowledgebases',
|
|
620
|
-
...options
|
|
621
|
-
});
|
|
622
|
-
};
|
|
623
|
-
exports.listKnowledgebases = listKnowledgebases;
|
|
624
|
-
/**
|
|
625
|
-
* Create knowledgebase
|
|
626
|
-
* Creates an knowledgebase.
|
|
627
|
-
*/
|
|
628
|
-
const createKnowledgebase = (options) => {
|
|
629
|
-
return (options.client ?? client_gen_1.client).post({
|
|
630
|
-
security: [
|
|
631
|
-
{
|
|
632
|
-
scheme: 'bearer',
|
|
633
|
-
type: 'http'
|
|
634
|
-
}
|
|
635
|
-
],
|
|
636
|
-
url: '/knowledgebases',
|
|
637
|
-
...options,
|
|
638
|
-
headers: {
|
|
639
|
-
'Content-Type': 'application/json',
|
|
640
|
-
...options?.headers
|
|
641
|
-
}
|
|
642
|
-
});
|
|
643
|
-
};
|
|
644
|
-
exports.createKnowledgebase = createKnowledgebase;
|
|
645
|
-
/**
|
|
646
|
-
* Delete knowledgebase
|
|
647
|
-
* Deletes an knowledgebase by Name.
|
|
648
|
-
*/
|
|
649
|
-
const deleteKnowledgebase = (options) => {
|
|
650
|
-
return (options.client ?? client_gen_1.client).delete({
|
|
651
|
-
security: [
|
|
652
|
-
{
|
|
653
|
-
scheme: 'bearer',
|
|
654
|
-
type: 'http'
|
|
655
|
-
}
|
|
656
|
-
],
|
|
657
|
-
url: '/knowledgebases/{knowledgebaseName}',
|
|
658
|
-
...options
|
|
659
|
-
});
|
|
660
|
-
};
|
|
661
|
-
exports.deleteKnowledgebase = deleteKnowledgebase;
|
|
662
|
-
/**
|
|
663
|
-
* Get knowledgebase
|
|
664
|
-
* Returns an knowledgebase by Name.
|
|
665
|
-
*/
|
|
666
|
-
const getKnowledgebase = (options) => {
|
|
667
|
-
return (options.client ?? client_gen_1.client).get({
|
|
668
|
-
security: [
|
|
669
|
-
{
|
|
670
|
-
scheme: 'bearer',
|
|
671
|
-
type: 'http'
|
|
672
|
-
}
|
|
673
|
-
],
|
|
674
|
-
url: '/knowledgebases/{knowledgebaseName}',
|
|
675
|
-
...options
|
|
676
|
-
});
|
|
677
|
-
};
|
|
678
|
-
exports.getKnowledgebase = getKnowledgebase;
|
|
679
|
-
/**
|
|
680
|
-
* Update knowledgebase
|
|
681
|
-
* Updates an knowledgebase.
|
|
682
|
-
*/
|
|
683
|
-
const updateKnowledgebase = (options) => {
|
|
684
|
-
return (options.client ?? client_gen_1.client).put({
|
|
685
|
-
security: [
|
|
686
|
-
{
|
|
687
|
-
scheme: 'bearer',
|
|
688
|
-
type: 'http'
|
|
689
|
-
}
|
|
690
|
-
],
|
|
691
|
-
url: '/knowledgebases/{knowledgebaseName}',
|
|
692
|
-
...options,
|
|
693
|
-
headers: {
|
|
694
|
-
'Content-Type': 'application/json',
|
|
695
|
-
...options?.headers
|
|
696
|
-
}
|
|
697
|
-
});
|
|
698
|
-
};
|
|
699
|
-
exports.updateKnowledgebase = updateKnowledgebase;
|
|
700
|
-
/**
|
|
701
|
-
* List knowledgebase revisions
|
|
702
|
-
* Returns revisions for a knowledgebase by name.
|
|
703
|
-
*/
|
|
704
|
-
const listKnowledgebaseRevisions = (options) => {
|
|
705
|
-
return (options.client ?? client_gen_1.client).get({
|
|
706
|
-
security: [
|
|
707
|
-
{
|
|
708
|
-
scheme: 'bearer',
|
|
709
|
-
type: 'http'
|
|
710
|
-
}
|
|
711
|
-
],
|
|
712
|
-
url: '/knowledgebases/{knowledgebaseName}/revisions',
|
|
713
|
-
...options
|
|
714
|
-
});
|
|
715
|
-
};
|
|
716
|
-
exports.listKnowledgebaseRevisions = listKnowledgebaseRevisions;
|
|
717
607
|
/**
|
|
718
608
|
* List locations
|
|
719
609
|
* Returns a list of all locations available with status.
|
|
@@ -51,24 +51,7 @@ export type AgentSpec = CoreSpec & {
|
|
|
51
51
|
* Description, small description computed from the prompt
|
|
52
52
|
*/
|
|
53
53
|
description?: string;
|
|
54
|
-
functions?: FunctionsList;
|
|
55
|
-
/**
|
|
56
|
-
* Knowledgebase Name
|
|
57
|
-
*/
|
|
58
|
-
knowledgebase?: string;
|
|
59
|
-
/**
|
|
60
|
-
* Model name
|
|
61
|
-
*/
|
|
62
|
-
model?: string;
|
|
63
|
-
/**
|
|
64
|
-
* Prompt, describe what your agent does
|
|
65
|
-
*/
|
|
66
|
-
prompt?: string;
|
|
67
54
|
repository?: Repository;
|
|
68
|
-
/**
|
|
69
|
-
* Store id
|
|
70
|
-
*/
|
|
71
|
-
storeId?: string;
|
|
72
55
|
triggers?: Triggers;
|
|
73
56
|
};
|
|
74
57
|
/**
|
|
@@ -249,7 +232,7 @@ export type CustomDomainSpec = {
|
|
|
249
232
|
/**
|
|
250
233
|
* CNAME target for the domain
|
|
251
234
|
*/
|
|
252
|
-
|
|
235
|
+
cnameRecords?: string;
|
|
253
236
|
/**
|
|
254
237
|
* Last verification attempt timestamp
|
|
255
238
|
*/
|
|
@@ -448,7 +431,6 @@ export type FunctionSpec = CoreSpec & {
|
|
|
448
431
|
kit?: Array<FunctionKit>;
|
|
449
432
|
schema?: FunctionSchema;
|
|
450
433
|
};
|
|
451
|
-
export type FunctionsList = Array<string>;
|
|
452
434
|
/**
|
|
453
435
|
* Histogram bucket
|
|
454
436
|
*/
|
|
@@ -791,13 +773,6 @@ export type JobMetrics = {
|
|
|
791
773
|
export type JobSpec = CoreSpec & {
|
|
792
774
|
triggers?: Triggers;
|
|
793
775
|
};
|
|
794
|
-
/**
|
|
795
|
-
* Jobs chart
|
|
796
|
-
*/
|
|
797
|
-
export type JobsChart = {
|
|
798
|
-
failed?: JobsChartValue;
|
|
799
|
-
success?: JobsChartValue;
|
|
800
|
-
};
|
|
801
776
|
/**
|
|
802
777
|
* Jobs CPU usage
|
|
803
778
|
*/
|
|
@@ -811,27 +786,6 @@ export type JobsChartValue = {
|
|
|
811
786
|
*/
|
|
812
787
|
value?: number;
|
|
813
788
|
};
|
|
814
|
-
/**
|
|
815
|
-
* Jobs executions
|
|
816
|
-
*/
|
|
817
|
-
export type JobsExecutions = {
|
|
818
|
-
/**
|
|
819
|
-
* Failed executions
|
|
820
|
-
*/
|
|
821
|
-
failed?: number;
|
|
822
|
-
/**
|
|
823
|
-
* Running executions
|
|
824
|
-
*/
|
|
825
|
-
running?: number;
|
|
826
|
-
/**
|
|
827
|
-
* Success executions
|
|
828
|
-
*/
|
|
829
|
-
success?: number;
|
|
830
|
-
/**
|
|
831
|
-
* Total executions
|
|
832
|
-
*/
|
|
833
|
-
total?: number;
|
|
834
|
-
};
|
|
835
789
|
/**
|
|
836
790
|
* Jobs chart
|
|
837
791
|
*/
|
|
@@ -852,27 +806,6 @@ export type JobsSuccessFailedChart = {
|
|
|
852
806
|
timestamp?: string;
|
|
853
807
|
total?: JobsChartValue;
|
|
854
808
|
};
|
|
855
|
-
/**
|
|
856
|
-
* Jobs tasks
|
|
857
|
-
*/
|
|
858
|
-
export type JobsTasks = {
|
|
859
|
-
/**
|
|
860
|
-
* Failed executions
|
|
861
|
-
*/
|
|
862
|
-
failed?: number;
|
|
863
|
-
/**
|
|
864
|
-
* Running executions
|
|
865
|
-
*/
|
|
866
|
-
running?: number;
|
|
867
|
-
/**
|
|
868
|
-
* Success executions
|
|
869
|
-
*/
|
|
870
|
-
success?: number;
|
|
871
|
-
/**
|
|
872
|
-
* Total executions
|
|
873
|
-
*/
|
|
874
|
-
total?: number;
|
|
875
|
-
};
|
|
876
809
|
/**
|
|
877
810
|
* Jobs executions
|
|
878
811
|
*/
|
|
@@ -898,53 +831,6 @@ export type JobsTotal = {
|
|
|
898
831
|
*/
|
|
899
832
|
total?: number;
|
|
900
833
|
};
|
|
901
|
-
/**
|
|
902
|
-
* Knowledgebase
|
|
903
|
-
*/
|
|
904
|
-
export type Knowledgebase = {
|
|
905
|
-
events?: CoreEvents;
|
|
906
|
-
metadata?: Metadata;
|
|
907
|
-
spec?: KnowledgebaseSpec;
|
|
908
|
-
/**
|
|
909
|
-
* Knowledgebase status
|
|
910
|
-
*/
|
|
911
|
-
status?: string;
|
|
912
|
-
};
|
|
913
|
-
/**
|
|
914
|
-
* Knowledgebase specification
|
|
915
|
-
*/
|
|
916
|
-
export type KnowledgebaseSpec = {
|
|
917
|
-
/**
|
|
918
|
-
* Collection name
|
|
919
|
-
*/
|
|
920
|
-
collectionName?: string;
|
|
921
|
-
/**
|
|
922
|
-
* Embedding model
|
|
923
|
-
*/
|
|
924
|
-
embeddingModel?: string;
|
|
925
|
-
/**
|
|
926
|
-
* Embedding model type
|
|
927
|
-
*/
|
|
928
|
-
embeddingModelType?: string;
|
|
929
|
-
/**
|
|
930
|
-
* Enable or disable the agent
|
|
931
|
-
*/
|
|
932
|
-
enabled?: boolean;
|
|
933
|
-
integrationConnections?: IntegrationConnectionsList;
|
|
934
|
-
/**
|
|
935
|
-
* Options specific to the knowledge base
|
|
936
|
-
*/
|
|
937
|
-
options?: {
|
|
938
|
-
[key: string]: string;
|
|
939
|
-
};
|
|
940
|
-
policies?: PoliciesList;
|
|
941
|
-
revision?: RevisionConfiguration;
|
|
942
|
-
/**
|
|
943
|
-
* Sandbox mode
|
|
944
|
-
*/
|
|
945
|
-
sandbox?: boolean;
|
|
946
|
-
};
|
|
947
|
-
export type KnowledgebasesList = Array<string>;
|
|
948
834
|
/**
|
|
949
835
|
* Last N requests
|
|
950
836
|
*/
|
|
@@ -3232,104 +3118,6 @@ export type ListJobRevisionsResponses = {
|
|
|
3232
3118
|
200: Array<RevisionMetadata>;
|
|
3233
3119
|
};
|
|
3234
3120
|
export type ListJobRevisionsResponse = ListJobRevisionsResponses[keyof ListJobRevisionsResponses];
|
|
3235
|
-
export type ListKnowledgebasesData = {
|
|
3236
|
-
body?: never;
|
|
3237
|
-
path?: never;
|
|
3238
|
-
query?: never;
|
|
3239
|
-
url: '/knowledgebases';
|
|
3240
|
-
};
|
|
3241
|
-
export type ListKnowledgebasesResponses = {
|
|
3242
|
-
/**
|
|
3243
|
-
* successful operation
|
|
3244
|
-
*/
|
|
3245
|
-
200: Array<Knowledgebase>;
|
|
3246
|
-
};
|
|
3247
|
-
export type ListKnowledgebasesResponse = ListKnowledgebasesResponses[keyof ListKnowledgebasesResponses];
|
|
3248
|
-
export type CreateKnowledgebaseData = {
|
|
3249
|
-
body: Knowledgebase;
|
|
3250
|
-
path?: never;
|
|
3251
|
-
query?: never;
|
|
3252
|
-
url: '/knowledgebases';
|
|
3253
|
-
};
|
|
3254
|
-
export type CreateKnowledgebaseResponses = {
|
|
3255
|
-
/**
|
|
3256
|
-
* successful operation
|
|
3257
|
-
*/
|
|
3258
|
-
200: Knowledgebase;
|
|
3259
|
-
};
|
|
3260
|
-
export type CreateKnowledgebaseResponse = CreateKnowledgebaseResponses[keyof CreateKnowledgebaseResponses];
|
|
3261
|
-
export type DeleteKnowledgebaseData = {
|
|
3262
|
-
body?: never;
|
|
3263
|
-
path: {
|
|
3264
|
-
/**
|
|
3265
|
-
* Name of the knowledgebase
|
|
3266
|
-
*/
|
|
3267
|
-
knowledgebaseName: string;
|
|
3268
|
-
};
|
|
3269
|
-
query?: never;
|
|
3270
|
-
url: '/knowledgebases/{knowledgebaseName}';
|
|
3271
|
-
};
|
|
3272
|
-
export type DeleteKnowledgebaseResponses = {
|
|
3273
|
-
/**
|
|
3274
|
-
* successful operation
|
|
3275
|
-
*/
|
|
3276
|
-
200: Knowledgebase;
|
|
3277
|
-
};
|
|
3278
|
-
export type DeleteKnowledgebaseResponse = DeleteKnowledgebaseResponses[keyof DeleteKnowledgebaseResponses];
|
|
3279
|
-
export type GetKnowledgebaseData = {
|
|
3280
|
-
body?: never;
|
|
3281
|
-
path: {
|
|
3282
|
-
/**
|
|
3283
|
-
* Name of the knowledgebase
|
|
3284
|
-
*/
|
|
3285
|
-
knowledgebaseName: string;
|
|
3286
|
-
};
|
|
3287
|
-
query?: never;
|
|
3288
|
-
url: '/knowledgebases/{knowledgebaseName}';
|
|
3289
|
-
};
|
|
3290
|
-
export type GetKnowledgebaseResponses = {
|
|
3291
|
-
/**
|
|
3292
|
-
* successful operation
|
|
3293
|
-
*/
|
|
3294
|
-
200: Knowledgebase;
|
|
3295
|
-
};
|
|
3296
|
-
export type GetKnowledgebaseResponse = GetKnowledgebaseResponses[keyof GetKnowledgebaseResponses];
|
|
3297
|
-
export type UpdateKnowledgebaseData = {
|
|
3298
|
-
body: Knowledgebase;
|
|
3299
|
-
path: {
|
|
3300
|
-
/**
|
|
3301
|
-
* Name of the knowledgebase
|
|
3302
|
-
*/
|
|
3303
|
-
knowledgebaseName: string;
|
|
3304
|
-
};
|
|
3305
|
-
query?: never;
|
|
3306
|
-
url: '/knowledgebases/{knowledgebaseName}';
|
|
3307
|
-
};
|
|
3308
|
-
export type UpdateKnowledgebaseResponses = {
|
|
3309
|
-
/**
|
|
3310
|
-
* successful operation
|
|
3311
|
-
*/
|
|
3312
|
-
200: Knowledgebase;
|
|
3313
|
-
};
|
|
3314
|
-
export type UpdateKnowledgebaseResponse = UpdateKnowledgebaseResponses[keyof UpdateKnowledgebaseResponses];
|
|
3315
|
-
export type ListKnowledgebaseRevisionsData = {
|
|
3316
|
-
body?: never;
|
|
3317
|
-
path: {
|
|
3318
|
-
/**
|
|
3319
|
-
* Name of the knowledgebase
|
|
3320
|
-
*/
|
|
3321
|
-
knowledgebaseName: string;
|
|
3322
|
-
};
|
|
3323
|
-
query?: never;
|
|
3324
|
-
url: '/knowledgebases/{knowledgebaseName}/revisions';
|
|
3325
|
-
};
|
|
3326
|
-
export type ListKnowledgebaseRevisionsResponses = {
|
|
3327
|
-
/**
|
|
3328
|
-
* successful operation
|
|
3329
|
-
*/
|
|
3330
|
-
200: Array<RevisionMetadata>;
|
|
3331
|
-
};
|
|
3332
|
-
export type ListKnowledgebaseRevisionsResponse = ListKnowledgebaseRevisionsResponses[keyof ListKnowledgebaseRevisionsResponses];
|
|
3333
3121
|
export type ListLocationsData = {
|
|
3334
3122
|
body?: never;
|
|
3335
3123
|
path?: never;
|
package/dist/sandbox/action.js
CHANGED
|
@@ -66,8 +66,10 @@ class SandboxAction {
|
|
|
66
66
|
return (0, internal_js_1.getForcedUrl)('sandbox', this.name);
|
|
67
67
|
}
|
|
68
68
|
get url() {
|
|
69
|
-
if (this.forcedUrl)
|
|
70
|
-
|
|
69
|
+
if (this.forcedUrl) {
|
|
70
|
+
const url = this.forcedUrl.toString();
|
|
71
|
+
return url.endsWith('/') ? url.slice(0, -1) : url;
|
|
72
|
+
}
|
|
71
73
|
// Uncomment and use this when agent and mcp are available in mk3
|
|
72
74
|
// Update all requests made in this package to use fallbackUrl when internalUrl is not working
|
|
73
75
|
// if (settings.runInternalHostname) return this.internalUrl;
|
|
@@ -4,13 +4,14 @@ import { DeleteProcessByIdentifierKillResponse, DeleteProcessByIdentifierRespons
|
|
|
4
4
|
import { ProcessRequestWithLog, ProcessResponseWithLog } from "../types.js";
|
|
5
5
|
export declare class SandboxProcess extends SandboxAction {
|
|
6
6
|
constructor(sandbox: Sandbox);
|
|
7
|
-
streamLogs(
|
|
7
|
+
streamLogs(processName: string, options?: {
|
|
8
8
|
onLog?: (log: string) => void;
|
|
9
9
|
onStdout?: (stdout: string) => void;
|
|
10
10
|
onStderr?: (stderr: string) => void;
|
|
11
11
|
}): {
|
|
12
12
|
close: () => void;
|
|
13
13
|
};
|
|
14
|
+
private _streamLogs;
|
|
14
15
|
exec(process: ProcessRequest | ProcessRequestWithLog): Promise<PostProcessResponse | ProcessResponseWithLog>;
|
|
15
16
|
wait(identifier: string, { maxWait, interval }?: {
|
|
16
17
|
maxWait?: number;
|
|
@@ -8,7 +8,74 @@ class SandboxProcess extends action_js_1.SandboxAction {
|
|
|
8
8
|
constructor(sandbox) {
|
|
9
9
|
super(sandbox);
|
|
10
10
|
}
|
|
11
|
-
streamLogs(
|
|
11
|
+
streamLogs(processName, options = {}) {
|
|
12
|
+
const reconnectInterval = 30000;
|
|
13
|
+
let currentStream = null;
|
|
14
|
+
let isRunning = true;
|
|
15
|
+
let reconnectTimer = null;
|
|
16
|
+
// Track seen logs to avoid duplicates
|
|
17
|
+
const seenLogs = new Set();
|
|
18
|
+
const startStream = () => {
|
|
19
|
+
let logCounter = 0;
|
|
20
|
+
// Close existing stream if any
|
|
21
|
+
if (currentStream) {
|
|
22
|
+
currentStream.close();
|
|
23
|
+
}
|
|
24
|
+
// Start new stream with deduplication
|
|
25
|
+
currentStream = this._streamLogs(processName, {
|
|
26
|
+
onLog: (log) => {
|
|
27
|
+
const logKey = `${logCounter++}:${log}`;
|
|
28
|
+
if (!seenLogs.has(logKey)) {
|
|
29
|
+
seenLogs.add(logKey);
|
|
30
|
+
options.onLog?.(log);
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
onStdout: (stdout) => {
|
|
34
|
+
const logKey = `${logCounter++}:${stdout}`;
|
|
35
|
+
if (!seenLogs.has(logKey)) {
|
|
36
|
+
seenLogs.add(logKey);
|
|
37
|
+
options.onStdout?.(stdout);
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
onStderr: (stderr) => {
|
|
41
|
+
const logKey = `${logCounter++}:${stderr}`;
|
|
42
|
+
if (!seenLogs.has(logKey)) {
|
|
43
|
+
seenLogs.add(logKey);
|
|
44
|
+
options.onStderr?.(stderr);
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
// Schedule next reconnection
|
|
49
|
+
if (isRunning) {
|
|
50
|
+
reconnectTimer = setTimeout(() => {
|
|
51
|
+
if (isRunning) {
|
|
52
|
+
startStream();
|
|
53
|
+
}
|
|
54
|
+
}, reconnectInterval);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
// Start the initial stream
|
|
58
|
+
startStream();
|
|
59
|
+
// Return control functions
|
|
60
|
+
return {
|
|
61
|
+
close: async () => {
|
|
62
|
+
isRunning = false;
|
|
63
|
+
// Clear reconnect timer
|
|
64
|
+
if (reconnectTimer) {
|
|
65
|
+
clearTimeout(reconnectTimer);
|
|
66
|
+
reconnectTimer = null;
|
|
67
|
+
}
|
|
68
|
+
// Close current stream
|
|
69
|
+
if (currentStream) {
|
|
70
|
+
currentStream.close();
|
|
71
|
+
currentStream = null;
|
|
72
|
+
}
|
|
73
|
+
// Clear seen logs
|
|
74
|
+
seenLogs.clear();
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
_streamLogs(identifier, options) {
|
|
12
79
|
const controller = new AbortController();
|
|
13
80
|
void (async () => {
|
|
14
81
|
try {
|
|
@@ -81,11 +148,8 @@ class SandboxProcess extends action_js_1.SandboxAction {
|
|
|
81
148
|
this.handleResponseError(response, data, error);
|
|
82
149
|
let result = data;
|
|
83
150
|
// Handle wait_for_completion with parallel log streaming
|
|
84
|
-
if (shouldWaitForCompletion) {
|
|
85
|
-
|
|
86
|
-
if (onLog) {
|
|
87
|
-
streamControl = this.streamLogs(result.pid, { onLog });
|
|
88
|
-
}
|
|
151
|
+
if (shouldWaitForCompletion && onLog) {
|
|
152
|
+
const streamControl = this.streamLogs(result.pid, { onLog });
|
|
89
153
|
try {
|
|
90
154
|
// Wait for process completion
|
|
91
155
|
result = await this.wait(result.pid, { interval: 500, maxWait: 1000 * 60 * 60 });
|
|
@@ -21,7 +21,9 @@ export declare class SandboxInstance {
|
|
|
21
21
|
maxWait?: number;
|
|
22
22
|
interval?: number;
|
|
23
23
|
}): Promise<this>;
|
|
24
|
-
static create(sandbox?: SandboxModel | SandboxCreateConfiguration
|
|
24
|
+
static create(sandbox?: SandboxModel | SandboxCreateConfiguration, { safe }?: {
|
|
25
|
+
safe?: boolean;
|
|
26
|
+
}): Promise<SandboxInstance>;
|
|
25
27
|
static get(sandboxName: string): Promise<SandboxInstance>;
|
|
26
28
|
static list(): Promise<SandboxInstance[]>;
|
|
27
29
|
static delete(sandboxName: string): Promise<SandboxModel>;
|
package/dist/sandbox/sandbox.js
CHANGED
|
@@ -42,7 +42,7 @@ class SandboxInstance {
|
|
|
42
42
|
logger_js_1.logger.warn("⚠️ Warning: sandbox.wait() is deprecated. You don't need to wait for the sandbox to be deployed anymore.");
|
|
43
43
|
return this;
|
|
44
44
|
}
|
|
45
|
-
static async create(sandbox) {
|
|
45
|
+
static async create(sandbox, { safe = true } = {}) {
|
|
46
46
|
const defaultName = `sandbox-${(0, uuid_1.v4)().replace(/-/g, '').substring(0, 8)}`;
|
|
47
47
|
const defaultImage = "blaxel/prod-base:latest";
|
|
48
48
|
const defaultMemory = 4096;
|
|
@@ -81,10 +81,10 @@ class SandboxInstance {
|
|
|
81
81
|
}
|
|
82
82
|
sandbox = sandbox;
|
|
83
83
|
if (!sandbox.metadata) {
|
|
84
|
-
sandbox.metadata = { name:
|
|
84
|
+
sandbox.metadata = { name: defaultName };
|
|
85
85
|
}
|
|
86
86
|
if (!sandbox.spec) {
|
|
87
|
-
sandbox.spec = { runtime: { image:
|
|
87
|
+
sandbox.spec = { runtime: { image: defaultImage, memory: defaultMemory } };
|
|
88
88
|
}
|
|
89
89
|
if (!sandbox.spec.runtime) {
|
|
90
90
|
sandbox.spec.runtime = { image: defaultImage, memory: defaultMemory };
|
|
@@ -98,7 +98,12 @@ class SandboxInstance {
|
|
|
98
98
|
});
|
|
99
99
|
const instance = new SandboxInstance(data);
|
|
100
100
|
// TODO remove this part once we have a better way to handle this
|
|
101
|
-
|
|
101
|
+
if (safe) {
|
|
102
|
+
try {
|
|
103
|
+
await instance.fs.ls('/');
|
|
104
|
+
}
|
|
105
|
+
catch { }
|
|
106
|
+
}
|
|
102
107
|
return instance;
|
|
103
108
|
}
|
|
104
109
|
static async get(sandboxName) {
|