refactor(chat): reorganize helper functions and update imports

This commit is contained in:
2026-07-15 10:59:23 +08:00
parent 2b90f90ab0
commit ed3e800245
20 changed files with 27 additions and 29 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ import { Logger } from "@/utils/logger";
import { Result } from "@/utils/result";
import type { ChatEvent } from "../../chat-events";
import { sendResponseToUiMessage } from "../../chat-machine.helpers";
import { sendResponseToUiMessage } from "../../helper/message-mappers";
const log = new Logger("StoresChatChatSendFlow");
+1 -1
View File
@@ -9,7 +9,7 @@ import { readAndSyncHistory } from "../../chat-history-sync";
import {
type UnlockMessageRequest,
type UnlockMessageOutput,
} from "../../chat-machine.helpers";
} from "../../helper/unlock";
const log = new Logger("StoresChatChatUnlockFlow");
+3 -1
View File
@@ -1,9 +1,11 @@
import {
applyHistoryLoadedOutput,
applyNetworkHistoryLoadedOutput,
} from "../helper/history";
import {
countLockedHistoryMessages,
shouldPromptUnlockHistory,
} from "../chat-machine.helpers";
} from "../helper/unlock";
import { baseChatMachineSetup } from "./setup";
const applyLocalHistoryLoadedAction = baseChatMachineSetup.assign(
+1 -1
View File
@@ -8,7 +8,7 @@ import {
beginPendingReply,
finishPendingReply,
type HttpSendOutput,
} from "../chat-machine.helpers";
} from "../helper/send-state";
import { historyMachineSetup } from "./history-flow";
import { createChatActorActionSetup } from "./setup";
+2 -4
View File
@@ -1,7 +1,5 @@
import {
createChatPromotionState,
shouldPromptUnlockHistory,
} from "../chat-machine.helpers";
import { createChatPromotionState } from "../helper/promotion";
import { shouldPromptUnlockHistory } from "../helper/unlock";
import { initialState } from "../chat-state";
import {
guestInitializingState,
+2 -2
View File
@@ -1,11 +1,11 @@
import { type DoneActorEvent } from "xstate";
import { applyPromotionUnlockOutput } from "../helper/promotion";
import {
applyPromotionUnlockOutput,
applySingleUnlockOutput,
countLockedHistoryMessages,
type UnlockMessageOutput,
} from "../chat-machine.helpers";
} from "../helper/unlock";
import type { UnlockHistoryOutput } from "./actors/unlock";
import { sendMachineSetup } from "./send-flow";
import { createChatActorActionSetup } from "./setup";