import type { InterruptResponse } from "../runtime/interrupts.js"; /** What a `std::guard` interrupt carries (see docs/site/guide/guards.md, * "The interrupt payload"). */ export type GuardTripData = { dimension: "cost" | "time"; limit: number; spent: number; label: string | null; draftValue: unknown; }; export declare function isGuardTrip(effect: string, data: unknown): data is GuardTripData; /** Which guard tripped and what it spent against its limit. */ export declare function describeGuardTrip(data: GuardTripData): string; /** What a reject may give back. The draft is a preview of the innermost * saved draft; a `finalize` can replace it, so it is not a promise. */ export declare function draftNote(data: GuardTripData): string; /** The three ways to answer a trip, in the order the form lists them. */ export type GuardChoice = "grant" | "removeLimit" | "reject"; export declare function guardChoices(data: GuardTripData): { choice: GuardChoice; label: string; }[]; export declare function amountPrompt(data: GuardTripData): string; export declare const MESSAGE_PROMPT = "Message to the model (optional)"; /** The amount a person typed, in the dimension's unit: dollars, or * milliseconds written as the guide's unit literals (`100ms`, `30s`, * `2m`, `1h`) or a bare number. Null when it is not an amount. */ export declare function parseAmount(dimension: "cost" | "time", text: string): number | null; /** Why a grant of `amount` would be refused by the runtime, or null when * it clears the trip. The runtime throws on an answer that leaves the * tripped budget exceeded, since the guard would trip again at once. */ export declare function checkGrant(data: GuardTripData, amount: number): string | null; /** The response the runtime understands for a choice: `approve` with a * grant on the tripped dimension, with its disarm, or `reject`. */ export declare function guardResponse(data: GuardTripData, choice: GuardChoice, amount: number | null, message: string): InterruptResponse;