@carrierllc/mcp 0.13.88 → 0.13.89
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/README.md +1 -0
- package/dist/{chunk-BDW6EFM3.js → chunk-5P7TAD2J.js} +4 -2
- package/dist/chunk-5P7TAD2J.js.map +1 -0
- package/dist/cli.js +1 -1
- package/dist/index.js +16 -9
- package/dist/index.js.map +1 -1
- package/package.json +3 -1
- package/dist/chunk-BDW6EFM3.js.map +0 -1
package/dist/cli.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -91,7 +91,7 @@ import {
|
|
|
91
91
|
verifyStorefront,
|
|
92
92
|
withOcsListSummary,
|
|
93
93
|
withTemplateResellerId
|
|
94
|
-
} from "./chunk-
|
|
94
|
+
} from "./chunk-5P7TAD2J.js";
|
|
95
95
|
import "./chunk-SHKKVIIA.js";
|
|
96
96
|
|
|
97
97
|
// src/index.ts
|
|
@@ -8929,6 +8929,11 @@ function stripeFields(id, mode) {
|
|
|
8929
8929
|
return { ok: true, id, mode };
|
|
8930
8930
|
}
|
|
8931
8931
|
|
|
8932
|
+
// src/org-api-key.ts
|
|
8933
|
+
function orgApiKey() {
|
|
8934
|
+
return process.env.CARRIER_API_KEY?.trim() || process.env.CARRIER_ORG_API_KEY?.trim() || void 0;
|
|
8935
|
+
}
|
|
8936
|
+
|
|
8932
8937
|
// src/tools-storefront-plan.ts
|
|
8933
8938
|
var STOREFRONT_PLAN_TOOL_SCOPES = {
|
|
8934
8939
|
update_storefront_plan: "write",
|
|
@@ -8942,7 +8947,7 @@ function apiOrigin() {
|
|
|
8942
8947
|
return (process.env.CARRIER_API_URL ?? DEFAULT_API).replace(/\/$/, "");
|
|
8943
8948
|
}
|
|
8944
8949
|
function apiKey2() {
|
|
8945
|
-
return
|
|
8950
|
+
return orgApiKey() ?? null;
|
|
8946
8951
|
}
|
|
8947
8952
|
async function patchStorefrontPlan(storefrontId, slug, body2) {
|
|
8948
8953
|
const key = apiKey2();
|
|
@@ -14318,15 +14323,15 @@ function createStorefrontApiCall(options) {
|
|
|
14318
14323
|
|
|
14319
14324
|
// src/index.ts
|
|
14320
14325
|
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
|
|
14322
|
-
if (!token && !process.env.CARRIER_API_TOKEN) {
|
|
14326
|
+
var token = process.env.CARRIER_OCS_API_TOKEN?.trim() || process.env.ESIMVAULT_API_TOKEN?.trim() || void 0;
|
|
14327
|
+
if (!token && !process.env.CARRIER_API_TOKEN?.trim() && !orgApiKey()) {
|
|
14323
14328
|
console.error(
|
|
14324
|
-
"ERROR: Set CARRIER_API_TOKEN for durable inventory or CARRIER_OCS_API_TOKEN for explicit OCS tools."
|
|
14329
|
+
"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
14330
|
);
|
|
14326
14331
|
process.exit(1);
|
|
14327
14332
|
}
|
|
14328
14333
|
var stdioEnv = {
|
|
14329
|
-
CARRIER_API_TOKEN: process.env.CARRIER_API_TOKEN,
|
|
14334
|
+
CARRIER_API_TOKEN: process.env.CARRIER_API_TOKEN?.trim() || void 0,
|
|
14330
14335
|
CARRIER_AI_CREDITS_ENABLED: process.env.CARRIER_AI_CREDITS_ENABLED,
|
|
14331
14336
|
CARRIER_AI_UNFUNDED_FALLBACK: process.env.CARRIER_AI_UNFUNDED_FALLBACK,
|
|
14332
14337
|
CARRIER_AI_PERSONAL_UNMETERED: process.env.CARRIER_AI_PERSONAL_UNMETERED,
|
|
@@ -14402,7 +14407,9 @@ var props = {
|
|
|
14402
14407
|
var audit = (_row) => {
|
|
14403
14408
|
};
|
|
14404
14409
|
var getUserToken = async (_sub) => {
|
|
14405
|
-
if (!token) throw new Error(
|
|
14410
|
+
if (!token) throw new Error(
|
|
14411
|
+
"CARRIER_OCS_API_TOKEN is required for explicit OCS tools. CARRIER_API_KEY alone enables the storefront management tools only."
|
|
14412
|
+
);
|
|
14406
14413
|
return token;
|
|
14407
14414
|
};
|
|
14408
14415
|
var toolCtx = {
|
|
@@ -14411,7 +14418,7 @@ var toolCtx = {
|
|
|
14411
14418
|
managedAuth: {},
|
|
14412
14419
|
audit,
|
|
14413
14420
|
getUserToken,
|
|
14414
|
-
getApiToken: async () => process.env.CARRIER_API_TOKEN || void 0
|
|
14421
|
+
getApiToken: async () => process.env.CARRIER_API_TOKEN?.trim() || void 0
|
|
14415
14422
|
};
|
|
14416
14423
|
var server = new McpServer(
|
|
14417
14424
|
{ name: "carrier-mcp", version: CARRIER_VERSION },
|
|
@@ -14456,7 +14463,7 @@ registerStorefrontManagementTools(
|
|
|
14456
14463
|
props,
|
|
14457
14464
|
createStorefrontApiCall({
|
|
14458
14465
|
baseUrl: process.env.CARRIER_API_URL,
|
|
14459
|
-
getToken:
|
|
14466
|
+
getToken: orgApiKey
|
|
14460
14467
|
}),
|
|
14461
14468
|
"rest",
|
|
14462
14469
|
{ exclude: new Set(Object.keys(STOREFRONT_PLAN_TOOL_SCOPES)) }
|