@djangocfg/ui-tools 2.1.335 → 2.1.337

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 (194) hide show
  1. package/README.md +68 -2
  2. package/dist/ChatRoot-PNNGQCYF.css +7 -0
  3. package/dist/ChatRoot-PNNGQCYF.css.map +1 -0
  4. package/dist/ChatRoot-XV2QXMV4.mjs +5 -0
  5. package/dist/ChatRoot-XV2QXMV4.mjs.map +1 -0
  6. package/dist/ChatRoot-YX4RLHQX.cjs +14 -0
  7. package/dist/ChatRoot-YX4RLHQX.cjs.map +1 -0
  8. package/dist/{CronScheduler.client-3O3VU4CI.mjs → CronScheduler.client-DLMXCPAJ.mjs} +4 -4
  9. package/dist/{CronScheduler.client-3O3VU4CI.mjs.map → CronScheduler.client-DLMXCPAJ.mjs.map} +1 -1
  10. package/dist/{CronScheduler.client-A4GO6YBY.cjs → CronScheduler.client-WEJF4PWQ.cjs} +14 -14
  11. package/dist/{CronScheduler.client-A4GO6YBY.cjs.map → CronScheduler.client-WEJF4PWQ.cjs.map} +1 -1
  12. package/dist/{DocsLayout-XLDB6CJ2.cjs → DocsLayout-N5ZJZPBY.cjs} +200 -199
  13. package/dist/DocsLayout-N5ZJZPBY.cjs.map +1 -0
  14. package/dist/{DocsLayout-CTJINVBM.mjs → DocsLayout-VFPPNKSQ.mjs} +7 -6
  15. package/dist/DocsLayout-VFPPNKSQ.mjs.map +1 -0
  16. package/dist/JsonSchemaForm-DD7CLRIG.cjs +13 -0
  17. package/dist/{JsonSchemaForm-6WMS4CIY.cjs.map → JsonSchemaForm-DD7CLRIG.cjs.map} +1 -1
  18. package/dist/JsonSchemaForm-XKUIVELK.mjs +4 -0
  19. package/dist/{JsonSchemaForm-KX4JT3M4.mjs.map → JsonSchemaForm-XKUIVELK.mjs.map} +1 -1
  20. package/dist/JsonTree-55625VVH.mjs +5 -0
  21. package/dist/{JsonTree-F27RMYSI.cjs.map → JsonTree-55625VVH.mjs.map} +1 -1
  22. package/dist/JsonTree-DCM5QGWF.cjs +11 -0
  23. package/dist/{JsonTree-QTJYSHCV.mjs.map → JsonTree-DCM5QGWF.cjs.map} +1 -1
  24. package/dist/{LottiePlayer.client-6WVWDO75.cjs → LottiePlayer.client-2S7ISJ2S.cjs} +6 -6
  25. package/dist/{LottiePlayer.client-6WVWDO75.cjs.map → LottiePlayer.client-2S7ISJ2S.cjs.map} +1 -1
  26. package/dist/{LottiePlayer.client-B4I6WNZM.mjs → LottiePlayer.client-5LDSSJWS.mjs} +4 -4
  27. package/dist/{LottiePlayer.client-B4I6WNZM.mjs.map → LottiePlayer.client-5LDSSJWS.mjs.map} +1 -1
  28. package/dist/{MapContainer-RYG4HPH4.cjs → MapContainer-76YL2JXL.cjs} +8 -8
  29. package/dist/{MapContainer-RYG4HPH4.cjs.map → MapContainer-76YL2JXL.cjs.map} +1 -1
  30. package/dist/{MapContainer-GXQLP5WY.mjs → MapContainer-7HXBI3OH.mjs} +3 -3
  31. package/dist/{MapContainer-GXQLP5WY.mjs.map → MapContainer-7HXBI3OH.mjs.map} +1 -1
  32. package/dist/{Mermaid.client-SXRRI2YW.mjs → Mermaid.client-NL4SVR7F.mjs} +4 -4
  33. package/dist/{Mermaid.client-SXRRI2YW.mjs.map → Mermaid.client-NL4SVR7F.mjs.map} +1 -1
  34. package/dist/{Mermaid.client-W76R5AKJ.cjs → Mermaid.client-NNTI6DFX.cjs} +26 -26
  35. package/dist/{Mermaid.client-W76R5AKJ.cjs.map → Mermaid.client-NNTI6DFX.cjs.map} +1 -1
  36. package/dist/Player-BRV7XTWR.mjs +4 -0
  37. package/dist/{Player-M3GC3VPE.mjs.map → Player-BRV7XTWR.mjs.map} +1 -1
  38. package/dist/Player-PM7F7DD7.cjs +13 -0
  39. package/dist/{Player-ZL2X5LGG.cjs.map → Player-PM7F7DD7.cjs.map} +1 -1
  40. package/dist/{PrettyCode.client-RPDIE5CH.cjs → PrettyCode.client-KOHDVPPN.cjs} +13 -13
  41. package/dist/{PrettyCode.client-RPDIE5CH.cjs.map → PrettyCode.client-KOHDVPPN.cjs.map} +1 -1
  42. package/dist/{PrettyCode.client-SPMTQEG4.mjs → PrettyCode.client-ZGYGKE7G.mjs} +4 -4
  43. package/dist/{PrettyCode.client-SPMTQEG4.mjs.map → PrettyCode.client-ZGYGKE7G.mjs.map} +1 -1
  44. package/dist/TreeRoot-N72OYKXU.cjs +19 -0
  45. package/dist/{TreeRoot-A3J65L6F.mjs.map → TreeRoot-N72OYKXU.cjs.map} +1 -1
  46. package/dist/TreeRoot-VGAIXCUA.mjs +4 -0
  47. package/dist/{TreeRoot-DSK5JILT.cjs.map → TreeRoot-VGAIXCUA.mjs.map} +1 -1
  48. package/dist/chunk-2ZLKZ5VR.mjs +631 -0
  49. package/dist/chunk-2ZLKZ5VR.mjs.map +1 -0
  50. package/dist/{chunk-LFWQ36LJ.mjs → chunk-5G5YBFS6.mjs} +4 -4
  51. package/dist/{chunk-LFWQ36LJ.mjs.map → chunk-5G5YBFS6.mjs.map} +1 -1
  52. package/dist/{chunk-IHAY6FO6.cjs → chunk-5I5QNGUG.cjs} +17 -17
  53. package/dist/{chunk-IHAY6FO6.cjs.map → chunk-5I5QNGUG.cjs.map} +1 -1
  54. package/dist/{chunk-F2CMIIOH.cjs → chunk-76NNDZH6.cjs} +42 -42
  55. package/dist/{chunk-F2CMIIOH.cjs.map → chunk-76NNDZH6.cjs.map} +1 -1
  56. package/dist/chunk-B5AWZOHJ.cjs +649 -0
  57. package/dist/chunk-B5AWZOHJ.cjs.map +1 -0
  58. package/dist/{chunk-KR6B3LVY.mjs → chunk-B6IR5KSC.mjs} +3 -3
  59. package/dist/{chunk-KR6B3LVY.mjs.map → chunk-B6IR5KSC.mjs.map} +1 -1
  60. package/dist/{chunk-5LBDYFWH.mjs → chunk-C6GXVH5J.mjs} +3 -3
  61. package/dist/{chunk-5LBDYFWH.mjs.map → chunk-C6GXVH5J.mjs.map} +1 -1
  62. package/dist/{chunk-NRKD4F5X.cjs → chunk-FEN5S772.cjs} +36 -36
  63. package/dist/{chunk-NRKD4F5X.cjs.map → chunk-FEN5S772.cjs.map} +1 -1
  64. package/dist/{chunk-2SMCH62O.cjs → chunk-FP2RLYQZ.cjs} +11 -11
  65. package/dist/{chunk-2SMCH62O.cjs.map → chunk-FP2RLYQZ.cjs.map} +1 -1
  66. package/dist/{chunk-MOME6KYD.mjs → chunk-G5IEC7SR.mjs} +3 -3
  67. package/dist/{chunk-MOME6KYD.mjs.map → chunk-G5IEC7SR.mjs.map} +1 -1
  68. package/dist/{chunk-SE5IERVH.mjs → chunk-GYIO7W7M.mjs} +3 -3
  69. package/dist/{chunk-SE5IERVH.mjs.map → chunk-GYIO7W7M.mjs.map} +1 -1
  70. package/dist/{chunk-3Z3A7FHA.cjs → chunk-IEEAENLX.cjs} +48 -48
  71. package/dist/{chunk-3Z3A7FHA.cjs.map → chunk-IEEAENLX.cjs.map} +1 -1
  72. package/dist/{chunk-DFTVB66S.cjs → chunk-KNDLV4PI.cjs} +85 -85
  73. package/dist/{chunk-DFTVB66S.cjs.map → chunk-KNDLV4PI.cjs.map} +1 -1
  74. package/dist/{chunk-SSUOENAZ.mjs → chunk-KNEQRUBA.mjs} +3 -3
  75. package/dist/{chunk-SSUOENAZ.mjs.map → chunk-KNEQRUBA.mjs.map} +1 -1
  76. package/dist/{chunk-CGILA3WO.mjs → chunk-N2XQF2OL.mjs} +5 -3
  77. package/dist/{chunk-CGILA3WO.mjs.map → chunk-N2XQF2OL.mjs.map} +1 -1
  78. package/dist/{chunk-EUADAUBQ.mjs → chunk-N4MZYNR4.mjs} +4 -4
  79. package/dist/{chunk-EUADAUBQ.mjs.map → chunk-N4MZYNR4.mjs.map} +1 -1
  80. package/dist/{chunk-GGKGH5PM.mjs → chunk-OBRSGM64.mjs} +4 -4
  81. package/dist/{chunk-GGKGH5PM.mjs.map → chunk-OBRSGM64.mjs.map} +1 -1
  82. package/dist/{chunk-6JTB2X72.mjs → chunk-ODO4GMW7.mjs} +3 -3
  83. package/dist/{chunk-6JTB2X72.mjs.map → chunk-ODO4GMW7.mjs.map} +1 -1
  84. package/dist/{chunk-WGEGR3DF.cjs → chunk-OLISEQHS.cjs} +5 -2
  85. package/dist/{chunk-WGEGR3DF.cjs.map → chunk-OLISEQHS.cjs.map} +1 -1
  86. package/dist/{chunk-PZKAH7WQ.mjs → chunk-PVAX67JG.mjs} +3 -3
  87. package/dist/{chunk-PZKAH7WQ.mjs.map → chunk-PVAX67JG.mjs.map} +1 -1
  88. package/dist/{chunk-PRPG2T2E.cjs → chunk-QJ6GTUCO.cjs} +6 -6
  89. package/dist/{chunk-PRPG2T2E.cjs.map → chunk-QJ6GTUCO.cjs.map} +1 -1
  90. package/dist/chunk-QW4RBGHN.cjs +961 -0
  91. package/dist/chunk-QW4RBGHN.cjs.map +1 -0
  92. package/dist/{chunk-33AMWFBZ.cjs → chunk-SGP7V2UW.cjs} +15 -15
  93. package/dist/{chunk-33AMWFBZ.cjs.map → chunk-SGP7V2UW.cjs.map} +1 -1
  94. package/dist/{chunk-FX2QFYWF.mjs → chunk-VWQ5WOIL.mjs} +3 -3
  95. package/dist/{chunk-FX2QFYWF.mjs.map → chunk-VWQ5WOIL.mjs.map} +1 -1
  96. package/dist/{chunk-ZLQHUZDU.cjs → chunk-YDPDTOSP.cjs} +139 -139
  97. package/dist/{chunk-ZLQHUZDU.cjs.map → chunk-YDPDTOSP.cjs.map} +1 -1
  98. package/dist/{chunk-77HQWEQ6.cjs → chunk-YW5IVWHQ.cjs} +33 -33
  99. package/dist/{chunk-77HQWEQ6.cjs.map → chunk-YW5IVWHQ.cjs.map} +1 -1
  100. package/dist/chunk-YWSQDBNU.mjs +2339 -0
  101. package/dist/chunk-YWSQDBNU.mjs.map +1 -0
  102. package/dist/{chunk-YXBOAGIM.cjs → chunk-YXZ6GU7H.cjs} +7 -7
  103. package/dist/{chunk-YXBOAGIM.cjs.map → chunk-YXZ6GU7H.cjs.map} +1 -1
  104. package/dist/{chunk-62Y65TGK.mjs → chunk-ZUFTH5IR.mjs} +8 -631
  105. package/dist/chunk-ZUFTH5IR.mjs.map +1 -0
  106. package/dist/chunk-ZWPBBAR2.cjs +2379 -0
  107. package/dist/chunk-ZWPBBAR2.cjs.map +1 -0
  108. package/dist/components-EHOGXATG.cjs +22 -0
  109. package/dist/{components-5UXYNAKR.cjs.map → components-EHOGXATG.cjs.map} +1 -1
  110. package/dist/components-MQ6DR7TX.cjs +26 -0
  111. package/dist/{components-CFXOEVPN.mjs.map → components-MQ6DR7TX.cjs.map} +1 -1
  112. package/dist/components-XRX7QGLB.mjs +5 -0
  113. package/dist/{components-WYEZL5TE.cjs.map → components-XRX7QGLB.mjs.map} +1 -1
  114. package/dist/components-YATKRWLH.mjs +5 -0
  115. package/dist/{components-ZAGG2PBO.mjs.map → components-YATKRWLH.mjs.map} +1 -1
  116. package/dist/file-icon/index.cjs +6 -6
  117. package/dist/file-icon/index.mjs +1 -1
  118. package/dist/index.cjs +739 -215
  119. package/dist/index.cjs.map +1 -1
  120. package/dist/index.d.cts +1025 -39
  121. package/dist/index.d.ts +1025 -39
  122. package/dist/index.mjs +387 -31
  123. package/dist/index.mjs.map +1 -1
  124. package/dist/tree/index.cjs +38 -38
  125. package/dist/tree/index.d.cts +2 -2
  126. package/dist/tree/index.d.ts +2 -2
  127. package/dist/tree/index.mjs +3 -3
  128. package/package.json +6 -6
  129. package/src/index.ts +5 -0
  130. package/src/stories/index.ts +3 -1
  131. package/src/tools/Chat/Chat.story.tsx +1006 -0
  132. package/src/tools/Chat/README.md +528 -0
  133. package/src/tools/Chat/components/Attachments.tsx +192 -0
  134. package/src/tools/Chat/components/ChatRoot.tsx +208 -0
  135. package/src/tools/Chat/components/Composer.tsx +134 -0
  136. package/src/tools/Chat/components/EmptyState.tsx +47 -0
  137. package/src/tools/Chat/components/ErrorBanner.tsx +47 -0
  138. package/src/tools/Chat/components/JumpToLatest.tsx +30 -0
  139. package/src/tools/Chat/components/MessageActions.tsx +72 -0
  140. package/src/tools/Chat/components/MessageBubble.tsx +228 -0
  141. package/src/tools/Chat/components/MessageList.tsx +82 -0
  142. package/src/tools/Chat/components/Sources.tsx +55 -0
  143. package/src/tools/Chat/components/StreamingIndicator.tsx +29 -0
  144. package/src/tools/Chat/components/ToolCalls.tsx +172 -0
  145. package/src/tools/Chat/components/index.ts +24 -0
  146. package/src/tools/Chat/config.ts +55 -0
  147. package/src/tools/Chat/context/ChatProvider.tsx +126 -0
  148. package/src/tools/Chat/context/index.ts +9 -0
  149. package/src/tools/Chat/core/audio/audioBus.ts +172 -0
  150. package/src/tools/Chat/core/audio/index.ts +8 -0
  151. package/src/tools/Chat/core/audio/preferences.ts +68 -0
  152. package/src/tools/Chat/core/audio/types.ts +49 -0
  153. package/src/tools/Chat/core/ids.ts +16 -0
  154. package/src/tools/Chat/core/index.ts +5 -0
  155. package/src/tools/Chat/core/logger.ts +73 -0
  156. package/src/tools/Chat/core/markdown.ts +56 -0
  157. package/src/tools/Chat/core/payload-dispatch.ts +54 -0
  158. package/src/tools/Chat/core/persona.ts +35 -0
  159. package/src/tools/Chat/core/reducer.ts +335 -0
  160. package/src/tools/Chat/core/transport/http.ts +167 -0
  161. package/src/tools/Chat/core/transport/index.ts +13 -0
  162. package/src/tools/Chat/core/transport/mock.ts +134 -0
  163. package/src/tools/Chat/core/transport/sse.ts +116 -0
  164. package/src/tools/Chat/core/transport/types.ts +24 -0
  165. package/src/tools/Chat/hooks/index.ts +26 -0
  166. package/src/tools/Chat/hooks/useChat.ts +555 -0
  167. package/src/tools/Chat/hooks/useChatAudio.ts +191 -0
  168. package/src/tools/Chat/hooks/useChatComposer.ts +227 -0
  169. package/src/tools/Chat/hooks/useChatHistory.ts +59 -0
  170. package/src/tools/Chat/hooks/useChatLayout.ts +111 -0
  171. package/src/tools/Chat/hooks/useChatLightbox.ts +34 -0
  172. package/src/tools/Chat/hooks/useChatScroll.ts +132 -0
  173. package/src/tools/Chat/index.ts +161 -0
  174. package/src/tools/Chat/lazy.tsx +14 -0
  175. package/src/tools/Chat/types.ts +237 -0
  176. package/src/tools/Chat/utils/collectImageAttachments.ts +13 -0
  177. package/src/tools/Map/README.md +384 -0
  178. package/dist/DocsLayout-CTJINVBM.mjs.map +0 -1
  179. package/dist/DocsLayout-XLDB6CJ2.cjs.map +0 -1
  180. package/dist/JsonSchemaForm-6WMS4CIY.cjs +0 -13
  181. package/dist/JsonSchemaForm-KX4JT3M4.mjs +0 -4
  182. package/dist/JsonTree-F27RMYSI.cjs +0 -11
  183. package/dist/JsonTree-QTJYSHCV.mjs +0 -5
  184. package/dist/Player-M3GC3VPE.mjs +0 -4
  185. package/dist/Player-ZL2X5LGG.cjs +0 -13
  186. package/dist/TreeRoot-A3J65L6F.mjs +0 -4
  187. package/dist/TreeRoot-DSK5JILT.cjs +0 -19
  188. package/dist/chunk-62Y65TGK.mjs.map +0 -1
  189. package/dist/chunk-TKSFZHCG.cjs +0 -1597
  190. package/dist/chunk-TKSFZHCG.cjs.map +0 -1
  191. package/dist/components-5UXYNAKR.cjs +0 -22
  192. package/dist/components-CFXOEVPN.mjs +0 -5
  193. package/dist/components-WYEZL5TE.cjs +0 -26
  194. package/dist/components-ZAGG2PBO.mjs +0 -5
