Merge pull request #3728 from SillyTavern/actions/eslint-checker Add ESLint PR check action

ec98746ac6fb64666b8112fd16dba74fa46fcadc

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

Signed
38 files changed, +350 -151Ignore whitespace
.eslintrc.cjs+4 -0
@@ -3,6 +3,9 @@ module.exports = {
33 extends: [
44 'eslint:recommended',
55 ],
6+ plugins: [
7+ 'jsdoc',
8+ ],
69 env: {
710 es6: true,
811 },
@@ -78,6 +81,7 @@ module.exports = {
7881 'public/scripts/extensions/tts/lib/**',
7982 ],
8083 rules: {
84+ 'jsdoc/no-undefined-types': ['warn', { disableReporting: true, markVariablesAsUsed: true }],
8185 'no-unused-vars': ['error', { args: 'none' }],
8286 'no-control-regex': 'off',
8387 'no-constant-condition': ['error', { checkLoops: false }],
.github/workflows/pr-auto-manager.yml+35 -0
@@ -11,6 +11,41 @@ permissions:
1111 pull-requests: write
1212
1313jobs:
14+ run-eslint:
15+ name: ✅ Check ESLint on PR
16+ runs-on: ubuntu-latest
17+ # Only needs to run when code is changed
18+ if: github.event.action == 'opened' || github.event.action == 'synchronize'
19+
20+ steps:
21+ - name: Checkout Repository
22+ # Checkout
23+ # https://github.com/marketplace/actions/checkout
24+ uses: actions/checkout@v4.2.2
25+
26+ - name: Setup Node.js
27+ # Setup Node.js environment
28+ # https://github.com/marketplace/actions/setup-node-js-environment
29+ uses: actions/setup-node@v4.3.0
30+ with:
31+ node-version: 20
32+
33+ - name: Run npm install
34+ run: npm ci
35+
36+ - name: Run ESLint
37+ # Action ESLint
38+ # https://github.com/marketplace/actions/action-eslint
39+ uses: sibiraj-s/action-eslint@v3.0.1
40+ with:
41+ token: ${{ secrets.GITHUB_TOKEN }}
42+ eslint-args: '--ignore-path=.gitignore --quiet'
43+ extensions: 'js,ts'
44+ annotations: true
45+ ignore-patterns: |
46+ dist/
47+ lib/
48+
1449 label-by-size:
1550 name: 🏷️ Label PR by Size
1651 # This job should run after all others, to prevent possible concurrency issues
package-lock.json+202 -4
@@ -110,7 +110,8 @@
110110 "@types/write-file-atomic": "^4.0.3",
111111 "@types/yargs": "^17.0.33",
112112 "@types/yauzl": "^2.10.3",
113113 "eslint": "^8.57.1",
114+ "eslint-plugin-jsdoc": "^48.10.0"
114115 },
115116 "engines": {
116117 "node": ">= 18"
@@ -147,6 +148,21 @@
147148 "integrity": "sha512-KlmTftToTtmb6aLVdne4NluS+POWputPF5J8v25UN/EQS+K9vahWEIe1NPRSFqBQclObkqHaj7JOnFrmnSm5MA==",
148149 "license": "Apache-2.0"
149150 },
151+ "node_modules/@es-joy/jsdoccomment": {
152+ "version": "0.46.0",
153+ "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.46.0.tgz",
154+ "integrity": "sha512-C3Axuq1xd/9VqFZpW4YAzOx5O9q/LP46uIQy/iNDpHG3fmPa6TBtvfglMCs3RBiBxAIi0Go97r8+jvTt55XMyQ==",
155+ "dev": true,
156+ "license": "MIT",
157+ "dependencies": {
158+ "comment-parser": "1.4.1",
159+ "esquery": "^1.6.0",
160+ "jsdoc-type-pratt-parser": "~4.0.0"
161+ },
162+ "engines": {
163+ "node": ">=16"
164+ }
165+ },
150166 "node_modules/@eslint-community/eslint-utils": {
151167 "version": "4.4.0",
152168 "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz",
@@ -970,6 +986,19 @@
970986 "node": ">=14"
971987 }
972988 },
989+ "node_modules/@pkgr/core": {
990+ "version": "0.1.1",
991+ "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.1.1.tgz",
992+ "integrity": "sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==",
993+ "dev": true,
994+ "license": "MIT",
995+ "engines": {
996+ "node": "^12.20.0 || ^14.18.0 || >=16.0.0"
997+ },
998+ "funding": {
999+ "url": "https://opencollective.com/unts"
1000+ }
1001+ },
9731002 "node_modules/@popperjs/core": {
9741003 "version": "2.11.8",
9751004 "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz",
@@ -2099,6 +2128,16 @@
20992128 "safe-buffer": "~5.2.0"
21002129 }
21012130 },
2131+ "node_modules/are-docs-informative": {
2132+ "version": "0.0.2",
2133+ "resolved": "https://registry.npmjs.org/are-docs-informative/-/are-docs-informative-0.0.2.tgz",
2134+ "integrity": "sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig==",
2135+ "dev": true,
2136+ "license": "MIT",
2137+ "engines": {
2138+ "node": ">=14"
2139+ }
2140+ },
21022141 "node_modules/argparse": {
21032142 "version": "2.0.1",
21042143 "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
@@ -2614,6 +2653,16 @@
26142653 "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
26152654 "license": "MIT"
26162655 },
2656+ "node_modules/comment-parser": {
2657+ "version": "1.4.1",
2658+ "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.4.1.tgz",
2659+ "integrity": "sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg==",
2660+ "dev": true,
2661+ "license": "MIT",
2662+ "engines": {
2663+ "node": ">= 12.0.0"
2664+ }
2665+ },
26172666 "node_modules/compress-commons": {
26182667 "version": "6.0.2",
26192668 "resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-6.0.2.tgz",
@@ -3560,6 +3609,69 @@
35603609 "url": "https://opencollective.com/eslint"
35613610 }
35623611 },
3612+ "node_modules/eslint-plugin-jsdoc": {
3613+ "version": "48.10.0",
3614+ "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-48.10.0.tgz",
3615+ "integrity": "sha512-BEli0k8E0dzhJairAllwlkGnyYDZVKNn4WDmyKy+v6J5qGNuofjzxwNUi+55BOGmyO9mKBhqaidwGy+dxndn/Q==",
3616+ "dev": true,
3617+ "license": "BSD-3-Clause",
3618+ "dependencies": {
3619+ "@es-joy/jsdoccomment": "~0.46.0",
3620+ "are-docs-informative": "^0.0.2",
3621+ "comment-parser": "1.4.1",
3622+ "debug": "^4.3.5",
3623+ "escape-string-regexp": "^4.0.0",
3624+ "esquery": "^1.6.0",
3625+ "parse-imports": "^2.1.1",
3626+ "semver": "^7.6.3",
3627+ "spdx-expression-parse": "^4.0.0",
3628+ "synckit": "^0.9.1"
3629+ },
3630+ "engines": {
3631+ "node": ">=18"
3632+ },
3633+ "peerDependencies": {
3634+ "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0"
3635+ }
3636+ },
3637+ "node_modules/eslint-plugin-jsdoc/node_modules/debug": {
3638+ "version": "4.4.0",
3639+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz",
3640+ "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==",
3641+ "dev": true,
3642+ "license": "MIT",
3643+ "dependencies": {
3644+ "ms": "^2.1.3"
3645+ },
3646+ "engines": {
3647+ "node": ">=6.0"
3648+ },
3649+ "peerDependenciesMeta": {
3650+ "supports-color": {
3651+ "optional": true
3652+ }
3653+ }
3654+ },
3655+ "node_modules/eslint-plugin-jsdoc/node_modules/escape-string-regexp": {
3656+ "version": "4.0.0",
3657+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
3658+ "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==",
3659+ "dev": true,
3660+ "license": "MIT",
3661+ "engines": {
3662+ "node": ">=10"
3663+ },
3664+ "funding": {
3665+ "url": "https://github.com/sponsors/sindresorhus"
3666+ }
3667+ },
3668+ "node_modules/eslint-plugin-jsdoc/node_modules/ms": {
3669+ "version": "2.1.3",
3670+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
3671+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
3672+ "dev": true,
3673+ "license": "MIT"
3674+ },
35633675 "node_modules/eslint-scope": {
35643676 "version": "7.2.2",
35653677 "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz",
@@ -3690,9 +3802,9 @@
36903802 }
36913803 },
36923804 "node_modules/esquery": {
36933805 "version": "1.56.0",
36943806 "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.56.0.tgz",
36953807 "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idISca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/9fIU5GjG73IgjKMVg5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==",
36963808 "dev": true,
36973809 "license": "BSD-3-Clause",
36983810 "dependencies": {
@@ -5015,6 +5127,16 @@
50155127 "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==",
50165128 "license": "MIT"
50175129 },
5130+ "node_modules/jsdoc-type-pratt-parser": {
5131+ "version": "4.0.0",
5132+ "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-4.0.0.tgz",
5133+ "integrity": "sha512-YtOli5Cmzy3q4dP26GraSOeAhqecewG04hoO8DY56CH4KJ9Fvv5qKWUCCo3HZob7esJQHCv6/+bnTy72xZZaVQ==",
5134+ "dev": true,
5135+ "license": "MIT",
5136+ "engines": {
5137+ "node": ">=12.0.0"
5138+ }
5139+ },
50185140 "node_modules/json-buffer": {
50195141 "version": "3.0.1",
50205142 "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz",
@@ -5891,6 +6013,20 @@
58916013 "integrity": "sha512-ft3iAoLOB/MlwbNXgzy43SWGP6sQki2jQvAyBg/zDFAgr9bfNWZIUj42Kw2eJIl8kEi4PbgE6U1Zau/HwI75HA==",
58926014 "license": "MIT"
58936015 },
6016+ "node_modules/parse-imports": {
6017+ "version": "2.2.1",
6018+ "resolved": "https://registry.npmjs.org/parse-imports/-/parse-imports-2.2.1.tgz",
6019+ "integrity": "sha512-OL/zLggRp8mFhKL0rNORUTR4yBYujK/uU+xZL+/0Rgm2QE4nLO9v8PzEweSJEbMGKmDRjJE4R3IMJlL2di4JeQ==",
6020+ "dev": true,
6021+ "license": "Apache-2.0 AND MIT",
6022+ "dependencies": {
6023+ "es-module-lexer": "^1.5.3",
6024+ "slashes": "^3.0.12"
6025+ },
6026+ "engines": {
6027+ "node": ">= 18"
6028+ }
6029+ },
58946030 "node_modules/parse5": {
58956031 "version": "7.1.2",
58966032 "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz",
@@ -6600,6 +6736,19 @@
66006736 "integrity": "sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg==",
66016737 "license": "MIT"
66026738 },
6739+ "node_modules/semver": {
6740+ "version": "7.7.1",
6741+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz",
6742+ "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==",
6743+ "dev": true,
6744+ "license": "ISC",
6745+ "bin": {
6746+ "semver": "bin/semver.js"
6747+ },
6748+ "engines": {
6749+ "node": ">=10"
6750+ }
6751+ },
66036752 "node_modules/send": {
66046753 "version": "0.19.0",
66056754 "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz",
@@ -6811,6 +6960,13 @@
68116960 "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
68126961 "license": "MIT"
68136962 },
6963+ "node_modules/slashes": {
6964+ "version": "3.0.12",
6965+ "resolved": "https://registry.npmjs.org/slashes/-/slashes-3.0.12.tgz",
6966+ "integrity": "sha512-Q9VME8WyGkc7pJf6QEkj3wE+2CnvZMI+XJhwdTPR8Z/kWQRXi7boAWLDibRPyHRTUTPx5FaU7MsyrjI3yLB4HA==",
6967+ "dev": true,
6968+ "license": "ISC"
6969+ },
68146970 "node_modules/sliced": {
68156971 "version": "1.0.1",
68166972 "resolved": "https://registry.npmjs.org/sliced/-/sliced-1.0.1.tgz",
@@ -6903,6 +7059,31 @@
69037059 "source-map": "^0.6.0"
69047060 }
69057061 },
7062+ "node_modules/spdx-exceptions": {
7063+ "version": "2.5.0",
7064+ "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz",
7065+ "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==",
7066+ "dev": true,
7067+ "license": "CC-BY-3.0"
7068+ },
7069+ "node_modules/spdx-expression-parse": {
7070+ "version": "4.0.0",
7071+ "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-4.0.0.tgz",
7072+ "integrity": "sha512-Clya5JIij/7C6bRR22+tnGXbc4VKlibKSVj2iHvVeX5iMW7s1SIQlqu699JkODJJIhh/pUu8L0/VLh8xflD+LQ==",
7073+ "dev": true,
7074+ "license": "MIT",
7075+ "dependencies": {
7076+ "spdx-exceptions": "^2.1.0",
7077+ "spdx-license-ids": "^3.0.0"
7078+ }
7079+ },
7080+ "node_modules/spdx-license-ids": {
7081+ "version": "3.0.21",
7082+ "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.21.tgz",
7083+ "integrity": "sha512-Bvg/8F5XephndSK3JffaRqdT+gyhfqIPwDHpX80tJrF8QQRYMo8sNMeaZ2Dp5+jhwKnUmIOyFFQfHRkjJm5nXg==",
7084+ "dev": true,
7085+ "license": "CC0-1.0"
7086+ },
69067087 "node_modules/sprintf-js": {
69077088 "version": "1.1.3",
69087089 "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz",
@@ -7042,6 +7223,23 @@
70427223 "node": ">=8"
70437224 }
70447225 },
7226+ "node_modules/synckit": {
7227+ "version": "0.9.2",
7228+ "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.9.2.tgz",
7229+ "integrity": "sha512-vrozgXDQwYO72vHjUb/HnFbQx1exDjoKzqx23aXEg2a9VIg2TSFZ8FmeZpTjUCFMYw7mpX4BE2SFu8wI7asYsw==",
7230+ "dev": true,
7231+ "license": "MIT",
7232+ "dependencies": {
7233+ "@pkgr/core": "^0.1.0",
7234+ "tslib": "^2.6.2"
7235+ },
7236+ "engines": {
7237+ "node": "^14.18.0 || >=16.0.0"
7238+ },
7239+ "funding": {
7240+ "url": "https://opencollective.com/unts"
7241+ }
7242+ },
70457243 "node_modules/tapable": {
70467244 "version": "2.2.1",
70477245 "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz",
package.json+2 -1
@@ -140,6 +140,7 @@
140140 "@types/write-file-atomic": "^4.0.3",
141141 "@types/yargs": "^17.0.33",
142142 "@types/yauzl": "^2.10.3",
143143 "eslint": "^8.57.1",
144+ "eslint-plugin-jsdoc": "^48.10.0"
144145 }
145146}
public/script.js+1 -1
@@ -595,7 +595,7 @@ let is_delete_mode = false;
595595let fav_ch_checked = false;
596596let scrollLock = false;
597597export let abortStatusCheck = new AbortController();
598598export let charDragDropHandler = null;
599599
600600/** @type {debounce_timeout} The debounce timeout used for chat/settings save. debounce_timeout.long: 1.000 ms */
601601export const DEFAULT_SAVE_EDIT_TIMEOUT = debounce_timeout.relaxed;
public/scripts/PromptManager.js+1 -1
@@ -4,7 +4,7 @@ import { DOMPurify, Popper } from '../lib.js';
44
55import { event_types, eventSource, is_send_press, main_api, substituteParams } from '../script.js';
66import { is_group_generating } from './group-chats.js';
77import { Message, MessageCollection, TokenHandler } from './openai.js';
88import { power_user } from './power-user.js';
99import { debounce, waitUntilCondition, escapeHtml } from './utils.js';
1010import { debounce_timeout } from './constants.js';
public/scripts/autocomplete/AutoComplete.js+0 -2
@@ -3,10 +3,8 @@ import { debounce, escapeRegex } from '../utils.js';
33import { AutoCompleteOption } from './AutoCompleteOption.js';
44import { AutoCompleteFuzzyScore } from './AutoCompleteFuzzyScore.js';
55import { BlankAutoCompleteOption } from './BlankAutoCompleteOption.js';
6-// eslint-disable-next-line no-unused-vars
76import { AutoCompleteNameResult } from './AutoCompleteNameResult.js';
87import { AutoCompleteSecondaryNameResult } from './AutoCompleteSecondaryNameResult.js';
9-import { Popup, getTopmostModalLayer } from '../popup.js';
108
119/**@readonly*/
1210/**@enum {Number}*/
public/scripts/autocomplete/AutoCompleteNameResultBase.js+0 -1
@@ -1,4 +1,3 @@
1-import { SlashCommandNamedArgumentAutoCompleteOption } from '../slash-commands/SlashCommandNamedArgumentAutoCompleteOption.js';
21import { AutoCompleteOption } from './AutoCompleteOption.js';
32
43
public/scripts/autocomplete/AutoCompleteOption.js+10 -11
@@ -1,19 +1,18 @@
1-import { SlashCommand } from '../slash-commands/SlashCommand.js';
21import { AutoCompleteFuzzyScore } from './AutoCompleteFuzzyScore.js';
32
43
54
65export class AutoCompleteOption {
76 /** @type {string} */ name;
87 /** @type {string} */ typeIcon;
98 /** @type {string} */ type;
109 /** @type {number} */ nameOffset = 0;
1110 /** @type {AutoCompleteFuzzyScore} */ score;
1211 /** @type {string} */ replacer;
1312 /** @type {HTMLElement} */ dom;
1413 /** @type {(input:string)=>boolean} */ matchProvider;
1514 /** @type {(input:string)=>string} */ valueProvider;
1615 /** @type {boolean} */ makeSelectable = false;
1716
1817
1918 /**
public/scripts/bookmarks.js+1 -2
@@ -1,7 +1,6 @@
11import {
22 characters,
33 saveChat,
4- system_messages,
54 system_message_types,
65 this_chid,
76 openCharacterChat,
@@ -13,7 +12,7 @@ import {
1312 saveChatConditional,
1413 saveItemizedPrompts,
1514} from '../script.js';
1615import { humanizedDateTime, getMessageTimeStamp } from './RossAscends-mods.js';
1716import {
1817 getGroupPastChats,
1918 group_activation_strategy,
public/scripts/extensions/quick-reply/api/QuickReplyApi.js+3 -6
@@ -1,21 +1,18 @@
1-// eslint-disable-next-line no-unused-vars
21import { QuickReply } from '../src/QuickReply.js';
32import { QuickReplyContextLink } from '../src/QuickReplyContextLink.js';
43import { QuickReplySet } from '../src/QuickReplySet.js';
5-// eslint-disable-next-line no-unused-vars
64import { QuickReplySettings } from '../src/QuickReplySettings.js';
7-// eslint-disable-next-line no-unused-vars
85import { SettingsUi } from '../src/ui/SettingsUi.js';
96import { onlyUnique } from '../../../utils.js';
107
118export class QuickReplyApi {
129 /** @type {QuickReplySettings} */ settings;
1310 /** @type {SettingsUi} */ settingsUi;
1411
1512
1613
1714
1815 constructor(/** @type {QuickReplySettings} */settings, /** @type {SettingsUi} */settingsUi) {
1916 this.settings = settings;
2017 this.settingsUi = settingsUi;
2118 }
public/scripts/extensions/quick-reply/src/AutoExecuteHandler.js+4 -6
@@ -1,18 +1,16 @@
11import { warn } from '../index.js';
2-// eslint-disable-next-line no-unused-vars
32import { QuickReply } from './QuickReply.js';
4-// eslint-disable-next-line no-unused-vars
53import { QuickReplySettings } from './QuickReplySettings.js';
64
75export class AutoExecuteHandler {
86 /** @type {QuickReplySettings} */ settings;
97
108 /** @type {Boolean[]}*/ preventAutoExecuteStack = [];
119
1210
1311
1412
1513 constructor(/** @type {QuickReplySettings} */settings) {
1614 this.settings = settings;
1715 }
1816
@@ -24,7 +22,7 @@ export class AutoExecuteHandler {
2422
2523
2624
2725 async performAutoExecute(/** @type {QuickReply[]} */qrList) {
2826 for (const qr of qrList) {
2927 this.preventAutoExecuteStack.push(qr.preventAutoExecute);
3028 try {
public/scripts/extensions/quick-reply/src/QuickReply.js+1 -3
@@ -49,7 +49,7 @@ export class QuickReply {
4949 /**@type {string}*/ automationId = '';
5050
5151 /**@type {function}*/ onExecute;
5252 /** @type {(qr:QuickReply)=>AsyncGenerator<SlashCommandClosureResult|{closure:SlashCommandClosure, executor:SlashCommandExecutor|SlashCommandClosureResult}, SlashCommandClosureResult, boolean>} */ onDebug;
5353 /**@type {function}*/ onDelete;
5454 /**@type {function}*/ onUpdate;
5555 /**@type {function}*/ onInsertBefore;
@@ -635,7 +635,6 @@ export class QuickReply {
635635 }, { passive:true });
636636 const getLineStart = ()=>{
637637 const start = message.selectionStart;
638- const end = message.selectionEnd;
639638 let lineStart;
640639 if (start == 0 || message.value[start - 1] == '\n') {
641640 // cursor is already at beginning of line
@@ -701,7 +700,6 @@ export class QuickReply {
701700 } else if (evt.key == 'Enter' && !evt.ctrlKey && !evt.shiftKey && !evt.altKey && !(ac.isReplaceable && ac.isActive)) {
702701 // new line, keep indent
703702 const start = message.selectionStart;
704- const end = message.selectionEnd;
705703 let lineStart = getLineStart();
706704 const indent = /^([^\S\n]*)/.exec(message.value.slice(lineStart))[1] ?? '';
707705 if (indent.length) {
public/scripts/extensions/quick-reply/src/SlashCommandHandler.js+3 -4
@@ -8,18 +8,17 @@ import { SlashCommandEnumValue, enumTypes } from '../../../slash-commands/SlashC
88import { SlashCommandParser } from '../../../slash-commands/SlashCommandParser.js';
99import { SlashCommandScope } from '../../../slash-commands/SlashCommandScope.js';
1010import { isTrueBoolean } from '../../../utils.js';
11-// eslint-disable-next-line no-unused-vars
1211import { QuickReplyApi } from '../api/QuickReplyApi.js';
1312import { QuickReply } from './QuickReply.js';
1413import { QuickReplySet } from './QuickReplySet.js';
1514
1615export class SlashCommandHandler {
1716 /** @type {QuickReplyApi} */ api;
1817
1918
2019
2120
2221 constructor(/** @type {QuickReplyApi} */api) {
2322 this.api = api;
2423 }
2524
@@ -27,7 +26,7 @@ export class SlashCommandHandler {
2726
2827
2928 init() {
3029 function getExecutionIcons(/** @type {QuickReply} */ qr) {
3130 let icons = '';
3231 if (qr.preventAutoExecute) icons += '🚫';
3332 if (qr.isHidden) icons += '👁️';
public/scripts/extensions/quick-reply/src/ui/ButtonUi.js+1 -2
@@ -1,11 +1,10 @@
11import { animation_duration } from '../../../../../script.js';
22import { dragElement } from '../../../../RossAscends-mods.js';
33import { loadMovingUIState } from '../../../../power-user.js';
4-// eslint-disable-next-line no-unused-vars
54import { QuickReplySettings } from '../QuickReplySettings.js';
65
76export class ButtonUi {
87 /** @type {QuickReplySettings} */ settings;
98
109 /**@type {HTMLElement}*/ dom;
1110 /**@type {HTMLElement}*/ popoutDom;
public/scripts/extensions/quick-reply/src/ui/SettingsUi.js+3 -4
@@ -3,14 +3,13 @@ import { getSortableDelay } from '../../../../utils.js';
33import { log, warn } from '../../index.js';
44import { QuickReply } from '../QuickReply.js';
55import { QuickReplySet } from '../QuickReplySet.js';
6-// eslint-disable-next-line no-unused-vars
76import { QuickReplySettings } from '../QuickReplySettings.js';
87
98export class SettingsUi {
109 /** @type {QuickReplySettings} */ settings;
1110
1211 /** @type {HTMLElement} */ template;
1312 /** @type {HTMLElement} */ dom;
1413
1514 /**@type {HTMLInputElement}*/ isEnabled;
1615 /**@type {HTMLInputElement}*/ isCombined;
public/scripts/extensions/quick-reply/src/ui/ctx/ContextMenu.js+0 -1
@@ -1,5 +1,4 @@
11import { QuickReply } from '../../QuickReply.js';
2-// eslint-disable-next-line no-unused-vars
32import { QuickReplySet } from '../../QuickReplySet.js';
43import { MenuHeader } from './MenuHeader.js';
54import { MenuItem } from './MenuItem.js';
public/scripts/extensions/stable-diffusion/index.js+3 -4
@@ -2337,10 +2337,10 @@ function processReply(str) {
23372337 str = str.replaceAll('“', '');
23382338 str = str.replaceAll('\n', ', ');
23392339 str = str.normalize('NFD');
2340-
2340+
23412341 // Strip out non-alphanumeric characters barring model syntax exceptions
23422342 str = str.replace(/[^a-zA-Z0-9.,:_(){}<>[\]\-'|#]+/g, ' ');
2343-
2343+
23442344 str = str.replace(/\s+/g, ' '); // Collapse multiple whitespaces into one
23452345 str = str.trim();
23462346
@@ -3234,7 +3234,7 @@ function getNovelParams() {
32343234 extension_settings.sd.scheduler = 'karras';
32353235 }
32363236
32373237 if (extension_settings.sd.sampler === 'ddim' ||
32383238 ['nai-diffusion-4-curated-preview', 'nai-diffusion-4-full'].includes(extension_settings.sd.model)) {
32393239 sm = false;
32403240 sm_dyn = false;
@@ -3772,7 +3772,6 @@ async function addSDGenButtons() {
37723772 $('#sd_wand_container').append(buttonHtml);
37733773 $(document.body).append(dropdownHtml);
37743774
3775- const messageButton = $('.sd_message_gen');
37763775 const button = $('#sd_gen');
37773776 const dropdown = $('#sd_dropdown');
37783777 dropdown.hide();
public/scripts/extensions/token-counter/index.js+1 -1
@@ -24,7 +24,7 @@ $('button').click(function () {
2424
2525async function doTokenCounter() {
2626 const { tokenizerName, tokenizerId } = getFriendlyTokenizerName(main_api);
2727 const html = await renderExtensionTemplateAsync('token-counter', 'window', { tokenizerName });
2828
2929 const dialog = $(html);
3030 const countDebounced = debounce(async () => {
public/scripts/extensions/tts/gpt-sovits-v2.js+0 -2
@@ -183,8 +183,6 @@ class GptSovitsV2Provider {
183183
184184 let prompt_text = replaceSpeaker(voiceId);
185185
186- const streaming = this.settings.streaming;
187-
188186 const params = {
189187 text: inputText,
190188 prompt_text: prompt_text,
public/scripts/extensions/tts/index.js+1 -1
@@ -1,5 +1,5 @@
11import { cancelTtsPlay, eventSource, event_types, getCurrentChatId, isStreamingEnabled, name2, saveSettingsDebounced, substituteParams } from '../../../script.js';
22import { ModuleWorkerWrapper, doExtrasFetch, extension_settings, getApiUrl, getContext, modules, renderExtensionTemplateAsync } from '../../extensions.js';
33import { delay, escapeRegex, getBase64Async, getStringHash, onlyUnique } from '../../utils.js';
44import { EdgeTtsProvider } from './edge.js';
55import { ElevenLabsTtsProvider } from './elevenlabs.js';
public/scripts/group-chats.js+0 -1
@@ -46,7 +46,6 @@ import {
4646 hideSwipeButtons,
4747 chat_metadata,
4848 updateChatMetadata,
49- isStreamingEnabled,
5049 getThumbnailUrl,
5150 getRequestHeaders,
5251 setMenuType,
public/scripts/nai-settings.js+1 -0
@@ -795,6 +795,7 @@ export function parseNovelAILogprobs(data) {
795795
796796 // Add the chosen token to `merged` if it's not already there. This can
797797 // happen if the chosen token was not among the top 10 most likely ones.
798+ // eslint-disable-next-line no-unused-vars
798799 const [[chosenId], [_, chosenAfter]] = data.chosen[0];
799800 if (!merged.some(([id]) => id === chosenId)) {
800801 merged.push([chosenId, chosenAfter]);
public/scripts/slash-commands.js+5 -3
@@ -69,12 +69,14 @@ import { SlashCommand } from './slash-commands/SlashCommand.js';
6969import { SlashCommandAbortController } from './slash-commands/SlashCommandAbortController.js';
7070import { SlashCommandNamedArgumentAssignment } from './slash-commands/SlashCommandNamedArgumentAssignment.js';
7171import { SlashCommandEnumValue, enumTypes } from './slash-commands/SlashCommandEnumValue.js';
7272import { POPUP_RESULT, POPUP_TYPE, Popup, callGenericPopup } from './popup.js';
7373import { commonEnumProviders, enumIcons } from './slash-commands/SlashCommandCommonEnumsProvider.js';
7474import { SlashCommandBreakController } from './slash-commands/SlashCommandBreakController.js';
7575import { SlashCommandExecutionError } from './slash-commands/SlashCommandExecutionError.js';
7676import { slashCommandReturnHelper } from './slash-commands/SlashCommandReturnHelper.js';
7777import { accountStorage } from './util/AccountStorage.js';
78+import { SlashCommandDebugController } from './slash-commands/SlashCommandDebugController.js';
79+import { SlashCommandScope } from './slash-commands/SlashCommandScope.js';
7880export {
7981 executeSlashCommands, executeSlashCommandsWithOptions, getSlashCommandsHelp, registerSlashCommand,
8082};
@@ -4345,7 +4347,7 @@ const clearCommandProgressDebounced = debounce(clearCommandProgress);
43454347 * @prop {boolean} [handleParserErrors] (true) Whether to handle parser errors (show toast on error) or throw.
43464348 * @prop {SlashCommandScope} [scope] (null) The scope to be used when executing the commands.
43474349 * @prop {boolean} [handleExecutionErrors] (false) Whether to handle execution errors (show toast on error) or throw
43484350 * @prop {{[id:PARSER_FLAG]:boolean}import('./slash-commands/SlashCommandParser.js').ParserFlags} [parserFlags] (null) Parser flags to apply
43494351 * @prop {SlashCommandAbortController} [abortController] (null) Controller used to abort or pause command execution
43504352 * @prop {SlashCommandDebugController} [debugController] (null) Controller used to control debug execution
43514353 * @prop {(done:number, total:number)=>void} [onProgress] (null) Callback to handle progress events
@@ -4355,7 +4357,7 @@ const clearCommandProgressDebounced = debounce(clearCommandProgress);
43554357/**
43564358 * @typedef ExecuteSlashCommandsOnChatInputOptions
43574359 * @prop {SlashCommandScope} [scope] (null) The scope to be used when executing the commands.
43584360 * @prop {{[id:PARSER_FLAG]:boolean}import('./slash-commands/SlashCommandParser.js').ParserFlags} [parserFlags] (null) Parser flags to apply
43594361 * @prop {boolean} [clearChatInput] (false) Whether to clear the chat input textarea
43604362 * @prop {string} [source] (null) String indicating where the code come from (e.g., QR name)
43614363 */
public/scripts/slash-commands/SlashCommand.js+1 -5
@@ -3,16 +3,12 @@ import { SlashCommandAbortController } from './SlashCommandAbortController.js';
33import { SlashCommandArgument, SlashCommandNamedArgument } from './SlashCommandArgument.js';
44import { SlashCommandClosure } from './SlashCommandClosure.js';
55import { SlashCommandDebugController } from './SlashCommandDebugController.js';
6-import { PARSER_FLAG } from './SlashCommandParser.js';
76import { SlashCommandScope } from './SlashCommandScope.js';
87
9-
10-
11-
128/**
139 * @typedef {{
1410 * _scope:SlashCommandScope,
15- * _parserFlags:{[id:PARSER_FLAG]:boolean},
11+ * _parserFlags:import('./SlashCommandParser.js').ParserFlags,
1612 * _abortController:SlashCommandAbortController,
1713 * _debugController:SlashCommandDebugController,
1814 * _hasUnnamedArgument:boolean,
public/scripts/slash-commands/SlashCommandAutoCompleteNameResult.js+0 -3
@@ -1,9 +1,6 @@
11import { AutoCompleteNameResult } from '../autocomplete/AutoCompleteNameResult.js';
2-import { AutoCompleteOption } from '../autocomplete/AutoCompleteOption.js';
32import { AutoCompleteSecondaryNameResult } from '../autocomplete/AutoCompleteSecondaryNameResult.js';
43import { SlashCommand } from './SlashCommand.js';
5-import { SlashCommandNamedArgument } from './SlashCommandArgument.js';
6-import { SlashCommandClosure } from './SlashCommandClosure.js';
74import { SlashCommandCommandAutoCompleteOption } from './SlashCommandCommandAutoCompleteOption.js';
85import { SlashCommandEnumAutoCompleteOption } from './SlashCommandEnumAutoCompleteOption.js';
96import { SlashCommandExecutor } from './SlashCommandExecutor.js';
public/scripts/slash-commands/SlashCommandClosure.js+13 -16
@@ -2,7 +2,6 @@ import { substituteParams } from '../../script.js';
22import { delay, escapeRegex, uuidv4 } from '../utils.js';
33import { SlashCommand } from './SlashCommand.js';
44import { SlashCommandAbortController } from './SlashCommandAbortController.js';
5-import { SlashCommandNamedArgument } from './SlashCommandArgument.js';
65import { SlashCommandBreak } from './SlashCommandBreak.js';
76import { SlashCommandBreakController } from './SlashCommandBreakController.js';
87import { SlashCommandBreakPoint } from './SlashCommandBreakPoint.js';
@@ -14,21 +13,19 @@ import { SlashCommandNamedArgumentAssignment } from './SlashCommandNamedArgument
1413import { SlashCommandScope } from './SlashCommandScope.js';
1514
1615export class SlashCommandClosure {
1716 /** @type {SlashCommandScope} */ scope;
1817 /** @type {boolean} */ executeNow = false;
19- // @ts-ignore
18+ /** @type {SlashCommandNamedArgumentAssignment[]} */ argumentList = [];
2019 /** @type {SlashCommandNamedArgumentAssignment[]} */ argumentListprovidedArgumentList = [];
21- // @ts-ignore
20+ /** @type {SlashCommandExecutor[]} */ executorList = [];
2221 /** @type {SlashCommandNamedArgumentAssignment[]SlashCommandAbortController} */ providedArgumentList = []abortController;
2322 /** @type {SlashCommandExecutor[]SlashCommandBreakController} */ executorList = []breakController;
2423 /** @type {SlashCommandAbortControllerSlashCommandDebugController} */ abortControllerdebugController;
2524 /** @type {SlashCommandBreakController(done:number, total:number)=>void} */ breakControlleronProgress;
2625 /** @type {SlashCommandDebugControllerstring} */ debugControllerrawText;
2726 /** @type {(done:number, total:number)=>voidstring} */ onProgressfullText;
2827 /** @type {string} */ rawTextparserContext;
2928 /** @type {string} */ fullText#source = uuidv4();
30- /**@type {string}*/ parserContext;
31- /**@type {string}*/ #source = uuidv4();
3229 get source() { return this.#source; }
3330 set source(value) {
3431 this.#source = value;
public/scripts/slash-commands/SlashCommandDebugController.js+11 -11
@@ -2,20 +2,20 @@ import { SlashCommandClosure } from './SlashCommandClosure.js';
22import { SlashCommandExecutor } from './SlashCommandExecutor.js';
33
44export class SlashCommandDebugController {
55 /** @type {SlashCommandClosure[]} */ stack = [];
66 /** @type {SlashCommandExecutor[]} */ cmdStack = [];
77 /** @type {boolean[]} */ stepStack = [];
88 /** @type {boolean} */ isStepping = false;
99 /** @type {boolean} */ isSteppingInto = false;
1010 /** @type {boolean} */ isSteppingOut = false;
1111
1212 /** @type {object} */ namedArguments;
1313 /** @type {string|SlashCommandClosure|(string|SlashCommandClosure)[]} */ unnamedArguments;
1414
1515 /** @type {Promise<boolean>} */ continuePromise;
1616 /** @type {(boolean)=>void} */ continueResolver;
1717
1818 /** @type {(closure:SlashCommandClosure, executor:SlashCommandExecutor)=>Promise<boolean>} */ onBreakPoint;
1919
2020
2121
public/scripts/slash-commands/SlashCommandEnumValue.js+0 -4
@@ -1,7 +1,3 @@
1-import { SlashCommandExecutor } from './SlashCommandExecutor.js';
2-import { SlashCommandScope } from './SlashCommandScope.js';
3-
4-
51/**
62 * @typedef {'enum' | 'command' | 'namedArgument' | 'variable' | 'qr' | 'macro' | 'number' | 'name'} EnumType
73 */
public/scripts/slash-commands/SlashCommandExecutor.js+4 -9
@@ -1,11 +1,7 @@
1-// eslint-disable-next-line no-unused-vars
21import { uuidv4 } from '../utils.js';
32import { SlashCommand } from './SlashCommand.js';
4-// eslint-disable-next-line no-unused-vars
53import { SlashCommandClosure } from './SlashCommandClosure.js';
64import { SlashCommandNamedArgumentAssignment } from './SlashCommandNamedArgumentAssignment.js';
7-// eslint-disable-next-line no-unused-vars
8-import { PARSER_FLAG } from './SlashCommandParser.js';
95import { SlashCommandUnnamedArgumentAssignment } from './SlashCommandUnnamedArgumentAssignment.js';
106
117export class SlashCommandExecutor {
@@ -28,11 +24,10 @@ export class SlashCommandExecutor {
2824 arg.value.source = value;
2925 }
3026 }
3127 /** @type {SlashCommand} */ command;
32- // @ts-ignore
28+ /** @type {SlashCommandNamedArgumentAssignment[]} */ namedArgumentList = [];
3329 /** @type {SlashCommandNamedArgumentAssignmentSlashCommandUnnamedArgumentAssignment[]} */ namedArgumentListunnamedArgumentList = [];
3430 /** @type {SlashCommandUnnamedArgumentAssignment[]import('./SlashCommandParser.js').ParserFlags} */ unnamedArgumentList = []parserFlags;
35- /**@type {{[id:PARSER_FLAG]:boolean}} */ parserFlags;
3631
3732 get commandCount() {
3833 return 1
public/scripts/slash-commands/SlashCommandNamedArgumentAssignment.js+4 -4
@@ -1,10 +1,10 @@
11import { SlashCommandClosure } from './SlashCommandClosure.js';
22
33export class SlashCommandNamedArgumentAssignment {
44 /** @type {number} */ start;
55 /** @type {number} */ end;
66 /** @type {string} */ name;
77 /** @type {string|SlashCommandClosure} */ value;
88
99
1010 constructor() {
public/scripts/slash-commands/SlashCommandNamedArgumentAutoCompleteOption.js+2 -3
@@ -1,11 +1,10 @@
11import { AutoCompleteOption } from '../autocomplete/AutoCompleteOption.js';
22import { SlashCommand } from './SlashCommand.js';
33import { SlashCommandNamedArgument } from './SlashCommandArgument.js';
4-import { SlashCommandNamedArgumentAssignment } from './SlashCommandNamedArgumentAssignment.js';
54
65export class SlashCommandNamedArgumentAutoCompleteOption extends AutoCompleteOption {
76 /** @type {SlashCommandNamedArgument} */ arg;
87 /** @type {SlashCommand} */ cmd;
98
109 /**
1110 * @param {SlashCommandNamedArgument} arg
public/scripts/slash-commands/SlashCommandParser.js+21 -22
@@ -8,11 +8,9 @@ import { SlashCommandExecutor } from './SlashCommandExecutor.js';
88import { SlashCommandParserError } from './SlashCommandParserError.js';
99import { AutoCompleteNameResult } from '../autocomplete/AutoCompleteNameResult.js';
1010import { SlashCommandQuickReplyAutoCompleteOption } from './SlashCommandQuickReplyAutoCompleteOption.js';
11-// eslint-disable-next-line no-unused-vars
1211import { SlashCommandScope } from './SlashCommandScope.js';
1312import { SlashCommandVariableAutoCompleteOption } from './SlashCommandVariableAutoCompleteOption.js';
1413import { SlashCommandNamedArgumentAssignment } from './SlashCommandNamedArgumentAssignment.js';
15-// eslint-disable-next-line no-unused-vars
1614import { SlashCommandAbortController } from './SlashCommandAbortController.js';
1715import { SlashCommandAutoCompleteNameResult } from './SlashCommandAutoCompleteNameResult.js';
1816import { SlashCommandUnnamedArgumentAssignment } from './SlashCommandUnnamedArgumentAssignment.js';
@@ -28,16 +26,18 @@ import { t } from '../i18n.js';
2826/** @typedef {import('./SlashCommand.js').NamedArgumentsCapture} NamedArgumentsCapture */
2927/** @typedef {import('./SlashCommand.js').NamedArguments} NamedArguments */
3028
3129/**@readonly*/
3230/* * @enum {Number}*/
31+ * @readonly
32+ * @typedef {{[id:PARSER_FLAG]:boolean}} ParserFlags
33+ */
3334export const PARSER_FLAG = {
3435 'STRICT_ESCAPING': 1,
3536 'REPLACE_GETVAR': 2,
3637};
3738
3839export class SlashCommandParser {
39- // @ts-ignore
40+ /** @type {Object.<string, SlashCommand>} */ static commands = {};
40- /**@type {Object.<string, SlashCommand>}*/ static commands = {};
4141
4242 /**
4343 * @deprecated Use SlashCommandParser.addCommandObject() instead.
@@ -101,26 +101,25 @@ export class SlashCommandParser {
101101 get commands() {
102102 return SlashCommandParser.commands;
103103 }
104- // @ts-ignore
104+ /** @type {Object.<string, string>} */ helpStrings = {};
105105 /** @type {Object.<string, string>boolean} */ helpStringsverifyCommandNames = {}true;
106106 /** @type {booleanstring} */ verifyCommandNames = truetext;
107107 /** @type {stringnumber} */ textindex;
108108 /** @type {numberSlashCommandAbortController} */ indexabortController;
109109 /** @type {SlashCommandAbortControllerSlashCommandDebugController} */ abortControllerdebugController;
110110 /** @type {SlashCommandDebugControllerSlashCommandScope} */ debugControllerscope;
111111 /** @type {SlashCommandScopeSlashCommandClosure} */ scopeclosure;
112- /**@type {SlashCommandClosure}*/ closure;
113112
114113 /** @type {Object.<PARSER_FLAG,boolean>} */ flags = {};
115114
116115 /** @type {boolean} */ jumpedEscapeSequence = false;
117116
118117 /** @type {{start:number, end:number}[]} */ closureIndex;
119118 /** @type {{start:number, end:number, name:string}[]} */ macroIndex;
120119 /** @type {SlashCommandExecutor[]} */ commandIndex;
121120 /** @type {SlashCommandScope[]} */ scopeIndex;
122121
123122 /** @type {string} */ parserContext;
124123
125124 get userIndex() { return this.index; }
126125
public/scripts/slash-commands/SlashCommandScope.js+6 -6
@@ -2,21 +2,21 @@ import { SlashCommandClosure } from './SlashCommandClosure.js';
22import { convertValueType } from '../utils.js';
33
44export class SlashCommandScope {
55 /** @type {string[]} */ variableNames = [];
66 get allVariableNames() {
77 const names = [...this.variableNames, ...(this.parent?.allVariableNames ?? [])];
88 return names.filter((it,idx)=>idx == names.indexOf(it));
99 }
1010 // @ts-ignore
1111 /** @type {object.<string, string|SlashCommandClosure>} */ variables = {};
1212 // @ts-ignore
1313 /** @type {object.<string, string|SlashCommandClosure>} */ macros = {};
1414 /** @type {{key:string, value:string|SlashCommandClosure}[]} */
1515 get macroList() {
1616 return [...Object.keys(this.macros).map(key=>({ key, value:this.macros[key] })), ...(this.parent?.macroList ?? [])];
1717 }
1818 /** @type {SlashCommandScope} */ parent;
1919 /** @type {string} */ #pipe;
2020 get pipe() {
2121 return this.#pipe ?? this.parent?.pipe;
2222 }
public/scripts/slash-commands/SlashCommandUnnamedArgumentAssignment.js+3 -3
@@ -1,9 +1,9 @@
11import { SlashCommandClosure } from './SlashCommandClosure.js';
22
33export class SlashCommandUnnamedArgumentAssignment {
44 /** @type {number} */ start;
55 /** @type {number} */ end;
66 /** @type {string|SlashCommandClosure} */ value;
77
88
99 constructor() {
public/scripts/tags.js+0 -1
@@ -13,7 +13,6 @@ import {
1313 DEFAULT_PRINT_TIMEOUT,
1414 printCharacters,
1515} from '../script.js';
16-// eslint-disable-next-line no-unused-vars
1716import { FILTER_TYPES, FILTER_STATES, DEFAULT_FILTER_STATE, isFilterState, FilterHelper } from './filters.js';
1817
1918import { groupCandidatesFilter, groups, selected_group } from './group-chats.js';
public/scripts/variables.js+2 -2
@@ -9,7 +9,7 @@ import { SlashCommandClosure } from './slash-commands/SlashCommandClosure.js';
99import { SlashCommandClosureResult } from './slash-commands/SlashCommandClosureResult.js';
1010import { commonEnumProviders, enumIcons } from './slash-commands/SlashCommandCommonEnumsProvider.js';
1111import { SlashCommandEnumValue, enumTypes } from './slash-commands/SlashCommandEnumValue.js';
1212import { PARSER_FLAG, SlashCommandParser } from './slash-commands/SlashCommandParser.js';
1313import { slashCommandReturnHelper } from './slash-commands/SlashCommandReturnHelper.js';
1414import { SlashCommandScope } from './slash-commands/SlashCommandScope.js';
1515import { isFalseBoolean, convertValueType, isTrueBoolean } from './utils.js';
@@ -583,7 +583,7 @@ export function evalBoolean(rule, a, b) {
583583 * Executes a slash command from a string (may be enclosed in quotes) and returns the result.
584584 * @param {string} command Command to execute. May contain escaped macro and batch separators.
585585 * @param {SlashCommandScope} [scope] The scope to use.
586586 * @param {{[id:PARSER_FLAG]:boolean}import('./slash-commands/SlashCommandParser.js').ParserFlags} [parserFlags] The parser flags to use.
587587 * @param {SlashCommandAbortController} [abortController] The abort controller to use.
588588 * @returns {Promise<SlashCommandClosureResult>} Closure execution result
589589 */
public/scripts/world-info.js+1 -1
@@ -1,6 +1,6 @@
11import { Fuse } from '../lib.js';
22
33import { saveSettings, callPopup, substituteParams, getRequestHeaders, chat_metadata, this_chid, characters, saveCharacterDebounced, menu_type, eventSource, event_types, getExtensionPromptByName, saveMetadata, getCurrentChatId, extension_prompt_roles } from '../script.js';
44import { download, debounce, initScrollHeight, resetScrollHeight, parseJsonFile, extractDataFromPng, getFileBuffer, getCharaFilename, getSortableDelay, escapeRegex, PAGINATION_TEMPLATE, navigation_option, waitUntilCondition, isTrueBoolean, setValueByPath, flashHighlight, select2ModifyOptions, getSelect2OptionId, dynamicSelect2DataViaAjax, highlightRegex, select2ChoiceClickSubscribe, isFalseBoolean, getSanitizedFilename, checkOverwriteExistingData, getStringHash, parseStringArray, cancelDebounce, findChar, onlyUnique } from './utils.js';
55import { extension_settings, getContext } from './extensions.js';
66import { NOTE_MODULE_NAME, metadata_keys, shouldWIAddPrompt } from './authors-note.js';