/** * Canonical Grantex scope-matching semantics (SPEC §4.1). * * A scope is `resource:action[:constraint]`. Matching is exact: a granted * scope satisfies a required scope only when the two strings are identical. * In particular a constrained scope (`payments:initiate:max_500`) is never * satisfied by its unconstrained form, and vice versa — the constraint is * part of the permission, not a suffix to be prefix-matched away. * * Adapters that add their own wildcard sugar MUST reduce to these rules for * every non-wildcard scope (see `@grantex/x402`'s `scopeMatches`). */ export interface ParsedScope { resource: string; action: string; constraint?: string; } /** Splits `resource:action[:constraint]`; returns undefined for malformed scopes. */ export declare function parseScope(scope: string): ParsedScope | undefined; /** True when `granted` satisfies `required` — exact string equality. */ export declare function scopeMatches(granted: string, required: string): boolean; /** True when a required scope is satisfied by at least one granted scope. */ export declare function hasScope(grantedScopes: readonly string[], required: string): boolean; /** Required scopes not covered by the granted set (empty when all are satisfied). */ export declare function missingScopes(grantedScopes: readonly string[], requiredScopes: readonly string[]): string[]; //# sourceMappingURL=scopes.d.ts.map