feat: add getWorldInfoNames() to getContext() for WorldInfo enumeration. (#5505)

efbff343424e3ef8dd67358882d297149976ffe4

Theros <theros@svaltek.xyz>

Signed
1 files changed, +2 -1Ignore whitespace
public/scripts/st-context.js+2 -1
@@ -104,7 +104,7 @@ import { ToolManager } from './tool-calling.js';
104104import { accountStorage } from './util/AccountStorage.js';
105105import { timestampToMoment, uuidv4, importFromExternalUrl } from './utils.js';
106106import { addGlobalVariable, addLocalVariable, decrementGlobalVariable, decrementLocalVariable, deleteGlobalVariable, deleteLocalVariable, existsGlobalVariable, existsLocalVariable, getGlobalVariable, getLocalVariable, incrementGlobalVariable, incrementLocalVariable, setGlobalVariable, setLocalVariable } from './variables.js';
107107import { convertCharacterBook, getWorldInfoPrompt, loadWorldInfo, reloadEditor, saveWorldInfo, updateWorldInfoList, world_names } from './world-info.js';
108108import { ChatCompletionService, TextCompletionService } from './custom-request.js';
109109import { ConnectionManagerRequestService } from './extensions/shared.js';
110110import { updateReasoningUI, parseReasoningFromString, getReasoningTemplateByName } from './reasoning.js';
@@ -279,6 +279,7 @@ export function getContext() {
279279 updateWorldInfoList,
280280 convertCharacterBook,
281281 getWorldInfoPrompt,
282+ getWorldInfoNames: () => Array.isArray(world_names) ? [...world_names] : [],
282283 CONNECT_API_MAP,
283284 getTextGenServer,
284285 extractMessageFromData,