@liveblocks/react-ui 2.25.0-aiprivatebeta1 → 2.25.0-aiprivatebeta11

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 (273) hide show
  1. package/dist/_private/index.cjs +18 -10
  2. package/dist/_private/index.cjs.map +1 -1
  3. package/dist/_private/index.d.cts +204 -172
  4. package/dist/_private/index.d.ts +204 -172
  5. package/dist/_private/index.js +12 -5
  6. package/dist/_private/index.js.map +1 -1
  7. package/dist/components/AiChat.cjs +179 -0
  8. package/dist/components/AiChat.cjs.map +1 -0
  9. package/dist/components/AiChat.js +177 -0
  10. package/dist/components/AiChat.js.map +1 -0
  11. package/dist/components/AiTool.cjs +164 -0
  12. package/dist/components/AiTool.cjs.map +1 -0
  13. package/dist/components/AiTool.js +162 -0
  14. package/dist/components/AiTool.js.map +1 -0
  15. package/dist/components/Comment.cjs +7 -5
  16. package/dist/components/Comment.cjs.map +1 -1
  17. package/dist/components/Comment.js +7 -5
  18. package/dist/components/Comment.js.map +1 -1
  19. package/dist/components/Composer.cjs +1 -2
  20. package/dist/components/Composer.cjs.map +1 -1
  21. package/dist/components/Composer.js +1 -2
  22. package/dist/components/Composer.js.map +1 -1
  23. package/dist/components/InboxNotificationList.cjs +11 -3
  24. package/dist/components/InboxNotificationList.cjs.map +1 -1
  25. package/dist/components/InboxNotificationList.js +12 -4
  26. package/dist/components/InboxNotificationList.js.map +1 -1
  27. package/dist/components/Thread.cjs +3 -3
  28. package/dist/components/Thread.cjs.map +1 -1
  29. package/dist/components/Thread.js +3 -3
  30. package/dist/components/Thread.js.map +1 -1
  31. package/dist/components/internal/AiChatAssistantMessage.cjs +74 -291
  32. package/dist/components/internal/AiChatAssistantMessage.cjs.map +1 -1
  33. package/dist/components/internal/AiChatAssistantMessage.js +76 -293
  34. package/dist/components/internal/AiChatAssistantMessage.js.map +1 -1
  35. package/dist/components/internal/AiChatComposer.cjs +58 -282
  36. package/dist/components/internal/AiChatComposer.cjs.map +1 -1
  37. package/dist/components/internal/AiChatComposer.js +63 -283
  38. package/dist/components/internal/AiChatComposer.js.map +1 -1
  39. package/dist/components/internal/AiChatUserMessage.cjs +26 -169
  40. package/dist/components/internal/AiChatUserMessage.cjs.map +1 -1
  41. package/dist/components/internal/AiChatUserMessage.js +28 -171
  42. package/dist/components/internal/AiChatUserMessage.js.map +1 -1
  43. package/dist/components/internal/Button.cjs.map +1 -1
  44. package/dist/components/internal/Button.js.map +1 -1
  45. package/dist/components/internal/CodeBlock.cjs +72 -0
  46. package/dist/components/internal/CodeBlock.cjs.map +1 -0
  47. package/dist/components/internal/CodeBlock.js +70 -0
  48. package/dist/components/internal/CodeBlock.js.map +1 -0
  49. package/dist/components/internal/Emoji.cjs +12 -4
  50. package/dist/components/internal/Emoji.cjs.map +1 -1
  51. package/dist/components/internal/Emoji.js +12 -4
  52. package/dist/components/internal/Emoji.js.map +1 -1
  53. package/dist/components/internal/Prose.cjs +37 -0
  54. package/dist/components/internal/Prose.cjs.map +1 -0
  55. package/dist/components/internal/Prose.js +35 -0
  56. package/dist/components/internal/Prose.js.map +1 -0
  57. package/dist/constants.cjs +2 -0
  58. package/dist/constants.cjs.map +1 -1
  59. package/dist/constants.js +2 -1
  60. package/dist/constants.js.map +1 -1
  61. package/dist/icon.cjs +6 -0
  62. package/dist/icon.cjs.map +1 -1
  63. package/dist/icon.js +3 -0
  64. package/dist/icon.js.map +1 -1
  65. package/dist/icons/{Resolve.cjs → CheckCircle.cjs} +3 -3
  66. package/dist/icons/CheckCircle.cjs.map +1 -0
  67. package/dist/icons/{Resolve.js → CheckCircle.js} +3 -3
  68. package/dist/icons/CheckCircle.js.map +1 -0
  69. package/dist/icons/{Resolved.cjs → CheckCircleFill.cjs} +3 -3
  70. package/dist/icons/CheckCircleFill.cjs.map +1 -0
  71. package/dist/icons/{Resolved.js → CheckCircleFill.js} +3 -3
  72. package/dist/icons/CheckCircleFill.js.map +1 -0
  73. package/dist/icons/Copy.cjs +8 -9
  74. package/dist/icons/Copy.cjs.map +1 -1
  75. package/dist/icons/Copy.js +8 -9
  76. package/dist/icons/Copy.js.map +1 -1
  77. package/dist/icons/Retry.cjs +21 -0
  78. package/dist/icons/Retry.cjs.map +1 -0
  79. package/dist/icons/Retry.js +19 -0
  80. package/dist/icons/Retry.js.map +1 -0
  81. package/dist/icons/index.cjs +8 -4
  82. package/dist/icons/index.cjs.map +1 -1
  83. package/dist/icons/index.js +4 -2
  84. package/dist/icons/index.js.map +1 -1
  85. package/dist/index.cjs +3 -1
  86. package/dist/index.cjs.map +1 -1
  87. package/dist/index.d.cts +102 -43
  88. package/dist/index.d.ts +102 -43
  89. package/dist/index.js +2 -1
  90. package/dist/index.js.map +1 -1
  91. package/dist/overrides.cjs +6 -12
  92. package/dist/overrides.cjs.map +1 -1
  93. package/dist/overrides.js +6 -12
  94. package/dist/overrides.js.map +1 -1
  95. package/dist/primitives/AiChatComposer/index.cjs +202 -0
  96. package/dist/primitives/AiChatComposer/index.cjs.map +1 -0
  97. package/dist/primitives/AiChatComposer/index.js +195 -0
  98. package/dist/primitives/AiChatComposer/index.js.map +1 -0
  99. package/dist/primitives/AiMessage/contexts.cjs +18 -0
  100. package/dist/primitives/AiMessage/contexts.cjs.map +1 -0
  101. package/dist/primitives/AiMessage/contexts.js +15 -0
  102. package/dist/primitives/AiMessage/contexts.js.map +1 -0
  103. package/dist/primitives/AiMessage/index.cjs +134 -0
  104. package/dist/primitives/AiMessage/index.cjs.map +1 -0
  105. package/dist/primitives/AiMessage/index.js +132 -0
  106. package/dist/primitives/AiMessage/index.js.map +1 -0
  107. package/dist/primitives/Collapsible/index.cjs +127 -0
  108. package/dist/primitives/Collapsible/index.cjs.map +1 -0
  109. package/dist/primitives/Collapsible/index.js +123 -0
  110. package/dist/primitives/Collapsible/index.js.map +1 -0
  111. package/dist/primitives/Comment/index.cjs +2 -2
  112. package/dist/primitives/Comment/index.cjs.map +1 -1
  113. package/dist/primitives/Comment/index.js +1 -1
  114. package/dist/primitives/Comment/index.js.map +1 -1
  115. package/dist/primitives/Composer/index.cjs +19 -14
  116. package/dist/primitives/Composer/index.cjs.map +1 -1
  117. package/dist/primitives/Composer/index.js +18 -13
  118. package/dist/primitives/Composer/index.js.map +1 -1
  119. package/dist/{slate → primitives/Composer/slate}/plugins/auto-formatting.cjs +3 -3
  120. package/dist/primitives/Composer/slate/plugins/auto-formatting.cjs.map +1 -0
  121. package/dist/{slate → primitives/Composer/slate}/plugins/auto-formatting.js +3 -3
  122. package/dist/primitives/Composer/slate/plugins/auto-formatting.js.map +1 -0
  123. package/dist/{slate → primitives/Composer/slate}/plugins/auto-links.cjs +7 -2
  124. package/dist/primitives/Composer/slate/plugins/auto-links.cjs.map +1 -0
  125. package/dist/{slate → primitives/Composer/slate}/plugins/auto-links.js +8 -3
  126. package/dist/primitives/Composer/slate/plugins/auto-links.js.map +1 -0
  127. package/dist/{slate → primitives/Composer/slate}/plugins/custom-links.cjs +8 -3
  128. package/dist/primitives/Composer/slate/plugins/custom-links.cjs.map +1 -0
  129. package/dist/{slate → primitives/Composer/slate}/plugins/custom-links.js +9 -4
  130. package/dist/primitives/Composer/slate/plugins/custom-links.js.map +1 -0
  131. package/dist/{slate → primitives/Composer/slate}/plugins/mentions.cjs +9 -10
  132. package/dist/primitives/Composer/slate/plugins/mentions.cjs.map +1 -0
  133. package/dist/{slate → primitives/Composer/slate}/plugins/mentions.js +6 -6
  134. package/dist/primitives/Composer/slate/plugins/mentions.js.map +1 -0
  135. package/dist/{slate → primitives/Composer/slate}/plugins/paste.cjs +1 -1
  136. package/dist/primitives/Composer/slate/plugins/paste.cjs.map +1 -0
  137. package/dist/{slate → primitives/Composer/slate}/plugins/paste.js +1 -1
  138. package/dist/primitives/Composer/slate/plugins/paste.js.map +1 -0
  139. package/dist/primitives/Composer/utils.cjs +4 -4
  140. package/dist/primitives/Composer/utils.cjs.map +1 -1
  141. package/dist/primitives/Composer/utils.js +4 -4
  142. package/dist/primitives/Composer/utils.js.map +1 -1
  143. package/dist/primitives/{internal/Markdown.cjs → Markdown.cjs} +150 -83
  144. package/dist/primitives/Markdown.cjs.map +1 -0
  145. package/dist/primitives/{internal/Markdown.js → Markdown.js} +151 -83
  146. package/dist/primitives/Markdown.js.map +1 -0
  147. package/dist/primitives/index.cjs +4 -9
  148. package/dist/primitives/index.cjs.map +1 -1
  149. package/dist/primitives/index.d.cts +4 -110
  150. package/dist/primitives/index.d.ts +4 -110
  151. package/dist/primitives/index.js +0 -1
  152. package/dist/primitives/index.js.map +1 -1
  153. package/dist/primitives/slate/plugins/empty-clear-formatting.cjs.map +1 -0
  154. package/dist/primitives/slate/plugins/empty-clear-formatting.js.map +1 -0
  155. package/dist/{slate → primitives/slate}/plugins/normalize.cjs +0 -5
  156. package/dist/primitives/slate/plugins/normalize.cjs.map +1 -0
  157. package/dist/{slate → primitives/slate}/plugins/normalize.js +0 -5
  158. package/dist/primitives/slate/plugins/normalize.js.map +1 -0
  159. package/dist/primitives/slate/utils/get-character.cjs.map +1 -0
  160. package/dist/primitives/slate/utils/get-character.js.map +1 -0
  161. package/dist/primitives/slate/utils/get-dom-range.cjs.map +1 -0
  162. package/dist/primitives/slate/utils/get-dom-range.js.map +1 -0
  163. package/dist/primitives/slate/utils/get-match-range.cjs.map +1 -0
  164. package/dist/primitives/slate/utils/get-match-range.js.map +1 -0
  165. package/dist/primitives/slate/utils/is-empty-string.cjs.map +1 -0
  166. package/dist/primitives/slate/utils/is-empty-string.js.map +1 -0
  167. package/dist/primitives/slate/utils/is-empty.cjs.map +1 -0
  168. package/dist/primitives/slate/utils/is-empty.js.map +1 -0
  169. package/dist/primitives/slate/utils/is-text.cjs.map +1 -0
  170. package/dist/primitives/slate/utils/is-text.js.map +1 -0
  171. package/dist/primitives/slate/utils/is-whitespace-character.cjs.map +1 -0
  172. package/dist/primitives/slate/utils/is-whitespace-character.js.map +1 -0
  173. package/dist/{slate → primitives/slate}/utils/marks.cjs +9 -9
  174. package/dist/primitives/slate/utils/marks.cjs.map +1 -0
  175. package/dist/{slate → primitives/slate}/utils/marks.js +9 -9
  176. package/dist/primitives/slate/utils/marks.js.map +1 -0
  177. package/dist/primitives/slate/utils/selection-contains-inlines.cjs.map +1 -0
  178. package/dist/primitives/slate/utils/selection-contains-inlines.js.map +1 -0
  179. package/dist/utils/ErrorBoundary.cjs +48 -0
  180. package/dist/utils/ErrorBoundary.cjs.map +1 -0
  181. package/dist/utils/ErrorBoundary.js +45 -0
  182. package/dist/utils/ErrorBoundary.js.map +1 -0
  183. package/dist/utils/use-visible.cjs +65 -45
  184. package/dist/utils/use-visible.cjs.map +1 -1
  185. package/dist/utils/use-visible.js +66 -46
  186. package/dist/utils/use-visible.js.map +1 -1
  187. package/dist/version.cjs +1 -1
  188. package/dist/version.cjs.map +1 -1
  189. package/dist/version.js +1 -1
  190. package/dist/version.js.map +1 -1
  191. package/package.json +18 -6
  192. package/src/styles/constants.css +1 -1
  193. package/src/styles/dark/index.css +7 -3
  194. package/src/styles/index.css +640 -307
  195. package/src/styles/utils.css +8 -3
  196. package/styles/dark/attributes.css +1 -1
  197. package/styles/dark/attributes.css.map +1 -1
  198. package/styles/dark/media-query.css +1 -1
  199. package/styles/dark/media-query.css.map +1 -1
  200. package/styles.css +1 -1
  201. package/styles.css.map +1 -1
  202. package/dist/components/AiChat/AiChat.cjs +0 -211
  203. package/dist/components/AiChat/AiChat.cjs.map +0 -1
  204. package/dist/components/AiChat/AiChat.js +0 -209
  205. package/dist/components/AiChat/AiChat.js.map +0 -1
  206. package/dist/icons/Resolve.cjs.map +0 -1
  207. package/dist/icons/Resolve.js.map +0 -1
  208. package/dist/icons/Resolved.cjs.map +0 -1
  209. package/dist/icons/Resolved.js.map +0 -1
  210. package/dist/primitives/Chat/Composer/index.cjs +0 -323
  211. package/dist/primitives/Chat/Composer/index.cjs.map +0 -1
  212. package/dist/primitives/Chat/Composer/index.js +0 -315
  213. package/dist/primitives/Chat/Composer/index.js.map +0 -1
  214. package/dist/primitives/internal/Collapsible.cjs +0 -99
  215. package/dist/primitives/internal/Collapsible.cjs.map +0 -1
  216. package/dist/primitives/internal/Collapsible.js +0 -95
  217. package/dist/primitives/internal/Collapsible.js.map +0 -1
  218. package/dist/primitives/internal/Emoji.cjs +0 -32
  219. package/dist/primitives/internal/Emoji.cjs.map +0 -1
  220. package/dist/primitives/internal/Emoji.js +0 -30
  221. package/dist/primitives/internal/Emoji.js.map +0 -1
  222. package/dist/primitives/internal/Markdown.cjs.map +0 -1
  223. package/dist/primitives/internal/Markdown.js.map +0 -1
  224. package/dist/slate/plugins/auto-formatting.cjs.map +0 -1
  225. package/dist/slate/plugins/auto-formatting.js.map +0 -1
  226. package/dist/slate/plugins/auto-links.cjs.map +0 -1
  227. package/dist/slate/plugins/auto-links.js.map +0 -1
  228. package/dist/slate/plugins/custom-links.cjs.map +0 -1
  229. package/dist/slate/plugins/custom-links.js.map +0 -1
  230. package/dist/slate/plugins/empty-clear-formatting.cjs.map +0 -1
  231. package/dist/slate/plugins/empty-clear-formatting.js.map +0 -1
  232. package/dist/slate/plugins/mentions.cjs.map +0 -1
  233. package/dist/slate/plugins/mentions.js.map +0 -1
  234. package/dist/slate/plugins/normalize.cjs.map +0 -1
  235. package/dist/slate/plugins/normalize.js.map +0 -1
  236. package/dist/slate/plugins/paste.cjs.map +0 -1
  237. package/dist/slate/plugins/paste.js.map +0 -1
  238. package/dist/slate/utils/get-character.cjs.map +0 -1
  239. package/dist/slate/utils/get-character.js.map +0 -1
  240. package/dist/slate/utils/get-dom-range.cjs.map +0 -1
  241. package/dist/slate/utils/get-dom-range.js.map +0 -1
  242. package/dist/slate/utils/get-match-range.cjs.map +0 -1
  243. package/dist/slate/utils/get-match-range.js.map +0 -1
  244. package/dist/slate/utils/is-empty-string.cjs.map +0 -1
  245. package/dist/slate/utils/is-empty-string.js.map +0 -1
  246. package/dist/slate/utils/is-empty.cjs.map +0 -1
  247. package/dist/slate/utils/is-empty.js.map +0 -1
  248. package/dist/slate/utils/is-text.cjs.map +0 -1
  249. package/dist/slate/utils/is-text.js.map +0 -1
  250. package/dist/slate/utils/is-whitespace-character.cjs.map +0 -1
  251. package/dist/slate/utils/is-whitespace-character.js.map +0 -1
  252. package/dist/slate/utils/marks.cjs.map +0 -1
  253. package/dist/slate/utils/marks.js.map +0 -1
  254. package/dist/slate/utils/selection-contains-inlines.cjs.map +0 -1
  255. package/dist/slate/utils/selection-contains-inlines.js.map +0 -1
  256. /package/dist/{slate → primitives/slate}/plugins/empty-clear-formatting.cjs +0 -0
  257. /package/dist/{slate → primitives/slate}/plugins/empty-clear-formatting.js +0 -0
  258. /package/dist/{slate → primitives/slate}/utils/get-character.cjs +0 -0
  259. /package/dist/{slate → primitives/slate}/utils/get-character.js +0 -0
  260. /package/dist/{slate → primitives/slate}/utils/get-dom-range.cjs +0 -0
  261. /package/dist/{slate → primitives/slate}/utils/get-dom-range.js +0 -0
  262. /package/dist/{slate → primitives/slate}/utils/get-match-range.cjs +0 -0
  263. /package/dist/{slate → primitives/slate}/utils/get-match-range.js +0 -0
  264. /package/dist/{slate → primitives/slate}/utils/is-empty-string.cjs +0 -0
  265. /package/dist/{slate → primitives/slate}/utils/is-empty-string.js +0 -0
  266. /package/dist/{slate → primitives/slate}/utils/is-empty.cjs +0 -0
  267. /package/dist/{slate → primitives/slate}/utils/is-empty.js +0 -0
  268. /package/dist/{slate → primitives/slate}/utils/is-text.cjs +0 -0
  269. /package/dist/{slate → primitives/slate}/utils/is-text.js +0 -0
  270. /package/dist/{slate → primitives/slate}/utils/is-whitespace-character.cjs +0 -0
  271. /package/dist/{slate → primitives/slate}/utils/is-whitespace-character.js +0 -0
  272. /package/dist/{slate → primitives/slate}/utils/selection-contains-inlines.cjs +0 -0
  273. /package/dist/{slate → primitives/slate}/utils/selection-contains-inlines.js +0 -0
