@sonordev/site-kit 7.4.0 → 8.0.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 (227) hide show
  1. package/AGENTS.md +40 -12
  2. package/CHANGELOG.md +67 -0
  3. package/README.md +44 -18
  4. package/agent-manifest.json +111 -56
  5. package/dist/AnalyticsProvider-LYFDQRRJ.js +13 -0
  6. package/dist/{ArticleViewTracker-3DH53RSB.js → ArticleViewTracker-HG7IIRJY.js} +6 -5
  7. package/dist/{BlocksPopup-FGWYVHCH.js → BlocksPopup-GFX3GZIK.js} +6 -5
  8. package/dist/{ChatWidget-CDQZCLVH.js → ChatWidget-DVS7MLBN.js} +8 -5
  9. package/dist/{FileField-IPJ7L2W6.js → FileField-DVN7NUBI.js} +5 -5
  10. package/dist/{FormSpotlight-CQI2DBWI.js → FormSpotlight-W4SXKKO6.js} +3 -3
  11. package/dist/{FormStage-4WHD6ED4.js → FormStage-JTEE5MZD.js} +3 -3
  12. package/dist/ManagedForm-ZAUHIHGP.js +19 -0
  13. package/dist/{ManagedNewsletterForm-3D2BK3KQ.js → ManagedNewsletterForm-DQIB5Z4Y.js} +9 -6
  14. package/dist/{SignalCore-HEQYITTM.js → SignalCore-W5PYYMGX.js} +7 -7
  15. package/dist/SiteChat-MY2GATWC.js +6 -0
  16. package/dist/SiteDesignReporter-ICZWEGCY.js +12 -0
  17. package/dist/SitePopups-TGULLAER.js +13 -0
  18. package/dist/SitemapSync-AN2OBJE6.js +9 -0
  19. package/dist/_client/booking-widget.js +6 -5
  20. package/dist/_client/testimonial-section.js +3 -2
  21. package/dist/affiliates/index.js +6 -6
  22. package/dist/analytics/index.js +73 -7
  23. package/dist/articles/index.js +2 -2
  24. package/dist/articles/server-ui.js +3 -3
  25. package/dist/articles/server.js +2 -2
  26. package/dist/brand.css +1 -1
  27. package/dist/chat/index.d.ts +1 -1
  28. package/dist/chat/index.js +39 -8
  29. package/dist/chunk-3G7YABRA.js +25 -0
  30. package/dist/{chunk-CGWUXUYZ.js → chunk-3RDJKIYO.js} +2 -2
  31. package/dist/{chunk-J4FSB4OG.js → chunk-3YKQLC7J.js} +5 -2
  32. package/dist/{chunk-3E3PPSNR.js → chunk-56VDS2RP.js} +2 -2
  33. package/dist/chunk-5ROTTMBL.js +19 -0
  34. package/dist/{chunk-KHQ5GD6T.js → chunk-5S2XDG5O.js} +1 -1
  35. package/dist/chunk-5TM3WPCI.js +7 -0
  36. package/dist/{chunk-7HPZSWS4.js → chunk-6CJGZFOU.js} +1 -1
  37. package/dist/{chunk-RYVDGXC2.js → chunk-6KU7STM3.js} +3 -1
  38. package/dist/{chunk-FUQTV5O6.js → chunk-6QFINXLH.js} +3 -3
  39. package/dist/{chunk-AH4AXO4P.js → chunk-6ZXJ3SXR.js} +1 -1
  40. package/dist/{chunk-XA2BNW5M.js → chunk-7YEEOIWI.js} +1 -1
  41. package/dist/{chunk-IE5SSOCN.js → chunk-BQ2CXKTQ.js} +3 -11
  42. package/dist/{chunk-X6F6SO4S.js → chunk-C7TLGL3R.js} +21 -1
  43. package/dist/{chunk-43OCZ3JA.js → chunk-CAH4Y4PY.js} +4 -2
  44. package/dist/{chunk-PXKIGZ2F.js → chunk-EATJPSTS.js} +1 -1
  45. package/dist/{chunk-OOD6GMT4.js → chunk-GNSXOTIK.js} +6 -4
  46. package/dist/{chunk-EHR4NIMX.js → chunk-ICAVVF6D.js} +3 -3
  47. package/dist/{chunk-MHGAZ3LL.js → chunk-IJQ767JS.js} +3 -5
  48. package/dist/{chunk-CKW4HFJG.js → chunk-J65N34YM.js} +3 -3
  49. package/dist/{chunk-4BHRA7TI.js → chunk-JIH32RH2.js} +3 -3
  50. package/dist/{chunk-D2RGEWHS.js → chunk-K22OLAPC.js} +2 -2
  51. package/dist/{chunk-CG4ETW5Y.js → chunk-KRBBH64S.js} +3 -3
  52. package/dist/{chunk-JRCNUUNG.js → chunk-LBIQ5LTC.js} +1 -1
  53. package/dist/{chunk-MDP7EB4J.js → chunk-LKH44GI3.js} +5 -5
  54. package/dist/{chunk-ZTLMPUO6.js → chunk-LNSF6BJC.js} +1 -1
  55. package/dist/{chunk-5O62CER4.js → chunk-M62U7TJF.js} +1 -1
  56. package/dist/{chunk-EDYHROQ7.js → chunk-NFRJTOTB.js} +3 -3
  57. package/dist/{chunk-4DJMJ4V5.js → chunk-OE3NXEOF.js} +1 -1
  58. package/dist/{chunk-AV4QAK5F.js → chunk-OGK7OL3T.js} +5 -4
  59. package/dist/{chunk-YCFW2OQO.js → chunk-PD7K54EQ.js} +2 -2
  60. package/dist/{chunk-PF64OEXC.js → chunk-PIX7FAMX.js} +2 -2
  61. package/dist/{chunk-XEMHGJEG.js → chunk-ROAOI6GG.js} +10 -10
  62. package/dist/{chunk-6LLTLLEJ.js → chunk-S7SSYGUJ.js} +6 -5
  63. package/dist/{chunk-ATE6IFVK.js → chunk-SBPAXWLF.js} +1 -1
  64. package/dist/{chunk-DA5XC7Y6.js → chunk-TOSZGJEQ.js} +1 -1
  65. package/dist/{chunk-4NTBQNHA.js → chunk-TYAVHRWH.js} +80 -81
  66. package/dist/{chunk-ZTLU3BSW.js → chunk-TZ5RTANX.js} +2 -2
  67. package/dist/{chunk-4YTYGG2C.js → chunk-URJN75ZG.js} +29 -16
  68. package/dist/{chunk-CSN45MHO.js → chunk-UUWUAMUC.js} +13 -16
  69. package/dist/{chunk-PKGN32AU.js → chunk-XPTJRVL2.js} +1 -1
  70. package/dist/{chunk-662ILEZ6.js → chunk-Y35BWW2C.js} +3 -7
  71. package/dist/{chunk-PQDJNIHR.js → chunk-ZHNQFNO3.js} +2 -2
  72. package/dist/chunk-ZKADJNR2.js +52 -0
  73. package/dist/{chunk-GK7TV7EK.js → chunk-ZLFGXKLG.js} +1 -1
  74. package/dist/client/index.js +6 -5
  75. package/dist/contracts/entries.d.ts +1 -1
  76. package/dist/contracts/sentences.d.ts +46 -0
  77. package/dist/contracts/site-cache.d.ts +2 -0
  78. package/dist/cta-bar/index.js +1 -1
  79. package/dist/fleet/index.js +6 -5
  80. package/dist/forms/field-autocomplete.d.ts +16 -8
  81. package/dist/forms/index.d.ts +5 -0
  82. package/dist/forms/index.js +17 -17
  83. package/dist/forms/server.js +7 -7
  84. package/dist/forms/static.js +2 -2
  85. package/dist/forms/submitForm.d.ts +5 -0
  86. package/dist/images/index.js +4 -4
  87. package/dist/index.d.ts +3 -7
  88. package/dist/index.js +1 -1
  89. package/dist/layout/SiteKitLayout.d.ts +2 -1
  90. package/dist/layout/client.js +11 -9
  91. package/dist/layout/index.js +13 -11
  92. package/dist/llms/index.js +7 -6
  93. package/dist/maps/index.js +6 -6
  94. package/dist/mcp/sonor.d.ts +47 -3
  95. package/dist/mcp/sonor.js +30 -20
  96. package/dist/proxy/index.d.ts +3 -3
  97. package/dist/proxy/index.js +1 -1
  98. package/dist/reputation/index.js +3 -2
  99. package/dist/reputation/server.js +2 -1
  100. package/dist/revalidate/index.js +3 -3
  101. package/dist/robots/indexnow.js +2 -2
  102. package/dist/runtime/index.d.ts +32 -0
  103. package/dist/runtime/index.js +7 -0
  104. package/dist/seo/api.d.ts +0 -4
  105. package/dist/seo/client.js +6 -5
  106. package/dist/seo/getManagedMetadata.d.ts +24 -0
  107. package/dist/seo/index.d.ts +2 -3
  108. package/dist/seo/index.js +14 -132
  109. package/dist/seo/indexnow.js +2 -2
  110. package/dist/seo/llms.js +7 -6
  111. package/dist/seo/register-sitemap-cli.js +2 -2
  112. package/dist/seo/server-api.d.ts +0 -6
  113. package/dist/seo/server.d.ts +1 -1
  114. package/dist/seo/server.js +4 -4
  115. package/dist/seo/sitemap.js +4 -3
  116. package/dist/seo/types.d.ts +9 -30
  117. package/dist/server/index.d.ts +8 -1
  118. package/dist/server/index.js +4 -3
  119. package/dist/server/mint-site-token.d.ts +0 -11
  120. package/dist/server/server-fetch.d.ts +19 -0
  121. package/dist/server-api-EGOKC7Q3.js +9 -0
  122. package/dist/shared/build-entries.d.ts +21 -9
  123. package/dist/shared/clientApiConfig.d.ts +56 -0
  124. package/dist/shared/identity-reader.d.ts +26 -0
  125. package/dist/shared/identity-storage.d.ts +30 -0
  126. package/dist/shared/identity.d.ts +13 -13
  127. package/dist/shared/import-specifiers.d.ts +26 -0
  128. package/dist/shared/sonorFetch.d.ts +4 -3
  129. package/dist/shared/version.d.ts +1 -1
  130. package/dist/signal/index.js +2 -2
  131. package/dist/sitemap/index.js +4 -3
  132. package/dist/slots/index.js +3 -3
  133. package/dist/sync/index.js +6 -5
  134. package/dist/types.d.ts +0 -1
  135. package/dist/website/cta-bar.js +1 -1
  136. package/dist/website/images.js +4 -4
  137. package/dist/website/index.js +7 -6
  138. package/dist/website/popups.js +10 -7
  139. package/dist/website/slots.js +3 -3
  140. package/dist/{writeLLMsTxt-OL4KQERZ.js → writeLLMsTxt-UZGN6IBU.js} +3 -2
  141. package/docs/MIGRATING-TO-7.md +5 -2
  142. package/docs/MIGRATING-TO-8.md +183 -0
  143. package/docs.json +4 -8
  144. package/package.json +15 -44
  145. package/skills/site-kit/SKILL.md +41 -11
  146. package/src/analytics/README.md +14 -14
  147. package/src/chat/README.md +7 -7
  148. package/src/forms/README.md +61 -6
  149. package/src/mcp/README.md +61 -20
  150. package/src/proxy/README.md +5 -4
  151. package/src/revalidate/README.md +2 -2
  152. package/src/runtime/README.md +51 -0
  153. package/src/seo/README.md +24 -8
  154. package/src/sync/README.md +2 -2
  155. package/src/website/README.md +3 -2
  156. package/dist/AnalyticsProvider-BQXV3ZF3.js +0 -11
  157. package/dist/ManagedForm-7FZNH4L2.js +0 -16
  158. package/dist/SiteChat-DMPDXY3W.js +0 -5
  159. package/dist/SiteDesignReporter-Y2IOJE52.js +0 -11
  160. package/dist/SitePopups-HD2LDKVU.js +0 -10
  161. package/dist/SitemapSync-OKPZHRX6.js +0 -8
  162. package/dist/chunk-24QZEO3Q.js +0 -41
  163. package/dist/chunk-BU66S5B7.js +0 -1
  164. package/dist/chunk-G3NHWMP5.js +0 -233
  165. package/dist/chunk-HODO5BX5.js +0 -28
  166. package/dist/chunk-L3AQCDCY.js +0 -386
  167. package/dist/chunk-P5GB6NEO.js +0 -66
  168. package/dist/chunk-SWKE6FWH.js +0 -47
  169. package/dist/cms/CmsPage.d.ts +0 -17
  170. package/dist/cms/CmsPreview.d.ts +0 -37
  171. package/dist/cms/CmsSection.d.ts +0 -8
  172. package/dist/cms/PortableTextRenderer.d.ts +0 -7
  173. package/dist/cms/index.d.ts +0 -37
  174. package/dist/cms/index.js +0 -5
  175. package/dist/cms/sanity-image.d.ts +0 -47
  176. package/dist/cms/sections/CtaSection.d.ts +0 -3
  177. package/dist/cms/sections/CustomSection.d.ts +0 -7
  178. package/dist/cms/sections/FaqSection.d.ts +0 -3
  179. package/dist/cms/sections/FormSection.d.ts +0 -8
  180. package/dist/cms/sections/GallerySection.d.ts +0 -3
  181. package/dist/cms/sections/HeroSection.d.ts +0 -3
  182. package/dist/cms/sections/RichTextSection.d.ts +0 -3
  183. package/dist/cms/sections/TestimonialsSection.d.ts +0 -3
  184. package/dist/cms/sections/index.d.ts +0 -8
  185. package/dist/cms/server-api.d.ts +0 -49
  186. package/dist/cms/server.d.ts +0 -1
  187. package/dist/cms/server.js +0 -5
  188. package/dist/cms/types.d.ts +0 -104
  189. package/dist/commerce/CalendarView.d.ts +0 -43
  190. package/dist/commerce/CheckoutForm.d.ts +0 -11
  191. package/dist/commerce/EventCalendar.d.ts +0 -26
  192. package/dist/commerce/EventCheckout.d.ts +0 -42
  193. package/dist/commerce/EventEmbed.d.ts +0 -11
  194. package/dist/commerce/EventModal.d.ts +0 -43
  195. package/dist/commerce/EventTile.d.ts +0 -10
  196. package/dist/commerce/EventsAgenda.d.ts +0 -38
  197. package/dist/commerce/EventsWidget.d.ts +0 -84
  198. package/dist/commerce/OfferingCard.d.ts +0 -9
  199. package/dist/commerce/OfferingList.d.ts +0 -9
  200. package/dist/commerce/ProductDetail.d.ts +0 -38
  201. package/dist/commerce/ProductEmbed.d.ts +0 -11
  202. package/dist/commerce/ProductGrid.d.ts +0 -41
  203. package/dist/commerce/ProductPage.d.ts +0 -39
  204. package/dist/commerce/RegistrationForm.d.ts +0 -9
  205. package/dist/commerce/SizeChart.d.ts +0 -8
  206. package/dist/commerce/UpcomingEvents.d.ts +0 -9
  207. package/dist/commerce/api.d.ts +0 -179
  208. package/dist/commerce/events-extras.d.ts +0 -60
  209. package/dist/commerce/index.d.ts +0 -33
  210. package/dist/commerce/index.js +0 -8022
  211. package/dist/commerce/server.d.ts +0 -161
  212. package/dist/commerce/server.js +0 -2
  213. package/dist/commerce/types.d.ts +0 -340
  214. package/dist/commerce/useEventModal.d.ts +0 -20
  215. package/dist/commerce/utils.d.ts +0 -17
  216. package/dist/engage/EngageWidget.d.ts +0 -21
  217. package/dist/engage/index.d.ts +0 -14
  218. package/dist/engage/index.js +0 -45
  219. package/dist/engage/types.d.ts +0 -33
  220. package/dist/seo/ManagedContent.d.ts +0 -14
  221. package/dist/server-api-BVCBLJKL.js +0 -9
  222. package/dist/website/cms/server.d.ts +0 -2
  223. package/dist/website/cms/server.js +0 -5
  224. package/dist/website/cms-server.d.ts +0 -2
  225. package/dist/website/cms.d.ts +0 -2
  226. package/dist/website/cms.js +0 -5
  227. package/src/commerce/README.md +0 -109
