@burdenoff/microfe-healthybowl 2026.725.3 → 2026.725.4

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 (424) hide show
  1. package/dist/components/assistant/AssistantChatArea.js +127 -141
  2. package/dist/components/assistant/AssistantChatArea.js.map +1 -1
  3. package/dist/components/assistant/AssistantMarkdownImage.js +87 -0
  4. package/dist/components/assistant/AssistantMarkdownImage.js.map +1 -0
  5. package/dist/components/assistant/AssistantMarkdownRenderer.js +174 -183
  6. package/dist/components/assistant/AssistantMarkdownRenderer.js.map +1 -1
  7. package/dist/components/assistant/AssistantMessageAttachments.js +80 -0
  8. package/dist/components/assistant/AssistantMessageAttachments.js.map +1 -0
  9. package/dist/components/assistant/AssistantMessageItem.js +85 -73
  10. package/dist/components/assistant/AssistantMessageItem.js.map +1 -1
  11. package/dist/components/assistant/AssistantMessageList.js +6 -1
  12. package/dist/components/assistant/AssistantMessageList.js.map +1 -1
  13. package/dist/components/assistant/composer/AssistantAttachmentButton.js +26 -12
  14. package/dist/components/assistant/composer/AssistantAttachmentButton.js.map +1 -1
  15. package/dist/components/assistant/composer/AssistantAttachmentChips.js +65 -0
  16. package/dist/components/assistant/composer/AssistantAttachmentChips.js.map +1 -0
  17. package/dist/components/assistant/composer/AssistantComposer.js +134 -76
  18. package/dist/components/assistant/composer/AssistantComposer.js.map +1 -1
  19. package/dist/components/assistant/composer/AssistantModeSelector.js +60 -21
  20. package/dist/components/assistant/composer/AssistantModeSelector.js.map +1 -1
  21. package/dist/components/assistant/composer/AssistantVoiceButton.js +9 -8
  22. package/dist/components/assistant/composer/AssistantVoiceButton.js.map +1 -1
  23. package/dist/components/assistant/index.js +4 -0
  24. package/dist/healthybowl/pages/pest-management/AiPestDetectionPage.js +4 -4
  25. package/dist/hooks/useAssistantAttachments.js +181 -0
  26. package/dist/hooks/useAssistantAttachments.js.map +1 -0
  27. package/dist/hooks/useVoiceInput.js +86 -0
  28. package/dist/hooks/useVoiceInput.js.map +1 -0
  29. package/dist/node_modules/@ungap/structured-clone/esm/deserialize.js +63 -0
  30. package/dist/node_modules/@ungap/structured-clone/esm/deserialize.js.map +1 -0
  31. package/dist/node_modules/@ungap/structured-clone/esm/index.js +8 -0
  32. package/dist/node_modules/@ungap/structured-clone/esm/index.js.map +1 -0
  33. package/dist/node_modules/@ungap/structured-clone/esm/serialize.js +93 -0
  34. package/dist/node_modules/@ungap/structured-clone/esm/serialize.js.map +1 -0
  35. package/dist/node_modules/bail/index.js +8 -0
  36. package/dist/node_modules/bail/index.js.map +1 -0
  37. package/dist/node_modules/ccount/index.js +12 -0
  38. package/dist/node_modules/ccount/index.js.map +1 -0
  39. package/dist/node_modules/comma-separated-tokens/index.js +9 -0
  40. package/dist/node_modules/comma-separated-tokens/index.js.map +1 -0
  41. package/dist/node_modules/decode-named-character-reference/index.dom.js +12 -0
  42. package/dist/node_modules/decode-named-character-reference/index.dom.js.map +1 -0
  43. package/dist/node_modules/devlop/lib/default.js +7 -0
  44. package/dist/node_modules/devlop/lib/default.js.map +1 -0
  45. package/dist/node_modules/estree-util-is-identifier-name/lib/index.js +9 -0
  46. package/dist/node_modules/estree-util-is-identifier-name/lib/index.js.map +1 -0
  47. package/dist/node_modules/extend/index.js +42 -0
  48. package/dist/node_modules/extend/index.js.map +1 -0
  49. package/dist/node_modules/hast-util-sanitize/lib/index.js +163 -0
  50. package/dist/node_modules/hast-util-sanitize/lib/index.js.map +1 -0
  51. package/dist/node_modules/hast-util-sanitize/lib/schema.js +76 -0
  52. package/dist/node_modules/hast-util-sanitize/lib/schema.js.map +1 -0
  53. package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.js +255 -0
  54. package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.js.map +1 -0
  55. package/dist/node_modules/hast-util-whitespace/lib/index.js +12 -0
  56. package/dist/node_modules/hast-util-whitespace/lib/index.js.map +1 -0
  57. package/dist/node_modules/html-url-attributes/lib/index.js +38 -0
  58. package/dist/node_modules/html-url-attributes/lib/index.js.map +1 -0
  59. package/dist/node_modules/inline-style-parser/cjs/index.js +92 -0
  60. package/dist/node_modules/inline-style-parser/cjs/index.js.map +1 -0
  61. package/dist/node_modules/is-plain-obj/index.js +10 -0
  62. package/dist/node_modules/is-plain-obj/index.js.map +1 -0
  63. package/dist/node_modules/longest-streak/index.js +11 -0
  64. package/dist/node_modules/longest-streak/index.js.map +1 -0
  65. package/dist/node_modules/markdown-table/index.js +61 -0
  66. package/dist/node_modules/markdown-table/index.js.map +1 -0
  67. package/dist/node_modules/mdast-util-find-and-replace/lib/index.js +63 -0
  68. package/dist/node_modules/mdast-util-find-and-replace/lib/index.js.map +1 -0
  69. package/dist/node_modules/mdast-util-find-and-replace/node_modules/escape-string-regexp/index.js +9 -0
  70. package/dist/node_modules/mdast-util-find-and-replace/node_modules/escape-string-regexp/index.js.map +1 -0
  71. package/dist/node_modules/mdast-util-from-markdown/lib/index.js +559 -0
  72. package/dist/node_modules/mdast-util-from-markdown/lib/index.js.map +1 -0
  73. package/dist/node_modules/mdast-util-gfm/lib/index.js +28 -0
  74. package/dist/node_modules/mdast-util-gfm/lib/index.js.map +1 -0
  75. package/dist/node_modules/mdast-util-gfm-autolink-literal/lib/index.js +131 -0
  76. package/dist/node_modules/mdast-util-gfm-autolink-literal/lib/index.js.map +1 -0
  77. package/dist/node_modules/mdast-util-gfm-footnote/lib/index.js +99 -0
  78. package/dist/node_modules/mdast-util-gfm-footnote/lib/index.js.map +1 -0
  79. package/dist/node_modules/mdast-util-gfm-strikethrough/lib/index.js +51 -0
  80. package/dist/node_modules/mdast-util-gfm-strikethrough/lib/index.js.map +1 -0
  81. package/dist/node_modules/mdast-util-gfm-table/lib/index.js +139 -0
  82. package/dist/node_modules/mdast-util-gfm-table/lib/index.js.map +1 -0
  83. package/dist/node_modules/mdast-util-gfm-task-list-item/lib/index.js +60 -0
  84. package/dist/node_modules/mdast-util-gfm-task-list-item/lib/index.js.map +1 -0
  85. package/dist/node_modules/mdast-util-phrasing/lib/index.js +24 -0
  86. package/dist/node_modules/mdast-util-phrasing/lib/index.js.map +1 -0
  87. package/dist/node_modules/mdast-util-to-hast/lib/footer.js +105 -0
  88. package/dist/node_modules/mdast-util-to-hast/lib/footer.js.map +1 -0
  89. package/dist/node_modules/mdast-util-to-hast/lib/handlers/blockquote.js +14 -0
  90. package/dist/node_modules/mdast-util-to-hast/lib/handlers/blockquote.js.map +1 -0
  91. package/dist/node_modules/mdast-util-to-hast/lib/handlers/break.js +17 -0
  92. package/dist/node_modules/mdast-util-to-hast/lib/handlers/break.js.map +1 -0
  93. package/dist/node_modules/mdast-util-to-hast/lib/handlers/code.js +24 -0
  94. package/dist/node_modules/mdast-util-to-hast/lib/handlers/code.js.map +1 -0
  95. package/dist/node_modules/mdast-util-to-hast/lib/handlers/delete.js +14 -0
  96. package/dist/node_modules/mdast-util-to-hast/lib/handlers/delete.js.map +1 -0
  97. package/dist/node_modules/mdast-util-to-hast/lib/handlers/emphasis.js +14 -0
  98. package/dist/node_modules/mdast-util-to-hast/lib/handlers/emphasis.js.map +1 -0
  99. package/dist/node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.js +32 -0
  100. package/dist/node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.js.map +1 -0
  101. package/dist/node_modules/mdast-util-to-hast/lib/handlers/heading.js +14 -0
  102. package/dist/node_modules/mdast-util-to-hast/lib/handlers/heading.js.map +1 -0
  103. package/dist/node_modules/mdast-util-to-hast/lib/handlers/html.js +14 -0
  104. package/dist/node_modules/mdast-util-to-hast/lib/handlers/html.js.map +1 -0
  105. package/dist/node_modules/mdast-util-to-hast/lib/handlers/image-reference.js +23 -0
  106. package/dist/node_modules/mdast-util-to-hast/lib/handlers/image-reference.js.map +1 -0
  107. package/dist/node_modules/mdast-util-to-hast/lib/handlers/image.js +17 -0
  108. package/dist/node_modules/mdast-util-to-hast/lib/handlers/image.js.map +1 -0
  109. package/dist/node_modules/mdast-util-to-hast/lib/handlers/index.js +58 -0
  110. package/dist/node_modules/mdast-util-to-hast/lib/handlers/index.js.map +1 -0
  111. package/dist/node_modules/mdast-util-to-hast/lib/handlers/inline-code.js +19 -0
  112. package/dist/node_modules/mdast-util-to-hast/lib/handlers/inline-code.js.map +1 -0
  113. package/dist/node_modules/mdast-util-to-hast/lib/handlers/link-reference.js +20 -0
  114. package/dist/node_modules/mdast-util-to-hast/lib/handlers/link-reference.js.map +1 -0
  115. package/dist/node_modules/mdast-util-to-hast/lib/handlers/link.js +17 -0
  116. package/dist/node_modules/mdast-util-to-hast/lib/handlers/link.js.map +1 -0
  117. package/dist/node_modules/mdast-util-to-hast/lib/handlers/list-item.js +61 -0
  118. package/dist/node_modules/mdast-util-to-hast/lib/handlers/list-item.js.map +1 -0
  119. package/dist/node_modules/mdast-util-to-hast/lib/handlers/list.js +22 -0
  120. package/dist/node_modules/mdast-util-to-hast/lib/handlers/list.js.map +1 -0
  121. package/dist/node_modules/mdast-util-to-hast/lib/handlers/paragraph.js +14 -0
  122. package/dist/node_modules/mdast-util-to-hast/lib/handlers/paragraph.js.map +1 -0
  123. package/dist/node_modules/mdast-util-to-hast/lib/handlers/root.js +12 -0
  124. package/dist/node_modules/mdast-util-to-hast/lib/handlers/root.js.map +1 -0
  125. package/dist/node_modules/mdast-util-to-hast/lib/handlers/strong.js +14 -0
  126. package/dist/node_modules/mdast-util-to-hast/lib/handlers/strong.js.map +1 -0
  127. package/dist/node_modules/mdast-util-to-hast/lib/handlers/table-cell.js +14 -0
  128. package/dist/node_modules/mdast-util-to-hast/lib/handlers/table-cell.js.map +1 -0
  129. package/dist/node_modules/mdast-util-to-hast/lib/handlers/table-row.js +26 -0
  130. package/dist/node_modules/mdast-util-to-hast/lib/handlers/table-row.js.map +1 -0
  131. package/dist/node_modules/mdast-util-to-hast/lib/handlers/table.js +37 -0
  132. package/dist/node_modules/mdast-util-to-hast/lib/handlers/table.js.map +1 -0
  133. package/dist/node_modules/mdast-util-to-hast/lib/handlers/text.js +13 -0
  134. package/dist/node_modules/mdast-util-to-hast/lib/handlers/text.js.map +1 -0
  135. package/dist/node_modules/mdast-util-to-hast/lib/handlers/thematic-break.js +14 -0
  136. package/dist/node_modules/mdast-util-to-hast/lib/handlers/thematic-break.js.map +1 -0
  137. package/dist/node_modules/mdast-util-to-hast/lib/index.js +21 -0
  138. package/dist/node_modules/mdast-util-to-hast/lib/index.js.map +1 -0
  139. package/dist/node_modules/mdast-util-to-hast/lib/revert.js +22 -0
  140. package/dist/node_modules/mdast-util-to-hast/lib/revert.js.map +1 -0
  141. package/dist/node_modules/mdast-util-to-hast/lib/state.js +110 -0
  142. package/dist/node_modules/mdast-util-to-hast/lib/state.js.map +1 -0
  143. package/dist/node_modules/mdast-util-to-markdown/lib/handle/blockquote.js +14 -0
  144. package/dist/node_modules/mdast-util-to-markdown/lib/handle/blockquote.js.map +1 -0
  145. package/dist/node_modules/mdast-util-to-markdown/lib/handle/break.js +11 -0
  146. package/dist/node_modules/mdast-util-to-markdown/lib/handle/break.js.map +1 -0
  147. package/dist/node_modules/mdast-util-to-markdown/lib/handle/code.js +38 -0
  148. package/dist/node_modules/mdast-util-to-markdown/lib/handle/code.js.map +1 -0
  149. package/dist/node_modules/mdast-util-to-markdown/lib/handle/definition.js +26 -0
  150. package/dist/node_modules/mdast-util-to-markdown/lib/handle/definition.js.map +1 -0
  151. package/dist/node_modules/mdast-util-to-markdown/lib/handle/emphasis.js +27 -0
  152. package/dist/node_modules/mdast-util-to-markdown/lib/handle/emphasis.js.map +1 -0
  153. package/dist/node_modules/mdast-util-to-markdown/lib/handle/heading.js +26 -0
  154. package/dist/node_modules/mdast-util-to-markdown/lib/handle/heading.js.map +1 -0
  155. package/dist/node_modules/mdast-util-to-markdown/lib/handle/html.js +12 -0
  156. package/dist/node_modules/mdast-util-to-markdown/lib/handle/html.js.map +1 -0
  157. package/dist/node_modules/mdast-util-to-markdown/lib/handle/image-reference.js +25 -0
  158. package/dist/node_modules/mdast-util-to-markdown/lib/handle/image-reference.js.map +1 -0
  159. package/dist/node_modules/mdast-util-to-markdown/lib/handle/image.js +30 -0
  160. package/dist/node_modules/mdast-util-to-markdown/lib/handle/image.js.map +1 -0
  161. package/dist/node_modules/mdast-util-to-markdown/lib/handle/index.js +46 -0
  162. package/dist/node_modules/mdast-util-to-markdown/lib/handle/index.js.map +1 -0
  163. package/dist/node_modules/mdast-util-to-markdown/lib/handle/inline-code.js +21 -0
  164. package/dist/node_modules/mdast-util-to-markdown/lib/handle/inline-code.js.map +1 -0
  165. package/dist/node_modules/mdast-util-to-markdown/lib/handle/link-reference.js +25 -0
  166. package/dist/node_modules/mdast-util-to-markdown/lib/handle/link-reference.js.map +1 -0
  167. package/dist/node_modules/mdast-util-to-markdown/lib/handle/link.js +43 -0
  168. package/dist/node_modules/mdast-util-to-markdown/lib/handle/link.js.map +1 -0
  169. package/dist/node_modules/mdast-util-to-markdown/lib/handle/list-item.js +20 -0
  170. package/dist/node_modules/mdast-util-to-markdown/lib/handle/list-item.js.map +1 -0
  171. package/dist/node_modules/mdast-util-to-markdown/lib/handle/list.js +28 -0
  172. package/dist/node_modules/mdast-util-to-markdown/lib/handle/list.js.map +1 -0
  173. package/dist/node_modules/mdast-util-to-markdown/lib/handle/paragraph.js +9 -0
  174. package/dist/node_modules/mdast-util-to-markdown/lib/handle/paragraph.js.map +1 -0
  175. package/dist/node_modules/mdast-util-to-markdown/lib/handle/root.js +11 -0
  176. package/dist/node_modules/mdast-util-to-markdown/lib/handle/root.js.map +1 -0
  177. package/dist/node_modules/mdast-util-to-markdown/lib/handle/strong.js +27 -0
  178. package/dist/node_modules/mdast-util-to-markdown/lib/handle/strong.js.map +1 -0
  179. package/dist/node_modules/mdast-util-to-markdown/lib/handle/text.js +8 -0
  180. package/dist/node_modules/mdast-util-to-markdown/lib/handle/text.js.map +1 -0
  181. package/dist/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.js +11 -0
  182. package/dist/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.js.map +1 -0
  183. package/dist/node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.js +10 -0
  184. package/dist/node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.js.map +1 -0
  185. package/dist/node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.js +13 -0
  186. package/dist/node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.js.map +1 -0
  187. package/dist/node_modules/mdast-util-to-markdown/lib/util/check-bullet.js +10 -0
  188. package/dist/node_modules/mdast-util-to-markdown/lib/util/check-bullet.js.map +1 -0
  189. package/dist/node_modules/mdast-util-to-markdown/lib/util/check-emphasis.js +10 -0
  190. package/dist/node_modules/mdast-util-to-markdown/lib/util/check-emphasis.js.map +1 -0
  191. package/dist/node_modules/mdast-util-to-markdown/lib/util/check-fence.js +10 -0
  192. package/dist/node_modules/mdast-util-to-markdown/lib/util/check-fence.js.map +1 -0
  193. package/dist/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js +10 -0
  194. package/dist/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js.map +1 -0
  195. package/dist/node_modules/mdast-util-to-markdown/lib/util/check-quote.js +10 -0
  196. package/dist/node_modules/mdast-util-to-markdown/lib/util/check-quote.js.map +1 -0
  197. package/dist/node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.js +10 -0
  198. package/dist/node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.js.map +1 -0
  199. package/dist/node_modules/mdast-util-to-markdown/lib/util/check-rule.js +10 -0
  200. package/dist/node_modules/mdast-util-to-markdown/lib/util/check-rule.js.map +1 -0
  201. package/dist/node_modules/mdast-util-to-markdown/lib/util/check-strong.js +10 -0
  202. package/dist/node_modules/mdast-util-to-markdown/lib/util/check-strong.js.map +1 -0
  203. package/dist/node_modules/mdast-util-to-markdown/lib/util/encode-character-reference.js +8 -0
  204. package/dist/node_modules/mdast-util-to-markdown/lib/util/encode-character-reference.js.map +1 -0
  205. package/dist/node_modules/mdast-util-to-markdown/lib/util/encode-info.js +40 -0
  206. package/dist/node_modules/mdast-util-to-markdown/lib/util/encode-info.js.map +1 -0
  207. package/dist/node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.js +8 -0
  208. package/dist/node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.js.map +1 -0
  209. package/dist/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.js +13 -0
  210. package/dist/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.js.map +1 -0
  211. package/dist/node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.js +10 -0
  212. package/dist/node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.js.map +1 -0
  213. package/dist/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.js +14 -0
  214. package/dist/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.js.map +1 -0
  215. package/dist/node_modules/mdast-util-to-string/lib/index.js +26 -0
  216. package/dist/node_modules/mdast-util-to-string/lib/index.js.map +1 -0
  217. package/dist/node_modules/micromark/lib/constructs.js +82 -0
  218. package/dist/node_modules/micromark/lib/constructs.js.map +1 -0
  219. package/dist/node_modules/micromark/lib/create-tokenizer.js +179 -0
  220. package/dist/node_modules/micromark/lib/create-tokenizer.js.map +1 -0
  221. package/dist/node_modules/micromark/lib/initialize/content.js +36 -0
  222. package/dist/node_modules/micromark/lib/initialize/content.js.map +1 -0
  223. package/dist/node_modules/micromark/lib/initialize/document.js +104 -0
  224. package/dist/node_modules/micromark/lib/initialize/document.js.map +1 -0
  225. package/dist/node_modules/micromark/lib/initialize/flow.js +27 -0
  226. package/dist/node_modules/micromark/lib/initialize/flow.js.map +1 -0
  227. package/dist/node_modules/micromark/lib/initialize/text.js +88 -0
  228. package/dist/node_modules/micromark/lib/initialize/text.js.map +1 -0
  229. package/dist/node_modules/micromark/lib/parse.js +31 -0
  230. package/dist/node_modules/micromark/lib/parse.js.map +1 -0
  231. package/dist/node_modules/micromark/lib/postprocess.js +10 -0
  232. package/dist/node_modules/micromark/lib/postprocess.js.map +1 -0
  233. package/dist/node_modules/micromark/lib/preprocess.js +34 -0
  234. package/dist/node_modules/micromark/lib/preprocess.js.map +1 -0
  235. package/dist/node_modules/micromark-core-commonmark/lib/attention.js +116 -0
  236. package/dist/node_modules/micromark-core-commonmark/lib/attention.js.map +1 -0
  237. package/dist/node_modules/micromark-core-commonmark/lib/autolink.js +45 -0
  238. package/dist/node_modules/micromark-core-commonmark/lib/autolink.js.map +1 -0
  239. package/dist/node_modules/micromark-core-commonmark/lib/blank-line.js +20 -0
  240. package/dist/node_modules/micromark-core-commonmark/lib/blank-line.js.map +1 -0
  241. package/dist/node_modules/micromark-core-commonmark/lib/block-quote.js +40 -0
  242. package/dist/node_modules/micromark-core-commonmark/lib/block-quote.js.map +1 -0
  243. package/dist/node_modules/micromark-core-commonmark/lib/character-escape.js +19 -0
  244. package/dist/node_modules/micromark-core-commonmark/lib/character-escape.js.map +1 -0
  245. package/dist/node_modules/micromark-core-commonmark/lib/character-reference.js +31 -0
  246. package/dist/node_modules/micromark-core-commonmark/lib/character-reference.js.map +1 -0
  247. package/dist/node_modules/micromark-core-commonmark/lib/code-fenced.js +91 -0
  248. package/dist/node_modules/micromark-core-commonmark/lib/code-fenced.js.map +1 -0
  249. package/dist/node_modules/micromark-core-commonmark/lib/code-indented.js +45 -0
  250. package/dist/node_modules/micromark-core-commonmark/lib/code-indented.js.map +1 -0
  251. package/dist/node_modules/micromark-core-commonmark/lib/code-text.js +45 -0
  252. package/dist/node_modules/micromark-core-commonmark/lib/code-text.js.map +1 -0
  253. package/dist/node_modules/micromark-core-commonmark/lib/content.js +49 -0
  254. package/dist/node_modules/micromark-core-commonmark/lib/content.js.map +1 -0
  255. package/dist/node_modules/micromark-core-commonmark/lib/definition.js +62 -0
  256. package/dist/node_modules/micromark-core-commonmark/lib/definition.js.map +1 -0
  257. package/dist/node_modules/micromark-core-commonmark/lib/hard-break-escape.js +19 -0
  258. package/dist/node_modules/micromark-core-commonmark/lib/hard-break-escape.js.map +1 -0
  259. package/dist/node_modules/micromark-core-commonmark/lib/heading-atx.js +69 -0
  260. package/dist/node_modules/micromark-core-commonmark/lib/heading-atx.js.map +1 -0
  261. package/dist/node_modules/micromark-core-commonmark/lib/html-flow.js +143 -0
  262. package/dist/node_modules/micromark-core-commonmark/lib/html-flow.js.map +1 -0
  263. package/dist/node_modules/micromark-core-commonmark/lib/html-text.js +102 -0
  264. package/dist/node_modules/micromark-core-commonmark/lib/html-text.js.map +1 -0
  265. package/dist/node_modules/micromark-core-commonmark/lib/label-end.js +160 -0
  266. package/dist/node_modules/micromark-core-commonmark/lib/label-end.js.map +1 -0
  267. package/dist/node_modules/micromark-core-commonmark/lib/label-start-image.js +25 -0
  268. package/dist/node_modules/micromark-core-commonmark/lib/label-start-image.js.map +1 -0
  269. package/dist/node_modules/micromark-core-commonmark/lib/label-start-link.js +22 -0
  270. package/dist/node_modules/micromark-core-commonmark/lib/label-start-link.js.map +1 -0
  271. package/dist/node_modules/micromark-core-commonmark/lib/line-ending.js +16 -0
  272. package/dist/node_modules/micromark-core-commonmark/lib/line-ending.js.map +1 -0
  273. package/dist/node_modules/micromark-core-commonmark/lib/list.js +80 -0
  274. package/dist/node_modules/micromark-core-commonmark/lib/list.js.map +1 -0
  275. package/dist/node_modules/micromark-core-commonmark/lib/setext-underline.js +61 -0
  276. package/dist/node_modules/micromark-core-commonmark/lib/setext-underline.js.map +1 -0
  277. package/dist/node_modules/micromark-core-commonmark/lib/thematic-break.js +27 -0
  278. package/dist/node_modules/micromark-core-commonmark/lib/thematic-break.js.map +1 -0
  279. package/dist/node_modules/micromark-extension-gfm/index.js +20 -0
  280. package/dist/node_modules/micromark-extension-gfm/index.js.map +1 -0
  281. package/dist/node_modules/micromark-extension-gfm-autolink-literal/lib/syntax.js +176 -0
  282. package/dist/node_modules/micromark-extension-gfm-autolink-literal/lib/syntax.js.map +1 -0
  283. package/dist/node_modules/micromark-extension-gfm-footnote/lib/syntax.js +195 -0
  284. package/dist/node_modules/micromark-extension-gfm-footnote/lib/syntax.js.map +1 -0
  285. package/dist/node_modules/micromark-extension-gfm-strikethrough/lib/syntax.js +98 -0
  286. package/dist/node_modules/micromark-extension-gfm-strikethrough/lib/syntax.js.map +1 -0
  287. package/dist/node_modules/micromark-extension-gfm-table/lib/edit-map.js +45 -0
  288. package/dist/node_modules/micromark-extension-gfm-table/lib/edit-map.js.map +1 -0
  289. package/dist/node_modules/micromark-extension-gfm-table/lib/infer.js +22 -0
  290. package/dist/node_modules/micromark-extension-gfm-table/lib/infer.js.map +1 -0
  291. package/dist/node_modules/micromark-extension-gfm-table/lib/syntax.js +203 -0
  292. package/dist/node_modules/micromark-extension-gfm-table/lib/syntax.js.map +1 -0
  293. package/dist/node_modules/micromark-extension-gfm-task-list-item/lib/syntax.js +36 -0
  294. package/dist/node_modules/micromark-extension-gfm-task-list-item/lib/syntax.js.map +1 -0
  295. package/dist/node_modules/micromark-factory-destination/index.js +28 -0
  296. package/dist/node_modules/micromark-factory-destination/index.js.map +1 -0
  297. package/dist/node_modules/micromark-factory-label/index.js +22 -0
  298. package/dist/node_modules/micromark-factory-label/index.js.map +1 -0
  299. package/dist/node_modules/micromark-factory-space/index.js +16 -0
  300. package/dist/node_modules/micromark-factory-space/index.js.map +1 -0
  301. package/dist/node_modules/micromark-factory-title/index.js +26 -0
  302. package/dist/node_modules/micromark-factory-title/index.js.map +1 -0
  303. package/dist/node_modules/micromark-factory-whitespace/index.js +14 -0
  304. package/dist/node_modules/micromark-factory-whitespace/index.js.map +1 -0
  305. package/dist/node_modules/micromark-util-character/index.js +26 -0
  306. package/dist/node_modules/micromark-util-character/index.js.map +1 -0
  307. package/dist/node_modules/micromark-util-chunked/index.js +13 -0
  308. package/dist/node_modules/micromark-util-chunked/index.js.map +1 -0
  309. package/dist/node_modules/micromark-util-classify-character/index.js +10 -0
  310. package/dist/node_modules/micromark-util-classify-character/index.js.map +1 -0
  311. package/dist/node_modules/micromark-util-combine-extensions/index.js +28 -0
  312. package/dist/node_modules/micromark-util-combine-extensions/index.js.map +1 -0
  313. package/dist/node_modules/micromark-util-decode-numeric-character-reference/index.js +9 -0
  314. package/dist/node_modules/micromark-util-decode-numeric-character-reference/index.js.map +1 -0
  315. package/dist/node_modules/micromark-util-decode-string/index.js +19 -0
  316. package/dist/node_modules/micromark-util-decode-string/index.js.map +1 -0
  317. package/dist/node_modules/micromark-util-html-tag-name/index.js +11 -0
  318. package/dist/node_modules/micromark-util-html-tag-name/index.js.map +1 -0
  319. package/dist/node_modules/micromark-util-normalize-identifier/index.js +8 -0
  320. package/dist/node_modules/micromark-util-normalize-identifier/index.js.map +1 -0
  321. package/dist/node_modules/micromark-util-resolve-all/index.js +13 -0
  322. package/dist/node_modules/micromark-util-resolve-all/index.js.map +1 -0
  323. package/dist/node_modules/micromark-util-sanitize-uri/index.js +20 -0
  324. package/dist/node_modules/micromark-util-sanitize-uri/index.js.map +1 -0
  325. package/dist/node_modules/micromark-util-subtokenize/index.js +37 -0
  326. package/dist/node_modules/micromark-util-subtokenize/index.js.map +1 -0
  327. package/dist/node_modules/micromark-util-subtokenize/lib/splice-buffer.js +59 -0
  328. package/dist/node_modules/micromark-util-subtokenize/lib/splice-buffer.js.map +1 -0
  329. package/dist/node_modules/property-information/index.js +28 -0
  330. package/dist/node_modules/property-information/index.js.map +1 -0
  331. package/dist/node_modules/property-information/lib/aria.js +63 -0
  332. package/dist/node_modules/property-information/lib/aria.js.map +1 -0
  333. package/dist/node_modules/property-information/lib/find.js +33 -0
  334. package/dist/node_modules/property-information/lib/find.js.map +1 -0
  335. package/dist/node_modules/property-information/lib/hast-to-react.js +24 -0
  336. package/dist/node_modules/property-information/lib/hast-to-react.js.map +1 -0
  337. package/dist/node_modules/property-information/lib/html.js +328 -0
  338. package/dist/node_modules/property-information/lib/html.js.map +1 -0
  339. package/dist/node_modules/property-information/lib/normalize.js +8 -0
  340. package/dist/node_modules/property-information/lib/normalize.js.map +1 -0
  341. package/dist/node_modules/property-information/lib/svg.js +566 -0
  342. package/dist/node_modules/property-information/lib/svg.js.map +1 -0
  343. package/dist/node_modules/property-information/lib/util/case-insensitive-transform.js +9 -0
  344. package/dist/node_modules/property-information/lib/util/case-insensitive-transform.js.map +1 -0
  345. package/dist/node_modules/property-information/lib/util/case-sensitive-transform.js +8 -0
  346. package/dist/node_modules/property-information/lib/util/case-sensitive-transform.js.map +1 -0
  347. package/dist/node_modules/property-information/lib/util/create.js +16 -0
  348. package/dist/node_modules/property-information/lib/util/create.js.map +1 -0
  349. package/dist/node_modules/property-information/lib/util/defined-info.js +20 -0
  350. package/dist/node_modules/property-information/lib/util/defined-info.js.map +1 -0
  351. package/dist/node_modules/property-information/lib/util/info.js +11 -0
  352. package/dist/node_modules/property-information/lib/util/info.js.map +1 -0
  353. package/dist/node_modules/property-information/lib/util/merge.js +11 -0
  354. package/dist/node_modules/property-information/lib/util/merge.js.map +1 -0
  355. package/dist/node_modules/property-information/lib/util/schema.js +11 -0
  356. package/dist/node_modules/property-information/lib/util/schema.js.map +1 -0
  357. package/dist/node_modules/property-information/lib/util/types.js +18 -0
  358. package/dist/node_modules/property-information/lib/util/types.js.map +1 -0
  359. package/dist/node_modules/property-information/lib/xlink.js +21 -0
  360. package/dist/node_modules/property-information/lib/xlink.js.map +1 -0
  361. package/dist/node_modules/property-information/lib/xml.js +17 -0
  362. package/dist/node_modules/property-information/lib/xml.js.map +1 -0
  363. package/dist/node_modules/property-information/lib/xmlns.js +16 -0
  364. package/dist/node_modules/property-information/lib/xmlns.js.map +1 -0
  365. package/dist/node_modules/react-markdown/lib/index.js +142 -0
  366. package/dist/node_modules/react-markdown/lib/index.js.map +1 -0
  367. package/dist/node_modules/rehype-sanitize/lib/index.js +11 -0
  368. package/dist/node_modules/rehype-sanitize/lib/index.js.map +1 -0
  369. package/dist/node_modules/remark-gfm/lib/index.js +12 -0
  370. package/dist/node_modules/remark-gfm/lib/index.js.map +1 -0
  371. package/dist/node_modules/remark-parse/lib/index.js +18 -0
  372. package/dist/node_modules/remark-parse/lib/index.js.map +1 -0
  373. package/dist/node_modules/remark-rehype/lib/index.js +20 -0
  374. package/dist/node_modules/remark-rehype/lib/index.js.map +1 -0
  375. package/dist/node_modules/space-separated-tokens/index.js +8 -0
  376. package/dist/node_modules/space-separated-tokens/index.js.map +1 -0
  377. package/dist/node_modules/style-to-js/cjs/index.js +21 -0
  378. package/dist/node_modules/style-to-js/cjs/index.js.map +1 -0
  379. package/dist/node_modules/style-to-js/cjs/utilities.js +20 -0
  380. package/dist/node_modules/style-to-js/cjs/utilities.js.map +1 -0
  381. package/dist/node_modules/style-to-object/cjs/index.js +25 -0
  382. package/dist/node_modules/style-to-object/cjs/index.js.map +1 -0
  383. package/dist/node_modules/trim-lines/index.js +23 -0
  384. package/dist/node_modules/trim-lines/index.js.map +1 -0
  385. package/dist/node_modules/trough/lib/index.js +52 -0
  386. package/dist/node_modules/trough/lib/index.js.map +1 -0
  387. package/dist/node_modules/unified/lib/callable-instance.js +11 -0
  388. package/dist/node_modules/unified/lib/callable-instance.js.map +1 -0
  389. package/dist/node_modules/unified/lib/index.js +163 -0
  390. package/dist/node_modules/unified/lib/index.js.map +1 -0
  391. package/dist/node_modules/unist-util-is/lib/index.js +49 -0
  392. package/dist/node_modules/unist-util-is/lib/index.js.map +1 -0
  393. package/dist/node_modules/unist-util-position/lib/index.js +24 -0
  394. package/dist/node_modules/unist-util-position/lib/index.js.map +1 -0
  395. package/dist/node_modules/unist-util-stringify-position/lib/index.js +17 -0
  396. package/dist/node_modules/unist-util-stringify-position/lib/index.js.map +1 -0
  397. package/dist/node_modules/unist-util-visit/lib/index.js +14 -0
  398. package/dist/node_modules/unist-util-visit/lib/index.js.map +1 -0
  399. package/dist/node_modules/unist-util-visit-parents/lib/color.js +8 -0
  400. package/dist/node_modules/unist-util-visit-parents/lib/color.js.map +1 -0
  401. package/dist/node_modules/unist-util-visit-parents/lib/index.js +38 -0
  402. package/dist/node_modules/unist-util-visit-parents/lib/index.js.map +1 -0
  403. package/dist/node_modules/vfile/lib/index.js +91 -0
  404. package/dist/node_modules/vfile/lib/index.js.map +1 -0
  405. package/dist/node_modules/vfile/lib/minpath.browser.js +101 -0
  406. package/dist/node_modules/vfile/lib/minpath.browser.js.map +1 -0
  407. package/dist/node_modules/vfile/lib/minproc.browser.js +9 -0
  408. package/dist/node_modules/vfile/lib/minproc.browser.js.map +1 -0
  409. package/dist/node_modules/vfile/lib/minurl.browser.js +33 -0
  410. package/dist/node_modules/vfile/lib/minurl.browser.js.map +1 -0
  411. package/dist/node_modules/vfile/lib/minurl.shared.js +8 -0
  412. package/dist/node_modules/vfile/lib/minurl.shared.js.map +1 -0
  413. package/dist/node_modules/vfile-message/lib/index.js +26 -0
  414. package/dist/node_modules/vfile-message/lib/index.js.map +1 -0
  415. package/dist/services/assistantApi.js +2 -2
  416. package/dist/services/assistantApi.js.map +1 -1
  417. package/dist/types/assistant.js.map +1 -1
  418. package/dist/utils/assistantAttachments.js +140 -0
  419. package/dist/utils/assistantAttachments.js.map +1 -0
  420. package/dist/utils/assistantContext.js +25 -0
  421. package/dist/utils/assistantContext.js.map +1 -0
  422. package/package.json +5 -2
  423. package/dist/utils/sanitizeUrl.js +0 -9
  424. package/dist/utils/sanitizeUrl.js.map +0 -1
