import type { ClaimedExecution, EffectObservation, EffectPreparedAction, ExecutionCapability, ExecutionEffect, NativeExecutor, PreparedAction, ReconcileResult } from "@decionis/agent-safe-pipeline"; import type { RegisteredEffect } from "../EffectEvidenceRegister.js"; import { type CardAuthorizationRequest, type CardAuthorizationResult, type CardPurchase } from "./CardPurchase.js"; export declare const CARD_ISSUER_PLATFORM = "card-issuer"; /** * What the issuer reported about an authorization it was told to approve, * with the attempt it belongs to: the purchase and the projection its grant * was bound to, the issuer's request and result, and whether the claim's * lease had closed by the time the result arrived. */ export interface CardAuthorizationReceipt { readonly purchase: CardPurchase; readonly prepared: EffectPreparedAction; readonly request: CardAuthorizationRequest; readonly result: CardAuthorizationResult; readonly leaseExpired: boolean; readonly correlationId: string; readonly idempotencyKey: string; } export interface CardAuthorizationExecutorOptions { /** The observer the effect record and the authority name. */ readonly observer: { readonly id: string; readonly version: string; }; readonly clock?: () => Date; } /** * The cards family on `agent-safe.executors.native/1`, permit style: the * issuer performs the effect, when its real-time authorization hook asks, so * this executor never writes anything. The grant is held when the purchase * is decided; the issuer's authorization request presents it, which claims * it once; the permit is the approval the issuer is answered with; and the * issuer's result is the receipt that settles it. * * - `observe` reads the result into the family's effect record: an approval * within the ceiling is the authorised effect, a decline is a refusal, and * a result after the claim's lease is indeterminate whatever it says. * - `reconcile` has no one to ask: the issuer is the system of record and * this boundary has no read path into it, so an authorization whose result * never arrived stays unknown until someone who can see the issuer's ledger * says. */ export declare class CardAuthorizationExecutor implements NativeExecutor { readonly platform = "card-issuer"; readonly style: "permit"; readonly actionTypes: readonly string[]; readonly version: string; private readonly observer; private readonly clock; constructor(options: CardAuthorizationExecutorOptions); capabilities(): Promise; /** * The purchase as an intent: this card, at this merchant, for at most this * amount, bound to the projection the issuer's result is later compared * with. The retry identity is the purchase's own digest, so the same * purchase proposed twice is one purchase. */ prepare(purchase: CardPurchase): Promise; /** The permit the issuer is answered with: this grant, for this intent, until it expires. */ execute(run: ClaimedExecution): Promise>; /** The issuer's result as the family's effect record; anything but a receipt is unknown. */ observe(effect: ExecutionEffect): Promise>; reconcile(): Promise>; } //# sourceMappingURL=CardAuthorizationExecutor.d.ts.map