@agent-native/core 0.110.2 → 0.111.0

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 (380) hide show
  1. package/corpus/README.md +1 -1
  2. package/corpus/core/CHANGELOG.md +17 -0
  3. package/corpus/core/docs/content/components.mdx +7 -0
  4. package/corpus/core/docs/content/locales/ar-SA/components.mdx +4 -2
  5. package/corpus/core/docs/content/locales/de-DE/components.mdx +4 -2
  6. package/corpus/core/docs/content/locales/es-ES/components.mdx +4 -2
  7. package/corpus/core/docs/content/locales/fr-FR/components.mdx +4 -2
  8. package/corpus/core/docs/content/locales/hi-IN/components.mdx +3 -2
  9. package/corpus/core/docs/content/locales/ja-JP/components.mdx +3 -2
  10. package/corpus/core/docs/content/locales/ko-KR/components.mdx +3 -2
  11. package/corpus/core/docs/content/locales/pt-BR/components.mdx +4 -2
  12. package/corpus/core/docs/content/locales/zh-CN/components.mdx +3 -2
  13. package/corpus/core/docs/content/locales/zh-TW/components.mdx +3 -2
  14. package/corpus/core/docs/content/toolkit-agent-ux.mdx +8 -3
  15. package/corpus/core/migration-manifest.json +133 -269
  16. package/corpus/core/package.json +32 -33
  17. package/corpus/core/scripts/check-dist-imports.mjs +25 -1
  18. package/corpus/core/scripts/finalize-build.mjs +59 -2
  19. package/corpus/core/src/client/AgentAskPopover.tsx +1 -1
  20. package/corpus/core/src/client/AgentPanel.tsx +1 -1
  21. package/corpus/core/src/client/AssistantChat.tsx +12 -14
  22. package/corpus/core/src/client/NewWorkspaceAppFlow.tsx +1 -1
  23. package/corpus/core/src/client/agent-chat-adapter.ts +1 -1
  24. package/corpus/core/src/client/blocks/RegistryBlockDataProvider.tsx +121 -0
  25. package/corpus/core/src/client/blocks/index.ts +6 -0
  26. package/corpus/core/src/client/chat/attachment-adapters.ts +4 -5
  27. package/corpus/core/src/client/chat/index.ts +0 -1
  28. package/corpus/core/src/client/chat/message-components.tsx +2 -2
  29. package/corpus/core/src/client/code-agent-chat-adapter.ts +2 -2
  30. package/corpus/core/src/client/collab/index.ts +0 -22
  31. package/corpus/core/src/client/composer/index.ts +5 -66
  32. package/corpus/core/src/client/composer/runtime-adapters.tsx +123 -0
  33. package/corpus/core/src/client/composer/use-mention-search.ts +2 -79
  34. package/corpus/core/src/client/composer/wired-components.tsx +53 -0
  35. package/corpus/core/src/client/extensions/ExtensionViewer.tsx +1 -1
  36. package/corpus/core/src/client/extensions/ExtensionsListPage.tsx +1 -1
  37. package/corpus/core/src/client/extensions/ExtensionsSidebarSection.tsx +1 -1
  38. package/corpus/core/src/client/index.ts +0 -156
  39. package/corpus/core/src/client/resources/ResourceEditor.tsx +29 -681
  40. package/corpus/core/src/client/resources/ResourcesPanel.tsx +1 -1
  41. package/corpus/core/src/client/settings/AutomationsSection.tsx +1 -1
  42. package/corpus/core/src/client/sharing/index.ts +0 -4
  43. package/corpus/core/src/client/tombstone/agent-presence-chip.ts +17 -0
  44. package/corpus/core/src/client/tombstone/editor.ts +265 -0
  45. package/corpus/core/src/client/tombstone/live-cursor-overlay.ts +21 -0
  46. package/corpus/core/src/client/tombstone/presence-bar.ts +17 -0
  47. package/corpus/core/src/client/tombstone/recent-edit-highlights.ts +17 -0
  48. package/corpus/core/src/client/tombstone/remote-selection-rings.ts +21 -0
  49. package/corpus/core/src/client/tombstone/rich-markdown-editor.ts +265 -0
  50. package/corpus/core/src/client/tombstone/ui-dialog.ts +49 -0
  51. package/corpus/core/src/client/tombstone/ui-dropdown-menu.ts +69 -0
  52. package/corpus/core/src/client/tombstone/ui-hover-card.ts +21 -0
  53. package/corpus/core/src/client/tombstone/ui-popover.ts +25 -0
  54. package/corpus/core/src/client/tombstone/ui-sheet.ts +49 -0
  55. package/corpus/core/src/client/tombstone/ui-tooltip.ts +29 -0
  56. package/corpus/core/src/client/tombstone/visual-style-controls.ts +61 -0
  57. package/corpus/core/src/client/uploads/index.ts +5 -0
  58. package/corpus/core/src/client/{rich-markdown-editor/uploadEditorImage.ts → uploads/upload-editor-image.ts} +11 -4
  59. package/corpus/core/src/package-lifecycle/tombstone.ts +16 -2
  60. package/corpus/core/src/package-lifecycle/upgrade-error.ts +23 -5
  61. package/corpus/core/src/testing.ts +1 -4
  62. package/corpus/core/src/vite/client.ts +62 -22
  63. package/corpus/templates/content/app/components/editor/VisualEditor.tsx +2 -4
  64. package/corpus/templates/content/app/components/editor/extensions/registryBlocks.ts +1 -1
  65. package/corpus/templates/content/app/components/editor/registrySlashItems.ts +53 -52
  66. package/corpus/templates/plan/app/components/editor/PlanBlockNode.tsx +2 -2
  67. package/corpus/templates/plan/app/components/editor/planSlashCommands.ts +1 -1
  68. package/corpus/templates/plan/app/components/plan/DocumentArea.tsx +1 -1
  69. package/corpus/templates/plan/app/components/plan/PlanImageNode.tsx +1 -1
  70. package/corpus/templates/plan/app/components/plan/PlanMarkdownEditor.tsx +1 -1
  71. package/dist/catalog.json +1 -0
  72. package/dist/client/AgentAskPopover.js +1 -1
  73. package/dist/client/AgentAskPopover.js.map +1 -1
  74. package/dist/client/AgentPanel.js +1 -1
  75. package/dist/client/AgentPanel.js.map +1 -1
  76. package/dist/client/AssistantChat.d.ts +2 -2
  77. package/dist/client/AssistantChat.d.ts.map +1 -1
  78. package/dist/client/AssistantChat.js +5 -6
  79. package/dist/client/AssistantChat.js.map +1 -1
  80. package/dist/client/NewWorkspaceAppFlow.js +1 -1
  81. package/dist/client/NewWorkspaceAppFlow.js.map +1 -1
  82. package/dist/client/agent-chat-adapter.d.ts.map +1 -1
  83. package/dist/client/agent-chat-adapter.js +1 -1
  84. package/dist/client/agent-chat-adapter.js.map +1 -1
  85. package/dist/client/blocks/RegistryBlockDataProvider.d.ts +7 -0
  86. package/dist/client/blocks/RegistryBlockDataProvider.d.ts.map +1 -0
  87. package/dist/client/blocks/RegistryBlockDataProvider.js +54 -0
  88. package/dist/client/blocks/RegistryBlockDataProvider.js.map +1 -0
  89. package/dist/client/blocks/index.d.ts +2 -0
  90. package/dist/client/blocks/index.d.ts.map +1 -1
  91. package/dist/client/blocks/index.js +1 -0
  92. package/dist/client/blocks/index.js.map +1 -1
  93. package/dist/client/chat/attachment-adapters.d.ts.map +1 -1
  94. package/dist/client/chat/attachment-adapters.js +1 -1
  95. package/dist/client/chat/attachment-adapters.js.map +1 -1
  96. package/dist/client/chat/index.d.ts +0 -1
  97. package/dist/client/chat/index.d.ts.map +1 -1
  98. package/dist/client/chat/index.js +0 -1
  99. package/dist/client/chat/index.js.map +1 -1
  100. package/dist/client/chat/message-components.d.ts.map +1 -1
  101. package/dist/client/chat/message-components.js +2 -2
  102. package/dist/client/chat/message-components.js.map +1 -1
  103. package/dist/client/code-agent-chat-adapter.d.ts.map +1 -1
  104. package/dist/client/code-agent-chat-adapter.js +1 -1
  105. package/dist/client/code-agent-chat-adapter.js.map +1 -1
  106. package/dist/client/collab/index.d.ts +0 -5
  107. package/dist/client/collab/index.d.ts.map +1 -1
  108. package/dist/client/collab/index.js +0 -5
  109. package/dist/client/collab/index.js.map +1 -1
  110. package/dist/client/composer/index.d.ts +3 -11
  111. package/dist/client/composer/index.d.ts.map +1 -1
  112. package/dist/client/composer/index.js +3 -10
  113. package/dist/client/composer/index.js.map +1 -1
  114. package/dist/client/composer/runtime-adapters.d.ts +5 -0
  115. package/dist/client/composer/runtime-adapters.d.ts.map +1 -0
  116. package/dist/client/composer/runtime-adapters.js +85 -0
  117. package/dist/client/composer/runtime-adapters.js.map +1 -0
  118. package/dist/client/composer/use-mention-search.d.ts +1 -2
  119. package/dist/client/composer/use-mention-search.d.ts.map +1 -1
  120. package/dist/client/composer/use-mention-search.js +2 -69
  121. package/dist/client/composer/use-mention-search.js.map +1 -1
  122. package/dist/client/composer/wired-components.d.ts +10 -0
  123. package/dist/client/composer/wired-components.d.ts.map +1 -0
  124. package/dist/client/composer/wired-components.js +20 -0
  125. package/dist/client/composer/wired-components.js.map +1 -0
  126. package/dist/client/extensions/ExtensionViewer.js +1 -1
  127. package/dist/client/extensions/ExtensionViewer.js.map +1 -1
  128. package/dist/client/extensions/ExtensionsListPage.js +1 -1
  129. package/dist/client/extensions/ExtensionsListPage.js.map +1 -1
  130. package/dist/client/extensions/ExtensionsSidebarSection.js +1 -1
  131. package/dist/client/extensions/ExtensionsSidebarSection.js.map +1 -1
  132. package/dist/client/index.d.ts +0 -10
  133. package/dist/client/index.d.ts.map +1 -1
  134. package/dist/client/index.js +0 -26
  135. package/dist/client/index.js.map +1 -1
  136. package/dist/client/resources/ResourceEditor.d.ts.map +1 -1
  137. package/dist/client/resources/ResourceEditor.js +14 -532
  138. package/dist/client/resources/ResourceEditor.js.map +1 -1
  139. package/dist/client/resources/ResourcesPanel.js +1 -1
  140. package/dist/client/resources/ResourcesPanel.js.map +1 -1
  141. package/dist/client/settings/AutomationsSection.js +1 -1
  142. package/dist/client/settings/AutomationsSection.js.map +1 -1
  143. package/dist/client/sharing/index.d.ts +0 -1
  144. package/dist/client/sharing/index.d.ts.map +1 -1
  145. package/dist/client/sharing/index.js +0 -1
  146. package/dist/client/sharing/index.js.map +1 -1
  147. package/dist/client/tombstone/agent-presence-chip.d.ts +6 -0
  148. package/dist/client/tombstone/agent-presence-chip.d.ts.map +1 -0
  149. package/dist/client/tombstone/agent-presence-chip.js +5 -0
  150. package/dist/client/tombstone/agent-presence-chip.js.map +1 -0
  151. package/dist/client/tombstone/editor.d.ts +128 -0
  152. package/dist/client/tombstone/editor.d.ts.map +1 -0
  153. package/dist/client/tombstone/editor.js +76 -0
  154. package/dist/client/tombstone/editor.js.map +1 -0
  155. package/dist/client/tombstone/live-cursor-overlay.d.ts +8 -0
  156. package/dist/client/tombstone/live-cursor-overlay.d.ts.map +1 -0
  157. package/dist/client/tombstone/live-cursor-overlay.js +5 -0
  158. package/dist/client/tombstone/live-cursor-overlay.js.map +1 -0
  159. package/dist/client/tombstone/presence-bar.d.ts +6 -0
  160. package/dist/client/tombstone/presence-bar.d.ts.map +1 -0
  161. package/dist/client/tombstone/presence-bar.js +5 -0
  162. package/dist/client/tombstone/presence-bar.js.map +1 -0
  163. package/dist/client/tombstone/recent-edit-highlights.d.ts +6 -0
  164. package/dist/client/tombstone/recent-edit-highlights.d.ts.map +1 -0
  165. package/dist/client/tombstone/recent-edit-highlights.js +5 -0
  166. package/dist/client/tombstone/recent-edit-highlights.js.map +1 -0
  167. package/dist/client/tombstone/remote-selection-rings.d.ts +8 -0
  168. package/dist/client/tombstone/remote-selection-rings.d.ts.map +1 -0
  169. package/dist/client/tombstone/remote-selection-rings.js +5 -0
  170. package/dist/client/tombstone/remote-selection-rings.js.map +1 -0
  171. package/dist/client/tombstone/rich-markdown-editor.d.ts +128 -0
  172. package/dist/client/tombstone/rich-markdown-editor.d.ts.map +1 -0
  173. package/dist/client/tombstone/rich-markdown-editor.js +76 -0
  174. package/dist/client/tombstone/rich-markdown-editor.js.map +1 -0
  175. package/dist/client/tombstone/ui-dialog.d.ts +22 -0
  176. package/dist/client/tombstone/ui-dialog.d.ts.map +1 -0
  177. package/dist/client/tombstone/ui-dialog.js +23 -0
  178. package/dist/client/tombstone/ui-dialog.js.map +1 -0
  179. package/dist/client/tombstone/ui-dropdown-menu.d.ts +32 -0
  180. package/dist/client/tombstone/ui-dropdown-menu.d.ts.map +1 -0
  181. package/dist/client/tombstone/ui-dropdown-menu.js +33 -0
  182. package/dist/client/tombstone/ui-dropdown-menu.js.map +1 -0
  183. package/dist/client/tombstone/ui-hover-card.d.ts +8 -0
  184. package/dist/client/tombstone/ui-hover-card.d.ts.map +1 -0
  185. package/dist/client/tombstone/ui-hover-card.js +9 -0
  186. package/dist/client/tombstone/ui-hover-card.js.map +1 -0
  187. package/dist/client/tombstone/ui-popover.d.ts +10 -0
  188. package/dist/client/tombstone/ui-popover.d.ts.map +1 -0
  189. package/dist/client/tombstone/ui-popover.js +11 -0
  190. package/dist/client/tombstone/ui-popover.js.map +1 -0
  191. package/dist/client/tombstone/ui-sheet.d.ts +22 -0
  192. package/dist/client/tombstone/ui-sheet.d.ts.map +1 -0
  193. package/dist/client/tombstone/ui-sheet.js +23 -0
  194. package/dist/client/tombstone/ui-sheet.js.map +1 -0
  195. package/dist/client/tombstone/ui-tooltip.d.ts +12 -0
  196. package/dist/client/tombstone/ui-tooltip.d.ts.map +1 -0
  197. package/dist/client/tombstone/ui-tooltip.js +13 -0
  198. package/dist/client/tombstone/ui-tooltip.js.map +1 -0
  199. package/dist/client/tombstone/visual-style-controls.d.ts +28 -0
  200. package/dist/client/tombstone/visual-style-controls.d.ts.map +1 -0
  201. package/dist/client/tombstone/visual-style-controls.js +23 -0
  202. package/dist/client/tombstone/visual-style-controls.js.map +1 -0
  203. package/dist/client/uploads/index.d.ts +1 -0
  204. package/dist/client/uploads/index.d.ts.map +1 -1
  205. package/dist/client/uploads/index.js +1 -0
  206. package/dist/client/uploads/index.js.map +1 -1
  207. package/dist/client/{rich-markdown-editor/uploadEditorImage.d.ts → uploads/upload-editor-image.d.ts} +8 -4
  208. package/dist/client/uploads/upload-editor-image.d.ts.map +1 -0
  209. package/dist/client/{rich-markdown-editor/uploadEditorImage.js → uploads/upload-editor-image.js} +2 -2
  210. package/dist/client/uploads/upload-editor-image.js.map +1 -0
  211. package/dist/collab/struct-routes.d.ts +1 -1
  212. package/dist/notifications/routes.d.ts +3 -3
  213. package/dist/package-lifecycle/tombstone.d.ts.map +1 -1
  214. package/dist/package-lifecycle/tombstone.js +13 -3
  215. package/dist/package-lifecycle/tombstone.js.map +1 -1
  216. package/dist/package-lifecycle/upgrade-error.d.ts +2 -2
  217. package/dist/package-lifecycle/upgrade-error.d.ts.map +1 -1
  218. package/dist/package-lifecycle/upgrade-error.js +8 -5
  219. package/dist/package-lifecycle/upgrade-error.js.map +1 -1
  220. package/dist/secrets/routes.d.ts +9 -9
  221. package/dist/server/agent-engine-api-key-route.d.ts +1 -1
  222. package/dist/server/transcribe-voice.d.ts +1 -1
  223. package/dist/testing.d.ts +1 -3
  224. package/dist/testing.d.ts.map +1 -1
  225. package/dist/testing.js +1 -3
  226. package/dist/testing.js.map +1 -1
  227. package/dist/vite/client.d.ts.map +1 -1
  228. package/dist/vite/client.js +26 -22
  229. package/dist/vite/client.js.map +1 -1
  230. package/docs/content/components.mdx +7 -0
  231. package/docs/content/locales/ar-SA/components.mdx +4 -2
  232. package/docs/content/locales/de-DE/components.mdx +4 -2
  233. package/docs/content/locales/es-ES/components.mdx +4 -2
  234. package/docs/content/locales/fr-FR/components.mdx +4 -2
  235. package/docs/content/locales/hi-IN/components.mdx +3 -2
  236. package/docs/content/locales/ja-JP/components.mdx +3 -2
  237. package/docs/content/locales/ko-KR/components.mdx +3 -2
  238. package/docs/content/locales/pt-BR/components.mdx +4 -2
  239. package/docs/content/locales/zh-CN/components.mdx +3 -2
  240. package/docs/content/locales/zh-TW/components.mdx +3 -2
  241. package/docs/content/toolkit-agent-ux.mdx +8 -3
  242. package/migration-manifest.json +133 -269
  243. package/package.json +31 -32
  244. package/corpus/core/src/client/composer/AgentComposerFrame.tsx +0 -59
  245. package/corpus/core/src/client/composer/ComposerPlusMenu.tsx +0 -988
  246. package/corpus/core/src/client/composer/MentionPopover.tsx +0 -412
  247. package/corpus/core/src/client/composer/PastedTextChip.tsx +0 -150
  248. package/corpus/core/src/client/composer/PromptComposer.tsx +0 -714
  249. package/corpus/core/src/client/composer/RealtimeVoiceMode.tsx +0 -860
  250. package/corpus/core/src/client/composer/TiptapComposer.tsx +0 -2928
  251. package/corpus/core/src/client/composer/VoiceButton.tsx +0 -262
  252. package/corpus/core/src/client/composer/asset-picker-url.ts +0 -80
  253. package/corpus/core/src/client/composer/attachment-accept.ts +0 -71
  254. package/corpus/core/src/client/composer/draft-key.ts +0 -7
  255. package/corpus/core/src/client/composer/extensions/FileReference.tsx +0 -55
  256. package/corpus/core/src/client/composer/extensions/MentionReference.tsx +0 -93
  257. package/corpus/core/src/client/composer/extensions/SkillReference.tsx +0 -56
  258. package/corpus/core/src/client/composer/pasted-text.ts +0 -160
  259. package/corpus/core/src/client/composer/prompt-attachments.ts +0 -70
  260. package/corpus/core/src/client/composer/realtime-voice-audio-level.ts +0 -64
  261. package/corpus/core/src/client/composer/realtime-voice-transcript.ts +0 -134
  262. package/corpus/core/src/client/composer/types.ts +0 -66
  263. package/corpus/core/src/client/composer/use-file-search.ts +0 -63
  264. package/corpus/core/src/client/composer/use-skills.ts +0 -44
  265. package/corpus/core/src/client/composer/useRealtimeVoiceMode.tsx +0 -2095
  266. package/corpus/core/src/client/composer/useVoiceDictation.ts +0 -1155
  267. package/corpus/core/src/client/editor/index.ts +0 -1
  268. package/corpus/core/src/client/rich-markdown-editor/RegistryBlockNode.tsx +0 -799
  269. package/corpus/core/src/client/rich-markdown-editor/index.ts +0 -70
  270. package/corpus/core/src/client/rich-markdown-editor/registrySlashCommands.ts +0 -112
  271. package/dist/client/composer/AgentComposerFrame.d.ts +0 -19
  272. package/dist/client/composer/AgentComposerFrame.d.ts.map +0 -1
  273. package/dist/client/composer/AgentComposerFrame.js +0 -14
  274. package/dist/client/composer/AgentComposerFrame.js.map +0 -1
  275. package/dist/client/composer/ComposerPlusMenu.d.ts +0 -17
  276. package/dist/client/composer/ComposerPlusMenu.d.ts.map +0 -1
  277. package/dist/client/composer/ComposerPlusMenu.js +0 -501
  278. package/dist/client/composer/ComposerPlusMenu.js.map +0 -1
  279. package/dist/client/composer/MentionPopover.d.ts +0 -29
  280. package/dist/client/composer/MentionPopover.d.ts.map +0 -1
  281. package/dist/client/composer/MentionPopover.js +0 -180
  282. package/dist/client/composer/MentionPopover.js.map +0 -1
  283. package/dist/client/composer/PastedTextChip.d.ts +0 -9
  284. package/dist/client/composer/PastedTextChip.d.ts.map +0 -1
  285. package/dist/client/composer/PastedTextChip.js +0 -47
  286. package/dist/client/composer/PastedTextChip.js.map +0 -1
  287. package/dist/client/composer/PromptComposer.d.ts +0 -115
  288. package/dist/client/composer/PromptComposer.d.ts.map +0 -1
  289. package/dist/client/composer/PromptComposer.js +0 -299
  290. package/dist/client/composer/PromptComposer.js.map +0 -1
  291. package/dist/client/composer/RealtimeVoiceMode.d.ts +0 -104
  292. package/dist/client/composer/RealtimeVoiceMode.d.ts.map +0 -1
  293. package/dist/client/composer/RealtimeVoiceMode.js +0 -245
  294. package/dist/client/composer/RealtimeVoiceMode.js.map +0 -1
  295. package/dist/client/composer/TiptapComposer.d.ts +0 -222
  296. package/dist/client/composer/TiptapComposer.d.ts.map +0 -1
  297. package/dist/client/composer/TiptapComposer.js +0 -1834
  298. package/dist/client/composer/TiptapComposer.js.map +0 -1
  299. package/dist/client/composer/VoiceButton.d.ts +0 -23
  300. package/dist/client/composer/VoiceButton.d.ts.map +0 -1
  301. package/dist/client/composer/VoiceButton.js +0 -100
  302. package/dist/client/composer/VoiceButton.js.map +0 -1
  303. package/dist/client/composer/asset-picker-url.d.ts +0 -16
  304. package/dist/client/composer/asset-picker-url.d.ts.map +0 -1
  305. package/dist/client/composer/asset-picker-url.js +0 -64
  306. package/dist/client/composer/asset-picker-url.js.map +0 -1
  307. package/dist/client/composer/attachment-accept.d.ts +0 -9
  308. package/dist/client/composer/attachment-accept.d.ts.map +0 -1
  309. package/dist/client/composer/attachment-accept.js +0 -65
  310. package/dist/client/composer/attachment-accept.js.map +0 -1
  311. package/dist/client/composer/draft-key.d.ts +0 -2
  312. package/dist/client/composer/draft-key.d.ts.map +0 -1
  313. package/dist/client/composer/draft-key.js +0 -8
  314. package/dist/client/composer/draft-key.js.map +0 -1
  315. package/dist/client/composer/extensions/FileReference.d.ts +0 -3
  316. package/dist/client/composer/extensions/FileReference.d.ts.map +0 -1
  317. package/dist/client/composer/extensions/FileReference.js +0 -36
  318. package/dist/client/composer/extensions/FileReference.js.map +0 -1
  319. package/dist/client/composer/extensions/MentionReference.d.ts +0 -3
  320. package/dist/client/composer/extensions/MentionReference.d.ts.map +0 -1
  321. package/dist/client/composer/extensions/MentionReference.js +0 -66
  322. package/dist/client/composer/extensions/MentionReference.js.map +0 -1
  323. package/dist/client/composer/extensions/SkillReference.d.ts +0 -3
  324. package/dist/client/composer/extensions/SkillReference.d.ts.map +0 -1
  325. package/dist/client/composer/extensions/SkillReference.js +0 -40
  326. package/dist/client/composer/extensions/SkillReference.js.map +0 -1
  327. package/dist/client/composer/pasted-text.d.ts +0 -31
  328. package/dist/client/composer/pasted-text.d.ts.map +0 -1
  329. package/dist/client/composer/pasted-text.js +0 -130
  330. package/dist/client/composer/pasted-text.js.map +0 -1
  331. package/dist/client/composer/prompt-attachments.d.ts +0 -11
  332. package/dist/client/composer/prompt-attachments.d.ts.map +0 -1
  333. package/dist/client/composer/prompt-attachments.js +0 -45
  334. package/dist/client/composer/prompt-attachments.js.map +0 -1
  335. package/dist/client/composer/realtime-voice-audio-level.d.ts +0 -14
  336. package/dist/client/composer/realtime-voice-audio-level.d.ts.map +0 -1
  337. package/dist/client/composer/realtime-voice-audio-level.js +0 -47
  338. package/dist/client/composer/realtime-voice-audio-level.js.map +0 -1
  339. package/dist/client/composer/realtime-voice-transcript.d.ts +0 -26
  340. package/dist/client/composer/realtime-voice-transcript.d.ts.map +0 -1
  341. package/dist/client/composer/realtime-voice-transcript.js +0 -103
  342. package/dist/client/composer/realtime-voice-transcript.js.map +0 -1
  343. package/dist/client/composer/types.d.ts +0 -60
  344. package/dist/client/composer/types.d.ts.map +0 -1
  345. package/dist/client/composer/types.js +0 -2
  346. package/dist/client/composer/types.js.map +0 -1
  347. package/dist/client/composer/use-file-search.d.ts +0 -6
  348. package/dist/client/composer/use-file-search.d.ts.map +0 -1
  349. package/dist/client/composer/use-file-search.js +0 -52
  350. package/dist/client/composer/use-file-search.js.map +0 -1
  351. package/dist/client/composer/use-skills.d.ts +0 -7
  352. package/dist/client/composer/use-skills.d.ts.map +0 -1
  353. package/dist/client/composer/use-skills.js +0 -39
  354. package/dist/client/composer/use-skills.js.map +0 -1
  355. package/dist/client/composer/useRealtimeVoiceMode.d.ts +0 -172
  356. package/dist/client/composer/useRealtimeVoiceMode.d.ts.map +0 -1
  357. package/dist/client/composer/useRealtimeVoiceMode.js +0 -1648
  358. package/dist/client/composer/useRealtimeVoiceMode.js.map +0 -1
  359. package/dist/client/composer/useVoiceDictation.d.ts +0 -57
  360. package/dist/client/composer/useVoiceDictation.d.ts.map +0 -1
  361. package/dist/client/composer/useVoiceDictation.js +0 -975
  362. package/dist/client/composer/useVoiceDictation.js.map +0 -1
  363. package/dist/client/editor/index.d.ts +0 -2
  364. package/dist/client/editor/index.d.ts.map +0 -1
  365. package/dist/client/editor/index.js +0 -2
  366. package/dist/client/editor/index.js.map +0 -1
  367. package/dist/client/rich-markdown-editor/RegistryBlockNode.d.ts +0 -130
  368. package/dist/client/rich-markdown-editor/RegistryBlockNode.d.ts.map +0 -1
  369. package/dist/client/rich-markdown-editor/RegistryBlockNode.js +0 -426
  370. package/dist/client/rich-markdown-editor/RegistryBlockNode.js.map +0 -1
  371. package/dist/client/rich-markdown-editor/index.d.ts +0 -5
  372. package/dist/client/rich-markdown-editor/index.d.ts.map +0 -1
  373. package/dist/client/rich-markdown-editor/index.js +0 -5
  374. package/dist/client/rich-markdown-editor/index.js.map +0 -1
  375. package/dist/client/rich-markdown-editor/registrySlashCommands.d.ts +0 -60
  376. package/dist/client/rich-markdown-editor/registrySlashCommands.d.ts.map +0 -1
  377. package/dist/client/rich-markdown-editor/registrySlashCommands.js +0 -51
  378. package/dist/client/rich-markdown-editor/registrySlashCommands.js.map +0 -1
  379. package/dist/client/rich-markdown-editor/uploadEditorImage.d.ts.map +0 -1
  380. package/dist/client/rich-markdown-editor/uploadEditorImage.js.map +0 -1
