computesdk 2.3.0 → 2.4.0
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/README.md +1 -1
- package/dist/index.d.mts +15 -1
- package/dist/index.d.ts +15 -1
- package/dist/index.js +51 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +51 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# computesdk
|
|
2
2
|
|
|
3
|
-
The
|
|
3
|
+
The universal SDK for running code in remote sandboxes. Zero-config auto-detection with support for E2B, Modal, Railway, Daytona, Vercel, and more.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
package/dist/index.d.mts
CHANGED
|
@@ -3838,6 +3838,9 @@ declare const PROVIDER_AUTH: {
|
|
|
3838
3838
|
readonly blaxel: readonly [readonly ["BL_API_KEY", "BL_WORKSPACE"]];
|
|
3839
3839
|
readonly namespace: readonly [readonly ["NSC_TOKEN"], readonly ["NSC_TOKEN_FILE"]];
|
|
3840
3840
|
readonly hopx: readonly [readonly ["HOPX_API_KEY"]];
|
|
3841
|
+
readonly beam: readonly [readonly ["BEAM_TOKEN", "BEAM_WORKSPACE_ID"]];
|
|
3842
|
+
readonly sprites: readonly [readonly ["SPRITES_TOKEN"]];
|
|
3843
|
+
readonly 'just-bash': readonly [readonly []];
|
|
3841
3844
|
};
|
|
3842
3845
|
/**
|
|
3843
3846
|
* All supported provider names (excluding gateway which is special)
|
|
@@ -3966,6 +3969,14 @@ interface ExplicitComputeConfig {
|
|
|
3966
3969
|
hopx?: {
|
|
3967
3970
|
apiKey?: string;
|
|
3968
3971
|
};
|
|
3972
|
+
beam?: {
|
|
3973
|
+
token?: string;
|
|
3974
|
+
workspaceId?: string;
|
|
3975
|
+
};
|
|
3976
|
+
sprites?: {
|
|
3977
|
+
apiKey?: string;
|
|
3978
|
+
};
|
|
3979
|
+
'just-bash'?: {};
|
|
3969
3980
|
}
|
|
3970
3981
|
/**
|
|
3971
3982
|
* Options for creating a sandbox via the gateway
|
|
@@ -4184,7 +4195,7 @@ declare const GATEWAY_URL = "https://gateway.computesdk.com";
|
|
|
4184
4195
|
* Provider detection priority order
|
|
4185
4196
|
* When multiple provider credentials are detected, use the first one in this list
|
|
4186
4197
|
*/
|
|
4187
|
-
declare const PROVIDER_PRIORITY: readonly ["e2b", "railway", "render", "daytona", "modal", "runloop", "vercel", "cloudflare", "codesandbox", "blaxel", "namespace", "hopx"];
|
|
4198
|
+
declare const PROVIDER_PRIORITY: readonly ["e2b", "railway", "render", "daytona", "modal", "runloop", "vercel", "cloudflare", "codesandbox", "blaxel", "namespace", "hopx", "beam", "sprites"];
|
|
4188
4199
|
/**
|
|
4189
4200
|
* Required environment variables for each provider
|
|
4190
4201
|
* @deprecated Use PROVIDER_AUTH from provider-config instead
|
|
@@ -4202,6 +4213,9 @@ declare const PROVIDER_ENV_VARS: {
|
|
|
4202
4213
|
readonly blaxel: readonly ["BL_API_KEY", "BL_WORKSPACE"];
|
|
4203
4214
|
readonly namespace: readonly ["NSC_TOKEN"];
|
|
4204
4215
|
readonly hopx: readonly ["HOPX_API_KEY"];
|
|
4216
|
+
readonly beam: readonly ["BEAM_TOKEN", "BEAM_WORKSPACE_ID"];
|
|
4217
|
+
readonly sprites: readonly ["SPRITES_TOKEN"];
|
|
4218
|
+
readonly 'just-bash': readonly [];
|
|
4205
4219
|
};
|
|
4206
4220
|
|
|
4207
4221
|
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
|
@@ -3838,6 +3838,9 @@ declare const PROVIDER_AUTH: {
|
|
|
3838
3838
|
readonly blaxel: readonly [readonly ["BL_API_KEY", "BL_WORKSPACE"]];
|
|
3839
3839
|
readonly namespace: readonly [readonly ["NSC_TOKEN"], readonly ["NSC_TOKEN_FILE"]];
|
|
3840
3840
|
readonly hopx: readonly [readonly ["HOPX_API_KEY"]];
|
|
3841
|
+
readonly beam: readonly [readonly ["BEAM_TOKEN", "BEAM_WORKSPACE_ID"]];
|
|
3842
|
+
readonly sprites: readonly [readonly ["SPRITES_TOKEN"]];
|
|
3843
|
+
readonly 'just-bash': readonly [readonly []];
|
|
3841
3844
|
};
|
|
3842
3845
|
/**
|
|
3843
3846
|
* All supported provider names (excluding gateway which is special)
|
|
@@ -3966,6 +3969,14 @@ interface ExplicitComputeConfig {
|
|
|
3966
3969
|
hopx?: {
|
|
3967
3970
|
apiKey?: string;
|
|
3968
3971
|
};
|
|
3972
|
+
beam?: {
|
|
3973
|
+
token?: string;
|
|
3974
|
+
workspaceId?: string;
|
|
3975
|
+
};
|
|
3976
|
+
sprites?: {
|
|
3977
|
+
apiKey?: string;
|
|
3978
|
+
};
|
|
3979
|
+
'just-bash'?: {};
|
|
3969
3980
|
}
|
|
3970
3981
|
/**
|
|
3971
3982
|
* Options for creating a sandbox via the gateway
|
|
@@ -4184,7 +4195,7 @@ declare const GATEWAY_URL = "https://gateway.computesdk.com";
|
|
|
4184
4195
|
* Provider detection priority order
|
|
4185
4196
|
* When multiple provider credentials are detected, use the first one in this list
|
|
4186
4197
|
*/
|
|
4187
|
-
declare const PROVIDER_PRIORITY: readonly ["e2b", "railway", "render", "daytona", "modal", "runloop", "vercel", "cloudflare", "codesandbox", "blaxel", "namespace", "hopx"];
|
|
4198
|
+
declare const PROVIDER_PRIORITY: readonly ["e2b", "railway", "render", "daytona", "modal", "runloop", "vercel", "cloudflare", "codesandbox", "blaxel", "namespace", "hopx", "beam", "sprites"];
|
|
4188
4199
|
/**
|
|
4189
4200
|
* Required environment variables for each provider
|
|
4190
4201
|
* @deprecated Use PROVIDER_AUTH from provider-config instead
|
|
@@ -4202,6 +4213,9 @@ declare const PROVIDER_ENV_VARS: {
|
|
|
4202
4213
|
readonly blaxel: readonly ["BL_API_KEY", "BL_WORKSPACE"];
|
|
4203
4214
|
readonly namespace: readonly ["NSC_TOKEN"];
|
|
4204
4215
|
readonly hopx: readonly ["HOPX_API_KEY"];
|
|
4216
|
+
readonly beam: readonly ["BEAM_TOKEN", "BEAM_WORKSPACE_ID"];
|
|
4217
|
+
readonly sprites: readonly ["SPRITES_TOKEN"];
|
|
4218
|
+
readonly 'just-bash': readonly [];
|
|
4205
4219
|
};
|
|
4206
4220
|
|
|
4207
4221
|
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
|
@@ -3645,7 +3645,10 @@ var PROVIDER_AUTH = {
|
|
|
3645
3645
|
codesandbox: [["CSB_API_KEY"]],
|
|
3646
3646
|
blaxel: [["BL_API_KEY", "BL_WORKSPACE"]],
|
|
3647
3647
|
namespace: [["NSC_TOKEN"], ["NSC_TOKEN_FILE"]],
|
|
3648
|
-
hopx: [["HOPX_API_KEY"]]
|
|
3648
|
+
hopx: [["HOPX_API_KEY"]],
|
|
3649
|
+
beam: [["BEAM_TOKEN", "BEAM_WORKSPACE_ID"]],
|
|
3650
|
+
sprites: [["SPRITES_TOKEN"]],
|
|
3651
|
+
"just-bash": [[]]
|
|
3649
3652
|
};
|
|
3650
3653
|
var PROVIDER_NAMES = Object.keys(PROVIDER_AUTH);
|
|
3651
3654
|
var PROVIDER_HEADERS = {
|
|
@@ -3693,7 +3696,15 @@ var PROVIDER_HEADERS = {
|
|
|
3693
3696
|
},
|
|
3694
3697
|
hopx: {
|
|
3695
3698
|
apiKey: "X-HOPX-API-Key"
|
|
3696
|
-
}
|
|
3699
|
+
},
|
|
3700
|
+
beam: {
|
|
3701
|
+
token: "X-Beam-Token",
|
|
3702
|
+
workspaceId: "X-Beam-Workspace-Id"
|
|
3703
|
+
},
|
|
3704
|
+
sprites: {
|
|
3705
|
+
apiKey: "X-Sprites-Token"
|
|
3706
|
+
},
|
|
3707
|
+
"just-bash": {}
|
|
3697
3708
|
};
|
|
3698
3709
|
var PROVIDER_ENV_MAP = {
|
|
3699
3710
|
e2b: {
|
|
@@ -3741,7 +3752,15 @@ var PROVIDER_ENV_MAP = {
|
|
|
3741
3752
|
},
|
|
3742
3753
|
hopx: {
|
|
3743
3754
|
HOPX_API_KEY: "apiKey"
|
|
3744
|
-
}
|
|
3755
|
+
},
|
|
3756
|
+
beam: {
|
|
3757
|
+
BEAM_TOKEN: "token",
|
|
3758
|
+
BEAM_WORKSPACE_ID: "workspaceId"
|
|
3759
|
+
},
|
|
3760
|
+
sprites: {
|
|
3761
|
+
SPRITES_TOKEN: "apiKey"
|
|
3762
|
+
},
|
|
3763
|
+
"just-bash": {}
|
|
3745
3764
|
};
|
|
3746
3765
|
var PROVIDER_DASHBOARD_URLS = {
|
|
3747
3766
|
e2b: "https://e2b.dev/dashboard",
|
|
@@ -3755,7 +3774,10 @@ var PROVIDER_DASHBOARD_URLS = {
|
|
|
3755
3774
|
codesandbox: "https://codesandbox.io/dashboard/settings",
|
|
3756
3775
|
blaxel: "https://blaxel.ai/dashboard",
|
|
3757
3776
|
namespace: "https://cloud.namespace.so",
|
|
3758
|
-
hopx: "https://hopx.ai/dashboard"
|
|
3777
|
+
hopx: "https://hopx.ai/dashboard",
|
|
3778
|
+
beam: "https://app.beam.cloud",
|
|
3779
|
+
sprites: "https://sprites.dev",
|
|
3780
|
+
"just-bash": "https://github.com/vercel-labs/just-bash"
|
|
3759
3781
|
};
|
|
3760
3782
|
function isValidProvider(name) {
|
|
3761
3783
|
return name in PROVIDER_AUTH;
|
|
@@ -3825,7 +3847,9 @@ var PROVIDER_PRIORITY = [
|
|
|
3825
3847
|
"codesandbox",
|
|
3826
3848
|
"blaxel",
|
|
3827
3849
|
"namespace",
|
|
3828
|
-
"hopx"
|
|
3850
|
+
"hopx",
|
|
3851
|
+
"beam",
|
|
3852
|
+
"sprites"
|
|
3829
3853
|
];
|
|
3830
3854
|
var PROVIDER_ENV_VARS = {
|
|
3831
3855
|
e2b: ["E2B_API_KEY"],
|
|
@@ -3839,7 +3863,10 @@ var PROVIDER_ENV_VARS = {
|
|
|
3839
3863
|
codesandbox: ["CSB_API_KEY"],
|
|
3840
3864
|
blaxel: ["BL_API_KEY", "BL_WORKSPACE"],
|
|
3841
3865
|
namespace: ["NSC_TOKEN"],
|
|
3842
|
-
hopx: ["HOPX_API_KEY"]
|
|
3866
|
+
hopx: ["HOPX_API_KEY"],
|
|
3867
|
+
beam: ["BEAM_TOKEN", "BEAM_WORKSPACE_ID"],
|
|
3868
|
+
sprites: ["SPRITES_TOKEN"],
|
|
3869
|
+
"just-bash": []
|
|
3843
3870
|
};
|
|
3844
3871
|
|
|
3845
3872
|
// src/auto-detect.ts
|
|
@@ -3974,6 +4001,21 @@ function getProviderHeaders(provider) {
|
|
|
3974
4001
|
headers["X-Render-Owner-ID"] = process.env.RENDER_OWNER_ID;
|
|
3975
4002
|
}
|
|
3976
4003
|
break;
|
|
4004
|
+
case "beam":
|
|
4005
|
+
if (process.env.BEAM_TOKEN) {
|
|
4006
|
+
headers["X-Beam-Token"] = process.env.BEAM_TOKEN;
|
|
4007
|
+
}
|
|
4008
|
+
if (process.env.BEAM_WORKSPACE_ID) {
|
|
4009
|
+
headers["X-Beam-Workspace-Id"] = process.env.BEAM_WORKSPACE_ID;
|
|
4010
|
+
}
|
|
4011
|
+
break;
|
|
4012
|
+
case "sprites":
|
|
4013
|
+
if (process.env.SPRITES_TOKEN) {
|
|
4014
|
+
headers["X-Sprites-Token"] = process.env.SPRITES_TOKEN;
|
|
4015
|
+
}
|
|
4016
|
+
break;
|
|
4017
|
+
case "just-bash":
|
|
4018
|
+
break;
|
|
3977
4019
|
}
|
|
3978
4020
|
return headers;
|
|
3979
4021
|
}
|
|
@@ -4013,6 +4055,9 @@ To fix this, set one of the following:
|
|
|
4013
4055
|
Namespace: export NSC_TOKEN=xxx
|
|
4014
4056
|
HopX: export HOPX_API_KEY=xxx
|
|
4015
4057
|
Render: export RENDER_API_KEY=xxx RENDER_OWNER_ID=xxx
|
|
4058
|
+
Beam: export BEAM_TOKEN=xxx BEAM_WORKSPACE_ID=xxx
|
|
4059
|
+
Sprites: export SPRITES_TOKEN=xxx
|
|
4060
|
+
just-bash: (no credentials needed - local sandbox)
|
|
4016
4061
|
|
|
4017
4062
|
Or set COMPUTESDK_PROVIDER to specify explicitly:
|
|
4018
4063
|
export COMPUTESDK_PROVIDER=<provider>
|