@aigentyc/chat-sdk 0.1.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 (162) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +156 -0
  3. package/dist/JsonRenderResult-Ftw4AKwb.d.cts +18 -0
  4. package/dist/JsonRenderResult-Ftw4AKwb.d.ts +18 -0
  5. package/dist/JsonRenderResult-GQOYPLVH.cjs +15 -0
  6. package/dist/JsonRenderResult-GQOYPLVH.cjs.map +1 -0
  7. package/dist/JsonRenderResult-ZFJ6VWMS.js +6 -0
  8. package/dist/JsonRenderResult-ZFJ6VWMS.js.map +1 -0
  9. package/dist/SlotsContext-CBtt36al.d.ts +148 -0
  10. package/dist/SlotsContext-CHvISDJT.d.cts +148 -0
  11. package/dist/VisualizationRenderer-FNFYNN66.js +5 -0
  12. package/dist/VisualizationRenderer-FNFYNN66.js.map +1 -0
  13. package/dist/VisualizationRenderer-VKMZXRUX.cjs +20 -0
  14. package/dist/VisualizationRenderer-VKMZXRUX.cjs.map +1 -0
  15. package/dist/ai-elements.cjs +4608 -0
  16. package/dist/ai-elements.cjs.map +1 -0
  17. package/dist/ai-elements.d.cts +897 -0
  18. package/dist/ai-elements.d.ts +897 -0
  19. package/dist/ai-elements.js +4363 -0
  20. package/dist/ai-elements.js.map +1 -0
  21. package/dist/chunk-3MP2EGEJ.cjs +270 -0
  22. package/dist/chunk-3MP2EGEJ.cjs.map +1 -0
  23. package/dist/chunk-3RW7O444.js +26 -0
  24. package/dist/chunk-3RW7O444.js.map +1 -0
  25. package/dist/chunk-42ARGQXE.js +51 -0
  26. package/dist/chunk-42ARGQXE.js.map +1 -0
  27. package/dist/chunk-4FBVV64J.js +257 -0
  28. package/dist/chunk-4FBVV64J.js.map +1 -0
  29. package/dist/chunk-4QT25AXI.js +21 -0
  30. package/dist/chunk-4QT25AXI.js.map +1 -0
  31. package/dist/chunk-525KS5HM.cjs +30 -0
  32. package/dist/chunk-525KS5HM.cjs.map +1 -0
  33. package/dist/chunk-5F3O3ZJH.js +299 -0
  34. package/dist/chunk-5F3O3ZJH.js.map +1 -0
  35. package/dist/chunk-5QSXB6UL.cjs +259 -0
  36. package/dist/chunk-5QSXB6UL.cjs.map +1 -0
  37. package/dist/chunk-5T4FJ2SR.js +664 -0
  38. package/dist/chunk-5T4FJ2SR.js.map +1 -0
  39. package/dist/chunk-7BNYTOTE.cjs +67 -0
  40. package/dist/chunk-7BNYTOTE.cjs.map +1 -0
  41. package/dist/chunk-AWAJOSFP.cjs +96 -0
  42. package/dist/chunk-AWAJOSFP.cjs.map +1 -0
  43. package/dist/chunk-BKDV2H6Z.js +224 -0
  44. package/dist/chunk-BKDV2H6Z.js.map +1 -0
  45. package/dist/chunk-FQN6OBGN.cjs +171 -0
  46. package/dist/chunk-FQN6OBGN.cjs.map +1 -0
  47. package/dist/chunk-FYPJSHCL.js +190 -0
  48. package/dist/chunk-FYPJSHCL.js.map +1 -0
  49. package/dist/chunk-J2H6MLQF.cjs +680 -0
  50. package/dist/chunk-J2H6MLQF.cjs.map +1 -0
  51. package/dist/chunk-J2K7EJYP.cjs +198 -0
  52. package/dist/chunk-J2K7EJYP.cjs.map +1 -0
  53. package/dist/chunk-JI5KCSOI.cjs +23 -0
  54. package/dist/chunk-JI5KCSOI.cjs.map +1 -0
  55. package/dist/chunk-JOO6C3XT.cjs +44 -0
  56. package/dist/chunk-JOO6C3XT.cjs.map +1 -0
  57. package/dist/chunk-KBGPBUTI.cjs +78 -0
  58. package/dist/chunk-KBGPBUTI.cjs.map +1 -0
  59. package/dist/chunk-MT2AMINB.js +75 -0
  60. package/dist/chunk-MT2AMINB.js.map +1 -0
  61. package/dist/chunk-MZQKGNWF.js +4 -0
  62. package/dist/chunk-MZQKGNWF.js.map +1 -0
  63. package/dist/chunk-NG7OTWXQ.cjs +226 -0
  64. package/dist/chunk-NG7OTWXQ.cjs.map +1 -0
  65. package/dist/chunk-NPJKLYLV.js +68 -0
  66. package/dist/chunk-NPJKLYLV.js.map +1 -0
  67. package/dist/chunk-NW2ESHRV.js +685 -0
  68. package/dist/chunk-NW2ESHRV.js.map +1 -0
  69. package/dist/chunk-NWF735F5.js +1631 -0
  70. package/dist/chunk-NWF735F5.js.map +1 -0
  71. package/dist/chunk-NYQSM3EB.cjs +305 -0
  72. package/dist/chunk-NYQSM3EB.cjs.map +1 -0
  73. package/dist/chunk-OU7OROOE.cjs +1643 -0
  74. package/dist/chunk-OU7OROOE.cjs.map +1 -0
  75. package/dist/chunk-PS3U7T37.js +42 -0
  76. package/dist/chunk-PS3U7T37.js.map +1 -0
  77. package/dist/chunk-Q7T3VAJV.cjs +687 -0
  78. package/dist/chunk-Q7T3VAJV.cjs.map +1 -0
  79. package/dist/chunk-QYCEHFAB.js +265 -0
  80. package/dist/chunk-QYCEHFAB.js.map +1 -0
  81. package/dist/chunk-RPDJXB3U.js +676 -0
  82. package/dist/chunk-RPDJXB3U.js.map +1 -0
  83. package/dist/chunk-UKEL7FWS.js +64 -0
  84. package/dist/chunk-UKEL7FWS.js.map +1 -0
  85. package/dist/chunk-VS3NZ7FX.js +164 -0
  86. package/dist/chunk-VS3NZ7FX.js.map +1 -0
  87. package/dist/chunk-WZLWAVSS.cjs +73 -0
  88. package/dist/chunk-WZLWAVSS.cjs.map +1 -0
  89. package/dist/chunk-X5YEOOPK.cjs +758 -0
  90. package/dist/chunk-X5YEOOPK.cjs.map +1 -0
  91. package/dist/chunk-X7R334SB.cjs +5 -0
  92. package/dist/chunk-X7R334SB.cjs.map +1 -0
  93. package/dist/chunk-XXNDL5SJ.cjs +432 -0
  94. package/dist/chunk-XXNDL5SJ.cjs.map +1 -0
  95. package/dist/chunk-YQELMJW5.js +429 -0
  96. package/dist/chunk-YQELMJW5.js.map +1 -0
  97. package/dist/components.cjs +551 -0
  98. package/dist/components.cjs.map +1 -0
  99. package/dist/components.d.cts +181 -0
  100. package/dist/components.d.ts +181 -0
  101. package/dist/components.js +483 -0
  102. package/dist/components.js.map +1 -0
  103. package/dist/core.cjs +283 -0
  104. package/dist/core.cjs.map +1 -0
  105. package/dist/core.d.cts +455 -0
  106. package/dist/core.d.ts +455 -0
  107. package/dist/core.js +241 -0
  108. package/dist/core.js.map +1 -0
  109. package/dist/hooks.cjs +324 -0
  110. package/dist/hooks.cjs.map +1 -0
  111. package/dist/hooks.d.cts +163 -0
  112. package/dist/hooks.d.ts +163 -0
  113. package/dist/hooks.js +277 -0
  114. package/dist/hooks.js.map +1 -0
  115. package/dist/i18n.cjs +26 -0
  116. package/dist/i18n.cjs.map +1 -0
  117. package/dist/i18n.d.cts +50 -0
  118. package/dist/i18n.d.ts +50 -0
  119. package/dist/i18n.js +5 -0
  120. package/dist/i18n.js.map +1 -0
  121. package/dist/index.cjs +466 -0
  122. package/dist/index.cjs.map +1 -0
  123. package/dist/index.d.cts +80 -0
  124. package/dist/index.d.ts +80 -0
  125. package/dist/index.js +438 -0
  126. package/dist/index.js.map +1 -0
  127. package/dist/interaction-tracker-D9P1Oq4j.d.cts +83 -0
  128. package/dist/interaction-tracker-D9P1Oq4j.d.ts +83 -0
  129. package/dist/json-render.cjs +23 -0
  130. package/dist/json-render.cjs.map +1 -0
  131. package/dist/json-render.d.cts +857 -0
  132. package/dist/json-render.d.ts +857 -0
  133. package/dist/json-render.js +6 -0
  134. package/dist/json-render.js.map +1 -0
  135. package/dist/live-chat-transport-4XLOIPOE.js +4 -0
  136. package/dist/live-chat-transport-4XLOIPOE.js.map +1 -0
  137. package/dist/live-chat-transport-ALVRGWX7.cjs +13 -0
  138. package/dist/live-chat-transport-ALVRGWX7.cjs.map +1 -0
  139. package/dist/select-B4l9yoyn.d.cts +99 -0
  140. package/dist/select-B4l9yoyn.d.ts +99 -0
  141. package/dist/styles.css +2 -0
  142. package/dist/theme.cjs +18 -0
  143. package/dist/theme.cjs.map +1 -0
  144. package/dist/theme.d.cts +55 -0
  145. package/dist/theme.d.ts +55 -0
  146. package/dist/theme.js +5 -0
  147. package/dist/theme.js.map +1 -0
  148. package/dist/tools.cjs +32 -0
  149. package/dist/tools.cjs.map +1 -0
  150. package/dist/tools.d.cts +117 -0
  151. package/dist/tools.d.ts +117 -0
  152. package/dist/tools.js +11 -0
  153. package/dist/tools.js.map +1 -0
  154. package/dist/types-DKJ_-nbG.d.cts +349 -0
  155. package/dist/types-DKJ_-nbG.d.ts +349 -0
  156. package/dist/ui.cjs +667 -0
  157. package/dist/ui.cjs.map +1 -0
  158. package/dist/ui.d.cts +95 -0
  159. package/dist/ui.d.ts +95 -0
  160. package/dist/ui.js +414 -0
  161. package/dist/ui.js.map +1 -0
  162. package/package.json +255 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Aigentyc
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,156 @@
1
+ # @aigentyc/chat-sdk
2
+
3
+ > React SDK for building AI-powered chat interfaces connected to the Aigentyc platform.
4
+
5
+ ## Features
6
+ - Drop-in `<Chat />` and `<ChatWidget />` components
7
+ - Full slot system — replace any UI piece
8
+ - Headless mode with `useAigentycChat` hook
9
+ - Backend-driven tool rendering (visualization, json-render, custom HTML)
10
+ - Live chat handoff with Socket.IO
11
+ - Built-in i18n (en, he) — extensible with `addLanguage()`
12
+ - React 19, SSR-compatible (Next.js App Router)
13
+ - Multi-instance support — multiple chats on one page
14
+ - White-label — zero forced branding
15
+
16
+ ## Quickest start — scaffold a new app
17
+
18
+ ```bash
19
+ npm create aigentyc-chat@latest my-app
20
+ cd my-app && npm install && npm run dev
21
+ ```
22
+
23
+ Picks Vite or Next.js, wires your `projectId`, drops in `<Chat />`. Done.
24
+
25
+ ## Add to an existing app
26
+
27
+ ```bash
28
+ npm install @aigentyc/chat-sdk
29
+ ```
30
+
31
+ That's it — core chat, streaming, and tool rendering work out of the box.
32
+
33
+ Optional peer deps — install only if you use that feature:
34
+ - `socket.io-client` — live chat handoff
35
+ - `recharts` — visualization tool renderer
36
+ - `@json-render/core @json-render/react @json-render/shadcn zod` — json-render tools
37
+
38
+ ## Quick Start
39
+
40
+ ```tsx
41
+ import { Chat } from "@aigentyc/chat-sdk"
42
+ import "@aigentyc/chat-sdk/theme/styles.css"
43
+
44
+ export function App() {
45
+ return (
46
+ <Chat
47
+ projectId="your-project-id"
48
+ apiEndpoint="https://api.aigentyc.com"
49
+ apiKey="your-api-key"
50
+ />
51
+ )
52
+ }
53
+ ```
54
+
55
+ ## Four Levels of Control
56
+
57
+ ### Level 1 — Drop-in
58
+ ```tsx
59
+ <Chat projectId="..." apiEndpoint="..." />
60
+ ```
61
+
62
+ ### Level 2 — Customize with slots + theme
63
+ ```tsx
64
+ <Chat
65
+ projectId="..." apiEndpoint="..."
66
+ theme={{ primaryColor: "#3b82f6" }}
67
+ slots={{ header: MyHeader, input: MyInput }}
68
+ onMessageSent={(msg) => analytics.track('chat', msg)}
69
+ />
70
+ ```
71
+
72
+ ### Level 3 — Compose components
73
+ ```tsx
74
+ <ChatProvider projectId="..." apiEndpoint="...">
75
+ <MyLayout>
76
+ <ChatInterface />
77
+ <ChatInput />
78
+ </MyLayout>
79
+ </ChatProvider>
80
+ ```
81
+
82
+ ### Level 4 — Headless
83
+ ```tsx
84
+ const { messages, sendMessage, status } = useAigentycChat({
85
+ projectId: "...", apiEndpoint: "..."
86
+ })
87
+ ```
88
+
89
+ ## Slots
90
+
91
+ | Slot | Replaces |
92
+ | --- | --- |
93
+ | `header` | Chat header bar |
94
+ | `welcome` | Welcome / empty state |
95
+ | `message` | Individual message bubble |
96
+ | `input` | Composer / input box |
97
+ | `footer` | Footer below input |
98
+ | `loader` | Loading indicator |
99
+ | `suggestions` | Suggested prompts |
100
+ | `tools` | Per-tool renderers (keyed by tool name) |
101
+
102
+ ## Tool Rendering
103
+ Tools created in the Aigentyc platform come with rendering instructions. The SDK auto-renders based on `uiRenderMode`:
104
+ - `visualization` → recharts
105
+ - `json_render` → component spec via @json-render/shadcn
106
+ - `legacy` → custom HTML/CSS template
107
+ - `preset` → built-in renderers
108
+
109
+ Override per-tool:
110
+ ```tsx
111
+ <Chat slots={{ tools: { searchProducts: MyProductGrid } }} />
112
+ ```
113
+
114
+ ## Theming
115
+ All theme tokens are CSS variables under `[data-aigentyc-chat]`. Override via `theme` prop or your own CSS.
116
+
117
+ ## i18n
118
+ Built-in: `en`, `he`. Add custom languages:
119
+ ```tsx
120
+ import { addLanguage } from "@aigentyc/chat-sdk/i18n"
121
+ addLanguage("fr", { welcomeTitle: "Bienvenue", ... })
122
+ ```
123
+
124
+ ## Live Chat
125
+ Enable Socket.IO-based live chat handoff:
126
+ ```tsx
127
+ <Chat enableLiveChat chatServiceUrl="wss://..." />
128
+ ```
129
+
130
+ ## Next.js / SSR
131
+ All components have `"use client"` directives. Works in App Router and Pages Router.
132
+
133
+ ## Storybook
134
+ ```bash
135
+ npm run storybook
136
+ ```
137
+
138
+ ## Demo
139
+ ```bash
140
+ cd demo && npm install && npm run dev
141
+ ```
142
+
143
+ ## Package Exports
144
+ - `@aigentyc/chat-sdk` — main (Chat, ChatWidget, ChatProvider)
145
+ - `@aigentyc/chat-sdk/core` — types, transport, utils
146
+ - `@aigentyc/chat-sdk/hooks` — all hooks
147
+ - `@aigentyc/chat-sdk/components` — individual chat components
148
+ - `@aigentyc/chat-sdk/ai-elements` — Message, Conversation, etc.
149
+ - `@aigentyc/chat-sdk/tools` — ToolRenderer, VisualizationRenderer
150
+ - `@aigentyc/chat-sdk/json-render` — json-render system
151
+ - `@aigentyc/chat-sdk/ui` — shadcn primitives
152
+ - `@aigentyc/chat-sdk/theme` — ThemeProvider + styles.css
153
+ - `@aigentyc/chat-sdk/i18n` — translations
154
+
155
+ ## License
156
+ MIT
@@ -0,0 +1,18 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { Spec } from '@json-render/core';
3
+
4
+ interface JsonRenderResultProps {
5
+ spec: Spec;
6
+ data: unknown;
7
+ onSendMessage?: (message: string) => void;
8
+ className?: string;
9
+ conversationMessages?: Array<{
10
+ role: string;
11
+ content: string;
12
+ }>;
13
+ /** API key for authenticated requests (form submissions etc.) */
14
+ apiKey?: string;
15
+ }
16
+ declare function JsonRenderResult({ spec: rawSpec, data, onSendMessage, className, conversationMessages, apiKey, }: JsonRenderResultProps): react_jsx_runtime.JSX.Element;
17
+
18
+ export { JsonRenderResult as J };
@@ -0,0 +1,18 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { Spec } from '@json-render/core';
3
+
4
+ interface JsonRenderResultProps {
5
+ spec: Spec;
6
+ data: unknown;
7
+ onSendMessage?: (message: string) => void;
8
+ className?: string;
9
+ conversationMessages?: Array<{
10
+ role: string;
11
+ content: string;
12
+ }>;
13
+ /** API key for authenticated requests (form submissions etc.) */
14
+ apiKey?: string;
15
+ }
16
+ declare function JsonRenderResult({ spec: rawSpec, data, onSendMessage, className, conversationMessages, apiKey, }: JsonRenderResultProps): react_jsx_runtime.JSX.Element;
17
+
18
+ export { JsonRenderResult as J };
@@ -0,0 +1,15 @@
1
+ "use client";
2
+ 'use strict';
3
+
4
+ var chunkJ2H6MLQF_cjs = require('./chunk-J2H6MLQF.cjs');
5
+ require('./chunk-Q7T3VAJV.cjs');
6
+ require('./chunk-525KS5HM.cjs');
7
+
8
+
9
+
10
+ Object.defineProperty(exports, "JsonRenderResult", {
11
+ enumerable: true,
12
+ get: function () { return chunkJ2H6MLQF_cjs.JsonRenderResult; }
13
+ });
14
+ //# sourceMappingURL=JsonRenderResult-GQOYPLVH.cjs.map
15
+ //# sourceMappingURL=JsonRenderResult-GQOYPLVH.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"JsonRenderResult-GQOYPLVH.cjs"}
@@ -0,0 +1,6 @@
1
+ "use client";
2
+ export { JsonRenderResult } from './chunk-RPDJXB3U.js';
3
+ import './chunk-5T4FJ2SR.js';
4
+ import './chunk-3RW7O444.js';
5
+ //# sourceMappingURL=JsonRenderResult-ZFJ6VWMS.js.map
6
+ //# sourceMappingURL=JsonRenderResult-ZFJ6VWMS.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"JsonRenderResult-ZFJ6VWMS.js"}
@@ -0,0 +1,148 @@
1
+ import { RefObject, ComponentType } from 'react';
2
+ import { f as LiveChatState, e as LiveChatMessage, C as ChatProviderProps, c as ChatMessage, a as ChatConfig, b as ChatEventCallbacks } from './types-DKJ_-nbG.js';
3
+
4
+ type ChatStatus$1 = "idle" | "streaming" | "error";
5
+ interface ActiveTool$1 {
6
+ toolName: string;
7
+ state: "partial-call" | "call" | "output-available";
8
+ args: Record<string, unknown>;
9
+ result?: unknown;
10
+ renderMode: string;
11
+ }
12
+ /** Options for the headless `useAigentycChat` hook (same shape as ChatProviderProps). */
13
+ type UseAigentycChatOptions = Omit<ChatProviderProps, "children" | "slots" | "theme">;
14
+ /** Live chat sub-object returned by the hook. */
15
+ interface LiveChatReturn {
16
+ state: LiveChatState;
17
+ messages: LiveChatMessage[];
18
+ operatorName: string;
19
+ queuePosition: number;
20
+ showIdentityForm: boolean;
21
+ initiate: (visitorName?: string, visitorEmail?: string) => Promise<void>;
22
+ send: (content: string) => void;
23
+ end: () => void;
24
+ cancel: () => void;
25
+ submitRating: (rating: "positive" | "negative", comment?: string) => void;
26
+ returnToAI: () => void;
27
+ requestManualHandoff: () => void;
28
+ setShowIdentityForm: (show: boolean) => void;
29
+ }
30
+ /** Return value of `useAigentycChat`. */
31
+ interface UseAigentycChatReturn {
32
+ messages: ChatMessage[];
33
+ status: ChatStatus$1;
34
+ error: Error | undefined;
35
+ sessionId: string;
36
+ sendMessage: (content: string) => void;
37
+ stopGeneration: () => void;
38
+ newConversation: () => void;
39
+ clearMessages: () => void;
40
+ activeTools: ActiveTool$1[];
41
+ liveChat: LiveChatReturn;
42
+ chatRef: RefObject<HTMLDivElement | null>;
43
+ }
44
+ /**
45
+ * Standalone headless hook for Aigentyc Chat. No provider needed.
46
+ *
47
+ * Creates its own transport, session, and persistence internally. Use this
48
+ * when you want full control over the UI but still want all SDK features
49
+ * (chat, tools, live chat, persistence).
50
+ */
51
+ declare function useAigentycChat(options: UseAigentycChatOptions): UseAigentycChatReturn;
52
+
53
+ type ChatStatus = "idle" | "streaming" | "error";
54
+ interface ActiveTool {
55
+ toolName: string;
56
+ state: "partial-call" | "call" | "output-available";
57
+ args: Record<string, unknown>;
58
+ result?: unknown;
59
+ renderMode: string;
60
+ }
61
+ interface ChatContextValue {
62
+ messages: ChatMessage[];
63
+ status: ChatStatus;
64
+ error: Error | undefined;
65
+ sessionId: string;
66
+ config: ChatConfig;
67
+ activeTools: ActiveTool[];
68
+ sendMessage: (content: string) => void;
69
+ stopGeneration: () => void;
70
+ newConversation: () => void;
71
+ clearMessages: () => void;
72
+ callbacks?: ChatEventCallbacks;
73
+ }
74
+ /**
75
+ * Returns the chat context. Must be used within a `ChatContextProvider`.
76
+ */
77
+ declare function useChatContext(): ChatContextValue;
78
+
79
+ interface LiveChatContextValue {
80
+ /** Current live chat state machine state. */
81
+ state: LiveChatState;
82
+ /** Live chat messages. */
83
+ messages: LiveChatMessage[];
84
+ /** Name of the connected operator. */
85
+ operatorName: string;
86
+ /** Current position in queue. */
87
+ queuePosition: number;
88
+ /** Whether to show the visitor identity form. */
89
+ showIdentityForm: boolean;
90
+ /** Initiate a live chat session. */
91
+ initiate: (visitorName?: string, visitorEmail?: string) => Promise<void>;
92
+ /** Send a message in live chat. */
93
+ send: (content: string) => void;
94
+ /** End the live chat session. */
95
+ end: () => void;
96
+ /** Cancel a pending live chat request. */
97
+ cancel: () => void;
98
+ /** Submit a satisfaction rating. */
99
+ submitRating: (rating: "positive" | "negative", comment?: string) => void;
100
+ /** Return to AI chat mode. */
101
+ returnToAI: () => void;
102
+ /** Request manual handoff (shows identity form). */
103
+ requestManualHandoff: () => void;
104
+ /** Control identity form visibility. */
105
+ setShowIdentityForm: (show: boolean) => void;
106
+ /** Register a getter for AI chat history (used for context handoff). */
107
+ registerAiHistoryGetter: (getter: () => Array<{
108
+ role: string;
109
+ content: string;
110
+ }>) => void;
111
+ /** Pre-filled user info. */
112
+ userInfo?: {
113
+ name?: string;
114
+ email?: string;
115
+ } | null;
116
+ }
117
+ /**
118
+ * Returns the live chat context, or `null` if not within a LiveChatProvider.
119
+ *
120
+ * Live chat is opt-in (`enableLiveChat` on `ChatProvider`), so components that
121
+ * optionally show live-chat UI should handle the null case gracefully.
122
+ */
123
+ declare function useLiveChat(): LiveChatContextValue | null;
124
+
125
+ /**
126
+ * All available slot names that can be overridden.
127
+ */
128
+ type SlotName = "header" | "footer" | "input" | "welcomePage" | "userMessage" | "assistantMessage" | "systemMessage" | "loader" | "feedback" | "tools" | "toolRenderers" | "liveChatPanel" | "satisfactionRating" | "visitorIdentityForm" | "floatingButton" | "emptyState";
129
+ /**
130
+ * A slot component receives the default component as a prop alongside its own props.
131
+ */
132
+ type SlotComponent<P = Record<string, unknown>> = ComponentType<P & {
133
+ DefaultComponent: ComponentType<P>;
134
+ }>;
135
+ /**
136
+ * Map of slot name to override component.
137
+ */
138
+ type SlotMap = Partial<Record<SlotName, SlotComponent<any>>>;
139
+ /**
140
+ * Returns the full SlotMap from context.
141
+ */
142
+ declare function useSlots(): SlotMap;
143
+ /**
144
+ * Returns the override component for the given slot name, or undefined if none is set.
145
+ */
146
+ declare function useSlot<P = Record<string, unknown>>(name: SlotName): SlotComponent<P> | undefined;
147
+
148
+ export { type LiveChatReturn as L, type UseAigentycChatOptions as U, type UseAigentycChatReturn as a, useChatContext as b, useLiveChat as c, useSlot as d, useSlots as e, useAigentycChat as u };
@@ -0,0 +1,148 @@
1
+ import { RefObject, ComponentType } from 'react';
2
+ import { f as LiveChatState, e as LiveChatMessage, C as ChatProviderProps, c as ChatMessage, a as ChatConfig, b as ChatEventCallbacks } from './types-DKJ_-nbG.cjs';
3
+
4
+ type ChatStatus$1 = "idle" | "streaming" | "error";
5
+ interface ActiveTool$1 {
6
+ toolName: string;
7
+ state: "partial-call" | "call" | "output-available";
8
+ args: Record<string, unknown>;
9
+ result?: unknown;
10
+ renderMode: string;
11
+ }
12
+ /** Options for the headless `useAigentycChat` hook (same shape as ChatProviderProps). */
13
+ type UseAigentycChatOptions = Omit<ChatProviderProps, "children" | "slots" | "theme">;
14
+ /** Live chat sub-object returned by the hook. */
15
+ interface LiveChatReturn {
16
+ state: LiveChatState;
17
+ messages: LiveChatMessage[];
18
+ operatorName: string;
19
+ queuePosition: number;
20
+ showIdentityForm: boolean;
21
+ initiate: (visitorName?: string, visitorEmail?: string) => Promise<void>;
22
+ send: (content: string) => void;
23
+ end: () => void;
24
+ cancel: () => void;
25
+ submitRating: (rating: "positive" | "negative", comment?: string) => void;
26
+ returnToAI: () => void;
27
+ requestManualHandoff: () => void;
28
+ setShowIdentityForm: (show: boolean) => void;
29
+ }
30
+ /** Return value of `useAigentycChat`. */
31
+ interface UseAigentycChatReturn {
32
+ messages: ChatMessage[];
33
+ status: ChatStatus$1;
34
+ error: Error | undefined;
35
+ sessionId: string;
36
+ sendMessage: (content: string) => void;
37
+ stopGeneration: () => void;
38
+ newConversation: () => void;
39
+ clearMessages: () => void;
40
+ activeTools: ActiveTool$1[];
41
+ liveChat: LiveChatReturn;
42
+ chatRef: RefObject<HTMLDivElement | null>;
43
+ }
44
+ /**
45
+ * Standalone headless hook for Aigentyc Chat. No provider needed.
46
+ *
47
+ * Creates its own transport, session, and persistence internally. Use this
48
+ * when you want full control over the UI but still want all SDK features
49
+ * (chat, tools, live chat, persistence).
50
+ */
51
+ declare function useAigentycChat(options: UseAigentycChatOptions): UseAigentycChatReturn;
52
+
53
+ type ChatStatus = "idle" | "streaming" | "error";
54
+ interface ActiveTool {
55
+ toolName: string;
56
+ state: "partial-call" | "call" | "output-available";
57
+ args: Record<string, unknown>;
58
+ result?: unknown;
59
+ renderMode: string;
60
+ }
61
+ interface ChatContextValue {
62
+ messages: ChatMessage[];
63
+ status: ChatStatus;
64
+ error: Error | undefined;
65
+ sessionId: string;
66
+ config: ChatConfig;
67
+ activeTools: ActiveTool[];
68
+ sendMessage: (content: string) => void;
69
+ stopGeneration: () => void;
70
+ newConversation: () => void;
71
+ clearMessages: () => void;
72
+ callbacks?: ChatEventCallbacks;
73
+ }
74
+ /**
75
+ * Returns the chat context. Must be used within a `ChatContextProvider`.
76
+ */
77
+ declare function useChatContext(): ChatContextValue;
78
+
79
+ interface LiveChatContextValue {
80
+ /** Current live chat state machine state. */
81
+ state: LiveChatState;
82
+ /** Live chat messages. */
83
+ messages: LiveChatMessage[];
84
+ /** Name of the connected operator. */
85
+ operatorName: string;
86
+ /** Current position in queue. */
87
+ queuePosition: number;
88
+ /** Whether to show the visitor identity form. */
89
+ showIdentityForm: boolean;
90
+ /** Initiate a live chat session. */
91
+ initiate: (visitorName?: string, visitorEmail?: string) => Promise<void>;
92
+ /** Send a message in live chat. */
93
+ send: (content: string) => void;
94
+ /** End the live chat session. */
95
+ end: () => void;
96
+ /** Cancel a pending live chat request. */
97
+ cancel: () => void;
98
+ /** Submit a satisfaction rating. */
99
+ submitRating: (rating: "positive" | "negative", comment?: string) => void;
100
+ /** Return to AI chat mode. */
101
+ returnToAI: () => void;
102
+ /** Request manual handoff (shows identity form). */
103
+ requestManualHandoff: () => void;
104
+ /** Control identity form visibility. */
105
+ setShowIdentityForm: (show: boolean) => void;
106
+ /** Register a getter for AI chat history (used for context handoff). */
107
+ registerAiHistoryGetter: (getter: () => Array<{
108
+ role: string;
109
+ content: string;
110
+ }>) => void;
111
+ /** Pre-filled user info. */
112
+ userInfo?: {
113
+ name?: string;
114
+ email?: string;
115
+ } | null;
116
+ }
117
+ /**
118
+ * Returns the live chat context, or `null` if not within a LiveChatProvider.
119
+ *
120
+ * Live chat is opt-in (`enableLiveChat` on `ChatProvider`), so components that
121
+ * optionally show live-chat UI should handle the null case gracefully.
122
+ */
123
+ declare function useLiveChat(): LiveChatContextValue | null;
124
+
125
+ /**
126
+ * All available slot names that can be overridden.
127
+ */
128
+ type SlotName = "header" | "footer" | "input" | "welcomePage" | "userMessage" | "assistantMessage" | "systemMessage" | "loader" | "feedback" | "tools" | "toolRenderers" | "liveChatPanel" | "satisfactionRating" | "visitorIdentityForm" | "floatingButton" | "emptyState";
129
+ /**
130
+ * A slot component receives the default component as a prop alongside its own props.
131
+ */
132
+ type SlotComponent<P = Record<string, unknown>> = ComponentType<P & {
133
+ DefaultComponent: ComponentType<P>;
134
+ }>;
135
+ /**
136
+ * Map of slot name to override component.
137
+ */
138
+ type SlotMap = Partial<Record<SlotName, SlotComponent<any>>>;
139
+ /**
140
+ * Returns the full SlotMap from context.
141
+ */
142
+ declare function useSlots(): SlotMap;
143
+ /**
144
+ * Returns the override component for the given slot name, or undefined if none is set.
145
+ */
146
+ declare function useSlot<P = Record<string, unknown>>(name: SlotName): SlotComponent<P> | undefined;
147
+
148
+ export { type LiveChatReturn as L, type UseAigentycChatOptions as U, type UseAigentycChatReturn as a, useChatContext as b, useLiveChat as c, useSlot as d, useSlots as e, useAigentycChat as u };
@@ -0,0 +1,5 @@
1
+ "use client";
2
+ export { VisualizationRenderer, VisualizationRenderer_default as default } from './chunk-5T4FJ2SR.js';
3
+ import './chunk-3RW7O444.js';
4
+ //# sourceMappingURL=VisualizationRenderer-FNFYNN66.js.map
5
+ //# sourceMappingURL=VisualizationRenderer-FNFYNN66.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"VisualizationRenderer-FNFYNN66.js"}
@@ -0,0 +1,20 @@
1
+ "use client";
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var chunkQ7T3VAJV_cjs = require('./chunk-Q7T3VAJV.cjs');
7
+ require('./chunk-525KS5HM.cjs');
8
+
9
+
10
+
11
+ Object.defineProperty(exports, "VisualizationRenderer", {
12
+ enumerable: true,
13
+ get: function () { return chunkQ7T3VAJV_cjs.VisualizationRenderer; }
14
+ });
15
+ Object.defineProperty(exports, "default", {
16
+ enumerable: true,
17
+ get: function () { return chunkQ7T3VAJV_cjs.VisualizationRenderer_default; }
18
+ });
19
+ //# sourceMappingURL=VisualizationRenderer-VKMZXRUX.cjs.map
20
+ //# sourceMappingURL=VisualizationRenderer-VKMZXRUX.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"VisualizationRenderer-VKMZXRUX.cjs"}