@cloudhal/mcp-server 0.6.1 → 0.6.2

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.
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * RFC-0042 §4 "API and MCP" for `list_entries`: `where` and `orderBy` over a collection's list
3
- * fields, run by core-ts's shared evaluator (`queryContentEntries`), and `limit`/`cursor` paging.
4
- * Without `orderBy` the list keeps its order (last updated first); without `limit` it is unpaged,
3
+ * fields, run by core-ts's shared evaluator (`queryContentEntries`, in SQL while the collection's
4
+ * list values are ready), and `limit`/`cursor` paging: with `orderBy` the store pages, without it
5
+ * the list keeps its order (last updated first) and is paged here; without `limit` it is unpaged,
5
6
  * as before. Problems are refused as `invalid_query` with their paths (`where/0/value`).
6
7
  */
7
8
  import type { ContentEntry } from "@cloudhal/core-contracts";
@@ -1,12 +1,18 @@
1
1
  /**
2
2
  * RFC-0042 §4 "API and MCP" for `list_entries`: `where` and `orderBy` over a collection's list
3
- * fields, run by core-ts's shared evaluator (`queryContentEntries`), and `limit`/`cursor` paging.
4
- * Without `orderBy` the list keeps its order (last updated first); without `limit` it is unpaged,
3
+ * fields, run by core-ts's shared evaluator (`queryContentEntries`, in SQL while the collection's
4
+ * list values are ready), and `limit`/`cursor` paging: with `orderBy` the store pages, without it
5
+ * the list keeps its order (last updated first) and is paged here; without `limit` it is unpaged,
5
6
  * as before. Problems are refused as `invalid_query` with their paths (`where/0/value`).
6
7
  */
7
8
 
8
9
  import { SiteSchema } from "@cloudhal/core-contracts";
9
- import { InvariantError, queryContentEntries } from "@cloudhal/core-ts";
10
+ import {
11
+ ENTRY_PAGE_LIMIT,
12
+
13
+ InvariantError,
14
+ queryContentEntries,
15
+ } from "@cloudhal/core-ts";
10
16
 
11
17
 
12
18
  const DEFS = SiteSchema.$defs ;
