sillytavern 1.16.0 → 1.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (294) hide show
  1. package/.dockerignore +1 -0
  2. package/.eslintrc.cjs +23 -0
  3. package/Dockerfile +1 -1
  4. package/Start.bat +1 -1
  5. package/UpdateAndStart.bat +1 -1
  6. package/UpdateForkAndStart.bat +1 -1
  7. package/default/config.yaml +72 -4
  8. package/default/{public/error → content/errors}/url-not-found.html +2 -2
  9. package/default/content/index.json +36 -0
  10. package/default/content/presets/context/Gemma 4.json +14 -0
  11. package/default/content/presets/instruct/Gemma 4.json +25 -0
  12. package/default/content/presets/instruct/KoboldAI.json +1 -1
  13. package/default/content/presets/openai/Default.json +2 -0
  14. package/default/content/presets/reasoning/Gemma 4.json +6 -0
  15. package/default/content/presets/reasoning/Think XML.json +6 -0
  16. package/default/content/settings.json +1 -1
  17. package/docker/docker-entrypoint.sh +3 -3
  18. package/index.d.ts +5 -1
  19. package/package.json +21 -16
  20. package/plugins.js +4 -3
  21. package/public/css/!USER-CSS-README.md +7 -0
  22. package/public/css/backgrounds.css +207 -16
  23. package/public/css/extensions-panel.css +12 -2
  24. package/public/css/loader.css +57 -0
  25. package/public/css/mobile-styles.css +77 -1
  26. package/public/css/popup.css +4 -0
  27. package/public/css/streaming-display.css +236 -0
  28. package/public/css/toggle-dependent.css +10 -0
  29. package/public/css/welcome.css +1 -0
  30. package/public/global.d.ts +4 -1
  31. package/public/img/kobold.svg +5 -77
  32. package/public/img/koboldcpp.svg +5 -77
  33. package/public/img/koboldhorde.svg +6 -47
  34. package/public/img/logo.svg +2 -0
  35. package/public/img/minimax.svg +1 -0
  36. package/public/img/pollinations.svg +4 -1
  37. package/public/img/scale.svg +2 -60
  38. package/public/img/textgenerationwebui.svg +6 -87
  39. package/public/img/workers_ai.svg +9 -0
  40. package/public/index.html +276 -113
  41. package/public/lib.js +8 -0
  42. package/public/locales/ar-sa.json +17 -1
  43. package/public/locales/de-de.json +17 -1
  44. package/public/locales/es-es.json +17 -1
  45. package/public/locales/fr-fr.json +21 -5
  46. package/public/locales/is-is.json +17 -1
  47. package/public/locales/it-it.json +17 -1
  48. package/public/locales/ja-jp.json +17 -1
  49. package/public/locales/ko-kr.json +18 -2
  50. package/public/locales/nl-nl.json +17 -1
  51. package/public/locales/pt-pt.json +17 -1
  52. package/public/locales/ru-ru.json +20 -4
  53. package/public/locales/th-th.json +17 -1
  54. package/public/locales/uk-ua.json +17 -1
  55. package/public/locales/vi-vn.json +17 -1
  56. package/public/locales/zh-cn.json +1813 -482
  57. package/public/locales/zh-tw.json +21 -5
  58. package/public/script.js +515 -308
  59. package/public/scripts/BulkEditOverlay.js +11 -9
  60. package/public/scripts/PromptManager.js +1 -3
  61. package/public/scripts/RossAscends-mods.js +17 -19
  62. package/public/scripts/a11y.js +1 -0
  63. package/public/scripts/action-loader-slashcommands.js +370 -0
  64. package/public/scripts/action-loader.js +617 -0
  65. package/public/scripts/authors-note.js +2 -4
  66. package/public/scripts/autocomplete/AutoComplete.js +0 -5
  67. package/public/scripts/autocomplete/AutoCompleteFuzzyScore.js +0 -3
  68. package/public/scripts/autocomplete/AutoCompleteNameResult.js +0 -1
  69. package/public/scripts/autocomplete/AutoCompleteNameResultBase.js +2 -3
  70. package/public/scripts/autocomplete/AutoCompleteOption.js +1 -2
  71. package/public/scripts/backgrounds.js +799 -33
  72. package/public/scripts/bookmarks.js +59 -16
  73. package/public/scripts/browser-fixes.js +8 -0
  74. package/public/scripts/bulk-edit.js +1 -1
  75. package/public/scripts/cfg-scale.js +0 -1
  76. package/public/scripts/chat-backups.js +1 -1
  77. package/public/scripts/chats.js +7 -7
  78. package/public/scripts/constants.js +2 -0
  79. package/public/scripts/custom-request.js +3 -2
  80. package/public/scripts/data-maid.js +0 -1
  81. package/public/scripts/dynamic-styles.js +7 -2
  82. package/public/scripts/events.js +12 -0
  83. package/public/scripts/extensions/assets/index.js +313 -221
  84. package/public/scripts/extensions/assets/installation.html +19 -1
  85. package/public/scripts/extensions/assets/manifest.json +4 -1
  86. package/public/scripts/extensions/assets/style.css +16 -3
  87. package/public/scripts/extensions/attachments/index.js +2 -2
  88. package/public/scripts/extensions/attachments/manage-button.html +1 -1
  89. package/public/scripts/extensions/attachments/manifest.json +4 -1
  90. package/public/scripts/extensions/caption/index.js +16 -14
  91. package/public/scripts/extensions/caption/manifest.json +4 -1
  92. package/public/scripts/extensions/caption/settings.html +24 -0
  93. package/public/scripts/extensions/connection-manager/index.js +336 -5
  94. package/public/scripts/extensions/connection-manager/manifest.json +4 -1
  95. package/public/scripts/extensions/expressions/index.js +81 -32
  96. package/public/scripts/extensions/expressions/manifest.json +4 -1
  97. package/public/scripts/extensions/gallery/index.js +23 -3
  98. package/public/scripts/extensions/gallery/manifest.json +4 -1
  99. package/public/scripts/extensions/memory/index.js +17 -10
  100. package/public/scripts/extensions/memory/manifest.json +4 -1
  101. package/public/scripts/extensions/quick-reply/api/QuickReplyApi.js +9 -15
  102. package/public/scripts/extensions/quick-reply/index.js +17 -20
  103. package/public/scripts/extensions/quick-reply/manifest.json +4 -1
  104. package/public/scripts/extensions/quick-reply/src/AutoExecuteHandler.js +1 -5
  105. package/public/scripts/extensions/quick-reply/src/QuickReply.js +105 -116
  106. package/public/scripts/extensions/quick-reply/src/QuickReplyConfig.js +12 -20
  107. package/public/scripts/extensions/quick-reply/src/QuickReplyContextLink.js +0 -2
  108. package/public/scripts/extensions/quick-reply/src/QuickReplySet.js +25 -26
  109. package/public/scripts/extensions/quick-reply/src/QuickReplySetLink.js +6 -14
  110. package/public/scripts/extensions/quick-reply/src/QuickReplySettings.js +2 -8
  111. package/public/scripts/extensions/quick-reply/src/SlashCommandHandler.js +13 -21
  112. package/public/scripts/extensions/quick-reply/src/ui/ButtonUi.js +6 -14
  113. package/public/scripts/extensions/quick-reply/src/ui/SettingsUi.js +30 -38
  114. package/public/scripts/extensions/quick-reply/src/ui/ctx/ContextMenu.js +0 -4
  115. package/public/scripts/extensions/quick-reply/src/ui/ctx/MenuItem.js +0 -3
  116. package/public/scripts/extensions/quick-reply/src/ui/ctx/SubMenu.js +0 -4
  117. package/public/scripts/extensions/regex/index.js +34 -4
  118. package/public/scripts/extensions/regex/manifest.json +4 -1
  119. package/public/scripts/extensions/shared.js +36 -1
  120. package/public/scripts/extensions/stable-diffusion/button.html +0 -4
  121. package/public/scripts/extensions/stable-diffusion/index.js +282 -120
  122. package/public/scripts/extensions/stable-diffusion/manifest.json +4 -1
  123. package/public/scripts/extensions/stable-diffusion/settings.html +37 -17
  124. package/public/scripts/extensions/stable-diffusion/style.css +0 -4
  125. package/public/scripts/extensions/token-counter/index.js +2 -3
  126. package/public/scripts/extensions/token-counter/manifest.json +4 -1
  127. package/public/scripts/extensions/translate/index.js +2 -2
  128. package/public/scripts/extensions/translate/manifest.json +4 -1
  129. package/public/scripts/extensions/tts/alltalk.js +0 -1
  130. package/public/scripts/extensions/tts/chatterbox.js +0 -3
  131. package/public/scripts/extensions/tts/coqui.js +16 -21
  132. package/public/scripts/extensions/tts/cosyvoice.js +0 -6
  133. package/public/scripts/extensions/tts/elevenlabs.js +1 -1
  134. package/public/scripts/extensions/tts/google-native.js +0 -2
  135. package/public/scripts/extensions/tts/gpt-sovits-v2.js +0 -8
  136. package/public/scripts/extensions/tts/gsvi.js +0 -9
  137. package/public/scripts/extensions/tts/index.js +93 -44
  138. package/public/scripts/extensions/tts/kokoro-worker.js +1 -1
  139. package/public/scripts/extensions/tts/manifest.json +4 -1
  140. package/public/scripts/extensions/tts/minimax.js +0 -2
  141. package/public/scripts/extensions/tts/openai.js +0 -1
  142. package/public/scripts/extensions/tts/silerotts.js +0 -1
  143. package/public/scripts/extensions/tts/system.js +1 -2
  144. package/public/scripts/extensions/tts/vits.js +2 -4
  145. package/public/scripts/extensions/tts/xtts.js +0 -1
  146. package/public/scripts/extensions/vectors/index.js +289 -193
  147. package/public/scripts/extensions/vectors/manifest.json +4 -1
  148. package/public/scripts/extensions/vectors/settings.html +36 -0
  149. package/public/scripts/extensions.js +647 -130
  150. package/public/scripts/f-localStorage.js +0 -1
  151. package/public/scripts/filters.js +12 -4
  152. package/public/scripts/group-chats.js +29 -35
  153. package/public/scripts/horde.js +1 -2
  154. package/public/scripts/i18n.js +7 -1
  155. package/public/scripts/input-md-formatting.js +4 -5
  156. package/public/scripts/instruct-mode.js +1 -2
  157. package/public/scripts/itemized-prompts.js +5 -0
  158. package/public/scripts/kai-settings.js +2 -2
  159. package/public/scripts/keyboard.js +6 -0
  160. package/public/scripts/loader.js +50 -66
  161. package/public/scripts/logit-bias.js +4 -10
  162. package/public/scripts/macros/definitions/chat-macros.js +12 -0
  163. package/public/scripts/macros/definitions/core-macros.js +24 -3
  164. package/public/scripts/macros/definitions/env-macros.js +24 -0
  165. package/public/scripts/macros/engine/MacroCstWalker.js +2 -3
  166. package/public/scripts/macros/engine/MacroEnv.types.js +2 -0
  167. package/public/scripts/macros/engine/MacroEnvBuilder.js +10 -1
  168. package/public/scripts/macros.js +15 -8
  169. package/public/scripts/nai-settings.js +6 -12
  170. package/public/scripts/openai.js +826 -472
  171. package/public/scripts/personas.js +1049 -113
  172. package/public/scripts/popup.js +197 -11
  173. package/public/scripts/power-user.js +105 -246
  174. package/public/scripts/preset-manager.js +2 -5
  175. package/public/scripts/reasoning.js +149 -5
  176. package/public/scripts/request-compression.js +131 -0
  177. package/public/scripts/samplerSelect.js +2 -5
  178. package/public/scripts/secrets.js +217 -16
  179. package/public/scripts/showdown-underscore.js +1 -1
  180. package/public/scripts/slash-commands/SlashCommand.js +3 -6
  181. package/public/scripts/slash-commands/SlashCommandArgument.js +1 -2
  182. package/public/scripts/slash-commands/SlashCommandAutoCompleteNameResult.js +13 -13
  183. package/public/scripts/slash-commands/SlashCommandBrowser.js +15 -15
  184. package/public/scripts/slash-commands/SlashCommandClosure.js +17 -17
  185. package/public/scripts/slash-commands/SlashCommandCommandAutoCompleteOption.js +0 -2
  186. package/public/scripts/slash-commands/SlashCommandCommonEnumsProvider.js +45 -5
  187. package/public/scripts/slash-commands/SlashCommandDebugController.js +4 -9
  188. package/public/scripts/slash-commands/SlashCommandEnumAutoCompleteOption.js +1 -2
  189. package/public/scripts/slash-commands/SlashCommandExecutionError.js +0 -1
  190. package/public/scripts/slash-commands/SlashCommandExecutor.js +6 -6
  191. package/public/scripts/slash-commands/SlashCommandParser.js +20 -20
  192. package/public/scripts/slash-commands/SlashCommandScope.js +3 -5
  193. package/public/scripts/slash-commands.js +1296 -91
  194. package/public/scripts/sse-stream.js +20 -32
  195. package/public/scripts/st-context.js +18 -1
  196. package/public/scripts/stats.js +1 -2
  197. package/public/scripts/streaming-display.js +430 -0
  198. package/public/scripts/swipe-picker.js +444 -0
  199. package/public/scripts/tags.js +101 -49
  200. package/public/scripts/templates/itemizationText.html +11 -11
  201. package/public/scripts/templates/tabbyDownloader.html +1 -1
  202. package/public/scripts/templates/thirdPartyExtensionWarning.html +18 -0
  203. package/public/scripts/templates/wandMenu.html +1 -0
  204. package/public/scripts/templates/welcomePanel.html +4 -1
  205. package/public/scripts/textgen-models.js +381 -6
  206. package/public/scripts/textgen-settings.js +15 -12
  207. package/public/scripts/tokenizers.js +64 -68
  208. package/public/scripts/tool-calling.js +27 -5
  209. package/public/scripts/user.js +7 -6
  210. package/public/scripts/util/SimpleMutex.js +1 -2
  211. package/public/scripts/util/ThemeGenerator.js +322 -0
  212. package/public/scripts/utils.js +187 -16
  213. package/public/scripts/variables.js +1 -33
  214. package/public/scripts/welcome-screen.js +124 -8
  215. package/public/scripts/world-info.js +128 -32
  216. package/public/style.css +163 -8
  217. package/src/additional-headers.js +47 -32
  218. package/src/command-line.js +14 -2
  219. package/src/constants.js +29 -0
  220. package/src/electron/Start.bat +1 -1
  221. package/src/electron/package-lock.json +12 -12
  222. package/src/electron/package.json +1 -1
  223. package/src/endpoints/assets.js +12 -25
  224. package/src/endpoints/backends/chat-completions.js +320 -99
  225. package/src/endpoints/backends/kobold.js +1 -1
  226. package/src/endpoints/backends/text-completions.js +2 -5
  227. package/src/endpoints/backgrounds.js +111 -54
  228. package/src/endpoints/backups.js +3 -5
  229. package/src/endpoints/characters.js +184 -46
  230. package/src/endpoints/chats.js +27 -7
  231. package/src/endpoints/content-manager.js +115 -36
  232. package/src/endpoints/extensions.js +117 -57
  233. package/src/endpoints/groups.js +2 -3
  234. package/src/endpoints/horde.js +1 -4
  235. package/src/endpoints/image-metadata.js +283 -36
  236. package/src/endpoints/minimax.js +0 -2
  237. package/src/endpoints/nanogpt.js +138 -0
  238. package/src/endpoints/novelai.js +4 -7
  239. package/src/endpoints/openai.js +99 -3
  240. package/src/endpoints/openrouter.js +45 -10
  241. package/src/endpoints/search.js +2 -1
  242. package/src/endpoints/secrets.js +9 -3
  243. package/src/endpoints/settings.js +12 -2
  244. package/src/endpoints/speech.js +2 -2
  245. package/src/endpoints/sprites.js +1 -2
  246. package/src/endpoints/stable-diffusion.js +207 -27
  247. package/src/endpoints/thumbnails.js +1 -2
  248. package/src/endpoints/tokenizers.js +20 -11
  249. package/src/endpoints/users-private.js +16 -2
  250. package/src/endpoints/users-public.js +27 -15
  251. package/src/endpoints/vectors.js +27 -0
  252. package/src/express-common.js +82 -7
  253. package/src/git/client.js +138 -0
  254. package/src/middleware/accessLogWriter.js +2 -2
  255. package/src/middleware/basicAuth.js +60 -29
  256. package/src/middleware/corsProxy.js +6 -2
  257. package/src/middleware/hostWhitelist.js +1 -4
  258. package/src/middleware/userCss.js +19 -0
  259. package/src/middleware/validateFileName.js +2 -1
  260. package/src/middleware/webpack-serve.js +7 -5
  261. package/src/middleware/whitelist.js +7 -51
  262. package/src/private-request-filter.js +231 -0
  263. package/src/prompt-converters.js +38 -14
  264. package/src/request-proxy.js +13 -2
  265. package/src/server-init.js +12 -0
  266. package/src/server-main.js +26 -7
  267. package/src/server-startup.js +63 -7
  268. package/src/users.js +146 -10
  269. package/src/util.js +21 -13
  270. package/src/vectors/extras-vectors.js +1 -2
  271. package/src/vectors/llamacpp-vectors.js +3 -2
  272. package/src/vectors/ollama-vectors.js +19 -23
  273. package/src/vectors/openai-vectors.js +25 -4
  274. package/src/vectors/vllm-vectors.js +3 -2
  275. package/start.sh +1 -1
  276. package/tests/frontend/MacroEnvBuilder.e2e.js +2 -0
  277. package/tests/package-lock.json +15 -19
  278. package/tests/private-request-filter.test.js +130 -0
  279. package/tests/prompt-converters.test.js +1263 -0
  280. package/tests/tavern-card-validator.test.js +251 -0
  281. package/tests/util-pure.test.js +689 -0
  282. package/tests/util.test.js +61 -2
  283. package/webpack.config.js +64 -14
  284. package/config.yaml +0 -326
  285. package/post-install.js +0 -114
  286. package/public/css/user.css +0 -1
  287. package/public/error/forbidden-by-whitelist.html +0 -22
  288. package/public/error/host-not-allowed.html +0 -21
  289. package/public/error/unauthorized.html +0 -17
  290. package/public/error/url-not-found.html +0 -15
  291. /package/default/{public/error → content/errors}/forbidden-by-whitelist.html +0 -0
  292. /package/default/{public/error → content/errors}/host-not-allowed.html +0 -0
  293. /package/default/{public/error → content/errors}/unauthorized.html +0 -0
  294. /package/default/{public/css → content}/user.css +0 -0
