@blaxel/core 0.2.90-dev.181 → 0.2.90-preview.183

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.
Files changed (96) hide show
  1. package/README.md +2 -37
  2. package/dist/cjs/.tsbuildinfo +1 -1
  3. package/dist/cjs/client/sdk.gen.js +12 -63
  4. package/dist/cjs/common/autoload.js +3 -0
  5. package/dist/cjs/common/controlPlaneFetch.js +57 -0
  6. package/dist/cjs/common/h2fetch.js +1 -1
  7. package/dist/cjs/common/lazyInit.js +5 -4
  8. package/dist/cjs/common/settings.js +28 -3
  9. package/dist/cjs/common/settings.test.js +3 -3
  10. package/dist/cjs/drive/index.js +3 -39
  11. package/dist/cjs/index.js +0 -1
  12. package/dist/cjs/jobs/jobs.js +9 -42
  13. package/dist/cjs/sandbox/client/sdk.gen.js +1 -1
  14. package/dist/cjs/sandbox/preview.js +3 -8
  15. package/dist/cjs/sandbox/sandbox.js +4 -41
  16. package/dist/cjs/types/client/sdk.gen.d.ts +19 -34
  17. package/dist/cjs/types/client/types.gen.d.ts +47 -707
  18. package/dist/cjs/types/common/controlPlaneFetch.d.ts +4 -0
  19. package/dist/cjs/types/common/settings.d.ts +18 -0
  20. package/dist/cjs/types/drive/index.d.ts +4 -35
  21. package/dist/cjs/types/index.d.ts +0 -1
  22. package/dist/cjs/types/jobs/jobs.d.ts +3 -33
  23. package/dist/cjs/types/sandbox/client/sdk.gen.d.ts +1 -1
  24. package/dist/cjs/types/sandbox/client/types.gen.d.ts +0 -24
  25. package/dist/cjs/types/sandbox/preview.d.ts +2 -2
  26. package/dist/cjs/types/sandbox/sandbox.d.ts +2 -36
  27. package/dist/cjs/types/volume/index.d.ts +4 -37
  28. package/dist/cjs/volume/index.js +3 -41
  29. package/dist/cjs-browser/.tsbuildinfo +1 -1
  30. package/dist/cjs-browser/client/sdk.gen.js +12 -63
  31. package/dist/cjs-browser/common/autoload.js +3 -0
  32. package/dist/cjs-browser/common/controlPlaneFetch.js +57 -0
  33. package/dist/cjs-browser/common/lazyInit.js +5 -4
  34. package/dist/cjs-browser/common/settings.js +28 -3
  35. package/dist/cjs-browser/common/settings.test.js +3 -3
  36. package/dist/cjs-browser/drive/index.js +3 -39
  37. package/dist/cjs-browser/index.js +0 -1
  38. package/dist/cjs-browser/jobs/jobs.js +9 -42
  39. package/dist/cjs-browser/sandbox/client/sdk.gen.js +1 -1
  40. package/dist/cjs-browser/sandbox/preview.js +3 -8
  41. package/dist/cjs-browser/sandbox/sandbox.js +4 -41
  42. package/dist/cjs-browser/types/client/sdk.gen.d.ts +19 -34
  43. package/dist/cjs-browser/types/client/types.gen.d.ts +47 -707
  44. package/dist/cjs-browser/types/common/controlPlaneFetch.d.ts +4 -0
  45. package/dist/cjs-browser/types/common/settings.d.ts +18 -0
  46. package/dist/cjs-browser/types/drive/index.d.ts +4 -35
  47. package/dist/cjs-browser/types/index.d.ts +0 -1
  48. package/dist/cjs-browser/types/jobs/jobs.d.ts +3 -33
  49. package/dist/cjs-browser/types/sandbox/client/sdk.gen.d.ts +1 -1
  50. package/dist/cjs-browser/types/sandbox/client/types.gen.d.ts +0 -24
  51. package/dist/cjs-browser/types/sandbox/preview.d.ts +2 -2
  52. package/dist/cjs-browser/types/sandbox/sandbox.d.ts +2 -36
  53. package/dist/cjs-browser/types/volume/index.d.ts +4 -37
  54. package/dist/cjs-browser/volume/index.js +3 -41
  55. package/dist/esm/.tsbuildinfo +1 -1
  56. package/dist/esm/client/sdk.gen.js +9 -57
  57. package/dist/esm/common/autoload.js +3 -0
  58. package/dist/esm/common/controlPlaneFetch.js +51 -0
  59. package/dist/esm/common/h2fetch.js +1 -1
  60. package/dist/esm/common/lazyInit.js +5 -4
  61. package/dist/esm/common/settings.js +28 -3
  62. package/dist/esm/common/settings.test.js +3 -3
  63. package/dist/esm/drive/index.js +3 -39
  64. package/dist/esm/index.js +0 -1
  65. package/dist/esm/jobs/jobs.js +9 -42
  66. package/dist/esm/sandbox/client/sdk.gen.js +1 -1
  67. package/dist/esm/sandbox/preview.js +3 -8
  68. package/dist/esm/sandbox/sandbox.js +4 -41
  69. package/dist/esm/volume/index.js +3 -41
  70. package/dist/esm-browser/.tsbuildinfo +1 -1
  71. package/dist/esm-browser/client/sdk.gen.js +9 -57
  72. package/dist/esm-browser/common/autoload.js +3 -0
  73. package/dist/esm-browser/common/controlPlaneFetch.js +51 -0
  74. package/dist/esm-browser/common/lazyInit.js +5 -4
  75. package/dist/esm-browser/common/settings.js +28 -3
  76. package/dist/esm-browser/common/settings.test.js +3 -3
  77. package/dist/esm-browser/drive/index.js +3 -39
  78. package/dist/esm-browser/index.js +0 -1
  79. package/dist/esm-browser/jobs/jobs.js +9 -42
  80. package/dist/esm-browser/sandbox/client/sdk.gen.js +1 -1
  81. package/dist/esm-browser/sandbox/preview.js +3 -8
  82. package/dist/esm-browser/sandbox/sandbox.js +4 -41
  83. package/dist/esm-browser/volume/index.js +3 -41
  84. package/package.json +1 -1
  85. package/dist/cjs/common/pagination.js +0 -87
  86. package/dist/cjs/common/pagination.test.js +0 -62
  87. package/dist/cjs/types/common/pagination.d.ts +0 -35
  88. package/dist/cjs/types/common/pagination.test.d.ts +0 -1
  89. package/dist/cjs-browser/common/pagination.js +0 -87
  90. package/dist/cjs-browser/common/pagination.test.js +0 -62
  91. package/dist/cjs-browser/types/common/pagination.d.ts +0 -35
  92. package/dist/cjs-browser/types/common/pagination.test.d.ts +0 -1
  93. package/dist/esm/common/pagination.js +0 -83
  94. package/dist/esm/common/pagination.test.js +0 -60
  95. package/dist/esm-browser/common/pagination.js +0 -83
  96. package/dist/esm-browser/common/pagination.test.js +0 -60
