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.mjs CHANGED
@@ -3462,7 +3462,8 @@ var PROVIDER_AUTH = {
3462
3462
  runloop: [["RUNLOOP_API_KEY"]],
3463
3463
  cloudflare: [["CLOUDFLARE_API_TOKEN", "CLOUDFLARE_ACCOUNT_ID"]],
3464
3464
  codesandbox: [["CSB_API_KEY"]],
3465
- blaxel: [["BL_API_KEY", "BL_WORKSPACE"]]
3465
+ blaxel: [["BL_API_KEY", "BL_WORKSPACE"]],
3466
+ namespace: [["NSC_TOKEN"]]
3466
3467
  };
3467
3468
  var PROVIDER_NAMES = Object.keys(PROVIDER_AUTH);
3468
3469
  var PROVIDER_HEADERS = {
@@ -3504,6 +3505,9 @@ var PROVIDER_HEADERS = {
3504
3505
  blaxel: {
3505
3506
  apiKey: "X-BL-API-Key",
3506
3507
  workspace: "X-BL-Workspace"
3508
+ },
3509
+ namespace: {
3510
+ token: "X-Namespace-Token"
3507
3511
  }
3508
3512
  };
3509
3513
  var PROVIDER_ENV_MAP = {
@@ -3545,6 +3549,9 @@ var PROVIDER_ENV_MAP = {
3545
3549
  blaxel: {
3546
3550
  BL_API_KEY: "apiKey",
3547
3551
  BL_WORKSPACE: "workspace"
3552
+ },
3553
+ namespace: {
3554
+ NSC_TOKEN: "token"
3548
3555
  }
3549
3556
  };
3550
3557
  var PROVIDER_DASHBOARD_URLS = {
@@ -3557,7 +3564,8 @@ var PROVIDER_DASHBOARD_URLS = {
3557
3564
  runloop: "https://runloop.ai/dashboard",
3558
3565
  cloudflare: "https://dash.cloudflare.com/profile/api-tokens",
3559
3566
  codesandbox: "https://codesandbox.io/dashboard/settings",
3560
- blaxel: "https://blaxel.ai/dashboard"
3567
+ blaxel: "https://blaxel.ai/dashboard",
3568
+ namespace: "https://cloud.namespace.so"
3561
3569
  };
3562
3570
  function isValidProvider(name) {
3563
3571
  return name in PROVIDER_AUTH;
@@ -3625,7 +3633,8 @@ var PROVIDER_PRIORITY = [
3625
3633
  "vercel",
3626
3634
  "cloudflare",
3627
3635
  "codesandbox",
3628
- "blaxel"
3636
+ "blaxel",
3637
+ "namespace"
3629
3638
  ];
3630
3639
  var PROVIDER_ENV_VARS = {
3631
3640
  e2b: ["E2B_API_KEY"],
@@ -3637,7 +3646,8 @@ var PROVIDER_ENV_VARS = {
3637
3646
  vercel: ["VERCEL_TOKEN", "VERCEL_TEAM_ID", "VERCEL_PROJECT_ID"],
3638
3647
  cloudflare: ["CLOUDFLARE_API_TOKEN", "CLOUDFLARE_ACCOUNT_ID"],
3639
3648
  codesandbox: ["CSB_API_KEY"],
3640
- blaxel: ["BL_API_KEY", "BL_WORKSPACE"]
3649
+ blaxel: ["BL_API_KEY", "BL_WORKSPACE"],
3650
+ namespace: ["NSC_TOKEN"]
3641
3651
  };
3642
3652
 
3643
3653
  // src/auto-detect.ts
@@ -3754,6 +3764,11 @@ function getProviderHeaders(provider) {
3754
3764
  headers["X-Blaxel-Workspace"] = process.env.BL_WORKSPACE;
3755
3765
  }
3756
3766
  break;
3767
+ case "namespace":
3768
+ if (process.env.NSC_TOKEN) {
3769
+ headers["X-Namespace-Token"] = process.env.NSC_TOKEN;
3770
+ }
3771
+ break;
3757
3772
  }
3758
3773
  return headers;
3759
3774
  }
@@ -3790,6 +3805,7 @@ To fix this, set one of the following:
3790
3805
  Cloudflare: export CLOUDFLARE_API_TOKEN=xxx CLOUDFLARE_ACCOUNT_ID=xxx
3791
3806
  CodeSandbox: export CSB_API_KEY=xxx
3792
3807
  Blaxel: export BL_API_KEY=xxx BL_WORKSPACE=xxx
3808
+ Namespace: export NSC_TOKEN=xxx
3793
3809
 
3794
3810
  Or set COMPUTESDK_PROVIDER to specify explicitly:
3795
3811
  export COMPUTESDK_PROVIDER=e2b