@inkeep/agents-ui 0.16.0 → 0.16.2

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 (124) hide show
  1. package/dist/color-mode/index.js +4 -4
  2. package/dist/index.cjs +1 -1
  3. package/dist/index.js +167 -161
  4. package/dist/node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.3.0-canary-87ae75b3-20260128/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.cjs +9 -0
  5. package/dist/node_modules/.pnpm/{use-sync-external-store@1.5.0_react@19.0.0 → use-sync-external-store@1.6.0_react@19.3.0-canary-87ae75b3-20260128}/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +2 -2
  6. package/dist/primitives/atoms/cmdk/index.cjs +1 -1
  7. package/dist/primitives/atoms/cmdk/index.js +14 -2
  8. package/dist/primitives/atoms/combobox.d.ts +104 -0
  9. package/dist/primitives/atoms/icons/built-in-icons.cjs +1 -1
  10. package/dist/primitives/atoms/icons/built-in-icons.d.ts +4 -1
  11. package/dist/primitives/atoms/icons/built-in-icons.js +94 -91
  12. package/dist/primitives/atoms/icons/collections/pi.cjs +1 -1
  13. package/dist/primitives/atoms/icons/collections/pi.d.ts +3 -0
  14. package/dist/primitives/atoms/icons/collections/pi.js +82 -37
  15. package/dist/primitives/atoms/icons/inkeep-default-icons.cjs +1 -1
  16. package/dist/primitives/atoms/icons/inkeep-default-icons.js +4 -1
  17. package/dist/primitives/atoms/portal.js +3 -3
  18. package/dist/primitives/atoms/select.cjs +1 -1
  19. package/dist/primitives/atoms/select.js +2 -2
  20. package/dist/primitives/atoms/shadow/context.js +4 -4
  21. package/dist/primitives/components/embedded-chat/chat-error-helpers.cjs +3 -0
  22. package/dist/primitives/components/embedded-chat/chat-error-helpers.d.ts +26 -0
  23. package/dist/primitives/components/embedded-chat/chat-error-helpers.js +32 -0
  24. package/dist/primitives/components/embedded-chat/file-upload-input.cjs +1 -1
  25. package/dist/primitives/components/embedded-chat/file-upload-input.d.ts +1 -2
  26. package/dist/primitives/components/embedded-chat/file-upload-input.js +359 -217
  27. package/dist/primitives/components/embedded-chat/image-preview-modal.js +3 -3
  28. package/dist/primitives/components/embedded-chat/use-chat-action.cjs +1 -1
  29. package/dist/primitives/components/embedded-chat/use-chat-action.js +16 -14
  30. package/dist/primitives/components/embedded-chat/use-inkeep-chat.cjs +2 -4
  31. package/dist/primitives/components/embedded-chat/use-inkeep-chat.d.ts +1 -2
  32. package/dist/primitives/components/embedded-chat/use-inkeep-chat.js +312 -284
  33. package/dist/primitives/components/embedded-chat/use-stream-processor.cjs +1 -1
  34. package/dist/primitives/components/embedded-chat/use-stream-processor.js +1 -1
  35. package/dist/primitives/components/embedded-chat.cjs +3 -3
  36. package/dist/primitives/components/embedded-chat.d.ts +2 -3
  37. package/dist/primitives/components/embedded-chat.js +122 -114
  38. package/dist/primitives/components/embedded-search/search-provider.js +3 -3
  39. package/dist/primitives/components/embedded-search.cjs +1 -1
  40. package/dist/primitives/components/embedded-search.d.ts +1 -1
  41. package/dist/primitives/components/embedded-search.js +3 -3
  42. package/dist/primitives/components/modal/modal-provider.js +2 -2
  43. package/dist/primitives/components/modal.js +3 -3
  44. package/dist/primitives/components/sidebar-chat/index.js +1 -1
  45. package/dist/primitives/components/tagline-logo-icon.js +50 -9
  46. package/dist/primitives/hooks/use-events-api.cjs +1 -0
  47. package/dist/primitives/hooks/use-events-api.d.ts +29 -0
  48. package/dist/primitives/hooks/use-events-api.js +43 -0
  49. package/dist/primitives/hooks/use-initial-conversation.js +4 -1
  50. package/dist/primitives/hooks/use-input-notification.js +9 -9
  51. package/dist/primitives/index.cjs +1 -1
  52. package/dist/primitives/index.js +150 -144
  53. package/dist/primitives/providers/base-events-provider.cjs +1 -1
  54. package/dist/primitives/providers/base-events-provider.d.ts +2 -0
  55. package/dist/primitives/providers/base-events-provider.js +23 -22
  56. package/dist/primitives/providers/chat-auth-provider.cjs +1 -0
  57. package/dist/primitives/providers/chat-auth-provider.d.ts +27 -0
  58. package/dist/primitives/providers/chat-auth-provider.js +46 -0
  59. package/dist/primitives/providers/chat-base-events-provider.cjs +1 -0
  60. package/dist/primitives/providers/chat-base-events-provider.d.ts +12 -0
  61. package/dist/primitives/providers/chat-base-events-provider.js +73 -0
  62. package/dist/primitives/providers/chat-bubble-provider.js +1 -1
  63. package/dist/primitives/providers/chat-form-provider.d.ts +1 -1
  64. package/dist/primitives/providers/chat-form-provider.js +4 -4
  65. package/dist/primitives/providers/chat-history-provider.js +3 -3
  66. package/dist/primitives/providers/config-provider.js +3 -3
  67. package/dist/primitives/providers/feedback-provider.cjs +1 -1
  68. package/dist/primitives/providers/feedback-provider.js +37 -31
  69. package/dist/primitives/providers/form-field-provider.js +3 -3
  70. package/dist/primitives/providers/help-menu-provider.js +4 -4
  71. package/dist/primitives/providers/hover-popover-provider.js +3 -3
  72. package/dist/primitives/providers/image-preview-provider.js +5 -5
  73. package/dist/primitives/providers/index.cjs +1 -1
  74. package/dist/primitives/providers/index.d.ts +2 -0
  75. package/dist/primitives/providers/index.js +57 -51
  76. package/dist/primitives/providers/markdown-provider.js +2 -2
  77. package/dist/primitives/providers/message-provider.js +1 -1
  78. package/dist/primitives/providers/sidebar-chat-provider.js +3 -3
  79. package/dist/primitives/providers/source-item-provider.js +3 -3
  80. package/dist/primitives/providers/widget-provider.js +2 -2
  81. package/dist/primitives/utils/misc.cjs +1 -1
  82. package/dist/primitives/utils/misc.js +2 -2
  83. package/dist/react/chat-button.js +1 -1
  84. package/dist/react/embedded-chat.cjs +1 -1
  85. package/dist/react/embedded-chat.js +104 -102
  86. package/dist/react/embedded-search.cjs +1 -1
  87. package/dist/react/embedded-search.js +18 -18
  88. package/dist/react/index.cjs +1 -1
  89. package/dist/react/index.js +167 -161
  90. package/dist/styled/components/chat-bubble.js +4 -4
  91. package/dist/styled/components/chat-button.cjs +1 -1
  92. package/dist/styled/components/chat-button.js +9 -9
  93. package/dist/styled/components/chat-history.cjs +1 -1
  94. package/dist/styled/components/chat-history.js +22 -22
  95. package/dist/styled/components/embedded-chat/file-upload-input.cjs +1 -1
  96. package/dist/styled/components/embedded-chat/file-upload-input.js +71 -72
  97. package/dist/styled/components/embedded-chat/image-preview-modal.js +14 -7
  98. package/dist/styled/components/embedded-chat.cjs +1 -1
  99. package/dist/styled/components/embedded-chat.js +211 -199
  100. package/dist/styled/components/embedded-search.cjs +1 -1
  101. package/dist/styled/components/embedded-search.js +72 -66
  102. package/dist/styled/components/loading-indicator.cjs +1 -1
  103. package/dist/styled/components/loading-indicator.js +1 -1
  104. package/dist/styled/components/message.cjs +1 -1
  105. package/dist/styled/components/message.js +142 -139
  106. package/dist/styled/components/modal.js +3 -3
  107. package/dist/styled/components/searchbar.js +8 -8
  108. package/dist/styled/components/sidebar-chat.cjs +1 -1
  109. package/dist/styled/components/sidebar-chat.js +5 -5
  110. package/dist/styled/index.cjs +1 -1
  111. package/dist/styled/index.js +155 -149
  112. package/dist/styled/inkeep.css.cjs +13 -3
  113. package/dist/styled/inkeep.css.js +13 -3
  114. package/dist/theme/utils/generate-theme-variables.js +6 -6
  115. package/dist/types/config/ai.d.ts +5 -0
  116. package/dist/types/events.d.ts +11 -0
  117. package/dist/types/icons/built-in.d.ts +1 -1
  118. package/dist/types/icons/custom.d.ts +3 -0
  119. package/package.json +2 -2
  120. package/dist/node_modules/.pnpm/use-sync-external-store@1.5.0_react@19.0.0/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.cjs +0 -9
  121. /package/dist/node_modules/.pnpm/{use-sync-external-store@1.5.0_react@19.0.0 → use-sync-external-store@1.6.0_react@19.3.0-canary-87ae75b3-20260128}/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.cjs +0 -0
  122. /package/dist/node_modules/.pnpm/{use-sync-external-store@1.5.0_react@19.0.0 → use-sync-external-store@1.6.0_react@19.3.0-canary-87ae75b3-20260128}/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +0 -0
  123. /package/dist/node_modules/.pnpm/{use-sync-external-store@1.5.0_react@19.0.0 → use-sync-external-store@1.6.0_react@19.3.0-canary-87ae75b3-20260128}/node_modules/use-sync-external-store/shim/index.cjs +0 -0
  124. /package/dist/node_modules/.pnpm/{use-sync-external-store@1.5.0_react@19.0.0 → use-sync-external-store@1.6.0_react@19.3.0-canary-87ae75b3-20260128}/node_modules/use-sync-external-store/shim/index.js +0 -0
