@sonordev/site-kit 7.1.2 → 7.2.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 (167) hide show
  1. package/AGENTS.md +1 -1
  2. package/CHANGELOG.md +51 -0
  3. package/README.md +9 -8
  4. package/agent-manifest.json +12 -4
  5. package/dist/{AnalyticsProvider-ZB33W6MC.js → AnalyticsProvider-SLFFBRPE.js} +4 -4
  6. package/dist/{ArticleViewTracker-GMHYLLLZ.js → ArticleViewTracker-TM5AMGN2.js} +3 -3
  7. package/dist/{BlocksPopup-EA6LYL25.js → BlocksPopup-YJNJIVPO.js} +5 -5
  8. package/dist/ChatWidget-XKOSH66S.js +17 -0
  9. package/dist/{FileField-QKA3JB2Q.js → FileField-CI4UL5SH.js} +3 -3
  10. package/dist/{FormSpotlight-AQTIA5TP.js → FormSpotlight-F2AAEGBN.js} +20 -6
  11. package/dist/{FormStage-FDTLTP3B.js → FormStage-BI5R5CNC.js} +27 -7
  12. package/dist/ManagedForm-G6COGHXL.js +16 -0
  13. package/dist/{ManagedNewsletterForm-J6QSAGGP.js → ManagedNewsletterForm-BO3WCGXX.js} +7 -5
  14. package/dist/{SignalCore-JZNXOLNT.js → SignalCore-ZA6WHKBR.js} +3 -3
  15. package/dist/SiteChat-YJADDTKG.js +5 -0
  16. package/dist/{SiteDesignReporter-W4EJUSTE.js → SiteDesignReporter-5YAW36AQ.js} +5 -5
  17. package/dist/SitePopups-ST5PMKZE.js +10 -0
  18. package/dist/SitemapSync-RJTEBINX.js +8 -0
  19. package/dist/_client/booking-widget.js +5 -5
  20. package/dist/affiliates/index.js +3 -3
  21. package/dist/analytics/index.js +4 -4
  22. package/dist/analytics/send-gate.d.ts +1 -1
  23. package/dist/articles/index.js +2 -2
  24. package/dist/articles/server-ui.js +3 -2
  25. package/dist/articles/server.js +2 -1
  26. package/dist/{engage → chat}/ChatWidget.d.ts +7 -6
  27. package/dist/{engage → chat}/EchoUiActions.d.ts +1 -1
  28. package/dist/chat/SiteChat.d.ts +25 -0
  29. package/dist/{engage → chat}/brand-color.d.ts +1 -1
  30. package/dist/{engage → chat}/chat-messages.d.ts +1 -1
  31. package/dist/{engage → chat}/echo-config.d.ts +1 -1
  32. package/dist/chat/index.d.ts +10 -6
  33. package/dist/chat/index.js +14 -8
  34. package/dist/{engage → chat}/launcher-placement.d.ts +1 -7
  35. package/dist/{engage → chat}/socket-loader.d.ts +2 -2
  36. package/dist/chat/types.d.ts +136 -0
  37. package/dist/chunk-27FISYK4.js +4 -0
  38. package/dist/{chunk-LUXVWITO.js → chunk-4NTBQNHA.js} +247 -78
  39. package/dist/{chunk-V3PUVBME.js → chunk-5V2V5C3Y.js} +2 -4
  40. package/dist/{chunk-Q4W23JYM.js → chunk-5YCEMV2L.js} +1 -1
  41. package/dist/{chunk-RHNWA34F.js → chunk-64DKGVEI.js} +41 -7
  42. package/dist/{chunk-GLHQ3LRO.js → chunk-6U3VLV2C.js} +1 -1
  43. package/dist/{chunk-WWSHFRDL.js → chunk-BC4Y3S3D.js} +1 -1
  44. package/dist/{chunk-JSZN6LDZ.js → chunk-BF7TZYC3.js} +38 -31
  45. package/dist/{chunk-M3YEPKP7.js → chunk-BKY2ZNM7.js} +1 -1
  46. package/dist/{chunk-AQSNPZY4.js → chunk-C2FZBUSS.js} +80 -1
  47. package/dist/{chunk-NK4CSJNP.js → chunk-CF5QNFYU.js} +2 -2
  48. package/dist/{chunk-D5EC5KVO.js → chunk-D5DCBD4Y.js} +2 -2
  49. package/dist/{chunk-3SDOQUUF.js → chunk-D6ZC7XKZ.js} +2 -2
  50. package/dist/chunk-EJVQJCG5.js +370 -0
  51. package/dist/{chunk-AH5Q262S.js → chunk-F24FNCTK.js} +1 -1
  52. package/dist/{chunk-V6FDQLR7.js → chunk-FR6BYFPC.js} +53 -21
  53. package/dist/{chunk-UXOGCKL6.js → chunk-GEXT7BTE.js} +1 -1
  54. package/dist/{chunk-JTU2GOM4.js → chunk-GGORNBSC.js} +18 -6
  55. package/dist/{chunk-ERXXITG4.js → chunk-HGFAEDG3.js} +1 -1
  56. package/dist/chunk-HODO5BX5.js +28 -0
  57. package/dist/chunk-HW7B43E5.js +14 -0
  58. package/dist/{chunk-CSTQDNGK.js → chunk-IAM3D3RL.js} +43 -24
  59. package/dist/{chunk-PGMVL4AB.js → chunk-JJ3DELUL.js} +2 -2
  60. package/dist/{chunk-ILU5I6RW.js → chunk-JMLK6MH7.js} +1 -1
  61. package/dist/{chunk-YEMPUQVU.js → chunk-JWTQS5F5.js} +2 -2
  62. package/dist/{chunk-VDF5DFWT.js → chunk-K4ZHAURD.js} +1 -1
  63. package/dist/chunk-NV72HZ4W.js +45 -0
  64. package/dist/{chunk-4Y5FWDPM.js → chunk-NZ4RXN3G.js} +55 -7
  65. package/dist/chunk-OWZ7ATLZ.js +187 -0
  66. package/dist/{chunk-TXBAOEKG.js → chunk-PKGN32AU.js} +5 -4
  67. package/dist/chunk-Q6E4OPGG.js +40 -0
  68. package/dist/{chunk-QEDHRBAT.js → chunk-QL6XNPSD.js} +2 -2
  69. package/dist/{chunk-JBE46QJZ.js → chunk-R46IQIGK.js} +1 -1
  70. package/dist/{chunk-6WIQCXOO.js → chunk-RPZ7OQGD.js} +1 -1
  71. package/dist/{chunk-PHYMNUJU.js → chunk-S54ECQGY.js} +1 -1
  72. package/dist/{chunk-VGH4MDTU.js → chunk-VHKEF5ZB.js} +1 -1
  73. package/dist/{chunk-HF57LG73.js → chunk-VO3JYRT5.js} +43 -29
  74. package/dist/chunk-VWWITFWM.js +300 -0
  75. package/dist/{chunk-CIG5UL2S.js → chunk-ZTLMPUO6.js} +3 -2
  76. package/dist/client/index.js +3 -3
  77. package/dist/commerce/index.js +4 -4
  78. package/dist/contracts/color.d.ts +1 -1
  79. package/dist/contracts/entries.d.ts +1 -1
  80. package/dist/contracts/error-page.d.ts +183 -0
  81. package/dist/contracts/llms.d.ts +1 -0
  82. package/dist/contracts/proposal-sitemap.d.ts +130 -0
  83. package/dist/contracts/schema-placeholders.d.ts +87 -0
  84. package/dist/engage/EngageWidget.d.ts +13 -12
  85. package/dist/engage/index.d.ts +10 -9
  86. package/dist/engage/index.js +31 -35
  87. package/dist/engage/types.d.ts +19 -244
  88. package/dist/fleet/FleetHeartbeat.d.ts +1 -1
  89. package/dist/fleet/index.js +4 -4
  90. package/dist/forms/FormEnhancer.d.ts +25 -12
  91. package/dist/forms/ServerForm.d.ts +11 -10
  92. package/dist/forms/StaticForm.d.ts +3 -1
  93. package/dist/forms/field-autocomplete.d.ts +28 -0
  94. package/dist/forms/form-dom-values.d.ts +42 -0
  95. package/dist/forms/index.js +11 -9
  96. package/dist/forms/server.js +6 -4
  97. package/dist/forms/static.js +3 -2
  98. package/dist/forms/submitForm.d.ts +8 -1
  99. package/dist/forms/types.d.ts +41 -2
  100. package/dist/forms/useForm.d.ts +21 -4
  101. package/dist/forms/webmcp.d.ts +38 -0
  102. package/dist/images/index.js +4 -4
  103. package/dist/index.d.ts +4 -1
  104. package/dist/index.js +1 -1
  105. package/dist/layout/SiteKitClientProviders.d.ts +3 -3
  106. package/dist/layout/SiteKitLayout.d.ts +4 -4
  107. package/dist/layout/client.d.ts +3 -3
  108. package/dist/layout/client.js +7 -7
  109. package/dist/layout/index.js +8 -8
  110. package/dist/layout/types.d.ts +5 -4
  111. package/dist/llms/contract.js +1 -1
  112. package/dist/llms/index.js +6 -6
  113. package/dist/maps/index.js +3 -3
  114. package/dist/mcp/index.js +2 -14
  115. package/dist/mcp/sonor.js +14 -11
  116. package/dist/revalidate/index.js +2 -2
  117. package/dist/seo/client.js +4 -4
  118. package/dist/seo/index.js +15 -8
  119. package/dist/seo/llms/contract.js +1 -1
  120. package/dist/seo/llms.js +6 -6
  121. package/dist/seo/register-sitemap-cli.js +1 -1
  122. package/dist/seo/sitemap.js +4 -4
  123. package/dist/server/index.js +2 -2
  124. package/dist/shared/dialog.d.ts +27 -0
  125. package/dist/shared/identity.d.ts +1 -1
  126. package/dist/shared/layers.d.ts +7 -0
  127. package/dist/shared/mid-form.d.ts +53 -0
  128. package/dist/shared/reporting-gate.d.ts +1 -1
  129. package/dist/shared/version.d.ts +1 -1
  130. package/dist/shared/visual-viewport-gap.d.ts +1 -1
  131. package/dist/signal/index.js +2 -2
  132. package/dist/signal/types.d.ts +1 -1
  133. package/dist/sitemap/index.js +4 -4
  134. package/dist/{socket-loader-R24ZSRSQ.js → socket-loader-CGIPEG74.js} +1 -1
  135. package/dist/sync/index.js +5 -5
  136. package/dist/types.d.ts +3 -1
  137. package/dist/{web-vitals.attribution-GD6LGLVF.js → web-vitals.attribution-N2PCCF4Q.js} +1 -1
  138. package/dist/website/BlocksPopup.d.ts +1 -1
  139. package/dist/website/PopupBlocks.d.ts +5 -2
  140. package/dist/website/SitePopups.d.ts +25 -0
  141. package/dist/website/images.js +4 -4
  142. package/dist/website/index.js +6 -6
  143. package/dist/website/popup-rules.d.ts +46 -0
  144. package/dist/website/popup-types.d.ts +113 -0
  145. package/dist/website/popups.d.ts +2 -6
  146. package/dist/website/popups.js +6 -14
  147. package/dist/{writeLLMsTxt-G3JBNBC5.js → writeLLMsTxt-OV24LQVL.js} +3 -3
  148. package/docs/MIGRATING-TO-7.md +41 -9
  149. package/docs.json +2 -1
  150. package/package.json +2 -2
  151. package/src/analytics/README.md +2 -2
  152. package/src/articles/README.md +4 -1
  153. package/src/{engage → chat}/README.md +63 -62
  154. package/src/forms/README.md +49 -3
  155. package/src/layout/README.md +8 -5
  156. package/src/seo/README.md +3 -1
  157. package/src/sync/README.md +10 -0
  158. package/src/website/README.md +133 -0
  159. package/dist/ChatWidget-UCDWMWCW.js +0 -15
  160. package/dist/EngageWidget-7ZYSK4GE.js +0 -11
  161. package/dist/ManagedForm-H7BVAH2W.js +0 -14
  162. package/dist/SitemapSync-XBANGKHZ.js +0 -8
  163. package/dist/chunk-NDF4A5JM.js +0 -37
  164. package/dist/chunk-VLARKWZU.js +0 -100
  165. package/dist/chunk-YCJT4JJG.js +0 -837
  166. package/dist/engage/DesignRenderer.d.ts +0 -57
  167. package/dist/engage/element-rules.d.ts +0 -38
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @sonordev/site-kit/engage - Echo UI Actions
2
+ * @sonordev/site-kit/chat - Echo UI Actions
3
3
  *
