/** * @name session/session-limits * @description Session spending limit management — per-transaction checks, balance deduction, and daily resets. * * @flow * 1. `checkSpendingLimit` validates a transaction amount against per-transaction and remaining session limits. * 2. `deductFromSession` subtracts a spent amount from the session's remaining balance. * 3. `resetDailyLimits` resets the session's remaining balance to the maximum per-session limit. * * @module session/session-limits */ import type { SapAgentSession, SapSpendingLimits } from '../../core/src/types.js'; /** * @name checkSpendingLimit * @description Checks whether a transaction amount is within the session's spending limits. * * @param session — The agent session to check against. * @param amountSol — The transaction amount in SOL to validate. * @returns `{ allowed: true }` if within limits; `{ allowed: false, reason }` with an explanation otherwise. * * @usedBy Tool handlers across the SAP MCP runtime. */ export declare function checkSpendingLimit(session: SapAgentSession, amountSol: number): { allowed: boolean; reason?: string; }; /** * @name deductFromSession * @description Deducts a spent amount from the session's remaining SOL balance and returns the updated limits. * * @param session — The agent session to deduct from. * @param amountSol — The amount in SOL to deduct. * @returns A new `SapSpendingLimits` object with the updated `remainingSessionSol`. * * @usedBy Tool handlers across the SAP MCP runtime. */ export declare function deductFromSession(session: SapAgentSession, amountSol: number): SapSpendingLimits; /** * @name resetDailyLimits * @description Resets the session's remaining SOL balance to the maximum per-session limit. * * Called periodically to reset daily spending counters. In production, a separate * daily counter stored in Redis/DB would be reset here. * * @param session — The agent session whose limits to reset. * * @usedBy Scheduled limit reset tasks in the SAP MCP runtime. */ export declare function resetDailyLimits(session: SapAgentSession): void; //# sourceMappingURL=session-limits.d.ts.map