@worktango/ai-assistant 0.0.90 → 0.0.91

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 (180) hide show
  1. package/dist/{Absenteeism-3H6nbQK1.mjs → Absenteeism-BHhgEQ2H.mjs} +1 -1
  2. package/dist/{ActivityFeed-i4JmNP-B.mjs → ActivityFeed-X2BEjp7M.mjs} +1 -1
  3. package/dist/{AddUser-BhkUhPFv.mjs → AddUser-CZ6v3Vnx.mjs} +1 -1
  4. package/dist/{Admin-CFY7tyDA.mjs → Admin-CK5kiXRS.mjs} +1 -1
  5. package/dist/{Admin-DjCkHmv2.mjs → Admin-Dakmsoi2.mjs} +1 -1
  6. package/dist/{AiGeneral-DXmJsLCs.mjs → AiGeneral-4OQSYTZK.mjs} +1 -1
  7. package/dist/{AiScoring-Ba8V8pHp.mjs → AiScoring-7vtdhPJa.mjs} +1 -1
  8. package/dist/{AiText-DjQEd7m1.mjs → AiText-CQXppODY.mjs} +1 -1
  9. package/dist/{Anniversary-B1K04u0w.mjs → Anniversary-Bmqagh9V.mjs} +1 -1
  10. package/dist/{Appreciation-CYXiaN89.mjs → Appreciation-CbaG-BMn.mjs} +1 -1
  11. package/dist/{ArrowDown-DbUIGfI8.mjs → ArrowDown-BooPIhM9.mjs} +1 -1
  12. package/dist/{ArrowLeft-98PgOsrv.mjs → ArrowLeft-BpRUqp0o.mjs} +1 -1
  13. package/dist/{ArrowRight-BYiUQGYL.mjs → ArrowRight-NmG_a6mP.mjs} +1 -1
  14. package/dist/{ArrowUp-BXOOA1ty.mjs → ArrowUp-ySTw8rE5.mjs} +1 -1
  15. package/dist/{Attachment-C66nmK_n.mjs → Attachment-PdicWxOZ.mjs} +1 -1
  16. package/dist/{BeQuickDontHurry-jdrxqWfY.mjs → BeQuickDontHurry-DhajCJUE.mjs} +1 -1
  17. package/dist/{Birthday-C90y1x-F.mjs → Birthday-C69Cg2Kk.mjs} +1 -1
  18. package/dist/{BrandPromise-CSnpVUTA.mjs → BrandPromise-ClNZBOS5.mjs} +1 -1
  19. package/dist/{BrandVision-DaOoO9R1.mjs → BrandVision-BxoLq2Av.mjs} +1 -1
  20. package/dist/{Calendar-BcZhdqCo.mjs → Calendar-Mp5s9IlB.mjs} +1 -1
  21. package/dist/{CaretDn-tdYoRgiA.mjs → CaretDn-CGTQPrhS.mjs} +1 -1
  22. package/dist/{CaretDown-2VCSeleR.mjs → CaretDown-f8iHF7xk.mjs} +1 -1
  23. package/dist/{CaretLeft-C4I6uNSo.mjs → CaretLeft-DJZ7gjex.mjs} +1 -1
  24. package/dist/{CaretRight-DZ6W6JKh.mjs → CaretRight-2B5GsbGX.mjs} +1 -1
  25. package/dist/{CaretUp-DDuaZXa5.mjs → CaretUp-C7X82x4G.mjs} +1 -1
  26. package/dist/{ChallengeAccepted-DtuHyfEC.mjs → ChallengeAccepted-DyA0gOux.mjs} +1 -1
  27. package/dist/{CheckIn-BrtZxdbm.mjs → CheckIn-Dslzr9r9.mjs} +1 -1
  28. package/dist/{CheckIns-C8i_ESbz.mjs → CheckIns-8U86SPzq.mjs} +1 -1
  29. package/dist/{CheckSeal-DZwqIX2x.mjs → CheckSeal-mPlp4Jcg.mjs} +1 -1
  30. package/dist/{Checkmark-DboPsLL9.mjs → Checkmark-CsAcgEh9.mjs} +1 -1
  31. package/dist/{Clock-BEZNJv5v.mjs → Clock-CzAMopgf.mjs} +1 -1
  32. package/dist/{Close-B_E3-TSA.mjs → Close-BdeKIv-W.mjs} +1 -1
  33. package/dist/{CloudDownload-DnZi1edQ.mjs → CloudDownload-CumrbUqA.mjs} +1 -1
  34. package/dist/{Comment-Bt7MW4tC.mjs → Comment-BpD_dUf_.mjs} +1 -1
  35. package/dist/{Comments-THHTX2Vi.mjs → Comments-ciOreIbl.mjs} +1 -1
  36. package/dist/{Connections-BeeNDkPz.mjs → Connections-CxtlO1Rw.mjs} +1 -1
  37. package/dist/{Copy-hRG1sEEn.mjs → Copy-CkaQMoxp.mjs} +1 -1
  38. package/dist/{CustomQuestion-B0KGEGXU.mjs → CustomQuestion-Bg17juBP.mjs} +1 -1
  39. package/dist/{CustomerSuccess-r-uvFsfN.mjs → CustomerSuccess-Ml5NR_bZ.mjs} +1 -1
  40. package/dist/DatePicker-k_wA6ZIy.mjs +299 -0
  41. package/dist/{Dot-DUHUDUlY.mjs → Dot-CG-tcAlQ.mjs} +1 -1
  42. package/dist/{Download-DnmBF1q6.mjs → Download-B5RdnVF2.mjs} +1 -1
  43. package/dist/{Drag-V89CTc4d.mjs → Drag-D8_y0vat.mjs} +1 -1
  44. package/dist/{Earn-BGlDs5th.mjs → Earn-Dw1VExHI.mjs} +1 -1
  45. package/dist/{Email-D5PHQvx_.mjs → Email-D2naleeI.mjs} +1 -1
  46. package/dist/{EmojiDisplay-CXW0SZvJ.mjs → EmojiDisplay-K77bJtVr.mjs} +2 -2
  47. package/dist/{EmojiPicker-CUb2WEuu.mjs → EmojiPicker-Byq04Fk7.mjs} +2 -2
  48. package/dist/{EnpsSurvey-DBarEkhG.mjs → EnpsSurvey-CTuuNXy6.mjs} +1 -1
  49. package/dist/{Expired-CQR6tX82.mjs → Expired-w9BFIHnJ.mjs} +1 -1
  50. package/dist/{Eye-BNaF3OYc.mjs → Eye-DjpjAz2N.mjs} +1 -1
  51. package/dist/{Feedback-oTWcvIvh.mjs → Feedback-BNP2KCOk.mjs} +1 -1
  52. package/dist/{Feedback-D_EMH823.mjs → Feedback-DyKioDOM.mjs} +1 -1
  53. package/dist/{Filter-BEyiFYmK.mjs → Filter-ff-V5qGL.mjs} +1 -1
  54. package/dist/{Flag-CVkdnhC1.mjs → Flag-DVoc5EXw.mjs} +1 -1
  55. package/dist/{Giphy-z1jNlxgJ.mjs → Giphy-BQ4fvhmk.mjs} +1 -1
  56. package/dist/{GoalCount-BrGT5vLs.mjs → GoalCount-CgZ6l49g.mjs} +1 -1
  57. package/dist/{GoalPercent-CmgjJwh0.mjs → GoalPercent-Dr9n1Eim.mjs} +1 -1
  58. package/dist/{GoalTask-DZfIH9sw.mjs → GoalTask-B8swi2Kg.mjs} +1 -1
  59. package/dist/{GoalTask-CuI2JbMR.mjs → GoalTask-v1Tk9uO_.mjs} +1 -1
  60. package/dist/{Goals-Di1U4JcX.mjs → Goals-D9cskVkJ.mjs} +1 -1
  61. package/dist/{Goals-hV2J9LkZ.mjs → Goals-mRK-IUn5.mjs} +1 -1
  62. package/dist/{Growth-d8GArTVq.mjs → Growth-IlL1rikT.mjs} +1 -1
  63. package/dist/{Hamburger-D6rX3D-P.mjs → Hamburger-t2eDPk4n.mjs} +1 -1
  64. package/dist/{Help-BQSdpaKr.mjs → Help-C3-yRFTn.mjs} +1 -1
  65. package/dist/{HighFive-CvSZiZnm.mjs → HighFive-CedVzMSN.mjs} +1 -1
  66. package/dist/{HighFive-zemXprYX.mjs → HighFive-D5O89ubH.mjs} +1 -1
  67. package/dist/{Home-lt2f6nUu.mjs → Home-01qgXGqf.mjs} +1 -1
  68. package/dist/{Home-BZNqYz9L.mjs → Home-BB4UQ0CR.mjs} +1 -1
  69. package/dist/{HorizontalLine-O2DaoSRd.mjs → HorizontalLine-nqFBpJdS.mjs} +1 -1
  70. package/dist/{Hourglass-B3FT23c2.mjs → Hourglass-DqEa7mVx.mjs} +1 -1
  71. package/dist/{Image-D4m08cgW.mjs → Image-BceKuRFa.mjs} +1 -1
  72. package/dist/{ImageFile-BBxgqU6_.mjs → ImageFile-xOVbnWTe.mjs} +1 -1
  73. package/dist/{InGoodCompany-5YDmrB9f.mjs → InGoodCompany-D8CzPIpQ.mjs} +1 -1
  74. package/dist/{Incentives-koRv7chD.mjs → Incentives-B_kgRFed.mjs} +1 -1
  75. package/dist/{Info-BFdqbnu4.mjs → Info-CkXba90F.mjs} +1 -1
  76. package/dist/{Insights-CPxxQd7o.mjs → Insights-BYBKiN6X.mjs} +1 -1
  77. package/dist/{Insights-vhd4hj77.mjs → Insights-CzMduh8F.mjs} +1 -1
  78. package/dist/{Integrations-C2gZO24-.mjs → Integrations-BMREbfTT.mjs} +1 -1
  79. package/dist/{KazooLogo-BtYDJzht.mjs → KazooLogo-Bb8b5JwJ.mjs} +1 -1
  80. package/dist/{KnowYourAudience-DG0BEQBN.mjs → KnowYourAudience-hdHvpAJ5.mjs} +1 -1
  81. package/dist/{Launch-TVGPQW83.mjs → Launch-BZd__RP6.mjs} +1 -1
  82. package/dist/{Link-0Np3oLMA.mjs → Link-9CVMA-NF.mjs} +1 -1
  83. package/dist/{LinkArrow-D31rNLtB.mjs → LinkArrow-Bw9hu5v7.mjs} +1 -1
  84. package/dist/{Loading-k891G3aW.mjs → Loading-DY_zMUkM.mjs} +1 -1
  85. package/dist/{Lock-CilS_r7a.mjs → Lock-BHytsW-t.mjs} +1 -1
  86. package/dist/{Management-D1eLJSST.mjs → Management-BADbkOpt.mjs} +1 -1
  87. package/dist/{MeatballMenu-BQ-M71_a.mjs → MeatballMenu-b6VzzXQN.mjs} +1 -1
  88. package/dist/{Messages-BysedRyW.mjs → Messages-BXhAzkVs.mjs} +1 -1
  89. package/dist/{Microphone-CxN0BKd4.mjs → Microphone-C7RaiebM.mjs} +1 -1
  90. package/dist/{Mobile-CKgqL6F5.mjs → Mobile-BLiqnM7K.mjs} +1 -1
  91. package/dist/{Nomination-CI5_sM2S.mjs → Nomination-DoF1uARM.mjs} +1 -1
  92. package/dist/{NominationsAndAwards-BjOrcZ9x.mjs → NominationsAndAwards-BM37M_ib.mjs} +1 -1
  93. package/dist/{Notification-CRgahfKl.mjs → Notification-NoJRkwNO.mjs} +1 -1
  94. package/dist/{Okrs-BrL8bkLH.mjs → Okrs-Bt2P8yhw.mjs} +1 -1
  95. package/dist/{Pause-BS_e_ldd.mjs → Pause-CM0ASi2V.mjs} +1 -1
  96. package/dist/{PeerToPeer-B3KR1TU9.mjs → PeerToPeer-4TSDCE63.mjs} +1 -1
  97. package/dist/{Pencil--JWoYABP.mjs → Pencil-CgLkDHIG.mjs} +1 -1
  98. package/dist/{People-C7aIe2Cv.mjs → People-BZnyV-50.mjs} +1 -1
  99. package/dist/{PerformanceManagement-BniowiFs.mjs → PerformanceManagement-BpcP5Ada.mjs} +1 -1
  100. package/dist/{Pin-TsNPHiOs.mjs → Pin-TuhbkDMz.mjs} +1 -1
  101. package/dist/{PinnedIconAward-D65R3mQP.mjs → PinnedIconAward-CG-gnKrP.mjs} +1 -1
  102. package/dist/{PinnedIconBrightIdea-J_gtTFVq.mjs → PinnedIconBrightIdea-z2E1n9-8.mjs} +1 -1
  103. package/dist/{PinnedIconBullseye-BQKLfF06.mjs → PinnedIconBullseye-BSxwRkWS.mjs} +1 -1
  104. package/dist/{PinnedIconChampagne-aHisjwaL.mjs → PinnedIconChampagne-arJe0BX4.mjs} +1 -1
  105. package/dist/{PinnedIconCheer-CJDLq6JF.mjs → PinnedIconCheer-T67kvKBJ.mjs} +1 -1
  106. package/dist/{PinnedIconCrown-B9IgHISb.mjs → PinnedIconCrown-9FhsdX35.mjs} +1 -1
  107. package/dist/{PinnedIconDiamond-ByKGT89a.mjs → PinnedIconDiamond-Bgosoa8i.mjs} +1 -1
  108. package/dist/{PinnedIconHoleInOne-DqPrcZjF.mjs → PinnedIconHoleInOne-DH1AGhCA.mjs} +1 -1
  109. package/dist/{PinnedIconMedal-xOsZd862.mjs → PinnedIconMedal-CuiCqPfT.mjs} +1 -1
  110. package/dist/{PinnedIconMetrics-BWHZ8J7g.mjs → PinnedIconMetrics-BmIqDVZt.mjs} +1 -1
  111. package/dist/{PinnedIconPin-odayroj7.mjs → PinnedIconPin-6o2vWgkJ.mjs} +1 -1
  112. package/dist/{PinnedIconRockAndRoll-DB_DQxXq.mjs → PinnedIconRockAndRoll-DQ87I842.mjs} +1 -1
  113. package/dist/{PinnedIconRocket-moXMWBbk.mjs → PinnedIconRocket-CV8gz4My.mjs} +1 -1
  114. package/dist/{PinnedIconStrength-B3qBQlVB.mjs → PinnedIconStrength-CymBNMgH.mjs} +1 -1
  115. package/dist/{PinnedIconTeddyBear-B2YICPKX.mjs → PinnedIconTeddyBear-CFuXxi_Q.mjs} +1 -1
  116. package/dist/{PlatformLogo-dLOslLXM.mjs → PlatformLogo-DgqbrQd2.mjs} +1 -1
  117. package/dist/{Plus-HzBnkeip.mjs → Plus-Befq76EY.mjs} +1 -1
  118. package/dist/{Popper-OrCgm3bj.mjs → Popper-Dfy5ksLl.mjs} +1 -1
  119. package/dist/{PrivateEye-Ba6S1vYH.mjs → PrivateEye-DZoiyub2.mjs} +1 -1
  120. package/dist/{PrivatePushPin-Bl1mO88e.mjs → PrivatePushPin-D3GMYlJr.mjs} +1 -1
  121. package/dist/{Processing-Cz7GeYcd.mjs → Processing-iTYhaQ-D.mjs} +1 -1
  122. package/dist/{Productivity-QETkuhKj.mjs → Productivity-BxmbS4EX.mjs} +1 -1
  123. package/dist/{ProgressCircle-D-LARjij.mjs → ProgressCircle-32U1ZzQW.mjs} +1 -1
  124. package/dist/{PulseSurvey-FsDqWuvd.mjs → PulseSurvey-Bca1_Kc4.mjs} +1 -1
  125. package/dist/{PushPin-BF21TbzM.mjs → PushPin-CAnf4TLR.mjs} +1 -1
  126. package/dist/{Recognition-SgzH0-12.mjs → Recognition-BXrMQ01z.mjs} +1 -1
  127. package/dist/{Recognition-DxprZ1BP.mjs → Recognition-C5SdxK05.mjs} +1 -1
  128. package/dist/{Retention-DmtI-rxP.mjs → Retention-DXIOlkke.mjs} +1 -1
  129. package/dist/{Rewards-Dp-oh_fV.mjs → Rewards-B7TbNZhD.mjs} +1 -1
  130. package/dist/{Rewards-DuPpuYQl.mjs → Rewards-zouzcoUK.mjs} +1 -1
  131. package/dist/{RewardsCatalog-C8eHpFDD.mjs → RewardsCatalog-DBF6F9ib.mjs} +1 -1
  132. package/dist/{Roadmap-DxMs5KH9.mjs → Roadmap-DdJMiq9o.mjs} +1 -1
  133. package/dist/{Search-DncFxops.mjs → Search-Du0f3mpj.mjs} +1 -1
  134. package/dist/{Security-Bi4f4s0a.mjs → Security-ClolQdHY.mjs} +1 -1
  135. package/dist/{SendRecognition-BbCZSbpx.mjs → SendRecognition-zklmBlvh.mjs} +1 -1
  136. package/dist/{ShareLink-CbyjaE0V.mjs → ShareLink-CGyW1w2z.mjs} +1 -1
  137. package/dist/{SidebarCollapse-Dhe7RcV_.mjs → SidebarCollapse-D50NnJDs.mjs} +1 -1
  138. package/dist/{Skill-BbcPoD_c.mjs → Skill-Ck1DxAVO.mjs} +1 -1
  139. package/dist/{Skills-D0Bl2TCu.mjs → Skills-EcyeyG_V.mjs} +1 -1
  140. package/dist/{Smiley-JqcgB-RD.mjs → Smiley-Do_HxJfk.mjs} +1 -1
  141. package/dist/{Stop-C34vFNNz.mjs → Stop-DQDMhfeA.mjs} +1 -1
  142. package/dist/{Survey-yxLE7G3M.mjs → Survey-D7zZgGJH.mjs} +1 -1
  143. package/dist/{Surveys-BjYtAtPp.mjs → Surveys--1799Cj4.mjs} +1 -1
  144. package/dist/{SyncUps-CbLQ0MXq.mjs → SyncUps-CYHLHA7Q.mjs} +1 -1
  145. package/dist/{Syncs-BBhRjbqm.mjs → Syncs-CcxApcrp.mjs} +1 -1
  146. package/dist/{TalentReview-BqcbUrcp.mjs → TalentReview-C8y7GSnC.mjs} +1 -1
  147. package/dist/{TalentReview-5b3EwsBj.mjs → TalentReview-K3_v80kj.mjs} +1 -1
  148. package/dist/{TalentReviewInsights-C82vtX-_.mjs → TalentReviewInsights-CydAi3cV.mjs} +1 -1
  149. package/dist/{TaskCompleted-B-KcMLf3.mjs → TaskCompleted-C2oxtEp9.mjs} +1 -1
  150. package/dist/{Team-CTJbv9rS.mjs → Team-aB41OKi3.mjs} +1 -1
  151. package/dist/{Teams-BUcDRttn.mjs → Teams-BH0S8WUg.mjs} +1 -1
  152. package/dist/{TextBold-B5UkDE66.mjs → TextBold-14Kuhq6m.mjs} +1 -1
  153. package/dist/{TextBulletList-5yiCp1HT.mjs → TextBulletList-BiyHhuqq.mjs} +1 -1
  154. package/dist/{TextInput-B_M6avnh.mjs → TextInput-DvMnSCyO.mjs} +1 -1
  155. package/dist/{TextItalic-DGs2tgGf.mjs → TextItalic-Di8N9TXF.mjs} +1 -1
  156. package/dist/{TextNumberList-gaEhRYQB.mjs → TextNumberList-BmRAavA7.mjs} +1 -1
  157. package/dist/{TextUnderline-DlL4mGTn.mjs → TextUnderline-BlPvpCse.mjs} +1 -1
  158. package/dist/{Toggle-CBqe5RIg.mjs → Toggle--s-8B4Bk.mjs} +1 -1
  159. package/dist/{Translate-zlY8X30H.mjs → Translate-BikJcfEm.mjs} +1 -1
  160. package/dist/{Trash-BV5ihiXO.mjs → Trash-BjXC4FRb.mjs} +1 -1
  161. package/dist/{TrendDown-DrTJqLqO.mjs → TrendDown-Dxa_eM7I.mjs} +1 -1
  162. package/dist/{TrendUp-G3kfyxXt.mjs → TrendUp-TEteX4Kn.mjs} +1 -1
  163. package/dist/{Undo-BbKG6pqe.mjs → Undo-ZW5nbLDS.mjs} +1 -1
  164. package/dist/{Unplugged-BN3I8ViJ.mjs → Unplugged-r9-dqsbw.mjs} +1 -1
  165. package/dist/{UpDownCaret-wqoCJH2K.mjs → UpDownCaret-d37BiLcC.mjs} +1 -1
  166. package/dist/{VerticalLine-Dzz_ntoP.mjs → VerticalLine-B_ytqSsR.mjs} +1 -1
  167. package/dist/{Warning-BiFiDFvb.mjs → Warning-BFvCkTyE.mjs} +1 -1
  168. package/dist/{WarningNoOutline-DLi9Fw9B.mjs → WarningNoOutline-BrQd2l2O.mjs} +1 -1
  169. package/dist/{YesAnd-S8gYEJEo.mjs → YesAnd-CRriCXCp.mjs} +1 -1
  170. package/dist/ai-assistant.css +1 -1
  171. package/dist/{emoji-BQ_ubf5X.mjs → emoji-C9jKLMMO.mjs} +1 -1
  172. package/dist/express.js +1379 -423
  173. package/dist/{react-apexcharts.min-QrephSsD.mjs → react-apexcharts.min-BNPbbaGs.mjs} +1 -1
  174. package/dist/react.es.js +5 -5
  175. package/dist/react.umd.js +346 -369
  176. package/dist/{reactComponent-DbyiC2C_.mjs → reactComponent-B8XgXVZo.mjs} +15350 -13357
  177. package/package.json +11 -3
  178. package/react.d.ts +5 -1
  179. package/sharedTypes.ts +91 -30
  180. package/dist/DatePicker-l0sNRNKZ.mjs +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@worktango/ai-assistant",