@@ -10,12 +10,15 @@ var BellCrossed = require('./BellCrossed.cjs');
10
10
  var Blockquote = require('./Blockquote.cjs');
11
11
  var Bold = require('./Bold.cjs');
12
12
  var Check = require('./Check.cjs');
13
+ var CheckCircle = require('./CheckCircle.cjs');
14
+ var CheckCircleFill = require('./CheckCircleFill.cjs');
13
15
  var ChevronDown = require('./ChevronDown.cjs');
14
16
  var ChevronLeft = require('./ChevronLeft.cjs');
15
17
  var ChevronRight = require('./ChevronRight.cjs');
16
18
  var ChevronUp = require('./ChevronUp.cjs');
17
19
  var Code = require('./Code.cjs');
18
20
  var Comment = require('./Comment.cjs');
21
+ var Copy = require('./Copy.cjs');
19
22
  var Cross = require('./Cross.cjs');
20
23
  var Delete = require('./Delete.cjs');
21
24
  var Edit = require('./Edit.cjs');
@@ -32,9 +35,8 @@ var ListUnordered = require('./ListUnordered.cjs');
32
35
  var Mention = require('./Mention.cjs');
33
36
  var QuestionMark = require('./QuestionMark.cjs');
34
37
  var Redo = require('./Redo.cjs');
