@agent-native/core 0.76.3 → 0.76.5

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 (435) hide show
  1. package/corpus/core/CHANGELOG.md +25 -0
  2. package/corpus/core/package.json +1 -1
  3. package/corpus/core/src/agent/production-agent.ts +147 -56
  4. package/corpus/core/src/agent/run-store.ts +36 -0
  5. package/corpus/core/src/client/AgentPanel.tsx +3 -3
  6. package/corpus/core/src/client/AgentTaskCard.tsx +2 -1
  7. package/corpus/core/src/client/AppearancePicker.tsx +1 -1
  8. package/corpus/core/src/client/AssistantChat.tsx +3 -3
  9. package/corpus/core/src/client/CommandMenu.tsx +4 -4
  10. package/corpus/core/src/client/ErrorBoundary.tsx +1 -1
  11. package/corpus/core/src/client/MultiTabAssistantChat.tsx +11 -11
  12. package/corpus/core/src/client/NewWorkspaceAppFlow.tsx +5 -5
  13. package/corpus/core/src/client/components/ui/dropdown-menu.tsx +9 -9
  14. package/corpus/core/src/client/components/ui/sheet.tsx +1 -1
  15. package/corpus/core/src/client/composer/ComposerPlusMenu.tsx +6 -6
  16. package/corpus/core/src/client/composer/MentionPopover.tsx +4 -4
  17. package/corpus/core/src/client/composer/PastedTextChip.tsx +3 -3
  18. package/corpus/core/src/client/composer/PromptComposer.tsx +3 -3
  19. package/corpus/core/src/client/composer/TiptapComposer.tsx +16 -16
  20. package/corpus/core/src/client/guided-questions.tsx +6 -8
  21. package/corpus/core/src/client/i18n.tsx +2 -2
  22. package/corpus/core/src/client/integrations/IntegrationCard.tsx +2 -2
  23. package/corpus/core/src/client/integrations/IntegrationsPanel.tsx +4 -4
  24. package/corpus/core/src/client/notifications/NotificationsBell.tsx +3 -3
  25. package/corpus/core/src/client/onboarding/OnboardingBanner.tsx +3 -3
  26. package/corpus/core/src/client/onboarding/OnboardingPanel.tsx +17 -10
  27. package/corpus/core/src/client/org/OrgSwitcher.tsx +13 -11
  28. package/corpus/core/src/client/org/TeamPage.tsx +2 -2
  29. package/corpus/core/src/client/settings/AgentsSection.tsx +3 -3
  30. package/corpus/core/src/client/settings/AutomationsSection.tsx +3 -3
  31. package/corpus/core/src/client/settings/SecretsSection.tsx +2 -2
  32. package/corpus/core/src/client/settings/SettingsPanel.tsx +5 -7
  33. package/corpus/core/src/client/settings/SettingsSection.tsx +1 -1
  34. package/corpus/core/src/client/settings/UsageSection.tsx +3 -3
  35. package/corpus/core/src/client/settings/VoiceTranscriptionSection.tsx +3 -3
  36. package/corpus/core/src/client/sharing/ShareButton.tsx +7 -7
  37. package/corpus/core/src/client/sharing/ShareDialog.tsx +3 -3
  38. package/corpus/core/src/deploy/build.ts +31 -14
  39. package/corpus/core/src/styles/agent-conversation.css +10 -10
  40. package/corpus/core/src/styles/blocks.css +2 -2
  41. package/corpus/core/src/styles/rich-markdown-editor.css +2 -2
  42. package/corpus/templates/analytics/app/components/layout/MobileNav.tsx +1 -1
  43. package/corpus/templates/analytics/app/components/ui/alert-dialog.tsx +1 -1
  44. package/corpus/templates/analytics/app/components/ui/alert.tsx +1 -1
  45. package/corpus/templates/analytics/app/components/ui/breadcrumb.tsx +1 -1
  46. package/corpus/templates/analytics/app/components/ui/calendar.tsx +6 -6
  47. package/corpus/templates/analytics/app/components/ui/carousel.tsx +6 -6
  48. package/corpus/templates/analytics/app/components/ui/command.tsx +2 -2
  49. package/corpus/templates/analytics/app/components/ui/context-menu.tsx +9 -9
  50. package/corpus/templates/analytics/app/components/ui/date-picker.tsx +1 -1
  51. package/corpus/templates/analytics/app/components/ui/dialog.tsx +2 -2
  52. package/corpus/templates/analytics/app/components/ui/drawer.tsx +1 -1
  53. package/corpus/templates/analytics/app/components/ui/dropdown-menu.tsx +9 -9
  54. package/corpus/templates/analytics/app/components/ui/input-otp.tsx +1 -1
  55. package/corpus/templates/analytics/app/components/ui/menubar.tsx +9 -9
  56. package/corpus/templates/analytics/app/components/ui/navigation-menu.tsx +3 -3
  57. package/corpus/templates/analytics/app/components/ui/pagination.tsx +4 -4
  58. package/corpus/templates/analytics/app/components/ui/scroll-area.tsx +1 -1
  59. package/corpus/templates/analytics/app/components/ui/select.tsx +3 -3
  60. package/corpus/templates/analytics/app/components/ui/sheet.tsx +2 -2
  61. package/corpus/templates/analytics/app/components/ui/sidebar.tsx +6 -6
  62. package/corpus/templates/analytics/app/components/ui/table.tsx +2 -2
  63. package/corpus/templates/analytics/app/components/ui/toast.tsx +3 -3
  64. package/corpus/templates/assets/app/components/layout/Layout.tsx +2 -2
  65. package/corpus/templates/assets/app/components/layout/Sidebar.tsx +12 -12
  66. package/corpus/templates/assets/app/components/ui/alert-dialog.tsx +1 -1
  67. package/corpus/templates/assets/app/components/ui/alert.tsx +1 -1
  68. package/corpus/templates/assets/app/components/ui/breadcrumb.tsx +1 -1
  69. package/corpus/templates/assets/app/components/ui/dialog.tsx +2 -2
  70. package/corpus/templates/assets/app/components/ui/dropdown-menu.tsx +9 -9
  71. package/corpus/templates/assets/app/components/ui/pagination.tsx +4 -4
  72. package/corpus/templates/assets/app/components/ui/scroll-area.tsx +1 -1
  73. package/corpus/templates/assets/app/components/ui/select.tsx +3 -3
  74. package/corpus/templates/assets/app/components/ui/sheet.tsx +2 -2
  75. package/corpus/templates/assets/app/components/ui/table.tsx +2 -2
  76. package/corpus/templates/assets/app/routes/library.tsx +3 -3
  77. package/corpus/templates/assets/app/routes/settings.tsx +1 -1
  78. package/corpus/templates/brain/app/components/layout/Sidebar.tsx +5 -5
  79. package/corpus/templates/brain/app/components/ui/dropdown-menu.tsx +9 -9
  80. package/corpus/templates/brain/app/components/ui/select.tsx +3 -3
  81. package/corpus/templates/brain/app/components/ui/sheet.tsx +2 -2
  82. package/corpus/templates/brain/app/components/ui/table.tsx +2 -2
  83. package/corpus/templates/calendar/app/components/calendar/GoogleConnectBanner.tsx +6 -6
  84. package/corpus/templates/calendar/app/components/calendar/GoogleSetupWizard.tsx +3 -3
  85. package/corpus/templates/calendar/app/components/layout/Sidebar.tsx +11 -9
  86. package/corpus/templates/calendar/app/components/ui/alert-dialog.tsx +1 -1
  87. package/corpus/templates/calendar/app/components/ui/alert.tsx +1 -1
  88. package/corpus/templates/calendar/app/components/ui/breadcrumb.tsx +1 -1
  89. package/corpus/templates/calendar/app/components/ui/calendar.tsx +5 -5
  90. package/corpus/templates/calendar/app/components/ui/carousel.tsx +6 -6
  91. package/corpus/templates/calendar/app/components/ui/command.tsx +2 -2
  92. package/corpus/templates/calendar/app/components/ui/context-menu.tsx +9 -9
  93. package/corpus/templates/calendar/app/components/ui/dialog.tsx +2 -2
  94. package/corpus/templates/calendar/app/components/ui/drawer.tsx +1 -1
  95. package/corpus/templates/calendar/app/components/ui/dropdown-menu.tsx +9 -9
  96. package/corpus/templates/calendar/app/components/ui/input-otp.tsx +1 -1
  97. package/corpus/templates/calendar/app/components/ui/menubar.tsx +9 -9
  98. package/corpus/templates/calendar/app/components/ui/navigation-menu.tsx +3 -3
  99. package/corpus/templates/calendar/app/components/ui/pagination.tsx +4 -4
  100. package/corpus/templates/calendar/app/components/ui/scroll-area.tsx +1 -1
  101. package/corpus/templates/calendar/app/components/ui/select.tsx +3 -3
  102. package/corpus/templates/calendar/app/components/ui/sheet.tsx +2 -2
  103. package/corpus/templates/calendar/app/components/ui/sidebar.tsx +6 -6
  104. package/corpus/templates/calendar/app/components/ui/sonner.tsx +1 -1
  105. package/corpus/templates/calendar/app/components/ui/table.tsx +2 -2
  106. package/corpus/templates/calendar/app/components/ui/toast.tsx +3 -3
  107. package/corpus/templates/calendar/app/pages/Settings.tsx +5 -5
  108. package/corpus/templates/chat/app/components/layout/Sidebar.tsx +9 -9
  109. package/corpus/templates/chat/app/components/ui/alert-dialog.tsx +1 -1
  110. package/corpus/templates/chat/app/components/ui/alert.tsx +1 -1
  111. package/corpus/templates/chat/app/components/ui/breadcrumb.tsx +1 -1
  112. package/corpus/templates/chat/app/components/ui/calendar.tsx +5 -5
  113. package/corpus/templates/chat/app/components/ui/carousel.tsx +6 -6
  114. package/corpus/templates/chat/app/components/ui/command.tsx +2 -2
  115. package/corpus/templates/chat/app/components/ui/context-menu.tsx +9 -9
  116. package/corpus/templates/chat/app/components/ui/dialog.tsx +2 -2
  117. package/corpus/templates/chat/app/components/ui/drawer.tsx +1 -1
  118. package/corpus/templates/chat/app/components/ui/dropdown-menu.tsx +9 -9
  119. package/corpus/templates/chat/app/components/ui/input-otp.tsx +1 -1
  120. package/corpus/templates/chat/app/components/ui/menubar.tsx +9 -9
  121. package/corpus/templates/chat/app/components/ui/navigation-menu.tsx +3 -3
  122. package/corpus/templates/chat/app/components/ui/pagination.tsx +4 -4
  123. package/corpus/templates/chat/app/components/ui/scroll-area.tsx +1 -1
  124. package/corpus/templates/chat/app/components/ui/select.tsx +3 -3
  125. package/corpus/templates/chat/app/components/ui/sheet.tsx +2 -2
  126. package/corpus/templates/chat/app/components/ui/sidebar.tsx +6 -6
  127. package/corpus/templates/chat/app/components/ui/table.tsx +2 -2
  128. package/corpus/templates/chat/app/components/ui/toast.tsx +3 -3
  129. package/corpus/templates/clips/app/components/capture-install-options.tsx +3 -3
  130. package/corpus/templates/clips/app/components/editable-recording-title.tsx +1 -1
  131. package/corpus/templates/clips/app/components/library/bulk-action-toolbar.tsx +3 -3
  132. package/corpus/templates/clips/app/components/library/folder-tree.tsx +5 -5
  133. package/corpus/templates/clips/app/components/library/library-layout.tsx +3 -3
  134. package/corpus/templates/clips/app/components/library/organization-switcher.tsx +4 -4
  135. package/corpus/templates/clips/app/components/library/recording-card.tsx +11 -11
  136. package/corpus/templates/clips/app/components/library/search-bar.tsx +4 -4
  137. package/corpus/templates/clips/app/components/library/space-card.tsx +1 -1
  138. package/corpus/templates/clips/app/components/library/tag-input.tsx +1 -1
  139. package/corpus/templates/clips/app/components/meetings/quick-ask-sidebar.tsx +2 -2
  140. package/corpus/templates/clips/app/components/recorder/camera-visualizer.tsx +2 -2
  141. package/corpus/templates/clips/app/components/recorder/microphone-visualizer.tsx +1 -1
  142. package/corpus/templates/clips/app/components/recorder/pre-record-panel.tsx +4 -4
  143. package/corpus/templates/clips/app/components/recorder/storage-setup-card.tsx +1 -1
  144. package/corpus/templates/clips/app/components/sharing/share-ui.tsx +2 -2
  145. package/corpus/templates/clips/app/components/ui/alert-dialog.tsx +1 -1
  146. package/corpus/templates/clips/app/components/ui/alert.tsx +1 -1
  147. package/corpus/templates/clips/app/components/ui/breadcrumb.tsx +1 -1
  148. package/corpus/templates/clips/app/components/ui/calendar.tsx +5 -5
  149. package/corpus/templates/clips/app/components/ui/carousel.tsx +6 -6
  150. package/corpus/templates/clips/app/components/ui/command.tsx +2 -2
  151. package/corpus/templates/clips/app/components/ui/context-menu.tsx +9 -9
  152. package/corpus/templates/clips/app/components/ui/dialog.tsx +2 -2
  153. package/corpus/templates/clips/app/components/ui/drawer.tsx +1 -1
  154. package/corpus/templates/clips/app/components/ui/dropdown-menu.tsx +9 -9
  155. package/corpus/templates/clips/app/components/ui/input-otp.tsx +1 -1
  156. package/corpus/templates/clips/app/components/ui/menubar.tsx +9 -9
  157. package/corpus/templates/clips/app/components/ui/navigation-menu.tsx +3 -3
  158. package/corpus/templates/clips/app/components/ui/pagination.tsx +4 -4
  159. package/corpus/templates/clips/app/components/ui/scroll-area.tsx +1 -1
  160. package/corpus/templates/clips/app/components/ui/select.tsx +3 -3
  161. package/corpus/templates/clips/app/components/ui/sheet.tsx +2 -2
  162. package/corpus/templates/clips/app/components/ui/sidebar.tsx +6 -6
  163. package/corpus/templates/clips/app/components/ui/table.tsx +2 -2
  164. package/corpus/templates/clips/app/components/ui/toast.tsx +3 -3
  165. package/corpus/templates/clips/app/components/workspace/branding-editor.tsx +1 -1
  166. package/corpus/templates/clips/app/components/workspace/insights-hub.tsx +2 -2
  167. package/corpus/templates/clips/app/components/workspace/invite-dialog.tsx +2 -2
  168. package/corpus/templates/clips/app/components/workspace/top-creators-table.tsx +6 -6
  169. package/corpus/templates/clips/app/components/workspace/top-videos-table.tsx +2 -2
  170. package/corpus/templates/clips/app/routes/_app.dictate.tsx +4 -4
  171. package/corpus/templates/clips/app/routes/_app.meetings._index.tsx +7 -7
  172. package/corpus/templates/clips/app/routes/_app.settings._index.tsx +1 -1
  173. package/corpus/templates/clips/app/routes/download.tsx +2 -2
  174. package/corpus/templates/clips/app/routes/invite.$token.tsx +2 -2
  175. package/corpus/templates/clips/app/routes/r.$recordingId.tsx +3 -3
  176. package/corpus/templates/clips/app/routes/record.tsx +5 -5
  177. package/corpus/templates/clips/app/routes/share.$shareId.tsx +7 -7
  178. package/corpus/templates/content/app/components/EmptyState.tsx +1 -1
  179. package/corpus/templates/content/app/components/editor/DocumentToolbar.tsx +17 -17
  180. package/corpus/templates/content/app/components/layout/Layout.tsx +2 -2
  181. package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +10 -9
  182. package/corpus/templates/content/app/components/sidebar/DocumentTreeItem.tsx +10 -6
  183. package/corpus/templates/content/app/components/sidebar/NotionButton.tsx +3 -3
  184. package/corpus/templates/content/app/components/ui/alert-dialog.tsx +1 -1
  185. package/corpus/templates/content/app/components/ui/dialog.tsx +2 -2
  186. package/corpus/templates/content/app/components/ui/dropdown-menu.tsx +9 -9
  187. package/corpus/templates/content/app/components/ui/scroll-area.tsx +1 -1
  188. package/corpus/templates/content/app/components/ui/sheet.tsx +2 -2
  189. package/corpus/templates/content/app/components/ui/table.tsx +2 -2
  190. package/corpus/templates/content/app/components/ui/toast.tsx +3 -3
  191. package/corpus/templates/design/app/components/layout/Layout.tsx +3 -3
  192. package/corpus/templates/design/app/components/layout/Sidebar.tsx +3 -3
  193. package/corpus/templates/design/app/components/ui/alert-dialog.tsx +1 -1
  194. package/corpus/templates/design/app/components/ui/alert.tsx +1 -1
  195. package/corpus/templates/design/app/components/ui/breadcrumb.tsx +1 -1
  196. package/corpus/templates/design/app/components/ui/calendar.tsx +5 -5
  197. package/corpus/templates/design/app/components/ui/carousel.tsx +6 -6
  198. package/corpus/templates/design/app/components/ui/command.tsx +2 -2
  199. package/corpus/templates/design/app/components/ui/context-menu.tsx +9 -9
  200. package/corpus/templates/design/app/components/ui/dialog.tsx +2 -2
  201. package/corpus/templates/design/app/components/ui/drawer.tsx +1 -1
  202. package/corpus/templates/design/app/components/ui/dropdown-menu.tsx +9 -9
  203. package/corpus/templates/design/app/components/ui/input-otp.tsx +1 -1
  204. package/corpus/templates/design/app/components/ui/menubar.tsx +9 -9
  205. package/corpus/templates/design/app/components/ui/navigation-menu.tsx +3 -3
  206. package/corpus/templates/design/app/components/ui/pagination.tsx +4 -4
  207. package/corpus/templates/design/app/components/ui/scroll-area.tsx +1 -1
  208. package/corpus/templates/design/app/components/ui/select.tsx +3 -3
  209. package/corpus/templates/design/app/components/ui/sheet.tsx +2 -2
  210. package/corpus/templates/design/app/components/ui/sidebar.tsx +6 -6
  211. package/corpus/templates/design/app/components/ui/table.tsx +2 -2
  212. package/corpus/templates/design/app/components/ui/toast.tsx +3 -3
  213. package/corpus/templates/design/app/pages/DesignSystems.tsx +6 -8
  214. package/corpus/templates/design/app/pages/Index.tsx +8 -8
  215. package/corpus/templates/design/app/pages/NotFound.tsx +1 -1
  216. package/corpus/templates/design/app/pages/Templates.tsx +2 -2
  217. package/corpus/templates/forms/app/components/layout/Sidebar.tsx +3 -3
  218. package/corpus/templates/forms/app/components/ui/alert-dialog.tsx +1 -1
  219. package/corpus/templates/forms/app/components/ui/alert.tsx +1 -1
  220. package/corpus/templates/forms/app/components/ui/breadcrumb.tsx +1 -1
  221. package/corpus/templates/forms/app/components/ui/calendar.tsx +9 -6
  222. package/corpus/templates/forms/app/components/ui/carousel.tsx +6 -6
  223. package/corpus/templates/forms/app/components/ui/command.tsx +2 -2
  224. package/corpus/templates/forms/app/components/ui/context-menu.tsx +9 -9
  225. package/corpus/templates/forms/app/components/ui/dialog.tsx +2 -2
  226. package/corpus/templates/forms/app/components/ui/drawer.tsx +1 -1
  227. package/corpus/templates/forms/app/components/ui/dropdown-menu.tsx +9 -9
  228. package/corpus/templates/forms/app/components/ui/input-otp.tsx +1 -1
  229. package/corpus/templates/forms/app/components/ui/menubar.tsx +9 -9
  230. package/corpus/templates/forms/app/components/ui/navigation-menu.tsx +3 -3
  231. package/corpus/templates/forms/app/components/ui/pagination.tsx +4 -4
  232. package/corpus/templates/forms/app/components/ui/scroll-area.tsx +1 -1
  233. package/corpus/templates/forms/app/components/ui/select.tsx +3 -3
  234. package/corpus/templates/forms/app/components/ui/sheet.tsx +2 -2
  235. package/corpus/templates/forms/app/components/ui/sidebar.tsx +6 -6
  236. package/corpus/templates/forms/app/components/ui/table.tsx +2 -2
  237. package/corpus/templates/forms/app/components/ui/toast.tsx +3 -3
  238. package/corpus/templates/forms/app/pages/FormBuilderPage.tsx +18 -18
  239. package/corpus/templates/forms/app/pages/FormsListPage.tsx +9 -9
  240. package/corpus/templates/macros/app/components/layout/AppLayout.tsx +4 -4
  241. package/corpus/templates/macros/app/components/ui/alert-dialog.tsx +1 -1
  242. package/corpus/templates/macros/app/components/ui/alert.tsx +1 -1
  243. package/corpus/templates/macros/app/components/ui/breadcrumb.tsx +1 -1
  244. package/corpus/templates/macros/app/components/ui/command.tsx +2 -2
  245. package/corpus/templates/macros/app/components/ui/context-menu.tsx +9 -9
  246. package/corpus/templates/macros/app/components/ui/dialog.tsx +2 -2
  247. package/corpus/templates/macros/app/components/ui/drawer.tsx +1 -1
  248. package/corpus/templates/macros/app/components/ui/dropdown-menu.tsx +9 -9
  249. package/corpus/templates/macros/app/components/ui/menubar.tsx +9 -9
  250. package/corpus/templates/macros/app/components/ui/navigation-menu.tsx +3 -3
  251. package/corpus/templates/macros/app/components/ui/pagination.tsx +4 -4
  252. package/corpus/templates/macros/app/components/ui/scroll-area.tsx +1 -1
  253. package/corpus/templates/macros/app/components/ui/select.tsx +3 -3
  254. package/corpus/templates/macros/app/components/ui/sheet.tsx +2 -2
  255. package/corpus/templates/macros/app/components/ui/table.tsx +2 -2
  256. package/corpus/templates/macros/app/components/ui/toast.tsx +3 -3
  257. package/corpus/templates/macros/app/routes/_index.tsx +2 -2
  258. package/corpus/templates/macros/app/routes/analytics.tsx +1 -1
  259. package/corpus/templates/mail/app/components/GoogleConnectBanner.tsx +6 -6
  260. package/corpus/templates/mail/app/components/email/AttachmentStrip.tsx +2 -2
  261. package/corpus/templates/mail/app/components/email/EmailListItem.tsx +5 -5
  262. package/corpus/templates/mail/app/components/email/IntegrationsSidebar.tsx +5 -5
  263. package/corpus/templates/mail/app/components/email/MobileActionBar.tsx +3 -3
  264. package/corpus/templates/mail/app/components/layout/AppLayout.tsx +10 -10
  265. package/corpus/templates/mail/app/components/layout/CommandPalette.tsx +1 -1
  266. package/corpus/templates/mail/app/components/layout/SearchBar.tsx +3 -3
  267. package/corpus/templates/mail/app/components/ui/alert-dialog.tsx +1 -1
  268. package/corpus/templates/mail/app/components/ui/alert.tsx +1 -1
  269. package/corpus/templates/mail/app/components/ui/breadcrumb.tsx +1 -1
  270. package/corpus/templates/mail/app/components/ui/calendar.tsx +4 -4
  271. package/corpus/templates/mail/app/components/ui/carousel.tsx +6 -6
  272. package/corpus/templates/mail/app/components/ui/command.tsx +2 -2
  273. package/corpus/templates/mail/app/components/ui/context-menu.tsx +9 -9
  274. package/corpus/templates/mail/app/components/ui/dialog.tsx +2 -2
  275. package/corpus/templates/mail/app/components/ui/drawer.tsx +1 -1
  276. package/corpus/templates/mail/app/components/ui/dropdown-menu.tsx +9 -9
  277. package/corpus/templates/mail/app/components/ui/input-otp.tsx +1 -1
  278. package/corpus/templates/mail/app/components/ui/menubar.tsx +9 -9
  279. package/corpus/templates/mail/app/components/ui/navigation-menu.tsx +3 -3
  280. package/corpus/templates/mail/app/components/ui/pagination.tsx +4 -4
  281. package/corpus/templates/mail/app/components/ui/scroll-area.tsx +1 -1
  282. package/corpus/templates/mail/app/components/ui/select.tsx +3 -3
  283. package/corpus/templates/mail/app/components/ui/sheet.tsx +2 -2
  284. package/corpus/templates/mail/app/components/ui/sidebar.tsx +6 -6
  285. package/corpus/templates/mail/app/components/ui/sonner.tsx +2 -2
  286. package/corpus/templates/mail/app/components/ui/table.tsx +2 -2
  287. package/corpus/templates/mail/app/components/ui/toast.tsx +3 -3
  288. package/corpus/templates/plan/app/components/layout/Sidebar.tsx +10 -10
  289. package/corpus/templates/plan/app/components/ui/alert-dialog.tsx +1 -1
  290. package/corpus/templates/plan/app/components/ui/alert.tsx +1 -1
  291. package/corpus/templates/plan/app/components/ui/breadcrumb.tsx +1 -1
  292. package/corpus/templates/plan/app/components/ui/calendar.tsx +5 -5
  293. package/corpus/templates/plan/app/components/ui/carousel.tsx +6 -6
  294. package/corpus/templates/plan/app/components/ui/command.tsx +2 -2
  295. package/corpus/templates/plan/app/components/ui/context-menu.tsx +9 -9
  296. package/corpus/templates/plan/app/components/ui/dialog.tsx +2 -2
  297. package/corpus/templates/plan/app/components/ui/drawer.tsx +1 -1
  298. package/corpus/templates/plan/app/components/ui/dropdown-menu.tsx +9 -9
  299. package/corpus/templates/plan/app/components/ui/input-otp.tsx +1 -1
  300. package/corpus/templates/plan/app/components/ui/menubar.tsx +9 -9
  301. package/corpus/templates/plan/app/components/ui/navigation-menu.tsx +3 -3
  302. package/corpus/templates/plan/app/components/ui/pagination.tsx +4 -4
  303. package/corpus/templates/plan/app/components/ui/scroll-area.tsx +1 -1
  304. package/corpus/templates/plan/app/components/ui/select.tsx +3 -3
  305. package/corpus/templates/plan/app/components/ui/sheet.tsx +2 -2
  306. package/corpus/templates/plan/app/components/ui/sidebar.tsx +6 -6
  307. package/corpus/templates/plan/app/components/ui/table.tsx +2 -2
  308. package/corpus/templates/plan/app/components/ui/toast.tsx +3 -3
  309. package/corpus/templates/slides/app/components/layout/Layout.tsx +1 -1
  310. package/corpus/templates/slides/app/components/ui/alert-dialog.tsx +1 -1
  311. package/corpus/templates/slides/app/components/ui/alert.tsx +1 -1
  312. package/corpus/templates/slides/app/components/ui/breadcrumb.tsx +1 -1
  313. package/corpus/templates/slides/app/components/ui/calendar.tsx +5 -5
  314. package/corpus/templates/slides/app/components/ui/carousel.tsx +6 -6
  315. package/corpus/templates/slides/app/components/ui/command.tsx +2 -2
  316. package/corpus/templates/slides/app/components/ui/context-menu.tsx +9 -9
  317. package/corpus/templates/slides/app/components/ui/dialog.tsx +2 -2
  318. package/corpus/templates/slides/app/components/ui/drawer.tsx +1 -1
  319. package/corpus/templates/slides/app/components/ui/dropdown-menu.tsx +9 -9
  320. package/corpus/templates/slides/app/components/ui/input-otp.tsx +1 -1
  321. package/corpus/templates/slides/app/components/ui/menubar.tsx +9 -9
  322. package/corpus/templates/slides/app/components/ui/navigation-menu.tsx +3 -3
  323. package/corpus/templates/slides/app/components/ui/pagination.tsx +4 -4
  324. package/corpus/templates/slides/app/components/ui/scroll-area.tsx +1 -1
  325. package/corpus/templates/slides/app/components/ui/select.tsx +3 -3
  326. package/corpus/templates/slides/app/components/ui/sheet.tsx +2 -2
  327. package/corpus/templates/slides/app/components/ui/sidebar.tsx +6 -6
  328. package/corpus/templates/slides/app/components/ui/table.tsx +2 -2
  329. package/corpus/templates/slides/app/components/ui/toast.tsx +3 -3
  330. package/corpus/templates/videos/app/components/ui/alert-dialog.tsx +1 -1
  331. package/corpus/templates/videos/app/components/ui/alert.tsx +1 -1
  332. package/corpus/templates/videos/app/components/ui/breadcrumb.tsx +1 -1
  333. package/corpus/templates/videos/app/components/ui/calendar.tsx +5 -5
  334. package/corpus/templates/videos/app/components/ui/carousel.tsx +6 -6
  335. package/corpus/templates/videos/app/components/ui/command.tsx +2 -2
  336. package/corpus/templates/videos/app/components/ui/context-menu.tsx +9 -9
  337. package/corpus/templates/videos/app/components/ui/dialog.tsx +2 -2
  338. package/corpus/templates/videos/app/components/ui/drawer.tsx +1 -1
  339. package/corpus/templates/videos/app/components/ui/dropdown-menu.tsx +9 -9
  340. package/corpus/templates/videos/app/components/ui/input-otp.tsx +1 -1
  341. package/corpus/templates/videos/app/components/ui/menubar.tsx +9 -9
  342. package/corpus/templates/videos/app/components/ui/navigation-menu.tsx +3 -3
  343. package/corpus/templates/videos/app/components/ui/pagination.tsx +4 -4
  344. package/corpus/templates/videos/app/components/ui/scroll-area.tsx +1 -1
  345. package/corpus/templates/videos/app/components/ui/select.tsx +3 -3
  346. package/corpus/templates/videos/app/components/ui/sheet.tsx +2 -2
  347. package/corpus/templates/videos/app/components/ui/sidebar.tsx +6 -6
  348. package/corpus/templates/videos/app/components/ui/table.tsx +2 -2
  349. package/corpus/templates/videos/app/components/ui/toast.tsx +3 -3
  350. package/dist/agent/production-agent.d.ts +47 -0
  351. package/dist/agent/production-agent.d.ts.map +1 -1
  352. package/dist/agent/production-agent.js +112 -56
  353. package/dist/agent/production-agent.js.map +1 -1
  354. package/dist/agent/run-store.d.ts +21 -0
  355. package/dist/agent/run-store.d.ts.map +1 -1
  356. package/dist/agent/run-store.js +32 -0
  357. package/dist/agent/run-store.js.map +1 -1
  358. package/dist/client/AgentPanel.js +3 -3
  359. package/dist/client/AgentPanel.js.map +1 -1
  360. package/dist/client/AgentTaskCard.d.ts.map +1 -1
  361. package/dist/client/AgentTaskCard.js +1 -1
  362. package/dist/client/AgentTaskCard.js.map +1 -1
  363. package/dist/client/AppearancePicker.js +1 -1
  364. package/dist/client/AppearancePicker.js.map +1 -1
  365. package/dist/client/AssistantChat.js +3 -3
  366. package/dist/client/AssistantChat.js.map +1 -1
  367. package/dist/client/CommandMenu.js +4 -4
  368. package/dist/client/CommandMenu.js.map +1 -1
  369. package/dist/client/ErrorBoundary.js +1 -1
  370. package/dist/client/ErrorBoundary.js.map +1 -1
  371. package/dist/client/MultiTabAssistantChat.js +9 -9
  372. package/dist/client/MultiTabAssistantChat.js.map +1 -1
  373. package/dist/client/NewWorkspaceAppFlow.js +5 -5
  374. package/dist/client/NewWorkspaceAppFlow.js.map +1 -1
  375. package/dist/client/components/ui/dropdown-menu.js +6 -6
  376. package/dist/client/components/ui/dropdown-menu.js.map +1 -1
  377. package/dist/client/components/ui/sheet.js +1 -1
  378. package/dist/client/components/ui/sheet.js.map +1 -1
  379. package/dist/client/composer/ComposerPlusMenu.js +5 -5
  380. package/dist/client/composer/ComposerPlusMenu.js.map +1 -1
  381. package/dist/client/composer/MentionPopover.js +4 -4
  382. package/dist/client/composer/MentionPopover.js.map +1 -1
  383. package/dist/client/composer/PastedTextChip.js +2 -2
  384. package/dist/client/composer/PastedTextChip.js.map +1 -1
  385. package/dist/client/composer/PromptComposer.js +3 -3
  386. package/dist/client/composer/PromptComposer.js.map +1 -1
  387. package/dist/client/composer/TiptapComposer.js +12 -12
  388. package/dist/client/composer/TiptapComposer.js.map +1 -1
  389. package/dist/client/guided-questions.d.ts.map +1 -1
  390. package/dist/client/guided-questions.js +5 -5
  391. package/dist/client/guided-questions.js.map +1 -1
  392. package/dist/client/i18n.js +2 -2
  393. package/dist/client/i18n.js.map +1 -1
  394. package/dist/client/integrations/IntegrationCard.js +1 -1
  395. package/dist/client/integrations/IntegrationCard.js.map +1 -1
  396. package/dist/client/integrations/IntegrationsPanel.js +4 -4
  397. package/dist/client/integrations/IntegrationsPanel.js.map +1 -1
  398. package/dist/client/notifications/NotificationsBell.js +3 -3
  399. package/dist/client/notifications/NotificationsBell.js.map +1 -1
  400. package/dist/client/onboarding/OnboardingBanner.js +3 -3
  401. package/dist/client/onboarding/OnboardingBanner.js.map +1 -1
  402. package/dist/client/onboarding/OnboardingPanel.d.ts.map +1 -1
  403. package/dist/client/onboarding/OnboardingPanel.js +15 -10
  404. package/dist/client/onboarding/OnboardingPanel.js.map +1 -1
  405. package/dist/client/org/OrgSwitcher.d.ts.map +1 -1
  406. package/dist/client/org/OrgSwitcher.js +7 -7
  407. package/dist/client/org/OrgSwitcher.js.map +1 -1
  408. package/dist/client/org/TeamPage.js +2 -2
  409. package/dist/client/org/TeamPage.js.map +1 -1
  410. package/dist/client/settings/AgentsSection.js +3 -3
  411. package/dist/client/settings/AgentsSection.js.map +1 -1
  412. package/dist/client/settings/AutomationsSection.js +2 -2
  413. package/dist/client/settings/AutomationsSection.js.map +1 -1
  414. package/dist/client/settings/SecretsSection.js +2 -2
  415. package/dist/client/settings/SecretsSection.js.map +1 -1
  416. package/dist/client/settings/SettingsPanel.d.ts.map +1 -1
  417. package/dist/client/settings/SettingsPanel.js +4 -4
  418. package/dist/client/settings/SettingsPanel.js.map +1 -1
  419. package/dist/client/settings/SettingsSection.js +1 -1
  420. package/dist/client/settings/SettingsSection.js.map +1 -1
  421. package/dist/client/settings/UsageSection.js +2 -2
  422. package/dist/client/settings/UsageSection.js.map +1 -1
  423. package/dist/client/settings/VoiceTranscriptionSection.js +3 -3
  424. package/dist/client/settings/VoiceTranscriptionSection.js.map +1 -1
  425. package/dist/client/sharing/ShareButton.js +6 -6
  426. package/dist/client/sharing/ShareButton.js.map +1 -1
  427. package/dist/client/sharing/ShareDialog.js +3 -3
  428. package/dist/client/sharing/ShareDialog.js.map +1 -1
  429. package/dist/deploy/build.d.ts.map +1 -1
  430. package/dist/deploy/build.js +31 -14
  431. package/dist/deploy/build.js.map +1 -1
  432. package/dist/styles/agent-conversation.css +10 -10
  433. package/dist/styles/blocks.css +2 -2
  434. package/dist/styles/rich-markdown-editor.css +2 -2
  435. package/package.json +1 -1
