Merge pull request #3410 from bmen25124/export_some_world_methods New exported methods: loadWorldInfo(), saveWorldInfo(), updateWorldIn…

aecbc48d43e5c12bc888823d7da555e7dfdf286a

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

Signed
2 files changed, +7 -2Ignore whitespace
public/scripts/st-context.js+5 -0
@@ -70,6 +70,7 @@ import { tokenizers, getTextTokens, getTokenCount, getTokenCountAsync, getTokeni
7070import { ToolManager } from './tool-calling.js';
7171import { timestampToMoment, uuidv4 } from './utils.js';
7272import { getGlobalVariable, getLocalVariable, setGlobalVariable, setLocalVariable } from './variables.js';
73+import { convertCharacterBook, loadWorldInfo, saveWorldInfo, updateWorldInfoList } from './world-info.js';
7374
7475export function getContext() {
7576 return {
@@ -186,6 +187,10 @@ export function getContext() {
186187 set: setGlobalVariable,
187188 },
188189 },
190+ loadWorldInfo,
191+ saveWorldInfo,
192+ updateWorldInfoList,
193+ convertCharacterBook,
189194 };
190195}
191196
public/scripts/world-info.js+2 -2
@@ -1708,7 +1708,7 @@ export async function loadWorldInfo(name) {
17081708 return null;
17091709}
17101710
17111711export async function updateWorldInfoList() {
17121712 const result = await fetch('/api/settings/get', {
17131713 method: 'POST',
17141714 headers: getRequestHeaders(),
@@ -4658,7 +4658,7 @@ function convertNovelLorebook(inputObj) {
46584658 return outputObj;
46594659}
46604660
46614661export function convertCharacterBook(characterBook) {
46624662 const result = { entries: {}, originalData: characterBook };
46634663
46644664 characterBook.entries.forEach((entry, index) => {