35
- var Resolve = require('./Resolve.cjs');
36
- var Resolved = require('./Resolved.cjs');
37
38
  var Restore = require('./Restore.cjs');
39
+ var Retry = require('./Retry.cjs');
38
40
  var Search = require('./Search.cjs');
39
41
  var Send = require('./Send.cjs');
40
42
  var Shorten = require('./Shorten.cjs');
@@ -61,12 +63,15 @@ exports.BellCrossedIcon = BellCrossed.BellCrossedIcon;
61
63
  exports.BlockquoteIcon = Blockquote.BlockquoteIcon;
62
64
  exports.BoldIcon = Bold.BoldIcon;
63
65
  exports.CheckIcon = Check.CheckIcon;
66
+ exports.CheckCircleIcon = CheckCircle.CheckCircleIcon;
67
+ exports.CheckCircleFillIcon = CheckCircleFill.CheckCircleFillIcon;
64
68
  exports.ChevronDownIcon = ChevronDown.ChevronDownIcon;
65
69
  exports.ChevronLeftIcon = ChevronLeft.ChevronLeftIcon;
66
70
  exports.ChevronRightIcon = ChevronRight.ChevronRightIcon;
67
71
  exports.ChevronUpIcon = ChevronUp.ChevronUpIcon;
68
72
  exports.CodeIcon = Code.CodeIcon;
69
73
  exports.CommentIcon = Comment.CommentIcon;
74
+ exports.CopyIcon = Copy.CopyIcon;
70
75
  exports.CrossIcon = Cross.CrossIcon;
71
76
  exports.DeleteIcon = Delete.DeleteIcon;
72
77
  exports.EditIcon = Edit.EditIcon;
@@ -83,9 +88,8 @@ exports.ListUnorderedIcon = ListUnordered.ListUnorderedIcon;
83
88
  exports.MentionIcon = Mention.MentionIcon;
84
89
  exports.QuestionMarkIcon = QuestionMark.QuestionMarkIcon;
85
90
  exports.RedoIcon = Redo.RedoIcon;
86
- exports.ResolveIcon = Resolve.ResolveIcon;
87
- exports.ResolvedIcon = Resolved.ResolvedIcon;
88
91
  exports.RestoreIcon = Restore.RestoreIcon;
92
+ exports.RetryIcon = Retry.RetryIcon;
89
93
  exports.SearchIcon = Search.SearchIcon;
90
94
  exports.SendIcon = Send.SendIcon;
91
95
  exports.ShortenIcon = Shorten.ShortenIcon;
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -8,12 +8,15 @@ export { BellCrossedIcon } from './BellCrossed.js';
8
8
  export { BlockquoteIcon } from './Blockquote.js';
9
9
  export { BoldIcon } from './Bold.js';
