Commit Graph
6173 Commits
Author SHA1 Message Date
Cohee 86bac00a81 Groq: Pull models list from endpoint 2025-07-09 20:25:20 +03:00
Cohee 5be2323e23 AI21: Add Jamba 1.7 models 2025-07-09 20:09:34 +03:00
Cohee b737af47b5 Refactor OpenAI preset API endpoints to unify save and delete operations 2025-07-08 21:32:58 +03:00
Cohee a029a6e1f1 Fix convertTextToBase64 for large files
Reference: https://github.com/google/closure-library/blob/b312823ec5f84239ff1db7526f4a75cba0420a33/closure/goog/crypt/crypt.js#L104-L123
2025-07-07 12:57:48 +00: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
CoheeandCopilot 28189bb1c7 Move default slash commands to respective module (#4240)
* Move default slash commands to respective module

* Update public/scripts/slash-commands.js

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

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-07-06 17:17:19 +03:00
Cohee 8449b4bb27 Move Horde status check to respective module 2025-07-06 16:38:52 +03:00
Cohee c51ce1d018 Move text completion settings to respective module (#4239) 2025-07-06 16:32:48 +03:00
Cohee 3d488a5e7b Move DOMPurify hooks to chats module 2025-07-06 16:13:22 +03:00
CoheeandCopilot 2f56a73368 Move NovelAI settings to respective module (#4238)
* Move NovelAI settings to respective module

* Update public/scripts/nai-settings.js

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

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-07-06 16:05:26 +03:00
Cohee 88ef9ca0de Properly save chat QR metadata in groups
Fixes #4121
2025-07-06 15:11:00 +03:00
CoheeandCopilot e1a55408b6 OpenRouter: match both id/text in select2 (#4237)
* OpenRouter: match both id/text in select2

* Update public/scripts/utils.js

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

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-07-06 14:41:25 +03:00
Marcela Petra Ferraz de NovaesandCohee 38a7668535 Feature/add character tags to message div option (#4225)
* Adding toggle.

* Adding events for the new toggle. Reloading chat when toggled.

* Adding chat reload when tags are added or removed to char.

* Adding main applyCharacterTagsToMessageDivs function to add tags to divs.

* Adding information that the class name is normalized and lowercased to the tooltip.

* Correcting console.traces to console.debug for minimal console printing.

* Lint indentation fix.

* Adding simple cache.

* Adding reload event when a new message is added to chat.

* Changing tags applied from classes to HTML data API.

* Adding guide showing how to select data attributes with CSS.

* Fixing trailing comma pointed out by lint.

* Simplifying re-rendering by deleting previous attributes.

* Adding the feature as default behavior, removing toggles. Will add docs to ST docs.

* Removing code that is no longer needed.

* Re-rendering divs after other tag operations.

* Filtering message ids to only re-render specific divs. Adding suggested changes.

* After testing, it seems to add all messages by one, so it appears it's not needed call this in the printMessages function.

* Lint fixes.

* Cache jquery selector

* Fix local variables assignment

* Move new functions to tags module

* Normalizing tag names before adding them as data-*

* Replace commas with spaces to avoid issues with tag names containing commas.

* Correcting where the comma replacing should go.

* Add error handling for applyCharacterTagsToMessageDivs

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-07-05 22:37:43 +03:00
CoheeandCopilot e0469b4808 Move Kobold Classic settings into related module (#4234)
* Move Kobold Classic settings into related module

* Update public/scripts/kai-settings.js

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

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-07-05 21:00:06 +03:00
CoheeandCopilot 8a6e6503f5 Move itemized prompts into separate module (#4229)
* Move itemized prompts into separate module

* Update public/scripts/itemized-prompts.js

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

* Update public/scripts/itemized-prompts.js

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

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-07-05 16:21:17 +03:00
Cohee 85f38542b6 Improve sanitation of CSS pseudo-classes (#4230) 2025-07-05 16:13:35 +03:00
Gness Erquint 9aab4ea648 Non-streaming narrate by paragraphs setting now actually works automatically regardless of streaming-related settings. Resolves #4228. 2025-07-05 08:25:03 +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 1e63fdd4b3 Clean-up console.trace calls 2025-07-04 01:25:47 +03:00
Cohee 9cdfb8b596 Remove console.debug from tags colorize handler 2025-07-04 01:24:36 +03:00
Marcela Petra Ferraz de Novaes 3f842d2049 Bugfix - Clicking on tag view list toggles checkbox (#4227)
* Adding event.preventDefault() to prevent checkbox toggle when clicking to open pop-up.

* Adjusting comment.
2025-07-04 01:23:51 +03:00
Cohee 51904c2f10 Add persona titles (#4224)
* Add persona titles

* Refactor persona title editing
2025-07-03 19:28:09 +03:00
Cohee d41725cd4f Fix thumbnails for backgrounds containing a single quote 2025-06-30 23:07:50 +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
Vin AstralisandCohee a7783b62a8 Add Speed Control to ElevenLabs TTS Provider (#4213)
* add speed

* Adjust speed range

* More granular step

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-06-29 02:30:24 +03:00
Cohee 1e3fada8d7 Prefer sanitize filename with extension 2025-06-28 22:25:14 +03:00
Cohee cdefddef6c Implement persona thumbnails (#4210)
* Implement persona thumbnails

* Dear Firefox, fix your overzealous image cache

* Add cache busting for avatar uploads when overwriting existing files
2025-06-28 21:39:32 +03:00
Cohee 37528c81b3 Caption: Add 'Show captions in chat' setting 2025-06-28 20:00:38 +03:00
Marcela Petra Ferraz de NovaesandCohee 34118bbdc2 Feature/Perchance AI Character Chat import (#4211)
* Adding ZLib and Jimp imports.

* Adding checks to see if UUID or URL are from Perchance.

* Adding conversion for Perchance cards and avatar.

* Adding label and example for Perchance character import.

* Adding localization of Perchance import option.

* Lint dangling comma fix.

* Simplifying one liner arrow function.

* Checking .gz at the end of Perchance url.

* Refactoring.

* Handling Base64 avatars.

* Fixing issue with UUID and refactoring.

* Adding char name to Perchance UUID example.

* Undoing unwanted variable name change of avatarBuffer to defaultAvatarBuffer

* Adding null check.

* Minor adjustments: renaming variable and organizing imports.

* Simple refactoring and reducing level of console messages.

* Add character source for perchance

* Add null check

* Use slug for source

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-06-28 16:18:26 +03:00
Vin Astralis 363192dd39 feat(elevenlabs): add new models and deprecate old ones (#4212)
* feat(elevenlabs): add new models and deprecate old ones

* feat(elevenlabs): update default model to eleven_turbo_v2_5 and enhance extended settings check
2025-06-28 15:58:09 +03:00
Cohee d91c6c28cb Translate: Update API key management 2025-06-28 15:32:29 +03:00
Cohee 579ef1e86c Refactor API key management in extensions 2025-06-26 21:24:51 +03:00
Cohee 0f73e361df Remove nomicai from secrets input map 2025-06-26 20:53:36 +03:00
Cohee 780bd1fc65 Add backfill for missing WI entries fields (#4203)
* Add backfill for missing WI entries fields
Fixes #4202

* Backfill before filter/sorting

* Fix array wrapping

* Check if characterFilter is array

* Add console debug for isArray check

* Add isArray check for entry
2025-06-26 20:48:24 +03:00
Wolfsblvt b1887a0cc2 Fix default emojis expression setting resetting (#4206)
Adjusts conditions to properly enforce mutual exclusivity between fallback expression and default emoji settings

- Ensures "[ No fallback ]" option only appears when both settings are inactive
- Updates migration logic to ONLY reset default emoji setting when fallback is active

Fixes #4205
2025-06-26 09:47:16 +03:00
Cohee 28f5b74cc7 OpenRouter: Use display name for options on text completion 2025-06-25 22:05:16 +03:00
Cohee 7bf1da7384 Perform save if fixing placement 2025-06-25 22:03:25 +03:00
Cohee 7d7f1b1e29 Check if regex script placement is an array 2025-06-25 22:01:45 +03:00
Cohee 17511c444f Hide image models from Together textgen select 2025-06-25 21:39:24 +03:00
Cohee dbe0111034 Refactor saveBase64AsFile uploads (#4200)
* Refactor saveBase64AsFile uploads

* Add request body check

* Extract server-side constants

* Allow .jfif media attachments

* Allow .bmp uploads

* Enhance image prompt handling: support additional MIME types and prevent upscaling in thumbnails

* Convert file extension to lowercase

* Enhance thumbnail creation: improve image quality and add white background

* Add toast for error in media upload
2025-06-25 21:34:08 +03:00
Cohee 7755fc50a5 Image Generation: Support video outputs for ComfyUI (#4194)
* ImgGen: ComfyUI support video outputs

* Fix video format check to handle undefined and case sensitivity

* Fix error handling and add output debug log in comfy workflows

* Refactor Comfy generation result

* Add video file extensions constant
2025-06-25 20:11:09 +03:00
Cohee 66adbea12b Merge branch 'release' into staging 2025-06-25 10:39:14 +00:00
Cohee 12a54d901e WI: exclude characterFilter fields from new entry template 2025-06-25 10:38:08 +00:00
Cohee d641089107 Merge pull request #4199 from GregW6/fix/file-attachment-1
Fix attachment file extension extraction
2025-06-25 00:21:04 +03:00
GregW6 9bfb4163d3 refactor(Attachment): ♻️ Simplify extension extraction to one line
Removing temporary variable.
2025-06-25 02:27:00 +07:00
GregW6 4785d7580c fix(Attachment): 🐛 Extract file attachment extension through file name 2025-06-24 22:03:11 +07:00
Cohee 0fa1b26fa4 Add deletion control for attached videos 2025-06-23 01:01:44 +03:00
Cohee b357e5d25e Add video preview to clean-up dialog 2025-06-23 00:39:21 +03:00
Cohee 9481f9989a Closes #4187 [FEATURE_REQUEST] Allow wildcards in Banned Strings List 2025-06-22 20:35:46 +03:00