package/.dockerignore CHANGED
@@ -11,6 +11,7 @@
11
11
  /docker/extensions
12
12
  /docker/data
13
13
  /docker/plugins
14
+ /docker/dist
14
15
  /public/scripts/extensions/third-party
15
16
 
16
17
  # --- Plugins (keep only package files) ---
package/.eslintrc.cjs CHANGED
@@ -102,5 +102,28 @@ module.exports = {
102
102
  // These rules should eventually be enabled.
103
103
  'no-async-promise-executor': 'off',
104
104
  'no-inner-declarations': 'off',
105
+ // Additional formatting rules based on codebase conventions
106
+ 'brace-style': ['error', '1tbs', { allowSingleLine: true }],
107
+ 'array-bracket-spacing': ['error', 'never'],
108
+ 'computed-property-spacing': ['error', 'never'],
109
+ 'block-spacing': ['error', 'always'],
110
+ 'keyword-spacing': ['error', { before: true, after: true }],
111
+ 'space-before-blocks': ['error', 'always'],
112
+ 'space-before-function-paren': ['error', { anonymous: 'always', named: 'never', asyncArrow: 'always' }],
113
+ 'space-in-parens': ['error', 'never'],
114
+ 'comma-spacing': ['error', { before: false, after: true }],
115
+ 'key-spacing': ['error', { beforeColon: false, afterColon: true }],
116
+ 'func-call-spacing': ['error', 'never'],
117
+ 'no-multiple-empty-lines': ['error', { max: 2, maxEOF: 1, maxBOF: 0 }],
118
+ 'padded-blocks': ['error', 'never'],
119
+ 'no-whitespace-before-property': 'error',
120
+ 'space-unary-ops': ['error', { words: true, nonwords: false }],
121
+ 'arrow-spacing': ['error', { before: true, after: true }],
122
+ 'template-curly-spacing': ['error', 'never'],
123
+ 'rest-spread-spacing': ['error', 'never'],
124
+ 'generator-star-spacing': ['error', { before: false, after: true }],
125
+ 'yield-star-spacing': ['error', { before: false, after: true }],
126
+ 'template-tag-spacing': ['error', 'never'],
127
+ 'switch-colon-spacing': ['error', { after: true, before: false }],
105
128
  },
