sillytavern 1.12.0 → 1.12.1

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 (125) hide show
  1. package/.github/readme.md +40 -0
  2. package/.github/workflows/docker-publish.yml +7 -9
  3. package/.github/workflows/update-i18n.yaml +33 -0
  4. package/docker/docker-compose.yml +1 -0
  5. package/package.json +7 -5
  6. package/public/css/mobile-styles.css +5 -0
  7. package/public/css/promptmanager.css +1 -1
  8. package/public/css/select2-overrides.css +10 -0
  9. package/public/css/st-tailwind.css +20 -0
  10. package/public/css/world-info.css +5 -0
  11. package/public/global.d.ts +41 -0
  12. package/public/index.html +393 -322
  13. package/public/lib/eventemitter.js +2 -2
  14. package/public/locales/ar-sa.json +1236 -700
  15. package/public/locales/de-de.json +1236 -700
  16. package/public/locales/es-es.json +1236 -697
  17. package/public/locales/fr-fr.json +1236 -697
  18. package/public/locales/is-is.json +1236 -698
  19. package/public/locales/it-it.json +1236 -700
  20. package/public/locales/ja-jp.json +1236 -697
  21. package/public/locales/ko-kr.json +1227 -713
  22. package/public/locales/nl-nl.json +1236 -700
  23. package/public/locales/pt-pt.json +1236 -698
  24. package/public/locales/ru-ru.json +1225 -948
  25. package/public/locales/uk-ua.json +1236 -697
  26. package/public/locales/vi-vn.json +1236 -698
  27. package/public/locales/zh-cn.json +1240 -699
  28. package/public/locales/zh-tw.json +1409 -1143
  29. package/public/script.js +277 -155
  30. package/public/scripts/BulkEditOverlay.js +2 -19
  31. package/public/scripts/PromptManager.js +21 -66
  32. package/public/scripts/RossAscends-mods.js +88 -97
  33. package/public/scripts/bookmarks.js +2 -0
  34. package/public/scripts/char-data.js +19 -0
  35. package/public/scripts/chats.js +126 -37
  36. package/public/scripts/extensions/assets/market.html +2 -2
  37. package/public/scripts/extensions/attachments/index.js +288 -2
  38. package/public/scripts/extensions/attachments/manager.html +23 -2
  39. package/public/scripts/extensions/attachments/style.css +24 -0
  40. package/public/scripts/extensions/caption/index.js +7 -97
  41. package/public/scripts/extensions/caption/settings.html +90 -0
  42. package/public/scripts/extensions/expressions/index.js +68 -6
  43. package/public/scripts/extensions/expressions/settings.html +1 -1
  44. package/public/scripts/extensions/memory/index.js +1 -0
  45. package/public/scripts/extensions/quick-reply/src/ui/SettingsUi.js +1 -0
  46. package/public/scripts/extensions/regex/dropdown.html +35 -7
  47. package/public/scripts/extensions/regex/editor.html +1 -1
  48. package/public/scripts/extensions/regex/embeddedScripts.html +5 -0
  49. package/public/scripts/extensions/regex/engine.js +20 -3
  50. package/public/scripts/extensions/regex/importTarget.html +19 -0
  51. package/public/scripts/extensions/regex/index.js +261 -64
  52. package/public/scripts/extensions/regex/scriptTemplate.html +6 -0
  53. package/public/scripts/extensions/regex/style.css +54 -1
  54. package/public/scripts/extensions/shared.js +18 -17
  55. package/public/scripts/extensions/stable-diffusion/button.html +4 -0
  56. package/public/scripts/extensions/stable-diffusion/comfyWorkflowEditor.html +1 -0
  57. package/public/scripts/extensions/stable-diffusion/dropdown.html +12 -0
  58. package/public/scripts/extensions/stable-diffusion/index.js +248 -72
  59. package/public/scripts/extensions/stable-diffusion/settings.html +107 -74
  60. package/public/scripts/extensions/translate/index.js +21 -1
  61. package/public/scripts/extensions/tts/azure.js +207 -0
  62. package/public/scripts/extensions/tts/edge.js +1 -0
  63. package/public/scripts/extensions/tts/gsvi.js +267 -0
  64. package/public/scripts/extensions/tts/index.js +4 -0
  65. package/public/scripts/extensions/tts/novel.js +1 -0
  66. package/public/scripts/extensions/tts/speecht5.js +1 -0
  67. package/public/scripts/extensions/vectors/index.js +247 -45
  68. package/public/scripts/extensions/vectors/settings.html +55 -12
  69. package/public/scripts/extensions.js +2 -0
  70. package/public/scripts/group-chats.js +12 -5
  71. package/public/scripts/i18n.js +4 -3
  72. package/public/scripts/macros.js +5 -2
  73. package/public/scripts/openai.js +168 -5
  74. package/public/scripts/personas.js +77 -18
  75. package/public/scripts/popup.js +8 -7
  76. package/public/scripts/power-user.js +111 -21
  77. package/public/scripts/scrapers.js +51 -6
  78. package/public/scripts/secrets.js +1 -0
  79. package/public/scripts/slash-commands/SlashCommand.js +6 -1
  80. package/public/scripts/slash-commands/SlashCommandArgument.js +2 -2
  81. package/public/scripts/slash-commands/SlashCommandParser.js +1 -1
  82. package/public/scripts/slash-commands.js +225 -85
  83. package/public/scripts/tags.js +21 -6
  84. package/public/scripts/templates/formatting.html +1 -0
  85. package/public/scripts/templates/importCharacters.html +22 -0
  86. package/public/scripts/templates/promptManagerExportForCharacter.html +4 -0
  87. package/public/scripts/templates/promptManagerExportPopup.html +12 -0
  88. package/public/scripts/templates/promptManagerFooter.html +11 -0
  89. package/public/scripts/templates/promptManagerHeader.html +12 -0
  90. package/public/scripts/templates/promptManagerListHeader.html +8 -0
  91. package/public/scripts/templates/snapshotsView.html +2 -2
  92. package/public/scripts/templates/userProfile.html +14 -14
  93. package/public/scripts/templates/welcome.html +14 -2
  94. package/public/scripts/textgen-settings.js +38 -0
  95. package/public/scripts/tokenizers.js +1 -1
  96. package/public/scripts/utils.js +138 -25
  97. package/public/scripts/variables.js +12 -13
  98. package/public/scripts/world-info.js +90 -51
  99. package/public/style.css +409 -137
  100. package/server.js +3 -0
  101. package/src/additional-headers.js +16 -4
  102. package/src/character-card-parser.js +21 -13
  103. package/src/constants.js +1 -0
  104. package/src/endpoints/azure.js +92 -0
  105. package/src/endpoints/backends/chat-completions.js +52 -8
  106. package/src/endpoints/backends/kobold.js +55 -2
  107. package/src/endpoints/characters.js +40 -3
  108. package/src/endpoints/chats.js +7 -10
  109. package/src/endpoints/content-manager.js +43 -0
  110. package/src/endpoints/files.js +16 -0
  111. package/src/endpoints/google.js +7 -3
  112. package/src/endpoints/groups.js +2 -2
  113. package/src/endpoints/horde.js +13 -12
  114. package/src/endpoints/novelai.js +2 -2
  115. package/src/endpoints/secrets.js +1 -0
  116. package/src/endpoints/settings.js +6 -10
  117. package/src/endpoints/stable-diffusion.js +47 -3
  118. package/src/endpoints/tokenizers.js +11 -2
  119. package/src/endpoints/vectors.js +85 -18
  120. package/src/prompt-converters.js +79 -2
  121. package/src/users.js +1 -0
  122. package/src/util.js +7 -7
  123. package/src/validator/TavernCardValidator.js +52 -8
  124. package/src/vectors/llamacpp-vectors.js +61 -0
  125. package/src/vectors/ollama-vectors.js +69 -0
