Move new globalScanData args to the end

6ddd395211f230e99c26f7946e1a7bfe9c6d741e

Crow <bismuthglass@protonmail.com>

2 files changed, +9 -9Ignore whitespace
public/script.js+1 -1
@@ -4155,7 +4155,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
41554155 scenario: scenario,
41564156 creatorNotes: creatorNotes,
41574157 };
41584158 const { worldInfoString, worldInfoBefore, worldInfoAfter, worldInfoExamples, worldInfoDepth } = await getWorldInfoPrompt(globalScanData, chatForWI, this_max_context, dryRun, globalScanData);
41594159 setExtensionPrompt('QUIET_PROMPT', '', extension_prompt_types.IN_PROMPT, 0, true);
41604160
41614161 // Add message example WI
public/scripts/world-info.js+8 -8
@@ -187,10 +187,10 @@ class WorldInfoBuffer {
187187
188188 /**
189189 * Initialize the buffer with the given messages.
190- * @param {WIGlobalScanData} globalScanData Chat independent context to be scanned
191190 * @param {string[]} messages Array of messages to add to the buffer
191+ * @param {WIGlobalScanData} globalScanData Chat independent context to be scanned
192192 */
193193 constructor(globalScanDatamessages, messagesglobalScanData) {
194194 this.#initDepthBuffer(messages);
195195 this.#globalScanDataBuffer = globalScanData;
196196 }
@@ -796,10 +796,10 @@ export const worldInfoCache = new StructuredCloneMap({ cloneOnGet: true, cloneOn
796796
797797/**
798798 * Gets the world info based on chat messages.
799- * @param {WIGlobalScanData} globalScanData Chat independent context to be scanned
800799 * @param {string[]} chat - The chat messages to scan, in reverse order.
801800 * @param {number} maxContext - The maximum context size of the generation.
802801 * @param {boolean} isDryRun - If true, the function will not emit any events.
802+ * @param {WIGlobalScanData} globalScanData Chat independent context to be scanned
803803 * @typedef {object} WIPromptResult
804804 * @property {string} worldInfoString - Complete world info string
805805 * @property {string} worldInfoBefore - World info that goes before the prompt
@@ -810,10 +810,10 @@ export const worldInfoCache = new StructuredCloneMap({ cloneOnGet: true, cloneOn
810810 * @property {Array} anAfter - Array of entries after Author's Note
811811 * @returns {Promise<WIPromptResult>} The world info string and depth.
812812 */
813813export async function getWorldInfoPrompt(globalScanData, chat, maxContext, isDryRun, globalScanData) {
814814 let worldInfoString = '', worldInfoBefore = '', worldInfoAfter = '';
815815
816816 const activatedWorldInfo = await checkWorldInfo(globalScanData, chat, maxContext, isDryRun, globalScanData);
817817 worldInfoBefore = activatedWorldInfo.worldInfoBefore;
818818 worldInfoAfter = activatedWorldInfo.worldInfoAfter;
819819 worldInfoString = worldInfoBefore + worldInfoAfter;
@@ -4053,10 +4053,10 @@ function parseDecorators(content) {
40534053
40544054/**
40554055 * Performs a scan on the chat and returns the world info activated.
4056- * @param {WIGlobalScanData} globalScanData Chat independent context to be scanned
40574056 * @param {string[]} chat The chat messages to scan, in reverse order.
40584057 * @param {number} maxContext The maximum context size of the generation.
40594058 * @param {boolean} isDryRun Whether to perform a dry run.
4059+ * @param {WIGlobalScanData} globalScanData Chat independent context to be scanned
40604060 * @typedef {object} WIActivated
40614061 * @property {string} worldInfoBefore The world info before the chat.
40624062 * @property {string} worldInfoAfter The world info after the chat.
@@ -4067,9 +4067,9 @@ function parseDecorators(content) {
40674067 * @property {Set<any>} allActivatedEntries All entries.
40684068 * @returns {Promise<WIActivated>} The world info activated.
40694069 */
40704070export async function checkWorldInfo(globalScanData, chat, maxContext, isDryRun, globalScanData) {
40714071 const context = getContext();
40724072 const buffer = new WorldInfoBuffer(globalScanDatachat, chatglobalScanData);
40734073
40744074 console.debug(`[WI] --- START WI SCAN (on ${chat.length} messages)${isDryRun ? ' (DRY RUN)' : ''} ---`);
40754075