UNPKG

@adonis-agora/agent

Version:

Governed, durable-backed AI agent (chat + tool-calling + governance) for AdonisJS — part of the Agora ecosystem.

22 lines • 1.28 kB
export interface ApprovalCountdown { /** Milliseconds until the request lapses, floored at 0; `null` when it never does. */ remainingMs: number | null; /** The instant has passed. Always `false` for a request with no expiry. */ isExpired: boolean; } export interface UseApprovalCountdownOptions { /** How often the value re-renders while counting. Default 1000 — a seconds label needs no more. */ intervalMs?: number; /** Injectable clock for tests. */ now?: () => number; } /** What {@link useApprovalCountdown} reads for `expiresAt` at `now`, without the ticking. */ export declare function approvalCountdown(expiresAt: string | null | undefined, now?: number): ApprovalCountdown; /** * Time left on an approval request (`call.approval.expiresAt`), ticking until it lapses and then * holding at zero. Headless: pair `remainingMs` with `formatElapsed` or any label of your own, and * use `isExpired` to stop offering buttons the server would refuse (`410 Gone`). The server stays * the authority — a lapse is final only once the call settles `expired`. */ export declare function useApprovalCountdown(expiresAt: string | null | undefined, options?: UseApprovalCountdownOptions): ApprovalCountdown; //# sourceMappingURL=countdown.d.ts.map