chiltepin-render 0.33.2 → 0.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -74,11 +74,11 @@ body{background:var(--white);color:var(--charcoal);font-family:var(--font-body);
74
74
  .docskin .section{padding:0;margin-bottom:64px;}
75
75
  .docskin .section > *:last-child{margin-bottom:0;}
76
76
  .docskin .section-num{font-size:11px;text-transform:uppercase;letter-spacing:.14em;color:var(--soft);font-weight:700;margin-bottom:8px;}
77
- .docskin .section-head{margin-bottom:28px;padding-bottom:16px;border-bottom:2px solid var(--navy);}
77
+ .docskin .section-head{margin-bottom:28px;padding-bottom:16px;border-bottom:1px solid var(--rule-solid);}
78
78
  .docskin .section-head.bare{border-bottom:0;padding-bottom:0;margin-bottom:14px;}
79
79
  .docskin .section-head.bare .section-num{margin-bottom:0;font-size:10px;opacity:.8;}
80
80
  .docskin .section-head .section-title{border-bottom:0;padding-bottom:0;margin-bottom:14px;}
81
- .docskin .section-title{font-family:var(--font-display);font-weight:700;font-size:clamp(28px,3.6vw,40px);line-height:1.15;letter-spacing:-.01em;color:var(--navy);margin:0 0 14px;padding-bottom:12px;border-bottom:2px solid var(--navy);}
81
+ .docskin .section-title{font-family:var(--font-display);font-weight:700;font-size:clamp(28px,3.6vw,40px);line-height:1.15;letter-spacing:-.01em;color:var(--navy);margin:0 0 14px;padding-bottom:12px;border-bottom:1px solid var(--rule-solid);}
82
82
  .docskin .section-lede{font-size:16px;color:var(--slate);line-height:1.6;max-width:860px;margin:0;}
83
83
  .docskin .section-block{margin-bottom:64px;scroll-margin-top:16px;}
84
84
  .docskin .section-block:last-child{margin-bottom:0;}
@@ -278,7 +278,15 @@ body{background:var(--white);color:var(--charcoal);font-family:var(--font-body);
278
278
  .docskin .callout-body p{margin:0 0 8px;}
279
279
  .docskin .callout-body p:last-child{margin-bottom:0;}
280
280
  /* prose */
281
- .docskin .prose h2{font-family:var(--font-display);font-weight:700;font-size:clamp(24px,3vw,32px);line-height:1.15;letter-spacing:-.015em;color:var(--navy);margin:40px 0 14px;padding-bottom:12px;border-bottom:2px solid var(--navy);}
281
+ /* Markdown pipe tables and links inside prose: the same frame, header, and
282
+ row rules as the table block, so a GFM table never renders bare. */
283
+ .docskin .prose table{width:100%;border-collapse:separate;border-spacing:0;margin:18px 0;font-size:13px;border:1px solid var(--rule-solid);border-radius:6px;overflow:hidden;}
284
+ .docskin .prose thead th{background:var(--paper-2);color:var(--muted);text-align:left;padding:9px 12px;font-family:var(--font-mono);font-size:9.5px;text-transform:uppercase;letter-spacing:.12em;font-weight:500;border-bottom:1px solid var(--rule-solid);}
285
+ .docskin .prose td{padding:9px 12px;border-bottom:1px solid var(--rule-table);vertical-align:top;}
286
+ .docskin .prose tbody tr:last-child td{border-bottom:none;}
287
+ .docskin .prose tbody tr:nth-child(even){background:color-mix(in srgb,var(--paper-2) 50%,transparent);}
288
+ .docskin .prose a{color:var(--link);text-decoration:underline;text-underline-offset:2px;text-decoration-color:color-mix(in srgb,var(--link) 50%,transparent);}
289
+ .docskin .prose h2{font-family:var(--font-display);font-weight:700;font-size:clamp(24px,3vw,32px);line-height:1.15;letter-spacing:-.015em;color:var(--navy);margin:40px 0 14px;padding-bottom:12px;border-bottom:1px solid var(--rule-solid);}
282
290
  .docskin .prose h2:first-child{margin-top:0;}
283
291
  .docskin .prose h3{font-family:var(--font-display);font-weight:700;font-size:19px;letter-spacing:-.005em;color:var(--navy);margin:36px 0 12px;}
284
292
  .docskin .prose h4{font-family:var(--font-mono);font-size:10px;text-transform:uppercase;letter-spacing:.12em;font-weight:500;color:var(--muted);margin:22px 0 8px;}
@@ -371,7 +379,7 @@ body{background:var(--white);color:var(--charcoal);font-family:var(--font-body);
371
379
  .docskin .link-chip .lt{color:var(--gray);font-family:var(--font-mono);font-size:9px;text-transform:uppercase;letter-spacing:.06em;}
372
380
  a.link-chip,a.st-link{text-decoration:none;color:inherit;}
373
381
  a.link-chip:hover,a.st-link:hover{text-decoration:underline;}
374
- .docskin .footer{margin-top:8px;padding:18px 32px 28px;border-top:2px solid var(--navy);font-size:11px;color:var(--gray);text-transform:uppercase;letter-spacing:.1em;font-weight:700;display:flex;justify-content:space-between;flex-wrap:wrap;gap:10px;}
382
+ .docskin .footer{margin-top:8px;padding:18px 32px 28px;border-top:1px solid var(--rule-solid);font-size:11px;color:var(--gray);text-transform:uppercase;letter-spacing:.1em;font-weight:700;display:flex;justify-content:space-between;flex-wrap:wrap;gap:10px;}
375
383
  .docskin .footer .accent{color:var(--highlight);}
376
384
  .docskin .layer-label{font-family:var(--font-body);font-size:10.5px;font-weight:700;letter-spacing:.07em;text-transform:uppercase;}
377
385
  .docskin .uml-sep{stroke:var(--rule);stroke-width:1;}
@@ -5700,6 +5708,13 @@ function autoGrid(ids, edges, rankdir) {
5700
5708
  }
5701
5709
 
5702
5710
  // src/blocks/flow.ts
5711
+ var AI_CHIP = {
5712
+ agent: "AGENT",
5713
+ llm: "LLM",
5714
+ tool: "TOOL",
5715
+ human: "HUMAN",
5716
+ memory: "MEMORY"
5717
+ };
5703
5718
  function flowRevealOrder(nodes, edges) {
5704
5719
  const ids = new Set(nodes.map((n) => n.id));
5705
5720
  const indeg = /* @__PURE__ */ new Map();
@@ -5828,16 +5843,22 @@ function renderFlowSvg(data) {
5828
5843
  const cx = r5.x + r5.w / 2;
5829
5844
  const cy = r5.y + r5.h / 2;
5830
5845
  const accent = accentIds.has(n.id);
5831
- const stroke = accent ? "var(--accent)" : kind === "start" ? "var(--rule-solid)" : "var(--ink)";
5832
- const sw = accent ? 1.5 : kind === "start" ? 1 : 1.5;
5833
- const fill = accent ? "var(--accent-tint)" : kind === "start" ? "var(--paper-2)" : "var(--paper)";
5846
+ const chip3 = AI_CHIP[kind];
5847
+ const secondary2 = kind === "start" || kind === "memory";
5848
+ const stroke = accent ? "var(--accent)" : secondary2 ? "var(--rule-solid)" : "var(--ink)";
5849
+ const sw = accent ? 1.5 : secondary2 ? 1 : 1.5;
5850
+ const fill = accent ? "var(--accent-tint)" : secondary2 ? "var(--paper-2)" : "var(--paper)";
5851
+ const dash = kind === "human" ? ' stroke-dasharray="4 3"' : "";
5834
5852
  let shape;
5835
5853
  if (kind === "decision") {
5836
5854
  shape = `<polygon points="${cx},${r5.y} ${r5.x + r5.w},${cy} ${cx},${r5.y + r5.h} ${r5.x},${cy}" fill="${fill}" stroke="${stroke}" stroke-width="${sw}" stroke-linejoin="round"/>`;
5837
5855
  } else if (kind === "start" || kind === "end") {
5838
5856
  shape = `<rect x="${r5.x}" y="${r5.y}" width="${r5.w}" height="${r5.h}" rx="${r5.h / 2}" fill="${fill}" stroke="${stroke}" stroke-width="${sw}"/>`;
5839
5857
  } else {
5840
- shape = `<rect x="${r5.x}" y="${r5.y}" width="${r5.w}" height="${r5.h}" rx="4" fill="${fill}" stroke="${stroke}" stroke-width="${sw}"/>`;
5858
+ shape = `<rect x="${r5.x}" y="${r5.y}" width="${r5.w}" height="${r5.h}" rx="4" fill="${fill}" stroke="${stroke}" stroke-width="${sw}"${dash}/>`;
5859
+ }
5860
+ if (chip3 !== void 0) {
5861
+ shape += `<text x="${r5.x + 8}" y="${r5.y + 11}" class="blk-chip t-sub">${chip3}</text>`;
5841
5862
  }
5842
5863
  const nl = n.label.indexOf("\n");
5843
5864
  const name = nl >= 0 ? n.label.slice(0, nl) : n.label;
@@ -5845,12 +5866,13 @@ function renderFlowSvg(data) {
5845
5866
  const maxChars = kind === "decision" ? 18 : 20;
5846
5867
  const lines = sub.length > 0 ? wrapText(name, maxChars, 1) : wrapText(name, maxChars, 2);
5847
5868
  const tone = accent ? " c-accent" : "";
5869
+ const dy = chip3 !== void 0 ? 4 : 0;
5848
5870
  let texts = "";
5849
5871
  if (sub.length > 0) {
5850
- texts = `<text x="${cx}" y="${cy - 1}" class="fc-label t-name${tone}">${escapeHtml(lines[0] ?? name)}</text><text x="${cx}" y="${cy + 12}" class="fc-sub t-sub" text-anchor="middle">${escapeHtml(sub)}</text>`;
5872
+ texts = `<text x="${cx}" y="${cy - 1 + dy}" class="fc-label t-name${tone}">${escapeHtml(lines[0] ?? name)}</text><text x="${cx}" y="${cy + 12 + dy}" class="fc-sub t-sub" text-anchor="middle">${escapeHtml(sub)}</text>`;
5851
5873
  } else {
5852
5874
  texts = lines.map(
5853
- (ln2, j2) => `<text x="${cx}" y="${cy + 4.5 - (lines.length - 1) * 7.5 + j2 * 15}" class="fc-label t-name${tone}">${escapeHtml(ln2)}</text>`
5875
+ (ln2, j2) => `<text x="${cx}" y="${cy + 4.5 + dy - (lines.length - 1) * 7.5 + j2 * 15}" class="fc-label t-name${tone}">${escapeHtml(ln2)}</text>`
5854
5876
  ).join("");
5855
5877
  }
5856
5878
  s += `<g${bp(`nodes.${ni}`)}${nodeCellAttrs(n.col, n.row, n.w ?? 1)}${revealAttr(stepOf(n.id))}>${shape}${texts}</g>`;
@@ -5863,6 +5885,11 @@ function renderFlowSvg(data) {
5863
5885
  if (kindsUsed.has("start")) items.push({ swatch: "node-fill2", label: "start" });
5864
5886
  if (kindsUsed.has("process")) items.push({ swatch: "node", label: "step" });
5865
5887
  if (kindsUsed.has("decision")) items.push({ swatch: "node", label: "decision (diamond)" });
5888
+ if (kindsUsed.has("agent")) items.push({ swatch: "node", label: "AGENT \xB7 autonomous step" });
5889
+ if (kindsUsed.has("llm")) items.push({ swatch: "node", label: "LLM \xB7 model call" });
5890
+ if (kindsUsed.has("tool")) items.push({ swatch: "node", label: "TOOL \xB7 retrieval / API / code" });
5891
+ if (kindsUsed.has("human")) items.push({ swatch: "node-dashed", label: "HUMAN \xB7 review gate" });
5892
+ if (kindsUsed.has("memory")) items.push({ swatch: "node-fill2", label: "MEMORY \xB7 store" });
5866
5893
  if (kindsUsed.has("end") && [...accentIds].length < nodes.filter((n) => n.kind === "end").length) {
5867
5894
  items.push({ swatch: "node", label: "exit" });
5868
5895
  }