106
129
  };
package/Dockerfile CHANGED
@@ -19,7 +19,7 @@ COPY --chown=node:node . ./
19
19
 
20
20
  RUN \
21
21
  echo "*** Install npm packages ***" && \
22
- npm ci --no-audit --no-fund --loglevel=error --no-progress --omit=dev && npm cache clean --force
22
+ npm ci --no-audit --no-fund --loglevel=error --no-progress --omit=dev --ignore-scripts && npm cache clean --force
23
23
 
24
24
  # Create config directory and link config.yaml. Added hardcoded dirs(constants.js?)
25
25
  # that must be present for Non-Root Mode and volumeless docker runs.
package/Start.bat CHANGED
@@ -1,7 +1,7 @@
1
1
  @echo off
2
2
  pushd %~dp0
3
3
  set NODE_ENV=production
4
- call npm install --no-save --no-audit --no-fund --loglevel=error --no-progress --omit=dev
4
+ call npm install --no-save --no-audit --no-fund --loglevel=error --no-progress --omit=dev --ignore-scripts
5
5
  node server.js %*
6
6
  pause
7
7
  popd
@@ -20,7 +20,7 @@ if %errorlevel% neq 0 (
20
20
  )
21
21
  )
22
22
  set NODE_ENV=production
23
- call npm install --no-save --no-audit --no-fund --loglevel=error --no-progress --omit=dev
23
+ call npm install --no-save --no-audit --no-fund --loglevel=error --no-progress --omit=dev --ignore-scripts
24
24
  node server.js %*
