@carrierllc/mcp 0.2.20 → 0.3.0

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
@@ -5,7 +5,7 @@ import {
5
5
  clampUsagePeriod,
6
6
  generateStorefrontLogo,
7
7
  lastNDaysPeriod
8
- } from "./chunk-NHQDO2E7.js";
8
+ } from "./chunk-ZII4CD4U.js";
9
9
 
10
10
  // src/cli/index.ts
11
11
  import { Command } from "commander";
@@ -1188,6 +1188,169 @@ var CLI_DOMAINS = [
1188
1188
  }
1189
1189
  ],
1190
1190
  write: true
1191
+ },
1192
+ {
1193
+ name: "sim-status show",
1194
+ tool: "get_sim_provider_status",
1195
+ summary: "SIM/eSIM status at the SIM provider level, distinct from OCS status.",
1196
+ options: [ICCID]
1197
+ },
1198
+ {
1199
+ name: "sim-status set",
1200
+ tool: "change_sim_status",
1201
+ summary: "Change the SIM/eSIM status at the SIM provider level. DELETED is irreversible.",
1202
+ options: [
1203
+ ICCID,
1204
+ {
1205
+ flags: "--status <status>",
1206
+ description: "New SIM status: ENABLED, DISABLED or DELETED (irreversible)",
1207
+ arg: "simStatus",
1208
+ type: "string",
1209
+ required: true
1210
+ }
1211
+ ],
1212
+ write: true
1213
+ },
1214
+ {
1215
+ name: "phone-number set",
1216
+ tool: "affect_subscriber_phone_number",
1217
+ summary: "Assign a phone number (MSISDN) to a subscriber.",
1218
+ options: [
1219
+ ICCID,
1220
+ {
1221
+ flags: "--phone-number <e164>",
1222
+ description: "E.164 phone number to assign, e.g. +31612345678",
1223
+ arg: "phone_number",
1224
+ type: "string",
1225
+ required: true
1226
+ },
1227
+ {
1228
+ flags: "--phone-type <type>",
1229
+ description: "'fake' for test/dev MSISDNs, 'real' for production",
1230
+ arg: "phone_type",
1231
+ type: "string",
1232
+ required: true
1233
+ }
1234
+ ],
1235
+ write: true
1236
+ },
1237
+ {
1238
+ name: "contact set",
1239
+ tool: "modify_subscriber_contact_info",
1240
+ summary: "Update contact details on a subscriber. Omitted fields stay unchanged.",
1241
+ options: [
1242
+ ICCID,
1243
+ { flags: "--first-name <name>", description: "First name", arg: "firstName", type: "string" },
1244
+ { flags: "--last-name <name>", description: "Last name", arg: "lastName", type: "string" },
1245
+ { flags: "--company <name>", description: "Company name", arg: "company", type: "string" },
1246
+ { flags: "--email <email>", description: "Email address", arg: "email", type: "string" },
1247
+ { flags: "--phone-number <number>", description: "Phone number", arg: "phoneNumber", type: "string" }
1248
+ ],
1249
+ write: true
1250
+ },
1251
+ {
1252
+ name: "mobile-plan set",
1253
+ tool: "modify_subscriber_mobile_plan",
1254
+ summary: "Change the mobile pricing plan a subscriber is billed under.",
1255
+ options: [
1256
+ ICCID,
1257
+ {
1258
+ flags: "--plan-id <id>",
1259
+ description: "Mobile pricing plan ID",
1260
+ arg: "mobile_plan_id",
1261
+ type: "number",
1262
+ required: true
1263
+ }
1264
+ ],
1265
+ write: true
1266
+ },
1267
+ {
1268
+ name: "voip-plan set",
1269
+ tool: "modify_subscriber_voip_plan",
1270
+ summary: "Change the VoIP pricing plan assigned to a subscriber.",
1271
+ options: [
1272
+ ICCID,
1273
+ {
1274
+ flags: "--plan-id <id>",
1275
+ description: "VoIP pricing plan ID",
1276
+ arg: "voip_plan_id",
1277
+ type: "number",
1278
+ required: true
1279
+ }
1280
+ ],
1281
+ write: true
1282
+ },
1283
+ {
1284
+ name: "traffic set",
1285
+ tool: "set_subscriber_traffic_restrictions",
1286
+ summary: "Enable or disable data, calls and SMS per traffic type. Omit a flag to leave it unchanged.",
1287
+ options: [
1288
+ ICCID,
1289
+ { flags: "--data <bool>", description: "Allow data traffic (true or false)", arg: "dataAllowed", type: "boolean" },
1290
+ { flags: "--moc <bool>", description: "Allow outbound calls (true or false)", arg: "mocAllowed", type: "boolean" },
1291
+ { flags: "--mtc <bool>", description: "Allow inbound calls (true or false)", arg: "mtcAllowed", type: "boolean" },
1292
+ { flags: "--sms <bool>", description: "Allow outbound SMS (true or false)", arg: "smsMoAllowed", type: "boolean" }
1293
+ ],
1294
+ write: true
1295
+ },
1296
+ {
1297
+ name: "bitrate show",
1298
+ tool: "hlr_get_bitrate",
1299
+ summary: "Current HLR-level bandwidth cap for a subscriber.",
1300
+ options: [ICCID]
1301
+ },
1302
+ {
1303
+ name: "bitrate set",
1304
+ tool: "hlr_set_bitrate",
1305
+ summary: "Set an HLR-level bandwidth cap. Pass a numeric bps value or an OCS level.",
1306
+ options: [
1307
+ ICCID,
1308
+ {
1309
+ flags: "--bitrate <bps>",
1310
+ description: "Max bitrate in bits per second (0 removes the limit)",
1311
+ arg: "bitrate",
1312
+ type: "number"
1313
+ },
1314
+ {
1315
+ flags: "--bitrate-string <level>",
1316
+ description: "OCS bitrate level, e.g. KB_256, KB_1024, UNLIMITED (instead of --bitrate)",
1317
+ arg: "bitrate_string",
1318
+ type: "string"
1319
+ }
1320
+ ],
1321
+ write: true,
1322
+ requireOneOf: ["bitrate", "bitrate_string"]
1323
+ },
1324
+ {
1325
+ name: "greenzone reset",
1326
+ tool: "reset_subscriber_gz_counter",
1327
+ summary: "Reset the Green Zone byte counter to zero. Irreversible.",
1328
+ options: [ICCID],
1329
+ write: true
1330
+ },
1331
+ {
1332
+ name: "cell-location",
1333
+ tool: "get_subscriber_location_by_cell_id",
1334
+ summary: "Resolve a raw cell tower tuple to coordinates (Bridge4IP GeoSense).",
1335
+ options: [
1336
+ {
1337
+ flags: "--radio-type <type>",
1338
+ description: "Radio type: 2G, 3G, 4G, 5G or NB-IoT",
1339
+ arg: "radio_type",
1340
+ type: "string",
1341
+ required: true
1342
+ },
1343
+ { flags: "--mcc <mcc>", description: "Mobile Country Code", arg: "mcc", type: "number", required: true },
1344
+ { flags: "--mnc <mnc>", description: "Mobile Network Code", arg: "mnc", type: "number", required: true },
1345
+ { flags: "--lac <lac>", description: "Location Area Code", arg: "lac", type: "number", required: true },
1346
+ { flags: "--cell-id <id>", description: "Cell tower ID (strongly recommended)", arg: "cell_id", type: "number" },
1347
+ {
1348
+ flags: "--signal-strength <dbm>",
1349
+ description: "Signal strength in dBm, e.g. -89 (improves accuracy)",
1350
+ arg: "signal_strength",
1351
+ type: "number"
1352
+ }
1353
+ ]
1191
1354
  }
