From 3edc456fe780e51b2a0d798d604803128119db00 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Wed, 25 Oct 2023 00:28:58 +0300 Subject: [PATCH] Extend extensions interop API --- public/script.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/public/script.js b/public/script.js index 621513c8c..6267cc03c 100644 --- a/public/script.js +++ b/public/script.js @@ -142,7 +142,7 @@ import { onlyUnique, } from "./scripts/utils.js"; -import { extension_settings, getContext, loadExtensionSettings, processExtensionHelpers, registerExtensionHelper, runGenerationInterceptors, saveMetadataDebounced } from "./scripts/extensions.js"; +import { ModuleWorkerWrapper, extension_settings, getContext, loadExtensionSettings, processExtensionHelpers, registerExtensionHelper, renderExtensionTemplate, runGenerationInterceptors, saveMetadataDebounced } from "./scripts/extensions.js"; import { COMMENT_NAME_DEFAULT, executeSlashCommands, getSlashCommandsHelp, registerSlashCommand } from "./scripts/slash-commands.js"; import { tag_map, @@ -6447,6 +6447,10 @@ window["SillyTavern"].getContext = function () { chatId: selected_group ? groups.find(x => x.id == selected_group)?.chat_id : (this_chid && characters[this_chid] && characters[this_chid].chat), + getCurrentChatId: getCurrentChatId, + getRequestHeaders: getRequestHeaders, + reloadCurrentChat: reloadCurrentChat, + saveSettingsDebounced: saveSettingsDebounced, onlineStatus: online_status, maxContext: Number(max_context), chatMetadata: chat_metadata, @@ -6468,6 +6472,12 @@ window["SillyTavern"].getContext = function () { registerSlashCommand: registerSlashCommand, registerHelper: registerExtensionHelper, registedDebugFunction: registerDebugFunction, + renderExtensionTemplate: renderExtensionTemplate, + callPopup: callPopup, + mainApi: main_api, + extensionSettings: extension_settings, + ModuleWorkerWrapper: ModuleWorkerWrapper, + getTokenizerModel: getTokenizerModel, }; };