@@ -1,13 +1,13 @@
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.listJobs = exports.getIntegrationConnectionModel = exports.listIntegrationConnectionModels = exports.getIntegrationConnectionModelEndpointConfigurations = exports.updateIntegrationConnection = exports.getIntegrationConnection = exports.deleteIntegrationConnection = exports.createIntegrationConnection = exports.listIntegrationConnections = exports.getIntegration = exports.deleteImageTag = exports.unshareImage = exports.shareImage = exports.listImageShares = exports.getImage = exports.deleteImage = exports.createImage = exports.listImages = exports.cleanupImages = exports.listFunctionRevisions = exports.updateFunction = exports.getFunction = exports.deleteFunction = exports.createFunction = exports.listFunctions = exports.testFeatureFlag = exports.getWorkspaceFeatures = exports.listAllEgressIps = exports.getEgressGatewayUsage = exports.listAllEgressGateways = exports.getDriveJwks = exports.createDriveAccessToken = exports.updateDrive = exports.getDrive = exports.deleteDrive = exports.createDrive = exports.listDrives = 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.listTemplates = exports.deleteApiKeyForServiceAccount = exports.createApiKeyForServiceAccount = exports.listApiKeysForServiceAccount = exports.updateWorkspaceServiceAccount = exports.deleteWorkspaceServiceAccount = exports.createWorkspaceServiceAccount = exports.getWorkspaceServiceAccounts = 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.getPolicyUsages = exports.updatePolicy = exports.getPolicy = exports.deletePolicy = exports.createPolicy = exports.listPolicies = exports.declineImageShare = exports.acceptImageShare = exports.listPendingImageShares = exports.listModelRevisions = exports.updateModel = exports.getModel = exports.deleteModel = exports.createModel = exports.listModels = exports.listMcpHubDefinitions = exports.listLocations = exports.listJobRevisions = exports.listJobExecutionTasks = exports.getJobExecution = exports.deleteJobExecution = exports.createJobExecution = exports.listJobExecutions = exports.updateJob = exports.getJob = exports.deleteJob = exports.createJob = void 0;
6
- exports.checkWorkspaceAvailability = exports.leaveWorkspace = exports.acceptWorkspaceInvitation = exports.declineWorkspaceInvitation = exports.updateWorkspace = exports.getWorkspace = exports.deleteWorkspace = exports.createWorkspace = exports.listWorkspaces = exports.getEgressIp = exports.deleteEgressIp = exports.createEgressIp = exports.listEgressIps = exports.getEgressGateway = exports.deleteEgressGateway = exports.createEgressGateway = exports.listEgressGateways = exports.getVpc = exports.deleteVpc = exports.createVpc = exports.listVpcs = exports.updateVolume = exports.getVolume = exports.deleteVolume = exports.createVolume = exports.listVolumes = exports.deleteVolumeTemplateVersion = exports.updateVolumeTemplate = exports.getVolumeTemplate = exports.deleteVolumeTemplate = exports.createVolumeTemplate = exports.listVolumeTemplates = exports.updateWorkspaceUserRole = exports.removeWorkspaceUser = exports.inviteWorkspaceUser = exports.listWorkspaceUsers = exports.getTemplate = void 0;
4
+ exports.createJob = exports.listJobs = exports.getIntegrationConnectionModel = exports.listIntegrationConnectionModels = exports.getIntegrationConnectionModelEndpointConfigurations = exports.updateIntegrationConnection = exports.getIntegrationConnection = exports.deleteIntegrationConnection = exports.createIntegrationConnection = exports.listIntegrationConnections = exports.getIntegration = exports.deleteImageTag = exports.unshareImage = exports.shareImage = exports.listImageShares = exports.getImage = exports.deleteImage = exports.createImage = exports.listImages = exports.cleanupImages = exports.listFunctionRevisions = exports.updateFunction = exports.getFunction = exports.deleteFunction = exports.createFunction = exports.listFunctions = exports.testFeatureFlag = exports.getWorkspaceFeatures = exports.listAllEgressIps = exports.listAllEgressGateways = exports.getDriveJwks = exports.createDriveAccessToken = exports.updateDrive = exports.getDrive = exports.deleteDrive = exports.createDrive = exports.listDrives = 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.inviteWorkspaceUser = exports.listWorkspaceUsers = exports.getTemplate = exports.listTemplates = exports.deleteApiKeyForServiceAccount = exports.createApiKeyForServiceAccount = exports.listApiKeysForServiceAccount = exports.updateWorkspaceServiceAccount = exports.deleteWorkspaceServiceAccount = exports.createWorkspaceServiceAccount = exports.getWorkspaceServiceAccounts = 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.updatePolicy = exports.getPolicy = exports.deletePolicy = exports.createPolicy = exports.listPolicies = exports.declineImageShare = exports.acceptImageShare = exports.listPendingImageShares = exports.listModelRevisions = exports.updateModel = exports.getModel = exports.deleteModel = exports.createModel = exports.listModels = exports.listMcpHubDefinitions = exports.listLocations = exports.listJobRevisions = exports.getJobExecution = exports.deleteJobExecution = exports.createJobExecution = exports.listJobExecutions = exports.updateJob = exports.getJob = exports.deleteJob = void 0;
6
+ exports.checkWorkspaceAvailability = exports.leaveWorkspace = exports.acceptWorkspaceInvitation = exports.declineWorkspaceInvitation = exports.updateWorkspace = exports.getWorkspace = exports.deleteWorkspace = exports.createWorkspace = exports.listWorkspaces = exports.getEgressIp = exports.deleteEgressIp = exports.createEgressIp = exports.listEgressIps = exports.getEgressGateway = exports.deleteEgressGateway = exports.createEgressGateway = exports.listEgressGateways = exports.getVpc = exports.deleteVpc = exports.createVpc = exports.listVpcs = exports.updateVolume = exports.getVolume = exports.deleteVolume = exports.createVolume = exports.listVolumes = exports.deleteVolumeTemplateVersion = exports.updateVolumeTemplate = exports.getVolumeTemplate = exports.deleteVolumeTemplate = exports.createVolumeTemplate = exports.listVolumeTemplates = exports.updateWorkspaceUserRole = exports.removeWorkspaceUser = void 0;
7
7
  const client_gen_1 = require("./client.gen");
