import { type PayloadAction } from "@reduxjs/toolkit"; import { type IChatConversationLocal, type IChatConversationLocalItem } from "../../model.js"; /** * Re-sync the active conversation with the backend whenever the chat window is opened. * * The host shell hosts several micro-frontends (Catalog, Metric editor, Analytical Designer) and * keeps their runtimes alive across client-side navigation. Each runtime owns its own GenAI redux * store, which is only populated once on initial mount. As a result, a conversation started or * switched to on one micro-frontend was not reflected on another until a full page reload. * * When the chat is (re)opened we re-fetch the conversation list from the backend and, if another * conversation has become the most recently active one, switch to it. We then re-fetch the active * thread from the backend and replace the cached messages atomically so that messages created on * another micro-frontend show up even when this runtime already had the conversation cached. This * keeps the conversation and its messages in sync across host navigation without requiring a manual * reload. A flaky/empty backend response never clears what the user is currently looking at. * * Only runs in agentic conversations mode and only after the initial load finished. A brand-new * unsent draft conversation or an in-progress message exchange is never replaced. * @internal */ export declare function onChatOpenSync({ payload: { isOpen } }: PayloadAction<{ isOpen: boolean; }>): Generator | import("redux-saga/effects").PutEffect<{ payload: undefined; type: "messages/startNewConversationAction"; }> | import("redux-saga/effects").PutEffect<{ payload: { messages?: import("../../model.js").Message[]; items?: IChatConversationLocalItem[]; }; type: "messages/setMessagesAction"; }> | import("redux-saga/effects").PutEffect<{ payload: { conversation: IChatConversationLocal; }; type: "messages/setCurrentConversationAction"; }> | import("redux-saga/effects").SelectEffect, void, never>; //# sourceMappingURL=onChatOpenSync.d.ts.map