Compare commits

..
848 Commits
Author SHA1 Message Date
Wolfsblvt ad29cbda62 docs: route new provider contributions before implementation (#6099)
* docs: route new provider contributions before implementation

* docs: point provider PR authors to integration guide
2026-10-03 00:05:27 +02:00
EmandWolfsblvt bc81b9f7e3 Change API button warning from credit to charge (#6049)
* Change API button warning from credit to charge

Updated the warning message for the test API button to indicate a charge instead of a credit. (you are using tokens to send the message, the provider is not giving you tokens because you sent a test)

* fix: clarify test message usage charges

---------

Co-authored-by: Wolfsblvt <wolfsblvt@gmail.com>
2026-09-23 23:19:13 +02:00
EmandWolfsblvt 8901f28b01 Fix typos in property descriptions in char-data.js (#6054)
* Fix typos in property descriptions in char-data.js

Wether → Whether x6

* docs: correct character description property text

---------

Co-authored-by: Wolfsblvt <wolfsblvt@gmail.com>
2026-09-23 23:16:59 +02:00
Em 9758a6cd5e Fix typo in readme regarding open source status (#6047)
Corrected 'open sourced' to 'open source' for consistency.
2026-09-23 23:08:52 +02:00
Em ca7330f1af Fix typo in comment for tool calls (#6052)
assistent → assistant
2026-09-23 23:08:18 +02:00
Em a1c7f19bac Fix typo in comment (#6053)
posible  →  possible
2026-09-23 23:07:45 +02:00
Wolfsblvt e9860754ad feat: add GPT-6 Sol and Luna, Opus 5.5, and Gemini 3.8 Flash (#6070) 2026-09-23 21:59:01 +02:00
Wolfsblvt 7c39941963 Merge pull request #6038 from SillyTavern/release
Sync npm publishing workflow to staging.
2026-09-14 21:16:18 +02:00
Wolfsblvt 06bde939fb Fix npm release publishing workflow (#6037)
Allow npm releases to be retried from an existing release tag through the trusted publishing workflow, and scope the `allow-directory` workaround to the publish command.
2026-09-14 21:01:34 +02:00
Wolfsblvt 7e8663cd9c Merge pull request #6036 from SillyTavern/staging
1.19.0
2026-09-14 19:55:46 +02:00
Wolfsblvt 61139aa9b6 Update release version number (#6035) 2026-09-14 19:44:18 +02:00
Wolfsblvt 5e8d463ed4 feat: add Claude Fable 5.1 and GPT-6 Astra (#6015) 2026-09-14 19:03:39 +02:00
F.B. c0a417b240 Add image embed for DeepSeek V4 Flash Vision Exp (#5964) (#5996)
Add deepseek-v4-flash-vision-exp to image embed whitelist.
Block image embed in non `user` msg as DS doesn't allow this.
2026-09-07 23:09:17 +02:00
X00LAandClaude Sonnet 5 cc053e8356 Fix CORS proxy forwarding raw zstd-compressed bytes to the client (#6007)
undici (Node's fetch) transparently decompresses gzip, deflate, and br,
but not zstd. When a browser's full Accept-Encoding header is forwarded
as-is to the target origin, a Cloudflare-fronted server may respond
with zstd, and corsProxyMiddleware pipes those still-compressed bytes
straight through — the client receives garbage instead of the expected
body (e.g. "SyntaxError: Unexpected token" when parsing JSON).

Cap the outgoing Accept-Encoding to the encodings undici can actually
decode, so the target always responds with something we can forward
correctly.

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-07 23:07:13 +02:00
Siyuan ChenandWolfsblvt d6b244cd25 Fix: Avoid cpSync crash when renaming characters (#6012)
* Fix: Avoid cpSync crash when renaming characters

Add a no-op filter to fs.cpSync during character renaming.

This avoids Node.js's native copyDir fast path, which can terminate
the process on Windows with affected Node.js versions instead of
throwing a catchable filesystem error.

Refs: https://github.com/nodejs/node/issues/63970

* docs: explain character rename copy workaround

---------

Co-authored-by: Wolfsblvt <wolfsblvt@gmail.com>
2026-09-07 23:05:18 +02:00
voodoohop e7c4f8ee98 fix: resolve Pollinations TTS model aliases (#6010) 2026-09-07 23:03:43 +02:00
QiuLGandQiuLG a8f7e0d900 Fix Quick Reply overwrite cancellation (#6005)
Co-authored-by: QiuLG <195722592+QiuLsG@users.noreply.github.com>
2026-09-07 23:00:44 +02:00
saitewasreset 4613abc26e Google AI Studio: Fetch all model pages (#5954)
Paginate the Gemini models endpoint before returning available
generateContent models, and reject incomplete model lists.
2026-09-01 00:58:51 +02:00
Jeremy SchoemakerandWolfsblvt dd326d244f Return a degraded preview instead of dropping a chat whose last line is unparseable (#5969)
* fix: return a degraded preview instead of {} when a chat's last line is unparseable

getChatInfo resolved an empty object when the last line of a chat .jsonl
failed to parse or lacked known fields (truncated write, external edit).
All three consumers (chat list, search, recents) drop entries without a
file_name, so an otherwise intact chat silently disappeared from the UI
while still occupying its name for uniqueness checks (#5940).

Resolve the already-built chatData instead: file_id, file_name, file_size
and mtime-based last_mes are known good from stat(), chat_items comes from
the line count, and mes falls back to the existing placeholder. Matcher
results from the intact lines are preserved for search.

Fixes #5940

* fix: exclude unreadable chat line from message count

Keep degraded previews aligned with the messages that can actually be loaded by excluding both the metadata line and broken trailing line.

---------

Co-authored-by: Wolfsblvt <wolfsblvt@gmail.com>
2026-09-01 00:38:40 +02:00
Zhewen Tan ccd8287833 fix: preserve zero NovelAI Math1 temperature (#5965) 2026-08-31 23:36:06 +02:00
Em 30eaf26a43 Update TavernAI link in README (#5987)
Update TavernAI link in README
2026-08-27 01:33:51 +02:00
PeterGriffin 98af17a8a4 fix(chat): delete associated tool calls with messages (#5949) 2026-08-21 06:35:50 +02:00
primorLee 0a9ba91852 fix: parse boolean values in env migrations (#5950) 2026-08-21 06:33:08 +02:00
Christoph 814734d4af Fix duplicate tool call IDs if provider repeats id, type, name (#5948)
Before this fix, tool call IDs were duplicated repeatedly with streaming requests if the provider repeats the "id" field in each streaming chunk:

```
{
    role: 'tool',
    content: 'content',
    tool_call_id: 'chatcmpl-tool-aa62chatcmpl-tool-aa62chatcmpl-tool-aa62chatcmpl-tool-aa62'
},
```

After this fix:

```
{
    role: 'tool',
    content: 'content',
    tool_call_id: 'chatcmpl-tool-aa62'
},
```

Example of raw streaming chunks received from Fireworks AI exhibiting this behavior of repeating "id", "type", "name":

```json
{
  "id": "chatcmpl-b7de",
  "object": "chat.completion.chunk",
  "created": 1783459695,
  "model": "accounts/fireworks/models/glm-5p2",
  "choices": [
    {
      "index": 0,
      "delta": {
        "tool_calls": [
          {
            "index": 0,
            "id": "chatcmpl-tool-aa62",
            "type": "function",
            "function": {
              "name": "debug_tool",
              "arguments": ""
            },
            "name": null
          }
        ]
      },
      "finish_reason": null,
      "raw_output": null
    }
  ],
  "usage": null
}
{
  "id": "chatcmpl-b7de",
  "object": "chat.completion.chunk",
  "created": 1783459695,
  "model": "accounts/fireworks/models/glm-5p2",
  "choices": [
    {
      "index": 0,
      "delta": {
        "tool_calls": [
          {
            "index": 0,
            "id": "chatcmpl-tool-aa62",
            "type": "function",
            "function": {
              "name": null,
              "arguments": "{\"input\": \""
            },
            "name": null
          }
        ]
      },
      "finish_reason": null,
      "raw_output": null
    }
  ],
  "usage": null
}
{
  "id": "chatcmpl-b7de",
  "object": "chat.completion.chunk",
  "created": 1783459695,
  "model": "accounts/fireworks/models/glm-5p2",
  "choices": [
    {
      "index": 0,
      "delta": {
        "tool_calls": [
          {
            "index": 0,
            "id": "chatcmpl-tool-aa62",
            "type": "function",
            "function": {
              "name": null,
              "arguments": "First"
            },
            "name": null
          }
        ]
      },
      "finish_reason": null,
      "raw_output": null
    }
  ],
  "usage": null
}
```
2026-08-21 06:16:41 +02:00
Christoph 8992872765 Fireworks: Request and process reasoning (#5947)
This change enables reasoning effort selection for the Fireworks provider as documented at https://docs.fireworks.ai/guides/reasoning#using-reasoning_effort.
2026-08-19 23:47:16 +02:00
Christoph 558d72dde2 Fireworks AI: Set session affinity header for improved caching (#5826)
This change adds a chat-specific "x-session-affinity" HTTP header to requests to Fireworks that use the full prompt. Quiet requests like summarization requests that don't use the same prompt prefix are excluded.

This improves prompt caching by
1. Adding a stable "x-session-affinity" header, which Fireworks AI recommends to route requests to the same replica
2. Separating different chats into different sessions
3. Separating main LLM calls from quiet calls which have a completely different prompt prefix

See https://docs.fireworks.ai/guides/prompt-caching.

This uses an HMAC with the cookie secret instead of simply hashing the chat title to avoid leaking chat titles. Session affinity headers may not fall under zero-data retention in Fireworks or could be cached by proxies on the way. Chat titles are tiny, so the HMAC computation is instant.
2026-08-19 23:25:15 +02:00
WolfsblvtandClaude Fable 5 4ad7af3c06 fix: use provider error fields instead of statusText for HTTP 200 errors (#5945)
Providers can return an HTTP 200 response whose body carries an error
object without a message field, or the error as a plain string. The
error message fell back to response.statusText, which is 'OK' for any
200 response, producing the opaque 'Error: OK'. Error messages now fall
back to the error's code or type field, then the string form, and only
use statusText for non-2xx responses where it carries meaning. Applies
to the non-streaming request path and both streaming error toasts.

Fixes #5647

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-19 21:05:04 +02:00
WolfsblvtandClaude Fable 5 bcc42de2e9 Give non-ASCII chat names distinct backup keys and throttles (#5944)
* fix: give non-ASCII chat names distinct backup keys and throttles

Backup filenames replace all non-alphanumeric characters with
underscores, so names such as equal-length CJK ones collapsed to the
same key and shared a single backup quota: busy chats evicted the
backups of unrelated quiet ones. The backup key now appends a short
hash of the raw name whenever the name contains non-ASCII characters,
keeping keys distinct and stable while ASCII names keep their exact
current keys and retention.

The backup throttle was also keyed per user only, so rapid saves in
one chat deferred or swallowed the backup of another chat saved in the
same window. It is now keyed per user and chat.

Fixes #5780

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix: replace stray NUL byte in backup throttle key separator

A literal 0x00 byte slipped into the template string separator, which
made Git treat the whole file as binary.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* chore: reunite backupChat docblock with its function

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-19 20:49:43 +02:00
WolfsblvtandClaude Fable 5 b4e162324b fix: mint a fresh integrity slug for new branches and checkpoints (#5943)
Branches and checkpoints inherited the parent chat's integrity UUID
through the chat_metadata spread in saveChat and saveGroupBookmarkChat,
so every member of a branch family shared one slug and the integrity
guard could not tell them apart. A save aimed at the wrong file within
the family would pass validation. New branches and checkpoints now get
their own slug at creation. Existing files are unaffected.

Fixes #5942

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-19 20:30:01 +02:00
Marcela Petra Ferraz de Novaes 2c61f3be1e fix: never resize avatars option does not work for group chat avatar (#5936)
* Check the never_resize_avatars setting to request or not cropping for group avatars.

* Change max width of thumbnail to 300px so square images are allowed.
2026-08-19 20:17:30 +02:00
48e7d605df fix(expressions): guard against null/undefined default-expression labels (#5938)
* fix(expressions): guard against null/undefined default-expression labels

Classifiers can return a falsy or literal "null"/"undefined" expression
label, and setDefaultEmojiForImage then requested the nonexistent
/img/default-expressions/null.png, producing a 404.

Fall back to DEFAULT_FALLBACK_EXPRESSION (joy) when the label is falsy,
a literal "null"/"undefined", or a custom expression without a default
asset. This is the only place the default-expressions URL is built, so the
guard covers all 404 paths.

Fixes #5863

* fix(expressions): fall back for any label without a default asset

Generalize the guard to a whitelist check against DEFAULT_EXPRESSIONS.
Every entry in that list has a matching default-expressions asset, so
any other label (falsy, literal null/undefined strings, custom
expressions, or unexpected classifier output) falls back to the
default expression instead of requesting a missing image.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Wolfsblvt <wolfsblvt@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-19 20:13:23 +02:00
WolfsblvtandClaude Fable 5 12b4fc50aa tests: set extensions enabled override for discover suite
PR #5571 added an extensionsEnabledFeatureGuard middleware that reads
extensions.enabled via getConfigValue. The test environment has no
config.yaml, so getConfig() exits the process and kills the Jest
worker, failing the extensions-discover suite. Set the env var
override so the guard resolves without touching the config file.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-19 20:06:43 +02:00
Yongjie Guan 742d5601be Prevent proxy access keys from triggering password-manager prompts in Chromium-based browsers (#5913)
* fix: prevent proxy keys from triggering password manager

Render reverse proxy credentials as visually masked text fields with password-neutral DOM identifiers while preserving existing settings, preset, and request field names. Align the Azure OpenAI key input and add regression coverage.

* fix: preserve masked secret clipboard protection
2026-08-19 20:05:15 +02:00
4ed1372411 fix: correct malformed multimodal caption request for oobabooga (#5915)
Closes #4448

The 'ooba' special case in the caption-image route split the correctly
structured message (a single user message with a content array
containing text + image_url) into two separate messages, moving
image_url to a top-level property with an empty content array.

oobabooga's own multimodal image handling (modules/image_utils.py)
only looks for images inside content array items with
type: 'image_url', so this transformation caused the image to be
silently dropped, producing hallucinated or "I can't see an image"
captions - even though the request appeared to contain valid image
data.

Removing the special case lets 'ooba' use the same, already-correct
message structure as every other multimodal-capable API.

Verified against a local oobabooga (llama.cpp/GGUF loader) with a
vision-capable GGUF + mmproj pair: before the fix, captions ignored
the attached image; after the fix, captions accurately describe real
photos.

Co-authored-by: bbastex <bbastex@users.noreply.github.com>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-17 03:33:13 +02:00
Christoph 86b55c8696 Fireworks: Update model fetching because /v1/models is broken (#5831)
* Fireworks AI: Fetch model list from custom URL

Fireworks provides the model list on a custom URL in a custom format, see https://docs.fireworks.ai/api-reference/list-models. The standard /v1/models endpoint no longer works correctly and returns a wrong list of models:

```
Available models: [
  'accounts/fireworks/models/deepseek-v4-pro',
  'accounts/fireworks/models/flux-1-schnell-fp8',
  'accounts/fireworks/models/glm-5p1',
  'accounts/fireworks/models/glm-5p2',
  'accounts/fireworks/models/gpt-oss-120b',
  'accounts/fireworks/models/kimi-k2p5',
  'accounts/fireworks/models/kimi-k2p6'
]
```

Many new models like Deepseek V4 Pro, Kimi K2.7 Code are missing.

* Fireworks AI: Add "fast" models

Some models have a "fast" variant. The model list endpoint does not return this information, so for now the available fast versions are listed explicitly.

Fast models have the same parameters (max context etc.) as the regular ones. They are only faster and cost more.
2026-08-17 03:30:30 +02:00
Martin TibkeandMartin Tibke 1a7f88861d fix(tags): drop filters for tags with no assigned entities (#5911)
Filter lists only print tags that are assigned to at least one entity, so a
persisted filter on an unassigned tag has no element to toggle. "Clear all
filters" cannot reset it either, since it works by clicking the printed
elements. The result is a character list that stays empty on every app start,
showing only an "N characters hidden" notice with no visible cause.

removeMissingTagFilters() already dropped filters for deleted tags and for
empty open bogus folders (#5225). Generalize that check to any tag without
assigned entities, which covers plain tags as well, and clear the matching
account storage entry so the filter does not come back on the next reload.

Co-authored-by: Martin Tibke <martin@tibke.net>
2026-08-17 03:01:40 +02:00
WolfsblvtandClaude Fable 5 800caeb9e0 fix: skip extension folders without a manifest during discovery (#5934)
A manually deleted extension often leaves a folder husk on disk, for
example when Windows fails to remove locked .git files. The discover
endpoint listed any directory, so the husk kept reporting as an
installed extension: /extension-exists and /extension-state returned
true after a fresh load and the manifest fetch produced a 404 in the
console on every load. Discovery now skips folders without a
manifest.json and logs a warning naming the exact path, and the
client drops any discovered name whose manifest could not be loaded
so state queries cannot report ghost extensions.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-17 02:47:08 +02:00
f91050136c fix: show full Generic textgen model list in a select (#5897)
Browsers filter datalist suggestions to the current input value, so
Generic OpenAI-compatible text completion looked like a single model
while Chat Custom's select showed the full /v1/models list. Add an
Available Models select (select2 + reconnect) matching other textgen
backends, and keep the optional free-text Model ID field.

Co-authored-by: trahloc <trahloc@proton.me>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-17 02:21:11 +02:00
f199580102 fix: remove GroupId requirement from MiniMax TTS (#5920)
* Update TTS model from Gemini 2.5 to 3.1 in TTS Extension (#5778)

* Update TTS model from Gemini 2.5 to 3.1 in TTS Extension

Added New versions and new Default model

* Add glm-5.2 option to model selection dropdown

* fix: remove GroupId requirement from MiniMax TTS

MiniMax's current API (sk-cp- keys) uses Bearer auth only. GroupId
is a legacy parameter from the pre-2025 API that the current API
tolerates/ignores. Requiring it blocks new users from setting up
MiniMax TTS.

- Backend: drop groupId from required params and URL
- Frontend: remove Group ID input field and all validation checks

Fixes #5909

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
Co-authored-by: Samueras <Samueras@jackoedv.de>
Co-authored-by: chen-jiying <chen-jiying@users.noreply.github.com>
2026-08-17 01:36:56 +02:00
eaf2858e43 fix: use exact ArrayBuffer slices for BYAF imports (#5917)
* Update TTS model from Gemini 2.5 to 3.1 in TTS Extension (#5778)

* Update TTS model from Gemini 2.5 to 3.1 in TTS Extension

Added New versions and new Default model

* Add glm-5.2 option to model selection dropdown

* Refactor file reading to use getArrayBufferSlice

* Update util.js

* Update util-pure.test.js

* test: add real-archive regression for BYAF pooled buffer handling

Builds an actual BYAF zip in memory, embeds it at an offset inside a
larger backing buffer to simulate Node's buffer pooling, and proves
through the real parser that the exact ArrayBuffer slice parses
correctly while the raw oversized backing buffer does not.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
Co-authored-by: Samueras <Samueras@jackoedv.de>
Co-authored-by: Wolfsblvt <wolfsblvt@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-17 01:28:15 +02:00
1cfdcd82e1 fix: skip non-image ComfyUI outputs (#5910)
* fix: skip non-image ComfyUI outputs

* test: cover ComfyUI gif fallback and no-output error paths

Extends the skip-non-image regression with the gifs fallback that
animated workflows rely on and the error path when no output node
carries images or gifs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: CaoBochun <caobochun@bytedance.com>
Co-authored-by: Wolfsblvt <wolfsblvt@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-17 01:19:49 +02:00
7228502f0b Add Claude Opus 5 / Sonnet 5 and Gemini 3.7 Flash / 3.6 Flash / 3.5 Flash-Lite (#5883)
* feature: add Claude Opus 5, Sonnet 5, and Gemini 3.6 Flash / 3.5 Flash-Lite

Enable adaptive thinking and strip rejected sampling/prefill fields so the new models work with Chat Completions and Image Captioning.

* feature: add Gemini 3.7 Flash

Strip rejected sampling/prefill fields and map min thinking to low so the model works with Chat Completions and Image Captioning.

* feat: refresh Claude and Gemini model lists on top of Claude 5 support

Builds on the Claude 5 and Gemini wiring in this branch: removes
retired models from the Claude and Gemini dropdowns and captioning
lists (claude-opus-4-1 verified retired with a live 404; Gemini 2.0
experimental models, 2.5 preview snapshots, and gemini-3-pro-preview
are shut down per Google's model docs), labels deprecated models
without touching option values so saved selections keep working, adds
claude-fable-5 to the captioning list, and moves new-install defaults
to claude-sonnet-5 and gemini-3.7-flash. Claude 5 generation, vision,
web search, and effort mapping verified live against the API; the
trailing-prefill test now uses a plain loop so the tests lint passes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Wolfsblvt <wolfsblvt@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-17 01:10:28 +02:00
WolfsblvtandClaude Fable 5 4f6977b779 feat: verify GPT-5.6 support and refresh OpenAI model list (#5932)
Verifies Sol, Terra, and Luna live against the API: generation,
vision, effort values (none/low/xhigh), the unlisted gpt-5.6 alias,
and the sampler contract (temperature and top_p are rejected even
with reasoning off, so the strict stripping stays). Removes models
OpenAI has shut down from the model dropdowns, labels announced
deprecations without touching option values, orders groups newest
first, and moves the new-install and captioning defaults off
gpt-4-turbo, which shuts down on October 23, 2026.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-17 00:37:46 +02:00
6fea520309 Don't do a full chat reload from /addswipe (#5903)
* Don't reload chat from addswipe

* test: add /addswipe regression and harden e2e login helper

Covers both /addswipe modes through the real command pipeline:
swipe data, counters, visible text, and message element identity,
which a full chat reload would break. The login helper now tries
accounts from last to first so password-protected accounts don't
break local e2e runs, and the test waits out fresh-account
onboarding before measuring.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Wolfsblvt <wolfsblvt@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-17 00:13:30 +02:00
aca0684c0b Fix crash when a chat is deleted during a search/recent scan (#5871)
* Update TTS model from Gemini 2.5 to 3.1 in TTS Extension (#5778)

* Update TTS model from Gemini 2.5 to 3.1 in TTS Extension

Added New versions and new Default model

* Add glm-5.2 option to model selection dropdown

* Fix crash when a chat file is deleted mid-scan

getChatInfo() stats a chat file without handling ENOENT. If the file
is deleted (e.g. from the UI) while a search or the recent-chats list
is scanning the same directory, the stat throws, and since it's inside
new Promise(async (res) => {...}) with no reject wired up, it becomes
an unhandled rejection that kills the whole server process.

This catches ENOENT and resolves with { match: false } instead, same
as the fallback already used elsewhere in this function/its callers
for corrupted or unmatched entries.

* fix: handle all mid-scan chat deletion races in getChatInfo

The stat guard alone left the function unsound: it lived inside an
async promise executor, so a non-ENOENT error became an unhandled
rejection and the promise never settled. A file deleted between the
stat and the stream opening still crashed via an unhandled stream
error, which readline re-emits, and a file truncated to empty mid-scan
hung the request because the close handler never resolved.

getChatInfo now uses plain async/await up to the streaming part,
resolves a no-match sentinel when the file vanishes at either point,
resolves an empty object on truncation, and properly rejects
everything else. Comes with deterministic regression tests for each
race window.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
Co-authored-by: Samueras <Samueras@jackoedv.de>
Co-authored-by: Wolfsblvt <wolfsblvt@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-16 23:51:08 +02:00
0x4kgi 54aedc8797 Add/enable low reasoning effort for Deepseek (#5924)
Also mapping min/minimum as low as it makes sense here.
2026-08-16 23:45:06 +02:00
b5cc683074 Update BFL generation and polling endpoints to api.bfl.ai (#5681)
* Fix BFL API endpoint and polling URL handling

* fix: send authentication header when polling BFL results

The bfl.ai API requires the x-key header on the polling request as
well; the retired bfl.ml API tolerated unauthenticated polling. Without
the header every poll returns 403 and generation never completes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
Co-authored-by: Wolfsblvt <wolfsblvt@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-16 23:41:48 +02:00
WolfsblvtandClaude Fable 5 cd2c65c9d4 fix: await chat completion preset application when switching presets (#5930)
Applying a CC preset deferred the actual settings update behind an
unawaitable event continuation, so /preset resolved before the preset
was applied. A connection profile switch runs /api, /preset, /api in
sequence, and the preset's stored chat_completion_source would land
after the final /api check, reverting the source to the previous
provider. Requests then silently went to the wrong endpoint.

The preset application chain is now captured in a promise that
selectPreset awaits, so /preset resolves only when the preset is fully
applied and follow-up commands sequence correctly. The UI dropdown
path is unchanged, and callers that do not await selectPreset keep
the exact previous behavior.

Fixes #5926
Fixes #5147

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-16 23:21:01 +02:00
ed563cb7d8 fix: reject localhost and .localhost domains in /api/search/visit to prevent SSRF bypass (#5749)
* fix: reject localhost and .localhost domains in /api/search/visit to prevent SSRF bypass

The hostname check in /api/search/visit only validated IP addresses using
ipRegex, but did not block 'localhost' or subdomains ending in '.localhost'.
This allowed SSRF bypasses to internal services via localhost URLs.

Changes:
- Add explicit rejection of 'localhost' hostname
- Add rejection of any hostname ending in '.localhost' (RFC 6761 reserved)

Closes GHSA-wm7j-m6jm-8797

* fix: enforce SSRF boundary for /api/search/visit at connection time

The URL string checks only guard the literal input. Hostnames resolving
to private addresses, redirects into internal services, and DNS
rebinding all bypassed them. The visit endpoint now routes its outbound
request through a strict PrivateRequestAgent even when the private
request filter is disabled: the resolved IP is validated at connection
time on every hop and the connection is pinned to the validated IP.
When the private request filter is enabled its configured whitelist
keeps applying, and an enabled request proxy keeps owning routing.
Also rejects bracketed IPv6 literals, which kept their brackets and
slipped past the hostname check.

Fixes GHSA-wm7j-m6jm-8797

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Wolfsblvt <wolfsblvt@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-16 22:56:44 +02:00
WolfsblvtandClaude Fable 5 32e1966757 fix: require confirmation before overwriting chats with unparseable headers (#5928)
An existing non-empty chat file whose first line could not be parsed as a
JSON object passed the integrity check as if it were a legacy chat, so a
save silently replaced the file and only the replacement got backed up.
The check now fails closed for unparseable, truncated, or non-object
headers, routing the client into the existing overwrite confirmation
dialog. A UTF-8 BOM in front of an otherwise valid header is stripped
before parsing. Empty files, valid legacy headers, and force saves behave
as before.

Fixes #5454

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-16 22:23:29 +02:00
Frank Schubert 380e31e8c5 fix: fetch only current prompt from ComfyUI history endpoint (#5790)
The ComfyUI polling loop fetches /history every 100ms to check if the
current prompt has completed. This returns the entire history, which
grows unboundedly. After ~170 generations, the JSON response exceeds
Node.js's 512MB string length limit, crashing the server with:

  RangeError: Invalid string length

Fix by requesting /history/{id} instead, which returns only the single
prompt entry needed. This is a supported ComfyUI API endpoint that
returns the same data structure.
2026-07-12 00:43:10 +02:00
Tony Gies 46bd341ec1 perf(plugins): list plugin dirs without per-entry statSync (#5690)
updatePlugins called fs.statSync on every entry returned by readdirSync
just to test isDirectory(). Pass withFileTypes to readdirSync and filter
on the Dirent type instead. Symlinks are still treated as directories.
2026-07-12 00:31:20 +02:00
Tony Gies aaf12b4925 perf(util): read each file's mtime once when getImages sorts by date (#5689)
The previous date sort read file modification times while comparing
items, which meant stat'ing the same files over and over for one
listing. mtimes are now read once per file before sorting. Files that
disappear during the call (e.g. concurrent deletion) sort to the start
instead of crashing.
2026-07-12 00:25:22 +02:00
DeathStalker471andWolfsblvt c4672e953e chore: Sync NanoGPT providers: UOMI and Wafer (#5707)
* Sync Nanogpt providers again

* Sort providers alphabetically

---------

Co-authored-by: Wolfsblvt <wolfsblvt@gmail.com>
2026-07-12 00:21:37 +02:00
cloak1505 4259eb7220 Sync OpenRouter providers list (#5686) 2026-07-12 00:04:43 +02:00
DragonFSKY 0168803f41 Fix whitespace-only reasoning block controls (#5636)
* Fix whitespace-only reasoning block controls

* Fix duplicate hidden reasoning editor

* Fix hidden reasoning open state cleanup

* Add reasoning message edit regression tests
2026-07-11 23:54:25 +02:00
Wolfsblvt 2463e83966 Fix: remove trailing whitespace from variable macros (#5848)
- Restore root lint compliance for the variable macro registry.
2026-07-11 23:23:19 +02:00
Wolfsblvt 0a1a746bfd Fix: ignore local third-party extensions during linting (#5847)
- Keep root lint focused on core sources.
- Ignore local .windsurf IDE settings.
2026-07-11 23:22:56 +02:00
Jason WuandWolfsblvt 902bd10382 Add Claude Opus 4.8, GPT-5.6 models, and migrate Gemini 3.1 Flash Lite and Gemini image models to stable (#5845)
* feature: support Claude Opus 4.8 model

* feature: support OpenAI GPT 5.6 models

* fix: replace deprecated Gemini preview model with stable gemini-3.1-flash-lite

* Fix GPT-5.6 Chat Completions effort mapping

- Map Maximum reasoning effort to xhigh because max is Responses-only
- Clarify model-specific OpenAI and adaptive Claude effort guidance
- Cover stable Gemini 3.1 Flash-Lite thinking-level routing

Tests:
- npm run test:unit -- --runInBand
- ESLint on all changed JavaScript files

* Fix: migrate Gemini image models to stable IDs

- Replace shut-down Gemini image preview selectors for Google AI and Vertex AI
- Migrate saved chat and caption model settings to the stable replacements
- Enable image generation for the stable model IDs
- Correct the Gemini 3.1 Flash Image context fallback to 128K
- Add regression coverage for stable Gemini 3 image thinking levels

Tests:
- npm run test:unit -- --runInBand
- ESLint on all changed JavaScript files

---------

Co-authored-by: Wolfsblvt <wolfsblvt@gmail.com>
2026-07-11 16:22:04 +02:00
maxime-fleury 29ed34939c Fix translation for 'Persona Description' in French (#5830)
Fix translation in french
2026-07-08 20:34:58 +02:00
Noahandransxd 37943ea4b1 Optimize World Info entry sorting to avoid O(n^2) lookups (#5809)
* Optimize World Info entry sorting to avoid O(n^2) lookups

The comparator in checkWorldInfo called sortedEntries.indexOf() twice per
comparison, making the sort O(n^2 log n). Build an index Map once and use
it for lookups instead. Sort order is unchanged.

* Address review: build index map before sort, use -1 for unknown entries

Move sortedEntriesIndex creation to immediately before the activatedNow
sort so indices match the current sortedEntries array. Use ?? -1 so
externally force-activated (cloned) entries behave like indexOf(-1).

* Skip index map when at most one entry needs sorting

Build sortedEntriesIndex only when activatedNow.size > 1, since the
comparator is not used for zero or one activated entries.

---------

Co-authored-by: ransxd <ransxd@users.noreply.github.com>
2026-07-08 20:21:46 +02:00
Lukas Straub 29e0df4886 Openrouter: Enable logprobs if requested by user (#5804) 2026-07-07 20:24:53 +02:00
6b49e9e7d0 Add claude-fable-5 support to Claude and OpenAI-compatible request builders (#5757)
* Add claude-fable-5 support to Claude and OpenAI-compatible request builders

* Fix: request Fable thinking summaries on auto

- Request summarized adaptive thinking for claude-fable auto effort when reasoning display is enabled

- Preserve existing effort mapping and sampler stripping behavior

Verification:

- node --check src/endpoints/backends/chat-completions.js

- git diff --check

---------

Co-authored-by: TheLonelyDevil9 <TheLonelyDevil9@users.noreply.github.com>
Co-authored-by: Wolfsblvt <wolfsblvt@gmail.com>
2026-07-07 20:22:32 +02:00
WolfsblvtandSamueras bba96c6fbe Update TTS model from Gemini 2.5 to 3.1 in TTS Extension (#5778) (#5824)
* Update TTS model from Gemini 2.5 to 3.1 in TTS Extension

Added New versions and new Default model

* Add glm-5.2 option to model selection dropdown

Co-authored-by: Samueras <Samueras@jackoedv.de>
2026-07-07 19:52:38 +02:00
Samueras 8172dcd0ee Update TTS model from Gemini 2.5 to 3.1 in TTS Extension (#5778)
* Update TTS model from Gemini 2.5 to 3.1 in TTS Extension

Added New versions and new Default model

* Add glm-5.2 option to model selection dropdown
2026-07-07 19:36:20 +02:00
Samueras 10ae84fb62 Add glm-5.2 to contextMap (#5770)
* Add glm-5.2 to contextMap

Add glm-5.2 to contextMap

* Update contextMap for glm-5.2 max value
2026-07-07 19:29:45 +02:00
RossAscends bf6f0b0c46 Merge pull request #5814 from underscorex86/patch-5
change novelai user information to be called from image.novelai.net
confirmed via Anlatan discord announcement.
2026-07-04 13:51:32 +09:00
underscore_x 3594fe224a change user information to be called from image.novelai.net
"for 3rd party API customers: GET /user/information, GET /user/data, GET /user/subscription should now be called from https://image.novelai.net. The old URL will be non-functional in a couple of hours. The old URL is currently non-functional."

from NAI devs, this change has already been implemented from NAI side, no backward compat.
2026-07-04 05:43:04 +01:00
Tosd 1ca70787f9 Add gemini-3.5-flash to Google AI Studio and Vertex model lists (#5675) 2026-05-20 13:06:50 +03:00
Cohee 691f0ce604 Temporarily comment out allow-remote setting in .npmrc due to npm bug (#5668)
https://github.com/npm/cli/issues/9347
2026-05-19 21:04:48 +03:00
Cohee fe048f6bdc Improve remote tokenizer encode validation (#5665)
* fix: handle unsupported text generation types in encode endpoint

* fix: simplify URL handling in encode endpoint by using trimV1 utility
2026-05-19 00:45:56 +03:00
Blueberry 93bd9e217e Macros: Access array and object elements (#4383) (#5649)
* Macros: Access array items by index (#4383)

* Macros: Access array and object elements (#4383)

* fix spacing

* setvarkey setvarindex

* setglobalvarindex getglobalvarindex
2026-05-19 00:13:47 +03:00
Cohee fd582be5ca Add rate limit to account reset (#5603) 2026-05-18 23:25:50 +03:00
Cohee 3a453d4cfa Enforce stricter npm source restrictions in .npmrc (#5663) 2026-05-18 22:51:39 +03:00
40ca51f4f1 Pollinations: Add API endpoint selection (#5625)
* Split Pollinations into two separate API providers: (Key) and (No Key)

- Replaces the single "Pollinations" source with two distinct entries:
  - "Pollinations (Key)": uses gen.pollinations.ai/v1 with Bearer token auth,
    supports BYOP OAuth flow with app key pk_Gu8Ta8q6QhS67hSg and manual key entry
  - "Pollinations (No Key)": uses text.pollinations.ai/v1, no authentication required
- Renames CHAT_COMPLETION_SOURCES.POLLINATIONS to POLLINATIONS_KEY/POLLINATIONS_NOKEY
  throughout the codebase (constants, endpoints, frontend scripts)
- Adds BYOP authorize button and OAuth callback handler for key-based source
- Updates all data-source attributes, secret key mappings, model selectors,
  tool-calling, reasoning, slash-commands, caption, and SD extension references

https://claude.ai/code/session_01T57Cm84cv2GiSL4DPCccBj

* Fix POLLINATIONS_NOKEY: exempt from API key check, fix placeholder text

- Add POLLINATIONS_NOKEY to the keyless providers exemption in the
  /generate endpoint's API key guard (was hitting the 400 check)
- Remove 'pk_...' from the key input placeholder since pk_ is the
  app key used in the BYOP auth link, not the user's secret key

https://claude.ai/code/session_01T57Cm84cv2GiSL4DPCccBj

* Add Pollinations anonymous/authenticated endpoint selector

Implements reviewer feedback to use a single Pollinations provider with
an endpoint dropdown (similar to Z.AI) rather than two separate sources.

- Add POLLINATIONS_ENDPOINT enum (anonymous / authenticated)
- Anonymous uses text.pollinations.ai/v1, no API key required
- Authenticated uses gen.pollinations.ai/v1, requires sk_... key with BYOP OAuth support
- Key input and BYOP button are hidden when anonymous endpoint is selected
- Backend skips key guard for anonymous requests
- Reasoning effort and JSON schema only sent for authenticated mode
- Connection status check passes for anonymous without a saved key

https://claude.ai/code/session_01T57Cm84cv2GiSL4DPCccBj

* Fix broken Pollinations references after resolving merge conflicts

- Replace POLLINATIONS_KEY/NOKEY in CHAT_COMPLETION_SOURCES with POLLINATIONS
- Fix SECRET_KEYS.POLLINATIONS → SECRET_KEYS.POLLINATIONS_KEY in backend
- Update all chat_completion_sources references in openai.js to use unified POLLINATIONS
- Consolidate duplicate model select/change handlers into single pollinations_model
- Keep backward compat in caption-image handler for pollinations_key/nokey multimodal API
- Fix openai.js inline handler to route pollinations to correct endpoint based on endpoint field

https://claude.ai/code/session_01T57Cm84cv2GiSL4DPCccBj

* Complete Pollinations unification: remove all pollinations_key/nokey splits

- Fix committed merge conflict in openai.js (Wolfsblvt review)
- Replace POLLINATIONS_KEY/NOKEY in chat_completion_source dropdown with single POLLINATIONS option
- Replace pollinations_key,pollinations_nokey in all data-source attributes with pollinations
- Merge duplicate /pollinations_key and /pollinations_nokey multimodal routes into single /pollinations
- Update caption extension: single "Pollinations" option using pollinations_endpoint from oai_settings
- Update slash-commands.js model selector to single pollinations entry
- Clean up caption-image handler (openai.js) to use only 'pollinations' api type
- Pass pollinations_endpoint in caption request body (shared.js)
- Add settings migration: pollinations_key → pollinations, pollinations_nokey → pollinations (anonymous)

https://claude.ai/code/session_01T57Cm84cv2GiSL4DPCccBj

* Address Cohee review: named constants, mock key, revert POLLINATIONS_KEY rename, default to authenticated

- Use POLLINATIONS_ENDPOINT named constants throughout (no magic 'anonymous' strings)
- Use mock key pattern (set key to POLLINATIONS_ENDPOINT.ANONYMOUS value) so no guard exception needed
- Revert POLLINATIONS_KEY rename back to POLLINATIONS in secrets.js files
- Default pollinations_endpoint to AUTHENTICATED so saved keys aren't bypassed
- Remove redundant isPollinationsAnon check from getReasoningEffort() (backend handles it)
- Unify tool-calling.js, caption, shared, stable-diffusion to single POLLINATIONS source

https://claude.ai/code/session_01T57Cm84cv2GiSL4DPCccBj

* Fix ESLint padded-blocks error in BYOP OAuth callback

https://claude.ai/code/session_01T57Cm84cv2GiSL4DPCccBj

* fix: regression in caption API validation

* fix: remove unneeded migration

* fix: remove duplicate keyless check in apiSourceConfig

* fix: regression in extractReasoningFromData

* refactor: simplify UI unhide logic

* fix: remove BYOP flow due to security concerns

* fix: use a string instead of a constant reference for placeholder key

* fix: reconnect when switching endpoints

* feat: support pollinations in /api-url command

* fix: remove endpoint check from image generation (it always uses authenticated)

* fix: default to authenticated

* fix: use a named constant in auto-connect logic

* fix: filter by modality in anon models list

* fix: remove bespoke model loading logic for anon endpoint

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
2026-05-18 22:45:53 +03:00
Wolfsblvt 060f224f28 Add MessageFormatter: a structured hook system for extensions to transform message content pre-DOM (#5652)
* feat(core): add MessageFormatter pipeline for extension message hooks

Introduces a new MessageFormatter singleton class (public/scripts/message-formatter.js)
that allows extensions to transform message text at well-defined stages of the
messageFormatting() pipeline, before the result reaches the DOM.

The pipeline exposes three hook stages (all before DOMPurify sanitization):
- BEFORE_REGEX  -- raw Markdown, before custom regex rules
- AFTER_REGEX   -- plain Markdown, after regex, before showdown conversion
- AFTER_MARKDOWN -- rendered HTML, after showdown, before sanitization (default)

There is intentionally no post-sanitize stage to prevent XSS vectors.

Extensions register hooks via getContext().messageFormatter.addHook(fn, { stage, order }).
Stage and order enums (formatting_stage, hook_order) are re-exported on the
singleton instance itself so extensions need no additional imports beyond getContext().

The formatter also exposes a .format() shim over messageFormatting() for
convenience. messageFormatting() itself gains full JSDoc documentation.

* feat(core): add pipeline documentation to MessageFormatter.format()

Adds detailed JSDoc documentation to the MessageFormatter.format() method
describing the complete 11-step message formatting pipeline, from prompt-bias
stripping through DOMPurify sanitization. Clarifies that all extension hooks
(beforeRegex, afterRegex, afterMarkdown) run before sanitization to ensure
their output is always sanitised.

* feat(core): add async detection and non-string return guards to MessageFormatter

Adds runtime and registration-time safety checks to the MessageFormatter hook system:
- Throws TypeError at registration if an async function is passed to addHook()
- Emits console warning and ignores return value if a hook returns non-string at runtime
- Detects Promise returns and includes helpful hint that hook may be async
- Updates JSDoc to clarify synchronous string return requirement and error conditions

* test(frontend): add comprehensive e2e tests for MessageFormatter

Adds full test coverage for the MessageFormatter singleton class including:
- Module exports validation (formatting_stage, hook_order enums)
- Singleton instance constant re-exports
- Registration validation (rejects non-functions, async functions, unknown stages)
- Hook execution pipeline (stage isolation, order sorting, context freezing)
- Error handling (continues on throw, warns on non-string/Promise returns)
- Stage injection

* refactor(core): rename ch_name parameter to characterName in MessageFormatter

Renames the `ch_name` parameter to `characterName` throughout MessageFormatter for improved code clarity and consistency with modern naming conventions. Updates JSDoc typedef and method signatures.
2026-05-18 21:51:16 +03:00
Wolfsblvt aec9754b31 Fix: Scoped comment macro {{//}}...{{///}} not removing its content (#5643)
* fix: handle scoped comment macro closing tag tokenization edge case

The lexer greedily tokenizes '//' before '/', causing {{///}} to parse as {{// /}} instead of {{/ //}}. Added special case detection in MacroCstWalker to check if the comment macro's first argument starts with '/' and treat it as a closing block. Removed list/strictArgs flags from comment macro definition and added comprehensive e2e tests for scoped comment blocks.

* refactor: DRY, remove unneccessarily duplicated private extractMacroInfo
2026-05-18 21:48:49 +03:00
Wolfsblvt 9f8c3e156a Lorebook "Apply Current Sorting" — Order control, ascending mode, step size, and live validation feedback (#5653)
* feat: enhance world info sorting with ascending/descending modes and animation

- Add autoFocus property to popup inputs with autofocus attribute and tabIndex
- Add slide animation to setInfoBlock/clearInfoBlock with configurable animate option
- Replace simple input prompt with detailed popup for applying current sorting
- Add ascending/descending order toggle for world info entry sorting
- Add configurable step value between order assignments
- Add real-time warning when starting value is below

* fix: improve world info sorting warning to account for step value

- Update warning calculation to consider step size when detecting order collisions
- Add step input parameter to updateWarning function
- Attach input listener to step field for real-time warning updates
- Display more detailed warning message showing the calculated final order value
2026-05-18 20:14:45 +03:00
Wolfsblvt 355598bb30 fix: disable pipe/filter feature to prevent breaking macros with pipe characters in arguments (#5644)
Temporarily commented out Filter.Pipe and Filter.EscapedPipe token handling in MacroLexer to fix issue where pipe characters in argument values (e.g., {{setvar::foo::|bar}}) were incorrectly parsed as filter operators. Added regression tests for pipe handling in argument values and skipped existing output modifier tests until filter flag (>) logic is properly implemented.

Resolves: #5618
2026-05-18 19:56:38 +03:00
mekineerandCohee 45d166ff6a fix(autocomplete): guard MutationObserver against detached textarea (#5660)
When a textarea is removed from the DOM before the autocomplete
clone-positioning logic runs, parentElement is null and
MutationObserver.observe throws. This can happen when extensions
abort generation early (via generate_interceptor) and the textarea
is torn down before autocomplete finishes setup.

Add a null check so the observer is only attached when the parent
still exists.

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-05-18 19:35:36 +03:00
realyxl 69cf5571ba Update outdated readme-zh_cn.md and readme-ja_jp.md (#5659) 2026-05-18 19:33:36 +03:00
加乘 81be2c51a2 Update outdated readme-zh_tw.md (#5639) 2026-05-18 19:32:19 +03:00
DeathStalker471 a900958bef chore: Sync NanoGPT providers: Tensorix, and Xiaomi (#5646)
* Sync NanoGPT providers, Tensorix, and Xiaomi

* fix lint
2026-05-18 19:31:18 +03:00
underscore_x 56061f793c fix mislabelled popup for "Replace existing Quick Reply set" (#5662)
* fix mislabelled popup for "Replace existing Quick Reply Set"

it currently provides a popup asking for confirmation "Replace existing World Info" when user tries to create a new QR Set with an existing name.

Checked that it does not conflict/reuse anything from the actual world info screen.

* capitalisation
2026-05-18 19:30:26 +03:00
FeldherrenandCohee 77ba2c21a5 Add message indicating that the 'Request mode reasoning' checkbox controls whether reasoning is generated at the source, for Deepseek API (#5633)
* Add message indicating that the 'Request mode reasoning' checkbox
controls whether reasoning is generated at the source, for Deepseek API.

* Added zai and moonshot to conditions for showing message indicating reasoning is enabled/disabled by 'request model reasoning' toggle..

* Added new message indicating openrouter's behaviour when 'request model reasoning' setting is disabled.

* fix: grammar

* fix: duplication for openrouter

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-05-13 22:43:37 +03:00
Leandro Jofré 597517730b Feat/New features for character expressions (#5574)
* update: improve fetching of selected default expression
It includes the fallback values #emoji and #none.

* update: allow expression-list to filter custom expressions
It can allow, filter out, or only include custom expressions in the result.

* update: separate getLastExpression from the slash command to use on macros

* feat: register defaultExpression macro
It will fetch the label of the currently selected global fallback expression.

* feat: register lastExpression macro
It will return the last expression used by the selected character.

* feat: register availableExpressions macro
Returns a list of all expressions provided by the Classifier API.

* update: fix macros labels

* update: normalize return label for defaultExpression macro

* Fix - Typos

* Update - Add compatibility with old macro engine

* Fix - Remove redundant structuredClone

* Update - Consider sprite folders to fetch the last expression used

* Update - Improve last message handling when name is provided

* Fix - Update description of getLastCharacterMessage

* Update - Bring back using active character as fallback for groups
Just weighted that if no name is provided, doing fallback to the active character generating prompt is more useful for groups than grabbing the expression used by another character, after randomly removing that prev commit.
2026-05-13 22:35:45 +03:00
44af6bc169 Update persona lore on WI rename (#5637)
* Fix personal lore stale update on rename (#5628)

* Add test for rename persona lore

Co-authored-by: Copilot <copilot@github.com>

* Fix stale update on personal lore rename

Co-authored-by: Copilot <copilot@github.com>

Given the recent work to fix #5610, this is a continuation to fix a
similiar bug in the persona lore.

* Add newline for linter check

---------

Co-authored-by: Copilot <copilot@github.com>

* feat: update links for other personas

---------

Co-authored-by: Unnatural Developer <40277404+unnaturaldeveloper@users.noreply.github.com>
Co-authored-by: Copilot <copilot@github.com>
2026-05-13 22:04:03 +03:00
RojikkuandCohee 3913dfffb9 fix(content-manager) parseChubUrl should clean URL before relying on length (#5604)
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-05-13 22:03:26 +03:00
Tantoofaaz777 d08bbb1096 Skip inactive autocomplete repositioning (#5635) 2026-05-13 20:53:50 +03:00
Manthan AwganandCohee b1f5c29921 Refactor custom header and body handling in OpenAI scripts to use substituteParams function for improved parameter substitution. (#5627)
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-05-13 20:43:58 +03:00
Cohee bfff81bbf9 fix: event type in note-position command (#5624) 2026-05-12 00:54:26 +03:00
Unnatural DeveloperandCohee d5b6b7924b Fix stale chat bound lore name after rename (#5610)
* Add test to reproduce chat lore bug

Co-authored-by: Copilot <copilot@github.com>

Given that I wanted to reliably reproduce the bug, I created a playwright Docker container as part of this commit, along with the applicable unit test. The included docker-compose includes an environment variable that is passed for use by the frontend test harness, default to the host that the playwright and the ST instance containers are running on.

* Fix stale chat bound lore name after rename

Co-authored-by: Copilot <copilot@github.com>

Given the function renameWorldInfo and the resulting call to updateWorldInfoLinks, this fix ensures that if the world_info key in the chat_metadata is still set to the old name, it will be updated to the name

Resolves: #5608

* Start to separate test runner from branch

Given the bug fix for #5608 should be separate from the test runner
compose file, this commit removes the file from the branch associated
with the bug fix.

* Fix frontend test setup to check for login page

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>

* Make change to eslint configuration

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>

Given the updates to the setup of frontend-utils, configure eslint to
recognize browser and jquery specific globals

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-05-12 00:27:11 +03:00
CasualAutopsyandCohee e0c1dbad8f Add expand editor button to CC quick prompts (#5607)
* Add expand editor button to quick prompts

* fix: clean-up html

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-05-12 00:25:37 +03:00
ReithanandCohee 37b3e9e461 fix /tokens command returning inflated count for OpenAI API (#5601)
* fix /tokens command returning inflated count for OpenAI API

* Apply repo owner's patch to improve token counting fix

- Remove artificial 'role: system' wrapper that caused inflated counts
- Initialize token_count to 0 instead of -1
- Simplify web tokenizer to join message content directly
- Maintains caching functionality while fixing the overhead issue

* lint

* Revert to using cached implementation

* lint 2: revenge

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-05-12 00:19:48 +03:00
Wolfsblvt 29a18ce0c6 Refactor getUniqueName utility for allowBaseName option (#5602)
* feat: add allowBaseName option to getUniqueName utility function

* feat: simplify getUniqueName by removing allowBaseName option and changing default startIndex to 0
2026-05-05 22:33:04 +03:00
Cohee 51ad27fb86 Merge pull request #5591 from SillyTavern/staging
Staging
2026-05-03 18:45:46 +03:00
Cohee 982dfec022 Update release version number (#5590) 2026-05-03 18:44:24 +03:00
Forkoz 95ca4315bd Add encode_special_tokens to tokenizers.js (#5589) 2026-05-03 18:39:36 +03:00
Cohee 97392a4ca0 Refactor extension management and assets download menu (#5583)
* feat: refactor extension and asset management

* feat: refactor name selector

* fix: make text localizable

* fix: handle abort errors in extension version checks

* fix: replace returns with throws

* fix: remove debug prefix from toast

* fix: preserve file names of imported characters
2026-05-02 20:01:44 +03:00
Cohee e5ae782705 Add option to return malformed JSON string from extractJsonFromData (#5578)
* feat: add option to return malformed JSON string from extractJsonFromData
Fixes #5569

* fix: add fallback for Perplexity case
2026-05-02 18:31:06 +03:00
Cohee 9d61bbc3ed fix: npm audit package dependencies (#5572) 2026-05-02 17:41:39 +03:00
Cohee 3eb3861596 Extension clone improvements (part 2) (#5571)
* fix: remove the cloned directory if it contains no manifest

* fix: apply feature flag guard to user extension data hosting

* fix: disable inactive controls when feature flag is off

* fix: change response status to 404
2026-05-02 17:08:57 +03:00
CoheeandCopilot c325c6d8e9 Add account version tags to cookies (#5563)
* feat: add user account version to session cookie

Co-authored-by: Copilot <copilot@github.com>

* feat: include user handle in account version hash calculation

* feat: refactor recovery code generation to use a dedicated function

* fix: don't overwrite current session version if updating another user

Co-authored-by: Copilot <copilot@github.com>

* fix: reset session version instead of nullifying the entire session

* fix: short circuit and clear cookie on request invalidation

Co-authored-by: Copilot <copilot@github.com>

* fix: update account version on recovery

---------

Co-authored-by: Copilot <copilot@github.com>
2026-05-02 17:07:57 +03:00
Leandro Jofré 91c40280ed Update/Turn expression-set-fallback into expression-fallback (#5564)
* Update - Turn expression-set-fallback into expression-fallback
Make the extension a getter and setter instead of a setter only.

* Update - Rewrite the help string and add usage examples

* Fix - Remove the alias
2026-05-01 17:04:49 +03:00
CoheeandCopilot b2fa6a0afb Add rate limit to basic auth middleware (#5504)
* feat: add rate limiting to basic auth flow

* fix: round up retry-after duration

* feat: enhance point consume logic

* fix: move unauthorized webpage reading inside response function

* refactor: move getIpAddress to express-common

* fix: check for rate limit before checking creds

* fix: use correct rate limit pattern in /recover-step2

* feat: handle CF forwarded IP header in rate limit, whitelist and access logger

* feat: add individual config toggles for forwarded headers

* feat: enhance IP address retrieval to include forwarded IP for access logging

* chore: clean-up diff

* fix: don't consume points for missing credentials

* feat: log rate limited method and URL

Co-authored-by: Copilot <copilot@github.com>

* feat: make rate limiter points configurable

Co-authored-by: Copilot <copilot@github.com>

* feat: implement retry-after header for rate limiting responses

Co-authored-by: Copilot <copilot@github.com>

---------

Co-authored-by: Copilot <copilot@github.com>
2026-05-01 00:09:24 +03:00
DeathStalker471andCohee 4ca9863f38 feat: add nanogpt provider selection (#5544)
* add nanogpt provider selection

* update payg text

* fix: resync providers from endpoint

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-04-30 23:55:42 +03:00
Leandro Jofré 3a9c10d680 Feat - Add expression-set-fallback slash command (#5551)
* Feat - Add expression-set-fallback slash command

* Fix ESLint

* Fix - Use proper name convention for slash command method

* Fix - Change misleading expression-set-fallback help string label

* Fix - Use normal description for expression label argument

* Update - Make expression-set-fallback case unsensitive
Also fixed array creation by removing the spread syntax and added warning.
2026-04-30 23:41:04 +03:00
Reithan 338e35fc8a Fix json schema use for openAI compat CUSTOM endpoints in several use paths (#5561)
* pass jsonSchema options through sendStreamingRequest in Generate

* translate json_schema to response_format for CUSTOM chat completion source

* pass jsonSchema through generateGroupWrapper params in group chat generation
2026-04-30 23:38:01 +03:00
CoheeandCopilot 5512473b29 Extension management improvements (#5552)
* feat: enhance asset management with extension categories

Co-authored-by: Copilot <copilot@github.com>

* fix: enhance extension name validation in server endpoints

* feat: display extension author in the extensions list

* fix: unify server error response format

Co-authored-by: Copilot <copilot@github.com>

* feat: add splash on installing third-party for the first time

* fix: add URL format validation, unify validation error messages

Co-authored-by: Copilot <copilot@github.com>

* fix: apply object freeze to EMPTY_AUTHOR value

Co-authored-by: Copilot <copilot@github.com>

* fix: typecheck extensionName in API requests

Co-authored-by: Copilot <copilot@github.com>

* feat: add feature flag guard to extensions endpoints

Co-authored-by: Copilot <copilot@github.com>

* fix: parse URL before checking

Co-authored-by: Copilot <copilot@github.com>

* fix: use case insensitive regex check

* fix: make debug log more useful

Co-authored-by: Copilot <copilot@github.com>

* fix: add pre-validation of URL format and protocol

Co-authored-by: Copilot <copilot@github.com>

* fix: leaner installation success toast

* fix: settings data loss when extensions are disabled

* fix: don't try to auto-focus elements that don't exist

Co-authored-by: Copilot <copilot@github.com>

* fix: set Popup.defaultResult to negative

Co-authored-by: Copilot <copilot@github.com>

* revert: restore undefined default result

---------

Co-authored-by: Copilot <copilot@github.com>
2026-04-30 23:31:50 +03:00
Cohee 45f2951854 fix: temperature -> maxTemperature (#5554) 2026-04-29 03:26:27 +03:00
.:bubfix:. 44f433d10b Minor adjustments to the SVG icons. (#5546)
- Created an SVG version of the SillyTavern logo
- The modified images are 4 times smaller (-43.7 KiB), with no visible loss in quality
2026-04-29 01:34:52 +03:00
Cohee 08e1ce8ec5 Merge pull request #5549 from SillyTavern/release
Backmerge release into staging
2026-04-28 19:16:00 +03:00
Cohee aa50edcf45 fix: update backup archive to ignore migration secrets files (#5548) 2026-04-28 19:14:54 +03:00
CoheeandCopilot Autofix powered by AI 2e4ca3dabf fix: improve sanitation of toasts that bypass HTML escaping (#5540)
* fix: improve sanitation of toasts that bypass HTML escaping

* fix: replace absolute lib.js import with relative

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

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-04-28 01:00:31 +03:00
.:bubfix:. bd9479fef8 Better SVG for Kobold/KoboldCpp (#5543)
- 23 times smaller than the original.
- This time with genuine transparency.
2026-04-28 00:18:47 +03:00
crsp6447 940b3722cf Fix: Prevent crash in cachingAtDepthForOpenRouterClaude on empty content from trailing tool calls (#5541)
* Prevent crash in cachingAtDepthForOpenRouterClaude when message has no text

* Apply optional chaining suggestion
2026-04-27 23:53:14 +03:00
338119ab77 Implement private IP range request host validator (#5497)
* feat: implement private IP range request host validator for server-side HTTP requests

* feat: add link-local address support

* fix: use correct config keys

* fix: if config missing use default loopback addresses

* fix: re-use resolved address for connection

* test: add unit coverage for private request filter and proxy interaction

Agent-Logs-Url: https://github.com/SillyTavern/SillyTavern/sessions/1813593e-2263-45e2-aa53-74d39515f1df

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* test: remove request-proxy.test.js

* perf: cache resolved matches

* fix: remove unused import

* fix: use proper ipv4 loopback cidr

* fix: correct raiseError comment

* test: uses tls.connect for secure endpoints

* Implement private IP range request host validator

Agent-Logs-Url: https://github.com/SillyTavern/SillyTavern/sessions/e76ba122-136e-43ad-b4bc-ea48a01fcdda

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* Revert "Implement private IP range request host validator"

This reverts commit 14e2714702.

* fix: close request without sending status in CORS forwarding when headers were sent

* fix: not enabled -> disabled

* feat: add enableKeepAlive option to PrivateRequestAgent

Co-authored-by: Copilot <copilot@github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: anthropic-code-agent[bot] <242468646+Claude@users.noreply.github.com>
Co-authored-by: Copilot <copilot@github.com>
2026-04-27 01:51:18 +03:00
WolfsblvtandCohee 1bb2a5ea19 Fix missing filename sanitization on V2 JSON character import + harden getPngName as safety nee (#5538)
* fix: sanitize character filenames on V2 JSON import and harden getPngName

- Add missing sanitize() call in importFromJson V2 spec branch to match all other import paths
- Sanitize data.name before readFromV2() so the name field sync happens automatically
- Add sanitize() as defense-in-depth inside getPngName() to catch future oversights
- Refactor getPngName() to use getUniqueName() utility for consistent name generation

* fix: sanitize data.name before readFromV2 in importFromPng and importFromCharX

Same bug as importFromJson: readFromV2() overwrites the top-level name
with the unsanitized data.name, undoing any prior sanitize() call.
Fix by sanitizing data.name before readFromV2 so the sync preserves it.

* fix: sanitize top-level name field in JSON and CharX import paths

* fix: incorrect path rejection in isPathUnderParent

* fix: increase maxTries in getPngName

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-04-27 01:13:19 +03:00
DeathStalker471andCohee 7201d87f2e feat: Add NanoGPT credit stats UI (#5537)
* Add NanoGPT credit stats UI

* fix lint

* fix: type check

* fix: migrate inline styles to css

* feat: add sub active date display

* feat: add link to balance page

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-04-27 00:13:06 +03:00
d327412e29 Chat Completion: common model sorting and grouping settings, improved NanoGPT model list (#5536)
* Improve NanoGPT Model List

* Update token multiplier condition to !== 1 to support showing discounts

* Add Model Sorting

* rework sorting to be more compact

* feat: combine CC model sorting/grouping settings

Co-authored-by: Copilot <copilot@github.com>

* fix: adjust migration logic

Co-authored-by: Copilot <copilot@github.com>

* feat: implement grouping for Chutes

* fix: apply review suggestions

* fix: call reconnect instead of direct status check

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
Co-authored-by: Copilot <copilot@github.com>
2026-04-26 23:25:56 +03:00
CoheeandCopilot 97dba399e4 Implement S256 challenge in OpenRouter OAuth flow (#5501)
* feat: implement S256 challenge in OpenRouter OAuth flow

* fix: add error handling for missing OpenRouter authorization code

* fix: save verifier to accountStorage

Co-authored-by: Copilot <copilot@github.com>

* fix: comment on getVerifierKey

---------

Co-authored-by: Copilot <copilot@github.com>
2026-04-26 22:32:53 +03:00
Cohee 25fb4ceb50 fix: remove legacy filter state restoration (#5535) 2026-04-26 21:06:54 +03:00
Cohee c249e5384c feat: pass koboldcpp reasoning effort (#5491)
Fixes #5489
2026-04-26 00:02:07 +03:00
CoheeandCopilot 09d72828cb feat: add gemma 4 for AI studio (#5493)
* feat: add gemma 4 for AI studio

* fix: update max context return value for gemma-3n-e4b-it model

* refactor: iterate array of [regex, number]

* gemma4: enable tool calling and sysprompt

Co-authored-by: Copilot <copilot@github.com>

---------

Co-authored-by: Copilot <copilot@github.com>
2026-04-25 22:22:55 +03:00
CoheeandCopilot 09bb7622ed OpenAI: Add gpt-5.5, gpt-5.4-mini/nano, gpt-image-2 (#5529)
* feat: gpt-image-2 for OpenAI image generation

* gpt-5.5

Co-authored-by: Copilot <copilot@github.com>

* fix: adjust reasoning effort mapping

Co-authored-by: Copilot <copilot@github.com>

* fix: html format

---------

Co-authored-by: Copilot <copilot@github.com>
2026-04-25 21:46:52 +03:00
CopilotandCohee1207 7948886c1d Add Tool Call Recurse Limit slider to Chat Completion settings (#5518)
* feat: add Tool Call Recurse Limit slider to Chat/Message Handling settings

Agent-Logs-Url: https://github.com/SillyTavern/SillyTavern/sessions/ecbde89f-8f4d-4e91-9189-a998d12ca76b

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* feat: move tool call recurse limit to openai_settings under Chat Completion settings

Agent-Logs-Url: https://github.com/SillyTavern/SillyTavern/sessions/132e4c28-9564-47cd-92c1-e8ab50d88905

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* refactor: use CSS :has() selector instead of JS toggle for tool_call_recurse_limit_block visibility

Agent-Logs-Url: https://github.com/SillyTavern/SillyTavern/sessions/c562deb5-05ce-4ebf-84a0-9eeea9d24433

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* fix: wrap tool_call_recurse_limit_block in range-block for correct layout

Agent-Logs-Url: https://github.com/SillyTavern/SillyTavern/sessions/4d25a367-ac12-4e54-83b0-1543eb6f370a

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* fix: data-i18n attribute

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>
2026-04-25 21:05:39 +03:00
feg 0a493cad89 add macro support for image caption extension prompt (multimodal) (#5527)
* added macro processing to caption ext

added
`prompt = substituteParamsExtended(prompt);`
to the captionmultimodal function
(so it can use macros and stuff)

* caption ext updated from old substituteparams

* removed comment
2026-04-25 20:14:45 +03:00
Christoph 29e3136473 fix: Don't apply layout hack in Firefox Mobile while editing text (#5531)
This fixes the following bug in Firefox Mobile on Android:

**Steps to reproduce:**

1. Swipe a word into the chat input edit field in Firefox Mobile on Android, for examples "Test".
2. In GBoard (default Android keyboard), tap on a different suggestion, for examples "Rest".

**Expected behavior:** The word "Test" is replaced with "Rest".

**Actual behavior:** The word becomes "TestRest".

I confirmed with bisecting that the commit f897a4ab1a introduced the issue.

This change fixes the issue by disabling the layout hack while editing text.
Disabling the layout hack is limited to Firefox Mobile because

* I could not reproduce the bug in Chrome on Android
* This way, if it causes a new bug, only Firefox Mobile users are affected
2026-04-25 19:56:52 +03:00
DeathStalker471andCohee b1ef254f78 fix: disable HTTP keepAlive (Node 18 behavior) with a config toggle (#5519)
* implement disable keepalive, handle request-proxy and config logic

* Invert keep-alive boolean setting

* fix: clean-up server.js diff

* fix: boolean flag type

* feat: disable keep-alive by default

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-04-24 22:53:35 +03:00
77cbcd8774 feat: add DeepSeek V4 model support with thinking mode and reasoning effort (#5522)
* fix: align DeepSeek provider with V4 API

* Fix DeepSeek beta routing for standard chat completions

* feat: add DeepSeek V4 model support with thinking mode and reasoning effort

* Address DeepSeek review feedback

* Set DeepSeek default model to v4 flash

* fix: clean-up deprecated models, add migration

* fix: move reasoning effort mapping to resolveReasoningEffort

* fix: lint empty line

* fix: remove duplicate code

* fix: add coder model to migration logic

---------

Co-authored-by: dclef <drclef233@gmail.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-04-24 21:47:30 +03:00
aecbb9a2ee feat: add MiniMax as a chat completion provider (#5452)
* feat: add MiniMax as a chat completion provider

Add MiniMax (https://www.minimax.io) as a first-class chat completion
provider. MiniMax already has TTS integration in SillyTavern; this
extends support to LLM chat completions via their OpenAI-compatible API.

Supported models:
- MiniMax-M2.5 (default) — 204K context
- MiniMax-M2.5-highspeed — same capability, faster inference

Key implementation details:
- Reuses existing SECRET_KEYS.MINIMAX (shared with TTS)
- API endpoint: https://api.minimax.io/v1
- Temperature clamped to (0.0, 1.0] as required by MiniMax API
- Returns hardcoded model list since MiniMax doesn't expose /v1/models
- Full UI integration: model selector, sampler parameters, streaming

Co-Authored-By: octo-patch <octo-patch@users.noreply.github.com>

* feat: upgrade MiniMax default model to M2.7

- Add MiniMax-M2.7 and MiniMax-M2.7-highspeed to model list
- Set MiniMax-M2.7 as default model
- Keep all previous models as alternatives

* feat: independent request function, vision support, temp clamping for MiniMax

- Extract sendMinimaxRequest() following Chutes pattern (PR #4844)
  with function calling and JSON Schema structured output support
- Clamp temperature to (0.01, 1.0] on backend; limit frontend UI max to 1.0
- Enable image inlining for MiniMax M2.7 model
- Add MiniMax to slash-commands model selector and tokenizer mapping
- Add minimax_model to default preset

* feat: add VLM-based vision support for MiniMax M2.7

M2.7 does not natively accept image input. When images are detected
in messages, pre-process them via the MiniMax VLM endpoint
(/v1/coding_plan/vlm) to convert images to text descriptions before
sending to the chat completions API. Uses the same API key.

* feat: add M2-her model to MiniMax provider

M2-her is MiniMax's dialogue/roleplay-optimized model with 64K context
and 2048 max completion tokens. Text-only (no vision).

* feat: add MiniMax China endpoint (minimaxi.com) support

Add endpoint selector (Global/China) for MiniMax, mirroring the
SiliconFlow pattern. Users can now choose between api.minimax.io
(international) and api.minimaxi.com (China domestic).

* fix: merge consecutive same-role messages for MiniMax

MiniMax API rejects consecutive messages with the same role with
error 'invalid chat setting (2013)'. Merge them before sending.

* review: address PR feedback on MiniMax provider

Backend (src/endpoints/backends/chat-completions.js):
- Drop the entire MiniMax VLM image-preprocessing path; vision is no
  longer advertised for this provider, so M2.7 messages now go straight
  to /chat/completions without a separate VLM round-trip.
- Drop the json_schema -> response_format mapping (MiniMax does not
  document structured-output support; relying on it was speculative).
- Drop the backend temperature clamp; the same clamp now lives in the
  frontend so the wire payload matches what the user sees.
- Drop the MINIMAX branch in /status that returned a hard-coded model
  list; the frontend hardcodes the same list and bypasses /status via
  noValidateSources, so the round-trip was wasted.
- Add a streaming Transform + non-streaming helper that move
  <think>...</think> blocks from delta.content / message.content to
  reasoning_content. MiniMax M2.x emit chain-of-thought inline in
  content; without this transform the raw <think> tags leak into the
  rendered chat. Includes a state machine that holds back partial
  marker bytes so a marker split across SSE chunks is still detected.

Frontend:
- public/scripts/openai.js: add MINIMAX to noValidateSources so the key
  is accepted without a /models call; remove the dead saveModelList
  branch; clamp temperature to (0.0, 1.0] in createGenerationParameters.
- public/scripts/reasoning.js: add MINIMAX to the non-streaming
  reasoning_content extraction case (the backend transform now produces
  this field for MiniMax responses).
- public/scripts/slash-commands.js: add MINIMAX to the /api enum and
  add a MiniMax case to /api-url so users can switch endpoint by
  command.
- public/scripts/custom-request.js: pass minimax_endpoint through the
  override-payload merge alongside the other per-source endpoint fields.
- public/scripts/tokenizers.js: stop returning openai_model (which was
  always a MiniMax model id and thus an unknown tokenizer); fall back
  to gpt-3.5-turbo for a coarse but functional estimate.
- public/scripts/tool-calling.js: add MINIMAX to supportedSources so
  function-calling settings are exposed.
- public/index.html: drop the "-- Connect to the API --" placeholder
  option from the model select (the model list is hardcoded and always
  populated); remove minimax from the vision data-source attributes
  on the inline-media controls.
- public/img/minimax.svg: replace the multicolor brand SVG with a
  single-color currentColor version that matches the other provider
  icons in the connect panel.

* review: drop backend <think> parsing, defer to frontend

Per reviewer feedback: SillyTavern's reasoningHandler / reasoning_auto_parse
setting already extracts <think>...</think> blocks on the client side, so the
backend doesn't need to rewrite MiniMax responses. Removes the SSE Transform,
the non-streaming helper, and the corresponding case in reasoning.js.

* fix: remove isImageInliningSupported declaration for MINIMAX

* fix: remove MINIMAX from stream reasoning parsing

* fix: add to autoconnect logic

* fix: add missing MINIMAX models from docs

* fix: freq. and pres. pen aren't supported for MINIMAX

* fix: use clamp function for adjusting temperature

* fix: pass minimax_endpoint from connection profile to ChatCompletionService

* fix: update supported APIs in slash command documentation

* fix: replace bespoke merge with standard MERGE_TOOLS processing

* fix: add data-i18n attributes for headers

---------

Co-authored-by: octo-patch <octo-patch@users.noreply.github.com>
Co-authored-by: octo-patch <octo-patch@github.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-04-24 00:43:05 +03:00
StagnatingandCohee a028bec87b Display OpenRouter credit balance in UI (#5513)
* Display OpenRouter credit balance in UI

Adds a "View Remaining Credits" click handler that fetches the
current balance from the OpenRouter /credits endpoint via a new
server-side /api/openrouter/credits route, and renders it next
to the link. The anchor still points at openrouter.ai/account
so middle-click / right-click "open in new tab" keeps working.

* Return 500 on OpenRouter credits failure

* Reduce to two decimals

* Update view credits URL

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-04-23 23:21:28 +03:00
柚柚子 752ae243b9 Fix KoboldCpp vector hash deletion (#5508) 2026-04-23 23:03:59 +03:00
Theros efbff34342 feat: add getWorldInfoNames() to getContext() for WorldInfo enumeration. (#5505) 2026-04-23 11:24:10 +03:00
cloak1505 6d2165149b Sync OpenRouter providers list (#5503) 2026-04-22 22:04:15 +03:00
柚柚子 ff31ca6692 feat: add Adaptive-P controls for oobabooga (#5502)
* feat: add ooba adaptive-p controls

* fix: align ooba adaptive-p sampler order
2026-04-22 21:34:52 +03:00
4df18ccb0b Add Slug Parameter to Action Loader for Programmatic Identification (#5490)
* feat: add slug parameter to action-loader for programmatic identification

Add optional `slug` parameter to ActionLoaderHandle for easier identification via code or CSS. Update all loader.show() calls across the codebase to include descriptive slugs ('app-init', 'chat-rename', 'chat-delete', 'bulk-delete', 'chat-load', 'image-generation', 'legacy-loader'). Add data attributes (data-slug, data-loader-id, data-blocking) to toast content div. Expose slug via getter and make id private with getter.

* Apply suggestions from code review

Fix slug jsdoc wording

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

* fix: Add identifier to second loader in img gen

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-04-20 22:29:40 +03:00
TanJeeSchuanandCohee e5d4ff5fae Enhance Vectorize All process with error handling, retries and minor improvements (#5479)
* fix (vectors): Fixed Vectorize All progress report and ETA issues

* fix (vectors): Added strip reasoning block function for extras/WebLLM summaries

* feat(vectors): Retry failed summaries with configurable attempts

* feat(vectors): Skip summarization for short messages

* feat(vectors): Skip failed messages during Vectorize All instead of aborting all

Prevents the "Vectorize All" process from stopping on single-message
errors. Failed items are now skipped and reported at the end of the
session rather than aborting the entire sync.

Summarization: Implements per-message retries; failures use the original
text as a fallback or mark for skipping.

Vector Insertion: Differentiates fatal configuration errors (abort) from
transient batch failures (skip and notify).

* Resolved: 'account_id_missing' is missing

* Resolved: Refactored out summarizeSkipOnFailure() functionality into summarize() via options parameter

* Fix eslint and type checks

* feat(vectors): add types to maps and sets, improve summarize function options

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-04-20 02:33:12 +03:00
Wolfsblvt 8aeda4a101 Add Persona CRUD Slash Commands with Shared Avatar Utilities (#5466)
* Add persona CRUD slash commands with enhanced utilities

- Add `/persona-create`, `/persona-update`, `/persona-delete`, `/persona-duplicate`, and `/persona-get` slash commands for programmatic persona management
- Move `persona_description_positions` enum from power-user.js to personas.js for better encapsulation
- Add position and role parsing utilities (`parsePersonaPosition`, `parsePersonaRole`) with name-to-value mapping
- Extend `initPersona()` to accept optional position, depth, role, and lorebook parameters
- Refactor `deleteUserAvatar()` to delegate to new `deletePersona

* Add NaN validation for descriptionDepth parameter in createPersonaCallback

- Add isNaN() check for depth parameter after Number() conversion
- Display warning toast when invalid depth value is provided
- Fall back to DEFAULT_DEPTH when depth is NaN
- Change depth from const to let to allow reassignment after validation

* Refactor persona lookup to support avatar key targeting and fix enum provider currying

- Refactor `autoSelectPersona()` to accept optional `personaKey` parameter for targeting specific persona when multiple share the same name
- Replace manual persona lookup loops with `findPersona()` helper calls in `autoSelectPersona()` and `setNameCallback()`
- Update `setNameCallback()` to pass both persona name and avatar key to `autoSelectPersona()` for precise targeting
- Refactor `commonEnumProviders.personas()`
2026-04-20 02:26:08 +03:00
Wolfsblvt 15a3e3f072 feat: add click-to-edit support for reasoning blocks and auto-focus reasoning textarea (#5487)
Extend click-to-edit functionality to reasoning blocks in addition to message text. When clicking on a reasoning block, automatically focus the reasoning textarea after entering edit mode.
2026-04-20 02:11:42 +03:00
WolfsblvtandCohee 53f251c52a Fix: Prevent "Show More Messages" Button from Triggering Message Edit Mode (#5486)
* fix: prevent event bubbling on show more messages button

Replace mouseup/touchend with click event and add stopPropagation/preventDefault to prevent unintended event bubbling when loading more messages.

* Add hover style to "show more messages"

* add button role to show_more_messages

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-04-20 01:44:33 +03:00
WolfsblvtandCohee d8b3d36a84 Refactor: Replace SD image generation indicator with ActionLoader system (#5472)
* refactor: replace custom generation indicator with action-loader

Remove custom generation tracking (activeGenerations counter, generationToast) and replace with action-loader's non-blocking stoppable toast. Import loader from action-loader.js and use loader.show() with onStop callback in generatePicture() and generateMediaSwipe(). Remove updateGenerationIndicator(), startGenerationTracking(), and endGenerationTracking() functions. Remove manual stop button show/hide logic and generation counter updates

* Remove legacy stop button, add sentinel handler value

* fix: reassign loaderHandle in generateMediaSwipe

* feat: add data attributes to action-loader toast for easier selection

Add loaderId, title, and blocking data attributes to toast content div to enable programmatic identification and filtering of active loader toasts

* Revert "feat: add data attributes to action-loader toast for easier selection"

This reverts commit e8da27b4c9.

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-04-20 01:10:20 +03:00
Cohee b8f2b1cfa6 fix: enhance URL validation for Z.AI image generation (#5482)
* fix: enhance URL validation for Z.AI image generation and handle potential delays
Fixes #5480

* fix: retry 404 in a loop

* fix: handle Z.AI image and video unavailability with appropriate warnings and responses
2026-04-20 00:28:55 +03:00
Cohee b44b12b527 Add 'pm-render' command to refresh prompt manager content (#5483) 2026-04-20 00:07:25 +03:00
d720605be8 Bulk extension field updates via merge-attributes with UNSET_VALUE sentinel (#5471)
* feat: add bulk extension field updates with UNSET_VALUE sentinel for key deletion

- Add `UNSET_VALUE` sentinel constant to signal complete field removal from character cards
- Add `writeExtensionFieldBulk()` function to update extension fields across multiple characters in a single API call
- Add `deleteValueByPath()` utility function to remove nested object keys by dot-path
- Update `writeExtensionField()` to support `UNSET_VALUE` for deleting extension keys
- Extend `/api/characters/merge-attributes

* Revert package-lock.json changes

* Allow null values in merge-attributes filter path validation

Change filter.path existence check to only skip on undefined, not null. This allows merging attributes when the existing value is explicitly null, treating null as a valid value rather than absence of a value.

* fix: share forbiddenRegExp between modules

* feat: add writeExtensionFieldBulk and UNSET_VALUE constant to getContext

* Update src/endpoints/characters.js

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

* fix: validate for .png extension

* Update public/scripts/extensions.js

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

* refactor: extract shouldSkip logic as a function param to avoid double parsing

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-20 00:06:28 +03:00
b436971a09 fix: correct typo in cacheScores debug log and add JSDoc to filterDataByState (#5468)
* fix: limit max-height of select[multiple] on mobile to prevent Chrome 145+ full-screen rendering (fixes #5242)

* fix: correct typo in cacheScores debug log and add JSDoc to filterDataByState (fixes #5252)

* fix: Correct jsdoc syntax

---------

Co-authored-by: octo-patch <octo-patch@github.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-04-19 22:04:45 +03:00
Octopusandocto-patch a678299700 fix: limit max-height of select[multiple] on mobile to prevent Chrome 145+ full-screen rendering (fixes #5242) (#5467)
Co-authored-by: octo-patch <octo-patch@github.com>
2026-04-19 21:54:10 +03:00
Wolfsblvt 552936a0d8 fix: exclude other group members' reasoning from prompt context in group chats (#5473)
In group chats, only include reasoning from the currently generating character instead of all group members. This prevents reasoning from other characters being injected into the prompt context when generating responses.

- Filter reasoning in coreChat loop based on message author matching name2
- Filter reasoning in setOpenAIMessages based on message author matching name2
- Add isOtherGroupMember check before adding reasoning to messages
2026-04-19 16:08:52 +03:00
ashishch432 d1e719eb48 add claude-opus-4-7 (#5465) 2026-04-19 15:47:40 +03:00
Wolfsblvt 4003251c2f Increase Top K max value from 200 to 500 for text generation WebUI (#5474)
Raises the maximum allowed Top K sampling parameter from 200 to 500 in both the range slider and number input controls to support higher token selection limits.
2026-04-19 15:20:06 +03:00
awaaeandCohee 767746beb2 WI: Rename "New" button to "Create"
* Fix internationalization issues

* fix(i18n): update world creation key and zh-cn translations

Changes the i18n key for the world editor's "New" button to "Create" to
avoid conflict with listing filters. Updates the Chinese translation
for the "New" key to "最新" (Latest).

* fix(i18n): correct translation key for world creation button

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-04-16 21:12:58 +03:00
EnerccioandPeter Vanusanik 277285d30c implemented emit events for itemized-prompts.js (#5461)
* implemented emit events for itemized-prompts.js

* removed redundant ITEMIZED_PROMPTS_DELETED_ALL event and updated emit logic accordingly

---------

Co-authored-by: Peter Vanusanik <pvan@bach.cz>
2026-04-16 21:10:19 +03:00
WolfsblvtandCohee 0ac31c8fcd Enhanced /persona-sync Command with Range, Name Filter, and Quiet Mode (#5460)
* Add range and silent parameters to /persona-sync command with optional confirmation suppression

- Add optional start/end range parameters to syncUserNameToPersona() function
- Add silent parameter to suppress confirmation popup when needed
- Update /persona-sync slash command to accept range argument (index or range string) and named silent argument
- Parse range using stringToRange() utility, default to full chat if not provided
- Update confirmation message to reflect whether syncing all messages or specified

* Add `from` named argument to /persona-sync command for filtering by persona name

- Add `from` named argument to filter messages by persona name (case-insensitive)
- Rename `silent` argument to `quiet` with inverted default (true) for consistency
- Add userMessageNamesEnumProvider() to provide autocomplete for existing user message names in chat
- Update syncUserNameToPersona() to accept nameFilter parameter and filter messages accordingly
- Update confirmation message to reflect name filtering when

* Add async/await wrapper to sync_name_button click handler for proper promise handling

Function now has arguments, so using just the function as the event is shown as wrong usage

* Post-merge imports fix

* Use canonical command name in examples

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-04-15 23:41:10 +03:00
Cohee 3f72d3df80 Improve OpenRouter model lists in extensions (#5459)
* fix: extensions OpenRouter model lists

* fix: update JSDoc for optional mapping function parameter in fetchModelsByModality

* fix: update JSDoc to clarify return type of fetchModelsByModality function

* fix: encode output modality in fetchModelsByModality API request
2026-04-15 23:18:26 +03:00
Reithan 051346c517 Enable interleaved tool reasoning for custom OpenAI-compat endpoints (#5445)
* enable interleaved tool reasoning for custom OpenAI-compat endpoints

Add chat_completion_sources.CUSTOM to interleaved_reasoning_providers so
that local OpenAI-compatible endpoints (e.g. KoboldCPP in Chat Completions
mode) can forward reasoning context in tool-call chains when the user has
configured Interleaved Thinking.

Also expose the Interleaved Thinking UI control for the Custom source so
users can actually opt in — previously the dropdown was hidden behind a
data-source="openrouter" guard.

The custom streaming path already correctly accumulates delta.reasoning_content
from streaming chunks; this change only removes the provider gate that was
silently discarding that data before it reached the API payload.

* don't override invocation reasoning with prior-turn assistant reasoning

When an invocation already has its own reasoning captured at execution
time, preserve it instead of replacing it with previousAssistantReasoning
from the backward scan. The override was correct when invocations never
carried their own reasoning, but now that the custom/openrouter paths
capture per-invocation reasoning, the unconditional replacement caused
all tool calls in a chain to receive the same stale reasoning from an
earlier unrelated assistant turn.

Fall back to previousAssistantReasoning only when clone.reasoning is empty.
2026-04-15 23:16:39 +03:00
CasualAutopsy af7bd65f42 Impersonate with last_input_sequence (#5456) 2026-04-15 22:43:41 +03:00
CopilotandCohee1207 78628f7dbb Integrate Cloudflare Workers AI text-to-image into SD extension (#5434)
* feat: integrate Cloudflare Workers AI for text-to-image generation in SD extension

Agent-Logs-Url: https://github.com/SillyTavern/SillyTavern/sessions/efc79e4d-2119-4cdb-8afb-f26e318a38ef

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* fix: address review - use oai_settings for account ID, sort dropdown alphabetically, remove Account ID input, move debug log

Agent-Logs-Url: https://github.com/SillyTavern/SillyTavern/sessions/bf0dda38-df40-44f4-8a63-0c952b48905d

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* Clean-up diffs

* feat: add refresh models button to Workers AI section

Agent-Logs-Url: https://github.com/SillyTavern/SillyTavern/sessions/ab6b5e7a-84d2-44d1-9f6e-3d330de04ef1

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* fix: revert unrelated package-lock.json changes

Agent-Logs-Url: https://github.com/SillyTavern/SillyTavern/sessions/ab6b5e7a-84d2-44d1-9f6e-3d330de04ef1

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* Fix models loading

* refactor: update model refresh button ID and add class to select elements

* Send formData to BFL models

* fix: adjust use FormData condition

* fix: validate Workers AI account ID before proceeding with image model loading

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>
2026-04-15 22:00:08 +03:00
WolfsblvtandCohee 64c96e895c Add Streaming Display Utility and New Generation Slash Commands (/genstream, /reasoning-format) (#5438)
* Add StreamingDisplay class for live LLM generation output with floating toast panel

- Add StreamingDisplay class to show streaming reasoning and content in a floating toast panel
- Extract createModelIcon() helper from insertSVGIcon() for reusable API/model icon creation
- StreamingDisplay automatically appends inside topmost open dialog (same pattern as fixToastrForDialogs)
- Add CSS with fade-in animation, pulsating activity indicator, and separate reasoning/content sections
- Support optional model icon in header

* Add ConnectionManagerRequestService.getProfileIcon() method for retrieving profile API icons

- Add static getProfileIcon() method to ConnectionManagerRequestService
- Returns HTMLImageElement created via createModelIcon() for a given profile's API/model
- Accepts optional profileId parameter, defaults to currently selected profile
- Returns null if Connection Manager is disabled, profile not found, or profile has no API
- Import createModelIcon from script.js

* Use animation_duration directly in hide() and CSS transition instead of constant

- Remove ANIMATION_DURATION_MS constant and use animation_duration directly in hide() method
- Replace hardcoded 0.3s CSS transitions with CSS variable var(--animation-duration, 125ms)
- Read animation_duration value inline in hide() for accurate timing

* Add /genstream slash command with live streaming display and reasoning support

- Add /genstream slash command that generates text via Connection Manager with live streaming UI
- Add formatReasoning() helper function (inverse of parseReasoningFromString) to format reasoning/content into template-wrapped strings
- Add connectionProfiles enum provider for profile selection in slash commands
- StreamingDisplay: add delay parameter to hide() method (default 1000ms) to show final result before dismiss

* Add /reasoning-format slash command to format reasoning and content into template-wrapped strings

- Add /reasoning-format (alias: /format-reasoning) slash command that wraps reasoning/content using Reasoning Formatting settings
- Accept required 'reasoning' named argument and optional unnamed 'content' argument
- Validate that prefix/suffix are configured before formatting
- Return formatted string via formatReasoning() helper for use with /reasoning-parse
- Show warning toasts if prefix/suffix missing

* Rename /genstream command to /profile-genstream and move to appropriate module

* Apply messageFormatting to StreamingDisplay reasoning and content text for proper rendering

- Import messageFormatting from script.js
- Replace textContent with innerHTML using messageFormatting() in updateReasoning() and updateText()
- Pass isSystem=true for reasoning, isSystem=false for content to match formatting expectations
- Update css to utilize pre-formatted paragraphs correctly

* Strip auto-added quotes from <q> tags in StreamingDisplay and add 'mes_text' class for consistent chat message formatting

- Add CSS rules to remove browser-default quotes from <q> tags in reasoning and content sections
- Add 'mes_text' class to textContent div to match chat message formatting behavior
- Prevents double quotes when messageFormatting already adds them via <q> tags

* Add minimize/close buttons and complete state to StreamingDisplay with configurable auto-hide

- Add minimize button to collapse/restore content sections while keeping header visible
- Add close button to manually dismiss display (generation continues in background)
- Replace CSS pseudo-element with explicit LED indicator element for better state control
- Add complete() method to mark generation done: changes LED from pulsing orange to solid green
- Add configurable auto-hide delay after completion

* Add stop button to StreamingDisplay with abort support and onStop/onComplete closures for /profile-genstream

- Add stop button to StreamingDisplay when onStop handler is provided
- Add markStopped() method with solid red LED state indicator
- Add AbortController integration to /profile-genstream for request cancellation
- Add onStop and onComplete closure arguments to /profile-genstream command
- Update complete() method signature to use options object with label and delay
- Disable stop button immediately

* Position StreamingDisplay above bottom form block using CSS variable with fallback

- Change bottom positioning from fixed 20px to dynamic calculation
- Use max() to position above --bottomFormBlockSize + 5px or minimum 20px
- Ensures StreamingDisplay doesn't overlap with bottom UI elements

* Rename /profile-genstream arguments for clarity: label→generating, completedLabel→completed, hideDelay→delay

- Rename `label` argument to `generating` to better reflect its purpose as the in-progress state label
- Rename `completedLabel` to `completed` for consistency and brevity
- Rename `hideDelay` to `delay` for simpler naming
- Update all internal references and variable names to match new argument names
- Update argument descriptions and default values accordingly

* Remove variable resolution from /profile-genstream arguments: system, length, and delay

- Remove ARGUMENT_TYPE.VARIABLE_NAME from typeList for system, length, and delay arguments
- Replace resolveVariable() calls with direct argument access for system, length, and delay
- Simplify type checking to use typeof directly on args properties
- Maintain existing default values and validation logic

* Add warning toast and early return when connection profile not found in /profile-genstream

- Display toastr warning when fuzzy search fails to find matching profile
- Return empty string to prevent execution with invalid profile
- Improves user feedback for incorrect profile names or IDs

* Extract buildResultText() helper in /profile-genstream to return partial results when stopped

- Add buildResultText() helper function to centralize result formatting logic
- Return partial generated text when user stops generation instead of empty string
- Reuse buildResultText() for both stopped and completed states
- Maintains consistent reasoning formatting in both cases

* fix lint

* Update documentation to reflect argument name change from hideDelay to delay

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-04-15 21:38:13 +03:00
CopilotandCohee1207 4d67a6986b fix: missing closing bracket in jQuery selector in setInContextMessages() (#5451)
* Initial plan

* fix: add missing closing bracket in jQuery selector in setInContextMessages()

Agent-Logs-Url: https://github.com/SillyTavern/SillyTavern/sessions/756522d8-8fe8-4c14-bcea-31d520619fb5

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>
2026-04-15 21:21:32 +03:00
WolfsblvtandCohee d72f4b6fcb Emit PERSONA_CREATED event on persona duplication (#5448)
* feat: emit PERSONA_CREATED event when duplicating a persona

Adds PERSONA_CREATED event emission in duplicatePersona() to notify listeners when a persona is duplicated. Includes the new avatarId, name, and duplicatedFromAvatarId in the event payload.

* fix: event data and execution order

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-04-14 00:19:02 +03:00
WolfsblvtandCohee 737cb95adb Add clean extension lifecycle hook for optional data cleanup (#5449)
* Add 'clean' extension hook support with optional cleanup on delete

- Add hasExtensionHook() helper to check if an extension defines a specific manifest hook
- Add 'clean' hook type to callExtensionHook() JSDoc
- Add clean button to extension UI when 'clean' hook is present
- Add onCleanClick() handler to run clean hook with confirmation
- Add cleanExtension() function to execute clean hook and reload page
- Modify deleteExtension() to optionally run clean hook before deletion
- Show cleanup checkbox on extension delete popup

* fix lint

Remove unused `callGenericPopup` import from extensions.js

* Force save settings before page reload in extension clean and delete operations

Add explicit saveSettings() calls in cleanExtension() and deleteExtension() to prevent race conditions where clean/delete hooks might update settings that get lost during the subsequent page reload.

* Remove admin permission check from extension clean operation

The clean hook is extension-defined and may not require admin privileges. Permission checks should be handled by the extension's clean hook implementation if needed, rather than enforcing a blanket restriction at the UI level.

* fix: show clean button for built-ins

* Update hasExtensionHook to support built-in extensions

* Revert "Update hasExtensionHook to support built-in extensions"

This reverts commit 31be55ea66.

* Revert "fix: show clean button for built-ins"

This reverts commit 5f86fec70c.

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-04-14 00:18:43 +03:00
ReithanandCohee 1a561f3bb0 KoboldCpp: Allow grammar to keep place during continue (#5444)
* allow grammar to keep place during continue

* lint

* fix: require kai flag for grammar to be set

* fix: don't retain if grammar is empty

* fix: default to undefined if not retain

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-04-13 20:57:47 +03:00
WolfsblvtandCohee f4f390f325 Fix: Missing signature and toolSignatures fields in ChatCompletionService streaming state (#5439)
* Fix: Add signature and toolSignatures fields to ChatCompletionService streaming state object

* fix: pass images array to getStreamingReply

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-04-13 20:19:02 +03:00
Wolfsblvt 6a325d2b22 Add disabled property support to all popup input types (#5441)
Adds optional `disabled` boolean property to PopupInputConfiguration JSDoc and implements it across all input types (checkbox, text, textarea, number). When set to true, the input element will be rendered in a disabled state.
2026-04-13 19:39:16 +03:00
Wolfsblvt a7f144f28b feat: add getExtensionManifest() to extensions.js and expose via getContext() (#5442)
Returns a structuredClone of the loaded manifest for the given extension name.
Accepts either the short name or full internal key (third-party/...).
Returns null if the extension is not registered.
2026-04-13 19:27:56 +03:00
WolfsblvtandCohee 7d3d1231a9 Chore: Add persona lifecycle events (PERSONA_CREATED, PERSONA_UPDATED, PERSONA_RENAMED, PERSONA_DELETED) (#5443)
* Add persona lifecycle events (created, updated, renamed, deleted) and emit them throughout persona management functions

* fix: await event emissions

* fix: await event in convertCharacterToPersona

* fix: await PERSONA_UPDATED in callbacks

* fix: delete multiple personas without reloading the chat

* fix: add CHAT_RENAMED event and adjust welcome screen pin update logic

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-04-13 19:24:38 +03:00
Cohee 24379db88d Gemma 4 reasoning: drop newline there (#5433)
https://github.com/SillyTavern/SillyTavern/commit/9e0ecefd6456c2103fd3b195a7cefebd7e01cf67#r181874666
2026-04-10 21:31:40 +03:00
CopilotandCohee1207 ff10249ab5 Add configurable welcome screen recent chats, fix pin loss on rename, and add popup number input validation (#5436)
* Add configurable recent chats settings and fix pin loss on chat rename

- Add gear icon button to welcome screen header for settings
- Settings popup with Max recent chats (default: 15) and Collapsed recent chats (default: 3) options
- Settings stored in accountStorage as 'recentChatsSettings'
- Add PinnedChatsManager.rename() to migrate pin state when chats are renamed
- Call rename() from both character and group chat rename functions

Agent-Logs-Url: https://github.com/SillyTavern/SillyTavern/sessions/99fa84c4-a82b-4253-96ff-a0621fb63f5c

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* Fix pin rename: use file_name with .jsonl extension to match stored pin keys

The data-file attribute contains chat_name (without .jsonl), but PinnedChatsManager
stores keys using file_name (with .jsonl). Append .jsonl to both old and new names
when calling PinnedChatsManager.rename() in character and group chat rename functions.

Agent-Logs-Url: https://github.com/SillyTavern/SillyTavern/sessions/c8e4f720-1d0b-49ef-b57b-ba9d85c42d4f

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* Refactor to support number inputs

* Restore package-lock

* Use clamp() from utils.js instead of manual Math.min/Math.max

Agent-Logs-Url: https://github.com/SillyTavern/SillyTavern/sessions/1669884c-1bd3-4b60-808d-5610f24838e6

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* Revert unintended package-lock.json changes

Agent-Logs-Url: https://github.com/SillyTavern/SillyTavern/sessions/1669884c-1bd3-4b60-808d-5610f24838e6

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* Use input values instead of magic numbers

* Add auto-clamping on number inputs in popups and range placeholders in welcome-screen settings

Agent-Logs-Url: https://github.com/SillyTavern/SillyTavern/sessions/9af8ad07-77bc-46db-9ec6-0030fecf0f8d

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* Use constants for min/max chat limits to avoid hardcoded duplication in tooltips

Agent-Logs-Url: https://github.com/SillyTavern/SillyTavern/sessions/9af8ad07-77bc-46db-9ec6-0030fecf0f8d

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* Improve input validation by using Number.isFinite for min/max values in Popup class

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>
2026-04-10 21:30:43 +03:00
CopilotandCohee1207 64e8c8d964 Refactor repetitive vectorization model loading into a generic data-driven function (#5425)
* refactor: replace 12 individual load/populate functions with generic loadRemoteEmbeddingModels

Replaced 6 pairs of load+populate functions (Chutes, NanoGPT, ElectronHub,
OpenRouter, SiliconFlow, WorkersAI) with a single data-driven generic
function and a configuration map, following the pattern used by the
caption extension's processEndpoint helper.

Agent-Logs-Url: https://github.com/SillyTavern/SillyTavern/sessions/29bd42f8-b35b-442f-91fe-bd6c1092436e

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* address review: always include body, use typeof check, remove omitContentType

Agent-Logs-Url: https://github.com/SillyTavern/SillyTavern/sessions/ccfc6ba8-57fd-4411-8e12-106b5e11be86

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>
2026-04-09 23:50:32 +03:00
WolfsblvtandCohee f3521e7007 Migrate built-in extensions to use manifest-based activate hooks (#5435)
* Convert jQuery/IIFE wrappers to exported init() functions and register activate hooks in 8 extension manifests

* Convert remaining extensions to exported init() with activate hooks and await initExtensions()

- Convert jQuery/IIFE wrappers to exported init() functions in expressions, memory, quick-reply, regex, stable-diffusion, translate, tts, and vectors extensions

- Register init functions as activate hooks in extension manifests

- Properly await async initExtensions() in firstLoadInit()

* Fix eslint

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-04-09 23:49:55 +03:00
Wolfsblvt fb915b4321 Add /regex-state slash command to check regex script status (#5428)
* feat: add /regex-state command to check script enabled status

Adds a new slash command that returns 'on' or 'off' to indicate whether a regex script is currently enabled or disabled.

* refactor: change /regex-state return values from 'on'/'off' to 'true'/'false'

Updates the /regex-state slash command to return boolean string values ('true'/'false') instead of ('on'/'off') for better consistency with standard boolean conventions.
2026-04-09 23:27:36 +03:00
Alex DillsandCohee fa9a28c6f3 Fix stable-diffusion.cpp model routing and URL path handling (#5427)
* fix: include model field in sd.cpp SDAPI requests and preserve URL path

The sd.cpp integration overwrites the URL pathname when constructing
requests, which breaks proxy servers like llama-swap that use path-based
routing (e.g. /upstream/model-name). Additionally, the model field was
never included in SDAPI requests, which is required by llama-swap to
route requests to the correct backend.

Changes:
- Server: Append to URL pathname instead of overwriting (same pattern as #5178)
- Server: Pass model field through to sd-server payload
- Client: Add model name text input for sd.cpp source settings
- Client: Send model name in generate request payload

* fix: fetch models from server and populate standard Model dropdown

Instead of a separate text input for the model name, fetch the model
list from the sd.cpp server's /v1/models endpoint and populate the
standard Model dropdown. This provides a seamless experience where
users just pick a model from the dropdown like any other source.

Works with both standalone sd-server and proxy servers like llama-swap
that expose multiple models via the OpenAI-compatible models endpoint.

* fix: don't send clip_skip=1 to sd.cpp, it produces blank images

sd-server generates blank white images when clip_skip is set to 1.
Since clip_skip=1 means 'use all CLIP layers' (the default behavior),
only send the parameter when it's > 1.

* Fix eslint

* Replace string appends with urlJoin

* fix: convert URL strings to URL objects in sdcpp routes

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-04-09 23:12:21 +03:00
Wolfsblvt ff4c6fa1bb chore: add arguments logging to deprecated MacrosParser method warnings (#5429)
Extends the #logDeprecated helper to accept and log the arguments passed to deprecated methods, providing better debugging context for migration. Updates all deprecated method calls (get, has, registerMacro, unregisterMacro) to forward their arguments to the deprecation logger.
2026-04-09 22:33:54 +03:00
Wolfsblvt 81c85f8049 fix: skip pseudo-elements when generating focus-visible styles (#5430)
Prevents invalid CSS by skipping rules containing `::` (pseudo-elements like `::before`, `::after`, `::-webkit-scrollbar`) when converting `:hover` to `:focus-visible`, as pseudo-elements cannot receive focus.
2026-04-09 22:28:39 +03:00
Wolfsblvt 67eba1b472 fix: treat all English locale variants as supported fallback language (#5431)
Previously only exact 'en' was accepted as fallback when a language wasn't found. Now accepts any English variant (en-US, en-AU, etc.) to prevent spurious warnings for valid English locales.
2026-04-09 22:24:29 +03:00
Wolfsblvt df27574247 Fix: Remove unused ComfyUI RunPod API key input mapping (#5432) 2026-04-09 22:20:34 +03:00
Tony GiesandCohee a9c377c3c8 feat: add Workers AI text embeddings and multimodal captioning (#5414)
* feat: add Workers AI text embeddings and multimodal captioning

Extends the Cloudflare Workers AI integration to the vectors and
caption extensions.

Embeddings: adds workers_ai source to the vectors extension using the
OpenAI-compatible /v1/embeddings endpoint, with dynamic model listing
from the Cloudflare model search API.

Captioning: adds workers_ai as a multimodal caption API with dynamic
vision model discovery via the multimodal-models endpoint.

* Add logo svg

* Refactor caption dropdown population

* Fix order of sources

* feat: add error handling for missing Workers AI account ID

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-04-08 23:43:21 +03:00
bumpratandCohee 94a5773412 refactor(tts): remove redundant 4-space codeblock filter (#5406)
* refactor(tts): remove redundant 4-space codeblock filter

- Deleted the regex that removed lines starting with four spaces.
- Original intent was to strip "indented code blocks" (Markdown legacy syntax).
- In practice, SillyTavern already handles explicit code fences (```...``` and ~~~...~~~).
- Indented code blocks are rarely used and the regex caused unnecessary text loss in normal messages.
- Simplifies codeblock skipping logic and avoids accidental removal of valid content.

* Remove commented out code

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-04-08 22:11:21 +03:00
WolfsblvtandCohee 5e68410d4e Add Entry Preview to World Info Deletion Confirmation Dialog (#5423)
* feat: add entry preview to world info deletion confirmation dialog

Displays entry comment or first two lines of content in the deletion confirmation popup to help users verify they're deleting the correct entry.

* fix: sanitize world info entry preview text in deletion confirmation dialog

Adds DOMPurify sanitization to the entry preview text displayed in the deletion confirmation popup to prevent potential XSS vulnerabilities from unsanitized user content.

* DOMPurify -> escapeHtml

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-04-08 20:31:00 +03:00
Cohee 5ec635aa40 fix npm audit in src/electron (#5405) 2026-04-06 00:46:27 +03:00
Tony GiesandCohee 700fc05411 feat: add Cloudflare Workers AI provider (#5385)
* feat: add Cloudflare Workers AI provider

Adds support for Cloudflare Workers AI using its OpenAI-compatible API.

Workers AI-specific stuff includes:
- Model list fetching and capabilities detection
- Tokenizer auto-detection for typical hosted model families
- Streaming not supported when using structured output

Closes #5305

* Make the entire header clickable

* Add missing samplers

* Fix non-streaming reasoning parsing

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-04-06 00:24:47 +03:00
KKTsNandCohee c9c652eece fix: improve streaming error propagation and forwarded response logging (#5317)
* Fix: Improve streaming error handling and forwarded response logging

* Fix: fix ESLint error  Strings must use singlequote  quotes

* fix: preserve and log forwarded stream errors

* chore: narrow forwarded stream error fix scope

* fix: make forwardFetchResponse awaitable and forward upstream error text

* Restore original happy path handling

* Remove redundant checks in forwardFetchResponse function

* Don't send anything on parsing error end

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-04-05 23:01:47 +03:00
Cohee d96d1451ab Add IP whitelist for SSO authentication headers (#5404)
* feat: add trusted proxies configuration for SSO authentication

* Refactor check to accept IP address directly

* Refactor IP patterns validation

* Unify warning message format
2026-04-05 22:20:39 +03:00
Tony Gies a45ec30cf0 Add tests for Cache, MemoryLimitedMap, and other util.js coverage gaps (#5365) 2026-04-05 21:05:08 +03:00
Tony Gies 8d8e3833f6 Add unit tests for TavernCardValidator (#5366)
* Add unit tests for TavernCardValidator
2026-04-05 21:03:18 +03:00
Tony GiesandCohee 760263b78a Add unit tests for prompt-converters.js (#5364)
* Add unit tests for prompt-converters.js

* fix: add type annotation for prompt-converters module

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-04-05 20:54:38 +03:00
Tony GiesandCohee 128888f605 Skip TTS for voices explicitly set to disabled (fixes #4970) (#5367)
* Skip TTS for voices explicitly set to disabled (fixes #4970)

* Always show disabled message in commands and fix restoring voice map UI

* Always show a message on manual TTS trigger

* Fix null current job on disabled

* Adjust type annotation

* Force update worker when disabled play is attempted

* Treat audio control queue as manual

* Update TTS message processing to include manual flag

* Don't show toast if was already shown by manual playback

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-04-05 20:25:26 +03:00
Cohee 8e8f501279 Immutable public and global content management (#5390)
* Use custom init script instead of postinstall

* Revert changes to start scripts in src\electron

* Add global data to content manager

* Add migration for public overrides and user.css location update

* Update npm publish workflow to use 'omit=dev' flag in npm ci commands

* Rename user.css readme file

* Fix indentation in userCssMiddleware function

* Add directory creation for content target

* Restore template compile location

* Move stylesheet up in index.json

* Use path.resolve for user.css file path in userCssMiddleware

* Correct capitalization in "Not Found" error page title and heading

* Remove init run from startup scripts

* Simplify user CSS file path resolution

* Update userCssMiddleware comment
2026-04-05 19:32:28 +03:00
LumiandCohee 9e0ecefd64 Add Gemma 4 instruct, context, and reasoning presets (#5403)
* Add Gemma 4 context preset

* Add new instruction preset for Gemma 4

* Add Gemma 4 reasoning preset

* Add to index.json

* Disable wrapping, fix story string

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-04-05 19:25:11 +03:00
Cohee 0f4a0147fd Add VSCode settings for TypeScript SDK configuration (#5394)
* Add VSCode settings for TypeScript SDK configuration

* Install typescript as a dev dependency
2026-04-02 23:47:31 +03:00
Cohee 21e8cf9060 glm-5v-turbo (#5393)
* glm-5v-turbo

* Add support for image and video inlining
2026-04-02 20:19:01 +03:00
Cohee e2d8c0200f Use custom init script instead of postinstall (#5384)
* Use custom init script instead of postinstall

* Revert changes to start scripts in src\electron

* feat: add --ignore-scripts flag to npm install commands in batch and shell scripts

* feat: add --ignore-scripts flag to npm ci in Dockerfile
2026-04-01 23:34:00 +03:00
Cohee 04ef0632ee Save chat before emitting event for user message (#5389)
Fixes #5388
2026-04-01 23:19:56 +03:00
Cohee d2b2b1b4a6 fix: require long press to open swipe picker on phones (#5382)
* fix: require long press to open swipe picker on phones

* fix: clarify parameter description in assignLorebookToChat function

* fix: update event parameter type in onSwipeCounterClick to include TouchEvent

* fix: update event parameter types in onSwipeCounterClick and addLongPressEvent
2026-03-31 20:08:56 +03:00
ClaudeandCohee1207 a8021ee6e1 Fix /genraw user instruct format not applied and unwanted system newline (#5372)
* Initial plan

* Fix /genraw user instruct format and system newline bugs

- Fix Bug #1: Change default role for string prompts from 'system' to 'user'
  to ensure user instruct formatting is properly applied
- Fix Bug #2: Remove unconditional newline after system prompt when using
  instruct mode, respecting the actual system instruct format

Agent-Logs-Url: https://github.com/SillyTavern/SillyTavern/sessions/7bfd62eb-2898-468d-9ea9-42d694a394b9

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* fix: add runtime string type check for substituteParams content

* Add fallback wrap for story string

---------

Co-authored-by: anthropic-code-agent[bot] <242468646+Claude@users.noreply.github.com>
Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>
2026-03-31 01:02:31 +03:00
CopilotandCohee1207 63feac9423 feat: swipe picker expand/collapse, copy button, and left-align text (#5380)
* Initial plan

* feat: add expand/collapse, copy button, and left-align text in swipe picker

Addresses user feedback for swipe picker (added in 1.17.0):
1. Left-align swipe text (was inheriting centered alignment)
2. Add expand/collapse toggle using hidden checkbox + CSS :has
3. Add copy-to-clipboard button using shared copyText utility

Agent-Logs-Url: https://github.com/SillyTavern/SillyTavern/sessions/90892f1c-3c75-404b-a93b-2abe672cc0e3

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* revert unintended package-lock.json changes from npm install

Agent-Logs-Url: https://github.com/SillyTavern/SillyTavern/sessions/90892f1c-3c75-404b-a93b-2abe672cc0e3

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* fix: address review feedback - hide checkbox, use chevron icons, align buttons with fa-fw

- Fix checkbox visibility by using !important to override input[type=checkbox] grid display
- Change expand icon to fa-chevron-down and collapse to fa-chevron-up
- Add fa-fw class to all action buttons (copy, expand/collapse, branch, delete) for even sizing
- Add align-items: baseline to the actions container

Agent-Logs-Url: https://github.com/SillyTavern/SillyTavern/sessions/c8ca349f-3579-442a-baa1-fc138ba1d7a6

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* revert unintended package-lock.json changes

Agent-Logs-Url: https://github.com/SillyTavern/SillyTavern/sessions/c8ca349f-3579-442a-baa1-fc138ba1d7a6

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* fix: update class names for chat action elements in swipe picker

* fix: prevent chevron layout shift and swap button order

- Use single label element as icon (fa-chevron-down) instead of two
  child <i> elements toggling visibility, preventing layout shift
- Override ::before content to chevron-up when expanded via CSS
- Swap chevron and copy button order (chevron first, then copy)

Agent-Logs-Url: https://github.com/SillyTavern/SillyTavern/sessions/284283b1-6c7f-4371-bc4a-94d841513879

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* style: add comment for FA unicode value in CSS

Agent-Logs-Url: https://github.com/SillyTavern/SillyTavern/sessions/284283b1-6c7f-4371-bc4a-94d841513879

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* Rotate the chevron instead of changing content

* Make the ui full height

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>
2026-03-31 00:41:03 +03:00
CopilotandCohee1207 c918f4f36d Add opt-in toggle to keep hidden messages in chat vector index (#5378)
* Initial plan

* Add opt-in toggle to keep hidden messages in chat vector index

Agent-Logs-Url: https://github.com/SillyTavern/SillyTavern/sessions/eadc80a1-a417-40df-a374-76d7c4a46ce3

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* Revert package-lock changes

* Fix: Remove 'vectorized' class from chat messages before adding it

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>
2026-03-30 23:39:19 +03:00
XiangzheandCohee b89293418d fix: return Error objects from invokeFunctionTool and create error invocations (#5351)
* fix: return Error objects from invokeFunctionTool and create error invocations

invokeFunctionTool previously called .toString() on caught errors,
converting them to plain strings. This made the instanceof Error
check in invokeFunctionTools dead code.

Changes:
- Return Error objects directly from invokeFunctionTool
- Create error invocations with error: true flag when tools fail
- Record failed stealth tools in stealthCalls
- Preserve signature/reasoning on error invocations
- Add error field to ToolInvocation typedef

* fix: use Error.toString to avoid behavioral changes

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-03-30 23:26:48 +03:00
lunar sheepandCohee ff1ca1412a feat(secrets): update readSecret function to accept optional secret ID (#5356)
* feat(secrets): update readSecret function to accept optional secret ID

* add secret_id to ConnectionManagerRequestService payload

* fix: pass secret_id for Text Completion types

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-03-30 22:30:45 +03:00
Cohee 6bd766f857 CI: Update node to 24, run ci without scripts (#5376) (#5377) 2026-03-30 20:50:24 +03:00
Cohee 004f1336e6 CI: Update node to 24, run ci without scripts (#5376) 2026-03-30 20:49:12 +03:00
Cohee b4c721d7bc Fix npm audit in /tests (#5370) 2026-03-28 19:59:42 +02:00
Cohee e3f41666c6 Merge pull request #5368 from SillyTavern/staging
1.17.0
2026-03-28 19:22:41 +02:00
Tony Gies 271c1e22ca Fix async file deletion bugs in assets endpoint (#5363)
The delete handler had a missing `return` before `sendStatus(400)`,
causing execution to fall through to `sendStatus(200)`, a double-send
that triggers ERR_HTTP_HEADERS_SENT, which the catch block then
compounds by attempting a third `sendStatus(500)`.

Both the delete and download handlers used callback-based `fs.unlink()`
without awaiting completion. In the download handler, this caused a race
with `createWriteStream({ flags: 'wx' })` (which fails if the file
still exists). In both handlers, `throw err` inside the callback was an
unhandled exception that could never be caught by the outer try/catch.

Replace callback-based `fs.unlink()` with `await fs.promises.unlink()`
and add missing `return` statements to prevent response cascades.
2026-03-28 15:39:29 +02:00
Cohee bef7b39cbe Add glm-5.1 to models list (#5361) 2026-03-28 02:08:28 +02:00
Cohee c78f978ede fix: conditionally include secrets in user data backup (#5360)
* fix: conditionally include secrets in user data backup

* feat: add full data backup toggle

* 418 -> 403
I'm not a teapot

* Distinguish fails from disabled
2026-03-28 01:52:03 +02:00
Cohee b06a62952d Merge pull request #5359 from SillyTavern/chore/release-1.17.0
Update release version to 1.17.0 and fix audit in dependencies
2026-03-28 00:34:07 +02:00
Cohee f205128cc0 Restore typescript version 2026-03-28 00:14:45 +02:00
Cohee 16f6787aa9 Merge branch 'release' into chore/release-1.17.0 2026-03-28 00:07:37 +02:00
Cohee 322c9f03e1 Fix npm audit for path-to-regexp 2026-03-28 00:07:16 +02:00
Cohee 4371574b7f Fix npm audit for handlebars 2026-03-28 00:06:34 +02:00
Cohee f41127a0f9 Update version to 1.17.0 2026-03-28 00:04:27 +02:00
Coheeandrenovate[bot] b3f1114a68 CI: SHA hash pin dependencies in Actions (#5358)
* Add Renovate configuration file

* Delete .github/workflows/update-i18n.yaml

* chore(deps): pin dependencies (#1)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update codelytv/pr-size-labeler action to v1.10.3 (#2)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Delete renovate.json

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-27 23:57:35 +02:00
awaaeandCohee b04c974407 feat(ui): add interface to manage message swipe history (#5304)
* feat(ui): add popup to jump to a specific swipe

Adds a new "Jump to swipe history" button to message actions and makes
the swipe counter clickable on the latest message. This opens a
searchable popup allowing users to quickly find and jump to a
specific alternate swipe without having to click through them
sequentially.

- Adds a searchable swipe picker popup menu
- Makes the swipe counter interactive when multiple swipes exist
- Adds a dedicated swipe picker button to message controls

* fix(ui): hide swipe picker when there are no swipes

Ensures the newly added swipe picker button is only shown when a
message has multiple swipes available. It explicitly hides the
button for non-swipeable messages or messages with a single swipe.

* feat(ui): redesign swipe picker with direct id input

Replace text-based search with a numeric input for direct swipe navigation.
Update popup layout with a sticky header and improved scrolling behavior.
Sync input value with the currently selected swipe in the list.
Refactor styling to align with chat selection components.

* feat(ui): allow branching from specific swipes via picker

- Enable swipe picker for historical messages to inspect alternate swipes
- Add branch button to picker entries to create new chats from specific swipes
- Update saveChat and createBranch to accept chat snapshots
- Restrict swipe jumping to the active message only

* refactor(logic): consolidate swipe sync logic and simplify helpers

Update `syncSwipeToMes` to accept a target message object, enabling its
use in the bookmarks module and removing the duplicate
`applySwipeToSnapshot` function.

Also simplify `canOpenSwipePickerForMessage` and
`canJumpToSwipeForMessage` signatures by removing the redundant message
parameter.

* refactor(a11y): support dynamic roles via classes

Introduce a managed role system in the accessibility script to handle
elements that dynamically gain or lose interactive states. The mutation
observer now watches for class attribute changes and automatically
applies or clears roles (e.g., `role="button"`) using active selectors.

Updated the swipe counter to rely on this centralized system by toggling
an `.interactable` class instead of manually modifying tabindex and role
attributes. Removed the redundant 'Enter' keydown handler for the swipe
counter to prevent duplicate trigger events.

* fix(ui): compute missing token counts in swipe picker

Update renderSwipeList to asynchronously calculate token counts when
missing from swipe metadata. Introduce SWIPE_SOURCE.SWIPE_PICKER to
correctly identify swipes triggered from the picker and bypass
generation checks.

* feat(ui): enable deleting specific swipes via swipe picker

- Adds a delete button to swipe picker entries, allowing removal of specific message versions.
- Refactors deletion logic to handle removing non-current swipes without triggering animations and correctly updates indices.
- Includes confirmation dialogs and improves input focus behavior.

* refactor:Delete process inline to button click processor

* feat: universal swipe inspection and picker improvements

- Permit opening the swipe browser on any chat entry to review past generations.
- Parallelize the retrieval of token statistics to speed up list rendering.
- Format message metrics (length and tokens) into a single, concise string.
- Update the `getBranchChatSnapshot` API to accept an options object.
- Register swipe list items as interactable elements for keyboard control.
- Apply styling to prevent text highlighting on picker entries.

* fix:remove unused CSS

* fix: fix disabled styling for swipe delete button

Remove tooltips and prevent hover animations or glow effects when the
delete button is disabled in the swipe picker. Update CSS to enforce
default cursor and fixed opacity on hover for the disabled state.

* remove: Unused CSS

* Extract swipe-picker.js module

* Revert to manual ARIA role management

* Avoid scrollIntoView and scroll on open

* Fix keyboard interaction in past chats menu

* Fix a11y attribute

* fix: call refreshSwipeButtons when deleting not selected swipe

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-03-26 02:28:48 +02:00
XiangzheandCohee 94139f465e feat: add finalizeIntermediaryMessage for StreamingProcessor (#5333)
* feat: add finalizeIntermediaryMessage for streaming tool call chains

Add a lighter finalization method on StreamingProcessor that runs
before tool invocation. This ensures CHARACTER_MESSAGE_RENDERED is
emitted for streamed text messages before the tool call chain
continues, allowing extensions (TTS, image forwarding, etc.) to
process intermediary messages.

finalizeIntermediaryMessage performs essential processing:
- Code block styling (addCopyToCodeBlocks)
- Reasoning handler finalization
- Logprobs saving
- Image attachment processing
- Reasoning signature storage
- MESSAGE_RECEIVED and CHARACTER_MESSAGE_RENDERED events

Without the heavier onFinishStreaming operations:
- UI unlock (markUIGenStopped)
- Auto-swipe
- Sound playback
- Chat saving
- Swipe counter update

* fix: return Error objects from invokeFunctionTool and create error invocations

invokeFunctionTool previously called .toString() on caught errors,
converting them to plain strings. This made the 'instanceof Error'
check in invokeFunctionTools dead code - errors silently became
successful invocations, showToolCallError never fired, and the
result.errors array was always empty.

Changes:
- Return Error objects directly from invokeFunctionTool
- Create error invocations with error: true flag when tools fail
- Add error field to ToolInvocation typedef

* fix: record failed stealth tools in stealthCalls and preserve signature/reasoning on error invocations

When a stealth tool errors, its name was not added to stealthCalls, causing
shouldStopGeneration to evaluate as false. This led to an incorrect recursive
Generate('normal') call instead of stopping generation as the stealth tool
contract requires ('no follow-up generation').

Also preserve toolCall.signature and reasoningText on error invocations to
match the success path, preventing Gemini/OpenRouter multi-turn tool context
from breaking when a tool call fails.

* Clarify method comments

* fix: initialize error property in ToolInvocation to false

* Apply review suggestions

* Make options object required

* fix: remove unnecessary return statement in updateSwipeCounter method

* refactor: split tool call error handling into separate PR (#5351)

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-03-26 00:26:39 +02:00
Cohee 6f61bc8d95 Fix npm audit (yaml, picomatch) (#5354) 2026-03-26 00:18:49 +02:00
CopilotandCohee1207 319c647e13 Fix vLLM vector embeddings URL construction to preserve custom API path prefixes (#5350)
* Initial plan

* fix: use trimV1 and url-join for vLLM vector embeddings URL construction

Fixes URL path construction in vllm-vectors.js to preserve custom API
path prefixes (e.g. /compatible-mode/v1). Previously url.pathname
assignment would overwrite the entire path, stripping any prefix.

Now uses the same trimV1 + urlJoin pattern as llamacpp-vectors.js.

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>
Agent-Logs-Url: https://github.com/SillyTavern/SillyTavern/sessions/f708dd66-8961-4c23-8b8b-3ab868bf676a

* Revert package-lock

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>
2026-03-25 00:12:52 +02:00
SoniaNvmandCohee a794a3780a Renaming a lorebook now re-links itself to cards using it (with a confirmation prompt) (#5323)
* renaming a lorebook prompts to update existing links

* used suggested api and logic

* add world property to shallow function

* Fix type error in assignLorebookToChat invoke

* Remove debug console logs

* Fix activeCharacterUpdated

* Extract updateWorldInfoLinks into a func

* Invert if for an early return

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-03-24 23:48:43 +02:00
Raymond FlanaganandCohee 4839c76fb5 Handle port conflicts during server startup (#5349)
* Handle port conflicts during server startup

* Fix return type of startHTTPorHTTPS

* Update language in getAddressInUseMessage

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-03-24 23:29:25 +02:00
WolfsblvtandCohee e52c035fcd Add allowEscapeClose option to popup class for Escape key behavior override (#5340)
* feat(popup): add allowEscapeClose option to override default escape key behavior

Add `allowEscapeClose` parameter to PopupOptions to explicitly control whether Escape key closes the popup, overriding the default logic that checks for visible cancel/close buttons. When null (default), uses existing behavior; when true, allows escape even without buttons; when false, prevents escape even with buttons present.

* feat(popup): enable Escape key closing for informational popups

Add `allowEscapeClose: true` option to TEXT-type popups in export preset, persona lore, sampler select, stats, and world info assignment dialogs to allow users to dismiss these informational popups with the Escape key.

* Improve Escape key interaction in popups

* Adjust jsdoc for allowEscapeClose

* Always return CANCELLED on Escape

* fix(popup): correct jsdoc for allowEscapeClose property description

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-03-24 01:11:38 +02:00
allo-andCohee d306194c51 Fix missing model name in tokenize requests for llama.cpp (fixes #4962) (#5344)
* Fix missing model name in tokenize requests for llama.cpp (fixes #4962)

The new router mode of llama.cpp allows to switch models on the fly,
what is already supported by SillyTavern. The call to the `/tokenize`
endpoint did not contain the model name, and failed in router mode.
This patch adds the `model` parameter similar to the implementation
for other backends.

* fix: migrate vllm and aphrodite to new payload field

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-03-23 23:12:02 +02:00
45009cd0e4 Deprecate legacy loader and migrate all callsites to action-loader system with informative toasts (#5326)
* Refactor loader.js to use action-loader system and move overlay management into action-loader module

- Deprecate showLoader() and hideLoader() in favor of action-loader API
- Implement legacy functions as thin wrappers around ActionLoaderHandle
- Move overlay management (showOverlay, hideOverlay, isOverlayDisplayed) into action-loader.js
- Move Popup-based loader implementation and preloader cleanup to action-loader
- Add loader.isBlocking() method to check for active blocking overlays

* Migrate from legacy loader functions to action-loader API throughout codebase

- Replace showLoader()/hideLoader() imports with loader from action-loader.js
- Update firstLoadInit() to use loader.show() with title, message, and ToastMode.STATIC
- Pass initLoaderHandle to getSettings() for early hide during onboarding flow
- Refactor renameGroupOrCharacterChat() to use loader.show() instead of boolean flag
- Wrap handleDeleteChat() with loader.show() and proper error handling
- Update BulkEditOver...

* Update loader titles and remove redundant reload notification

- Change bookmark loader title from "Bookmark" to "Chat History" for clarity
- Remove loader notification before extensions reload (redundant with browser reload)

* lint fix

* Add splash screen support to action loader with custom overlay content

- Add `overlayContent` option to ActionLoaderOptions for custom HTML in overlay
- Implement splash screen styles with centered logo, spinner, and message
- Update firstLoadInit() to use custom splash screen instead of static toast
- Pass custom content through showOverlay() to replace default spinner
- Adjust non-blocking loader warning to account for custom overlay content

* Refactor loader overlay to use DOM elements instead of HTML strings

- Add createDefaultLoaderOverlay() function to generate fresh loader overlay elements
- Export createOverlay() method on loader utility API for external use
- Change overlayContent parameter type from string-only to string|HTMLElement|null
- Add getOverlayContent() helper to normalize custom content for Popup
- Update firstLoadInit() to build splash screen using DOM manipulation instead of template literals
- Add splash-logo class and

* Use a true ellipsis

* Adjust sizing for desktop

* Even truer ellipsis

* Add transition to splash screen and fix blur animation on hideOverlay (#5338)

* Initial plan

* Blur entire splash screen on hideOverlay, not just spinner

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>
Agent-Logs-Url: https://github.com/SillyTavern/SillyTavern/sessions/eee6c06d-7c9d-4363-bc8f-2647ed390368

* Add transition to splash-screen and fix transition detection

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>
Agent-Logs-Url: https://github.com/SillyTavern/SillyTavern/sessions/9368bc36-31a0-4a58-aebd-7b569696ff2e

---------

Co-authored-by: anthropic-code-agent[bot] <242468646+Claude@users.noreply.github.com>
Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* Add translations to supported locales

* Localize logo alt on welcome screen

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
Co-authored-by: Claude <242468646+Claude@users.noreply.github.com>
2026-03-22 03:30:23 +02:00
0e5928b13a Filter out inapplicable stop strings for Chat Completion (#5337)
* Stop strings apply to Chat Completions and should not be greyed out.

* Revert "Stop strings apply to Chat Completions and should not be greyed out."

This reverts commit 51e5cfee41.

* Stopping strings should only apply to Text Completions https://github.com/SillyTavern/SillyTavern/pull/5337#pullrequestreview-3987164461

* Custom stop strings still apply

* Also apply to non-streaming message clean-up

* This comment is now misplaced

* Oops, wrong file

* Revert package-lock change

---------

Co-authored-by: user <user@exmaple.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-03-22 03:05:14 +02:00
XiangzheandCohee 2cb1861db6 feat: add SiliconFlow.cn chat completion and embedding support (#5316)
* feat: add SiliconFlow.cn endpoint support and embedding vectors

Chat completion:
- Add endpoint selection dropdown (Global/.com vs China/.cn) to existing
  SiliconFlow provider, following the Z.AI endpoint pattern
- Backend switches API URL based on selected endpoint
- Add /api-url slash command support for endpoint switching

Embeddings:
- Add SiliconFlow as a vector/embedding source (OpenAI-compatible)
- Support both .com and .cn endpoints via siliconflow_endpoint setting
  borrowed from the main connection panel (Vertex AI pattern)
- Superset model list with platform attribution (.cn) markers
- Models: Qwen3-Embedding (0.6B/4B/8B) + BGE/BCE models (.cn only)

* Add filter by models type

* Load embedding models from endpoint

* Improve api-url command declaration

* Support endpoint override in custom-request service

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-03-22 00:52:03 +02:00
Wolfsblvt 7766d41c42 Fix: Prevent Escape Key from Closing Non-Dismissable Popups (#5327)
* fix(popup): prevent Escape key from closing popups when both cancel and close buttons are hidden

Add validation in cancel listener to check visibility of cancel and close buttons before allowing Escape key to close popup. Set isClosingPrevented flag to block subsequent close events when neither button is visible.

* feat(popup): add double-escape force-close mechanism for blocking popups

Add double-escape detection (within 500ms) to allow force-closing blocking popups that have both cancel and close buttons hidden. Show confirmation dialog warning about potential inconsistent state before allowing force-close. Track last escape press timestamp and confirmation popup state to prevent duplicate dialogs. Gracefully cancel force-close confirmation if main popup closes naturally.
2026-03-22 00:09:17 +02:00
cloak1505 e3fbc8510a Correct input_video to video_url in embedOpenRouterMedia() (#5331) 2026-03-21 23:55:42 +02:00
Xiangzhe 67f97dbe73 fix: remove deprecated xAI grok-2-image-1212 model (#5334)
The grok-2-image-1212 model was deprecated on 2026-02-24 and is no
longer available. Only grok-imagine-image and grok-imagine-image-pro
remain as valid xAI image generation models.
2026-03-21 23:45:50 +02:00
Cohee 963786758b feat(slash-commands): add stringify option to /array-wrap command for JSON primitive handling 2026-03-20 01:29:30 +02:00
WolfsblvtandCopilot Autofix powered by AI 240e9ca907 Extend Popup System with Placeholder, Tooltip, and Icon Support (+ those in slash commands) (#5322)
* feat: add placeholder and tooltip support to popup system with icon buttons

Add `placeholder` and `tooltip` options to main popup configuration. For INPUT type popups, placeholder applies to input field; for other types, tooltip applies to content area. Enhance custom buttons with optional `icon` parameter for Font Awesome icons and `tooltip` for hover text. Add tooltip support to custom inputs (placeholder for text/textarea, tooltip icon for checkboxes).

* fix: preserve default toastClass when applying custom cssClass in /echo command

Modify cssClass argument handling in echoCallback to append custom class to existing toastClass instead of replacing it. Use filter(Boolean).join(' ') to combine default and custom classes while handling undefined values.

* feat: add placeholder, tooltip, and icon support to popup system slash commands

Add `placeholder` and `tooltip` named arguments to /input command for input field customization. Add `tooltip` argument to /popup command for content area hover text. Enhance /buttons command to support button objects with `text`, `tooltip`, and `icon` (Font Awesome) properties alongside simple string labels. Update help text and examples for all three commands. Normalize button labels to ButtonLabel format internally

* Fix jsdoc wording

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

* fix: add validation for button labels in /buttons command

Add validation check to ensure each button entry is either a string or an object with a non-empty string `text` property. Return empty string and log warning if validation fails. Fix capitalization of 'Popup' in /popup command return value description.

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-03-20 01:14:49 +02:00
WolfsblvtandCohee a6486d7f08 Add Action Loader Module with Stacking Support and STscript Commands (#5311)
* Add action loader utility with stoppable toast notifications

* Add slash commands for action loader control (/loader-wrap, /loader-show, /loader-hide, /loader-stop)

* Refactor action loader to support stacking multiple loaders with individual toast management

- Convert action loader from singleton to class-based handle system (ActionLoaderHandle)
- Support multiple concurrent loaders with single overlay and stacked toasts
- Add unique ID generation and tracking for each loader instance
- Implement onHide callback alongside existing onStop callback
- Add getActiveLoaderHandles() and getLoaderHandleById() utility functions
- Refactor hideActionLoader() to accept...

* Improve action loader overlay and toast handling with better state checks and cleanup timing

- Check isLoaderDisplayed() before showing overlay to prevent conflicts with existing loaders
- Use toastr.options.hideDuration for toast removal timing instead of hardcoded 250ms
- Simplify hideActionLoader() by using getActiveLoaderHandles() helper
- Remove redundant empty check in hideActionLoader()
- Add clarifying comment for intentional error throw in createClosureHandler()
- Remove redundant 'onStop' default

* fix stop button toast removal issue by using toastr.clear force option instead of manual removal with timeout

* Fix isLoaderDisplayed() by using double negation operator instead of null comparison

* Add non-blocking loader support with `blocking` parameter for toast-only action loaders

- Add `blocking` option to ActionLoaderHandle (default: true)
- Implement hasBlockingLoaders() helper to check for active blocking loaders
- Show/hide overlay only when blocking loaders are active
- Add `blocking` named argument to /loader-wrap and /loader-show commands
- Update help strings with non-blocking usage examples
- Import commonEnumProviders for boolean enum and isFalseBoolean utility

* Add optional title parameter to action loader toast notifications and reorder constructor parameters for consistency

- Add `title` parameter to ActionLoaderOptions and ActionLoaderHandle constructor
- Pass title to toastr.info() for toast notifications
- Reorder parameters: blocking, toastMode, message, title, stopTooltip (grouped by importance)
- Add warning when creating non-blocking loader without toast (invisible to user)
- Update /loader-wrap and /loader-show commands with title argument

* Add loader utility API to action-loader and expose it in ST context for convenient programmatic access

- Create `loader` object with show/hide/active/get methods and ToastMode/Handle exports
- Add JSDoc examples for basic usage, non-blocking tasks, and hiding all loaders
- Import and expose `loader` in ST context alongside existing loader functions

* Split slash command and functional modules

* Create abort controller on app init

* Remove HTML tags from "returns" declaration

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-03-20 01:04:39 +02:00
Cohee bdaadd17dd Fix npm audit 2026-03-20 00:28:06 +02:00
XiangzheandCohee e4ad489448 feat(tts): emit events and track messageId for third-party integrations (#5309)
* feat(tts): add event signals and messageId tracking for third-party integrations

* feat(tts): move events to core, centralize clone and id tracking

* Apply review suggestions

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-03-20 00:24:34 +02:00
Wolfsblvt 2a00253937 Fix description and firstMessage in /char-create command being optional
Make description and firstMessage optional parameters in createCharacterCallback, allowing character creation with only a name. Remove validation checks that previously required these fields to be non-empty strings.
2026-03-18 22:43:23 +01:00
276a0c2125 Remove long deprecated STscript commands and parameters (#5312)
* Remove deprecated 'format' argument from /listinjects and /listvars commands

* Remove deprecated /lock command and add as alias to /persona-lock

* Add 'bind' as an alias for /persona-lock command (#5321)

* Initial plan

* Add 'bind' as an alias for /persona-lock command

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

---------

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>
2026-03-18 18:30:53 +02:00
DN2331 c3f36b2b9f fix(openrouter): respect enableThoughtSignatures setting for message signatures (#5318)
The addOpenRouterSignatures function was previously converting and appending message.signature to reasoning_details unconditionally, ignoring the `enableThoughtSignatures` setting.

This change adds a check for `enableThoughtSignatures` before converting message.signature, while still ensuring the original signature property is deleted to prevent API schema validation errors (HTTP 400).
2026-03-18 18:20:40 +02:00
WolfsblvtandCopilot Autofix powered by AI f9c42a32dd Character CRUD Slash Commands (#5306)
* feat: add character CRUD slash commands (char-create, char-update, char-get, char-delete)

Implement comprehensive character management commands allowing programmatic creation, modification, retrieval, and deletion of characters without UI interaction. All commands support named arguments with proper validation and error handling.

* feat: enhance char CRUD commands with favorite, avatar, and improved defaults

Add `favorite` and `avatar` named arguments to char-create and char-update commands. Make `char` argument optional in char-delete (defaults to current character). Improve documentation with clarifications on card tags vs ST tags, avatar URL sources, and usage examples. Add `fav` field to char-get output.

* feat: add /tag-import slash command for programmatic character tag import

Implement /tag-import command with `name` (defaults to {{char}}) and `mode` arguments (all/existing/none/ask). Command imports character card tags as ST tags for filtering/organizing. Returns 'true' if tags were imported, 'false' otherwise. Mode argument maps to existing tag_import_setting enum values.

* feat: enhance char-create and char-update with avatar upload and tag parsing

Add avatar resolution and upload support for char-create and char-update commands. Implement resolveAvatarData() to handle URLs, base64 data URLs, and local paths. Add uploadCharacterAvatar() to upload resolved images via /api/characters/edit-avatar. Parse tags argument as comma-separated array. Refresh side panel after char-update when modifying current character. Add char-get2 alias for testing.

* feat: enhance avatar argument in char CRUD commands with file picker and local path support

Add `prompt` value to avatar argument to open file picker dialog. Implement promptForAvatarFile() to handle image selection with validation. Add folderEnumMatchProvider() for autocomplete matching of folder paths. Update avatar enumList with common ST paths (characters/, backgrounds/, User Avatars/, assets/, user/images/). Remove external URL support from resolveAvatarData() - now only accepts "prompt", base

* feat: add /char-duplicate slash command with avatar resize support and enhanced avatar upload handling

Implement /char-duplicate command with `char` and `select` named arguments. Add `avatarPromptResize` argument to char-create and char-update for optional resize/crop dialog. Refactor duplicateCharacter() to accept avatar and silent parameters, returning the new avatar key. Enhance uploadCharacterAvatar() to handle resize prompts and return success status. Add cache busting and DOM refresh for avatar thumbnails

* refactor: optimize avatar refresh after upload by using cache busting and DOM query

Replace message-specific avatar refresh logic with generic image refresh targeting all thumbnails using the updated avatar URL. Remove unnecessary delay and character name matching. Add cache busting for both thumbnail and full character image. Use querySelectorAll to find and refresh all affected img elements in one pass.

* refactor: rename char-get alias from char-get2 to char-data

* refactor: move /dupe command to alias of /char-duplicate and fix characterIndex type

Move standalone /dupe command to alias of /char-duplicate for consistency with character CRUD commands. Cast characterIndex to String in char-update to match expected type.

* docs: clarify /imagine command integration with avatar argument in char CRUD commands

Update avatar argument descriptions and examples to explicitly mention /imagine command return value support. Reorder piped /imagine example to show correct command flow (generate image first, then update character).

* feat: add i18n support to char-create and char-update command error messages

Wrap validation error toastr messages in t`` template literals for translation support in /char-create and /char-update commands.

* feat: add group chat validation to /tag-import command

Add early validation check to prevent tag import in group chats. Display warning toastr message and return 'false' when selected_group is not null.

* Fix char update world property

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

* Fix help text documentation to match arg name

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

* fix: return empty string instead of throwing errors in char-create and char-update commands

Replace `throw error` with `return ''` in error handlers for /char-create and /char-update commands to prevent unhandled promise rejections while still displaying error toastr messages.

* refactor: make deleteCharacter return boolean success status and update char-delete command to use it

Change deleteCharacter to return boolean indicating success/failure instead of void. Return false on user cancellation or failed chat close, true when character is successfully deleted. Update /char-delete command to use returned success value instead of always returning 'true'.

* refactor: make description and firstMessage optional in /char-create command

Remove description and firstMessage from required fields array, allowing character creation with only a name. Update help text to reflect that only name is required.

* refactor: extract external URL check to utility function and add same-origin URL support for avatar resolution

Extract external URL check into `isExternalUrl` utility function in utils.js. Update `resolveAvatarData` to use new utility and add support for same-origin URLs by converting them to pathname before fetching.

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-03-18 18:14:21 +02:00
Cohee bae4fd9f98 glm-5-turbo 2026-03-17 22:49:42 +02:00
GentleBurrandCohee c4024fe208 Fix AICC direct link import parsing (#5307)
* Fix AICC direct link import parsing

Update parseAICC in src/endpoints/content-manager.js to dynamically extract the author and character name from the end of the URL path. This resolves a 404 import error caused by AICC adding category subfolders and changing their base URL structure from /character-cards/ to /charactercards/.

* Clean up whitespace in content-manager.js

Remove unnecessary whitespace in URL path processing.

* Use isValidUrl for URL validation

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-03-17 20:35:22 +02:00
Cohee 4ab4fca89d Merge branch 'release' into staging 2026-03-16 00:14:59 +02:00
Cohee 30e66f0ea0 Fix npm audit 2026-03-15 23:39:42 +02:00
Cohee dbf15b335e Add /docker/dist to ignore files 2026-03-15 23:35:22 +02:00
Cohee 645b8063e1 Intellectual Webpack cache management (#5295)
* Intellectual Webpack cache management

* Check if webpackRoot exists.

* Wrap webpack directory reading in try-catch

* Enhance cache pruning console output
2026-03-15 23:30:57 +02:00
Cohee f868e9ed68 Merge branch 'release' into staging 2026-03-15 22:00:13 +02:00
Cohee 9917935248 ci: Split PR checks and PR manager workflows 2026-03-15 21:55:28 +02:00
CopilotandCohee1207 2e476bc742 Add reasoning-collapse, reasoning-expand, reasoning-toggle slash commands with range support (#5296)
* Initial plan

* Add reasoning-collapse, reasoning-expand, reasoning-toggle slash commands

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* Add message range support to reasoning commands and allChatRange macro

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>
2026-03-15 20:22:25 +02:00
bf91d9afc9 Chat lorebook click unify (#5246)
* Unify chat lorebook button click behavior with character lorebook button

* Update locale strings for chat lorebook button

* Unify chat lorebook button click behavior with character lorebook button

* Update locale strings for chat lorebook button

* Also unify character lorebook button to support Alt modifier

* Update locale strings for character lorebook button

* Update public/locales/fr-fr.json

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

* Add long-press support for lorebook buttons on mobile

* Update locale strings for lorebook button long-press

* Fix long-press to use event delegation for dynamic elements

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-15 20:14:32 +02:00
Cohee 5e3c7570fa Update default reasoning config to match added template 2026-03-15 17:47:24 +02:00
Cohee b2c320dc0b Reasoning: Add template with <think> without newlines
Fixes #4932
2026-03-15 15:32:09 +02:00
CopilotandCohee1207 6d9d715948 Fix typo in KoboldAI.json: "OUPUT" → "OUTPUT" (#5282)
* Initial plan

* Fix typo in KoboldAI.json: "OUPUT" → "OUTPUT"

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>
2026-03-13 23:37:19 +02:00
Cohee 9bce79f797 Claude: fix non-streaming multipart text block parsing (#5278) 2026-03-13 21:12:46 +02:00
Cohee b259c975a3 Claude: disable adaptive thonk by default 2026-03-13 21:10:29 +02:00
CoheeandCopilot Autofix powered by AI db07c4a120 feat: add array-wrap and array-unwrap commands (#5277)
* feat: add array-wrap and array-unwrap commands

* Add LIST as available argument type

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

* Throw when trying to wrap a closure

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

* Throw on closure in array-unwrap

* Add the rest of argument types for array-unwrap

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

* Add Python-friendly aliases

* Don't filter out just strings

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

* Proper primitive value unwrapping

* Throw on multiple unnamed arguments

* Enhance parsed object wrapping

* Update comment to clarify boolean support in value wrapping

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-03-13 20:45:54 +02:00
MaksimandMaksim Sharkov c0a4682dcc feat: Add gemini-embedding-2-preview in google vectorization models (#5274)
Co-authored-by: Maksim Sharkov <msharkov@nobilis.team>
2026-03-13 19:58:06 +02:00
PavdigandCohee 8879272a6b fix: prioritize UI memory content for {{summary}} macro resolution (#5268)
* fix(extensions/Summarize): prioritize UI memory content for {{summary}} macro

The {{summary}} macro previously relied solely on history-based metadata, causing it to return empty when starting a new chat if 'None (not injected)' was selected as the injection position.

This change prioritizes the #memory_contents UI value to ensure the macro resolves immediately, even before the first history-based summary is generated.

* Implement for legacy macro

* Restore original trim call

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-03-11 22:57:53 +02:00
Cohee e0ed67357c Use string byte length for token guesstimation (#5267)
* Use string byte length for token guesstimation

* Use Buffer.byteLength on backend

* Preserve TextEncoder instance
2026-03-11 01:28:23 +02:00
1c5091539c feat: optionally gzip large save uploads with fallback (#5259)
* feat: optionally gzip large save uploads with fallback

* fix: replace Safari-prone save compression with fflate fallback

* refactor: align save upload compression with review feedback

* refactor: use compressRequest wrapper for save uploads

* Refactor request compression settings

* Fix default value

* Avoid null in bytes parsing result

* fix: switch request compression to fflate gzip

* fix: add request compression maxBytes cap and clarify timeout semantics

* Refresh package-lock.json

* Unify payload limit setting names

* Expose compression termination function

* Add compression to group chat saves

---------

Co-authored-by: Roland4396 <Roland4396@users.noreply.github.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-03-10 23:32:36 +02:00
Cohee dbf9bc1a54 Merge branch 'release' into staging 2026-03-10 22:43:14 +02:00
Cohee 0cb193c119 Update webpack dependency 2026-03-10 22:42:35 +02:00
Cohee a187c34638 Fix npm audit 2026-03-10 22:28:11 +02:00
Cohee ae5c65c3cf Baka-proofing OpenRouter OAuth flow 2026-03-09 20:46:46 +02:00
CopilotandCohee1207 3ad9b05e27 Implement extension manifest hooks for lifecycle events (#5261)
* Initial plan

* Implement extension manifest hooks for install, delete, enable, disable

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* Revert unrelated package-lock.json changes

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* Address review: use Object.hasOwn, add activate hook, simplify await, return folderName from backend

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* Add 'update' hook that triggers on extension update

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* Revert package-lock

* Add 5-second timeout for extension hook calls using delay and Promise.race

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* Revert unintended package-lock.json changes

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* Add timeout warning log when extension hook exceeds 5 seconds

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* Refactor extension hook call to handle synchronous results

* Refactor callExtensionHook to use constants for timeout results

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>
2026-03-08 13:10:28 +02:00
Cohee 92dd9ecab2 gpt-5.4 2026-03-07 20:39:34 +02:00
7418d272a7 Split generateRaw into two functions exposing generateRawData (#5249)
* Split generateRaw into two functions exposing generateRawData

* Concise types

* Improve comments

* Update public/script.js

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

* Update public/script.js

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

* Update public/script.js

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

* Add GenerateRawParams typedef for improved documentation and clarity

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-07 19:56:30 +02:00
Cohee 7a9483efba Remove BOS from KoboldCpp token encoding
Fixes #4663
2026-03-07 18:28:20 +02:00
Cohee e19c4f7e19 Remove BOS token from Tabby encoding
Fixes #5254
2026-03-07 18:25:58 +02:00
HaochenandCohee 2415e6bc86 add Slash commands regenerate and swipe (#5243)
* add Slash commands regenerate and swipe

* Update /swipe slash command direction handling

* Fix await not working in groups

* Add SLASH_COMMAND source to swipe functionality and update constants

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-03-07 18:16:49 +02:00
Cohee 8c07dcda24 Show experimental engine onboarding for greeting macros 2026-03-07 17:52:00 +02:00
Lucas ScalaandCohee 90892fd236 Group add to background folder (#5237)
* group add

* make button not wide

* make single and batch add to folder use the same style popup

* prevent stuck UI, allow scrolling, prevent ::after conflicts

* extremely large commit, beware

* clear everything after performing bulk actions

* Unify bulk selection design language

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-03-07 17:41:28 +02:00
Cohee 764e9ddec0 Fix npm audit 2026-03-07 17:07:21 +02:00
Cohee a608b3451b Require Node 20 and up 2026-03-07 17:04:31 +02:00
equal-l2 e834d3724b Remove xAI web search capability (#5255)
With web search on, the API now returns 410 Gone.
2026-03-07 16:58:56 +02:00
Spicy MarinaraandCopilot f20aed95d0 Add gpt-5.3-chat-latest model support (#5241)
* Add gpt-5.3-chat-latest model support

- Add to OpenAI model dropdown (index.html)
- Add to captioning multimodal model list (caption/settings.html)
- Add to OPENAI_REASONING_EFFORT_MODELS (constants.js)
- Add OPENAI_FIXED_REASONING_EFFORT map to clamp effort to 'medium' (the only value this model accepts)
- Apply fixed effort override in both Azure and general OpenAI request paths (chat-completions.js)
- Update frontend gpt-5.x regex for parameter handling (openai.js)

* Update public/scripts/openai.js

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

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-04 20:04:04 +02:00
Cohee 83a16d144c Add path validation for chat directory operations 2026-03-03 23:43:23 +02:00
Cohee ff8b029c9d Fortify user data path checks 2026-03-03 22:00:44 +02:00
Cohee 2abade3f80 Add sanitize of chat import names 2026-03-03 21:55:47 +02:00
Cohee 5600c2067b Fix priority of movingDivs closing 2026-03-03 21:46:24 +02:00
Cohee 8e10051100 Gallery: Add wand menu item 2026-03-03 21:26:58 +02:00
Cohee 3070cf26cd Add config for adaptive thinking
Fixes #5236
2026-03-03 20:10:39 +02:00
Cohee 04df80d907 thy gemini-3.1-flash-lite consumed 2026-03-03 20:04:36 +02:00
Cohee b9efb12d4d Fix type error in createLazyFields 2026-03-03 15:48:45 +00:00
Cohee 552cb948ed Merge branch 'release' into staging 2026-03-03 15:46:36 +00:00
Cohee e41bcf0cce Fix npm audit 2026-03-03 15:46:13 +00:00
Wolfsblvt f5b1f913f9 Enable experimental macro engine by default (#5234) 2026-03-03 17:18:45 +02:00
b5a1d227fd Implement {{charFirstMessage}} / {{greeting}} macro with alternate greeting indexing and substitution (#5220)
* Initial plan

* Implement {{firstMessage}} / {{greeting}} macro for character's first message

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* Simplify firstMessage resolver to use || instead of ?? for consistency

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* Remove {{firstMessage}} alias, add 0-based greeting index for alternate greetings

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* Add alternateGreetings to env, apply substitution to greetings

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* Remove legacy greeting macro, keep only new engine implementation

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>
Co-authored-by: anthropic-code-agent[bot] <242468646+Claude@users.noreply.github.com>
2026-03-01 17:44:29 +02:00
Cohee 63fa9c1d07 Claude: map Reasoning Effort to adaptive thinking config (#5219)
Supersedes #5105
2026-03-01 17:11:22 +02:00
3db508a759 Support for isomorphic-git as an alternative git backend, part 1 (#5229)
* Initial version of git adapter for alternate backend. Only clone is
implemented.

* Regenerate package-lock.json

* Clarify comments in config.yaml regarding git backend options

---------

Co-authored-by: Sanitised <sanitised@users.noreply.github.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-03-01 17:08:07 +02:00
Tony Gies 15e2f24046 fix: skip system messages in OpenRouter cacheAtDepth calculation (#5230)
System messages in the OpenRouter messages array were being counted
toward depth and could receive cache_control breakpoints. Since
OpenRouter hoists system messages into Claude's separate system
parameter, this misplaced breakpoints and could prevent caching
entirely if the hoisted content fell below minimum cache size.

Closes #5227
2026-03-01 16:58:51 +02:00
Cohee c138bbd3d7 Merge branch 'release' into staging 2026-03-01 16:49:21 +02:00
Cohee b7bb8be35a Fix npm audit 2026-03-01 16:48:45 +02:00
Tony Gies 994234e557 Add unit tests for pure functions in src/util.js (#5231)
77 tests covering 24 pure functions: keyToEnv, getBasicAuthHeader,
getHexString, normalizeZipEntryPath, deepMerge, uuidv4,
humanizedDateTime, tryParse, clientRelativePath, getUniqueName,
removeFileExtension, removeColorFormatting, getSeparator, isValidUrl,
urlHostnameToIPv6, toBoolean, stringToBool, trimV1, trimTrailingSlash,
mutateJsonString, isPathUnderParent, isFileURL, getRequestURL, and
formatBytes (via getBasicAuthHeader pattern).

These are all deterministic, side-effect-free functions tested without
any mocking. Placed in a separate file from the existing util.test.js
to keep concerns separated.
2026-03-01 16:39:24 +02:00
Cohee d552be8484 Merge branch 'release' into staging 2026-02-27 20:34:17 +02:00
Cohee c536bfc7f5 Fix npm audit 2026-02-27 20:33:23 +02:00
Cohee 744ce7705d gemini-3.1-flash-image-preview 2026-02-27 20:26:22 +02:00
Cohee 649b4a5280 Merge branch 'release' into staging 2026-02-26 21:27:02 +02:00
Cohee 96aa970604 Fix npm audit 2026-02-26 21:26:40 +02:00
Cohee d8f39269b9 Remove open bogus folder tags that don't have any entities assigned (#5225)
Fixes #5222
2026-02-25 23:51:52 +02:00
d789efba07 Use Ollama /api/embed endpoint for vector embeddings (#5221)
* Use Ollama /api/embed endpoint for vector embeddings

The deprecated /api/embeddings endpoint does not properly support the
truncate parameter, causing "input length exceeds context length" errors
when vectorizing files. Migrate to /api/embed which correctly handles
truncation and supports native batch input.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Wrap single Ollama vector calculation into batch
Fixes https://github.com/SillyTavern/SillyTavern/pull/5221/changes#r2850052729

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-02-25 23:44:12 +02:00
CopilotandCohee1207 4fa37e52f7 Fix tag hide/show toggle in Tag Management not persisting (#5226)
* Initial plan

* Fix tag hide/show in Tag Management: pass original tag refs instead of copies, fix inverted tooltip

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* Revert unrelated package-lock.json changes

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* Revert tooltip change: tooltip shows current state, not action after click

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* Pre-calculate tag counts into a Map and pass to sortTags for sort-by-usage

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* Revert unintended package-lock.json changes from npm install

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* Use instanceof Map for counts checks, add missing JSDoc param for sortTags

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* Revert unintended package-lock.json changes

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* Remove legacy `count` field

* Improve readability (marginally)

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>
2026-02-25 23:34:43 +02:00
Cohee 4dbdd06d6d Add reload prompt to extension branch switch success message 2026-02-25 00:41:54 +02:00
Cohee 8422d2d0c7 Merge branch 'release' into staging 2026-02-24 23:45:47 +02:00
Cohee b7f0040831 Fix npm audit in /tests 2026-02-24 23:45:41 +02:00
Cohee 57386347ee Merge branch 'release' into staging 2026-02-24 23:44:39 +02:00
Cohee e678d24a39 Fix npm audit 2026-02-24 23:44:32 +02:00
Cohee 3f8b9998ca gork-imagine
Closes #5216
2026-02-24 23:35:21 +02:00
Lucas ScalaandCohee 54bba07420 Background Folders (#5187)
* backend, frontend, bugfixes

* Mobile button and sizing

* lint

* clear folder thumbnailFile on delete, rename thumbnailFile on rename

* use filteredImages when changing sort option

* Address all the review comments

* Fix friendly title generation to handle empty strings

* Move add folder button to the header

* instead of search filtering the backgrounds in a folder and showing the folder if the results > 0, search the folder names.

* Trade button places

* Adjust button text

* feat: restrict folder creation to the Global tab

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-02-24 21:27:03 +02:00
Cohee 537f0559ab fix: enhance IP addresses hostname validation 2026-02-24 20:55:11 +02:00
CopilotandCohee1207 ccf8ce7a06 Add PERSONA_CHANGED event (#5218)
* Initial plan

* Add PERSONA_CHANGED event emission when active user avatar changes

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>
2026-02-24 20:52:04 +02:00
GERNOMAandCohee 8f5c8f0a8e Open router provider filter (#5208)
* Added filter for OpenRouter models provider selection

Now if a model is selected, only available providers for that model will show. Wanted to do the same for the quants, but I think the API is not returning the quants available for each model at the moment. Used existing API that for some reason was not consumed.

* Added filter for OpenRouter providers

Now if a model is selected, only the providers available show. Wanted to do the same with the quants but it seems the OpenRouter API is not giving the available quants list at the moment for each model.

* gua

* Now it also works on chat completion and only disables options

* detail

* Warning added

* eslint

* Move inline styles to CSS

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-02-24 20:40:42 +02:00
Cohee 334635ce74 Create data root if not exists in standalone mode
Supersedes #5217
2026-02-24 20:29:44 +02:00
Cohee 46f1d211e1 fix: ensure input results are a Map before processing in refinePrompt 2026-02-24 00:40:09 +02:00
BriochandCohee 0cef10f63f feat(openrouter): disable reasoning if Request model reasoning is off and effort is minimum (#5079)
* feat(openrouter): disable reasoning if "Request model reasoning" is disabled

* feat(openrouter): map minimum reasoning to none if request reasoning is off

* Add hint how to disable reasoning

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-02-23 21:19:04 +02:00
Cohee 496b3570e6 fix: Preserve saved resolution 2026-02-23 20:54:05 +02:00
CopilotandCohee1207 a93fc0443e Preserve image dimensions when generating swipe images (#5205)
* Initial plan

* feat: preserve image width/height when generating swipe images

Save width and height in ImageGenerationAttachmentProps when creating
MediaAttachment objects, and apply saved dimensions when generating
image swipes. Falls back to current extension settings if not specified.

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* fix: validate dimension override with Number.isInteger and skip setTypeSpecificDimensions when override is present

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* fix: call restoreOriginalDimensions when setTypeSpecificDimensions was used

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* Contain the logic to setTypeSpecificDimensions

* Diff clean-up

* feat: enhance prompt refinement with negative input and saved resolution options

* fix: Only save image dimensions when running from command

* Fix wording in refine prompt dialog

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>
2026-02-23 20:51:25 +02:00
Cohee 7ffb28f753 Numbers must go up 📈
Updated contributor count and years of development in the README.
2026-02-22 15:49:28 +02:00
ZhenyaPavandCohee 0ba0418fac OpenRouter interleaved reasoning forwarding for tool-call continuations (#5160)
* fix(openrouter): forward reasoning across active tool-call chains

* feat(reasoning): add tool-chain forwarding toggle and honor edited reasoning

* feat(reasoning): add OpenRouter interleaved forwarding modes

* moved the reasoning forwarding dropdown into a separate line

* feat(reasoning): default tool reasoning forwarding to disabled

* refactor(openrouter): move tool reasoning mode to CC settings

Move OpenRouter tool reasoning forwarding control to response configuration and scope it to OpenRouter.

Store mode in chat completion settings (presettable), remove legacy power_user boolean/fallback, and use constants for mode values.

Preserve OpenRouter Gemini signature forwarding independently from plaintext tool reasoning mode.

* fix(openrouter): tighten active-chain reasoning forwarding

Use trailing contiguous tool-chain boundary for active-chain eligibility.

Also rename the UI control to Interleaved Thinking Forwarding and place selector on its own line.

* fix(openrouter): use adjacent assistant reasoning for tool calls

For interleaved thinking forwarding, source reasoning only from the immediately preceding assistant non-tool message.

Keep mode gating behavior unchanged and avoid history-window reasoning carryover.

* fix(openrouter): skip tool messages for reasoning source

When forwarding interleaved reasoning, ignore intervening tool result messages when resolving the preceding assistant reasoning source.

This keeps only the first tool call in a chain tied to a prior assistant reasoning block unless a later invocation carries its own reasoning.

* fix(openrouter): keep plaintext reasoning with signatures

Do not suppress forwarded tool-call reasoning when thought signatures are present.

* fix(openrouter): split interleaved thinking mode behavior

Restore distinct mode semantics: active_chain uses nearest assistant-text boundary after skipping tool/tool-call messages, while since_last_user scans for latest assistant reasoning since user.

Update UI label to Interleaved Thinking with right-aligned dropdown and explanatory tooltip.

* style(openrouter): align interleaved thinking dropdown row

Match OpenRouter interleaved thinking control layout with existing oneline-dropdown patterns.

Also update reasoning-forwarding inline comment wording for current mode behavior.

* docs(ui): clarify interleaved thinking tooltip

Use explicit API-request wording for OpenRouter interleaved thinking tooltip text.

* i18n(openrouter): localize interleaved thinking UI

Add locale keys for OpenRouter interleaved thinking label, mode options, and inline helper description.

Wire dropdown option text to data-i18n in index.html.

* fixed helper text wrapping

* fix(ui): make interleaved thinking helper text wrap

* i18n(openrouter): translate interleaved thinking labels

Replace placeholder English values for interleaved thinking keys in non-English locale files.

* fix(ui): restore interleaved thinking dropdown alignment

* Remove changes from en.json

* Type fixes

* Reworked the interleaved reasoning provider logic

* Renamed the variables in preparation for potential implementation for other providers

* Gate interleaved tool reasoning on reasoning request setting

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-02-22 13:15:52 +02:00
Cohee 8462cbaebb Fix duplicate image generation toast on tool call. 2026-02-20 01:09:56 +02:00
Wagner BrunaandCohee ab8d7e5184 build llama.cpp embedding url path by appending instead of overwriting (#5178)
* build llama.cpp embedding url path by appending instead of overwriting

When using a llama-swap frontend, this allows choosing the embedding model
by path; for instance, with the secondary embedding endpoint URL configured
to http://127.0.0.1:5001/upstream/emb-model to pick the "emb-model" model.
With this approach, the same llama-swap instance can be used to serve both
the main LLM and the embedding model from local llama-server commands.

* Trim trailing v1 from URL

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-02-19 23:39:58 +02:00
Leandro Jofré 162d45a241 Feat - Export SlashCommandEnumValue for extensions through getContext (#5191) 2026-02-19 23:11:30 +02:00
Lucas ScalaandCohee 8aaaab37b7 Fix APNG thumbnail handling and improve animated format detection (#5113)
* check png for apng headers

* isAnimated flag

* refactor: centralize background animation extension checks

* refactor: scope animated extension dedupe to backgrounds

* remove precompute from startup

* Fix animation preference not being loaded, fix type-check of customInputs

* Fix eslint

* Fix sort on removal type

* Update metadata before returning from endpoint on CRUD operations

* Remove race condition in metadata load

* Load metadata after loading the list

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-02-19 22:46:21 +02:00
TosdandTosd0 45bf3a402a Update zh-CN translations (#5180)
* Update zh-CN translations

* i18n(zh-CN): sort keys

* Update translations

---------

Co-authored-by: Tosd0 <65720409+Sevenyine@users.noreply.github.com>
2026-02-19 20:48:28 +02:00
Spicy Marinara 31f4d5dbfe Add gemini-3.1-pro-preview to caption settings (#5190) 2026-02-19 15:00:24 +02:00
Spicy Marinara a923b0eefe Add gemini-3.1-pro-preview to Google AI Studio and Vertex model lists with thinking support (#5188) 2026-02-19 14:28:48 +02:00
CopilotandCohee1207 eeda4d377e Add {{maxContext}}, {{maxResponse}} macros and {{maxPromptTokens}} alias (#5176)
* Initial plan

* Add maxContext, maxResponse macros and maxPromptTokens alias

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* Refactor getMaxContextSize to use getMaxContextTokens/getMaxResponseTokens and remove maxReply aliases

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* Align aliases in single line

* Rename getMaxPromptTokens

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>
2026-02-17 21:47:51 +02:00
Cohee 3bd1034639 claude-sonnet-4-6 2026-02-17 21:33:19 +02:00
3a952293b4 Add gallery argument to /imagine command (#5168)
* Add gallery argument to /imagine to skip character gallery save

Adds a `gallery` named argument (default: true) to the /imagine slash
command. When `gallery=false`, the generated image is saved to the
generic images directory instead of the character-specific gallery
folder, while still returning a usable image URL.

This is useful for extensions that manage their own image display
(e.g. inline in chat messages) and don't need gallery copies.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Can't assign to a constant

* Update help string to clarify image saving behavior in generation requests

* Fix file name template if no char name provided

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-02-16 21:22:43 +02:00
YKDZ 966ab8336b Merge pull request #5171 from YKDZ/release
i18n: Comprehensive update and refactor for Simplified Chinese (zh-CN)
2026-02-16 21:00:26 +02:00
Cohee 1b0417824f Merge pull request #5173 from SillyTavern/release
Guard `isValidImageUrl` against nullish `avatar_url` inputs (#5172)
2026-02-16 17:02:31 +02:00
CopilotandCohee1207 3efe809d27 Guard isValidImageUrl against nullish avatar_url inputs (#5172)
* Initial plan

* fix: guard isValidImageUrl against nullish input

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>
2026-02-16 17:01:41 +02:00
Wolfsblvt 87a0ac7cd1 Add textarea support to popup custom inputs (#5167)
- Add 'textarea' as a valid input type alongside 'checkbox' and 'text'
- Add optional `rows` property to control textarea height (default: 1)
- Implement textarea rendering with proper label, placeholder, and styling
- Update result collection logic to handle textarea values like text inputs
- Update warning message to include textarea in supported types
2026-02-15 23:55:20 +02:00
56e995c320 feat: add prefers-reduced-motion and prefers-contrast media queries (#5122)
* feat: add prefers-reduced-motion and prefers-contrast media queries

- Integrate OS prefers-reduced-motion into existing JS toggle system:
  when OS preference is active, force reduced_motion on and disable
  the UI checkbox with an explanatory tooltip
- Add body.reduced-motion CSS rules for hardcoded animations that
  bypass the --animation-duration variable (text_segment fade-in,
  dragover pulse)
- Add prefers-contrast: more media query for enhanced focus outlines

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Support translating title text

* Use duration variable

* Removed stream fade-in override

* Combine hi-contrast selectors

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-02-15 19:45:24 +02:00
Malformed CandCohee b44a67b7e7 Fix koboldcpp dry sequence stringification (#5156)
* Add DRY sequence parsing

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-02-15 17:11:17 +02:00
CopilotandCohee1207 f687bc95e9 Overhaul /bgcol: Oklch color space, full palette generation, save as new theme (#5162)
* Initial plan

* Overhaul /bgcol command: Oklab color space, dominant color extraction, full theme palette generation

- Create ThemeGenerator module in public/scripts/util/ with:
  - Oklab color space conversions (sRGB ↔ Oklab ↔ LCH)
  - Chroma-weighted dominant color extraction (vivid over muddy averages)
  - Color theory palette: complementary, analogous, triadic hue relationships
  - WCAG contrast ratio enforcement (≥3.5:1 for all text colors)
- Replace old setAvgBG with new implementation using ThemeGenerator
- Save generated theme as "Generated - <background name>" instead of overwriting
- Update command help string to reflect production-ready status

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* Extract hue shift constants for clarity (code review feedback)

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* Add name and bg arguments to /bgcol command

- Add `name` named argument to override the generated theme name
- Add `bg` named argument with enum provider listing available backgrounds
  from /api/backgrounds/all to override the current background

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* Improve types, add enum provider, reduce transparency

* Adjust alpha channel for better readability

* Refactor ThemeGenerator to work directly in Oklch, removing intermediate Oklab conversions

Replaced srgbToOklab/oklabToSrgb + oklabToLCH/lchToOklab with direct
srgbToOklch/oklchToSrgb functions. All color manipulations now use
{L, C, h} directly without converting through {a, b} intermediates.
The ensureContrast function now takes (L, C, h) parameters instead of
an Oklab object.

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* Add custom background URL check and enhance theme generation logic

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>
2026-02-15 16:39:55 +02:00
Cohee 46ea79bab5 Merge branch 'release' into staging 2026-02-15 15:57:51 +02:00
SenatusSPQR1 4672647293 Fix NanoGPT Claude cache detection for prefixed model IDs (#5164) 2026-02-15 15:57:14 +02:00
Leandro Jofré 9383b3ab13 Fix - Remove non-samplers from sampler selection popup (#5163)
Removed OR's fallback providers checkbox and the generic model and URL inputs for Custom Endpoint.
2026-02-15 02:14:05 +02:00
Cohee 4d1619ba47 Chore: enable brace-style eslint check (#5159)
* eslint: enable brace-style check

* Fix jsdoc and color

* fix: correct CSS color syntax in CreateZenSliders function
2026-02-15 01:46:32 +02:00
Cohee 357da3219b Chore: Add code formatting conventions as eslint rules (#5158)
* Add code formatting conventions as eslint rules

* Improve formatting in addQuickReply
2026-02-15 01:16:34 +02:00
Cohee d118eee014 Update npm workflow for trusted publishing
Updated Node.js version from 22 to 24 and added permissions for OIDC.
2026-02-14 18:01:17 +02:00
Cohee e3b866b5d2 Merge pull request #5154 from SillyTavern/staging
Staging
2026-02-14 17:46:49 +02:00
HimeHina df0e1256e6 Fix: HTTP Basic Auth fails when password contains colons (#5153)
* Fix: HTTP Basic Auth fails when password contains colons

The credentials in HTTP Basic Auth are formatted as base64(username:password).
Per RFC 7617, the username must not contain a colon, but the password can.
The previous code used `.split(':')` which splits on all colons, truncating
passwords that contain ':' characters. Fix by splitting only on the first colon.

* Use spread syntax for credential parsing
2026-02-14 17:44:54 +02:00
Cohee 843c572154 Merge commit from fork
* Add file name sanitation to background upload

* Add file name sanitation to chat export
2026-02-14 17:44:09 +02:00
Cohee 9ec9a5c51c Merge commit from fork 2026-02-14 17:43:36 +02:00
Cohee 232cf6d825 Merge commit from fork 2026-02-14 17:42:02 +02:00
Cohee 734ef7d939 1.16.0 2026-02-14 16:27:02 +02:00
CopilotandCohee1207 5832cb8b07 Add NanoGPT embeddings support for Vector Storage (#5150)
* Initial plan

* Add NanoGPT embeddings support for Vector Storage

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* Fix models loading

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>
2026-02-14 00:31:30 +02:00
Cohee 266f3ade0d Fix: skip generating thumbnails for APNG
Backported from #5113
2026-02-13 01:23:44 +02:00
Cohee 1e49f3d4f1 Fix: allow serving thumbnails that start with a dot 2026-02-13 01:07:24 +02:00
Cohee 614f404390 Revert "add char-archive to whitelistImportDomains"
This reverts commit 13099c43a9.
2026-02-12 23:40:30 +02:00
TosdandTosd0 a1204a4438 Update zh-CN translations (#5145)
* fix(index.html): typo

* Update zh-CN translations

* Add missing zh-CN translation

---------

Co-authored-by: Tosd0 <65720409+Sevenyine@users.noreply.github.com>
2026-02-12 22:06:37 +02:00
Cohee 3b21f856aa Fix npm audit 2026-02-12 21:31:18 +02:00
Cohee a5aff87b1d Merge branch 'release' into staging 2026-02-12 00:41:56 +02:00
Wolfsblvt 953d9f34cb Macros 2.0 - list-supported Macros Autocomplete Improvements (#5135)
* fix(macros): prevent list-arg macros from accepting scoped content

List-arg macros now correctly reject scoped content since they only accept arbitrary inline arguments. Updated validation logic in autocomplete, scope detection, and CST walker to check for `list === null` before allowing scopes. Also improved list item hint display to show total count when typing additional items.

* feat(macros): display min/max constraints for list arguments in autocomplete hints

Add visual indication of list argument constraints by showing min/max values in autocomplete hints. List items now display "(list, min: X, max: Y)" or "(variable-length list)" when no constraints exist. Includes new CSS styling for smaller, dimmed hint text.

* feat(macros): validate list argument min/max constraints and improve warning display

Add validation for list argument constraints (min/max) with specific error messages when too few or too many list items are provided. Continue highlighting current argument position even when warnings are present (except where semantically invalid), allowing users to navigate back to valid arguments while seeing "too many arguments" warnings.
2026-02-12 00:32:17 +02:00
CopilotandCohee1207 1b5d65e34c Add GLM-5 to Z.AI model list (#5138)
* Initial plan

* Add glm-5 to Z.AI model list with 200k context

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>
2026-02-12 00:21:08 +02:00
CopilotandCohee1207 626b324fe0 Add "✨ Vibe Coded" label to PRs created by @Copilot (#5137)
* Initial plan

* Add label-copilot-prs job to automatically add "✨ Vibe Coded" label to PRs created by @Copilot

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>
2026-02-12 00:06:27 +02:00
CopilotandCohee1207 50e566ee0d Set HTML lang attribute from app locale to enable CSS hyphens: auto (#5136)
* Initial plan

* Set HTML lang attribute based on app locale to enable CSS hyphens: auto

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>
2026-02-11 23:58:10 +02:00
Cohee 9714374749 Preserve user input on tool call recursion (#5134)
Supersedes #5129
2026-02-11 22:49:39 +02:00
Cohee 00a61d370b Fix npm audit 2026-02-11 21:30:35 +02:00
awaaeandCohee 10e08f0e3d feat(server): make CORS middleware configurable (#5123)
* feat(server): make CORS middleware configurable

Add detailed configuration options for CORS in config.yaml, including
origin, methods, headers, credentials, and max age. Update server
initialization to apply these settings dynamically instead of using
hardcoded values.

* fix(server): Fix default value and conditional logic issues in CORS configuration

- Changed the default value of `cors.maxAge` from `null` to `0`.
- Simplified the conditional check logic for `allowedHeaders`, removing duplicate checks for `corsAllowedHeaders` being `null`.

* fix(server): Fix CORS exposed headers configuration logic

- Removed redundant conditional checks. now directly validates array length when `corsExposedHeaders` has a truthy value

* Improve types + simplify checks

* fix(cors): align maxAge default with original behavior

* Adjust default array values

* Remove debug log

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-02-11 21:27:45 +02:00
CopilotandCohee1207 23ba3e5bb2 Add rename buttons for ComfyUI workflows and style presets (#5124)
* Initial plan

* Add rename buttons for ComfyUI workflows and style presets

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* Address review feedback: pencil icon, filename validation, 204 status, error prefix, frontend duplicate check, re-render styles select

Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

* fix: ensure existing workflow check only considers HTMLOptionElement instances

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>
2026-02-09 23:04:34 +02:00
thecaptain789andthecaptain789 1961fb59c0 fix: correct typo 'seperated' to 'separated' (#5121)
Co-authored-by: thecaptain789 <thecaptain789@users.noreply.github.com>
2026-02-09 20:09:39 +02:00
Cohee 8e911af031 ImgGen: default to selected style name on save click 2026-02-08 02:50:00 +02:00
Cohee bee4d9a818 fix: sync swipes only when chat is not pristine to ensure macro resolution (#5106) 2026-02-08 02:35:14 +02:00
Wolfsblvt 9f4449973b Macros 2.0 - Optional scoped content + improved closing-tag autocomplete (#5117)
* feat(macros): Add optional scope detection and improved closing tag autocomplete

- Implement `isScopeOptional()` to detect when scoped content is optional based on macro argument requirements
- Filter optional scopes from autocomplete hints unless force-triggered (Ctrl+Space)
- Add "OPTIONAL" badge styling for optional scoped content in autocomplete UI
- Show multiple closing tag suggestions (innermost to outermost) with priority ordering
- Display nesting level information for nested optional scopes

* fix(autocomplete): show original macro details when typing closing tags

Add nameOffset=2 to MacroClosingTagAutoCompleteOption to skip {{ prefix for fuzzy highlighting. When typing closing tags ({{/macroName}}), detect and show the original macro's details instead of "no match" error by looking up the macro definition and creating a non-selectable context option with no argument highlighting.
2026-02-08 02:25:21 +02:00
L 788ed3d323 Background sort feature (#5107)
* Add background sort by date added feature

* reapply search after changing sort

* overengineer it

* use sortIgnoreCaseAndAccents

* make enum for sort options
2026-02-08 02:10:48 +02:00
cloak1505 300912237d Sync OpenRouter providers list (#5110) 2026-02-06 22:48:25 +02:00
Cohee 4e5cb9c44f Prevent accidental chat overwrites when switching between characters/groups 2026-02-05 23:47:17 +02:00
DeclineThyselfanduser b64c279473 Add clearData option to clearChat function (#5091)
* Centralized `await clearChat();` and `chat.length = 0;` into `wipeChat()`

* Added `clearData` argument to `clearChat`.

---------

Co-authored-by: user <user@exmaple.com>
2026-02-05 23:39:36 +02:00
Cohee 12014a993c Fix npm audit 2026-02-05 23:16:52 +02:00
LandCohee 4550afd4ca Backgrounds metadata population and frontend colors (#5092)
* Startup and on-demand check

* Update comments, add color preload

* remove redundant metadata generation

* changed image-metadata/all from GET to POST

* move initializeAllUserMetadata to image-metadata.js, make blocking (?)

* Add type annotations

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-02-05 22:45:56 +02:00
Leandro JofréandCohee 992fd8f01d Feat/Allow to bulk toggle all third-party extensions from Manage Extensions (#5094)
* Feat - Allow to bulk toggle all third-party extensions from popup manager

* Fix - Prevent reloading the page if the final state is the same

* Fix - Handle bulk toggle with no extensions installed

* Update - Delete leftover debug logs

* Fix - Simplify extension toggle logic and improve readability

* Update - State that bulk toggle only affects external extensions

* Feat - Allow to restore bulk toggled extensions

* Update - Move bulk toggle to the third-party extensions header

* Uncenter section headers

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-02-05 22:24:44 +02:00
LumiandCohee 39c8eb343c add option for claude-opus-4-6 (#5103)
* add option for claude-opus-4-6

* fix: add claude-opus-4-6 to limited sampling and verbosity model lists

* fix: disable assistant prefill for claude-opus-4-6

* refacor: merge fixthinkingPrefill and noPrefillModel

* 1m context

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-02-05 21:42:27 +02:00
Kristy AureliaandCohee d6fafdd983 Add Minimal Prompt Processing option (#5095)
* Implement Minimal Prompt Processing

* Fix and rename cmd argument.

* Whitespace

* Handle processing selection with a enum

* Update processing argument description

* Fix typo in minimal prompt processing label title

* Add missing semi

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-02-05 01:38:55 +02:00
Wolfsblvt 34688f8493 chore(wi): Add logSlashCommandWarn utility and integrate into world-info slash commands (#5096) 2026-02-05 01:04:14 +02:00
WolfsblvtandCohee 06b77ec94c Macros 2.0 - Improve Autocomplete edge cases on completing macros (#5093)
* fix(autocomplete): handle nested macros in :: separator parsing

Track nesting depth when parsing macro parts to avoid treating :: inside nested macros as separators. Increment depth on {{ and decrement on }}, only recognizing :: as a separator when nestedDepth is 0.

* chore(autocomplete): add missing properties for non-variable macros

Add `variableNameEnd` and `variableOperatorEnd` fields to track end positions of variable components in macro parsing context.

* fix(autocomplete): stop macro parsing at newlines before first :: separator

Prevent newlines before the first :: separator from being included in macro identifier/space-arg parsing. Track separator state and break early when encountering newlines at depth 0 before any :: is seen. Only include the last part if cursor is within its bounds to avoid extending macro context across line breaks.

* fix(autocomplete): handle cursor position after closing braces in macro detection

Skip closing }} when searching backwards if cursor is immediately after them, treating them as the target macro's closing braces rather than nested braces. Skip forward search entirely when cursor is after }}, using cursor position as closePos directly.

* fix(autocomplete): show macro details when typing closing brace and add no-match indicator

Track `isTypingClosingBrace` state when cursor is after a single `}` on standalone macros (no separators/args). Strip trailing `}` from identifier in this case. Show matching macro details when typing closing brace, same as when typing args. Add "no match" error option when typing args/closing brace but identifier doesn't match any macro. Extract `AnyMacroAutoCompleteOption` typedef for cleaner type annotations

* fix(autocomplete): show variable context when typing closing brace on shorthand macros

Detect `isTypingClosingBrace` state for variable shorthands (e.g., `{{.Lila}`, `{{.Lila+=4}`). Parse value before brace detection to check for trailing `}`. Show non-selectable context options (variable name, operator, value) when typing closing brace instead of operator/value suggestions. Strip trailing `}` from value when detected. Set `resultStart` to cursor position when typing closing brace to avoid replacement

* fix(autocomplete): stop flag parsing at newlines and show context when typing closing brace on variable shorthands

Skip newlines (not just all whitespace) between flags to prevent extending macro context across line breaks. Show variable context (name, operator, value) when typing closing brace on shorthand macros by excluding `isTypingClosingBrace` from the value-typing check.

* Fix highlight of value autocomplete option

* Rename permanentMatch to forceFullNameMatch

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-02-05 00:20:50 +02:00
Cohee 2fda8ca003 Update chevrotain and remove dependency override 2026-02-04 00:20:26 +02:00
Leandro Jofré 925ee10560 Fix - Do not spam saveSettingsDebounced setting an item in AccountStorage (#5090) 2026-02-03 23:09:50 +02:00
LandCohee f5b5350cf4 /image-metadata (#4788)
* git push --force

Implement background management in json

lint

upload multer weirdness, fix for timestamp

* remove duplicated logic to generate backgrounds.json

* remove duplicate logic to create backgrounds.js

* remove excessive enodent eror handling

* simplify shared extension constants

* move backgrounds.json to backgrounds/index.json

* use plimit

* move user directory iteration to syncBackgroundsMetadata insetad of server main

* create and move getBackgroundThumbnailResolution

* nitpick

* typdef

* simplify checks

* use read method

* error -> regenerate

* use fileExists

* type error fix (maybe)

* add object to jsdoc returns

* typo

* use getUniqueName from util.js

* remove duplicated multer something or other

* make skipped_extensions a set

* remove strict comparison

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>

* create isAnimatedWebP and use it

* use file creation date instead of server date

* actually type BackgroundImageMetadata

* use fileExists instead of try catch

* response.sendStatus(500);

* sync json to allow adding images to the folder without restart

* lint

* Generic image metadata endpoint. Remove tags and starred. No startup sync.

* lint

* Descriptive json and move to util.js

* remove folders routes

* It's a POST

* Revert file name to index.json

* Type errors fixing

* Remove p-limit

* Why?

* apply codex suggestions

* see comment

* remove unused functions

* remove path normalization for da path, not needed

* Fix dimensions shadowing issue, circular imports, and apply bg res to only bg

* move thumbnailsEnabled to the top level

* Metadata now stored at {userDataRoot}/image-metadata.json instead of per-folder index.json
Uses relative paths as keys (e.g., backgrounds/sunset.png) for easy file existence checking
Added cleanupOrphanedMetadata() function and /api/image-metadata/cleanup endpoint for data-maid integration
Simplified the API endpoint by removing folder-grouping logic

* lint

* update backgrounds.js imports

* security check, .replaceAll

* Remove useless function, pass type to cache invalidate and seperate file types

* fix: normalize file paths to use POSIX separators in metadata functions

* serve original

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-02-03 01:53:29 +02:00
Cohee 5c62cf4a6e fix: restore cross-message text search 2026-02-02 08:19:51 +00:00
Cohee ad88acc980 perf: Use null matcher when no query 2026-02-02 03:35:16 +02:00
Cohee e5c14af76d fix(welcome-screen): only scroll to elements not in viewport 2026-02-02 01:49:07 +02:00
Cohee 3f8acaad4e Refactor /search to use per-line async parsing (#5085)
* Refactor /search to use per-line async parsing
Supersedes #5047

* Use named type

* Cache query fragments, add file name match

* Skip invalid chat files in search

* Remove extensions from /search results

* Use file_id when appropriate

* Revert "Use file_id when appropriate"

This reverts commit aaa0274b53.

* Clean-up file extension handling

* Move extension append down for non-group
2026-02-02 01:44:15 +02:00
Cohee cf587bc766 fix(translate): update translator to use fetch for request function 2026-01-31 18:56:49 +02:00
BriochandCohee 6c864e8bb2 feat(openrouter): add model quantizations setting (#5080)
* feat(openrouter): add model quantizations setting

* Remove bogus setting

* Simplify nullish coalescing assignment

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-01-30 23:51:22 +02:00
Cohee bba43f3321 Merge branch 'release' into staging 2026-01-29 00:46:46 +02:00
Cohee f63399a4f9 Fix: don't overwrite group_only_greetings 2026-01-29 00:46:30 +02:00
StageDog 3ac70790ff fix: welcome depth (#5077) 2026-01-29 00:27:49 +02:00
Jay4242andCohee 12452491cb Stable diffusion.cpp server support (#5074)
* feat: Add stable-diffusion.cpp server endpoints

* feat: Add stable-diffusion.cpp server settings

* feat: Add stable-diffusion.cpp server

* Add debug log for sdcpp payload

* feat: add loadSdcppSamplers and loadSdcppSchedulers for sdcpp backend

* feat: add sdcpp to sampler and scheduler source lists

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-01-29 00:24:45 +02:00
Cohee 10e8e01a55 Moonshot: Map "Request reasoning" to thinking type
Fixes #5072
2026-01-28 00:55:11 +02:00
Cohee 578ef7eb6c /beep or /ding 2026-01-28 00:33:58 +02:00
Cohee 0e5b4de10c Moonshot: Pull vision flag from model data
Fixes #5068
2026-01-28 00:26:50 +02:00
Crush0andCohee eaa6a00e97 Volcengine tts (#5003)
* feat(tts): Add support for Volcengine TTS provider

* refactor: Remove the redundant comments in the Volcengine TTS-related code.

* fix(volcengine): Fix the audio data processing logic in the voice generation interface

* feat(tts): Enhance Volcengine TTS functionality and improve error handling

- Return more detailed error information when generating voice fails
- Add multiple preset voice options and support custom voice management
- Reconstruct the audio stream processing logic to enhance reliability
- Improve the UI interface, adding a voice selection dropdown menu and operation buttons

* refactor(tts): Optimize the code structure and error handling of the Volcengine TTS provider
- Remove the unused "voices" array and "model" parameter
- Improve the text processing logic, eliminating unnecessary separators
- Standardize the error handling logic, simplifying the status code checks
- Fix the DOM operation method, using "createElement" instead of string concatenation
- Ensure the existence check of the "customVoices" array

* Fix: Change the Content-Type of the audio response to audio/mpeg.

* Clean-up

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-01-26 20:45:38 +02:00
ef25a03650 Expose character update APIs for extensions (#5062)
* Expose character update APIs for extensions

Add getCharacterSource, importFromExternalUrl, and importTags to the
extension context (SillyTavern.getContext()). This allows extensions to:

- Get the source URL for a character (Chub, etc.)
- Import/update a character from an external URL
- Import tags from a character's embedded tag data

These functions already exist and are used internally but were not
exposed to extensions. This enables extension developers to build
features like bulk character update checking and tag synchronization.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix review comments

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-01-26 20:38:23 +02:00
Cohee 5a7875ba28 Update Pollinations API (#5060)
* Upgrade Pollinations API
Done: text, caption
To do: TTS, image
Fixes #5020

* Update Pollinations TTS to new API

* Update Pollinations API for images
2026-01-26 20:31:13 +02:00
Cohee ffa01d80a6 Add macros autocomplete to alternate greetings 2026-01-23 23:51:06 +02:00
WolfsblvtandCohee 9ff9d59672 Macros 2.0 (v0.7.1) - Macro Autocomplete everywhere (#5019)
* Add macro autocomplete for free text inputs

Implements macro autocomplete (`{{`) for textareas and input fields marked with `data-macros` attribute. Extracts shared autocomplete logic into MacroAutoCompleteHelper.js for consistency between slash command and free text contexts. Includes MutationObserver for dynamic element initialization and supports variable shorthands, operators, flags, and scoped macro closing tags.

* fix annoying circular dependency again

* Add `data-macros` attribute to enable macro autocomplete on text inputs

Enables macro autocomplete (`{{`) for various textareas and input fields throughout the UI by adding the `data-macros` attribute. Includes context template fields, instruct mode sequences, character/persona descriptions, world info content, and other prompt-related inputs. Also ensures the attribute is preserved when expanding editors and creating world info entries.

* Allow macro autocomplete in editing messages

Enables macro autocomplete (`{{`) when editing messages by adding the `data-macros` attribute to the dynamically created edit textarea element.

* Add autocomplete visibility setting support for macro autocomplete

Respects the global STScript autocomplete visibility setting (`power_user.stscript.autocomplete.state`) for macro autocomplete in free text inputs. When set to "Input length > 1", macro autocomplete only activates after typing `{{` plus at least 2 characters. Also adds a tooltip to the visibility setting explaining it applies to both slash commands and macros.

* Fix unclosed div tag in STScript autocomplete visibility setting

Closes the `<div>` tag that was incorrectly left open in the autocomplete visibility setting markup.

* Add setting to control macro autocomplete visibility in non-expanded fields

Introduces a new `showInAllMacroFields` setting that controls whether macro autocomplete appears in all macro-enabled fields or only in expanded editors and when pressing Ctrl+Space. Also adds `data-macros-autocomplete` attribute support with `always` and `hide` modes for per-field override. When the setting is off, autocomplete only shows in expanded editors (which now get `data-macros-autocomplete="always"`) and the completion

* Add `data-macros-autocomplete-style` attribute to control macro autocomplete popup size

Introduces a new `data-macros-autocomplete-style` attribute with `small` (33vw, max 700px) and `expanded` (default chat width) modes to control macro autocomplete popup dimensions. The `small` style is now the default for inline fields, while `expanded` is used for expanded editors and prompt manager. Also refactors `getAutocompleteMode` to return `DEFAULT` instead of `null` and adds corresponding `getAutocompleteStyle` helper

* Fix autocomplete details panel alignment when list is constrained by viewport edge

Adjusts the details panel position to align with the actual autocomplete list position when the list is constrained by the right edge of the viewport. Previously, the panel would position based on cursor location even when the list was pushed left, causing misalignment. Now checks if the list's actual position differs from the calculated position (with 5px tolerance) and uses the list's position instead.

* Guard autocomplete details panel alignment check with `isReplaceable` condition

Prevents attempting to read the autocomplete list's bounding rect when the list is not visible. The alignment adjustment for viewport-constrained lists now only runs when `isReplaceable` is true, avoiding potential errors when the list DOM is not rendered.

* Fix macro autocomplete cursor detection to handle nested macros correctly

Updates `findMacroAtCursor` to track nesting depth when searching for opening `{{` and closing `}}` braces. Previously would incorrectly stop at the first brace pair encountered in either direction, breaking autocomplete when cursor was inside nested macros like `{{getvar::{{getvar::name}}}}`. Now properly skips over nested macro boundaries by incrementing/decrementing depth counters until finding the matching braces at depth

* gief me my comments back (and fixes, that were missed)

- Added detailed JSDoc comments to all exported functions explaining parameters, return types, and behavior
- Added inline comments throughout functions explaining logic flow, edge cases, and implementation details
- Documented parser-based vs regex-based unclosed scope detection approaches
- Clarified variable shorthand autocomplete logic including operator filtering, context display, and priority

* refactor(macros): freeze MACRO_AUTOCOMPLETE_MODE and MACRO_AUTOCOMPLETE_STYLE enums

* feat(macros): explicitly set `makeSelectable` flag for non-insertable autocomplete options

- Set `makeSelectable = true` for variable shorthand options in {{if}} conditions (already insertable)
- Set `makeSelectable = false` for already-typed operators in variable shorthand autocomplete
- Set `makeSelectable = false` for already-typed flags in macro autocomplete
- Set `makeSelectable = false` for non-selectable closing block flags when no unclosed scopes exist
- Set `makeSelectable = false` for sc

* refactor(macros): consolidate typedef imports in MacroAutoCompleteHelper

- Fixed typo in MacroDefinition typedef import (removed extra `/` from JSDoc comment)
- Replaced long-form typedef imports with short-form aliases for MacroAutoCompleteContext and MacroDefinition
- Improved code consistency by using imported typedefs throughout function signatures

* refactor(autocomplete): select first selectable item as default instead of always first item

- Extracted default item selection logic into `selectDefaultItem()` method
- Changed default selection to prioritize first selectable item over first item in list
- Falls back to last item when no selectable items exist (preserves context for info-only options)
- Added JSDoc documentation explaining selection behavior

* feat(macros): make already-typed variable names non-selectable in autocomplete

- Set `makeSelectable = false` for variable name options that match the currently typed name
- Set empty `valueProvider` for matched variables to prevent re-insertion
- Prevents redundant selection of variables that are already fully typed in the input

* feat(macros): add value context autocomplete option for variable shorthand operators

- Created `VariableValueContextAutoCompleteOption` class to display context about expected values
- Shows operator name, symbol, and description when typing variable shorthand values
- Displays currently typed value and completion hint
- Non-selectable option (context only) with priority 4
- Added to variable shorthand autocomplete when operator is typed and value is being entered

* fix lint

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-01-23 23:46:47 +02:00
Wolfsblvt ca60ba148c chore(macros): Allow registration of aliases for existing macros (#5053)
- Added `registerMacroAlias()` public method to register aliases for existing macros
- Extracted shared registration logic into private `#registerMacroEntry()` helper
- Refactored `registerMacro()` to use `#registerMacroEntry()` for both primary macros and aliases
- Alias registration validates name format, prevents self-aliasing, and resolves alias chains to primary definition
- Aliases inherit handler and metadata from target but has source of the registration caller
2026-01-23 23:19:07 +02:00
Cohee bf7efbf7e1 Merge branch 'release' into staging 2026-01-23 22:52:57 +02:00
Cohee 7a497421bb Add getOneCharacter to getContext 2026-01-23 22:52:17 +02:00
Wolfsblvt 42155ecebf Macros 2.0 (v0.7.3) - Variable Shorthand: Comparison Operators & Autocomplete Improvements (#5050)
* feat: Add numeric comparison operators (>, >=, <, <=) to variable shorthand syntax

- Added four new comparison operators for local and global variables
- Implemented greaterThan, greaterThanOrEqual, lessThan, lessThanOrEqual operations in MacroCstWalker
- Updated lexer to recognize >=, >, <=, < operators (longer patterns before shorter to avoid conflicts)
- Simplified parser by consolidating operator alternatives into single OR block
- Enhanced autocomplete with operator definitions, examples, and usage

* Improve autocomplete for variable shorthand operators with cursor-aware filtering

- Track `variableNameEnd` and `variableOperatorEnd` positions in parsed macro context for accurate cursor position checks
- Add `isShortOperatorPrefix()` helper to detect operators that could be prefixes of longer ones (e.g., `>` → `>=`)
- Fix operator autocomplete to show longer variants when typing short operators (typing `>` now shows both `>` and `>=`)
- Show operator suggestions immediately when variable
2026-01-23 01:05:00 +02:00
Wolfsblvt 6f5032f20e Allow reasoning edit to substitute macros on saving the reasoning (#5052)
* Apply macro substitution when editing reasoning content

- Added `substituteParams()` call to process macros in edited reasoning text
- Changed `newReasoning` from const to let to allow reassignment

* chore: Remove unnecessary double macro substitution from message edit

- Removed `substituteParams()` call for first message (index 0) in `messageEditDone()`
- Macro substitution is now handled consistently by `updateMessage()` for all messages
2026-01-23 00:45:26 +02:00
Cohee 042dd44408 Add APP_INITIALIZED to event auto-fire list 2026-01-23 00:32:43 +02:00
cc12ace48d Clarified contribution guidelines for large PRs. (#5032)
* Added guidelines for splitting large PRs.

* Added links, formatting and mentioned dot property access.

* Fixed and corrected:
https://github.com/SillyTavern/SillyTavern/pull/5032#discussion_r2707433279
https://github.com/SillyTavern/SillyTavern/pull/5032#discussion_r2707445447
https://github.com/SillyTavern/SillyTavern/pull/5032#discussion_r2707449255
https://github.com/SillyTavern/SillyTavern/pull/5032#discussion_r2707455801
https://github.com/SillyTavern/SillyTavern/pull/5032#discussion_r2707458468

* Removed and altered: https://github.com/SillyTavern/SillyTavern/pull/5032#discussion_r2710152562 https://github.com/SillyTavern/SillyTavern/pull/5032#discussion_r2710125321 https://github.com/SillyTavern/SillyTavern/pull/5032#discussion_r2710129926 https://github.com/SillyTavern/SillyTavern/pull/5032#discussion_r2707430359

* Get rid of nested lists

---------

Co-authored-by: user <user@exmaple.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-01-23 00:24:38 +02:00
a09c1a7a84 Added 'dot-notation': ['error'] to .eslint.cjs (#5042)
* Added 'dot-notation': ['error'], to `.eslint.cjs`

* Ran `eslint --fix` to correct `dot-notation` errors.

* Added `eslint-disable dot-notation` anywhere errors were caused.

* Allowed dot-notation for uppercase properties: 'allowPattern': '[A-Z]\\w*$'

* Check if `rule instanceof CSSStyleRule`
https://github.com/SillyTavern/SillyTavern/pull/5042#discussion_r2711827148

* Fixed `await result.json();` types.

* refactor: update dot-notation usage in CoquiTtsProvider and PresetManager

---------

Co-authored-by: user <user@exmaple.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-01-23 00:11:03 +02:00
Cohee 03f671ca72 Merge branch 'release' into staging 2026-01-22 23:59:08 +02:00
Cohee d6a20ba546 Fix npm audit 2026-01-22 23:58:57 +02:00
WolfsblvtandCohee 26d495f457 Add /reroll-pick command to reset {{pick}} macro (#5049)
* feat(macros): Add `/reroll-pick` command to reset `{{pick}}` macro choices

- Added `/reroll-pick` slash command to change the seed for all `{{pick}}` macros in current chat
- Command accepts optional numeric seed value, otherwise increments current seed by 1
- Updated `{{pick}}` macro to use `pick_reroll_seed` from chat metadata in seed calculation
- Updated `{{pick}}` macro description to mention reroll capability
- Added comprehensive help text with examples for `/reroll-pick` command
- Updated tests

* lint fix

* fix(macros): exclude null reroll seed from {{pick}} hash calculation

- Changed reroll seed default from 0 to null when not set
- Filter out null values from combined seed string to avoid including "-0" suffix
- Updated both core macro implementation and tests to match new behavior

* Use strict null comparison

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-01-22 23:52:59 +02:00
WolfsblvtandCohee f3c886fd12 Add APP_INITIALIZED event before hideLoader in initialization sequence, before APP_READY fires (#5051)
* Add APP_INIT event before hideLoader in initialization sequence

* refactor(events): rename APP_INIT to APP_INITIALIZED

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-01-22 23:40:48 +02:00
Forkoz b5eacfa014 Add tabby for adaptive_P (#5044) 2026-01-22 12:39:03 +02:00
san-tianandccss 865114fb1c Replace error with warn when failing to write config.yaml
* try to modify config.yaml at start instead of modify it

* replace error with warn when failing to write config.yaml

---------

Co-authored-by: ccss <ccss>
2026-01-21 14:56:23 +02:00
Cohee ff78290fd0 glm-4.7-flash 2026-01-20 23:22:29 +02:00
CoheeandPavdig 2c09d32b5b feat(docker): add robust healthcheck script (#5028)
* feat(docker): add robust healthcheck script

- Added `docker/healthcheck.cjs`: A standalone, dependency-free Node.js script for verifying server status.
- Updated `Dockerfile`: Added HEALTHCHECK instruction and script copy step.
- Features: Auto-detects port from env/config, handles IPv4/IPv6 fallback, auto-retries HTTPS on socket hangup, and sets custom User-Agent.

* feat(docker): new healthcheck with /api/health endpoint

- Added `GET /api/health` endpoint to `server.js` (unauthenticated) for lightweight status checks.
- Update `docker/healthcheck.cjs`: Rewrite
- Updated Error handle for `HEALTHCHECK`

* feat(docker): switch to heartbeat file healthcheck mechanism

- Replaced network-based check with a file-based heartbeat approach.
- Updated `src/command-line.js`: Added `heartbeatInterval` argument with explicit ENV override (`SILLYTAVERN_HEARTBEAT_INTERVAL`).
- Updated `src/server-main.js`: Added logic to write `heartbeat.json` to data directory at set intervals.
- Rewrote `docker/healthcheck.cjs`: Script now monitors the heartbeat file timestamp (zero dependencies, no config parsing required).
- Updated `Dockerfile`: Sets default heartbeat interval to 30s and ensures script availability.
- Updated `config.yaml`: Added `heartbeatInterval` defaulting to 0 (disabled) for non-Docker users.

* Fix variable names

* Convert to ESM, use serverDirectory variable

* Move file to /src

* fix: update heartbeat path to use global DATA_ROOT variable

* Pretty colors

* Move healthcheck to docker-compose.yml

* Comment fixed

* Even cleaner diff!

---------

Co-authored-by: Pavdig <101715456+Pavdig@users.noreply.github.com>
2026-01-18 16:36:37 +02:00
Cohee 1ff98e76f8 Recent Chats: Add pin functionality (#5030)
* feat: Implement pinned chat functionality in welcome screen

* Highlight pinned / unpinned blocks

* Reduce flash duration
2026-01-18 15:50:23 +02:00
a50fecee25 feat(sd): Add generation status indicator and improve abort handling (#5015)
* feat(sd): Add generation status indicator and improve abort handling

- Add persistent toast notification showing "Generating image..." during generation
- Toast displays spinner, supports multiple concurrent generations with count
- Click toast to dismiss (generation continues in background)
- Improve abort handling: show friendly "Image generation stopped" info message
  instead of error when user clicks stop button
- Handle abort in both generatePicture() and sendGenerationRequest() catch blocks

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Scope abort controllers for each individual button

* Use native element reference for caching button abort controller

* Update toast in paintbrush button handler

* refactor: Update abort message for image generation in sdMessageButton

* feat: Enhance generation indicator with active generation count in toast

* Move tracking after prompt generation, add toast for LLM prompt gen progress

* Add type annotation for generation toastr

* Simplify generation abort checks

* Remove unnecessary blank line in addSDGenButtons function

---------

Co-authored-by: mschienbein <mschienbein@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-01-18 15:03:56 +02:00
PavdigandCohee 78651bdf56 Docker: Build Optimization and Enhanced Non-Root/Volumeless Support (#5024)
* docker: optimize build layers and enhance permission handling

- Pre-created hardcoded dirs in Dockerfile to support volumeless non-root runs.
- Enhanced slightly docker-entrypoint.sh with robust volume detection and safer chown logic.
- Included legacy 'backups' directory... again.
- Added dos2unix to install list.
- Updated .dockerignore
- Updated comments
- Smaller fixes

* fix(docker): removed unnecessary comment, and the... *sighs* backups dir, again

* Exclude DS_Store everywhere

* Exclude tests and all jsconfigs from docker images

* Exclude local plugins from docker builds

* fix(docker): backups are back... yay xD

* feat(docker): add robust healthcheck script

- Added `docker/healthcheck.cjs`: A standalone, dependency-free Node.js script for verifying server status.
- Updated `Dockerfile`: Added HEALTHCHECK instruction and script copy step.
- Features: Auto-detects port from env/config, handles IPv4/IPv6 fallback, auto-retries HTTPS on socket hangup, and sets custom User-Agent.

* Fix .dockerignore permission

* Revert "feat(docker): add robust healthcheck script"

This reverts commit fa634fb088.

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-01-17 22:51:50 +02:00
Cohee 06691e8b9d Gemini: Add config.yaml setting for thought signatures (#5025) 2026-01-16 23:23:39 +02:00
Cohee 9d36b19ef9 Update validation for query messages and max entries 2026-01-16 23:11:07 +02:00
adventchilde / aethelandCohee 8926cdc5ce Adding Slash Commands for Vector Storage Extension (#5008)
* Add vector slash commands

* Updated vector-threshold command per feedback. Want to validate it is correct before fixing other commands.

* Added slash commands for several vector storage settings.

* Added slash commands for vector storage, updated w/dev feedback

* Fix min value of entries

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-01-16 22:59:24 +02:00
Beinsezii 76f70ec3c2 Add Adaptive P sampler ordering (#5022) 2026-01-16 12:41:06 +02:00
Jeff SandbergandCohee b418ec5c37 Add taxon filter controls to Group Chat member list (#5006)
* Add taxon controls to top of group member list

* Refactor/cleanup getGroupCharacters

* Fix favorites, refactor and cleanup code

* Fix clearing filters, only show relevant filters in groups

* Fix issues and add persistence

- Fix group member tag listing requiring character list to be init to display
- Fix character tag updates to actually show up in group member contexts
- Persist filter changes for group member tag controls

* Apply suggestions from code review

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>

* Avoid sibling selectors

* Err on invalid tag type

* avoid hardcoded ids

* cleanup: don't use `group_member`, use `group_candidates_list`

* Support both selectors and jquery instances in getFilterHelper

* Sanitize missing tag filters before rendering

* Unscrew jsdoc formatting

* Show all tags, mark absents specially

* Improve JSDoc

* Fix tag indicator for group contexts

* Don't use deprecated fields

* Add a comment on potentially undefined group id

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-01-16 02:27:59 +02:00
Cohee e77c1d33a6 Fix logit bias with best match tokenizer
Fixes #5017
2026-01-15 21:43:31 +02:00
Beinsezii ede7efe52c Adaptive-P for llama.cpp llama-server (#4959)
* Enable Adaptive-P UI on llama.cpp

* Add Adaptive P sampler ordering

* Revert "Add Adaptive P sampler ordering"

This reverts commit 22d85a0e89.
2026-01-15 21:28:30 +02:00
Wolfsblvt 9b0f0dcc9a Fix legacy name prefix removal using wrong variable in bookmarks
Fixes leftover bug from #4993.
In both `getBookmarkName` and `createBranch`, the second regex replacement was incorrectly using the original `name` variable instead of the already-cleaned `cleanName` variable, causing the legacy prefix removal to fail.
2026-01-15 11:01:52 +01:00
Wolfsblvt 0b529290aa Macros 2.0 expose runtime warn log function 2026-01-15 00:32:27 +01:00
7d99540829 Improved printMessages performance on large chats by reducing DOM updates. (#4947)
* Improved printMessages performance by reducing DOM updates.
Refactored part of addOneMessage into createMessageElement.

Before: Rendered 1000 messages in 25.529199999809265 seconds.
After:  Rendered 1000 messages in 5.088 seconds.

* Fixed mistakes: https://github.com/SillyTavern/SillyTavern/pull/4947#pullrequestreview-3624592007

* Formatting fix

* Fixed scroll and last_mes order..

* Refactored printMessages logic into redisplayChat.

* Passed `fade`.

* Cleanup.

* WIP.
Removed getMessageFromTemplate
Refactored addOneMessage and updateMessageElement.

* Minor changes to better match https://github.com/SillyTavern/SillyTavern/pull/4985

* If insert is false, `newMessage` may not be new, so I renamed `newMessage` to `messageElement` and `newMessageId` to `messageId`.

I also rearranged some constants to improve readability.

* Accept 0 as valid insertAfter/insertBefore targets

* Renamed forceId to messageId for clarity.

* Change forceId to undefined by default.

* Swapped `forceId` to `messageId` in addOneMessage.

* Added adjustMediaScroll to updateMessageElement.

* Revert "Change forceId to undefined by default."

This reverts commit cbda7eb3fe.

---------

Co-authored-by: user <user@exmaple.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-01-15 00:30:40 +02:00
bce1372ed4 feat(sd): Add Z.AI GLM-Image model support (#5012)
* feat(sd): Add Z.AI GLM-Image model support

Add the new GLM-Image model to the Z.AI image generation source:
- Add 'glm-image' to the model dropdown with friendly display name
- Handle GLM-Image's requirement for dimensions in multiples of 32
  (vs CogView's multiples of 16)
- Show quality dropdown for GLM-Image (supports standard/hd)

The GLM-Image model uses the same API endpoint as CogView
but has different dimension constraints.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat(sd): Enhance Z.AI GLM-Image support

- Use regex for GLM-Image model detection (futureproofing)
- Skip 2^21 pixel limit for GLM-Image (CogView-specific)
- Add Z.AI recommended resolutions (1280x1280, 1568x1056, etc.)
- Add "Use Coding API" toggle for GLM Coding Plan users
- Add better error logging for image fetch debugging

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* refactor(sd): Address PR review feedback for Z.AI GLM-Image

- Remove custom zai_coding_api setting, use existing oai_settings.zai_endpoint
- Always use Common API for image generation (avoids rate limits)
- Keep ZAI_ENDPOINT import for consistency with other extensions

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: always use Common API for Z.AI image generation

Removes conditional endpoint selection since we decided to always use
Common API for image generation (Coding API has stricter rate limits).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* It's not only cogview anymore

* Remove unused param from request payload

* Remove redundant debug logs

* Loosen the check on image quality data attribute

* Bring back coding API notice

---------

Co-authored-by: mschienbein <mschienbein@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-01-14 23:58:53 +02:00
Cohee b89ffdfece Suppress error messages when Firefox unloads the tab (#5013)
* Fix error messages when Firefox tab reopened after unload
#4989

* Export settingsReady flag
2026-01-14 23:40:52 +02:00
Cohee 206540a072 Revert "Add <svg> to list of Showdown block tags (#4998)"
This reverts commit f79ee5a1b1.
2026-01-14 03:25:54 +02:00
Cohee 26af6b10c3 Increase wait delay in chat-jump 2026-01-14 02:32:53 +02:00
Cohee 7e410b4aa8 Retry API tokenization on reconnecting to backend
Fixes #5004
2026-01-14 02:16:56 +02:00
Cohee cd3bed87c1 Merge pull request #4954 from SillyTavern/fix/docker-readonly
Update Dockerfile
2026-01-14 01:46:14 +02:00
Cohee f79ee5a1b1 Add <svg> to list of Showdown block tags (#4998)
Fixes #4898
2026-01-14 00:49:42 +02:00
3e40ac1c27 refactor/perf-printMessages #4: Renamed newMessage to messageElement and newMessageId to messageId. (#4985)
* If insert is false, `newMessage` may not be new, so I renamed `newMessage` to `messageElement` and `newMessageId` to `messageId`.

I also rearranged some constants to improve readability.

* Accept 0 as valid insertAfter/insertBefore targets

* Yeah whatever

---------

Co-authored-by: user <user@exmaple.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-01-14 00:20:26 +02:00
Wolfsblvt f8c373f55a Macros 2.0 (v0.7.0) -Variable Shorthand: New Operators & Lazy Evaluation (#4997)
* Add new variable shorthand operators and new variable macros

- Add `{{hasvar}}` and `{{deletevar}}` macros for local variables
- Add `{{hasglobalvar}}` and `{{deleteglobalvar}}` macros for global variables
- Implement new variable shorthand operators: `-=`, `||`, `??`, `||=`, `??=`, `==`
- Refactor variable expression evaluation to use direct variable API calls instead of routing through macro registry
- Add comprehensive operator support in lexer with proper token ordering for multi-character operators

* Implement lazy evaluation for variable shorthand value expressions

- Replace eager value evaluation with lazy evaluation pattern for variable operators
- Add `#createLazyValue()` method that caches value expression result on first call
- Change `#executeVariableOperation()` to accept `lazyValue` function instead of pre-evaluated value
- Only evaluate value expressions when actually needed (e.g., when variable is falsy for `||`, when variable doesn't exist for `??`)
- Add comprehensive e2e tests

* Update variable shorthand autocomplete with new operators and add edge case tests

- Add new operators to autocomplete definitions: `-=`, `||`, `??`, `||=`, `??=`, `==`
- Update example lists in `VariableShorthandAutoCompleteOption` and `VariableNameAutoCompleteOption`
- Add operator definitions with descriptions and `needsValue` flags to `VariableOperatorDefinitions`
- Update `parseMacroContext()` to recognize new operators with proper ordering (longer operators checked first)

* Add not equals (!=) operator to variable shorthand expressions

- Add `!=` operator to variable shorthand definitions for local and global variables
- Implement `notEquals` operation in `MacroCstWalker` that returns inverted equality comparison
- Add `NotEquals` token to lexer with pattern `/!=`
- Update parser to handle `!=` operator with value expression
- Add `!=` operator to autocomplete examples and operator definitions
- Update `parseMacroContext()` to recognize `!=` operator and...

* Tiny code review fixes

- Fix typo: "insie" → "inside" in variable shorthand operators comment
- Remove extra space in `{{getglobalvar}}` example usage

* Fix missing closing braces in hasglobalvar macro example usage

* Fix isFalsy to normalize value before checking boolean state in variable shorthand operators

- Apply `normalize()` to value before passing to `isFalseBoolean()` in `isFalsy` helper
- Ensures consistent falsy evaluation for variable shorthand operators like `||`, `??`, `||=`, `??=`

* Fix pipe character inside macro braces being treated as command separator

- Add `isInsideMacroBraces()` method to track unclosed `{{}}` macro braces
- Modify `testCommandEnd()` to only treat `|` as command end when not inside macro braces
- Scan text behind current position to calculate macro brace depth
- Skip second character when detecting `{{` or `}}` pairs
- Ensure `depth` never goes below 0 using `Math.max(0, depth - 1)`

* Add aliases for variable existence and deletion macros

- Add `varexists` alias for `hasvar` macro
- Add `flushvar` alias for `deletevar` macro
- Add `globalvarexists` alias for `hasglobalvar` macro
- Add `flushglobalvar` alias for `deleteglobalvar` macro

* Update variable shorthand operator descriptions to clarify return behavior

- Add "returns nothing" clarification to `=`, `+=`, `-=` operators in examples and definitions
- Add "returns the new value" clarification to `++`, `--` operators in examples and definitions
- Update `VariableOperatorDefinitions` descriptions to match example text
- Ensures users understand which operators return values vs perform silent mutations
2026-01-13 13:32:18 +02:00
Cohee 9e88f23382 Merge branch 'release' into staging 2026-01-13 02:25:03 +02:00
Cohee bba91e38fc Google Translate: Normalize pt-BR target language 2026-01-13 02:23:46 +02:00
Cohee 684b755826 Adjust itemized prompts on message move/delete (#5000)
* Adjust itemized prompts on message move/delete

* Sort itemized prompts on swap

* Remove itemized prompt on regeneration
2026-01-12 22:40:33 +02:00
69b7a17c77 refactor/perf-printMessages #3: Extracted updateMessageItemizedPromptButton and getMessageHTML from addOneMessage to improve readability. (#4984)
* Extracted updateMessageItemizedPromptButton and getMessageHTML from addOneMessage to improve readability.

* Fix types and function calls

* Fixed insertBefore, insertAfter and messages without extra.

* Use strict comparison operator

* Use logical OR for display text fallback

* Fixed newMessageId again.

* Faster showMoreMessages.

* removed `insertAfter` and `insertBefore` from `mes_edit_copy`,  `/message-role` and `/message-name`.

* Formatting fix

* Refactor newMessageId

---------

Co-authored-by: user <user@exmaple.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-01-12 21:39:47 +02:00
Cohee 372db63cd5 NanoGPT: Add reasoning effort control
Closes #4999
2026-01-12 21:05:02 +02:00
Cohee 618918535e Show a page reload prompt on EME toggle (#4994)
* Show a page reload prompt on EME toggle
#4992

* Fix lint

* Orange toast
2026-01-12 02:18:57 +02:00
a9f2d559f4 refactor/perf-printMessages #2: Removed getMessageFromTemplate (#4983)
* Reduced redundant swipe code by fully updating the swipe message.

* `getMessageFromTemplate` is an inconvenient function that requires more lines than it saves.
It cannot be used in any other function, therefore it should not exist.
This change also prevents an unnecessary call of `messageTemplate.clone` in addOneMessage when `type = 'swipe'`.

ESLint.

* Fixed: https://github.com/SillyTavern/SillyTavern/pull/4983#discussion_r2680379455

* Replaced ?? with &&: https://github.com/SillyTavern/SillyTavern/pull/4983#discussion_r2680366010 and removed comments.

* Fixed bias check. "0" is falsy.

* Remove scroll adjust early bail

* Call appendMediaToMessage before updating content
Because we need to preserve chatHeight and scrollPosition according to the previous swipe, not the new one

---------

Co-authored-by: user <user@exmaple.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-01-12 02:12:51 +02:00
Wolfsblvt 491f2a3afd Feature: Enhanced Branch and Checkpoint Naming (#4993)
* Add customizable name builder and max tries to getUniqueName utility

- Add optional `nameBuilder` parameter to allow custom name formatting
- Add `maxTries` parameter to client-side version to prevent infinite loops
- Update JSDoc with new optional parameters
- Use nullish coalescing to set default name builder function
- Default name builder maintains existing "${baseName} (${i})" format

* Add startIndex option to getUniqueName utility for flexible name generation

* Enhance branch creation to use current chat name and ensure unique names

- Import `getCurrentChatDetails` from script.js
- Replace hardcoded branch name format with current chat name as base
- Add custom `buildBranchName` function to format branch names with suffix
- Strip existing " - Branch #N" suffixes before generating new branch name
- Use `getUniqueName` utility with `nameBuilder` to ensure unique branch names
- Remove unused `mainChat` variable and replace with `mainChatName`

* Enhance checkpoint creation to use current chat name and suggest unique names

- Import `getCurrentChatDetails` from script.js to get current chat name
- Add custom `buildCheckpointName` function to format checkpoint names with suffix
- Strip existing " - Checkpoint #N" suffixes before generating new checkpoint name
- Use `getUniqueName` utility with `nameBuilder` to ensure unique checkpoint names
- Pass `suggestedName` to template and popup input for better UX
- Replace manual loop with `getUniqueName`

* Remove automatic timestamp suffix from bookmark names

* Fix getUniqueName utility to correctly handle maxTries and return null on failure

* shut up copilot

* Strip legacy bookmark and branch name prefixes when generating unique names

- Add removal of old "Checkpoint #N - " prefix format in `buildCheckpointName`
- Add removal of old "Branch #N - " prefix format in `buildBranchName`
- Change `cleanName` from const to let to allow multiple replacements
- Ensures clean base names regardless of legacy or current naming format
2026-01-12 01:07:51 +02:00
Coheeanduser 2d1a96f91d Improve performance of printMessages (#4979)
* Improve performance of printMessages

* Add clarifying comment

* Refactor printMessages into redisplayChat.

* const https://github.com/SillyTavern/SillyTavern/pull/4981#discussion_r2675632422

* Use `toFixed(3)` instead of 17 decimals. https://github.com/SillyTavern/SillyTavern/pull/4981#discussion_r2675647691

* Removed `.find is faster than .children.` comment. https://github.com/SillyTavern/SillyTavern/pull/4981#discussion_r2675625188

* Simplified add 'last_mes'. https://github.com/SillyTavern/SillyTavern/pull/4981#discussion_r2675616734

---------

Co-authored-by: user <user@exmaple.com>
2026-01-11 18:33:23 +02:00
Cohee 1bfabd9b77 Merge branch 'release' into staging 2026-01-11 02:49:11 +02:00
Cohee f861beb244 OpenRouter: Fix fallback model request 2026-01-11 02:48:58 +02:00
Cohee d56011b60f Skip redundant scroll adjustment 2026-01-11 02:05:44 +02:00
Cohee ab164efea6 Fix: don't call append media twice on swipe (#4991) 2026-01-11 01:41:10 +02:00
Wolfsblvt 858b9e684e Enhance world duplication to use current world name as base (#4990)
- Update `getFreeWorldName()` to accept optional `worldName` parameter and `stripIndex` option
- Add JSDoc documentation for `getFreeWorldName()` parameters and return value
- Modify world duplicate handler to pass current world name to `getFreeWorldName()`
- Strip existing numbered suffix from base name before generating new numbered name
- Default to "New World" when no world name is provided
- Make "New World" translatable
2026-01-11 00:01:16 +02:00
Cohee 281c50bb52 Fix: init macros before extensions (#4988)
* Fix: init macros before extensions

* Add an anchor comment for future reference
2026-01-10 23:38:21 +02:00
Cohee 6036ff9a3c Merge branch 'release' into staging 2026-01-10 19:53:16 +02:00
Cohee eb48c5abe2 Fix: show edit textarea for messages with inline media 2026-01-10 19:53:08 +02:00
Cohee d25d97ad5d Merge branch 'release' into staging 2026-01-10 19:37:59 +02:00
Cohee c705cbe698 Fix {{summary}} with experimental engine 2026-01-10 19:37:43 +02:00
Wolfsblvt 5c2a02a128 Fix {{pick}} macro seeding inside delayed-resolution macros like {{if}} (#4986)
- Thread `contextOffset` through `MacroEngine.evaluate()` to preserve global document position
- Update `resolve()` in execution context to pass caller's `globalOffset` as `contextOffset`
- Add `offsetDelta` option to `resolve()` for additional offset customization
- Add regression tests for `{{pick}}` inside `{{if}}` blocks with `delayArgResolution`
- Ensure identical picks at different positions produce different results
2026-01-10 11:50:58 +02:00
Cohee ad860f4447 Z.AI: Add video generation models 2026-01-10 00:59:33 +02:00
Wolfsblvt 3047045d37 Macros 2.0 [Fix] - Fix macro evaluation to allow nested scoped macros in arguments (#4977)
* Fix scoped macro evaluation to allow nested scoped macros in arguments

- Refactor `#evaluateArgumentNode` to re-parse argument content for scoped macro pairs
- Create shared `#evaluateRawContent` helper method for consistent text evaluation
- Update `#evaluateScopedContent` to use the shared helper, reducing duplication
- Add 8 comprehensive test cases for nested scoped macros in arguments
- Enhance JSDoc documentation for EvaluationContext text parameter

* Fix `{{pick}}` macro to use global document offset for deterministic seeding

- Replace `range.startOffset` with `globalOffset` in pick macro handler for consistent position-based seeding
- Add `contextOffset` to EvaluationContext to track base offset from original document (starts at 0 for top-level)
- Calculate `globalOffset` as `contextOffset + range.startOffset` when building MacroCall objects
- Thread `contextOffset` through evaluation pipeline: MacroEngine → MacroCstWalker → all evaluation

* Fix typo in MacroCstWalker JSDoc comment and thread contextOffset through evaluateDocument

- Correct JSDoc typo: "rull macro text" → "full macro text"
- Destructure `contextOffset` from options in `evaluateDocument` method
- Pass `contextOffset` to EvaluationContext instead of hardcoded 0
2026-01-09 23:25:08 +02:00
Cohee 8a32b72dfe Replace $.ajax with fetch (#4978) 2026-01-09 02:28:22 +02:00
Cohee 68d4da1c83 Optimize getGroupPastChats (#4976)
* Optimize getGroupPastChats

* Add return type to getGroupPastChats
2026-01-09 02:17:18 +02:00
8372e7bf9d "gradually replacing property access with a dot operator" (#4965)
* "gradually replacing property access with a dot operator"
https://github.com/SillyTavern/SillyTavern/pull/4963#discussion_r2663003561

(?<=\w|\])\['([a-zA-Z]\w+)'\]
My regex found 593 matches across 47 files.
Also, two typos.

* Fixed chat[0].chat_metadata type error.
https://github.com/SillyTavern/SillyTavern/pull/4965#discussion_r2664275854

* Fixed `swipedElementsDiv[0]?.getAnimations().filter((a) => a.animationName` type error.
https://github.com/SillyTavern/SillyTavern/pull/4965#discussion_r2664274593

* Fixed config.MESSAGE_SANITIZE and config.MESSAGE_ALLOW_SYSTEM_UI type errors.
https://github.com/SillyTavern/SillyTavern/pull/4965#discussion_r2664266271

* Fixed group.date_last_chat type error.
https://github.com/SillyTavern/SillyTavern/pull/4965#discussion_r2664295652

* Reverted SlashCommandParser dot property access.
https://github.com/SillyTavern/SillyTavern/pull/4965#discussion_r2664310931

* LLM fixed canUseNegativeLookbehind.result; type error.
https://github.com/SillyTavern/SillyTavern/pull/4965#discussion_r2664314288

* Reverted chat-completions.js bodyParams and headers dot property access.

https://github.com/SillyTavern/SillyTavern/pull/4965#discussion_r2664317848
https://github.com/SillyTavern/SillyTavern/pull/4965#discussion_r2664320088
https://github.com/SillyTavern/SillyTavern/pull/4965#discussion_r2664324438

* Reverted openai.js data dot property access.

https://github.com/SillyTavern/SillyTavern/pull/4965#discussion_r2664326244

* Reverted tests/frontend/MacroEnvBuilder.e2e.js env.dynamicMacros dot property access.

https://github.com/SillyTavern/SillyTavern/pull/4965#discussion_r2664330990

* Partially reverted `window` dot property access.

* Reverted result.json() and settings dot property access.

* Reverted google.js headers dot property access.

* Fixed regex: `(?<=\w|\])\['([a-zA-Z]\w*)'\]`

* Swapped window to globalThis with dot property access.

* LLM fixed canUseNegativeLookbehind type.

* Refactor property access

* Consistency

---------

Co-authored-by: user <user@exmaple.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-01-08 23:58:21 +02:00
allen9441andCohee f6a2def403 Fix user handle naming logic (#4969)
* Fix user handle naming logic

* Extract slugify logic into a module func

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-01-08 19:08:37 +02:00
Cohee f797573290 Add OpenRouter headers to image generation requests 2026-01-07 12:31:06 +00:00
Cohee 908368f221 Merge branch 'release' into staging 2026-01-07 08:55:24 +00:00
Cohee bc660b8b91 Fix legacy {{authorsNote}} 2026-01-07 08:54:05 +00:00
ae5f69585b Removed 87 redundant chat[chat.length - 1] lookups. (#4963)
* Removed redundant `chat[chat.length - 1]` lookups.

* Readability.
Don't chat[chat.push({}) - 1];.

* Chat can't be empty.
https://github.com/SillyTavern/SillyTavern/pull/4963#discussion_r2663006489

* Fixed mixup: https://github.com/SillyTavern/SillyTavern/pull/4963#discussion_r2663000183

* Rename it back to item

* Add early return on empty chat.

* Fix swipe assignment to use item message instead of last message

---------

Co-authored-by: user <user@exmaple.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-01-07 01:17:54 +02:00
Cohee 1c6d5da1b5 Cut secret input UI messages 2026-01-07 00:26:36 +02:00
Cohee 7320aa948d Audio inlining for OpenAI and Custom-compatible (#4964)
* Audio inlining for OpenAI and Custom-compatible

* Add context sizes

* chatgpt-image-latest

* Add quality control for gpt-image
2026-01-06 13:27:13 +02:00
CoheeandWolfsblvt 7331dba056 Macros 2.0 (v0.6.6) - STscript compatibility (#4957)
* Bypass REPLACE_GETVAR with experimental parser enabled

* (wip) macro-2.0 replacer in STscript parser

* Add support for MacroDefinitionOptions format in dynamic macros

- Add DynamicMacroValue typedef supporting string, function, or MacroDefinitionOptions object
- Extract macro definition building logic into MacroRegistry.buildMacroDefFromOptions() method
- Update MacroEngine to detect and handle three dynamic macro formats:
  1. string - direct value, no args allowed
  2. function - handler function, no args allowed (legacy)
  3. MacroDefinitionOptions object - full definition with handler, args, type

* Implement dynamic macro replacers

* Remove global typedef

* Use unique closure boundary

* Add e2e tests for MacroSlashCommands

* Update public/scripts/macros/engine/MacroEngine.js

Co-authored-by: Wolfsblvt <wolfsblvt@gmail.com>

* Use strict args array match

* Update public/scripts/macros/engine/MacroEngine.js

---------

Co-authored-by: Wolfsblvt <wolfsblvt@gmail.com>
2026-01-06 00:57:03 +02:00
Cohee 293ee0a310 Caption: Add custom model input field (#4956) 2026-01-05 02:15:52 +02:00
WolfsblvtandCohee e40b31b06d Macros 2.0 (v0.5.2) - Onboarding for new Macro Engine (#4955)
* Macros 2.0 [Feature] - Add onboarding popup for experimental macro engine features

- Add `onbordingExperimentalMacroEngine()` function in MacroDiagnostics.js to detect and prompt users about experimental features
- Detect experimental macro features in `substituteParamsLegacy()`: {{if}}, scoped macros, macro flags, variable shorthands, nested macros
- Add feature detection in autocomplete parser for macro flags, variable shorthands, and leading whitespace

* Fix typo: rename `onbording` to `onboarding` throughout macro diagnostics system

* Add `void` operator to async onboarding calls and fix typo in comment

- Add `void` operator to all `onboardingExperimentalMacroEngine()` calls to explicitly discard Promise return values
- Fix typo in MacroDiagnostics.js comment: "hat" → "that"

* Fix typo in experimental macro engine onboarding popup: "anytime time" → "any time"

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-01-05 01:32:13 +02:00
WolfsblvtandCohee b453fdc5d8 Macros 2.0 [Fix] - Macro display override uses alias name if relevant + preserve whitespaces for autocomplete closing tag (#4953)
* Refactor: Move MacroBrowser.js to macros/engine directory and update import paths

* Replace macro name with alias in displayOverride for macro browser

- Import escapeRegex utility for safe regex pattern creation
- Check if macro has aliasOf property when displayOverride is present
- Replace all occurrences of the original macro name with the alias name in displayOverride text
- Use word boundary regex pattern to match macro names in {{macro}}, {{macro::}}, and {{macro }} contexts

* Add whitespace padding preservation for macro closing tag autocomplete

- Extract paddingBefore and paddingAfter from opening macro tags in MacroCstWalker
- Pass padding info through unclosed scope detection in findUnclosedScopes() and findUnclosedScopesRegex()
- Update MacroClosingTagAutoCompleteOption constructor to accept padding options
- Apply same whitespace padding to closing tags as their corresponding opening tags
- Update regex fallback to capture and preserve whitespace from opening tags

* Add replacementStartOffset to AutoCompleteOption for whitespace normalization in closing tags

- Add replacementStartOffset property to AutoCompleteOption class with JSDoc documentation
- Update AutoComplete.select() to apply per-option replacement offset when calculating effectiveStart
- Calculate replacementStartOffset in MacroClosingTagAutoCompleteOption based on currentPadding length
- Pass currentPadding from context.paddingBefore to MacroClosingTagAutoCompleteOption in SlashCommandParser

* Fix closing tag detection regex to correctly autocomplete // macro

* Add flags and fullText to EnhancedMacroAutoCompleteOption context and fix {{//}} autocomplete offset

- Add flags, currentFlag, and fullText properties to EnhancedMacroAutoCompleteOptions JSDoc
- Store options object as #options field in EnhancedMacroAutoCompleteOption for later access
- Pass flags, currentFlag, and fullText from context to macroContext in SlashCommandParser
- Fix {{//}} macro autocomplete to adjust replacementStartOffset when typed after single slash to avoid treating it as flag

* Add unnamedArgs definition to {{//}} comment macro for better documentation

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-01-05 01:27:06 +02:00
Wolfsblvt cd0627bfec Macros 2.0 [➕Macros] - Add {{hasExtension}} macro, and refactor extension lookup logic (#4948)
* Add {{hasExtension}} macro and refactor extension lookup logic

- Move findExtension() from extensions-slashcommands.js to extensions.js and export it
- Update findExtension() to return object with name and enabled properties instead of just name string
- Add {{hasExtension}} macro to check if an extension is enabled
- Update /extension-state and /extension-exists commands to use refactored findExtension()
- Remove duplicate findExtension() implementation from extensions-slashcommands.js

* Refactor extension action callbacks to use extension object instead of separate name and enabled properties

* fix eslint
2026-01-04 20:37:27 +02:00
Cohee e6ce84d726 Wrap reloadCurrentChat into SimpleMutex. (#4944)
Supersedes #4943
2026-01-04 19:54:25 +02:00
Cohee 2fb4ab3184 Add Adaptive-P settings (#4945)
* TC: Add Adaptive-P settings and UI elements

* Improve compatibility with sampler select
2026-01-03 22:25:16 +02:00
WolfsblvtandCohee 81414724b0 Macros 2.0 (v0.5.1) - Delayed Macro Argument Resolution for {{if}} Macro (#4934)
* Add variable shorthand syntax support for local and global variables

- Add VariableShorthandType enum and VariableShorthandDefinitions for `.` (local) and `$` (global) prefixes
- Add VariableShorthandAutoCompleteOption class for autocomplete of variable shorthand syntax
- Implement variable expression parsing in MacroCstWalker to handle `{{.varName}}` and `{{$varName}}` syntax
- Add support for variable operations: get, set (=), increment (++), decrement (--), and add (+=)
- Route variable expressions to appropriate macro via handler

* Add variable shorthand autocomplete support for variable names and operators

- Add `isValidVariableShorthandName()` helper to validate variable names against shorthand pattern
- Add `VariableNameAutoCompleteOption` class for suggesting existing and new variable names
- Add `VariableOperatorAutoCompleteOption` class for suggesting operators (=, ++, --, +=)
- Add `VariableOperatorDefinitions` map with operator metadata (symbol, name, description, needsValue)

* Add variable shorthand support to {{if}} macro condition autocomplete

- Add variable shorthand (.var, $var) support to {{if}} condition evaluation in core-macros.js
- Detect and resolve variable shorthands using getvar/getglobalvar macros before condition check
- Update {{if}} description and examples to document variable shorthand syntax
- Add variable shorthand autocomplete options when typing {{if}} condition
- Show variable prefix options (. and $) when no condition is typed yet
- Reuse #buildVariableShorthandOptions

* refactor: Add Object.freeze to lexer constants and improve JSDoc documentation

- Freeze `modes` and `Tokens` objects to prevent accidental mutations
- Convert inline comments to proper JSDoc format for better documentation
- Add JSDoc block for `Def` lexer definition object
- Improve comment clarity and formatting consistency throughout MacroLexer.js
- Remove redundant section separator comments in variable shorthand modes

* Add inversion prefix (!) autocomplete support to {{if}} macro condition

- Add SimpleAutoCompleteOption class for basic autocomplete items with name, symbol, and description
- Add ! inversion prefix as autocomplete option in {{if}} condition with 🔁 icon
- Show ! as selectable option when nothing typed, non-selectable when already present
- Fix condition parsing to handle ! prefix with whitespace (e.g., "! $myvar")
- Update identifier extraction to strip ! and whitespace before detecting variable

* fix lint

* Fix variable shorthand regex in {{if}} macro to properly capture prefix and variable name

* Expand comprehensive e2e tests for variable shorthand syntax in lexer and macro engine

- Add MacroLexer tests for variable shorthand edge cases (whitespace, numbers, underscores, operators)
- Add MacroEngine tests for variable shorthand operations (hyphens, underscores, non-existent vars, chaining)
- Add MacroEngine tests for variable shorthand in {{if}} conditions (truthy/falsy, inversion, else branches)
- Test variable names with hyphens, underscores, and numbers in both get/set and conditional contexts

* Fix macro flags not being allowed inside variable shorthand macros

- Move MANY(flags) block from macroBody to macro rule to parse flags before branching
- Fix MacroCstWalker to extract flags from children.flags instead of bodyChildren.flags
- Ensures flags are available for both variable expressions and regular macros
- Fixes flag extraction in visitMacro and visitBlockMacroClose methods

* Implement delayed argument resolution for {{if}} macro to prevent side effects in non-chosen branches

- Add `delayArgResolution` flag to MacroDefinition to control when nested macros are evaluated
- Modify MacroCstWalker to skip nested macro evaluation when delayArgResolution is true
- Update {{if}} macro to use delayArgResolution and manually resolve only the chosen branch
- Replace ELSE_MARKER splitting with `splitOnTopLevelElse()` that parses CST to find correct {{else}} at depth 0

* Fix delayed resolve on if/else macros being off when a non-scoped if macro was being used inside

- Track argument count in MacroCstWalker.extractMacroInfo() to distinguish inline vs scoped macros
- Update splitOnTopLevelElse() to only track scoped {{if}} blocks (1 arg) when finding {{else}} at depth 0
- Update findClosingMacro() to only increment depth for macros that can accept scoped content
- Add e2e tests for inline {{if::condition::content}} inside scoped {{if}}/{{else}} blocks

* Remove eslint exclusion

* Remove duplicate tests

* Regenerate package-lock.json in /tests

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2026-01-03 19:45:17 +02:00
Wolfsblvt dbc4fe611c Macros 2.0 [Fix] - Make macro name matching case-insensitive throughout the macro system (#4942)
* Make macro name matching case-insensitive throughout the macro system

- Normalize macro names and aliases to lowercase in MacroRegistry storage and lookup
- Update MacroCstWalker to use case-insensitive matching for block macro pairing
- Normalize dynamic macro keys to lowercase in MacroEnvBuilder
- Update MacroEngine to use lowercase keys when checking dynamic macros
- Preserve original casing in macro definitions for display purposes
- Add comments explaining case-insensitive matching behavior

* Make alias validation case-insensitive in MacroRegistry to prevent duplicate names

- Prevents registering aliases that differ only in casing from the macro name
2026-01-03 18:40:32 +02:00
Cohee b774a553f9 Caption: allow duplicate model ids into the list from different sources 2026-01-03 00:44:11 +02:00
Cohee 0c8d74da02 NanoGPT: Enable tool calling
Closes #4930
2026-01-03 00:20:31 +02:00
Cohee f1b11db5f8 Merge branch 'release' into staging 2026-01-02 19:36:25 +02:00
Cohee ce71ca5097 Fix npm audit 2026-01-02 19:35:50 +02:00
ZhenyaPavandCohee ef89d0f291 Added regex filter option to TTS extension (#4924)
* Add regex filter option to TTS extension

- Added checkbox to enable/disable regex filtering of TTS text
- Added text input for custom regex patterns
- Default pattern removes emojis and non-English text while preserving letters, numbers, spaces, and punctuation
- Regex is applied after asterisk removal and other text processing
- Includes error handling for invalid regex patterns
- Automatically cleans up extra spaces after regex removal

* reverted the accidental change in tts_skip_tags description
clarified the regex description

* Add regex validation warning to TTS settings

* fixed regex field in UI

* reworked the regex warning

* changed the regex event to change (input might not have worked correctly)

* Apply review comments

* Spacing fix

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-12-31 20:03:04 +02:00
WolfsblvtandCohee 0dcd9906bf Macros 2.0 (v0.5) - Add variable shorthand macros and variable support to {{if}} macro (#4933)
* Add variable shorthand syntax support for local and global variables

- Add VariableShorthandType enum and VariableShorthandDefinitions for `.` (local) and `$` (global) prefixes
- Add VariableShorthandAutoCompleteOption class for autocomplete of variable shorthand syntax
- Implement variable expression parsing in MacroCstWalker to handle `{{.varName}}` and `{{$varName}}` syntax
- Add support for variable operations: get, set (=), increment (++), decrement (--), and add (+=)
- Route variable expressions to appropriate macro via handler

* Add variable shorthand autocomplete support for variable names and operators

- Add `isValidVariableShorthandName()` helper to validate variable names against shorthand pattern
- Add `VariableNameAutoCompleteOption` class for suggesting existing and new variable names
- Add `VariableOperatorAutoCompleteOption` class for suggesting operators (=, ++, --, +=)
- Add `VariableOperatorDefinitions` map with operator metadata (symbol, name, description, needsValue)

* Add variable shorthand support to {{if}} macro condition autocomplete

- Add variable shorthand (.var, $var) support to {{if}} condition evaluation in core-macros.js
- Detect and resolve variable shorthands using getvar/getglobalvar macros before condition check
- Update {{if}} description and examples to document variable shorthand syntax
- Add variable shorthand autocomplete options when typing {{if}} condition
- Show variable prefix options (. and $) when no condition is typed yet
- Reuse #buildVariableShorthandOptions

* refactor: Add Object.freeze to lexer constants and improve JSDoc documentation

- Freeze `modes` and `Tokens` objects to prevent accidental mutations
- Convert inline comments to proper JSDoc format for better documentation
- Add JSDoc block for `Def` lexer definition object
- Improve comment clarity and formatting consistency throughout MacroLexer.js
- Remove redundant section separator comments in variable shorthand modes

* Add inversion prefix (!) autocomplete support to {{if}} macro condition

- Add SimpleAutoCompleteOption class for basic autocomplete items with name, symbol, and description
- Add ! inversion prefix as autocomplete option in {{if}} condition with 🔁 icon
- Show ! as selectable option when nothing typed, non-selectable when already present
- Fix condition parsing to handle ! prefix with whitespace (e.g., "! $myvar")
- Update identifier extraction to strip ! and whitespace before detecting variable

* fix lint

* Fix variable shorthand regex in {{if}} macro to properly capture prefix and variable name

* Expand comprehensive e2e tests for variable shorthand syntax in lexer and macro engine

- Add MacroLexer tests for variable shorthand edge cases (whitespace, numbers, underscores, operators)
- Add MacroEngine tests for variable shorthand operations (hyphens, underscores, non-existent vars, chaining)
- Add MacroEngine tests for variable shorthand in {{if}} conditions (truthy/falsy, inversion, else branches)
- Test variable names with hyphens, underscores, and numbers in both get/set and conditional contexts

* Fix macro flags not being allowed inside variable shorthand macros

- Move MANY(flags) block from macroBody to macro rule to parse flags before branching
- Fix MacroCstWalker to extract flags from children.flags instead of bodyChildren.flags
- Ensures flags are available for both variable expressions and regular macros
- Fixes flag extraction in visitMacro and visitBlockMacroClose methods

* Add SillyTavern global to tests eslintrc

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-12-31 19:38:50 +02:00
Cohee 5dee64e0bc Update description of banned macro 2025-12-29 21:14:20 +02:00
Cohee 316dfaadc7 Update macro category for charAuthorsNote 2025-12-29 21:14:07 +02:00
underscore_x 865e0a60a2 updated claude prompt caching url (#4931) 2025-12-29 13:26:13 +02:00
guoql666 efd87b4759 add new Tts adapter provider (#4915)
* add new provider: gpt-sovits-adapter

* export function getCharacters

* fixed some bugs
2025-12-28 23:55:28 +02:00
Subwolf a8eb154517 Zai moonshot reverse proxy (#4923)
* adding reverse proxy support

* update

* added handling for the image caption extension
2025-12-28 23:52:04 +02:00
WolfsblvtandCohee e9bedadc0b Macros 2.0 (v0.4) - Add scoped macros (last arg can be scoped), {{if}} macro and macro flags (baseline implementation) (#4913)
* Macros: make category optional, default to UNCATEGORIZED

* Tests: Update macro tests to match new error handling behavior

- Change MacroRegistry tests from expecting thrown errors to capturing console.error logs
- Update MacroLexer tests to expect plaintext fallback instead of lexer errors for invalid tokens
- Fix MacroEngine test to use `char` macro instead of `newline` for arity validation
- Update MacroParser test with corrected expected error message for invalid identifiers
- Remove "[Error]" prefixes from test descriptions where lexer no longer errors

* Macros: Implement macro execution flags system

- Add MacroFlags module with flag parsing and validation (!, ?, ~, /, >, ., $, #)
- Update lexer to tokenize flags as separate tokens before macro identifier
- Modify parser to capture flags in CST under 'flags' label
- Update CST walker to parse flag tokens into MacroFlags object
- Pass parsed flags to macro handlers via MacroCall and MacroContext
- Update autocomplete parser to handle flags before identifier
- Add comprehensive tests for flag parsing,

* Macros: Fix autocomplete positioning for macros with flags and whitespace

- Add identifierStart to parseMacroContext to track where identifier begins in macro text
- Update autocomplete to use identifierStart for correct range calculation
- Simplify indexMacros regex to use global flag instead of manual loop
- Use parseMacroContext in indexMacros to extract identifier (handles flags/whitespace)
- Fix autocomplete range starting at wrong position when flags or whitespace present

* Macros: Add autocomplete support for macro execution flags

- Add MacroFlagAutoCompleteOption class for rendering flag options in autocomplete
- Extend parseMacroContext to track currentFlag (flag cursor is on) and isInFlagsArea
- Track flagEndPositions to determine which flag cursor is currently typing
- Update #buildEnhancedMacroOptions to show flag options when cursor is in flags area
- Show current flag first if cursor just typed it, then show remaining available flags
- Add renderItem and renderDetails methods to MacroFlag

* Macros: Implement scoped macro syntax with opening and closing tags

- Add scoped macro processing to MacroCstWalker to find and merge opening/closing pairs
- Parse closing block flag (/) to identify closing macros and match with opening tags
- Extract content between opening and closing tags as the last unnamed argument
- Add `isScoped` property to MacroCall and MacroContext to track scoped invocations
- Implement `#processScopedMacros` to find outermost matching pairs and handle nesting

* Macros: Add autocomplete warnings, scoped content info, and closing tag suggestions

- Add arity warning banners in autocomplete details for invalid argument counts
- Show warning when using space-separated args on multi-arg or no-arg macros
- Add scoped content info banner when cursor is inside unclosed scoped macro
- Implement MacroClosingTagAutoCompleteOption to suggest closing tags for scoped macros
- Add sortPriority property to AutoCompleteOption for controlling sort order

* SlashCommands: Disable unimplemented flags and closing flag when no unclosed scopes in autocomplete

- Set closing block flag as non-selectable when no unclosed scopes exist
- Set unimplemented flags as non-selectable with empty valueProvider
- Lower sort priority (12) for non-selectable flags vs selectable flags (10)

* Autocomplete: Show scoped content info and auto-close no-arg macros

- Show scoped content info when cursor is at closing }} of unclosed scoped macro
- Auto-complete no-arg macros with closing }} using valueProvider
- Trigger autocomplete on select (isSelect) to refresh after choosing an option
- Simplify MacroFlagAutoCompleteOption to use base makeItem for consistent styling
- Change closing tag icon from '{/}' to '{/' for better visual consistency

* Macros: Add scoped trim macro to trim content inside opening/closing tags

- Add scoped usage for {{trim}}content{{/trim}} to trim whitespace from content
- Keep non-scoped {{trim}} behavior (post-processing marker) for backward compatibility
- Add optional unnamed 'content' argument for scoped usage
- Update description to explain both scoped and non-scoped behavior
- Handler checks isScoped flag to determine which behavior to use

* Autocomplete: Fix closing tag parsing to prevent `/` being treated as flag

- Add special case in parseMacroContext to detect closing tags (`/` + identifier char)
- Stop flag parsing when `/` is followed by identifier character (closing tag syntax)
- Simplify MacroClosingTagAutoCompleteOption valueProvider to return full closing tag
- Remove input-based logic since autocomplete replaces entire identifier

* Macros: Add {{if}} conditional macro with auto-resolution of macro names

- Add {{if condition}}content{{/if}} macro to conditionally show content
- Auto-resolve condition if it matches a registered macro name (0 required args)
- Support both scoped content ({{if x}}...{{/if}}) and explicit args ({{if::x::content}})
- Treat empty string, "false", "off", "0" as falsy conditions
- Inherit environment context when resolving macro names
- Update autocomplete warning to allow space-separated syntax

* Macros: Add centralized identifier validation with pattern enforcement

- Export MACRO_IDENTIFIER_PATTERN from MacroLexer for reuse across modules
- Add isIdentifierValid() helper function to validate macro names and aliases
- Enforce identifier pattern: must start with letter, followed by word chars or hyphens
- Update macro registration to validate both primary names and alias identifiers
- Improve error messages to explain identifier requirements
- Add comprehensive e2e tests for valid/invalid identifier patterns

* Macros: Add tests for scoped {{trim}} macro functionality

* SlashCommands: Fix macro indexing to properly handle nested macros with brace depth tracking

- Replace regex-based macro detection with manual brace depth tracking
- Track opening/closing brace pairs to correctly identify macro boundaries
- Ensure nested macros like {{reverse::Hey {{user}}}} are properly indexed
- Index both outer and inner macros by scanning content recursively
- Handle unclosed macros by defaulting to end of text

* Macros: Add {{else}} branch support to {{if}} conditional macro

- Add {{else}} macro as marker to split then/else branches in {{if}} blocks
- Use control character sequence (\u0000\u001FELSE\u001F\u0000) as internal marker
- Split scoped content on else marker and trim both branches independently
- Return then-branch if condition is truthy, else-branch if falsy
- Auto-suggest {{else}} in autocomplete when inside scoped {{if}} block
- Make {{else}} non-selectable in autocomplete when outside {{if}} scope

* Macros: Add negation support to {{if}} conditional macro with ! prefix

- Add ! prefix support to invert condition evaluation in {{if}} macro
- Parse original macro text to detect ! prefix before macro resolution
- Strip ! from condition after detecting inversion to avoid double-negation
- Invert isFalsy result when ! prefix is detected in original condition
- Prevent ! in resolved values from triggering inversion (only original syntax)

* Autocomplete: Add {{if}} condition autocomplete with zero-arg macro suggestions

- Add EnhancedMacroAutoCompleteOptions typedef for noBraces/paddingAfter/closeWithBraces options
- Support options object in EnhancedMacroAutoCompleteOption constructor alongside context
- Add noBraces mode to display macro names without {{ }} braces (for use as values)
- Add paddingAfter option to match opening whitespace style before closing }}

* Autocomplete: Match opening whitespace padding when auto-closing macros

* Fix `{{if}}` example usages

* Macros: Hide `comment` alias from autocomplete suggestions for `//` macro

* Macros: Simplify {{trim}} handler with destructured parameters and clearer content check

* Macros: Use MacroEngine.evaluate for zero-arg macro resolution in {{if}} condition handler

* Macros: Add auto-trim for scoped content with # flag to preserve whitespace

- Auto-trim scoped content by default in MacroCstWalker before passing to handlers
- Add preserveWhitespace flag (# symbol) to prevent auto-trimming when needed
- Rename legacyHash flag to preserveWhitespace across engine and definitions
- Update {{trim}} handler to rely on engine auto-trim for scoped content
- Update {{if}} handler to respect # flag when trimming branches around {{else}} marker

* Macros: Clarify macro name validation error message to use "alphanumeric characters" instead of "word chars"

* Add 'setspriteoverride' optional 'name' argument

* Refactor ElevenLabs TTS API key handling (#4906)

* Refactor ElevenLabs TTS API key handling #4483

* Remove unused connection button and related event handler from ElevenLabs TTS provider

* Add ElevenLabs STT endpoint

* Add caching system prompt feature for OpenRouter Gemini (#4903)

* feat: add caching system prompt for OpenRouter Gemini

* fix: resolve reviews

* Update GitHub links to llama.cpp

* Add model selection support for llama.cpp router mode (#4910)

* Add model selection support for llama.cpp router mode

- Add llamacpp_model setting to textgen-settings.js
- Implement loadLlamaCppModels() function to fetch and populate models
- Add onLlamaCppModelSelect() handler for model selection
- Update status check to load llama.cpp models when connecting
- Update getTextGenModel() to return selected llama.cpp model
- Add model dropdown to HTML UI in llama.cpp section
- Initialize event handlers and Select2 for better UX
- Add llamacpp_model to preset manager for save/load support
- Add llamacpp_model to slash commands support

This implements model selection for llama.cpp router mode, allowing
users to select from multiple models without restarting the server.
Follows the same pattern as Ollama, Tabby, and vLLM implementations.

* Correct spelling

* Fix clear selection position

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>

* Add glm-4.7 model option and context mapping for Z.AI

* Add select2 style for NanoGPT list
Closes #4911

* Disable macro engine init traces

* Update type annotations for instruct presets and context presets

* Fix test for new error text

* Add MacroStoryString tests

* Add trimContent utility for consistent indentation dedenting in scoped macros

- Add trimScopedContent method to MacroEngine that trims and dedents scoped content based on first non-empty line indentation
- Pass trimContent utility through evaluation context to all macro handlers
- Update {{if}} macro to use trimContent instead of direct trim() call
- Update auto-trim logic in MacroCstWalker to use trimContent for consistent dedenting
- Add trimContent to MacroExecutionContext type definitions

* Add ELSE_MARKER export and cleanup leftover markers in macro processing

* Update trimContent parameter to use options object pattern in JSDoc

* Add processor registration system to MacroEngine with priority-based execution

- Add MacroProcessor callback and RegisteredProcessor typedef for pre/post processors
- Add addPreProcessor/removePreProcessor and addPostProcessor/removePostProcessor methods with priority-based sorting
- Refactor core legacy syntax handling into registered processors with reserved priorities (0-50)
- Move legacy time syntax, marker replacements, brace unescaping, trim macro, and ELSE_MARKER cleanup to registered processors

* Split core processor registration into separate pre and post processor methods

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-12-28 21:36:13 +02:00
Cohee 1c0e7ea955 Merge pull request #4925 from SillyTavern/staging
Staging
2025-12-28 18:28:51 +02:00
Ngo Dinh Gia BaoandCohee 829db7f2d0 [Electron Hub] Prompt Caching Support for Claude models (#4918)
* Prompt Caching support Claude models

* Prompt Caching support Claude models

* Diff clean-up

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-12-28 17:05:54 +02:00
Cohee bb53da4c09 add missing zai vision models 2025-12-27 23:07:57 +02:00
Cohee 1f0c0ccff4 Add message-role command 2025-12-27 21:21:39 +02:00
SammyandCohee 9a1ded5202 Allow editing of global Worldinfo settings (#4921)
* create and export updateWorldInfoSettings

* Add WorldInfoSettings type and refactor updateWorldInfoSettings function

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-12-27 20:08:29 +02:00
equal-l2andCohee d46fd60a57 Fix OpenRouter compatibility for OpenAI models (#4917)
* Fix OpenRouter compatibility for OpenAI models

* Don't disable o1 streaming on OpenRouter

* Fix OpenRouter compatibility for o1 model handling

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-12-27 18:44:37 +02:00
Cohee 8b94180bba 1.15.0 2025-12-27 17:25:43 +02:00
Ben 3668e95d95 filter out models that don't have a valid id (#4920) 2025-12-27 02:33:25 +02:00
Cohee 11337d40ef Fix chutes status check 2025-12-27 01:39:48 +02:00
Cohee a14b0855ee Allow getting current name in message-name 2025-12-27 01:28:56 +02:00
AphidGitandCohee af495cefbd chchar slash cmd (#4916)
* Add an additional slash command to change a message's character and avatar.

* Refactor message character change command to update message sender's name

* Fix default value

* Allow setting unbound message names

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-12-27 01:24:00 +02:00
Cohee e7c9496a61 Fix: add missing quotes to index.html 2025-12-27 00:13:39 +02:00
9nbf7c4q6b-lgtmandCohee 3098c4c5bf Comfyui serverless runpod image generation (#4891)
* Add comfyrunpod generation endpoints.

Get a bunch of settings added.

Probably get runpod api secret stored properly.

sending to runpod.

Correct workflow wrapping for runpod.

* Reuse comfyui workflow setting block for runpod.

* Update API key url to point to runpod settings

* Remove debug print.

* Combine normal and runpod comfyui generation functions

* Remove unused server endpoints for runpod.

* Remove debug prints from server.

* Remove redundant switch case.

* Check for url to see if image generation is possible for comfy and comfy runpod.

* lint

* Correct/update doc comments.

* Make runpod serverless a sub-type under comfyui source in the UI.

* Set comfy_type in stable-diffusion defaultSettings

* Allow loading comfy workflows even if url isnt set yet.

* Change default runpod url to template example

* Rename runpod api key to comfy_runpod

* Handle default switches separately from standard now that default setting is ensured.

* Update runpod api key name on server.

* Move example runpod url to placeholder.

* lint

* Remove incorrect comment.

* Hide toasts remote models toasts

* React to key updates

* Add type annotation for data and improve workflow handling in generate endpoint

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-12-24 23:37:57 +02:00
DeclineThyselfanduser bff6ab3cb7 Updated Avatar Style and Hide Chat Avatars title text. (#4908)
* Added an option to hide message avatars in `User Settings > UI Theme`.

* Deprecated the `Hide Chat Avatars` toggle.
Moved the option to hide message avatars to `User Settings > UI Theme > Avatars`.

* Revert "Deprecated the `Hide Chat Avatars` toggle."

This reverts commit 6f616767cc.

* Moved `Hide Chat Avatars` next to `Avatar Style`, added title text.

* Reverted changes.

---------

Co-authored-by: user <user@exmaple.com>
2025-12-24 16:38:25 +02:00
my-alt 29456b9bd2 Enhance text generation API to support model parameter for llama.cpp router mode. Update getStatusTextgen to include model in request body and improve context size handling. (#4914) 2025-12-24 16:30:45 +02:00
Cohee 432639e341 Disable macro engine init traces 2025-12-23 02:45:28 +02:00
Cohee 373da39bf4 Add select2 style for NanoGPT list
Closes #4911
2025-12-23 00:09:39 +02:00
Cohee 0539583197 Add glm-4.7 model option and context mapping for Z.AI 2025-12-22 23:14:09 +02:00
my-altandCohee 7f98e3e213 Add model selection support for llama.cpp router mode (#4910)
* Add model selection support for llama.cpp router mode

- Add llamacpp_model setting to textgen-settings.js
- Implement loadLlamaCppModels() function to fetch and populate models
- Add onLlamaCppModelSelect() handler for model selection
- Update status check to load llama.cpp models when connecting
- Update getTextGenModel() to return selected llama.cpp model
- Add model dropdown to HTML UI in llama.cpp section
- Initialize event handlers and Select2 for better UX
- Add llamacpp_model to preset manager for save/load support
- Add llamacpp_model to slash commands support

This implements model selection for llama.cpp router mode, allowing
users to select from multiple models without restarting the server.
Follows the same pattern as Ollama, Tabby, and vLLM implementations.

* Correct spelling

* Fix clear selection position

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-12-21 22:51:44 +02:00
Cohee 39cc1b9039 Update GitHub links to llama.cpp 2025-12-21 21:13:13 +02:00
Chanho Chung ca43796795 Add caching system prompt feature for OpenRouter Gemini (#4903)
* feat: add caching system prompt for OpenRouter Gemini

* fix: resolve reviews
2025-12-20 19:01:42 +02:00
Cohee c75df956c5 Refactor ElevenLabs TTS API key handling (#4906)
* Refactor ElevenLabs TTS API key handling #4483

* Remove unused connection button and related event handler from ElevenLabs TTS provider

* Add ElevenLabs STT endpoint
2025-12-20 18:37:59 +02:00
Cohee 0dd32775d6 Add 'setspriteoverride' optional 'name' argument 2025-12-19 20:38:29 +02:00
Cohee 83ea6e5cbf Better thonk effort for Gem 3 2025-12-18 21:40:52 +02:00
Cohee 6fccccca6d OpenRouter: add as image generation source 2025-12-18 21:17:01 +02:00
Cohee b370808753 Migrate substituteParams calls to new engine (#4901) 2025-12-18 00:01:08 +02:00
Cohee c92939e56c Z.AI: Video inlining and 'coding' captions
Closes #4899
2025-12-17 23:31:14 +02:00
Cohee 995fa10fa4 gpt-image-1.5 2025-12-17 23:06:34 +02:00
mightytribbleandCohee 2cd2bd4a4d Implement Gemini thought signatures (#4886)
* Implement Gemini thought signatures

* Implement streaming support for Gemini thought signatures

* Implement OR support for Gemini thought signatures

* Remove unnecessary extraction of thought sigs from response parts

* Update thought sig comments to remove explicit Gemini mention

* Fix thought_signature naming convention in message.extra

* Add thought_signatures to ReasoningMessageExtra typedef

* Prevent thought sigs being sent to incompatible endpoints

* Move signatures to populateChatHistory, update for consistent casing

* Code clean-up

* Only send thought signatures if target model and API match original

* Implement content-hash thought signature mapping

* Change the data model + split for text/functions

* Don't include signature to invocations if the model doesn't match

* Fix function description

* Remove misleading comment

* Handle OpenRouter signatures

* Improve message extra types

* Prevent modifying original invocations when removing signatures

* Fix return of openrouter non-streaming signatures

* Remove redundant array check

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-12-17 22:23:47 +02:00
Cohee 5accfbc5d8 Gemini: add media resolution select (#4775) 2025-12-17 20:46:02 +02:00
Cohee 081c3e7b1c jerma 3 flash 2025-12-17 20:35:00 +02:00
Cohee 8fa01d3df9 Update Mistral V7-Tekken
Fixes #4826
2025-12-17 00:41:04 +02:00
Cohee 48089598b6 OpenAI: gpt-image-1-mini 2025-12-17 00:17:13 +02:00
Cohee bb3ea08b5a Z.AI: Add image generation and web search (#4895)
* Z.AI: Add image generation

* Z.AI: Add web search endpoint

* Add image URL validation

* Combine validation conditions
2025-12-16 00:39:17 +02:00
Wolfsblvt 000fbccda9 Optimize {{pick}} macro by caching content hash in MacroEnv 2025-12-15 22:08:59 +01:00
6f8b6b098e Macros 2.0 (v0.3) - Replacing the existing Macro System with a new Macro Engine (#4820)
* Chevrotain lib and env setup

* First draft of the macro lexer

* fix ESLint types loading for chevrotain

* Cleaner lexer modes

* Readme link to Chevrotain & license

* Add jsconfig to tests folder

- Add jsconfig.json to tests folder, to prevent IDE errors on dynamic imports inside the page.evaluate execution.

* Slight improvements on lexer & first tests

* Add more lexer tests

* More edge cases tests

* Reorder tests

* Add macro execution modifiers + more tests

- Added macro flags (execution modifiers) to lexer
- Fixed some lexing issues
- Expanded lexer tests
- Treat lexer errors as failed test

* enable eslint for tests and run it

* Fix lexing unknown flags - treat as error

* Rewrote lexer modes/tokes to capture errors better

* Add lexing for output modifiers

* Clearer names for lexer tokens

* Increase tests default timeout

* Restructure lexer error testcases

* Allow legacy underscores in macro identifiers

* Test case for legacy single-colon syntax

* Improve lexer, removing warnings

* Basic setup for MacroParser + initial tests

* Make parser errors testable

* Add macros stuff to SillyTavern.getContext

* macros test case naming + lint

* Parser consumes basic macros

- Fix lexer mode names
- Add basic macro parsing (identifier, and arguments)
- Tests: basic macro parsing tests
- Tests: simplifyCstNode supports ignoring nodes, or flattening nodes to just plaintext

* Improve macro argument parsing to allow colons in values

Enhances separator handling by fixing separator type detection and enabling colon characters within argument values
Updates validation to require at least one argument component and adds error cases for empty arguments
Includes expanded test coverage for mixed separator scenarios and edge cases

* More nested macro tests

Add error case tests to enforce macro start position requirements
Include nested macro parsing scenarios and invalid syntax checks
Ensures parser correctly handles edge cases with embedded macros

* Unvendor chevrotain

* Add document rule

* Implement visitor, switch built-ins to new type

* Puppeteer -> playwright

* Revert "Implement visitor, switch built-ins to new type"

This reverts commit 706a94b4de.

* Converted puppeteeer tests

* File rename

* chore: reduce Playwright worker count to 4 for performance/stability

* test: add comprehensive legacy macro parser test suite

- Added 13 test cases covering legacy macro formats (roll, reverse, comment, datetime, time_UTC, banned, setvar)
- Documented parser limitations with TODO comments for whitespace separators, special characters, and empty arguments
- Tests validate parsing of various separator styles (space, colon, +/-) and argument formats (quoted, numeric, empty)

* fix: handle legacy macro syntax with colon or whitespace separator

- Modified arguments rule to support both double-colon (::) and single-colon (:) separators
- Made single-colon separator optional to allow whitespace-separated legacy macros
- Removed TODO comments as parser now correctly handles legacy macro formats

* feat: support space-separated quoted arguments in macro parser

- Added parsing support for equals signs and quotes as valid argument tokens
- Removed TODO comments for legacy macro parsing with quoted arguments

* fix: improves macro argument parsing with colon handling

Enhances parser to correctly handle double colons within legacy single-colon arguments
Introduces separate parsing rules for arguments with different colon constraints
Adds test coverage for arguments containing double colons in legacy format

* fix: allow empty macro arguments after double-colon separator

- Changed argument rule from AT_LEAST_ONE to MANY to permit zero-length arguments
- Updated tests to verify empty argument parsing (e.g., `{{something::}}`)
- Enhanced simplifyCstNode helper with default flatten/ignore keys and improved null handling

* refactor: improve test documentation with inline macro display

- Added inline comments showing the actual macro syntax being tested for better readability
- Removed duplicate comment in error test case
- Cleaned up extra whitespace in legacy macro tests

* feat: add legacy macro preprocessing for time offset format

- Implemented preProcessFixLegacyMacros method to convert {{time_UTC±N}} to {{time::UTC±N}} format
- Updated tests to use new preprocessing step for legacy time macro parsing
- Added runPreProcessFix option to test helper functions for controlled legacy macro handling

* feat: add support for comment macros with double-slash syntax

- Added `DoubleSlash` token to lexer to recognize `//` as a valid macro identifier
- Updated parser to accept either `//` or standard identifiers as macro names
- Enhanced test suite with comprehensive comment macro test cases including multiline support

* feat: implement macro evaluation engine with CST walking and registry integration

(I'm tired, let's just throw this in right now)

- Added CST walker and macro registry to engine initialization
- Enhanced parseDocument to handle empty input, legacy macro preprocessing, and error collection
- Implemented async evaluate method with full macro resolution pipeline
- Added resolveMacro callback to handle unknown macros and registry execution
- Integrated lexing/parsing error handling with console warnings
- Added support for preserving unknown macro

* refactor: improve type safety and code clarity in macro evaluation system

- Simplified typedef imports to use correct Chevrotain types (CstNode, IToken)
- Added TokenRange typedef for consistent offset handling
- Enhanced error messages with context-specific prefixes
- Replaced verbose type casts with inline JSDoc annotations
- Condensed singleton pattern declarations to single lines
- Improved null safety with optional chaining and nullish coalescing
- Extracted resolveMacro logic into private root function

* fix test macro whitespace arguments onls accepting one argument

* Fix OpenRouter embeddings URL
#4736

* Fix: Prevent data loss on bulk regex move to scoped scripts (#4760)

* Fix: Prevent data loss in regex bulk move

* prevents moving to scoped scripts with group selected for bulkedit

* Refactor: make whitelist validation a bit more robust (#4757)

* refactor: extract IP whitelist validation into helper function

- Added isIPInWhitelist helper with error handling for individual whitelist entry checks
- Replaced inline whitelist matching logic with reusable function calls
- Added JSDoc type annotations and error logging for failed IP matching attempts

* refactor: simplify whitelist validation with upfront filtering

- Moved IP validation to startup time instead of per-request checking
- Extracted validateWhitelist function to filter invalid entries once at initialization
- Simplified isIPInWhitelist by removing redundant error handling after validation

* fix: correct IP whitelist matching to use parsed CIDR notation

* Feat: Improve multiline input handling in popups (#4756)

* feat: improve multiline input handling in popups

- Added Ctrl+Enter requirement for submission in multiline input popups to prevent accidental sends
- Exported PopupUtils class for external use

* refactor: remove redundant higher/different rows from input popups

- Removed rows: 2 from callGenericPopup calls where default behavior is sufficient
- Increased rows from 2 to 4 in caption extension for better multiline input experience

* Fix npm audit

* feat: add max-height and scrolling to world entry key input fields (#4769)

- Added 160px max-height to select2 multiple selection, primary key, and secondary key text areas in world entries
- Enabled vertical scrolling with hidden horizontal overflow for better UX with long content

* Bump anti-troll tags limit
Closes #4763

* OpenAI: Add Sora 2 API (#4748)

* OpenAI: Add Sora 2 API

* Add duration control

* Support client generation abort

* Reduce poll log amount

* Simplify selector

* Simplify model-specific control handling

* Gemini: Pass non-success response content to frontend

* Vertex: Add Vertex AI-specific safety setting (#4770)

Closes #4455

* Feature: allows sorting tags by most used (#4768)

* add sorting tags by most used

* Fix whitespaces

* Code review updates

* Remove commented code

* Fix capitalization in comment

* Apply review suggestion

* Simplify template init

* Reformat

* Add documentation for appendViewTagToList and printViewTagList functions

* Reprint renamed tags regardless of sorting mode

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>

* Move img.swipe notice block up

* Preserve media playback state when running appendMediaToMessage (#4771)

* Preserve media playback state when running appendMediaToMessage

* Better selector specificity

* Fix local variable name

* Move typedef to global.d.ts

* Check for readyState on save/restore

* Only check for currentSrc on restoration callback

* gpt-5.1

* A 500 billion dollar startup can’t filter API payload fields

* Refactor macro argument validation to use requiredArgs and list pattern

- Replace minArgs/maxArgs/enforceArity with requiredArgs and list specification
- Add MacroListSpec typedef for flexible list argument constraints (min/max)
- Rename enforceArity to strictArgs with inverted default behavior
- Update validation logic to separately track required vs. list arguments
- Add requiredArgs and list arrays to MacroExecutionContext for easier access
- Improve error messages to clearly distinguish between required and list

* Refactor MacroRegistry.registerMacro to use options object pattern

- Move handler function into options object as required property
- Improve validation with detailed error messages for all option fields
- Add explicit type checking for requiredArgs, list, strictArgs, and description
- Consolidate name normalization and validation logic
- Simplify list option parsing with clearer conditional structure
- Update all builtin macro registrations to use new signature

* Add e2e tests for macro arity validation errors

- Test ping macro rejects calls with unexpected arguments
- Test upper macro rejects calls without required arguments
- Verify macros remain unresolved and log warnings on arity violations

* re-implement core macros as registered macros

- Create shallow frozen copy of env object before passing to macro handlers
- Add comprehensive MacroEnv typedef with nested types for names, character, system, and extra fields
- Update MacroDefinitionOptions typedef to clarify default values and mark handler as required
- Export variable manipulation functions for external use
- Fix whitespace in ifCallback JSDoc comment

* Defer slash command autocomplete initialization to firstLoadInit

- Move slash command autocomplete setup from module-level to initSlashCommandAutoComplete function
- Add null check for sendTextarea.value before accessing first character
- Import and call initSlashCommandAutoComplete in firstLoadInit sequence
- Export registerCoreMacros, registerInstructMacros, and registerVariableMacros using named export syntax
- Call registerCoreMacros from initMacros with

* Add variable manipulation functions to SillyTavern context API

- Import deleteGlobalVariable, deleteLocalVariable, addGlobalVariable, addLocalVariable, incrementGlobalVariable, incrementLocalVariable, decrementGlobalVariable, and decrementLocalVariable from variables.js
- Expose del, add, inc, and dec methods on both context.variables.local and context.variables.global objects
- Provide consistent API for variable deletion, addition, increment, and decrement operations

* Extract test setup utilities and fix trailing comma in core-macros.js

- Add testSetup utility object with goST and awaitST helper functions for Playwright tests
- Replace duplicated beforeEach setup code in MacroLexer, MacroParser, and MacroRegistry tests with testSetup.goST
- Add explanatory comments indicating tests currently run without ST context
- Fix missing trailing comma in input macro handler registration

* Refactor MacroEngine e2e tests to use real core macros instead of prototypes

- Replace prototype macros (ping, echo, upper, wrap, first) with actual core macros (newline, reverse, setvar, getvar, addvar, roll)
- Use testSetup.awaitST helper from utils.js for beforeEach setup
- Increase test timeout from 10s to 20s due to additional setup requirements
- Remove registerPrototypeMacros import and registration logic from evaluateWithEngine
- Add page.waitForTimeout(1000) to ensure macros are fully initialize
- Remove now obsolete MacroBuiltins.js

* Fix audit in tests

* Rename frontend test utils file to frontent-test-utils.js and update imports

- Rename tests/frontend/utils.js to tests/frontend/frontent-test-utils.js
- Update testSetup imports across MacroEngine, MacroLexer, MacroParser, and MacroRegistry e2e tests

* Refactor MacroRegistry for improved readability and consistency

- Reorder MacroDefinition typedef fields to match registration order (handler moved to end)
- Add inline JSDoc comments to MacroDefinitionOptions properties for clarity
- Simplify name validation logic in unregisterMacro, hasMacro, and getMacro methods using early returns
- Extract argument validation logic into dedicated isArgsValid helper function
- Refactor executeMacro to be async and use Promise.resolve for consistent promise handling

* Add returns field to MacroDefinitionOptions for documenting macro return values

- Add returns property to MacroDefinitionOptions typedef with string type and null default
- Include returns field in MacroDefinition typedef
- Store returns value in macro definition object for documentation purposes

* Add error handling to macro execution and refactor core macro handlers

- Add catch handler in MacroRegistry.executeMacro to log errors and return empty string on handler failures
- Update macro descriptions to use "index" instead of "ID" for message position macros
- Simplify reverse macro description and remove redundant null coalescing
- Add strictArgs: false to comment macro to ensure it's always removed
- Enhance time macro description with UTC offset examples
- Remove unnecessary null check

* Refactor instruct-macros.js for consistency and reduce code duplication

- Rename enabled helper to instEnabled and add sysEnabled helper for clarity
- Consolidate defaultSystemPrompt, instructSystem, and instructSystemPrompt into single registerSimple call
- Simplify systemPrompt handler by removing unnecessary null coalescing and intermediate variables
- Convert chatSeparator and chatStart macros to use registerSimple helper
- Fix JSDoc comment formatting for registerSimple helper function

* Add normalize helper to MacroExecutionContext and refactor variable macros for consistency

- Add normalizeMacroResult method to MacroEngine for converting macro results to strings
- Include normalize function in MacroExecutionContext for handler use
- Update normalizeMacroResult to handle arrays explicitly alongside objects
- Add returns field to variable macros that produce side-effects only
- Refactor variable macro handlers to use destructuring and normalize helper
- Remove redundant null checks an

* chore: Remove duplicate getglobalvar macro registration from variable-macros.js

- Remove redundant getglobalvar macro definition (already registered earlier in the file)
- Import MacroEngine in MacroRegistry for normalizeMacroResult access
- Add fallback binding for normalize in MacroExecutionContext when not provided by caller
- Update executeMacro to use executionContext.normalize instead of standalone normalizeMacroResult
- Remove normalizeMacroResult helper function from MacroRegistry (now handled by MacroEngine)

* Add core environment macros for names, character fields, system info, and deterministic pick

- Add lastGenerationType tracking with event listeners for GENERATION_STARTED and CHAT_CHANGED
- Add ensureLastGenerationTypeTracking helper to initialize event listeners once
- Register name macros: user, char, group, groupNotMuted, notChar, charIfNotGroup
- Register character card field macros: charPrompt, charInstruction, description, personality, scenario, persona, mesExamplesRaw, charDepthPrompt, cre

* Refactor core macros into separate modules by category (env, state, chat, time)

- Move name and character card field macros to new env-macros.js module
- Move system/device/runtime state macros to new state-macros.js module
- Move chat inspection macros (lastMessage, lastMessageId, etc.) to new chat-macros.js module
- Move time/date macros (time, date, weekday, isotime, etc.) to new time-macros.js module
- Remove lastGenerationType tracking logic and helper functions from core-macros.js (moved to state

* Reorganize macro system into engine and definitions directories

- Move macro engine components (MacroEngine, MacroRegistry, MacroLexer, MacroParser, MacroCstWalker) to macros/engine/ subdirectory
- Move macro definition modules (core-macros, env-macros, state-macros, chat-macros, time-macros, variable-macros, instruct-macros) to macros/definitions/ subdirectory
- Create macro-system.js as central entry point that exports engine singletons and initRegisterMacros function
- Refactor variable-macros.js to use S

* Export getGeneratingModel function and add MacroEnvBuilder to macro system exports

- Export getGeneratingModel function from script.js for external use
- Import MacroEnvBuilder in macro-system.js
- Add envBuilder singleton to macros export object alongside existing engine components

* Extract MacroEnv typedefs into separate MacroEnv.types.js file

- Create MacroEnv.types.js with MacroEnv, MacroEnvNames, MacroEnvCharacter, and MacroEnvSystem typedefs
- Remove MacroEnv typedef definitions from MacroRegistry.js
- Update MacroRegistry.js, MacroEngine.js, MacroEnvBuilder.js, and env-macros.js to import MacroEnv from MacroEnv.types.js
- Change MacroEngine.evaluate env parameter type from any to optional MacroEnv

* Add comprehensive e2e tests for MacroEnvBuilder

- Create MacroEnvBuilder.e2e.js with 13 test cases validating environment construction
- Test name override precedence (overrides vs global fallback)
- Test character field population based on replaceCharacterCard flag
- Test original value one-shot helper function behavior
- Test group override string propagation to group/group

* Add substituteParamsAsync function with experimental macro engine support

- Create substituteParamsAsync function in script.js as async alternative to substituteParams
- Use object destructuring pattern for function parameters following RO-RO convention
- Add experimental_macro_engine flag to power_user settings for feature gating
- Add MacroEnvFunctions typedef with original and postProcess function types to MacroEnv.types.js
- Add functions property to MacroEnv typedef for one-shot helpers an

* Add dynamic macro support to MacroEngine with environment-based override and postProcess execution

- Add defOverride parameter to MacroRegistry.executeMacro for temporary macro definitions
- Check env.dynamicMacros in MacroEngine#resolveMacro and create temporary macro definition when found
- Set strictArgs to true for dynamic macros to fail if called with arguments
- Execute env.functions.postProcess on macro results in MacroEngine#resolveMacro with error handling
- Update MacroEnv typedef to make

* Refactor macro handlers to assume non-null env and remove optional chaining

- Remove optional chaining (?.) from env property access in env-macros.js and instruct-macros.js
- Change MacroExecutionContext env property from optional to required in MacroRegistry.js
- Update executeMacro context parameter from optional to required
- Simplify original macro handler to call env.functions.original() directly without try-catch
- Update MacroHandler typedef to use arrow function syntax for consistency
- Remove redundant null checks an

* Refactor MacroRegistry.executeMacro to accept MacroCall object and make MacroExecutionContext properties non-optional

- Change executeMacro to accept MacroCall object instead of separate name and context parameters
- Move normalize function from context parameter to options object in executeMacro
- Construct MacroExecutionContext from MacroCall properties within executeMacro
- Set namedArgs to null in executionContext (currently unused)
- Update MacroEngine.resolveMacro to pass MacroCall directly

* Remove normalize parameter from MacroRegistry.executeMacro and bind normalizeMacroResult directly in execution context

- Remove normalize parameter from executeMacro options object in MacroRegistry.js
- Bind MacroEngine.normalizeMacroResult directly in executionContext instead of accepting override
- Remove normalize option from MacroEngine.resolveMacro call to executeMacro
- Add missing name fields (group, groupNotMuted, notChar) to MacroEnvBuilder default env object

* Make MacroEnvRawContext properties optional and change original function from required to optional in MacroEnvFunctions

- Change MacroEnvRawContext properties from required to optional with null defaults
- Change original function from required to optional in MacroEnvFunctions typedef
- Remove original function from default env object in MacroEnvBuilder (only include when provided)

* Refactor MacroEnvBuilder tests to use optional properties and add macro arity validation tests

- Remove explicit undefined/false assignments from MacroEnvRawContext test objects (now optional with defaults)
- Rename additionalMacro to dynamicMacros in MacroEnvBuilder tests and update property access from env.extra to env.dynamicMacros
- Move original function from env.extra to env.functions in test assertions
- Remove test for additionalMacro overriding original helper (no longer applicable with

* Improve macro error handling with dedicated diagnostics and runtime error propagation

- Import and use logMacroInternalError and logMacroRuntimeWarning from MacroDiagnostics in MacroEngine
- Wrap MacroRegistry.executeMacro call in try-catch to distinguish runtime vs internal errors
- Nest postProcess execution in inner try-catch with dedicated error logging
- Return raw macro syntax on execution failure instead of empty string
- Replace console.warn with logMacroRuntimeWarning for argument count

* Add macro argument type validation with positional argument definitions and runtime type checking

- Add MacroArgType and MacroPositionalArgDef typedefs for argument metadata
- Change requiredArgs option to accept number or MacroPositionalArgDef[] array
- Add requiredArgDefs property to MacroDefinition to store normalized argument definitions
- Validate requiredArgs array elements during macro registration (name, description, type fields)
- Generate default argument definitions when requiredArgs is a

* Add e2e tests for macro type validation and dynamic macro strict arity enforcement

- Add test verifying strict typed macros fail resolution when argument type is invalid
- Add test verifying non-strict typed macros execute with invalid types but log warnings
- Add test verifying dynamic macros reject arguments due to strictArgs enforcement
- Capture and assert runtime warning messages for type validation and arity violations
- Register test macros with integer type requirements and varying strict

* Add mesExamples macro with instruct mode formatting support

- Register mesExamples macro in env-macros.js to format dialogue examples
- Import parseMesExamples, main_api, power_user, and formatInstructModeExamples
- Check instruct mode enabled state and main_api to determine formatting path
- Parse raw examples using parseMesExamples with instruct mode flag
- Return empty string when raw examples are missing or parsed result is empty
- Format examples using formatInstructModeExamples when instruct mode is active

* Add URL navigation wait in test setup and increase Playwright worker count to 4

- Add waitForURL check after user selection in awaitST to ensure navigation completes before preloader check
- Increase Playwright workers from 1 to 4 for parallel test execution

* Add e2e tests for multi-line macro arguments and comment macro functionality

- Add test verifying reverse macro handles multi-line arguments with newline characters
- Add test verifying comment macro removes single-line comments with simple body
- Add test verifying comment macro accepts non-word characters immediately after //
- Add test verifying comment macro ignores additional // sequences inside comment body
- Add test verifying comment macro supports multi-line comment bodies

* Standardize JSDoc type annotations to use explicit null defaults and union types instead of nullable shorthand

* Remove individual test timeout configurations from frontend macro test files

* Add positional argument definitions with sample values and descriptions to core, env, and time macros

- Add sampleValue field to MacroPositionalArgDef typedef (optional string)
- Replace numeric requiredArgs with positional argument definition arrays in roll, banned, outlet, datetimeformat, and timeDiff macros
- Include name, sampleValue, description, and type fields for each positional argument
- Update timeDiff description to clarify absolute difference calculation
- Remove unnecessary blank lines in

* Remove async/await from macro engine evaluation and convert all macro handlers to synchronous execution

Makes me sad, but such is life

* Refactor substituteParams to use options object signature with backward compatibility for legacy positional arguments

- Rename original substituteParams to substituteParamsLegacy with unchanged positional argument signature
- Rename substituteParamsNew to substituteParams as the new primary function
- Add automatic detection and routing of legacy positional argument calls to substituteParamsLegacy
- Update substituteParamsExtended to use new options object signature and mark as deprecated

* forgor

* fix missing import, and package-lock, finally. Maybe.

* Add experimental macro engine toggle to UI settings

- Add experimental_macro_engine setting to default settings.json
- Move experimental_macro_engine property to correct position in power_user object (with other experimental settings)
- Add checkbox UI control in settings panel with flask icon and tooltip explaining nested macro resolution and logical replacement order
- Wire up checkbox event handler to save experimental_macro_engine setting
- Load experimental_macro_engine state on settings initialization

* Refactor macro pre/post-processing from parser to engine and improve error handling

- Move legacy macro pre-processing (time_UTC format) from MacroParser to MacroEngine #runPreProcessors
- Move trim macro post-processing to MacroEngine #runPostProcessors to handle cross-boundary behavior
- Remove MacroLexer import from MacroEngine (now handled by MacroParser.parseDocument)
- Update MacroParser.parseDocument to return separate lexingErrors and parserErrors arrays

* Add {{trim}} macro placeholder that defers to post-processing for cross-boundary whitespace handling

* Add eslint-plugin-playwright

* Add logMacroSyntaxWarning function for structured lexer/parser error reporting with compact human-readable payload

* Small code review fixes

- import event types from events.js
- Add chained fallback to {{input}}, just to be safe
- switched variables.js to export-per-method
- minor text adjustments in registered macro docs

* fix lexer not capturing linebreaks correctly & simplify plaintext token

- Replace alternation-based pattern with negated character class approach
- Use `(?:[^{]|\{(?!\{))+` to match non-brace chars or single braces not followed by another brace
- Add unicode flag for consistency
- Update comment to clarify intent: consume anything that is not the start of a macro '{{'

* Skip macro processing on char/group fields for env build (performance)

- Add returnRaw parameter to getCharacterCardFields to optionally return raw values without baseChatReplace
- Add returnRaw parameter to getGroupCharacterCards for consistent raw value handling
- Replace direct baseChatReplace calls with conditional transform function based on returnRaw flag
- Apply collapseNewlines when returnRaw is true and collapse_newlines setting is enabled
- Update MacroEnvBuilder to use the returnRaw as true

* Fix lexer failing to handle literal '{' before macro openers

- Add PlaintextOpenBrace token to lexer with pattern `/\{(?=\{\{)/` to match single '{' immediately before '{{'
- Update lexer mode definition to consume PlaintextOpenBrace before attempting macro start
- Update parser document rule to handle PlaintextOpenBrace as alternative to Plaintext
- Update MacroCstWalker to collect both Plaintext and Plaintext.OpenBrace tokens when building document items

* Add legacy non-curly marker pre-processing (<USER>, <BOT>, <CHAR>, <GROUP>, <CHARIFNOTGROUP>)

- Add pre-processing step in MacroEngine to rewrite legacy angle-bracket markers into their curly-brace macro equivalents
- Map <USER> → {{user}}, <BOT> → {{char}}, <CHAR> → {{char}}, <GROUP> → {{group}}, <CHARIFNOTGROUP> → {{charIfNotGroup}}
- Add e2e tests verifying legacy marker resolution through the engine pipeline
- Tests cover <USER>, <BOT>/<CHAR>, and <GROUP>/<CHARIFNOTGROUP> markers

* Add env.content to MacroEnv and use it for deterministic {{pick}} hashing

- Add content property to MacroEnv type definition and MacroEnvBuilder to expose the full original input string
- Update {{pick}} macro handler to use env.content hash instead of rawListString hash for seed generation
- Ensures deterministic behavior when the same prompt position contains different list items across evaluations
- Prevents {{pick}} from returning different values when nested macros resolve to different intermediate

* add e2e tests for env.content exposure and deterministic {{pick}} behavior

- Rename getChatIdHashCore → getChatIdHash in core-macros.js for consistency
- Add e2e test verifying env.content is exposed to macro handlers
- Add e2e test confirming {{pick}} returns stable results for same chat and content
- Tests verify deterministic behavior by comparing multiple evaluations with fixed chat_id_hash

* Rename chat macro helper functions to remove 'Core' suffix for consistency

* Add MacrosParser deprecation warnings and bridge to new macro engine when experimental flag enabled

- Import macroSystem and power_user for experimental macro engine integration
- Add @deprecated JSDoc tag to MacrosParser class
- Add #logDeprecated helper to warn about deprecated MacrosParser methods
- Add #registerMacroInNewEngine to bridge legacy macro registrations into new engine
- Add #unregisterMacroInNewEngine to bridge legacy macro unregistrations
- Log deprecation warnings in get, has, register

* Fix lint in tests

* Add comprehensive bracket handling tests and improve macro lexer/parser resilience to invalid syntax

- Add logMacroGeneralError function for non-macro-specific error logging
- Add CST validation check in MacroEngine to return original input if parser produces invalid CST
- Wrap MacroCstWalker.evaluateDocument in try-catch to gracefully handle evaluation failures
- Update MacroLexer Unknown token pattern to capture single closing braces not followed by another closing brace
- Add fallback mode exit

* Add error recovery for incomplete macros by flattening them to plaintext while preserving nested complete macros

- Enable Chevrotain error recovery in MacroParser constructor
- Add #isRecoveryToken helper to detect tokens inserted during error recovery
- Add #flattenIncompleteMacro to recursively convert incomplete macro nodes into plaintext items
- Update #collectDocumentItems to detect recovery-inserted Macro.End tokens and flatten incomplete macros
- Simplify plaintext token collection to use

* Add e2e test verifying nested macros resolve even when outer macro has invalid argument count

* Remove unused macro CST node caching mechanism from MacroCstWalker

* Add JSDoc type re-exports and register shorthand to macro-system.js for improved DX

- Re-export commonly used JSDoc types from MacroRegistry and MacroEnv modules for easier consumption by external code
- Add macros.register shorthand function bound to MacroRegistry.registerMacro for convenient macro registration
- Includes MacroDefinitionOptions, MacroHandler, MacroEnv, and related type definitions

* Migrate legacy macro registrations to new macro system API across multiple modules

- Replace MacrosParser.registerMacro calls with macros.register using object-based configuration
- Update imports from './macros.js' to './macros/macro-system.js'
- Extract macro registration into dedicated registerAuthorsNoteMacros function in authors-note.js
- Add descriptions to all macro registrations for better documentation
- Update MacrosParser iterator to yield from new registry when experimental engine is enabled

* Add MacroCategory to all macro registrations across codebase for improved organization and discoverability

- Import MacroCategory from macro-system.js in authors-note.js, memory/index.js, stable-diffusion/index.js, and macros.js
- Add category property to all macro registrations using appropriate MacroCategory values
- Assign 'legacy' category to MacrosParser auto-registered macros
- Categorize macros across chat, character, prompts, utility, random, state, time, and names categories

* fix lint

* Add MacroBrowser UI component and integrate macro help system into chat interface

- Add implementation of MacroBrowser
- Add macros.css stylesheet link to index.html
- Update core-macros.js ban macro to return empty string instead of 'Empty string' description
- Add sampleValue property to positional argument definitions in MacroRegistry
- Generate default sampleValue for numeric requiredArgs using 'arg{n}' pattern
- Set default description to '<no description>' and returns to '<empty string>' when empty

* Reorder JSDoc typedef declarations in MacroRegistry.js to have the most relevant first

* fix missing category in legacy initMacros

* Add displayOverride and exampleUsage properties to macro registration system

- Add displayOverride property to MacroDefinitionOptions for custom signature display
- Add exampleUsage property to MacroDefinitionOptions for documentation examples
- Update MacroRegistry.registerMacro to validate and process displayOverride and exampleUsage
- Add logMacroRegisterWarning function to MacroDiagnostics for registration-time warnings
- Auto-wrap displayOverride and exampleUsage in curly braces if missing

* Add error handling to MacroRegistry.registerMacro and logMacroRegisterError diagnostic function

- Add logMacroRegisterError function to MacroDiagnostics for registration failures
- Wrap MacroRegistry.registerMacro body in try-catch to handle registration errors gracefully
- Change registerMacro return type from MacroDefinition to MacroDefinition|null
- Log registration errors and return null instead of throwing, preventing macro registration failures from breaking the application

* Optimize character card field access with lazy evaluation to improve macro execution performance

* Add brace unescaping to MacroEngine post-processing to support literal curly braces in macro output

- Add regex replacement to unescape \{ and \} to { and } after macro execution
- Allows users to output literal braces by escaping them with backslashes
- Escaped sequences like \{\{ don't match MacroStart pattern and pass through as plain text

* Add alias system to macro registry with UI support for displaying and navigating macro aliases

- Add `aliases` property to MacroDefinitionOptions for defining alternative macro names
- Add `aliasOf` and `aliasVisible` properties to MacroDefinition to track alias relationships
- Update MacroRegistry.registerMacro to create alias entries pointing to primary definitions
- Add `getPrimaryMacro` method to retrieve primary definition from alias names
- Add filtering options to `getAllMacros` to exclude aliases

* Strip curly braces from MacroBrowser search query to match macro name format in search definitions

* Add enhanced macro autocomplete with argument hints and context-aware suggestions

- Add comprehensive CSS styling for enhanced macro autocomplete items with flex layout
- Add argument hint banner styling with gradient background and border
- Add current argument highlighting in details panel
- Export formatMacroSignature, createSourceIndicator, createAliasIndicator, and createTypeBadge from MacroBrowser for reuse

* Fix macro autocomplete not showing details/arguments because of trailing colons

* Change macro details CSS selectors from `.macroBrowser` to `.macro-details` for better reusability and update autocomplete to use macro enum icon

- Replace all `.macroBrowser` selectors with `.macro-details` in macros.css to allow macro details panel styling to work outside MacroBrowser context
- Change autocomplete option icon from hardcoded '{}' to `enumIcons.macro` for consistency
- Remove redundant `showCategory: false` option from renderMacroDetails call in autocomplete (now handled by default

* Add MacroArgType enum to replace string literal type union for macro argument types

- Add MacroArgType enum with STRING, INTEGER, NUMBER, and BOOLEAN values
- Replace MacroArgType typedef string literal union with enum reference
- Export MacroArgType from macro-system.js alongside MacroCategory
- Remove MacroArgType typedef re-export (now an enum, not a type)

* Add support for multiple argument types in macro definitions

- Update createTypeBadge to handle both single type and array of types, displaying as "type1 | type2" with tooltip
- Add JSDoc comments to MacroArgType enum values explaining each type
- Update MacroArgDefinition typedef to allow type property to be single MacroArgType or array
- Update MacroRegistry.registerMacro to validate array of types and default empty arrays to 'string'
- Update validateArgTypes to check if argument value matches

* Add returnType property to macro definitions with automatic type badge display in macro details panel

- Rename MacroArgType enum to MacroValueType to reflect dual use for arguments and return types
- Add returnType property to MacroDefinitionOptions (defaults to MacroValueType.STRING)
- Add returnType validation in MacroRegistry.registerMacro to ensure valid type values
- Update renderMacroDetails to always show Returns section with type badge
- Add macro-returns-content CSS class with flex layout for type

* Add detailed argument definitions, return types, and example usage to all variable macros

- Replace numeric requiredArgs with detailed argument definition objects including name, type, and description
- Add returnType property to all macros that return values (inc/dec/get variants)
- Add returns property descriptions to all macros
- Add exampleUsage arrays demonstrating typical usage patterns for each macro
- Apply changes consistently

* Add returns descriptions and return types to core macro definitions with improved documentation

* Add returns descriptions, display overrides, and example usage to time macros with improved documentation

* fix lint

* Add returns descriptions and return types to chat, environment, instruct, and state macros with improved documentation

* Add missing properties to dynamic macro definition override to match MacroDefinitionOptions structure

* Replace console logging with MacroDiagnostics logging in MacroEnvBuilder and MacroRegistry

* Add support for array-based argument types in macro autocomplete with union type display and tooltip

* Rename requiredArgs to unnamedArgs and add support for optional unnamed arguments with bracket notation in macro signatures and hints

* Add optional offset argument definition to time macro with type, sample value, and description

* Simplify example usage for random and pick macros by removing surrounding context text

* Add default value display for optional macro arguments in autocomplete and browser documentation

* Fix macro args defaultValue not being converted into the normalized values for register and display

* Allow STscript macro auto completion to still show up when typing closing braces

* Add space macro with optional count argument for inserting multiple spaces

* Add optional count argument to newline macro for inserting multiple newlines with default value of 1

* Remove MutationObserver and CTRL+F keyboard event handling from MacroBrowser

* fix lint

* Register `{{summary}}` macro for both old and new macro engines based on experimental flag

* Register `{{charPrefix}}` and `{{charNegativePrefix}}` macros for both old and new macro engines based on experimental flag

* Update hidden alias badge text to indicate deprecation status

* Simplify macro name validation and error handling in MacroRegistry

Remove redundant `macroName` variable by normalizing `name` parameter early and reusing it throughout the registration flow. Consolidate trim checks in validation condition.

* Remove exp macro engine flag checks from auto complete and help, and remove legacy macro template

Move macro registration to always use new engine regardless of experimental flag. Remove conditional logic for `experimental_macro_engine` in MacroBrowser, system messages, and slash command parser. Delete legacy `macros.html` template and associated static macro help generation. Always use MacroBrowser for macro documentation display.

* Rename macros to camelCase and add backward-compatible aliases

Rename `description`, `personality`, `scenario`, `creatorNotes` to `charDescription`, `charPersonality`, `charScenario`, `charCreatorNotes` respectively. Rename `idle_duration` to `idleDuration`. Add old names as aliases for backward compatibility. Add `comment` as visible alias for `//` macro. Mark `idle_duration` alias as hidden.

* fix `random` and `pick` macros by using list parameter directly instead of raw string

Remove `raw` parameter from `random` and `pick` macro handlers. Simplify legacy comma-separated list handling by using `list[0]` directly instead of `rawListString`. Rename `items` variable to `list` in `pick` macro for consistency.

* fix `random` and `pick` not handling all colon-separated lists as before

Extract `readSingleArgsRandomList` helper function to handle legacy comma-separated and double-colon list parsing. Reuse this helper in both `random` and `pick` macro handlers to eliminate duplicated list parsing logic.

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
Co-authored-by: bmen25124 <bmen25124@gmail.com>
2025-12-15 21:29:46 +02:00
Kexus 4f9aeac7ac Correct error message in evalBoolean (#4889) 2025-12-14 19:42:59 +02:00
Cohee 204d384d9b glm 4.6v 2025-12-13 17:41:24 +02:00
Cohee f3c963fa8e jippity 5.2 2025-12-13 17:26:31 +02:00
98dd31b7f5 Chevrons can overlap with other elements. (#4878)
* Attempt to fix overlapping chevrons.
https://github.com/SillyTavern/SillyTavern/pull/4712#issuecomment-3639322664

* Removed supports.

* swipeRightBlock now has pointer-events:none.

* Add pointer events to swipes-counter

---------

Co-authored-by: user <user@exmaple.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-12-12 22:02:14 +02:00
Cohee 7da38faf60 Z.AI: Add transcribe endpoint 2025-12-12 00:53:53 +02:00
Cohee f7d9dbf5ce Add speech-to-text endpoints for Chutes, Groq and Mistral 2025-12-12 00:11:14 +02:00
Cohee 9046fe8d2d Refactor CC API async route handlers (#4885)
* Improve error handling in CC /status and /generate endpoints

* Cancel pending status check on switching CC source
2025-12-11 23:31:46 +02:00
Cohee 10a2f0f740 Replace Google Translate library (#4884) 2025-12-11 22:59:51 +02:00
Cohee 8d34ad5bae Merge branch 'release' into staging 2025-12-11 08:45:40 +00:00
Cohee 088ce0e962 Fix 'send if empty'
Closes #4881
2025-12-11 08:44:39 +00:00
Cohee b9aebb369f Fix: Pass-through pointer events to swipe buttons in video container 2025-12-11 01:19:04 +02:00
Cohee f4b071e71a Fix: Prevent swipe hotkeys when focused into a video element 2025-12-11 00:59:29 +02:00
Cohee 7125ddc0c3 Fix: apply right spacing to file wrapper block 2025-12-11 00:49:47 +02:00
Cohee e7dee7f5a7 Fix: preserve attached files during file input changes (#4877)
* fix: preserve attached files during file input changes

* Reverse order of duplicate pasted files check
2025-12-10 22:02:17 +02:00
Chanho Chung 6fdeaa2cd9 fix: caching system prompt functionality for OpenRouter Claude (#4872) 2025-12-10 20:22:54 +02:00
equal-l2 cd9de2f1b0 Add docker data directories to .dockerignore (#4873)
* Add docker data directories to .dockerignore

* Remove /docker/user from .dockerignore

The folder is not in docker-compose
2025-12-10 20:15:35 +02:00
Cohee b7760ddaaa Ollama: Add reasoning content extraction 2025-12-09 00:24:52 +02:00
d5320f57cf Backported refactor of the chats endpoint from feat/chat-tree. (#4870)
* Backported cleanup and refactor of chats endpoint from `feat/chat-tree`.

* https://github.com/SillyTavern/SillyTavern/pull/4870#discussion_r2599941781

* Error message.
https://github.com/SillyTavern/SillyTavern/pull/4870#discussion_r2599941796
https://github.com/SillyTavern/SillyTavern/pull/4870#discussion_r2599941797

* chatIntegritySlug https://github.com/SillyTavern/SillyTavern/pull/4870#discussion_r2599958991

* /save should not hang on empty body.chat.
https://github.com/SillyTavern/SillyTavern/pull/4870#discussion_r2599959001
https://github.com/SillyTavern/SillyTavern/pull/4870#discussion_r2599958997

* When the backup directory does not exist, log an error instead of silently failing.

* chatData should be an array.
https://github.com/SillyTavern/SillyTavern/pull/4870#discussion_r2599990728

* Skip body check.
https://github.com/SillyTavern/SillyTavern/pull/4870#discussion_r2599987542

* Change integrity warning to debug.
https://github.com/SillyTavern/SillyTavern/pull/4870#discussion_r2600005665

* Return null on error in `tryReadFileSync`.

* Update warning message for missing chat file to clarify potential emptiness

* Rename IntegrityMismatch to IntegrityMismatchError for clarity and consistency

* Fix a type error and formatting

* Improve debug messages and documentation for integrity checks in chat saving

* Add newline before file writing function for improved readability

* Improve debug message formatting for integrity validation in checkChatIntegrity function

---------

Co-authored-by: user <user@exmaple.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-12-08 23:54:40 +02:00
BeinseziiandCohee b5e20f2ff9 "N" support for llama.cpp (#4869)
* llama.cpp supports 'n' now

* Fix response parsing

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-12-08 22:50:34 +02:00
Cohee 9aff57c9c4 Add dummy reasoning_content for deepseek-reasoner tool calls
#4857
2025-12-07 23:40:52 +02:00
Cohee 311f226be4 Fix broken entry in asset list when gallery is open 2025-12-07 23:28:39 +02:00
Cohee f26a672811 Omit content type in POST request if no body 2025-12-07 23:26:47 +02:00
DeclineThyselfanduser 7c24667f49 Fixed isModifiedKeyboardEvent order of operations. (#4866)
https://github.com/SillyTavern/SillyTavern/pull/4819#discussion_r2595641856

Co-authored-by: user <user@exmaple.com>
2025-12-07 21:37:32 +02:00
CoheeandGhostXia 0225562f4e Regex cache (#4858)
feat: optimize regex extension performance

- Implemented caching mechanism for regex scripts to improve message rendering speed.
- Added automatic cache invalidation on script updates.
- Optimized regex compilation to reduce CPU usage.

---------

Co-authored-by: GhostXia <33112711+GhostXia@users.noreply.github.com>
2025-12-04 22:21:13 +02:00
Cohee bd1583faa4 Implement chat backups browse menu (#4862)
* Implement chat backups browse menu

* Unify bytes string formatting
2025-12-04 22:05:27 +02:00
Cohee 4e4d370686 Merge branch 'release' into staging 2025-12-03 22:03:19 +02:00
Cohee fbf789fa74 Fix path to sprites construction (#4860)
* Fix path to sprites construction

* Clean-up destination sprite paths
2025-12-03 22:02:52 +02:00
kashmirmydon c40caa050f Fix Mistral's Max Temperature 2025-12-03 21:27:31 +02:00
Cohee 8ca836c3a1 custom-request: Pass api-url for Z.AI and Vertex and fix if omitted in profile (#4859) 2025-12-03 21:17:41 +02:00
Cohee 090c8ec560 feat: add function to retrieve chat completion preset from settings 2025-12-03 21:17:06 +02:00
a4cc9b3989 Facillitate extension use of ConnectionManagerRequestService (#4841)
* Separate prompt-building functionality from request-sending functionality

* removing logs and clarifying comments

* separating parameter construction functionality to allow ConnectionManagerRequestService to use all other preset parameters

* fixing chat completion issues, adding documentation to new functions.

* Improving ConnectionManagerRequestService errors. Adding parseReasoningFromString option to override reasoning template.

* Adjusting TextCompletionService prompt formatting

* linting

* Use settingsToUpdate to convert from OAI preset to OAI settings.

* lint

* throw errors when profile ID not found

* Fix missed instances of global completion settings being used (CC and TC), replaced with optional argument. Specified typing for ChatCompletionSettings and TextCompletionSettings.

* Adjusting parameters of parseReasoningFromString and adding getReasoningTemplateByName

* using messages.role as a fallback for custom requests, fixing newline removal.

* parameters => settings
I like how it sounds better

* ditto

* You know I had to do it to 'em

* Update getCustomTokenBans

* Fix calculateLogitBias

* Fix param attributes

* Fix type checks

* Less strict role type on ChatCompletionMessage

* Add missing space

* fixing getChatCompletionModel to use an arbitrary chat completion settings object

* Fixing issues with preset overriding custom data passed.

* Pass model to createGenerationParameters externally

* Unify seed param handling for CHUTES

* Fix non-existing CC source

* Use strict comparison

* Use global settings as a base for generation parameters creation

* removing unnecessary handling of preset fields

* don't pass preset prompts, use the passed payload override messages

* refactoring text generation prompt building of last line

* Pass model to getReasoningEffort

* Pass model name to canPerformToolCalls

* Pass model to createTextGenGenerationData

---------

Co-authored-by: qvink <qvink@users.noreply.github.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-12-03 20:09:02 +02:00
Kristian SchlikowandCohee 6c8eb4d9ac Feat: Add toggle to exclude think/reason blocks from smooth streaming (#4849)
* Feat: Add toggle to exclude think/reason blocks from smooth streaming

* Fix: Adjust new setting name to properly reflect what it does

* Sync data-i18n with text content

* Add reasoning stream flags for Mistral, Claude and Google models

* Update layout

* Fix: Enhance reasoning handling in parseStreamData function

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-12-03 00:20:23 +02:00
Sammy f145296a58 add optional argument to changeMainApi (#4853) 2025-12-02 14:52:42 +02:00
Cohee b6a480b329 Merge branch 'release' into staging 2025-12-02 10:45:59 +00:00
Cohee 52a0860320 Fix npm audit 2025-12-02 10:36:49 +00:00
Cohee df513868e5 Switch Dockerfile to use npm ci 2025-12-02 10:30:57 +00:00
Cohee 560d15c5bb Prevent writing package-lock.json in startup scripts 2025-12-02 10:26:35 +00:00
Cohee 43f1824309 Fix: TTS speed control binding for chutes 2025-12-01 01:56:19 +02:00
Cohee fdc9b4c949 Fix: add a case in logprobs parsing function for AIMLAPI 2025-12-01 00:26:35 +02:00
BenandCohee 55a07d445d Chutes integration (#4844)
* Chutes integration

* Fix eslint

* Fix key saving

* Fix logo coloration

* Fix tool checks

* Unhide image inlining controls

* Fix order of options

* Fix type use in TTS extension script

* Add Chutes as a vector storage source

* Change log levels to debug

* Fix streamed reasoning parsing

* Skip remote models update

* TTS: Fix API key highlight

* Sort image models A-Z

* TTS: Fixes

* Remove unused SD endpoint

* Skip setting context size if models list is not yet loaded

* remove chutes quota / balance

* Fix: streamed tool calling

* Hide reasoning effort control

* Add image request debug log

* Fix: scroll down on media load in extensions

* Unhide some samplers

* Bring back reasoning effort

* This code will never execute

* Reformat else if cases

* Add stop strings to request

* Remove conditional from reasoning_effort body param

* Preserve original pricing fields

* Unhide logit bias setting

* Pass repetition penalty and logit bias to backend

* Swap llama tokenizer for llama3

* Pass min_p, remove supported_sampling_parameters checks

* Enable logprobs

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-12-01 00:17:49 +02:00
dc06abb364 Added MockServer class for tests. (#4843)
* Added a mock OpenAI-compatible endpoint at /v1/chat/completions.
Disabled by default.
Intended for debugging and e2e tests.

* Fixed empty prompts.

* Add mock server and example test

* Improve test

* Added `eslint-plugin-playwright`

* Removed `Date.now()` for reproducible responses.

* Ignore ERR_SERVER_NOT_RUNNING on close.

* Use MockServer in mock-openai.js

* Fixed error check.

* Removed mock server.

* Fix test name

---------

Co-authored-by: user <user@exmaple.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-11-30 19:20:25 +02:00
mightytribbleandCohee 1f78094322 Convert OAI tool_choice to Gemini functionCallingConfig for Gemini requests (#4840)
* Send toolConfig block to Gemini, if defined and tools block also present.

* Convert OAI tool_choice to Gemini functionCallingConfig for Gemini requests

* Remove blank line

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-11-30 19:18:41 +02:00
cloak1505 cd4f37f39b Sync OpenRouter providers list (#4846)
Python script to output a .txt containing a formatted list: https://gist.github.com/cloak1505/90a96bca28b332492221691268b674fd
2025-11-30 19:06:45 +02:00
Cohee 1da6e40129 Backgrounds menu tabs (#4845)
* Add tabs for backgrounds menu

* Improve styling and layout

* Use resize observer

* Add upload to chat bg logic

* Custom BG should always lock

* Fix auto-select when deleting active chat bg

* Use frame event cancellation on rapid resize

* Allow multiple uploads

* Fix mobile tab selector

* Bypass global lock with shift key

* Update copy tooltip

* Update localization files
2025-11-30 19:04:08 +02:00
Cohee 9246ca2779 Fix: enum/readonly comment order 2025-11-30 01:53:11 +02:00
1c1f25b5c6 Backported /tests from macros-2.0. (#4842)
* Backported `/tests` from `macros-2.0`.

* Added `eslint-plugin-playwright`

* Improve formatting

---------

Co-authored-by: user <user@exmaple.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-11-29 20:46:54 +02:00
Cohee b2ba255be4 Fix: replace debounced with regular save chat on end of stream 2025-11-29 13:25:36 +02:00
Cohee 2eba10fa7f Gemini: Add image request settings (#4838)
* Gemini: Add image request settings

* Allow aspect ratio for 2.5 flash
2025-11-29 00:59:09 +02:00
38f6b9a119 Enhanced CharX Import with Asset Extraction (#4825)
* feat: Extract and store CharX embedded assets on import

Enhances CharX (.charx) file import to extract and store embedded assets
in accessible locations:

- Add CharXParser class in new src/charx.js module
- Extract sprites (emotion/expression) → characters/{name}/
- Extract backgrounds → backgrounds/{name}_{asset}.{ext}
- Extract misc/x-risu-asset → user/images/{name}/
- Skip user_icon assets to prevent persona conflicts
- Support SFX (self-extracting) ZIP archives
- Add extractFilesFromZipBuffer() for efficient multi-file extraction
- Add normalizeZipEntryPath() for safe path handling
- Use hyphens in sprite names for ST expression label compatibility
- Fix ArrayBuffer slicing for Node.js buffer pool issue

Tested with 34 real-world RisuAI exports (200-300MB, 1000+ assets each).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: Address review feedback for CharX parser

- Add normalizeExtString() to handle dotted/uppercase extensions
  (e.g., '.PNG' or 'PNG' now correctly becomes 'png')
- Revert default avatar to path string instead of eager fs.readFileSync
- Simplify getCharXAssetBaseName regex, remove dead useHyphens branch
- Add JSDoc for persistCharXAssets documenting sync write behavior

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* refactor: Move ensureDirectory to util.js for reuse

- Extract ensureDirectory() from charx.js to util.js as a shared helper
- Add JSDoc for getUniqueAssetPath explaining sprite naming convention
- Prepares utilities for future ZIP-based format imports (similar to BYAF)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: CharX asset overwrite and folder naming

- Overwrite existing assets on re-import instead of creating duplicates
  (matches sprites.js upload behavior with deleteExistingByBaseName)
- Use character name for asset folders, not unique filename
  (ST's sprite system looks up by character name from card data)
- Strip trailing extensions from asset names to avoid file.ext.ext
- Add per-file error handling so one bad asset doesn't abort import
- Remove redundant else branch in storage category assignment
- Add comment explaining intentional 'embeded://' typo (RisuAI compat)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: Address PR review feedback

- Filter out directories in deleteExistingByBaseName (Cohee1207)
- Use ISO timestamp for create_date instead of humanizedDateTime

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: Store CharX backgrounds in character-specific folder

Changed background storage from global `backgrounds/` to character-specific
`characters/{charName}/backgrounds/` per maintainer feedback.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Remove unused import

* fix: Reduce CharX debug logging noise

Remove verbose per-file debug logs that create excessive console noise
for large archives. Keep only essential logging matching BYAF style:
- Entry point info log
- Final summary of imported assets
- Warnings for actual failures

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-11-28 23:51:09 +02:00
Cohee 3b59eae7c0 Gemini: Only register custom tools when there are no function tools 2025-11-28 20:22:05 +02:00
Cohee 068c6bdccd Gemini: Fix search tool is not supported when function tools are used 2025-11-28 20:18:02 +02:00
mightytribbleandCohee 32bbf4ec10 Support non-function native tools for Gemini
* Enable retrieval tool type for VertexAI Gemini endpoints

* Apply code suggestion

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-11-28 20:02:32 +02:00
Cohee 965b86da62 Add verbosity control (#4837)
* Add verbosity control

* Remove for Azure OpenAI
2025-11-28 19:49:59 +02:00
Cohee 1af87ea165 Backfill missing swipe_info (#4831)
* Backfill missing swipe_info

* Add type for SwipeInfo

* Init SwipeInfo with empty extra
2025-11-28 18:17:14 +02:00
Cohee 59ba22fa9e "Squash system messages" is back 2025-11-28 17:21:12 +02:00
Cohee d03a0b12b9 ImgGen: Preset GALLERY style for images generated with paintbrush if previously unset
Fixes https://github.com/SillyTavern/SillyTavern/pull/4833#issuecomment-3587591627
2025-11-28 02:48:42 +02:00
drake1138andCohee 765c76ea80 Return character prefixes to brush image generation (#4833)
* Return character prompt prefixes to brush image generation

Before [#4719](https://github.com/SillyTavern/SillyTavern/pull/4719), the brush tool would generate an image using the character specific prompt prefixes. This returns that functionality.

* eslint fix

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-11-28 02:43:56 +02:00
drake1138andCohee 05e85af3c6 Return character prefixes to brush image generation (#4833)
* Return character prompt prefixes to brush image generation

Before [#4719](https://github.com/SillyTavern/SillyTavern/pull/4719), the brush tool would generate an image using the character specific prompt prefixes. This returns that functionality.

* eslint fix

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-11-28 02:43:21 +02:00
Cohee 7de0307a98 Merge branch 'release' into staging 2025-11-28 02:26:30 +02:00
cd4364d311 Empty swipes are not handled by ensureSwipes. (#4828)
* Handle empty swipes.

* Add warning.

* Replace with forEach

* Replace with for loop

---------

Co-authored-by: user <user@exmaple.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-11-28 00:46:18 +02:00
Cohee 2b7003a6da Google Imagen: Add personGeneration setting to config.yaml 2025-11-28 00:26:31 +02:00
Cohee 0a22856faf Chat Completion: Reduce number of toggles in AI Response Configuration (#4821)
* Chat Completion: Reduce number of toggles in AI Response Configuration

* Consolidate migration logic

* Don't enable media inlining if image inlining was disabled

* Fix icons showing on media toggle off

* Update i18n
2025-11-28 00:16:23 +02:00
Cohee 0b5b3f089e Prompt Manager: Make main/PHI/aux injectable (#4829) 2025-11-27 23:34:25 +02:00
Cohee df865dda85 Extend caption/img gen generated text preview rows 2025-11-27 21:35:30 +02:00
Cohee da78cc6993 Fix: Google AI image generation setting
Fixes #4824
2025-11-27 21:29:03 +02:00
Cohee 3c7d81571d Fix: button visibility checks in swipe gesture handlers 2025-11-27 12:56:24 +02:00
Leandro Jofré 5f01d91e17 Fix - Check for samplers in the connections pannel (#4822) 2025-11-27 00:40:02 +02:00
Leandro Jofré 84a1403ce0 Fix - Check for samplers in the connections pannel (#4822) 2025-11-27 00:39:29 +02:00
Cohee 0fcf056352 Add chat_metadata object to Kobold Lite import header 2025-11-26 20:05:50 +02:00
Cohee cd992472d5 Add deprecated user_name and character_name fields for backward compatibility 2025-11-26 19:59:05 +02:00
Cohee 51f9590a8f Check chat_metadata in JSONL header 2025-11-26 19:32:53 +02:00
fc85b205ac Backport feat/chat-tree and fix #4709 (#4712)
* Performance improvements due to using chatElement instead of $('#chat').

* Reverts change `hideSwipeButtons()` change.

https://github.com/SillyTavern/SillyTavern/pull/4576#discussion_r2394996102

* I’ve been working on a PR for issue #1731: [Swipes on every AI message, not just the last one](https://github.com/SillyTavern/SillyTavern/issues/1731). I’d appreciate feedback to avoid unnecessary effort.

Currently, I have User and Assistant branches working.
I have not touched `/api/chats/save` or '/api/chats/get', so branches do not persist.

To keep `context.chat` unmodified (so extensions and the rest of the code remain unaffected), I’ve stored branches in `chatTree`:
```javascript
chatTree = {
  branch_id: 1,
  branch: [
    { mes: "Hi" },
    { mes: "Hello", branch_id: 0, branch: [...] },
  ]
}
```

When a message is swiped, chatTree is updated via `saveChatToTree()`, then the next branch is loaded using get`ChatFromTree()`.

Questions:
According to Cohee: [This requires reorganizations in the file format for chats, not viable in the short term.](https://github.com/SillyTavern/SillyTavern/issues/1731#issuecomment-1937845036)
I'm hesitant to proceed. May I store chatTree.json files alongside the existing .jsonl chats?
Should I create a new /save endpoint, modify the existing one, or discontinue using .jsonl for saving.

Known issues:
Branches do not persist on refresh.
Swiping multiple messages at once throws `Cannot read properties of undefined (reading 'mes')
`. This will be fixed in the UI.
Branches persist between chats/characters. This will be fixed when loading a chat.
The Swipe arrows overlap with messages.
No animation plays when swiping then editing a user message.

* Fixed bug.

Gemini:
The calculation of mesId is fragile and contains a bug. The fallback chat[chat.length - 1] is a message object, and Number(object) will result in NaN. This will break the swipe functionality if the preceding expressions are falsy. Additionally, chat.indexOf(message) will almost always point to the last message in the chat, which is incorrect when swiping on an earlier message.

A more robust approach is recommended to reliably get the message ID from the clicked element.

    const mesId = Number($(this).closest('.mes').attr('mesid'));

* Fixes swipes on long chats.

* chatTree is now persistent. Fixed bugs.

* Fixed bugs.
https://github.com/SillyTavern/SillyTavern/pull/4573#discussion_r2390042262
The logic to rename the chat tree file (.json) is currently in an unreachable else block. The if condition !fs.existsSync(pathToOriginalFile) || fs.existsSync(pathToRenamedFile) will almost always evaluate to true after the preceding copyFileSync and unlinkSync operations, because pathToOriginalFile will no longer exist. This prevents the chat tree file from being renamed, which breaks the persistence of message branches when a chat is renamed.

The scrollChatToMessage function is implemented incorrectly. Calling .scrollTop() without any arguments on a jQuery object retrieves the current vertical scroll position; it does not scroll the element into view. This function will not have the intended effect of scrolling the chat to the specified message.

* Fixed bugs. https://github.com/SillyTavern/SillyTavern/pull/4573#pullrequestreview-3282889120

There's a typo in the property name being deleted. It should be branch to match the data structure you've defined, not branches. This error will prevent the pruning logic from working correctly, potentially leading to corrupted or bloated chatTree data.

The modified treeData is not being saved here. Instead, the global chatTree is being sent in the request. This will cause any renames of group members within message branches to be lost upon saving. You should send treeData, which contains the modifications.

This function may have performance issues on large chats due to multiple structuredClone calls within a loop. swipelessMessage is created from a deep clone, and then it's deep-cloned again for every swipe. While this ensures data integrity, it is inefficient. Consider refactoring to reduce the number of deep-cloning operations, for instance, by creating swipelessMessage once per message and deep-cloning it only when creating a new branch for a swipe.

* Fix warning. https://github.com/SillyTavern/SillyTavern/pull/4573#discussion_r2390183161

The logic for renaming the chat tree file seems to have a flaw. The condition !fs.existsSync(pathToOriginalTreeFile) || fs.existsSync(pathToRenamedTreeFile) will be true if the original tree file does not exist. In this case, a warning is logged. However, it's a valid scenario for a chat to not have a corresponding tree file, so no warning should be logged. The current logic could lead to confusing log messages.

* Refactored chatTree into `public/scripts/chat-tree.js`.

https://github.com/SillyTavern/SillyTavern/pull/4573#discussion_r2390269514

* Displaying swipes on past messages and the entire chat tree functionality is now an opt-in toggle.

https://github.com/SillyTavern/SillyTavern/pull/4573#discussion_r2390273599

* Only allow one concurrent swipe.
Fixed:
Swiping multiple messages at once throws Cannot read properties of undefined (reading 'mes') .

* Fixed bugs.
Now `swipe_id >= swipes.length` is set to swipes.length.

* Fixed bug.
Swiping a user message did not re-show swipe buttons after the generation finished.

* Moved `Show Swipes for All Messages` Toggle to `Chat/Message Handling`.
https://github.com/SillyTavern/SillyTavern/pull/4573#discussion_r2395008961

* `JSON.stringify doesn't add spaces by default`
https://github.com/SillyTavern/SillyTavern/pull/4573#discussion_r2395047031

* Fixed "Tree file left behind when renaming chats"

https://github.com/SillyTavern/SillyTavern/pull/4573#discussion_r2395546142

* Fixed "Guard chatTree recursion in group member rename"
https://github.com/SillyTavern/SillyTavern/pull/4573#pullrequestreview-3290587129

* Re-implement: https://github.com/SillyTavern/SillyTavern/pull/4576#discussion_r2395506501

* Moved chat trees to a separate directory. https://github.com/SillyTavern/SillyTavern/pull/4573#discussion_r2395045583
Enabled chat tree backups.

* Removed structuredClone() for improved performance.

* Fixed bugs.
Characters are now correctly renamed in the chatTree.
Directories are now recursively created.

* Reverts `hideSwipeButtons` to original functionality when `show_swipes_for_all_messages` is false.

https://github.com/SillyTavern/SillyTavern/pull/4576#discussion_r2395375718

* Added `refreshSwipeButtons`.
Updated `showSwipeButtons` and `hideSwipeButtons`.
Fixed bugs.

* Fixed.
https://github.com/SillyTavern/SillyTavern/pull/4573#discussion_r2400143193
https://github.com/SillyTavern/SillyTavern/pull/4573#discussion_r2400143202

* Added `clamp` to util.js.
Refactored `swipe`.

* Fixed bugs.
https://github.com/SillyTavern/SillyTavern/pull/4573#discussion_r2400685914
https://github.com/SillyTavern/SillyTavern/pull/4573#discussion_r2400685911

* Fixed bugs.

* Fixed swipe animations.

* Fixed bug by setting ids with `Number`.

* Delete swipes, and bugfixes.

* Merged `refactor/swipe`.

* Fixed bug created in `Delete swipes, and bugfixes.`.

* Merged from origin/staging.

* Merged changes from refactor/swipe.

* Fixed bug and refactored `syncWithSwipeId`.

* Merged from `origin/staging`.

* Fixed merge.

* Fixed overlapping message generations.

* Warn user, and refresh chat.

* Added metadata to chatTree file.

* Fixed "a sacrifice for the sake of simplicity." https://github.com/SillyTavern/SillyTavern/pull/2752#issuecomment-2323512022

Gemini:
https://github.com/SillyTavern/SillyTavern/pull/4573#discussion_r2464165990
https://github.com/SillyTavern/SillyTavern/pull/4573#discussion_r2464165991

* Improved swipeGenerate's animation.

* Added `SWIPE_SOURCE` constant.

* await `switchSwipesAllMessages`.

* Added `swipeState`.

* Fixed:
https://github.com/SillyTavern/SillyTavern/pull/4573#issuecomment-3449690308

* Done:
https://github.com/SillyTavern/SillyTavern/pull/4573#discussion_r2466884547
https://github.com/SillyTavern/SillyTavern/pull/4573#discussion_r2466884547
https://github.com/SillyTavern/SillyTavern/pull/4573#discussion_r2466894947
https://github.com/SillyTavern/SillyTavern/pull/4573#discussion_r2466902075
https://github.com/SillyTavern/SillyTavern/pull/4573#discussion_r2466911245
https://github.com/SillyTavern/SillyTavern/pull/4573#discussion_r2466938169

* Removed `NEUTRAL_CHAT_TREE_KEY`

* Moved backups

* Fixed `/send` and fixed a bug in `sendMessageAs`.

* Fixed: https://github.com/SillyTavern/SillyTavern/pull/4573#discussion_r2466913570

* Fixes usage of `ENOENT`: https://github.com/SillyTavern/SillyTavern/pull/4573#discussion_r2466929980

* Removed LLM attribution.

* Updated link and warning.

* Removed debugging comments.

* Fixed: https://github.com/SillyTavern/SillyTavern/pull/4573#discussion_r2466905341

* Replaced `isSwipingAllowed` with `swipeState`.

* Backported many changes from feat/chat-tree.

* Refactored `showSwipeButtons` and `hideSwipeButtons` into `refreshSwipeButtons`

* Refactored `showSwipeButtons` and `hideSwipeButtons` into `refreshSwipeButtons`

* Fixed: https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2472109888
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2472113323

* Merged from `refactor/backport-chat-tree`.

* Proposed fix for https://github.com/SillyTavern/SillyTavern/issues/4709
Reverts commit: https://github.com/SillyTavern/SillyTavern/commit/1b3db273891c1ba8c781d2f691ad2e41937ca2aa

On PR: https://github.com/SillyTavern/SillyTavern/pull/2940

* Proposed fix for https://github.com/SillyTavern/SillyTavern/issues/4709
Reverts commit: https://github.com/SillyTavern/SillyTavern/commit/1b3db273891c1ba8c781d2f691ad2e41937ca2aa

On PR: https://github.com/SillyTavern/SillyTavern/pull/2940

* Fixed regenerate and continue while editing the last message.

* Added swipesHidden.
Messages can now be designated as non-swipeable with `message.extra.swipeable`.

* Use `.hidden` and classes instead of `.css` to display swipe chevrons.

* Fixed:
https://github.com/SillyTavern/SillyTavern/pull/4712#issuecomment-3465749700
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2476136375
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2476140043
https://github.com/SillyTavern/SillyTavern/pull/4712#issuecomment-3465776056
https://github.com/SillyTavern/SillyTavern/pull/4712#issuecomment-3465794330

* Fixed bug.

* Fixed broken JQuery animation.

* Fixed:
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2479003956
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2479011525
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2479014001

* Fixed active arrow transition.

* Fixed swipe shake direction.

* Fixed truthy check.

* Added temporary link to documentation PR.

* Moved `switchSwipesAllMessages`

* Fixed failed generations deleting the branch.
Fixed `forceSwipeId`.
Always call `saveChatConditional` if the `swipe_id` has changed.

* ESLint.

* Fixed bug.
Better `syncSwipeToMes` error handling.

* Backported changes from `feat/chat-tree`

Added failed swipe animation.
Fixed `newSwipeId`.

* Fixed: https://github.com/SillyTavern/SillyTavern/pull/4712

* Fixed:
https://github.com/SillyTavern/SillyTavern/pull/4712#pullrequestreview-3406878337

* Fixed:
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2483143387

* Fixed:
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2483143387

* Added `showSwipes: false` to `showMoreMessages`.

And a few more performance improvements.

* Fixed animations.

* Added `'.mes'` to `.children`.

* Significantly improved `animateSwipeTransition` performance on large chats.

* Improved `syncSwipeToMes` error handling.

* Significantly improved `animateSwipeTransition` performance on large chats.

* Improved `syncSwipeToMes` error handling.

* Corrected Merge.

* Corrected Merge.

* Improved: `redisplayChat`
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2484177521

* Fixed: https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2484215469

* Fixed: https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2484217230

* Added a temporary implementation of `branchChat`.

* Fixed bug when generating a swipe.

* Fixed bug in `branchChat`.

* Fixed Off by one error due to `chatElement.children()` selecting `show_more_messages`.
https://github.com/SillyTavern/SillyTavern/pull/4712#issuecomment-3478331073

* Fixed Off by one error due to `chatElement.children()` selecting `show_more_messages`.
https://github.com/SillyTavern/SillyTavern/pull/4712#issuecomment-3478331073

* Cleaned system messages array and moved `swipeable`

* Removed CSS nesting.

* Fixed merge.

* Improved `syncSwipeToMes` error handling.

* Matched `swipes-counter` fade to chevrons.
https://github.com/SillyTavern/SillyTavern/pull/4712#issuecomment-3478192184

* Wrapped `transition-behavior: allow-discrete;` in `@supports`.

* Fixed types.

* Improved swipeability feedback and functions.

* Improved `refreshSwipeButtons` performance again.

* Swapped `.attr` to `.prop`.

* Fixed: `@supports (transition-behavior: allow-discrete)`

* Fixed and clarified typo.

* Fixed:
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2495919425
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2495923036
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2495927019
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2495930080
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2495943870
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2495950927
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2495954387
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2495974324
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2495974683

* Fixed: https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2495957181
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2495960920
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2495968137
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2495968922
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2495959430
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2495924599

* Fixed: https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2495918468
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2495931979
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2495933092
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2495939511

* Improved `refreshSwipeButtons` performance by skipping 'swipes-counter' updates by default.

* Fixed: https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2496382916
https://github.com/SillyTavern/SillyTavern/pull/4712#discussion_r2496379401

* Removed chevron fade-in on Cohee's request: https://github.com/SillyTavern/SillyTavern/pull/4712#issuecomment-3493829978

* Set most system messages to `swipeable: false`.

* Implemented `OVERSWIPE_BEHAVIOR`.

* Fixed: https://github.com/SillyTavern/SillyTavern/pull/4712#issuecomment-3499706714

* Fix formatting, make comments IDE friendly

* IDE friendly enum comments

* Move animation frames to a dedicated file

* Do not compare with -1

* overswipeBehavior => getOverswipeBehavior

* Formatting fix

* Don't let regenerate on is_system

* Fixed canceled generations in pristine chats.
https://github.com/SillyTavern/SillyTavern/pull/4712#issuecomment-3499819670

* Fixed `AUTO_SWIPE` when `animation_duration = 0`.

* Fixed mistake in `redisplayChat`.

* Holding the swipe button speeds up `swipeDuration`.

* Fixed 'animationend' never ending.
Altered resetTime.

* Swapped from `saveChatConditional` to `saveChatDebounced` in `swipe`.

* Skip the animation if it's faster than 50ms instead of 10ms.

* Typo.

* Fixed:
https://github.com/SillyTavern/SillyTavern/pull/4712#pullrequestreview-3457198109

* Adjust duration reset cooldown

* Add quotes to selector

* Specify type for message parameter in swipe function

* Add type for swipe UI event

* Disabled fade-in during printMessages.
https://github.com/SillyTavern/SillyTavern/pull/4712#issuecomment-3539315919

* Typo.

* Added quotes to selector .

* Reduce reset time 500 -> 350

* Loops do not cause a generation so their chevrons should not have increased opacity.
https://github.com/SillyTavern/SillyTavern/pull/4712#issuecomment-3543692019

* Revert reset time

* Renamed `heldSwipes` to `recentSwipes`.

* Autofix the swipes array during `updateSwipeCounter`.

* User messages should not have swipes.

* Chevrons should always be shown on pristine greetings: https://github.com/SillyTavern/SillyTavern/pull/4712#issuecomment-3557893373

* Improve formatting

* Fixed: https://github.com/SillyTavern/SillyTavern/pull/4712#issuecomment-3559617088

* Show `pristineGreetingSwipeNotice` once.

* `clearMessageData` when swipe-regenerating a message.

* accountStorage is already imported in the module

* Removed `await`.

* Removed pristine greeting notice.
https://github.com/SillyTavern/SillyTavern/pull/4712#issuecomment-3560758598

* Removed redundant functions in `StreamingProcessor` and fixed streamed replies missing counters.

* Moved `markUIGenStopped` after `eventSource.emit`.

Swapped to `saveChatDebounced` to fix: https://github.com/SillyTavern/SillyTavern/pull/4712#issuecomment-3567014810.

* Save a structuredClone of `chat` to prevent an invalid chat from being saved.

* Only `structuredClone` `chat` on `saveChatDebounced`.

* Revert "Only `structuredClone` `chat` on `saveChatDebounced`."

This reverts commit 49498b7aa1.

* Revert "Save a structuredClone of `chat` to prevent an invalid chat from being saved."

This reverts commit 5f137ed138.

* Prevent `saveChatDebounced` from saving while the swipe is in progress.
See: https://github.com/SillyTavern/SillyTavern/pull/4712#issuecomment-3567077312

* Fixed animation never ending: https://github.com/SillyTavern/SillyTavern/pull/4712#issuecomment-3567106213

* `forceMesId` and `forceSwipeId` are not objects.

* Fixed Reduced Motion causing a warning when swiping back.

* Only  hide `.mes_buttons` when generating.

* Fix eslint

* Reset duration on switching direction

---------

Co-authored-by: user <user@exmaple.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-11-26 17:38:31 +02:00
Cohee 5993084ee6 Unify chat timestamps format (#4806)
* Unify chat timestamps format

* Handle ISO timestamps in stats.js

* Refactor timestamp parsing on server

* Switch to ISO timestamps for character/messages creation dates

* Fix type error

* Early exist in saveGroupChat if group not found

* Remove redundant fields from temp.chat export header

* Auto-fix char creation date format on edit

* Add name to fallback chat file names

* Rename parseTimestamp server side function
2025-11-26 15:55:15 +02:00
Leandro Jofré b9cea60c02 Update - Trigger CHARACTER_RENAMED_IN_PAST_CHAT for group chats (#4818) 2025-11-26 15:54:02 +02:00
Cohee 929d377da8 Update group chat metadata format (#4805)
* Migrate group metadata to group chat files

* Skip migration if chat already has metadata

* Fix active group not being set on group conversion

* Improve types in createGroup

* Fix padding in hotswap group avatars

* Fix centering of empty hotswap avatar

* Added automatic backups of migrated data

* Fix 'OVERWRITE' for GC

* Fix metadata parsing order in migration

* Remove color accents from regular migration logs

* Always set gen_id in converted message

* Clone messages before conversion

* Reduce size of add/remove buttons

* Fix group chat file size calculation
2025-11-25 23:48:43 +02:00
Cohee 051b275795 Fix resetting the context size when switching between CC sources (#4816)
* Fix resetting the context size when switching between CC sources that load the models list dynamically

* Revert the requirement to have models list for XAI

* Revert for sources that don't load context size from endpoint
2025-11-25 23:11:01 +02:00
Cohee 999ab48972 Refactor loadOpenAISettings (#4815)
* Refactor loadOpenAISettings

* Fix migration logic

* Show external category on load

* Restore jamba migration

* Refactor saveOpenAIPreset to use dynamic settings mapping
2025-11-25 03:21:07 +02:00
Cohee 3efcfbd1a2 Add new Claude model options and update regex checks for model validation 2025-11-24 21:55:29 +02:00
Cohee 248f5aa892 NanoGPT: Expose additional samplers 2025-11-24 20:36:51 +02:00
DeclineThyselfanduser 1b196cc101 getStringHash (#4811)
cyrb53 (c) 2018 bryc https://github.com/bryc/code/blob/master/jshash/experimental/cyrb53.js
License: Public domain (or MIT if needed). Attribution appreciated.

Co-authored-by: user <user@exmaple.com>
2025-11-24 11:47:24 +02:00
Cohee e5ceafddb1 Backgrounds: Restore drawer title header (#4809)
* Backgrounds: Restore drawer title header

* Change add background icon
2025-11-24 01:24:53 +02:00
Cohee c932e93988 /api-url: Add VertexAI region management (#4808)
* /api-url: Add VertexAI region management

* Remove unneeded array copy
2025-11-24 00:46:35 +02:00
Cohee 7325cc7c41 Fix data model in api/worldinfo/list 2025-11-24 00:13:02 +02:00
Cohee 8b1f2bc9f4 Merge branch 'release' into staging 2025-11-24 00:11:32 +02:00
Cohee 91d26c4b1d TC: Add a toggle for empty json schemas (#4807) 2025-11-24 00:08:18 +02:00
Cohee 9a595af55b Merge branch 'release' into staging 2025-11-23 23:20:05 +02:00
Cohee ac7076c832 TC: Fix being unable to restore null JSON schema 2025-11-23 23:17:03 +02:00
Cohee 8da417b0ea Merge branch 'release' into staging 2025-11-23 17:13:21 +02:00
Cohee 236a3b1c2d Save metadata immediately upon closing overrides dialog 2025-11-23 17:05:29 +02:00
Cohee 0bf0bc5a78 Regenerate package lock 2025-11-23 17:04:03 +02:00
Cohee 9c0588f5d5 Fix IDE resolution of absolute module paths 2025-11-23 16:54:13 +02:00
Cohee 1b5075a331 Remove nvm install from start.sh (#4804)
* Remove nvm install from start.sh

* Make it red
2025-11-23 16:37:50 +02:00
Cohee 4b77cb8583 Scroll down on swipe gen cancellation 2025-11-23 16:16:02 +02:00
Cohee 02ef1a7648 Regenerate package lock
Fixes #4793
2025-11-23 16:03:00 +02:00
Wolfsblvt a11abc4273 Add new WORLDINFO_SCAN_DONE event with mutable state for extensions (#4797)
* chore: Add WORLDINFO_SCAN_DONE event with mutable state for extensions

* Fix incorrect scan state reference in world info recursion logic

* Fix typo in world info scan state property name: 'sucessful' → 'successful'

(am i stupid)
2025-11-23 15:59:49 +02:00
Cohee 3a3d992bc3 Merge branch 'release' into staging 2025-11-23 15:55:38 +02:00
Cohee dc0deffd61 Fix npm audit in tests 2025-11-23 15:55:07 +02:00
Cohee d04aaec7cf canDeleteSwipe = power_user.confirm_message_delete
Fixes #4799
2025-11-23 15:54:27 +02:00
Cohee 28657339e3 Fix: Use nullish coalescing operator for kudos calculation in showKudos function 2025-11-23 15:50:02 +02:00
Cohee 50599a49b4 Add file_id to api/worldinfo/list 2025-11-23 13:39:22 +02:00
Cohee fad9baa587 canDeleteSwipe = power_user.confirm_message_delete
Fixes #4799
2025-11-23 01:47:45 +02:00
Cohee cdfe873984 Add /api/worldinfo/list endpoint 2025-11-22 23:04:07 +02:00
Cohee 2467688208 waitForFrame in scrollChatToBottom in sync scenarios #4791 2025-11-22 22:43:13 +02:00
Cohee a8004a9a9e Gallery: Add video uploads to gallery (#4796)
* Gallery: Add video uploads to gallery

* Improve thumbnailing logic

* Add error handling to thumnailing process

* Improve formatting in utils.js
2025-11-22 21:58:36 +02:00
Cohee 269c694bc7 Add state validation to onImageSwiped function 2025-11-22 18:57:07 +02:00
Cohee 9c9be90821 Merge pull request #4794 from SillyTavern/staging
Staging
2025-11-22 17:27:11 +02:00
ffe17bb870 Fixed layout thrashing when Stream Fade-In and Auto-scroll Chat are enabled. (#4791)
* Scheduling scrollChatToBottom after the animation frame prevents layout thrashing.

https://developer.mozilla.org/en-US/docs/Web/API/Window/requestAnimationFrame#return_value
https://gist.github.com/paulirish/5d52fb081b3570c81e3a#file-what-forces-layout-md

* Make frame request optional

---------

Co-authored-by: user <user@exmaple.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-11-22 15:58:23 +02:00
Cohee a668012138 Z.AI: Add endpoint selection (#4789)
* Z.AI: Add endpoint selection
Closes #4778

* Add i18n support for Z.AI endpoint options

* Update message for captioning ext.

* Remove unused imports

* Add api-url autoconnect guard
2025-11-22 00:44:27 +02:00
Cohee c31d92c909 1.14.0 2025-11-21 23:29:20 +02:00
Cohee 9e0a1c7d73 Horde: Try get shared key info
Fixes #4787
2025-11-21 23:12:00 +02:00
Cohee 45931a334f QR: Add handler for group chat creation event 2025-11-21 22:34:42 +02:00
Cohee 9f7677c04b Check for message being edited in beforeunload 2025-11-21 15:47:00 +00:00
Cohee 1a061321fd Handle empty chat directories in /api/characters/chats 2025-11-21 02:45:47 +02:00
Cohee e092088ad9 Add extension in /api/chats/delete if missing 2025-11-21 02:33:41 +02:00
Leandro Jofré e8a75c3329 Feat/Link sampler selection lock to TC API Type (#4782)
* Update - Revert connection profile change TC commands load order

This change was made to prevent preset tied samplers from breaking, such thing doesn't exist anymore.

* Update - Unlink preset renaming logic from sampler selection lock

* Update - Link TC sampler selection lock to API Type

* Fix - Clean comments

* Update - Use localforage selectedSamplers and data selectsampler as main sampler selection storage

* Fix - ESLint errors

* Update - Change lock tooltip with correct description

* Fix - Move and await sampler select localforage initializer to finish

Tried to move it to the most reasonable place possible that allowed to make an await.

* Fix - Make loadTextGenSettings async to load API selected samplers
2025-11-21 01:57:23 +02:00
Cohee 35949cac01 Add dummy signatures to image and empty text parts 2025-11-20 22:18:56 +02:00
Cohee 2d9b0ad0a9 Don't parse inline images from reasoning blocks 2025-11-20 21:46:21 +02:00
Cohee 70e569f0ef google bonanza pro 2025-11-20 21:33:40 +02:00
Cohee 04f844577c Filter recent chats from deleted entities on welcome screen 2025-11-20 20:53:51 +02:00
Cohee 621b27063a Add root chat files to /recent 2025-11-20 20:52:59 +02:00
Cohee b55dd49746 Add server endpoint to call prompt processing on demand 2025-11-20 20:37:26 +02:00
Leandro JofréandCohee 0d9a72becc Add option to keep manually selected samplers on API Type switch (#4692)
* Feat - Save and load manually selected samplers per preset

* Fix - Sync sampler popup with selected sampler state settings

* Fix - Prevent breaking visualization after disabling keep selected samplers

* Fix - ESLint errors in samplerSelect.js

* Fix - ESLint errors in textgen-settings.js

* Docs - Write JSDocs for new methods in textgen-settings.js

* Update - Make the reset button work individually per preset

* Fix - Trailing whitespace at the end of class selector

* Fix - Update tooltip information for force samplers toggle

* Fix - Prevent calling isSamplerManualPriorityEnabled a bajillion times

* Fix - Unbrick switch from manually-forced to non-manually-forced preset

This prevents samplers non controlled by [data-tg-type] from being sent to the shadow realm if they were previously hidden by [data-tg-samplers]. is_preset_switch is just to prevent breaking muscle memmory of users not using force manually selected samplers.

* Fix - Load manually selected samplers on connection profile switch

Changing preset does not update samplers ONLY IF force manually selection is disabled. Changing API before preset would update the samplers, but using the settings of the previous preset, due to preset being changed AFTER the API.

* Fix - Switch API Type controls in the API Connections panel

* Fix - ESLint errors in textgen-settings.js

* Fix - Update sampler selection only with textgenerationwebui as main API selected

* Styles - Change the sampler selection lock button icon to an actual lock.

* Fix - Await for sampler selection reset to finish

* Update - Normalize function name

* Update - Preserve manual sampler selections on preset renaming

* Fix - Properly reset sampler manual selections

* Update - Ensure selection reset displays API specific samplers

* Fix - ESLint errors

* Fix - Avoid modifying non-existent data

* Update - Move manual sampler control methods to samplerSelect.js

* Fix - Break circular file dependency between textgen-settings.js and samplerSelect.js

setting_names was unavailable during page load, throwing an error and preventing ST from loading.

* Update menu layout

* Remove pointless await

* Update param naming to camelCase

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-11-19 22:56:15 +02:00
Cohee 945d727132 Hide "visibility only" notice for ZAI reasoning toggle 2025-11-19 22:23:19 +02:00
Cohee ef3996cbea Restyle "Image Swipe Behavior" block 2025-11-19 22:14:50 +02:00
QiyuanChenandCohee 5c974bd148 feat: add siliconflow chat provider (#4764)
* feat: add siliconflow chat provider

* fix: remove siliconflow seed handling

* fix: enable SiliconFlow image inlining from shared vision list

* fix: handle SiliconFlow model context limits and sizing

* fix: drop SiliconFlow reasoning effort handling since controls are hidden

* fix: parse SiliconFlow reasoning in streaming and non-streaming

* fix: add missing comma in supported models list

* Remove seed from HTML template

* Combine streamed reasoning parsing blocks

* Update logo image

* Unhide image inlining controls

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-11-19 22:10:29 +02:00
Cohee 05a963a637 Add metadata flag to api/chats/recent 2025-11-19 20:36:52 +02:00
Cohee 69de212cc3 Add extensionless file name to /chats endpoints 2025-11-19 20:34:12 +02:00
equal-l2 62bcfd3de0 Add Gemini 3 for Vertex AI (#4777) 2025-11-19 17:35:08 +02:00
Cohee 73cedc115d Image swipe is back 🗣️🔥 2025-11-19 09:08:58 +00:00
Cohee 6c43ab64b5 Add metadata flag to api/characters/chats 2025-11-19 00:02:52 +02:00
Cohee 7448094f1b Add /edit-avatar endpoint 2025-11-18 21:46:29 +02:00
Cohee 9d9a8f1dd1 Jeremiah the Third 2025-11-18 20:19:04 +02:00
Cohee dc2624cdf5 Fix npm audit 2025-11-18 19:50:13 +02:00
Cohee af0cdec110 A 500 billion dollar startup can’t filter API payload fields 2025-11-17 20:08:29 +02:00
Cohee 1c4a918e43 gpt-5.1 2025-11-16 23:18:10 +02:00
Cohee b10f680371 Preserve media playback state when running appendMediaToMessage (#4771)
* Preserve media playback state when running appendMediaToMessage

* Better selector specificity

* Fix local variable name

* Move typedef to global.d.ts

* Check for readyState on save/restore

* Only check for currentSrc on restoration callback
2025-11-16 21:56:53 +02:00
Cohee c7040d2be4 Move img.swipe notice block up 2025-11-16 21:26:53 +02:00
SerenaandCohee e7af479427 Feature: allows sorting tags by most used (#4768)
* add sorting tags by most used

* Fix whitespaces

* Code review updates

* Remove commented code

* Fix capitalization in comment

* Apply review suggestion

* Simplify template init

* Reformat

* Add documentation for appendViewTagToList and printViewTagList functions

* Reprint renamed tags regardless of sorting mode

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-11-16 21:16:15 +02:00
Cohee 1baaa26729 Vertex: Add Vertex AI-specific safety setting (#4770)
Closes #4455
2025-11-16 18:26:03 +02:00
Cohee 306fc3f408 Gemini: Pass non-success response content to frontend 2025-11-16 17:55:53 +02:00
Cohee b99ccc3f0c OpenAI: Add Sora 2 API (#4748)
* OpenAI: Add Sora 2 API

* Add duration control

* Support client generation abort

* Reduce poll log amount

* Simplify selector

* Simplify model-specific control handling
2025-11-16 17:49:21 +02:00
Cohee f8c4795b4a Bump anti-troll tags limit
Closes #4763
2025-11-16 15:57:30 +02:00
Wolfsblvt 19ae4e7cc1 feat: add max-height and scrolling to world entry key input fields (#4769)
- Added 160px max-height to select2 multiple selection, primary key, and secondary key text areas in world entries
- Enabled vertical scrolling with hidden horizontal overflow for better UX with long content
2025-11-16 15:42:07 +02:00
Cohee 3af1622b38 Fix npm audit 2025-11-16 15:30:29 +02:00
Wolfsblvt 81367629fe Feat: Improve multiline input handling in popups (#4756)
* feat: improve multiline input handling in popups

- Added Ctrl+Enter requirement for submission in multiline input popups to prevent accidental sends
- Exported PopupUtils class for external use

* refactor: remove redundant higher/different rows from input popups

- Removed rows: 2 from callGenericPopup calls where default behavior is sufficient
- Increased rows from 2 to 4 in caption extension for better multiline input experience
2025-11-12 21:20:13 +02:00
Wolfsblvt bc06f3e3e0 Refactor: make whitelist validation a bit more robust (#4757)
* refactor: extract IP whitelist validation into helper function

- Added isIPInWhitelist helper with error handling for individual whitelist entry checks
- Replaced inline whitelist matching logic with reusable function calls
- Added JSDoc type annotations and error logging for failed IP matching attempts

* refactor: simplify whitelist validation with upfront filtering

- Moved IP validation to startup time instead of per-request checking
- Extracted validateWhitelist function to filter invalid entries once at initialization
- Simplified isIPInWhitelist by removing redundant error handling after validation

* fix: correct IP whitelist matching to use parsed CIDR notation
2025-11-12 21:13:58 +02:00
Wolfsblvt 6963f5cdd7 chore: add test-results directory to gitignore 2025-11-12 00:12:21 +01:00
Serena a0bff84e4e Fix: Prevent data loss on bulk regex move to scoped scripts (#4760)
* Fix: Prevent data loss in regex bulk move

* prevents moving to scoped scripts with group selected for bulkedit
2025-11-11 15:20:16 +02:00
Cohee dc4e0270e7 Fix OpenRouter embeddings URL
#4736
2025-11-11 13:16:04 +00:00
Wolfsblvt b0dd267b9e feat: enhance HTML escaping to include single quotes (#4755) 2025-11-10 00:33:01 +02:00
Madobe Ichika eb0706d294 Raise max response length to 128k for GPT-5 models (#4753) 2025-11-09 13:30:23 +02:00
Cohee 94b95013bc Add audio/video inlining for OpenRouter (#4751)
* Add OpenRouter inlining support for video and audio

* Refactor modality checks
2025-11-08 17:39:31 +02:00
Cohee 38679897c6 Add captioning for video attachments (#4749)
* Add captioning for video attachments

* Unify error toast titles

* Add MEDIA_SOURCE enum and update media handling to include source information

* Unify attachment handling logic

* Add error handling for auto-captioning failures

* Use string formatting for console error
2025-11-08 02:07:28 +02:00
Cohee 4fcdec47f4 Fix PPP for audio attachments 2025-11-08 01:04:05 +02:00
Cohee 5837f28599 TC: Allow setting null JSON schema (#4746)
* TC: Allow setting empty JSON schema

* Fix check for llamacpp schema

* Handle grammar/schema for Aphrodite

* Conditional include for guided_json

* Update default presets with null value

* Conditional include into payload for grammar/schema
2025-11-07 23:39:52 +02:00
Cohee 09b8d59f4d Moonshot: Load models list from endpoint 2025-11-06 22:51:40 +02:00
105b436a66 fix #3199: firefox using cached images instead of new images. (#4743)
* Fixed: https://github.com/SillyTavern/SillyTavern/issues/3199#issue-2745917391

* Wrap header set in isFirefox

* Only invalidate Firefox caches. Also invalidate thumbnail caches.

* Skip `mime.lookup` on non-Firefox browsers.

* Improve param comments

---------

Co-authored-by: user <user@exmaple.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-11-06 20:11:21 +02:00
Cohee ad72fa806e Google: Add Veo models (#4742)
* Google: Add Veo models

* Combine retry into a singe loop

* Improve error logging and reporting

* Add client abort handling for video generation endpoint
2025-11-06 19:58:01 +02:00
StageDog 5a2b325ff7 fix: reorder regex import target popup (#4744) 2025-11-06 10:57:06 +02:00
Cohee a06a033a71 OpenRouter: Fix embeddings endpoint #4736 2025-11-06 08:55:40 +00:00
bmen25124 a728d30c99 Refactor flattenSchema to simplify JSON schema for Google Generative … (#4711)
* Refactor flattenSchema to simplify JSON schema for Google Generative AI API compatibility

* Added unit test and github action

* Add unit tests workflow and update test script in package.json

* Downgrade eslint-plugin-jest to make min node version 18
2025-11-06 00:08:58 +02:00
Cohee 2577e35c0b Audio media attachments (#4741)
* Add audio-player component

* Enhance audio player functionality and styles

- Adjust audio player layout and styles in CSS for better spacing and alignment.
- Add audio element to message template in HTML.
- Implement audio attachment handling in JavaScript, including a new AudioPlayer class.
- Update media attachment structure to include titles for audio files.
- Extend supported media file types in constants.

* Add audio inlining control

* Fix file formats list

* Simplify hints

* Add to prompt

* Add progress title hint

* Add to scrollOnMediaLoad

* Add audio size hint

* Add gallery controls

* Delete removed media attachments from server

* Adjust min width

* No-op when swiping a singular media

* Fix clean-up

* Fix silent deletion logic

* More accurate media prompt estimations

* Round durations with ceiling function

* Adjust rounding logic

* you don't have to say it twice

* Export deleteFileFromServer

* Don't reference module from HTML

* Clean-up styles

* Move formatTime to utils

* Add fa-fw to delete
2025-11-05 00:53:23 +02:00
Cohee 447c271b36 Fix type error in escape key handler 2025-11-03 22:57:44 +02:00
Cohee 845bd8c999 OpenRouter: Add as vector storage provider (#4736)
* OpenRouter: Add as vector storage provider

* Better array filtering
2025-11-03 21:53:17 +02:00
fathom0324andgoogle-labs-jules[bot] 73c1bc2d03 Prevent Esc from closing editor during composition (#4738)
* fix(IME): Prevent Esc from closing editor during composition

When using a Chinese IME, pressing the Escape key during composition should cancel the composition, not close the message editor.

This commit fixes the issue by adding a check for `!e.isComposing` to the 'keyup' event listener for the Escape key in `public/script.js`. This ensures that the editor is only closed when the Escape key is pressed outside of an IME composition session.

* fix(IME): Change the handler of 'Escape' from 'keyup' to 'keydown'

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2025-11-03 21:26:17 +02:00
Cohee c04be57f84 Support multiple images in single API response (#4734)
* Support multiple images in single API response

* Fix media wrapper clashing with swipe counter

* Return an empty array, add additional filtering

* Add index to inline image filenames in processImageAttachment
2025-11-03 00:30:36 +02:00
Cohee c14fba8829 Add scroll behavior options for media appending 2025-11-02 23:27:34 +02:00
Cohee a47b371702 Fix scrolling behavior 2025-11-02 23:03:11 +02:00
d1035336a8 Fixed bug in syncMesToSwipe. "" is falsy and a valid message. (#4733)
* Fixed bug in `syncMesToSwipe`.

* Use strict inequality operator

---------

Co-authored-by: user <user@exmaple.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-11-02 20:16:09 +02:00
de7c113346 Multiple attachments (#4719)
* Multiple file uploads

* mes_img_wrapper

* mes_video_wrapper

* Named export instead of function wrapper

* Update public/scripts/chats.js

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

* Fix optional chaining for message extra

* Preserve existing files with paste

* Improve swipe message extras clean-up

* Clean-up: Add chat_backgrounds to known images

* Add ensureMessageMediaIsArray to getContext

* Fix compatibility warning

* Update to media array

* Move de-dupe check logic

* Fix comment

* Fix clean-up logic

* Improve typing

* `feat/multi-file` Added a toggle between the old gallery and new image list. (#4722)

* Added "Toggle Gallery" button.
Added `getContainerInfo`.

* Refactor

* Change checkbox toggle to select

* Ensure media_display is set correctly only if any image_swipes were migrated

* Rename function

* Support Date in parseTimestamp

* Add type to main chat array

* Add media display reload prompt

---------

Co-authored-by: user <user@exmaple.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>

* Use a single wrapper block for media

* Fix type annotation

* Fix video display in list mode

* Refactor saveImageToMessage to include title in media object

* Use named constants in migrateMediaToArray

* Update img control styles

* Fix error container state

* Refactor onImageSwiped

* Remove redundant event handler

* Refactor expandMessageMedia

* Use shared function for display handling, fix notice logic

* Enhance ChatMessage and ChatMessageExtra types

* Refactor media display reload logic

* Improve styling for media containers

* Adjust spacing in file form styles

* Fix scroll handling in appendMediaToMessage

* Reduce flicker in appendMediaToMessage

* Extract scrollOnMediaLoad func

* Improve scroll behavior in gallery display

* Improve delegation for click events

* Add file d&d handler to #form_sheld

* Improve scroll adjust for slow connections

* Adjust debounce timeout

* Add messageMedia enum provider

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: DeclineThyself <FallenHaze@tutamail.com>
Co-authored-by: user <user@exmaple.com>
2025-11-02 20:10:43 +02:00
Cohee 60a8b51951 Unblock textarea send during edit (#4714) 2025-10-30 19:43:53 +02:00
Cohee fc2aefa5be Claude: Fix image inlining for haiku-4-5 2025-10-30 04:17:33 +02:00
docfail 5f35a38963 Remove unnecessary check for swipe info to fix #4717 (#4718)
* - Removed unneccessary check for swipe info. Swipes are valid and can be read by the chat message UI just fine without the dates and details surrounding generation settings.

* + Swipe info will now be backfilled if it's missing using placeholder data, to improve compatibility.

* + Fix big oopsie.
2025-10-30 00:27:30 +02:00
Cohee 36557dc1f6 Add Start Reply With to master import/export (#4716) 2025-10-29 21:14:57 +02:00
docfailandCohee dd758161bd Add Full Support for BYAF Archives (#4701)
* + Fix discarding all scenarios aside from the first one, which would cause all chats other than the first one to be lost.
+ Accumulate alternative starting messages from all scenarios, as different scenarios are how Backyard handles having alternative greetings. A scenario with multiple messages in its "firstMessages" array is invalid as per BYAF spec.
+ Return scenarios so that they can be used to populate chats, scenario overrides, and in the future, the other character settings overrides as well.

* + Added support for importing chats (including swipes) from BYAF. This brings the core functionality of BYAF imports mostly in-line with the standard, without the inclusion of any features that are currently missing from ST.
> The only supported feature not yet implemented is scenario overrides per-chat. This will be the the goal of the next commit.

* + Implemented scenario overrides, fully bringing ST's BYAF import as in-line with the BYAF standard as possible without adding new feature functionality to ST.
+ Also added some new chat metadata fields in preparation for example message and system prompt overrides.

* + Added support for pulling alternate icons from the BYAF archive. They are not used yet, but they are safely stored.
+ Added support for pulling backgrounds from the BYAF archive. They are not used yet but they are stored and linked to the chats they originally belonged to.
+ Saved every remaining field that was previously discarded from BYAF that a user actually needs in a way that could be used in the future, and can be accessed by the user if needed after import. Any fields that are not preserved at this point are specfic to either Backyard AI's desktop application, or to the BYAF manifest itself, and therefore have no relevance to a user.
> With this, BYAF import should be fully supported and in-line with the official spec.

* + Updated comments and method names to reflect changes appropriately. First round of touch ups.

* + More comment updates.

* - Removed commented code, that is no longer needed for reference.

* > No longer sanitize for filenames in the character card, as there's no need. The sanitization now happens when generating the filename, which is subsequently used for file operations.
+ Added replacement function for sanitizing filenames which uses visually similar but valid for filenames replacement characters instead of deleting the characters for better data parity.

* + Preserve isNSFW flag as a tag, so it's not lost on import.

* + preserve labels on character alt avatars

* + Deduplicate first messages, so that 5 chats with the same first message don't create 5 identical first messages.

* + Adjusted icon naming logic to produce more sensible results.

* > User path.basename and path.extname for getting the base name and extension of files, respectively.

* > Should use camelCase for local function names.

* > Use a set for greetings instead of explicitly checking for duplicates.

* > Missed a snake case local function name.

* > Updated background import logic to integrate with existing per-chat background system.

* + Updated logic to skip import of chats and backgrounds when a character is being updated/replaced.

* + Added copy of getUniqueName helper function from frontend utils to backend utils.
+ Refactored duplicated logic for getting unique filenames for backgrounds and character alt icons to use the newly available function.

* > fixed adding an extra dot to the filenames for icons after switching to path.extname for getting the extension

* > Updated metadata settings generation in byaf chat so that it doesn't overwrite valid yet 'falsy' values with defaults. Oops

* > Remove variable for configuration that will likely never need to exist.

* > custom_background should be an empty string if chat_background is falsy

* > Make an array empty if chat_background is falsy.

* > Prefer camelCase for local variable names.

* + Added definitions for ByafParseResult and ByafChatBackground.
> Updated overused and unweildy anonymous types to the newly defined types.

* + When importing a character with chats, the character will now no longer open to a new empty chat, but instead will pick the first of the imported chats to open up to.

* Rename prev_paths => paths

* Prettify logs display

* Set fallback chat name if scenario is untitled

* card.data.name => card.name

* Optimize first scenario message access

* + Moved custom replacement function from importFromByaf into util.js as sanitizeSafeCharacterReplacements() so that the replacement logic may be reused anywhere for consistency.

* > Missed a couple. Updated for consistency

* + Preserve character full/display name without it needing to be safe as a filename.
> Change logic for naming the folder the alt images live in to match the logic the sprites endpoint uses to get character sprites for consistency

* > Only add full_name extension if displayName exists.

* full_name => display_name

* - No longer use safe lookalike replacements for filename sanitization to be consistent with how web browsers sanitize invalid characters in filenames before saving to disk.

* Tiny formatting fix

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-10-29 20:06:53 +02:00
Cohee 5e033a9db9 Change window resize log level to debug 2025-10-28 23:27:31 +02:00
docfailandCohee 47f744dfdf Character settings overrides UI (#4707)
* + Implemented support for overrides of system prompt and example messages from chat metadata. This is needed for BYAF import parity. No UI for modifying these yet, but they're easily changeable in the chat files already. These metadata settings are already supported by BYAF import as of the last commit so this just enables them.

* + Updated scenario overrides popup to now be a character settings overrides popup.
+ Updated the template to have a new section for example messages and system prompts
+ Updated the logic to handle all three overrides
+ Updated logic to only save when the popup is closed, instead of on every character input.

* Preserve import, allow scrolling

* Add confirmation on override removal. Always save pending changes.

* Update dialog layout, add editor expand buttons

* Fix mes examples override in group chats with Join mode

* Update group chat button title

* Specify that Prefer Char. Prompt is a requirement

* Fix group join mode not replacing macros in overrides

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-10-28 21:57:52 +02:00
6757a0375b Refactored mes_edit_up and mes_edit_down into messageEditMove. (#4704)
* Refactored `mes_edit_up` and `mes_edit_down` into `messageEditMove`.

* Fixed:
https://github.com/SillyTavern/SillyTavern/pull/4704#pullrequestreview-3385227819

* Fixed https://github.com/SillyTavern/SillyTavern/pull/4704#pullrequestreview-3385647876 and refactored `updateEditArrowClasses`.

* Update this_edit_mes_id in messageEditMove

* Don't set this_edit_mes_id if unset

---------

Co-authored-by: user <user@exmaple.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-10-28 20:31:06 +02:00
Cohee f3ec2483ac Sync OpenRouter providers 2025-10-28 20:14:18 +02:00
Cohee 2175ccbf1e Don't split multiswipes unless requested (#4703) 2025-10-28 00:58:30 +02:00
DeclineThyselfanduser 0cb4f79c36 Fixed a bug in sendMessageAs. (#4706)
Co-authored-by: user <user@exmaple.com>
2025-10-28 00:06:13 +02:00
Cohee 1de4f30775 Prefer const in variable definition 2025-10-26 15:19:41 +02:00
db315ecf0f Fix koboldcpp abort generation error (#4693)
* Enhance contribution guidelines for pull requests

Added guidelines for maintaining workflow during PRs.

* fix abort generation error when koboldcpp is set with a password

* add parameter type, and remove unecessary line

* oops, missing comma

* eslint

* remove header content type

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
Co-authored-by: Your Name <you@example.com>
2025-10-26 15:19:10 +02:00
Cohee 256398f607 Merge branch 'release' into staging 2025-10-26 15:15:02 +02:00
Kristian SchlikowandCohee b5083c7b23 fix: Enhances model display for Fal.ai image gen source (#4694)
* fix: Enhances model display for Fal.ai image gen source

* Move text processing to backend

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-10-26 15:14:28 +02:00
Cohee 133ad15a83 Prevent propagation and editing of 'json_data' field in character data (#4690) 2025-10-24 15:44:50 +03:00
2df8e52d48 If the world-info has no comment, show it's keys in the placeholder. (#4681)
* Show keys in commentInput's placeholder.

* Fixed.
https://github.com/SillyTavern/SillyTavern/pull/4681#discussion_r2450822592
https://github.com/SillyTavern/SillyTavern/pull/4681#discussion_r2450827302
https://github.com/SillyTavern/SillyTavern/pull/4681#discussion_r2450834282
https://github.com/SillyTavern/SillyTavern/pull/4681#discussion_r2450844011

* Update comment backfill logic

* Don't update placeholder with secondary keys

* Fix MAX_COMMENT_LENGTH to enforce a limit of 100 characters

---------

Co-authored-by: user <user@exmaple.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-10-23 22:10:08 +03:00
Cohee 55969bc96e Chat Completion: Streamline settings and API key handling (#4687)
* refactor: streamline CC settings and API key handling

* Add types for API settings

* Allow keyless custom source connection
2025-10-23 21:28:37 +03:00
DreamGenX 4e428c938d update dreamgen presets (#4683)
* update dreamgen presets

* remove dreamgen presets

* remove dreamgen presets
2025-10-23 21:07:08 +03:00
Cohee e9cd32a123 Enhance contribution guidelines for pull requests
Added guidelines for maintaining workflow during PRs.
2025-10-23 12:35:15 +03:00
Cohee da2fbbbb15 Ollama: Always truncate embedding inputs
https://docs.ollama.com/api#parameters-8
2025-10-23 00:58:00 +03:00
Cohee d32ac6c018 Unbrick preset saving 2025-10-23 00:50:42 +03:00
Cohee 860e80fe0a Update default sampler presets for Text Completion and AI Horde / Kobold Classic (#4686)
* Update default sampler presets for Text Completion and AI Horde / Kobold Classic

* do_sample = true

* Add missing fields to TC presets

* Consolidate Default and RecoveredRuins

* Fix rep.pen in Kobold presets

* Adjust TC samplers in default settings.json
2025-10-22 23:01:48 +03:00
f0ceba43e9 feat: [Electron Hub] Support Vector Storage, Better searching for image engine (#4540)
* feat: [Electron Hub] Add Vector Storage, Better searching for image model list

* feat: [Electron Hub] Add quality parameter for Image Engine

* fixed ESLint

* Update public/scripts/extensions/vectors/index.js

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

* small tweaks

* Use default getOpenAIVector

* Refactor and clean-up code

* Move endpoint filtering logic to backend

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-10-21 23:38:12 +03:00
Cohee 4add4f0090 Add official GLM API as CC provider (#4678)
* Add UI elements

* Add support for model configuration

* fix: update API request parameters for improved handling

* Add logo img

* Fix tool calling with negative index

* Include tool calls into 'last in context' calculation

* feat: add support for captioning
2025-10-21 22:37:27 +03:00
Cohee c0e84aaa16 Merge branch 'release' into staging 2025-10-21 20:56:09 +03:00
Cohee 46cb4b5fcb fix: freshChat detection on group chat load.
This breaks persona refresh on untainted group chats. I have no better solution for that yet.
2025-10-21 20:55:55 +03:00
Cohee 3e7b511af2 fix: return debounced save in deleteMessage 2025-10-21 20:16:30 +03:00
DeclineThyselfanduser 19c4aea25a Fixed crash when top_logprobs is empty. (#4680)
Co-authored-by: user <user@exmaple.com>
2025-10-20 23:12:29 +03:00
Cohee 593fba5700 Refactor message edit function (#4679)
* Refactor message edit, show counters on last message

* fix: add warnings for missing message in chat array and DOM during edit

* Export messageEdit function

* Formatting fix

* Fix comment alignment
2025-10-20 21:16:38 +03:00
20556aa3dd Refactored swipe and moved messageEdit to a separate function. (#4610)
* Extracted `messageEdit` and `messageEditCancel` from `.mes_edit` and `.mes_edit_cancel`

* Fixed.
https://github.com/SillyTavern/SillyTavern/pull/4633#discussion_r241505
https://github.com/SillyTavern/SillyTavern/pull/4633#pullrequestreview-3316588180

* Refactored `swipe` and moved `messageEdit` to a separate function.
Also, a few more minor changes.

* Fixed bug.
https://github.com/SillyTavern/SillyTavern/pull/4610#discussion_r2404789035
https://github.com/SillyTavern/SillyTavern/pull/4610#discussion_r2404789038

* Fixed.
https://github.com/SillyTavern/SillyTavern/pull/4610#discussion_r2408682277
https://github.com/SillyTavern/SillyTavern/pull/4610#discussion_r2408689706
https://github.com/SillyTavern/SillyTavern/pull/4610#discussion_r2408690772
https://github.com/SillyTavern/SillyTavern/pull/4610#discussion_r2408697066
https://github.com/SillyTavern/SillyTavern/pull/4610#discussion_r2408705156
https://github.com/SillyTavern/SillyTavern/pull/4610#discussion_r2408708088
https://github.com/SillyTavern/SillyTavern/pull/4610#discussion_r2408725971
https://github.com/SillyTavern/SillyTavern/pull/4610#discussion_r2408726241
https://github.com/SillyTavern/SillyTavern/pull/4610#discussion_r2408740050
https://github.com/SillyTavern/SillyTavern/pull/4610#discussion_r2408745918
https://github.com/SillyTavern/SillyTavern/pull/4610#discussion_r2408753165
https://github.com/SillyTavern/SillyTavern/pull/4610#discussion_r2408761262
https://github.com/SillyTavern/SillyTavern/pull/4610#discussion_r2408764531
https://github.com/SillyTavern/SillyTavern/pull/4610#discussion_r2408781694
https://github.com/SillyTavern/SillyTavern/pull/4610#discussion_r2408784426
https://github.com/SillyTavern/SillyTavern/pull/4610#discussion_r2408794672
https://github.com/SillyTavern/SillyTavern/pull/4610#discussion_r2408802366
https://github.com/SillyTavern/SillyTavern/pull/4610#discussion_r2408803433

* Fixed:
https://github.com/SillyTavern/SillyTavern/pull/4610#discussion_r2408702506

https://github.com/SillyTavern/SillyTavern/pull/4610#discussion_r2408805635

https://github.com/SillyTavern/SillyTavern/pull/4610#discussion_r2410368443

https://github.com/SillyTavern/SillyTavern/pull/4610#discussion_r2408791120

* Bugfixes. Incomplete.

* Fix formatting

* Use scrollTop because scrollIntoView breaks layout on phones.

* Only show '?' in `formaSwipeCounter` if something is wrong.
https://github.com/SillyTavern/SillyTavern/pull/4610#discussion_r2412169005

* Respect animation_duration if it's >= 0.

* Disabled expandNewMessage's animation on Cohee's request. https://github.com/SillyTavern/SillyTavern/pull/4610/files#r2408731744

* Only hide the swipe counter when a generation is ongoing.
https://github.com/SillyTavern/SillyTavern/pull/4610#discussion_r2440588779

* refreshSwipeButtons

* Adjust swipeDuration constant

* feat: add refreshSwipeButtons and isSwipingAllowed to context

* Fixed image swipes.

https://github.com/SillyTavern/SillyTavern/pull/4610#discussion_r2442489827

https://github.com/SillyTavern/SillyTavern/pull/4610#discussion_r2442490042

* Fixed.
https://github.com/SillyTavern/SillyTavern/pull/4610#issuecomment-3418657967

* Fixed: https://github.com/SillyTavern/SillyTavern/pull/4610#discussion_r2442480238

* Fixed.
https://github.com/SillyTavern/SillyTavern/pull/4610#discussion_r2442536011

* Minor refactor.

* Fixed: https://github.com/SillyTavern/SillyTavern/pull/4610#discussion_r2443359660 https://github.com/SillyTavern/SillyTavern/pull/4610#discussion_r2443359435

* Fixed: https://github.com/SillyTavern/SillyTavern/pull/4610#discussion_r2443357913

* Fix registration of click events

* Fix passing data to swipe events

---------

Co-authored-by: user <user@exmaple.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-10-20 20:51:33 +03:00
Cohee 743c26a9f8 fix: nanogpt and deepseek models not saving to presets 2025-10-19 23:36:45 +03:00
Cohee 034a5f3aa4 fix: timeout git process after 5 minutes of inactivity (#4673)
* fix: timeout git process after 10 seconds of inactivity

* fix: increase git process timeout to 10 minutes

* 10->5 min, remove timeout from install
2025-10-19 22:03:19 +03:00
Cohee ba79e7d94c Fix event handlers in cosyvoice.js
Fixes #4668
2025-10-19 16:50:55 +03:00
Cohee 5c62c3a90d feat: add move up/down functionality for alternate greetings (#4676)
* feat: add move up/down functionality for alternate greetings

* Remove disabled cursor style
2025-10-19 16:46:19 +03:00
Cohee 5eb43e45b6 fix: set metadata tainted flag on swipe deletion 2025-10-18 19:15:43 +03:00
StageDog 4bda4444e4 feat: Apply preset regexes before scoped regexes + avoid unnecessary popping up (#4672)
* feat: apply preset regexes before scoped regexes

* feat: apply preset regexes before scoped regexes for debugger list

* fix: don't notify reload regexes when save preset through ui button

* docs: add comment for SCRIPT_TYPES order

* fix: updatePreset is wrongly reset preset
2025-10-18 19:08:11 +03:00
Cohee 94ba7bcf2d fix: /cut of the first displayed message 2025-10-18 17:14:55 +03:00
Cohee ea3c5029c6 fix: prevent swipe deletion from /del command 2025-10-18 16:33:27 +03:00
StageDog 7dda524284 feat: set sortable handle for regex (#4667) 2025-10-17 22:13:18 +03:00
bmen25124andCohee dcab740b99 Added deleteMessage method (#4666)
* Added deleteMessage

* Simpler swipeDeletion param

* Added to context

* Fix review comments

* Only offer swipe deletion if count of swipes > 1

* Improve array check

* Fix generation broken after message deleted

* Use named constant for confirmation result

* Save chat immediately

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-10-17 22:08:46 +03:00
Cohee d08f3a2eef Allow blockquotes with encoded tags (#4662)
* Allow blockquotes with encoded tags
Fixes #4634

* Cache canUseNegativeLookbehind result

* Optimize regex allocation
2025-10-17 19:42:10 +03:00
Cohee 47765b6205 CC: Add advanced formatting null settings notice (#4661) 2025-10-16 23:41:08 +03:00
Cohee 41c048ed35 Fix formatting in messageEditCancel 2025-10-16 23:30:15 +03:00
Cohee 59a80fb0a0 getContext: export showSwipeButtons/hideSwipeButtons 2025-10-16 23:22:34 +03:00
37271ddad4 Extracted messageEdit and messageEditCancel from .mes_edit and .mes_edit_cancel (#4633)
* Extracted `messageEdit` and `messageEditCancel` from `.mes_edit` and `.mes_edit_cancel`

* Fixed.
https://github.com/SillyTavern/SillyTavern/pull/4633#discussion_r241505
https://github.com/SillyTavern/SillyTavern/pull/4633#pullrequestreview-3316588180

* Fixed..
https://github.com/SillyTavern/SillyTavern/pull/4633#issuecomment-3383321321
https://github.com/SillyTavern/SillyTavern/pull/4633#pullrequestreview-3316602505

* Fixed...

* Fixed....
https://github.com/SillyTavern/SillyTavern/pull/4633#discussion_r2415124843
https://github.com/SillyTavern/SillyTavern/pull/4633#discussion_r2415124845

* Fix type conversion errors

* Fix type error

* Fix being unable to close message edit on first message with escape

* Fixed.
https://github.com/SillyTavern/SillyTavern/pull/4633#issuecomment-3412364573

Another bug found (sorry):
Open edit on the last message, move it up, then move it back down. Swipe buttons appear, as far as I understand your intention, they shan't.

* showSwipeButtons: return early if message edit is open

---------

Co-authored-by: user <user@exmaple.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-10-16 23:20:47 +03:00
Cohee 74c158bd2e Merge pull request #4656 from SillyTavern/staging
Staging
2025-10-16 20:31:22 +03:00
Cohee 91112362af Fix isClaude3or4 for OR caching 2025-10-15 22:59:41 +03:00
Cohee bd30a31815 Forgor context size 2025-10-15 21:30:52 +03:00
Cohee 23a59f27f1 claude-haiku-4-5 2025-10-15 21:27:46 +03:00
Cohee 10ebf09438 Fix control binds in gpt-sovits provider
Fixes #4655
2025-10-15 20:10:26 +03:00
Cohee 87d33b4d0b Highlight just imported chats in the list 2025-10-15 01:12:29 +03:00
Cohee b2c3f749d2 1.13.5 2025-10-15 00:56:03 +03:00
Cohee 3234045d64 Add bulk and drag&drop to chats import (#4652)
* Add bulk and drag-drop to chats import

* Perform list refresh only once
2025-10-15 00:43:30 +03:00
Cohee 0748af59e3 Fix missing swipe_info on first messages 2025-10-13 01:16:06 +03:00
Cohee a559f45ad4 Fix off-by-one cases in user prompt filler logic (#4648)
* Fix off-by-one cases in user prompt filler logic
Fixes #4645

* Skip inject pre-allocation in CC prompts

* Fix filler insert on continuing on user message
2025-10-12 23:36:17 +03:00
IceFog72 2ef9b3977b groupMemberListPopout placement (#4649)
`$('body').append(newElement);` -> `$('#movingDivs').append(newElement);`
2025-10-12 22:53:01 +03:00
LandCohee b7f93b3594 expose openThirdPartyExtensionMenu for Video Avatar extension (#4646)
* init

* Use less egregious export method

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-10-11 22:13:18 +03:00
df7f046912 Preset Regex: add preset type for script regexes (#4642)
* feat: preset regex

* refactor: unify `saveScriptsByType`

* fix: default branch for `saveScriptsByType`

* refactor: resolve some reviews

* fix: lint

* refactor: getPresetName -> getCurrentPresetName

* refactor: unify regex allow operation

* feat: notify whether to reload current chat when preset is changed

* refacotr: set timeout for reload current chat notification

* fix: _ -> lodash

* i18n

* Refactor API ID access

* refactor: replace UNKNOWN type with a separate constant

* refactor: consolidate CSS rules for scoped and preset script blocks

* Extend toast timeout

* Fix bug with moving, refactor

* Refactor bulk toggle operations

* Use for..of for preset application

* refactor: enhance parameter documentation for scriptType in regex functions

* fix: await loadRegexScripts in event handlers

* fix: correct script type in saveScriptsByType for preset handling

* fix: add null checks for preset manager and API ID in regex functions

* feat: implement expandable regex script options in UI

* Always show edit/delete buttons

* Add title attribute to regex script name

* fix: correct class name for regex script display

* Remove extra paddings from script blocks

* fix: ensure preset scripts are only disallowed if currently allowed during rename

* fix: reload on bulk script toggle

* feat: add PRESET_RENAMED_BEFORE event type and emit it during preset renaming

* fix: always preserve preset extensions on rename

* Handle horde in getPresetManager

---------

Co-authored-by: ZoinkCN <zoinkcn@outlook.com>
Co-authored-by: StageDog <aksanajw845@gmail.com>
2025-10-11 22:10:06 +03:00
Cohee e4d779d450 NanoGPT: Add reasoning content display
Fixes #4643
2025-10-11 00:26:45 +03:00
CoheeandWolfsblvt df8f2a477a feat: prevent scrolling of containers when using focused number inputs (#4629)
* feat: prevent scrolling of containers when using focused number inputs
#4607

* feat: enhance number input wheel behavior with slider sync and Firefox support

* refactor: optimize number input wheel handler with native DOM methods and type checks

* Refactor: Move into dom-handlers folder

* refactor: use optional chaining for slider element selection

* Simplify file paths

* Unlock scroll to edit in misc controls

* refactor: throttle wheel event handler updates

* refactor: Extract value update into a function

* fix: NaN-aware value clamping

* fix: Add sanity checks for input value calculations

---------

Co-authored-by: Wolfsblvt <wolfsblvt@gmail.com>
2025-10-10 21:42:44 +03:00
Cohee aaad129d1b Add missing props to ConnectionProfile typedef 2025-10-10 20:43:11 +03:00
bmen25124 d48a3639ed Added "custom_prompt_post_processing" to custom-request (#4639) 2025-10-10 20:37:23 +03:00
Mijyuoon 7944b7c7ff Add required icon sizes for PWAs on Firefox for Android (#4641) 2025-10-10 20:35:29 +03:00
cloak1505andCohee bc40d93b49 Remove dead Gemini 1.5 models, and clean up (#4636)
* Remove dead Gemini 1.5 models, and clean up

* Remove dead models (error 404): Gemini 1.5, `gemini-2.5-pro-exp-03-25`, `gemini-2.5-flash-preview-04-17`
* Adjust the Gemini → descriptions
* Assign default models to 2.5 Pro and Sonnet 4.5 (3.5 and 3.7 will be retiring soon)
* Add `gemini-2.5-flash-image`

* Don't forget learnlm-1.5-pro

* Update default claude

* Vertex: Clean-up 2.5 preview models

* Disable thinking for 2.5-flash-image

* Bring back banana preview

* Update defaults in more places

* Add gemini preview-09-2025 and robotics-er

* unbrick my last commit

* Add gemini-robotics-er to captions

* Set max context for gemini-robotics-er

dang

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-10-10 20:11:04 +03:00
Wolfsblvt 5fd64bef2e fix: improve bot detection and event filtering in GitHub workflow conditions 2025-10-09 00:24:04 +02:00
Cohee 20c7286ea1 Webpack: Only serve lib.js under root path 2025-10-09 01:22:10 +03:00
Wolfsblvt 59d4c7f5d7 fix: restrict app token generation to internal PRs and add fallback auth token (on PR comments) 2025-10-09 00:02:39 +02:00
Cohee 780633e05a text-embedding-005 2025-10-08 21:24:55 +03:00
Rivelle a418ad0f14 Add -webkit-tap-highlight-color for smoother touch experience (#4630)
* Add interactable outline color CSS variables

Introduces --interactable-outline-color and --interactable-outline-color-faint variables to the body style, both set to transparent for future use in styling interactive elements.

* Update global styles and remove unused CSS variables

Added -webkit-tap-highlight-color to the universal selector for improved touch experience.
2025-10-08 19:46:43 +03:00
Cohee 2929ae66ad Remove recursive subtitution in getOutletPrompt 2025-10-08 10:49:49 +00:00
Cohee 21eee36eb3 Regex: Re-export getRegexScripts for legacy extensions 2025-10-08 09:26:06 +00:00
Cohee 9dddbbb04a Regex: Code clean-up (#4628)
* Add confirmation for bulk move, add UNKNOWN type, improve JSDoc

* Fix toggle all bulk move visibility

* Improve function documentation

* Refactor currentChatId check and improve JSDoc for getScriptDecorators function

* Check against known values in moveRegexScript

* Fix console warning spam

* Simplify currentChatId check

* Prevent moving scripts into the void

* Make texts translatable
2025-10-07 23:49:20 +03:00
StageDogandZoinkCN f15c91fa8e Preset Regex: refactor regex scope detection (#4618)
* refactor: explicit type for regex scope + feat: bulk move regex

* fix: eslint

* i18n: polish

* refactor: jsdoc + use object type for option

* fix: default return type for `getScriptsByType`

* refactor: simplify

* refactor: share default options

* refactor: remove unrequired css

* fix: move regexes to global + refactor: make regex operation interfaces more consistant

---------

Co-authored-by: ZoinkCN <zoinkcn@outlook.com>
2025-10-07 22:30:11 +03:00
Cohee 7296d89b58 Update PR template 2025-10-07 21:58:29 +03:00
Cohee 96ae49a89f Update contribution guidelines (#4613)
* Update contribution guidelines

* fix: language in CONTRIBUTING.md

* Updated language to clarify the role of maintainers in PR reviews.

* Update section title for AI coding assistance tools

* Update CONTRIBUTING.md

* 200
2025-10-07 21:57:42 +03:00
Wolfsblvt 01e3880587 refactor: add has() and get() to MacrosParser (#4626) 2025-10-07 21:19:24 +03:00
Wolfsblvt 806726d737 Workflows Switch all to use app token/app for any PR/issue labeling/commenting action (#4624)
* ci: switch workflows to use app token/app id authentication

* That wasn't supposed to go in this PR

* chore: refactor to local token minting step [Test]

* chore: expose token output from setup-app-token action and add PR checkout step

* ci: replace checkout and custom app token with create-github-app-token action in PR merge conflict workflow

* ci: add test label action to PR conflict check workflow

* another test...

* I am losing my sanity

* can this work now? please? This action adds my debug level?

* it needs to run always

* let's do it via curl...?

* why did it (totally not me) remove the always() again

* Sorry I screamed at you, Qwen. Does this work?

* refactor: consolidate GitHub App token creation into individual jobs

* chore: remove debug label functionality from merge conflict workflow

* chore: let's figure out why labeler is not behaving

* chore: remove temporary GitHub API token validation check from PR workflow

* ci: ensure workflow jobs run regardless of previous job failures by adding if: always()
2025-10-07 20:49:32 +03:00
Cohee 9a56a2ba2e Workflow: Update private key secret for GitHub app token 2025-10-07 17:01:28 +03:00
WolfsblvtandCohee f88ba369dd Workflows: Replace ISSUES_BOT_TOKEN with GitHub App for labeling + 'against release' auto comment (#4621)
* ci: replace ISSUES_BOT_TOKEN with GitHub App authentication for PR auto-labeling workflow

* Update PR auto comments for target branch guidance

Added note about changing target branch for PRs.

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-10-07 16:55:15 +03:00
TrahlocandTrahloc c14d88dbe0 Fix font size difference in API Connections dropdowns (#4620)
- Fixes visual inconsistency between 'Enter a Model ID' input and 'Available Models' dropdown
- Uses calc(var(--mainFontSize) * 0.95) to match the slightly smaller font size of the dropdown
- Resolves issue #4599

This is the most minimal fix that targets only the specific element causing the visual difference.

Co-authored-by: Trahloc <trahloc@hearth.trahloc.com>
2025-10-07 16:11:18 +03:00
StageDogandZoinkCN 72f91bcf83 Preset Regex: event change (#4616)
* feat: PRESET_RENAMED event

* fix: emit PRESET_DELETED only when the deletion successes

---------

Co-authored-by: ZoinkCN <zoinkcn@outlook.com>
2025-10-07 15:27:10 +03:00
IceFog72 d3019c7d49 Summarize Popout placement (#4615)
$('body').append(newElement); -> $('#movingDivs').append(newElement);
2025-10-07 00:13:34 +03:00
Wolfsblvt 74ff23ec0c fix: remove focus call before keyup event dispatch that traps cursor (#4607) 2025-10-06 23:25:49 +03:00
WolfsblvtandCohee 9463d1a152 Reprint non-tainted group chat on switching personas (#4603)
* fix: reprint non-tainted group chat on switching personas

* feat: mark chat as tainted when sending user message

* feat: mark chat as tainted when adding custom messages or captions

* feat: export createOrEditCharacter function and integrate it into retriggerFirstMessageOnEmptyChat

* fix: optimize loadPersonaForCurrentChat by storing current chat ID in a variable

* Improve conditions of first message retrigger

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-10-06 22:45:26 +03:00
befb2ffb78 deleteSwipe now emits the deleted message Id. (#4609)
* deleteSwipe now emits the deleted message Id.

* Fixed:

this_edit_mes_id can be a string (don't ask). Either wrap it in parseInt or Number function
https://github.com/SillyTavern/SillyTavern/pull/4609#discussion_r2405534766

I think it's better to use messageId in naming. Most of weirdly abbreviated params and variables come way back from TavernAI code.
https://github.com/SillyTavern/SillyTavern/pull/4609#discussion_r2405537550

* Revert outside number conversions

---------

Co-authored-by: user <user@exmaple.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-10-06 22:10:13 +03:00
StageDog aa699a3f93 feat: emit dryRun when GENERATE_AFTER_DATA (#4614) 2025-10-06 22:04:04 +03:00
Wolfsblvt c4cb0b783a security: update GitHub workflows to use ISSUES_BOT_TOKEN instead of GITHUB_TOKEN (#4606) 2025-10-06 11:33:38 +03:00
WolfsblvtandCohee 39fd16fe86 Fix not jumping twice to group chat when creating a new group chat with deleting the old one (#4602)
* fix: do not jumo to chat twice on new group chat with delete

* fix: prevent metadata reset when deleting non-active group chat

* Bring back group chat splice call

* Always delete past group metadata on chat delete

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-10-06 11:25:38 +03:00
WolfsblvtandCohee a65f708fd8 Allow create new world books via /getpersonabook and /getcharbook (#4597)
* feat: allow create new world books via /getpersonabook and /getcharbook

Refactor character world info management into dedicated functions

Extract character world assignment logic from UI handlers into reusable functions
Add support for automatic lorebook creation in slash commands
Improve code maintainability by centralizing world info operations

* refactor: update boolean enum provider from onOffToggle to trueFalse in world info commands

* fix: improve world info name uniqueness check using getUniqueName utility

* Unset current persona WI on file deletion

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-10-05 16:41:54 +03:00
Wolfsblvt 23b1360204 fix: add optional chaining to prevent undefined error when accessing first_mes (#4601) 2025-10-05 01:41:04 +03:00
Jakub JędrzejczykandCohee e68f9e482e Authentik automatic login support (#4600)
* feat: authentik auto login

* refactor: move SSO login configuration under sso section in config

* Migrate SSO config keys read

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-10-04 23:47:43 +03:00
Wolfsblvt d56c649d86 style: hide self-responses label when activation strategy is not natural (#4593) 2025-10-04 13:30:11 +03:00
Wolfsblvt 08f48a9867 fix: enable character source (open link) when group is selected (#4592) 2025-10-04 13:26:13 +03:00
Wolfsblvt 06f5cea402 Fix group chat on new chat not respecting saved persona connections (#4594)
* fix: (new) group chat doesn't respect persona connections

Fixes #3876

* refactor: simplify persona connection filtering with destructuring and type comparison

* fix: remove redundant type check in persona connection filtering logic

(char avatar and group key *should* always be unique and different anyway, no need to check on type. Makes this more flexible)
2025-10-04 13:24:49 +03:00
Cohee 334a5409a0 Persona description editor expand (#4591)
* Enhance persona description section with expandable editor icon

* Fix selector for persona description update to use data attribute
2025-10-04 13:15:32 +03:00
Cohee 326d1c34c8 Emit event on message swipe deletion (#4590)
Closes #4567
2025-10-03 21:20:29 +03:00
WolfsblvtandCohee df2dee8482 Fix make /profile await the for an actual successful API connection (#4589)
* fix: add connection status check after profile switch in connection manager

Fixes #4262

* feat: add timeout parameter to connection manager await functionality & catch timout error

* Add rejectOnTimeout option to waitUntilCondition

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-10-03 20:43:35 +03:00
Cohee 654ddb1608 Emit prompt events in generateRaw (#4587)
Closes https://github.com/SillyTavern/Extension-PromptInspector/issues/4
2025-10-03 19:50:01 +03:00
WolfsblvtandCohee 3e3dfbe05e Small change, (visually) disable "Link to Source" on characters that weren't downloaded from a source (#4588)
* feat: enable character source dropdown based on availability and style disabled options

* feat: emit event when character is in right character panel

* refactor: rename CHARACTER_SELECT_SELECTED event to CHARACTER_EDITOR_OPENED for clarity

* Always disable source option when peeking in groups

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-10-03 19:48:13 +03:00
Wolfsblvt c9e022a790 gitignore vscode workspaces 2025-10-03 08:16:00 +02:00
shanmaocc 58a294639a Fix duplicate CHARACTER_MESSAGE_RENDERED events during streaming (#4584)
Refer to line 5771, where is correct, but the branch is not added, resulting in the branch being triggered once here when the streaming is completed, and finally the streaming is triggered again. In fact, it should not be triggered here
2025-10-02 23:56:45 +03:00
WolfsblvtandCohee 7bedaed92c Extend Update/Replace character function to replace directly from URL + Fixes on cached thumbnail (#4581)
* refactor: allow popup okButton and cancelButton to be set to false to hide them, even if visible by default

* feat: add character replacement from online source URL

- add utility function to import anything from external URL (refactored from existing function)
- fix character replace toast showing "Created"
- fix thumbnails not refreshing for replaced char
- fix accidentally creating new chat on replace, instead of reloading the open chat

* fix: refresh avatar thumbnail only after successful character import and when character exists

* chore: fix lint, unused import

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-10-02 23:05:19 +03:00
Wolfsblvt 1d1b606f72 fix: prevent duplicate tag imports by filtering already assigned tags, fixing an unintended error toast (#4582) 2025-10-02 21:30:39 +03:00
Cohee 1d279e500e Allow saving empty secrets via secret manager and slash command (#4580)
* Allow saving empty secrets via secret manager and slash command
Closes #4577

* Fix logic on cancel

* Fix /secrets-read with empty secret value
2025-10-02 21:23:42 +03:00
Quairon-Nailo 8a5531b4ec feat: Add {{notChar}} macro for participant list (#4579)
* feat: Add {{notChar}} macro for participant list

* implement impersonation logic consistently.

* docs: Document the new {{notChar}} macro

* docs: Fix format for {{notChar}} and remove examples.

* docs: Add span tag

* docs: fix extra quote mark

* docs: Add suggested fixes
2025-10-02 21:05:52 +03:00
WolfsblvtandCohee d2f3a85742 Fix MiniMax (TTS) pitch on API calls being the wrong range (#4578)
* fix: change MiniMax TTS pitch from float range 0.5-2.0 to integer range -12 to 12

Fixes #4570

* refactor: replace hardcoded defaults with defaultSettings in MiniMaxTtsProvider config

* refactor: restructure TTS settings with min/max ranges and add value clamping, adjust volume range

* fix: flatten MiniMaxTtsProvider settings to use default values from complex field definitions

* Adjust block spacing

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-10-02 21:03:22 +03:00
DeclineThyselfanduser 9415185a89 Performance improvements due to using chatElement instead of $('#chat'). (#4576)
* Performance improvements due to using chatElement instead of $('#chat').

* Reverts change `hideSwipeButtons()` change.

https://github.com/SillyTavern/SillyTavern/pull/4576#discussion_r2394996102

---------

Co-authored-by: user <user@exmaple.com>
2025-10-01 22:49:13 +03:00
LandCohee 7f9cbb04c6 Scroll to top button (#4569)
* init

* implement review suggestions

* remove unnecessary css variables

* respect reduced motion

* simplify setupScrollToTop call

* power_user flag fix

* simplify, more of above

* remove remove button when drawer is closed logic

* throttle scroll checker

* Fix review comments

* Make scrollToTop a shared function

* Refactor logic

* Replace on hover color

* Prefer theme colors for button

* Increase hover brightness for scroll-to-top button

* Clean-up diff

* Fix type annotation

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-10-01 19:47:00 +03:00
Cohee 873868389c Use textContent for copy from codeblocks 2025-09-30 00:15:37 +03:00
Cohee d3774fec96 Check if messages is array before applying cache setting
Fixes #4564
2025-09-29 23:58:05 +03:00
Cohee dd2011f5be Streaming fade-in animation (#4568)
* [wip] Add stream fade-in effect for message text and corresponding CSS animation

* Avoid using temporary element during text segmentation

* Add fade in toggle

* Skip whitespace-only nodes

* Fade-in reasoning stream

* Fix case when segmenter is not supported
2025-09-29 23:32:41 +03:00
Cohee c4cc6f611e claude-sonnet-4-5 2025-09-29 23:22:12 +03:00
Cohee d73fd1a0e5 Merge branch 'release' into staging 2025-09-25 22:20:30 +03:00
dependabot[bot] 8f7b6b43c3 Bump tar-fs from 3.0.9 to 3.1.1 in /tests (#4561)
Bumps [tar-fs](https://github.com/mafintosh/tar-fs) from 3.0.9 to 3.1.1.
- [Commits](https://github.com/mafintosh/tar-fs/compare/v3.0.9...v3.1.1)

---
updated-dependencies:
- dependency-name: tar-fs
  dependency-version: 3.1.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-25 22:19:56 +03:00
André M PivaandCohee 0f49a059e3 Feat: add first and last buttons to pagination component (#4560)
* add first and last buttons to pagination

* Add i18n support

* Update pagination buttons font

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-09-25 20:42:47 +03:00
Cohee a3e47ce0a6 Remove bg lock/unlock toasts 2025-09-25 20:13:44 +03:00
LandCohee 4127b688c9 Update BG header layout (#4519)
* init

* cleanup

* logic changes and some styling

* set z index to a reasonable value

* remove pointless animation

* cleanup

* restore animation

* checkmark icon on selected background

* drop shadow

* tweak size slightly

* Apply suggestion from @Cohee1207

condense

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>

* more of the above

* make lock indicator use a class like the selection indicator

* make backgroundHighlight run on page load

* cleanup

* html restructure and display: contents. only issue left is slightly wonky desktop buttons order

* yellow lock icon for consistancy

* Update layout

* Restore fitting logic

* Styles clean-up

* Remove duplicate class

* Restore button titles

* Fix return types of slash commands

* Update locked background on select if lock status is on

* Force header to 100% width

* Clean-up styles

* Fix locked highlight on custom backgrounds

* Revert global lock button

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-09-25 20:12:12 +03:00
WolfsblvtandCohee c9419a383e Fix creator notes display field (in char panel) not updating when changed in Advanced Definitions (#4552)
* feat: update creator notes display when editing character and updating content

* Fix interaction with create form

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-09-23 21:58:20 +03:00
Cohee 45a7c6b2aa Assets: Display extension author in the list (#4551)
* Assets: Display extension author in the list

* Fix overflow of long text
2025-09-23 15:00:11 +03:00
Cohee f838d5c88d Fix WI AN position, break outlets in AN
Fixes #4554
2025-09-23 10:53:38 +00:00
Cohee 85fc7fe971 Fix: Close chat before performing deletion (#4545) 2025-09-22 00:59:46 +03:00
equal-l2 2679020ecd Add new Grok models (#4541)
* Add new Grok models

* Fix xAI request fields filtering

* Fetch xAI model lists from API
2025-09-21 17:41:39 +03:00
Cohee 8d19a6e77f Firefox: Fix parsing of style tags in creators notes 2025-09-21 01:37:33 +03:00
Cohee 64d7865837 Caption: Add refresh models button 2025-09-21 00:50:40 +03:00
Cohee 00cd7f8180 Mistral: Remove hard coded model lists 2025-09-20 20:42:14 +03:00
Cohee 3246d2960c Gemini: Fix parsing multiple tool calls in one response
Fixes #4537
2025-09-20 20:24:42 +03:00
Cohee 068ddd7c94 Mistral: Load caption models from endpoint 2025-09-20 00:22:12 +03:00
Cohee deec251f09 Return newline at the end of styles 2025-09-18 21:20:55 +03:00
Cohee 4e01c9c0dc Use variable for mobile jumbo list button 2025-09-18 21:19:44 +03:00
7cba4e88ab Add new WI position 'outlet' to expose WI entries triggered to be placed as macros literally anywhere (#4523)
* feat: add outlet prompt support for world info entries

* feat: add outlet name field with autocomplete for world info entries

* feat: add outlet entries for world info support to WI parsing

* feat: add tooltip and validation for WI outlet name entries

* Trim macro outlet name

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

* refactor: consolidate WI injection cleanup and fix strict equality comparison

* fix: update outlet macro regex pattern to use double colon delimiter

* fix: replace carriage returns with newlines in WI entry outlet tooltip

* fix: add null checks and array validation for WI outlet entries handling

* feat: add outletName field to world info entry definition schema (supports /setwientryfield command)

* fix: add outletName field to export of character lore books

* do not remove outlet name on position change, but filter out for auto complete

* Match WI extensions field name

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>

* outlet name being used in char WI import too

* docs: add outlet macro documentation to help template

* be explicit about risu/novel/agnai wi not supporting outlets

* Inject A/N and TC sysprompt after populating outlets

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-09-18 21:12:14 +03:00
RossAscends 1fe8d96ab2 revert mobile char panel autoclose 2025-09-18 07:53:28 +09:00
RossAscends 97e4b41bc2 mobile: only autoclose char panel if it's actually open 2025-09-18 03:42:20 +09:00
RossAscends 1e7309fa17 i forgor one of em 2025-09-17 20:46:49 +09:00
RossAscends 2c25b5f012 completely ignore panel pins on mobile 2025-09-17 20:44:11 +09:00
RossAscends 136ddbc079 vert center mobile char list back button 2025-09-17 19:29:02 +09:00
RossAscends a0b2b740c9 Merge branch 'staging' of github.com-RA:sillytavern/sillytavern into staging 2025-09-17 18:19:59 +09:00
RossAscends 9298a34fea mobile fixes: close charlist on char select, hide L/R panel locks, larger charlist back button 2025-09-17 18:19:55 +09:00
Cohee ab66a9fed1 Caption: Rename Anthropic => Claude 2025-09-17 07:58:13 +00:00
07a4007363 feat: [Electron Hub] Added Text-to-Speech, Prompt cost, Sort/Group/Se… (#4528)
* feat: [Electron Hub] Added Text-to-Speech, Prompt cost, Sort/Group/Search for model list

* feat: [Electron Hub] Added Text-to-Speech, Prompt cost, Sort/Group/Search for model list

* Update public/scripts/extensions/tts/electronhub.js

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

* Update public/scripts/openai.js

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

* Update public/scripts/openai.js

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

* feat: [Electron Hub] Added Text-to-Speech, Prompt cost, Sort/Group/Search for model list

* feat: [Electron Hub] Show model capabilities

* Support logit_bias

* Small tweaks

* Added tokenizer selection logic

* Added tokenizer selection logic

* Fixed ESLint

* Small tweaks

* Split localization tags

* Fix formatting

* Refactor icons, add tool icon

* Support newer oai model tokenizers

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-09-16 22:22:27 +03:00
LandCohee eec837cee6 Layout Update (#4514)
* init

* mostly working messy version

* css layout, mobile is fixed

* revert changes

* more of the above

* cleanup

* revert breaking fixes, cleanup dead code

* dead code

* delete fallback

* spacing

* css tweaks and removed getChatBackgroundsList

* mobile sizing

* revert unrelated changes

* use name instead of context

* debounce from constants.js

* replace if/else

* pass images directly

* more of the above

* buttons

* buttons functionality

* add default column counts

* remove .mobile-only-menu-toggle when clicked (layering fix)

* lint

* universal column default of 3

* sacrifice firefox for chrome

* Restore media query

This reverts commit 295a5a8190.

* Add disabled attribute styles for menu_button

* use opacity 0, pointer events none instead of display:none

* Format styles

* Fix type errors

* Add blur event handler to close mobile menu when focus is lost

---------

Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-09-16 13:20:06 +03:00
RossAscends 33458b86b0 Merge branch 'staging' of github.com-RA:sillytavern/sillytavern into staging 2025-09-16 00:44:52 +09:00
RossAscends 76d48bf8f8 nomnalize TGWebUI grammar string HTML nest 2025-09-16 00:44:48 +09:00
L 9b0e84832f div id="logo block" update (#4524) 2025-09-15 10:06:52 +03:00
L 5170984446 Backgrounds Drawer Max Height (#4515)
* init

* lint

* shrink drawer, plus why is css messy

* put questionable hint back in

* copy other drawers
2025-09-15 09:50:29 +03:00
GoldenglowMeow e0edd57653 fix(perf): disable periodic expired item check in node-persist (#4521) 2025-09-14 21:00:17 +03:00
RossAscends 4d366e463d Merge branch 'staging' of github.com-RA:sillytavern/sillytavern into staging 2025-09-15 02:59:31 +09:00
RossAscends b814e29d40 show grammar string input in tabby API samplers list 2025-09-15 02:59:24 +09:00
1e05eac7df Update ru-ru locale (#4522)
* Work on tl

* eslint fix

* Update data-i18n attribute for expand view button

* Add data-i18n to button

---------

Co-authored-by: Yokayo <nonameutubecomm@gmail.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
2025-09-14 20:57:33 +03:00
Cohee 23e5a7ca38 Fix prompt cost block showing when switching API type to TC and type is not OpenRouter 2025-09-14 20:46:53 +03:00
RossAscends f1dd51867d standardize ooba logit bias HTML nest 2025-09-15 02:27:57 +09:00
RossAscends 5c0e2e7c96 more TGWebUI sampler HTML nest cleanup 2025-09-15 01:53:52 +09:00
RossAscends 0795e397a6 standardize TGwebui sampler toggle HTML nests 2025-09-15 00:23:51 +09:00
Cohee aec8b8db2a Docker: Update base image to node:lts-alpine3.22 2025-09-13 23:21:16 +03:00
Cohee 8f68b2cae9 Actions: Update Node version in npm publish workflow 2025-09-13 23:13:00 +03:00
Cohee f53f039452 Fix toast position on app init 2025-09-13 21:23:11 +03:00
497 changed files with 69561 additions and 18566 deletions
+57 -12
View File
@@ -1,17 +1,62 @@
# --- Git & CI ---
.git
.github
.vscode
node_modules
npm-debug.log
readme*
Start.bat
/dist
/backups
cloudflared.exe
access.log
/data
/cache
.DS_Store
.gitignore
# --- Docker ---
/Dockerfile
/.dockerignore
/docker/docker-compose.yml
/docker/config
/docker/extensions
/docker/data
/docker/plugins
/docker/dist
/public/scripts/extensions/third-party
# --- Plugins (keep only package files) ---
/plugins/*
!/plugins/package.json
!/plugins/package-lock.json
# --- The Folders ---
/backups
/cache
/colab
/data
/dist
/node_modules
/tests
# --- Sensitive Info ---
**/.env*
**/*.pem
**/certs
# --- Documentation ---
readme*
*.md
Update-Instructions.txt
# --- OS & System Junk ---
**/.DS_Store
*.bat
*.cmd
*.exe
start.sh
# --- Dev Config ---
.editorconfig
.eslintrc.cjs
.eslintrc*
.vscode
**/jsconfig.json
.npmignore
.gemini
replit.nix
.replit
.nomedia
# -- Logs & Temp ---
*.log
**/tmp
+25 -1
View File
@@ -70,6 +70,7 @@ module.exports = {
'**/dist/**',
'**/.git/**',
'public/lib/**',
'public/scripts/extensions/third-party/**',
'backups/**',
'data/**',
'cache/**',
@@ -98,9 +99,32 @@ module.exports = {
'no-cond-assign': 'error',
'no-unneeded-ternary': 'error',
'no-irregular-whitespace': ['error', { skipStrings: true, skipTemplates: true }],
'dot-notation': ['error', { 'allowPattern': '[A-Z]\\w*$' }],
// These rules should eventually be enabled.
'no-async-promise-executor': 'off',
'no-inner-declarations': 'off',
// Additional formatting rules based on codebase conventions
'brace-style': ['error', '1tbs', { allowSingleLine: true }],
'array-bracket-spacing': ['error', 'never'],
'computed-property-spacing': ['error', 'never'],
'block-spacing': ['error', 'always'],
'keyword-spacing': ['error', { before: true, after: true }],
'space-before-blocks': ['error', 'always'],
'space-before-function-paren': ['error', { anonymous: 'always', named: 'never', asyncArrow: 'always' }],
'space-in-parens': ['error', 'never'],
'comma-spacing': ['error', { before: false, after: true }],
'key-spacing': ['error', { beforeColon: false, afterColon: true }],
'func-call-spacing': ['error', 'never'],
'no-multiple-empty-lines': ['error', { max: 2, maxEOF: 1, maxBOF: 0 }],
'padded-blocks': ['error', 'never'],
'no-whitespace-before-property': 'error',
'space-unary-ops': ['error', { words: true, nonwords: false }],
'arrow-spacing': ['error', { before: true, after: true }],
'template-curly-spacing': ['error', 'never'],
'rest-spread-spacing': ['error', 'never'],
'generator-star-spacing': ['error', { before: false, after: true }],
'yield-star-spacing': ['error', { before: false, after: true }],
'template-tag-spacing': ['error', 'never'],
'switch-colon-spacing': ['error', { after: true, before: false }],
},
};
+10
View File
@@ -41,6 +41,16 @@ labels:
🔬 This PR needs testing!
Any contributor can test and leave reviews, so feel free to help us out!
- name: ❗ Against Release Branch
labeled:
pr:
body: >
❗ This PR is against the `release` branch.
Please make sure this was intended, and you did not want to target the `staging` branch. Only hotfixes, readme changes and similar should be made against `release`.
You can change the target branch **without recreating the PR** by clicking "Edit" at the top of the page.
- name: 🟥 ⬤⬤⬤⬤⬤
labeled:
pr:
+7 -1
View File
@@ -1,5 +1,11 @@
<!-- Put X in the box below to confirm -->
<!--
Adding a new named external provider or service?
Read https://docs.sillytavern.app/for-contributors/provider-integrations/
before implementing or submitting it, and link the prior issue when the guide requires one.
-->
## Checklist:
- [ ] I have read the [Contributing guidelines](https://github.com/SillyTavern/SillyTavern/blob/release/CONTRIBUTING.md).
- [ ] I have read the [Contribution guidelines](https://github.com/SillyTavern/SillyTavern/blob/release/CONTRIBUTING.md).
+1 -1
View File
@@ -36,7 +36,7 @@ Angefangen im Februar 2023 als Fork von TavernAI 1.2.8 hat SillyTavern nun über
## Brauche ich einen leistungsstarken PC, um SillyTavern auszuführen?
Die Hardwareanforderungen sind minimal: Es läuft auf allem, was NodeJS 18 oder höher ausführen kann. Wenn du LLM-Inferenz auf deinem lokalen Rechner durchführen möchtest, empfehlen wir eine NVIDIA-Grafikkarte der 3000er-Serie mit mindestens 6 GB VRAM, aber die tatsächlichen Anforderungen können je nach Modell und Backend, das du verwendest, variieren.
Die Hardwareanforderungen sind minimal: Es läuft auf allem, was NodeJS 20 oder höher ausführen kann. Wenn du LLM-Inferenz auf deinem lokalen Rechner durchführen möchtest, empfehlen wir eine NVIDIA-Grafikkarte der 3000er-Serie mit mindestens 6 GB VRAM, aber die tatsächlichen Anforderungen können je nach Modell und Backend, das du verwendest, variieren.
## Fragen oder Vorschläge?
+3 -2
View File
@@ -26,7 +26,7 @@ SillyTavernは、多くのLLM API(KoboldAI/CPP、Horde、NovelAI、Ooba、Tabb
SillyTavern(略してST)は、テキスト生成LLM、画像生成エンジン、TTS音声モデルと対話するための、ローカルにインストールされるユーザーインターフェースです。
2023年2月にTavernAI 1.2.8のフォークとして始まり、SillyTavernは現在200人以上の貢献者と2年間の独立した開発を経て、知識豊富なAI愛好家のための主要なソフトウェアとして機能し続けています。
2023年2月にTavernAI 1.2.8のフォークとして始まり、SillyTavernは現在300人以上の貢献者と3年間の独立した開発を経て、知識豊富なAI愛好家のための主要なソフトウェアとして機能し続けています。
## 私たちのビジョン
@@ -36,7 +36,7 @@ SillyTavern(略してST)は、テキスト生成LLM、画像生成エンジ
## SillyTavernを実行するには強力なPCが必要ですか?
ハードウェア要件は最小限です。NodeJS 18以上を実行できるものであれば何でも動作します。ローカルマシンでLLM推論を行う場合は、少なくとも6GBのVRAMを搭載した3000シリーズのNVIDIAグラフィックスカードを推奨しますが、実際の要件は使用するモデルやバックエンドによって異なる場合があります。
ハードウェア要件は最小限です。NodeJS 20以上を実行できるものであれば何でも動作します。ローカルマシンでLLM推論を行う場合は、少なくとも6GBのVRAMを搭載した3000シリーズのNVIDIAグラフィックスカードを推奨しますが、実際の要件は使用するモデルやバックエンドによって異なる場合があります。
## 質問や提案はありますか?
@@ -79,6 +79,7 @@ SillyTavern(略してST)は、テキスト生成LLM、画像生成エンジ
* CncAnonのTavernAITurbo modの一部を許可を得て使用
* PepperTacoの作品に触発されたビジュアルノベルモード (<https://github.com/peppertaco/Tavern/>)
* GoogleによるNoto Sansフォント (OFLライセンス)
* Chevrotainによるレキサー/パーサー (Apache-2.0ライセンス) <https://github.com/chevrotain/chevrotain>
* Font Awesomeによるアイコンテーマ <https://fontawesome.com> (アイコン: CC BY 4.0, フォント: SIL OFL 1.1, コード: MITライセンス)
* @OtisAlejandroによるデフォルトコンテンツ(Seraphinaキャラクターと伝承本)と@kallmefloccによる10K Discordユーザー記念背景
* [@mrguymiah](https://github.com/mrguymiah)と[@Bronya-Rand](https://github.com/Bronya-Rand)によるDockerガイド
+1 -1
View File
@@ -36,7 +36,7 @@ SillyTavern(짧게는 ST)은 텍스트 생성 LLM, 이미지 생성 엔진, TTS
## SillyTavern을 위해서 좋은 성능의 PC가 필요한가요?
하드웨어 요구 사항은 거의 없습니다: NodeJS 18 이상을 실행할 수 있는 모든 환경에서 작동합니다. 다만 로컬 LLM 모델을 사용할 경우, 최소 6GB VRAM 이상의 3000번대 NVIDIA 그래픽 카드를 권장하지만, 실제 요구 사항은 사용하는 모델과 백엔드에 따라 달라질 수 있습니다.
하드웨어 요구 사항은 거의 없습니다: NodeJS 20 이상을 실행할 수 있는 모든 환경에서 작동합니다. 다만 로컬 LLM 모델을 사용할 경우, 최소 6GB VRAM 이상의 3000번대 NVIDIA 그래픽 카드를 권장하지만, 실제 요구 사항은 사용하는 모델과 백엔드에 따라 달라질 수 있습니다.
## 질문이나 제안이 있으신가요?
+1 -1
View File
@@ -36,7 +36,7 @@ SillyTavern (или сокращенно ST) - это локально уста
## Нужен ли мне мощный компьютер для запуска SillyTavern?
Требования к оборудованию минимальны: он будет работать на всем, что может запустить NodeJS 18 или выше. Если вы собираетесь выполнять инференс LLM на своем локальном компьютере, мы рекомендуем видеокарту NVIDIA 3000-й серии с не менее чем 6 ГБ видеопамяти, но фактические требования могут варьироваться в зависимости от модели и используемого вами бэкенда.
Требования к оборудованию минимальны: он будет работать на всем, что может запустить NodeJS 20 или выше. Если вы собираетесь выполнять инференс LLM на своем локальном компьютере, мы рекомендуем видеокарту NVIDIA 3000-й серии с не менее чем 6 ГБ видеопамяти, но фактические требования могут варьироваться в зависимости от модели и используемого вами бэкенда.
## Вопросы или предложения?
+3 -2
View File
@@ -26,7 +26,7 @@ SillyTavern 为众多 LLM API(KoboldAI/CPP、Horde、NovelAI、Ooba、Tabby、
SillyTavern(简称 ST)是一个本地安装的用户界面,允许您与文本生成 LLM、图像生成引擎和 TTS 语音模型进行交互。
SillyTavern 于 2023 年 2 月作为 TavernAI 1.2.8 的一个分支开始,如今已拥有超过 200 名贡献者和 2 年的独立开发经验,并继续作为资深 AI 爱好者领先的软件。
SillyTavern 于 2023 年 2 月作为 TavernAI 1.2.8 的一个分支开始,如今已拥有超过 300 名贡献者和 3 年的独立开发经验,并继续作为资深 AI 爱好者领先的软件。
## 我们的愿景
@@ -36,7 +36,7 @@ SillyTavern 于 2023 年 2 月作为 TavernAI 1.2.8 的一个分支开始,如
## 我需要一台性能强大的电脑来运行 SillyTavern 吗?
硬件要求很低:任何可以运行 NodeJS 18 或更高版本的设备都可以运行它。如果您打算在本地计算机上进行 LLM 推理,我们建议使用至少具有 6GB VRAM 的 3000 系列 NVIDIA 显卡,但实际要求可能会根据模型和您使用的后端而有所不同。
硬件要求很低:任何可以运行 NodeJS 20 或更高版本的设备都可以运行它。如果您打算在本地计算机上进行 LLM 推理,我们建议使用至少具有 6GB VRAM 的 3000 系列 NVIDIA 显卡,但实际要求可能会根据模型和您使用的后端而有所不同。
## 有问题或建议?
@@ -79,6 +79,7 @@ SillyTavern 于 2023 年 2 月作为 TavernAI 1.2.8 的一个分支开始,如
* CncAnon 的 TavernAITurbo mod 的部分内容经许可使用
* 视觉小说模式的灵感来自 PepperTaco 的工作 (<https://github.com/peppertaco/Tavern/>)
* Noto Sans 字体 by Google (OFL 许可证)
* Lexer/Parser 由 Chevrotain 提供 (Apache-2.0 许可证) <https://github.com/chevrotain/chevrotain>
* 图标主题 by Font Awesome <https://fontawesome.com> (图标: CC BY 4.0, 字体: SIL OFL 1.1, 代码: MIT 许可证)
* 默认内容由 @OtisAlejandro (Seraphina 角色和世界书) 和 @kallmeflocc (10K Discord 用户庆祝背景) 提供
* Docker 指南由 [@mrguymiah](https://github.com/mrguymiah) 和 [@Bronya-Rand](https://github.com/Bronya-Rand) 提供
+4 -3
View File
@@ -26,7 +26,7 @@ SillyTavern 提供一個統一的前端介面,整合多種大型語言模型
SillyTavern(簡稱 ST)是一款本地安裝的使用者介面,讓您能與大型語言模型(LLM)、影像生成引擎以及語音合成模型互動的前端。
SillyTavern 起源於 2023 年 2 月,作為 TavernAI 1.2.8 的分支版本發展至今。目前已有超過 200 位貢獻者,並擁有超過兩年的獨立開發歷史。如今,它已成為 AI 愛好者中備受推崇的軟體之一。
SillyTavern 起源於 2023 年 2 月,作為 TavernAI 1.2.8 的分支版本發展至今。目前已有超過 300 位貢獻者,並擁有超過三年的獨立開發歷史。如今,它已成為 AI 愛好者中備受推崇的軟體之一。
## 我們的願景
@@ -36,13 +36,13 @@ SillyTavern 起源於 2023 年 2 月,作為 TavernAI 1.2.8 的分支版本發
## 我需要高效能電腦才能運行 SillyTavern 嗎?
SillyTavern 的硬體需求相當低。任何能夠運行 NodeJS 18 或更高版本的設備都可以執行。若您打算在本地機器上進行 LLM 推理,我們建議使用擁有至少 6GB VRAM 的 3000 系列 NVIDIA 顯示卡,但實際需求可能因模型和您使用的後端而異。
SillyTavern 的硬體需求相當低。任何能夠運行 NodeJS 20 或更高版本的設備都可以執行。若您打算在本地機器上進行 LLM 推理,我們建議使用擁有至少 6GB VRAM 的 3000 系列 NVIDIA 顯示卡,但實際需求可能因模型和您使用的後端而異。
## 有任何問題或建議?
### 歡迎加入我們的 Discord 伺服器
| [![][discord-shield-badge]][discord-link] | [加入我們的 Disocrd 伺服器](https://discord.gg/sillytavern) 以獲得技術支援、分享您喜愛的角色與提示詞。 |
| [![][discord-shield-badge]][discord-link] | [加入我們的 Discord 伺服器](https://discord.gg/sillytavern) 以獲得技術支援、分享您喜愛的角色與提示詞。 |
| :---------------------------------------- | :----------------------------------------------------------------------------------------------------------------- |
或直接聯繫開發者:
@@ -79,6 +79,7 @@ SillyTavern 的硬體需求相當低。任何能夠運行 NodeJS 18 或更高版
* 經授權使用部分來自 CncAnon 的 TavernAITurbo 模組
* 視覺小說模式(Visual Novel Mode)的靈感,來源於 PepperTaco 的貢獻(<https://github.com/peppertaco/Tavern/>)
* Noto Sans 字體由 Google 提供(OFL 許可)
* Lexer/Parser 由 Chevrotain 提供 (Apache-2.0 許可) <https://github.com/chevrotain/chevrotain>
* 主題圖示由 Font Awesome <https://fontawesome.com> 提供(圖示:CC BY 4.0,字體:SIL OFL 1.1,程式碼:MIT 許可)
* 預設資源來源於 @OtisAlejandro(包含角色 Seraphina 與知識書)與 @kallmeflocc(SillyTavern 官方 Discord 伺服器成員突破 10K 的慶祝背景)
* Docker 安裝指南由 [@mrguymiah](https://github.com/mrguymiah) 和 [@Bronya-Rand](https://github.com/Bronya-Rand) 編寫
+5 -4
View File
@@ -23,17 +23,17 @@ We have a [Documentation website](https://docs.sillytavern.app/) to answer most
SillyTavern (or ST for short) is a locally installed user interface that allows you to interact with text generation LLMs, image generation engines, and TTS voice models.
Beginning in February 2023 as a fork of TavernAI 1.2.8, SillyTavern now has over 200 contributors and 2 years of independent development under its belt, and continues to serve as a leading software for savvy AI hobbyists.
Beginning in February 2023 as a fork of TavernAI 1.2.8, SillyTavern now has over 300 contributors and 3 years of independent development under its belt, and continues to serve as a leading software for savvy AI hobbyists.
## Our Vision
1. We aim to empower users with as much utility and control over their LLM prompts as possible. The steep learning curve is part of the fun!
2. We do not provide any online or hosted services, nor programmatically track any user data.
3. SillyTavern is a passion project brought to you by a dedicated community of LLM enthusiasts, and will always be free and open sourced.
3. SillyTavern is a passion project brought to you by a dedicated community of LLM enthusiasts, and will always be free and open source.
## Do I need a powerful PC to run SillyTavern?
The hardware requirements are minimal: it will run on anything that can run NodeJS 18 or higher. If you intend to do LLM inference on your local machine, we recommend a 3000-series NVIDIA graphics card with at least 6GB of VRAM, but actual requirements may vary depending on the model and backend you choose to use.
The hardware requirements are minimal: it will run on anything that can run NodeJS 20 or higher. If you intend to do LLM inference on your local machine, we recommend a 3000-series NVIDIA graphics card with at least 6GB of VRAM, but actual requirements may vary depending on the model and backend you choose to use.
## Questions or suggestions?
@@ -75,10 +75,11 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.**
* [TavernAI](https://github.com/TavernAI/TavernAI) 1.2.8 by Humi: MIT License
* [TavernAI](https://github.com/TavernAI/TavernAI-v1) 1.2.8 by Humi: MIT License
* Portions of CncAnon's TavernAITurbo mod used with permission
* Visual Novel Mode inspired by the work of PepperTaco (<https://github.com/peppertaco/Tavern/>)
* Noto Sans font by Google (OFL license)
* Lexer/Parser by Chevrotain (Apache-2.0 license) <https://github.com/chevrotain/chevrotain>
* Icon theme by Font Awesome <https://fontawesome.com> (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
* Default content by @OtisAlejandro (Seraphina character and lorebook) and @kallmeflocc (10K Discord Users Celebratory Background)
* Docker guide by [@mrguymiah](https://github.com/mrguymiah) and [@Bronya-Rand](https://github.com/Bronya-Rand)
+7 -7
View File
@@ -35,13 +35,13 @@ jobs:
# It's currently not possible to have `branches` under the `schedule` trigger
- name: Checkout the release branch (on release)
if: ${{ github.event_name == 'release' || github.event_name == 'push' }}
uses: actions/checkout@v4.1.2
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
with:
ref: "release"
- name: Checkout the staging branch
if: ${{ github.event_name == 'schedule' }}
uses: actions/checkout@v4.1.2
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
with:
ref: "staging"
@@ -55,13 +55,13 @@ jobs:
# Setting up QEMU for multi-arch image build
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
- name: Extract metadata (tags, labels) for the image
uses: docker/metadata-action@v5.5.1
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
id: metadata
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
@@ -74,7 +74,7 @@ jobs:
# Login into package repository as the person who created the release
- name: Log in to the Container registry
uses: docker/login-action@v3
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
@@ -84,7 +84,7 @@ jobs:
# Tag it with branch name
# Assumes branch name is the version number
- name: Build and push
uses: docker/build-push-action@v5.3.0
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
with:
context: .
platforms: linux/amd64,linux/arm64
+63 -18
View File
@@ -15,12 +15,23 @@ jobs:
label-on-content:
name: 🏷️ Label Issues by Content
runs-on: ubuntu-latest
if: always()
steps:
- name: Mint App Token
id: app
# Create a GitHub App token
# https://github.com/marketplace/actions/create-github-app-token
uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v2
with:
app-id: ${{ vars.ST_BOT_APP_ID }}
private-key: ${{ secrets.ST_BOT_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- name: Checkout Repository
# Checkout
# https://github.com/marketplace/actions/checkout
uses: actions/checkout@v4.2.2
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Auto-Label Issues (Based on Issue Content)
# only auto label based on issue content once, on open (to prevent re-labeling removed labels)
@@ -28,89 +39,123 @@ jobs:
# Issue Labeler
# https://github.com/marketplace/actions/regex-issue-labeler
uses: github/issue-labeler@v3.4
uses: github/issue-labeler@c1b0f9f52a63158c4adc09425e858e87b32e9685 # v3.4
with:
configuration-path: .github/issues-auto-labels.yml
enable-versioned-regex: 0
repo-token: ${{ secrets.GITHUB_TOKEN }}
repo-token: ${{ steps.app.outputs.token }}
label-on-labels:
name: 🏷️ Label Issues by Labels
needs: [label-on-content]
runs-on: ubuntu-latest
if: always()
steps:
- name: Mint App Token
id: app
# Create a GitHub App token
# https://github.com/marketplace/actions/create-github-app-token
uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v2
with:
app-id: ${{ vars.ST_BOT_APP_ID }}
private-key: ${{ secrets.ST_BOT_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- name: ✅ Add "👍 Approved" for relevant labels
if: contains(fromJSON('["👩‍💻 Good First Issue", "🙏 Help Wanted", "🪲 Confirmed", "⚠️ High Priority", "❕ Medium Priority", "💤 Low Priority"]'), github.event.label.name)
# 🤖 Issues Helper
# https://github.com/marketplace/actions/issues-helper
uses: actions-cool/issues-helper@v3.6.0
uses: actions-cool/issues-helper@a610082f8ac0cf03e357eb8dd0d5e2ba075e017e # v3.6.0
with:
actions: 'add-labels'
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ steps.app.outputs.token }}
labels: '👍 Approved'
- name: ❌ Remove progress labels when issue is marked done or stale
if: contains(fromJSON('["✅ Done", "✅ Done (staging)", "⚰️ Stale", "❌ wontfix"]'), github.event.label.name)
# 🤖 Issues Helper
# https://github.com/marketplace/actions/issues-helper
uses: actions-cool/issues-helper@v3.6.0
uses: actions-cool/issues-helper@a610082f8ac0cf03e357eb8dd0d5e2ba075e017e # v3.6.0
with:
actions: 'remove-labels'
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ steps.app.outputs.token }}
labels: '🧑‍💻 In Progress,🤔 Unsure,🤔 Under Consideration'
- name: ❌ Remove temporary labels when confirmed labels are added
if: contains(fromJSON('["❌ wontfix","👍 Approved","👩‍💻 Good First Issue"]'), github.event.label.name)
# 🤖 Issues Helper
# https://github.com/marketplace/actions/issues-helper
uses: actions-cool/issues-helper@v3.6.0
uses: actions-cool/issues-helper@a610082f8ac0cf03e357eb8dd0d5e2ba075e017e # v3.6.0
with:
actions: 'remove-labels'
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ steps.app.outputs.token }}
labels: '🤔 Unsure,🤔 Under Consideration'
- name: ❌ Remove no bug labels when "🪲 Confirmed" is added
if: github.event.label.name == '🪲 Confirmed'
# 🤖 Issues Helper
# https://github.com/marketplace/actions/issues-helper
uses: actions-cool/issues-helper@v3.6.0
uses: actions-cool/issues-helper@a610082f8ac0cf03e357eb8dd0d5e2ba075e017e # v3.6.0
with:
actions: 'remove-labels'
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ steps.app.outputs.token }}
labels: '✖️ Not Reproducible,✖️ Not A Bug'
remove-stale-label:
name: 🗑️ Remove Stale Label on Comment
needs: [label-on-content, label-on-labels]
runs-on: ubuntu-latest
# Only run this on new comments, to automatically remove the stale label
if: github.event_name == 'issue_comment' && github.actor != 'github-actions[bot]'
if: always() && (github.event_name == 'issue_comment' && github.event.sender.type != 'Bot')
steps:
- name: Mint App Token
id: app
# Create a GitHub App token
# https://github.com/marketplace/actions/create-github-app-token
uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v2
with:
app-id: ${{ vars.ST_BOT_APP_ID }}
private-key: ${{ secrets.ST_BOT_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- name: Remove Stale Label
# 🤖 Issues Helper
# https://github.com/marketplace/actions/issues-helper
uses: actions-cool/issues-helper@v3.6.0
uses: actions-cool/issues-helper@a610082f8ac0cf03e357eb8dd0d5e2ba075e017e # v3.6.0
with:
actions: 'remove-labels'
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ steps.app.outputs.token }}
issue-number: ${{ github.event.issue.number }}
labels: '⚰️ Stale,🕸️ Inactive,🚏 Awaiting User Response,🛑 No Response'
write-auto-comments:
name: 💬 Post Issue Comments Based on Labels
needs: [label-on-content, label-on-labels]
needs: [label-on-content, label-on-labels, remove-stale-label]
runs-on: ubuntu-latest
if: always()
steps:
- name: Mint App Token
id: app
# Create a GitHub App token
# https://github.com/marketplace/actions/create-github-app-token
uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v2
with:
app-id: ${{ vars.ST_BOT_APP_ID }}
private-key: ${{ secrets.ST_BOT_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- name: Checkout Repository
# Checkout
# https://github.com/marketplace/actions/checkout
uses: actions/checkout@v4.2.2
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Post Issue Comments Based on Labels
# Label Commenter
# https://github.com/marketplace/actions/label-commenter
uses: peaceiris/actions-label-commenter@v1.10.0
uses: peaceiris/actions-label-commenter@f0dbbef043eb1b150b566db36b0bdc8b7f505579 # v1.10.0
with:
config_file: .github/issues-auto-comments.yml
github_token: ${{ secrets.GITHUB_TOKEN }}
github_token: ${{ steps.app.outputs.token }}
+13 -2
View File
@@ -15,12 +15,23 @@ jobs:
update-linked-issues:
name: 🔗 Mark Linked Issues Done on Push
runs-on: ubuntu-latest
if: always()
steps:
- name: Mint App Token
id: app
# Create a GitHub App token
# https://github.com/marketplace/actions/create-github-app-token
uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v2
with:
app-id: ${{ vars.ST_BOT_APP_ID }}
private-key: ${{ secrets.ST_BOT_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- name: Checkout Repository
# Checkout
# https://github.com/marketplace/actions/checkout
uses: actions/checkout@v4.2.2
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Extract Linked Issues from Commit Message
id: extract_issues
@@ -31,7 +42,7 @@ jobs:
- name: Label Linked Issues
id: label_linked_issues
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ steps.app.outputs.token }}
run: |
for ISSUE in $(echo $issues | jq -r '.[]'); do
if [ "${{ github.ref }}" == "refs/heads/staging" ]; then
+41 -8
View File
@@ -15,14 +15,25 @@ jobs:
mark-inactivity:
name: ⏳ Mark Issues/PRs without Activity
runs-on: ubuntu-latest
if: always()
steps:
- name: Mint App Token
id: app
# Create a GitHub App token
# https://github.com/marketplace/actions/create-github-app-token
uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v2
with:
app-id: ${{ vars.ST_BOT_APP_ID }}
private-key: ${{ secrets.ST_BOT_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- name: Mark Issues/PRs without Activity
# Close Stale Issues and PRs
# https://github.com/marketplace/actions/close-stale-issues
uses: actions/stale@v9.1.0
uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9.1.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
repo-token: ${{ steps.app.outputs.token }}
days-before-stale: 183
days-before-close: 7
operations-per-run: 30
@@ -47,16 +58,27 @@ jobs:
await-user-response:
name: ⚠️ Mark Issues/PRs Awaiting User Response
needs: [mark-inactivity]
runs-on: ubuntu-latest
needs: mark-inactivity
if: always()
steps:
- name: Mint App Token
id: app
# Create a GitHub App token
# https://github.com/marketplace/actions/create-github-app-token
uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v2
with:
app-id: ${{ vars.ST_BOT_APP_ID }}
private-key: ${{ secrets.ST_BOT_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- name: Mark Issues/PRs Awaiting User Response
# Close Stale Issues and PRs
# https://github.com/marketplace/actions/close-stale-issues
uses: actions/stale@v9.1.0
uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9.1.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
repo-token: ${{ steps.app.outputs.token }}
days-before-stale: 7
days-before-close: 7
operations-per-run: 30
@@ -74,16 +96,27 @@ jobs:
alternative-exists:
name: 🔄 Mark Issues with Alternative Exists
needs: [mark-inactivity, await-user-response]
runs-on: ubuntu-latest
needs: await-user-response
if: always()
steps:
- name: Mint App Token
id: app
# Create a GitHub App token
# https://github.com/marketplace/actions/create-github-app-token
uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v2
with:
app-id: ${{ vars.ST_BOT_APP_ID }}
private-key: ${{ secrets.ST_BOT_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- name: Mark Issues with Alternative Exists
# Close Stale Issues and PRs
# https://github.com/marketplace/actions/close-stale-issues
uses: actions/stale@v9.1.0
uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9.1.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
repo-token: ${{ steps.app.outputs.token }}
days-before-stale: 7
days-before-close: 7
operations-per-run: 30
+31 -12
View File
@@ -1,4 +1,4 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# Publish to npm for a new release or explicitly retry an existing release tag.
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
name: Node.js Package
@@ -6,27 +6,46 @@ name: Node.js Package
on:
release:
types: [created]
workflow_dispatch:
inputs:
tag:
description: Existing release tag to publish
required: true
type: string
env:
PUBLISH_TAG: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.event.release.tag_name }}
PUBLISH_REF: ${{ github.event_name == 'workflow_dispatch' && format('refs/tags/{0}', inputs.tag) || github.ref }}
permissions:
id-token: write # Required for OIDC
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
with:
node-version: 16
- run: npm ci
ref: ${{ env.PUBLISH_REF }}
- uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # v3
with:
node-version: 24
- name: Verify release tag matches package version
run: test "$(node -p "require('./package.json').version")" = "$PUBLISH_TAG"
- run: npm ci --omit=dev --ignore-scripts
publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
with:
node-version: 16
ref: ${{ env.PUBLISH_REF }}
- uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # v3
with:
node-version: 24
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
- run: npm ci --omit=dev --ignore-scripts
# https://github.com/npm/cli/issues/9755
- run: npm publish --allow-directory=all
+13 -2
View File
@@ -15,14 +15,25 @@ jobs:
remove-labels:
name: 🗑️ Remove Pending Labels on Close
runs-on: ubuntu-latest
if: always()
steps:
- name: Mint App Token
id: app
# Create a GitHub App token
# https://github.com/marketplace/actions/create-github-app-token
uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v2
with:
app-id: ${{ vars.ST_BOT_APP_ID }}
private-key: ${{ secrets.ST_BOT_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- name: Remove Pending Labels on Close
# 🤖 Issues Helper
# https://github.com/marketplace/actions/issues-helper
uses: actions-cool/issues-helper@v3.6.0
uses: actions-cool/issues-helper@a610082f8ac0cf03e357eb8dd0d5e2ba075e017e # v3.6.0
with:
actions: remove-labels
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ steps.app.outputs.token }}
issue-number: ${{ github.event.issue.number || github.event.pull_request.number }}
labels: '🚏 Awaiting User Response,🧑‍💻 In Progress,📌 Keep Open,🚫 Merge Conflicts,🔬 Needs Testing,🔨 Needs Work,⚰️ Stale,⛔ Waiting For External/Upstream'
+13 -3
View File
@@ -15,15 +15,25 @@ jobs:
label-maintainer:
name: 🏷️ Label if Author is a Repo Maintainer
runs-on: ubuntu-latest
if: contains(fromJson('["Cohee1207", "RossAscends", "Wolfsblvt"]'), github.actor)
if: always() && contains(fromJson('["Cohee1207", "RossAscends", "Wolfsblvt"]'), github.actor)
steps:
- name: Mint App Token
id: app
# Create a GitHub App token
# https://github.com/marketplace/actions/create-github-app-token
uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v2
with:
app-id: ${{ vars.ST_BOT_APP_ID }}
private-key: ${{ secrets.ST_BOT_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- name: Label if Author is a Repo Maintainer
# 🤖 Issues Helper
# https://github.com/marketplace/actions/issues-helper
uses: actions-cool/issues-helper@v3.6.0
uses: actions-cool/issues-helper@a610082f8ac0cf03e357eb8dd0d5e2ba075e017e # v3.6.0
with:
actions: 'add-labels'
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ steps.app.outputs.token }}
issue-number: ${{ github.event.issue.number || github.event.pull_request.number }}
labels: '👷 Maintainer'
+125 -68
View File
@@ -12,54 +12,10 @@ permissions:
pull-requests: write
jobs:
run-eslint:
name: ✅ Check ESLint on PR
runs-on: ubuntu-latest
# Only needs to run when code is changed
if: github.event.action == 'opened' || github.event.action == 'synchronize'
# Override permissions, linter likely needs write access to issues
permissions:
contents: read
issues: write
pull-requests: write
steps:
- name: Checkout Repository
# Checkout
# https://github.com/marketplace/actions/checkout
uses: actions/checkout@v4.2.2
with:
ref: ${{ github.event.pull_request.head.sha }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Setup Node.js
# Setup Node.js environment
# https://github.com/marketplace/actions/setup-node-js-environment
uses: actions/setup-node@v4.3.0
with:
node-version: 20
- name: Run npm install
run: npm ci
- name: Run ESLint
# Action ESLint
# https://github.com/marketplace/actions/action-eslint
uses: sibiraj-s/action-eslint@v3.0.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
eslint-args: '--ignore-path=.gitignore --quiet'
extensions: 'js'
annotations: true
ignore-patterns: |
dist/
lib/
label-by-size:
name: 🏷️ Label PR by Size
# This job should run after all others, to prevent possible concurrency issues
needs: [label-by-branches, label-by-files, remove-stale-label, check-merge-blocking-labels, write-auto-comments]
needs: [label-by-branches, label-by-files, label-copilot-prs, remove-stale-label, check-merge-blocking-labels, write-auto-comments]
runs-on: ubuntu-latest
# Only needs to run when code is changed
if: always() && (github.event.action == 'opened' || github.event.action == 'synchronize')
@@ -71,12 +27,22 @@ jobs:
pull-requests: write
steps:
- name: Mint App Token
id: app
# Create a GitHub App token
# https://github.com/marketplace/actions/create-github-app-token
uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v2
with:
app-id: ${{ vars.ST_BOT_APP_ID }}
private-key: ${{ secrets.ST_BOT_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- name: Label PR Size
# Pull Request Size Labeler
# https://github.com/marketplace/actions/pull-request-size-labeler
uses: codelytv/pr-size-labeler@v1.10.2
uses: codelytv/pr-size-labeler@4ec67706cd878fbc1c8db0a5dcd28b6bb412e85a # v1.10.3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ steps.app.outputs.token }}
xs_label: '🟩 ⬤○○○○'
xs_max_size: '20'
s_label: '🟩 ⬤⬤○○○'
@@ -95,47 +61,100 @@ jobs:
name: 🏷️ Label PR by Branches
runs-on: ubuntu-latest
# Only label once when PR is created or when base branch is changed, to allow manual label removal
if: github.event.action == 'opened' || (github.event.action == 'synchronize' && github.event.changes.base)
if: always() && (github.event.action == 'opened' || (github.event.action == 'synchronize' && github.event.changes.base))
steps:
- name: Mint App Token
id: app
# Create a GitHub App token
# https://github.com/marketplace/actions/create-github-app-token
uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v2
with:
app-id: ${{ vars.ST_BOT_APP_ID }}
private-key: ${{ secrets.ST_BOT_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- name: Checkout Repository
# Checkout
# https://github.com/marketplace/actions/checkout
uses: actions/checkout@v4.2.2
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Apply Labels Based on Branch Name and Target Branch
# Pull Request Labeler
# https://github.com/marketplace/actions/labeler
uses: actions/labeler@v5.0.0
uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0
with:
configuration-path: .github/pr-auto-labels-by-branch.yml
repo-token: ${{ secrets.GITHUB_TOKEN }}
repo-token: ${{ steps.app.outputs.token }}
label-by-files:
name: 🏷️ Label PR by Files
needs: [label-by-branches]
runs-on: ubuntu-latest
# Only needs to run when code is changed
if: github.event.action == 'opened' || github.event.action == 'synchronize'
if: always() && (github.event.action == 'opened' || github.event.action == 'synchronize')
steps:
- name: Mint App Token
id: app
# Create a GitHub App token
# https://github.com/marketplace/actions/create-github-app-token
uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v2
with:
app-id: ${{ vars.ST_BOT_APP_ID }}
private-key: ${{ secrets.ST_BOT_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- name: Checkout Repository
# Checkout
# https://github.com/marketplace/actions/checkout
uses: actions/checkout@v4.2.2
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Apply Labels Based on Changed Files
# Pull Request Labeler
# https://github.com/marketplace/actions/labeler
uses: actions/labeler@v5.0.0
uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0
env:
GITHUB_TOKEN: ${{ steps.app.outputs.token }} # labeler action needs some handholding
with:
configuration-path: .github/pr-auto-labels-by-files.yml
repo-token: ${{ secrets.GITHUB_TOKEN }}
repo-token: ${{ steps.app.outputs.token }}
label-copilot-prs:
name: 🏷️ Label Copilot PRs as Vibe Coded
runs-on: ubuntu-latest
# Only label once when PR is created by Copilot
if: >
github.event.action == 'opened' &&
github.event.pull_request.user.login == 'Copilot'
steps:
- name: Mint App Token
id: app
# Create a GitHub App token
# https://github.com/marketplace/actions/create-github-app-token
uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v2
with:
app-id: ${{ vars.ST_BOT_APP_ID }}
private-key: ${{ secrets.ST_BOT_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- name: Add Vibe Coded Label
# 🤖 Issues Helper
# https://github.com/marketplace/actions/issues-helper
uses: actions-cool/issues-helper@a610082f8ac0cf03e357eb8dd0d5e2ba075e017e # v3.6.0
with:
actions: 'add-labels'
token: ${{ steps.app.outputs.token }}
issue-number: ${{ github.event.pull_request.number }}
labels: '✨ Vibe Coded'
remove-stale-label:
name: 🗑️ Remove Stale Label on Comment
needs: [label-by-branches, label-by-files, label-copilot-prs]
runs-on: ubuntu-latest
# Only runs on comments not done by the github actions bot
if: github.event_name == 'pull_request_review_comment' && github.actor != 'github-actions[bot]'
if: always() && (github.event_name == 'pull_request_review_comment' && github.event.sender.type != 'Bot')
# Override permissions, issue labeler needs issues write access
permissions:
@@ -144,19 +163,33 @@ jobs:
pull-requests: write
steps:
- name: Mint App Token
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
id: app
# Only run if the PR is from the same repository
# This action runs on comments, which will not receive the env vars for this
# Create a GitHub App token
# https://github.com/marketplace/actions/create-github-app-token
uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v2
with:
app-id: ${{ vars.ST_BOT_APP_ID }}
private-key: ${{ secrets.ST_BOT_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- name: Remove Stale Label
if: always()
# 🤖 Issues Helper
# https://github.com/marketplace/actions/issues-helper
uses: actions-cool/issues-helper@v3.6.0
uses: actions-cool/issues-helper@a610082f8ac0cf03e357eb8dd0d5e2ba075e017e # v3.6.0
with:
actions: 'remove-labels'
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ steps.app.outputs.token || github.token }} # Use fallback to GITHUB_TOKEN if app token is not available
issue-number: ${{ github.event.pull_request.number }}
labels: '⚰️ Stale'
check-merge-blocking-labels:
name: 🚫 Check Merge Blocking Labels
needs: [label-by-branches, label-by-files]
needs: [label-by-branches, label-by-files, label-copilot-prs, remove-stale-label]
runs-on: ubuntu-latest
# Run, even if the previous jobs were skipped/failed
if: always()
@@ -172,7 +205,7 @@ jobs:
# GitHub Script
# https://github.com/marketplace/actions/github-script
id: label-check
uses: actions/github-script@v7.0.1
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
const prLabels = context.payload.pull_request.labels.map(label => label.name);
@@ -206,30 +239,44 @@ jobs:
write-auto-comments:
name: 💬 Post PR Comments Based on Labels
needs: [label-by-branches, label-by-files]
needs: [label-by-branches, label-by-files, label-copilot-prs, remove-stale-label, check-merge-blocking-labels]
runs-on: ubuntu-latest
# Run, even if the previous jobs were skipped/failed
if: always()
if: always() && (github.event_name == 'pull_request_target')
steps:
- name: Mint App Token
id: app
# Create a GitHub App token
# https://github.com/marketplace/actions/create-github-app-token
uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v2
with:
app-id: ${{ vars.ST_BOT_APP_ID }}
private-key: ${{ secrets.ST_BOT_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- name: Checkout Repository
# Checkout
# https://github.com/marketplace/actions/checkout
uses: actions/checkout@v4.2.2
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Post PR Comments Based on Labels
# Label Commenter for PRs
# https://github.com/marketplace/actions/label-commenter
uses: peaceiris/actions-label-commenter@v1.10.0
uses: peaceiris/actions-label-commenter@f0dbbef043eb1b150b566db36b0bdc8b7f505579 # v1.10.0
with:
config_file: .github/pr-auto-comments.yml
github_token: ${{ secrets.GITHUB_TOKEN }}
github_token: ${{ steps.app.outputs.token }}
# This runs on merged PRs to staging, reading the PR body and directly linked issues. Check `issues-updates-on-merge.yml`:`update-linked-issues` for commit-based updates.
update-linked-issues:
name: 🔗 Mark Linked Issues Done on Staging Merge
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'staging'
if: >
always() &&
github.event_name == 'pull_request_target' &&
github.event.pull_request.merged == true &&
github.event.pull_request.base.ref == 'staging'
# Override permissions, We need to be able to write to issues
permissions:
@@ -238,6 +285,16 @@ jobs:
pull-requests: write
steps:
- name: Mint App Token
id: app
# Create a GitHub App token
# https://github.com/marketplace/actions/create-github-app-token
uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v2
with:
app-id: ${{ vars.ST_BOT_APP_ID }}
private-key: ${{ secrets.ST_BOT_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- name: Extract Linked Issues From PR Description
id: extract_issues
run: |
@@ -250,7 +307,7 @@ jobs:
PR_NUMBER=${{ github.event.pull_request.number }}
REPO=${{ github.repository }}
API_URL="https://api.github.com/repos/$REPO/pulls/$PR_NUMBER/issues"
ISSUES=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "$API_URL" | jq -r '.[].number' | jq -R -s -c 'split("\n")[:-1]')
ISSUES=$(curl -s -H "Authorization: token ${{ steps.app.outputs.token }}" "$API_URL" | jq -r '.[].number' | jq -R -s -c 'split("\n")[:-1]')
echo "linked_issues=$ISSUES" >> $GITHUB_ENV
- name: Merge Issue Lists
@@ -262,7 +319,7 @@ jobs:
- name: Label Linked Issues
id: label_linked_issues
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ steps.app.outputs.token }}
run: |
for ISSUE in $(echo $final_issues | jq -r '.[]'); do
gh issue edit $ISSUE -R ${{ github.repository }} --add-label "✅ Done (staging)" --remove-label "🧑‍💻 In Progress"
@@ -15,14 +15,25 @@ jobs:
check-merge-conflicts:
name: ⚔️ Check Merge Conflicts
runs-on: ubuntu-latest
if: always()
steps:
- name: Mint App Token
id: app
# Create a GitHub App token
# https://github.com/marketplace/actions/create-github-app-token
uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v2
with:
app-id: ${{ vars.ST_BOT_APP_ID }}
private-key: ${{ secrets.ST_BOT_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- name: Check Merge Conflicts
# Label Conflicting Pull Requests
# https://github.com/marketplace/actions/label-conflicting-pull-requests
uses: eps1lon/actions-label-merge-conflict@v3.0.3
uses: eps1lon/actions-label-merge-conflict@1df065ebe6e3310545d4f4c4e862e43bdca146f0 # v3.0.3
with:
dirtyLabel: '🚫 Merge Conflicts'
repoToken: ${{ secrets.GITHUB_TOKEN }}
repoToken: ${{ steps.app.outputs.token }}
commentOnDirty: >
⚠️ This PR has conflicts that need to be resolved before it can be merged.
+84
View File
@@ -0,0 +1,84 @@
name: ✅ Pull Request Checks
on:
pull_request:
types: [opened, synchronize, reopened]
permissions:
contents: read
jobs:
run-eslint:
name: ✅ Check ESLint on PR
runs-on: ubuntu-latest
# Only needs to run when code is changed
if: always() && (github.event.action == 'opened' || github.event.action == 'synchronize')
# Override permissions, linter likely needs write access to issues
permissions:
contents: read
issues: write
pull-requests: write
steps:
- name: Checkout Repository
# Checkout
# https://github.com/marketplace/actions/checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.event.pull_request.head.sha }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Setup Node.js
# Setup Node.js environment
# https://github.com/marketplace/actions/setup-node-js-environment
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
with:
node-version: 24
- name: Run npm install
run: npm ci --ignore-scripts
- name: Run ESLint
# Action ESLint
# https://github.com/marketplace/actions/action-eslint
uses: sibiraj-s/action-eslint@bcf41bb9abce43cdbad51ab9b3da2eddaa17eab3 # v3.0.1
with:
token: ${{ secrets.GITHUB_TOKEN }} # ESLint can run with the original permissions
eslint-args: '--ignore-path=.gitignore --quiet'
extensions: 'js'
annotations: true
ignore-patterns: |
dist/
lib/
run-tests:
name: ✅ Run Unit Tests on PR
runs-on: ubuntu-latest
# Only needs to run when code is changed
if: always() && (github.event.action == 'opened' || github.event.action == 'synchronize')
steps:
- name: Checkout Repository
# Checkout
# https://github.com/marketplace/actions/checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.event.pull_request.head.sha }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Setup Node.js
# Setup Node.js environment
# https://github.com/marketplace/actions/setup-node-js-environment
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
with:
node-version: 24
- name: Install root dependencies
run: npm ci --ignore-scripts
- name: Install test dependencies
run: npm ci --ignore-scripts --prefix tests
- name: Run unit tests
run: npm run test:unit --prefix tests
-32
View File
@@ -1,32 +0,0 @@
name: Update i18n data
on: workflow_dispatch
jobs:
build:
runs-on: ubuntu-latest
permissions: # Job-level permissions configuration starts here
contents: write # 'write' access to repository contents
steps:
- name: disable auto crlf
uses: steve02081504/disable-autocrlf@v1
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
- name: Create local changes
run: |
aria2c https://raw.githubusercontent.com/SillyTavern/SillyTavern-i18n/main/generate.py
aria2c https://raw.githubusercontent.com/SillyTavern/SillyTavern-i18n/main/requirements.txt
pip install -r ./requirements.txt
python ./generate.py "" --sort-keys
rm -f ./generate.py ./requirements.txt
- name: add all
run: git add -A
- name: push
uses: actions-go/push@master
with:
author-email: 41898282+github-actions[bot]@users.noreply.github.com
author-name: github-actions[bot]
commit-message: 'i18n changes'
remote: origin
+4
View File
@@ -26,6 +26,7 @@ public/stats.json
/docker/user
/docker/extensions
/docker/data
/docker/dist
.DS_Store
public/settings.json
/thumbnails
@@ -33,6 +34,7 @@ whitelist.txt
.vscode/**
!.vscode/extensions.json
.idea/
.windsurf/
secrets.json
/dist
/backups/
@@ -55,3 +57,5 @@ public/scripts/extensions/third-party
.env
/StartDev.bat
yarn.lock
*.code-workspace
test-results/
+8
View File
@@ -0,0 +1,8 @@
ignore-scripts=true
min-release-age=7
allow-directory=none
allow-file=none
allow-git=none
# Temporarily disabled due to an npm bug:
# https://github.com/npm/cli/issues/9347
# allow-remote=none
+4
View File
@@ -0,0 +1,4 @@
{
"js/ts.tsdk.promptToUseWorkspaceVersion": true,
"js/ts.tsdk.path": "./node_modules/typescript/lib"
}
+75 -20
View File
@@ -9,33 +9,88 @@
## Getting the code ready
1. Register a GitHub account.
2. Fork this repository under your account.
2. Fork this repository under your account.
3. Clone the fork onto your machine.
4. Open the cloned repository in the code editor.
5. Create a git branch (recommended).
5. Create a git branch (recommended), review the [git book](https://git-scm.com/book/en/v2/Getting-Started-About-Version-Control) if you haven't.
6. Make your changes and test them locally.
7. Commit the changes and push the branch to the remote repo.
8. Go to GitHub, and open a pull request, targeting the upstream branch.
8. Go to GitHub, and open a pull request, targeting the appropriate upstream branch.
## Contribution guidelines
1. Our standards are pretty low, but make sure the code is not too ugly:
- Run VS Code's autoformat when you're done.
- Check with ESLint by running `npm run lint`, then fix the errors.
- Use common sense and follow existing naming conventions.
2. Create pull requests for the staging branch, 99% of contributions should go there. That way people could test your code before the next stable release.
3. You can still send a pull request for release in the following scenarios:
- Updating README.
- Updating GitHub Actions.
- Hotfixing a critical bug.
4. Project maintainers will test and can change your code before merging.
5. Write at least somewhat meaningful PR descriptions. There's no "right" way to do it, but the following may help with outlining a general structure:
- What is the reason for a change?
- What did you do to achieve this?
- How would a reviewer test the change?
6. Mind the license. Your contributions will be licensed under the GNU Affero General Public License. If you don't know what that implies, consult your lawyer.
### Maintain code quality
Our standards are pretty low, but make sure the code is not too ugly:
- Run VS Code's autoformat when you're done.
- Check with ESLint by running `npm run lint`, then fix the errors.
- Use common sense and follow existing naming conventions.
### Use the correct target branch
Create pull requests for the `staging` branch, 99% of contributions should go there. That way people could test your code before the next stable release.
You can still send a pull request for `release` in the following scenarios:
- Updating README.
- Updating GitHub Actions.
- Hotfixing a critical bug.
Project maintainers will test and can change your code before merging. To keep our workflow smooth, please ensure the following:
- The "Allow edits from maintainers" option is checked.
- Avoid force-pushing your branch once the PR is out of draft state.
### Make contributions small and testable
To make sure that your contribution remains testable and reviewable, try not to exceed a soft limit of **200 lines of code** (both additions and deletions) per pull request. If you have more to contribute, split it into multiple pull requests.
We can also consider creating a separate feature branch for more substantial changes, but please discuss it with the maintainers first. For example:
- Leave the main larger PR as a draft so it can be used to discuss the implementation.
- Split each group of functions or features into a ~200 line PR so it can be properly reviewed and merged to staging or a feature branch.
- If there are large codependent changes that cannot be split, start with the most utilized dependencies and stub dependent functions.
- Each will be reviewed and tested one by one, merging into the feature branch as they're ready.
- Do not create all branches in advance, as subsequent changes made in previous commits as a result of test/review may create a lot of merge conflicts.
### Provide clear descriptions of your changes
Write at least somewhat meaningful PR descriptions and commit messages. There's no "right" way to do it, but the following may help with outlining a general structure:
- What is the reason for a change?
- What did you do to achieve this?
- How would a reviewer test the change?
### Discuss new provider integrations before implementing them
Do not use a completed pull request as the first product discussion for a new named external provider or service.
- Model routers, resellers, rerouters, gateways, and aggregators should use **Custom (OpenAI-compatible)** and publish provider-owned setup instructions. Provider-specific convenience may be implemented as a third-party UI extension or server plugin.
- New first-party model, TTS, speech, web search, image, vectorization, embedding, reranking, and similar integrations are exceptional and should begin with a public issue and maintainer discussion before implementation.
- Existing-provider maintenance and provider-neutral improvements to generic compatibility remain welcome.
Read [Integrating an External Provider](https://docs.sillytavern.app/for-contributors/provider-integrations/) before starting implementation.
### We (likely) don't speak your language
English is the primary language of communication in this project. Please use only English when writing commit messages, PR descriptions, comments and other text. This does not apply to contributions to localization files.
### Legal stuff
Mind the license. Your contributions will be licensed under the GNU Affero General Public License. If you don't know what that implies, consult your lawyer.
## Use of AI coding assistance tools ("Vibe Coding")
We do not prohibit nor encourage the use of AI tools for coding assistance to help you write code, documentation, etc. This includes specialized IDEs, plugins and add-ons, chat interfaces, etc. However, please keep in mind the following:
- No matter who (or what) wrote the code, you are responsible for it. Make sure to carefully review and test everything before committing, and be ready to discuss and fix any issues that may arise during the review.
- Maintainers can reject reviewing and accepting PRs of very low quality, i.e. if the time to fix the issues exceeds the time to write the code from scratch.
- Avoid common mistakes attributed to AI tools, such as: adding/removing unrelated comments, excessive logging, unawareness of the project context and conventions, etc.
- You are allowed, but not required, to trigger AI tools that are added to the project by maintainers (Gemini, Copilot, Codex). Keep in mind that any feedback (comments, suggestions) that these tools generate is not a call to action; make sure to properly assess it before applying.
## Further reading
1. [How to write UI extensions](https://docs.sillytavern.app/for-contributors/writing-extensions/)
2. [How to write server plugins](https://docs.sillytavern.app/for-contributors/server-plugins)
1. [How to integrate an external provider](https://docs.sillytavern.app/for-contributors/provider-integrations/)
2. [How to write UI extensions](https://docs.sillytavern.app/for-contributors/writing-extensions/)
3. [How to write server plugins](https://docs.sillytavern.app/for-contributors/server-plugins)
+16 -12
View File
@@ -1,44 +1,48 @@
FROM node:lts-alpine3.21
FROM node:lts-alpine3.23
# Arguments
ARG APP_HOME=/home/node/app
# Install system dependencies
RUN apk add --no-cache gcompat tini git git-lfs
# "Don't rely on the base image for tools; if you call it, you install it." ;)
RUN apk add --no-cache gcompat tini git git-lfs su-exec shadow dos2unix
# Create app directory
# Create app directory and set ownership
WORKDIR ${APP_HOME}
RUN chown node:node ${APP_HOME}
# Set NODE_ENV to production
ENV NODE_ENV=production
# Bundle app source
COPY . ./
# Bundle app source and set ownership
COPY --chown=node:node . ./
RUN \
echo "*** Install npm packages ***" && \
npm i --no-audit --no-fund --loglevel=error --no-progress --omit=dev && npm cache clean --force
npm ci --no-audit --no-fund --loglevel=error --no-progress --omit=dev --ignore-scripts && npm cache clean --force
# Create config directory and link config.yaml
# Create config directory and link config.yaml. Added hardcoded dirs(constants.js?)
# that must be present for Non-Root Mode and volumeless docker runs.
RUN \
rm -f "config.yaml" || true && \
ln -s "./config/config.yaml" "config.yaml" || true && \
mkdir "config" || true
mkdir -p config data plugins public/scripts/extensions/third-party backups && \
chown -R node:node config data plugins public/scripts/extensions/third-party backups && \
ln -s "./config/config.yaml" "config.yaml"
# Pre-compile public libraries
RUN \
echo "*** Run Webpack ***" && \
node "./docker/build-lib.js"
# Set the entrypoint script
# Set the entrypoint script and cleanup
RUN \
echo "*** Cleanup ***" && \
mv "./docker/docker-entrypoint.sh" "./" && \
rm -rf "./docker" && \
echo "*** Make docker-entrypoint.sh executable ***" && \
chmod +x "./docker-entrypoint.sh" && \
echo "*** Convert line endings to Unix format ***" && \
dos2unix "./docker-entrypoint.sh"
dos2unix "./docker-entrypoint.sh" && \
rm -rf "./docker"
# Fix extension repos permissions
RUN git config --global --add safe.directory "*"
+1 -1
View File
@@ -1,7 +1,7 @@
@echo off
pushd %~dp0
set NODE_ENV=production
call npm install --no-audit --no-fund --loglevel=error --no-progress --omit=dev
call npm install --no-save --no-audit --no-fund --loglevel=error --no-progress --omit=dev --ignore-scripts
node server.js %*
pause
popd
+1 -1
View File
@@ -20,7 +20,7 @@ if %errorlevel% neq 0 (
)
)
set NODE_ENV=production
call npm install --no-audit --no-fund --loglevel=error --no-progress --omit=dev
call npm install --no-save --no-audit --no-fund --loglevel=error --no-progress --omit=dev --ignore-scripts
node server.js %*
:end
pause
+1 -1
View File
@@ -102,7 +102,7 @@ if %errorlevel% neq 0 (
echo Installing npm packages and starting server
set NODE_ENV=production
call npm install --no-audit --no-fund --loglevel=error --no-progress --omit=dev
call npm install --no-save --no-audit --no-fund --loglevel=error --no-progress --omit=dev --ignore-scripts
node server.js %*
:end
+129 -14
View File
@@ -38,6 +38,12 @@ browserLaunch:
avoidLocalhost: false
# Server port
port: 8000
# Interval in seconds to write a heartbeat file. Set to 0 to disable.
# This is used primarily for Docker healthchecks.
heartbeatInterval: 0
# Enable HTTP/HTTPS keep-alive globally.
# Disabling restores old Node 18 behavior, can help if ECONNRESET and other network errors occur.
enableKeepAlive: false
# -- SSL options --
ssl:
# Enable SSL/TLS encryption
@@ -52,7 +58,7 @@ ssl:
# -- SECURITY CONFIGURATION --
# Toggle whitelist mode
whitelistMode: true
# Whitelist will also verify IP in X-Forwarded-For / X-Real-IP headers
# When enabled, whitelist will also verify IP in headers enabled in `forwardedHeaders` section.
enableForwardedWhitelist: true
# Whitelist of allowed IP addresses
whitelist:
@@ -68,6 +74,25 @@ basicAuthUser:
password: "password"
# Enables CORS proxy middleware
enableCorsProxy: false
# CORS settings (applied to all routes)
cors:
# Enable or disable CORS middleware
enabled: true
# Allowed origins. Use "null" to match the default browser file origin.
# You can set "*" to allow any origin, or a list of allowed origins.
origin:
- "null"
# Allowed methods
methods:
- "OPTIONS"
# Allowed request headers (optional)
allowedHeaders: []
# Exposed response headers (optional)
exposedHeaders: []
# Allow credentials (cookies, authorization headers)
credentials: false
# Preflight cache max age in seconds (optional)
maxAge: null
# -- REQUEST PROXY CONFIGURATION --
requestProxy:
# If a proxy is enabled, all outgoing HTTP/HTTPS requests will be routed through it.
@@ -82,18 +107,37 @@ requestProxy:
enableUserAccounts: false
# Enable discreet login mode: hides user list on the login screen
enableDiscreetLogin: false
# Enable's authlia based auto login. Only enable this if you
# have setup and installed Authelia as a middle-ware on your
# reverse proxy
# https://www.authelia.com/
# This will use auto login to an account with the same username
# as that used for authlia. (Ensure the username in authlia
# is an exact match in lowercase with that in sillytavern)
autheliaAuth: false
# If `basicAuthMode` and this are enabled then
# the username and passwords for basic auth are the same as those
# for the individual accounts
perUserBasicAuth: false
# -- SSO LOGIN CONFIGURATION --
sso:
# Enable's authlia based auto login. Only enable this if you
# have setup and installed Authelia as a middle-ware on your
# reverse proxy
# https://www.authelia.com/
# This will use auto login to an account with the same username
# as that used for authlia. (Ensure the username in authlia
# is an exact match in lowercase with that in sillytavern)
autheliaAuth: false
# Enable's authentik based auto login. Only enable this if you
# have setup and installed Authentik as a middle-ware on your
# reverse proxy.
# https://goauthentik.io/
# This will use auto login to an account with the same username
# as that used for authentik. (Ensure the username in authentik
# is an exact match in lowercase with that in sillytavern).
authentikAuth: false
# List of trusted proxy IPs for SSO authentication.
# Supports wildcards or CIDR notation for subnets.
# Example: ['127.0.0.1', '192.168.1.1']
# Set to ['*'] to trust all proxies (NOT RECOMMENDED unless you have other security measures in place)
trustedProxies:
- ::1
- 127.0.0.1
# Host whitelist configuration. Recommended if you're using a listen mode
hostWhitelist:
# Enable or disable host whitelisting
@@ -107,6 +151,26 @@ hostWhitelist:
# - .trycloudflare.com
hosts: []
# Perform whitelist checks against server-side HTTP requests that resolve to private IP addresses.
# This is an additional layer of security to prevent Server-Side Request Forgery (SSRF) attacks.
# Recommended when listen mode is enabled, or if your server is accessible by untrusted users.
privateAddressWhitelist:
# Enable private address whitelist to block requests to private IP ranges.
enabled: false
# If true, requests to hosts that cannot be resolved will be allowed instead of blocked.
allowUnresolvedHosts: false
# Log blocked and allowed requests to the console.
log:
# Log blocked requests to the console with a warning message
blockedRequests: true
# Log allowed requests to the console with an info message
allowedRequests: false
# List of allowed private IP ranges (in CIDR notation or wildcard format).
# Allows loopback IP ranges by default, but you can customize this list to fit your needs.
allowedRanges:
- '127.0.0.0/8' # Loopback (IPv4)
- '::1/128' # Loopback (IPv6)
# User session timeout *in seconds* (defaults to 24 hours).
## Set to a positive number to expire session after a certain time of inactivity
## Set to 0 to expire session when the browser is closed
@@ -125,12 +189,31 @@ logging:
minLogLevel: 0
# -- RATE LIMITING CONFIGURATION --
rateLimiting:
# Use X-Real-IP header instead of socket IP for rate limiting
# Only enable this if you are using a properly configured reverse proxy (like Nginx/traefik/Caddy)
# Use any of the enabled headers in the `forwardedHeaders` section to identify the client IP for rate limiting.
# If disabled, only the socket IP will be used, which may not work correctly if you are behind a reverse proxy.
preferRealIpHeader: false
# Set the maximum number of allowed failed basic authentication attempts before rate limiting is applied. Set to 0 to disable rate limiting for basic auth.
basicAuthMaxAttempts: 5
# Set the maximum number of allowed failed account login attempts before rate limiting is applied. Set to 0 to disable rate limiting for account logins.
accountsLoginMaxAttempts: 5
# Set the maximum number of allowed failed account recovery attempts before rate limiting is applied. Set to 0 to disable rate limiting for account recovery.
accountsRecoverMaxAttempts: 5
# Set the maximum number of allowed failed account reset attempts before rate limiting is applied. Set to 0 to disable rate limiting for account resets.
accountsResetMaxAttempts: 5
# Set to true to enable support for real IPs in certain request headers for features like IP whitelisting, rate limiting and access logging.
# Only change if you are sure that you use a correctly configured reverse proxy, otherwise this may lead to IP spoofing.
forwardedHeaders:
# X-Real-IP header (common with Nginx and Caddy)
xRealIp: true
# X-Forwarded-For header (common with many proxies, but may contain multiple IPs - only the first one will be used)
xForwardedFor: true
# CF-Connecting-IP header (used by Cloudflare Tunnels)
cfConnectingIp: false
## BACKUP CONFIGURATION
backups:
# Allow users to create a full backup archive of their data
allowFullDataBackup: true
# Common settings for all backup types
common:
# Number of backups to keep for each chat and settings file
@@ -168,6 +251,16 @@ performance:
memoryCacheCapacity: '100mb'
# Enables disk caching for character cards. Improves performances with large card libraries.
useDiskCache: true
# Configures gzip compression for client requests with large payloads (e.g. settings or chat saves).
requestCompression:
# Enable request compression.
enabled: false
# Minimum payload size to trigger compression. Set to 0 to compress all requests regardless of size.
minPayloadSize: '256kb'
# Hard upper payload size limit for compression. Set to 0 to allow compression of any size.
maxPayloadSize: '8mb'
# Timeout for request compression in milliseconds.
timeout: 4000
# CACHE BUSTER CONFIGURATION
# IMPORTANT: Requires localhost or a domain with HTTPS, otherwise will not work!
@@ -188,7 +281,6 @@ whitelistImportDomains:
- cdn.discordapp.com
- files.catbox.moe
- raw.githubusercontent.com
- char-archive.evulid.cc
# API request overrides (for KoboldAI and Text Completion APIs)
## Note: host includes the port number if it's not the default (80 or 443)
## Format is an array of objects:
@@ -217,6 +309,13 @@ extensions:
speechToText: Xenova/whisper-small
textToSpeech: Xenova/speecht5_tts
# Git backend for plugin/extension repository operations.
# - Use "auto" to prefer system git, falling back to the integrated backend
# - Use "system" to force system backend
# - Use "builtin" to force integrated backend
git:
backend: auto
# Additional model tokenizers can be downloaded on demand.
# Disabling will fallback to another locally available tokenizer.
enableDownloadableTokenizers: true
@@ -253,14 +352,14 @@ ollama:
# -- ANTHROPIC CLAUDE API CONFIGURATION --
claude:
# Enables caching of the system prompt (if supported).
# https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching
# https://platform.claude.com/docs/en/build-with-claude/prompt-caching
# -- IMPORTANT! --
# Use only when the prompt before the chat history is static and doesn't change between requests
# (e.g {{random}} macro or lorebooks not as in-chat injections).
# Otherwise, you'll just waste money on cache misses.
enableSystemPromptCache: false
# Enables caching of the message history at depth (if supported).
# https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching
# https://platform.claude.com/docs/en/build-with-claude/prompt-caching
# -- IMPORTANT! --
# Use with caution. Behavior may be unpredictable and no guarantees can or will be made.
# Set to an integer to specify the desired depth. 0 (which does NOT include the prefill)
@@ -271,10 +370,26 @@ claude:
## 5m: base price x 1.25
## 1h: base price x 2
extendedTTL: false
# Enables adaptive thinking for supported models (Opus 4.6+).
# Disable to enforce legacy thinking mode (with thinking budget).
# https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking
enableAdaptiveThinking: false
# -- GOOGLE GEMINI API CONFIGURATION --
gemini:
# API endpoint version ("v1beta" or "v1alpha")
apiVersion: 'v1beta'
# Adds thought signatures to requests (if available). Only for Gemini 3 and above.
thoughtSignatures: true
# Enables caching of the system prompt (if supported). Only for OpenRouter.
# -- IMPORTANT! --
# Use only when the prompt before the chat history is static and doesn't change between requests
# (e.g {{random}} macro or lorebooks not as in-chat injections).
# Otherwise, you'll just waste money on cache misses.
enableSystemPromptCache: false
# https://ai.google.dev/gemini-api/docs/imagen#imagen-configuration
image:
# Leave empty to use the API-default value.
personGeneration: 'allow_adult'
# -- SERVER PLUGIN CONFIGURATION --
enableServerPlugins: false
# Attempt to automatically update server plugins on startup
@@ -2,11 +2,11 @@
<html>
<head>
<title>Not found</title>
<title>Not Found</title>
</head>
<body>
<h1>Not found</h1>
<h1>Not Found</h1>
<p>
The requested URL was not found on this server.
</p>
+38 -218
View File
@@ -139,98 +139,18 @@
"filename": "Char_Avatar_Comfy_Workflow.json",
"type": "workflow"
},
{
"filename": "presets/kobold/Ace of Spades.json",
"type": "kobold_preset"
},
{
"filename": "presets/kobold/Basic Coherence.json",
"type": "kobold_preset"
},
{
"filename": "presets/kobold/Best Guess.json",
"type": "kobold_preset"
},
{
"filename": "presets/kobold/Coherent Creativity.json",
"type": "kobold_preset"
},
{
"filename": "presets/kobold/Deterministic.json",
"type": "kobold_preset"
},
{
"filename": "presets/kobold/Genesis.json",
"type": "kobold_preset"
},
{
"filename": "presets/kobold/Godlike.json",
"type": "kobold_preset"
},
{
"filename": "presets/kobold/Good Winds.json",
"type": "kobold_preset"
},
{
"filename": "presets/kobold/Liminal Drift.json",
"type": "kobold_preset"
},
{
"filename": "presets/kobold/Low Rider.json",
"type": "kobold_preset"
},
{
"filename": "presets/kobold/Luna Moth.json",
"type": "kobold_preset"
},
{
"filename": "presets/kobold/Mayday.json",
"type": "kobold_preset"
},
{
"filename": "presets/kobold/Miro Bronze.json",
"type": "kobold_preset"
},
{
"filename": "presets/kobold/Miro Gold.json",
"type": "kobold_preset"
},
{
"filename": "presets/kobold/Miro Silver.json",
"type": "kobold_preset"
},
{
"filename": "presets/kobold/Ouroboros.json",
"type": "kobold_preset"
},
{
"filename": "presets/kobold/Pleasing Results.json",
"type": "kobold_preset"
},
{
"filename": "presets/kobold/Pro Writer.json",
"filename": "presets/kobold/Neutral.json",
"type": "kobold_preset"
},
{
"filename": "presets/kobold/RecoveredRuins.json",
"type": "kobold_preset"
},
{
"filename": "presets/kobold/Space Alien.json",
"type": "kobold_preset"
},
{
"filename": "presets/kobold/Storywriter.json",
"type": "kobold_preset"
},
{
"filename": "presets/kobold/TFS-with-Top-A.json",
"type": "kobold_preset"
},
{
"filename": "presets/kobold/Titanic.json",
"type": "kobold_preset"
},
{
"filename": "presets/kobold/Universal-Creative.json",
"type": "kobold_preset"
@@ -243,10 +163,6 @@
"filename": "presets/kobold/Universal-Super-Creative.json",
"type": "kobold_preset"
},
{
"filename": "presets/kobold/simple-proxy-for-tavern.json",
"type": "kobold_preset"
},
{
"filename": "presets/novel/Asper-Kayra.json",
"type": "novel_preset"
@@ -343,22 +259,6 @@
"filename": "presets/novel/Erato-Zany Scribe.json",
"type": "novel_preset"
},
{
"filename": "presets/textgen/Asterism.json",
"type": "textgen_preset"
},
{
"filename": "presets/textgen/Beam Search.json",
"type": "textgen_preset"
},
{
"filename": "presets/textgen/Big O.json",
"type": "textgen_preset"
},
{
"filename": "presets/textgen/Contrastive Search.json",
"type": "textgen_preset"
},
{
"filename": "presets/textgen/Default.json",
"type": "textgen_preset"
@@ -368,99 +268,7 @@
"type": "textgen_preset"
},
{
"filename": "presets/textgen/Divine Intellect.json",
"type": "textgen_preset"
},
{
"filename": "presets/textgen/Kobold (Godlike).json",
"type": "textgen_preset"
},
{
"filename": "presets/textgen/Kobold (Liminal Drift).json",
"type": "textgen_preset"
},
{
"filename": "presets/textgen/LLaMa-Precise.json",
"type": "textgen_preset"
},
{
"filename": "presets/textgen/Midnight Enigma.json",
"type": "textgen_preset"
},
{
"filename": "presets/textgen/Miro Bronze.json",
"type": "textgen_preset"
},
{
"filename": "presets/textgen/Miro Gold.json",
"type": "textgen_preset"
},
{
"filename": "presets/textgen/Miro Silver.json",
"type": "textgen_preset"
},
{
"filename": "presets/textgen/Mirostat.json",
"type": "textgen_preset"
},
{
"filename": "presets/textgen/Naive.json",
"type": "textgen_preset"
},
{
"filename": "presets/textgen/NovelAI (Best Guess).json",
"type": "textgen_preset"
},
{
"filename": "presets/textgen/NovelAI (Decadence).json",
"type": "textgen_preset"
},
{
"filename": "presets/textgen/NovelAI (Genesis).json",
"type": "textgen_preset"
},
{
"filename": "presets/textgen/NovelAI (Lycaenidae).json",
"type": "textgen_preset"
},
{
"filename": "presets/textgen/NovelAI (Ouroboros).json",
"type": "textgen_preset"
},
{
"filename": "presets/textgen/NovelAI (Pleasing Results).json",
"type": "textgen_preset"
},
{
"filename": "presets/textgen/NovelAI (Sphinx Moth).json",
"type": "textgen_preset"
},
{
"filename": "presets/textgen/NovelAI (Storywriter).json",
"type": "textgen_preset"
},
{
"filename": "presets/textgen/Shortwave.json",
"type": "textgen_preset"
},
{
"filename": "presets/textgen/Simple-1.json",
"type": "textgen_preset"
},
{
"filename": "presets/textgen/Space Alien.json",
"type": "textgen_preset"
},
{
"filename": "presets/textgen/StarChat.json",
"type": "textgen_preset"
},
{
"filename": "presets/textgen/TFS-with-Top-A.json",
"type": "textgen_preset"
},
{
"filename": "presets/textgen/Titanic.json",
"filename": "presets/textgen/Neutral.json",
"type": "textgen_preset"
},
{
@@ -475,14 +283,6 @@
"filename": "presets/textgen/Universal-Super-Creative.json",
"type": "textgen_preset"
},
{
"filename": "presets/textgen/Yara.json",
"type": "textgen_preset"
},
{
"filename": "presets/textgen/simple-proxy-for-tavern.json",
"type": "textgen_preset"
},
{
"filename": "presets/openai/Default.json",
"type": "openai_preset"
@@ -507,14 +307,6 @@
"filename": "presets/context/Default.json",
"type": "context"
},
{
"filename": "presets/context/DreamGen Role-Play V1 ChatML.json",
"type": "context"
},
{
"filename": "presets/context/DreamGen Role-Play V1 Llama3.json",
"type": "context"
},
{
"filename": "presets/context/Libra-32B.json",
"type": "context"
@@ -587,14 +379,6 @@
"filename": "presets/instruct/ChatML.json",
"type": "instruct"
},
{
"filename": "presets/instruct/DreamGen Role-Play V1 ChatML.json",
"type": "instruct"
},
{
"filename": "presets/instruct/DreamGen Role-Play V1 Llama3.json",
"type": "instruct"
},
{
"filename": "presets/instruct/Koala.json",
"type": "instruct"
@@ -854,5 +638,41 @@
{
"filename": "presets/reasoning/OpenAI Harmony.json",
"type": "reasoning"
},
{
"filename": "presets/reasoning/Think XML.json",
"type": "reasoning"
},
{
"filename": "presets/reasoning/Gemma 4.json",
"type": "reasoning"
},
{
"filename": "presets/instruct/Gemma 4.json",
"type": "instruct"
},
{
"filename": "presets/context/Gemma 4.json",
"type": "context"
},
{
"filename": "user.css",
"type": "stylesheet"
},
{
"filename": "errors/forbidden-by-whitelist.html",
"type": "error_page"
},
{
"filename": "errors/host-not-allowed.html",
"type": "error_page"
},
{
"filename": "errors/unauthorized.html",
"type": "error_page"
},
{
"filename": "errors/url-not-found.html",
"type": "error_page"
}
]
@@ -1,14 +0,0 @@
{
"story_string": "{{#if anchorBefore}}{{anchorBefore}}\n{{/if}}{{#if system}}{{system}}\n\n\n{{/if}}## Overall plot description:\n\n{{#if scenario}}{{scenario}}{{else}}Conversation between {{char}} and {{user}}.{{/if}}{{#if wiBefore}}\n\n{{wiBefore}}{{/if}}\n\n\n## Characters:\n\n### {{char}}\n\n{{#if description}}{{description}}\n\n{{/if}}{{#if personality}}{{personality}}\n\n{{/if}}### {{user}}\n\n{{#if persona}}{{persona}}{{else}}{{user}} is the protagonist of the role-play.{{/if}}{{#if wiAfter}}\n\n{{wiAfter}}{{/if}}{{#if mesExamples}}\n\n{{mesExamples}}{{/if}}{{#if anchorAfter}}{{anchorAfter}}\n{{/if}}{{trim}}",
"example_separator": "",
"chat_start": "",
"use_stop_strings": false,
"names_as_stop_strings": true,
"story_string_position": 0,
"story_string_depth": 1,
"story_string_role": 0,
"always_force_name2": false,
"trim_sentences": true,
"single_line": false,
"name": "DreamGen Role-Play V1 ChatML"
}
@@ -1,14 +0,0 @@
{
"story_string": "{{#if anchorBefore}}{{anchorBefore}}\n{{/if}}{{#if system}}{{system}}\n\n\n{{/if}}## Overall plot description:\n\n{{#if scenario}}{{scenario}}{{else}}Conversation between {{char}} and {{user}}.{{/if}}{{#if wiBefore}}\n\n{{wiBefore}}{{/if}}\n\n\n## Characters:\n\n### {{char}}\n\n{{#if description}}{{description}}\n\n{{/if}}{{#if personality}}{{personality}}\n\n{{/if}}### {{user}}\n\n{{#if persona}}{{persona}}{{else}}{{user}} is the protagonist of the role-play.{{/if}}{{#if wiAfter}}\n\n{{wiAfter}}{{/if}}{{#if mesExamples}}\n\n{{mesExamples}}{{/if}}{{#if anchorAfter}}{{anchorAfter}}\n{{/if}}{{trim}}",
"example_separator": "<|eot_id|>\n<|start_header_id|>user<|end_header_id|>\n\nWrite an example narrative / conversation that is not part of the main story.",
"chat_start": "<|eot_id|>\n<|start_header_id|>user<|end_header_id|>\n\nStart the role-play between {{char}} and {{user}}.",
"use_stop_strings": false,
"names_as_stop_strings": true,
"story_string_position": 0,
"story_string_depth": 1,
"story_string_role": 0,
"always_force_name2": false,
"trim_sentences": true,
"single_line": false,
"name": "DreamGen Role-Play V1 Llama3"
}
@@ -0,0 +1,14 @@
{
"story_string": "{{#if anchorBefore}}{{anchorBefore}}\n{{/if}}{{#if system}}{{system}}\n{{/if}}{{#if wiBefore}}{{wiBefore}}\n{{/if}}{{#if description}}{{description}}\n{{/if}}{{#if personality}}{{personality}}\n{{/if}}{{#if scenario}}{{scenario}}\n{{/if}}{{#if wiAfter}}{{wiAfter}}\n{{/if}}{{#if persona}}{{persona}}\n{{/if}}{{#if anchorAfter}}{{anchorAfter}}\n{{/if}}{{trim}}",
"example_separator": "",
"chat_start": "",
"use_stop_strings": false,
"names_as_stop_strings": true,
"story_string_position": 0,
"story_string_depth": 1,
"story_string_role": 0,
"always_force_name2": true,
"trim_sentences": false,
"single_line": false,
"name": "Gemma 4"
}
@@ -1,25 +0,0 @@
{
"input_sequence": "\n<|im_start|>text names= {{name}}\n",
"output_sequence": "\n<|im_start|>text names= {{name}}\n",
"last_output_sequence": "",
"system_sequence": "",
"stop_sequence": "\n<|im_start|>",
"wrap": false,
"macro": true,
"names_behavior": "none",
"activation_regex": "",
"first_output_sequence": "",
"skip_examples": false,
"output_suffix": "<|im_end|>",
"input_suffix": "<|im_end|>",
"system_suffix": "",
"user_alignment_message": "",
"system_same_as_user": true,
"last_system_sequence": "",
"first_input_sequence": "",
"last_input_sequence": "",
"sequences_as_stop_strings": true,
"story_string_prefix": "<|im_start|>system\n",
"story_string_suffix": "<|im_end|>",
"name": "DreamGen Role-Play V1 ChatML"
}
@@ -1,25 +0,0 @@
{
"input_sequence": "<|eot_id|>\n<|start_header_id|>writer character: {{user}}<|end_header_id|>\n\n",
"output_sequence": "<|eot_id|>\n<|start_header_id|>writer character: {{char}}<|end_header_id|>\n\n",
"last_output_sequence": "",
"system_sequence": "",
"stop_sequence": "",
"wrap": false,
"macro": true,
"names_behavior": "none",
"activation_regex": "",
"first_output_sequence": "",
"skip_examples": false,
"output_suffix": "",
"input_suffix": "",
"system_suffix": "",
"user_alignment_message": "",
"system_same_as_user": false,
"last_system_sequence": "",
"first_input_sequence": "",
"last_input_sequence": "",
"sequences_as_stop_strings": true,
"story_string_prefix": "<|start_header_id|>system<|end_header_id|>\n",
"story_string_suffix": "",
"name": "DreamGen Role-Play V1 Llama3"
}
@@ -0,0 +1,25 @@
{
"input_sequence": "<|turn>user\n",
"output_sequence": "<|turn>model\n",
"last_output_sequence": "",
"system_sequence": "<|turn>system\n",
"stop_sequence": "<turn|>",
"wrap": false,
"macro": true,
"names_behavior": "force",
"activation_regex": "",
"first_output_sequence": "",
"skip_examples": false,
"output_suffix": "<turn|>\n",
"input_suffix": "<turn|>\n",
"system_suffix": "<turn|>\n",
"user_alignment_message": "",
"system_same_as_user": false,
"last_system_sequence": "",
"first_input_sequence": "",
"last_input_sequence": "",
"sequences_as_stop_strings": true,
"story_string_prefix": "<|turn>system\n",
"story_string_suffix": "<turn|>\n",
"name": "Gemma 4"
}
@@ -1,6 +1,6 @@
{
"input_sequence": "{{[INPUT]}}",
"output_sequence": "{{[OUPUT]}}",
"output_sequence": "{{[OUTPUT]}}",
"last_output_sequence": "",
"system_sequence": "{{[SYSTEM]}}",
"stop_sequence": "",
@@ -1,6 +1,6 @@
{
"input_sequence": "[INST]",
"output_sequence": " ",
"output_sequence": "",
"last_output_sequence": "",
"system_sequence": "[SYSTEM_PROMPT]",
"stop_sequence": "</s>",
@@ -1,24 +0,0 @@
{
"temp": 1.15,
"rep_pen": 1.05,
"rep_pen_range": 2048,
"top_p": 0.95,
"top_a": 0,
"top_k": 0,
"typical": 1,
"tfs": 0.8,
"rep_pen_slope": 7,
"sampler_order": [
6,
3,
2,
0,
5,
1,
4
],
"mirostat": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"grammar": ""
}
@@ -1,24 +0,0 @@
{
"temp": 0.59,
"rep_pen": 1.1,
"rep_pen_range": 2048,
"top_p": 1,
"top_a": 0,
"top_k": 0,
"typical": 1,
"tfs": 0.87,
"rep_pen_slope": 0.3,
"sampler_order": [
6,
5,
0,
2,
3,
1,
4
],
"mirostat": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"grammar": ""
}
@@ -1,24 +0,0 @@
{
"temp": 0.8,
"rep_pen": 1.15,
"rep_pen_range": 2048,
"top_p": 0.9,
"top_a": 0,
"top_k": 100,
"typical": 1,
"tfs": 1,
"rep_pen_slope": 3.4,
"sampler_order": [
6,
5,
0,
2,
3,
1,
4
],
"mirostat": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"grammar": ""
}
@@ -1,24 +0,0 @@
{
"temp": 0.51,
"rep_pen": 1.2,
"rep_pen_range": 2048,
"top_p": 1,
"top_a": 0,
"top_k": 0,
"typical": 1,
"tfs": 0.99,
"rep_pen_slope": 0,
"sampler_order": [
6,
5,
0,
2,
3,
1,
4
],
"mirostat": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"grammar": ""
}
@@ -1,8 +1,9 @@
{
"temp": 0,
"rep_pen": 1.18,
"rep_pen_range": 2048,
"rep_pen": 1,
"rep_pen_range": 0,
"top_p": 0,
"min_p": 0,
"top_a": 0,
"top_k": 1,
"typical": 1,
@@ -20,5 +21,6 @@
"mirostat": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"use_default_badwordsids": false,
"grammar": ""
}
}
@@ -1,24 +0,0 @@
{
"temp": 0.63,
"rep_pen": 1.05,
"rep_pen_range": 2048,
"top_p": 0.98,
"top_a": 0,
"top_k": 0,
"typical": 1,
"tfs": 0.98,
"rep_pen_slope": 0.1,
"sampler_order": [
6,
2,
0,
3,
5,
1,
4
],
"mirostat": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"grammar": ""
}
@@ -1,24 +0,0 @@
{
"temp": 0.7,
"rep_pen": 1.1,
"rep_pen_range": 1024,
"top_p": 0.5,
"top_a": 0.75,
"top_k": 0,
"typical": 0.19,
"tfs": 0.97,
"rep_pen_slope": 0.7,
"sampler_order": [
6,
5,
4,
3,
2,
1,
0
],
"mirostat": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"grammar": ""
}
@@ -1,24 +0,0 @@
{
"temp": 0.7,
"rep_pen": 1.1,
"rep_pen_range": 1024,
"top_p": 1,
"top_a": 0,
"top_k": 0,
"typical": 1,
"tfs": 0.9,
"rep_pen_slope": 0.7,
"sampler_order": [
6,
0,
1,
2,
3,
4,
5
],
"mirostat": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"grammar": ""
}
@@ -1,24 +0,0 @@
{
"temp": 0.66,
"rep_pen": 1.1,
"rep_pen_range": 1024,
"top_p": 1,
"top_a": 0.96,
"top_k": 0,
"typical": 0.6,
"tfs": 1,
"rep_pen_slope": 0.7,
"sampler_order": [
6,
4,
5,
1,
0,
2,
3
],
"mirostat": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"grammar": ""
}
@@ -1,24 +0,0 @@
{
"temp": 0.94,
"rep_pen": 1.05,
"rep_pen_range": 2048,
"top_p": 1,
"top_a": 0,
"top_k": 12,
"typical": 1,
"tfs": 0.94,
"rep_pen_slope": 0.2,
"sampler_order": [
6,
5,
0,
2,
3,
1,
4
],
"mirostat": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"grammar": ""
}
@@ -1,24 +0,0 @@
{
"temp": 1.5,
"rep_pen": 1.1,
"rep_pen_range": 2048,
"top_p": 0.24,
"top_a": 0,
"top_k": 85,
"typical": 1,
"tfs": 1,
"rep_pen_slope": 0,
"sampler_order": [
6,
5,
0,
2,
3,
1,
4
],
"mirostat": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"grammar": ""
}
@@ -1,24 +0,0 @@
{
"temp": 1.05,
"rep_pen": 1.1,
"rep_pen_range": 1024,
"top_p": 0.95,
"top_a": 0,
"top_k": 0,
"typical": 1,
"tfs": 1,
"rep_pen_slope": 0.7,
"sampler_order": [
6,
0,
1,
2,
3,
4,
5
],
"mirostat": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"grammar": ""
}
@@ -1,24 +0,0 @@
{
"temp": 1.06,
"rep_pen": 1,
"rep_pen_range": 0,
"top_p": 1,
"top_a": 0,
"top_k": 0,
"typical": 1,
"tfs": 1,
"rep_pen_slope": 0.9,
"sampler_order": [
6,
0,
1,
3,
4,
2,
5
],
"mirostat": 2,
"mirostat_tau": 9.61,
"mirostat_eta": 1,
"grammar": ""
}
@@ -1,24 +0,0 @@
{
"temp": 1.17,
"rep_pen": 1,
"rep_pen_range": 0,
"top_p": 1,
"top_a": 0,
"top_k": 0,
"typical": 1,
"tfs": 1,
"rep_pen_slope": 0.9,
"sampler_order": [
6,
0,
1,
3,
4,
2,
5
],
"mirostat": 2,
"mirostat_tau": 9.91,
"mirostat_eta": 1,
"grammar": ""
}
@@ -1,24 +0,0 @@
{
"temp": 1.17,
"rep_pen": 1,
"rep_pen_range": 0,
"top_p": 1,
"top_a": 0,
"top_k": 0,
"typical": 1,
"tfs": 1,
"rep_pen_slope": 0.9,
"sampler_order": [
6,
0,
1,
3,
4,
2,
5
],
"mirostat": 2,
"mirostat_tau": 9.62,
"mirostat_eta": 1,
"grammar": ""
}
@@ -1,12 +1,13 @@
{
"temp": 0.7,
"rep_pen": 1.15,
"rep_pen_range": 2048,
"temp": 1,
"rep_pen": 1,
"rep_pen_range": 0,
"top_p": 1,
"top_a": 0.2,
"min_p": 0,
"top_a": 0,
"top_k": 0,
"typical": 1,
"tfs": 0.95,
"tfs": 1,
"rep_pen_slope": 0,
"sampler_order": [
6,
@@ -20,5 +21,6 @@
"mirostat": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"use_default_badwordsids": false,
"grammar": ""
}
}
@@ -1,24 +0,0 @@
{
"temp": 1.07,
"rep_pen": 1.05,
"rep_pen_range": 404,
"top_p": 1,
"top_a": 0,
"top_k": 100,
"typical": 1,
"tfs": 0.93,
"rep_pen_slope": 0.8,
"sampler_order": [
6,
0,
5,
3,
2,
1,
4
],
"mirostat": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"grammar": ""
}
@@ -1,24 +0,0 @@
{
"temp": 0.44,
"rep_pen": 1.15,
"rep_pen_range": 2048,
"top_p": 1,
"top_a": 0,
"top_k": 0,
"typical": 1,
"tfs": 0.9,
"rep_pen_slope": 6.8,
"sampler_order": [
6,
5,
0,
2,
3,
1,
4
],
"mirostat": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"grammar": ""
}
@@ -1,24 +0,0 @@
{
"temp": 1.35,
"rep_pen": 1.15,
"rep_pen_range": 2048,
"top_p": 1,
"top_a": 0,
"top_k": 0,
"typical": 1,
"tfs": 0.69,
"rep_pen_slope": 0.1,
"sampler_order": [
6,
3,
2,
5,
0,
1,
4
],
"mirostat": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"grammar": ""
}
@@ -3,6 +3,7 @@
"rep_pen": 1.1,
"rep_pen_range": 600,
"top_p": 0.95,
"min_p": 0.01,
"top_a": 0,
"top_k": 0,
"typical": 1,
@@ -20,5 +21,6 @@
"mirostat": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"use_default_badwordsids": false,
"grammar": ""
}
}
@@ -1,24 +0,0 @@
{
"temp": 1.31,
"rep_pen": 1.09,
"rep_pen_range": 2048,
"top_p": 0.29,
"top_a": 0,
"top_k": 72,
"typical": 1,
"tfs": 1,
"rep_pen_slope": 0,
"sampler_order": [
6,
0,
1,
3,
4,
2,
5
],
"mirostat": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"grammar": ""
}
@@ -1,24 +0,0 @@
{
"temp": 0.72,
"rep_pen": 1.1,
"rep_pen_range": 2048,
"top_p": 0.73,
"top_a": 0,
"top_k": 0,
"typical": 1,
"tfs": 1,
"rep_pen_slope": 0.2,
"sampler_order": [
6,
5,
0,
2,
3,
1,
4
],
"mirostat": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"grammar": ""
}
@@ -1,24 +0,0 @@
{
"temp": 1.01,
"rep_pen": 1.21,
"rep_pen_range": 2048,
"top_p": 0.21,
"top_a": 0.75,
"top_k": 91,
"typical": 1,
"tfs": 1,
"rep_pen_slope": 0,
"sampler_order": [
6,
0,
1,
3,
4,
2,
5
],
"mirostat": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"grammar": ""
}
@@ -1,7 +1,7 @@
{
"temp": 1.5,
"rep_pen": 1,
"rep_pen_range": 600,
"rep_pen_range": 0,
"top_p": 1,
"min_p": 0.1,
"top_a": 0,
@@ -1,7 +1,7 @@
{
"temp": 1.25,
"rep_pen": 1,
"rep_pen_range": 600,
"rep_pen_range": 0,
"top_p": 1,
"min_p": 0.1,
"top_a": 0,
@@ -1,7 +1,7 @@
{
"temp": 2,
"rep_pen": 1,
"rep_pen_range": 600,
"rep_pen_range": 0,
"top_p": 1,
"min_p": 0.1,
"top_a": 0,
@@ -1,24 +0,0 @@
{
"temp": 0.65,
"rep_pen": 1.18,
"rep_pen_range": 2048,
"top_p": 0.47,
"top_a": 0,
"top_k": 42,
"typical": 1,
"tfs": 1,
"rep_pen_slope": 0,
"sampler_order": [
6,
0,
1,
3,
4,
2,
5
],
"mirostat": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"grammar": ""
}
+13 -7
View File
@@ -1,20 +1,27 @@
{
"chat_completion_source": "openai",
"openai_model": "gpt-4-turbo",
"claude_model": "claude-3-5-sonnet-20240620",
"openai_model": "gpt-5.6-terra",
"claude_model": "claude-sonnet-5",
"openrouter_model": "OR_Website",
"openrouter_use_fallback": false,
"openrouter_group_models": false,
"openrouter_sort_models": "alphabetically",
"ai21_model": "jamba-large",
"mistralai_model": "mistral-large-latest",
"chutes_model": "deepseek-ai/DeepSeek-V3-0324",
"chutes_sort_models": "alphabetically",
"minimax_model": "MiniMax-M2.7",
"minimax_endpoint": "global",
"electronhub_model": "gpt-4o-mini",
"electronhub_sort_models": "alphabetically",
"electronhub_group_models": false,
"custom_model": "",
"custom_url": "",
"custom_include_body": "",
"custom_exclude_body": "",
"custom_include_headers": "",
"google_model": "gemini-pro",
"vertexai_model": "gemini-2.0-flash-001",
"google_model": "gemini-3.7-flash",
"vertexai_model": "gemini-3.7-flash",
"temperature": 1,
"frequency_penalty": 0,
"presence_penalty": 0,
@@ -25,7 +32,6 @@
"repetition_penalty": 1,
"openai_max_context": 4095,
"openai_max_tokens": 300,
"wrap_in_quotes": false,
"names_behavior": 0,
"send_if_empty": "",
"impersonation_prompt": "[Write your next reply from the point of view of {{user}}, using the chat history so far as a guideline for the writing style of {{user}}. Don't write as {{char}} or system. Don't describe actions of {{char}}.]",
@@ -228,9 +234,9 @@
"show_external_models": false,
"assistant_prefill": "",
"assistant_impersonation": "",
"claude_use_sysprompt": false,
"use_sysprompt": false,
"squash_system_messages": false,
"image_inlining": false,
"media_inlining": true,
"bypass_status_check": false,
"continue_prefill": false,
"continue_postfix": " ",
@@ -0,0 +1,6 @@
{
"name": "Gemma 4",
"prefix": "<|channel>thought\n",
"suffix": "<channel|>",
"separator": "\n\n"
}
@@ -0,0 +1,6 @@
{
"name": "Think XML",
"prefix": "<think>",
"suffix": "</think>",
"separator": "\n"
}
@@ -1,85 +0,0 @@
{
"temp": 1.68,
"temperature_last": true,
"top_p": 0.17,
"top_k": 77,
"top_a": 0.42,
"tfs": 0.97,
"epsilon_cutoff": 0,
"eta_cutoff": 0,
"typical_p": 1,
"min_p": 0,
"rep_pen": 1.02,
"rep_pen_range": 0,
"rep_pen_decay": 0,
"rep_pen_slope": 1,
"no_repeat_ngram_size": 0,
"penalty_alpha": 0,
"num_beams": 1,
"length_penalty": 1,
"min_length": 0,
"encoder_rep_pen": 1,
"freq_pen": 0,
"presence_pen": 0,
"skew": 0,
"do_sample": true,
"early_stopping": false,
"dynatemp": false,
"min_temp": 0,
"max_temp": 2,
"dynatemp_exponent": 1,
"smoothing_factor": 0,
"smoothing_curve": 1,
"dry_allowed_length": 2,
"dry_multiplier": 0,
"dry_base": 1.75,
"dry_sequence_breakers": "[\"\\n\", \":\", \"\\\"\", \"*\"]",
"dry_penalty_last_n": 0,
"add_bos_token": true,
"ban_eos_token": false,
"skip_special_tokens": true,
"mirostat_mode": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"guidance_scale": 1,
"negative_prompt": "",
"grammar_string": "",
"json_schema": {},
"banned_tokens": "",
"sampler_priority": [
"temperature",
"dynamic_temperature",
"quadratic_sampling",
"top_k",
"top_p",
"typical_p",
"epsilon_cutoff",
"eta_cutoff",
"tfs",
"top_a",
"min_p",
"mirostat"
],
"samplers": [
"top_k",
"tfs_z",
"typical_p",
"top_p",
"min_p",
"temperature"
],
"ignore_eos_token": false,
"spaces_between_special_tokens": true,
"speculative_ngram": false,
"sampler_order": [
6,
0,
1,
3,
4,
2,
5
],
"logit_bias": [],
"rep_pen_size": 0
}
@@ -1,85 +0,0 @@
{
"temp": 0.7,
"temperature_last": true,
"top_p": 0.92,
"top_k": 150,
"top_a": 0,
"tfs": 1,
"epsilon_cutoff": 0,
"eta_cutoff": 0,
"typical_p": 1,
"min_p": 0,
"rep_pen": 3,
"rep_pen_range": 0,
"rep_pen_decay": 0,
"rep_pen_slope": 1,
"no_repeat_ngram_size": 2,
"penalty_alpha": 0,
"num_beams": 10,
"length_penalty": 1.4,
"min_length": 200,
"encoder_rep_pen": 1,
"freq_pen": 0,
"presence_pen": 0,
"skew": 0,
"do_sample": true,
"early_stopping": true,
"dynatemp": false,
"min_temp": 0,
"max_temp": 2,
"dynatemp_exponent": 1,
"smoothing_factor": 0,
"smoothing_curve": 1,
"dry_allowed_length": 2,
"dry_multiplier": 0,
"dry_base": 1.75,
"dry_sequence_breakers": "[\"\\n\", \":\", \"\\\"\", \"*\"]",
"dry_penalty_last_n": 0,
"add_bos_token": true,
"ban_eos_token": false,
"skip_special_tokens": true,
"mirostat_mode": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"guidance_scale": 1,
"negative_prompt": "",
"grammar_string": "",
"json_schema": {},
"banned_tokens": "",
"sampler_priority": [
"temperature",
"dynamic_temperature",
"quadratic_sampling",
"top_k",
"top_p",
"typical_p",
"epsilon_cutoff",
"eta_cutoff",
"tfs",
"top_a",
"min_p",
"mirostat"
],
"samplers": [
"top_k",
"tfs_z",
"typical_p",
"top_p",
"min_p",
"temperature"
],
"ignore_eos_token": false,
"spaces_between_special_tokens": true,
"speculative_ngram": false,
"sampler_order": [
6,
0,
1,
3,
4,
2,
5
],
"logit_bias": [],
"rep_pen_size": 0
}
@@ -1,85 +0,0 @@
{
"temp": 0.87,
"temperature_last": true,
"top_p": 0.99,
"top_k": 85,
"top_a": 0,
"tfs": 0.68,
"epsilon_cutoff": 0,
"eta_cutoff": 0,
"typical_p": 0.68,
"min_p": 0,
"rep_pen": 1.01,
"rep_pen_range": 0,
"rep_pen_decay": 0,
"rep_pen_slope": 1,
"no_repeat_ngram_size": 0,
"penalty_alpha": 0,
"num_beams": 1,
"length_penalty": 1,
"min_length": 0,
"encoder_rep_pen": 1,
"freq_pen": 0,
"presence_pen": 0,
"skew": 0,
"do_sample": true,
"early_stopping": false,
"dynatemp": false,
"min_temp": 0,
"max_temp": 2,
"dynatemp_exponent": 1,
"smoothing_factor": 0,
"smoothing_curve": 1,
"dry_allowed_length": 2,
"dry_multiplier": 0,
"dry_base": 1.75,
"dry_sequence_breakers": "[\"\\n\", \":\", \"\\\"\", \"*\"]",
"dry_penalty_last_n": 0,
"add_bos_token": true,
"ban_eos_token": false,
"skip_special_tokens": true,
"mirostat_mode": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"guidance_scale": 1,
"negative_prompt": "",
"grammar_string": "",
"json_schema": {},
"banned_tokens": "",
"sampler_priority": [
"temperature",
"dynamic_temperature",
"quadratic_sampling",
"top_k",
"top_p",
"typical_p",
"epsilon_cutoff",
"eta_cutoff",
"tfs",
"top_a",
"min_p",
"mirostat"
],
"samplers": [
"top_k",
"tfs_z",
"typical_p",
"top_p",
"min_p",
"temperature"
],
"ignore_eos_token": false,
"spaces_between_special_tokens": true,
"speculative_ngram": false,
"sampler_order": [
6,
0,
1,
3,
4,
2,
5
],
"logit_bias": [],
"rep_pen_size": 0
}
@@ -1,85 +0,0 @@
{
"temp": 1,
"temperature_last": true,
"top_p": 1,
"top_k": 4,
"top_a": 0,
"tfs": 1,
"epsilon_cutoff": 0,
"eta_cutoff": 0,
"typical_p": 1,
"min_p": 0,
"rep_pen": 1,
"rep_pen_range": 0,
"rep_pen_decay": 0,
"rep_pen_slope": 1,
"no_repeat_ngram_size": 0,
"penalty_alpha": 0.6,
"num_beams": 1,
"length_penalty": 1,
"min_length": 0,
"encoder_rep_pen": 1,
"freq_pen": 0,
"presence_pen": 0,
"skew": 0,
"do_sample": false,
"early_stopping": false,
"dynatemp": false,
"min_temp": 0,
"max_temp": 2,
"dynatemp_exponent": 1,
"smoothing_factor": 0,
"smoothing_curve": 1,
"dry_allowed_length": 2,
"dry_multiplier": 0,
"dry_base": 1.75,
"dry_sequence_breakers": "[\"\\n\", \":\", \"\\\"\", \"*\"]",
"dry_penalty_last_n": 0,
"add_bos_token": true,
"ban_eos_token": false,
"skip_special_tokens": true,
"mirostat_mode": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"guidance_scale": 1,
"negative_prompt": "",
"grammar_string": "",
"json_schema": {},
"banned_tokens": "",
"sampler_priority": [
"temperature",
"dynamic_temperature",
"quadratic_sampling",
"top_k",
"top_p",
"typical_p",
"epsilon_cutoff",
"eta_cutoff",
"tfs",
"top_a",
"min_p",
"mirostat"
],
"samplers": [
"top_k",
"tfs_z",
"typical_p",
"top_p",
"min_p",
"temperature"
],
"ignore_eos_token": false,
"spaces_between_special_tokens": true,
"speculative_ngram": false,
"sampler_order": [
6,
0,
1,
3,
4,
2,
5
],
"logit_bias": [],
"rep_pen_size": 0
}
+41 -7
View File
@@ -1,15 +1,15 @@
{
"temp": 0.7,
"temp": 1,
"temperature_last": true,
"top_p": 0.5,
"top_k": 40,
"top_p": 0.95,
"top_k": 0,
"top_a": 0,
"tfs": 1,
"epsilon_cutoff": 0,
"eta_cutoff": 0,
"typical_p": 1,
"min_p": 0,
"rep_pen": 1.2,
"min_p": 0.01,
"rep_pen": 1.1,
"rep_pen_range": 0,
"rep_pen_decay": 0,
"rep_pen_slope": 1,
@@ -44,12 +44,18 @@
"guidance_scale": 1,
"negative_prompt": "",
"grammar_string": "",
"json_schema": {},
"json_schema": null,
"json_schema_allow_empty": false,
"banned_tokens": "",
"sampler_priority": [
"repetition_penalty",
"presence_penalty",
"frequency_penalty",
"dry",
"temperature",
"dynamic_temperature",
"quadratic_sampling",
"top_n_sigma",
"top_k",
"top_p",
"typical_p",
@@ -58,16 +64,40 @@
"tfs",
"top_a",
"min_p",
"mirostat"
"mirostat",
"xtc",
"encoder_repetition_penalty",
"no_repeat_ngram"
],
"samplers": [
"penalties",
"dry",
"top_n_sigma",
"top_k",
"typ_p",
"tfs_z",
"typical_p",
"xtc",
"top_p",
"min_p",
"temperature"
],
"samplers_priorities": [
"dry",
"penalties",
"no_repeat_ngram",
"temperature",
"top_nsigma",
"top_p_top_k",
"top_a",
"min_p",
"tfs",
"eta_cutoff",
"epsilon_cutoff",
"typical_p",
"quadratic",
"xtc"
],
"ignore_eos_token": false,
"spaces_between_special_tokens": true,
"speculative_ngram": false,
@@ -81,5 +111,9 @@
5
],
"logit_bias": [],
"xtc_threshold": 0.1,
"xtc_probability": 0,
"nsigma": 0,
"min_keep": 0,
"rep_pen_size": 0
}
@@ -9,7 +9,7 @@
"eta_cutoff": 0,
"typical_p": 1,
"min_p": 0,
"rep_pen": 1.18,
"rep_pen": 1,
"rep_pen_range": 0,
"rep_pen_decay": 0,
"rep_pen_slope": 1,
@@ -44,12 +44,18 @@
"guidance_scale": 1,
"negative_prompt": "",
"grammar_string": "",
"json_schema": {},
"json_schema": null,
"json_schema_allow_empty": false,
"banned_tokens": "",
"sampler_priority": [
"repetition_penalty",
"presence_penalty",
"frequency_penalty",
"dry",
"temperature",
"dynamic_temperature",
"quadratic_sampling",
"top_n_sigma",
"top_k",
"top_p",
"typical_p",
@@ -58,16 +64,40 @@
"tfs",
"top_a",
"min_p",
"mirostat"
"mirostat",
"xtc",
"encoder_repetition_penalty",
"no_repeat_ngram"
],
"samplers": [
"penalties",
"dry",
"top_n_sigma",
"top_k",
"typ_p",
"tfs_z",
"typical_p",
"xtc",
"top_p",
"min_p",
"temperature"
],
"samplers_priorities": [
"dry",
"penalties",
"no_repeat_ngram",
"temperature",
"top_nsigma",
"top_p_top_k",
"top_a",
"min_p",
"tfs",
"eta_cutoff",
"epsilon_cutoff",
"typical_p",
"quadratic",
"xtc"
],
"ignore_eos_token": false,
"spaces_between_special_tokens": true,
"speculative_ngram": false,
@@ -81,5 +111,9 @@
5
],
"logit_bias": [],
"xtc_threshold": 0.1,
"xtc_probability": 0,
"nsigma": 0,
"min_keep": 0,
"rep_pen_size": 0
}
@@ -1,85 +0,0 @@
{
"temp": 1.31,
"temperature_last": true,
"top_p": 0.14,
"top_k": 49,
"top_a": 0.52,
"tfs": 1,
"epsilon_cutoff": 1.49,
"eta_cutoff": 10.42,
"typical_p": 1,
"min_p": 0,
"rep_pen": 1.17,
"rep_pen_range": 0,
"rep_pen_decay": 0,
"rep_pen_slope": 1,
"no_repeat_ngram_size": 0,
"penalty_alpha": 0,
"num_beams": 1,
"length_penalty": 1,
"min_length": 0,
"encoder_rep_pen": 1,
"freq_pen": 0,
"presence_pen": 0,
"skew": 0,
"do_sample": true,
"early_stopping": false,
"dynatemp": false,
"min_temp": 0,
"max_temp": 2,
"dynatemp_exponent": 1,
"smoothing_factor": 0,
"smoothing_curve": 1,
"dry_allowed_length": 2,
"dry_multiplier": 0,
"dry_base": 1.75,
"dry_sequence_breakers": "[\"\\n\", \":\", \"\\\"\", \"*\"]",
"dry_penalty_last_n": 0,
"add_bos_token": true,
"ban_eos_token": false,
"skip_special_tokens": true,
"mirostat_mode": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"guidance_scale": 1,
"negative_prompt": "",
"grammar_string": "",
"json_schema": {},
"banned_tokens": "",
"sampler_priority": [
"temperature",
"dynamic_temperature",
"quadratic_sampling",
"top_k",
"top_p",
"typical_p",
"epsilon_cutoff",
"eta_cutoff",
"tfs",
"top_a",
"min_p",
"mirostat"
],
"samplers": [
"top_k",
"tfs_z",
"typical_p",
"top_p",
"min_p",
"temperature"
],
"ignore_eos_token": false,
"spaces_between_special_tokens": true,
"speculative_ngram": false,
"sampler_order": [
6,
0,
1,
3,
4,
2,
5
],
"logit_bias": [],
"rep_pen_size": 0
}
@@ -1,85 +0,0 @@
{
"temp": 0.7,
"temperature_last": true,
"top_p": 0.5,
"top_k": 0,
"top_a": 0,
"tfs": 1,
"epsilon_cutoff": 0,
"eta_cutoff": 0,
"typical_p": 0.19,
"min_p": 0,
"rep_pen": 1.1,
"rep_pen_range": 0,
"rep_pen_decay": 0,
"rep_pen_slope": 1,
"no_repeat_ngram_size": 0,
"penalty_alpha": 0,
"num_beams": 1,
"length_penalty": 1,
"min_length": 0,
"encoder_rep_pen": 1,
"freq_pen": 0,
"presence_pen": 0,
"skew": 0,
"do_sample": true,
"early_stopping": false,
"dynatemp": false,
"min_temp": 0,
"max_temp": 2,
"dynatemp_exponent": 1,
"smoothing_factor": 0,
"smoothing_curve": 1,
"dry_allowed_length": 2,
"dry_multiplier": 0,
"dry_base": 1.75,
"dry_sequence_breakers": "[\"\\n\", \":\", \"\\\"\", \"*\"]",
"dry_penalty_last_n": 0,
"add_bos_token": true,
"ban_eos_token": false,
"skip_special_tokens": true,
"mirostat_mode": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"guidance_scale": 1,
"negative_prompt": "",
"grammar_string": "",
"json_schema": {},
"banned_tokens": "",
"sampler_priority": [
"temperature",
"dynamic_temperature",
"quadratic_sampling",
"top_k",
"top_p",
"typical_p",
"epsilon_cutoff",
"eta_cutoff",
"tfs",
"top_a",
"min_p",
"mirostat"
],
"samplers": [
"top_k",
"tfs_z",
"typical_p",
"top_p",
"min_p",
"temperature"
],
"ignore_eos_token": false,
"spaces_between_special_tokens": true,
"speculative_ngram": false,
"sampler_order": [
6,
0,
1,
3,
4,
2,
5
],
"logit_bias": [],
"rep_pen_size": 0
}
@@ -1,85 +0,0 @@
{
"temp": 0.66,
"temperature_last": true,
"top_p": 1,
"top_k": 0,
"top_a": 0,
"tfs": 1,
"epsilon_cutoff": 0,
"eta_cutoff": 0,
"typical_p": 0.6,
"min_p": 0,
"rep_pen": 1.1,
"rep_pen_range": 0,
"rep_pen_decay": 0,
"rep_pen_slope": 1,
"no_repeat_ngram_size": 0,
"penalty_alpha": 0,
"num_beams": 1,
"length_penalty": 1,
"min_length": 0,
"encoder_rep_pen": 1,
"freq_pen": 0,
"presence_pen": 0,
"skew": 0,
"do_sample": true,
"early_stopping": false,
"dynatemp": false,
"min_temp": 0,
"max_temp": 2,
"dynatemp_exponent": 1,
"smoothing_factor": 0,
"smoothing_curve": 1,
"dry_allowed_length": 2,
"dry_multiplier": 0,
"dry_base": 1.75,
"dry_sequence_breakers": "[\"\\n\", \":\", \"\\\"\", \"*\"]",
"dry_penalty_last_n": 0,
"add_bos_token": true,
"ban_eos_token": false,
"skip_special_tokens": true,
"mirostat_mode": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"guidance_scale": 1,
"negative_prompt": "",
"grammar_string": "",
"json_schema": {},
"banned_tokens": "",
"sampler_priority": [
"temperature",
"dynamic_temperature",
"quadratic_sampling",
"top_k",
"top_p",
"typical_p",
"epsilon_cutoff",
"eta_cutoff",
"tfs",
"top_a",
"min_p",
"mirostat"
],
"samplers": [
"top_k",
"tfs_z",
"typical_p",
"top_p",
"min_p",
"temperature"
],
"ignore_eos_token": false,
"spaces_between_special_tokens": true,
"speculative_ngram": false,
"sampler_order": [
6,
0,
1,
3,
4,
2,
5
],
"logit_bias": [],
"rep_pen_size": 0
}
@@ -1,85 +0,0 @@
{
"temp": 0.7,
"temperature_last": true,
"top_p": 0.1,
"top_k": 40,
"top_a": 0,
"tfs": 1,
"epsilon_cutoff": 0,
"eta_cutoff": 0,
"typical_p": 1,
"min_p": 0,
"rep_pen": 1.18,
"rep_pen_range": 0,
"rep_pen_decay": 0,
"rep_pen_slope": 1,
"no_repeat_ngram_size": 0,
"penalty_alpha": 0,
"num_beams": 1,
"length_penalty": 1,
"min_length": 200,
"encoder_rep_pen": 1,
"freq_pen": 0,
"presence_pen": 0,
"skew": 0,
"do_sample": true,
"early_stopping": false,
"dynatemp": false,
"min_temp": 0,
"max_temp": 2,
"dynatemp_exponent": 1,
"smoothing_factor": 0,
"smoothing_curve": 1,
"dry_allowed_length": 2,
"dry_multiplier": 0,
"dry_base": 1.75,
"dry_sequence_breakers": "[\"\\n\", \":\", \"\\\"\", \"*\"]",
"dry_penalty_last_n": 0,
"add_bos_token": true,
"ban_eos_token": false,
"skip_special_tokens": true,
"mirostat_mode": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"guidance_scale": 1,
"negative_prompt": "",
"grammar_string": "",
"json_schema": {},
"banned_tokens": "",
"sampler_priority": [
"temperature",
"dynamic_temperature",
"quadratic_sampling",
"top_k",
"top_p",
"typical_p",
"epsilon_cutoff",
"eta_cutoff",
"tfs",
"top_a",
"min_p",
"mirostat"
],
"samplers": [
"top_k",
"tfs_z",
"typical_p",
"top_p",
"min_p",
"temperature"
],
"ignore_eos_token": false,
"spaces_between_special_tokens": true,
"speculative_ngram": false,
"sampler_order": [
6,
0,
1,
3,
4,
2,
5
],
"logit_bias": [],
"rep_pen_size": 0
}
@@ -1,85 +0,0 @@
{
"temp": 0.98,
"temperature_last": true,
"top_p": 0.37,
"top_k": 100,
"top_a": 0,
"tfs": 1,
"epsilon_cutoff": 0,
"eta_cutoff": 0,
"typical_p": 1,
"min_p": 0,
"rep_pen": 1.18,
"rep_pen_range": 0,
"rep_pen_decay": 0,
"rep_pen_slope": 1,
"no_repeat_ngram_size": 0,
"penalty_alpha": 0,
"num_beams": 1,
"length_penalty": 1,
"min_length": 0,
"encoder_rep_pen": 1,
"freq_pen": 0,
"presence_pen": 0,
"skew": 0,
"do_sample": true,
"early_stopping": false,
"dynatemp": false,
"min_temp": 0,
"max_temp": 2,
"dynatemp_exponent": 1,
"smoothing_factor": 0,
"smoothing_curve": 1,
"dry_allowed_length": 2,
"dry_multiplier": 0,
"dry_base": 1.75,
"dry_sequence_breakers": "[\"\\n\", \":\", \"\\\"\", \"*\"]",
"dry_penalty_last_n": 0,
"add_bos_token": true,
"ban_eos_token": false,
"skip_special_tokens": true,
"mirostat_mode": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"guidance_scale": 1,
"negative_prompt": "",
"grammar_string": "",
"json_schema": {},
"banned_tokens": "",
"sampler_priority": [
"temperature",
"dynamic_temperature",
"quadratic_sampling",
"top_k",
"top_p",
"typical_p",
"epsilon_cutoff",
"eta_cutoff",
"tfs",
"top_a",
"min_p",
"mirostat"
],
"samplers": [
"top_k",
"tfs_z",
"typical_p",
"top_p",
"min_p",
"temperature"
],
"ignore_eos_token": false,
"spaces_between_special_tokens": true,
"speculative_ngram": false,
"sampler_order": [
6,
0,
1,
3,
4,
2,
5
],
"logit_bias": [],
"rep_pen_size": 0
}
@@ -1,85 +0,0 @@
{
"temp": 1.06,
"temperature_last": true,
"top_p": 1,
"top_k": 0,
"top_a": 0,
"tfs": 1,
"epsilon_cutoff": 0,
"eta_cutoff": 0,
"typical_p": 1,
"min_p": 0,
"rep_pen": 1,
"rep_pen_range": 0,
"rep_pen_decay": 0,
"rep_pen_slope": 1,
"no_repeat_ngram_size": 0,
"penalty_alpha": 0,
"num_beams": 1,
"length_penalty": 1,
"min_length": 0,
"encoder_rep_pen": 1,
"freq_pen": 0,
"presence_pen": 0,
"skew": 0,
"do_sample": true,
"early_stopping": false,
"dynatemp": false,
"min_temp": 0,
"max_temp": 2,
"dynatemp_exponent": 1,
"smoothing_factor": 0,
"smoothing_curve": 1,
"dry_allowed_length": 2,
"dry_multiplier": 0,
"dry_base": 1.75,
"dry_sequence_breakers": "[\"\\n\", \":\", \"\\\"\", \"*\"]",
"dry_penalty_last_n": 0,
"add_bos_token": true,
"ban_eos_token": false,
"skip_special_tokens": true,
"mirostat_mode": 2,
"mirostat_tau": 9.61,
"mirostat_eta": 1,
"guidance_scale": 1,
"negative_prompt": "",
"grammar_string": "",
"json_schema": {},
"banned_tokens": "",
"sampler_priority": [
"temperature",
"dynamic_temperature",
"quadratic_sampling",
"top_k",
"top_p",
"typical_p",
"epsilon_cutoff",
"eta_cutoff",
"tfs",
"top_a",
"min_p",
"mirostat"
],
"samplers": [
"top_k",
"tfs_z",
"typical_p",
"top_p",
"min_p",
"temperature"
],
"ignore_eos_token": false,
"spaces_between_special_tokens": true,
"speculative_ngram": false,
"sampler_order": [
6,
0,
1,
3,
4,
2,
5
],
"logit_bias": [],
"rep_pen_size": 0
}
@@ -1,85 +0,0 @@
{
"temp": 1.17,
"temperature_last": true,
"top_p": 1,
"top_k": 0,
"top_a": 0,
"tfs": 1,
"epsilon_cutoff": 0,
"eta_cutoff": 0,
"typical_p": 1,
"min_p": 0,
"rep_pen": 1,
"rep_pen_range": 0,
"rep_pen_decay": 0,
"rep_pen_slope": 1,
"no_repeat_ngram_size": 0,
"penalty_alpha": 0,
"num_beams": 1,
"length_penalty": 1,
"min_length": 0,
"encoder_rep_pen": 1,
"freq_pen": 0,
"presence_pen": 0,
"skew": 0,
"do_sample": true,
"early_stopping": false,
"dynatemp": false,
"min_temp": 0,
"max_temp": 2,
"dynatemp_exponent": 1,
"smoothing_factor": 0,
"smoothing_curve": 1,
"dry_allowed_length": 2,
"dry_multiplier": 0,
"dry_base": 1.75,
"dry_sequence_breakers": "[\"\\n\", \":\", \"\\\"\", \"*\"]",
"dry_penalty_last_n": 0,
"add_bos_token": true,
"ban_eos_token": false,
"skip_special_tokens": true,
"mirostat_mode": 2,
"mirostat_tau": 9.91,
"mirostat_eta": 1,
"guidance_scale": 1,
"negative_prompt": "",
"grammar_string": "",
"json_schema": {},
"banned_tokens": "",
"sampler_priority": [
"temperature",
"dynamic_temperature",
"quadratic_sampling",
"top_k",
"top_p",
"typical_p",
"epsilon_cutoff",
"eta_cutoff",
"tfs",
"top_a",
"min_p",
"mirostat"
],
"samplers": [
"top_k",
"tfs_z",
"typical_p",
"top_p",
"min_p",
"temperature"
],
"ignore_eos_token": false,
"spaces_between_special_tokens": true,
"speculative_ngram": false,
"sampler_order": [
6,
0,
1,
3,
4,
2,
5
],
"logit_bias": [],
"rep_pen_size": 0
}
@@ -1,85 +0,0 @@
{
"temp": 1.17,
"temperature_last": true,
"top_p": 1,
"top_k": 0,
"top_a": 0,
"tfs": 1,
"epsilon_cutoff": 0,
"eta_cutoff": 0,
"typical_p": 1,
"min_p": 0,
"rep_pen": 1,
"rep_pen_range": 0,
"rep_pen_decay": 0,
"rep_pen_slope": 1,
"no_repeat_ngram_size": 0,
"penalty_alpha": 0,
"num_beams": 1,
"length_penalty": 1,
"min_length": 0,
"encoder_rep_pen": 1,
"freq_pen": 0,
"presence_pen": 0,
"skew": 0,
"do_sample": true,
"early_stopping": false,
"dynatemp": false,
"min_temp": 0,
"max_temp": 2,
"dynatemp_exponent": 1,
"smoothing_factor": 0,
"smoothing_curve": 1,
"dry_allowed_length": 2,
"dry_multiplier": 0,
"dry_base": 1.75,
"dry_sequence_breakers": "[\"\\n\", \":\", \"\\\"\", \"*\"]",
"dry_penalty_last_n": 0,
"add_bos_token": true,
"ban_eos_token": false,
"skip_special_tokens": true,
"mirostat_mode": 2,
"mirostat_tau": 9.62,
"mirostat_eta": 1,
"guidance_scale": 1,
"negative_prompt": "",
"grammar_string": "",
"json_schema": {},
"banned_tokens": "",
"sampler_priority": [
"temperature",
"dynamic_temperature",
"quadratic_sampling",
"top_k",
"top_p",
"typical_p",
"epsilon_cutoff",
"eta_cutoff",
"tfs",
"top_a",
"min_p",
"mirostat"
],
"samplers": [
"top_k",
"tfs_z",
"typical_p",
"top_p",
"min_p",
"temperature"
],
"ignore_eos_token": false,
"spaces_between_special_tokens": true,
"speculative_ngram": false,
"sampler_order": [
6,
0,
1,
3,
4,
2,
5
],
"logit_bias": [],
"rep_pen_size": 0
}
@@ -1,85 +0,0 @@
{
"temp": 1,
"temperature_last": true,
"top_p": 1,
"top_k": 0,
"top_a": 0,
"tfs": 1,
"epsilon_cutoff": 0,
"eta_cutoff": 0,
"typical_p": 1,
"min_p": 0,
"rep_pen": 1,
"rep_pen_range": 0,
"rep_pen_decay": 0,
"rep_pen_slope": 1,
"no_repeat_ngram_size": 0,
"penalty_alpha": 0,
"num_beams": 1,
"length_penalty": 1,
"min_length": 0,
"encoder_rep_pen": 1,
"freq_pen": 0,
"presence_pen": 0,
"skew": 0,
"do_sample": true,
"early_stopping": false,
"dynatemp": false,
"min_temp": 0,
"max_temp": 2,
"dynatemp_exponent": 1,
"smoothing_factor": 0,
"smoothing_curve": 1,
"dry_allowed_length": 2,
"dry_multiplier": 0,
"dry_base": 1.75,
"dry_sequence_breakers": "[\"\\n\", \":\", \"\\\"\", \"*\"]",
"dry_penalty_last_n": 0,
"add_bos_token": true,
"ban_eos_token": false,
"skip_special_tokens": true,
"mirostat_mode": 2,
"mirostat_tau": 8,
"mirostat_eta": 0.1,
"guidance_scale": 1,
"negative_prompt": "",
"grammar_string": "",
"json_schema": {},
"banned_tokens": "",
"sampler_priority": [
"temperature",
"dynamic_temperature",
"quadratic_sampling",
"top_k",
"top_p",
"typical_p",
"epsilon_cutoff",
"eta_cutoff",
"tfs",
"top_a",
"min_p",
"mirostat"
],
"samplers": [
"top_k",
"tfs_z",
"typical_p",
"top_p",
"min_p",
"temperature"
],
"ignore_eos_token": false,
"spaces_between_special_tokens": true,
"speculative_ngram": false,
"sampler_order": [
6,
0,
1,
3,
4,
2,
5
],
"logit_bias": [],
"rep_pen_size": 0
}
@@ -1,85 +0,0 @@
{
"temp": 0.7,
"temperature_last": true,
"top_p": 0.85,
"top_k": 50,
"top_a": 0,
"tfs": 1,
"epsilon_cutoff": 0,
"eta_cutoff": 0,
"typical_p": 1,
"min_p": 0,
"rep_pen": 1,
"rep_pen_range": 0,
"rep_pen_decay": 0,
"rep_pen_slope": 1,
"no_repeat_ngram_size": 0,
"penalty_alpha": 0,
"num_beams": 1,
"length_penalty": 1,
"min_length": 0,
"encoder_rep_pen": 1,
"freq_pen": 0,
"presence_pen": 0,
"skew": 0,
"do_sample": true,
"early_stopping": false,
"dynatemp": false,
"min_temp": 0,
"max_temp": 2,
"dynatemp_exponent": 1,
"smoothing_factor": 0,
"smoothing_curve": 1,
"dry_allowed_length": 2,
"dry_multiplier": 0,
"dry_base": 1.75,
"dry_sequence_breakers": "[\"\\n\", \":\", \"\\\"\", \"*\"]",
"dry_penalty_last_n": 0,
"add_bos_token": true,
"ban_eos_token": false,
"skip_special_tokens": true,
"mirostat_mode": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"guidance_scale": 1,
"negative_prompt": "",
"grammar_string": "",
"json_schema": {},
"banned_tokens": "",
"sampler_priority": [
"temperature",
"dynamic_temperature",
"quadratic_sampling",
"top_k",
"top_p",
"typical_p",
"epsilon_cutoff",
"eta_cutoff",
"tfs",
"top_a",
"min_p",
"mirostat"
],
"samplers": [
"top_k",
"tfs_z",
"typical_p",
"top_p",
"min_p",
"temperature"
],
"ignore_eos_token": false,
"spaces_between_special_tokens": true,
"speculative_ngram": false,
"sampler_order": [
6,
0,
1,
3,
4,
2,
5
],
"logit_bias": [],
"rep_pen_size": 0
}
@@ -1,5 +1,5 @@
{
"temp": 0.44,
"temp": 1,
"temperature_last": true,
"top_p": 1,
"top_k": 0,
@@ -9,7 +9,7 @@
"eta_cutoff": 0,
"typical_p": 1,
"min_p": 0,
"rep_pen": 1.15,
"rep_pen": 1,
"rep_pen_range": 0,
"rep_pen_decay": 0,
"rep_pen_slope": 1,
@@ -44,12 +44,18 @@
"guidance_scale": 1,
"negative_prompt": "",
"grammar_string": "",
"json_schema": {},
"json_schema": null,
"json_schema_allow_empty": false,
"banned_tokens": "",
"sampler_priority": [
"repetition_penalty",
"presence_penalty",
"frequency_penalty",
"dry",
"temperature",
"dynamic_temperature",
"quadratic_sampling",
"top_n_sigma",
"top_k",
"top_p",
"typical_p",
@@ -58,16 +64,40 @@
"tfs",
"top_a",
"min_p",
"mirostat"
"mirostat",
"xtc",
"encoder_repetition_penalty",
"no_repeat_ngram"
],
"samplers": [
"penalties",
"dry",
"top_n_sigma",
"top_k",
"typ_p",
"tfs_z",
"typical_p",
"xtc",
"top_p",
"min_p",
"temperature"
],
"samplers_priorities": [
"dry",
"penalties",
"no_repeat_ngram",
"temperature",
"top_nsigma",
"top_p_top_k",
"top_a",
"min_p",
"tfs",
"eta_cutoff",
"epsilon_cutoff",
"typical_p",
"quadratic",
"xtc"
],
"ignore_eos_token": false,
"spaces_between_special_tokens": true,
"speculative_ngram": false,
@@ -81,5 +111,9 @@
5
],
"logit_bias": [],
"xtc_threshold": 0.1,
"xtc_probability": 0,
"nsigma": 0,
"min_keep": 0,
"rep_pen_size": 0
}
@@ -1,85 +0,0 @@
{
"temp": 0.8,
"temperature_last": true,
"top_p": 0.9,
"top_k": 100,
"top_a": 0,
"tfs": 1,
"epsilon_cutoff": 0,
"eta_cutoff": 0,
"typical_p": 1,
"min_p": 0,
"rep_pen": 1.15,
"rep_pen_range": 0,
"rep_pen_decay": 0,
"rep_pen_slope": 1,
"no_repeat_ngram_size": 0,
"penalty_alpha": 0,
"num_beams": 1,
"length_penalty": 1,
"min_length": 0,
"encoder_rep_pen": 1,
"freq_pen": 0,
"presence_pen": 0,
"skew": 0,
"do_sample": true,
"early_stopping": false,
"dynatemp": false,
"min_temp": 0,
"max_temp": 2,
"dynatemp_exponent": 1,
"smoothing_factor": 0,
"smoothing_curve": 1,
"dry_allowed_length": 2,
"dry_multiplier": 0,
"dry_base": 1.75,
"dry_sequence_breakers": "[\"\\n\", \":\", \"\\\"\", \"*\"]",
"dry_penalty_last_n": 0,
"add_bos_token": true,
"ban_eos_token": false,
"skip_special_tokens": true,
"mirostat_mode": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"guidance_scale": 1,
"negative_prompt": "",
"grammar_string": "",
"json_schema": {},
"banned_tokens": "",
"sampler_priority": [
"temperature",
"dynamic_temperature",
"quadratic_sampling",
"top_k",
"top_p",
"typical_p",
"epsilon_cutoff",
"eta_cutoff",
"tfs",
"top_a",
"min_p",
"mirostat"
],
"samplers": [
"top_k",
"tfs_z",
"typical_p",
"top_p",
"min_p",
"temperature"
],
"ignore_eos_token": false,
"spaces_between_special_tokens": true,
"speculative_ngram": false,
"sampler_order": [
6,
0,
1,
3,
4,
2,
5
],
"logit_bias": [],
"rep_pen_size": 0
}
@@ -1,85 +0,0 @@
{
"temp": 1.99,
"temperature_last": true,
"top_p": 1,
"top_k": 100,
"top_a": 0,
"tfs": 1,
"epsilon_cutoff": 0,
"eta_cutoff": 0,
"typical_p": 0.97,
"min_p": 0,
"rep_pen": 1,
"rep_pen_range": 0,
"rep_pen_decay": 0,
"rep_pen_slope": 1,
"no_repeat_ngram_size": 0,
"penalty_alpha": 0,
"num_beams": 1,
"length_penalty": 1,
"min_length": 0,
"encoder_rep_pen": 1,
"freq_pen": 0,
"presence_pen": 0,
"skew": 0,
"do_sample": true,
"early_stopping": false,
"dynatemp": false,
"min_temp": 0,
"max_temp": 2,
"dynatemp_exponent": 1,
"smoothing_factor": 0,
"smoothing_curve": 1,
"dry_allowed_length": 2,
"dry_multiplier": 0,
"dry_base": 1.75,
"dry_sequence_breakers": "[\"\\n\", \":\", \"\\\"\", \"*\"]",
"dry_penalty_last_n": 0,
"add_bos_token": true,
"ban_eos_token": false,
"skip_special_tokens": true,
"mirostat_mode": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"guidance_scale": 1,
"negative_prompt": "",
"grammar_string": "",
"json_schema": {},
"banned_tokens": "",
"sampler_priority": [
"temperature",
"dynamic_temperature",
"quadratic_sampling",
"top_k",
"top_p",
"typical_p",
"epsilon_cutoff",
"eta_cutoff",
"tfs",
"top_a",
"min_p",
"mirostat"
],
"samplers": [
"top_k",
"tfs_z",
"typical_p",
"top_p",
"min_p",
"temperature"
],
"ignore_eos_token": false,
"spaces_between_special_tokens": true,
"speculative_ngram": false,
"sampler_order": [
6,
0,
1,
3,
4,
2,
5
],
"logit_bias": [],
"rep_pen_size": 0
}
@@ -1,85 +0,0 @@
{
"temp": 0.63,
"temperature_last": true,
"top_p": 0.98,
"top_k": 0,
"top_a": 0,
"tfs": 1,
"epsilon_cutoff": 0,
"eta_cutoff": 0,
"typical_p": 1,
"min_p": 0,
"rep_pen": 1.05,
"rep_pen_range": 0,
"rep_pen_decay": 0,
"rep_pen_slope": 1,
"no_repeat_ngram_size": 0,
"penalty_alpha": 0,
"num_beams": 1,
"length_penalty": 1,
"min_length": 0,
"encoder_rep_pen": 1,
"freq_pen": 0,
"presence_pen": 0,
"skew": 0,
"do_sample": true,
"early_stopping": false,
"dynatemp": false,
"min_temp": 0,
"max_temp": 2,
"dynatemp_exponent": 1,
"smoothing_factor": 0,
"smoothing_curve": 1,
"dry_allowed_length": 2,
"dry_multiplier": 0,
"dry_base": 1.75,
"dry_sequence_breakers": "[\"\\n\", \":\", \"\\\"\", \"*\"]",
"dry_penalty_last_n": 0,
"add_bos_token": true,
"ban_eos_token": false,
"skip_special_tokens": true,
"mirostat_mode": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"guidance_scale": 1,
"negative_prompt": "",
"grammar_string": "",
"json_schema": {},
"banned_tokens": "",
"sampler_priority": [
"temperature",
"dynamic_temperature",
"quadratic_sampling",
"top_k",
"top_p",
"typical_p",
"epsilon_cutoff",
"eta_cutoff",
"tfs",
"top_a",
"min_p",
"mirostat"
],
"samplers": [
"top_k",
"tfs_z",
"typical_p",
"top_p",
"min_p",
"temperature"
],
"ignore_eos_token": false,
"spaces_between_special_tokens": true,
"speculative_ngram": false,
"sampler_order": [
6,
0,
1,
3,
4,
2,
5
],
"logit_bias": [],
"rep_pen_size": 0
}
@@ -1,85 +0,0 @@
{
"temp": 1.99,
"temperature_last": true,
"top_p": 0.85,
"top_k": 12,
"top_a": 0,
"tfs": 1,
"epsilon_cutoff": 0,
"eta_cutoff": 0,
"typical_p": 1,
"min_p": 0,
"rep_pen": 1.15,
"rep_pen_range": 0,
"rep_pen_decay": 0,
"rep_pen_slope": 1,
"no_repeat_ngram_size": 0,
"penalty_alpha": 0,
"num_beams": 1,
"length_penalty": 1,
"min_length": 0,
"encoder_rep_pen": 1,
"freq_pen": 0,
"presence_pen": 0,
"skew": 0,
"do_sample": true,
"early_stopping": false,
"dynatemp": false,
"min_temp": 0,
"max_temp": 2,
"dynatemp_exponent": 1,
"smoothing_factor": 0,
"smoothing_curve": 1,
"dry_allowed_length": 2,
"dry_multiplier": 0,
"dry_base": 1.75,
"dry_sequence_breakers": "[\"\\n\", \":\", \"\\\"\", \"*\"]",
"dry_penalty_last_n": 0,
"add_bos_token": true,
"ban_eos_token": false,
"skip_special_tokens": true,
"mirostat_mode": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"guidance_scale": 1,
"negative_prompt": "",
"grammar_string": "",
"json_schema": {},
"banned_tokens": "",
"sampler_priority": [
"temperature",
"dynamic_temperature",
"quadratic_sampling",
"top_k",
"top_p",
"typical_p",
"epsilon_cutoff",
"eta_cutoff",
"tfs",
"top_a",
"min_p",
"mirostat"
],
"samplers": [
"top_k",
"tfs_z",
"typical_p",
"top_p",
"min_p",
"temperature"
],
"ignore_eos_token": false,
"spaces_between_special_tokens": true,
"speculative_ngram": false,
"sampler_order": [
6,
0,
1,
3,
4,
2,
5
],
"logit_bias": [],
"rep_pen_size": 0
}
@@ -1,85 +0,0 @@
{
"temp": 1.07,
"temperature_last": true,
"top_p": 1,
"top_k": 100,
"top_a": 0,
"tfs": 1,
"epsilon_cutoff": 0,
"eta_cutoff": 0,
"typical_p": 1,
"min_p": 0,
"rep_pen": 1.05,
"rep_pen_range": 0,
"rep_pen_decay": 0,
"rep_pen_slope": 1,
"no_repeat_ngram_size": 0,
"penalty_alpha": 0,
"num_beams": 1,
"length_penalty": 1,
"min_length": 0,
"encoder_rep_pen": 1,
"freq_pen": 0,
"presence_pen": 0,
"skew": 0,
"do_sample": true,
"early_stopping": false,
"dynatemp": false,
"min_temp": 0,
"max_temp": 2,
"dynatemp_exponent": 1,
"smoothing_factor": 0,
"smoothing_curve": 1,
"dry_allowed_length": 2,
"dry_multiplier": 0,
"dry_base": 1.75,
"dry_sequence_breakers": "[\"\\n\", \":\", \"\\\"\", \"*\"]",
"dry_penalty_last_n": 0,
"add_bos_token": true,
"ban_eos_token": false,
"skip_special_tokens": true,
"mirostat_mode": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"guidance_scale": 1,
"negative_prompt": "",
"grammar_string": "",
"json_schema": {},
"banned_tokens": "",
"sampler_priority": [
"temperature",
"dynamic_temperature",
"quadratic_sampling",
"top_k",
"top_p",
"typical_p",
"epsilon_cutoff",
"eta_cutoff",
"tfs",
"top_a",
"min_p",
"mirostat"
],
"samplers": [
"top_k",
"tfs_z",
"typical_p",
"top_p",
"min_p",
"temperature"
],
"ignore_eos_token": false,
"spaces_between_special_tokens": true,
"speculative_ngram": false,
"sampler_order": [
6,
0,
1,
3,
4,
2,
5
],
"logit_bias": [],
"rep_pen_size": 0
}
@@ -1,85 +0,0 @@
{
"temp": 1.99,
"temperature_last": true,
"top_p": 0.18,
"top_k": 30,
"top_a": 0,
"tfs": 1,
"epsilon_cutoff": 0,
"eta_cutoff": 0,
"typical_p": 1,
"min_p": 0,
"rep_pen": 1.15,
"rep_pen_range": 0,
"rep_pen_decay": 0,
"rep_pen_slope": 1,
"no_repeat_ngram_size": 0,
"penalty_alpha": 0,
"num_beams": 1,
"length_penalty": 1,
"min_length": 0,
"encoder_rep_pen": 1,
"freq_pen": 0,
"presence_pen": 0,
"skew": 0,
"do_sample": true,
"early_stopping": false,
"dynatemp": false,
"min_temp": 0,
"max_temp": 2,
"dynatemp_exponent": 1,
"smoothing_factor": 0,
"smoothing_curve": 1,
"dry_allowed_length": 2,
"dry_multiplier": 0,
"dry_base": 1.75,
"dry_sequence_breakers": "[\"\\n\", \":\", \"\\\"\", \"*\"]",
"dry_penalty_last_n": 0,
"add_bos_token": true,
"ban_eos_token": false,
"skip_special_tokens": true,
"mirostat_mode": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"guidance_scale": 1,
"negative_prompt": "",
"grammar_string": "",
"json_schema": {},
"banned_tokens": "",
"sampler_priority": [
"temperature",
"dynamic_temperature",
"quadratic_sampling",
"top_k",
"top_p",
"typical_p",
"epsilon_cutoff",
"eta_cutoff",
"tfs",
"top_a",
"min_p",
"mirostat"
],
"samplers": [
"top_k",
"tfs_z",
"typical_p",
"top_p",
"min_p",
"temperature"
],
"ignore_eos_token": false,
"spaces_between_special_tokens": true,
"speculative_ngram": false,
"sampler_order": [
6,
0,
1,
3,
4,
2,
5
],
"logit_bias": [],
"rep_pen_size": 0
}
@@ -1,85 +0,0 @@
{
"temp": 0.72,
"temperature_last": true,
"top_p": 0.73,
"top_k": 0,
"top_a": 0,
"tfs": 1,
"epsilon_cutoff": 0,
"eta_cutoff": 0,
"typical_p": 1,
"min_p": 0,
"rep_pen": 1.1,
"rep_pen_range": 0,
"rep_pen_decay": 0,
"rep_pen_slope": 1,
"no_repeat_ngram_size": 0,
"penalty_alpha": 0,
"num_beams": 1,
"length_penalty": 1,
"min_length": 0,
"encoder_rep_pen": 1,
"freq_pen": 0,
"presence_pen": 0,
"skew": 0,
"do_sample": true,
"early_stopping": false,
"dynatemp": false,
"min_temp": 0,
"max_temp": 2,
"dynatemp_exponent": 1,
"smoothing_factor": 0,
"smoothing_curve": 1,
"dry_allowed_length": 2,
"dry_multiplier": 0,
"dry_base": 1.75,
"dry_sequence_breakers": "[\"\\n\", \":\", \"\\\"\", \"*\"]",
"dry_penalty_last_n": 0,
"add_bos_token": true,
"ban_eos_token": false,
"skip_special_tokens": true,
"mirostat_mode": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"guidance_scale": 1,
"negative_prompt": "",
"grammar_string": "",
"json_schema": {},
"banned_tokens": "",
"sampler_priority": [
"temperature",
"dynamic_temperature",
"quadratic_sampling",
"top_k",
"top_p",
"typical_p",
"epsilon_cutoff",
"eta_cutoff",
"tfs",
"top_a",
"min_p",
"mirostat"
],
"samplers": [
"top_k",
"tfs_z",
"typical_p",
"top_p",
"min_p",
"temperature"
],
"ignore_eos_token": false,
"spaces_between_special_tokens": true,
"speculative_ngram": false,
"sampler_order": [
6,
0,
1,
3,
4,
2,
5
],
"logit_bias": [],
"rep_pen_size": 0
}
@@ -1,85 +0,0 @@
{
"temp": 1.53,
"temperature_last": true,
"top_p": 0.64,
"top_k": 33,
"top_a": 0.04,
"tfs": 1,
"epsilon_cutoff": 0,
"eta_cutoff": 0,
"typical_p": 1,
"min_p": 0,
"rep_pen": 1.07,
"rep_pen_range": 0,
"rep_pen_decay": 0,
"rep_pen_slope": 1,
"no_repeat_ngram_size": 0,
"penalty_alpha": 0,
"num_beams": 1,
"length_penalty": 1,
"min_length": 0,
"encoder_rep_pen": 1,
"freq_pen": 0,
"presence_pen": 0,
"skew": 0,
"do_sample": true,
"early_stopping": false,
"dynatemp": false,
"min_temp": 0,
"max_temp": 2,
"dynatemp_exponent": 1,
"smoothing_factor": 0,
"smoothing_curve": 1,
"dry_allowed_length": 2,
"dry_multiplier": 0,
"dry_base": 1.75,
"dry_sequence_breakers": "[\"\\n\", \":\", \"\\\"\", \"*\"]",
"dry_penalty_last_n": 0,
"add_bos_token": true,
"ban_eos_token": false,
"skip_special_tokens": true,
"mirostat_mode": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"guidance_scale": 1,
"negative_prompt": "",
"grammar_string": "",
"json_schema": {},
"banned_tokens": "",
"sampler_priority": [
"temperature",
"dynamic_temperature",
"quadratic_sampling",
"top_k",
"top_p",
"typical_p",
"epsilon_cutoff",
"eta_cutoff",
"tfs",
"top_a",
"min_p",
"mirostat"
],
"samplers": [
"top_k",
"tfs_z",
"typical_p",
"top_p",
"min_p",
"temperature"
],
"ignore_eos_token": false,
"spaces_between_special_tokens": true,
"speculative_ngram": false,
"sampler_order": [
6,
0,
1,
3,
4,
2,
5
],
"logit_bias": [],
"rep_pen_size": 0
}
@@ -1,85 +0,0 @@
{
"temp": 0.7,
"temperature_last": true,
"top_p": 0.9,
"top_k": 20,
"top_a": 0,
"tfs": 1,
"epsilon_cutoff": 0,
"eta_cutoff": 0,
"typical_p": 1,
"min_p": 0,
"rep_pen": 1.15,
"rep_pen_range": 0,
"rep_pen_decay": 0,
"rep_pen_slope": 1,
"no_repeat_ngram_size": 0,
"penalty_alpha": 0,
"num_beams": 1,
"length_penalty": 1,
"min_length": 0,
"encoder_rep_pen": 1,
"freq_pen": 0,
"presence_pen": 0,
"skew": 0,
"do_sample": true,
"early_stopping": false,
"dynatemp": false,
"min_temp": 0,
"max_temp": 2,
"dynatemp_exponent": 1,
"smoothing_factor": 0,
"smoothing_curve": 1,
"dry_allowed_length": 2,
"dry_multiplier": 0,
"dry_base": 1.75,
"dry_sequence_breakers": "[\"\\n\", \":\", \"\\\"\", \"*\"]",
"dry_penalty_last_n": 0,
"add_bos_token": true,
"ban_eos_token": false,
"skip_special_tokens": true,
"mirostat_mode": 0,
"mirostat_tau": 5,
"mirostat_eta": 0.1,
"guidance_scale": 1,
"negative_prompt": "",
"grammar_string": "",
"json_schema": {},
"banned_tokens": "",
"sampler_priority": [
"temperature",
"dynamic_temperature",
"quadratic_sampling",
"top_k",
"top_p",
"typical_p",
"epsilon_cutoff",
"eta_cutoff",
"tfs",
"top_a",
"min_p",
"mirostat"
],
"samplers": [
"top_k",
"tfs_z",
"typical_p",
"top_p",
"min_p",
"temperature"
],
"ignore_eos_token": false,
"spaces_between_special_tokens": true,
"speculative_ngram": false,
"sampler_order": [
6,
0,
1,
3,
4,
2,
5
],
"logit_bias": [],
"rep_pen_size": 0
}

Some files were not shown because too many files have changed in this diff Show More