Typing fixes to avoid breaking any APIs
| @@ -3704,7 +3704,7 @@ function parseDecorators(content) { | |||
| 3704 | * @param {string[]} chat The chat messages to scan, in reverse order. | 3704 | * @param {string[]} chat The chat messages to scan, in reverse order. |
| 3705 | * @param {number} maxContext The maximum context size of the generation. | 3705 | * @param {number} maxContext The maximum context size of the generation. |
| 3706 | * @param {boolean} isDryRun Whether to perform a dry run. | 3706 | * @param {boolean} isDryRun Whether to perform a dry run. |
| 3707 | * @typedef {{ worldInfoBefore: string, worldInfoAfter: string, EMEntries: any[], WIDepthEntries: any[], allActivatedEntries: Map<string, any> }} WIActivated | 3707 | * @typedef {{ worldInfoBefore: string, worldInfoAfter: string, EMEntries: any[], WIDepthEntries: any[], allActivatedEntries: Set<any> }} WIActivated |
| 3708 | * @returns {Promise<WIActivated>} The world info activated. | 3708 | * @returns {Promise<WIActivated>} The world info activated. |
| 3709 | */ | 3709 | */ |
| 3710 | export async function checkWorldInfo(chat, maxContext, isDryRun) { | 3710 | export async function checkWorldInfo(chat, maxContext, isDryRun) { |
| @@ -3748,7 +3748,7 @@ export async function checkWorldInfo(chat, maxContext, isDryRun) { | |||
| 3748 | !isDryRun && timedEffects.checkTimedEffects(); | 3748 | !isDryRun && timedEffects.checkTimedEffects(); |
| 3749 | 3749 | ||
| 3750 | if (sortedEntries.length === 0) { | 3750 | if (sortedEntries.length === 0) { |
| 3751 | return { worldInfoBefore: '', worldInfoAfter: '', WIDepthEntries: [], EMEntries: [], allActivatedEntries: new Map() }; | 3751 | return { worldInfoBefore: '', worldInfoAfter: '', WIDepthEntries: [], EMEntries: [], allActivatedEntries: new Set() }; |
| 3752 | } | 3752 | } |
| 3753 | 3753 | ||
| 3754 | /** @type {number[]} Represents the delay levels for entries that are delayed until recursion */ | 3754 | /** @type {number[]} Represents the delay levels for entries that are delayed until recursion */ |
| @@ -4195,7 +4195,7 @@ export async function checkWorldInfo(chat, maxContext, isDryRun) { | |||
| 4195 | console.log(`[WI] Adding ${allActivatedEntries.size} entries to prompt`, Array.from(allActivatedEntries.values())); | 4195 | console.log(`[WI] Adding ${allActivatedEntries.size} entries to prompt`, Array.from(allActivatedEntries.values())); |
| 4196 | console.debug('[WI] --- DONE ---'); | 4196 | console.debug('[WI] --- DONE ---'); |
| 4197 | 4197 | ||
| 4198 | return { worldInfoBefore, worldInfoAfter, EMEntries, WIDepthEntries, allActivatedEntries: allActivatedEntries.values() }; | 4198 | return { worldInfoBefore, worldInfoAfter, EMEntries, WIDepthEntries, allActivatedEntries: new Set(allActivatedEntries.values()) }; |
| 4199 | } | 4199 | } |
| 4200 | 4200 | ||
| 4201 | /** | 4201 | /** |