Commit Graph
425 Commits
Author SHA1 Message Date
CoheeandCopilot b0820c4517 Text Completion: Inject Story String @ depth (#4362)
* TC/AF: Add Story String position

* Update public/scripts/power-user.js

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Add before/after anchors as story string params

* Move autofix story string at settings load

* Substitute in story string wrappers

* Only add an auto-newline after story string if wrap is enabled

* Do not init names_force_groups with default value

* Update default settings

* Auto-delete obsolete fields from instruct templates

* Update default templates

* Remove newline from GLM-4 prefix

* Format as one line

* Remove auto-fix leftovers from renderStoryString

* Remove pointless reassignments in autoFixMissingField

* Update KoboldAI template

* Add info hint for Story String sequences

* Update default templates

* Reformat extractMessageFromData

* Fix condition in autoFixStoryString

* Update tooltip text for Story String Sequences

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-08-09 20:33:04 +03:00
Cohee 25e965f717 Instruct: Add Sequences as Stop Strings control (#4355)
* Instruct: Add Sequences as Stop Strings control

* lint fix
2025-08-07 10:27:16 +03:00
afa3261746 Redesign Creator's Note block (#4298)
* Restyle creator's notes block

* Creator Notes to standoutHeader styling, allows for viewing Note without hiding chardefs

* Fix closing tag

* Remove stray close tag

* Adjust spoiler-free mode toggle

* Make the whole toggle area clickable

* Remove redundant comment

* Add empty state for creator's notes

* Adjust paddings

* Update public/index.html

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

---------

Co-authored-by: RossAscends <124905043+RossAscends@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-07-23 00:08:56 +03:00
Cohee 96bdc13937 Replace ajax with fetch (#4241)
* Replace ajax with fetch
Fix type errors in power-user / group-chats modules

* Fix single sprite upload

* Return empty object on failed upload
2025-07-06 23:27:53 +03:00
GregW6andCohee 1547a53d7c Refactor: Replace Deprecated Code (#4221)
* refactor: ♻️ Replace deprecated code defined within this repository

- Replace ““/public/scripts.js” > `callPopup`” with ““/public/scripts/popup.js” > `callGenericPopup`”.
- Replace ““/public/scripts/tokenizers.js” > `getTokenCount`” with ““/public/scripts/tokenizers.js” > `getTokenCountAsync`”.
- Replace ““/public/scripts/extensions/assets/index.js” > `executeSlashCommands`” with ““/public/scripts/extensions/assets/index.js” > `executeSlashCommandsWithOptions`”.

* refactor: ♻️ Replace deprecated code from standard library

1. Replace set of deprecated `escape` and deprecated `unescape` functions with `encodeURIComponent` and `decodeURIComponent` functions.
2. Replace set of `encodeURIComponent` and deprecated `unescape` functions with a custom `convertTextToBinaryString` function.

* refactor: ♻️ Replace deprecated code imported from external library

All of them is from jQuery.
1. Replace `$(document).ready(() => { ... })` → `jQuery(() => { ... })`.
2. Replace event type direct calls.
    1) Change
        - `$('...').change(function () { ... })` → `$('...').on('change', function () { ... })`.
    2) Click
        - `$('...').click(function () { ... })` → `$('...').on('click', function () { ... })`.
        - `$('...').click()` → `$('...').trigger('click')`.
    3) Focus
        - `$('...').focus(function () { ... })` → `$('...').on('focus', function () { ... })`.
        - `$('...').focus()` → `$('...').trigger('focus')`.
    4) Blur
        - `$('...').blur(function () { ... })` → `$('...').on('blur', function () { ... })`.
    5) Keyup
        - `$('...').keyup(function () { ... })` → `$('...').on('keyup', function () { ... })`.

* refactor(Attachment): ♻️ Merge `convertTextToBinaryString` and `convertTextToBase64`

`convertTextToBase64` function use `Uint8Array.prototype.toBase64` if supported by the Browser and use a combination of `Window.btoa` and `String.fromCharCode` as fallback.

* fix: 🐛 Fix Bind World Info to Character Card

Using the new `Popup` class.

* fix: 🐛 Fix Bind World Info to Character Card