10
10
  export { CheckIcon } from './Check.js';
11
+ export { CheckCircleIcon } from './CheckCircle.js';
12
+ export { CheckCircleFillIcon } from './CheckCircleFill.js';
11
13
  export { ChevronDownIcon } from './ChevronDown.js';
12
14
  export { ChevronLeftIcon } from './ChevronLeft.js';
13
15
  export { ChevronRightIcon } from './ChevronRight.js';
14
16
  export { ChevronUpIcon } from './ChevronUp.js';
15
17
  export { CodeIcon } from './Code.js';
16
18
  export { CommentIcon } from './Comment.js';
19
+ export { CopyIcon } from './Copy.js';
17
20
  export { CrossIcon } from './Cross.js';
18
21
  export { DeleteIcon } from './Delete.js';
19
22
  export { EditIcon } from './Edit.js';
@@ -30,9 +33,8 @@ export { ListUnorderedIcon } from './ListUnordered.js';
30
33
  export { MentionIcon } from './Mention.js';
31
34
  export { QuestionMarkIcon } from './QuestionMark.js';
32
35
  export { RedoIcon } from './Redo.js';
33
- export { ResolveIcon } from './Resolve.js';
34
- export { ResolvedIcon } from './Resolved.js';
35
36
  export { RestoreIcon } from './Restore.js';
37
+ export { RetryIcon } from './Retry.js';
36
38
  export { SearchIcon } from './Search.js';
37
39
  export { SendIcon } from './Send.js';
38
40
  export { ShortenIcon } from './Shorten.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/index.cjs CHANGED
@@ -2,7 +2,8 @@
2
2
 
3
3
  var core = require('@liveblocks/core');
4
4
  var version = require('./version.cjs');
5
- var AiChat = require('./components/AiChat/AiChat.cjs');
5
+ var AiChat = require('./components/AiChat.cjs');
6
+ var AiTool = require('./components/AiTool.cjs');
6
7
  var Comment = require('./components/Comment.cjs');
7
8
  var Composer = require('./components/Composer.cjs');
8
9
  var HistoryVersionSummary = require('./components/HistoryVersionSummary.cjs');
@@ -17,6 +18,7 @@ var overrides = require('./overrides.cjs');
17
18
  core.detectDupes(version.PKG_NAME, version.PKG_VERSION, version.PKG_FORMAT);
18
19
 
19
20
  exports.AiChat = AiChat.AiChat;
21
+ exports.AiTool = AiTool.AiTool;
20
22
  exports.Comment = Comment.Comment;
21
23
  exports.Composer = Composer.Composer;
22
24
  exports.HistoryVersionSummary = HistoryVersionSummary.HistoryVersionSummary;
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../src/index.ts"],"sourcesContent":["import { detectDupes } from \"@liveblocks/core\";\n\nimport { PKG_FORMAT, PKG_NAME, PKG_VERSION } from \"./version\";\n\ndetectDupes(PKG_NAME, PKG_VERSION, PKG_FORMAT);\n\nexport { AiChat, type AiChatProps } from \"./components/AiChat/AiChat\";\nexport type { CommentProps } from \"./components/Comment\";\nexport { Comment } from \"./components/Comment\";\nexport type { ComposerProps } from \"./components/Composer\";\nexport { Composer } from \"./components/Composer\";\nexport type { HistoryVersionSummaryProps } from \"./components/HistoryVersionSummary\";\nexport { HistoryVersionSummary } from \"./components/HistoryVersionSummary\";\nexport type { HistoryVersionSummaryListProps } from \"./components/HistoryVersionSummaryList\";\nexport { HistoryVersionSummaryList } from \"./components/HistoryVersionSummaryList\";\nexport type {\n InboxNotificationAvatarProps,\n InboxNotificationCustomKindProps,\n InboxNotificationCustomProps,\n InboxNotificationIconProps,\n InboxNotificationProps,\n InboxNotificationTextMentionKindProps,\n InboxNotificationTextMentionProps,\n InboxNotificationThreadKindProps,\n InboxNotificationThreadProps,\n} from \"./components/InboxNotification\";\nexport { InboxNotification } from \"./components/InboxNotification\";\nexport type { InboxNotificationListProps } from \"./components/InboxNotificationList\";\nexport { InboxNotificationList } from \"./components/InboxNotificationList\";\nexport type { ThreadProps } from \"./components/Thread\";\nexport { Thread } from \"./components/Thread\";\nexport { LiveblocksUIConfig } from \"./config\";\nexport * as Icon from \"./icon\";\nexport type {\n ChatComposerOverrides,\n CommentOverrides,\n ComposerOverrides,\n GlobalOverrides,\n InboxNotificationOverrides,\n LocalizationOverrides,\n Overrides,\n ThreadOverrides,\n} from \"./overrides\";\nexport { useOverrides } from \"./overrides\";\nexport type { ComposerSubmitComment } from \"./primitives\";\nexport type {\n CommentAttachmentArgs,\n ComposerBodyMark,\n ComposerBodyMarks,\n} from \"./types\";\n"],"names":["detectDupes","PKG_NAME","PKG_VERSION","PKG_FORMAT"],"mappings":";;;;;;;;;;;;;;;;AAIAA,gBAAY,CAAAC,gBAAA,EAAUC,qBAAaC,kBAAU,CAAA;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../src/index.ts"],"sourcesContent":["import { detectDupes } from \"@liveblocks/core\";\n\nimport { PKG_FORMAT, PKG_NAME, PKG_VERSION } from \"./version\";\n\ndetectDupes(PKG_NAME, PKG_VERSION, PKG_FORMAT);\n\nexport type {\n AiChatComponents,\n AiChatComponentsEmptyProps,\n AiChatComponentsLoadingProps,\n AiChatProps,\n} from \"./components/AiChat\";\nexport { AiChat } from \"./components/AiChat\";\nexport type { AiToolIconProps, AiToolProps } from \"./components/AiTool\";\nexport { AiTool } from \"./components/AiTool\";\nexport type { CommentProps } from \"./components/Comment\";\nexport { Comment } from \"./components/Comment\";\nexport type { ComposerProps } from \"./components/Composer\";\nexport { Composer } from \"./components/Composer\";\nexport type { HistoryVersionSummaryProps } from \"./components/HistoryVersionSummary\";\nexport { HistoryVersionSummary } from \"./components/HistoryVersionSummary\";\nexport type { HistoryVersionSummaryListProps } from \"./components/HistoryVersionSummaryList\";\nexport { HistoryVersionSummaryList } from \"./components/HistoryVersionSummaryList\";\nexport type {\n InboxNotificationAvatarProps,\n InboxNotificationCustomKindProps,\n InboxNotificationCustomProps,\n InboxNotificationIconProps,\n InboxNotificationProps,\n InboxNotificationTextMentionKindProps,\n InboxNotificationTextMentionProps,\n InboxNotificationThreadKindProps,\n InboxNotificationThreadProps,\n} from \"./components/InboxNotification\";\nexport { InboxNotification } from \"./components/InboxNotification\";\nexport type { InboxNotificationListProps } from \"./components/InboxNotificationList\";\nexport { InboxNotificationList } from \"./components/InboxNotificationList\";\nexport type { ThreadProps } from \"./components/Thread\";\nexport { Thread } from \"./components/Thread\";\nexport { LiveblocksUIConfig } from \"./config\";\nexport * as Icon from \"./icon\";\nexport type {\n CommentOverrides,\n ComposerOverrides,\n GlobalOverrides,\n InboxNotificationOverrides,\n LocalizationOverrides,\n Overrides,\n ThreadOverrides,\n} from \"./overrides\";\nexport { useOverrides } from \"./overrides\";\nexport type { ComposerSubmitComment } from \"./primitives\";\nexport type {\n CommentAttachmentArgs,\n ComposerBodyMark,\n ComposerBodyMarks,\n} from \"./types\";\n"],"names":["detectDupes","PKG_NAME","PKG_VERSION","PKG_FORMAT"],"mappings":";;;;;;;;;;;;;;;;;AAIAA,gBAAY,CAAAC,gBAAA,EAAUC,qBAAaC,kBAAU,CAAA;;;;;;;;;;;;;;;"}
package/dist/index.d.cts CHANGED
@@ -1,8 +1,13 @@
1
1
  import * as react from 'react';
