Revert pipe caching
This commit is contained in:
parent
65f2cc1952
commit
e2f886d796
|
@ -166,8 +166,7 @@ parser.addCommand('memberdown', moveGroupMemberDownCallback, ['downmember'], '<s
|
|||
parser.addCommand('peek', peekCallback, [], '<span class="monospace">(message index or range)</span> – shows a group member character card without switching chats', true, true);
|
||||
parser.addCommand('delswipe', deleteSwipeCallback, ['swipedel'], '<span class="monospace">(optional 1-based id)</span> – deletes a swipe from the last chat message. If swipe id not provided - deletes the current swipe.', true, true);
|
||||
parser.addCommand('echo', echoCallback, [], '<span class="monospace">(title=string severity=info/warning/error/success [text])</span> – echoes the text to toast message. Useful for pipes debugging.', true, true);
|
||||
parser.addCommand('#', (_, value) => undefined, [], ' – a comment, does nothing, e.g. <tt>/# the next three commands switch variables a and b</tt>', true, true);
|
||||
// '<span class="monospace">(text)</span> – echoes the text to toast message. Useful for pipes debugging.', true, true);
|
||||
parser.addCommand('#', (_, value) => '', [], ' – a comment, does nothing, e.g. <tt>/# the next three commands switch variables a and b</tt>', true, true);
|
||||
parser.addCommand('gen', generateCallback, [], '<span class="monospace">(lock=on/off [prompt])</span> – generates text using the provided prompt and passes it to the next command through the pipe, optionally locking user input while generating.', true, true);
|
||||
parser.addCommand('genraw', generateRawCallback, [], '<span class="monospace">(lock=on/off [prompt])</span> – generates text using the provided prompt and passes it to the next command through the pipe, optionally locking user input while generating. Does not include chat history or character card. Use instruct=off to skip instruct formatting, e.g. <tt>/genraw instruct=off Why is the sky blue?</tt>. Use stop=... with a JSON-serialized array to add one-time custom stop strings, e.g. <tt>/genraw stop=["\\n"] Say hi</tt>', true, true);
|
||||
parser.addCommand('addswipe', addSwipeCallback, ['swipeadd'], '<span class="monospace">(text)</span> – adds a swipe to the last chat message.', true, true);
|
||||
|
@ -1525,11 +1524,7 @@ async function executeSlashCommands(text, unescape = false) {
|
|||
unnamedArg = unnamedArg.replace(/{{pipe}}/i, pipeResult || '');
|
||||
}
|
||||
|
||||
let oldPipeResult = pipeResult;
|
||||
pipeResult = await result.command.callback(result.args, unnamedArg);
|
||||
if (pipeResult === undefined && oldPipeResult !== undefined) {
|
||||
pipeResult = oldPipeResult;
|
||||
}
|
||||
|
||||
if (result.command.interruptsGeneration) {
|
||||
interrupt = true;
|
||||
|
|
|
@ -43,7 +43,7 @@ function setLocalVariable(name, value, args = {}) {
|
|||
}
|
||||
localVariable[args.index] = value;
|
||||
} else {
|
||||
if (localVariable === null) {
|
||||
if (localVariable === null) {
|
||||
localVariable = [];
|
||||
}
|
||||
localVariable[numIndex] = value;
|
||||
|
@ -92,7 +92,7 @@ function setGlobalVariable(name, value, args = {}) {
|
|||
}
|
||||
globalVariable[args.index] = value;
|
||||
} else {
|
||||
if (globalVariable === null) {
|
||||
if (globalVariable === null) {
|
||||
globalVariable = [];
|
||||
}
|
||||
globalVariable[numIndex] = value;
|
||||
|
@ -116,7 +116,9 @@ function addLocalVariable(name, value) {
|
|||
setGlobalVariable(name, JSON.stringify(parsedValue));
|
||||
return parsedValue;
|
||||
}
|
||||
} catch {}
|
||||
} catch {
|
||||
// ignore non-array values
|
||||
}
|
||||
const increment = Number(value);
|
||||
|
||||
if (isNaN(increment) || isNaN(Number(currentValue))) {
|
||||
|
@ -144,7 +146,9 @@ function addGlobalVariable(name, value) {
|
|||
setGlobalVariable(name, JSON.stringify(parsedValue));
|
||||
return parsedValue;
|
||||
}
|
||||
} catch {}
|
||||
} catch {
|
||||
// ignore non-array values
|
||||
}
|
||||
const increment = Number(value);
|
||||
|
||||
if (isNaN(increment) || isNaN(Number(currentValue))) {
|
||||
|
|
Loading…
Reference in New Issue