@@ -1,4 +1,27 @@
1
+ import type { Metadata } from 'next';
1
2
  import type { GetManagedMetadataOptions, ManagedMetadataResult, GetABVariantOptions, ABTestResult } from './types';
3
+ /**
4
+ * The canonical every page gets when nobody says otherwise: itself.
5
+ *
6
+ * Relative on purpose. Next resolves './' against `metadataBase` AND the route
7
+ * being rendered, so one value is right in a page and also in a root layout,
8
+ * whose metadata every page beneath it inherits. An absolute canonical built
9
+ * from `path` is wrong in exactly that second case: a layout that asks for '/'
10
+ * stamps the homepage on every inner page, telling search engines each one is
11
+ * a copy of it. A site that sets nothing ships no canonical at all.
12
+ *
13
+ * Without a `metadataBase` Next emits the path alone ('/privacy'), which is
14
+ * still a valid canonical; with one it is absolute.
15
+ */
16
+ export declare const SELF_CANONICAL = "./";
17
+ type Alternates = NonNullable<Metadata['alternates']>;
18
+ /**
19
+ * Merge alternates key by key, later parts winning, so a page that supplies
20
+ * only `languages` keeps its canonical and one that supplies a canonical (or
21
+ * `null`, to opt out) replaces the default. Next replaces the whole
22
+ * `alternates` object otherwise.
23
+ */
24
+ export declare function mergeAlternates(...parts: Array<Metadata['alternates'] | undefined>): Alternates;
2
25
  /**
3
26
  * Get managed metadata for a page
4
27
  *
@@ -43,3 +66,4 @@ export declare function getABVariant(options: GetABVariantOptions): Promise<ABTe
43
66
  export declare function getManagedMetadataWithAB(options: GetManagedMetadataOptions & {
44
67
  sessionId?: string;
45
68
  }): Promise<ManagedMetadataResult>;
69
+ export {};
@@ -1,13 +1,12 @@
1
- export type { SonorSEOConfig, SEOPageData, GetManagedMetadataOptions, ManagedMetadataResult, SchemaMarkup, ManagedSchemaProps, FAQItem, ManagedFAQData, ManagedFAQProps, ManagedLink, ManagedInternalLinksProps, ManagedContentBlock, ManagedContentProps, ABTest, ABTestResult, GetABVariantOptions, ManagedRedirect, GetRedirectOptions, RedirectResult, ManagedScript, ManagedScriptsProps, RobotsDirective, GetRobotsOptions, SitemapEntry, GetSitemapEntriesOptions, } from './types';
1
+ export type { SonorSEOConfig, SEOPageData, GetManagedMetadataOptions, ManagedMetadataResult, SchemaMarkup, ManagedSchemaProps, FAQItem, ManagedFAQData, ManagedFAQProps, ManagedLink, ManagedInternalLinksProps, ABTest, ABTestResult, GetABVariantOptions, ManagedRedirect, GetRedirectOptions, RedirectResult, ManagedScript, ManagedScriptsProps, RobotsDirective, GetRobotsOptions, SitemapEntry, GetSitemapEntriesOptions, } from './types';
2
2
  export type { EntityType, SEOEntity, PageSeoContext, } from './server-api';
3
3
  export { getManagedMetadata, getManagedMetadataWithAB, getABVariant, } from './getManagedMetadata';
4
4
  export { withManagedMetadata } from './withManagedMetadata';
5
5
  export { getRedirect, getRobotsDirective, generateSitemap, isIndexable, } from './routing';
6
- export { getSEOPageData, getSchemaMarkups, getFAQData, getInternalLinks, getContentBlock, getABTest, recordABImpression, getRedirectData, getManagedScripts, getRobotsData, getSitemapEntries, registerSitemap, getEntities, getPrimaryEntity, getEntityEnhancedSchema, getVisibilityScore, getVisibilitySummary, } from './server-api';
6
+ export { getSEOPageData, getSchemaMarkups, getFAQData, getInternalLinks, getABTest, recordABImpression, getRedirectData, getManagedScripts, getRobotsData, getSitemapEntries, registerSitemap, getEntities, getPrimaryEntity, getEntityEnhancedSchema, getVisibilityScore, getVisibilitySummary, } from './server-api';
7
7
  export { ManagedSchema, LLMSchema, createSchema, createBreadcrumbSchema } from './ManagedSchema';
8
8
  export { createWebSiteOrganizationStub } from './groundingSchema';
9
9
  export { ManagedFAQ } from './ManagedFAQ';
10
10
  export { ManagedInternalLinks } from './ManagedInternalLinks';
11
- export { ManagedContent, getManagedContentData } from './ManagedContent';
12
11
  export { ManagedScripts, ManagedNoScripts } from './ManagedScripts';
13
12
  export { SitemapSync } from '../SitemapSync';
package/dist/seo/index.js CHANGED
@@ -2,25 +2,26 @@ export { ManagedNoScripts, ManagedScripts } from '../chunk-MVLMXC44.js';
2
2
  import { pickManagedLlmSchemaForJsonLd } from '../chunk-NZ4RXN3G.js';
3
3
  import { safeJsonLd } from '../chunk-4KZ6W3ZH.js';
4
4
  import { withoutSchemaPlaceholders } from '../chunk-VWWITFWM.js';
5
- export { SitemapSync } from '../chunk-D2RGEWHS.js';
6
- import { getManagedMetadata } from '../chunk-4YTYGG2C.js';
7
- export { generateSitemap, getABVariant, getManagedMetadata, getManagedMetadataWithAB, getRedirect, getRobotsDirective, isIndexable } from '../chunk-4YTYGG2C.js';
8
- import { getContentBlock, getSchemaMarkups, getSEOPageData, getEntityEnhancedSchema, getFAQData, getInternalLinks, getEntities, pruneSchemaTypes } from '../chunk-662ILEZ6.js';
9
- export { getABTest, getContentBlock, getEntities, getEntityEnhancedSchema, getFAQData, getInternalLinks, getManagedScripts, getPrimaryEntity, getRedirectData, getRobotsData, getSEOPageData, getSchemaMarkups, getSitemapEntries, getVisibilityScore, getVisibilitySummary, recordABImpression, registerSitemap } from '../chunk-662ILEZ6.js';
5
+ export { SitemapSync } from '../chunk-K22OLAPC.js';
6
+ import { getManagedMetadata, mergeAlternates } from '../chunk-URJN75ZG.js';
7
+ export { generateSitemap, getABVariant, getManagedMetadata, getManagedMetadataWithAB, getRedirect, getRobotsDirective, isIndexable } from '../chunk-URJN75ZG.js';
8
+ import { getSchemaMarkups, getSEOPageData, getEntityEnhancedSchema, getFAQData, getInternalLinks, pruneSchemaTypes } from '../chunk-Y35BWW2C.js';
9
+ export { getABTest, getEntities, getEntityEnhancedSchema, getFAQData, getInternalLinks, getManagedScripts, getPrimaryEntity, getRedirectData, getRobotsData, getSEOPageData, getSchemaMarkups, getSitemapEntries, getVisibilityScore, getVisibilitySummary, recordABImpression, registerSitemap } from '../chunk-Y35BWW2C.js';
10
10
  import '../chunk-BQR4IPBW.js';
11
- import '../chunk-RYVDGXC2.js';
12
11
  import '../chunk-MJP63SSS.js';
13
- import '../chunk-X6F6SO4S.js';
12
+ import '../chunk-6KU7STM3.js';
13
+ import '../chunk-C7TLGL3R.js';
14
14
  import '../chunk-MH2DSGC6.js';
15
15
  import '../chunk-YVKRYQRG.js';
16
16
  import '../chunk-DIKNRN34.js';
17
17
  import '../chunk-FESKKJAS.js';
18
18
  import '../chunk-A4CC4ZG3.js';
19
- import '../chunk-43OCZ3JA.js';
19
+ import '../chunk-CAH4Y4PY.js';
20
20
  import '../chunk-EKBEOXTH.js';
21
- import '../chunk-3E3PPSNR.js';
22
- import '../chunk-GK7TV7EK.js';
23
- import '../chunk-KHQ5GD6T.js';
21
+ import '../chunk-3G7YABRA.js';
22
+ import '../chunk-56VDS2RP.js';
23
+ import '../chunk-ZLFGXKLG.js';
24
+ import '../chunk-5S2XDG5O.js';
24
25
  import '../chunk-PKBMQBKP.js';
25
26
  import { Suspense } from 'react';
26
27
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
@@ -37,6 +38,7 @@ function withManagedMetadata(path, pageMetadata) {
37
38
  return {
38
39
  ...managed,
39
40
  ...pageSpecific,
41
+ alternates: mergeAlternates(managed.alternates, pageSpecific.alternates),
40
42
  openGraph: {
41
43
  ...managed.openGraph,
42
44
  ...pageSpecific.openGraph
@@ -475,125 +477,5 @@ async function ManagedInternalLinksAsync({
475
477
  function ManagedInternalLinks(props) {
476
478
  return /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(ManagedInternalLinksAsync, { ...props }) });
477
479
  }
478
- function renderMarkdown(content) {
479
- return content.replace(/^### (.*$)/gim, "<h3>$1</h3>").replace(/^## (.*$)/gim, "<h2>$1</h2>").replace(/^# (.*$)/gim, "<h1>$1</h1>").replace(/\*\*(.*)\*\*/gim, "<strong>$1</strong>").replace(/\*(.*)\*/gim, "<em>$1</em>").replace(/\[(.*?)\]\((.*?)\)/gim, '<a href="$2">$1</a>').replace(/\n\n/gim, "</p><p>").replace(/^(.+)$/gim, "<p>$1</p>");
480
- }
481
- function injectEntityAnnotations(html, entities) {
482
- if (!entities.length) return html;
483
- let annotatedHtml = html;
484
- const sortedEntities = [...entities].sort((a, b) => b.name.length - a.name.length);
485
- for (const entity of sortedEntities) {
486
- if (entity.name.length < 3) continue;
487
- const regex = new RegExp(
488
- `(?<![\\w-])(?<!data-sonor-entity=")${escapeRegExp(entity.name)}(?![\\w-])`,
489
- "gi"
490
- );
491
- const schemaType = getSchemaTypeForEntity(entity.entity_type);
492
- annotatedHtml = annotatedHtml.replace(regex, (match) => {
493
- return `<span class="aeo-entity aeo-entity-${entity.entity_type}" data-sonor-entity="${entity.id}" data-sonor-entity-type="${entity.entity_type}" data-sonor-entity-name="${entity.name}" itemscope itemtype="https://schema.org/${schemaType}"><span itemprop="name">${match}</span></span>`;
494
- });
495
- }
496
- return annotatedHtml;
497
- }
498
- function escapeRegExp(string) {
499
- return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
500
- }
501
- function getSchemaTypeForEntity(entityType) {
502
- const typeMap = {
503
- organization: "Organization",
504
- person: "Person",
505
- service: "Service",
506
- product: "Product",
507
- location: "Place",
508
- concept: "Thing",
509
- credential: "EducationalOccupationalCredential"
510
- };
511
- return typeMap[entityType] || "Thing";
512
- }
513
- async function ManagedContentAsync({
514
- path,
515
- section,
516
- fallback,
517
- className,
518
- components = {},
519
- injectEntityAnnotations: shouldInjectEntities = false,
520
- site
521
- }) {
522
- const block = await getContentBlock(path, section, site);
523
- if (!block) {
524
- if (fallback) {
525
- return /* @__PURE__ */ jsx(Fragment, { children: fallback });
526
- }
527
- return null;
528
- }
529
- let entities = [];
530
- if (shouldInjectEntities) {
531
- try {
532
- entities = await getEntities();
533
- } catch (err) {
534
- console.warn("@sonordev/seo: Failed to fetch entities for annotation:", err);
535
- }
536
- }
537
- const containerClass = className || `sk-content sk-content--${section}`;
538
- const processHtml = (html) => {
539
- if (shouldInjectEntities && entities.length > 0) {
540
- return injectEntityAnnotations(html, entities);
541
- }
542
- return html;
543
- };
544
- switch (block.content_type) {
545
- case "html":
546
- return /* @__PURE__ */ jsx(
547
- "div",
548
- {
549
- className: containerClass,
550
- dangerouslySetInnerHTML: { __html: processHtml(block.content) }
551
- }
552
- );
553
- case "markdown":
554
- const htmlContent = processHtml(renderMarkdown(block.content));
555
- return /* @__PURE__ */ jsx(
556
- "div",
557
- {
558
- className: containerClass,
559
- dangerouslySetInnerHTML: { __html: htmlContent }
560
- }
561
- );
562
- case "json":
563
- const jsonData = typeof block.content === "string" ? JSON.parse(block.content) : block.content;
564
- return /* @__PURE__ */ jsxs(
565
- "div",
566
- {
567
- className: containerClass,
568
- "data-content": JSON.stringify(jsonData),
569
- children: [
570
- jsonData.title && /* @__PURE__ */ jsx("h2", { children: jsonData.title }),
571
- jsonData.subtitle && /* @__PURE__ */ jsx("p", { className: "subtitle", children: jsonData.subtitle }),
572
- jsonData.content && /* @__PURE__ */ jsx("div", { dangerouslySetInnerHTML: { __html: jsonData.content } }),
573
- jsonData.items && /* @__PURE__ */ jsx("ul", { children: jsonData.items.map((item, index) => /* @__PURE__ */ jsx("li", { children: typeof item === "string" ? item : item.text }, index)) })
574
- ]
575
- }
576
- );
577
- case "react":
578
- const componentData = typeof block.content === "string" ? JSON.parse(block.content) : block.content;
579
- const componentName = componentData.component;
580
- const componentProps = componentData.props || {};
581
- const Component = components[componentName];
582
- if (!Component) {
583
- console.warn(`@sonordev/seo: Component "${componentName}" not found in components map`);
584
- return fallback ? /* @__PURE__ */ jsx(Fragment, { children: fallback }) : null;
585
- }
586
- return /* @__PURE__ */ jsx("div", { className: containerClass, children: /* @__PURE__ */ jsx(Component, { ...componentProps }) });
587
- default:
588
- console.warn(`@sonordev/seo: Unknown content type "${block.content_type}"`);
589
- return fallback ? /* @__PURE__ */ jsx(Fragment, { children: fallback }) : null;
590
- }
591
- }
592
- async function getManagedContentData(path, section, site) {
593
- return getContentBlock(path, section, site);
594
- }
595
- function ManagedContent(props) {
596
- return /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(ManagedContentAsync, { ...props }) });
597
- }
598
480
 