@@ -138,7 +138,7 @@ function ImagePreviewLightbox({ src, alt, onClose, }) {
138
138
  document.body.style.overflow = "";
139
139
  };
140
140
  }, [onClose]);
141
- return (_jsxs("div", { role: "dialog", "aria-label": "Image preview", onClick: onClose, className: "fixed inset-0 z-[300] flex items-center justify-center bg-black/80 p-6 cursor-zoom-out", children: [_jsx("img", { src: src, alt: alt, onClick: (e) => e.stopPropagation(), className: "max-h-full max-w-full object-contain rounded-md shadow-2xl cursor-default" }), _jsx("button", { type: "button", onClick: onClose, "aria-label": "Close preview", className: "absolute right-4 top-4 flex h-8 w-8 cursor-pointer items-center justify-center rounded-full border border-white/30 bg-black/40 text-white hover:bg-black/60", children: _jsx(IconX, { className: "h-4 w-4" }) })] }));
141
+ return (_jsxs("div", { role: "dialog", "aria-label": "Image preview", onClick: onClose, className: "fixed inset-0 z-[300] flex items-center justify-center bg-black/80 p-6 cursor-zoom-out", children: [_jsx("img", { src: src, alt: alt, onClick: (e) => e.stopPropagation(), className: "max-h-full max-w-full object-contain rounded-md shadow-2xl cursor-default" }), _jsx("button", { type: "button", onClick: onClose, "aria-label": "Close preview", className: "absolute end-4 top-4 flex h-8 w-8 cursor-pointer items-center justify-center rounded-full border border-white/30 bg-black/40 text-white hover:bg-black/60", children: _jsx(IconX, { className: "h-4 w-4" }) })] }));
142
142
  }
