@carrierllc/mcp 0.13.41 → 0.13.47

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.
Files changed (68) hide show
  1. package/dist/{chunk-6OAZJBLA.js → chunk-4XUAUQ3U.js} +67 -7
  2. package/dist/chunk-4XUAUQ3U.js.map +1 -0
  3. package/dist/cli.js +55 -9
  4. package/dist/cli.js.map +1 -1
  5. package/dist/index.js +66 -15
  6. package/dist/index.js.map +1 -1
  7. package/package.json +1 -1
  8. package/templates/storefront/CLERK.md +23 -0
  9. package/templates/storefront/src/app/activate/[orderId]/ActivateClient.tsx +29 -22
  10. package/templates/storefront/src/app/activate/[orderId]/page.tsx +2 -2
  11. package/templates/storefront/src/app/api/checkout/claim/route.ts +7 -6
  12. package/templates/storefront/src/app/api/checkout/guest/route.ts +72 -17
  13. package/templates/storefront/src/app/api/orders/[orderId]/route.ts +2 -2
  14. package/templates/storefront/src/app/checkout/[templateId]/CheckoutClient.tsx +51 -25
  15. package/templates/storefront/src/app/checkout/success/CheckoutSuccessClient.tsx +165 -131
  16. package/templates/storefront/src/app/checkout/success/FocusHeading.tsx +20 -0
  17. package/templates/storefront/src/app/checkout/success/page.tsx +136 -15
  18. package/templates/storefront/src/app/dashboard/EsimControls.tsx +20 -24
  19. package/templates/storefront/src/app/dashboard/page.tsx +43 -23
  20. package/templates/storefront/src/app/globals.css +44 -5
  21. package/templates/storefront/src/app/help/page.tsx +2 -2
  22. package/templates/storefront/src/app/layout.tsx +5 -3
  23. package/templates/storefront/src/app/page.tsx +27 -7
  24. package/templates/storefront/src/app/shop/ShopClient.tsx +106 -72
  25. package/templates/storefront/src/app/shop/page.tsx +7 -2
  26. package/templates/storefront/src/app/sign-in/[[...sign-in]]/StorefrontSignInClient.tsx +297 -0
  27. package/templates/storefront/src/app/sign-in/[[...sign-in]]/page.tsx +13 -14
  28. package/templates/storefront/src/app/sign-up/[[...sign-up]]/StorefrontSignUpClient.tsx +31 -28
  29. package/templates/storefront/src/app/sign-up/[[...sign-up]]/page.tsx +5 -2
  30. package/templates/storefront/src/brand.config.ts +16 -0
  31. package/templates/storefront/src/components/Providers.tsx +20 -1
  32. package/templates/storefront/src/components/faq/FaqSection.tsx +2 -2
  33. package/templates/storefront/src/components/footer/StorefrontFooter.tsx +7 -7
  34. package/templates/storefront/src/components/landing/FinalCTA.tsx +4 -9
  35. package/templates/storefront/src/components/landing/HeroSection.tsx +4 -7
  36. package/templates/storefront/src/components/landing/HowItWorks.tsx +1 -1
  37. package/templates/storefront/src/components/landing/PlanCard.tsx +23 -13
  38. package/templates/storefront/src/components/landing/TierPlanBoard.tsx +237 -0
  39. package/templates/storefront/src/components/nav/StorefrontNav.tsx +8 -11
  40. package/templates/storefront/src/components/shop/CountrySearch.tsx +94 -0
  41. package/templates/storefront/src/components/theme/BrandStyles.tsx +2 -2
  42. package/templates/storefront/src/components/theme/ThemeToggle.tsx +1 -1
  43. package/templates/storefront/src/components/theme/brand-accent-css.ts +21 -0
  44. package/templates/storefront/src/components/theme/brand-style.ts +88 -0
  45. package/templates/storefront/src/components/theme/clerk-appearance.ts +18 -2
  46. package/templates/storefront/src/lib/buyer-auth-copy.ts +83 -0
  47. package/templates/storefront/src/lib/buyer-error.ts +32 -0
  48. package/templates/storefront/src/lib/buyer-session.ts +41 -0
  49. package/templates/storefront/src/lib/catalog-countries.ts +179 -0
  50. package/templates/storefront/src/lib/checkout-client-error.ts +28 -0
  51. package/templates/storefront/src/lib/checkout-copy.ts +89 -0
  52. package/templates/storefront/src/lib/checkout-order-claim.ts +8 -7
  53. package/templates/storefront/src/lib/checkout-return.ts +18 -0
  54. package/templates/storefront/src/lib/clerk-instance.ts +89 -0
  55. package/templates/storefront/src/lib/order-reference.ts +15 -0
  56. package/templates/storefront/src/lib/request-origin.ts +28 -0
  57. package/templates/storefront/src/lib/sanitize-auth-redirect.ts +20 -4
  58. package/templates/storefront/src/lib/tap-target.ts +17 -0
  59. package/templates/storefront/src/lib/verify-checkout-session.ts +118 -19
  60. package/templates/storefront/src/middleware.ts +11 -0
  61. package/templates/storefront/src/vendor/carrier/catalog-guard.ts +9 -5
  62. package/templates/storefront/src/vendor/carrier/client.ts +22 -4
  63. package/templates/storefront/src/vendor/carrier/country-offers.ts +106 -0
  64. package/templates/storefront/src/vendor/carrier/stripe-price.ts +134 -0
  65. package/templates/storefront/src/vendor/carrier/tiers.ts +161 -0
  66. package/templates/storefront/src/vendor/carrier/types.ts +22 -0
  67. package/templates/storefront/src/vendor/geo/index.ts +15 -4
  68. package/dist/chunk-6OAZJBLA.js.map +0 -1
