mirror of
https://github.com/Wx-2025/ST-Amily2-Chat-Optimisation.git
synced 2026-06-06 12:45:51 +00:00
进行解耦合功能拆分处理
This commit is contained in:
@@ -56,4 +56,9 @@ if (!window.Amily2Bus) {
|
||||
window.Amily2Bus = new Amily2Bus();
|
||||
}
|
||||
|
||||
export default Amily2Bus;
|
||||
export function initializeAmilyBus() {
|
||||
if (!window.Amily2Bus) {
|
||||
window.Amily2Bus = new Amily2Bus();
|
||||
console.log('[Amily2] Amily2Bus 已成功初始化并附加到 window 对象');
|
||||
}
|
||||
}
|
||||
10
core/bus.js
10
core/bus.js
@@ -1,11 +1,11 @@
|
||||
import { eventSource, event_types } from '/script.js';
|
||||
|
||||
export const LOG_LEVELS = {
|
||||
DEBUG: 0,
|
||||
INFO: 1,
|
||||
WARN: 2,
|
||||
ERROR: 3,
|
||||
NONE: 99
|
||||
DEBUG: 0b0001,
|
||||
INFO: 0b0010,
|
||||
WARN: 0b0100,
|
||||
ERROR: 0b1000,
|
||||
NONE: 0
|
||||
};
|
||||
|
||||
class FilePipe {
|
||||
|
||||
41
imports.js
Normal file
41
imports.js
Normal file
@@ -0,0 +1,41 @@
|
||||
// Side-effect imports (独立模块/自初始化模块)
|
||||
import "./PresetSettings/index.js";
|
||||
import "./PreOptimizationViewer/index.js";
|
||||
import "./WorldEditor/WorldEditor.js";
|
||||
import './core/amily2-updater.js';
|
||||
import './SL/bus/Amily2Bus.js'
|
||||
|
||||
// Re-exports (重新导出供 index.js 使用)
|
||||
export { createDrawer } from "./ui/drawer.js";
|
||||
export { showPlotOptimizationProgress, updatePlotOptimizationProgress, hidePlotOptimizationProgress } from './ui/optimization-progress.js';
|
||||
export { registerSlashCommands } from "./core/commands.js";
|
||||
export { onMessageReceived, handleTableUpdate } from "./core/events.js";
|
||||
export { processPlotOptimization } from "./core/summarizer.js";
|
||||
|
||||
// External SillyTavern scripts (外部脚本)
|
||||
export { getContext, extension_settings } from "/scripts/extensions.js";
|
||||
export { characters, this_chid, eventSource, event_types, saveSettingsDebounced } from '/script.js';
|
||||
|
||||
// Core Systems
|
||||
export { injectTableData, generateTableContent } from "./core/table-system/injector.js";
|
||||
export { initialize as initializeRagProcessor } from "./core/rag-processor.js";
|
||||
export { loadTables, clearHighlights, rollbackAndRefill, rollbackState, commitPendingDeletions, saveStateToMessage, getMemoryState, clearUpdatedTables } from './core/table-system/manager.js';
|
||||
export { fillWithSecondaryApi } from './core/table-system/secondary-filler.js';
|
||||
export { renderTables } from './ui/table-bindings.js';
|
||||
export { log } from './core/table-system/logger.js';
|
||||
export { checkForUpdates, fetchMessageBoardContent } from './core/api.js';
|
||||
export { setUpdateInfo, applyUpdateIndicator } from './ui/state.js';
|
||||
export { pluginVersion, extensionName, defaultSettings } from './utils/settings.js';
|
||||
export { checkAuthorization, refreshUserInfo } from './utils/auth.js';
|
||||
export { tableSystemDefaultSettings } from './core/table-system/settings.js';
|
||||
export { manageLorebookEntriesForChat } from './core/lore.js';
|
||||
|
||||
// Feature Modules
|
||||
export { initializeCharacterWorldBook } from './CharacterWorldBook/cwb_index.js';
|
||||
export { cwbDefaultSettings } from './CharacterWorldBook/src/cwb_config.js';
|
||||
export { bindGlossaryEvents } from './glossary/GT_bindings.js';
|
||||
export { updateOrInsertTableInChat, startContinuousRendering, stopContinuousRendering } from './ui/message-table-renderer.js';
|
||||
export { initializeRenderer } from './core/tavern-helper/renderer.js';
|
||||
export { initializeApiListener, registerApiHandler, amilyHelper, initializeAmilyHelper } from './core/tavern-helper/main.js';
|
||||
export { registerContextOptimizerMacros, resetContextBuffer } from './core/context-optimizer.js';
|
||||
export { initializeSuperMemory } from './core/super-memory/manager.js';
|
||||
Reference in New Issue
Block a user