599
- export { LLMSchema, ManagedContent, ManagedFAQ, ManagedInternalLinks, ManagedSchema, createBreadcrumbSchema, createSchema, createWebSiteOrganizationStub, getManagedContentData, withManagedMetadata };
481
+ export { LLMSchema, ManagedFAQ, ManagedInternalLinks, ManagedSchema, createBreadcrumbSchema, createSchema, createWebSiteOrganizationStub, withManagedMetadata };
@@ -1,4 +1,4 @@
1
- export { GET, INDEXNOW_KEY_PATH, createIndexNowKeyRoute, fetchIndexNowKey } from '../chunk-PXKIGZ2F.js';
2
- import '../chunk-X6F6SO4S.js';
1
+ export { GET, INDEXNOW_KEY_PATH, createIndexNowKeyRoute, fetchIndexNowKey } from '../chunk-EATJPSTS.js';
2
+ import '../chunk-C7TLGL3R.js';
3
3
  import '../chunk-MH2DSGC6.js';
4
4
  import '../chunk-PKBMQBKP.js';
package/dist/seo/llms.js CHANGED
@@ -1,11 +1,11 @@
1
- export { createLLMsFullTxtHandler, createLLMsTxtHandler, formatSourcedFactsSection, llmsResponseHeaders } from '../chunk-5O62CER4.js';
1
+ export { createLLMsFullTxtHandler, createLLMsTxtHandler, formatSourcedFactsSection, llmsResponseHeaders } from '../chunk-M62U7TJF.js';
2
2
  export { buildAiDiscoveryHeaders, wantsLlmsDiscoveryLink } from '../chunk-PO2TRJPY.js';
