@blaxel/core 0.2.66 → 0.2.67-preview.85

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.
@@ -9,8 +9,8 @@ const index_js_1 = require("../authentication/index.js");
9
9
  const env_js_1 = require("../common/env.js");
10
10
  const node_js_1 = require("../common/node.js");
11
11
  // Build info - these placeholders are replaced at build time by build:replace-imports
12
- const BUILD_VERSION = "0.2.66";
13
- const BUILD_COMMIT = "716e957b944689373d4279122541451cad0ff3ae";
12
+ const BUILD_VERSION = "0.2.67-preview.85";
13
+ const BUILD_COMMIT = "da3d8e8ab535c2b332cf34cb6c05e4bd226f1d40";
14
14
  const BUILD_SENTRY_DSN = "https://fd5e60e1c9820e1eef5ccebb84a07127@o4508714045276160.ingest.us.sentry.io/4510465864564736";
15
15
  // Cache for config.yaml tracking value
16
16
  let configTrackingValue = null;
@@ -1,7 +1,7 @@
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.getWatchFilesystemByPath = exports.postUpgrade = exports.getProcessByIdentifierLogsStream = exports.getProcessByIdentifierLogs = exports.deleteProcessByIdentifierKill = exports.getProcessByIdentifier = exports.deleteProcessByIdentifier = exports.postProcess = exports.getProcess = exports.getNetworkProcessByPidPorts = exports.postNetworkProcessByPidMonitor = exports.deleteNetworkProcessByPidMonitor = exports.getHealth = exports.putFilesystemTreeByPath = exports.getFilesystemTreeByPath = exports.deleteFilesystemTreeByPath = exports.putFilesystemByPath = exports.getFilesystemByPath = exports.deleteFilesystemByPath = exports.getFilesystemSearchByPath = exports.postFilesystemMultipartInitiateByPath = exports.getFilesystemMultipartByUploadIdParts = exports.putFilesystemMultipartByUploadIdPart = exports.postFilesystemMultipartByUploadIdComplete = exports.deleteFilesystemMultipartByUploadIdAbort = exports.getFilesystemMultipart = exports.getFilesystemFindByPath = exports.getFilesystemContentSearchByPath = exports.getCodegenRerankingByPath = exports.putCodegenFastapplyByPath = void 0;
4
+ exports.getWatchFilesystemByPath = exports.postUpgrade = exports.getProcessByIdentifierLogsStream = exports.getProcessByIdentifierLogs = exports.deleteProcessByIdentifierKill = exports.getProcessByIdentifier = exports.deleteProcessByIdentifier = exports.postProcess = exports.getProcess = exports.putNetworkTunnelConfig = exports.deleteNetworkTunnel = exports.getNetworkProcessByPidPorts = exports.postNetworkProcessByPidMonitor = exports.deleteNetworkProcessByPidMonitor = exports.getHealth = exports.putFilesystemTreeByPath = exports.getFilesystemTreeByPath = exports.deleteFilesystemTreeByPath = exports.putFilesystemByPath = exports.getFilesystemByPath = exports.deleteFilesystemByPath = exports.getFilesystemSearchByPath = exports.postFilesystemMultipartInitiateByPath = exports.getFilesystemMultipartByUploadIdParts = exports.putFilesystemMultipartByUploadIdPart = exports.postFilesystemMultipartByUploadIdComplete = exports.deleteFilesystemMultipartByUploadIdAbort = exports.getFilesystemMultipart = exports.getFilesystemFindByPath = exports.getFilesystemContentSearchByPath = exports.getCodegenRerankingByPath = exports.putCodegenFastapplyByPath = void 0;
5
5
  const client_fetch_1 = require("@hey-api/client-fetch");
6
6
  const client_gen_1 = require("./client.gen");