Using the new `Popup` class.

* refactor: 🐛 Refactor and fix Character World Info popup

Add singleton back and some optimization.

-   **🛡️ Singleton Pattern:** Implemented a singleton pattern using the `characterWorldPopup` variable. This prevents multiple instances of the popup from being created, ensuring a clean and predictable UI. If the popup is already open, it will be brought into focus instead of creating a duplicate.
-   **♻️ Improved Readability:** The event handling logic has been extracted into clearly named functions (`handlePrimaryWorldSelect`, `handleExtrasWorldSelect`), making the `Popup` constructor cleaner and the overall code more readable and maintainable.
-   **⚙️ Optimized Performance:** The new implementation caches frequently accessed values and jQuery selectors, reducing redundant DOM lookups and improving performance.

---

* refactor(Chat): ♻️ Modernize chat deletion confirmation

Replaces the deprecated `callPopup` with the modern `callGenericPopup` for the chat deletion confirmation dialog.

* Fix /delchat command

* Remove unused code

* Fix type. Change value to debug log

* Remove value logs

* Remove singleton pattern for openCharacterWorldPopup

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-07-04 19:42:51 +03:00
Cohee fbb6180bc1 Adjust scoped variable naming, format comments 2025-06-29 18:09:47 +03:00
kallewoofandCohee 1b2976ae1d feature: customizable mappings for presets per model name / chat template (#4153)
* feature: customizable mappings for presets per chat template

This adds the ability to assign custom context/instruct presets on a per-chat-template(-hash) basis. Users using custom templates may use this feature to auto-enable the preset of their choice, rather than the built-in defaults.

* fix: do not use chat tempate based instruct preset derivation if a preset was auto-selected already

This fixes issues where regex matched presets are overridden.

* reset chat template hash on connect

* handle derive_mappings being null

* unorthodox eslint requirement adherence

* button styling

* un-nest derivation related properties

* Migrate setting

* add bind model to preset button to the miscellaneous section

* switch to unified button for model preset mappings

* fix bind UI

* eslint

* do not include koboldcpp/ggml-model-xxx.gguf in preset saving

* review fixes

* stray console.log / eslint

* Update checkbox state if no model map exists

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-06-29 18:04:00 +03:00
Cohee 1e3fada8d7 Prefer sanitize filename with extension 2025-06-28 22:25:14 +03:00
RossAscendsandCohee fa10833e52 add minimum requirement of 2 [A-za-z] for slashcommand autocomplete to show up (#4080)
* add minimum requirement of 2 [A-za-z] for slashcommand autocomplete to show up

* Migrate to dedicated AC toggle

* Replace state checkbox with select

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-06-01 20:07:33 +03:00
Cohee d336ea7a13 Add rounded square avatars theme option 2025-05-22 00:39:00 +03:00
Cohee 34490c9614 Display loader earlier, init toast classes in power-user 2025-05-21 20:35:03 +03:00
RossAscends 1aa7d1d5a5 meta-theme color matches UI Background 2025-05-21 21:01:28 +09:00
RossAscends b3e317393b console log cleanup 2025-05-21 16:03:37 +09:00
RossAscends 87f547cd87 add option for toastr location to themes 2025-05-21 15:07:47 +09:00
Cohee 7a4d6ecfde Migrate old preference for "click to edit" setting based on chat display style 2025-05-07 11:12:41 +00:00
Cohee 5e31a21d8d Decouple "click to edit" from document mode 2025-05-06 22:02:20 +03:00
Cohee ca29de4704 Add style pin feature for greeting messages 2025-05-04 17:48:36 +03:00
Cohee 775ae0f557 TC sysprompt: Add Post-History Instructions control
Closes #3920
2025-04-28 00:14:57 +03:00
Cohee 35395fcb39 Increase unlocked slider limits 2025-04-13 13:35:50 +03:00
Cohee 03d590415b Merge pull request #3700 from SillyTavern/reasoning-template
Reasoning templates
2025-03-18 01:49:06 +02:00
Cohee b1346910a4 Adjust reasoning template migration procedure 2025-03-18 00:47:20 +02:00
Cohee 271c93a504 Rename DeepSeek template, add Blank reasoning template 2025-03-18 00:32:31 +02:00
Cohee fba2d809d0 Merge branch 'release' into staging 2025-03-17 09:47:11 +00:00
Cohee b01e2824be Remove trim from /start-reply-with 2025-03-17 09:46:52 +00:00
Cohee c022858e5b Fix structuredClone 2025-03-16 23:37:18 +02:00
bmen25124 8dc66bd21b Better WI type readability, fixed clone and type opeators. 2025-03-17 00:13:39 +03:00
Cohee cf2671c6d7 Merge branch 'staging' into reasoning-template 2025-03-16 22:51:28 +02:00
bmen25124 0e41db615e New exports 2025-03-16 23:44:02 +03:00
bmen25124 d42a81f97c New connection manager events, ConnectionManagerRequestService (#3603) 2025-03-16 16:58:34 +02:00
Cohee 62342b35e2 Reasoning template 2025-03-16 15:01:31 +02:00
Cohee 68b5be063f TC: Increased unlocked response to 32k 2025-03-11 00:24:28 +02:00
Wolfsblvt 57a229d5fd Fix "Response Length" slider showing wrong value
- "Mad Lab Mode" was falsely "resetting" the slider control, for no obvious reason besides weird implementation.
2025-03-10 22:21:36 +01:00
Cohee 7845994315 Add 'start-reply-with' to Connection Profiles (#3632)
* Connection Profiles: Add support for 'start-reply-with' command and allow empty values for 'stop-strings' command

* Add handling for empty profile values in makeFancyProfile function

* Fix application of empty values

* Handle undefined values

* Improve argument validation

* Replace || with &&

* I got it right this time, swear

* Who wrote this?
2025-03-09 16:55:49 +02:00
Cohee a9c2af19e3 Add null checks for querySelector stscript_autocomplete_width
Closes #3582
2025-03-07 11:32:58 +00:00
Reithan aaf066699b Update TFS and DynaTemp Exponent to use 3 sig dig 2025-02-27 09:20:07 -08:00
Wolfsblvt 8bd4fd76ae Merge branch 'staging' into persona-improvements 2025-02-22 19:23:59 +01:00
Wolfsblvt c12f26441e Merge branch 'staging' into support-multiple-expressions 2025-02-19 20:22:02 +01:00
Wolfsblvt b5fc7d6d4d Add toggle for showing hidden reasoning 2025-02-12 22:04:48 +01:00
Cohee d5bdf1cb90 Add settings.json-backed KV string storage
Fixes #3461, #3443
2025-02-11 20:17:48 +02:00
Cohee d5959a4681 Add awaits to event emissions 2025-02-08 19:13:05 +02:00
Cohee 5aa82eda2b Add missed power_user setting 2025-02-02 20:53:55 +02:00
Wolfsblvt 25ffc4ac4a Merge branch 'staging' into support-multiple-expressions 2025-02-01 04:47:48 +01:00
Cohee 364078ce27 /del is fine too 2025-01-31 22:36:18 +02:00
Cohee fda64ffb1f Alias /del to /delete 2025-01-31 22:30:58 +02:00
Cohee dfc2eb32c8 Merge pull request #3386 from SillyTavern/reasoning-parse
Reasoning blocks auto-parsing
2025-01-31 11:41:10 +02:00
Wolfsblvt 198d10e759 Allow setting specific sprites as expressions
- Update /expression-set command to allow setting specific sprites
- Enhance enum completion for /expression-set to show expressions/sprites and more their info
- Fix setting sprite folder reprinting stuff double
- Fix not being able to unset expressions
2025-01-30 02:42:05 +01:00
Cohee c32e0bdde7 Autoswipe: Fix endless loop if blacklist empty 2025-01-29 23:01:37 +02:00
Cohee d0abba23dc Add reasoning auto-parsing, always show reasoning prefix/suffix in Markdown, respect space trim preference 2025-01-29 21:38:08 +02:00
Cohee 0c9676e7fc /stop-strings: add aliases 2025-01-28 23:01:58 +02:00
Cohee bab8a09a80 /stop-strings: update help 2025-01-28 23:00:28 +02:00