
import { isEqualOrParent } from '../../../../base/common/resources.js';
import { PromptsStorage } from './promptSyntax/service/promptsService.js';

var AICustomizationSources;
(function(AICustomizationSources) {
    AICustomizationSources.local = "local";
    AICustomizationSources.user = "user";
    AICustomizationSources.extension = "extension";
    AICustomizationSources.plugin = "plugin";
    AICustomizationSources.builtin = "builtin";
    AICustomizationSources.all = [
        AICustomizationSources.local,
        AICustomizationSources.user,
        AICustomizationSources.extension,
        AICustomizationSources.plugin,
        AICustomizationSources.builtin
    ];
})(AICustomizationSources || (AICustomizationSources = {}));
const BUILTIN_STORAGE = AICustomizationSources.builtin;
const AICustomizationManagementSection = {
    Agents: "agents",
    Skills: "skills",
    Instructions: "instructions",
    Prompts: "prompts",
    Hooks: "hooks",
    McpServers: "mcpServers",
    Plugins: "plugins",
    Models: "models"
};
function applyStorageSourceFilter(items, filter) {
    const sourceSet = ( new Set(filter.sources));
    return items.filter(item => {
        if (!( sourceSet.has(item.storage))) {
            return false;
        }
        if (item.storage === PromptsStorage.user && filter.includedUserFileRoots) {
            return ( filter.includedUserFileRoots.some(root => isEqualOrParent(item.uri, root)));
        }
        return true;
    });
}

export { AICustomizationManagementSection, AICustomizationSources, BUILTIN_STORAGE, applyStorageSourceFilter };
