computesdk 2.5.2 → 2.5.3
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 +9 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +32 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +32 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -3854,7 +3854,9 @@ declare const PROVIDER_AUTH: {
|
|
|
3854
3854
|
readonly beam: readonly [readonly ["BEAM_TOKEN", "BEAM_WORKSPACE_ID"]];
|
|
3855
3855
|
readonly sprites: readonly [readonly ["SPRITES_TOKEN"]];
|
|
3856
3856
|
readonly freestyle: readonly [readonly ["FREESTYLE_API_KEY"]];
|
|
3857
|
+
readonly upstash: readonly [readonly ["UPSTASH_BOX_API_KEY"]];
|
|
3857
3858
|
readonly 'just-bash': readonly [readonly []];
|
|
3859
|
+
readonly 'secure-exec': readonly [readonly []];
|
|
3858
3860
|
};
|
|
3859
3861
|
/**
|
|
3860
3862
|
* All supported provider names (excluding gateway which is special)
|
|
@@ -3993,7 +3995,11 @@ interface ExplicitComputeConfig {
|
|
|
3993
3995
|
freestyle?: {
|
|
3994
3996
|
apiKey?: string;
|
|
3995
3997
|
};
|
|
3998
|
+
upstash?: {
|
|
3999
|
+
apiKey?: string;
|
|
4000
|
+
};
|
|
3996
4001
|
'just-bash'?: {};
|
|
4002
|
+
'secure-exec'?: {};
|
|
3997
4003
|
}
|
|
3998
4004
|
/**
|
|
3999
4005
|
* Options for creating a sandbox via the gateway
|
|
@@ -4242,7 +4248,7 @@ declare const TRIBUTARY_URL = "https://tributary.edge.computesdk.com";
|
|
|
4242
4248
|
* Provider detection priority order
|
|
4243
4249
|
* When multiple provider credentials are detected, use the first one in this list
|
|
4244
4250
|
*/
|
|
4245
|
-
declare const PROVIDER_PRIORITY: readonly ["e2b", "railway", "render", "daytona", "modal", "runloop", "vercel", "cloudflare", "codesandbox", "blaxel", "namespace", "hopx", "beam", "sprites", "freestyle"];
|
|
4251
|
+
declare const PROVIDER_PRIORITY: readonly ["e2b", "railway", "render", "daytona", "modal", "runloop", "vercel", "cloudflare", "codesandbox", "blaxel", "namespace", "hopx", "beam", "sprites", "freestyle", "upstash", "secure-exec"];
|
|
4246
4252
|
/**
|
|
4247
4253
|
* Required environment variables for each provider
|
|
4248
4254
|
* @deprecated Use PROVIDER_AUTH from provider-config instead
|
|
@@ -4263,7 +4269,9 @@ declare const PROVIDER_ENV_VARS: {
|
|
|
4263
4269
|
readonly beam: readonly ["BEAM_TOKEN", "BEAM_WORKSPACE_ID"];
|
|
4264
4270
|
readonly sprites: readonly ["SPRITES_TOKEN"];
|
|
4265
4271
|
readonly freestyle: readonly ["FREESTYLE_API_KEY"];
|
|
4272
|
+
readonly upstash: readonly ["UPSTASH_BOX_API_KEY"];
|
|
4266
4273
|
readonly 'just-bash': readonly [];
|
|
4274
|
+
readonly 'secure-exec': readonly [];
|
|
4267
4275
|
};
|
|
4268
4276
|
|
|
4269
4277
|
export { type CallableCompute, type CodeResult$1 as CodeResult, CommandExitError, type CommandResult$1 as CommandResult, type CreateSandboxOptions$1 as CreateSandboxOptions, type ExplicitComputeConfig, type FileEntry, FileWatcher, 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, type Snapshot, TRIBUTARY_URL, TerminalInstance, type WebSocketConstructor, autoConfigureCompute, buildProviderHeaders, buildSetupPayload, compute, decodeBinaryMessage, detectProvider, encodeBinaryMessage, encodeSetupPayload, getMissingEnvVars, getProviderConfigFromEnv, getProviderHeaders, isCommandExitError, isGatewayModeEnabled, isProviderAuthComplete, isValidProvider };
|
package/dist/index.d.ts
CHANGED
|
@@ -3854,7 +3854,9 @@ declare const PROVIDER_AUTH: {
|
|
|
3854
3854
|
readonly beam: readonly [readonly ["BEAM_TOKEN", "BEAM_WORKSPACE_ID"]];
|
|
3855
3855
|
readonly sprites: readonly [readonly ["SPRITES_TOKEN"]];
|
|
3856
3856
|
readonly freestyle: readonly [readonly ["FREESTYLE_API_KEY"]];
|
|
3857
|
+
readonly upstash: readonly [readonly ["UPSTASH_BOX_API_KEY"]];
|
|
3857
3858
|
readonly 'just-bash': readonly [readonly []];
|
|
3859
|
+
readonly 'secure-exec': readonly [readonly []];
|
|
3858
3860
|
};
|
|
3859
3861
|
/**
|
|
3860
3862
|
* All supported provider names (excluding gateway which is special)
|
|
@@ -3993,7 +3995,11 @@ interface ExplicitComputeConfig {
|
|
|
3993
3995
|
freestyle?: {
|
|
3994
3996
|
apiKey?: string;
|
|
3995
3997
|
};
|
|
3998
|
+
upstash?: {
|
|
3999
|
+
apiKey?: string;
|
|
4000
|
+
};
|
|
3996
4001
|
'just-bash'?: {};
|
|
4002
|
+
'secure-exec'?: {};
|
|
3997
4003
|
}
|
|
3998
4004
|
/**
|
|
3999
4005
|
* Options for creating a sandbox via the gateway
|
|
@@ -4242,7 +4248,7 @@ declare const TRIBUTARY_URL = "https://tributary.edge.computesdk.com";
|
|
|
4242
4248
|
* Provider detection priority order
|
|
4243
4249
|
* When multiple provider credentials are detected, use the first one in this list
|
|
4244
4250
|
*/
|
|
4245
|
-
declare const PROVIDER_PRIORITY: readonly ["e2b", "railway", "render", "daytona", "modal", "runloop", "vercel", "cloudflare", "codesandbox", "blaxel", "namespace", "hopx", "beam", "sprites", "freestyle"];
|
|
4251
|
+
declare const PROVIDER_PRIORITY: readonly ["e2b", "railway", "render", "daytona", "modal", "runloop", "vercel", "cloudflare", "codesandbox", "blaxel", "namespace", "hopx", "beam", "sprites", "freestyle", "upstash", "secure-exec"];
|
|
4246
4252
|
/**
|
|
4247
4253
|
* Required environment variables for each provider
|
|
4248
4254
|
* @deprecated Use PROVIDER_AUTH from provider-config instead
|
|
@@ -4263,7 +4269,9 @@ declare const PROVIDER_ENV_VARS: {
|
|
|
4263
4269
|
readonly beam: readonly ["BEAM_TOKEN", "BEAM_WORKSPACE_ID"];
|
|
4264
4270
|
readonly sprites: readonly ["SPRITES_TOKEN"];
|
|
4265
4271
|
readonly freestyle: readonly ["FREESTYLE_API_KEY"];
|
|
4272
|
+
readonly upstash: readonly ["UPSTASH_BOX_API_KEY"];
|
|
4266
4273
|
readonly 'just-bash': readonly [];
|
|
4274
|
+
readonly 'secure-exec': readonly [];
|
|
4267
4275
|
};
|
|
4268
4276
|
|
|
4269
4277
|
export { type CallableCompute, type CodeResult$1 as CodeResult, CommandExitError, type CommandResult$1 as CommandResult, type CreateSandboxOptions$1 as CreateSandboxOptions, type ExplicitComputeConfig, type FileEntry, FileWatcher, 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, type Snapshot, TRIBUTARY_URL, TerminalInstance, type WebSocketConstructor, autoConfigureCompute, buildProviderHeaders, buildSetupPayload, compute, decodeBinaryMessage, detectProvider, encodeBinaryMessage, encodeSetupPayload, getMissingEnvVars, getProviderConfigFromEnv, getProviderHeaders, isCommandExitError, isGatewayModeEnabled, isProviderAuthComplete, isValidProvider };
|
package/dist/index.js
CHANGED
|
@@ -3652,7 +3652,9 @@ var PROVIDER_AUTH = {
|
|
|
3652
3652
|
beam: [["BEAM_TOKEN", "BEAM_WORKSPACE_ID"]],
|
|
3653
3653
|
sprites: [["SPRITES_TOKEN"]],
|
|
3654
3654
|
freestyle: [["FREESTYLE_API_KEY"]],
|
|
3655
|
-
|
|
3655
|
+
upstash: [["UPSTASH_BOX_API_KEY"]],
|
|
3656
|
+
"just-bash": [[]],
|
|
3657
|
+
"secure-exec": [[]]
|
|
3656
3658
|
};
|
|
3657
3659
|
var PROVIDER_NAMES = Object.keys(PROVIDER_AUTH);
|
|
3658
3660
|
var PROVIDER_HEADERS = {
|
|
@@ -3713,7 +3715,11 @@ var PROVIDER_HEADERS = {
|
|
|
3713
3715
|
freestyle: {
|
|
3714
3716
|
apiKey: "X-Freestyle-API-Key"
|
|
3715
3717
|
},
|
|
3716
|
-
|
|
3718
|
+
upstash: {
|
|
3719
|
+
apiKey: "X-Upstash-Box-API-Key"
|
|
3720
|
+
},
|
|
3721
|
+
"just-bash": {},
|
|
3722
|
+
"secure-exec": {}
|
|
3717
3723
|
};
|
|
3718
3724
|
var PROVIDER_ENV_MAP = {
|
|
3719
3725
|
e2b: {
|
|
@@ -3774,7 +3780,11 @@ var PROVIDER_ENV_MAP = {
|
|
|
3774
3780
|
freestyle: {
|
|
3775
3781
|
FREESTYLE_API_KEY: "apiKey"
|
|
3776
3782
|
},
|
|
3777
|
-
|
|
3783
|
+
upstash: {
|
|
3784
|
+
UPSTASH_BOX_API_KEY: "apiKey"
|
|
3785
|
+
},
|
|
3786
|
+
"just-bash": {},
|
|
3787
|
+
"secure-exec": {}
|
|
3778
3788
|
};
|
|
3779
3789
|
var PROVIDER_DASHBOARD_URLS = {
|
|
3780
3790
|
e2b: "https://e2b.dev/dashboard",
|
|
@@ -3792,7 +3802,9 @@ var PROVIDER_DASHBOARD_URLS = {
|
|
|
3792
3802
|
beam: "https://app.beam.cloud",
|
|
3793
3803
|
sprites: "https://sprites.dev",
|
|
3794
3804
|
freestyle: "https://dash.freestyle.sh",
|
|
3795
|
-
|
|
3805
|
+
upstash: "https://console.upstash.com",
|
|
3806
|
+
"just-bash": "https://github.com/vercel-labs/just-bash",
|
|
3807
|
+
"secure-exec": "https://github.com/anomalyco/secure-exec"
|
|
3796
3808
|
};
|
|
3797
3809
|
function isValidProvider(name) {
|
|
3798
3810
|
return name in PROVIDER_AUTH;
|
|
@@ -3865,7 +3877,9 @@ var PROVIDER_PRIORITY = [
|
|
|
3865
3877
|
"hopx",
|
|
3866
3878
|
"beam",
|
|
3867
3879
|
"sprites",
|
|
3868
|
-
"freestyle"
|
|
3880
|
+
"freestyle",
|
|
3881
|
+
"upstash",
|
|
3882
|
+
"secure-exec"
|
|
3869
3883
|
];
|
|
3870
3884
|
var PROVIDER_ENV_VARS = {
|
|
3871
3885
|
e2b: ["E2B_API_KEY"],
|
|
@@ -3883,7 +3897,9 @@ var PROVIDER_ENV_VARS = {
|
|
|
3883
3897
|
beam: ["BEAM_TOKEN", "BEAM_WORKSPACE_ID"],
|
|
3884
3898
|
sprites: ["SPRITES_TOKEN"],
|
|
3885
3899
|
freestyle: ["FREESTYLE_API_KEY"],
|
|
3886
|
-
|
|
3900
|
+
upstash: ["UPSTASH_BOX_API_KEY"],
|
|
3901
|
+
"just-bash": [],
|
|
3902
|
+
"secure-exec": []
|
|
3887
3903
|
};
|
|
3888
3904
|
|
|
3889
3905
|
// src/auto-detect.ts
|
|
@@ -3893,7 +3909,7 @@ function isGatewayModeEnabled() {
|
|
|
3893
3909
|
function hasProviderEnv(provider) {
|
|
3894
3910
|
if (typeof process === "undefined") return false;
|
|
3895
3911
|
const requiredVars = PROVIDER_ENV_VARS[provider];
|
|
3896
|
-
if (!requiredVars) return false;
|
|
3912
|
+
if (!requiredVars || requiredVars.length === 0) return false;
|
|
3897
3913
|
return requiredVars.every((varName) => !!process.env?.[varName]);
|
|
3898
3914
|
}
|
|
3899
3915
|
function getProviderEnvStatus(provider) {
|
|
@@ -4033,6 +4049,13 @@ function getProviderHeaders(provider) {
|
|
|
4033
4049
|
break;
|
|
4034
4050
|
case "just-bash":
|
|
4035
4051
|
break;
|
|
4052
|
+
case "secure-exec":
|
|
4053
|
+
break;
|
|
4054
|
+
case "upstash":
|
|
4055
|
+
if (process.env.UPSTASH_BOX_API_KEY) {
|
|
4056
|
+
headers["X-Upstash-Box-API-Key"] = process.env.UPSTASH_BOX_API_KEY;
|
|
4057
|
+
}
|
|
4058
|
+
break;
|
|
4036
4059
|
}
|
|
4037
4060
|
return headers;
|
|
4038
4061
|
}
|
|
@@ -4074,7 +4097,9 @@ To fix this, set one of the following:
|
|
|
4074
4097
|
Render: export RENDER_API_KEY=xxx RENDER_OWNER_ID=xxx
|
|
4075
4098
|
Beam: export BEAM_TOKEN=xxx BEAM_WORKSPACE_ID=xxx
|
|
4076
4099
|
Sprites: export SPRITES_TOKEN=xxx
|
|
4100
|
+
Upstash: export UPSTASH_BOX_API_KEY=xxx
|
|
4077
4101
|
just-bash: (no credentials needed - local sandbox)
|
|
4102
|
+
secure-exec: (no credentials needed - local sandbox)
|
|
4078
4103
|
|
|
4079
4104
|
Or set COMPUTESDK_PROVIDER to specify explicitly:
|
|
4080
4105
|
export COMPUTESDK_PROVIDER=<provider>
|