@carrierllc/mcp 0.4.0 → 0.4.1

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-RBG4MKMW.js";
42
+ } from "./chunk-6OI56RSR.js";
43
43
  import {
44
44
  copyTree,
45
45
  exists,
package/dist/index.js CHANGED
@@ -25,13 +25,14 @@ import {
25
25
  probeAll,
26
26
  provisionClerk,
27
27
  rankTargets,
28
+ recurringPackageParams,
28
29
  renderHtml,
29
30
  repairPlanFor,
30
31
  storefrontClerkUrls,
31
32
  subscriberIdParams,
32
33
  usageOverPeriodParams,
33
34
  verifyStorefront
34
- } from "./chunk-RBG4MKMW.js";
35
+ } from "./chunk-6OI56RSR.js";
35
36
  import "./chunk-SHKKVIIA.js";
36
37
 
37
38
  // src/index.ts
@@ -1217,21 +1218,10 @@ function registerAllTools(server2, ctx) {
1217
1218
  TOOL_SCOPES["assign_recurring_package"],
1218
1219
  ctx,
1219
1220
  async ({ iccid, packageTemplateId, activation_at_first_use, start_time_utc }, token2) => {
1220
- const cache = /* @__PURE__ */ new Map();
1221
- const sub = await resolveSubscriberByIccid(ctx.env, token2, iccid, cache);
1222
- const subscriberId = sub.id ?? sub.subscriberId;
1223
- if (subscriberId === void 0) {
1224
- return {
1225
- isError: true,
1226
- content: [{ type: "text", text: `Error: Could not resolve subscriberId for ICCID ${iccid}` }]
1227
- };
1228
- }
1229
- const params = {
1230
- subscriber: Number(subscriberId),
1231
- packageTemplateId
1232
- };
1233
- if (activation_at_first_use === true) params.activationAtFirstUse = true;
1234
- if (start_time_utc !== void 0) params.startTimeUTC = start_time_utc;
1221
+ const params = recurringPackageParams(iccid, packageTemplateId, {
1222
+ activationAtFirstUse: activation_at_first_use,
1223
+ startTimeUTC: start_time_utc
1224
+ });
1235
1225
  return ocsCall(ctx.env, token2, "affectRecurringPackageToSubscriber", params);
1236
1226
  }
1237
1227
  )
@@ -3544,7 +3534,10 @@ High suspension rate (${totalSuspended} suspended vs ${totalActive} active)`);
3544
3534
  (a) => Number(a.balance ?? 0) < 10
3545
3535
  );
3546
3536
  const packageOnlyZero = accounts.filter(
3547
- (a) => Boolean(a.packageOnly) && Number(a.balance ?? 0) <= 0
3537
+ (a) => a.packageOnly === true && Number(a.balance ?? 0) === 0
3538
+ );
3539
+ const criticalZero = accounts.filter(
3540
+ (a) => a.packageOnly === false && Number(a.balance ?? 0) <= 0
3548
3541
  );
3549
3542
  sections.push(`
3550
3543
  ## Account Summary`);
@@ -3560,23 +3553,28 @@ High suspension rate (${totalSuspended} suspended vs ${totalActive} active)`);
3560
3553
  sections.push(`| ${a.name ?? a.accountId ?? "?"} | ${Number(a.balance ?? 0).toFixed(2)} | ${a.packageOnly ? "yes" : "no"} |`);
3561
3554
  }
3562
3555
  }
3563
- const critical = packageOnlyZero.length;
3564
- const warning = lowBalance.length - critical;
3565
- const healthy = accounts.length - lowBalance.length;
3556
+ const informational = packageOnlyZero.length;
3557
+ const critical = criticalZero.length;
3558
+ const warning = lowBalance.length - informational - critical;
3559
+ const healthy = accounts.length - informational - critical - Math.max(warning, 0);
3566
3560
  sections.push(`
3567
3561
  ## Fleet Health Verdict`);
3568
3562
  sections.push(`- Healthy: ${healthy}`);
3569
- sections.push(`- Warning (low balance, not package-only-zero): ${Math.max(warning, 0)}`);
3570
- sections.push(`- Critical (package-only and 0 balance): ${critical}`);
3563
+ sections.push(`- Informational (package-only at 0 balance): ${informational}`);
3564
+ sections.push(`- Warning (low balance): ${Math.max(warning, 0)}`);
3565
+ sections.push(`- Critical (non-package-only at 0 balance): ${critical}`);
3571
3566
  if (accounts.length === 0) {
3572
3567
  sections.push(`
3573
3568
  No accounts found under this reseller.`);
3574
3569
  } else if (critical > 0) {
3575
3570
  sections.push(`
3576
- Action: top up package-only accounts at 0 balance to keep packages assignable.`);
3571
+ Action: top up non-package-only accounts at 0 balance to restore rated traffic.`);
3577
3572
  } else if (lowBalance.length === 0) {
3578
3573
  sections.push(`
3579
3574
  All accounts healthy.`);
3575
+ } else if (informational > 0 && warning <= 0) {
3576
+ sections.push(`
3577
+ Package-only accounts at 0 balance require no action.`);
3580
3578
  }
3581
3579
  } else {
3582
3580
  sections.push(`