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