4
4
  * Renders the optional `uiActions` the visitor Echo concierge returns alongside
5
5
  * a chat reply. Rendered beneath the assistant
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @sonordev/site-kit/chat - SiteChat: the Website chat a site shows
3
+ * (Sonor → Messages).
4
+ *
5
+ * Echo's launcher, mounted once the browser is idle. SiteKitLayout mounts it
6
+ * for you (its `chat` prop); mount it yourself only on a site without
7
+ * SiteKitLayout. ChatWidget, its markdown renderer and its socket download
8
+ * when it first renders, never with the page. It shows only while the
9
+ * project's chat is switched on in Sonor (see ChatWidget's isChatEnabled).
10
+ */
11
+ import React from 'react';
12
+ import type { ChatLauncherPlacement } from './types';
13
+ import { type AnalyticsGateOptions } from '../shared/reporting-gate';
14
+ export interface SiteChatProps extends ChatLauncherPlacement, AnalyticsGateOptions {
15
+ apiUrl?: string;
16
+ apiKey?: string;
17
+ /** For chat routing. Resolved from the API key when absent. */
18
+ projectId?: string;
19
+ }
20
+ /**
21
+ * Same gate as analytics (frames, localhost, a key to send with): a chat
22
+ * launcher in a case study's device frame would talk to the agency's visitor,
23
+ * not this site's.
24
+ */
25
+ export declare function SiteChat(props: SiteChatProps): React.JSX.Element | null;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @sonordev/site-kit/engage — Echo's brand colours
2
+ * @sonordev/site-kit/chat — Echo's brand colours
3
3
  *