7
7
  /**
@@ -422,6 +422,44 @@ const getNetworkProcessByPidPorts = (options) => {
422
422
  });
423
423
  };
424
424
  exports.getNetworkProcessByPidPorts = getNetworkProcessByPidPorts;
425
+ /**
426
+ * Disconnect tunnel
427
+ * Stop the network tunnel and restore the original network configuration. WARNING: After disconnecting, the sandbox will lose all outbound internet connectivity (no egress). Inbound connections to the sandbox will still work. Use PUT /network/tunnel/config to re-establish the tunnel.
428
+ */
429
+ const deleteNetworkTunnel = (options) => {
430
+ return (options?.client ?? client_gen_1.client).delete({
431
+ security: [
432
+ {
433
+ scheme: 'bearer',
434
+ type: 'http'
435
+ }
436
+ ],
437
+ url: '/network/tunnel',
438
+ ...options
439
+ });
440
+ };
441
+ exports.deleteNetworkTunnel = deleteNetworkTunnel;
442
+ /**
443
+ * Update tunnel configuration
444
+ * Apply a new tunnel configuration on the fly. The existing tunnel is torn down and a new one is established. This endpoint is write-only; there is no corresponding GET to read the config back.
445
+ */
446
+ const putNetworkTunnelConfig = (options) => {
447
+ return (options.client ?? client_gen_1.client).put({
448
+ security: [
449
+ {
450
+ scheme: 'bearer',
451
+ type: 'http'
452
+ }
453
+ ],
454
+ url: '/network/tunnel/config',
455
+ ...options,
456
+ headers: {
457
+ 'Content-Type': 'application/json',
458
+ ...options?.headers
459
+ }
460
+ });
461
+ };
462
+ exports.putNetworkTunnelConfig = putNetworkTunnelConfig;
425
463
  /**
426
464
  * List all processes
427
465
  * Get a list of all running and completed processes
@@ -68,6 +68,7 @@ class SandboxInstance {
68
68
  'envs' in sandbox ||
69
69
  'volumes' in sandbox ||
70
70
  'lifecycle' in sandbox ||
71
+ 'network' in sandbox ||
71
72
  'snapshotEnabled' in sandbox ||
72
73
  'labels' in sandbox) {
73
74
  if (!sandbox)
@@ -89,6 +90,7 @@ class SandboxInstance {
89
90
  "Please specify a region (e.g. 'us-pdx-1', 'eu-lon-1', 'us-was-1') in the sandbox configuration or set the BL_REGION environment variable.");
90
91
  }
91
92
  const lifecycle = sandbox.lifecycle;
93
+ const network = sandbox.network;
92
94
  const snapshotEnabled = sandbox.snapshotEnabled;
93
95
  sandbox = {
94
96
  metadata: { name: sandbox.name, labels: sandbox.labels },
@@ -104,6 +106,7 @@ class SandboxInstance {
104
106
  },
105
107
  volumes: volumes,
106
108
  lifecycle: lifecycle,
109
+ network: network,
107
110
  }
108
111
  };
109
112
  if (ttl) {
@@ -1,5 +1,5 @@
1
1
  import { type Options as ClientOptions, type TDataShape, type Client } from '@hey-api/client-fetch';
2
- import type { PutCodegenFastapplyByPathData, GetCodegenRerankingByPathData, GetFilesystemContentSearchByPathData, GetFilesystemFindByPathData, GetFilesystemMultipartData, DeleteFilesystemMultipartByUploadIdAbortData, PostFilesystemMultipartByUploadIdCompleteData, PutFilesystemMultipartByUploadIdPartData, GetFilesystemMultipartByUploadIdPartsData, PostFilesystemMultipartInitiateByPathData, GetFilesystemSearchByPathData, DeleteFilesystemByPathData, GetFilesystemByPathData, PutFilesystemByPathData, DeleteFilesystemTreeByPathData, GetFilesystemTreeByPathData, PutFilesystemTreeByPathData, GetHealthData, DeleteNetworkProcessByPidMonitorData, PostNetworkProcessByPidMonitorData, GetNetworkProcessByPidPortsData, GetProcessData, PostProcessData, DeleteProcessByIdentifierData, GetProcessByIdentifierData, DeleteProcessByIdentifierKillData, GetProcessByIdentifierLogsData, GetProcessByIdentifierLogsStreamData, PostUpgradeData, GetWatchFilesystemByPathData } from './types.gen';
2
+ import type { PutCodegenFastapplyByPathData, GetCodegenRerankingByPathData, GetFilesystemContentSearchByPathData, GetFilesystemFindByPathData, GetFilesystemMultipartData, DeleteFilesystemMultipartByUploadIdAbortData, PostFilesystemMultipartByUploadIdCompleteData, PutFilesystemMultipartByUploadIdPartData, GetFilesystemMultipartByUploadIdPartsData, PostFilesystemMultipartInitiateByPathData, GetFilesystemSearchByPathData, DeleteFilesystemByPathData, GetFilesystemByPathData, PutFilesystemByPathData, DeleteFilesystemTreeByPathData, GetFilesystemTreeByPathData, PutFilesystemTreeByPathData, GetHealthData, DeleteNetworkProcessByPidMonitorData, PostNetworkProcessByPidMonitorData, GetNetworkProcessByPidPortsData, DeleteNetworkTunnelData, PutNetworkTunnelConfigData, GetProcessData, PostProcessData, DeleteProcessByIdentifierData, GetProcessByIdentifierData, DeleteProcessByIdentifierKillData, GetProcessByIdentifierLogsData, GetProcessByIdentifierLogsStreamData, PostUpgradeData, GetWatchFilesystemByPathData } from './types.gen';
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
@@ -156,6 +156,16 @@ export declare const postNetworkProcessByPidMonitor: <ThrowOnError extends boole
156
156
  export declare const getNetworkProcessByPidPorts: <ThrowOnError extends boolean = false>(options: Options<GetNetworkProcessByPidPortsData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<{
157
157
  [key: string]: unknown;
158
158
  }, import("./types.gen").ErrorResponse, ThrowOnError>;
159
+ /**
160
+ * Disconnect tunnel
161
+ * Stop the network tunnel and restore the original network configuration. WARNING: After disconnecting, the sandbox will lose all outbound internet connectivity (no egress). Inbound connections to the sandbox will still work. Use PUT /network/tunnel/config to re-establish the tunnel.
162
+ */
163
+ export declare const deleteNetworkTunnel: <ThrowOnError extends boolean = false>(options?: Options<DeleteNetworkTunnelData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").SuccessResponse, import("./types.gen").ErrorResponse, ThrowOnError>;
164
+ /**
165
+ * Update tunnel configuration
166
+ * Apply a new tunnel configuration on the fly. The existing tunnel is torn down and a new one is established. This endpoint is write-only; there is no corresponding GET to read the config back.
167
+ */
168
+ export declare const putNetworkTunnelConfig: <ThrowOnError extends boolean = false>(options: Options<PutNetworkTunnelConfigData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").SuccessResponse, import("./types.gen").ErrorResponse, ThrowOnError>;
159
169
  /**
160
170
  * List all processes
161
171
  * Get a list of all running and completed processes
@@ -184,6 +184,12 @@ export type TreeRequest = {
184
184
  [key: string]: string;
185
185
  };
186
186
  };
187
+ export type TunnelConfigRequest = {
188
+ /**
189
+ * Base64-encoded tunnel config JSON
190
+ */
191
+ config: string;
192
+ };
187
193
  export type UpgradeRequest = {
188
194
  /**
189
195
  * Base URL for releases (useful for forks)
@@ -1025,6 +1031,61 @@ export type GetNetworkProcessByPidPortsResponses = {
1025
1031
  };
1026
1032
  };
1027
1033
  export type GetNetworkProcessByPidPortsResponse = GetNetworkProcessByPidPortsResponses[keyof GetNetworkProcessByPidPortsResponses];
1034
+ export type DeleteNetworkTunnelData = {
1035
+ body?: never;
1036
+ path?: never;
1037
+ query?: never;
1038
+ url: '/network/tunnel';
1039
+ };
1040
+ export type DeleteNetworkTunnelErrors = {
1041
+ /**
1042
+ * No tunnel is running
1043
+ */
1044
+ 400: ErrorResponse;
1045
+ /**
1046
+ * Failed to stop tunnel
1047
+ */
1048
+ 500: ErrorResponse;
1049
+ };
1050
+ export type DeleteNetworkTunnelError = DeleteNetworkTunnelErrors[keyof DeleteNetworkTunnelErrors];
1051
+ export type DeleteNetworkTunnelResponses = {
1052
+ /**
1053
+ * Tunnel disconnected
1054
+ */
1055
+ 200: SuccessResponse;
1056
+ };
1057
+ export type DeleteNetworkTunnelResponse = DeleteNetworkTunnelResponses[keyof DeleteNetworkTunnelResponses];
1058
+ export type PutNetworkTunnelConfigData = {
1059
+ /**
1060
+ * Base64-encoded tunnel configuration
1061
+ */
1062
+ body: TunnelConfigRequest;
1063
+ path?: never;
1064
+ query?: never;
1065
+ url: '/network/tunnel/config';
1066
+ };
1067
+ export type PutNetworkTunnelConfigErrors = {
1068
+ /**
1069
+ * Invalid request body
1070
+ */
1071
+ 400: ErrorResponse;
1072
+ /**
1073
+ * Invalid tunnel configuration
1074
+ */
1075
+ 422: ErrorResponse;
1076
+ /**
1077
+ * Failed to apply configuration
1078
+ */
1079
+ 500: ErrorResponse;
1080
+ };
1081
+ export type PutNetworkTunnelConfigError = PutNetworkTunnelConfigErrors[keyof PutNetworkTunnelConfigErrors];
1082
+ export type PutNetworkTunnelConfigResponses = {
1083
+ /**
1084
+ * Configuration applied
1085
+ */
1086
+ 200: SuccessResponse;
1087
+ };
1088
+ export type PutNetworkTunnelConfigResponse = PutNetworkTunnelConfigResponses[keyof PutNetworkTunnelConfigResponses];
1028
1089
  export type GetProcessData = {
1029
1090
  body?: never;
1030
1091
  path?: never;
@@ -1,4 +1,4 @@
1
- import { Port, Sandbox, SandboxLifecycle, VolumeAttachment } from "../client/types.gen";
1
+ import { Port, Sandbox, SandboxLifecycle, VolumeAttachment, SandboxNetwork } from "../client/types.gen";
2
2
  import { PostProcessResponse, ProcessRequest } from "./client";
3
3
  export interface SessionCreateOptions {
4
4
  expiresAt?: Date;
@@ -40,6 +40,7 @@ export type SandboxCreateConfiguration = {
40
40
  expires?: Date;
41
41
  region?: string;
42
42
  lifecycle?: SandboxLifecycle;
43
+ network?: SandboxNetwork;
43
44
  snapshotEnabled?: boolean;
44
45
  labels?: Record<string, string>;
45
46
  };