@@ -2,49 +2,31 @@ import { useAssistantStore as e } from "../../store/assistantStore.js";
2
2
  import { useTr as t } from "../../shared/hooks/useTr.js";
3
3
  import { checkAssistantAiCredits as n, createAssistantSandbox as r, createAssistantSession as i, extendAssistantSandboxTTL as a, findExistingSandbox as o, getAssistantArtifacts as s, getAssistantMessages as c, getAssistantSession as l, reportAssistantAiTokenUsage as u, sendAssistantPromptAsync as d, waitForAssistantServiceReady as f, waitForSandboxReady as p } from "../../services/assistantApi.js";
4
4
  import { gatherPageContext as m } from "../../utils/pageContext.js";
5
- import { AssistantMessageList as h } from "./AssistantMessageList.js";
6
- import { AssistantApiCallsConsentDialog as g } from "./AssistantApiCallsConsentDialog.js";
7
- import { ASSISTANT_MODES as _ } from "../../types/assistant.js";
8
- import { AssistantEmptyState as v } from "./AssistantEmptyState.js";
9
- import { AssistantComposer as ee } from "./composer/AssistantComposer.js";
10
- import { useAssistantApiAccess as te } from "../../hooks/useAssistantApiAccess.js";
11
- import { isQuotaExhaustedError as y } from "../../utils/quotaUtils.js";
12
- import { dispatchAssistantQuotaExhausted as b, notifyAiCreditsUpdated as ne } from "../../utils/aiCredits.js";
13
- import { buildPromptForMode as re } from "../../utils/assistantPrompt.js";
14
- import { useCallback as x, useEffect as S, useMemo as ie, useRef as ae, useState as oe } from "react";
15
- import { jsx as C, jsxs as se } from "react/jsx-runtime";
16
- import { useGatewayClient as ce } from "@burdenoff/fe-libs/shared/graphql";
17
- import { useAuthToken as le } from "@burdenoff/fe-libs/shared/providers/shell";
5
+ import { getOrganizationId as h, getWorkspaceId as g } from "../../utils/assistantContext.js";
6
+ import { buildPromptParts as ee, buildPromptWithAttachments as te, toMessageAttachment as _ } from "../../utils/assistantAttachments.js";
7
+ import { AssistantMessageList as v } from "./AssistantMessageList.js";
8
+ import { AssistantApiCallsConsentDialog as y } from "./AssistantApiCallsConsentDialog.js";
9
+ import { ASSISTANT_MODES as b } from "../../types/assistant.js";
10
+ import { AssistantEmptyState as x } from "./AssistantEmptyState.js";
11
+ import { AssistantComposer as ne } from "./composer/AssistantComposer.js";
12
+ import { useAssistantApiAccess as re } from "../../hooks/useAssistantApiAccess.js";
13
+ import { isQuotaExhaustedError as ie } from "../../utils/quotaUtils.js";
14
+ import { dispatchAssistantQuotaExhausted as ae, notifyAiCreditsUpdated as oe } from "../../utils/aiCredits.js";
15
+ import { buildPromptForMode as se } from "../../utils/assistantPrompt.js";
16
+ import { useCallback as S, useEffect as C, useMemo as ce, useRef as w, useState as le } from "react";
17
+ import { jsx as T, jsxs as ue } from "react/jsx-runtime";
18
+ import { useGatewayClient as de } from "@burdenoff/fe-libs/shared/graphql";
19
+ import { useAuthToken as fe } from "@burdenoff/fe-libs/shared/providers/shell";
18
20
  //#region src/components/assistant/AssistantChatArea.tsx
