@carrierllc/mcp 0.13.88 → 0.13.90

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/cli.js CHANGED
@@ -45,7 +45,7 @@ import {
45
45
  verifyStorefront,
46
46
  walletScreen,
47
47
  which
48
- } from "./chunk-BDW6EFM3.js";
48
+ } from "./chunk-OJ5YT4ZS.js";
49
49
  import {
50
50
  copyTree,
51
51
  exists,
package/dist/index.js CHANGED
@@ -91,7 +91,7 @@ import {
91
91
  verifyStorefront,
92
92
  withOcsListSummary,
93
93
  withTemplateResellerId
94
- } from "./chunk-BDW6EFM3.js";
94
+ } from "./chunk-OJ5YT4ZS.js";
95
95
  import "./chunk-SHKKVIIA.js";
96
96
 
97
97
  // src/index.ts
@@ -730,13 +730,18 @@ var BedrockError = class extends Error {
730
730
  }
731
731
  status;
732
732
  };
733
+ function signingSessionToken(creds) {
734
+ if (!creds.sessionToken) return void 0;
735
+ return creds.accessKeyId.startsWith("ASIA") ? creds.sessionToken : void 0;
736
+ }
733
737
  function client(creds) {
734
738
  const region = creds.region ?? DEFAULT_BEDROCK_REGION;
739
+ const sessionToken = signingSessionToken(creds);
735
740
  return {
736
741
  aws: new AwsClient({
737
742
  accessKeyId: creds.accessKeyId,
738
743
  secretAccessKey: creds.secretAccessKey,
739
- ...creds.sessionToken ? { sessionToken: creds.sessionToken } : {},
744
+ ...sessionToken ? { sessionToken } : {},
740
745
  region,
741
746
  service: "bedrock",
742
747
  // See MAX_ATTEMPTS. aws4fetch's retry loop cannot be cancelled, so this
@@ -8929,6 +8934,11 @@ function stripeFields(id, mode) {
8929
8934
  return { ok: true, id, mode };
8930
8935
  }
8931
8936
 
8937
+ // src/org-api-key.ts
8938
+ function orgApiKey() {
8939
+ return process.env.CARRIER_API_KEY?.trim() || process.env.CARRIER_ORG_API_KEY?.trim() || void 0;
8940
+ }
8941
+
8932
8942
  // src/tools-storefront-plan.ts
8933
8943
  var STOREFRONT_PLAN_TOOL_SCOPES = {
8934
8944
  update_storefront_plan: "write",
@@ -8942,7 +8952,7 @@ function apiOrigin() {
8942
8952
  return (process.env.CARRIER_API_URL ?? DEFAULT_API).replace(/\/$/, "");
8943
8953
  }
8944
8954
  function apiKey2() {
8945
- return process.env.CARRIER_API_KEY?.trim() || process.env.CARRIER_ORG_API_KEY?.trim() || null;
8955
+ return orgApiKey() ?? null;
8946
8956
  }
8947
8957
  async function patchStorefrontPlan(storefrontId, slug, body2) {
8948
8958
  const key = apiKey2();
@@ -14318,15 +14328,15 @@ function createStorefrontApiCall(options) {
14318
14328
 
14319
14329
  // src/index.ts
14320
14330
  var baseUrl = process.env.CARRIER_OCS_BASE_URL ?? process.env.ESIMVAULT_BASE_URL ?? "https://ocs.esimvault.cloud";
14321
- var token = process.env.CARRIER_OCS_API_TOKEN ?? process.env.ESIMVAULT_API_TOKEN;
14322
- if (!token && !process.env.CARRIER_API_TOKEN) {
14331
+ var token = process.env.CARRIER_OCS_API_TOKEN?.trim() || process.env.ESIMVAULT_API_TOKEN?.trim() || void 0;
14332
+ if (!token && !process.env.CARRIER_API_TOKEN?.trim() && !orgApiKey()) {
14323
14333
  console.error(
14324
- "ERROR: Set CARRIER_API_TOKEN for durable inventory or CARRIER_OCS_API_TOKEN for explicit OCS tools."
14334
+ "ERROR: Set CARRIER_API_KEY (ak_...; CARRIER_ORG_API_KEY also works), CARRIER_API_TOKEN for durable inventory, or CARRIER_OCS_API_TOKEN for explicit OCS tools."
14325
14335
  );
14326
14336
  process.exit(1);
14327
14337
  }
14328
14338
  var stdioEnv = {
14329
- CARRIER_API_TOKEN: process.env.CARRIER_API_TOKEN,
14339
+ CARRIER_API_TOKEN: process.env.CARRIER_API_TOKEN?.trim() || void 0,
14330
14340
  CARRIER_AI_CREDITS_ENABLED: process.env.CARRIER_AI_CREDITS_ENABLED,
14331
14341
  CARRIER_AI_UNFUNDED_FALLBACK: process.env.CARRIER_AI_UNFUNDED_FALLBACK,
14332
14342
  CARRIER_AI_PERSONAL_UNMETERED: process.env.CARRIER_AI_PERSONAL_UNMETERED,
@@ -14402,7 +14412,9 @@ var props = {
14402
14412
  var audit = (_row) => {
14403
14413
  };
14404
14414
  var getUserToken = async (_sub) => {
14405
- if (!token) throw new Error("CARRIER_OCS_API_TOKEN is required for explicit OCS tools");
14415
+ if (!token) throw new Error(
14416
+ "CARRIER_OCS_API_TOKEN is required for explicit OCS tools. CARRIER_API_KEY alone enables the storefront management tools only."
14417
+ );
14406
14418
  return token;
14407
14419
  };
14408
14420
  var toolCtx = {
@@ -14411,7 +14423,7 @@ var toolCtx = {
14411
14423
  managedAuth: {},
14412
14424
  audit,
14413
14425
  getUserToken,
14414
- getApiToken: async () => process.env.CARRIER_API_TOKEN || void 0
14426
+ getApiToken: async () => process.env.CARRIER_API_TOKEN?.trim() || void 0
14415
14427
  };
14416
14428
  var server = new McpServer(
14417
14429
  { name: "carrier-mcp", version: CARRIER_VERSION },
@@ -14456,7 +14468,7 @@ registerStorefrontManagementTools(
14456
14468
  props,
14457
14469
  createStorefrontApiCall({
14458
14470
  baseUrl: process.env.CARRIER_API_URL,
14459
- getToken: () => process.env.CARRIER_API_KEY?.trim() || process.env.CARRIER_ORG_API_KEY?.trim() || void 0
14471
+ getToken: orgApiKey
14460
14472
  }),
14461
14473
  "rest",
14462
14474
  { exclude: new Set(Object.keys(STOREFRONT_PLAN_TOOL_SCOPES)) }