143
143
  function AttachmentChip({ attachment, onRemove, }) {
144
144
  const src = useMemo(() => getImageSrc(attachment), [attachment]);
@@ -160,7 +160,7 @@ function AttachmentChip({ attachment, onRemove, }) {
160
160
  e.stopPropagation();
161
161
  onRemove(attachment.id);
162
162
  }
163
- }, "aria-label": `Remove ${attachment.name}`, className: "absolute right-1 top-1 flex h-5 w-5 cursor-pointer items-center justify-center rounded-full border border-border/60 bg-background/90 text-muted-foreground hover:text-foreground", children: _jsx(IconX, { className: "h-3 w-3" }) })] }), previewOpen ? (_jsx(ImagePreviewLightbox, { src: src, alt: attachment.name, onClose: () => setPreviewOpen(false) })) : null] }));
163
+ }, "aria-label": `Remove ${attachment.name}`, className: "absolute end-1 top-1 flex h-5 w-5 cursor-pointer items-center justify-center rounded-full border border-border/60 bg-background/90 text-muted-foreground hover:text-foreground", children: _jsx(IconX, { className: "h-3 w-3" }) })] }), previewOpen ? (_jsx(ImagePreviewLightbox, { src: src, alt: attachment.name, onClose: () => setPreviewOpen(false) })) : null] }));
164
164
  }
165
165
  return (_jsxs("div", { className: "agent-composer-attachment-chip group relative inline-flex max-w-[200px] items-center gap-2 rounded-md border border-border/70 bg-muted/50 px-2 py-1.5 text-xs", children: [_jsx("div", { className: "flex h-6 w-6 shrink-0 items-center justify-center rounded bg-background text-[9px] font-semibold uppercase text-muted-foreground", children: attachment.name.split(".").pop() || "file" }), _jsx("span", { className: "min-w-0 truncate font-medium", children: attachment.name }), _jsx("button", { type: "button", onClick: () => onRemove(attachment.id), "aria-label": `Remove ${attachment.name}`, className: "flex h-5 w-5 shrink-0 cursor-pointer items-center justify-center rounded text-muted-foreground hover:text-foreground", children: _jsx(IconX, { className: "h-3 w-3" }) })] }));
166
166
  }
@@ -229,7 +229,7 @@ function PromptComposerInner({ onSubmit, placeholder, disabled, autoFocus, class
229
229
  effort: composerEffort,
230
230
  });
231
231
  }, [composerEffort, composerEngine, composerModel, onSubmit]);
232
- return (_jsxs(AgentComposerFrame, { className: cn("text-left", className), rootClassName: rootClassName, style: style, rootStyle: rootStyle, layoutVariant: layoutVariant, children: [_jsx(PromptAttachmentStrip, {}), _jsx(TiptapComposer, { focusRef: handleRef, disabled: disabled, placeholder: placeholder, initialText: initialText, initialTextKey: initialTextKey, onSubmit: handleSubmit, clearOnSubmit: !preserveDraftOnSubmit, plusMenuMode: plusMenuMode ?? (attachmentsEnabled ? "upload-only" : "hidden"), attachButton: attachButton, modeControl: modeControl, toolbarSlot: toolbarSlot, actionButton: actionButton, extraActionButton: extraActionButton, layoutVariant: layoutVariant, slashCommands: slashCommands, slashSkills: slashSkills, includeDefaultSlashCommands: includeDefaultSlashCommands, includeDefaultSlashSkills: includeDefaultSlashSkills, onSlashCommand: onSlashCommand, voiceEnabled: voiceEnabled, onTextChange: onTextChange, draftScope: draftScope, selectedModel: composerModel, selectedEffort: composerEffort, availableModels: composerModelGroups, onModelChange: handleModelChange, onEffortChange: handleEffortChange, providerConnectStatusEnabled: resolvedModelStatusChecksEnabled, onConnectProvider: onConnectProvider })] }));
232
+ return (_jsxs(AgentComposerFrame, { className: cn("text-start", className), rootClassName: rootClassName, style: style, rootStyle: rootStyle, layoutVariant: layoutVariant, children: [_jsx(PromptAttachmentStrip, {}), _jsx(TiptapComposer, { focusRef: handleRef, disabled: disabled, placeholder: placeholder, initialText: initialText, initialTextKey: initialTextKey, onSubmit: handleSubmit, clearOnSubmit: !preserveDraftOnSubmit, plusMenuMode: plusMenuMode ?? (attachmentsEnabled ? "upload-only" : "hidden"), attachButton: attachButton, modeControl: modeControl, toolbarSlot: toolbarSlot, actionButton: actionButton, extraActionButton: extraActionButton, layoutVariant: layoutVariant, slashCommands: slashCommands, slashSkills: slashSkills, includeDefaultSlashCommands: includeDefaultSlashCommands, includeDefaultSlashSkills: includeDefaultSlashSkills, onSlashCommand: onSlashCommand, voiceEnabled: voiceEnabled, onTextChange: onTextChange, draftScope: draftScope, selectedModel: composerModel, selectedEffort: composerEffort, availableModels: composerModelGroups, onModelChange: handleModelChange, onEffortChange: handleEffortChange, providerConnectStatusEnabled: resolvedModelStatusChecksEnabled, onConnectProvider: onConnectProvider })] }));
233
233
  }
