537
return commands.filter(command => matchesSessionType(command.sessionTypes, sessionType));
538
}
540
>
const items = await harness.itemProvider.provideChatSessionCustomizations(sessionResource, token);
541
>
if (!items) {
542
return [];
543
}
545
>
for (const item of items) {
546
>
if ((item.enabled !== false) && (item.type === PromptsType.prompt || item.type === PromptsType.skill)) {
547
>
// `IChatPromptSlashCommand.storage` is `PromptsStorage`, so coerce
548
>
// the wider provider-supplied storage (which may be `BUILTIN_STORAGE`)
549
>
// down to the closest narrow value.
550
>
const storage = item.source;
551
>
const narrowStorage: PromptsStorage = storage !== undefined && storage !== BUILTIN_STORAGE
552
>
? storage as PromptsStorage
553
: PromptsStorage.local;
555
>
uri: item.uri,
556
>
type: item.type as PromptsType.prompt | PromptsType.skill,
557
>
name: item.pluginUri ? getCanonicalPluginCommandId({ uri: item.pluginUri, label: item.pluginLabel }, item.name) : item.name,
558
>
description: item.description,
559
>
userInvocable: item.userInvocable ?? true,
560
>
storage: narrowStorage,
561
>
sessionTypes: [sessionType],
562
>
});
563
>
}
564
>
}
565
>
return result;
566
}
567