4
4
  * Single source of truth for how Echo turns the site's brand colour into
5
5
  * foreground colours. ChatWidget and EchoUiActions route every such decision
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @sonordev/site-kit/engage — Echo's transcript: message shapes and turns
2
+ * @sonordev/site-kit/chat — Echo's transcript: message shapes and turns
3
3
  *
4
4
  * Single source of truth for what ChatWidget adds to the transcript when a
5
5
  * visitor speaks, and for the one AI turn every send path goes through.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @sonordev/site-kit/engage - Echo Public Configuration
2
+ * @sonordev/site-kit/chat - Echo Public Configuration
3
3
  *
4
4
  * Helpers for configuring the ChatWidget with Echo-specific defaults
5
5
  * for the Sonor public site (sonor.io).
@@ -2,10 +2,14 @@
2
2
  * @sonordev/site-kit/chat — Website chat (Sonor → Messages).
3
3
  *
4
4
  * The chat launcher and Echo conversation a site shows. SiteKitLayout mounts
5
- * it for you (its `chat` prop, `engage` before 6.6); import it here to place
6
- * it yourself. It used to live in `./engage`, which still re-exports it.
5
+ * it for you (its `chat` prop); `SiteChat` places it yourself the same way
6
+ * (idle-deferred, gated like analytics), and `ChatWidget` is the widget
7
+ * itself. `@sonordev/site-kit/engage` (deprecated) re-exports these.
7
8
  */
