import { URI } from "../../../../../../base/common/uri.js"; import { ContextKeyExpression } from "../../../../../../platform/contextkey/common/contextkey.js"; import { ExtensionIdentifier, IExtensionDescription } from "../../../../../../platform/extensions/common/extensions.js"; import { IChatModeInstructions, IVariableReference } from "../../chatModes.js"; import { PromptFileSource, PromptsType, Target } from "../promptTypes.js"; import { IHandOff, ParsedPromptFile } from "../promptFileParser.js"; import { ChatRequestHooks } from "../hookSchema.js"; /** * Entry emitted by the prompts service when discovery logging occurs. * A debug bridge (e.g. contribution) can listen and forward these to IChatDebugService. */ export interface IPromptDiscoveryLogEntry { readonly sessionResource: URI; readonly name: string; readonly details?: string; readonly category?: string; /** When present, the bridge should store this for later event resolution. */ readonly discoveryInfo?: IPromptDiscoveryInfo; } /** * Activation events for prompt file providers. */ export declare const CUSTOM_AGENT_PROVIDER_ACTIVATION_EVENT = "onCustomAgentProvider"; export declare const INSTRUCTIONS_PROVIDER_ACTIVATION_EVENT = "onInstructionsProvider"; export declare const PROMPT_FILE_PROVIDER_ACTIVATION_EVENT = "onPromptFileProvider"; export declare const SKILL_PROVIDER_ACTIVATION_EVENT = "onSkillProvider"; /** * Context for querying prompt files. */ export interface IPromptFileContext { } /** * Represents a prompt file resource from an external provider. */ export interface IPromptFileResource { /** * The URI to the agent or prompt resource file. */ readonly uri: URI; /** * Optional externally provided prompt command name. */ readonly name?: string; /** * Optional externally provided prompt command description. */ readonly description?: string; } /** * Where the prompt is stored. */ export declare enum PromptsStorage { local = "local", user = "user", extension = "extension", plugin = "plugin" } /** * Represents a prompt path with its type. * This is used for both prompt files and prompt source folders. */ export type IPromptPath = IExtensionPromptPath | ILocalPromptPath | IUserPromptPath | IPluginPromptPath; export interface IPromptPathBase { /** * URI of the prompt. */ readonly uri: URI; /** * Storage of the prompt. */ readonly storage: PromptsStorage; /** * Type of the prompt (e.g. 'prompt' or 'instructions'). */ readonly type: PromptsType; /** * Identifier of the contributing extension (only when storage === PromptsStorage.extension). */ readonly extension?: IExtensionDescription; /** * Identifier of the contributing plugin (only when storage === PromptsStorage.plugin). */ readonly pluginUri?: URI; /** * The source that produced this prompt path. */ readonly source?: PromptFileSource; readonly name?: string; readonly description?: string; } export interface IExtensionPromptPath extends IPromptPathBase { readonly storage: PromptsStorage.extension; readonly extension: IExtensionDescription; readonly source: PromptFileSource.ExtensionContribution | PromptFileSource.ExtensionAPI; readonly name?: string; readonly description?: string; readonly when?: string; } export declare function isExtensionPromptPath(obj: IPromptPath): obj is IExtensionPromptPath; export interface ILocalPromptPath extends IPromptPathBase { readonly storage: PromptsStorage.local; } export interface IUserPromptPath extends IPromptPathBase { readonly storage: PromptsStorage.user; } export interface IPluginPromptPath extends IPromptPathBase { readonly storage: PromptsStorage.plugin; readonly pluginUri: URI; readonly source: PromptFileSource.Plugin; } export type IAgentSource = { readonly storage: PromptsStorage.extension; readonly extensionId: ExtensionIdentifier; readonly type: PromptFileSource.ExtensionContribution | PromptFileSource.ExtensionAPI; } | { readonly storage: PromptsStorage.local | PromptsStorage.user; } | { readonly storage: PromptsStorage.plugin; readonly pluginUri: URI; }; /** * The visibility/availability of an agent. * - 'all': available as custom agent in picker AND can be used as subagent * - 'user': only available in the custom agent picker * - 'agent': only usable as subagent by the subagent tool * - 'hidden': neither in picker nor usable as subagent */ export type ICustomAgentVisibility = { readonly userInvocable: boolean; readonly agentInvocable: boolean; }; export declare function isCustomAgentVisibility(obj: unknown): obj is ICustomAgentVisibility; export interface ICustomAgent { /** * URI of a custom agent file. */ readonly uri: URI; /** * Name of the custom agent as used in prompt files or contexts */ readonly name: string; /** * Description of the agent */ readonly description?: string; /** * Tools metadata in the prompt header. */ readonly tools?: readonly string[]; /** * Model metadata in the prompt header. */ readonly model?: readonly string[]; /** * Argument hint metadata in the prompt header that describes what inputs the agent expects or supports. */ readonly argumentHint?: string; /** * Target of the agent: Copilot, VSCode, Claude, or undefined if not specified. */ readonly target: Target; /** * What visibility the agent has (user invocable, subagent invocable). */ readonly visibility: ICustomAgentVisibility; /** * Contents of the custom agent file body and other agent instructions. */ readonly agentInstructions: IChatModeInstructions; /** * Hand-offs defined in the custom agent file. */ readonly handOffs?: readonly IHandOff[]; /** * List of subagent names that can be used by the agent. * If empty, no subagents are available. If ['*'] or undefined, all agents can be used. */ readonly agents?: readonly string[]; /** * Lifecycle hooks scoped to this subagent. */ readonly hooks?: ChatRequestHooks; /** * Where the agent was loaded from. */ readonly source: IAgentSource; } export interface IAgentInstructions { readonly content: string; readonly toolReferences: readonly IVariableReference[]; readonly metadata?: Record; } export interface IChatPromptSlashCommand { readonly name: string; readonly description: string | undefined; readonly argumentHint: string | undefined; readonly promptPath: IPromptPath; readonly parsedPromptFile: ParsedPromptFile; readonly when: ContextKeyExpression | undefined; } /** * Supply-chain metadata describing where a skill originated. */ export interface IAgentSkill { readonly uri: URI; readonly storage: PromptsStorage; readonly name: string; readonly description: string | undefined; /** * If true, the skill should not be automatically loaded by the agent. * Use for workflows you want to trigger manually with /name. */ readonly disableModelInvocation: boolean; /** * If false, the skill is hidden from the / menu. * Use for background knowledge users shouldn't invoke directly. */ readonly userInvocable: boolean; /** * Optional context key expression. When set, the skill is only available * when this expression evaluates to true against a scoped context. */ readonly when?: ContextKeyExpression; /** * Optional plugin URI describing where this skill originated. */ readonly pluginUri?: URI; /** * Optional extension metadata describing where this skill originated. */ readonly extension?: IExtensionDescription; } /** * Type of agent instruction file. */ export declare enum AgentFileType { agentsMd = "agentsMd", claudeMd = "claudeMd", copilotInstructionsMd = "copilotInstructionsMd" } /** * Represents a resolved agent instruction file with its real path for duplicate detection. * Used by listAgentInstructions to filter out symlinks pointing to the same file. */ export interface IResolvedAgentFile { readonly uri: URI; /** * The real path of the file, if it is a symlink. */ readonly realPath: URI | undefined; readonly type: AgentFileType; } export interface Logger { logInfo(message: string): void; } /** * Reason why a prompt file was skipped during discovery. */ export type PromptFileSkipReason = "missing-name" | "missing-description" | "name-mismatch" | "duplicate-name" | "parse-error" | "disabled" | "all-hooks-disabled" | "claude-hooks-disabled" | "workspace-untrusted"; /** * Result of discovering a single prompt file. */ export interface IPromptFileDiscoveryResult { readonly status: "loaded" | "skipped"; readonly skipReason?: PromptFileSkipReason; /** Error message if parse-error */ readonly errorMessage?: string; /** For duplicates, the URI of the file that took precedence */ readonly duplicateOf?: URI; /** Prompt path for the discovered file. */ readonly promptPath: IPromptPath; /** Whether the skill is user-invocable in the / menu (set user-invocable: false to hide it) */ readonly userInvocable?: boolean; /** If true, the skill won't be automatically loaded by the agent (disable-model-invocation: true) */ readonly disableModelInvocation?: boolean; } /** * Diagnostic information about a source folder that was searched during discovery. */ export interface IPromptSourceFolderResult { readonly uri: URI; readonly storage: PromptsStorage; } /** * Summary of prompt file discovery for a specific type. */ export interface IPromptDiscoveryInfo { readonly type: PromptsType; readonly files: readonly IPromptFileDiscoveryResult[]; /** Source folders that were searched */ readonly sourceFolders?: readonly IPromptSourceFolderResult[]; } export interface IConfiguredHooksInfo { readonly hooks: ChatRequestHooks; readonly hasDisabledClaudeHooks: boolean; }