Use prefix in the migrated sysprompts

c340766bb6ba6308cba8899cf3e9adae021ad819

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

2 files changed, +2 -1Ignore whitespace
public/scripts/sysprompt.js+1 -1
@@ -29,7 +29,7 @@ async function migrateSystemPromptFromInstructMode() {
29 if (existingPromptName) {29 if (existingPromptName) {
30 power_user.sysprompt.name = existingPromptName;30 power_user.sysprompt.name = existingPromptName;
31 } else {31 } else {
32 const data = { name: `${power_user.instruct.preset} (Migrated)`, content: prompt };32 const data = { name: `[Migrated] ${power_user.instruct.preset}`, content: prompt };
33 await getPresetManager('sysprompt')?.savePreset(data.name, data);33 await getPresetManager('sysprompt')?.savePreset(data.name, data);
34 power_user.sysprompt.name = data.name;34 power_user.sysprompt.name = data.name;
35 }35 }
src/users.js+1 -0
@@ -368,6 +368,7 @@ async function migrateSystemPrompts() {
368 // Only leave contents that are not in the default prompts368 // Only leave contents that are not in the default prompts
369 migratedPrompts = migratedPrompts.filter(x => !defaultPrompts.some(y => y.content === x.content));369 migratedPrompts = migratedPrompts.filter(x => !defaultPrompts.some(y => y.content === x.content));
370 for (const sysPromptData of migratedPrompts) {370 for (const sysPromptData of migratedPrompts) {
371 sysPromptData.name = `[Migrated] ${sysPromptData.name}`;
371 const syspromptPath = path.join(directory.sysprompt, `${sysPromptData.name}.json`);372 const syspromptPath = path.join(directory.sysprompt, `${sysPromptData.name}.json`);
372 writeFileAtomicSync(syspromptPath, JSON.stringify(sysPromptData, null, 4));373 writeFileAtomicSync(syspromptPath, JSON.stringify(sysPromptData, null, 4));
373 console.log(`Migrated system prompt ${sysPromptData.name} for ${directory.root.split(path.sep).pop()}`);374 console.log(`Migrated system prompt ${sysPromptData.name} for ${directory.root.split(path.sep).pop()}`);