2
- import { ElementType, ComponentPropsWithoutRef, ReactNode, HTMLAttributes, FormEvent, ComponentType, RefAttributes, MouseEvent, ComponentProps, PropsWithChildren } from 'react';
3
- import { CommentAttachment, CopilotId, AiChatContext, ClientToolDefinition, CommentBody, BaseMetadata, DM, CommentData, HistoryVersion, InboxNotificationData, InboxNotificationThreadData, InboxNotificationTextMentionData, InboxNotificationCustomData, KDAD, ThreadData } from '@liveblocks/core';
2
+ import { ComponentType, ComponentPropsWithoutRef, ElementType, ReactNode, ComponentProps, FormEvent, RefAttributes, MouseEvent, PropsWithChildren } from 'react';
3
+ import { CommentAttachment, AiKnowledgeSource, AiOpaqueToolDefinition, AiToolTypePack, JsonObject, ToolResultData, NoInfr, AiToolExecuteCallback, CommentBody, BaseMetadata, DM, CommentData, HistoryVersion, InboxNotificationData, InboxNotificationThreadData, InboxNotificationTextMentionData, InboxNotificationCustomData, KDAD, ThreadData } from '@liveblocks/core';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
 
6
+ interface GlobalComponents {
7
+ Anchor: ComponentType<ComponentPropsWithoutRef<"a">> | "a";
8
+ }
9
+ type Components = GlobalComponents;
10
+
6
11
  type Direction = "ltr" | "rtl";
7
12
  type SlotProp = {
8
13
  /**
@@ -73,21 +78,17 @@ interface ComposerOverrides {
73
78
  COMPOSER_SEND: string;
74
79
  COMPOSER_TOGGLE_MARK: (mark: ComposerBodyMark) => string;
75
80
  }
76
- interface ChatComposerOverrides {
77
- CHAT_COMPOSER_PLACEHOLDER: string;
78
- CHAT_COMPOSER_SEND: string;
79
- CHAT_COMPOSER_ATTACH_FILES: string;
80
- CHAT_COMPOSER_REMOVE_ATTACHMENT: string;
81
- CHAT_COMPOSER_ABORT: string;
81
+ interface AiChatComposerOverrides {
82
+ AI_CHAT_COMPOSER_PLACEHOLDER: string;
83
+ AI_CHAT_COMPOSER_SEND: string;
84
+ AI_CHAT_COMPOSER_ABORT: string;
82
85
  }
83
- interface ChatMessageOverrides {
84
- CHAT_MESSAGE_DELETED: string;
85
- CHAT_MESSAGE_THINKING: string;
86
- CHAT_MESSAGE_COPY: string;
87
- CHAT_MESSAGE_TRY_AGAIN: string;
86
+ interface AiChatMessageOverrides {
87
+ AI_CHAT_MESSAGE_DELETED: string;
88
+ AI_CHAT_MESSAGE_THINKING: string;
88
89
  }
89
- interface ChatOverrides {
90
- GET_CHAT_MESSAGES_ERROR: (error: Error) => ReactNode;
90
+ interface AiChatOverrides {
91
+ AI_CHAT_MESSAGES_ERROR: (error: Error) => ReactNode;
91
92
  }
92
93
  interface ThreadOverrides {
93
94
  THREAD_RESOLVE: string;
@@ -113,53 +114,107 @@ interface HistoryVersionPreviewOverrides {
113
114
  HISTORY_VERSION_PREVIEW_EMPTY: ReactNode;
114
115
  HISTORY_VERSION_PREVIEW_ERROR: (error: Error) => ReactNode;
115
116
  }
116
- type Overrides = LocalizationOverrides & GlobalOverrides & ComposerOverrides & CommentOverrides & ThreadOverrides & InboxNotificationOverrides & HistoryVersionPreviewOverrides & ChatComposerOverrides & ChatMessageOverrides & ChatOverrides;
117
+ type Overrides = LocalizationOverrides & GlobalOverrides & ComposerOverrides & CommentOverrides & ThreadOverrides & InboxNotificationOverrides & HistoryVersionPreviewOverrides & AiChatComposerOverrides & AiChatMessageOverrides & AiChatOverrides;
117
118
  declare function useOverrides(overrides?: Partial<Overrides>): Overrides;
118
119
 
119
- type AiChatProps = HTMLAttributes<HTMLDivElement> & {
120
+ type AiChatComponentsEmptyProps = {
120
121
  /**
121
- * The id of the chat the composer belongs to.
122
+ * The chat id provided to the `AiChat` component.
122
123
  */
123
124
  chatId: string;
124
125
  /**
125
- * The id of the copilot to use to send the message.
126
- */
127
- copilotId?: CopilotId;
128
- /**
129
- * The contextual information to include in the chat. Used by the assistant when generating responses.
126
+ * The copilot id provided to the `AiChat` component.
130
127
  */
131
- contexts?: AiChatContext[];
128
+ copilotId?: string;
129
+ };
130
+ type AiChatComponentsLoadingProps = Record<string, never>;
131
+ type AiChatComponents = {
132
132
  /**
133
- * The contextual information to include in the chat. Used by the assistant when generating responses.
133
+ * The component used to render the empty state of the chat.
134
134
  */
135
- tools?: Record<string, ClientToolDefinition>;
135
+ Empty: ComponentType<AiChatComponentsEmptyProps>;
136
136
  /**
137
- * Override the component's strings.
137
+ * The component used to render the loading state of the chat.
138
138
  */
139
- overrides?: Partial<GlobalOverrides & ChatMessageOverrides & ChatComposerOverrides & ChatOverrides>;
139
+ Loading: ComponentType<AiChatComponentsLoadingProps>;
140
140
  };
