@carrierllc/mcp 0.13.9 → 0.13.11

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.
@@ -1820,7 +1820,7 @@ function storefrontScreen(input) {
1820
1820
  // package.json
1821
1821
  var package_default = {
1822
1822
  name: "@carrierllc/mcp",
1823
- version: "0.13.9",
1823
+ version: "0.13.11",
1824
1824
  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).",
1825
1825
  license: "MIT",
1826
1826
  author: "Carrier (Lifecycle Innovations Limited)",
@@ -1901,7 +1901,7 @@ var package_default = {
1901
1901
  // src/version.ts
1902
1902
  var CARRIER_VERSION = package_default.version;
1903
1903
 
1904
- // ../../packages/ocs-client/dist/chunk-LLQXWRFM.js
1904
+ // ../../packages/ocs-client/dist/chunk-66I2ZRZF.js
1905
1905
  var OCS_MAX_USAGE_WINDOW_DAYS = 7;
1906
1906
  function clampUsagePeriod(start, end, maxDays = OCS_MAX_USAGE_WINDOW_DAYS) {
1907
1907
  const endMs = Date.parse(`${end}T00:00:00Z`);
@@ -1930,6 +1930,35 @@ function locationParams(iccid) {
1930
1930
  function subscriberIdParams(iccid) {
1931
1931
  return { iccid };
1932
1932
  }
1933
+ function modifySubscriberStatusParams(iccid, newStatus) {
1934
+ return { subscriber: { iccid }, newStatus };
1935
+ }
1936
+ function nestSubscriberIdParam(params) {
1937
+ if (!params || typeof params !== "object" || Array.isArray(params)) return params;
1938
+ const record = params;
1939
+ if (typeof record["subscriber"] !== "string") return params;
1940
+ return { ...record, subscriber: { iccid: record["subscriber"] } };
1941
+ }
1942
+ function packageStatusConfirmation(params) {
1943
+ const confirmation = { updated: true };
1944
+ if (!params || typeof params !== "object" || Array.isArray(params)) return confirmation;
1945
+ const record = params;
1946
+ const id = record["subsPrepaidPackageId"];
1947
+ if (typeof id === "number" && Number.isFinite(id)) confirmation.subsPrepaidPackageId = id;
1948
+ if (typeof record["active"] === "boolean") {
1949
+ confirmation.active = record["active"];
1950
+ confirmation.status = record["active"] ? "ACTIVE" : "INACTIVE";
1951
+ }
1952
+ return confirmation;
1953
+ }
1954
+ function normaliseAbsentOcsPayload(method, payload, params) {
1955
+ if (payload !== null && payload !== void 0) return payload;
1956
+ if (method === "listSteeringList") return [];
1957
+ if (method === "modifySubscriberPrepaidPackageStatus") {
1958
+ return packageStatusConfirmation(params);
1959
+ }
1960
+ return payload;
1961
+ }
1933
1962
  function recurringPackageParams(iccid, packageTemplateId, options = {}) {
1934
1963
  if (options.activationAtFirstUse !== void 0 && options.startTimeUTC !== void 0) {
1935
1964
  throw new Error("activationAtFirstUse cannot be combined with startTimeUTC");
@@ -2650,7 +2679,7 @@ function packageTemplateModifyFromToolJson(changes, method) {
2650
2679
  return packageTemplateModifyParams(body, method);
2651
2680
  }
2652
2681
 
2653
- // ../../packages/ocs-client/dist/chunk-SFPWPYGO.js
2682
+ // ../../packages/ocs-client/dist/chunk-L4DSDLRS.js
2654
2683
  import { z } from "zod";
2655
2684
  var OCS_V1_METHODS = /* @__PURE__ */ new Set([
2656
2685
  "getResellerInfo",
@@ -2995,7 +3024,7 @@ async function runWithBudget(method, attempt, budget = ocsBudgetFor(method)) {
2995
3024
  throw lastTimeout ?? new OcsTimeoutError(method, budget.attemptMs, budget.totalMs, Math.max(attempts, 1));
2996
3025
  }
2997
3026
 
2998
- // ../../packages/ocs-client/dist/chunk-WYFBYNKX.js
3027
+ // ../../packages/ocs-client/dist/chunk-XP62UVUD.js
2999
3028
  var RATE_LIMIT = 10;
3000
3029
  var WINDOW_MS = 1e3;
3001
3030
  var windows = /* @__PURE__ */ new Map();
@@ -3417,7 +3446,8 @@ var OcsClient = class {
3417
3446
  const url = `${this.baseUrl}/v1?token=${tok}`;
3418
3447
  assertBareIntParam(method, params);
3419
3448
  const wireParams = applyParamRenames(method, params);
3420
- const body = JSON.stringify({ [method]: wireParams });
3449
+ const shapedParams = method === "modifySubscriberStatus" ? nestSubscriberIdParam(wireParams) : wireParams;
3450
+ const body = JSON.stringify({ [method]: shapedParams });
3421
3451
  return retryWithBackoff(async () => {
3422
3452
  await acquireToken(tok);
3423
3453
  await acquireEndpointSlot(tok, method, this._priority);
@@ -3481,6 +3511,7 @@ var OcsClient = class {
3481
3511
  } else {
3482
3512
  payload = null;
3483
3513
  }
3514
+ payload = normaliseAbsentOcsPayload(method, payload, shapedParams);
3484
3515
  if (this._validateResponses) {
3485
3516
  const schema = RESPONSE_SCHEMAS[method];
3486
3517
  if (schema) {
@@ -4342,6 +4373,31 @@ function subscriberSimId(record) {
4342
4373
  if (nested && typeof nested === "object" && nested !== record) return subscriberSimId(nested);
4343
4374
  return void 0;
4344
4375
  }
4376
+ function extractSimProviderStatus(data) {
4377
+ const name = (rec) => {
4378
+ if (!rec || typeof rec !== "object") return void 0;
4379
+ const r = rec;
4380
+ for (const key of ["simStatus", "status"]) {
4381
+ const v = r[key];
4382
+ if (typeof v === "string" && v.trim() !== "") return v.trim();
4383
+ }
4384
+ return void 0;
4385
+ };
4386
+ if (!Array.isArray(data)) return name(data);
4387
+ let latest;
4388
+ let firstReadable;
4389
+ for (const entry of data) {
4390
+ const status = name(entry);
4391
+ if (status === void 0) continue;
4392
+ const rec = entry;
4393
+ const end = rec.end;
4394
+ if (end === void 0 || end === null || end === "") return status;
4395
+ firstReadable ??= status;
4396
+ const at = typeof rec.start === "string" || typeof rec.start === "number" ? Date.parse(String(rec.start)) : NaN;
4397
+ if (Number.isFinite(at) && (!latest || at > latest.at)) latest = { status, at };
4398
+ }
4399
+ return latest?.status ?? firstReadable;
4400
+ }
4345
4401
  function prepaidPackageRows(data) {
4346
4402
  return ocsArray(data, PREPAID_PACKAGE_KEYS);
4347
4403
  }
@@ -4676,6 +4732,7 @@ export {
4676
4732
  lastNDaysPeriod,
4677
4733
  locationParams,
4678
4734
  subscriberIdParams,
4735
+ modifySubscriberStatusParams,
4679
4736
  recurringPackageParams,
4680
4737
  networkEventsOverPeriodParams,
4681
4738
  usageOverPeriodParams,
@@ -4712,6 +4769,7 @@ export {
4712
4769
  subscriberRows,
4713
4770
  extractResellerBalance,
4714
4771
  subscriberSimId,
4772
+ extractSimProviderStatus,
4715
4773
  prepaidPackageRows,
4716
4774
  isActivePackage,
4717
4775
  staleActivePackages,
@@ -4760,4 +4818,4 @@ export {
4760
4818
  storefrontScreen,
4761
4819
  CARRIER_VERSION
4762
4820
  };
4763
- //# sourceMappingURL=chunk-DF2PGR5H.js.map
4821
+ //# sourceMappingURL=chunk-ZLPXWOYO.js.map