tfrere HF Staff commited on
Commit
8fc8501
·
1 Parent(s): 19b3f9c

feat(editor): embed studio with data files and agent-aware editing

Browse files

Editor
- New Embed Studio panel for AI-assisted chart creation: upload and
manage data files (3MB limit), browse them in a dedicated viewer,
and iterate on the generated HTML via a chat wired to a dedicated
embed agent (embed-chat + embed-system-prompt + embed-tools +
tiptap-catalog) that can create, rename and edit embeds.
- Tiptap extensions for agent-driven editing:
- agent-focus: Yjs-awareness ranges so every peer sees where
another user's AI is working ("<Name> agent" label).
- agent-highlight: local PM decoration to mark the paragraph the
agent is currently rewriting.
- agent-rewrite: typewriter-animated range rewrite command used
by the rephrase flow.
- Rephrase flow now goes through agent-rewrite (typewriter) instead
of a plain replace; bold demonstration moved to the floating bubble
toolbar above a selection.
- SlashMenu reorganised with grouping and dev-only items dropped.
- New components: DataFileViewer, FilesSidebar, UploadZone.
- Refreshed TopBar, ChatPanel, SettingsDrawer, Editor.
- Hooks: useEmbedChat + useEmbedData (data file store) + refreshed
useAgentChat.
- data-files helper + ai-tool-parts update.

Made-with: Cursor

27 files changed +3127 -150
Files changed (27)
backend/src/agent/embed-chat.ts+13
backend/src/agent/embed-system-prompt.ts+55-6
backend/src/agent/embed-tools.ts+36
backend/src/agent/system-prompt.ts+99-7
backend/src/agent/tiptap-catalog.tsAdded+266
backend/src/agent/tools.ts+17-2
frontend/src/components/ChatPanel.tsx+1-43
frontend/src/components/DataFileViewer.tsxAdded+157
frontend/src/components/EmbedStudio.tsx+87-7
frontend/src/components/FilesSidebar.tsxAdded+132
frontend/src/components/TopBar.tsx+99-1
frontend/src/components/UploadZone.tsxAdded+65
frontend/src/editor/Editor.tsx+19-1
frontend/src/editor/SlashMenu.tsx+150-33
frontend/src/editor/agent-executor.tsAdded+218
frontend/src/editor/embeds/embed-data-store.tsAdded+107
frontend/src/editor/extensions/agent-focus.tsAdded+315
frontend/src/editor/extensions/agent-highlight.tsAdded+165
frontend/src/editor/extensions/agent-rewrite.tsAdded+267
frontend/src/editor/frontmatter/SettingsDrawer.tsx-9
frontend/src/hooks/useAgentChat.ts+33-28
frontend/src/hooks/useEmbedChat.ts+157-9
frontend/src/hooks/useEmbedData.tsAdded+109
frontend/src/styles/components/_embed-studio.css+388
frontend/src/styles/editor/_block-tools.css+22-3
frontend/src/utils/ai-tool-parts.ts+5-1
frontend/src/utils/data-files.tsAdded+145