Beautiful, AI-native markdown IDE and LLM wiki
TypeScript 2nd-brainagent-skillsclaudecodexcompany-braindocsknowledge-knowledge-baseknowledge-managementllmllm-wikillm-wiki-karpathymarkdownmarkdown-editormdmdxnotespkmsecond-brainskills
import { useReusableSession } from '@/components/reusable-session-store';
import { requestSendToOpenChat } from './open-chat-send';
import { dispatchComments } from './store';
import { useCommentDispatch } from './use-comment-delivery';
export function useSendQueue(): (threadIds?: readonly string[]) => void {
const composeFreshTurn = useCommentDispatch();
const openSession = useReusableSession();
const reusableThread = openSession?.kind === 'thread' ? openSession : null;
return (threadIds) => {
if (reusableThread === null) {
void dispatchComments({ compose: composeFreshTurn, threadIds });
return;
}
requestSendToOpenChat(threadIds);
};
}