@@ -1,164 +1,170 @@
1
- import { BaseEventsProvider as u, useBaseEvents as C } from "./providers/base-events-provider.js";
2
- import { ChatFormProvider as x, useChatForm as h, useChatFormState as l } from "./providers/chat-form-provider.js";
3
- import { ChatHistoryProvider as v, useChatHistory as P } from "./providers/chat-history-provider.js";
4
- import { InkeepConfigProvider as I, WebWidgetInteractionType as c, useInkeepConfig as g } from "./providers/config-provider.js";
5
- import { FeedbackProvider as M, useMessageFeedback as k } from "./providers/feedback-provider.js";
6
- import { FormFieldProvider as F, useFormField as H } from "./providers/form-field-provider.js";
7
- import { HelpMenuProvider as R, useHelpMenu as E, useHelpMenuState as D } from "./providers/help-menu-provider.js";
8
- import { ChatMarkdownProvider as W, useChatMarkdown as A } from "./providers/markdown-provider.js";
9
- import { MessageProvider as z, useMessage as L, useOptionalMessage as $ } from "./providers/message-provider.js";
10
- import { RootProvider as K } from "./providers/root-provider.js";
11
- import { SourceItemProvider as Q, useSourceItem as U } from "./providers/source-item-provider.js";
12
- import { ThemeProvider as G } from "./providers/theme-provider.js";
13
- import { WidgetProvider as V, useWidget as X } from "./providers/widget-provider.js";
14
- import { SidebarChatProvider as Z, useInkeepSidebarChat as _, useOptionalSidebarChat as ee, useSidebarChat as oe } from "./providers/sidebar-chat-provider.js";
15
- import { ChatBubbleProvider as te, useChatBubble as ae, useInkeepChatBubble as me, useOptionalChatBubble as se } from "./providers/chat-bubble-provider.js";
16
- import { ikp as pe, jsxFactory as de } from "./components/factory.js";
1
+ import { BaseEventsContext as u, BaseEventsProvider as C, useBaseEvents as f } from "./providers/base-events-provider.js";
2
+ import { ChatAuthProvider as h, useChatAuth as l } from "./providers/chat-auth-provider.js";
3
+ import { ChatBaseEventsProvider as S } from "./providers/chat-base-events-provider.js";
4
+ import { ChatFormProvider as b, useChatForm as I, useChatFormState as c } from "./providers/chat-form-provider.js";
5
+ import { ChatHistoryProvider as B, useChatHistory as M } from "./providers/chat-history-provider.js";
6
+ import { InkeepConfigProvider as y, WebWidgetInteractionType as F, useInkeepConfig as E } from "./providers/config-provider.js";
7
+ import { FeedbackProvider as w, useMessageFeedback as R } from "./providers/feedback-provider.js";
8
+ import { FormFieldProvider as D, useFormField as O } from "./providers/form-field-provider.js";
9
+ import { HelpMenuProvider as T, useHelpMenu as z, useHelpMenuState as L } from "./providers/help-menu-provider.js";
10
+ import { ChatMarkdownProvider as j, useChatMarkdown as K } from "./providers/markdown-provider.js";
11
+ import { MessageProvider as Q, useMessage as U, useOptionalMessage as q } from "./providers/message-provider.js";
12
+ import { RootProvider as J } from "./providers/root-provider.js";
13
+ import { SourceItemProvider as X, useSourceItem as Y } from "./providers/source-item-provider.js";
14
+ import { ThemeProvider as _ } from "./providers/theme-provider.js";
15
+ import { WidgetProvider as oe, useWidget as re } from "./providers/widget-provider.js";
16
+ import { SidebarChatProvider as ae, useInkeepSidebarChat as me, useOptionalSidebarChat as se, useSidebarChat as ie } from "./providers/sidebar-chat-provider.js";
17
+ import { ChatBubbleProvider as de, useChatBubble as ne, useInkeepChatBubble as ue, useOptionalChatBubble as Ce } from "./providers/chat-bubble-provider.js";
18
+ import { ikp as xe, jsxFactory as he } from "./components/factory.js";
17
19
  import * as e from "./components/embedded-chat.js";
