@carrierllc/mcp 0.13.47 → 0.13.51

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.
@@ -957,15 +957,6 @@ async function provisionClerk(opts) {
957
957
  "CLERK_PLATFORM_TOKEN"
958
958
  ]);
959
959
  const notes = [];
960
- if (platformToken && !opts.noCreate) {
961
- const created = await createClerkApplication(platformToken, {
962
- name: opts.name,
963
- domain: opts.domain,
964
- production: opts.production
965
- });
966
- if (created.ok) return created;
967
- notes.push(created.reason ?? "Clerk Platform API call failed.");
968
- }
969
960
  const discovered = discoverClerkCredentials(opts.env);
970
961
  if (discovered) {
971
962
  return {
@@ -975,12 +966,27 @@ async function provisionClerk(opts) {
975
966
  reason: notes.length ? notes.join(" ") : void 0
976
967
  };
977
968
  }
969
+ if (platformToken && !opts.noCreate) {
970
+ const created = await createClerkApplication(platformToken, {
971
+ name: opts.name,
972
+ domain: opts.domain,
973
+ production: opts.production
974
+ });
975
+ if (created.ok) return created;
976
+ notes.push(created.reason ?? "Clerk Platform API call failed.");
977
+ }
978
978
  if (opts.cli && opts.storefront && !opts.noCreate) {
979
- const minted = await mintKeylessClerkApp(opts.storefront, opts.cli);
980
- if (minted.ok) {
981
- return { ...minted, reason: notes.length ? notes.join(" ") : void 0 };
979
+ if (opts.production) {
980
+ notes.push(
981
+ "Keyless Clerk minting is skipped for production deploys: a keyless app is a development instance. Set CLERK_PLATFORM_API_KEY or provide existing keys."
982
+ );
983
+ } else {
984
+ const minted = await mintKeylessClerkApp(opts.storefront, opts.cli);
985
+ if (minted.ok) {
986
+ return { ...minted, reason: notes.length ? notes.join(" ") : void 0 };
987
+ }
988
+ notes.push(minted.reason ?? "Clerk CLI keyless provisioning failed.");
982
989
  }
983
- notes.push(minted.reason ?? "Clerk CLI keyless provisioning failed.");
984
990
  }
985
991
  if (!platformToken) {
986
992
  notes.push(
@@ -1077,17 +1083,22 @@ var PROBES = [
1077
1083
  { path: "/" },
1078
1084
  { path: "/shop", expectBody: /·/ },
1079
1085
  // plan names render as "Visit · Calm"
1080
- { path: "/help" }
1086
+ { path: "/help" },
1087
+ // apps/storefront/src/app/dashboard/AccountSession.tsx renders this when
1088
+ // NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY or CLERK_SECRET_KEY is missing — the
1089
+ // build shipped without Clerk inlined, so sign-in can never reach the user.
1090
+ { path: "/dashboard", rejectBody: /Your install code is on the link from checkout/ }
1081
1091
  ];
1082
- async function probe(base, path, expectBody) {
1092
+ async function probe(base, path, expectBody, rejectBody) {
1083
1093
  const url = `${base.replace(/\/$/, "")}${path}${path.includes("?") ? "&" : "?"}_v=${Date.now()}`;
1084
1094
  try {
1085
1095
  const res = await fetch(url, { redirect: "manual" });
1086
1096
  const status = res.status;
1087
1097
  const ok = status < 400;
1088
- if (!expectBody || !ok) return { path, status, ok };
1098
+ if (!expectBody && !rejectBody || !ok) return { path, status, ok };
1089
1099
  const body = await res.text();
1090
- return { path, status, ok, bodyOk: expectBody.test(body) };
1100
+ if (expectBody) return { path, status, ok, bodyOk: expectBody.test(body) };
1101
+ return { path, status, ok, bodyOk: !rejectBody.test(body) };
1091
1102
  } catch (e) {
1092
1103
  return { path, status: 0, ok: false, error: e instanceof Error ? e.message : String(e) };
1093
1104
  }
@@ -1097,6 +1108,7 @@ function diagnose(probes, secrets) {
1097
1108
  const root = by("/");
1098
1109
  const shop = by("/shop");
1099
1110
  const help = by("/help");
1111
+ const dashboard = by("/dashboard");
1100
1112
  if (probes.every((p) => p.ok && p.bodyOk !== false)) return "healthy";
1101
1113
  if (probes.every((p) => p.status === 0)) return "not-deployed";
1102
1114
  const catalogDown = root?.status === 500 && shop?.status === 500;
@@ -1104,6 +1116,9 @@ function diagnose(probes, secrets) {
1104
1116
  return needsCarrierKey(secrets) ? "carrier-key-missing" : "unclassified";
1105
1117
  }
1106
1118
  if (shop?.ok && shop.bodyOk === false) return "empty-catalog";
1119
+ if (root?.ok && shop?.ok && help?.ok && dashboard?.bodyOk === false) {
1120
+ return "clerk-not-configured";
1121
+ }
1107
1122
  if (root?.ok && shop?.ok && probes.some((p) => p.status >= 500)) return "clerk-keys-missing";
1108
1123
  if (probes.every((p) => p.status === 404)) return "not-deployed";
1109
1124
  return "unclassified";
@@ -1112,13 +1127,15 @@ var SUMMARIES = {
1112
1127
  healthy: "All probes returned a working page.",
1113
1128
  "carrier-key-missing": "Catalog pages return 500 while non-catalog pages work \u2014 CARRIER_API_KEY is missing or invalid on the host.",
1114
1129
  "clerk-keys-missing": "Public pages work but auth routes error \u2014 Clerk keys are missing on the host.",
1130
+ "clerk-not-configured": "/dashboard serves its no-Clerk fallback while public pages work \u2014 Clerk keys are missing on the storefront. Provision Clerk, rebuild so the publishable key is inlined, and redeploy.",
1115
1131
  "empty-catalog": "/shop renders but no plans are in it \u2014 the Carrier catalog returned nothing sellable. Not a deploy problem.",
1116
1132
  "not-deployed": "Nothing served at the deployed URL \u2014 the deploy did not land, or the URL is wrong.",
1117
1133
  unclassified: "The storefront is not serving correctly and the symptom matches no known cause."
1118
1134
  };
1119
1135
  var REPAIRABLE = /* @__PURE__ */ new Set([
1120
1136
  "carrier-key-missing",
1121
- "clerk-keys-missing"
1137
+ "clerk-keys-missing",
1138
+ "clerk-not-configured"
1122
1139
  ]);
1123
1140
  var sleep = (ms) => new Promise((r) => setTimeout(r, ms));
1124
1141
  async function verifyStorefront(url, storefront, env = process.env, opts = {}) {
@@ -1129,8 +1146,8 @@ async function verifyStorefront(url, storefront, env = process.env, opts = {}) {
1129
1146
  let diagnosis = "unclassified";
1130
1147
  for (let attempt = 1; attempt <= attempts; attempt++) {
1131
1148
  probes = [];
1132
- for (const { path, expectBody } of PROBES) {
1133
- probes.push(await probe(url, path, expectBody));
1149
+ for (const { path, expectBody, rejectBody } of PROBES) {
1150
+ probes.push(await probe(url, path, expectBody, rejectBody));
1134
1151
  }
1135
1152
  diagnosis = diagnose(probes, secrets);
1136
1153
  if (diagnosis !== "not-deployed" || attempt === attempts) break;
@@ -1149,7 +1166,7 @@ async function verifyStorefront(url, storefront, env = process.env, opts = {}) {
1149
1166
  function formatProbes(probes) {
1150
1167
  return probes.map((p) => {
1151
1168
  const status = p.status === 0 ? "unreachable" : String(p.status);
1152
- const body = p.bodyOk === false ? " (no plans)" : "";
1169
+ const body = p.bodyOk === false ? ` (${p.path === "/dashboard" ? "clerk fallback" : "no plans"})` : "";
1153
1170
  return `${p.path} ${status}${body}`;
1154
1171
  }).join(" ");
1155
1172
  }
@@ -1173,6 +1190,14 @@ function repairPlanFor(diagnosis) {
1173
1190
  note: "Provision Clerk, rebuild so the publishable key is inlined, and redeploy."
1174
1191
  };
1175
1192
  }
1193
+ if (diagnosis === "clerk-not-configured") {
1194
+ return {
1195
+ diagnosis,
1196
+ runClerk: true,
1197
+ rebuild: true,
1198
+ note: "Clerk keys are missing on the storefront; provision Clerk, rebuild so the publishable key is inlined, and redeploy."
1199
+ };
1200
+ }
1176
1201
  return void 0;
1177
1202
  }
1178
1203
 
@@ -1888,7 +1913,7 @@ function storefrontScreen(input) {
1888
1913
  // package.json
1889
1914
  var package_default = {
1890
1915
  name: "@carrierllc/mcp",
1891
- version: "0.13.47",
1916
+ version: "0.13.51",
1892
1917
  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).",
1893
1918
  license: "MIT",
1894
1919
  author: "Carrier (Lifecycle Innovations Limited)",
@@ -1896,7 +1921,10 @@ var package_default = {
1896
1921
  type: "module",
1897
1922
  carrierCompatibility: {
1898
1923
  claudeOAuthOwnerVersion: "2.1.277",
1899
- claudeOAuthOwnerVersions: ["2.1.277", "2.1.296"]
1924
+ claudeOAuthOwnerVersions: [
1925
+ "2.1.277",
1926
+ "2.1.296"
1927
+ ]
1900
1928
  },
1901
1929
  main: "./dist/index.js",
1902
1930
  files: [
@@ -5575,6 +5603,7 @@ export {
5575
5603
  deriveAccentLight,
5576
5604
  deriveAccentPaletteSubs,
5577
5605
  renderEnv,
5606
+ discoverSecrets,
5578
5607
  mergeEnvLocal,
5579
5608
  slug,
5580
5609
  installDeps,
@@ -5601,4 +5630,4 @@ export {
5601
5630
  package_default,
5602
5631
  CARRIER_VERSION
5603
5632
  };
5604
- //# sourceMappingURL=chunk-4XUAUQ3U.js.map
5633
+ //# sourceMappingURL=chunk-NPAD6AA7.js.map