computesdk 1.16.0 → 1.17.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 +8 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -3657,6 +3657,11 @@ interface ExplicitComputeConfig {
|
|
|
3657
3657
|
computesdkApiKey?: string;
|
|
3658
3658
|
/** Optional gateway URL override */
|
|
3659
3659
|
gatewayUrl?: string;
|
|
3660
|
+
/**
|
|
3661
|
+
* WebSocket implementation for environments without native WebSocket support.
|
|
3662
|
+
* In Node.js < 22, pass the 'ws' package: `import WebSocket from 'ws'`
|
|
3663
|
+
*/
|
|
3664
|
+
WebSocket?: WebSocketConstructor;
|
|
3660
3665
|
/** Provider-specific configurations */
|
|
3661
3666
|
e2b?: {
|
|
3662
3667
|
apiKey?: string;
|
|
@@ -3833,6 +3838,7 @@ declare const compute: CallableCompute;
|
|
|
3833
3838
|
* Automatically detects gateway mode and provider from environment variables.
|
|
3834
3839
|
* Enables zero-config usage of ComputeSDK.
|
|
3835
3840
|
*/
|
|
3841
|
+
|
|
3836
3842
|
/**
|
|
3837
3843
|
* Check if gateway mode is enabled
|
|
3838
3844
|
* Gateway mode requires COMPUTESDK_API_KEY to be set
|
|
@@ -3861,6 +3867,7 @@ interface GatewayConfig {
|
|
|
3861
3867
|
gatewayUrl: string;
|
|
3862
3868
|
provider: string;
|
|
3863
3869
|
providerHeaders: Record<string, string>;
|
|
3870
|
+
WebSocket?: WebSocketConstructor;
|
|
3864
3871
|
}
|
|
3865
3872
|
/**
|
|
3866
3873
|
* Main auto-configuration function
|
|
@@ -3901,4 +3908,4 @@ declare const PROVIDER_ENV_VARS: {
|
|
|
3901
3908
|
readonly blaxel: readonly ["BL_API_KEY", "BL_WORKSPACE"];
|
|
3902
3909
|
};
|
|
3903
3910
|
|
|
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 };
|
|
3911
|
+
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
|
@@ -3657,6 +3657,11 @@ interface ExplicitComputeConfig {
|
|
|
3657
3657
|
computesdkApiKey?: string;
|
|
3658
3658
|
/** Optional gateway URL override */
|
|
3659
3659
|
gatewayUrl?: string;
|
|
3660
|
+
/**
|
|
3661
|
+
* WebSocket implementation for environments without native WebSocket support.
|
|
3662
|
+
* In Node.js < 22, pass the 'ws' package: `import WebSocket from 'ws'`
|
|
3663
|
+
*/
|
|
3664
|
+
WebSocket?: WebSocketConstructor;
|
|
3660
3665
|
/** Provider-specific configurations */
|
|
3661
3666
|
e2b?: {
|
|
3662
3667
|
apiKey?: string;
|
|
@@ -3833,6 +3838,7 @@ declare const compute: CallableCompute;
|
|
|
3833
3838
|
* Automatically detects gateway mode and provider from environment variables.
|
|
3834
3839
|
* Enables zero-config usage of ComputeSDK.
|
|
3835
3840
|
*/
|
|
3841
|
+
|
|
3836
3842
|
/**
|
|
3837
3843
|
* Check if gateway mode is enabled
|
|
3838
3844
|
* Gateway mode requires COMPUTESDK_API_KEY to be set
|
|
@@ -3861,6 +3867,7 @@ interface GatewayConfig {
|
|
|
3861
3867
|
gatewayUrl: string;
|
|
3862
3868
|
provider: string;
|
|
3863
3869
|
providerHeaders: Record<string, string>;
|
|
3870
|
+
WebSocket?: WebSocketConstructor;
|
|
3864
3871
|
}
|
|
3865
3872
|
/**
|
|
3866
3873
|
* Main auto-configuration function
|
|
@@ -3901,4 +3908,4 @@ declare const PROVIDER_ENV_VARS: {
|
|
|
3901
3908
|
readonly blaxel: readonly ["BL_API_KEY", "BL_WORKSPACE"];
|
|
3902
3909
|
};
|
|
3903
3910
|
|
|
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 };
|
|
3911
|
+
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
|
@@ -3912,7 +3912,8 @@ Get your API key at: https://computesdk.com/dashboard`
|
|
|
3912
3912
|
apiKey: computesdkApiKey,
|
|
3913
3913
|
gatewayUrl: config.gatewayUrl || GATEWAY_URL,
|
|
3914
3914
|
provider: config.provider,
|
|
3915
|
-
providerHeaders
|
|
3915
|
+
providerHeaders,
|
|
3916
|
+
WebSocket: config.WebSocket
|
|
3916
3917
|
};
|
|
3917
3918
|
}
|
|
3918
3919
|
|
|
@@ -4053,7 +4054,7 @@ var ComputeManager = class {
|
|
|
4053
4054
|
...name && { name },
|
|
4054
4055
|
...namespace && { namespace }
|
|
4055
4056
|
},
|
|
4056
|
-
WebSocket: globalThis.WebSocket,
|
|
4057
|
+
WebSocket: config.WebSocket || globalThis.WebSocket,
|
|
4057
4058
|
destroyHandler: async () => {
|
|
4058
4059
|
await gatewayFetch(`${config.gatewayUrl}/v1/sandboxes/${sandboxId}`, config, {
|
|
4059
4060
|
method: "DELETE"
|
|
@@ -4079,7 +4080,7 @@ var ComputeManager = class {
|
|
|
4079
4080
|
provider,
|
|
4080
4081
|
token: token || config.apiKey,
|
|
4081
4082
|
metadata,
|
|
4082
|
-
WebSocket: globalThis.WebSocket,
|
|
4083
|
+
WebSocket: config.WebSocket || globalThis.WebSocket,
|
|
4083
4084
|
destroyHandler: async () => {
|
|
4084
4085
|
await gatewayFetch(`${config.gatewayUrl}/v1/sandboxes/${sandboxId}`, config, {
|
|
4085
4086
|
method: "DELETE"
|
|
@@ -4135,7 +4136,7 @@ var ComputeManager = class {
|
|
|
4135
4136
|
name: result.data.name,
|
|
4136
4137
|
namespace: result.data.namespace
|
|
4137
4138
|
},
|
|
4138
|
-
WebSocket: globalThis.WebSocket,
|
|
4139
|
+
WebSocket: config.WebSocket || globalThis.WebSocket,
|
|
4139
4140
|
destroyHandler: async () => {
|
|
4140
4141
|
await gatewayFetch(`${config.gatewayUrl}/v1/sandboxes/${sandboxId}`, config, {
|
|
4141
4142
|
method: "DELETE"
|
|
@@ -4172,7 +4173,7 @@ var ComputeManager = class {
|
|
|
4172
4173
|
name,
|
|
4173
4174
|
namespace
|
|
4174
4175
|
},
|
|
4175
|
-
WebSocket: globalThis.WebSocket,
|
|
4176
|
+
WebSocket: config.WebSocket || globalThis.WebSocket,
|
|
4176
4177
|
destroyHandler: async () => {
|
|
4177
4178
|
await gatewayFetch(`${config.gatewayUrl}/v1/sandboxes/${sandboxId}`, config, {
|
|
4178
4179
|
method: "DELETE"
|