@@ -536,6 +536,9 @@ function renderEnv(brand) {
536
536
  `NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=`,
537
537
  `# Optional. Scopes the catalog to one hosted shop. Empty keeps the unscoped template list.`,
538
538
  `NEXT_PUBLIC_STOREFRONT_SLUG=`,
539
+ `# Optional. Set to 1 to show the Lightning tier. Empty keeps it hidden.`,
540
+ `# Real Stripe Price ids are still required. Fixture plans are never sold.`,
541
+ `NEXT_PUBLIC_LIGHTNING_TIER=`,
539
542
  `# Optional. Sends the eSIM QR code by email once an order is ready.`,
540
543
  `# \`carrier site email\` authenticates you at Resend in the browser and`,
541
544
  `# fills this in. Without it the storefront still sells and activates; the`,
@@ -543,9 +546,24 @@ function renderEnv(brand) {
543
546
  `# The from-address is composed from brand.config.ts (emailFromMailbox +`,
544
547
  `# domain), so verify that domain at resend.com/domains first.`,
545
548
  `RESEND_API_KEY=`,
546
- `# Clerk \u2014 \`carrier site clerk\` fills these in, or paste them from dashboard.clerk.com`,
549
+ `# Clerk instance switch. dev is the default and the only instance this`,
550
+ `# template configures. production reads the *_PRODUCTION names and does`,
551
+ `# not create an application. Leave those empty until that instance exists.`,
552
+ `NEXT_PUBLIC_CLERK_INSTANCE=dev`,
553
+ `# Clerk \u2014 \`carrier site clerk\` fills the dev pair, or paste them from dashboard.clerk.com`,
547
554
  `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=`,
548
555
  `CLERK_SECRET_KEY=`,
556
+ `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY_PRODUCTION=`,
557
+ `CLERK_SECRET_KEY_PRODUCTION=`,
558
+ `# Buyer password reset. Empty shows Forgot password. false hides it.`,
559
+ `NEXT_PUBLIC_PASSWORD_RESET_ENABLED=`,
560
+ `# Buyers stay on this shop. These stop Clerk from sending them to its hosted pages.`,
561
+ `NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in`,
562
+ `NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up`,
563
+ `# Country list. Empty keeps each plan's own coverage.`,
564
+ `# Example for the eSIMMY shop: NEXT_PUBLIC_COUNTRY_CATALOG=esimmy`,
565
+ `# That value expands Europe, Schengen and Global to the countries that shop sells.`,
566
+ `NEXT_PUBLIC_COUNTRY_CATALOG=`,
549
567
  ``
550
568
  ].join("\n");
551
569
  }