19
- var ue = {
21
+ var pe = {
20
22
  general: 18e4,
21
23
  "api-calls": 18e4,
22
24
  "vibe-plugins": 6e5
23
- }, de = 18e4;
24
- function fe() {
25
+ }, me = 18e4;
26
+ function he() {
25
27
  return `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
26
28
  }
27
- function w(e) {
28
- try {
29
- let t = e === "workspaceId" ? "burdenoff-active-context-workspace" : "burdenoff-active-context-organization", n = sessionStorage.getItem(t);
30
- if (n) return n;
31
- let r = localStorage.getItem(t);
32
- if (r) return r;
33
- let i = sessionStorage.getItem("bf-active-profile");
34
- if (!i) return "";
35
- let a = localStorage.getItem(`bf-p-${i}-context`);
36
- return a ? JSON.parse(a)[e] ?? "" : "";
37
- } catch {
38
- return "";
39
- }
40
- }
41
- function pe() {
42
- return new URLSearchParams(window.location.search).get("workspace") ?? w("workspaceId");
43
- }
44
- function me() {
45
- return new URLSearchParams(window.location.search).get("org") ?? w("organizationId");
46
- }
47
- function he(e) {
29
+ function ge(e) {
48
30
  let t = e instanceof Error ? e.message.toLowerCase() : String(e).toLowerCase();
49
31
  return t.includes("rate limit exceeded") || t.includes("unauthorized") || t.includes("k8s api error 401") ? !1 : [
50
32
  "sandbox not found",
@@ -59,7 +41,7 @@ function he(e) {
59
41
  "session mode mismatch"
60
42
  ].some((e) => t.includes(e));
61
43
  }
62
- function T(e) {
44
+ function _e(e) {
63
45
  return e.replace(/(Authorization\s*:\s*Bearer\s+)[^\s\n]+/gi, "$1[REDACTED]").replace(/(X-Workspace-Authorization\s*:\s*Bearer\s+)[^\s\n]+/gi, "$1[REDACTED]").replace(/\beyJ[A-Za-z0-9_-]+\.[A-Za-z0-9._-]+\.[A-Za-z0-9._-]+\b/g, "[REDACTED_JWT]").replace(/\bsk-ant-[A-Za-z0-9-]+\b/g, "[REDACTED_API_KEY]");
64
46
  }
65
47
  function E(e) {
@@ -74,7 +56,7 @@ function O(e) {
74
56
  return t === "completed" ? `Completed: ${n}` : t === "failed" ? `Failed: ${n}` : `Running: ${n}`;
75
57
  });
76
58
  }
77
- function k(e, t) {
59
+ function ve(e, t) {
78
60
  let n = e.filter((e) => e.info?.role === "assistant" && E(e) > t).sort((e, t) => E(e) - E(t));
79
61
  if (n.length === 0) return {
80
62
  content: "Thinking...",
@@ -87,7 +69,7 @@ function k(e, t) {
87
69
  tokens: r.info?.tokens
88
70
  };
89
71
  }
90
- function ge(e) {
72
+ function ye(e) {
91
73
  switch (e) {
92
74
  case "provisioning": return "Starting assistant environment...";
93
75
  case "connecting": return "Connecting to assistant...";
@@ -95,146 +77,150 @@ function ge(e) {
95
77
  default: return "";
96
78
  }
97
79
  }
98
- var A = () => {
99
- let w = t(), D = ce("workspace"), { getAccessToken: O, getWorkspaceToken: A, userId: j } = le(), { conversations: _e, activeConversationId: M, mode: N, processingByConversationId: P, setMode: F, setConversationMode: I, setActiveConversation: ve, createConversation: L, addMessage: R, updateMessage: z, patchMessage: B, setConversationProcessing: V, clearConversationProcessing: ye, setBackendSessionId: H, clearBackendSessionId: U, setSandbox: W, clearSandbox: be, acknowledgeApiCalls: xe } = e(), G = _e.find((e) => e.id === M)?.messages ?? [], K = M ? P[M] : void 0, Se = K?.messageId ?? null, Ce = K?.status === "provisioning" || K?.status === "connecting" || K?.status === "streaming", we = K?.status === "error" ? K.messageId : null, { canUseApiCalls: q, loading: Te } = te(me()), Ee = ie(() => _.filter((e) => !e.requiresAdmin || q), [q]), [J, Y] = oe(null);
100
- S(() => {
101
- if (Te) return;
102
- let e = _.find((e) => e.id === N);
80
+ var k = () => {
81
+ let D = t(), O = de("workspace"), { getAccessToken: k, getWorkspaceToken: be, userId: A } = fe(), { conversations: j, activeConversationId: M, mode: N, processingByConversationId: P, setMode: F, setConversationMode: I, setActiveConversation: xe, createConversation: L, addMessage: R, updateMessage: z, patchMessage: B, setConversationProcessing: V, clearConversationProcessing: Se, setBackendSessionId: H, clearBackendSessionId: U, setSandbox: W, clearSandbox: Ce, acknowledgeApiCalls: we } = e(), G = j.find((e) => e.id === M)?.messages ?? [], K = M ? P[M] : void 0, Te = K?.messageId ?? null, Ee = K?.status === "provisioning" || K?.status === "connecting" || K?.status === "streaming", De = K?.status === "error" ? K.messageId : null, { canUseApiCalls: q, loading: Oe } = re(h()), ke = ce(() => b.filter((e) => !e.requiresAdmin || q), [q]), [J, Y] = le(null), Ae = w([]);
82
+ C(() => {
83
+ if (Oe) return;
84
+ let e = b.find((e) => e.id === N);
103
85
  (!e || e.requiresAdmin && !q) && N !== "general" && F("general");
104
86
  }, [
105
87
  N,
106
88
  q,
107
- Te,
89
+ Oe,
108
90
  F
109
91
  ]);
110
- let X = x((e, t, n, r) => {
111
- V(e, n, t, null), r ? z(e, t, r) : z(e, t, ge(n));
112
- }, [V, z]), De = x(async (t, n, a, s, c) => {
92
+ let X = S((e, t, n, r) => {
93
+ V(e, n, t, null), r ? z(e, t, r) : z(e, t, ye(n));
94
+ }, [V, z]), je = S(async (t, n, a, s, c) => {
113
95
  let u = e.getState().sandboxesByMode[a]?.sandboxId ?? null, d = async (e) => {
114
96
  try {
115
- return await p(D, e, s, c, 3e5, (e) => X(t, n, "provisioning", e)), await f(D, e, s, c, 9e4, (e) => X(t, n, "connecting", e)), !0;
97
+ return await p(O, e, s, c, 3e5, (e) => X(t, n, "provisioning", e)), await f(O, e, s, c, 9e4, (e) => X(t, n, "connecting", e)), !0;
116
98
  } catch {
117
99
  return !1;
118
100
  }
119
101
  };
120
102
  if (u && (W(a, u, "provisioning"), X(t, n, "provisioning", "Reusing assistant environment..."), await d(u) || (W(a, null, "provisioning"), u = null)), !u) {
121
103
  X(t, n, "provisioning", "Looking for existing environment...");
122
- let e = await o(D, s, a, c);
104
+ let e = await o(O, s, a, c);
123
105
  e && (W(a, e, "provisioning"), X(t, n, "provisioning", "Reusing assistant environment..."), await d(e) ? u = e : W(a, null, "provisioning"));
124
106
  }
125
107
  if (!u) {
126
- if (a === "api-calls" && !O()) throw Error("API Calls mode requires an authenticated session. Please sign in again.");
127
- X(t, n, "provisioning", "Starting assistant environment..."), W(a, null, "provisioning"), u = await r(D, a, s, c), W(a, u, "provisioning"), await p(D, u, s, c, 3e5, (e) => X(t, n, "provisioning", e)), await f(D, u, s, c, 9e4, (e) => X(t, n, "connecting", e));
108
+ if (a === "api-calls" && !k()) throw Error("API Calls mode requires an authenticated session. Please sign in again.");
109
+ X(t, n, "provisioning", "Starting assistant environment..."), W(a, null, "provisioning"), u = await r(O, a, s, c), W(a, u, "provisioning"), await p(O, u, s, c, 3e5, (e) => X(t, n, "provisioning", e)), await f(O, u, s, c, 9e4, (e) => X(t, n, "connecting", e));
128
110
  }
129
111
  W(a, u, "running");
130
112
  let m = e.getState().conversations.find((e) => e.id === t)?.backendSessionId ?? null;
131
113
  if (m) try {
132
- let e = await l(D, u, s, m, c);
114
+ let e = await l(O, u, s, m, c);
133
115
  if (e.mode !== a) throw Error(`Session mode mismatch: expected ${a}, received ${e.mode}`);
134
116
  } catch {
135
117
  U(t), m = null;
136
118
  }
137
- return m || (X(t, n, "connecting", "Preparing session..."), m = (await i(D, u, s, a, c)).sessionId, H(t, m)), {
119
+ return m || (X(t, n, "connecting", "Preparing session..."), m = (await i(O, u, s, a, c)).sessionId, H(t, m)), {
138
120
  sandboxId: u,
139
121
  sessionId: m
140
122
  };
141
123
  }, [
142
- D,
143
- U,
144
124
  O,
125
+ U,
126
+ k,
145
127
  H,
146
128
  W,
147
129
  X
148
- ]), Z = x(async (t) => {
130
+ ]), Z = S(async (t, r = []) => {
149
131
  if (M) {
150
132
  let e = P[M]?.status;
151
133
  if (e === "provisioning" || e === "connecting" || e === "streaming") return;
152
134
  }
153
- let r = e.getState().mode, i = M, o = i ? e.getState().conversations.find((e) => e.id === i) : void 0;
154
- if (i ? o && o.mode !== r && (o.messages.length > 0 || o.backendSessionId) ? i = L(void 0, r) : o && o.mode !== r && I(i, r) : i = L(void 0, r), !i) return;
155
- let l = pe(), f = {
156
- accessToken: O(),
157
- workspaceToken: A(),
158
- userId: j,
159
- organizationId: me()
160
- }, p = {
161
- id: fe(),
135
+ let i = e.getState().mode, o = M, l = o ? e.getState().conversations.find((e) => e.id === o) : void 0;
136
+ if (o ? l && l.mode !== i && (l.messages.length > 0 || l.backendSessionId) ? o = L(void 0, i) : l && l.mode !== i && I(o, i) : o = L(void 0, i), !o) return;
137
+ Ae.current = r;
138
+ let f = g(), p = {
139
+ accessToken: k(),
140
+ workspaceToken: be(),
141
+ userId: A,
142
+ organizationId: h()
143
+ }, v = {
144
+ id: he(),
162
145
  role: "user",
163
146
  content: t,
164
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
147
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
148
+ metadata: r.length ? { attachments: r.map(_) } : void 0
165
149
  };
166
- R(i, p);
167
- let h = fe();
168
- R(i, {
169
- id: h,
150
+ R(o, v);
151
+ let y = he();
152
+ R(o, {
153
+ id: y,
170
154
  role: "assistant",
171
155
  content: "",
172
156
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
173
157
  });
174
- let g = (e, t, n, a) => {
175
- B(i, h, {
176
- content: T(e),
177
- metadata: t?.length || n || a ? {
158
+ let b = (e, t, n, r) => {
159
+ B(o, y, {
160
+ content: _e(e),
161
+ metadata: t?.length || n || r ? {
178
162
  artifacts: t,
179
- mode: r,
163
+ mode: i,
180
164
  sessionId: n,
181
- sandboxId: a
165
+ sandboxId: r
182
166
  } : void 0
183
167
  });
184
- }, _ = async (e = 1) => {
168
+ }, x = async (e = 1) => {
185
169
  try {
186
- await n(D, l, f);
170
+ await n(O, f, p);
187
171
  } catch (e) {
188
- if (y(e)) {
189
- b("ai-credits"), g("You've run out of AI credits for this billing cycle. Upgrade your plan to keep chatting."), V(i, "error", h, null);
172
+ if (ie(e)) {
173
+ ae("ai-credits"), b("You've run out of AI credits for this billing cycle. Upgrade your plan to keep chatting."), V(o, "error", y, null);
190
174
  return;
191
175
  }
192
176
  console.warn("[assistant] AI-credit pre-flight check failed with a non-quota error; proceeding — gateway @usage(checkQuota) still enforces the real budget downstream", e);
193
177
  }
194
178
  try {
195
- let { sandboxId: e, sessionId: n } = await De(i, h, r, l, f), o = (await c(D, e, l, n, f, 50).catch(() => [])).reduce((e, t) => Math.max(e, E(t)), 0);
196
- X(i, h, "streaming", "Thinking..."), await d(D, e, l, n, re(r, t), r, m(), f);
197
- let p = k([], o), _ = Date.now() + (ue[r] ?? de), v = Date.now();
198
- for (; Date.now() < _ && (p = k(await c(D, e, l, n, f, 50), o), B(i, h, { content: T(p.content) }), !p.done);) Date.now() - v > 3e4 && (await a(D, e, l, 600, f).catch(() => void 0), v = Date.now()), await new Promise((e) => setTimeout(e, 1500));
199
- if (!p.done && r !== "vibe-plugins") throw Error("Assistant response timed out while streaming progress");
200
- let ee = r === "vibe-plugins" ? await s(D, e, l, n, f).catch(() => []) : void 0;
201
- if (p.done || (p = {
202
- ...p,
203
- content: `${p.content}\n\n_Still building in the background — any artifacts below will finish shortly. Re-open this conversation to pick up the completed plugin._`
204
- }), g(p.content, ee, n, e), p.tokens) {
205
- B(i, h, { tokens: p.tokens });
179
+ let { sandboxId: e, sessionId: n } = await je(o, y, i, f, p), l = (await c(O, e, f, n, p, 50).catch(() => [])).reduce((e, t) => Math.max(e, E(t)), 0);
180
+ X(o, y, "streaming", "Thinking...");
181
+ let h = se(i, te(t, r));
182
+ await d(O, e, f, n, h, i, m(), p, ee(h, r));
183
+ let g = ve([], l), _ = Date.now() + (pe[i] ?? me), v = Date.now();
184
+ for (; Date.now() < _ && (g = ve(await c(O, e, f, n, p, 50), l), B(o, y, { content: _e(g.content) }), !g.done);) Date.now() - v > 3e4 && (await a(O, e, f, 600, p).catch(() => void 0), v = Date.now()), await new Promise((e) => setTimeout(e, 1500));
185
+ if (!g.done && i !== "vibe-plugins") throw Error("Assistant response timed out while streaming progress");
186
+ let x = i === "vibe-plugins" ? await s(O, e, f, n, p).catch(() => []) : void 0;
187
+ if (g.done || (g = {
188
+ ...g,
189
+ content: `${g.content}\n\n_Still building in the background — any artifacts below will finish shortly. Re-open this conversation to pick up the completed plugin._`
190
+ }), b(g.content, x, n, e), g.tokens) {
191
+ B(o, y, { tokens: g.tokens });
206
192
  try {
207
- await u(D, l, n, p.tokens, f), ne();
193
+ await u(O, f, n, g.tokens, p), oe();
208
194
  } catch {}
209
195
  }
210
- V(i, "complete", h, null);
196
+ V(o, "complete", y, null);
211
197
  } catch (t) {
212
- if (e === 1 && he(t)) return U(i), be(r), _(2);
198
+ if (e === 1 && ge(t)) return U(o), Ce(i), x(2);
213
199
  throw t;
214
200
  }
215
201
  };
216
202
  try {
217
- if (!l) throw Error("Assistant backend is unavailable without an active workspace context.");
218
- await _();
203
+ if (!f) throw Error("Assistant backend is unavailable without an active workspace context.");
204
+ await x();
219
205
  } catch (e) {
220
- if (y(e)) {
221
- b("sandbox"), g("You've reached your sandbox limit on the current plan. Upgrade to start the AI assistant."), V(i, "error", h, null);
206
+ if (ie(e)) {
207
+ ae("sandbox"), b("You've reached your sandbox limit on the current plan. Upgrade to start the AI assistant."), V(o, "error", y, null);
222
208
  return;
223
209
  }
224
210
  let t = e instanceof Error ? e.message : "Something went wrong";
225
- V(i, "error", h, t), z(i, h, `Sorry, an error occurred: ${t}. Please try again.`);
211
+ V(o, "error", y, t), z(o, y, `Sorry, an error occurred: ${t}. Please try again.`);
226
212
  }
227
213
  }, [
228
214
  M,
229
215
  R,
230
- D,
216
+ O,
231
217
  U,
232
- be,
233
- _e,
218
+ Ce,
219
+ j,
234
220
  L,
235
- De,
236
- O,
237
- A,
221
+ je,
222
+ k,
223
+ be,
238
224
  B,
239
225
  P,
240
226
  H,
@@ -242,16 +228,16 @@ var A = () => {
242
228
  V,
243
229
  X,
244
230
  z,
245
- j
246
- ]), Oe = x((e) => {
231
+ A
232
+ ]), Me = S((e) => {
247
233
  Z(e);
248
- }, [Z]), ke = x(() => {
234
+ }, [Z]), Ne = S(() => {
249
235
  let e = [...G].reverse().find((e) => e.role === "user");
250
- e && Z(e.content);
251
- }, [G, Z]), Q = ae(Z);
252
- S(() => {
236
+ e && Z(e.content, Ae.current);
237
+ }, [G, Z]), Q = w(Z);
238
+ C(() => {
253
239
  Q.current = Z;
254
- }, [Z]), S(() => {
240
+ }, [Z]), C(() => {
255
241
  let t = e.getState().consumePendingPrompt();
256
242
  return t && Q.current(t), e.subscribe((t, n) => {
257
243
  if (t.pendingPrompt && t.pendingPrompt !== n.pendingPrompt) {
@@ -260,69 +246,69 @@ var A = () => {
260
246
  }
261
247
  });
262
248
  }, []);
263
- let $ = x((t) => {
249
+ let $ = S((t) => {
264
250
  let n = M ? e.getState().conversations.find((e) => e.id === M) : void 0;
265
251
  if (n && (n.messages.length > 0 || n.backendSessionId)) {
266
252
  if (n.mode !== t) {
267
253
  let n = e.getState().conversations.find((n) => n.mode === t && n.messages.length === 0 && !n.backendSessionId && !e.getState().processingByConversationId[n.id]);
268
- n ? ve(n.id) : L(void 0, t);
254
+ n ? xe(n.id) : L(void 0, t);
269
255
  }
270
256
  } else M && I(M, t);
271
257
  F(t);
272
258
  }, [
273
259
  M,
274
260
  L,
275
- ve,
261
+ xe,
276
262
  I,
277
263
  F
278
- ]), Ae = x((t) => {
279
- if (_.find((e) => e.id === t)?.writeCapable && !e.getState().apiCallsAcknowledged) {
264
+ ]), Pe = S((t) => {
265
+ if (b.find((e) => e.id === t)?.writeCapable && !e.getState().apiCallsAcknowledged) {
280
266
  Y(t);
281
267
  return;
282
268
  }
283
269
  $(t);
284
- }, [$]), je = x(() => {
270
+ }, [$]), Fe = S(() => {
285
271
  let e = J;
286
- Y(null), xe(), e && $(e);
272
+ Y(null), we(), e && $(e);
287
273
  }, [
288
274
  J,
289
- xe,
275
+ we,
290
276
  $
291
- ]), Me = x(() => {
277
+ ]), Ie = S(() => {
292
278
  Y(null);
293
279
  }, []);
294
- return /* @__PURE__ */ se("div", {
280
+ return /* @__PURE__ */ ue("div", {
295
281
  className: "flex flex-1 flex-col overflow-hidden",
296
282
  children: [
297
- G.length === 0 ? /* @__PURE__ */ C(v, {
283
+ G.length === 0 ? /* @__PURE__ */ T(x, {
298
284
  mode: N,
299
- onSuggestionClick: Oe
300
- }) : /* @__PURE__ */ C("div", {
285
+ onSuggestionClick: Me
286
+ }) : /* @__PURE__ */ T("div", {
301
287
  className: "flex min-h-0 flex-1 flex-col",
302
- children: /* @__PURE__ */ C(h, {
288
+ children: /* @__PURE__ */ T(v, {
303
289
  messages: G,
304
- streamingMessageId: Se,
305
- failedMessageId: we,
306
- onRetry: ke
290
+ streamingMessageId: Te,
291
+ failedMessageId: De,
292
+ onRetry: Ne
307
293
  })
308
294
  }),
309
- /* @__PURE__ */ C(ee, {
310
- onSend: (e) => void Z(e),
311
- disabled: Ce,
312
- placeholder: N === "api-calls" ? w("healthybowl.assistant.chatArea.placeholderActions", "What would you like me to do?") : w("healthybowl.assistant.chatArea.placeholderGeneral", "Ask HealthyBowl anything…"),
295
+ /* @__PURE__ */ T(ne, {
296
+ onSend: (e, t) => void Z(e, t),
297
+ disabled: Ee,
298
+ placeholder: N === "api-calls" ? D("healthybowl.assistant.chatArea.placeholderActions", "What would you like me to do?") : D("healthybowl.assistant.chatArea.placeholderGeneral", "Ask HealthyBowl anything…"),
313
299
  mode: N,
314
- availableModes: Ee,
315
- onModeChange: Ae
300
+ availableModes: ke,
301
+ onModeChange: Pe
316
302
  }),
317
- /* @__PURE__ */ C(g, {
303
+ /* @__PURE__ */ T(y, {
318
304
  open: J !== null,
319
- onConfirm: je,
320
- onCancel: Me
305
+ onConfirm: Fe,
306
+ onCancel: Ie
321
307
  })
322
308
  ]
323
309
  });
324
310
  };
325
311
  //#endregion
326
- export { A as AssistantChatArea };
312
+ export { k as AssistantChatArea };
327
313
 
328
314
  //# sourceMappingURL=AssistantChatArea.js.map