234
234
  /**
235
235
  * Standalone composer that mirrors the agent sidebar's input experience —
@@ -1 +1 @@
1
- {"version":3,"file":"PromptComposer.js","sourceRoot":"","sources":["../../../src/client/composer/PromptComposer.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,WAAW,EACX,SAAS,EACT,OAAO,EACP,MAAM,EACN,QAAQ,GAIT,MAAM,OAAO,CAAC;AACf,OAAO,EACL,wBAAwB,EACxB,eAAe,EACf,MAAM,EACN,WAAW,EACX,eAAe,GAChB,MAAM,qBAAqB,CAAC;AAQ7B,OAAO,EACL,0BAA0B,EAC1B,4BAA4B,GAC7B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EACL,+BAA+B,EAC/B,cAAc,GAIf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAOjE,OAAO,EAAE,aAAa,EAAyB,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,kCAAkC,EAAE,MAAM,6BAA6B,CAAC;AAEjF,OAAO,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAC9D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Ref,\n type ReactNode,\n} from \"react\";\nimport {\n AssistantRuntimeProvider,\n ThreadPrimitive,\n useAui,\n useComposer,\n useLocalRuntime,\n} from \"@assistant-ui/react\";\nimport type {\n Attachment,\n AttachmentAdapter,\n ChatModelAdapter,\n CompleteAttachment,\n PendingAttachment,\n} from \"@assistant-ui/react\";\nimport {\n CompositeAttachmentAdapter,\n SimpleImageAttachmentAdapter,\n} from \"@assistant-ui/react\";\nimport { IconX } from \"@tabler/icons-react\";\nimport { cn } from \"../utils.js\";\nimport { AgentComposerFrame } from \"./AgentComposerFrame.js\";\nimport {\n DEFAULT_VOICE_DICTATION_ENABLED,\n TiptapComposer,\n type ComposerSubmitIntent,\n type TiptapComposerHandle,\n type TiptapComposerSubmitOptions,\n} from \"./TiptapComposer.js\";\nimport { IMAGE_ATTACHMENT_ACCEPT } from \"./attachment-accept.js\";\nimport type {\n AgentComposerLayoutVariant,\n Reference,\n SkillResult,\n SlashCommand,\n} from \"./types.js\";\nimport { useChatModels, type EngineModelGroup } from \"../use-chat-models.js\";\nimport { TooltipProvider } from \"../components/ui/tooltip.js\";\nimport { AssistantUiStaleIndexErrorBoundary } from \"../assistant-ui-recovery.js\";\nimport type { ReasoningEffort } from \"../../shared/reasoning-effort.js\";\nimport { isPastedTextAttachmentName } from \"./pasted-text.js\";\nimport { PastedTextChip } from \"./PastedTextChip.js\";\nimport {\n PROMPT_DOCUMENT_ATTACHMENT_ACCEPT,\n TextAttachmentAdapter,\n} from \"./attachment-accept.js\";\nimport { escapePromptAttachmentAttribute } from \"./prompt-attachments.js\";\n\nconst MAX_INLINE_TEXT_FILE_CHARS = 60_000;\n\n/**\n * Files the user attached via the \"+\" button in PromptComposer. The host owns\n * what to do with them — typically POST to a per-app upload endpoint and pass\n * the resulting URLs/paths into the prompt that gets sent to the agent.\n */\nexport type PromptComposerFile = File;\n\nexport interface PromptComposerSubmitOptions {\n intent?: ComposerSubmitIntent;\n model?: string;\n engine?: string;\n effort?: ReasoningEffort;\n}\n\nexport interface PromptComposerProps {\n /** Called when the user submits the composer. */\n onSubmit: (\n text: string,\n files: PromptComposerFile[],\n references: Reference[],\n options: PromptComposerSubmitOptions,\n ) => void;\n placeholder?: string;\n disabled?: boolean;\n autoFocus?: boolean;\n className?: string;\n style?: CSSProperties;\n rootClassName?: string;\n rootStyle?: CSSProperties;\n /** Forwarded to TiptapComposer for draft persistence. */\n draftScope?: string;\n /** Keep the submitted prompt in the editor. Default: false. */\n preserveDraftOnSubmit?: boolean;\n /** Show the model selector (default: true). */\n showModelSelector?: boolean;\n /** Show the voice dictation button. Defaults to DEFAULT_VOICE_DICTATION_ENABLED. */\n voiceEnabled?: boolean;\n /** Show file upload controls and pass submitted files to onSubmit (default: true). */\n attachmentsEnabled?: boolean;\n /**\n * Controls the shared \"+\" affordance. Defaults to upload-only for standalone\n * prompt forms; chat surfaces can opt into the full sidebar menu.\n */\n plusMenuMode?: \"full\" | \"upload-only\" | \"hidden\";\n /** Programmatically seed the composer with plain text. */\n initialText?: string;\n /** Stable key used to re-apply `initialText` when the host picks a preset. */\n initialTextKey?: string | number;\n /** Optional host-owned control rendered directly after the \"+\" button. */\n modeControl?: ReactNode;\n /** Explicit host-owned toolbar slot rendered directly after the \"+\" button. */\n toolbarSlot?: ReactNode;\n /** Custom attachment button to render instead of the default \"+\" affordance. */\n attachButton?: ReactNode;\n /** Custom action button to render instead of the default send button. */\n actionButton?: ReactNode;\n /** Extra button rendered alongside the default send button. */\n extraActionButton?: ReactNode;\n /** Shared sizing/layout variant for host surfaces. Default keeps sidebar behavior. */\n layoutVariant?: AgentComposerLayoutVariant;\n /** Additional slash commands surfaced in the shared / menu. */\n slashCommands?: SlashCommand[];\n /** Additional slash skills surfaced in the shared / menu. */\n slashSkills?: SkillResult[];\n /** Include built-in sidebar slash commands like /clear and /help. Default true. */\n includeDefaultSlashCommands?: boolean;\n /** Include app-discovered skills from the default agent endpoint. Default true. */\n includeDefaultSlashSkills?: boolean;\n /** Called when a slash command from the shared / menu is executed. */\n onSlashCommand?: (command: string) => void;\n /** External model list for hosts that already resolve models outside the app. */\n availableModels?: EngineModelGroup[];\n selectedModel?: string;\n selectedEngine?: string;\n selectedEffort?: ReasoningEffort;\n onModelChange?: (model: string, engine: string) => void;\n onEffortChange?: (effort: ReasoningEffort) => void;\n /**\n * Enable server-backed model/provider status checks. Defaults off when the\n * host supplies model state and callbacks, otherwise on.\n */\n modelStatusChecksEnabled?: boolean;\n /** Called whenever the plain editor text changes. */\n onTextChange?: (text: string) => void;\n /**\n * Override the Builder.io connect action in the model picker. When provided,\n * clicking \"Connect Builder.io\" calls this instead of opening a browser popup.\n * Used by the Electron desktop app to route through the native IPC handler.\n */\n onConnectProvider?: () => void;\n /** Imperative handle for focusing the composer. */\n composerRef?: Ref<TiptapComposerHandle>;\n}\n\n// Minimal pass-through adapter. PromptComposer always submits through\n// onSubmitOverride, so the runtime never actually calls this — but\n// `useLocalRuntime` needs *something* shaped like a ChatModelAdapter.\nconst NOOP_ADAPTER: ChatModelAdapter = {\n async *run() {\n return;\n },\n};\n\n/**\n * Local binary document adapter so reference PDFs, decks, and docs can be\n * attached without dragging the whole assistant chat module into bundles that\n * just want a prompt popover.\n */\nclass BinaryDocumentAttachmentAdapter implements AttachmentAdapter {\n public accept = PROMPT_DOCUMENT_ATTACHMENT_ACCEPT;\n\n public async add(state: { file: File }): Promise<PendingAttachment> {\n return {\n id: state.file.name,\n type: \"document\",\n name: state.file.name,\n contentType: state.file.type || \"application/octet-stream\",\n file: state.file,\n status: { type: \"requires-action\", reason: \"composer-send\" },\n };\n }\n\n public async send(\n attachment: PendingAttachment,\n ): Promise<CompleteAttachment> {\n return {\n ...attachment,\n status: { type: \"complete\" },\n content: [],\n };\n }\n\n public async remove() {\n /* noop */\n }\n}\n\nclass RasterImageAttachmentAdapter extends SimpleImageAttachmentAdapter {\n public accept = IMAGE_ATTACHMENT_ACCEPT;\n}\n\nfunction isInlineableTextFile(file: File): boolean {\n if (file.type.startsWith(\"text/\")) return true;\n if (file.type === \"application/json\") return true;\n return /\\.(txt|md|markdown|csv|json|yaml|yml|html?|css|xml)$/i.test(\n file.name,\n );\n}\n\nfunction formatInlineTextFile(name: string, text: string): string {\n const truncated = text.length > MAX_INLINE_TEXT_FILE_CHARS;\n const body = truncated ? text.slice(0, MAX_INLINE_TEXT_FILE_CHARS) : text;\n return [\n `<uploaded-text-file name=\"${escapePromptAttachmentAttribute(name)}\">`,\n body,\n truncated\n ? `[Truncated after ${MAX_INLINE_TEXT_FILE_CHARS} characters.]`\n : \"\",\n \"</uploaded-text-file>\",\n ]\n .filter(Boolean)\n .join(\"\\n\");\n}\n\nexport async function buildPromptComposerSubmission(options: {\n text: string;\n attachments?: ReadonlyArray<unknown>;\n}): Promise<{ text: string; files: File[] }> {\n const files: File[] = [];\n const pastedTextBlocks: string[] = [];\n const rawText = options.text;\n\n for (const att of options.attachments ?? []) {\n const a = att as Attachment;\n if (\"file\" in a && a.file instanceof File) {\n const file = a.file;\n if (isPastedTextAttachmentName(file.name)) {\n try {\n pastedTextBlocks.push(await file.text());\n } catch {\n files.push(file);\n }\n } else {\n if (isInlineableTextFile(file)) {\n try {\n pastedTextBlocks.push(\n formatInlineTextFile(file.name, await file.text()),\n );\n } catch {\n // Keep the upload path fallback below.\n }\n }\n // Note: images are NOT inlined into the prompt text even when small.\n // Inlining a base64 data-URL into a text string consumes an enormous\n // number of tokens (≈ 700 K per MB) and most hosts handle images via\n // proper attachment channels. The `files` array below carries the image\n // for the host to process through a dedicated attachment pipeline.\n files.push(file);\n }\n }\n }\n\n return {\n text: pastedTextBlocks.length\n ? [rawText.trim(), ...pastedTextBlocks].filter(Boolean).join(\"\\n\\n\")\n : rawText,\n files,\n };\n}\n\nfunction getImageSrc(attachment: Attachment): string | null {\n if (attachment.type !== \"image\") return null;\n if (\"file\" in attachment && attachment.file) {\n return URL.createObjectURL(attachment.file);\n }\n const imagePart = attachment.content?.find((part) => part.type === \"image\");\n return imagePart && \"image\" in imagePart ? imagePart.image : null;\n}\n\nfunction ImagePreviewLightbox({\n src,\n alt,\n onClose,\n}: {\n src: string;\n alt: string;\n onClose: () => void;\n}) {\n useEffect(() => {\n const handler = (e: KeyboardEvent) => {\n if (e.key === \"Escape\") onClose();\n };\n document.addEventListener(\"keydown\", handler);\n document.body.style.overflow = \"hidden\";\n return () => {\n document.removeEventListener(\"keydown\", handler);\n document.body.style.overflow = \"\";\n };\n }, [onClose]);\n\n return (\n <div\n role=\"dialog\"\n aria-label=\"Image preview\"\n onClick={onClose}\n className=\"fixed inset-0 z-[300] flex items-center justify-center bg-black/80 p-6 cursor-zoom-out\"\n >\n <img\n src={src}\n alt={alt}\n onClick={(e) => e.stopPropagation()}\n className=\"max-h-full max-w-full object-contain rounded-md shadow-2xl cursor-default\"\n />\n <button\n type=\"button\"\n onClick={onClose}\n aria-label=\"Close preview\"\n className=\"absolute right-4 top-4 flex h-8 w-8 cursor-pointer items-center justify-center rounded-full border border-white/30 bg-black/40 text-white hover:bg-black/60\"\n >\n <IconX className=\"h-4 w-4\" />\n </button>\n </div>\n );\n}\n\nfunction AttachmentChip({\n attachment,\n onRemove,\n}: {\n attachment: Attachment;\n onRemove: (id: string) => void;\n}) {\n const src = useMemo(() => getImageSrc(attachment), [attachment]);\n const [previewOpen, setPreviewOpen] = useState(false);\n useEffect(\n () => () => {\n if (src?.startsWith(\"blob:\")) URL.revokeObjectURL(src);\n },\n [src],\n );\n\n if (isPastedTextAttachmentName(attachment.name)) {\n return <PastedTextChip attachment={attachment} onRemove={onRemove} />;\n }\n\n if (src) {\n return (\n <>\n <button\n type=\"button\"\n onClick={() => setPreviewOpen(true)}\n aria-label={`Preview ${attachment.name}`}\n className=\"agent-composer-attachment-image group relative flex h-16 min-w-16 max-w-28 cursor-zoom-in items-center justify-center overflow-hidden rounded-lg border border-border/70 bg-muted/50\"\n >\n <img\n src={src}\n alt={attachment.name}\n className=\"max-h-full max-w-full object-contain p-1\"\n />\n <span\n role=\"button\"\n tabIndex={0}\n onClick={(e) => {\n e.stopPropagation();\n onRemove(attachment.id);\n }}\n onKeyDown={(e) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n e.stopPropagation();\n onRemove(attachment.id);\n }\n }}\n aria-label={`Remove ${attachment.name}`}\n className=\"absolute right-1 top-1 flex h-5 w-5 cursor-pointer items-center justify-center rounded-full border border-border/60 bg-background/90 text-muted-foreground hover:text-foreground\"\n >\n <IconX className=\"h-3 w-3\" />\n </span>\n </button>\n {previewOpen ? (\n <ImagePreviewLightbox\n src={src}\n alt={attachment.name}\n onClose={() => setPreviewOpen(false)}\n />\n ) : null}\n </>\n );\n }\n\n return (\n <div className=\"agent-composer-attachment-chip group relative inline-flex max-w-[200px] items-center gap-2 rounded-md border border-border/70 bg-muted/50 px-2 py-1.5 text-xs\">\n <div className=\"flex h-6 w-6 shrink-0 items-center justify-center rounded bg-background text-[9px] font-semibold uppercase text-muted-foreground\">\n {attachment.name.split(\".\").pop() || \"file\"}\n </div>\n <span className=\"min-w-0 truncate font-medium\">{attachment.name}</span>\n <button\n type=\"button\"\n onClick={() => onRemove(attachment.id)}\n aria-label={`Remove ${attachment.name}`}\n className=\"flex h-5 w-5 shrink-0 cursor-pointer items-center justify-center rounded text-muted-foreground hover:text-foreground\"\n >\n <IconX className=\"h-3 w-3\" />\n </button>\n </div>\n );\n}\n\nfunction PromptAttachmentStrip() {\n const attachments = useComposer((state) => state.attachments);\n const aui = useAui();\n\n const handleRemove = useCallback(\n (id: string) => {\n void aui.composer().attachment({ id }).remove();\n },\n [aui],\n );\n\n if (attachments.length === 0) return null;\n return (\n <div className=\"agent-composer-attachment-strip flex flex-wrap gap-2 px-2 pt-2\">\n {attachments.map((attachment) => (\n <AttachmentChip\n key={attachment.id}\n attachment={attachment}\n onRemove={handleRemove}\n />\n ))}\n </div>\n );\n}\n\nfunction PromptComposerInner({\n onSubmit,\n placeholder,\n disabled,\n autoFocus,\n className,\n style,\n rootClassName,\n rootStyle,\n draftScope,\n preserveDraftOnSubmit = false,\n showModelSelector = true,\n voiceEnabled = DEFAULT_VOICE_DICTATION_ENABLED,\n attachmentsEnabled = true,\n plusMenuMode,\n initialText,\n initialTextKey,\n modeControl,\n toolbarSlot,\n attachButton,\n actionButton,\n extraActionButton,\n layoutVariant,\n slashCommands,\n slashSkills,\n includeDefaultSlashCommands,\n includeDefaultSlashSkills,\n onSlashCommand,\n availableModels,\n selectedModel,\n selectedEngine,\n selectedEffort,\n onModelChange,\n onEffortChange,\n modelStatusChecksEnabled,\n onTextChange,\n onConnectProvider,\n composerRef,\n}: PromptComposerProps) {\n const localRef = useRef<TiptapComposerHandle>(null);\n const handleRef = composerRef ?? localRef;\n const hostManagedModels = Boolean(\n availableModels && selectedModel && onModelChange,\n );\n const resolvedModelStatusChecksEnabled =\n modelStatusChecksEnabled ?? !hostManagedModels;\n const models = useChatModels({\n enabled: showModelSelector && resolvedModelStatusChecksEnabled,\n });\n const composerModel = showModelSelector\n ? (selectedModel ?? models.selectedModel)\n : undefined;\n const composerEngine = showModelSelector\n ? (selectedEngine ?? models.selectedEngine)\n : undefined;\n const composerEffort = showModelSelector\n ? (selectedEffort ?? models.selectedEffort)\n : undefined;\n const composerModelGroups = showModelSelector\n ? (availableModels ?? models.availableModels)\n : undefined;\n const handleModelChange = showModelSelector\n ? (onModelChange ?? models.onModelChange)\n : undefined;\n const handleEffortChange = showModelSelector\n ? (onEffortChange ?? models.onEffortChange)\n : undefined;\n\n useEffect(() => {\n if (!autoFocus) return;\n const id = window.setTimeout(() => {\n const target =\n typeof handleRef === \"object\" && handleRef && \"current\" in handleRef\n ? handleRef.current\n : null;\n target?.focus();\n }, 50);\n return () => window.clearTimeout(id);\n }, [autoFocus, handleRef]);\n\n const handleSubmit = useCallback(\n async (\n text: string,\n references: Reference[],\n attachments?: ReadonlyArray<unknown>,\n submitOptions?: TiptapComposerSubmitOptions,\n ) => {\n // PromptComposer hosts (NewWorkspaceAppFlow, create-extension, create-deck,\n // …) submit a single string prompt — they don't run the assistant-ui\n // attachment send pipeline. TiptapComposer auto-converts large pastes\n // into a \"Pasted text\" chip, which would otherwise disappear into an\n // unprocessed File. Inline the chip body back into the prompt text so\n // newlines and full content survive the round-trip.\n const { text: finalText, files } = await buildPromptComposerSubmission({\n text,\n attachments,\n });\n onSubmit(finalText, files, references, {\n intent: submitOptions?.intent ?? \"immediate\",\n model: composerModel,\n engine: composerEngine,\n effort: composerEffort,\n });\n },\n [composerEffort, composerEngine, composerModel, onSubmit],\n );\n\n return (\n <AgentComposerFrame\n className={cn(\"text-left\", className)}\n rootClassName={rootClassName}\n style={style}\n rootStyle={rootStyle}\n layoutVariant={layoutVariant}\n >\n <PromptAttachmentStrip />\n <TiptapComposer\n focusRef={handleRef}\n disabled={disabled}\n placeholder={placeholder}\n initialText={initialText}\n initialTextKey={initialTextKey}\n onSubmit={handleSubmit}\n clearOnSubmit={!preserveDraftOnSubmit}\n plusMenuMode={\n plusMenuMode ?? (attachmentsEnabled ? \"upload-only\" : \"hidden\")\n }\n attachButton={attachButton}\n modeControl={modeControl}\n toolbarSlot={toolbarSlot}\n actionButton={actionButton}\n extraActionButton={extraActionButton}\n layoutVariant={layoutVariant}\n slashCommands={slashCommands}\n slashSkills={slashSkills}\n includeDefaultSlashCommands={includeDefaultSlashCommands}\n includeDefaultSlashSkills={includeDefaultSlashSkills}\n onSlashCommand={onSlashCommand}\n voiceEnabled={voiceEnabled}\n onTextChange={onTextChange}\n draftScope={draftScope}\n selectedModel={composerModel}\n selectedEffort={composerEffort}\n availableModels={composerModelGroups}\n onModelChange={handleModelChange}\n onEffortChange={handleEffortChange}\n providerConnectStatusEnabled={resolvedModelStatusChecksEnabled}\n onConnectProvider={onConnectProvider}\n />\n </AgentComposerFrame>\n );\n}\n\n/**\n * Standalone composer that mirrors the agent sidebar's input experience —\n * voice dictation, file upload, model selector, submit-on-Enter — for use in\n * popovers and inline prompt forms (create tool, create deck, create dashboard,\n * the Dispatch new-app flow, etc.).\n *\n * The host owns submission: when the user presses Enter or clicks submit,\n * `onSubmit(text, files, references, options)` is called. PromptComposer runs\n * its own minimal assistant-ui runtime so it can be dropped into any subtree\n * without needing the outer chat to be mounted.\n */\nexport function PromptComposer(props: PromptComposerProps) {\n const attachmentAdapter = useMemo(\n () =>\n new CompositeAttachmentAdapter([\n new RasterImageAttachmentAdapter(),\n new BinaryDocumentAttachmentAdapter(),\n new TextAttachmentAdapter(),\n ]),\n [],\n );\n const runtime = useLocalRuntime(NOOP_ADAPTER, {\n adapters: { attachments: attachmentAdapter },\n });\n const resetKey = [\n props.draftScope ?? \"\",\n props.initialTextKey ?? \"\",\n props.initialText ?? \"\",\n ].join(\":\");\n\n return (\n <TooltipProvider delayDuration={200}>\n <AssistantRuntimeProvider runtime={runtime}>\n <ThreadPrimitive.Root\n className=\"contents\"\n style={{ display: \"contents\" }}\n >\n <AssistantUiStaleIndexErrorBoundary\n resetKey={resetKey}\n componentName=\"PromptComposer\"\n >\n <PromptComposerInner {...props} />\n </AssistantUiStaleIndexErrorBoundary>\n </ThreadPrimitive.Root>\n </AssistantRuntimeProvider>\n </TooltipProvider>\n );\n}\n"]}
1
+ {"version":3,"file":"PromptComposer.js","sourceRoot":"","sources":["../../../src/client/composer/PromptComposer.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,WAAW,EACX,SAAS,EACT,OAAO,EACP,MAAM,EACN,QAAQ,GAIT,MAAM,OAAO,CAAC;AACf,OAAO,EACL,wBAAwB,EACxB,eAAe,EACf,MAAM,EACN,WAAW,EACX,eAAe,GAChB,MAAM,qBAAqB,CAAC;AAQ7B,OAAO,EACL,0BAA0B,EAC1B,4BAA4B,GAC7B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EACL,+BAA+B,EAC/B,cAAc,GAIf,MAA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AS,EAAC,UAAU,EACpB,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,YAE9B,KAAC,kCAAkC,IACjC,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAC,gBAAgB,YAE9B,KAAC,mBAAmB,OAAK,KAAK,GAAI,GACC,GAChB,GACE,GACX,CACnB,CAAC;AACJ,CAAC","sourcesContent":["import {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n type CSSProperties,\n type Ref,\n type ReactNode,\n} from \"react\";\nimport {\n AssistantRuntimeProvider,\n ThreadPrimitive,\n useAui,\n useComposer,\n useLocalRuntime,\n} from \"@assistant-ui/react\";\nimport type {\n Attachment,\n AttachmentAdapter,\n ChatModelAdapter,\n CompleteAttachment,\n PendingAttachment,\n} from \"@assistant-ui/react\";\nimport {\n CompositeAttachmentAdapter,\n SimpleImageAttachmentAdapter,\n} from \"@assistant-ui/react\";\nimport { IconX } from \"@tabler/icons-react\";\nimport { cn } from \"../utils.js\";\nimport { AgentComposerFrame } from \"./AgentComposerFrame.js\";\nimport {\n DEFAULT_VOICE_DICTATION_ENABLED,\n TiptapComposer,\n type ComposerSubmitIntent,\n type TiptapComposerHandle,\n type TiptapComposerSubmitOptions,\n} from \"./TiptapComposer.js\";\nimport { IMAGE_ATTACHMENT_ACCEPT } from \"./attachment-accept.js\";\nimport type {\n AgentComposerLayoutVariant,\n Reference,\n SkillResult,\n SlashCommand,\n} from \"./types.js\";\nimport { useChatModels, type EngineModelGroup } from \"../use-chat-models.js\";\nimport { TooltipProvider } from \"../components/ui/tooltip.js\";\nimport { AssistantUiStaleIndexErrorBoundary } from \"../assistant-ui-recovery.js\";\nimport type { ReasoningEffort } from \"../../shared/reasoning-effort.js\";\nimport { isPastedTextAttachmentName } from \"./pasted-text.js\";\nimport { PastedTextChip } from \"./PastedTextChip.js\";\nimport {\n PROMPT_DOCUMENT_ATTACHMENT_ACCEPT,\n TextAttachmentAdapter,\n} from \"./attachment-accept.js\";\nimport { escapePromptAttachmentAttribute } from \"./prompt-attachments.js\";\n\nconst MAX_INLINE_TEXT_FILE_CHARS = 60_000;\n\n/**\n * Files the user attached via the \"+\" button in PromptComposer. The host owns\n * what to do with them — typically POST to a per-app upload endpoint and pass\n * the resulting URLs/paths into the prompt that gets sent to the agent.\n */\nexport type PromptComposerFile = File;\n\nexport interface PromptComposerSubmitOptions {\n intent?: ComposerSubmitIntent;\n model?: string;\n engine?: string;\n effort?: ReasoningEffort;\n}\n\nexport interface PromptComposerProps {\n /** Called when the user submits the composer. */\n onSubmit: (\n text: string,\n files: PromptComposerFile[],\n references: Reference[],\n options: PromptComposerSubmitOptions,\n ) => void;\n placeholder?: string;\n disabled?: boolean;\n autoFocus?: boolean;\n className?: string;\n style?: CSSProperties;\n rootClassName?: string;\n rootStyle?: CSSProperties;\n /** Forwarded to TiptapComposer for draft persistence. */\n draftScope?: string;\n /** Keep the submitted prompt in the editor. Default: false. */\n preserveDraftOnSubmit?: boolean;\n /** Show the model selector (default: true). */\n showModelSelector?: boolean;\n /** Show the voice dictation button. Defaults to DEFAULT_VOICE_DICTATION_ENABLED. */\n voiceEnabled?: boolean;\n /** Show file upload controls and pass submitted files to onSubmit (default: true). */\n attachmentsEnabled?: boolean;\n /**\n * Controls the shared \"+\" affordance. Defaults to upload-only for standalone\n * prompt forms; chat surfaces can opt into the full sidebar menu.\n */\n plusMenuMode?: \"full\" | \"upload-only\" | \"hidden\";\n /** Programmatically seed the composer with plain text. */\n initialText?: string;\n /** Stable key used to re-apply `initialText` when the host picks a preset. */\n initialTextKey?: string | number;\n /** Optional host-owned control rendered directly after the \"+\" button. */\n modeControl?: ReactNode;\n /** Explicit host-owned toolbar slot rendered directly after the \"+\" button. */\n toolbarSlot?: ReactNode;\n /** Custom attachment button to render instead of the default \"+\" affordance. */\n attachButton?: ReactNode;\n /** Custom action button to render instead of the default send button. */\n actionButton?: ReactNode;\n /** Extra button rendered alongside the default send button. */\n extraActionButton?: ReactNode;\n /** Shared sizing/layout variant for host surfaces. Default keeps sidebar behavior. */\n layoutVariant?: AgentComposerLayoutVariant;\n /** Additional slash commands surfaced in the shared / menu. */\n slashCommands?: SlashCommand[];\n /** Additional slash skills surfaced in the shared / menu. */\n slashSkills?: SkillResult[];\n /** Include built-in sidebar slash commands like /clear and /help. Default true. */\n includeDefaultSlashCommands?: boolean;\n /** Include app-discovered skills from the default agent endpoint. Default true. */\n includeDefaultSlashSkills?: boolean;\n /** Called when a slash command from the shared / menu is executed. */\n onSlashCommand?: (command: string) => void;\n /** External model list for hosts that already resolve models outside the app. */\n availableModels?: EngineModelGroup[];\n selectedModel?: string;\n selectedEngine?: string;\n selectedEffort?: ReasoningEffort;\n onModelChange?: (model: string, engine: string) => void;\n onEffortChange?: (effort: ReasoningEffort) => void;\n /**\n * Enable server-backed model/provider status checks. Defaults off when the\n * host supplies model state and callbacks, otherwise on.\n */\n modelStatusChecksEnabled?: boolean;\n /** Called whenever the plain editor text changes. */\n onTextChange?: (text: string) => void;\n /**\n * Override the Builder.io connect action in the model picker. When provided,\n * clicking \"Connect Builder.io\" calls this instead of opening a browser popup.\n * Used by the Electron desktop app to route through the native IPC handler.\n */\n onConnectProvider?: () => void;\n /** Imperative handle for focusing the composer. */\n composerRef?: Ref<TiptapComposerHandle>;\n}\n\n// Minimal pass-through adapter. PromptComposer always submits through\n// onSubmitOverride, so the runtime never actually calls this — but\n// `useLocalRuntime` needs *something* shaped like a ChatModelAdapter.\nconst NOOP_ADAPTER: ChatModelAdapter = {\n async *run() {\n return;\n },\n};\n\n/**\n * Local binary document adapter so reference PDFs, decks, and docs can be\n * attached without dragging the whole assistant chat module into bundles that\n * just want a prompt popover.\n */\nclass BinaryDocumentAttachmentAdapter implements AttachmentAdapter {\n public accept = PROMPT_DOCUMENT_ATTACHMENT_ACCEPT;\n\n public async add(state: { file: File }): Promise<PendingAttachment> {\n return {\n id: state.file.name,\n type: \"document\",\n name: state.file.name,\n contentType: state.file.type || \"application/octet-stream\",\n file: state.file,\n status: { type: \"requires-action\", reason: \"composer-send\" },\n };\n }\n\n public async send(\n attachment: PendingAttachment,\n ): Promise<CompleteAttachment> {\n return {\n ...attachment,\n status: { type: \"complete\" },\n content: [],\n };\n }\n\n public async remove() {\n /* noop */\n }\n}\n\nclass RasterImageAttachmentAdapter extends SimpleImageAttachmentAdapter {\n public accept = IMAGE_ATTACHMENT_ACCEPT;\n}\n\nfunction isInlineableTextFile(file: File): boolean {\n if (file.type.startsWith(\"text/\")) return true;\n if (file.type === \"application/json\") return true;\n return /\\.(txt|md|markdown|csv|json|yaml|yml|html?|css|xml)$/i.test(\n file.name,\n );\n}\n\nfunction formatInlineTextFile(name: string, text: string): string {\n const truncated = text.length > MAX_INLINE_TEXT_FILE_CHARS;\n const body = truncated ? text.slice(0, MAX_INLINE_TEXT_FILE_CHARS) : text;\n return [\n `<uploaded-text-file name=\"${escapePromptAttachmentAttribute(name)}\">`,\n body,\n truncated\n ? `[Truncated after ${MAX_INLINE_TEXT_FILE_CHARS} characters.]`\n : \"\",\n \"</uploaded-text-file>\",\n ]\n .filter(Boolean)\n .join(\"\\n\");\n}\n\nexport async function buildPromptComposerSubmission(options: {\n text: string;\n attachments?: ReadonlyArray<unknown>;\n}): Promise<{ text: string; files: File[] }> {\n const files: File[] = [];\n const pastedTextBlocks: string[] = [];\n const rawText = options.text;\n\n for (const att of options.attachments ?? []) {\n const a = att as Attachment;\n if (\"file\" in a && a.file instanceof File) {\n const file = a.file;\n if (isPastedTextAttachmentName(file.name)) {\n try {\n pastedTextBlocks.push(await file.text());\n } catch {\n files.push(file);\n }\n } else {\n if (isInlineableTextFile(file)) {\n try {\n pastedTextBlocks.push(\n formatInlineTextFile(file.name, await file.text()),\n );\n } catch {\n // Keep the upload path fallback below.\n }\n }\n // Note: images are NOT inlined into the prompt text even when small.\n // Inlining a base64 data-URL into a text string consumes an enormous\n // number of tokens (≈ 700 K per MB) and most hosts handle images via\n // proper attachment channels. The `files` array below carries the image\n // for the host to process through a dedicated attachment pipeline.\n files.push(file);\n }\n }\n }\n\n return {\n text: pastedTextBlocks.length\n ? [rawText.trim(), ...pastedTextBlocks].filter(Boolean).join(\"\\n\\n\")\n : rawText,\n files,\n };\n}\n\nfunction getImageSrc(attachment: Attachment): string | null {\n if (attachment.type !== \"image\") return null;\n if (\"file\" in attachment && attachment.file) {\n return URL.createObjectURL(attachment.file);\n }\n const imagePart = attachment.content?.find((part) => part.type === \"image\");\n return imagePart && \"image\" in imagePart ? imagePart.image : null;\n}\n\nfunction ImagePreviewLightbox({\n src,\n alt,\n onClose,\n}: {\n src: string;\n alt: string;\n onClose: () => void;\n}) {\n useEffect(() => {\n const handler = (e: KeyboardEvent) => {\n if (e.key === \"Escape\") onClose();\n };\n document.addEventListener(\"keydown\", handler);\n document.body.style.overflow = \"hidden\";\n return () => {\n document.removeEventListener(\"keydown\", handler);\n document.body.style.overflow = \"\";\n };\n }, [onClose]);\n\n return (\n <div\n role=\"dialog\"\n aria-label=\"Image preview\"\n onClick={onClose}\n className=\"fixed inset-0 z-[300] flex items-center justify-center bg-black/80 p-6 cursor-zoom-out\"\n >\n <img\n src={src}\n alt={alt}\n onClick={(e) => e.stopPropagation()}\n className=\"max-h-full max-w-full object-contain rounded-md shadow-2xl cursor-default\"\n />\n <button\n type=\"button\"\n onClick={onClose}\n aria-label=\"Close preview\"\n className=\"absolute end-4 top-4 flex h-8 w-8 cursor-pointer items-center justify-center rounded-full border border-white/30 bg-black/40 text-white hover:bg-black/60\"\n >\n <IconX className=\"h-4 w-4\" />\n </button>\n </div>\n );\n}\n\nfunction AttachmentChip({\n attachment,\n onRemove,\n}: {\n attachment: Attachment;\n onRemove: (id: string) => void;\n}) {\n const src = useMemo(() => getImageSrc(attachment), [attachment]);\n const [previewOpen, setPreviewOpen] = useState(false);\n useEffect(\n () => () => {\n if (src?.startsWith(\"blob:\")) URL.revokeObjectURL(src);\n },\n [src],\n );\n\n if (isPastedTextAttachmentName(attachment.name)) {\n return <PastedTextChip attachment={attachment} onRemove={onRemove} />;\n }\n\n if (src) {\n return (\n <>\n <button\n type=\"button\"\n onClick={() => setPreviewOpen(true)}\n aria-label={`Preview ${attachment.name}`}\n className=\"agent-composer-attachment-image group relative flex h-16 min-w-16 max-w-28 cursor-zoom-in items-center justify-center overflow-hidden rounded-lg border border-border/70 bg-muted/50\"\n >\n <img\n src={src}\n alt={attachment.name}\n className=\"max-h-full max-w-full object-contain p-1\"\n />\n <span\n role=\"button\"\n tabIndex={0}\n onClick={(e) => {\n e.stopPropagation();\n onRemove(attachment.id);\n }}\n onKeyDown={(e) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n e.stopPropagation();\n onRemove(attachment.id);\n }\n }}\n aria-label={`Remove ${attachment.name}`}\n className=\"absolute end-1 top-1 flex h-5 w-5 cursor-pointer items-center justify-center rounded-full border border-border/60 bg-background/90 text-muted-foreground hover:text-foreground\"\n >\n <IconX className=\"h-3 w-3\" />\n </span>\n </button>\n {previewOpen ? (\n <ImagePreviewLightbox\n src={src}\n alt={attachment.name}\n onClose={() => setPreviewOpen(false)}\n />\n ) : null}\n </>\n );\n }\n\n return (\n <div className=\"agent-composer-attachment-chip group relative inline-flex max-w-[200px] items-center gap-2 rounded-md border border-border/70 bg-muted/50 px-2 py-1.5 text-xs\">\n <div className=\"flex h-6 w-6 shrink-0 items-center justify-center rounded bg-background text-[9px] font-semibold uppercase text-muted-foreground\">\n {attachment.name.split(\".\").pop() || \"file\"}\n </div>\n <span className=\"min-w-0 truncate font-medium\">{attachment.name}</span>\n <button\n type=\"button\"\n onClick={() => onRemove(attachment.id)}\n aria-label={`Remove ${attachment.name}`}\n className=\"flex h-5 w-5 shrink-0 cursor-pointer items-center justify-center rounded text-muted-foreground hover:text-foreground\"\n >\n <IconX className=\"h-3 w-3\" />\n </button>\n </div>\n );\n}\n\nfunction PromptAttachmentStrip() {\n const attachments = useComposer((state) => state.attachments);\n const aui = useAui();\n\n const handleRemove = useCallback(\n (id: string) => {\n void aui.composer().attachment({ id }).remove();\n },\n [aui],\n );\n\n if (attachments.length === 0) return null;\n return (\n <div className=\"agent-composer-attachment-strip flex flex-wrap gap-2 px-2 pt-2\">\n {attachments.map((attachment) => (\n <AttachmentChip\n key={attachment.id}\n attachment={attachment}\n onRemove={handleRemove}\n />\n ))}\n </div>\n );\n}\n\nfunction PromptComposerInner({\n onSubmit,\n placeholder,\n disabled,\n autoFocus,\n className,\n style,\n rootClassName,\n rootStyle,\n draftScope,\n preserveDraftOnSubmit = false,\n showModelSelector = true,\n voiceEnabled = DEFAULT_VOICE_DICTATION_ENABLED,\n attachmentsEnabled = true,\n plusMenuMode,\n initialText,\n initialTextKey,\n modeControl,\n toolbarSlot,\n attachButton,\n actionButton,\n extraActionButton,\n layoutVariant,\n slashCommands,\n slashSkills,\n includeDefaultSlashCommands,\n includeDefaultSlashSkills,\n onSlashCommand,\n availableModels,\n selectedModel,\n selectedEngine,\n selectedEffort,\n onModelChange,\n onEffortChange,\n modelStatusChecksEnabled,\n onTextChange,\n onConnectProvider,\n composerRef,\n}: PromptComposerProps) {\n const localRef = useRef<TiptapComposerHandle>(null);\n const handleRef = composerRef ?? localRef;\n const hostManagedModels = Boolean(\n availableModels && selectedModel && onModelChange,\n );\n const resolvedModelStatusChecksEnabled =\n modelStatusChecksEnabled ?? !hostManagedModels;\n const models = useChatModels({\n enabled: showModelSelector && resolvedModelStatusChecksEnabled,\n });\n const composerModel = showModelSelector\n ? (selectedModel ?? models.selectedModel)\n : undefined;\n const composerEngine = showModelSelector\n ? (selectedEngine ?? models.selectedEngine)\n : undefined;\n const composerEffort = showModelSelector\n ? (selectedEffort ?? models.selectedEffort)\n : undefined;\n const composerModelGroups = showModelSelector\n ? (availableModels ?? models.availableModels)\n : undefined;\n const handleModelChange = showModelSelector\n ? (onModelChange ?? models.onModelChange)\n : undefined;\n const handleEffortChange = showModelSelector\n ? (onEffortChange ?? models.onEffortChange)\n : undefined;\n\n useEffect(() => {\n if (!autoFocus) return;\n const id = window.setTimeout(() => {\n const target =\n typeof handleRef === \"object\" && handleRef && \"current\" in handleRef\n ? handleRef.current\n : null;\n target?.focus();\n }, 50);\n return () => window.clearTimeout(id);\n }, [autoFocus, handleRef]);\n\n const handleSubmit = useCallback(\n async (\n text: string,\n references: Reference[],\n attachments?: ReadonlyArray<unknown>,\n submitOptions?: TiptapComposerSubmitOptions,\n ) => {\n // PromptComposer hosts (NewWorkspaceAppFlow, create-extension, create-deck,\n // …) submit a single string prompt — they don't run the assistant-ui\n // attachment send pipeline. TiptapComposer auto-converts large pastes\n // into a \"Pasted text\" chip, which would otherwise disappear into an\n // unprocessed File. Inline the chip body back into the prompt text so\n // newlines and full content survive the round-trip.\n const { text: finalText, files } = await buildPromptComposerSubmission({\n text,\n attachments,\n });\n onSubmit(finalText, files, references, {\n intent: submitOptions?.intent ?? \"immediate\",\n model: composerModel,\n engine: composerEngine,\n effort: composerEffort,\n });\n },\n [composerEffort, composerEngine, composerModel, onSubmit],\n );\n\n return (\n <AgentComposerFrame\n className={cn(\"text-start\", className)}\n rootClassName={rootClassName}\n style={style}\n rootStyle={rootStyle}\n layoutVariant={layoutVariant}\n >\n <PromptAttachmentStrip />\n <TiptapComposer\n focusRef={handleRef}\n disabled={disabled}\n placeholder={placeholder}\n initialText={initialText}\n initialTextKey={initialTextKey}\n onSubmit={handleSubmit}\n clearOnSubmit={!preserveDraftOnSubmit}\n plusMenuMode={\n plusMenuMode ?? (attachmentsEnabled ? \"upload-only\" : \"hidden\")\n }\n attachButton={attachButton}\n modeControl={modeControl}\n toolbarSlot={toolbarSlot}\n actionButton={actionButton}\n extraActionButton={extraActionButton}\n layoutVariant={layoutVariant}\n slashCommands={slashCommands}\n slashSkills={slashSkills}\n includeDefaultSlashCommands={includeDefaultSlashCommands}\n includeDefaultSlashSkills={includeDefaultSlashSkills}\n onSlashCommand={onSlashCommand}\n voiceEnabled={voiceEnabled}\n onTextChange={onTextChange}\n draftScope={draftScope}\n selectedModel={composerModel}\n selectedEffort={composerEffort}\n availableModels={composerModelGroups}\n onModelChange={handleModelChange}\n onEffortChange={handleEffortChange}\n providerConnectStatusEnabled={resolvedModelStatusChecksEnabled}\n onConnectProvider={onConnectProvider}\n />\n </AgentComposerFrame>\n );\n}\n\n/**\n * Standalone composer that mirrors the agent sidebar's input experience —\n * voice dictation, file upload, model selector, submit-on-Enter — for use in\n * popovers and inline prompt forms (create tool, create deck, create dashboard,\n * the Dispatch new-app flow, etc.).\n *\n * The host owns submission: when the user presses Enter or clicks submit,\n * `onSubmit(text, files, references, options)` is called. PromptComposer runs\n * its own minimal assistant-ui runtime so it can be dropped into any subtree\n * without needing the outer chat to be mounted.\n */\nexport function PromptComposer(props: PromptComposerProps) {\n const attachmentAdapter = useMemo(\n () =>\n new CompositeAttachmentAdapter([\n new RasterImageAttachmentAdapter(),\n new BinaryDocumentAttachmentAdapter(),\n new TextAttachmentAdapter(),\n ]),\n [],\n );\n const runtime = useLocalRuntime(NOOP_ADAPTER, {\n adapters: { attachments: attachmentAdapter },\n });\n const resetKey = [\n props.draftScope ?? \"\",\n props.initialTextKey ?? \"\",\n props.initialText ?? \"\",\n ].join(\":\");\n\n return (\n <TooltipProvider delayDuration={200}>\n <AssistantRuntimeProvider runtime={runtime}>\n <ThreadPrimitive.Root\n className=\"contents\"\n style={{ display: \"contents\" }}\n >\n <AssistantUiStaleIndexErrorBoundary\n resetKey={resetKey}\n componentName=\"PromptComposer\"\n >\n <PromptComposerInner {...props} />\n </AssistantUiStaleIndexErrorBoundary>\n </ThreadPrimitive.Root>\n </AssistantRuntimeProvider>\n </TooltipProvider>\n );\n}\n"]}
@@ -204,7 +204,7 @@ Prefer appAction()/appFetch() for app data. Some actions return JSON strings for
204
204
  function ComposerModeChip({ mode, onRemove, }) {
205
205
  const config = COMPOSER_MODE_CONFIGS[mode];
206
206
  const Icon = config.icon;
207
- return (_jsxs("span", { className: "inline-flex items-center gap-1 rounded-md border border-border bg-muted/50 px-1.5 py-0.5 text-xs font-medium text-foreground", children: [_jsx(Icon, { className: "h-3 w-3 text-muted-foreground" }), config.label, _jsx("button", { type: "button", onClick: onRemove, className: "ml-0.5 rounded-sm text-muted-foreground hover:text-foreground cursor-pointer", children: _jsx(IconX, { className: "h-3 w-3" }) })] }));
207
+ return (_jsxs("span", { className: "inline-flex items-center gap-1 rounded-md border border-border bg-muted/50 px-1.5 py-0.5 text-xs font-medium text-foreground", children: [_jsx(Icon, { className: "h-3 w-3 text-muted-foreground" }), config.label, _jsx("button", { type: "button", onClick: onRemove, className: "ms-0.5 rounded-sm text-muted-foreground hover:text-foreground cursor-pointer", children: _jsx(IconX, { className: "h-3 w-3" }) })] }));
208
208
  }
209
209
  function plainTextToDoc(text) {
210
210
  const lines = text.length > 0 ? text.split(/\r?\n/) : [""];
@@ -252,12 +252,12 @@ function ModeSelector({ mode, onChange, planModeDisabled = false, planModeDisabl
252
252
  return (_jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsxs("button", { type: "button", "aria-label": mode === "build" ? "Act mode" : "Plan mode", "data-agent-composer-slot": "mode-button", className: "agent-composer-mode-button shrink-0 flex items-center gap-1 rounded-md px-2 py-1 text-[12px] font-medium text-muted-foreground hover:bg-accent/50 hover:text-foreground", children: [mode === "build" ? "Act" : "Plan", _jsx(IconChevronDown, { className: "h-3 w-3 opacity-60" })] }) }), _jsxs(PopoverContent, { side: "top", align: "end", sideOffset: 6, collisionPadding: 8, "data-agent-native-composer-popover": "true", className: "z-[260] w-60 rounded-lg border-border p-0 py-1 shadow-lg", style: { fontSize: 13 }, children: [_jsxs("button", { type: "button", onClick: () => {
253
253
  onChange("build");
254
254
  setOpen(false);
255
- }, className: "flex w-full items-center gap-3 px-3 py-2 hover:bg-accent/50 text-left", children: [_jsx(IconPencil, { className: "h-4 w-4 shrink-0 text-muted-foreground" }), _jsxs("div", { className: "flex-1 min-w-0", children: [_jsx("span", { className: "font-medium text-foreground text-[13px]", children: "Act" }), _jsx("p", { className: "text-[11px] text-muted-foreground mt-0.5", children: "Use tools and make approved changes" })] }), mode === "build" && (_jsx(IconCheck, { className: "h-3.5 w-3.5 shrink-0 text-blue-500" }))] }), _jsxs("button", { type: "button", disabled: planModeDisabled, title: planModeDisabled ? planModeDisabledReason : undefined, onClick: () => {
255
+ }, className: "flex w-full items-center gap-3 px-3 py-2 hover:bg-accent/50 text-start", children: [_jsx(IconPencil, { className: "h-4 w-4 shrink-0 text-muted-foreground" }), _jsxs("div", { className: "flex-1 min-w-0", children: [_jsx("span", { className: "font-medium text-foreground text-[13px]", children: "Act" }), _jsx("p", { className: "text-[11px] text-muted-foreground mt-0.5", children: "Use tools and make approved changes" })] }), mode === "build" && (_jsx(IconCheck, { className: "h-3.5 w-3.5 shrink-0 text-blue-500" }))] }), _jsxs("button", { type: "button", disabled: planModeDisabled, title: planModeDisabled ? planModeDisabledReason : undefined, onClick: () => {
256
256
  if (planModeDisabled)
257
257
  return;
258
258
  onChange("plan");
259
259
  setOpen(false);
260
- }, className: `flex w-full items-center gap-3 px-3 py-2 text-left ${planModeDisabled
260
+ }, className: `flex w-full items-center gap-3 px-3 py-2 text-start ${planModeDisabled
261
261
  ? "cursor-not-allowed opacity-60"
262
262
  : "hover:bg-accent/50"}`, children: [_jsx(IconClipboardList, { className: "h-4 w-4 shrink-0 text-muted-foreground" }), _jsxs("div", { className: "flex-1 min-w-0", children: [_jsx("span", { className: "font-medium text-foreground text-[13px]", children: "Plan" }), _jsx("p", { className: "text-[11px] text-muted-foreground mt-0.5", children: planModeDisabled
263
263
  ? planModeDisabledReason
@@ -444,21 +444,21 @@ function ModelSelector({ model, effort = "auto", engines, onChange, onEffortChan
444
444
  else {
445
445
  builderFlow.start();
446
446
  }
447
- }, disabled: !onConnectProvider && builderFlow.connecting, className: "flex w-full items-start gap-2 px-3 py-2 text-left hover:bg-accent/50 disabled:opacity-60", children: [_jsx(IconPlugConnected, { className: "h-4 w-4 shrink-0 mt-0.5 text-blue-500" }), _jsxs("span", { className: "flex-1 min-w-0", children: [_jsx("span", { className: "block text-[12px] font-medium text-foreground", children: !onConnectProvider && builderFlow.connecting
447
+ }, disabled: !onConnectProvider && builderFlow.connecting, className: "flex w-full items-start gap-2 px-3 py-2 text-start hover:bg-accent/50 disabled:opacity-60", children: [_jsx(IconPlugConnected, { className: "h-4 w-4 shrink-0 mt-0.5 text-blue-500" }), _jsxs("span", { className: "flex-1 min-w-0", children: [_jsx("span", { className: "block text-[12px] font-medium text-foreground", children: !onConnectProvider && builderFlow.connecting
448
448
  ? "Connecting Builder.io…"
449
- : "Connect Builder.io" }), _jsx("span", { className: "block text-[11px] text-muted-foreground", children: "Free credits for Claude, OpenAI & Gemini" })] })] }), _jsx("div", { className: "my-1 border-t border-border" })] })), imageModel && imageModel.options.length > 0 && (_jsxs(_Fragment, { children: [_jsx("div", { className: "flex items-center hover:bg-accent/30", children: _jsxs("button", { type: "button", "aria-expanded": imageExpanded, onClick: () => setImageExpanded((prev) => !prev), className: "flex flex-1 min-w-0 items-center gap-1.5 px-2 py-1.5 cursor-pointer text-left", children: [imageExpanded ? (_jsx(IconChevronDown, { className: "h-3 w-3 shrink-0 text-muted-foreground" })) : (_jsx(IconChevronRight, { className: "h-3 w-3 shrink-0 text-muted-foreground" })), _jsx("span", { className: "text-[11px] font-medium text-muted-foreground uppercase tracking-wide shrink-0", children: imageModel.label ?? "Image model" }), !imageExpanded && imageModelLabel && (_jsx("span", { className: "text-[11px] text-muted-foreground/80 truncate", children: imageModelLabel }))] }) }), imageExpanded &&
449
+ : "Connect Builder.io" }), _jsx("span", { className: "block text-[11px] text-muted-foreground", children: "Free credits for Claude, OpenAI & Gemini" })] })] }), _jsx("div", { className: "my-1 border-t border-border" })] })), imageModel && imageModel.options.length > 0 && (_jsxs(_Fragment, { children: [_jsx("div", { className: "flex items-center hover:bg-accent/30", children: _jsxs("button", { type: "button", "aria-expanded": imageExpanded, onClick: () => setImageExpanded((prev) => !prev), className: "flex flex-1 min-w-0 items-center gap-1.5 px-2 py-1.5 cursor-pointer text-start", children: [imageExpanded ? (_jsx(IconChevronDown, { className: "h-3 w-3 shrink-0 text-muted-foreground" })) : (_jsx(IconChevronRight, { className: "h-3 w-3 shrink-0 text-muted-foreground rtl:-scale-x-100" })), _jsx("span", { className: "text-[11px] font-medium text-muted-foreground uppercase tracking-wide shrink-0", children: imageModel.label ?? "Image model" }), !imageExpanded && imageModelLabel && (_jsx("span", { className: "text-[11px] text-muted-foreground/80 truncate", children: imageModelLabel }))] }) }), imageExpanded &&
450
450
  imageModel.options.map((option) => (_jsxs("button", { type: "button", onClick: () => {
451
451
  imageModel.onChange(option.value);
452
452
  setImageExpanded(false);
453
- }, className: "flex w-full items-center gap-3 pl-7 pr-3 py-1.5 text-left hover:bg-accent/50", children: [_jsx("span", { className: "flex-1 min-w-0 text-[13px] text-foreground truncate", children: option.label }), option.value === imageModel.value && (_jsx(IconCheck, { className: "h-3.5 w-3.5 shrink-0 text-blue-500" }))] }, option.value))), _jsx("div", { className: "my-1 border-t border-border" })] })), autoModelGroup && (_jsxs("button", { type: "button", onClick: () => {
453
+ }, className: "flex w-full items-center gap-3 ps-7 pe-3 py-1.5 text-start hover:bg-accent/50", children: [_jsx("span", { className: "flex-1 min-w-0 text-[13px] text-foreground truncate", children: option.label }), option.value === imageModel.value && (_jsx(IconCheck, { className: "h-3.5 w-3.5 shrink-0 text-blue-500" }))] }, option.value))), _jsx("div", { className: "my-1 border-t border-border" })] })), autoModelGroup && (_jsxs("button", { type: "button", onClick: () => {
454
454
  onChange("auto", autoModelGroup.engine);
455
455
  setOpen(false);
456
- }, className: "flex w-full items-center gap-3 px-3 py-1.5 text-left hover:bg-accent/50", children: [_jsx("span", { className: "flex-1 min-w-0 text-[13px] text-foreground truncate", children: "Auto" }), model === "auto" && (_jsx(IconCheck, { className: "h-3.5 w-3.5 shrink-0 text-blue-500" }))] })), autoModelGroup && providerGroups.length > 0 && (_jsx("div", { className: "my-1 border-t border-border" })), providerGroups.map((group) => {
456
+ }, className: "flex w-full items-center gap-3 px-3 py-1.5 text-start hover:bg-accent/50", children: [_jsx("span", { className: "flex-1 min-w-0 text-[13px] text-foreground truncate", children: "Auto" }), model === "auto" && (_jsx(IconCheck, { className: "h-3.5 w-3.5 shrink-0 text-blue-500" }))] })), autoModelGroup && providerGroups.length > 0 && (_jsx("div", { className: "my-1 border-t border-border" })), providerGroups.map((group) => {
457
457
  const models = latestModelsOnly(group.models);
458
458
  const groupKey = `${group.engine}:${group.label}`;
459
459
  const isExpanded = expandedGroups.has(groupKey);
460
460
  const ChevronIcon = isExpanded ? IconChevronDown : IconChevronRight;
461
- return (_jsxs("div", { children: [_jsxs("div", { className: "flex items-center hover:bg-accent/30", children: [_jsxs("button", { type: "button", "aria-expanded": isExpanded, onClick: () => toggleGroup(groupKey), className: "flex flex-1 min-w-0 items-center gap-1.5 px-2 py-1.5 cursor-pointer text-left", children: [_jsx(ChevronIcon, { className: "h-3 w-3 shrink-0 text-muted-foreground" }), _jsx("span", { className: "text-[11px] font-medium text-muted-foreground uppercase tracking-wide shrink-0", children: group.label }), !isExpanded && groupKey === selectedGroupKey && (_jsx("span", { className: "text-[11px] text-muted-foreground/80 truncate", children: friendlyModelName(model) }))] }), !group.configured && (_jsx("button", { type: "button", className: "text-[10px] text-muted-foreground/60 hover:text-foreground cursor-pointer pr-3 py-1.5", onClick: openLlmSettings, children: "needs API key" }))] }), isExpanded &&
461
+ return (_jsxs("div", { children: [_jsxs("div", { className: "flex items-center hover:bg-accent/30", children: [_jsxs("button", { type: "button", "aria-expanded": isExpanded, onClick: () => toggleGroup(groupKey), className: "flex flex-1 min-w-0 items-center gap-1.5 px-2 py-1.5 cursor-pointer text-start", children: [_jsx(ChevronIcon, { className: "h-3 w-3 shrink-0 text-muted-foreground rtl:-scale-x-100" }), _jsx("span", { className: "text-[11px] font-medium text-muted-foreground uppercase tracking-wide shrink-0", children: group.label }), !isExpanded && groupKey === selectedGroupKey && (_jsx("span", { className: "text-[11px] text-muted-foreground/80 truncate", children: friendlyModelName(model) }))] }), !group.configured && (_jsx("button", { type: "button", className: "text-[10px] text-muted-foreground/60 hover:text-foreground cursor-pointer pe-3 py-1.5", onClick: openLlmSettings, children: "needs API key" }))] }), isExpanded &&
462
462
  models.map((m) => (_jsxs("button", { type: "button", onClick: () => {
463
463
  if (!group.configured) {
464
464
  openLlmSettings();
@@ -472,11 +472,11 @@ function ModelSelector({ model, effort = "auto", engines, onChange, onEffortChan
472
472
  onEffortChange?.("auto");
473
473
  }
474
474
  setOpen(false);
475
- }, className: `flex w-full items-center gap-3 pl-7 pr-3 py-1.5 text-left ${group.configured
475
+ }, className: `flex w-full items-center gap-3 ps-7 pe-3 py-1.5 text-start ${group.configured
476
476
  ? "hover:bg-accent/50"
477
477
  : "opacity-40 cursor-default"}`, children: [_jsx("span", { className: "flex-1 min-w-0 text-[13px] text-foreground truncate", children: friendlyModelName(m) }), m === model && group.configured && (_jsx(IconCheck, { className: "h-3.5 w-3.5 shrink-0 text-blue-500" }))] }, m)))] }, groupKey));