3
- "version": "0.0.90",
3
+ "version": "0.0.91",
4
4
  "files": [
5
5
  "constants.js",
6
6
  "dist",
@@ -31,8 +31,10 @@
31
31
  "html2canvas": "^1.4.1",
32
32
  "http-proxy-middleware": "^3",
33
33
  "json-nd": "^1",
34
+ "lodash.clonedeep": "^4",
34
35
  "micromark": "^4",
35
- "react-apexcharts": "^1.7.0"
36
+ "react-apexcharts": "^1.7.0",
37
+ "uuid": "^9"
36
38
  },
37
39
  "devDependencies": {
38
40
  "@vitejs/plugin-react": "^4.2.1",
@@ -42,7 +44,13 @@
42
44
  "vite": "~6.2.4",
43
45
  "vite-plugin-css-modules": "0.0.1"
44
46
  },
45
- "graphqlCodeGeneration": {},
47
+ "graphqlCodeGeneration": {
48
+ "apiHooks": {
49
+ "config": {
50
+ "enumsAsTypes": true
51
+ }
52
+ }
53
+ },
46
54
  "$schema": "../../packages/build-tools/schema.json",
47
55
  "peerDependencies": {
48
56
  "express": ">=4",
package/react.d.ts CHANGED
@@ -9,9 +9,13 @@ import {
9
9
  AiAssistantSuggestedPromptsProps,
10
10
  GetFollowUpSuggestions,
11
11
  ChatDataFile,
12
+ AiAssistantControls,
13
+ FollowUpSuggestion,
12
14
  } from "./sharedTypes";
13
15
 
14
- export const defaultGetFollowUpSuggestions: GetFollowUpSuggestions;
16
+ export const getDefaultGetFollowUpSuggestions: (args: {
17
+ promptOverride?: string;
18
+ }) => GetFollowUpSuggestions;
15
19
 
16
20
  export function AiAssistant(args: AiAssistantProps): JSX.Element;
17
21
 
package/sharedTypes.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  import type { Static, TSchema, Type } from "@sinclair/typebox";
2
2
 
3
+ import { Message } from "./generated/apiHooks";
4
+
3
5
  export type AiAssistantSuggestedPromptsProps = {
4
6
  suggestedPrompts: Record<string, AiAssistantSuggestedPrompt[]>;
5
7
  onSelect: (prompt: AiAssistantSuggestedPrompt) => void | Promise<void>;
@@ -29,6 +31,59 @@ export type ToolDeclaration<TParams extends TSchema = TSchema> = {
29
31
  fulfill: (result: Static<TParams>) => Promise<string | ChatDataFile>;
30
32
  };
31
33
 
34
+ /**
35
+ * Debug info added during the execution of the AI assistant.
36
+ */
37
+ export type DebugInfo = {
38
+ time: Date;
39
+ message: string;
40
+ data?: any;
41
+ level: "info" | "error" | "warn";
42
+ }[];
43
+
44
+ export type PropRefs = {
45
+ onAfterLlmCall?: (messages: Omit<Message, "__typename">[]) => void;
46
+ onBeforeLlmCall?: () => void;
47
+ onError?: (error: Error) => void;
48
+ onChunkAdded?: () => void;
49
+ tools?: ToolDeclaration[];
50
+ model?: SupportedTextModel;
51
+ temperature?: number;
52
+ isMounted: boolean;
53
+ systemInstruction?: () => string | Promise<string>;
54
+ getConversationById: (
55
+ conversationId: string
56
+ ) => ChatStateTree[string] | undefined;
57
+ getFollowUpSuggestions?: GetFollowUpSuggestions;
58
+ setFollowUpSuggestionsByConversationId: React.Dispatch<
59
+ React.SetStateAction<Record<string, FollowUpSuggestion[]>>
60
+ >;
61
+ handleSendUserMessage: (args: {
62
+ conversationId?: string;
63
+ messageText: string;
64
+ }) => Promise<void>;
65
+ setPrompt: (
66
+ conversationId: string | undefined,
67
+ prompt: string | ((prev: string) => string)
68
+ ) => void;
69
+ onSelectedConversationChange?: (
70
+ conversationId: string | undefined,
71
+ messages: ChatStateTree
72
+ ) => void;
73
+ selectedConversationId: string | undefined;
74
+ onSelectedConversationLoaded?: (
75
+ /**
76
+ * The conversation that loaded.
77
+ */
78
+ conversationId: string | undefined,
79
+ /**
80
+ * The conversation that is currently selected
81
+ */
82
+ selectedConversationId: string | undefined,
83
+ messages: ChatStateTree
84
+ ) => void;
85
+ };
86
+
32
87
  export type ChatData =
33
88
  | ChatDataText
34
89
  | ChatDataToolCall
@@ -39,8 +94,10 @@ export type ChatDataText = { type: "text"; text: string };
39
94
 
40
95
  export type ChatDataFile = {
41
96
  type: "file";
97
+ toolName: string;
42
98
  fileUri: string;
43
99
  mimeType: string;
100
+ args?: unknown;
44
101
  };
45
102
 
46
103
  export type ChatDataToolCall = {
@@ -52,6 +109,7 @@ export type ChatDataToolCall = {
52
109
  export type ChatDataToolResult = {
53
110
  type: "toolResult";
54
111
  toolName: string;
112
+ args?: unknown;
55
113
  result: any;
56
114
  };
57
115
 
@@ -62,11 +120,8 @@ export type ChatHistoryItem = {
62
120
  };
63
121
 
64
122
  export type GetFollowUpSuggestions = (args: {
65
- chatHistory: ChatItem[];
66
- aiAssistantControls: React.MutableRefObject<AiAssistantControls>;
67
- setFollowUpSuggestions: (suggestions: FollowUpSuggestion[]) => void;
68
- followUpSuggestionsPromptOverride?: string;
69
- }) => Promise<FollowUpSuggestion[]>;
123
+ conversation: ChatStateTree[string];
124
+ }) => Promise<AiAssistantSuggestedPrompt[]>;
70
125
 
71
126
  export type ChatHistory = Record<string, ChatHistoryItem[]>;
72
127
 
@@ -98,28 +153,6 @@ export type AiAssistantProps = {
98
153
  * The function to call when the AI assistant is closed.
99
154
  */
100
155
  onClose: () => void;
101
- /**
102
- * The function to call when the AI assistant receives a text reply from the LLM.
103
- * Is invoked with the entire chat history, including the new message.
104
- */
105
- onLlmTextReply?: (chatHistory: ChatItem[]) => void;
106
- /**
107
- * The function to call when the selected conversation changes. Is invoked with
108
- * the ID of the selected conversation, or undefined if there is no selected
109
- * conversation.
110
- */
111
- onSelectedConversationChange?: (conversationId?: string) => void;
112
- /**
113
- * This is a callback event that is invoked when the selected conversation has
114
- * loaded. We do not pass the conversation itself because this is to be used as
115
- * an event to trigger other actions, like loading suggested follow ups.
116
- *
117
- * If the conversation is new, the `conversation` argument will be undefined.
118
- */
119
- onSelectedConversationLoaded?: (conversation?: {
120
- conversationId: string;
121
- messages: ChatItem[];
122
- }) => void;
123
156
  /**
124
157
  * This is a callback event that is invoked when the user sends a message.
125
158
  */
@@ -173,9 +206,37 @@ export type AiAssistantProps = {
173
206
  */
174
207
  minimumCharacterCount?: number;
175
208
  /**
176
- * Follow up suggestions to display in the chat window, just above the text area.
209
+ * The ID of the conversation to start with. If not provided, a new conversation will be created.
210
+ */
211
+ initialConversationId?: string;
212
+ /**
213
+ * Returns a set of follow-up suggestions for the given conversation.
177
214
  */
178
- followUpSuggestions?: FollowUpSuggestion[];
215
+ getFollowUpSuggestions?: GetFollowUpSuggestions;
216
+ /**
217
+ * Invoked with a raw string of the chat (in plain text) to get a possible title
218
+ */
219
+ getChatTitle?: (chat: string) => Promise<string>;
220
+ };
221
+
222
+ export type ChatStateTree = Record<
223
+ string,
224
+ {
225
+ id: string;
226
+ title: string;
227
+ isUpdatingTitle?: boolean;
228
+ updatedAt: Date;
229
+ isLoading: boolean;
230
+ messages: Omit<Message, "__typename">[];
231
+ }
232
+ >;
233
+
234
+ // ChatItem augmented with some UI stuff
235
+ export type AugmentedChatItem = ChatItem & {
236
+ id?: string;
237
+ timestamp?: Date;
238
+ isPending?: boolean;
239
+ filterFromApiCalls?: boolean;
179
240
  };
180
241
 
181
242
  /**
@@ -203,7 +264,7 @@ export type FollowUpSuggestion =
203
264
  export interface Conversation {
204
265
  id: string;
205
266
  title: string;
206
- updatedAt: Date;
267
+ updatedAt?: Date;
207
268
  messages: {
208
269
  conversationId: string;
209
270
  id: string;
@@ -1 +0,0 @@
1
-