import { IConfigurationService } from "../../../../../../platform/configuration/common/configuration.service.js"; import { URI } from "../../../../../../base/common/uri.js"; import { PromptsType } from "../promptTypes.js"; import { IPromptSourceFolder } from "./promptFileLocations.js"; /** * Configuration helper for the `reusable prompts` feature. * @see {@link PromptsConfig.PROMPT_LOCATIONS_KEY}, {@link PromptsConfig.INSTRUCTIONS_LOCATION_KEY}, {@link PromptsConfig.MODE_LOCATION_KEY}, or {@link PromptsConfig.PROMPT_FILES_SUGGEST_KEY}. * * ### Functions * * - {@link getLocationsValue} allows to current read configuration value * - {@link promptSourceFolders} gets list of source folders for prompt files * - {@link getPromptFilesRecommendationsValue} gets prompt file recommendation configuration * * ### File Paths Resolution * * We resolve only `*.prompt.md` files inside the resulting source folders. Relative paths are resolved * relative to: * * - the current workspace `root`, if applicable, in other words one of the workspace folders * can be used as a prompt files source folder * - root of each top-level folder in the workspace (if there are multiple workspace folders) * - current root folder (if a single folder is open) * * ### Prompt File Suggestions * * The `chat.promptFilesRecommendations` setting allows configuring which prompt files to suggest in different contexts: * * ```json * { * "chat.promptFilesRecommendations": { * "plan": true, // Always suggest * "new-page": "resourceExtname == .js", // Suggest for JavaScript files * "draft-blog": "resourceLangId == markdown", // Suggest for Markdown files * "debug": false // Never suggest * } * } * ``` */ export declare namespace PromptsConfig { /** * Configuration key for the locations of reusable prompt files. */ const PROMPT_LOCATIONS_KEY = "chat.promptFilesLocations"; /** * Configuration key for the locations of instructions files. */ const INSTRUCTIONS_LOCATION_KEY = "chat.instructionsFilesLocations"; /** * Configuration key for the locations of mode files. * @deprecated Use {@link AGENTS_LOCATION_KEY} instead */ const MODE_LOCATION_KEY = "chat.modeFilesLocations"; /** * Configuration key for the locations of agent files (with simplified path support). */ const AGENTS_LOCATION_KEY = "chat.agentFilesLocations"; /** * Configuration key for the locations of skill folders. */ const SKILLS_LOCATION_KEY = "chat.agentSkillsLocations"; /** * Configuration key for the locations of hook files. */ const HOOKS_LOCATION_KEY = "chat.hookFilesLocations"; /** * Configuration key for prompt file suggestions. */ const PROMPT_FILES_SUGGEST_KEY = "chat.promptFilesRecommendations"; /** * Configuration key for use of the copilot instructions file. */ const USE_COPILOT_INSTRUCTION_FILES = "github.copilot.chat.codeGeneration.useInstructionFiles"; /** * Configuration key for the AGENTS.md. */ const USE_AGENT_MD = "chat.useAgentsMdFile"; /** * Configuration key for nested AGENTS.md files. */ const USE_NESTED_AGENT_MD = "chat.useNestedAgentsMdFiles"; /** * Configuration key for the CLAUDE.md. */ const USE_CLAUDE_MD = "chat.useClaudeMdFile"; /** * Configuration key for agent skills usage. */ const USE_AGENT_SKILLS = "chat.useAgentSkills"; /** * Configuration key for chat hooks usage. */ const USE_CHAT_HOOKS = "chat.useHooks"; /** * Configuration key for enabling Claude hooks. */ const USE_CLAUDE_HOOKS = "chat.useClaudeHooks"; /** * Configuration key for enabling hooks defined in custom agent frontmatter. */ const USE_CUSTOM_AGENT_HOOKS = "chat.useCustomAgentHooks"; /** * Configuration key for enabling stronger skill adherence prompt (experimental). */ const USE_SKILL_ADHERENCE_PROMPT = "chat.experimental.useSkillAdherencePrompt"; /** * Configuration key for including applying instructions. */ const INCLUDE_APPLYING_INSTRUCTIONS = "chat.includeApplyingInstructions"; /** * Configuration key for including referenced instructions. */ const INCLUDE_REFERENCED_INSTRUCTIONS = "chat.includeReferencedInstructions"; /** * Get value of the `reusable prompt locations` configuration setting. * @see {@link PROMPT_LOCATIONS_CONFIG_KEY}, {@link INSTRUCTIONS_LOCATIONS_CONFIG_KEY}, {@link MODE_LOCATIONS_CONFIG_KEY}, {@link SKILLS_LOCATION_KEY}. */ function getLocationsValue(configService: IConfigurationService, type: PromptsType): Record | undefined; /** * Gets list of source folders for prompt files. * Defaults to {@link PROMPT_DEFAULT_SOURCE_FOLDER}, {@link INSTRUCTIONS_DEFAULT_SOURCE_FOLDER}, {@link MODE_DEFAULT_SOURCE_FOLDER} or {@link SKILLS_LOCATION_KEY}. */ function promptSourceFolders(configService: IConfigurationService, type: PromptsType): IPromptSourceFolder[]; /** * Get value of the prompt file recommendations configuration setting. * @param configService Configuration service instance * @param resource Optional resource URI to get workspace folder-specific settings * @see {@link PROMPT_FILES_SUGGEST_KEY}. */ function getPromptFilesRecommendationsValue(configService: IConfigurationService, resource?: URI): Record | undefined; } export declare function getPromptFileLocationsConfigKey(type: PromptsType): string; /** * Helper to parse an input value of `any` type into a boolean. * * @param value - input value to parse * @returns `true` if the value is the boolean `true` value or a string that can * be clearly mapped to a boolean (e.g., `"true"`, `"TRUE"`, `"FaLSe"`, etc.), * `undefined` for rest of the values */ export declare function asBoolean(value: unknown): boolean | undefined; /** * Helper to check if a path starts with tilde (user home). * Only supports Unix-style (`~/`) paths for cross-platform sharing. * Backslash paths (`~\`) are not supported to ensure paths are shareable in repos. * * @param path - path to check * @returns `true` if the path starts with `~/` */ export declare function isTildePath(path: string): boolean;