import { type CredentialState } from "../agent/engine/credential-state.js"; /** * Failure rates as events instead of anecdotes. A failure class that repeats * (a rejected key, a missing provider, an action returning 5xx) would otherwise * mean one analytics event per occurrence, so each (event, dimensions) pair is * counted in a window and shipped as `count`: the first occurrence immediately, * then one event per window carrying the rest. `SUM(count)` is the exact total * whichever way the events were flushed. * * Dimensions are bounded tokens (action names, error codes, state kinds) and * never ids or addresses; state is bounded and folds into one overflow key. */ export declare const FAILURE_COUNT_EVENTS: { readonly actionErrors: "action_error_counts"; readonly credentialState: "credential_state_counts"; readonly attachmentOutcomes: "attachment_outcome_counts"; }; export declare function resetFailureCountersForTests(): void; /** * Count one occurrence of a bounded outcome class under a `_counts` * event, for code outside core that has its own classes to chart (a template's * cooldowns, a provider's quota). Dimensions are tokens, never ids or * addresses. A name that breaks the convention is reported once and dropped, * so a typo cannot throw into the code path being measured. */ export declare function countOutcome(event: string, dimensions: Record): void; /** * One attachment mint, resolve or delete, with how it ended. Successes are * counted too, so a failure is a rate and not just a number. */ export declare function countAttachmentOutcome(input: { operation: "mint" | "resolve" | "delete"; status: string; reason?: string; whoCanFix?: string; }): void; /** * One action request that ended in a failure. `errorCode` is the typed code the * action raised (`validation` and `untyped` stand in when there is none), so the * chart separates expected typed states from bare 500s. */ export declare function countActionFailure(input: { action: string; status: number; errorCode?: string; caller?: string; }): void; /** A credential state other than `usable` was shown to a user or an owner. */ export declare function countCredentialState(state: CredentialState, source: "credit_notice" | "action_route" | "automation"): void;