pagegraph 0.12.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +325 -66
- package/dist/anthropic-messages-TqKpKmfW.js +1067 -0
- package/dist/anthropic-messages-TqKpKmfW.js.map +1 -0
- package/dist/audit.d.ts +4 -2
- package/dist/audit.js +5 -5
- package/dist/audit.js.map +1 -1
- package/dist/azure-openai-responses-DJjBLwoI.js +231 -0
- package/dist/azure-openai-responses-DJjBLwoI.js.map +1 -0
- package/dist/build-only/audit.js +1 -1
- package/dist/build-only/claims.d.ts +1 -0
- package/dist/build-only/claims.js +6 -0
- package/dist/build-only/claims.js.map +1 -0
- package/dist/build-only/config.js +1 -1
- package/dist/build-only/oxlint.d.ts +1 -0
- package/dist/build-only/oxlint.js +6 -0
- package/dist/build-only/oxlint.js.map +1 -0
- package/dist/build-only/tanstack-start.js +1 -1
- package/dist/build-only/vite.js +1 -1
- package/dist/{checks-uZk5Em9A.js → checks-BS-aDXB_.js} +2 -2
- package/dist/checks-BS-aDXB_.js.map +1 -0
- package/dist/claims-Bch7Lxlo.d.ts +92 -0
- package/dist/claims-Bv7voeEV.js +431 -0
- package/dist/claims-Bv7voeEV.js.map +1 -0
- package/dist/claims.d.ts +94 -0
- package/dist/claims.js +2 -0
- package/dist/cli.js +17607 -43387
- package/dist/cli.js.map +1 -1
- package/dist/cloudflare-workers-ai-system-one-f3ZrvNYZ.js +41 -0
- package/dist/cloudflare-workers-ai-system-one-f3ZrvNYZ.js.map +1 -0
- package/dist/config.d.ts +9 -29
- package/dist/config.js +2 -2
- package/dist/config.js.map +1 -1
- package/dist/{content-kcEnQdfi.js → content-CHd0X4s6.js} +2 -2
- package/dist/{content-kcEnQdfi.js.map → content-CHd0X4s6.js.map} +1 -1
- package/dist/{content-B1cPtL8b.d.ts → content-DgNr7apS.d.ts} +4 -5
- package/dist/declare-D5o7hwmv.js.map +1 -1
- package/dist/diagnostics-Wt5faNDM.js +108 -0
- package/dist/diagnostics-Wt5faNDM.js.map +1 -0
- package/dist/dist-B6zg_Z3Z.js +4794 -0
- package/dist/dist-B6zg_Z3Z.js.map +1 -0
- package/dist/document-CztEu3Vd.d.ts +109 -0
- package/dist/document-Dvemcv7V.js +379 -0
- package/dist/document-Dvemcv7V.js.map +1 -0
- package/dist/env-api-keys-C-OA0yM-.js +124 -0
- package/dist/env-api-keys-C-OA0yM-.js.map +1 -0
- package/dist/error-body-CyiejW4b.js +103 -0
- package/dist/error-body-CyiejW4b.js.map +1 -0
- package/dist/facts-1OKclPOk.js +115 -0
- package/dist/facts-1OKclPOk.js.map +1 -0
- package/dist/github-copilot-headers-CEpMOpQF.js +24 -0
- package/dist/github-copilot-headers-CEpMOpQF.js.map +1 -0
- package/dist/google-generative-ai-BxABKIKO.js +330 -0
- package/dist/google-generative-ai-BxABKIKO.js.map +1 -0
- package/dist/google-shared-0gpM2jFi.js +19471 -0
- package/dist/google-shared-0gpM2jFi.js.map +1 -0
- package/dist/google-vertex-D8Eb5cbu.js +376 -0
- package/dist/google-vertex-D8Eb5cbu.js.map +1 -0
- package/dist/{declare-DVgdEdOL.d.ts → graph-D1PIndsC.d.ts} +117 -6
- package/dist/{graph-Bcsourlv.js → graph-DMNOLXLu.js} +23 -13
- package/dist/graph-DMNOLXLu.js.map +1 -0
- package/dist/hash-Dp7EzZUo.js +18 -0
- package/dist/hash-Dp7EzZUo.js.map +1 -0
- package/dist/headers-BRNMVpzu.js +19 -0
- package/dist/headers-BRNMVpzu.js.map +1 -0
- package/dist/index-C5w9ripz.d.ts +204 -0
- package/dist/index.d.ts +6 -160
- package/dist/index.js +37 -5
- package/dist/index.js.map +1 -1
- package/dist/inline-BbS93GAT.js +682 -0
- package/dist/inline-BbS93GAT.js.map +1 -0
- package/dist/json-parse-C10znB7l.js +383 -0
- package/dist/json-parse-C10znB7l.js.map +1 -0
- package/dist/llms-Dhr_5u2O.js +19 -0
- package/dist/llms-Dhr_5u2O.js.map +1 -0
- package/dist/markdown-C6dRE9zD.js +168 -0
- package/dist/markdown-C6dRE9zD.js.map +1 -0
- package/dist/markdown-path-lJB9BAVZ.js +6 -0
- package/dist/markdown-path-lJB9BAVZ.js.map +1 -0
- package/dist/{message-DT_CjUdt.js → message-CuBjgZ74.js} +2 -2
- package/dist/{message-DT_CjUdt.js.map → message-CuBjgZ74.js.map} +1 -1
- package/dist/mistral-conversations-CvaqBWjR.js +690 -0
- package/dist/mistral-conversations-CvaqBWjR.js.map +1 -0
- package/dist/models-DcT5qOEL.js +1203 -0
- package/dist/models-DcT5qOEL.js.map +1 -0
- package/dist/node-Ccvru9GE.js +26 -0
- package/dist/node-Ccvru9GE.js.map +1 -0
- package/dist/node-MEosBOF2.js +2403 -0
- package/dist/node-MEosBOF2.js.map +1 -0
- package/dist/openai-BCBEd2eO.js +17350 -0
- package/dist/openai-BCBEd2eO.js.map +1 -0
- package/dist/openai-codex-responses-vJqxeeRC.js +1268 -0
- package/dist/openai-codex-responses-vJqxeeRC.js.map +1 -0
- package/dist/openai-completions-Cb_fRAbI.js +989 -0
- package/dist/openai-completions-Cb_fRAbI.js.map +1 -0
- package/dist/openai-prompt-cache-Bc6qNWt0.js +10 -0
- package/dist/openai-prompt-cache-Bc6qNWt0.js.map +1 -0
- package/dist/openai-responses-sDuh82G5.js +268 -0
- package/dist/openai-responses-sDuh82G5.js.map +1 -0
- package/dist/openai-responses-shared-mhuo1Jov.js +599 -0
- package/dist/openai-responses-shared-mhuo1Jov.js.map +1 -0
- package/dist/openrouter-images-CRmBkzpX.js +127 -0
- package/dist/openrouter-images-CRmBkzpX.js.map +1 -0
- package/dist/oxlint.d.ts +58 -0
- package/dist/oxlint.js +202 -0
- package/dist/oxlint.js.map +1 -0
- package/dist/page-heads-BfjWQvau.d.ts +108 -0
- package/dist/{page-heads-6y-CARRQ.js → page-heads-BgbaIjj9.js} +3 -3
- package/dist/page-heads-BgbaIjj9.js.map +1 -0
- package/dist/pi-Bvw6J0gh.js +56795 -0
- package/dist/pi-Bvw6J0gh.js.map +1 -0
- package/dist/pi-messages-CejiVYvO.js +308 -0
- package/dist/pi-messages-CejiVYvO.js.map +1 -0
- package/dist/{projections-DeEFe7XT.d.ts → projections-Bk-qOOsR.d.ts} +2 -2
- package/dist/provider-env-t38GK5FF.js +39 -0
- package/dist/provider-env-t38GK5FF.js.map +1 -0
- package/dist/provider-retry-DzKoh1X7.js +80 -0
- package/dist/provider-retry-DzKoh1X7.js.map +1 -0
- package/dist/react.d.ts +3 -2
- package/dist/react.js +2 -1
- package/dist/react.js.map +1 -1
- package/dist/rolldown-runtime-B-lAHAz2.js +37 -0
- package/dist/sanitize-unicode-Ds14l9Om.js +28 -0
- package/dist/sanitize-unicode-Ds14l9Om.js.map +1 -0
- package/dist/sdk-C9_wiO6w.js +12503 -0
- package/dist/sdk-C9_wiO6w.js.map +1 -0
- package/dist/state-BuJP_3Lr.js +28102 -0
- package/dist/state-BuJP_3Lr.js.map +1 -0
- package/dist/system-one-shared-Dl10ZF7Z.js +167 -0
- package/dist/system-one-shared-Dl10ZF7Z.js.map +1 -0
- package/dist/tanstack-start/index.d.ts +29 -13
- package/dist/tanstack-start/index.js +391 -42
- package/dist/tanstack-start/index.js.map +1 -1
- package/dist/tanstack-start/markdown.d.ts +12 -0
- package/dist/tanstack-start/markdown.js +149 -0
- package/dist/tanstack-start/markdown.js.map +1 -0
- package/dist/tanstack-start/prerender-worker.d.ts +2 -0
- package/dist/tanstack-start/prerender-worker.js +7 -0
- package/dist/tanstack-start/prerender-worker.js.map +1 -0
- package/dist/tanstack-start/react.d.ts +7 -0
- package/dist/tanstack-start/react.js +12 -0
- package/dist/tanstack-start/react.js.map +1 -0
- package/dist/tanstack-start/server.d.ts +9 -3
- package/dist/tanstack-start/server.js +26 -2
- package/dist/tanstack-start/server.js.map +1 -1
- package/dist/transform-messages-BLJ8EfK6.js +468 -0
- package/dist/transform-messages-BLJ8EfK6.js.map +1 -0
- package/dist/typesafe-system-one-CwEWMV8P.js +25 -0
- package/dist/typesafe-system-one-CwEWMV8P.js.map +1 -0
- package/dist/{vite-graph-loader-01p1WxEq.js → vite-graph-loader-CsGiYNWE.js} +6 -5
- package/dist/vite-graph-loader-CsGiYNWE.js.map +1 -0
- package/dist/vite-graph-loader-DZCwejuJ.d.ts +133 -0
- package/package.json +47 -10
- package/dist/checks-uZk5Em9A.js.map +0 -1
- package/dist/graph-Bcsourlv.js.map +0 -1
- package/dist/graph-BxCY90vq.d.ts +0 -104
- package/dist/graph-CBIY71w6.d.ts +0 -57
- package/dist/page-heads-6y-CARRQ.js.map +0 -1
- package/dist/page-heads-DNkjMUEN.d.ts +0 -21
- package/dist/vite-graph-loader-01p1WxEq.js.map +0 -1
- package/dist/vite-graph-loader-Btgjz5RH.d.ts +0 -56
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-DMNOLXLu.js","names":[],"sources":["../src/core/graph.ts"],"sourcesContent":["/**\n * SEO graph — the derived model that projections (sitemap, robots), the CLI, and\n * the check engine all read from. Built from route declarations (`staticData.seo`)\n * plus consumer-supplied content collections. This module is pure: no React, no\n * env, no knowledge of where instances come from. Origins and env-derived values\n * are injected by the callers of the projections, never read here.\n *\n * A node is one of:\n * - a structural route (`source: \"route\"`), keyed by its normalized full path,\n * merging a layout route's declaration (crumb) with its index child's (kind,\n * sitemap policy) when both resolve to the same URL;\n * - a content instance (`source` = the collection's label), keyed by the page URL\n * and carrying page-level metadata.\n *\n * Edges: `crumb-parent` (breadcrumb ancestry), `related` (deliberate cross-links),\n * `collection-member` (membership in a curated set), and `redirect` (route aliases).\n * The route walk emits crumb/related/redirect edges from declarations; a collection\n * may declare any additional edges its instances need.\n */\n\nimport type { AnyRoute } from \"@tanstack/react-router\";\n\nimport { applyTitleTemplate, type PublicPath, type RouteSeo, type SeoKind } from \"./declare\";\n\n/**\n * Where a node came from: `\"route\"` for a structural route declaration, or the\n * `source` label of the collection that produced the instance (e.g. \"blog\").\n */\nexport type SeoSource = string;\n\nexport interface SeoNode {\n /** Canonical path, no origin (e.g. \"/pricing\", \"/blog/my-post\"). */\n path: string;\n kind: SeoKind;\n source: SeoSource;\n /** Route-declared authored-document mode, inherited by collection instances. */\n markdown?: \"rendered\" | \"source\" | undefined;\n /** Group label for llms.txt, inherited by collection instances. */\n llms?: string | undefined;\n /** Route-declared policy, or synthesized (kind + inherited sitemap) for instances. */\n policy: RouteSeo;\n /**\n * The head the page ships: a static route's declared `head`, or an instance's\n * title (through its route's `titleTemplate`) and description. Absent when the\n * route computes its head at request time and no collection supplies it.\n */\n head?: SeoNodeHead | undefined;\n instance?:\n | {\n title: string;\n description?: string | undefined;\n publishedAt?: string | undefined;\n modifiedAt?: string | undefined;\n }\n | undefined;\n}\n\n/**\n * A node's head as graph data: the full title, description, and FAQ text. An\n * instance without a description still carries its title.\n */\nexport interface SeoNodeHead {\n readonly title: string;\n readonly description?: string | undefined;\n readonly faqs?: ReadonlyArray<{ readonly question: string; readonly answer: string }> | undefined;\n}\n\nexport type SeoEdgeType = \"crumb-parent\" | \"related\" | \"redirect\" | \"collection-member\";\n\nexport interface SeoEdge {\n from: string;\n to: string;\n type: SeoEdgeType;\n}\n\nexport interface SeoGraph {\n nodes: Map<string, SeoNode>;\n edges: Array<SeoEdge>;\n /** Exact-path ownership conflicts encountered while assembling graph sources. */\n collisions?: ReadonlyArray<{ path: string; sources: ReadonlyArray<SeoSource> }> | undefined;\n}\n\n/** One concrete page produced by a collection. */\nexport interface SeoInstance {\n /** Canonical path of the page (e.g. \"/blog/my-post\"). */\n readonly path: string;\n readonly title: string;\n readonly description?: string | undefined;\n readonly publishedAt?: string | undefined;\n readonly modifiedAt?: string | undefined;\n}\n\nexport interface SeoCollection {\n /**\n * The param route these instances render through (e.g. \"/blog/$slug\"). Instances\n * inherit this route's declared policy (kind + sitemap) — the graph reads it from\n * the structural node, so declarations stay the single source of truth.\n */\n readonly route: PublicPath;\n /** The `source` stamped on every node this collection produces (e.g. \"blog\"). */\n readonly source: SeoSource;\n readonly instances: ReadonlyArray<SeoInstance>;\n /** Edges the collection declares between its instances and the rest of the graph. */\n readonly edges?: ReadonlyArray<SeoEdge> | undefined;\n}\n\n/**\n * The structural route shape the graph walks: a TanStack route tree has it\n * before `init()`, and an adapter can build it from parsed route files.\n */\nexport interface SeoRouteNode {\n readonly options: {\n readonly path?: string | undefined;\n readonly staticData?:\n | {\n readonly seo?: RouteSeo | undefined;\n readonly markdown?: SeoNode[\"markdown\"];\n readonly llms?: SeoNode[\"llms\"];\n }\n | undefined;\n };\n readonly children?: ReadonlyArray<SeoRouteNode> | undefined;\n}\n\nexport interface BuildSeoGraphInput {\n readonly routeTree: AnyRoute | SeoRouteNode;\n readonly collections?: ReadonlyArray<SeoCollection> | undefined;\n}\n\n/** Kind for instances whose collection route carries no declaration to inherit. */\nconst FALLBACK_KIND: SeoKind = \"page\";\n\n\n/**\n * Join a child's local path onto its parent's computed full path with the same\n * semantics as TanStack's route init (relative segments, index \"/\" inherits the\n * parent, pathless/group routes are transparent), then normalize trailing slashes.\n */\nfunction joinPath(parent: string, seg: string | undefined): string {\n if (seg === undefined) return parent; // pathless layout / route group\n if (seg === \"/\") return parent; // index route resolves to its parent's URL\n const trimmed = seg.replace(/^\\/+/, \"\").replace(/\\/+$/, \"\");\n const joined = `${parent === \"/\" ? \"\" : parent}/${trimmed}`;\n return joined.replace(/\\/{2,}/g, \"/\");\n}\n\n/** A route's declared head as graph data: templated title, description, and plain FAQs. */\nfunction declaredHead(seo: RouteSeo): SeoNodeHead | undefined {\n if (seo.head === undefined) return undefined;\n return {\n title: applyTitleTemplate(seo.titleTemplate, seo.head.title),\n description: seo.head.description,\n faqs: seo.head.faqs?.map(({ question, answer }) => ({ question, answer })),\n };\n}\n\n/** Merge a route's declaration into an existing same-path node (deeper route wins). */\nfunction mergeSeo(base: RouteSeo, override: RouteSeo): RouteSeo {\n return {\n kind: override.kind,\n crumb: override.crumb ?? base.crumb,\n sitemap: override.sitemap ?? base.sitemap,\n robots: override.robots ?? base.robots,\n related: override.related ?? base.related,\n link: override.link ?? base.link,\n redirectTo: override.redirectTo ?? base.redirectTo,\n modifiedAt: override.modifiedAt ?? base.modifiedAt,\n head: override.head ?? base.head,\n titleTemplate: override.titleTemplate ?? base.titleTemplate,\n };\n}\n\n/**\n * Walk the route tree building structural nodes and crumb-parent edges. `crumbStack`\n * holds the paths of crumb-declaring ancestors so each crumb node links to its nearest\n * crumb ancestor down the real route-parent chain (matching render-time breadcrumbs).\n */\nfunction walkRoutes(\n route: SeoRouteNode,\n parentPath: string,\n isRoot: boolean,\n nodes: Map<string, SeoNode>,\n edges: Array<SeoEdge>,\n crumbStack: Array<string>,\n): void {\n const path = isRoot ? \"/\" : joinPath(parentPath, route.options.path);\n const data = route.options.staticData;\n const seo = data?.seo;\n\n if (seo || data?.markdown !== undefined || data?.llms !== undefined) {\n const existing = nodes.get(path);\n if (existing) {\n if (seo) existing.policy = mergeSeo(existing.policy, seo);\n existing.kind = existing.policy.kind;\n // A head renders with its own route's template, never one merged from a layout.\n existing.head = (seo && declaredHead(seo)) ?? existing.head;\n existing.markdown = data?.markdown ?? existing.markdown;\n existing.llms = data?.llms ?? existing.llms;\n } else {\n const policy = seo ?? { kind: FALLBACK_KIND };\n nodes.set(path, {\n path,\n kind: policy.kind,\n source: \"route\",\n policy: { ...policy },\n head: seo && declaredHead(seo),\n markdown: data?.markdown,\n llms: data?.llms,\n });\n }\n\n const nearestCrumbAncestor = crumbStack[crumbStack.length - 1];\n if (seo?.crumb !== undefined && nearestCrumbAncestor !== undefined) {\n edges.push({ from: path, to: nearestCrumbAncestor, type: \"crumb-parent\" });\n }\n }\n\n const pushedCrumb = seo?.crumb !== undefined;\n if (pushedCrumb) crumbStack.push(path);\n for (const child of route.children ?? []) {\n walkRoutes(child, path, false, nodes, edges, crumbStack);\n }\n if (pushedCrumb) crumbStack.pop();\n}\n\n/**\n * Add one collection's instance nodes, inheriting kind + sitemap policy from the\n * collection route's declaration, then append the edges it declares. A path already\n * owned by another node is a collision: the first owner keeps the path and the\n * conflict is reported (the `path-owner-collision` check turns it into a violation).\n */\nfunction addCollection(\n nodes: Map<string, SeoNode>,\n edges: Array<SeoEdge>,\n collisions: Array<{ path: string; sources: ReadonlyArray<SeoSource> }>,\n collection: SeoCollection,\n): void {\n const collectionNode = nodes.get(collection.route);\n const kind = collectionNode?.kind ?? FALLBACK_KIND;\n const sitemap = collectionNode?.policy.sitemap;\n const titleTemplate = collectionNode?.policy.titleTemplate;\n\n /**\n * Paths this collection lost to an earlier owner. Their instances never enter\n * the graph, so any edge declared out of them would dangle — and the dead-edge\n * check only validates an edge's `to`, so nothing downstream would catch it.\n */\n const rejected = new Set<string>();\n\n for (const instance of collection.instances) {\n const existing = nodes.get(instance.path);\n if (existing) {\n collisions.push({ path: instance.path, sources: [existing.source, collection.source] });\n rejected.add(instance.path);\n continue;\n }\n nodes.set(instance.path, {\n path: instance.path,\n kind,\n source: collection.source,\n markdown: collectionNode?.markdown,\n llms: collectionNode?.llms,\n policy: { kind, sitemap },\n head: { title: applyTitleTemplate(titleTemplate, instance.title), description: instance.description },\n instance: {\n title: instance.title,\n description: instance.description,\n publishedAt: instance.publishedAt,\n modifiedAt: instance.modifiedAt,\n },\n });\n }\n\n for (const edge of collection.edges ?? []) {\n if (rejected.has(edge.from)) continue;\n edges.push(edge);\n }\n}\n\n/**\n * Build the SEO graph from route declarations and content collections.\n *\n * Synchronous: the caller materializes its collections before calling, so there is\n * no async work here. Callers own the origin.\n */\nexport function buildSeoGraph(input: BuildSeoGraphInput): SeoGraph {\n const nodes = new Map<string, SeoNode>();\n const edges: Array<SeoEdge> = [];\n const collisions: Array<{ path: string; sources: ReadonlyArray<SeoSource> }> = [];\n\n walkRoutes(input.routeTree as unknown as SeoRouteNode, \"/\", true, nodes, edges, []);\n\n for (const collection of input.collections ?? []) {\n addCollection(nodes, edges, collisions, collection);\n }\n\n for (const node of nodes.values()) {\n if (node.source !== \"route\") continue;\n for (const to of node.policy.related ?? []) {\n edges.push({ from: node.path, to, type: \"related\" });\n }\n if (node.policy.redirectTo !== undefined) {\n edges.push({ from: node.path, to: node.policy.redirectTo, type: \"redirect\" });\n }\n }\n\n return { nodes, edges, collisions };\n}\n"],"mappings":";;;AAkIA,MAAM,gBAAyB;;;;;;AAQ/B,SAAS,SAAS,QAAgB,KAAiC;CACjE,IAAI,QAAQ,KAAA,GAAW,OAAO;CAC9B,IAAI,QAAQ,KAAK,OAAO;CACxB,MAAM,UAAU,IAAI,QAAQ,QAAQ,EAAE,CAAC,CAAC,QAAQ,QAAQ,EAAE;CAE1D,OAAO,GADW,WAAW,MAAM,KAAK,OAAO,GAAG,UACpC,QAAQ,WAAW,GAAG;AACtC;;AAGA,SAAS,aAAa,KAAwC;CAC5D,IAAI,IAAI,SAAS,KAAA,GAAW,OAAO,KAAA;CACnC,OAAO;EACL,OAAO,mBAAmB,IAAI,eAAe,IAAI,KAAK,KAAK;EAC3D,aAAa,IAAI,KAAK;EACtB,MAAM,IAAI,KAAK,MAAM,KAAK,EAAE,UAAU,cAAc;GAAE;GAAU;EAAO,EAAE;CAC3E;AACF;;AAGA,SAAS,SAAS,MAAgB,UAA8B;CAC9D,OAAO;EACL,MAAM,SAAS;EACf,OAAO,SAAS,SAAS,KAAK;EAC9B,SAAS,SAAS,WAAW,KAAK;EAClC,QAAQ,SAAS,UAAU,KAAK;EAChC,SAAS,SAAS,WAAW,KAAK;EAClC,MAAM,SAAS,QAAQ,KAAK;EAC5B,YAAY,SAAS,cAAc,KAAK;EACxC,YAAY,SAAS,cAAc,KAAK;EACxC,MAAM,SAAS,QAAQ,KAAK;EAC5B,eAAe,SAAS,iBAAiB,KAAK;CAChD;AACF;;;;;;AAOA,SAAS,WACP,OACA,YACA,QACA,OACA,OACA,YACM;CACN,MAAM,OAAO,SAAS,MAAM,SAAS,YAAY,MAAM,QAAQ,IAAI;CACnE,MAAM,OAAO,MAAM,QAAQ;CAC3B,MAAM,MAAM,MAAM;CAElB,IAAI,OAAO,MAAM,aA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
+
//#region node_modules/@earendil-works/pi-ai/dist/utils/hash.js
|
|
2
|
+
/** Fast deterministic hash to shorten long strings */
|
|
3
|
+
function shortHash(str) {
|
|
4
|
+
let h1 = 3735928559;
|
|
5
|
+
let h2 = 1103547991;
|
|
6
|
+
for (let i = 0; i < str.length; i++) {
|
|
7
|
+
const ch = str.charCodeAt(i);
|
|
8
|
+
h1 = Math.imul(h1 ^ ch, 2654435761);
|
|
9
|
+
h2 = Math.imul(h2 ^ ch, 1597334677);
|
|
10
|
+
}
|
|
11
|
+
h1 = Math.imul(h1 ^ h1 >>> 16, 2246822507) ^ Math.imul(h2 ^ h2 >>> 13, 3266489909);
|
|
12
|
+
h2 = Math.imul(h2 ^ h2 >>> 16, 2246822507) ^ Math.imul(h1 ^ h1 >>> 13, 3266489909);
|
|
13
|
+
return (h2 >>> 0).toString(36) + (h1 >>> 0).toString(36);
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { shortHash as t };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=hash-Dp7EzZUo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hash-Dp7EzZUo.js","names":[],"sources":["../node_modules/@earendil-works/pi-ai/dist/utils/hash.js"],"sourcesContent":["/** Fast deterministic hash to shorten long strings */\nexport function shortHash(str) {\n let h1 = 0xdeadbeef;\n let h2 = 0x41c6ce57;\n for (let i = 0; i < str.length; i++) {\n const ch = str.charCodeAt(i);\n h1 = Math.imul(h1 ^ ch, 2654435761);\n h2 = Math.imul(h2 ^ ch, 1597334677);\n }\n h1 = Math.imul(h1 ^ (h1 >>> 16), 2246822507) ^ Math.imul(h2 ^ (h2 >>> 13), 3266489909);\n h2 = Math.imul(h2 ^ (h2 >>> 16), 2246822507) ^ Math.imul(h1 ^ (h1 >>> 13), 3266489909);\n return (h2 >>> 0).toString(36) + (h1 >>> 0).toString(36);\n}\n//# sourceMappingURL=hash.js.map"],"x_google_ignoreList":[0],"mappings":";;AACA,SAAgB,UAAU,KAAK;CAC3B,IAAI,KAAK;CACT,IAAI,KAAK;CACT,KAAK,IAAI,IAAI,GAAG,IAAI,IAAI,QAAQ,KAAK;EACjC,MAAM,KAAK,IAAI,WAAW,CAAC;EAC3B,KAAK,KAAK,KAAK,KAAK,IAAI,UAAU;EAClC,KAAK,KAAK,KAAK,KAAK,IAAI,UAAU;CACtC;CACA,KAAK,KAAK,KAAK,KAAM,OAAO,IAAK,UAAU,IAAI,KAAK,KAAK,KAAM,OAAO,IAAK,UAAU;CACrF,KAAK,KAAK,KAAK,KAAM,OAAO,IAAK,UAAU,IAAI,KAAK,KAAK,KAAM,OAAO,IAAK,UAAU;CACrF,QAAQ,OAAO,EAAA,CAAG,SAAS,EAAE,KAAK,OAAO,EAAA,CAAG,SAAS,EAAE;AAC3D"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region node_modules/@earendil-works/pi-ai/dist/utils/headers.js
|
|
2
|
+
function headersToRecord(headers) {
|
|
3
|
+
const result = {};
|
|
4
|
+
for (const [key, value] of headers.entries()) result[key] = value;
|
|
5
|
+
return result;
|
|
6
|
+
}
|
|
7
|
+
function providerHeadersToRecord(...headerSources) {
|
|
8
|
+
const merged = /* @__PURE__ */ new Map();
|
|
9
|
+
for (const source of headerSources) for (const [name, value] of Object.entries(source ?? {})) {
|
|
10
|
+
const normalizedName = name.toLowerCase();
|
|
11
|
+
merged.delete(normalizedName);
|
|
12
|
+
if (value !== null) merged.set(normalizedName, [name, value]);
|
|
13
|
+
}
|
|
14
|
+
return merged.size > 0 ? Object.fromEntries(merged.values()) : void 0;
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { providerHeadersToRecord as n, headersToRecord as t };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=headers-BRNMVpzu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"headers-BRNMVpzu.js","names":[],"sources":["../node_modules/@earendil-works/pi-ai/dist/utils/headers.js"],"sourcesContent":["export function headersToRecord(headers) {\n const result = {};\n for (const [key, value] of headers.entries()) {\n result[key] = value;\n }\n return result;\n}\nexport function providerHeadersToRecord(...headerSources) {\n const merged = new Map();\n for (const source of headerSources) {\n for (const [name, value] of Object.entries(source ?? {})) {\n const normalizedName = name.toLowerCase();\n merged.delete(normalizedName);\n if (value !== null)\n merged.set(normalizedName, [name, value]);\n }\n }\n return merged.size > 0 ? Object.fromEntries(merged.values()) : undefined;\n}\n//# sourceMappingURL=headers.js.map"],"x_google_ignoreList":[0],"mappings":";AAAA,SAAgB,gBAAgB,SAAS;CACrC,MAAM,SAAS,CAAC;CAChB,KAAK,MAAM,CAAC,KAAK,UAAU,QAAQ,QAAQ,GACvC,OAAO,OAAO;CAElB,OAAO;AACX;AACA,SAAgB,wBAAwB,GAAG,eAAe;CACtD,MAAM,yBAAS,IAAI,IAAI;CACvB,KAAK,MAAM,UAAU,eACjB,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,UAAU,CAAC,CAAC,GAAG;EACtD,MAAM,iBAAiB,KAAK,YAAY;EACxC,OAAO,OAAO,cAAc;EAC5B,IAAI,UAAU,MACV,OAAO,IAAI,gBAAgB,CAAC,MAAM,KAAK,CAAC;CAChD;CAEJ,OAAO,OAAO,OAAO,IAAI,OAAO,YAAY,OAAO,OAAO,CAAC,IAAI,KAAA;AACnE"}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { a as SeoGraph, h as RouteSeo, n as SeoCollection, o as SeoInstance, p as PublicPath, r as SeoEdge, s as SeoNode, u as SeoSource } from "./graph-D1PIndsC.js";
|
|
2
|
+
import { N as SimpleEdge, w as AnchorRegion } from "./content-DgNr7apS.js";
|
|
3
|
+
import { f as Message, m as SectionDocument, p as PageDocument } from "./page-heads-BfjWQvau.js";
|
|
4
|
+
import "./projections-Bk-qOOsR.js";
|
|
5
|
+
import { AnyRouter } from "@tanstack/react-router";
|
|
6
|
+
//#region src/markdown/hash.d.ts
|
|
7
|
+
declare const contentHash: (value: unknown) => string;
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region src/markdown/markdown.d.ts
|
|
10
|
+
interface MarkdownWriter {
|
|
11
|
+
text(value: Message | string | undefined): string;
|
|
12
|
+
heading(level: number, value: Message | string | undefined): string;
|
|
13
|
+
table(rows: ReadonlyArray<ReadonlyArray<Message | string>>): string;
|
|
14
|
+
}
|
|
15
|
+
interface SectionKind {
|
|
16
|
+
readonly kind: string;
|
|
17
|
+
readonly markdown: (section: SectionDocument, md: MarkdownWriter) => string;
|
|
18
|
+
}
|
|
19
|
+
/** A kind can be passed directly to Section; importing its definition registers its serializer. */
|
|
20
|
+
declare function defineSectionKind<const K extends string>(definition: SectionKind & {
|
|
21
|
+
kind: K;
|
|
22
|
+
}): SectionKind & {
|
|
23
|
+
kind: K;
|
|
24
|
+
};
|
|
25
|
+
declare function sectionMarkdown(section: SectionDocument, options?: {
|
|
26
|
+
includeHumans?: boolean;
|
|
27
|
+
}): string;
|
|
28
|
+
/** One public twin, in authored section order. Human-only messages never enter it. */
|
|
29
|
+
declare function documentMarkdown(document: PageDocument, site: string): string;
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region src/markdown/llms.d.ts
|
|
32
|
+
interface LlmsPage {
|
|
33
|
+
document: Pick<PageDocument, "path" | "title" | "description">;
|
|
34
|
+
llms?: string;
|
|
35
|
+
}
|
|
36
|
+
declare function llmsSection(path: string): string;
|
|
37
|
+
declare function llmsMarkdown(pages: ReadonlyArray<LlmsPage>, site: string): string;
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region src/markdown/lock.d.ts
|
|
40
|
+
/** Stable, reviewable snapshot of document and message hashes with source locations. */
|
|
41
|
+
interface MarkdownLock {
|
|
42
|
+
readonly version: 1;
|
|
43
|
+
readonly pages: Readonly<Record<string, {
|
|
44
|
+
readonly document: string;
|
|
45
|
+
readonly messages: Readonly<Record<string, string>>;
|
|
46
|
+
}>>;
|
|
47
|
+
}
|
|
48
|
+
/** Build the v1 lock without changing document hashes, message hashes, or sources. */
|
|
49
|
+
declare function createMarkdownLock(documents: ReadonlyArray<PageDocument>): MarkdownLock;
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region src/core/collections.d.ts
|
|
52
|
+
/** What a page contributes: its instance metadata plus the paths it links to deliberately. */
|
|
53
|
+
interface ContentEntry extends Omit<SeoInstance, "path"> {
|
|
54
|
+
/** Defaults to the page's `url`. */
|
|
55
|
+
readonly path?: string | undefined;
|
|
56
|
+
/** Deliberate cross-links, emitted as `related` edges from this page. */
|
|
57
|
+
readonly related?: ReadonlyArray<string> | undefined;
|
|
58
|
+
}
|
|
59
|
+
interface ContentCollectionOptions<Page> {
|
|
60
|
+
/** The param route these pages render through, e.g. `/blog/$slug`. */
|
|
61
|
+
readonly route: PublicPath;
|
|
62
|
+
/** The `source` label stamped on every node, e.g. `"blog"`. */
|
|
63
|
+
readonly source: SeoSource;
|
|
64
|
+
readonly pages: ReadonlyArray<Page>;
|
|
65
|
+
/** Map one page to its entry; decode frontmatter here. */
|
|
66
|
+
readonly entry: (page: Page) => ContentEntry;
|
|
67
|
+
/** Edges beyond `related` (crumb parents, collection membership). */
|
|
68
|
+
readonly edges?: ReadonlyArray<SeoEdge> | undefined;
|
|
69
|
+
}
|
|
70
|
+
declare function contentCollection<Page extends {
|
|
71
|
+
readonly url: string;
|
|
72
|
+
}>(options: ContentCollectionOptions<Page>): SeoCollection;
|
|
73
|
+
//#endregion
|
|
74
|
+
//#region src/core/wire.d.ts
|
|
75
|
+
interface SeoGraphJson {
|
|
76
|
+
readonly nodes: ReadonlyArray<SeoNode>;
|
|
77
|
+
readonly edges: ReadonlyArray<SeoEdge>;
|
|
78
|
+
readonly collisions?: ReadonlyArray<{
|
|
79
|
+
readonly path: string;
|
|
80
|
+
readonly sources: ReadonlyArray<SeoSource>;
|
|
81
|
+
}> | undefined;
|
|
82
|
+
}
|
|
83
|
+
declare function graphToJson(graph: SeoGraph): SeoGraphJson;
|
|
84
|
+
declare function graphFromJson(json: SeoGraphJson): SeoGraph;
|
|
85
|
+
//#endregion
|
|
86
|
+
//#region src/core/link-candidates.d.ts
|
|
87
|
+
/** One proposed contextual link, in the direction the link would be authored. */
|
|
88
|
+
interface LinkCandidatePair {
|
|
89
|
+
readonly source: string;
|
|
90
|
+
readonly destination: string;
|
|
91
|
+
/** The cluster the pair shares: a top-level section, or `kind:<kind>`. */
|
|
92
|
+
readonly cluster: string;
|
|
93
|
+
/** Why the pair is plausible, e.g. `same top-level section "/blog"`. */
|
|
94
|
+
readonly reason: string;
|
|
95
|
+
}
|
|
96
|
+
interface LinkCandidateOptions {
|
|
97
|
+
/** Maximum candidates to return after ordering (default 50). */
|
|
98
|
+
readonly limit?: number;
|
|
99
|
+
/** Restrict to these clusters; a filter may be a section or a bare kind. */
|
|
100
|
+
readonly clusters?: ReadonlyArray<string>;
|
|
101
|
+
/** Anchors already served in HTML. Only body-region edges exclude their own direction. */
|
|
102
|
+
readonly renderedEdges?: ReadonlyArray<SimpleEdge & {
|
|
103
|
+
readonly region?: AnchorRegion;
|
|
104
|
+
}>;
|
|
105
|
+
}
|
|
106
|
+
/** One cluster and how many candidate pairs it contributes (before `limit`). */
|
|
107
|
+
interface LinkClusterSummary {
|
|
108
|
+
readonly key: string;
|
|
109
|
+
readonly candidates: number;
|
|
110
|
+
}
|
|
111
|
+
interface LinkCandidateResult {
|
|
112
|
+
readonly candidates: ReadonlyArray<LinkCandidatePair>;
|
|
113
|
+
/** Candidate pairs before `limit` was applied (after cluster filters). */
|
|
114
|
+
readonly total: number;
|
|
115
|
+
readonly truncated: boolean;
|
|
116
|
+
readonly clusters: ReadonlyArray<LinkClusterSummary>;
|
|
117
|
+
}
|
|
118
|
+
/** Directionless pair key, so an edge in either direction means "connected". */
|
|
119
|
+
declare const undirectedEdgeKey: (from: string, to: string) => string;
|
|
120
|
+
/** A `--cluster` filter matches a section by name, or a kind via its bare label. */
|
|
121
|
+
declare const matchesClusterFilter: (cluster: string, filter: string) => boolean;
|
|
122
|
+
/** Human reason string for a candidate's source page, used when handing a plan to Jev. */
|
|
123
|
+
declare const candidateSourceText: (node: SeoNode) => string;
|
|
124
|
+
/**
|
|
125
|
+
* Enumerate reviewable contextual-link candidates from the declared graph.
|
|
126
|
+
*
|
|
127
|
+
* Excluded: self-pairs, pages that are not sitemap-eligible, pairs already
|
|
128
|
+
* declared as a `related` edge, and — when {@link LinkCandidateOptions.renderedEdges}
|
|
129
|
+
* is supplied — pairs already rendered as an anchor. Queries, hashes, and
|
|
130
|
+
* trailing slashes are normalized so both sides compare by the graph's path key.
|
|
131
|
+
*/
|
|
132
|
+
declare const generateLinkCandidates: (graph: SeoGraph, options?: LinkCandidateOptions) => LinkCandidateResult;
|
|
133
|
+
/**
|
|
134
|
+
* Decode a rendered-edge dump supplied to the CLI: either a bare array of
|
|
135
|
+
* `{ from, to }` edges, or an object carrying `edges` (or `internalEdges`).
|
|
136
|
+
* Throws on any other shape — this is user input, not a provider payload.
|
|
137
|
+
*/
|
|
138
|
+
declare const decodeRenderedEdges: (input: unknown) => ReadonlyArray<SimpleEdge & {
|
|
139
|
+
readonly region?: AnchorRegion;
|
|
140
|
+
}>;
|
|
141
|
+
//#endregion
|
|
142
|
+
//#region src/core/inspect-html.d.ts
|
|
143
|
+
/**
|
|
144
|
+
* Read a rendered `<head>` and validate it: title, meta
|
|
145
|
+
* (description/robots/og/twitter), canonical link, and `application/ld+json`
|
|
146
|
+
* blocks, with a minimal per-type JSON-LD check.
|
|
147
|
+
*
|
|
148
|
+
* This is the pure half of `pagegraph inspect --live` — the half worth having on its
|
|
149
|
+
* own. The CLI fetches a URL and hands the body here; a test suite can render a
|
|
150
|
+
* page and hand *that* here, asserting the head it actually ships. Both get the
|
|
151
|
+
* same verdict, because it is the same function.
|
|
152
|
+
*
|
|
153
|
+
* No HTML-parsing dependency, by design: a `<head>` is small and well-formed, so
|
|
154
|
+
* string/regex scanning is enough, and the package's core stays zero-dependency
|
|
155
|
+
* (which is also why the object guard below is hand-rolled — `effect/Predicate`
|
|
156
|
+
* is not reachable from this entry). It is honest about its limits: it does not
|
|
157
|
+
* build a DOM, so exotic markup (commented-out tags, CDATA, attributes spanning
|
|
158
|
+
* constructs) is out of scope. This validates *rendered output*, not arbitrary
|
|
159
|
+
* HTML.
|
|
160
|
+
*
|
|
161
|
+
* `issues` are blocking: a non-empty list makes `pagegraph inspect --live` exit 1.
|
|
162
|
+
* Required tags are `<title>`, `meta[name=description]`, and
|
|
163
|
+
* `link[rel=canonical]`; any JSON-LD that fails to parse or fails its minimal
|
|
164
|
+
* schema is also blocking.
|
|
165
|
+
*/
|
|
166
|
+
interface JsonLdReport {
|
|
167
|
+
type: string;
|
|
168
|
+
valid: boolean;
|
|
169
|
+
errors: Array<string>;
|
|
170
|
+
}
|
|
171
|
+
interface LiveHeadReport {
|
|
172
|
+
url: string;
|
|
173
|
+
status: number;
|
|
174
|
+
title?: string | undefined;
|
|
175
|
+
description?: string | undefined;
|
|
176
|
+
canonical?: string | undefined;
|
|
177
|
+
robots?: string | undefined;
|
|
178
|
+
og: Record<string, string>;
|
|
179
|
+
twitter: Record<string, string>;
|
|
180
|
+
jsonLd: Array<JsonLdReport>;
|
|
181
|
+
issues: Array<string>;
|
|
182
|
+
}
|
|
183
|
+
/** Parse a rendered HTML document's `<head>` into a report. Pure. */
|
|
184
|
+
declare const inspectHtml: (url: string, status: number, html: string) => LiveHeadReport;
|
|
185
|
+
/** A non-empty `issues` list fails `pagegraph inspect --live` (exit 1). */
|
|
186
|
+
declare const hasBlockingIssues: (report: LiveHeadReport) => boolean;
|
|
187
|
+
//#endregion
|
|
188
|
+
//#region src/core/resolve-route-link.d.ts
|
|
189
|
+
/**
|
|
190
|
+
* Resolve a route's declared `seo.link` card (title + description) by its full
|
|
191
|
+
* path.
|
|
192
|
+
*
|
|
193
|
+
* `useRouter()` returns a Router typed to this app's exact route tree, so
|
|
194
|
+
* `routesByPath` is keyed by the literal `FileRouteTypes["fullPaths"]` union —
|
|
195
|
+
* but callers here (declared `related` targets) hold arbitrary runtime path
|
|
196
|
+
* strings, not that literal type. `routesByPath` and `routesById` are plain
|
|
197
|
+
* Records on every Router instance regardless of which route tree it's
|
|
198
|
+
* parameterized over, so this narrows to that structural shape once, at this
|
|
199
|
+
* boundary, instead of threading an `AnyRoute` cast through every call site.
|
|
200
|
+
*/
|
|
201
|
+
declare function resolveRouteLink(router: AnyRouter, path: string): RouteSeo["link"];
|
|
202
|
+
//#endregion
|
|
203
|
+
export { sectionMarkdown as A, LlmsPage as C, SectionKind as D, MarkdownWriter as E, defineSectionKind as O, createMarkdownLock as S, llmsSection as T, graphToJson as _, inspectHtml as a, contentCollection as b, LinkCandidateResult as c, decodeRenderedEdges as d, generateLinkCandidates as f, graphFromJson as g, SeoGraphJson as h, hasBlockingIssues as i, contentHash as j, documentMarkdown as k, LinkClusterSummary as l, undirectedEdgeKey as m, JsonLdReport as n, LinkCandidateOptions as o, matchesClusterFilter as p, LiveHeadReport as r, LinkCandidatePair as s, resolveRouteLink as t, candidateSourceText as u, ContentCollectionOptions as v, llmsMarkdown as w, MarkdownLock as x, ContentEntry as y };
|
|
204
|
+
//# sourceMappingURL=index-C5w9ripz.d.ts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,160 +1,6 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { a as
|
|
3
|
-
import {
|
|
4
|
-
import { a as
|
|
5
|
-
import { i as
|
|
6
|
-
|
|
7
|
-
//#region src/core/collections.d.ts
|
|
8
|
-
/** What a page contributes: its instance metadata plus the paths it links to deliberately. */
|
|
9
|
-
interface ContentEntry extends Omit<SeoInstance, "path"> {
|
|
10
|
-
/** Defaults to the page's `url`. */
|
|
11
|
-
readonly path?: string | undefined;
|
|
12
|
-
/** Deliberate cross-links, emitted as `related` edges from this page. */
|
|
13
|
-
readonly related?: ReadonlyArray<string> | undefined;
|
|
14
|
-
}
|
|
15
|
-
interface ContentCollectionOptions<Page> {
|
|
16
|
-
/** The param route these pages render through, e.g. `/blog/$slug`. */
|
|
17
|
-
readonly route: PublicPath;
|
|
18
|
-
/** The `source` label stamped on every node, e.g. `"blog"`. */
|
|
19
|
-
readonly source: SeoSource;
|
|
20
|
-
readonly pages: ReadonlyArray<Page>;
|
|
21
|
-
/** Map one page to its entry; decode frontmatter here. */
|
|
22
|
-
readonly entry: (page: Page) => ContentEntry;
|
|
23
|
-
/** Edges beyond `related` (crumb parents, collection membership). */
|
|
24
|
-
readonly edges?: ReadonlyArray<SeoEdge> | undefined;
|
|
25
|
-
}
|
|
26
|
-
declare function contentCollection<Page extends {
|
|
27
|
-
readonly url: string;
|
|
28
|
-
}>(options: ContentCollectionOptions<Page>): SeoCollection;
|
|
29
|
-
//#endregion
|
|
30
|
-
//#region src/core/wire.d.ts
|
|
31
|
-
interface SeoGraphJson {
|
|
32
|
-
readonly nodes: ReadonlyArray<SeoNode>;
|
|
33
|
-
readonly edges: ReadonlyArray<SeoEdge>;
|
|
34
|
-
readonly collisions?: ReadonlyArray<{
|
|
35
|
-
readonly path: string;
|
|
36
|
-
readonly sources: ReadonlyArray<SeoSource>;
|
|
37
|
-
}> | undefined;
|
|
38
|
-
}
|
|
39
|
-
declare function graphToJson(graph: SeoGraph): SeoGraphJson;
|
|
40
|
-
declare function graphFromJson(json: SeoGraphJson): SeoGraph;
|
|
41
|
-
//#endregion
|
|
42
|
-
//#region src/core/link-candidates.d.ts
|
|
43
|
-
/** One proposed contextual link, in the direction the link would be authored. */
|
|
44
|
-
interface LinkCandidatePair {
|
|
45
|
-
readonly source: string;
|
|
46
|
-
readonly destination: string;
|
|
47
|
-
/** The cluster the pair shares: a top-level section, or `kind:<kind>`. */
|
|
48
|
-
readonly cluster: string;
|
|
49
|
-
/** Why the pair is plausible, e.g. `same top-level section "/blog"`. */
|
|
50
|
-
readonly reason: string;
|
|
51
|
-
}
|
|
52
|
-
interface LinkCandidateOptions {
|
|
53
|
-
/** Maximum candidates to return after ordering (default 50). */
|
|
54
|
-
readonly limit?: number;
|
|
55
|
-
/** Restrict to these clusters; a filter may be a section or a bare kind. */
|
|
56
|
-
readonly clusters?: ReadonlyArray<string>;
|
|
57
|
-
/** Anchors already served in HTML. Only body-region edges exclude their own direction. */
|
|
58
|
-
readonly renderedEdges?: ReadonlyArray<SimpleEdge & {
|
|
59
|
-
readonly region?: AnchorRegion;
|
|
60
|
-
}>;
|
|
61
|
-
}
|
|
62
|
-
/** One cluster and how many candidate pairs it contributes (before `limit`). */
|
|
63
|
-
interface LinkClusterSummary {
|
|
64
|
-
readonly key: string;
|
|
65
|
-
readonly candidates: number;
|
|
66
|
-
}
|
|
67
|
-
interface LinkCandidateResult {
|
|
68
|
-
readonly candidates: ReadonlyArray<LinkCandidatePair>;
|
|
69
|
-
/** Candidate pairs before `limit` was applied (after cluster filters). */
|
|
70
|
-
readonly total: number;
|
|
71
|
-
readonly truncated: boolean;
|
|
72
|
-
readonly clusters: ReadonlyArray<LinkClusterSummary>;
|
|
73
|
-
}
|
|
74
|
-
/** Directionless pair key, so an edge in either direction means "connected". */
|
|
75
|
-
declare const undirectedEdgeKey: (from: string, to: string) => string;
|
|
76
|
-
/** A `--cluster` filter matches a section by name, or a kind via its bare label. */
|
|
77
|
-
declare const matchesClusterFilter: (cluster: string, filter: string) => boolean;
|
|
78
|
-
/** Human reason string for a candidate's source page, used when handing a plan to Jev. */
|
|
79
|
-
declare const candidateSourceText: (node: SeoNode) => string;
|
|
80
|
-
/**
|
|
81
|
-
* Enumerate reviewable contextual-link candidates from the declared graph.
|
|
82
|
-
*
|
|
83
|
-
* Excluded: self-pairs, pages that are not sitemap-eligible, pairs already
|
|
84
|
-
* declared as a `related` edge, and — when {@link LinkCandidateOptions.renderedEdges}
|
|
85
|
-
* is supplied — pairs already rendered as an anchor. Queries, hashes, and
|
|
86
|
-
* trailing slashes are normalized so both sides compare by the graph's path key.
|
|
87
|
-
*/
|
|
88
|
-
declare const generateLinkCandidates: (graph: SeoGraph, options?: LinkCandidateOptions) => LinkCandidateResult;
|
|
89
|
-
/**
|
|
90
|
-
* Decode a rendered-edge dump supplied to the CLI: either a bare array of
|
|
91
|
-
* `{ from, to }` edges, or an object carrying `edges` (or `internalEdges`).
|
|
92
|
-
* Throws on any other shape — this is user input, not a provider payload.
|
|
93
|
-
*/
|
|
94
|
-
declare const decodeRenderedEdges: (input: unknown) => ReadonlyArray<SimpleEdge & {
|
|
95
|
-
readonly region?: AnchorRegion;
|
|
96
|
-
}>;
|
|
97
|
-
//#endregion
|
|
98
|
-
//#region src/core/inspect-html.d.ts
|
|
99
|
-
/**
|
|
100
|
-
* Read a rendered `<head>` and validate it: title, meta
|
|
101
|
-
* (description/robots/og/twitter), canonical link, and `application/ld+json`
|
|
102
|
-
* blocks, with a minimal per-type JSON-LD check.
|
|
103
|
-
*
|
|
104
|
-
* This is the pure half of `pagegraph inspect --live` — the half worth having on its
|
|
105
|
-
* own. The CLI fetches a URL and hands the body here; a test suite can render a
|
|
106
|
-
* page and hand *that* here, asserting the head it actually ships. Both get the
|
|
107
|
-
* same verdict, because it is the same function.
|
|
108
|
-
*
|
|
109
|
-
* No HTML-parsing dependency, by design: a `<head>` is small and well-formed, so
|
|
110
|
-
* string/regex scanning is enough, and the package's core stays zero-dependency
|
|
111
|
-
* (which is also why the object guard below is hand-rolled — `effect/Predicate`
|
|
112
|
-
* is not reachable from this entry). It is honest about its limits: it does not
|
|
113
|
-
* build a DOM, so exotic markup (commented-out tags, CDATA, attributes spanning
|
|
114
|
-
* constructs) is out of scope. This validates *rendered output*, not arbitrary
|
|
115
|
-
* HTML.
|
|
116
|
-
*
|
|
117
|
-
* `issues` are blocking: a non-empty list makes `pagegraph inspect --live` exit 1.
|
|
118
|
-
* Required tags are `<title>`, `meta[name=description]`, and
|
|
119
|
-
* `link[rel=canonical]`; any JSON-LD that fails to parse or fails its minimal
|
|
120
|
-
* schema is also blocking.
|
|
121
|
-
*/
|
|
122
|
-
interface JsonLdReport {
|
|
123
|
-
type: string;
|
|
124
|
-
valid: boolean;
|
|
125
|
-
errors: Array<string>;
|
|
126
|
-
}
|
|
127
|
-
interface LiveHeadReport {
|
|
128
|
-
url: string;
|
|
129
|
-
status: number;
|
|
130
|
-
title?: string | undefined;
|
|
131
|
-
description?: string | undefined;
|
|
132
|
-
canonical?: string | undefined;
|
|
133
|
-
robots?: string | undefined;
|
|
134
|
-
og: Record<string, string>;
|
|
135
|
-
twitter: Record<string, string>;
|
|
136
|
-
jsonLd: Array<JsonLdReport>;
|
|
137
|
-
issues: Array<string>;
|
|
138
|
-
}
|
|
139
|
-
/** Parse a rendered HTML document's `<head>` into a report. Pure. */
|
|
140
|
-
declare const inspectHtml: (url: string, status: number, html: string) => LiveHeadReport;
|
|
141
|
-
/** A non-empty `issues` list fails `pagegraph inspect --live` (exit 1). */
|
|
142
|
-
declare const hasBlockingIssues: (report: LiveHeadReport) => boolean;
|
|
143
|
-
//#endregion
|
|
144
|
-
//#region src/core/resolve-route-link.d.ts
|
|
145
|
-
/**
|
|
146
|
-
* Resolve a route's declared `seo.link` card (title + description) by its full
|
|
147
|
-
* path.
|
|
148
|
-
*
|
|
149
|
-
* `useRouter()` returns a Router typed to this app's exact route tree, so
|
|
150
|
-
* `routesByPath` is keyed by the literal `FileRouteTypes["fullPaths"]` union —
|
|
151
|
-
* but callers here (declared `related` targets) hold arbitrary runtime path
|
|
152
|
-
* strings, not that literal type. `routesByPath` and `routesById` are plain
|
|
153
|
-
* Records on every Router instance regardless of which route tree it's
|
|
154
|
-
* parameterized over, so this narrows to that structural shape once, at this
|
|
155
|
-
* boundary, instead of threading an `AnyRoute` cast through every call site.
|
|
156
|
-
*/
|
|
157
|
-
declare function resolveRouteLink(router: AnyRouter, path: string): RouteSeo["link"];
|
|
158
|
-
//#endregion
|
|
159
|
-
export { type Anchor, type AnchorRegion, type BuildSeoGraphInput, type CheckGraphOptions, type ContentCheckOptions, type ContentCollectionOptions, type ContentEntry, type ContentFinding, type ContentPolicy, type ContentRuleName, type CoverageRule, type FreshnessEntry, type FreshnessPolicy, type FreshnessReport, type Heading, type JsonLdDocument, type JsonLdNode, type JsonLdReport, type LinkCandidateOptions, type LinkCandidatePair, type LinkCandidateResult, type LinkClusterSummary, type LinkEdge, type LinkGraphDiff, type LiveHeadReport, type NodeReport, type PageContent, type PageHead, type PageHeadsOptions, type ProjectionConfig, type PublicPath, RENDERED_EDGE_ARTIFACT_SCHEMA_VERSION, type Register, type RenderedDocument, type RenderedEdgeArtifact, type RenderedEdgeArtifactCrawl, type RenderedEdgeFailure, type RenderedGraph, type RenderedPage, type RobotsConfig, type RouteSeo, type SeoCollection, type SeoEdge, type SeoEdgeType, type SeoFaq, type SeoGraph, type SeoGraphJson, type SeoInstance, type SeoKind, type SeoNode, type SeoNodeHead, type SeoPageHead, type SeoRouteNode, type SeoSource, type Severity, type SimpleEdge, type SitemapPolicy, type Violation, type WordCountRule, applyTitleTemplate, buildRenderedGraph, buildSeoGraph, candidateSourceText, checkCoverage, checkFreshness, checkGraph, checkPageContent, checkRenderedContent, checkRenderedCoverage, contentCollection, contentSignal, decodeRenderedEdgeArtifact, decodeRenderedEdges, diffLinkGraph, extractAnchors, extractPageContent, freshnessReport, generateLinkCandidates, graphFromJson, graphToJson, hasBlockingIssues, hasStructuralViolations, inspectHtml, inspectNode, isSitemapEligible, lastModified, matchesClusterFilter, normalizePath, pageHeads, renderRobots, renderSitemap, renderedCheckTargets, renderedGraphFromEdges, resolveRouteLink, selectPageHeadNodes, undirectedEdgeKey };
|
|
160
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1
|
+
import { _ as SeoKind, a as SeoGraph, b as applyTitleTemplate, c as SeoNodeHead, d as buildSeoGraph, f as JsonLdDocument, g as SeoFaq, h as RouteSeo, i as SeoEdgeType, l as SeoRouteNode, m as Register, n as SeoCollection, o as SeoInstance, p as PublicPath, r as SeoEdge, s as SeoNode, t as BuildSeoGraphInput, u as SeoSource, v as SeoPageHead, y as SitemapPolicy } from "./graph-D1PIndsC.js";
|
|
2
|
+
import { A as RenderedEdgeFailure, B as FreshnessEntry, C as Anchor, D as RENDERED_EDGE_ARTIFACT_SCHEMA_VERSION, E as LinkGraphDiff, F as decodeRenderedEdgeArtifact, H as FreshnessReport, I as diffLinkGraph, L as extractAnchors, M as RenderedPage, N as SimpleEdge, O as RenderedEdgeArtifact, P as buildRenderedGraph, R as normalizePath, S as hasStructuralViolations, T as LinkEdge, U as freshnessReport, V as FreshnessPolicy, _ as Violation, a as Heading, b as checkGraph, c as RenderedDocument, d as checkRenderedContent, f as extractPageContent, g as Severity, h as CoverageRule, i as ContentRuleName, j as RenderedGraph, k as RenderedEdgeArtifactCrawl, l as WordCountRule, m as CheckGraphOptions, n as ContentFinding, o as JsonLdNode, p as renderedCheckTargets, r as ContentPolicy, s as PageContent, t as ContentCheckOptions, u as checkPageContent, v as checkCoverage, w as AnchorRegion, x as checkRenderedCoverage, y as checkFreshness, z as renderedGraphFromEdges } from "./content-DgNr7apS.js";
|
|
3
|
+
import { _ as hashDocument, a as FactDefinition, c as fact, d as InlineNode, f as Message, g as VisualDocument, h as SectionItem, i as selectPageHeadNodes, l as resolveFact, m as SectionDocument, n as PageHeadsOptions, o as Facts, p as PageDocument, r as pageHeads, s as defineFacts, t as PageHead, u as BodyEntry } from "./page-heads-BfjWQvau.js";
|
|
4
|
+
import { A as sectionMarkdown, C as LlmsPage, D as SectionKind, E as MarkdownWriter, O as defineSectionKind, S as createMarkdownLock, T as llmsSection, _ as graphToJson, a as inspectHtml, b as contentCollection, c as LinkCandidateResult, d as decodeRenderedEdges, f as generateLinkCandidates, g as graphFromJson, h as SeoGraphJson, i as hasBlockingIssues, j as contentHash, k as documentMarkdown, l as LinkClusterSummary, m as undirectedEdgeKey, n as JsonLdReport, o as LinkCandidateOptions, p as matchesClusterFilter, r as LiveHeadReport, s as LinkCandidatePair, t as resolveRouteLink, u as candidateSourceText, v as ContentCollectionOptions, w as llmsMarkdown, x as MarkdownLock, y as ContentEntry } from "./index-C5w9ripz.js";
|
|
5
|
+
import { a as inspectNode, c as renderRobots, i as contentSignal, l as renderSitemap, n as ProjectionConfig, o as isSitemapEligible, r as RobotsConfig, s as lastModified, t as NodeReport } from "./projections-Bk-qOOsR.js";
|
|
6
|
+
export { type Anchor, type AnchorRegion, type BodyEntry, type BuildSeoGraphInput, type CheckGraphOptions, type ContentCheckOptions, type ContentCollectionOptions, type ContentEntry, type ContentFinding, type ContentPolicy, type ContentRuleName, type CoverageRule, type FactDefinition, type Facts, type FreshnessEntry, type FreshnessPolicy, type FreshnessReport, type Heading, type InlineNode, type JsonLdDocument, type JsonLdNode, type JsonLdReport, type LinkCandidateOptions, type LinkCandidatePair, type LinkCandidateResult, type LinkClusterSummary, type LinkEdge, type LinkGraphDiff, type LiveHeadReport, type LlmsPage, type MarkdownLock, type MarkdownWriter, type Message, type NodeReport, type PageContent, type PageDocument, type PageHead, type PageHeadsOptions, type ProjectionConfig, type PublicPath, RENDERED_EDGE_ARTIFACT_SCHEMA_VERSION, type Register, type RenderedDocument, type RenderedEdgeArtifact, type RenderedEdgeArtifactCrawl, type RenderedEdgeFailure, type RenderedGraph, type RenderedPage, type RobotsConfig, type RouteSeo, type SectionDocument, type SectionItem, type SectionKind, type SeoCollection, type SeoEdge, type SeoEdgeType, type SeoFaq, type SeoGraph, type SeoGraphJson, type SeoInstance, type SeoKind, type SeoNode, type SeoNodeHead, type SeoPageHead, type SeoRouteNode, type SeoSource, type Severity, type SimpleEdge, type SitemapPolicy, type Violation, type VisualDocument, type WordCountRule, applyTitleTemplate, buildRenderedGraph, buildSeoGraph, candidateSourceText, checkCoverage, checkFreshness, checkGraph, checkPageContent, checkRenderedContent, checkRenderedCoverage, contentCollection, contentHash, contentSignal, createMarkdownLock, decodeRenderedEdgeArtifact, decodeRenderedEdges, defineFacts, defineSectionKind, diffLinkGraph, documentMarkdown, extractAnchors, extractPageContent, fact, freshnessReport, generateLinkCandidates, graphFromJson, graphToJson, hasBlockingIssues, hasStructuralViolations, hashDocument, inspectHtml, inspectNode, isSitemapEligible, lastModified, llmsMarkdown, llmsSection, matchesClusterFilter, normalizePath, pageHeads, renderRobots, renderSitemap, renderedCheckTargets, renderedGraphFromEdges, resolveFact, resolveRouteLink, sectionMarkdown, selectPageHeadNodes, undirectedEdgeKey };
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { t as applyTitleTemplate } from "./declare-D5o7hwmv.js";
|
|
2
|
-
import { t as buildSeoGraph } from "./graph-
|
|
2
|
+
import { t as buildSeoGraph } from "./graph-DMNOLXLu.js";
|
|
3
3
|
import { n as graphToJson, t as graphFromJson } from "./wire-B4RQMc4e.js";
|
|
4
4
|
import { i as lastModified, n as inspectNode, o as renderRobots, r as isSitemapEligible, s as renderSitemap, t as contentSignal } from "./projections-D0oOFKiY.js";
|
|
5
|
-
import { i as checkRenderedCoverage, n as checkFreshness, o as hasStructuralViolations, r as checkGraph, s as freshnessReport, t as checkCoverage } from "./checks-
|
|
6
|
-
import { a as RENDERED_EDGE_ARTIFACT_SCHEMA_VERSION, c as diffLinkGraph, d as renderedGraphFromEdges, f as hasBlockingIssues, i as renderedCheckTargets, l as extractAnchors, n as checkRenderedContent, o as buildRenderedGraph, p as inspectHtml, r as extractPageContent, s as decodeRenderedEdgeArtifact, t as checkPageContent, u as normalizePath } from "./content-
|
|
7
|
-
import { n as selectPageHeadNodes, t as pageHeads } from "./page-heads-
|
|
5
|
+
import { i as checkRenderedCoverage, n as checkFreshness, o as hasStructuralViolations, r as checkGraph, s as freshnessReport, t as checkCoverage } from "./checks-BS-aDXB_.js";
|
|
6
|
+
import { a as RENDERED_EDGE_ARTIFACT_SCHEMA_VERSION, c as diffLinkGraph, d as renderedGraphFromEdges, f as hasBlockingIssues, i as renderedCheckTargets, l as extractAnchors, n as checkRenderedContent, o as buildRenderedGraph, p as inspectHtml, r as extractPageContent, s as decodeRenderedEdgeArtifact, t as checkPageContent, u as normalizePath } from "./content-CHd0X4s6.js";
|
|
7
|
+
import { n as selectPageHeadNodes, t as pageHeads } from "./page-heads-BgbaIjj9.js";
|
|
8
|
+
import { o as hashDocument, s as contentHash } from "./inline-BbS93GAT.js";
|
|
9
|
+
import { i as resolveFact, n as defineFacts, r as fact } from "./facts-1OKclPOk.js";
|
|
10
|
+
import { n as documentMarkdown, r as sectionMarkdown, t as defineSectionKind } from "./markdown-C6dRE9zD.js";
|
|
11
|
+
import { n as llmsSection, t as llmsMarkdown } from "./llms-Dhr_5u2O.js";
|
|
8
12
|
//#region src/core/collections.ts
|
|
9
13
|
function contentCollection(options) {
|
|
10
14
|
const entries = options.pages.map((page) => {
|
|
@@ -171,6 +175,34 @@ function resolveRouteLink(router, path) {
|
|
|
171
175
|
return Object.values(routesById).find((route) => route.fullPath === path)?.options.staticData?.seo?.link;
|
|
172
176
|
}
|
|
173
177
|
//#endregion
|
|
174
|
-
|
|
178
|
+
//#region src/markdown/lock.ts
|
|
179
|
+
const compare = (left, right) => left < right ? -1 : left > right ? 1 : 0;
|
|
180
|
+
/** Build the v1 lock without changing document hashes, message hashes, or sources. */
|
|
181
|
+
function createMarkdownLock(documents) {
|
|
182
|
+
const pages = Object.create(null);
|
|
183
|
+
for (const document of [...documents].sort((left, right) => compare(left.path, right.path))) {
|
|
184
|
+
if (Object.hasOwn(pages, document.path)) throw new Error(`Duplicate document page path "${document.path}"`);
|
|
185
|
+
if (!/^[0-9a-f]{64}$/.test(document.hash)) throw new Error(`Invalid document document hash "${document.hash}" on "${document.path}"`);
|
|
186
|
+
const messages = Object.create(null);
|
|
187
|
+
for (const message of [...document.messages].sort((left, right) => compare(left.hash, right.hash) || compare(left.source, right.source))) {
|
|
188
|
+
if (!/^[0-9a-f]{16}$/.test(message.hash)) throw new Error(`Invalid document message hash "${message.hash}" on "${document.path}"`);
|
|
189
|
+
if (!Object.hasOwn(messages, message.hash)) messages[message.hash] = message.source;
|
|
190
|
+
}
|
|
191
|
+
pages[document.path] = {
|
|
192
|
+
document: document.hash,
|
|
193
|
+
messages
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
for (const [path, page] of Object.entries(pages)) {
|
|
197
|
+
if (typeof page.document !== "string") throw new Error(`Expected string\n at ["pages"][${JSON.stringify(path)}]["document"]`);
|
|
198
|
+
for (const [hash, source] of Object.entries(page.messages)) if (typeof source !== "string") throw new Error(`Expected string\n at ["pages"][${JSON.stringify(path)}]["messages"][${JSON.stringify(hash)}]`);
|
|
199
|
+
}
|
|
200
|
+
return {
|
|
201
|
+
version: 1,
|
|
202
|
+
pages
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
//#endregion
|
|
206
|
+
export { RENDERED_EDGE_ARTIFACT_SCHEMA_VERSION, applyTitleTemplate, buildRenderedGraph, buildSeoGraph, candidateSourceText, checkCoverage, checkFreshness, checkGraph, checkPageContent, checkRenderedContent, checkRenderedCoverage, contentCollection, contentHash, contentSignal, createMarkdownLock, decodeRenderedEdgeArtifact, decodeRenderedEdges, defineFacts, defineSectionKind, diffLinkGraph, documentMarkdown, extractAnchors, extractPageContent, fact, freshnessReport, generateLinkCandidates, graphFromJson, graphToJson, hasBlockingIssues, hasStructuralViolations, hashDocument, inspectHtml, inspectNode, isSitemapEligible, lastModified, llmsMarkdown, llmsSection, matchesClusterFilter, normalizePath, pageHeads, renderRobots, renderSitemap, renderedCheckTargets, renderedGraphFromEdges, resolveFact, resolveRouteLink, sectionMarkdown, selectPageHeadNodes, undirectedEdgeKey };
|
|
175
207
|
|
|
176
208
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/core/collections.ts","../src/core/link-candidates.ts","../src/core/resolve-route-link.ts"],"sourcesContent":["/**\n * Content collections — pages a param route renders from content (MDX, a CMS,\n * a manifest) — in the shape the graph reads. Works with any source whose\n * pages carry a URL, which covers Fumadocs `loader().getPages()` directly.\n */\n\nimport type { PublicPath } from \"./declare\";\nimport type { SeoCollection, SeoEdge, SeoInstance, SeoSource } from \"./graph\";\n\n/** What a page contributes: its instance metadata plus the paths it links to deliberately. */\nexport interface ContentEntry extends Omit<SeoInstance, \"path\"> {\n /** Defaults to the page's `url`. */\n readonly path?: string | undefined;\n /** Deliberate cross-links, emitted as `related` edges from this page. */\n readonly related?: ReadonlyArray<string> | undefined;\n}\n\nexport interface ContentCollectionOptions<Page> {\n /** The param route these pages render through, e.g. `/blog/$slug`. */\n readonly route: PublicPath;\n /** The `source` label stamped on every node, e.g. `\"blog\"`. */\n readonly source: SeoSource;\n readonly pages: ReadonlyArray<Page>;\n /** Map one page to its entry; decode frontmatter here. */\n readonly entry: (page: Page) => ContentEntry;\n /** Edges beyond `related` (crumb parents, collection membership). */\n readonly edges?: ReadonlyArray<SeoEdge> | undefined;\n}\n\nexport function contentCollection<Page extends { readonly url: string }>(\n options: ContentCollectionOptions<Page>,\n): SeoCollection {\n const entries = options.pages.map((page) => {\n const entry = options.entry(page);\n return { ...entry, path: entry.path ?? page.url };\n });\n return {\n route: options.route,\n source: options.source,\n instances: entries.map(({ related: _related, ...instance }) => instance),\n edges: [\n ...entries.flatMap((entry) =>\n [...new Set(entry.related ?? [])].map((to): SeoEdge => ({ from: entry.path, to, type: \"related\" })),\n ),\n ...(options.edges ?? []),\n ],\n };\n}\n","/**\n * Pure candidate generation for contextual cross-links.\n *\n * Given the declared graph, enumerate `(source, destination)` pairs that are\n * *plausible* contextual links and *not already connected*. A pair is plausible\n * when the two pages sit in the same cluster: a shared top-level section (e.g.\n * `/blog/a` and `/blog/b` under `/blog`) or, for root-level pages that share no\n * section, the same `kind`. Only sitemap-eligible pages are candidates — a\n * noindex, redirect, or param template is not a link surface.\n *\n * The plan is a proposal, never an application: nothing here writes a\n * declaration. Effect- and framework-free so it runs in the CLI, a Worker, or a\n * test on the same graph.\n */\n\nimport type { SeoGraph, SeoNode } from \"./graph\";\nimport type { AnchorRegion, SimpleEdge } from \"./links\";\nimport { isSitemapEligible } from \"./projections\";\n\n/** One proposed contextual link, in the direction the link would be authored. */\nexport interface LinkCandidatePair {\n readonly source: string;\n readonly destination: string;\n /** The cluster the pair shares: a top-level section, or `kind:<kind>`. */\n readonly cluster: string;\n /** Why the pair is plausible, e.g. `same top-level section \"/blog\"`. */\n readonly reason: string;\n}\n\nexport interface LinkCandidateOptions {\n /** Maximum candidates to return after ordering (default 50). */\n readonly limit?: number;\n /** Restrict to these clusters; a filter may be a section or a bare kind. */\n readonly clusters?: ReadonlyArray<string>;\n /** Anchors already served in HTML. Only body-region edges exclude their own direction. */\n readonly renderedEdges?: ReadonlyArray<SimpleEdge & { readonly region?: AnchorRegion }>;\n}\n\n/** One cluster and how many candidate pairs it contributes (before `limit`). */\nexport interface LinkClusterSummary {\n readonly key: string;\n readonly candidates: number;\n}\n\nexport interface LinkCandidateResult {\n readonly candidates: ReadonlyArray<LinkCandidatePair>;\n /** Candidate pairs before `limit` was applied (after cluster filters). */\n readonly total: number;\n readonly truncated: boolean;\n readonly clusters: ReadonlyArray<LinkClusterSummary>;\n}\n\n/**\n * Canonical path key: query and hash stripped, trailing slashes removed, \"/\"\n * preserved. This is the same path key the graph and the rendered-link core\n * use, so a served anchor like `/blog/a?ref=nav` still matches the graph pair\n * `/blog/a`.\n */\nconst normalize = (path: string): string => {\n const pathname = path.split(/[?#]/, 1)[0] ?? \"\";\n const trimmed = pathname.replace(/\\/+$/, \"\");\n return trimmed === \"\" ? \"/\" : trimmed;\n};\n\n/** Directionless pair key, so an edge in either direction means \"connected\". */\nexport const undirectedEdgeKey = (from: string, to: string): string => {\n const [a, b] = [normalize(from), normalize(to)].sort();\n return `${a}\\u0000${b}`;\n};\n\nconst directedEdgeKey = (from: string, to: string): string => `${normalize(from)}\\u0000${normalize(to)}`;\n\n/** First path segment, or undefined for the root page. */\nconst topSegment = (path: string): string | undefined => {\n const segment = path.split(\"/\").filter(Boolean)[0];\n return segment === undefined || segment === \"\" ? undefined : segment;\n};\n\n/** A page with no nested segment (`/`, `/pricing`, `/blog`) is root-level. */\nconst isRootLevel = (path: string): boolean => path.split(\"/\").filter(Boolean).length <= 1;\n\n/**\n * The cluster a pair shares, or undefined when they share none. Section-first:\n * a shared top-level section wins. The kind fallback is local to root-level\n * pages, so it never pairs two nested pages from different sections.\n */\nexport const candidateClusterOf = (a: SeoNode, b: SeoNode): { key: string; reason: string } | undefined => {\n const aSegment = topSegment(a.path);\n const bSegment = topSegment(b.path);\n if (aSegment !== undefined && aSegment === bSegment) {\n return { key: aSegment, reason: `same top-level section \"/${aSegment}\"` };\n }\n if (isRootLevel(a.path) && isRootLevel(b.path) && a.kind === b.kind) {\n return { key: `kind:${a.kind}`, reason: `same kind \"${a.kind}\"` };\n }\n return undefined;\n};\n\n/** A `--cluster` filter matches a section by name, or a kind via its bare label. */\nexport const matchesClusterFilter = (cluster: string, filter: string): boolean => {\n const normalized = filter.replace(/^\\/+/, \"\").toLowerCase();\n const key = cluster.toLowerCase();\n return key === normalized || key === `kind:${normalized}`;\n};\n\n/** Human reason string for a candidate's source page, used when handing a plan to Jev. */\nexport const candidateSourceText = (node: SeoNode): string =>\n node.instance?.description?.trim() ||\n node.instance?.title?.trim() ||\n node.policy.link?.description?.trim() ||\n node.policy.link?.title?.trim() ||\n node.path;\n\n/**\n * Enumerate reviewable contextual-link candidates from the declared graph.\n *\n * Excluded: self-pairs, pages that are not sitemap-eligible, pairs already\n * declared as a `related` edge, and — when {@link LinkCandidateOptions.renderedEdges}\n * is supplied — pairs already rendered as an anchor. Queries, hashes, and\n * trailing slashes are normalized so both sides compare by the graph's path key.\n */\nexport const generateLinkCandidates = (\n graph: SeoGraph,\n options: LinkCandidateOptions = {},\n): LinkCandidateResult => {\n const limit = options.limit ?? 50;\n const filters = options.clusters ?? [];\n // Legacy bare edges have no region. Treat them as body links so a v1 edge dump\n // remains conservative; region-aware artifacts retain nav/header/footer edges.\n const rendered = new Set(\n (options.renderedEdges ?? []).filter((edge) => edge.region === undefined || edge.region === \"body\")\n .map((edge) => directedEdgeKey(edge.from, edge.to)),\n );\n const declared = new Set(\n graph.edges\n .filter((edge) => edge.type === \"related\")\n .map((edge) => directedEdgeKey(edge.from, edge.to)),\n );\n\n const eligible = [...graph.nodes.values()].filter(isSitemapEligible);\n\n const all: Array<LinkCandidatePair> = [];\n for (let i = 0; i < eligible.length; i++) {\n for (let j = i + 1; j < eligible.length; j++) {\n const a = eligible[i]!;\n const b = eligible[j]!;\n const cluster = candidateClusterOf(a, b);\n if (cluster === undefined) continue;\n if (filters.length > 0 && !filters.some((filter) => matchesClusterFilter(cluster.key, filter))) {\n continue;\n }\n for (const [source, destination] of [[a.path, b.path], [b.path, a.path]]) {\n const key = directedEdgeKey(source!, destination!);\n if (declared.has(key) || rendered.has(key)) continue;\n all.push({ source: source!, destination: destination!, cluster: cluster.key, reason: cluster.reason });\n }\n }\n }\n\n const compare = (x: LinkCandidatePair, y: LinkCandidatePair): number =>\n x.cluster < y.cluster\n ? -1\n : x.cluster > y.cluster\n ? 1\n : x.source < y.source\n ? -1\n : x.source > y.source\n ? 1\n : x.destination < y.destination\n ? -1\n : x.destination > y.destination\n ? 1\n : 0;\n all.sort(compare);\n\n const counts = new Map<string, number>();\n for (const pair of all) counts.set(pair.cluster, (counts.get(pair.cluster) ?? 0) + 1);\n\n const candidates = all.slice(0, limit);\n return {\n candidates,\n total: all.length,\n truncated: all.length > candidates.length,\n clusters: [...counts.entries()].map(([key, count]) => ({ key, candidates: count })),\n };\n};\n\n/**\n * Decode a rendered-edge dump supplied to the CLI: either a bare array of\n * `{ from, to }` edges, or an object carrying `edges` (or `internalEdges`).\n * Throws on any other shape — this is user input, not a provider payload.\n */\nexport const decodeRenderedEdges = (input: unknown): ReadonlyArray<SimpleEdge & { readonly region?: AnchorRegion }> => {\n const array =\n Array.isArray(input)\n ? input\n : input !== null && typeof input === \"object\" && Array.isArray((input as { edges?: unknown }).edges)\n ? (input as { edges: ReadonlyArray<unknown> }).edges\n : input !== null &&\n typeof input === \"object\" &&\n Array.isArray((input as { internalEdges?: unknown }).internalEdges)\n ? (input as { internalEdges: ReadonlyArray<unknown> }).internalEdges\n : undefined;\n\n if (array === undefined) {\n throw new Error(\n \"expected an array of { from, to } edges, or an object with an `edges` array\",\n );\n }\n\n return array.map((item) => {\n if (item === null || typeof item !== \"object\") {\n throw new Error(\"each rendered edge must be an object with string `from` and `to`\");\n }\n const { from, to, region } = item as { from?: unknown; to?: unknown; region?: unknown };\n if (typeof from !== \"string\" || typeof to !== \"string\") {\n throw new Error(\"each rendered edge must have string `from` and `to`\");\n }\n if (region !== undefined && ![\"nav\", \"header\", \"footer\", \"body\"].includes(region as string)) {\n throw new Error(\"rendered edge region must be nav, header, footer, or body\");\n }\n return region === undefined ? { from, to } : { from, to, region: region as AnchorRegion };\n });\n};\n","import type { AnyRoute, AnyRouter } from \"@tanstack/react-router\";\n\nimport type { RouteSeo } from \"./declare\";\n\ninterface RouteMaps {\n routesByPath: Record<string, AnyRoute | undefined>;\n routesById: Record<string, AnyRoute>;\n}\n\n/**\n * Resolve a route's declared `seo.link` card (title + description) by its full\n * path.\n *\n * `useRouter()` returns a Router typed to this app's exact route tree, so\n * `routesByPath` is keyed by the literal `FileRouteTypes[\"fullPaths\"]` union —\n * but callers here (declared `related` targets) hold arbitrary runtime path\n * strings, not that literal type. `routesByPath` and `routesById` are plain\n * Records on every Router instance regardless of which route tree it's\n * parameterized over, so this narrows to that structural shape once, at this\n * boundary, instead of threading an `AnyRoute` cast through every call site.\n */\nexport function resolveRouteLink(router: AnyRouter, path: string): RouteSeo[\"link\"] {\n const { routesByPath, routesById } = router as unknown as RouteMaps;\n\n const direct = routesByPath[path];\n if (direct) return direct.options.staticData?.seo?.link;\n\n const byFullPath = Object.values(routesById).find((route) => route.fullPath === path);\n return byFullPath?.options.staticData?.seo?.link;\n}\n"],"mappings":";;;;;;;;AA6BA,SAAgB,kBACd,SACe;CACf,MAAM,UAAU,QAAQ,MAAM,KAAK,SAAS;EAC1C,MAAM,QAAQ,QAAQ,MAAM,IAAI;EAChC,OAAO;GAAE,GAAG;GAAO,MAAM,M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O,UAAU,YACjB,MAAM,QAAS,MAAsC,aAAa,IACjE,MAAoD,gBACrD,KAAA;CAEV,IAAI,UAAU,KAAA,GACZ,MAAM,IAAI,MACR,6EACF;CAGF,OAAO,MAAM,KAAK,SAAS;EACzB,IAAI,SAAS,QAAQ,OAAO,SAAS,UACnC,MAAM,IAAI,MAAM,kEAAkE;EAEpF,MAAM,EAAE,MAAM,IAAI,WAAW;EAC7B,IAAI,OAAO,SAAS,YAAY,OAAO,OAAO,UAC5C,MAAM,IAAI,MAAM,qDAAqD;EAEvE,IAAI,WAAW,KAAA,KAAa,CAAC;GAAC;GAAO;GAAU;GAAU;EAAM,CAAC,CAAC,SAAS,MAAgB,GACxF,MAAM,IAAI,MAAM,2DAA2D;EAE7E,OAAO,WAAW,KAAA,IAAY;GAAE;GAAM;EAAG,IAAI;GAAE;GAAM;GAAY;EAAuB;CAC1F,CAAC;AACH;;;;;;;;;;;;;;;AC1MA,SAAgB,iBAAiB,QAAmB,MAAgC;CAClF,MAAM,EAAE,cAAc,eAAe;CAErC,MAAM,SAAS,aAAa;CAC5B,IAAI,QAAQ,OAAO,OAAO,QAAQ,YAAY,KAAK;CAGnD,OADmB,OAAO,OAAO,UAAU,CAAC,CAAC,MAAM,UAAU,MAAM,aAAa,IAChE,CAAC,EAAE,QAAQ,YAAY,KAAK;AAC9C"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/core/collections.ts","../src/core/link-candidates.ts","../src/core/resolve-route-link.ts","../src/markdown/lock.ts"],"sourcesContent":["/**\n * Content collections — pages a param route renders from content (MDX, a CMS,\n * a manifest) — in the shape the graph reads. Works with any source whose\n * pages carry a URL, which covers Fumadocs `loader().getPages()` directly.\n */\n\nimport type { PublicPath } from \"./declare\";\nimport type { SeoCollection, SeoEdge, SeoInstance, SeoSource } from \"./graph\";\n\n/** What a page contributes: its instance metadata plus the paths it links to deliberately. */\nexport interface ContentEntry extends Omit<SeoInstance, \"path\"> {\n /** Defaults to the page's `url`. */\n readonly path?: string | undefined;\n /** Deliberate cross-links, emitted as `related` edges from this page. */\n readonly related?: ReadonlyArray<string> | undefined;\n}\n\nexport interface ContentCollectionOptions<Page> {\n /** The param route these pages render through, e.g. `/blog/$slug`. */\n readonly route: PublicPath;\n /** The `source` label stamped on every node, e.g. `\"blog\"`. */\n readonly source: SeoSource;\n readonly pages: ReadonlyArray<Page>;\n /** Map one page to its entry; decode frontmatter here. */\n readonly entry: (page: Page) => ContentEntry;\n /** Edges beyond `related` (crumb parents, collection membership). */\n readonly edges?: ReadonlyArray<SeoEdge> | undefined;\n}\n\nexport function contentCollection<Page extends { readonly url: string }>(\n options: ContentCollectionOptions<Page>,\n): SeoCollection {\n const entries = options.pages.map((page) => {\n const entry = options.entry(page);\n return { ...entry, path: entry.path ?? page.url };\n });\n return {\n route: options.route,\n source: options.source,\n instances: entries.map(({ related: _related, ...instance }) => instance),\n edges: [\n ...entries.flatMap((entry) =>\n [...new Set(entry.related ?? [])].map((to): SeoEdge => ({ from: entry.path, to, type: \"related\" })),\n ),\n ...(options.edges ?? []),\n ],\n };\n}\n","/**\n * Pure candidate generation for contextual cross-links.\n *\n * Given the declared graph, enumerate `(source, destination)` pairs that are\n * *plausible* contextual links and *not already connected*. A pair is plausible\n * when the two pages sit in the same cluster: a shared top-level section (e.g.\n * `/blog/a` and `/blog/b` under `/blog`) or, for root-level pages that share no\n * section, the same `kind`. Only sitemap-eligible pages are candidates — a\n * noindex, redirect, or param template is not a link surface.\n *\n * The plan is a proposal, never an application: nothing here writes a\n * declaration. Effect- and framework-free so it runs in the CLI, a Worker, or a\n * test on the same graph.\n */\n\nimport type { SeoGraph, SeoNode } from \"./graph\";\nimport type { AnchorRegion, SimpleEdge } from \"./links\";\nimport { isSitemapEligible } from \"./projections\";\n\n/** One proposed contextual link, in the direction the link would be authored. */\nexport interface LinkCandidatePair {\n readonly source: string;\n readonly destination: string;\n /** The cluster the pair shares: a top-level section, or `kind:<kind>`. */\n readonly cluster: string;\n /** Why the pair is plausible, e.g. `same top-level section \"/blog\"`. */\n readonly reason: string;\n}\n\nexport interface LinkCandidateOptions {\n /** Maximum candidates to return after ordering (default 50). */\n readonly limit?: number;\n /** Restrict to these clusters; a filter may be a section or a bare kind. */\n readonly clusters?: ReadonlyArray<string>;\n /** Anchors already served in HTML. Only body-region edges exclude their own direction. */\n readonly renderedEdges?: ReadonlyArray<SimpleEdge & { readonly region?: AnchorRegion }>;\n}\n\n/** One cluster and how many candidate pairs it contributes (before `limit`). */\nexport interface LinkClusterSummary {\n readonly key: string;\n readonly candidates: number;\n}\n\nexport interface LinkCandidateResult {\n readonly candidates: ReadonlyArray<LinkCandidatePair>;\n /** Candidate pairs before `limit` was applied (after cluster filters). */\n readonly total: number;\n readonly truncated: boolean;\n readonly clusters: ReadonlyArray<LinkClusterSummary>;\n}\n\n/**\n * Canonical path key: query and hash stripped, trailing slashes removed, \"/\"\n * preserved. This is the same path key the graph and the rendered-link core\n * use, so a served anchor like `/blog/a?ref=nav` still matches the graph pair\n * `/blog/a`.\n */\nconst normalize = (path: string): string => {\n const pathname = path.split(/[?#]/, 1)[0] ?? \"\";\n const trimmed = pathname.replace(/\\/+$/, \"\");\n return trimmed === \"\" ? \"/\" : trimmed;\n};\n\n/** Directionless pair key, so an edge in either direction means \"connected\". */\nexport const undirectedEdgeKey = (from: string, to: string): string => {\n const [a, b] = [normalize(from), normalize(to)].sort();\n return `${a}\\u0000${b}`;\n};\n\nconst directedEdgeKey = (from: string, to: string): string => `${normalize(from)}\\u0000${normalize(to)}`;\n\n/** First path segment, or undefined for the root page. */\nconst topSegment = (path: string): string | undefined => {\n const segment = path.split(\"/\").filter(Boolean)[0];\n return segment === undefined || segment === \"\" ? undefined : segment;\n};\n\n/** A page with no nested segment (`/`, `/pricing`, `/blog`) is root-level. */\nconst isRootLevel = (path: string): boolean => path.split(\"/\").filter(Boolean).length <= 1;\n\n/**\n * The cluster a pair shares, or undefined when they share none. Section-first:\n * a shared top-level section wins. The kind fallback is local to root-level\n * pages, so it never pairs two nested pages from different sections.\n */\nexport const candidateClusterOf = (a: SeoNode, b: SeoNode): { key: string; reason: string } | undefined => {\n const aSegment = topSegment(a.path);\n const bSegment = topSegment(b.path);\n if (aSegment !== undefined && aSegment === bSegment) {\n return { key: aSegment, reason: `same top-level section \"/${aSegment}\"` };\n }\n if (isRootLevel(a.path) && isRootLevel(b.path) && a.kind === b.kind) {\n return { key: `kind:${a.kind}`, reason: `same kind \"${a.kind}\"` };\n }\n return undefined;\n};\n\n/** A `--cluster` filter matches a section by name, or a kind via its bare label. */\nexport const matchesClusterFilter = (cluster: string, filter: string): boolean => {\n const normalized = filter.replace(/^\\/+/, \"\").toLowerCase();\n const key = cluster.toLowerCase();\n return key === normalized || key === `kind:${normalized}`;\n};\n\n/** Human reason string for a candidate's source page, used when handing a plan to Jev. */\nexport const candidateSourceText = (node: SeoNode): string =>\n node.instance?.description?.trim() ||\n node.instance?.title?.trim() ||\n node.policy.link?.description?.trim() ||\n node.policy.link?.title?.trim() ||\n node.path;\n\n/**\n * Enumerate reviewable contextual-link candidates from the declared graph.\n *\n * Excluded: self-pairs, pages that are not sitemap-eligible, pairs already\n * declared as a `related` edge, and — when {@link LinkCandidateOptions.renderedEdges}\n * is supplied — pairs already rendered as an anchor. Queries, hashes, and\n * trailing slashes are normalized so both sides compare by the graph's path key.\n */\nexport const generateLinkCandidates = (\n graph: SeoGraph,\n options: LinkCandidateOptions = {},\n): LinkCandidateResult => {\n const limit = options.limit ?? 50;\n const filters = options.clusters ?? [];\n // Legacy bare edges have no region. Treat them as body links so a v1 edge dump\n // remains conservative; region-aware artifacts retain nav/header/footer edges.\n const rendered = new Set(\n (options.renderedEdges ?? []).filter((edge) => edge.region === undefined || edge.region === \"body\")\n .map((edge) => directedEdgeKey(edge.from, edge.to)),\n );\n const declared = new Set(\n graph.edges\n .filter((edge) => edge.type === \"related\")\n .map((edge) => directedEdgeKey(edge.from, edge.to)),\n );\n\n const eligible = [...graph.nodes.values()].filter(isSitemapEligible);\n\n const all: Array<LinkCandidatePair> = [];\n for (let i = 0; i < eligible.length; i++) {\n for (let j = i + 1; j < eligible.length; j++) {\n const a = eligible[i]!;\n const b = eligible[j]!;\n const cluster = candidateClusterOf(a, b);\n if (cluster === undefined) continue;\n if (filters.length > 0 && !filters.some((filter) => matchesClusterFilter(cluster.key, filter))) {\n continue;\n }\n for (const [source, destination] of [[a.path, b.path], [b.path, a.path]]) {\n const key = directedEdgeKey(source!, destination!);\n if (declared.has(key) || rendered.has(key)) continue;\n all.push({ source: source!, destination: destination!, cluster: cluster.key, reason: cluster.reason });\n }\n }\n }\n\n const compare = (x: LinkCandidatePair, y: LinkCandidatePair): number =>\n x.cluster < y.cluster\n ? -1\n : x.cluster > y.cluster\n ? 1\n : x.source < y.source\n ? -1\n : x.source > y.source\n ? 1\n : x.destination < y.destination\n ? -1\n : x.destination > y.destination\n ? 1\n : 0;\n all.sort(compare);\n\n const counts = new Map<string, number>();\n for (const pair of all) counts.set(pair.cluster, (counts.get(pair.cluster) ?? 0) + 1);\n\n const candidates = all.slice(0, limit);\n return {\n candidates,\n total: all.length,\n truncated: all.length > candidates.length,\n clusters: [...counts.entries()].map(([key, count]) => ({ key, candidates: count })),\n };\n};\n\n/**\n * Decode a rendered-edge dump supplied to the CLI: either a bare array of\n * `{ from, to }` edges, or an object carrying `edges` (or `internalEdges`).\n * Throws on any other shape — this is user input, not a provider payload.\n */\nexport const decodeRenderedEdges = (input: unknown): ReadonlyArray<SimpleEdge & { readonly region?: AnchorRegion }> => {\n const array =\n Array.isArray(input)\n ? input\n : input !== null && typeof input === \"object\" && Array.isArray((input as { edges?: unknown }).edges)\n ? (input as { edges: ReadonlyArray<unknown> }).edges\n : input !== null &&\n typeof input === \"object\" &&\n Array.isArray((input as { internalEdges?: unknown }).internalEdges)\n ? (input as { internalEdges: ReadonlyArray<unknown> }).internalEdges\n : undefined;\n\n if (array === undefined) {\n throw new Error(\n \"expected an array of { from, to } edges, or an object with an `edges` array\",\n );\n }\n\n return array.map((item) => {\n if (item === null || typeof item !== \"object\") {\n throw new Error(\"each rendered edge must be an object with string `from` and `to`\");\n }\n const { from, to, region } = item as { from?: unknown; to?: unknown; region?: unknown };\n if (typeof from !== \"string\" || typeof to !== \"string\") {\n throw new Error(\"each rendered edge must have string `from` and `to`\");\n }\n if (region !== undefined && ![\"nav\", \"header\", \"footer\", \"body\"].includes(region as string)) {\n throw new Error(\"rendered edge region must be nav, header, footer, or body\");\n }\n return region === undefined ? { from, to } : { from, to, region: region as AnchorRegion };\n });\n};\n","import type { AnyRoute, AnyRouter } from \"@tanstack/react-router\";\n\nimport type { RouteSeo } from \"./declare\";\n\ninterface RouteMaps {\n routesByPath: Record<string, AnyRoute | undefined>;\n routesById: Record<string, AnyRoute>;\n}\n\n/**\n * Resolve a route's declared `seo.link` card (title + description) by its full\n * path.\n *\n * `useRouter()` returns a Router typed to this app's exact route tree, so\n * `routesByPath` is keyed by the literal `FileRouteTypes[\"fullPaths\"]` union —\n * but callers here (declared `related` targets) hold arbitrary runtime path\n * strings, not that literal type. `routesByPath` and `routesById` are plain\n * Records on every Router instance regardless of which route tree it's\n * parameterized over, so this narrows to that structural shape once, at this\n * boundary, instead of threading an `AnyRoute` cast through every call site.\n */\nexport function resolveRouteLink(router: AnyRouter, path: string): RouteSeo[\"link\"] {\n const { routesByPath, routesById } = router as unknown as RouteMaps;\n\n const direct = routesByPath[path];\n if (direct) return direct.options.staticData?.seo?.link;\n\n const byFullPath = Object.values(routesById).find((route) => route.fullPath === path);\n return byFullPath?.options.staticData?.seo?.link;\n}\n","import type { PageDocument } from \"./document\";\n\n/** Stable, reviewable snapshot of document and message hashes with source locations. */\nexport interface MarkdownLock {\n readonly version: 1;\n readonly pages: Readonly<Record<string, {\n readonly document: string;\n readonly messages: Readonly<Record<string, string>>;\n }>>;\n}\n\nconst compare = (left: string, right: string): number => (left < right ? -1 : left > right ? 1 : 0);\n\n/** Build the v1 lock without changing document hashes, message hashes, or sources. */\nexport function createMarkdownLock(documents: ReadonlyArray<PageDocument>): MarkdownLock {\n const pages: Record<string, { document: string; messages: Record<string, string> }> =\n Object.create(null);\n\n for (const document of [...documents].sort((left, right) => compare(left.path, right.path))) {\n if (Object.hasOwn(pages, document.path))\n throw new Error(`Duplicate document page path \"${document.path}\"`);\n if (!/^[0-9a-f]{64}$/.test(document.hash))\n throw new Error(`Invalid document document hash \"${document.hash}\" on \"${document.path}\"`);\n\n const messages: Record<string, string> = Object.create(null);\n for (const message of [...document.messages].sort(\n (left, right) => compare(left.hash, right.hash) || compare(left.source, right.source),\n )) {\n if (!/^[0-9a-f]{16}$/.test(message.hash))\n throw new Error(`Invalid document message hash \"${message.hash}\" on \"${document.path}\"`);\n if (!Object.hasOwn(messages, message.hash)) messages[message.hash] = message.source;\n }\n pages[document.path] = { document: document.hash, messages };\n }\n\n // Typed callers supply strings, but the lock remains a validating runtime boundary.\n for (const [path, page] of Object.entries(pages)) {\n if (typeof page.document !== \"string\")\n throw new Error(`Expected string\\n at [\"pages\"][${JSON.stringify(path)}][\"document\"]`);\n for (const [hash, source] of Object.entries(page.messages)) {\n if (typeof source !== \"string\")\n throw new Error(`Expected string\\n at [\"pages\"][${JSON.stringify(path)}][\"messages\"][${JSON.stringify(hash)}]`);\n }\n }\n return { version: 1, pages };\n}\n"],"mappings":";;;;;;;;;;;;AA6BA,SAAgB,kBACd,SACe;CACf,MAAM,UAAU,QAAQ,MAAM,KAAK,SAAS;EAC1C,MAAM,QAAQ,QAAQ,MAAM,IAAI;EAChC,OAAO;GAAE,GAAG;GAAO,MAAM,MAAM,QAAQ,KAAK;EAAI;CAClD,CAAC;CACD,OAAO;EACL,OAAO,QAAQ;EACf,QAAQ,QAAQ;EAChB,WAAW,QAAQ,KAAK,EAAE,SAAS,UAAU,GAAG,eAAe,QAAQ;EACvE,OAAO,CACL,GAAG,QAAQ,SAAS,UAClB,CAAC,GAAG,IAAI,IAAI,MAAM,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,QA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