Commit History
-
docs(spec): drop residual OpenRouter mentions
Three references slipped through the HF Inference migration: the system diagram, the API route table (/api/chat description) and the agent sequence diagram all still named OpenRouter as the LLM backend. Replace them with HF Inference (Providers) to match the actual implementation in stream-handler.ts. Co-authored-by: Cursor <cursoragent@cursor.com>68dccd7 -
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
-
docs: refresh README, architecture, spec and add agent teams proposal
- README: align env var table with real backend (OPENROUTER_API_KEY, HF_DATASET_ID, SPACE_ID, PUBLISH_BASE_URL, ENABLE_PDF, OAUTH_SCOPES) and fix prerequisites - ARCHITECTURE / SPECIFICATION: describe the new transformer pipeline, embed studio flow, mobile TOC + CommentPopover; drop the deleted CommentsSidebar reference - TESTS: announce the Playwright E2E suite as part of the stack and add 4.1.4 for the upload rate limiter; note the split between fast hermetic suite and opt-in E2E - Add AGENT_TEAMS_PROPOSAL.md to track the upcoming multi-agent collaboration design Made-with: Cursor32a4aca -
feat(backend): rate-limit /api/upload to prevent anonymous abuse
Upload stays intentionally unauthenticated (covered by spec 4.1.3), so guard it with a simple per-IP sliding-window limiter (30 uploads / 60s). The limiter returns 429 with a Retry-After header and uses the X-Forwarded-For head when behind a proxy. Spec updated with the new 4.1.4 test line. Made-with: Cursor5576f9a
-
refactor: remove MUI, unify publisher pipeline, add shared component registry
Phase 1 - Publisher pipeline: - Extract ~370 lines of inline CSS from html-renderer.ts into _publisher.css - Create shared/component-defs.ts as single source of truth for component definitions - Replace 6 regex blocks in postProcess() with linkedom DOM manipulation - Add GET /api/preview/:docName for testing renders without publishing - Add 12 snapshot tests for each postProcess transformation (46 tests total) Phase 2 - Remove MUI: - Replace all MUI components with native HTML elements + custom CSS - Create _ui.css with editor chrome styles using --ed-* CSS tokens - Create Tooltip.tsx using Floating UI (lightweight replacement) - Replace @mui/icons-material with lucide-react - Delete theme.ts, remove @mui/* and @emotion/* dependencies Phase 3 - Documentation: - Add docs/ARCHITECTURE.md covering CSS layers, HF Spaces constraints, shared registry, publisher pipeline, and test coverage Made-with: Cursord15d7f7 -
fix: prevent seed race condition with Y.Map guard and defensive checks
- Add Y.Map("meta").seeded flag to prevent multiple clients from seeding the same empty doc concurrently (Yjs merge duplication) - Set seededRef early to prevent re-entry - Add authors array length check in seedFrontmatter as extra guard Made-with: Cursorce5a372 -
test: add vitest test suite for publisher, auth, security, utils
- Setup vitest with test helpers for Y.Doc fixtures - 34 tests across 6 files covering: - Publisher pipeline (extraction, HTML gen, post-processing, idempotency) - XSS prevention (licence, title, description, authors, DOI) - Auth (token extraction, OAuth config) - Utils (sanitizeName, docPath, path traversal) - CSS @custom-media resolution - HF Storage configuration Made-with: Cursor755a930 -
refactor: rename to Science Article Template Editor, remove MDX export, fix settings drawer
- Rename project from "Collab Editor" to "Science Article Template Editor" across README, package.json, HTML titles, and docs - Remove MDX export: delete to-mdx.ts, serializers, UI button, and registerComponentSerializers; use editor.getText() for agent context - Settings drawer: flatten Advanced accordion, fix toggle clipping (ml: 0), widen to 380px, use slotProps.paper (MUI v9) Made-with: Cursor20354ec
-
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