UNPKG

@toolprint/hypertool-mcp

Version:

HyperTool MCP proxy server for routing requests between clients and multiple underlying MCP servers

85 lines • 3.03 kB
/** * File system scanner for persona discovery * * This module provides comprehensive file system scanning functionality to discover * persona folders and archives in standard and custom locations. It handles permissions * gracefully, respects .gitignore patterns, and implements depth-limited traversal. * * @fileoverview Persona file system scanner with robust error handling */ import type { PersonaReference, PersonaDiscoveryConfig } from "./types.js"; /** * File system scanner options */ interface ScannerOptions { /** Maximum depth for recursive scanning */ maxDepth?: number; /** Whether to follow symbolic links */ followSymlinks?: boolean; /** Additional ignore patterns */ ignorePatterns?: string[]; /** Whether to enable parallel scanning */ parallel?: boolean; } /** * Scan result including personas, errors, and warnings */ export interface ScanResult { /** Discovered persona references */ personas: PersonaReference[]; /** Errors encountered during scanning */ errors: string[]; /** Warnings encountered during scanning */ warnings: string[]; } /** * Scan for persona folders and archives in configured locations * * @param config Discovery configuration with additional paths and options * @returns Promise resolving to scan result with personas and errors */ export declare function scanForPersonas(config?: PersonaDiscoveryConfig): Promise<ScanResult>; /** * Scan a specific directory for personas * * @param dirPath Path to directory to scan * @param options Scanner options * @returns Promise resolving to array of discovered persona references */ export declare function scanDirectory(dirPath: string, options?: Partial<ScannerOptions>): Promise<PersonaReference[]>; /** * Check if a path appears to be a valid persona folder * * @param dirPath Path to check * @returns Promise resolving to true if path contains persona configuration */ export declare function isPersonaDirectory(dirPath: string): Promise<boolean>; /** * Check if a path is a valid persona archive * * @param filePath Path to check * @returns Promise resolving to true if path is a supported persona archive */ export declare function isPersonaArchive(filePath: string): Promise<boolean>; /** * Get configured persona search path * * @returns Array with single configured persona directory path */ export declare function getStandardSearchPaths(): string[]; /** * Validate that a search path exists and is accessible * * @param path Path to validate * @returns Promise resolving to true if path is valid for scanning */ export declare function validateSearchPath(path: string): Promise<boolean>; /** * Check if scanning would find any personas without doing a full scan * * @param config Discovery configuration * @returns Promise resolving to true if scanning would likely find personas */ export declare function hasPersonasInPaths(config?: PersonaDiscoveryConfig): Promise<boolean>; export {}; //# sourceMappingURL=scanner.d.ts.map