mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-02 00:09:30 +01:00
Send extension ID for customizations (#305796)
This commit is contained in:
@@ -561,15 +561,16 @@ const newCommands: ApiCommand[] = [
|
||||
new ApiCommand(
|
||||
'vscode.extensionPromptFileProvider', '_listExtensionPromptFiles', 'Get all extension-contributed prompt files (custom agents, instructions, and prompt files).',
|
||||
[],
|
||||
new ApiCommandResult<IExtensionPromptFileResult[], { uri: vscode.Uri; type: PromptsType }[]>(
|
||||
'A promise that resolves to an array of objects containing uri and type.',
|
||||
new ApiCommandResult<IExtensionPromptFileResult[], { uri: vscode.Uri; type: PromptsType; extensionId: string }[]>(
|
||||
'A promise that resolves to an array of objects containing uri, type, and extensionId.',
|
||||
(value) => {
|
||||
if (!value) {
|
||||
return [];
|
||||
}
|
||||
return value.map(item => ({
|
||||
uri: URI.revive(item.uri),
|
||||
type: item.type
|
||||
type: item.type,
|
||||
extensionId: item.extensionId
|
||||
}));
|
||||
}
|
||||
)
|
||||
|
||||
@@ -157,6 +157,7 @@ export class ChatPromptFilesExtensionPointHandler implements IWorkbenchContribut
|
||||
export interface IExtensionPromptFileResult {
|
||||
readonly uri: UriComponents;
|
||||
readonly type: PromptsType;
|
||||
readonly extensionId: string;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -178,7 +179,7 @@ CommandsRegistry.registerCommand('_listExtensionPromptFiles', async (accessor):
|
||||
const result: IExtensionPromptFileResult[] = [];
|
||||
for (const file of [...agents, ...instructions, ...prompts, ...skills, ...hooks]) {
|
||||
if (file.storage === PromptsStorage.extension) {
|
||||
result.push({ uri: file.uri.toJSON(), type: file.type });
|
||||
result.push({ uri: file.uri.toJSON(), type: file.type, extensionId: file.extension.identifier.value });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user