computesdk 1.18.1 → 1.18.2

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 CHANGED
@@ -3611,6 +3611,7 @@ declare const PROVIDER_AUTH: {
3611
3611
  readonly cloudflare: readonly [readonly ["CLOUDFLARE_API_TOKEN", "CLOUDFLARE_ACCOUNT_ID"]];
3612
3612
  readonly codesandbox: readonly [readonly ["CSB_API_KEY"]];
3613
3613
  readonly blaxel: readonly [readonly ["BL_API_KEY", "BL_WORKSPACE"]];
3614
+ readonly namespace: readonly [readonly ["NSC_TOKEN"]];
3614
3615
  };
3615
3616
  /**
3616
3617
  * All supported provider names (excluding gateway which is special)
@@ -3726,6 +3727,9 @@ interface ExplicitComputeConfig {
3726
3727
  apiKey?: string;
3727
3728
  workspace?: string;
3728
3729
  };
3730
+ namespace?: {
3731
+ token?: string;
3732
+ };
3729
3733
  }
3730
3734
  /**
3731
3735
  * Options for creating a sandbox via the gateway
@@ -3742,6 +3746,8 @@ interface CreateSandboxOptions {
3742
3746
  namespace?: string;
3743
3747
  /** Docker image to use for the sandbox (for infrastructure providers like Railway) */
3744
3748
  image?: string;
3749
+ /** Provider-specific snapshot to create from (e.g., Vercel snapshots) */
3750
+ snapshotId?: string;
3745
3751
  }
3746
3752
  /**
3747
3753
  * Options for finding or creating a named sandbox
@@ -3917,7 +3923,7 @@ declare const GATEWAY_URL = "https://gateway.computesdk.com";
3917
3923
  * Provider detection priority order
3918
3924
  * When multiple provider credentials are detected, use the first one in this list
3919
3925
  */
3920
- declare const PROVIDER_PRIORITY: readonly ["e2b", "railway", "render", "daytona", "modal", "runloop", "vercel", "cloudflare", "codesandbox", "blaxel"];
3926
+ declare const PROVIDER_PRIORITY: readonly ["e2b", "railway", "render", "daytona", "modal", "runloop", "vercel", "cloudflare", "codesandbox", "blaxel", "namespace"];
3921
3927
  /**
3922
3928
  * Required environment variables for each provider
3923
3929
  * @deprecated Use PROVIDER_AUTH from provider-config instead
@@ -3933,6 +3939,7 @@ declare const PROVIDER_ENV_VARS: {
3933
3939
  readonly cloudflare: readonly ["CLOUDFLARE_API_TOKEN", "CLOUDFLARE_ACCOUNT_ID"];
3934
3940
  readonly codesandbox: readonly ["CSB_API_KEY"];
3935
3941
  readonly blaxel: readonly ["BL_API_KEY", "BL_WORKSPACE"];
3942
+ readonly namespace: readonly ["NSC_TOKEN"];
3936
3943
  };
3937
3944
 
3938
3945
  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
@@ -3611,6 +3611,7 @@ declare const PROVIDER_AUTH: {
3611
3611
  readonly cloudflare: readonly [readonly ["CLOUDFLARE_API_TOKEN", "CLOUDFLARE_ACCOUNT_ID"]];
3612
3612
  readonly codesandbox: readonly [readonly ["CSB_API_KEY"]];
3613
3613
  readonly blaxel: readonly [readonly ["BL_API_KEY", "BL_WORKSPACE"]];
3614
+ readonly namespace: readonly [readonly ["NSC_TOKEN"]];
3614
3615
  };
3615
3616
  /**
3616
3617
  * All supported provider names (excluding gateway which is special)
@@ -3726,6 +3727,9 @@ interface ExplicitComputeConfig {
3726
3727
  apiKey?: string;
3727
3728
  workspace?: string;
3728
3729
  };
3730
+ namespace?: {
3731
+ token?: string;
3732
+ };
3729
3733
  }
3730
3734
  /**
3731
3735
  * Options for creating a sandbox via the gateway
@@ -3742,6 +3746,8 @@ interface CreateSandboxOptions {
3742
3746
  namespace?: string;
3743
3747
  /** Docker image to use for the sandbox (for infrastructure providers like Railway) */
3744
3748
  image?: string;
3749
+ /** Provider-specific snapshot to create from (e.g., Vercel snapshots) */
3750
+ snapshotId?: string;
3745
3751
  }
3746
3752
  /**
3747
3753
  * Options for finding or creating a named sandbox
@@ -3917,7 +3923,7 @@ declare const GATEWAY_URL = "https://gateway.computesdk.com";
3917
3923
  * Provider detection priority order
3918
3924
  * When multiple provider credentials are detected, use the first one in this list
3919
3925
  */
