@docyrus/rn-assistant 0.0.1

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 (314) hide show
  1. package/README.md +477 -0
  2. package/dist/commonjs/components/agent-selector/agent-selector.js +300 -0
  3. package/dist/commonjs/components/agent-selector/agent-selector.js.map +1 -0
  4. package/dist/commonjs/components/agent-selector/index.js +17 -0
  5. package/dist/commonjs/components/agent-selector/index.js.map +1 -0
  6. package/dist/commonjs/components/assistant-animations/assistant-animations.js +169 -0
  7. package/dist/commonjs/components/assistant-animations/assistant-animations.js.map +1 -0
  8. package/dist/commonjs/components/assistant-animations/index.js +17 -0
  9. package/dist/commonjs/components/assistant-animations/index.js.map +1 -0
  10. package/dist/commonjs/components/assistant-screen/assistant-screen.js +809 -0
  11. package/dist/commonjs/components/assistant-screen/assistant-screen.js.map +1 -0
  12. package/dist/commonjs/components/assistant-screen/index.js +17 -0
  13. package/dist/commonjs/components/assistant-screen/index.js.map +1 -0
  14. package/dist/commonjs/components/index.js +116 -0
  15. package/dist/commonjs/components/index.js.map +1 -0
  16. package/dist/commonjs/components/message-parts/index.js +13 -0
  17. package/dist/commonjs/components/message-parts/index.js.map +1 -0
  18. package/dist/commonjs/components/message-parts/message-parts.js +209 -0
  19. package/dist/commonjs/components/message-parts/message-parts.js.map +1 -0
  20. package/dist/commonjs/components/new-chat/index.js +17 -0
  21. package/dist/commonjs/components/new-chat/index.js.map +1 -0
  22. package/dist/commonjs/components/new-chat/new-chat.js +100 -0
  23. package/dist/commonjs/components/new-chat/new-chat.js.map +1 -0
  24. package/dist/commonjs/components/prompt-input/attachment-picker.js +341 -0
  25. package/dist/commonjs/components/prompt-input/attachment-picker.js.map +1 -0
  26. package/dist/commonjs/components/prompt-input/attachment-preview.js +229 -0
  27. package/dist/commonjs/components/prompt-input/attachment-preview.js.map +1 -0
  28. package/dist/commonjs/components/prompt-input/index.js +41 -0
  29. package/dist/commonjs/components/prompt-input/index.js.map +1 -0
  30. package/dist/commonjs/components/prompt-input/prompt-input.js +288 -0
  31. package/dist/commonjs/components/prompt-input/prompt-input.js.map +1 -0
  32. package/dist/commonjs/components/prompt-input/provider-selector.js +542 -0
  33. package/dist/commonjs/components/prompt-input/provider-selector.js.map +1 -0
  34. package/dist/commonjs/components/prompt-input/reasoning-level-selector.js +350 -0
  35. package/dist/commonjs/components/prompt-input/reasoning-level-selector.js.map +1 -0
  36. package/dist/commonjs/components/prompt-input/voice-recorder.js +260 -0
  37. package/dist/commonjs/components/prompt-input/voice-recorder.js.map +1 -0
  38. package/dist/commonjs/components/sessions-list/index.js +17 -0
  39. package/dist/commonjs/components/sessions-list/index.js.map +1 -0
  40. package/dist/commonjs/components/sessions-list/sessions-list.js +820 -0
  41. package/dist/commonjs/components/sessions-list/sessions-list.js.map +1 -0
  42. package/dist/commonjs/hooks/index.js +34 -0
  43. package/dist/commonjs/hooks/index.js.map +1 -0
  44. package/dist/commonjs/hooks/use-agent-models.js +104 -0
  45. package/dist/commonjs/hooks/use-agent-models.js.map +1 -0
  46. package/dist/commonjs/hooks/use-assistant.js +402 -0
  47. package/dist/commonjs/hooks/use-assistant.js.map +1 -0
  48. package/dist/commonjs/hooks/use-attachment-picker.js +308 -0
  49. package/dist/commonjs/hooks/use-attachment-picker.js.map +1 -0
  50. package/dist/commonjs/hooks/use-voice-recorder.js +217 -0
  51. package/dist/commonjs/hooks/use-voice-recorder.js.map +1 -0
  52. package/dist/commonjs/index.js +112 -0
  53. package/dist/commonjs/index.js.map +1 -0
  54. package/dist/commonjs/package.json +1 -0
  55. package/dist/commonjs/theme/assistant-theme.js +105 -0
  56. package/dist/commonjs/theme/assistant-theme.js.map +1 -0
  57. package/dist/commonjs/theme/index.js +19 -0
  58. package/dist/commonjs/theme/index.js.map +1 -0
  59. package/dist/commonjs/types/index.js +2 -0
  60. package/dist/commonjs/types/index.js.map +1 -0
  61. package/dist/commonjs/ui/action-sheet.js +348 -0
  62. package/dist/commonjs/ui/action-sheet.js.map +1 -0
  63. package/dist/commonjs/ui/alert-dialog.js +134 -0
  64. package/dist/commonjs/ui/alert-dialog.js.map +1 -0
  65. package/dist/commonjs/ui/docyrus-brand-mark.js +52 -0
  66. package/dist/commonjs/ui/docyrus-brand-mark.js.map +1 -0
  67. package/dist/commonjs/ui/docyrus-icon.js +298 -0
  68. package/dist/commonjs/ui/docyrus-icon.js.map +1 -0
  69. package/dist/commonjs/ui/index.js +34 -0
  70. package/dist/commonjs/ui/index.js.map +1 -0
  71. package/dist/commonjs/utils/api-client.js +99 -0
  72. package/dist/commonjs/utils/api-client.js.map +1 -0
  73. package/dist/commonjs/utils/default-api-config.js +195 -0
  74. package/dist/commonjs/utils/default-api-config.js.map +1 -0
  75. package/dist/commonjs/utils/index.js +39 -0
  76. package/dist/commonjs/utils/index.js.map +1 -0
  77. package/dist/commonjs/utils/resolve-api-headers.js +16 -0
  78. package/dist/commonjs/utils/resolve-api-headers.js.map +1 -0
  79. package/dist/module/components/agent-selector/agent-selector.js +296 -0
  80. package/dist/module/components/agent-selector/agent-selector.js.map +1 -0
  81. package/dist/module/components/agent-selector/index.js +4 -0
  82. package/dist/module/components/agent-selector/index.js.map +1 -0
  83. package/dist/module/components/assistant-animations/assistant-animations.js +164 -0
  84. package/dist/module/components/assistant-animations/assistant-animations.js.map +1 -0
  85. package/dist/module/components/assistant-animations/index.js +4 -0
  86. package/dist/module/components/assistant-animations/index.js.map +1 -0
  87. package/dist/module/components/assistant-screen/assistant-screen.js +801 -0
  88. package/dist/module/components/assistant-screen/assistant-screen.js.map +1 -0
  89. package/dist/module/components/assistant-screen/index.js +4 -0
  90. package/dist/module/components/assistant-screen/index.js.map +1 -0
  91. package/dist/module/components/index.js +23 -0
  92. package/dist/module/components/index.js.map +1 -0
  93. package/dist/module/components/message-parts/index.js +4 -0
  94. package/dist/module/components/message-parts/index.js.map +1 -0
  95. package/dist/module/components/message-parts/message-parts.js +205 -0
  96. package/dist/module/components/message-parts/message-parts.js.map +1 -0
  97. package/dist/module/components/new-chat/index.js +4 -0
  98. package/dist/module/components/new-chat/index.js.map +1 -0
  99. package/dist/module/components/new-chat/new-chat.js +96 -0
  100. package/dist/module/components/new-chat/new-chat.js.map +1 -0
  101. package/dist/module/components/prompt-input/attachment-picker.js +337 -0
  102. package/dist/module/components/prompt-input/attachment-picker.js.map +1 -0
  103. package/dist/module/components/prompt-input/attachment-preview.js +225 -0
  104. package/dist/module/components/prompt-input/attachment-preview.js.map +1 -0
  105. package/dist/module/components/prompt-input/index.js +15 -0
  106. package/dist/module/components/prompt-input/index.js.map +1 -0
  107. package/dist/module/components/prompt-input/prompt-input.js +284 -0
  108. package/dist/module/components/prompt-input/prompt-input.js.map +1 -0
  109. package/dist/module/components/prompt-input/provider-selector.js +538 -0
  110. package/dist/module/components/prompt-input/provider-selector.js.map +1 -0
  111. package/dist/module/components/prompt-input/reasoning-level-selector.js +346 -0
  112. package/dist/module/components/prompt-input/reasoning-level-selector.js.map +1 -0
  113. package/dist/module/components/prompt-input/voice-recorder.js +256 -0
  114. package/dist/module/components/prompt-input/voice-recorder.js.map +1 -0
  115. package/dist/module/components/sessions-list/index.js +4 -0
  116. package/dist/module/components/sessions-list/index.js.map +1 -0
  117. package/dist/module/components/sessions-list/sessions-list.js +816 -0
  118. package/dist/module/components/sessions-list/sessions-list.js.map +1 -0
  119. package/dist/module/hooks/index.js +18 -0
  120. package/dist/module/hooks/index.js.map +1 -0
  121. package/dist/module/hooks/use-agent-models.js +100 -0
  122. package/dist/module/hooks/use-agent-models.js.map +1 -0
  123. package/dist/module/hooks/use-assistant.js +398 -0
  124. package/dist/module/hooks/use-assistant.js.map +1 -0
  125. package/dist/module/hooks/use-attachment-picker.js +303 -0
  126. package/dist/module/hooks/use-attachment-picker.js.map +1 -0
  127. package/dist/module/hooks/use-voice-recorder.js +214 -0
  128. package/dist/module/hooks/use-voice-recorder.js.map +1 -0
  129. package/dist/module/index.js +59 -0
  130. package/dist/module/index.js.map +1 -0
  131. package/dist/module/package.json +1 -0
  132. package/dist/module/theme/assistant-theme.js +100 -0
  133. package/dist/module/theme/assistant-theme.js.map +1 -0
  134. package/dist/module/theme/index.js +4 -0
  135. package/dist/module/theme/index.js.map +1 -0
  136. package/dist/module/types/index.js +2 -0
  137. package/dist/module/types/index.js.map +1 -0
  138. package/dist/module/ui/action-sheet.js +344 -0
  139. package/dist/module/ui/action-sheet.js.map +1 -0
  140. package/dist/module/ui/alert-dialog.js +130 -0
  141. package/dist/module/ui/alert-dialog.js.map +1 -0
  142. package/dist/module/ui/docyrus-brand-mark.js +48 -0
  143. package/dist/module/ui/docyrus-brand-mark.js.map +1 -0
  144. package/dist/module/ui/docyrus-icon.js +294 -0
  145. package/dist/module/ui/docyrus-icon.js.map +1 -0
  146. package/dist/module/ui/index.js +7 -0
  147. package/dist/module/ui/index.js.map +1 -0
  148. package/dist/module/utils/api-client.js +95 -0
  149. package/dist/module/utils/api-client.js.map +1 -0
  150. package/dist/module/utils/default-api-config.js +190 -0
  151. package/dist/module/utils/default-api-config.js.map +1 -0
  152. package/dist/module/utils/index.js +12 -0
  153. package/dist/module/utils/index.js.map +1 -0
  154. package/dist/module/utils/resolve-api-headers.js +12 -0
  155. package/dist/module/utils/resolve-api-headers.js.map +1 -0
  156. package/dist/typescript/commonjs/eslint.config.d.mts +4 -0
  157. package/dist/typescript/commonjs/eslint.config.d.mts.map +1 -0
  158. package/dist/typescript/commonjs/package.json +1 -0
  159. package/dist/typescript/commonjs/src/components/agent-selector/agent-selector.d.ts +49 -0
  160. package/dist/typescript/commonjs/src/components/agent-selector/agent-selector.d.ts.map +1 -0
  161. package/dist/typescript/commonjs/src/components/agent-selector/index.d.ts +2 -0
  162. package/dist/typescript/commonjs/src/components/agent-selector/index.d.ts.map +1 -0
  163. package/dist/typescript/commonjs/src/components/assistant-animations/assistant-animations.d.ts +8 -0
  164. package/dist/typescript/commonjs/src/components/assistant-animations/assistant-animations.d.ts.map +1 -0
  165. package/dist/typescript/commonjs/src/components/assistant-animations/index.d.ts +2 -0
  166. package/dist/typescript/commonjs/src/components/assistant-animations/index.d.ts.map +1 -0
  167. package/dist/typescript/commonjs/src/components/assistant-screen/assistant-screen.d.ts +122 -0
  168. package/dist/typescript/commonjs/src/components/assistant-screen/assistant-screen.d.ts.map +1 -0
  169. package/dist/typescript/commonjs/src/components/assistant-screen/index.d.ts +2 -0
  170. package/dist/typescript/commonjs/src/components/assistant-screen/index.d.ts.map +1 -0
  171. package/dist/typescript/commonjs/src/components/index.d.ts +11 -0
  172. package/dist/typescript/commonjs/src/components/index.d.ts.map +1 -0
  173. package/dist/typescript/commonjs/src/components/message-parts/index.d.ts +2 -0
  174. package/dist/typescript/commonjs/src/components/message-parts/index.d.ts.map +1 -0
  175. package/dist/typescript/commonjs/src/components/message-parts/message-parts.d.ts +22 -0
  176. package/dist/typescript/commonjs/src/components/message-parts/message-parts.d.ts.map +1 -0
  177. package/dist/typescript/commonjs/src/components/new-chat/index.d.ts +2 -0
  178. package/dist/typescript/commonjs/src/components/new-chat/index.d.ts.map +1 -0
  179. package/dist/typescript/commonjs/src/components/new-chat/new-chat.d.ts +34 -0
  180. package/dist/typescript/commonjs/src/components/new-chat/new-chat.d.ts.map +1 -0
  181. package/dist/typescript/commonjs/src/components/prompt-input/attachment-picker.d.ts +53 -0
  182. package/dist/typescript/commonjs/src/components/prompt-input/attachment-picker.d.ts.map +1 -0
  183. package/dist/typescript/commonjs/src/components/prompt-input/attachment-preview.d.ts +42 -0
  184. package/dist/typescript/commonjs/src/components/prompt-input/attachment-preview.d.ts.map +1 -0
  185. package/dist/typescript/commonjs/src/components/prompt-input/index.d.ts +9 -0
  186. package/dist/typescript/commonjs/src/components/prompt-input/index.d.ts.map +1 -0
  187. package/dist/typescript/commonjs/src/components/prompt-input/prompt-input.d.ts +139 -0
  188. package/dist/typescript/commonjs/src/components/prompt-input/prompt-input.d.ts.map +1 -0
  189. package/dist/typescript/commonjs/src/components/prompt-input/provider-selector.d.ts +11 -0
  190. package/dist/typescript/commonjs/src/components/prompt-input/provider-selector.d.ts.map +1 -0
  191. package/dist/typescript/commonjs/src/components/prompt-input/reasoning-level-selector.d.ts +35 -0
  192. package/dist/typescript/commonjs/src/components/prompt-input/reasoning-level-selector.d.ts.map +1 -0
  193. package/dist/typescript/commonjs/src/components/prompt-input/voice-recorder.d.ts +48 -0
  194. package/dist/typescript/commonjs/src/components/prompt-input/voice-recorder.d.ts.map +1 -0
  195. package/dist/typescript/commonjs/src/components/sessions-list/index.d.ts +2 -0
  196. package/dist/typescript/commonjs/src/components/sessions-list/index.d.ts.map +1 -0
  197. package/dist/typescript/commonjs/src/components/sessions-list/sessions-list.d.ts +59 -0
  198. package/dist/typescript/commonjs/src/components/sessions-list/sessions-list.d.ts.map +1 -0
  199. package/dist/typescript/commonjs/src/hooks/index.d.ts +8 -0
  200. package/dist/typescript/commonjs/src/hooks/index.d.ts.map +1 -0
  201. package/dist/typescript/commonjs/src/hooks/use-agent-models.d.ts +68 -0
  202. package/dist/typescript/commonjs/src/hooks/use-agent-models.d.ts.map +1 -0
  203. package/dist/typescript/commonjs/src/hooks/use-assistant.d.ts +55 -0
  204. package/dist/typescript/commonjs/src/hooks/use-assistant.d.ts.map +1 -0
  205. package/dist/typescript/commonjs/src/hooks/use-attachment-picker.d.ts +99 -0
  206. package/dist/typescript/commonjs/src/hooks/use-attachment-picker.d.ts.map +1 -0
  207. package/dist/typescript/commonjs/src/hooks/use-voice-recorder.d.ts +101 -0
  208. package/dist/typescript/commonjs/src/hooks/use-voice-recorder.d.ts.map +1 -0
  209. package/dist/typescript/commonjs/src/index.d.ts +47 -0
  210. package/dist/typescript/commonjs/src/index.d.ts.map +1 -0
  211. package/dist/typescript/commonjs/src/theme/assistant-theme.d.ts +51 -0
  212. package/dist/typescript/commonjs/src/theme/assistant-theme.d.ts.map +1 -0
  213. package/dist/typescript/commonjs/src/theme/index.d.ts +2 -0
  214. package/dist/typescript/commonjs/src/theme/index.d.ts.map +1 -0
  215. package/dist/typescript/commonjs/src/types/index.d.ts +167 -0
  216. package/dist/typescript/commonjs/src/types/index.d.ts.map +1 -0
  217. package/dist/typescript/commonjs/src/ui/action-sheet.d.ts +29 -0
  218. package/dist/typescript/commonjs/src/ui/action-sheet.d.ts.map +1 -0
  219. package/dist/typescript/commonjs/src/ui/alert-dialog.d.ts +12 -0
  220. package/dist/typescript/commonjs/src/ui/alert-dialog.d.ts.map +1 -0
  221. package/dist/typescript/commonjs/src/ui/docyrus-brand-mark.d.ts +5 -0
  222. package/dist/typescript/commonjs/src/ui/docyrus-brand-mark.d.ts.map +1 -0
  223. package/dist/typescript/commonjs/src/ui/docyrus-icon.d.ts +11 -0
  224. package/dist/typescript/commonjs/src/ui/docyrus-icon.d.ts.map +1 -0
  225. package/dist/typescript/commonjs/src/ui/index.d.ts +5 -0
  226. package/dist/typescript/commonjs/src/ui/index.d.ts.map +1 -0
  227. package/dist/typescript/commonjs/src/utils/api-client.d.ts +35 -0
  228. package/dist/typescript/commonjs/src/utils/api-client.d.ts.map +1 -0
  229. package/dist/typescript/commonjs/src/utils/default-api-config.d.ts +38 -0
  230. package/dist/typescript/commonjs/src/utils/default-api-config.d.ts.map +1 -0
  231. package/dist/typescript/commonjs/src/utils/index.d.ts +9 -0
  232. package/dist/typescript/commonjs/src/utils/index.d.ts.map +1 -0
  233. package/dist/typescript/commonjs/src/utils/resolve-api-headers.d.ts +3 -0
  234. package/dist/typescript/commonjs/src/utils/resolve-api-headers.d.ts.map +1 -0
  235. package/dist/typescript/module/eslint.config.d.mts +4 -0
  236. package/dist/typescript/module/eslint.config.d.mts.map +1 -0
  237. package/dist/typescript/module/package.json +1 -0
  238. package/dist/typescript/module/src/components/agent-selector/agent-selector.d.ts +49 -0
  239. package/dist/typescript/module/src/components/agent-selector/agent-selector.d.ts.map +1 -0
  240. package/dist/typescript/module/src/components/agent-selector/index.d.ts +2 -0
  241. package/dist/typescript/module/src/components/agent-selector/index.d.ts.map +1 -0
  242. package/dist/typescript/module/src/components/assistant-animations/assistant-animations.d.ts +8 -0
  243. package/dist/typescript/module/src/components/assistant-animations/assistant-animations.d.ts.map +1 -0
  244. package/dist/typescript/module/src/components/assistant-animations/index.d.ts +2 -0
  245. package/dist/typescript/module/src/components/assistant-animations/index.d.ts.map +1 -0
  246. package/dist/typescript/module/src/components/assistant-screen/assistant-screen.d.ts +122 -0
  247. package/dist/typescript/module/src/components/assistant-screen/assistant-screen.d.ts.map +1 -0
  248. package/dist/typescript/module/src/components/assistant-screen/index.d.ts +2 -0
  249. package/dist/typescript/module/src/components/assistant-screen/index.d.ts.map +1 -0
  250. package/dist/typescript/module/src/components/index.d.ts +11 -0
  251. package/dist/typescript/module/src/components/index.d.ts.map +1 -0
  252. package/dist/typescript/module/src/components/message-parts/index.d.ts +2 -0
  253. package/dist/typescript/module/src/components/message-parts/index.d.ts.map +1 -0
  254. package/dist/typescript/module/src/components/message-parts/message-parts.d.ts +22 -0
  255. package/dist/typescript/module/src/components/message-parts/message-parts.d.ts.map +1 -0
  256. package/dist/typescript/module/src/components/new-chat/index.d.ts +2 -0
  257. package/dist/typescript/module/src/components/new-chat/index.d.ts.map +1 -0
  258. package/dist/typescript/module/src/components/new-chat/new-chat.d.ts +34 -0
  259. package/dist/typescript/module/src/components/new-chat/new-chat.d.ts.map +1 -0
  260. package/dist/typescript/module/src/components/prompt-input/attachment-picker.d.ts +53 -0
  261. package/dist/typescript/module/src/components/prompt-input/attachment-picker.d.ts.map +1 -0
  262. package/dist/typescript/module/src/components/prompt-input/attachment-preview.d.ts +42 -0
  263. package/dist/typescript/module/src/components/prompt-input/attachment-preview.d.ts.map +1 -0
  264. package/dist/typescript/module/src/components/prompt-input/index.d.ts +9 -0
  265. package/dist/typescript/module/src/components/prompt-input/index.d.ts.map +1 -0
  266. package/dist/typescript/module/src/components/prompt-input/prompt-input.d.ts +139 -0
  267. package/dist/typescript/module/src/components/prompt-input/prompt-input.d.ts.map +1 -0
  268. package/dist/typescript/module/src/components/prompt-input/provider-selector.d.ts +11 -0
  269. package/dist/typescript/module/src/components/prompt-input/provider-selector.d.ts.map +1 -0
  270. package/dist/typescript/module/src/components/prompt-input/reasoning-level-selector.d.ts +35 -0
  271. package/dist/typescript/module/src/components/prompt-input/reasoning-level-selector.d.ts.map +1 -0
  272. package/dist/typescript/module/src/components/prompt-input/voice-recorder.d.ts +48 -0
  273. package/dist/typescript/module/src/components/prompt-input/voice-recorder.d.ts.map +1 -0
  274. package/dist/typescript/module/src/components/sessions-list/index.d.ts +2 -0
  275. package/dist/typescript/module/src/components/sessions-list/index.d.ts.map +1 -0
  276. package/dist/typescript/module/src/components/sessions-list/sessions-list.d.ts +59 -0
  277. package/dist/typescript/module/src/components/sessions-list/sessions-list.d.ts.map +1 -0
  278. package/dist/typescript/module/src/hooks/index.d.ts +8 -0
  279. package/dist/typescript/module/src/hooks/index.d.ts.map +1 -0
  280. package/dist/typescript/module/src/hooks/use-agent-models.d.ts +68 -0
  281. package/dist/typescript/module/src/hooks/use-agent-models.d.ts.map +1 -0
  282. package/dist/typescript/module/src/hooks/use-assistant.d.ts +55 -0
  283. package/dist/typescript/module/src/hooks/use-assistant.d.ts.map +1 -0
  284. package/dist/typescript/module/src/hooks/use-attachment-picker.d.ts +99 -0
  285. package/dist/typescript/module/src/hooks/use-attachment-picker.d.ts.map +1 -0
  286. package/dist/typescript/module/src/hooks/use-voice-recorder.d.ts +101 -0
  287. package/dist/typescript/module/src/hooks/use-voice-recorder.d.ts.map +1 -0
  288. package/dist/typescript/module/src/index.d.ts +47 -0
  289. package/dist/typescript/module/src/index.d.ts.map +1 -0
  290. package/dist/typescript/module/src/theme/assistant-theme.d.ts +51 -0
  291. package/dist/typescript/module/src/theme/assistant-theme.d.ts.map +1 -0
  292. package/dist/typescript/module/src/theme/index.d.ts +2 -0
  293. package/dist/typescript/module/src/theme/index.d.ts.map +1 -0
  294. package/dist/typescript/module/src/types/index.d.ts +167 -0
  295. package/dist/typescript/module/src/types/index.d.ts.map +1 -0
  296. package/dist/typescript/module/src/ui/action-sheet.d.ts +29 -0
  297. package/dist/typescript/module/src/ui/action-sheet.d.ts.map +1 -0
  298. package/dist/typescript/module/src/ui/alert-dialog.d.ts +12 -0
  299. package/dist/typescript/module/src/ui/alert-dialog.d.ts.map +1 -0
  300. package/dist/typescript/module/src/ui/docyrus-brand-mark.d.ts +5 -0
  301. package/dist/typescript/module/src/ui/docyrus-brand-mark.d.ts.map +1 -0
  302. package/dist/typescript/module/src/ui/docyrus-icon.d.ts +11 -0
  303. package/dist/typescript/module/src/ui/docyrus-icon.d.ts.map +1 -0
  304. package/dist/typescript/module/src/ui/index.d.ts +5 -0
  305. package/dist/typescript/module/src/ui/index.d.ts.map +1 -0
  306. package/dist/typescript/module/src/utils/api-client.d.ts +35 -0
  307. package/dist/typescript/module/src/utils/api-client.d.ts.map +1 -0
  308. package/dist/typescript/module/src/utils/default-api-config.d.ts +38 -0
  309. package/dist/typescript/module/src/utils/default-api-config.d.ts.map +1 -0
  310. package/dist/typescript/module/src/utils/index.d.ts +9 -0
  311. package/dist/typescript/module/src/utils/index.d.ts.map +1 -0
  312. package/dist/typescript/module/src/utils/resolve-api-headers.d.ts +3 -0
  313. package/dist/typescript/module/src/utils/resolve-api-headers.d.ts.map +1 -0
  314. package/package.json +176 -0
