Commit History
-
feat(editor): inline author editor with affiliation typeahead and DnD
Simplify the Authors & affiliations modal UX without changing the data schema: - Add/edit authors inline (drop the separate AuthorInlineForm modal). - Attach affiliations via a single typeahead that matches an existing one or creates a new one in one gesture. - Collapse the affiliations list (reorder + rename + URL) behind a disclosure since it is rarely touched. - Replace up/down chevrons with a grip handle and native drag-and-drop reordering for both authors and affiliations. Store gains atomic addAuthor/updateAuthor (create + attach new affiliations in one transaction) and auto-prunes orphan affiliations with 1-based index remapping. The agent tooling and system prompt follow the new author-driven affiliation model. Co-authored-by: Cursor <cursoragent@cursor.com>53c7a9e
-
fix(agent): disable response buffering for chat streaming
The AI SDK streams tokens chunk-by-chunk via \`streamText\` + \`toUIMessageStreamResponse\`, but on a HF Space the response went through layers that re-coalesced everything into one big payload arriving at message end: - Nginx in front of the Space buffers responses by default unless \`X-Accel-Buffering: no\` is set; - transparent gzip on the path holds chunks until the compression window fills; - TCP_NODELAY off keeps small writes in the kernel until they reach MTU. End result: the user saw \"Thinking...\" then the whole assistant reply dropped at once, masking the streaming. Fix: - Set \`X-Accel-Buffering: no\` and \`Content-Encoding: identity\` on the streamed response so proxies pass bytes through as they arrive. - Add \`Cache-Control: no-cache, no-transform\` to also block transforming/compressing intermediaries. - Call \`res.flushHeaders()\` so the browser commits to streaming mode immediately (first-byte triggers progressive rendering of the assistant bubble)…df28ae4 -
fix(agent): forbid re-pasting tool output in the text reply
After calling \`createEmbed\` / \`patchEmbed\` (embed chat) or \`insertAtCursor\` / \`applyDiff\` (main chat), the model would re-emit the just-inserted code/prose verbatim inside its text reply. The chart is already live in the preview pane and the doc is already updated, so the dump is pure noise - it pollutes the chat history, looks like a "did it stream?" stall to the user (the long reply only appears once the full text is buffered on the client), and bloats the next turn's context window. Tighten both prompts: - embed-system-prompt: new "Reply format (STRICT)" section. Caps the reply at 1-2 sentences, explicitly forbids fenced code blocks of the chart source, bullet "feature" lists and phrases like "Voici le code" / "Just paste this where you want the banner". Keeps an escape hatch for "show me the code" requests (short relevant snippet only). - system-prompt: extend the anti-patterns list with a "NEVER paste the content you just inserted/replaced back into your te…e8173b7 -
feat(embed-studio): make agent-generated charts theme-aware
The iframe already supports live light/dark swap via CSS variables and a postMessage(setTheme) hot-swap, but the LLM kept generating charts that hardcode colours into SVG attributes (fill="#333", stroke="black", ...). Those values can't be overridden by the parent's data-theme attribute, so the chart looked correct on whatever theme the model guessed and broken on the other one. Two complementary fixes: 1. Forward the current theme (light/dark) from EmbedStudio through useEmbedChat into the request context, and surface it in the system prompt as a "Current theme" section. The model now knows which background it's painting against and can self-correct. 2. Rewrite the "Colors & theming" section of the embed system prompt with a concrete CSS pattern (scoped .d3-* rules driving fill/stroke via var(--text-color), --axis-color, --grid-color, ...) and an explicit ban on hardcoded SVG colour attributes. Add a hint about window.__chartRerender for JS-driven palettes. No…27abbe5 -
fix(agent): default back to gpt-oss-120b, pin Llama 3.3 to Together
Groq (HF Router's :fastest pick for Llama 3.3 70B) validates tool calls very strictly and was rejecting the editor's 18-tool registry with "Failed to call a function. Please adjust your prompt." Fireworks has deprecated the Llama 3.3 checkpoint; Nscale doesn't support the `tools` parameter at all. Together serves the same model with full tool-calling support, so pin Llama 3.3 to `:together`. Restore openai/gpt-oss-120b as the default - it's HF's trending tool-calling model and the reasoning-strip fix already covers the Cerebras round-trip case. Co-authored-by: Cursor <cursoragent@cursor.com>3afbbdf -
fix(agent): strip reasoning_content from history, default to Llama 3.3 70B
Reasoning models (gpt-oss-*, DeepSeek R1, ...) emit a `reasoning` UI part alongside their text answer. The AI SDK persists those parts and on the next turn round-trips them as `reasoning_content` on the assistant message - which some HF Inference Providers (notably Cerebras, the default for gpt-oss) reject with 400 wrong_api_format. The model doesn't need to see its own prior reasoning to keep the conversation going, so filter those parts out before convertToModelMessages. While we're at it, swap the default model from gpt-oss-120b to meta-llama/Llama-3.3-70B-Instruct: it doesn't emit reasoning, works across every provider exposing it, and is a more conservative starting point for first-time forkers. Co-authored-by: Cursor <cursoragent@cursor.com>e9c2c73 -
feat(agent): switch AI backend from OpenRouter to HF Inference Providers
The chat panel and embed studio now call Hugging Face Inference Providers (OpenAI-compatible router at https://router.huggingface.co/v1) via @ai-sdk/openai-compatible, using the logged-in editor's OAuth token when available and falling back to HF_TOKEN. Forking the Space no longer requires wiring an OpenRouter API key - the user's own HF token funds their own inference. - Replace @openrouter/ai-sdk-provider with @ai-sdk/openai-compatible - Forward the OAuth cookie token per request, fallback to HF_TOKEN - Refresh AVAILABLE_MODELS to HF-served, tool-calling-capable models (gpt-oss 120B/20B, Llama 3.3 70B, Qwen3 Coder 480B, DeepSeek V3.1) - Add inference-api to hf_oauth_scopes and document the new env vars (HF_INFERENCE_MODEL, expanded HF_TOKEN role) in README + SPECIFICATION - Update agent-chat tests to expect the new "Hugging Face token" error Co-authored-by: Cursor <cursoragent@cursor.com>6b6afea
-
feat(editor): embed studio with data files and agent-aware editing
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. - …8fc8501
-
refactor(backend): modular server split with new routes, persistence and agent layer
- Introduce create-app factory to compose routes, middleware and Hocuspocus in isolation - Extract route modules (auth, chat, publish) and move storage logic into persistence.ts - Harden auth + HF storage integration (user token fallback, secure cookie in production) - Add embed studio AI pipeline (embed-chat, embed-tools, system prompt) and shared stream handler - Cover the new surface with api-routes, persistence and agent-chat test suites - Ship .env.example and .gitignore so new contributors can boot without guesswork Made-with: Cursorf6678ab
-
chore: initial commit
Collaborative article editor with TipTap, Yjs, and HF integration. Features: - Real-time collaborative editing (Hocuspocus + Yjs) - Notion-like block handles, slash commands, bubble toolbar - Academic citations (Citation.js + DOI/BibTeX) - KaTeX math, code highlighting, tables - Custom component system (accordion, note, quote, stack, etc.) - LLM agent sidebar (OpenRouter) - Image upload with HF dataset storage - MDX export - Frontmatter management (title, authors, affiliations) - Comments system Made-with: Cursor561e6f0