@carrierllc/mcp 0.13.31 → 0.13.33

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.
@@ -1855,7 +1855,7 @@ function storefrontScreen(input) {
1855
1855
  // package.json
1856
1856
  var package_default = {
1857
1857
  name: "@carrierllc/mcp",
1858
- version: "0.13.31",
1858
+ version: "0.13.33",
1859
1859
  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).",
1860
1860
  license: "MIT",
1861
1861
  author: "Carrier (Lifecycle Innovations Limited)",
@@ -4585,30 +4585,45 @@ function subscriberSimId(record) {
4585
4585
  if (nested && typeof nested === "object" && nested !== record) return subscriberSimId(nested);
4586
4586
  return void 0;
4587
4587
  }
4588
- function extractSimProviderStatus(data) {
4589
- const name = (rec) => {
4590
- if (!rec || typeof rec !== "object") return void 0;
4591
- const r = rec;
4592
- for (const key of ["simStatus", "status"]) {
4593
- const v = r[key];
4594
- if (typeof v === "string" && v.trim() !== "") return v.trim();
4595
- }
4596
- return void 0;
4588
+ function simProviderStatusName(rec) {
4589
+ if (!rec || typeof rec !== "object") return void 0;
4590
+ const r = rec;
4591
+ for (const key of ["simStatus", "status"]) {
4592
+ const v = r[key];
4593
+ if (typeof v === "string" && v.trim() !== "") return v.trim();
4594
+ }
4595
+ return void 0;
4596
+ }
4597
+ function currentSimProviderPeriod(data, now = /* @__PURE__ */ new Date()) {
4598
+ if (!Array.isArray(data)) {
4599
+ return simProviderStatusName(data) === void 0 ? void 0 : data;
4600
+ }
4601
+ const bound = (raw) => {
4602
+ if (raw === void 0 || raw === null || raw === "") return void 0;
4603
+ if (typeof raw === "number") return raw;
4604
+ if (typeof raw !== "string") return NaN;
4605
+ const stamp = raw.trim();
4606
+ const hasZone = /(?:Z|[+-]\d{2}:?\d{2})$/.test(stamp);
4607
+ return Date.parse(hasZone ? stamp : `${stamp}Z`);
4597
4608
  };
4598
- if (!Array.isArray(data)) return name(data);
4599
- let latest;
4600
- let firstReadable;
4609
+ const atNow = now.getTime();
4610
+ if (!Number.isFinite(atNow)) return void 0;
4611
+ let current;
4601
4612
  for (const entry of data) {
4602
- const status = name(entry);
4613
+ const status = simProviderStatusName(entry);
4603
4614
  if (status === void 0) continue;
4604
4615
  const rec = entry;
4605
- const end = rec.end;
4606
- if (end === void 0 || end === null || end === "") return status;
4607
- firstReadable ??= status;
4608
- const at = typeof rec.start === "string" || typeof rec.start === "number" ? Date.parse(String(rec.start)) : NaN;
4609
- if (Number.isFinite(at) && (!latest || at > latest.at)) latest = { status, at };
4616
+ const start = bound(rec.start);
4617
+ const end = bound(rec.end);
4618
+ if (start !== void 0 && (!Number.isFinite(start) || start > atNow)) continue;
4619
+ if (end !== void 0 && (!Number.isFinite(end) || end <= atNow)) continue;
4620
+ const at = start ?? -Infinity;
4621
+ if (!current || at > current.at) current = { record: rec, at };
4610
4622
  }
4611
- return latest?.status ?? firstReadable;
4623
+ return current?.record;
4624
+ }
4625
+ function extractSimProviderStatus(data, now = /* @__PURE__ */ new Date()) {
4626
+ return simProviderStatusName(currentSimProviderPeriod(data, now));
4612
4627
  }
4613
4628
  function prepaidPackageRows(data) {
4614
4629
  return ocsArray(data, PREPAID_PACKAGE_KEYS);
@@ -5519,4 +5534,4 @@ export {
5519
5534
  package_default,
5520
5535
  CARRIER_VERSION
5521
5536
  };
5522
- //# sourceMappingURL=chunk-EHJEAI4V.js.map
5537
+ //# sourceMappingURL=chunk-QLLHVD63.js.map