graff — a fast agentic coding harness in Zig: multi-provider, MCP, workflows, DGM evolution loop, TS/Python SDKs
Python
feat(gui): render LaTeX math in chat via KaTeX (#208)
justrachb22a3cf00d6f
diff --git a/bun.lock b/bun.lockindex 6f937279..dfc69cd7 100644--- a/bun.lock+++ b/bun.lock@@ -23,6 +23,7 @@"class-variance-authority": "^0.7.1","clsx": "^2.1.1","dockview-react": "^5.2.0",+ "katex": "^0.17.0","lucide-react": "^1.8.0","mermaid": "^11.15.0","react": "^19.2.4",@@ -40,6 +41,7 @@"@rolldown/plugin-babel": "^0.2.3","@tailwindcss/vite": "^4.2.2","@tauri-apps/cli": "^2.10.1",+ "@types/katex": "^0.16.8","@types/node": "^24.12.2","@types/react": "^19.2.14","@types/react-dom": "^19.2.3",@@ -500,6 +502,8 @@"@types/json-schema": ["@types/[email protected]", "", {}, "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA=="],+ "@types/katex": ["@types/[email protected]", "", {}, "sha512-trgaNyfU+Xh2Tc+ABIb44a5AYUpicB3uwirOioeOkNPPbmgRNtcWyDeeFRzjPZENO9Vq8gvVqfhaaXWLlevVwg=="],+"@types/node": ["@types/[email protected]", "", { "dependencies": { "undici-types": "~6.21.0" } }, "sha512-EANqOCF9QFyra+4pfxUcX9STKJpCLjMbObVzljIJomAWSnuSIEAvyzEU53GaajbXJEgdh0iEcPL+DGvpUd4k1Q=="],"@types/q": ["@types/[email protected]", "", {}, "sha512-hroOstUScF6zhIi+5+x0dzqrHA1EJi+Irri6b1fxolMTqqHIV/Cg77EtnQcZqZCu8hR3mX2BzIxN4/GzI68Kfw=="],@@ -632,7 +636,7 @@"color-name": ["[email protected]", "", {}, "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="],- "commander": ["[email protected]", "", {}, "sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw=="],+ "commander": ["[email protected]", "", {}, "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww=="],"concat-map": ["[email protected]", "", {}, "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="],@@ -1104,7 +1108,7 @@"jsonfile": ["[email protected]", "", { "dependencies": { "universalify": "^2.0.0" }, "optionalDependencies": { "graceful-fs": "^4.1.6" } }, "sha512-zwOTdL3rFQ/lRdBnntKVOX6k5cKJwEc1HdilT71BWEu7J41gXIB2MRp+vxduPSwZJPWBxEzv4yH1wYLJGUHX4Q=="],- "katex": ["[email protected]", "", { "dependencies": { "commander": "^8.3.0" }, "bin": { "katex": "cli.js" } }, "sha512-Eeo8Ys1doU1z+x8AZsPpQu+p/QcZBI5PeOo7QGQdy2x2m0MU/hYagBbGOmXwr5KVbEfVuWv9LpnQWeehogurjg=="],+ "katex": ["[email protected]", "", { "dependencies": { "commander": "^8.3.0" }, "bin": { "katex": "cli.js" } }, "sha512-Vdw0ATsQ9V+LuegM/BTwQqV/6cTl5lbGcIrU+BCgLxyf6bo38ybOr372tuSIxir3CN720flu1meYR6XzNMwQnw=="],"keyv": ["[email protected]", "", { "dependencies": { "json-buffer": "3.0.1" } }, "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw=="],@@ -1618,12 +1622,12 @@"is-inside-container/is-docker": ["[email protected]", "", { "bin": { "is-docker": "cli.js" } }, "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ=="],- "katex/commander": ["[email protected]", "", {}, "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww=="],-"log-symbols/chalk": ["[email protected]", "", {}, "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA=="],"log-symbols/is-unicode-supported": ["[email protected]", "", {}, "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ=="],+ "mermaid/katex": ["[email protected]", "", { "dependencies": { "commander": "^8.3.0" }, "bin": { "katex": "cli.js" } }, "sha512-Eeo8Ys1doU1z+x8AZsPpQu+p/QcZBI5PeOo7QGQdy2x2m0MU/hYagBbGOmXwr5KVbEfVuWv9LpnQWeehogurjg=="],+"mermaid/uuid": ["[email protected]", "", { "bin": { "uuid": "dist-node/bin/uuid" } }, "sha512-6ZxzVpzDXDa3bJWaHilVayA+BH/1zmxCJoVgvmqJnid/gPoKHxUrS/aC/T6LGQtNHT+XHG9fXPJB4d+IrU30Ew=="],"micromatch/picomatch": ["[email protected]", "", {}, "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA=="],@@ -1642,6 +1646,8 @@"restore-cursor/onetime": ["[email protected]", "", { "dependencies": { "mimic-function": "^5.0.0" } }, "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ=="],+ "shadcn/commander": ["[email protected]", "", {}, "sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw=="],+"shadcn/zod": ["[email protected]", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="],"svgo/chalk": ["[email protected]", "", { "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", "supports-color": "^5.3.0" } }, "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ=="],diff --git a/gui/package.json b/gui/package.jsonindex cffe8273..bc7c78f4 100644--- a/gui/package.json+++ b/gui/package.json@@ -30,6 +30,7 @@"class-variance-authority": "^0.7.1","clsx": "^2.1.1","dockview-react": "^5.2.0",+ "katex": "^0.17.0","lucide-react": "^1.8.0","mermaid": "^11.15.0","react": "^19.2.4",@@ -47,6 +48,7 @@"@rolldown/plugin-babel": "^0.2.3","@tailwindcss/vite": "^4.2.2","@tauri-apps/cli": "^2.10.1",+ "@types/katex": "^0.16.8","@types/node": "^24.12.2","@types/react": "^19.2.14","@types/react-dom": "^19.2.3",diff --git a/gui/src/components/chat/markdown/KatexMath.tsx b/gui/src/components/chat/markdown/KatexMath.tsxnew file mode 100644index 00000000..f037aac0--- /dev/null+++ b/gui/src/components/chat/markdown/KatexMath.tsx@@ -0,0 +1,52 @@+import { useMemo } from "react";+import katex from "katex";++// KaTeX renders math the local Markdown parser captured as `\[...\]`/`$$...$$`+// (display) or `\(...\)`/`$...$` (inline). renderToString is pure (no DOM), so+// this stays server-renderable and unit-testable. katex.min.css is bundled+// globally via src/styles/index.css (@import), mirroring how shadcn/tailwind.css+// is pulled in, so this component carries no CSS import the (non-Vite) test+// runner would fail to resolve.+//+// throwOnError:false makes an incomplete (still-streaming) or malformed formula+// render as a visible KaTeX error instead of throwing; trust:false keeps+// \href/\includegraphics and raw-HTML commands from injecting anything unsafe.+interface KatexMathProps {+ latex: string;+ display?: boolean;+}++export function KatexMath({ latex, display = false }: KatexMathProps) {+ const html = useMemo(() => {+ try {+ return katex.renderToString(latex, {+ displayMode: display,+ throwOnError: false,+ output: "htmlAndMathml",+ trust: false,+ strict: "ignore",+ });+ } catch {+ return null;+ }+ }, [latex, display]);++ if (html == null) {+ // renderToString unexpectedly threw: show the raw source rather than nothing.+ return display ? (+ <pre className="overflow-x-auto">+ <code>{latex}</code>+ </pre>+ ) : (+ <code>{latex}</code>+ );+ }++ if (display) {+ return (+ <div className="my-2 overflow-x-auto" dangerouslySetInnerHTML={{ __html: html }} />+ );+ }++ return <span dangerouslySetInnerHTML={{ __html: html }} />;+}diff --git a/gui/src/components/chat/markdown/MarkdownRenderer.test.tsx b/gui/src/components/chat/markdown/MarkdownRenderer.test.tsxindex dbb2116e..6e4f331d 100644--- a/gui/src/components/chat/markdown/MarkdownRenderer.test.tsx+++ b/gui/src/components/chat/markdown/MarkdownRenderer.test.tsx@@ -49,3 +49,35 @@ test("allows markdown links to workspace file paths", () => {expect(html).toContain('href="src/app.ts"');expect(html).toContain('href="/Users/example/project/src/app.ts"');});++// #208: agent responses emit LaTeX; the renderer must typeset it via KaTeX+// rather than showing raw source, while keeping code and unsafe input safe.+test("renders display math as typeset KaTeX, not raw source", () => {+ const html = renderToStaticMarkup(+ <MarkdownRenderer text={"\\[\nG \\approx 1+\\alpha\n\\]"} />,+ );+ expect(html).toContain("katex-display");+ expect(html).toContain('class="katex"');+});++test("renders inline $...$ as KaTeX while keeping surrounding text", () => {+ const html = renderToStaticMarkup(+ <MarkdownRenderer text={"The ratio $G = 1+\\alpha$ converges."} />,+ );+ expect(html).toContain('class="katex"');+ expect(html).toContain("converges");+});++test("leaves a $ inside inline code as code, not math", () => {+ const html = renderToStaticMarkup(<MarkdownRenderer text={"use `$x$` please"} />);+ expect(html).toContain("<code>$x$</code>");+ expect(html).not.toContain("katex");+});++test("sanitizes unsafe LaTeX: no javascript href or anchor is emitted", () => {+ const html = renderToStaticMarkup(+ <MarkdownRenderer text={"$\\href{javascript:alert(1)}{x}$"} />,+ );+ expect(html).not.toContain("<a ");+ expect(html).not.toMatch(/href\s*=\s*"javascript:/i);+});diff --git a/gui/src/components/chat/markdown/MarkdownRenderer.tsx b/gui/src/components/chat/markdown/MarkdownRenderer.tsxindex 74cf0bf9..4d225941 100644--- a/gui/src/components/chat/markdown/MarkdownRenderer.tsx+++ b/gui/src/components/chat/markdown/MarkdownRenderer.tsx@@ -12,6 +12,7 @@ import {import { openFilePathFromChat, openUrlFromChat } from "../utils/chatOpen";import { ChatTable } from "./ChatTable";import { CodeBlock } from "./CodeBlock";+import { KatexMath } from "./KatexMath";import { MermaidDiagram } from "./MermaidDiagram";import { dropRedundantCodeHeadings, parseMarkdown } from "./parser";import type { MdBlock, MdInline, MdListItem } from "./types";@@ -60,6 +61,8 @@ function renderBlock(block: MdBlock, workspacePath?: string | null): ReactNode {return <MermaidDiagram code={block.value} />;}return <CodeBlock value={block.value} lang={block.lang} />;+ case "math":+ return <KatexMath latex={block.value} display />;case "thematicBreak":return <hr className="border-border/70" />;case "blockquote":@@ -149,6 +152,8 @@ function renderInline(nodes: MdInline[], workspacePath?: string | null): ReactNoreturn <del key={index}>{renderInline(node.children, workspacePath)}</del>;case "code":return <code key={index}>{node.value}</code>;+ case "math":+ return <KatexMath key={index} latex={node.value} />;case "break":return <br key={index} />;case "link":diff --git a/gui/src/components/chat/markdown/parser.test.ts b/gui/src/components/chat/markdown/parser.test.tsindex 878ebf73..48566275 100644--- a/gui/src/components/chat/markdown/parser.test.ts+++ b/gui/src/components/chat/markdown/parser.test.ts@@ -142,3 +142,80 @@ describe("dropRedundantCodeHeadings", () => {expect(blocks.map((b) => b.type)).toEqual(["heading", "paragraph"]);});});++describe("parseMarkdown math (#208)", () => {+ test("parses a multi-line display block \\[ ... \\]", () => {+ const [block] = parseMarkdown("\\[\nG \\approx 1+\\alpha\n\\]");+ expect(block).toMatchObject({ type: "math", value: "G \\approx 1+\\alpha", closed: true });+ });++ test("parses single-line $$...$$ and \\[...\\] display blocks", () => {+ expect(parseMarkdown("$$x^2$$")[0]).toMatchObject({ type: "math", value: "x^2", closed: true });+ expect(parseMarkdown("\\[x^2\\]")[0]).toMatchObject({ type: "math", value: "x^2", closed: true });+ });++ test("renders an unclosed (streaming) display block as open math without throwing", () => {+ // Why: chat streams tokens; a half-arrived formula must degrade to open math+ // rather than swallow the rest of the message as a paragraph of backslashes.+ const [block] = parseMarkdown("\\[\nx^2");+ expect(block).toMatchObject({ type: "math", value: "x^2", closed: false });+ });++ test("parses inline \\( ... \\) and $ ... $ between text", () => {+ expect(parseInline("before \\(x^2\\) after")).toEqual([+ { type: "text", value: "before " },+ { type: "math", value: "x^2" },+ { type: "text", value: " after" },+ ]);+ expect(parseInline("before $x^2$ after")).toEqual([+ { type: "text", value: "before " },+ { type: "math", value: "x^2" },+ { type: "text", value: " after" },+ ]);+ });++ test("does not treat an escaped \\$ or prose currency as math", () => {+ expect(parseInline("costs \\$5 today")).toEqual([{ type: "text", value: "costs \\$5 today" }]);+ expect(parseInline("$5 and $10 total")).toEqual([{ type: "text", value: "$5 and $10 total" }]);+ // A price followed by a later `$word` must not span into inline math: the+ // closing `$` sits against a space, so it never closes a formula.+ expect(parseInline("I have $5 and $funds now")).toEqual([+ { type: "text", value: "I have $5 and $funds now" },+ ]);+ // Real inline math still parses (the closer hugs the content).+ expect(parseInline("math $x = 5$ here")).toEqual([+ { type: "text", value: "math " },+ { type: "math", value: "x = 5" },+ { type: "text", value: " here" },+ ]);+ });++ test("keeps a $ inside inline code and $$ inside a fence as code", () => {+ expect(parseInline("use `$x$` here")).toEqual([+ { type: "text", value: "use " },+ { type: "code", value: "$x$" },+ { type: "text", value: " here" },+ ]);+ expect(parseMarkdown("```\n$$x$$\n```")[0]).toMatchObject({ type: "code", value: "$$x$$" });+ });++ test("degrades an unclosed inline $ to literal text", () => {+ expect(parseInline("open $x math")).toEqual([{ type: "text", value: "open $x math" }]);+ });++ test("degrades empty/malformed delimiters to text instead of throwing", () => {+ // Empty content matches no math (the capture requires ≥1 char), so these stay+ // literal rather than producing an empty formula or crashing a stream.+ expect(parseInline("a $$ b")).toEqual([{ type: "text", value: "a $$ b" }]);+ expect(parseInline("a \\(\\) b")).toEqual([{ type: "text", value: "a \\(\\) b" }]);+ expect(parseInline("price is $")).toEqual([{ type: "text", value: "price is $" }]);+ });++ test("passes a literal $ inside \\( ... \\) to KaTeX verbatim, not as a nested delimiter", () => {+ expect(parseInline("\\(a $ b\\)")).toEqual([{ type: "math", value: "a $ b" }]);+ });++ test("preserves multi-byte characters inside math content", () => {+ expect(parseInline("$\\alpha é$")).toEqual([{ type: "math", value: "\\alpha é" }]);+ });+});diff --git a/gui/src/components/chat/markdown/parser.ts b/gui/src/components/chat/markdown/parser.tsindex c555db15..ed18fcbf 100644--- a/gui/src/components/chat/markdown/parser.ts+++ b/gui/src/components/chat/markdown/parser.ts@@ -13,6 +13,8 @@ const BLOCKQUOTE_RE = /^ {0,3}> ?(.*)$/;const UNORDERED_RE = /^(\s*)([-*+])\s+(.*)$/;const ORDERED_RE = /^(\s*)(\d{1,9})([.)])\s+(.*)$/;const TABLE_DELIM_RE = /^\s*\|?\s*:?-+:?\s*(\|\s*:?-+:?\s*)*\|?\s*$/;+// Display-math openers: \[ ... \] and $$ ... $$ (recognized at block level).+const MATH_BLOCK_OPEN_RE = /^\s*(\$\$|\\\[)/;export function parseMarkdown(input: string): MdBlock[] {const text = input.replace(/\r\n?/g, "\n");@@ -38,6 +40,13 @@ function parseBlocks(lines: string[]): MdBlock[] {continue;}+ // Display math (\[...\] / $$...$$) is checked before other blocks so its+ // delimiters are never mistaken for a paragraph or thematic break.+ if (MATH_BLOCK_OPEN_RE.test(line)) {+ i = pushMathBlock(blocks, lines, i);+ continue;+ }+if (THEMATIC_BREAK_RE.test(line)) {blocks.push({ type: "thematicBreak" });i += 1;@@ -119,6 +128,46 @@ function pushFence(return [i];}+function pushMathBlock(blocks: MdBlock[], lines: string[], start: number): number {+ const opener = lines[start].match(MATH_BLOCK_OPEN_RE)![1];+ const closer = opener === "$$" ? "$$" : "\\]";+ const afterOpener = lines[start].slice(lines[start].indexOf(opener) + opener.length);++ // Opener and closer on the same line, e.g. `\[ x^2 \]`.+ const sameLine = afterOpener.indexOf(closer);+ if (sameLine >= 0) {+ blocks.push({ type: "math", value: afterOpener.slice(0, sameLine).trim(), closed: true });+ return start + 1;+ }++ // Otherwise collect until a line containing the closer. An unclosed run (still+ // streaming) degrades to an open math block rather than swallowing the rest of+ // the message as a paragraph.+ const body: string[] = [];+ if (afterOpener.trim() !== "") {+ body.push(afterOpener);+ }+ let i = start + 1;+ let closed = false;+ while (i < lines.length) {+ const closeIndex = lines[i].indexOf(closer);+ if (closeIndex >= 0) {+ const before = lines[i].slice(0, closeIndex);+ if (before.trim() !== "") {+ body.push(before);+ }+ closed = true;+ i += 1;+ break;+ }+ body.push(lines[i]);+ i += 1;+ }++ blocks.push({ type: "math", value: body.join("\n").trim(), closed });+ return i;+}+function pushBlockquote(blocks: MdBlock[], lines: string[], start: number): number {const inner: string[] = [];let i = start;@@ -321,6 +370,7 @@ function startsNewBlock(lines: string[], i: number): boolean {const line = lines[i];return (FENCE_RE.test(line) ||+ MATH_BLOCK_OPEN_RE.test(line) ||THEMATIC_BREAK_RE.test(line) ||HEADING_RE.test(line) ||BLOCKQUOTE_RE.test(line) ||@@ -352,6 +402,7 @@ function inlineToPlainText(nodes: MdInline[]): string {switch (node.type) {case "text":case "code":+ case "math":return node.value;case "strong":case "em":@@ -381,6 +432,13 @@ const DEL_RE = /~~([\s\S]+?)~~/g;const EM_STAR_RE = /\*([\s\S]+?)\*/g;const EM_UNDER_RE = /(?<![A-Za-z0-9])_([\s\S]+?)_(?![A-Za-z0-9])/g;const LINK_RE = /\[([^\]]*)\]\(\s*(<[^>]*>|[^)\s]+)(?:\s+"[^"]*")?\s*\)/g;+// Inline math: \( ... \) and $ ... $. The dollar form is deliberately narrow —+// Inline math: \( ... \) and $ ... $. The dollar form is deliberately narrow —+// the opener/closer hug the content and must not sit against a digit or (for the+// closer) a space — so prose currency like "$5 and $10" or "$5 and $funds" stays+// text; an escaped \$ never opens either form.+const MATH_PAREN_RE = /\\\(([\s\S]+?)\\\)/g;+const MATH_DOLLAR_RE = /(?<![\\$0-9])\$(?![\s$])([^\n$]+?)(?<!\s)\$(?![\d$])/g;export function parseInline(text: string): MdInline[] {if (text === "") {@@ -413,6 +471,17 @@ function nextInlineMatch(text: string, from: number): InlineMatch | null {type: "code",value: trimCodeSpan(m[2]),}));+ // Inline math after code so a `$` inside a code span stays code (code wins the+ // earlier index). The captured LaTeX is passed to KaTeX verbatim, never+ // re-parsed as Markdown.+ pushCandidate(candidates, MATH_PAREN_RE, text, from, (m) => ({+ type: "math",+ value: m[1].trim(),+ }));+ pushCandidate(candidates, MATH_DOLLAR_RE, text, from, (m) => ({+ type: "math",+ value: m[1].trim(),+ }));pushCandidate(candidates, HARD_BREAK_RE, text, from, () => ({ type: "break" }));pushCandidate(candidates, LINK_RE, text, from, (m) => ({type: "link",@@ -445,7 +514,7 @@ function nextInlineMatch(text: string, from: number): InlineMatch | null {}// Earliest position wins; on ties the earlier-pushed (higher precedence:- // code, break, link, strong, del, em) candidate is kept.+ // code, math, break, link, strong, del, em) candidate is kept.candidates.sort((a, b) => a.index - b.index);return candidates[0];}diff --git a/gui/src/components/chat/markdown/types.ts b/gui/src/components/chat/markdown/types.tsindex f67d4f7f..1bae916a 100644--- a/gui/src/components/chat/markdown/types.ts+++ b/gui/src/components/chat/markdown/types.ts@@ -8,6 +8,7 @@ export type MdInline =| { type: "em"; children: MdInline[] }| { type: "del"; children: MdInline[] }| { type: "code"; value: string }+ | { type: "math"; value: string }| { type: "link"; href: string; children: MdInline[] }| { type: "break" };@@ -22,6 +23,8 @@ export type MdBlock =| { type: "paragraph"; children: MdInline[] }// `closed` is false while a fence is still being streamed (no closing ```).| { type: "code"; lang: string | null; value: string; closed: boolean }+ // Display math (\[...\] or $$...$$). `closed` is false while still streaming.+ | { type: "math"; value: string; closed: boolean }| { type: "blockquote"; children: MdBlock[] }| { type: "list"; ordered: boolean; start: number; items: MdListItem[] }| {diff --git a/gui/src/styles/index.css b/gui/src/styles/index.cssindex 224cd74f..8f964712 100644--- a/gui/src/styles/index.css+++ b/gui/src/styles/index.css@@ -3,3 +3,4 @@@import "./theme-presets.css";@import "./workspace.css";@import "./motion.css";+@import "katex/dist/katex.min.css";