/** * Permission syntax parser. * * Parses --allow and --deny CLI arguments into PermissionConfig. * * Bash patterns require an explicit trailing wildcard (*) to indicate * prefix matching. Patterns without wildcards will throw an error. * * @example * parsePermissions( * ["read,glob,bash:git *"], * ["bash:rm*"] * ) * // Returns: * // { * // allow: [ * // { type: "tool", name: "read" }, * // { type: "tool", name: "glob" }, * // { type: "bash", pattern: "git *" } * // ], * // deny: [ * // { type: "bash", pattern: "rm*" } * // ] * // } */ import type { PermissionConfig, PermissionRule } from "./types.js"; /** * Parse a single permission rule string. * * Supported formats: * - "read" → { type: "tool", name: "read" } * - "bash:git *" → { type: "bash", pattern: "git *" } * - "read:src/**" → { type: "path", tool: "read", pattern: "src/**" } */ declare function parseRule(rule: string): PermissionRule; /** * Parse a comma-separated list of permission rules. */ declare function parseRuleList(input: string): PermissionRule[]; /** * Parse --allow and --deny arguments into PermissionConfig. * * @param allow - Array of comma-separated allow rules * @param deny - Array of comma-separated deny rules * @returns Parsed permission configuration * @throws Error if any rule is invalid */ declare function parsePermissions(allow?: string[], deny?: string[]): PermissionConfig; /** * Format a permission rule for display. */ declare function formatRule(rule: PermissionRule): string; export { formatRule, parsePermissions, parseRule, parseRuleList };