@agent-native/toolkit 0.5.1 → 0.7.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 (349) hide show
  1. package/README.md +17 -1
  2. package/dist/chat-history/ChatHistoryList.d.ts +103 -0
  3. package/dist/chat-history/ChatHistoryList.d.ts.map +1 -0
  4. package/dist/chat-history/ChatHistoryList.js +109 -0
  5. package/dist/chat-history/ChatHistoryList.js.map +1 -0
  6. package/dist/chat-history/ChatHistoryList.spec.d.ts +2 -0
  7. package/dist/chat-history/ChatHistoryList.spec.d.ts.map +1 -0
  8. package/dist/chat-history/ChatHistoryList.spec.js +283 -0
  9. package/dist/chat-history/ChatHistoryList.spec.js.map +1 -0
  10. package/dist/chat-history/index.d.ts +2 -0
  11. package/dist/chat-history/index.d.ts.map +1 -0
  12. package/dist/chat-history/index.js +2 -0
  13. package/dist/chat-history/index.js.map +1 -0
  14. package/dist/chat-history.css +314 -0
  15. package/dist/composer/AgentComposerFrame.d.ts +19 -0
  16. package/dist/composer/AgentComposerFrame.d.ts.map +1 -0
  17. package/dist/composer/AgentComposerFrame.js +14 -0
  18. package/dist/composer/AgentComposerFrame.js.map +1 -0
  19. package/dist/composer/ComposerPlusMenu.d.ts +17 -0
  20. package/dist/composer/ComposerPlusMenu.d.ts.map +1 -0
  21. package/dist/composer/ComposerPlusMenu.js +501 -0
  22. package/dist/composer/ComposerPlusMenu.js.map +1 -0
  23. package/dist/composer/MentionPopover.d.ts +29 -0
  24. package/dist/composer/MentionPopover.d.ts.map +1 -0
  25. package/dist/composer/MentionPopover.js +180 -0
  26. package/dist/composer/MentionPopover.js.map +1 -0
  27. package/dist/composer/PastedTextChip.d.ts +9 -0
  28. package/dist/composer/PastedTextChip.d.ts.map +1 -0
  29. package/dist/composer/PastedTextChip.js +47 -0
  30. package/dist/composer/PastedTextChip.js.map +1 -0
  31. package/dist/composer/PromptComposer.d.ts +114 -0
  32. package/dist/composer/PromptComposer.d.ts.map +1 -0
  33. package/dist/composer/PromptComposer.js +302 -0
  34. package/dist/composer/PromptComposer.js.map +1 -0
  35. package/dist/composer/PromptComposer.spec.d.ts +2 -0
  36. package/dist/composer/PromptComposer.spec.d.ts.map +1 -0
  37. package/dist/composer/PromptComposer.spec.js +64 -0
  38. package/dist/composer/PromptComposer.spec.js.map +1 -0
  39. package/dist/composer/RealtimeVoiceMode.d.ts +104 -0
  40. package/dist/composer/RealtimeVoiceMode.d.ts.map +1 -0
  41. package/dist/composer/RealtimeVoiceMode.js +245 -0
  42. package/dist/composer/RealtimeVoiceMode.js.map +1 -0
  43. package/dist/composer/RealtimeVoiceMode.spec.d.ts +2 -0
  44. package/dist/composer/RealtimeVoiceMode.spec.d.ts.map +1 -0
  45. package/dist/composer/RealtimeVoiceMode.spec.js +439 -0
  46. package/dist/composer/RealtimeVoiceMode.spec.js.map +1 -0
  47. package/dist/composer/TiptapComposer.d.ts +221 -0
  48. package/dist/composer/TiptapComposer.d.ts.map +1 -0
  49. package/dist/composer/TiptapComposer.js +1838 -0
  50. package/dist/composer/TiptapComposer.js.map +1 -0
  51. package/dist/composer/TiptapComposer.spec.d.ts +2 -0
  52. package/dist/composer/TiptapComposer.spec.d.ts.map +1 -0
  53. package/dist/composer/TiptapComposer.spec.js +277 -0
  54. package/dist/composer/TiptapComposer.spec.js.map +1 -0
  55. package/dist/composer/VoiceButton.d.ts +25 -0
  56. package/dist/composer/VoiceButton.d.ts.map +1 -0
  57. package/dist/composer/VoiceButton.js +100 -0
  58. package/dist/composer/VoiceButton.js.map +1 -0
  59. package/dist/composer/VoiceButton.spec.d.ts +2 -0
  60. package/dist/composer/VoiceButton.spec.d.ts.map +1 -0
  61. package/dist/composer/VoiceButton.spec.js +19 -0
  62. package/dist/composer/VoiceButton.spec.js.map +1 -0
  63. package/dist/composer/asset-picker-url.d.ts +16 -0
  64. package/dist/composer/asset-picker-url.d.ts.map +1 -0
  65. package/dist/composer/asset-picker-url.js +64 -0
  66. package/dist/composer/asset-picker-url.js.map +1 -0
  67. package/dist/composer/asset-picker-url.spec.d.ts +2 -0
  68. package/dist/composer/asset-picker-url.spec.d.ts.map +1 -0
  69. package/dist/composer/asset-picker-url.spec.js +23 -0
  70. package/dist/composer/asset-picker-url.spec.js.map +1 -0
  71. package/dist/composer/attachment-accept.d.ts +9 -0
  72. package/dist/composer/attachment-accept.d.ts.map +1 -0
  73. package/dist/composer/attachment-accept.js +65 -0
  74. package/dist/composer/attachment-accept.js.map +1 -0
  75. package/dist/composer/attachment-accept.spec.d.ts +2 -0
  76. package/dist/composer/attachment-accept.spec.d.ts.map +1 -0
  77. package/dist/composer/attachment-accept.spec.js +15 -0
  78. package/dist/composer/attachment-accept.spec.js.map +1 -0
  79. package/dist/composer/draft-key.d.ts +2 -0
  80. package/dist/composer/draft-key.d.ts.map +1 -0
  81. package/dist/composer/draft-key.js +8 -0
  82. package/dist/composer/draft-key.js.map +1 -0
  83. package/dist/composer/draft-key.spec.d.ts +2 -0
  84. package/dist/composer/draft-key.spec.d.ts.map +1 -0
  85. package/dist/composer/draft-key.spec.js +13 -0
  86. package/dist/composer/draft-key.spec.js.map +1 -0
  87. package/dist/composer/extensions/FileReference.d.ts +3 -0
  88. package/dist/composer/extensions/FileReference.d.ts.map +1 -0
  89. package/dist/composer/extensions/FileReference.js +36 -0
  90. package/dist/composer/extensions/FileReference.js.map +1 -0
  91. package/dist/composer/extensions/MentionReference.d.ts +3 -0
  92. package/dist/composer/extensions/MentionReference.d.ts.map +1 -0
  93. package/dist/composer/extensions/MentionReference.js +66 -0
  94. package/dist/composer/extensions/MentionReference.js.map +1 -0
  95. package/dist/composer/extensions/SkillReference.d.ts +3 -0
  96. package/dist/composer/extensions/SkillReference.d.ts.map +1 -0
  97. package/dist/composer/extensions/SkillReference.js +40 -0
  98. package/dist/composer/extensions/SkillReference.js.map +1 -0
  99. package/dist/composer/index.d.ts +14 -0
  100. package/dist/composer/index.d.ts.map +1 -0
  101. package/dist/composer/index.js +13 -0
  102. package/dist/composer/index.js.map +1 -0
  103. package/dist/composer/pasted-text.d.ts +31 -0
  104. package/dist/composer/pasted-text.d.ts.map +1 -0
  105. package/dist/composer/pasted-text.js +130 -0
  106. package/dist/composer/pasted-text.js.map +1 -0
  107. package/dist/composer/pasted-text.spec.d.ts +2 -0
  108. package/dist/composer/pasted-text.spec.d.ts.map +1 -0
  109. package/dist/composer/pasted-text.spec.js +107 -0
  110. package/dist/composer/pasted-text.spec.js.map +1 -0
  111. package/dist/composer/prompt-attachments.d.ts +18 -0
  112. package/dist/composer/prompt-attachments.d.ts.map +1 -0
  113. package/dist/composer/prompt-attachments.js +65 -0
  114. package/dist/composer/prompt-attachments.js.map +1 -0
  115. package/dist/composer/prompt-attachments.spec.d.ts +2 -0
  116. package/dist/composer/prompt-attachments.spec.d.ts.map +1 -0
  117. package/dist/composer/prompt-attachments.spec.js +63 -0
  118. package/dist/composer/prompt-attachments.spec.js.map +1 -0
  119. package/dist/composer/realtime-voice-audio-level.d.ts +14 -0
  120. package/dist/composer/realtime-voice-audio-level.d.ts.map +1 -0
  121. package/dist/composer/realtime-voice-audio-level.js +47 -0
  122. package/dist/composer/realtime-voice-audio-level.js.map +1 -0
  123. package/dist/composer/realtime-voice-audio-level.spec.d.ts +2 -0
  124. package/dist/composer/realtime-voice-audio-level.spec.d.ts.map +1 -0
  125. package/dist/composer/realtime-voice-audio-level.spec.js +25 -0
  126. package/dist/composer/realtime-voice-audio-level.spec.js.map +1 -0
  127. package/dist/composer/realtime-voice-transcript.d.ts +26 -0
  128. package/dist/composer/realtime-voice-transcript.d.ts.map +1 -0
  129. package/dist/composer/realtime-voice-transcript.js +103 -0
  130. package/dist/composer/realtime-voice-transcript.js.map +1 -0
  131. package/dist/composer/realtime-voice-transcript.spec.d.ts +2 -0
  132. package/dist/composer/realtime-voice-transcript.spec.d.ts.map +1 -0
  133. package/dist/composer/realtime-voice-transcript.spec.js +76 -0
  134. package/dist/composer/realtime-voice-transcript.spec.js.map +1 -0
  135. package/dist/composer/runtime-adapters.d.ts +163 -0
  136. package/dist/composer/runtime-adapters.d.ts.map +1 -0
  137. package/dist/composer/runtime-adapters.js +130 -0
  138. package/dist/composer/runtime-adapters.js.map +1 -0
  139. package/dist/composer/types.d.ts +60 -0
  140. package/dist/composer/types.d.ts.map +1 -0
  141. package/dist/composer/types.js +2 -0
  142. package/dist/composer/types.js.map +1 -0
  143. package/dist/composer/use-file-search.d.ts +6 -0
  144. package/dist/composer/use-file-search.d.ts.map +1 -0
  145. package/dist/composer/use-file-search.js +53 -0
  146. package/dist/composer/use-file-search.js.map +1 -0
  147. package/dist/composer/use-mention-search.d.ts +6 -0
  148. package/dist/composer/use-mention-search.d.ts.map +1 -0
  149. package/dist/composer/use-mention-search.js +75 -0
  150. package/dist/composer/use-mention-search.js.map +1 -0
  151. package/dist/composer/use-skills.d.ts +7 -0
  152. package/dist/composer/use-skills.d.ts.map +1 -0
  153. package/dist/composer/use-skills.js +40 -0
  154. package/dist/composer/use-skills.js.map +1 -0
  155. package/dist/composer/useRealtimeVoiceMode.d.ts +179 -0
  156. package/dist/composer/useRealtimeVoiceMode.d.ts.map +1 -0
  157. package/dist/composer/useRealtimeVoiceMode.js +1657 -0
  158. package/dist/composer/useRealtimeVoiceMode.js.map +1 -0
  159. package/dist/composer/useRealtimeVoiceMode.spec.d.ts +2 -0
  160. package/dist/composer/useRealtimeVoiceMode.spec.d.ts.map +1 -0
  161. package/dist/composer/useRealtimeVoiceMode.spec.js +618 -0
  162. package/dist/composer/useRealtimeVoiceMode.spec.js.map +1 -0
  163. package/dist/composer/useVoiceDictation.d.ts +57 -0
  164. package/dist/composer/useVoiceDictation.d.ts.map +1 -0
  165. package/dist/composer/useVoiceDictation.js +1004 -0
  166. package/dist/composer/useVoiceDictation.js.map +1 -0
  167. package/dist/composer/useVoiceDictation.spec.d.ts +2 -0
  168. package/dist/composer/useVoiceDictation.spec.d.ts.map +1 -0
  169. package/dist/composer/useVoiceDictation.spec.js +32 -0
  170. package/dist/composer/useVoiceDictation.spec.js.map +1 -0
  171. package/dist/editor/RegistryBlockContext.d.ts +68 -0
  172. package/dist/editor/RegistryBlockContext.d.ts.map +1 -0
  173. package/dist/editor/RegistryBlockContext.js +10 -0
  174. package/dist/editor/RegistryBlockContext.js.map +1 -0
  175. package/dist/editor/RegistryBlockNode.d.ts +66 -0
  176. package/dist/editor/RegistryBlockNode.d.ts.map +1 -0
  177. package/dist/editor/RegistryBlockNode.js +406 -0
  178. package/dist/editor/RegistryBlockNode.js.map +1 -0
  179. package/dist/editor/RegistryBlockNode.spec.d.ts +2 -0
  180. package/dist/editor/RegistryBlockNode.spec.d.ts.map +1 -0
  181. package/dist/editor/RegistryBlockNode.spec.js +215 -0
  182. package/dist/editor/RegistryBlockNode.spec.js.map +1 -0
  183. package/dist/editor/index.d.ts +2 -0
  184. package/dist/editor/index.d.ts.map +1 -1
  185. package/dist/editor/index.js +2 -0
  186. package/dist/editor/index.js.map +1 -1
  187. package/dist/editor/registrySlashCommands.d.ts +68 -0
  188. package/dist/editor/registrySlashCommands.d.ts.map +1 -0
  189. package/dist/editor/registrySlashCommands.js +51 -0
  190. package/dist/editor/registrySlashCommands.js.map +1 -0
  191. package/package.json +32 -1
  192. package/src/app-shell/header-actions.tsx +84 -0
  193. package/src/app-shell/index.ts +1 -0
  194. package/src/chat-history/ChatHistoryList.spec.tsx +453 -0
  195. package/src/chat-history/ChatHistoryList.tsx +469 -0
  196. package/src/chat-history/index.ts +7 -0
  197. package/src/chat-history.css +314 -0
  198. package/src/collab-ui/AgentPresenceChip.tsx +69 -0
  199. package/src/collab-ui/LiveCursorOverlay.tsx +241 -0
  200. package/src/collab-ui/PresenceBar.tsx +346 -0
  201. package/src/collab-ui/RecentEditHighlights.tsx +225 -0
  202. package/src/collab-ui/RemoteSelectionRings.tsx +227 -0
  203. package/src/collab-ui/agent-identity.ts +16 -0
  204. package/src/collab-ui/index.ts +39 -0
  205. package/src/collab-ui/lead-client.ts +32 -0
  206. package/src/collab-ui/types.spec.ts +18 -0
  207. package/src/collab-ui/types.ts +96 -0
  208. package/src/composer/AgentComposerFrame.tsx +59 -0
  209. package/src/composer/ComposerPlusMenu.tsx +983 -0
  210. package/src/composer/MentionPopover.tsx +412 -0
  211. package/src/composer/PastedTextChip.tsx +150 -0
  212. package/src/composer/PromptComposer.spec.ts +73 -0
  213. package/src/composer/PromptComposer.tsx +718 -0
  214. package/src/composer/RealtimeVoiceMode.spec.tsx +771 -0
  215. package/src/composer/RealtimeVoiceMode.tsx +856 -0
  216. package/src/composer/TiptapComposer.spec.ts +390 -0
  217. package/src/composer/TiptapComposer.tsx +2936 -0
  218. package/src/composer/VoiceButton.spec.ts +33 -0
  219. package/src/composer/VoiceButton.tsx +255 -0
  220. package/src/composer/asset-picker-url.spec.ts +56 -0
  221. package/src/composer/asset-picker-url.ts +80 -0
  222. package/src/composer/attachment-accept.spec.ts +22 -0
  223. package/src/composer/attachment-accept.ts +71 -0
  224. package/src/composer/draft-key.spec.ts +19 -0
  225. package/src/composer/draft-key.ts +7 -0
  226. package/src/composer/extensions/FileReference.tsx +55 -0
  227. package/src/composer/extensions/MentionReference.tsx +93 -0
  228. package/src/composer/extensions/SkillReference.tsx +56 -0
  229. package/src/composer/index.ts +79 -0
  230. package/src/composer/pasted-text.spec.ts +162 -0
  231. package/src/composer/pasted-text.ts +160 -0
  232. package/src/composer/prompt-attachments.spec.ts +80 -0
  233. package/src/composer/prompt-attachments.ts +93 -0
  234. package/src/composer/realtime-voice-audio-level.spec.ts +32 -0
  235. package/src/composer/realtime-voice-audio-level.ts +64 -0
  236. package/src/composer/realtime-voice-transcript.spec.ts +95 -0
  237. package/src/composer/realtime-voice-transcript.ts +134 -0
  238. package/src/composer/runtime-adapters.tsx +343 -0
  239. package/src/composer/types.ts +66 -0
  240. package/src/composer/use-file-search.ts +64 -0
  241. package/src/composer/use-mention-search.ts +90 -0
  242. package/src/composer/use-skills.ts +45 -0
  243. package/src/composer/useRealtimeVoiceMode.spec.ts +818 -0
  244. package/src/composer/useRealtimeVoiceMode.tsx +2117 -0
  245. package/src/composer/useVoiceDictation.spec.ts +45 -0
  246. package/src/composer/useVoiceDictation.ts +1191 -0
  247. package/src/context-ui/ContextMeter.tsx +101 -0
  248. package/src/context-ui/ContextSegmentRow.tsx +184 -0
  249. package/src/context-ui/ContextTreemap.tsx +125 -0
  250. package/src/context-ui/ContextXRayPanel.tsx +377 -0
  251. package/src/context-ui/format.ts +42 -0
  252. package/src/context-ui/index.ts +15 -0
  253. package/src/context-ui/types.ts +43 -0
  254. package/src/design-tweaks/index.ts +1 -0
  255. package/src/design-tweaks/visual-style-controls.tsx +1084 -0
  256. package/src/editor/BubbleToolbar.tsx +253 -0
  257. package/src/editor/CodeBlockNode.tsx +254 -0
  258. package/src/editor/DragHandle.spec.ts +588 -0
  259. package/src/editor/DragHandle.ts +1437 -0
  260. package/src/editor/ImageExtension.roundtrip.spec.ts +117 -0
  261. package/src/editor/ImageExtension.ts +306 -0
  262. package/src/editor/RegistryBlockContext.tsx +107 -0
  263. package/src/editor/RegistryBlockNode.spec.ts +279 -0
  264. package/src/editor/RegistryBlockNode.tsx +652 -0
  265. package/src/editor/RichMarkdownEditor.collab.spec.ts +79 -0
  266. package/src/editor/RichMarkdownEditor.roundtrip.spec.ts +226 -0
  267. package/src/editor/RichMarkdownEditor.tsx +81 -0
  268. package/src/editor/RunId.ts +61 -0
  269. package/src/editor/SharedRichEditor.tsx +321 -0
  270. package/src/editor/SlashCommandMenu.tsx +310 -0
  271. package/src/editor/disableHistory.spec.ts +85 -0
  272. package/src/editor/extensions.ts +402 -0
  273. package/src/editor/gfmDoc.spec.ts +230 -0
  274. package/src/editor/gfmDoc.ts +92 -0
  275. package/src/editor/index.ts +93 -0
  276. package/src/editor/registrySlashCommands.ts +131 -0
  277. package/src/editor/structuralReorderUndo.spec.ts +144 -0
  278. package/src/editor/surgical-apply.spec.ts +279 -0
  279. package/src/editor/surgical-apply.ts +192 -0
  280. package/src/editor/useCollabReconcile.concurrent.spec.ts +422 -0
  281. package/src/editor/useCollabReconcile.idempotent.spec.ts +324 -0
  282. package/src/editor/useCollabReconcile.ts +589 -0
  283. package/src/editor.css +510 -0
  284. package/src/hooks/index.ts +2 -0
  285. package/src/hooks/use-mobile.tsx +21 -0
  286. package/src/hooks/use-toast.ts +188 -0
  287. package/src/index.ts +8 -0
  288. package/src/onboarding/index.ts +1 -0
  289. package/src/provider.tsx +47 -0
  290. package/src/sharing/VisibilityBadge.spec.ts +96 -0
  291. package/src/sharing/VisibilityBadge.tsx +37 -0
  292. package/src/sharing/index.ts +4 -0
  293. package/src/styles.css +21 -0
  294. package/src/ui/accordion.tsx +56 -0
  295. package/src/ui/alert-dialog.tsx +141 -0
  296. package/src/ui/alert.tsx +59 -0
  297. package/src/ui/aspect-ratio.tsx +5 -0
  298. package/src/ui/avatar.tsx +48 -0
  299. package/src/ui/badge.tsx +37 -0
  300. package/src/ui/breadcrumb.tsx +115 -0
  301. package/src/ui/button.tsx +78 -0
  302. package/src/ui/calendar.tsx +214 -0
  303. package/src/ui/card.tsx +86 -0
  304. package/src/ui/carousel.tsx +260 -0
  305. package/src/ui/chart.tsx +375 -0
  306. package/src/ui/checkbox.tsx +28 -0
  307. package/src/ui/collapsible.tsx +9 -0
  308. package/src/ui/command.spec.tsx +51 -0
  309. package/src/ui/command.tsx +174 -0
  310. package/src/ui/context-menu.tsx +202 -0
  311. package/src/ui/date-picker.tsx +64 -0
  312. package/src/ui/dialog.spec.tsx +43 -0
  313. package/src/ui/dialog.tsx +146 -0
  314. package/src/ui/drawer.tsx +126 -0
  315. package/src/ui/dropdown-menu.tsx +218 -0
  316. package/src/ui/form.tsx +177 -0
  317. package/src/ui/hover-card.tsx +27 -0
  318. package/src/ui/index.ts +52 -0
  319. package/src/ui/input-otp.tsx +69 -0
  320. package/src/ui/input.tsx +22 -0
  321. package/src/ui/label.tsx +24 -0
  322. package/src/ui/logo.tsx +36 -0
  323. package/src/ui/menubar.tsx +235 -0
  324. package/src/ui/navigation-menu.tsx +128 -0
  325. package/src/ui/pagination.tsx +121 -0
  326. package/src/ui/popover.tsx +44 -0
  327. package/src/ui/progress.tsx +26 -0
  328. package/src/ui/radio-group.tsx +42 -0
  329. package/src/ui/resizable.tsx +43 -0
  330. package/src/ui/scroll-area.tsx +46 -0
  331. package/src/ui/select.tsx +158 -0
  332. package/src/ui/separator.tsx +29 -0
  333. package/src/ui/sheet.tsx +160 -0
  334. package/src/ui/sidebar.tsx +777 -0
  335. package/src/ui/skeleton.tsx +18 -0
  336. package/src/ui/slider.tsx +26 -0
  337. package/src/ui/sonner.tsx +58 -0
  338. package/src/ui/spinner.tsx +17 -0
  339. package/src/ui/switch.tsx +27 -0
  340. package/src/ui/table.tsx +117 -0
  341. package/src/ui/tabs.tsx +53 -0
  342. package/src/ui/textarea.tsx +23 -0
  343. package/src/ui/toast.tsx +127 -0
  344. package/src/ui/toaster.tsx +33 -0
  345. package/src/ui/toggle-group.tsx +59 -0
  346. package/src/ui/toggle.tsx +43 -0
  347. package/src/ui/tooltip.tsx +53 -0
  348. package/src/ui/use-toast.ts +3 -0
  349. package/src/utils.ts +8 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VoiceButton.spec.d.ts","sourceRoot":"","sources":["../../src/composer/VoiceButton.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,19 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { isRealtimeVoiceSetupRequired } from "./VoiceButton.js";
