Some extensions are statically imported inside script.js, bypassing
the extension load method. The true method to solve this is using
dynamic imports and undefined checks, but implementing this is
extremely time-consuming.
For now, add the extension_first_load event which fires when
first load is about to start. This changes loading priority to
static -> offline -> online/API.
In addition, initialize the event source earlier since it's more
important than most of the other imports.
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>
Adds the option to override the chat's author's note with one set
for each character. This saves the pain of having to copy and paste
author's notes for every chat.
Signed-off-by: kingbri <bdashore3@proton.me>
Duplicate characters get handled by the system, so why not sprites?
If a sprite is duplicated, users can specify the folder name that
the changed sprites are located in.
This commit only adds support for single person chats and breaks
compatibility with group chats. Another commit is required to fix
group sprite functionality.
Signed-off-by: kingbri <bdashore3@proton.me>
An API key is extremely important for ST-Extras servers that are
exposed to the internet.
Add an API key field below where the user enters the extras URL. For
convenience, this key is persisted whenever the user refreshes the
page.
Also modify the fetch requests to always include API keys if present.
See ST-Extras for more information on how this works.
Signed-off-by: kingbri <bdashore3@proton.me>