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.
Files changed (160) hide show
  1. package/README.md +325 -66
  2. package/dist/anthropic-messages-TqKpKmfW.js +1067 -0
  3. package/dist/anthropic-messages-TqKpKmfW.js.map +1 -0
  4. package/dist/audit.d.ts +4 -2
  5. package/dist/audit.js +5 -5
  6. package/dist/audit.js.map +1 -1
  7. package/dist/azure-openai-responses-DJjBLwoI.js +231 -0
  8. package/dist/azure-openai-responses-DJjBLwoI.js.map +1 -0
  9. package/dist/build-only/audit.js +1 -1
  10. package/dist/build-only/claims.d.ts +1 -0
  11. package/dist/build-only/claims.js +6 -0
  12. package/dist/build-only/claims.js.map +1 -0
  13. package/dist/build-only/config.js +1 -1
  14. package/dist/build-only/oxlint.d.ts +1 -0
  15. package/dist/build-only/oxlint.js +6 -0
  16. package/dist/build-only/oxlint.js.map +1 -0
  17. package/dist/build-only/tanstack-start.js +1 -1
  18. package/dist/build-only/vite.js +1 -1
  19. package/dist/{checks-uZk5Em9A.js → checks-BS-aDXB_.js} +2 -2
  20. package/dist/checks-BS-aDXB_.js.map +1 -0
  21. package/dist/claims-Bch7Lxlo.d.ts +92 -0
  22. package/dist/claims-Bv7voeEV.js +431 -0
  23. package/dist/claims-Bv7voeEV.js.map +1 -0
  24. package/dist/claims.d.ts +94 -0
  25. package/dist/claims.js +2 -0
  26. package/dist/cli.js +17607 -43387
  27. package/dist/cli.js.map +1 -1
  28. package/dist/cloudflare-workers-ai-system-one-f3ZrvNYZ.js +41 -0
  29. package/dist/cloudflare-workers-ai-system-one-f3ZrvNYZ.js.map +1 -0
  30. package/dist/config.d.ts +9 -29
  31. package/dist/config.js +2 -2
  32. package/dist/config.js.map +1 -1
  33. package/dist/{content-kcEnQdfi.js → content-CHd0X4s6.js} +2 -2
  34. package/dist/{content-kcEnQdfi.js.map → content-CHd0X4s6.js.map} +1 -1
  35. package/dist/{content-B1cPtL8b.d.ts → content-DgNr7apS.d.ts} +4 -5
  36. package/dist/declare-D5o7hwmv.js.map +1 -1
  37. package/dist/diagnostics-Wt5faNDM.js +108 -0
  38. package/dist/diagnostics-Wt5faNDM.js.map +1 -0
  39. package/dist/dist-B6zg_Z3Z.js +4794 -0
  40. package/dist/dist-B6zg_Z3Z.js.map +1 -0
  41. package/dist/document-CztEu3Vd.d.ts +109 -0
  42. package/dist/document-Dvemcv7V.js +379 -0
  43. package/dist/document-Dvemcv7V.js.map +1 -0
  44. package/dist/env-api-keys-C-OA0yM-.js +124 -0
  45. package/dist/env-api-keys-C-OA0yM-.js.map +1 -0
  46. package/dist/error-body-CyiejW4b.js +103 -0
  47. package/dist/error-body-CyiejW4b.js.map +1 -0
  48. package/dist/facts-1OKclPOk.js +115 -0
  49. package/dist/facts-1OKclPOk.js.map +1 -0
  50. package/dist/github-copilot-headers-CEpMOpQF.js +24 -0
  51. package/dist/github-copilot-headers-CEpMOpQF.js.map +1 -0
  52. package/dist/google-generative-ai-BxABKIKO.js +330 -0
  53. package/dist/google-generative-ai-BxABKIKO.js.map +1 -0
  54. package/dist/google-shared-0gpM2jFi.js +19471 -0
  55. package/dist/google-shared-0gpM2jFi.js.map +1 -0
  56. package/dist/google-vertex-D8Eb5cbu.js +376 -0
  57. package/dist/google-vertex-D8Eb5cbu.js.map +1 -0
  58. package/dist/{declare-DVgdEdOL.d.ts → graph-D1PIndsC.d.ts} +117 -6
  59. package/dist/{graph-Bcsourlv.js → graph-DMNOLXLu.js} +23 -13
  60. package/dist/graph-DMNOLXLu.js.map +1 -0
  61. package/dist/hash-Dp7EzZUo.js +18 -0
  62. package/dist/hash-Dp7EzZUo.js.map +1 -0
  63. package/dist/headers-BRNMVpzu.js +19 -0
  64. package/dist/headers-BRNMVpzu.js.map +1 -0
  65. package/dist/index-C5w9ripz.d.ts +204 -0
  66. package/dist/index.d.ts +6 -160
  67. package/dist/index.js +37 -5
  68. package/dist/index.js.map +1 -1
  69. package/dist/inline-BbS93GAT.js +682 -0
  70. package/dist/inline-BbS93GAT.js.map +1 -0
  71. package/dist/json-parse-C10znB7l.js +383 -0
  72. package/dist/json-parse-C10znB7l.js.map +1 -0
  73. package/dist/llms-Dhr_5u2O.js +19 -0
  74. package/dist/llms-Dhr_5u2O.js.map +1 -0
  75. package/dist/markdown-C6dRE9zD.js +168 -0
  76. package/dist/markdown-C6dRE9zD.js.map +1 -0
  77. package/dist/markdown-path-lJB9BAVZ.js +6 -0
  78. package/dist/markdown-path-lJB9BAVZ.js.map +1 -0
  79. package/dist/{message-DT_CjUdt.js → message-CuBjgZ74.js} +2 -2
  80. package/dist/{message-DT_CjUdt.js.map → message-CuBjgZ74.js.map} +1 -1
  81. package/dist/mistral-conversations-CvaqBWjR.js +690 -0
  82. package/dist/mistral-conversations-CvaqBWjR.js.map +1 -0
  83. package/dist/models-DcT5qOEL.js +1203 -0
  84. package/dist/models-DcT5qOEL.js.map +1 -0
  85. package/dist/node-Ccvru9GE.js +26 -0
  86. package/dist/node-Ccvru9GE.js.map +1 -0
  87. package/dist/node-MEosBOF2.js +2403 -0
  88. package/dist/node-MEosBOF2.js.map +1 -0
  89. package/dist/openai-BCBEd2eO.js +17350 -0
  90. package/dist/openai-BCBEd2eO.js.map +1 -0
  91. package/dist/openai-codex-responses-vJqxeeRC.js +1268 -0
  92. package/dist/openai-codex-responses-vJqxeeRC.js.map +1 -0
  93. package/dist/openai-completions-Cb_fRAbI.js +989 -0
  94. package/dist/openai-completions-Cb_fRAbI.js.map +1 -0
  95. package/dist/openai-prompt-cache-Bc6qNWt0.js +10 -0
  96. package/dist/openai-prompt-cache-Bc6qNWt0.js.map +1 -0
  97. package/dist/openai-responses-sDuh82G5.js +268 -0
  98. package/dist/openai-responses-sDuh82G5.js.map +1 -0
  99. package/dist/openai-responses-shared-mhuo1Jov.js +599 -0
  100. package/dist/openai-responses-shared-mhuo1Jov.js.map +1 -0
  101. package/dist/openrouter-images-CRmBkzpX.js +127 -0
  102. package/dist/openrouter-images-CRmBkzpX.js.map +1 -0
  103. package/dist/oxlint.d.ts +58 -0
  104. package/dist/oxlint.js +202 -0
  105. package/dist/oxlint.js.map +1 -0
  106. package/dist/page-heads-BfjWQvau.d.ts +108 -0
  107. package/dist/{page-heads-6y-CARRQ.js → page-heads-BgbaIjj9.js} +3 -3
  108. package/dist/page-heads-BgbaIjj9.js.map +1 -0
  109. package/dist/pi-Bvw6J0gh.js +56795 -0
  110. package/dist/pi-Bvw6J0gh.js.map +1 -0
  111. package/dist/pi-messages-CejiVYvO.js +308 -0
  112. package/dist/pi-messages-CejiVYvO.js.map +1 -0
  113. package/dist/{projections-DeEFe7XT.d.ts → projections-Bk-qOOsR.d.ts} +2 -2
  114. package/dist/provider-env-t38GK5FF.js +39 -0
  115. package/dist/provider-env-t38GK5FF.js.map +1 -0
  116. package/dist/provider-retry-DzKoh1X7.js +80 -0
  117. package/dist/provider-retry-DzKoh1X7.js.map +1 -0
  118. package/dist/react.d.ts +3 -2
  119. package/dist/react.js +2 -1
  120. package/dist/react.js.map +1 -1
  121. package/dist/rolldown-runtime-B-lAHAz2.js +37 -0
  122. package/dist/sanitize-unicode-Ds14l9Om.js +28 -0
  123. package/dist/sanitize-unicode-Ds14l9Om.js.map +1 -0
  124. package/dist/sdk-C9_wiO6w.js +12503 -0
  125. package/dist/sdk-C9_wiO6w.js.map +1 -0
  126. package/dist/state-BuJP_3Lr.js +28102 -0
  127. package/dist/state-BuJP_3Lr.js.map +1 -0
  128. package/dist/system-one-shared-Dl10ZF7Z.js +167 -0
  129. package/dist/system-one-shared-Dl10ZF7Z.js.map +1 -0
  130. package/dist/tanstack-start/index.d.ts +29 -13
  131. package/dist/tanstack-start/index.js +391 -42
  132. package/dist/tanstack-start/index.js.map +1 -1
  133. package/dist/tanstack-start/markdown.d.ts +12 -0
  134. package/dist/tanstack-start/markdown.js +149 -0
  135. package/dist/tanstack-start/markdown.js.map +1 -0
  136. package/dist/tanstack-start/prerender-worker.d.ts +2 -0
  137. package/dist/tanstack-start/prerender-worker.js +7 -0
  138. package/dist/tanstack-start/prerender-worker.js.map +1 -0
  139. package/dist/tanstack-start/react.d.ts +7 -0
  140. package/dist/tanstack-start/react.js +12 -0
  141. package/dist/tanstack-start/react.js.map +1 -0
  142. package/dist/tanstack-start/server.d.ts +9 -3
  143. package/dist/tanstack-start/server.js +26 -2
  144. package/dist/tanstack-start/server.js.map +1 -1
  145. package/dist/transform-messages-BLJ8EfK6.js +468 -0
  146. package/dist/transform-messages-BLJ8EfK6.js.map +1 -0
  147. package/dist/typesafe-system-one-CwEWMV8P.js +25 -0
  148. package/dist/typesafe-system-one-CwEWMV8P.js.map +1 -0
  149. package/dist/{vite-graph-loader-01p1WxEq.js → vite-graph-loader-CsGiYNWE.js} +6 -5
  150. package/dist/vite-graph-loader-CsGiYNWE.js.map +1 -0
  151. package/dist/vite-graph-loader-DZCwejuJ.d.ts +133 -0
  152. package/package.json +47 -10
  153. package/dist/checks-uZk5Em9A.js.map +0 -1
  154. package/dist/graph-Bcsourlv.js.map +0 -1
  155. package/dist/graph-BxCY90vq.d.ts +0 -104
  156. package/dist/graph-CBIY71w6.d.ts +0 -57
  157. package/dist/page-heads-6y-CARRQ.js.map +0 -1
  158. package/dist/page-heads-DNkjMUEN.d.ts +0 -21
  159. package/dist/vite-graph-loader-01p1WxEq.js.map +0 -1
  160. package/dist/vite-graph-loader-Btgjz5RH.d.ts +0 -56
