feat(ui): right-rail companion chat — streaming, tool chips, inline drafts

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
root
2026-06-01 19:34:27 +10:00
parent 19a20ba083
commit f49282b00c
5 changed files with 188 additions and 17 deletions

16
public/markdown.js Normal file
View File

@@ -0,0 +1,16 @@
// Shared markdown → sanitized HTML helper.
// Used by the companion chat rail and any other component that needs
// safe rendered markdown outside the full editor.
import { marked } from './vendor/marked.esm.js';
import DOMPurify from './vendor/purify.es.mjs';
marked.setOptions({ gfm: true, breaks: true });
/**
* Parse `src` as Markdown and return a DOMPurify-sanitized HTML string.
* Safe to assign to element.innerHTML.
*/
export function renderMarkdown(src) {
return DOMPurify.sanitize(marked.parse(src || ''));
}