25
25
  :end
26
26
  pause
@@ -102,7 +102,7 @@ if %errorlevel% neq 0 (
102
102
 
103
103
  echo Installing npm packages and starting server
104
104
  set NODE_ENV=production
105
- call npm install --no-save --no-audit --no-fund --loglevel=error --no-progress --omit=dev
105
+ call npm install --no-save --no-audit --no-fund --loglevel=error --no-progress --omit=dev --ignore-scripts
106
106
  node server.js %*
107
107
 
108
108
  :end
@@ -41,6 +41,9 @@ port: 8000
41
41
  # Interval in seconds to write a heartbeat file. Set to 0 to disable.
42
42
  # This is used primarily for Docker healthchecks.
43
43
  heartbeatInterval: 0
44
+ # Enable HTTP/HTTPS keep-alive globally.
45
+ # Disabling restores old Node 18 behavior, can help if ECONNRESET and other network errors occur.
46
+ enableKeepAlive: false
44
47
  # -- SSL options --
45
48
  ssl:
46
49
  # Enable SSL/TLS encryption
@@ -55,7 +58,7 @@ ssl:
55
58
  # -- SECURITY CONFIGURATION --
56
59
  # Toggle whitelist mode
57
60
  whitelistMode: true
58
- # Whitelist will also verify IP in X-Forwarded-For / X-Real-IP headers
61
+ # When enabled, whitelist will also verify IP in headers enabled in `forwardedHeaders` section.
59
62
  enableForwardedWhitelist: true
60
63
  # Whitelist of allowed IP addresses
61
64
  whitelist:
@@ -127,6 +130,13 @@ sso:
127
130
  # as that used for authentik. (Ensure the username in authentik
128
131
  # is an exact match in lowercase with that in sillytavern).
129
132
  authentikAuth: false
133
+ # List of trusted proxy IPs for SSO authentication.
134
+ # Supports wildcards or CIDR notation for subnets.
135
+ # Example: ['127.0.0.1', '192.168.1.1']
136
+ # Set to ['*'] to trust all proxies (NOT RECOMMENDED unless you have other security measures in place)
137
+ trustedProxies:
138
+ - ::1
139
+ - 127.0.0.1
130
140
 
131
141
  # Host whitelist configuration. Recommended if you're using a listen mode
132
142
  hostWhitelist:
@@ -141,6 +151,26 @@ hostWhitelist:
141
151
  # - .trycloudflare.com
142
152
  hosts: []
143
153
 
154
+ # Perform whitelist checks against server-side HTTP requests that resolve to private IP addresses.
155
+ # This is an additional layer of security to prevent Server-Side Request Forgery (SSRF) attacks.
156
+ # Recommended when listen mode is enabled, or if your server is accessible by untrusted users.
157
+ privateAddressWhitelist:
158
+ # Enable private address whitelist to block requests to private IP ranges.
159
+ enabled: false
160
+ # If true, requests to hosts that cannot be resolved will be allowed instead of blocked.
161
+ allowUnresolvedHosts: false
162
+ # Log blocked and allowed requests to the console.
163
+ log:
164
+ # Log blocked requests to the console with a warning message
165
+ blockedRequests: true
166
+ # Log allowed requests to the console with an info message
167
+ allowedRequests: false
168
+ # List of allowed private IP ranges (in CIDR notation or wildcard format).
169
+ # Allows loopback IP ranges by default, but you can customize this list to fit your needs.
170
+ allowedRanges:
171
+ - '127.0.0.0/8' # Loopback (IPv4)
172
+ - '::1/128' # Loopback (IPv6)
173
+
144
174
  # User session timeout *in seconds* (defaults to 24 hours).
145
175
  ## Set to a positive number to expire session after a certain time of inactivity
146
176
  ## Set to 0 to expire session when the browser is closed
@@ -159,12 +189,29 @@ logging:
159
189
  minLogLevel: 0
160
190
  # -- RATE LIMITING CONFIGURATION --
161
191
  rateLimiting:
162
- # Use X-Real-IP header instead of socket IP for rate limiting
163
- # Only enable this if you are using a properly configured reverse proxy (like Nginx/traefik/Caddy)
192
+ # Use any of the enabled headers in the `forwardedHeaders` section to identify the client IP for rate limiting.
193
+ # If disabled, only the socket IP will be used, which may not work correctly if you are behind a reverse proxy.
164
194
  preferRealIpHeader: false
195
+ # Set the maximum number of allowed failed basic authentication attempts before rate limiting is applied. Set to 0 to disable rate limiting for basic auth.
196
+ basicAuthMaxAttempts: 5
197
+ # Set the maximum number of allowed failed account login attempts before rate limiting is applied. Set to 0 to disable rate limiting for account logins.
198
+ accountsLoginMaxAttempts: 5
199
+ # Set the maximum number of allowed failed account recovery attempts before rate limiting is applied. Set to 0 to disable rate limiting for account recovery.
200
+ accountsRecoverMaxAttempts: 5
201
+ # Set to true to enable support for real IPs in certain request headers for features like IP whitelisting, rate limiting and access logging.
202
+ # Only change if you are sure that you use a correctly configured reverse proxy, otherwise this may lead to IP spoofing.
203
+ forwardedHeaders:
204
+ # X-Real-IP header (common with Nginx and Caddy)
205
+ xRealIp: true
206
+ # X-Forwarded-For header (common with many proxies, but may contain multiple IPs - only the first one will be used)
207
+ xForwardedFor: true
208
+ # CF-Connecting-IP header (used by Cloudflare Tunnels)
209
+ cfConnectingIp: false
165
210
 
166
211
  ## BACKUP CONFIGURATION
167
212
  backups:
213
+ # Allow users to create a full backup archive of their data
214
+ allowFullDataBackup: true
168
215
  # Common settings for all backup types
169
216
  common:
170
217
  # Number of backups to keep for each chat and settings file
@@ -202,6 +249,16 @@ performance:
202
249
  memoryCacheCapacity: '100mb'
203
250
  # Enables disk caching for character cards. Improves performances with large card libraries.
204
251
  useDiskCache: true
252
+ # Configures gzip compression for client requests with large payloads (e.g. settings or chat saves).
253
+ requestCompression:
254
+ # Enable request compression.
255
+ enabled: false
256
+ # Minimum payload size to trigger compression. Set to 0 to compress all requests regardless of size.
257
+ minPayloadSize: '256kb'
258
+ # Hard upper payload size limit for compression. Set to 0 to allow compression of any size.
259
+ maxPayloadSize: '8mb'
260
+ # Timeout for request compression in milliseconds.
261
+ timeout: 4000
205
262
 
206
263
  # CACHE BUSTER CONFIGURATION
207
264
  # IMPORTANT: Requires localhost or a domain with HTTPS, otherwise will not work!
@@ -250,6 +307,13 @@ extensions:
250
307
  speechToText: Xenova/whisper-small
251
308
  textToSpeech: Xenova/speecht5_tts
252
309
 
310
+ # Git backend for plugin/extension repository operations.
311
+ # - Use "auto" to prefer system git, falling back to the integrated backend
312
+ # - Use "system" to force system backend
313
+ # - Use "builtin" to force integrated backend
314
+ git:
315
+ backend: auto
316
+
253
317
  # Additional model tokenizers can be downloaded on demand.
254
318
  # Disabling will fallback to another locally available tokenizer.
255
319
  enableDownloadableTokenizers: true
@@ -293,7 +357,7 @@ claude:
293
357
  # Otherwise, you'll just waste money on cache misses.
294
358
  enableSystemPromptCache: false
295
359
  # Enables caching of the message history at depth (if supported).
296
- # https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching
360
+ # https://platform.claude.com/docs/en/build-with-claude/prompt-caching
297
361
  # -- IMPORTANT! --
298
362
  # Use with caution. Behavior may be unpredictable and no guarantees can or will be made.
299
363
  # Set to an integer to specify the desired depth. 0 (which does NOT include the prefill)
@@ -304,6 +368,10 @@ claude:
304
368
  ## 5m: base price x 1.25
305
369
  ## 1h: base price x 2
306
370
  extendedTTL: false
371
+ # Enables adaptive thinking for supported models (Opus 4.6+).
372
+ # Disable to enforce legacy thinking mode (with thinking budget).
373
+ # https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking
374
+ enableAdaptiveThinking: false
307
375
  # -- GOOGLE GEMINI API CONFIGURATION --
308
376
  gemini:
309
377
  # API endpoint version ("v1beta" or "v1alpha")
@@ -2,11 +2,11 @@
2
2
  <html>
3
3
 
4
4
  <head>
5
- <title>Not found</title>
5
+ <title>Not Found</title>
6
6
  </head>
7
7
 
8
8
  <body>
9
- <h1>Not found</h1>
9
+ <h1>Not Found</h1>
10
10
  <p>
11
11
  The requested URL was not found on this server.
12
12
  </p>
@@ -638,5 +638,41 @@
638
638
  {
639
639
  "filename": "presets/reasoning/OpenAI Harmony.json",
640
640
  "type": "reasoning"
641
+ },
642
+ {
643
+ "filename": "presets/reasoning/Think XML.json",
644
+ "type": "reasoning"
645
+ },
646
+ {
647
+ "filename": "presets/reasoning/Gemma 4.json",
648
+ "type": "reasoning"
649
+ },
650
+ {
651
+ "filename": "presets/instruct/Gemma 4.json",
652
+ "type": "instruct"
653
+ },
654
+ {
655
+ "filename": "presets/context/Gemma 4.json",
656
+ "type": "context"
657
+ },
658
+ {
659
+ "filename": "user.css",
660
+ "type": "stylesheet"
661
+ },
662
+ {
663
+ "filename": "errors/forbidden-by-whitelist.html",
664
+ "type": "error_page"
665
+ },
666
+ {
667
+ "filename": "errors/host-not-allowed.html",
668
+ "type": "error_page"
669
+ },
670
+ {
671
+ "filename": "errors/unauthorized.html",
672
+ "type": "error_page"
673
+ },
674
+ {
675
+ "filename": "errors/url-not-found.html",
676
+ "type": "error_page"
641
677
  }
642
678
  ]
