import { Tool } from './types.js'; /** * Filters the provided tools collection based on specified glob patterns and readOnly flag. * This function processes the input patterns against available tools to determine * which tools should be returned. It handles special cases like wildcard patterns, * empty pattern arrays, and pattern matching errors. When readOnly is true, * it only returns tools that have _meta.readOnly set to true or tools that follow read-only patterns. * * IMPORTANT: The readOnly flag takes priority over pattern matching for security reasons. * Even if patterns match non-read-only tools, when readOnly=true is specified, * only read-only tools will be returned. * * @param allTools - Complete collection of available tools to be filtered * @param patterns - Optional glob patterns to filter tools by (e.g., 'ziti*', 'jwt-*') * If omitted or empty, all tools will be returned * A single '*' pattern will return all tools * @param readOnly - Optional flag to only return read-only tools * When true, only returns tools marked as readOnly * Takes priority over pattern matching for security * @returns Array of Tool objects that match the specified criteria * Returns all tools if no patterns provided or on error * * @example * // Return all tools that start with "auth" * const authTools = getAvailableTools(tools, ['auth*']); * * @example * // Return all read-only tools (regardless of pattern matching) * const readOnlyTools = getAvailableTools(tools, ['*'], true); * * @example * // Return only read-only tools that match the pattern * // Note: --read-only takes priority, so even if the pattern matches non-read-only tools, * // only the read-only ones will be returned * const readOnlyAuthTools = getAvailableTools(tools, ['*Identities'], true); */ export declare function getAvailableTools(allTools: Tool[], patterns?: string[], readOnly?: boolean): Tool[]; /** * Validates tool patterns against available tools to ensure each pattern matches at least one tool. * This function verifies that each provided pattern (including glob patterns) corresponds to * at least one available tool, throwing specific errors for different validation scenarios. * * @param patterns - Array of tool name patterns to validate * Can include glob patterns with wildcards (e.g., 'ziti*') * Empty array or undefined will skip validation * @param availableTools - Collection of Tool objects to validate patterns against * * @throws {Error} If availableTools is not a valid array or is empty * @throws {Error} If any pattern doesn't match at least one tool name, with different * error messages for exact matches vs. wildcard patterns * * @example * // Validate specific tool names * validatePatterns(['ziti-jwt', 'ziti-management'], tools); * * @example * // Validate with glob patterns * validatePatterns(['ziti*', 'jwt-*'], tools); * * @see {@link Glob} for the pattern matching implementation * @see {@link getAvailableTools} for filtering tools using these patterns */ export declare function validatePatterns(patterns: string[], availableTools: Tool[]): void;