refactor: controllerize generation recall event hooks

This commit is contained in:
Youzini-afk
2026-03-29 17:09:09 +08:00
parent e29e413516
commit d3479bc672
3 changed files with 104 additions and 63 deletions

View File

@@ -53,6 +53,10 @@ import {
pruneProcessedMessageHashesFromFloor,
rollbackAffectedJournals,
} from "../chat-history.js";
import {
onBeforeCombinePromptsController,
onGenerationAfterCommandsController,
} from "../event-binding.js";
const extensionsShimSource = [
"export const extension_settings = globalThis.__p0ExtensionSettings || {};",
@@ -303,6 +307,8 @@ function createGenerationRecallHarness() {
GRAPH_LOAD_STATES,
GRAPH_METADATA_KEY,
GRAPH_PERSISTENCE_META_KEY,
onBeforeCombinePromptsController,
onGenerationAfterCommandsController,
};
vm.createContext(context);
vm.runInContext(