@@ -0,0 +1,14 @@
1
+ {
2
+ "story_string": "{{#if anchorBefore}}{{anchorBefore}}\n{{/if}}{{#if system}}{{system}}\n{{/if}}{{#if wiBefore}}{{wiBefore}}\n{{/if}}{{#if description}}{{description}}\n{{/if}}{{#if personality}}{{personality}}\n{{/if}}{{#if scenario}}{{scenario}}\n{{/if}}{{#if wiAfter}}{{wiAfter}}\n{{/if}}{{#if persona}}{{persona}}\n{{/if}}{{#if anchorAfter}}{{anchorAfter}}\n{{/if}}{{trim}}",
3
+ "example_separator": "",
4
+ "chat_start": "",
5
+ "use_stop_strings": false,
6
+ "names_as_stop_strings": true,
7
+ "story_string_position": 0,
8
+ "story_string_depth": 1,
9
+ "story_string_role": 0,
10
+ "always_force_name2": true,
11
+ "trim_sentences": false,
12
+ "single_line": false,
13
+ "name": "Gemma 4"
14
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "input_sequence": "<|turn>user\n",
3
+ "output_sequence": "<|turn>model\n",
4
+ "last_output_sequence": "",
5
+ "system_sequence": "<|turn>system\n",
6
+ "stop_sequence": "<turn|>",
7
+ "wrap": false,
8
+ "macro": true,
9
+ "names_behavior": "force",
10
+ "activation_regex": "",
11
+ "first_output_sequence": "",
12
+ "skip_examples": false,
13
+ "output_suffix": "<turn|>\n",
14
+ "input_suffix": "<turn|>\n",
15
+ "system_suffix": "<turn|>\n",
16
+ "user_alignment_message": "",
17
+ "system_same_as_user": false,
18
+ "last_system_sequence": "",
19
+ "first_input_sequence": "",
20
+ "last_input_sequence": "",
21
+ "sequences_as_stop_strings": true,
22
+ "story_string_prefix": "<|turn>system\n",
23
+ "story_string_suffix": "<turn|>\n",
24
+ "name": "Gemma 4"
25
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "input_sequence": "{{[INPUT]}}",
3
- "output_sequence": "{{[OUPUT]}}",
3
+ "output_sequence": "{{[OUTPUT]}}",
4
4
  "last_output_sequence": "",
5
5
  "system_sequence": "{{[SYSTEM]}}",
6
6
  "stop_sequence": "",
@@ -10,6 +10,8 @@
10
10
  "mistralai_model": "mistral-large-latest",
11
11
  "chutes_model": "deepseek-ai/DeepSeek-V3-0324",
12
12
  "chutes_sort_models": "alphabetically",
13
+ "minimax_model": "MiniMax-M2.7",
14
+ "minimax_endpoint": "global",
13
15
  "electronhub_model": "gpt-4o-mini",
14
16
  "electronhub_sort_models": "alphabetically",
15
17
  "electronhub_group_models": false,
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "Gemma 4",
3
+ "prefix": "<|channel>thought\n",
4
+ "suffix": "<channel|>",
5
+ "separator": "\n\n"
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "Think XML",
3
+ "prefix": "<think>",
4
+ "suffix": "</think>",
5
+ "separator": "\n"
6
+ }
@@ -191,7 +191,7 @@
191
191
  "custom_stopping_strings_macro": true,
