Commit Graph

1213 Commits

Author SHA1 Message Date
kingbri
e6eae0aad1 Regex: Fix script duplication on edit
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>
2023-07-05 01:30:50 -04:00
kingbri
0f8d07053e Regex: Don't wrap scriptTemplate elements
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>
2023-07-05 01:30:50 -04:00
kingbri
ee6a6603a3 Regex: Add trimStrings option
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>
2023-07-05 01:30:50 -04:00
kingbri
ef7aa3941b Extensions: Add regex engine
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>
2023-07-05 01:30:49 -04:00
Cohee
9a8e036ff9 Use floor rounding on chroma auto-calc 2023-07-05 01:25:43 +03:00
Cohee
0d858bdefb #591 Fix Chroma auto-adjust rounding N query to 0 2023-07-05 01:23:11 +03:00
Cohee
27ab509caf Split help command into pages 2023-07-05 01:06:24 +03:00
Cohee
872bbfad1a Slash command to quickly open a character by name 2023-07-05 00:15:12 +03:00
RossAscends
b8f3a7cbe0 fix code text color & default minimal light theme 2023-07-05 05:16:52 +09:00
RossAscends
fde2a91d2a down the rabbit hole 2023-07-05 04:45:54 +09:00
RossAscends
383a9f67a2 Merge branch 'dev' of https://github.com/Cohee1207/SillyTavern into dev 2023-07-05 02:44:06 +09:00
RossAscends
8cee880486 hopeful fix for resize spam on mobile 2023-07-05 02:43:52 +09:00
BlipRanger
80ac13ef20 Rare race condition patch 2023-07-04 12:26:21 -04:00
RossAscends
b994dbb2d1 dont punish rampant zoomers too much 2023-07-05 00:41:39 +09:00
RossAscends
83d954246f anti-Tav tactics (MovingUI resets on page zoom) 2023-07-05 00:16:36 +09:00
RossAscends
368f3ea968 minor skill issue *obliterated by Dalamud* 2023-07-04 23:10:08 +09:00
RossAscends
19502492c6 Merge branch 'dev' of https://github.com/Cohee1207/SillyTavern into dev 2023-07-04 23:00:13 +09:00
RossAscends
3426f80656 Impervious MovingUI 2023-07-04 23:00:10 +09:00
Cohee
6770ccbe91 Fix Chub embedded lorebooks import 2023-07-04 14:47:48 +03:00
Cohee
8ad431bea6 Fix waifu mode setting migration 2023-07-04 11:46:53 +03:00
Cohee
856b835172 Fix migration of settings.json 2023-07-04 11:41:15 +03:00
Cohee
9e3c55805f Better chat completion continue 2023-07-03 18:22:12 +03:00
Cohee
2b8f5d14e9 Don't stack suggested replies on Poe with continue. 2023-07-03 13:49:26 +03:00
Cohee
13deac2527 Don't insert a newline on empty WI 2023-07-03 11:34:15 +03:00
kingbri
ca2542d81a Utils: Add UUID v4 support
Unique IDs should use UUID as there's a higher prevention of overflow
when assigning them.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-07-02 18:31:02 -04:00
Cohee
6d33e44519 Fix "continue" as a slash command 2023-07-02 23:59:33 +03:00
Cohee
0c3f3f952d Toggle for space trimming 2023-07-02 23:47:33 +03:00
Cohee
6e15f7474f Fix obliteration of quick reply slots on input 2023-07-02 23:09:32 +03:00
Cohee
7a33042ea9 Add slash commands for chat styles and continue 2023-07-02 22:40:38 +03:00
Cohee
2e80de230e Fix Quick reply skill issue 2023-07-02 22:18:11 +03:00
Cohee
225bd5aa0a Update Poe impersonate prompt 2023-07-02 21:39:41 +03:00
Cohee
b14a85a96b Lower PaLM max context size 2023-07-02 21:37:44 +03:00
Cohee
febef5dfba Customizable number of quick reply slots 2023-07-02 21:37:14 +03:00
Cohee
8eb82cdcd9 Continue 2023-07-02 20:21:42 +03:00
Cohee
c156e32ec7 Merge pull request #611 from bdashore3/dev
Add AI reply prefixes for prompt construction
2023-07-02 18:00:00 +03:00
RossAscends
002dbae8c5 MVP: 'Single Document' chat mode 2023-07-02 23:34:46 +09:00
RossAscends
bd9e739de2 new slash command: /resetpanels (alias /resetui) 2023-07-02 19:10:04 +09:00
RossAscends
5dbfe209f6 better /cut error messages 2023-07-02 17:40:15 +09:00
RossAscends
229ec5f255 +"/cut N" for targeted mes deletion,
+ toggle to show mesIDs in chat
2023-07-02 17:32:48 +09:00
RossAscends
8d18f2a80a /delmode alias /del + args for N msgs deletion 2023-07-02 15:49:50 +09:00
kingbri
080ecec5f2 Chat: Add AI reply prefixes
Experimentation yields that prefixing a reply with something drives
the AI to possibly produce more targeted and meaningful conversation.

The example I used is showing an AI's "thoughts" in a message via
the use of backticks. By automatically prefixing {{char}}'s thoughts,
the AI generates an internal monologue that the user can also use
for their own responses.

This feature is stable, but in an experimental state for now in terms
of expansion.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-07-01 20:12:19 -04:00
Cohee
3b4f8811e7 Add probability of activation to WI 2023-07-01 21:02:03 +03:00
Cohee
63bd4cd499 Fix selecting personas with quick reply 2023-07-01 19:25:04 +03:00
Cohee
59b92d4356 Fix message view inflation on Safari when custom separators set 2023-07-01 17:22:49 +03:00
RossAscends
309a2ed564 fix /name for quickreplies (maybe stealth broken, test pls) 2023-07-01 13:33:36 +09:00
Cohee
cba2feb875 #569 Use main API as summary source 2023-06-30 23:37:01 +03:00
Cohee
fe8db4ded8 #605 JB prompt override for Poe. 2023-06-30 19:32:07 +03:00
Cohee
8cda073d00 Fix sticky bias 2023-06-30 18:38:15 +03:00
Cohee
c134aed9f5 Fix budget cutting in WI 2023-06-30 17:42:33 +03:00
Cohee
6be7d5704e Add OpenRouter OAuth flow 2023-06-30 12:01:49 +03:00