1192
1355
  ]
1193
1356
  },
@@ -1280,6 +1443,87 @@ var CLI_DOMAINS = [
1280
1443
  ],
1281
1444
  write: true
1282
1445
  },
1446
+ {
1447
+ name: "assign-recurring",
1448
+ tool: "assign_recurring_package",
1449
+ summary: "Assign an auto-renewing package from a recurring-enabled template.",
1450
+ options: [
1451
+ ICCID,
1452
+ {
1453
+ flags: "--template-id <id>",
1454
+ description: "Recurring package template ID from `carrier templates list`",
1455
+ arg: "packageTemplateId",
1456
+ type: "number",
1457
+ required: true
1458
+ },
1459
+ {
1460
+ flags: "--activate-at-first-use",
1461
+ description: "Activate on first network usage (instead of --start-time)",
1462
+ arg: "activation_at_first_use",
1463
+ type: "boolean"
1464
+ },
1465
+ {
1466
+ flags: "--start-time <iso>",
1467
+ description: "Scheduled activation, ISO 8601 UTC (instead of --activate-at-first-use)",
1468
+ arg: "start_time_utc",
1469
+ type: "string"
1470
+ }
1471
+ ],
1472
+ write: true
1473
+ },
1474
+ {
1475
+ name: "recurring set",
1476
+ tool: "stop_resume_recurring_package",
1477
+ summary: "Pause or restart the auto-renewal of a recurring package.",
1478
+ options: [
1479
+ ICCID,
1480
+ PACKAGE_ID,
1481
+ {
1482
+ flags: "--action <action>",
1483
+ description: "'stop' halts future renewals, 'resume' re-enables them",
1484
+ arg: "action",
1485
+ type: "string",
1486
+ required: true
1487
+ }
1488
+ ],
1489
+ write: true
1490
+ },
1491
+ {
1492
+ name: "active-period set",
1493
+ tool: "modify_subscriber_package_active_period",
1494
+ summary: "Move the start and/or end of a package's active period.",
1495
+ options: [
1496
+ ICCID,
1497
+ {
1498
+ flags: "--package-id <id>",
1499
+ description: "Package ID from `carrier packages list`",
1500
+ arg: "package_id",
1501
+ type: "number",
1502
+ required: true
1503
+ },
1504
+ {
1505
+ flags: "--start <date>",
1506
+ description: "New start date, ISO 8601 (e.g. 2026-09-01)",
1507
+ arg: "start_date",
1508
+ type: "string"
1509
+ },
1510
+ {
1511
+ flags: "--end <date>",
1512
+ description: "New end date, ISO 8601 (e.g. 2026-09-30)",
1513
+ arg: "end_date",
1514
+ type: "string"
1515
+ }
1516
+ ],
1517
+ write: true,
1518
+ requireOneOf: ["start_date", "end_date"]
1519
+ },
1520
+ {
1521
+ name: "clean",
1522
+ tool: "clean_all_packages",
1523
+ summary: "Remove ALL packages from a subscriber. Irreversible.",
1524
+ options: [ICCID],
1525
+ write: true
1526
+ },
1283
1527
  {
1284
1528
  name: "delete",
1285
1529
  tool: "delete_subscriber_package",
@@ -1402,6 +1646,28 @@ var CLI_DOMAINS = [
1402
1646
  ],
1403
1647
  write: true
1404
1648
  },