8
8
  /**
9
9
  * List all agents
10
- * Returns AI agents deployed in the workspace. Each agent includes its deployment status, runtime configuration, and global inference endpoint URL. Starting with API version 2026-04-28 the response is wrapped in `{data, meta}` and supports cursor pagination via the `cursor` and `limit` query parameters; older versions keep returning a bare array with all agents.
10
+ * Returns all AI agents deployed in the workspace. Each agent includes its deployment status, runtime configuration, and global inference endpoint URL.
11
11
  */
12
12
  const listAgents = (options) => {
13
13
  return (options?.client ?? client_gen_1.client).get({
@@ -239,7 +239,7 @@ const verifyCustomDomain = (options) => {
239
239
  exports.verifyCustomDomain = verifyCustomDomain;
240
240
  /**
241
241
  * List drives
242
- * Returns all drives in the workspace. Drives provide persistent storage that can be attached to agents, functions, and sandboxes. Starting with API version 2026-04-28, the response wraps items in `{data, meta}` and supports cursor pagination via the `cursor` and `limit` query parameters; older versions keep returning a bare array with all drives.
242
+ * Returns all drives in the workspace. Drives provide persistent storage that can be attached to agents, functions, and sandboxes.
243
243
  */
244
244
  const listDrives = (options) => {
245
245
  return (options?.client ?? client_gen_1.client).get({
@@ -374,23 +374,6 @@ const listAllEgressGateways = (options) => {
374
374
  });
375
375
  };
376
376
  exports.listAllEgressGateways = listAllEgressGateways;
377
- /**
378
- * Egress gateway sandbox attachments
379
- * Returns the inverse map (gateway → sandbox names) for the workspace. Used by the egress-IPs UI to render attachment counts without fetching the sandboxes listing full client-side.
380
- */
381
- const getEgressGatewayUsage = (options) => {
382
- return (options?.client ?? client_gen_1.client).get({
383
- security: [
384
- {
385
- scheme: 'bearer',
386
- type: 'http'
387
- }
388
- ],
389
- url: '/egressgateways/usage',
390
- ...options
391
- });
392
- };
393
- exports.getEgressGatewayUsage = getEgressGatewayUsage;
394
377
  /**
395
378
  * List all egress IPs across all VPCs and gateways in the workspace
396
379
  */
@@ -443,7 +426,7 @@ const testFeatureFlag = (options) => {
443
426
  exports.testFeatureFlag = testFeatureFlag;
444
427
  /**
445
428
  * List all MCP servers
446
- * Returns MCP server functions deployed in the workspace. Each function includes its deployment status, transport protocol (websocket or http-stream), and endpoint URL. Starting with API version 2026-04-28 the response is wrapped in `{data, meta}` and supports cursor pagination via the `cursor` and `limit` query parameters; older versions keep returning a bare array with all functions.
429
+ * Returns all MCP server functions deployed in the workspace. Each function includes its deployment status, transport protocol (websocket or http-stream), and endpoint URL.
447
430
  */
448
431
  const listFunctions = (options) => {
449
432
  return (options?.client ?? client_gen_1.client).get({
@@ -875,7 +858,7 @@ const getIntegrationConnectionModel = (options) => {
875
858
  exports.getIntegrationConnectionModel = getIntegrationConnectionModel;
876
859
  /**
877
860
  * List batch jobs
878
- * Returns batch job definitions in the workspace. Each job can be triggered to run multiple parallel tasks with configurable concurrency and retry settings. Starting with API version 2026-04-28 the response is wrapped in `{data, meta}` and supports cursor pagination via the `cursor` and `limit` query parameters; older versions keep returning a bare array with all jobs.
861
+ * Returns all batch job definitions in the workspace. Each job can be triggered to run multiple parallel tasks with configurable concurrency and retry settings.
879
862
  */
880
863
  const listJobs = (options) => {
881
864
  return (options?.client ?? client_gen_1.client).get({
@@ -968,7 +951,7 @@ const updateJob = (options) => {
968
951
  exports.updateJob = updateJob;
969
952
  /**
970
953
  * List job executions
971
- * Returns executions for a batch job. Starting with API version 2026-04-28 the response is wrapped in `{data, meta}` and supports cursor pagination via the `cursor` and `limit` query parameters; older versions keep the legacy offset/limit contract and return a bare array.
954
+ * Returns paginated list of executions for a batch job, sorted by creation time. Each execution contains status, task counts, and timing information.
972
955
  */
973
956
  const listJobExecutions = (options) => {
974
957
  return (options.client ?? client_gen_1.client).get({
@@ -1038,23 +1021,6 @@ const getJobExecution = (options) => {
1038
1021
  });
1039
1022
  };
1040
1023
  exports.getJobExecution = getJobExecution;
1041
- /**
1042
- * List execution tasks
1043
- * Returns one cursor-paginated page of an execution's tasks. Tasks are derived from event history each request; only the in-memory slicing is paginated, the events scan still fetches the whole event log behind the scenes. Available starting with API version 2026-04-28.
1044
- */
1045
- const listJobExecutionTasks = (options) => {
1046
- return (options.client ?? client_gen_1.client).get({
1047
- security: [
1048
- {
1049
- scheme: 'bearer',
1050
- type: 'http'
1051
- }
1052
- ],
1053
- url: '/jobs/{jobId}/executions/{executionId}/tasks',
1054
- ...options
1055
- });
1056
- };
1057
- exports.listJobExecutionTasks = listJobExecutionTasks;
1058
1024
  /**
1059
1025
  * List job revisions
1060
1026
  * Returns revisions for a job by name.
@@ -1108,7 +1074,7 @@ const listMcpHubDefinitions = (options) => {
1108
1074
  exports.listMcpHubDefinitions = listMcpHubDefinitions;
1109
1075
  /**
1110
1076
  * List model endpoints
1111
- * Returns model gateway endpoints configured in the workspace. Each model represents a proxy to an external LLM provider (OpenAI, Anthropic, etc.) with unified access control. Starting with API version 2026-04-28 the response is wrapped in `{data, meta}` and supports cursor pagination via the `cursor` and `limit` query parameters; older versions keep returning a bare array with all models.
1077
+ * Returns all model gateway endpoints configured in the workspace. Each model represents a proxy to an external LLM provider (OpenAI, Anthropic, etc.) with unified access control.
1112
1078
  */
1113
1079
  const listModels = (options) => {
1114
1080
  return (options?.client ?? client_gen_1.client).get({
@@ -1269,7 +1235,7 @@ const declineImageShare = (options) => {
1269
1235
  exports.declineImageShare = declineImageShare;
1270
1236
  /**
1271
1237
  * List governance policies
1272
- * Returns governance policies in the workspace. Policies control deployment locations, hardware flavors, and token limits for agents, functions, and models. Starting with API version 2026-04-28 the response is wrapped in `{data, meta}` and supports cursor pagination via the `cursor` and `limit` query parameters; older versions keep returning a bare array with all policies.
1238
+ * Returns all governance policies in the workspace. Policies control deployment locations, hardware flavors, and token limits for agents, functions, and models.
1273
1239
  */
1274
1240
  const listPolicies = (options) => {
1275
1241
  return (options?.client ?? client_gen_1.client).get({
@@ -1360,23 +1326,6 @@ const updatePolicy = (options) => {
1360
1326
  });
1361
1327
  };
1362
1328
  exports.updatePolicy = updatePolicy;
1363
- /**
1364
- * List resources using a policy
1365
- * Returns the names of every resource (agent, function, model, sandbox, job) currently referencing the given policy. Replaces the client-side fan-out the policies UI used to do over the listings.
1366
- */
1367
- const getPolicyUsages = (options) => {
1368
- return (options.client ?? client_gen_1.client).get({
1369
- security: [
1370
- {
1371
- scheme: 'bearer',
1372
- type: 'http'
1373
- }
1374
- ],
1375
- url: '/policies/{policyName}/usages',
1376
- ...options
1377
- });
1378
- };
1379
- exports.getPolicyUsages = getPolicyUsages;
1380
1329
  /**
1381
1330
  * List public ips
1382
1331
  * Returns a list of all public ips used in Blaxel..
@@ -1413,7 +1362,7 @@ const listSandboxHubDefinitions = (options) => {
1413
1362
  exports.listSandboxHubDefinitions = listSandboxHubDefinitions;
1414
1363
  /**
1415
1364
  * List sandboxes
1416
- * Returns sandboxes in the workspace. Each sandbox includes its configuration, status, and endpoint URL. Terminated sandboxes are hidden by default; pass `showTerminated=true` to include them. Starting with API version 2026-04-28 the response is wrapped in `{data, meta}` and supports cursor pagination via the `cursor` and `limit` query parameters; older versions keep returning a bare array of all sandboxes.
1365
+ * Returns all sandboxes in the workspace. Each sandbox includes its configuration, status, and endpoint URL.
1417
1366
  */
1418
1367
  const listSandboxes = (options) => {
1419
1368
  return (options?.client ?? client_gen_1.client).get({
@@ -2005,7 +1954,7 @@ const deleteVolumeTemplateVersion = (options) => {
2005
1954
  exports.deleteVolumeTemplateVersion = deleteVolumeTemplateVersion;
2006
1955
  /**
2007
1956
  * List persistent volumes
2008
- * Returns persistent storage volumes in the workspace. Volumes can be attached to sandboxes for durable file storage that persists across sessions and sandbox deletions. Starting with API version 2026-04-28 the response is wrapped in `{data, meta}` and supports cursor pagination via the `cursor` and `limit` query parameters; older versions keep returning a bare array of volumes.
1957
+ * Returns all persistent storage volumes in the workspace. Volumes can be attached to sandboxes for durable file storage that persists across sessions and sandbox deletions.
2009
1958
  */
2010
1959
  const listVolumes = (options) => {
2011
1960
  return (options?.client ?? client_gen_1.client).get({
@@ -41,11 +41,13 @@ const client_gen_js_1 = require("../client/client.gen.js");
41
41
  const interceptors_js_1 = require("../client/interceptors.js");
42
42
  const responseInterceptor_js_1 = require("../client/responseInterceptor.js");
43
43
  const client_gen_js_2 = require("../sandbox/client/client.gen.js");
44
+ const controlPlaneFetch_js_1 = require("./controlPlaneFetch.js");
44
45
  const settings_js_1 = require("./settings.js");
45
46
  var lazyInit_js_1 = require("./lazyInit.js");
46
47
  Object.defineProperty(exports, "ensureAutoloaded", { enumerable: true, get: function () { return lazyInit_js_1.ensureAutoloaded; } });
47
48
  client_gen_js_1.client.setConfig({
48
49
  baseUrl: settings_js_1.settings.baseUrl,
50
+ fetch: controlPlaneFetch_js_1.controlPlaneFetch,
49
51
  });
50
52
  // Register request interceptors
51
53
  for (const interceptor of interceptors_js_1.interceptors) {
@@ -90,6 +92,7 @@ function initialize(config) {
90
92
  settings_js_1.settings.setConfig(config);
91
93
  client_gen_js_1.client.setConfig({
92
94
  baseUrl: settings_js_1.settings.baseUrl,
95
+ fetch: controlPlaneFetch_js_1.controlPlaneFetch,
93
96
  });
94
97
  client_gen_js_2.client.setConfig({
95
98
  baseUrl: settings_js_1.settings.baseUrl,
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.nativeFetchSupportsH2 = void 0;
4
+ exports.undiciSupportsNativeH2 = undiciSupportsNativeH2;
5
+ exports.shouldUseControlPlaneH2 = shouldUseControlPlaneH2;
6
+ exports.controlPlaneFetch = controlPlaneFetch;
7
+ const h2fetch_js_1 = require("./h2fetch.js");
8
+ const h2pool_js_1 = require("./h2pool.js");
9
+ const settings_js_1 = require("./settings.js");
10
+ const h2FetchByHost = new Map();
11
+ // Node's global fetch dispatcher only negotiates HTTP/2 by default starting
12
+ // with undici 8 (Node 26+); undici 7 (Node 24) and undici 6 (Node 22) still
13
+ // ALPN to HTTP/1.1 for fetch, verified empirically against api.blaxel.ai. On
14
+ // undici >= 8 the pooled wrapper is redundant, so we prefer the native path.
15
+ function undiciSupportsNativeH2(undiciVersion) {
16
+ const major = Number(undiciVersion?.split(".")[0] ?? 0);
17
+ return major >= 8;
18
+ }
19
+ // `process`/`process.versions` is absent on Cloudflare Workers and other
20
+ // non-Node runtimes, and `process.versions.undici` is undefined on Bun/Deno;
21
+ // all of those resolve to `false` and keep the wrapper as the fallback.
22
+ exports.nativeFetchSupportsH2 = typeof process !== "undefined" && undiciSupportsNativeH2(process.versions?.undici);
23
+ function shouldUseControlPlaneH2(url, h2Disabled, proxyConfigured = false, nativeH2 = false, forceWrapper = false) {
24
+ if (h2Disabled || proxyConfigured)
25
+ return false;
26
+ if (url.protocol !== "https:")
27
+ return false;
28
+ // Token refresh is sequential and unauthenticated; it cannot contribute to
29
+ // the create burst TLS storm, and device-mode refresh currently relies on the
30
+ // native fetch path.
31
+ if (url.pathname.endsWith("/oauth/token"))
32
+ return false;
33
+ if (!(url.hostname.endsWith("blaxel.ai") || url.hostname.endsWith("blaxel.dev"))) {
34
+ return false;
35
+ }
36
+ // Native fetch already negotiates HTTP/2: skip the redundant wrapper unless
37
+ // explicitly forced (e.g. to exercise the pooled path on a modern runtime).
38
+ if (nativeH2 && !forceWrapper)
39
+ return false;
40
+ return true;
41
+ }
42
+ function controlPlaneFetch(input) {
43
+ const url = new URL(input.url);
44
+ const proxyConfigured = Boolean(settings_js_1.settings.config.proxy);
45
+ // Global disableH2 still wins; disableControlPlaneH2 opts out of just the
46
+ // control-plane wrapper while leaving data-plane H2 in place.
47
+ const h2Disabled = settings_js_1.settings.disableH2 || settings_js_1.settings.disableControlPlaneH2;
48
+ if (!shouldUseControlPlaneH2(url, h2Disabled, proxyConfigured, exports.nativeFetchSupportsH2, settings_js_1.settings.forceControlPlaneH2)) {
49
+ return globalThis.fetch(input);
50
+ }
51
+ let h2Fetch = h2FetchByHost.get(url.hostname);
52
+ if (!h2Fetch) {
53
+ h2Fetch = (0, h2fetch_js_1.createPoolBackedH2Fetch)(h2pool_js_1.h2Pool, url.hostname);
54
+ h2FetchByHost.set(url.hostname, h2Fetch);
55
+ }
56
+ return h2Fetch(input);
57
+ }
@@ -7,7 +7,7 @@ exports.h2RequestDirectFromPool = h2RequestDirectFromPool;
7
7
  exports.h2RequestDirect = h2RequestDirect;
8
8
  const settings_js_1 = require("./settings.js");
9
9
  const h2ref_js_1 = require("./h2ref.js");
10
- const MIN_H2_SESSION_MAX_LISTENERS = 256;
10
+ const MIN_H2_SESSION_MAX_LISTENERS = 64;
11
11
  const sessionsWithListenerBudget = new WeakSet();
12
12
  /**
13
13
  * Per-domain async semaphore that bounds the number of in-flight HTTP/2
@@ -36,6 +36,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.ensureAutoloaded = ensureAutoloaded;
37
37
  const client_gen_js_1 = require("../client/client.gen.js");
38
38
  const client_gen_js_2 = require("../sandbox/client/client.gen.js");
39
+ const controlPlaneFetch_js_1 = require("./controlPlaneFetch.js");
39
40
  const sentry_js_1 = require("./sentry.js");
40
41
  const settings_js_1 = require("./settings.js");
41
42
  let autoloaded = false;
@@ -69,7 +70,7 @@ function ensureAutoloaded() {
69
70
  // Keep the clients' baseUrl in sync with the now-resolved env. Without
70
71
  // this, the module-load `client.setConfig({ baseUrl })` would be stuck on
71
72
  // the prod default for users who rely on `config.yaml` (no env vars).
72
- client_gen_js_1.client.setConfig({ baseUrl: settings_js_1.settings.baseUrl });
73
+ client_gen_js_1.client.setConfig({ baseUrl: settings_js_1.settings.baseUrl, fetch: controlPlaneFetch_js_1.controlPlaneFetch });
73
74
  client_gen_js_2.client.setConfig({ baseUrl: settings_js_1.settings.baseUrl });
74
75
  // Initialize Sentry for SDK error tracking.
75
76
  (0, sentry_js_1.initSentry)();
@@ -80,9 +81,9 @@ function ensureAutoloaded() {
80
81
  if (isNode && !isBrowser && !settings_js_1.settings.disableH2) {
81
82
  try {
82
83
  // Pre-warm edge H2 for the configured region so the first
83
- // SandboxInstance.create() gets an instant session via the pool.
84
- // The control-plane client (api.blaxel.ai) stays on regular fetch
85
- // which already benefits from undici's built-in connection pooling.
84
+ // SandboxInstance.create() gets an instant data-plane session via the
85
+ // pool. Control-plane H2 is intentionally not warmed; its cold burst
86
+ // relies on pool deduplication instead.
86
87
  const region = settings_js_1.settings.region;
87
88
  if (region) {
88
89
  Promise.resolve().then(() => __importStar(require("./h2pool.js"))).then(({ h2Pool }) => {
@@ -28,10 +28,10 @@ function missingCredentialsMessage() {
28
28
  return "No Blaxel credentials found. Set the BL_API_KEY and BL_WORKSPACE environment variables, or run `bl login`.";
29
29
  }
30
30
  // Build info - these placeholders are replaced at build time by build:replace-imports
31
- const BUILD_VERSION = "0.2.90-dev.181";
32
- const BUILD_COMMIT = "588f48a812b2e4e0ff556b9008896ad944741f53";
31
+ const BUILD_VERSION = "0.2.90-preview.183";
32
+ const BUILD_COMMIT = "e47f7913315215d00a881153cf552d424046a303";
33
33
  const BUILD_SENTRY_DSN = "https://fd5e60e1c9820e1eef5ccebb84a07127@o4508714045276160.ingest.us.sentry.io/4510465864564736";
34
- const BLAXEL_API_VERSION = "2026-04-28";
34
+ const BLAXEL_API_VERSION = "2026-04-16";
35
35
  // Cache for config.yaml tracking value
36
36
  let configTrackingValue = null;
37
37
  let configTrackingLoaded = false;
@@ -250,6 +250,31 @@ class Settings {
250
250
  }
251
251
  return isDenoRuntime();
252
252
  }
253
+ // Control-plane-only escape hatch: disables the control-plane H2 wrapper
254
+ // without affecting data-plane (edge) H2. `disableH2` is the global override
255
+ // and is checked separately by callers, so it always wins.
256
+ get disableControlPlaneH2() {
257
+ if (typeof this.config.disableControlPlaneH2 === "boolean") {
258
+ return this.config.disableControlPlaneH2;
259
+ }
260
+ const value = env_js_1.env.BL_DISABLE_CONTROL_PLANE_H2;
261
+ if (value) {
262
+ return ["1", "true", "yes", "on"].includes(value.toLowerCase());
263
+ }
264
+ return false;
265
+ }
266
+ // Forces the control-plane H2 wrapper on even when native fetch already
267
+ // supports H2 (undici >= 7). `disableH2`/`disableControlPlaneH2` still win.
268
+ get forceControlPlaneH2() {
269
+ if (typeof this.config.forceControlPlaneH2 === "boolean") {
270
+ return this.config.forceControlPlaneH2;
271
+ }
272
+ const value = env_js_1.env.BL_FORCE_CONTROL_PLANE_H2;
273
+ if (value) {
274
+ return ["1", "true", "yes", "on"].includes(value.toLowerCase());
275
+ }
276
+ return false;
277
+ }
253
278
  get maxConcurrentH2Requests() {
254
279
  if (typeof this.config.maxConcurrentH2Requests === "number") {
255
280
  return this.config.maxConcurrentH2Requests;
@@ -43,10 +43,10 @@ const env_js_1 = require("./env.js");
43
43
  (0, vitest_1.afterEach)(() => {
44
44
  delete env_js_1.env.BL_API_VERSION;
45
45
  });
46
- (0, vitest_1.it)('defaults to 2026-04-28 when BL_API_VERSION is not set', async () => {
46
+ (0, vitest_1.it)('defaults to 2026-04-16 when BL_API_VERSION is not set', async () => {
47
47
  delete env_js_1.env.BL_API_VERSION;
48
48
  const { settings } = await Promise.resolve().then(() => __importStar(require('./settings.js')));
49
- (0, vitest_1.expect)(settings.apiVersion).toBe('2026-04-28');
49
+ (0, vitest_1.expect)(settings.apiVersion).toBe('2026-04-16');
50
50
  });
51
51
  (0, vitest_1.it)('headers include Blaxel-Version set to the default', async () => {
52
52
  delete env_js_1.env.BL_API_VERSION;
@@ -55,7 +55,7 @@ const env_js_1 = require("./env.js");
55
55
  const previous = settings.credentials;
56
56
  settings.credentials = new apikey_js_1.ApiKey({ apiKey: 'test-key', workspace: 'test-ws' });
57
57
  try {
58
- (0, vitest_1.expect)(settings.headers['Blaxel-Version']).toBe('2026-04-28');
58
+ (0, vitest_1.expect)(settings.headers['Blaxel-Version']).toBe('2026-04-16');
59
59
  }
60
60
  finally {
61
61
  settings.credentials = previous;
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DriveInstance = void 0;
4
4
  const uuid_1 = require("uuid");
5
5
  const index_js_1 = require("../client/index.js");
6
- const pagination_js_1 = require("../common/pagination.js");
7
6
  const settings_js_1 = require("../common/settings.js");
8
7
  class DriveInstance {
9
8
  drive;
@@ -87,44 +86,9 @@ class DriveInstance {
87
86
  });
88
87
  return new DriveInstance(data);
89
88
  }
90
- /**
91
- * List one page of drives.
92
- *
93
- * The returned page exposes `data` for the current page, `meta` for cursor
94
- * metadata, and helpers to fetch more pages only when you need them.
95
- *
96
- * @example
97
- * ```ts
98
- * const page = await DriveInstance.list({ limit: 50 });
99
- *
100
- * for (const drive of page.data) {
101
- * console.log(drive.name);
102
- * }
103
- *
104
- * const nextPage = await page.nextPage();
105
- * ```
106
- *
107
- * @example
108
- * ```ts
109
- * const allDrives = await (await DriveInstance.list()).autoPagingToArray({
110
- * limit: 1000,
111
- * });
112
- * ```
113
- */
114
- static async list(query) {
115
- const fetchPage = async (pageQuery) => {
116
- const { data } = await (0, index_js_1.listDrives)({
117
- query: pageQuery,
118
- throwOnError: true,
119
- });
120
- return data;
121
- };
122
- return (0, pagination_js_1.createPaginatedList)({
123
- response: await fetchPage(query),
124
- fetchPage,
125
- mapItem: (drive) => new DriveInstance(drive),
126
- query,
127
- });
89
+ static async list() {
90
+ const { data } = await (0, index_js_1.listDrives)({ throwOnError: true });
91
+ return data.map((drive) => new DriveInstance(drive));
128
92
  }
129
93
  static async delete(driveName) {
130
94
  const { data } = await (0, index_js_1.deleteDrive)({
package/dist/cjs/index.js CHANGED
@@ -23,7 +23,6 @@ __exportStar(require("./common/node.js"), exports);
23
23
  __exportStar(require("./common/errors.js"), exports);
24
24
  __exportStar(require("./common/internal.js"), exports);
25
25
  __exportStar(require("./common/logger.js"), exports);
26
- __exportStar(require("./common/pagination.js"), exports);
27
26
  __exportStar(require("./common/settings.js"), exports);
28
27
  __exportStar(require("./common/webhook.js"), exports);
29
28
  __exportStar(require("./drive/index.js"), exports);
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.blJob = void 0;
4
4
  const index_js_1 = require("../client/index.js");
5
5
  const logger_js_1 = require("../common/logger.js");
6
- const pagination_js_1 = require("../common/pagination.js");
7
6
  const settings_js_1 = require("../common/settings.js");
8
7
  const telemetry_js_1 = require("../telemetry/telemetry.js");
9
8
  class BlJob {
@@ -79,50 +78,18 @@ class BlJob {
79
78
  return data;
80
79
  }
81
80
  /**
82
- * List one page of executions for this job.
83
- *
84
- * The returned page exposes `data` for the current page, `meta` for cursor
85
- * metadata, and helpers to fetch more pages only when you need them.
86
- *
87
- * @example
88
- * ```ts
89
- * const job = blJob("daily-import");
90
- * const page = await job.listExecutions({ limit: 50 });
91
- *
92
- * for (const execution of page.data) {
93
- * console.log(execution.status);
94
- * }
95
- *
96
- * const nextPage = await page.nextPage();
97
- * ```
98
- *
99
- * @example
100
- * ```ts
101
- * const job = blJob("daily-import");
102
- * const executions = await (await job.listExecutions()).autoPagingToArray({
103
- * limit: 1000,
104
- * });
105
- * ```
81
+ * List all executions for this job
106
82
  */
107
- async listExecutions(query) {
83
+ async listExecutions() {
108
84
  logger_js_1.logger.debug(`Listing executions for job: ${this.jobName}`);
109
- const fetchPage = async (pageQuery) => {
110
- const { data } = await (0, index_js_1.listJobExecutions)({
111
- path: {
112
- jobId: this.jobName,
113
- },
114
- query: pageQuery,
115
- headers: settings_js_1.settings.headers,
116
- throwOnError: true,
117
- });
118
- return data;
119
- };
120
- return (0, pagination_js_1.createPaginatedList)({
121
- response: await fetchPage(query),
122
- fetchPage,
123
- mapItem: (execution) => execution,
124
- query,
85
+ const { data } = await (0, index_js_1.listJobExecutions)({
86
+ path: {
87
+ jobId: this.jobName,
88
+ },
89
+ headers: settings_js_1.settings.headers,
90
+ throwOnError: true,
125
91
  });
92
+ return data ?? [];
126
93
  }
127
94
  /**
128
95
  * Get the status of a specific execution
@@ -92,7 +92,7 @@ const getDrivesMount = (options) => {
92
92
  exports.getDrivesMount = getDrivesMount;
93
93
  /**
94
94
  * Attach a drive to a local path
95
- * Mounts an agent drive using the blfs binary to a local path, optionally mounting a subpath within the drive. Supports optional UID/GID mapping to remap file ownership between the local sandbox and the filer (always mapped to filer UID/GID 0). Mapping values can be set per-request via uidMap/gidMap fields, or globally via BLFS_UID_MAP/BLFS_GID_MAP environment variables (request values take precedence).
95
+ * Mounts an agent drive using the blfs binary to a local path, optionally mounting a subpath within the drive
96
96
  */
97
97
  const postDrivesMount = (options) => {
98
98
  return (options.client ?? client_gen_1.client).post({
@@ -105,29 +105,24 @@ class SandboxPreviews {
105
105
  });
106
106
  return data.map((preview) => new SandboxPreview(preview));
107
107
  }
108
- async create(preview, force) {
109
- const query = {};
110
- if (force) {
111
- query['force'] = 'true';
112
- }
108
+ async create(preview) {
113
109
  const { data } = await (0, index_js_1.createSandboxPreview)({
114
110
  path: {
115
111
  sandboxName: this.sandboxName,
116
112
  },
117
- query,
118
113
  body: preview,
119
114
  throwOnError: true,
120
115
  });
121
116
  return new SandboxPreview(data);
122
117
  }
123
- async createIfNotExists(preview, force) {
118
+ async createIfNotExists(preview) {
124
119
  try {
125
120
  const previewInstance = await this.get(preview.metadata.name);
126
121
  return previewInstance;
127
122
  }
128
123
  catch (e) {
129
124
  if (typeof e === "object" && e !== null && "code" in e && e.code === 404) {
130
- return this.create(preview, force);
125
+ return this.create(preview);
131
126
  }
132
127
  throw e;
133
128
  }
@@ -37,7 +37,6 @@ exports.SandboxInstance = void 0;
37
37
  const uuid_1 = require("uuid");
38
38
  const index_js_1 = require("../client/index.js");
39
39
  const logger_js_1 = require("../common/logger.js");
40
- const pagination_js_1 = require("../common/pagination.js");
41
40
  const settings_js_1 = require("../common/settings.js");
42
41
  const index_js_2 = require("./codegen/index.js");
43
42
  const index_js_3 = require("./drive/index.js");
@@ -273,46 +272,10 @@ class SandboxInstance {
273
272
  const instance = new SandboxInstance(data);
274
273
  return SandboxInstance.attachH2Session(instance);
275
274
  }
276
- /**
277
- * List one page of sandboxes.
278
- *
279
- * The returned page exposes `data` for the current page, `meta` for cursor
280
- * metadata, and helpers to fetch more pages only when you need them.
281
- *
282
- * @example
283
- * ```ts
284
- * const page = await SandboxInstance.list({ limit: 50 });
285
- *
286
- * for (const sandbox of page.data) {
287
- * console.log(sandbox.metadata.name);
288
- * }
289
- *
290
- * const nextPage = await page.nextPage();
291
- * ```
292
- *
293
- * @example
294
- * ```ts
295
- * const page = await SandboxInstance.list({ limit: 100 });
296
- *
297
- * for await (const sandbox of page) {
298
- * console.log(sandbox.metadata.name);
299
- * }
300
- * ```
301
- */
302
- static async list(query) {
303
- const fetchPage = async (pageQuery) => {
304
- const { data } = await (0, index_js_1.listSandboxes)({
305
- query: pageQuery,
306
- throwOnError: true,
307
- });
308
- return data;
309
- };
310
- return (0, pagination_js_1.createPaginatedList)({
311
- response: await fetchPage(query),
312
- fetchPage,
313
- mapItem: (sandbox) => SandboxInstance.attachH2Session(new SandboxInstance(sandbox)),
314
- query,
315
- });
275
+ static async list() {
276
+ const { data } = await (0, index_js_1.listSandboxes)({ throwOnError: true });
277
+ const instances = data.map((sandbox) => new SandboxInstance(sandbox));
278
+ return Promise.all(instances.map((instance) => SandboxInstance.attachH2Session(instance)));
316
279
  }
317
280
  static async delete(sandboxName) {
318
281
  const { data } = await (0, index_js_1.deleteSandbox)({