@carrierllc/mcp 0.13.10 → 0.13.12

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
@@ -39,7 +39,7 @@ import {
39
39
  verifyStorefront,
40
40
  walletScreen,
41
41
  which
42
- } from "./chunk-AUOGFI2I.js";
42
+ } from "./chunk-IQDAU7WA.js";
43
43
  import {
44
44
  copyTree,
45
45
  exists,
package/dist/index.js CHANGED
@@ -17,8 +17,10 @@ import {
17
17
  deploySite,
18
18
  esimStatusPerAccountParams,
19
19
  extractDailyUsage,
20
+ extractEsimStatusByAccount,
20
21
  extractEsimStatusCounts,
21
22
  extractResellerBalance,
23
+ extractSimProviderStatus,
22
24
  extractSubscriberStatus,
23
25
  filterActiveSubscribers,
24
26
  fleetScreen,
@@ -69,8 +71,9 @@ import {
69
71
  summarizeNetworkEvents,
70
72
  usageOverPeriodParams,
71
73
  verifyStorefront,
72
- withOcsListSummary
73
- } from "./chunk-AUOGFI2I.js";
74
+ withOcsListSummary,
75
+ withTemplateResellerId
76
+ } from "./chunk-IQDAU7WA.js";
74
77
  import "./chunk-SHKKVIIA.js";
75
78
 
76
79
  // src/index.ts
@@ -2212,7 +2215,11 @@ function registerAllTools(server2, ctx) {
2212
2215
  content: [{ type: "text", text: `Error: ${params.error}` }]
2213
2216
  };
2214
2217
  }
2215
- return ocsCall(ctx.env, token2, "createPrepaidPackageTemplate", params);
2218
+ const withReseller = await withTemplateResellerId(
2219
+ params,
2220
+ () => getDefaultResellerId(ctx.env, token2)
2221
+ );
2222
+ return ocsCall(ctx.env, token2, "createPrepaidPackageTemplate", withReseller);
2216
2223
  }
2217
2224
  )
2218
2225
  );
@@ -3763,7 +3770,7 @@ function registerIntelligenceTools(server2, ctx) {
3763
3770
  const simId = subscriberSimId(sub.data);
3764
3771
  const sim = simId !== void 0 ? await safeCall(ctx.env, token2, "getSimProviderStatus", simId) : { data: null, error: null };
3765
3772
  if (sim.data) {
3766
- const simStatus = String(sim.data.simStatus ?? sim.data.status ?? "").toUpperCase();
3773
+ const simStatus = (extractSimProviderStatus(sim.data) ?? "").toUpperCase();
3767
3774
  if (simStatus && !["ENABLED", "ACTIVE", "ACTIVATED"].includes(simStatus)) {
3768
3775
  findings.push(`SIM provider status is ${simStatus} \u2014 SIM may be disabled at network level`);
3769
3776
  actions.push(`Enable SIM via change_sim_status`);
@@ -10671,19 +10678,23 @@ function extractAccounts(json) {
10671
10678
  function toFleetInput(raw) {
10672
10679
  const counts = extractEsimStatusCounts(raw.status);
10673
10680
  const accountRecords = extractAccounts(raw.accounts);
10674
- const accounts = accountRecords.map((a) => ({
10675
- name: String(a.name ?? a.accountId ?? "?"),
10676
- balance: Number(a.balance ?? 0),
10677
- // Per-account status breakdown is not in listResellerAccount; the fleet
10678
- // totals come from the status call. Showing 0 here would read as "this
10679
- // account has no eSIMs", so the per-account columns stay at the balance
10680
- // and flags this call actually carries.
10681
- active: 0,
10682
- suspended: 0,
10683
- inventory: 0,
10684
- other: 0,
10685
- packageOnly: Boolean(a.packageOnly)
10686
- }));
10681
+ const byId = /* @__PURE__ */ new Map();
10682
+ for (const row of extractEsimStatusByAccount(raw.status)) {
10683
+ if (row.id !== void 0) byId.set(row.id, row);
10684
+ }
10685
+ const accounts = accountRecords.map((a) => {
10686
+ const id = Number(a.id ?? a.accountId);
10687
+ const status = Number.isFinite(id) ? byId.get(id) : void 0;
10688
+ return {
10689
+ name: String(a.name ?? a.accountId ?? "?"),
10690
+ balance: Number(a.balance ?? 0),
10691
+ active: status?.active ?? 0,
10692
+ suspended: status?.suspended ?? 0,
10693
+ inventory: status?.inventory ?? 0,
10694
+ other: status?.other ?? 0,
10695
+ packageOnly: Boolean(a.packageOnly)
10696
+ };
10697
+ });
10687
10698
  const unavailable = [];
10688
10699
  if (raw.statusError) unavailable.push(`esimStatusPerAccount: ${raw.statusError}`);
10689
10700
  if (raw.accountsError) unavailable.push(`listResellerAccount: ${raw.accountsError}`);