v0.2.1 - card grids no longer collapse to a single card
Picks up @page2ai/core 0.1.2.
What was broken
The conversion root was chosen with querySelector('main article') || querySelector('article'), which returns the first <article> in document order. HTML5 allows that tag on any self-contained composition, so design systems spend it on cards and teasers. Measured on raw server HTML, body characters excluding frontmatter:
| page | before | after |
|---|---|---|
docs.astro.build/en/getting-started/ |
208 | 3,494 |
starlight.astro.build/ |
209 | 3,324 |
blog.cloudflare.com/ |
927 | 15,068 |
An <article> now replaces its container only when it carries at least half the container's content text. Real articles measured 0.81-0.84 of their <main>, cards and teasers 0.07-0.22, and nothing observed lands between. Fifteen of eighteen pages in the sweep are byte-identical, including both GitHub repo pages where <article class="markdown-body"> is the content and must keep winning. Nothing regressed.
Also: linkedom can return a <body> with zero children while the content sits under documentElement; the renderer now falls through instead of reporting an empty page.
Also fixed
SERVER_VERSION was a hardcoded constant beside package.json and manifest.json. It drifted on the first release after it was written: 0.2.1 was about to ship while the running server still introduced itself as 0.2.0 over the wire. It is now read from package.json.
Bundle
page2ai-mcp-0.2.1.mcpb, 2.5 MB, built from production dependencies only. Verified by unpacking and running it, not by packing it: initialize and server/discover both answered, serverInfo reports 0.2.1, and tools/call on the Astro page returned 4,838 characters.