Path: blob/main/src/vscode-dts/vscode.proposed.chatPromptFiles.d.ts
4770 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' {89// #region CustomAgentProvider1011/**12* Represents a custom agent resource file (e.g., .agent.md) available for a repository.13*/14export interface CustomAgentResource {15/**16* The URI to the custom agent resource file.17*/18readonly uri: Uri;1920/**21* Indicates whether the custom agent is editable. Defaults to false.22*/23readonly isEditable?: boolean;24}2526/**27* Context for querying custom agents.28*/29export type CustomAgentContext = object;3031/**32* A provider that supplies custom agent resources (from .agent.md files) for repositories.33*/34export interface CustomAgentProvider {35/**36* A human-readable label for this provider.37*/38readonly label: string;3940/**41* An optional event to signal that custom agents have changed.42*/43readonly onDidChangeCustomAgents?: Event<void>;4445/**46* Provide the list of custom agents available.47* @param context Context for the query.48* @param token A cancellation token.49* @returns An array of custom agent resources or a promise that resolves to such.50*/51provideCustomAgents(context: CustomAgentContext, token: CancellationToken): ProviderResult<CustomAgentResource[]>;52}5354// #endregion5556// #region InstructionsProvider5758/**59* Represents an instructions resource file available for a repository.60*/61export interface InstructionsResource {62/**63* The URI to the instructions resource file.64*/65readonly uri: Uri;6667/**68* Indicates whether the instructions are editable. Defaults to false.69*/70readonly isEditable?: boolean;71}7273/**74* Context for querying instructions.75*/76export type InstructionsContext = object;7778/**79* A provider that supplies instructions resources for repositories.80*/81export interface InstructionsProvider {82/**83* A human-readable label for this provider.84*/85readonly label: string;8687/**88* An optional event to signal that instructions have changed.89*/90readonly onDidChangeInstructions?: Event<void>;9192/**93* Provide the list of instructions available.94* @param context Context for the query.95* @param token A cancellation token.96* @returns An array of instructions resources or a promise that resolves to such.97*/98provideInstructions(context: InstructionsContext, token: CancellationToken): ProviderResult<InstructionsResource[]>;99}100101// #endregion102103// #region PromptFileProvider104105/**106* Represents a prompt file resource (e.g., .prompt.md) available for a repository.107*/108export interface PromptFileResource {109/**110* The URI to the prompt file resource.111*/112readonly uri: Uri;113114/**115* Indicates whether the prompt file is editable. Defaults to false.116*/117readonly isEditable?: boolean;118}119120/**121* Context for querying prompt files.122*/123export type PromptFileContext = object;124125/**126* A provider that supplies prompt file resources (from .prompt.md files) for repositories.127*/128export interface PromptFileProvider {129/**130* A human-readable label for this provider.131*/132readonly label: string;133134/**135* An optional event to signal that prompt files have changed.136*/137readonly onDidChangePromptFiles?: Event<void>;138139/**140* Provide the list of prompt files available.141* @param context Context for the query.142* @param token A cancellation token.143* @returns An array of prompt file resources or a promise that resolves to such.144*/145providePromptFiles(context: PromptFileContext, token: CancellationToken): ProviderResult<PromptFileResource[]>;146}147148// #endregion149150// #region Chat Provider Registration151152export namespace chat {153/**154* Register a provider for custom agents.155* @param provider The custom agent provider.156* @returns A disposable that unregisters the provider when disposed.157*/158export function registerCustomAgentProvider(provider: CustomAgentProvider): Disposable;159160/**161* Register a provider for instructions.162* @param provider The instructions provider.163* @returns A disposable that unregisters the provider when disposed.164*/165export function registerInstructionsProvider(provider: InstructionsProvider): Disposable;166167/**168* Register a provider for prompt files.169* @param provider The prompt file provider.170* @returns A disposable that unregisters the provider when disposed.171*/172export function registerPromptFileProvider(provider: PromptFileProvider): Disposable;173}174175// #endregion176}177178179