@@ -83,19 +89,28 @@ export async function listEntries(
83
89
  if (base.collection === undefined && (where !== undefined || orderBy !== undefined))
84
90
  refuse("collection", "where and orderBy need the collection whose list fields they use");
85
91
  const offset = a.cursor === undefined ? 0 : decodeCursor(a.cursor );
86
- const { entries } = await queryContentEntries(ctx.store, siteId, {
92
+ // Ordered by a field, the store pages (in SQL once the collection's list values are ready);
93
+ // otherwise the list keeps its last-updated order, sorted here.
94
+ const paged =
95
+ orderBy !== undefined &&
96
+ Number.isInteger(limit) &&
97
+ (limit ) >= 1 &&
98
+ (limit ) <= ENTRY_PAGE_LIMIT;
99
+ const result = await queryContentEntries(ctx.store, siteId, {
87
100
  ...base,
88
101
  ...(where ? { where } : {}),
89
102
  ...(orderBy ? { orderBy } : {}),
103
+ ...(paged ? { limit, offset } : {}),
90
104
  now: (ctx.now?.() ?? new Date()).getTime(),
91
105
  });
92
- const ordered = orderBy ? entries : entries.sort(byUpdated);
106
+ const ordered = orderBy ? result.entries : result.entries.sort(byUpdated);
93
107
  if (limit === undefined) return { entries: ordered };
94
- const page = ordered.slice(offset, offset + limit);
108
+ const page = paged ? ordered : ordered.slice(offset, offset + limit);
109
+ const total = paged ? result.total : ordered.length;
95
110
  const next = offset + page.length;
96
111
  return {
97
112
  entries: page,
98
- total: ordered.length,
99
- ...(next < ordered.length ? { nextCursor: encodeCursor(next) } : {}),
113
+ total,
114
+ ...(next < total ? { nextCursor: encodeCursor(next) } : {}),
100
115
  };
101
116
  }
@@ -2,4 +2,4 @@
2
2
  * In-page checks, part of `RENDER_CHECK_SCRIPT`: carousel-label / -lcp / -focus / -autoplay, image-fit, overlay-open; ends at the top of the page.
3
3
  * Plain source text, run inside the page; it shares the script's locals (see ./index.ts).
4
4
  */
5
- export declare const COMPONENT_CHECKS = " // A static preview runs no scripts (its CSP), so checks of what a module does wait for the site.\n const staticPreview = !!document.querySelector('meta[name=\"generator\"][content=\"Cloudhal preview\"]');\n // carousel-label and carousel-lcp: named carousels and slides; a hero's first slide not lazy.\n for (const c of document.querySelectorAll('[aria-roledescription=\"carousel\"], [aria-roledescription=\"kayd\u0131rmal\u0131 alan\"]')) {\n const name = (c.getAttribute(\"aria-label\") || \"\").trim();\n if (!name) add(\"carousel-label\", c, \"a carousel without a name (aria-label)\");\n else if (/carousel|karusel/i.test(name)) add(\"carousel-label\", c, \"its name says carousel; name what it shows\");\n const slides = [...c.querySelectorAll('[aria-roledescription=\"slide\"], [aria-roledescription=\"slayt\"]')];\n for (const s of slides) if (!(s.getAttribute(\"aria-label\") || \"\").trim()) add(\"carousel-label\", s, \"a slide without a name\");\n if (!staticPreview && c.querySelector('[data-ch-carousel=\"prev\"][data-ch-pending],[data-ch-carousel=\"next\"][data-ch-pending]'))\n add(\"carousel-focus\", c, \"its arrows never appeared: the carousel module did not run\");\n if (!staticPreview && c.getAttribute(\"data-variant\") === \"hero\")\n for (const s of slides.slice(1)) {\n if (s.closest(\"[inert]\")) continue;\n const f = s.querySelector('a[href],button,input,select,textarea,[tabindex]:not([tabindex=\"-1\"])');\n if (f) add(\"carousel-focus\", f, \"Tab can land in a slide out of view (make off-screen slides inert)\");\n }\n if (c.hasAttribute(\"data-autoplay\")) {\n const first = c.querySelector('a[href],button,input,select,textarea,[tabindex]:not([tabindex=\"-1\"])');\n if (!first || first.getAttribute(\"data-ch-carousel\") !== \"rotate\")\n add(\"carousel-autoplay\", c, \"it plays on its own without a rotation control first in Tab order\");\n else if (!(first.getAttribute(\"aria-label\") || \"\").trim())\n add(\"carousel-autoplay\", first, \"its rotation control has no name\");\n }\n if (c.getAttribute(\"data-variant\") === \"hero\")\n slides.forEach((s, i) => {\n for (const img of s.querySelectorAll(\"img\")) {\n const lazy = wasLazy.has(img);\n if (i === 0 && lazy) add(\"carousel-lcp\", img, \"the first hero slide's image is lazy; it is what the reader sees first\");\n if (i > 0 && !lazy) add(\"carousel-lcp\", img, \"slide \" + (i + 1) + \"'s image loads before anyone sees it; make it lazy\");\n }\n });\n }\n\n // image-fit: cover crops that cut away much of a picture without a focal point (object-position).\n for (const img of document.querySelectorAll(\"[data-section-id] img\")) {\n const box = img.getBoundingClientRect();\n if (!img.naturalWidth || !img.naturalHeight || box.width < 80 || box.height < 80) continue;\n const cs = getComputedStyle(img);\n if (cs.objectFit !== \"cover\" || /object-position/.test(img.getAttribute(\"style\") || \"\")) continue;\n const own = img.naturalWidth / img.naturalHeight;\n const frame = box.width / box.height;\n const kept = Math.min(own, frame) / Math.max(own, frame);\n if (kept < 0.6)\n add(\"image-fit\", img, \"the frame keeps \" + Math.round(kept * 100) + \"% of the picture with no focal point; set one (update_asset focal) or use fit blur-fill\");\n }\n\n const playing = document.querySelectorAll(\"[data-autoplay]\");\n if (playing.length > 1) add(\"carousel-autoplay\", playing[1], \"a second carousel plays on its own; one per page at most\");\n\n // overlay-open: every overlay of the page's sections, opened the way a reader would.\n const isOpen = (t) => !!t.open || t.matches(\":popover-open\");\n const overlaysOf = [...document.querySelectorAll(\"[data-section-id] dialog.ch-dialog, [data-section-id] [popover].ch-popover\")];\n for (const t of overlaysOf) {\n const sel = '[commandfor=\"' + t.id + '\"]:not([command=\"close\"]),[popovertarget=\"' + t.id + '\"]:not([popovertargetaction=\"hide\"]),[data-ch-open=\"' + t.id + '\"],[data-ch-lightbox=\"' + t.id + '\"]';\n const trigger = [...document.querySelectorAll(sel)].find(shown);\n if (!trigger) { add(\"overlay-open\", t, \"nothing on the page opens it\"); continue; }\n trigger.scrollIntoView({ block: \"center\" });\n trigger.focus();\n trigger.click();\n await frame();\n if (!isOpen(t)) { add(\"overlay-open\", trigger, \"did not open its overlay\"); continue; }\n const modal = t.tagName === \"DIALOG\";\n if (modal && !t.contains(document.activeElement)) add(\"overlay-open\", t, \"focus stayed outside when it opened\");\n if (modal && t.getAttribute(\"closedby\") === \"none\" && !t.querySelector('[command=\"close\"]'))\n add(\"overlay-open\", t, \"it closes only by a button, and has none\");\n // Its text against its own paint (an overlay is opaque).\n const tw = document.createTreeWalker(t, NodeFilter.SHOW_TEXT);\n const doneT = new Set();\n while (tw.nextNode()) {\n const el = tw.currentNode.parentElement;\n if (!el || doneT.has(el) || !tw.currentNode.nodeValue.trim() || !visible(el)) continue;\n doneT.add(el);\n // The first opaque fill between the text and the overlay's edge.\n let bg = null;\n for (let e = el; e && !bg; e = e === t ? null : e.parentElement) {\n const c = rgba(getComputedStyle(e).backgroundColor);\n if (c[3] >= 1) bg = c.slice(0, 3);\n }\n if (!bg) continue;\n const st = getComputedStyle(el);\n const got = ratio(over(rgba(st.color), bg), bg);\n const big = parseFloat(st.fontSize) >= 24 || (parseFloat(st.fontSize) >= 18.66 && Number(st.fontWeight) >= 700);\n if (got < (big ? 3 : 4.5)) add(\"overlay-open\", el, got.toFixed(1) + \":1 inside the overlay, needs \" + (big ? 3 : 4.5) + \":1\");\n }\n if (modal) t.close(); else t.hidePopover();\n await frame();\n if (document.activeElement !== trigger) add(\"overlay-open\", trigger, \"focus did not come back when it closed\");\n }\n window.scrollTo(0, 0);\n";
5
+ export declare const COMPONENT_CHECKS: string;
@@ -2,7 +2,7 @@
2
2
  * In-page checks, part of `RENDER_CHECK_SCRIPT`: carousel-label / -lcp / -focus / -autoplay, image-fit, overlay-open; ends at the top of the page.
3
3
  * Plain source text, run inside the page; it shares the script's locals (see ./index.ts).
4
4
  */
5
- export const COMPONENT_CHECKS = ` // A static preview runs no scripts (its CSP), so checks of what a module does wait for the site.
5
+ export const COMPONENT_CHECKS = String.raw` // A static preview runs no scripts (its CSP), so checks of what a module does wait for the site.
6
6
  const staticPreview = !!document.querySelector('meta[name="generator"][content="Cloudhal preview"]');
7
7
  // carousel-label and carousel-lcp: named carousels and slides; a hero's first slide not lazy.
8
8
  for (const c of document.querySelectorAll('[aria-roledescription="carousel"], [aria-roledescription="kaydırmalı alan"]')) {
@@ -2,4 +2,4 @@
2
2
  * In-page checks, part of `RENDER_CHECK_SCRIPT`: empty-section, tap-target, input-label, chart-empty, long-line.
3
3
  * Plain source text, run inside the page; it shares the script's locals (see ./index.ts).
4
4
  */
5
- export declare const CONTENT_CHECKS = " // empty-section\n for (const s of document.querySelectorAll(\"[data-section-id]\")) {\n if (getComputedStyle(s).display === \"none\") continue;\n const text = (s.innerText || \"\").trim();\n const media = s.querySelector(\"img,video,iframe,svg,canvas,input,select,textarea,picture\");\n const r = s.getBoundingClientRect();\n if (!text && !media) add(\"empty-section\", s, \"no text or media\");\n else if (r.height < 8) add(\"empty-section\", s, Math.round(r.height) + \" px tall\");\n }\n\n // tap-target: on small screens, controls under 24 \u00D7 24 px that sit too close to another one\n // (WCAG 2.5.8: a 24 px circle on each must not touch another target; links inside sentences are exempt).\n if (W < 768) {\n const targets = [...document.querySelectorAll(\"a[href],button,input:not([type=hidden]),select,textarea,summary,[role=button]\")]\n .filter(visible)\n .map((el) => ({ el, r: el.getBoundingClientRect() }))\n // screen-reader-only controls (1 \u00D7 1 px) are not tapped\n .filter((t) => t.r.width > 2 || t.r.height > 2);\n const small = (t) => t.r.width < 24 || t.r.height < 24;\n const centre = (r) => [r.left + r.width / 2, r.top + r.height / 2];\n const toRect = (p, r) => Math.hypot(Math.max(r.left - p[0], 0, p[0] - r.right), Math.max(r.top - p[1], 0, p[1] - r.bottom));\n for (const t of targets) {\n if (!small(t)) continue;\n if (t.el.tagName === \"A\" && getComputedStyle(t.el).display === \"inline\") {\n const block = t.el.closest(\"p,li,td,dd,blockquote,figcaption\");\n if (block && (block.innerText || \"\").trim().length > (t.el.innerText || \"\").trim().length + 20) continue;\n }\n const c = centre(t.r);\n const near = targets.find((o) => o !== t && !o.el.contains(t.el) && !t.el.contains(o.el) &&\n (toRect(c, o.r) < 12 || (small(o) && Math.hypot(c[0] - centre(o.r)[0], c[1] - centre(o.r)[1]) < 24)));\n if (near) add(\"tap-target\", t.el, Math.round(t.r.width) + \" \u00D7 \" + Math.round(t.r.height) + \" px, too close to \" + JSON.stringify(clip((near.el.innerText || near.el.getAttribute(\"aria-label\") || near.el.tagName.toLowerCase()).trim(), 24)));\n }\n }\n\n // input-label: form controls without an accessible name (a label, aria-label or aria-labelledby).\n for (const el of document.querySelectorAll(\"input:not([type=hidden]):not([type=submit]):not([type=button]),select,textarea\")) {\n if (!visible(el) && !(el.type === \"radio\" || el.type === \"checkbox\")) continue;\n const named = [...(el.labels || [])].some((l) => (l.innerText || l.textContent || \"\").trim()) ||\n (el.getAttribute(\"aria-label\") || \"\").trim() ||\n (el.getAttribute(\"aria-labelledby\") || \"\").split(/s+/).some((id) => id && (document.getElementById(id)?.textContent || \"\").trim());\n if (!named) add(\"input-label\", el, \"no label a screen reader can announce\");\n }\n\n // chart-empty: a chart whose data has no rows.\n for (const el of document.querySelectorAll(\"[data-ch-chart-empty]\")) add(\"chart-empty\", el, \"no rows in its data\");\n\n // long-line: text columns whose full lines hold more than 90 characters on average. Counted on\n // the rendered lines (each paragraph's last, partly filled one left out) and pooled over every\n // paragraph of the same width and font, so paragraphs of one column get one verdict.\n const range = document.createRange();\n const columns = new Map();\n let measured = 0;\n for (const p of document.querySelectorAll(\"p,li,dd,blockquote\")) {\n if (measured >= 80 || !visible(p) || p.querySelector(\"p,li\")) continue;\n if ((p.innerText || \"\").trim().length < 180) continue;\n measured++;\n // Characters by the line they are drawn on, in reading order: a character more than half a\n // line below the current line starts the next (inline code in another size stays on its line).\n // A run of spaces counts once, as it is shown.\n const s = getComputedStyle(p);\n const half = (s.lineHeight === \"normal\" ? parseFloat(s.fontSize) * 1.2 : parseFloat(s.lineHeight)) / 2;\n const rows = [];\n let top = -Infinity, seen = 0, space = true;\n const tw = document.createTreeWalker(p, NodeFilter.SHOW_TEXT);\n while (tw.nextNode() && seen < 800) {\n const n = tw.currentNode;\n for (let i = 0; i < n.length && seen < 800; i++) {\n const blank = /s/.test(n.data[i]);\n if (blank && space) continue;\n space = blank;\n seen++;\n range.setStart(n, i);\n range.setEnd(n, i + 1);\n const b = range.getClientRects()[0];\n if (!b) continue;\n if (b.top > top + half) { rows.push(0); top = b.top; }\n rows[rows.length - 1]++;\n }\n }\n // The last line seen may be partly filled (the paragraph's end, or where counting stopped).\n const full = rows.slice(0, -1);\n if (full.length < 2) continue;\n const width = Math.round(p.getBoundingClientRect().width);\n const key = width + \"|\" + s.fontSize + \"|\" + s.fontFamily;\n const col = columns.get(key) || { width, first: p, paragraphs: 0, lines: 0, chars: 0 };\n col.paragraphs++;\n col.lines += full.length;\n col.chars += full.reduce((a, b) => a + b, 0);\n columns.set(key, col);\n }\n for (const col of columns.values()) {\n const per = Math.round(col.chars / col.lines);\n if (per > 90)\n add(\"long-line\", col.first, \"about \" + per + \" characters a line in this \" + col.width + \" px column\" + (col.paragraphs > 1 ? \" (\" + col.paragraphs + \" paragraphs)\" : \"\"));\n }\n";
5
+ export declare const CONTENT_CHECKS: string;
@@ -2,7 +2,7 @@
2
2
  * In-page checks, part of `RENDER_CHECK_SCRIPT`: empty-section, tap-target, input-label, chart-empty, long-line.
3
3
  * Plain source text, run inside the page; it shares the script's locals (see ./index.ts).
4
4
  */
5
- export const CONTENT_CHECKS = ` // empty-section
5
+ export const CONTENT_CHECKS = String.raw` // empty-section
6
6
  for (const s of document.querySelectorAll("[data-section-id]")) {
7
7
  if (getComputedStyle(s).display === "none") continue;
8
8
  const text = (s.innerText || "").trim();
@@ -41,7 +41,7 @@ export const CONTENT_CHECKS = ` // empty-section
41
41
  if (!visible(el) && !(el.type === "radio" || el.type === "checkbox")) continue;
42
42
  const named = [...(el.labels || [])].some((l) => (l.innerText || l.textContent || "").trim()) ||
43
43
  (el.getAttribute("aria-label") || "").trim() ||
44
- (el.getAttribute("aria-labelledby") || "").split(/s+/).some((id) => id && (document.getElementById(id)?.textContent || "").trim());
44
+ (el.getAttribute("aria-labelledby") || "").split(/\s+/).some((id) => id && (document.getElementById(id)?.textContent || "").trim());
45
45
  if (!named) add("input-label", el, "no label a screen reader can announce");
46
46
  }
47
47
 
@@ -2,4 +2,4 @@
2
2
  * In-page checks, part of `RENDER_CHECK_SCRIPT`: contrast: text against what is painted beneath it, band by band.
3
3
  * Plain source text, run inside the page; it shares the script's locals (see ./index.ts).
4
4
  */
5
- export declare const CONTRAST_CHECKS = " // contrast: text against what is painted beneath it (elementsFromPoint), band by band.\n const canvas = document.createElement(\"canvas\");\n canvas.width = canvas.height = 1;\n const g = canvas.getContext(\"2d\", { willReadFrequently: true });\n const rgba = (css) => {\n g.clearRect(0, 0, 1, 1);\n g.fillStyle = \"rgba(0,0,0,0)\";\n g.fillStyle = css;\n g.fillRect(0, 0, 1, 1);\n const d = g.getImageData(0, 0, 1, 1).data;\n return [d[0], d[1], d[2], d[3] / 255];\n };\n const over = (top, under) => [0, 1, 2].map((i) => top[i] * top[3] + under[i] * (1 - top[3]));\n const lum = (c) => {\n const [r, gg, b] = c.map((v) => {\n v /= 255;\n return v <= 0.03928 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4);\n });\n return 0.2126 * r + 0.7152 * gg + 0.0722 * b;\n };\n const ratio = (a, b) => {\n const [x, y] = [lum(a), lum(b)].sort((p, q) => q - p);\n return (x + 0.05) / (y + 0.05);\n };\n const texts = [];\n const walker = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT);\n const seen = new Set();\n while (walker.nextNode() && texts.length < 800) {\n const n = walker.currentNode;\n const el = n.parentElement;\n if (!el || seen.has(el) || !n.nodeValue.trim()) continue;\n if (el.closest(\"script,style,noscript,template,svg\")) continue;\n seen.add(el);\n if (visible(el)) texts.push(el);\n }\n const pending = new Set(texts);\n const page = Math.max(document.documentElement.scrollHeight, H);\n for (let y = 0; y < page && pending.size; y += H) {\n window.scrollTo(0, y);\n for (const el of [...pending]) {\n const r = el.getBoundingClientRect();\n const cx = r.left + Math.min(r.width / 2, 12), cy = r.top + Math.min(r.height / 2, 10);\n if (cy < 0 || cy >= H || cx < 0 || cx >= W) continue;\n const stack = document.elementsFromPoint(cx, cy);\n const at = stack.indexOf(el);\n if (at < 0) continue;\n pending.delete(el);\n const layers = [];\n let known = true;\n for (const e of stack.slice(at)) {\n const s = getComputedStyle(e);\n if (/^(IMG|VIDEO|CANVAS|IFRAME|PICTURE)$/.test(e.tagName) || e.tagName.toLowerCase() === \"svg\" || s.backgroundImage !== \"none\") { known = false; break; }\n const c = rgba(s.backgroundColor);\n if (c[3] > 0) { layers.push(c); if (c[3] >= 1) break; }\n }\n if (!known) continue;\n let bg = [255, 255, 255];\n for (const c of layers.reverse()) bg = over(c, bg);\n const s = getComputedStyle(el);\n const fg = over(rgba(s.color), bg);\n const size = parseFloat(s.fontSize), weight = Number(s.fontWeight) || 400;\n const need = size >= 24 || (size >= 18.66 && weight >= 700) ? 3 : 4.5;\n const got = ratio(fg, bg);\n if (got < need) add(\"contrast\", el, got.toFixed(1) + \":1, needs \" + need + \":1\");\n }\n }\n window.scrollTo(0, 0);\n";
5
+ export declare const CONTRAST_CHECKS: string;
@@ -2,7 +2,7 @@
2
2
  * In-page checks, part of `RENDER_CHECK_SCRIPT`: contrast: text against what is painted beneath it, band by band.
3
3
  * Plain source text, run inside the page; it shares the script's locals (see ./index.ts).
4
4
  */
5
- export const CONTRAST_CHECKS = ` // contrast: text against what is painted beneath it (elementsFromPoint), band by band.
5
+ export const CONTRAST_CHECKS = String.raw` // contrast: text against what is painted beneath it (elementsFromPoint), band by band.
6
6
  const canvas = document.createElement("canvas");
7
7
  canvas.width = canvas.height = 1;
8
8
  const g = canvas.getContext("2d", { willReadFrequently: true });
@@ -2,4 +2,4 @@
2
2
  * In-page checks, part of `RENDER_CHECK_SCRIPT`: font-fallback.
3
3
  * Plain source text, run inside the page; it shares the script's locals (see ./index.ts).
4
4
  */
5
- export declare const FONT_CHECKS = " // font-fallback (RFC-0023 \u00A72): text set in a web font whose stack has no metric-matched fallback\n // right after it (a face with size-adjust or ascent-override). Without one, the text is first\n // drawn in a system font of another size and moves when the web font arrives.\n if (document.fonts) {\n const tuned = new Set(), web = new Set();\n const name = (f) => f.trim().replace(/^[\"']|[\"']$/g, \"\").toLowerCase();\n for (const f of document.fonts) {\n const fam = name(f.family);\n if ((f.sizeAdjust && f.sizeAdjust !== \"100%\") || (f.ascentOverride && f.ascentOverride !== \"normal\")) tuned.add(fam);\n else if (f.status === \"loaded\") web.add(fam);\n }\n const seen = new Set();\n const walker = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT);\n for (let n = walker.nextNode(); n; n = walker.nextNode()) {\n const el = n.parentElement;\n if (!el || !n.textContent.trim()) continue;\n const stack = getComputedStyle(el).fontFamily;\n if (seen.has(stack)) continue;\n seen.add(stack);\n const fams = stack.split(\",\").map(name);\n if (!web.has(fams[0]) || tuned.has(fams[0]) || tuned.has(fams[1] || \"\")) continue;\n if (!visible(el)) { seen.delete(stack); continue; }\n add(\"font-fallback\", el, JSON.stringify(fams[0]) + \" has no metric-matched fallback after it, so the text moves when the font loads\");\n }\n }\n";
5
+ export declare const FONT_CHECKS: string;
@@ -2,7 +2,7 @@
2
2
  * In-page checks, part of `RENDER_CHECK_SCRIPT`: font-fallback.
3
3
  * Plain source text, run inside the page; it shares the script's locals (see ./index.ts).
4
4
  */
5
- export const FONT_CHECKS = ` // font-fallback (RFC-0023 §2): text set in a web font whose stack has no metric-matched fallback
5
+ export const FONT_CHECKS = String.raw` // font-fallback (RFC-0023 §2): text set in a web font whose stack has no metric-matched fallback
6
6
  // right after it (a face with size-adjust or ascent-override). Without one, the text is first
7
7
  // drawn in a system font of another size and moves when the web font arrives.
8
8
  if (document.fonts) {
@@ -6,6 +6,10 @@
6
6
  * prelude defines the helpers (`add`, `describe`, `visible`, `imgs`, `W`, `H`); the motion part
7
7
  * scrolls the page once and defines `frame`, which the navigation and component parts use; the
8
8
  * component part ends back at the top. Keep the order.
9
+ *
10
+ * Every part is a `String.raw` template, so a backslash in the page's code (`/\s/`) reaches the
11
+ * page as written: in a plain template `\s` arrives as `s` and `\b` as a control character, and
12
+ * Biome's useless-escape fix deleted the backslash (test/render-script.test.ts checks this).
9
13
  */
10
14
  import { COMPONENT_CHECKS } from "./components.js";
11
15
  import { CONTENT_CHECKS } from "./content.js";
@@ -2,4 +2,4 @@
2
2
  * In-page checks, part of `RENDER_CHECK_SCRIPT`: overflow-x, img-alt / img-broken, heading-order.
3
3
  * Plain source text, run inside the page; it shares the script's locals (see ./index.ts).
4
4
  */
5
- export declare const LAYOUT_CHECKS = " // overflow-x: the outermost elements that stick out past the screen's right edge.\n const sw = document.documentElement.scrollWidth;\n if (sw > W + 1) {\n const clipped = (el) => {\n for (let e = el.parentElement; e && e !== document.body; e = e.parentElement) {\n const o = getComputedStyle(e).overflowX;\n if (o !== \"visible\") return true;\n }\n return false;\n };\n for (const el of document.body.querySelectorAll(\"*\")) {\n const r = el.getBoundingClientRect();\n if (r.width === 0 || r.right <= W + 1) continue;\n const p = el.parentElement && el.parentElement.getBoundingClientRect();\n if (p && p.right > W + 1) continue;\n if (clipped(el)) continue;\n add(\"overflow-x\", el, Math.round(r.right - W) + \" px past the edge\");\n }\n if (out[\"overflow-x\"].count === 0) add(\"overflow-x\", document.body, \"the page is \" + (sw - W) + \" px wider than the screen\");\n }\n\n // img-alt / img-broken\n for (const img of imgs) {\n if (!img.hasAttribute(\"alt\") && img.getAttribute(\"role\") !== \"presentation\" && img.getAttribute(\"aria-hidden\") !== \"true\")\n add(\"img-alt\", img, \"no alt attribute\");\n if (img.getAttribute(\"src\") && img.complete && img.naturalWidth === 0) add(\"img-broken\", img, \"did not load\");\n }\n\n // heading-order\n const hs = [...document.querySelectorAll(\"h1,h2,h3,h4,h5,h6\")].filter(visible);\n const h1 = hs.filter((h) => h.tagName === \"H1\");\n if (h1.length === 0) add(\"heading-order\", document.body, \"no level-1 heading\");\n for (const h of h1.slice(1)) add(\"heading-order\", h, \"a second level-1 heading\");\n let prev = 0;\n for (const h of hs) {\n const level = Number(h.tagName[1]);\n if (prev && level > prev + 1) add(\"heading-order\", h, \"h\" + prev + \" \u2192 h\" + level + \" skips a level\");\n prev = level;\n }\n";
5
+ export declare const LAYOUT_CHECKS: string;
@@ -2,7 +2,7 @@
2
2
  * In-page checks, part of `RENDER_CHECK_SCRIPT`: overflow-x, img-alt / img-broken, heading-order.
3
3
  * Plain source text, run inside the page; it shares the script's locals (see ./index.ts).
4
4
  */
5
- export const LAYOUT_CHECKS = ` // overflow-x: the outermost elements that stick out past the screen's right edge.
5
+ export const LAYOUT_CHECKS = String.raw` // overflow-x: the outermost elements that stick out past the screen's right edge.
6
6
  const sw = document.documentElement.scrollWidth;
7
7
  if (sw > W + 1) {
8
8
  const clipped = (el) => {
@@ -2,4 +2,4 @@
2
2
  * In-page checks, part of `RENDER_CHECK_SCRIPT`: The reader's scroll pass, then motion-cls, reduced-motion, motion-budget, flash; defines `frame`.
3
3
  * Plain source text, run inside the page; it shares the script's locals (see ./index.ts).
4
4
  */
5
- export declare const MOTION_CHECKS = " // RFC-0024 \u00A78: scroll through the page once, as a reader would, so reveals play, then measure.\n let shift = 0;\n let po;\n try {\n po = new PerformanceObserver((list) => {\n for (const e of list.getEntries()) if (!e.hadRecentInput) shift += e.value;\n });\n po.observe({ type: \"layout-shift\", buffered: true });\n } catch {}\n const pageH = document.documentElement.scrollHeight;\n for (let y = 0; y < pageH; y += Math.round(H * 0.8)) {\n window.scrollTo(0, y);\n await new Promise((r) => setTimeout(r, 90));\n }\n window.scrollTo(0, pageH);\n await new Promise((r) => setTimeout(r, 700));\n if (po) {\n for (const e of po.takeRecords()) if (!e.hadRecentInput) shift += e.value;\n po.disconnect();\n }\n // motion-cls: more layout shift than Core Web Vitals' \"good\" threshold.\n if (shift > 0.1) add(\"motion-cls\", document.body, \"layout shift \" + shift.toFixed(2) + \" while loading and scrolling (good is 0.1 or less)\");\n // reduced-motion: with the reader asking for less, nothing stays hidden and nothing travels.\n if (matchMedia(\"(prefers-reduced-motion: reduce)\").matches) {\n for (const el of document.querySelectorAll(\"[data-ch-reveal]\"))\n if (el.classList.contains(\"ch-pre\") || Number(getComputedStyle(el).opacity) === 0)\n add(\"reduced-motion\", el, \"stays hidden for readers who ask for reduced motion\");\n const moving = /transform|translate|scale|rotate|^top$|^left$|^right$|^bottom$|offset/;\n for (const a of document.getAnimations ? document.getAnimations() : []) {\n if (a.playState !== \"running\" || !a.effect || !a.effect.getKeyframes) continue;\n const props = a.effect.getKeyframes().flatMap((k) => Object.keys(k));\n if (!props.some((p) => moving.test(p))) continue;\n const el = a.effect.target;\n if (el) add(\"reduced-motion\", el, \"moves for readers who ask for reduced motion\");\n }\n }\n // motion-budget: a page carries a few scroll effects and one scroll story, not a show.\n const scrolls = document.querySelectorAll(\"[data-ch-scroll]\");\n if (scrolls.length > 6) add(\"motion-budget\", scrolls[6], scrolls.length + \" scroll effects on the page; keep to 6 or fewer, the strongest ones\");\n const stories = document.querySelectorAll(\".ch-scrolly\");\n if (stories.length > 1) add(\"motion-budget\", stories[1], stories.length + \" scroll stories on the page; keep to one\");\n const splits = document.querySelectorAll('[data-ch-reveal^=\"split-\"]');\n if (splits.length > 2) add(\"motion-budget\", splits[2], splits.length + \" split headings or texts; keep to 2, for the lines that matter most\");\n const ambients = document.querySelectorAll(\"[data-ch-ambient]\");\n if (ambients.length > 2) add(\"motion-budget\", ambients[2], ambients.length + \" ambient backgrounds on the page; keep to 2, best one on the hero\");\n const loops = document.querySelectorAll(\"[data-ch-loop], .ch-marquee, [data-ch-rotate]\");\n if (loops.length > 2) add(\"motion-budget\", loops[2], loops.length + \" things that loop on the page; keep to 2\");\n // flash: a running animation that repeats faster than three times a second and changes how\n // bright something is (opacity, color, background, filter, visibility).\n const bright = /opacity|color|background|filter|visibility|fill/i;\n for (const a of document.getAnimations ? document.getAnimations() : []) {\n if (a.playState !== \"running\" || !a.effect || !a.effect.getComputedTiming) continue;\n const t = a.effect.getComputedTiming();\n const each = Number(t.duration) / Math.max(0.0001, Math.abs(a.playbackRate || 1));\n if (!(t.iterations > 1) || !(each > 0) || each >= 1000 / 3) continue;\n const props = a.effect.getKeyframes ? a.effect.getKeyframes().flatMap((k) => Object.keys(k)) : [];\n if (props.some((p) => bright.test(p)) && a.effect.target) add(\"flash\", a.effect.target, \"repeats \" + Math.round(1000 / each) + \" times a second\");\n }\n window.scrollTo(0, 0);\n const frame = () => new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(r)));\n await frame();\n";
5
+ export declare const MOTION_CHECKS: string;
@@ -2,7 +2,7 @@
2
2
  * In-page checks, part of `RENDER_CHECK_SCRIPT`: The reader's scroll pass, then motion-cls, reduced-motion, motion-budget, flash; defines `frame`.
3
3
  * Plain source text, run inside the page; it shares the script's locals (see ./index.ts).
4
4
  */
5
- export const MOTION_CHECKS = ` // RFC-0024 §8: scroll through the page once, as a reader would, so reveals play, then measure.
5
+ export const MOTION_CHECKS = String.raw` // RFC-0024 §8: scroll through the page once, as a reader would, so reveals play, then measure.
6
6
  let shift = 0;
7
7
  let po;
8
8
  try {
@@ -2,4 +2,4 @@
2
2
  * In-page checks, part of `RENDER_CHECK_SCRIPT`: skip-link, landmarks, header-contrast, focus-obscured.
3
3
  * Plain source text, run inside the page; it shares the script's locals (see ./index.ts).
4
4
  */
5
- export declare const NAVIGATION_CHECKS = " // skip-link: the first focusable element is a link to the main content (or inside it).\n const shown = (e) => e.getClientRects().length > 0 && getComputedStyle(e).visibility !== \"hidden\";\n const focusables = [...document.querySelectorAll('a[href],button,input,select,textarea,summary,[tabindex]:not([tabindex=\"-1\"])')]\n .filter((e) => !e.disabled && !e.closest(\"[inert],dialog:not([open]),[popover]:not(:popover-open)\") && shown(e));\n const firstFocus = focusables[0];\n if (firstFocus) {\n const href = firstFocus.tagName === \"A\" ? firstFocus.getAttribute(\"href\") || \"\" : \"\";\n const target = href.startsWith(\"#\") && href.length > 1 ? document.getElementById(decodeURIComponent(href.slice(1))) : null;\n if (!target) add(\"skip-link\", firstFocus, \"the first thing Tab reaches is not a link to the main content\");\n else if (!target.matches(\"main,[role=main]\") && !target.closest(\"main,[role=main]\")) add(\"skip-link\", firstFocus, \"it points at #\" + target.id + \", outside the main content\");\n }\n\n // landmarks: one banner header, one main, one footer (outside articles and sections), named menus.\n const top = (sel) => [...document.querySelectorAll(sel)].filter((e) => shown(e) && !(e.parentElement && e.parentElement.closest(\"article,aside,main,nav,section,dialog\")));\n const banners = top(\"header\"), mains = [...document.querySelectorAll(\"main,[role=main]\")].filter(shown), infos = top(\"footer\");\n if (banners.length !== 1) add(\"landmarks\", banners[1] || document.body, banners.length + \" page headers (one is right)\");\n if (mains.length !== 1) add(\"landmarks\", mains[1] || document.body, mains.length + \" main regions (one is right)\");\n if (infos.length !== 1) add(\"landmarks\", infos[1] || document.body, infos.length + \" page footers (one is right)\");\n const navs = [...document.querySelectorAll(\"nav\")].filter(shown);\n if (navs.length > 1) for (const n of navs) if (!n.getAttribute(\"aria-label\") && !n.getAttribute(\"aria-labelledby\")) add(\"landmarks\", n, \"a menu without a name (aria-label), among \" + navs.length);\n\n // header-contrast: a transparent header's text against what is under it, at the top of the page.\n const clear = document.querySelector(\"header[data-transparent]\");\n if (clear && !clear.hasAttribute(\"data-ch-scrolled\")) {\n const done = new Set();\n const tw = document.createTreeWalker(clear, NodeFilter.SHOW_TEXT);\n while (tw.nextNode()) {\n const el = tw.currentNode.parentElement;\n if (!el || done.has(el) || !tw.currentNode.nodeValue.trim() || !visible(el)) continue;\n done.add(el);\n if (el.closest(\"[popover],dialog,.ch-menu__panel\")) continue;\n const r = el.getBoundingClientRect();\n if (r.width <= 1 || r.height <= 1) continue;\n const cx = r.left + Math.min(r.width / 2, 12), cy = r.top + Math.min(r.height / 2, 10);\n if (cy < 0 || cy >= H || cx < 0 || cx >= W) continue;\n // Text on a fill of its own inside the header (a button, a field) is the contrast check's.\n let own = false;\n for (let e = el; e && e !== clear; e = e.parentElement) if (rgba(getComputedStyle(e).backgroundColor)[3] > 0.5) { own = true; break; }\n if (own) continue;\n let bg = null;\n for (const e of document.elementsFromPoint(cx, cy)) {\n if (clear.contains(e)) continue;\n if (/^(IMG|VIDEO|CANVAS|IFRAME|PICTURE)$/.test(e.tagName)) break;\n const c = rgba(getComputedStyle(e).backgroundColor);\n if (c[3] > 0) { bg = over(c, [255, 255, 255]); break; }\n }\n if (!bg) bg = [255, 255, 255];\n const st = getComputedStyle(el);\n const got = ratio(over(rgba(st.color), bg), bg);\n const big = parseFloat(st.fontSize) >= 24 || (parseFloat(st.fontSize) >= 18.66 && Number(st.fontWeight) >= 700);\n if (got < (big ? 3 : 4.5)) add(\"header-contrast\", el, got.toFixed(1) + \":1 over the first band, needs \" + (big ? 3 : 4.5) + \":1\");\n }\n }\n\n // focus-obscured: tabbing back up the page, a sticky or fixed header never covers the focused element.\n const stuck = [...document.querySelectorAll(\"header,[data-ch-bar]\")].filter((e) => shown(e) && /sticky|fixed/.test(getComputedStyle(e).position));\n if (stuck.length) {\n const targets = [...document.querySelectorAll(\"main a[href],main button,main input,main summary,body > footer a[href]\")]\n .filter((e) => shown(e) && visible(e)).slice(-40).reverse();\n window.scrollTo(0, document.documentElement.scrollHeight);\n await frame();\n for (const el of targets) {\n el.focus();\n await frame();\n const r = el.getBoundingClientRect();\n const cx = Math.min(Math.max(r.left + r.width / 2, 0), W - 1), cy = Math.min(Math.max(r.top + r.height / 2, 0), H - 1);\n const at = document.elementFromPoint(cx, cy);\n const cover = at && !el.contains(at) && stuck.find((s) => s.contains(at));\n if (cover) add(\"focus-obscured\", el, \"under the \" + (cover.tagName === \"HEADER\" ? \"sticky header\" : \"bar\") + \" when it has focus\");\n }\n if (document.activeElement && document.activeElement.blur) document.activeElement.blur();\n window.scrollTo(0, 0);\n }\n";
5
+ export declare const NAVIGATION_CHECKS: string;
@@ -2,7 +2,7 @@
2
2
  * In-page checks, part of `RENDER_CHECK_SCRIPT`: skip-link, landmarks, header-contrast, focus-obscured.
3
3
  * Plain source text, run inside the page; it shares the script's locals (see ./index.ts).
4
4
  */
5
- export const NAVIGATION_CHECKS = ` // skip-link: the first focusable element is a link to the main content (or inside it).
5
+ export const NAVIGATION_CHECKS = String.raw` // skip-link: the first focusable element is a link to the main content (or inside it).
6
6
  const shown = (e) => e.getClientRects().length > 0 && getComputedStyle(e).visibility !== "hidden";
7
7
  const focusables = [...document.querySelectorAll('a[href],button,input,select,textarea,summary,[tabindex]:not([tabindex="-1"])')]
8
8
  .filter((e) => !e.disabled && !e.closest("[inert],dialog:not([open]),[popover]:not(:popover-open)") && shown(e));
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import { RENDER_CHECK_IDS } from "../types.js";
6
6
 
7
- export const PRELUDE = ` const W = document.documentElement.clientWidth || window.innerWidth, H = window.innerHeight, MAX = 5;
7
+ export const PRELUDE = String.raw` const W = document.documentElement.clientWidth || window.innerWidth, H = window.innerHeight, MAX = 5;
8
8
  const ids = ${JSON.stringify(RENDER_CHECK_IDS)};
9
9
  const out = Object.fromEntries(ids.map((id) => [id, { id, count: 0, examples: [] }]));
10
10
  const clip = (s, n) => (s.length > n ? s.slice(0, n - 1) + "…" : s);
@@ -22,9 +22,9 @@ export const PRELUDE = ` const W = document.documentElement.clientWidth || wind
22
22
  let tag = el.tagName.toLowerCase();
23
23
  if (el.id) tag += "#" + el.id;
24
24
  else if (typeof el.className === "string" && el.className.trim())
25
- tag += "." + el.className.trim().split(/\\s+/).slice(0, 2).join(".");
25
+ tag += "." + el.className.trim().split(/\s+/).slice(0, 2).join(".");
26
26
  parts.push(tag);
27
- const text = ((el.innerText || "").trim() || el.getAttribute("alt") || el.getAttribute("src") || "").replace(/\\s+/g, " ");
27
+ const text = ((el.innerText || "").trim() || el.getAttribute("alt") || el.getAttribute("src") || "").replace(/\s+/g, " ");
28
28
  if (text) parts.push(JSON.stringify(clip(text, 48)));
29
29
  return parts.join(" ");
30
30
  };
@@ -7,5 +7,5 @@
7
7
  * keeps the Content-Security-Policy violations the page raises while it loads, which the
8
8
  * `script-blocked` check reads. Report-only ones (`cloudhal dev`) are kept too.
9
9
  */
10
- export declare const CSP_LISTENER = "(() => {\n const seen = (window.__chCsp = []);\n window.addEventListener(\"securitypolicyviolation\", (e) => {\n if (seen.length < 50)\n seen.push({ directive: e.effectiveDirective || e.violatedDirective || \"\", blocked: e.blockedURI || \"\", sample: e.sample || \"\", line: e.lineNumber || 0, report: e.disposition === \"report\", el: e.target instanceof Element ? e.target : null });\n }, true);\n})();";
11
- export declare const SCRIPT_CHECKS = " // surface-broken: a body surface the preview could not draw (RFC-0020 \u00A75), or a component in one\n // with an unknown block type or props that do not fit it. Theme blocks the preview leaves to the\n // site are fine.\n for (const el of document.querySelectorAll(\".ch-surface-problem\")) {\n const why = [...el.querySelectorAll(\"li\")].map((li) => (li.textContent || \"\").trim()).filter(Boolean);\n add(\"surface-broken\", el, why.length ? why.slice(0, 3).join(\"; \") : \"this interactive block cannot be shown\");\n }\n for (const el of document.querySelectorAll(\".ch-block--missing\")) {\n const text = (el.textContent || \"\").trim();\n if (!/shown by the theme on the site$/.test(text)) add(\"surface-broken\", el, text);\n }\n\n // script-blocked: scripts the page's Content-Security-Policy refused (the Site Worker sends\n // script-src 'self', so an inline <script> never runs there). A static preview runs none on\n // purpose (its own CSP), so it is not asked.\n const runsScripts = !document.querySelector('meta[name=\"generator\"][content=\"Cloudhal preview\"]');\n for (const v of runsScripts ? window.__chCsp || [] : []) {\n if (!/^(script-src|script-src-elem|script-src-attr|worker-src)$/.test(v.directive)) continue;\n const inline = v.blocked === \"inline\" || v.blocked === \"eval\" || !v.blocked;\n const what = inline\n ? (v.blocked === \"eval\" ? \"eval\" : \"an inline script\") + (v.sample ? \" \" + JSON.stringify(clip(v.sample.trim(), 40)) : \"\") + (v.line ? \" at line \" + v.line : \"\")\n : \"the script \" + v.blocked;\n const fix = inline ? \"; ship it as a file (a .js under /_astro or public/)\" : \"\";\n const el = v.el && v.el.isConnected ? v.el : document.body;\n add(\"script-blocked\", el, what + (v.report ? \" would be blocked on the site\" : \" was blocked\") + \" by \" + v.directive + fix);\n }\n";
10
+ export declare const CSP_LISTENER: string;
11
+ export declare const SCRIPT_CHECKS: string;
@@ -8,7 +8,7 @@
8
8
  * keeps the Content-Security-Policy violations the page raises while it loads, which the
9
9
  * `script-blocked` check reads. Report-only ones (`cloudhal dev`) are kept too.
10
10
  */
11
- export const CSP_LISTENER = `(() => {
11
+ export const CSP_LISTENER = String.raw`(() => {
12
12
  const seen = (window.__chCsp = []);
13
13
  window.addEventListener("securitypolicyviolation", (e) => {
14
14
  if (seen.length < 50)
@@ -16,7 +16,7 @@ export const CSP_LISTENER = `(() => {
16
16
  }, true);
17
17
  })();`;
18
18
 
19
- export const SCRIPT_CHECKS = ` // surface-broken: a body surface the preview could not draw (RFC-0020 §5), or a component in one
19
+ export const SCRIPT_CHECKS = String.raw` // surface-broken: a body surface the preview could not draw (RFC-0020 §5), or a component in one
20
20
  // with an unknown block type or props that do not fit it. Theme blocks the preview leaves to the
21
21
  // site are fine.
22
22
  for (const el of document.querySelectorAll(".ch-surface-problem")) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudhal/mcp-server",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "description": "Cloudhal MCP server: semantic site tools (pages, articles, snapshots, preview, publish) governed by the policy engine",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://cloudhal.dev",
@@ -56,24 +56,24 @@
56
56
  "README.md"
57
57
  ],
58
58
  "dependencies": {
59
- "@cloudhal/analytics": "0.6.1",
60
- "@cloudhal/agent-runtime": "0.6.1",
61
- "@cloudhal/astro-renderer": "0.6.1",
62
- "@cloudhal/comments": "0.6.1",
63
- "@cloudhal/core-contracts": "0.6.1",
64
- "@cloudhal/core-ts": "0.6.1",
65
- "@cloudhal/storage": "0.6.1",
59
+ "@cloudhal/analytics": "0.6.2",
60
+ "@cloudhal/agent-runtime": "0.6.2",
61
+ "@cloudhal/astro-renderer": "0.6.2",
62
+ "@cloudhal/comments": "0.6.2",
63
+ "@cloudhal/core-contracts": "0.6.2",
64
+ "@cloudhal/core-ts": "0.6.2",
65
+ "@cloudhal/storage": "0.6.2",
66
66
  "@modelcontextprotocol/server": "2.3.1",
67
- "@cloudhal/schedules": "0.6.1"
67
+ "@cloudhal/schedules": "0.6.2"
68
68
  },
69
69
  "devDependencies": {
70
70
  "@cloudflare/workers-types": "^5.20261007.1",
71
71
  "@modelcontextprotocol/client": "2.3.1",
72
72
  "@types/node": "^26.6.5",
73
73
  "better-sqlite3": "13.0.3",
74
- "happy-dom": "^21.0.1",
74
+ "happy-dom": "^21.0.4",
75
75
  "typescript": "7.0.2",
76
- "vitest": "5.0.3"
76
+ "vitest": "5.0.5"
77
77
  },
78
78
  "engines": {
79
79
  "node": ">=24"