Collapse Epiphany mutation route boilerplate

This commit is contained in:
Meta Vens 2026-05-13 07:11:32 +01:00
commit 4f44140856
5 changed files with 187 additions and 286 deletions

View file

@ -1,8 +1,10 @@
use codex_app_server_protocol::ThreadEpiphanyIndexResponse;
use codex_app_server_protocol::ThreadEpiphanyRetrieveIndexSummary;
use codex_app_server_protocol::ThreadEpiphanyRetrieveResponse;
use codex_app_server_protocol::ThreadEpiphanyRetrieveResult;
use codex_app_server_protocol::ThreadEpiphanyRetrieveResultKind;
use codex_app_server_protocol::ThreadEpiphanyRetrieveShardSummary;
use codex_core::CodexThread;
use codex_core::EpiphanyRetrieveResponse as CoreEpiphanyRetrieveResponse;
use codex_core::EpiphanyRetrieveResult as CoreEpiphanyRetrieveResult;
use codex_core::EpiphanyRetrieveResultKind as CoreEpiphanyRetrieveResultKind;
@ -23,6 +25,17 @@ pub fn map_epiphany_retrieve_response(
})
}
pub async fn index_thread_epiphany_retrieval(
thread: &CodexThread,
force_full_rebuild: bool,
) -> anyhow::Result<ThreadEpiphanyIndexResponse> {
let index_summary = thread
.epiphany_index(force_full_rebuild)
.await
.and_then(map_epiphany_retrieve_index_summary)?;
Ok(ThreadEpiphanyIndexResponse { index_summary })
}
pub fn map_epiphany_retrieve_index_summary(
summary: EpiphanyRetrievalState,
) -> anyhow::Result<ThreadEpiphanyRetrieveIndexSummary> {