Fix ESLint squigglies
This commit is contained in:
parent
e7382e184d
commit
b5f77a2164
|
@ -449,7 +449,7 @@ class WorldInfoTimedEffects {
|
||||||
console.debug('Cooldown ended for entry', entry.uid);
|
console.debug('Cooldown ended for entry', entry.uid);
|
||||||
},
|
},
|
||||||
|
|
||||||
'delay': () => {},
|
'delay': () => { },
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -3610,7 +3610,7 @@ async function checkWorldInfo(chat, maxContext, isDryRun) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (entry.disable == true) {
|
if (entry.disable == true) {
|
||||||
log(`disabled`);
|
log('disabled');
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3620,7 +3620,7 @@ async function checkWorldInfo(chat, maxContext, isDryRun) {
|
||||||
const filtered = entry.characterFilter.isExclude ? nameIncluded : !nameIncluded;
|
const filtered = entry.characterFilter.isExclude ? nameIncluded : !nameIncluded;
|
||||||
|
|
||||||
if (filtered) {
|
if (filtered) {
|
||||||
log(`filtered out by character`);
|
log('filtered out by character');
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3637,7 +3637,7 @@ async function checkWorldInfo(chat, maxContext, isDryRun) {
|
||||||
const filtered = entry.characterFilter.isExclude ? includesTag : !includesTag;
|
const filtered = entry.characterFilter.isExclude ? includesTag : !includesTag;
|
||||||
|
|
||||||
if (filtered) {
|
if (filtered) {
|
||||||
log(`filtered out by tag`);
|
log('filtered out by tag');
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3649,47 +3649,47 @@ async function checkWorldInfo(chat, maxContext, isDryRun) {
|
||||||
const isDelay = timedEffects.isEffectActive('delay', entry);
|
const isDelay = timedEffects.isEffectActive('delay', entry);
|
||||||
|
|
||||||
if (isDelay) {
|
if (isDelay) {
|
||||||
log(`suppressed by delay`);
|
log('suppressed by delay');
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isCooldown && !isSticky) {
|
if (isCooldown && !isSticky) {
|
||||||
log(`suppressed by cooldown`);
|
log('suppressed by cooldown');
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only use checks for recursion flags if the scan step was activated by recursion
|
// Only use checks for recursion flags if the scan step was activated by recursion
|
||||||
if (scanState !== scan_state.RECURSION && entry.delayUntilRecursion) {
|
if (scanState !== scan_state.RECURSION && entry.delayUntilRecursion) {
|
||||||
log(`suppressed by delay until recursion`);
|
log('suppressed by delay until recursion');
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (scanState === scan_state.RECURSION && world_info_recursive && entry.excludeRecursion) {
|
if (scanState === scan_state.RECURSION && world_info_recursive && entry.excludeRecursion) {
|
||||||
log(`suppressed by exclude recursion`);
|
log('suppressed by exclude recursion');
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now do checks for immediate activations
|
// Now do checks for immediate activations
|
||||||
if (entry.constant) {
|
if (entry.constant) {
|
||||||
log(`activated because of constant`);
|
log('activated because of constant');
|
||||||
activatedNow.add(entry);
|
activatedNow.add(entry);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (buffer.isExternallyActivated(entry)) {
|
if (buffer.isExternallyActivated(entry)) {
|
||||||
log(`externally activated`);
|
log('externally activated');
|
||||||
activatedNow.add(entry);
|
activatedNow.add(entry);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isSticky) {
|
if (isSticky) {
|
||||||
log(`activated because active sticky`);
|
log('activated because active sticky');
|
||||||
activatedNow.add(entry);
|
activatedNow.add(entry);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Array.isArray(entry.key) || !entry.key.length) {
|
if (!Array.isArray(entry.key) || !entry.key.length) {
|
||||||
log(`has no keys defined, skipped`);
|
log('has no keys defined, skipped');
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3703,7 +3703,7 @@ async function checkWorldInfo(chat, maxContext, isDryRun) {
|
||||||
const substituted = substituteParams(key);
|
const substituted = substituteParams(key);
|
||||||
|
|
||||||
if (substituted && buffer.matchKeys(textToScan, substituted.trim(), entry)) {
|
if (substituted && buffer.matchKeys(textToScan, substituted.trim(), entry)) {
|
||||||
log(`has match on primary keyword`, substituted);
|
log('has match on primary keyword', substituted);
|
||||||
|
|
||||||
//selective logic begins
|
//selective logic begins
|
||||||
if (
|
if (
|
||||||
|
@ -3711,7 +3711,7 @@ async function checkWorldInfo(chat, maxContext, isDryRun) {
|
||||||
Array.isArray(entry.keysecondary) && //always true
|
Array.isArray(entry.keysecondary) && //always true
|
||||||
entry.keysecondary.length //ignore empties
|
entry.keysecondary.length //ignore empties
|
||||||
) {
|
) {
|
||||||
log(`has secondary keywords. Checking logic`, Object.entries(world_info_logic).find(x => x[1] === entry.selectiveLogic));
|
log('has secondary keywords. Checking logic', Object.entries(world_info_logic).find(x => x[1] === entry.selectiveLogic));
|
||||||
let hasAnyMatch = false;
|
let hasAnyMatch = false;
|
||||||
let hasAllMatch = true;
|
let hasAllMatch = true;
|
||||||
secondary: for (let keysecondary of entry.keysecondary) {
|
secondary: for (let keysecondary of entry.keysecondary) {
|
||||||
|
@ -3730,9 +3730,9 @@ async function checkWorldInfo(chat, maxContext, isDryRun) {
|
||||||
// If AND ANY logic and the main checks pass OR if NOT ALL logic and the main checks do not pass
|
// If AND ANY logic and the main checks pass OR if NOT ALL logic and the main checks do not pass
|
||||||
if ((selectiveLogic === world_info_logic.AND_ANY && hasSecondaryMatch) || (selectiveLogic === world_info_logic.NOT_ALL && !hasSecondaryMatch)) {
|
if ((selectiveLogic === world_info_logic.AND_ANY && hasSecondaryMatch) || (selectiveLogic === world_info_logic.NOT_ALL && !hasSecondaryMatch)) {
|
||||||
if (selectiveLogic === world_info_logic.AND_ANY) {
|
if (selectiveLogic === world_info_logic.AND_ANY) {
|
||||||
log(`activated. (AND ANY) Found match secondary keyword`, secondarySubstituted);
|
log('activated. (AND ANY) Found match secondary keyword', secondarySubstituted);
|
||||||
} else {
|
} else {
|
||||||
log(`activated. (NOT ALL) Found not matching secondary keyword`, secondarySubstituted);
|
log('activated. (NOT ALL) Found not matching secondary keyword', secondarySubstituted);
|
||||||
}
|
}
|
||||||
activatedNow.add(entry);
|
activatedNow.add(entry);
|
||||||
break secondary;
|
break secondary;
|
||||||
|
@ -3741,23 +3741,23 @@ async function checkWorldInfo(chat, maxContext, isDryRun) {
|
||||||
|
|
||||||
// Handle NOT ANY logic
|
// Handle NOT ANY logic
|
||||||
if (selectiveLogic === world_info_logic.NOT_ANY && !hasAnyMatch) {
|
if (selectiveLogic === world_info_logic.NOT_ANY && !hasAnyMatch) {
|
||||||
log(`activated. (NOT ANY) No secondary keywords found`, entry.keysecondary);
|
log('activated. (NOT ANY) No secondary keywords found', entry.keysecondary);
|
||||||
activatedNow.add(entry);
|
activatedNow.add(entry);
|
||||||
break primary;
|
break primary;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle AND ALL logic
|
// Handle AND ALL logic
|
||||||
if (selectiveLogic === world_info_logic.AND_ALL && hasAllMatch) {
|
if (selectiveLogic === world_info_logic.AND_ALL && hasAllMatch) {
|
||||||
log(`activated. (AND ALL) All secondary keywords found`, entry.keysecondary);
|
log('activated. (AND ALL) All secondary keywords found', entry.keysecondary);
|
||||||
activatedNow.add(entry);
|
activatedNow.add(entry);
|
||||||
break primary;
|
break primary;
|
||||||
}
|
}
|
||||||
|
|
||||||
log(`skipped. Secondary keywords not satisfied`, entry.keysecondary);
|
log('skipped. Secondary keywords not satisfied', entry.keysecondary);
|
||||||
break primary;
|
break primary;
|
||||||
} else {
|
} else {
|
||||||
// Handle cases where secondary is empty
|
// Handle cases where secondary is empty
|
||||||
log(`activated by primary keyword`, substituted);
|
log('activated by primary keyword', substituted);
|
||||||
activatedNow.add(entry);
|
activatedNow.add(entry);
|
||||||
break primary;
|
break primary;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue