@carrierllc/mcp 0.13.0 → 0.13.4
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/README.md +4 -3
- package/dist/{chunk-ZUUC3J4J.js → chunk-DUAXD7GD.js} +1529 -1130
- package/dist/chunk-DUAXD7GD.js.map +1 -0
- package/dist/cli.js +61 -13
- package/dist/cli.js.map +1 -1
- package/dist/index.js +95 -47
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/plugin/carrier/README.md +2 -1
- package/plugin/carrier/skills/issue-esim/SKILL.md +92 -0
- package/plugin/carrier/skills/provision/SKILL.md +2 -0
- package/templates/storefront/src/app/activate/[orderId]/ActivateClient.tsx +2 -2
- package/templates/storefront/src/components/faq/FaqSection.tsx +2 -2
- package/dist/chunk-ZUUC3J4J.js.map +0 -1
package/dist/cli.js
CHANGED
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
verifyStorefront,
|
|
40
40
|
walletScreen,
|
|
41
41
|
which
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-DUAXD7GD.js";
|
|
43
43
|
import {
|
|
44
44
|
copyTree,
|
|
45
45
|
exists,
|
|
@@ -731,6 +731,54 @@ function buildDashScreen(domain, payload) {
|
|
|
731
731
|
// src/cli/lib/status.ts
|
|
732
732
|
import { homedir as homedir2 } from "os";
|
|
733
733
|
import { join as join5 } from "path";
|
|
734
|
+
|
|
735
|
+
// src/cli/lib/mcp-url.ts
|
|
736
|
+
var PRODUCTION_MCP_URL = "https://mcp.carrier.llc/mcp";
|
|
737
|
+
var PRODUCTION_HOST = "mcp.carrier.llc";
|
|
738
|
+
var URL_TOKEN = /https?:\/\/[^\s"'<>)]+/g;
|
|
739
|
+
function pathWithoutTrailingSlash(pathname) {
|
|
740
|
+
let end = pathname.length;
|
|
741
|
+
while (end > 1 && pathname.charCodeAt(end - 1) === 47) end -= 1;
|
|
742
|
+
return pathname.slice(0, end);
|
|
743
|
+
}
|
|
744
|
+
function parseHttpUrl(value) {
|
|
745
|
+
try {
|
|
746
|
+
const parsed = new URL(value);
|
|
747
|
+
if (parsed.protocol !== "https:" && parsed.protocol !== "http:") return null;
|
|
748
|
+
return parsed;
|
|
749
|
+
} catch {
|
|
750
|
+
return null;
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
function isProductionMcpUrl(value) {
|
|
754
|
+
if (value === PRODUCTION_MCP_URL) return true;
|
|
755
|
+
const parsed = parseHttpUrl(value);
|
|
756
|
+
if (!parsed || parsed.protocol !== "https:" || parsed.hostname !== PRODUCTION_HOST) return false;
|
|
757
|
+
return pathWithoutTrailingSlash(parsed.pathname) === "/mcp";
|
|
758
|
+
}
|
|
759
|
+
function isCarrierMcpHost(value) {
|
|
760
|
+
const parsed = parseHttpUrl(value);
|
|
761
|
+
return parsed?.protocol === "https:" && parsed.hostname === PRODUCTION_HOST;
|
|
762
|
+
}
|
|
763
|
+
function trimTrailingPunctuation(token) {
|
|
764
|
+
let end = token.length;
|
|
765
|
+
while (end > 0) {
|
|
766
|
+
const code = token.charCodeAt(end - 1);
|
|
767
|
+
if (code !== 46 && code !== 44 && code !== 59 && code !== 58) break;
|
|
768
|
+
end -= 1;
|
|
769
|
+
}
|
|
770
|
+
return token.slice(0, end);
|
|
771
|
+
}
|
|
772
|
+
function lineMentionsProductionMcp(line) {
|
|
773
|
+
const tokens = line.match(URL_TOKEN);
|
|
774
|
+
if (!tokens) return false;
|
|
775
|
+
for (const token of tokens) {
|
|
776
|
+
if (isProductionMcpUrl(trimTrailingPunctuation(token))) return true;
|
|
777
|
+
}
|
|
778
|
+
return false;
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
// src/cli/lib/status.ts
|
|
734
782
|
function detectEnvToken() {
|
|
735
783
|
const api = process.env.CARRIER_API_KEY?.trim() || process.env.CARRIER_ORG_API_KEY?.trim() || "";
|
|
736
784
|
if (api.startsWith("ak_") || api.length > 0) {
|
|
@@ -746,8 +794,8 @@ function rankHit(name, url) {
|
|
|
746
794
|
else if (/^carrier[-_]?/i.test(name) && !/test|staging|stg|dev|local/i.test(name)) rank += 40;
|
|
747
795
|
else if (/carrier/i.test(name) && !/test|staging|stg|dev|local/i.test(name)) rank += 20;
|
|
748
796
|
else if (/carrier/i.test(name)) rank += 5;
|
|
749
|
-
if (url
|
|
750
|
-
else if (
|
|
797
|
+
if (isProductionMcpUrl(url)) rank += 50;
|
|
798
|
+
else if (isCarrierMcpHost(url)) rank += 25;
|
|
751
799
|
return rank;
|
|
752
800
|
}
|
|
753
801
|
function scanMcpServers(servers) {
|
|
@@ -759,10 +807,10 @@ function scanMcpServers(servers) {
|
|
|
759
807
|
}
|
|
760
808
|
const url = typeof entry?.url === "string" ? entry.url : "";
|
|
761
809
|
const rank = rankHit(name, url);
|
|
762
|
-
if (rank < 20 && !url
|
|
810
|
+
if (rank < 20 && !isCarrierMcpHost(url)) {
|
|
763
811
|
continue;
|
|
764
812
|
}
|
|
765
|
-
const urlMatches = url
|
|
813
|
+
const urlMatches = isProductionMcpUrl(url);
|
|
766
814
|
const hit = {
|
|
767
815
|
registered: true,
|
|
768
816
|
urlMatches,
|
|
@@ -840,7 +888,7 @@ ${r.stderr}`;
|
|
|
840
888
|
if (!carrierLine) {
|
|
841
889
|
return { registered: false, urlMatches: false, detail: "carrier not in claude mcp list" };
|
|
842
890
|
}
|
|
843
|
-
const urlMatches =
|
|
891
|
+
const urlMatches = lineMentionsProductionMcp(carrierLine);
|
|
844
892
|
return { registered: true, urlMatches, detail: carrierLine.slice(0, 200) };
|
|
845
893
|
}
|
|
846
894
|
function buildNextSteps(s) {
|
|
@@ -1985,12 +2033,12 @@ var CLI_DOMAINS = [
|
|
|
1985
2033
|
{
|
|
1986
2034
|
name: "sim-status set",
|
|
1987
2035
|
tool: "change_sim_status",
|
|
1988
|
-
summary: "Change the SIM/eSIM status at the SIM provider level.
|
|
2036
|
+
summary: "Change the SIM/eSIM status at the SIM provider level. ENABLED and DISABLED map to OCS Affected and Free.",
|
|
1989
2037
|
options: [
|
|
1990
2038
|
ICCID,
|
|
1991
2039
|
{
|
|
1992
2040
|
flags: "--status <status>",
|
|
1993
|
-
description: "New SIM status: ENABLED
|
|
2041
|
+
description: "New SIM status: ENABLED or DISABLED",
|
|
1994
2042
|
arg: "simStatus",
|
|
1995
2043
|
type: "string",
|
|
1996
2044
|
required: true
|
|
@@ -2090,12 +2138,12 @@ var CLI_DOMAINS = [
|
|
|
2090
2138
|
{
|
|
2091
2139
|
name: "bitrate set",
|
|
2092
2140
|
tool: "hlr_set_bitrate",
|
|
2093
|
-
summary: "Set an HLR-level bandwidth cap.
|
|
2141
|
+
summary: "Set an HLR-level bandwidth cap. Bits per second are mapped onto the OCS KB_ enum.",
|
|
2094
2142
|
options: [
|
|
2095
2143
|
ICCID,
|
|
2096
2144
|
{
|
|
2097
2145
|
flags: "--bitrate <bps>",
|
|
2098
|
-
description: "Max bitrate in bits per second
|
|
2146
|
+
description: "Max bitrate in bits per second. 256000 is KB_256. 0 is UNLIMITED.",
|
|
2099
2147
|
arg: "bitrate",
|
|
2100
2148
|
type: "number"
|
|
2101
2149
|
},
|
|
@@ -2366,7 +2414,7 @@ var CLI_DOMAINS = [
|
|
|
2366
2414
|
{
|
|
2367
2415
|
name: "set-core",
|
|
2368
2416
|
tool: "modify_template_core",
|
|
2369
|
-
summary: "Change name, limits,
|
|
2417
|
+
summary: "Change name, limits, cost, validity or zone on a template.",
|
|
2370
2418
|
options: [
|
|
2371
2419
|
TEMPLATE_ID,
|
|
2372
2420
|
{
|
|
@@ -2387,7 +2435,7 @@ var CLI_DOMAINS = [
|
|
|
2387
2435
|
TEMPLATE_ID,
|
|
2388
2436
|
{
|
|
2389
2437
|
flags: "--changes <json>",
|
|
2390
|
-
description: `Recurring fields as JSON, e.g. '{"
|
|
2438
|
+
description: `Recurring fields as JSON, e.g. '{"recurringPeriodicityType":2,"nbOccurrence":12}'`,
|
|
2391
2439
|
arg: "changes",
|
|
2392
2440
|
type: "string",
|
|
2393
2441
|
required: true
|
|
@@ -2452,7 +2500,7 @@ var CLI_DOMAINS = [
|
|
|
2452
2500
|
options: [
|
|
2453
2501
|
{
|
|
2454
2502
|
flags: "--zone <json>",
|
|
2455
|
-
description: `Zone config as JSON, e.g. '{"
|
|
2503
|
+
description: `Zone config as JSON, e.g. '{"locationZoneName":"Europe","tadigList":["AZER1","QWER1"],"networkProfileId":79}'`,
|
|
2456
2504
|
arg: "zone",
|
|
2457
2505
|
type: "string",
|
|
2458
2506
|
required: true
|