8
- export { ChatWidget, EchoChat, isChatEnabled } from '../engage/ChatWidget';
9
- export { chatLauncherStyles, DEFAULT_LAUNCHER_OFFSET_BOTTOM } from '../engage/launcher-placement';
10
- export type { ChatLauncherStyles } from '../engage/launcher-placement';
11
- export type { ChatAvailability, ChatConfig, ChatConversation, ChatLauncherPlacement, ChatLauncherPosition, ChatMessage, UiAction, UiActionType, } from '../engage/types';
9
+ export { SiteChat, type SiteChatProps } from './SiteChat';
10
+ export { ChatWidget, EchoChat, isChatEnabled } from './ChatWidget';
11
+ export { chatLauncherStyles, DEFAULT_LAUNCHER_OFFSET_BOTTOM } from './launcher-placement';
12
+ export type { ChatLauncherStyles } from './launcher-placement';
13
+ export { SONOR_PUBLIC_ECHO_DEFAULTS, getEchoWidgetProps } from './echo-config';
14
+ export type { EchoPublicConfig } from './echo-config';
15
+ export type { ChatAvailability, ChatConfig, ChatConversation, ChatLauncherPlacement, ChatLauncherPosition, ChatMessage, UiAction, UiActionType, } from './types';
@@ -1,16 +1,22 @@
1
1
  'use client';
