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

b44b12b52734568cae63080f3d57be6a0f4fe28c

Cohee <18619528+Cohee1207@users.noreply.github.com>

Signed
1 files changed, +18 -0Showing whitespace changes
public/scripts/slash-commands.js+18 -0
@@ -3103,6 +3103,24 @@ export function initDefaultSlashCommands() {
3103 helpString: t`Sets the specified prompt manager entry/entries on or off.`,3103 helpString: t`Sets the specified prompt manager entry/entries on or off.`,
3104 }));3104 }));
3105 SlashCommandParser.addCommandObject(SlashCommand.fromProps({3105 SlashCommandParser.addCommandObject(SlashCommand.fromProps({
3106 name: 'pm-render',
3107 callback: (args, _) => {
3108 const dryRun = !isFalseBoolean(args?.refresh?.toString());
3109 promptManager.render(dryRun);
3110 return '';
3111 },
3112 namedArgumentList: [
3113 SlashCommandNamedArgument.fromProps({
3114 name: 'refresh',
3115 description: 'Perform a dry run of the generation to refresh token counters before rendering the prompt manager',
3116 typeList: [ARGUMENT_TYPE.BOOLEAN],
3117 defaultValue: 'true',
3118 enumList: commonEnumProviders.boolean('trueFalse')(),
3119 }),
3120 ],
3121 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.`,
3122 }));
3123 SlashCommandParser.addCommandObject(SlashCommand.fromProps({
3106 name: 'pick-icon',3124 name: 'pick-icon',
3107 callback: async () => ((await showFontAwesomePicker()) ?? false).toString(),3125 callback: async () => ((await showFontAwesomePicker()) ?? false).toString(),
3108 returns: t`The chosen icon name or false if cancelled.`,3126 returns: t`The chosen icon name or false if cancelled.`,