478
- }), effortOptions.length > 0 && (_jsxs(_Fragment, { children: [_jsx("div", { className: "my-1 border-t border-border" }), _jsx("div", { className: "flex items-center hover:bg-accent/30", children: _jsxs("button", { type: "button", "aria-expanded": reasoningExpanded, onClick: () => setReasoningExpanded((prev) => !prev), className: "flex flex-1 min-w-0 items-center gap-1.5 px-2 py-1.5 cursor-pointer text-left", children: [reasoningExpanded ? (_jsx(IconChevronDown, { className: "h-3 w-3 shrink-0 text-muted-foreground" })) : (_jsx(IconChevronRight, { className: "h-3 w-3 shrink-0 text-muted-foreground" })), _jsx("span", { className: "text-[11px] font-medium text-muted-foreground uppercase tracking-wide shrink-0", children: "Reasoning" }), !reasoningExpanded && (_jsx("span", { className: "text-[11px] text-muted-foreground/80 truncate", children: reasoningEffortLabel(effort) }))] }) }), reasoningExpanded &&
479
- effortOptions.map((option) => (_jsxs("button", { type: "button", onClick: () => onEffortChange?.(option), className: "flex w-full items-center gap-3 pl-7 pr-3 py-1.5 text-left hover:bg-accent/50", children: [_jsx("span", { className: "flex-1 min-w-0 text-[13px] text-foreground truncate", children: reasoningEffortLabel(option) }), option === effort && (_jsx(IconCheck, { className: "h-3.5 w-3.5 shrink-0 text-blue-500" }))] }, option)))] }))] })] }));
478
+ }), effortOptions.length > 0 && (_jsxs(_Fragment, { children: [_jsx("div", { className: "my-1 border-t border-border" }), _jsx("div", { className: "flex items-center hover:bg-accent/30", children: _jsxs("button", { type: "button", "aria-expanded": reasoningExpanded, onClick: () => setReasoningExpanded((prev) => !prev), className: "flex flex-1 min-w-0 items-center gap-1.5 px-2 py-1.5 cursor-pointer text-start", children: [reasoningExpanded ? (_jsx(IconChevronDown, { className: "h-3 w-3 shrink-0 text-muted-foreground" })) : (_jsx(IconChevronRight, { className: "h-3 w-3 shrink-0 text-muted-foreground rtl:-scale-x-100" })), _jsx("span", { className: "text-[11px] font-medium text-muted-foreground uppercase tracking-wide shrink-0", children: "Reasoning" }), !reasoningExpanded && (_jsx("span", { className: "text-[11px] text-muted-foreground/80 truncate", children: reasoningEffortLabel(effort) }))] }) }), reasoningExpanded &&
479
+ effortOptions.map((option) => (_jsxs("button", { type: "button", onClick: () => onEffortChange?.(option), className: "flex w-full items-center gap-3 ps-7 pe-3 py-1.5 text-start hover:bg-accent/50", children: [_jsx("span", { className: "flex-1 min-w-0 text-[13px] text-foreground truncate", children: reasoningEffortLabel(option) }), option === effort && (_jsx(IconCheck, { className: "h-3.5 w-3.5 shrink-0 text-blue-500" }))] }, option)))] }))] })] }));
480
480
  }
