// Renders the Digital Apprentice step cards into the shared stream (#log). // Consecutive steps of the same action collapse into one card. Cards render // INCREMENTALLY (append new, patch changed) so each entry animation fires once — // the staggered "steps slowly show up" reveal. A connector rail links the // check-circles down the left edge for a terminal/console feel. import { escapeHtml } from "./util.js"; const steps = []; const CARDS = { warmup: { title: "Waking the models", lead: "" }, recall: { title: "Memory", lead: "Checked your past jobs for anything similar." }, document: { title: "Document Capture", lead: "Read the handed-over document." }, perceive: { title: "Site Analysis", lead: "Reviewed the job and noted what's needed." }, price: { title: "Market Pricing", lead: "Pulled current prices for each part." }, add_priced_item: { title: "Market Pricing", lead: "Pulled current prices for each part." }, finish: { title: "Estimate Assembled", lead: "" }, assemble: { title: "Estimate Assembled", lead: "" }, }; function group(list) { const cards = []; for (const s of list) { const last = cards[cards.length - 1]; if (last && last.action === s.action) { last.details.push(s.detail); last.status = s.status; } else { cards.push({ action: s.action, status: s.status, details: [s.detail] }); } } return cards; } function cardInner(c) { const working = c.status === "active"; const marker = working ? '
' : 'check_circle'; const meta = CARDS[c.action] || { title: c.action, lead: "" }; const lead = meta.lead ? `${meta.lead}
` : ""; const items = c.details.length > 1 || meta.lead ? `${escapeHtml(c.details[0])}
`; return `${meta.title}
${lead}${items}Waiting for a job to forge…