18
20
  import * as o from "./components/sidebar-chat/index.js";
19
- import { ChatProvider as ue, useChat as Ce } from "./components/embedded-chat/chat-provider.js";
21
+ import { ChatProvider as ve, useChat as Se } from "./components/embedded-chat/chat-provider.js";
20
22
  import * as r from "./components/embedded-search.js";
21
- import { SearchProvider as xe, SearchProviderImpl as he, useSearch as le } from "./components/embedded-search/search-provider.js";
23
+ import { SearchProvider as be, SearchProviderImpl as Ie, useSearch as ce } from "./components/embedded-search/search-provider.js";
22
24
  import * as t from "./components/modal.js";
23
- import { ModalProvider as ve, useModal as Pe } from "./components/modal/modal-provider.js";
25
+ import { ModalProvider as Be, useModal as Me } from "./components/modal/modal-provider.js";
24
26
  import * as a from "./components/chat-button.js";
25
27
  import * as m from "./components/searchbar.js";
26
28
  import * as s from "./components/chat-bubble/index.js";
27
29
  import * as i from "./components/data-summaries.js";
28
30
  import * as p from "./components/chat-history/index.js";
29
- import { useBoolean as Ie } from "./hooks/use-boolean.js";
30
- import { useComponentClassNames as ge } from "./hooks/use-component-classnames.js";
31
- import { useContainerSize as Me } from "./hooks/use-container-size.js";
32
- import { useInkeepOpenState as ye } from "./hooks/use-inkeep-open-state.js";
33
- import { useCopyToClipboard as He } from "./hooks/use-copy-to-clipboard.js";
34
- import { useInstantUpdate as Re } from "./hooks/use-instant-update.js";
35
- import { useIsMounted as De } from "./hooks/use-is-mounted.js";
36
- import { useMediaQuery as We } from "./hooks/use-media-query.js";
37
- import { useResizeObserver as Te } from "./hooks/use-resize-observer.js";
38
- import { useScrollingFades as Le, useScrollingFadesHorizontal as $e } from "./hooks/use-scrolling-fades.js";
39
- import { useSettleAction as Ke } from "./hooks/use-settle-action.js";
40
- import { useSimpleScroll as Qe } from "./hooks/use-simple-scroll.js";
41
- import { callAll as qe, dataAttr as Ge, getInitials as Je, getMessageContent as Ve, isCitationArtifact as Xe, isString as Ye, maybeRender as Ze, toKebabCase as _e } from "./utils/misc.js";
42
- import { ChatBubbleComponentIds as oo, DataSummaryComponentIds as ro, SearchBarComponentIds as to, SidebarChatComponentIds as ao, aiChatComponentIds as mo, aiChatHistoryComponentIds as so, aiSearchComponentIds as io, chatButtonComponentIds as po, componentIDs as no, markDownComponentIds as uo, miscellanousComponentIds as Co, modalComponentIds as fo } from "./utils/component-ids.js";
43
- import { composeRefs as ho, useComposedRefs as lo } from "./utils/compose-refs.js";
44
- import { mergeProps as vo } from "./utils/merge-props.js";
45
- import { Portal as bo } from "./atoms/portal.js";
46
- import { CustomIcon as co } from "./atoms/icons/custom-icon.js";
47
- import { BuiltInIconRenderer as Bo } from "./atoms/icons/built-in-icon-renderer.js";
48
- import { PortalWithTheme as ko } from "./atoms/portal-with-theme.js";
49
- import { Command as Fo, CommandDialog as Ho, CommandEmpty as wo, CommandInput as Ro, CommandItem as Eo, CommandList as Do, CommandLoading as Oo, CommandRoot as Wo, CommandSeparator as Ao, defaultFilter as To, useCommandState as zo, useCommandStore as Lo } from "./atoms/cmdk/index.js";
50
- import { ErrorBoundary as jo } from "./atoms/error-boundary.js";
51
- import { InkeepShadow as No, InkeepShadowProvider as Qo, ShadowContext as Uo, useShadow as qo } from "./atoms/shadow/context.js";
31
+ import { useBoolean as ye } from "./hooks/use-boolean.js";
32
+ import { useComponentClassNames as Ee } from "./hooks/use-component-classnames.js";
33
+ import { useContainerSize as we } from "./hooks/use-container-size.js";
34
+ import { useInkeepOpenState as Ae } from "./hooks/use-inkeep-open-state.js";
35
+ import { useCopyToClipboard as Oe } from "./hooks/use-copy-to-clipboard.js";
36
+ import { useInstantUpdate as Te } from "./hooks/use-instant-update.js";
37
+ import { useIsMounted as Le } from "./hooks/use-is-mounted.js";
38
+ import { useMediaQuery as je } from "./hooks/use-media-query.js";
39
+ import { useResizeObserver as Ne } from "./hooks/use-resize-observer.js";
40
+ import { useScrollingFades as Ue, useScrollingFadesHorizontal as qe } from "./hooks/use-scrolling-fades.js";
41
+ import { useSettleAction as Je } from "./hooks/use-settle-action.js";
42
+ import { useSimpleScroll as Xe } from "./hooks/use-simple-scroll.js";
43
+ import { callAll as Ze, dataAttr as _e, getInitials as eo, getMessageContent as oo, isCitationArtifact as ro, isString as to, maybeRender as ao, toKebabCase as mo } from "./utils/misc.js";
44
+ import { ChatBubbleComponentIds as io, DataSummaryComponentIds as po, SearchBarComponentIds as no, SidebarChatComponentIds as uo, aiChatComponentIds as Co, aiChatHistoryComponentIds as fo, aiSearchComponentIds as xo, chatButtonComponentIds as ho, componentIDs as lo, markDownComponentIds as vo, miscellanousComponentIds as So, modalComponentIds as Po } from "./utils/component-ids.js";
45
+ import { composeRefs as Io, useComposedRefs as co } from "./utils/compose-refs.js";
46
+ import { mergeProps as Bo } from "./utils/merge-props.js";
47
+ import { Portal as ko } from "./atoms/portal.js";
48
+ import { CustomIcon as Fo } from "./atoms/icons/custom-icon.js";
49
+ import { BuiltInIconRenderer as Ho } from "./atoms/icons/built-in-icon-renderer.js";
50
+ import { PortalWithTheme as Ro } from "./atoms/portal-with-theme.js";
51
+ import { Command as Do, CommandDialog as Oo, CommandEmpty as Wo, CommandInput as To, CommandItem as zo, CommandList as Lo, CommandLoading as $o, CommandRoot as jo, CommandSeparator as Ko, defaultFilter as No, useCommandState as Qo, useCommandStore as Uo } from "./atoms/cmdk/index.js";
52
+ import { ErrorBoundary as Go } from "./atoms/error-boundary.js";
53
+ import { InkeepShadow as Vo, InkeepShadowProvider as Xo, ShadowContext as Yo, useShadow as Zo } from "./atoms/shadow/context.js";
52
54
  export {
53
- u as BaseEventsProvider,
54
- Bo as BuiltInIconRenderer,
55
- oo as ChatBubbleComponentIds,
55
+ u as BaseEventsContext,
56
+ C as BaseEventsProvider,
57
+ Ho as BuiltInIconRenderer,
58
+ h as ChatAuthProvider,
59
+ S as ChatBaseEventsProvider,
60
+ io as ChatBubbleComponentIds,
56
61
  s as ChatBubblePrimitive,
57
- te as ChatBubbleProvider,
62
+ de as ChatBubbleProvider,
58
63
  a as ChatButtonPrimitive,
59
- x as ChatFormProvider,
64
+ b as ChatFormProvider,
60
65
  p as ChatHistoryPrimitive,
61
- v as ChatHistoryProvider,
62
- W as ChatMarkdownProvider,
63
- ue as ChatProvider,
64
- Fo as Command,
65
- Ho as CommandDialog,
66
- wo as CommandEmpty,
67
- Ro as CommandInput,
68
- Eo as CommandItem,
69
- Do as CommandList,
70
- Oo as CommandLoading,
71
- Wo as CommandRoot,
72
- Ao as CommandSeparator,
73
- co as CustomIcon,
74
- ro as DataSummaryComponentIds,
66
+ B as ChatHistoryProvider,
67
+ j as ChatMarkdownProvider,
68
+ ve as ChatProvider,
69
+ Do as Command,
70
+ Oo as CommandDialog,
71
+ Wo as CommandEmpty,
72
+ To as CommandInput,
73
+ zo as CommandItem,
74
+ Lo as CommandList,
75
+ $o as CommandLoading,
76
+ jo as CommandRoot,
77
+ Ko as CommandSeparator,
78
+ Fo as CustomIcon,
79
+ po as DataSummaryComponentIds,
75
80
  i as DataSummaryPrimitive,
76
81
  e as EmbeddedChatPrimitive,
77
82
  r as EmbeddedSearchPrimitive,
78
- jo as ErrorBoundary,
79
- M as FeedbackProvider,
80
- F as FormFieldProvider,
81
- R as HelpMenuProvider,
82
- I as InkeepConfigProvider,
83
- No as InkeepShadow,
84
- Qo as InkeepShadowProvider,
85
- z as MessageProvider,
83
+ Go as ErrorBoundary,
84
+ w as FeedbackProvider,
85
+ D as FormFieldProvider,
86
+ T as HelpMenuProvider,
87
+ y as InkeepConfigProvider,
88
+ Vo as InkeepShadow,
89
+ Xo as InkeepShadowProvider,
90
+ Q as MessageProvider,
86
91
  t as ModalPrimitive,
87
- ve as ModalProvider,
88
- bo as Portal,
89
- ko as PortalWithTheme,
90
- K as RootProvider,
91
- to as SearchBarComponentIds,
92
+ Be as ModalProvider,
93
+ ko as Portal,
94
+ Ro as PortalWithTheme,
95
+ J as RootProvider,
96
+ no as SearchBarComponentIds,
92
97
  m as SearchBarPrimitive,
93
- xe as SearchProvider,
94
- he as SearchProviderImpl,
95
- Uo as ShadowContext,
96
- ao as SidebarChatComponentIds,
98
+ be as SearchProvider,
99
+ Ie as SearchProviderImpl,
100
+ Yo as ShadowContext,
101
+ uo as SidebarChatComponentIds,
97
102
  o as SidebarChatPrimitive,
98
- Z as SidebarChatProvider,
99
- Q as SourceItemProvider,
100
- G as ThemeProvider,
101
- c as WebWidgetInteractionType,
102
- V as WidgetProvider,
103
- mo as aiChatComponentIds,
104
- so as aiChatHistoryComponentIds,
105
- io as aiSearchComponentIds,
106
- qe as callAll,
107
- po as chatButtonComponentIds,
108
- no as componentIDs,
109
- ho as composeRefs,
110
- Ge as dataAttr,
111
- To as defaultFilter,
112
- Je as getInitials,
113
- Ve as getMessageContent,
114
- pe as ikp,
115
- Xe as isCitationArtifact,
116
- Ye as isString,
117
- de as jsxFactory,
118
- uo as markDownComponentIds,
119
- Ze as maybeRender,
120
- vo as mergeProps,
121
- Co as miscellanousComponentIds,
122
- fo as modalComponentIds,
123
- _e as toKebabCase,
124
- C as useBaseEvents,
125
- Ie as useBoolean,
126
- Ce as useChat,
127
- ae as useChatBubble,
128
- h as useChatForm,
129
- l as useChatFormState,
130
- P as useChatHistory,
131
- A as useChatMarkdown,
132
- zo as useCommandState,
133
- Lo as useCommandStore,
134
- ge as useComponentClassNames,
135
- lo as useComposedRefs,
136
- Me as useContainerSize,
137
- He as useCopyToClipboard,
138
- H as useFormField,
139
- E as useHelpMenu,
140
- D as useHelpMenuState,
141
- me as useInkeepChatBubble,
142
- g as useInkeepConfig,
143
- ye as useInkeepOpenState,
144
- _ as useInkeepSidebarChat,
145
- Re as useInstantUpdate,
146
- De as useIsMounted,
147
- We as useMediaQuery,
148
- L as useMessage,
149
- k as useMessageFeedback,
150
- Pe as useModal,
151
- se as useOptionalChatBubble,
152
- $ as useOptionalMessage,
153
- ee as useOptionalSidebarChat,
154
- Te as useResizeObserver,
155
- Le as useScrollingFades,
156
- $e as useScrollingFadesHorizontal,
157
- le as useSearch,
158
- Ke as useSettleAction,
159
- qo as useShadow,
160
- oe as useSidebarChat,
161
- Qe as useSimpleScroll,
162
- U as useSourceItem,
163
- X as useWidget
103
+ ae as SidebarChatProvider,
104
+ X as SourceItemProvider,
105
+ _ as ThemeProvider,
106
+ F as WebWidgetInteractionType,
107
+ oe as WidgetProvider,
108
+ Co as aiChatComponentIds,
109
+ fo as aiChatHistoryComponentIds,
110
+ xo as aiSearchComponentIds,
111
+ Ze as callAll,
112
+ ho as chatButtonComponentIds,
113
+ lo as componentIDs,
114
+ Io as composeRefs,
115
+ _e as dataAttr,
116
+ No as defaultFilter,
117
+ eo as getInitials,
118
+ oo as getMessageContent,
119
+ xe as ikp,
120
+ ro as isCitationArtifact,
121
+ to as isString,
122
+ he as jsxFactory,
123
+ vo as markDownComponentIds,
124
+ ao as maybeRender,
125
+ Bo as mergeProps,
126
+ So as miscellanousComponentIds,
127
+ Po as modalComponentIds,
128
+ mo as toKebabCase,
129
+ f as useBaseEvents,
130
+ ye as useBoolean,
131
+ Se as useChat,
132
+ l as useChatAuth,
133
+ ne as useChatBubble,
134
+ I as useChatForm,
135
+ c as useChatFormState,
136
+ M as useChatHistory,
137
+ K as useChatMarkdown,
138
+ Qo as useCommandState,
139
+ Uo as useCommandStore,
140
+ Ee as useComponentClassNames,
141
+ co as useComposedRefs,
142
+ we as useContainerSize,
143
+ Oe as useCopyToClipboard,
144
+ O as useFormField,
145
+ z as useHelpMenu,
146
+ L as useHelpMenuState,
147
+ ue as useInkeepChatBubble,
148
+ E as useInkeepConfig,
149
+ Ae as useInkeepOpenState,
150
+ me as useInkeepSidebarChat,
151
+ Te as useInstantUpdate,
152
+ Le as useIsMounted,
153
+ je as useMediaQuery,
154
+ U as useMessage,
155
+ R as useMessageFeedback,
156
+ Me as useModal,
157
+ Ce as useOptionalChatBubble,
158
+ q as useOptionalMessage,
159
+ se as useOptionalSidebarChat,
160
+ Ne as useResizeObserver,
161
+ Ue as useScrollingFades,
162
+ qe as useScrollingFadesHorizontal,
163
+ ce as useSearch,
164
+ Je as useSettleAction,
165
+ Zo as useShadow,
166
+ ie as useSidebarChat,
167
+ Xe as useSimpleScroll,
168
+ Y as useSourceItem,
169
+ re as useWidget
164
170
  };
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("react/jsx-runtime"),t=require("react"),l=require("./config-provider.cjs"),a=t.createContext(void 0),p=({children:e})=>{const{baseSettings:s,componentType:n}=l.useInkeepConfig(),{tags:o,analyticsProperties:r}=s,i=t.useMemo(()=>({widgetLibraryVersion:"0.16.0",componentType:n,tags:o}),[n,o]),u={logEvent:t.useCallback(async c=>{const v={...i,...c.properties,...r},d={eventName:c.eventName,properties:v};return s.onEvent?.(d)},[s,i,r])};return E.jsx(a.Provider,{value:u,children:e})},g=()=>{const e=t.useContext(a);if(!e)throw new Error("useBaseEvents must be used within a BaseEventsProvider");return e};exports.BaseEventsProvider=p;exports.useBaseEvents=g;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),t=require("react"),p=require("./config-provider.cjs"),n=t.createContext(void 0),g=({children:e})=>{const{baseSettings:s,componentType:o}=p.useInkeepConfig(),{tags:r,analyticsProperties:i}=s,c="0.16.2",a=t.useMemo(()=>({widgetLibraryVersion:c,componentType:o,tags:r}),[o,r,c]),v={logEvent:t.useCallback(async u=>{const E={...a,...u.properties,...i},d={eventName:u.eventName,properties:E};return s.onEvent?.(d)},[s,a,i])};return l.jsx(n.Provider,{value:v,children:e})},m=()=>{const e=t.useContext(n);if(!e)throw new Error("useBaseEvents must be used within a BaseEventsProvider");return e};exports.BaseEventsContext=n;exports.BaseEventsProvider=g;exports.useBaseEvents=m;
@@ -1,4 +1,6 @@
1
1
  import { InkeepEvent } from '../../types/index.ts';
