Beautiful, AI-native markdown IDE and LLM wiki
TypeScript 2nd-brainagent-skillsclaudecodexcompany-braindocsknowledge-knowledge-baseknowledge-managementllmllm-wikillm-wiki-karpathymarkdownmarkdown-editormdmdxnotespkmsecond-brainskills
import type { Editor } from '@tiptap/core';
import type { Doc } from 'yjs';
export function getYDoc(editor: Editor): Doc | undefined {
if (editor.isDestroyed) return undefined;
const collabExt = editor.extensionManager.extensions.find((e) => e.name === 'collaboration');
return collabExt?.options?.document as Doc | undefined;
}