/** * Resource Resolver - Dual-source resource resolution * * Resolves resources (agents, commands, prompts, templates) from two sources: * 1. Project overrides: .valora/{type}/ (highest priority) * 2. Package built-ins: data/{type}/ (fallback) * * Project-level resources override built-in ones when they share the same name. */ export interface ResourceInfo { name: string; path: string; source: 'builtin' | 'project'; } export type ResourceType = 'agents' | 'commands' | 'hooks' | 'prompts' | 'templates'; export declare class ResourceResolver { private readonly packageDataDir; private readonly pluginDirs; private readonly projectConfigDir; constructor(); /** * Register a plugin directory as an allowed resource location. * Must be called before any loader attempts to use the plugin directory. */ registerPluginDir(dir: string): void; /** * Get ordered list of directories to search for a resource type. * Project directory comes first (higher priority), then package directory. */ getSources(resourceType: ResourceType): string[]; /** * Resolve the path to a single resource file. * Project override wins over built-in. */ resolveResource(resourceType: ResourceType, name: string): null | string; /** * Resolve a resource directory path. * Returns the first existing directory: project override, then package built-in. * For loaders that need a single directory path. */ resolveResourceDir(resourceType: ResourceType): string; /** * List all resources from both sources, merged with deduplication. * Project overrides take precedence when names collide. */ listResources(resourceType: ResourceType, extension?: string): ResourceInfo[]; /** * Get the package data directory path. */ getPackageDataDir(): string; /** * Get the project config directory path, or null if not in a project. */ getProjectConfigDir(): null | string; /** * Check if a directory is within the package data dir, project config dir, or a registered plugin dir. * Used for security validation. */ isAllowedDirectory(dirPath: string): boolean; private addResourcesFromDir; } export declare function getResourceResolver(): ResourceResolver; export declare function resetResourceResolver(): void; //# sourceMappingURL=resource-resolver.d.ts.map