3
3
  export { AI_RETRIEVAL_CRAWLERS, AI_TRAINING_CRAWLERS, buildAiCrawlerRules, createRobotsTxtHandler } from '../chunk-QLTDFUJ7.js';
4
- export { LEGACY_PUBLICATION_PATH, SEO_REVALIDATION_MAX_BODY_BYTES, SEO_REVALIDATION_MAX_ITEMS, createLlmsRevalidateHandler, createSeoRevalidationHandler, parseSeoRevalidationPayload } from '../chunk-XA2BNW5M.js';
5
- import '../chunk-XTRZGXB2.js';
4
+ export { LEGACY_PUBLICATION_PATH, SEO_REVALIDATION_MAX_BODY_BYTES, SEO_REVALIDATION_MAX_ITEMS, createLlmsRevalidateHandler, createSeoRevalidationHandler, parseSeoRevalidationPayload } from '../chunk-7YEEOIWI.js';
6
5
  export { AEOBlock, AEOCitedContent, AEOClaim, AEOComparison, AEODefinition, AEOEntity, AEOProvenanceList, AEOStep, AEOSteps, AEOSummary, DEFAULT_SPEAKABLE_SELECTORS, SpeakableSchema, createSpeakableSchema, getSpeakableSelectorsForPage } from '../chunk-PSAG45YF.js';