@@ -558,14 +576,29 @@ var TEMPLATE_ENV_KEYS = {
558
576
  NEXT_PUBLIC_CARRIER_API_URL: "public",
559
577
  NEXT_PUBLIC_APP_URL: "public",
560
578
  NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY: "public",
579
+ // `dev` (default) or `production`. Production is a switch only: this
580
+ // template never creates a Clerk application. See templates/storefront/CLERK.md.
581
+ NEXT_PUBLIC_CLERK_INSTANCE: "public",
582
+ NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY_PRODUCTION: "public",
583
+ // Unset shows Forgot password. `false` hides it on this storefront.
584
+ NEXT_PUBLIC_PASSWORD_RESET_ENABLED: "public",
585
+ // Keep buyers on this shop. Clerk's hosted pages are not the buyer path.
586
+ NEXT_PUBLIC_CLERK_SIGN_IN_URL: "public",
587
+ NEXT_PUBLIC_CLERK_SIGN_UP_URL: "public",
588
+ // Empty keeps each plan's own coverage. `esimmy` expands Europe, Schengen and Global.
589
+ NEXT_PUBLIC_COUNTRY_CATALOG: "public",
561
590
  // Optional. Present: checkout is embedded in the storefront's own page.
562
591
  // Absent: checkout redirects to Stripe's hosted page, which still works.
563
592
  NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY: "public",
564
593
  // Optional. Present: the scaffold catalog is scoped to one hosted shop.
565
594
  // Absent: the catalog client calls the unscoped template list.
566
595
  NEXT_PUBLIC_STOREFRONT_SLUG: "public",
596
+ // Optional. Off unless the value is exactly "1". Lightning still stays
597
+ // hidden until that tenant's plans carry real Stripe Price ids.
598
+ NEXT_PUBLIC_LIGHTNING_TIER: "public",
567
599
  CARRIER_API_KEY: "secret",
568
600
  CLERK_SECRET_KEY: "secret",
601
+ CLERK_SECRET_KEY_PRODUCTION: "secret",
569
602
  STRIPE_SECRET_KEY: "secret",
570
603
  // Optional. Present: the storefront emails the QR code to whoever paid.
571
604
  // Absent: the activation page says email delivery is not set up, and every
@@ -1855,7 +1888,7 @@ function storefrontScreen(input) {
1855
1888
  // package.json
1856
1889
  var package_default = {
1857
1890
  name: "@carrierllc/mcp",
1858
- version: "0.13.41",
1891
+ version: "0.13.47",
1859
1892
  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).",
1860
1893
  license: "MIT",
1861
1894
  author: "Carrier (Lifecycle Innovations Limited)",
@@ -1944,7 +1977,7 @@ var package_default = {
1944
1977
  // src/version.ts
1945
1978
  var CARRIER_VERSION = package_default.version;
1946
1979
 
1947
- // ../../packages/ocs-client/dist/chunk-BOZG5AMY.js
1980
+ // ../../packages/ocs-client/dist/chunk-PYQ6XDVV.js
1948
1981
  var OCS_MAX_USAGE_WINDOW_DAYS = 7;
1949
1982
  function clampUsagePeriod(start, end, maxDays = OCS_MAX_USAGE_WINDOW_DAYS) {
1950
1983
  const endMs = Date.parse(`${end}T00:00:00Z`);
@@ -1976,6 +2009,32 @@ function subscriberIdParams(iccid) {
1976
2009
  function modifySubscriberStatusParams(iccid, newStatus) {
1977
2010
  return { subscriber: { iccid }, newStatus };
1978
2011
  }
2012
+ function modifySubscriberContactInfoParams(iccid, fields = {}) {
2013
+ const params = { subscriber: { iccid } };
2014
+ if (fields.name !== void 0) params.name = fields.name;
2015
+ if (fields.company !== void 0) params.company = fields.company;
2016
+ if (fields.phone !== void 0) params.phone = fields.phone;
2017
+ if (fields.mail !== void 0) params.mail = fields.mail;
2018
+ return params;
2019
+ }
2020
+ function modifySubscriberContactInfoFromTool(args) {
2021
+ const nameParts = [args.firstName, args.lastName].filter(
2022
+ (part) => typeof part === "string" && part.length > 0
2023
+ );
2024
+ return modifySubscriberContactInfoParams(args.iccid, {
2025
+ ...nameParts.length > 0 ? { name: nameParts.join(" ") } : {},
2026
+ ...args.company !== void 0 ? { company: args.company } : {},
2027
+ ...args.phoneNumber !== void 0 ? { phone: args.phoneNumber } : {},
2028
+ ...args.email !== void 0 ? { mail: args.email } : {}
2029
+ });
2030
+ }
2031
+ var SUBSCRIBER_ID_OBJECT_METHODS = /* @__PURE__ */ new Set([
2032
+ "modifySubscriberStatus",
2033
+ "modifySubscriberContactInfo"
2034
+ ]);
2035
+ function nestsSubscriberId(method) {
2036
+ return SUBSCRIBER_ID_OBJECT_METHODS.has(method);
2037
+ }
1979
2038
  function nestSubscriberIdParam(params) {
1980
2039
  if (!params || typeof params !== "object" || Array.isArray(params)) return params;
1981
2040
  const record = params;
@@ -2748,7 +2807,7 @@ function packageTemplateModifyFromToolJson(changes, method) {
2748
2807
  return packageTemplateModifyParams(body, method);
2749
2808
  }
2750
2809
 
2751
- // ../../packages/ocs-client/dist/chunk-MNVQV5ST.js
2810
+ // ../../packages/ocs-client/dist/chunk-QGJDLVG3.js
2752
2811
  import { z } from "zod";
2753
2812
  var OCS_V1_METHODS = /* @__PURE__ */ new Set([
2754
2813
  "getResellerInfo",
@@ -3097,7 +3156,7 @@ async function runWithBudget(method, attempt, budget = ocsBudgetFor(method)) {
3097
3156
  throw lastTimeout ?? new OcsTimeoutError(method, budget.attemptMs, budget.totalMs, Math.max(attempts, 1));
3098
3157
  }
3099
3158
 
3100
- // ../../packages/ocs-client/dist/chunk-IU7WF2BY.js
3159
+ // ../../packages/ocs-client/dist/chunk-VDRJZSQW.js
3101
3160
  var RATE_LIMIT = 10;
3102
3161
  var WINDOW_MS = 1e3;
3103
3162
  var windows = /* @__PURE__ */ new Map();
@@ -3523,7 +3582,7 @@ var OcsClient = class {
3523
3582
  const url = `${this.baseUrl}/v1?token=${tok}`;
3524
3583
  assertBareIntParam(method, params);
3525
3584
  const wireParams = applyParamRenames(method, params);
3526
- const shapedParams = method === "modifySubscriberStatus" ? nestSubscriberIdParam(wireParams) : wireParams;
3585
+ const shapedParams = nestsSubscriberId(method) ? nestSubscriberIdParam(wireParams) : wireParams;
3527
3586
  const body = JSON.stringify({ [method]: shapedParams });
3528
3587
  const singleAttempt = SINGLE_ATTEMPT_METHODS.has(method);
3529
3588
  const send = async () => {
@@ -5443,6 +5502,7 @@ export {
5443
5502
  locationParams,
5444
5503
  subscriberIdParams,
5445
5504
  modifySubscriberStatusParams,
5505
+ modifySubscriberContactInfoFromTool,
5446
5506
  recurringPackageParams,
5447
5507
  networkEventsOverPeriodParams,
5448
5508
  usageOverPeriodParams,
@@ -5541,4 +5601,4 @@ export {
5541
5601
  package_default,
5542
5602
  CARRIER_VERSION
5543
5603
  };
5544
- //# sourceMappingURL=chunk-6OAZJBLA.js.map
5604
+ //# sourceMappingURL=chunk-4XUAUQ3U.js.map