From be57821457ac3412b48e5e37db983a0fd6ec4c9e Mon Sep 17 00:00:00 2001 From: claude-bot <10+claude-bot@noreply.localhost> Date: Fri, 23 Oct 2026 05:46:45 +0000 Subject: [PATCH] Paper analysis articles in PostgreSQL (sections/blocks/links), rendered on the paper page; OctoTools analysis Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01FbMbJPadPzVwvt9rU9GBNo --- components/ArticleView.tsx | 171 +++++ components/Mermaid.tsx | 30 + content/articles/octotools.json | 752 +++++++++++++++++++++ db/analysis-schema.sql | 48 ++ lib/article-types.ts | 14 + lib/articles.ts | 39 ++ package-lock.json | 1112 +++++++++++++++++++++++++++++++ package.json | 1 + pages/papers/[id].tsx | 12 +- scripts/deploy.sh | 1 + scripts/load-articles.js | 111 +++ styles/globals.css | 23 + 12 files changed, 2311 insertions(+), 3 deletions(-) create mode 100644 components/ArticleView.tsx create mode 100644 components/Mermaid.tsx create mode 100644 content/articles/octotools.json create mode 100644 db/analysis-schema.sql create mode 100644 lib/article-types.ts create mode 100644 lib/articles.ts create mode 100644 scripts/load-articles.js diff --git a/components/ArticleView.tsx b/components/ArticleView.tsx new file mode 100644 index 0000000..3d29aaa --- /dev/null +++ b/components/ArticleView.tsx @@ -0,0 +1,171 @@ +import Link from 'next/link'; +import dynamic from 'next/dynamic'; +import { Fragment, ReactNode } from 'react'; +import type { ArticleData, Block, Section } from '../lib/article-types'; + +const Mermaid = dynamic(() => import('./Mermaid'), { ssr: false, loading: () =>
Loading diagram…
}); + +const PALETTE = ['#2f5bea', '#e0702b', '#1b9e77', '#a14b9c', '#c9a227', '#d6336c', '#37a0d6']; + +/* ---------- inline markdown: **bold**, *italic*, `code`, [text](url) ---------- */ +const safeHref = (u: string) => /^(https?:\/\/|\/|#|mailto:)/.test(u); +export function inline(s: string): ReactNode[] { + const out: ReactNode[] = []; + const re = /(\[[^\]]+\]\([^)\s]+\))|(\*\*[^*]+\*\*)|(\*[^*\s][^*]*\*)|(`[^`]+`)/g; + let last = 0; let m: RegExpExecArray | null; let k = 0; + while ((m = re.exec(s))) { + if (m.index > last) out.push(s.slice(last, m.index)); + const t = m[0]; + if (m[1]) { + const [, text, url] = t.match(/^\[([^\]]+)\]\(([^)\s]+)\)$/)!; + if (!safeHref(url)) out.push(text); + else if (url.startsWith('/') || url.startsWith('#')) out.push({text}); + else out.push({text} ↗); + } else if (m[2]) out.push({inline(t.slice(2, -2))}); + else if (m[3]) out.push({t.slice(1, -1)}); + else out.push({t.slice(1, -1)}); + last = m.index + t.length; + } + if (last < s.length) out.push(s.slice(last)); + return out; +} + +function MarkdownBlock({ text }: { text: string }) { + return ( + <> + {text.replace(/\r/g, '').split(/\n{2,}/).map((raw, i) => { + const src = raw.trim(); + if (!src) return null; + const h = src.match(/^(#{3,4})\s+(.*)$/); + if (h && !src.includes('\n')) return h[1].length === 3 ?

{inline(h[2])}

:

{inline(h[2])}

; + const lines = src.split('\n'); + if (lines.every((l) => /^\s*[-*]\s+/.test(l))) return ; + if (lines.every((l) => /^\s*\d+[.)]\s+/.test(l))) return
    {lines.map((l, j) =>
  1. {inline(l.replace(/^\s*\d+[.)]\s+/, ''))}
  2. )}
; + return

{inline(lines.join(' '))}