481
481
  export function TiptapComposer({ placeholder = "Message agent...", disabled = false, focusRef, initialText, initialTextKey, onSubmit, clearOnSubmit = true, onTextChange, actionButton, extraActionButton, attachButton, modeControl, toolbarSlot, layoutVariant = "default", slashCommands = [], slashSkills = [], includeDefaultSlashCommands = true, includeDefaultSlashSkills = true, onSlashCommand, execMode, onExecModeChange, planModeDisabled = false, planModeDisabledReason, voiceEnabled = DEFAULT_VOICE_DICTATION_ENABLED, selectedModel, selectedEffort, availableModels, onModelChange, onEffortChange, providerConnectStatusEnabled, onConnectProvider, imageModelMenu, draftScope, contextItems = [], onRemoveContextItem, plusMenuMode = "full", interceptBuildRequestsForBuilder = false, onAttachmentError, }) {
482
482
  const [popover, setPopover] = useState(null);
@@ -1373,7 +1373,7 @@ export function TiptapComposer({ placeholder = "Message agent...", disabled = fa
1373
1373
  setComposerMode(null);
1374
1374
  composerModeRef.current = null;
1375
1375
  editor?.commands.focus("end");
1376
- } }) })), hasContextItems && (_jsx("div", { "data-agent-composer-variant": layoutVariant, "data-agent-composer-slot": "context-row", className: "agent-composer-context-row flex flex-wrap gap-1.5 px-2.5 pt-2 pb-0", children: contextItems.map((item) => (_jsxs("span", { className: "inline-flex max-w-full items-center gap-1.5 rounded-md border border-border bg-muted/50 px-2 py-1 text-[11px] font-medium text-foreground", children: [_jsx(IconClipboardList, { className: "h-3 w-3 shrink-0 text-muted-foreground" }), _jsx("span", { className: "min-w-0 truncate", children: item.title }), _jsx("button", { type: "button", onClick: () => onRemoveContextItem?.(item.key), "aria-label": `Remove ${item.title} context`, className: "ml-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-accent hover:text-foreground", children: _jsx(IconX, { className: "h-3 w-3" }) })] }, item.key))) })), _jsx("div", { "data-agent-composer-variant": layoutVariant, "data-agent-composer-slot": "editor-wrap", className: `agent-composer-editor-wrap ${composerMode || hasContextItems ? "px-2 pt-1 pb-1" : "px-2 pt-2 pb-1"}`, children: _jsx(EditorContent, { editor: editor, "data-agent-composer-variant": layoutVariant, "data-agent-composer-slot": "editor", className: "agent-composer-editor aui-composer flex-1 min-w-0 [&_.ProseMirror]:outline-none [&_.ProseMirror_p]:m-0 px-0.5" }) }), voiceEnabled && _jsx(VoiceRecordingOverlay, { voice: voice }), _jsxs("div", { "data-agent-composer-variant": layoutVariant, "data-agent-composer-slot": "toolbar", className: "agent-composer-toolbar flex items-center gap-1 px-2 py-1.5", children: [attachButton ??
1376
+ } }) })), hasContextItems && (_jsx("div", { "data-agent-composer-variant": layoutVariant, "data-agent-composer-slot": "context-row", className: "agent-composer-context-row flex flex-wrap gap-1.5 px-2.5 pt-2 pb-0", children: contextItems.map((item) => (_jsxs("span", { className: "inline-flex max-w-full items-center gap-1.5 rounded-md border border-border bg-muted/50 px-2 py-1 text-[11px] font-medium text-foreground", children: [_jsx(IconClipboardList, { className: "h-3 w-3 shrink-0 text-muted-foreground" }), _jsx("span", { className: "min-w-0 truncate", children: item.title }), _jsx("button", { type: "button", onClick: () => onRemoveContextItem?.(item.key), "aria-label": `Remove ${item.title} context`, className: "ms-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-accent hover:text-foreground", children: _jsx(IconX, { className: "h-3 w-3" }) })] }, item.key))) })), _jsx("div", { "data-agent-composer-variant": layoutVariant, "data-agent-composer-slot": "editor-wrap", className: `agent-composer-editor-wrap ${composerMode || hasContextItems ? "px-2 pt-1 pb-1" : "px-2 pt-2 pb-1"}`, children: _jsx(EditorContent, { editor: editor, "data-agent-composer-variant": layoutVariant, "data-agent-composer-slot": "editor", className: "agent-composer-editor aui-composer flex-1 min-w-0 [&_.ProseMirror]:outline-none [&_.ProseMirror_p]:m-0 px-0.5" }) }), voiceEnabled && _jsx(VoiceRecordingOverlay, { voice: voice }), _jsxs("div", { "data-agent-composer-variant": layoutVariant, "data-agent-composer-slot": "toolbar", className: "agent-composer-toolbar flex items-center gap-1 px-2 py-1.5", children: [attachButton ??
1377
1377
  (plusMenuMode === "hidden" ? null : (_jsx(ComposerPlusMenu, { onSelectMode: handleSelectMode, mode: plusMenuMode, onAttachmentError: onAttachmentError }))), toolbarSlot ?? modeControl, _jsx("div", { "data-agent-composer-slot": "toolbar-spacer", className: "flex-1" }), selectedModel && availableModels && onModelChange && (_jsx(ModelSelector, { model: selectedModel, effort: selectedEffort, engines: availableModels, onChange: onModelChange, onEffortChange: onEffortChange, providerConnectStatusEnabled: providerConnectStatusEnabled, onConnectProvider: onConnectProvider, imageModel: imageModelMenu })), execMode && onExecModeChange && (_jsx(ModeSelector, { mode: execMode, onChange: onExecModeChange, planModeDisabled: planModeDisabled, planModeDisabledReason: planModeDisabledReason })), actionButton ?? (_jsxs(_Fragment, { children: [extraActionButton, voiceEnabled && (_jsx(VoiceButton, { voice: voice, isMac: isMac, disabled: disabled })), _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("button", { type: "button", onClick: () => submitComposer("immediate"), disabled: !canSend, "data-agent-composer-slot": "send-button", className: "agent-composer-send-button shrink-0 flex h-7 w-7 items-center justify-center rounded-md bg-primary text-primary-foreground hover:opacity-90 disabled:opacity-30 disabled:cursor-not-allowed", children: _jsx(IconArrowUp, { className: "h-3.5 w-3.5" }) }) }), _jsx(TooltipContent, { children: "Send message" })] })] }))] }), _jsx(MentionPopover, { ref: popoverRef, type: popover?.type ?? "@", position: popover?.position ?? null, mentionItems: mentionItems, skills: filteredSkills, commands: filteredCommands, hint: hint, isLoading: popover?.type === "@" ? mentionsLoading : skillsLoading, query: popover?.query ?? "", onSelectMention: handleSelectMention, onSelectSkill: handleSelectSkill, onSelectCommand: handleSelectCommand, onClose: closePopover })] }));
1378
1378
  }
1379
1379
  //# sourceMappingURL=TiptapComposer.js.map