@solvapay/server 2.4.1 → 2.5.0-preview-4dcf60c628500a6210ba69edbf7ae56ee47fbb3a

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/index.d.cts CHANGED
@@ -817,6 +817,12 @@ interface components {
817
817
  /** @description Whether the grant was recorded */
818
818
  success: boolean;
819
819
  };
820
+ LimitAutoRechargeDto: {
821
+ /** @description Whether auto-recharge is enabled for this provider */
822
+ enabled: boolean;
823
+ /** @description Stored auto-recharge status when a config exists */
824
+ status?: string;
825
+ };
820
826
  LimitBalanceDto: {
821
827
  /** @description Credit balance in credits (100 credits = 1 minor currency unit) */
822
828
  creditBalance: number;
@@ -829,6 +835,8 @@ interface components {
829
835
  LimitPlanItemDto: {
830
836
  /** @description Derived billing cycle */
831
837
  billingCycle?: string;
838
+ /** @description Deep link that opens hosted checkout with this plan preselected. Present only when a checkout session was minted for this response. */
839
+ checkoutUrl?: string;
832
840
  /**
833
841
  * @deprecated
834
842
  * @description Deprecated alias of perUnitChargeMinor. Same minor-units value — not credits. Prefer perUnitChargeMinor.
@@ -858,6 +866,8 @@ interface components {
858
866
  LimitResponse: {
859
867
  /** @description True when the customer must activate a priced default plan before usage is allowed */
860
868
  activationRequired?: boolean;
869
+ /** @description Per-provider auto-recharge snapshot read off the customer document. Omitted when no config exists. */
870
+ autoRecharge?: components['schemas']['LimitAutoRechargeDto'];
861
871
  /** @description Prepaid usage balance context when the default plan is usage-based */
862
872
  balance?: components['schemas']['LimitBalanceDto'];
863
873
  /**
@@ -878,9 +888,7 @@ interface components {
878
888
  creditsPerUnit?: number;
879
889
  /** @description ISO 4217 currency code for credit fields */
880
890
  currency?: string;
881
- /**
882
- * The effective finite cap for this meter. Present only when the backend measured a finite cap.
883
- */
891
+ /** @description The effective finite cap for this meter. Present only when the backend measured a finite cap. */
884
892
  limit?: number;
885
893
  /**
886
894
  * The meter name to use when tracking usage events
@@ -893,10 +901,21 @@ interface components {
893
901
  needsUpgrade?: boolean;
894
902
  /** @description Access is granted and usage beyond the included cap accrues an overage charge — `onExceed: charge`. */
895
903
  overage?: boolean;
904
+ /**
905
+ * Authoritative paywall classification shared with Managed MCP. Present on denial responses only.
906
+ * @enum {string}
907
+ */
908
+ paywallReason?: 'activation_required' | 'topup_required' | 'payment_required';
909
+ /** @description Display name of the active or default plan */
910
+ planName?: string;
911
+ /** @description Active plan reference when the customer already holds a purchase */
912
+ planRef?: string;
896
913
  /** @description Active plans on the product available for activation or checkout */
897
914
  plans?: components['schemas']['LimitPlanItemDto'][];
898
915
  /** @description Product the limit check applies to */
899
916
  product?: components['schemas']['LimitProductBriefDto'];
917
+ /** @description Active purchase reference when the customer already holds a purchase */
918
+ purchaseRef?: string;
900
919
  /**
901
920
  * Remaining usage units before hitting the limit. `-1` means unlimited (no finite cap).
902
921
  * @example 997
@@ -906,9 +925,7 @@ interface components {
906
925
  throttled?: boolean;
907
926
  /** @description The customer was auto-upgraded to the target pricing to restore access — `onExceed: auto_upgrade` succeeded. */
908
927
  upgraded?: boolean;
909
- /**
910
- * Consumed usage units this period. Present only when the backend measured a finite cap.
911
- */
928
+ /** @description Consumed usage units this period. Present only when the backend measured a finite cap. */
912
929
  used?: number;
913
930
  /**
914
931
  * Whether the customer is within their usage limits
@@ -3899,7 +3916,7 @@ type AttachBusinessDetailsParams = {
3899
3916
  type AttachBusinessDetailsResult = components['schemas']['AttachBusinessDetailsResponse'];
3900
3917
  type CheckLimitsRequest = components['schemas']['CheckLimitRequest'];
3901
3918
  /**
3902
- * Extended LimitResponse with SDK-added plan field.
3919
+ * `LimitResponse` plus a deprecated SDK-only `plan` alias.
3903
3920
  *
3904
3921
  * The backend `LimitResponse` now natively carries the `onExceed` outcome flags
3905
3922
  * (`throttled` / `overage` / `needsTopUp` / `needsUpgrade` / `upgraded`, resolved
@@ -3907,9 +3924,13 @@ type CheckLimitsRequest = components['schemas']['CheckLimitRequest'];
3907
3924
  * `overage` ride the allow path (`withinLimits: true`) so a protected handler
3908
3925
  * can read them from `decision.limits` and degrade service or note overage; the
3909
3926
  * others accompany a gate outcome.
3927
+ *
3928
+ * Read `planRef` for the active plan. `plan` is never populated by the
3929
+ * backend — it remains optional so older fixtures and callers still type-check.
3910
3930
  */
3911
3931
  type LimitResponseWithPlan = components['schemas']['LimitResponse'] & {
3912
- plan: string;
3932
+ /** @deprecated Never populated by the backend. Read `planRef` instead. */
3933
+ plan?: string;
3913
3934
  };
3914
3935
  /**
3915
3936
  * Extended CustomerResponse with proper field mapping
@@ -4200,6 +4221,16 @@ interface SolvaPayClient {
4200
4221
  type LimitPlanSummary = components['schemas']['LimitPlanItemDto'];
4201
4222
  type LimitActivationBalance = components['schemas']['LimitBalanceDto'];
4202
4223
  type LimitActivationProduct = components['schemas']['LimitProductBriefDto'];
4224
+ type LimitAutoRechargeDto = components['schemas']['LimitAutoRechargeDto'];
4225
+ /**
4226
+ * All paywall reasons the SDK recognises: every backend `paywallReason`
4227
+ * plus the three SDK-only classifier kinds. Derived from a shared tuple
4228
+ * so the Zod mirror in `paywall-schema.ts` cannot drift.
4229
+ */
4230
+ declare const PAYWALL_REASONS: readonly ["activation_required", "topup_required", "payment_required", "upgrade_required", "limit_reached", "reactivation_required"];
4231
+ type PaywallReason = (typeof PAYWALL_REASONS)[number];
4232
+ declare const PAYWALL_NEXT_ACTIONS: readonly ["topup", "checkout", "activate", "account"];
4233
+ type PaywallNextAction = (typeof PAYWALL_NEXT_ACTIONS)[number];
4203
4234
  /**
4204
4235
  * Arguments passed to protected handlers
4205
4236
  */
@@ -4236,8 +4267,10 @@ interface PaywallMetadata {
4236
4267
  * when the backend did not send it — never defaulted.
4237
4268
  */
4238
4269
  type PaywallGateRecoveryFields = {
4239
- /** Active plan reference from `limits.plan`. */
4270
+ /** Active plan reference from `limits.planRef` (falls back to deprecated `plan`). */
4240
4271
  planRef?: string;
4272
+ /** Display name of the active or default plan. */
4273
+ planName?: string;
4241
4274
  /** Product plans from `checkLimits` (activation already had this). */
4242
4275
  plans?: LimitPlanSummary[];
4243
4276
  /** Meter the gated call was charged against. */
@@ -4257,6 +4290,37 @@ type PaywallGateRecoveryFields = {
4257
4290
  };
4258
4291
  /** Prepaid credit balance, coalesced from nested or top-level fields. */
4259
4292
  creditBalance?: number;
4293
+ /**
4294
+ * `PaywallState.kind` — same vocabulary as the classifier, not a third enum.
4295
+ * `upgrade_required` / `limit_reached` / `reactivation_required` are
4296
+ * SDK-only; the backend's `paywallReason` is a smaller set
4297
+ * (`activation_required` / `topup_required` / `payment_required`).
4298
+ */
4299
+ reason?: PaywallReason;
4300
+ /** Single primary recovery the agent should take. */
4301
+ nextAction?: PaywallNextAction;
4302
+ /**
4303
+ * Credits deducted per call. Named `creditsPerCall` on purpose:
4304
+ * `balance.creditsPerUnit` is credits, but `plans[].creditsPerUnit`
4305
+ * is a deprecated alias for `perUnitChargeMinor` (minor currency units).
4306
+ */
4307
+ creditsPerCall?: number;
4308
+ /** `max(0, creditsPerCall - creditBalance)` when both are known. */
4309
+ shortfallCredits?: number;
4310
+ /** How many calls the current allowance or wallet still covers. */
4311
+ remainingCalls?: number;
4312
+ /** Active purchase reference when the customer already holds a purchase. */
4313
+ purchaseRef?: string;
4314
+ /** Purchase/plan status when the backend sent one. */
4315
+ planStatus?: string;
4316
+ /** Per-provider auto-recharge snapshot. Omitted when unknown. */
4317
+ autoRecharge?: LimitAutoRechargeDto;
4318
+ /** Global destinations. Per-plan URLs stay on `plans[].checkoutUrl`. */
4319
+ links?: {
4320
+ topup?: string;
4321
+ checkout?: string;
4322
+ manage?: string;
4323
+ };
4260
4324
  };
4261
4325
  type PaywallStructuredContent = ({
4262
4326
  kind: 'payment_required';
@@ -5504,13 +5568,10 @@ interface ProtectHandlerContext {
5504
5568
  */
5505
5569
 
5506
5570
  /**
5507
- * Subset of `LimitResponseWithPlan` the helper actually reads. Keeps the
5508
- * signature flexible — callers can pass the raw `apiClient.checkLimits`
5509
- * result without first asserting the `plan` field.
5571
+ * `LimitResponseWithPlan` as returned by `apiClient.checkLimits`.
5572
+ * `plan` is optional and deprecated — the backend never sends it.
5510
5573
  */
5511
- type LimitsLike = Omit<LimitResponseWithPlan, 'plan'> & {
5512
- plan?: LimitResponseWithPlan['plan'];
5513
- };
5574
+ type LimitsLike = LimitResponseWithPlan;
5514
5575
  declare function buildPaywallGate(productRef: string, limits: LimitsLike): PaywallStructuredContent;
5515
5576
 
5516
5577
  /**
@@ -5522,6 +5583,7 @@ declare function buildPaywallGate(productRef: string, limits: LimitsLike): Paywa
5522
5583
 
5523
5584
  declare const PaywallStructuredContentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
5524
5585
  planRef: z.ZodOptional<z.ZodString>;
5586
+ planName: z.ZodOptional<z.ZodString>;
5525
5587
  plans: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
5526
5588
  meterName: z.ZodOptional<z.ZodString>;
5527
5589
  unitPriceMinor: z.ZodOptional<z.ZodNumber>;
@@ -5534,12 +5596,41 @@ declare const PaywallStructuredContentSchema: z.ZodDiscriminatedUnion<[z.ZodObje
5534
5596
  creditBalance: z.ZodOptional<z.ZodNumber>;
5535
5597
  balance: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
5536
5598
  productDetails: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
5599
+ reason: z.ZodOptional<z.ZodEnum<{
5600
+ topup_required: "topup_required";
5601
+ payment_required: "payment_required";
5602
+ activation_required: "activation_required";
5603
+ upgrade_required: "upgrade_required";
5604
+ limit_reached: "limit_reached";
5605
+ reactivation_required: "reactivation_required";
5606
+ }>>;
5607
+ nextAction: z.ZodOptional<z.ZodEnum<{
5608
+ topup: "topup";
5609
+ checkout: "checkout";
5610
+ activate: "activate";
5611
+ account: "account";
5612
+ }>>;
5613
+ creditsPerCall: z.ZodOptional<z.ZodNumber>;
5614
+ shortfallCredits: z.ZodOptional<z.ZodNumber>;
5615
+ remainingCalls: z.ZodOptional<z.ZodNumber>;
5616
+ purchaseRef: z.ZodOptional<z.ZodString>;
5617
+ planStatus: z.ZodOptional<z.ZodString>;
5618
+ autoRecharge: z.ZodOptional<z.ZodObject<{
5619
+ enabled: z.ZodBoolean;
5620
+ status: z.ZodOptional<z.ZodString>;
5621
+ }, z.core.$strip>>;
5622
+ links: z.ZodOptional<z.ZodObject<{
5623
+ topup: z.ZodOptional<z.ZodString>;
5624
+ checkout: z.ZodOptional<z.ZodString>;
5625
+ manage: z.ZodOptional<z.ZodString>;
5626
+ }, z.core.$strip>>;
5537
5627
  kind: z.ZodLiteral<"payment_required">;
5538
5628
  product: z.ZodString;
5539
5629
  checkoutUrl: z.ZodString;
5540
5630
  message: z.ZodString;
5541
5631
  }, z.core.$strip>, z.ZodObject<{
5542
5632
  planRef: z.ZodOptional<z.ZodString>;
5633
+ planName: z.ZodOptional<z.ZodString>;
5543
5634
  plans: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
5544
5635
  meterName: z.ZodOptional<z.ZodString>;
5545
5636
  unitPriceMinor: z.ZodOptional<z.ZodNumber>;
@@ -5552,6 +5643,34 @@ declare const PaywallStructuredContentSchema: z.ZodDiscriminatedUnion<[z.ZodObje
5552
5643
  creditBalance: z.ZodOptional<z.ZodNumber>;
5553
5644
  balance: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
5554
5645
  productDetails: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
5646
+ reason: z.ZodOptional<z.ZodEnum<{
5647
+ topup_required: "topup_required";
5648
+ payment_required: "payment_required";
5649
+ activation_required: "activation_required";
5650
+ upgrade_required: "upgrade_required";
5651
+ limit_reached: "limit_reached";
5652
+ reactivation_required: "reactivation_required";
5653
+ }>>;
5654
+ nextAction: z.ZodOptional<z.ZodEnum<{
5655
+ topup: "topup";
5656
+ checkout: "checkout";
5657
+ activate: "activate";
5658
+ account: "account";
5659
+ }>>;
5660
+ creditsPerCall: z.ZodOptional<z.ZodNumber>;
5661
+ shortfallCredits: z.ZodOptional<z.ZodNumber>;
5662
+ remainingCalls: z.ZodOptional<z.ZodNumber>;
5663
+ purchaseRef: z.ZodOptional<z.ZodString>;
5664
+ planStatus: z.ZodOptional<z.ZodString>;
5665
+ autoRecharge: z.ZodOptional<z.ZodObject<{
5666
+ enabled: z.ZodBoolean;
5667
+ status: z.ZodOptional<z.ZodString>;
5668
+ }, z.core.$strip>>;
5669
+ links: z.ZodOptional<z.ZodObject<{
5670
+ topup: z.ZodOptional<z.ZodString>;
5671
+ checkout: z.ZodOptional<z.ZodString>;
5672
+ manage: z.ZodOptional<z.ZodString>;
5673
+ }, z.core.$strip>>;
5555
5674
  kind: z.ZodLiteral<"activation_required">;
5556
5675
  product: z.ZodString;
5557
5676
  checkoutUrl: z.ZodString;
@@ -5589,38 +5708,41 @@ type PaywallState = {
5589
5708
  } | {
5590
5709
  kind: 'reactivation_required';
5591
5710
  };
5711
+ type CreditSignals = {
5712
+ creditBalance?: number;
5713
+ creditsPerCall?: number;
5714
+ shortfallCredits?: number;
5715
+ remainingCalls?: number;
5716
+ isCreditBased: boolean;
5717
+ };
5718
+ /**
5719
+ * Coalesce the two credit-balance channels and derive shortfall /
5720
+ * remaining-call counts. Nested `balance` wins when present.
5721
+ */
5722
+ declare function creditSignals(limits: LimitResponseWithPlan | null): CreditSignals;
5723
+ declare function nextActionFor(state: PaywallState): PaywallNextAction;
5592
5724
  /**
5593
5725
  * Classify a `LimitResponseWithPlan` (or `null` on degraded paths) into
5594
5726
  * a `PaywallState`. Pure — safe to call multiple times per request.
5595
5727
  *
5596
5728
  * Precedence:
5597
- * 1. `activationRequired === true` — trumps everything else; the
5598
- * backend explicitly flagged that no plan is live yet.
5599
- * 2. Authoritative `needsTopUp` / `needsUpgrade` flags from
5600
- * `decideLimit`, when the backend sent them. Prefer these over
5601
- * the credit-balance heuristic so a top-up deny and an
5602
- * auto-upgrade deny are not re-derived from plan type.
5603
- * 3. Usage-based plan out of credits — the customer has a plan but
5604
- * ran out, so a topup is the right action. "Out of credits" is
5605
- * determined from (in order): the nested
5606
- * `balance.creditBalance === 0` block, the top-level
5607
- * `creditBalance === 0` field, or `remaining === 0` as a
5608
- * fallback for older backend responses that omit both credit
5609
- * fields on usage-based plans.
5610
- * 4. Active plan at included cap (`plan` is a non-empty ref and
5611
- * `remaining <= 0`) → `limit_reached`. This is the "on Free, used
5612
- * 3 of 3" case — not "no plan".
5613
- * 5. Everything else → `upgrade_required`, including:
5614
- * - `limits === null` (defensive),
5615
- * - no active plan on the product.
5729
+ * 1. `activationRequired` / `paywallReason === 'activation_required'`.
5730
+ * 2. `paywallReason === 'topup_required'` — backend stays authoritative
5731
+ * for credit-based denials (same rule as Managed MCP).
5732
+ * 3. Authoritative `needsTopUp` / `needsUpgrade` flags from `decideLimit`.
5733
+ * 4. Credit-field presence + a real shortfall (`balance < cost`).
5734
+ * 5. Active purchase / plan at included cap → `limit_reached`.
5735
+ * 6. Floor: never `upgrade_required` when credit fields or a purchase
5736
+ * are present. Everything else → `upgrade_required`.
5616
5737
  *
5617
5738
  * `reactivation_required` is deferred — it needs a distinct backend
5618
- * signal (future `LimitResponse.inactivePurchaseRef`) which isn't
5619
- * emitted yet. Kept in the type so downstream code compiles against
5620
- * the full discriminated union; `classifyPaywallState` will never
5621
- * return it under current backend behaviour.
5739
+ * signal which isn't emitted yet. Kept in the type so downstream code
5740
+ * compiles against the full discriminated union.
5622
5741
  */
5623
5742
  declare function classifyPaywallState(limits: LimitResponseWithPlan | null): PaywallState;
5743
+ /** Escape markdown link-label delimiters — plan names are provider-authored. */
5744
+ declare function linkLabel(name: string): string;
5745
+ declare function planLadder(gate: PaywallStructuredContent): string | null;
5624
5746
  /**
5625
5747
  * Produce the terminal-friendly gate message. Names the `account`
5626
5748
  * viewer (with a `view` hint when the landing screen matters) or
@@ -6425,4 +6547,4 @@ declare function verifyWebhook({ body, signature, secret, }: {
6425
6547
  secret: string;
6426
6548
  }): WebhookEvent;
6427
6549
 
6428
- export { type ActivatePlanResult, type AssignCreditsRequest, type AssignCreditsResponse, type AttachBusinessDetailsParams, type AttachBusinessDetailsResult, type AuthenticatedUser, type AutoRechargeConfig, type AutoRechargeDisplayBlock, type AutoRechargeInput, type AutoRechargeResponse, BALANCE_RECONCILE_DELAYS_MS, type ConfigureMcpPlansRequest, type ConfigureMcpPlansResponse, type CreateSolvaPayConfig, type CreditActivityEntry, type CreditActivityResult, type CreditActivityType, type CreditDebitResult, type CreditDebitSkipReason, type CreditDisplayBlock, type CustomerBalanceResult, type CustomerResponseMapped, type CustomerWebhookObject, type ErrorResult, type GetHistoryResult, type GetUsageResult, type HttpAdapterOptions, type LimitActivationBalance, type LimitActivationProduct, type LimitPlanSummary, type LimitResponseWithPlan, type McpBootstrapPlanInput, type McpBootstrapRequest, type McpBootstrapResponse, type McpServerLike, type McpToolPlanMappingInput, type NextAdapterOptions, type OneTimePurchaseInfo, type PayableAllowResult, type PayableFunction, type PayableGateOptions, type PayableGateResult, type PayableOptions, type PayablePaywallResult, type PaymentMethodInfo, type PaywallArgs, type PaywallDecision, PaywallError, type PaywallGateRecoveryFields, type PaywallMetadata, type PaywallState, type PaywallStructuredContent, PaywallStructuredContentSchema, type ProcessPaymentResult, type ProductConfigurationStatus, type ProtectHandlerContext, type PurchaseCheckResult, type PurchaseInfo, type RegisterVirtualToolsMcpOptions, type RetryOptions, type SaveAutoRechargeInput, type SaveAutoRechargeResponse, type SdkMerchantResponse, type SdkProductResponse, type ServerClientOptions, type SolvaPay, type SolvaPayClient, TOPUP_BALANCE_POLL_DELAYS_MS, type ToolPlanMappingInput, type TopupProcessResult, type TrackUsageBulkRequest, type TrackUsageBulkResponse, type TrackUsageRequest, type TrackUsageResponse, type UsageLimitsInput, VIRTUAL_TOOL_DEFINITIONS, type VerifyProductConfigurationOptions, type VirtualToolDefinition, type VirtualToolsOptions, type WebhookEvent, type WebhookEventForType, type WebhookEventObjectMap, type WebhookEventType, type WebhookProduct, activatePlanCore, attachBusinessDetailsCore, buildGateMessage, buildNudgeMessage, buildPaywallGate, cancelPurchaseCore, checkLimitsCore, checkPurchaseCore, classifyPaywallState, type components, createCheckoutSessionCore, createCustomerSessionCore, createPaymentIntentCore, createSolvaPay, createSolvaPayClient, createTopupPaymentIntentCore, createVirtualTools, deriveUsageSnapshot, disableAutoRechargeCore, getAuthenticatedUserCore, getAutoRechargeCore, getCustomerBalanceCore, getHistoryCore, getMerchantCore, getPaymentMethodCore, getProductCore, getUsageCore, handleRouteError, isErrorResult, isPaywallStructuredContent, jsonSchemaToZodRawShape, listPlansCore, paywallErrorToClientPayload, pollBalanceUntilIncreased, processPaymentIntentCore, processTopupPaymentIntentCore, reactivatePurchaseCore, registerVirtualToolsMcpImpl, saveAutoRechargeCore, syncCustomerCore, trackUsageCore, verifyProductConfiguration, verifyWebhook, withRetry };
6550
+ export { type ActivatePlanResult, type AssignCreditsRequest, type AssignCreditsResponse, type AttachBusinessDetailsParams, type AttachBusinessDetailsResult, type AuthenticatedUser, type AutoRechargeConfig, type AutoRechargeDisplayBlock, type AutoRechargeInput, type AutoRechargeResponse, BALANCE_RECONCILE_DELAYS_MS, type ConfigureMcpPlansRequest, type ConfigureMcpPlansResponse, type CreateSolvaPayConfig, type CreditActivityEntry, type CreditActivityResult, type CreditActivityType, type CreditDebitResult, type CreditDebitSkipReason, type CreditDisplayBlock, type CreditSignals, type CustomerBalanceResult, type CustomerResponseMapped, type CustomerWebhookObject, type ErrorResult, type GetHistoryResult, type GetUsageResult, type HttpAdapterOptions, type LimitActivationBalance, type LimitActivationProduct, type LimitAutoRechargeDto, type LimitPlanSummary, type LimitResponseWithPlan, type McpBootstrapPlanInput, type McpBootstrapRequest, type McpBootstrapResponse, type McpServerLike, type McpToolPlanMappingInput, type NextAdapterOptions, type OneTimePurchaseInfo, type PayableAllowResult, type PayableFunction, type PayableGateOptions, type PayableGateResult, type PayableOptions, type PayablePaywallResult, type PaymentMethodInfo, type PaywallArgs, type PaywallDecision, PaywallError, type PaywallGateRecoveryFields, type PaywallMetadata, type PaywallNextAction, type PaywallReason, type PaywallState, type PaywallStructuredContent, PaywallStructuredContentSchema, type ProcessPaymentResult, type ProductConfigurationStatus, type ProtectHandlerContext, type PurchaseCheckResult, type PurchaseInfo, type RegisterVirtualToolsMcpOptions, type RetryOptions, type SaveAutoRechargeInput, type SaveAutoRechargeResponse, type SdkMerchantResponse, type SdkProductResponse, type ServerClientOptions, type SolvaPay, type SolvaPayClient, TOPUP_BALANCE_POLL_DELAYS_MS, type ToolPlanMappingInput, type TopupProcessResult, type TrackUsageBulkRequest, type TrackUsageBulkResponse, type TrackUsageRequest, type TrackUsageResponse, type UsageLimitsInput, VIRTUAL_TOOL_DEFINITIONS, type VerifyProductConfigurationOptions, type VirtualToolDefinition, type VirtualToolsOptions, type WebhookEvent, type WebhookEventForType, type WebhookEventObjectMap, type WebhookEventType, type WebhookProduct, activatePlanCore, attachBusinessDetailsCore, buildGateMessage, buildNudgeMessage, buildPaywallGate, cancelPurchaseCore, checkLimitsCore, checkPurchaseCore, classifyPaywallState, type components, createCheckoutSessionCore, createCustomerSessionCore, createPaymentIntentCore, createSolvaPay, createSolvaPayClient, createTopupPaymentIntentCore, createVirtualTools, creditSignals, deriveUsageSnapshot, disableAutoRechargeCore, getAuthenticatedUserCore, getAutoRechargeCore, getCustomerBalanceCore, getHistoryCore, getMerchantCore, getPaymentMethodCore, getProductCore, getUsageCore, handleRouteError, isErrorResult, isPaywallStructuredContent, jsonSchemaToZodRawShape, linkLabel, listPlansCore, nextActionFor, paywallErrorToClientPayload, planLadder, pollBalanceUntilIncreased, processPaymentIntentCore, processTopupPaymentIntentCore, reactivatePurchaseCore, registerVirtualToolsMcpImpl, saveAutoRechargeCore, syncCustomerCore, trackUsageCore, verifyProductConfiguration, verifyWebhook, withRetry };