192
192
  "fuzzy_search": true,
193
193
  "encode_tags": false,
194
- "experimental_macro_engine": false,
194
+ "experimental_macro_engine": true,
195
195
  "enableLabMode": false,
196
196
  "enableZenSliders": false,
197
197
  "ui_mode": 1,
@@ -1,6 +1,6 @@
1
1
  #!/bin/sh
2
2
 
3
- # Function to handle startup logic (Config check + Postinstall + Start)
3
+ # Function to handle startup logic (Config check + init + Start)
4
4
  start_sillytavern() {
5
5
  local PREFIX="$1"
6
6
  shift # Remove the first argument (PREFIX) so $@ contains the rest
@@ -11,8 +11,8 @@ start_sillytavern() {
11
11
  $PREFIX cp "default/config.yaml" "config/config.yaml"
12
12
  fi
13
13
 
14
- # Execute postinstall to auto-populate config.yaml with missing values
15
- $PREFIX npm run postinstall
14
+ # Execute init script to auto-populate config.yaml with missing values
15
+ $PREFIX npm run init
16
16
 
17
17
  # Start the server
18
18
  exec $PREFIX node server.js --listen "$@"
package/index.d.ts CHANGED
@@ -40,7 +40,11 @@ declare global {
40
40
  /**
41
41
  * Authenticated user handle.
42
42
  */
43
- handle: string;
43
+ handle: string | null;
44
+ /**
45
+ * Account version tag: shake256 derivative of password hash and salt.
46
+ */
47
+ version: string | null;
44
48
  /**
45
49
  * Last time the session was extended.
46
50
  */
package/package.json CHANGED
@@ -29,13 +29,14 @@
29
29
  "@mozilla/readability": "^0.6.0",
30
30
  "@popperjs/core": "^2.11.8",
31
31
  "@zeldafan0225/ai_horde": "^5.2.0",
32
+ "agent-base": "^7.1.3",
32
33
  "archiver": "^7.0.1",
33
34
  "bing-translate-api": "^4.1.0",
34
35
  "body-parser": "^1.20.2",
35
36
  "bowser": "^2.12.1",
36
37
  "bytes": "^3.1.2",
37
38
  "chalk": "^5.6.0",
38
- "chevrotain": "^11.1.1",
39
+ "chevrotain": "^11.2.0",
39
40
  "command-exists": "^1.2.9",
40
41
  "compression": "^1.8.1",
41
42
  "cookie-parser": "^1.4.6",
@@ -44,14 +45,15 @@
44
45
  "crc": "^4.3.2",
45
46
  "csrf-sync": "^4.2.1",
46
47
  "diff-match-patch": "^1.0.5",
47
- "dompurify": "^3.2.6",
48
+ "dompurify": "^3.4.2",
48
49
  "droll": "^0.2.1",
49
50
  "env-paths": "^3.0.0",
50
51
  "express": "^4.21.0",
52
+ "fflate": "^0.8.2",
51
53
  "form-data": "^4.0.4",
52
54
  "fuse.js": "^7.1.0",
53
55
  "google-translate-api-x": "^10.7.2",
54
- "handlebars": "^4.7.8",
56
+ "handlebars": "^4.7.9",
55
57
  "helmet": "^8.1.0",
56
58
  "highlight.js": "^11.11.1",
57
59
  "host-validation-middleware": "^0.1.1",
@@ -62,12 +64,14 @@
62
64
  "ip-regex": "^5.0.0",
63
65
  "ipaddr.js": "^2.2.0",
64
66
  "is-docker": "^3.0.0",
67
+ "isomorphic-git": "^1.36.3",
68
+ "js-sha256": "^0.11.1",
65
69
  "localforage": "^1.10.0",
66
- "lodash": "^4.17.21",
70
+ "lodash": "^4.18.1",
67
71
  "mime-types": "^3.0.2",
68
72
  "moment": "^2.30.1",
69
73
  "morphdom": "^2.7.7",
70
- "multer": "^2.0.2",
74
+ "multer": "^2.1.1",
71
75
  "node-fetch": "^3.3.2",
72
76
  "node-persist": "^4.0.4",
73
77
  "open": "^10.2.0",
@@ -80,21 +84,21 @@
80
84
  "seedrandom": "^3.0.5",
81
85
  "showdown": "^2.1.0",
82
86
  "sillytavern-transformers": "2.14.6",
83
- "simple-git": "^3.28.0",
87
+ "simple-git": "^3.33.0",
84
88
  "slidetoggle": "^4.0.0",
85
89
  "tiktoken": "^1.0.22",
86
90
  "url-join": "^5.0.0",
87
91
  "vectra": "^0.2.2",
88
92
  "wavefile": "^11.0.0",
89
- "webpack": "^5.98.0",
93
+ "webpack": "^5.105.4",
90
94
  "write-file-atomic": "^5.0.1",
91
95
  "ws": "^8.18.3",
92
- "yaml": "^2.8.1",
96
+ "yaml": "^2.8.3",
93
97
  "yargs": "^17.7.1",
94
- "yauzl": "^3.2.0"
98
+ "yauzl": "^3.2.1"
95
99
  },
96
100
  "engines": {
97
- "node": ">= 18"
101
+ "node": ">= 20"
98
102
  },
99
103
  "overrides": {
100
104
  "vectra": {
@@ -111,8 +115,9 @@
111
115
  "type": "git",
112
116
  "url": "https://github.com/SillyTavern/SillyTavern.git"
113
117
  },
114
- "version": "1.16.0",
118
+ "version": "1.18.0",
115
119
  "scripts": {
120
+ "init": "node src/server-init.js",
116
121
  "start": "node server.js",
117
122
  "debug": "node --inspect server.js",
118
123
  "start:global": "node server.js --global",
@@ -120,7 +125,6 @@
120
125
  "start:deno": "deno run --allow-run --allow-net --allow-read --allow-write --allow-sys --allow-env server.js",
121
126
  "start:bun": "bun server.js",
122
127
  "start:no-csrf": "node server.js --disableCsrf",
123
- "postinstall": "node post-install.js",
124
128
  "lint": "eslint \"src/**/*.js\" \"public/**/*.js\" ./*.js",
125
129
  "lint:fix": "eslint \"src/**/*.js\" \"public/**/*.js\" ./*.js --fix",
126
130
  "plugins:update": "node plugins update",
@@ -135,7 +139,7 @@
135
139
  },
136
140
  "main": "server.js",
137
141
  "devDependencies": {
138
- "@chevrotain/types": "^11.0.3",
142
+ "@chevrotain/types": "^11.2.0",
139
143
  "@types/archiver": "^6.0.3",
140
144
  "@types/bytes": "^3.1.5",
141
145
  "@types/command-exists": "^1.2.3",
@@ -149,9 +153,9 @@
149
153
  "@types/jquery-cropper": "^1.0.4",
150
154
  "@types/jquery.transit": "^0.9.33",
151
155
  "@types/jqueryui": "^1.12.24",
152
- "@types/lodash": "^4.17.20",
156
+ "@types/lodash": "^4.17.24",
153
157
  "@types/mime-types": "^3.0.1",
154
- "@types/multer": "^2.0.0",
158
+ "@types/multer": "^2.1.0",
155
159
  "@types/node": "^18.19.84",
156
160
  "@types/node-persist": "^3.1.8",
157
161
  "@types/png-chunk-text": "^1.0.3",
@@ -165,6 +169,7 @@
165
169
  "eslint": "^8.57.1",
166
170
  "eslint-plugin-jest": "^27.9.0",
167
171
  "eslint-plugin-jsdoc": "^48.10.0",
168
- "eslint-plugin-playwright": "^2.3.0"
172
+ "eslint-plugin-playwright": "^2.3.0",
173
+ "typescript": "^5.9.3"
169
174
  }
170
175
  }
package/plugins.js CHANGED
@@ -9,11 +9,13 @@ import process from 'node:process';
9
9
  import { fileURLToPath } from 'node:url';
10
10
 
11
11
  import { default as git, CheckRepoActions } from 'simple-git';
12
+ import { createGitClient } from './src/git/client.js';
12
13
  import { color } from './src/util.js';
13
14
 
14
15
  const __dirname = import.meta.dirname ?? path.dirname(fileURLToPath(import.meta.url));
15
16
  process.chdir(__dirname);
16
17
  const pluginsPath = './plugins';
18
+ const gitBackend = process.env.SILLYTAVERN_GIT_BACKEND || 'auto';
17
19
 
18
20
  const command = process.argv[2];
19
21
 
@@ -87,10 +89,9 @@ async function installPlugin(pluginName) {
87
89
  return console.log(color.yellow(`Directory already exists at ${pluginPath}`));
88
90
  }
89
91
 
90
- await git().clone(pluginName, pluginPath, { '--depth': 1 });
92
+ await createGitClient({ backend: gitBackend }).clone(pluginName, pluginPath, { depth: 1 });
91
93
  console.log(`Plugin ${color.green(pluginName)} installed to ${color.cyan(pluginPath)}`);
92
- }
93
- catch (error) {
94
+ } catch (error) {
94
95
  console.error(color.red(`Failed to install plugin ${pluginName}`), error);
95
96
  }
96
97
  }
@@ -0,0 +1,7 @@
1
+ # Looking for user.css?
2
+
3
+ user.css is now located under your data root directory in the "_css" folder.
4
+
5
+ Example for the default data root:
6
+
7
+ /data/_css/user.css