@solvapay/react 2.2.0 → 2.2.1-preview-4e9e88853847575b5dbe7c2d36163333a2364b7a

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/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @solvapay/react changelog
2
2
 
3
+ ## 2.2.1-preview-4e9e88853847575b5dbe7c2d36163333a2364b7a
4
+
5
+ ### Patch Changes
6
+
7
+ - d15f9ca: Classify each SDK paywall denial honestly and name the recovery. Credit shortfalls report balance, cost and shortfall instead of "no active plan"; included-usage exhaustion reaches `limit_reached`; failed auto-upgrades keep `upgrade_required` with distinct copy. Gate messages append a named per-plan checkout ladder when the backend sends `plans[].checkoutUrl`.
8
+
9
+ The `account` tool no longer crashes on a successful limits check (the backend never sends `plan`, and an unguarded `ref.length` threw). Tool errors now validate against the registered output schema so hosts report the real message instead of `-32602`. `attach_business_details` accepts every backend tax ID type. `already_purchased` completes activation. Top-up no longer invents a 100-credit peg when `creditsPerMinorUnit` is missing.
10
+
11
+ - Updated dependencies [a67bb7c]
12
+ - Updated dependencies [d15f9ca]
13
+ - @solvapay/mcp-core@0.4.1-preview-4e9e88853847575b5dbe7c2d36163333a2364b7a
14
+ - @solvapay/core@1.7.1-preview-4e9e88853847575b5dbe7c2d36163333a2364b7a
15
+
3
16
  ## 2.2.0
4
17
 
5
18
  ### Minor Changes
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { _ as UsageSnapshot } from './useUsage-CMqxEF9d.js';
2
+ import { _ as UsageSnapshot } from './useUsage-CfM9dQwB.js';
3
3
 
4
4
  /**
5
5
  * `<UsageMeter>` compound primitive — renders the authenticated customer's
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { _ as UsageSnapshot } from './useUsage-CTgRBvFK.cjs';
2
+ import { _ as UsageSnapshot } from './useUsage-x6DQG7xe.cjs';
3
3
 
4
4
  /**
5
5
  * `<UsageMeter>` compound primitive — renders the authenticated customer's
@@ -46,7 +46,7 @@ import {
46
46
  useTopupAmountSelector,
47
47
  validateAutoRechargeForm,
48
48
  withPaymentElementDefaults
49
- } from "./chunk-VTGYZIE2.js";
49
+ } from "./chunk-LCBCOFXZ.js";
50
50
 
51
51
  // src/TopupForm.tsx
52
52
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -2278,6 +2278,7 @@ function useActivation() {
2278
2278
  switch (data.status) {
2279
2279
  case "activated":
2280
2280
  case "already_active":
2281
+ case "already_purchased":
2281
2282
  setState("activated");
2282
2283
  return "activated";
2283
2284
  case "topup_required":
@@ -8,7 +8,7 @@ import {
8
8
  useOpenExternal,
9
9
  useSolvaPay,
10
10
  useTransport
11
- } from "./chunk-VTGYZIE2.js";
11
+ } from "./chunk-LCBCOFXZ.js";
12
12
 
13
13
  // src/hooks/usePaymentMethod.ts
14
14
  import { useCallback, useEffect, useState } from "react";
@@ -1,4 +1,4 @@
1
- import { a4 as components, b as Plan, P as PaymentFormProps, a as PrefillCustomer, A as ActivationResult, s as UseTopupAmountSelectorReturn, a5 as AutoRechargeInput, u as AutoRechargeConfig, a6 as AutoRechargeDisplayBlock, E as CheckoutStep, O as SuccessMeta } from './useUsage-CTgRBvFK.cjs';
1
+ import { a4 as components, b as Plan, P as PaymentFormProps, a as PrefillCustomer, A as ActivationResult, s as UseTopupAmountSelectorReturn, a5 as AutoRechargeInput, u as AutoRechargeConfig, a6 as AutoRechargeDisplayBlock, E as CheckoutStep, O as SuccessMeta } from './useUsage-CfM9dQwB.js';
2
2
  import React from 'react';
3
3
  import { PaymentElement, CardElement } from '@stripe/react-stripe-js';
4
4
  import { TaxBreakdown } from '@solvapay/core';
@@ -14,6 +14,16 @@ import { PaymentIntent } from '@stripe/stripe-js';
14
14
  type LimitPlanSummary = components['schemas']['LimitPlanItemDto'];
15
15
  type LimitActivationBalance = components['schemas']['LimitBalanceDto'];
16
16
  type LimitActivationProduct = components['schemas']['LimitProductBriefDto'];
17
+ type LimitAutoRechargeDto = components['schemas']['LimitAutoRechargeDto'];
18
+ /**
19
+ * All paywall reasons the SDK recognises: every backend `paywallReason`
20
+ * plus the three SDK-only classifier kinds. Derived from a shared tuple
21
+ * so the Zod mirror in `paywall-schema.ts` cannot drift.
22
+ */
23
+ declare const PAYWALL_REASONS: readonly ["activation_required", "topup_required", "payment_required", "upgrade_required", "limit_reached", "reactivation_required"];
24
+ type PaywallReason = (typeof PAYWALL_REASONS)[number];
25
+ declare const PAYWALL_NEXT_ACTIONS: readonly ["topup", "checkout", "activate", "account"];
26
+ type PaywallNextAction = (typeof PAYWALL_NEXT_ACTIONS)[number];
17
27
  /**
18
28
  * Structured content for paywall errors (MCP structuredContent and manual handling).
19
29
  */
@@ -24,8 +34,10 @@ type LimitActivationProduct = components['schemas']['LimitProductBriefDto'];
24
34
  * when the backend did not send it — never defaulted.
25
35
  */
26
36
  type PaywallGateRecoveryFields = {
27
- /** Active plan reference from `limits.plan`. */
37
+ /** Active plan reference from `limits.planRef` (falls back to deprecated `plan`). */
28
38
  planRef?: string;
39
+ /** Display name of the active or default plan. */
40
+ planName?: string;
29
41
  /** Product plans from `checkLimits` (activation already had this). */
30
42
  plans?: LimitPlanSummary[];
31
43
  /** Meter the gated call was charged against. */
@@ -45,6 +57,37 @@ type PaywallGateRecoveryFields = {
45
57
  };
46
58
  /** Prepaid credit balance, coalesced from nested or top-level fields. */
47
59
  creditBalance?: number;
60
+ /**
61
+ * `PaywallState.kind` — same vocabulary as the classifier, not a third enum.
62
+ * `upgrade_required` / `limit_reached` / `reactivation_required` are
63
+ * SDK-only; the backend's `paywallReason` is a smaller set
64
+ * (`activation_required` / `topup_required` / `payment_required`).
65
+ */
66
+ reason?: PaywallReason;
67
+ /** Single primary recovery the agent should take. */
68
+ nextAction?: PaywallNextAction;
69
+ /**
70
+ * Credits deducted per call. Named `creditsPerCall` on purpose:
71
+ * `balance.creditsPerUnit` is credits, but `plans[].creditsPerUnit`
72
+ * is a deprecated alias for `perUnitChargeMinor` (minor currency units).
73
+ */
74
+ creditsPerCall?: number;
75
+ /** `max(0, creditsPerCall - creditBalance)` when both are known. */
76
+ shortfallCredits?: number;
77
+ /** How many calls the current allowance or wallet still covers. */
78
+ remainingCalls?: number;
79
+ /** Active purchase reference when the customer already holds a purchase. */
80
+ purchaseRef?: string;
81
+ /** Purchase/plan status when the backend sent one. */
82
+ planStatus?: string;
83
+ /** Per-provider auto-recharge snapshot. Omitted when unknown. */
84
+ autoRecharge?: LimitAutoRechargeDto;
85
+ /** Global destinations. Per-plan URLs stay on `plans[].checkoutUrl`. */
86
+ links?: {
87
+ topup?: string;
88
+ checkout?: string;
89
+ manage?: string;
90
+ };
48
91
  };
