import { CancellationToken } from "../../../../../../base/common/cancellation.js"; import { Event } from "../../../../../../base/common/event.js"; import { IDisposable } from "../../../../../../base/common/lifecycle.js"; import { ResourceSet } from "../../../../../../base/common/map.js"; import { URI } from "../../../../../../base/common/uri.js"; import { ITextModel } from "../../../../../../editor/common/model.js"; import { IExtensionDescription } from "../../../../../../platform/extensions/common/extensions.js"; import { IResolvedPromptSourceFolder } from "../config/promptFileLocations.js"; import { ParsedPromptFile } from "../promptFileParser.js"; import { PromptsType } from "../promptTypes.js"; import { IPromptPath, PromptsStorage, IChatPromptSlashCommand, ICustomAgent, IResolvedAgentFile, Logger, IPromptFileContext, IPromptFileResource, IAgentSkill, IPromptDiscoveryInfo, IConfiguredHooksInfo, IPromptDiscoveryLogEntry } from "./promptsService.js"; /** * Provides prompt services. */ export declare const IPromptsService: import("../../../../../../platform/instantiation/common/instantiation.js").ServiceIdentifier; /** * Provides prompt services. */ export interface IPromptsService extends IDisposable { readonly _serviceBrand: undefined; /** * The parsed prompt file for the provided text model. * @param textModel Returns the parsed prompt file. */ getParsedPromptFile(textModel: ITextModel): ParsedPromptFile; /** * List all available prompt files. */ listPromptFiles(type: PromptsType, token: CancellationToken): Promise; /** * List all available prompt files. */ listPromptFilesForStorage(type: PromptsType, storage: PromptsStorage, token: CancellationToken): Promise; /** * Get a list of prompt source folders based on the provided prompt type. */ getSourceFolders(type: PromptsType): Promise; /** * Get a list of resolved prompt source folders with full metadata. * This includes displayPath, isDefault, and storage information. * Used for diagnostics and config-info displays. */ getResolvedSourceFolders(type: PromptsType): Promise; /** * Validates if the provided command name is a valid prompt slash command. */ isValidSlashCommandName(name: string): boolean; /** * Gets the prompt file for a slash command. */ resolvePromptSlashCommand(command: string, token: CancellationToken): Promise; /** * Event that is triggered when the slash command to ParsedPromptFile cache is updated. * Event handlers can use {@link resolvePromptSlashCommand} to retrieve the latest data. */ readonly onDidChangeSlashCommands: Event; /** * Returns a prompt command if the command name is valid. * @param sessionResource Optional session resource to scope debug logging to a specific session. */ getPromptSlashCommands(token: CancellationToken, sessionResource?: URI): Promise; /** * Returns the prompt command name for the given URI. */ getPromptSlashCommandName(uri: URI, token: CancellationToken): Promise; /** * Event that is triggered when the list of custom agents changes. */ readonly onDidChangeCustomAgents: Event; /** * Event that is triggered when the list of instruction files changes. */ readonly onDidChangeInstructions: Event; /** * Finds all available custom agents * @param sessionResource Optional session resource to scope debug logging to a specific session. */ getCustomAgents(token: CancellationToken, sessionResource?: URI): Promise; /** * Parses the provided URI * @param uris */ parseNew(uri: URI, token: CancellationToken): Promise; /** * Internal: register a contributed file. Returns a disposable that removes the contribution. * Not intended for extension authors; used by contribution point handler. */ registerContributedFile(type: PromptsType, uri: URI, extension: IExtensionDescription, name: string | undefined, description: string | undefined, when?: string): IDisposable; getPromptLocationLabel(promptPath: IPromptPath): string; /** * Gets list of AGENTS.md files, including optionally nested ones from subfolders. */ listNestedAgentMDs(token: CancellationToken): Promise; /** * Gets combined list of agent instruction files (AGENTS.md, CLAUDE.md, copilot-instructions.md). * Combines results from listAgentMDs (non-nested), listClaudeMDs, and listCopilotInstructionsMDs. */ listAgentInstructions(token: CancellationToken, logger?: Logger): Promise; /** * For a chat mode file URI, return the name of the agent file that it should use. * @param oldURI */ getAgentFileURIFromModeFile(oldURI: URI): URI | undefined; /** * Returns the list of disabled prompt file URIs for a given type. By default no prompt files are disabled. */ getDisabledPromptFiles(type: PromptsType): ResourceSet; /** * Persists the set of disabled prompt file URIs for the given type. */ setDisabledPromptFiles(type: PromptsType, uris: ResourceSet): void; /** * Registers a prompt file provider that can provide prompt files for repositories. * @param extension The extension registering the provider. * @param type The type of contribution. * @param provider The provider implementation with optional change event. * @returns A disposable that unregisters the provider when disposed. */ registerPromptFileProvider(extension: IExtensionDescription, type: PromptsType, provider: { onDidChangePromptFiles?: Event; providePromptFiles: (context: IPromptFileContext, token: CancellationToken) => Promise; }): IDisposable; /** * Gets list of agent skills files. * @param sessionResource Optional session resource to scope debug logging to a specific session. */ findAgentSkills(token: CancellationToken, sessionResource?: URI): Promise; /** * Event that is triggered when the list of skills changes. */ readonly onDidChangeSkills: Event; /** * Gets detailed discovery information for a prompt type. * This includes all files found and their load/skip status with reasons. * Used for diagnostics and config-info displays. * @param sessionResource Optional session resource to scope debug logging to a specific session. */ getPromptDiscoveryInfo(type: PromptsType, token: CancellationToken, sessionResource?: URI): Promise; /** * Gets all hooks collected from hooks.json files. * The result is cached and invalidated when hook files change. * @param sessionResource Optional session resource to scope debug logging to a specific session. */ getHooks(token: CancellationToken, sessionResource?: URI): Promise; /** * Gets all instruction files, logging discovery info to the debug log. * @param sessionResource Optional session resource to scope debug logging to a specific session. */ getInstructionFiles(token: CancellationToken, sessionResource?: URI): Promise; /** * Fired when a discovery-related log entry is produced. * Listeners (such as a debug bridge) can forward these to IChatDebugService. */ readonly onDidLogDiscovery: Event; }