@@ -1,5 +1,4 @@
1
- import { o as SeoKind } from "./declare-DVgdEdOL.js";
2
- import { a as SeoGraph, u as SeoSource } from "./graph-BxCY90vq.js";
1
+ import { _ as SeoKind, a as SeoGraph, u as SeoSource } from "./graph-D1PIndsC.js";
3
2
  //#region src/core/freshness.d.ts
4
3
  /** Project policy: pages whose last change is older than this are stale. */
5
4
  interface FreshnessPolicy {
@@ -193,7 +192,7 @@ interface Violation {
193
192
  * A contextual-link coverage rule: every sitemap-eligible page matching the
194
193
  * `path` glob must have at least `minInbound` incoming contextual links. Unlike
195
194
  * the static rules, these come from project policy (a CLI flag or
196
- * `seo.config.ts`), because "which pages are money pages" is app knowledge.
195
+ * `pagegraph.config.ts`), because "which pages are money pages" is app knowledge.
197
196
  *
198
197
  * The same rule shape is evaluated twice: `checkCoverage` counts declared
199
198
  * `related` edges, and `checkRenderedCoverage` counts the contextual anchors a
@@ -244,7 +243,7 @@ declare function checkCoverage(graph: SeoGraph, rules: ReadonlyArray<CoverageRul
244
243
  * distinction the declared pass draws by counting `related` edges alone.
245
244
  *
246
245
  * The target universe is the declared graph's sitemap-eligible pages: the globs
247
- * in `seo.config.ts` are written against declared paths, and the crawl is what
246
+ * in `pagegraph.config.ts` are written against declared paths, and the crawl is what
248
247
  * supplies the served edges. Pass the crawl's `internalEdges` (each edge carries
249
248
  * its `region`).
250
249
  */
@@ -334,4 +333,4 @@ declare const renderedCheckTargets: (graph: SeoGraph) => Array<string>;
334
333
  declare function checkRenderedContent(graph: SeoGraph, documents: ReadonlyArray<RenderedDocument>, policy?: ContentPolicy): Array<Violation>;
335
334
  //#endregion
336
335
  export { RenderedEdgeFailure as A, FreshnessEntry as B, Anchor as C, RENDERED_EDGE_ARTIFACT_SCHEMA_VERSION as D, LinkGraphDiff as E, decodeRenderedEdgeArtifact as F, FreshnessReport as H, diffLinkGraph as I, extractAnchors as L, RenderedPage as M, SimpleEdge as N, RenderedEdgeArtifact as O, buildRenderedGraph as P, normalizePath as R, hasStructuralViolations as S, LinkEdge as T, freshnessReport as U, FreshnessPolicy as V, Violation as _, Heading as a, checkGraph as b, RenderedDocument as c, checkRenderedContent as d, extractPageContent as f, Severity as g, CoverageRule as h, ContentRuleName as i, RenderedGraph as j, RenderedEdgeArtifactCrawl as k, WordCountRule as l, CheckGraphOptions as m, ContentFinding as n, JsonLdNode as o, renderedCheckTargets as p, ContentPolicy as r, PageContent as s, ContentCheckOptions as t, checkPageContent as u, checkCoverage as v, AnchorRegion as w, checkRenderedCoverage as x, checkFreshness as y, renderedGraphFromEdges as z };
337
- //# sourceMappingURL=content-B1cPtL8b.d.ts.map
336
+ //# sourceMappingURL=content-DgNr7apS.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"declare-D5o7hwmv.js","names":[],"sources":["../src/core/declare.ts"],"sourcesContent":["/**\n * The declaration surface: what a route says about itself in\n * `staticData.seo`. Everything else in this package derives from it.\n *\n * The two vocabularies a consumer owns — the set of valid paths and the set of\n * valid page kinds — are supplied by augmenting {@link Register}, the same\n * pattern TanStack Router uses for its own typed registry. Unaugmented, both\n * fall back to `string`, so the package compiles and behaves on its own.\n */\n\nimport type { AnyRouteMatch } from \"@tanstack/react-router\";\nimport type { Graph, Thing, WithContext } from \"schema-dts\";\n\n/**\n * Consumer-augmented registry.\n *\n * ```ts\n * declare module \"pagegraph\" {\n * interface Register {\n * paths: FileRouteTypes[\"fullPaths\"];\n * kinds: \"page\" | \"article\" | \"hub\";\n * }\n * }\n * ```\n */\nexport interface Register {}\n\n/** Every public full path in the consumer's route tree (type-only; erased at runtime). */\nexport type PublicPath = Register extends { paths: infer P extends string } ? P : string;\n\n/** The consumer's page taxonomy. A label: nothing in the core branches on it. */\nexport type SeoKind = Register extends { kinds: infer K extends string } ? K : string;\n\nexport interface SitemapPolicy {\n priority: number;\n changeFrequency: \"weekly\" | \"monthly\";\n}\n\n/** A question and answer the page shows and marks up as FAQPage. */\nexport interface SeoFaq {\n question: string;\n answer: string;\n category?: string | undefined;\n isHighlighted?: boolean | undefined;\n}\n\n/** A top-level JSON-LD entity or graph ready to serialize into a script element. */\nexport type JsonLdDocument = WithContext<Thing> | Graph;\n\n/**\n * The document head a page ships. A static route declares it once in\n * `staticData.seo.head` and renders it with `seo.head` from `pagegraph/react`;\n * the graph, `pageHeads`, and the checks read the same title, description, and\n * FAQs. A dynamic route passes it to `seoHead(ctx, head)` from its `head()`.\n */\nexport interface SeoPageHead {\n /**\n * The page title. A route that declares {@link RouteSeo.titleTemplate} gets\n * it applied; otherwise this is the full `<title>`.\n */\n title: string;\n description: string;\n ogTitle?: string | undefined;\n ogDescription?: string | undefined;\n /** Override of the route's robots policy. */\n robots?: string | undefined;\n article?:\n | {\n publishedAt: string;\n modifiedAt?: string | undefined;\n author?: { name: string; url?: string | undefined } | undefined;\n image?: string | undefined;\n tags?: ReadonlyArray<string> | undefined;\n }\n | undefined;\n faqs?: ReadonlyArray<SeoFaq> | undefined;\n service?: { name: string; description?: string | undefined; serviceType: string } | undefined;\n /** Standalone keywords meta for non-article pages; article pages derive it from tags. */\n keywords?: ReadonlyArray<string> | undefined;\n /** Visible canonical pages rendered as an ordered collection on this page. */\n itemList?: { name: string; items: ReadonlyArray<{ name: string; url: string }> } | undefined;\n /** Additional schema.org documents for this route. */\n jsonLd?: ReadonlyArray<JsonLdDocument> | undefined;\n /**\n * Explicit canonical path (used for canonical + og:url instead of the match pathname).\n * For routes whose canonical is computed independently of the URL, e.g. a docs splat\n * that derives it from the resolved slug segments in its loader.\n */\n canonicalPath?: string | undefined;\n /**\n * Explicit breadcrumb trail for the BreadcrumbList JSON-LD, overriding the match-chain\n * trail. For routes whose hierarchy lives outside the route tree. Each `path` is a URL path.\n */\n breadcrumbs?: ReadonlyArray<{ name: string; path: string }> | undefined;\n}\n\nexport interface RouteSeo {\n kind: SeoKind;\n /** Breadcrumb label; fn form reads the match (e.g. loaderData frontmatter title). */\n crumb?: string | ((match: AnyRouteMatch) => string) | undefined;\n /** false = excluded from sitemap. Absent on non-indexable kinds is fine. */\n sitemap?: SitemapPolicy | false | undefined;\n /** meta robots value, e.g. \"noindex, follow\" on a hub page. */\n robots?: string | undefined;\n /** Typed cross-link edges. */\n related?: ReadonlyArray<PublicPath> | undefined;\n /** How OTHER pages render a card for this page. */\n link?: { title: string; description: string } | undefined;\n /** This route is a redirect/alias. */\n redirectTo?: PublicPath | undefined;\n /**\n * When this page's content last changed meaningfully, as an ISO 8601 date.\n * Feeds the sitemap `<lastmod>` and the freshness report. Content instances\n * carry their own dates instead; a param route's value is never inherited.\n */\n modifiedAt?: string | undefined;\n /** A static page's head, rendered by `seo.head`; the graph and `pageHeads` read it. */\n head?: SeoPageHead | undefined;\n /**\n * Full-title template for pages rendered through this route, with `%s` for the\n * page's own title (e.g. `\"%s | Example Blog\"`). `seoHead` applies it to the\n * title a dynamic route passes, and the graph applies it to the instances a\n * collection routes through it, so the suffix lives in one place.\n */\n titleTemplate?: string | undefined;\n}\n\n/** Apply a {@link RouteSeo.titleTemplate}; no template means the title is already full. */\nexport function applyTitleTemplate(template: string | undefined, title: string): string {\n // A replacer function keeps `$&` and friends in the title literal.\n return template === undefined ? title : template.replaceAll(\"%s\", () => title);\n}\n\ndeclare module \"@tanstack/react-router\" {\n interface StaticDataRouteOption {\n seo?: RouteSeo | undefined;\n }\n}\n"],"mappings":";;AAgIA,SAAgB,mBAAmB,UAA8B,OAAuB;CAEtF,OAAO,aAAa,KAAA,IAAY,QAAQ,SAAS,WAAW,YAAY,KAAK;AAC/E"}
1
+ {"version":3,"file":"declare-D5o7hwmv.js","names":[],"sources":["../src/core/declare.ts"],"sourcesContent":["/**\n * The declaration surface: what a route says about itself in\n * `staticData.seo`. Everything else in this package derives from it.\n *\n * Consumers supply valid route paths, page kinds, and authored fact ids by\n * augmenting {@link Register}, the same pattern TanStack Router uses for its own\n * typed registry. Unaugmented, these fall back to `string`, so the package\n * compiles and behaves on its own.\n */\n\nimport type { AnyRouteMatch } from \"@tanstack/react-router\";\nimport type { Graph, Thing, WithContext } from \"schema-dts\";\n\n/**\n * Consumer-augmented registry.\n *\n * ```ts\n * declare module \"pagegraph\" {\n * interface Register {\n * paths: FileRouteTypes[\"fullPaths\"];\n * kinds: \"page\" | \"article\" | \"hub\";\n * facts: typeof facts;\n * }\n * }\n * ```\n */\nexport interface Register {}\n\n/** Every public full path in the consumer's route tree (type-only; erased at runtime). */\nexport type PublicPath = Register extends { paths: infer P extends string } ? P : string;\n\n/** The consumer's page taxonomy. A label: nothing in the core branches on it. */\nexport type SeoKind = Register extends { kinds: infer K extends string } ? K : string;\n\nexport interface SitemapPolicy {\n priority: number;\n changeFrequency: \"weekly\" | \"monthly\";\n}\n\n/** A question and answer the page shows and marks up as FAQPage. */\nexport interface SeoFaq {\n question: string;\n answer: string;\n category?: string | undefined;\n isHighlighted?: boolean | undefined;\n}\n\n/** A top-level JSON-LD entity or graph ready to serialize into a script element. */\nexport type JsonLdDocument = WithContext<Thing> | Graph;\n\n/**\n * The document head a page ships. A static route declares it once in\n * `staticData.seo.head` and renders it with `seo.head` from `pagegraph/react`;\n * the graph, `pageHeads`, and the checks read the same title, description, and\n * FAQs. A dynamic route passes it to `seoHead(ctx, head)` from its `head()`.\n */\nexport interface SeoPageHead {\n /**\n * The page title. A route that declares {@link RouteSeo.titleTemplate} gets\n * it applied; otherwise this is the full `<title>`.\n */\n title: string;\n description: string;\n ogTitle?: string | undefined;\n ogDescription?: string | undefined;\n /** Override of the route's robots policy. */\n robots?: string | undefined;\n article?:\n | {\n publishedAt: string;\n modifiedAt?: string | undefined;\n author?: { name: string; url?: string | undefined } | undefined;\n image?: string | undefined;\n tags?: ReadonlyArray<string> | undefined;\n }\n | undefined;\n faqs?: ReadonlyArray<SeoFaq> | undefined;\n service?: { name: string; description?: string | undefined; serviceType: string } | undefined;\n /** Standalone keywords meta for non-article pages; article pages derive it from tags. */\n keywords?: ReadonlyArray<string> | undefined;\n /** Visible canonical pages rendered as an ordered collection on this page. */\n itemList?: { name: string; items: ReadonlyArray<{ name: string; url: string }> } | undefined;\n /** Additional schema.org documents for this route. */\n jsonLd?: ReadonlyArray<JsonLdDocument> | undefined;\n /**\n * Explicit canonical path (used for canonical + og:url instead of the match pathname).\n * For routes whose canonical is computed independently of the URL, e.g. a docs splat\n * that derives it from the resolved slug segments in its loader.\n */\n canonicalPath?: string | undefined;\n /**\n * Explicit breadcrumb trail for the BreadcrumbList JSON-LD, overriding the match-chain\n * trail. For routes whose hierarchy lives outside the route tree. Each `path` is a URL path.\n */\n breadcrumbs?: ReadonlyArray<{ name: string; path: string }> | undefined;\n}\n\nexport interface RouteSeo {\n kind: SeoKind;\n /** Breadcrumb label; fn form reads the match (e.g. loaderData frontmatter title). */\n crumb?: string | ((match: AnyRouteMatch) => string) | undefined;\n /** false = excluded from sitemap. Absent on non-indexable kinds is fine. */\n sitemap?: SitemapPolicy | false | undefined;\n /** meta robots value, e.g. \"noindex, follow\" on a hub page. */\n robots?: string | undefined;\n /** Typed cross-link edges. */\n related?: ReadonlyArray<PublicPath> | undefined;\n /** How OTHER pages render a card for this page. */\n link?: { title: string; description: string } | undefined;\n /** This route is a redirect/alias. */\n redirectTo?: PublicPath | undefined;\n /**\n * When this page's content last changed meaningfully, as an ISO 8601 date.\n * Feeds the sitemap `<lastmod>` and the freshness report. Content instances\n * carry their own dates instead; a param route's value is never inherited.\n */\n modifiedAt?: string | undefined;\n /** A static page's head, rendered by `seo.head`; the graph and `pageHeads` read it. */\n head?: SeoPageHead | undefined;\n /**\n * Full-title template for pages rendered through this route, with `%s` for the\n * page's own title (e.g. `\"%s | Example Blog\"`). `seoHead` applies it to the\n * title a dynamic route passes, and the graph applies it to the instances a\n * collection routes through it, so the suffix lives in one place.\n */\n titleTemplate?: string | undefined;\n}\n\n/** Apply a {@link RouteSeo.titleTemplate}; no template means the title is already full. */\nexport function applyTitleTemplate(template: string | undefined, title: string): string {\n // A replacer function keeps `$&` and friends in the title literal.\n return template === undefined ? title : template.replaceAll(\"%s\", () => title);\n}\n\ndeclare module \"@tanstack/react-router\" {\n interface StaticDataRouteOption {\n seo?: RouteSeo | undefined;\n /** How this route supplies its authored document. */\n markdown?: \"rendered\" | \"source\" | undefined;\n /** Group label for this page in llms.txt. */\n llms?: string | undefined;\n }\n}\n"],"mappings":";;AAiIA,SAAgB,mBAAmB,UAA8B,OAAuB;CAEtF,OAAO,aAAa,KAAA,IAAY,QAAQ,SAAS,WAAW,YAAY,KAAK;AAC/E"}
@@ -0,0 +1,108 @@
1
+ //#region node_modules/@earendil-works/pi-ai/dist/utils/event-stream.js
2
+ var FifoQueue = class {
3
+ incoming = [];
4
+ outgoing = [];
5
+ get length() {
6
+ return this.incoming.length + this.outgoing.length;
7
+ }
8
+ enqueue(value) {
9
+ this.incoming.push(value);
10
+ }
11
+ dequeue() {
12
+ if (this.outgoing.length === 0) while (this.incoming.length > 0) this.outgoing.push(this.incoming.pop());
13
+ return this.outgoing.pop();
14
+ }
15
+ };
16
+ var EventStream = class {
17
+ queue = new FifoQueue();
18
+ waiting = new FifoQueue();
19
+ done = false;
20
+ finalResultPromise;
21
+ resolveFinalResult;
22
+ isComplete;
23
+ extractResult;
24
+ constructor(isComplete, extractResult) {
25
+ this.isComplete = isComplete;
26
+ this.extractResult = extractResult;
27
+ this.finalResultPromise = new Promise((resolve) => {
28
+ this.resolveFinalResult = resolve;
29
+ });
30
+ }
31
+ push(event) {
32
+ if (this.done) return;
33
+ if (this.isComplete(event)) {
34
+ this.done = true;
35
+ this.resolveFinalResult(this.extractResult(event));
36
+ }
37
+ const waiter = this.waiting.dequeue();
38
+ if (waiter) waiter({
39
+ value: event,
40
+ done: false
41
+ });
42
+ else this.queue.enqueue(event);
43
+ }
44
+ end(result) {
45
+ this.done = true;
46
+ if (result !== void 0) this.resolveFinalResult(result);
47
+ while (this.waiting.length > 0) this.waiting.dequeue()({
48
+ value: void 0,
49
+ done: true
50
+ });
51
+ }
52
+ async *[Symbol.asyncIterator]() {
53
+ while (true) if (this.queue.length > 0) yield this.queue.dequeue();
54
+ else if (this.done) return;
55
+ else {
56
+ const result = await new Promise((resolve) => this.waiting.enqueue(resolve));
57
+ if (result.done) return;
58
+ yield result.value;
59
+ }
60
+ }
61
+ result() {
62
+ return this.finalResultPromise;
63
+ }
64
+ };
65
+ var AssistantMessageEventStream = class extends EventStream {
66
+ constructor() {
67
+ super((event) => event.type === "done" || event.type === "error", (event) => {
68
+ if (event.type === "done") return event.message;
69
+ else if (event.type === "error") return event.error;
70
+ throw new Error("Unexpected event type for final result");
71
+ });
72
+ }
73
+ };
74
+ //#endregion
75
+ //#region node_modules/@earendil-works/pi-ai/dist/utils/diagnostics.js
76
+ function formatThrownValue(value) {
77
+ if (value instanceof Error) return value.message || value.name;
78
+ if (typeof value === "string") return value;
79
+ return String(value);
80
+ }
81
+ function extractDiagnosticError(error) {
82
+ if (!(error instanceof Error)) return {
83
+ name: "ThrownValue",
84
+ message: formatThrownValue(error)
85
+ };
86
+ const code = error.code;
87
+ return {
88
+ name: error.name || void 0,
89
+ message: error.message || error.name,
90
+ stack: error.stack,
91
+ code: typeof code === "string" || typeof code === "number" ? code : void 0
92
+ };
93
+ }
94
+ function createAssistantMessageDiagnostic(type, error, details) {
95
+ return {
96
+ type,
97
+ timestamp: Date.now(),
98
+ error: extractDiagnosticError(error),
99
+ details
100
+ };
101
+ }
102
+ function appendAssistantMessageDiagnostic(message, diagnostic) {
103
+ message.diagnostics = [...message.diagnostics ?? [], diagnostic];
104
+ }
105
+ //#endregion
106
+ export { AssistantMessageEventStream as a, formatThrownValue as i, createAssistantMessageDiagnostic as n, EventStream as o, extractDiagnosticError as r, appendAssistantMessageDiagnostic as t };
107
+
108
+ //# sourceMappingURL=diagnostics-Wt5faNDM.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diagnostics-Wt5faNDM.js","names":[],"sources":["../node_modules/@earendil-works/pi-ai/dist/utils/event-stream.js","../node_modules/@earendil-works/pi-ai/dist/utils/diagnostics.js"],"sourcesContent":["class FifoQueue {\n incoming = [];\n outgoing = [];\n get length() {\n return this.incoming.length + this.outgoing.length;\n }\n enqueue(value) {\n this.incoming.push(value);\n }\n dequeue() {\n if (this.outgoing.length === 0) {\n while (this.incoming.length > 0) {\n this.outgoing.push(this.incoming.pop());\n }\n }\n return this.outgoing.pop();\n }\n}\n// Generic event stream class for async iteration\nexport class EventStream {\n queue = new FifoQueue();\n waiting = new FifoQueue();\n done = false;\n finalResultPromise;\n resolveFinalResult;\n isComplete;\n extractResult;\n constructor(isComplete, extractResult) {\n this.isComplete = isComplete;\n this.extractResult = extractResult;\n this.finalResultPromise = new Promise((resolve) => {\n this.resolveFinalResult = resolve;\n });\n }\n push(event) {\n if (this.done)\n return;\n if (this.isComplete(event)) {\n this.done = true;\n this.resolveFinalResult(this.extractResult(event));\n }\n // Deliver to waiting consumer or queue it\n const waiter = this.waiting.dequeue();\n if (waiter) {\n waiter({ value: event, done: false });\n }\n else {\n this.queue.enqueue(event);\n }\n }\n end(result) {\n this.done = true;\n if (result !== undefined) {\n this.resolveFinalResult(result);\n }\n // Notify all waiting consumers that we're done\n while (this.waiting.length > 0) {\n const waiter = this.waiting.dequeue();\n waiter({ value: undefined, done: true });\n }\n }\n async *[Symbol.asyncIterator]() {\n while (true) {\n if (this.queue.length > 0) {\n yield this.queue.dequeue();\n }\n else if (this.done) {\n return;\n }\n else {\n const result = await new Promise((resolve) => this.waiting.enqueue(resolve));\n if (result.done)\n return;\n yield result.value;\n }\n }\n }\n result() {\n return this.finalResultPromise;\n }\n}\nexport class AssistantMessageEventStream extends EventStream {\n constructor() {\n super((event) => event.type === \"done\" || event.type === \"error\", (event) => {\n if (event.type === \"done\") {\n return event.message;\n }\n else if (event.type === \"error\") {\n return event.error;\n }\n throw new Error(\"Unexpected event type for final result\");\n });\n }\n}\n/** Factory function for AssistantMessageEventStream (for use in extensions) */\nexport function createAssistantMessageEventStream() {\n return new AssistantMessageEventStream();\n}\n//# sourceMappingURL=event-stream.js.map","export function formatThrownValue(value) {\n if (value instanceof Error)\n return value.message || value.name;\n if (typeof value === \"string\")\n return value;\n return String(value);\n}\nexport function extractDiagnosticError(error) {\n if (!(error instanceof Error))\n return { name: \"ThrownValue\", message: formatThrownValue(error) };\n const code = error.code;\n return {\n name: error.name || undefined,\n message: error.message || error.name,\n stack: error.stack,\n code: typeof code === \"string\" || typeof code === \"number\" ? code : undefined,\n };\n}\nexport function createAssistantMessageDiagnostic(type, error, details) {\n return { type, timestamp: Date.now(), error: extractDiagnosticError(error), details };\n}\nexport function appendAssistantMessageDiagnostic(message, diagnostic) {\n message.diagnostics = [...(message.diagnostics ?? []), diag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