Merge branch 'staging' into patch-7

5d275998ed56370b020a39d1392b66939b1c6bdb

Cohee <18619528+Cohee1207@users.noreply.github.com>

Signed
125 files changed, +3530 -2026Showing whitespace changes
.github/readme.md+40 -16
@@ -317,29 +317,34 @@ Start.bat --port 8000 --listen false
317317
318318### Supported arguments
319319
320+> \[!TIP]
321+> None of the arguments are required. If you don't provide them, SillyTavern will use the settings in `config.yaml`.
322+
320323| Option | Description | Type |
321324|-------------------------|------------------------------------------------------------------------------------------------------|----------|
322325| `--version` | Show version number | boolean |
323-| `--enableIPv6` | Enables IPv6. | boolean |
324-| `--enableIPv4` | Enables IPv4. | boolean |
325-| `--port` | Sets the port under which SillyTavern will run. If not provided falls back to yaml config 'port'. | number |
326-| `--dnsPreferIPv6` | Prefers IPv6 for dns. If not provided falls back to yaml config 'preferIPv6'. | boolean |
327-| `--autorun` | Automatically launch SillyTavern in the browser. If not provided falls back to yaml config 'autorun'.| boolean |
328-| `--autorunHostname` | The autorun hostname, probably best left on 'auto'. | string |
329-| `--autorunPortOverride` | Overrides the port for autorun. | string |
330-| `--listen` | SillyTavern is listening on all network interfaces. If not provided falls back to yaml config 'listen'.| boolean |
331-| `--corsProxy` | Enables CORS proxy. If not provided falls back to yaml config 'enableCorsProxy'. | boolean |
332-| `--disableCsrf` | Disables CSRF protection | boolean |
333-| `--ssl` | Enables SSL | boolean |
334-| `--certPath` | Path to your certificate file. | string |
335-| `--keyPath` | Path to your private key file. | string |
336-| `--whitelist` | Enables whitelist mode | boolean |
337326| `--dataRoot` | Root directory for data storage | string |
338327| `--avoidLocalhostport` | AvoidsSets usingthe 'localhost'port forunder autorunwhich inSillyTavern autowill mode. run | boolean number |
328+| `--listen` | SillyTavern will listen on all network interfaces | boolean |
329+| `--whitelist` | Enables whitelist mode | boolean |
339330| `--basicAuthMode` | Enables basic authentication | boolean |
331+| `--enableIPv4` | Enables IPv4 protocol | boolean |
332+| `--enableIPv6` | Enables IPv6 protocol | boolean |
333+| `--listenAddressIPv4` | Specific IPv4 address to listen to | string |
334+| `--listenAddressIPv6` | Specific IPv6 address to listen to | string |
335+| `--dnsPreferIPv6` | Prefers IPv6 for DNS | boolean |
336+| `--ssl` | Enables SSL | boolean |
337+| `--certPath` | Path to your certificate file | string |
338+| `--keyPath` | Path to your private key file | string |
339+| `--autorun` | Automatically launch SillyTavern in the browser | boolean |
340+| `--autorunHostname` | Autorun hostname | string |
341+| `--autorunPortOverride` | Overrides the port for autorun | string |
342+| `--avoidLocalhost` | Avoids using 'localhost' for autorun in auto mode | boolean |
343+| `--corsProxy` | Enables CORS proxy | boolean |
340344| `--requestProxyEnabled` | Enables a use of proxy for outgoing requests | boolean |
341345| `--requestProxyUrl` | Request proxy URL (HTTP or SOCKS protocols) | string |
342346| `--requestProxyBypass` | Request proxy bypass list (space separated list of hosts) | array |
347+| `--disableCsrf` | Disables CSRF protection (NOT RECOMMENDED) | boolean |
343348
344349## Remote connections
345350
@@ -351,10 +356,29 @@ You may also want to configure SillyTavern user profiles with (optional) passwor
351356
352357## Performance issues?
353358
359+### General tips
360+
3543611. Disable the Blur Effect and enable Reduced Motion on the User Settings panel (UI Theme toggles category).
3553622. If using response streaming, set the streaming FPS to a lower value (10-15 FPS is recommended).
3563633. Make sure the browser is enabled to use GPU acceleration for rendering.
357364
365+### Input lag
366+
367+Performance degradation, particularly input lag, is most commonly attributed to browser extensions. Known problematic extensions include:
368+
369+* iCloud Password Manager
370+* DeepL Translation
371+* AI-based grammar correction tools
372+* Various ad-blocking extensions
373+
374+If you experience performance issues and cannot identify the cause, or suspect an issue with SillyTavern itself, please:
375+
376+1. [Record a performance profile](https://developer.chrome.com/docs/devtools/performance/reference)
377+2. Export the profile as a JSON file
378+3. Submit it to the development team for analysis
379+
380+We recommend first testing with all browser extensions and third-party SillyTavern extensions disabled to isolate the source of the performance degradation.
381+
358382## License and credits
359383
360384**This program is distributed in the hope that it will be useful,
Dockerfile+1 -1
@@ -4,7 +4,7 @@ FROM node:lts-alpine3.19
44ARG APP_HOME=/home/node/app
55
66# Install system dependencies
77RUN apk add --no-cache gcompat tini git
88
99# Create app directory
1010WORKDIR ${APP_HOME}
default/config.yaml+27 -6
@@ -1,8 +1,6 @@
11# -- DATA CONFIGURATION --
22# Root directory for user data storage
33dataRoot: ./data
4-# The maximum amount of memory that parsed character cards can use in MB
5-cardsCacheCapacity: 100
64# -- SERVER CONFIGURATION --
75# Listen for incoming connections
86listen: false
@@ -28,6 +26,11 @@ port: 8000
2826# - Use -1 to use the server port.
2927# - Specify a port to override the default.
3028autorunPortOverride: -1
29+# -- SSL options --
30+ssl:
31+ enabled: false
32+ certPath: "./certs/cert.pem"
33+ keyPath: "./certs/privkey.pem"
3134# -- SECURITY CONFIGURATION --
3235# Toggle whitelist mode
3336whitelistMode: true
@@ -37,6 +40,8 @@ enableForwardedWhitelist: true
3740whitelist:
3841 - ::1
3942 - 127.0.0.1
43+# Automatically whitelist Docker host and gateway IPs
44+whitelistDockerHosts: true
4045# Toggle basic authentication for endpoints
4146basicAuthMode: false
4247# Basic authentication credentials
@@ -71,20 +76,28 @@ autheliaAuth: false
7176# the username and passwords for basic auth are the same as those
7277# for the individual accounts
7378perUserBasicAuth: false
74-# Minimum log level to display in the terminal (DEBUG = 0, INFO = 1, WARN = 2, ERROR = 3)
75-minLogLevel: 0
7679
7780# User session timeout *in seconds* (defaults to 24 hours).
7881## Set to a positive number to expire session after a certain time of inactivity
7982## Set to 0 to expire session when the browser is closed
8083## Set to a negative number to disable session expiration
8184sessionTimeout: -1
82-# Used to sign session cookies. Will be auto-generated if not set
83-cookieSecret: ''
8485# Disable CSRF protection - NOT RECOMMENDED
8586disableCsrfProtection: false
8687# Disable startup security checks - NOT RECOMMENDED
8788securityOverride: false
89+# -- LOGGING CONFIGURATION --
90+logging:
91+ # Enable access logging to access.log file
92+ # Records new connections with timestamp, IP address and user agent
93+ enableAccessLog: true
94+ # Minimum log level to display in the terminal (DEBUG = 0, INFO = 1, WARN = 2, ERROR = 3)
95+ minLogLevel: 0
96+# -- RATE LIMITING CONFIGURATION --
97+rateLimiting:
98+ # Use X-Real-IP header instead of socket IP for rate limiting
99+ # Only enable this if you are using a properly configured reverse proxy (like Nginx/traefik/Caddy)
100+ preferRealIpHeader: false
88101# -- ADVANCED CONFIGURATION --
89102# Open the browser automatically
90103autorun: true
@@ -120,6 +133,14 @@ thumbnails:
120133 # Maximum thumbnail dimensions per type [width, height]
121134 dimensions: { 'bg': [160, 90], 'avatar': [96, 144] }
122135
136+# PERFORMANCE-RELATED CONFIGURATION
137+performance:
138+ # Enables lazy loading of character cards. Improves performances with large card libraries.
139+ # May have compatibility issues with some extensions.
140+ lazyLoadCharacters: false
141+ # The maximum amount of memory that parsed character cards can use. Set to 0 to disable memory caching.
142+ memoryCacheCapacity: '100mb'
143+
123144# Allow secret keys exposure via API
124145allowKeysExposure: false
125146# Skip new default content checks
default/content/presets/openai/Default.json+0 -1
@@ -28,7 +28,6 @@
2828 "wrap_in_quotes": false,
2929 "names_behavior": 0,
3030 "send_if_empty": "",
31- "jailbreak_system": false,
3231 "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}}.]",
3332 "new_chat_prompt": "[Start a new Chat]",
3433 "new_group_chat_prompt": "[Start a new group chat. Group members: {{group}}]",
default/content/settings.json+0 -1
@@ -626,7 +626,6 @@
626626 "ai21_model": "jamba-1.5-large",
627627 "windowai_model": "",
628628 "openrouter_model": "OR_Website",
629- "jailbreak_system": true,
630629 "reverse_proxy": "",
631630 "chat_completion_source": "openai",
632631 "max_context_unlocked": false,
docker/build-lib.js+1 -1
@@ -1,4 +1,4 @@
11import getWebpackServeMiddleware from '../src/middleware/webpack-serve.js';
22
33const middleware = getWebpackServeMiddleware();
44await middleware.runWebpackCompiler({ forceDist: true });
docker/docker-compose.yml+3 -1
@@ -1,10 +1,12 @@
1-version: "3"
21services:
32 sillytavern:
43 build: ..
54 container_name: sillytavern
65 hostname: sillytavern
76 image: ghcr.io/sillytavern/sillytavern:latest
7+ environment:
8+ - NODE_ENV=production
9+ - FORCE_COLOR=1
810 ports:
911 - "8000:8000"
1012 volumes:
docker/docker-entrypoint.sh+3 -0
@@ -5,5 +5,8 @@ if [ ! -e "config/config.yaml" ]; then
55 cp -r "default/config.yaml" "config/config.yaml"
66fi
77
8+# Execute postinstall to auto-populate config.yaml with missing values
9+npm run postinstall
10+
811# Start the server
912exec node server.js --listen "$@"
index.d.ts+36 -2
@@ -1,7 +1,36 @@
11import { UserDirectoryList, UserEventEmitter } from "./src/users"'node:events';
22import { CsrfSyncedToken } from "'csrf-sync"';
3+import { UserDirectoryList, User } from './src/users.js';
4+import { CommandLineArguments } from './src/command-line.js';
5+import { EVENT_NAMES } from './src/server-events.js';
6+
7+/**
8+ * Event payload for SERVER_STARTED event.
9+ */
10+export interface ServerStartedEvent {
11+ /**
12+ * The URL the server is listening on.
13+ */
14+ url: URL;
15+}
16+
17+/**
18+ * Map of all server events to their payload types.
19+ */
20+export interface ServerEventMap {
21+ [EVENT_NAMES.SERVER_STARTED]: [ServerStartedEvent];
22+}
323
424declare global {
25+ declare namespace NodeJS {
26+ export interface Process {
27+ /**
28+ * A global instance of the server events emitter.
29+ */
30+ serverEvents: EventEmitter<ServerEventMap>;
31+ }
32+ }
33+
534 declare namespace CookieSessionInterfaces {
635 export interface CookieSessionObject {
736 /**
@@ -32,4 +61,9 @@ declare global {
3261 * The root directory for user data.
3362 */
3463 var DATA_ROOT: string;
64+
65+ /**
66+ * Parsed command line arguments.
67+ */
68+ var COMMAND_LINE_ARGS: CommandLineArguments;
3569}
package-lock.json+630 -467
@@ -10,19 +10,21 @@
1010 "hasInstallScript": true,
1111 "license": "AGPL-3.0",
1212 "dependencies": {
1313 "@adobe/css-tools": "^4.4.02",
1414 "@agnai/sentencepiece-js": "^1.1.1",
1515 "@agnai/web-tokenizers": "^0.1.3",
1616 "@iconfu/svg-inject": "^1.2.3",
1717 "@mozilla/readability": "^0.5.0",
1818 "@popperjs/core": "^2.11.8",
1919 "@zeldafan0225/ai_horde": "^5.12.0",
2020 "archiver": "^7.0.1",
2121 "bing-translate-api": "^4.0.2",
2222 "body-parser": "^1.20.2",
2323 "bowser": "^2.11.0",
24+ "bytes": "^3.1.2",
25+ "chalk": "^5.4.1",
2426 "command-exists": "^1.2.9",
2527 "compression": "^1.8.0",
2628 "cookie-parser": "^1.4.6",
2729 "cookie-session": "^2.1.0",
2830 "cors": "^2.8.5",
@@ -31,18 +33,19 @@
3133 "dompurify": "^3.2.4",
3234 "droll": "^0.2.1",
3335 "express": "^4.21.0",
3436 "form-data": "^4.0.02",
3537 "fuse.js": "^7.01.0",
3638 "google-translate-api-browser": "^3.0.1",
3739 "google-translate-api-x": "^10.7.12",
3840 "handlebars": "^4.7.8",
3941 "helmet": "^7.12.0",
4042 "highlight.js": "^11.1011.01",
4143 "html-entities": "^2.5.2",
4244 "iconv-lite": "^0.6.3",
4345 "ip-matching": "^2.1.2",
4446 "ip-regex": "^5.0.0",
4547 "ipaddr.js": "^2.02.10",
48+ "is-docker": "^3.0.0",
4649 "jimp": "^0.22.10",
4750 "localforage": "^1.10.0",
4851 "lodash": "^4.17.21",
@@ -51,28 +54,28 @@
5154 "morphdom": "^2.7.4",
5255 "multer": "^1.4.5-lts.1",
5356 "node-fetch": "^3.3.2",
5457 "node-persist": "^4.0.14",
5558 "open": "^8.4.2",
5659 "png-chunk-text": "^1.0.0",
5760 "png-chunks-encode": "^1.0.0",
5861 "png-chunks-extract": "^1.0.0",
5962 "proxy-agent": "^6.45.0",
6063 "rate-limiter-flexible": "^5.0.05",
6164 "response-time": "^2.3.23",
6265 "sanitize-filename": "^1.6.3",
6366 "seedrandom": "^3.0.5",
6467 "showdown": "^2.1.0",
6568 "sillytavern-transformers": "2.14.6",
6669 "simple-git": "^3.1927.10",
6770 "slidetoggle": "^4.0.0",
6871 "tiktoken": "^1.0.1620",
6972 "url-join": "^5.0.0",
7073 "vectra": "^0.2.2",
7174 "wavefile": "^11.0.0",
7275 "webpack": "^5.9598.0",
7376 "write-file-atomic": "^5.0.1",
7477 "ws": "^8.1718.1",
7578 "yaml": "^2.37.40",
7679 "yargs": "^17.7.1",
7780 "yauzl": "^2.10.0"
7881 },
@@ -80,23 +83,23 @@
8083 "sillytavern": "server.js"
8184 },
8285 "devDependencies": {
8386 "@types/archiver": "^6.0.23",
87+ "@types/bytes": "^3.1.5",
8488 "@types/command-exists": "^1.2.3",
8589 "@types/compression": "^1.7.5",
8690 "@types/cookie-parser": "^1.4.78",
8791 "@types/cookie-session": "^2.0.49",
8892 "@types/cors": "^2.8.17",
8993 "@types/deno": "^2.02.0",
90- "@types/dompurify": "^3.2.0",
9194 "@types/express": "^4.17.21",
9295 "@types/jquery": "^3.5.2932",
9396 "@types/jquery-cropper": "^1.0.4",
9497 "@types/jquery.transit": "^0.9.33",
9598 "@types/jqueryui": "^1.12.23",
9699 "@types/lodash": "^4.17.1016",
97100 "@types/mime-types": "^2.1.4",
98101 "@types/multer": "^1.4.12",
99102 "@types/node": "^18.19.5578",
100103 "@types/node-persist": "^3.1.8",
101104 "@types/png-chunk-text": "^1.0.3",
102105 "@types/png-chunks-encode": "^1.0.2",
@@ -107,7 +110,7 @@
107110 "@types/write-file-atomic": "^4.0.3",
108111 "@types/yargs": "^17.0.33",
109112 "@types/yauzl": "^2.10.3",
110113 "eslint": "^8.57.01"
111114 },
112115 "engines": {
113116 "node": ">= 18"
@@ -124,9 +127,9 @@
124127 }
125128 },
126129 "node_modules/@adobe/css-tools": {
127130 "version": "4.4.02",
128131 "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.4.02.tgz",
129132 "integrity": "sha512-Ff9baYZExFpsdkBNuvGKTKWCwKH57HRZLVtycZS05WTQNVOiXVSeAki3nU35zlRbToeMW8aHlJfyS+ksdQQB3rMncgqDK78uLznstjyfIf2Arnh22pW8kBpLs6rpKDwgnZT46hin5Hl1WzazzK64DOrhSwYpS7bQ1C4BOv27q0A==",
130133 "license": "MIT"
131134 },
132135 "node_modules/@agnai/sentencepiece-js": {
@@ -220,9 +223,9 @@
220223 "license": "MIT"
221224 },
222225 "node_modules/@eslint/js": {
223226 "version": "8.57.01",
224227 "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.01.tgz",
225228 "integrity": "sha512-Ysd9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==",
226229 "dev": true,
227230 "license": "MIT",
228231 "engines": {
@@ -239,14 +242,14 @@
239242 }
240243 },
241244 "node_modules/@humanwhocodes/config-array": {
242245 "version": "0.1113.140",
243246 "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.1113.140.tgz",
244247 "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSgDZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==",
245248 "deprecated": "Use @eslint/config-array instead",
246249 "dev": true,
247250 "license": "Apache-2.0",
248251 "dependencies": {
249252 "@humanwhocodes/object-schema": "^2.0.23",
250253 "debug": "^4.3.1",
251254 "minimatch": "^3.0.5"
252255 },
@@ -255,13 +258,13 @@
255258 }
256259 },
257260 "node_modules/@humanwhocodes/config-array/node_modules/debug": {
258261 "version": "4.34.60",
259262 "resolved": "https://registry.npmjs.org/debug/-/debug-4.34.60.tgz",
260263 "integrity": "sha512-O6WTZ/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1AIxCY/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIgT6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==",
261264 "dev": true,
262265 "license": "MIT",
263266 "dependencies": {
264267 "ms": "^2.1.23"
265268 },
266269 "engines": {
267270 "node": ">=6.0"
@@ -273,9 +276,9 @@
273276 }
274277 },
275278 "node_modules/@humanwhocodes/config-array/node_modules/ms": {
276279 "version": "2.1.23",
277280 "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.23.tgz",
278281 "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk6FlzubTLZG3J2a/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2wNVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
279282 "dev": true,
280283 "license": "MIT"
281284 },
@@ -816,9 +819,9 @@
816819 }
817820 },
818821 "node_modules/@jridgewell/gen-mapping": {
819822 "version": "0.3.58",
820823 "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.58.tgz",
821824 "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7imAbBGkb+OKnq0qlz/GaQgebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==",
822825 "license": "MIT",
823826 "dependencies": {
824827 "@jridgewell/set-array": "^1.2.1",
@@ -1084,9 +1087,9 @@
10841087 "license": "MIT"
10851088 },
10861089 "node_modules/@types/archiver": {
10871090 "version": "6.0.23",
10881091 "resolved": "https://registry.npmjs.org/@types/archiver/-/archiver-6.0.23.tgz",
10891092 "integrity": "sha512-KmROQqbQzKGuaAbmKa6wUll6k3zX6qs5KlxIggs1P1JcYJaTCx2gnlr+ZcytkJ51f0S1yd2DoaEwoIK10HmBaLnZwWneBz+YqDa7NmbXjmtC5YBLSyQYo21YaUnQ3HbaPFKL1ooo6RQ6OPYPIDyxfpDDXwJBm0dwcZu0zECBcQ==",
10901093 "dev": true,
10911094 "license": "MIT",
10921095 "dependencies": {
@@ -1104,6 +1107,13 @@
11041107 "@types/node": "*"
11051108 }
11061109 },
1110+ "node_modules/@types/bytes": {
1111+ "version": "3.1.5",
1112+ "resolved": "https://registry.npmjs.org/@types/bytes/-/bytes-3.1.5.tgz",
1113+ "integrity": "sha512-VgZkrJckypj85YxEsEavcMmmSOIzkUHqWmM4CCyia5dc54YwsXzJ5uT4fYxBQNEXx+oF1krlhgCbvfubXqZYsQ==",
1114+ "dev": true,
1115+ "license": "MIT"
1116+ },
11071117 "node_modules/@types/cacheable-request": {
11081118 "version": "6.0.3",
11091119 "resolved": "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.3.tgz",
@@ -1144,12 +1154,12 @@
11441154 }
11451155 },
11461156 "node_modules/@types/cookie-parser": {
11471157 "version": "1.4.78",
11481158 "resolved": "https://registry.npmjs.org/@types/cookie-parser/-/cookie-parser-1.4.78.tgz",
11491159 "integrity": "sha512-Fvuyi354Zl37JqFrOJ9yQfRQkljb41l0xVphc7kg5JTjjr+uayxzIGCwYTayFKocfV7TuDYZClCdIP9ckhvAu/ixDtCB6qx2TT0FKjPLf1f3P/J1rgf6lPs64mwpLRZ0IyZ49V4BQ8vbF4Ut2C2e+WH4al3xD3ZwYwIUfnbT4NQ==",
11501160 "dev": true,
11511161 "license": "MIT",
11521162 "dependenciespeerDependencies": {
11531163 "@types/express": "*"
11541164 }
11551165 },
@@ -1175,21 +1185,30 @@
11751185 }
11761186 },
11771187 "node_modules/@types/deno": {
11781188 "version": "2.02.0",
11791189 "resolved": "https://registry.npmjs.org/@types/deno/-/deno-2.02.0.tgz",
11801190 "integrity": "sha512-O94x6M/jRVlq93kqfkl4sYR5N7ZSyoQy6fJeMArP0dvvNT4IOolfySyukuqqKhsLmSXDV4wGanqXIZ+Pz4ukzXVIbMnE/VgvpauNHsvjQ9iBVnJ3X0gAvMa2khcoFD8DSO7mQVCuiuDMPgxFihw3TlReS6JTa4hRG9nAZInpmw==",
11811191 "dev": true,
11821192 "license": "MIT"
11831193 },
11841194 "node_modules/@types/dompurifyeslint": {
11851195 "version": "39.26.01",
11861196 "resolved": "https://registry.npmjs.org/@types/dompurifyeslint/-/dompurifyeslint-39.26.01.tgz",
11871197 "integrity": "sha512-Fgg31wv9QbLDA0SpTOXO3MaxySc4DKGLi8sna4FXx2pKgId/Utjo4r3ZRPdCt4UQee8BWrWyYo2jXw63kk7/+Q5z21yifghREPJGYaEOEIACgTY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==",
1188- "deprecated": "This is a stub types definition. dompurify provides its own type definitions, so you do not need this installed.",
1198+ "license": "MIT",
11891199 "devdependencies": true,{
1200+ "@types/estree": "*",
1201+ "@types/json-schema": "*"
1202+ }
1203+ },
1204+ "node_modules/@types/eslint-scope": {
1205+ "version": "3.7.7",
1206+ "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.7.tgz",
1207+ "integrity": "sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==",
11901208 "license": "MIT",
11911209 "dependencies": {
11921210 "dompurify@types/eslint": "*",
1211+ "@types/estree": "*"
11931212 }
11941213 },
11951214 "node_modules/@types/estree": {
@@ -1236,9 +1255,9 @@
12361255 "license": "MIT"
12371256 },
12381257 "node_modules/@types/jquery": {
12391258 "version": "3.5.3132",
12401259 "resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-3.5.3132.tgz",
12411260 "integrity": "sha512-rf/iB+cPJ/YZfMwrb9Xbf4CkMqS02YH8zACqN1xzdxc3cO735Qe5AbSUFmyOiaWAbcpqh9Wna+FVuQbm7IaWC4y3FVYfVDxRGqmUCFjjPII0HWaP0vTPJGp6m4o13AXySCcMbWfrWtBFAKwUk0vgACvoQHpWDg2rGdHkYPLmCiQ==",
12421261 "dev": true,
12431262 "license": "MIT",
12441263 "dependencies": {
@@ -1298,9 +1317,9 @@
12981317 }
12991318 },
13001319 "node_modules/@types/lodash": {
13011320 "version": "4.17.1016",
13021321 "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.1016.tgz",
13031322 "integrity": "sha512-YpS0zzoduEhuOWjAotS6A5AVCva7X4lVlYLF0FYHAY9sdraBfnatttHItlWeZdGhuEkfHX7Em5NYQAXKW+OzMNg2ZYAx8t1T+52uQFiuG27NGwzJfCX3s1GjOa7ujxZa52kjJLOr4FUxT+giF6Tgxv1e+/czV/iTtBw27WTU9g==",
13041323 "dev": true,
13051324 "license": "MIT"
13061325 },
@@ -1335,9 +1354,9 @@
13351354 }
13361355 },
13371356 "node_modules/@types/node": {
13381357 "version": "18.19.5578",
13391358 "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.5578.tgz",
13401359 "integrity": "sha512-zzw5Vw52205Zrm1ilZCTwKLkk9rruBJXFeYN0Bc5SbjirwYX/nmErSEkN5FLqXPuKXTd3MqPfioYbgun3IvK/k5d1D7RKHATGqU7y6YfX9QxZraUzUrFGqH6XzOzG196BC35ltJC4Cwm8dQxMCnrPGZPg1kvXjp3SIekCN/ynw==",
13411360 "license": "MIT",
13421361 "dependencies": {
13431362 "undici-types": "~5.26.4"
@@ -1527,148 +1546,148 @@
15271546 "license": "ISC"
15281547 },
15291548 "node_modules/@webassemblyjs/ast": {
15301549 "version": "1.1214.1",
15311550 "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.1214.1.tgz",
15321551 "integrity": "sha512-EKfMUOPRRUTy5UII4qJDGPpqfwjOmZ5jeGFwid9mnoqIFKnuBEDgQfm1ccRp/8bCQrx1frohyufl4JlbMMZ4P1wpeOfDhF6FQkxZJ1b/e+e0vqoi1qH56JpmZSzEL53jKnNzScdmftJyG5xWgPLwr6X1Nhw6OLme5usuBWYBvuQ==",
15331552 "license": "MIT",
15341553 "dependencies": {
15351554 "@webassemblyjs/helper-numbers": "1.1113.62",
15361555 "@webassemblyjs/helper-wasm-bytecode": "1.1113.62"
15371556 }
15381557 },
15391558 "node_modules/@webassemblyjs/floating-point-hex-parser": {
15401559 "version": "1.1113.62",
15411560 "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.1113.62.tgz",
15421561 "integrity": "sha512-ejAj9hfRJ2XMsNHk/v6Fu2dGS6oXyTOzbKxGH4steLbLNOu71Oj+i4UaXBXGemOfQ/JfQ6mdQg/WXtwleQRLLS4OvfDhv8rYnVwH27YJLMyYsxhwC8Lg34n6CqRvqfS2O71BxY6ByfMDRhBytzknj9yGUPVJ1qIKhRlAwO1AovA==",
15431562 "license": "MIT"
15441563 },
15451564 "node_modules/@webassemblyjs/helper-api-error": {
15461565 "version": "1.1113.62",
15471566 "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.1113.62.tgz",
15481567 "integrity": "sha512-o0YkoP4pVu4rN8aTJgAyj9hC2Sv5UlkzCHhxqWj8butaLvnpdc2jOwh4ewE6CX0txSfLn/UYaV/pheS2TxgU56GMYxy4ZQCbDZd6JuvvNV/WFildOjsaWD3Tzzvmw/Qmas3cXzRJPMjP83JqEsgSbyrmaGjBfDtV7KDXV9UzFQ==",
15491568 "license": "MIT"
15501569 },
15511570 "node_modules/@webassemblyjs/helper-buffer": {
15521571 "version": "1.1214.1",
15531572 "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.1214.1.tgz",
15541573 "integrity": "sha512-nzJwQw99DNDKr9BVCOZcLuJJUlqkJhjyH7wtcHiKssDtFPRB+kVzVl6Fmq/tI5ZtEyWT1KZMyOXltXLZJmDtvLCDgwsyrkohEtopTXCwiQdxlDf96m0E39yb0k5uJVhFGleZFoNw1c4aeIcVUPPbXUVJ94wwnMOAqUHyzoEPVMA==",
15551574 "license": "MIT"
15561575 },
15571576 "node_modules/@webassemblyjs/helper-numbers": {
15581577 "version": "1.1113.62",
15591578 "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.1113.62.tgz",
15601579 "integrity": "sha512-vUIhZ8LZoIWHBohiEObxVm6hwP034jwmc9kuq5GdHZH0wiLVLIPcMCdpJzG4C11cHoQ25TFIQj9kaVADVX7N3gFE8aCmS5Q6eQYcV3gI35O4J789wlQA+7JrqTTpJqn5emA4U2hvwJmvFRC0HODS+3Ye6WioDklgd6scJ3+PLnEA==",
15611580 "license": "MIT",
15621581 "dependencies": {
15631582 "@webassemblyjs/floating-point-hex-parser": "1.1113.62",
15641583 "@webassemblyjs/helper-api-error": "1.1113.62",
15651584 "@xtuc/long": "4.2.2"
15661585 }
15671586 },
15681587 "node_modules/@webassemblyjs/helper-wasm-bytecode": {
15691588 "version": "1.1113.62",
15701589 "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.1113.62.tgz",
15711590 "integrity": "sha512-sFFHKwcmBprO9e7Icf03QbLKy93F0EAIXLh0ogEVR6rOubA9AoZ+gddyWYDViL8bpPjJJl0WHxCdETktXdmtWLGVzoHbqUcY4Be1LkNfwTmXOJUFZYSJdAWRYhNbFyuB70j3dRdwH9g+qXhLAO0kiYGlg3TxDV+I4rQTr/YNXkA==",
15721591 "license": "MIT"
15731592 },
15741593 "node_modules/@webassemblyjs/helper-wasm-section": {
15751594 "version": "1.1214.1",
15761595 "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.1214.1.tgz",
15771596 "integrity": "sha512-Jif4vfB6FJlUlSbgEMHUyk1j234GTNG9dBJ4XJdOySoj518Xj0oGsNi59cUQF4RRMS9ouBUxDDdyBVfPTypa5gds5mXEqTJ6oxRoqjhWDU83OgzAYjwsCV8Lo/N+oRsNDmx/ZDpqalmrtgOMkHwxsG0iI//3BwWAErYRHtgn0dZw==",
15781597 "license": "MIT",
15791598 "dependencies": {
15801599 "@webassemblyjs/ast": "1.1214.1",
15811600 "@webassemblyjs/helper-buffer": "1.1214.1",
15821601 "@webassemblyjs/helper-wasm-bytecode": "1.1113.62",
15831602 "@webassemblyjs/wasm-gen": "1.1214.1"
15841603 }
15851604 },
15861605 "node_modules/@webassemblyjs/ieee754": {
15871606 "version": "1.1113.62",
15881607 "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.1113.62.tgz",
15891608 "integrity": "sha512-LM4p2csPNvbij6U1f19v6WR56QZ8JcHg3QIJTlSwzFcmx6WSORicYj6I63f9yU1kEUtrpG+kjkiIAkevHpDXrg4LtOzh58S/5lX4ITKxnAK2USuNEvpdVV9AlgGQb8rJDHaLeHciwG4zlGr0j/SNWlr7x3vO1lDEsuePvtcDNCkw==",
15901609 "license": "MIT",
15911610 "dependencies": {
15921611 "@xtuc/ieee754": "^1.2.0"
15931612 }
15941613 },
15951614 "node_modules/@webassemblyjs/leb128": {
15961615 "version": "1.1113.62",
15971616 "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.1113.62.tgz",
15981617 "integrity": "sha512-m7a0FhE67DQXgouf1tbN5XQcdWoNgaAuoULHIfGFIEVKA6tuLde1oNoIdzVzdkNEAWZ1dZ5orIbff80YPdHx20mrHwHrVNNTjNr8E3xz9BdpcGqRQbAEa+fkrCb+fRFTl/edls6XnIlkmS6FrXAquJRPni3ZZKjw6FSPjPQ6sQw==",
15991618 "license": "Apache-2.0",
16001619 "dependencies": {
16011620 "@xtuc/long": "4.2.2"
16021621 }
16031622 },
16041623 "node_modules/@webassemblyjs/utf8": {
16051624 "version": "1.1113.62",
16061625 "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.1113.62.tgz",
16071626 "integrity": "sha512-vtXf2wTQ33NQWGjKTASY1xV5m7Hr0iPeXD9+up9Zsg8sa2yWiQpzSsMyXj0qViVP6xKGCUT8p8YJ6HqI7l5eCnWx1T/FYdsv07HQs2wTFbbofRDobLll3T9d2AO+g3my8xy5peVyjSag4I50mR1bBSN/RACt12lo+R9tJk0NZQ==",
16081627 "license": "MIT"
16091628 },
16101629 "node_modules/@webassemblyjs/wasm-edit": {
16111630 "version": "1.1214.1",
16121631 "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.1214.1.tgz",
16131632 "integrity": "sha512-1DuwbVvADvS5mGnXbE+c9NfA8QRcZ6iKquqjjmR10k6o+zzsRVesil54DKexiowcFCPdrRNJUIQH/Q0qaMgB01+SQ1u6gJ8iA/1NzlE4N7KtyZNHi3w7at7hDjvRNm5rcUXa00z1vRz3glZoULfJ5mpvYhLybmVcwcjGrC1pRrQ==",
16141633 "license": "MIT",
16151634 "dependencies": {
16161635 "@webassemblyjs/ast": "1.1214.1",
16171636 "@webassemblyjs/helper-buffer": "1.1214.1",
16181637 "@webassemblyjs/helper-wasm-bytecode": "1.1113.62",
16191638 "@webassemblyjs/helper-wasm-section": "1.1214.1",
16201639 "@webassemblyjs/wasm-gen": "1.1214.1",
16211640 "@webassemblyjs/wasm-opt": "1.1214.1",
16221641 "@webassemblyjs/wasm-parser": "1.1214.1",
16231642 "@webassemblyjs/wast-printer": "1.1214.1"
16241643 }
16251644 },
16261645 "node_modules/@webassemblyjs/wasm-gen": {
16271646 "version": "1.1214.1",
16281647 "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.1214.1.tgz",
16291648 "integrity": "sha512-TDq4Ojh9fcohAw6OIMXqiIcTq5KUXTGRkVxbSo1hQnSy6lAM5GSdfwWeSxpAo0YzgsgF182E/U0mDNhuA0tW7wAmomSIjP8ZbfGQhumkNvgC33AY7qtMCXnN6bL2u2Js4gVCg8fp735aEiMSBbDR7UQIj90n4wKAFUSEd0QN2Ukg==",
16301649 "license": "MIT",
16311650 "dependencies": {
16321651 "@webassemblyjs/ast": "1.1214.1",
16331652 "@webassemblyjs/helper-wasm-bytecode": "1.1113.62",
16341653 "@webassemblyjs/ieee754": "1.1113.62",
16351654 "@webassemblyjs/leb128": "1.1113.62",
16361655 "@webassemblyjs/utf8": "1.1113.62"
16371656 }
16381657 },
16391658 "node_modules/@webassemblyjs/wasm-opt": {
16401659 "version": "1.1214.1",
16411660 "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.1214.1.tgz",
16421661 "integrity": "sha512-Jg99j/2gG2iaz3hijw857AVYekZe2SAskcqlWIZXjji5WStnOpVoat3gQfTPTcKLUNvBqnY2U6E5bdOQcSM+oVP/Q5tb2djnCjBtMocYPmrDY9NzowJjislEjwP/Su1GfxPBgC4an2303MCVS2Mg9d3AJpIGdUFIQQWbPds0Sw==",
16431662 "license": "MIT",
16441663 "dependencies": {
16451664 "@webassemblyjs/ast": "1.1214.1",
16461665 "@webassemblyjs/helper-buffer": "1.1214.1",
16471666 "@webassemblyjs/wasm-gen": "1.1214.1",
16481667 "@webassemblyjs/wasm-parser": "1.1214.1"
16491668 }
16501669 },
16511670 "node_modules/@webassemblyjs/wasm-parser": {
16521671 "version": "1.1214.1",
16531672 "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.1214.1.tgz",
16541673 "integrity": "sha512-xikIi7c2FHXysxXe3COrVUPSheuBtpcfhbpFj4gmu7KRLYOzANztwUU0IbsqvMqzuNK2JLBl+glRGWCEqZo1WCLyAQKZ0R5qB7mCnud/yyX08jWFw5MsoalJ1pQ4EdFlgj9VdXKGuENGsiCIjegI1W7p91rUlcB/LB5yRJKNTcQ==",
16551674 "license": "MIT",
16561675 "dependencies": {
16571676 "@webassemblyjs/ast": "1.1214.1",
16581677 "@webassemblyjs/helper-api-error": "1.1113.62",
16591678 "@webassemblyjs/helper-wasm-bytecode": "1.1113.62",
16601679 "@webassemblyjs/ieee754": "1.1113.62",
16611680 "@webassemblyjs/leb128": "1.1113.62",
16621681 "@webassemblyjs/utf8": "1.1113.62"
16631682 }
16641683 },
16651684 "node_modules/@webassemblyjs/wast-printer": {
16661685 "version": "1.1214.1",
16671686 "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.1214.1.tgz",
16681687 "integrity": "sha512-kPSSXE6De1XOR820C90RIo2ogvZG+X4WAlOisVWQMikjbcvY2e0rwPsKQ9F688lksZhBcPycBBuii3O7m8FACbDMWDojpAqvjIncrG8J0XHKyQfVeAc3KiHzqUoO/F34Y2shGzesfqv7o57xrxovZJH/MetF5UjroJ/R/3isoiw==",
16691688 "license": "MIT",
16701689 "dependencies": {
16711690 "@webassemblyjs/ast": "1.1214.1",
16721691 "@xtuc/long": "4.2.2"
16731692 }
16741693 },
@@ -1685,9 +1704,10 @@
16851704 "license": "Apache-2.0"
16861705 },
16871706 "node_modules/@zeldafan0225/ai_horde": {
16881707 "version": "5.12.0",
16891708 "resolved": "https://registry.npmjs.org/@zeldafan0225/ai_horde/-/ai_horde-5.12.0.tgz",
16901709 "integrity": "sha512-rPC0nmmFSXK808Oon0zFPA7yGSUKBXiLtMejkmKTyfAzzOHHQtIkFFwt8nTW+F87Kndl1b5ZQfZVgnTm2qf5By4M82fEH+KyHXvnkSTzOl/i2lO4ccfN2e355LzX1lBLwSirUaqW0tjAXIyD+nlATVA43SwDM0D35TpdolPj4g==",
1710+ "license": "MIT",
16911711 "dependencies": {
16921712 "@thunder04/supermap": "^3.0.2"
16931713 },
@@ -1721,9 +1741,9 @@
17211741 }
17221742 },
17231743 "node_modules/acorn": {
17241744 "version": "8.1114.20",
17251745 "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.1114.20.tgz",
17261746 "integrity": "sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4wcl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==",
17271747 "license": "MIT",
17281748 "bin": {
17291749 "acorn": "bin/acorn"
@@ -1732,15 +1752,6 @@
17321752 "node": ">=0.4.0"
17331753 }
17341754 },
1735- "node_modules/acorn-import-attributes": {
1736- "version": "1.9.5",
1737- "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz",
1738- "integrity": "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==",
1739- "license": "MIT",
1740- "peerDependencies": {
1741- "acorn": "^8"
1742- }
1743- },
17441755 "node_modules/acorn-jsx": {
17451756 "version": "5.3.2",
17461757 "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz",
@@ -1752,40 +1763,14 @@
17521763 }
17531764 },
17541765 "node_modules/agent-base": {
17551766 "version": "7.1.13",
17561767 "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.13.tgz",
17571768 "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOAjRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==",
17581769 "license": "MIT",
1759- "dependencies": {
1760- "debug": "^4.3.4"
1761- },
17621770 "engines": {
17631771 "node": ">= 14"
17641772 }
17651773 },
1766- "node_modules/agent-base/node_modules/debug": {
1767- "version": "4.3.7",
1768- "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
1769- "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
1770- "license": "MIT",
1771- "dependencies": {
1772- "ms": "^2.1.3"
1773- },
1774- "engines": {
1775- "node": ">=6.0"
1776- },
1777- "peerDependenciesMeta": {
1778- "supports-color": {
1779- "optional": true
1780- }
1781- }
1782- },
1783- "node_modules/agent-base/node_modules/ms": {
1784- "version": "2.1.3",
1785- "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
1786- "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
1787- "license": "MIT"
1788- },
17891774 "node_modules/agentkeepalive": {
17901775 "version": "4.5.0",
17911776 "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.5.0.tgz",
@@ -1802,6 +1787,7 @@
18021787 "version": "6.12.6",
18031788 "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
18041789 "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
1790+ "dev": true,
18051791 "license": "MIT",
18061792 "dependencies": {
18071793 "fast-deep-equal": "^3.1.1",
@@ -1814,15 +1800,45 @@
18141800 "url": "https://github.com/sponsors/epoberezkin"
18151801 }
18161802 },
18171803 "node_modules/ajv-keywordsformats": {
18181804 "version": "32.51.21",
18191805 "resolved": "https://registry.npmjs.org/ajv-keywordsformats/-/ajv-keywordsformats-32.51.21.tgz",
18201806 "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmLWx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQWMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==",
18211807 "license": "MIT",
1808+ "dependencies": {
1809+ "ajv": "^8.0.0"
1810+ },
18221811 "peerDependencies": {
18231812 "ajv": "^68.90.10"
1813+ },
1814+ "peerDependenciesMeta": {
1815+ "ajv": {
1816+ "optional": true
1817+ }
18241818 }
18251819 },
1820+ "node_modules/ajv-formats/node_modules/ajv": {
1821+ "version": "8.17.1",
1822+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz",
1823+ "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==",
1824+ "license": "MIT",
1825+ "dependencies": {
1826+ "fast-deep-equal": "^3.1.3",
1827+ "fast-uri": "^3.0.1",
1828+ "json-schema-traverse": "^1.0.0",
1829+ "require-from-string": "^2.0.2"
1830+ },
1831+ "funding": {
1832+ "type": "github",
1833+ "url": "https://github.com/sponsors/epoberezkin"
1834+ }
1835+ },
1836+ "node_modules/ajv-formats/node_modules/json-schema-traverse": {
1837+ "version": "1.0.0",
1838+ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",
1839+ "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==",
1840+ "license": "MIT"
1841+ },
18261842 "node_modules/ansi-regex": {
18271843 "version": "5.0.1",
18281844 "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
@@ -2219,15 +2235,6 @@
22192235 "npm": "1.2.8000 || >= 1.4.16"
22202236 }
22212237 },
2222- "node_modules/body-parser/node_modules/bytes": {
2223- "version": "3.1.2",
2224- "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
2225- "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==",
2226- "license": "MIT",
2227- "engines": {
2228- "node": ">= 0.8"
2229- }
2230- },
22312238 "node_modules/body-parser/node_modules/iconv-lite": {
22322239 "version": "0.4.24",
22332240 "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
@@ -2355,9 +2362,9 @@
23552362 }
23562363 },
23572364 "node_modules/bytes": {
23582365 "version": "3.01.02",
23592366 "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.01.02.tgz",
23602367 "integrity": "sha512-pMhOfFDPiv9t5jjIXkHosWmkSyQbvsgEVNkz0ERHbuLh2T/7j4Mqqpz523Fe8MVY89KC6Sh/QfS2sMNf7TyzTx6S3yRJObOAV7956r8cr2+SjgFDcwOj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==",
23612368 "license": "MIT",
23622369 "engines": {
23632370 "node": ">= 0.8"
@@ -2409,6 +2416,19 @@
24092416 "url": "https://github.com/sponsors/ljharb"
24102417 }
24112418 },
2419+ "node_modules/call-bind-apply-helpers": {
2420+ "version": "1.0.2",
2421+ "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",
2422+ "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==",
2423+ "license": "MIT",
2424+ "dependencies": {
2425+ "es-errors": "^1.3.0",
2426+ "function-bind": "^1.1.2"
2427+ },
2428+ "engines": {
2429+ "node": ">= 0.4"
2430+ }
2431+ },
24122432 "node_modules/callsites": {
24132433 "version": "3.1.0",
24142434 "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
@@ -2449,17 +2469,12 @@
24492469 }
24502470 },
24512471 "node_modules/chalk": {
24522472 "version": "5.4.1.2",
24532473 "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.4.1.2.tgz",
24542474 "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+0G76SLROeyw9CpQ061i4mAU3w==",
2455- "dev": true,
24562475 "license": "MIT",
2457- "dependencies": {
2458- "ansi-styles": "^4.1.0",
2459- "supports-color": "^7.1.0"
2460- },
24612476 "engines": {
2462- "node": ">=10"
2477+ "node": "^12.17.0 || ^14.13 || >=16.0.0"
24632478 },
24642479 "funding": {
24652480 "url": "https://github.com/chalk/chalk?sponsor=1"
@@ -2702,23 +2717,52 @@
27022717 }
27032718 },
27042719 "node_modules/compression": {
27052720 "version": "1.78.40",
27062721 "resolved": "https://registry.npmjs.org/compression/-/compression-1.78.40.tgz",
27072722 "integrity": "sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6tk6WLKfunuqCYD3t6AsuPGvQWaKwuLLh2/xHNcX4qE+6CUQcAoA6tvIfDNXpSqnrhwA7O53R7WVQUnt8dVAIW+x89MLrWAqpfDE8iQYHr7xTgOgGA==",
27082723 "license": "MIT",
27092724 "dependencies": {
27102725 "acceptsbytes": "~1.3.51.2",
27112726 "bytescompressible": "3~2.0.018",
2712- "compressible": "~2.0.16",
27132727 "debug": "2.6.9",
2728+ "negotiator": "~0.6.4",
27142729 "on-headers": "~1.0.2",
27152730 "safe-buffer": "5.1.2.1",
27162731 "vary": "~1.1.2"
27172732 },
27182733 "engines": {
27192734 "node": ">= 0.8.0"
27202735 }
27212736 },
2737+ "node_modules/compression/node_modules/negotiator": {
2738+ "version": "0.6.4",
2739+ "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.4.tgz",
2740+ "integrity": "sha512-myRT3DiWPHqho5PrJaIRyaMv2kgYf0mUVgBNOYMuCH5Ki1yEiQaf/ZJuQ62nvpc44wL5WDbTX7yGJi1Neevw8w==",
2741+ "license": "MIT",
2742+ "engines": {
2743+ "node": ">= 0.6"
2744+ }
2745+ },
2746+ "node_modules/compression/node_modules/safe-buffer": {
2747+ "version": "5.2.1",
2748+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
2749+ "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
2750+ "funding": [
2751+ {
2752+ "type": "github",
2753+ "url": "https://github.com/sponsors/feross"
2754+ },
2755+ {
2756+ "type": "patreon",
2757+ "url": "https://www.patreon.com/feross"
2758+ },
2759+ {
2760+ "type": "consulting",
2761+ "url": "https://feross.org/support"
2762+ }
2763+ ],
2764+ "license": "MIT"
2765+ },
27222766 "node_modules/concat-map": {
27232767 "version": "0.0.1",
27242768 "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
@@ -3279,6 +3323,20 @@
32793323 "node": ">=0.8.0"
32803324 }
32813325 },
3326+ "node_modules/dunder-proto": {
3327+ "version": "1.0.1",
3328+ "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
3329+ "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",
3330+ "license": "MIT",
3331+ "dependencies": {
3332+ "call-bind-apply-helpers": "^1.0.1",
3333+ "es-errors": "^1.3.0",
3334+ "gopd": "^1.2.0"
3335+ },
3336+ "engines": {
3337+ "node": ">= 0.4"
3338+ }
3339+ },
32823340 "node_modules/eastasianwidth": {
32833341 "version": "0.2.0",
32843342 "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz",
@@ -3346,9 +3404,9 @@
33463404 }
33473405 },
33483406 "node_modules/es-define-property": {
33493407 "version": "1.0.01",
33503408 "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.01.tgz",
33513409 "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQLTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",
33523410 "license": "MIT",
33533411 "dependencies": {
33543412 "get-intrinsic": "^1.2.4"
@@ -3372,6 +3430,33 @@
33723430 "integrity": "sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw==",
33733431 "license": "MIT"
33743432 },
3433+ "node_modules/es-object-atoms": {
3434+ "version": "1.1.1",
3435+ "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz",
3436+ "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==",
3437+ "license": "MIT",
3438+ "dependencies": {
3439+ "es-errors": "^1.3.0"
3440+ },
3441+ "engines": {
3442+ "node": ">= 0.4"
3443+ }
3444+ },
3445+ "node_modules/es-set-tostringtag": {
3446+ "version": "2.1.0",
3447+ "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz",
3448+ "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==",
3449+ "license": "MIT",
3450+ "dependencies": {
3451+ "es-errors": "^1.3.0",
3452+ "get-intrinsic": "^1.2.6",
3453+ "has-tostringtag": "^1.0.2",
3454+ "hasown": "^2.0.2"
3455+ },
3456+ "engines": {
3457+ "node": ">= 0.4"
3458+ }
3459+ },
33753460 "node_modules/escalade": {
33763461 "version": "3.2.0",
33773462 "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz",
@@ -3418,17 +3503,18 @@
34183503 }
34193504 },
34203505 "node_modules/eslint": {
34213506 "version": "8.57.01",
34223507 "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.01.tgz",
34233508 "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==",
3509+ "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.",
34243510 "dev": true,
34253511 "license": "MIT",
34263512 "dependencies": {
34273513 "@eslint-community/eslint-utils": "^4.2.0",
34283514 "@eslint-community/regexpp": "^4.6.1",
34293515 "@eslint/eslintrc": "^2.1.4",
34303516 "@eslint/js": "8.57.01",
34313517 "@humanwhocodes/config-array": "^0.1113.140",
34323518 "@humanwhocodes/module-importer": "^1.0.1",
34333519 "@nodelib/fs.walk": "^1.2.8",
34343520 "@ungap/structured-clone": "^1.2.0",
@@ -3503,6 +3589,23 @@
35033589 "url": "https://opencollective.com/eslint"
35043590 }
35053591 },
3592+ "node_modules/eslint/node_modules/chalk": {
3593+ "version": "4.1.2",
3594+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
3595+ "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
3596+ "dev": true,
3597+ "license": "MIT",
3598+ "dependencies": {
3599+ "ansi-styles": "^4.1.0",
3600+ "supports-color": "^7.1.0"
3601+ },
3602+ "engines": {
3603+ "node": ">=10"
3604+ },
3605+ "funding": {
3606+ "url": "https://github.com/chalk/chalk?sponsor=1"
3607+ }
3608+ },
35063609 "node_modules/eslint/node_modules/debug": {
35073610 "version": "4.3.4",
35083611 "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
@@ -3749,6 +3852,7 @@
37493852 "version": "2.1.0",
37503853 "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
37513854 "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==",
3855+ "dev": true,
37523856 "license": "MIT"
37533857 },
37543858 "node_modules/fast-levenshtein": {
@@ -3758,6 +3862,22 @@
37583862 "dev": true,
37593863 "license": "MIT"
37603864 },
3865+ "node_modules/fast-uri": {
3866+ "version": "3.0.6",
3867+ "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.6.tgz",
3868+ "integrity": "sha512-Atfo14OibSv5wAp4VWNsFYE1AchQRTv9cBGWET4pZWHzYshFSS9NQI6I57rdKn9croWVMbYFbLhJ+yJvmZIIHw==",
3869+ "funding": [
3870+ {
3871+ "type": "github",
3872+ "url": "https://github.com/sponsors/fastify"
3873+ },
3874+ {
3875+ "type": "opencollective",
3876+ "url": "https://opencollective.com/fastify"
3877+ }
3878+ ],
3879+ "license": "BSD-3-Clause"
3880+ },
37613881 "node_modules/fastq": {
37623882 "version": "1.15.0",
37633883 "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz",
@@ -3928,13 +4048,14 @@
39284048 }
39294049 },
39304050 "node_modules/form-data": {
39314051 "version": "4.0.02",
39324052 "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.02.tgz",
39334053 "integrity": "sha512-ETEklSGi5t0QMZuiXoAhGfm/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPpslu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+xgEhuMaHCZ0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+zGgn31Kd235W35f7Hykkawwnr6FM8w==",
39344054 "license": "MIT",
39354055 "dependencies": {
39364056 "asynckit": "^0.4.0",
39374057 "combined-stream": "^1.0.8",
4058+ "es-set-tostringtag": "^2.1.0",
39384059 "mime-types": "^2.1.12"
39394060 },
39404061 "engines": {
@@ -3999,20 +4120,6 @@
39994120 "node": ">= 0.6"
40004121 }
40014122 },
4002- "node_modules/fs-extra": {
4003- "version": "11.2.0",
4004- "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz",
4005- "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==",
4006- "license": "MIT",
4007- "dependencies": {
4008- "graceful-fs": "^4.2.0",
4009- "jsonfile": "^6.0.1",
4010- "universalify": "^2.0.0"
4011- },
4012- "engines": {
4013- "node": ">=14.14"
4014- }
4015- },
40164123 "node_modules/fs.realpath": {
40174124 "version": "1.0.0",
40184125 "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
@@ -4030,9 +4137,9 @@
40304137 }
40314138 },
40324139 "node_modules/fuse.js": {
40334140 "version": "7.01.0",
40344141 "resolved": "https://registry.npmjs.org/fuse.js/-/fuse.js-7.01.0.tgz",
40354142 "integrity": "sha512-14F4hBIxqKvD4Zz/XjDc3y94mNZN6pRv3U13Udo0lNLCWRBUsrMv2xwcF/y/Z5sV6+FQWtrLf4SzuuUxfusZADLINj+dE8clK1frKdmqiJNb1Es75fmI5oY6X2mxLVUciLLjxqw/ow68cHpm4sunt8Qxr72Dhy+lER6dGd02FQ==",
40364143 "license": "Apache-2.0",
40374144 "engines": {
40384145 "node": ">=10"
@@ -4048,16 +4155,21 @@
40484155 }
40494156 },
40504157 "node_modules/get-intrinsic": {
40514158 "version": "1.23.40",
40524159 "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.23.40.tgz",
40534160 "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF79fSjSaos/oQuhzumXJK7paBRQfRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==",
40544161 "license": "MIT",
40554162 "dependencies": {
4163+ "call-bind-apply-helpers": "^1.0.2",
4164+ "es-define-property": "^1.0.1",
40564165 "es-errors": "^1.3.0",
4166+ "es-object-atoms": "^1.1.1",
40574167 "function-bind": "^1.1.2",
40584168 "hasget-proto": "^1.0.1",
40594169 "has-symbolsgopd": "^1.02.30",
40604170 "hasownhas-symbols": "^21.01.0",
4171+ "hasown": "^2.0.2",
4172+ "math-intrinsics": "^1.1.0"
40614173 },
40624174 "engines": {
40634175 "node": ">= 0.4"
@@ -4066,6 +4178,19 @@
40664178 "url": "https://github.com/sponsors/ljharb"
40674179 }
40684180 },
4181+ "node_modules/get-proto": {
4182+ "version": "1.0.1",
4183+ "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz",
4184+ "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",
4185+ "license": "MIT",
4186+ "dependencies": {
4187+ "dunder-proto": "^1.0.1",
4188+ "es-object-atoms": "^1.0.0"
4189+ },
4190+ "engines": {
4191+ "node": ">= 0.4"
4192+ }
4193+ },
40694194 "node_modules/get-stream": {
40704195 "version": "5.2.0",
40714196 "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz",
@@ -4082,24 +4207,23 @@
40824207 }
40834208 },
40844209 "node_modules/get-uri": {
40854210 "version": "6.0.34",
40864211 "resolved": "https://registry.npmjs.org/get-uri/-/get-uri-6.0.34.tgz",
40874212 "integrity": "sha512-BzUrJBS9EcUb4cFol8r4W3v1cPsSyajLSthNkz5BxbpDcHN5tIrM10E2eNvfnvBn3DaT3DUgx0OpsBKkaOpanwE1b1lFFLvLgak2whF2xDBcOy6NLVGZBqqjJjsIhvopKfWWEi64pLVTWWehV8KlLerZkfNTA95sTe2OdJKm1OzQ==",
40884213 "license": "MIT",
40894214 "dependencies": {
40904215 "basic-ftp": "^5.0.2",
40914216 "data-uri-to-buffer": "^6.0.2",
40924217 "debug": "^4.3.4",
4093- "fs-extra": "^11.2.0"
40944218 },
40954219 "engines": {
40964220 "node": ">= 14"
40974221 }
40984222 },
40994223 "node_modules/get-uri/node_modules/debug": {
41004224 "version": "4.34.70",
41014225 "resolved": "https://registry.npmjs.org/debug/-/debug-4.34.70.tgz",
41024226 "integrity": "sha512-Er2nc6WTZ/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yWIxCY/T6BALoZHaE4ctp9xm+GOJap1Krg4w0Hg80oCqgQZ5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==",
41034227 "license": "MIT",
41044228 "dependencies": {
41054229 "ms": "^2.1.3"
@@ -4189,9 +4313,9 @@
41894313 "license": "MIT"
41904314 },
41914315 "node_modules/google-translate-api-x": {
41924316 "version": "10.7.12",
41934317 "resolved": "https://registry.npmjs.org/google-translate-api-x/-/google-translate-api-x-10.7.12.tgz",
41944318 "integrity": "sha512-OdZDS6jRWzn1woOk62aOKQ5OyVaJSAGSmbvGMcnULaih2NFgD4Y6840DLAMot90mLWgwoB+eyc6CktOWxo36IWfstOjwGFG/dkvnGl3Z2Sbpmk1A+jc2WwrBiRjqaY2AQpetyZkFrZkxop8ZxXgOAQXGskFOhGJady8nA6ZJ2g==",
41954319 "license": "MIT",
41964320 "engines": {
41974321 "node": ">=14.0.0"
@@ -4202,12 +4326,12 @@
42024326 }
42034327 },
42044328 "node_modules/gopd": {
42054329 "version": "1.02.10",
42064330 "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.02.10.tgz",
42074331 "integrity": "sha512-d65bNlIadxvpbZUKRh6/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwAkUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",
42084332 "license": "MIT",
42094333 "dependenciesengines": {
42104334 "get-intrinsicnode": "^1.1>= 0.34"
42114335 },
42124336 "funding": {
42134337 "url": "https://github.com/sponsors/ljharb"
@@ -4304,10 +4428,10 @@
43044428 "url": "https://github.com/sponsors/ljharb"
43054429 }
43064430 },
43074431 "node_modules/has-protosymbols": {
43084432 "version": "1.01.30",
43094433 "resolved": "https://registry.npmjs.org/has-protosymbols/-/has-protosymbols-1.01.30.tgz",
43104434 "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+Qeb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==",
43114435 "license": "MIT",
43124436 "engines": {
43134437 "node": ">= 0.4"
@@ -4316,11 +4440,14 @@
43164440 "url": "https://github.com/sponsors/ljharb"
43174441 }
43184442 },
43194443 "node_modules/has-symbolstostringtag": {
43204444 "version": "1.0.32",
43214445 "resolved": "https://registry.npmjs.org/has-symbolstostringtag/-/has-symbolstostringtag-1.0.32.tgz",
43224446 "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2TdNqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+AieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==",
43234447 "license": "MIT",
4448+ "dependencies": {
4449+ "has-symbols": "^1.0.3"
4450+ },
43244451 "engines": {
43254452 "node": ">= 0.4"
43264453 },
@@ -4341,17 +4468,18 @@
43414468 }
43424469 },
43434470 "node_modules/helmet": {
43444471 "version": "7.12.0",
43454472 "resolved": "https://registry.npmjs.org/helmet/-/helmet-7.12.0.tgz",
43464473 "integrity": "sha512-g+HZqgfbpXdCkme/Cd/mZkV0aV3BZZZSugecH03kl38mZRiwvN089JfMXokizgqEPXsl2Guk094yExfoDXR0cBYWxtBbaSww/Kmdx8jKjBikpDj2crw+Iynv4KpYEviojNdTJActJAgvT4WEJsBW2iTUi1GgZ6swmoug3Oy4Xw==",
4474+ "license": "MIT",
43474475 "engines": {
43484476 "node": ">=16.0.0"
43494477 }
43504478 },
43514479 "node_modules/highlight.js": {
43524480 "version": "11.1011.01",
43534481 "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-11.1011.01.tgz",
43544482 "integrity": "sha512-SYVnVFswQERXwwo44whKBVCYoliBQwaPvtd/2tYFkRQtXDWj1nackaV2JPXx3L0+zu1laSya563sJvd8/qCJ2p+F8VDGt7o35d4utbamowvUNLLMovFqwCLSocpZTz3MgaSRA1IbqRWZv97dtErQML0/XVkJ2q+Mr+UVdpJK5w==",
43554483 "license": "BSD-3-Clause",
43564484 "engines": {
43574485 "node": ">=12.0.0"
@@ -4428,9 +4556,9 @@
44284556 }
44294557 },
44304558 "node_modules/http-proxy-agent/node_modules/debug": {
44314559 "version": "4.34.70",
44324560 "resolved": "https://registry.npmjs.org/debug/-/debug-4.34.70.tgz",
44334561 "integrity": "sha512-Er2nc6WTZ/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yWIxCY/T6BALoZHaE4ctp9xm+GOJap1Krg4w0Hg80oCqgQZ5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==",
44344562 "license": "MIT",
44354563 "dependencies": {
44364564 "ms": "^2.1.3"
@@ -4464,12 +4592,12 @@
44644592 }
44654593 },
44664594 "node_modules/https-proxy-agent": {
44674595 "version": "7.0.56",
44684596 "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.56.tgz",
44694597 "integrity": "sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvwvK9P5/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalwiUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==",
44704598 "license": "MIT",
44714599 "dependencies": {
44724600 "agent-base": "^7.01.2",
44734601 "debug": "4"
44744602 },
44754603 "engines": {
@@ -4477,9 +4605,9 @@
44774605 }
44784606 },
44794607 "node_modules/https-proxy-agent/node_modules/debug": {
44804608 "version": "4.34.70",
44814609 "resolved": "https://registry.npmjs.org/debug/-/debug-4.34.70.tgz",
44824610 "integrity": "sha512-Er2nc6WTZ/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yWIxCY/T6BALoZHaE4ctp9xm+GOJap1Krg4w0Hg80oCqgQZ5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==",
44834611 "license": "MIT",
44844612 "dependencies": {
44854613 "ms": "^2.1.3"
@@ -4646,9 +4774,9 @@
46464774 }
46474775 },
46484776 "node_modules/ipaddr.js": {
46494777 "version": "2.12.0",
46504778 "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.12.0.tgz",
46514779 "integrity": "sha512-LlbxQ7xKzfBusov6UMi4MFpEg0mAg3wB2o37wslZS19hZqorUnrnzSkpOVy+mAm9xyNGEduwXMEDuf4WfzBIiiDEiTqNubEYpYuHWIf6K4psgN2ZWKExS4xhVCrRVfb/RZwMVYEd7IKGvh4IUkEXYxtAVu9T3OelJQwfW8fWJA==",
46524780 "license": "MIT",
46534781 "engines": {
46544782 "node": ">= 10"
@@ -4661,15 +4789,15 @@
46614789 "license": "MIT"
46624790 },
46634791 "node_modules/is-docker": {
46644792 "version": "23.20.10",
46654793 "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-23.20.10.tgz",
46664794 "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQeljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==",
46674795 "license": "MIT",
46684796 "bin": {
46694797 "is-docker": "cli.js"
46704798 },
46714799 "engines": {
4672- "node": ">=8"
4800+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
46734801 },
46744802 "funding": {
46754803 "url": "https://github.com/sponsors/sindresorhus"
@@ -4746,6 +4874,21 @@
47464874 "node": ">=8"
47474875 }
47484876 },
4877+ "node_modules/is-wsl/node_modules/is-docker": {
4878+ "version": "2.2.1",
4879+ "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz",
4880+ "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==",
4881+ "license": "MIT",
4882+ "bin": {
4883+ "is-docker": "cli.js"
4884+ },
4885+ "engines": {
4886+ "node": ">=8"
4887+ },
4888+ "funding": {
4889+ "url": "https://github.com/sponsors/sindresorhus"
4890+ }
4891+ },
47494892 "node_modules/isarray": {
47504893 "version": "1.0.0",
47514894 "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
@@ -4959,6 +5102,7 @@
49595102 "version": "0.4.1",
49605103 "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
49615104 "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
5105+ "dev": true,
49625106 "license": "MIT"
49635107 },
49645108 "node_modules/json-stable-stringify-without-jsonify": {
@@ -4968,18 +5112,6 @@
49685112 "dev": true,
49695113 "license": "MIT"
49705114 },
4971- "node_modules/jsonfile": {
4972- "version": "6.1.0",
4973- "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
4974- "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
4975- "license": "MIT",
4976- "dependencies": {
4977- "universalify": "^2.0.0"
4978- },
4979- "optionalDependencies": {
4980- "graceful-fs": "^4.1.6"
4981- }
4982- },
49835115 "node_modules/keygrip": {
49845116 "version": "1.1.0",
49855117 "resolved": "https://registry.npmjs.org/keygrip/-/keygrip-1.1.0.tgz",
@@ -5126,6 +5258,15 @@
51265258 "node": "14 || >=16.14"
51275259 }
51285260 },
5261+ "node_modules/math-intrinsics": {
5262+ "version": "1.1.0",
5263+ "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
5264+ "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==",
5265+ "license": "MIT",
5266+ "engines": {
5267+ "node": ">= 0.4"
5268+ }
5269+ },
51295270 "node_modules/md5": {
51305271 "version": "2.3.0",
51315272 "resolved": "https://registry.npmjs.org/md5/-/md5-2.3.0.tgz",
@@ -5382,9 +5523,13 @@
53825523 }
53835524 },
53845525 "node_modules/node-persist": {
53855526 "version": "4.0.14",
53865527 "resolved": "https://registry.npmjs.org/node-persist/-/node-persist-4.0.14.tgz",
53875528 "integrity": "sha512-QtRjwAlcOQChQpfG6odtEhxYmA3nS5XYr+bx9JRjwahl1TM3sm9J3CCn518sPAz/MI0eoHRb2DrkEsCOFo8sq8jG5sQ7tw1mCCc8xBG4f0wi+flHkSSgQeX998iQ75Pu27evA6UUWCjSE7xnrYTg2q33oU5leJ061EKPDv6BocQ==",
5529+ "license": "MIT",
5530+ "dependencies": {
5531+ "p-limit": "^3.1.0"
5532+ },
53885533 "engines": {
53895534 "node": ">=10.12.0"
53905535 }
@@ -5530,6 +5675,21 @@
55305675 "url": "https://github.com/sponsors/sindresorhus"
55315676 }
55325677 },
5678+ "node_modules/open/node_modules/is-docker": {
5679+ "version": "2.2.1",
5680+ "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz",
5681+ "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==",
5682+ "license": "MIT",
5683+ "bin": {
5684+ "is-docker": "cli.js"
5685+ },
5686+ "engines": {
5687+ "node": ">=8"
5688+ },
5689+ "funding": {
5690+ "url": "https://github.com/sponsors/sindresorhus"
5691+ }
5692+ },
55335693 "node_modules/openai": {
55345694 "version": "4.17.4",
55355695 "resolved": "https://registry.npmjs.org/openai/-/openai-4.17.4.tgz",
@@ -5601,7 +5761,6 @@
56015761 "version": "3.1.0",
56025762 "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",
56035763 "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==",
5604- "dev": true,
56055764 "license": "MIT",
56065765 "dependencies": {
56075766 "yocto-queue": "^0.1.0"
@@ -5630,28 +5789,28 @@
56305789 }
56315790 },
56325791 "node_modules/pac-proxy-agent": {
56335792 "version": "7.0.2.0",
56345793 "resolved": "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-7.0.2.0.tgz",
56355794 "integrity": "sha512-BFi3vZnO9X5Qt6NRz7ZOaPja3ic0PhlsmCRYLOpN11+mWBCR6XJDqW5RF3j8jm4WGGQZtBATEB8ESquiLMc0lV8vcd5Ql/JAKAoyzHFXaStwjkzpOpC5Yv+bTfxYzeKW73eHgpIzLfHvjTSdf3vpa2bMiUQrg9i6276yn8666aA==",
56365795 "license": "MIT",
56375796 "dependencies": {
56385797 "@tootallnate/quickjs-emscripten": "^0.23.0",
56395798 "agent-base": "^7.01.2",
56405799 "debug": "^4.3.4",
56415800 "get-uri": "^6.0.1",
56425801 "http-proxy-agent": "^7.0.0",
56435802 "https-proxy-agent": "^7.0.56",
56445803 "pac-resolver": "^7.0.1",
56455804 "socks-proxy-agent": "^8.0.45"
56465805 },
56475806 "engines": {
56485807 "node": ">= 14"
56495808 }
56505809 },
56515810 "node_modules/pac-proxy-agent/node_modules/debug": {
56525811 "version": "4.34.70",
56535812 "resolved": "https://registry.npmjs.org/debug/-/debug-4.34.70.tgz",
56545813 "integrity": "sha512-Er2nc6WTZ/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yWIxCY/T6BALoZHaE4ctp9xm+GOJap1Krg4w0Hg80oCqgQZ5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==",
56555814 "license": "MIT",
56565815 "dependencies": {
56575816 "ms": "^2.1.3"
@@ -5987,19 +6146,19 @@
59876146 }
59886147 },
59896148 "node_modules/proxy-agent": {
59906149 "version": "6.45.0",
59916150 "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-6.45.0.tgz",
59926151 "integrity": "sha512-u0piLUTmatMXdr2KlRiA2CyDu8GqR8EjahTG3aY3nXjdzFyoZbmB8hrBsTyMezhULIXKnC0jpfjlmiZ3+nCOHMgGjRbimiXmA9kMEaCzoInSu/L9EHh3zL81xCdp7m+Y2pHIsnmbdDoEDoAz5geaonNR6q6+yOPQs6n4T6sBQA==",
59936152 "license": "MIT",
59946153 "dependencies": {
59956154 "agent-base": "^7.01.2",
59966155 "debug": "^4.3.4",
59976156 "http-proxy-agent": "^7.0.1",
59986157 "https-proxy-agent": "^7.0.36",
59996158 "lru-cache": "^7.14.1",
60006159 "pac-proxy-agent": "^7.0.1.0",
60016160 "proxy-from-env": "^1.1.0",
60026161 "socks-proxy-agent": "^8.0.25"
60036162 },
60046163 "engines": {
60056164 "node": ">= 14"
@@ -6134,9 +6293,10 @@
61346293 }
61356294 },
61366295 "node_modules/rate-limiter-flexible": {
61376296 "version": "5.0.05",
61386297 "resolved": "https://registry.npmjs.org/rate-limiter-flexible/-/rate-limiter-flexible-5.0.05.tgz",
61396298 "integrity": "sha512-ivCyLBwPtR5IRrz+aZnztVwX16ZK3iAjdlW21I/vjHq56at5Zb8eIefDzODg8R7hwPOHpBtb6Pj9Zdmn0nRb8gdSQfo+3FYwYygUs/V2BBdwGa9nFtakDwKt4l0bnvNB53TNT++QSFewwHX9qXrZJuMe9j+TUaU21lm5ARgqdQ==",
6299+ "license": "ISC"
61406300 },
61416301 "node_modules/raw-body": {
61426302 "version": "2.5.2",
@@ -6153,15 +6313,6 @@
61536313 "node": ">= 0.8"
61546314 }
61556315 },
6156- "node_modules/raw-body/node_modules/bytes": {
6157- "version": "3.1.2",
6158- "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
6159- "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==",
6160- "license": "MIT",
6161- "engines": {
6162- "node": ">= 0.8"
6163- }
6164- },
61656316 "node_modules/raw-body/node_modules/iconv-lite": {
61666317 "version": "0.4.24",
61676318 "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
@@ -6261,6 +6412,15 @@
62616412 "node": ">=0.10.0"
62626413 }
62636414 },
6415+ "node_modules/require-from-string": {
6416+ "version": "2.0.2",
6417+ "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz",
6418+ "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==",
6419+ "license": "MIT",
6420+ "engines": {
6421+ "node": ">=0.10.0"
6422+ }
6423+ },
62646424 "node_modules/resolve-alpn": {
62656425 "version": "1.2.1",
62666426 "resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz",
@@ -6278,27 +6438,18 @@
62786438 }
62796439 },
62806440 "node_modules/response-time": {
62816441 "version": "2.3.23",
62826442 "resolved": "https://registry.npmjs.org/response-time/-/response-time-2.3.23.tgz",
62836443 "integrity": "sha512-MUIDaDQf+CVqflfTdQ5yam+aYCkXj1PY8fjlPDQ6ppxJlmgZb864pHtA750mayywNg8tx4rS7qH9JXdSsjjOPHl/OFFfrTQNgmc5oen8Hr1Jxpn6LlHNXxCIFdYMHuK1kMeYMobb9XN3mvxaGQm3dbegqYFMX4+3gwGDORfbWg==",
62846444 "license": "MIT",
62856445 "dependencies": {
62866446 "depd": "~12.10.0",
62876447 "on-headers": "~1.0.1"
62886448 },
62896449 "engines": {
62906450 "node": ">= 0.8.0"
62916451 }
62926452 },
6293- "node_modules/response-time/node_modules/depd": {
6294- "version": "1.1.2",
6295- "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
6296- "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==",
6297- "license": "MIT",
6298- "engines": {
6299- "node": ">= 0.6"
6300- }
6301- },
63026453 "node_modules/responselike": {
63036454 "version": "2.0.1",
63046455 "resolved": "https://registry.npmjs.org/responselike/-/responselike-2.0.1.tgz",
@@ -6389,6 +6540,59 @@
63896540 "integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==",
63906541 "license": "ISC"
63916542 },
6543+ "node_modules/schema-utils": {
6544+ "version": "4.3.0",
6545+ "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.0.tgz",
6546+ "integrity": "sha512-Gf9qqc58SpCA/xdziiHz35F4GNIWYWZrEshUc/G/r5BnLph6xpKuLeoJoQuj5WfBIx/eQLf+hmVPYHaxJu7V2g==",
6547+ "license": "MIT",
6548+ "dependencies": {
6549+ "@types/json-schema": "^7.0.9",
6550+ "ajv": "^8.9.0",
6551+ "ajv-formats": "^2.1.1",
6552+ "ajv-keywords": "^5.1.0"
6553+ },
6554+ "engines": {
6555+ "node": ">= 10.13.0"
6556+ },
6557+ "funding": {
6558+ "type": "opencollective",
6559+ "url": "https://opencollective.com/webpack"
6560+ }
6561+ },
6562+ "node_modules/schema-utils/node_modules/ajv": {
6563+ "version": "8.17.1",
6564+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz",
6565+ "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==",
6566+ "license": "MIT",
6567+ "dependencies": {
6568+ "fast-deep-equal": "^3.1.3",
6569+ "fast-uri": "^3.0.1",
6570+ "json-schema-traverse": "^1.0.0",
6571+ "require-from-string": "^2.0.2"
6572+ },
6573+ "funding": {
6574+ "type": "github",
6575+ "url": "https://github.com/sponsors/epoberezkin"
6576+ }
6577+ },
6578+ "node_modules/schema-utils/node_modules/ajv-keywords": {
6579+ "version": "5.1.0",
6580+ "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz",
6581+ "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==",
6582+ "license": "MIT",
6583+ "dependencies": {
6584+ "fast-deep-equal": "^3.1.3"
6585+ },
6586+ "peerDependencies": {
6587+ "ajv": "^8.8.2"
6588+ }
6589+ },
6590+ "node_modules/schema-utils/node_modules/json-schema-traverse": {
6591+ "version": "1.0.0",
6592+ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",
6593+ "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==",
6594+ "license": "MIT"
6595+ },
63926596 "node_modules/seedrandom": {
63936597 "version": "3.0.5",
63946598 "resolved": "https://registry.npmjs.org/seedrandom/-/seedrandom-3.0.5.tgz",
@@ -6569,14 +6773,14 @@
65696773 }
65706774 },
65716775 "node_modules/simple-git": {
65726776 "version": "3.1927.10",
65736777 "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-3.1927.10.tgz",
65746778 "integrity": "sha512-Ck+rcjVaE1HotraRAS8uivHoFS9Yi9GY49ogc6/YAi3Fl9ROnF4VyubNylgCkA+xgTvToTuoMkT9/l9lvuP5jftwnYUp6DwuJzsKErHgfyRk8IB8pqGHWEbM3tLgV1wRVqLaKWnDSzXOVzya8csELIaWaYNutsEuAhZrtOjozA==",
65756779 "license": "MIT",
65766780 "dependencies": {
65776781 "@kwsites/file-exists": "^1.1.1",
65786782 "@kwsites/promise-deferred": "^1.1.1",
65796783 "debug": "^4.3.45"
65806784 },
65816785 "funding": {
65826786 "type": "github",
@@ -6584,12 +6788,12 @@
65846788 }
65856789 },
65866790 "node_modules/simple-git/node_modules/debug": {
65876791 "version": "4.3.4.0",
65886792 "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.0.tgz",
65896793 "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX6WTZ/IxCY/T6BALoZHaE4ctp9xm+7GZ5kY/vCNNhehwxfkQpzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==",
65906794 "license": "MIT",
65916795 "dependencies": {
65926796 "ms": "^2.1.23"
65936797 },
65946798 "engines": {
65956799 "node": ">=6.0"
@@ -6601,9 +6805,9 @@
66016805 }
66026806 },
66036807 "node_modules/simple-git/node_modules/ms": {
66046808 "version": "2.1.23",
66056809 "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.23.tgz",
66066810 "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk6FlzubTLZG3J2a/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2wNVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
66076811 "license": "MIT"
66086812 },
66096813 "node_modules/sliced": {
@@ -6629,9 +6833,9 @@
66296833 }
66306834 },
66316835 "node_modules/socks": {
66326836 "version": "2.8.34",
66336837 "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.34.tgz",
66346838 "integrity": "sha512-l5x7VUUWbjVFbafGLxPWkYsHIhEvmF85tbIeFZWc8ZPtoMyybuEhL7Jye/ooC4/d48FgOjSJXgsFD3YaD0aRxR3mEcqnidIs7ReYJFVzWdd6fXJYUM8ixcQcJRGTka/AJPYCW8Zwb3saV0KflYhyVJXKhb947GndU35SxYNResQ==",
66356839 "license": "MIT",
66366840 "dependencies": {
66376841 "ip-address": "^9.0.5",
@@ -6643,12 +6847,12 @@
66436847 }
66446848 },
66456849 "node_modules/socks-proxy-agent": {
66466850 "version": "8.0.45",
66476851 "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.45.tgz",
66486852 "integrity": "sha512-GNAq/eg8Udq2x0eNiFkr9gRg5bA7PXEWagQdeRX4cPSGHehCEsotFqbPW9sJ8WVYB6UbmIMv7kUUORIF2Nncq4VQvBfNBLibW9YZR5dlYCSUhwcD628pRllm7n+X/8V38v637gim9bjFptMk1QWsCTr0ttrJEiXbNnRwE+YTzJw==",
66496853 "license": "MIT",
66506854 "dependencies": {
66516855 "agent-base": "^7.1.12",
66526856 "debug": "^4.3.4",
66536857 "socks": "^2.8.3"
66546858 },
@@ -6657,9 +6861,9 @@
66576861 }
66586862 },
66596863 "node_modules/socks-proxy-agent/node_modules/debug": {
66606864 "version": "4.34.70",
66616865 "resolved": "https://registry.npmjs.org/debug/-/debug-4.34.70.tgz",
66626866 "integrity": "sha512-Er2nc6WTZ/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yWIxCY/T6BALoZHaE4ctp9xm+GOJap1Krg4w0Hg80oCqgQZ5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==",
66636867 "license": "MIT",
66646868 "dependencies": {
66656869 "ms": "^2.1.3"
@@ -6857,9 +7061,9 @@
68577061 }
68587062 },
68597063 "node_modules/terser": {
68607064 "version": "5.3639.0",
68617065 "resolved": "https://registry.npmjs.org/terser/-/terser-5.3639.0.tgz",
68627066 "integrity": "sha512-IYV9eNMuFAV4THUspIRXkLakHnV6XO7FEdtKjf/mDyrnqUg9LnlOn6LBAhFyLho16harJoWMg/RwRvM9SZjR4GUq8Nk8zj67FzVARr74wnZsQYgTrg5jXOn2nCYjRUcZZEdE3qa2zb8QEDRUGVZBW4rlazf2fxkg8tztybTaqWw==",
68637067 "license": "BSD-2-Clause",
68647068 "dependencies": {
68657069 "@jridgewell/source-map": "^0.3.3",
@@ -6875,16 +7079,16 @@
68757079 }
68767080 },
68777081 "node_modules/terser-webpack-plugin": {
68787082 "version": "5.3.1012",
68797083 "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.1012.tgz",
68807084 "integrity": "sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgsjDLYqo7oF8tJIttjXO6jBY5Hk8p3A8W4ttih7cCEq64fQFWmgJ4VqAQjKr7WwIDlmXKEc6QeoRb5ecjZ+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w2afcg==",
68817085 "license": "MIT",
68827086 "dependencies": {
68837087 "@jridgewell/trace-mapping": "^0.3.2025",
68847088 "jest-worker": "^27.4.5",
68857089 "schema-utils": "^34.13.10",
68867090 "serialize-javascript": "^6.0.12",
68877091 "terser": "^5.2631.01"
68887092 },
68897093 "engines": {
68907094 "node": ">= 10.13.0"
@@ -6908,24 +7112,6 @@
69087112 }
69097113 }
69107114 },
6911- "node_modules/terser-webpack-plugin/node_modules/schema-utils": {
6912- "version": "3.3.0",
6913- "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz",
6914- "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==",
6915- "license": "MIT",
6916- "dependencies": {
6917- "@types/json-schema": "^7.0.8",
6918- "ajv": "^6.12.5",
6919- "ajv-keywords": "^3.5.2"
6920- },
6921- "engines": {
6922- "node": ">= 10.13.0"
6923- },
6924- "funding": {
6925- "type": "opencollective",
6926- "url": "https://opencollective.com/webpack"
6927- }
6928- },
69297115 "node_modules/text-table": {
69307116 "version": "0.2.0",
69317117 "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
@@ -6934,9 +7120,9 @@
69347120 "license": "MIT"
69357121 },
69367122 "node_modules/tiktoken": {
69377123 "version": "1.0.1620",
69387124 "resolved": "https://registry.npmjs.org/tiktoken/-/tiktoken-1.0.1620.tgz",
69397125 "integrity": "sha512-hRcORIGF2YlAgWx3nzrGJOrKSJwLoc81HpXmMQk89632XAgURc7IeV2FgQ2iXo9zzVIpXp84kth/J96fCvpsHg2kWoHcbj9fgNi2me1uYlJgl2RZ2EjxwDaWLeDY/s6fZiyO9n1QoTOM5P7ZSYfToPvAvwYNMbg5LETVYVKyzfQ==",
69407126 "license": "MIT"
69417127 },
69427128 "node_modules/timm": {
@@ -6999,9 +7185,9 @@
69997185 }
70007186 },
70017187 "node_modules/tslib": {
70027188 "version": "2.78.01",
70037189 "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.78.01.tgz",
70047190 "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55ooJFu94HQb+dW7IXv3RCXDzAKVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
70057191 "license": "0BSD"
70067192 },
70077193 "node_modules/tsscmp": {
@@ -7076,15 +7262,6 @@
70767262 "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==",
70777263 "license": "MIT"
70787264 },
7079- "node_modules/universalify": {
7080- "version": "2.0.1",
7081- "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz",
7082- "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==",
7083- "license": "MIT",
7084- "engines": {
7085- "node": ">= 10.0.0"
7086- }
7087- },
70887265 "node_modules/unpipe": {
70897266 "version": "1.0.0",
70907267 "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
@@ -7128,6 +7305,7 @@
71287305 "version": "4.4.1",
71297306 "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",
71307307 "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==",
7308+ "dev": true,
71317309 "license": "BSD-2-Clause",
71327310 "dependencies": {
71337311 "punycode": "^2.1.0"
@@ -7256,18 +7434,18 @@
72567434 }
72577435 },
72587436 "node_modules/webpack": {
72597437 "version": "5.9598.0",
72607438 "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.9598.0.tgz",
72617439 "integrity": "sha512-2t3XstrKULz41MNMBFUFynvx+cJ97TyHdyQ8HCt//pqErqDvNjU9YQBnZxIHa11VXsi7F3mb5gM44Gv9qFgj0acCQK2VE1CtdfwFdimkapco3hlPCJ/aO2tuDxdeTPdU7xu9Qzeq73n2yVKimVbtm+TnApIugGhLJnkU6gjYXA==",
72627440 "license": "MIT",
72637441 "dependencies": {
72647442 "@types/estreeeslint-scope": "^13.07.57",
72657443 "@webassemblyjstypes/astestree": "^1.120.16",
72667444 "@webassemblyjs/wasm-editast": "^1.1214.1",
72677445 "@webassemblyjs/wasm-parseredit": "^1.1214.1",
72687446 "acorn@webassemblyjs/wasm-parser": "^81.714.1",
72697447 "acorn-import-attributes": "^18.914.50",
72707448 "browserslist": "^4.2124.100",
72717449 "chrome-trace-event": "^1.0.2",
72727450 "enhanced-resolve": "^5.17.1",
72737451 "es-module-lexer": "^1.2.1",
@@ -7279,9 +7457,9 @@
72797457 "loader-runner": "^4.2.0",
72807458 "mime-types": "^2.1.27",
72817459 "neo-async": "^2.6.2",
72827460 "schema-utils": "^34.23.0",
72837461 "tapable": "^2.1.1",
72847462 "terser-webpack-plugin": "^5.3.1011",
72857463 "watchpack": "^2.4.1",
72867464 "webpack-sources": "^3.2.3"
72877465 },
@@ -7332,24 +7510,6 @@
73327510 "node": ">=4.0"
73337511 }
73347512 },
7335- "node_modules/webpack/node_modules/schema-utils": {
7336- "version": "3.3.0",
7337- "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz",
7338- "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==",
7339- "license": "MIT",
7340- "dependencies": {
7341- "@types/json-schema": "^7.0.8",
7342- "ajv": "^6.12.5",
7343- "ajv-keywords": "^3.5.2"
7344- },
7345- "engines": {
7346- "node": ">= 10.13.0"
7347- },
7348- "funding": {
7349- "type": "opencollective",
7350- "url": "https://opencollective.com/webpack"
7351- }
7352- },
73537513 "node_modules/whatwg-fetch": {
73547514 "version": "3.6.20",
73557515 "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.6.20.tgz",
@@ -7444,9 +7604,10 @@
74447604 }
74457605 },
74467606 "node_modules/ws": {
74477607 "version": "8.1718.1",
74487608 "resolved": "https://registry.npmjs.org/ws/-/ws-8.1718.1.tgz",
74497609 "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZRKW2aJZMXeMxVpnZ6bck+h4gZekJyRqFU8pvnbAbbs/3TgRPyRswznaxmzdULiBr6KY7XkTnW8uvt0iT9H5DkHUChXrc+GQuurzwa0rVI16n/Xzjdz1w==",
7610+ "license": "MIT",
74507611 "engines": {
74517612 "node": ">=10.0.0"
74527613 },
@@ -7522,10 +7683,13 @@
75227683 }
75237684 },
75247685 "node_modules/yaml": {
75257686 "version": "2.37.40",
75267687 "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.37.40.tgz",
75277688 "integrity": "sha512-8aAvwVUSHpfEqTQ4w+hSoy/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocAQHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA==",
75287689 "license": "ISC",
7690+ "bin": {
7691+ "yaml": "bin.mjs"
7692+ },
75297693 "engines": {
75307694 "node": ">= 14"
75317695 }
@@ -7571,7 +7735,6 @@
75717735 "version": "0.1.0",
75727736 "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz",
75737737 "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==",
7574- "dev": true,
75757738 "license": "MIT",
75767739 "engines": {
75777740 "node": ">=10"
package.json+31 -27
@@ -1,18 +1,20 @@
11{
22 "dependencies": {
33 "@adobe/css-tools": "^4.4.02",
44 "@agnai/sentencepiece-js": "^1.1.1",
55 "@agnai/web-tokenizers": "^0.1.3",
66 "@iconfu/svg-inject": "^1.2.3",
77 "@mozilla/readability": "^0.5.0",
88 "@popperjs/core": "^2.11.8",
99 "@zeldafan0225/ai_horde": "^5.12.0",
1010 "archiver": "^7.0.1",
1111 "bing-translate-api": "^4.0.2",
1212 "body-parser": "^1.20.2",
1313 "bowser": "^2.11.0",
14+ "bytes": "^3.1.2",
15+ "chalk": "^5.4.1",
1416 "command-exists": "^1.2.9",
1517 "compression": "^1.8.0",
1618 "cookie-parser": "^1.4.6",
1719 "cookie-session": "^2.1.0",
1820 "cors": "^2.8.5",
@@ -21,18 +23,19 @@
2123 "dompurify": "^3.2.4",
2224 "droll": "^0.2.1",
2325 "express": "^4.21.0",
2426 "form-data": "^4.0.02",
2527 "fuse.js": "^7.01.0",
2628 "google-translate-api-browser": "^3.0.1",
2729 "google-translate-api-x": "^10.7.12",
2830 "handlebars": "^4.7.8",
2931 "helmet": "^7.12.0",
3032 "highlight.js": "^11.1011.01",
3133 "html-entities": "^2.5.2",
3234 "iconv-lite": "^0.6.3",
3335 "ip-matching": "^2.1.2",
3436 "ip-regex": "^5.0.0",
3537 "ipaddr.js": "^2.02.10",
38+ "is-docker": "^3.0.0",
3639 "jimp": "^0.22.10",
3740 "localforage": "^1.10.0",
3841 "lodash": "^4.17.21",
@@ -41,28 +44,28 @@
4144 "morphdom": "^2.7.4",
4245 "multer": "^1.4.5-lts.1",
4346 "node-fetch": "^3.3.2",
4447 "node-persist": "^4.0.14",
4548 "open": "^8.4.2",
4649 "png-chunk-text": "^1.0.0",
4750 "png-chunks-encode": "^1.0.0",
4851 "png-chunks-extract": "^1.0.0",
4952 "proxy-agent": "^6.45.0",
5053 "rate-limiter-flexible": "^5.0.05",
5154 "response-time": "^2.3.23",
5255 "sanitize-filename": "^1.6.3",
5356 "seedrandom": "^3.0.5",
5457 "showdown": "^2.1.0",
5558 "sillytavern-transformers": "2.14.6",
5659 "simple-git": "^3.1927.10",
5760 "slidetoggle": "^4.0.0",
5861 "tiktoken": "^1.0.1620",
5962 "url-join": "^5.0.0",
6063 "vectra": "^0.2.2",
6164 "wavefile": "^11.0.0",
6265 "webpack": "^5.9598.0",
6366 "write-file-atomic": "^5.0.1",
6467 "ws": "^8.1718.1",
6568 "yaml": "^2.37.40",
6669 "yargs": "^17.7.1",
6770 "yauzl": "^2.10.0"
6871 },
@@ -90,7 +93,8 @@
9093 "version": "1.12.12",
9194 "scripts": {
9295 "start": "node server.js",
9396 "debug": "node server.js --inspect server.js",
97+ "electron": "electron ./src/electron",
9498 "start:deno": "deno run --allow-run --allow-net --allow-read --allow-write --allow-sys --allow-env server.js",
9599 "start:bun": "bun server.js",
96100 "start:no-csrf": "node server.js --disableCsrf",
@@ -109,23 +113,23 @@
109113 },
110114 "main": "server.js",
111115 "devDependencies": {
112116 "@types/archiver": "^6.0.23",
117+ "@types/bytes": "^3.1.5",
113118 "@types/command-exists": "^1.2.3",
114119 "@types/compression": "^1.7.5",
115120 "@types/cookie-parser": "^1.4.78",
116121 "@types/cookie-session": "^2.0.49",
117122 "@types/cors": "^2.8.17",
118123 "@types/deno": "^2.02.0",
119- "@types/dompurify": "^3.2.0",
120124 "@types/express": "^4.17.21",
121125 "@types/jquery": "^3.5.2932",
122126 "@types/jquery-cropper": "^1.0.4",
123127 "@types/jquery.transit": "^0.9.33",
124128 "@types/jqueryui": "^1.12.23",
125129 "@types/lodash": "^4.17.1016",
126130 "@types/mime-types": "^2.1.4",
127131 "@types/multer": "^1.4.12",
128132 "@types/node": "^18.19.5578",
129133 "@types/node-persist": "^3.1.8",
130134 "@types/png-chunk-text": "^1.0.3",
131135 "@types/png-chunks-encode": "^1.0.2",
@@ -136,6 +140,6 @@
136140 "@types/write-file-atomic": "^4.0.3",
137141 "@types/yargs": "^17.0.33",
138142 "@types/yauzl": "^2.10.3",
139143 "eslint": "^8.57.01"
140144 }
141145}
plugins.js+2 -2
@@ -8,7 +8,7 @@ import path from 'node:path';
88import process from 'node:process';
99import { fileURLToPath } from 'node:url';
1010
1111import { default as git, CheckRepoActions } from 'simple-git';
1212import { color } from './src/util.js';
1313
1414const __dirname = import.meta.dirname ?? path.dirname(fileURLToPath(import.meta.url));
@@ -49,7 +49,7 @@ async function updatePlugins() {
4949 const pluginPath = path.join(pluginsPath, directory);
5050 const pluginRepo = git(pluginPath);
5151
5252 const isRepo = await pluginRepo.checkIsRepo(CheckRepoActions.IS_REPO_ROOT);
5353 if (!isRepo) {
5454 console.log(`Directory ${color.yellow(directory)} is not a Git repository`);
5555 continue;
post-install.js+31 -16
@@ -7,26 +7,13 @@ import crypto from 'node:crypto';
77import process from 'node:process';
88import yaml from 'yaml';
99import _ from 'lodash';
10+import chalk from 'chalk';
1011import { createRequire } from 'node:module';
1112
1213/**
1314 * Colorizes console output.
1415 */
1516const color = {chalk;
16- byNum: (mess, fgNum) => {
17- mess = mess || '';
18- fgNum = fgNum === undefined ? 31 : fgNum;
19- return '\u001b[' + fgNum + 'm' + mess + '\u001b[39m';
20- },
21- black: (mess) => color.byNum(mess, 30),
22- red: (mess) => color.byNum(mess, 31),
23- green: (mess) => color.byNum(mess, 32),
24- yellow: (mess) => color.byNum(mess, 33),
25- blue: (mess) => color.byNum(mess, 34),
26- magenta: (mess) => color.byNum(mess, 35),
27- cyan: (mess) => color.byNum(mess, 36),
28- white: (mess) => color.byNum(mess, 37),
29-};
3017
3118const keyMigrationMap = [
3219 {
@@ -104,6 +91,25 @@ const keyMigrationMap = [
10491 newKey: 'extensions.models.textToSpeech',
10592 migrate: (value) => value,
10693 },
94+ {
95+ oldKey: 'minLogLevel',
96+ newKey: 'logging.minLogLevel',
97+ migrate: (value) => value,
98+ },
99+ {
100+ oldKey: 'cardsCacheCapacity',
101+ newKey: 'performance.memoryCacheCapacity',
102+ migrate: (value) => `${value}mb`,
103+ },
104+ // uncomment one release after 1.12.13
105+ /*
106+ {
107+ oldKey: 'cookieSecret',
108+ newKey: 'cookieSecret',
109+ migrate: () => void 0,
110+ remove: true,
111+ },
112+ */
107113];
108114
109115/**
@@ -163,8 +169,17 @@ function addMissingConfigValues() {
163169
164170 // Migrate old keys to new keys
165171 const migratedKeys = [];
166172 for (const { oldKey, newKey, migrate, remove } of keyMigrationMap) {
167173 if (_.has(config, oldKey)) {
174+ if (remove) {
175+ _.unset(config, oldKey);
176+ migratedKeys.push({
177+ oldKey,
178+ newValue: void 0,
179+ });
180+ continue;
181+ }
182+
168183 const oldValue = _.get(config, oldKey);
169184 const newValue = migrate(oldValue);
170185 _.set(config, newKey, newValue);
public/css/toggle-dependent.css+6 -5
@@ -96,11 +96,6 @@ body.charListGrid #rm_print_characters_block .group_select .group_name_block,
9696 flex-direction: column;
9797}
9898
99-#user_avatar_block.gridView .avatar-container .avatar-buttons {
100- flex-wrap: wrap;
101- justify-content: space-evenly;
102-}
103-
10499body.charListGrid #rm_print_characters_block .bogus_folder_select .character_select_container,
105100body.charListGrid #rm_print_characters_block .character_select .character_select_container,
106101body.charListGrid #rm_print_characters_block .group_select .group_select_container,
@@ -231,10 +226,16 @@ body.big-avatars .avatars_inline_small .avatar img {
231226body.big-avatars .avatars_inline {
232227 max-height: calc(var(--avatar-base-height) * var(--big-avatar-height-factor) + 2 * var(--avatar-base-border-radius));
233228}
229+body.big-avatars .avatars_inline.avatars_multiline {
230+ max-height: fit-content;
231+}
234232
235233body.big-avatars .avatars_inline.avatars_inline_small {
236234 height: calc(var(--avatar-base-height) * var(--big-avatar-height-factor) * var(--inline-avatar-small-factor) + 2 * var(--avatar-base-border-radius));
237235}
236+body.big-avatars .avatars_inline.avatars_inline_small.avatars_multiline {
237+ height: inherit;
238+}
238239
239240body:not(.big-avatars) .avatars_inline_small .avatar_collage {
240241 min-width: calc(var(--avatar-base-width) * var(--inline-avatar-small-factor));
public/global.d.ts+8 -0
@@ -40,4 +40,12 @@ declare global {
4040 searchInputCssClass?: string;
4141 }
4242 }
43+
44+ /**
45+ * Translates a text to a target language using a translation provider.
46+ * @param text Text to translate
47+ * @param lang Target language
48+ * @param provider Translation provider
49+ */
50+ async function translate(text: string, lang: string, provider: string = null): Promise<string>;
4351}
public/index.html+166 -76
@@ -1294,8 +1294,8 @@
12941294 <span data-i18n="TFS">TFS</span>
12951295 <div class="fa-solid fa-circle-info opacity50p" data-i18n="[title]Tail_Free_Sampling_desc" title="Tail-Free Sampling (TFS) searches for a tail of low-probability tokens in the distribution,&#13;by analyzing the rate of change in token probabilities using derivatives. It retains tokens up to a threshold (e.g., 0.3) based on the normalized second derivative.&#13;The closer to 0, the more discarded tokens. Set to 1.0 to disable."></div>
12961296 </small>
12971297 <input class="neo-range-slider" type="range" id="tfs_textgenerationwebui" name="volume" min="0" max="1" step="0.01001">
12981298 <input class="neo-range-input" type="number" min="0" max="1" step="0.01001" data-for="tfs_textgenerationwebui" id="tfs_counter_textgenerationwebui">
12991299 </div>
13001300 <div data-tg-type="ooba,mancer,aphrodite" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0">
13011301 <small>
@@ -1305,7 +1305,7 @@
13051305 <input class="neo-range-slider" type="range" id="epsilon_cutoff_textgenerationwebui" name="volume" min="0" max="9" step="0.01">
13061306 <input class="neo-range-input" type="number" min="0" max="9" step="0.01" data-for="epsilon_cutoff_textgenerationwebui" id="epsilon_cutoff_counter_textgenerationwebui">
13071307 </div>
13081308 <div data-tg-type="aphrodite,koboldcpp" class="alignitemscenter flex-container flexFlowColumn flexBasis30p flexGrow flexShrink gap0">
13091309 <small>
13101310 <span data-i18n="Top nsigma">Top nsigma</span>
13111311 <div class="fa-solid fa-circle-info opacity50p" title="A sampling method that filters logits based on their statistical properties. It keeps tokens within n standard deviations of the maximum logit value, providing a simpler alternative to top-p/top-k sampling while maintaining sampling stability across different temperatures."></div>
@@ -1477,8 +1477,8 @@
14771477 </div>
14781478 <div class="alignitemscenter flex-container marginBot5 flexFlowColumn flexGrow flexShrink gap0">
14791479 <small data-i18n="Exponent">Exponent</small>
14801480 <input class="neo-range-slider" type="range" id="dynatemp_exponent_textgenerationwebui" name="volume" min="0.01001" max="10" step="0.01001" />
14811481 <input class="neo-range-input" type="number" min="0.01001" max="10" step="0.01001" data-for="dynatemp_exponent_textgenerationwebui" id="dynatemp_exponent_counter_textgenerationwebui">
14821482 </div>
14831483 </div>
14841484 </div>
@@ -1951,7 +1951,18 @@
19511951 </span>
19521952 </div>
19531953 </div>
19541954 <div class="range-block" data-source="openai,cohere,mistralai,custom,claudemakersuite,openrouter,groq,deepseek">
1955+ <label for="openai_enable_web_search" class="checkbox_label flexWrap widthFreeExpand">
1956+ <input id="openai_enable_web_search" type="checkbox" />
1957+ <span data-i18n="Enable web search">Enable web search</span>
1958+ </label>
1959+ <div class="flexBasis100p toggle-description justifyLeft">
1960+ <span>
1961+ Use search capabilities provided by the backend.
1962+ </span>
1963+ </div>
1964+ </div>
1965+ <div class="range-block" data-source="openai,cohere,mistralai,custom,claude,openrouter,groq,deepseek,makersuite,ai21">
19551966 <label for="openai_function_calling" class="checkbox_label flexWrap widthFreeExpand">
19561967 <input id="openai_function_calling" type="checkbox" />
19571968 <span data-i18n="Enable function calling">Enable function calling</span>
@@ -2000,7 +2011,7 @@
20002011 </span>
20012012 </div>
20022013 </div>
20032014 <div class="range-block" data-source="deepseek,openrouter,custom,claude">
20042015 <label for="openai_show_thoughts" class="checkbox_label widthFreeExpand">
20052016 <input id="openai_show_thoughts" type="checkbox" />
20062017 <span>
@@ -2014,10 +2025,11 @@
20142025 </span>
20152026 </div>
20162027 </div>
20172028 <div class="flex-container flexFlowColumn wide100p textAlignCenter marginTop10" data-source="openai,custom,claude">
20182029 <div class="flex-container oneline-dropdown" title="Constrains effort on reasoning for reasoning models.&#10;Currently supported values are low, medium, and high.&#10;Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response." data-i18n="[title]Constrains effort on reasoning for reasoning models.">
20192030 <label for="openai_reasoning_effort" data-i18n="Reasoning Effort">
2020- Reasoning Effort
2031+ <span data-i18n="Reasoning Effort">Reasoning Effort</span>
2032+ <i data-source="claude" class="opacity50p fa-solid fa-circle-info" title="Allocates a portion of the response length for thinking (low: 10%, medium: 25%, high: 50%), but minimum 1024 tokens."></i>
20212033 </label>
20222034 <select id="openai_reasoning_effort">
20232035 <option data-i18n="openai_reasoning_effort_low" value="low">Low</option>
@@ -2866,6 +2878,10 @@
28662878 <option value="o3-mini">o3-mini</option>
28672879 <option value="o3-mini-2025-01-31">o3-mini-2025-01-31</option>
28682880 </optgroup>
2881+ <optgroup label="GPT-4.5">
2882+ <option value="gpt-4.5-preview">gpt-4.5-preview</option>
2883+ <option value="gpt-4.5-preview-2025-02-27">gpt-4.5-preview-2025-02-27</option>
2884+ </optgroup>
28692885 <optgroup label="GPT-4 Turbo and GPT-4">
28702886 <option value="gpt-4-turbo">gpt-4-turbo</option>
28712887 <option value="gpt-4-turbo-2024-04-09">gpt-4-turbo-2024-04-09</option>
@@ -2915,6 +2931,8 @@
29152931 <h4 data-i18n="Claude Model">Claude Model</h4>
29162932 <select id="model_claude_select">
29172933 <optgroup label="Versions">
2934+ <option value="claude-3-7-sonnet-latest">claude-3-7-sonnet-latest</option>
2935+ <option value="claude-3-7-sonnet-20250219">claude-3-7-sonnet-20250219</option>
29182936 <option value="claude-3-5-sonnet-latest">claude-3-5-sonnet-latest</option>
29192937 <option value="claude-3-5-sonnet-20241022">claude-3-5-sonnet-20241022</option>
29202938 <option value="claude-3-5-sonnet-20240620">claude-3-5-sonnet-20240620</option>
@@ -3060,7 +3078,15 @@
30603078 <div>
30613079 <h4 data-i18n="AI21 Model">AI21 Model</h4>
30623080 <select id="model_ai21_select">
30633081 <optgroup label="Jamba 1.5(Latest)">
3082+ <option value="jamba-mini">jamba-mini</option>
3083+ <option value="jamba-large">jamba-large</option>
3084+ </optgroup>
3085+ <optgroup label="Jamba 1.6">
3086+ <option value="jamba-1.6-mini">jamba-1.6-mini</option>
3087+ <option value="jamba-1.6-large">jamba-1.6-large</option>
3088+ </optgroup>
3089+ <optgroup label="Jamba 1.5 (Deprecated)">
30643090 <option value="jamba-1.5-mini">jamba-1.5-mini</option>
30653091 <option value="jamba-1.5-large">jamba-1.5-large</option>
30663092 </optgroup>
@@ -3186,21 +3212,33 @@
31863212 </div>
31873213 <h4 data-i18n="Groq Model">Groq Model</h4>
31883214 <select id="model_groq_select">
31893215 <optgroup label="ProductionAlibaba ModelsCloud">
31903216 <option value="gemma2qwen-9b2.5-it32b">gemma2qwen-9b2.5-it32b</option>
31913217 <option value="llamaqwen-32.35-70bcoder-versatile32b">llamaqwen-32.35-70bcoder-versatile32b</option>
3192- <option value="llama-3.1-8b-instant">llama-3.1-8b-instant</option>
3218+ </optgroup>
3193- <option value="llama3-70b-8192">llama3-70b-8192</option>
3219+ <optgroup label="DeepSeek / Alibaba Cloud">
31943220 <option value="llama3deepseek-8br1-8192distill-qwen-32b">llama3deepseek-8br1-8192distill-qwen-32b</option>
3195- <option value="mixtral-8x7b-32768">mixtral-8x7b-32768</option>
31963221 </optgroup>
31973222 <optgroup label="PreviewDeepSeek Models/ Meta">
31983223 <option value="deepseek-r1-distill-llama-70b">deepseek-r1-distill-llama-70b</option>
3199- <option value="llama-3.3-70b-specdec">llama-3.3-70b-specdec</option>
3224+ </optgroup>
3225+ <optgroup label="Google">
3226+ <option value="gemma2-9b-it">gemma2-9b-it</option>
3227+ </optgroup>
3228+ <optgroup label="Meta">
3229+ <option value="llama-3.1-8b-instant">llama-3.1-8b-instant </option>
3230+ <option value="llama-3.2-11b-vision-preview">llama-3.2-11b-vision-preview </option>
32003231 <option value="llama-3.2-1b-preview">llama-3.2-1b-preview </option>
32013232 <option value="llama-3.2-3b-preview">llama-3.2-3b-preview </option>
3202- <option value="llama-3.2-11b-vision-preview">llama-3.2-11b-vision-preview</option>
32033233 <option value="llama-3.2-90b-vision-preview">llama-3.2-90b-vision-preview </option>
3234+ <option value="llama-3.3-70b-specdec">llama-3.3-70b-specdec </option>
3235+ <option value="llama-3.3-70b-versatile">llama-3.3-70b-versatile </option>
3236+ <option value="llama-guard-3-8b">llama-guard-3-8b </option>
3237+ <option value="llama3-70b-8192">llama3-70b-8192 </option>
3238+ <option value="llama3-8b-8192">llama3-8b-8192 </option>
3239+ </optgroup>
3240+ <optgroup label="Mistral AI">
3241+ <option value="mixtral-8x7b-32768">mixtral-8x7b-32768</option>
32043242 </optgroup>
32053243 </select>
32063244 </div>
@@ -3253,6 +3291,10 @@
32533291 <option value="sonar">sonar</option>
32543292 <option value="sonar-pro">sonar-pro</option>
32553293 <option value="sonar-reasoning">sonar-reasoning</option>
3294+ <option value="sonar-reasoning-pro">sonar-reasoning-pro</option>
3295+ </optgroup>
3296+ <optgroup label="Offline Models">
3297+ <option value="r1-1776">r1-1776</option>
32563298 </optgroup>
32573299 <optgroup label="Deprecated Models">
32583300 <!-- These are scheduled for deprecation after 2/22/2025 -->
@@ -3282,6 +3324,8 @@
32823324 <option value="c4ai-aya-23">c4ai-aya-23</option>
32833325 <option value="c4ai-aya-expanse-8b">c4ai-aya-expanse-8b</option>
32843326 <option value="c4ai-aya-expanse-32b">c4ai-aya-expanse-32b</option>
3327+ <option value="c4ai-aya-vision-8b">c4ai-aya-vision-8b</option>
3328+ <option value="c4ai-aya-vision-32b">c4ai-aya-vision-32b</option>
32853329 <option value="command-light">command-light</option>
32863330 <option value="command">command</option>
32873331 <option value="command-r">command-r</option>
@@ -3318,7 +3362,7 @@
33183362 </div>
33193363 <div>
33203364 <small>
33213365 <span data-i18n="Doesn't work? Try adding">Doesn't work? Try adding</span> <code>/v1</code> <span data-i18n="at the end of the URL!">at the end of the URL!</span>
33223366 </small>
33233367 </div>
33243368 <h4>
@@ -4001,7 +4045,7 @@
40014045 <div class="alignitemscenter flex-container flexFlowColumn flexGrow flexShrink gap0 flexBasis48p" title="Cap the number of entry activation recursions" data-i18n="[title]Cap the number of entry activation recursions">
40024046 <small>
40034047 <span data-i18n="Max Recursion Steps">Max Recursion Steps</span>
40044048 <div class="fa-solid fa-triangle-exclamation opacity50p" data-i18n="[title]0 = unlimited, 1 = scans once and doesn't recurse, 2 = scans once and recurses once, etc\n(disabled when min activations are used)" title="0 = unlimited, 1 = scans once and doesn't recurse, 2 = scans once and recurses once, etc&#10;(disabled when min activations are used)"></div>
40054049 </small>
40064050 <input class="neo-range-slider" type="range" id="world_info_max_recursion_steps" name="world_info_max_recursion_steps" min="0" max="10" step="1">
40074051 <input class="neo-range-input" type="number" min="0" max="10" step="1" data-for="world_info_max_recursion_steps" id="world_info_max_recursion_steps_counter">
@@ -4130,7 +4174,7 @@
41304174 </div>
41314175 <div id="UI-language-block" class="flex-container alignItemsBaseline">
41324176 <span data-i18n="UI Language">Language:</span>
41334177 <select id="ui_language_select" class="flex1 margin0 text_pole">
41344178 <option value="" data-i18n="Default">Default</option>
41354179 <option value="en">English</option>
41364180 </select>
@@ -4188,7 +4232,7 @@
41884232 <!-- <h4><span data-i18n="UI Colors">Theme Settings</span></h4> -->
41894233 <div name="AvatarAndChatDisplay" class="flex-container flexFlowColumn">
41904234 <div class="flex-container alignItemsBaseline">
41914235 <span data-i18n="Avatar Style:">Avatars:</span>
41924236 <select id="avatar_style" class="widthNatural flex1 margin0">
41934237 <option value="0" data-i18n="Circle">Circle</option>
41944238 <option value="2" data-i18n="Square">Square</option>
@@ -4398,7 +4442,7 @@
43984442 <option data-i18n="Ask" value="1">Ask</option>
43994443 <option data-i18n="tag_import_none" value="2">None</option>
44004444 <option data-i18n="tag_import_all" value="3">All</option>
44014445 <option data-i18n="Existingtag_import_existing" value="4">Existing</option>
44024446 </select>
44034447 </div>
44044448 <label class="checkbox_label" for="fuzzy_search_checkbox" title="Use fuzzy matching, and search characters in the list by all data fields, not just by a name substring." data-i18n="[title]Use fuzzy matching, and search characters in the list by all data fields, not just by a name substring">
@@ -4413,7 +4457,7 @@
44134457 <input id="prefer_character_jailbreak" type="checkbox" />
44144458 <small data-i18n="Prefer Character Card Instructions">Prefer Char. Instructions</small>
44154459 </label>
44164460 <label class="checkbox_label" for="never_resize_avatars" title="Avoid cropping and resizing imported character images. When off, crop/resize to 512x768.&#10;This will disable the upload cropping popup for avatars." data-i18n="[title]Avoid cropping and resizing imported character images. When off, crop/resize to 512x768never_resize_avatars_tooltip">
44174461 <input id="never_resize_avatars" type="checkbox" />
44184462 <small data-i18n="Never resize avatars">Never resize avatars</small>
44194463 </label>
@@ -4666,7 +4710,7 @@
46664710 <small data-i18n="Enabled">Enabled</small>
46674711 </label>
46684712 <small data-i18n="Minimum generated message length">Minimum generated message length</small>
46694713 <input id="auto_swipe_minimum_length" name="auto_swipe_minimum_length" type="number" min="0" step="1" value="0" class="text_pole" title="If the generated message is shorter than thisthese many characters, trigger an auto-swipe." data-i18n="[title]If the generated message is shorter than thisthese many characters, trigger an auto-swipe">
46704714 <small data-i18n="Blacklisted words">Blacklisted words</small>
46714715 <div class="auto_swipe">
46724716 <textarea id="auto_swipe_blacklist" name="auto_swipe_blacklist" data-i18n="[placeholder]words you dont want generated separated by comma ','" placeholder="words you don't want generated separated by comma ','" class="text_pole textarea_compact" value="" autocomplete="off" rows="3"></textarea>
@@ -4917,7 +4961,10 @@
49174961 </div>
49184962 <hr class="wide100p margin0">
49194963 <div class="alignitemscenter flex-container justifyCenter wide100p" style="justify-content: space-between;">
4920- <h4 class="margin0"><span data-i18n="Extras API:">Extras API:</span></h4>
4964+ <h4 class="margin0">
4965+ <span data-i18n="(DEPRECATED)">(DEPRECATED)</span>
4966+ <span data-i18n="Extras API:">Extras API:</span>
4967+ </h4>
49214968 <div class="flex-container">
49224969 <div id="extensions_status" data-i18n="Not connected...">Not connected...</div>
49234970 <label for="extensions_autoconnect" class="checkbox_label flexNoGap">
@@ -4968,7 +5015,7 @@
49685015 </div>
49695016 </div>
49705017 <div id="persona-management-block" class="flex-container wide100p flexGap10">
49715018 <div class="persona_management_left_column flex1 overflowHidden wide100p">
49725019 <div class="flex-container marginBot10 alignitemscenter">
49735020 <div id="create_dummy_persona" class="menu_button menu_button_icon" title="Create a dummy persona" data-i18n="[title]Create a dummy persona">
49745021 <i class="fa-solid fa-person-circle-question fa-fw"></i>
@@ -4991,27 +5038,34 @@
49915038 <input type="hidden" id="avatar_upload_overwrite" name="overwrite_name" value="">
49925039 </form>
49935040 </div>
49945041 <div class="persona_management_right_column flex1">
49955042 <h4div data-i18nclass="Namepersona_management_current_persona">Name</h4>
4996- <div class="change_name">
5043+ <h4 class="standoutHeader" data-i18n="Current Persona">Current Persona</h4>
4997- <input id="your_name" name="your_name" data-i18n="[placeholder]Enter your name" placeholder="Enter your name" class="text_pole wide100p" value="" autocomplete="off">
5044+
4998- <div id="your_name_button" class="menu_button fa-solid fa-check" title="Click to set a new User Name" data-i18n="[title]Click to set a new User Name">
5045+ <div id="persona_controls" class="flex-container">
4999- </div>
5046+ <h5 id="your_name" class="persona_name">[Persona Name]</h5>
5000- <div id="lock_user_name" class="menu_button fa-solid fa-unlock" title="Click to lock your selected persona to the current chat. Click again to remove the lock." data-i18n="[title]Click to lock your selected persona to the current chat. Click again to remove the lock.">
5047+ <div class="persona_controls_buttons_block buttons_block">
5001- </div>
5048+ <div id="persona_rename_button" class="menu_button fa-solid fa-pencil" title="Rename Persona" data-i18n="[title]Rename Persona"></div>
50025049 <div id="sync_name_button" class="menu_button fa-solid fa-sync" title="Click to set user name for all messages" data-i18n="[title]Click to set user name for all messages"></div>
5003- </div>
5050+ <div id="persona_lore_button" class="menu_button fa-solid fa-globe" title="Persona Lore&#10;Alt+Click to open the lorebook" data-i18n="[title]Persona Lore Alt+Click to open the lorebook"></div>
5004- <div id="persona_lore_button" class="menu_button fa-solid fa-globe" title="Persona Lore&#10;Alt+Click to open the lorebook" data-i18n="[title]Persona Lore Alt+Click to open the lorebook">
5051+
5052+ <div id="persona_set_image_button" class="menu_button fa-solid fa-image" title="Change Persona Image" data-i18n="[title]Change Persona Image"></div>
5053+ <div id="persona_duplicate_button" class="menu_button fa-solid fa-clone" title="Duplicate Persona" data-i18n="[title]Duplicate Persona"></div>
5054+ <div id="persona_delete_button" class="menu_button fa-solid fa-skull red_button" title="Delete Persona" data-i18n="[title]Delete Persona"></div>
50055055 </div>
50065056 </div>
5007- <div>
5057+
50085058 <h4 data-i18n="Persona Description">Persona Description</h4>
50095059 <textarea id="persona_description" name="persona_description" data-i18n="[placeholder]Example: [{{user}} is a 28-year-old Romanian cat girl.]" placeholder="Example:&#10;[{{user}} is a 28-year-old Romanian cat girl.]" class="text_pole textarea_compact" value="" autocomplete="off" rows="8"></textarea>
5010- <div class="extension_token_counter">
5060+
5061+ <div class="flex-container justifySpaceBetween">
5062+ <h4 data-i18n="Position">Position</h4>
5063+ <div class="extension_token_counter widthFitContent">
50115064 <span data-i18n="Tokens persona description">Tokens</span>: <span id="persona_description_token_count">0</span>
50125065 </div>
50135066 </div>
5014- <label for="persona_description_position" data-i18n="Position:">Position:</label>
5067+
5068+ <div class="persona_management_description_position_container">
50155069 <select id="persona_description_position">
50165070 <option value="9" data-i18n="None (disabled)">None (disabled)</option>
50175071 <option value="0" data-i18n="In Story String / Prompt Manager">In Story String / Prompt Manager</option>
@@ -5034,7 +5088,30 @@
50345088 </div>
50355089 </div>
50365090 </div>
5091+
5092+ <h4 data-i18n="Connections">Connections</h4>
5093+ <div id="persona_connections_buttons" class="flex-container">
5094+ <div id="lock_persona_default" class="menu_button menu_button_icon" title="Click to select this as default persona for the new chats. Click again to remove it." data-i18n="[title]Click to select this as default persona for the new chats. Click again to remove it.">
5095+ <i class="icon fa-solid fa-crown fa-fw"></i>
5096+ <div data-i18n="Default">Default</div>
5097+ </div>
5098+ <div id="lock_persona_to_char" class="menu_button menu_button_icon" title="Click to lock your selected persona to the current character. Click again to remove the lock." data-i18n="[title]Click to lock your selected persona to the current character. Click again to remove the lock.">
5099+ <i class="icon fa-solid fa-unlock fa-fw"></i>
5100+ <div data-i18n="Character">Character</div>
5101+ </div>
5102+ <div id="lock_user_name" class="menu_button menu_button_icon" title="Click to lock your selected persona to the current chat. Click again to remove the lock." data-i18n="[title]Click to lock your selected persona to the current chat. Click again to remove the lock.">
5103+ <i class="icon fa-solid fa-unlock fa-fw"></i>
5104+ <div data-i18n="Chat">Chat</div>
5105+ </div>
50375106 </div>
5107+ <div id="persona_connections_info_block"></div>
5108+ <div id="persona_connections_list" class="text_muted m-b-1 avatars_inline avatars_multiline scroll-reset-container expander">
5109+ </div>
5110+ </div>
5111+
5112+ <div class="persona_management_global_settings">
5113+ <h4 class="standoutHeader" data-i18n="Global Settings">Global Settings</h4>
5114+
50385115 <div class="range-block">
50395116 <label for="persona_show_notifications" class="checkbox_label">
50405117 <input id="persona_show_notifications" type="checkbox" />
@@ -5043,6 +5120,23 @@
50435120 </span>
50445121 </label>
50455122 </div>
5123+ <div class="range-block">
5124+ <label for="persona_allow_multi_connections" class="checkbox_label" title="When multiple personas are connected to a character, a popup will appear to select which one to use." data-i18n="[title]When multiple personas are connected to a character, a popup will appear to select which one to use">
5125+ <input id="persona_allow_multi_connections" type="checkbox" />
5126+ <span data-i18n="Allow multiple persona connections per character">
5127+ Allow multiple persona connections per character
5128+ </span>
5129+ </label>
5130+ </div>
5131+ <div class="range-block">
5132+ <label for="persona_auto_lock" class="checkbox_label" title="Whenever a persona is selected, it will be locked to the current chat and automatically selected when the chat is opened." data-i18n="[title]Whenever a persona is selected, it will be locked to the current chat and automatically selected when the chat is opened.">
5133+ <input id="persona_auto_lock" type="checkbox" />
5134+ <span data-i18n="Auto-lock a chosen persona to the chat">
5135+ Auto-lock a chosen persona to the chat
5136+ </span>
5137+ </label>
5138+ </div>
5139+ </div>
50465140 </div>
50475141 </div>
50485142 </div>
@@ -5068,7 +5162,7 @@
50685162 <div class="right_menu_button fa-solid fa-list-ul" id="rm_button_characters" title="Select/Create Characters" data-i18n="[title]Select/Create Characters"></div>
50695163 </div>
50705164 <div id="HotSwapWrapper" class="alignitemscenter flex-container margin0auto wide100p">
50715165 <div class="hotswap avatars_inline flex-container scroll-reset-container expander" data-i18n="[no_favs]Favorite characters to add them to HotSwaps" no_favs="Favorite characters to add them to HotSwaps"></div>
50725166 </div>
50735167 </div>
50745168 <hr>
@@ -5106,13 +5200,13 @@
51065200 </div>
51075201 </div>
51085202 <div class="flex-container flexFlowColumn expander flexNoGap">
51095203 <div id="avatar_div" class="avatar_div buttons_block alignitemsflexstart justifySpaceBetween flexnowrap">
51105204 <label id="avatar_div_div" class="add_avatar avatar" for="add_avatar_button" title="Click to select a new avatar for this character" data-i18n="[title]Click to select a new avatar for this character">
51115205 <img id="avatar_load_preview" src="img/ai4.png" alt="avatar">
51125206 <input hidden type="file" id="add_avatar_button" name="avatar" accept="image/*">
51135207 </label>
51145208 <div class="flex-container" id="avatar_controls">
51155209 <div class="form_create_bottom_buttons_block buttons_block">
51165210 <div id="rm_button_back" class="menu_button fa-solid fa-left-long "></div>
51175211 <!-- <div id="renameCharButton" class="menu_button fa-solid fa-user-pen" title="Rename Character"></div> -->
51185212 <div id="favorite_button" class="menu_button fa-solid fa-star" title="Add to Favorites" data-i18n="[title]Add to Favorites"></div>
@@ -5120,6 +5214,7 @@
51205214 <div id="advanced_div" class="menu_button fa-solid fa-book " title="Advanced Definitions" data-i18n="[title]Advanced Definition"></div>
51215215 <div id="world_button" class="menu_button fa-solid fa-globe" title="Character Lore&#10;&#10;Click to load&#10;Shift-click to open 'Link to World Info' popup" data-i18n="[title]world_button_title"></div>
51225216 <div class="chat_lorebook_button menu_button fa-solid fa-passport" title="Chat Lore&#10;Alt+Click to open the lorebook" data-i18n="[title]Chat Lore Alt+Click to open the lorebook"></div>
5217+ <div id="char_connections_button" class="menu_button fa-solid fa-face-smile" title="Connected Personas" data-i18n="[title]Connected Personas"></div>
51235218 <div id="export_button" class="menu_button fa-solid fa-file-export " title="Export and Download" data-i18n="[title]Export and Download"></div>
51245219 <!-- <div id="set_chat_scenario" class="menu_button fa-solid fa-scroll" title="Set a chat scenario override"></div> -->
51255220 <!-- <div id="set_character_world" class="menu_button fa-solid fa-globe" title="Set a character World Info / Lorebook"></div> -->
@@ -5127,7 +5222,7 @@
51275222 <label for="create_button" id="create_button_label" class="menu_button fa-solid fa-user-check" title="Create Character" data-i18n="[title]Create Character">
51285223 <input type="submit" id="create_button" name="create_button">
51295224 </label>
51305225 <div id="delete_button" class="menu_button fa-solid fa-skull red_button" title="Delete Character" data-i18n="[title]Delete Character"></div>
51315226 </div>
51325227 <label class="flex1 height100p" for="char-management-dropdown">
51335228 <select id="char-management-dropdown" class="text_pole">
@@ -5317,17 +5412,17 @@
53175412 </div>
53185413 </div>
53195414 <div id="GroupFavDelOkBack" class="flex-container flexGap5 spaceEvenly flex1">
53205415 <div id="rm_button_back_from_group" class="heightFitContent margin0 menu_button fa-solid fa-fw fa-left-long"></div>
53215416 <div id="rm_group_scenario" class="heightFitContent margin0 menu_button fa-solid fa-fw fa-scroll" title="Set a group chat scenario" data-i18n="[title]Set a group chat scenario"></div>
53225417 <div id="group_favorite_button" class="heightFitContent margin0 menu_button fa-solid fa-fw fa-star" title="Add to Favorites" data-i18n="[title]Add to Favorites"></div>
53235418 <input id="rm_group_fav" type="hidden" />
53245419 <div id="group_open_media_overrides" class="heightFitContent margin0 menu_button menu_button_icon open_media_overrides" title="Click to allow/forbid the use of external media for this group." data-i18n="[title]Click to allow/forbid the use of external media for this group.">
53255420 <i id="group_media_allowed_icon" class="fa-solid fa-fw fa-link"></i>
53265421 <i id="group_media_forbidden_icon" class="fa-solid fa-fw fa-link-slash"></i>
53275422 </div>
53285423 <div id="rm_group_submit" class="heightFitContent margin0 menu_button fa-solid fa-fw fa-check" title="Create" data-i18n="[title]Create"></div>
53295424 <div id="rm_group_restore_avatar" class="heightFitContent margin0 menu_button fa-solid fa-fw fa-images" title="Restore collage avatar" data-i18n="[title]Restore collage avatar"></div>
53305425 <div id="rm_group_delete" class="heightFitContent margin0 menu_button fa-solid fa-fw fa-trash-can" title="Delete" data-i18n="[title]Delete"></div>
53315426 <div class="flex1">
53325427 <label class="checkbox_label whitespacenowrap">
53335428 <input id="rm_group_allow_self_responses" type="checkbox" />
@@ -5464,25 +5559,20 @@
54645559 <div class="flex-container wide100pLess70px character_select_container">
54655560 <div class="wide100p character_name_block">
54665561 <span class="ch_name flex1"></span>
5467- <div class="avatar-buttons">
5468- <button class="menu_button bind_user_name" title="Bind user name to that avatar" data-i18n="[title]Bind user name to that avatar">
5469- <i class="fa-fw fa-solid fa-user-edit fa-sm"></i>
5470- </button>
5471- <button class="menu_button set_persona_image" title="Change persona image" data-i18n="[title]Change persona image">
5472- <i class="fa-fw fa-solid fa-image fa-sm"></i>
5473- </button>
5474- <button class="menu_button set_default_persona" title="Select this as default persona for the new chats." data-i18n="[title]Select this as default persona for the new chats.">
5475- <i class="fa-fw fa-solid fa-crown fa-sm"></i>
5476- </button>
5477- <button class="menu_button duplicate_persona" title="Duplicate persona" data-i18n="[title]Duplicate persona">
5478- <i class="fa-fw fa-solid fa-clone fa-sm"></i>
5479- </button>
5480- <button class="menu_button delete_avatar" title="Delete persona" data-i18n="[title]Delete persona">
5481- <i class="fa-fw fa-solid fa-trash-alt fa-sm"></i>
5482- </button>
5483- </div>
54845562 </div>
54855563 <div class="ch_description"></div>
5564+ <div class="avatar_container_states buttons_block">
5565+ <div class="locked_to_chat_label avatar_state has_hover_label menu_button menu_button_icon disabled" title="Persona is locked to the current chat" data-i18n="[title]Persona is locked to the current chat">
5566+ <i class="icon fa-solid fa-lock fa-fw"></i>
5567+ <i class="label_icon icon fa-solid fa-comments fa-fw"></i>
5568+ <div class="label" data-i18n="Chat">Chat</div>
5569+ </div>
5570+ <div class="locked_to_character_label avatar_state has_hover_label menu_button menu_button_icon disabled " title="Persona is locked to the current character" data-i18n="[title]Persona is locked to the current character">
5571+ <i class="icon fa-solid fa-lock fa-fw"></i>
5572+ <i class="label_icon icon fa-solid fa-user fa-fw"></i>
5573+ <div class="label" data-i18n="Character">Character</div>
5574+ </div>
5575+ </div>
54865576 </div>
54875577 </div>
54885578 </div>
@@ -6308,7 +6398,7 @@
63086398 </div>
63096399 </div>
63106400 <div class="mes_reasoning_actions flex-container">
63116401 <div class="mes_reasoning_edit_done menu_button edit_button fa-solid fa-check" title="Confirm" data-i18n="[title]ConfirmeditConfirm Edit"></div>
63126402 <div class="mes_reasoning_delete menu_button edit_button fa-solid fa-trash-can" title="Remove reasoning" data-i18n="[title]Remove reasoning"></div>
63136403 <div class="mes_reasoning_edit_cancel menu_button edit_button fa-solid fa-xmark" title="Cancel edit" data-i18n="[title]Cancel edit"></div>
63146404 <div class="mes_reasoning_copy mes_button fa-solid fa-copy" title="Copy reasoning" data-i18n="[title]Copy reasoning"></div>
@@ -6890,8 +6980,8 @@
68906980 </div>
68916981 <div id="form_sheld">
68926982 <div id="dialogue_del_mes">
68936983 <div id="dialogue_del_mes_ok" data-i18n="Delete" class="menu_button">Delete</div>
68946984 <div id="dialogue_del_mes_cancel" data-i18n="Cancel" class="menu_button">Cancel</div>
68956985 </div>
68966986 <div id="send_form" class="no-connection">
68976987 <form id="file_form" class="wide100p displayNone">
public/lib.js+3 -0
@@ -20,6 +20,7 @@ import * as Popper from '@popperjs/core';
2020import droll from 'droll';
2121import morphdom from 'morphdom';
2222import { toggle as slideToggle } from 'slidetoggle';
23+import chalk from 'chalk';
2324
2425/**
2526 * Expose the libraries to the 'window' object.
@@ -96,6 +97,7 @@ export default {
9697 droll,
9798 morphdom,
9899 slideToggle,
100+ chalk,
99101};
100102
101103export {
@@ -118,4 +120,5 @@ export {
118120 droll,
119121 morphdom,
120122 slideToggle,
123+ chalk,
121124};
public/lib/eventemitter.js+42 -1
@@ -24,10 +24,22 @@ if (typeof Array.prototype.indexOf === 'function') {
2424
2525
2626/* Polyfill EventEmitter. */
27-var EventEmitter = function () {
27+/**
28+ * Creates an event emitter.
29+ * @param {string[]} autoFireAfterEmit Auto-fire event names
30+ */
31+var EventEmitter = function (autoFireAfterEmit = []) {
2832 this.events = {};
33+ this.autoFireLastArgs = new Map();
34+ this.autoFireAfterEmit = new Set(autoFireAfterEmit);
2935};
3036
37+/**
38+ * Adds a listener to an event.
39+ * @param {string} event Event name
40+ * @param {function} listener Event listener
41+ * @returns
42+ */
3143EventEmitter.prototype.on = function (event, listener) {
3244 // Unknown event used by external libraries?
3345 if (event === undefined) {
@@ -40,6 +52,10 @@ EventEmitter.prototype.on = function (event, listener) {
4052 }
4153
4254 this.events[event].push(listener);
55+
56+ if (this.autoFireAfterEmit.has(event) && this.autoFireLastArgs.has(event)) {
57+ listener.apply(this, this.autoFireLastArgs.get(event));
58+ }
4359};
4460
4561/**
@@ -60,6 +76,10 @@ EventEmitter.prototype.makeLast = function (event, listener) {
6076 }
6177
6278 events.push(listener);
79+
80+ if (this.autoFireAfterEmit.has(event) && this.autoFireLastArgs.has(event)) {
81+ listener.apply(this, this.autoFireLastArgs.get(event));
82+ }
6383}
6484
6585/**
@@ -80,8 +100,17 @@ EventEmitter.prototype.makeFirst = function (event, listener) {
80100 }
81101
82102 events.unshift(listener);
103+
104+ if (this.autoFireAfterEmit.has(event) && this.autoFireLastArgs.has(event)) {
105+ listener.apply(this, this.autoFireLastArgs.get(event));
106+ }
83107}
84108
109+/**
110+ * Removes a listener from an event.
111+ * @param {string} event Event name
112+ * @param {function} listener Event listener
113+ */
85114EventEmitter.prototype.removeListener = function (event, listener) {
86115 var idx;
87116
@@ -94,6 +123,10 @@ EventEmitter.prototype.removeListener = function (event, listener) {
94123 }
95124};
96125
126+/**
127+ * Emits an event with optional arguments.
128+ * @param {string} event Event name
129+ */
97130EventEmitter.prototype.emit = async function (event) {
98131 let args = [].slice.call(arguments, 1);
99132 if (localStorage.getItem('eventTracing') === 'true') {
@@ -118,6 +151,10 @@ EventEmitter.prototype.emit = async function (event) {
118151 }
119152 }
120153 }
154+
155+ if (this.autoFireAfterEmit.has(event)) {
156+ this.autoFireLastArgs.set(event, args);
157+ }
121158};
122159
123160EventEmitter.prototype.emitAndWait = function (event) {
@@ -144,6 +181,10 @@ EventEmitter.prototype.emitAndWait = function (event) {
144181 }
145182 }
146183 }
184+
185+ if (this.autoFireAfterEmit.has(event)) {
186+ this.autoFireLastArgs.set(event, args);
187+ }
147188};
148189
149190EventEmitter.prototype.once = function (event, listener) {
public/locales/ar-sa.json+3 -3
@@ -558,7 +558,7 @@
558558 "Delete a theme": "حذف موضوع",
559559 "Update a theme file": "تحديث ملف السمة",
560560 "Save as a new theme": "حفظ كسمة جديدة",
561561 "Avatar Style:": "نمط الصورة الرمزية",
562562 "Circle": "دائرة",
563563 "Square": "مربع",
564564 "Rectangle": "مستطيل",
@@ -633,7 +633,7 @@
633633 "Prefer Character Card Prompt": "تفضيل التعليمات من بطاقة الشخصية",
634634 "If checked and the character card contains a jailbreak override (Post History Instruction), use that instead": "إذا تم التحقق وكانت بطاقة الشخصية تحتوي على تجاوز للكسر (تعليمات تاريخ المشاركة)، استخدم ذلك بدلاً من ذلك",
635635 "Prefer Character Card Jailbreak": "تفضيل كسر الحصار من بطاقة الشخصية",
636636 "Avoid cropping and resizing imported character images. When off, crop/resize to 512x768never_resize_avatars_tooltip": "تجنب اقتصاص صور الأحرف المستوردة وتغيير حجمها. عند إيقاف التشغيل، قم بالقص/تغيير الحجم إلى 512 × 768.",
637637 "Never resize avatars": "لا تغيير حجم الصور الرمزية أبدًا",
638638 "Show actual file names on the disk, in the characters list display only": "عرض الأسماء الفعلية للملفات على القرص، في عرض قائمة الشخصيات فقط",
639639 "Show avatar filenames": "عرض أسماء ملفات الصور الرمزية",
@@ -709,7 +709,7 @@
709709 "Auto-swipe": "السحب التلقائي",
710710 "Enable the auto-swipe function. Settings in this section only have an effect when auto-swipe is enabled": "تمكين وظيفة السحب التلقائي. الإعدادات في هذا القسم تؤثر فقط عند تمكين السحب التلقائي",
711711 "Minimum generated message length": "الحد الأدنى لطول الرسالة المولدة",
712712 "If the generated message is shorter than thisthese many characters, trigger an auto-swipe": "إذا كانت الرسالة المولدة أقصر من هذا، فتحريض السحب التلقائي",
713713 "Blacklisted words": "الكلمات الممنوعة",
714714 "words you dont want generated separated by comma ','": "الكلمات التي لا تريد توليدها مفصولة بفاصلة ','",
715715 "Blacklisted word count to swipe": "عدد الكلمات الممنوعة للسحب",
public/locales/de-de.json+3 -3
@@ -558,7 +558,7 @@
558558 "Delete a theme": "Löschen eines Designs",
559559 "Update a theme file": "Ein Theme-Datei aktualisieren",
560560 "Save as a new theme": "Als neues Theme speichern",
561561 "Avatar Style:": "Avatar-Stil",
562562 "Circle": "Kreis",
563563 "Square": "Quadrat",
564564 "Rectangle": "Rechteck",
@@ -633,7 +633,7 @@
633633 "Prefer Character Card Prompt": "Bevorzuge Charakterkarten-Prompt",
634634 "If checked and the character card contains a jailbreak override (Post History Instruction), use that instead": "Wenn aktiviert und die Charakterkarte eine Jailbreak-Überschreibung enthält (Post-History-Instruction), verwende stattdessen diese",
635635 "Prefer Character Card Jailbreak": "Bevorzuge Charakterkarten-Jailbreak",
636636 "Avoid cropping and resizing imported character images. When off, crop/resize to 512x768never_resize_avatars_tooltip": "Vermeiden Sie das Zuschneiden und Ändern der Größe importierter Zeichenbilder. Wenn deaktiviert, wird die Größe auf 512 x 768 zugeschnitten/angepasst.",
637637 "Never resize avatars": "Avatare niemals verkleinern",
638638 "Show actual file names on the disk, in the characters list display only": "Zeige tatsächliche Dateinamen auf der Festplatte, nur in der Anzeige der Charakterliste",
639639 "Show avatar filenames": "Avatar-Dateinamen anzeigen",
@@ -709,7 +709,7 @@
709709 "Auto-swipe": "Automatisches Wischen",
710710 "Enable the auto-swipe function. Settings in this section only have an effect when auto-swipe is enabled": "Aktiviere die Auto-Wisch-Funktion. Einstellungen in diesem Abschnitt haben nur dann Auswirkungen, wenn das automatische Wischen aktiviert ist",
711711 "Minimum generated message length": "Minimale generierte Nachrichtenlänge",
712712 "If the generated message is shorter than thisthese many characters, trigger an auto-swipe": "Wenn die generierte Nachricht kürzer ist als diese, löse automatisches Wischen aus",
713713 "Blacklisted words": "Verbotene Wörter",
714714 "words you dont want generated separated by comma ','": "Wörter, die du nicht generiert haben möchtest, durch Komma ',' getrennt",
715715 "Blacklisted word count to swipe": "Anzahl der verbotenen Wörter, um zu wischen",
public/locales/es-es.json+3 -3
@@ -558,7 +558,7 @@
558558 "Delete a theme": "Eliminar un tema",
559559 "Update a theme file": "Actualizar un archivo de tema",
560560 "Save as a new theme": "Guardar como nuevo tema",
561561 "Avatar Style:": "Estilo de Avatar",
562562 "Circle": "Círculo",
563563 "Square": "Cuadrado",
564564 "Rectangle": "Rectángulo",
@@ -633,7 +633,7 @@
633633 "Prefer Character Card Prompt": "Preferir Indicaciones en Tarjeta de Personaje",
634634 "If checked and the character card contains a jailbreak override (Post History Instruction), use that instead": "Si está marcado y la tarjeta de personaje contiene una anulación de jailbreak (Instrucciones Post Historial), usar eso en su lugar",
635635 "Prefer Character Card Jailbreak": "Preferir Jailbreak en Tarjeta de Personaje",
636636 "Avoid cropping and resizing imported character images. When off, crop/resize to 512x768never_resize_avatars_tooltip": "Evite recortar y cambiar el tamaño de las imágenes de personajes importados. Cuando esté desactivado, recorte/cambie el tamaño a 512x768.",
637637 "Never resize avatars": "Nunca redimensionar avatares",
638638 "Show actual file names on the disk, in the characters list display only": "Mostrar nombres de archivo reales en el disco, solo en la visualización de la lista de personajes",
639639 "Show avatar filenames": "Mostrar nombres de archivo de avatares",
@@ -709,7 +709,7 @@
709709 "Auto-swipe": "Deslizamiento automático",
710710 "Enable the auto-swipe function. Settings in this section only have an effect when auto-swipe is enabled": "Habilitar la función de deslizamiento automático. La configuración en esta sección solo tiene efecto cuando el deslizamiento automático está habilitado",
711711 "Minimum generated message length": "Longitud mínima del mensaje generado",
712712 "If the generated message is shorter than thisthese many characters, trigger an auto-swipe": "Si el mensaje generado es más corto que esto, activar un deslizamiento automático",
713713 "Blacklisted words": "Palabras prohibidas",
714714 "words you dont want generated separated by comma ','": "palabras que no desea generar separadas por coma ','",
715715 "Blacklisted word count to swipe": "Número de palabras prohibidas para deslizar",
public/locales/fr-fr.json+5 -7
@@ -508,7 +508,7 @@
508508 "Delete a theme": "Supprimer un thème",
509509 "Update a theme file": "Mettre à jour un fichier de thème",
510510 "Save as a new theme": "Enregistrer en tant que nouveau thème",
511511 "Avatar Style:": "Style d'avatar",
512512 "Circle": "Cercle",
513513 "Square": "Carré",
514514 "Rectangle": "Rectangle",
@@ -581,7 +581,7 @@
581581 "Advanced Character Search": "Recherche de personnage avancée",
582582 "If checked and the character card contains a prompt override (System Prompt), use that instead": "Si cochée et si la carte de personnage contient un prompt de remplacement (prompt système), l'utiliser à la place",
583583 "Prefer Character Card Prompt": "Préférer le prompt du personnage",
584584 "Avoid cropping and resizing imported character images. When off, crop/resize to 512x768never_resize_avatars_tooltip": "Évitez de recadrer et de redimensionner les images de personnages importés. Lorsqu'il est désactivé, recadrez/redimensionnez à 512 x 768.",
585585 "Never resize avatars": "Ne jamais redimensionner les avatars",
586586 "Show actual file names on the disk, in the characters list display only": "Afficher les noms de fichier réels sur le disque, dans l'affichage de la liste de personnages uniquement",
587587 "Show avatar filenames": "Afficher les noms de fichier des avatars",
@@ -656,7 +656,7 @@
656656 "Auto-swipe": "Balayage automatique",
657657 "Enable the auto-swipe function. Settings in this section only have an effect when auto-swipe is enabled": "Activer la fonction de balayage automatique. Les paramètres de cette section n'ont d'effet que lorsque le balayage automatique est activé",
658658 "Minimum generated message length": "Longueur minimale du message généré",
659659 "If the generated message is shorter than thisthese many characters, trigger an auto-swipe": "Si le message généré est plus court que cela, déclenchez un balayage automatique",
660660 "Blacklisted words": "Mots en liste noire",
661661 "words you dont want generated separated by comma ','": "mots que vous ne voulez pas générer séparés par des virgules ','",
662662 "Blacklisted word count to swipe": "Nombre de mots en liste noire pour balayer",
@@ -1420,7 +1420,6 @@
14201420 "Block Entropy API Key": "Clé API Block Entropy",
14211421 "Select a Model": "Sélectionner un modèle",
14221422 "Example: http://localhost:1234/v1": "Exemple: http://localhost:1234/v1",
1423- "at the end of the URL!": "à la fin de l'URL !",
14241423 "(Optional)": "(Optionnel)",
14251424 "Enter a Model ID": "Saisir un ID de modèle",
14261425 "Example: gpt-3.5-turbo": "Exemple: gpt-3.5-turbo",
@@ -1485,7 +1484,7 @@
14851484 "(disabled when max recursion steps are used)": "(désactivé lorsque le nombre maximum de pas de récursivité est utilisé)",
14861485 "Cap the number of entry activation recursions": "Plafonner le nombre de récursions d'activation d'entrée",
14871486 "Max Recursion Steps": "Nombre maximal d'étapes de récursivité",
14881487 "0 = unlimited, 1 = scans once and doesn't recurse, 2 = scans once and recurses once, etc\\n(disabled when min activations are used)": "0 = illimité, 1 = scanne une fois et ne récure pas, 2 = scanne une fois et récure une fois, etc.\n(désactivé lorsque des activations minimales sont utilisées)",
14891488 "Include names with each message into the context for scanning": "Inclure les noms dans chaque message dans le contexte pour l'analyse.",
14901489 "Apply current sorting as Order": "Appliquer le tri actuel comme ordre",
14911490 "Display swipe numbers for all messages, not just the last.": "Afficher le nombre de balayage sur tous les messages, et pas seulement le dernier.",
@@ -1494,7 +1493,7 @@
14941493 "Ask": "Demander",
14951494 "tag_import_none": "Aucun",
14961495 "tag_import_all": "Tous",
14971496 "Existingtag_import_existing": "Existant",
14981497 "If checked and the character card contains a Post-History Instructions override, use that instead": "Si cette case est cochée et que la carte de personnage contient une instruction de remplacement pour le post-histoire, utilisez-la à la place.",
14991498 "Prefer Character Card Instructions": "Préférer les instructions du personnage",
15001499 "Enable auto-select of input text in some text fields when clicking/selecting them. Applies to popup input textboxes, and possible other custom input fields.": "Active la sélection automatique du texte saisi dans certains champs de texte lorsque l'on clique dessus ou qu'on les sélectionne. S'applique aux zones de texte de type popup et, éventuellement, à d'autres champs de saisie personnalisés.",
@@ -1602,7 +1601,6 @@
16021601 "Character Expressions": "Expressions de personnages",
16031602 "Translate text to English before classification": "Traduire le texte en anglais avant de le classer",
16041603 "Show default images (emojis) if sprite missing": "Afficher les images par défaut (emojis) si le sprite est manquant",
1605- "Image Type - talkinghead (extras)": "Type d'image - talkinghead (extras)",
16061604 "Classifier API": "API de classification",
16071605 "Select the API for classifying expressions.": "Sélectionnez l'API pour classer les expressions.",
16081606 "Main API": "API principale",
public/locales/is-is.json+3 -3
@@ -558,7 +558,7 @@
558558 "Delete a theme": "Eyða þema",
559559 "Update a theme file": "Uppfæra þemu skrá",
560560 "Save as a new theme": "Vista sem nýja þemu",
561561 "Avatar Style:": "Avatar Stíll",
562562 "Circle": "Hring",
563563 "Square": "Reitur",
564564 "Rectangle": "Ferhyrningur",
@@ -633,7 +633,7 @@
633633 "Prefer Character Card Prompt": "Kosstu kvenkortu fyrirspurn",
634634 "If checked and the character card contains a jailbreak override (Post History Instruction), use that instead": "Ef merkt er og kortið inniheldur fangabrotsskil, notaðu það í staðinn",
635635 "Prefer Character Card Jailbreak": "Kosstu kvenkortu fangabrot",
636636 "Avoid cropping and resizing imported character images. When off, crop/resize to 512x768never_resize_avatars_tooltip": "Forðastu að klippa og breyta stærð innfluttra stafamynda. Þegar slökkt er á því skaltu skera/breyta stærð í 512x768.",
637637 "Never resize avatars": "Aldrei breyta stærðinni á merkjum",
638638 "Show actual file names on the disk, in the characters list display only": "Sýna raunveruleg nöfn skráa á diskinum, í lista yfir persónur sýna aðeins",
639639 "Show avatar filenames": "Sýna nöfn merkja",
@@ -709,7 +709,7 @@
709709 "Auto-swipe": "Sjálfvirkur sveip",
710710 "Enable the auto-swipe function. Settings in this section only have an effect when auto-swipe is enabled": "Virkjaðu sjálfvirka sveiflugerð. Stillingar í þessum hluta hafa aðeins áhrif þegar sjálfvirkur sveiflugerð er virk",
711711 "Minimum generated message length": "Lágmarks lengd á mynduðum skilaboðum",
712712 "If the generated message is shorter than thisthese many characters, trigger an auto-swipe": "Ef mynduðu skilaboðin eru styttri en þessi, kallaðu fram sjálfvirkar sveiflugerðar",
713713 "Blacklisted words": "Svört orð",
714714 "words you dont want generated separated by comma ','": "orð sem þú vilt ekki að framleiða aðskilin með kommu ','",
715715 "Blacklisted word count to swipe": "Fjöldi svörtra orða til að sveipa",
public/locales/it-it.json+3 -3
@@ -558,7 +558,7 @@
558558 "Delete a theme": "Elimina un tema",
559559 "Update a theme file": "Aggiorna un file di tema",
560560 "Save as a new theme": "Salva come nuovo tema",
561561 "Avatar Style:": "Stile avatar",
562562 "Circle": "Cerchio",
563563 "Square": "Quadrato",
564564 "Rectangle": "Rettangolo",
@@ -633,7 +633,7 @@
633633 "Prefer Character Card Prompt": "Preferisci Prompt della Scheda Personaggio",
634634 "If checked and the character card contains a jailbreak override (Post History Instruction), use that instead": "Se selezionato e la scheda del personaggio contiene una sovrascrittura jailbreak (Istruzione Storico Post), usalo invece",
635635 "Prefer Character Card Jailbreak": "Preferisci Jailbreak della Scheda Personaggio",
636636 "Avoid cropping and resizing imported character images. When off, crop/resize to 512x768never_resize_avatars_tooltip": "Evita di ritagliare e ridimensionare le immagini dei personaggi importati. Quando è disattivato, ritaglia/ridimensiona a 512x768.",
637637 "Never resize avatars": "Non ridimensionare mai gli avatar",
638638 "Show actual file names on the disk, in the characters list display only": "Mostra i nomi file effettivi sul disco, solo nella visualizzazione dell'elenco dei personaggi",
639639 "Show avatar filenames": "Mostra nomi file avatar",
@@ -709,7 +709,7 @@
709709 "Auto-swipe": "Auto-swipe",
710710 "Enable the auto-swipe function. Settings in this section only have an effect when auto-swipe is enabled": "Abilita la funzione di auto-swipe. Le impostazioni in questa sezione hanno effetto solo quando l'auto-swipe è abilitato",
711711 "Minimum generated message length": "Lunghezza minima del messaggio generato",
712712 "If the generated message is shorter than thisthese many characters, trigger an auto-swipe": "Se il messaggio generato è più breve di questo, attiva un'automatica rimozione",
713713 "Blacklisted words": "Parole in blacklist",
714714 "words you dont want generated separated by comma ','": "parole che non vuoi generate separate da virgola ','",
715715 "Blacklisted word count to swipe": "Numero di parole in blacklist per attivare un'automatica rimozione",
public/locales/ja-jp.json+3 -3
@@ -558,7 +558,7 @@
558558 "Delete a theme": "テーマを削除する",
559559 "Update a theme file": "テーマファイルを更新",
560560 "Save as a new theme": "新しいテーマとして保存",
561561 "Avatar Style:": "アバタースタイル",
562562 "Circle": "円",
563563 "Square": "正方形",
564564 "Rectangle": "長方形",
@@ -633,7 +633,7 @@
633633 "Prefer Character Card Prompt": "キャラクターカードのプロンプトを優先",
634634 "If checked and the character card contains a jailbreak override (Post History Instruction), use that instead": "チェックされていてキャラクターカードにジェイルブレイクオーバーライド(投稿履歴指示)が含まれている場合、それを代わりに使用します",
635635 "Prefer Character Card Jailbreak": "キャラクターカードのJailbreakを優先",
636636 "Avoid cropping and resizing imported character images. When off, crop/resize to 512x768never_resize_avatars_tooltip": "インポートした文字画像の切り取りやサイズ変更を避けます。オフにすると、512x768 に切り取り/サイズ変更されます。",
637637 "Never resize avatars": "アバターを常にリサイズしない",
638638 "Show actual file names on the disk, in the characters list display only": "ディスク上の実際のファイル名を表示します。キャラクターリストの表示にのみ",
639639 "Show avatar filenames": "アバターのファイル名を表示",
@@ -709,7 +709,7 @@
709709 "Auto-swipe": "オートスワイプ",
710710 "Enable the auto-swipe function. Settings in this section only have an effect when auto-swipe is enabled": "自動スワイプ機能を有効にします。このセクションの設定は、自動スワイプが有効になっている場合にのみ効果があります",
711711 "Minimum generated message length": "生成されたメッセージの最小長",
712712 "If the generated message is shorter than thisthese many characters, trigger an auto-swipe": "生成されたメッセージがこれよりも短い場合、自動スワイプをトリガーします",
713713 "Blacklisted words": "ブラックリストされた単語",
714714 "words you dont want generated separated by comma ','": "コンマ ',' で区切られた生成したくない単語",
715715 "Blacklisted word count to swipe": "スワイプするブラックリストされた単語の数",
public/locales/ko-kr.json+4 -5
@@ -568,7 +568,7 @@
568568 "Delete a theme": "테마 삭제",
569569 "Update a theme file": "테마 파일 업데이트",
570570 "Save as a new theme": "새 테마로 저장",
571571 "Avatar Style:": "캐릭터 프로필 스타일",
572572 "Circle": "원",
573573 "Square": "정사각형",
574574 "Rectangle": "사각형",
@@ -646,7 +646,7 @@
646646 "Prefer Character Card Prompt": "캐릭터 카드 프롬프트 선호",
647647 "If checked and the character card contains a jailbreak override (Post History Instruction), use that instead": "선택되어 있고 캐릭터 카드에 (Post-History 지시)탈옥 재정의가 포함 된 경우, 그것을 대신 사용합니다.",
648648 "Prefer Character Card Jailbreak": "캐릭터 카드 탈옥 선호",
649649 "Avoid cropping and resizing imported character images. When off, crop/resize to 512x768never_resize_avatars_tooltip": "가져온 캐릭터 이미지를 자르거나 크기를 조정하지 마세요. 꺼져 있으면 512x768로 자르거나 크기를 조정합니다.",
650650 "Never resize avatars": "아바타 크기 변경하지 않음",
651651 "Show actual file names on the disk, in the characters list display only": "실제 파일 이름을 디스크에 표시하며 캐릭터 목록 디스플레이에만",
652652 "Show avatar filenames": "아바타 파일 이름 표시",
@@ -724,7 +724,7 @@
724724 "Auto-swipe": "자동 스와이프",
725725 "Enable the auto-swipe function. Settings in this section only have an effect when auto-swipe is enabled": "자동 스와이프 기능을 활성화합니다. 이 섹션의 설정은 자동 스와이프가 활성화되었을 때만 영향을 미칩니다",
726726 "Minimum generated message length": "생성된 메시지 최소 길이",
727727 "If the generated message is shorter than thisthese many characters, trigger an auto-swipe": "생성된 메시지가이보다 짧으면 자동 스와이프를 트리거합니다",
728728 "Blacklisted words": "금지어",
729729 "words you dont want generated separated by comma ','": "쉼표로 구분된 생성하지 않으려는 단어",
730730 "Blacklisted word count to swipe": "스와이프할 금지어 개수",
@@ -1467,7 +1467,6 @@
14671467 "menu within": "내의 메뉴",
14681468 "Translate text to English before classification": "분류 전에 텍스트를 영어로 번역합니다.",
14691469 "Show default images (emojis) if sprite missing": "해당하는 스프라이트가 없으면 기본 이미지 (이모지들)을 표시합니다.",
1470- "Image Type - talkinghead (extras)": "이미지 유형 - 토킹 헤드 (부가 사항)",
14711470 "Classifier API": "분류를 위한 API",
14721471 "Select the API for classifying expressions.": "감정 이미지들을 분류할 API를 선택하세요.",
14731472 "Local": "로컬",
@@ -1614,7 +1613,7 @@
16141613 "Ask": "묻기",
16151614 "tag_import_none": "불러오지 않음",
16161615 "tag_import_all": "전부",
16171616 "Existingtag_import_existing": "기존 태그 참조",
16181617 "You can add more": "원한다면",
16191618 "or_welcome": "또는",
16201619 "from other websites": "를 통해 다른 웹사이트들로부터 불러올 수 있습니다.",
public/locales/nl-nl.json+3 -3
@@ -558,7 +558,7 @@
558558 "Delete a theme": "Verwijder een thema",
559559 "Update a theme file": "Werk een themabestand bij",
560560 "Save as a new theme": "Opslaan als nieuw thema",
561561 "Avatar Style:": "Avatarstijl",
562562 "Circle": "Cirkel",
563563 "Square": "Vierkant",
564564 "Rectangle": "Rechthoek",
@@ -633,7 +633,7 @@
633633 "Prefer Character Card Prompt": "Voorkeur karakterkaart prompt",
634634 "If checked and the character card contains a jailbreak override (Post History Instruction), use that instead": "Als aangevinkt en de karakterkaart bevat een jailbreak-override (Post History Instruction), gebruik die in plaats daarvan",
635635 "Prefer Character Card Jailbreak": "Voorkeur karakterkaart jailbreak",
636636 "Avoid cropping and resizing imported character images. When off, crop/resize to 512x768never_resize_avatars_tooltip": "Vermijd het bijsnijden en vergroten/verkleinen van geïmporteerde karakterafbeeldingen. Indien uitgeschakeld, bijsnijden/formaat wijzigen naar 512 x 768.",
637637 "Never resize avatars": "Avatars nooit verkleinen",
638638 "Show actual file names on the disk, in the characters list display only": "Toon de werkelijke bestandsnamen op de schijf, alleen in de weergave van de lijst met personages",
639639 "Show avatar filenames": "Toon avatar bestandsnamen",
@@ -709,7 +709,7 @@
709709 "Auto-swipe": "Automatisch vegen",
710710 "Enable the auto-swipe function. Settings in this section only have an effect when auto-swipe is enabled": "Schakel de automatische-vegen functie in. Instellingen in dit gedeelte hebben alleen effect wanneer automatisch vegen is ingeschakeld",
711711 "Minimum generated message length": "Minimale gegenereerde berichtlengte",
712712 "If the generated message is shorter than thisthese many characters, trigger an auto-swipe": "Als het gegenereerde bericht korter is dan dit, activeer dan een automatische veeg",
713713 "Blacklisted words": "Verboden woorden",
714714 "words you dont want generated separated by comma ','": "woorden die je niet gegenereerd wilt hebben gescheiden door komma ','",
715715 "Blacklisted word count to swipe": "Aantal verboden woorden om te vegen",
public/locales/pt-pt.json+3 -3
@@ -558,7 +558,7 @@
558558 "Delete a theme": "Excluir um tema",
559559 "Update a theme file": "Atualizar um arquivo de tema",
560560 "Save as a new theme": "Salvar como um novo tema",
561561 "Avatar Style:": "Estilo de Avatar",
562562 "Circle": "Círculo",
563563 "Square": "Quadrado",
564564 "Rectangle": "Retângulo",
@@ -633,7 +633,7 @@
633633 "Prefer Character Card Prompt": "Preferir Prompt do Cartão de Personagem",
634634 "If checked and the character card contains a jailbreak override (Post History Instruction), use that instead": "Se marcado e o cartão de personagem contiver uma substituição de jailbreak (Instrução de Histórico de Postagens), use isso em vez disso",
635635 "Prefer Character Card Jailbreak": "Preferir Jailbreak do Cartão de Personagem",
636636 "Avoid cropping and resizing imported character images. When off, crop/resize to 512x768never_resize_avatars_tooltip": "Evite cortar e redimensionar imagens de personagens importados. Quando desativado, corte/redimensione para 512x768.",
637637 "Never resize avatars": "Nunca redimensionar avatares",
638638 "Show actual file names on the disk, in the characters list display only": "Mostrar nomes de arquivo reais no disco, apenas na exibição da lista de personagens",
639639 "Show avatar filenames": "Mostrar nomes de arquivo de avatar",
@@ -709,7 +709,7 @@
709709 "Auto-swipe": "Auto-swipe",
710710 "Enable the auto-swipe function. Settings in this section only have an effect when auto-swipe is enabled": "Ativar a função de auto-swipe. As configurações nesta seção só têm efeito quando o auto-swipe está ativado",
711711 "Minimum generated message length": "Comprimento mínimo da mensagem gerada",
712712 "If the generated message is shorter than thisthese many characters, trigger an auto-swipe": "Se a mensagem gerada for mais curta que isso, acione um auto-swipe",
713713 "Blacklisted words": "Palavras proibidas",
714714 "words you dont want generated separated by comma ','": "palavras que você não quer geradas separadas por vírgula ','",
715715 "Blacklisted word count to swipe": "Contagem de palavras proibidas para swipe",
public/locales/ru-ru.json+76 -17
@@ -195,12 +195,12 @@
195195 "Yes": "Да",
196196 "No": "Нет",
197197 "Context %": "Процент контекста",
198198 "Budget Cap": "БюджетныйЛимит лимитбюджета",
199199 "(0 = disabled)": "(0 = отключено)",
200200 "None": "Отсутствует",
201201 "User Settings": "Настройки пользователя",
202202 "UI Language": "Язык интерфейса",
203203 "Avatar Style:": "Аватарки",
204204 "Circle": "Круглые",
205205 "Rectangle": "Прямоугольные",
206206 "Square": "Квадратные",
@@ -426,7 +426,7 @@
426426 "Requests logprobs from the API for the Token Probabilities feature": "Запросить логпробы из API для функции Token Probabilities.",
427427 "Automatically reject and re-generate AI message based on configurable criteria": "Автоматическое отклонение и повторная генерация сообщений AI на основе настраиваемых критериев.",
428428 "Enable the auto-swipe function. Settings in this section only have an effect when auto-swipe is enabled": "Включить авто-свайп. Настройки в этом разделе действуют только при включенном авто-свайпе.",
429429 "If the generated message is shorter than thisthese many characters, trigger an auto-swipe": "Если сгенерированное сообщение короче этого значения, срабатывает авто-свайп.",
430430 "Reload and redraw the currently open chat": "Перезагрузить и перерисовать открытый в данный момент чат.",
431431 "Auto-Expand Message Actions": "Развернуть действия",
432432 "Persona Management": "Управление персоной",
@@ -575,10 +575,10 @@
575575 "Characters sorting order": "Порядок сортировки персонажей",
576576 "Remove": "Убрать",
577577 "Select a World Info file for": "Выбрать файл с миром для",
578578 "Primary Lorebook": "ОсновногоОсновной лорбукалорбук",
579579 "A selected World Info will be bound to this character as its own Lorebook.": "Информация о мире будет привязана к персонажу как его собственный лорбук.",
580580 "When generating an AI reply, it will be combined with the entries from a global World Info selector.": "Когда ИИ генерирует ответ, он будет совмещён с записями из глобально выбранного мира.",
581581 "Exporting a character would also export the selected Lorebook file embedded in the JSON data.": "При экспорте персонажа вместе с ним также выгрузится выбранный лорбук в виде JSON.",
582582 "Additional Lorebooks": "Вспомогательные лорбуки",
583583 "Associate one or more auxillary Lorebooks with this character.": "Привязать к этому персонажу один или больше вспомогательных лорбуков",
584584 "NOTE: These choices are optional and won't be preserved on character export!": "ВНИМАНИЕ: эти выборы необязательные и не будут сохранены при экспорте персонажа!",
@@ -593,7 +593,7 @@
593593 "Prompt": "Промпт",
594594 "Copy": "Скопировать",
595595 "Confirm": "Подтвердить",
596596 "Copy this message": "СкопироватьПродублировать сообщение",
597597 "Delete this message": "Удалить сообщение",
598598 "Move message up": "Переместить сообщение вверх",
599599 "Move message down": "Переместить сообщение вниз",
@@ -612,7 +612,7 @@
612612 "Ask AI to write your message for you": "Попросить ИИ написать сообщение за вас",
613613 "Continue the last message": "Продолжить текущее сообщение",
614614 "Bind user name to that avatar": "Закрепить имя за этим аватаром",
615615 "Select this as default persona for the new chats.": "ВыбератьВыбирать эту Персону в качестве персоныперсону по умолчанию для всех новых чатов.",
616616 "Change persona image": "Сменить аватар персоны",
617617 "Delete persona": "Удалить персону",
618618 "Reduced Motion": "Сокращение анимаций",
@@ -640,7 +640,7 @@
640640 "Token Probabilities": "Вероятности токенов",
641641 "Close chat": "Закрыть чат",
642642 "Manage chat files": "Все чаты",
643643 "Import Extension From Git Repo": "Импортировать расширение из Git Repository-репозитория.",
644644 "Install extension": "Установить расширение",
645645 "Manage extensions": "Управление расширениями",
646646 "Tokens persona description": "Токенов",
@@ -995,7 +995,7 @@
995995 "Set your custom avatar.": "Установить аватарку",
996996 "Remove your custom avatar.": "Сбросить аватарку",
997997 "Make a Snapshot": "Сделать снимок",
998998 "Avoid cropping and resizing imported character images. When off, crop/resize to 512x768never_resize_avatars_tooltip": "Не менять размер картинок у импортируемых персонажей. При отключении все картинки будут приводиться к размеру 512х768",
999999 "Char List Subheader": "Доп. заголовок в списке персонажей",
10001000 "# Messages to Load": "Сколько сообщений загружать",
10011001 "(0 = All)": "(0 = все)",
@@ -1122,12 +1122,11 @@
11221122 "help_hotkeys_0": "Горячие клавиши",
11231123 "You can browse a list of bundled characters in the": "Комплектных персонажей можно найти в меню",
11241124 "Download Extensions & Assets": "Загрузить расширения и ресурсы",
11251125 "menu within": "внутри этихв кубиковменю",
11261126 "Assets URL": "URL с описанием ресурсов",
11271127 "Custom (OpenAI-compatible)": "Кастомный (совместимый с OpenAI)",
11281128 "Custom Endpoint (Base URL)": "Кастомный эндпоинт (базовый URL)",
11291129 "Example: http://localhost:1234/v1": "Пример: http://localhost:1234/v1",
1130- "at the end of the URL!": "!",
11311130 "Custom API Key": "Ключ от кастомного API",
11321131 "(Optional)": "(необязательно)",
11331132 "Enter a Model ID": "Введите идентификатор модели",
@@ -1622,7 +1621,7 @@
16221621 "Defines on importing cards which action should be chosen for importing its listed tags. 'Ask' will always display the dialog.": "Выберите, какие действия следует предпринять по отношению к тегам импортируемой карточки. При выборе опции \"Спрашивать\" вы будете решать это индивидуально для каждой карточки.",
16231622 "Ask": "Спрашивать",
16241623 "tag_import_all": "Все",
16251624 "Existingtag_import_existing": "Только существующие",
16261625 "tag_import_none": "Не импортировать",
16271626 "Using a proxy that you're not running yourself is a risk to your data privacy.": "Помните, что используя чужую прокси, вы подвергаете риску конфиденциальность своих данных.",
16281627 "ANY support requests will be REFUSED if you are using a proxy.": "НЕ РАССЧИТЫВАЙТЕ на нашу поддержку, если используете прокси.",
@@ -1943,7 +1942,7 @@
19431942 "and connect to an": "и подключитесь к",
19441943 "You can add more": "Можете добавить больше",
19451944 "from other websites": "с других сайтов.",
19461945 "Go to the": "ЗаглянитеЗаходите в",
19471946 "to install additional features.": ", чтобы установить разные дополнительные ресурсы.",
19481947 "or_welcome": "; также доступен",
19491948 "Claude API Key": "Ключ от API Claude",
@@ -1958,7 +1957,7 @@
19581957 "Save": "Сохранить",
19591958 "Chat Lorebook": "Лорбук для чата",
19601959 "chat_world_template_txt": "Выбранный мир будет привязан к этому чату. Будет добавляться в промпт наряду с глобальным лорбуком и лором персонажа.",
19611960 "world_button_title": "Лор персонажа\n\nНажмите, чтобы загрузить\nShift + кликЛКМ, чтобы открыть диалог привязки мира",
19621961 "No auxillary Lorebooks set. Click here to select.": "Вспомогательный лорбук не выбран. Нажмите, чтобы выбрать.",
19631962 "ext_regex_user_input_desc": "Отправленные вами сообщения.",
19641963 "ext_regex_ai_input_desc": "Полученные от API ответы.",
@@ -2144,5 +2143,65 @@
21442143 "Not connected to the API!": "Нет соединения с API!",
21452144 "ext_type_system": "Это комплектное расширение. Его нельзя удалить, а обновляется оно вместе со всей системой.",
21462145 "Update all": "Обновить все",
21472146 "Close": "Закрыть",
2147+ "Optional modules:": "Необязательные модули:",
2148+ "Sort: Display Name": "Сортировать: по названию",
2149+ "Sort: Loading Order": "Сортировать: в порядке загрузки",
2150+ "Click to toggle": "Нажмите, чтобы включить или выключить",
2151+ "Loading Asset List": "Загрузить список ресурсов",
2152+ "Don't ask again for this URL": "Запомнить выбор для этого адреса",
2153+ "Are you sure you want to connect to the following url?": "Вы точно хотите подключиться к этому адресу?",
2154+ "All": "Всё",
2155+ "Characters": "Персонажи",
2156+ "Ambient sounds": "Звуковой эмбиент",
2157+ "Blip sounds": "Звуки уведомлений",
2158+ "Background music": "Фоновая музыка",
2159+ "Search": "Поиск",
2160+ "extension_install_1": "Чтобы загружать расширения из этого списка, у вас должен быть установлен ",
2161+ "extension_install_2": ".",
2162+ "extension_install_3": "Нажмите на иконку ",
2163+ "extension_install_4": ", чтобы перейти в репозиторий расширения и получить более подробную информацию о нём.",
2164+ "Extension repo/guide:": "Репозиторий расширения:",
2165+ "Preview in browser": "Предпросмотр",
2166+ "Adds a function tool": "Частично или полностью работает через вызов функций",
2167+ "Tool": "Функции",
2168+ "Move extension": "Переместить расширение",
2169+ "ext_type_local": "Это локальное расширение, доступно только вам",
2170+ "ext_type_global": "Это глобальное расширение, доступно всем пользователям",
2171+ "Move": "Переместить",
2172+ "Enter the Git URL of the extension to install": "Введите Git-адрес расширения",
2173+ "Please be aware that using external extensions can have unintended side effects and may pose security risks. Always make sure you trust the source before importing an extension. We are not responsible for any damage caused by third-party extensions.": "помните, что используя расширения от сторонних авторов, вы можете подвергать систему опасности. Устанавливайте расширения только от проверенных разработчиков. Мы не несём ответственности за любой ущерб, причинённый сторонними расширениями.",
2174+ "Disclaimer:": "Внимание:",
2175+ "Example:": "Пример:",
2176+ "context_derived": "Считывать из метаданных модели (по возможности)",
2177+ "instruct_derived": "Считывать из метаданных модели (по возможности)",
2178+ "Confirm token parsing with": "Чтобы убедиться в правильности выделения токенов, используйте",
2179+ "Reasoning Effort": "Рассуждения",
2180+ "Constrains effort on reasoning for reasoning models.": "Регулирует объём внутренних рассуждений модели (reasoning), для моделей которые поддерживают эту возможность.\nНа данный момент поддерживаются три значения: Подробные, Обычные, Поверхностные.\nПри менее подробном рассуждении ответ получается быстрее, а также экономятся токены, уходящие на рассуждения.",
2181+ "openai_reasoning_effort_low": "Поверхностные",
2182+ "openai_reasoning_effort_medium": "Обычные",
2183+ "openai_reasoning_effort_high": "Подробные",
2184+ "Persona Lore Alt+Click to open the lorebook": "Лорбук данной персоны\nAlt + ЛКМ чтобы открыть лорбук",
2185+ "Persona Lorebook for": "Лорбук для персоны",
2186+ "persona_world_template_txt": "Выбранная Информация о мире будет привязана к этой персоне. Информация будет добавляться в каждом промпте вместе с глобальным лорбуком и лорбуками персонажа и чата.",
2187+ "Global list": "Глобальный список",
2188+ "Preset-specific list": "Список для данного пресета",
2189+ "Banned tokens/strings are being sent in the request.": "Запрещённые токены и строки отсылаются в запросе.",
2190+ "Banned tokens/strings are NOT being sent in the request.": "Запрещённые токены и строки НЕ отсылаются в запросе.",
2191+ "Add a reasoning block": "Добавить блок рассуждений",
2192+ "Create a copy of this message?": "Продублировать это сообщение?",
2193+ "Max Recursion Steps": "Макс. глубина рекурсии",
2194+ "0 = unlimited, 1 = scans once and doesn't recurse, 2 = scans once and recurses once, etc": "0 = неограничено, 1 = сканировать единожды, 2 = сканировать единожды и сделать один повторный проход, и т.д.\n(неактивно при указанном мин. числе активаций)",
2195+ "(disabled when max recursion steps are used)": "(неактивно при указанной макс. глубине рекурсии)",
2196+ "Enter a valid API URL": "Введите корректный адрес API",
2197+ "No Ollama model selected.": "Не выбрана модель Ollama",
2198+ "Background Fitting": "Способ подгонки фона под разрешение",
2199+ "Chat Lore Alt+Click to open the lorebook": "Лорбук данного чата\nAlt + ЛКМ чтобы открыть лорбук",
2200+ "Token Counter": "Подсчитать токены",
2201+ "Type / paste in the box below to see the number of tokens in the text.": "Введите или вставьте текст в окошко ниже, чтобы подсчитать количество токенов в нём.",
2202+ "Selected tokenizer:": "Выбранный токенайзер:",
2203+ "Input:": "Входные данные:",
2204+ "Tokenized text:": "Токенизированный текст:",
2205+ "Token IDs:": "Идентификаторы токенов:",
2206+ "Tokens:": "Токенов:"
21482207}
public/locales/uk-ua.json+3 -3
@@ -558,7 +558,7 @@
558558 "Delete a theme": "Видалити тему",
559559 "Update a theme file": "Оновити файл теми",
560560 "Save as a new theme": "Зберегти як нову тему",
561561 "Avatar Style:": "Стиль аватара",
562562 "Circle": "Коло",
563563 "Square": "Квадрат",
564564 "Rectangle": "Прямокутник",
@@ -633,7 +633,7 @@
633633 "Prefer Character Card Prompt": "Перевага запиту персонажа",
634634 "If checked and the character card contains a jailbreak override (Post History Instruction), use that instead": "Якщо відмічено і картка персонажа містить заміну джейлбрейку (Інструкцію), використовуйте її замість цього",
635635 "Prefer Character Card Jailbreak": "Перевага джейлбрейку персонажа",
636636 "Avoid cropping and resizing imported character images. When off, crop/resize to 512x768never_resize_avatars_tooltip": "Уникайте обрізання та зміни розміру імпортованих зображень символів. Коли вимкнено, обрізати/змінити розмір до 512x768.",
637637 "Never resize avatars": "Ніколи не змінювати розмір аватарів",
638638 "Show actual file names on the disk, in the characters list display only": "Показувати фактичні назви файлів на диску, тільки у відображенні списку персонажів",
639639 "Show avatar filenames": "Показувати імена файлів аватарів",
@@ -709,7 +709,7 @@
709709 "Auto-swipe": "Автоматичний змах",
710710 "Enable the auto-swipe function. Settings in this section only have an effect when auto-swipe is enabled": "Вмикає функцію автоматичного змаху. Налаштування в цьому розділі діють лише тоді, коли увімкнено автоматичний змах",
711711 "Minimum generated message length": "Мінімальна довжина згенерованого повідомлення",
712712 "If the generated message is shorter than thisthese many characters, trigger an auto-swipe": "Якщо згенероване повідомлення коротше за це, викликайте автоматичний змаху",
713713 "Blacklisted words": "Список заборонених слів",
714714 "words you dont want generated separated by comma ','": "слова, які ви не хочете генерувати, розділені комою ','",
715715 "Blacklisted word count to swipe": "Кількість заборонених слів для змаху",
public/locales/vi-vn.json+3 -3
@@ -558,7 +558,7 @@
558558 "Delete a theme": "Xóa một chủ đề",
559559 "Update a theme file": "Cập nhật một tập tin chủ đề",
560560 "Save as a new theme": "Lưu dưới dạng chủ đề mới",
561561 "Avatar Style:": "Kiểu hình đại diện",
562562 "Circle": "Hình tròn",
563563 "Square": "Hình vuông",
564564 "Rectangle": "Hình chữ nhật",
@@ -633,7 +633,7 @@
633633 "Prefer Character Card Prompt": "Ưu tiên Gợi ý từ Card",
634634 "If checked and the character card contains a jailbreak override (Post History Instruction), use that instead": "Nếu được kiểm tra và thẻ nhân vật chứa một lệnh phá vỡ giam giữ (Hướng dẫn Lịch sử Bài viết), hãy sử dụng thay vào đó",
635635 "Prefer Character Card Jailbreak": "Ưu tiên Jailbreak từ Card",
636636 "Avoid cropping and resizing imported character images. When off, crop/resize to 512x768never_resize_avatars_tooltip": "Tránh cắt xén và thay đổi kích thước hình ảnh ký tự đã nhập. Khi tắt, hãy cắt/thay đổi kích thước thành 512x768.",
637637 "Never resize avatars": "Không bao giờ thay đổi kích thước hình đại diện",
638638 "Show actual file names on the disk, in the characters list display only": "Hiển thị tên tệp thực tế trên đĩa, chỉ trong danh sách nhân vật",
639639 "Show avatar filenames": "Hiển thị tên tệp hình đại diện",
@@ -709,7 +709,7 @@
709709 "Auto-swipe": "Tự động vuốt",
710710 "Enable the auto-swipe function. Settings in this section only have an effect when auto-swipe is enabled": "Bật chức năng tự động vuốt. Các cài đặt trong phần này chỉ có tác dụng khi tự động vuốt được bật",
711711 "Minimum generated message length": "Độ dài tối thiểu của tin nhắn được tạo",
712712 "If the generated message is shorter than thisthese many characters, trigger an auto-swipe": "Nếu tin nhắn được tạo ra ngắn hơn điều này, kích hoạt tự động vuốt",
713713 "Blacklisted words": "Từ trong danh sách đen",
714714 "words you dont want generated separated by comma ','": "các từ bạn không muốn được tạo ra được phân tách bằng dấu phẩy ','",
715715 "Blacklisted word count to swipe": "Số từ trong danh sách đen để vuốt",
public/locales/zh-cn.json+102 -41
@@ -2,7 +2,7 @@
22 "Favorite": "星标",
33 "Tag": "标签",
44 "Duplicate": "复制",
55 "Persona": "角色用户角色",
66 "Delete": "删除",
77 "AI Response Configuration": "AI响应配置",
88 "AI Configuration panel will stay open": "AI配置面板将保持打开",
@@ -203,6 +203,7 @@
203203 "Ignore EOS Token": "忽略序列结束词符",
204204 "Ignore the EOS Token even if it generates.": "即使生成了序列结束词符,也忽略它。",
205205 "Skip Special Tokens": "跳过特殊词符",
206+ "Request Model Reasoning": "Request Model Reasoning",
206207 "Temperature Last": "温度放最后",
207208 "Temperature_Last_desc": "温度采样器放到最后使用。这通常是合理的。\n当启用时:首先进行潜在词符的选择,然后应用温度来修正它们的相对概率(技术上是对数似然)。\n当禁用时:首先应用温度来修正所有词符的相对概率,然后从中选择潜在词符。\n禁用此项可以增大分布在尾部的词符概率,这可能加大得到不相关回复的几率。",
208209 "Speculative Ngram": "推测性 Ngram",
@@ -210,7 +211,9 @@
210211 "Spaces Between Special Tokens": "特殊词符之间的空格",
211212 "Seed_desc": "一个用于生成确定性和可复现的输出的随机种子。设置为 -1 时会使用随机种子。",
212213 "LLaMA / Mistral / Yi models only": "LLaMA / Mistral / Yi模型专用。首先确保您选择了适当的词符化器。\n这项设置决定了你不想在结果中看到的字符串。\n每行一个字符串。可以是文本或者[词符id]。\n许多词符以空格开头。如果不确定,请使用词符计数器。",
214+ "Global list": "Global list",
213215 "Example: some text [42, 69, 1337]": "例如:\n一些文本\n[42, 69, 1337]",
216+ "Preset-specific list": "Preset-specific list",
214217 "CFG": "CFG",
215218 "Classifier Free Guidance. More helpful tip coming soon": "无分类器指导(CFG)。更多有用的提示敬请期待。",
216219 "Scale": "缩放比例",
@@ -255,11 +258,11 @@
255258 "enable_functions_desc_1": "允许使用",
256259 "enable_functions_desc_2": "功能工具",
257260 "enable_functions_desc_3": "可以被各种扩展利用来提供附加功能。",
258261 "Send inline images": "发送内联图像发送图片",
259262 "image_inlining_hint_1": "如果模型支持,则在提示词中发送图像就可以在提示词中发送图片(例如 GPT-4V、Claude 3 或 Llava 13B)。\n对任何消息使用n发送消息时,点击",
260263 "image_inlining_hint_2": "在这里(",
261264 "image_inlining_hint_3": "菜单将图像文件附加到聊天中)将图片添加到消息中。",
262265 "Inline Image Quality": "内联图像质量图片画质",
263266 "openai_inline_image_quality_auto": "自动",
264267 "openai_inline_image_quality_low": "低",
265268 "openai_inline_image_quality_high": "高",
@@ -268,6 +271,11 @@
268271 "Merges_all_system_messages_desc_2": "字段发送。",
269272 "Request model reasoning": "请求思维链",
270273 "Allows the model to return its thinking process.": "允许模型返回其思维过程。",
274+ "Constrains effort on reasoning for reasoning models.": "限定模型推理的强度。\n当前支持低、中、高三种强度。\n降低推理强度可以让模型更快回复,并节省推理所用的词符数。。",
275+ "Reasoning Effort": "推理强度",
276+ "openai_reasoning_effort_low": "低",
277+ "openai_reasoning_effort_medium": "中",
278+ "openai_reasoning_effort_high": "高",
271279 "Assistant Prefill": "AI预填",
272280 "Expand the editor": "展开编辑器",
273281 "Start Claude's answer with...": "以如下内容开始Claude的回答...",
@@ -328,7 +336,8 @@
328336 "Click Authorize below or get the key from": "点击下方授权或从以下位置获取密钥",
329337 "View Remaining Credits": "查看剩余额度",
330338 "OpenRouter Model": "OpenRouter 模型",
331339 "Model Providers": "模型提供者模型提供商",
340+ "Automatically chooses an alternative provider if chosen providers can't serve your request.": "在当前选择的模型提供商无效时,自动选择备用的提供商。",
332341 "Allow fallback providers": "允许后备提供者",
333342 "InfermaticAI API Key": "InfermaticAI API 密钥",
334343 "InfermaticAI Model": "InfermaticAI 模型",
@@ -374,7 +383,7 @@
374383 "Use an admin API key.": "使用管理员API密钥。",
375384 "koboldcpp API key (optional)": "koboldcpp API 密钥(可选)",
376385 "Example: 127.0.0.1:5001": "示例:127.0.0.1:5001",
377386 "Bypass status check": "绕过状态检查跳过状态检查",
378387 "Derive context size from backend": "从后端获取上下文长度",
379388 "Authorize": "授权",
380389 "Get your OpenRouter API token using OAuth flow. You will be redirected to openrouter.ai": "使用OAuth流程获取您的OpenRouter API令牌。您将被重定向到openrouter.ai",
@@ -389,8 +398,8 @@
389398 "This will show up as your saved preset.": "这将显示为您保存的预设。",
390399 "Proxy Server URL": "代理服务器 URL",
391400 "Alternative server URL (leave empty to use the default value).": "备用服务器 URL(留空以使用默认值)。",
392401 "Doesn't work? Try adding": "不起作用?尝试添加在末尾添加",
393402 "at the end!": "试试!",
394403 "Proxy Password": "代理密码",
395404 "Will be used as a password for the proxy instead of API key.": "将用作代理的密码,而不是 API 密钥。",
396405 "Peek a password": "查看密码",
@@ -411,6 +420,7 @@
411420 "Anthropic's developer console": "Anthropic 开发者控制台",
412421 "Claude Model": "Claude 模型",
413422 "Window AI Model": "Window AI 模型",
423+ "Use extension settings": "使用扩展程序中的设定",
414424 "Allow fallback routes Description": "如果所选模型无法响应您的请求,则自动选择备用模型。",
415425 "Allow fallback models": "允许后备模型",
416426 "Model Order": "OpenRouter 模型顺序",
@@ -419,6 +429,7 @@
419429 "Context Size": "上下文长度",
420430 "Group by vendors": "按厂商分组",
421431 "Group by vendors Description": "将 OpenAI 模型放在一组,将 Anthropic 模型放在另一组,等等。可以与排序结合。",
432+ "To use instruct formatting, switch to OpenRouter under Text Completion API.": "To use instruct formatting, switch to OpenRouter under Text Completion API.",
422433 "Scale API Key": "Scale API密钥",
423434 "Clear your cookie": "清除你的 Cookie",
424435 "Alt Method": "备用方法",
@@ -442,7 +453,6 @@
442453 "Select a Model": "选择一个模型",
443454 "Custom Endpoint (Base URL)": "自定义端点(基础 URL)",
444455 "Example: http://localhost:1234/v1": "例如:http://localhost:1234/v1",
445- "at the end of the URL!": "到 URL 的末尾!",
446456 "Custom API Key": "自定义 API 密钥",
447457 "(Optional)": "(可选)",
448458 "Enter a Model ID": "输入模型名",
@@ -466,9 +476,9 @@
466476 "AI Response Formatting": "AI回复格式化",
467477 "Advanced Formatting": "高级格式化设置",
468478 "Import Advanced Formatting settings": "导入高级格式化设置\n\n对于指导和上下文模板,你也可以提供旧版文件。",
469479 "Master Import": "Master Import全局导入",
470480 "Export Advanced Formatting settings": "导出高级格式化设置",
471481 "Master Export": "Master Export全局导出",
472482 "Context Template": "上下文模板",
473483 "context_derived": "若可能,从模型的元数据获取。",
474484 "Select your current Context Template": "选择你当前的上下文模板",
@@ -508,7 +518,7 @@
508518 "Skip Example Dialogues Formatting": "跳过示例对话格式化",
509519 "Include Names": "包括名称",
510520 "Never": "永不",
511521 "Groups and Past Personas": "Groups and Past Personas群聊和过去的用户角色",
512522 "Always": "永远",
513523 "Instruct Sequences": "指令序列",
514524 "User Message Sequences": "用户消息序列",
@@ -561,6 +571,24 @@
561571 "JSON serialized array of strings": "JSON序列化的字符串数组",
562572 "Replace Macro in Stop Strings": "替换自定义停止字符串中的宏",
563573 "Token Padding": "词符填充",
574+ "Reasoning": "推理",
575+ "reasoning_auto_parse": "Automatically parse reasoning blocks from main content between the reasoning prefix/suffix. Both fields must be defined and non-empty.",
576+ "Auto-Parse": "自动解析",
577+ "reasoning_auto_expand": "自动展开推理内容块。",
578+ "Auto-Expand": "自动展开",
579+ "reasoning_show_hidden": "对于隐藏推理内容的模型,展示其推理用时。",
580+ "Show Hidden": "显示隐藏内容",
581+ "reasoning_add_to_prompts": "将已有的推理块添加到提示词。若需新增一个推理块,请使用消息编辑菜单。",
582+ "Add to Prompts": "添加到提示词",
583+ "reasoning_max_additions": "Maximum number of reasoning blocks to be added per prompt, counting from the last message.",
584+ "Max": "最大值",
585+ "Reasoning Formatting": "推理内容格式化",
586+ "reasoning_prefix": "插入在推理内容之前。",
587+ "Prefix": "前缀",
588+ "reasoning_suffix": "插入在推理内容之后。",
589+ "Suffix": "后缀",
590+ "reasoning_separator": "插入在推理内容和消息内容之间。",
591+ "Separator": "分隔符",
564592 "Miscellaneous": "杂项",
565593 "Non-markdown strings": "非 Markdown 字符串",
566594 "comma delimited,no spaces between": "以逗号分隔,无需空格",
@@ -584,7 +612,7 @@
584612 "(0 = unlimited, use budget)": "(“0”为无限制,使用预算)",
585613 "Cap the number of entry activation recursions": "限制条目激活递归的次数",
586614 "Max Recursion Steps": "最大递归深度",
587615 "0 = unlimited, 1 = scans once and doesn't recurse, 2 = scans once and recurses once, etc\\n(disabled when min activations are used)": "“0”为无限制,“1”为扫描一次且不递归,“2”为扫描一次且递归一次,依此类推\n(当使用最小激活次数时,此功能被禁用)",
588616 "Insertion Strategy": "插入策略",
589617 "Sorted Evenly": "均匀排序",
590618 "Character Lore First": "角色世界书优先",
@@ -639,7 +667,7 @@
639667 "Delete a theme": "删除主题",
640668 "Update a theme file": "更新主题文件",
641669 "Save as a new theme": "另存为新主题",
642670 "Avatar Style:": "头像样式",
643671 "Circle": "圆形",
644672 "Square": "正方形",
645673 "Rectangle": "矩形",
@@ -713,16 +741,16 @@
713741 "Defines on importing cards which action should be chosen for importing its listed tags. 'Ask' will always display the dialog.": "定义在导入卡片时应选择哪种操作来导入其列出的标签。“询问”将始终显示对话框。",
714742 "Import Card Tags": "导入卡片标签",
715743 "Ask": "询问",
716744 "tag_import_none": "不导入",
717745 "tag_import_all": "全部导入全部",
718746 "Existingtag_import_existing": "现存的仅导入现有的",
719747 "Use fuzzy matching, and search characters in the list by all data fields, not just by a name substring": "使用模糊匹配,在列表中通过所有数据字段搜索角色,而不仅仅是名称子字符串",
720748 "Advanced Character Search": "高级角色搜索",
721749 "If checked and the character card contains a prompt override (System Prompt), use that instead": "开启后,如果角色卡已包含系统提示词,则覆盖当前的系统提示词。",
722750 "Prefer Character Card Prompt": "角色卡提示词优先",
723751 "If checked and the character card contains a Post-History Instructions override, use that instead": "开启后,如果角色卡包含后历史指令覆盖,则使用它。",
724752 "Prefer Character Card Instructions": "首选角色卡说明",
725753 "Avoid cropping and resizing imported character images. When off, crop/resize to 512x768never_resize_avatars_tooltip": "避免裁剪和调整导入的角色图像的大小。关闭时,裁剪/调整大小为 512x768。",
726754 "Never resize avatars": "永不调整头像大小",
727755 "Show actual file names on the disk, in the characters list display only": "在角色列表显示中,显示磁盘上实际的文件名。",
728756 "Show avatar filenames": "显示头像文件名",
@@ -751,7 +779,7 @@
751779 "Restore User Input": "恢复用户输入",
752780 "Allow repositioning certain UI elements by dragging them. PC only, no effect on mobile": "允许通过拖动重新定位某些UI元素。仅适用于PC,对移动设备无影响",
753781 "Movable UI Panels": "可移动 UI 面板",
754782 "Reset MovingUI panel sizes/locations.": "重置 MovingUI可移动UI 面板大小/位置。",
755783 "mui_reset": "Reset",
756784 "MovingUI preset. Predefined/saved draggable positions": "可移动UI预设。预定义/保存的可拖动位置",
757785 "MUI Preset": "可移动 UI 预设",
@@ -759,7 +787,7 @@
759787 "Apply a custom CSS style to all of the ST GUI": "将自定义CSS样式应用于所有ST GUI",
760788 "Custom CSS": "自定义 CSS",
761789 "Chat/Message Handling": "聊天/消息处理",
762790 "# Messages to Load": "要加载 # 要加载的消息条消息",
763791 "The number of chat history messages to load before pagination.": "分页前要加载的聊天历史消息数。",
764792 "(0 = All)": "(“0”为全部)",
765793 "Streaming FPS": "流式传输帧速率",
@@ -804,11 +832,12 @@
804832 "Auto-swipe": "自动滑动",
805833 "Enable the auto-swipe function. Settings in this section only have an effect when auto-swipe is enabled": "启用自动滑动功能。仅当启用自动滑动时,本节中的设置才会生效",
806834 "Minimum generated message length": "生成的消息的最小长度",
807835 "If the generated message is shorter than thisthese many characters, trigger an auto-swipe": "如果生成的消息短于此长度,则触发自动滑动",
808836 "Blacklisted words": "屏蔽词",
809837 "words you dont want generated separated by comma ','": "不想生成的词语,用半角逗号“,”分隔",
810838 "Blacklisted word count to swipe": "触发滑动的黑名单词语数量",
811839 "Minimum number of blacklisted words detected to trigger an auto-swipe": "触发自动滑动刷新回复所需检测到的最少违禁词数量。",
840+ "Automatically 'continue' a response if the model stopped before reaching a certain amount of tokens.": "当回复没有达到特定词符数时,自动让模型“继续”这个回复。",
812841 "Auto-Continue": "自动继续",
813842 "Allow for Chat Completion APIs": "允许使用聊天补全API",
814843 "Target length (tokens)": "目标长度(以词符数计)",
@@ -843,12 +872,12 @@
843872 "Change Background Image": "更改背景图片",
844873 "Background Image": "背景图片",
845874 "Filter": "搜索",
846875 "Background Fitting": "Background Fitting背景图片尺寸",
847876 "Classic": "Classic经典",
848877 "Cover": "Cover填充",
849878 "Contain": "Contain不变换",
850879 "Stretch": "Stretch拉伸",
851880 "Center": "Center居中",
852881 "Automatically select a background based on the chat context": "根据聊天上下文自动选择背景",
853882 "Auto-select": "自动选择",
854883 "System Backgrounds": "系统背景",
@@ -930,6 +959,7 @@
930959 "Search / Create Tags": "搜索/创建标签",
931960 "View all tags": "查看所有标签",
932961 "Creator's Notes": "创作者的注释",
962+ "Character details are hidden.": "角色详情已隐藏。",
933963 "Show / Hide Description and First Message": "显示/隐藏描述和第一条消息",
934964 "Character Description": "角色描述",
935965 "Click to allow/forbid the use of external media for this character.": "单击以允许/禁止此角色使用外部媒体。",
@@ -1054,6 +1084,7 @@
10541084 "Drag to reorder tag": "拖动以排序",
10551085 "Use tag as folder": "标记为文件夹",
10561086 "Delete tag": "删除标签",
1087+ "Toggle entry's active state.": "切换条目激活状态。",
10571088 "Entry Title/Memo": "条目标题/备忘录",
10581089 "WI Entry Status:🔵 Constant🟢 Normal🔗 Vectorized": "世界书条目状态:\r🔵 永久\r🟢 关键词\r🔗 向量化",
10591090 "WI_Entry_Status_Constant": "永久",
@@ -1072,7 +1103,7 @@
10721103 "Depth": "深度",
10731104 "Order:": "顺序:",
10741105 "Order": "顺序",
10751106 "Trigger %:": "触发 %:",
10761107 "Duplicate world info entry": "重复的世界信息条目",
10771108 "Delete world info entry": "删除世界信息条目",
10781109 "Comma separated (required)": "逗号分隔(必填)",
@@ -1154,7 +1185,7 @@
11541185 "Message Actions": "消息操作",
11551186 "Translate message": "翻译消息",
11561187 "Generate Image": "生成图片",
11571188 "Narrate": "叙述朗读",
11581189 "Exclude message from prompts": "从提示词中排除消息",
11591190 "Include message in prompts": "将消息包含在提示词中",
11601191 "Embed file or image": "嵌入文件或图像",
@@ -1165,9 +1196,16 @@
11651196 "Edit": "编辑",
11661197 "Confirm": "确认",
11671198 "Copy this message": "复制此消息",
1199+ "Add a reasoning block": "添加一个推理块",
11681200 "Delete this message": "删除此消息",
11691201 "Move message up": "将消息上移",
11701202 "Move message down": "将消息下移",
1203+ "Thought for some time": "思考了一会",
1204+ "Confirm Edit": "确认",
1205+ "Remove reasoning": "删除推理内容",
1206+ "Cancel edit": "Cancel edit",
1207+ "Copy reasoning": "复制推理内容",
1208+ "Edit reasoning": "编辑推理内容",
11711209 "Enlarge": "放大",
11721210 "Caption": "标题",
11731211 "Swipe left": "Swipe left",
@@ -1266,6 +1304,10 @@
12661304 "Regenerate": "重新生成",
12671305 "Impersonate": "AI 帮答",
12681306 "Continue": "继续",
1307+ "extension_install_1": "若想从此页安装扩展程序,你需要提前安装",
1308+ "extension_install_2": "。",
1309+ "extension_install_3": "点这个图标(",
1310+ "extension_install_4": ")前往扩展程序的代码仓库以了解如何使用它。",
12691311 "These characters are the winners of character design contests and have outstandable quality.": "这些角色都是角色设计大赛的获奖者,品质非常出色。",
12701312 "Contest Winners": "比赛获胜者",
12711313 "These characters are the finalists of character design contests and have remarkable quality.": "这些角色都是角色设计大赛的入围作品,品质十分出色。",
@@ -1334,9 +1376,11 @@
13341376 "macro)": "宏指令)",
13351377 "Automatically caption images": "自动为图像添加标题",
13361378 "Edit captions before saving": "保存前编辑标题",
1379+ "Included settings:": "包含的设置:",
1380+ "{{@key}}": "{{@key}}:",
13371381 "Profile name:": "配置名称:",
13381382 "Creating a Connection Profile": "新建API连接配置",
1339- "{{@key}}": "{{@key}}:",
1383+ "Click on the setting name to omit it from the profile.": "点击设置名称以将其从连接配置中删除。",
13401384 "Enter a name:": "输入名字:",
13411385 "Connection Profile": "API连接配置",
13421386 "View connection profile details": "查看API连接配置详情",
@@ -1345,14 +1389,17 @@
13451389 "Edit a connection profile": "编辑API连接配置",
13461390 "Reload a connection profile": "重载API连接配置",
13471391 "Delete a connection profile": "删除API连接配置",
13481392 "Omitted Settings:": "Omitted Settings:排除的设置:",
13491393 "Character Expressions": "角色表情",
1394+ "Use the selected API from Chat Translation extension settings.": "使用聊天翻译扩展程序中已选择的API。",
13501395 "Translate text to English before classification": "分类之前将文本翻译成英文",
1351- "Show default images (emojis) if sprite missing": "如果表情包缺失,则显示默认图像(表情符号)",
1396+ "A single expression can have multiple sprites. Whenever the expression is chosen, a random sprite for this expression will be selected.": "A single expression can have multiple sprites. Whenever the expression is chosen, a random sprite for this expression will be selected.",
13521397 "ImageAllow Typemultiple -sprites talkingheadper (extras)expression": "图像类型Allow -multiple 说话头像(附加内容)sprites per expression",
1398+ "If the same expression is used again, re-roll the sprite. This only applies to expressions that have multiple available sprites assigned.": "If the same expression is used again, re-roll the sprite. This only applies to expressions that have multiple available sprites assigned.",
1399+ "Re-roll if same expression is used again": "Re-roll if same sprite is used again",
13531400 "Classifier API": "分类器 API",
13541401 "Select the API for classifying expressions.": "选择用于对表达式进行分类的API。",
13551402 "Main API": "主要当前连接的 API",
13561403 "WebLLM Extension": "WebLLM Extension",
13571404 "LLM Prompt": "大语言模型提示词",
13581405 "Will be used if the API doesn't support JSON schemas or function calling.": "如果 API 不支持 JSON 模式或函数调用,则会使用它。",
@@ -1372,6 +1419,10 @@
13721419 "Put images with expressions there. File names should follow the pattern:": "将带有表情的图像放在那里。文件名应遵循以下模式:",
13731420 "expression_label_pattern": "[表达式标签].[图像格式]",
13741421 "Sprite set:": "表情集:",
1422+ "upload_expression_request": "请输入表情名称(不用加后缀)。",
1423+ "upload_expression_naming_1": "素材名称必须符合所选表情 {{expression}} 的命名规范",
1424+ "upload_expression_naming_2": "当存在多个表情时,名称应由表情名称与合法后缀构成,允许使用横杠'-'或英文句号'.'作为分隔符。",
1425+ "upload_expression_replace": "点击“替换”以替换当前表情:",
13751426 "Show Gallery": "展示图库",
13761427 "ext_sum_title": "总结",
13771428 "ext_sum_with": "总结如下:",
@@ -1494,6 +1545,7 @@
14941545 "ext_regex_slash_desc": "通过 STscript 命令发送的消息。",
14951546 "Slash Commands": "快捷命令",
14961547 "ext_regex_wi_desc": "知识书/世界书 条目的内容。需要勾选“仅格式提示词”!",
1548+ "ext_regex_reasoning_desc": "推理块内容。当'仅格式提示词'被选中时,它会影响提示词里的推理内容。",
14971549 "ext_regex_min_depth_desc": "当应用于提示或显示时,仅影响深度至少为 N 级的消息。“0”为最后一条消息,“1”为倒数第二条消息等。仅计算 WI 条目 @Depth 和可用消息,即非隐藏或系统消息。",
14981550 "Min Depth": "最小深度",
14991551 "ext_regex_min_depth_placeholder": "无限",
@@ -1621,6 +1673,13 @@
16211673 "Interactive Mode": "交互模式",
16221674 "Function Tool": "Function Tool",
16231675 "Image Prompt Templates": "图像提示模板",
1676+ "Token Counter": "词符计数器",
1677+ "Type / paste in the box below to see the number of tokens in the text.": "在下方框中输入或粘贴你想要统计词符数量的文本。",
1678+ "Selected tokenizer:": "已选分词器:",
1679+ "Input:": "输入:",
1680+ "Tokens:": "词符:",
1681+ "Tokenized text:": "词符化文本:",
1682+ "Token IDs:": "词符ID:",
16241683 "ext_translate_btn_chat": "翻译聊天",
16251684 "ext_translate_btn_input": "翻译输入",
16261685 "ext_translate_delete_confirm_1": "你确定吗?",
@@ -1640,11 +1699,12 @@
16401699 "Auto Generation": "自动生成",
16411700 "Requires auto generation to be enabled.": "需要启用自动生成功能。",
16421701 "Narrate by paragraphs (when streaming)": "按段朗读(流式播放时)",
1702+ "Narrate by paragraphs (when not streaming)": "按段朗读(非流式播放时)",
16431703 "Only narrate quotes": "只朗读引号内文本",
16441704 "Ignore text, even quotes, inside asterisk": "不朗读所有*星号内文本*,即使其被引号包裹",
16451705 "Narrate only the translated text": "只朗读翻译后文本",
16461706 "Skip codeblocks": "跳过代码块",
16471707 "Skip tagged blocks": "跳过标签化的块跳过标签块里的内容(<tagged标签>跳过这里</标签>)",
16481708 "Pass Asterisks to TTS Engine": "将星号传递给文本转语音服务",
16491709 "Audio Playback Speed": "音频播放速度",
16501710 "Vector Storage": "向量存储",
@@ -1666,6 +1726,7 @@
16661726 "Max Entries": "最大条目数",
16671727 "File vectorization settings": "文件向量化设置",
16681728 "Enable for files": "为文件启用",
1729+ "Only chunk on custom boundary": "仅按自定义边界分块",
16691730 "Translate files into English before processing": "处理之前将文件翻译成英文",
16701731 "Message attachments": "消息附件",
16711732 "Size threshold (KB)": "大小阈值(KB)",
@@ -1855,7 +1916,6 @@
18551916 "Total Tokens in Prompt:": "提示词的总Token数量:",
18561917 "Max Context": "最大上下文:",
18571918 "(Context Size - Response Length)": "(上下文长度 - 回复长度)",
1858- ":": ":",
18591919 "System-wide Replacement Macros (in order of evaluation):": "系统范围的替换宏(按评估顺序):",
18601920 "help_macros_1": "仅适用于斜线命令批处理。替换为上一个命令的返回结果。",
18611921 "help_macros_2": "仅插入一个换行符。",
@@ -1873,18 +1933,19 @@
18731933 "help_macros_14": "未格式化的对话示例",
18741934 "(only for Story String)": "(仅适用于故事字符串)",
18751935 "help_macros_summary": "“Summarize”扩展生成的最新聊天摘要(如果有)。",
18761936 "help_macros_15": "您当前的 Persona 用户名您当前的用户角色名称",
18771937 "help_macros_16": "角色的名字",
18781938 "help_macros_17": "角色的版本号",
18791939 "help_macros_18": "以逗号分隔的群成员名称列表或单人聊天中的角色名称。别名:{{charIfNotGroup}}",
18801940 "help_groupNotMuted": "与 {{group}} 相同,但排除被禁言的成员",
18811941 "help_macros_19": "当前选定的 API 的文本生成模型名称。",
18821942 "Can be inaccurate!": "可能不准确不一定准确!",
18831943 "help_macros_20": "最新聊天消息的文本。",
18841944 "help_macros_lastUser": "最后的用户聊天消息文本。",
18851945 "help_macros_lastChar": "最后的角色聊天消息文本。",
18861946 "help_macros_21": "最新聊天消息的索引号。对于斜线命令批处理很有用。",
18871947 "help_macros_22": "上下文中包含的第一条消息的 ID。要求在当前会话中至少运行一次生成。",
1948+ "help_macros_firstDisplayedMessageId": "第一条载入可见聊天的消息的ID",
18881949 "help_macros_23": "最后一条聊天消息中当前滑动的 ID(以 1 为基数)。如果最后一条消息是用户或提示隐藏的,则为空字符串。",
18891950 "help_macros_24": "最后一条聊天消息中的滑动次数。如果最后一条消息是用户隐藏或提示隐藏的,则为空字符串。",
18901951 "help_macros_reverse": "反转宏的内容。",
@@ -2041,7 +2102,7 @@
20412102 "in the chat bar": "至聊天框",
20422103 "SillyTavern Documentation Site": "访问 SillyTavern 帮助文档",
20432104 "Still have questions?": "仍有疑问?",
20442105 "Join the SillyTavern Discord": "加入 SillyTavern Discord群组",
20452106 "Post a GitHub issue": "在 GitHub 发布问题",
20462107 "Contact the developers": "联系开发者",
20472108 "If you're connected to an API, try asking me something!": "若您已经配置好API,尝试发送些什么吧!",
public/locales/zh-tw.json+504 -333
@@ -4,23 +4,23 @@
44 "Duplicate": "複製",
55 "Persona": "使用者角色",
66 "Delete": "刪除",
77 "AI Response Configuration": "設定 AI 回應回應設定",
88 "AI Configuration panel will stay open": "上鎖 = AI 設定面板將保持開啟",
99 "clickslidertips": "點選滑桿數字可手動輸入點選滑桿旁的數字以手動輸入。",
1010 "MAD LAB MODE ON": "瘋狂實驗室模式",
1111 "Documentation on sampling parameters": "取樣參數的說明文件。",
1212 "kobldpresets": "Kobold 預設設定檔",
1313 "guikoboldaisettings": "GUI KoboldAI 設定",
1414 "Update current preset": "更新預設更新預設設定檔",
1515 "Save preset as": "另存新預設另存新預設設定檔",
1616 "Import preset": "匯入預設匯入預設設定檔",
1717 "Export preset": "匯出預設設定檔",
1818 "Restore current preset": "還原目前預設還原目前預設設定檔",
1919 "Delete the preset": "刪除預設刪除預設設定檔",
2020 "novelaipresets": "NovelAI 預設設定檔",
2121 "Default": "預設",
2222 "openaipresets": "OpenAI 預設設定檔",
2323 "Text Completion presets": "文本補全預設文字補全預設設定檔",
2424 "AI Module": "AI 模組",
2525 "Changes the style of the generated text.": "變更生成文字的樣式。",
2626 "No Module": "無模組",
@@ -35,7 +35,7 @@
3535 "Only enable this if your model supports context sizes greater than 8192 tokens": "僅在您的模型支援超過 8192 個符元的上下文長度時啟用此功能",
3636 "Max prompt cost:": "最大提示詞費用:",
3737 "Display the response bit by bit as it is generated.": "逐字顯示生成中的回應內容。",
3838 "When this is off, responses will be displayed all at once when they are complete.": "關閉時,回應將在生成完成後一次性顯示回應將在生成完成後一次全部顯示。",
3939 "Temperature": "溫度",
4040 "rep.pen": "重複懲罰",
4141 "Rep. Pen. Range.": "重複懲罰範圍",
@@ -51,7 +51,7 @@
5151 "Aggressive": "積極",
5252 "Very aggressive": "非常積極",
5353 "Unlocked Context Size": "解鎖上下文長度",
5454 "Unrestricted maximum value for the context slider": "不限制上下文滑桿最大值不限制上下文長度的最大值",
5555 "Context Size (tokens)": "上下文長度(符元數)",
5656 "Max Response Length (tokens)": "最大回應長度(符元數)",
5757 "Multiple swipes per generation": "每次生成多次滑動",
@@ -71,7 +71,7 @@
7171 "Utility Prompts": "實用提示詞",
7272 "Impersonation prompt": "AI 扮演提示詞",
7373 "Restore default prompt": "還原預設提示詞",
7474 "Prompt that is used for Impersonation function": "用於 AI 模仿功能的提示詞扮演使用者」功能的提示詞",
7575 "World Info Format Template": "世界資訊格式",
7676 "Restore default format": "還原預設格式",
7777 "Wraps activated World Info entries before inserting into the prompt.": "在插入提示詞前包裝已啟用的世界資訊條目。",
@@ -79,8 +79,8 @@
7979 "scenario_format_template_part_2": "來標示要插入內容的位置。",
8080 "Scenario Format Template": "場景格式",
8181 "Personality Format Template": "個性格式",
8282 "Group Nudge Prompt Template": "群組推動提示詞範本群組聊天格式微調",
8383 "Sent at the end of the group chat history to force reply from a specific character.": "在群組聊天歷史結束時發送以強制特定角色回覆在群組聊天歷史結束時傳送以強制特定角色回覆",
8484 "New Chat": "新聊天",
8585 "Restore new chat prompt": "還原新聊天的提示詞",
8686 "Set at the beginning of the chat history to indicate that a new chat is about to start.": "設定在聊天歷史的開頭以表明即將開始新的聊天",
@@ -89,17 +89,17 @@
8989 "Set at the beginning of the chat history to indicate that a new group chat is about to start.": "設定在聊天歷史的開頭以表明即將開始新的群組聊天",
9090 "New Example Chat": "新範例聊天",
9191 "Set at the beginning of Dialogue examples to indicate that a new example chat is about to start.": "設定在對話範例的開頭以表明即將開始新的範例聊天",
9292 "Continue nudge": "繼續輔助提示詞繼續輔助微調",
9393 "Set at the end of the chat history when the continue button is pressed.": "按下繼續按鈕時設定在聊天歷史的末尾按下「繼續」按鈕時,插入於聊天歷史的結尾",
9494 "Replace empty message": "取代空白訊息",
9595 "Send this text instead of nothing when the text box is empty.": "當文字方塊為空時當文字框為空時發送此字串而不是空白傳送此文字以取代空白。",
9696 "Seed": "種子",
9797 "Set to get deterministic results. Use -1 for random seed.": "設定以獲取確定性結果設定數值以取得可重現的結果。使用 -1 作為隨機種子",
98- "Temperature controls the randomness in token selection": "溫度控制符元選擇中的隨機性",
98+ "Temperature controls the randomness in token selection": "溫度(Temperature)控制符元選擇的隨機性。\n- 低溫(<1.0):產生更可預測且具邏輯性的文字,優先選擇機率較高的符元。\n- 高溫(>1.0):提升創造性與輸出的多樣性,更常選擇機率較低的符元。\n將值設為 1.0 可使用原始機率。",
9999 "Top_K_desc": "Top K 設定可以選擇的最高符元數量。\n例如,Top K 為 20,這意味著只保留排名前 20 的符元(無論它們的機率是多樣還是有限的)。\n設定為 0 以停用。",
100100 "Top_P_desc": "Top P(又名核心取樣) 會將所有頂級符元加總,直到達到目標百分比。\n例如,如果前兩個符元都是 25%,而 Top P 設為 0.5,那麼只有前兩個符元會被考慮。\n設定為 1.0 以停用。",
101101 "Typical P": "Typical P",
102102 "Typical_P_desc": "Typical P 取樣根據符元偏離集合平均熵的程度進行優先排序。\n它會保留累積機率接近預設閾值 (例如0例如 0.5) 的符元,強調那些具有平均信息量的符元,強調那些具有平均資訊量的符元。\n設定為 1.0 以停用。",
103103 "Min_P_desc": "Min P 設定基本最小機率。\n這個值會根據最高符元的機率進行調整。例如,如果最高符元機率為 80%,而 Min P 設為 0.1,那麼只有機率高於 8% 的符元會被考慮。\n設定為 0 以停用。",
104104 "Top_A_desc": "Top A 根據最高符元機率的平方設定符元選擇的門檻。\n例如,如果 Top A 值為 0.2,而最高符元機率為 50%,那麼低於 5%(0.2 * 0.5^2) 的符元機率就會被排除。\n設定為 0 以停用。",
105105 "Tail_Free_Sampling_desc": "無尾取樣 (Tail-Free Sampling, TFS) 會透過分析符元機率的變化率 (使用導數) 來尋找分佈中的低機率符元尾部。\n它會根據標準化的二階導數,保留直到某個閾值 (例如 0.3) 的符元。\n數值越接近 0,表示會棄去越多符元。設定為 1.0 以停用。",
@@ -126,10 +126,10 @@
126126 "Logit Bias": "Logit 偏差",
127127 "Add": "新增",
128128 "Helps to ban or reenforce the usage of certain words": "有助於禁止或強化某些符元的使用",
129129 "CFG Scale": "CFG 比例縮放比例",
130130 "Negative Prompt": "負面提示詞",
131131 "Add text here that would make the AI generate things you don't want in your outputs.": "在這裡新增文字在此新增文字使以防止 AI 生成您不希望在輸出中出現的內容在輸出中生成您不希望出現的內容。",
132132 "Used if CFG Scale is unset globally, per chat or character": "如果CFG Scale未在全域、每個聊天或角色中設定CFG 縮放比例未被全域設定則使用它將作用於所有聊天或角色",
133133 "Mirostat Tau": "Tau",
134134 "Mirostat LR": "Mirostat 學習率",
135135 "Min Length": "最小長度",
@@ -144,14 +144,14 @@
144144 "Epsilon Cutoff": "Epsilon 截斷",
145145 "Epsilon cutoff sets a probability floor below which tokens are excluded from being sampled": "Epsilon 截斷設定排除符元的機率下限",
146146 "Eta Cutoff": "Eta 截斷",
147147 "Eta_Cutoff_desc": "Eta 截斷是特殊 Eta 取樣技術的主要參數。\n單位為 1e-4;合理值為 3。\n設為 0 以停用。\n詳情請參見n詳細資訊請參見 Hewitt 等人於 2022 年撰寫的論文《Truncation Sampling as Language Model Desmoothing》。",
148148 "rep.pen decay": "重複懲罰衰減",
149149 "Encoder Rep. Pen.": "編碼器重複懲罰",
150150 "No Repeat Ngram Size": "無重複 Ngram 大小",
151151 "Skew": "Skew",
152152 "Max Tokens Second": "最大符元/秒",
153153 "Smooth Sampling": "平滑取樣",
154154 "Smooth_Sampling_desc": "允許您使用二次/三次變換來調整分佈。較低的平滑因子值將更具創造性,通常在 0.2-0.3 之間是最佳點(假設曲線=1)。較高的平滑曲線值會使曲線更陡峭,這將更加激烈地懲罰低概率選擇這將更加激烈地懲罰低機率選擇。1.0 的曲線值相當於僅使用平滑因子。",
155155 "Smoothing Factor": "平滑因子",
156156 "Smoothing Curve": "平滑曲線",
157157 "DRY_Repetition_Penalty_desc": "DRY 會懲罰那些將輸入的結尾擴充為已在先前輸入中出現過序列的符元。將乘法器設為 0 以停用。",
@@ -183,7 +183,7 @@
183183 "Length Penalty": "長度懲罰",
184184 "Early Stopping": "提前停止",
185185 "Contrastive search": "對比搜尋",
186186 "Contrastive_search_txt": "一種取樣器,通過利用大多數透過利用大多數 LLM 的表示空間的等向性,鼓勵多樣性的同時保持一致性。詳情請參閱詳細資訊請參閱 Su 等人於 2022 年發表的論文《A Contrastive Framework for Neural Text Generation》。",
187187 "Penalty Alpha": "懲罰 Alpha",
188188 "Strength of the Contrastive Search regularization term. Set to 0 to disable CS": "對比搜尋正則化項的強度。設定為 0 以停用 CS",
189189 "Do Sample": "進行取樣",
@@ -194,7 +194,7 @@
194194 "Ignore the EOS Token even if it generates.": "即使生成也忽略 EOS 符元",
195195 "Skip Special Tokens": "跳過特殊符元",
196196 "Temperature Last": "最後的溫度",
197197 "Temperature_Last_desc": "使用最後應用溫度取樣器。這幾乎總是明智的做法。\n啟用時:首先取樣一組合理的符元,然後應用溫度來調整它們的相對機率(技術上講,是 logits)。\n停用時:首先應用溫度調整所有符元的相對機率,然後從中取樣合理的符元。\n停用「最後應用溫度取樣」會增加分佈尾部的概率會增加分佈尾部的機率,這傾向於放大獲得不連貫回應的機會。",
198198 "Speculative Ngram": "推測性 Ngram",
199199 "Use a different speculative decoding method without a draft model": "使用不含草稿模型的不同推測性解碼方法。",
200200 "Spaces Between Special Tokens": "特殊符元之間的空格",
@@ -222,21 +222,21 @@
222222 "Message Content": "訊息內容",
223223 "Prepend character names to message contents.": "在訊息內容前新增角色名稱",
224224 "Continue Postfix": "繼續後綴",
225225 "The next chunk of the continued message will be appended using this as a separator.": "繼續訊息的下一塊將使用此作為分隔符附加繼續訊息的下一塊將使用此作為分隔符號附加",
226226 "Space": "空格",
227227 "Newline": "換行",
228228 "Double Newline": "雙換行",
229229 "Wrap user messages in quotes before sending": "發送前將使用者訊息用引號括起來傳送前將使用者訊息用引號括起來",
230230 "Wrap in Quotes": "用引號包裹",
231231 "Wrap entire user message in quotes before sending.": "在發送之前將整個使用者訊息用引號包裹在傳送之前將整個使用者訊息用引號包裹。",
232232 "Leave off if you use quotes manually for speech.": "如果您手動使用引號進行發言,請關閉。",
233233 "Continue prefill": "繼續預先填充",
234234 "Continue sends the last message as assistant role instead of system message with instruction.": "繼續將最後的訊息作為助理角色發送繼續將最後的訊息作為助理角色傳送,而不是帶有指令的系統訊息。",
235235 "Squash system messages": "合併系統訊息",
236236 "Combines consecutive system messages into one (excluding example dialogues). May improve coherence for some models.": "將連續的系統訊息合併為一個(不包括對話範例)。可能會提高某些模型的一致性。",
237237 "Enable function calling": "啟用函數調用啟用函式呼叫",
238238 "Send inline images": "發送內嵌圖片傳送內嵌圖片",
239239 "image_inlining_hint_1": "如果模型支援(例如:GPT-4V、Claude 3 或 Llava 13B),則在提示詞中發送圖片則在提示詞中傳送圖片。\n使用任何訊息上的",
240240 "image_inlining_hint_2": "動作或",
241241 "image_inlining_hint_3": "選單來附加圖片文件到聊天中。",
242242 "Inline Image Quality": "內嵌圖片品質",
@@ -246,31 +246,31 @@
246246 "Use AI21 Tokenizer": "使用 AI21 分詞器",
247247 "Use the appropriate tokenizer for Jurassic models, which is more efficient than GPT's.": "對於 Jurassic 模型使用適當的分詞器,比 GPT 的更高效",
248248 "Use Google Tokenizer": "使用 Google 分詞器",
249249 "Use the appropriate tokenizer for Google models via their API. Slower prompt processing, but offers much more accurate token counting.": "通過透過 Google 模型的 API 使用適當的分詞器。提示詞處理速度較慢,但提供更準確的符元計數。",
250250 "Use system prompt": "使用系統提示詞",
251251 "(Gemini 1.5 Pro/Flash only)": "(僅限於 Gemini 1.5 Pro/Flash)",
252252 "Merges_all_system_messages_desc_1": "合併所有系統訊息,直到第一則非系統角色的訊息,並通過並透過 google 的",
253253 "Merges_all_system_messages_desc_2": "字段發送欄位傳送而不是與其餘提示詞內容一起發送而不是與其餘提示詞內容一起傳送。",
254254 "Assistant Prefill": "預先填充助理訊息",
255255 "Start Claude's answer with...": "開始 Claude 的回答⋯",
256256 "Assistant Impersonation Prefill": "助理扮演時的預先填充",
257257 "Use system prompt (Claude 2.1+ only)": "使用系統提示詞(僅限 Claude 2.1+)",
258258 "Send the system prompt for supported models. If disabled, the user message is added to the beginning of the prompt.": "為支援的模型發送系統提示詞為支援的模型傳送系統提示詞。停用時,使用者訊息將新增到提示詞的開頭。",
259259 "User first message": "使用者第一則訊息",
260260 "Restore User first message": "還原使用者第一則訊息",
261261 "Human message": "人類訊息、指令等。\n當空白時不加入任何內容,也就是需要一個帶有使用者角色的新提示詞。",
262262 "New preset": "新預設新預設設定檔",
263263 "Delete preset": "刪除預設刪除預設設定檔",
264264 "View / Edit bias preset": "查看檢視/編輯 Bias 預設預設設定檔",
265265 "Add bias entry": "新增 Bias 條目",
266266 "Most tokens have a leading space.": "大多數符元有前導空格",
267267 "API Connections": "API 連線",
268268 "Text Completion": "文本補全文字補全",
269269 "Chat Completion": "聊天補全",
270270 "NovelAI": "NovelAI",
271271 "AI Horde": "AI Horde",
272272 "KoboldAI": "KoboldAI",
273273 "Avoid sending sensitive information to the Horde.": "避免發送敏感資訊到避免傳送敏感資訊到 Horde。",
274274 "Review the Privacy statement": "檢視隱私聲明",
275275 "Register a Horde account for faster queue times": "註冊 Horde 帳號以縮短等待時間",
276276 "Learn how to contribute your idle GPU cycles to the Horde": "了解如何將閒置的 GPU 週期貢獻給 Horde",
@@ -279,7 +279,7 @@
279279 "Can help with bad responses by queueing only the approved workers. May slowdown the response time.": "僅將已批准的 worker 排隊,可以幫助處理不良回應。可能會延長回應時間。",
280280 "Trusted workers only": "僅限受信任的 worker",
281281 "API key": "API 金鑰",
282282 "Get it here:": "在這裡獲取在這裡取得:",
283283 "Register": "註冊",
284284 "View my Kudos": "瀏覽我的讚賞記錄",
285285 "Enter": "輸入",
@@ -346,18 +346,18 @@
346346 "Save Proxy": "儲存代理伺服器",
347347 "Delete Proxy": "刪除代理伺服器",
348348 "Proxy Name": "代理伺服器名稱",
349349 "This will show up as your saved preset.": "這將顯示為您儲存的預設這將顯示為您儲存的預設設定檔",
350350 "Proxy Server URL": "代理伺服器 URL",
351351 "Alternative server URL (leave empty to use the default value).": "替代伺服器 URL(留空以使用預設值)。",
352352 "Remove your real OAI API Key from the API panel BEFORE typing anything into this box": "在此框中輸入任何內容之前,從 API 面板中刪除您的實際 OAI API 金鑰",
353353 "We cannot provide support for problems encountered while using an unofficial OpenAI proxy": "我們無法為使用非官方 OpenAI 代理伺服器時遇到的問題提供支援",
354354 "Doesn't work? Try adding": "不起作用?嘗試新增",
355355 "at the end!": "在最後在 URL 結尾!",
356356 "Proxy Password": "代理伺服器密碼",
357357 "Will be used as a password for the proxy instead of API key.": "將用作代理的密碼,而不是 API 金鑰",
358358 "Peek a password": "顯示密碼",
359359 "OpenAI API key": "OpenAI API 金鑰",
360360 "View API Usage Metrics": "查看檢視 API 使用指標",
361361 "Follow": "遵循",
362362 "these directions": "這些指示",
363363 "to get your OpenAI API key.": "以取得您的 OpenAI API 金鑰。",
@@ -397,16 +397,16 @@
397397 "Available Models": "可用模型",
398398 "Prompt Post-Processing": "提示詞後處理",
399399 "Applies additional processing to the prompt before sending it to the API.": "這個選項會在將提示詞送往 API 之前,對它進行額外的處理。",
400400 "Verifies your API connection by sending a short test message. Be aware that you'll be credited for it!": "透過發送簡短的測試訊息來驗證您的透過傳送簡短的測試訊息來驗證您的 API 連線。請注意,您將因此獲得榮譽!",
401401 "Test Message": "測試訊息",
402402 "Auto-connect to Last Server": "自動連線到上次伺服器自動連接至上次使用的伺服器",
403403 "Missing key": "❌ 鑰匙遺失",
404404 "Key saved": "✔️ 金鑰已儲存",
405405 "View hidden API keys": "查看隱藏的檢視隱藏的 API 金鑰",
406406 "AI Response Formatting": "AI 回應進階格式化",
407407 "Advanced Formatting": "進階格式化",
408408 "Context Template": "上下文範本",
409409 "Auto-select this preset for Instruct Mode": "自動選擇此預設用於指令模式自動選擇此預設設定檔用於指令模式",
410410 "Story String": "故事字串",
411411 "Example Separator": "分隔符號範例",
412412 "Chat Start": "聊天開始符號",
@@ -458,7 +458,7 @@
458458 "Inserted before the first Assistant's message.": "插入在第一則助理訊息之前。",
459459 "First Assistant Prefix": "開頭助理前綴",
460460 "instruct_last_output_sequence": "插入在最後一則助理訊息之前,或在生成 AI 回覆時作為最後一行提示詞(除了中立/系統角色)。",
461461 "Last Assistant Prefix": "末尾助理前綴結尾助理前綴",
462462 "Will be inserted as a last prompt line when using system/neutral generation.": "在使用系統/中立生成時作為最後一行提示詞插入。",
463463 "System Instruction Prefix": "系統指令前綴",
464464 "If a stop sequence is generated, everything past it will be removed from the output (inclusive).": "如果生成了停止序列,包括該序列以及之後的所有內容將從輸出中刪除。",
@@ -482,7 +482,7 @@
482482 "Non-markdown strings": "非 Markdown 字串",
483483 "separate with commas w/o space between": "用逗號分隔,之間無空格",
484484 "Custom Stopping Strings": "自訂停止字串",
485485 "JSON serialized array of strings": "JSON 序列化字串數組序列化字串陣列",
486486 "Replace Macro in Stop Strings": "取代自訂停止字串中的巨集",
487487 "Auto-Continue": "自動繼續",
488488 "Allow for Chat Completion APIs": "允許聊天補全 API",
@@ -493,7 +493,7 @@
493493 "Active World(s) for all chats": "所有聊天啟用中的世界書",
494494 "-- World Info not found --": "-- 未找到世界資訊 --",
495495 "Global World Info/Lorebook activation settings": "全域世界資訊/知識書啟動設定",
496496 "Click to expand": "點擊展開點選展開",
497497 "Scan Depth": "掃描深度",
498498 "Context %": "上下文百分比",
499499 "Budget Cap": "預算上限",
@@ -506,16 +506,16 @@
506506 "Sorted Evenly": "均等排序",
507507 "Character Lore First": "角色知識書優先",
508508 "Global Lore First": "全域知識書優先",
509509 "Entries can activate other entries by mentioning their keywords": "條目可以通過提及其關鍵字來啟用其他條目條目可以透過提及其關鍵字來啟用其他條目",
510510 "Recursive Scan": "遞迴掃描",
511511 "Lookup for the entry keys in the context will respect the case": "在上下文中查找條目鍵將區分大小寫在上下文中查詢條目鍵將區分大小寫",
512512 "Case Sensitive": "區分大小寫",
513513 "If the entry key consists of only one word, it would not be matched as part of other words": "如果條目鍵僅包含一個詞,則不會作為其他詞的一部分進行配對",
514514 "Match Whole Words": "完全配對",
515515 "Only the entries with the most number of key matches will be selected for Inclusion Group filtering": "只有符合最多鍵值數量的條目將被選中進行包含群組過濾",
516516 "Use Group Scoring": "使用群組評分",
517517 "Alert if your world info is greater than the allocated budget.": "如果您的世界資訊超過分配的預算則提醒",
518518 "Alert On Overflow": "溢出時警告溢位時警告",
519519 "New": "新增",
520520 "or": "或",
521521 "--- Pick to Edit ---": "--- 選擇編輯 ---",
@@ -548,7 +548,7 @@
548548 "User Settings": "使用者設定",
549549 "Simple": "簡單",
550550 "Advanced": "進階",
551551 "UI Language": "介面語言:",
552552 "Account": "帳號",
553553 "Admin Panel": "管理面板",
554554 "Logout": "登出",
@@ -559,7 +559,7 @@
559559 "Delete a theme": "刪除主題",
560560 "Update a theme file": "更新主題檔",
561561 "Save as a new theme": "另存為新主題",
562562 "Avatar Style:": "頭像樣式",
563563 "Circle": "圓形",
564564 "Square": "方形",
565565 "Rectangle": "矩形",
@@ -580,9 +580,9 @@
580580 "User Message Blur Tint": "使用者訊息模糊色調",
581581 "AI Message Blur Tint": "AI 訊息模糊色調",
582582 "Chat Width": "對話框寬度",
583583 "Width of the main chat window in % of screen width": "主聊天視窗寬度占螢幕寬度的百分比主聊天視窗寬度佔螢幕寬度的百分比",
584584 "Font Scale": "字體比例字型比例",
585585 "Font size": "字體大小字型大小",
586586 "Blur Strength": "模糊強度",
587587 "Blur strength on UI panels.": "UI 面板上的模糊強度",
588588 "Text Shadow Width": "文字陰影寬度",
@@ -622,22 +622,22 @@
622622 "Enables a magnification effect on hover when you display the zoomed avatar after clicking an avatar's image in chat.": "當你在聊天中點選頭像的圖片後,這會啟用滑鼠懸停時的放大效果。",
623623 "Show tagged character folders in the character list": "在角色列表中顯示標籤角色資料夾。",
624624 "Tags as Folders": "標籤作為資料夾",
625625 "Tags_as_Folders_desc": "標籤必須在「標籤管理」選單中標記為資料夾才可適用。點擊這裡打開點選這裡開啟。",
626626 "Character Handling": "角色處理",
627627 "If set in the advanced character definitions, this field will be displayed in the characters list.": "如果在進階角色定義中設定,這個欄位將顯示在角色清單中。",
628628 "Char List Subheader": "角色列表子標題",
629629 "Character Version": "角色版本",
630630 "Created by": "創作者",
631631 "Use fuzzy matching, and search characters in the list by all data fields, not just by a name substring": "使用模糊配對,並通過所有資料欄位在列表中搜尋角色並透過所有資料欄位在列表中搜尋角色而不僅僅是通過名稱子字串而不僅僅是透過名稱子字串。",
632632 "Advanced Character Search": "進階角色搜尋",
633633 "If checked and the character card contains a prompt override (System Prompt), use that instead": "如果選中並且角色卡包含提示詞覆寫(系統提示詞),則使用該提示詞。",
634634 "Prefer Character Card Prompt": "角色卡主要提示詞優先",
635635 "If checked and the character card contains a jailbreak override (Post History Instruction), use that instead": "如果選中並且角色卡包含越獄覆寫(聊天歷史後指示),則使用該提示詞。",
636636 "Prefer Character Card Jailbreak": "角色卡越獄優先",
637- "Avoid cropping and resizing imported character images. When off, crop/resize to 512x768": "避免裁剪和調整匯入的角色圖像大小。未勾選時將會裁剪/調整大小到 512x768。",
637+ "never_resize_avatars_tooltip": "避免裁剪與調整匯入的角色頭像大小。未啟用此選項時,圖片將被裁剪/調整為 512x768。此設定會關閉上傳頭像時的裁剪彈出視窗。",
638638 "Never resize avatars": "永不調整頭像大小",
639639 "Show actual file names on the disk, in the characters list display only": "僅在角色列表顯示實際檔案名稱。",
640640 "Show avatar filenames": "顯示頭像檔案名顯示頭像檔案名稱",
641641 "Prompt to import embedded card tags on character import. Otherwise embedded tags are ignored": "在角色匯入時提示詞匯入嵌入的卡片標籤。否則,嵌入的標籤將被忽略。",
642642 "Import Card Tags": "匯入卡片中的標籤",
643643 "Hide character definitions from the editor panel behind a spoiler button": "在編輯器面板中將角色定義隱藏在劇透按鈕後面。",
@@ -658,14 +658,14 @@
658658 "Relaxed API URLS": "寬鬆的 API URL 格式",
659659 "Ask to import the World Info/Lorebook for every new character with embedded lorebook. If unchecked, a brief message will be shown instead": "當新角色含有知識書時,詢問是否要匯入嵌入的世界資訊/知識書。如果未選中,則會顯示簡短的訊息。",
660660 "Lorebook Import Dialog": "匯入知識書對話框",
661661 "Restore unsaved user input on page refresh": "在頁面刷新時還原未儲存的使用者輸入在頁面重新整理時還原未儲存的使用者輸入。",
662662 "Restore User Input": "還原使用者輸入",
663663 "Allow repositioning certain UI elements by dragging them. PC only, no effect on mobile": "允許通過拖動重新定位某些允許透過拖動重新定位某些 UI 元素。僅適用於 PC 版。",
664664 "Movable UI Panels": "可拖動的 UI 模式",
665665 "MovingUI preset. Predefined/saved draggable positions": "MovingUI 預設預設設定檔。預先定義/儲存可拖動位置。",
666666 "MUI Preset": "MovingUI 預設預設設定檔",
667667 "Save movingUI changes to a new file": "另存 MovingUI 變更為新檔案",
668668 "Reset MovingUI panel sizes/locations.": "重置重設 MovingUI 面板大小/位置",
669669 "Apply a custom CSS style to all of the ST GUI": "將自訂 CSS 樣式應用於所有 SillyTavern 介面",
670670 "Custom CSS": "自訂 CSS 樣式",
671671 "Expand the editor": "展開編輯器",
@@ -679,7 +679,7 @@
679679 "Gradual push-out": "逐步推出",
680680 "Always include examples": "總是包含範例",
681681 "Never include examples": "永不包含範例",
682682 "Send on Enter": "按下 Enter 鍵發送鍵傳送:",
683683 "Disabled": "停用",
684684 "Automatic (PC)": "自動(PC)",
685685 "Press Send to continue": "按下傳送繼續",
@@ -699,22 +699,22 @@
699699 "Forbid External Media": "禁止使用外部媒體",
700700 "Allow {{char}}: in bot messages": "允許機器人訊息中使用 {{char}}:",
701701 "Allow {{user}}: in bot messages": "允許機器人訊息中使用 {{user}}:",
702702 "Skip encoding and characters in message text, allowing a subset of HTML markup as well as Markdown": "跳過編碼訊息文字中的 < 和 > 字符字元,允許一部分 HTML 標記以及 Markdown",
703703 "Show tags in responses": "在回應中顯示標籤",
704704 "Allow AI messages in groups to contain lines spoken by other group members": "允許群組中的 AI 訊息包含其他群組成員說的話",
705705 "Relax message trim in Groups": "放寬群組中的訊息修剪",
706706 "Log prompts to console": "將提示詞記錄到控制台",
707707 "Requests logprobs from the API for the Token Probabilities feature": "從 API 請求 logprobs 用於符元機率功能。",
708708 "Request token probabilities": "請求符元機率",
709709 "Automatically reject and re-generate AI message based on configurable criteria": "根據可配置標準自動拒絕並重新生成根據可設定標準自動拒絕並重新生成 AI 訊息。",
710710 "Auto-swipe": "自動滑動",
711711 "Enable the auto-swipe function. Settings in this section only have an effect when auto-swipe is enabled": "啟用自動滑動功能。此部分的設定僅在啟用自動滑動時有效。",
712712 "Minimum generated message length": "生成訊息的最小長度",
713713 "If the generated message is shorter than thisthese many characters, trigger an auto-swipe": "如果生成的訊息比這個短,將觸發自動滑動。",
714714 "Blacklisted words": "黑名單詞語",
715715 "words you dont want generated separated by comma ','": "您不想生成的文字,使用逗號分隔",
716716 "Blacklisted word count to swipe": "滑動的黑名單詞語數量",
717717 "Minimum number of blacklisted words detected to trigger an auto-swipe": "檢測到的黑名單詞語數量觸發自動滑動的最小值偵測到的黑名單詞語數量觸發自動滑動的最小值。",
718718 "AutoComplete Settings": "自動完成設定",
719719 "Automatically hide details": "自動隱藏詳細資訊",
720720 "Determines how entries are found for autocomplete.": "決定如何找到自動完成的條目",
@@ -726,18 +726,18 @@
726726 "Autocomplete Style": "自動完成樣式",
727727 "Follow Theme": "沿用介面主題",
728728 "Dark": "深色",
729729 "Sets the font size of the autocomplete.": "設定自動完成的字體大小設定自動完成的字型大小",
730730 "Sets the width of the autocomplete.": "設定自動完成的寬度",
731731 "Autocomplete Width": "自動完成寬度",
732732 "chat input box": "聊天輸入框",
733733 "entire chat width": "整個聊天寬度",
734734 "full window width": "全視窗寬度",
735735 "STscript Settings": "STscript 設定",
736736 "Sets default flags for the STscript parser.": "設定 STscript 解析器的預設標誌解析器的預設象徵",
737737 "Parser Flags": "解析器標誌解析器象徵",
738738 "Switch to stricter escaping, allowing all delimiting characters to be escaped with a backslash, and backslashes to be escaped as well.": "切換到更嚴格的字元跳脫,允許所有分隔符號使用反斜線跳脫,反斜線自己也可以跳脫。",
739739 "STRICT_ESCAPING": "STRICT_ESCAPING",
740740 "Replace all {{getvar::}} and {{getglobalvar::}} macros with scoped variables to avoid double macro substitution.": "將所有 {{getvar::}} 和 {{getglobalvar::}} 巨集取代為作用域變量以避免雙重巨集取代巨集取代為區域變數以避免雙重巨集取代",
741741 "REPLACE_GETVAR": "REPLACE_GETVAR",
742742 "Change Background Image": "變更背景圖片",
743743 "Filter": "篩選",
@@ -758,7 +758,7 @@
758758 "Extras API key (optional)": "擴充功能 API 金鑰(選填)",
759759 "Persona Management": "使用者角色管理",
760760 "How do I use this?": "我該如何使用這個?",
761761 "Click for stats!": "點擊以查看統計資料點選以檢視統計資料!",
762762 "Usage Stats": "統計資料",
763763 "Backup your personas to a file": "備份您的使用者角色檔案",
764764 "Backup": "備份",
@@ -766,20 +766,20 @@
766766 "Restore": "還原",
767767 "Create a dummy persona": "建立一個虛構使用者角色",
768768 "Create": "建立",
769769 "Toggle grid view": "切換為網格視圖切換為網格檢視",
770770 "No persona description": "無使用者角色描述",
771771 "Name": "名稱",
772772 "Enter your name": "輸入您的名字",
773773 "Click to set a new User Name": "設定新的使用者名稱",
774774 "Click to lock your selected persona to the current chat. Click again to remove the lock.": "綁定目前所選的使用者角色至本次聊天。再次點擊則可移除綁定再次點選則可移除綁定。",
775775 "Click to set user name for all messages": "設定所有訊息的使用者名稱",
776776 "Persona Description": "使用者角色描述",
777777 "Example: [{{user}} is a 28-year-old Romanian cat girl.]": "範例:[{{user}} 是一個 28 歲的羅馬尼亞貓娘。]",
778778 "Tokens persona description": "角色描述符元數",
779779 "Position:": "插入位置:",
780780 "In Story String / Prompt Manager": "提示詞管理器/故事字串中",
781781 "Top of Author's Note": "作者備註的頂部作者備註的頂端",
782782 "Bottom of Author's Note": "作者備註的底部作者備註的底端",
783783 "In-chat @ Depth": "聊天中 @ 深度",
784784 "Depth:": "深度:",
785785 "Role:": "角色:",
@@ -820,7 +820,7 @@
820820 "Replace / Update": "取代/更新",
821821 "Import Tags": "匯入標籤",
822822 "Search / Create Tags": "搜尋/建立標籤",
823823 "View all tags": "查看所有標籤檢視所有標籤",
824824 "Creator's Notes": "創作者備註",
825825 "Show / Hide Description and First Message": "顯示/隱藏描述和第一則訊息",
826826 "Character Description": "角色描述",
@@ -830,7 +830,7 @@
830830 "First message": "初始訊息",
831831 "Click to set additional greeting messages": "點選以設定額外的問候訊息",
832832 "Alt. Greetings": "額外問候語",
833833 "This will be the first message from the character that starts every chat.": "這將是每次聊天開始時角色發送的第一則訊息這將是每次聊天開始時角色傳送的第一則訊息。",
834834 "Group Controls": "群組控制",
835835 "Chat Name (Optional)": "聊天名稱(選填)",
836836 "Click to select a new avatar for this group": "點選以選擇此群組的新頭像",
@@ -843,7 +843,7 @@
843843 "Join character cards (include muted)": "合併角色卡欄位(包括靜音)",
844844 "Inserted before each part of the joined fields.": "插入在合併欄位的每一部分之前。",
845845 "Join Prefix": "加入前綴",
846846 "When 'Join character cards' is selected, all respective fields of the characters are being joined together.This means that in the story string for example all character descriptions will be joined to one big text.If you want those fields to be separated, you can define a prefix or suffix here.This value supports normal macros and will also replace {{char}} with the relevant char's name and <FIELDNAME> with the name of the part (e.g.: description, personality, scenario, etc.)": "選擇「合併角色卡欄位」時,所有角色的相關欄位將被合併。\r例如,在故事字串中,所有角色的描述將合併為一段大文本所有角色的描述將合併為一段大文字。\r若您希望這些欄位保持分隔,您可以在此定義前綴或後綴。\r\r此值支持常規巨集r此值支援常規巨集 {{macros}},並會將 {{char}} 替換為相關角色的名稱,可將 <FIELDNAME> 替換為欄位名稱(例如:角色描述、個性、場景等)。",
847847 "Inserted after each part of the joined fields.": "插入在合併欄位的每一部分之後。",
848848 "Join Suffix": "加入後綴",
849849 "Set a group chat scenario": "設定群組聊天場景",
@@ -855,10 +855,10 @@
855855 "Hide Muted Member Sprites": "於群組拼貼頭像中隱藏靜音成員",
856856 "Current Members": "目前成員",
857857 "Add Members": "新增成員",
858858 "Create New Character": "創建角色建立角色",
859859 "Import Character from File": "由本地檔案匯入角色由本機檔案匯入角色",
860860 "Import content from external URL": "由外部 URL 匯入內容",
861861 "Create New Chat Group": "創建聊天群組建立聊天群組",
862862 "Characters sorting order": "角色排序依據",
863863 "A-Z": "A-Z",
864864 "Z-A": "Z-A",
@@ -871,8 +871,8 @@
871871 "Most tokens": "最多符元",
872872 "Least tokens": "最少符元",
873873 "Random": "隨機",
874874 "Toggle character grid view": "切換為角色網格視圖切換為角色網格檢視",
875875 "Bulk_edit_characters": "批次編輯角色\n\n點選以切換角色\n「Shift+點擊點選」可選擇/取消選擇範圍的角色\n右鍵以查看動作n右鍵以檢視動作\n右鍵以查看動作n右鍵以檢視動作",
876876 "Bulk select all characters": "全選所有角色",
877877 "Bulk delete characters": "批次刪除角色",
878878 "popup-button-save": "儲存",
@@ -887,9 +887,9 @@
887887 "Main Prompt": "主要提示詞",
888888 "Any contents here will replace the default Main Prompt used for this character. (v2 spec: system_prompt)": "此處的任何內容將取代此角色使用的預設主要提示詞。(v2 規範:system_prompt)",
889889 "Any contents here will replace the default Jailbreak Prompt used for this character. (v2 spec: post_history_instructions)": "此處的任何內容將取代此角色使用的預設越獄提示詞。(v2 規範:post_history_instructions)",
890890 "Creator's Metadata (Not sent with the AI prompt)": "創作者的中繼資料(不會與 AI 提示詞一起發送提示詞一起傳送)",
891891 "Creator's Metadata": "創作者的中繼資料",
892892 "(Not sent with the AI Prompt)": "(不與 AI 提示詞一起發送提示詞一起傳送)",
893893 "Everything here is optional": "此處所有內容均為選填",
894894 "(Botmaker's name / Contact Info)": "(機器人創作者的名字/聯絡資訊)",
895895 "(If you want to track character versions)": "(若您想追蹤角色版本)",
@@ -901,7 +901,7 @@
901901 "Scenario": "場景設想",
902902 "(Circumstances and context of the interaction)": "(互動情形與聊天背景)",
903903 "Character's Note": "角色備註",
904904 "(Text to be inserted in-chat @ designated depth and role)": "(在聊天中以指定角色於 @ 深度位置插入文本深度位置插入文字)",
905905 "@ Depth": "@ 深度",
906906 "Role": "角色",
907907 "Talkativeness": "健談度",
@@ -990,13 +990,13 @@
990990 "Exclude from recursion": "不可遞迴(此條目不會被其他條目啟用)",
991991 "Prevent further recursion (this entry will not activate others)": "防止進一步遞迴(此條目不會啟用其他條目)",
992992 "Delay until recursion (this entry can only be activated on recursive checking)": "延遲遞迴(此條目只能在遞迴檢查時啟用)",
993993 "What this keyword should mean to the AI, sent verbatim": "這個關鍵字對 AI 應意味著什麼,逐字發送逐字傳送",
994994 "Filter to Character(s)": "角色篩選",
995995 "Character Exclusion": "角色排除",
996996 "-- Characters not found --": "-- 未找到角色 --",
997997 "Inclusion Group": "包含的群組",
998998 "Inclusion Groups ensure only one entry from a group is activated at a time, if multiple are triggered.Documentation: World Info - Inclusion Group": "如果觸發多個條目,包含群組可確保一次僅啟動一組中的一個條目。\r支援多個以逗號分隔的群組。\r\r文件:世界資訊——包容性集團",
999999 "Prioritize this entry: When checked, this entry is prioritized out of all selections.If multiple are prioritized, the one with the highest 'Order' is chosen.": "優先考慮此條目:選取後,此條目將在所有選擇中優先。\r如果有多個優先級r如果有多個優先順序,則選擇「順序」最高的一個。",
10001000 "Only one entry with the same label will be activated": "僅會啟用具有相同標籤的一個條目",
10011001 "A relative likelihood of entry activation within the group": "群組內條目啟用的相對可能性",
10021002 "Group Weight": "群組權重",
@@ -1008,7 +1008,7 @@
10081008 "prompt_manager_edit": "編輯",
10091009 "prompt_manager_name": "名稱",
10101010 "A name for this prompt.": "這個提示詞的名稱。",
10111011 "To whom this message will be attributed.": "此訊息將隸屬於誰此訊息所屬的角色。",
10121012 "AI Assistant": "人工智慧助手",
10131013 "prompt_manager_position": "位置",
10141014 "Injection position. Next to other prompts (relative) or in-chat (absolute).": "注入位置。與其他提示詞相鄰(相對位置)或在聊天中(絕對位置)。",
@@ -1016,7 +1016,7 @@
10161016 "prompt_manager_depth": "深度",
10171017 "Injection depth. 0 = after the last message, 1 = before the last message, etc.": "注入深度。0 = 在最後一則訊息之後,1 = 在最後一則訊息之前,以此類推。",
10181018 "Prompt": "提示詞",
10191019 "The prompt to be sent.": "要發送的提示詞要傳送的提示詞。",
10201020 "This prompt cannot be overridden by character cards, even if overrides are preferred.": "即使啟用優先覆寫,此提示詞也不能被角色卡片覆寫。",
10211021 "prompt_manager_forbid_overrides": "禁止覆寫",
10221022 "reset": "重設",
@@ -1069,13 +1069,13 @@
10691069 "Trigger a message from this character": "觸發此角色的訊息",
10701070 "Move up": "上移",
10711071 "Move down": "下移",
10721072 "View character card": "查看角色卡檢視角色卡",
10731073 "Remove from group": "從群組中移除",
10741074 "Add to group": "新增到群組",
10751075 "Alternate Greetings": "額外問候語",
10761076 "Alternate_Greetings_desc": "這些將在開始新聊天時顯示為第一則訊息的滑動選項。\n群組成員可以選擇其中之一來開始對話。",
10771077 "Alternate Greetings Hint": "額外問候語的提示訊息",
10781078 "(This will be the first message from the character that starts every chat)": "(這將是每次聊天開始時角色發送的第一則訊息這將是每次聊天開始時角色傳送的第一則訊息)",
10791079 "Forbid Media Override explanation": "此角色/群組在聊天中使用外部媒體的能力。",
10801080 "Forbid Media Override subtitle": "禁止媒體覆寫副標題",
10811081 "Always forbidden": "總是禁止",
@@ -1089,7 +1089,7 @@
10891089 "After Main Prompt / Story String": "在主要提示詞/故事字串之後",
10901090 "as": "作為",
10911091 "Insertion Frequency": "插入頻率",
10921092 "(0 = Disable, 1 = Always)": "(0 = 停用, 1 = 永久)",
10931093 "User inputs until next insertion:": "使用者輸入直到下一次插入:",
10941094 "Character Author's Note (Private)": "角色作者備註(私人)",
10951095 "Won't be shared with the character card on export.": "匯出時不與角色卡共享。",
@@ -1114,7 +1114,7 @@
11141114 "Chat Negatives": "聊天負面提示詞",
11151115 "Character Negatives": "角色負面提示詞",
11161116 "Global Negatives": "全域負面提示詞",
11171117 "Custom Separator:": "自訂分隔符自訂分隔符號:",
11181118 "Insertion Depth:": "插入深度:",
11191119 "Token Probabilities": "符元機率",
11201120 "Select a token to see alternatives considered by the AI.": "選擇一個符元以檢視 AI 考慮的替代方案",
@@ -1125,7 +1125,7 @@
11251125 "Abort script execution": "中止腳本執行",
11261126 "Abort request": "中止請求",
11271127 "Continue the last message": "繼續生成最新訊息",
11281128 "Send a message": "發送訊息傳送訊息",
11291129 "Close chat": "關閉聊天",
11301130 "Toggle Panels": "切換面板",
11311131 "Back to parent chat": "返回上層聊天",
@@ -1156,7 +1156,7 @@
11561156 "File per article": "每篇文章一個檔案",
11571157 "Each article will be saved as a separate file.": "每篇文章將另存為一個檔案。",
11581158 "Data Bank": "資料庫",
11591159 "These files will be available for extensions that support attachments (e.g. Vector Storage).": "這些檔案將可用於支援附件的擴充功能(例如向量存儲例如向量儲存)。",
11601160 "Supported file types: Plain Text, PDF, Markdown, HTML, EPUB.": "支援的檔案類型:純文字,PDF,Markdown,HTML,EPUB。",
11611161 "Drag and drop files here to upload.": "拖放檔案至此即可上傳。",
11621162 "Date (Newest First)": "日期(最新優先)",
@@ -1172,7 +1172,7 @@
11721172 "These files are available for all characters in all chats.": "適用於所有聊天、所有角色。",
11731173 "Character Attachments": "角色附件",
11741174 "These files are available the current character in all chats they are in.": "適用於該角色參與的所有聊天。",
11751175 "Saved locally. Not exported.": "僅本地保存僅本機儲存,不匯出。",
11761176 "Chat Attachments": "聊天附件",
11771177 "These files are available to all characters in the current chat.": "適用於本次聊天中的所有角色。",
11781178 "Enter a base URL of the MediaWiki to scrape.": "輸入要抓取的 MediaWiki 的基礎 URL。",
@@ -1189,7 +1189,7 @@
11891189 "ext_sum_memory_placeholder": "將在此生成摘要⋯",
11901190 "Trigger a summary update right now.": "立即更新摘要內容。",
11911191 "ext_sum_force_text": "重新摘要",
11921192 "Disable automatic summary updates. While paused, the summary remains as-is. You can still force an update by pressing the Summarize now button (which is only available with the Main API).": "停用自動摘要更新。暫停時,摘要保持原樣。您仍可以透過點擊您仍可以透過點選「重新摘要」按鈕強制更新(僅適用於使用「主要 API」)。",
11931193 "ext_sum_pause": "暫停",
11941194 "Omit World Info and Author's Note from text to be summarized. Only has an effect when using the Main API. The Extras API always omits WI/AN.": "摘要時將省略世界資訊和作者備註。此選項僅適用於使用主要 API,擴充功能 API 始終自動省略世界資訊與作者備註。",
11951195 "ext_sum_no_wi_an": "排除世界資訊及作者備註",
@@ -1204,7 +1204,7 @@
12041204 "ext_sum_prompt_builder_3": "經典、阻塞",
12051205 "Summary Prompt": "摘要提示詞",
12061206 "ext_sum_restore_default_prompt_tip": "還原為預設提示詞",
12071207 "ext_sum_prompt_placeholder": "此提示詞將發送給此提示詞將傳送給 AI 以請求生成摘要。{{words}} 將解析為「字數」參數。",
12081208 "ext_sum_target_length_1": "目標摘要長度",
12091209 "ext_sum_target_length_2": "(",
12101210 "ext_sum_target_length_3": "字)",
@@ -1222,17 +1222,17 @@
12221222 "ext_sum_update_every_words_1": "更新每",
12231223 "ext_sum_update_every_words_2": " 字",
12241224 "ext_sum_both_sliders": "若兩個滑桿數值皆不為零,則將各自按照其時間間隔更新摘要。",
12251225 "ext_sum_injection_template": "插入模板插入範本",
12261226 "ext_sum_memory_template_placeholder": "{{summary}} 會解析為目前的摘要內容。",
12271227 "ext_sum_injection_position": "插入位置",
12281228 "How many messages before the current end of the chat.": "距離本次聊天結尾前的訊息數量。",
12291229 "ext_regex_title": "正規表示式",
12301230 "ext_regex_new_global_script": "+ 全域",
12311231 "ext_regex_new_scoped_script": "+ 局部區域",
12321232 "ext_regex_import_script": "匯入腳本",
12331233 "ext_regex_global_scripts": "全域腳本",
12341234 "ext_regex_global_scripts_desc": "適用於所有角色,資料將儲存到本地資料將儲存到本機。",
12351235 "ext_regex_scoped_scripts": "局部腳本區域腳本",
12361236 "ext_regex_scoped_scripts_desc": "僅適用於目前角色,資料將儲存到該角色卡中。",
12371237 "Regex Editor": "正規表示式編輯器",
12381238 "Test Mode": "測試模式",
@@ -1247,17 +1247,17 @@
12471247 "ext_regex_replace_string_placeholder": "使用 {{match}} 來包含來自尋找正規表示式的匹配文字或 $1、$2 等捕獲組。",
12481248 "Trim Out": "修剪掉",
12491249 "ext_regex_trim_placeholder": "在取代之前,全域修剪正規表示式匹配中的任何不需要的部分。每個元素用輸入鍵分隔。",
12501250 "ext_regex_affects": "影響對象影響物件",
12511251 "ext_regex_user_input": "使用者輸入",
12521252 "ext_regex_ai_output": "AI 輸出",
12531253 "Slash Commands": "斜線命令",
12541254 "ext_regex_min_depth_desc": "當應用於提示或顯示時,僅影響至少 N 層深的消息層深的訊息 0 = 最後一則訊息,1 = 倒數第二個訊息等。",
12551255 "Min Depth": "最小深度",
12561256 "ext_regex_min_depth_placeholder": "無限制",
12571257 "ext_regex_max_depth_desc": "當應用於提示或顯示時,僅影響不超過 N 層深度的訊息。0 = 最後一則訊息,1 = 倒數第二個訊息等。",
12581258 "ext_regex_other_options": "其他選項",
12591259 "Only Format Display": "僅修改聊天顯示",
12601260 "ext_regex_only_format_prompt_desc": "不修改聊天記錄,僅修改發送訊息僅修改傳送訊息請求文本生成時請求文字生成時)時的系統提示詞。",
12611261 "Only Format Prompt (?)": "僅修改系統提示詞",
12621262 "Run On Edit": "編輯時執行",
12631263 "ext_regex_substitute_regex_desc": "在執行「尋找正規表達式」前,將 {{macros}}(巨集)替換為對應內容",
@@ -1267,7 +1267,7 @@
12671267 "ext_regex_enable_script": "啟用腳本",
12681268 "ext_regex_edit_script": "編輯腳本",
12691269 "ext_regex_move_to_global": "移至全域腳本",
12701270 "ext_regex_move_to_scoped": "移至作用域腳本移至區域腳本",
12711271 "ext_regex_export_script": "匯出腳本",
12721272 "ext_regex_delete_script": "刪除腳本",
12731273 "Trigger Stable Diffusion": "觸發 Stable Diffusion",
@@ -1281,24 +1281,24 @@
12811281 "Image Generation": "圖片生成設定",
12821282 "sd_refine_mode": "允許在傳送至生成 API 前,手動編輯提示詞字串",
12831283 "sd_refine_mode_txt": "生成前編輯提示詞",
12841284 "sd_interactive_mode": "當發送當傳送「給我一張貓的圖片」這類訊息時,自動生成圖片。",
12851285 "sd_interactive_mode_txt": "互動模式",
12861286 "sd_multimodal_captioning": "根據使用者和角色的頭像,使用多模態模型描述生成肖像提示詞。",
12871287 "sd_multimodal_captioning_txt": "對肖像使用多模態模型描述",
12881288 "sd_expand": "使用文本生成模型自動擴寫提示詞使用文字生成模型自動擴寫提示詞。",
12891289 "sd_expand_txt": "自動潤色提示詞自動潤飾提示詞",
12901290 "sd_snap": "對於具有特定長寬比的生成請求(如肖像、背景),將其調整至最接近的已知解析度,同時儘量保持絕對像素數(建議用於 SDXL)。",
12911291 "sd_snap_txt": "自動調整解析度",
12921292 "Source": "來源",
12931293 "sd_auto_url": "範例: {{auto_url}}",
12941294 "Authentication (optional)": "授權驗證(選填)",
12951295 "Example: username:password": "範例:帳號:密碼",
12961296 "Important:": "重要:",
12971297 "sd_auto_auth_warning_1": "使用",
12981298 "sd_auto_auth_warning_2": "旗標執行 SD Web UI!伺服器必須能夠被 SillyTavern 主機存取。",
12991299 "sd_drawthings_url": "範例: {{drawthings_url}}",
13001300 "sd_drawthings_auth_txt": "執行 DrawThings 應用程式並在介面中啟用 HTTP API 開關!伺服器必須能夠被 SillyTavern 主機存取。",
13011301 "sd_vlad_url": "範例: {{vlad_url}}",
13021302 "The server must be accessible from the SillyTavern host machine.": "伺服器必須能夠被 SillyTavern 主機存取。",
13031303 "Hint: Save an API key in AI Horde API settings to use it here.": "提示訊息:在 AI Horde API 設定中儲存一個 API 金鑰,以便在此使用。",
13041304 "Allow NSFW images from Horde": "允許來自 Horde 的 NSFW 圖片",
@@ -1312,7 +1312,7 @@
13121312 "Image Quality": "圖片品質",
13131313 "Standard": "標準",
13141314 "HD": "高畫質",
13151315 "sd_comfy_url": "範例: {{comfy_url}}",
13161316 "Open workflow editor": "開啟 workflow 編輯器",
13171317 "Create new workflow": "建立新的 workflow",
13181318 "Delete workflow": "刪除 workflow",
@@ -1330,14 +1330,14 @@
13301330 "SMEA": "SMEA",
13311331 "DYN variants of SMEA samplers often lead to more varied output, but may fail at very high resolutions.": "SMEA 取樣器的 DYN 變體通常會產生更多樣化的輸出,但在非常高的解析度下可能會失敗。",
13321332 "DYN": "DYN",
13331333 "Scheduler": "調度器排程器",
13341334 "Restore Faces": "修復臉部",
13351335 "Hires. Fix": "高解析度修正",
13361336 "Upscaler": "放大演算法放大演演算法",
13371337 "Upscale by": "放大倍率",
13381338 "Denoising strength": "重繪幅度",
13391339 "Hires steps (2nd pass)": "高解析步驟(2nd pass)",
13401340 "Preset for prompt prefix and negative prompt": "提示詞前綴和負面提示詞的預設設定提示詞前綴和負面提示詞的預設設定檔",
13411341 "Style": "樣式",
13421342 "Save style": "儲存樣式",
13431343 "Delete style": "刪除樣式",
@@ -1346,9 +1346,9 @@
13461346 "Negative common prompt prefix": "通用負面提示詞前綴",
13471347 "Character-specific prompt prefix": "角色提示詞前綴",
13481348 "Won't be used in groups.": "群聊中無效",
13491349 "sd_character_prompt_placeholder": "描述該角色的特徵。這些特徵將添加在通用提示詞前綴之後這些特徵將新增在通用提示詞前綴之後。例如:女性、綠色眼睛、棕色頭髮、粉紅色襯衫。",
13501350 "Character-specific negative prompt prefix": "角色負面提示詞前綴",
13511351 "sd_character_negative_prompt_placeholder": "不應出現在該角色上的任何特徵。這些特徵將添加在負面通用提示詞前綴之後這些特徵將新增在負面通用提示詞前綴之後。例如:珠寶、鞋子、眼鏡。",
13521352 "Shareable": "分享至角色卡",
13531353 "Image Prompt Templates": "圖片生成提示詞",
13541354 "Vectors Model Warning": "向量模型警告",
@@ -1358,7 +1358,7 @@
13581358 "Status:": "狀態:",
13591359 "Created:": "建立於:",
13601360 "Display Name:": "顯示名稱:",
13611361 "User Handle:": "使用者控制代碼使用者控制程式碼:",
13621362 "Password:": "密碼:",
13631363 "Confirm Password:": "確認密碼:",
13641364 "This will create a new subfolder...": "這將建立一個新的子資料夾⋯",
@@ -1372,10 +1372,10 @@
13721372 "Also wipe user data.": "同時清除使用者資料。",
13731373 "Warning:": "警告:",
13741374 "This action is irreversible.": "此動作不可逆轉。",
13751375 "Type the user's handle below to confirm:": "在下方輸入使用者的控制代碼以確認在下方輸入使用者的控制程式碼以確認:",
13761376 "Import Characters": "匯入角色",
13771377 "Enter the URL of the content to import": "輸入要匯入的內容的 URL",
13781378 "Supported sources:": "支持的來源支援的來源:",
13791379 "char_import_1": "Chub 角色(直接連結或 ID)",
13801380 "char_import_example": "例子:",
13811381 "char_import_2": "Chub Lorebook(直接連結或 ID)",
@@ -1387,7 +1387,7 @@
13871387 "char_import_8": "RisuRealm 角色(直接連結)",
13881388 "Supports importing multiple characters.": "支援匯入多個字元。",
13891389 "Write each URL or ID into a new line.": "將每個 URL 或 ID 寫入新行。",
13901390 "Export for character": "匯出字符匯出字元",
13911391 "Export prompts for this character, including their order.": "匯出該角色的提示,包括其順序。",
13921392 "Export all": "全部匯出",
13931393 "Export all your prompts to a file": "將所有提示匯出到文件",
@@ -1395,7 +1395,7 @@
13951395 "Delete prompt": "刪除提示",
13961396 "Import a prompt list": "匯入提示列表",
13971397 "Export this prompt list": "匯出此提示列表",
13981398 "Reset current character": "重置目前字符重設目前字元",
13991399 "New prompt": "新提示",
14001400 "Prompts": "提示",
14011401 "Total Tokens:": "代幣總數:",
@@ -1444,93 +1444,92 @@
14441444 "Still have questions?": "仍有更多問題?",
14451445 "Join the SillyTavern Discord": "加入 SillyTavern Discord",
14461446 "Post a GitHub issue": "發布 GitHub 問題",
14471447 "Contact the developers": "聯繫開發者聯絡開發者",
14481448 "(-1 for random)": "(-1 表示隨機)",
14491449 "(Optional)": "(可選)",
14501450 "(use _space": "(使用",
14511451 "api_no_connection": "未連線⋯",
14521452 "No model description": "[無描述]",
14531453 "openai_logit_bias_no_items": "無項目",
14541454 "Any contents here will replace the default Post-History Instructions used for this character. (v2 specpost_history_instructions)": "此處填入的內容將取代該角色的默認聊天歷史後指示此處填入的內容將取代該角色的預設聊天歷史後指示(Post-History Instructions)。\n(v2 格式:specpost_history_instructions)",
14551455 "comma delimited,no spaces between": "逗號分割,無需空格",
14561456 "e.g. black-forest-labs/FLUX.1-dev": "例如:black-forest-labs/FLUX.1-dev",
14571457 "Example: gpt-4o": "例如:gpt-4o",
14581458 "Example: http://localhost:1234/v1": "例如:http://localhost:1234/v1",
14591459 "popup-button-crop": "裁剪",
14601460 "(disabled when max recursion steps are used)": "(當最大遞歸步驟數使用時將停用當最大遞迴步驟數使用時將停用)",
1461- "0 = unlimited, 1 = scans once and doesn't recurse, 2 = scans once and recurses once, etc\n(disabled when min activations are used)": "0 = 無限制,1 = 掃描一次且不遞歸,2 = 掃描一次並遞歸一次,以此類推\n(使用最小啟動設定時將停用)",
1461+ "A greedy, brute-force algorithm used in LLM sampling to find the most likely sequence of words or tokens. It expands multiple candidate sequences at once, maintaining a fixed number (beam width) of top sequences at each step.": "一種用於 LLM 抽樣的貪婪演演算法,用於尋找最可能的單詞或標記序列。該方法會同時展開多個候選序列,並在每一步中保持固定數量的頂級序列(beam width)。",
1462- "A greedy, brute-force algorithm used in LLM sampling to find the most likely sequence of words or tokens. It expands multiple candidate sequences at once, maintaining a fixed number (beam width) of top sequences at each step.": "一種用於 LLM 抽樣的貪婪演算法,用於尋找最可能的單詞或標記序列。該方法會同時展開多個候選序列,並在每一步中保持固定數量的頂級序列(beam width)。",
14631462 "A multiplicative factor to expand the overall area that the nodes take up.": "節點佔用該擴充功能區域的倍數。",
14641463 "Abort current image generation task": "終止目前的圖片生成任務",
14651464 "Add Character and User names to a list of stopping strings.": "將角色和使用者角色名稱添加至停止字符列表將角色和使用者角色名稱新增至停止字元列表。",
14661465 "Alignment for rank nodes.": "對排名節點的對齊方式。",
14671466 "Always show the node full info panel at the bottom left of the timeline view. When off, show it near the node.": "始終將節點的完整資訊面板顯示在時間軸視圖的左下角始終將節點的完整資訊面板顯示在時間軸檢視的左下角。關閉時,將顯示在節點附近。",
14681467 "Always show the node tooltip at the bottom left of the timeline view. When off, show it near the node.": "始終將節點的工具提示欄顯示在時間軸視圖的左下角始終將節點的工具提示欄顯示在時間軸檢視的左下角。關閉時,將顯示在節點附近。",
14691468 "Apply current sorting as Order": "應用此排序為順序",
14701469 "Cap the number of entry activation recursions": "限制入口啟動的遞歸次數限制入口啟動的遞迴次數",
14711470 "Caption": "標題",
14721471 "Close popup": "關閉彈出視窗",
14731472 "Color configuration for Timelines when 'Use UI Theme' in Style Settings is off.": "關閉「使用介面主題」的時間線顏色。",
14741473 "context_allow_post_history_instructions": "在文本完成模式中包含聊天歷史後指示在文字完成模式中包含聊天歷史後指示(Post-History Instructions),但可能導致不良輸出。",
14751474 "Create a new connection profile": "建立新的連線設定檔",
14761475 "Defines on importing cards which action should be chosen for importing its listed tags. 'Ask' will always display the dialog.": "定義匯入角色卡時應採取的動作。選擇「詢問」將始終顯示對話框。",
14771476 "delay_until_recursion_level": "定義遞迴掃描的延遲層級。\r最初僅匹配第一層(數字最小的層級)。\r未找到匹配時,下一層將成為可匹配的層級。\r此過程會重複,直到所有層級都被檢查完畢。\r與「延遲至遞歸延遲至遞迴」設定相關聯。",
14781477 "Delete a connection profile": "刪除連線設定檔",
14791478 "Delete template": "刪除模板刪除範本",
14801479 "Delete the template": "刪除此模板刪除此範本",
14811480 "Disabling is not recommended.": "不建議禁用不建議停用。",
14821481 "Display swipe numbers for all messages, not just the last.": "顯示所有訊息的滑動編號,而不僅是最後一條訊息。",
14831482 "Duplicate persona": "複製使用者角色",
14841483 "Edit a connection profile": "編輯連線設定檔",
14851484 "Enable auto-select of input text in some text fields when clicking/selecting them. Applies to popup input textboxes, and possible other custom input fields.": "啟用自動選擇輸入框中的文本啟用自動選擇輸入框中的文字,適用於彈出輸入框及其他自定義輸入框。",
14861485 "Entries with a cooldown can't be activated N messages after being triggered.": "設有冷卻時間的條目於觸發後的 N 條訊息內無法再次啟用。",
14871486 "Entries with a delay can't be activated until there are N messages present in the chat.": "有延遲的條目需等待聊天中出現 N 條訊息後才能啟用。",
14881487 "Expand swipe nodes when the timeline view first opens, and whenever the graph is refreshed. When off, you can expand them by long-pressing a node, or by pressing the Toggle Swipes button.": "時間線視圖首次打開或刷新時展開滑動節點時間線檢視首次開啟或重新整理時展開滑動節點關閉時可通過長按節點或點選關閉時可透過長按節點或點選「切換滑動」按鈕展開。",
14891488 "Export Advanced Formatting settings": "匯出進階格式設定",
14901489 "Export template": "匯出模板匯出範本",
14911490 "Find similar characters": "尋找相似角色",
14921491 "Height of a node, in pixels at zoom level 1.0.": "縮放等級為 1.0 時的節點像素高度。",
14931492 "How the automatic graph builder assigns a rank (layout depth) to graph nodes.": "自動圖表生成器分配圖節點等級(佈局深度配置深度)的方式。",
14941493 "If checked and the character card contains a Post-History Instructions override, use that instead": "勾選後,將使用角色卡中的聊天歷史後指示(Post-History Instructions)覆蓋。",
14951494 "Import Advanced Formatting settings": "匯入進階格式設定\n也可提供舊版檔案作為提示詞和上下文範本使用",
14961495 "Import template": "匯入模板匯入範本",
14971496 "In group chat, highlight the character(s) that are currently queued to generate responses and the order in which they will respond.": "在群組聊天中,突出顯示該生成回應的角色及順序。",
14981497 "Include names with each message into the context for scanning": "將每條訊息的名稱納入掃描上下文",
14991498 "Inserted before the first User's message": "插入到第一條使用者訊息前。",
15001499 "instruct_enabled": "啟用指令模式(Instruct Mode)",
15011500 "instruct_last_input_sequence": "插入到最後一條使用者訊息之前。",
15021501 "instruct_template_activation_regex_desc": "連線 API 或選擇模型時,若模型名稱符合所提供的正規表達式,則自動啟動該指令模板則自動啟動該指令範本(Instruct Template)。",
15031502 "Load Asset List": "載入資源列表",
15041503 "load_asset_list_desc": "根據資源列表文件載入擴充功能及資源。\n\n該字段中的默認資源n該欄位中的預設資源 URL 指向官方擴充功能及資源列表。\n可在此插入您的自定義資源列表。\n\n若需安裝單個第三方擴充功能,請使用右上角的「安裝擴充功能」按鈕。",
15051504 "markdown_hotkeys_desc": "啟用快捷鍵以在某些文本輸入框中插入啟用快捷鍵以在某些文字輸入框中插入 Markdown 格式字符格式字元。詳見「/help hotkeys」。",
15061505 "Not all samplers supported.": "並非所有採樣器均受支援並非所有取樣器均受支援。",
15071506 "Open the timeline view. Same as the slash command '/tl'.": "打開時間線視圖開啟時間線檢視,與斜線指令「/tl」相同。",
15081507 "Penalize sequences based on their length.": "根據序列長度進行懲罰。",
15091508 "Reload a connection profile": "重新載入連線設定檔",
15101509 "Rename current preset": "重新命名此預設重新命名此預設設定檔",
15111510 "Rename current prompt": "重新命名此提示詞",
15121511 "Rename current template": "重新命名此模板重新命名此範本",
15131512 "Reset all Timelines settings to their default values.": "將所有時間軸設定重置為預設值將所有時間軸設定重設為預設值。",
15141513 "Restore current prompt": "還原目前的提示詞",
15151514 "Restore current template": "還原目前的模板還原目前的範本",
15161515 "Save prompt as": "另存提示詞為",
15171516 "Save template as": "另存模板為另存範本為",
15181517 "sd_adetailer_face": "在生成過程中使用 ADetailer 臉部模型。需在後端安裝 ADetailer 擴充功能。",
15191518 "sd_free_extend": "自動使用目前選定的 LLM 擴充功能的「自由模式」提示詞(不包括肖像或背景)。",
15201519 "sd_function_tool": "使用功能工具自動檢測意圖以生成圖片使用功能工具自動偵測意圖以生成圖片。",
15211520 "Seed_desc": "用於生成確定性和可重現輸出的隨機種子。設定為 -1 時將使用隨機種子。",
15221521 "Select your current Context Template": "選擇您目前的上下文模板選擇您目前的上下文範本",
15231522 "Select your current Instruct Template": "選擇您目前的指令模板選擇您目前的指令範本",
15241523 "Select your current System Prompt": "選擇您目前的系統提示詞",
15251524 "Separation between adjacent edges in the same rank.": "同一層級中相鄰邊之間的間距。",
15261525 "Separation between adjacent nodes in the same rank.": "同一層級中相鄰節點之間的間距。",
15271526 "Separation between each rank in the layout.": "佈局中各層級之間的間距配置中各層級之間的間距。",
15281527 "Settings for the visual appearance of the Timelines graph.": "時間線圖形的視覺外觀設置時間線圖形的視覺外觀設定。",
15291528 "Show a button in the input area to ask the AI to impersonate your character for a single message": "於輸入框中添加按鈕於輸入框中新增按鈕,讓 AI 模仿您的角色發送一則訊息模仿您的角色傳送一則訊息。",
15301529 "Show a legend for colors corresponding to different characters and chat checkpoints.": "顯示一個圖例,標註不同角色和對話檢查點對應的顏色。",
15311530 "Show the AI character's avatar as the graph root node. When off, the root node is blank.": "將 AI 角色的頭像作為圖形的根節點;關閉時,根節點為空。",
15321531 "Sticky entries will stay active for N messages after being triggered.": "觸發後,置頂條目將在接下來的 N 條訊息中保持活躍。",
15331532 "stscript_parser_flag_replace_getvar_label": "防止 {{getvar::}} 和 {{getglobalvar::}} 巨集的字面巨集樣值被自動解析。\n例如,{{newline}} 將保持為字面字串 {{newline}}。\n\n(此功能通過內部將此功能透過內部將 {{getvar::}} 和 {{getglobalvar::}} 巨集替換為局部變數來實現巨集替換為區域變數來實現。)",
15341533 "Style and routing of graph edges.": "圖形邊的樣式和路徑。",
15351534 "Swap width and height": "交換寬度與高度",
15361535 "Swipe left": "向左滑動",
@@ -1541,14 +1540,14 @@
15411540 "The visual appearance of a node in the graph.": "圖形中節點的視覺外觀。",
15421541 "Update a connection profile": "更新連線設定檔",
15431542 "Update current prompt": "更新此提示詞",
15441543 "Update current template": "更新此模板更新此範本",
15451544 "Use GPU acceleration for positioning the full info panel that appears when you click a node. If the tooltip arrow tends to disappear, turning this off may help.": "啟用 GPU 加速來定位點擊節點時出現的完整資訊面板加速來定位點選節點時出現的完整資訊面板。若發現工具提示箭頭經常消失,可考慮關閉此功能。",
15461545 "Use the colors of the ST GUI theme, instead of the colors configured in Color Settings specifically for this extension.": "使用使用者設定中的介面主題顏色,取代下方「顏色設定」中額外設定的顏色。",
15471546 "View connection profile details": "查看連線設定檔詳情檢視連線設定檔詳細資訊",
15481547 "When enabled, nodes that have swipes splitting off of them will appear subtly larger, in addition to having the double border.": "啟用後,具分支滑動的節點將顯示雙重邊框,還會略微放大。",
15491548 "WI Entry Status:🔵 Constant🟢 Normal🔗 Vectorized": "世界資訊條目狀態:\\r🔵 恆定\\r🟢 正常\\r🔗 向量化",
15501549 "Width of a node, in pixels at zoom level 1.0.": "縮放等級為 1.0 時,節點的像素寬度。",
15511550 "world_button_title": "角色背景設定\n「Shift+點擊點選」可開啟「連結至世界資訊」彈窗",
15521551 "# of Beams": "# of Beams",
15531552 "01.AI API Key": "01.AI API 金鑰",
15541553 "01.AI Model": "01.AI 模型",
@@ -1559,7 +1558,7 @@
15591558 "Allow Post-History Instructions": "允許聊天歷史後指示",
15601559 "Allow reverse proxy": "允許反向代理",
15611560 "Alternate Greeting #": "備選問候語 #",
15621561 "alternate_greetings_hint_1": "點擊點選",
15631562 "alternate_greetings_hint_2": "按鈕開始!",
15641563 "Always": "總是",
15651564 "ANY support requests will be REFUSED if you are using a proxy.": "使用代理時,所有支援請求均不予受理。",
@@ -1571,14 +1570,13 @@
15711570 "Assistant Message Sequences": "助理訊息序列",
15721571 "Assistant Prefix": "助理訊息前綴",
15731572 "Assistant Suffix": "助理訊息後綴",
1574- "at the end of the URL!": "在 URL 末尾!",
15751573 "Audio Playback Speed": "音檔播放速度",
15761574 "Auto-select Input Text": "自動選擇輸入文本自動選擇輸入文字",
15771575 "Automatically caption images": "自動產生圖片註解",
15781576 "Auxiliary": "輔助提示詞",
15791577 "Background Image": "背景圖片",
15801578 "Block Entropy API Key": "Block Entropy API 金鑰",
15811579 "Can be set manually or with an _space": "可以手動設置或使用可以手動設定或使用 _space",
15821580 "Caption Prompt": "註解功能提示詞",
15831581 "category": "類別",
15841582 "Character Expressions": "角色情緒立繪",
@@ -1591,12 +1589,12 @@
15911589 "Checkpoint Color": "檢查點節點邊框顏色",
15921590 "Chunk boundary": "Chunk 邊界",
15931591 "Chunk overlap (%)": "Chunk 重疊(%)",
15941592 "Chunk size (chars)": "Chunk 大小(字符數字元數)",
15951593 "class": "所有類別",
15961594 "Classifier API": "分類器 API",
15971595 "Click to set": "點擊以設定點選以設定",
15981596 "CLIP Skip": "CLIP 跳過",
15991597 "Completion Object": "完成對象完成物件",
16001598 "Conf": "設定檔",
16011599 "Connection Profile": "連線設定檔",
16021600 "Cooldown": "冷卻時間",
@@ -1605,13 +1603,13 @@
16051603 "currently_selected": "[目前已選取]",
16061604 "Custom (OpenAI-compatible)": "自定義(相容 OpenAI)",
16071605 "Custom Expressions": "自定義角色表情",
16081606 "Data Bank files": "數據庫文件資料庫文件",
16091607 "Default / Fallback Expression": "默認預設/回退表情",
16101608 "Delay": "延遲",
16111609 "Delay until recursion (can only be activated on recursive checking)": "遞迴掃描延遲(僅在啟用遞迴掃描時可用)",
16121610 "Do not proceed if you do not agree to this!": "若不同意此條款,請勿繼續!",
16131611 "Edge Color": "邊緣顏色",
16141612 "Edit captions before saving": "在保存前編輯註解在儲存前編輯註解",
16151613 "Enable for files": "啟用文件檔案向量化",
16161614 "Enable for World Info": "啟用世界資訊向量化",
16171615 "enable_functions_desc_1": "允許使用",
@@ -1623,8 +1621,8 @@
16231621 "Enter a Model ID": "輸入模型 ID",
16241622 "Example: https://****.endpoints.huggingface.cloud": "例如:https://****.endpoints.huggingface.cloud",
16251623 "Exclude": "排除",
16261624 "Exclude Top Choices (XTC)": "排除頂部選項排除頂端選項(XTC)",
16271625 "Existingtag_import_existing": "現有項目",
16281626 "expression_label_pattern": "[情緒名稱].[圖檔格式](例如:neutral.png)。",
16291627 "ext_translate_auto_mode": "自動翻譯模式",
16301628 "ext_translate_btn_chat": "翻譯聊天內容",
@@ -1644,16 +1642,15 @@
16441642 "File vectorization settings": "檔案向量化設定",
16451643 "Filter to Characters or Tags": "角色/標籤篩選",
16461644 "First User Prefix": "第一使用者前綴",
16471645 "folder of your user data directory and name it as the name of the character.": "」中新建資料夾中新增資料夾,並將該資料夾命名為角色名稱(名稱需與使用者資料夾中的角色名稱一致)。",
16481646 "Group Scoring": "群組評分",
16491647 "Groups and Past Personas": "群組與過去的使用者角色設定",
16501648 "Hint:": "提示:",
16511649 "Hint: Set the URL in the API connection settings.": "提示:在 API 連線設置中設定連線設定中設定 URL。",
16521650 "Horde": "Horde",
16531651 "HuggingFace Token": "HuggingFace 符元",
16541652 "Image Captioning": "圖片註解",
16551653 "Generate Caption": "產生圖片註解",
1656- "Image Type - talkinghead (extras)": "圖片類型 - talkinghead(額外選項)",
16571654 "Injection Position": "插入位置",
16581655 "Injection position. Relative (to other prompts in prompt manager) or In-chat @ Depth.": "插入位置(與提示詞管理器中的其他提示相比)或聊天中的深度位置。",
16591656 "Injection Template": "插入範本",
@@ -1662,17 +1659,17 @@
16621659 "Instruct Template": "指令範本",
16631660 "Interactive Mode": "互動模式",
16641661 "Karras": "Karras",
16651662 "Keep model in memory": "將模型保存在記憶體中將模型儲存在記憶體中",
16661663 "Keyboard": "鍵盤:",
16671664 "AI Horde Website": "AI Horde 網站",
16681665 "Last User Prefix": "最後用戶前綴最後使用者前綴",
16691666 "Linear": "線性",
16701667 "LLM": "LLM",
16711668 "LLM Prompt": "LLM 提示詞",
16721669 "Load a custom asset list or select": "載入或選擇自定義資源列表",
16731670 "Load an asset list": "載入資源列表",
16741671 "Local": "本地本機",
16751672 "Local (Transformers)": "本地本機(Transformers)",
16761673 "macro)": "巨集)",
16771674 "Main API": "主要 API",
16781675 "Markdown Hotkeys": "Markdown 快捷鍵",
@@ -1681,20 +1678,20 @@
16811678 "Max Entries": "最大條目數",
16821679 "Max Recursion Steps": "最大遞迴步數",
16831680 "Message attachments": "訊息附件",
16841681 "Message Template": "訊息模板訊息範本",
16851682 "Model ID": "模型 ID",
16861683 "mui_reset": "重置重設",
16871684 "Multimodal (OpenAI / Anthropic / llama / Google)": "多模態(OpenAI/Anthropic/llama/Google)",
16881685 "must be set in Tabby's config.yml to switch models.": "須在 Tabby's config.yml 中設置以切換模型中設定以切換模型。",
16891686 "Names as Stop Strings": "將名稱用作停止字串",
16901687 "Never": "從不",
16911688 "NomicAI API Key": "NomicAI API 金鑰",
16921689 "Non-recursable (will not be activated by another)": "不可遞迴(不會被其他條目啟動)",
16931690 "None (disabled)": "無(已禁用已停用)",
16941691 "OK": "確定",
16951692 "Old messages are vectorized gradually as you chat. To process all previous messages, click the button below.": "舊訊息會在聊天時逐步向量化。\n若要處理所有先前訊息,請點擊下方按鈕請點選下方按鈕。",
16961693 "Only used when Main API or WebLLM Extension is selected.": "僅在選擇主要 API 或 WebLLM 擴充功能時使用。",
16971694 "Open a chat to see the character expressions.": "開啟聊天以查看角色表情開啟聊天以檢視角色表情。",
16981695 "Post-History Instructions": "聊天歷史後指示",
16991696 "Prefer Character Card Instructions": "角色卡聊天歷史後指示優先",
17001697 "Prioritize": "優先處理",
@@ -1708,7 +1705,7 @@
17081705 "Quick Impersonate button": "快速模擬按鈕",
17091706 "Recursion Level": "遞迴層級",
17101707 "Remove all image overrides": "移除所有圖片覆蓋",
17111708 "Restore default": "恢復預設",
17121709 "Retain#": "保留#",
17131710 "Retrieve chunks": "檢索 Chunks",
17141711 "Sampler Order": "取樣順序",
@@ -1716,7 +1713,7 @@
17161713 "sd_free_extend_small": "(互動/指令)",
17171714 "sd_free_extend_txt": "使用「自由模式」。由 LLM 自動擴寫圖片生成提示",
17181715 "sd_function_tool_txt": "使用功能工具",
17191716 "sd_prompt_-1": "聊天訊息模板聊天訊息範本",
17201717 "sd_prompt_-2": "功能工具提示詞",
17211718 "sd_prompt_0": "角色(第二人稱,你)",
17221719 "sd_prompt_1": "使用者(第一人稱,我)",
@@ -1734,19 +1731,19 @@
17341731 "Select with Enter": "按 Enter 選擇",
17351732 "Select with Tab": "按 Tab 選擇",
17361733 "Select with Tab or Enter": "按 Tab 或 Enter 選擇",
17371734 "Separators as Stop Strings": "以分隔符作為停止字串以分隔符號作為停止字串",
17381735 "Set the default and fallback expression being used when no matching expression is found.": "設定在無法配對表情時所使用的預設表情和備用圖片。",
17391736 "Set your API keys and endpoints in the API Connections tab first.": "請先在「API 連線」頁面中設定您的 API 金鑰和端點。",
17401737 "Show default images (emojis) if sprite missing": "無對應圖片時,顯示為預設表情符號(emoji)",
17411738 "Show group chat queue": "顯示群組聊天隊列顯示群組聊天佇列",
17421739 "Size threshold (KB)": "大小閾值(KB)",
17431740 "Slash Command": "斜線命令",
17441741 "space_ slash command.": " 斜線命令。",
17451742 "Sprite Folder Override": "表情立繪資料夾覆蓋",
17461743 "Sprite set:": "立繪組:",
17471744 "Show Gallery": "查看圖庫檢視相簿",
17481745 "Sticky": "黏性",
17491746 "Style Preset": "預設樣式樣式預設設定檔",
17501747 "Summarize chat messages for vector generation": "摘要聊天訊息以進行向量化處理",
17511748 "Summarize chat messages when sending": "傳送時摘要聊天內容",
17521749 "Swipe # for All Messages": "為所有訊息分配滑動編號 #",
@@ -1758,16 +1755,16 @@
17581755 "tag_import_all": "全部匯入",
17591756 "tag_import_none": "不匯入",
17601757 "Text Generation WebUI (oobabooga)": "文字生成 WebUI (oobabooga)",
17611758 "The server MUST be started with the --embedding flag to use this feature!": "若要使用此功能,伺服器必須啟動時加上 --embedding 標誌象徵。",
17621759 "Threshold": "閾值",
17631760 "to install 3rd party extensions.": "用於安裝第三方擴充功能。",
17641761 "Top": "頂部頂端",
17651762 "Translate text to English before classification": "在分類前將文本翻譯為英文。分類前,將訊息翻譯為英文",
17661763 "Uncheck to hide the extensions messages in chat prompts.": "不勾選即可隱藏聊天提示詞中的擴充功能訊息。",
17671764 "Unchecked: only entries with ❌ status can be activated.": "未勾選時:僅允許啟用狀態為 ❌ 的條目。",
17681765 "Unified Sampling": "統一取樣(Unified Sampling)",
17691766 "Upload sprite pack (ZIP)": "批次上傳立繪包(.ZIP)",
17701767 "Use a forward slash to specify a subfolder. Example: _space": "使用「/」來設置子目錄來設定子目錄,例如:_space",
17711768 "Use ADetailer (Face)": "使用 ADetailer 進行臉部處理。",
17721769 "Use an admin API key.": "使用管理員的 API 金鑰。",
17731770 "Use global": "啟用全域設定",
@@ -1775,21 +1772,21 @@
17751772 "User Node Color": "使用者節點顏色",
17761773 "User Prefix": "使用者訊息前綴",
17771774 "User Suffix": "使用者訊息後綴",
17781775 "Using a proxy that youre not running yourself is a risk to your data privacy.": "使用非自行管理的代理服務存在數據隱私洩漏風險使用非自行管理的代理服務存在資料隱私洩漏風險。",
17791776 "Vector Storage": "向量存儲向量儲存",
17801777 "Vector Summarization": "向量摘要",
17811778 "Vectorization Model": "向量生成模型",
17821779 "Vectorization Source": "向量化來源",
17831780 "Vectorize All": "向量化全部數據向量化全部資料",
17841781 "View Stats": "查看統計資料檢視統計資料",
17851782 "Warning: This might cause your sent messages to take a bit to process and slow down response time.": "警告:這可能會導致訊息處理速度變慢,並延長回應時間。",
17861783 "WarningThis might cause your sent messages to take a bit to process and slow down response time.": "警告:這將顯著減緩向量生成速度,因為所有消息都需先進行摘要因為所有訊息都需先進行摘要。",
17871784 "WebLLM Extension": "WebLLM 擴充功能",
17881785 "Whole Words": "匹配完整單字",
17891786 "Will be used if the API doesnt support JSON schemas or function calling.": "若 API 不支持不支援 JSON 模式或函數調用模式或函式呼叫,將使用此設定。",
17901787 "World Info settings": "世界資訊設定",
17911788 "You are in offline mode. Click on the image below to set the expression.": "您目前為離線狀態,請點擊下方圖片進行表情設定請點選下方圖片進行表情設定。",
17921789 "You can find your API key in the Stability AI dashboard.": "API 金鑰可在 Stability AI 儀表板中查看儀錶板中檢視。",
17931790 "Stop Inspecting": "停止檢查",
17941791 "Inspect Prompts": "檢查提示詞",
17951792 "Toggle prompt inspection": "切換提示詞檢查",
@@ -1799,19 +1796,19 @@
17991796 "KoboldAI Horde": "KoboldAI Horde",
18001797 "KoboldAI Horde Website": "KoboldAI Horde 網站",
18011798 "Derive context size from backend": "從後端推導上下文大小",
18021799 "Using a proxy that you're not running yourself is a risk to your data privacy.": "使用非自行管理的代理服務可能導致您的數據隱私外洩使用非自行管理的代理服務可能導致您的資料隱私外洩。",
18031800 "Claude API Key": "Claude API 金鑰",
18041801 "NanoGPT API Key": "NanoGPT API 金鑰",
18051802 "NanoGPT Model": "NanoGPT 模型",
18061803 "context_derived": "若可能,根據模型元數據推導根據模型後設資料推導。",
18071804 "instruct_derived": "若可能,根據模型元數據推導根據模型後設資料推導。",
18081805 "Inserted before the first User's message.": "插入於第一則使用者訊息之前。",
18091806 "0 = unlimited, 1 = scans once and doesn't recurse, 2 = scans once and recurses once, etc\\n(disabled when min activations are used)": "0 = 無限制,1 = 掃描一次不遞歸掃描一次不遞迴,2 = 掃描一次後遞歸一次掃描一次後遞迴一次 ⋯以此類推\n(啟用最小啟動次數時無效)",
18101807 "Quick 'Impersonate' button": "快速「AI 扮演使用者」按鈕",
18111808 "Manual": "手動",
18121809 "Any contents here will replace the default Post-History Instructions used for this character. (v2 spec: post_history_instructions)": "此處填入的內容將取代該角色的默認聊天歷史後指示此處填入的內容將取代該角色的預設聊天歷史後指示(Post-History Instructions)。\n(v2 格式:specpost_history_instructions)",
18131810 "The content of this prompt is pulled from elsewhere and cannot be edited here.": "此提示內容由其他地方提取,無法在此進行編輯。",
18141811 "Open checkpoint chat\nShift+Click to replace the existing checkpoint with a new one": "開啟檢查點聊天\n使用「Shift+點擊點選」將以新檢查點替換現有的。",
18151812 "Reroll with the entire prefix": "使用完整前綴重新生成",
18161813 "Disable": "停用",
18171814 "Enable": "啟用",
@@ -1823,17 +1820,17 @@
18231820 "{{@key}}": "{{@key}}:",
18241821 "Enter a name:": "輸入名稱:",
18251822 "Omitted Settings:": "忽略的設定:",
18261823 "Will be used if the API doesn't support JSON schemas or function calling.": "將於 API 不支援 JSON 結構或函數調用時使用結構或函式呼叫時使用。",
18271824 "ext_sum_webllm": "WebLLM 擴充功能",
18281825 "ext_sum_restore_tip": "恢復先前的摘要;重複使用以清除此聊天的摘要狀態。",
18291826 "ext_sum_force_tip": "將立即更新摘要。",
18301827 "ext_sum_include_wi_scan_desc": "於掃描世界資訊時包含最新摘要。",
18311828 "ext_sum_include_wi_scan": "包含世界資訊掃描",
18321829 "None (not injected)": "無(不插入)",
18331830 "ext_sum_injection_position_none": "此摘要將不會插入提示詞中,但可通過但可透過 {{summary}} 巨集訪問巨集存取。",
18341831 "Labels and Message": "標籤與訊息",
18351832 "Label": "標籤",
18361833 "(label of the button, if no icon is chosen) ": "(若未選擇圖標若未選擇圖示,則為按鈕的標籤)",
18371834 "Title": "名稱",
18381835 "(tooltip, leave empty to show message or /command)": "(工具提示,留空以顯示訊息或 /command)",
18391836 "Message / Command:": "訊息/指令:",
@@ -1848,7 +1845,7 @@
18481845 "Execute on user message": "根據使用者訊息執行",
18491846 "Execute on AI message": "根據 AI 訊息執行",
18501847 "Execute on chat change": "聊天內容變更時執行",
18511848 "Execute on new chat": "新建聊天時執行新增聊天時執行",
18521849 "Execute on group member draft": "群組成員變更時執行",
18531850 "Automation ID:": "自動化 ID:",
18541851 "Testing": "測試",
@@ -1859,43 +1856,43 @@
18591856 "Global Quick Reply Sets": "全域快速回覆",
18601857 "Chat Quick Reply Sets": "聊天快速回覆",
18611858 "Edit Quick Replies": "編輯快速回覆",
18621859 "Disable Send (Insert Into Input Field)": "停用發送停用傳送插入到輸入字段插入到輸入欄位)",
18631860 "Place Quick Reply Before Input": "在輸入前插入快速回覆",
18641861 "Inject user input automatically": "自動插入使用者輸入",
18651862 "(if disabled, use ": "(若停用,請使用",
18661863 "macro for manual injection)": "巨集進行手動插入)",
18671864 "Color": "顏色",
18681865 "Only apply color as accent": "僅使用顏色作為強調",
18691866 "ext_regex_new_global_script_desc": "新建新增「全域」正規表達式",
18701867 "ext_regex_new_scoped_script_desc": "新建新增作用域區域」正規表達式",
18711868 "ext_regex_disallow_scoped": "不使用作用域正規表達式不使用區域正規表達式",
18721869 "ext_regex_allow_scoped": "使用作用域正規表達式使用區域正規表達式",
18731870 "ext_regex_user_input_desc": "使用者發送的訊息使用者傳送的訊息。",
18741871 "ext_regex_ai_input_desc": "從生成式 API 接收到的訊息。",
18751872 "ext_regex_slash_desc": "使用 STscript 指令發送的訊息指令傳送的訊息。",
18761873 "ext_regex_wi_desc": "世界資訊/知識書條目內容。需要勾選「僅格式化提示詞」!",
18771874 "ext_regex_run_on_edit_desc": "當指定角色的訊息被編輯時執行正規腳本。",
18781875 "Macro in Find Regex": "巨集替換模式",
18791876 "Don't substitute": "不替換(純文字匹配)",
18801877 "Substitute (raw)": "原始替換(不處理 *、. 等特殊字符等特殊字元)",
18811878 "Substitute (escaped)": "轉義替換(將特殊字符將特殊字元 *、. 等當作普通文字處理)",
18821879 "Ephemerality": "暫時性",
18831880 "ext_regex_only_format_visual_desc": "僅改變聊天界面顯示的訊息僅改變聊天介面顯示的訊息,不修改聊天記錄檔案內容。",
18841881 "Hint: Save an API key in Horde KoboldAI API settings to use it here.": "提示:請於 Horde KoboldAI API 設定中保存設定中儲存 API 金鑰以進行使用。",
18851882 "Prompt Upsampling": "提示提升(Upsampling)",
18861883 "Uncheck to hide the extension's messages in chat prompts.": "取消選取可在聊天提示詞中隱藏擴充功能的訊息。",
18871884 "ext_translate_delete_confirm_1": "確定要刪除嗎?",
18881885 "ext_translate_delete_confirm_2": "這將「永久刪除」本次聊天中所有訊息的翻譯文本本次聊天中所有訊息的翻譯文字,且無法復原。",
18891886 "Select TTS Provider": "選擇 TTS 提供者",
18901887 "tts_enabled": "啟用",
18911888 "Narrate user messages": "朗讀使用者訊息",
18921889 "Auto Generation": "自動生成",
18931890 "Requires auto generation to be enabled.": "需要啟用自動生成功能。",
18941891 "Narrate by paragraphs (when streaming)": "按段落朗讀(使用「串流」傳輸時)",
18951892 "Only narrate quotes": "僅朗讀「引號」中的文字",
18961893 "Ignore text, even quotes, inside asterisk": "忽略 *(星號)內的文字(包括「引號」)",
18971894 "Narrate only the translated text": "僅朗讀翻譯後的文本僅朗讀翻譯後的文字",
18981895 "Skip codeblocks": "跳過代碼塊跳過程式碼塊",
18991896 "Skip tagged blocks": "跳過 <標記> 塊",
19001897 "Pass Asterisks to TTS Engine": "將 *(星號)視為普通文字傳送至 TTS 引擎(否則忽略)",
19011898 "Warning: This will slow down vector generation drastically, as all messages have to be summarized first.": "警告:操作後將顯著降低向量生成速度,因為所有訊息都必須先進行摘要。",
@@ -1903,42 +1900,42 @@
19031900 "this chat is temporary and will be deleted as soon as you leave it.": "此聊天為臨時聊天,離開後將被刪除。",
19041901 "Import Tags For _begin": "為",
19051902 "Import Tags For _end": "匯入標籤",
19061903 "Click remove on any tag to remove it from this import.<br />Select one of the import options to finish importing the tags.": "點擊任意標籤上的點選任意標籤上的「移除」可將其於本次匯入中刪除。\n選擇一個匯入選項以完成標籤匯入。",
19071904 "Existing Tags": "現有標籤",
19081905 "New Tags": "新標籤",
19091906 "Folder Tags": "資料夾標籤",
19101907 "The following tags will be auto-imported based on the currently selected folders": "以下標籤將根據目前選擇的文件夾自動匯入以下標籤將根據目前選擇的資料夾自動匯入",
19111908 "Import None": "不匯入",
19121909 "Import All": "全部匯入",
19131910 "Import Existing": "匯入現有標籤",
19141911 "Import": "匯入",
19151912 "chat_rename_1": "輸入此聊天檔案的新名稱:",
19161913 "chat_rename_2": "!! 使用已存在的檔案名將導致錯誤使用已存在的檔案名稱將導致錯誤 !!",
19171914 "chat_rename_3": "這將斷開各檢查點間的連結。",
19181915 "chat_rename_4": "無需在末尾加上無需在結尾加上 `.jsonl`。",
19191916 "Include Body Parameters": "包含請求主體參數",
19201917 "custom_include_body_desc": "包含在 Chat Completion 請求體中的參數(YAML 格式)\n\n範例:\n- top_k: 20\n- repetition_penalty: 1.1",
19211918 "Exclude Body Parameters": "排除請求主體參數",
19221919 "custom_exclude_body_desc": "排除於 Chat Completion 請求體中的參數(YAML 格式)\n\n範例:\n- frequency_penalty\n- presence_penalty",
19231920 "Include Request Headers": "包含請求頭包含請求標頭(Request Headers)",
19241921 "custom_include_headers_desc": "添加於新增於 Chat Completion 請求的自定義標頭(YAML 格式)\n\n範例:\n- CustomHeader: custom-value\n- AnotherHeader: custom-value",
19251922 "THIS IS PERMANENT!": "這是「永久性」的!",
19261923 "Also delete the chat files": "同時刪除此聊天檔案",
19271924 "Are you sure you want to duplicate this character?": "您確定要複製該角色嗎?",
19281925 "If you just want to start a new chat with the same character...": "若您只是想與該角色開始新聊天,請使用左下角選單中的「開始新聊天」。",
19291926 "forbid_media_global_state_forbidden": "(禁止)",
19301927 "forbid_media_global_state_allowed": "(允許)",
19311928 "help_format_1": "文本格式化命令文字格式化命令:",
19321929 "help_format_2": "*文本文字*",
19331930 "help_format_3": "顯示為",
19341931 "help_format_4": "斜體",
19351932 "help_format_5": "**文本文字**",
19361933 "help_format_6": "顯示為",
19371934 "help_format_7": "粗體",
19381935 "help_format_8": "***text***",
19391936 "help_format_9": "顯示為",
19401937 "help_format_10": "粗斜體",
19411938 "help_format_11": "__文本____文字__",
19421939 "help_format_12": "顯示為",
19431940 "help_format_13": "底線",
19441941 "help_format_14": "~~text~~",
@@ -1969,8 +1966,8 @@
19691966 "help_3": "格式化",
19701967 "help_4": "快捷鍵",
19711968 "help_5": "{{macros}}(巨集)",
19721969 "help_6": "還有問題嗎?請查看請造訪",
19731970 "help_7": "SillyTavern 官方文檔網站官方文件網站",
19741971 "help_8": " 了解更多資訊!",
19751972 "help_hotkeys_0": "聊天快捷鍵",
19761973 "help_hotkeys_1": "↑(方向鍵)",
@@ -1980,21 +1977,21 @@
19801977 "help_hotkeys_5": "←(方向鍵)",
19811978 "help_hotkeys_6": "向左滑動",
19821979 "help_hotkeys_7": "→(方向鍵)",
19831980 "help_hotkeys_8": "向右滑動(注意:若聊天框中已有輸入,滑動快捷鍵將被禁用滑動快捷鍵將被停用)",
19841981 "help_hotkeys_9": "Enter",
19851982 "help_hotkeys_10": "(選中聊天框時)",
19861983 "help_hotkeys_10_1": "向 AI 發送您的訊息傳送您的訊息",
19871984 "help_hotkeys_11": "Ctrl+Enter",
19881985 "help_hotkeys_12": "重新生成最後一則 AI 回應",
19891986 "help_hotkeys_13": "Alt+Enter",
19901987 "help_hotkeys_14": "繼續生成最後一則 AI 回應",
19911988 "help_hotkeys_15": "Esc 鍵",
19921989 "help_hotkeys_16": "停止 AI 回應生成,關閉使用者界面關閉使用者介面,取消訊息編輯",
19931990 "help_hotkeys_17": "Ctrl+Shift+↑",
19941991 "help_hotkeys_18": "滾動到上下文行",
19951992 "help_hotkeys_19": "Ctrl+Shift+↓",
19961993 "help_hotkeys_20": "Markdown 快捷鍵",
19971994 "help_hotkeys_21": "適用於聊天框和帶有此圖標的文本區域適用於聊天框和帶有此圖示的文字區域:",
19981995 "help_hotkeys_22": "**粗體**",
19991996 "help_hotkeys_23": "*斜體*",
20001997 "help_hotkeys_24": "__底線__",
@@ -2008,7 +2005,7 @@
20082005 "help_macros_2": "插入一個換行符。",
20092006 "help_macros_3": "修剪巨集指令周圍的換行符。",
20102007 "help_macros_4": "無操作,僅返回空字串。",
20112008 "help_macros_5": "在 API 設定中定義的全域提示詞。僅在高級定義提示詞覆蓋中有效僅在高階定義提示詞覆蓋中有效。",
20122009 "help_macros_6": "使用者輸入",
20132010 "help_macros_7": "角色的主要提示詞覆蓋",
20142011 "help_macros_8": "角色的聊天歷史後指示覆蓋",
@@ -2025,11 +2022,11 @@
20252022 "help_macros_17": "角色版本",
20262023 "help_macros_18": "以逗號分隔的群組成員名稱列表(包含靜音成員)或單人聊天中的角色名稱。別名:{{charIfNotGroup}}",
20272024 "help_groupNotMuted": "與 {{group}} 相同,但不包含靜音成員",
20282025 "help_macros_19": "目前所選之 API 的文本生成模型名稱的文字生成模型名稱。",
20292026 "Can be inaccurate!": "可能不準確!",
20302027 "help_macros_20": "最新聊天訊息的文本內容最新聊天訊息的文字內容。",
20312028 "help_macros_lastUser": "最新使用者聊天訊息的文本內容最新使用者聊天訊息的文字內容。",
20322029 "help_macros_lastChar": "最新角色聊天訊息的文本內容最新角色聊天訊息的文字內容。",
20332030 "help_macros_21": "最新聊天訊息的索引 # 編號。適用於斜線命令批次處理。",
20342031 "help_macros_22": "包含在上下文中的第一條訊息的 ID。需在目前對話中至少進行一次生成。",
20352032 "help_macros_23": "最新聊天訊息中所滑動的 ID(以 1 起始)。若最新訊息為使用者訊息或提示為隱藏,則為空字串。",
@@ -2044,20 +2041,20 @@
20442041 "help_macros_31": "指定格式的目前日期/時間,例如,德國日期/時間:",
20452042 "help_macros_32": "指定 UTC 時區偏移量的目前時間,例如 UTC-4 或 UTC+2",
20462043 "help_macros_33": "計算 time1 和 time2 之間的時間差。接受時間和日期巨集。(例如:{{timeDiff::{{isodate}} {{time}}::2024/5/11 12:30:00}})",
20472044 "help_macros_34": "上次使用者訊息發送後的時間上次使用者訊息傳送後的時間",
20482045 "help_macros_35": "設定 AI 的行為偏好,直到下一次使用者輸入。引號中的文本很重要引號中的文字很重要。",
20492046 "help_macros_36": "擲骰子。(例如:",
20502047 "space_ will roll a 6-sided dice and return a number between 1 and 6)": "將擲一個六面骰並回傳 1 到 6 間的數字)",
20512048 "help_macros_37": "從列表中返回隨機一項。(例如:",
20522049 "space_ will return 1 of the 4 numbers at random. Works with text lists too.": "將隨機返回 4 個數字中的 1 個。也適用於文本列表也適用於文字列表。)",
20532050 "help_macros_38": "用於隨機的替代語法,允許在列表中使用逗號。",
20542051 "help_macros_39": "從列表中選擇隨機一項。工作原理與 {{random}} 相同,但選擇結果將在本次聊天中保持一致,不會在後續消息或提示處理時重新滾動不會在後續訊息或提示處理時重新滾動。",
20552052 "help_macros_40": "若使用 Text Generation WebUI 後端,動態將引號中的文本添加到禁用單詞序列中動態將引號中的文字新增到停用單詞序列中。對其他後端無效。可在任何地方使用(角色描述、世界資訊、作者備註等)。引號內容很重要。",
20562053 "Instruct Mode and Context Template Macros:": "指令模式與上下文模板巨集指令模式與上下文範本巨集:",
20572054 "(enabled in the Advanced Formatting settings)": "(在高級格式化設定中啟用在高階格式化設定中啟用)",
20582055 "help_macros_41": "允許的最大提示詞長度(以符元為單位)=(上下文大小 - 回應長度)",
20592056 "help_macros_42": "上下文模板對話範例分隔符上下文範本對話範例分隔符號",
20602057 "help_macros_43": "上下文模板聊天開始行上下文範本聊天開始行",
20612058 "help_macros_44": "主要提示詞(啟用後,將覆蓋角色提示詞或預設系統提示)",
20622059 "help_macros_45": "主要提示詞",
20632060 "help_macros_46": "指令系統提示詞前綴序列",
@@ -2076,21 +2073,21 @@
20762073 "help_macros_first_user": "指令使用者開頭輸入序列",
20772074 "help_macros_last_user": "指令使用者結尾輸入序列",
20782075 "Chat variables Macros:": "聊天變數巨集:",
20792076 "Local variables = unique to the current chat": "局部變數區域變數 = 僅作用於本次聊天",
20802077 "Global variables = works in any chat for any character": "全域變數 = 作用於所有聊天中的所有角色",
20812078 "Scoped variables = works in STscript": "局部變數區域變數 = 適用於 STscript",
20822079 "help_macros_59": "替換為局部變數替換為區域變數 \"name\" 的值",
20832080 "help_macros_60": "替換為空字串,並將局部變數並將區域變數 \"name\" 設定為 \"value\"",
20842081 "help_macros_61": "替換為空字串,並將 \"increment\" 數值添加到局部變數數值新增到區域變數 \"name\"",
20852082 "help_macros_62": "替換為局部變數替換為區域變數 \"name\" 的值增加 1 後的結果",
20862083 "help_macros_63": "替換為局部變數替換為區域變數 \"name\" 的值減少 1 後的結果",
20872084 "help_macros_64": "替換為全域變數 \"name\" 的值",
20882085 "help_macros_65": "替換為空字串,並將全域變數 \"name\" 設定為 \"value\"",
20892086 "help_macros_66": "替換為空字串,並將 \"increment\" 數值添加到全域變數數值新增到全域變數 \"name\"",
20902087 "help_macros_67": "替換為全域變數 \"name\" 的值增加 1 後的結果",
20912088 "help_macros_68": "替換為全域變數 \"name\" 的值減少 1 後的結果",
20922089 "help_macros_69": "替換為局部變數替換為區域變數 \"name\" 的值",
20932090 "help_macros_70": "替換為局部變數替換為區域變數 \"name\" 中指定索引(適用於陣列/列表或對象列表或物件/字典)的值",
20942091 "{{name}}": "{{name}}",
20952092 "If necessary, you can later restore this chat file from the /backups folder": "若需要,您可以稍後從 /backups 資料夾恢復此聊天檔案",
20962093 "Also delete the current chat file": "同時刪除目前的聊天檔案",
@@ -2111,13 +2108,13 @@
21112108 "Exclude Patterns": "排除模式",
21122109 "Glob patterns of files to exclude in the download.": "要排除於下載中的文件的全域模式。\r每行輸入一個模式。",
21132110 "Tag Management": "管理標籤",
21142111 "Save your tags to a file": "將標籤保存到文件將標籤儲存到文件",
21152112 "Restore tags from a file": "從文件中恢復標籤",
21162113 "Create a new tag": "創建新標籤建立新標籤",
21172114 "Drag handle to reorder. Click name to rename. Click color to change display.": "拖動以重新排序。點擊名稱重新命名點選名稱重新命名點擊顏色更改顯示點選顏色更改顯示。",
21182115 "Click on the folder icon to use this tag as a folder.": "點擊資料夾圖示以將此標籤作為資料夾點選資料夾圖示以將此標籤作為資料夾。",
21192116 "Use alphabetical sorting": "按字母順序排序 ",
21202117 "tags_sorting_desc": "啟用後,標籤將在創建或重命名時將自動按字母排序標籤將在建立或重新命名時將自動按字母排序。\n禁用時n停用時新標籤將附加到末尾新標籤將附加到結尾。\n若標籤被手動拖動重新排序,則自動排序將被禁用則自動排序將被停用。",
21212118 "and connect to an": "並連線到",
21222119 "You can add more": "您可加入更多",
21232120 "or_welcome": "或",
@@ -2157,13 +2154,13 @@
21572154 "Which elements to color.": "設定需要上色的元素。",
21582155 "Open Chat History": "開啟聊天記錄",
21592156 "Reset": "重設",
21602157 "Save": "保存儲存",
21612158 " folder of your user directory (typically 'data/default-user'). Place your expressions there.": "資料夾內,放置您的角色立繪(通常為「data/default-user」)。",
21622159 "Always show the node full info panel at the…e timeline view. When off, show it near the node.": "始終在時間軸視圖底部顯示節點的完整資訊面板始終在時間軸檢視底端顯示節點的完整資訊面板。若關閉,則在節點附近顯示。",
21632160 "Always show the node tooltip at the bottom …e timeline view. When off, show it near the node.": "始終在時間軸視圖左下角顯示節點的提示框始終在時間軸檢視左下角顯示節點的提示框。若關閉,則在節點附近顯示。",
21642161 "Dialogue settings for user personas.": "Dialogue settings for user personas.",
21652162 "Expand swipe nodes when the timeline view f… a node, or by pressing the Toggle Swipes button.": "在時間軸視圖首次打開時展開滑動節點在時間軸檢視首次開啟時展開滑動節點,或透過按下「切換滑動」按鈕來展開節點。",
21662163 "Send as a character": "以角色身份發送以角色身份傳送",
21672164 "Use GPU acceleration for positioning the fu…ow tends to disappear, turning this off may help.": "使用 GPU 加速來定位完整資訊面板。若面板頻繁消失,建議關閉此選項以解決問題。",
21682165 "Use the colors of the ST GUI theme, instead…n Color Settings specifically for this extension.": "使用使用者設定中的介面主題顏色,取代下方「顏色設定」中額外設定的顏色。",
21692166 "When enabled, nodes that have swipes splitt… larger, in addition to having the double border.": "啟用後,具有分支滑動的節點除了顯示雙重邊框外,還會顯示為更大的尺寸。",
@@ -2172,7 +2169,7 @@
21722169 "Commands": "指令",
21732170 "Contrast": "對比度",
21742171 "Darken Unfocused Character Sprites": "暗化未聚焦的角色立繪",
21752172 "Delete tint": "保存色調儲存色調",
21762173 "Ease": "平滑過渡",
21772174 "Ease-In": "淡入",
21782175 "Ease-In-Out": "淡入 + 淡出",
@@ -2216,7 +2213,7 @@
22162213 "Select the animation for focus mode.": "選擇聚焦模式的動畫效果。",
22172214 "Select the color of the letterbox.": "選擇遮罩顏色。",
22182215 "Select the letterbox mode for the Prome VN UI.": "選擇 Prome 視覺小說介面的遮罩模式",
22192216 "Select the tint preset to use for the Prome VN UI.": "選擇用於 Prome 視覺小說介面的色調預設視覺小說介面的色調預設設定檔。",
22202217 "Sepia": "復古",
22212218 "Set the blur of the character shadow.": "設定角色陰影模糊程度。",
22222219 "Set the brightness of the character.": "設定角色亮度。",
@@ -2240,7 +2237,7 @@
22402237 "Sprite List": "角色立繪列表",
22412238 "Sprite Shadow Configuration": "設定角色立繪陰影",
22422239 "Tint Configuration": "設定色調",
22432240 "Tint Presets": "預設色調色調預設設定檔",
22442241 "Type the name of the sprite set to use for your pe…rites in the 'characters' folder in SillyTavern).": "輸入您要使用的個人角色立繪集名稱(需將立繪存放於 SillyTavern 中的「characters」資料夾內)。",
22452242 "User Sprite Configuration": "[測試版] 使用者立繪設定",
22462243 "Vertical Letterbox": "垂直遮罩",
@@ -2254,33 +2251,33 @@
22542251 "Prome Commands": "Prome 指令",
22552252 "Show/Hide the letterbox (black bars) in the VN UI": "顯示/隱藏視覺小說模式中的黑邊(信箱模式)",
22562253 "Toggles focus mode on character sprites": "切換角色立繪的焦點模式",
22572254 "Sets the focus mode animation": "設置焦點模式動畫設定焦點模式動畫",
22582255 "Toggles the defocus tint on non-speaking character sprites": "切換非對話角色立繪的背景色",
22592256 "Toggles the shake animation when a character speaks on character sprites": "切換角色立繪對話時的震動動畫",
22602257 "Toggles sprite shadows on character sprites": "切換角色立繪的陰影效果",
22612258 "Toggles world/character tint on the VN UI": "切換視覺小說模式中的世界/角色色調",
22622259 "Toggles world tint on the VN UI": "切換視覺小說模式中的世界色調",
22632260 "Toggles character tint on the VN UI": "切換視覺小說模式中的角色色調",
22642261 "Toggles sharing world tint with character sprites (This will override Character Tint)": "切換角色立繪是否與世界色調共享色調(此操作將覆蓋角色色調設置此操作將覆蓋角色色調設定)",
22652262 "Sets the expression of the user sprite": "設定使用者立繪的表情",
22662263 "Sets the user sprite set to use for the user sprite": "設定使用者立繪所使用的立繪集",
22672264 "Toggles the user sprite on the VN UI": "切換視覺小說模式中使用者立繪的顯示狀態",
22682265 "Close": "關閉",
22692266 "View this current chat's chat history.": "查看本次聊天的聊天記錄檢視本次聊天的聊天記錄。",
22702267 "WARNING: Functions in this category are for advanced users only. Don't click anything if you're not sure about the consequences.": "警告:此類功能僅適用於進階使用者。若您不確定使用後果,請勿點擊任何按鈕請勿點選任何按鈕。",
22712268 "Enter a new display name:": "輸入新的顯示名稱:",
22722269 "Enter Checkpoint Name:": "輸入檢查點名稱:",
22732270 "(Leave empty to auto-generate)": "(留空將自動命名)",
22742271 "The currently existing checkpoint will be unlinked and replaced with the new checkpoint, but can still be found in the Chat Management.": "此檢查點將取消連結並替換為新的檢查點,但仍可在「管理聊天檔案」中找到。",
22752272 "Enter the Git URL of the extension to install": "輸入欲安裝的擴充功能 Git URL",
22762273 "Disclaimer:": "免責聲明免責宣告:",
22772274 "Please be aware that using external extensions can have unintended side effects and may pose security risks. Always make sure you trust the source before importing an extension. We are not responsible for any damage caused by third-party extensions.": "請注意,使用外部擴充功能可能會導致意想不到的副作用並存在安全風險。在匯入前,請務必確保您信任其來源。我們對於第三方擴充功能所引起的任何損害概不負責。",
22782275 "Prompt Itemization": "提示詞項目化",
22792276 "API/Model": "API/模型",
22802277 "Preset": "預設預設設定檔",
22812278 "Only the white numbers really matter. All numbers are estimates. Grey color items may not have been included in the context due to certain prompt format settings.": "所有數字均為估算值,僅白色數字真正重要。灰色項目可能因提示詞格式設定未納入上下文。",
22822279 "System Info:": "系統資訊:",
22832280 "Bias:": "Bias:",
22842281 "World Info:": "世界資訊:",
22852282 "Chat History:": "聊天記錄:",
22862283 "Extensions:": "擴充功能:",
@@ -2289,48 +2286,48 @@
22892286 "(Context Size - Response Length)": "(上下文長度 - 回應長度)",
22902287 ":": ":",
22912288 "API/Model:": "API/模型:",
22922289 "Preset:": "預設預設設定檔:",
22932290 "Tokenizer:": "分詞器:",
22942291 "Choose what to export": "選擇匯出內容",
22952292 "Text Completion Preset": "文本補全預設文字補全預設設定檔",
22962293 "Choose what to import": "選擇匯入內容",
22972294 "Enter your password below to confirm:": "請在下方輸入密碼以完成確認:",
22982295 "Unique to this chat.": "此設定僅適用於本次聊天。",
22992296 "The following scenario text will be used instead of the value set in the character card.": "以下場景內容將覆蓋角色卡中的設定值。",
23002297 "Checkpoints inherit the scenario override from their parent, and can be changed individually after that.": "檢查點將繼承父項的場景覆蓋值,但仍可獨立修改。",
23012298 "Are you sure you want to delete the theme?": "您確定要刪除介面主題嗎?",
23022299 "This will delete all your settings and data. There will be no undo button. Make sure you have a backup before proceeding.": "此操作將刪除所有設定與數據此操作將刪除所有設定與資料,且無法還原。進行重設前請務必完成備份。",
23032300 "Account reset code has been posted to the server console.": "帳號重設驗證碼已發送至伺服器控制台帳號重設驗證碼已傳送至伺服器控制台。",
23042301 "Prompt Tokens:": "提示詞符元數:",
23052302 "All group members will use the following scenario text instead of what is specified in their character cards.": "所有群組聊天成員將使用以下場景內容,取代原有角色卡中指定的內容。",
23062303 "Toggle sidebar": "切換側邊欄",
23072304 "Show connection profiles": "顯示連線設定檔",
23082305 "View chat files": "查看聊天檔案檢視聊天檔案",
23092306 "New chat": "新聊天",
23102307 "Rename chat": "重新命名聊天",
23112308 "Delete chat": "刪除聊天",
23122309 "Are you sure?": "你確定嗎?",
23132310 "Enter new chat name": "輸入新的聊天名稱",
23142311 "No chat selected": "未選擇聊天",
23152312 "Draggable template not found. Side bar will not be added.": "未找到可拖動模板未找到可拖動範本側邊欄將不被添加側邊欄將不被新增。",
23162313 "Failed to find draggable or close button. Side bar will not be added.": "未找到可拖動項或關閉按鈕。側邊欄將不被添加側邊欄將不被新增。",
23172314 "Sidebar or toggle button not found": "未找到側邊欄或切換按鈕",
23182315 "Switch connection profile": "切換連線設定檔",
23192316 "Failed to get current API": "獲取取得 API 失敗",
23202317 "Failed to get current model": "獲取模型失敗取得模型失敗",
23212318 "Aborting populateSideBar due to process id mismatch": "由於 populateSideBar ID 不匹配,中止填充側邊欄",
23222319 "Bronya Rand": "Bronya Rand(布洛妮婭·蘭德)",
23232320 "Toggles Prome, VN Mode and other Prome features.": "切換 Prome、視覺小說模式和其他 Prome 功能。",
23242321 "Only Show Last Message in Chat (Requires Prome to be enabled).": "僅顯示聊天中的最後一條消息僅顯示聊天中的最後一條訊息(需啟用 Prome)。",
23252322 "Emulates the character card of a character to be a sprite. (Requires Prome to be enabled).": "將角色的角色卡圖片模擬為角色立繪(需啟用 Prome)。",
23262323 "Shakes the character sprite when the character is speaking (Only works if Streaming is enabled in Preset Settings).": "當角色說話時,震動角色的立繪(僅在預設設定中啟用僅在預設設定檔中啟用「串流」時有效)。",
23272324 "Focuses the current speaking character in chat. (Requires Prome to be enabled).": "聚焦聊天中當前正在說話的角色聚焦聊天中目前正在說話的角色(要啟用 Prome)。",
23282325 "Darkens non-speaking (unfocused) characters. (Requires Prome to be enabled).": "使未說話(未聚焦)的角色變暗(需啟用 Prome)。",
23292326 "Auto-hides characters from the screen that haven't been in the conversation for a while up to X characters. (Requires Prome to be enabled).": "自動隱藏未參與會話一段時間的角色,最多 X 個角色(需啟用 Prome)。",
23302327 "Enables the ability to use a user sprite for your persona.": "啟用後,將為使用者的角色使用角色立繪功能。",
23312328 "Applies the world tint to character sprites (Requires Prome to be enabled. This will override your character tint settings).": "將世界色調應用於角色立繪(需啟用 Prome,這將覆蓋角色的色調設定)。",
23322329 "Tints the world background.": "為世界背景添加色調為世界背景新增色調。",
23332330 "Tints the character sprites.": "為角色立繪添加色調為角色立繪新增色調(需啟用 Prome)。",
23342331 "Auto-Hide Sprites": "自動隱藏立繪",
23352332 "Max Visible Sprites": "最大顯示數",
23362333 "Set the maximum number of visible sprites that appears in the VN screen.": "設定視覺小說模式中,畫面可顯示的最大立繪數量。",
@@ -2355,11 +2352,11 @@
23552352 "Auto": "自動",
23562353 "Allow": "允許",
23572354 "Forbid": "禁止",
23582355 "Aphrodite only. Determines the order of samplers. Skew is always applied post-softmax, so it's not included here.": "僅限 Aphrodite 使用。決定採樣器的順序決定取樣器的順序。偏移總是在 softmax 後應用,因此不包括在此。",
23592356 "Aphrodite only. Determines the order of samplers.": "僅限 Aphrodite 使用。決定採樣器的順序決定取樣器的順序。",
23602357 "Request model reasoning": "請求模型思維鏈",
23612358 "Allows the model to return its thinking process.": "讓模型回傳其思考過程。",
23622359 "Generic (OpenAI-compatible) [LM Studio, LiteLLM, etc.]": "通用(兼容相容 OpenAI)[LM Studio, LiteLLM 等]",
23632360 "Model ID (optional)": "模型 ID(可選)",
23642361 "DeepSeek API Key": "DeepSeek API 金鑰",
23652362 "DeepSeek Model": "DeepSeek 模型",
@@ -2372,31 +2369,31 @@
23722369 "Contain": "自適應",
23732370 "Stretch": "拉伸",
23742371 "Center": "置中",
23752372 "Persona Lore Alt+Click to open the lorebook": "「Alt+點擊點選」可開啟角色知識書",
23762373 "Chat Lore Alt+Click to open the lorebook": "「Alt+點擊點選」可開啟聊天知識書",
23772374 "Function Tool": "功能工具",
23782375 "Functions in this category are for advanced users only. Don't click anything if you're not sure about the consequences.": "此類功能僅供高級用戶使用此類功能僅供高階使用者使用。若不確定後果,請勿點擊任何內容請勿點選任何內容。",
23792376 "Are you sure you want to delete this user?": "確定要刪除該使用者嗎?",
23802377 "help_macros_isMobile": "目前是否在行動端使用:\"true\" 表示是,\"false\" 表示否",
23812378 "Persona Lorebook for": "角色知識書適用於",
23822379 "persona_world_template_txt": "選中的世界資訊將綁定到此角色。生成 AI 回覆時,會結合全域、角色及聊天知識書中的內容。",
23832380 "Key saved; press \"Test Message\" to verify.": "金鑰已儲存;請點擊請點選「測試訊息」進行驗證。",
23842381 "Preset name:": "預設名稱預設設定檔名稱:",
23852382 "Hint: Use a character/group name to bind preset to a specific chat.": "提示:使用角色/群組名稱將綁定預設至特定對話群組名稱將綁定預設設定檔至特定對話。",
23862383 "Your preset contains proxy and/or custom endpoint settings.": "此預設包含代理和此預設設定檔包含代理和/或自訂端點設定。",
23872384 "Do you want to remove these fields before exporting?": "是否要在匯出前移除這些欄位?",
23882385 "Delete the preset? This action is irreversible and your current settings will be overwritten.": "確定刪除此預設確定刪除此預設設定檔?刪除後無法復原,且此設定將被覆蓋。",
23892386 "Update all": "全部更新",
23902387 "Automatically chooses an alternative provider if chosen providers can't serve your request.": "當所選提供者無法滿足您的請求時,自動選擇替代提供者。",
23912388 "Use extension settings": "使用擴充功能設定",
23922389 "To use instruct formatting, switch to OpenRouter under Text Completion API.": "若要使用指令格式,請在文本補全請在文字補全 API 下切換至 OpenRouter。",
23932390 "Automatically 'continue' a response if the model stopped before reaching a certain amount of tokens.": "如果模型在達到一定數量的符元前停止,則自動繼續生成回應。",
23942391 "Toggle entry's active state.": "切換條目的啟用狀態。",
23952392 "Non-sticky": "無黏性",
23962393 "No cooldown": "無冷卻時間",
23972394 "No delay": "無延遲",
23982395 "Included settings:": "包含設定:",
23992396 "Click on the setting name to omit it from the profile.": "點擊設定名稱以從設定檔中省略點選設定名稱以從設定檔中省略。",
24002397 "Tints the chat background and/or character sprites.": "調整聊天背景或角色圖片的色調。",
24012398 "Only chunk on custom boundary": "僅在自定邊界進行分塊(chunk)",
24022399 "help_macros_firstDisplayedMessageId": "載入到可見聊天中的第一則訊息的 ID。",
@@ -2404,7 +2401,7 @@
24042401 "Select providers. No selection = all providers.": "選擇供應商。未選擇=所有供應商。",
24052402 "Select a model": "選擇模型",
24062403 "Search models...": "搜尋模型⋯",
24072404 "[Currently loaded]": "[當前加載目前載入]",
24082405 "Search providers...": "搜尋供應商⋯",
24092406 "No-sticky": "無固定",
24102407 "Create a new World Info": "建立新世界資訊",
@@ -2429,15 +2426,15 @@
24292426 "Loading third-party extensions... Please wait...": "正在載入第三方擴充功能,請稍候⋯",
24302427 "The page will be reloaded shortly...": "頁面即將重新載入⋯",
24312428 "Extensions state changed": "擴充功能狀態已更改",
24322429 "Error loading extensions. See browser console for details.": "載入擴充功能時出現錯誤。詳情請查看瀏覽器控制台詳細資訊請檢視瀏覽器控制台。",
24332430 "You don't have permission to update global extensions.": "您無權更新全域擴充功能。",
24342431 "Extension update failed": "擴充功能更新失敗",
24352432 "Extension ${0} updated to ${1}": "擴充功能 ${0} 已更新至 ${1}",
24362433 "Reload the page to apply updates": "重新加載頁面以使用更新重新載入頁面以使用更新",
24372434 "You don't have permission to delete global extensions.": "您無權刪除全域擴充功能。",
24382435 "Are you sure you want to delete ${0}?": "確定要刪除 ${0} 嗎?",
24392436 "You don't have permission to move extensions.": "您無權移動擴充功能。",
24402437 "Are you sure you want to move ${0} to your local extensions? This will make it available only for you.": "確定要將 ${0} 移至本地擴充功能嗎移至本機擴充功能嗎?此後僅您可使用。",
24412438 "Are you sure you want to move ${0} to the global extensions? This will make it available for all users.": "確定要將 ${0} 移至全域擴充功能嗎?此後所有使用者皆可使用。",
24422439 "Extension ${0} moved.": "擴充功能 ${0} 已移動。",
24432440 "Extension ${0} deleted": "擴充功能 ${0} 已刪除。",
@@ -2452,5 +2449,179 @@
24522449 "Modules provided by your Extras API:": "由您的 Extras API 提供的模組:",
24532450 "Not connected to the API!": "未連線到 API!",
24542451 "ext_type_system": "這是內建的擴充功能,無法刪除,且會跟隨系統更新。",
24552452 "Valid": "已驗證",
2453+ "Request Model Reasoning": "請求模型推理",
2454+ "Global list": "全域列表",
2455+ "Preset-specific list": "特定預設設定檔列表",
2456+ "Constrains effort on reasoning for reasoning models.": "限制推理模型的推理耗費。\n目前支援的值為低、中和高。\n降低推理耗費可加快回應速度,並減少推理所使用的符元數量。",
2457+ "Reasoning Effort": "推理耗費",
2458+ "openai_reasoning_effort_low": "低",
2459+ "openai_reasoning_effort_medium": "中",
2460+ "openai_reasoning_effort_high": "高",
2461+ "Reasoning": "推理 Reasoning",
2462+ "reasoning_auto_parse": "自動解析主要內容中推理區塊,需定義且不為空的前綴與後綴欄位。",
2463+ "Auto-Parse": "自動解析",
2464+ "reasoning_auto_expand": "自動展開推理區塊。",
2465+ "Auto-Expand": "自動展開",
2466+ "reasoning_show_hidden": "顯示隱藏推理功能模型的推理時間",
2467+ "Show Hidden": "顯示隱藏內容",
2468+ "reasoning_add_to_prompts": "將現有推理區塊新增至提示詞中。若需新增推理區塊,請使用訊息編輯選單。",
2469+ "Add to Prompts": "新增至提示詞",
2470+ "reasoning_max_additions": "從最後一則訊息起算,每則提示詞中可新增的最大推理區塊數量。",
2471+ "Max": "最大值",
2472+ "Reasoning Formatting": "推理格式",
2473+ "reasoning_prefix": "插入於推理內容之前。",
2474+ "Prefix": "前綴",
2475+ "reasoning_suffix": "插入於推理內容之後。",
2476+ "Suffix": "後綴",
2477+ "reasoning_separator": "插入於推理內容與訊息內容之間。",
2478+ "Separator": "分隔符號",
2479+ "Character details are hidden.": "角色詳細資訊已隱藏。",
2480+ "Add a reasoning block": "新增推理區塊",
2481+ "Thought for some time": "思考了一段時間",
2482+ "Confirm Edit": "確認",
2483+ "Remove reasoning": "移除推理",
2484+ "Cancel edit": "取消編輯",
2485+ "Copy reasoning": "複製推理",
2486+ "Edit reasoning": "編輯推理",
2487+ "extension_install_1": "若要從此頁面下載擴充功能,您需要安裝",
2488+ "extension_install_2": "已安裝。",
2489+ "extension_install_3": "點選",
2490+ "extension_install_4": "圖示以存取擴充功能的儲存庫,檢視使用技巧。",
2491+ "Use the selected API from Chat Translation extension settings.": "使用擴充功能設定中,「聊天翻譯」所選的翻譯提供者(API)。",
2492+ "A single expression can have multiple sprites. Whenever the expression is chosen, a random sprite for this expression will be selected.": "單個同名表情可以有多張角色立繪。每次使用該表情時,會隨機擇一顯示。",
2493+ "Allow multiple sprites per expression": "允許單一表情使用多張立繪",
2494+ "If the same expression is used again, re-roll the sprite. This only applies to expressions that have multiple available sprites assigned.": "若再次使用相同的表情,將重新隨機選擇。此功能僅適用於分配了多張立繪的表情。",
2495+ "Re-roll if same expression is used again": "重複使用同名表情時,隨機選用其他立繪",
2496+ "upload_expression_request": "請輸入角色立繪名稱(不含副檔名)。",
2497+ "upload_expression_naming_1": "角色立繪名稱必須符合所選表情的命名規則:{{expression}}",
2498+ "upload_expression_naming_2": "對於多個表情,名稱必須包含表情名稱和有效的後綴,允許的分隔符號為「-」或「.」。",
2499+ "upload_expression_replace": "點選「取代」以取代現有表情:",
2500+ "ext_regex_reasoning_desc": "推理區塊內容。當「僅格式化提示詞」已勾選時,這也會影響新增至提示詞的推理內容。",
2501+ "Token Counter": "符元計數器",
2502+ "Type / paste in the box below to see the number of tokens in the text.": "在下框中輸入或貼上文字以檢視符元(Token)數量。",
2503+ "Selected tokenizer:": "選擇的分詞器:",
2504+ "Input:": "輸入:",
2505+ "Tokens:": "符元數:",
2506+ "Tokenized text:": "已符元化的文字:",
2507+ "Token IDs:": "符元 ID:",
2508+ "Narrate by paragraphs (when not streaming)": "按段落朗讀(不使用「串流」時)",
2509+ " folder (typically in ": "資料夾(通常位於 ",
2510+ "Copy to Clipboard": "複製到剪貼簿",
2511+ "Reset to Defaults": "重設為預設值",
2512+ "Toggles Guinevere features.": "切換 Guinevere 功能。",
2513+ "Update customCSS": "更新 customCSS",
2514+ "Apply Theme": "套用主題",
2515+ "Enable Guinevere": "啟用 Guinevere",
2516+ "Note: Themes can be made/applied by going to the ": "注意:主題可通過前往以下位置進行創建/應用",
2517+ "Theme Name": "主題名稱",
2518+ "An unknown error occurred while counting tokens. Further information may be available in console.": "計算符元時發生未知錯誤。更多資訊可能可在主控台(console)中查看。",
2519+ "Qvink Memory": "Qvink Memory(進階聊天記憶)",
2520+ "Toggle whether memory is enabled for this chat specifically (overrides all settings).": "切換是否為此聊天啟用記憶功能(將覆蓋所有設定)。",
2521+ "Toggle Chat Memory": "切換聊天記憶",
2522+ "Preview current memory state (the exact text that will be injected into your context).": "預覽目前記憶狀態(包含將嵌入上下文的具體內容)。",
2523+ "Copy ALL memories to clipboard (all memories in the entire chat, not just those injected).": "將所有記憶複製到剪貼簿(包含整個聊天的所有記憶,而非僅限於注入的部分)。",
2524+ "Just refreshes which memories are included and re-renders the memories under each message, doesn't change summaries. This is done automatically all the time, the button is here just in case.": "不影響摘要,僅更新已包含的聊天記憶,並重新顯示在每則訊息下方。此過程通常會自動執行,按鈕只是備用選項。",
2525+ "Active Settings Profile ": "目前設定檔",
2526+ "Create, edit, and save configuration profiles for this extension.": "建立、編輯及儲存此擴充功能的設定檔。",
2527+ "The currently selected profile": "目前選取的設定檔",
2528+ "Save current profile": "儲存此設定檔",
2529+ "Rename current profile": "重新命名此設定檔",
2530+ "Create new profile": "建立新設定檔",
2531+ "Restore current profile": "還原此設定檔",
2532+ "Delete current profile": "刪除此設定檔",
2533+ "Set as default profile for current character": "設為目前角色的預設設定檔",
2534+ "Summarization": "摘要",
2535+ "Customize the prompt used to summarize a given message": "自訂用於摘要指定訊息的提示詞",
2536+ "Edit the summary prompt": "編輯摘要提示",
2537+ "Preview the filled-in summary prompt, using the last message as an example.": "以最後一則訊息為例,預覽填充完成的摘要提示",
2538+ "Mass re-summarization. Brings up dialog to choose subsets of messages to summarize or re-summarize.": "批量重新摘要:開啟對話框以選擇訊息子集進行摘要或重新摘要。",
2539+ "Stop all summarization immediately.": "立即停止所有摘要。",
2540+ "New messages will be automatically summarized if they will be included in short-term memory.": "如果新訊息將被納入短期記憶,將自動進行摘要。",
2541+ "Auto Summarize": "自動摘要",
2542+ "Auto-summarization will be triggered before a new message is sent instead of after.": "自動摘要將在發送新訊息之前觸發。",
2543+ "Auto Summarize Before Generation": "在生成內容前自動摘要",
2544+ "Show the progress bar when auto-summarizing more than 1 message.": "在自動摘要多於 1 則訊息時顯示進度條。",
2545+ "Auto Summarize Progress Bar": "自動摘要進度條",
2546+ "Number of messages to delay summarization (0 = summarize up to the most recent message, 1 = lag behind by one message, etc.)": "延遲摘要的訊息數量(0 = 摘要至最新訊息,1 = 延遲摘要 1 則訊息,以此類推)。",
2547+ "Auto Summarize Message Lag": "自動摘要訊息延遲",
2548+ "Wait until this many messages before auto-summarizing them all in sequence (1 = summarize every message immediately, 2 = summarize when you have two ready, etc). Still summarizes one at a time.": "在訊息數量達到此設定值後,依序自動摘要(1 = 即時摘要每則訊息,2 = 等待 2 則訊息後再摘要,以此類推)。摘要將逐條執行。",
2549+ "Auto Summarize Batch Size": "自動摘要批次大小",
2550+ "The maximum number of messages back that auto-summarization will apply (-1 to disable).": "自動摘要可回溯的訊息最大數量(-1 表示禁用此功能)。",
2551+ "Auto Summarize Message Limit": "自動摘要訊息上限",
2552+ "Time in seconds to wait between summarizations. May be needed if you are using a external API with a rate limit.": "每次摘要的間隔時間(秒)。此設定適用於使用具有請求速率限制的外部 API。",
2553+ "Summarization Time Delay": "摘要時間延遲",
2554+ "The maximum token length a summary is allowed to be before cutting it off. Use the {{words}} macro in the summarization prompt to get this value.": "摘要在被截斷前允許的最大符元(token)長度。可在摘要提示中使用 {{words}} 巨集以取得此數值。",
2555+ "Summary Max Token Length": "摘要允許的最大符元長度",
2556+ "Editing a message will automatically trigger a re-summarization if it has already been summarized.": "編輯訊息時,若該訊息已被摘要,將自動觸發重新摘要。",
2557+ "Re-summarize on Edit": "編輯後重新摘要",
2558+ "Swiping a message will automatically trigger a re-summarization if it has already been summarized.": "滑動訊息後若已進行摘要,將自動觸發重新摘要。",
2559+ "Re-summarize on Swipe": "滑動後重新摘要",
2560+ "Block chat input while summarizing.": "在摘要進行時暫時禁用聊天訊息輸入。",
2561+ "Block Chat": "訊息輸入鎖定",
2562+ "Whether to use messages and/or summaries as context for summarization. You must use {{history}} in the summary prompt.": "決定是否在摘要中使用訊息及/或過往摘要作為背景資訊。需於摘要提示詞中,使用 {{history}}。",
2563+ "Message History": "訊息歷史",
2564+ "Messages": "僅訊息",
2565+ "Summaries": "僅摘要",
2566+ "Both": "訊息與摘要",
2567+ "Preview what the message history will look like": "預覽訊息歷史的顯示效果",
2568+ "How many previous messages to include in the summarization prompt as context.": "摘要提示中要包含多少先前訊息作為上下文。",
2569+ "Number of Previous Messages": "先前訊息數量",
2570+ "When including previous messages, also include user messages.": "包含先前訊息時,也包含使用者訊息。",
2571+ "Include Previous User Messages": "包含先前使用者訊息",
2572+ "The message to summarize will be inside the system instruct template itself. In unchecked (default), the message will instead be added separately after the prompt. Some models benefit from this, but it is not recommended.": "系統指令模板內將直接包含需要摘要的訊息。若未啟用此選項(預設設定),訊息會在提示後分開添加。儘管某些模型可能更適合此設定,但一般不建議使用。",
2573+ "Nest Message in Summary Prompt": "在摘要提示中內嵌訊息",
2574+ "WARNING: doesn't work great. Attempts to preserve context-shifting by including all the content that is sent in regular prompts (world info, description, personas, example messages, message history, etc). If your regular prompts are static, this can allow Context Shifting to work between summarizations, but it decreases the accuracy of summarization due to all the extra stuff in the prompt. It also can't be previewed as this injection is handled by ST, not the extension.": "警告:效果不佳。此功能嘗試透過在摘要時包含所有常規提示內容(如世界資訊、描述、角色設定、示範訊息、聊天歷史等)來保留上下文轉換。若您的常規提示為靜態內容,則可在摘要之間維持上下文轉換,但由於提示中包含大量額外資訊,將降低摘要的準確性。此外,此內容注入由 ST 處理,而非此擴充功能,因此無法進行預覽。",
2575+ "Include All Context Content": "包含所有上下文內容",
2576+ "Short-term Memory Injection": "短期記憶注入",
2577+ "Determines which messages are included in the short-term memory injection and where. If you change this and include messages that weren't summarized previously, you can either manually trigger a re-summarization or just wait until automatic summarization triggers.": "設定短期記憶注入中所包含的訊息及其插入位置。若更改此設定並包含先前未摘要的訊息,您可手動觸發重新摘要,或等待自動摘要啟動。",
2578+ "Edit the short-term memory prompt": "編輯短期記憶提示",
2579+ "Include User Messages": "包含使用者訊息",
2580+ "Include System Messages": "包含系統訊息",
2581+ "Include Thought Message": "包含思考訊息",
2582+ "Message Length Threshold": "訊息長度閾值",
2583+ "The minimum token length a message has to be in order to get summarized.": "可被摘要的訊息最小符元長度。",
2584+ "The max percent of the context that short-term memory can take up.": "短期記憶可佔用上下文的最大百分比。",
2585+ "Short-Term Context %": "短期記憶上下文%",
2586+ "Include short-term memory in the World Info Scan": "在世界資訊掃描中包含短期記憶",
2587+ "Do not inject": "不注入",
2588+ "Before main prompt": "主提示之前",
2589+ "After main prompt": "主提示之後",
2590+ "In chat at depth": "在對話中位於深度",
2591+ "Long-Term Memory Injection": "長期記憶注入",
2592+ "Determines where long-term messages are injected.": "決定長期訊息注入的位置。",
2593+ "Edit the long-term memory prompt": "編輯長期記憶提示",
2594+ "The max percent of the context that long-term memory can take up.": "長期記憶可佔用上下文的最大百分比。",
2595+ "Long-Term Context %": "長期記憶上下文%",
2596+ "Include long-term memory in the World Info Scan": "在世界資訊掃描中包含長期記憶",
2597+ "Misc.": "其他",
2598+ "Fill your console with debug messages": "將偵錯訊息填入主控台",
2599+ "Debug Mode": "偵錯模式",
2600+ "Display summarizations below each message": "在每則訊息下顯示摘要",
2601+ "Display Memories": "顯示記憶",
2602+ "Enable Memory in New Chats": "在新對話中啟用記憶",
2603+ "Limit Message History": "限制訊息歷史",
2604+ "Revert Settings": "還原設定",
2605+ "Auto-summarize user messages and include summaries in memory.": "自動摘要使用者訊息,並將該摘要納入記憶。",
2606+ "Auto-summarize system messages and include summaries in memory.": "自動摘要系統訊息,並將該摘要納入記憶。",
2607+ "Auto-summarize thought messages and include summaries in memory (from the Stepped Thinking extension).": "自動摘要思考訊息並將摘要納入記憶(來自 Stepped Thinking 擴充功能)。",
2608+ "Revert all settings to default (not the default profile, just the default that comes with the extension). Your other profiles won't be affected.": "將所有設定恢復為預設值(並非恢復至「預設設定檔」,而是擴充功能隨附的原始預設值)。其他設定檔將不受影響。",
2609+ "Limit the number of messages to send in regular prompts to this number (-1 for no limit). Message memories will still be sent.": "限制常規提示中傳送的訊息數量至此數值(-1 表示無限制)。訊息記憶仍將一併傳送。",
2610+ "Whether memory is enabled by default for new chats.": "是否在新對話中預設啟用記憶。",
2611+ "Summarize Chat": "摘要對話",
2612+ "Choose settings for the chat summarization. All message inclusion/exclusion settings from the main config profile are used, in addition to the following options.": "選擇聊天摘要的設定。摘要時將使用主要設定檔中的所有訊息包含/排除規則,並可額外設定以下選項。",
2613+ "Currently preparing to summarize:": "目前正在準備摘要:",
2614+ "Summarize messages with no existing summary": "摘要尚無摘要的訊息",
2615+ "Re-summarize messages with existing short-term memories": "重新摘要具有現有短期記憶的訊息",
2616+ "Re-summarize messages with existing long-term memories": "重新摘要具有現有長期記憶的訊息",
2617+ "Re-summarize messages with existing memories, but which are currently excluded from short-term and long-term memory": "重新摘要具有現有記憶,但目前被排除在短期和長期記憶之外的訊息",
2618+ "Re-summarize messages with existing memories that have been manually edited.": "重新摘要已手動編輯的訊息記憶",
2619+ "Type the folder name of the theme you want to apply.": "輸入您想套用的主題資料夾名稱。",
2620+ "Place your theme data in a folder.": "請將主題資料存於該資料夾內。",
2621+ "Unsure where to start? Type ": "不確定如何開始?輸入:",
2622+ " to apply the default Google Messages theme or click ": " 即可使用預設主題 Google Messages,或點擊",
2623+ "here": "這裡",
2624+ " to learn how to create your own theme.": " 以學習如何創建個人化主題。",
2625+ "Guinevere (UI Theme Extension)": "Guinevere(進階自定義 UI 主題)",
2626+ "and Guinaifen.": "和 Guinaifen(桂乃芬)呈獻。"
24562627}
public/script.js+331 -106
@@ -235,6 +235,8 @@ import {
235235 initPersonas,
236236 setPersonaDescription,
237237 initUserAvatar,
238+ updatePersonaConnectionsAvatarList,
239+ isPersonaPanelOpen,
238240} from './scripts/personas.js';
239241import { getBackgrounds, initBackgrounds, loadBackgroundSettings, background_settings } from './scripts/backgrounds.js';
240242import { hideLoader, showLoader } from './scripts/loader.js';
@@ -366,6 +368,10 @@ DOMPurify.addHook('uponSanitizeElement', (node, _, config) => {
366368 return;
367369 }
368370
371+ if (!(node instanceof Element)) {
372+ return;
373+ }
374+
369375 let mediaBlocked = false;
370376
371377 switch (node.tagName) {
@@ -447,6 +453,8 @@ export const event_types = {
447453 MESSAGE_DELETED: 'message_deleted',
448454 MESSAGE_UPDATED: 'message_updated',
449455 MESSAGE_FILE_EMBEDDED: 'message_file_embedded',
456+ MESSAGE_REASONING_EDITED: 'message_reasoning_edited',
457+ MESSAGE_REASONING_DELETED: 'message_reasoning_deleted',
450458 MORE_MESSAGES_LOADED: 'more_messages_loaded',
451459 IMPERSONATE_READY: 'impersonate_ready',
452460 CHAT_CHANGED: 'chat_id_changed',
@@ -493,6 +501,8 @@ export const event_types = {
493501 // TODO: Naming convention is inconsistent with other events
494502 CHARACTER_DELETED: 'characterDeleted',
495503 CHARACTER_DUPLICATED: 'character_duplicated',
504+ CHARACTER_RENAMED: 'character_renamed',
505+ CHARACTER_RENAMED_IN_PAST_CHAT: 'character_renamed_in_past_chat',
496506 /** @deprecated The event is aliased to STREAM_TOKEN_RECEIVED. */
497507 SMOOTH_STREAM_TOKEN_RECEIVED: 'stream_token_received',
498508 STREAM_TOKEN_RECEIVED: 'stream_token_received',
@@ -507,7 +517,7 @@ export const event_types = {
507517 TOOL_CALLS_RENDERED: 'tool_calls_rendered',
508518};
509519
510520export const eventSource = new EventEmitter([event_types.APP_READY]);
511521
512522eventSource.on(event_types.CHAT_CHANGED, processChatSlashCommands);
513523
@@ -545,6 +555,10 @@ let generatedPromptCache = '';
545555let generation_started = new Date();
546556/** @type {import('./scripts/char-data.js').v1CharData[]} */
547557export let characters = [];
558+/**
559+ * Stringified index of a currently chosen entity in the characters array.
560+ * @type {string|undefined} Yes, we hate it as much as you do.
561+ */
548562export let this_chid;
549563let saveCharactersPage = 0;
550564export const default_avatar = 'img/ai4.png';
@@ -598,7 +612,6 @@ export const printCharactersDebounced = debounce(() => { printCharacters(false);
598612export const system_message_types = {
599613 HELP: 'help',
600614 WELCOME: 'welcome',
601- GROUP: 'group',
602615 EMPTY: 'empty',
603616 GENERIC: 'generic',
604617 NARRATOR: 'narrator',
@@ -691,14 +704,6 @@ async function getSystemMessages() {
691704 uses_system_ui: true,
692705 mes: await renderTemplateAsync('welcome', { displayVersion }),
693706 },
694- group: {
695- name: systemUserName,
696- force_avatar: system_avatar,
697- is_user: false,
698- is_system: true,
699- is_group: true,
700- mes: 'Group chat created. Say \'Hi\' to lovely people!',
701- },
702707 empty: {
703708 name: systemUserName,
704709 force_avatar: system_avatar,
@@ -978,7 +983,7 @@ async function firstLoadInit() {
978983 await initTokenizers();
979984 initBackgrounds();
980985 initAuthorsNote();
981986 await initPersonas();
982987 initRossMods();
983988 initStats();
984989 initCfg();
@@ -1027,12 +1032,22 @@ export function setAnimationDuration(ms = null) {
10271032 document.documentElement.style.setProperty('--animation-duration', `${animation_duration}ms`);
10281033}
10291034
1035+/**
1036+ * Sets the currently active character
1037+ * @param {object|number|string} [entityOrKey] - An entity with id property (character, group, tag), or directly an id or tag key. If not provided, the active character is reset to `null`.
1038+ */
10301039export function setActiveCharacter(entityOrKey) {
10311040 active_character = entityOrKey ? getTagKeyForEntity(entityOrKey) : null;
1041+ if (active_character) active_group = null;
10321042}
10331043
1044+/**
1045+ * Sets the currently active group.
1046+ * @param {object|number|string} [entityOrKey] - An entity with id property (character, group, tag), or directly an id or tag key. If not provided, the active group is reset to `null`.
1047+ */
10341048export function setActiveGroup(entityOrKey) {
10351049 active_group = entityOrKey ? getTagKeyForEntity(entityOrKey) : null;
1050+ if (active_group) active_character = null;
10361051}
10371052
10381053/**
@@ -1347,6 +1362,14 @@ export function resultCheckStatus() {
13471362 stopStatusLoading();
13481363}
13491364
1365+
1366+/**
1367+ * Switches the currently selected character to the one with the given ID. (character index, not the character key!)
1368+ *
1369+ * If the character ID doesn't exist, if the chat is being saved, or if a group is being generated, this function does nothing.
1370+ * If the character is different from the currently selected one, it will clear the chat and reset any selected character or group.
1371+ * @param {number} id The ID of the character to switch to.
1372+ */
13501373export async function selectCharacterById(id) {
13511374 if (characters[id] === undefined) {
13521375 return;
@@ -1361,7 +1384,7 @@ export async function selectCharacterById(id) {
13611384 return;
13621385 }
13631386
13641387 if (selected_group || String(this_chid) !== String(id)) {
13651388 //if clicked on a different character from what was currently selected
13661389 if (!is_send_press) {
13671390 await clearChat();
@@ -1369,7 +1392,7 @@ export async function selectCharacterById(id) {
13691392 resetSelectedGroup();
13701393 this_edit_mes_id = undefined;
13711394 selected_button = 'character_edit';
1372- this_chid = id;
1395+ setCharacterId(id);
13731396 chat.length = 0;
13741397 chat_metadata = {};
13751398 await getChat();
@@ -1420,7 +1443,7 @@ function getCharacterBlock(item, id) {
14201443 }
14211444 // Populate the template
14221445 const template = $('#character_template .character_select').clone();
14231446 template.attr({ 'data-chid': id, 'id': `CharID${id}` });
14241447 template.find('img').attr('src', this_avatar).attr('alt', item.name);
14251448 template.find('.avatar').attr('title', `[Character] ${item.name}\nFile: ${item.avatar}`);
14261449 template.find('.ch_name').text(item.name).attr('title', `[Character] ${item.name}`);
@@ -1546,6 +1569,7 @@ export async function printCharacters(fullRefresh = false) {
15461569 });
15471570
15481571 favsToHotswap();
1572+ updatePersonaConnectionsAvatarList();
15491573}
15501574
15511575/** Checks the state of the current search, and adds/removes the search sorting option accordingly */
@@ -1758,9 +1782,7 @@ export async function getCharacters() {
17581782 const response = await fetch('/api/characters/all', {
17591783 method: 'POST',
17601784 headers: getRequestHeaders(),
17611785 body: JSON.stringify({}),
1762- '': '',
1763- }),
17641786 });
17651787 if (response.ok === true) {
17661788 characters.splice(0, characters.length);
@@ -2455,7 +2477,7 @@ export function addOneMessage(mes, { type = 'normal', insertAfter = null, scroll
24552477 timestamp: timestamp,
24562478 extra: mes.extra,
24572479 tokenCount: mes.extra?.token_count ?? 0,
24582480 ...formatGenerationTimer(mes.gen_started, mes.gen_finished, mes.extra?.token_count, mes.extra?.reasoning_duration, mes.extra?.time_to_first_token),
24592481 };
24602482
24612483 const renderedMessage = getMessageFromTemplate(params);
@@ -2576,13 +2598,14 @@ export function formatCharacterAvatar(characterAvatar) {
25762598 * @param {Date} gen_finished Date when generation was finished
25772599 * @param {number} tokenCount Number of tokens generated (0 if not available)
25782600 * @param {number?} [reasoningDuration=null] Reasoning duration (null if no reasoning was done)
2601+ * @param {number?} [timeToFirstToken=null] Time to first token
25792602 * @returns {Object} Object containing the formatted timer value and title
25802603 * @example
25812604 * const { timerValue, timerTitle } = formatGenerationTimer(gen_started, gen_finished, tokenCount);
25822605 * console.log(timerValue); // 1.2s
25832606 * console.log(timerTitle); // Generation queued: 12:34:56 7 Jan 2021\nReply received: 12:34:57 7 Jan 2021\nTime to generate: 1.2 seconds\nToken rate: 5 t/s
25842607 */
25852608function formatGenerationTimer(gen_started, gen_finished, tokenCount, reasoningDuration = null, timeToFirstToken = null) {
25862609 if (!gen_started || !gen_finished) {
25872610 return {};
25882611 }
@@ -2596,8 +2619,9 @@ function formatGenerationTimer(gen_started, gen_finished, tokenCount, reasoningD
25962619 `Generation queued: ${start.format(dateFormat)}`,
25972620 `Reply received: ${finish.format(dateFormat)}`,
25982621 `Time to generate: ${seconds} seconds`,
2622+ timeToFirstToken ? `Time to first token: ${timeToFirstToken / 1000} seconds` : '',
25992623 reasoningDuration > 0 ? `Time to think: ${reasoningDuration / 1000} seconds` : '',
26002624 tokenCount > 0 ? `Token rate: ${Number(tokenCount / seconds).toFixed(13)} t/s` : '',
26012625 ].filter(x => x).join('\n').trim();
26022626
26032627 if (isNaN(seconds) || seconds < 0) {
@@ -2692,7 +2716,16 @@ export function substituteParams(content, _name1, _name2, _original, _group, _re
26922716 environment.personality = fields.personality || '';
26932717 environment.scenario = fields.scenario || '';
26942718 environment.persona = fields.persona || '';
26952719 environment.mesExamples = fields.mesExamples() ||=> '';{
2720+ const isInstruct = power_user.instruct.enabled && main_api !== 'openai';
2721+ const mesExamplesArray = parseMesExamples(fields.mesExamples, isInstruct);
2722+ if (isInstruct) {
2723+ const instructExamples = formatInstructModeExamples(mesExamplesArray, name1, name2);
2724+ return instructExamples.join('');
2725+ }
2726+ return mesExamplesArray.join('');
2727+ };
2728+ environment.mesExamplesRaw = fields.mesExamples || '';
26962729 environment.charVersion = fields.version || '';
26972730 environment.char_version = fields.version || '';
26982731 }
@@ -3081,6 +3114,27 @@ export function getCharacterCardFields() {
30813114 return result;
30823115}
30833116
3117+/**
3118+ * Parses an examples string.
3119+ * @param {string} examplesStr
3120+ * @returns {string[]} Examples array with block heading
3121+ */
3122+export function parseMesExamples(examplesStr, isInstruct) {
3123+ if (!examplesStr || examplesStr.length === 0 || examplesStr === '<START>') {
3124+ return [];
3125+ }
3126+
3127+ if (!examplesStr.startsWith('<START>')) {
3128+ examplesStr = '<START>\n' + examplesStr.trim();
3129+ }
3130+
3131+ const exampleSeparator = power_user.context.example_separator ? `${substituteParams(power_user.context.example_separator)}\n` : '';
3132+ const blockHeading = main_api === 'openai' ? '<START>\n' : (exampleSeparator || (isInstruct ? '<START>\n' : ''));
3133+ const splitExamples = examplesStr.split(/<START>/gi).slice(1).map(block => `${blockHeading}${block.trim()}\n`);
3134+
3135+ return splitExamples;
3136+}
3137+
30843138export function isStreamingEnabled() {
30853139 const noStreamSources = [chat_completion_sources.SCALE];
30863140 return (
@@ -3113,8 +3167,9 @@ class StreamingProcessor {
31133167 * @param {boolean} forceName2 If true, force the use of name2
31143168 * @param {Date} timeStarted Date when generation was started
31153169 * @param {string} continueMessage Previous message if the type is 'continue'
3170+ * @param {PromptReasoning} promptReasoning Prompt reasoning instance
31163171 */
31173172 constructor(type, forceName2, timeStarted, continueMessage, promptReasoning) {
31183173 this.result = '';
31193174 this.messageId = -1;
31203175 /** @type {HTMLElement} */
@@ -3135,6 +3190,9 @@ class StreamingProcessor {
31353190 this.abortController = new AbortController();
31363191 this.firstMessageText = '...';
31373192 this.timeStarted = timeStarted;
3193+ /** @type {number?} */
3194+ this.timeToFirstToken = null;
3195+ this.createdAt = new Date();
31383196 this.continueMessage = type === 'continue' ? continueMessage : '';
31393197 this.swipes = [];
31403198 /** @type {import('./scripts/logprobs.js').TokenLogprobs[]} */
@@ -3142,6 +3200,8 @@ class StreamingProcessor {
31423200 this.toolCalls = [];
31433201 // Initialize reasoning in its own handler
31443202 this.reasoningHandler = new ReasoningHandler(timeStarted);
3203+ /** @type {PromptReasoning} */
3204+ this.promptReasoning = promptReasoning;
31453205 }
31463206
31473207 #checkDomElements(messageId) {
@@ -3170,6 +3230,10 @@ class StreamingProcessor {
31703230 }
31713231
31723232 async onStartStreaming(text) {
3233+ if (this.type === 'continue' && this.promptReasoning.prefixReasoning) {
3234+ this.reasoningHandler.initContinue(this.promptReasoning);
3235+ }
3236+
31733237 let messageId = -1;
31743238
31753239 if (this.type == 'impersonate') {
@@ -3220,9 +3284,11 @@ class StreamingProcessor {
32203284 if (!chat[messageId]['extra']) {
32213285 chat[messageId]['extra'] = {};
32223286 }
3287+ chat[messageId]['extra']['time_to_first_token'] = this.timeToFirstToken;
32233288
32243289 // Update reasoning
32253290 await this.reasoningHandler.process(messageId, mesChanged);
3291+ processedText = chat[messageId]['mes'];
32263292
32273293 // Token count update.
32283294 const tokenCountText = this.reasoningHandler.reasoning + processedText;
@@ -3236,7 +3302,12 @@ class StreamingProcessor {
32363302
32373303 if ((this.type == 'swipe' || this.type === 'continue') && Array.isArray(chat[messageId]['swipes'])) {
32383304 chat[messageId]['swipes'][chat[messageId]['swipe_id']] = processedText;
3239- chat[messageId]['swipe_info'][chat[messageId]['swipe_id']] = { 'send_date': chat[messageId]['send_date'], 'gen_started': chat[messageId]['gen_started'], 'gen_finished': chat[messageId]['gen_finished'], 'extra': JSON.parse(JSON.stringify(chat[messageId]['extra'])) };
3305+ chat[messageId]['swipe_info'][chat[messageId]['swipe_id']] = {
3306+ 'send_date': chat[messageId]['send_date'],
3307+ 'gen_started': chat[messageId]['gen_started'],
3308+ 'gen_finished': chat[messageId]['gen_finished'],
3309+ 'extra': JSON.parse(JSON.stringify(chat[messageId]['extra'])),
3310+ };
32403311 }
32413312
32423313 const formattedText = messageFormatting(
@@ -3252,7 +3323,7 @@ class StreamingProcessor {
32523323 this.messageTextDom.innerHTML = formattedText;
32533324 }
32543325
32553326 const timePassed = formatGenerationTimer(this.timeStarted, currentTime, currentTokenCount, this.reasoningHandler.getDuration(), this.timeToFirstToken);
32563327 if (this.messageTimerDom instanceof HTMLElement) {
32573328 this.messageTimerDom.textContent = timePassed.timerValue;
32583329 this.messageTimerDom.title = timePassed.timerTitle;
@@ -3327,7 +3398,12 @@ class StreamingProcessor {
33273398 if (this.type !== 'swipe' && this.type !== 'impersonate') {
33283399 if (Array.isArray(chat[messageId]['swipes']) && chat[messageId]['swipes'].length === 1 && chat[messageId]['swipe_id'] === 0) {
33293400 chat[messageId]['swipes'][0] = chat[messageId]['mes'];
3330- chat[messageId]['swipe_info'][0] = { 'send_date': chat[messageId]['send_date'], 'gen_started': chat[messageId]['gen_started'], 'gen_finished': chat[messageId]['gen_finished'], 'extra': JSON.parse(JSON.stringify(chat[messageId]['extra'])) };
3401+ chat[messageId]['swipe_info'][0] = {
3402+ 'send_date': chat[messageId]['send_date'],
3403+ 'gen_started': chat[messageId]['gen_started'],
3404+ 'gen_finished': chat[messageId]['gen_finished'],
3405+ 'extra': JSON.parse(JSON.stringify(chat[messageId]['extra'])),
3406+ };
33313407 }
33323408 }
33333409 }
@@ -3361,7 +3437,11 @@ class StreamingProcessor {
33613437 const sw = new Stopwatch(1000 / power_user.streaming_fps);
33623438 const timestamps = [];
33633439 for await (const { text, swipes, logprobs, toolCalls, state } of this.generator()) {
33643440 timestamps.push(const now = Date.now());
3441+ timestamps.push(now);
3442+ if (!this.timeToFirstToken) {
3443+ this.timeToFirstToken = now - this.createdAt.getTime();
3444+ }
33653445 if (this.isStopped || this.abortController.signal.aborted) {
33663446 return this.result;
33673447 }
@@ -3373,7 +3453,7 @@ class StreamingProcessor {
33733453 this.messageLogprobs.push(...(Array.isArray(logprobs) ? logprobs : [logprobs]));
33743454 }
33753455 // Get the updated reasoning string into the handler
33763456 this.reasoningHandler.updateReasoning(this.messageId, state?.reasoning ?? '');
33773457 await eventSource.emit(event_types.STREAM_TOKEN_RECEIVED, text);
33783458 await sw.tick(async () => await this.onProgressStreaming(this.messageId, this.continueMessage + text));
33793459 }
@@ -3628,6 +3708,9 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
36283708 setGenerationProgress(0);
36293709 generation_started = new Date();
36303710
3711+ // Prevent generation from shallow characters
3712+ await unshallowCharacter(this_chid);
3713+
36313714 // Occurs every time, even if the generation is aborted due to slash commands execution
36323715 await eventSource.emit(event_types.GENERATION_STARTED, type, { automatic_trigger, force_name2, quiet_prompt, quietToLoud, skipWIAN, force_chid, signal, quietImage }, dryRun);
36333716
@@ -3859,13 +3942,13 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
38593942 };
38603943 }));
38613944
38623945 const reasoningpromptReasoning = new PromptReasoning();
38633946 for (let i = coreChat.length - 1; i >= 0; i--) {
38643947 const depth = coreChat.length - i - 1;
38653948 const isPrefix = isContinue && i === coreChat.length - 1;
38663949 coreChat[i] = {
38673950 ...coreChat[i],
38683951 mes: reasoningpromptReasoning.addToMessage(
38693952 coreChat[i].mes,
38703953 getRegexedString(
38713954 String(coreChat[i].extra?.reasoning ?? ''),
@@ -3873,9 +3956,10 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
38733956 { isPrompt: true, depth: depth },
38743957 ),
38753958 isPrefix,
3959+ coreChat[i].extra?.reasoning_duration,
38763960 ),
38773961 };
38783962 if (reasoningpromptReasoning.isLimitReached()) {
38793963 break;
38803964 }
38813965 }
@@ -3939,29 +4023,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
39394023 force_name2 = false;
39404024 }
39414025
3942- // TODO (kingbri): Migrate to a utility function
4026+ let mesExamplesArray = parseMesExamples(mesExamples, isInstruct);
3943- /**
3944- * Parses an examples string.
3945- * @param {string} examplesStr
3946- * @returns {string[]} Examples array with block heading
3947- */
3948- function parseMesExamples(examplesStr) {
3949- if (!examplesStr || examplesStr.length === 0 || examplesStr === '<START>') {
3950- return [];
3951- }
3952-
3953- if (!examplesStr.startsWith('<START>')) {
3954- examplesStr = '<START>\n' + examplesStr.trim();
3955- }
3956-
3957- const exampleSeparator = power_user.context.example_separator ? `${substituteParams(power_user.context.example_separator)}\n` : '';
3958- const blockHeading = main_api === 'openai' ? '<START>\n' : (exampleSeparator || (isInstruct ? '<START>\n' : ''));
3959- const splitExamples = examplesStr.split(/<START>/gi).slice(1).map(block => `${blockHeading}${block.trim()}\n`);
3960-
3961- return splitExamples;
3962- }
3963-
3964- let mesExamplesArray = parseMesExamples(mesExamples);
39654027
39664028 //////////////////////////////////
39674029 // Extension added strings
@@ -3986,7 +4048,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
39864048 }
39874049
39884050 const formattedExample = baseChatReplace(exampleMessage, name1, name2);
39894051 const cleanedExample = parseMesExamples(formattedExample, isInstruct);
39904052
39914053 // Insert depending on before or after position
39924054 if (example.position === wi_anchor_position.before) {
@@ -4700,7 +4762,8 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
47004762 console.debug(`pushed prompt bits to itemizedPrompts array. Length is now: ${itemizedPrompts.length}`);
47014763
47024764 if (isStreamingEnabled() && type !== 'quiet') {
4703- streamingProcessor = new StreamingProcessor(type, force_name2, generation_started, continue_mag);
4765+ continue_mag = promptReasoning.removePrefix(continue_mag);
4766+ streamingProcessor = new StreamingProcessor(type, force_name2, generation_started, continue_mag, promptReasoning);
47044767 if (isContinue) {
47054768 // Save reply does add cycle text to the prompt, so it's not needed here
47064769 streamingProcessor.firstMessageText = '';
@@ -4801,6 +4864,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
48014864 }
48024865
48034866 if (isContinue) {
4867+ continue_mag = promptReasoning.removePrefix(continue_mag);
48044868 getMessage = continue_mag + getMessage;
48054869 }
48064870
@@ -5290,7 +5354,7 @@ function addChatsSeparator(mesSendString) {
52905354}
52915355
52925356async function duplicateCharacter() {
52935357 if (this_chid === undefined || !characters[this_chid]) {
52945358 toastr.warning(t`You must first select a character to duplicate!`);
52955359 return '';
52965360 }
@@ -5624,7 +5688,7 @@ export async function sendStreamingRequest(type, data) {
56245688 * @returns {string} Generation URL
56255689 * @throws {Error} If the API is unknown
56265690 */
56275691export function getGenerateUrl(api) {
56285692 switch (api) {
56295693 case 'kobold':
56305694 return '/api/backends/kobold/generate';
@@ -5692,14 +5756,15 @@ function parseAndSaveLogprobs(data, continueFrom) {
56925756/**
56935757 * Extracts the message from the response data.
56945758 * @param {object} data Response data
5759+ * @param {string} activeApi If it's set, ignores active API
56955760 * @returns {string} Extracted message
56965761 */
56975762export function extractMessageFromData(data, activeApi = null) {
56985763 if (typeof data === 'string') {
56995764 return data;
57005765 }
57015766
57025767 switch (activeApi ?? main_api) {
57035768 case 'kobold':
57045769 return data.results[0].text;
57055770 case 'koboldhorde':
@@ -5709,7 +5774,7 @@ function extractMessageFromData(data) {
57095774 case 'novel':
57105775 return data.output;
57115776 case 'openai':
57125777 return data?.content?.find(p => p.type === 'text')?.text ?? data?.choices?.[0]?.message?.content ?? data?.choices?.[0]?.text ?? data?.text ?? data?.message?.content?.[0]?.text ?? data?.message?.tool_plan ?? '';
57135778 default:
57145779 return '';
57155780 }
@@ -6069,17 +6134,52 @@ export async function saveReply(type, getMessage, fromStreaming, title, swipes,
60696134 return { type, getMessage };
60706135}
60716136
6072-export function syncCurrentSwipeInfoExtras() {
6137+/**
6138+ * Syncs the current message and all its data into the swipe data at the given message ID (or the last message if no ID is given).
6139+ *
6140+ * If the swipe data is invalid in some way, this function will exit out without doing anything.
6141+ * @param {number?} [messageId=null] - The ID of the message to sync with the swipe data. If no ID is given, the last message is used.
6142+ * @returns {boolean} Whether the message was successfully synced
6143+ */
6144+export function syncMesToSwipe(messageId = null) {
60736145 if (!chat.length) {
60746146 return false;
60756147 }
6076- const currentMessage = chat[chat.length - 1];
6148+
6077- if (currentMessage && Array.isArray(currentMessage.swipe_info) && typeof currentMessage.swipe_id === 'number') {
6149+ const targetMessageId = messageId ?? chat.length - 1;
6078- const swipeInfo = currentMessage.swipe_info[currentMessage.swipe_id];
6150+ if (chat.length > targetMessageId || targetMessageId < 0) {
6079- if (swipeInfo && typeof swipeInfo === 'object') {
6151+ console.warn(`[syncMesToSwipe] Invalid message ID: ${messageId}`);
6080- swipeInfo.extra = structuredClone(currentMessage.extra);
6152+ return false;
6153+ }
6154+
6155+ const targetMessage = chat[targetMessageId];
6156+
6157+ // No swipe data there yet, exit out
6158+ if (typeof targetMessage.swipe_id !== 'number') {
6159+ return false;
60816160 }
6161+ // If swipes structure is invalid, exit out (for now?)
6162+ if (!Array.isArray(targetMessage.swipe_info) || !Array.isArray(targetMessage.swipes)) {
6163+ return false;
60826164 }
6165+ // If the swipe is not present yet, exit out (will likely be copied later)
6166+ if (!targetMessage.swipes[targetMessage.swipe_id] || !targetMessage.swipe_info[targetMessage.swipe_id]) {
6167+ return false;
6168+ }
6169+
6170+ const targetSwipeInfo = targetMessage.swipe_info[targetMessage.swipe_id];
6171+ if (typeof targetSwipeInfo !== 'object') {
6172+ return false;
6173+ }
6174+
6175+ targetMessage.swipes[targetMessage.swipe_id] = targetMessage.mes;
6176+
6177+ targetSwipeInfo.send_date = targetMessage.send_date;
6178+ targetSwipeInfo.gen_started = targetMessage.gen_started;
6179+ targetSwipeInfo.gen_finished = targetMessage.gen_finished;
6180+ targetSwipeInfo.extra = structuredClone(targetMessage.extra);
6181+
6182+ return true;
60836183}
60846184
60856185function saveImageToMessage(img, mes) {
@@ -6155,7 +6255,7 @@ export function resetChatState() {
61556255 // replaces deleted charcter name with system user since it will be displayed next.
61566256 name2 = (this_chid === undefined && neutralCharacterName) ? neutralCharacterName : systemUserName;
61576257 //unsets expected chid before reloading (related to getCharacters/printCharacters from using old arrays)
6158- this_chid = undefined;
6258+ setCharacterId(undefined);
61596259 // sets up system user to tell user about having deleted a character
61606260 chat.splice(0, chat.length, ...SAFETY_CHAT);
61616261 // resets chat metadata
@@ -6178,8 +6278,29 @@ export function setExternalAbortController(controller) {
61786278 abortController = controller;
61796279}
61806280
6281+/**
6282+ * Sets a character array index.
6283+ * @param {number|string|undefined} value
6284+ */
61816285export function setCharacterId(value) {
6182- this_chid = value;
6286+ switch (typeof value) {
6287+ case 'bigint':
6288+ case 'number':
6289+ this_chid = String(value);
6290+ break;
6291+ case 'string':
6292+ this_chid = !isNaN(parseInt(value)) ? value : undefined;
6293+ break;
6294+ case 'object':
6295+ this_chid = characters.indexOf(value) !== -1 ? String(characters.indexOf(value)) : undefined;
6296+ break;
6297+ case 'undefined':
6298+ this_chid = undefined;
6299+ break;
6300+ default:
6301+ console.error('Invalid character ID type:', value);
6302+ break;
6303+ }
61836304}
61846305
61856306export function setCharacterName(value) {
@@ -6207,6 +6328,23 @@ export function setSendButtonState(value) {
62076328 is_send_press = value;
62086329}
62096330
6331+/**
6332+ * Renames the currently selected character, updating relevant references and optionally renaming past chats.
6333+ *
6334+ * If no name is provided, a popup prompts for a new name. If the new name matches the current name,
6335+ * the renaming process is aborted. The function sends a request to the server to rename the character
6336+ * and handles updates to other related fields such as tags, lore, and author notes.
6337+ *
6338+ * If the renaming is successful, the character list is reloaded and the renamed character is selected.
6339+ * Optionally, past chats can be renamed to reflect the new character name.
6340+ *
6341+ * @param {string?} [name=null] - The new name for the character. If not provided, a popup will prompt for it.
6342+ * @param {object} [options] - Additional options.
6343+ * @param {boolean} [options.silent=false] - If true, suppresses popups and warnings.
6344+ * @param {boolean?} [options.renameChats=null] - If true, renames past chats to reflect the new character name.
6345+ * @returns {Promise<boolean>} - Returns true if the character was successfully renamed, false otherwise.
6346+ */
6347+
62106348export async function renameCharacter(name = null, { silent = false, renameChats = null } = {}) {
62116349 if (!name && silent) {
62126350 toastr.warning(t`No character name provided.`, t`Rename Character`);
@@ -6241,9 +6379,35 @@ export async function renameCharacter(name = null, { silent = false, renameChats
62416379 const data = await response.json();
62426380 const newAvatar = data.avatar;
62436381
6244- // Replace tags list
6382+ const oldName = getCharaFilename(null, { manualAvatarKey: oldAvatar });
6383+ const newName = getCharaFilename(null, { manualAvatarKey: newAvatar });
6384+
6385+ // Replace other auxillery fields where was referenced by avatar key
6386+ // Tag List
62456387 renameTagKey(oldAvatar, newAvatar);
62466388
6389+ // Addtional lore books
6390+ const charLore = world_info.charLore?.find(x => x.name == oldName);
6391+ if (charLore) {
6392+ charLore.name = newName;
6393+ saveSettingsDebounced();
6394+ }
6395+
6396+ // Char-bound Author's Notes
6397+ const charNote = extension_settings.note.chara?.find(x => x.name == oldName);
6398+ if (charNote) {
6399+ charNote.name = newName;
6400+ saveSettingsDebounced();
6401+ }
6402+
6403+ // Update active character, if the current one was the currently active one
6404+ if (active_character === oldAvatar) {
6405+ active_character = newAvatar;
6406+ saveSettingsDebounced();
6407+ }
6408+
6409+ await eventSource.emit(event_types.CHARACTER_RENAMED, oldAvatar, newAvatar);
6410+
62476411 // Reload characters list
62486412 await getCharacters();
62496413
@@ -6252,25 +6416,30 @@ export async function renameCharacter(name = null, { silent = false, renameChats
62526416
62536417 if (newChId !== -1) {
62546418 // Select the character after the renaming
6255- this_chid = -1;
6419+ setCharacterId(undefined);
62566420 await selectCharacterById(String(newChId));
62576421
62586422 // Async delay to update UI
62596423 await delay(1);
62606424
62616425 if (this_chid === -1undefined) {
62626426 throw new Error('New character not selected');
62636427 }
62646428
62656429 // Also rename as a group member
62666430 await renameGroupMember(oldAvatar, newAvatar, newValue);
62676431 const renamePastChatsConfirm = renameChats !== null ? renameChats
6268- : silent ? false : await callPopup(`<h3>Character renamed!</h3>
6432+ ? renameChats
6269- <p>Past chats will still contain the old character name. Would you like to update the character name in previous chats as well?</p>
6433+ : silent
6270- <i><b>Sprites folder (if any) should be renamed manually.</b></i>`, 'confirm');
6434+ ? false
6435+ : await Popup.show.confirm(
6436+ t`Character renamed!`,
6437+ `<p>${t`Past chats will still contain the old character name. Would you like to update the character name in previous chats as well?`}</p>
6438+ <i><b>${t`Sprites folder (if any) should be renamed manually.`}</b></i>`,
6439+ ) == POPUP_RESULT.AFFIRMATIVE;
62716440
62726441 if (renamePastChatsConfirm) {
62736442 await renamePastChats(oldAvatar, newAvatar, newValue);
62746443 await reloadCurrentChat();
62756444 toastr.success(t`Character renamed and past chats updated!`, t`Rename Character`);
62766445 } else {
@@ -6287,7 +6456,7 @@ export async function renameCharacter(name = null, { silent = false, renameChats
62876456 }
62886457 catch (error) {
62896458 // Reloading to prevent data corruption
62906459 if (!silent) await callPopupPopup.show.text(t`Rename Character`, t`Something went wrong. The page will be reloaded.`, 'text');
62916460 else toastr.error(t`Something went wrong. The page will be reloaded.`, t`Rename Character`);
62926461
62936462 console.log('Renaming character error:', error);
@@ -6298,7 +6467,7 @@ export async function renameCharacter(name = null, { silent = false, renameChats
62986467 return true;
62996468}
63006469
63016470async function renamePastChats(oldAvatar, newAvatar, newValuenewName) {
63026471 const pastChats = await getPastCharacterChats();
63036472
63046473 for (const { file_name } of pastChats) {
@@ -6308,7 +6477,7 @@ async function renamePastChats(newAvatar, newValue) {
63086477 method: 'POST',
63096478 headers: getRequestHeaders(),
63106479 body: JSON.stringify({
63116480 ch_name: newValuenewName,
63126481 file_name: fileNameWithoutExtension,
63136482 avatar_url: newAvatar,
63146483 }),
@@ -6324,15 +6493,17 @@ async function renamePastChats(newAvatar, newValue) {
63246493 }
63256494
63266495 if (message.name !== undefined) {
63276496 message.name = newValuenewName;
63286497 }
63296498 }
63306499
6500+ await eventSource.emit(event_types.CHARACTER_RENAMED_IN_PAST_CHAT, currentChat, oldAvatar, newAvatar);
6501+
63316502 const saveChatResponse = await fetch('/api/chats/save', {
63326503 method: 'POST',
63336504 headers: getRequestHeaders(),
63346505 body: JSON.stringify({
63356506 ch_name: newValuenewName,
63366507 file_name: fileNameWithoutExtension,
63376508 chat: currentChat,
63386509 avatar_url: newAvatar,
@@ -6358,6 +6529,7 @@ export function saveChatDebounced() {
63586529 if (chatSaveTimeout) {
63596530 console.debug('Clearing chat save timeout');
63606531 clearTimeout(chatSaveTimeout);
6532+ chatSaveTimeout = null;
63616533 }
63626534
63636535 chatSaveTimeout = setTimeout(async () => {
@@ -6374,7 +6546,7 @@ export function saveChatDebounced() {
63746546 console.debug('Chat save timeout triggered');
63756547 await saveChatConditional();
63766548 console.debug('Chat saved');
63776549 }, 1000DEFAULT_SAVE_EDIT_TIMEOUT);
63786550}
63796551
63806552export async function saveChat(chatName, withMetadata, mesId) {
@@ -6529,7 +6701,7 @@ export function buildAvatarList(block, entities, { templateId = 'inline_avatar_t
65296701 }
65306702
65316703 avatarTemplate.attr('data-type', entity.type);
65326704 avatarTemplate.attr({ 'data-chid': id, 'id': `CharID${id}` });
65336705 avatarTemplate.find('img').attr('src', this_avatar).attr('alt', entity.item.name);
65346706 avatarTemplate.attr('title', `[Character] ${entity.item.name}\nFile: ${entity.item.avatar}`);
65356707 if (highlightFavs) {
@@ -6544,8 +6716,14 @@ export function buildAvatarList(block, entities, { templateId = 'inline_avatar_t
65446716 avatarTemplate.addClass(grpTemplate.attr('class'));
65456717 avatarTemplate.empty();
65466718 avatarTemplate.append(grpTemplate.children());
6719+ avatarTemplate.attr({ 'data-grid': id, 'data-chid': null });
65476720 avatarTemplate.attr('title', `[Group] ${entity.item.name}`);
65486721 }
6722+ else if (entity.type === 'persona') {
6723+ avatarTemplate.attr({ 'data-pid': id, 'data-chid': null });
6724+ avatarTemplate.find('img').attr('src', getUserAvatar(entity.item.avatar));
6725+ avatarTemplate.attr('title', `[Persona] ${entity.item.name}\nFile: ${entity.item.avatar}`);
6726+ }
65496727
65506728 if (interactable) {
65516729 avatarTemplate.addClass(INTERACTABLE_CONTROL_CLASS);
@@ -6557,9 +6735,43 @@ export function buildAvatarList(block, entities, { templateId = 'inline_avatar_t
65576735 }
65586736}
65596737
6738+/**
6739+ * Loads all the data of a shallow character.
6740+ * @param {string|undefined} characterId Array index
6741+ * @returns {Promise<void>} Promise that resolves when the character is unshallowed
6742+ */
6743+export async function unshallowCharacter(characterId) {
6744+ if (characterId === undefined) {
6745+ console.warn('Undefined character cannot be unshallowed');
6746+ return;
6747+ }
6748+
6749+ /** @type {import('./scripts/char-data.js').v1CharData} */
6750+ const character = characters[characterId];
6751+ if (!character) {
6752+ console.warn('Character not found:', characterId);
6753+ return;
6754+ }
6755+
6756+ // Character is not shallow
6757+ if (!character.shallow) {
6758+ return;
6759+ }
6760+
6761+ const avatar = character.avatar;
6762+ if (!avatar) {
6763+ console.warn('Character has no avatar field:', characterId);
6764+ return;
6765+ }
6766+
6767+ await getOneCharacter(avatar);
6768+}
6769+
65606770export async function getChat() {
65616771 //console.log('/api/chats/get -- entered for -- ' + characters[this_chid].name);
65626772 try {
6773+ await unshallowCharacter(this_chid);
6774+
65636775 const response = await $.ajax({
65646776 type: 'POST',
65656777 url: '/api/chats/get',
@@ -6782,14 +6994,14 @@ export function changeMainAPI() {
67826994 forceCharacterEditorTokenize();
67836995}
67846996
67856997export function setUserName(value, { toastPersonaNameChange = true } = {}) {
67866998 name1 = value;
67876999 if (name1 === undefined || name1 == '')
67887000 name1 = default_user_name;
67897001 console.log(`User name changed to ${name1}`);
67907002 $('#your_name').valtext(name1);
67917003 if (toastPersonaNameChange && power_user.persona_show_notifications && !isPersonaPanelOpen()) {
67927004 toastr.success(t`Your messages will now be sent as ${name1}`, t`Current personaPersona updatedChanged`);
67937005 }
67947006 saveSettingsDebounced();
67957007}
@@ -6841,7 +7053,7 @@ export async function getSettings() {
68417053 settings = JSON.parse(data.settings);
68427054 if (settings.username !== undefined && settings.username !== '') {
68437055 name1 = settings.username;
68447056 $('#your_name').valtext(name1);
68457057 }
68467058
68477059 accountStorage.init(settings?.accountStorage);
@@ -7546,7 +7758,7 @@ export function select_rm_info(type, charId, previousCharId = null) {
75467758 if (previousCharId) {
75477759 const newId = characters.findIndex((x) => x.avatar == previousCharId);
75487760 if (newId >= 0) {
7549- this_chid = newId;
7761+ setCharacterId(newId);
75507762 }
75517763 }
75527764}
@@ -7566,6 +7778,7 @@ export function select_selected_character(chid) {
75667778 $('#create_button').attr('value', 'Save'); // what is the use case for this?
75677779 $('#dupe_button').show();
75687780 $('#create_button_label').css('display', 'none');
7781+ $('#char_connections_button').show();
75697782
75707783 // Hide the chat scenario button if we're peeking the group member defs
75717784 $('#set_chat_scenario').toggle(!selected_group);
@@ -7650,6 +7863,7 @@ function select_rm_create() {
76507863 $('#create_button_label').css('display', '');
76517864 $('#create_button').attr('value', 'Create');
76527865 $('#dupe_button').hide();
7866+ $('#char_connections_button').hide();
76537867
76547868 //create text poles
76557869 $('#rm_button_back').css('display', '');
@@ -7679,8 +7893,8 @@ function select_rm_create() {
76797893 $('#renameCharButton').css('display', 'none');
76807894 $('#name_div').removeClass('displayNone');
76817895 $('#name_div').addClass('displayBlock');
76827896 $('.open_alternate_greetings').data('chid', undefined-1);
76837897 $('#set_character_world').data('chid', undefined-1);
76847898 setWorldInfoButtonClass(undefined, !!create_save.world);
76857899 updateFavButtonState(false);
76867900 checkEmbeddedWorld();
@@ -7771,7 +7985,7 @@ function updateFavButtonState(state) {
77717985}
77727986
77737987export async function setScenarioOverride() {
77747988 if (!selected_group && (this_chid === undefined || !characters[this_chid])) {
77757989 console.warn('setScenarioOverride() -- no selected group or character');
77767990 return;
77777991 }
@@ -7989,6 +8203,12 @@ export async function saveChatConditional() {
79898203 }
79908204
79918205 try {
8206+ if (chatSaveTimeout) {
8207+ console.debug('Debounced chat save canceled');
8208+ clearTimeout(chatSaveTimeout);
8209+ chatSaveTimeout = null;
8210+ }
8211+
79928212 isChatSaving = true;
79938213
79948214 if (selected_group) {
@@ -8130,7 +8350,7 @@ function updateAlternateGreetingsHintVisibility(root) {
81308350function openCharacterWorldPopup() {
81318351 const chid = $('#set_character_world').data('chid');
81328352
81338353 if (menu_type != 'create' && chid === undefined) {
81348354 toastr.error('Does not have an Id for this character in world select menu.');
81358355 return;
81368356 }
@@ -8262,7 +8482,7 @@ function openAlternateGreetings() {
82628482 return;
82638483 } else {
82648484 // If the character does not have alternate greetings, create an empty array
82658485 if (characters[chid] && !Array.isArray(characters[chid].data.alternate_greetings) == false) {
82668486 characters[chid].data.alternate_greetings = [];
82678487 }
82688488 }
@@ -8449,7 +8669,7 @@ async function createOrEditCharacter(e) {
84498669
84508670 formData.delete('alternate_greetings');
84518671 const chid = $('.open_alternate_greetings').data('chid');
84528672 if (characters[chid] && Array.isArray(characters[chid]?.data?.alternate_greetings)) {
84538673 for (const value of characters[chid].data.alternate_greetings) {
84548674 formData.append('alternate_greetings', value);
84558675 }
@@ -8525,7 +8745,7 @@ function swipe_left() { // when we swipe left..but no generation.
85258745 }
85268746
85278747 // Make sure ad-hoc changes to extras are saved before swiping away
85288748 syncCurrentSwipeInfoExtrassyncMesToSwipe();
85298749
85308750 const swipe_duration = 120;
85318751 const swipe_range = '700px';
@@ -8663,7 +8883,7 @@ const swipe_right = () => {
86638883 }
86648884
86658885 // Make sure ad-hoc changes to extras are saved before swiping away
86668886 syncCurrentSwipeInfoExtrassyncMesToSwipe();
86678887
86688888 const swipe_duration = 200;
86698889 const swipe_range = 700;
@@ -8675,7 +8895,12 @@ const swipe_right = () => {
86758895 chat[chat.length - 1]['swipes'] = []; // empty the array
86768896 chat[chat.length - 1]['swipe_info'] = [];
86778897 chat[chat.length - 1]['swipes'][0] = chat[chat.length - 1]['mes']; //assign swipe array with last message from chat
8678- chat[chat.length - 1]['swipe_info'][0] = { 'send_date': chat[chat.length - 1]['send_date'], 'gen_started': chat[chat.length - 1]['gen_started'], 'gen_finished': chat[chat.length - 1]['gen_finished'], 'extra': JSON.parse(JSON.stringify(chat[chat.length - 1]['extra'])) };
8898+ chat[chat.length - 1]['swipe_info'][0] = {
8899+ 'send_date': chat[chat.length - 1]['send_date'],
8900+ 'gen_started': chat[chat.length - 1]['gen_started'],
8901+ 'gen_finished': chat[chat.length - 1]['gen_finished'],
8902+ 'extra': JSON.parse(JSON.stringify(chat[chat.length - 1]['extra'])),
8903+ };
86798904 //assign swipe info array with last message from chat
86808905 }
86818906 if (chat.length === 1 && chat[0]['swipe_id'] !== undefined && chat[0]['swipe_id'] === chat[0]['swipes'].length - 1) { // if swipe_right is called on the last alternate greeting, loop back around
@@ -8831,7 +9056,7 @@ const swipe_right = () => {
88319056 }
88329057};
88339058
88349059export const CONNECT_API_MAP = {
88359060 // Default APIs not contined inside text gen / chat gen
88369061 'kobold': {
88379062 selected: 'kobold',
@@ -9969,7 +10194,7 @@ jQuery(async function () {
996910194 });
997010195
997110196 $(document).on('click', '.character_select', async function () {
997210197 const id = Number($(this).attr('data-chid'));
997310198 await selectCharacterById(id);
997410199 });
997510200
@@ -10165,7 +10390,7 @@ jQuery(async function () {
1016510390 $('#form_create').submit(createOrEditCharacter);
1016610391
1016710392 $('#delete_button').on('click', async function () {
1016810393 if (this_chid === undefined || !characters[this_chid]) {
1016910394 toastr.warning('No character selected.');
1017010395 return;
1017110396 }
@@ -10947,7 +11172,7 @@ jQuery(async function () {
1094711172 });
1094811173
1094911174 $(document).on('click', '.mes_edit_copy', async function () {
1095011175 const confirmation = await callGenericPopup('t`Create a copy of this message?'`, POPUP_TYPE.CONFIRM);
1095111176 if (!confirmation) {
1095211177 return;
1095311178 }
public/scripts/BulkEditOverlay.js+10 -10
@@ -395,7 +395,7 @@ class BulkEditOverlay {
395395
396396 /**
397397 * @typedef {object} LastSelected - An object noting the last selected character and its state.
398398 * @property {stringnumber} [characterId] - The character id of the last selected character.
399399 * @property {boolean} [select] - The selected state of the last selected character. <c>true</c> if it was selected, <c>false</c> if it was deselected.
400400 */
401401
@@ -672,10 +672,10 @@ class BulkEditOverlay {
672672 * @param {HTMLElement} currentCharacter - The html element of the currently toggled character
673673 */
674674 handleShiftClick = (currentCharacter) => {
675675 const characterId = Number(currentCharacter.getAttribute('data-chid'));
676676 const select = !this.selectedCharacters.includes(characterId);
677677
678678 if (this.lastSelected.characterId >= 0 && this.lastSelected.select !== undefined) {
679679 // Only if select state and the last select state match we execute the range select
680680 if (select === this.lastSelected.select) {
681681 this.toggleCharactersInRange(currentCharacter, select);
@@ -691,7 +691,7 @@ class BulkEditOverlay {
691691 * @param {boolean} [param1.markState] - Whether the toggle of this character should be remembered as the last done toggle
692692 */
693693 toggleSingleCharacter = (character, { markState = true } = {}) => {
694694 const characterId = Number(character.getAttribute('data-chid'));
695695
696696 const select = !this.selectedCharacters.includes(characterId);
697697 const legacyBulkEditCheckbox = character.querySelector('.' + BulkEditOverlay.legacySelectedClass);
@@ -699,11 +699,11 @@ class BulkEditOverlay {
699699 if (select) {
700700 character.classList.add(BulkEditOverlay.selectedClass);
701701 if (legacyBulkEditCheckbox) legacyBulkEditCheckbox.checked = true;
702702 this.#selectedCharacters.push(String(characterId));
703703 } else {
704704 character.classList.remove(BulkEditOverlay.selectedClass);
705705 if (legacyBulkEditCheckbox) legacyBulkEditCheckbox.checked = false;
706706 this.#selectedCharacters = this.#selectedCharacters.filter(item => String(characterId) !== item);
707707 }
708708
709709 this.updateSelectedCount();
@@ -732,15 +732,15 @@ class BulkEditOverlay {
732732 * @param {boolean} select - <c>true</c> if the characters in the range are to be selected, <c>false</c> if deselected
733733 */
734734 toggleCharactersInRange = (currentCharacter, select) => {
735735 const currentCharacterId = Number(currentCharacter.getAttribute('data-chid'));
736736 const characters = Array.from(document.querySelectorAll('#' + BulkEditOverlay.containerId + ' .' + BulkEditOverlay.characterClass));
737737
738738 const startIndex = characters.findIndex(c => Number(c.getAttribute('data-chid')) === Number(this.lastSelected.characterId));
739739 const endIndex = characters.findIndex(c => Number(c.getAttribute('data-chid')) === currentCharacterId);
740740
741741 for (let i = Math.min(startIndex, endIndex); i <= Math.max(startIndex, endIndex); i++) {
742742 const character = characters[i];
743743 const characterId = Number(character.getAttribute('data-chid'));
744744 const isCharacterSelected = this.selectedCharacters.includes(characterId);
745745
746746 // Only toggle the character if it wasn't on the state we have are toggling towards.
public/scripts/RossAscends-mods.js+24 -6
@@ -280,17 +280,32 @@ async function RA_autoloadchat() {
280280 // active character is the name, we should look it up in the character list and get the id
281281 if (active_character !== null && active_character !== undefined) {
282282 const active_character_id = characters.findIndex(x => getTagKeyForEntity(x) === active_character);
283283 if (active_character_id !== null-1) {
284284 await selectCharacterById(String(active_character_id));
285285
286286 // Do a little tomfoolery to spoof the tag selector
287287 const selectedCharElement = $(`#rm_print_characters_block .character_select[chid="${active_character_id}"]`);
288288 applyTagsOnCharacterSelect.call(selectedCharElement);
289+ } else {
290+ setActiveCharacter(null);
291+ saveSettingsDebounced();
292+ console.warn(`Currently active character with ID ${active_character} not found. Resetting to no active character.`);
289293 }
290294 }
291295
292296 if (active_group !== null && active_group !== undefined) {
293- await openGroupById(String(active_group));
297+ if (active_character) {
298+ console.warn('Active character and active group are both set. Only active character will be loaded. Resetting active group.');
299+ setActiveGroup(null);
300+ saveSettingsDebounced();
301+ } else {
302+ const result = await openGroupById(String(active_group));
303+ if (!result) {
304+ setActiveGroup(null);
305+ saveSettingsDebounced();
306+ console.warn(`Currently active group with ID ${active_group} not found. Resetting to no active group.`);
307+ }
308+ }
294309 }
295310
296311 // if the character list hadn't been loaded yet, try again.
@@ -301,7 +316,10 @@ export async function favsToHotswap() {
301316 const entities = getEntitiesList({ doFilter: false });
302317 const container = $('#right-nav-panel .hotswap');
303318
304- const favs = entities.filter(x => x.item.fav || x.item.fav == 'true');
319+ // Hard limit is required because even if all hotswaps don't fit the screen, their images would still be loaded
320+ // 25 is roughly calculated as the maximum number of favs that can fit an ultrawide monitor with the default theme
321+ const FAVS_LIMIT = 25;
322+ const favs = entities.filter(x => x.item.fav || x.item.fav == 'true').slice(0, FAVS_LIMIT);
305323
306324 //helpful instruction message if no characters are favorited
307325 if (favs.length == 0) {
@@ -879,14 +897,14 @@ export function initRossMods() {
879897
880898 // when a char is selected from the list, save their name as the auto-load character for next page load
881899 $(document).on('click', '.character_select', function () {
882900 const characterId = $(this).attr('chid') || $(this).data('id-chid');
883901 setActiveCharacter(characterId);
884902 setActiveGroup(null);
885903 saveSettingsDebounced();
886904 });
887905
888906 $(document).on('click', '.group_select', function () {
889907 const groupId = $(this).attr('data-chid') || $(this).attr('grid') || $(this).data('id-grid');
890908 setActiveCharacter(null);
891909 setActiveGroup(groupId);
892910 saveSettingsDebounced();
public/scripts/authors-note.js+9 -9
@@ -299,7 +299,7 @@ function loadSettings() {
299299 $('#extension_floating_role').val(chat_metadata[metadata_keys.role]);
300300 $(`input[name="extension_floating_position"][value="${chat_metadata[metadata_keys.position]}"]`).prop('checked', true);
301301
302302 if (extension_settings.note.chara && getContext().characterId !== undefined) {
303303 const charaNote = extension_settings.note.chara.find((e) => e.name === getCharaFilename());
304304
305305 $('#extension_floating_chara').val(charaNote ? charaNote.prompt : '');
@@ -389,7 +389,11 @@ export function setFloatingPrompt() {
389389}
390390
391391function onANMenuItemClick() {
392392 if (!selected_group ||&& this_chid === undefined) {
393+ toastr.warning(t`Select a character before trying to use Author's Note`, '', { timeOut: 2000 });
394+ return;
395+ }
396+
393397 //show AN if it's hidden
394398 if ($('#floatingPrompt').css('display') !== 'flex') {
395399 $('#floatingPrompt').addClass('resizing');
@@ -416,22 +420,18 @@ function onANMenuItemClick() {
416420 $('#floatingPrompt').transition({
417421 opacity: 0.0,
418422 duration: animation_duration,
419- },
423+ }, async function () {
420- async function () {
421424 await delay(50);
422425 $('#floatingPrompt').removeClass('resizing');
423426 });
424427 setTimeout(function () {
425428 $('#floatingPrompt').hide();
426429 }, animation_duration);
427-
428430 }
431+
429432 //duplicate options menu close handler from script.js
430433 //because this listener takes priority
431434 $('#options').stop().fadeOut(animation_duration);
432- } else {
433- toastr.warning(t`Select a character before trying to use Author's Note`, '', { timeOut: 2000 });
434- }
435435}
436436
437437async function onChatChanged() {
@@ -446,7 +446,7 @@ async function onChatChanged() {
446446 $('#extension_floating_prompt_token_counter').text(tokenCounter1);
447447
448448 let tokenCounter2;
449449 if (extension_settings.note.chara && context.characterId !== undefined) {
450450 const charaNote = extension_settings.note.chara.find((e) => e.name === getCharaFilename());
451451
452452 if (charaNote) {
public/scripts/bookmarks.js+0 -10
@@ -318,16 +318,6 @@ export async function convertSoloToGroupChat() {
318318 const groupChat = chat.slice();
319319 const genIdFirst = Date.now();
320320
321- // Add something if the chat is empty
322- if (groupChat.length === 0) {
323- const newMessage = {
324- ...system_messages[system_message_types.GROUP],
325- send_date: getMessageTimeStamp(),
326- extra: { type: system_message_types.GROUP },
327- };
328- groupChat.push(newMessage);
329- }
330-
331321 for (let index = 0; index < groupChat.length; index++) {
332322 const message = groupChat[index];
333323
public/scripts/cfg-scale.js+7 -8
@@ -69,8 +69,7 @@ function setCharCfg(tempValue, setting) {
6969 if (!existingCharaCfg.useChara &&
7070 (tempAssign.guidance_scale ?? 1.00) === 1.00 &&
7171 (tempAssign.negative_prompt?.length ?? 0) === 0 &&
7272 (tempAssign.positive_prompt?.length ?? 0) === 0) {
73- {
7473 extension_settings.cfg.chara.splice(existingCharaCfgIndex, 1);
7574 }
7675 } else if (avatarName && tempValue.length > 0) {
@@ -113,7 +112,11 @@ function setChatCfg(tempValue, setting) {
113112
114113// TODO: Only change CFG when character is selected
115114function onCfgMenuItemClick() {
116115 if (!selected_group ||&& this_chid === undefined) {
116+ toastr.warning('Select a character before trying to configure CFG', '', { timeOut: 2000 });
117+ return;
118+ }
119+
117120 //show CFG config if it's hidden
118121 if ($('#cfgConfig').css('display') !== 'flex') {
119122 $('#cfgConfig').addClass('resizing');
@@ -140,8 +143,7 @@ function onCfgMenuItemClick() {
140143 $('#cfgConfig').transition({
141144 opacity: 0.0,
142145 duration: animation_duration,
143- },
146+ }, async function () {
144- async function () {
145147 await delay(50);
146148 $('#cfgConfig').removeClass('resizing');
147149 });
@@ -153,9 +155,6 @@ function onCfgMenuItemClick() {
153155 //duplicate options menu close handler from script.js
154156 //because this listener takes priority
155157 $('#options').stop().fadeOut(animation_duration);
156- } else {
157- toastr.warning('Select a character before trying to configure CFG', '', { timeOut: 2000 });
158- }
159158}
160159
161160async function onChatChanged() {
public/scripts/char-data.js+1 -0
@@ -113,5 +113,6 @@
113113 * @property {string} chat - name of the current chat file chat
114114 * @property {string} avatar - file name of the avatar image (acts as a unique identifier)
115115 * @property {string} json_data - the full raw JSON data of the character
116+ * @property {boolean?} shallow - if the data is shallow (lazy-loaded)
116117 */
117118export default 0;// now this file is a module
public/scripts/custom-request.js+189 -0
@@ -0,0 +1,189 @@
1+import { getPresetManager } from './preset-manager.js';
2+import { extractMessageFromData, getGenerateUrl, getRequestHeaders } from '../script.js';
3+import { getTextGenServer } from './textgen-settings.js';
4+
5+// #region Type Definitions
6+/**
7+ * @typedef {Object} TextCompletionRequestBase
8+ * @property {string} prompt - The text prompt for completion
9+ * @property {number} max_tokens - Maximum number of tokens to generate
10+ * @property {string} [model] - Optional model name
11+ * @property {string} api_type - Type of API to use
12+ * @property {string} [api_server] - Optional API server URL
13+ * @property {number} [temperature] - Optional temperature parameter
14+ */
15+
16+/** @typedef {Record<string, any> & TextCompletionRequestBase} TextCompletionRequest */
17+
18+/**
19+ * @typedef {Object} TextCompletionPayloadBase
20+ * @property {string} prompt - The text prompt for completion
21+ * @property {number} max_tokens - Maximum number of tokens to generate
22+ * @property {number} max_new_tokens - Alias for max_tokens
23+ * @property {string} [model] - Optional model name
24+ * @property {string} api_type - Type of API to use
25+ * @property {string} api_server - API server URL
26+ * @property {number} [temperature] - Optional temperature parameter
27+ */
28+
29+/** @typedef {Record<string, any> & TextCompletionPayloadBase} TextCompletionPayload */
30+
31+/**
32+ * @typedef {Object} ChatCompletionMessage
33+ * @property {string} role - The role of the message author (e.g., "user", "assistant", "system")
34+ * @property {string} content - The content of the message
35+ */
36+
37+/**
38+ * @typedef {Object} ChatCompletionPayloadBase
39+ * @property {ChatCompletionMessage[]} messages - Array of chat messages
40+ * @property {string} [model] - Optional model name to use for completion
41+ * @property {string} chat_completion_source - Source provider for chat completion
42+ * @property {number} max_tokens - Maximum number of tokens to generate
43+ * @property {number} [temperature] - Optional temperature parameter for response randomness
44+ */
45+
46+/** @typedef {Record<string, any> & ChatCompletionPayloadBase} ChatCompletionPayload */
47+// #endregion
48+
49+/**
50+ * Creates & sends a text completion request. Streaming is not supported.
51+ */
52+export class TextCompletionService {
53+ static TYPE = 'textgenerationwebui';
54+
55+ /**
56+ * @param {TextCompletionRequest} custom
57+ * @returns {TextCompletionPayload}
58+ */
59+ static createRequestData({ prompt, max_tokens, model, api_type, api_server, temperature, ...props }) {
60+ return {
61+ ...props,
62+ prompt,
63+ max_tokens,
64+ max_new_tokens: max_tokens,
65+ model,
66+ api_type,
67+ api_server: api_server ?? getTextGenServer(api_type),
68+ temperature,
69+ stream: false,
70+ };
71+ }
72+
73+ /**
74+ * Sends a text completion request to the specified server
75+ * @param {TextCompletionPayload} data Request data
76+ * @param {boolean?} extractData Extract message from the response. Default true
77+ * @returns {Promise<string | any>} Extracted data or the raw response
78+ * @throws {Error}
79+ */
80+ static async sendRequest(data, extractData = true) {
81+ const response = await fetch(getGenerateUrl(this.TYPE), {
82+ method: 'POST',
83+ headers: getRequestHeaders(),
84+ cache: 'no-cache',
85+ body: JSON.stringify(data),
86+ signal: new AbortController().signal,
87+ });
88+
89+ const json = await response.json();
90+ if (!response.ok || json.error) {
91+ throw json;
92+ }
93+
94+ return extractData ? extractMessageFromData(json, this.TYPE) : json;
95+ }
96+
97+ /**
98+ * @param {string} presetName
99+ * @param {TextCompletionRequest} custom
100+ * @param {boolean?} extractData Extract message from the response. Default true
101+ * @returns {Promise<string | any>} Extracted data or the raw response
102+ * @throws {Error}
103+ */
104+ static async sendRequestWithPreset(presetName, custom, extractData = true) {
105+ const presetManager = getPresetManager(this.TYPE);
106+ if (!presetManager) {
107+ throw new Error('Preset manager not found');
108+ }
109+
110+ const preset = presetManager.getCompletionPresetByName(presetName);
111+ if (!preset) {
112+ throw new Error('Preset not found');
113+ }
114+
115+ const data = this.createRequestData({ ...preset, ...custom });
116+
117+ return await this.sendRequest(data, extractData);
118+ }
119+}
120+
121+/**
122+ * Creates & sends a chat completion request. Streaming is not supported.
123+ */
124+export class ChatCompletionService {
125+ static TYPE = 'openai';
126+
127+ /**
128+ * @param {ChatCompletionPayload} custom
129+ * @returns {ChatCompletionPayload}
130+ */
131+ static createRequestData({ messages, model, chat_completion_source, max_tokens, temperature, ...props }) {
132+ return {
133+ ...props,
134+ messages,
135+ model,
136+ chat_completion_source,
137+ max_tokens,
138+ temperature,
139+ stream: false,
140+ };
141+ }
142+
143+ /**
144+ * Sends a chat completion request
145+ * @param {ChatCompletionPayload} data Request data
146+ * @param {boolean?} extractData Extract message from the response. Default true
147+ * @returns {Promise<string | any>} Extracted data or the raw response
148+ * @throws {Error}
149+ */
150+ static async sendRequest(data, extractData = true) {
151+ const response = await fetch('/api/backends/chat-completions/generate', {
152+ method: 'POST',
153+ headers: getRequestHeaders(),
154+ cache: 'no-cache',
155+ body: JSON.stringify(data),
156+ signal: new AbortController().signal,
157+ });
158+
159+ const json = await response.json();
160+ if (!response.ok || json.error) {
161+ throw json;
162+ }
163+
164+ return extractData ? extractMessageFromData(json, this.TYPE) : json;
165+ }
166+
167+ /**
168+ * @param {string} presetName
169+ * @param {ChatCompletionPayload} custom
170+ * @param {boolean} extractData Extract message from the response. Default true
171+ * @returns {Promise<string | any>} Extracted data or the raw response
172+ * @throws {Error}
173+ */
174+ static async sendRequestWithPreset(presetName, custom, extractData = true) {
175+ const presetManager = getPresetManager(this.TYPE);
176+ if (!presetManager) {
177+ throw new Error('Preset manager not found');
178+ }
179+
180+ const preset = presetManager.getCompletionPresetByName(presetName);
181+ if (!preset) {
182+ throw new Error('Preset not found');
183+ }
184+
185+ const data = this.createRequestData({ ...preset, ...custom });
186+
187+ return await this.sendRequest(data, extractData);
188+ }
189+}
public/scripts/extensions.js+58 -6
@@ -7,7 +7,7 @@ import { renderTemplate, renderTemplateAsync } from './templates.js';
77import { delay, isSubsetOf, sanitizeSelector, setValueByPath } from './utils.js';
88import { getContext } from './st-context.js';
99import { isAdmin } from './user.js';
1010import { addLocaleData, getCurrentLocale, t } from './i18n.js';
1111import { debounce_timeout } from './constants.js';
1212import { accountStorage } from './util/AccountStorage.js';
1313
@@ -154,8 +154,18 @@ export const extension_settings = {
154154 refine_mode: false,
155155 },
156156 expressions: {
157+ /** @type {number} see `EXPRESSION_API` */
158+ api: undefined,
157159 /** @type {string[]} */
158160 custom: [],
161+ showDefault: false,
162+ translate: false,
163+ /** @type {string} */
164+ fallback_expression: undefined,
165+ /** @type {string} */
166+ llmPrompt: undefined,
167+ allowMultiple: true,
168+ rerollIfSame: false,
159169 },
160170 connectionManager: {
161171 selectedProfile: '',
@@ -200,6 +210,12 @@ export const extension_settings = {
200210 * @type {string[]}
201211 */
202212 disabled_attachments: [],
213+ gallery: {
214+ /** @type {{[characterKey: string]: string}} */
215+ folders: {},
216+ /** @type {string} */
217+ sort: 'dateAsc',
218+ },
203219};
204220
205221function showHideExtensionsMenu() {
@@ -374,7 +390,7 @@ async function activateExtensions() {
374390 if (meetsModuleRequirements && !isDisabled) {
375391 try {
376392 console.debug('Activating extension', name);
377393 const promise = addExtensionLocale(name, manifest).finally(() => Promise.all([addExtensionScript(name, manifest), addExtensionStyle(name, manifest)]));
378394 await promise
379395 .then(() => activeExtensions.add(name))
380396 .catch(err => console.log('Could not activate extension', name, err));
@@ -567,6 +583,42 @@ function addExtensionScript(name, manifest) {
567583}
568584
569585/**
586+ * Adds a localization data for an extension.
587+ * @param {string} name Extension name
588+ * @param {object} manifest Manifest object
589+ */
590+function addExtensionLocale(name, manifest) {
591+ // No i18n data in the manifest
592+ if (!manifest.i18n || typeof manifest.i18n !== 'object') {
593+ return Promise.resolve();
594+ }
595+
596+ const currentLocale = getCurrentLocale();
597+ const localeFile = manifest.i18n[currentLocale];
598+
599+ // Manifest doesn't provide a locale file for the current locale
600+ if (!localeFile) {
601+ return Promise.resolve();
602+ }
603+
604+ return fetch(`/scripts/extensions/${name}/${localeFile}`)
605+ .then(async response => {
606+ if (!response.ok) {
607+ throw new Error(`HTTP ${response.status}: ${response.statusText}`);
608+ }
609+
610+ const data = await response.json();
611+
612+ if (data && typeof data === 'object') {
613+ addLocaleData(currentLocale, data);
614+ }
615+ })
616+ .catch(err => {
617+ console.log('Could not load extension locale data for ' + name, err);
618+ });
619+}
620+
621+/**
570622 * Generates HTML string for displaying an extension in the UI.
571623 *
572624 * @param {string} name - The name of the extension.
@@ -603,12 +655,12 @@ function generateExtensionHtml(name, manifest, isActive, isDisabled, isExternal,
603655 }
604656
605657 let toggleElement = isActive || isDisabled ?
606658 `'<input type="checkbox" title="' + t`Click to toggle` + `" data-name="${name}" class="${isActive ? 'toggle_disable' : 'toggle_enable'} ${checkboxClass}" ${isActive ? 'checked' : ''}>` :
607659 `<input type="checkbox" title="Cannot enable extension" data-name="${name}" class="extension_missing ${checkboxClass}" disabled>`;
608660
609661 let deleteButton = isExternal ? `<button class="btn_delete menu_button" data-name="${externalId}" data-i18n="[title]Delete" title="Delete"><i class="fa-fw fa-solid fa-trash-can"></i></button>` : '';
610662 let updateButton = isExternal ? `<button class="btn_update menu_button displayNone" data-name="${externalId}" title="Update available"><i class="fa-solid fa-download fa-fw"></i></button>` : '';
611663 let moveButton = isExternal && isUserAdmin ? `<button class="btn_move menu_button" data-name="${externalId}" data-i18n="[title]Move" title="Move"><i class="fa-solid fa-folder-tree fa-fw"></i></button>` : '';
612664 let modulesInfo = '';
613665
614666 if (isActive && Array.isArray(manifest.optional)) {
@@ -616,7 +668,7 @@ function generateExtensionHtml(name, manifest, isActive, isDisabled, isExternal,
616668 modules.forEach(x => optional.delete(x));
617669 if (optional.size > 0) {
618670 const optionalString = DOMPurify.sanitize([...optional].join(', '));
619671 modulesInfo = `'<div class="extension_modules">' + t`Optional modules:` + ` <span class="optional">${optionalString}</span></div>`;
620672 }
621673 } else if (!isDisabled) { // Neither active nor disabled
622674 const requirements = new Set(manifest.requires);
public/scripts/extensions/assets/index.js+13 -15
@@ -10,6 +10,7 @@ import { POPUP_TYPE, Popup, callGenericPopup } from '../../popup.js';
1010import { executeSlashCommands } from '../../slash-commands.js';
1111import { accountStorage } from '../../util/AccountStorage.js';
1212import { flashHighlight, getStringHash, isValidUrl } from '../../utils.js';
13+import { t } from '../../i18n.js';
1314export { MODULE_NAME };
1415
1516const MODULE_NAME = 'assets';
@@ -59,11 +60,11 @@ const KNOWN_TYPES = {
5960 'blip': 'Blip sounds',
6061};
6162
6263async function downloadAssetsList(url) {
6364 updateCurrentAssets().then(async function () {
6465 fetch(url, { cache: 'no-cache' })
6566 .then(response => response.json())
6667 .then(jsonasync =>function(json) {
6768
6869 availableAssets = {};
6970 $('#assets_menu').empty();
@@ -84,10 +85,10 @@ function downloadAssetsList(url) {
8485
8586 $('#assets_type_select').empty();
8687 $('#assets_search').val('');
8788 $('#assets_type_select').append($('<option />', { value: '', text: 't`All'` }));
8889
8990 for (const type of assetTypes) {
9091 const option = $('<option />', { value: type, text: t([KNOWN_TYPES[type] || type]) });
9192 $('#assets_type_select').append(option);
9293 }
9394
@@ -104,11 +105,7 @@ function downloadAssetsList(url) {
104105 assetTypeMenu.append(`<h3>${KNOWN_TYPES[assetType] || assetType}</h3>`).hide();
105106
106107 if (assetType == 'extension') {
107- assetTypeMenu.append(`
108+ assetTypeMenu.append(await renderExtensionTemplateAsync('assets', 'installation'));
108- <div class="assets-list-git">
109- To download extensions from this page, you need to have <a href="https://git-scm.com/downloads" target="_blank">Git</a> installed.<br>
110- Click the <i class="fa-solid fa-sm fa-arrow-up-right-from-square"></i> icon to visit the Extension's repo for tips on how to use it.
111- </div>`);
112109 }
113110
114111 for (const i in availableAssets[assetType].sort((a, b) => a?.name && b?.name && a['name'].localeCompare(b['name']))) {
@@ -184,7 +181,7 @@ function downloadAssetsList(url) {
184181 const displayName = DOMPurify.sanitize(asset['name'] || asset['id']);
185182 const description = DOMPurify.sanitize(asset['description'] || '');
186183 const url = isValidUrl(asset['url']) ? asset['url'] : '';
187184 const title = assetType === 'extension' ? t`Extension repo/guide:` + ` ${url}` : 't`Preview in browser'`;
188185 const previewIcon = (assetType === 'extension' || assetType === 'character') ? 'fa-arrow-up-right-from-square' : 'fa-headphones-simple';
189186 const toolTag = assetType === 'extension' && asset['tool'];
190187
@@ -195,9 +192,10 @@ function downloadAssetsList(url) {
195192 <b>${displayName}</b>
196193 <a class="asset_preview" href="${url}" target="_blank" title="${title}">
197194 <i class="fa-solid fa-sm ${previewIcon}"></i>
198195 </a>` +
199196 ${(toolTag ? '<span class="tag" title="' + t`Adds a function tool` + '"><i class="fa-solid fa-sm fa-wrench"></i> Tool</span>' : ''}+
200- </span>
197+ t`Tool` + '</span>' : '') +
198+ `</span>
201199 <small class="asset-description">
202200 ${description}
203201 </small>
@@ -435,7 +433,7 @@ jQuery(async () => {
435433 const rememberKey = `Assets_SkipConfirm_${getStringHash(url)}`;
436434 const skipConfirm = accountStorage.getItem(rememberKey) === 'true';
437435
438436 const confirmation = skipConfirm || await Popup.show.confirm('t`Loading Asset List'`, `'<span>' + t`Are you sure you want to connect to the following url?` + `</span><var>${url}</var>`, {
439437 customInputs: [{ id: 'assets-remember', label: 'Don\'t ask again for this URL' }],
440438 onClose: popup => {
441439 if (popup.result) {
public/scripts/extensions/assets/installation.html+4 -0
@@ -0,0 +1,4 @@
1+<div class="assets-list-git">
2+ <span data-i18n="extension_install_1">To download extensions from this page, you need to have </span><a href="https://git-scm.com/downloads" target="_blank">Git</a><span data-i18n="extension_install_2"> installed.</span><br>
3+ <span data-i18n="extension_install_3">Click the </span><i class="fa-solid fa-sm fa-arrow-up-right-from-square"></i><span data-i18n="extension_install_4"> icon to visit the Extension's repo for tips on how to use it.</span>
4+</div>
4 \ No newline at end of file
public/scripts/extensions/assets/window.html+1 -1
@@ -33,7 +33,7 @@ To install a single 3rd party extension, use the &quot;Install Extensions&quot;
3333 <div id="assets_filters" class="flex-container">
3434 <select id="assets_type_select" class="text_pole flex1">
3535 </select>
3636 <input id="assets_search" class="text_pole flex1" data-i18n="[placeholder]Search" placeholder="Search" type="search">
3737 <div id="assets-characters-button" class="menu_button menu_button_icon">
3838 <i class="fa-solid fa-image-portrait"></i>
3939 <span data-i18n="Characters">Characters</span>
public/scripts/extensions/caption/index.js+56 -17
@@ -398,23 +398,62 @@ jQuery(async function () {
398398
399399 $('#caption_wand_container').append(sendButton);
400400 $(sendButton).on('click', () => {
401401 const hasCaptionModule = (() => {
402- (modules.includes('caption') && extension_settings.caption.source === 'extras') ||
402+ const settings = extension_settings.caption;
403- (extension_settings.caption.source === 'multimodal' && extension_settings.caption.multimodal_api === 'openai' && (secret_state[SECRET_KEYS.OPENAI] || extension_settings.caption.allow_reverse_proxy)) ||
403+
404- (extension_settings.caption.source === 'multimodal' && extension_settings.caption.multimodal_api === 'openrouter' && secret_state[SECRET_KEYS.OPENROUTER]) ||
404+ // Handle non-multimodal sources
405405 if (extension_settings.captionsettings.source === 'multimodalextras' && extension_settings.captionmodules.multimodal_api === includes('zerooneaicaption' && secret_state[SECRET_KEYS.ZEROONEAI])) ||return true;
406406 if (extension_settings.captionsettings.source === 'multimodallocal' &&|| extension_settings.captionsettings.multimodal_apisource === 'groqhorde' && secret_state[SECRET_KEYS.GROQ]) ||return true;
407- (extension_settings.caption.source === 'multimodal' && extension_settings.caption.multimodal_api === 'mistral' && (secret_state[SECRET_KEYS.MISTRALAI] || extension_settings.caption.allow_reverse_proxy)) ||
407+
408- (extension_settings.caption.source === 'multimodal' && extension_settings.caption.multimodal_api === 'google' && (secret_state[SECRET_KEYS.MAKERSUITE] || extension_settings.caption.allow_reverse_proxy)) ||
408+ // Handle multimodal sources
409- (extension_settings.caption.source === 'multimodal' && extension_settings.caption.multimodal_api === 'anthropic' && (secret_state[SECRET_KEYS.CLAUDE] || extension_settings.caption.allow_reverse_proxy)) ||
409+ if (settings.source === 'multimodal') {
410- (extension_settings.caption.source === 'multimodal' && extension_settings.caption.multimodal_api === 'ollama' && textgenerationwebui_settings.server_urls[textgen_types.OLLAMA]) ||
410+ const api = settings.multimodal_api;
411- (extension_settings.caption.source === 'multimodal' && extension_settings.caption.multimodal_api === 'llamacpp' && textgenerationwebui_settings.server_urls[textgen_types.LLAMACPP]) ||
411+
412- (extension_settings.caption.source === 'multimodal' && extension_settings.caption.multimodal_api === 'ooba' && textgenerationwebui_settings.server_urls[textgen_types.OOBA]) ||
412+ // APIs that support reverse proxy
413- (extension_settings.caption.source === 'multimodal' && extension_settings.caption.multimodal_api === 'koboldcpp' && textgenerationwebui_settings.server_urls[textgen_types.KOBOLDCPP]) ||
413+ const reverseProxyApis = {
414- (extension_settings.caption.source === 'multimodal' && extension_settings.caption.multimodal_api === 'vllm' && textgenerationwebui_settings.server_urls[textgen_types.VLLM]) ||
414+ 'openai': SECRET_KEYS.OPENAI,
415- (extension_settings.caption.source === 'multimodal' && extension_settings.caption.multimodal_api === 'custom') ||
415+ 'mistral': SECRET_KEYS.MISTRALAI,
416- extension_settings.caption.source === 'local' ||
416+ 'google': SECRET_KEYS.MAKERSUITE,
417- extension_settings.caption.source === 'horde';
417+ 'anthropic': SECRET_KEYS.CLAUDE,
418+ };
419+
420+ if (reverseProxyApis[api]) {
421+ if (secret_state[reverseProxyApis[api]] || settings.allow_reverse_proxy) {
422+ return true;
423+ }
424+ }
425+
426+ const chatCompletionApis = {
427+ 'openrouter': SECRET_KEYS.OPENROUTER,
428+ 'zerooneai': SECRET_KEYS.ZEROONEAI,
429+ 'groq': SECRET_KEYS.GROQ,
430+ 'cohere': SECRET_KEYS.COHERE,
431+ };
432+
433+ if (chatCompletionApis[api] && secret_state[chatCompletionApis[api]]) {
434+ return true;
435+ }
436+
437+ const textCompletionApis = {
438+ 'ollama': textgen_types.OLLAMA,
439+ 'llamacpp': textgen_types.LLAMACPP,
440+ 'ooba': textgen_types.OOBA,
441+ 'koboldcpp': textgen_types.KOBOLDCPP,
442+ 'vllm': textgen_types.VLLM,
443+ };
444+
445+ if (textCompletionApis[api] && textgenerationwebui_settings.server_urls[textCompletionApis[api]]) {
446+ return true;
447+ }
448+
449+ // Custom API doesn't need additional checks
450+ if (api === 'custom') {
451+ return true;
452+ }
453+ }
454+
455+ return false;
456+ })();
418457
419458 if (!hasCaptionModule) {
420459 toastr.error('Choose other captioning source in the extension settings.', 'Captioning is not available');
public/scripts/extensions/caption/settings.html+9 -0
@@ -19,6 +19,7 @@
1919 <select id="caption_multimodal_api" class="flex1 text_pole">
2020 <option value="zerooneai">01.AI (Yi)</option>
2121 <option value="anthropic">Anthropic</option>
22+ <option value="cohere">Cohere</option>
2223 <option value="custom" data-i18n="Custom (OpenAI-compatible)">Custom (OpenAI-compatible)</option>
2324 <option value="google">Google AI Studio</option>
2425 <option value="groq">Groq</option>
@@ -35,6 +36,8 @@
3536 <div class="flex1 flex-container flexFlowColumn flexNoGap">
3637 <label for="caption_multimodal_model" data-i18n="Model">Model</label>
3738 <select id="caption_multimodal_model" class="flex1 text_pole">
39+ <option data-type="cohere" value="c4ai-aya-vision-8b">c4ai-aya-vision-8b</option>
40+ <option data-type="cohere" value="c4ai-aya-vision-32b">c4ai-aya-vision-32b</option>
3841 <option data-type="mistral" value="pixtral-12b-latest">pixtral-12b-latest</option>
3942 <option data-type="mistral" value="pixtral-12b-2409">pixtral-12b-2409</option>
4043 <option data-type="mistral" value="pixtral-large-latest">pixtral-large-latest</option>
@@ -45,6 +48,12 @@
4548 <option data-type="openai" value="gpt-4o">gpt-4o</option>
4649 <option data-type="openai" value="gpt-4o-mini">gpt-4o-mini</option>
4750 <option data-type="openai" value="chatgpt-4o-latest">chatgpt-4o-latest</option>
51+ <option data-type="openai" value="o1">o1</option>
52+ <option data-type="openai" value="o1-2024-12-17">o1-2024-12-17</option>
53+ <option data-type="openai" value="gpt-4.5-preview">gpt-4.5-preview</option>
54+ <option data-type="openai" value="gpt-4.5-preview-2025-02-27">gpt-4.5-preview-2025-02-27</option>
55+ <option data-type="anthropic" value="claude-3-7-sonnet-latest">claude-3-7-sonnet-latest</option>
56+ <option data-type="anthropic" value="claude-3-7-sonnet-20250219">claude-3-7-sonnet-20250219</option>
4857 <option data-type="anthropic" value="claude-3-5-sonnet-latest">claude-3-5-sonnet-latest</option>
4958 <option data-type="anthropic" value="claude-3-5-sonnet-20241022">claude-3-5-sonnet-20241022</option>
5059 <option data-type="anthropic" value="claude-3-5-sonnet-20240620">claude-3-5-sonnet-20240620</option>
public/scripts/extensions/expressions/index.js+789 -708
@@ -1,11 +1,11 @@
11import { Fuse } from '../../../lib.js';
22
33import { callPopupcharacters, eventSource, event_types, generateRaw, getRequestHeaders, main_api, online_status, saveSettingsDebounced, substituteParams, substituteParamsExtended, system_message_types, this_chid } from '../../../script.js';
44import { dragElement, isMobile } from '../../RossAscends-mods.js';
55import { getContext, getApiUrl, modules, extension_settings, ModuleWorkerWrapper, doExtrasFetch, renderExtensionTemplateAsync } from '../../extensions.js';
66import { loadMovingUIState, performFuzzySearch, power_user } from '../../power-user.js';
77import { onlyUnique, debounce, getCharaFilename, trimToEndSentence, trimToStartSentence, waitUntilCondition, findChar } from '../../utils.js';
88import { hideMutedSprites, selected_group } from '../../group-chats.js';
99import { isJsonSchemaSupported } from '../../textgen-settings.js';
1010import { debounce_timeout } from '../../constants.js';
1111import { SlashCommandParser } from '../../slash-commands/SlashCommandParser.js';
@@ -15,16 +15,32 @@ import { SlashCommandEnumValue, enumTypes } from '../../slash-commands/SlashComm
1515import { commonEnumProviders } from '../../slash-commands/SlashCommandCommonEnumsProvider.js';
1616import { slashCommandReturnHelper } from '../../slash-commands/SlashCommandReturnHelper.js';
1717import { generateWebLlmChatPrompt, isWebLlmSupported } from '../shared.js';
18+import { Popup, POPUP_RESULT } from '../../popup.js';
19+import { t } from '../../i18n.js';
1820export { MODULE_NAME };
1921
22+/**
23+* @typedef {object} Expression Expression definition with label and file path
24+* @property {string} label The label of the expression
25+* @property {ExpressionImage[]} files One or more images to represent this expression
26+*/
27+
28+/**
29+ * @typedef {object} ExpressionImage An expression image
30+ * @property {string} expression - The expression
31+ * @property {boolean} [isCustom=false] - If the expression is added by user
32+ * @property {string} fileName - The filename with extension
33+ * @property {string} title - The title for the image
34+ * @property {string} imageSrc - The image source / full path
35+ * @property {'success' | 'additional' | 'failure'} type - The type of the image
36+ */
37+
2038const MODULE_NAME = 'expressions';
2139const UPDATE_INTERVAL = 2000;
2240const STREAMING_UPDATE_INTERVAL = 10000;
23-const TALKINGCHECK_UPDATE_INTERVAL = 500;
2441const DEFAULT_FALLBACK_EXPRESSION = 'joy';
2542const DEFAULT_LLM_PROMPT = 'Ignore previous instructions. Classify the emotion of the last message. Output just one word, e.g. "joy" or "anger". Choose only one of the following labels: {{labels}}';
2643const DEFAULT_EXPRESSIONS = [
27- 'talkinghead',
2844 'admiration',
2945 'amusement',
3046 'anger',
@@ -54,6 +70,12 @@ const DEFAULT_EXPRESSIONS = [
5470 'surprise',
5571 'neutral',
5672];
73+
74+const OPTION_NO_FALLBACK = '#none';
75+const OPTION_EMOJI_FALLBACK = '#emoji';
76+const RESET_SPRITE_LABEL = '#reset';
77+
78+
5779/** @enum {number} */
5880const EXPRESSION_API = {
5981 local: 0,
@@ -65,35 +87,29 @@ const EXPRESSION_API = {
6587let expressionsList = null;
6688let lastCharacter = undefined;
6789let lastMessage = null;
68-let lastTalkingState = false;
90+/** @type {{[characterKey: string]: Expression[]}} */
69-let lastTalkingStateMessage = null; // last message as seen by `updateTalkingState` (tracked separately, different timer)
7091let spriteCache = {};
7192let inApiCall = false;
7293let lastServerResponseTime = 0;
73-export let lastExpression = {};
74-
75-function isTalkingHeadEnabled() {
76- return extension_settings.expressions.talkinghead && extension_settings.expressions.api == EXPRESSION_API.extras;
77-}
7894
79-/**
95+/** @type {{[characterName: string]: string}} */
80- * Returns the fallback expression if explicitly chosen, otherwise the default one
96+export let lastExpression = {};
81- * @returns {string} expression name
82- */
83-function getFallbackExpression() {
84- return extension_settings.expressions.fallback_expression ?? DEFAULT_FALLBACK_EXPRESSION;
85-}
8697
8798/**
88- * Toggles Talkinghead mode on/off.
99+ * Returns a placeholder image object for a given expression
89- *
100+ * @param {string} expression - The expression label
90- * Implements the `/th` slash command, which is meant to be bound to a Quick Reply button
101+ * @param {boolean} [isCustom=false] - Whether the expression is custom
91- * as a quick way to switch Talkinghead on or off (e.g. to conserve GPU resources when AFK
102+ * @returns {ExpressionImage} The placeholder image object
92- * for a long time).
93103 */
94104function toggleTalkingHeadCommandgetPlaceholderImage(_expression, isCustom = false) {
95- setTalkingHeadState(!extension_settings.expressions.talkinghead);
105+ return {
96- return String(extension_settings.expressions.talkinghead);
106+ expression: expression,
107+ isCustom: isCustom,
108+ title: 'No Image',
109+ type: 'failure',
110+ fileName: 'No-Image-Placeholder.svg',
111+ imageSrc: '/img/No-Image-Placeholder.svg',
112+ };
97113}
98114
99115function isVisualNovelMode() {
@@ -108,21 +124,21 @@ async function forceUpdateVisualNovelMode() {
108124
109125const updateVisualNovelModeDebounced = debounce(forceUpdateVisualNovelMode, debounce_timeout.quick);
110126
111127async function updateVisualNovelMode(namespriteFolderName, expression) {
112128 const containervnContainer = $('#visual-novel-wrapper');
113129
114130 await visualNovelRemoveInactive(containervnContainer);
115131
116132 const setSpritePromises = await visualNovelSetCharacterSprites(containervnContainer, namespriteFolderName, expression);
117133
118134 // calculate layer indices based on recent messages
119135 await visualNovelUpdateLayers(containervnContainer);
120136
121137 await Promise.allSettled(setSpritePromises);
122138
123139 // update again based on new sprites
124140 if (setSpritePromises.length > 0) {
125141 await visualNovelUpdateLayers(containervnContainer);
126142 }
127143}
128144
@@ -153,52 +169,60 @@ async function visualNovelRemoveInactive(container) {
153169 await Promise.allSettled(removeInactiveCharactersPromises);
154170}
155171
156-async function visualNovelSetCharacterSprites(container, name, expression) {
172+/**
173+ * Sets the character sprites for visual novel mode based on the provided container, name, and expression.
174+ *
175+ * @param {JQuery<HTMLElement>} vnContainer - The container element where the sprites will be set
176+ * @param {string} spriteFolderName - The name of the sprite folder
177+ * @param {string} expression - The expression to set for the characters
178+ * @returns {Promise<Array>} - An array of promises that resolve when the sprites are set
179+ */
180+async function visualNovelSetCharacterSprites(vnContainer, spriteFolderName, expression) {
181+ const originalExpression = expression;
157182 const context = getContext();
158183 const group = context.groups.find(x => x.id == context.groupId);
159- const labels = await getExpressionsList();
160184
161- const createCharacterPromises = [];
162185 const setSpritePromises = [];
163186
164187 for (const avatar of group.members) {
165- const isDisabled = group.disabled_members.includes(avatar);
166-
167188 // skip disabled characters
189+ const isDisabled = group.disabled_members.includes(avatar);
168190 if (isDisabled && hideMutedSprites) {
169191 continue;
170192 }
171193
172194 const character = context.characters.find(x => x.avatar == avatar);
173-
174195 if (!character) {
175196 continue;
176197 }
177198
178- const spriteFolderName = getSpriteFolderName({ original_avatar: character.avatar }, character.name);
199+ const expressionImage = vnContainer.find(`.expression-holder[data-avatar="${avatar}"]`);
200+ /** @type {JQuery<HTMLElement>} */
201+ let img;
202+
203+ const memberSpriteFolderName = getSpriteFolderName({ original_avatar: character.avatar }, character.name);
179204
180205 // download images if not downloaded yet
181206 if (spriteCache[spriteFolderNamememberSpriteFolderName] === undefined) {
182207 spriteCache[spriteFolderNamememberSpriteFolderName] = await getSpritesList(spriteFolderNamememberSpriteFolderName);
183208 }
184209
185- const sprites = spriteCache[spriteFolderName];
210+ const prevExpressionSrc = expressionImage.find('img').attr('src') || null;
186- const expressionImage = container.find(`.expression-holder[data-avatar="${avatar}"]`);
187- const defaultExpression = getFallbackExpression();
188- const defaultSpritePath = sprites.find(x => x.label === defaultExpression)?.path;
189- const noSprites = sprites.length === 0;
190211
191212 if (expressionImage!originalExpression && Array.isArray(spriteCache[memberSpriteFolderName]) && spriteCache[memberSpriteFolderName].length > 0) {
192- if (name == spriteFolderName) {
213+ expression = await getLastMessageSprite(avatar);
193- await validateImages(spriteFolderName, true);
214+ }
194- setExpressionOverrideHtml(true); // <= force clear expression override input
195- const currentSpritePath = labels.includes(expression) ? sprites.find(x => x.label === expression)?.path : '';
196215
197- const path = currentSpritePath || defaultSpritePath || '';
216+ const spriteFile = chooseSpriteForExpression(memberSpriteFolderName, expression, { prevExpressionSrc: prevExpressionSrc });
198- const img = expressionImage.find('img');
217+ if (expressionImage.length) {
218+ if (!spriteFolderName || spriteFolderName == memberSpriteFolderName) {
219+ await validateImages(memberSpriteFolderName, true);
220+ setExpressionOverrideHtml(true); // <= force clear expression override input
221+ const path = spriteFile?.imageSrc || '';
222+ img = expressionImage.find('img');
199223 await setImage(img, path);
200224 }
201225 expressionImage.toggleClass('hidden', noSprites!spriteFile);
202226 } else {
203227 const template = $('#expression-holder').clone();
204228 template.attr('id', `expression-${avatar}`);
@@ -206,21 +230,49 @@ async function visualNovelSetCharacterSprites(container, name, expression) {
206230 template.find('.drag-grabber').attr('id', `expression-${avatar}header`);
207231 $('#visual-novel-wrapper').append(template);
208232 dragElement($(template[0]));
209233 template.toggleClass('hidden', noSprites!spriteFile);
210234 awaitimg setImage(= template.find('img'), defaultSpritePath || '');
235+ await setImage(img, spriteFile?.imageSrc || '');
211236 const fadeInPromise = new Promise(resolve => {
212237 template.fadeIn(250, () => resolve());
213238 });
214239 createCharacterPromisessetSpritePromises.push(fadeInPromise);
215- const setSpritePromise = setLastMessageSprite(template.find('img'), avatar, labels);
216- setSpritePromises.push(setSpritePromise);
217240 }
241+
242+ if (!img) {
243+ continue;
244+ }
245+
246+ img.attr('data-sprite-folder-name', spriteFolderName);
247+ img.attr('data-expression', expression);
248+ img.attr('data-sprite-filename', spriteFile?.fileName || null);
249+ img.attr('title', expression);
250+
251+ if (spriteFile) console.info(`Expression set for group member ${character.name}`, { expression: spriteFile.expression, file: spriteFile.fileName });
252+ else if (expressionImage.length) console.info(`Expression unset for group member ${character.name} - No sprite found`, { expression: expression });
253+ else console.info(`Expression not available for group member ${character.name}`, { expression: expression });
218254 }
219255
220- await Promise.allSettled(createCharacterPromises);
221256 return setSpritePromises;
222257}
223258
259+/**
260+ * Classifies the text of the latest message and returns the expression label.
261+ * @param {string} avatar - The avatar of the character to get the last message for
262+ * @returns {Promise<string>} - The expression label
263+ */
264+async function getLastMessageSprite(avatar) {
265+ const context = getContext();
266+ const lastMessage = context.chat.slice().reverse().find(x => x.original_avatar == avatar || (x.force_avatar && x.force_avatar.includes(encodeURIComponent(avatar))));
267+
268+ if (lastMessage) {
269+ const text = lastMessage.mes || '';
270+ return await getExpressionLabel(text);
271+ }
272+
273+ return null;
274+}
275+
224276async function visualNovelUpdateLayers(container) {
225277 const context = getContext();
226278 const group = context.groups.find(x => x.id == context.groupId);
@@ -256,11 +308,17 @@ async function visualNovelUpdateLayers(container) {
256308 const containerWidth = container.width();
257309 const pivotalPoint = containerWidth * 0.5;
258310
259311 let images = Array.from($('#visual-novel-wrapper .expression-holder')).sort(sortFunction);
260312 let imagesWidth = [];
261313
262- images.sort(sortFunction).each(function () {
314+ for (const image of images) {
263- imagesWidth.push($(this).width());
315+ if (image instanceof HTMLImageElement && !image.complete) {
316+ await new Promise(resolve => image.addEventListener('load', resolve, { once: true }));
317+ }
318+ }
319+
320+ images.forEach(image => {
321+ imagesWidth.push($(image).width());
264322 });
265323
266324 let totalWidth = imagesWidth.reduce((a, b) => a + b, 0);
@@ -274,7 +332,7 @@ async function visualNovelUpdateLayers(container) {
274332 currentPosition = 0; // Reset the initial position to 0
275333 }
276334
277335 images.sort(sortFunction).eachforEach((indexcurrent, currentindex) => {
278336 const element = $(current);
279337 const elementID = element.attr('id');
280338
@@ -294,9 +352,15 @@ async function visualNovelUpdateLayers(container) {
294352 element.show();
295353
296354 const promise = new Promise(resolve => {
355+ if (power_user.reduced_motion) {
356+ element.css('left', currentPosition + 'px');
357+ requestAnimationFrame(() => resolve());
358+ }
359+ else {
297360 element.animate({ left: currentPosition + 'px' }, 500, () => {
298361 resolve();
299362 });
363+ }
300364 });
301365
302366 currentPosition += imagesWidth[index];
@@ -307,23 +371,12 @@ async function visualNovelUpdateLayers(container) {
307371 await Promise.allSettled(setLayerIndicesPromises);
308372}
309373
310-async function setLastMessageSprite(img, avatar, labels) {
374+/**
311- const context = getContext();
375+ * Sets the expression for the given character image.
312- const lastMessage = context.chat.slice().reverse().find(x => x.original_avatar == avatar || (x.force_avatar && x.force_avatar.includes(encodeURIComponent(avatar))));
376+ * @param {JQuery<HTMLElement>} img - The image element to set the image on
313-
377+ * @param {string} path - The path to the image
314- if (lastMessage) {
378+ * @returns {Promise<void>} - A promise that resolves when the image is set
315- const text = lastMessage.mes || '';
379+ */
316- const spriteFolderName = getSpriteFolderName(lastMessage, lastMessage.name);
317- const sprites = spriteCache[spriteFolderName] || [];
318- const label = await getExpressionLabel(text);
319- const path = labels.includes(label) ? sprites.find(x => x.label === label)?.path : '';
320-
321- if (path) {
322- setImage(img, path);
323- }
324- }
325-}
326-
327380async function setImage(img, path) {
328381 // Cohee: If something goes wrong, uncomment this to return to the old behavior
329382 /*
@@ -340,7 +393,7 @@ async function setImage(img, path) {
340393 return new Promise(resolve => {
341394 const prevExpressionSrc = img.attr('src');
342395 const expressionClone = img.clone();
343396 const originalId = img.attrdata('idfilename');
344397
345398 //only swap expressions when necessary
346399 if (prevExpressionSrc !== path && !img.hasClass('expression-animating')) {
@@ -348,7 +401,7 @@ async function setImage(img, path) {
348401 expressionClone.addClass('expression-clone');
349402 //make invisible and remove id to prevent double ids
350403 //must be made invisible to start because they share the same Z-index
351404 expressionClone.attrdata('idfilename', '').css({ opacity: 0 });
352405 //add new sprite path to clone src
353406 expressionClone.attr('src', path);
354407 //add invisible clone to html
@@ -384,14 +437,18 @@ async function setImage(img, path) {
384437 //remove old expression
385438 img.remove();
386439 //replace ID so it becomes the new 'original' expression for next change
387440 expressionClone.attrdata('idfilename', originalId);
388441 expressionClone.removeClass('expression-animating');
389442
390443 // Reset the expression holder min height and width
391444 expressionHolder.css('min-width', 100);
392445 expressionHolder.css('min-height', 100);
393446
447+ if (expressionClone.prop('complete')) {
394448 resolve();
449+ } else {
450+ expressionClone.one('load', () => resolve());
451+ }
395452 });
396453
397454 expressionClone.removeClass('expression-clone');
@@ -410,216 +467,9 @@ async function setImage(img, path) {
410467 });
411468}
412469
413-function onExpressionsShowDefaultInput() {
470+async function moduleWorker({ newChat = false } = {}) {
414- const value = $(this).prop('checked');
415- extension_settings.expressions.showDefault = value;
416- saveSettingsDebounced();
417-
418- const existingImageSrc = $('img.expression').prop('src');
419- if (existingImageSrc !== undefined) { //if we have an image in src
420- if (!value && existingImageSrc.includes('/img/default-expressions/')) { //and that image is from /img/ (default)
421- $('img.expression').prop('src', ''); //remove it
422- lastMessage = null;
423- }
424- if (value) {
425- lastMessage = null;
426- }
427- }
428-}
429-
430-/**
431- * Stops animating Talkinghead.
432- */
433-async function unloadTalkingHead() {
434- if (!modules.includes('talkinghead')) {
435- console.debug('talkinghead module is disabled');
436- return;
437- }
438- console.debug('expressions: Stopping Talkinghead');
439-
440- try {
441- const url = new URL(getApiUrl());
442- url.pathname = '/api/talkinghead/unload';
443- const loadResponse = await doExtrasFetch(url);
444- if (!loadResponse.ok) {
445- throw new Error(loadResponse.statusText);
446- }
447- //console.log(`Response: ${loadResponseText}`);
448- } catch (error) {
449- //console.error(`Error unloading - ${error}`);
450- }
451-}
452-
453-/**
454- * Posts `talkinghead.png` of the current character to the talkinghead module in SillyTavern-extras, to start animating it.
455- */
456-async function loadTalkingHead() {
457- if (!modules.includes('talkinghead')) {
458- console.debug('talkinghead module is disabled');
459- return;
460- }
461- console.debug('expressions: Starting Talkinghead');
462-
463- const spriteFolderName = getSpriteFolderName();
464-
465- const talkingheadPath = `/characters/${encodeURIComponent(spriteFolderName)}/talkinghead.png`;
466- const emotionsSettingsPath = `/characters/${encodeURIComponent(spriteFolderName)}/_emotions.json`;
467- const animatorSettingsPath = `/characters/${encodeURIComponent(spriteFolderName)}/_animator.json`;
468-
469- try {
470- const spriteResponse = await fetch(talkingheadPath);
471-
472- if (!spriteResponse.ok) {
473- throw new Error(spriteResponse.statusText);
474- }
475-
476- const spriteBlob = await spriteResponse.blob();
477- const spriteFile = new File([spriteBlob], 'talkinghead.png', { type: 'image/png' });
478- const formData = new FormData();
479- formData.append('file', spriteFile);
480-
481- const url = new URL(getApiUrl());
482- url.pathname = '/api/talkinghead/load';
483-
484- const loadResponse = await doExtrasFetch(url, {
485- method: 'POST',
486- body: formData,
487- });
488-
489- if (!loadResponse.ok) {
490- throw new Error(loadResponse.statusText);
491- }
492-
493- const loadResponseText = await loadResponse.text();
494- console.log(`Load talkinghead response: ${loadResponseText}`);
495-
496- // Optional: per-character emotion templates
497- let emotionsSettings;
498- try {
499- const emotionsResponse = await fetch(emotionsSettingsPath);
500- if (emotionsResponse.ok) {
501- emotionsSettings = await emotionsResponse.json();
502- console.log(`Loaded ${emotionsSettingsPath}`);
503- } else {
504- throw new Error();
505- }
506- }
507- catch (error) {
508- emotionsSettings = {}; // blank -> use server defaults (to unload the previous character's customizations)
509- console.log(`No valid config at ${emotionsSettingsPath}, using server defaults`);
510- }
511- try {
512- const url = new URL(getApiUrl());
513- url.pathname = '/api/talkinghead/load_emotion_templates';
514- const apiResult = await doExtrasFetch(url, {
515- method: 'POST',
516- headers: {
517- 'Content-Type': 'application/json',
518- 'Bypass-Tunnel-Reminder': 'bypass',
519- },
520- body: JSON.stringify(emotionsSettings),
521- });
522-
523- if (!apiResult.ok) {
524- throw new Error(apiResult.statusText);
525- }
526- }
527- catch (error) {
528- // it's ok if not supported
529- console.log('Failed to send _emotions.json (backend too old?), ignoring');
530- }
531-
532- // Optional: per-character animator and postprocessor config
533- let animatorSettings;
534- try {
535- const animatorResponse = await fetch(animatorSettingsPath);
536- if (animatorResponse.ok) {
537- animatorSettings = await animatorResponse.json();
538- console.log(`Loaded ${animatorSettingsPath}`);
539- } else {
540- throw new Error();
541- }
542- }
543- catch (error) {
544- animatorSettings = {}; // blank -> use server defaults (to unload the previous character's customizations)
545- console.log(`No valid config at ${animatorSettingsPath}, using server defaults`);
546- }
547- try {
548- const url = new URL(getApiUrl());
549- url.pathname = '/api/talkinghead/load_animator_settings';
550- const apiResult = await doExtrasFetch(url, {
551- method: 'POST',
552- headers: {
553- 'Content-Type': 'application/json',
554- 'Bypass-Tunnel-Reminder': 'bypass',
555- },
556- body: JSON.stringify(animatorSettings),
557- });
558-
559- if (!apiResult.ok) {
560- throw new Error(apiResult.statusText);
561- }
562- }
563- catch (error) {
564- // it's ok if not supported
565- console.log('Failed to send _animator.json (backend too old?), ignoring');
566- }
567- } catch (error) {
568- console.error(`Error loading talkinghead image: ${talkingheadPath} - ${error}`);
569- }
570-}
571-
572-function handleImageChange() {
573- const imgElement = document.querySelector('img#expression-image.expression');
574-
575- if (!imgElement || !(imgElement instanceof HTMLImageElement)) {
576- console.log('Cannot find addExpressionImage()');
577- return;
578- }
579-
580- if (isTalkingHeadEnabled() && modules.includes('talkinghead')) {
581- const talkingheadResultFeedSrc = `${getApiUrl()}/api/talkinghead/result_feed`;
582- $('#expression-holder').css({ display: '' });
583- if (imgElement.src !== talkingheadResultFeedSrc) {
584- const expressionImageElement = document.querySelector('.expression_list_image');
585-
586- if (expressionImageElement && expressionImageElement instanceof HTMLImageElement) {
587- doExtrasFetch(expressionImageElement.src, {
588- method: 'HEAD',
589- })
590- .then(response => {
591- if (response.ok) {
592- imgElement.src = talkingheadResultFeedSrc;
593- }
594- })
595- .catch(error => {
596- console.error(error);
597- });
598- }
599- }
600- } else {
601- imgElement.src = ''; // remove in case char doesn't have expressions
602-
603- // When switching Talkinghead off, force-set the character to the last known expression, if any.
604- // This preserves the same expression Talkinghead had at the moment it was switched off.
605- const charName = getContext().name2;
606- const last = lastExpression[charName];
607- const targetExpression = last ? last : getFallbackExpression();
608- setExpression(charName, targetExpression, true);
609- }
610-}
611-
612-async function moduleWorker() {
613471 const context = getContext();
614472
615- // Hide and disable Talkinghead while not in extras
616- $('#image_type_block').toggle(extension_settings.expressions.api == EXPRESSION_API.extras);
617-
618- if (extension_settings.expressions.api != EXPRESSION_API.extras && extension_settings.expressions.talkinghead) {
619- $('#image_type_toggle').prop('checked', false);
620- setTalkingHeadState(false);
621- }
622-
623473 // non-characters not supported
624474 if (!context.groupId && context.characterId === undefined) {
625475 removeExpression();
@@ -646,7 +496,7 @@ async function moduleWorker() {
646496 }
647497
648498 const currentLastMessage = getLastCharacterMessage();
649499 let spriteFolderName = context.groupId ? getSpriteFolderName(currentLastMessage, currentLastMessage.name) : getSpriteFolderName();
650500
651501 // character has no expressions or it is not loaded
652502 if (Object.keys(spriteCache).length === 0) {
@@ -686,6 +536,10 @@ async function moduleWorker() {
686536 offlineMode.css('display', 'none');
687537 }
688538
539+ if (context.groupId && vnMode && newChat) {
540+ await forceUpdateVisualNovelMode();
541+ }
542+
689543 // Don't bother classifying if current char has no sprites and no default expressions are enabled
690544 if ((!Array.isArray(spriteCache[spriteFolderName]) || spriteCache[spriteFolderName].length === 0) && !extension_settings.expressions.showDefault) {
691545 return;
@@ -732,11 +586,11 @@ async function moduleWorker() {
732586 const force = !!context.groupId;
733587
734588 // Character won't be angry on you for swiping
735589 if (currentLastMessage.mes == '...' && expressionsList.includes(getFallbackExpression()extension_settings.expressions.fallback_expression)) {
736590 expression = getFallbackExpression()extension_settings.expressions.fallback_expression;
737591 }
738592
739593 await sendExpressionCall(spriteFolderName, expression, { force: force, vnMode: vnMode });
740594 }
741595 catch (error) {
742596 console.log(error);
@@ -749,91 +603,6 @@ async function moduleWorker() {
749603 }
750604}
751605
752-/**
753- * Starts/stops Talkinghead talking animation.
754- *
755- * Talking starts only when all the following conditions are met:
756- * - The LLM is currently streaming its output.
757- * - The AI's current last message is non-empty, and also not just '...' (as produced by a swipe).
758- * - The AI's current last message has changed from what we saw during the previous call.
759- *
760- * In all other cases, talking stops.
761- *
762- * A Talkinghead API call is made only when the talking state changes.
763- *
764- * Note that also the TTS system, if enabled, starts/stops the Talkinghead talking animation.
765- * See `talkingAnimation` in `SillyTavern/public/scripts/extensions/tts/index.js`.
766- */
767-async function updateTalkingState() {
768- // Don't bother if Talkinghead is disabled or not loaded.
769- if (!isTalkingHeadEnabled() || !modules.includes('talkinghead')) {
770- return;
771- }
772-
773- const context = getContext();
774- const currentLastMessage = getLastCharacterMessage();
775-
776- try {
777- // TODO: Not sure if we need also "&& !context.groupId" here - the classify check in `moduleWorker`
778- // (that similarly checks the streaming processor state) does that for some reason.
779- // Talkinghead isn't currently designed to work with groups.
780- const lastMessageChanged = !((lastCharacter === context.characterId || lastCharacter === context.groupId) && lastTalkingStateMessage === currentLastMessage.mes);
781- const url = new URL(getApiUrl());
782- let newTalkingState;
783- if (context.streamingProcessor && !context.streamingProcessor.isFinished &&
784- currentLastMessage.mes.length !== 0 && currentLastMessage.mes !== '...' && lastMessageChanged) {
785- url.pathname = '/api/talkinghead/start_talking';
786- newTalkingState = true;
787- } else {
788- url.pathname = '/api/talkinghead/stop_talking';
789- newTalkingState = false;
790- }
791- try {
792- // Call the Talkinghead API only if the talking state changed.
793- if (newTalkingState !== lastTalkingState) {
794- console.debug(`updateTalkingState: calling ${url.pathname}`);
795- await doExtrasFetch(url);
796- }
797- }
798- catch (error) {
799- // it's ok if not supported
800- }
801- finally {
802- lastTalkingState = newTalkingState;
803- }
804- }
805- catch (error) {
806- // console.log(error);
807- }
808- finally {
809- lastTalkingStateMessage = currentLastMessage.mes;
810- }
811-}
812-
813-/**
814- * Checks whether the current character has a talkinghead image available.
815- * @returns {Promise<boolean>} True if the character has a talkinghead image available, false otherwise.
816- */
817-async function isTalkingHeadAvailable() {
818- let spriteFolderName = getSpriteFolderName();
819-
820- try {
821- await validateImages(spriteFolderName);
822-
823- let talkingheadObj = spriteCache[spriteFolderName].find(obj => obj.label === 'talkinghead');
824- let talkingheadPath = talkingheadObj ? talkingheadObj.path : null;
825-
826- if (talkingheadPath != null) {
827- return true;
828- } else {
829- await unloadTalkingHead();
830- return false;
831- }
832- } catch (err) {
833- return err;
834- }
835-}
836-
837606function getSpriteFolderName(characterMessage = null, characterName = null) {
838607 const context = getContext();
839608 let spriteFolderName = characterName ?? context.name2;
@@ -848,33 +617,6 @@ function getSpriteFolderName(characterMessage = null, characterName = null) {
848617 return spriteFolderName;
849618}
850619
851-function setTalkingHeadState(newState) {
852- console.debug(`expressions: New talkinghead state: ${newState}`);
853- extension_settings.expressions.talkinghead = newState; // Store setting
854- saveSettingsDebounced();
855-
856- if ([EXPRESSION_API.local, EXPRESSION_API.llm, EXPRESSION_API.webllm].includes(extension_settings.expressions.api)) {
857- return;
858- }
859-
860- isTalkingHeadAvailable().then(result => {
861- if (result) {
862- //console.log("talkinghead exists!");
863-
864- if (extension_settings.expressions.talkinghead) {
865- loadTalkingHead();
866- } else {
867- unloadTalkingHead();
868- }
869- handleImageChange(); // Change image as needed
870-
871-
872- } else {
873- //console.log("talkinghead does not exist.");
874- }
875- });
876-}
877-
878620function getFolderNameByMessage(message) {
879621 const context = getContext();
880622 let avatarPath = '';
@@ -882,7 +624,7 @@ function getFolderNameByMessage(message) {
882624 if (context.groupId) {
883625 avatarPath = message.original_avatar || context.characters.find(x => message.force_avatar && message.force_avatar.includes(encodeURIComponent(x.avatar)))?.avatar;
884626 }
885627 else if (context.characterId !== undefined) {
886628 avatarPath = getCharaFilename();
887629 }
888630
@@ -894,48 +636,55 @@ function getFolderNameByMessage(message) {
894636 return folderName;
895637}
896638
897-async function sendExpressionCall(name, expression, force, vnMode) {
639+/**
898- lastExpression[name.split('/')[0]] = expression;
640+ * Update the expression for the given character.
899- if (!vnMode) {
641+ *
642+ * @param {string} spriteFolderName The character name, optionally with a sprite folder override, e.g. "folder/expression".
643+ * @param {string} expression The expression label, e.g. "amusement", "joy", etc.
644+ * @param {Object} [options] Additional options
645+ * @param {boolean} [options.force=false] If true, the expression will be sent even if it is the same as the current expression.
646+ * @param {boolean} [options.vnMode=null] If true, the expression will be sent in Visual Novel mode. If null, it will be determined by the current chat mode.
647+ * @param {string?} [options.overrideSpriteFile=null] - Set if a specific sprite file should be used. Must be sprite file name.
648+ */
649+export async function sendExpressionCall(spriteFolderName, expression, { force = false, vnMode = null, overrideSpriteFile = null } = {}) {
650+ lastExpression[spriteFolderName.split('/')[0]] = expression;
651+ if (vnMode === null) {
900652 vnMode = isVisualNovelMode();
901653 }
902654
903655 if (vnMode) {
904656 await updateVisualNovelMode(namespriteFolderName, expression);
905657 } else {
906658 setExpression(namespriteFolderName, expression, { force: force, overrideSpriteFile: overrideSpriteFile });
907659 }
908660}
909661
910662async function setSpriteSetCommandsetSpriteFolderCommand(_, folder) {
911663 if (!folder) {
912664 console.log('Clearing sprite set');
913665 folder = '';
914666 }
915667
916668 if (folder.startsWith('/') || folder.startsWith('\\')) {
917- folder = folder.slice(1);
918-
919669 const currentLastMessage = getLastCharacterMessage();
670+ folder = folder.slice(1);
920671 folder = `${currentLastMessage.name}/${folder}`;
921672 }
922673
923674 $('#expression_override').val(folder.trim());
924675 onClickExpressionOverrideButton();
925- // removeExpression();
676+
926- // moduleWorker();
677+ // No need to resend the expression, the folder override will automatically update the currently displayed one.
927- const vnMode = isVisualNovelMode();
928- await sendExpressionCall(folder, lastExpression, true, vnMode);
929678 return '';
930679}
931680
932681async function classifyCallback(/** @type {{api: string?, prompt: string?}} */ { api = null, prompt = null }, text) {
933682 if (!text) {
934683 toastr.warningerror('No text provided');
935684 return '';
936685 }
937686 if (api && !Object.keys(EXPRESSION_API).includes(api)) {
938687 toastr.warningerror('Invalid API provided');
939688 return '';
940689 }
941690
@@ -951,37 +700,69 @@ async function classifyCallback(/** @type {{api: string?, prompt: string?}} */ {
951700 return label;
952701}
953702
954-async function setSpriteSlashCommand(_, spriteId) {
703+/** @type {(args: {type: 'expression' | 'sprite'}, searchTerm: string) => Promise<string>} */
955- if (!spriteId) {
704+async function setSpriteSlashCommand({ type }, searchTerm) {
956- console.log('No sprite id provided');
705+ type ??= 'expression';
706+ searchTerm = searchTerm.trim().toLowerCase();
707+ if (!searchTerm) {
708+ toastr.error(t`No expression or sprite name provided`, t`Set Sprite`);
957709 return '';
958710 }
959711
960- spriteId = spriteId.trim().toLowerCase();
712+ const currentLastMessage = selected_group ? getLastCharacterMessage() : null;
713+ const spriteFolderName = getSpriteFolderName(currentLastMessage, currentLastMessage?.name);
714+
715+ let label = searchTerm;
716+
717+ /** @type {string?} */
718+ let spriteFile = null;
961719
962- // In Talkinghead mode, don't check for the existence of the sprite
963- // (emotion names are the same as for sprites, but it only needs "talkinghead.png").
964- const currentLastMessage = getLastCharacterMessage();
965- const spriteFolderName = getSpriteFolderName(currentLastMessage, currentLastMessage.name);
966- let label = spriteId;
967- if (!isTalkingHeadEnabled() || !modules.includes('talkinghead')) {
968720 await validateImages(spriteFolderName);
969721
970- // Fuzzy search for sprite
722+ // Handle reset as a special term and just reset the sprite via expression call
971- const fuse = new Fuse(spriteCache[spriteFolderName], { keys: ['label'] });
723+ if (searchTerm === RESET_SPRITE_LABEL) {
972- const results = fuse.search(spriteId);
724+ await sendExpressionCall(spriteFolderName, label, { force: true });
973- const spriteItem = results[0]?.item;
725+ return lastExpression[spriteFolderName] ?? '';
726+ }
727+
728+ switch (type) {
729+ case 'expression': {
730+ // Fuzzy search for expression
731+ const existingExpressions = getCachedExpressions().map(x => ({ label: x }));
732+ const results = performFuzzySearch('expression-expressions', existingExpressions, [
733+ { name: 'label', weight: 1 },
734+ ], searchTerm);
735+ const matchedExpression = results[0]?.item;
736+ if (!matchedExpression) {
737+ toastr.warning(t`No expression found for search term ${searchTerm}`, t`Set Sprite`);
738+ return '';
739+ }
974740
975- if (!spriteItem) {
741+ label = matchedExpression.label;
976- console.log('No sprite found for search term ' + spriteId);
742+ break;
743+ }
744+ case 'sprite': {
745+ // Fuzzy search for sprite file
746+ const sprites = spriteCache[spriteFolderName].map(x => x.files).flat();
747+ const results = performFuzzySearch('expression-expressions', sprites, [
748+ { name: 'title', weight: 1 },
749+ { name: 'fileName', weight: 1 },
750+ ], searchTerm);
751+ const matchedSprite = results[0]?.item;
752+ if (!matchedSprite) {
753+ toastr.warning(t`No sprite file found for search term ${searchTerm}`, t`Set Sprite`);
977754 return '';
978755 }
979756
980757 label = spriteItemmatchedSprite.labelexpression;
758+ spriteFile = matchedSprite.fileName;
759+ break;
760+ }
761+ default: throw Error('Invalid sprite set type: ' + type);
981762 }
982763
983- const vnMode = isVisualNovelMode();
764+ await sendExpressionCall(spriteFolderName, label, { force: true, overrideSpriteFile: spriteFile });
984- await sendExpressionCall(spriteFolderName, label, true, vnMode);
765+
985766 return label;
986767}
987768
@@ -999,6 +780,21 @@ function spriteFolderNameFromCharacter(char) {
999780}
1000781
1001782/**
783+ * Generates a unique sprite name by appending an index to the given expression. *
784+ * @param {string} expression - The base expression to be used as the prefix for the sprite name.
785+ * @param {ExpressionImage[]} existingFiles - An array of existing file objects, each containing a fileName property.
786+ * @returns {string} - A unique sprite name with the format "expression-index".
787+ */
788+function generateUniqueSpriteName(expression, existingFiles) {
789+ let index = existingFiles.length;
790+ let newSpriteName;
791+ do {
792+ newSpriteName = `${expression}-${index++}`;
793+ } while (existingFiles.some(file => withoutExtension(file.fileName) === newSpriteName));
794+ return newSpriteName;
795+}
796+
797+/**
1002798 * Slash command callback for /uploadsprite
1003799 *
1004800 * label= is required
@@ -1011,16 +807,29 @@ function spriteFolderNameFromCharacter(char) {
1011807 * @param {object} args
1012808 * @param {string} args.name Character name or avatar key, passed through findChar
1013809 * @param {string} args.label Expression label
1014810 * @param {string} [args.folder=null] SpriteOptional sprite folder path, processed using backslash rules
811+ * @param {string?} [args.spriteName=null] Optional sprite name
1015812 * @param {string} imageUrl Image URI to fetch and upload
1016813 * @returns {Promise<voidstring>} the sprite name
1017814 */
1018815async function uploadSpriteCommand({ name, label, folder = null, spriteName = null }, imageUrl) {
1019816 if (!imageUrl) throw new Error('Image URL is required');
1020817 if (!label || typeof label !== 'string') throw new Error('Expression label is required');{
818+ toastr.error(t`Expression label is required`, t`Error Uploading Sprite`);
819+ return '';
820+ }
1021821
1022822 label = label.replace(/[^a-z]/gi, '').toLowerCase().trim();
1023- if (!label) throw new Error('Expression label must contain at least one letter');
823+ if (!label) {
824+ toastr.error(t`Expression label must contain at least one letter`, t`Error Uploading Sprite`);
825+ return '';
826+ }
827+
828+ spriteName = spriteName || label;
829+ if (!validateExpressionSpriteName(label, spriteName)) {
830+ toastr.error(t`Invalid sprite name. Must follow the naming pattern for expression sprites.`, t`Error Uploading Sprite`);
831+ return '';
832+ }
1024833
1025834 name = name || getLastCharacterMessage().original_avatar || getLastCharacterMessage().name;
1026835 const char = findChar({ name });
@@ -1041,6 +850,7 @@ async function uploadSpriteCommand({ name, label, folder }, imageUrl) {
1041850 formData.append('name', folder); // this is the folder or character name
1042851 formData.append('label', label); // this is the expression label
1043852 formData.append('avatar', file); // this is the image file
853+ formData.append('spriteName', spriteName); // this is a redundant comment
1044854
1045855 await handleFileUpload('/api/sprites/upload', formData);
1046856 console.debug(`[${MODULE_NAME}] Upload of ${imageUrl} completed for ${name} with label ${label}`);
@@ -1048,6 +858,8 @@ async function uploadSpriteCommand({ name, label, folder }, imageUrl) {
1048858 console.error(`[${MODULE_NAME}] Error uploading file:`, error);
1049859 throw error;
1050860 }
861+
862+ return spriteName;
1051863}
1052864
1053865/**
@@ -1159,7 +971,7 @@ function getJsonSchema(emotions) {
1159971function onTextGenSettingsReady(args) {
1160972 // Only call if inside an API call
1161973 if (inApiCall && extension_settings.expressions.api === EXPRESSION_API.llm && isJsonSchemaSupported()) {
1162- const emotions = DEFAULT_EXPRESSIONS.filter((e) => e != 'talkinghead');
974+ const emotions = DEFAULT_EXPRESSIONS;
1163975 Object.assign(args, {
1164976 top_k: 1,
1165977 stop: [],
@@ -1177,16 +989,16 @@ function onTextGenSettingsReady(args) {
1177989 * @param {EXPRESSION_API} [expressionsApi=extension_settings.expressions.api] - The expressions API to use for classification.
1178990 * @param {object} [options={}] - Optional arguments.
1179991 * @param {string?} [options.customPrompt=null] - The custom prompt to use for classification.
1180992 * @returns {Promise<string?>} - The label of the expression.
1181993 */
1182994export async function getExpressionLabel(text, expressionsApi = extension_settings.expressions.api, { customPrompt = null } = {}) {
1183995 // Return if text is undefined, saving a costly fetch request
1184996 if ((!modules.includes('classify') && expressionsApi == EXPRESSION_API.extras) || !text) {
1185997 return getFallbackExpression()extension_settings.expressions.fallback_expression;
1186998 }
1187999
11881000 if (extension_settings.expressions.translate && typeof window['globalThis.translate'] === 'function') {
11891001 text = await window['globalThis.translate'](text, 'en');
11901002 }
11911003
11921004 text = sampleClassifyText(text);
@@ -1212,7 +1024,7 @@ export async function getExpressionLabel(text, expressionsApi = extension_settin
12121024 await waitUntilCondition(() => online_status !== 'no_connection', 3000, 250);
12131025 } catch (error) {
12141026 console.warn('No LLM connection. Using fallback expression', error);
12151027 return getFallbackExpression()extension_settings.expressions.fallback_expression;
12161028 }
12171029
12181030 const expressionsList = await getExpressionsList();
@@ -1225,7 +1037,7 @@ export async function getExpressionLabel(text, expressionsApi = extension_settin
12251037 case EXPRESSION_API.webllm: {
12261038 if (!isWebLlmSupported()) {
12271039 console.warn('WebLLM is not supported. Using fallback expression');
12281040 return getFallbackExpression()extension_settings.expressions.fallback_expression;
12291041 }
12301042
12311043 const expressionsList = await getExpressionsList();
@@ -1258,9 +1070,9 @@ export async function getExpressionLabel(text, expressionsApi = extension_settin
12581070 } break;
12591071 }
12601072 } catch (error) {
12611073 toastr.infoerror('Could not classify expression. Check the console or your backend for more information.');
12621074 console.error(error);
12631075 return getFallbackExpression()extension_settings.expressions.fallback_expression;
12641076 }
12651077}
12661078
@@ -1288,75 +1100,155 @@ function removeExpression() {
12881100 $('#no_chat_expressions').show();
12891101}
12901102
1291-async function validateImages(character, forceRedrawCached) {
1103+/**
1292- if (!character) {
1104+ * Validate a character's sprites, and redraw the sprites list if not done before or forced to redraw.
1105+ * @param {string} spriteFolderName - The character sprite folder to validate
1106+ * @param {boolean} [forceRedrawCached=false] - Whether to force redrawing the sprites list even if it's already been drawn before
1107+ */
1108+async function validateImages(spriteFolderName, forceRedrawCached = false) {
1109+ if (!spriteFolderName) {
12931110 return;
12941111 }
12951112
12961113 const labels = await getExpressionsList();
12971114
12981115 if (spriteCache[characterspriteFolderName]) {
12991116 if (forceRedrawCached && $('#image_list').data('name') !== characterspriteFolderName) {
13001117 console.debug('force redrawing character sprites list');
13011118 await drawSpritesList(characterspriteFolderName, labels, spriteCache[characterspriteFolderName]);
13021119 }
13031120
13041121 return;
13051122 }
13061123
13071124 const sprites = await getSpritesList(characterspriteFolderName);
13081125 let validExpressions = await drawSpritesList(characterspriteFolderName, labels, sprites);
13091126 spriteCache[characterspriteFolderName] = validExpressions;
1127+}
1128+
1129+/**
1130+ * Takes a given sprite as returned from the server, and enriches it with additional data for display/sorting
1131+ * @param {{ path: string, label: string }} sprite
1132+ * @returns {ExpressionImage}
1133+ */
1134+function getExpressionImageData(sprite) {
1135+ const fileName = sprite.path.split('/').pop().split('?')[0];
1136+ const fileNameWithoutExtension = fileName.replace(/\.[^/.]+$/, '');
1137+ return {
1138+ expression: sprite.label,
1139+ fileName: fileName,
1140+ title: fileNameWithoutExtension,
1141+ imageSrc: sprite.path,
1142+ type: 'success',
1143+ isCustom: extension_settings.expressions.custom?.includes(sprite.label),
1144+ };
13101145}
13111146
1312-async function drawSpritesList(character, labels, sprites) {
1147+/**
1148+ * Populate the character expression list with sprites for the given character.
1149+ * @param {string} spriteFolderName - The name of the character to populate the list for
1150+ * @param {string[]} labels - An array of expression labels that are valid
1151+ * @param {Expression[]} sprites - An array of sprites
1152+ * @returns {Promise<Expression[]>} An array of valid expression labels
1153+ */
1154+async function drawSpritesList(spriteFolderName, labels, sprites) {
1155+ /** @type {Expression[]} */
13131156 let validExpressions = [];
1157+
13141158 $('#no_chat_expressions').hide();
13151159 $('#open_chat_expressions').show();
13161160 $('#image_list').empty();
13171161 $('#image_list').data('name', characterspriteFolderName);
13181162 $('#image_list_header_name').text(characterspriteFolderName);
13191163
13201164 if (!Array.isArray(labels)) {
13211165 return [];
13221166 }
13231167
13241168 for (const itemexpression of labels.sort()) {
1325- const sprite = sprites.find(x => x.label == item);
1169+ const isCustom = extension_settings.expressions.custom?.includes(expression);
1326- const isCustom = extension_settings.expressions.custom.includes(item);
1170+ const images = sprites
1327-
1171+ .filter(s => s.label === expression)
1328- if (sprite) {
1172+ .map(s => s.files)
13291173 validExpressions.pushflat(sprite);
1330- const listItem = await getListItem(item, sprite.path, 'success', isCustom);
1174+
1175+ if (images.length === 0) {
1176+ const listItem = await getListItem(expression, {
1177+ isCustom,
1178+ images: [getPlaceholderImage(expression, isCustom)],
1179+ });
13311180 $('#image_list').append(listItem);
1181+ continue;
13321182 }
1333- else {
1183+
1334- const listItem = await getListItem(item, '/img/No-Image-Placeholder.svg', 'failure', isCustom);
1184+ validExpressions.push({ label: expression, files: images });
1185+
1186+ // Render main = first file, additional = rest
1187+ let listItem = await getListItem(expression, {
1188+ isCustom,
1189+ images,
1190+ });
13351191 $('#image_list').append(listItem);
13361192 }
1337- }
13381193 return validExpressions;
13391194}
13401195
13411196/**
13421197 * Renders a list item template for the expressions list.
13431198 * @param {string} itemexpression Expression name
13441199 * @param {stringobject} imageSrc Pathargs toArguments imageobject
1345- * @param {'success' | 'failure'} textClass 'success' or 'failure'
1200+ * @param {ExpressionImage[]} [args.images] Array of image objects
13461201 * @param {boolean} [args.isCustom=false] If expression is added by user
13471202 * @returns {Promise<string>} Rendered list item template
13481203 */
13491204async function getListItem(itemexpression, imageSrc,{ textClassimages, isCustom = false } = {}) {
13501205 return renderExtensionTemplateAsync(MODULE_NAME, 'list-item', { itemexpression, imageSrcimages, textClass,isCustom: isCustom ?? false });
13511206}
13521207
1208+/**
1209+ * Fetches and processes the list of sprites for a given character name.
1210+ * Retrieves sprite data from the server and organizes it into labeled groups.
1211+ *
1212+ * @param {string} name - The character name to fetch sprites for
1213+ * @returns {Promise<Expression[]>} A promise that resolves to an array of grouped expression objects, each containing a label and associated image data
1214+ */
1215+
13531216async function getSpritesList(name) {
13541217 console.debug('getting sprites list');
13551218
13561219 try {
13571220 const result = await fetch(`/api/sprites/get?name=${encodeURIComponent(name)}`);
1221+ /** @type {{ label: string, path: string }[]} */
13581222 let sprites = result.ok ? (await result.json()) : [];
1359- return sprites;
1223+
1224+ /** @type {Expression[]} */
1225+ const grouped = sprites.reduce((acc, sprite) => {
1226+ const imageData = getExpressionImageData(sprite);
1227+ let existingExpression = acc.find(exp => exp.label === sprite.label);
1228+ if (existingExpression) {
1229+ existingExpression.files.push(imageData);
1230+ } else {
1231+ acc.push({ label: sprite.label, files: [imageData] });
1232+ }
1233+
1234+ return acc;
1235+ }, []);
1236+
1237+ // Sort the sprites for each expression alphabetically, but keep the main expression file at the front
1238+ for (const expression of grouped) {
1239+ expression.files.sort((a, b) => {
1240+ if (a.title === expression.label) return -1;
1241+ if (b.title === expression.label) return 1;
1242+ return a.title.localeCompare(b.title);
1243+ });
1244+
1245+ // Mark all besides the first sprite as 'additional'
1246+ for (let i = 1; i < expression.files.length; i++) {
1247+ expression.files[i].type = 'additional';
1248+ }
1249+ }
1250+
1251+ return grouped;
13601252 }
13611253 catch (err) {
13621254 console.log(err);
@@ -1395,17 +1287,31 @@ async function renderFallbackExpressionPicker() {
13951287 const defaultPicker = $('#expression_fallback');
13961288 defaultPicker.empty();
13971289
1398- const fallbackExpression = getFallbackExpression();
1290+
1291+ addOption(OPTION_NO_FALLBACK, '[ No fallback ]', !extension_settings.expressions.fallback_expression);
1292+ addOption(OPTION_EMOJI_FALLBACK, '[ Default emojis ]', !!extension_settings.expressions.showDefault);
13991293
14001294 for (const expression of expressions) {
1295+ addOption(expression, expression, expression == extension_settings.expressions.fallback_expression);
1296+ }
1297+
1298+ /** @type {(value: string, label: string, isSelected: boolean) => void} */
1299+ function addOption(value, label, isSelected) {
14011300 const option = document.createElement('option');
14021301 option.value = expressionvalue;
14031302 option.text = expressionlabel;
14041303 option.selected = expression == fallbackExpressionisSelected;
14051304 defaultPicker.append(option);
14061305 }
14071306}
14081307
1308+/**
1309+ * Retrieves a unique list of cached expressions.
1310+ * Combines the default expressions list with custom user-defined expressions.
1311+ *
1312+ * @returns {string[]} An array of unique expression labels
1313+ */
1314+
14091315function getCachedExpressions() {
14101316 if (!Array.isArray(expressionsList)) {
14111317 return [];
@@ -1463,7 +1369,7 @@ export async function getExpressionsList() {
14631369 }
14641370
14651371 // If there was no specific list, or an error, just return the default expressions
14661372 expressionsList = DEFAULT_EXPRESSIONS.filter(e => e !== 'talkinghead').slice();
14671373 return expressionsList;
14681374 }
14691375
@@ -1471,38 +1377,88 @@ export async function getExpressionsList() {
14711377 return [...result, ...extension_settings.expressions.custom].filter(onlyUnique);
14721378}
14731379
1474-async function setExpression(character, expression, force) {
1380+/**
1475- if (!isTalkingHeadEnabled() || !modules.includes('talkinghead')) {
1381+ * Selects a sprite from the given sprite folder for the given expression.
1476- console.debug('entered setExpressions');
1382+ *
1477- await validateImages(character);
1383+ * If multiple sprites are allowed for the expression, it will randomly select one.
1384+ * If the rerollIfSame option is enabled, it will only select a different sprite if the previous sprite was the same.
1385+ * If the overrideSpriteFile option is set, it will look for the sprite with the given file name instead of randomly selecting one.
1386+ *
1387+ * @param {string} spriteFolderName - The name of the sprite folder
1388+ * @param {string} expression - The expression to find the sprite for
1389+ * @param {object} [options] - Options to select the sprite
1390+ * @param {string} [options.prevExpressionSrc=null] - The source of the previous expression
1391+ * @param {string} [options.overrideSpriteFile=null] - The file name of the sprite to select
1392+ * @returns {ExpressionImage?} - The selected sprite
1393+ */
1394+function chooseSpriteForExpression(spriteFolderName, expression, { prevExpressionSrc = null, overrideSpriteFile = null } = {}) {
1395+ if (!spriteCache[spriteFolderName]) return null;
1396+ if (expression === RESET_SPRITE_LABEL) return null;
1397+
1398+ // Search for sprites of that expression - or fallback expression sprites if enabled
1399+ let sprite = spriteCache[spriteFolderName].find(x => x.label === expression);
1400+ if (!(sprite?.files.length > 0) && extension_settings.expressions.fallback_expression) {
1401+ sprite = spriteCache[spriteFolderName].find(x => x.label === extension_settings.expressions.fallback_expression);
1402+ console.debug('Expression', expression, 'not found. Using fallback expression', extension_settings.expressions.fallback_expression);
1403+ }
1404+ if (!(sprite?.files.length > 0)) return null;
1405+
1406+ let spriteFile = sprite.files[0];
1407+
1408+ // If a specific sprite file should be set, we are looking it up here
1409+ if (overrideSpriteFile) {
1410+ const searched = sprite.files.find(x => x.fileName === overrideSpriteFile);
1411+ if (searched) spriteFile = searched;
1412+ else toastr.warning(t`Couldn't find sprite file ${overrideSpriteFile} for expression ${expression}.`, t`Sprite Not Found`);
1413+ }
1414+ // Else calculate next expression, if multiple are allowed
1415+ else if (extension_settings.expressions.allowMultiple && sprite.files.length > 1) {
1416+ let possibleFiles = sprite.files;
1417+ if (extension_settings.expressions.rerollIfSame) {
1418+ possibleFiles = possibleFiles.filter(x => !prevExpressionSrc || x.imageSrc !== prevExpressionSrc);
1419+ }
1420+ spriteFile = possibleFiles[Math.floor(Math.random() * possibleFiles.length)];
1421+ }
1422+
1423+ return spriteFile;
1424+
1425+}
1426+
1427+/**
1428+ * Set the expression of a character.
1429+ * @param {string} spriteFolderName - The name of the character (folder name - can also be a costume override)
1430+ * @param {string} expression - The expression or sprite name to set
1431+ * @param {Object} options - Optional parameters
1432+ * @param {boolean} [options.force=false] - Whether to force the expression change even if Visual Novel mode is on
1433+ * @param {string?} [options.overrideSpriteFile=null] - Set if a specific sprite file should be used. Must be sprite file name.
1434+ * @returns {Promise<void>} A promise that resolves when the expression has been set.
1435+ */
1436+async function setExpression(spriteFolderName, expression, { force = false, overrideSpriteFile = null } = {}) {
1437+ await validateImages(spriteFolderName);
14781438 const img = $('img.expression');
14791439 const prevExpressionSrc = img.attr('src');
14801440 const expressionClone = img.clone();
14811441
1482- const sprite = (spriteCache[character] && spriteCache[character].find(x => x.label === expression));
1442+ const spriteFile = chooseSpriteForExpression(spriteFolderName, expression, { prevExpressionSrc: prevExpressionSrc, overrideSpriteFile: overrideSpriteFile });
1483- console.debug('checking for expression images to show..');
1443+ if (spriteFile) {
1484- if (sprite) {
1485- console.debug('setting expression from character images folder');
1486-
14871444 if (force && isVisualNovelMode()) {
14881445 const context = getContext();
14891446 const group = context.groups.find(x => x.id === context.groupId);
14901447
1491- for (const member of group.members) {
1448+ // If it's a folder, make sure we find the group member based on the actual name
1492- const groupMember = context.characters.find(x => x.avatar === member);
1449+ const memberName = spriteFolderName.split('/')[0] ?? spriteFolderName;
1493-
1494- if (!groupMember) {
1495- continue;
1496- }
14971450
1498- if (groupMember.name == character) {
1451+ const groupMember = group.members
1499- await setImage($(`.expression-holder[data-avatar="${member}"] img`), sprite.path);
1452+ .map(member => context.characters.find(x => x.avatar === member))
1453+ .find(groupMember => groupMember && groupMember.name === memberName);
1454+ if (groupMember) {
1455+ await setImage($(`.expression-holder[data-avatar="${groupMember.avatar}"] img`), spriteFile.imageSrc);
15001456 return;
15011457 }
15021458 }
1503- }
1459+
15041460 //only swap expressions when necessary
15051461 if (prevExpressionSrc !== spritespriteFile.pathimageSrc
15061462 && !img.hasClass('expression-animating')) {
15071463 //clone expression
15081464 expressionClone.addClass('expression-clone');
@@ -1510,7 +1466,12 @@ async function setExpression(character, expression, force) {
15101466 //must be made invisible to start because they share the same Z-index
15111467 expressionClone.attr('id', '').css({ opacity: 0 });
15121468 //add new sprite path to clone src
15131469 expressionClone.attr('src', spritespriteFile.pathimageSrc);
1470+ //set relevant data tags
1471+ expressionClone.attr('data-sprite-folder-name', spriteFolderName);
1472+ expressionClone.attr('data-expression', expression);
1473+ expressionClone.attr('data-sprite-filename', spriteFile.fileName);
1474+ expressionClone.attr('title', expression);
15141475 //add invisible clone to html
15151476 expressionClone.appendTo($('#expression-holder'));
15161477
@@ -1552,80 +1513,85 @@ async function setExpression(character, expression, force) {
15521513 expressionHolder.css('min-height', 100);
15531514 });
15541515
1555-
15561516 expressionClone.removeClass('expression-clone');
15571517
15581518 expressionClone.removeClass('default');
15591519 expressionClone.off('error');
15601520 expressionClone.on('error', function (error) {
15611521 console.debug('Expression image error', spritespriteFile.pathimageSrc, error);
15621522 $(this).attr('src', '');
15631523 $(this).off('error');
15641524 if (force && extension_settings.expressions.showDefault) {
1565- setDefault();
1525+ setDefaultEmojiForImage(img, expression);
15661526 }
15671527 });
15681528 }
1529+
1530+ console.info('Expression set', { expression: spriteFile.expression, file: spriteFile.fileName });
15691531 }
15701532 else {
1571- if (extension_settings.expressions.showDefault) {
1533+ img.attr('data-sprite-folder-name', spriteFolderName);
1572- setDefault();
1573- }
1574- }
15751534
1576- function setDefault() {
1535+ img.off('error');
1577- console.debug('setting default');
1578- const defImgUrl = `/img/default-expressions/${expression}.png`;
1579- //console.log(defImgUrl);
1580- img.attr('src', defImgUrl);
1581- img.addClass('default');
1582- }
1583- document.getElementById('expression-holder').style.display = '';
15841536
1537+ if (extension_settings.expressions.showDefault && expression !== RESET_SPRITE_LABEL) {
1538+ setDefaultEmojiForImage(img, expression);
15851539 } else {
1586- // Set the Talkinghead emotion to the specified expression
1540+ setNoneForImage(img, expression);
1587- // TODO: For now, Talkinghead emote only supported when VN mode is off; see also updateVisualNovelMode.
1588- try {
1589- let result = await isTalkingHeadAvailable();
1590- if (result) {
1591- const url = new URL(getApiUrl());
1592- url.pathname = '/api/talkinghead/set_emotion';
1593- await doExtrasFetch(url, {
1594- method: 'POST',
1595- headers: {
1596- 'Content-Type': 'application/json',
1597- },
1598- body: JSON.stringify({ emotion_name: expression }),
1599- });
1600- }
16011541 }
1602- catch (error) {
1542+ console.debug('Expression unset - No sprite found', { expression: expression });
1603- // `set_emotion` is not present in old versions, so let it 404.
16041543 }
16051544
1606- try {
1545+ document.getElementById('expression-holder').style.display = '';
1607- // Find the <img> element with id="expression-image" and class="expression"
1608- const imgElement = document.querySelector('img#expression-image.expression');
1609- //console.log("searching");
1610- if (imgElement && imgElement instanceof HTMLImageElement) {
1611- //console.log("setting value");
1612- imgElement.src = getApiUrl() + '/api/talkinghead/result_feed';
1613- }
16141546}
1615- catch (error) {
1547+
1616- //console.log("The fetch failed!");
1548+/**
1549+ * Sets the default expression image for the given image element and expression
1550+ * @param {JQuery<HTMLElement>} img - The image element to set the default expression for
1551+ * @param {string} expression - The expression label to use for the default image
1552+ */
1553+function setDefaultEmojiForImage(img, expression) {
1554+ if (extension_settings.expressions.custom?.includes(expression)) {
1555+ console.debug(`Can't set default emoji for a custom expression (${expression}). setting to ${DEFAULT_FALLBACK_EXPRESSION} instead.`);
1556+ expression = DEFAULT_FALLBACK_EXPRESSION;
16171557 }
1558+
1559+ const defImgUrl = `/img/default-expressions/${expression}.png`;
1560+ img.attr('src', defImgUrl);
1561+ img.attr('data-expression', expression);
1562+ img.attr('data-sprite-filename', null);
1563+ img.attr('title', expression);
1564+ img.addClass('default');
16181565}
1566+
1567+/**
1568+ * Sets the image element to display no expression by clearing its source attribute.
1569+ * @param {JQuery<HTMLElement>} img - The image element to clear the expression for
1570+ * @param {string} expression - The expression label to use
1571+ */
1572+function setNoneForImage(img, expression) {
1573+ img.attr('src', '');
1574+ img.attr('data-expression', expression);
1575+ img.attr('data-sprite-filename', null);
1576+ img.attr('title', expression);
1577+ img.removeClass('default');
16191578}
16201579
16211580function onClickExpressionImage() {
1622- const expression = $(this).attr('id');
1581+ // If there is no expression image and we clicked on the placeholder, we remove the sprite by calling via the expression label
1623- setSpriteSlashCommand({}, expression);
1582+ if ($(this).attr('data-expression-type') === 'failure') {
1583+ const label = $(this).attr('data-expression');
1584+ setSpriteSlashCommand({ type: 'expression' }, label);
1585+ return;
1586+ }
1587+
1588+ const spriteFile = $(this).attr('data-filename');
1589+ setSpriteSlashCommand({ type: 'sprite' }, spriteFile);
16241590}
16251591
16261592async function onClickExpressionAddCustom() {
16271593 const template = await renderExtensionTemplateAsync(MODULE_NAME, 'add-custom-expression');
16281594 let expressionName = await callPopupPopup.show.input(templatenull, 'input'template);
16291595
16301596 if (!expressionName) {
16311597 console.debug('No custom expression name provided');
@@ -1636,19 +1602,15 @@ async function onClickExpressionAddCustom() {
16361602
16371603 // a-z, 0-9, dashes and underscores only
16381604 if (!/^[a-z0-9-_]+$/.test(expressionName)) {
16391605 toastr.infowarning('Invalid custom expression name provided', 'Add Custom Expression');
16401606 return;
16411607 }
1642-
1608+ if (DEFAULT_EXPRESSIONS.includes(expressionName) || DEFAULT_EXPRESSIONS.some(x => expressionName.startsWith(x))) {
1643- // Check if expression name already exists in default expressions
1609+ toastr.warning('Expression name already exists', 'Add Custom Expression');
1644- if (DEFAULT_EXPRESSIONS.includes(expressionName)) {
1645- toastr.info('Expression name already exists');
16461610 return;
16471611 }
1648-
1649- // Check if expression name already exists in custom expressions
16501612 if (extension_settings.expressions.custom.includes(expressionName)) {
16511613 toastr.infowarning('Custom expression already exists', 'Add Custom Expression');
16521614 return;
16531615 }
16541616
@@ -1665,14 +1627,15 @@ async function onClickExpressionAddCustom() {
16651627
16661628async function onClickExpressionRemoveCustom() {
16671629 const selectedExpression = String($('#expression_custom').val());
1630+ const noCustomExpressions = extension_settings.expressions.custom.length === 0;
16681631
16691632 if (!selectedExpression || noCustomExpressions) {
16701633 console.debug('No custom expression selected');
16711634 return;
16721635 }
16731636
16741637 const template = await renderExtensionTemplateAsync(MODULE_NAME, 'remove-custom-expression', { expression: selectedExpression });
16751638 const confirmation = await callPopupPopup.show.confirm(templatenull, 'confirm'template);
16761639
16771640 if (!confirmation) {
16781641 console.debug('Custom expression removal cancelled');
@@ -1682,8 +1645,8 @@ async function onClickExpressionRemoveCustom() {
16821645 // Remove custom expression from settings
16831646 const index = extension_settings.expressions.custom.indexOf(selectedExpression);
16841647 extension_settings.expressions.custom.splice(index, 1);
16851648 if (selectedExpression == getFallbackExpression()extension_settings.expressions.fallback_expression) {
16861649 toastr.warning(`Deleted custom expression '${selectedExpression}' that was also selected as the fallback expression.\nFallback expression has been reset to '${DEFAULT_FALLBACK_EXPRESSION}'.`, 'Remove Custom Expression');
16871650 extension_settings.expressions.fallback_expression = DEFAULT_FALLBACK_EXPRESSION;
16881651 }
16891652 await renderAdditionalExpressionSettings();
@@ -1707,12 +1670,35 @@ function onExpressionApiChanged() {
17071670 }
17081671}
17091672
17101673async function onExpressionFallbackChanged() {
1711- const expression = this.value;
1674+ /** @type {HTMLSelectElement} */
1712- if (expression) {
1675+ const select = this;
1713- extension_settings.expressions.fallback_expression = expression;
1676+ const selectedValue = select.value;
1714- saveSettingsDebounced();
1677+
1678+ switch (selectedValue) {
1679+ case OPTION_NO_FALLBACK:
1680+ extension_settings.expressions.fallback_expression = null;
1681+ extension_settings.expressions.showDefault = false;
1682+ break;
1683+ case OPTION_EMOJI_FALLBACK:
1684+ extension_settings.expressions.fallback_expression = null;
1685+ extension_settings.expressions.showDefault = true;
1686+ break;
1687+ default:
1688+ extension_settings.expressions.fallback_expression = selectedValue;
1689+ extension_settings.expressions.showDefault = false;
1690+ break;
1691+ }
1692+
1693+ const img = $('img.expression');
1694+ const spriteFolderName = img.attr('data-sprite-folder-name');
1695+ const expression = img.attr('data-expression');
1696+
1697+ if (spriteFolderName && expression) {
1698+ await sendExpressionCall(spriteFolderName, expression, { force: true });
17151699 }
1700+
1701+ saveSettingsDebounced();
17161702}
17171703
17181704async function handleFileUpload(url, formData) {
@@ -1739,34 +1725,111 @@ async function handleFileUpload(url, formData) {
17391725 }
17401726}
17411727
1728+/**
1729+ * Removes the file extension from a file name
1730+ * @param {string} fileName The file name to remove the extension from
1731+ * @returns {string} The file name without the extension
1732+ */
1733+function withoutExtension(fileName) {
1734+ return fileName.replace(/\.[^/.]+$/, '');
1735+}
1736+
1737+function validateExpressionSpriteName(expression, spriteName) {
1738+ const filenameValidationRegex = new RegExp(`^${expression}(?:[-\\.].*?)?$`);
1739+ const validFileName = filenameValidationRegex.test(spriteName);
1740+ return validFileName;
1741+}
1742+
17421743async function onClickExpressionUpload(event) {
17431744 // Prevents the expression from being set
17441745 event.stopPropagation();
17451746
17461747 const idexpressionListItem = $(this).closest('.expression_list_item').attr('id');
1748+
1749+ const clickedFileName = expressionListItem.attr('data-expression-type') !== 'failure' ? expressionListItem.attr('data-filename') : null;
1750+ const expression = expressionListItem.data('expression');
17471751 const name = $('#image_list').data('name');
17481752
17491753 const handleExpressionUploadChange = async (e) => {
17501754 const file = e.target.files[0];
17511755
17521756 if (!file || !file.name) {
1757+ console.debug('No valid file selected');
1758+ return;
1759+ }
1760+
1761+ const existingFiles = spriteCache[name]?.find(x => x.label === expression)?.files || [];
1762+
1763+ let spriteName = expression;
1764+
1765+ if (extension_settings.expressions.allowMultiple) {
1766+ const matchesExisting = existingFiles.some(x => x.fileName === file.name);
1767+ const fileNameWithoutExtension = withoutExtension(file.name);
1768+ const validFileName = validateExpressionSpriteName(expression, fileNameWithoutExtension);
1769+
1770+ // If there is no expression yet and it's a valid expression, we just take it
1771+ if (!clickedFileName && validFileName) {
1772+ spriteName = fileNameWithoutExtension;
1773+ }
1774+ // If the filename matches the one that was clicked, we just take it and replace it
1775+ else if (clickedFileName === file.name) {
1776+ spriteName = fileNameWithoutExtension;
1777+ }
1778+ // If it's a valid filename and there's no existing file with the same name, we just take it
1779+ else if (!matchesExisting && validFileName) {
1780+ spriteName = fileNameWithoutExtension;
1781+ }
1782+ else {
1783+ /** @type {import('../../popup.js').CustomPopupButton[]} */
1784+ const customButtons = [];
1785+ if (clickedFileName) {
1786+ customButtons.push({
1787+ text: t`Replace Existing`,
1788+ result: POPUP_RESULT.NEGATIVE,
1789+ action: () => {
1790+ console.debug('Replacing existing sprite');
1791+ spriteName = withoutExtension(clickedFileName);
1792+ },
1793+ });
1794+ }
1795+
1796+ spriteName = null;
1797+ const suggestedSpriteName = generateUniqueSpriteName(expression, existingFiles);
1798+
1799+ const message = await renderExtensionTemplateAsync(MODULE_NAME, 'templates/upload-expression', { expression, clickedFileName });
1800+
1801+ const input = await Popup.show.input(t`Upload Expression Sprite`, message,
1802+ suggestedSpriteName, { customButtons: customButtons });
1803+
1804+ if (input) {
1805+ if (!validateExpressionSpriteName(expression, input)) {
1806+ toastr.warning(t`The name you entered does not follow the naming schema for the selected expression '${expression}'.`, t`Invalid Expression Sprite Name`);
1807+ return;
1808+ }
1809+ spriteName = input;
1810+ }
1811+ }
1812+ } else {
1813+ spriteName = withoutExtension(clickedFileName);
1814+ }
1815+
1816+ if (!spriteName) {
1817+ toastr.warning(t`Cancelled uploading sprite.`, t`Upload Cancelled`);
1818+ // Reset the input
1819+ e.target.form.reset();
17531820 return;
17541821 }
17551822
17561823 const formData = new FormData();
17571824 formData.append('name', name);
17581825 formData.append('label', idexpression);
17591826 formData.append('avatar', file);
1827+ formData.append('spriteName', spriteName);
17601828
17611829 await handleFileUpload('/api/sprites/upload', formData);
17621830
17631831 // Reset the input
17641832 e.target.form.reset();
1765-
1766- // In Talkinghead mode, when a new talkinghead image is uploaded, refresh the live char.
1767- if (id === 'talkinghead' && isTalkingHeadEnabled() && modules.includes('talkinghead')) {
1768- await loadTalkingHead();
1769- }
17701833 };
17711834
17721835 $('#expression_upload')
@@ -1822,8 +1885,9 @@ async function onClickExpressionOverrideButton() {
18221885 inApiCall = true;
18231886 $('#visual-novel-wrapper').empty();
18241887 await validateImages(overridePath.length === 0 ? currentLastMessage.name : overridePath, true);
1888+ const name = overridePath.length === 0 ? currentLastMessage.name : overridePath;
18251889 const expression = await getExpressionLabel(currentLastMessage.mes);
18261890 await sendExpressionCall(overridePath.length === 0 ? currentLastMessage.name : overridePath, expression, { force: true });
18271891 forceUpdateVisualNovelMode();
18281892 } catch (error) {
18291893 console.debug(`Setting expression override for ${avatarFileName} failed with error: ${error}`);
@@ -1849,7 +1913,7 @@ async function onClickExpressionOverrideRemoveAllButton() {
18491913 const currentLastMessage = getLastCharacterMessage();
18501914 await validateImages(currentLastMessage.name, true);
18511915 const expression = await getExpressionLabel(currentLastMessage.mes);
18521916 await sendExpressionCall(currentLastMessage.name, expression, { force: true });
18531917 forceUpdateVisualNovelMode();
18541918
18551919 console.debug(extension_settings.expressionOverrides);
@@ -1872,16 +1936,13 @@ async function onClickExpressionUploadPackButton() {
18721936 formData.append('name', name);
18731937 formData.append('avatar', file);
18741938
1939+ const uploadToast = toastr.info('Please wait...', 'Upload is processing', { timeOut: 0, extendedTimeOut: 0 });
18751940 const { count } = await handleFileUpload('/api/sprites/upload-zip', formData);
1941+ toastr.clear(uploadToast);
18761942 toastr.success(`Uploaded ${count} image(s) for ${name}`);
18771943
18781944 // Reset the input
18791945 e.target.form.reset();
1880-
1881- // In Talkinghead mode, refresh the live char.
1882- if (isTalkingHeadEnabled() && modules.includes('talkinghead')) {
1883- await loadTalkingHead();
1884- }
18851946 };
18861947
18871948 $('#expression_upload_pack')
@@ -1894,20 +1955,28 @@ async function onClickExpressionDelete(event) {
18941955 // Prevents the expression from being set
18951956 event.stopPropagation();
18961957
1897- const confirmation = await callPopup('<h3>Are you sure?</h3>Once deleted, it\'s gone forever!', 'confirm');
1958+ const expressionListItem = $(this).closest('.expression_list_item');
1959+ const expression = expressionListItem.data('expression');
1960+
1961+ if (expressionListItem.attr('data-expression-type') === 'failure') {
1962+ return;
1963+ }
18981964
1965+ const confirmation = await Popup.show.confirm(t`Delete Expression`, t`Are you sure you want to delete this expression? Once deleted, it\'s gone forever!`
1966+ + '<br /><br />'
1967+ + t`Expression:` + ' <tt>' + expressionListItem.attr('data-filename') + '</tt>');
18991968 if (!confirmation) {
19001969 return;
19011970 }
19021971
19031972 const idfileName = $(this).closestwithoutExtension('.expression_list_item')expressionListItem.attr('iddata-filename'));
19041973 const name = $('#image_list').data('name');
19051974
19061975 try {
19071976 await fetch('/api/sprites/delete', {
19081977 method: 'POST',
19091978 headers: getRequestHeaders(),
19101979 body: JSON.stringify({ name, label: idexpression, spriteName: fileName }),
19111980 });
19121981 } catch (error) {
19131982 toastr.error('Failed to delete image. Try again later.');
@@ -1984,6 +2053,16 @@ function migrateSettings() {
19842053 extension_settings.expressions.llmPrompt = DEFAULT_LLM_PROMPT;
19852054 saveSettingsDebounced();
19862055 }
2056+
2057+ if (extension_settings.expressions.allowMultiple === undefined) {
2058+ extension_settings.expressions.allowMultiple = true;
2059+ saveSettingsDebounced();
2060+ }
2061+
2062+ if (extension_settings.expressions.showDefault && extension_settings.expressions.fallback_expression !== undefined) {
2063+ extension_settings.expressions.showDefault = false;
2064+ saveSettingsDebounced();
2065+ }
19872066}
19882067
19892068(async function () {
@@ -2010,13 +2089,19 @@ function migrateSettings() {
20102089 const template = await renderExtensionTemplateAsync(MODULE_NAME, 'settings');
20112090 $('#expressions_container').append(template);
20122091 $('#expression_override_button').on('click', onClickExpressionOverrideButton);
2013- $('#expressions_show_default').on('input', onExpressionsShowDefaultInput);
20142092 $('#expression_upload_pack_button').on('click', onClickExpressionUploadPackButton);
2015- $('#expressions_show_default').prop('checked', extension_settings.expressions.showDefault).trigger('input');
20162093 $('#expression_translate').prop('checked', extension_settings.expressions.translate).on('input', function () {
20172094 extension_settings.expressions.translate = !!$(this).prop('checked');
20182095 saveSettingsDebounced();
20192096 });
2097+ $('#expressions_allow_multiple').prop('checked', extension_settings.expressions.allowMultiple).on('input', function () {
2098+ extension_settings.expressions.allowMultiple = !!$(this).prop('checked');
2099+ saveSettingsDebounced();
2100+ });
2101+ $('#expressions_reroll_if_same').prop('checked', extension_settings.expressions.rerollIfSame).on('input', function () {
2102+ extension_settings.expressions.rerollIfSame = !!$(this).prop('checked');
2103+ saveSettingsDebounced();
2104+ });
20202105 $('#expression_override_cleanup_button').on('click', onClickExpressionOverrideRemoveAllButton);
20212106 $(document).on('dragstart', '.expression', (e) => {
20222107 e.preventDefault();
@@ -2025,21 +2110,15 @@ function migrateSettings() {
20252110 $(document).on('click', '.expression_list_item', onClickExpressionImage);
20262111 $(document).on('click', '.expression_list_upload', onClickExpressionUpload);
20272112 $(document).on('click', '.expression_list_delete', onClickExpressionDelete);
20282113 $(window).on('resize', () => updateVisualNovelModeDebounced());
20292114 $('#open_chat_expressions').hide();
20302115
2031- $('#image_type_toggle').on('click', function () {
2032- if (this instanceof HTMLInputElement) {
2033- setTalkingHeadState(this.checked);
2034- }
2035- });
2036-
20372116 await renderAdditionalExpressionSettings();
20382117 $('#expression_api').val(extension_settings.expressions.api ?? EXPRESSION_API.extras);
20392118 $('.expression_llm_prompt_block').toggle([EXPRESSION_API.llm, EXPRESSION_API.webllm].includes(extension_settings.expressions.api));
20402119 $('#expression_llm_prompt').val(extension_settings.expressions.llmPrompt ?? '');
20412120 $('#expression_llm_prompt').on('input', function () {
20422121 extension_settings.expressions.llmPrompt = String($(this).val());
20432122 saveSettingsDebounced();
20442123 });
20452124 $('#expression_llm_prompt_restore').on('click', function () {
@@ -2054,34 +2133,6 @@ function migrateSettings() {
20542133 $('#expression_api').on('change', onExpressionApiChanged);
20552134 }
20562135
2057- // Pause Talkinghead to save resources when the ST tab is not visible or the window is minimized.
2058- // We currently do this via loading/unloading. Could be improved by adding new pause/unpause endpoints to Extras.
2059- document.addEventListener('visibilitychange', function (event) {
2060- let pageIsVisible;
2061- if (document.hidden) {
2062- console.debug('expressions: SillyTavern is now hidden');
2063- pageIsVisible = false;
2064- } else {
2065- console.debug('expressions: SillyTavern is now visible');
2066- pageIsVisible = true;
2067- }
2068-
2069- if (isTalkingHeadEnabled() && modules.includes('talkinghead')) {
2070- isTalkingHeadAvailable().then(result => {
2071- if (result) {
2072- if (pageIsVisible) {
2073- loadTalkingHead();
2074- } else {
2075- unloadTalkingHead();
2076- }
2077- handleImageChange(); // Change image as needed
2078- } else {
2079- //console.log("talkinghead does not exist.");
2080- }
2081- });
2082- }
2083- });
2084-
20852136 addExpressionImage();
20862137 addVisualNovelMode();
20872138 migrateSettings();
@@ -2090,11 +2141,6 @@ function migrateSettings() {
20902141 const updateFunction = wrapper.update.bind(wrapper);
20912142 setInterval(updateFunction, UPDATE_INTERVAL);
20922143 moduleWorker();
2093- // For setting the Talkinghead talking animation on/off quickly enough for realtime use, we need another timer on a shorter schedule.
2094- const wrapperTalkingState = new ModuleWorkerWrapper(updateTalkingState);
2095- const updateTalkingStateFunction = wrapperTalkingState.update.bind(wrapperTalkingState);
2096- setInterval(updateTalkingStateFunction, TALKINGCHECK_UPDATE_INTERVAL);
2097- updateTalkingState();
20982144 dragElement($('#expression-holder'));
20992145 eventSource.on(event_types.CHAT_CHANGED, () => {
21002146 // character changed
@@ -2108,110 +2154,137 @@ function migrateSettings() {
21082154 imgElement.src = '';
21092155 }
21102156
2111- //set checkbox to global var
2112- $('#image_type_toggle').prop('checked', extension_settings.expressions.talkinghead);
2113- if (extension_settings.expressions.talkinghead) {
2114- setTalkingHeadState(extension_settings.expressions.talkinghead);
2115- }
2116-
21172157 setExpressionOverrideHtml();
21182158
21192159 if (isVisualNovelMode()) {
21202160 $('#visual-novel-wrapper').empty();
21212161 }
21222162
21232163 updateFunction({ newChat: true });
21242164 });
21252165 eventSource.on(event_types.MOVABLE_PANELS_RESET, updateVisualNovelModeDebounced);
21262166 eventSource.on(event_types.GROUP_UPDATED, updateVisualNovelModeDebounced);
2127- eventSource.on(event_types.EXTRAS_CONNECTED, () => {
2128- if (extension_settings.expressions.talkinghead) {
2129- setTalkingHeadState(extension_settings.expressions.talkinghead);
2130- }
2131- });
21322167
21332168 const localEnumProviders = {
21342169 expressions: () => getCachedExpressions().map(expression => {
2170+ const currentLastMessage = selected_group ? getLastCharacterMessage() : null;
2171+ const spriteFolderName = getSpriteFolderName(currentLastMessage, currentLastMessage?.name);
2172+ const expressions = getCachedExpressions();
2173+ return expressions.map(expression => {
2174+ const spriteCount = spriteCache[spriteFolderName]?.find(x => x.label === expression)?.files.length ?? 0;
21352175 const isCustom = extension_settings.expressions.custom?.includes(expression);
2136- return new SlashCommandEnumValue(expression, null, isCustom ? enumTypes.name : enumTypes.enum, isCustom ? 'C' : 'D');
2176+ const subtitle = spriteCount == 0 ? '❌ No sprites available for this expression' :
2137- }),
2177+ spriteCount > 1 ? `${spriteCount} sprites` : null;
2178+ return new SlashCommandEnumValue(expression,
2179+ subtitle,
2180+ isCustom ? enumTypes.name : enumTypes.enum,
2181+ isCustom ? 'C' : 'D');
2182+ });
2183+ },
2184+ sprites: () => {
2185+ const currentLastMessage = selected_group ? getLastCharacterMessage() : null;
2186+ const spriteFolderName = getSpriteFolderName(currentLastMessage, currentLastMessage?.name);
2187+ const sprites = spriteCache[spriteFolderName]?.map(x => x.files)?.flat() ?? [];
2188+ return sprites.map(x => {
2189+ return new SlashCommandEnumValue(x.title,
2190+ x.title !== x.expression ? x.expression : null,
2191+ x.isCustom ? enumTypes.name : enumTypes.enum,
2192+ x.isCustom ? 'C' : 'D');
2193+ });
2194+ },
21382195 };
21392196
21402197 SlashCommandParser.addCommandObject(SlashCommand.fromProps({
21412198 name: 'spriteexpression-set',
21422199 aliases: ['sprite', 'emote'],
21432200 callback: setSpriteSlashCommand,
2201+ namedArgumentList: [
2202+ SlashCommandNamedArgument.fromProps({
2203+ name: 'type',
2204+ description: 'Whether to set an expression or a specific sprite.',
2205+ typeList: [ARGUMENT_TYPE.STRING],
2206+ isRequired: false,
2207+ defaultValue: 'expression',
2208+ enumList: ['expression', 'sprite'],
2209+ }),
2210+ ],
21442211 unnamedArgumentList: [
21452212 SlashCommandArgument.fromProps({
21462213 description: 'spriteIdexpression label to set',
21472214 typeList: [ARGUMENT_TYPE.STRING],
21482215 isRequired: true,
2149- enumProvider: localEnumProviders.expressions,
2216+ enumProvider: (executor, _) => {
2217+ // Check if command is used to set a sprite, then use those enums
2218+ const type = executor.namedArgumentList.find(it => it.name == 'type')?.value || 'expression';
2219+ if (type == 'sprite') return localEnumProviders.sprites();
2220+ else return [
2221+ ...localEnumProviders.expressions(),
2222+ new SlashCommandEnumValue(RESET_SPRITE_LABEL, 'Resets the expression (to either default or no sprite)', enumTypes.enum, '❌'),
2223+ ];
2224+ },
21502225 }),
21512226 ],
21522227 helpString: 'Force sets the spriteexpression for the current character.',
21532228 returns: 'theThe currently set spriteexpression label after setting it.',
21542229 }));
21552230 SlashCommandParser.addCommandObject(SlashCommand.fromProps({
21562231 name: 'spriteoverrideexpression-folder-override',
21572232 aliases: ['spriteoverride', 'costume'],
21582233 callback: setSpriteSetCommandsetSpriteFolderCommand,
21592234 unnamedArgumentList: [
21602235 new SlashCommandArgument(
21612236 'optional folder', [ARGUMENT_TYPE.STRING], false,
21622237 ),
21632238 ],
2164- helpString: 'Sets an override sprite folder for the current character. If the name starts with a slash or a backslash, selects a sub-folder in the character-named folder. Empty value to reset to default.',
2239+ helpString: `
2240+ <div>
2241+ Sets an override sprite folder for the current character.<br />
2242+ In groups, this will apply to the character who last sent a message.
2243+ </div>
2244+ <div>
2245+ If the name starts with a slash or a backslash, selects a sub-folder in the character-named folder. Empty value to reset to default.
2246+ </div>
2247+ `,
21652248 }));
21662249 SlashCommandParser.addCommandObject(SlashCommand.fromProps({
21672250 name: 'lastspriteexpression-last',
2168- callback: (_, name) => {
2251+ aliases: ['lastsprite'],
2252+ /** @type {(args: object, name: string) => Promise<string>} */
2253+ callback: async (_, name) => {
21692254 if (typeof name !== 'string') throw new Error('name must be a string');
2255+ if (!name) {
2256+ if (selected_group) {
2257+ toastr.error(t`In group chats, you must specify a character name.`, t`No character name specified`);
2258+ return '';
2259+ }
2260+ name = characters[this_chid]?.avatar;
2261+ }
2262+
21702263 const char = findChar({ name: name });
2264+ if (!char) toastr.warning(t`Couldn't find character ${name}.`, t`Character not found`);
2265+
21712266 const sprite = lastExpression[char?.name ?? name] ?? '';
21722267 return sprite;
21732268 },
21742269 returns: 'the last set sprite / expression for the named character.',
21752270 unnamedArgumentList: [
21762271 SlashCommandArgument.fromProps({
21772272 description: 'Character name - or unique character identifier (avatar key). If not provided, the current character for this chat will be used (does not work in group chats)',
21782273 typeList: [ARGUMENT_TYPE.STRING],
2179- isRequired: true,
21802274 enumProvider: commonEnumProviders.characters('character'),
21812275 }),
21822276 ],
21832277 helpString: 'Returns the last set sprite / expression for the named character.',
2184- }));
2185- SlashCommandParser.addCommandObject(SlashCommand.fromProps({
2186- name: 'th',
2187- callback: toggleTalkingHeadCommand,
2188- aliases: ['talkinghead'],
2189- helpString: 'Character Expressions: toggles <i>Image Type - talkinghead (extras)</i> on/off.',
2190- returns: 'the current state of the <i>Image Type - talkinghead (extras)</i> on/off.',
21912278 }));
21922279 SlashCommandParser.addCommandObject(SlashCommand.fromProps({
21932280 name: 'classifyexpression-expressionslist',
21942281 aliases: ['expressions'],
2282+ /** @type {(args: {return: string}) => Promise<string>} */
21952283 callback: async (args) => {
2284+ let returnType =
21962285 /** @type {import('../../slash-commands/SlashCommandReturnHelper.js').SlashCommandReturnType} */
2197- // @ts-ignore
2286+ (args.return);
2198- let returnType = args.return;
2199-
2200- // Old legacy return type handling
2201- if (args.format) {
2202- toastr.warning(`Legacy argument 'format' with value '${args.format}' is deprecated. Please use 'return' instead. Routing to the correct return type...`, 'Deprecation warning');
2203- const type = String(args?.format).toLowerCase().trim();
2204- switch (type) {
2205- case 'json':
2206- returnType = 'object';
2207- break;
2208- default:
2209- returnType = 'pipe';
2210- break;
2211- }
2212- }
22132287
2214- // Now the actual new return type handling
22152288 const list = await getExpressionsList();
22162289
22172290 return await slashCommandReturnHelper.doReturn(returnType ?? 'pipe', list, { objectToStringFunc: list => list.join(', ') });
@@ -2225,22 +2298,13 @@ function migrateSettings() {
22252298 enumList: slashCommandReturnHelper.enumList({ allowObject: true }),
22262299 forceEnum: true,
22272300 }),
2228- // TODO remove some day
2229- SlashCommandNamedArgument.fromProps({
2230- name: 'format',
2231- description: '!!! DEPRECATED - use "return" instead !!! The format to return the list in: comma-separated plain text or JSON array. Default is plain text.',
2232- typeList: [ARGUMENT_TYPE.STRING],
2233- enumList: [
2234- new SlashCommandEnumValue('plain', null, enumTypes.enum, ', '),
2235- new SlashCommandEnumValue('json', null, enumTypes.enum, '[]'),
2236- ],
2237- }),
22382301 ],
22392302 returns: 'The comma-separated list of available expressions, including custom expressions.',
22402303 helpString: 'Returns a list of available expressions, including custom expressions.',
22412304 }));
22422305 SlashCommandParser.addCommandObject(SlashCommand.fromProps({
22432306 name: 'expression-classify',
2307+ aliases: ['classify'],
22442308 callback: classifyCallback,
22452309 namedArgumentList: [
22462310 SlashCommandNamedArgument.fromProps({
@@ -2279,11 +2343,13 @@ function migrateSettings() {
22792343 `,
22802344 }));
22812345 SlashCommandParser.addCommandObject(SlashCommand.fromProps({
22822346 name: 'uploadspriteexpression-upload',
2347+ aliases: ['uploadsprite'],
2348+ /** @type {(args: {name: string, label: string, folder: string?, spriteName: string?}, url: string) => Promise<string>} */
22832349 callback: async (args, url) => {
22842350 return await uploadSpriteCommand(args, url);
2285- return '';
22862351 },
2352+ returns: 'the resulting sprite name',
22872353 unnamedArgumentList: [
22882354 SlashCommandArgument.fromProps({
22892355 description: 'URL of the image to upload',
@@ -2297,7 +2363,6 @@ function migrateSettings() {
22972363 description: 'Character name or avatar key (default is current character)',
22982364 typeList: [ARGUMENT_TYPE.STRING],
22992365 isRequired: false,
2300- acceptsMultiple: false,
23012366 }),
23022367 SlashCommandNamedArgument.fromProps({
23032368 name: 'label',
@@ -2305,16 +2370,32 @@ function migrateSettings() {
23052370 typeList: [ARGUMENT_TYPE.STRING],
23062371 enumProvider: localEnumProviders.expressions,
23072372 isRequired: true,
2308- acceptsMultiple: false,
23092373 }),
23102374 SlashCommandNamedArgument.fromProps({
23112375 name: 'folder',
23122376 description: 'Override folder to upload into',
23132377 typeList: [ARGUMENT_TYPE.STRING],
23142378 isRequired: false,
2315- acceptsMultiple: false,
2379+ }),
2380+ SlashCommandNamedArgument.fromProps({
2381+ name: 'spriteName',
2382+ description: 'Override sprite name to allow multiple sprites per expressions. Has to follow the naming pattern. If unspecified, the label will be used as sprite name.',
2383+ typeList: [ARGUMENT_TYPE.STRING],
2384+ isRequired: false,
23162385 }),
23172386 ],
2318- helpString: '<div>Upload a sprite from a URL.</div><div>Example:</div><pre><code>/uploadsprite name=Seraphina label=joy /user/images/Seraphina/Seraphina_2024-12-22@12h37m57s.png</code></pre>',
2387+ helpString: `
2388+ <div>
2389+ Upload a sprite from a URL.
2390+ </div>
2391+ <div>
2392+ <strong>Example:</strong>
2393+ <ul>
2394+ <li>
2395+ <pre><code>/uploadsprite name=Seraphina label=joy /user/images/Seraphina/Seraphina_2024-12-22@12h37m57s.png</code></pre>
2396+ </li>
2397+ </ul>
2398+ </div>
2399+ `,
23192400 }));
23202401})();
public/scripts/extensions/expressions/list-item.html+9 -5
@@ -1,4 +1,5 @@
1-<div id="{{item}}" class="expression_list_item">
1+{{#each images}}
2+<div class="expression_list_item interactable" data-expression="{{../expression}}" data-expression-type="{{this.type}}" data-filename="{{this.fileName}}">
23 <div class="expression_list_buttons">
34 <div class="menu_button expression_list_upload" title="Upload image">
45 <i class="fa-solid fa-upload"></i>
@@ -7,11 +8,14 @@
78 <i class="fa-solid fa-trash"></i>
89 </div>
910 </div>
1011 <div class="expression_list_title {{textClass}}">
1112 <span>{{item../expression}}</span>
1213 {{#if ../isCustom}}
1314 <small class="expression_list_custom">(custom)</small>
1415 {{/if}}
1516 </div>
1617 <imgdiv class="expression_list_imageexpression_list_image_container" srctitle="{{imageSrcthis.title}}" />
18+ <img class="expression_list_image" src="{{this.imageSrc}}" alt="{{this.title}}" data-epression="{{../expression}}" />
1719 </div>
20+</div>
21+{{/each}}
public/scripts/extensions/expressions/settings.html+21 -9
@@ -6,17 +6,17 @@
66 </div>
77
88 <div class="inline-drawer-content">
99 <label class="checkbox_label" for="expression_translate" title="Use the selected API from Chat Translation extension settings." data-i18n="[title]Use the selected API from Chat Translation extension settings.">
1010 <input id="expression_translate" type="checkbox">
1111 <span data-i18n="Translate text to English before classification">Translate text to English before classification</span>
1212 </label>
13- <label class="checkbox_label" for="expressions_show_default">
13+ <label class="checkbox_label" for="expressions_allow_multiple" title="A single expression can have multiple sprites. Whenever the expression is chosen, a random sprite for this expression will be selected." data-i18n="[title]A single expression can have multiple sprites. Whenever the expression is chosen, a random sprite for this expression will be selected.">
1414 <input id="expressions_show_defaultexpressions_allow_multiple" type="checkbox">
1515 <span data-i18n="Show default imagesAllow (emojis)multiple ifsprites spriteper missingexpression">Show default imagesAllow (emojis)multiple ifsprites spriteper missingexpression</span>
1616 </label>
17- <label id="image_type_block" class="checkbox_label" for="image_type_toggle">
17+ <label class="checkbox_label" for="expressions_reroll_if_same" title="If the same expression is used again, re-roll the sprite. This only applies to expressions that have multiple available sprites assigned." data-i18n="[title]If the same expression is used again, re-roll the sprite. This only applies to expressions that have multiple available sprites assigned.">
1818 <input id="image_type_toggleexpressions_reroll_if_same" type="checkbox">
1919 <span data-i18n="ImageRe-roll Typeif -same talkingheadexpression (extras)is used again">ImageRe-roll Typeif -same talkingheadsprite (extras)is used again</span>
2020 </label>
2121 <div class="expression_api_block m-b-1 m-t-1">
2222 <label for="expression_api" data-i18n="Classifier API">Classifier API</label>
@@ -75,8 +75,20 @@
7575 <span data-i18n="Remove all image overrides">Remove all image overrides</span>
7676 </div>
7777 </div>
78- <p class="hint"><b data-i18n="Hint:">Hint:</b> <i><span data-i18n="Create new folder in the _space">Create new folder in the </span><b>/characters/</b> <span data-i18n="folder of your user data directory and name it as the name of the character.">folder of your user data directory and name it as the name of the character.</span>
78+ <p class="hint">
79- <span data-i18n="Put images with expressions there. File names should follow the pattern:">Put images with expressions there. File names should follow the pattern: </span><tt data-i18n="expression_label_pattern">[expression_label].[image_format]</tt></i></p>
79+ <b data-i18n="Hint:">Hint:</b>
80+ <i>
81+ <span data-i18n="Create new folder in the _space">Create new folder in the </span><b>/characters/</b> <span data-i18n="folder of your user data directory and name it as the name of the character.">folder of your user data directory and name it as the name of the character.</span>
82+ <span data-i18n="Put images with expressions there. File names should follow the pattern:">Put images with expressions there. File names should follow the pattern: </span><tt data-i18n="expression_label_pattern">[expression_label].[image_format]</tt>
83+ </i>
84+ </p>
85+ <p>
86+ <i>
87+ <span>In case of multiple files per expression, file names can contain a suffix, either separated by a dot or a
88+ dash.
89+ Examples: </span><tt>joy.png</tt>, <tt>joy-1.png</tt>, <tt>joy.expressive.png</tt>
90+ </i>
91+ </p>
8092 <h3 id="image_list_header">
8193 <strong data-i18n="Sprite set:">Sprite set:</strong>&nbsp;<span id="image_list_header_name"></span>
8294 </h3>
public/scripts/extensions/expressions/style.css+31 -2
@@ -111,6 +111,10 @@ img.expression.default {
111111 justify-content: center;
112112}
113113
114+.expression_list_image_container {
115+ overflow: hidden;
116+}
117+
114118.expression_list_title {
115119 position: absolute;
116120 bottom: 0;
@@ -126,6 +130,9 @@ img.expression.default {
126130 flex-direction: column;
127131 line-height: 1;
128132}
133+.expression_list_custom {
134+ font-size: 0.66rem;
135+}
129136
130137.expression_list_buttons {
131138 position: absolute;
@@ -162,11 +169,24 @@ img.expression.default {
162169 row-gap: 1rem;
163170}
164171
165172#image_list .expression_list_item[data-expression-type="success"] .expression_list_title {
166173 color: green;
167174}
168175
169-#image_list .failure {
176+#image_list .expression_list_item[data-expression-type="additional"] .expression_list_title {
177+ color: darkolivegreen;
178+}
179+#image_list .expression_list_item[data-expression-type="additional"] .expression_list_title::before {
180+ content: '➕';
181+ position: absolute;
182+ top: -7px;
183+ left: -9px;
184+ font-size: 14px;
185+ color: transparent;
186+ text-shadow: 0 0 0 darkolivegreen;
187+}
188+
189+#image_list .expression_list_item[data-expression-type="failure"] .expression_list_title {
170190 color: red;
171191}
172192
@@ -189,3 +209,12 @@ img.expression.default {
189209 flex-direction: row;
190210}
191211
212+#expressions_container:has(#expressions_allow_multiple:not(:checked)) #image_list .expression_list_item[data-expression-type="additional"],
213+#expressions_container:has(#expressions_allow_multiple:not(:checked)) label[for="expressions_reroll_if_same"] {
214+ opacity: 0.3;
215+ transition: opacity var(--animation-duration) ease;
216+}
217+#expressions_container:has(#expressions_allow_multiple:not(:checked)) #image_list .expression_list_item[data-expression-type="additional"]:hover,
218+#expressions_container:has(#expressions_allow_multiple:not(:checked)) #image_list .expression_list_item[data-expression-type="additional"]:focus {
219+ opacity: unset;
220+}
public/scripts/extensions/expressions/templates/upload-expression.html+12 -0
@@ -0,0 +1,12 @@
1+<div class="m-b-1" data-i18n="upload_expression_request">Please enter a name for the sprite (without extension).</div>
2+<div class="m-b-1" data-i18n="upload_expression_naming_1">
3+ Sprite names must follow the naming schema for the selected expression: {{expression}}
4+</div>
5+<div data-i18n="upload_expression_naming_2">
6+ For multiple expressions, the name must follow the expression name and a valid suffix. Allowed separators are '-' or dot '.'.
7+</div>
8+<span class="m-b-1" data-i18n="Examples:">Examples:</span> <tt>{{expression}}.png</tt>, <tt>{{expression}}-1.png</tt>, <tt>{{expression}}.expressive.png</tt>
9+{{#if clickedFileName}}
10+<div class="m-t-1" data-i18n="upload_expression_replace">Click 'Replace' to replace the existing expression:</div>
11+<tt>{{clickedFileName}}</tt>
12+{{/if}}
public/scripts/extensions/gallery/index.js+205 -58
@@ -6,7 +6,7 @@ import {
66 event_types,
77} from '../../../script.js';
88import { groups, selected_group } from '../../group-chats.js';
99import { loadFileToDocument, delay, getBase64Async, getSanitizedFilename } from '../../utils.js';
1010import { loadMovingUIState } from '../../power-user.js';
1111import { dragElement } from '../../RossAscends-mods.js';
1212import { SlashCommandParser } from '../../slash-commands/SlashCommandParser.js';
@@ -14,7 +14,7 @@ import { SlashCommand } from '../../slash-commands/SlashCommand.js';
1414import { ARGUMENT_TYPE, SlashCommandNamedArgument } from '../../slash-commands/SlashCommandArgument.js';
1515import { DragAndDropHandler } from '../../dragdrop.js';
1616import { commonEnumProviders } from '../../slash-commands/SlashCommandCommonEnumsProvider.js';
1717import { t, translate } from '../../i18n.js';
1818
1919const extensionName = 'gallery';
2020const extensionFolderPath = `scripts/extensions/${extensionName}/`;
@@ -50,6 +50,48 @@ mutationObserver.observe(document.body, {
5050 subtree: false,
5151});
5252
53+const SORT = Object.freeze({
54+ NAME_ASC: { value: 'nameAsc', field: 'name', order: 'asc', label: t`Sort By: Name (A-Z)` },
55+ NAME_DESC: { value: 'nameDesc', field: 'name', order: 'desc', label: t`Sort By: Name (Z-A)` },
56+ DATE_ASC: { value: 'dateAsc', field: 'date', order: 'asc', label: t`Sort By: Date (Oldest First)` },
57+ DATE_DESC: { value: 'dateDesc', field: 'date', order: 'desc', label: t`Sort By: Date (Newest First)` },
58+});
59+
60+const defaultSettings = Object.freeze({
61+ folders: {},
62+ sort: SORT.DATE_ASC.value,
63+});
64+
65+/**
66+ * Initializes the settings for the gallery extension.
67+ */
68+function initSettings() {
69+ let shouldSave = false;
70+ const context = SillyTavern.getContext();
71+ if (!context.extensionSettings.gallery) {
72+ context.extensionSettings.gallery = structuredClone(defaultSettings);
73+ shouldSave = true;
74+ }
75+ for (const key of Object.keys(defaultSettings)) {
76+ if (!Object.hasOwn(context.extensionSettings.gallery, key)) {
77+ context.extensionSettings.gallery[key] = structuredClone(defaultSettings[key]);
78+ shouldSave = true;
79+ }
80+ }
81+ if (shouldSave) {
82+ context.saveSettingsDebounced();
83+ }
84+}
85+
86+/**
87+ * Retrieves the gallery folder for a given character.
88+ * @param {import('../../char-data.js').v1CharData} char Character data
89+ * @returns {string} The gallery folder for the character
90+ */
91+function getGalleryFolder(char) {
92+ return SillyTavern.getContext().extensionSettings.gallery.folders[char?.avatar] ?? char?.name;
93+}
94+
5395/**
5496 * Retrieves a list of gallery items based on a given URL. This function calls an API endpoint
5597 * to get the filenames and then constructs the item list.
@@ -58,11 +100,20 @@ mutationObserver.observe(document.body, {
58100 * @returns {Promise<Array>} - Resolves with an array of gallery item objects, rejects on error.
59101 */
60102async function getGalleryItems(url) {
61- const response = await fetch(`/api/images/list/${url}`, {
103+ const sortValue = getSortOrder();
104+ const sortObj = Object.values(SORT).find(it => it.value === sortValue) ?? SORT.DATE_ASC;
105+ const response = await fetch('/api/images/list', {
62106 method: 'POST',
63107 headers: getRequestHeaders(),
108+ body: JSON.stringify({
109+ folder: url,
110+ sortField: sortObj.field,
111+ sortOrder: sortObj.order,
112+ }),
64113 });
65114
115+ url = await getSanitizedFilename(url);
116+
66117 const data = await response.json();
67118 const items = data.map((file) => ({
68119 src: `user/images/${url}/${file}`,
@@ -74,6 +125,46 @@ async function getGalleryItems(url) {
74125}
75126
76127/**
128+ * Retrieves a list of gallery folders. This function calls an API endpoint
129+ * @returns {Promise<string[]>} - Resolves with an array of gallery folders.
130+ */
131+async function getGalleryFolders() {
132+ try {
133+ const response = await fetch('/api/images/folders', {
134+ method: 'POST',
135+ headers: getRequestHeaders(),
136+ });
137+
138+ if (!response.ok) {
139+ throw new Error(`HTTP error. Status: ${response.status}`);
140+ }
141+ const data = await response.json();
142+ return data;
143+ } catch (error) {
144+ console.error('Failed to fetch gallery folders:', error);
145+ return [];
146+ }
147+}
148+
149+/**
150+ * Sets the sort order for the gallery.
151+ * @param {string} order Sort order
152+ */
153+function setSortOrder(order) {
154+ const context = SillyTavern.getContext();
155+ context.extensionSettings.gallery.sort = order;
156+ context.saveSettingsDebounced();
157+}
158+
159+/**
160+ * Retrieves the current sort order for the gallery.
161+ * @returns {string} The current sort order for the gallery.
162+ */
163+function getSortOrder() {
164+ return SillyTavern.getContext().extensionSettings.gallery.sort ?? defaultSettings.sort;
165+}
166+
167+/**
77168 * Initializes a gallery using the provided items and sets up the drag-and-drop functionality.
78169 * It uses the nanogallery2 library to display the items and also initializes
79170 * event listeners to handle drag-and-drop of files onto the gallery.
@@ -106,11 +197,28 @@ async function initGallery(items, url) {
106197 },
107198 galleryDisplayMode: 'pagination',
108199 fnThumbnailOpen: viewWithDragbox,
200+ fnThumbnailInit: function (/** @type {JQuery<HTMLElement>} */ $thumbnail, /** @type {{src: string}} */ item) {
201+ if (!item?.src) return;
202+ $thumbnail.attr('title', String(item.src).split('/').pop());
203+ },
109204 });
110205
111206 const dragDropHandler = new DragAndDropHandler(`#dragGallery.${nonce}`, async (files, event) => {
112- let file = files[0];
207+ if (!Array.isArray(files) || files.length === 0) {
113- uploadFile(file, url); // Added url parameter to know where to upload
208+ return;
209+ }
210+
211+ // Upload each file
212+ for (const file of files) {
213+ await uploadFile(file, url);
214+ }
215+
216+ // Refresh the gallery
217+ const newItems = await getGalleryItems(url);
218+ $('#dragGallery').closest('#gallery').remove();
219+ await makeMovable(url);
220+ await delay(100);
221+ await initGallery(newItems, url);
114222 });
115223
116224 const resizeHandler = function () {
@@ -169,15 +277,14 @@ async function showCharGallery() {
169277
170278 try {
171279 let url = selected_group || this_chid;
172280 if (!selected_group && this_chid !== undefined) {
173281 const charurl = getGalleryFolder(characters[this_chid]);
174- url = char.avatar.replace('.png', '');
175282 }
176283
177284 const items = await getGalleryItems(url);
178285 // if there already is a gallery, destroy it and place this one in its place
179286 $('#dragGallery').closest('#gallery').remove();
180287 await makeMovable(url);
181288 await delay(100);
182289 await initGallery(items, url);
183290 } catch (err) {
@@ -196,30 +303,19 @@ async function showCharGallery() {
196303 * @returns {Promise<void>} - Promise representing the completion of the file upload and gallery refresh.
197304 */
198305async function uploadFile(file, url) {
306+ try {
199307 // Convert the file to a base64 string
200308 const readerbase64Data = newawait FileReadergetBase64Async(file);
201- reader.onloadend = async function () {
202- const base64Data = reader.result;
203309
204310 // Create the payload
205311 const payload = {
206312 image: base64Data,
313+ ch_name: url,
207314 };
208315
209- // Add the ch_name from the provided URL (assuming it's the character name)
210- payload.ch_name = url;
211-
212- try {
213- const headers = await getRequestHeaders();
214-
215- // Merge headers with content-type for JSON
216- Object.assign(headers, {
217- 'Content-Type': 'application/json',
218- });
219-
220316 const response = await fetch('/api/images/upload', {
221317 method: 'POST',
222318 headers: headersgetRequestHeaders(),
223319 body: JSON.stringify(payload),
224320 });
225321
@@ -229,59 +325,57 @@ async function uploadFile(file, url) {
229325
230326 const result = await response.json();
231327
232328 toastr.success('t`File uploaded successfully. Saved at: ' + ${result.path}`);
233-
234- // Refresh the gallery
235- const newItems = await getGalleryItems(url); // Fetch the latest items
236- $('#dragGallery').closest('#gallery').remove(); // Destroy old gallery
237- makeMovable();
238- await delay(100);
239- await initGallery(newItems, url); // Reinitialize the gallery with new items and pass 'url'
240329 } catch (error) {
241330 console.error('There was an issue uploading the file:', error);
242331
243332 // Replacing alert with toastr error notification
244333 toastr.error('t`Failed to upload the file.'`);
245334 }
246- };
247- reader.readAsDataURL(file);
248335}
249336
250-$(document).ready(function () {
251- // Register an event listener
252- eventSource.on('charManagementDropdown', (selectedOptionId) => {
253- if (selectedOptionId === 'show_char_gallery') {
254- showCharGallery();
255- }
256- });
257-
258- // Add an option to the dropdown
259- $('#char-management-dropdown').append(
260- $('<option>', {
261- id: 'show_char_gallery',
262- text: translate('Show Gallery'),
263- }),
264- );
265-});
266-
267337/**
268338 * Creates a new draggable container based on a template.
269339 * This function takes a template with the ID 'generic_draggable_template' and clones it.
270340 * The cloned element has its attributes set, a new child div appended, and is made visible on the body.
271341 * Additionally, it sets up the element to prevent dragging on its images.
342+ * @param {string} url - The URL of the image source.
343+ * @returns {Promise<void>} - Promise representing the completion of the draggable container creation.
272344 */
273345async function makeMovable(id = 'gallery'url) {
274-
275346 console.debug('making new container from template');
347+ const id = 'gallery';
276348 const template = $('#generic_draggable_template').html();
277349 const newElement = $(template);
278350 newElement.css('background-color', 'var(--SmartThemeBlurTintColor)');
279351 newElement.attr('forChar', id);
280352 newElement.attr('id', id);
281353 newElement.find('.drag-grabber').attr('id', `${id}header`);
282354 const dragTitle = newElement.find('.dragTitle').text('Image Gallery');
283- //add a div for the gallery
355+ dragTitle.addClass('flex-container justifySpaceBetween alignItemsBaseline');
284- newElement.append('<div id="dragGallery"></div>');
356+ const titleText = document.createElement('span');
357+ titleText.textContent = t`Image Gallery`;
358+ dragTitle.append(titleText);
359+ const sortSelect = document.createElement('select');
360+ sortSelect.classList.add('gallery-sort-select');
361+
362+ for (const sort of Object.values(SORT)) {
363+ const option = document.createElement('option');
364+ option.value = sort.value;
365+ option.textContent = sort.label;
366+ sortSelect.appendChild(option);
367+ }
368+
369+ sortSelect.addEventListener('change', async () => {
370+ const selectedOption = sortSelect.options[sortSelect.selectedIndex].value;
371+ setSortOrder(selectedOption);
372+ closeButton.trigger('click');
373+ await showCharGallery();
374+ });
375+
376+ sortSelect.value = getSortOrder();
377+ dragTitle.append(sortSelect);
378+
285379 // add no-scrollbar class to this element
286380 newElement.addClass('no-scrollbar');
287381
@@ -290,6 +384,81 @@ function makeMovable(id = 'gallery') {
290384 closeButton.attr('id', `${id}close`);
291385 closeButton.attr('data-related-id', `${id}`);
292386
387+ const topBarElement = document.createElement('div');
388+ topBarElement.classList.add('flex-container', 'alignItemsCenter');
389+
390+ const onChangeFolder = async (/** @type {Event} */ e) => {
391+ if (e instanceof KeyboardEvent && e.key !== 'Enter') {
392+ return;
393+ }
394+
395+ try {
396+ const newUrl = await getSanitizedFilename(galleryFolderInput.value);
397+ updateGalleryFolder(newUrl);
398+ closeButton.trigger('click');
399+ await showCharGallery();
400+ toastr.info(t`Gallery folder changed to ${newUrl}`);
401+ galleryFolderInput.value = newUrl;
402+ } catch (error) {
403+ console.error('Failed to change gallery folder:', error);
404+ toastr.error(error?.message || t`Unknown error`, t`Failed to change gallery folder`);
405+ }
406+ };
407+
408+ const onRestoreFolder = async () => {
409+ try {
410+ restoreGalleryFolder();
411+ closeButton.trigger('click');
412+ await showCharGallery();
413+ } catch (error) {
414+ console.error('Failed to restore gallery folder:', error);
415+ toastr.error(error?.message || t`Unknown error`, t`Failed to restore gallery folder`);
416+ }
417+ };
418+
419+ const galleryFolderInput = document.createElement('input');
420+ galleryFolderInput.type = 'text';
421+ galleryFolderInput.placeholder = t`Folder Name`;
422+ galleryFolderInput.title = t`Enter a folder name to change the gallery folder`;
423+ galleryFolderInput.value = url;
424+ galleryFolderInput.classList.add('text_pole', 'gallery-folder-input', 'flex1');
425+ galleryFolderInput.addEventListener('keyup', onChangeFolder);
426+
427+ const galleryFolderAccept = document.createElement('div');
428+ galleryFolderAccept.classList.add('right_menu_button', 'fa-solid', 'fa-check', 'fa-fw');
429+ galleryFolderAccept.title = t`Change gallery folder`;
430+ galleryFolderAccept.addEventListener('click', onChangeFolder);
431+
432+ const galleryFolderRestore = document.createElement('div');
433+ galleryFolderRestore.classList.add('right_menu_button', 'fa-solid', 'fa-recycle', 'fa-fw');
434+ galleryFolderRestore.title = t`Restore gallery folder`;
435+ galleryFolderRestore.addEventListener('click', onRestoreFolder);
436+
437+ topBarElement.appendChild(galleryFolderInput);
438+ topBarElement.appendChild(galleryFolderAccept);
439+ topBarElement.appendChild(galleryFolderRestore);
public/scripts/extensions/gallery/style.css+0 -0
public/scripts/extensions/memory/index.js+0 -0
public/scripts/extensions/memory/settings.html+0 -0
public/scripts/extensions/memory/style.css+0 -0
public/scripts/extensions/shared.js+0 -0
public/scripts/extensions/stable-diffusion/index.js+0 -0
public/scripts/extensions/token-counter/index.js+0 -0
public/scripts/extensions/token-counter/window.html+0 -0
public/scripts/extensions/translate/index.js+0 -0
public/scripts/extensions/tts/alltalk.js+0 -0
public/scripts/extensions/tts/index.js+0 -0
public/scripts/extensions/tts/openai-compatible.js+0 -0
public/scripts/extensions/tts/system.js+0 -0
public/scripts/extensions/vectors/index.js+0 -0
public/scripts/group-chats.js+0 -0
public/scripts/horde.js+0 -0
public/scripts/i18n.js+0 -0
public/scripts/logprobs.js+0 -0
public/scripts/openai.js+0 -0
public/scripts/personas.js+0 -0
public/scripts/power-user.js+0 -0
public/scripts/preset-manager.js+0 -0
public/scripts/reasoning.js+0 -0
public/scripts/slash-commands.js+0 -0
public/scripts/slash-commands/SlashCommandCommonEnumsProvider.js+0 -0
public/scripts/sse-stream.js+0 -0
public/scripts/st-context.js+0 -0
public/scripts/tags.js+0 -0
public/scripts/templates/macros.html+0 -0
public/scripts/textgen-models.js+0 -0
public/scripts/textgen-settings.js+0 -0
public/scripts/tokenizers.js+0 -0
public/scripts/tool-calling.js+0 -0
public/scripts/utils.js+0 -0
public/scripts/world-info.js+0 -0
public/style.css+0 -0
server.js+0 -0
src/command-line.js+0 -0
src/electron/Start.bat+0 -0
src/electron/index.js+0 -0
src/electron/package-lock.json+0 -0
src/electron/package.json+0 -0
src/electron/start.sh+0 -0
src/endpoints/backends/chat-completions.js+0 -0
src/endpoints/backends/text-completions.js+0 -0
src/endpoints/characters.js+0 -0
src/endpoints/chats.js+0 -0
src/endpoints/content-manager.js+0 -0
src/endpoints/extensions.js+0 -0
src/endpoints/images.js+0 -0
src/endpoints/openai.js+0 -0
src/endpoints/secrets.js+0 -0
src/endpoints/settings.js+0 -0
src/endpoints/sprites.js+0 -0
src/endpoints/thumbnails.js+0 -0
src/endpoints/tokenizers.js+0 -0
src/endpoints/users-public.js+0 -0
src/endpoints/vectors.js+0 -0
src/express-common.js+0 -0
src/middleware/accessLogWriter.js+0 -0
src/middleware/basicAuth.js+0 -0
src/middleware/corsProxy.js+0 -0
src/middleware/webpack-serve.js+0 -0
src/middleware/whitelist.js+0 -0
src/plugin-loader.js+0 -0
src/prompt-converters.js+0 -0
src/server-events.js+0 -0
src/server-startup.js+0 -0
src/transformers.js+0 -0
src/users.js+0 -0
src/util.js+0 -0
webpack.config.js+0 -0
Diff truncated