// Flow view — input → processing → output for any sub-workflow
const { DG: FDG, DG70: FDG70, DG60: FDG60, DG50: FDG50, DG10: FDG10, DG06: FDG06, MINT: FMINT, BGMINT: FBGMINT, BGLIGHT: FBGLIGHT, SPINE: FSPINE } = window;
// ─────────────────────── MARKDOWN RENDERER ───────────────────────
// Minimal markdown → React. Supports: # headings, **bold**, *italic*, lists, tables, ---
const InlineMD = ({ text }) => {
// Render bold/italic/inline-code
const parts = [];
let rest = text;
let key = 0;
const regex = /(\*\*[^*]+\*\*|\*[^*]+\*|`[^`]+`)/g;
let last = 0;
let m;
while ((m = regex.exec(text)) !== null) {
if (m.index > last) parts.push(text.slice(last, m.index));
const tok = m[0];
if (tok.startsWith('**')) parts.push({tok.slice(2,-2)});
else if (tok.startsWith('*')) parts.push({tok.slice(1,-1)});
else if (tok.startsWith('`')) parts.push({tok.slice(1,-1)});
last = m.index + tok.length;
}
if (last < text.length) parts.push(text.slice(last));
return <>{parts}>;
};
const Markdown = ({ source }) => {
const lines = source.split('\n');
const blocks = [];
let i = 0;
let key = 0;
while (i < lines.length) {
const line = lines[i];
// HR
if (/^---+$/.test(line.trim())) {
blocks.push(
| {h} | )}
|---|
{assistant.tagline}