/** * @name SapMcpPricing * @description Pricing registry for hosted SAP MCP tool monetization. */ import type { SapMcpMonetizationConfig } from '../../config-runtime/src/env.js'; import type { McpToolCall, ParsedMcpRequest } from './json-rpc.js'; /** * @name PaymentTier * @description Commercial pricing tier for an MCP request. */ export type PaymentTier = 'free' | 'micro-read' | 'read-premium' | 'builder' | 'value-action' | 'batch'; /** * @name ToolPricing * @description Resolved price classification for one tool call. */ export interface ToolPricing { toolName: string; tier: PaymentTier; priceUsd: number; reason: string; exactPrice?: boolean; } /** * @name PricingCatalog * @description Public, machine-readable pricing and routing model exposed to agents. */ export interface PricingCatalog { source: 'sap-mcp-pricing-registry'; version: 1; strictTools: boolean; currency: 'USD'; tiers: Record; toolSets: { free: string[]; microRead: string[]; conditionalFree: string[]; conditionalMicroRead: string[]; readPremium: string[]; builders: string[]; valueActions: string[]; heavyValueActions: string[]; valueActionPrefixes: string[]; }; runtimeRules: string[]; } /** * @name PaymentDecision * @description Aggregated payment requirement for a JSON-RPC MCP request. */ export type PaymentDecision = { required: false; tier: 'free'; reason: string; toolPricings: ToolPricing[]; } | { required: true; tier: Exclude; priceUsd: number; price: string; description: string; toolPricings: ToolPricing[]; toolNames: string[]; }; /** * @name buildPricingCatalog * @description Returns the public pricing catalog used by docs, agents, and marketplace metadata. */ export declare function buildPricingCatalog(config: SapMcpMonetizationConfig): PricingCatalog; /** * @name resolvePaymentDecision * @description Calculates whether a parsed MCP request requires payment and the exact USD price. */ export declare function resolvePaymentDecision(parsedRequest: ParsedMcpRequest, config: SapMcpMonetizationConfig): PaymentDecision; /** * @name priceToolCall * @description Classifies and prices a single MCP tool invocation. */ export declare function priceToolCall(toolCall: McpToolCall, config: SapMcpMonetizationConfig): ToolPricing; /** * @name classifyTool * @description Maps a tool name to the default hosted monetization tier. */ export declare function classifyTool(toolName: string, config?: Pick): PaymentTier; /** * @name formatUsdPrice * @description Formats a decimal USD price for x402 money parsing while preserving small prices. */ export declare function formatUsdPrice(priceUsd: number): string; //# sourceMappingURL=pricing.d.ts.map