7
- export { AGENT_ACCESS_HEADING, appendAgentAccessSection, describesMcp, detectMcpServer, formatAgentAccessSection, generateLLMsFullTxt, generateLLMsTxt, writeLLMsTxtToPublic } from '../chunk-ZTLU3BSW.js';
8
- export { getBusinessInfo, getFAQItems, getLLMsData, getOptimizedLLMsTxt, getPageSummaries, getServices } from '../chunk-4BHRA7TI.js';
6
+ import '../chunk-XTRZGXB2.js';
7
+ export { AGENT_ACCESS_HEADING, appendAgentAccessSection, describesMcp, detectMcpServer, formatAgentAccessSection, generateLLMsFullTxt, generateLLMsTxt, writeLLMsTxtToPublic } from '../chunk-TZ5RTANX.js';
8
+ export { getBusinessInfo, getFAQItems, getLLMsData, getOptimizedLLMsTxt, getPageSummaries, getServices } from '../chunk-JIH32RH2.js';
9
9
  import '../chunk-L5UOHS6E.js';
10
10
  import '../chunk-WMVK77ND.js';
11
11
  import '../chunk-UAYAJPEP.js';
@@ -15,5 +15,6 @@ import '../chunk-MJP63SSS.js';
15
15
  import '../chunk-YVKRYQRG.js';
16
16
  import '../chunk-FESKKJAS.js';
17
17
  import '../chunk-A4CC4ZG3.js';
18
- import '../chunk-KHQ5GD6T.js';
18
+ import '../chunk-3G7YABRA.js';
19
+ import '../chunk-5S2XDG5O.js';
19
20
  import '../chunk-PKBMQBKP.js';
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
+ import { HEX_COLOR, colorLuminance, DARK_LUMINANCE } from '../chunk-S22FSH7C.js';
2
3
  import { findSitemapRoute, findAppDirForDiscovery, discoverNextJsRoutes } from '../chunk-ZEGVKVD5.js';
3
4
  import { inferPageType } from '../chunk-YVKRYQRG.js';
4
5
  import { resolveSyncSite, postRegisterSitemap } from '../chunk-DIKNRN34.js';
5
6
  import '../chunk-FESKKJAS.js';
6
7
  import '../chunk-A4CC4ZG3.js';
7
- import { HEX_COLOR, colorLuminance, DARK_LUMINANCE } from '../chunk-S22FSH7C.js';
8
8
  import '../chunk-PKBMQBKP.js';
9
9
  import fs, { existsSync, readFileSync } from 'fs';
10
10
  import path2 from 'path';
@@ -458,7 +458,7 @@ async function registerLocalSitemap(options) {
458
458
  }
