murashit_codex-panel/tests/features/chat/support/thread-stream.ts
2026-07-09 06:52:13 +09:00

14 lines
744 B
TypeScript

import type { ChatState } from "../../../../src/features/chat/application/state/root-reducer";
import { threadStreamItems, threadStreamWithItems } from "../../../../src/features/chat/application/state/thread-stream";
import type { ThreadStreamItem } from "../../../../src/features/chat/domain/thread-stream/items";
import { chatStateWith } from "./state";
export function chatStateThreadStreamItems(state: Pick<ChatState, "threadStream">): readonly ThreadStreamItem[] {
return threadStreamItems(state.threadStream);
}
export function withChatStateThreadStreamItems(state: ChatState, items: readonly ThreadStreamItem[]): ChatState {
return chatStateWith(state, {
threadStream: threadStreamWithItems(state.threadStream, items),
});
}