refactor(chat): move actors into machine directory
This commit is contained in:
@@ -45,7 +45,6 @@
|
|||||||
"./src/integrations",
|
"./src/integrations",
|
||||||
"./src/utils",
|
"./src/utils",
|
||||||
"./src/stores/auth",
|
"./src/stores/auth",
|
||||||
"./src/stores/chat",
|
|
||||||
"./src/stores/user"
|
"./src/stores/user"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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";
|
|
||||||
@@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
export * from "./chat-context";
|
export * from "./chat-context";
|
||||||
export * from "./chat-events";
|
export * from "./chat-events";
|
||||||
export * from "./chat-machine.actors";
|
|
||||||
export * from "./chat-machine.helpers";
|
export * from "./chat-machine.helpers";
|
||||||
export * from "./chat-machine";
|
export * from "./chat-machine";
|
||||||
export * from "./chat-state";
|
export * from "./chat-state";
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import {
|
|||||||
readLocalHistorySnapshot,
|
readLocalHistorySnapshot,
|
||||||
resolveHistoryCacheIdentity,
|
resolveHistoryCacheIdentity,
|
||||||
syncNetworkHistory,
|
syncNetworkHistory,
|
||||||
} from "./chat-history-sync";
|
} from "../../chat-history-sync";
|
||||||
import type { ChatEvent } from "./chat-events";
|
import type { ChatEvent } from "../../chat-events";
|
||||||
|
|
||||||
const log = new Logger("StoresChatChatHistoryFlow");
|
const log = new Logger("StoresChatChatHistoryFlow");
|
||||||
|
|
||||||
@@ -8,8 +8,8 @@ import { resolveChatCacheOwnerKey } from "@/data/repositories/chat_cache_identit
|
|||||||
import { Logger } from "@/utils/logger";
|
import { Logger } from "@/utils/logger";
|
||||||
import { Result } from "@/utils/result";
|
import { Result } from "@/utils/result";
|
||||||
|
|
||||||
import type { ChatEvent } from "./chat-events";
|
import type { ChatEvent } from "../../chat-events";
|
||||||
import { sendResponseToUiMessage } from "./chat-machine.helpers";
|
import { sendResponseToUiMessage } from "../../chat-machine.helpers";
|
||||||
|
|
||||||
const log = new Logger("StoresChatChatSendFlow");
|
const log = new Logger("StoresChatChatSendFlow");
|
||||||
|
|
||||||
@@ -5,11 +5,11 @@ import { resolveChatCacheOwnerKey } from "@/data/repositories/chat_cache_identit
|
|||||||
import { Logger } from "@/utils/logger";
|
import { Logger } from "@/utils/logger";
|
||||||
import { Result } from "@/utils/result";
|
import { Result } from "@/utils/result";
|
||||||
|
|
||||||
import { readAndSyncHistory } from "./chat-history-sync";
|
import { readAndSyncHistory } from "../../chat-history-sync";
|
||||||
import {
|
import {
|
||||||
type UnlockMessageRequest,
|
type UnlockMessageRequest,
|
||||||
type UnlockMessageOutput,
|
type UnlockMessageOutput,
|
||||||
} from "./chat-machine.helpers";
|
} from "../../chat-machine.helpers";
|
||||||
|
|
||||||
const log = new Logger("StoresChatChatUnlockFlow");
|
const log = new Logger("StoresChatChatUnlockFlow");
|
||||||
|
|
||||||
@@ -93,5 +93,3 @@ export const unlockMessageActor = fromPromise<
|
|||||||
response: unlockResult.data,
|
response: unlockResult.data,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
export type { UnlockMessageOutput } from "./chat-machine.helpers";
|
|
||||||
@@ -1,13 +1,15 @@
|
|||||||
import { setup, type ActionFunction, type EventObject } from "xstate";
|
import { setup, type ActionFunction, type EventObject } from "xstate";
|
||||||
|
|
||||||
import type { ChatEvent } from "../chat-events";
|
import type { ChatEvent } from "../chat-events";
|
||||||
|
import { loadHistoryActor } from "./actors/history";
|
||||||
import {
|
import {
|
||||||
httpMessageQueueActor,
|
httpMessageQueueActor,
|
||||||
loadHistoryActor,
|
|
||||||
sendMessageHttpActor,
|
sendMessageHttpActor,
|
||||||
|
} from "./actors/send";
|
||||||
|
import {
|
||||||
unlockHistoryActor,
|
unlockHistoryActor,
|
||||||
unlockMessageActor,
|
unlockMessageActor,
|
||||||
} from "../chat-machine.actors";
|
} from "./actors/unlock";
|
||||||
import type { ChatState } from "../chat-state";
|
import type { ChatState } from "../chat-state";
|
||||||
|
|
||||||
export const baseChatMachineSetup = setup({
|
export const baseChatMachineSetup = setup({
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import {
|
|||||||
countLockedHistoryMessages,
|
countLockedHistoryMessages,
|
||||||
type UnlockMessageOutput,
|
type UnlockMessageOutput,
|
||||||
} from "../chat-machine.helpers";
|
} from "../chat-machine.helpers";
|
||||||
import type { UnlockHistoryOutput } from "../chat-unlock-flow";
|
import type { UnlockHistoryOutput } from "./actors/unlock";
|
||||||
import { sendMachineSetup } from "./send-flow";
|
import { sendMachineSetup } from "./send-flow";
|
||||||
import { createChatActorActionSetup } from "./setup";
|
import { createChatActorActionSetup } from "./setup";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user