3920
- declare const PROVIDER_PRIORITY: readonly ["e2b", "railway", "render", "daytona", "modal", "runloop", "vercel", "cloudflare", "codesandbox", "blaxel"];
3926
+ declare const PROVIDER_PRIORITY: readonly ["e2b", "railway", "render", "daytona", "modal", "runloop", "vercel", "cloudflare", "codesandbox", "blaxel", "namespace"];
3921
3927
  /**
3922
3928
  * Required environment variables for each provider
3923
3929
  * @deprecated Use PROVIDER_AUTH from provider-config instead
@@ -3933,6 +3939,7 @@ declare const PROVIDER_ENV_VARS: {
3933
3939
  readonly cloudflare: readonly ["CLOUDFLARE_API_TOKEN", "CLOUDFLARE_ACCOUNT_ID"];
3934
3940
  readonly codesandbox: readonly ["CSB_API_KEY"];
3935
3941
  readonly blaxel: readonly ["BL_API_KEY", "BL_WORKSPACE"];
3942
+ readonly namespace: readonly ["NSC_TOKEN"];
3936
3943
  };
3937
3944
 
3938
3945
  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
@@ -3515,7 +3515,8 @@ var PROVIDER_AUTH = {
3515
3515
  runloop: [["RUNLOOP_API_KEY"]],
3516
3516
  cloudflare: [["CLOUDFLARE_API_TOKEN", "CLOUDFLARE_ACCOUNT_ID"]],
3517
3517
  codesandbox: [["CSB_API_KEY"]],
3518
- blaxel: [["BL_API_KEY", "BL_WORKSPACE"]]
3518
+ blaxel: [["BL_API_KEY", "BL_WORKSPACE"]],
3519
+ namespace: [["NSC_TOKEN"]]
3519
3520
  };
3520
3521
  var PROVIDER_NAMES = Object.keys(PROVIDER_AUTH);
3521
3522
  var PROVIDER_HEADERS = {
@@ -3557,6 +3558,9 @@ var PROVIDER_HEADERS = {
3557
3558
  blaxel: {
3558
3559
  apiKey: "X-BL-API-Key",
3559
3560
  workspace: "X-BL-Workspace"
3561
+ },
3562
+ namespace: {
3563
+ token: "X-Namespace-Token"
3560
3564
  }
3561
3565
  };
3562
3566
  var PROVIDER_ENV_MAP = {
@@ -3598,6 +3602,9 @@ var PROVIDER_ENV_MAP = {
3598
3602
  blaxel: {
3599
3603
  BL_API_KEY: "apiKey",
3600
3604
  BL_WORKSPACE: "workspace"
3605
+ },
3606
+ namespace: {
3607
+ NSC_TOKEN: "token"
3601
3608
  }
3602
3609
  };
3603
3610
  var PROVIDER_DASHBOARD_URLS = {
@@ -3610,7 +3617,8 @@ var PROVIDER_DASHBOARD_URLS = {
3610
3617
  runloop: "https://runloop.ai/dashboard",
3611
3618
  cloudflare: "https://dash.cloudflare.com/profile/api-tokens",
3612
3619
  codesandbox: "https://codesandbox.io/dashboard/settings",
3613
- blaxel: "https://blaxel.ai/dashboard"
3620
+ blaxel: "https://blaxel.ai/dashboard",
3621
+ namespace: "https://cloud.namespace.so"
3614
3622
  };
3615
3623
  function isValidProvider(name) {
3616
3624
  return name in PROVIDER_AUTH;
@@ -3678,7 +3686,8 @@ var PROVIDER_PRIORITY = [
3678
3686
  "vercel",
3679
3687
  "cloudflare",
3680
3688
  "codesandbox",
3681
- "blaxel"
3689
+ "blaxel",
3690
+ "namespace"
3682
3691
  ];
3683
3692
  var PROVIDER_ENV_VARS = {
3684
3693
  e2b: ["E2B_API_KEY"],
@@ -3690,7 +3699,8 @@ var PROVIDER_ENV_VARS = {
3690
3699
  vercel: ["VERCEL_TOKEN", "VERCEL_TEAM_ID", "VERCEL_PROJECT_ID"],
3691
3700
  cloudflare: ["CLOUDFLARE_API_TOKEN", "CLOUDFLARE_ACCOUNT_ID"],
3692
3701
  codesandbox: ["CSB_API_KEY"],
3693
- blaxel: ["BL_API_KEY", "BL_WORKSPACE"]
3702
+ blaxel: ["BL_API_KEY", "BL_WORKSPACE"],
3703
+ namespace: ["NSC_TOKEN"]
3694
3704
  };
3695
3705
 
3696
3706
  // src/auto-detect.ts
@@ -3807,6 +3817,11 @@ function getProviderHeaders(provider) {
3807
3817
  headers["X-Blaxel-Workspace"] = process.env.BL_WORKSPACE;
3808
3818
  }
3809
3819
  break;
3820
+ case "namespace":
3821
+ if (process.env.NSC_TOKEN) {
3822
+ headers["X-Namespace-Token"] = process.env.NSC_TOKEN;
3823
+ }
3824
+ break;
3810
3825
  }
3811
3826
  return headers;
3812
3827
  }
@@ -3843,6 +3858,7 @@ To fix this, set one of the following:
3843
3858
  Cloudflare: export CLOUDFLARE_API_TOKEN=xxx CLOUDFLARE_ACCOUNT_ID=xxx
3844
3859
  CodeSandbox: export CSB_API_KEY=xxx
3845
3860
  Blaxel: export BL_API_KEY=xxx BL_WORKSPACE=xxx
3861
+ Namespace: export NSC_TOKEN=xxx
3846
3862
 
3847
3863
  Or set COMPUTESDK_PROVIDER to specify explicitly:
3848
3864
  export COMPUTESDK_PROVIDER=e2b