; + })} + + ); +} + +/* ---------- horizontal bar chart (SVG) ---------- */ +function BarChart({ d }: { d: Extract['data'] }) { + const rowH = 22 + (d.series.length - 1) * 12, W = 640, L = 170, R = 56, top = 8; + const H = top + d.labels.length * (rowH + 8) + 4; + const max = Math.max(...d.series.flatMap((s) => s.values), 0) || 1; + const X = (v: number) => (v / max) * (W - L - R); + const fmt = (v: number) => (Number.isInteger(v) ? String(v) : v.toFixed(1)) + (d.unit ?? ''); + return ( +
+
{d.title}
+ + {d.labels.map((lab, i) => { + const y = top + i * (rowH + 8); + return ( + + {lab.length > 26 ? lab.slice(0, 25) + '…' : lab}{lab} + {d.series.map((s, j) => { + const h = rowH / d.series.length, yy = y + j * h; + const hi = d.highlight?.includes(i); + return ( + + + {`${lab}${d.series.length > 1 ? ' · ' + s.name : ''}: ${fmt(s.values[i])}`} + + {fmt(s.values[i])} + + ); + })} + + ); + })} + + {d.series.length > 1 &&
{d.series.map((s, j) => {s.name})}
} + {d.note &&
{d.note}
} +
+ ); +} + +function BlockView({ b }: { b: Block }) { + switch (b.type) { + case 'markdown': return ; + case 'list': { + const Tag = b.data.ordered ? 'ol' : 'ul'; + return {b.data.items.map((it, i) =>
  • {inline(it)}
  • )}
    ; + } + case 'callout': + return
    {b.data.title && {b.data.title}. }{inline(b.data.text)}
    ; + case 'table': { + const d = b.data; + return ( +
    + {d.caption &&
    {d.caption}
    } +
    + + {d.columns.map((c, i) => )} + {d.rows.map((r, i) => {r.map((c, j) => )})} +
    {c}
    {inline(c)}
    +
    +
    + ); + } + case 'chart': return ; + case 'mermaid': return ; + case 'figure': + return /^(https:\/\/|\/)/.test(b.data.src) + ?
    {b.data.alt}{b.data.caption &&
    {b.data.caption}
    }
    + : null; + case 'code': return
    {b.data.text}
    ; + } +} + +function SectionView({ s, id }: { s: Section; id: string }) { + const H = (s.level <= 2 ? 'h2' : 'h3') as 'h2' | 'h3'; + return ( +
    + {s.title} + {s.blocks.map((b, i) => )} + {s.children.map((c) => )} +
    + ); +} + +const toc = (secs: Section[], id: string, depth = 0): ReactNode => + secs.map((s) => ( + + {s.title} + {toc(s.children, id, depth + 1)} + + )); + +export default function ArticleView({ a }: { a: ArticleData }) { + return ( +
    +
    + Analysis +

    {a.title}

    + {a.summary &&

    {a.summary}

    } +

    revision {a.revision} · updated {a.updatedAt}

    +
    +
    + +
    + {a.sections.map((s) => )} + {a.links.length > 0 && ( +
    +

    Links

    +
      + {a.links.map((l) => ( +
    • + {l.kind}{' '} + {l.url.startsWith('/') ? {l.title} : {l.title} ↗} + {l.note && — {l.note}} +
    • + ))} +
    +
    + )} +
    +
    +
    + ); +} diff --git a/components/Mermaid.tsx b/components/Mermaid.tsx new file mode 100644 index 0000000..06649da --- /dev/null +++ b/components/Mermaid.tsx @@ -0,0 +1,30 @@ +import { useEffect, useRef, useState } from 'react'; + +/** Mermaid.js diagram, rendered in the browser; the source is shown until it is ready (and if it fails). */ +export default function Mermaid({ code, caption }: { code: string; caption?: string }) { + const [svg, setSvg] = useState(''); + const [err, setErr] = useState(''); + const id = useRef('mmd' + Math.random().toString(36).slice(2)); + useEffect(() => { + let off = false; + (async () => { + try { + const mermaid = (await import('mermaid')).default; + const dark = window.matchMedia('(prefers-color-scheme: dark)').matches; + mermaid.initialize({ startOnLoad: false, securityLevel: 'strict', theme: dark ? 'dark' : 'default', flowchart: { htmlLabels: true, curve: 'basis' } }); + const out = await mermaid.render(id.current, code); + if (!off) setSvg(out.svg); + } catch (e) { + if (!off) setErr(String((e as Error).message ?? e)); + } + })(); + return () => { off = true; }; + }, [code]); + return ( +
    + {svg ?
    :
    {code}
    } + {err &&

    Diagram could not be drawn: {err}

    } + {caption &&
    {caption}
    } +
    + ); +} diff --git a/content/articles/octotools.json b/content/articles/octotools.json new file mode 100644 index 0000000..5b611da --- /dev/null +++ b/content/articles/octotools.json @@ -0,0 +1,752 @@ +{ + "slug": "octotools-contribution-and-evaluation", + "subject": { + "conf": "acl2026", + "ext_id": "2026.acl-long.1" + }, + "title": "OctoTools: key contribution and how it is evaluated", + "summary": "A training-free planner–executor framework that wraps every tool in a standardized “tool card”, evaluated on 16 benchmarks against zero-shot, chain-of-thought and three agent frameworks.", + "sections": [ + { + "key": "key-contribution", + "title": "Key contribution", + "level": 2, + "blocks": [ + { + "type": "callout", + "data": { + "tone": "info", + "title": "In one sentence", + "text": "OctoTools lets an LLM solve complex reasoning tasks by **planning and executing multi-step tool calls without any finetuning**, by putting every tool behind a **standardized tool card** and separating a **planner** (what to do next) from an **executor** (how to call the tool)." + } + }, + { + "type": "markdown", + "data": { + "text": "### What the paper claims\n\nThe Introduction (§1) lists four contributions:" + } + }, + { + "type": "list", + "data": { + "ordered": true, + "items": [ + "**A training-free, modular, extensible multi-agent framework**: OctoTools, which solves tasks “by planning and executing multi-step tool calls without finetuning”.", + "**A planner–executor paradigm with standardized tool cards**, “to simplify tool integration and improve reliability”.", + "**Large-scale experiments on 16 diverse benchmarks**, which the authors call “one of the most systematic evaluations of agentic systems to date” (their wording).", + "**In-depth analyses and ablations** that separate the contribution of multi-step planning from that of tool usage." + ] + } + }, + { + "type": "markdown", + "data": { + "text": "### How it works\n\nFive pieces make up the framework (§2):" + } + }, + { + "type": "table", + "data": { + "columns": [ + "Component", + "What it does", + "Where" + ], + "rows": [ + [ + "**Tool cards**", + "A standardized wrapper around each tool. The metadata holds the tool's name, version, input/output types and command demonstrations, and can add usage constraints such as limitations and best practices.", + "§2.2, Fig. 2–3" + ], + [ + "**Planner**", + "High-level planning builds a global plan at the start (the query analyzer); low-level planning (the action predictor) then picks one sub-goal, one tool and the context for it at every step.", + "§2.3, Fig. 2" + ], + [ + "**Executor**", + "The command generator turns the planner's text action into an executable Python call; the command executor runs it and stores action, command and result in the trajectory.", + "§2.4, Fig. 2" + ], + [ + "**Context verifier and solution summarizer**", + "The verifier checks whether the context so far solves the query (completeness, ambiguity) and decides to continue or stop; the summarizer writes the final answer from the whole trajectory.", + "§2.3, App. D.4" + ], + [ + "**Task-specific toolset optimization**", + "A greedy search run once per task: start from the base toolset, test each candidate tool added on its own, keep the tools that individually improve validation accuracy.", + "§2.5, Alg. 1" + ] + ] + } + }, + { + "type": "mermaid", + "data": { + "caption": "One problem-solving loop (Fig. 3, §2.1, App. D.1). The loop also ends when the step or time budget is reached.", + "code": "flowchart TD\n Q([\"Query\"]) --> QA[\"Query analyzer
    high-level plan\"]\n QA --> AP[\"Action predictor
    low-level plan: tool + sub-goal + context\"]\n TB[(\"Toolbox
    tool cards\")] -.-> AP\n AP --> CG[\"Command generator
    text action to Python call\"]\n TB -.-> CG\n CG --> CE[\"Command executor
    runs the tool\"]\n CE --> TR[(\"Trajectory
    action, command, result\")]\n TR --> CV{\"Context verifier
    solved?\"}\n CV -- no --> AP\n CV -- yes --> SS[\"Solution summarizer\"]\n SS --> A([\"Answer\"])" + } + }, + { + "type": "mermaid", + "data": { + "caption": "Task-specific toolset optimization, run once per task before the loop (Algorithm 1, §2.5).", + "code": "flowchart LR\n B[\"1. Baseline
    base toolset only,
    validation set\"] --> T[\"2. Add each candidate tool
    on its own
    and measure the accuracy change\"] --> K[\"3. Keep every tool
    with a positive change\"] --> O([\"Task-specific toolset\"])" + } + }, + { + "type": "markdown", + "data": { + "text": "The toolbox the paper ships has 11 tools in the main set and 3 more for exploration; they are listed with their tool-card locations in the [tools table](/contents/tools-of-agents)." + } + } + ] + }, + { + "key": "evaluation", + "title": "How it is evaluated", + "level": 2, + "blocks": [ + { + "type": "markdown", + "data": { + "text": "### Setup (§3.1, Table 1, App. B.1, C.3)\n\n- **16 benchmarks**, which the paper describes as spanning “two modalities, five domains, and four reasoning types”. The metric is **accuracy (%)**, reported as mean ± standard deviation over **three trials**.\n\n- **Data split:** 100 examples per benchmark form a validation set (used for toolset optimization and ablations); a held-out **test set of 200 examples** gives the final numbers. Benchmarks with fewer than 300 samples use all remaining samples as the test set.\n\n- **Base LLM:** `gpt-4o-2024-08-06`. Other backbones are tried in the analyses (below).\n\n- **Baselines:** zero-shot; chain-of-thought (“Think step by step”); *OctoTools base* (only the Generalist_Solution_Generator tool); and three agent frameworks, **AutoGen, GPT-Functions and LangChain**, given the same model and the same tools, with a maximum of **10 steps** and a **300-second** budget." + } + }, + { + "type": "table", + "data": { + "caption": "The 16 benchmarks, grouped as in Table 1", + "columns": [ + "Group", + "Benchmarks" + ], + "rows": [ + [ + "General (vision)", + "AlgoPuzzleVQA, Hallusion-VD, PuzzleVQA, VQA 2.0" + ], + [ + "Mathematical", + "Game of 24, Omni-MATH, CLEVR-Math, MathVista" + ], + [ + "Scientific", + "GPQA, MMLU-Pro, SciFIBench" + ], + [ + "Medical", + "MedQA, PathCLS, PathVQA, SLAKE" + ], + [ + "Agentic", + "GAIA-Text (text-only subset)" + ] + ] + } + }, + { + "type": "markdown", + "data": { + "text": "### Main results" + } + }, + { + "type": "chart", + "data": { + "kind": "bar", + "title": "Average accuracy over the 16 benchmarks", + "unit": "%", + "note": "Tables 1 and 2. Values recomputed from the per-task rows below and equal the paper's printed averages.", + "labels": [ + "Zero-shot", + "Chain-of-thought", + "OctoTools base", + "AutoGen", + "GPT-Functions", + "LangChain", + "OctoTools" + ], + "series": [ + { + "name": "Average accuracy", + "values": [ + 49.2, + 50.8, + 53.4, + 47.9, + 51.0, + 51.2, + 58.5 + ] + } + ], + "highlight": [ + 6 + ] + } + }, + { + "type": "markdown", + "data": { + "text": "OctoTools improves on zero-shot GPT-4o by **9.3 points** and on chain-of-thought by **7.7**. Against the agent frameworks with the same tools it leads by **10.6 over AutoGen, 7.5 over GPT-Functions and 7.3 over LangChain**, the best of the three (the abstract says “up to 10.6%”)." + } + }, + { + "type": "chart", + "data": { + "kind": "bar", + "title": "Gain over zero-shot GPT-4o, per benchmark", + "unit": " pts", + "note": "Δ(0-shot) column of Table 1.", + "labels": [ + "AlgoPuzzleVQA", + "Hallusion-VD", + "PuzzleVQA", + "VQA 2.0", + "Game of 24", + "Omni-MATH", + "CLEVR-Math", + "MathVista", + "GPQA", + "MMLU-Pro", + "SciFIBench", + "MedQA", + "PathCLS", + "PathVQA", + "SLAKE", + "GAIA-Text" + ], + "series": [ + { + "name": "OctoTools minus zero-shot", + "values": [ + 7.4, + 11.3, + 8.8, + 4.2, + 22.5, + 5.2, + 14.5, + 5.0, + 1.0, + 2.0, + 5.8, + 7.0, + 22.2, + 17.2, + 4.5, + 9.7 + ] + } + ] + } + }, + { + "type": "table", + "data": { + "caption": "Table 1: accuracy (%) against zero-shot, chain-of-thought and OctoTools base (mean over three trials; standard deviations omitted here)", + "numeric": true, + "highlightCol": 4, + "columns": [ + "Benchmark", + "0-shot", + "CoT", + "OctoTools base", + "OctoTools", + "Δ vs 0-shot", + "Δ vs CoT" + ], + "rows": [ + [ + "AlgoPuzzleVQA", + "41.3", + "42.7", + "44.0", + "48.7", + "+7.4", + "+6.0" + ], + [ + "Hallusion-VD", + "52.0", + "53.3", + "59.0", + "63.3", + "+11.3", + "+10.0" + ], + [ + "PuzzleVQA", + "52.2", + "54.0", + "59.3", + "61.0", + "+8.8", + "+7.0" + ], + [ + "VQA 2.0", + "50.3", + "48.7", + "47.2", + "54.5", + "+4.2", + "+5.8" + ], + [ + "Game of 24", + "22.2", + "33.3", + "37.8", + "44.7", + "+22.5", + "+11.4" + ], + [ + "Omni-MATH", + "27.0", + "29.3", + "30.2", + "32.2", + "+5.2", + "+2.9" + ], + [ + "CLEVR-Math", + "64.5", + "75.2", + "68.8", + "79.0", + "+14.5", + "+3.8" + ], + [ + "MathVista", + "59.3", + "59.5", + "63.0", + "64.3", + "+5.0", + "+4.8" + ], + [ + "GPQA", + "53.7", + "52.3", + "53.7", + "54.7", + "+1.0", + "+2.4" + ], + [ + "MMLU-Pro", + "71.7", + "70.3", + "71.5", + "73.7", + "+2.0", + "+3.4" + ], + [ + "SciFIBench", + "72.5", + "75.0", + "77.3", + "78.3", + "+5.8", + "+3.3" + ], + [ + "MedQA", + "84.5", + "84.8", + "92.8", + "91.5", + "+7.0", + "+6.7" + ], + [ + "PathCLS", + "36.0", + "37.5", + "37.0", + "58.2", + "+22.2", + "+20.7" + ], + [ + "PathVQA", + "32.0", + "27.8", + "43.5", + "49.2", + "+17.2", + "+21.4" + ], + [ + "SLAKE", + "59.3", + "60.3", + "59.2", + "63.8", + "+4.5", + "+3.5" + ], + [ + "GAIA-Text", + "8.7", + "8.4", + "9.7", + "18.4", + "+9.7", + "+10.0" + ], + [ + "**Average**", + "**49.2**", + "**50.8**", + "**53.4**", + "**58.5**", + "**+9.3**", + "**+7.7**" + ] + ] + } + }, + { + "type": "table", + "data": { + "caption": "Table 2: accuracy (%) against other agent frameworks with the same model and tools", + "numeric": true, + "highlightCol": 4, + "columns": [ + "Benchmark", + "AutoGen", + "GPT-Functions", + "LangChain", + "OctoTools" + ], + "rows": [ + [ + "AlgoPuzzleVQA", + "44.0", + "44.5", + "42.7", + "48.7" + ], + [ + "Hallusion-VD", + "52.7", + "57.0", + "53.7", + "63.3" + ], + [ + "PuzzleVQA", + "40.0", + "52.5", + "53.5", + "61.0" + ], + [ + "VQA 2.0", + "46.0", + "45.5", + "54.0", + "54.5" + ], + [ + "Game of 24", + "24.2", + "34.5", + "18.3", + "44.7" + ], + [ + "Omni-MATH", + "28.5", + "22.8", + "29.7", + "32.2" + ], + [ + "CLEVR-Math", + "69.5", + "71.2", + "69.2", + "79.0" + ], + [ + "MathVista", + "24.7", + "54.5", + "55.7", + "64.3" + ], + [ + "GPQA", + "48.7", + "45.8", + "52.2", + "54.7" + ], + [ + "MMLU-Pro", + "65.0", + "65.8", + "70.3", + "73.7" + ], + [ + "SciFIBench", + "70.0", + "68.8", + "77.0", + "78.3" + ], + [ + "MedQA", + "83.7", + "84.8", + "73.7", + "91.5" + ], + [ + "PathCLS", + "58.0", + "58.2", + "56.3", + "58.2" + ], + [ + "PathVQA", + "42.7", + "42.8", + "45.7", + "49.2" + ], + [ + "SLAKE", + "62.2", + "59.7", + "59.3", + "63.8" + ], + [ + "GAIA-Text", + "6.3", + "7.9", + "7.6", + "18.4" + ], + [ + "**Average**", + "**47.9**", + "**51.0**", + "**51.2**", + "**58.5**" + ] + ] + } + }, + { + "type": "callout", + "data": { + "tone": "note", + "title": "Reading the tables", + "text": "Counting rows of Table 2, OctoTools is at least as high as every other framework on **16 of 16** benchmarks and strictly higher on **15**; the tie is PathCLS (58.2 for both GPT-Functions and OctoTools). In Table 1 it is below its own base configuration on one benchmark, **MedQA** (91.5 against 92.8). Several differences are small next to the reported standard deviations, for example GPQA (+1.0 over zero-shot, ±1.9 and ±1.3)." + } + }, + { + "type": "markdown", + "data": { + "text": "### Ablations and analyses (§3.4, §4, App. C)" + } + }, + { + "type": "table", + "data": { + "caption": "What the analyses show", + "columns": [ + "Question", + "Finding", + "Where" + ], + "rows": [ + [ + "Is the toolset optimization worth it?", + "Base toolset **53.9%**, all tools enabled **57.4%** (+3.5), optimized toolset **58.9%** (+5.0).", + "Fig. 7, §4" + ], + [ + "Does more planning help?", + "Average accuracy generally rises as the maximum number of steps goes from 1 to 10; the paper gives no exact values in the text.", + "Fig. 6, §4" + ], + [ + "How are tools used?", + "OctoTools makes 32.2% of calls to the base tool and 67.8% to external tools; external-tool share is 10.6% for AutoGen, 23.3% for GPT-Functions and 10.7% for LangChain.", + "Fig. 4a, §3.4" + ], + [ + "Does it help weaker or other models?", + "Gains over each backbone's own baseline: GPT-4o-mini +7.1 on all 16 tasks; Claude 3.5 Haiku +7.4, Gemini 2.5 Pro +6.9, Grok-2 Vision +8.4, Qwen2.5-VL-72B +5.8.", + "Fig. 8–9" + ], + [ + "Does it help small open models?", + "Qwen2.5-3B: 23.5 to 37.2 (+13.6). Qwen2.5-7B: 34.1 to 40.3 (+6.3). Four tasks only (GAIA, Game of 24, GPQA, MedQA).", + "Table 3" + ], + [ + "What if tools fail?", + "With Qwen2.5-7B and tool failures injected at random, the paper states that “up to p=0.4, the average drop on 10 tasks is at most 1.6%”.", + "Table 4, §4" + ], + [ + "What does it cost?", + "GPT-4o: about 0.05 per query, 2.56 steps on average, 58.8 s. GPT-4o-mini: 0.01, 3.49 steps, 63.4 s. Gemini 2.5 Pro: 0.15, 216.2 s.", + "Table 6, §C.3" + ], + [ + "Do users like it?", + "The public demo had 22.9K visits and 3.6K queries; of 100 sampled feedback entries, 69% were positive.", + "§C.4" + ] + ] + } + }, + { + "type": "chart", + "data": { + "kind": "bar", + "title": "Gain from OctoTools on other backbones", + "unit": " pts", + "note": "Figures 8 and 9, as labelled in the paper.", + "labels": [ + "GPT-4o-mini", + "Claude 3.5 Haiku", + "Gemini 2.5 Pro", + "Grok-2 Vision", + "Qwen2.5-VL-72B" + ], + "series": [ + { + "name": "Average gain", + "values": [ + 7.1, + 7.4, + 6.9, + 8.4, + 5.8 + ] + } + ] + } + }, + { + "type": "chart", + "data": { + "kind": "bar", + "title": "Why runs fail (200 failures, a failure can have several causes)", + "unit": "%", + "note": "Table 5.", + "labels": [ + "Weak or incapable tools", + "Imperfect low-level plan", + "Imperfect high-level plan", + "Tool execution errors", + "Incorrect summarization", + "Invalid tool command" + ], + "series": [ + { + "name": "Share of failures", + "values": [ + 65.0, + 45.0, + 32.5, + 18.0, + 6.0, + 1.5 + ] + } + ] + } + } + ] + }, + { + "key": "limitations", + "title": "Limitations the authors state", + "level": 2, + "blocks": [ + { + "type": "list", + "data": { + "items": [ + "Performance depends on the base LLM's planning, code generation and summarization.", + "The framework assumes tools are accurate and accessible; restricted environments may reduce the benefit.", + "The greedy toolset search is not globally optimal and relies on validation data that may be scarce or biased.", + "Multi-step planning adds latency and cost; some queries take more than 90 seconds.", + "Code execution and external APIs raise security, privacy and bias concerns that the study does not fully audit.", + "Results can drift with third-party services; the authors suggest snapshotting tool versions." + ] + } + } + ] + }, + { + "key": "notes", + "title": "Notes on this analysis", + "level": 2, + "blocks": [ + { + "type": "callout", + "data": { + "tone": "warn", + "title": "Inconsistency in the paper's numbers", + "text": "Section 4 / Figure 7 gives 53.9% for the base toolset and 58.9% for the optimized toolset, while Table 1 gives 53.4 for OctoTools base and 58.5 for OctoTools. I did not find an explanation for the gap in the text I read." + } + }, + { + "type": "markdown", + "data": { + "text": "Everything above is taken from the paper itself (the ACL Anthology PDF, cross-checked against the arXiv version for the abstract, Tables 1–2 and the ablation findings); nothing is from other sources. Averages, per-task gains and the gains over other frameworks were recomputed from the table rows and match the printed values. Cross-checked between the two versions: the abstract, Tables 1–2 and the ablation findings. Figure 4, Tables 3, 5 and 6, and §C.4 were read in the ACL PDF only. For Table 4 only the paper's own sentence is quoted, because the per-rate values I extracted did not match it cleanly. The last 5,692 characters of the arXiv text were not read. The project page named in the paper does not give a separate code URL in the text I read." + } + } + ] + } + ], + "links": [ + { + "kind": "paper", + "title": "OctoTools on the ACL Anthology (ACL 2026)", + "url": "https://aclanthology.org/2026.acl-long.1/" + }, + { + "kind": "paper", + "title": "OctoTools PDF (ACL Anthology)", + "url": "https://aclanthology.org/2026.acl-long.1.pdf" + }, + { + "kind": "paper", + "title": "OctoTools on arXiv (2502.11271)", + "url": "https://arxiv.org/abs/2502.11271" + }, + { + "kind": "project", + "title": "OctoTools project page", + "url": "https://octotools.github.io/", + "note": "Named in the paper (Fig. 3 caption); lists code, demo, tool cards and video." + }, + { + "kind": "related", + "title": "Tools designed by papers (this site)", + "url": "/contents/tools-of-agents", + "note": "The 14 OctoTools tools with their tool-card locations." + } + ] +} \ No newline at end of file diff --git a/db/analysis-schema.sql b/db/analysis-schema.sql new file mode 100644 index 0000000..f153468 --- /dev/null +++ b/db/analysis-schema.sql @@ -0,0 +1,48 @@ +-- Analysis articles: one article per (paper, topic); each article has its own ordered, nestable sections; +-- each section is an ordered list of typed blocks. Lives in its own schema so the data rebuild +-- (which replaces schema "live" on every deploy) never touches it. +CREATE SCHEMA IF NOT EXISTS analysis; + +CREATE TABLE IF NOT EXISTS analysis.article ( + id bigserial PRIMARY KEY, + slug text NOT NULL UNIQUE, + subject_conf text NOT NULL, -- the paper this is about, by its stable key (conf, ext_id): + subject_ext_id text NOT NULL, -- papers.id is not stable across data rebuilds + title text NOT NULL, + summary text, + revision integer NOT NULL DEFAULT 1, + created_at timestamptz NOT NULL DEFAULT now(), + updated_at timestamptz NOT NULL DEFAULT now() +); +CREATE INDEX IF NOT EXISTS idx_article_subject ON analysis.article (subject_conf, subject_ext_id); + +CREATE TABLE IF NOT EXISTS analysis.section ( + id bigserial PRIMARY KEY, + article_id bigint NOT NULL REFERENCES analysis.article(id) ON DELETE CASCADE, + parent_id bigint REFERENCES analysis.section(id) ON DELETE CASCADE, -- nesting + key text NOT NULL, -- anchor / stable name, e.g. 'key-contribution' + title text NOT NULL, + level integer NOT NULL DEFAULT 2, -- heading level (2 or 3) + position integer NOT NULL, -- order among siblings + UNIQUE (article_id, key) +); + +CREATE TABLE IF NOT EXISTS analysis.block ( + id bigserial PRIMARY KEY, + section_id bigint NOT NULL REFERENCES analysis.section(id) ON DELETE CASCADE, + position integer NOT NULL, + type text NOT NULL CHECK (type IN ('markdown','list','callout','table','chart','mermaid','figure','code')), + data jsonb NOT NULL, -- shape depends on type (see scripts/load-articles.js) + UNIQUE (section_id, position) +); + +CREATE TABLE IF NOT EXISTS analysis.link ( + id bigserial PRIMARY KEY, + article_id bigint NOT NULL REFERENCES analysis.article(id) ON DELETE CASCADE, + section_id bigint REFERENCES analysis.section(id) ON DELETE SET NULL, + position integer NOT NULL, + kind text NOT NULL CHECK (kind IN ('paper','code','project','demo','dataset','related','other')), + title text NOT NULL, + url text NOT NULL, + note text +); diff --git a/lib/article-types.ts b/lib/article-types.ts new file mode 100644 index 0000000..0d5fe03 --- /dev/null +++ b/lib/article-types.ts @@ -0,0 +1,14 @@ +// Client-safe types for analysis articles (see db/analysis-schema.sql). +export type Block = + | { type: 'markdown'; data: { text: string } } + | { type: 'list'; data: { items: string[]; ordered?: boolean } } + | { type: 'callout'; data: { text: string; title?: string; tone?: 'info' | 'note' | 'warn' } } + | { type: 'table'; data: { columns: string[]; rows: string[][]; caption?: string; numeric?: boolean; highlightCol?: number } } + | { type: 'chart'; data: { kind: 'bar'; title: string; labels: string[]; series: { name: string; values: number[] }[]; unit?: string; note?: string; highlight?: number[] } } + | { type: 'mermaid'; data: { code: string; caption?: string } } + | { type: 'figure'; data: { src: string; alt: string; caption?: string } } + | { type: 'code'; data: { text: string; lang?: string } }; + +export interface Section { key: string; title: string; level: number; blocks: Block[]; children: Section[] } +export interface ArticleLink { kind: string; title: string; url: string; note: string | null } +export interface ArticleData { slug: string; title: string; summary: string | null; revision: number; updatedAt: string; sections: Section[]; links: ArticleLink[] } diff --git a/lib/articles.ts b/lib/articles.ts new file mode 100644 index 0000000..811f342 --- /dev/null +++ b/lib/articles.ts @@ -0,0 +1,39 @@ +import { query } from './db'; +import type { ArticleData, Block, Section } from './article-types'; + +/** Analysis articles about one paper, looked up by the paper's stable key (conf, ext_id). */ +export async function getArticlesFor(conf: string, extId: string | null): Promise { + if (!extId) return []; + try { + const articles = await query<{ id: number; slug: string; title: string; summary: string | null; revision: number; updated_at: Date }>( + `SELECT id, slug, title, summary, revision, updated_at FROM analysis.article WHERE subject_conf = ? AND subject_ext_id = ? ORDER BY created_at, id`, + [conf, extId]); + if (!articles.length) return []; + const ids = articles.map((a) => a.id); + const [secs, blocks, links] = await Promise.all([ + query<{ id: number; article_id: number; parent_id: number | null; key: string; title: string; level: number; position: number }>( + `SELECT id, article_id, parent_id, key, title, level, position FROM analysis.section WHERE article_id = ANY(?) ORDER BY position, id`, [ids]), + query<{ section_id: number; type: Block['type']; data: Block['data'] }>( + `SELECT b.section_id, b.type, b.data FROM analysis.block b JOIN analysis.section s ON s.id = b.section_id WHERE s.article_id = ANY(?) ORDER BY b.position`, [ids]), + query<{ article_id: number; kind: string; title: string; url: string; note: string | null }>( + `SELECT article_id, kind, title, url, note FROM analysis.link WHERE article_id = ANY(?) ORDER BY position, id`, [ids]), + ]); + const bySection = new Map(); + for (const b of blocks) (bySection.get(b.section_id) ?? bySection.set(b.section_id, []).get(b.section_id)!).push({ type: b.type, data: b.data } as Block); + const node = new Map(); + for (const s of secs) node.set(s.id, { key: s.key, title: s.title, level: s.level, blocks: bySection.get(s.id) ?? [], children: [], _parent: s.parent_id, _article: s.article_id }); + const roots = new Map(); + for (const s of secs) { + const n = node.get(s.id)!; + if (n._parent && node.has(n._parent)) node.get(n._parent)!.children.push(n); + else (roots.get(s.article_id) ?? roots.set(s.article_id, []).get(s.article_id)!).push(n); + } + return articles.map((a) => ({ + slug: a.slug, title: a.title, summary: a.summary, revision: a.revision, updatedAt: new Date(a.updated_at).toISOString().slice(0, 10), + sections: roots.get(a.id) ?? [], + links: links.filter((l) => l.article_id === a.id).map(({ kind, title, url, note }) => ({ kind, title, url, note })), + })); + } catch { + return []; // schema not created yet (e.g. a fresh database) + } +} diff --git a/package-lock.json b/package-lock.json index 2c1a06f..4d83cae 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,6 +8,7 @@ "name": "llm-general-survey-2026", "version": "0.1.0", "dependencies": { + "mermaid": "^11.4.0", "next": "^14.2.15", "pg": "^8.13.1", "react": "^18.3.1", @@ -21,6 +22,57 @@ "typescript": "^5.6.2" } }, + "node_modules/@antfu/install-pkg": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@antfu/install-pkg/-/install-pkg-2.1.0.tgz", + "integrity": "sha512-sdg9NxU3zR4Mnawfbc/x6GB5Wf17WYud5qOuEuxXjaKpYpMkISSJEjItGebXJ2bQ4DIcly4NYH23mtkGJjvKUw==", + "license": "MIT", + "dependencies": { + "package-manager-detector": "^1.8.0", + "tinyexec": "^1.3.1" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/@braintree/sanitize-url": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/@braintree/sanitize-url/-/sanitize-url-7.1.2.tgz", + "integrity": "sha512-jigsZK+sMF/cuiB7sERuo9V7N9jx+dhmHHnQyDSVdpZwVutaBu7WvNYqMDLSgFgfB30n452TP3vjDAvFC973mA==", + "license": "MIT" + }, + "node_modules/@chevrotain/types": { + "version": "11.1.2", + "resolved": "https://registry.npmjs.org/@chevrotain/types/-/types-11.1.2.tgz", + "integrity": "sha512-U+HFai5+zmJCkK86QsaJtoITlboZHBqrVketcO2ROv865xfCMSFpELQoz1GkX5GzME8pTa+3kbKrZHQtI0gdbw==", + "license": "Apache-2.0" + }, + "node_modules/@iconify/types": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@iconify/types/-/types-2.0.0.tgz", + "integrity": "sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg==", + "license": "MIT" + }, + "node_modules/@iconify/utils": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/@iconify/utils/-/utils-3.1.7.tgz", + "integrity": "sha512-JZHlwdID+dy+lTgbYC8NEC4zeugqeYsc6jewvzb4c58kHauJn+X7rNwQjxz5p2qSjqaEeQoLkCIQ9v/H4PK0/w==", + "license": "MIT", + "dependencies": { + "@antfu/install-pkg": "^2.0.1", + "@iconify/types": "^2.0.0", + "import-meta-resolve": "^4.2.0" + } + }, + "node_modules/@mermaid-js/parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@mermaid-js/parser/-/parser-1.2.1.tgz", + "integrity": "sha512-n12NohV3mrUyUL2o93IgG/ifeW9FTyeJn3zDxkhwa8MJ9Fxg3HQMlA3RiGmD/3UnJvheztkjjQAjA2T4LmUcpw==", + "license": "MIT", + "dependencies": { + "@chevrotain/types": "~11.1.2" + } + }, "node_modules/@next/env": { "version": "14.2.35", "resolved": "https://registry.npmjs.org/@next/env/-/env-14.2.35.tgz", @@ -187,6 +239,265 @@ "tslib": "^2.4.0" } }, + "node_modules/@types/d3": { + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/@types/d3/-/d3-7.4.3.tgz", + "integrity": "sha512-lZXZ9ckh5R8uiFVt8ogUNf+pIrK4EsWrx2Np75WvF/eTpJ0FMHNhjXk8CKEx/+gpHbNQyJWehbFaTvqmHWB3ww==", + "license": "MIT", + "dependencies": { + "@types/d3-array": "*", + "@types/d3-axis": "*", + "@types/d3-brush": "*", + "@types/d3-chord": "*", + "@types/d3-color": "*", + "@types/d3-contour": "*", + "@types/d3-delaunay": "*", + "@types/d3-dispatch": "*", + "@types/d3-drag": "*", + "@types/d3-dsv": "*", + "@types/d3-ease": "*", + "@types/d3-fetch": "*", + "@types/d3-force": "*", + "@types/d3-format": "*", + "@types/d3-geo": "*", + "@types/d3-hierarchy": "*", + "@types/d3-interpolate": "*", + "@types/d3-path": "*", + "@types/d3-polygon": "*", + "@types/d3-quadtree": "*", + "@types/d3-random": "*", + "@types/d3-scale": "*", + "@types/d3-scale-chromatic": "*", + "@types/d3-selection": "*", + "@types/d3-shape": "*", + "@types/d3-time": "*", + "@types/d3-time-format": "*", + "@types/d3-timer": "*", + "@types/d3-transition": "*", + "@types/d3-zoom": "*" + } + }, + "node_modules/@types/d3-array": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/@types/d3-array/-/d3-array-3.2.2.tgz", + "integrity": "sha512-hOLWVbm7uRza0BYXpIIW5pxfrKe0W+D5lrFiAEYR+pb6w3N2SwSMaJbXdUfSEv+dT4MfHBLtn5js0LAWaO6otw==", + "license": "MIT" + }, + "node_modules/@types/d3-axis": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@types/d3-axis/-/d3-axis-3.0.6.tgz", + "integrity": "sha512-pYeijfZuBd87T0hGn0FO1vQ/cgLk6E1ALJjfkC0oJ8cbwkZl3TpgS8bVBLZN+2jjGgg38epgxb2zmoGtSfvgMw==", + "license": "MIT", + "dependencies": { + "@types/d3-selection": "*" + } + }, + "node_modules/@types/d3-brush": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@types/d3-brush/-/d3-brush-3.0.6.tgz", + "integrity": "sha512-nH60IZNNxEcrh6L1ZSMNA28rj27ut/2ZmI3r96Zd+1jrZD++zD3LsMIjWlvg4AYrHn/Pqz4CF3veCxGjtbqt7A==", + "license": "MIT", + "dependencies": { + "@types/d3-selection": "*" + } + }, + "node_modules/@types/d3-chord": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@types/d3-chord/-/d3-chord-3.0.6.tgz", + "integrity": "sha512-LFYWWd8nwfwEmTZG9PfQxd17HbNPksHBiJHaKuY1XeqscXacsS2tyoo6OdRsjf+NQYeB6XrNL3a25E3gH69lcg==", + "license": "MIT" + }, + "node_modules/@types/d3-color": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/@types/d3-color/-/d3-color-3.1.3.tgz", + "integrity": "sha512-iO90scth9WAbmgv7ogoq57O9YpKmFBbmoEoCHDB2xMBY0+/KVrqAaCDyCE16dUspeOvIxFFRI+0sEtqDqy2b4A==", + "license": "MIT" + }, + "node_modules/@types/d3-contour": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@types/d3-contour/-/d3-contour-3.0.6.tgz", + "integrity": "sha512-BjzLgXGnCWjUSYGfH1cpdo41/hgdWETu4YxpezoztawmqsvCeep+8QGfiY6YbDvfgHz/DkjeIkkZVJavB4a3rg==", + "license": "MIT", + "dependencies": { + "@types/d3-array": "*", + "@types/geojson": "*" + } + }, + "node_modules/@types/d3-delaunay": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@types/d3-delaunay/-/d3-delaunay-6.0.4.tgz", + "integrity": "sha512-ZMaSKu4THYCU6sV64Lhg6qjf1orxBthaC161plr5KuPHo3CNm8DTHiLw/5Eq2b6TsNP0W0iJrUOFscY6Q450Hw==", + "license": "MIT" + }, + "node_modules/@types/d3-dispatch": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@types/d3-dispatch/-/d3-dispatch-3.0.7.tgz", + "integrity": "sha512-5o9OIAdKkhN1QItV2oqaE5KMIiXAvDWBDPrD85e58Qlz1c1kI/J0NcqbEG88CoTwJrYe7ntUCVfeUl2UJKbWgA==", + "license": "MIT" + }, + "node_modules/@types/d3-drag": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@types/d3-drag/-/d3-drag-3.0.7.tgz", + "integrity": "sha512-HE3jVKlzU9AaMazNufooRJ5ZpWmLIoc90A37WU2JMmeq28w1FQqCZswHZ3xR+SuxYftzHq6WU6KJHvqxKzTxxQ==", + "license": "MIT", + "dependencies": { + "@types/d3-selection": "*" + } + }, + "node_modules/@types/d3-dsv": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@types/d3-dsv/-/d3-dsv-3.0.7.tgz", + "integrity": "sha512-n6QBF9/+XASqcKK6waudgL0pf/S5XHPPI8APyMLLUHd8NqouBGLsU8MgtO7NINGtPBtk9Kko/W4ea0oAspwh9g==", + "license": "MIT" + }, + "node_modules/@types/d3-ease": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/d3-ease/-/d3-ease-3.0.2.tgz", + "integrity": "sha512-NcV1JjO5oDzoK26oMzbILE6HW7uVXOHLQvHshBUW4UMdZGfiY6v5BeQwh9a9tCzv+CeefZQHJt5SRgK154RtiA==", + "license": "MIT" + }, + "node_modules/@types/d3-fetch": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@types/d3-fetch/-/d3-fetch-3.0.7.tgz", + "integrity": "sha512-fTAfNmxSb9SOWNB9IoG5c8Hg6R+AzUHDRlsXsDZsNp6sxAEOP0tkP3gKkNSO/qmHPoBFTxNrjDprVHDQDvo5aA==", + "license": "MIT", + "dependencies": { + "@types/d3-dsv": "*" + } + }, + "node_modules/@types/d3-force": { + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/@types/d3-force/-/d3-force-3.0.10.tgz", + "integrity": "sha512-ZYeSaCF3p73RdOKcjj+swRlZfnYpK1EbaDiYICEEp5Q6sUiqFaFQ9qgoshp5CzIyyb/yD09kD9o2zEltCexlgw==", + "license": "MIT" + }, + "node_modules/@types/d3-format": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/d3-format/-/d3-format-3.0.4.tgz", + "integrity": "sha512-fALi2aI6shfg7vM5KiR1wNJnZ7r6UuggVqtDA+xiEdPZQwy/trcQaHnwShLuLdta2rTymCNpxYTiMZX/e09F4g==", + "license": "MIT" + }, + "node_modules/@types/d3-geo": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@types/d3-geo/-/d3-geo-3.1.1.tgz", + "integrity": "sha512-65Emv9fQiQQqphLlRkuQ5ypPsOmWPhtBGCMv61JDPEPMvsx+gzhGf74yw1a78xFKPj6zw4AgQICJoQv0vK9M2w==", + "license": "MIT", + "dependencies": { + "@types/geojson": "*" + } + }, + "node_modules/@types/d3-hierarchy": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/@types/d3-hierarchy/-/d3-hierarchy-3.1.7.tgz", + "integrity": "sha512-tJFtNoYBtRtkNysX1Xq4sxtjK8YgoWUNpIiUee0/jHGRwqvzYxkq0hGVbbOGSz+JgFxxRu4K8nb3YpG3CMARtg==", + "license": "MIT" + }, + "node_modules/@types/d3-interpolate": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/d3-interpolate/-/d3-interpolate-3.0.4.tgz", + "integrity": "sha512-mgLPETlrpVV1YRJIglr4Ez47g7Yxjl1lj7YKsiMCb27VJH9W8NVM6Bb9d8kkpG/uAQS5AmbA48q2IAolKKo1MA==", + "license": "MIT", + "dependencies": { + "@types/d3-color": "*" + } + }, + "node_modules/@types/d3-path": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@types/d3-path/-/d3-path-3.1.1.tgz", + "integrity": "sha512-VMZBYyQvbGmWyWVea0EHs/BwLgxc+MKi1zLDCONksozI4YJMcTt8ZEuIR4Sb1MMTE8MMW49v0IwI5+b7RmfWlg==", + "license": "MIT" + }, + "node_modules/@types/d3-polygon": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/d3-polygon/-/d3-polygon-3.0.2.tgz", + "integrity": "sha512-ZuWOtMaHCkN9xoeEMr1ubW2nGWsp4nIql+OPQRstu4ypeZ+zk3YKqQT0CXVe/PYqrKpZAi+J9mTs05TKwjXSRA==", + "license": "MIT" + }, + "node_modules/@types/d3-quadtree": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@types/d3-quadtree/-/d3-quadtree-3.0.6.tgz", + "integrity": "sha512-oUzyO1/Zm6rsxKRHA1vH0NEDG58HrT5icx/azi9MF1TWdtttWl0UIUsjEQBBh+SIkrpd21ZjEv7ptxWys1ncsg==", + "license": "MIT" + }, + "node_modules/@types/d3-random": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/d3-random/-/d3-random-3.0.4.tgz", + "integrity": "sha512-UHYId5WTCx4L4YNel7NU00XUXXgvgpgZOvp10PuvsQENjMDXhh2RyFc0KBjO7B45ne4Ha1yVH7ii0vnzKkuzWA==", + "license": "MIT" + }, + "node_modules/@types/d3-scale": { + "version": "4.0.9", + "resolved": "https://registry.npmjs.org/@types/d3-scale/-/d3-scale-4.0.9.tgz", + "integrity": "sha512-dLmtwB8zkAeO/juAMfnV+sItKjlsw2lKdZVVy6LRr0cBmegxSABiLEpGVmSJJ8O08i4+sGR6qQtb6WtuwJdvVw==", + "license": "MIT", + "dependencies": { + "@types/d3-time": "*" + } + }, + "node_modules/@types/d3-scale-chromatic": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@types/d3-scale-chromatic/-/d3-scale-chromatic-3.1.0.tgz", + "integrity": "sha512-iWMJgwkK7yTRmWqRB5plb1kadXyQ5Sj8V/zYlFGMUBbIPKQScw+Dku9cAAMgJG+z5GYDoMjWGLVOvjghDEFnKQ==", + "license": "MIT" + }, + "node_modules/@types/d3-selection": { + "version": "3.0.12", + "resolved": "https://registry.npmjs.org/@types/d3-selection/-/d3-selection-3.0.12.tgz", + "integrity": "sha512-Qe/KWYhEiIIxGs7HrAAjMfShxKldx19SJtr5zu53f3afPsdZNz7HHtdTLXo/kqeiWNXVycI24kSnfzBYkTzpgw==", + "license": "MIT" + }, + "node_modules/@types/d3-shape": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@types/d3-shape/-/d3-shape-3.2.0.tgz", + "integrity": "sha512-kVd74ta9eof3eJOvbNd1vGKS/XERRyQbT26Og63hIsvDO84cjD5gEOhsXf26w3FSoNlPVz84DOFcKv/oou+fMw==", + "license": "MIT", + "dependencies": { + "@types/d3-path": "*" + } + }, + "node_modules/@types/d3-time": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/d3-time/-/d3-time-3.0.4.tgz", + "integrity": "sha512-yuzZug1nkAAaBlBBikKZTgzCeA+k1uy4ZFwWANOfKw5z5LRhV0gNA7gNkKm7HoK+HRN0wX3EkxGk0fpbWhmB7g==", + "license": "MIT" + }, + "node_modules/@types/d3-time-format": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/d3-time-format/-/d3-time-format-4.0.3.tgz", + "integrity": "sha512-5xg9rC+wWL8kdDj153qZcsJ0FWiFt0J5RB6LYUNZjwSnesfblqrI/bJ1wBdJ8OQfncgbJG5+2F+qfqnqyzYxyg==", + "license": "MIT" + }, + "node_modules/@types/d3-timer": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/d3-timer/-/d3-timer-3.0.2.tgz", + "integrity": "sha512-Ps3T8E8dZDam6fUyNiMkekK3XUsaUEik+idO9/YjPtfj2qruF8tFBXS7XhtE4iIXBLxhmLjP3SXpLhVf21I9Lw==", + "license": "MIT" + }, + "node_modules/@types/d3-transition": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/@types/d3-transition/-/d3-transition-3.0.9.tgz", + "integrity": "sha512-uZS5shfxzO3rGlu0cC3bjmMFKsXv+SmZZcgp0KD22ts4uGXp5EVYGzu/0YdwZeKmddhcAccYtREJKkPfXkZuCg==", + "license": "MIT", + "dependencies": { + "@types/d3-selection": "*" + } + }, + "node_modules/@types/d3-zoom": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/@types/d3-zoom/-/d3-zoom-3.0.9.tgz", + "integrity": "sha512-0sE1406XBYJGiqD3AusTl9ZqC//2mIXix51tbom25gDCA8ri4xnSZg28CaSE8Srl6FClqABUKfsn0qghgdepMA==", + "license": "MIT", + "dependencies": { + "@types/d3-interpolate": "*", + "@types/d3-selection": "*" + } + }, + "node_modules/@types/geojson": { + "version": "7946.0.16", + "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.16.tgz", + "integrity": "sha512-6C8nqWur3j98U6+lXDfTUWIfgvZU+EumvpHKcYjujKH7woYyLj2sUmff0tRhrqM7BohUw7Pz3ZB1jj2gW9Fvmg==", + "license": "MIT" + }, "node_modules/@types/node": { "version": "22.20.5", "resolved": "https://registry.npmjs.org/@types/node/-/node-22.20.5.tgz", @@ -237,6 +548,23 @@ "@types/react": "^18.0.0" } }, + "node_modules/@types/trusted-types": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz", + "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==", + "license": "MIT", + "optional": true + }, + "node_modules/@upsetjs/venn.js": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@upsetjs/venn.js/-/venn.js-2.0.0.tgz", + "integrity": "sha512-WbBhLrooyePuQ1VZxrJjtLvTc4NVfpOyKx0sKqioq9bX1C1m7Jgykkn8gLrtwumBioXIqam8DLxp88Adbue6Hw==", + "license": "MIT", + "optionalDependencies": { + "d3-selection": "^3.0.0", + "d3-transition": "^3.0.1" + } + }, "node_modules/busboy": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", @@ -274,6 +602,24 @@ "integrity": "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==", "license": "MIT" }, + "node_modules/commander": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", + "license": "MIT", + "engines": { + "node": ">= 10" + } + }, + "node_modules/cose-base": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/cose-base/-/cose-base-1.0.3.tgz", + "integrity": "sha512-s9whTXInMSgAp/NVXVNuVxVKzGH2qck3aQlVHxDCdAEPgtMKwc4Wq6/QKhgdEdgbLSi9rBTAcPoRa6JpiG4ksg==", + "license": "MIT", + "dependencies": { + "layout-base": "^1.0.0" + } + }, "node_modules/csstype": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", @@ -281,18 +627,641 @@ "dev": true, "license": "MIT" }, + "node_modules/cytoscape": { + "version": "3.34.4", + "resolved": "https://registry.npmjs.org/cytoscape/-/cytoscape-3.34.4.tgz", + "integrity": "sha512-msY99tMY8iWTg+sIPGfSqDcPNOt4xcj+v/K/7qUFaCUxxlqnMkUYLBjRUzn9W5CU/R2hrmtJa5+UtovrEM2ctg==", + "license": "MIT", + "engines": { + "node": ">=0.10" + } + }, + "node_modules/cytoscape-cose-bilkent": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cytoscape-cose-bilkent/-/cytoscape-cose-bilkent-4.1.0.tgz", + "integrity": "sha512-wgQlVIUJF13Quxiv5e1gstZ08rnZj2XaLHGoFMYXz7SkNfCDOOteKBE6SYRfA9WxxI/iBc3ajfDoc6hb/MRAHQ==", + "license": "MIT", + "dependencies": { + "cose-base": "^1.0.0" + }, + "peerDependencies": { + "cytoscape": "^3.2.0" + } + }, + "node_modules/cytoscape-fcose": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cytoscape-fcose/-/cytoscape-fcose-2.2.0.tgz", + "integrity": "sha512-ki1/VuRIHFCzxWNrsshHYPs6L7TvLu3DL+TyIGEsRcvVERmxokbf5Gdk7mFxZnTdiGtnA4cfSmjZJMviqSuZrQ==", + "license": "MIT", + "dependencies": { + "cose-base": "^2.2.0" + }, + "peerDependencies": { + "cytoscape": "^3.2.0" + } + }, + "node_modules/cytoscape-fcose/node_modules/cose-base": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cose-base/-/cose-base-2.2.0.tgz", + "integrity": "sha512-AzlgcsCbUMymkADOJtQm3wO9S3ltPfYOFD5033keQn9NJzIbtnZj+UdBJe7DYml/8TdbtHJW3j58SOnKhWY/5g==", + "license": "MIT", + "dependencies": { + "layout-base": "^2.0.0" + } + }, + "node_modules/cytoscape-fcose/node_modules/layout-base": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/layout-base/-/layout-base-2.0.1.tgz", + "integrity": "sha512-dp3s92+uNI1hWIpPGH3jK2kxE2lMjdXdr+DH8ynZHpd6PUlH6x6cbuXnoMmiNumznqaNO31xu9e79F0uuZ0JFg==", + "license": "MIT" + }, + "node_modules/d3": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/d3/-/d3-7.9.0.tgz", + "integrity": "sha512-e1U46jVP+w7Iut8Jt8ri1YsPOvFpg46k+K8TpCb0P+zjCkjkPnV7WzfDJzMHy1LnA+wj5pLT1wjO901gLXeEhA==", + "license": "ISC", + "dependencies": { + "d3-array": "3", + "d3-axis": "3", + "d3-brush": "3", + "d3-chord": "3", + "d3-color": "3", + "d3-contour": "4", + "d3-delaunay": "6", + "d3-dispatch": "3", + "d3-drag": "3", + "d3-dsv": "3", + "d3-ease": "3", + "d3-fetch": "3", + "d3-force": "3", + "d3-format": "3", + "d3-geo": "3", + "d3-hierarchy": "3", + "d3-interpolate": "3", + "d3-path": "3", + "d3-polygon": "3", + "d3-quadtree": "3", + "d3-random": "3", + "d3-scale": "4", + "d3-scale-chromatic": "3", + "d3-selection": "3", + "d3-shape": "3", + "d3-time": "3", + "d3-time-format": "4", + "d3-timer": "3", + "d3-transition": "3", + "d3-zoom": "3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-array": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-3.2.4.tgz", + "integrity": "sha512-tdQAmyA18i4J7wprpYq8ClcxZy3SC31QMeByyCFyRt7BVHdREQZ5lpzoe5mFEYZUWe+oq8HBvk9JjpibyEV4Jg==", + "license": "ISC", + "dependencies": { + "internmap": "1 - 2" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-axis": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-axis/-/d3-axis-3.0.0.tgz", + "integrity": "sha512-IH5tgjV4jE/GhHkRV0HiVYPDtvfjHQlQfJHs0usq7M30XcSBvOotpmH1IgkcXsO/5gEQZD43B//fc7SRT5S+xw==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-brush": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-brush/-/d3-brush-3.0.0.tgz", + "integrity": "sha512-ALnjWlVYkXsVIGlOsuWH1+3udkYFI48Ljihfnh8FZPF2QS9o+PzGLBslO0PjzVoHLZ2KCVgAM8NVkXPJB2aNnQ==", + "license": "ISC", + "dependencies": { + "d3-dispatch": "1 - 3", + "d3-drag": "2 - 3", + "d3-interpolate": "1 - 3", + "d3-selection": "3", + "d3-transition": "3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-chord": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-chord/-/d3-chord-3.0.1.tgz", + "integrity": "sha512-VE5S6TNa+j8msksl7HwjxMHDM2yNK3XCkusIlpX5kwauBfXuyLAtNg9jCp/iHH61tgI4sb6R/EIMWCqEIdjT/g==", + "license": "ISC", + "dependencies": { + "d3-path": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-color": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-3.1.0.tgz", + "integrity": "sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-contour": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/d3-contour/-/d3-contour-4.0.2.tgz", + "integrity": "sha512-4EzFTRIikzs47RGmdxbeUvLWtGedDUNkTcmzoeyg4sP/dvCexO47AaQL7VKy/gul85TOxw+IBgA8US2xwbToNA==", + "license": "ISC", + "dependencies": { + "d3-array": "^3.2.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-delaunay": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/d3-delaunay/-/d3-delaunay-6.0.4.tgz", + "integrity": "sha512-mdjtIZ1XLAM8bm/hx3WwjfHt6Sggek7qH043O8KEjDXN40xi3vx/6pYSVTwLjEgiXQTbvaouWKynLBiUZ6SK6A==", + "license": "ISC", + "dependencies": { + "delaunator": "5" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-dispatch": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-3.0.1.tgz", + "integrity": "sha512-rzUyPU/S7rwUflMyLc1ETDeBj0NRuHKKAcvukozwhshr6g6c5d8zh4c2gQjY2bZ0dXeGLWc1PF174P2tVvKhfg==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-drag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-drag/-/d3-drag-3.0.0.tgz", + "integrity": "sha512-pWbUJLdETVA8lQNJecMxoXfH6x+mO2UQo8rSmZ+QqxcbyA3hfeprFgIT//HW2nlHChWeIIMwS2Fq+gEARkhTkg==", + "license": "ISC", + "dependencies": { + "d3-dispatch": "1 - 3", + "d3-selection": "3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-dsv": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-dsv/-/d3-dsv-3.0.1.tgz", + "integrity": "sha512-UG6OvdI5afDIFP9w4G0mNq50dSOsXHJaRE8arAS5o9ApWnIElp8GZw1Dun8vP8OyHOZ/QJUKUJwxiiCCnUwm+Q==", + "license": "ISC", + "dependencies": { + "commander": "7", + "iconv-lite": "0.6", + "rw": "1" + }, + "bin": { + "csv2json": "bin/dsv2json.js", + "csv2tsv": "bin/dsv2dsv.js", + "dsv2dsv": "bin/dsv2dsv.js", + "dsv2json": "bin/dsv2json.js", + "json2csv": "bin/json2dsv.js", + "json2dsv": "bin/json2dsv.js", + "json2tsv": "bin/json2dsv.js", + "tsv2csv": "bin/dsv2dsv.js", + "tsv2json": "bin/dsv2json.js" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-ease": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-3.0.1.tgz", + "integrity": "sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-fetch": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-fetch/-/d3-fetch-3.0.1.tgz", + "integrity": "sha512-kpkQIM20n3oLVBKGg6oHrUchHM3xODkTzjMoj7aWQFq5QEM+R6E4WkzT5+tojDY7yjez8KgCBRoj4aEr99Fdqw==", + "license": "ISC", + "dependencies": { + "d3-dsv": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-force": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-force/-/d3-force-3.0.0.tgz", + "integrity": "sha512-zxV/SsA+U4yte8051P4ECydjD/S+qeYtnaIyAs9tgHCqfguma/aAQDjo85A9Z6EKhBirHRJHXIgJUlffT4wdLg==", + "license": "ISC", + "dependencies": { + "d3-dispatch": "1 - 3", + "d3-quadtree": "1 - 3", + "d3-timer": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-format": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-3.1.2.tgz", + "integrity": "sha512-AJDdYOdnyRDV5b6ArilzCPPwc1ejkHcoyFarqlPqT7zRYjhavcT3uSrqcMvsgh2CgoPbK3RCwyHaVyxYcP2Arg==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-geo": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/d3-geo/-/d3-geo-3.1.1.tgz", + "integrity": "sha512-637ln3gXKXOwhalDzinUgY83KzNWZRKbYubaG+fGVuc/dxO64RRljtCTnf5ecMyE1RIdtqpkVcq0IbtU2S8j2Q==", + "license": "ISC", + "dependencies": { + "d3-array": "2.5.0 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-hierarchy": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/d3-hierarchy/-/d3-hierarchy-3.1.2.tgz", + "integrity": "sha512-FX/9frcub54beBdugHjDCdikxThEqjnR93Qt7PvQTOHxyiNCAlvMrHhclk3cD5VeAaq9fxmfRp+CnWw9rEMBuA==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-interpolate": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-3.0.1.tgz", + "integrity": "sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g==", + "license": "ISC", + "dependencies": { + "d3-color": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-path": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-3.1.0.tgz", + "integrity": "sha512-p3KP5HCf/bvjBSSKuXid6Zqijx7wIfNW+J/maPs+iwR35at5JCbLUT0LzF1cnjbCHWhqzQTIN2Jpe8pRebIEFQ==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-polygon": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-polygon/-/d3-polygon-3.0.1.tgz", + "integrity": "sha512-3vbA7vXYwfe1SYhED++fPUQlWSYTTGmFmQiany/gdbiWgU/iEyQzyymwL9SkJjFFuCS4902BSzewVGsHHmHtXg==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-quadtree": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-quadtree/-/d3-quadtree-3.0.1.tgz", + "integrity": "sha512-04xDrxQTDTCFwP5H6hRhsRcb9xxv2RzkcsygFzmkSIOJy3PeRJP7sNk3VRIbKXcog561P9oU0/rVH6vDROAgUw==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-random": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-random/-/d3-random-3.0.1.tgz", + "integrity": "sha512-FXMe9GfxTxqd5D6jFsQ+DJ8BJS4E/fT5mqqdjovykEB2oFbTMDVdg1MGFxfQW+FBOGoB++k8swBrgwSHT1cUXQ==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-sankey": { + "version": "0.12.3", + "resolved": "https://registry.npmjs.org/d3-sankey/-/d3-sankey-0.12.3.tgz", + "integrity": "sha512-nQhsBRmM19Ax5xEIPLMY9ZmJ/cDvd1BG3UVvt5h3WRxKg5zGRbvnteTyWAbzeSvlh3tW7ZEmq4VwR5mB3tutmQ==", + "license": "BSD-3-Clause", + "dependencies": { + "d3-array": "1 - 2", + "d3-shape": "^1.2.0" + } + }, + "node_modules/d3-sankey/node_modules/d3-array": { + "version": "2.12.1", + "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-2.12.1.tgz", + "integrity": "sha512-B0ErZK/66mHtEsR1TkPEEkwdy+WDesimkM5gpZr5Dsg54BiTA5RXtYW5qTLIAcekaS9xfZrzBLF/OAkB3Qn1YQ==", + "license": "BSD-3-Clause", + "dependencies": { + "internmap": "^1.0.0" + } + }, + "node_modules/d3-sankey/node_modules/d3-path": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-1.0.9.tgz", + "integrity": "sha512-VLaYcn81dtHVTjEHd8B+pbe9yHWpXKZUC87PzoFmsFrJqgFwDe/qxfp5MlfsfM1V5E/iVt0MmEbWQ7FVIXh/bg==", + "license": "BSD-3-Clause" + }, + "node_modules/d3-sankey/node_modules/d3-shape": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-1.3.7.tgz", + "integrity": "sha512-EUkvKjqPFUAZyOlhY5gzCxCeI0Aep04LwIRpsZ/mLFelJiUfnK56jo5JMDSE7yyP2kLSb6LtF+S5chMk7uqPqw==", + "license": "BSD-3-Clause", + "dependencies": { + "d3-path": "1" + } + }, + "node_modules/d3-sankey/node_modules/internmap": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/internmap/-/internmap-1.0.1.tgz", + "integrity": "sha512-lDB5YccMydFBtasVtxnZ3MRBHuaoE8GKsppq+EchKL2U4nK/DmEpPHNH8MZe5HkMtpSiTSOZwfN0tzYjO/lJEw==", + "license": "ISC" + }, + "node_modules/d3-scale": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-4.0.2.tgz", + "integrity": "sha512-GZW464g1SH7ag3Y7hXjf8RoUuAFIqklOAq3MRl4OaWabTFJY9PN/E1YklhXLh+OQ3fM9yS2nOkCoS+WLZ6kvxQ==", + "license": "ISC", + "dependencies": { + "d3-array": "2.10.0 - 3", + "d3-format": "1 - 3", + "d3-interpolate": "1.2.0 - 3", + "d3-time": "2.1.1 - 3", + "d3-time-format": "2 - 4" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-scale-chromatic": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-scale-chromatic/-/d3-scale-chromatic-3.1.0.tgz", + "integrity": "sha512-A3s5PWiZ9YCXFye1o246KoscMWqf8BsD9eRiJ3He7C9OBaxKhAd5TFCdEx/7VbKtxxTsu//1mMJFrEt572cEyQ==", + "license": "ISC", + "dependencies": { + "d3-color": "1 - 3", + "d3-interpolate": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-selection": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-3.0.0.tgz", + "integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-shape": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-3.2.0.tgz", + "integrity": "sha512-SaLBuwGm3MOViRq2ABk3eLoxwZELpH6zhl3FbAoJ7Vm1gofKx6El1Ib5z23NUEhF9AsGl7y+dzLe5Cw2AArGTA==", + "license": "ISC", + "dependencies": { + "d3-path": "^3.1.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-time": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-3.1.0.tgz", + "integrity": "sha512-VqKjzBLejbSMT4IgbmVgDjpkYrNWUYJnbCGo874u7MMKIWsILRX+OpX/gTk8MqjpT1A/c6HY2dCA77ZN0lkQ2Q==", + "license": "ISC", + "dependencies": { + "d3-array": "2 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-time-format": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-4.1.0.tgz", + "integrity": "sha512-dJxPBlzC7NugB2PDLwo9Q8JiTR3M3e4/XANkreKSUxF8vvXKqm1Yfq4Q5dl8budlunRVlUUaDUgFt7eA8D6NLg==", + "license": "ISC", + "dependencies": { + "d3-time": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-timer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-3.0.1.tgz", + "integrity": "sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-transition": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-transition/-/d3-transition-3.0.1.tgz", + "integrity": "sha512-ApKvfjsSR6tg06xrL434C0WydLr7JewBB3V+/39RMHsaXTOG0zmt/OAXeng5M5LBm0ojmxJrpomQVZ1aPvBL4w==", + "license": "ISC", + "dependencies": { + "d3-color": "1 - 3", + "d3-dispatch": "1 - 3", + "d3-ease": "1 - 3", + "d3-interpolate": "1 - 3", + "d3-timer": "1 - 3" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "d3-selection": "2 - 3" + } + }, + "node_modules/d3-zoom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-zoom/-/d3-zoom-3.0.0.tgz", + "integrity": "sha512-b8AmV3kfQaqWAuacbPuNbL6vahnOJflOhexLzMMNLga62+/nh0JzvJ0aO/5a5MVgUFGS7Hu1P9P03o3fJkDCyw==", + "license": "ISC", + "dependencies": { + "d3-dispatch": "1 - 3", + "d3-drag": "2 - 3", + "d3-interpolate": "1 - 3", + "d3-selection": "2 - 3", + "d3-transition": "2 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/dagre-d3-es": { + "version": "7.0.14", + "resolved": "https://registry.npmjs.org/dagre-d3-es/-/dagre-d3-es-7.0.14.tgz", + "integrity": "sha512-P4rFMVq9ESWqmOgK+dlXvOtLwYg0i7u0HBGJER0LZDJT2VHIPAMZ/riPxqJceWMStH5+E61QxFra9kIS3AqdMg==", + "license": "MIT", + "dependencies": { + "d3": "^7.9.0", + "lodash-es": "^4.17.21" + } + }, + "node_modules/dayjs": { + "version": "1.11.23", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.23.tgz", + "integrity": "sha512-QDTCU0M0MxR3hQfnlDJfwekQiaanm1ubOD231u73WBckQ/fsamwRLiE2GBz6D3a/xF1NgfiDLJjXBa1hYOYTtQ==", + "license": "MIT" + }, + "node_modules/delaunator": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/delaunator/-/delaunator-5.1.0.tgz", + "integrity": "sha512-AGrQ4QSgssa1NGmWmLPqN5NY2KajF5MqxetNEO+o0n3ZwZZeTmt7bBnvzHWrmkZFxGgr4HdyFgelzgi06otLuQ==", + "license": "ISC", + "dependencies": { + "robust-predicates": "^3.0.2" + } + }, + "node_modules/dompurify": { + "version": "3.4.17", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.4.17.tgz", + "integrity": "sha512-B/pSlYVHQ58kqISD/yDjuJ1yfzI34m1gF4lAod2bwSRhiN4K5Cl3H8Af7hqB2PmTL911tdEudnnXn5FnhRoz0w==", + "license": "(MPL-2.0 OR Apache-2.0)", + "optionalDependencies": { + "@types/trusted-types": "^2.0.7" + } + }, + "node_modules/es-toolkit": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/es-toolkit/-/es-toolkit-1.52.0.tgz", + "integrity": "sha512-XTNEJQh1tY1ZJVcf6ayP/2n4ZPyaHlW2FWs7xvw5ddPuhUVjLD3olQVQS7kf58JbAB48iL0uL/jerTrjtV3lDA==", + "license": "MIT", + "workspaces": [ + "docs", + "benchmarks", + "tests/types", + "tests/browser-compat" + ] + }, + "node_modules/fastdom": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/fastdom/-/fastdom-1.0.12.tgz", + "integrity": "sha512-LB+xjSTEbjHE1cWsxu+tN2Xqr1kpi+V9aADI7sVM5ZMaXyYGPHULQMzpJMYqOTULK/73pUkWVzzObFRBkPr+hg==", + "license": "MIT", + "dependencies": { + "strictdom": "^1.0.1" + } + }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "license": "ISC" }, + "node_modules/hachure-fill": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/hachure-fill/-/hachure-fill-0.5.2.tgz", + "integrity": "sha512-3GKBOn+m2LX9iq+JC1064cSFprJY4jL1jCXTcpnfER5HYE2l/4EfWSGzkPa/ZDBmYI0ZOEj5VHV/eKnPGkHuOg==", + "license": "MIT" + }, + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/import-meta-resolve": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.2.0.tgz", + "integrity": "sha512-Iqv2fzaTQN28s/FwZAoFq0ZSs/7hMAHJVX+w8PZl3cY19Pxk6jFFalxQoIfW2826i/fDLXv8IiEZRIT0lDuWcg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/internmap": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/internmap/-/internmap-2.0.3.tgz", + "integrity": "sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "license": "MIT" }, + "node_modules/katex": { + "version": "0.16.47", + "resolved": "https://registry.npmjs.org/katex/-/katex-0.16.47.tgz", + "integrity": "sha512-Eeo8Ys1doU1z+x8AZsPpQu+p/QcZBI5PeOo7QGQdy2x2m0MU/hYagBbGOmXwr5KVbEfVuWv9LpnQWeehogurjg==", + "funding": [ + "https://opencollective.com/katex", + "https://github.com/sponsors/katex" + ], + "license": "MIT", + "dependencies": { + "commander": "^8.3.0" + }, + "bin": { + "katex": "cli.js" + } + }, + "node_modules/katex/node_modules/commander": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", + "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==", + "license": "MIT", + "engines": { + "node": ">= 12" + } + }, + "node_modules/khroma": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/khroma/-/khroma-2.1.0.tgz", + "integrity": "sha512-Ls993zuzfayK269Svk9hzpeGUKob/sIgZzyHYdjQoAdQetRKpOLj+k/QQQ/6Qi0Yz65mlROrfd+Ev+1+7dz9Kw==" + }, + "node_modules/layout-base": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/layout-base/-/layout-base-1.0.2.tgz", + "integrity": "sha512-8h2oVEZNktL4BH2JCOI90iD1yXwL6iNW7KcCKT2QZgQJR2vbqDsldCTPRU9NifTCqHZci57XvQQ15YTu+sTYPg==", + "license": "MIT" + }, + "node_modules/lodash-es": { + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.18.1.tgz", + "integrity": "sha512-J8xewKD/Gk22OZbhpOVSwcs60zhd95ESDwezOFuA3/099925PdHJ7OFHNTGtajL3AlZkykD32HykiMo+BIBI8A==", + "license": "MIT" + }, "node_modules/loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", @@ -305,6 +1274,48 @@ "loose-envify": "cli.js" } }, + "node_modules/marked": { + "version": "16.4.2", + "resolved": "https://registry.npmjs.org/marked/-/marked-16.4.2.tgz", + "integrity": "sha512-TI3V8YYWvkVf3KJe1dRkpnjs68JUPyEa5vjKrp1XEEJUAOaQc+Qj+L1qWbPd0SJuAdQkFU0h73sXXqwDYxsiDA==", + "license": "MIT", + "bin": { + "marked": "bin/marked.js" + }, + "engines": { + "node": ">= 20" + } + }, + "node_modules/mermaid": { + "version": "11.17.2", + "resolved": "https://registry.npmjs.org/mermaid/-/mermaid-11.17.2.tgz", + "integrity": "sha512-V6K3C8EBdEsPFZXSKMJe6ppQOENxuHARr9GvHX4hh47lAbhMRD9qf4oEK7LoaRQxULMa80/qt5gHO73aCleBBg==", + "license": "MIT", + "dependencies": { + "@braintree/sanitize-url": "^7.1.2", + "@iconify/utils": "^3.0.2", + "@mermaid-js/parser": "^1.2.1", + "@types/d3": "^7.4.3", + "@upsetjs/venn.js": "^2.0.0", + "cytoscape": "^3.34.0", + "cytoscape-cose-bilkent": "^4.1.0", + "cytoscape-fcose": "^2.2.0", + "d3": "^7.9.0", + "d3-sankey": "^0.12.3", + "dagre-d3-es": "7.0.14", + "dayjs": "^1.11.21", + "dompurify": "^3.3.3", + "es-toolkit": "^1.45.1", + "fastdom": "1.0.12", + "katex": "^0.16.47", + "khroma": "^2.1.0", + "marked": "^16.3.0", + "roughjs": "^4.6.6", + "stylis": "^4.3.6", + "ts-dedent": "^2.2.0", + "uuid": "^11.1.0 || ^12 || ^13 || ^14.0.0" + } + }, "node_modules/nanoid": { "version": "3.3.20", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz", @@ -373,6 +1384,18 @@ } } }, + "node_modules/package-manager-detector": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/package-manager-detector/-/package-manager-detector-1.9.0.tgz", + "integrity": "sha512-zAMfbta9nPA8AKkA4WdmNAT8R8s6Dk0/xwPsqNnRidMFcLo1YkLuPDTgs2f64XdzS8vbLNnoJ+uUIkgbz7oRHA==", + "license": "MIT" + }, + "node_modules/path-data-parser": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/path-data-parser/-/path-data-parser-0.1.0.tgz", + "integrity": "sha512-NOnmBpt5Y2RWbuv0LMzsayp3lVylAHLPUTut412ZA3l+C4uw4ZVkQbjShYCQ8TCpUMdPapr4YjUqLYD6v68j+w==", + "license": "MIT" + }, "node_modules/pg": { "version": "8.23.1", "resolved": "https://registry.npmjs.org/pg/-/pg-8.23.1.tgz", @@ -468,6 +1491,22 @@ "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", "license": "ISC" }, + "node_modules/points-on-curve": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/points-on-curve/-/points-on-curve-0.2.0.tgz", + "integrity": "sha512-0mYKnYYe9ZcqMCWhUjItv/oHjvgEsfKvnUTg8sAtnHr3GVy7rGkXCb6d5cSyqrWqL4k81b9CPg3urd+T7aop3A==", + "license": "MIT" + }, + "node_modules/points-on-path": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/points-on-path/-/points-on-path-0.2.1.tgz", + "integrity": "sha512-25ClnWWuw7JbWZcgqY/gJ4FQWadKxGWk+3kR/7kD0tCaDtPPMj7oHu2ToLaVhfpnHrZzYby2w6tUA0eOIuUg8g==", + "license": "MIT", + "dependencies": { + "path-data-parser": "0.1.0", + "points-on-curve": "0.2.0" + } + }, "node_modules/postcss": { "version": "8.4.31", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", @@ -560,6 +1599,36 @@ "react": "^18.3.1" } }, + "node_modules/robust-predicates": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/robust-predicates/-/robust-predicates-3.0.3.tgz", + "integrity": "sha512-NS3levdsRIUOmiJ8FZWCP7LG3QpJyrs/TE0Zpf1yvZu8cAJJ6QMW92H1c7kWpdIHo8RvmLxN/o2JXTKHp74lUA==", + "license": "Unlicense" + }, + "node_modules/roughjs": { + "version": "4.6.6", + "resolved": "https://registry.npmjs.org/roughjs/-/roughjs-4.6.6.tgz", + "integrity": "sha512-ZUz/69+SYpFN/g/lUlo2FXcIjRkSu3nDarreVdGGndHEBJ6cXPdKguS8JGxwj5HA5xIbVKSmLgr5b3AWxtRfvQ==", + "license": "MIT", + "dependencies": { + "hachure-fill": "^0.5.2", + "path-data-parser": "^0.1.0", + "points-on-curve": "^0.2.0", + "points-on-path": "^0.2.1" + } + }, + "node_modules/rw": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/rw/-/rw-1.3.3.tgz", + "integrity": "sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ==", + "license": "BSD-3-Clause" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" + }, "node_modules/scheduler": { "version": "0.23.2", "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", @@ -595,6 +1664,12 @@ "node": ">=10.0.0" } }, + "node_modules/strictdom": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/strictdom/-/strictdom-1.0.1.tgz", + "integrity": "sha512-cEmp9QeXXRmjj/rVp9oyiqcvyocWab/HaoN4+bwFeZ7QzykJD6L3yD4v12K1x0tHpqRqVpJevN3gW7kyM39Bqg==", + "license": "MIT" + }, "node_modules/styled-jsx": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.1.tgz", @@ -618,6 +1693,30 @@ } } }, + "node_modules/stylis": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.4.0.tgz", + "integrity": "sha512-5Z9ZpRzfuH6l/UAvCPAPUo3665Nk2wLaZU3x+TLHKVzIz33+sbJqbtrYoC3KD4/uVOr2Zp+L0LySezP9OHV9yA==", + "license": "MIT" + }, + "node_modules/tinyexec": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.3.1.tgz", + "integrity": "sha512-GCvB3aoys96IuDFBMcTB46JOR6mdMtAToqwiW8JlWhsoh1mhHi/xn9ss/Dg7N555GiJyEt2qzoG/NHCwM6h1EA==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/ts-dedent": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/ts-dedent/-/ts-dedent-2.3.0.tgz", + "integrity": "sha512-JfJeIHke7y2egdGGgRAvpCwYFUsHlM2gPcrVOxFkznt/4uzQ7HFmvE63iFHVLBJNDuyDOQgijDK/tXH/f6Msjg==", + "license": "MIT", + "engines": { + "node": ">=6.10" + } + }, "node_modules/tslib": { "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", @@ -645,6 +1744,19 @@ "dev": true, "license": "MIT" }, + "node_modules/uuid": { + "version": "14.0.3", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-14.0.3.tgz", + "integrity": "sha512-Sc5u1VVln93y1Xnz4R+CunOZc7R9LUcTmhj7Rc7Eg3HVcf7rVn2FOoa812fe0W8p3jD7xeoGSYbfqCGGH2B6xw==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "bin": { + "uuid": "dist-node/bin/uuid" + } + }, "node_modules/xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", diff --git a/package.json b/package.json index 7619079..ef13051 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "data:load": "node scripts/load-pg.js --dir build/export" }, "dependencies": { + "mermaid": "^11.4.0", "next": "^14.2.15", "pg": "^8.13.1", "react": "^18.3.1", diff --git a/pages/papers/[id].tsx b/pages/papers/[id].tsx index a19f0eb..bfa58a6 100644 --- a/pages/papers/[id].tsx +++ b/pages/papers/[id].tsx @@ -5,15 +5,20 @@ import { getPaper } from '../../lib/queries'; import { getPaperWork } from '../../lib/worktypes'; import { typeSlug } from '../../lib/slug'; import { Paper } from '../../lib/types'; +import ArticleView from '../../components/ArticleView'; +import { getArticlesFor } from '../../lib/articles'; +import type { ArticleData } from '../../lib/article-types'; -type Props = { paper: Paper & { topics: { id: string; label: string }[] }; work: Awaited> }; +type Props = { paper: Paper & { topics: { id: string; label: string }[] }; work: Awaited>; articles: ArticleData[] }; export const getServerSideProps: GetServerSideProps = async ({ params }) => { const paper = await getPaper(Number(params?.id)); - return paper ? { props: { paper, work: await getPaperWork(paper.id) } } : { notFound: true }; + if (!paper) return { notFound: true }; + const [work, articles] = await Promise.all([getPaperWork(paper.id), getArticlesFor(paper.conf, paper.ext_id ?? null)]); + return { props: { paper, work, articles } }; }; -export default function PaperPage({ paper: p, work }: Props) { +export default function PaperPage({ paper: p, work, articles }: Props) { return (

    ← {p.conf_short} 2026 papers

    @@ -25,6 +30,7 @@ export default function PaperPage({ paper: p, work }: Props) { {p.award && p.award !== 'Poster' && {p.award}} {p.topics.map((t) => {t.label})}

    + {articles.map((a) => )} {work.meta?.summary &&

    Summary: {work.meta.summary}

    }

    Types of work

    diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 8ce9023..b4b9831 100644 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -70,6 +70,7 @@ python3 scripts/export_jsonl.py --db build/papers.db --out build/export npm ci --no-audit --no-fund npm run build node scripts/load-pg.js --dir build/export +node scripts/load-articles.js content/articles # analysis articles -> persistent schema "analysis" rm -rf build # ---- 4. switch + restart -------------------------------------------------------------- diff --git a/scripts/load-articles.js b/scripts/load-articles.js new file mode 100644 index 0000000..152d7d3 --- /dev/null +++ b/scripts/load-articles.js @@ -0,0 +1,111 @@ +#!/usr/bin/env node +// Upsert analysis articles (content/articles/*.json) into the persistent "analysis" schema in PostgreSQL. +// Idempotent: an article is replaced as a whole (sections, blocks, links) inside one transaction. +// usage: DATABASE_URL=postgres://... node scripts/load-articles.js [content/articles] +// +// Block shapes (data column): +// markdown {text} paragraphs, ###/#### headings, - and 1. lists, **bold**, *italic*, `code`, [text](url) +// list {items[], ordered?} items are inline markdown +// callout {text, title?, tone} tone: info | note | warn +// table {columns[], rows[][], caption?, numeric?, highlightCol?} cells are inline markdown +// chart {kind:'bar', title, labels[], series:[{name, values[]}], unit?, note?, highlight?[]} +// mermaid {code, caption?} Mermaid.js diagram source +// figure {src, alt, caption?} image (https:// or /path) +// code {text, lang?} +const fs = require('fs'); +const path = require('path'); +const { Client } = require('pg'); + +const TYPES = ['markdown', 'list', 'callout', 'table', 'chart', 'mermaid', 'figure', 'code']; +const KINDS = ['paper', 'code', 'project', 'demo', 'dataset', 'related', 'other']; +const dir = process.argv[2] || 'content/articles'; + +function fail(file, msg) { throw new Error(`${file}: ${msg}`); } + +function validate(file, a) { + for (const k of ['slug', 'title']) if (!a[k] || typeof a[k] !== 'string') fail(file, `missing ${k}`); + if (!a.subject || !a.subject.conf || !a.subject.ext_id) fail(file, 'missing subject.conf / subject.ext_id'); + if (!Array.isArray(a.sections) || !a.sections.length) fail(file, 'no sections'); + const keys = new Set(); + const walk = (secs) => { + for (const s of secs) { + if (!s.key || !s.title) fail(file, 'section needs key and title'); + if (keys.has(s.key)) fail(file, `duplicate section key ${s.key}`); + keys.add(s.key); + (s.blocks || []).forEach((b, i) => { + if (!TYPES.includes(b.type)) fail(file, `${s.key}[${i}]: unknown block type ${b.type}`); + const d = b.data || {}; + if (b.type === 'markdown' && typeof d.text !== 'string') fail(file, `${s.key}[${i}]: markdown needs text`); + if (b.type === 'list' && !Array.isArray(d.items)) fail(file, `${s.key}[${i}]: list needs items`); + if (b.type === 'mermaid' && typeof d.code !== 'string') fail(file, `${s.key}[${i}]: mermaid needs code`); + if (b.type === 'table' && !(Array.isArray(d.columns) && Array.isArray(d.rows) && d.rows.every((r) => r.length === d.columns.length))) + fail(file, `${s.key}[${i}]: table rows must match columns`); + if (b.type === 'chart' && !(Array.isArray(d.labels) && Array.isArray(d.series) && d.series.every((x) => x.values.length === d.labels.length))) + fail(file, `${s.key}[${i}]: chart series must match labels`); + }); + walk(s.children || []); + } + }; + walk(a.sections); + for (const l of a.links || []) if (!KINDS.includes(l.kind) || !l.url || !l.title) fail(file, `bad link ${JSON.stringify(l)}`); +} + +async function load(pg, a) { + await pg.query('BEGIN'); + try { + const ex = await pg.query('SELECT id, revision FROM analysis.article WHERE slug = $1', [a.slug]); + let id; + if (ex.rows.length) { + id = ex.rows[0].id; + await pg.query('DELETE FROM analysis.section WHERE article_id = $1', [id]); // cascades to blocks; links go below + await pg.query('DELETE FROM analysis.link WHERE article_id = $1', [id]); + await pg.query( + 'UPDATE analysis.article SET subject_conf=$2, subject_ext_id=$3, title=$4, summary=$5, revision=revision+1, updated_at=now() WHERE id=$1', + [id, a.subject.conf, a.subject.ext_id, a.title, a.summary ?? null]); + } else { + id = (await pg.query( + 'INSERT INTO analysis.article(slug, subject_conf, subject_ext_id, title, summary) VALUES ($1,$2,$3,$4,$5) RETURNING id', + [a.slug, a.subject.conf, a.subject.ext_id, a.title, a.summary ?? null])).rows[0].id; + } + const secIds = {}; + const insertSecs = async (secs, parent) => { + for (let i = 0; i < secs.length; i++) { + const s = secs[i]; + const sid = (await pg.query( + 'INSERT INTO analysis.section(article_id, parent_id, key, title, level, position) VALUES ($1,$2,$3,$4,$5,$6) RETURNING id', + [id, parent, s.key, s.title, s.level ?? (parent ? 3 : 2), i])).rows[0].id; + secIds[s.key] = sid; + for (let j = 0; j < (s.blocks || []).length; j++) + await pg.query('INSERT INTO analysis.block(section_id, position, type, data) VALUES ($1,$2,$3,$4)', [sid, j, s.blocks[j].type, JSON.stringify(s.blocks[j].data)]); + await insertSecs(s.children || [], sid); + } + }; + await insertSecs(a.sections, null); + const links = a.links || []; + for (let i = 0; i < links.length; i++) { + const l = links[i]; + await pg.query('INSERT INTO analysis.link(article_id, section_id, position, kind, title, url, note) VALUES ($1,$2,$3,$4,$5,$6,$7)', + [id, l.section ? secIds[l.section] ?? null : null, i, l.kind, l.title, l.url, l.note ?? null]); + } + await pg.query('COMMIT'); + return { id, sections: Object.keys(secIds).length, blocks: a.sections.reduce(function c(n, s) { return n + (s.blocks || []).length + (s.children || []).reduce(c, 0); }, 0), links: links.length }; + } catch (e) { await pg.query('ROLLBACK'); throw e; } +} + +(async () => { + if (!process.env.DATABASE_URL) { console.error('DATABASE_URL is not set'); process.exit(1); } + const files = fs.existsSync(dir) ? fs.readdirSync(dir).filter((f) => f.endsWith('.json')).sort() : []; + const articles = files.map((f) => { const a = JSON.parse(fs.readFileSync(path.join(dir, f), 'utf8')); validate(f, a); return [f, a]; }); + const pg = new Client({ connectionString: process.env.DATABASE_URL }); + await pg.connect(); + try { + await pg.query(fs.readFileSync(path.join(__dirname, '..', 'db', 'analysis-schema.sql'), 'utf8')); + for (const [f, a] of articles) { + const r = await load(pg, a); + console.log(`article ${a.slug} <- ${f}: ${r.sections} sections, ${r.blocks} blocks, ${r.links} links`); + } + const n = (await pg.query('SELECT COUNT(*)::int AS n FROM analysis.article')).rows[0].n; + console.log(`analysis.article rows: ${n}`); + } catch (e) { console.error('load-articles failed:', e.message); process.exitCode = 1; } + finally { await pg.end(); } +})(); diff --git a/styles/globals.css b/styles/globals.css index 176e092..84be43a 100644 --- a/styles/globals.css +++ b/styles/globals.css @@ -71,3 +71,26 @@ details.extract summary{cursor:pointer;font-weight:600;margin:8px 0} .tabs a:hover{border-color:var(--accent);text-decoration:none} section[id]{scroll-margin-top:100px} h3{font-size:16px;margin:18px 0 8px} + +/* analysis articles */ +.analysis{margin:18px 0 28px;padding:16px 18px;background:var(--card);border:1px solid var(--line);border-radius:12px} +.analysis-head{padding-bottom:8px;border-bottom:1px solid var(--line);margin-bottom:12px} +.art-body{min-width:0;font-size:15.5px;line-height:1.65} +.art-section{scroll-margin-top:70px} +.art-section h2{font-size:20px;margin:30px 0 10px;padding-top:6px;border-top:1px solid var(--line)} +.art-section:first-child h2{border-top:0;margin-top:6px} +.art-section h3,.art-body h3.md-h{font-size:16.5px;margin:20px 0 6px} +.art-body table{font-size:13.5px;line-height:1.5;margin:8px 0 16px} +.art-body table.num td:not(:first-child),.art-body table.num th:not(:first-child){text-align:right;font-variant-numeric:tabular-nums} +.art-body td.hl{background:var(--accent-bg);font-weight:600} +.callout{border-left:4px solid var(--accent);background:var(--accent-bg);border-radius:6px;padding:10px 14px;margin:12px 0} +.callout.note{border-left-color:#1b9e77;background:color-mix(in srgb,#1b9e77 12%,transparent)} +.callout.warn{border-left-color:#e0702b;background:color-mix(in srgb,#e0702b 14%,transparent)} +.chart-fig,.mermaid-fig,.tbl-wrap{margin:14px 0} +.chart-title{font-weight:600;font-size:14px;margin-bottom:4px} +.chart-note,.mermaid-fig figcaption{color:var(--muted);font-size:12.5px;margin-top:4px} +.chart-fig .legend{display:flex;flex-wrap:wrap;gap:12px;font-size:12px;margin-top:4px} +.legend i{display:inline-block;width:10px;height:10px;border-radius:2px;margin-right:5px} +.mermaid-svg{overflow-x:auto;text-align:center} +.mermaid-svg svg{max-width:100%;height:auto} +pre.mermaid-src,pre.code-block{background:var(--bg);border:1px solid var(--line);border-radius:8px;padding:10px 12px;overflow:auto;font-size:12.5px}