2
+ import { Context } from 'react';
3
+ export declare const BaseEventsContext: Context<BaseEventsContextValue | undefined>;
2
4
  export type BaseEventsContextValue = {
3
5
  logEvent: (event: InkeepEvent) => Promise<void>;
4
6
  };
@@ -1,37 +1,38 @@
1
1
  "use client";
2
- import { jsx as p } from "react/jsx-runtime";
3
- import { useMemo as u, useCallback as E, createContext as d, useContext as l } from "react";
4
- import { useInkeepConfig as g } from "./config-provider.js";
5
- const a = d(void 0), P = ({ children: e }) => {
6
- const { baseSettings: t, componentType: o } = g(), { tags: s, analyticsProperties: n } = t, r = u(
2
+ import { jsx as u } from "react/jsx-runtime";
3
+ import { createContext as E, useMemo as d, useCallback as l, useContext as g } from "react";
4
+ import { useInkeepConfig as x } from "./config-provider.js";
5
+ const c = E(void 0), b = ({ children: e }) => {
6
+ const { baseSettings: t, componentType: o } = x(), { tags: s, analyticsProperties: n } = t, r = "0.16.2", i = d(
7
7
  () => ({
8
- widgetLibraryVersion: "0.16.0",
8
+ widgetLibraryVersion: r,
9
9
  componentType: o,
10
10
  tags: s
11
11
  }),
12
- [o, s]
13
- ), c = { logEvent: E(
14
- async (i) => {
15
- const v = {
16
- ...r,
17
- ...i.properties,
12
+ [o, s, r]
13
+ ), v = { logEvent: l(
14
+ async (a) => {
15
+ const m = {
16
+ ...i,
17
+ ...a.properties,
18
18
  ...n
19
- }, m = {
20
- eventName: i.eventName,
21
- properties: v
19
+ }, p = {
20
+ eventName: a.eventName,
21
+ properties: m
22
22
  };
23
- return t.onEvent?.(m);
23
+ return t.onEvent?.(p);
24
24
  },
25
- [t, r, n]
25
+ [t, i, n]
26
26
  ) };
27
- return /* @__PURE__ */ p(a.Provider, { value: c, children: e });
28
- }, b = () => {
29
- const e = l(a);
27
+ return /* @__PURE__ */ u(c.Provider, { value: v, children: e });
28
+ }, w = () => {
29
+ const e = g(c);
30
30
  if (!e)
31
31
  throw new Error("useBaseEvents must be used within a BaseEventsProvider");
32
32
  return e;
33
33
  };
34
34
  export {
35
- P as BaseEventsProvider,
36
- b as useBaseEvents
35
+ c as BaseEventsContext,
36
+ b as BaseEventsProvider,
37
+ w as useBaseEvents
37
38
  };
@@ -0,0 +1 @@
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("react/jsx-runtime"),d=require("react"),T=require("./config-provider.cjs"),O=require("../components/modal/modal-provider.cjs"),m=require("./chat-bubble-provider.cjs"),x=require("./sidebar-chat-provider.cjs"),B=require("../hooks/use-auth-token.cjs"),R=require("../components/embedded-chat/use-captcha.cjs"),w=require("../hooks/use-anonymous-session.cjs"),l=d.createContext(void 0),I=({children:e})=>{const{baseSettings:n,aiChatSettings:p}=T.useInkeepConfig(),{shouldBypassCaptcha:C,privacyPreferences:A}=n,{baseUrl:i,appId:b,apiKey:s}=p,v=O.useModal(),f=m.useOptionalChatBubble(),g=x.useOptionalSidebarChat(),k=v?.isOpen??f?.isOpen??g?.isOpen??!0,{authToken:o,isLoading:a,refreshToken:q}=B.useAuthToken(),y=!!n.getAuthToken,t=!!o,{getCaptchaHeader:r,invalidate:u}=R.useCaptcha({baseUrl:i,shouldBypassCaptcha:C||!!s,shouldMakeInitialRequest:k}),{sessionToken:c,refreshSession:h}=w.useAnonymousSession({baseUrl:i,appId:b,getCaptchaHeader:r,invalidateCaptcha:u,optOutAllAnalytics:A?.optOutAllAnalytics,enabled:!t&&!a}),P={authToken:o,isAuthenticated:t,isAuthLoading:a,isAuthConfigured:y,refreshAuthToken:q,sessionToken:c,refreshSession:h,getCaptchaHeader:r,invalidateCaptcha:u,effectiveAuthToken:s??(t?o:c),applicableRefreshSession:s||t?void 0:h};return S.jsx(l.Provider,{value:P,children:e})},j=()=>{const e=d.useContext(l);if(!e)throw new Error("useChatAuth must be used within a ChatAuthProvider");return e};exports.ChatAuthProvider=I;exports.useChatAuth=j;
@@ -0,0 +1,27 @@
1
+ export interface ChatAuthContextValue {
2
+ authToken: string | null;
3
+ isAuthenticated: boolean;
4
+ isAuthLoading: boolean;
5
+ isAuthConfigured: boolean;
6
+ refreshAuthToken: () => Promise<string | null>;
7
+ sessionToken: string | null;
8
+ refreshSession: () => Promise<string | null>;
9
+ getCaptchaHeader: () => Promise<Record<string, string>>;
10
+ invalidateCaptcha: () => void;
11
+ /**
12
+ * Resolved bearer token, in priority order:
13
+ * apiKey ?? (isAuthenticated ? authToken : sessionToken)
14
+ * This is what should be sent as `Authorization: Bearer <token>` for run API calls.
15
+ */
16
+ effectiveAuthToken: string | null;
17
+ /**
18
+ * The `refreshSession` callback to pass into `useInkeepApiClient` for 401 retries.
19
+ * Undefined when `apiKey` or JWT auth is in use, since neither has an anonymous
20
+ * session to refresh — in those modes a 401 is terminal and shouldn't retry.
21
+ */
22
+ applicableRefreshSession: (() => Promise<string | null>) | undefined;
23
+ }
24
+ export declare const ChatAuthProvider: React.FC<{
25
+ children: React.ReactNode;
26
+ }>;
27
+ export declare const useChatAuth: () => ChatAuthContextValue;
@@ -0,0 +1,46 @@
1
+ "use client";
2
+ import { jsx as T } from "react/jsx-runtime";
3
+ import { useContext as y, createContext as S } from "react";
4
+ import { useInkeepConfig as x } from "./config-provider.js";
5
+ import { useModal as w } from "../components/modal/modal-provider.js";
6
+ import { useOptionalChatBubble as B } from "./chat-bubble-provider.js";
7
+ import { useOptionalSidebarChat as I } from "./sidebar-chat-provider.js";
8
+ import { useAuthToken as P } from "../hooks/use-auth-token.js";
9
+ import { useCaptcha as R } from "../components/embedded-chat/use-captcha.js";
10
+ import { useAnonymousSession as L } from "../hooks/use-anonymous-session.js";
11
+ const p = S(void 0), J = ({ children: t }) => {
12
+ const { baseSettings: n, aiChatSettings: l } = x(), { shouldBypassCaptcha: d, privacyPreferences: f } = n, { baseUrl: i, appId: m, apiKey: o } = l, C = w(), A = B(), b = I(), v = C?.isOpen ?? A?.isOpen ?? b?.isOpen ?? !0, { authToken: s, isLoading: a, refreshToken: k } = P(), g = !!n.getAuthToken, e = !!s, { getCaptchaHeader: r, invalidate: u } = R({
13
+ baseUrl: i,
14
+ shouldBypassCaptcha: d || !!o,
15
+ shouldMakeInitialRequest: v
16
+ }), { sessionToken: h, refreshSession: c } = L({
17
+ baseUrl: i,
18
+ appId: m,
19
+ getCaptchaHeader: r,
20
+ invalidateCaptcha: u,
21
+ optOutAllAnalytics: f?.optOutAllAnalytics,
22
+ enabled: !e && !a
23
+ }), O = {
24
+ authToken: s,
25
+ isAuthenticated: e,
26
+ isAuthLoading: a,
27
+ isAuthConfigured: g,
28
+ refreshAuthToken: k,
29
+ sessionToken: h,
30
+ refreshSession: c,
31
+ getCaptchaHeader: r,
32
+ invalidateCaptcha: u,
33
+ effectiveAuthToken: o ?? (e ? s : h),
34
+ applicableRefreshSession: o || e ? void 0 : c
35
+ };
36
+ return /* @__PURE__ */ T(p.Provider, { value: O, children: t });
37
+ }, N = () => {
38
+ const t = y(p);
39
+ if (!t)
40
+ throw new Error("useChatAuth must be used within a ChatAuthProvider");
41
+ return t;
42
+ };
43
+ export {
44
+ J as ChatAuthProvider,
45
+ N as useChatAuth
46
+ };
@@ -0,0 +1 @@
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("react/jsx-runtime"),g=require("react"),j=require("./config-provider.cjs"),B=require("./chat-auth-provider.cjs"),O=require("../hooks/use-events-api.cjs"),U=require("./base-events-provider.cjs"),x=({children:h})=>{const{baseSettings:n,aiChatSettings:y,componentType:c}=j.useInkeepConfig(),{tags:t,analyticsProperties:r,privacyPreferences:b,userProperties:o}=n,p="0.16.2",a=g.useMemo(()=>({widgetLibraryVersion:p,componentType:c}),[c,p]),{effectiveAuthToken:i,applicableRefreshSession:f,getCaptchaHeader:E,invalidateCaptcha:P}=B.useChatAuth(),{baseUrl:m,appId:A,analyticsApiBaseUrl:C}=y,l=b?.optOutAllAnalytics??!1,{logEvent:v}=O.useEventsApi({baseUrl:C??m,appId:A,authToken:i,getCaptchaHeader:E,invalidateCaptcha:P,refreshSession:f}),I={logEvent:g.useCallback(async s=>{const k={eventName:s.eventName,properties:{...a,...t?{tags:t}:{},...s.properties,...r}};if(!l&&i){const e=s.properties??{},u=typeof e.conversationId=="string"?e.conversationId:void 0,d=typeof e.messageId=="string"?e.messageId:void 0,q=!!o&&Object.keys(o).length>0,S={...t?{tags:t}:{},...r??{}},w={...a,...s.properties};v({body:{type:s.eventName,...u?{conversationId:u}:{},...d?{messageId:d}:{},...q?{userProperties:o}:{},properties:S,metadata:w}})}try{return await n.onEvent?.(k)}catch(e){console.warn("[events] onEvent callback threw",e)}},[n,a,t,r,v,l,i,o])};return T.jsx(U.BaseEventsContext.Provider,{value:I,children:h})};exports.ChatBaseEventsProvider=x;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Re-publishes BaseEventsContext for the chat subtree with an augmented logger
3
+ * that also POSTs to /run/v1/events. Outer BaseEventsProvider (search-side, no
4
+ * API) is unaffected — chat-tree consumers see this provider's logger, everyone
5
+ * else (widget triggers, search) sees the simple onEvent-only logger.
6
+ *
7
+ * Reads auth from ChatAuthProvider (parent), not useChat (child) — this is the
8
+ * direction-flip that breaks the previous cycle.
9
+ */
10
+ export declare const ChatBaseEventsProvider: React.FC<{
11
+ children: React.ReactNode;
12
+ }>;
@@ -0,0 +1,73 @@
1
+ "use client";
2
+ import { jsx as T } from "react/jsx-runtime";
3
+ import { useMemo as U, useCallback as x } from "react";
4
+ import { useInkeepConfig as B } from "./config-provider.js";
5
+ import { useChatAuth as N } from "./chat-auth-provider.js";
6
+ import { useEventsApi as O } from "../hooks/use-events-api.js";
7
+ import { BaseEventsContext as j } from "./base-events-provider.js";
8
+ const D = ({ children: g }) => {
9
+ const { baseSettings: n, aiChatSettings: f, componentType: c } = B(), { tags: t, analyticsProperties: r, privacyPreferences: u, userProperties: o } = n, p = "0.16.2", a = U(
10
+ () => ({
11
+ widgetLibraryVersion: p,
12
+ componentType: c
13
+ }),
14
+ [c, p]
15
+ ), { effectiveAuthToken: i, applicableRefreshSession: h, getCaptchaHeader: y, invalidateCaptcha: b } = N(), { baseUrl: A, appId: E, analyticsApiBaseUrl: C } = f, l = u?.optOutAllAnalytics ?? !1, { logEvent: v } = O({
16
+ baseUrl: C ?? A,
17
+ appId: E,
18
+ authToken: i,
19
+ getCaptchaHeader: y,
20
+ invalidateCaptcha: b,
21
+ refreshSession: h
22
+ }), I = { logEvent: x(
23
+ async (s) => {
24
+ const P = {
25
+ eventName: s.eventName,
26
+ properties: {
27
+ ...a,
28
+ ...t ? { tags: t } : {},
29
+ ...s.properties,
30
+ ...r
31
+ }
32
+ };
33
+ if (!l && i) {
34
+ const e = s.properties ?? {}, m = typeof e.conversationId == "string" ? e.conversationId : void 0, d = typeof e.messageId == "string" ? e.messageId : void 0, k = !!o && Object.keys(o).length > 0, w = {
35
+ ...t ? { tags: t } : {},
36
+ ...r ?? {}
37
+ }, S = {
38
+ ...a,
39
+ ...s.properties
40
+ };
41
+ v({
42
+ body: {
43
+ type: s.eventName,
44
+ ...m ? { conversationId: m } : {},
45
+ ...d ? { messageId: d } : {},
46
+ ...k ? { userProperties: o } : {},
47
+ properties: w,
48
+ metadata: S
49
+ }
50
+ });
51
+ }
52
+ try {
53
+ return await n.onEvent?.(P);
54
+ } catch (e) {
55
+ console.warn("[events] onEvent callback threw", e);
56
+ }
57
+ },
58
+ [
59
+ n,
60
+ a,
61
+ t,
62
+ r,
63
+ v,
64
+ l,
65
+ i,
66
+ o
67
+ ]
68
+ ) };
69
+ return /* @__PURE__ */ T(j.Provider, { value: I, children: g });
70
+ };
71
+ export {
72
+ D as ChatBaseEventsProvider
73
+ };
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { jsx as n } from "react/jsx-runtime";
3
- import { createContext as u, useContext as o } from "react";
3
+ import { useContext as o, createContext as u } from "react";
4
4
  import { useInkeepOpenState as b } from "../hooks/use-inkeep-open-state.js";
5
5
  const t = u(void 0), i = ({ children: e, value: r }) => /* @__PURE__ */ n(t.Provider, { value: r, children: e }), h = () => {
6
6
  const e = o(t);
@@ -17,7 +17,7 @@ export declare function useChatFormState(): {
17
17
  }> | undefined;
18
18
  getFields: (conversationId?: string) => FormField[];
19
19
  errors: FieldErrors<Record<string, any>>;
20
- control: Control<Record<string, any>, any>;
20
+ control: Control<Record<string, any>, any, Record<string, any>>;
21
21
  defaultValues: Record<string, any>;
22
22
  };
23
23
  export declare const ChatFormProvider: React.FC<{
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  import { jsx as N } from "react/jsx-runtime";
3
- import { useState as d, useCallback as a, useMemo as v, useEffect as P, createContext as T, useContext as k } from "react";
3
+ import { useContext as P, useState as d, useCallback as a, useMemo as v, useEffect as T, createContext as k } from "react";
4
4
  import { useForm as G } from "react-hook-form";
5
5
  import { useModal as W } from "../components/modal/modal-provider.js";
6
6
  import { getFormDefaultValues as j } from "../utils/form.js";
7
7
  import { useBaseEvents as A } from "./base-events-provider.js";
8
- const B = "root.serverError", y = T(void 0);
8
+ const B = "root.serverError", y = k(void 0);
9
9
  function D() {
10
10
  const [e, c] = d(null), [u, f] = d(null), [w, p] = d(!1), h = W(), { logEvent: b } = A(), x = a(
11
11
  (o, t) => {
@@ -37,7 +37,7 @@ function D() {
37
37
  } = G({
38
38
  defaultValues: n
39
39
  });
40
- P(() => {
40
+ T(() => {
41
41
  n && E(n);
42
42
  }, [E, n]);
43
43
  const F = a(
@@ -97,7 +97,7 @@ const U = ({ children: e }) => {
97
97
  const c = D();
98
98
  return /* @__PURE__ */ N(y.Provider, { value: c, children: e });
99
99
  }, X = () => {
100
- const e = k(y);
100
+ const e = P(y);
101
101
  if (!e)
102
102
  throw new Error("useChatForm must be used within a ChatFormProvider");
103
103
  return e;