49
92
  type PaywallStructuredContent = ({
50
93
  kind: 'payment_required';
@@ -1,4 +1,4 @@
1
- import { a4 as components, b as Plan, P as PaymentFormProps, a as PrefillCustomer, A as ActivationResult, s as UseTopupAmountSelectorReturn, a5 as AutoRechargeInput, u as AutoRechargeConfig, a6 as AutoRechargeDisplayBlock, E as CheckoutStep, O as SuccessMeta } from './useUsage-CMqxEF9d.js';
1
+ import { a4 as components, b as Plan, P as PaymentFormProps, a as PrefillCustomer, A as ActivationResult, s as UseTopupAmountSelectorReturn, a5 as AutoRechargeInput, u as AutoRechargeConfig, a6 as AutoRechargeDisplayBlock, E as CheckoutStep, O as SuccessMeta } from './useUsage-x6DQG7xe.cjs';
2
2
  import React from 'react';
3
3
  import { PaymentElement, CardElement } from '@stripe/react-stripe-js';
4
4
  import { TaxBreakdown } from '@solvapay/core';
@@ -14,6 +14,16 @@ import { PaymentIntent } from '@stripe/stripe-js';
14
14
  type LimitPlanSummary = components['schemas']['LimitPlanItemDto'];
15
15
  type LimitActivationBalance = components['schemas']['LimitBalanceDto'];
16
16
  type LimitActivationProduct = components['schemas']['LimitProductBriefDto'];
17
+ type LimitAutoRechargeDto = components['schemas']['LimitAutoRechargeDto'];
18
+ /**
19
+ * All paywall reasons the SDK recognises: every backend `paywallReason`
20
+ * plus the three SDK-only classifier kinds. Derived from a shared tuple
21
+ * so the Zod mirror in `paywall-schema.ts` cannot drift.
22
+ */
23
+ declare const PAYWALL_REASONS: readonly ["activation_required", "topup_required", "payment_required", "upgrade_required", "limit_reached", "reactivation_required"];
24
+ type PaywallReason = (typeof PAYWALL_REASONS)[number];
25
+ declare const PAYWALL_NEXT_ACTIONS: readonly ["topup", "checkout", "activate", "account"];
26
+ type PaywallNextAction = (typeof PAYWALL_NEXT_ACTIONS)[number];
17
27
  /**
18
28
  * Structured content for paywall errors (MCP structuredContent and manual handling).
19
29
  */
@@ -24,8 +34,10 @@ type LimitActivationProduct = components['schemas']['LimitProductBriefDto'];
24
34
  * when the backend did not send it — never defaulted.
25
35
  */
26
36
  type PaywallGateRecoveryFields = {
27
- /** Active plan reference from `limits.plan`. */
37
+ /** Active plan reference from `limits.planRef` (falls back to deprecated `plan`). */
28
38
  planRef?: string;
39
+ /** Display name of the active or default plan. */
40
+ planName?: string;
29
41
  /** Product plans from `checkLimits` (activation already had this). */
30
42
  plans?: LimitPlanSummary[];
31
43
  /** Meter the gated call was charged against. */
@@ -45,6 +57,37 @@ type PaywallGateRecoveryFields = {
45
57
  };
46
58
  /** Prepaid credit balance, coalesced from nested or top-level fields. */
47
59
  creditBalance?: number;
60
+ /**
61
+ * `PaywallState.kind` — same vocabulary as the classifier, not a third enum.
62
+ * `upgrade_required` / `limit_reached` / `reactivation_required` are
63
+ * SDK-only; the backend's `paywallReason` is a smaller set
64
+ * (`activation_required` / `topup_required` / `payment_required`).
65
+ */
66
+ reason?: PaywallReason;
67
+ /** Single primary recovery the agent should take. */
68
+ nextAction?: PaywallNextAction;
69
+ /**
70
+ * Credits deducted per call. Named `creditsPerCall` on purpose:
71
+ * `balance.creditsPerUnit` is credits, but `plans[].creditsPerUnit`
72
+ * is a deprecated alias for `perUnitChargeMinor` (minor currency units).
73
+ */
74
+ creditsPerCall?: number;
75
+ /** `max(0, creditsPerCall - creditBalance)` when both are known. */
76
+ shortfallCredits?: number;
77
+ /** How many calls the current allowance or wallet still covers. */
78
+ remainingCalls?: number;
79
+ /** Active purchase reference when the customer already holds a purchase. */
80
+ purchaseRef?: string;
81
+ /** Purchase/plan status when the backend sent one. */
82
+ planStatus?: string;
83
+ /** Per-provider auto-recharge snapshot. Omitted when unknown. */
84
+ autoRecharge?: LimitAutoRechargeDto;
85
+ /** Global destinations. Per-plan URLs stay on `plans[].checkoutUrl`. */
86
+ links?: {
87
+ topup?: string;
88
+ checkout?: string;
89
+ manage?: string;
90
+ };
48
91
  };
49
92
  type PaywallStructuredContent = ({
50
93
  kind: 'payment_required';
package/dist/index.cjs CHANGED
@@ -2748,6 +2748,7 @@ function useActivation() {
2748
2748
  switch (data.status) {
2749
2749
  case "activated":
2750
2750
  case "already_active":
2751
+ case "already_purchased":
2751
2752
  setState("activated");
2752
2753
  return "activated";
2753
2754
  case "topup_required":
package/dist/index.d.cts CHANGED
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
- import { S as SolvaPayProviderProps, P as PaymentFormProps, a as PrefillCustomer, T as TopupFormProps, C as CheckoutResult, b as Plan, A as ActivationResult, B as BootstrapPlanLike, c as SaveAutoRechargeResponse, d as PurchaseStatus, e as SolvaPayContextValue, U as UsePlansOptions, f as UsePlansReturn, g as UsePlanOptions, h as UsePlanReturn, i as UseProductReturn, j as UseMerchantReturn, k as SolvaPayCopy, l as PurchaseStatusReturn, m as CancelResult, R as ReactivateResult, n as ActivatePlanResult, o as UseTopupOptions, p as UseTopupReturn, q as BalanceStatus, r as UseTopupAmountSelectorOptions, s as UseTopupAmountSelectorReturn, t as UsePaymentMethodReturn, u as AutoRechargeConfig, v as SaveAutoRechargeInput, w as SolvaPayTransport, x as PartialSolvaPayCopy, y as PurchaseInfo, z as Product, D as SolvaPayConfig } from './useUsage-CTgRBvFK.cjs';
3
- export { E as CheckoutStep, F as CustomerPurchaseData, M as MandateContext, G as MandateTemplate, H as Merchant, I as PaymentError, J as PaymentIntentResult, K as PaymentMethodInfo, L as PaymentResult, N as PurchaseStatusValue, O as SuccessMeta, Q as TopupPaymentResult, V as TransportBalanceResult, W as TransportCheckoutSessionResult, X as TransportCustomerSessionResult, Y as TransportLimitsResult, Z as UnsupportedTransportMethodError, _ as UsageSnapshot, $ as UseUsageReturn, a0 as useUsage } from './useUsage-CTgRBvFK.cjs';
4
- import { P as PaymentFormSummary, a as PaymentFormCustomerFields, b as PaymentFormPaymentElement, c as PaymentFormCardElement, d as PaymentFormMandateText, e as PaymentFormTermsCheckbox, f as PaymentFormSubmitButton, g as PaymentFormLoading, h as PaymentFormError, i as PaymentFormLegalFooter, j as PaymentFormBusinessDetails, k as PaymentFormTaxSummary, A as AutoRechargeInputPayload, l as PaywallStructuredContent, C as CheckoutVariant } from './index-BJGjKUtC.cjs';
5
- export { m as ActivationFlowStep, B as BalanceBadge, n as CancelPlanButton, o as CheckoutErrorPhase, p as CheckoutStatus, q as CheckoutSteps, r as CheckoutSummary, s as CheckoutSummaryProps, M as MandateText, t as MandateTextProps, u as PlanBadge, v as ProductBadge, w as PurchaseGate, U as UseCheckoutFlowOptions, x as UseCheckoutFlowReturn, y as configToAutoRechargeInput, z as deriveVariant, D as useCheckoutFlow, E as useCheckoutStepsContext } from './index-BJGjKUtC.cjs';
2
+ import { S as SolvaPayProviderProps, P as PaymentFormProps, a as PrefillCustomer, T as TopupFormProps, C as CheckoutResult, b as Plan, A as ActivationResult, B as BootstrapPlanLike, c as SaveAutoRechargeResponse, d as PurchaseStatus, e as SolvaPayContextValue, U as UsePlansOptions, f as UsePlansReturn, g as UsePlanOptions, h as UsePlanReturn, i as UseProductReturn, j as UseMerchantReturn, k as SolvaPayCopy, l as PurchaseStatusReturn, m as CancelResult, R as ReactivateResult, n as ActivatePlanResult, o as UseTopupOptions, p as UseTopupReturn, q as BalanceStatus, r as UseTopupAmountSelectorOptions, s as UseTopupAmountSelectorReturn, t as UsePaymentMethodReturn, u as AutoRechargeConfig, v as SaveAutoRechargeInput, w as SolvaPayTransport, x as PartialSolvaPayCopy, y as PurchaseInfo, z as Product, D as SolvaPayConfig } from './useUsage-x6DQG7xe.cjs';
3
+ export { E as CheckoutStep, F as CustomerPurchaseData, M as MandateContext, G as MandateTemplate, H as Merchant, I as PaymentError, J as PaymentIntentResult, K as PaymentMethodInfo, L as PaymentResult, N as PurchaseStatusValue, O as SuccessMeta, Q as TopupPaymentResult, V as TransportBalanceResult, W as TransportCheckoutSessionResult, X as TransportCustomerSessionResult, Y as TransportLimitsResult, Z as UnsupportedTransportMethodError, _ as UsageSnapshot, $ as UseUsageReturn, a0 as useUsage } from './useUsage-x6DQG7xe.cjs';
4
+ import { P as PaymentFormSummary, a as PaymentFormCustomerFields, b as PaymentFormPaymentElement, c as PaymentFormCardElement, d as PaymentFormMandateText, e as PaymentFormTermsCheckbox, f as PaymentFormSubmitButton, g as PaymentFormLoading, h as PaymentFormError, i as PaymentFormLegalFooter, j as PaymentFormBusinessDetails, k as PaymentFormTaxSummary, A as AutoRechargeInputPayload, l as PaywallStructuredContent, C as CheckoutVariant } from './index-DFtP872_.cjs';
5
+ export { m as ActivationFlowStep, B as BalanceBadge, n as CancelPlanButton, o as CheckoutErrorPhase, p as CheckoutStatus, q as CheckoutSteps, r as CheckoutSummary, s as CheckoutSummaryProps, M as MandateText, t as MandateTextProps, u as PlanBadge, v as ProductBadge, w as PurchaseGate, U as UseCheckoutFlowOptions, x as UseCheckoutFlowReturn, y as configToAutoRechargeInput, z as deriveVariant, D as useCheckoutFlow, E as useCheckoutStepsContext } from './index-DFtP872_.cjs';
6
6
  import { PaymentIntent, Stripe, StripeElements } from '@stripe/stripe-js';
7
7
  import { BusinessDetailsInput, TaxBreakdown } from '@solvapay/core';
8
8
  import * as react_jsx_runtime from 'react/jsx-runtime';
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
- import { S as SolvaPayProviderProps, P as PaymentFormProps, a as PrefillCustomer, T as TopupFormProps, C as CheckoutResult, b as Plan, A as ActivationResult, B as BootstrapPlanLike, c as SaveAutoRechargeResponse, d as PurchaseStatus, e as SolvaPayContextValue, U as UsePlansOptions, f as UsePlansReturn, g as UsePlanOptions, h as UsePlanReturn, i as UseProductReturn, j as UseMerchantReturn, k as SolvaPayCopy, l as PurchaseStatusReturn, m as CancelResult, R as ReactivateResult, n as ActivatePlanResult, o as UseTopupOptions, p as UseTopupReturn, q as BalanceStatus, r as UseTopupAmountSelectorOptions, s as UseTopupAmountSelectorReturn, t as UsePaymentMethodReturn, u as AutoRechargeConfig, v as SaveAutoRechargeInput, w as SolvaPayTransport, x as PartialSolvaPayCopy, y as PurchaseInfo, z as Product, D as SolvaPayConfig } from './useUsage-CMqxEF9d.js';
3
- export { E as CheckoutStep, F as CustomerPurchaseData, M as MandateContext, G as MandateTemplate, H as Merchant, I as PaymentError, J as PaymentIntentResult, K as PaymentMethodInfo, L as PaymentResult, N as PurchaseStatusValue, O as SuccessMeta, Q as TopupPaymentResult, V as TransportBalanceResult, W as TransportCheckoutSessionResult, X as TransportCustomerSessionResult, Y as TransportLimitsResult, Z as UnsupportedTransportMethodError, _ as UsageSnapshot, $ as UseUsageReturn, a0 as useUsage } from './useUsage-CMqxEF9d.js';
4
- import { P as PaymentFormSummary, a as PaymentFormCustomerFields, b as PaymentFormPaymentElement, c as PaymentFormCardElement, d as PaymentFormMandateText, e as PaymentFormTermsCheckbox, f as PaymentFormSubmitButton, g as PaymentFormLoading, h as PaymentFormError, i as PaymentFormLegalFooter, j as PaymentFormBusinessDetails, k as PaymentFormTaxSummary, A as AutoRechargeInputPayload, l as PaywallStructuredContent, C as CheckoutVariant } from './index-PsjS_d7V.js';
5
- export { m as ActivationFlowStep, B as BalanceBadge, n as CancelPlanButton, o as CheckoutErrorPhase, p as CheckoutStatus, q as CheckoutSteps, r as CheckoutSummary, s as CheckoutSummaryProps, M as MandateText, t as MandateTextProps, u as PlanBadge, v as ProductBadge, w as PurchaseGate, U as UseCheckoutFlowOptions, x as UseCheckoutFlowReturn, y as configToAutoRechargeInput, z as deriveVariant, D as useCheckoutFlow, E as useCheckoutStepsContext } from './index-PsjS_d7V.js';
2
+ import { S as SolvaPayProviderProps, P as PaymentFormProps, a as PrefillCustomer, T as TopupFormProps, C as CheckoutResult, b as Plan, A as ActivationResult, B as BootstrapPlanLike, c as SaveAutoRechargeResponse, d as PurchaseStatus, e as SolvaPayContextValue, U as UsePlansOptions, f as UsePlansReturn, g as UsePlanOptions, h as UsePlanReturn, i as UseProductReturn, j as UseMerchantReturn, k as SolvaPayCopy, l as PurchaseStatusReturn, m as CancelResult, R as ReactivateResult, n as ActivatePlanResult, o as UseTopupOptions, p as UseTopupReturn, q as BalanceStatus, r as UseTopupAmountSelectorOptions, s as UseTopupAmountSelectorReturn, t as UsePaymentMethodReturn, u as AutoRechargeConfig, v as SaveAutoRechargeInput, w as SolvaPayTransport, x as PartialSolvaPayCopy, y as PurchaseInfo, z as Product, D as SolvaPayConfig } from './useUsage-CfM9dQwB.js';
3
+ export { E as CheckoutStep, F as CustomerPurchaseData, M as MandateContext, G as MandateTemplate, H as Merchant, I as PaymentError, J as PaymentIntentResult, K as PaymentMethodInfo, L as PaymentResult, N as PurchaseStatusValue, O as SuccessMeta, Q as TopupPaymentResult, V as TransportBalanceResult, W as TransportCheckoutSessionResult, X as TransportCustomerSessionResult, Y as TransportLimitsResult, Z as UnsupportedTransportMethodError, _ as UsageSnapshot, $ as UseUsageReturn, a0 as useUsage } from './useUsage-CfM9dQwB.js';
4
+ import { P as PaymentFormSummary, a as PaymentFormCustomerFields, b as PaymentFormPaymentElement, c as PaymentFormCardElement, d as PaymentFormMandateText, e as PaymentFormTermsCheckbox, f as PaymentFormSubmitButton, g as PaymentFormLoading, h as PaymentFormError, i as PaymentFormLegalFooter, j as PaymentFormBusinessDetails, k as PaymentFormTaxSummary, A as AutoRechargeInputPayload, l as PaywallStructuredContent, C as CheckoutVariant } from './index-D4EhOmYp.js';
5
+ export { m as ActivationFlowStep, B as BalanceBadge, n as CancelPlanButton, o as CheckoutErrorPhase, p as CheckoutStatus, q as CheckoutSteps, r as CheckoutSummary, s as CheckoutSummaryProps, M as MandateText, t as MandateTextProps, u as PlanBadge, v as ProductBadge, w as PurchaseGate, U as UseCheckoutFlowOptions, x as UseCheckoutFlowReturn, y as configToAutoRechargeInput, z as deriveVariant, D as useCheckoutFlow, E as useCheckoutStepsContext } from './index-D4EhOmYp.js';
6
6
  import { PaymentIntent, Stripe, StripeElements } from '@stripe/stripe-js';
7
7
  import { BusinessDetailsInput, TaxBreakdown } from '@solvapay/core';
8
8
  import * as react_jsx_runtime from 'react/jsx-runtime';
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  LaunchCustomerPortalButton,
6
6
  usePaymentMethod
7
- } from "./chunk-FWT62B56.js";
7
+ } from "./chunk-QZLY6SIU.js";
8
8
  import {
9
9
  ActivationFlow,
10
10
  AutoRecharge,
@@ -19,7 +19,7 @@ import {
19
19
  useCheckoutSteps,
20
20
  useCreditGate,
21
21
  usePaywallResolver
22
- } from "./chunk-X65JBC2A.js";
22
+ } from "./chunk-AW5PCAYK.js";
23
23
  import {
24
24
  AmountPicker,
25
25
  BalanceBadge,
@@ -100,7 +100,7 @@ import {
100
100
  useTopupAmountSelector,
101
101
  useTransport,
102
102
  useUsage
103
- } from "./chunk-VTGYZIE2.js";
103
+ } from "./chunk-LCBCOFXZ.js";
104
104
  import {
105
105
  createAnonymousAuthAdapter,
106
106
  defaultAuthAdapter,
@@ -5343,6 +5343,7 @@ function useActivation() {
5343
5343
  switch (data.status) {
5344
5344
  case "activated":
5345
5345
  case "already_active":
5346
+ case "already_purchased":
5346
5347
  setState("activated");
5347
5348
  return "activated";
5348
5349
  case "topup_required":
@@ -12334,7 +12335,9 @@ function EmbeddedTopup({
12334
12335
  autoRecharge: screen.autoRecharge,
12335
12336
  returnUrl,
12336
12337
  onSuccess: () => {
12337
- adjustBalance(committedAmountMinor * (creditsPerMinorUnit ?? 100));
12338
+ if (creditsPerMinorUnit != null && creditsPerMinorUnit > 0) {
12339
+ adjustBalance(committedAmountMinor * creditsPerMinorUnit);
12340
+ }
12338
12341
  setScreen({ step: "success", amountMinor: committedAmountMinor });
12339
12342
  void notifyModelContext({
12340
12343
  text: `Topup of ${formatPrice(committedAmountMinor, currency, {
@@ -1,10 +1,10 @@
1
- import { w as SolvaPayTransport, a1 as SolvaPayProviderInitial, D as SolvaPayConfig, B as BootstrapPlanLike, y as PurchaseInfo, a2 as CreditActivityType, a3 as CreditActivityEntry, H as Merchant } from '../useUsage-CTgRBvFK.cjs';
1
+ import { w as SolvaPayTransport, a1 as SolvaPayProviderInitial, D as SolvaPayConfig, B as BootstrapPlanLike, y as PurchaseInfo, a2 as CreditActivityType, a3 as CreditActivityEntry, H as Merchant } from '../useUsage-x6DQG7xe.cjs';
2
2
  import { TOOL_FOR_VIEW, SolvaPayMcpViewKind, BootstrapMerchant, BootstrapProduct, BootstrapPlan, BootstrapCustomer } from '@solvapay/mcp-core';
3
3
  export { MCP_TOOL_NAMES, McpToolName } from '@solvapay/mcp-core';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
  import React from 'react';
6
6
  import { PricingOptionLike, PricedLike, BalancePegLike } from '@solvapay/core';
7
- import { U as UsageMeterRootProps } from '../UsageMeter-rga6cyfB.cjs';
7
+ import { U as UsageMeterRootProps } from '../UsageMeter-ClENA677.cjs';
8
8
  import '@stripe/stripe-js';
9
9
  import '../adapters/auth.cjs';
10
10
 
@@ -1,10 +1,10 @@
1
- import { w as SolvaPayTransport, a1 as SolvaPayProviderInitial, D as SolvaPayConfig, B as BootstrapPlanLike, y as PurchaseInfo, a2 as CreditActivityType, a3 as CreditActivityEntry, H as Merchant } from '../useUsage-CMqxEF9d.js';
1
+ import { w as SolvaPayTransport, a1 as SolvaPayProviderInitial, D as SolvaPayConfig, B as BootstrapPlanLike, y as PurchaseInfo, a2 as CreditActivityType, a3 as CreditActivityEntry, H as Merchant } from '../useUsage-CfM9dQwB.js';
2
2
  import { TOOL_FOR_VIEW, SolvaPayMcpViewKind, BootstrapMerchant, BootstrapProduct, BootstrapPlan, BootstrapCustomer } from '@solvapay/mcp-core';
3
3
  export { MCP_TOOL_NAMES, McpToolName } from '@solvapay/mcp-core';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
  import React from 'react';
6
6
  import { PricingOptionLike, PricedLike, BalancePegLike } from '@solvapay/core';
7
- import { U as UsageMeterRootProps } from '../UsageMeter-BhxNHeRM.js';
7
+ import { U as UsageMeterRootProps } from '../UsageMeter-CkJ_nowq.js';
8
8
  import '@stripe/stripe-js';
9
9
  import '../adapters/auth.js';
10
10
 
package/dist/mcp/index.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  LaunchCustomerPortalButton,
4
4
  paymentMethodCache,
5
5
  usePaymentMethod
6
- } from "../chunk-FWT62B56.js";
6
+ } from "../chunk-QZLY6SIU.js";
7
7
  import {
8
8
  AmountPicker,
9
9
  BalanceBadge,
@@ -63,7 +63,7 @@ import {
63
63
  useTransport,
64
64
  useUsage,
65
65
  validateAutoRechargeForm
66
- } from "../chunk-VTGYZIE2.js";
66
+ } from "../chunk-LCBCOFXZ.js";
67
67
  import "../chunk-UMXOAUW7.js";
68
68
  import "../chunk-MLKGABMK.js";
69
69
 
@@ -4221,7 +4221,9 @@ function EmbeddedTopup({
4221
4221
  autoRecharge: screen.autoRecharge,
4222
4222
  returnUrl,
4223
4223
  onSuccess: () => {
4224
- adjustBalance(committedAmountMinor * (creditsPerMinorUnit ?? 100));
4224
+ if (creditsPerMinorUnit != null && creditsPerMinorUnit > 0) {
4225
+ adjustBalance(committedAmountMinor * creditsPerMinorUnit);
4226
+ }
4225
4227
  setScreen({ step: "success", amountMinor: committedAmountMinor });
4226
4228
  void notifyModelContext({
4227
4229
  text: `Topup of ${formatPrice(committedAmountMinor, currency, {
@@ -3180,6 +3180,7 @@ function useActivation() {
3180
3180
  switch (data.status) {
3181
3181
  case "activated":
3182
3182
  case "already_active":
3183
+ case "already_purchased":
3183
3184
  setState("activated");
3184
3185
  return "activated";
3185
3186
  case "topup_required":
@@ -1,13 +1,13 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React, { Ref } from 'react';
3
- import { b as Plan, z as Product, s as UseTopupAmountSelectorReturn, y as PurchaseInfo, T as TopupFormProps, c as SaveAutoRechargeResponse, u as AutoRechargeConfig } from '../useUsage-CTgRBvFK.cjs';
4
- export { B as BootstrapPlanLike, E as CheckoutStep, O as SuccessMeta } from '../useUsage-CTgRBvFK.cjs';
3
+ import { b as Plan, z as Product, s as UseTopupAmountSelectorReturn, y as PurchaseInfo, T as TopupFormProps, c as SaveAutoRechargeResponse, u as AutoRechargeConfig } from '../useUsage-x6DQG7xe.cjs';
4
+ export { B as BootstrapPlanLike, E as CheckoutStep, O as SuccessMeta } from '../useUsage-x6DQG7xe.cjs';
5
5
  import { TaxBreakdown, BusinessDetailsInput } from '@solvapay/core';
6
- import { A as AutoRechargeInputPayload, F as AmountInputUnit, G as AutoRechargeFormState, l as PaywallStructuredContent } from '../index-BJGjKUtC.cjs';
7
- export { H as ActivationFlow, I as ActivationFlowActivateButton, J as ActivationFlowActivated, K as ActivationFlowAmountPicker, L as ActivationFlowContinueButton, N as ActivationFlowError, O as ActivationFlowLoading, Q as ActivationFlowRetrying, R as ActivationFlowRoot, m as ActivationFlowStep, S as ActivationFlowSummary, B as BalanceBadge, n as CancelPlanButton, p as CheckoutStatus, q as CheckoutSteps, T as CheckoutStepsAmountContinueButton, V as CheckoutStepsAmountPicker, W as CheckoutStepsBackLink, X as CheckoutStepsIfStep, Y as CheckoutStepsPayment, Z as CheckoutStepsPlanContinueButton, _ as CheckoutStepsPlanGrid, $ as CheckoutStepsRoot, a0 as CheckoutStepsStepHeading, a1 as CheckoutStepsStepMessage, a2 as CheckoutStepsSuccess, M as MandateText, t as MandateTextProps, a3 as PaymentForm, j as PaymentFormBusinessDetails, c as PaymentFormCardElement, a as PaymentFormCustomerFields, h as PaymentFormError, i as PaymentFormLegalFooter, g as PaymentFormLoading, d as PaymentFormMandateText, b as PaymentFormPaymentElement, a4 as PaymentFormRoot, f as PaymentFormSubmitButton, P as PaymentFormSummary, k as PaymentFormTaxSummary, e as PaymentFormTermsCheckbox, u as PlanBadge, v as ProductBadge, w as PurchaseGate, a5 as PurchaseGateAllowed, a6 as PurchaseGateBlocked, a7 as PurchaseGateError, a8 as PurchaseGateLoading, a9 as PurchaseGateRoot, aa as useActivationFlow, E as useCheckoutStepsContext, ab as usePurchaseGate } from '../index-BJGjKUtC.cjs';
6
+ import { A as AutoRechargeInputPayload, F as AmountInputUnit, G as AutoRechargeFormState, l as PaywallStructuredContent } from '../index-DFtP872_.cjs';
7
+ export { H as ActivationFlow, I as ActivationFlowActivateButton, J as ActivationFlowActivated, K as ActivationFlowAmountPicker, L as ActivationFlowContinueButton, N as ActivationFlowError, O as ActivationFlowLoading, Q as ActivationFlowRetrying, R as ActivationFlowRoot, m as ActivationFlowStep, S as ActivationFlowSummary, B as BalanceBadge, n as CancelPlanButton, p as CheckoutStatus, q as CheckoutSteps, T as CheckoutStepsAmountContinueButton, V as CheckoutStepsAmountPicker, W as CheckoutStepsBackLink, X as CheckoutStepsIfStep, Y as CheckoutStepsPayment, Z as CheckoutStepsPlanContinueButton, _ as CheckoutStepsPlanGrid, $ as CheckoutStepsRoot, a0 as CheckoutStepsStepHeading, a1 as CheckoutStepsStepMessage, a2 as CheckoutStepsSuccess, M as MandateText, t as MandateTextProps, a3 as PaymentForm, j as PaymentFormBusinessDetails, c as PaymentFormCardElement, a as PaymentFormCustomerFields, h as PaymentFormError, i as PaymentFormLegalFooter, g as PaymentFormLoading, d as PaymentFormMandateText, b as PaymentFormPaymentElement, a4 as PaymentFormRoot, f as PaymentFormSubmitButton, P as PaymentFormSummary, k as PaymentFormTaxSummary, e as PaymentFormTermsCheckbox, u as PlanBadge, v as ProductBadge, w as PurchaseGate, a5 as PurchaseGateAllowed, a6 as PurchaseGateBlocked, a7 as PurchaseGateError, a8 as PurchaseGateLoading, a9 as PurchaseGateRoot, aa as useActivationFlow, E as useCheckoutStepsContext, ab as usePurchaseGate } from '../index-DFtP872_.cjs';
8
8
  import { PaymentElement } from '@stripe/react-stripe-js';
9
9
  import { Stripe, StripeElements } from '@stripe/stripe-js';
10
- export { a as UsageMeter, B as UsageMeterBar, b as UsageMeterClassNames, E as UsageMeterEmpty, L as UsageMeterLabel, c as UsageMeterLoading, P as UsageMeterPercentage, R as UsageMeterResetsIn, d as UsageMeterRoot, U as UsageMeterRootProps, u as useUsageMeter } from '../UsageMeter-rga6cyfB.cjs';
10
+ export { a as UsageMeter, B as UsageMeterBar, b as UsageMeterClassNames, E as UsageMeterEmpty, L as UsageMeterLabel, c as UsageMeterLoading, P as UsageMeterPercentage, R as UsageMeterResetsIn, d as UsageMeterRoot, U as UsageMeterRootProps, u as useUsageMeter } from '../UsageMeter-ClENA677.cjs';
11
11
  import '../adapters/auth.cjs';
12
12
 
13
13
  type PlanPricingOption = {
@@ -1,13 +1,13 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React, { Ref } from 'react';
3
- import { b as Plan, z as Product, s as UseTopupAmountSelectorReturn, y as PurchaseInfo, T as TopupFormProps, c as SaveAutoRechargeResponse, u as AutoRechargeConfig } from '../useUsage-CMqxEF9d.js';
4
- export { B as BootstrapPlanLike, E as CheckoutStep, O as SuccessMeta } from '../useUsage-CMqxEF9d.js';
3
+ import { b as Plan, z as Product, s as UseTopupAmountSelectorReturn, y as PurchaseInfo, T as TopupFormProps, c as SaveAutoRechargeResponse, u as AutoRechargeConfig } from '../useUsage-CfM9dQwB.js';
4
+ export { B as BootstrapPlanLike, E as CheckoutStep, O as SuccessMeta } from '../useUsage-CfM9dQwB.js';
5
5
  import { TaxBreakdown, BusinessDetailsInput } from '@solvapay/core';
6
- import { A as AutoRechargeInputPayload, F as AmountInputUnit, G as AutoRechargeFormState, l as PaywallStructuredContent } from '../index-PsjS_d7V.js';
7
- export { H as ActivationFlow, I as ActivationFlowActivateButton, J as ActivationFlowActivated, K as ActivationFlowAmountPicker, L as ActivationFlowContinueButton, N as ActivationFlowError, O as ActivationFlowLoading, Q as ActivationFlowRetrying, R as ActivationFlowRoot, m as ActivationFlowStep, S as ActivationFlowSummary, B as BalanceBadge, n as CancelPlanButton, p as CheckoutStatus, q as CheckoutSteps, T as CheckoutStepsAmountContinueButton, V as CheckoutStepsAmountPicker, W as CheckoutStepsBackLink, X as CheckoutStepsIfStep, Y as CheckoutStepsPayment, Z as CheckoutStepsPlanContinueButton, _ as CheckoutStepsPlanGrid, $ as CheckoutStepsRoot, a0 as CheckoutStepsStepHeading, a1 as CheckoutStepsStepMessage, a2 as CheckoutStepsSuccess, M as MandateText, t as MandateTextProps, a3 as PaymentForm, j as PaymentFormBusinessDetails, c as PaymentFormCardElement, a as PaymentFormCustomerFields, h as PaymentFormError, i as PaymentFormLegalFooter, g as PaymentFormLoading, d as PaymentFormMandateText, b as PaymentFormPaymentElement, a4 as PaymentFormRoot, f as PaymentFormSubmitButton, P as PaymentFormSummary, k as PaymentFormTaxSummary, e as PaymentFormTermsCheckbox, u as PlanBadge, v as ProductBadge, w as PurchaseGate, a5 as PurchaseGateAllowed, a6 as PurchaseGateBlocked, a7 as PurchaseGateError, a8 as PurchaseGateLoading, a9 as PurchaseGateRoot, aa as useActivationFlow, E as useCheckoutStepsContext, ab as usePurchaseGate } from '../index-PsjS_d7V.js';
6
+ import { A as AutoRechargeInputPayload, F as AmountInputUnit, G as AutoRechargeFormState, l as PaywallStructuredContent } from '../index-D4EhOmYp.js';
7
+ export { H as ActivationFlow, I as ActivationFlowActivateButton, J as ActivationFlowActivated, K as ActivationFlowAmountPicker, L as ActivationFlowContinueButton, N as ActivationFlowError, O as ActivationFlowLoading, Q as ActivationFlowRetrying, R as ActivationFlowRoot, m as ActivationFlowStep, S as ActivationFlowSummary, B as BalanceBadge, n as CancelPlanButton, p as CheckoutStatus, q as CheckoutSteps, T as CheckoutStepsAmountContinueButton, V as CheckoutStepsAmountPicker, W as CheckoutStepsBackLink, X as CheckoutStepsIfStep, Y as CheckoutStepsPayment, Z as CheckoutStepsPlanContinueButton, _ as CheckoutStepsPlanGrid, $ as CheckoutStepsRoot, a0 as CheckoutStepsStepHeading, a1 as CheckoutStepsStepMessage, a2 as CheckoutStepsSuccess, M as MandateText, t as MandateTextProps, a3 as PaymentForm, j as PaymentFormBusinessDetails, c as PaymentFormCardElement, a as PaymentFormCustomerFields, h as PaymentFormError, i as PaymentFormLegalFooter, g as PaymentFormLoading, d as PaymentFormMandateText, b as PaymentFormPaymentElement, a4 as PaymentFormRoot, f as PaymentFormSubmitButton, P as PaymentFormSummary, k as PaymentFormTaxSummary, e as PaymentFormTermsCheckbox, u as PlanBadge, v as ProductBadge, w as PurchaseGate, a5 as PurchaseGateAllowed, a6 as PurchaseGateBlocked, a7 as PurchaseGateError, a8 as PurchaseGateLoading, a9 as PurchaseGateRoot, aa as useActivationFlow, E as useCheckoutStepsContext, ab as usePurchaseGate } from '../index-D4EhOmYp.js';
8
8
  import { PaymentElement } from '@stripe/react-stripe-js';
9
9
  import { Stripe, StripeElements } from '@stripe/stripe-js';
10
- export { a as UsageMeter, B as UsageMeterBar, b as UsageMeterClassNames, E as UsageMeterEmpty, L as UsageMeterLabel, c as UsageMeterLoading, P as UsageMeterPercentage, R as UsageMeterResetsIn, d as UsageMeterRoot, U as UsageMeterRootProps, u as useUsageMeter } from '../UsageMeter-BhxNHeRM.js';
10
+ export { a as UsageMeter, B as UsageMeterBar, b as UsageMeterClassNames, E as UsageMeterEmpty, L as UsageMeterLabel, c as UsageMeterLoading, P as UsageMeterPercentage, R as UsageMeterResetsIn, d as UsageMeterRoot, U as UsageMeterRootProps, u as useUsageMeter } from '../UsageMeter-CkJ_nowq.js';
11
11
  import '../adapters/auth.js';
12
12
 
13
13
  type PlanPricingOption = {
@@ -89,7 +89,7 @@ import {
89
89
  useCreditGate,
90
90
  usePaywallNotice,
91
91
  usePurchaseGate
92
- } from "../chunk-X65JBC2A.js";
92
+ } from "../chunk-AW5PCAYK.js";
93
93
  import {
94
94
  AmountPicker,
95
95
  AmountPickerConfirm,
@@ -175,7 +175,7 @@ import {
175
175
  usePlanSelector,
176
176
  useTopupForm,
177
177
  useUsageMeter
178
- } from "../chunk-VTGYZIE2.js";
178
+ } from "../chunk-LCBCOFXZ.js";
179
179
  import "../chunk-UMXOAUW7.js";
180
180
  import "../chunk-MLKGABMK.js";
181
181
  export {
@@ -820,6 +820,12 @@ interface components {
820
820
  /** @description Whether the grant was recorded */
821
821
  success: boolean;
822
822
  };
823
+ LimitAutoRechargeDto: {
824
+ /** @description Whether auto-recharge is enabled for this provider */
825
+ enabled: boolean;
826
+ /** @description Stored auto-recharge status when a config exists */
827
+ status?: string;
828
+ };
823
829
  LimitBalanceDto: {
824
830
  /** @description Credit balance in credits (100 credits = 1 minor currency unit) */
825
831
  creditBalance: number;
@@ -832,6 +838,8 @@ interface components {
832
838
  LimitPlanItemDto: {
833
839
  /** @description Derived billing cycle */
834
840
  billingCycle?: string;
841
+ /** @description Deep link that opens hosted checkout with this plan preselected. Present only when a checkout session was minted for this response. */
842
+ checkoutUrl?: string;
835
843
  /**
836
844
  * @deprecated
837
845
  * @description Deprecated alias of perUnitChargeMinor. Same minor-units value — not credits. Prefer perUnitChargeMinor.
@@ -861,6 +869,8 @@ interface components {
861
869
  LimitResponse: {
862
870
  /** @description True when the customer must activate a priced default plan before usage is allowed */
863
871
  activationRequired?: boolean;
872
+ /** @description Per-provider auto-recharge snapshot read off the customer document. Omitted when no config exists. */
873
+ autoRecharge?: components['schemas']['LimitAutoRechargeDto'];
864
874
  /** @description Prepaid usage balance context when the default plan is usage-based */
865
875
  balance?: components['schemas']['LimitBalanceDto'];
866
876
  /**
@@ -881,9 +891,7 @@ interface components {
881
891
  creditsPerUnit?: number;
882
892
  /** @description ISO 4217 currency code for credit fields */
883
893
  currency?: string;
884
- /**
885
- * The effective finite cap for this meter. Present only when the backend measured a finite cap.
886
- */
894
+ /** @description The effective finite cap for this meter. Present only when the backend measured a finite cap. */
887
895
  limit?: number;
888
896
  /**
889
897
  * The meter name to use when tracking usage events
@@ -896,10 +904,21 @@ interface components {
896
904
  needsUpgrade?: boolean;
897
905
  /** @description Access is granted and usage beyond the included cap accrues an overage charge — `onExceed: charge`. */
898
906
  overage?: boolean;
907
+ /**
908
+ * Authoritative paywall classification shared with Managed MCP. Present on denial responses only.
909
+ * @enum {string}
910
+ */
911
+ paywallReason?: 'activation_required' | 'topup_required' | 'payment_required';
912
+ /** @description Display name of the active or default plan */
913
+ planName?: string;
914
+ /** @description Active plan reference when the customer already holds a purchase */
915
+ planRef?: string;
899
916
  /** @description Active plans on the product available for activation or checkout */
900
917
  plans?: components['schemas']['LimitPlanItemDto'][];
901
918
  /** @description Product the limit check applies to */
902
919
  product?: components['schemas']['LimitProductBriefDto'];
920
+ /** @description Active purchase reference when the customer already holds a purchase */
921
+ purchaseRef?: string;
903
922
  /**
904
923
  * Remaining usage units before hitting the limit. `-1` means unlimited (no finite cap).
905
924
  * @example 997
@@ -909,9 +928,7 @@ interface components {
909
928
  throttled?: boolean;
910
929
  /** @description The customer was auto-upgraded to the target pricing to restore access — `onExceed: auto_upgrade` succeeded. */
911
930
  upgraded?: boolean;
912
- /**
913
- * Consumed usage units this period. Present only when the backend measured a finite cap.
914
- */
931
+ /** @description Consumed usage units this period. Present only when the backend measured a finite cap. */
915
932
  used?: number;
916
933
  /**
917
934
  * Whether the customer is within their usage limits
@@ -3847,7 +3864,7 @@ interface operations {
3847
3864
  /** SDK purchase row. Generated from the OpenAPI `SdkPurchaseResponse` schema. */
3848
3865
  type PurchaseInfo = components['schemas']['SdkPurchaseResponse'];
3849
3866
  /**
3850
- * Extended LimitResponse with SDK-added plan field.
3867
+ * `LimitResponse` plus a deprecated SDK-only `plan` alias.
3851
3868
  *
3852
3869
  * The backend `LimitResponse` now natively carries the `onExceed` outcome flags
3853
3870
  * (`throttled` / `overage` / `needsTopUp` / `needsUpgrade` / `upgraded`, resolved
@@ -3855,9 +3872,13 @@ type PurchaseInfo = components['schemas']['SdkPurchaseResponse'];
3855
3872
  * `overage` ride the allow path (`withinLimits: true`) so a protected handler
3856
3873
  * can read them from `decision.limits` and degrade service or note overage; the
3857
3874
  * others accompany a gate outcome.
3875
+ *
3876
+ * Read `planRef` for the active plan. `plan` is never populated by the
3877
+ * backend — it remains optional so older fixtures and callers still type-check.
3858
3878
  */
3859
3879
  type LimitResponseWithPlan = components['schemas']['LimitResponse'] & {
3860
- plan: string;
3880
+ /** @deprecated Never populated by the backend. Read `planRef` instead. */
3881
+ plan?: string;
3861
3882
  };
3862
3883
  type OneTimePurchaseInfo = components['schemas']['OneTimePurchaseInfo'];
3863
3884
  /**
@@ -820,6 +820,12 @@ interface components {
820
820
  /** @description Whether the grant was recorded */
821
821
  success: boolean;
822
822
  };
823
+ LimitAutoRechargeDto: {
824
+ /** @description Whether auto-recharge is enabled for this provider */
825
+ enabled: boolean;
826
+ /** @description Stored auto-recharge status when a config exists */
827
+ status?: string;
828
+ };
823
829
  LimitBalanceDto: {
824
830
  /** @description Credit balance in credits (100 credits = 1 minor currency unit) */
825
831
  creditBalance: number;
@@ -832,6 +838,8 @@ interface components {
832
838
  LimitPlanItemDto: {
833
839
  /** @description Derived billing cycle */
834
840
  billingCycle?: string;
841
+ /** @description Deep link that opens hosted checkout with this plan preselected. Present only when a checkout session was minted for this response. */
842
+ checkoutUrl?: string;
835
843
  /**
836
844
  * @deprecated
837
845
  * @description Deprecated alias of perUnitChargeMinor. Same minor-units value — not credits. Prefer perUnitChargeMinor.
@@ -861,6 +869,8 @@ interface components {
861
869
  LimitResponse: {
862
870
  /** @description True when the customer must activate a priced default plan before usage is allowed */
863
871
  activationRequired?: boolean;
872
+ /** @description Per-provider auto-recharge snapshot read off the customer document. Omitted when no config exists. */
873
+ autoRecharge?: components['schemas']['LimitAutoRechargeDto'];
864
874
  /** @description Prepaid usage balance context when the default plan is usage-based */
865
875
  balance?: components['schemas']['LimitBalanceDto'];
866
876
  /**
@@ -881,9 +891,7 @@ interface components {
881
891
  creditsPerUnit?: number;
882
892
  /** @description ISO 4217 currency code for credit fields */
883
893
  currency?: string;
884
- /**
885
- * The effective finite cap for this meter. Present only when the backend measured a finite cap.
886
- */
894
+ /** @description The effective finite cap for this meter. Present only when the backend measured a finite cap. */
887
895
  limit?: number;
888
896
  /**
889
897
  * The meter name to use when tracking usage events
@@ -896,10 +904,21 @@ interface components {
896
904
  needsUpgrade?: boolean;
897
905
  /** @description Access is granted and usage beyond the included cap accrues an overage charge — `onExceed: charge`. */
898
906
  overage?: boolean;
907
+ /**
908
+ * Authoritative paywall classification shared with Managed MCP. Present on denial responses only.
909
+ * @enum {string}
910
+ */
911
+ paywallReason?: 'activation_required' | 'topup_required' | 'payment_required';
912
+ /** @description Display name of the active or default plan */
913
+ planName?: string;
914
+ /** @description Active plan reference when the customer already holds a purchase */
915
+ planRef?: string;
899
916
  /** @description Active plans on the product available for activation or checkout */
900
917
  plans?: components['schemas']['LimitPlanItemDto'][];
901
918
  /** @description Product the limit check applies to */
902
919
  product?: components['schemas']['LimitProductBriefDto'];
920
+ /** @description Active purchase reference when the customer already holds a purchase */
921
+ purchaseRef?: string;
903
922
  /**
904
923
  * Remaining usage units before hitting the limit. `-1` means unlimited (no finite cap).
905
924
  * @example 997
@@ -909,9 +928,7 @@ interface components {
909
928
  throttled?: boolean;
910
929
  /** @description The customer was auto-upgraded to the target pricing to restore access — `onExceed: auto_upgrade` succeeded. */
911
930
  upgraded?: boolean;
912
- /**
913
- * Consumed usage units this period. Present only when the backend measured a finite cap.
914
- */
931
+ /** @description Consumed usage units this period. Present only when the backend measured a finite cap. */
915
932
  used?: number;
916
933
  /**
917
934
  * Whether the customer is within their usage limits
@@ -3847,7 +3864,7 @@ interface operations {
3847
3864
  /** SDK purchase row. Generated from the OpenAPI `SdkPurchaseResponse` schema. */
3848
3865
  type PurchaseInfo = components['schemas']['SdkPurchaseResponse'];
3849
3866
  /**
3850
- * Extended LimitResponse with SDK-added plan field.
3867
+ * `LimitResponse` plus a deprecated SDK-only `plan` alias.
3851
3868
  *
3852
3869
  * The backend `LimitResponse` now natively carries the `onExceed` outcome flags
3853
3870
  * (`throttled` / `overage` / `needsTopUp` / `needsUpgrade` / `upgraded`, resolved
@@ -3855,9 +3872,13 @@ type PurchaseInfo = components['schemas']['SdkPurchaseResponse'];
3855
3872
  * `overage` ride the allow path (`withinLimits: true`) so a protected handler
3856
3873
  * can read them from `decision.limits` and degrade service or note overage; the
3857
3874
  * others accompany a gate outcome.
3875
+ *
3876
+ * Read `planRef` for the active plan. `plan` is never populated by the
3877
+ * backend — it remains optional so older fixtures and callers still type-check.
3858
3878
  */
3859
3879
  type LimitResponseWithPlan = components['schemas']['LimitResponse'] & {
3860
- plan: string;
3880
+ /** @deprecated Never populated by the backend. Read `planRef` instead. */
3881
+ plan?: string;
3861
3882
  };
3862
3883
  type OneTimePurchaseInfo = components['schemas']['OneTimePurchaseInfo'];
3863
3884
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solvapay/react",
3
- "version": "2.2.0",
3
+ "version": "2.2.1-preview-4e9e88853847575b5dbe7c2d36163333a2364b7a",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
@@ -57,7 +57,7 @@
57
57
  "directory": "packages/react"
58
58
  },
59
59
  "peerDependencies": {
60
- "@solvapay/mcp-core": "^0.2.8 || ^0.3.0 || ^0.4.0",
60
+ "@solvapay/mcp-core": "0.4.1-preview-4e9e88853847575b5dbe7c2d36163333a2364b7a",
61
61
  "react": "^18.2.0 || ^19.0.0",
62
62
  "react-dom": "^18.2.0 || ^19.0.0"
63
63
  },
@@ -69,7 +69,7 @@
69
69
  "dependencies": {
70
70
  "@stripe/react-stripe-js": "^6.0.0",
71
71
  "@stripe/stripe-js": "^9.0.0",
72
- "@solvapay/core": "1.7.0"
72
+ "@solvapay/core": "1.7.1-preview-4e9e88853847575b5dbe7c2d36163333a2364b7a"
73
73
  },
74
74
  "devDependencies": {
75
75
  "@testing-library/dom": "^10.4.1",
@@ -85,9 +85,9 @@
85
85
  "react-dom": "^19.2.5",
86
86
  "typescript": "^5.9.3",
87
87
  "vitest": "^4.1.2",
88
- "@solvapay/mcp-core": "0.4.0",
89
- "@solvapay/test-utils": "0.0.0",
90
- "@solvapay/server": "2.4.0"
88
+ "@solvapay/mcp-core": "0.4.1-preview-4e9e88853847575b5dbe7c2d36163333a2364b7a",
89
+ "@solvapay/server": "2.5.0-preview-4e9e88853847575b5dbe7c2d36163333a2364b7a",
90
+ "@solvapay/test-utils": "0.0.0"
91
91
  },
92
92
  "scripts": {
93
93
  "build": "tsup src/index.tsx src/primitives/index.ts src/adapters/auth.ts src/adapters/auth0.ts src/adapters/session-auth.ts src/mcp/index.ts --format esm,cjs --dts --tsconfig tsconfig.build.json && cp src/styles.css dist/styles.css && mkdir -p dist/mcp && cp src/mcp/styles.css dist/mcp/styles.css",