import type { ActionIntent } from '../types/policy.js'; /** * Intent shape accepted by computeActionRef. Identical to the ActionIntent * pick except that scopeRequired additionally admits a readonly string array, * the form draft-pidlisnyi-aps-03 §4.1 defines for the native preimage. * ActionIntent itself still types scopeRequired as a single string; widening * that type is outside this module (see types/policy.ts). */ export type ActionRefIntent = Omit, 'action'> & { action: Omit & { scopeRequired: ActionIntent['action']['scopeRequired'] | readonly string[]; }; }; /** Raised when scopeRequired carries two elements that are equal after NFC * normalization. draft-pidlisnyi-aps-03 §4.1 defines scope_required as a * duplicate-free array, so a duplicated array has no canonical form and is * rejected rather than deduplicated: an equality key must not map distinct * inputs onto one value silently. Subclasses the built-in Error so any * existing handler that catches Error (or `catch (e)`) still catches it and * fails closed. */ export declare class DuplicateScopeRequiredError extends Error { readonly code = "ERR_DUPLICATE_SCOPE_REQUIRED"; /** Stable machine-readable category, shared across the APS SDKs. */ readonly category = "invalid_scope_required"; /** Specific failure within the category. */ readonly reason = "duplicate_scope_required"; constructor(message: string); } export declare function computeActionRef(intent: ActionRefIntent): string; /** Write-boundary twin of computeActionRef(). * * Module-internal on purpose: absent from every barrel, so this adds no public API. * The exported computeActionRef() stays unrestricted, because a verifier re-deriving * the action_ref of an intent signed before this rule must still get the same value. * Mirrors the Python SDK's treatment of the sibling attribution primitive. */ export declare function computeActionRefForWrite(intent: ActionRefIntent): string; /** * Two receipts with the same action_ref describe the same request. * Simple equality check — provided as a named predicate so the semantic * intent is explicit at the call site. */ export declare function actionRefsMatch(a: string, b: string): boolean; //# sourceMappingURL=action-ref.d.ts.map