refactor(runtime): extract reroll/planner recall input factory (Phase 4b)

This commit is contained in:
youzini
2026-05-31 11:48:07 +00:00
parent 481ae6bb16
commit 4f1ccd4c7f
4 changed files with 525 additions and 359 deletions

View File

@@ -161,6 +161,11 @@ import {
normalizeStageNoticeLevel,
} from "../ui/ui-status.js";
import { createRecallInputState } from "../runtime/recall-input-state.js";
import { createRerollRecallInput } from "../runtime/reroll-recall-input.js";
import {
consumeRerollRecallReuseMarker,
createRerollRecallReuseMarker,
} from "../runtime/reroll-transaction-boundary.js";
const moduleDir = path.dirname(fileURLToPath(import.meta.url));
const indexPath = path.resolve(moduleDir, "../index.js");
@@ -783,6 +788,9 @@ async function createGraphPersistenceHarness({
},
},
createRecallInputState,
createRerollRecallInput,
consumeRerollRecallReuseMarker,
createRerollRecallReuseMarker,
createRecallMessageUiController() {
return {
refreshPersistedRecallMessageUi: () => ({
@@ -936,6 +944,9 @@ async function createGraphPersistenceHarness({
return serializeBmeChatStateTarget(target);
},
readPersistedRecallFromUserMessage,
formatInjection: (result = null) =>
String(result?.injectionText || result?.memoryBlock || ""),
getSchema: () => [],
areChatIdsEquivalentForIdentityCore,
cloneGraphForPersistence,
canMutateRuntimeGraphForIdentityCore,