computesdk 1.16.0 → 1.18.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/dist/index.d.mts +15 -2
- package/dist/index.d.ts +15 -2
- package/dist/index.js +18 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -3583,6 +3583,7 @@ declare const PROVIDER_AUTH: {
|
|
|
3583
3583
|
readonly e2b: readonly [readonly ["E2B_API_KEY"]];
|
|
3584
3584
|
readonly modal: readonly [readonly ["MODAL_TOKEN_ID", "MODAL_TOKEN_SECRET"]];
|
|
3585
3585
|
readonly railway: readonly [readonly ["RAILWAY_API_KEY", "RAILWAY_PROJECT_ID", "RAILWAY_ENVIRONMENT_ID"]];
|
|
3586
|
+
readonly render: readonly [readonly ["RENDER_API_KEY", "RENDER_OWNER_ID"]];
|
|
3586
3587
|
readonly daytona: readonly [readonly ["DAYTONA_API_KEY"]];
|
|
3587
3588
|
readonly vercel: readonly [readonly ["VERCEL_OIDC_TOKEN"], readonly ["VERCEL_TOKEN", "VERCEL_TEAM_ID", "VERCEL_PROJECT_ID"]];
|
|
3588
3589
|
readonly runloop: readonly [readonly ["RUNLOOP_API_KEY"]];
|
|
@@ -3657,6 +3658,11 @@ interface ExplicitComputeConfig {
|
|
|
3657
3658
|
computesdkApiKey?: string;
|
|
3658
3659
|
/** Optional gateway URL override */
|
|
3659
3660
|
gatewayUrl?: string;
|
|
3661
|
+
/**
|
|
3662
|
+
* WebSocket implementation for environments without native WebSocket support.
|
|
3663
|
+
* In Node.js < 22, pass the 'ws' package: `import WebSocket from 'ws'`
|
|
3664
|
+
*/
|
|
3665
|
+
WebSocket?: WebSocketConstructor;
|
|
3660
3666
|
/** Provider-specific configurations */
|
|
3661
3667
|
e2b?: {
|
|
3662
3668
|
apiKey?: string;
|
|
@@ -3672,6 +3678,10 @@ interface ExplicitComputeConfig {
|
|
|
3672
3678
|
projectId?: string;
|
|
3673
3679
|
environmentId?: string;
|
|
3674
3680
|
};
|
|
3681
|
+
render?: {
|
|
3682
|
+
apiKey?: string;
|
|
3683
|
+
serviceId?: string;
|
|
3684
|
+
};
|
|
3675
3685
|
daytona?: {
|
|
3676
3686
|
apiKey?: string;
|
|
3677
3687
|
};
|
|
@@ -3833,6 +3843,7 @@ declare const compute: CallableCompute;
|
|
|
3833
3843
|
* Automatically detects gateway mode and provider from environment variables.
|
|
3834
3844
|
* Enables zero-config usage of ComputeSDK.
|
|
3835
3845
|
*/
|
|
3846
|
+
|
|
3836
3847
|
/**
|
|
3837
3848
|
* Check if gateway mode is enabled
|
|
3838
3849
|
* Gateway mode requires COMPUTESDK_API_KEY to be set
|
|
@@ -3861,6 +3872,7 @@ interface GatewayConfig {
|
|
|
3861
3872
|
gatewayUrl: string;
|
|
3862
3873
|
provider: string;
|
|
3863
3874
|
providerHeaders: Record<string, string>;
|
|
3875
|
+
WebSocket?: WebSocketConstructor;
|
|
3864
3876
|
}
|
|
3865
3877
|
/**
|
|
3866
3878
|
* Main auto-configuration function
|
|
@@ -3884,7 +3896,7 @@ declare const GATEWAY_URL = "https://gateway.computesdk.com";
|
|
|
3884
3896
|
* Provider detection priority order
|
|
3885
3897
|
* When multiple provider credentials are detected, use the first one in this list
|
|
3886
3898
|
*/
|
|
3887
|
-
declare const PROVIDER_PRIORITY: readonly ["e2b", "railway", "daytona", "modal", "runloop", "vercel", "cloudflare", "codesandbox", "blaxel"];
|
|
3899
|
+
declare const PROVIDER_PRIORITY: readonly ["e2b", "railway", "render", "daytona", "modal", "runloop", "vercel", "cloudflare", "codesandbox", "blaxel"];
|
|
3888
3900
|
/**
|
|
3889
3901
|
* Required environment variables for each provider
|
|
3890
3902
|
* @deprecated Use PROVIDER_AUTH from provider-config instead
|
|
@@ -3892,6 +3904,7 @@ declare const PROVIDER_PRIORITY: readonly ["e2b", "railway", "daytona", "modal",
|
|
|
3892
3904
|
declare const PROVIDER_ENV_VARS: {
|
|
3893
3905
|
readonly e2b: readonly ["E2B_API_KEY"];
|
|
3894
3906
|
readonly railway: readonly ["RAILWAY_API_KEY", "RAILWAY_PROJECT_ID", "RAILWAY_ENVIRONMENT_ID"];
|
|
3907
|
+
readonly render: readonly ["RENDER_API_KEY", "RENDER_OWNER_ID"];
|
|
3895
3908
|
readonly daytona: readonly ["DAYTONA_API_KEY"];
|
|
3896
3909
|
readonly modal: readonly ["MODAL_TOKEN_ID", "MODAL_TOKEN_SECRET"];
|
|
3897
3910
|
readonly runloop: readonly ["RUNLOOP_API_KEY"];
|
|
@@ -3901,4 +3914,4 @@ declare const PROVIDER_ENV_VARS: {
|
|
|
3901
3914
|
readonly blaxel: readonly ["BL_API_KEY", "BL_WORKSPACE"];
|
|
3902
3915
|
};
|
|
3903
3916
|
|
|
3904
|
-
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, SignalService, TerminalInstance, autoConfigureCompute, buildProviderHeaders, compute, decodeBinaryMessage, detectProvider, encodeBinaryMessage, getMissingEnvVars, getProviderConfigFromEnv, getProviderHeaders, isCommandExitError, isGatewayModeEnabled, isProviderAuthComplete, isValidProvider };
|
|
3917
|
+
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, SignalService, TerminalInstance, type WebSocketConstructor, autoConfigureCompute, buildProviderHeaders, compute, decodeBinaryMessage, detectProvider, encodeBinaryMessage, getMissingEnvVars, getProviderConfigFromEnv, getProviderHeaders, isCommandExitError, isGatewayModeEnabled, isProviderAuthComplete, isValidProvider };
|
package/dist/index.d.ts
CHANGED
|
@@ -3583,6 +3583,7 @@ declare const PROVIDER_AUTH: {
|
|
|
3583
3583
|
readonly e2b: readonly [readonly ["E2B_API_KEY"]];
|
|
3584
3584
|
readonly modal: readonly [readonly ["MODAL_TOKEN_ID", "MODAL_TOKEN_SECRET"]];
|
|
3585
3585
|
readonly railway: readonly [readonly ["RAILWAY_API_KEY", "RAILWAY_PROJECT_ID", "RAILWAY_ENVIRONMENT_ID"]];
|
|
3586
|
+
readonly render: readonly [readonly ["RENDER_API_KEY", "RENDER_OWNER_ID"]];
|
|
3586
3587
|
readonly daytona: readonly [readonly ["DAYTONA_API_KEY"]];
|
|
3587
3588
|
readonly vercel: readonly [readonly ["VERCEL_OIDC_TOKEN"], readonly ["VERCEL_TOKEN", "VERCEL_TEAM_ID", "VERCEL_PROJECT_ID"]];
|
|
3588
3589
|
readonly runloop: readonly [readonly ["RUNLOOP_API_KEY"]];
|
|
@@ -3657,6 +3658,11 @@ interface ExplicitComputeConfig {
|
|
|
3657
3658
|
computesdkApiKey?: string;
|
|
3658
3659
|
/** Optional gateway URL override */
|
|
3659
3660
|
gatewayUrl?: string;
|
|
3661
|
+
/**
|
|
3662
|
+
* WebSocket implementation for environments without native WebSocket support.
|
|
3663
|
+
* In Node.js < 22, pass the 'ws' package: `import WebSocket from 'ws'`
|
|
3664
|
+
*/
|
|
3665
|
+
WebSocket?: WebSocketConstructor;
|
|
3660
3666
|
/** Provider-specific configurations */
|
|
3661
3667
|
e2b?: {
|
|
3662
3668
|
apiKey?: string;
|
|
@@ -3672,6 +3678,10 @@ interface ExplicitComputeConfig {
|
|
|
3672
3678
|
projectId?: string;
|
|
3673
3679
|
environmentId?: string;
|
|
3674
3680
|
};
|
|
3681
|
+
render?: {
|
|
3682
|
+
apiKey?: string;
|
|
3683
|
+
serviceId?: string;
|
|
3684
|
+
};
|
|
3675
3685
|
daytona?: {
|
|
3676
3686
|
apiKey?: string;
|
|
3677
3687
|
};
|
|
@@ -3833,6 +3843,7 @@ declare const compute: CallableCompute;
|
|
|
3833
3843
|
* Automatically detects gateway mode and provider from environment variables.
|
|
3834
3844
|
* Enables zero-config usage of ComputeSDK.
|
|
3835
3845
|
*/
|
|
3846
|
+
|
|
3836
3847
|
/**
|
|
3837
3848
|
* Check if gateway mode is enabled
|
|
3838
3849
|
* Gateway mode requires COMPUTESDK_API_KEY to be set
|
|
@@ -3861,6 +3872,7 @@ interface GatewayConfig {
|
|
|
3861
3872
|
gatewayUrl: string;
|
|
3862
3873
|
provider: string;
|
|
3863
3874
|
providerHeaders: Record<string, string>;
|
|
3875
|
+
WebSocket?: WebSocketConstructor;
|
|
3864
3876
|
}
|
|
3865
3877
|
/**
|
|
3866
3878
|
* Main auto-configuration function
|
|
@@ -3884,7 +3896,7 @@ declare const GATEWAY_URL = "https://gateway.computesdk.com";
|
|
|
3884
3896
|
* Provider detection priority order
|
|
3885
3897
|
* When multiple provider credentials are detected, use the first one in this list
|
|
3886
3898
|
*/
|
|
3887
|
-
declare const PROVIDER_PRIORITY: readonly ["e2b", "railway", "daytona", "modal", "runloop", "vercel", "cloudflare", "codesandbox", "blaxel"];
|
|
3899
|
+
declare const PROVIDER_PRIORITY: readonly ["e2b", "railway", "render", "daytona", "modal", "runloop", "vercel", "cloudflare", "codesandbox", "blaxel"];
|
|
3888
3900
|
/**
|
|
3889
3901
|
* Required environment variables for each provider
|
|
3890
3902
|
* @deprecated Use PROVIDER_AUTH from provider-config instead
|
|
@@ -3892,6 +3904,7 @@ declare const PROVIDER_PRIORITY: readonly ["e2b", "railway", "daytona", "modal",
|
|
|
3892
3904
|
declare const PROVIDER_ENV_VARS: {
|
|
3893
3905
|
readonly e2b: readonly ["E2B_API_KEY"];
|
|
3894
3906
|
readonly railway: readonly ["RAILWAY_API_KEY", "RAILWAY_PROJECT_ID", "RAILWAY_ENVIRONMENT_ID"];
|
|
3907
|
+
readonly render: readonly ["RENDER_API_KEY", "RENDER_OWNER_ID"];
|
|
3895
3908
|
readonly daytona: readonly ["DAYTONA_API_KEY"];
|
|
3896
3909
|
readonly modal: readonly ["MODAL_TOKEN_ID", "MODAL_TOKEN_SECRET"];
|
|
3897
3910
|
readonly runloop: readonly ["RUNLOOP_API_KEY"];
|
|
@@ -3901,4 +3914,4 @@ declare const PROVIDER_ENV_VARS: {
|
|
|
3901
3914
|
readonly blaxel: readonly ["BL_API_KEY", "BL_WORKSPACE"];
|
|
3902
3915
|
};
|
|
3903
3916
|
|
|
3904
|
-
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, SignalService, TerminalInstance, autoConfigureCompute, buildProviderHeaders, compute, decodeBinaryMessage, detectProvider, encodeBinaryMessage, getMissingEnvVars, getProviderConfigFromEnv, getProviderHeaders, isCommandExitError, isGatewayModeEnabled, isProviderAuthComplete, isValidProvider };
|
|
3917
|
+
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, SignalService, TerminalInstance, type WebSocketConstructor, autoConfigureCompute, buildProviderHeaders, compute, decodeBinaryMessage, detectProvider, encodeBinaryMessage, getMissingEnvVars, getProviderConfigFromEnv, getProviderHeaders, isCommandExitError, isGatewayModeEnabled, isProviderAuthComplete, isValidProvider };
|
package/dist/index.js
CHANGED
|
@@ -3472,6 +3472,7 @@ var PROVIDER_AUTH = {
|
|
|
3472
3472
|
e2b: [["E2B_API_KEY"]],
|
|
3473
3473
|
modal: [["MODAL_TOKEN_ID", "MODAL_TOKEN_SECRET"]],
|
|
3474
3474
|
railway: [["RAILWAY_API_KEY", "RAILWAY_PROJECT_ID", "RAILWAY_ENVIRONMENT_ID"]],
|
|
3475
|
+
render: [["RENDER_API_KEY", "RENDER_OWNER_ID"]],
|
|
3475
3476
|
daytona: [["DAYTONA_API_KEY"]],
|
|
3476
3477
|
vercel: [
|
|
3477
3478
|
["VERCEL_OIDC_TOKEN"],
|
|
@@ -3496,6 +3497,10 @@ var PROVIDER_HEADERS = {
|
|
|
3496
3497
|
projectId: "X-Railway-Project-ID",
|
|
3497
3498
|
environmentId: "X-Railway-Environment-ID"
|
|
3498
3499
|
},
|
|
3500
|
+
render: {
|
|
3501
|
+
apiKey: "X-Render-API-Key",
|
|
3502
|
+
ownerId: "X-Render-Owner-ID"
|
|
3503
|
+
},
|
|
3499
3504
|
daytona: {
|
|
3500
3505
|
apiKey: "X-Daytona-API-Key"
|
|
3501
3506
|
},
|
|
@@ -3533,6 +3538,10 @@ var PROVIDER_ENV_MAP = {
|
|
|
3533
3538
|
RAILWAY_PROJECT_ID: "projectId",
|
|
3534
3539
|
RAILWAY_ENVIRONMENT_ID: "environmentId"
|
|
3535
3540
|
},
|
|
3541
|
+
render: {
|
|
3542
|
+
RENDER_API_KEY: "apiKey",
|
|
3543
|
+
RENDER_OWNER_ID: "ownerId"
|
|
3544
|
+
},
|
|
3536
3545
|
daytona: {
|
|
3537
3546
|
DAYTONA_API_KEY: "apiKey"
|
|
3538
3547
|
},
|
|
@@ -3561,6 +3570,7 @@ var PROVIDER_DASHBOARD_URLS = {
|
|
|
3561
3570
|
e2b: "https://e2b.dev/dashboard",
|
|
3562
3571
|
modal: "https://modal.com/settings",
|
|
3563
3572
|
railway: "https://railway.app/account/tokens",
|
|
3573
|
+
render: "https://dashboard.render.com/account",
|
|
3564
3574
|
daytona: "https://daytona.io/dashboard",
|
|
3565
3575
|
vercel: "https://vercel.com/account/tokens",
|
|
3566
3576
|
runloop: "https://runloop.ai/dashboard",
|
|
@@ -3627,6 +3637,7 @@ var GATEWAY_URL = "https://gateway.computesdk.com";
|
|
|
3627
3637
|
var PROVIDER_PRIORITY = [
|
|
3628
3638
|
"e2b",
|
|
3629
3639
|
"railway",
|
|
3640
|
+
"render",
|
|
3630
3641
|
"daytona",
|
|
3631
3642
|
"modal",
|
|
3632
3643
|
"runloop",
|
|
@@ -3638,6 +3649,7 @@ var PROVIDER_PRIORITY = [
|
|
|
3638
3649
|
var PROVIDER_ENV_VARS = {
|
|
3639
3650
|
e2b: ["E2B_API_KEY"],
|
|
3640
3651
|
railway: ["RAILWAY_API_KEY", "RAILWAY_PROJECT_ID", "RAILWAY_ENVIRONMENT_ID"],
|
|
3652
|
+
render: ["RENDER_API_KEY", "RENDER_OWNER_ID"],
|
|
3641
3653
|
daytona: ["DAYTONA_API_KEY"],
|
|
3642
3654
|
modal: ["MODAL_TOKEN_ID", "MODAL_TOKEN_SECRET"],
|
|
3643
3655
|
runloop: ["RUNLOOP_API_KEY"],
|
|
@@ -3912,7 +3924,8 @@ Get your API key at: https://computesdk.com/dashboard`
|
|
|
3912
3924
|
apiKey: computesdkApiKey,
|
|
3913
3925
|
gatewayUrl: config.gatewayUrl || GATEWAY_URL,
|
|
3914
3926
|
provider: config.provider,
|
|
3915
|
-
providerHeaders
|
|
3927
|
+
providerHeaders,
|
|
3928
|
+
WebSocket: config.WebSocket
|
|
3916
3929
|
};
|
|
3917
3930
|
}
|
|
3918
3931
|
|
|
@@ -4053,7 +4066,7 @@ var ComputeManager = class {
|
|
|
4053
4066
|
...name && { name },
|
|
4054
4067
|
...namespace && { namespace }
|
|
4055
4068
|
},
|
|
4056
|
-
WebSocket: globalThis.WebSocket,
|
|
4069
|
+
WebSocket: config.WebSocket || globalThis.WebSocket,
|
|
4057
4070
|
destroyHandler: async () => {
|
|
4058
4071
|
await gatewayFetch(`${config.gatewayUrl}/v1/sandboxes/${sandboxId}`, config, {
|
|
4059
4072
|
method: "DELETE"
|
|
@@ -4079,7 +4092,7 @@ var ComputeManager = class {
|
|
|
4079
4092
|
provider,
|
|
4080
4093
|
token: token || config.apiKey,
|
|
4081
4094
|
metadata,
|
|
4082
|
-
WebSocket: globalThis.WebSocket,
|
|
4095
|
+
WebSocket: config.WebSocket || globalThis.WebSocket,
|
|
4083
4096
|
destroyHandler: async () => {
|
|
4084
4097
|
await gatewayFetch(`${config.gatewayUrl}/v1/sandboxes/${sandboxId}`, config, {
|
|
4085
4098
|
method: "DELETE"
|
|
@@ -4135,7 +4148,7 @@ var ComputeManager = class {
|
|
|
4135
4148
|
name: result.data.name,
|
|
4136
4149
|
namespace: result.data.namespace
|
|
4137
4150
|
},
|
|
4138
|
-
WebSocket: globalThis.WebSocket,
|
|
4151
|
+
WebSocket: config.WebSocket || globalThis.WebSocket,
|
|
4139
4152
|
destroyHandler: async () => {
|
|
4140
4153
|
await gatewayFetch(`${config.gatewayUrl}/v1/sandboxes/${sandboxId}`, config, {
|
|
4141
4154
|
method: "DELETE"
|
|
@@ -4172,7 +4185,7 @@ var ComputeManager = class {
|
|
|
4172
4185
|
name,
|
|
4173
4186
|
namespace
|
|
4174
4187
|
},
|
|
4175
|
-
WebSocket: globalThis.WebSocket,
|
|
4188
|
+
WebSocket: config.WebSocket || globalThis.WebSocket,
|
|
4176
4189
|
destroyHandler: async () => {
|
|
4177
4190
|
await gatewayFetch(`${config.gatewayUrl}/v1/sandboxes/${sandboxId}`, config, {
|
|
4178
4191
|
method: "DELETE"
|