diff --git a/barrelsby.json b/barrelsby.json index 35ca8871..6c8acef8 100644 --- a/barrelsby.json +++ b/barrelsby.json @@ -45,7 +45,6 @@ "./src/integrations", "./src/utils", "./src/stores/auth", - "./src/stores/chat", "./src/stores/user" ] } diff --git a/src/stores/chat/chat-machine.actors.ts b/src/stores/chat/chat-machine.actors.ts deleted file mode 100644 index d2413ff0..00000000 --- a/src/stores/chat/chat-machine.actors.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Backward-compatible actor exports. - * - * Concrete implementations live in capability flow files: - * - chat-history-flow - * - chat-send-flow - * - chat-unlock-flow - */ -export { loadHistoryActor } from "./chat-history-flow"; -export { - httpMessageQueueActor, - sendMessageHttpActor, -} from "./chat-send-flow"; -export { - unlockHistoryActor, - unlockMessageActor, - type UnlockMessageOutput, -} from "./chat-unlock-flow"; diff --git a/src/stores/chat/index.ts b/src/stores/chat/index.ts index 78cd11ae..20c7c620 100644 --- a/src/stores/chat/index.ts +++ b/src/stores/chat/index.ts @@ -4,7 +4,6 @@ export * from "./chat-context"; export * from "./chat-events"; -export * from "./chat-machine.actors"; export * from "./chat-machine.helpers"; export * from "./chat-machine"; export * from "./chat-state"; diff --git a/src/stores/chat/chat-history-flow.ts b/src/stores/chat/machine/actors/history.ts similarity index 92% rename from src/stores/chat/chat-history-flow.ts rename to src/stores/chat/machine/actors/history.ts index 41a30a53..fb32e357 100644 --- a/src/stores/chat/chat-history-flow.ts +++ b/src/stores/chat/machine/actors/history.ts @@ -6,8 +6,8 @@ import { readLocalHistorySnapshot, resolveHistoryCacheIdentity, syncNetworkHistory, -} from "./chat-history-sync"; -import type { ChatEvent } from "./chat-events"; +} from "../../chat-history-sync"; +import type { ChatEvent } from "../../chat-events"; const log = new Logger("StoresChatChatHistoryFlow"); diff --git a/src/stores/chat/chat-send-flow.ts b/src/stores/chat/machine/actors/send.ts similarity index 96% rename from src/stores/chat/chat-send-flow.ts rename to src/stores/chat/machine/actors/send.ts index 45af2b0f..b73883b9 100644 --- a/src/stores/chat/chat-send-flow.ts +++ b/src/stores/chat/machine/actors/send.ts @@ -8,8 +8,8 @@ import { resolveChatCacheOwnerKey } from "@/data/repositories/chat_cache_identit import { Logger } from "@/utils/logger"; import { Result } from "@/utils/result"; -import type { ChatEvent } from "./chat-events"; -import { sendResponseToUiMessage } from "./chat-machine.helpers"; +import type { ChatEvent } from "../../chat-events"; +import { sendResponseToUiMessage } from "../../chat-machine.helpers"; const log = new Logger("StoresChatChatSendFlow"); diff --git a/src/stores/chat/chat-unlock-flow.ts b/src/stores/chat/machine/actors/unlock.ts similarity index 94% rename from src/stores/chat/chat-unlock-flow.ts rename to src/stores/chat/machine/actors/unlock.ts index 6d2b9317..8d259a02 100644 --- a/src/stores/chat/chat-unlock-flow.ts +++ b/src/stores/chat/machine/actors/unlock.ts @@ -5,11 +5,11 @@ import { resolveChatCacheOwnerKey } from "@/data/repositories/chat_cache_identit import { Logger } from "@/utils/logger"; import { Result } from "@/utils/result"; -import { readAndSyncHistory } from "./chat-history-sync"; +import { readAndSyncHistory } from "../../chat-history-sync"; import { type UnlockMessageRequest, type UnlockMessageOutput, -} from "./chat-machine.helpers"; +} from "../../chat-machine.helpers"; const log = new Logger("StoresChatChatUnlockFlow"); @@ -93,5 +93,3 @@ export const unlockMessageActor = fromPromise< response: unlockResult.data, }; }); - -export type { UnlockMessageOutput } from "./chat-machine.helpers"; diff --git a/src/stores/chat/machine/setup.ts b/src/stores/chat/machine/setup.ts index ac27a19c..3726ff11 100644 --- a/src/stores/chat/machine/setup.ts +++ b/src/stores/chat/machine/setup.ts @@ -1,13 +1,15 @@ import { setup, type ActionFunction, type EventObject } from "xstate"; import type { ChatEvent } from "../chat-events"; +import { loadHistoryActor } from "./actors/history"; import { httpMessageQueueActor, - loadHistoryActor, sendMessageHttpActor, +} from "./actors/send"; +import { unlockHistoryActor, unlockMessageActor, -} from "../chat-machine.actors"; +} from "./actors/unlock"; import type { ChatState } from "../chat-state"; export const baseChatMachineSetup = setup({ diff --git a/src/stores/chat/machine/unlock-flow.ts b/src/stores/chat/machine/unlock-flow.ts index 9df41336..a1c576db 100644 --- a/src/stores/chat/machine/unlock-flow.ts +++ b/src/stores/chat/machine/unlock-flow.ts @@ -6,7 +6,7 @@ import { countLockedHistoryMessages, type UnlockMessageOutput, } from "../chat-machine.helpers"; -import type { UnlockHistoryOutput } from "../chat-unlock-flow"; +import type { UnlockHistoryOutput } from "./actors/unlock"; import { sendMachineSetup } from "./send-flow"; import { createChatActorActionSetup } from "./setup";