3
+ describe("isRealtimeVoiceSetupRequired", () => {
4
+ it("waits for the voice-specific provider status before prompting setup", () => {
5
+ expect(isRealtimeVoiceSetupRequired(null, false)).toBe(false);
6
+ });
7
+ it("does not wait on the redundant Builder status after voice status resolves", () => {
8
+ expect(isRealtimeVoiceSetupRequired({ builder: false, openai: false }, null)).toBe(true);
9
+ });
10
+ it("accepts either managed Builder voice or an OpenAI key", () => {
11
+ expect(isRealtimeVoiceSetupRequired({ builder: true, openai: false }, false)).toBe(false);
12
+ expect(isRealtimeVoiceSetupRequired({ builder: false, openai: true }, false)).toBe(false);
13
+ expect(isRealtimeVoiceSetupRequired({ builder: false, openai: false }, true)).toBe(false);
14
+ });
15
+ it("prompts setup only when neither realtime provider is configured", () => {
16
+ expect(isRealtimeVoiceSetupRequired({ builder: false, openai: false }, false)).toBe(true);
17
+ });
18
+ });
19
+ //# sourceMappingURL=VoiceButton.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VoiceButton.spec.js","sourceRoot":"","sources":["../../src/composer/VoiceButton.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAC;AAEhE,QAAQ,CAAC,8BAA8B,EAAE,GAAG,EAAE;IAC5C,EAAE,CAAC,qEAAqE,EAAE,GAAG,EAAE;QAC7E,MAAM,CAAC,4BAA4B,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,2EAA2E,EAAE,GAAG,EAAE;QACnF,MAAM,CACJ,4BAA4B,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,IAAI,CAAC,CACtE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACf,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uDAAuD,EAAE,GAAG,EAAE;QAC/D,MAAM,CACJ,4BAA4B,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,KAAK,CAAC,CACtE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACd,MAAM,CACJ,4BAA4B,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,KAAK,CAAC,CACtE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACd,MAAM,CACJ,4BAA4B,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,IAAI,CAAC,CACtE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAChB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,iEAAiE,EAAE,GAAG,EAAE;QACzE,MAAM,CACJ,4BAA4B,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,KAAK,CAAC,CACvE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACf,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,16 @@
1
+ export declare const ASSET_PICKER_HANDOFF_PARAM = "__an_asset_picker_handoff";
2
+ export declare const ASSET_PICKER_RETURN_ORIGIN_PARAM = "__an_asset_picker_return_origin";
3
+ export interface StandaloneAssetPickerOptions {
4
+ handoffId?: string;
5
+ returnOrigin?: string;
6
+ }
7
+ export declare function createAssetPickerHandoffId(): string;
8
+ /**
9
+ * Cross-origin Assets pages cannot inherit the host app's authenticated
10
+ * session inside an iframe. Treat those URLs as link-out targets so provider
11
+ * sign-in runs in a normal top-level browser context.
12
+ */
13
+ export declare function isExternalAssetPickerUrl(value: string, currentOrigin: string): boolean;
14
+ /** Build a top-level picker URL without iframe-only auth flags. */
15
+ export declare function standaloneAssetPickerUrl(value: string, baseUrl?: string, options?: StandaloneAssetPickerOptions): string;
16
+ //# sourceMappingURL=asset-picker-url.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asset-picker-url.d.ts","sourceRoot":"","sources":["../../src/composer/asset-picker-url.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,0BAA0B,8BAA8B,CAAC;AACtE,eAAO,MAAM,gCAAgC,oCACV,CAAC;AAEpC,MAAM,WAAW,4BAA4B;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,wBAAgB,0BAA0B,IAAI,MAAM,CAWnD;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,MAAM,EACb,aAAa,EAAE,MAAM,GACpB,OAAO,CAQT;AAED,mEAAmE;AACnE,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,MAAM,EACb,OAAO,SAAoB,EAC3B,OAAO,GAAE,4BAAiC,GACzC,MAAM,CAgCR"}
@@ -0,0 +1,64 @@
1
+ const FALLBACK_BASE_URL = "http://agent-native.invalid";
2
+ export const ASSET_PICKER_HANDOFF_PARAM = "__an_asset_picker_handoff";
3
+ export const ASSET_PICKER_RETURN_ORIGIN_PARAM = "__an_asset_picker_return_origin";
4
+ export function createAssetPickerHandoffId() {
5
+ if (typeof crypto !== "undefined" && crypto.randomUUID) {
6
+ return crypto.randomUUID();
7
+ }
8
+ if (typeof crypto !== "undefined" && crypto.getRandomValues) {
9
+ const bytes = crypto.getRandomValues(new Uint8Array(16));
10
+ return Array.from(bytes, (byte) => byte.toString(16).padStart(2, "0")).join("");
11
+ }
12
+ return `${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`;
13
+ }
14
+ /**
15
+ * Cross-origin Assets pages cannot inherit the host app's authenticated
16
+ * session inside an iframe. Treat those URLs as link-out targets so provider
17
+ * sign-in runs in a normal top-level browser context.
18
+ */
19
+ export function isExternalAssetPickerUrl(value, currentOrigin) {
20
+ try {
21
+ return new URL(value, currentOrigin).origin !== currentOrigin;
22
+ }
23
+ catch {
24
+ // A malformed configured URL should fail closed instead of being loaded in
25
+ // an iframe with an unknown auth boundary.
26
+ return true;
27
+ }
28
+ }
29
+ /** Build a top-level picker URL without iframe-only auth flags. */
30
+ export function standaloneAssetPickerUrl(value, baseUrl = FALLBACK_BASE_URL, options = {}) {
31
+ try {
32
+ const parsed = new URL(value, baseUrl);
33
+ parsed.searchParams.delete("embedded");
34
+ parsed.searchParams.delete("__an_embed_token");
35
+ parsed.searchParams.set("mediaType", "image");
36
+ let returnOrigin = null;
37
+ if (options.returnOrigin) {
38
+ try {
39
+ const parsedOrigin = new URL(options.returnOrigin);
40
+ if (parsedOrigin.protocol === "http:" ||
41
+ parsedOrigin.protocol === "https:") {
42
+ returnOrigin = parsedOrigin.origin;
43
+ }
44
+ }
45
+ catch {
46
+ // Omit an invalid return target rather than emitting an unverified
47
+ // cross-origin callback URL.
48
+ }
49
+ }
50
+ if (options.handoffId && returnOrigin) {
51
+ parsed.searchParams.set(ASSET_PICKER_HANDOFF_PARAM, options.handoffId);
52
+ parsed.searchParams.set(ASSET_PICKER_RETURN_ORIGIN_PARAM, returnOrigin);
53
+ }
54
+ else {
55
+ parsed.searchParams.delete(ASSET_PICKER_HANDOFF_PARAM);
56
+ parsed.searchParams.delete(ASSET_PICKER_RETURN_ORIGIN_PARAM);
57
+ }
58
+ return parsed.toString();
59
+ }
60
+ catch {
61
+ return value;
62
+ }
63
+ }
64
+ //# sourceMappingURL=asset-picker-url.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asset-picker-url.js","sourceRoot":"","sources":["../../src/composer/asset-picker-url.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=asset-picker-url.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asset-picker-url.spec.d.ts","sourceRoot":"","sources":["../../src/composer/asset-picker-url.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,23 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { isExternalAssetPickerUrl, standaloneAssetPickerUrl, } from "./asset-picker-url.js";
3
+ describe("asset picker auth handoff", () => {
4
+ it("treats the hosted Assets picker as external to the host app", () => {
5
+ expect(isExternalAssetPickerUrl("https://assets.agent-native.com/picker", "https://clips.agent-native.com")).toBe(true);
6
+ });
7
+ it("keeps same-origin pickers eligible for inline rendering", () => {
8
+ expect(isExternalAssetPickerUrl("/picker", "https://clips.agent-native.com")).toBe(false);
9
+ });
10
+ it("removes iframe flags from the top-level fallback URL", () => {
11
+ expect(standaloneAssetPickerUrl("https://assets.agent-native.com/picker?embedded=1&__an_embed_token=fake-token")).toBe("https://assets.agent-native.com/picker?mediaType=image");
12
+ });
13
+ it("adds a nonce-bound exact-origin callback to the top-level URL", () => {
14
+ expect(standaloneAssetPickerUrl("https://assets.agent-native.com/picker?embedded=1", "https://clips.agent-native.com", {
15
+ handoffId: "handoff-123",
16
+ returnOrigin: "https://clips.agent-native.com/chat",
17
+ })).toBe("https://assets.agent-native.com/picker?mediaType=image&__an_asset_picker_handoff=handoff-123&__an_asset_picker_return_origin=https%3A%2F%2Fclips.agent-native.com");
18
+ });
19
+ it("omits an invalid callback target", () => {
20
+ expect(standaloneAssetPickerUrl("https://assets.agent-native.com/picker", "https://clips.agent-native.com", { handoffId: "handoff-123", returnOrigin: "javascript:alert(1)" })).toBe("https://assets.agent-native.com/picker?mediaType=image");
21
+ });
22
+ });
23
+ //# sourceMappingURL=asset-picker-url.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asset-picker-url.spec.js","sourceRoot":"","sources":["../../src/composer/asset-picker-url.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EACL,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,uBAAuB,CAAC;AAE/B,QAAQ,CAAC,2BAA2B,EAAE,GAAG,EAAE;IACzC,EAAE,CAAC,6DAA6D,EAAE,GAAG,EAAE;QACrE,MAAM,CACJ,wBAAwB,CACtB,wCAAwC,EACxC,gCAAgC,CACjC,CACF,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACf,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yDAAyD,EAAE,GAAG,EAAE;QACjE,MAAM,CACJ,wBAAwB,CAAC,SAAS,EAAE,gCAAgC,CAAC,CACtE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAChB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sDAAsD,EAAE,GAAG,EAAE;QAC9D,MAAM,CACJ,wBAAwB,CACtB,+EAA+E,CAChF,CACF,CAAC,IAAI,CAAC,wDAAwD,CAAC,CAAC;IACnE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+DAA+D,EAAE,GAAG,EAAE;QACvE,MAAM,CACJ,wBAAwB,CACtB,mDAAmD,EACnD,gCAAgC,EAChC;YACE,SAAS,EAAE,aAAa;YACxB,YAAY,EAAE,qCAAqC;SACpD,CACF,CACF,CAAC,IAAI,CACJ,mKAAmK,CACpK,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kCAAkC,EAAE,GAAG,EAAE;QAC1C,MAAM,CACJ,wBAAwB,CACtB,wCAAwC,EACxC,gCAAgC,EAChC,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,qBAAqB,EAAE,CAClE,CACF,CAAC,IAAI,CAAC,wDAAwD,CAAC,CAAC;IACnE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { SimpleTextAttachmentAdapter } from "@assistant-ui/react";
2
+ export declare const PROMPT_DOCUMENT_ATTACHMENT_ACCEPT: string;
3
+ export declare const CHAT_DOCUMENT_ATTACHMENT_ACCEPT: string;
4
+ export declare const IMAGE_ATTACHMENT_ACCEPT: string;
5
+ export declare const TEXT_ATTACHMENT_ACCEPT: string;
6
+ export declare class TextAttachmentAdapter extends SimpleTextAttachmentAdapter {
7
+ accept: string;
8
+ }
9
+ //# sourceMappingURL=attachment-accept.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attachment-accept.d.ts","sourceRoot":"","sources":["../../src/composer/attachment-accept.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AAWlE,eAAO,MAAM,iCAAiC,QACH,CAAC;AAE5C,eAAO,MAAM,+BAA+B,QAIjC,CAAC;AAEZ,eAAO,MAAM,uBAAuB,QAsBzB,CAAC;AAEZ,eAAO,MAAM,sBAAsB,QAsBxB,CAAC;AAEZ,qBAAa,qBAAsB,SAAQ,2BAA2B;IAC7D,MAAM,SAA0B;CACxC"}
@@ -0,0 +1,65 @@
1
+ import { SimpleTextAttachmentAdapter } from "@assistant-ui/react";
2
+ const BASE_DOCUMENT_ATTACHMENT_ACCEPT = [
3
+ "application/pdf",
4
+ "application/vnd.openxmlformats-officedocument.presentationml.presentation",
5
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
6
+ ".pdf",
7
+ ".pptx",
8
+ ".docx",
9
+ ];
10
+ export const PROMPT_DOCUMENT_ATTACHMENT_ACCEPT = BASE_DOCUMENT_ATTACHMENT_ACCEPT.join(",");
11
+ export const CHAT_DOCUMENT_ATTACHMENT_ACCEPT = [
12
+ ...BASE_DOCUMENT_ATTACHMENT_ACCEPT,
13
+ "image/svg+xml",
14
+ ".svg",
15
+ ].join(",");
16
+ export const IMAGE_ATTACHMENT_ACCEPT = [
17
+ "image/jpeg",
18
+ "image/jpg",
19
+ "image/png",
20
+ "image/gif",
21
+ "image/webp",
22
+ "image/heic",
23
+ "image/heif",
24
+ "image/avif",
25
+ "image/bmp",
26
+ "image/tiff",
27
+ ".jpg",
28
+ ".jpeg",
29
+ ".png",
30
+ ".gif",
31
+ ".webp",
32
+ ".heic",
33
+ ".heif",
34
+ ".avif",
35
+ ".bmp",
36
+ ".tif",
37
+ ".tiff",
38
+ ].join(",");
39
+ export const TEXT_ATTACHMENT_ACCEPT = [
40
+ "text/plain",
41
+ "text/html",
42
+ "text/markdown",
43
+ "text/csv",
44
+ "text/xml",
45
+ "text/json",
46
+ "text/css",
47
+ "text/yaml",
48
+ "application/json",
49
+ "application/x-yaml",
50
+ ".txt",
51
+ ".md",
52
+ ".markdown",
53
+ ".csv",
54
+ ".json",
55
+ ".html",
56
+ ".htm",
57
+ ".css",
58
+ ".xml",
59
+ ".yaml",
60
+ ".yml",
61
+ ].join(",");
62
+ export class TextAttachmentAdapter extends SimpleTextAttachmentAdapter {
63
+ accept = TEXT_ATTACHMENT_ACCEPT;
64
+ }
65
+ //# sourceMappingURL=attachment-accept.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attachment-accept.js","sourceRoot":"","sources":["../../src/composer/attachment-accept.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AAElE,MAAM,+BAA+B,GAAG;IACtC,iBAAiB;IACjB,2EAA2E;IAC3E,yEAAyE;IACzE,MAAM;IACN,OAAO;IACP,OAAO;CACR,CAAC;AAEF,MAAM,CAAC,MAAM,iCAAiC,GAC5C,+BAA+B,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE5C,MAAM,CAAC,MAAM,+BAA+B,GAAG;IAC7C,GAAG,+BAA+B;IAClC,eAAe;IACf,MAAM;CACP,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAEZ,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,YAAY;IACZ,WAAW;IACX,WAAW;IACX,WAAW;IACX,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,WAAW;IACX,YAAY;IACZ,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;IACN,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,MAAM;IACN,MAAM;IACN,OAAO;CACR,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAEZ,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,YAAY;IACZ,WAAW;IACX,eAAe;IACf,UAAU;IACV,UAAU;IACV,WAAW;IACX,UAAU;IACV,WAAW;IACX,kBAAkB;IAClB,oBAAoB;IACpB,MAAM;IACN,KAAK;IACL,WAAW;IACX,MAAM;IACN,OAAO;IACP,OAAO;IACP,MAAM;IACN,MAAM;IACN,MAAM;IACN,OAAO;IACP,MAAM;CACP,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAEZ,MAAM,OAAO,qBAAsB,SAAQ,2BAA2B;IAC7D,MAAM,GAAG,sBAAsB,CAAC;CACxC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=attachment-accept.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attachment-accept.spec.d.ts","sourceRoot":"","sources":["../../src/composer/attachment-accept.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,15 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { CHAT_DOCUMENT_ATTACHMENT_ACCEPT, PROMPT_DOCUMENT_ATTACHMENT_ACCEPT, } from "./attachment-accept.js";
3
+ describe("attachment accept lists", () => {
4
+ it("keeps SVGs out of standalone prompt composer document uploads", () => {
5
+ const accept = PROMPT_DOCUMENT_ATTACHMENT_ACCEPT.split(",");
6
+ expect(accept).not.toContain("image/svg+xml");
7
+ expect(accept).not.toContain(".svg");
8
+ });
9
+ it("allows SVGs in the main chat document upload path", () => {
10
+ const accept = CHAT_DOCUMENT_ATTACHMENT_ACCEPT.split(",");
11
+ expect(accept).toContain("image/svg+xml");
12
+ expect(accept).toContain(".svg");
13
+ });
14
+ });
15
+ //# sourceMappingURL=attachment-accept.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attachment-accept.spec.js","sourceRoot":"","sources":["../../src/composer/attachment-accept.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EACL,+BAA+B,EAC/B,iCAAiC,GAClC,MAAM,wBAAwB,CAAC;AAEhC,QAAQ,CAAC,yBAAyB,EAAE,GAAG,EAAE;IACvC,EAAE,CAAC,+DAA+D,EAAE,GAAG,EAAE;QACvE,MAAM,MAAM,GAAG,iCAAiC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAE5D,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC;QAC9C,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mDAAmD,EAAE,GAAG,EAAE;QAC3D,MAAM,MAAM,GAAG,+BAA+B,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAE1D,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC;QAC1C,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function getComposerDraftKey(scope?: string | null): string;
2
+ //# sourceMappingURL=draft-key.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"draft-key.d.ts","sourceRoot":"","sources":["../../src/composer/draft-key.ts"],"names":[],"mappings":"AAEA,wBAAgB,mBAAmB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAIjE"}
@@ -0,0 +1,8 @@
1
+ const BASE_COMPOSER_DRAFT_KEY = "an-composer-draft";
2
+ export function getComposerDraftKey(scope) {
3
+ const trimmed = scope?.trim();
4
+ if (!trimmed)
5
+ return BASE_COMPOSER_DRAFT_KEY;
6
+ return `${BASE_COMPOSER_DRAFT_KEY}:${encodeURIComponent(trimmed)}`;
7
+ }
8
+ //# sourceMappingURL=draft-key.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"draft-key.js","sourceRoot":"","sources":["../../src/composer/draft-key.ts"],"names":[],"mappings":"AAAA,MAAM,uBAAuB,GAAG,mBAAmB,CAAC;AAEpD,MAAM,UAAU,mBAAmB,CAAC,KAAqB;IACvD,MAAM,OAAO,GAAG,KAAK,EAAE,IAAI,EAAE,CAAC;IAC9B,IAAI,CAAC,OAAO;QAAE,OAAO,uBAAuB,CAAC;IAC7C,OAAO,GAAG,uBAAuB,IAAI,kBAAkB,CAAC,OAAO,CAAC,EAAE,CAAC;AACrE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=draft-key.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"draft-key.spec.d.ts","sourceRoot":"","sources":["../../src/composer/draft-key.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,13 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { getComposerDraftKey } from "./draft-key.js";
3
+ describe("getComposerDraftKey", () => {
4
+ it("uses the legacy key when no scope is available", () => {
5
+ expect(getComposerDraftKey()).toBe("an-composer-draft");
6
+ expect(getComposerDraftKey(" ")).toBe("an-composer-draft");
7
+ });
8
+ it("scopes drafts by thread or tab id", () => {
9
+ expect(getComposerDraftKey("thread-qa")).toBe("an-composer-draft:thread-qa");
10
+ expect(getComposerDraftKey("tab with spaces")).toBe("an-composer-draft:tab%20with%20spaces");
11
+ });
12
+ });
13
+ //# sourceMappingURL=draft-key.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"draft-key.spec.js","sourceRoot":"","sources":["../../src/composer/draft-key.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IACnC,EAAE,CAAC,gDAAgD,EAAE,GAAG,EAAE;QACxD,MAAM,CAAC,mBAAmB,EAAE,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;QACxD,MAAM,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mCAAmC,EAAE,GAAG,EAAE;QAC3C,MAAM,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAC3C,6BAA6B,CAC9B,CAAC;QACF,MAAM,CAAC,mBAAmB,CAAC,iBAAiB,CAAC,CAAC,CAAC,IAAI,CACjD,uCAAuC,CACxC,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Node } from "@tiptap/core";
2
+ export declare const FileReference: Node<any, any>;
3
+ //# sourceMappingURL=FileReference.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileReference.d.ts","sourceRoot":"","sources":["../../../src/composer/extensions/FileReference.tsx"],"names":[],"mappings":"AACA,OAAO,EAAmB,IAAI,EAAE,MAAM,cAAc,CAAC;AAyBrD,eAAO,MAAM,aAAa,gBA4BxB,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { IconFile, IconFolder } from "@tabler/icons-react";
3
+ import { mergeAttributes, Node } from "@tiptap/core";
4
+ import { NodeViewWrapper, ReactNodeViewRenderer } from "@tiptap/react";
5
+ const FileReferenceComponent = ({ node }) => {
6
+ const isFolder = node.attrs.path?.endsWith("/");
7
+ const cleanPath = isFolder ? node.attrs.path.slice(0, -1) : node.attrs.path;
8
+ const displayName = cleanPath.split("/").pop() || cleanPath;
9
+ return (_jsx(NodeViewWrapper, { as: "span", className: "inline", children: _jsxs("span", { className: "inline-flex items-center gap-1 rounded-md border border-input bg-muted/50 px-1.5 py-0.5 text-xs font-medium text-foreground align-middle mx-0.5 max-w-[200px] select-none", title: node.attrs.path, children: [isFolder ? (_jsx(IconFolder, { size: 14, className: "shrink-0 text-muted-foreground" })) : (_jsx(IconFile, { size: 14, className: "shrink-0 text-muted-foreground" })), _jsx("span", { className: "truncate", children: displayName })] }) }));
10
+ };
11
+ export const FileReference = Node.create({
12
+ name: "fileReference",
13
+ group: "inline",
14
+ inline: true,
15
+ selectable: true,
16
+ atom: true,
17
+ addAttributes() {
18
+ return {
19
+ path: { default: null },
20
+ source: { default: "codebase" },
21
+ };
22
+ },
23
+ parseHTML() {
24
+ return [{ tag: 'span[data-type="file-reference"]' }];
25
+ },
26
+ renderHTML({ HTMLAttributes }) {
27
+ return [
28
+ "span",
29
+ mergeAttributes({ "data-type": "file-reference" }, HTMLAttributes),
30
+ ];
31
+ },
32
+ addNodeView() {
33
+ return ReactNodeViewRenderer(FileReferenceComponent);
34
+ },
35
+ });
36
+ //# sourceMappingURL=FileReference.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileReference.js","sourceRoot":"","sources":["../../../src/composer/extensions/FileReference.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAEvE,MAAM,sBAAsB,GAAG,CAAC,EAAE,IAAI,EAAiB,EAAE,EAAE;IACzD,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC;IAChD,MAAM,SAAS,GAAG,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;IAC5E,MAAM,WAAW,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,IAAI,SAAS,CAAC;IAE5D,OAAO,CACL,KAAC,eAAe,IAAC,EAAE,EAAC,MAAM,EAAC,SAAS,EAAC,QAAQ,YAC3C,gBACE,SAAS,EAAC,2KAA2K,EACrL,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,aAErB,QAAQ,CAAC,CAAC,CAAC,CACV,KAAC,UAAU,IAAC,IAAI,EAAE,EAAE,EAAE,SAAS,EAAC,gCAAgC,GAAG,CACpE,CAAC,CAAC,CAAC,CACF,KAAC,QAAQ,IAAC,IAAI,EAAE,EAAE,EAAE,SAAS,EAAC,gCAAgC,GAAG,CAClE,EACD,eAAM,SAAS,EAAC,UAAU,YAAE,WAAW,GAAQ,IAC1C,GACS,CACnB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC;IACvC,IAAI,EAAE,eAAe;IACrB,KAAK,EAAE,QAAQ;IACf,MAAM,EAAE,IAAI;IACZ,UAAU,EAAE,IAAI;IAChB,IAAI,EAAE,IAAI;IAEV,aAAa;QACX,OAAO;YACL,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;YACvB,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;SAChC,CAAC;IACJ,CAAC;IAED,SAAS;QACP,OAAO,CAAC,EAAE,GAAG,EAAE,kCAAkC,EAAE,CAAC,CAAC;IACvD,CAAC;IAED,UAAU,CAAC,EAAE,cAAc,EAAE;QAC3B,OAAO;YACL,MAAM;YACN,eAAe,CAAC,EAAE,WAAW,EAAE,gBAAgB,EAAE,EAAE,cAAc,CAAC;SACnE,CAAC;IACJ,CAAC;IAED,WAAW;QACT,OAAO,qBAAqB,CAAC,sBAAsB,CAAC,CAAC;IACvD,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Node } from "@tiptap/core";
2
+ export declare const MentionReference: Node<any, any>;
3
+ //# sourceMappingURL=MentionReference.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MentionReference.d.ts","sourceRoot":"","sources":["../../../src/composer/extensions/MentionReference.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAmB,IAAI,EAAE,MAAM,cAAc,CAAC;AA0CrD,eAAO,MAAM,gBAAgB,gBAuC3B,CAAC"}
@@ -0,0 +1,66 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { IconFile, IconFolder, IconFileText, IconCheckbox, IconMail, IconUser, IconPresentation, IconStack2, IconMessageChatbot, } from "@tabler/icons-react";
3
+ import { mergeAttributes, Node } from "@tiptap/core";
4
+ import { NodeViewWrapper, ReactNodeViewRenderer } from "@tiptap/react";
5
+ const iconProps = { size: 14, className: "shrink-0 text-muted-foreground" };
6
+ function MentionIcon({ icon }) {
7
+ switch (icon) {
8
+ case "folder":
9
+ return _jsx(IconFolder, { ...iconProps });
10
+ case "document":
11
+ return _jsx(IconFileText, { ...iconProps });
12
+ case "form":
13
+ return _jsx(IconCheckbox, { ...iconProps });
14
+ case "email":
15
+ return _jsx(IconMail, { ...iconProps });
16
+ case "user":
17
+ return _jsx(IconUser, { ...iconProps });
18
+ case "deck":
19
+ return _jsx(IconPresentation, { ...iconProps });
20
+ case "agent":
21
+ return _jsx(IconMessageChatbot, { ...iconProps });
22
+ case "file":
23
+ return _jsx(IconFile, { ...iconProps });
24
+ default:
25
+ return _jsx(IconStack2, { ...iconProps });
26
+ }
27
+ }
28
+ const MentionReferenceComponent = ({ node }) => {
29
+ return (_jsx(NodeViewWrapper, { as: "span", className: "inline", children: _jsxs("span", { className: "inline-flex items-center gap-1 rounded-md border border-input bg-muted/50 px-1.5 py-0.5 text-xs font-medium text-foreground align-middle mx-0.5 max-w-[200px] select-none", title: node.attrs.refPath || node.attrs.refId || node.attrs.label, children: [_jsx(MentionIcon, { icon: node.attrs.icon }), _jsx("span", { className: "truncate", children: node.attrs.label })] }) }));
30
+ };
31
+ export const MentionReference = Node.create({
32
+ name: "mentionReference",
33
+ group: "inline",
34
+ inline: true,
35
+ selectable: true,
36
+ atom: true,
37
+ addAttributes() {
38
+ return {
39
+ label: { default: null },
40
+ icon: { default: "file" },
41
+ source: { default: "" },
42
+ refType: { default: "file" },
43
+ refId: { default: null },
44
+ refPath: { default: null },
45
+ slotKey: { default: null },
46
+ slotLabel: { default: null },
47
+ metadata: { default: null },
48
+ };
49
+ },
50
+ parseHTML() {
51
+ return [{ tag: 'span[data-type="mention-reference"]' }];
52
+ },
53
+ renderHTML({ HTMLAttributes }) {
54
+ return [
55
+ "span",
56
+ mergeAttributes({ "data-type": "mention-reference" }, HTMLAttributes),
57
+ ];
58
+ },
59
+ renderText({ node }) {
60
+ return `@${node.attrs.label}`;
61
+ },
62
+ addNodeView() {
63
+ return ReactNodeViewRenderer(MentionReferenceComponent);
64
+ },
65
+ });
66
+ //# sourceMappingURL=MentionReference.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MentionReference.js","sourceRoot":"","sources":["../../../src/composer/extensions/MentionReference.tsx"],"names":[],"mappings":"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"}
@@ -0,0 +1,3 @@
1
+ import { Node } from "@tiptap/core";
2
+ export declare const SkillReference: Node<any, any>;
3
+ //# sourceMappingURL=SkillReference.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SkillReference.d.ts","sourceRoot":"","sources":["../../../src/composer/extensions/SkillReference.tsx"],"names":[],"mappings":"AACA,OAAO,EAAmB,IAAI,EAAE,MAAM,cAAc,CAAC;AAyBrD,eAAO,MAAM,cAAc,gBA6BzB,CAAC"}
@@ -0,0 +1,40 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { IconStack2 } from "@tabler/icons-react";
3
+ import { mergeAttributes, Node } from "@tiptap/core";
4
+ import { NodeViewWrapper, ReactNodeViewRenderer } from "@tiptap/react";
5
+ const SkillReferenceComponent = ({ node }) => {
6
+ const displayName = (node.attrs.name || node.attrs.path || "")
7
+ .replace(/^(\.agents?\/)?skills\//, "")
8
+ .replace(/\/SKILL\.md$/i, "")
9
+ .replace(/\.md$/i, "")
10
+ .split("/")
11
+ .pop() || "skill";
12
+ return (_jsx(NodeViewWrapper, { as: "span", className: "inline", children: _jsxs("span", { className: "inline-flex items-center gap-1 rounded-md border border-input bg-muted/50 px-1.5 py-0.5 text-xs font-medium text-foreground align-middle mx-0.5 max-w-[160px] select-none", title: node.attrs.path, children: [_jsx(IconStack2, { size: 14, className: "shrink-0 text-muted-foreground" }), _jsx("span", { className: "truncate", children: displayName })] }) }));
13
+ };
14
+ export const SkillReference = Node.create({
15
+ name: "skillReference",
16
+ group: "inline",
17
+ inline: true,
18
+ selectable: true,
19
+ atom: true,
20
+ addAttributes() {
21
+ return {
22
+ name: { default: null },
23
+ path: { default: null },
24
+ source: { default: "codebase" },
25
+ };
26
+ },
27
+ parseHTML() {
28
+ return [{ tag: 'span[data-type="skill-reference"]' }];
29
+ },
30
+ renderHTML({ HTMLAttributes }) {
31
+ return [
32
+ "span",
33
+ mergeAttributes({ "data-type": "skill-reference" }, HTMLAttributes),
34
+ ];
35
+ },
36
+ addNodeView() {
37
+ return ReactNodeViewRenderer(SkillReferenceComponent);
38
+ },
39
+ });
40
+ //# sourceMappingURL=SkillReference.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SkillReference.js","sourceRoot":"","sources":["../../../src/composer/extensions/SkillReference.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAEvE,MAAM,uBAAuB,GAAG,CAAC,EAAE,IAAI,EAAiB,EAAE,EAAE;IAC1D,MAAM,WAAW,GACf,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC;SACvC,OAAO,CAAC,yBAAyB,EAAE,EAAE,CAAC;SACtC,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC;SAC5B,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC;SACrB,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,EAAE,IAAI,OAAO,CAAC;IAEtB,OAAO,CACL,KAAC,eAAe,IAAC,EAAE,EAAC,MAAM,EAAC,SAAS,EAAC,QAAQ,YAC3C,gBACE,SAAS,EAAC,2KAA2K,EACrL,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,aAEtB,KAAC,UAAU,IAAC,IAAI,EAAE,EAAE,EAAE,SAAS,EAAC,gCAAgC,GAAG,EACnE,eAAM,SAAS,EAAC,UAAU,YAAE,WAAW,GAAQ,IAC1C,GACS,CACnB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAC,MAAM,CAAC;IACxC,IAAI,EAAE,gBAAgB;IACtB,KAAK,EAAE,QAAQ;IACf,MAAM,EAAE,IAAI;IACZ,UAAU,EAAE,IAAI;IAChB,IAAI,EAAE,IAAI;IAEV,aAAa;QACX,OAAO;YACL,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;YACvB,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;YACvB,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;SAChC,CAAC;IACJ,CAAC;IAED,SAAS;QACP,OAAO,CAAC,EAAE,GAAG,EAAE,mCAAmC,EAAE,CAAC,CAAC;IACxD,CAAC;IAED,UAAU,CAAC,EAAE,cAAc,EAAE;QAC3B,OAAO;YACL,MAAM;YACN,eAAe,CAAC,EAAE,WAAW,EAAE,iBAAiB,EAAE,EAAE,cAAc,CAAC;SACpE,CAAC;IACJ,CAAC;IAED,WAAW;QACT,OAAO,qBAAqB,CAAC,uBAAuB,CAAC,CAAC;IACxD,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,14 @@
1
+ export { FileReference } from "./extensions/FileReference.js";
2
+ export { SkillReference } from "./extensions/SkillReference.js";
3
+ export { MentionReference } from "./extensions/MentionReference.js";
4
+ export { AgentComposerFrame, type AgentComposerFrameProps, } from "./AgentComposerFrame.js";
5
+ export { TiptapComposer, canSubmitComposerContent, displayableComposerModeMessage, getComposerSubmitIntentForEnterKey, handleComposerFileDrop, insertComposerHardBreakAndScrollIntoView, type ComposerSubmitIntent, type TiptapComposerHandle, type TiptapComposerProps, type TiptapComposerSubmitOptions, } from "./TiptapComposer.js";
6
+ export { PromptComposer, type PromptComposerProps, type PromptComposerFile, type PromptComposerSubmitOptions, } from "./PromptComposer.js";
7
+ export { RealtimeVoiceModeDock, RealtimeVoiceModeEntry, type RealtimeVoiceModeCopy, type RealtimeVoiceModeDockProps, type RealtimeVoiceModeEntryProps, type RealtimeVoiceModeInlineSettings, type RealtimeVoiceModeSelectSetting, type RealtimeVoiceModeSettingOption, type RealtimeVoiceModeState, } from "./RealtimeVoiceMode.js";
8
+ export { createRealtimeVoiceSession, createRealtimeVoiceSessionWithCapability, executeRealtimeVoiceTool, extractRealtimeVoiceFunctionCalls, readRealtimeVoiceContext, readRealtimeVoiceContextWith, RealtimeVoiceModeBoundary, RealtimeVoiceModeProvider, useRealtimeVoiceMode, useRealtimeVoiceModeCopy, useRealtimeVoiceModeOptional, type RealtimeVoiceModeApi, type RealtimeVoiceModeProviderProps, type RealtimeVoiceSessionAnswer, type RealtimeVoiceToolResult, } from "./useRealtimeVoiceMode.js";
9
+ export { AGENT_PROMPT_MAX_INLINE_IMAGE_BYTES, AGENT_PROMPT_MAX_INLINE_TEXT_CHARS, escapePromptAttachmentAttribute, formatPromptWithAttachments, isInlineableAgentPromptFile, readAgentPromptAttachment, type AgentPromptAttachment, type ReadAgentPromptAttachmentOptions, } from "./prompt-attachments.js";
10
+ export { MentionPopover } from "./MentionPopover.js";
11
+ export { useMentionSearch } from "./use-mention-search.js";
12
+ export { ComposerRuntimeAdaptersProvider, useComposerRuntimeAdapters, type ComposerRuntimeAdapters, type ComposerTranslate, } from "./runtime-adapters.js";
13
+ export type { AgentComposerLayoutVariant, FileResult, SkillResult, MentionItem, Reference, SlashCommand, } from "./types.js";
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/composer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EACL,kBAAkB,EAClB,KAAK,uBAAuB,GAC7B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,cAAc,EACd,wBAAwB,EACxB,8BAA8B,EAC9B,kCAAkC,EAClC,sBAAsB,EACtB,wCAAwC,EACxC,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,2BAA2B,GACjC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,cAAc,EACd,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,2BAA2B,GACjC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,0BAA0B,EAC/B,KAAK,2BAA2B,EAChC,KAAK,+BAA+B,EACpC,KAAK,8BAA8B,EACnC,KAAK,8BAA8B,EACnC,KAAK,sBAAsB,GAC5B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,0BAA0B,EAC1B,wCAAwC,EACxC,wBAAwB,EACxB,iCAAiC,EACjC,wBAAwB,EACxB,4BAA4B,EAC5B,yBAAyB,EACzB,yBAAyB,EACzB,oBAAoB,EACpB,wBAAwB,EACxB,4BAA4B,EAC5B,KAAK,oBAAoB,EACzB,KAAK,8BAA8B,EACnC,KAAK,0BAA0B,EAC/B,KAAK,uBAAuB,GAC7B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,mCAAmC,EACnC,kCAAkC,EAClC,+BAA+B,EAC/B,2BAA2B,EAC3B,2BAA2B,EAC3B,yBAAyB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,gCAAgC,GACtC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EACL,+BAA+B,EAC/B,0BAA0B,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,GACvB,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EACV,0BAA0B,EAC1B,UAAU,EACV,WAAW,EACX,WAAW,EACX,SAAS,EACT,YAAY,GACb,MAAM,YAAY,CAAC"}
@@ -0,0 +1,13 @@
1
+ export { FileReference } from "./extensions/FileReference.js";
2
+ export { SkillReference } from "./extensions/SkillReference.js";
3
+ export { MentionReference } from "./extensions/MentionReference.js";
4
+ export { AgentComposerFrame, } from "./AgentComposerFrame.js";
5
+ export { TiptapComposer, canSubmitComposerContent, displayableComposerModeMessage, getComposerSubmitIntentForEnterKey, handleComposerFileDrop, insertComposerHardBreakAndScrollIntoView, } from "./TiptapComposer.js";
6
+ export { PromptComposer, } from "./PromptComposer.js";
7
+ export { RealtimeVoiceModeDock, RealtimeVoiceModeEntry, } from "./RealtimeVoiceMode.js";
8
+ export { createRealtimeVoiceSession, createRealtimeVoiceSessionWithCapability, executeRealtimeVoiceTool, extractRealtimeVoiceFunctionCalls, readRealtimeVoiceContext, readRealtimeVoiceContextWith, RealtimeVoiceModeBoundary, RealtimeVoiceModeProvider, useRealtimeVoiceMode, useRealtimeVoiceModeCopy, useRealtimeVoiceModeOptional, } from "./useRealtimeVoiceMode.js";
9
+ export { AGENT_PROMPT_MAX_INLINE_IMAGE_BYTES, AGENT_PROMPT_MAX_INLINE_TEXT_CHARS, escapePromptAttachmentAttribute, formatPromptWithAttachments, isInlineableAgentPromptFile, readAgentPromptAttachment, } from "./prompt-attachments.js";
10
+ export { MentionPopover } from "./MentionPopover.js";
11
+ export { useMentionSearch } from "./use-mention-search.js";
12
+ export { ComposerRuntimeAdaptersProvider, useComposerRuntimeAdapters, } from "./runtime-adapters.js";
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/composer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EACL,kBAAkB,GAEnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,cAAc,EACd,wBAAwB,EACxB,8BAA8B,EAC9B,kCAAkC,EAClC,sBAAsB,EACtB,wCAAwC,GAKzC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,cAAc,GAIf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GAQvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,0BAA0B,EAC1B,wCAAwC,EACxC,wBAAwB,EACxB,iCAAiC,EACjC,wBAAwB,EACxB,4BAA4B,EAC5B,yBAAyB,EACzB,yBAAyB,EACzB,oBAAoB,EACpB,wBAAwB,EACxB,4BAA4B,GAK7B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,mCAAmC,EACnC,kCAAkC,EAClC,+BAA+B,EAC/B,2BAA2B,EAC3B,2BAA2B,EAC3B,yBAAyB,GAG1B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EACL,+BAA+B,EAC/B,0BAA0B,GAG3B,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,31 @@
1
+ /** The clipboard flavors we care about for a paste. */
2
+ export interface ClipboardPaste {
3
+ /** `text/plain` flavor — used for size heuristics and as the default body. */
4
+ text: string;
5
+ /** `text/html` flavor when the source provided one. */
6
+ html?: string;
7
+ }
8
+ /** Read the relevant clipboard flavors from a paste/drop DataTransfer. */
9
+ export declare function readClipboardPaste(data: {
10
+ getData(type: string): string;
11
+ } | null | undefined): ClipboardPaste;
12
+ export declare function shouldConvertPasteToAttachment(text: string): boolean;
13
+ /**
14
+ * Whether a clipboard paste is large enough to become a `Pasted text`
15
+ * attachment chip. Mirrors `shouldConvertPasteToAttachment` but evaluates the
16
+ * representation we'd actually store, so an HTML-only paste (empty text/plain)
17
+ * still converts on the strength of its markup.
18
+ */
19
+ export declare function shouldConvertClipboardToAttachment(paste: ClipboardPaste): boolean;
20
+ /**
21
+ * Build the attachment File for a page-sized paste, preserving HTML markup when
22
+ * the pasted content is an HTML document so it travels the same rail as an
23
+ * uploaded .html file.
24
+ */
25
+ export declare function createPastedAttachmentFile(paste: ClipboardPaste): File;
26
+ /** Back-compat helper for callers that only have plain text. */
27
+ export declare function createPastedTextFile(text: string): File;
28
+ export declare function isPastedTextAttachmentName(name: string | undefined): boolean;
29
+ export declare function unwrapAttachmentEnvelope(text: string): string;
30
+ export declare function countLines(text: string): number;
31
+ //# sourceMappingURL=pasted-text.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pasted-text.d.ts","sourceRoot":"","sources":["../../src/composer/pasted-text.ts"],"names":[],"mappings":"AA4CA,uDAAuD;AACvD,MAAM,WAAW,cAAc;IAC7B,8EAA8E;IAC9E,IAAI,EAAE,MAAM,CAAC;IACb,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,0EAA0E;AAC1E,wBAAgB,kBAAkB,CAChC,IAAI,EAAE;IAAE,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,GAAG,IAAI,GAAG,SAAS,GACzD,cAAc,CAIhB;AAmCD,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAWpE;AAED;;;;;GAKG;AACH,wBAAgB,kCAAkC,CAChD,KAAK,EAAE,cAAc,GACpB,OAAO,CAET;AAQD;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI,CAGtE;AAED,gEAAgE;AAChE,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAEvD;AAED,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAE5E;AAKD,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAG7D;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAO/C"}