Refactor rerun and summary rebuild ranges

This commit is contained in:
Youzini-afk
2026-04-10 18:38:46 +08:00
parent 073e17e580
commit 517abc6a30
10 changed files with 1102 additions and 75 deletions

View File

@@ -71,6 +71,7 @@ import {
} from "./host/event-binding.js";
import {
executeExtractionBatchController,
onExtractionTaskController,
onManualExtractController,
onRerollController,
resolveAutoExtractionPlanController,
@@ -12682,6 +12683,47 @@ async function onManualExtract(options = {}) {
);
}
async function onExtractionTask(options = {}) {
return await onExtractionTaskController(
{
beginStageAbortController,
clampInt,
console,
createEmptyGraph,
ensureGraphMutationReady,
executeExtractionBatch,
finishStageAbortController,
getAssistantTurns,
getContext,
getCurrentChatId,
getCurrentGraph: () => currentGraph,
getGraphMutationBlockReason,
getGraphPersistenceState: () => graphPersistenceState,
getIsExtracting: () => isExtracting,
getLastExtractionStatusLevel: () => lastExtractionStatus?.level || "idle",
getLastProcessedAssistantFloor,
getSettings,
isAbortError,
normalizeGraphRuntimeState,
onManualExtract,
recoverHistoryIfNeeded,
refreshPanelLiveState,
retryPendingGraphPersist,
rollbackGraphForReroll,
setCurrentGraph: (graph) => {
currentGraph = graph;
},
setIsExtracting: (value) => {
isExtracting = value;
},
setLastExtractionStatus,
setRuntimeStatus,
toastr,
},
options,
);
}
async function onReroll({ fromFloor } = {}) {
return await onRerollController(
{
@@ -12750,7 +12792,7 @@ async function onManualSummaryRollup() {
});
}
async function onRebuildSummaryState() {
async function onRebuildSummaryState(options = {}) {
return await onRebuildSummaryStateController({
ensureGraphMutationReady,
getContext,
@@ -12761,7 +12803,7 @@ async function onRebuildSummaryState() {
saveGraphToChat,
setRuntimeStatus,
toastr,
});
}, options);
}
async function onClearSummaryState() {
@@ -12913,6 +12955,7 @@ async function onDeleteServerSyncFile() {
syncGraphLoadFromLiveContext({
source: "panel-open-sync",
}),
extractTask: onExtractionTask,
extract: onManualExtract,
compress: onManualCompress,
sleep: onManualSleep,