1649
+ {
1650
+ name: "network-profile set",
1651
+ tool: "change_network_profile_of_location_zone",
1652
+ summary: "Attach or change the network profile on an existing location zone.",
1653
+ options: [
1654
+ {
1655
+ flags: "--zone-id <id>",
1656
+ description: "Location zone ID from `carrier zones list`",
1657
+ arg: "location_zone_id",
1658
+ type: "number",
1659
+ required: true
1660
+ },
1661
+ {
1662
+ flags: "--network-profile-id <id>",
1663
+ description: "Network profile ID from `carrier network-profiles list`",
1664
+ arg: "network_profile_id",
1665
+ type: "number",
1666
+ required: true
1667
+ }
1668
+ ],
1669
+ write: true
1670
+ },
1405
1671
  {
1406
1672
  name: "destinations",
1407
1673
  tool: "list_destination_lists",
@@ -1458,6 +1724,193 @@ var CLI_DOMAINS = [
1458
1724
  }
1459
1725
  ]
1460
1726
  },
1727
+ {
1728
+ name: "accounts",
1729
+ summary: "Reseller accounts: balances and subscriber moves.",
1730
+ commands: [
1731
+ {
1732
+ name: "list",
1733
+ tool: "list_reseller_accounts",
1734
+ summary: "Accounts under a reseller with name, balance and type.",
1735
+ options: [RESELLER_ID]
1736
+ },
1737
+ {
1738
+ name: "balance set",
1739
+ tool: "modify_account_balance",
1740
+ summary: "Add to or replace an account's monetary balance.",
1741
+ options: [
1742
+ { ...ACCOUNT_ID("Account ID from `carrier accounts list`"), required: true },
1743
+ {
1744
+ flags: "--amount <amount>",
1745
+ description: "Amount to add (adapt) or set to (set)",
1746
+ arg: "amount",
1747
+ type: "number",
1748
+ required: true
1749
+ },
1750
+ {
1751
+ flags: "--mode <mode>",
1752
+ description: "'adapt' adds or subtracts, 'set' replaces",
1753
+ arg: "mode",
1754
+ type: "string",
1755
+ required: true
1756
+ }
1757
+ ],
1758
+ write: true
1759
+ },
1760
+ {
1761
+ name: "move-subscribers",
1762
+ tool: "move_subscriber_range_to_account",
1763
+ summary: "Move a contiguous ICCID range of subscribers to another account.",
1764
+ options: [
1765
+ {
1766
+ flags: "--iccid-from <iccid>",
1767
+ description: "Start ICCID of the range (inclusive)",
1768
+ arg: "iccidFrom",
1769
+ type: "string",
1770
+ required: true
1771
+ },
1772
+ {
1773
+ flags: "--iccid-to <iccid>",
1774
+ description: "End ICCID of the range (inclusive)",
1775
+ arg: "iccidTo",
1776
+ type: "string",
1777
+ required: true
1778
+ },
1779
+ { ...ACCOUNT_ID("Target account ID from `carrier accounts list`"), required: true }
1780
+ ],
1781
+ write: true
1782
+ }
1783
+ ]
1784
+ },
1785
+ {
1786
+ name: "reseller",
1787
+ summary: "The reseller the token belongs to.",
1788
+ commands: [
1789
+ {
1790
+ name: "show",
1791
+ tool: "get_reseller_info",
1792
+ summary: "Full reseller record: balance, pricing plans, contact and traffic config.",
1793
+ options: [RESELLER_ID]
1794
+ }
1795
+ ]
1796
+ },
1797
+ {
1798
+ name: "tariff",
1799
+ summary: "Wholesale tariffs: mobile and VoIP rates.",
1800
+ commands: [
1801
+ {
1802
+ name: "show",
1803
+ tool: "get_tariff",
1804
+ summary: "Per-country wholesale rates for data, voice and SMS.",
1805
+ options: [RESELLER_ID]
1806
+ },
1807
+ {
1808
+ name: "voip",
1809
+ tool: "list_subscriber_voip_tariff",
1810
+ summary: "VoIP tariff catalog for a reseller.",
1811
+ options: [
1812
+ {
1813
+ flags: "--reseller-id <id>",
1814
+ description: "Reseller ID (omit for the token owner's reseller)",
1815
+ arg: "reseller_id",
1816
+ type: "number"
1817
+ }
1818
+ ]
1819
+ },
1820
+ {
1821
+ name: "voip-rules",
1822
+ tool: "list_voip_tariff_rule",
1823
+ summary: "Rate rules inside one VoIP plan.",
1824
+ options: [
1825
+ {
1826
+ flags: "--voip-plan-id <id>",
1827
+ description: "VoIP plan ID from `carrier tariff voip`",
1828
+ arg: "voip_plan_id",
1829
+ type: "number",
1830
+ required: true
1831
+ }
1832
+ ]
1833
+ }
1834
+ ]
1835
+ },
1836
+ {
1837
+ name: "sms",
1838
+ summary: "Mobile-terminated SMS to subscribers.",
1839
+ commands: [
1840
+ {
1841
+ name: "send",
1842
+ tool: "send_sms",
1843
+ summary: "Send an MT SMS to one subscriber.",
1844
+ options: [
1845
+ ICCID,
1846
+ {
1847
+ flags: "--msisdn <msisdn>",
1848
+ description: "Target MSISDN in E.164 format",
1849
+ arg: "msisdn",
1850
+ type: "string",
1851
+ required: true
1852
+ },
1853
+ {
1854
+ flags: "--message <text>",
1855
+ description: "SMS text (160 chars GSM-7; 70 with emoji or non-Latin scripts)",
1856
+ arg: "message",
1857
+ type: "string",
1858
+ required: true
1859
+ },
1860
+ {
1861
+ flags: "--sender <sender>",
1862
+ description: "Sender ID or number shown on the device",
1863
+ arg: "sender",
1864
+ type: "string"
1865
+ }
1866
+ ],
1867
+ write: true
1868
+ }
1869
+ ]
1870
+ },
1871
+ {
1872
+ name: "sponsors",
1873
+ summary: "Sponsor networks backing the eSIM profiles.",
1874
+ commands: [
1875
+ {
1876
+ name: "list",
1877
+ tool: "list_sponsors",
1878
+ summary: "Sponsor carriers available to this reseller.",
1879
+ options: [RESELLER_ID]
1880
+ }
1881
+ ]
1882
+ },
1883
+ {
1884
+ name: "network-profiles",
1885
+ summary: "Roaming configuration profiles for zones and provisioning.",
1886
+ commands: [
1887
+ {
1888
+ name: "list",
1889
+ tool: "list_network_profiles",
1890
+ summary: "Network profiles available to this reseller.",
1891
+ options: []
1892
+ }
1893
+ ]
1894
+ },
1895
+ {
1896
+ name: "webhooks",
1897
+ summary: "Bridge4IP webhook and relay flag status.",
1898
+ commands: [
1899
+ {
1900
+ name: "show",
1901
+ tool: "carrier_webhook_config",
1902
+ summary: "Current relay flags (LU, Gy, VoIP, calls+SMS) and notification webhooks.",
1903
+ options: [
1904
+ {
1905
+ flags: "--reseller-id <id>",
1906
+ description: "Reseller ID (omit for the token owner's reseller)",
1907
+ arg: "reseller_id",
1908
+ type: "number"
1909
+ }
1910
+ ]
1911
+ }
1912
+ ]
1913
+ },
1461
1914
  {
1462
1915
  name: "intelligence",
1463
1916
  summary: "Composite reports over the fleet.",
@@ -1560,7 +2013,13 @@ function setArg(target, path, value) {
1560
2013
  node[parts[parts.length - 1]] = value;
1561
2014
  }
1562
2015
  function coerce(opt, raw) {
1563
- if (opt.type === "boolean") return { value: raw === true };
2016
+ if (opt.type === "boolean") {
2017
+ if (raw === true) return { value: true };
2018
+ const text3 = String(raw).toLowerCase();
2019
+ if (text3 === "true") return { value: true };
2020
+ if (text3 === "false") return { value: false };
2021
+ return { error: `${opt.flags} expects true or false, got "${String(raw)}"` };
2022
+ }
1564
2023
  if (opt.type === "number") {
1565
2024
  const n = Number(raw);
1566
2025
  if (!Number.isFinite(n)) return { error: `${opt.flags} expects a number, got "${String(raw)}"` };
@@ -2068,8 +2527,21 @@ program.command("ask").description(
2068
2527
  });
2069
2528
  for (const domain of CLI_DOMAINS) {
2070
2529
  const group = program.command(domain.name).description(domain.summary);
2530
+ const subgroups = /* @__PURE__ */ new Map();
2071
2531
  for (const cmd of domain.commands) {
2072
- const sub = group.command(cmd.name).description(cmd.write ? `${cmd.summary} Dry run unless --commit.` : cmd.summary);
2532
+ const parts = cmd.name.split(" ");
2533
+ let parent = group;
2534
+ let prefix = "";
2535
+ for (const part of parts.slice(0, -1)) {
2536
+ prefix = prefix ? `${prefix} ${part}` : part;
2537
+ let nested = subgroups.get(prefix);
2538
+ if (!nested) {
2539
+ nested = parent.command(part).description(`${part} subcommands`);
2540
+ subgroups.set(prefix, nested);
2541
+ }
2542
+ parent = nested;
2543
+ }
2544
+ const sub = parent.command(parts[parts.length - 1]).description(cmd.write ? `${cmd.summary} Dry run unless --commit.` : cmd.summary);
2073
2545
  for (const opt of cmd.options) sub.option(opt.flags, opt.description);
2074
2546
  sub.option("--json", "Print the raw tool response on stdout and nothing else");
2075
2547
  if (cmd.write) sub.option("--commit", "Apply the change instead of previewing it");