2
- export { ChatWidget, EchoChat, isChatEnabled } from '../chunk-RHNWA34F.js';
3
- import '../chunk-JE4A5S4F.js';
4
- export { DEFAULT_LAUNCHER_OFFSET_BOTTOM, chatLauncherStyles } from '../chunk-NDF4A5JM.js';
2
+ export { SONOR_PUBLIC_ECHO_DEFAULTS, getEchoWidgetProps } from '../chunk-HODO5BX5.js';
3
+ export { ChatWidget, DEFAULT_LAUNCHER_OFFSET_BOTTOM, EchoChat, chatLauncherStyles, isChatEnabled } from '../chunk-64DKGVEI.js';
4
+ export { SiteChat } from '../chunk-NV72HZ4W.js';
5
5
  import '../chunk-6T6CQVNL.js';
6
- import '../chunk-V6FDQLR7.js';
7
- import '../chunk-AQSNPZY4.js';
6
+ import '../chunk-JE4A5S4F.js';
7
+ import '../chunk-27FISYK4.js';
8
+ import '../chunk-FR6BYFPC.js';
9
+ import '../chunk-Q6E4OPGG.js';
10
+ import '../chunk-C2FZBUSS.js';
8
11
  import '../chunk-5SQK3D53.js';
12
+ import '../chunk-HW7B43E5.js';
9
13
  import '../chunk-NJCTQH2P.js';
10
14
  import '../chunk-S22FSH7C.js';
11
15
  import '../chunk-L2V5PUFN.js';
12
16
  import '../chunk-GJWI74ZZ.js';
13
- import '../chunk-3SDOQUUF.js';
14
- import '../chunk-VDF5DFWT.js';
15
- import '../chunk-AH5Q262S.js';
17
+ import '../chunk-43OCZ3JA.js';
18
+ import '../chunk-EKBEOXTH.js';
19
+ import '../chunk-D6ZC7XKZ.js';
20
+ import '../chunk-K4ZHAURD.js';
21
+ import '../chunk-F24FNCTK.js';
16
22
  import '../chunk-PKBMQBKP.js';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @sonordev/site-kit/engage - Chat launcher placement
2
+ * @sonordev/site-kit/chat - Chat launcher placement
3
3
  *
4
4
  * Single source of truth for where the Echo launcher sits and, derived from
