@carrierllc/mcp 0.13.63 → 0.13.65
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/{chunk-WCIQ6OYP.js → chunk-NMTO5PCG.js} +54 -25
- package/dist/chunk-NMTO5PCG.js.map +1 -0
- package/dist/cli.js +7 -1
- package/dist/cli.js.map +1 -1
- package/dist/index.js +14 -12
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-WCIQ6OYP.js.map +0 -1
|
@@ -1600,13 +1600,13 @@ function fleetScreen(input) {
|
|
|
1600
1600
|
}
|
|
1601
1601
|
];
|
|
1602
1602
|
const hasPerAccountCounts = input.accounts.some(
|
|
1603
|
-
(a) => a.active + a.suspended + a.inventory + a.other > 0
|
|
1603
|
+
(a) => !a.noData && a.active + a.suspended + a.inventory + a.other > 0
|
|
1604
1604
|
);
|
|
1605
1605
|
if (hasPerAccountCounts) {
|
|
1606
1606
|
sections.push({
|
|
1607
1607
|
kind: "bars",
|
|
1608
1608
|
title: "eSIMs by account",
|
|
1609
|
-
items:
|
|
1609
|
+
items: input.accounts.filter((a) => !a.noData).sort((a, b) => b.active + b.inventory - (a.active + a.inventory)).slice(0, 10).map((a) => ({
|
|
1610
1610
|
label: a.name,
|
|
1611
1611
|
value: a.active + a.suspended + a.inventory + a.other,
|
|
1612
1612
|
hint: `${a.active} active`,
|
|
@@ -1620,7 +1620,9 @@ function fleetScreen(input) {
|
|
|
1620
1620
|
columns: ["Account", "Balance", "Active", "Inventory"],
|
|
1621
1621
|
numeric: [1, 2, 3],
|
|
1622
1622
|
empty: "No accounts under this reseller.",
|
|
1623
|
-
rows: input.accounts.map(
|
|
1623
|
+
rows: input.accounts.map(
|
|
1624
|
+
(a) => a.noData ? [a.name, money(a.balance), "no data", "no data"] : [a.name, money(a.balance), a.active, a.inventory]
|
|
1625
|
+
)
|
|
1624
1626
|
});
|
|
1625
1627
|
if (criticals.length > 0) {
|
|
1626
1628
|
sections.push({
|
|
@@ -1913,7 +1915,7 @@ function storefrontScreen(input) {
|
|
|
1913
1915
|
// package.json
|
|
1914
1916
|
var package_default = {
|
|
1915
1917
|
name: "@carrierllc/mcp",
|
|
1916
|
-
version: "0.13.
|
|
1918
|
+
version: "0.13.65",
|
|
1917
1919
|
description: "Carrier MCP \u2014 natural-language control of MVNO/eSIM fleets via eSIMVault OCS. Stdio mode for direct integration with Claude Desktop, Cursor, Windsurf, and MCP-compatible clients. Ships the `carrier` CLI (plugin install + white-label eSIM storefront scaffold).",
|
|
1918
1920
|
license: "MIT",
|
|
1919
1921
|
author: "Carrier (Lifecycle Innovations Limited)",
|
|
@@ -2005,7 +2007,7 @@ var package_default = {
|
|
|
2005
2007
|
// src/version.ts
|
|
2006
2008
|
var CARRIER_VERSION = package_default.version;
|
|
2007
2009
|
|
|
2008
|
-
// ../../packages/ocs-client/dist/chunk-
|
|
2010
|
+
// ../../packages/ocs-client/dist/chunk-72GV2KT2.js
|
|
2009
2011
|
var OCS_MAX_USAGE_WINDOW_DAYS = 7;
|
|
2010
2012
|
function clampUsagePeriod(start, end, maxDays = OCS_MAX_USAGE_WINDOW_DAYS) {
|
|
2011
2013
|
const endMs = Date.parse(`${end}T00:00:00Z`);
|
|
@@ -2294,6 +2296,7 @@ function extractEsimStatusByAccount(json) {
|
|
|
2294
2296
|
const rec = account ?? {};
|
|
2295
2297
|
const row = emptyEsimStatusCounts();
|
|
2296
2298
|
const id = Number(rec.id ?? rec.accountId);
|
|
2299
|
+
if (rec.noData === true) row.noData = true;
|
|
2297
2300
|
if (rec.id !== void 0 || rec.accountId !== void 0) {
|
|
2298
2301
|
if (Number.isFinite(id)) row.id = id;
|
|
2299
2302
|
}
|
|
@@ -2835,7 +2838,7 @@ function packageTemplateModifyFromToolJson(changes, method) {
|
|
|
2835
2838
|
return packageTemplateModifyParams(body, method);
|
|
2836
2839
|
}
|
|
2837
2840
|
|
|
2838
|
-
// ../../packages/ocs-client/dist/chunk-
|
|
2841
|
+
// ../../packages/ocs-client/dist/chunk-6YTL46MO.js
|
|
2839
2842
|
import { z } from "zod";
|
|
2840
2843
|
var OCS_V1_METHODS = /* @__PURE__ */ new Set([
|
|
2841
2844
|
"getResellerInfo",
|
|
@@ -3184,7 +3187,7 @@ async function runWithBudget(method, attempt, budget = ocsBudgetFor(method)) {
|
|
|
3184
3187
|
throw lastTimeout ?? new OcsTimeoutError(method, budget.attemptMs, budget.totalMs, Math.max(attempts, 1));
|
|
3185
3188
|
}
|
|
3186
3189
|
|
|
3187
|
-
// ../../packages/ocs-client/dist/chunk-
|
|
3190
|
+
// ../../packages/ocs-client/dist/chunk-5AW3XRIO.js
|
|
3188
3191
|
var RATE_LIMIT = 10;
|
|
3189
3192
|
var WINDOW_MS = 1e3;
|
|
3190
3193
|
var windows = /* @__PURE__ */ new Map();
|
|
@@ -3885,7 +3888,7 @@ var OcsClient = class {
|
|
|
3885
3888
|
}
|
|
3886
3889
|
};
|
|
3887
3890
|
|
|
3888
|
-
// ../../packages/ocs-client/dist/chunk-
|
|
3891
|
+
// ../../packages/ocs-client/dist/chunk-QYXJUFOW.js
|
|
3889
3892
|
function buildListSubscriberParams(args) {
|
|
3890
3893
|
const params = {};
|
|
3891
3894
|
if (args.imsi) params.imsiPrefix = args.imsi;
|
|
@@ -3895,23 +3898,48 @@ function buildListSubscriberParams(args) {
|
|
|
3895
3898
|
if (args.msisdn) params.msisdnPrefix = args.msisdn;
|
|
3896
3899
|
return params;
|
|
3897
3900
|
}
|
|
3898
|
-
function
|
|
3899
|
-
if (
|
|
3900
|
-
const
|
|
3901
|
+
function periodFrom(entry) {
|
|
3902
|
+
if (!entry || typeof entry !== "object") return null;
|
|
3903
|
+
const rec = entry;
|
|
3904
|
+
const name = rec.status;
|
|
3905
|
+
if (typeof name !== "string" || name.length === 0) return null;
|
|
3906
|
+
const endDate = rec.endDate;
|
|
3907
|
+
const open = endDate === void 0 || endDate === null || endDate === "";
|
|
3908
|
+
return { name, start: typeof rec.startDate === "string" ? rec.startDate : "", open };
|
|
3909
|
+
}
|
|
3910
|
+
function currentSubscriberStatus(raw) {
|
|
3901
3911
|
if (typeof raw === "string" && raw.length > 0) return raw;
|
|
3902
|
-
if (!Array.isArray(raw)) return
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3912
|
+
if (!Array.isArray(raw)) return void 0;
|
|
3913
|
+
const periods = raw.map(periodFrom).filter((period) => period !== null);
|
|
3914
|
+
const open = periods.find((period) => period.open);
|
|
3915
|
+
if (open) return open.name;
|
|
3916
|
+
const latest = [...periods].sort((a, b) => b.start.localeCompare(a.start))[0];
|
|
3917
|
+
return latest?.name;
|
|
3918
|
+
}
|
|
3919
|
+
function isActiveStatus(status) {
|
|
3920
|
+
if (typeof status !== "string") return false;
|
|
3921
|
+
const name = status.trim().toLowerCase();
|
|
3922
|
+
return name === "active" || name === "1";
|
|
3923
|
+
}
|
|
3924
|
+
function subscriberStatusVerdict(status) {
|
|
3925
|
+
if (status === "") {
|
|
3926
|
+
return { severity: "info", finding: "OCS status could not be read from the subscriber record" };
|
|
3927
|
+
}
|
|
3928
|
+
if (!isActiveStatus(status)) {
|
|
3929
|
+
return {
|
|
3930
|
+
severity: "critical",
|
|
3931
|
+
finding: `OCS status is ${status} (not ACTIVE)`,
|
|
3932
|
+
action: "Reactivate subscriber via modify_subscriber_status"
|
|
3933
|
+
};
|
|
3913
3934
|
}
|
|
3914
|
-
return
|
|
3935
|
+
return { severity: "healthy" };
|
|
3936
|
+
}
|
|
3937
|
+
function extractSubscriberStatus(row) {
|
|
3938
|
+
if (row === null || typeof row !== "object") return null;
|
|
3939
|
+
const rec = row;
|
|
3940
|
+
const current = rec.currentStatus;
|
|
3941
|
+
if (typeof current === "string" && current.length > 0) return current;
|
|
3942
|
+
return currentSubscriberStatus(rec.status) ?? null;
|
|
3915
3943
|
}
|
|
3916
3944
|
function subscriberListEnvelope(raw) {
|
|
3917
3945
|
if (raw === null || typeof raw !== "object" || Array.isArray(raw)) return null;
|
|
@@ -4817,7 +4845,7 @@ function formatBytes(bytes) {
|
|
|
4817
4845
|
return `${(bytes / Math.pow(1024, i)).toFixed(2)} ${units[i]}`;
|
|
4818
4846
|
}
|
|
4819
4847
|
function isActiveSubscriber(row) {
|
|
4820
|
-
return (extractSubscriberStatus(row)
|
|
4848
|
+
return isActiveStatus(extractSubscriberStatus(row));
|
|
4821
4849
|
}
|
|
4822
4850
|
function filterActiveSubscribers(rows) {
|
|
4823
4851
|
return rows.filter((row) => isActiveSubscriber(row));
|
|
@@ -6038,6 +6066,7 @@ export {
|
|
|
6038
6066
|
OcsApiError,
|
|
6039
6067
|
OcsClient,
|
|
6040
6068
|
buildListSubscriberParams,
|
|
6069
|
+
subscriberStatusVerdict,
|
|
6041
6070
|
extractSubscriberStatus,
|
|
6042
6071
|
subscriberListEnvelope,
|
|
6043
6072
|
applySubscriberFilters,
|
|
@@ -6120,4 +6149,4 @@ export {
|
|
|
6120
6149
|
package_default,
|
|
6121
6150
|
CARRIER_VERSION
|
|
6122
6151
|
};
|
|
6123
|
-
//# sourceMappingURL=chunk-
|
|
6152
|
+
//# sourceMappingURL=chunk-NMTO5PCG.js.map
|