@@ -1,245 +0,0 @@
1
- import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Button } from "@agent-native/toolkit/ui/button";
3
- import { Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, } from "@agent-native/toolkit/ui/select";
4
- import { IconAlertTriangle, IconBrain, IconLanguage, IconLoader2, IconMicrophone, IconPhoneOff, IconSettings, IconVolume, } from "@tabler/icons-react";
5
- import { useCallback, useEffect, useId, useRef, useState, useSyncExternalStore, } from "react";
6
- import { Popover, PopoverAnchor, PopoverContent, PopoverTrigger, } from "../components/ui/popover.js";
7
- import { Tooltip, TooltipContent, TooltipTrigger, } from "../components/ui/tooltip.js";
8
- import { cn } from "../utils.js";
9
- import { createRealtimeVoiceAudioLevelStore, } from "./realtime-voice-audio-level.js";
10
- /**
11
- * Composer mic entry point for apps that support a full-duplex voice session.
12
- * The first click offers voice mode without silently changing the existing
13
- * editable-dictation behavior.
14
- */
15
- export function RealtimeVoiceModeEntry({ copy, disabled, providerStatusPending = false, open: controlledOpen, onOpenChange, onStartVoiceMode, onKeepDictating, setupRequired = false, openAiConfigured = false, connectingBuilder = false, onConnectBuilder, onUseOpenAiKey, className, }) {
16
- const [uncontrolledOpen, setUncontrolledOpen] = useState(false);
17
- const open = controlledOpen ?? uncontrolledOpen;
18
- const titleId = useId();
19
- const descriptionId = useId();
20
- const [collisionBoundary, setCollisionBoundary] = useState(null);
21
- const setTriggerNode = useCallback((node) => {
22
- const nextBoundary = node?.closest(".agent-panel-root") ?? null;
23
- setCollisionBoundary((currentBoundary) => currentBoundary === nextBoundary ? currentBoundary : nextBoundary);
24
- }, []);
25
- const setOpen = (nextOpen) => {
26
- if (controlledOpen === undefined)
27
- setUncontrolledOpen(nextOpen);
28
- onOpenChange?.(nextOpen);
29
- };
30
- const choose = (callback) => {
31
- setOpen(false);
32
- callback();
33
- };
34
- return (_jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx(PopoverTrigger, { asChild: true, children: _jsx(Button, { ref: setTriggerNode, type: "button", variant: "ghost", size: "icon", disabled: disabled, "aria-label": copy.entryButtonLabel, "aria-expanded": open, className: cn("size-7 shrink-0 text-muted-foreground hover:text-foreground", className), children: _jsx(IconMicrophone, {}) }) }) }), _jsx(TooltipContent, { children: copy.entryButtonLabel })] }), _jsx(PopoverContent, { side: "top", align: "end", sideOffset: 10, collisionBoundary: collisionBoundary ?? undefined, collisionPadding: 16, "data-collision-boundary": collisionBoundary ? "agent-panel" : "viewport", className: cn("p-4", setupRequired
35
- ? "w-[min(calc(100vw-2rem),var(--radix-popover-content-available-width,30rem),30rem)]"
36
- : "w-[min(calc(100vw-2rem),var(--radix-popover-content-available-width,22rem),22rem)]"), "aria-labelledby": titleId, "aria-describedby": descriptionId, children: _jsxs("div", { className: "grid gap-3", children: [_jsxs("div", { className: "grid gap-1", children: [_jsx("h2", { id: titleId, className: "text-sm font-semibold text-foreground", children: setupRequired ? copy.setupTitle : copy.promptTitle }), _jsx("p", { id: descriptionId, className: "text-sm leading-relaxed text-muted-foreground", children: setupRequired ? copy.setupDescription : copy.promptDescription })] }), _jsxs("div", { className: "flex flex-col-reverse gap-2 sm:flex-row sm:flex-wrap sm:justify-end", children: [_jsx(Button, { type: "button", variant: "ghost", size: "sm", onClick: () => choose(onKeepDictating), children: copy.keepDictating }), setupRequired ? (_jsxs(_Fragment, { children: [_jsx(Button, { type: "button", variant: "outline", size: "sm", onClick: () => choose(onUseOpenAiKey ?? onStartVoiceMode), children: openAiConfigured
37
- ? copy.startWithOpenAiKey
38
- : copy.useOpenAiKey }), _jsxs(Button, { type: "button", size: "sm", className: "whitespace-nowrap", disabled: connectingBuilder, onClick: () => choose(onConnectBuilder ?? onStartVoiceMode), children: [connectingBuilder ? (_jsx(IconLoader2, { className: "animate-spin" })) : null, copy.connectBuilder] })] })) : (_jsxs(Button, { type: "button", size: "sm", disabled: providerStatusPending, onClick: () => choose(onStartVoiceMode), children: [providerStatusPending ? (_jsx(IconLoader2, { className: "animate-spin" })) : (_jsx(IconMicrophone, {})), copy.startVoiceMode] }))] })] }) })] }));
39
- }
40
- const SILENT_AUDIO_LEVELS = createRealtimeVoiceAudioLevelStore();
41
- const WAVEFORM_WEIGHTS = [0.55, 0.82, 1, 0.82, 0.55];
42
- const AUDIO_ACTIVITY_THRESHOLD = 0.035;
43
- function usePrefersReducedMotion() {
44
- const [reduced, setReduced] = useState(false);
45
- useEffect(() => {
46
- if (typeof window === "undefined" || !window.matchMedia)
47
- return;
48
- const query = window.matchMedia("(prefers-reduced-motion: reduce)");
49
- const update = () => setReduced(query.matches);
50
- update();
51
- query.addEventListener?.("change", update);
52
- return () => query.removeEventListener?.("change", update);
53
- }, []);
54
- return reduced;
55
- }
56
- function VoiceWaveform({ level, reducedMotion, activity, }) {
57
- const visibleLevel = reducedMotion ? 0.45 : level;
58
- return (_jsx("span", { "aria-hidden": "true", className: "flex h-6 items-center justify-center gap-0.5", "data-realtime-voice-waveform": "true", "data-realtime-voice-waveform-activity": activity, children: WAVEFORM_WEIGHTS.map((weight, index) => (_jsx("span", { className: "h-5 w-0.5 origin-center rounded-full bg-current transition-transform duration-75 ease-out motion-reduce:transition-none", style: {
59
- transform: `scaleY(${0.2 + visibleLevel * 0.8 * weight})`,
60
- } }, index))) }));
61
- }
62
- function VoiceConnectingIndicator() {
63
- return (_jsx(IconLoader2, { "aria-hidden": "true", className: "size-6 animate-spin motion-reduce:animate-none", "data-realtime-voice-connecting-indicator": "true" }));
64
- }
65
- const ORB_STATE_CLASSES = {
66
- connecting: "bg-background/65 text-foreground ring-border/60 hover:bg-background/75",
67
- listening: "bg-background/65 text-foreground ring-border/60 hover:bg-background/75",
68
- speaking: "bg-background/65 text-foreground ring-border/60 hover:bg-background/75",
69
- working: "bg-background/65 text-foreground ring-border/60 hover:bg-background/75",
70
- error: "bg-destructive/20 text-destructive ring-destructive/30 hover:bg-destructive/25",
71
- ending: "cursor-wait bg-background/65 text-muted-foreground ring-border/60",
72
- };
73
- function useChatPanelTranslation(chatVisible) {
74
- const [translation, setTranslation] = useState(0);
75
- useEffect(() => {
76
- if (!chatVisible || typeof window === "undefined") {
77
- setTranslation(0);
78
- return;
79
- }
80
- const direction = window.getComputedStyle(document.documentElement).direction;
81
- const inlineEnd = direction === "rtl" ? "left" : "right";
82
- const update = () => {
83
- const panels = Array.from(document.querySelectorAll(`.agent-sidebar-panel[data-agent-sidebar-position="${inlineEnd}"][data-agent-sidebar-state="open"]`));
84
- const panel = panels.find((candidate) => {
85
- const rect = candidate.getBoundingClientRect();
86
- return rect.width > 0 && rect.height > 0;
87
- });
88
- if (!panel) {
89
- setTranslation(0);
90
- return;
91
- }
92
- // A fullscreen chat has no unobscured side to move into. Keep the dock
93
- // at its normal edge so it stays reachable instead of pinning it to the
94
- // opposite side of the same overlay.
95
- if (panel.dataset.agentSidebarLayout === "fullscreen") {
96
- setTranslation(0);
97
- return;
98
- }
99
- const rect = panel.getBoundingClientRect();
100
- const overlap = inlineEnd === "right"
101
- ? Math.max(0, window.innerWidth - rect.left)
102
- : Math.max(0, rect.right);
103
- const maximumShift = Math.max(0, window.innerWidth - 96);
104
- const distance = Math.min(overlap, maximumShift);
105
- setTranslation(inlineEnd === "right" ? -distance : distance);
106
- };
107
- update();
108
- const frame = window.requestAnimationFrame(update);
109
- window.addEventListener("resize", update);
110
- const resizeObserver = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(update);
111
- const observedPanels = new WeakSet();
112
- const observePanels = () => {
113
- document
114
- .querySelectorAll(".agent-sidebar-panel")
115
- .forEach((panel) => {
116
- if (!observedPanels.has(panel)) {
117
- observedPanels.add(panel);
118
- resizeObserver?.observe(panel);
119
- }
120
- });
121
- };
122
- observePanels();
123
- const mutationObserver = new MutationObserver(() => {
124
- observePanels();
125
- update();
126
- });
127
- mutationObserver.observe(document.body, {
128
- attributes: true,
129
- attributeFilter: [
130
- "data-agent-sidebar-layout",
131
- "data-agent-sidebar-state",
132
- "style",
133
- ],
134
- childList: true,
135
- subtree: true,
136
- });
137
- return () => {
138
- window.cancelAnimationFrame(frame);
139
- window.removeEventListener("resize", update);
140
- resizeObserver?.disconnect();
141
- mutationObserver.disconnect();
142
- };
143
- }, [chatVisible]);
144
- return translation;
145
- }
146
- function VoiceSettingRow({ icon: Icon, setting, onSelectOpenChange, }) {
147
- const selected = setting.options.find((option) => option.value === setting.value);
148
- return (_jsxs(Select, { value: setting.value, onValueChange: setting.onValueChange, onOpenChange: onSelectOpenChange, disabled: setting.disabled, children: [_jsx(SelectTrigger, { "aria-label": `${setting.label}: ${selected?.label ?? setting.value}`, className: "h-11 rounded-none border-0 bg-transparent px-3 shadow-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset", children: _jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-2.5", children: [_jsx(Icon, { className: "size-4 shrink-0 text-muted-foreground" }), _jsx("span", { className: "shrink-0 text-sm font-medium text-foreground", children: setting.label }), _jsx("span", { className: "ms-auto min-w-0 truncate text-end text-sm text-muted-foreground", children: selected?.label ?? setting.value })] }) }), _jsx(SelectContent, { align: "end", className: "min-w-56", "data-realtime-voice-setting-options": "true", children: _jsx(SelectGroup, { children: setting.options.map((option) => (_jsx(SelectItem, { value: option.value, children: _jsxs("span", { className: "grid gap-0.5", children: [_jsx("span", { children: option.label }), option.description ? (_jsx("span", { className: "text-xs text-muted-foreground", children: option.description })) : null] }) }, option.value))) }) })] }));
149
- }
150
- function VoiceInlineSettings({ settings, disabled, onSelectOpenChange, }) {
151
- const selectedVoice = settings.voiceStyle.options.find((option) => option.value === settings.voiceStyle.value);
152
- return (_jsxs("div", { "data-realtime-voice-settings": "true", children: [_jsx("h2", { className: "sr-only", children: settings.dialogLabel }), _jsxs("div", { className: "grid gap-0.5 px-4 pb-3 pt-4 text-center", children: [_jsx("div", { className: "truncate text-base font-semibold text-foreground", children: selectedVoice?.label ?? settings.voiceStyle.value }), selectedVoice?.description ? (_jsx("div", { className: "truncate text-xs text-muted-foreground", children: selectedVoice.description })) : null] }), _jsxs("div", { className: "mx-2 mb-2 overflow-hidden rounded-xl border border-border/70 bg-background/70", children: [_jsx(VoiceSettingRow, { icon: IconMicrophone, setting: {
153
- ...settings.microphone,
154
- disabled: disabled || settings.microphone.disabled,
155
- }, onSelectOpenChange: onSelectOpenChange }), _jsx("div", { className: "mx-3 h-px bg-border/70" }), _jsx(VoiceSettingRow, { icon: IconLanguage, setting: {
156
- ...settings.language,
157
- disabled: disabled || settings.language.disabled,
158
- }, onSelectOpenChange: onSelectOpenChange }), _jsx("div", { className: "mx-3 h-px bg-border/70" }), _jsx(VoiceSettingRow, { icon: IconBrain, setting: {
159
- ...settings.intelligence,
160
- disabled: disabled || settings.intelligence.disabled,
161
- }, onSelectOpenChange: onSelectOpenChange }), _jsx("div", { className: "mx-3 h-px bg-border/70" }), _jsx(VoiceSettingRow, { icon: IconVolume, setting: {
162
- ...settings.voiceStyle,
163
- disabled: disabled || settings.voiceStyle.disabled,
164
- }, onSelectOpenChange: onSelectOpenChange })] }), settings.microphoneError ? (_jsx("p", { className: "px-4 pb-3 text-center text-xs text-destructive", children: settings.microphoneError })) : null, settings.appliesNextConversationNote ? (_jsx("p", { className: "px-4 pb-3 text-center text-xs text-muted-foreground", children: settings.appliesNextConversationNote })) : null] }));
165
- }
166
- /**
167
- * Persistent voice-session control. Toggling the main orb only changes chat
168
- * visibility; ending the realtime session is intentionally a separate action.
169
- */
170
- export function RealtimeVoiceModeDock({ state, copy, chatVisible, audioLevels = SILENT_AUDIO_LEVELS, onToggleChat, onEndVoiceMode, settings, errorMessage, className, }) {
171
- const statusId = useId();
172
- const controlsId = useId();
173
- const [controlsOpen, setControlsOpen] = useState(false);
174
- const [settingsOpen, setSettingsOpen] = useState(false);
175
- const selectInteractionRef = useRef(false);
176
- const selectInteractionFrameRef = useRef(null);
177
- const levels = useSyncExternalStore(audioLevels.subscribe, audioLevels.getSnapshot, audioLevels.getSnapshot);
178
- const reducedMotion = usePrefersReducedMotion();
179
- // Microphone metering begins while the SDP request is still in flight. Keep
180
- // the connecting affordance authoritative until WebRTC is established;
181
- // otherwise speaking into the mic replaces the loader with a waveform and
182
- // makes a stalled connection look like a live call.
183
- const connected = state === "listening" || state === "speaking" || state === "working";
184
- const activity = connected
185
- ? levels.output > AUDIO_ACTIVITY_THRESHOLD
186
- ? "assistant"
187
- : levels.input > AUDIO_ACTIVITY_THRESHOLD
188
- ? "user"
189
- : "idle"
190
- : "idle";
191
- const activityLevel = activity === "assistant" ? levels.output : levels.input;
192
- const toggleLabel = chatVisible ? copy.hideChat : copy.showChat;
193
- const ending = state === "ending";
194
- const errorDetailVisible = state === "error" && Boolean(errorMessage);
195
- const controlsVisible = controlsOpen || settingsOpen;
196
- const chatPanelTranslation = useChatPanelTranslation(chatVisible);
197
- const handleSelectOpenChange = useCallback((open) => {
198
- if (selectInteractionFrameRef.current !== null) {
199
- window.cancelAnimationFrame(selectInteractionFrameRef.current);
200
- selectInteractionFrameRef.current = null;
201
- }
202
- selectInteractionRef.current = true;
203
- if (!open) {
204
- // Radix closes the portalled Select before its focus/outside events have
205
- // fully settled. Keep the parent protected through the current frame.
206
- selectInteractionFrameRef.current = window.requestAnimationFrame(() => {
207
- selectInteractionRef.current = false;
208
- selectInteractionFrameRef.current = null;
209
- });
210
- }
211
- }, []);
212
- useEffect(() => () => {
213
- if (selectInteractionFrameRef.current !== null) {
214
- window.cancelAnimationFrame(selectInteractionFrameRef.current);
215
- }
216
- }, []);
217
- const closeControlsUnlessFocused = (event) => {
218
- if (settingsOpen)
219
- return;
220
- if (!event.currentTarget.contains(document.activeElement)) {
221
- setControlsOpen(false);
222
- }
223
- };
224
- return (_jsxs("div", { className: cn("pointer-events-none fixed bottom-4 end-4 flex max-w-[calc(100vw-2rem)] flex-col items-end gap-2 transition-transform duration-200 ease-[var(--ease-collapse)] motion-reduce:transition-none", className), style: {
225
- zIndex: 270,
226
- transform: `translateX(${chatPanelTranslation}px)`,
227
- }, "data-realtime-voice-state": state, "data-realtime-voice-activity": activity, "data-realtime-voice-chat-offset": chatPanelTranslation, children: [errorDetailVisible ? (_jsx("div", { role: "alert", className: "pointer-events-auto max-w-xs rounded-lg border border-destructive/30 bg-background px-3 py-2 text-sm text-destructive shadow-md", children: errorMessage })) : null, _jsxs("div", { className: "group pointer-events-auto flex items-center gap-2", onMouseEnter: () => setControlsOpen(true), onMouseLeave: closeControlsUnlessFocused, onFocusCapture: () => setControlsOpen(true), onBlurCapture: (event) => {
228
- if (!event.currentTarget.contains(event.relatedTarget)) {
229
- setControlsOpen(false);
230
- }
231
- }, children: [_jsxs("div", { id: controlsId, "data-realtime-voice-controls": controlsVisible ? "open" : "closed", className: cn("flex items-center gap-1 rounded-full border border-border/70 bg-background/95 p-1 shadow-lg backdrop-blur-md transition-[transform,opacity] duration-150 ease-out motion-reduce:transition-none", controlsVisible
232
- ? "pointer-events-auto translate-x-0 opacity-100"
233
- : "pointer-events-none opacity-0 ltr:translate-x-2 rtl:-translate-x-2 group-hover:pointer-events-auto group-hover:translate-x-0 group-hover:opacity-100 group-focus-within:pointer-events-auto group-focus-within:translate-x-0 group-focus-within:opacity-100"), children: [_jsx("span", { id: statusId, role: state === "error" && !errorDetailVisible ? "alert" : "status", "aria-live": state === "error" && !errorDetailVisible ? "assertive" : "polite", className: "sr-only", children: copy.status[state] }), settings ? (_jsxs(Popover, { open: settingsOpen, onOpenChange: setSettingsOpen, children: [_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx(PopoverAnchor, { asChild: true, children: _jsx(Button, { type: "button", variant: "ghost", size: "icon", disabled: ending, onClick: () => setSettingsOpen((open) => !open), "aria-label": copy.voiceSettings, "aria-expanded": settingsOpen, className: "size-8 rounded-full text-muted-foreground transition-transform duration-150 ease-out active:scale-[0.97]", children: _jsx(IconSettings, {}) }) }) }), _jsx(TooltipContent, { children: copy.voiceSettings })] }), _jsx(PopoverContent, { side: "top", align: "end", sideOffset: 10, className: "w-[min(20rem,calc(100vw-2rem))] overflow-hidden p-0", onOpenAutoFocus: (event) => event.preventDefault(), onInteractOutside: (event) => {
234
- const target = event.target;
235
- if (selectInteractionRef.current ||
236
- (target instanceof Element &&
237
- target.closest('[data-realtime-voice-setting-options="true"]'))) {
238
- event.preventDefault();
239
- }
240
- }, children: _jsx(VoiceInlineSettings, { settings: settings, disabled: ending, onSelectOpenChange: handleSelectOpenChange }) })] })) : null, _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx(Button, { type: "button", variant: "ghost", size: "icon", disabled: ending, onClick: onEndVoiceMode, "aria-label": copy.endVoiceMode, className: "size-8 rounded-full text-destructive transition-transform duration-150 ease-out hover:bg-destructive/10 hover:text-destructive active:scale-[0.97]", children: _jsx(IconPhoneOff, {}) }) }), _jsx(TooltipContent, { children: copy.endVoiceMode })] })] }), _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx(Button, { type: "button", size: "icon", disabled: ending, onClick: () => {
241
- setControlsOpen(true);
242
- onToggleChat();
243
- }, "aria-label": toggleLabel, "aria-pressed": chatVisible, "data-realtime-voice-chat-toggle": "orb", "aria-describedby": statusId, "aria-controls": controlsId, "aria-expanded": controlsVisible, className: cn("relative isolate size-16 overflow-visible rounded-full ring-1 backdrop-blur-xl transition-transform duration-150 ease-out focus-visible:ring-offset-2 active:scale-[0.97] motion-reduce:transition-none", ORB_STATE_CLASSES[state]), children: _jsx("span", { className: "relative z-10 flex items-center justify-center", children: state === "connecting" ? (_jsx(VoiceConnectingIndicator, {})) : state !== "error" ? (_jsx(VoiceWaveform, { level: activityLevel, reducedMotion: reducedMotion, activity: activity })) : (_jsx(IconAlertTriangle, {})) }) }) }), _jsx(TooltipContent, { children: toggleLabel })] })] })] }));
244
- }
245
- //# sourceMappingURL=RealtimeVoiceMode.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RealtimeVoiceMode.js","sourceRoot":"","sources":["../../../src/client/composer/RealtimeVoiceMode.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AACzD,OAAO,EACL,MAAM,EACN,aAAa,EACb,WAAW,EACX,UAAU,EACV,aAAa,GACd,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,iBAAiB,EACjB,SAAS,EACT,YAAY,EACZ,WAAW,EACX,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,UAAU,GACX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAEL,WAAW,EACX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AO,EAAE,GAAG,EAAE;wCACZ,eAAe,CAAC,IAAI,CAAC,CAAC;wCACtB,YAAY,EAAE,CAAC;oCACjB,CAAC,gBACW,WAAW,kBACT,WAAW,qCACO,KAAK,sBACnB,QAAQ,mBACX,UAAU,mBACV,eAAe,EAC9B,SAAS,EAAE,EAAE,CACX,yMAAyM,EACzM,iBAAiB,CAAC,KAAK,CAAC,CACzB,YAED,eAAM,SAAS,EAAC,gDAAgD,YAC7D,KAAK,KAAK,YAAY,CAAC,CAAC,CAAC,CACxB,KAAC,wBAAwB,KAAG,CAC7B,CAAC,CAAC,CAAC,KAAK,KAAK,OAAO,CAAC,CAAC,CAAC,CACtB,KAAC,aAAa,IACZ,KAAK,EAAE,aAAa,EACpB,aAAa,EAAE,aAAa,EAC5B,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC,CAAC,CAAC,CACF,KAAC,iBAAiB,KAAG,CACtB,GACI,GACA,GACM,EACjB,KAAC,cAAc,cAAE,WAAW,GAAkB,IACtC,IACN,IACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["import { Button } from \"@agent-native/toolkit/ui/button\";\nimport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectTrigger,\n} from \"@agent-native/toolkit/ui/select\";\nimport {\n IconAlertTriangle,\n IconBrain,\n IconLanguage,\n IconLoader2,\n IconMicrophone,\n IconPhoneOff,\n IconSettings,\n IconVolume,\n} from \"@tabler/icons-react\";\nimport {\n type MouseEvent,\n useCallback,\n useEffect,\n useId,\n useRef,\n useState,\n useSyncExternalStore,\n} from \"react\";\n\nimport {\n Popover,\n PopoverAnchor,\n PopoverContent,\n PopoverTrigger,\n} from \"../components/ui/popover.js\";\nimport {\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n} from \"../components/ui/tooltip.js\";\nimport { cn } from \"../utils.js\";\nimport {\n createRealtimeVoiceAudioLevelStore,\n type RealtimeVoiceAudioLevelStore,\n} from \"./realtime-voice-audio-level.js\";\n\nexport type RealtimeVoiceModeState =\n | \"connecting\"\n | \"listening\"\n | \"speaking\"\n | \"working\"\n | \"error\"\n | \"ending\";\n\n/**\n * User-visible copy stays outside the shared component so host catalogs remain\n * the source of truth. Callers should provide these values through `useT()`.\n */\nexport interface RealtimeVoiceModeCopy {\n entryButtonLabel: string;\n promptTitle: string;\n promptDescription: string;\n setupTitle: string;\n setupDescription: string;\n connectBuilder: string;\n useOpenAiKey: string;\n startWithOpenAiKey: string;\n startVoiceMode: string;\n keepDictating: string;\n showChat: string;\n hideChat: string;\n endVoiceMode: string;\n voiceSettings: string;\n settings: {\n microphone: string;\n defaultMicrophone: string;\n microphoneSwitchFailed: string;\n language: string;\n autoLanguage: string;\n languages: Record<\n Exclude<\n import(\"./useRealtimeVoiceMode.js\").RealtimeVoiceLanguage,\n \"auto\"\n >,\n string\n >;\n intelligence: string;\n intelligenceLevels: Record<\n import(\"./useRealtimeVoiceMode.js\").RealtimeVoiceIntelligence,\n string\n >;\n voiceStyle: string;\n voiceChangePending: string;\n voiceDescriptions: Record<\n import(\"./useRealtimeVoiceMode.js\").RealtimeVoice,\n string\n >;\n };\n status: Record<RealtimeVoiceModeState, string>;\n errors: {\n unsupported: string;\n responseFailed: string;\n sessionFailed: string;\n channelDisconnected: string;\n connectionTimedOut?: string;\n connectionFailed: string;\n offerFailed: string;\n };\n}\n\nexport interface RealtimeVoiceModeEntryProps {\n copy: RealtimeVoiceModeCopy;\n disabled?: boolean;\n providerStatusPending?: boolean;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n onStartVoiceMode: () => void;\n onKeepDictating: () => void;\n setupRequired?: boolean;\n openAiConfigured?: boolean;\n connectingBuilder?: boolean;\n onConnectBuilder?: () => void;\n onUseOpenAiKey?: () => void;\n className?: string;\n}\n\n/**\n * Composer mic entry point for apps that support a full-duplex voice session.\n * The first click offers voice mode without silently changing the existing\n * editable-dictation behavior.\n */\nexport function RealtimeVoiceModeEntry({\n copy,\n disabled,\n providerStatusPending = false,\n open: controlledOpen,\n onOpenChange,\n onStartVoiceMode,\n onKeepDictating,\n setupRequired = false,\n openAiConfigured = false,\n connectingBuilder = false,\n onConnectBuilder,\n onUseOpenAiKey,\n className,\n}: RealtimeVoiceModeEntryProps) {\n const [uncontrolledOpen, setUncontrolledOpen] = useState(false);\n const open = controlledOpen ?? uncontrolledOpen;\n const titleId = useId();\n const descriptionId = useId();\n const [collisionBoundary, setCollisionBoundary] =\n useState<HTMLElement | null>(null);\n\n const setTriggerNode = useCallback((node: HTMLButtonElement | null) => {\n const nextBoundary =\n node?.closest<HTMLElement>(\".agent-panel-root\") ?? null;\n setCollisionBoundary((currentBoundary) =>\n currentBoundary === nextBoundary ? currentBoundary : nextBoundary,\n );\n }, []);\n\n const setOpen = (nextOpen: boolean) => {\n if (controlledOpen === undefined) setUncontrolledOpen(nextOpen);\n onOpenChange?.(nextOpen);\n };\n\n const choose = (callback: () => void) => {\n setOpen(false);\n callback();\n };\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <Tooltip>\n <TooltipTrigger asChild>\n <PopoverTrigger asChild>\n <Button\n ref={setTriggerNode}\n type=\"button\"\n variant=\"ghost\"\n size=\"icon\"\n disabled={disabled}\n aria-label={copy.entryButtonLabel}\n aria-expanded={open}\n className={cn(\n \"size-7 shrink-0 text-muted-foreground hover:text-foreground\",\n className,\n )}\n >\n <IconMicrophone />\n </Button>\n </PopoverTrigger>\n </TooltipTrigger>\n <TooltipContent>{copy.entryButtonLabel}</TooltipContent>\n </Tooltip>\n\n <PopoverContent\n side=\"top\"\n align=\"end\"\n sideOffset={10}\n collisionBoundary={collisionBoundary ?? undefined}\n collisionPadding={16}\n data-collision-boundary={collisionBoundary ? \"agent-panel\" : \"viewport\"}\n className={cn(\n \"p-4\",\n setupRequired\n ? \"w-[min(calc(100vw-2rem),var(--radix-popover-content-available-width,30rem),30rem)]\"\n : \"w-[min(calc(100vw-2rem),var(--radix-popover-content-available-width,22rem),22rem)]\",\n )}\n aria-labelledby={titleId}\n aria-describedby={descriptionId}\n >\n <div className=\"grid gap-3\">\n <div className=\"grid gap-1\">\n <h2 id={titleId} className=\"text-sm font-semibold text-foreground\">\n {setupRequired ? copy.setupTitle : copy.promptTitle}\n </h2>\n <p\n id={descriptionId}\n className=\"text-sm leading-relaxed text-muted-foreground\"\n >\n {setupRequired ? copy.setupDescription : copy.promptDescription}\n </p>\n </div>\n\n <div className=\"flex flex-col-reverse gap-2 sm:flex-row sm:flex-wrap sm:justify-end\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => choose(onKeepDictating)}\n >\n {copy.keepDictating}\n </Button>\n {setupRequired ? (\n <>\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n onClick={() => choose(onUseOpenAiKey ?? onStartVoiceMode)}\n >\n {openAiConfigured\n ? copy.startWithOpenAiKey\n : copy.useOpenAiKey}\n </Button>\n <Button\n type=\"button\"\n size=\"sm\"\n className=\"whitespace-nowrap\"\n disabled={connectingBuilder}\n onClick={() => choose(onConnectBuilder ?? onStartVoiceMode)}\n >\n {connectingBuilder ? (\n <IconLoader2 className=\"animate-spin\" />\n ) : null}\n {copy.connectBuilder}\n </Button>\n </>\n ) : (\n <Button\n type=\"button\"\n size=\"sm\"\n disabled={providerStatusPending}\n onClick={() => choose(onStartVoiceMode)}\n >\n {providerStatusPending ? (\n <IconLoader2 className=\"animate-spin\" />\n ) : (\n <IconMicrophone />\n )}\n {copy.startVoiceMode}\n </Button>\n )}\n </div>\n </div>\n </PopoverContent>\n </Popover>\n );\n}\n\nexport interface RealtimeVoiceModeDockProps {\n state: RealtimeVoiceModeState;\n copy: RealtimeVoiceModeCopy;\n chatVisible: boolean;\n audioLevels?: RealtimeVoiceAudioLevelStore;\n onToggleChat: () => void;\n onEndVoiceMode: () => void;\n settings?: RealtimeVoiceModeInlineSettings;\n errorMessage?: string | null;\n className?: string;\n}\n\nexport interface RealtimeVoiceModeSettingOption {\n value: string;\n label: string;\n description?: string;\n}\n\nexport interface RealtimeVoiceModeSelectSetting {\n label: string;\n value: string;\n options: readonly RealtimeVoiceModeSettingOption[];\n onValueChange: (value: string) => void;\n disabled?: boolean;\n}\n\nexport interface RealtimeVoiceModeInlineSettings {\n dialogLabel: string;\n appliesNextConversationNote?: string;\n microphoneError?: string;\n microphone: RealtimeVoiceModeSelectSetting;\n language: RealtimeVoiceModeSelectSetting;\n intelligence: RealtimeVoiceModeSelectSetting;\n voiceStyle: RealtimeVoiceModeSelectSetting;\n}\n\nconst SILENT_AUDIO_LEVELS = createRealtimeVoiceAudioLevelStore();\nconst WAVEFORM_WEIGHTS = [0.55, 0.82, 1, 0.82, 0.55];\nconst AUDIO_ACTIVITY_THRESHOLD = 0.035;\n\nfunction usePrefersReducedMotion(): boolean {\n const [reduced, setReduced] = useState(false);\n useEffect(() => {\n if (typeof window === \"undefined\" || !window.matchMedia) return;\n const query = window.matchMedia(\"(prefers-reduced-motion: reduce)\");\n const update = () => setReduced(query.matches);\n update();\n query.addEventListener?.(\"change\", update);\n return () => query.removeEventListener?.(\"change\", update);\n }, []);\n return reduced;\n}\n\nfunction VoiceWaveform({\n level,\n reducedMotion,\n activity,\n}: {\n level: number;\n reducedMotion: boolean;\n activity: \"idle\" | \"user\" | \"assistant\";\n}) {\n const visibleLevel = reducedMotion ? 0.45 : level;\n return (\n <span\n aria-hidden=\"true\"\n className=\"flex h-6 items-center justify-center gap-0.5\"\n data-realtime-voice-waveform=\"true\"\n data-realtime-voice-waveform-activity={activity}\n >\n {WAVEFORM_WEIGHTS.map((weight, index) => (\n <span\n key={index}\n className=\"h-5 w-0.5 origin-center rounded-full bg-current transition-transform duration-75 ease-out motion-reduce:transition-none\"\n style={{\n transform: `scaleY(${0.2 + visibleLevel * 0.8 * weight})`,\n }}\n />\n ))}\n </span>\n );\n}\n\nfunction VoiceConnectingIndicator() {\n return (\n <IconLoader2\n aria-hidden=\"true\"\n className=\"size-6 animate-spin motion-reduce:animate-none\"\n data-realtime-voice-connecting-indicator=\"true\"\n />\n );\n}\n\nconst ORB_STATE_CLASSES: Record<RealtimeVoiceModeState, string> = {\n connecting:\n \"bg-background/65 text-foreground ring-border/60 hover:bg-background/75\",\n listening:\n \"bg-background/65 text-foreground ring-border/60 hover:bg-background/75\",\n speaking:\n \"bg-background/65 text-foreground ring-border/60 hover:bg-background/75\",\n working:\n \"bg-background/65 text-foreground ring-border/60 hover:bg-background/75\",\n error:\n \"bg-destructive/20 text-destructive ring-destructive/30 hover:bg-destructive/25\",\n ending: \"cursor-wait bg-background/65 text-muted-foreground ring-border/60\",\n};\n\nfunction useChatPanelTranslation(chatVisible: boolean): number {\n const [translation, setTranslation] = useState(0);\n\n useEffect(() => {\n if (!chatVisible || typeof window === \"undefined\") {\n setTranslation(0);\n return;\n }\n\n const direction = window.getComputedStyle(\n document.documentElement,\n ).direction;\n const inlineEnd = direction === \"rtl\" ? \"left\" : \"right\";\n\n const update = () => {\n const panels = Array.from(\n document.querySelectorAll<HTMLElement>(\n `.agent-sidebar-panel[data-agent-sidebar-position=\"${inlineEnd}\"][data-agent-sidebar-state=\"open\"]`,\n ),\n );\n const panel = panels.find((candidate) => {\n const rect = candidate.getBoundingClientRect();\n return rect.width > 0 && rect.height > 0;\n });\n\n if (!panel) {\n setTranslation(0);\n return;\n }\n\n // A fullscreen chat has no unobscured side to move into. Keep the dock\n // at its normal edge so it stays reachable instead of pinning it to the\n // opposite side of the same overlay.\n if (panel.dataset.agentSidebarLayout === \"fullscreen\") {\n setTranslation(0);\n return;\n }\n\n const rect = panel.getBoundingClientRect();\n const overlap =\n inlineEnd === \"right\"\n ? Math.max(0, window.innerWidth - rect.left)\n : Math.max(0, rect.right);\n const maximumShift = Math.max(0, window.innerWidth - 96);\n const distance = Math.min(overlap, maximumShift);\n setTranslation(inlineEnd === \"right\" ? -distance : distance);\n };\n\n update();\n const frame = window.requestAnimationFrame(update);\n window.addEventListener(\"resize\", update);\n\n const resizeObserver =\n typeof ResizeObserver === \"undefined\" ? null : new ResizeObserver(update);\n const observedPanels = new WeakSet<HTMLElement>();\n const observePanels = () => {\n document\n .querySelectorAll<HTMLElement>(\".agent-sidebar-panel\")\n .forEach((panel) => {\n if (!observedPanels.has(panel)) {\n observedPanels.add(panel);\n resizeObserver?.observe(panel);\n }\n });\n };\n observePanels();\n\n const mutationObserver = new MutationObserver(() => {\n observePanels();\n update();\n });\n mutationObserver.observe(document.body, {\n attributes: true,\n attributeFilter: [\n \"data-agent-sidebar-layout\",\n \"data-agent-sidebar-state\",\n \"style\",\n ],\n childList: true,\n subtree: true,\n });\n\n return () => {\n window.cancelAnimationFrame(frame);\n window.removeEventListener(\"resize\", update);\n resizeObserver?.disconnect();\n mutationObserver.disconnect();\n };\n }, [chatVisible]);\n\n return translation;\n}\n\nfunction VoiceSettingRow({\n icon: Icon,\n setting,\n onSelectOpenChange,\n}: {\n icon: typeof IconLanguage;\n setting: RealtimeVoiceModeSelectSetting;\n onSelectOpenChange: (open: boolean) => void;\n}) {\n const selected = setting.options.find(\n (option) => option.value === setting.value,\n );\n\n return (\n <Select\n value={setting.value}\n onValueChange={setting.onValueChange}\n onOpenChange={onSelectOpenChange}\n disabled={setting.disabled}\n >\n <SelectTrigger\n aria-label={`${setting.label}: ${selected?.label ?? setting.value}`}\n className=\"h-11 rounded-none border-0 bg-transparent px-3 shadow-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset\"\n >\n <div className=\"flex min-w-0 flex-1 items-center gap-2.5\">\n <Icon className=\"size-4 shrink-0 text-muted-foreground\" />\n <span className=\"shrink-0 text-sm font-medium text-foreground\">\n {setting.label}\n </span>\n <span className=\"ms-auto min-w-0 truncate text-end text-sm text-muted-foreground\">\n {selected?.label ?? setting.value}\n </span>\n </div>\n </SelectTrigger>\n <SelectContent\n align=\"end\"\n className=\"min-w-56\"\n data-realtime-voice-setting-options=\"true\"\n >\n <SelectGroup>\n {setting.options.map((option) => (\n <SelectItem key={option.value} value={option.value}>\n <span className=\"grid gap-0.5\">\n <span>{option.label}</span>\n {option.description ? (\n <span className=\"text-xs text-muted-foreground\">\n {option.description}\n </span>\n ) : null}\n </span>\n </SelectItem>\n ))}\n </SelectGroup>\n </SelectContent>\n </Select>\n );\n}\n\nfunction VoiceInlineSettings({\n settings,\n disabled,\n onSelectOpenChange,\n}: {\n settings: RealtimeVoiceModeInlineSettings;\n disabled: boolean;\n onSelectOpenChange: (open: boolean) => void;\n}) {\n const selectedVoice = settings.voiceStyle.options.find(\n (option) => option.value === settings.voiceStyle.value,\n );\n\n return (\n <div data-realtime-voice-settings=\"true\">\n <h2 className=\"sr-only\">{settings.dialogLabel}</h2>\n <div className=\"grid gap-0.5 px-4 pb-3 pt-4 text-center\">\n <div className=\"truncate text-base font-semibold text-foreground\">\n {selectedVoice?.label ?? settings.voiceStyle.value}\n </div>\n {selectedVoice?.description ? (\n <div className=\"truncate text-xs text-muted-foreground\">\n {selectedVoice.description}\n </div>\n ) : null}\n </div>\n <div className=\"mx-2 mb-2 overflow-hidden rounded-xl border border-border/70 bg-background/70\">\n <VoiceSettingRow\n icon={IconMicrophone}\n setting={{\n ...settings.microphone,\n disabled: disabled || settings.microphone.disabled,\n }}\n onSelectOpenChange={onSelectOpenChange}\n />\n <div className=\"mx-3 h-px bg-border/70\" />\n <VoiceSettingRow\n icon={IconLanguage}\n setting={{\n ...settings.language,\n disabled: disabled || settings.language.disabled,\n }}\n onSelectOpenChange={onSelectOpenChange}\n />\n <div className=\"mx-3 h-px bg-border/70\" />\n <VoiceSettingRow\n icon={IconBrain}\n setting={{\n ...settings.intelligence,\n disabled: disabled || settings.intelligence.disabled,\n }}\n onSelectOpenChange={onSelectOpenChange}\n />\n <div className=\"mx-3 h-px bg-border/70\" />\n <VoiceSettingRow\n icon={IconVolume}\n setting={{\n ...settings.voiceStyle,\n disabled: disabled || settings.voiceStyle.disabled,\n }}\n onSelectOpenChange={onSelectOpenChange}\n />\n </div>\n {settings.microphoneError ? (\n <p className=\"px-4 pb-3 text-center text-xs text-destructive\">\n {settings.microphoneError}\n </p>\n ) : null}\n {settings.appliesNextConversationNote ? (\n <p className=\"px-4 pb-3 text-center text-xs text-muted-foreground\">\n {settings.appliesNextConversationNote}\n </p>\n ) : null}\n </div>\n );\n}\n\n/**\n * Persistent voice-session control. Toggling the main orb only changes chat\n * visibility; ending the realtime session is intentionally a separate action.\n */\nexport function RealtimeVoiceModeDock({\n state,\n copy,\n chatVisible,\n audioLevels = SILENT_AUDIO_LEVELS,\n onToggleChat,\n onEndVoiceMode,\n settings,\n errorMessage,\n className,\n}: RealtimeVoiceModeDockProps) {\n const statusId = useId();\n const controlsId = useId();\n const [controlsOpen, setControlsOpen] = useState(false);\n const [settingsOpen, setSettingsOpen] = useState(false);\n const selectInteractionRef = useRef(false);\n const selectInteractionFrameRef = useRef<number | null>(null);\n const levels = useSyncExternalStore(\n audioLevels.subscribe,\n audioLevels.getSnapshot,\n audioLevels.getSnapshot,\n );\n const reducedMotion = usePrefersReducedMotion();\n // Microphone metering begins while the SDP request is still in flight. Keep\n // the connecting affordance authoritative until WebRTC is established;\n // otherwise speaking into the mic replaces the loader with a waveform and\n // makes a stalled connection look like a live call.\n const connected =\n state === \"listening\" || state === \"speaking\" || state === \"working\";\n const activity = connected\n ? levels.output > AUDIO_ACTIVITY_THRESHOLD\n ? \"assistant\"\n : levels.input > AUDIO_ACTIVITY_THRESHOLD\n ? \"user\"\n : \"idle\"\n : \"idle\";\n const activityLevel = activity === \"assistant\" ? levels.output : levels.input;\n const toggleLabel = chatVisible ? copy.hideChat : copy.showChat;\n const ending = state === \"ending\";\n const errorDetailVisible = state === \"error\" && Boolean(errorMessage);\n const controlsVisible = controlsOpen || settingsOpen;\n const chatPanelTranslation = useChatPanelTranslation(chatVisible);\n\n const handleSelectOpenChange = useCallback((open: boolean) => {\n if (selectInteractionFrameRef.current !== null) {\n window.cancelAnimationFrame(selectInteractionFrameRef.current);\n selectInteractionFrameRef.current = null;\n }\n selectInteractionRef.current = true;\n if (!open) {\n // Radix closes the portalled Select before its focus/outside events have\n // fully settled. Keep the parent protected through the current frame.\n selectInteractionFrameRef.current = window.requestAnimationFrame(() => {\n selectInteractionRef.current = false;\n selectInteractionFrameRef.current = null;\n });\n }\n }, []);\n\n useEffect(\n () => () => {\n if (selectInteractionFrameRef.current !== null) {\n window.cancelAnimationFrame(selectInteractionFrameRef.current);\n }\n },\n [],\n );\n\n const closeControlsUnlessFocused = (event: MouseEvent<HTMLDivElement>) => {\n if (settingsOpen) return;\n if (!event.currentTarget.contains(document.activeElement)) {\n setControlsOpen(false);\n }\n };\n\n return (\n <div\n className={cn(\n \"pointer-events-none fixed bottom-4 end-4 flex max-w-[calc(100vw-2rem)] flex-col items-end gap-2 transition-transform duration-200 ease-[var(--ease-collapse)] motion-reduce:transition-none\",\n className,\n )}\n style={{\n zIndex: 270,\n transform: `translateX(${chatPanelTranslation}px)`,\n }}\n data-realtime-voice-state={state}\n data-realtime-voice-activity={activity}\n data-realtime-voice-chat-offset={chatPanelTranslation}\n >\n {errorDetailVisible ? (\n <div\n role=\"alert\"\n className=\"pointer-events-auto max-w-xs rounded-lg border border-destructive/30 bg-background px-3 py-2 text-sm text-destructive shadow-md\"\n >\n {errorMessage}\n </div>\n ) : null}\n\n <div\n className=\"group pointer-events-auto flex items-center gap-2\"\n onMouseEnter={() => setControlsOpen(true)}\n onMouseLeave={closeControlsUnlessFocused}\n onFocusCapture={() => setControlsOpen(true)}\n onBlurCapture={(event) => {\n if (\n !event.currentTarget.contains(event.relatedTarget as Node | null)\n ) {\n setControlsOpen(false);\n }\n }}\n >\n <div\n id={controlsId}\n data-realtime-voice-controls={controlsVisible ? \"open\" : \"closed\"}\n className={cn(\n \"flex items-center gap-1 rounded-full border border-border/70 bg-background/95 p-1 shadow-lg backdrop-blur-md transition-[transform,opacity] duration-150 ease-out motion-reduce:transition-none\",\n controlsVisible\n ? \"pointer-events-auto translate-x-0 opacity-100\"\n : \"pointer-events-none opacity-0 ltr:translate-x-2 rtl:-translate-x-2 group-hover:pointer-events-auto group-hover:translate-x-0 group-hover:opacity-100 group-focus-within:pointer-events-auto group-focus-within:translate-x-0 group-focus-within:opacity-100\",\n )}\n >\n <span\n id={statusId}\n role={state === \"error\" && !errorDetailVisible ? \"alert\" : \"status\"}\n aria-live={\n state === \"error\" && !errorDetailVisible ? \"assertive\" : \"polite\"\n }\n className=\"sr-only\"\n >\n {copy.status[state]}\n </span>\n\n {settings ? (\n <Popover open={settingsOpen} onOpenChange={setSettingsOpen}>\n <Tooltip>\n <TooltipTrigger asChild>\n <PopoverAnchor asChild>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon\"\n disabled={ending}\n onClick={() => setSettingsOpen((open) => !open)}\n aria-label={copy.voiceSettings}\n aria-expanded={settingsOpen}\n className=\"size-8 rounded-full text-muted-foreground transition-transform duration-150 ease-out active:scale-[0.97]\"\n >\n <IconSettings />\n </Button>\n </PopoverAnchor>\n </TooltipTrigger>\n <TooltipContent>{copy.voiceSettings}</TooltipContent>\n </Tooltip>\n <PopoverContent\n side=\"top\"\n align=\"end\"\n sideOffset={10}\n className=\"w-[min(20rem,calc(100vw-2rem))] overflow-hidden p-0\"\n onOpenAutoFocus={(event) => event.preventDefault()}\n onInteractOutside={(event) => {\n const target = event.target;\n if (\n selectInteractionRef.current ||\n (target instanceof Element &&\n target.closest(\n '[data-realtime-voice-setting-options=\"true\"]',\n ))\n ) {\n event.preventDefault();\n }\n }}\n >\n <VoiceInlineSettings\n settings={settings}\n disabled={ending}\n onSelectOpenChange={handleSelectOpenChange}\n />\n </PopoverContent>\n </Popover>\n ) : null}\n\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon\"\n disabled={ending}\n onClick={onEndVoiceMode}\n aria-label={copy.endVoiceMode}\n className=\"size-8 rounded-full text-destructive transition-transform duration-150 ease-out hover:bg-destructive/10 hover:text-destructive active:scale-[0.97]\"\n >\n <IconPhoneOff />\n </Button>\n </TooltipTrigger>\n <TooltipContent>{copy.endVoiceMode}</TooltipContent>\n </Tooltip>\n </div>\n\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n type=\"button\"\n size=\"icon\"\n disabled={ending}\n onClick={() => {\n setControlsOpen(true);\n onToggleChat();\n }}\n aria-label={toggleLabel}\n aria-pressed={chatVisible}\n data-realtime-voice-chat-toggle=\"orb\"\n aria-describedby={statusId}\n aria-controls={controlsId}\n aria-expanded={controlsVisible}\n className={cn(\n \"relative isolate size-16 overflow-visible rounded-full ring-1 backdrop-blur-xl transition-transform duration-150 ease-out focus-visible:ring-offset-2 active:scale-[0.97] motion-reduce:transition-none\",\n ORB_STATE_CLASSES[state],\n )}\n >\n <span className=\"relative z-10 flex items-center justify-center\">\n {state === \"connecting\" ? (\n <VoiceConnectingIndicator />\n ) : state !== \"error\" ? (\n <VoiceWaveform\n level={activityLevel}\n reducedMotion={reducedMotion}\n activity={activity}\n />\n ) : (\n <IconAlertTriangle />\n )}\n </span>\n </Button>\n </TooltipTrigger>\n <TooltipContent>{toggleLabel}</TooltipContent>\n </Tooltip>\n </div>\n </div>\n );\n}\n"]}
@@ -1,222 +0,0 @@
1
- import type { EditorView } from "@tiptap/pm/view";
2
- import React from "react";
3
- import { type ReasoningEffort } from "../../shared/reasoning-effort.js";
4
- import { AgentComposerReference, type AgentChatContextItem } from "../agent-chat.js";
5
- import type { SkillResult, Reference, SlashCommand, AgentComposerLayoutVariant } from "./types.js";
6
- export interface TiptapComposerHandle {
7
- focus(): void;
8
- setText(text: string): void;
9
- insertReference(ref: AgentComposerReference): void;
10
- }
11
- export type ComposerSubmitIntent = "immediate" | "queued";
12
- export declare const DEFAULT_VOICE_DICTATION_ENABLED = false;
13
- export interface TiptapComposerSubmitOptions {
14
- intent?: ComposerSubmitIntent;
15
- }
16
- export declare function canSubmitComposerContent(options: {
17
- hasEditorContent: boolean;
18
- attachmentCount: number;
19
- disabled?: boolean;
20
- }): boolean;
21
- export declare function formatVoiceTranscriptForComposer(text: string): string;
22
- export declare function canRemoveVoicePreview(options: {
23
- documentSize: number;
24
- anchor: number;
25
- previewText: string;
26
- currentText: string;
27
- }): boolean;
28
- export declare function resolveComposerPrimaryAction(options: {
29
- canSubmit: boolean;
30
- hasStopButton: boolean;
31
- }): "send" | "stop";
32
- export type ContextChipBackspaceAction = {
33
- type: "select";
34
- key: string;
35
- } | {
36
- type: "remove";
37
- key: string;
38
- } | null;
39
- export declare function resolveContextChipBackspaceAction(options: {
40
- contextItemKeys: string[];
41
- selectedKey: string | null;
42
- cursorAtStart: boolean;
43
- }): ContextChipBackspaceAction;
44
- export declare function getOversizedDocumentAttachmentError(attachments: ReadonlyArray<unknown>): string | null;
45
- export declare function getComposerSubmitIntentForEnterKey(event: Pick<KeyboardEvent, "key" | "shiftKey" | "metaKey" | "ctrlKey">, isMac: boolean): ComposerSubmitIntent | null;
46
- export declare function insertComposerHardBreakAndScrollIntoView(view: Pick<EditorView, "state" | "dispatch">): boolean;
47
- export declare function getComposerPopoverPosition(view: Pick<EditorView, "coordsAtPos">, pos: number): {
48
- top: number;
49
- left: number;
50
- } | null;
51
- export declare function displayableComposerModeMessage(options: {
52
- messagePrefix: string;
53
- trimmedText: string;
54
- attachmentCount: number;
55
- }): string;
56
- export declare function handleComposerFileDrop(options: {
57
- event: Pick<DragEvent, "dataTransfer" | "preventDefault" | "stopPropagation">;
58
- addAttachment: (file: File) => Promise<unknown>;
59
- onError?: (error: unknown) => void;
60
- }): boolean;
61
- type ExecMode = "build" | "plan";
62
- export interface TiptapComposerProps {
63
- placeholder?: string;
64
- disabled?: boolean;
65
- focusRef?: React.Ref<TiptapComposerHandle>;
66
- /** Programmatically seed the editor with plain text. */
67
- initialText?: string;
68
- /** Stable key used to re-apply the seeded text. */
69
- initialTextKey?: string | number;
70
- /**
71
- * When provided, called instead of composerRuntime.send(). Used for queue
72
- * mode and standalone prompt popovers. Receives the live composer
73
- * attachments so callers (e.g. PromptComposer) can surface uploaded files.
74
- */
75
- onSubmit?: (text: string, references: Reference[], attachments?: ReadonlyArray<unknown>, options?: TiptapComposerSubmitOptions) => void;
76
- /** Return false to stop a submit before it enters the chat runtime. */
77
- onBeforeSubmit?: () => boolean | Promise<boolean>;
78
- /**
79
- * Clear the editor after an onSubmit handler runs. Standalone workflows that
80
- * may fail outside the composer can keep the draft visible for quick edits.
81
- */
82
- clearOnSubmit?: boolean;
83
- /** Called whenever the plain editor text changes. */
84
- onTextChange?: (text: string) => void;
85
- /** Custom action button (e.g. stop button) to render instead of the default send button. */
86
- actionButton?: React.ReactNode;
87
- /** Extra button to render alongside the primary action. */
88
- extraActionButton?: React.ReactNode;
89
- /**
90
- * Stop control shown instead of the disabled send button while the composer
91
- * has no sendable content. Typing or attaching content restores send.
92
- */
93
- stopButton?: React.ReactNode;
94
- /** Custom attachment button to render instead of ComposerPrimitive.AddAttachment. */
95
- attachButton?: React.ReactNode;
96
- /** Custom host-owned control rendered next to the attachment affordance. */
97
- modeControl?: React.ReactNode;
98
- /** Explicit host-owned toolbar slot rendered next to the attachment affordance. */
99
- toolbarSlot?: React.ReactNode;
100
- /** Shared sizing/layout variant for host surfaces. Default keeps sidebar behavior. */
101
- layoutVariant?: AgentComposerLayoutVariant;
102
- /** Additional slash commands surfaced in the shared / menu. */
103
- slashCommands?: SlashCommand[];
104
- /** Additional slash skills surfaced in the shared / menu. */
105
- slashSkills?: SkillResult[];
106
- /** Include built-in sidebar slash commands like /clear and /help. Default true. */
107
- includeDefaultSlashCommands?: boolean;
108
- /** Include app-discovered skills from the default agent endpoint. Default true. */
109
- includeDefaultSlashSkills?: boolean;
110
- /** Called when a slash command (e.g. /clear, /help) is executed */
111
- onSlashCommand?: (command: string) => void;
112
- /** Current execution mode (build/plan) */
113
- execMode?: ExecMode;
114
- /** Callback to change execution mode */
115
- onExecModeChange?: (mode: ExecMode) => void;
116
- /** Disable Plan mode while leaving Act mode available. */
117
- planModeDisabled?: boolean;
118
- /** Explanation shown next to the disabled Plan option. */
119
- planModeDisabledReason?: string;
120
- /** Show the microphone button for voice dictation. Defaults to DEFAULT_VOICE_DICTATION_ENABLED. */
121
- voiceEnabled?: boolean;
122
- /** Selected model override for this conversation */
123
- selectedModel?: string;
124
- /** Selected reasoning effort override for this conversation */
125
- selectedEffort?: ReasoningEffort;
126
- /** Available models grouped by provider */
127
- availableModels?: Array<{
128
- engine: string;
129
- label: string;
130
- models: string[];
131
- configured: boolean;
132
- }>;
133
- /** Whether the model list is still being resolved. */
134
- modelListLoading?: boolean;
135
- /** Callback when user picks a model */
136
- onModelChange?: (model: string, engine: string) => void;
137
- /** Callback when user picks a reasoning effort */
138
- onEffortChange?: (effort: ReasoningEffort) => void;
139
- /**
140
- * Disable Builder/provider status polling for hosts that supply provider
141
- * state through another channel, such as Electron IPC.
142
- */
143
- providerConnectStatusEnabled?: boolean;
144
- /**
145
- * Override the Builder.io connect action in the model picker. When provided,
146
- * clicking "Connect Builder.io" calls this instead of opening a browser popup.
147
- * Used by the Electron desktop app to route through the native IPC handler.
148
- */
149
- onConnectProvider?: () => void;
150
- /** Route local runtime setup through the host's native bridge. */
151
- onConnectLocalRuntime?: (engine: string) => void;
152
- /**
153
- * Optional secondary model menu (e.g. an image-generation model) rendered as
154
- * an extra section inside the model picker. Opt-in; omit for chat-only apps.
155
- */
156
- imageModelMenu?: ComposerImageModelMenu;
157
- /** Stable scope for persisted drafts, usually the active thread or tab id. */
158
- draftScope?: string;
159
- /** Keyed context nuggets staged for the next submitted prompt. */
160
- contextItems?: AgentChatContextItem[];
161
- /** Remove a staged context nugget by key. */
162
- onRemoveContextItem?: (key: string) => void;
163
- /**
164
- * Controls the "+" menu next to the composer. `"full"` (default) shows the
165
- * normal Upload / Skill / Job / Automation / Tool / MCP picker. `"upload-only"`
166
- * collapses it to a single button that opens the file picker directly.
167
- * `"hidden"` hides attachment controls for text-only prompt surfaces.
168
- */
169
- plusMenuMode?: "full" | "upload-only" | "hidden";
170
- /**
171
- * When true and the composer is running inside the Builder.io webview/iframe,
172
- * intercept "build me an app/agent" prompts and forward them to the parent
173
- * Builder chat via `builder.submitChat` instead of sending to the local
174
- * agent. Off by default — the chat sidebar opts in; standalone prompt
175
- * forms (NewWorkspaceAppFlow, etc.) handle delegation themselves with
176
- * extra context (vault keys, computed app ids) that the raw composer
177
- * text lacks.
178
- */
179
- interceptBuildRequestsForBuilder?: boolean;
180
- /**
181
- * Called when a drag-drop or paste attachment fails (e.g. unsupported format,
182
- * size cap). Use this to surface a visible error in the parent chat surface
183
- * rather than silently swallowing the problem.
184
- */
185
- onAttachmentError?: (message: string) => void;
186
- }
187
- /** Tiptap keeps the Editor object truthy after destroy but clears commandManager. */
188
- export declare function isComposerEditorUsable<T extends {
189
- isDestroyed?: boolean;
190
- }>(editor: T | null | undefined): editor is T;
191
- export declare function createTiptapComposerExtensions(getPlaceholder: () => string | undefined): (import("@tiptap/core").Extension<import("@tiptap/extension-placeholder").PlaceholderOptions, any> | import("@tiptap/core").Extension<import("@tiptap/starter-kit").StarterKitOptions, any> | import("@tiptap/core").Node<any, any>)[];
192
- export declare const MODEL_SELECTOR_POPOVER_STYLE: {
193
- fontSize: number;
194
- maxHeight: string;
195
- };
196
- export declare function shouldShowModelSelectorSkeleton(isLoading: boolean, engineCount: number): boolean;
197
- export declare function compactComposerModelName(model: string): string;
198
- export declare function compactComposerReasoningEffortLabel(effort: ReasoningEffort): string;
199
- /**
200
- * Optional secondary model menu for apps that drive a separate generation model
201
- * alongside the chat LLM (e.g. the Assets app's image-generation model). When
202
- * provided, the model picker renders an extra collapsible section so the user
203
- * can see and pick both "what reasons about my request" (the chat model) and
204
- * "what produces the output" (this model). Opt-in — omit it and nothing changes.
205
- */
206
- export interface ComposerImageModelMenu {
207
- /** Currently-selected model id for this secondary menu. */
208
- value: string;
209
- /** Selectable options (stable id + human label). */
210
- options: Array<{
211
- value: string;
212
- label: string;
213
- }>;
214
- /** Invoked when the user picks a different option. */
215
- onChange: (value: string) => void;
216
- /** Section header. Defaults to "Image model". */
217
- label?: string;
218
- }
219
- export declare function getComposerReasoningEffortOptions(model: string): ReasoningEffort[];
220
- export declare function TiptapComposer({ placeholder, disabled, focusRef, initialText, initialTextKey, onSubmit, onBeforeSubmit, clearOnSubmit, onTextChange, actionButton, extraActionButton, stopButton, attachButton, modeControl, toolbarSlot, layoutVariant, slashCommands, slashSkills, includeDefaultSlashCommands, includeDefaultSlashSkills, onSlashCommand, execMode, onExecModeChange, planModeDisabled, planModeDisabledReason, voiceEnabled, selectedModel, selectedEffort, availableModels, modelListLoading, onModelChange, onEffortChange, providerConnectStatusEnabled, onConnectProvider, onConnectLocalRuntime, imageModelMenu, draftScope, contextItems, onRemoveContextItem, plusMenuMode, interceptBuildRequestsForBuilder, onAttachmentError, }: TiptapComposerProps): React.JSX.Element;
221
- export {};
222
- //# sourceMappingURL=TiptapComposer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TiptapComposer.d.ts","sourceRoot":"","sources":["../../../src/client/composer/TiptapComposer.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGlD,OAAO,KAON,MAAM,OAAO,CAAC;AAEf,OAAO,EAKL,KAAK,eAAe,EACrB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EACL,sBAAsB,EAItB,KAAK,oBAAoB,EAI1B,MAAM,kBAAkB,CAAC;AA2B1B,OAAO,KAAK,EAEV,WAAW,EACX,SAAS,EACT,YAAY,EAEZ,0BAA0B,EAC3B,MAAM,YAAY,CAAC;AAMpB,MAAM,WAAW,oBAAoB;IACnC,KAAK,IAAI,IAAI,CAAC;IACd,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,eAAe,CAAC,GAAG,EAAE,sBAAsB,GAAG,IAAI,CAAC;CACpD;AAED,MAAM,MAAM,oBAAoB,GAAG,WAAW,GAAG,QAAQ,CAAC;AAE1D,eAAO,MAAM,+BAA+B,QAAQ,CAAC;AAErD,MAAM,WAAW,2BAA2B;IAC1C,MAAM,CAAC,EAAE,oBAAoB,C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