package/.github/readme.md CHANGED
@@ -196,6 +196,45 @@ For MacOS / Linux all of these will be done in a Terminal.
196
196
  5. Start the install launcher with: `chmod +x install.sh && ./install.sh` and choose what you wanna install
197
197
  6. After installation start the launcher with: `chmod +x launcher.sh && ./launcher.sh`
198
198
 
199
+ ## 🐋 Installing via Docker
200
+
201
+ These instructions assume you have installed Docker, are able to access your command line for the installation of containers, and familiar with their general operation.
202
+
203
+ ### Building the image yourself
204
+
205
+ We have a comprehensive guide on using SillyTavern in Docker [here](http://docs.sillytavern.app/installation/docker/) which covers installations on Windows, macOS and Linux! Give it a read if you wish to build the image yourself.
206
+
207
+ ### Using the GitHub Container Registry (easiest)
208
+
209
+ You will need two mandatory directory mappings and a port mapping to allow SillyTavern to function. In the command, replace your selections in the following places:
210
+
211
+ #### Container Variables
212
+
213
+ ##### Volume Mappings
214
+
215
+ - [config] - The directory where SillyTavern configuration files will be stored on your host machine
216
+ - [data] - The directory where SillyTavern user data (including characters) will be stored on your host machine
217
+ - [plugins] - (optional) The directory where SillyTavern server plugins will be stored on your host machine
218
+
219
+ ##### Port Mappings
220
+
221
+ - [PublicPort] - The port to expose the traffic on. This is mandatory, as you will be accessing the instance from outside of its virtual machine container. DO NOT expose this to the internet without implementing a separate service for security.
222
+
223
+ ##### Additional Settings
224
+
225
+ - [TimeZone] - The timezone your instance should use. This is useful for making logs match your local time for easier troubleshooting. Use your TZ Identifier. (https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)
226
+ - [DockerNet] - The docker network that the container should be created with a connection to. If you don't know what it is, see the [official Docker documentation](https://docs.docker.com/reference/cli/docker/network/).
227
+ - [version] - On the right-hand side of this GitHub page, you'll see "Packages". Select the "sillytavern" package and you'll see the image versions. The image tag "latest" will keep you up-to-date with the current release. You can also utilize "staging" and "release" tags that point to the nightly images of the respective branches, but this may not be appropriate, if you are utilizing extensions that could be broken, and may need time to update.
228
+
229
+ #### Install command
230
+
231
+ 1. Open your Command Line
232
+ 2. Run the following command
233
+
234
+ `docker create --name='sillytavern' --net='[DockerNet]' -e TZ="[TimeZone]" -p '8000:8000/tcp' -v '[plugins]':'/home/node/app/plugins':'rw' -v '[config]':'/home/node/app/config':'rw' -v '[data]':'/home/node/app/data':'rw' 'ghcr.io/sillytavern/sillytavern:[version]'`
235
+
236
+ > Note that 8000 is a default listening port. Don't forget to use an appropriate port if you change it in the config.
237
+
199
238
  ## 📱 Mobile - Installing via termux
200
239
 
201
240
  > \[!NOTE]
@@ -347,6 +386,7 @@ GNU Affero General Public License for more details.**
347
386
  * Korean translation by @doloroushyeonse
348
387
  * k_euler_a support for Horde by <https://github.com/Teashrock>
349
388
  * Chinese translation by [@XXpE3](https://github.com/XXpE3), 中文 ISSUES 可以联系 @XXpE3
389
+ * Docker guide by [@mrguymiah](https://github.com/mrguymiah) and [@Bronya-Rand](https://github.com/Bronya-Rand)
350
390
 
351
391
  <!-- LINK GROUP -->
352
392
  [back-to-top]: https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square
@@ -30,7 +30,7 @@ jobs:
30
30
  run: |
31
31
  echo "IMAGE_NAME=${REPO,,}" >> ${GITHUB_ENV}
32
32
 
33
- # Using the following workaround because currently GitHub Actions
33
+ # Using the following workaround because currently GitHub Actions
34
34
  # does not support logical AND/OR operations on triggers
35
35
  # It's currently not possible to have `branches` under the `schedule` trigger
36
36
  - name: Checkout the release branch (on release)
@@ -65,7 +65,12 @@ jobs:
65
65
  id: metadata
66
66
  with:
67
67
  images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
68
- tags: ${{ env.BRANCH_NAME }}
68
+ # Release version tag if the workflow is triggered by a release
69
+ # Branch name tag if the workflow is triggered by a push
70
+ # Latest tag if the branch is release and the workflow is triggered by a push
71
+ tags: |
72
+ ${{ github.event_name == 'release' && github.ref_name || env.BRANCH_NAME }}
73
+ ${{ github.event_name == 'push' && env.BRANCH_NAME == 'release' && 'latest' || '' }}
69
74
 
70
75
  # Login into package repository as the person who created the release
71
76
  - name: Log in to the Container registry
@@ -87,10 +92,3 @@ jobs:
87
92
  push: true
88
93
  tags: ${{ steps.metadata.outputs.tags }}
89
94
  labels: ${{ steps.metadata.outputs.labels }}
90
-
91
- # If the workflow is triggered by a release, marks and push the image as such
92
- - name: Docker tag latest and push
93
- if: ${{ github.event_name == 'release' }}
94
- run: |
95
- docker tag $IMAGE_NAME:${{ github.ref_name }} $IMAGE_NAME:latest
96
- docker push $IMAGE_NAME:latest
@@ -0,0 +1,33 @@
1
+ name: Update i18n data
2
+
3
+ on:
4
+ workflow_dispatch:
5
+
6
+ jobs:
7
+ build:
8
+ runs-on: ubuntu-latest
9
+ permissions: # Job-level permissions configuration starts here
10
+ contents: write # 'write' access to repository contents
11
+ steps:
12
+ - name: disable auto crlf
13
+ uses: steve02081504/disable-autocrlf@v1
14
+ - uses: actions/checkout@v4
15
+ with:
16
+ ref: ${{ github.head_ref }}
17
+ fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
18
+ - name: Create local changes
19
+ run: |
20
+ aria2c https://raw.githubusercontent.com/SillyTavern/SillyTavern-i18n/main/generate.py
21
+ aria2c https://raw.githubusercontent.com/SillyTavern/SillyTavern-i18n/main/requirements.txt
22
+ pip install -r ./requirements.txt
23
+ python ./generate.py "" --sort-keys
24
+ rm -f ./generate.py ./requirements.txt
25
+ - name: add all
26
+ run: git add -A
27
+ - name: push
28
+ uses: actions-go/push@master
29
+ with:
30
+ author-email: 41898282+github-actions[bot]@users.noreply.github.com
31
+ author-name: github-actions[bot]
32
+ commit-message: 'i18n changes'
33
+ remote: origin
@@ -10,4 +10,5 @@ services:
10
10
  volumes:
11
11
  - "./config:/home/node/app/config"
12
12
  - "./data:/home/node/app/data"
13
+ - "./plugins:/home/node/app/plugins"
13
14
  restart: unless-stopped
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "dependencies": {
3
3
  "@agnai/sentencepiece-js": "^1.1.1",
4
4
  "@agnai/web-tokenizers": "^0.1.3",
5
- "@zeldafan0225/ai_horde": "^4.0.1",
5
+ "@zeldafan0225/ai_horde": "^5.1.0",
6
6
  "archiver": "^7.0.1",
7
7
  "bing-translate-api": "^2.9.1",
8
8
  "body-parser": "^1.20.2",
@@ -15,7 +15,6 @@
15
15
  "express": "^4.19.2",
16
16
  "form-data": "^4.0.0",
17
17
  "google-translate-api-browser": "^3.0.1",
18
- "gpt3-tokenizer": "^1.1.5",
19
18
  "he": "^1.2.0",
20
19
  "helmet": "^7.1.0",
21
20
  "ip-matching": "^2.1.2",
@@ -44,6 +43,9 @@
44
43
  "yargs": "^17.7.1",
45
44
  "yauzl": "^2.10.0"
46
45
  },
46
+ "engines": {
47
+ "node": ">= 18"
48
+ },
47
49
  "overrides": {
48
50
  "parse-bmfont-xml": {
49
51
  "xml2js": "^0.5.0"
@@ -57,8 +59,8 @@
57
59
  "axios": {
58
60
  "follow-redirects": "^1.15.4"
59
61
  },
60
- "@zeldafan0225/ai_horde": {
61
- "esbuild": "npm:dry-uninstall"
62
+ "node-fetch": {
63
+ "whatwg-url": "^14.0.0"
62
64
  }
63
65
  },
64
66
  "name": "sillytavern",
@@ -68,7 +70,7 @@
68
70
  "type": "git",
69
71
  "url": "https://github.com/SillyTavern/SillyTavern.git"
70
72
  },
71
- "version": "1.12.0",
73
+ "version": "1.12.1",
72
74
  "scripts": {
73
75
  "start": "node server.js",
74
76
  "start:no-csrf": "node server.js --disableCsrf",
@@ -117,6 +117,11 @@
117
117
  max-width: unset;
118
118
  }
119
119
 
120
+ #wiActivationSettings,
121
+ #wiTopBlock {
122
+ flex-direction: column;
123
+ }
124
+
120
125
  #top-settings-holder,
121
126
  #top-bar {
122
127
  position: fixed;
@@ -19,7 +19,7 @@
19
19
 
20
20
  #completion_prompt_manager #completion_prompt_manager_list li {
21
21
  display: grid;
22
- grid-template-columns: 4fr 80px 40px;
22
+ grid-template-columns: 4fr 80px 45px;
23
23
  margin-bottom: 0.5em;
24
24
  width: 100%
25
25
  }
@@ -199,6 +199,8 @@ span.select2.select2-container .select2-selection__choice__remove:hover {
199
199
  transition: background-color 0.3s;
200
200
  color: var(--SmartThemeBodyColor);
201
201
  background-color: var(--black50a);
202
+ white-space: break-spaces;
203
+ word-break: break-all;
202
204
  }
203
205
 
204
206
  .select2_choice_clickable_buttonstyle+span.select2-container .select2-selection__choice__display:hover {
@@ -218,6 +220,14 @@ span.select2.select2-container .select2-selection__choice__remove:hover {
218
220
  /* Fix weird styling choice or huge margin around selected options */
219
221
  margin-block-start: 2px;
220
222
  margin-block-end: 2px;
223
+ display: flex;
224
+ align-items: center;
225
+ flex-wrap: wrap;
226
+ row-gap: 5px;
227
+ }
228
+
229
+ .select2_multi_sameline+span.select2-container .select2-selection--multiple .select2-selection__choice {
230
+ margin-top: 0px;
221
231
  }
222
232
 
223
233
  .select2_multi_sameline+span.select2-container .select2-selection--multiple .select2-search__field {
@@ -572,3 +572,23 @@ textarea:disabled {
572
572
  text-align: center;
573
573
  padding: 5px;
574
574
  }
575
+
576
+ ul.li-padding-b-1 li {
577
+ padding-bottom: 1em;
578
+ }
579
+
580
+ ul.li-padding-b-2 li {
581
+ padding-bottom: 2em;
582
+ }
583
+
584
+ ul.li-padding-b-5 li {
585
+ padding-bottom: 5em;
586
+ }
587
+
588
+ ul.li-padding-bot5 li {
589
+ padding-bottom: 5px;
590
+ }
591
+
592
+ ul.li-padding-bot10 li {
593
+ padding-bottom: 10px;
594
+ }
@@ -257,3 +257,8 @@ select.keyselect+span.select2-container .select2-selection--multiple {
257
257
  .switch_input_type_icon:hover {
258
258
  opacity: 1;
259
259
  }
260
+
261
+ #wiCheckboxes {
262
+ align-self: center;
263
+ width: 100%;
264
+ }
@@ -1358,3 +1358,44 @@ declare namespace moment {
1358
1358
  declare global {
1359
1359
  const moment: typeof moment;
1360
1360
  }
1361
+
1362
+ /**
1363
+ * Callback data for the `LLM_FUNCTION_TOOL_REGISTER` event type that is triggered when a function tool can be registered.
1364
+ */
1365
+ interface FunctionToolRegister {
1366
+ /**
1367
+ * The type of generation that is being used
1368
+ */
1369
+ type?: string;
1370
+ /**
1371
+ * Generation data, including messages and sampling parameters
1372
+ */
1373
+ data: Record<string, object>;
1374
+ /**
1375
+ * Callback to register an LLM function tool.
1376
+ */
1377
+ registerFunctionTool: typeof registerFunctionTool;
1378
+ }
1379
+
1380
+ /**
1381
+ * Callback data for the `LLM_FUNCTION_TOOL_REGISTER` event type that is triggered when a function tool is registered.
1382
+ * @param name Name of the function tool to register
1383
+ * @param description Description of the function tool
1384
+ * @param params JSON schema for the parameters of the function tool
1385
+ * @param required Whether the function tool should be forced to be used
1386
+ */
1387
+ declare function registerFunctionTool(name: string, description: string, params: object, required: boolean): Promise<void>;
1388
+
1389
+ /**
1390
+ * Callback data for the `LLM_FUNCTION_TOOL_CALL` event type that is triggered when a function tool is called.
1391
+ */
1392
+ interface FunctionToolCall {
1393
+ /**
1394
+ * Name of the function tool to call
1395
+ */
1396
+ name: string;
1397
+ /**
1398
+ * JSON object with the parameters to pass to the function tool
1399
+ */
1400
+ arguments: string;
1401
+ }