computesdk 2.0.2 → 2.1.1
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/index.d.mts +11 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.js +22 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -3836,6 +3836,7 @@ declare const PROVIDER_AUTH: {
|
|
|
3836
3836
|
readonly codesandbox: readonly [readonly ["CSB_API_KEY"]];
|
|
3837
3837
|
readonly blaxel: readonly [readonly ["BL_API_KEY", "BL_WORKSPACE"]];
|
|
3838
3838
|
readonly namespace: readonly [readonly ["NSC_TOKEN"]];
|
|
3839
|
+
readonly hopx: readonly [readonly ["HOPX_API_KEY"]];
|
|
3839
3840
|
};
|
|
3840
3841
|
/**
|
|
3841
3842
|
* All supported provider names (excluding gateway which is special)
|
|
@@ -3948,14 +3949,22 @@ interface ExplicitComputeConfig {
|
|
|
3948
3949
|
};
|
|
3949
3950
|
codesandbox?: {
|
|
3950
3951
|
apiKey?: string;
|
|
3952
|
+
templateId?: string;
|
|
3953
|
+
timeout?: number;
|
|
3951
3954
|
};
|
|
3952
3955
|
blaxel?: {
|
|
3953
3956
|
apiKey?: string;
|
|
3954
3957
|
workspace?: string;
|
|
3958
|
+
image?: string;
|
|
3959
|
+
region?: string;
|
|
3960
|
+
memory?: number;
|
|
3955
3961
|
};
|
|
3956
3962
|
namespace?: {
|
|
3957
3963
|
token?: string;
|
|
3958
3964
|
};
|
|
3965
|
+
hopx?: {
|
|
3966
|
+
apiKey?: string;
|
|
3967
|
+
};
|
|
3959
3968
|
}
|
|
3960
3969
|
/**
|
|
3961
3970
|
* Options for creating a sandbox via the gateway
|
|
@@ -4174,7 +4183,7 @@ declare const GATEWAY_URL = "https://gateway.computesdk.com";
|
|
|
4174
4183
|
* Provider detection priority order
|
|
4175
4184
|
* When multiple provider credentials are detected, use the first one in this list
|
|
4176
4185
|
*/
|
|
4177
|
-
declare const PROVIDER_PRIORITY: readonly ["e2b", "railway", "render", "daytona", "modal", "runloop", "vercel", "cloudflare", "codesandbox", "blaxel", "namespace"];
|
|
4186
|
+
declare const PROVIDER_PRIORITY: readonly ["e2b", "railway", "render", "daytona", "modal", "runloop", "vercel", "cloudflare", "codesandbox", "blaxel", "namespace", "hopx"];
|
|
4178
4187
|
/**
|
|
4179
4188
|
* Required environment variables for each provider
|
|
4180
4189
|
* @deprecated Use PROVIDER_AUTH from provider-config instead
|
|
@@ -4191,6 +4200,7 @@ declare const PROVIDER_ENV_VARS: {
|
|
|
4191
4200
|
readonly codesandbox: readonly ["CSB_API_KEY"];
|
|
4192
4201
|
readonly blaxel: readonly ["BL_API_KEY", "BL_WORKSPACE"];
|
|
4193
4202
|
readonly namespace: readonly ["NSC_TOKEN"];
|
|
4203
|
+
readonly hopx: readonly ["HOPX_API_KEY"];
|
|
4194
4204
|
};
|
|
4195
4205
|
|
|
4196
4206
|
export { type CallableCompute, type CodeResult$1 as CodeResult, CommandExitError, type CommandResult$1 as CommandResult, type CreateSandboxOptions$1 as CreateSandboxOptions, type ExplicitComputeConfig, type FileEntry, FileWatcher, GATEWAY_URL, Sandbox as GatewaySandbox, MessageType, PROVIDER_AUTH, PROVIDER_DASHBOARD_URLS, PROVIDER_ENV_MAP, PROVIDER_ENV_VARS, PROVIDER_HEADERS, PROVIDER_NAMES, PROVIDER_PRIORITY, type ProviderName, type ProviderSandboxInfo, type RunCommandOptions, type Runtime, Sandbox, type SandboxFileSystem, type SandboxInfo$1 as SandboxInfo, type Sandbox$1 as SandboxInterface, type SandboxStatus, type SetupOverlayConfig, type SetupPayload, SignalService, TerminalInstance, type WebSocketConstructor, autoConfigureCompute, buildProviderHeaders, buildSetupPayload, compute, decodeBinaryMessage, detectProvider, encodeBinaryMessage, encodeSetupPayload, getMissingEnvVars, getProviderConfigFromEnv, getProviderHeaders, isCommandExitError, isGatewayModeEnabled, isProviderAuthComplete, isValidProvider };
|
package/dist/index.d.ts
CHANGED
|
@@ -3836,6 +3836,7 @@ declare const PROVIDER_AUTH: {
|
|
|
3836
3836
|
readonly codesandbox: readonly [readonly ["CSB_API_KEY"]];
|
|
3837
3837
|
readonly blaxel: readonly [readonly ["BL_API_KEY", "BL_WORKSPACE"]];
|
|
3838
3838
|
readonly namespace: readonly [readonly ["NSC_TOKEN"]];
|
|
3839
|
+
readonly hopx: readonly [readonly ["HOPX_API_KEY"]];
|
|
3839
3840
|
};
|
|
3840
3841
|
/**
|
|
3841
3842
|
* All supported provider names (excluding gateway which is special)
|
|
@@ -3948,14 +3949,22 @@ interface ExplicitComputeConfig {
|
|
|
3948
3949
|
};
|
|
3949
3950
|
codesandbox?: {
|
|
3950
3951
|
apiKey?: string;
|
|
3952
|
+
templateId?: string;
|
|
3953
|
+
timeout?: number;
|
|
3951
3954
|
};
|
|
3952
3955
|
blaxel?: {
|
|
3953
3956
|
apiKey?: string;
|
|
3954
3957
|
workspace?: string;
|
|
3958
|
+
image?: string;
|
|
3959
|
+
region?: string;
|
|
3960
|
+
memory?: number;
|
|
3955
3961
|
};
|
|
3956
3962
|
namespace?: {
|
|
3957
3963
|
token?: string;
|
|
3958
3964
|
};
|
|
3965
|
+
hopx?: {
|
|
3966
|
+
apiKey?: string;
|
|
3967
|
+
};
|
|
3959
3968
|
}
|
|
3960
3969
|
/**
|
|
3961
3970
|
* Options for creating a sandbox via the gateway
|
|
@@ -4174,7 +4183,7 @@ declare const GATEWAY_URL = "https://gateway.computesdk.com";
|
|
|
4174
4183
|
* Provider detection priority order
|
|
4175
4184
|
* When multiple provider credentials are detected, use the first one in this list
|
|
4176
4185
|
*/
|
|
4177
|
-
declare const PROVIDER_PRIORITY: readonly ["e2b", "railway", "render", "daytona", "modal", "runloop", "vercel", "cloudflare", "codesandbox", "blaxel", "namespace"];
|
|
4186
|
+
declare const PROVIDER_PRIORITY: readonly ["e2b", "railway", "render", "daytona", "modal", "runloop", "vercel", "cloudflare", "codesandbox", "blaxel", "namespace", "hopx"];
|
|
4178
4187
|
/**
|
|
4179
4188
|
* Required environment variables for each provider
|
|
4180
4189
|
* @deprecated Use PROVIDER_AUTH from provider-config instead
|
|
@@ -4191,6 +4200,7 @@ declare const PROVIDER_ENV_VARS: {
|
|
|
4191
4200
|
readonly codesandbox: readonly ["CSB_API_KEY"];
|
|
4192
4201
|
readonly blaxel: readonly ["BL_API_KEY", "BL_WORKSPACE"];
|
|
4193
4202
|
readonly namespace: readonly ["NSC_TOKEN"];
|
|
4203
|
+
readonly hopx: readonly ["HOPX_API_KEY"];
|
|
4194
4204
|
};
|
|
4195
4205
|
|
|
4196
4206
|
export { type CallableCompute, type CodeResult$1 as CodeResult, CommandExitError, type CommandResult$1 as CommandResult, type CreateSandboxOptions$1 as CreateSandboxOptions, type ExplicitComputeConfig, type FileEntry, FileWatcher, GATEWAY_URL, Sandbox as GatewaySandbox, MessageType, PROVIDER_AUTH, PROVIDER_DASHBOARD_URLS, PROVIDER_ENV_MAP, PROVIDER_ENV_VARS, PROVIDER_HEADERS, PROVIDER_NAMES, PROVIDER_PRIORITY, type ProviderName, type ProviderSandboxInfo, type RunCommandOptions, type Runtime, Sandbox, type SandboxFileSystem, type SandboxInfo$1 as SandboxInfo, type Sandbox$1 as SandboxInterface, type SandboxStatus, type SetupOverlayConfig, type SetupPayload, SignalService, TerminalInstance, type WebSocketConstructor, autoConfigureCompute, buildProviderHeaders, buildSetupPayload, compute, decodeBinaryMessage, detectProvider, encodeBinaryMessage, encodeSetupPayload, getMissingEnvVars, getProviderConfigFromEnv, getProviderHeaders, isCommandExitError, isGatewayModeEnabled, isProviderAuthComplete, isValidProvider };
|
package/dist/index.js
CHANGED
|
@@ -3308,6 +3308,7 @@ API request failed (${response.status}): ${error}`
|
|
|
3308
3308
|
const response = await this.request("/ready");
|
|
3309
3309
|
return {
|
|
3310
3310
|
ready: response.ready,
|
|
3311
|
+
healthy: response.healthy,
|
|
3311
3312
|
servers: response.servers ?? [],
|
|
3312
3313
|
overlays: response.overlays ?? []
|
|
3313
3314
|
};
|
|
@@ -3606,7 +3607,8 @@ var PROVIDER_AUTH = {
|
|
|
3606
3607
|
cloudflare: [["CLOUDFLARE_API_TOKEN", "CLOUDFLARE_ACCOUNT_ID"]],
|
|
3607
3608
|
codesandbox: [["CSB_API_KEY"]],
|
|
3608
3609
|
blaxel: [["BL_API_KEY", "BL_WORKSPACE"]],
|
|
3609
|
-
namespace: [["NSC_TOKEN"]]
|
|
3610
|
+
namespace: [["NSC_TOKEN"]],
|
|
3611
|
+
hopx: [["HOPX_API_KEY"]]
|
|
3610
3612
|
};
|
|
3611
3613
|
var PROVIDER_NAMES = Object.keys(PROVIDER_AUTH);
|
|
3612
3614
|
var PROVIDER_HEADERS = {
|
|
@@ -3643,7 +3645,7 @@ var PROVIDER_HEADERS = {
|
|
|
3643
3645
|
accountId: "X-Cloudflare-Account-Id"
|
|
3644
3646
|
},
|
|
3645
3647
|
codesandbox: {
|
|
3646
|
-
apiKey: "X-
|
|
3648
|
+
apiKey: "X-CODESANDBOX-API-Key"
|
|
3647
3649
|
},
|
|
3648
3650
|
blaxel: {
|
|
3649
3651
|
apiKey: "X-Blaxel-API-Key",
|
|
@@ -3651,6 +3653,9 @@ var PROVIDER_HEADERS = {
|
|
|
3651
3653
|
},
|
|
3652
3654
|
namespace: {
|
|
3653
3655
|
token: "X-Namespace-Token"
|
|
3656
|
+
},
|
|
3657
|
+
hopx: {
|
|
3658
|
+
apiKey: "X-HOPX-API-Key"
|
|
3654
3659
|
}
|
|
3655
3660
|
};
|
|
3656
3661
|
var PROVIDER_ENV_MAP = {
|
|
@@ -3695,6 +3700,9 @@ var PROVIDER_ENV_MAP = {
|
|
|
3695
3700
|
},
|
|
3696
3701
|
namespace: {
|
|
3697
3702
|
NSC_TOKEN: "token"
|
|
3703
|
+
},
|
|
3704
|
+
hopx: {
|
|
3705
|
+
HOPX_API_KEY: "apiKey"
|
|
3698
3706
|
}
|
|
3699
3707
|
};
|
|
3700
3708
|
var PROVIDER_DASHBOARD_URLS = {
|
|
@@ -3708,7 +3716,8 @@ var PROVIDER_DASHBOARD_URLS = {
|
|
|
3708
3716
|
cloudflare: "https://dash.cloudflare.com/profile/api-tokens",
|
|
3709
3717
|
codesandbox: "https://codesandbox.io/dashboard/settings",
|
|
3710
3718
|
blaxel: "https://blaxel.ai/dashboard",
|
|
3711
|
-
namespace: "https://cloud.namespace.so"
|
|
3719
|
+
namespace: "https://cloud.namespace.so",
|
|
3720
|
+
hopx: "https://hopx.ai/dashboard"
|
|
3712
3721
|
};
|
|
3713
3722
|
function isValidProvider(name) {
|
|
3714
3723
|
return name in PROVIDER_AUTH;
|
|
@@ -3777,7 +3786,8 @@ var PROVIDER_PRIORITY = [
|
|
|
3777
3786
|
"cloudflare",
|
|
3778
3787
|
"codesandbox",
|
|
3779
3788
|
"blaxel",
|
|
3780
|
-
"namespace"
|
|
3789
|
+
"namespace",
|
|
3790
|
+
"hopx"
|
|
3781
3791
|
];
|
|
3782
3792
|
var PROVIDER_ENV_VARS = {
|
|
3783
3793
|
e2b: ["E2B_API_KEY"],
|
|
@@ -3790,7 +3800,8 @@ var PROVIDER_ENV_VARS = {
|
|
|
3790
3800
|
cloudflare: ["CLOUDFLARE_API_TOKEN", "CLOUDFLARE_ACCOUNT_ID"],
|
|
3791
3801
|
codesandbox: ["CSB_API_KEY"],
|
|
3792
3802
|
blaxel: ["BL_API_KEY", "BL_WORKSPACE"],
|
|
3793
|
-
namespace: ["NSC_TOKEN"]
|
|
3803
|
+
namespace: ["NSC_TOKEN"],
|
|
3804
|
+
hopx: ["HOPX_API_KEY"]
|
|
3794
3805
|
};
|
|
3795
3806
|
|
|
3796
3807
|
// src/auto-detect.ts
|
|
@@ -3912,6 +3923,11 @@ function getProviderHeaders(provider) {
|
|
|
3912
3923
|
headers["X-Namespace-Token"] = process.env.NSC_TOKEN;
|
|
3913
3924
|
}
|
|
3914
3925
|
break;
|
|
3926
|
+
case "hopx":
|
|
3927
|
+
if (process.env.HOPX_API_KEY) {
|
|
3928
|
+
headers["X-HOPX-API-Key"] = process.env.HOPX_API_KEY;
|
|
3929
|
+
}
|
|
3930
|
+
break;
|
|
3915
3931
|
}
|
|
3916
3932
|
return headers;
|
|
3917
3933
|
}
|
|
@@ -3949,6 +3965,7 @@ To fix this, set one of the following:
|
|
|
3949
3965
|
CodeSandbox: export CSB_API_KEY=xxx
|
|
3950
3966
|
Blaxel: export BL_API_KEY=xxx BL_WORKSPACE=xxx
|
|
3951
3967
|
Namespace: export NSC_TOKEN=xxx
|
|
3968
|
+
HopX: export HOPX_API_KEY=xxx
|
|
3952
3969
|
|
|
3953
3970
|
Or set COMPUTESDK_PROVIDER to specify explicitly:
|
|
3954
3971
|
export COMPUTESDK_PROVIDER=e2b
|