@agent-native/core 0.110.3 → 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 +11 -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 -266
  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/awareness.d.ts +2 -2
  212. package/dist/collab/awareness.d.ts.map +1 -1
  213. package/dist/notifications/routes.d.ts +3 -3
  214. package/dist/package-lifecycle/tombstone.d.ts.map +1 -1
  215. package/dist/package-lifecycle/tombstone.js +13 -3
  216. package/dist/package-lifecycle/tombstone.js.map +1 -1
  217. package/dist/package-lifecycle/upgrade-error.d.ts +2 -2
  218. package/dist/package-lifecycle/upgrade-error.d.ts.map +1 -1
  219. package/dist/package-lifecycle/upgrade-error.js +8 -5
  220. package/dist/package-lifecycle/upgrade-error.js.map +1 -1
  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 -266
  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,262 +0,0 @@
1
- /**
2
- * Voice dictation button + recording overlay for the agent composer.
3
- *
4
- * UX mirrors Lovable: click-to-toggle record, a live amplitude bar and
5
- * MM:SS timer replace the editor area while recording, and a cancel X
6
- * discards without transcribing. The mic is always visible alongside the
7
- * send button (Cursor replaces send with mic; their users complain — we
8
- * don't copy that).
9
- */
10
-
11
- import {
12
- IconMicrophone,
13
- IconPlayerStopFilled,
14
- IconLoader2,
15
- IconX,
16
- } from "@tabler/icons-react";
17
-
18
- import {
19
- Tooltip,
20
- TooltipContent,
21
- TooltipTrigger,
22
- } from "../components/ui/tooltip.js";
23
- import { useBuilderConnectFlow } from "../settings/useBuilderStatus.js";
24
- import {
25
- type VoiceProviderStatus,
26
- useVoiceProviderStatus,
27
- } from "../voice-provider-status.js";
28
- import { RealtimeVoiceModeEntry } from "./RealtimeVoiceMode.js";
29
- import {
30
- useRealtimeVoiceModeCopy,
31
- useRealtimeVoiceModeOptional,
32
- } from "./useRealtimeVoiceMode.js";
33
- import type { VoiceDictationApi } from "./useVoiceDictation.js";
34
-
35
- function openOpenAiKeySettings(): void {
36
- window.location.hash = "#secrets:OPENAI_API_KEY";
37
- window.dispatchEvent(new Event("agent-panel:open"));
38
- window.dispatchEvent(
39
- new CustomEvent("agent-panel:open-settings", {
40
- detail: { section: "secrets" },
41
- }),
42
- );
43
- }
44
-
45
- export interface VoiceButtonProps {
46
- voice: VoiceDictationApi;
47
- isMac: boolean;
48
- disabled?: boolean;
49
- }
50
-
51
- export function isRealtimeVoiceSetupRequired(
52
- status: VoiceProviderStatus | null,
53
- builderConfigured: boolean | null,
54
- ): boolean {
55
- return (
56
- status !== null &&
57
- !status.builder &&
58
- !status.openai &&
59
- builderConfigured !== true
60
- );
61
- }
62
-
63
- export function VoiceButton({ voice, isMac, disabled }: VoiceButtonProps) {
64
- const { state, start, stop, supported } = voice;
65
- const realtimeVoice = useRealtimeVoiceModeOptional();
66
- const realtimeCopy = useRealtimeVoiceModeCopy();
67
- const voiceProviders = useVoiceProviderStatus();
68
- const builderConnect = useBuilderConnectFlow({
69
- trackingSource: "realtime_voice",
70
- trackingFlow: "voice_transcription",
71
- onConnected: () => voiceProviders.refresh(),
72
- });
73
-
74
- if (!supported) return null;
75
-
76
- const recording = state === "recording" || state === "starting";
77
- const transcribing = state === "transcribing";
78
-
79
- if (realtimeVoice?.active && !recording && !transcribing) return null;
80
-
81
- if (realtimeVoice && !recording && !transcribing) {
82
- return (
83
- <RealtimeVoiceModeEntry
84
- copy={realtimeCopy}
85
- disabled={disabled}
86
- providerStatusPending={voiceProviders.status === null}
87
- setupRequired={isRealtimeVoiceSetupRequired(
88
- voiceProviders.status,
89
- builderConnect.statusResolved ? builderConnect.configured : null,
90
- )}
91
- openAiConfigured={voiceProviders.status?.openai === true}
92
- connectingBuilder={builderConnect.connecting}
93
- onConnectBuilder={builderConnect.start}
94
- onUseOpenAiKey={() => {
95
- if (voiceProviders.status?.openai) void realtimeVoice.start();
96
- else openOpenAiKeySettings();
97
- }}
98
- onStartVoiceMode={() => void realtimeVoice.start()}
99
- onKeepDictating={() => void start()}
100
- />
101
- );
102
- }
103
-
104
- const label = recording
105
- ? "Stop recording"
106
- : transcribing
107
- ? "Transcribing…"
108
- : `Dictate (${isMac ? "⌘⇧M" : "Ctrl+Shift+M"})`;
109
-
110
- const onClick = () => {
111
- if (recording) stop();
112
- else if (!transcribing) void start();
113
- };
114
-
115
- return (
116
- <Tooltip>
117
- <TooltipTrigger asChild>
118
- <button
119
- type="button"
120
- onClick={onClick}
121
- disabled={disabled || transcribing}
122
- aria-label={label}
123
- aria-pressed={recording}
124
- className={`shrink-0 flex h-7 w-7 items-center justify-center rounded-md transition-colors duration-150 disabled:opacity-30 disabled:cursor-not-allowed ${
125
- recording
126
- ? "text-[#00B5FF] bg-[#00B5FF]/10 hover:bg-[#00B5FF]/20"
127
- : "text-muted-foreground hover:text-foreground hover:bg-accent/50"
128
- }`}
129
- >
130
- {transcribing ? (
131
- <IconLoader2 className="h-4 w-4 animate-spin" />
132
- ) : recording ? (
133
- <IconPlayerStopFilled className="h-3.5 w-3.5" />
134
- ) : (
135
- <IconMicrophone className="h-4 w-4" />
136
- )}
137
- </button>
138
- </TooltipTrigger>
139
- <TooltipContent>{label}</TooltipContent>
140
- </Tooltip>
141
- );
142
- }
143
-
144
- export interface VoiceRecordingOverlayProps {
145
- voice: VoiceDictationApi;
146
- }
147
-
148
- export function VoiceRecordingOverlay({ voice }: VoiceRecordingOverlayProps) {
149
- const { state, amplitude, durationMs, errorMessage, cancel } = voice;
150
- const { dismissError, start } = voice;
151
-
152
- if (state === "error" && errorMessage) {
153
- return (
154
- <div
155
- role="alert"
156
- className="mx-2 mt-1 flex items-start gap-2 rounded-md border border-red-500/40 bg-red-500/10 px-2 py-1.5 text-[11px] text-red-500"
157
- >
158
- <span className="flex-1 min-w-0">{errorMessage}</span>
159
- <Tooltip>
160
- <TooltipTrigger asChild>
161
- <button
162
- type="button"
163
- onClick={() => {
164
- dismissError();
165
- void start();
166
- }}
167
- className="shrink-0 cursor-pointer rounded px-1.5 py-0.5 text-[11px] font-medium text-red-500 hover:bg-red-500/20"
168
- aria-label="Try again"
169
- >
170
- Try again
171
- </button>
172
- </TooltipTrigger>
173
- <TooltipContent>Try again</TooltipContent>
174
- </Tooltip>
175
- <Tooltip>
176
- <TooltipTrigger asChild>
177
- <button
178
- type="button"
179
- onClick={dismissError}
180
- className="shrink-0 flex h-4 w-4 cursor-pointer items-center justify-center rounded text-red-500 hover:bg-red-500/20"
181
- aria-label="Dismiss"
182
- >
183
- <IconX className="h-3 w-3" />
184
- </button>
185
- </TooltipTrigger>
186
- <TooltipContent>Dismiss</TooltipContent>
187
- </Tooltip>
188
- </div>
189
- );
190
- }
191
-
192
- if (state !== "recording" && state !== "starting" && state !== "transcribing")
193
- return null;
194
-
195
- return (
196
- <div
197
- className="flex items-center gap-2 mx-2 mt-2 mb-1 h-[2rem] rounded-md border border-[#00B5FF]/40 bg-[#00B5FF]/10 px-2"
198
- aria-live="polite"
199
- >
200
- <Tooltip>
201
- <TooltipTrigger asChild>
202
- <button
203
- type="button"
204
- onClick={cancel}
205
- className="shrink-0 flex h-5 w-5 items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-accent/40"
206
- aria-label="Cancel recording"
207
- >
208
- <IconX className="h-3 w-3" />
209
- </button>
210
- </TooltipTrigger>
211
- <TooltipContent>Cancel (Esc)</TooltipContent>
212
- </Tooltip>
213
-
214
- <div className="flex-1 flex items-center gap-[2px] min-w-0 h-4">
215
- {state === "transcribing" ? (
216
- <span className="text-[11px] text-muted-foreground">
217
- Transcribing…
218
- </span>
219
- ) : (
220
- <AmplitudeBars amplitude={amplitude} />
221
- )}
222
- </div>
223
-
224
- <span className="shrink-0 text-[11px] font-medium tabular-nums text-muted-foreground">
225
- {state === "transcribing" ? (
226
- <IconLoader2 className="h-3 w-3 animate-spin" />
227
- ) : (
228
- formatDuration(durationMs)
229
- )}
230
- </span>
231
- </div>
232
- );
233
- }
234
-
235
- const BAR_COUNT = 24;
236
-
237
- function AmplitudeBars({ amplitude }: { amplitude: number }) {
238
- // Render a symmetric meter — the middle bars peak first so the visual
239
- // matches what voice input looks like in Lovable / iOS dictation.
240
- const bars = [];
241
- for (let i = 0; i < BAR_COUNT; i++) {
242
- const centerDistance =
243
- Math.abs(i - (BAR_COUNT - 1) / 2) / ((BAR_COUNT - 1) / 2);
244
- const heightPct =
245
- Math.max(0.1, amplitude * (1 - centerDistance * 0.6)) * 100;
246
- bars.push(
247
- <span
248
- key={i}
249
- className="flex-1 rounded-full bg-[#00B5FF]"
250
- style={{ height: `${heightPct}%`, minHeight: 2 }}
251
- />,
252
- );
253
- }
254
- return <>{bars}</>;
255
- }
256
-
257
- function formatDuration(ms: number): string {
258
- const total = Math.floor(ms / 1000);
259
- const m = Math.floor(total / 60);
260
- const s = total % 60;
261
- return `${m}:${s.toString().padStart(2, "0")}`;
262
- }
@@ -1,80 +0,0 @@
1
- const FALLBACK_BASE_URL = "http://agent-native.invalid";
2
-
3
- export const ASSET_PICKER_HANDOFF_PARAM = "__an_asset_picker_handoff";
4
- export const ASSET_PICKER_RETURN_ORIGIN_PARAM =
5
- "__an_asset_picker_return_origin";
6
-
7
- export interface StandaloneAssetPickerOptions {
8
- handoffId?: string;
9
- returnOrigin?: string;
10
- }
11
-
12
- export function createAssetPickerHandoffId(): string {
13
- if (typeof crypto !== "undefined" && crypto.randomUUID) {
14
- return crypto.randomUUID();
15
- }
16
- if (typeof crypto !== "undefined" && crypto.getRandomValues) {
17
- const bytes = crypto.getRandomValues(new Uint8Array(16));
18
- return Array.from(bytes, (byte) => byte.toString(16).padStart(2, "0")).join(
19
- "",
20
- );
21
- }
22
- return `${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`;
23
- }
24
-
25
- /**
26
- * Cross-origin Assets pages cannot inherit the host app's authenticated
27
- * session inside an iframe. Treat those URLs as link-out targets so provider
28
- * sign-in runs in a normal top-level browser context.
29
- */
30
- export function isExternalAssetPickerUrl(
31
- value: string,
32
- currentOrigin: string,
33
- ): boolean {
34
- try {
35
- return new URL(value, currentOrigin).origin !== currentOrigin;
36
- } catch {
37
- // A malformed configured URL should fail closed instead of being loaded in
38
- // an iframe with an unknown auth boundary.
39
- return true;
40
- }
41
- }
42
-
43
- /** Build a top-level picker URL without iframe-only auth flags. */
44
- export function standaloneAssetPickerUrl(
45
- value: string,
46
- baseUrl = FALLBACK_BASE_URL,
47
- options: StandaloneAssetPickerOptions = {},
48
- ): string {
49
- try {
50
- const parsed = new URL(value, baseUrl);
51
- parsed.searchParams.delete("embedded");
52
- parsed.searchParams.delete("__an_embed_token");
53
- parsed.searchParams.set("mediaType", "image");
54
- let returnOrigin: string | null = null;
55
- if (options.returnOrigin) {
56
- try {
57
- const parsedOrigin = new URL(options.returnOrigin);
58
- if (
59
- parsedOrigin.protocol === "http:" ||
60
- parsedOrigin.protocol === "https:"
61
- ) {
62
- returnOrigin = parsedOrigin.origin;
63
- }
64
- } catch {
65
- // Omit an invalid return target rather than emitting an unverified
66
- // cross-origin callback URL.
67
- }
68
- }
69
- if (options.handoffId && returnOrigin) {
70
- parsed.searchParams.set(ASSET_PICKER_HANDOFF_PARAM, options.handoffId);
71
- parsed.searchParams.set(ASSET_PICKER_RETURN_ORIGIN_PARAM, returnOrigin);
72
- } else {
73
- parsed.searchParams.delete(ASSET_PICKER_HANDOFF_PARAM);
74
- parsed.searchParams.delete(ASSET_PICKER_RETURN_ORIGIN_PARAM);
75
- }
76
- return parsed.toString();
77
- } catch {
78
- return value;
79
- }
80
- }
@@ -1,71 +0,0 @@
1
- import { SimpleTextAttachmentAdapter } from "@assistant-ui/react";
2
-
3
- const BASE_DOCUMENT_ATTACHMENT_ACCEPT = [
4
- "application/pdf",
5
- "application/vnd.openxmlformats-officedocument.presentationml.presentation",
6
- "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
7
- ".pdf",
8
- ".pptx",
9
- ".docx",
10
- ];
11
-
12
- export const PROMPT_DOCUMENT_ATTACHMENT_ACCEPT =
13
- BASE_DOCUMENT_ATTACHMENT_ACCEPT.join(",");
14
-
15
- export const CHAT_DOCUMENT_ATTACHMENT_ACCEPT = [
16
- ...BASE_DOCUMENT_ATTACHMENT_ACCEPT,
17
- "image/svg+xml",
18
- ".svg",
19
- ].join(",");
20
-
21
- export const IMAGE_ATTACHMENT_ACCEPT = [
22
- "image/jpeg",
23
- "image/jpg",
24
- "image/png",
25
- "image/gif",
26
- "image/webp",
27
- "image/heic",
28
- "image/heif",
29
- "image/avif",
30
- "image/bmp",
31
- "image/tiff",
32
- ".jpg",
33
- ".jpeg",
34
- ".png",
35
- ".gif",
36
- ".webp",
37
- ".heic",
38
- ".heif",
39
- ".avif",
40
- ".bmp",
41
- ".tif",
42
- ".tiff",
43
- ].join(",");
44
-
45
- export const TEXT_ATTACHMENT_ACCEPT = [
46
- "text/plain",
47
- "text/html",
48
- "text/markdown",
49
- "text/csv",
50
- "text/xml",
51
- "text/json",
52
- "text/css",
53
- "text/yaml",
54
- "application/json",
55
- "application/x-yaml",
56
- ".txt",
57
- ".md",
58
- ".markdown",
59
- ".csv",
60
- ".json",
61
- ".html",
62
- ".htm",
63
- ".css",
64
- ".xml",
65
- ".yaml",
66
- ".yml",
67
- ].join(",");
68
-
69
- export class TextAttachmentAdapter extends SimpleTextAttachmentAdapter {
70
- public accept = TEXT_ATTACHMENT_ACCEPT;
71
- }
@@ -1,7 +0,0 @@
1
- const BASE_COMPOSER_DRAFT_KEY = "an-composer-draft";
2
-
3
- export function getComposerDraftKey(scope?: string | null): string {
4
- const trimmed = scope?.trim();
5
- if (!trimmed) return BASE_COMPOSER_DRAFT_KEY;
6
- return `${BASE_COMPOSER_DRAFT_KEY}:${encodeURIComponent(trimmed)}`;
7
- }
@@ -1,55 +0,0 @@
1
- import { IconFile, IconFolder } from "@tabler/icons-react";
2
- import { mergeAttributes, Node } from "@tiptap/core";
3
- import { NodeViewWrapper, ReactNodeViewRenderer } from "@tiptap/react";
4
-
5
- const FileReferenceComponent = ({ node }: { node: any }) => {
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
-
10
- return (
11
- <NodeViewWrapper as="span" className="inline">
12
- <span
13
- 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"
14
- title={node.attrs.path}
15
- >
16
- {isFolder ? (
17
- <IconFolder size={14} className="shrink-0 text-muted-foreground" />
18
- ) : (
19
- <IconFile size={14} className="shrink-0 text-muted-foreground" />
20
- )}
21
- <span className="truncate">{displayName}</span>
22
- </span>
23
- </NodeViewWrapper>
24
- );
25
- };
26
-
27
- export const FileReference = Node.create({
28
- name: "fileReference",
29
- group: "inline",
30
- inline: true,
31
- selectable: true,
32
- atom: true,
33
-
34
- addAttributes() {
35
- return {
36
- path: { default: null },
37
- source: { default: "codebase" },
38
- };
39
- },
40
-
41
- parseHTML() {
42
- return [{ tag: 'span[data-type="file-reference"]' }];
43
- },
44
-
45
- renderHTML({ HTMLAttributes }) {
46
- return [
47
- "span",
48
- mergeAttributes({ "data-type": "file-reference" }, HTMLAttributes),
49
- ];
50
- },
51
-
52
- addNodeView() {
53
- return ReactNodeViewRenderer(FileReferenceComponent);
54
- },
55
- });
@@ -1,93 +0,0 @@
1
- import {
2
- IconFile,
3
- IconFolder,
4
- IconFileText,
5
- IconCheckbox,
6
- IconMail,
7
- IconUser,
8
- IconPresentation,
9
- IconStack2,
10
- IconMessageChatbot,
11
- } from "@tabler/icons-react";
12
- import { mergeAttributes, Node } from "@tiptap/core";
13
- import { NodeViewWrapper, ReactNodeViewRenderer } from "@tiptap/react";
14
-
15
- const iconProps = { size: 14, className: "shrink-0 text-muted-foreground" };
16
-
17
- function MentionIcon({ icon }: { icon?: string }) {
18
- switch (icon) {
19
- case "folder":
20
- return <IconFolder {...iconProps} />;
21
- case "document":
22
- return <IconFileText {...iconProps} />;
23
- case "form":
24
- return <IconCheckbox {...iconProps} />;
25
- case "email":
26
- return <IconMail {...iconProps} />;
27
- case "user":
28
- return <IconUser {...iconProps} />;
29
- case "deck":
30
- return <IconPresentation {...iconProps} />;
31
- case "agent":
32
- return <IconMessageChatbot {...iconProps} />;
33
- case "file":
34
- return <IconFile {...iconProps} />;
35
- default:
36
- return <IconStack2 {...iconProps} />;
37
- }
38
- }
39
-
40
- const MentionReferenceComponent = ({ node }: { node: any }) => {
41
- return (
42
- <NodeViewWrapper as="span" className="inline">
43
- <span
44
- 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"
45
- title={node.attrs.refPath || node.attrs.refId || node.attrs.label}
46
- >
47
- <MentionIcon icon={node.attrs.icon} />
48
- <span className="truncate">{node.attrs.label}</span>
49
- </span>
50
- </NodeViewWrapper>
51
- );
52
- };
53
-
54
- export const MentionReference = Node.create({
55
- name: "mentionReference",
56
- group: "inline",
57
- inline: true,
58
- selectable: true,
59
- atom: true,
60
-
61
- addAttributes() {
62
- return {
63
- label: { default: null },
64
- icon: { default: "file" },
65
- source: { default: "" },
66
- refType: { default: "file" },
67
- refId: { default: null },
68
- refPath: { default: null },
69
- slotKey: { default: null },
70
- slotLabel: { default: null },
71
- metadata: { default: null },
72
- };
73
- },
74
-
75
- parseHTML() {
76
- return [{ tag: 'span[data-type="mention-reference"]' }];
77
- },
78
-
79
- renderHTML({ HTMLAttributes }) {
80
- return [
81
- "span",
82
- mergeAttributes({ "data-type": "mention-reference" }, HTMLAttributes),
83
- ];
84
- },
85
-
86
- renderText({ node }) {
87
- return `@${node.attrs.label}`;
88
- },
89
-
90
- addNodeView() {
91
- return ReactNodeViewRenderer(MentionReferenceComponent);
92
- },
93
- });
@@ -1,56 +0,0 @@
1
- import { IconStack2 } from "@tabler/icons-react";
2
- import { mergeAttributes, Node } from "@tiptap/core";
3
- import { NodeViewWrapper, ReactNodeViewRenderer } from "@tiptap/react";
4
-
5
- const SkillReferenceComponent = ({ node }: { node: any }) => {
6
- const displayName =
7
- (node.attrs.name || node.attrs.path || "")
8
- .replace(/^(\.agents?\/)?skills\//, "")
9
- .replace(/\/SKILL\.md$/i, "")
10
- .replace(/\.md$/i, "")
11
- .split("/")
12
- .pop() || "skill";
13
-
14
- return (
15
- <NodeViewWrapper as="span" className="inline">
16
- <span
17
- 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"
18
- title={node.attrs.path}
19
- >
20
- <IconStack2 size={14} className="shrink-0 text-muted-foreground" />
21
- <span className="truncate">{displayName}</span>
22
- </span>
23
- </NodeViewWrapper>
24
- );
25
- };
26
-
27
- export const SkillReference = Node.create({
28
- name: "skillReference",
29
- group: "inline",
30
- inline: true,
31
- selectable: true,
32
- atom: true,
33
-
34
- addAttributes() {
35
- return {
36
- name: { default: null },
37
- path: { default: null },
38
- source: { default: "codebase" },
39
- };
40
- },
41
-
42
- parseHTML() {
43
- return [{ tag: 'span[data-type="skill-reference"]' }];
44
- },
45
-
46
- renderHTML({ HTMLAttributes }) {
47
- return [
48
- "span",
49
- mergeAttributes({ "data-type": "skill-reference" }, HTMLAttributes),
50
- ];
51
- },
52
-
53
- addNodeView() {
54
- return ReactNodeViewRenderer(SkillReferenceComponent);
55
- },
56
- });