Add 'pm-render' command to refresh prompt manager content (#5483)

This commit is contained in:
Cohee
2026-04-20 00:07:25 +03:00
committed by GitHub
parent d720605be8
commit b44b12b527
+18
View File
@@ -3102,6 +3102,24 @@ export function initDefaultSlashCommands() {
],
helpString: t`Sets the specified prompt manager entry/entries on or off.`,
}));
SlashCommandParser.addCommandObject(SlashCommand.fromProps({
name: 'pm-render',
callback: (args, _) => {
const dryRun = !isFalseBoolean(args?.refresh?.toString());
promptManager.render(dryRun);
return '';
},
namedArgumentList: [
SlashCommandNamedArgument.fromProps({
name: 'refresh',
description: 'Perform a dry run of the generation to refresh token counters before rendering the prompt manager',
typeList: [ARGUMENT_TYPE.BOOLEAN],
defaultValue: 'true',
enumList: commonEnumProviders.boolean('trueFalse')(),
}),
],
helpString: t`Rerenders the prompt manager content. Use this if you have made changes to the prompt entries through slash commands and want to see the changes reflected in the prompt manager UI.`,
}));
SlashCommandParser.addCommandObject(SlashCommand.fromProps({
name: 'pick-icon',
callback: async () => ((await showFontAwesomePicker()) ?? false).toString(),