package/dist/index.d.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as React$1 from 'react';
3
- import React__default, { ReactNode, ComponentType } from 'react';
2
+ import * as react from 'react';
3
+ import react__default, { ReactNode, ComponentType, RefObject, ChangeEvent, KeyboardEvent, ClipboardEvent } from 'react';
4
4
  import { Components } from 'react-markdown';
5
5
  import { ViewState } from 'react-map-gl/maplibre';
6
6
  import { Language } from 'prism-react-renderer';
@@ -13,11 +13,12 @@ export { CustomJsonSchema7, CustomJsonSchema7Type, CustomJsonUiDisabledWhenRule,
13
13
  import { CommonExternalProps } from 'react-json-tree';
14
14
  import { b as TreeRootProps } from './types-CevSbyfD.cjs';
15
15
  export { c as DEFAULT_TREE_APPEARANCE, D as DEFAULT_TREE_LABELS, F as FlatRow, R as ResolvedAppearance, m as TreeAccentIntensity, k as TreeAppearance, e as TreeContextMenuSlot, l as TreeDensity, f as TreeItemId, g as TreeLabels, j as TreeLoadChildren, T as TreeNode, n as TreeRadius, i as TreeRowRenderProps, a as TreeRowSlot, h as TreeSelectionMode, d as appearanceToStyle, r as resolveAppearance } from './types-CevSbyfD.cjs';
16
+ import * as zustand_middleware from 'zustand/middleware';
17
+ import * as zustand from 'zustand';
18
+ import { ConsolaInstance } from 'consola';
16
19
  import { MediaPlayerInstance } from '@vidstack/react';
17
20
  import * as monaco from 'monaco-editor';
18
21
  export { ChildCache, ChildEntry, ChildEntryStatus, DemoNode, FlattenInput, PersistedTreeState, TreeRoot as Tree, TreeChevron, TreeChevronProps, TreeContent, TreeContentProps, TreeContextValue, TreeEmpty, TreeEmptyProps, TreeError, TreeErrorProps, TreeIcon, TreeIconProps, TreeIndentGuides, TreeIndentGuidesProps, TreeLabel, TreeLabelProps, TreeProvider, TreeProviderProps, TreeRoot, TreeRow, TreeRowProps, TreeSearchInput, TreeSearchInputProps, TreeSkeleton, TreeSkeletonProps, UseTreeKeyboardOptions, UseTreeTypeAheadOptions, clearTreeState, createChildCache, createDemoTree, flattenTree, loadTreeState, resolveChildren, saveTreeState, useTreeActions, useTreeContext, useTreeExpansion, useTreeFocus, useTreeKeyboard, useTreeLabels, useTreeRows, useTreeSearch, useTreeSelection, useTreeTypeAhead } from './tree/index.cjs';
19
- import * as zustand_middleware from 'zustand/middleware';
20
- import * as zustand from 'zustand';
21
22
 
22
23
  interface LoadingFallbackProps {
23
24
  /** Minimum height of the loading container */
@@ -146,9 +147,9 @@ interface LinkRule {
146
147
  * (markdown-rendered React content). */
147
148
  render: (props: {
148
149
  href: string;
149
- children: React__default.ReactNode;
150
+ children: react__default.ReactNode;
150
151
  isUser: boolean;
151
- }) => React__default.ReactNode;
152
+ }) => react__default.ReactNode;
152
153
  /** URL scheme(s) to whitelist on the sanitize side, e.g. `['cmdop']`.
153
154
  * Bare schemes only — no `://`. Optional; omit for `http(s)` rules. */
154
155
  protocols?: readonly string[];
@@ -259,12 +260,12 @@ interface MarkdownMessageProps {
259
260
  * />
260
261
  * ```
261
262
  */
262
- declare const MarkdownMessage: React__default.FC<MarkdownMessageProps>;
263
+ declare const MarkdownMessage: react__default.FC<MarkdownMessageProps>;
263
264
 
264
265
  /** Recursively concatenate the text content of a React.ReactNode tree.
265
266
  * Used by the markdown renderers (e.g. `<pre>` extracting code) and
266
267
  * by consumers that need a plain-string label out of link children. */
267
- declare function extractTextFromChildren(children: React__default.ReactNode): string;
268
+ declare function extractTextFromChildren(children: react__default.ReactNode): string;
268
269
 
269
270
  interface UseCollapsibleContentOptions {
270
271
  /**
@@ -363,11 +364,11 @@ interface MapContainerProps {
363
364
  *
364
365
  * Automatically shows loading state while MapLibre GL loads (~800KB)
365
366
  */
366
- declare const LazyMapContainer: React$1.ComponentType<MapContainerProps>;
367
+ declare const LazyMapContainer: react.ComponentType<MapContainerProps>;
367
368
  /**
368
369
  * LazyMapView - Lazy-loaded map view (alias for MapContainer)
369
370
  */
370
- declare const LazyMapView: React$1.ComponentType<Omit<MapContainerProps, "initialViewport">>;
371
+ declare const LazyMapView: react.ComponentType<Omit<MapContainerProps, "initialViewport">>;
371
372
 
372
373
  /**
373
374
  * Mermaid Component - Dynamic Import Wrapper
@@ -390,14 +391,14 @@ interface MermaidProps {
390
391
  */
391
392
  scrollIsolation?: boolean;
392
393
  }
393
- declare const Mermaid: React__default.FC<MermaidProps>;
394
+ declare const Mermaid: react__default.FC<MermaidProps>;
394
395
 
395
396
  /**
396
397
  * LazyMermaid - Lazy-loaded Mermaid diagram renderer
397
398
  *
398
399
  * Automatically shows loading state while Mermaid loads (~800KB)
399
400
  */
400
- declare const LazyMermaid: React$1.ComponentType<MermaidProps>;
401
+ declare const LazyMermaid: react.ComponentType<MermaidProps>;
401
402
 
402
403
  interface PrettyCodeProps$1 {
403
404
  data: string | object;
@@ -419,7 +420,7 @@ interface PrettyCodeProps$1 {
419
420
  *
420
421
  * Automatically shows loading state while Prism loads (~500KB)
421
422
  */
422
- declare const LazyPrettyCode: React$1.ComponentType<PrettyCodeProps$1>;
423
+ declare const LazyPrettyCode: react.ComponentType<PrettyCodeProps$1>;
423
424
 
424
425
  interface ApiKey {
425
426
  id: string;
@@ -487,7 +488,7 @@ interface PlaygroundProps$1 {
487
488
  config: PlaygroundConfig;
488
489
  }
489
490
 
490
- declare const LazyOpenapiViewer: React$1.FC<PlaygroundProps$1>;
491
+ declare const LazyOpenapiViewer: react.FC<PlaygroundProps$1>;
491
492
 
492
493
  /** Visual density for form controls. */
493
494
  type JsonFormDensity = 'comfortable' | 'compact';
@@ -547,7 +548,7 @@ interface JsonSchemaFormProps<T = any> extends Omit<Partial<FormProps<T>>, 'sche
547
548
  *
548
549
  * Automatically shows loading state while RJSF loads (~300KB)
549
550
  */
550
- declare const LazyJsonSchemaForm: React$1.ComponentType<JsonSchemaFormProps<any>>;
551
+ declare const LazyJsonSchemaForm: react.ComponentType<JsonSchemaFormProps<any>>;
551
552
 
552
553
  /**
553
554
  * JSON Schema Form Component
@@ -842,7 +843,7 @@ interface LottiePlayerProps {
842
843
  *
843
844
  * Automatically shows loading state while Lottie loads (~200KB)
844
845
  */
845
- declare const LazyLottiePlayer: React$1.ComponentType<LottiePlayerProps>;
846
+ declare const LazyLottiePlayer: react.ComponentType<LottiePlayerProps>;
846
847
 
847
848
  type WaveformMode = 'peaks' | 'live' | 'bars' | 'progress' | 'none';
848
849
  type WaveformConfig = {
@@ -895,7 +896,7 @@ type PlayerHandle = {
895
896
  getDuration: () => number;
896
897
  };
897
898
 
898
- declare const LazyPlayer: React$1.ComponentType<PlayerProps>;
899
+ declare const LazyPlayer: react.ComponentType<PlayerProps>;
899
900
 
900
901
  /**
901
902
  * Video source type definitions
@@ -1042,7 +1043,7 @@ interface VideoPlayerProps extends CommonPlayerSettings, CommonPlayerEvents {
1042
1043
  /** Preloader timeout in ms */
1043
1044
  preloaderTimeout?: number;
1044
1045
  /** Custom error fallback UI */
1045
- errorFallback?: React__default.ReactNode | ((props: ErrorFallbackProps) => React__default.ReactNode);
1046
+ errorFallback?: react__default.ReactNode | ((props: ErrorFallbackProps) => react__default.ReactNode);
1046
1047
  }
1047
1048
  /** VideoPlayer ref methods */
1048
1049
  interface VideoPlayerRef {
@@ -1080,7 +1081,7 @@ interface VidstackProviderProps extends CommonPlayerSettings, CommonPlayerEvents
1080
1081
  theme?: 'default' | 'minimal' | 'modern';
1081
1082
  showInfo?: boolean;
1082
1083
  className?: string;
1083
- errorFallback?: React__default.ReactNode | ((props: ErrorFallbackProps) => React__default.ReactNode);
1084
+ errorFallback?: react__default.ReactNode | ((props: ErrorFallbackProps) => react__default.ReactNode);
1084
1085
  }
1085
1086
  /** Props passed to Native provider */
1086
1087
  interface NativeProviderProps extends CommonPlayerSettings, CommonPlayerEvents {
@@ -1099,7 +1100,7 @@ interface StreamProviderProps extends CommonPlayerSettings, CommonPlayerEvents {
1099
1100
  disableContextMenu?: boolean;
1100
1101
  showPreloader?: boolean;
1101
1102
  preloaderTimeout?: number;
1102
- errorFallback?: React__default.ReactNode | ((props: ErrorFallbackProps) => React__default.ReactNode);
1103
+ errorFallback?: react__default.ReactNode | ((props: ErrorFallbackProps) => react__default.ReactNode);
1103
1104
  }
1104
1105
  /** Options for resolving file source */
1105
1106
  interface ResolveFileSourceOptions {
@@ -1127,7 +1128,7 @@ interface VideoPlayerContextValue {
1127
1128
  sessionId?: string | null;
1128
1129
  }
1129
1130
  interface VideoPlayerProviderProps extends VideoPlayerContextValue {
1130
- children: React__default.ReactNode;
1131
+ children: react__default.ReactNode;
1131
1132
  }
1132
1133
  /** Simplified stream source (uses context for getStreamUrl) */
1133
1134
  interface SimpleStreamSource {
@@ -1147,7 +1148,7 @@ interface SimpleStreamSource {
1147
1148
  *
1148
1149
  * Automatically shows loading state while Vidstack loads (~150KB)
1149
1150
  */
1150
- declare const LazyVideoPlayer: React$1.ComponentType<VideoPlayerProps>;
1151
+ declare const LazyVideoPlayer: react.ComponentType<VideoPlayerProps>;
1151
1152
 
1152
1153
  type JsonTreeMode = 'full' | 'compact' | 'inline';
1153
1154
  interface JsonTreeConfig {
@@ -1226,7 +1227,7 @@ interface JsonTreeProps {
1226
1227
  * // Inline mode (minimal, for embedding)
1227
1228
  * <LazyJsonTree data={obj} mode="inline" />
1228
1229
  */
1229
- declare const LazyJsonTree: React$1.ComponentType<JsonTreeProps>;
1230
+ declare const LazyJsonTree: react.ComponentType<JsonTreeProps>;
1230
1231
 
1231
1232
  /**
1232
1233
  * ImageViewer type definitions
@@ -1269,7 +1270,7 @@ interface ImageViewerProps {
1269
1270
  *
1270
1271
  * Automatically shows loading state while ImageViewer loads (~50KB)
1271
1272
  */
1272
- declare const LazyImageViewer: React$1.ComponentType<ImageViewerProps>;
1273
+ declare const LazyImageViewer: react.ComponentType<ImageViewerProps>;
1273
1274
 
1274
1275
  /**
1275
1276
  * CronScheduler Types
@@ -1377,9 +1378,994 @@ interface CronSchedulerProviderProps {
1377
1378
  * timeFormat="24h"
1378
1379
  * />
1379
1380
  */
1380
- declare const LazyCronScheduler: React$1.ComponentType<CronSchedulerProps>;
1381
+ declare const LazyCronScheduler: react.ComponentType<CronSchedulerProps>;
1382
+
1383
+ declare const LazyTree: react.ComponentType<TreeRootProps<unknown>>;
1384
+
1385
+ /**
1386
+ * Public types for the Chat tool.
1387
+ *
1388
+ * Shapes here are the contract between transport adapters, the reducer,
1389
+ * the hooks layer and the components. Keep serializable (no Date, no Map).
1390
+ */
1391
+ type ChatRole = 'user' | 'assistant' | 'system';
1392
+ interface ChatToolCall {
1393
+ id: string;
1394
+ name: string;
1395
+ input: unknown;
1396
+ output?: unknown;
1397
+ /** Live buffer accumulated during streaming. Replaced by `output` on completion. */
1398
+ streamingText?: string;
1399
+ status: 'running' | 'success' | 'error' | 'cancelled';
1400
+ startedAt: number;
1401
+ endedAt?: number;
1402
+ /** Optional grouping label for parallel/fan-out execution. */
1403
+ sourceHostname?: string;
1404
+ }
1405
+ interface ChatAttachment {
1406
+ id: string;
1407
+ type: 'image' | 'file' | 'audio' | 'video';
1408
+ url: string;
1409
+ thumbnailUrl?: string;
1410
+ name?: string;
1411
+ mimeType?: string;
1412
+ sizeBytes?: number;
1413
+ status?: 'uploading' | 'ready' | 'error';
1414
+ /** 0..1 while uploading. */
1415
+ progress?: number;
1416
+ /** Extracted text from images (OCR). */
1417
+ ocrText?: string;
1418
+ }
1419
+ interface ChatSource {
1420
+ title: string;
1421
+ url: string;
1422
+ snippet?: string;
1423
+ chunkIndex?: number;
1424
+ }
1425
+ interface ChatPersona {
1426
+ /** Display name. */
1427
+ name?: string;
1428
+ /** Avatar image URL. */
1429
+ avatarUrl?: string;
1430
+ /** Initials fallback when no avatar. Auto-derived from `name` if absent. */
1431
+ initials?: string;
1432
+ /** Tooltip / aria description. */
1433
+ description?: string;
1434
+ }
1435
+ interface ChatMessage {
1436
+ id: string;
1437
+ role: ChatRole;
1438
+ content: string;
1439
+ /** epoch ms — serializable. */
1440
+ createdAt: number;
1441
+ isStreaming?: boolean;
1442
+ isError?: boolean;
1443
+ /** Bumps on edit so memo keys invalidate. */
1444
+ version?: number;
1445
+ /** Per-message persona override (multi-user / multi-bot). Falls back to
1446
+ * `ChatConfig.user` / `ChatConfig.assistant` when absent. */
1447
+ sender?: ChatPersona;
1448
+ /** Simple status indicator above message ("Searching knowledge base..."). */
1449
+ toolActivity?: string;
1450
+ toolCalls?: ChatToolCall[];
1451
+ attachments?: ChatAttachment[];
1452
+ sources?: ChatSource[];
1453
+ tokensIn?: number;
1454
+ tokensOut?: number;
1455
+ }
1456
+ type ChatDisplayMode = 'closed' | 'embedded' | 'floating' | 'sidebar' | 'fullscreen';
1457
+ interface ChatUserContext extends ChatPersona {
1458
+ email?: string;
1459
+ language?: string;
1460
+ role?: string;
1461
+ /** Free-form custom data forwarded to transport metadata. */
1462
+ custom?: Record<string, unknown>;
1463
+ }
1464
+ interface ChatAssistantContext extends ChatPersona {
1465
+ /** Model identifier (gpt-4o, claude-opus, …). */
1466
+ model?: string;
1467
+ }
1468
+ interface ChatPrefs {
1469
+ /** Submit hotkey for the composer. */
1470
+ submitOn?: 'enter' | 'cmd+enter';
1471
+ /** UI density. */
1472
+ density?: 'comfortable' | 'compact';
1473
+ /** Locale forwarded to transport metadata. */
1474
+ locale?: string;
1475
+ /** Show timestamps on each bubble. */
1476
+ showTimestamps?: boolean;
1477
+ }
1478
+ interface ChatConfig {
1479
+ /** Window title / aria-label. */
1480
+ title?: string;
1481
+ /** Composer placeholder. */
1482
+ placeholder?: string;
1483
+ /** Empty-state greeting. */
1484
+ greeting?: string;
1485
+ /** Empty-state description. */
1486
+ description?: string;
1487
+ /** Suggested prompts shown on empty conversation. */
1488
+ suggestions?: Array<{
1489
+ label: string;
1490
+ prompt: string;
1491
+ }>;
1492
+ /** Locale forwarded to the transport via stream metadata. */
1493
+ locale?: string;
1494
+ /** Project / chat slug forwarded to the transport. */
1495
+ slug?: string;
1496
+ /** UI density. Use `prefs.density` for the same effect; this stays for
1497
+ * backwards compatibility. */
1498
+ density?: 'comfortable' | 'compact';
1499
+ /** Identity of the human author. Renders avatar / name on user bubbles
1500
+ * and gets stamped on outgoing messages as `message.sender`. */
1501
+ user?: ChatUserContext;
1502
+ /** Identity of the assistant. Renders avatar / name on assistant bubbles. */
1503
+ assistant?: ChatAssistantContext;
1504
+ /** UI preferences. */
1505
+ prefs?: ChatPrefs;
1506
+ /** Visual labels (i18n is the host's job). */
1507
+ labels?: Partial<ChatLabels>;
1508
+ }
1509
+ interface ChatLabels {
1510
+ send: string;
1511
+ cancel: string;
1512
+ copy: string;
1513
+ regenerate: string;
1514
+ edit: string;
1515
+ delete: string;
1516
+ retry: string;
1517
+ newChat: string;
1518
+ loadMore: string;
1519
+ jumpToLatest: string;
1520
+ attach: string;
1521
+ voice: string;
1522
+ errorGeneric: string;
1523
+ cancelledSuffix: string;
1524
+ }
1525
+ declare const DEFAULT_LABELS: ChatLabels;
1526
+ interface CreateSessionOptions {
1527
+ metadata?: Record<string, unknown>;
1528
+ }
1529
+ interface SessionInfo {
1530
+ sessionId: string;
1531
+ /** If the server resumed an existing session, it may return prior messages. */
1532
+ messages?: ChatMessage[];
1533
+ hasMore?: boolean;
1534
+ cursor?: string | null;
1535
+ resumed?: boolean;
1536
+ }
1537
+ interface HistoryPage {
1538
+ messages: ChatMessage[];
1539
+ hasMore: boolean;
1540
+ nextCursor: string | null;
1541
+ }
1542
+ interface StreamOptions {
1543
+ signal: AbortSignal;
1544
+ attachments?: ChatAttachment[];
1545
+ metadata?: Record<string, unknown>;
1546
+ }
1547
+ interface SendOptions {
1548
+ signal?: AbortSignal;
1549
+ attachments?: ChatAttachment[];
1550
+ metadata?: Record<string, unknown>;
1551
+ }
1552
+ type ChatStreamEvent = {
1553
+ type: 'message_start';
1554
+ messageId: string;
1555
+ sessionId: string;
1556
+ } | {
1557
+ type: 'chunk';
1558
+ delta: string;
1559
+ } | {
1560
+ type: 'tool_activity';
1561
+ tool: string;
1562
+ status: string;
1563
+ } | {
1564
+ type: 'tool_call_start';
1565
+ toolId: string;
1566
+ name: string;
1567
+ input: unknown;
1568
+ sourceHostname?: string;
1569
+ } | {
1570
+ type: 'tool_call_delta';
1571
+ toolId: string;
1572
+ delta: string;
1573
+ } | {
1574
+ type: 'tool_call_end';
1575
+ toolId: string;
1576
+ output: unknown;
1577
+ status: 'success' | 'error';
1578
+ } | {
1579
+ type: 'message_end';
1580
+ tokensIn?: number;
1581
+ tokensOut?: number;
1582
+ sources?: ChatSource[];
1583
+ } | {
1584
+ type: 'error';
1585
+ code: string;
1586
+ message: string;
1587
+ };
1588
+ interface ChatTransport {
1589
+ createSession(opts?: CreateSessionOptions): Promise<SessionInfo>;
1590
+ loadHistory(sessionId: string, cursor?: string | null, limit?: number): Promise<HistoryPage>;
1591
+ stream(sessionId: string, content: string, options: StreamOptions): AsyncGenerator<ChatStreamEvent, void, void>;
1592
+ send(sessionId: string, content: string, options?: SendOptions): Promise<ChatMessage>;
1593
+ closeSession(sessionId: string): Promise<void>;
1594
+ }
1595
+
1596
+ type ChatAudioEvent = 'messageSent' | 'messageReceived' | 'streamStart' | 'error' | 'mention' | 'notification';
1597
+ /** Map an event to a sound URL. `false` silences the event explicitly. */
1598
+ type ChatAudioSounds = Partial<Record<ChatAudioEvent, string | false>>;
1599
+ interface ChatAudioConfig {
1600
+ /** Map event → asset URL. Omit (or set `false`) to silence one event. */
1601
+ sounds?: ChatAudioSounds;
1602
+ /** Master volume 0..1. Persisted via the global prefs store. */
1603
+ volume?: number;
1604
+ /** Master mute. */
1605
+ muted?: boolean;
1606
+ /** Custom predicate — return `false` to suppress a play call. */
1607
+ shouldPlay?: (event: ChatAudioEvent) => boolean;
1608
+ /** Default-suppress when user prefers reduced motion. Default: true. */
1609
+ respectReducedMotion?: boolean;
1610
+ /** Default-suppress when user prefers reduced data. Default: true. */
1611
+ respectReducedData?: boolean;
1612
+ /** Mute when host page is hidden (`visibilityState === 'hidden'`). Default: true. */
1613
+ muteWhenHidden?: boolean;
1614
+ }
1615
+ interface UseChatAudioReturn {
1616
+ /** Play a sound for an event. No-ops if the event has no URL or is muted. */
1617
+ play: (event: ChatAudioEvent) => void;
1618
+ /** Eagerly load an event's audio (called automatically on mount). */
1619
+ preload: (event: ChatAudioEvent) => void;
1620
+ /** Manually unlock — useful in stories/tests. */
1621
+ unlock: () => void;
1622
+ /** True after the first user gesture inside the chat root. */
1623
+ isUnlocked: boolean;
1624
+ /** Master mute (persistent). */
1625
+ muted: boolean;
1626
+ setMuted: (m: boolean) => void;
1627
+ /** Master volume 0..1 (persistent). */
1628
+ volume: number;
1629
+ setVolume: (v: number) => void;
1630
+ /** Per-event opt-out (persistent). */
1631
+ isEventEnabled: (event: ChatAudioEvent) => boolean;
1632
+ setEventEnabled: (event: ChatAudioEvent, enabled: boolean) => void;
1633
+ }
1634
+
1635
+ /**
1636
+ * Pure chat state machine. Zero React. Zero I/O.
1637
+ *
1638
+ * Invariants:
1639
+ * - At most one message has `isStreaming === true` at any time. It is always
1640
+ * the last message in the array.
1641
+ * - Messages are immutable; updates produce new objects.
1642
+ * - `version` bumps on edit so memo keys invalidate.
1643
+ */
1381
1644
 
1382
- declare const LazyTree: React$1.ComponentType<TreeRootProps<unknown>>;
1645
+ interface ChatState {
1646
+ sessionId: string | null;
1647
+ messages: ChatMessage[];
1648
+ /** Initial history load in flight. */
1649
+ isLoading: boolean;
1650
+ /** Assistant is generating a reply. */
1651
+ isStreaming: boolean;
1652
+ /** Older history page in flight. */
1653
+ isLoadingMore: boolean;
1654
+ hasMore: boolean;
1655
+ oldestCursor: string | null;
1656
+ error: string | null;
1657
+ }
1658
+ declare const initialState: ChatState;
1659
+ type ChatAction = {
1660
+ type: 'SESSION_SET';
1661
+ sessionId: string;
1662
+ messages?: ChatMessage[];
1663
+ hasMore?: boolean;
1664
+ cursor?: string | null;
1665
+ } | {
1666
+ type: 'HISTORY_LOAD_START';
1667
+ } | {
1668
+ type: 'HISTORY_LOAD_DONE';
1669
+ messages: ChatMessage[];
1670
+ hasMore: boolean;
1671
+ cursor: string | null;
1672
+ } | {
1673
+ type: 'HISTORY_MORE_START';
1674
+ } | {
1675
+ type: 'HISTORY_MORE_DONE';
1676
+ messages: ChatMessage[];
1677
+ hasMore: boolean;
1678
+ cursor: string | null;
1679
+ } | {
1680
+ type: 'MESSAGE_USER_ADD';
1681
+ message: ChatMessage;
1682
+ } | {
1683
+ type: 'STREAM_START';
1684
+ id: string;
1685
+ createdAt?: number;
1686
+ } | {
1687
+ type: 'STREAM_CHUNK';
1688
+ delta: string;
1689
+ } | {
1690
+ type: 'STREAM_TOOL_ACTIVITY';
1691
+ tool: string;
1692
+ } | {
1693
+ type: 'TOOL_CALL_START';
1694
+ messageId: string;
1695
+ toolCall: ChatToolCall;
1696
+ } | {
1697
+ type: 'TOOL_CALL_DELTA';
1698
+ messageId: string;
1699
+ toolId: string;
1700
+ delta: string;
1701
+ } | {
1702
+ type: 'TOOL_CALL_END';
1703
+ messageId: string;
1704
+ toolId: string;
1705
+ output: unknown;
1706
+ status: 'success' | 'error';
1707
+ } | {
1708
+ type: 'STREAM_DONE';
1709
+ id: string;
1710
+ tokensIn?: number;
1711
+ tokensOut?: number;
1712
+ sources?: ChatSource[];
1713
+ } | {
1714
+ type: 'STREAM_CANCELLED';
1715
+ id: string;
1716
+ partialText: string;
1717
+ label?: string;
1718
+ } | {
1719
+ type: 'STREAM_ERROR';
1720
+ id?: string;
1721
+ message: string;
1722
+ } | {
1723
+ type: 'MESSAGE_EDIT';
1724
+ id: string;
1725
+ content: string;
1726
+ } | {
1727
+ type: 'MESSAGE_DELETE';
1728
+ id: string;
1729
+ } | {
1730
+ type: 'MESSAGES_CLEAR';
1731
+ } | {
1732
+ type: 'ERROR_SET';
1733
+ error: string | null;
1734
+ } | {
1735
+ type: 'ATTACHMENT_PROGRESS';
1736
+ messageId: string;
1737
+ attachmentId: string;
1738
+ progress?: number;
1739
+ status?: ChatAttachment['status'];
1740
+ };
1741
+ declare function reducer(state: ChatState, action: ChatAction): ChatState;
1742
+
1743
+ interface UseChatConfig {
1744
+ transport: ChatTransport;
1745
+ initialSessionId?: string;
1746
+ autoCreateSession?: boolean;
1747
+ streaming?: boolean;
1748
+ pageSize?: number;
1749
+ onError?: (err: Error) => void;
1750
+ /** Fires once an assistant message finishes streaming (or buffered send returns). */
1751
+ onMessageEnd?: (msg: ChatMessage) => void;
1752
+ /** Fires after a user message is added to the state (right before streaming starts). */
1753
+ onMessageSent?: (msg: ChatMessage) => void;
1754
+ /** Fires when the assistant placeholder is created (first byte / pre-stream). */
1755
+ onStreamStart?: (assistantMessageId: string) => void;
1756
+ metadata?: Record<string, unknown>;
1757
+ /** Stamped on outgoing user messages as `message.sender`. */
1758
+ userPersona?: ChatPersona;
1759
+ /**
1760
+ * Enable verbose dev-mode logging (consola, namespace `chat:*`).
1761
+ * Defaults to `isDev` from `@djangocfg/ui-core/lib`. Pass `false` to silence
1762
+ * even in development; `true` to force on in production.
1763
+ */
1764
+ debug?: boolean;
1765
+ }
1766
+ interface UseChatReturn extends ChatState {
1767
+ sendMessage: (content: string, attachments?: ChatAttachment[]) => Promise<void>;
1768
+ cancelStream: () => void;
1769
+ regenerate: (messageId?: string) => Promise<void>;
1770
+ editMessage: (id: string, content: string) => Promise<void>;
1771
+ deleteMessage: (id: string) => void;
1772
+ clearMessages: () => void;
1773
+ loadMore: () => Promise<void>;
1774
+ newSession: () => Promise<void>;
1775
+ lastError: Error | null;
1776
+ }
1777
+ declare function useChat(config: UseChatConfig): UseChatReturn;
1778
+
1779
+ interface UseChatLayoutConfig {
1780
+ defaultMode?: ChatDisplayMode;
1781
+ storageKey?: string;
1782
+ sidebarStorageKey?: string;
1783
+ reserveCssVar?: string;
1784
+ defaultSidebarWidth?: number;
1785
+ minSidebarWidth?: number;
1786
+ maxSidebarWidth?: number;
1787
+ /** Mobile breakpoint, e.g. '(max-width: 640px)'. */
1788
+ mobileQuery?: string;
1789
+ }
1790
+ interface UseChatLayoutReturn {
1791
+ mode: ChatDisplayMode;
1792
+ setMode: (m: ChatDisplayMode) => void;
1793
+ open: () => void;
1794
+ close: () => void;
1795
+ toggle: () => void;
1796
+ sidebarWidth: number;
1797
+ setSidebarWidth: (w: number) => void;
1798
+ isMobile: boolean;
1799
+ /** Mode after mobile collapse rules — sidebar/floating become fullscreen on mobile. */
1800
+ effectiveMode: ChatDisplayMode;
1801
+ }
1802
+ declare function useChatLayout(config?: UseChatLayoutConfig): UseChatLayoutReturn;
1803
+
1804
+ interface ChatContextValue extends UseChatReturn {
1805
+ layout: UseChatLayoutReturn;
1806
+ config: ChatConfig;
1807
+ labels: ChatLabels;
1808
+ audio: UseChatAudioReturn;
1809
+ }
1810
+ interface ChatProviderProps {
1811
+ transport: ChatTransport;
1812
+ config?: ChatConfig;
1813
+ initialSessionId?: string;
1814
+ autoCreateSession?: boolean;
1815
+ streaming?: boolean;
1816
+ /** Audio-trigger configuration. Off by default (no `sounds` map). */
1817
+ audio?: ChatAudioConfig;
1818
+ /** Enable verbose dev logging via consola. Defaults to `isDev`. */
1819
+ debug?: boolean;
1820
+ children?: ReactNode;
1821
+ }
1822
+ declare function ChatProvider({ transport, config, initialSessionId, autoCreateSession, streaming, audio, debug, children, }: ChatProviderProps): react_jsx_runtime.JSX.Element;
1823
+ declare function useChatContext(): ChatContextValue;
1824
+ declare function useChatContextOptional(): ChatContextValue | null;
1825
+
1826
+ interface UseChatComposerOptions {
1827
+ onSubmit: (content: string, attachments: ChatAttachment[]) => void | Promise<void>;
1828
+ initialValue?: string;
1829
+ maxLength?: number;
1830
+ maxAttachments?: number;
1831
+ disabled?: boolean;
1832
+ /** 'enter' = Enter sends, Shift+Enter newline. 'cmd+enter' = Enter inserts newline, Cmd/Ctrl+Enter sends. */
1833
+ submitOn?: 'enter' | 'cmd+enter';
1834
+ history?: {
1835
+ enabled?: boolean;
1836
+ size?: number;
1837
+ };
1838
+ onPasteFiles?: (files: File[]) => void;
1839
+ }
1840
+ interface UseChatComposerReturn {
1841
+ value: string;
1842
+ setValue: (next: string) => void;
1843
+ attachments: ChatAttachment[];
1844
+ addAttachment: (a: ChatAttachment) => void;
1845
+ removeAttachment: (id: string) => void;
1846
+ isSubmitting: boolean;
1847
+ canSubmit: boolean;
1848
+ submit: () => Promise<void>;
1849
+ reset: () => void;
1850
+ focus: () => void;
1851
+ textareaRef: RefObject<HTMLTextAreaElement | null>;
1852
+ textareaProps: {
1853
+ ref: RefObject<HTMLTextAreaElement | null>;
1854
+ value: string;
1855
+ disabled: boolean;
1856
+ onChange: (e: ChangeEvent<HTMLTextAreaElement>) => void;
1857
+ onKeyDown: (e: KeyboardEvent<HTMLTextAreaElement>) => void;
1858
+ onPaste: (e: ClipboardEvent<HTMLTextAreaElement>) => void;
1859
+ };
1860
+ recallPrevious: () => void;
1861
+ recallNext: () => void;
1862
+ }
1863
+ declare function useChatComposer(options: UseChatComposerOptions): UseChatComposerReturn;
1864
+
1865
+ interface AttachmentRendererArgs {
1866
+ attachment: ChatAttachment;
1867
+ /** True when shown inside the composer's staging tray (denser layout). */
1868
+ isInComposer: boolean;
1869
+ onClick?: () => void;
1870
+ onRemove?: () => void;
1871
+ }
1872
+ type AttachmentRenderer = (args: AttachmentRendererArgs) => ReactNode;
1873
+ interface AttachmentRendererMap {
1874
+ image?: AttachmentRenderer;
1875
+ audio?: AttachmentRenderer;
1876
+ video?: AttachmentRenderer;
1877
+ file?: AttachmentRenderer;
1878
+ /** Fallback renderer when no per-type entry matched. */
1879
+ default?: AttachmentRenderer;
1880
+ }
1881
+ interface CommonProps {
1882
+ attachments: ChatAttachment[];
1883
+ maxVisible?: number;
1884
+ onClick?: (a: ChatAttachment) => void;
1885
+ onRemove?: (a: ChatAttachment) => void;
1886
+ isInComposer?: boolean;
1887
+ className?: string;
1888
+ }
1889
+ interface AttachmentsGridProps extends CommonProps {
1890
+ layout?: 'wrap' | 'grid';
1891
+ }
1892
+ declare function AttachmentsGrid({ attachments, maxVisible, onClick, onRemove, isInComposer, layout, className, }: AttachmentsGridProps): react_jsx_runtime.JSX.Element;
1893
+ interface AttachmentsListProps extends CommonProps {
1894
+ /** Per-type renderer overrides. Falls back to the default tile. */
1895
+ renderers?: AttachmentRendererMap;
1896
+ }
1897
+ declare function AttachmentsList({ attachments, maxVisible, onClick, onRemove, renderers, isInComposer, className, }: AttachmentsListProps): react_jsx_runtime.JSX.Element;
1898
+ interface AttachmentsProps extends CommonProps {
1899
+ layout?: 'grid' | 'row';
1900
+ renderers?: AttachmentRendererMap;
1901
+ }
1902
+ declare function Attachments(props: AttachmentsProps): react_jsx_runtime.JSX.Element;
1903
+
1904
+ type ToolPayloadKind = 'input' | 'output' | 'streaming';
1905
+ interface ToolCallsProps {
1906
+ calls: ChatToolCall[];
1907
+ /** Open every panel up-front. Default: false (panels are closed). */
1908
+ defaultExpanded?: boolean;
1909
+ /** Auto-open while a tool is running, then auto-close on completion.
1910
+ * User toggles after that are remembered. Default: true. */
1911
+ expandWhileStreaming?: boolean;
1912
+ /** Override how the tool input payload is rendered. Receives the raw value. */
1913
+ renderInput?: (input: unknown, call: ChatToolCall) => ReactNode;
1914
+ /** Override how the tool output payload is rendered. */
1915
+ renderOutput?: (output: unknown, call: ChatToolCall) => ReactNode;
1916
+ /** Override how the live `streamingText` is rendered. */
1917
+ renderStreaming?: (text: string, call: ChatToolCall) => ReactNode;
1918
+ /** Single override for all three; specific renderers above take precedence. */
1919
+ renderPayload?: (value: unknown, kind: ToolPayloadKind, call: ChatToolCall) => ReactNode;
1920
+ className?: string;
1921
+ }
1922
+ declare function ToolCalls({ calls, defaultExpanded, expandWhileStreaming, renderInput, renderOutput, renderStreaming, renderPayload, className, }: ToolCallsProps): react_jsx_runtime.JSX.Element;
1923
+
1924
+ interface ChatRootProps {
1925
+ transport: ChatTransport;
1926
+ config?: ChatConfig;
1927
+ initialSessionId?: string;
1928
+ autoCreateSession?: boolean;
1929
+ streaming?: boolean;
1930
+ /** Audio-trigger configuration. Off by default (no `sounds` map). */
1931
+ audio?: ChatAudioConfig;
1932
+ /**
1933
+ * Verbose dev-mode logging via `consola` (namespace `chat:*`).
1934
+ * Defaults to `isDev` from `@djangocfg/ui-core/lib`. Pass `false` to silence
1935
+ * even in development, or `true` to force on in production for debugging.
1936
+ */
1937
+ debug?: boolean;
1938
+ className?: string;
1939
+ /** Sticky banner above the message list (e.g. quota warning). */
1940
+ banner?: ReactNode;
1941
+ /** Header row below the banner — title / actions / session switcher. */
1942
+ header?: ReactNode;
1943
+ /** Footer slot below the composer (disclaimers, model picker). */
1944
+ footer?: ReactNode;
1945
+ /** Replaces the default `<EmptyState>` rendered when the conversation is empty. */
1946
+ empty?: ReactNode;
1947
+ /** Slot left of the textarea inside `<Composer>`. */
1948
+ composerToolbarStart?: ReactNode;
1949
+ /** Slot right of the textarea inside `<Composer>`. */
1950
+ composerToolbarEnd?: ReactNode;
1951
+ /** Replaces the default attachment tray inside `<Composer>`. */
1952
+ composerAttachmentTray?: ReactNode;
1953
+ /** Replaces the default `<JumpToLatest>` floating pill. */
1954
+ jumpToLatest?: ReactNode;
1955
+ /** Replace `<MessageBubble>` per message. */
1956
+ renderMessage?: (m: ChatMessage, i: number) => ReactNode;
1957
+ /** Render the header lazily — receives the chat context. */
1958
+ renderHeader?: (ctx: ChatContextValue) => ReactNode;
1959
+ /** Render the empty-state lazily — receives a `setValue` to seed the composer. */
1960
+ renderEmpty?: (api: {
1961
+ setValue: (v: string) => void;
1962
+ focus: () => void;
1963
+ }) => ReactNode;
1964
+ /** Forwarded into `<MessageBubble toolCallsProps>` so hosts can swap payload renderers. */
1965
+ toolCallsProps?: Omit<ToolCallsProps, 'calls'>;
1966
+ /** Per-type attachment renderers — `{ image, audio, video, file, default }`. */
1967
+ attachmentRenderers?: AttachmentRendererMap;
1968
+ /** Called when an attachment tile is clicked (e.g. open lightbox). */
1969
+ onAttachmentOpen?: (attachment: ChatAttachment) => void;
1970
+ /** Show the paperclip "attach" button in the composer. */
1971
+ showAttachmentButton?: boolean;
1972
+ /** Called when the user clicks the attach button (host opens its file picker). */
1973
+ onPickFiles?: () => void;
1974
+ }
1975
+ declare function ChatRoot(props: ChatRootProps): react_jsx_runtime.JSX.Element;
1976
+
1977
+ declare const LazyChat: react.ComponentType<ChatRootProps>;
1978
+
1979
+ /**
1980
+ * Chat defaults and constants.
1981
+ */
1982
+ declare const STORAGE_KEYS: {
1983
+ readonly mode: "djc-chat-mode";
1984
+ readonly sidebarWidth: "djc-chat-sidebar-width";
1985
+ readonly composerHistory: "djc-chat-composer-history";
1986
+ };
1987
+ declare const CSS_VARS: {
1988
+ readonly reserve: "--djc-chat-reserve";
1989
+ };
1990
+ declare const DEFAULT_Z_INDEX = 9000;
1991
+ declare const LIMITS: {
1992
+ /** Max characters per single message. */
1993
+ readonly messageMaxLength: 8000;
1994
+ /** Max attachments per message. */
1995
+ readonly attachmentsMax: 10;
1996
+ /** Composer history slots. */
1997
+ readonly composerHistorySize: 50;
1998
+ /** Coalesce stream tokens within this window before dispatching. */
1999
+ readonly streamCoalesceMs: 16;
2000
+ /** Default history page size. */
2001
+ readonly pageSize: 50;
2002
+ /** Virtualize list when >= this many messages (host-controlled threshold). */
2003
+ readonly virtualizeThreshold: 50;
2004
+ /** SSE idle timeout. */
2005
+ readonly sseIdleMs: 45000;
2006
+ };
2007
+ declare const DEFAULT_SIDEBAR: {
2008
+ readonly width: 420;
2009
+ readonly min: 320;
2010
+ readonly max: 720;
2011
+ };
2012
+ declare const HOTKEYS: {
2013
+ readonly send: "mod+enter";
2014
+ readonly cancel: "esc";
2015
+ readonly newChat: "mod+shift+n";
2016
+ readonly toggleOpen: "mod+/";
2017
+ readonly focusComposer: "mod+l";
2018
+ };
2019
+ declare const CHAT_EVENT_NAME = "djc:chat:send";
2020
+ interface ChatEventDetail {
2021
+ content: string;
2022
+ sessionId?: string;
2023
+ attachments?: unknown[];
2024
+ metadata?: Record<string, unknown>;
2025
+ }
2026
+
2027
+ /**
2028
+ * ID generation. Uses crypto.randomUUID when available with a fallback
2029
+ * for older environments (and SSR bundles that may not have crypto).
2030
+ */
2031
+ declare function createId(prefix?: string): string;
2032
+
2033
+ /**
2034
+ * Token coalescer. Buffers stream tokens within a small time window before
2035
+ * dispatching a single aggregated chunk. Prevents 60+ re-renders per second
2036
+ * on fast streams.
2037
+ */
2038
+ interface TokenBuffer {
2039
+ /** Append a delta. Returns immediately. */
2040
+ push(delta: string): void;
2041
+ /** Force flush and resolve any pending timer. */
2042
+ flush(): void;
2043
+ /** Stop accepting tokens; flush whatever is buffered. */
2044
+ close(): void;
2045
+ }
2046
+ declare function createTokenBuffer(onFlush: (delta: string) => void, windowMs?: 16): TokenBuffer;
2047
+
2048
+ declare function resolvePersona(message: Pick<ChatMessage, 'role' | 'sender'>, user?: ChatUserContext, assistant?: ChatAssistantContext): ChatPersona;
2049
+ /** Compute initials for an avatar fallback. */
2050
+ declare function deriveInitials(persona: ChatPersona, role?: string): string;
2051
+
2052
+ /**
2053
+ * HTTP + SSE transport. Default implementation for web hosts.
2054
+ *
2055
+ * Backend contract (see @dev/@refactoring7-chat/06-integration.md):
2056
+ * POST /sessions → SessionInfo (JSON)
2057
+ * GET /sessions/:id/history?cursor= → HistoryPage (JSON)
2058
+ * POST /sessions/:id/messages → SSE stream of ChatStreamEvent
2059
+ * POST /sessions/:id/messages/buffered → ChatMessage (JSON, fallback)
2060
+ * DELETE /sessions/:id → 204
2061
+ */
2062
+
2063
+ interface HttpTransportConfig {
2064
+ /** Base URL without trailing slash, e.g. '/api/chat' or 'https://api.example.com/v1/chat'. */
2065
+ baseUrl: string;
2066
+ /** Optional slug appended/forwarded as project identifier. */
2067
+ slug?: string;
2068
+ /** Returns headers applied to every request — e.g. Authorization. */
2069
+ getAuthHeader?: () => Record<string, string> | Promise<Record<string, string>>;
2070
+ /** Default fetch timeout (per non-streaming request). */
2071
+ timeoutMs?: number;
2072
+ /** Override fetch implementation (useful for tests or custom retry layers). */
2073
+ fetchImpl?: typeof fetch;
2074
+ }
2075
+ declare function createHttpTransport(config: HttpTransportConfig): ChatTransport;
2076
+
2077
+ /**
2078
+ * In-memory chat transport for stories and tests. Replays scripted replies.
2079
+ */
2080
+
2081
+ interface MockTransportOptions {
2082
+ /** Each entry is the assistant's reply for one user turn. Strings are split
2083
+ * into chunks; arrays are taken as the exact event sequence (after a
2084
+ * prepended `message_start` and before a synthetic `message_end`). */
2085
+ replies?: Array<string | ChatStreamEvent[]>;
2086
+ latencyMs?: number;
2087
+ /** Initial history returned by `createSession`. */
2088
+ initialMessages?: ChatMessage[];
2089
+ shouldFail?: (attempt: number) => boolean;
2090
+ }
2091
+ declare function createMockTransport(opts?: MockTransportOptions): ChatTransport;
2092
+
2093
+ /**
2094
+ * Server-Sent Events parser as an AsyncGenerator.
2095
+ *
2096
+ * Yields parsed events from a `Response` body. Handles the split-read case
2097
+ * where `event:` and `data:` arrive in separate TCP packets. Skips malformed
2098
+ * JSON gracefully. Honors AbortSignal (caller passes one to fetch).
2099
+ */
2100
+
2101
+ interface RawEvent {
2102
+ event?: string;
2103
+ data?: string;
2104
+ }
2105
+ interface ParseSSEOptions {
2106
+ signal?: AbortSignal;
2107
+ /** Map a raw SSE event to a ChatStreamEvent. Default: parse `data` as JSON
2108
+ * and assume the JSON shape already matches `ChatStreamEvent`. */
2109
+ map?: (raw: RawEvent) => ChatStreamEvent | null;
2110
+ idleTimeoutMs?: number;
2111
+ }
2112
+ declare function parseSSE(response: Response, options?: ParseSSEOptions): AsyncGenerator<ChatStreamEvent, void, void>;
2113
+
2114
+ /**
2115
+ * Transport surface re-export. Lives in core so transport implementations
2116
+ * never need to reach into the public types module.
2117
+ */
2118
+
2119
+ declare class TransportError extends Error {
2120
+ code: string;
2121
+ constructor(message: string, code?: string);
2122
+ }
2123
+
2124
+ interface UseChatScrollOptions {
2125
+ containerRef: RefObject<HTMLElement | null>;
2126
+ bottomRef: RefObject<HTMLElement | null>;
2127
+ isStreaming?: boolean;
2128
+ /** Distance from bottom (px) considered "at bottom". */
2129
+ bottomThresholdPx?: number;
2130
+ /** Bump key — increment when a new message arrives so the hook re-evaluates auto-scroll. */
2131
+ messagesCount?: number;
2132
+ }
2133
+ interface UseChatScrollReturn {
2134
+ isAtBottom: boolean;
2135
+ unreadCount: number;
2136
+ scrollToBottom: (smooth?: boolean) => void;
2137
+ resetUnread: () => void;
2138
+ }
2139
+ declare function useChatScroll(options: UseChatScrollOptions): UseChatScrollReturn;
2140
+
2141
+ interface UseChatHistoryOptions {
2142
+ enabled?: boolean;
2143
+ containerRef: RefObject<HTMLElement | null>;
2144
+ topSentinelRef: RefObject<HTMLElement | null>;
2145
+ hasMore: boolean;
2146
+ isLoadingMore: boolean;
2147
+ loadMore: () => Promise<void>;
2148
+ }
2149
+ /** Triggers `loadMore` when the top sentinel enters the container's viewport.
2150
+ * Preserves scroll anchor: if the container's height grows after load, we
2151
+ * bump scrollTop by the delta so the previously-visible message stays put. */
2152
+ declare function useChatHistory(options: UseChatHistoryOptions): void;
2153
+
2154
+ declare function useChatAudio(config?: ChatAudioConfig): UseChatAudioReturn;
2155
+
2156
+ interface ChatLightboxState {
2157
+ gallery: ChatAttachment[];
2158
+ index: number;
2159
+ }
2160
+ interface UseChatLightboxReturn {
2161
+ state: ChatLightboxState | null;
2162
+ open: (att: ChatAttachment, gallery?: ChatAttachment[]) => void;
2163
+ close: () => void;
2164
+ }
2165
+ /** Tiny state container for an image lightbox. The host owns the modal +
2166
+ * `<LazyImageViewer>` mount; we just track which gallery to show. */
2167
+ declare function useChatLightbox(): UseChatLightboxReturn;
2168
+
2169
+ interface ChatAudioPrefsState {
2170
+ /** 0..1 master volume. */
2171
+ volume: number;
2172
+ /** Master mute (overrides per-event toggles). */
2173
+ muted: boolean;
2174
+ /** Per-event opt-out — `false` silences a single trigger. */
2175
+ enabled: Partial<Record<ChatAudioEvent, boolean>>;
2176
+ setVolume: (v: number) => void;
2177
+ setMuted: (m: boolean) => void;
2178
+ setEventEnabled: (event: ChatAudioEvent, enabled: boolean) => void;
2179
+ }
2180
+ declare const useChatAudioPrefs: zustand.UseBoundStore<Omit<zustand.StoreApi<ChatAudioPrefsState>, "setState" | "persist"> & {
2181
+ setState(partial: ChatAudioPrefsState | Partial<ChatAudioPrefsState> | ((state: ChatAudioPrefsState) => ChatAudioPrefsState | Partial<ChatAudioPrefsState>), replace?: false): unknown;
2182
+ setState(state: ChatAudioPrefsState | ((state: ChatAudioPrefsState) => ChatAudioPrefsState), replace: true): unknown;
2183
+ persist: {
2184
+ setOptions: (options: Partial<zustand_middleware.PersistOptions<ChatAudioPrefsState, unknown, unknown>>) => void;
2185
+ clearStorage: () => void;
2186
+ rehydrate: () => Promise<void> | void;
2187
+ hasHydrated: () => boolean;
2188
+ onHydrate: (fn: (state: ChatAudioPrefsState) => void) => () => void;
2189
+ onFinishHydration: (fn: (state: ChatAudioPrefsState) => void) => () => void;
2190
+ getOptions: () => Partial<zustand_middleware.PersistOptions<ChatAudioPrefsState, unknown, unknown>>;
2191
+ };
2192
+ }>;
2193
+
2194
+ interface ToolPayloadMatcher {
2195
+ /** Cheap predicate. First match wins. */
2196
+ match: (value: unknown, kind: ToolPayloadKind, call: ChatToolCall) => boolean;
2197
+ render: (value: unknown, kind: ToolPayloadKind, call: ChatToolCall) => ReactNode;
2198
+ }
2199
+ type ToolPayloadFallback = (value: unknown, kind: ToolPayloadKind, call: ChatToolCall) => ReactNode;
2200
+ declare function dispatchToolPayload(matchers: ToolPayloadMatcher[], fallback: ToolPayloadFallback): ToolPayloadFallback;
2201
+ declare function isPlainObject(v: unknown): v is Record<string, unknown>;
2202
+ declare function isLatLng(v: unknown): v is {
2203
+ lat: number;
2204
+ lng: number;
2205
+ };
2206
+ declare function isGeoJSONFeatureCollection(v: unknown): v is {
2207
+ type: 'FeatureCollection';
2208
+ features: unknown[];
2209
+ };
2210
+ declare function isStringValue(v: unknown): v is string;
2211
+
2212
+ /** Walk the conversation and collect image attachments in chronological order. */
2213
+ declare function collectImageAttachments(messages: ChatMessage[]): ChatAttachment[];
2214
+
2215
+ /**
2216
+ * Chat dev logger.
2217
+ *
2218
+ * A thin namespaced wrapper over `consola` that no-ops in production unless
2219
+ * the host app explicitly opts in via `<ChatRoot debug />`. The default
2220
+ * detection uses `isDev` from `@djangocfg/ui-core/lib/env` (NODE_ENV).
2221
+ *
2222
+ * Why a dedicated module: chat is async and event-heavy (bootstrap, transport,
2223
+ * SSE chunks, tool calls, regenerate, …). Inline `console.log`s rot fast and
2224
+ * leak into prod. A single `getChatLogger()` call gives every layer the same
2225
+ * namespaced sub-logger and keeps zero-cost gating in one place.
2226
+ *
2227
+ * Sub-loggers:
2228
+ * bootstrap — initial session bootstrap (createSession / loadHistory)
2229
+ * transport — outbound transport calls + responses
2230
+ * stream — SSE chunk / tool / message_end events
2231
+ * lifecycle — sendMessage, regenerate, newSession, edits
2232
+ * tools — tool_call_start / _delta / _end specifics
2233
+ * error — caught errors (always emitted as `error` level)
2234
+ */
2235
+
2236
+ type ChatLogScope = 'bootstrap' | 'transport' | 'stream' | 'lifecycle' | 'tools' | 'error';
2237
+ interface ChatLogger {
2238
+ bootstrap: ConsolaInstance;
2239
+ transport: ConsolaInstance;
2240
+ stream: ConsolaInstance;
2241
+ lifecycle: ConsolaInstance;
2242
+ tools: ConsolaInstance;
2243
+ error: ConsolaInstance;
2244
+ /** True when this logger is actually emitting (host opted in or NODE_ENV=development). */
2245
+ enabled: boolean;
2246
+ }
2247
+ /**
2248
+ * Get the chat logger.
2249
+ * @param debug Explicit override from the host. `undefined` falls back to `isDev`.
2250
+ */
2251
+ declare function getChatLogger(debug?: boolean): ChatLogger;
2252
+
2253
+ interface MessageListProps {
2254
+ messages?: ChatMessage[];
2255
+ renderItem?: (m: ChatMessage, i: number) => ReactNode;
2256
+ renderEmpty?: () => ReactNode;
2257
+ isLoadingMore?: boolean;
2258
+ topSentinelRef?: RefObject<HTMLDivElement | null>;
2259
+ bottomRef?: RefObject<HTMLDivElement | null>;
2260
+ className?: string;
2261
+ itemClassName?: string;
2262
+ }
2263
+ declare const MessageList: react.ForwardRefExoticComponent<MessageListProps & react.RefAttributes<HTMLDivElement>>;
2264
+
2265
+ interface MessageBubbleProps {
2266
+ message: ChatMessage;
2267
+ isUser?: boolean;
2268
+ showAvatar?: boolean;
2269
+ /** Override avatar URL (skips persona resolution). */
2270
+ avatarSrc?: string;
2271
+ /** Override avatar fallback (skips persona resolution). */
2272
+ avatarFallback?: ReactNode;
2273
+ /** Personas — when provided, take precedence over context. */
2274
+ user?: ChatUserContext;
2275
+ assistant?: ChatAssistantContext;
2276
+ showTimestamp?: boolean;
2277
+ showActions?: boolean;
2278
+ isCompact?: boolean;
2279
+ className?: string;
2280
+ beforeContent?: ReactNode;
2281
+ afterContent?: ReactNode;
2282
+ toolCallsRenderer?: (calls: ChatToolCall[]) => ReactNode;
2283
+ /** Forwarded to the default `<ToolCalls>` when `toolCallsRenderer` is not set. */
2284
+ toolCallsProps?: Omit<ToolCallsProps, 'calls'>;
2285
+ sourcesRenderer?: (sources: ChatSource[]) => ReactNode;
2286
+ attachmentsRenderer?: (atts: ChatAttachment[]) => ReactNode;
2287
+ /** Per-type attachment renderers forwarded to default `<Attachments>`. */
2288
+ attachmentRenderers?: AttachmentRendererMap;
2289
+ /** Click handler for attachment tiles (e.g. open lightbox). */
2290
+ onAttachmentOpen?: (a: ChatAttachment) => void;
2291
+ onCopy?: () => void;
2292
+ onRegenerate?: () => void;
2293
+ onEdit?: () => void;
2294
+ onDelete?: () => void;
2295
+ }
2296
+ declare const MessageBubble: react.MemoExoticComponent<({ message, isUser: isUserProp, showAvatar, avatarSrc, avatarFallback, user, assistant, showTimestamp, showActions, isCompact, className, beforeContent, afterContent, toolCallsRenderer, toolCallsProps, sourcesRenderer, attachmentsRenderer, attachmentRenderers, onAttachmentOpen, onCopy, onRegenerate, onEdit, onDelete, }: MessageBubbleProps) => react_jsx_runtime.JSX.Element>;
2297
+
2298
+ interface MessageActionsProps {
2299
+ role: ChatRole;
2300
+ onCopy?: () => void;
2301
+ onRegenerate?: () => void;
2302
+ onEdit?: () => void;
2303
+ onDelete?: () => void;
2304
+ hideOn?: Array<ChatRole>;
2305
+ className?: string;
2306
+ }
2307
+ declare function MessageActions({ role, onCopy, onRegenerate, onEdit, onDelete, hideOn, className, }: MessageActionsProps): react_jsx_runtime.JSX.Element;
2308
+
2309
+ interface ComposerProps {
2310
+ composer: UseChatComposerReturn;
2311
+ placeholder?: string;
2312
+ disabled?: boolean;
2313
+ showAttachmentButton?: boolean;
2314
+ onPickFiles?: () => void;
2315
+ toolbarStart?: ReactNode;
2316
+ toolbarEnd?: ReactNode;
2317
+ attachmentTray?: ReactNode;
2318
+ className?: string;
2319
+ textareaClassName?: string;
2320
+ /** Show "Stop" button instead of "Send" while streaming. */
2321
+ isStreaming?: boolean;
2322
+ onCancel?: () => void;
2323
+ }
2324
+ declare const Composer: react.ForwardRefExoticComponent<ComposerProps & react.RefAttributes<HTMLDivElement>>;
2325
+
2326
+ interface SourcesProps {
2327
+ sources: ChatSource[];
2328
+ layout?: 'inline' | 'grid';
2329
+ maxVisible?: number;
2330
+ onClick?: (source: ChatSource) => void;
2331
+ className?: string;
2332
+ }
2333
+ declare function Sources({ sources, layout, maxVisible, onClick, className }: SourcesProps): react_jsx_runtime.JSX.Element;
2334
+
2335
+ interface EmptyStateProps {
2336
+ greeting?: string;
2337
+ description?: string;
2338
+ suggestions?: Array<{
2339
+ label: string;
2340
+ prompt: string;
2341
+ }>;
2342
+ onPickSuggestion?: (prompt: string) => void;
2343
+ className?: string;
2344
+ }
2345
+ declare function EmptyState({ greeting, description, suggestions, onPickSuggestion, className, }: EmptyStateProps): react_jsx_runtime.JSX.Element;
2346
+
2347
+ interface ErrorBannerProps {
2348
+ error: string | null;
2349
+ onDismiss?: () => void;
2350
+ onRetry?: () => void;
2351
+ className?: string;
2352
+ }
2353
+ declare function ErrorBanner({ error, onDismiss, onRetry, className }: ErrorBannerProps): react_jsx_runtime.JSX.Element;
2354
+
2355
+ interface JumpToLatestProps {
2356
+ visible?: boolean;
2357
+ unreadCount?: number;
2358
+ onClick?: () => void;
2359
+ className?: string;
2360
+ }
2361
+ declare function JumpToLatest({ visible, unreadCount, onClick, className }: JumpToLatestProps): react_jsx_runtime.JSX.Element;
2362
+
2363
+ interface StreamingIndicatorProps {
2364
+ variant?: 'dots' | 'pulse';
2365
+ label?: string;
2366
+ className?: string;
2367
+ }
2368
+ declare function StreamingIndicator({ variant, label, className }: StreamingIndicatorProps): react_jsx_runtime.JSX.Element;
1383
2369
 
1384
2370
  /**
1385
2371
  * PrettyCode Component - Dynamic Import Wrapper
@@ -1418,7 +2404,7 @@ interface PrettyCodeProps {
1418
2404
  */
1419
2405
  variant?: 'card' | 'plain';
1420
2406
  }
1421
- declare const PrettyCode: React__default.FC<PrettyCodeProps>;
2407
+ declare const PrettyCode: react__default.FC<PrettyCodeProps>;
1422
2408
 
1423
2409
  /**
1424
2410
  * useLottie Hook
@@ -1501,7 +2487,7 @@ declare function LottiePlayer(props: LottiePlayerProps): react_jsx_runtime.JSX.E
1501
2487
  interface PlaygroundProps {
1502
2488
  config: PlaygroundConfig;
1503
2489
  }
1504
- declare const Playground: React__default.FC<PlaygroundProps>;
2490
+ declare const Playground: react__default.FC<PlaygroundProps>;
1505
2491
 
1506
2492
  /**
1507
2493
  * VideoPlayer - Unified Video Player Component
@@ -1541,12 +2527,12 @@ declare const Playground: React__default.FC<PlaygroundProps>;
1541
2527
  * <VideoPlayer source={{ type: 'blob', data: arrayBuffer, mimeType: 'video/mp4' }} />
1542
2528
  */
1543
2529
 
1544
- declare const VideoPlayer: React__default.ForwardRefExoticComponent<VideoPlayerProps & {
2530
+ declare const VideoPlayer: react__default.ForwardRefExoticComponent<VideoPlayerProps & {
1545
2531
  source: VideoSourceUnion | SimpleStreamSource;
1546
- } & React__default.RefAttributes<VideoPlayerRef>>;
2532
+ } & react__default.RefAttributes<VideoPlayerRef>>;
1547
2533
 
1548
2534
  interface VideoControlsProps {
1549
- player: React__default.RefObject<MediaPlayerInstance | null>;
2535
+ player: react__default.RefObject<MediaPlayerInstance | null>;
1550
2536
  className?: string;
1551
2537
  }
1552
2538
  declare function VideoControls({ player, className }: VideoControlsProps): react_jsx_runtime.JSX.Element;
@@ -1563,7 +2549,7 @@ interface VideoErrorFallbackProps extends ErrorFallbackProps {
1563
2549
  /** Custom className */
1564
2550
  className?: string;
1565
2551
  /** Custom icon */
1566
- icon?: React__default.ReactNode;
2552
+ icon?: react__default.ReactNode;
1567
2553
  /** Custom title (defaults to error message) */
1568
2554
  title?: string;
1569
2555
  /** Custom description */
@@ -1618,21 +2604,21 @@ interface CreateVideoErrorFallbackOptions {
1618
2604
  *
1619
2605
  * <VideoPlayer source={source} errorFallback={errorFallback} />
1620
2606
  */
1621
- declare function createVideoErrorFallback(options: CreateVideoErrorFallbackOptions): (props: ErrorFallbackProps, source?: unknown) => React__default.ReactNode;
2607
+ declare function createVideoErrorFallback(options: CreateVideoErrorFallbackOptions): (props: ErrorFallbackProps, source?: unknown) => react__default.ReactNode;
1622
2608
 
1623
2609
  /**
1624
2610
  * VidstackProvider - Full-featured video player using Vidstack
1625
2611
  * Supports YouTube, Vimeo, HLS, DASH, and direct URLs
1626
2612
  */
1627
2613
 
1628
- declare const VidstackProvider: React__default.ForwardRefExoticComponent<VidstackProviderProps & React__default.RefAttributes<VideoPlayerRef>>;
2614
+ declare const VidstackProvider: react__default.ForwardRefExoticComponent<VidstackProviderProps & react__default.RefAttributes<VideoPlayerRef>>;
1629
2615
 
1630
2616
  /**
1631
2617
  * NativeProvider - Lightweight native HTML5 video player
1632
2618
  * For demo videos, background videos, autoplay loop muted scenarios
1633
2619
  */
1634
2620
 
1635
- declare const NativeProvider: React__default.ForwardRefExoticComponent<NativeProviderProps & React__default.RefAttributes<VideoPlayerRef>>;
2621
+ declare const NativeProvider: react__default.ForwardRefExoticComponent<NativeProviderProps & react__default.RefAttributes<VideoPlayerRef>>;
1636
2622
 
1637
2623
  /**
1638
2624
  * StreamProvider - HTTP Range streaming and Blob video player
@@ -1644,7 +2630,7 @@ declare const NativeProvider: React__default.ForwardRefExoticComponent<NativePro
1644
2630
  * - Custom error fallback
1645
2631
  */
1646
2632
 
1647
- declare const StreamProvider: React__default.ForwardRefExoticComponent<StreamProviderProps & React__default.RefAttributes<VideoPlayerRef>>;
2633
+ declare const StreamProvider: react__default.ForwardRefExoticComponent<StreamProviderProps & react__default.RefAttributes<VideoPlayerRef>>;
1648
2634
 
1649
2635
  /**
1650
2636
  * Provider for VideoPlayer streaming configuration
@@ -1703,7 +2689,7 @@ declare function resolveStreamSource(source: SimpleStreamSource, context: VideoP
1703
2689
  */
1704
2690
  declare function resolveFileSource(options: ResolveFileSourceOptions): VideoSourceUnion | null;
1705
2691
 
1706
- declare const Player: React$1.ForwardRefExoticComponent<PlayerProps & React$1.RefAttributes<PlayerHandle>>;
2692
+ declare const Player: react.ForwardRefExoticComponent<PlayerProps & react.RefAttributes<PlayerHandle>>;
1707
2693
 
1708
2694
  declare function ImageViewer({ images, initialIndex, inDialog, }: ImageViewerProps): react_jsx_runtime.JSX.Element;
1709
2695
 
@@ -2015,7 +3001,7 @@ interface EditorRef {
2015
3001
  * />
2016
3002
  * ```
2017
3003
  */
2018
- declare const Editor: React$1.ForwardRefExoticComponent<EditorProps & React$1.RefAttributes<EditorRef>>;
3004
+ declare const Editor: react.ForwardRefExoticComponent<EditorProps & react.RefAttributes<EditorRef>>;
2019
3005
 
2020
3006
  /**
2021
3007
  * Monaco Diff Editor Component
@@ -2400,4 +3386,4 @@ declare function useBlobUrlCleanup(key: string | null): void;
2400
3386
  */
2401
3387
  declare function generateContentKey(content: ArrayBuffer): string;
2402
3388
 
2403
- export { type ApiKey, ArrayFieldItemTemplate, ArrayFieldTemplate, type AspectRatioValue, Player as AudioPlayer, type PlayerProps as AudioPlayerProps, BaseInputTemplate, type BlobSource, CardLoadingFallback, CheckboxWidget, ColorWidget, type CreateLazyComponentOptions, type CreateVideoErrorFallbackOptions, CronScheduler, type CronSchedulerContextValue, type CronSchedulerProps, CronSchedulerProvider, type CronSchedulerState, CustomInput, type DASHSource, type DataUrlSource, DayChips, DiffEditor, type DiffEditorProps, type DisabledWhenRule, Editor, type EditorContextValue, type EditorFile, type EditorOptions, type EditorProps, EditorProvider, type EditorRef, type ErrorFallbackProps, ErrorListTemplate, FieldTemplate, type HLSSource, type ImageFile, ImageViewer, type ImageViewerProps, type JsonFormContext, type JsonFormDensity, JsonSchemaForm, type JsonSchemaFormProps, JsonTreeComponent as JsonTree, type JsonTreeConfig, type JsonTreeProps, LazyPlayer as LazyAudioPlayer, LazyCronScheduler, LazyImageViewer, LazyJsonSchemaForm, LazyJsonTree, LazyLottiePlayer, LazyMapContainer, LazyMapView, LazyMermaid, LazyOpenapiViewer, LazyPrettyCode, LazyTree, TreeRootProps as LazyTreeProps, LazyVideoPlayer, LazyWrapper, type LazyWrapperProps, type LinkRule, LoadingFallback, type LoadingFallbackProps, type LottieDirection, LottiePlayer, type LottiePlayerProps, type LottieSize, type LottieSpeed, type MapContainerProps, MapLoadingFallback, type MapStyleKey, type MapViewport, MarkdownEditor, type MarkdownEditorProps, MarkdownMessage, type MarkdownMessageProps, type MarkerData, type MentionAttrs, type MentionConfig, type MentionItem, type MentionMarkdownRenderer, Mermaid, type MermaidProps, type MonthDay, MonthDayGrid, NativeProvider, NumberWidget, ObjectFieldTemplate, Playground as OpenapiViewer, type PlayerMode, type PlaygroundConfig, type PlaygroundProps$1 as PlaygroundProps, PrettyCode, type PrettyCodeProps$1 as PrettyCodeProps, type ResolveFileSourceOptions, SchedulePreview, type ScheduleType, ScheduleTypeSelector, type SchemaSource, SelectWidget, type SimpleStreamSource, SliderWidget, Spinner, StreamProvider, type StreamSource, SwitchWidget, TextWidget, TimeSelector, TreeRootProps, type UiGroup, type UrlSource, type UseCollapsibleContentOptions, type UseCollapsibleContentResult, type UseEditorReturn, type UseLottieOptions, type UseLottieReturn, type UseMonacoReturn, VideoControls, VideoErrorFallback, type VideoErrorFallbackProps, VideoPlayer, type VideoPlayerContextValue, type VideoPlayerProps, VideoPlayerProvider, type VideoPlayerProviderProps, type VideoPlayerRef, type VideoSourceUnion, VidstackProvider, type VimeoSource, type WeekDay, type YouTubeSource, buildCron, createLazyComponent, createVideoErrorFallback, evaluateDisabledWhen, extractTextFromChildren, generateContentKey, getRequiredFields, hasRequiredFields, humanizeCron, isSimpleStreamSource, isValidCron, mentionPresets, mergeDefaults, normalizeFormData, parseCron, resolveFileSource, resolvePlayerMode, resolveStreamSource, safeJsonParse, safeJsonStringify, useAudioCache, useBlobUrlCleanup, useCollapsibleContent, useCronCustom, useCronMonthDays, useCronPreview, useCronScheduler, useCronSchedulerContext, useCronTime, useCronType, useCronWeekDays, useEditor, useEditorContext, useImageCache, useLanguage, useLottie, useMediaCacheStore, useMonaco, useVideoCache, useVideoPlayerContext, useVideoPlayerSettings, validateRequiredFields, validateSchema };
3389
+ export { type ApiKey, ArrayFieldItemTemplate, ArrayFieldTemplate, type AspectRatioValue, type AttachmentRenderer, type AttachmentRendererArgs, type AttachmentRendererMap, Attachments, AttachmentsGrid, type AttachmentsGridProps, AttachmentsList, type AttachmentsListProps, type AttachmentsProps, Player as AudioPlayer, type PlayerProps as AudioPlayerProps, BaseInputTemplate, type BlobSource, CHAT_EVENT_NAME, CSS_VARS, CardLoadingFallback, type ChatAction, type ChatAssistantContext, type ChatAttachment, type ChatAudioConfig, type ChatAudioEvent, type ChatAudioSounds, type ChatConfig, type ChatContextValue, type ChatDisplayMode, type ChatEventDetail, type ChatLabels, type ChatLightboxState, type ChatLogScope, type ChatLogger, type ChatMessage, type ChatPersona, type ChatPrefs, ChatProvider, type ChatProviderProps, type ChatRole, ChatRoot, type ChatRootProps, type ChatSource, type ChatState, type ChatStreamEvent, type ChatToolCall, type ChatTransport, type ChatUserContext, CheckboxWidget, ColorWidget, Composer, type ComposerProps, type CreateLazyComponentOptions, type CreateSessionOptions, type CreateVideoErrorFallbackOptions, CronScheduler, type CronSchedulerContextValue, type CronSchedulerProps, CronSchedulerProvider, type CronSchedulerState, CustomInput, type DASHSource, DEFAULT_LABELS, DEFAULT_SIDEBAR, DEFAULT_Z_INDEX, type DataUrlSource, DayChips, DiffEditor, type DiffEditorProps, type DisabledWhenRule, Editor, type EditorContextValue, type EditorFile, type EditorOptions, type EditorProps, EditorProvider, type EditorRef, EmptyState, type EmptyStateProps, ErrorBanner, type ErrorBannerProps, type ErrorFallbackProps, ErrorListTemplate, FieldTemplate, type HLSSource, HOTKEYS, type HistoryPage, type HttpTransportConfig, type ImageFile, ImageViewer, type ImageViewerProps, type JsonFormContext, type JsonFormDensity, JsonSchemaForm, type JsonSchemaFormProps, JsonTreeComponent as JsonTree, type JsonTreeConfig, type JsonTreeProps, JumpToLatest, type JumpToLatestProps, LIMITS, LazyPlayer as LazyAudioPlayer, LazyChat, type ChatRootProps as LazyChatProps, LazyCronScheduler, LazyImageViewer, LazyJsonSchemaForm, LazyJsonTree, LazyLottiePlayer, LazyMapContainer, LazyMapView, LazyMermaid, LazyOpenapiViewer, LazyPrettyCode, LazyTree, TreeRootProps as LazyTreeProps, LazyVideoPlayer, LazyWrapper, type LazyWrapperProps, type LinkRule, LoadingFallback, type LoadingFallbackProps, type LottieDirection, LottiePlayer, type LottiePlayerProps, type LottieSize, type LottieSpeed, type MapContainerProps, MapLoadingFallback, type MapStyleKey, type MapViewport, MarkdownEditor, type MarkdownEditorProps, MarkdownMessage, type MarkdownMessageProps, type MarkerData, type MentionAttrs, type MentionConfig, type MentionItem, type MentionMarkdownRenderer, Mermaid, type MermaidProps, MessageActions, type MessageActionsProps, MessageBubble, type MessageBubbleProps, MessageList, type MessageListProps, type MockTransportOptions, type MonthDay, MonthDayGrid, NativeProvider, NumberWidget, ObjectFieldTemplate, Playground as OpenapiViewer, type ParseSSEOptions, type PlayerMode, type PlaygroundConfig, type PlaygroundProps$1 as PlaygroundProps, PrettyCode, type PrettyCodeProps$1 as PrettyCodeProps, type ResolveFileSourceOptions, STORAGE_KEYS, SchedulePreview, type ScheduleType, ScheduleTypeSelector, type SchemaSource, SelectWidget, type SendOptions, type SessionInfo, type SimpleStreamSource, SliderWidget, Sources, type SourcesProps, Spinner, type StreamOptions, StreamProvider, type StreamSource, StreamingIndicator, type StreamingIndicatorProps, SwitchWidget, TextWidget, TimeSelector, type TokenBuffer, ToolCalls, type ToolCallsProps, type ToolPayloadFallback, type ToolPayloadKind, type ToolPayloadMatcher, TransportError, TreeRootProps, type UiGroup, type UrlSource, type UseChatAudioReturn, type UseChatComposerOptions, type UseChatComposerReturn, type UseChatConfig, type UseChatHistoryOptions, type UseChatLayoutConfig, type UseChatLayoutReturn, type UseChatLightboxReturn, type UseChatReturn, type UseChatScrollOptions, type UseChatScrollReturn, type UseCollapsibleContentOptions, type UseCollapsibleContentResult, type UseEditorReturn, type UseLottieOptions, type UseLottieReturn, type UseMonacoReturn, VideoControls, VideoErrorFallback, type VideoErrorFallbackProps, VideoPlayer, type VideoPlayerContextValue, type VideoPlayerProps, VideoPlayerProvider, type VideoPlayerProviderProps, type VideoPlayerRef, type VideoSourceUnion, VidstackProvider, type VimeoSource, type WeekDay, type YouTubeSource, buildCron, collectImageAttachments, createHttpTransport, createId, createLazyComponent, createMockTransport, createTokenBuffer, createVideoErrorFallback, deriveInitials, dispatchToolPayload, evaluateDisabledWhen, extractTextFromChildren, generateContentKey, getChatLogger, getRequiredFields, hasRequiredFields, humanizeCron, initialState, isGeoJSONFeatureCollection, isLatLng, isPlainObject, isSimpleStreamSource, isStringValue, isValidCron, mentionPresets, mergeDefaults, normalizeFormData, parseCron, parseSSE, reducer, resolveFileSource, resolvePersona, resolvePlayerMode, resolveStreamSource, safeJsonParse, safeJsonStringify, useAudioCache, useBlobUrlCleanup, useChat, useChatAudio, useChatAudioPrefs, useChatComposer, useChatContext, useChatContextOptional, useChatHistory, useChatLayout, useChatLightbox, useChatScroll, useCollapsibleContent, useCronCustom, useCronMonthDays, useCronPreview, useCronScheduler, useCronSchedulerContext, useCronTime, useCronType, useCronWeekDays, useEditor, useEditorContext, useImageCache, useLanguage, useLottie, useMediaCacheStore, useMonaco, useVideoCache, useVideoPlayerContext, useVideoPlayerSettings, validateRequiredFields, validateSchema };