Path: blob/main/src/vscode-dts/vscode.proposed.chatPromptFiles.d.ts
5243 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45// version: 167declare module 'vscode' {8// #region Resource Classes910/**11* Represents a chat-related resource, such as a custom agent, instructions, prompt file, or skill.12*/13export interface ChatResource {14/**15* Uri to the chat resource. This is typically a `.agent.md`, `.instructions.md`, `.prompt.md`, or `SKILL.md` file.16*/17readonly uri: Uri;18}1920// #endregion2122// #region Providers2324/**25* A provider that supplies custom agent resources (from .agent.md files) for repositories.26*/27export interface ChatCustomAgentProvider {28/**29* An optional event to signal that custom agents have changed.30*/31readonly onDidChangeCustomAgents?: Event<void>;3233/**34* Provide the list of custom agents available.35* @param context Context for the provide call.36* @param token A cancellation token.37* @returns An array of custom agents or a promise that resolves to such.38*/39provideCustomAgents(context: unknown, token: CancellationToken): ProviderResult<ChatResource[]>;40}4142/**43* A provider that supplies instructions resources for repositories.44*/45export interface ChatInstructionsProvider {46/**47* An optional event to signal that instructions have changed.48*/49readonly onDidChangeInstructions?: Event<void>;5051/**52* Provide the list of instructions available.53* @param context Context for the provide call.54* @param token A cancellation token.55* @returns An array of instructions or a promise that resolves to such.56*/57provideInstructions(context: unknown, token: CancellationToken): ProviderResult<ChatResource[]>;58}5960/**61* A provider that supplies prompt file resources (from .prompt.md files) for repositories.62*/63export interface ChatPromptFileProvider {64/**65* An optional event to signal that prompt files have changed.66*/67readonly onDidChangePromptFiles?: Event<void>;6869/**70* Provide the list of prompt files available.71* @param context Context for the provide call.72* @param token A cancellation token.73* @returns An array of prompt files or a promise that resolves to such.74*/75providePromptFiles(context: unknown, token: CancellationToken): ProviderResult<ChatResource[]>;76}7778// #endregion7980// #region SkillProvider8182/**83* A provider that supplies SKILL.md resources for agents.84*/85export interface ChatSkillProvider {86/**87* An optional event to signal that skills have changed.88*/89readonly onDidChangeSkills?: Event<void>;9091/**92* Provide the list of skills available.93* @param context Context for the provide call.94* @param token A cancellation token.95* @returns An array of skill resources or a promise that resolves to such.96*/97provideSkills(context: unknown, token: CancellationToken): ProviderResult<ChatResource[]>;98}99100// #endregion101102// #region Chat Provider Registration103104export namespace chat {105/**106* Register a provider for custom agents.107* @param provider The custom agent provider.108* @returns A disposable that unregisters the provider when disposed.109*/110export function registerCustomAgentProvider(provider: ChatCustomAgentProvider): Disposable;111112/**113* Register a provider for instructions.114* @param provider The instructions provider.115* @returns A disposable that unregisters the provider when disposed.116*/117export function registerInstructionsProvider(provider: ChatInstructionsProvider): Disposable;118119/**120* Register a provider for prompt files.121* @param provider The prompt file provider.122* @returns A disposable that unregisters the provider when disposed.123*/124export function registerPromptFileProvider(provider: ChatPromptFileProvider): Disposable;125126/**127* Register a provider for skills.128* @param provider The skill provider.129* @returns A disposable that unregisters the provider when disposed.130*/131export function registerSkillProvider(provider: ChatSkillProvider): Disposable;132}133134// #endregion135}136137138