459
459
  if (options.writeLlms && result.success) {
460
460
  try {
461
- const { writeLLMsTxtToPublic } = await import('../writeLLMsTxt-OL4KQERZ.js');
461
+ const { writeLLMsTxtToPublic } = await import('../writeLLMsTxt-UZGN6IBU.js');
462
462
  const written = await writeLLMsTxtToPublic({
463
463
  // Resolved here too: the sync's own `site` is scoped to the branch that
464
464
  // posts, and this runs on the skip path as well.
@@ -61,12 +61,6 @@ export declare const getInternalLinks: (sourcePath: string, options?: {
61
61
  limit?: number;
62
62
  site?: string;
63
63
  }) => Promise<any[]>;
64
- /**
65
- * Fetch content block - cached per request
66
- * @param site Sub-site host override; resolves from NEXT_PUBLIC_SITE_URL when omitted
67
- * @server-only
68
- */
69
- export declare const getContentBlock: (path: string, section: string, site?: string) => Promise<any>;
70
64
  /**
71
65
  * Fetch A/B test and determine variant - cached per request
72
66
  * @server-only
@@ -1,4 +1,4 @@
1
- export { getSEOPageData, getSchemaMarkups, getFAQData, getInternalLinks, getContentBlock, getABTest, recordABImpression, getRedirectData, getManagedScripts, getRobotsData, getSitemapEntries, registerSitemap, } from './server-api';
1
+ export { getSEOPageData, getSchemaMarkups, getFAQData, getInternalLinks, getABTest, recordABImpression, getRedirectData, getManagedScripts, getRobotsData, getSitemapEntries, registerSitemap, } from './server-api';
2
2
  export { getManagedMetadata, getManagedMetadataWithAB, } from './getManagedMetadata';
3
3
  export { generateSitemap, registerLocalSitemap, } from './routing';
4
4
  export type * from './types';
@@ -1,9 +1,9 @@
1
- export { generateSitemap, getManagedMetadata, getManagedMetadataWithAB, registerLocalSitemap } from '../chunk-4YTYGG2C.js';
2
- export { getABTest, getContentBlock, getFAQData, getInternalLinks, getManagedScripts, getRedirectData, getRobotsData, getSEOPageData, getSchemaMarkups, getSitemapEntries, recordABImpression, registerSitemap } from '../chunk-662ILEZ6.js';
1
+ export { generateSitemap, getManagedMetadata, getManagedMetadataWithAB, registerLocalSitemap } from '../chunk-URJN75ZG.js';
2
+ export { getABTest, getFAQData, getInternalLinks, getManagedScripts, getRedirectData, getRobotsData, getSEOPageData, getSchemaMarkups, getSitemapEntries, recordABImpression, registerSitemap } from '../chunk-Y35BWW2C.js';
3
3
  import '../chunk-BQR4IPBW.js';
4
- import '../chunk-RYVDGXC2.js';
5
4
  import '../chunk-MJP63SSS.js';
6
- import '../chunk-X6F6SO4S.js';
5
+ import '../chunk-6KU7STM3.js';
6
+ import '../chunk-C7TLGL3R.js';
7
7
  import '../chunk-MH2DSGC6.js';
8
8
  import '../chunk-DIKNRN34.js';
9
9
  import '../chunk-FESKKJAS.js';
@@ -1,7 +1,7 @@
1
- export { createSitemap, getPortfolioPaths, syncSitemapToPortal } from '../chunk-4DJMJ4V5.js';
1
+ export { createSitemap, getPortfolioPaths, syncSitemapToPortal } from '../chunk-OE3NXEOF.js';
2
+ import '../chunk-TZ5RTANX.js';
3
+ import '../chunk-JIH32RH2.js';
2
4
  import '../chunk-Z22QVHT4.js';
3
- import '../chunk-ZTLU3BSW.js';
4
- import '../chunk-4BHRA7TI.js';
5
5
  import '../chunk-L5UOHS6E.js';
6
6
  import '../chunk-WMVK77ND.js';
7
7
  import '../chunk-UAYAJPEP.js';
@@ -12,4 +12,5 @@ import '../chunk-YVKRYQRG.js';
12
12
  import '../chunk-DIKNRN34.js';
13
13
  import '../chunk-FESKKJAS.js';
14
14
  import '../chunk-A4CC4ZG3.js';
15
+ import '../chunk-3G7YABRA.js';
15
16
  import '../chunk-PKBMQBKP.js';
@@ -43,6 +43,15 @@ export interface GetManagedMetadataOptions {
43
43
  * Default: 'metadata' (icons included from project logo_url).
44
44
  */
45
45
  favicon?: 'metadata' | 'component';
46
+ /**
47
+ * Where this call lives. 'page' (default): Sonor's managed canonical and
48
+ * hreflang for `path` apply. 'layout': pass this when calling from a root or
49
+ * shared layout, whose metadata every route beneath it inherits; the page
50
+ * then gets the self-referencing default canonical and nothing path-specific.
51
+ * Either way a page with no managed canonical gets `alternates.canonical: './'`
52
+ * (its own URL, resolved against `metadataBase`).
53
+ */
54
+ scope?: 'page' | 'layout';
46
55
  }
47
56
  export interface ManagedMetadataResult extends Metadata {
48
57
  _managed: boolean;
@@ -143,36 +152,6 @@ export interface ManagedInternalLinksProps {
143
152
  */
144
153
  site?: string;
145
154
  }
146
- export interface ManagedContentBlock {
147
- id: string;
148
- project_id: string;
149
- path: string;
150
- section: string;
151
- content_type: 'html' | 'markdown' | 'json' | 'react';
152
- content: string | Record<string, unknown>;
153
- is_published: boolean;
154
- published_at?: string;
155
- updated_at: string;
156
- }
157
- export interface ManagedContentProps {
158
- /** @deprecated Project is resolved from API key by the portal */
159
- projectId?: string;
160
- path: string;
161
- section: string;
162
- /** Fallback content if none found */
163
- fallback?: React.ReactNode;
164
- className?: string;
165
- /** For 'react' type, map of component names to components */
166
- components?: Record<string, React.ComponentType<unknown>>;
167
- /** Inject entity annotations from knowledge graph (data-sonor-entity attributes) */
168
- injectEntityAnnotations?: boolean;
169
- /**
170
- * Sub-site host for multi-site projects (e.g. `charlotte.example.com`): shows that
171
- * host's block, falling back to a project-wide one. Omit to resolve from
172
- * NEXT_PUBLIC_SITE_URL.
173
- */
174
- site?: string;
175
- }
176
155
  /**
177
156
  * Entity from the knowledge graph (for content annotation)
178
157
  */
@@ -8,7 +8,14 @@
8
8
  *
9
9
  * Server-only — see `./server-fetch`. Never import into a client component.
10
10
  */
11
- export { resolveServerApiConfig, requireServerApiConfig, resolveApiOrigin, serverApiFetch, } from './server-fetch';
11
+ export { resolveServerApiConfig, requireServerApiConfig, resolveApiOrigin, serverApiFetch, isNextControlFlow, } from './server-fetch';
12
+ /**
13
+ * The cache tags Sonor expires through the site's revalidation route. Tag a
14
+ * `serverApiFetch` with the one for your content (`tags: [SITE_CACHE_TAGS.commerce]`)
15
+ * and an edit in Sonor refreshes it. Never spell a tag as a string.
16
+ */
17
+ export { SITE_CACHE_TAGS } from '../contracts/site-cache';
18
+ export type { SiteCacheTag } from '../contracts/site-cache';
12
19
  export type { ServerApiConfig, ResolveServerApiConfigOptions, ServerFetchOptions, } from './server-fetch';
13
20
  /**
14
21
  * Mint a short-lived, project-scoped client token from the raw `SONOR_API_KEY`,
@@ -1,6 +1,7 @@
1
- export { resolveClientCredential } from '../chunk-IE5SSOCN.js';
1
+ export { resolveClientCredential } from '../chunk-BQ2CXKTQ.js';
2
2
  import '../chunk-UAYAJPEP.js';
3
- export { requireServerApiConfig, resolveApiOrigin, resolveServerApiConfig, serverApiFetch } from '../chunk-X6F6SO4S.js';
3
+ export { SITE_CACHE_TAGS } from '../chunk-6KU7STM3.js';
4
+ export { isNextControlFlow, requireServerApiConfig, resolveApiOrigin, resolveServerApiConfig, serverApiFetch } from '../chunk-C7TLGL3R.js';
4
5
  import '../chunk-MH2DSGC6.js';
5
- import '../chunk-KHQ5GD6T.js';
6
+ import '../chunk-5S2XDG5O.js';
6
7
  import '../chunk-PKBMQBKP.js';
@@ -40,15 +40,4 @@
40
40
  */
41
41
  import 'server-only';
42
42
  export { resolveFetch } from '../shared/fresh-fetch';
43
- /**
44
- * Next signals "this render must go dynamic" by THROWING (DynamicServerError,
45
- * static-gen bailout, redirect/notFound digests, React's postpone). Those are
46
- * the framework's control flow, not a mint failure. Swallowing one makes Next
47
- * believe the render succeeded statically — which is precisely how the raw key
48
- * ended up stranded in prerendered HTML with no error anywhere. Let them
49
- * propagate; only real network/HTTP failures fall back to the raw key.
50
- *
51
- * @internal Exported for unit tests; not part of the package's public API.
52
- */
53
- export declare function isFrameworkSignal(err: unknown): boolean;
54
43
  export declare function resolveClientCredential(rawKey: string, apiUrl: string): Promise<string>;
@@ -51,6 +51,22 @@ export declare function requireServerApiConfig(options?: ResolveServerApiConfigO
51
51
  * the origin-resolution logic lives in one place.
52
52
  */
53
53
  export declare function resolveApiOrigin(apiUrl?: string): string;
54
+ /**
55
+ * True for an error Next throws to steer rendering rather than to report a
56
+ * failure: the dynamic-usage bailout an uncached fetch raises while a route
57
+ * is prerendered, `redirect()`, `notFound()` and the other `NEXT_*` signals,
58
+ * a postponed or interrupted prerender. Rethrow these. Caught, "render this
59
+ * route at request time" becomes "prerender it with no data", which reads
60
+ * as a failed fetch on every build and caches the empty page.
61
+ *
62
+ * Single source of truth for this check across site-kit and the kits built
63
+ * on it (serverApiFetch, the credential mint, commerce-kit). It mirrors
64
+ * Next's `unstable_rethrow` (including the `cause` chain), plus the
65
+ * static-generation bailout `dynamic = 'error'` raises, without importing
66
+ * Next into the data plane; server-fetch.test.ts checks it against the
67
+ * errors the installed Next throws.
68
+ */
69
+ export declare function isNextControlFlow(error: unknown): boolean;
54
70
  export interface ServerFetchOptions {
55
71
  /** HTTP method. Defaults to 'GET'. */
56
72
  method?: string;
@@ -110,5 +126,8 @@ export interface ServerFetchOptions {
110
126
  * - Optional retry/backoff on transient failures (default on)
111
127
  * - Returns null on failure (or missing key, unless `requireKey`) instead of
112
128
  * throwing, so a single bad fetch never crashes a render.
129
+ * - Lets Next's own control-flow errors through ({@link isNextControlFlow}),
130
+ * so a route that turns dynamic renders at request time instead of
131
+ * prerendering with nothing.
113
132
  */
114
133
  export declare function serverApiFetch<T>(path: string, options?: ServerFetchOptions): Promise<T | null>;
@@ -0,0 +1,9 @@
1
+ export { ensureMetadata, getABTest, getEntities, getEntityEnhancedSchema, getFAQData, getInternalLinks, getManagedScripts, getPrimaryEntity, getRedirectData, getRobotsData, getSEOPageData, getSchemaMarkups, getSitemapEntries, getVisibilityScore, getVisibilitySummary, recordABImpression, registerSitemap } from './chunk-Y35BWW2C.js';
2
+ import './chunk-MJP63SSS.js';
3
+ import './chunk-6KU7STM3.js';
4
+ import './chunk-C7TLGL3R.js';
5
+ import './chunk-MH2DSGC6.js';
6
+ import './chunk-DIKNRN34.js';
7
+ import './chunk-FESKKJAS.js';
8
+ import './chunk-A4CC4ZG3.js';
9
+ import './chunk-PKBMQBKP.js';
@@ -27,7 +27,6 @@ export declare const entry: {
27
27
  readonly 'seo/server': 'src/seo/server.ts';
28
28
  readonly 'seo/register-sitemap-cli': 'src/seo/register-sitemap-cli.ts';
29
29
  readonly 'analytics/index': 'src/analytics/index.ts';
30
- readonly 'engage/index': 'src/engage/index.ts';
31
30
  readonly 'signal/index': 'src/signal/index.ts';
32
31
  readonly 'forms/index': 'src/forms/index.ts';
33
32
  /** Pure honeypot policy contract (src/contracts, also published as @sonordev/contracts) */
@@ -43,8 +42,6 @@ export declare const entry: {
43
42
  readonly 'articles/index': 'src/articles/index.ts';
44
43
  readonly 'articles/server': 'src/articles/server-core.ts';
45
44
  readonly 'articles/server-ui': 'src/articles/server-ui.ts';
46
- readonly 'commerce/index': 'src/commerce/index.ts';
47
- readonly 'commerce/server': 'src/commerce/server.ts';
48
45
  readonly 'admin-auth/index': 'src/admin-auth/index.ts';
49
46
  readonly 'sync/index': 'src/sync/index.ts';
50
47
  readonly 'sitemap/index': 'src/sitemap/index.ts';
@@ -90,7 +87,7 @@ export declare const entry: {
90
87
  * component as its own client entry makes it reachable from two entries,
91
88
  * so esbuild puts it in a shared chunk, which the build stamps. In 6.x
92
89
  * the root entry re-exported these two and hid the problem; 7.0's
93
- * types-only root exposed it (BookingWidget on /tour, a QCR build).
90
+ * types-only root exposed it (BookingWidget on a tour page of a production build).
94
91
  * tsup.config.ts fails the build if any other entry is caught this way.
95
92
  */
96
93
  readonly '_client/booking-widget': 'src/sync/BookingWidget.tsx';
@@ -110,8 +107,6 @@ export declare const entry: {
110
107
  readonly 'website/images/server': 'src/website/images-server.ts';
111
108
  readonly 'website/slots': 'src/website/slots.ts';
112
109
  readonly 'website/slots/contract': 'src/website/slots-contract.ts';
113
- readonly 'website/cms': 'src/website/cms.ts';
114
- readonly 'website/cms/server': 'src/website/cms-server.ts';
115
110
  readonly 'website/landing': 'src/website/landing.ts';
116
111
  readonly 'website/landing/server': 'src/website/landing-server.ts';
117
112
  readonly 'website/cta-bar': 'src/website/cta-bar.ts';
@@ -152,11 +147,17 @@ export declare const entry: {
152
147
  readonly 'landing/server': 'src/landing/server.ts';
153
148
  readonly 'layout/client': 'src/layout/SiteKitClientProviders.tsx';
154
149
  readonly 'client/index': 'src/client/index.ts';
150
+ /**
151
+ * The browser transport and API-config reader, for packages that build on
152
+ * site-kit (@sonordev/commerce-kit): sonorFetch, getClientApiConfig. NOT
153
+ * stamped 'use client' — it's imported from server and client code alike —
154
+ * so it is listed in ISOMORPHIC_ENTRIES below, and the build fails if it
155
+ * ever reaches a stamped chunk.
156
+ */
157
+ readonly 'runtime/index': 'src/runtime/index.ts';
155
158
  readonly 'proxy/index': 'src/proxy/index.ts';
156
159
  readonly 'manifest/index': 'src/manifest/index.ts';
157
160
  readonly 'config/index': 'src/config/index.ts';
158
- readonly 'cms/index': 'src/cms/index.ts';
159
- readonly 'cms/server': 'src/cms/server.ts';
160
161
  readonly 'maps/index': 'src/maps/index.ts';
161
162
  /** Tier 0: zero-dep Reveal / Parallax / ScrollScene on the scroll engine */
162
163
  readonly 'motion/index': 'src/motion/index.ts';
@@ -182,7 +183,18 @@ export declare const entry: {
182
183
  * `server-only` module. Add new client entries HERE — that keeps the stamp and
183
184
  * the guard reading the same list.
184
185
  */
185
- export declare const CLIENT_ENTRIES: readonly ["_client/booking-widget", "_client/testimonial-section", "forms/index", "affiliates/index", "analytics/index", "seo/client", "engage/index", "signal/index", "commerce/index", "layout/client", "client/index", "fleet/index", "website/index", "website/popups", "chat/index", "articles/index", "maps/index", "mcp/client", "motion/index", "motion/gsap", "motion/three", "cta-bar/client"];
186
+ export declare const CLIENT_ENTRIES: readonly ["_client/booking-widget", "_client/testimonial-section", "forms/index", "affiliates/index", "analytics/index", "seo/client", "signal/index", "layout/client", "client/index", "fleet/index", "website/index", "website/popups", "chat/index", "articles/index", "maps/index", "mcp/client", "motion/index", "motion/gsap", "motion/three", "cta-bar/client"];
187
+ /**
188
+ * Entries that must run anywhere: imported by server components, route
189
+ * handlers and client components alike. So they are never stamped 'use client'
190
+ * (a function exported from a stamped module is a client reference on the
191
+ * server, and can't be called there), they import neither React nor Next nor
192
+ * `server-only`, and nothing they load eagerly may be a stamped chunk.
193
+ *
194
+ * `./client-entry-boundary.test.ts` checks the source graph and
195
+ * `tsup.config.ts` checks the built files, both from this list.
196
+ */
197
+ export declare const ISOMORPHIC_ENTRIES: readonly ["runtime/index"];
186
198
  /**
187
199
  * CLI binaries are consumed via `bin`/`npx`, never imported as typed modules, so they
188
200
  * don't ship `.d.ts`. Everything else in `entry` gets declarations.
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Where browser code finds Sonor: the API origin and the site credential
3
+ * SiteKitLayout publishes on window (`__SITE_KIT_API_URL__`,
4
+ * `__SITE_KIT_API_KEY__`, the latter usually a short-lived site token; see
5
+ * publishCredential.ts and siteToken.ts, the only writers).
6
+ *
7
+ * SINGLE SOURCE OF TRUTH for reading them. Every client module goes through
8
+ * one of the two functions below; don't read the globals anywhere else.
9
+ *
10
+ * readPublishedApiConfig() exactly what the layout published, no
11
+ * fallbacks. For code that must stay silent on a
12
+ * page without SiteKitLayout (form tracking,
13
+ * article views, the analytics gate).
14
+ * getClientApiConfig() the same with fallbacks: the default API origin
15
+ * (or the server's SONOR_API_URL during SSR), and,
16
+ * only when asked, the server's SONOR_API_KEY
17
+ * during SSR.
18
+ *
19
+ * Never read a NEXT_PUBLIC_*KEY here: Next inlines NEXT_PUBLIC_ values into
20
+ * every bundle a module reaches (see client-entry-boundary.test.ts).
21
+ */
22
+ export declare const DEFAULT_SONOR_API_URL = "https://api.sonor.io";
23
+ /** The globals SiteKitLayout sets on window. */
24
+ export interface SiteKitWindowGlobals {
25
+ __SITE_KIT_API_URL__?: string;
26
+ __SITE_KIT_API_KEY__?: string;
27
+ __SITE_KIT_SITE__?: string;
28
+ __SITE_KIT_SIGNAL_URL__?: string;
29
+ }
30
+ /**
31
+ * What SiteKitLayout published on this page, as is: either value is
32
+ * undefined when it wasn't published, and both are on the server.
33
+ */
34
+ export declare function readPublishedApiConfig(): {
35
+ apiUrl?: string;
36
+ apiKey?: string;
37
+ };
38
+ export interface ClientApiConfigOptions {
39
+ /**
40
+ * During server rendering, use the server's SONOR_API_KEY. For modules
41
+ * whose fetchers also run on the server (maps, reputation, llms). It's
42
+ * never inlined into a browser bundle: it isn't a NEXT_PUBLIC_ value.
43
+ */
44
+ serverKey?: boolean;
45
+ }
46
+ /**
47
+ * The API origin and credential with fallbacks. In the browser: the
48
+ * published origin (else api.sonor.io) and the published credential. On the
49
+ * server: SONOR_API_URL / NEXT_PUBLIC_SONOR_API_URL (else api.sonor.io), so
50
+ * SSR-rendered absolute URLs follow a staging override, and no credential
51
+ * unless `serverKey` asks for it.
52
+ */
53
+ export declare function getClientApiConfig(options?: ClientApiConfigOptions): {
54
+ apiUrl: string;
55
+ apiKey: string | undefined;
56
+ };
@@ -0,0 +1,26 @@
1
+ /**
2
+ * @sonordev/site-kit/shared — the read-only reader of the analytics identity.
3
+ *
4
+ * Forms, popups and `@sonordev/commerce-kit` (through `./runtime`) attach the
5
+ * visitor's ids to what they send, so Sonor can tie a lead or a sale to the
6
+ * visit; minting an id there would tie it to a visit analytics never saw.
7
+ * Creating the ids is identity.tsx's job; where they live is
8
+ * identity-storage.ts.
9
+ *
10
+ * React-free and not `'use client'`: the `./runtime` entry re-exports it, and
11
+ * that entry must stay isomorphic.
12
+ */
13
+ /** The visitor's current analytics ids. Each is null when there isn't one. */
14
+ export interface AnalyticsIdentity {
15
+ sessionId: string | null;
16
+ visitorId: string | null;
17
+ }
18
+ /**
19
+ * Read the visitor's analytics ids without creating them, so what a form,
20
+ * popup or checkout sends ties to the visit analytics recorded (and never to
21
+ * a fresh id analytics didn't see). Both are null during server rendering
22
+ * and before analytics has started a session in this tab. When the browser
23
+ * blocks storage, these are the in-memory ids analytics is using for this
24
+ * page load. Never throws.
25
+ */
26
+ export declare function readAnalyticsIdentity(): AnalyticsIdentity;