5
5
  * it, where the chat popup opens, on screen and in the stacking order.
@@ -14,12 +14,6 @@ import type { CSSProperties } from 'react';
14
14
  import type { ChatLauncherPlacement } from './types';
15
15
  /** Launcher clearance above the bottom edge when a site sets nothing. */
16
16
  export declare const DEFAULT_LAUNCHER_OFFSET_BOTTOM = "20px";
17
- /**
18
- * Layer everything Engage renders stacks on when a site sets nothing:
19
- * popups, nudges, bars and the chat launcher, with the chat popup one below.
20
- * EngageWidget's default comes from here too.
21
- */
22
- export declare const DEFAULT_ENGAGE_Z_INDEX = 9999;
23
17
  /**
24
18
  * Custom property a stylesheet can set to move the launcher. Wins over the
25
19
  * `offsetBottom` option. Deliberately never declared by the kit: a property
@@ -1,8 +1,8 @@
1
1
  import type { Socket } from 'socket.io-client';
2
2
  /**
3
3
  * Lazy socket.io loader — kept in a separate file so bundlers
4
- * (Turbopack, webpack) never pull socket.io-client into the main
5
- * engage chunk. Only loaded when the user actually opens the chat.
4
+ * (Turbopack, webpack) never pull socket.io-client into the chat
5
+ * chunk. Only loaded when the user actually opens the chat.
6
6
  *
7
7
  * This module owns site-kit's entire socket.io surface. If you are wondering
8
8
  * why package.json declares `engine.io-client` and `socket.io-parser` when
@@ -0,0 +1,136 @@
1
+ /**
2
+ * @sonordev/site-kit/chat: Website chat types (Sonor → Messages).
3
+ */
4
+ /** The corner the Echo chat launcher sits in. */
5
+ export type ChatLauncherPosition = 'bottom-right' | 'bottom-left';
6
+ /**
7
+ * Where the Echo chat launcher sits, including the layer it stacks on. The
8
+ * single definition of launcher placement: the layout's `chat` config,
9
+ * SiteChat's props and ChatConfig all extend it, so a new placement option is
10
+ * added once. ChatWidget turns it into styles through `chatLauncherStyles`
11
+ * (./launcher-placement).
12
+ */
13
+ export interface ChatLauncherPlacement {
14
+ /** Corner. Default: 'bottom-right' */
15
+ position?: ChatLauncherPosition;
16
+ /**
17
+ * Distance from the bottom of the viewport to the launcher, as any CSS
18
+ * length (`'88px'`, `'5.5rem'`, `'calc(4rem + 8px)'`). A number is pixels.
19
+ * Default: `'20px'`.
20
+ *
21
+ * The device's safe-area inset is added on top, so pass the clearance you
22
+ * want above your own UI, not the inset. The chat popup opens above the
23
+ * launcher wherever this puts it.
24
+ *
25
+ * A `--sk-echo-offset-bottom` custom property set anywhere above the
26
+ * launcher (`:root`, `body`, a media query, a `:has()` rule) wins over this
27
+ * value. Use that when the offset depends on the page or the breakpoint,
28
+ * such as clearing a sticky bar that only some pages render.
29
+ */
30
+ offsetBottom?: string | number;
31
+ /**
32
+ * Stacking layer. The launcher sits on it and the chat popup one layer
33
+ * beneath. Default: 9999.
34
+ *
35
+ * Through SiteKitLayout the same number also stacks popups, banners and
36
+ * toasts, so everything a site's widgets render shares one layer. Lower it
37
+ * when the site's own fixed UI (a mobile menu, a cookie banner) has to
38
+ * cover the chat.
39
+ */
40
+ zIndex?: number;
41
+ }
42
+ export interface ChatConfig extends ChatLauncherPlacement {
43
+ /** Widget position */
44
+ position: ChatLauncherPosition;
45
+ /** Widget appearance */
46
+ buttonIcon?: 'chat' | 'help' | 'custom';
47
+ buttonColor?: string;
48
+ buttonText?: string;
49
+ /** Brand primary color */
50
+ brandPrimary?: string;
51
+ /** Welcome message */
52
+ welcomeMessage?: string;
53
+ /** Operating hours */
54
+ operatingHours?: {
55
+ enabled: boolean;
56
+ timezone: string;
57
+ hours: {
58
+ [day: number]: {
59
+ start: string;
60
+ end: string;
61
+ } | null;
62
+ };
63
+ };
64
+ /** AI vs Live Chat */
65
+ mode: 'ai' | 'live' | 'hybrid';
66
+ /** AI settings (if mode is 'ai' or 'hybrid') */
67
+ aiSettings?: {
68
+ skillId?: string;
69
+ handoffToLive?: boolean;
70
+ handoffKeywords?: string[];
71
+ /** When AI should suggest handoff based on sentiment or keywords */
72
+ handoffTriggers?: {
73
+ negativesentiment?: boolean;
74
+ keywords?: string[];
75
+ afterMessages?: number;
76
+ };
77
+ };
78
+ /** Offline mode settings (when no agents available) */
79
+ offlineMode?: 'form' | 'ai' | 'message';
80
+ /** Form slug to show when offline (defaults to 'contact') */
81
+ offlineFormSlug?: string;
82
+ /** AI fallback when no agents online (hybrid mode) */
83
+ aiFallbackEnabled?: boolean;
84
+ /** Custom offline message */
85
+ offlineMessage?: string;
86
+ }
87
+ /**
88
+ * UI actions the visitor Echo endpoint (POST /echo/public/chat) may return on
89
+ * the JSON response alongside `content` / `conversationId`. The chat widget
90
+ * renders each as an inline card or chip beneath the assistant message.
91
+ *
92
+ * This mirrors the shape Echo's endpoint sends. It is a LOCAL contract on
93
+ * purpose: the kit never imports from the API.
94
+ *
95
+ * - `show_form` → data.formSlug (+ optional data.prefill) — offer the managed form inline.
96
+ * - `suggest_action` → data.action + data.message — clickable chip (send message or navigate).
97
+ * - `show_portfolio_item` → data.slug — the generic widget ignores it (a site's own chat UI handles it).
98
+ */
99
+ export type UiActionType = 'show_form' | 'suggest_action' | 'show_portfolio_item';
100
+ export interface UiAction {
101
+ type: UiActionType | string;
102
+ data: Record<string, unknown>;
103
+ }
104
+ export interface ChatMessage {
105
+ id: string;
106
+ conversation_id: string;
107
+ role: 'user' | 'assistant' | 'agent' | 'system';
108
+ content: string;
109
+ metadata?: Record<string, unknown>;
110
+ created_at: string;
111
+ /** Name of the agent (for agent messages) */
112
+ sender_name?: string;
113
+ /** Avatar URL of the agent */
114
+ sender_avatar?: string;
115
+ }
116
+ export interface ChatConversation {
117
+ id: string;
118
+ project_id: string;
119
+ visitor_id: string;
120
+ status: 'active' | 'ai' | 'pending_handoff' | 'human' | 'closed';
121
+ assigned_to?: string;
122
+ last_message_at: string;
123
+ created_at: string;
124
+ /** AI summary of the conversation */
125
+ ai_summary?: string;
126
+ /** Visitor info */
127
+ visitor_name?: string;
128
+ visitor_email?: string;
129
+ }
130
+ /** Availability status returned by the widget API */
131
+ export interface ChatAvailability {
132
+ available: boolean;
133
+ mode: 'live' | 'ai' | 'offline';
134
+ agentsOnline: number;
135
+ operatingHoursActive: boolean;
136
+ }
@@ -0,0 +1,4 @@
1
+ // src/shared/layers.ts
2
+ var DEFAULT_WIDGET_Z_INDEX = 9999;
3
+
4
+ export { DEFAULT_WIDGET_Z_INDEX };