Editing a script can bypass the unique naming system by just renaming
the script to another one. This change ensures that no two script
names can be the same by checking if the existing index and found indices
differ.
If something goes wrong, it would be better to use a filter and a
map and then check the index array length/includes. FindIndex
is used here for efficiency's sake since each array index is unique.
Signed-off-by: kingbri <bdashore3@proton.me>
Fix some UI for flex element wrapping. Text overflow for a script
name is now truncated if it exceeds one line of text. Also fix
how extension settings are laid out to prevent unnecessary
flex resizing.
Signed-off-by: kingbri <bdashore3@proton.me>
Sometimes the matched regex string needs to be pruned before
replacement. Add a method for the user to provide strings which
globally trims a regex match before any replacement is done.
Example without trim:
input - <Manami's thoughts: This is a thought>
regex - /<([^>]*)>/g
output - <Manami's thoughts: Manami's thoughts: This is a thought>
With trim:
input - <Manami's thoughts: This is a thought>
regex - /<([^>]*)>/g
trim - ["{{char}}'s thoughts: "]
output - <Manami's thoughts: This is a thought>
Signed-off-by: kingbri <bdashore3@proton.me>
Regex is a method that is commonly used to find and replace parts
of a string using a single pattern. Add support for using regex in
SillyTavern which allows users to dynamically change various aspects
of the chatting experience.
Users are able to choose where a given regex script should apply
(both invasive and non-invasive options!). Invasive options alter
chat history while non-invasive alters markdown display for the
entire chat.
A new variable called {{match}} is added in regex scripts which
substitutes in the found match from the original find regex script.
There is a lot more that can be added to this extension, but for now,
this is enough.
Signed-off-by: kingbri <bdashore3@proton.me>
This allows for more flexible popups with options rather than
implementing a brand new popup just to change button text.
Signed-off-by: kingbri <bdashore3@proton.me>
Removed the parameter size from many of the presets, as these can work well with many parameter sizes. Removed "Prompt Arena" from the ooba presets, as these are new defaults. Changed sampling order back to the originals. Rep Pen should should listed first, as this was how it was done originally, as well. Also cleaned up and removed the unused parameters.