141
- declare const AiChat: react.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
141
+ interface AiChatProps extends ComponentProps<"div"> {
142
142
  /**
143
143
  * The id of the chat the composer belongs to.
144
144
  */
145
145
  chatId: string;
146
+ /**
147
+ * Whether to focus the chat composer on mount.
148
+ */
149
+ autoFocus?: boolean;
146
150
  /**
147
151
  * The id of the copilot to use to send the message.
148
152
  */
149
- copilotId?: CopilotId;
153
+ copilotId?: string;
154
+ /**
155
+ * The contextual knowledge to include in the chat. May be used by the assistant when generating responses.
156
+ * Any knowledge you provide via this prop will be added to any already globally registered knowledge via <RegisterAiKnowledge />.
157
+ */
158
+ knowledge?: AiKnowledgeSource[];
150
159
  /**
151
- * The contextual information to include in the chat. Used by the assistant when generating responses.
160
+ * Tool definitions to make available within this chat. May be used by the assistant when generating responses.
152
161
  */
153
- contexts?: AiChatContext[];
162
+ tools?: Record<string, AiOpaqueToolDefinition>;
154
163
  /**
155
- * The contextual information to include in the chat. Used by the assistant when generating responses.
164
+ * The layout of the chat and its composer.
156
165
  */
157
- tools?: Record<string, ClientToolDefinition>;
166
+ layout?: "inset" | "compact";
158
167
  /**
159
168
  * Override the component's strings.
160
169
  */
161
- overrides?: Partial<GlobalOverrides & ChatMessageOverrides & ChatComposerOverrides & ChatOverrides>;
162
- } & react.RefAttributes<HTMLDivElement>>;
170
+ overrides?: Partial<GlobalOverrides & AiChatMessageOverrides & AiChatComposerOverrides & AiChatOverrides>;
171
+ /**
172
+ * Override the component's components.
173
+ */
174
+ components?: Partial<GlobalComponents & AiChatComponents>;
175
+ }
176
+ declare const AiChat: react.ForwardRefExoticComponent<Omit<AiChatProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
177
+
178
+ interface AiToolProps extends Omit<ComponentProps<"div">, "title" | "children"> {
179
+ /**
180
+ * The tool's title.
181
+ *
182
+ * By default, a human-readable version of the tool's name is used:
183
+ * - `"showTodo"` → "Show todo"
184
+ * - `"get_weather"` → "Get weather"
185
+ */
186
+ title?: string;
187
+ /**
188
+ * An optional icon displayed next to the title.
189
+ */
190
+ icon?: ReactNode;
191
+ /**
192
+ * The content shown in the tool.
193
+ */
194
+ children?: ReactNode;
195
+ }
196
+ type AiToolIconProps = ComponentProps<"div">;
197
+ type AiToolInspectorProps = ComponentProps<"div">;
198
+ /**
199
+ * @private This API will change, and is not considered stable. DO NOT RELY on it.
200
+ *
201
+ * This component can be used to build human-in-the-loop interfaces.
202
+ */
203
+ interface AiToolConfirmationProps<A extends JsonObject, R extends ToolResultData> extends ComponentProps<"div"> {
204
+ types?: NoInfr<AiToolTypePack<A, R>>;
205
+ args?: A;
206
+ confirm: AiToolExecuteCallback<A, R>;
207
+ cancel: AiToolExecuteCallback<A, R>;
208
+ variant?: "default" | "destructive";
209
+ }
210
+ declare function AiToolIcon({ className, ...props }: AiToolIconProps): react_jsx_runtime.JSX.Element;
211
+ declare function AiToolInspector({ className, ...props }: AiToolInspectorProps): react_jsx_runtime.JSX.Element;
212
+ declare function AiToolConfirmation<TPack extends AiToolTypePack, A extends JsonObject = TPack["A"], R extends ToolResultData = TPack["R"]>({ children, variant, confirm, cancel, className, ...props }: AiToolConfirmationProps<A, R>): react_jsx_runtime.JSX.Element | null;
213
+ declare const AiTool: react.ForwardRefExoticComponent<Omit<AiToolProps, "ref"> & react.RefAttributes<HTMLDivElement>> & {
214
+ Icon: typeof AiToolIcon;
215
+ Inspector: typeof AiToolInspector;
216
+ Confirmation: typeof AiToolConfirmation;
217
+ };
163
218
 
164
219
  interface ComposerEditorMentionProps {
165
220
  /**
@@ -214,7 +269,7 @@ interface ComposerEditorComponents {
214
269
  */
215
270
  FloatingToolbar?: ComponentType<ComposerEditorFloatingToolbarProps>;
216
271
  }
