import type { AuditApproval, AuditIdentityAssurance } from "./types.js"; declare const auditAttributionBrand: unique symbol; interface AuditAttributionFields { caller: string; threadId?: string; turnId?: string; runId?: string; networkProtocol?: "a2a" | "mcp" | "provider-api"; networkId?: string; networkPeer?: string; approvedToolCallKey?: string; mcpClient?: { name?: string; version?: string; oauthClientId?: string; }; mcpClientAccepted?: true; approval?: AuditApproval; identityAssurance?: AuditIdentityAssurance; } /** * Where an audited call came from and what vouched for it: its source, the * MCP client it reported, the OAuth client of its credential, verified A2A * identity assurance, the approval signal, and its run and network ids. `recordActionAudit` requires one and * only {@link auditAttribution} makes one, so a recorder cannot build its own * context and store nulls for a field it forgot. */ export type AuditAttribution = Readonly & { readonly [auditAttributionBrand]: true; }; /** * Values one invocation's audit rows record in place of its run's own. An * approved A2A replay links its rows to the paused task and names the review * page, without running in that task's journal or ledger. Held by that * invocation's execution frame, never by its context. */ export type AuditOverride = Partial>; /** * The run context attribution reads from; an `ActionRunContext` is one. * Approval is not read from it: a context can be handed to another action. */ export type AuditAttributionSource = Partial>; /** A recorder was given no attribution, or one `auditAttribution` did not make. */ export declare class AuditAttributionError extends Error { constructor(recorder: string); } export declare function assertAuditAttribution(value: unknown, recorder: string): asserts value is AuditAttribution; /** * Attribution for a write made inside an action, from its run context and the * evidence of the invocation running now. With no context the source is * `http`. */ export declare function auditAttribution(ctx: AuditAttributionSource | undefined): AuditAttribution; /** * Attribution for a write a Nitro route makes outside any action: `mcp` with * the credential's OAuth client when the request authenticated with a * verified MCP credential, else `http`. */ export declare function routeAuditAttribution(event: { context?: Record; }): AuditAttribution; export {};