@@ -0,0 +1,801 @@
1
+ "use strict";
2
+
3
+ import { useState, useCallback } from 'react';
4
+ import { View, Text, TouchableOpacity, StyleSheet, ScrollView, Modal } from 'react-native';
5
+ import { KeyboardStickyView } from 'react-native-keyboard-controller';
6
+ import { useSafeAreaInsets } from 'react-native-safe-area-context';
7
+ import { MessageSquareText, MessagesSquare, PenSquare, X } from 'lucide-react-native';
8
+ import { useI18n } from '@docyrus/i18n/rn';
9
+ import { SessionsList } from "../sessions-list/sessions-list.js";
10
+ import { AssistantAnimations } from "../assistant-animations/assistant-animations.js";
11
+ import { NewChat } from "../new-chat/new-chat.js";
12
+ import { PromptInput } from "../prompt-input/prompt-input.js";
13
+ import { ProviderSelector } from "../prompt-input/provider-selector.js";
14
+ import { ReasoningLevelSelector } from "../prompt-input/reasoning-level-selector.js";
15
+ import { VoiceRecorder } from "../prompt-input/voice-recorder.js";
16
+ import { AttachmentPicker } from "../prompt-input/attachment-picker.js";
17
+ import { AttachmentPreview } from "../prompt-input/attachment-preview.js";
18
+ import { MessageParts } from "../message-parts/message-parts.js";
19
+ import { useAgentModels } from "../../hooks/use-agent-models.js";
20
+ import { useAssistant } from "../../hooks/use-assistant.js";
21
+ import { useVoiceRecorder } from "../../hooks/use-voice-recorder.js";
22
+ import { useAttachmentPicker } from "../../hooks/use-attachment-picker.js";
23
+ import { DocyrusRNAssistantProvider, useDocyrusRNAssistantTheme } from "../../theme/index.js";
24
+ import { ActionSheet, DocyrusIcon } from "../../ui/index.js";
25
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
26
+ /**
27
+ * DocyAssistant Main Screen Component
28
+ *
29
+ * Complete AI assistant interface with:
30
+ * - Chat view with Vercel AI SDK
31
+ * - Sessions list
32
+ * - Works (saved outputs) list
33
+ * - New chat with quick actions
34
+ * - Agent/Model selector
35
+ *
36
+ * @example
37
+ * ```tsx
38
+ * <DocyAssistant
39
+ * api="https://api.docyrus.com"
40
+ * agentId="9979c996-0d0c-11ef-86a3-ef75fac389e0"
41
+ * token={userToken}
42
+ * credentials={{ token: userToken }}
43
+ * onError={(error) => console.error(error)}
44
+ * />
45
+ * ```
46
+ */
47
+ function DocyrusRNAssistantInner({
48
+ apiConfig,
49
+ agentId,
50
+ deploymentId,
51
+ dataSourceId,
52
+ credentials,
53
+ userId,
54
+ headers = {},
55
+ initialMode = 'chat',
56
+ onError,
57
+ showHeader = true,
58
+ onClose,
59
+ enableVoice = true,
60
+ enableAttachment = true,
61
+ allowedAttachmentTypes = ['*/*'],
62
+ maxAttachmentSize = 10 * 1024 * 1024,
63
+ maxAttachments = 10,
64
+ showModelSelectorInInput = true,
65
+ containerStyle,
66
+ safeAreaMode = 'host'
67
+ }) {
68
+ const theme = useDocyrusRNAssistantTheme();
69
+ const insets = useSafeAreaInsets();
70
+ const {
71
+ t
72
+ } = useI18n();
73
+ const [mode, setMode] = useState(initialMode);
74
+ const [activeThreadId, setActiveThreadId] = useState(null);
75
+ const [isChatStarted, setIsChatStarted] = useState(false);
76
+ const [chatError, setChatError] = useState(null);
77
+ const [selectedReasoningLevel, setSelectedReasoningLevel] = useState(null);
78
+
79
+ // Fetch agent models
80
+ const {
81
+ deployment,
82
+ models,
83
+ selectedModel,
84
+ selectModel
85
+ } = useAgentModels({
86
+ apiConfig,
87
+ agentId,
88
+ deploymentId
89
+ });
90
+
91
+ // Initialize chat
92
+ const chat = useAssistant({
93
+ apiConfig,
94
+ agentId,
95
+ deploymentId,
96
+ dataSourceId,
97
+ model: selectedModel || undefined,
98
+ threadId: activeThreadId || undefined,
99
+ credentials,
100
+ headers,
101
+ onError: error => {
102
+ // Show actual error message
103
+ const errorMsg = error.message || t('error.generic-desc', 'An error occurred. Please try again.');
104
+
105
+ // Clear first, then set new error to force re-render
106
+ setChatError(null);
107
+ setTimeout(() => {
108
+ setChatError(errorMsg);
109
+ }, 10);
110
+ onError?.(error);
111
+ },
112
+ onFinish: () => {
113
+ // Clear error on successful finish
114
+ setChatError(null);
115
+ }
116
+ });
117
+
118
+ // Build transcribe endpoint URL from config or prop
119
+ const transcribeEndpoint = apiConfig.endpoints.transcribe ? `${apiConfig.baseUrl}${apiConfig.endpoints.transcribe}` : undefined;
120
+
121
+ // Voice recorder hook
122
+ const voiceRecorder = useVoiceRecorder({
123
+ transcribeEndpoint,
124
+ transcribeHeaders: async () => {
125
+ if (typeof apiConfig.headers === 'function') {
126
+ return {
127
+ ...(await apiConfig.headers()),
128
+ ...headers
129
+ };
130
+ }
131
+ return {
132
+ ...(apiConfig.headers || {}),
133
+ ...headers
134
+ };
135
+ },
136
+ onTranscription: useCallback(text => {
137
+ // Append transcribed text to input
138
+ const currentInput = chat.input;
139
+ chat.setInput(currentInput ? `${currentInput} ${text}` : text);
140
+ }, [chat]),
141
+ onError: useCallback(error => {
142
+ onError?.(error);
143
+ }, [onError])
144
+ });
145
+
146
+ // Attachment picker hook
147
+ const attachmentPicker = useAttachmentPicker({
148
+ allowedDocumentTypes: allowedAttachmentTypes,
149
+ maxAttachments,
150
+ maxFileSize: maxAttachmentSize,
151
+ onError: useCallback(error => {
152
+ onError?.(error);
153
+ }, [onError])
154
+ });
155
+ const handleModeChange = newMode => {
156
+ setMode(newMode);
157
+ setChatError(null); // Clear error when switching modes
158
+ };
159
+ const handleSelectSession = async session => {
160
+ console.info('🔍 Selected Session:', {
161
+ id: session.id,
162
+ subject: session.subject
163
+ });
164
+ try {
165
+ setActiveThreadId(session.id);
166
+ chat.setThreadId(session.id);
167
+ await chat.loadMessages(session.id);
168
+ setIsChatStarted(true);
169
+ setMode('chat');
170
+ setChatError(null);
171
+ } catch (error) {
172
+ setActiveThreadId(null);
173
+ chat.setThreadId(null);
174
+ chat.clearMessages();
175
+ setIsChatStarted(false);
176
+ setMode('chat');
177
+ setChatError(error instanceof Error ? error.message : t('error.generic-desc', 'An error occurred. Please try again.'));
178
+ }
179
+ };
180
+ const handleNewChat = () => {
181
+ setActiveThreadId(null);
182
+ chat.setThreadId(null);
183
+ chat.clearMessages();
184
+ setMode('chat');
185
+ setIsChatStarted(false);
186
+ };
187
+ const handleStartChat = () => {
188
+ setActiveThreadId(null);
189
+ chat.setThreadId(null);
190
+ setMode('chat');
191
+ setIsChatStarted(true);
192
+ setTimeout(() => {
193
+ chat.inputRef.current?.focus();
194
+ }, 50);
195
+ };
196
+ const handleSubmitMessage = async () => {
197
+ if (!isChatStarted) {
198
+ setIsChatStarted(true);
199
+ }
200
+ await chat.sendMessage();
201
+ };
202
+ const visibleMessages = chat.messages.filter(msg => msg.content && msg.content.trim().length > 0);
203
+
204
+ // Show NewChat only if there is no active session, no visible messages, and chat has not started yet.
205
+ const showNewChatScreen = mode === 'chat' && visibleMessages.length === 0 && !activeThreadId && !chat.isLoading && !isChatStarted;
206
+ return /*#__PURE__*/_jsxs(View, {
207
+ style: [styles.container, {
208
+ backgroundColor: theme.colors.background
209
+ }, containerStyle],
210
+ children: [showHeader && /*#__PURE__*/_jsx(View, {
211
+ style: [styles.header, {
212
+ paddingTop: safeAreaMode === 'overlay' ? insets.top + (theme.spacing[2] ?? 8) : theme.spacing[4],
213
+ paddingHorizontal: theme.spacing[4],
214
+ paddingBottom: theme.spacing[3],
215
+ backgroundColor: theme.colors.muted,
216
+ borderBottomWidth: 1,
217
+ borderBottomColor: theme.colors.border
218
+ }],
219
+ children: /*#__PURE__*/_jsxs(View, {
220
+ style: {
221
+ flexDirection: 'row',
222
+ alignItems: 'center',
223
+ justifyContent: 'space-between'
224
+ },
225
+ children: [/*#__PURE__*/_jsxs(View, {
226
+ style: {
227
+ flexDirection: 'row',
228
+ alignItems: 'center',
229
+ flex: 1
230
+ },
231
+ children: [/*#__PURE__*/_jsx(View, {
232
+ style: {
233
+ width: 28,
234
+ height: 28,
235
+ alignItems: 'center',
236
+ justifyContent: 'center',
237
+ marginRight: theme.spacing[2.5]
238
+ },
239
+ children: /*#__PURE__*/_jsx(AssistantAnimations, {
240
+ animationType: chat.isLoading ? 'working' : 'thinking',
241
+ size: 28
242
+ })
243
+ }), /*#__PURE__*/_jsxs(View, {
244
+ style: {
245
+ flex: 1
246
+ },
247
+ children: [/*#__PURE__*/_jsx(Text, {
248
+ style: {
249
+ fontSize: 16,
250
+ fontWeight: '600',
251
+ color: theme.colors.foreground
252
+ },
253
+ numberOfLines: 1,
254
+ children: deployment?.name || t('assistant.title', 'Docyrus Assistant')
255
+ }), selectedModel && /*#__PURE__*/_jsx(Text, {
256
+ style: {
257
+ fontSize: 12,
258
+ color: theme.colors.mutedForeground
259
+ },
260
+ numberOfLines: 1,
261
+ children: selectedModel.name
262
+ })]
263
+ })]
264
+ }), /*#__PURE__*/_jsxs(View, {
265
+ style: {
266
+ flexDirection: 'row'
267
+ },
268
+ children: [mode === 'chat' && !showNewChatScreen && /*#__PURE__*/_jsx(TouchableOpacity, {
269
+ onPress: handleNewChat,
270
+ style: {
271
+ padding: theme.spacing[2],
272
+ borderRadius: theme.borderRadius.md,
273
+ backgroundColor: theme.colors.muted,
274
+ marginLeft: theme.spacing[2]
275
+ },
276
+ children: /*#__PURE__*/_jsx(PenSquare, {
277
+ size: 18,
278
+ color: theme.colors.foreground,
279
+ strokeWidth: 2.1
280
+ })
281
+ }), onClose && /*#__PURE__*/_jsx(TouchableOpacity, {
282
+ onPress: onClose,
283
+ style: {
284
+ padding: theme.spacing[2],
285
+ borderRadius: theme.borderRadius.md,
286
+ backgroundColor: theme.colors.muted,
287
+ marginLeft: theme.spacing[2]
288
+ },
289
+ children: /*#__PURE__*/_jsx(X, {
290
+ size: 18,
291
+ color: theme.colors.foreground,
292
+ strokeWidth: 2.2
293
+ })
294
+ })]
295
+ })]
296
+ })
297
+ }), /*#__PURE__*/_jsxs(View, {
298
+ style: [styles.tabBar, {
299
+ paddingHorizontal: theme.spacing[4],
300
+ paddingVertical: theme.spacing[2],
301
+ backgroundColor: theme.colors.card,
302
+ borderBottomWidth: 1,
303
+ borderBottomColor: theme.colors.border
304
+ }],
305
+ children: [/*#__PURE__*/_jsxs(TouchableOpacity, {
306
+ onPress: () => handleModeChange('chat'),
307
+ style: [styles.tab, {
308
+ paddingVertical: theme.spacing[2],
309
+ paddingHorizontal: theme.spacing[3],
310
+ borderRadius: theme.borderRadius.md,
311
+ backgroundColor: mode === 'chat' ? theme.colors.primary : 'transparent',
312
+ marginRight: theme.spacing[2]
313
+ }],
314
+ children: [/*#__PURE__*/_jsx(MessageSquareText, {
315
+ size: 16,
316
+ color: mode === 'chat' ? theme.colors.primaryForeground : theme.colors.mutedForeground,
317
+ strokeWidth: 2.2
318
+ }), /*#__PURE__*/_jsx(Text, {
319
+ style: {
320
+ fontSize: 14,
321
+ fontWeight: '600',
322
+ color: mode === 'chat' ? theme.colors.primaryForeground : theme.colors.mutedForeground,
323
+ marginLeft: theme.spacing[1.5]
324
+ },
325
+ children: t('assistant.chat', 'Chat')
326
+ })]
327
+ }), /*#__PURE__*/_jsxs(TouchableOpacity, {
328
+ onPress: () => handleModeChange('sessions'),
329
+ style: [styles.tab, {
330
+ paddingVertical: theme.spacing[2],
331
+ paddingHorizontal: theme.spacing[3],
332
+ borderRadius: theme.borderRadius.md,
333
+ backgroundColor: mode === 'sessions' ? theme.colors.primary : 'transparent'
334
+ }],
335
+ children: [/*#__PURE__*/_jsx(MessagesSquare, {
336
+ size: 16,
337
+ color: mode === 'sessions' ? theme.colors.primaryForeground : theme.colors.mutedForeground,
338
+ strokeWidth: 2.2
339
+ }), /*#__PURE__*/_jsx(Text, {
340
+ style: {
341
+ fontSize: 14,
342
+ fontWeight: '600',
343
+ color: mode === 'sessions' ? theme.colors.primaryForeground : theme.colors.mutedForeground,
344
+ marginLeft: theme.spacing[1.5]
345
+ },
346
+ children: t('assistant.sessions', 'Sessions')
347
+ })]
348
+ })]
349
+ }), mode === 'chat' && /*#__PURE__*/_jsxs(View, {
350
+ style: styles.chatScreen,
351
+ children: [/*#__PURE__*/_jsx(View, {
352
+ style: styles.content,
353
+ children: showNewChatScreen ? /*#__PURE__*/_jsx(NewChat, {
354
+ deployment: deployment,
355
+ onStartChat: handleStartChat
356
+ }) : /*#__PURE__*/_jsxs(ScrollView, {
357
+ ref: chat.scrollViewRef,
358
+ style: styles.scrollArea,
359
+ contentContainerStyle: {
360
+ paddingHorizontal: theme.spacing[4],
361
+ paddingTop: theme.spacing[4],
362
+ paddingBottom: theme.spacing[4]
363
+ },
364
+ keyboardShouldPersistTaps: "handled",
365
+ keyboardDismissMode: "on-drag",
366
+ showsVerticalScrollIndicator: true,
367
+ scrollEventThrottle: 16,
368
+ removeClippedSubviews: false,
369
+ onContentSizeChange: () => {
370
+ setTimeout(() => {
371
+ chat.scrollViewRef.current?.scrollToEnd({
372
+ animated: true
373
+ });
374
+ }, 100);
375
+ },
376
+ children: [visibleMessages.map(msg => {
377
+ return /*#__PURE__*/_jsx(View, {
378
+ style: {
379
+ marginBottom: theme.spacing[3],
380
+ alignSelf: msg.role === 'user' ? 'flex-end' : 'flex-start',
381
+ maxWidth: '80%'
382
+ },
383
+ children: /*#__PURE__*/_jsx(View, {
384
+ style: {
385
+ padding: theme.spacing[3],
386
+ borderRadius: theme.borderRadius.lg,
387
+ backgroundColor: msg.role === 'user' ? theme.colors.primary : theme.colors.card,
388
+ shadowColor: '#000',
389
+ shadowOffset: {
390
+ width: 0,
391
+ height: 1
392
+ },
393
+ shadowOpacity: 0.1,
394
+ shadowRadius: 2,
395
+ elevation: 2
396
+ },
397
+ children: msg.role === 'user' ? /*#__PURE__*/_jsx(Text, {
398
+ style: {
399
+ color: '#ffffff',
400
+ lineHeight: 20
401
+ },
402
+ children: msg.content
403
+ }) : /*#__PURE__*/_jsx(MessageParts, {
404
+ parts: msg.parts || [{
405
+ type: 'text',
406
+ text: msg.content
407
+ }]
408
+ })
409
+ })
410
+ }, msg.id);
411
+ }), !chat.isLoading && visibleMessages.length === 0 && !chatError && /*#__PURE__*/_jsxs(View, {
412
+ style: {
413
+ alignItems: 'center',
414
+ justifyContent: 'center',
415
+ paddingHorizontal: theme.spacing[6],
416
+ paddingVertical: theme.spacing[8]
417
+ },
418
+ children: [/*#__PURE__*/_jsx(View, {
419
+ style: {
420
+ width: 64,
421
+ height: 64,
422
+ borderRadius: 32,
423
+ backgroundColor: `${theme.colors.primary}15`,
424
+ alignItems: 'center',
425
+ justifyContent: 'center',
426
+ marginBottom: theme.spacing[3]
427
+ },
428
+ children: /*#__PURE__*/_jsx(DocyrusIcon, {
429
+ icon: "message-02",
430
+ size: 28,
431
+ color: theme.colors.primary
432
+ })
433
+ }), /*#__PURE__*/_jsx(Text, {
434
+ style: {
435
+ fontSize: 16,
436
+ fontWeight: '700',
437
+ color: theme.colors.foreground,
438
+ marginBottom: theme.spacing[1],
439
+ textAlign: 'center'
440
+ },
441
+ children: deployment?.name || deployment?.agent?.name || t('assistant.start-conversation', 'Start a conversation')
442
+ }), /*#__PURE__*/_jsx(Text, {
443
+ style: {
444
+ fontSize: 14,
445
+ color: theme.colors.mutedForeground,
446
+ textAlign: 'center',
447
+ lineHeight: 20
448
+ },
449
+ children: deployment?.welcomeMessage || deployment?.agent?.welcomeMessage || t('assistant.type-message-below', 'Type your message in the input below to begin chatting with the assistant.')
450
+ })]
451
+ }), chat.isLoading && /*#__PURE__*/_jsx(View, {
452
+ style: {
453
+ alignSelf: 'flex-start',
454
+ marginBottom: theme.spacing[3]
455
+ },
456
+ children: /*#__PURE__*/_jsxs(View, {
457
+ style: {
458
+ padding: theme.spacing[3],
459
+ borderRadius: theme.borderRadius.lg,
460
+ backgroundColor: theme.colors.card,
461
+ flexDirection: 'row',
462
+ alignItems: 'center',
463
+ gap: 6
464
+ },
465
+ children: [/*#__PURE__*/_jsx(View, {
466
+ style: {
467
+ width: 8,
468
+ height: 8,
469
+ borderRadius: 4,
470
+ backgroundColor: theme.colors.primary,
471
+ opacity: 0.6
472
+ }
473
+ }), /*#__PURE__*/_jsx(View, {
474
+ style: {
475
+ width: 8,
476
+ height: 8,
477
+ borderRadius: 4,
478
+ backgroundColor: theme.colors.primary,
479
+ opacity: 0.4
480
+ }
481
+ }), /*#__PURE__*/_jsx(View, {
482
+ style: {
483
+ width: 8,
484
+ height: 8,
485
+ borderRadius: 4,
486
+ backgroundColor: theme.colors.primary,
487
+ opacity: 0.2
488
+ }
489
+ })]
490
+ })
491
+ }), chatError && /*#__PURE__*/_jsxs(View, {
492
+ style: {
493
+ marginBottom: theme.spacing[3],
494
+ padding: theme.spacing[3],
495
+ borderRadius: theme.borderRadius.lg,
496
+ backgroundColor: theme.colors.destructive,
497
+ borderWidth: 1,
498
+ borderColor: theme.colors.destructive
499
+ },
500
+ children: [/*#__PURE__*/_jsx(Text, {
501
+ style: {
502
+ color: theme.colors.destructiveForeground,
503
+ fontSize: 14,
504
+ fontWeight: '600'
505
+ },
506
+ children: chatError
507
+ }), /*#__PURE__*/_jsx(TouchableOpacity, {
508
+ onPress: () => setChatError(null),
509
+ style: {
510
+ marginTop: theme.spacing[2],
511
+ alignSelf: 'flex-start'
512
+ },
513
+ children: /*#__PURE__*/_jsx(Text, {
514
+ style: {
515
+ color: theme.colors.destructiveForeground,
516
+ fontSize: 12,
517
+ textDecorationLine: 'underline'
518
+ },
519
+ children: t('common.dismiss', 'Dismiss')
520
+ })
521
+ })]
522
+ })]
523
+ })
524
+ }), /*#__PURE__*/_jsx(KeyboardStickyView, {
525
+ offset: {
526
+ opened: -(insets.bottom - 50),
527
+ closed: 0
528
+ },
529
+ children: /*#__PURE__*/_jsxs(View, {
530
+ style: {
531
+ paddingHorizontal: theme.spacing[3],
532
+ paddingTop: theme.spacing[1],
533
+ paddingBottom: Math.max(insets.bottom - 8, theme.spacing[2] ?? 8),
534
+ backgroundColor: theme.colors.background
535
+ },
536
+ children: [attachmentPicker.attachments.length > 0 && /*#__PURE__*/_jsx(View, {
537
+ style: {
538
+ marginBottom: theme.spacing[2]
539
+ },
540
+ children: /*#__PURE__*/_jsx(AttachmentPreview, {
541
+ attachments: attachmentPicker.attachments,
542
+ onRemove: attachmentPicker.removeAttachment
543
+ })
544
+ }), (voiceRecorder.isRecording || voiceRecorder.isTranscribing) && /*#__PURE__*/_jsx(View, {
545
+ style: {
546
+ marginBottom: theme.spacing[2]
547
+ },
548
+ children: /*#__PURE__*/_jsx(VoiceRecorder, {
549
+ isRecording: voiceRecorder.isRecording,
550
+ duration: voiceRecorder.duration,
551
+ isTranscribing: voiceRecorder.isTranscribing,
552
+ error: voiceRecorder.error?.message,
553
+ onStop: () => {
554
+ if (transcribeEndpoint) {
555
+ voiceRecorder.stopAndTranscribe();
556
+ } else {
557
+ voiceRecorder.stopRecording();
558
+ }
559
+ },
560
+ onCancel: () => {
561
+ voiceRecorder.reset();
562
+ },
563
+ accentColor: theme.colors.primary
564
+ })
565
+ }), /*#__PURE__*/_jsx(View, {
566
+ style: {
567
+ backgroundColor: theme.colors.card,
568
+ borderRadius: 24,
569
+ borderWidth: 1,
570
+ borderColor: theme.colors.border,
571
+ overflow: 'visible',
572
+ shadowColor: '#94a3b8',
573
+ shadowOffset: {
574
+ width: 0,
575
+ height: 6
576
+ },
577
+ shadowOpacity: theme.isDark ? 0 : 0.18,
578
+ shadowRadius: 12,
579
+ elevation: theme.isDark ? 0 : 4
580
+ },
581
+ children: /*#__PURE__*/_jsx(PromptInput, {
582
+ ref: chat.inputRef,
583
+ value: chat.input,
584
+ onChangeText: chat.setInput,
585
+ placeholder: t('assistant.ask-about-data', 'Ask me anything about your data...'),
586
+ onSend: handleSubmitMessage,
587
+ status: chat.isLoading ? 'streaming' : 'idle',
588
+ onStop: chat.stopGeneration,
589
+ accentColor: theme.colors.primary,
590
+ enableAttachment: false,
591
+ leftAccessory: /*#__PURE__*/_jsxs(View, {
592
+ style: {
593
+ flexDirection: 'row',
594
+ alignItems: 'center',
595
+ gap: theme.spacing[1.5]
596
+ },
597
+ children: [enableAttachment ? /*#__PURE__*/_jsx(AttachmentPicker, {
598
+ onPickDocuments: attachmentPicker.pickDocuments,
599
+ onPickImages: attachmentPicker.pickImages,
600
+ onTakePhoto: attachmentPicker.takePhoto,
601
+ isLoading: attachmentPicker.isLoading,
602
+ attachmentCount: attachmentPicker.attachments.length,
603
+ accentColor: theme.colors.primary
604
+ }) : null, selectedModel?.reasoningLevels && selectedModel.reasoningLevels.length > 1 ? /*#__PURE__*/_jsx(ReasoningLevelSelector, {
605
+ levels: selectedModel.reasoningLevels,
606
+ selectedLevel: selectedReasoningLevel,
607
+ onSelect: setSelectedReasoningLevel,
608
+ disabled: chat.isLoading,
609
+ compact: true
610
+ }) : null]
611
+ }),
612
+ centerAccessory: showModelSelectorInInput && models.length > 0 ? /*#__PURE__*/_jsx(ProviderSelector, {
613
+ models: models,
614
+ selectedModel: selectedModel,
615
+ onSelect: model => {
616
+ selectModel(model);
617
+ chat.setSelectedModel(model);
618
+ setSelectedReasoningLevel(null);
619
+ },
620
+ disabled: chat.isLoading,
621
+ variant: "toolbar"
622
+ }) : null,
623
+ enableVoice: enableVoice && !voiceRecorder.isRecording && !voiceRecorder.isTranscribing,
624
+ onVoicePress: () => {
625
+ voiceRecorder.startRecording();
626
+ },
627
+ isRecording: voiceRecorder.isRecording,
628
+ containerStyle: {
629
+ borderWidth: 0,
630
+ backgroundColor: 'transparent',
631
+ paddingHorizontal: theme.spacing[4],
632
+ paddingTop: theme.spacing[4],
633
+ paddingBottom: theme.spacing[3]
634
+ }
635
+ })
636
+ }), showNewChatScreen && /*#__PURE__*/_jsx(Text, {
637
+ style: {
638
+ marginTop: theme.spacing[2],
639
+ paddingHorizontal: theme.spacing[2],
640
+ fontSize: 11,
641
+ lineHeight: 16,
642
+ color: theme.colors.mutedForeground,
643
+ textAlign: 'left'
644
+ },
645
+ children: t('assistant.generative-ai-disclaimer', 'Our AI Assistant uses generative AI. You may need to verify the response.')
646
+ })]
647
+ })
648
+ })]
649
+ }), mode === 'sessions' && /*#__PURE__*/_jsx(SessionsList, {
650
+ apiConfig: apiConfig,
651
+ agentId: agentId,
652
+ userId: userId || credentials?.userId,
653
+ headers: headers,
654
+ onSelectSession: handleSelectSession,
655
+ onNewChat: handleNewChat,
656
+ showHeader: false
657
+ })]
658
+ });
659
+ }
660
+ export function DocyrusRNAssistant({
661
+ theme,
662
+ ...props
663
+ }) {
664
+ return /*#__PURE__*/_jsx(DocyrusRNAssistantProvider, {
665
+ theme: theme,
666
+ children: /*#__PURE__*/_jsx(DocyrusRNAssistantRoot, {
667
+ ...props
668
+ })
669
+ });
670
+ }
671
+ function DocyrusRNAssistantRoot({
672
+ containerStyle,
673
+ modalAnimationType = 'slide',
674
+ onClose,
675
+ presentation = 'embedded',
676
+ sheetDetent = 'large',
677
+ visible,
678
+ ...props
679
+ }) {
680
+ const theme = useDocyrusRNAssistantTheme();
681
+ if (presentation === 'modal') {
682
+ return /*#__PURE__*/_jsx(Modal, {
683
+ animationType: modalAnimationType,
684
+ onRequestClose: onClose,
685
+ presentationStyle: "fullScreen",
686
+ statusBarTranslucent: true,
687
+ transparent: false,
688
+ visible: visible ?? false,
689
+ children: /*#__PURE__*/_jsx(View, {
690
+ style: [styles.presentationRoot, {
691
+ backgroundColor: theme.colors.background
692
+ }, containerStyle],
693
+ children: /*#__PURE__*/_jsx(DocyrusRNAssistantInner, {
694
+ ...props,
695
+ containerStyle: styles.fill,
696
+ safeAreaMode: "overlay",
697
+ onClose: onClose
698
+ })
699
+ })
700
+ });
701
+ }
702
+ if (presentation === 'sheet') {
703
+ return /*#__PURE__*/_jsx(ActionSheet, {
704
+ closeOnBackdrop: true,
705
+ contentContainerStyle: styles.sheetContentContainer,
706
+ detent: sheetDetent,
707
+ onClose: onClose ?? (() => {}),
708
+ scrollable: false,
709
+ visible: visible ?? false,
710
+ children: /*#__PURE__*/_jsx(View, {
711
+ style: [styles.presentationRoot, containerStyle],
712
+ children: /*#__PURE__*/_jsx(DocyrusRNAssistantInner, {
713
+ ...props,
714
+ containerStyle: styles.fill,
715
+ safeAreaMode: "host",
716
+ onClose: onClose,
717
+ showHeader: props.showHeader ?? true
718
+ })
719
+ })
720
+ });
721
+ }
722
+ return /*#__PURE__*/_jsx(View, {
723
+ style: [styles.presentationRoot, containerStyle],
724
+ children: /*#__PURE__*/_jsx(DocyrusRNAssistantInner, {
725
+ ...props,
726
+ containerStyle: styles.fill,
727
+ onClose: onClose
728
+ })
729
+ });
730
+ }
731
+ export function DocyrusRNAssistantEmbedded(props) {
732
+ return /*#__PURE__*/_jsx(DocyrusRNAssistant, {
733
+ ...props,
734
+ presentation: "embedded"
735
+ });
736
+ }
737
+ export function DocyrusRNAssistantModal(props) {
738
+ return /*#__PURE__*/_jsx(DocyrusRNAssistant, {
739
+ ...props,
740
+ presentation: "modal"
741
+ });
742
+ }
743
+ export function DocyrusRNAssistantSheet(props) {
744
+ return /*#__PURE__*/_jsx(DocyrusRNAssistant, {
745
+ ...props,
746
+ presentation: "sheet"
747
+ });
748
+ }
749
+ export const DocyAssistant = DocyrusRNAssistant;
750
+ const styles = StyleSheet.create({
751
+ chatScreen: {
752
+ flex: 1,
753
+ flexBasis: 0,
754
+ minHeight: 0
755
+ },
756
+ container: {
757
+ alignSelf: 'stretch',
758
+ flex: 1,
759
+ flexBasis: 0,
760
+ minHeight: 0
761
+ },
762
+ fill: {
763
+ alignSelf: 'stretch',
764
+ flex: 1,
765
+ flexBasis: 0,
766
+ minHeight: 0
767
+ },
768
+ presentationRoot: {
769
+ alignSelf: 'stretch',
770
+ flex: 1,
771
+ flexBasis: 0,
772
+ minHeight: 0
773
+ },
774
+ header: {
775
+ // Dynamic styles
776
+ },
777
+ scrollArea: {
778
+ flex: 1,
779
+ flexBasis: 0,
780
+ minHeight: 0
781
+ },
782
+ sheetContentContainer: {
783
+ alignSelf: 'stretch',
784
+ flex: 1,
785
+ minHeight: 0,
786
+ paddingBottom: 0
787
+ },
788
+ tabBar: {
789
+ flexDirection: 'row'
790
+ },
791
+ tab: {
792
+ flexDirection: 'row',
793
+ alignItems: 'center'
794
+ },
795
+ content: {
796
+ flex: 1,
797
+ flexBasis: 0,
798
+ minHeight: 0
799
+ }
800
+ });
801
+ //# sourceMappingURL=assistant-screen.js.map