217
- interface ComposerEditorProps extends Omit<ComponentPropsWithoutRef<"div">, "defaultValue"> {
272
+ interface ComposerEditorProps extends Omit<ComponentPropsWithoutRef<"div">, "defaultValue" | "children"> {
218
273
  /**
219
274
  * The reading direction of the editor and related elements.
220
275
  */
@@ -454,11 +509,6 @@ type HistoryVersionSummaryListProps = ComponentPropsWithoutRef<"ol">;
454
509
  */
455
510
  declare const HistoryVersionSummaryList: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.OlHTMLAttributes<HTMLOListElement>, HTMLOListElement>, "ref"> & react.RefAttributes<HTMLOListElement>>;
456
511
 
457
- interface GlobalComponents {
458
- Anchor: ComponentType<ComponentPropsWithoutRef<"a">> | "a";
459
- }
460
- type Components = GlobalComponents;
461
-
462
512
  interface AvatarProps extends ComponentProps<"div"> {
463
513
  /**
464
514
  * The user ID to display the avatar for.
@@ -762,6 +812,8 @@ declare function BoldIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.E
762
812
 
763
813
  declare function CheckIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
764
814
 
815
+ declare function CheckCircleIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
816
+
765
817
  declare function ChevronDownIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
766
818
 
767
819
  declare function ChevronLeftIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
@@ -774,6 +826,8 @@ declare function CodeIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.E
774
826
 
775
827
  declare function CommentIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
776
828
 
829
+ declare function CopyIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
830
+
777
831
  declare function CrossIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
778
832
 
779
833
  declare function EllipsisIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
@@ -802,6 +856,8 @@ declare function QuestionMarkIcon(props: ComponentProps<"svg">): react_jsx_runti
802
856
 
803
857
  declare function RedoIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
804
858
 
859
+ declare function RetryIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
860
+
805
861
  declare function SearchIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
806
862
 
807
863
  declare function SendIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
@@ -838,12 +894,14 @@ declare namespace icon {
838
894
  BlockquoteIcon as Blockquote,
839
895
  BoldIcon as Bold,
840
896
  CheckIcon as Check,
897
+ CheckCircleIcon as CheckCircle,
841
898
  ChevronDownIcon as ChevronDown,
842
899
  ChevronLeftIcon as ChevronLeft,
843
900
  ChevronRightIcon as ChevronRight,
844
901
  ChevronUpIcon as ChevronUp,
845
902
  CodeIcon as Code,
846
903
  CommentIcon as Comment,
904
+ CopyIcon as Copy,
847
905
  CrossIcon as Cross,
848
906
  EllipsisIcon as Ellipsis,
849
907
  EmojiIcon as Emoji,
@@ -858,6 +916,7 @@ declare namespace icon {
858
916
  MentionIcon as Mention,
859
917
  QuestionMarkIcon as QuestionMark,
860
918
  RedoIcon as Redo,
919
+ RetryIcon as Retry,
861
920
  SearchIcon as Search,
862
921
  SendIcon as Send,
863
922
  ShortenIcon as Shorten,
@@ -873,4 +932,4 @@ declare namespace icon {
873
932
  };
874
933
  }
875
934
 
876
- export { AiChat, AiChatProps, ChatComposerOverrides, Comment, CommentAttachmentArgs, CommentOverrides, CommentProps, Composer, ComposerBodyMark, ComposerBodyMarks, ComposerOverrides, ComposerProps, ComposerSubmitComment, GlobalOverrides, HistoryVersionSummary, HistoryVersionSummaryList, HistoryVersionSummaryListProps, HistoryVersionSummaryProps, icon as Icon, InboxNotification, InboxNotificationAvatarProps, InboxNotificationCustomKindProps, InboxNotificationCustomProps, InboxNotificationIconProps, InboxNotificationList, InboxNotificationListProps, InboxNotificationOverrides, InboxNotificationProps, InboxNotificationTextMentionKindProps, InboxNotificationTextMentionProps, InboxNotificationThreadKindProps, InboxNotificationThreadProps, LiveblocksUIConfig, LocalizationOverrides, Overrides, Thread, ThreadOverrides, ThreadProps, useOverrides };
935
+ export { AiChat, AiChatComponents, AiChatComponentsEmptyProps, AiChatComponentsLoadingProps, AiChatProps, AiTool, AiToolIconProps, AiToolProps, Comment, CommentAttachmentArgs, CommentOverrides, CommentProps, Composer, ComposerBodyMark, ComposerBodyMarks, ComposerOverrides, ComposerProps, ComposerSubmitComment, GlobalOverrides, HistoryVersionSummary, HistoryVersionSummaryList, HistoryVersionSummaryListProps, HistoryVersionSummaryProps, icon as Icon, InboxNotification, InboxNotificationAvatarProps, InboxNotificationCustomKindProps, InboxNotificationCustomProps, InboxNotificationIconProps, InboxNotificationList, InboxNotificationListProps, InboxNotificationOverrides, InboxNotificationProps, InboxNotificationTextMentionKindProps, InboxNotificationTextMentionProps, InboxNotificationThreadKindProps, InboxNotificationThreadProps, LiveblocksUIConfig, LocalizationOverrides, Overrides, Thread, ThreadOverrides, ThreadProps, useOverrides };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,13 @@
1
1
  import * as react from 'react';
2
- import { ElementType, ComponentPropsWithoutRef, ReactNode, HTMLAttributes, FormEvent, ComponentType, RefAttributes, MouseEvent, ComponentProps, PropsWithChildren } from 'react';
3
- import { CommentAttachment, CopilotId, AiChatContext, ClientToolDefinition, CommentBody, BaseMetadata, DM, CommentData, HistoryVersion, InboxNotificationData, InboxNotificationThreadData, InboxNotificationTextMentionData, InboxNotificationCustomData, KDAD, ThreadData } from '@liveblocks/core';
2
+ import { ComponentType, ComponentPropsWithoutRef, ElementType, ReactNode, ComponentProps, FormEvent, RefAttributes, MouseEvent, PropsWithChildren } from 'react';
3
+ import { CommentAttachment, AiKnowledgeSource, AiOpaqueToolDefinition, AiToolTypePack, JsonObject, ToolResultData, NoInfr, AiToolExecuteCallback, CommentBody, BaseMetadata, DM, CommentData, HistoryVersion, InboxNotificationData, InboxNotificationThreadData, InboxNotificationTextMentionData, InboxNotificationCustomData, KDAD, ThreadData } from '@liveblocks/core';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
 
6
+ interface GlobalComponents {
7
+ Anchor: ComponentType<ComponentPropsWithoutRef<"a">> | "a";
8
+ }
9
+ type Components = GlobalComponents;
10
+
6
11
  type Direction = "ltr" | "rtl";
7
12
  type SlotProp = {
8
13
  /**
@@ -73,21 +78,17 @@ interface ComposerOverrides {
73
78
  COMPOSER_SEND: string;
74
79
  COMPOSER_TOGGLE_MARK: (mark: ComposerBodyMark) => string;
75
80
  }
76
- interface ChatComposerOverrides {
77
- CHAT_COMPOSER_PLACEHOLDER: string;
78
- CHAT_COMPOSER_SEND: string;
79
- CHAT_COMPOSER_ATTACH_FILES: string;
80
- CHAT_COMPOSER_REMOVE_ATTACHMENT: string;
81
- CHAT_COMPOSER_ABORT: string;
81
+ interface AiChatComposerOverrides {
82
+ AI_CHAT_COMPOSER_PLACEHOLDER: string;
83
+ AI_CHAT_COMPOSER_SEND: string;
84
+ AI_CHAT_COMPOSER_ABORT: string;
82
85
  }
83
- interface ChatMessageOverrides {
84
- CHAT_MESSAGE_DELETED: string;
85
- CHAT_MESSAGE_THINKING: string;
86
- CHAT_MESSAGE_COPY: string;
87
- CHAT_MESSAGE_TRY_AGAIN: string;
86
+ interface AiChatMessageOverrides {
87
+ AI_CHAT_MESSAGE_DELETED: string;
88
+ AI_CHAT_MESSAGE_THINKING: string;
88
89
  }
89
- interface ChatOverrides {
90
- GET_CHAT_MESSAGES_ERROR: (error: Error) => ReactNode;
90
+ interface AiChatOverrides {
91
+ AI_CHAT_MESSAGES_ERROR: (error: Error) => ReactNode;
91
92
  }
92
93
  interface ThreadOverrides {
93
94
  THREAD_RESOLVE: string;
@@ -113,53 +114,107 @@ interface HistoryVersionPreviewOverrides {
113
114
  HISTORY_VERSION_PREVIEW_EMPTY: ReactNode;
114
115
  HISTORY_VERSION_PREVIEW_ERROR: (error: Error) => ReactNode;
115
116
  }
116
- type Overrides = LocalizationOverrides & GlobalOverrides & ComposerOverrides & CommentOverrides & ThreadOverrides & InboxNotificationOverrides & HistoryVersionPreviewOverrides & ChatComposerOverrides & ChatMessageOverrides & ChatOverrides;
117
+ type Overrides = LocalizationOverrides & GlobalOverrides & ComposerOverrides & CommentOverrides & ThreadOverrides & InboxNotificationOverrides & HistoryVersionPreviewOverrides & AiChatComposerOverrides & AiChatMessageOverrides & AiChatOverrides;
117
118
  declare function useOverrides(overrides?: Partial<Overrides>): Overrides;
118
119
 
119
- type AiChatProps = HTMLAttributes<HTMLDivElement> & {
120
+ type AiChatComponentsEmptyProps = {
120
121
  /**
121
- * The id of the chat the composer belongs to.
122
+ * The chat id provided to the `AiChat` component.
122
123
  */
123
124
  chatId: string;
124
125
  /**
125
- * The id of the copilot to use to send the message.
126
- */
127
- copilotId?: CopilotId;
128
- /**
129
- * The contextual information to include in the chat. Used by the assistant when generating responses.
126
+ * The copilot id provided to the `AiChat` component.
130
127
  */
131
- contexts?: AiChatContext[];
128
+ copilotId?: string;
129
+ };
130
+ type AiChatComponentsLoadingProps = Record<string, never>;
131
+ type AiChatComponents = {
132
132
  /**
133
- * The contextual information to include in the chat. Used by the assistant when generating responses.
133
+ * The component used to render the empty state of the chat.
134
134
  */
135
- tools?: Record<string, ClientToolDefinition>;
135
+ Empty: ComponentType<AiChatComponentsEmptyProps>;
136
136
  /**
137
- * Override the component's strings.
137
+ * The component used to render the loading state of the chat.
138
138
  */
139
- overrides?: Partial<GlobalOverrides & ChatMessageOverrides & ChatComposerOverrides & ChatOverrides>;
139
+ Loading: ComponentType<AiChatComponentsLoadingProps>;
140
140
  };
141
- declare const AiChat: react.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
141
+ interface AiChatProps extends ComponentProps<"div"> {
142
142
  /**
143
143
  * The id of the chat the composer belongs to.
144
144
  */
145
145
  chatId: string;
146
+ /**
147
+ * Whether to focus the chat composer on mount.
148
+ */
149
+ autoFocus?: boolean;
146
150
  /**
147
151
  * The id of the copilot to use to send the message.
148
152
  */
149
- copilotId?: CopilotId;
153
+ copilotId?: string;
154
+ /**
155
+ * The contextual knowledge to include in the chat. May be used by the assistant when generating responses.
156
+ * Any knowledge you provide via this prop will be added to any already globally registered knowledge via <RegisterAiKnowledge />.
157
+ */
158
+ knowledge?: AiKnowledgeSource[];
150
159
  /**
151
- * The contextual information to include in the chat. Used by the assistant when generating responses.
160
+ * Tool definitions to make available within this chat. May be used by the assistant when generating responses.
152
161
  */
153
- contexts?: AiChatContext[];
162
+ tools?: Record<string, AiOpaqueToolDefinition>;
154
163
  /**
155
- * The contextual information to include in the chat. Used by the assistant when generating responses.
164
+ * The layout of the chat and its composer.
156
165
  */
157
- tools?: Record<string, ClientToolDefinition>;
166
+ layout?: "inset" | "compact";
158
167
  /**
159
168
  * Override the component's strings.
160
169
  */
161
- overrides?: Partial<GlobalOverrides & ChatMessageOverrides & ChatComposerOverrides & ChatOverrides>;
162
- } & react.RefAttributes<HTMLDivElement>>;
170
+ overrides?: Partial<GlobalOverrides & AiChatMessageOverrides & AiChatComposerOverrides & AiChatOverrides>;
171
+ /**
172
+ * Override the component's components.
173
+ */
174
+ components?: Partial<GlobalComponents & AiChatComponents>;
175
+ }
176
+ declare const AiChat: react.ForwardRefExoticComponent<Omit<AiChatProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
177
+
178
+ interface AiToolProps extends Omit<ComponentProps<"div">, "title" | "children"> {
179
+ /**
180
+ * The tool's title.
181
+ *
182
+ * By default, a human-readable version of the tool's name is used:
183
+ * - `"showTodo"` → "Show todo"
184
+ * - `"get_weather"` → "Get weather"
185
+ */
186
+ title?: string;
187
+ /**
188
+ * An optional icon displayed next to the title.
189
+ */
190
+ icon?: ReactNode;
191
+ /**
192
+ * The content shown in the tool.
193
+ */
194
+ children?: ReactNode;
195
+ }
196
+ type AiToolIconProps = ComponentProps<"div">;
197
+ type AiToolInspectorProps = ComponentProps<"div">;
198
+ /**
199
+ * @private This API will change, and is not considered stable. DO NOT RELY on it.
200
+ *
201
+ * This component can be used to build human-in-the-loop interfaces.
202
+ */
203
+ interface AiToolConfirmationProps<A extends JsonObject, R extends ToolResultData> extends ComponentProps<"div"> {
204
+ types?: NoInfr<AiToolTypePack<A, R>>;
205
+ args?: A;
206
+ confirm: AiToolExecuteCallback<A, R>;
207
+ cancel: AiToolExecuteCallback<A, R>;
208
+ variant?: "default" | "destructive";
209
+ }
210
+ declare function AiToolIcon({ className, ...props }: AiToolIconProps): react_jsx_runtime.JSX.Element;
211
+ declare function AiToolInspector({ className, ...props }: AiToolInspectorProps): react_jsx_runtime.JSX.Element;
212
+ declare function AiToolConfirmation<TPack extends AiToolTypePack, A extends JsonObject = TPack["A"], R extends ToolResultData = TPack["R"]>({ children, variant, confirm, cancel, className, ...props }: AiToolConfirmationProps<A, R>): react_jsx_runtime.JSX.Element | null;
213
+ declare const AiTool: react.ForwardRefExoticComponent<Omit<AiToolProps, "ref"> & react.RefAttributes<HTMLDivElement>> & {
214
+ Icon: typeof AiToolIcon;
215
+ Inspector: typeof AiToolInspector;
216
+ Confirmation: typeof AiToolConfirmation;
217
+ };
163
218
 
164
219
  interface ComposerEditorMentionProps {
165
220
  /**
@@ -214,7 +269,7 @@ interface ComposerEditorComponents {
214
269
  */
215
270
  FloatingToolbar?: ComponentType<ComposerEditorFloatingToolbarProps>;
216
271
  }
217
- interface ComposerEditorProps extends Omit<ComponentPropsWithoutRef<"div">, "defaultValue"> {
272
+ interface ComposerEditorProps extends Omit<ComponentPropsWithoutRef<"div">, "defaultValue" | "children"> {
218
273
  /**
219
274
  * The reading direction of the editor and related elements.
220
275
  */
@@ -454,11 +509,6 @@ type HistoryVersionSummaryListProps = ComponentPropsWithoutRef<"ol">;
454
509
  */
455
510
  declare const HistoryVersionSummaryList: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.OlHTMLAttributes<HTMLOListElement>, HTMLOListElement>, "ref"> & react.RefAttributes<HTMLOListElement>>;
456
511
 
457
- interface GlobalComponents {
458
- Anchor: ComponentType<ComponentPropsWithoutRef<"a">> | "a";
459
- }
460
- type Components = GlobalComponents;
461
-
462
512
  interface AvatarProps extends ComponentProps<"div"> {
463
513
  /**
464
514
  * The user ID to display the avatar for.
@@ -762,6 +812,8 @@ declare function BoldIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.E
762
812
 
763
813
  declare function CheckIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
764
814
 
815
+ declare function CheckCircleIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
816
+
765
817
  declare function ChevronDownIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
766
818
 
767
819
  declare function ChevronLeftIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
@@ -774,6 +826,8 @@ declare function CodeIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.E
774
826
 
775
827
  declare function CommentIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
776
828
 
829
+ declare function CopyIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
830
+
777
831
  declare function CrossIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
778
832
 
779
833
  declare function EllipsisIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
@@ -802,6 +856,8 @@ declare function QuestionMarkIcon(props: ComponentProps<"svg">): react_jsx_runti
802
856
 
803
857
  declare function RedoIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
804
858
 
859
+ declare function RetryIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
860
+
805
861
  declare function SearchIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
806
862
 
807
863
  declare function SendIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element;
@@ -838,12 +894,14 @@ declare namespace icon {
838
894
  BlockquoteIcon as Blockquote,
839
895
  BoldIcon as Bold,
840
896
  CheckIcon as Check,
897
+ CheckCircleIcon as CheckCircle,
841
898
  ChevronDownIcon as ChevronDown,
842
899
  ChevronLeftIcon as ChevronLeft,
843
900
  ChevronRightIcon as ChevronRight,
844
901
  ChevronUpIcon as ChevronUp,
845
902
  CodeIcon as Code,
846
903
  CommentIcon as Comment,
904
+ CopyIcon as Copy,
847
905
  CrossIcon as Cross,
848
906
  EllipsisIcon as Ellipsis,
849
907
  EmojiIcon as Emoji,
@@ -858,6 +916,7 @@ declare namespace icon {
858
916
  MentionIcon as Mention,
859
917
  QuestionMarkIcon as QuestionMark,
860
918
  RedoIcon as Redo,
919
+ RetryIcon as Retry,
861
920
  SearchIcon as Search,
862
921
  SendIcon as Send,
863
922
  ShortenIcon as Shorten,
@@ -873,4 +932,4 @@ declare namespace icon {
873
932
  };
874
933
  }
875
934
 
876
- export { AiChat, AiChatProps, ChatComposerOverrides, Comment, CommentAttachmentArgs, CommentOverrides, CommentProps, Composer, ComposerBodyMark, ComposerBodyMarks, ComposerOverrides, ComposerProps, ComposerSubmitComment, GlobalOverrides, HistoryVersionSummary, HistoryVersionSummaryList, HistoryVersionSummaryListProps, HistoryVersionSummaryProps, icon as Icon, InboxNotification, InboxNotificationAvatarProps, InboxNotificationCustomKindProps, InboxNotificationCustomProps, InboxNotificationIconProps, InboxNotificationList, InboxNotificationListProps, InboxNotificationOverrides, InboxNotificationProps, InboxNotificationTextMentionKindProps, InboxNotificationTextMentionProps, InboxNotificationThreadKindProps, InboxNotificationThreadProps, LiveblocksUIConfig, LocalizationOverrides, Overrides, Thread, ThreadOverrides, ThreadProps, useOverrides };
935
+ export { AiChat, AiChatComponents, AiChatComponentsEmptyProps, AiChatComponentsLoadingProps, AiChatProps, AiTool, AiToolIconProps, AiToolProps, Comment, CommentAttachmentArgs, CommentOverrides, CommentProps, Composer, ComposerBodyMark, ComposerBodyMarks, ComposerOverrides, ComposerProps, ComposerSubmitComment, GlobalOverrides, HistoryVersionSummary, HistoryVersionSummaryList, HistoryVersionSummaryListProps, HistoryVersionSummaryProps, icon as Icon, InboxNotification, InboxNotificationAvatarProps, InboxNotificationCustomKindProps, InboxNotificationCustomProps, InboxNotificationIconProps, InboxNotificationList, InboxNotificationListProps, InboxNotificationOverrides, InboxNotificationProps, InboxNotificationTextMentionKindProps, InboxNotificationTextMentionProps, InboxNotificationThreadKindProps, InboxNotificationThreadProps, LiveblocksUIConfig, LocalizationOverrides, Overrides, Thread, ThreadOverrides, ThreadProps, useOverrides };
package/dist/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { detectDupes } from '@liveblocks/core';
2
2
  import { PKG_NAME, PKG_VERSION, PKG_FORMAT } from './version.js';
3
- export { AiChat } from './components/AiChat/AiChat.js';
3
+ export { AiChat } from './components/AiChat.js';
4
+ export { AiTool } from './components/AiTool.js';
4
5
  export { Comment } from './components/Comment.js';
5
6
  export { Composer } from './components/Composer.js';
6
7
  export { HistoryVersionSummary } from './components/HistoryVersionSummary.js';