Commit History
23 days ago
-
build: mirror the research-article-template page layout
Add `npm run sync:template-layout` (backend/scripts/sync-template-layout.mjs). It copies the template's grid tokens and layout stylesheets into frontend/src/styles/template-layout/ with @custom-media resolved (neither Vite nor the publisher runs PostCSS), lifts the paper hero styles out of HeroPaper.astro, copies the link icons, and bundles the layout scripts (TOC, heading anchors, sidenotes, meta columns, debug grid on ?grid) into backend/src/publisher/layout-runtime.generated.ts. `--check` reports drift. Co-authored-by: Cursor <cursoragent@cursor.com>e5e073b -
feat(backend): import a research-article-template MDX article as an editor seed
Add scripts/import-showcase.ts (npm run import:showcase -- <content dir>): parses article.mdx and its chapters with remark-mdx, maps the template components onto the editor's nodes, converts the BibTeX bibliography to CSL-JSON, inlines the embeds (banner from the frontmatter included) and copies the images, audio and data files they use. The doc is checked against the publisher schema and the script reports what it simplified or dropped. Co-authored-by: Cursor <cursoragent@cursor.com>b9d291f
25 days ago
-
test(load): add a load test with simulated users, MCP agents and chaos
npm run test:load runs a real server on the fake Hub (production push timings) with users in child processes typing keystroke by keystroke, churn (wifi drops, sleeping laptops, reloads), MCP agents, a 15k-word article and optional HF outage + deploy on a wiped disk. It reports propagation latency, server CPU/RSS, HTTP and agent latency, Hub pushes, then checks that nothing was lost or diverged on any tab, in the cloud copy and on a fresh container. The scenario harness gains realTimings, wrap, env, nodeArgs, pid, errorLines and a bounded log buffer; Tab.open accepts any { port }. Documented in TESTS.md section 2.6 with results on an M1 Pro. Co-authored-by: Cursor <cursoragent@cursor.com>20d64bc -
feat(collab)!: migrate to Hocuspocus v4 and harden persistence
- Upgrade Hocuspocus 3 -> 4.8, Tiptap 3.33, @tiptap/y-tiptap 3.2, Yjs 13.6.33 and require Node 22 (Docker images and README). - Wire Hocuspocus v4 custom integration (web Request, forwarded messages and close events) and freeze inbound edits before the final shutdown snapshot. - Fail-closed document loading, atomic local writes, ordered HF pushes with retry, and a cloud-pull error stage in the sync indicator. - Run typecheck and tests as blocking steps in the Docker build, the only CI gate for a Space that deploys on push. - Add data-safety, storage-ordering, shutdown-flush and auth-guard suites, plus an opt-in Playwright collab-sync E2E test. BREAKING CHANGE: Node 22+ is required; y-tiptap 3.2 drops position migrations, so every collaborating client must reload after deploy. Co-authored-by: Cursor <cursoragent@cursor.com>3557a6a
-
fix(publisher): render math server-side via KaTeX
TipTap's math extension emits empty inline/block-math placeholders during generateHTML (rendering is a view-only step). Add a math transformer that fills those placeholders with static KaTeX HTML so formulas appear in the published article. Pin the KaTeX CSS CDN version to the server-side katex. Co-authored-by: Cursor <cursoragent@cursor.com>7b13bd7
-
chore(deps): align @hocuspocus /provider with server (v3)
The backend declared @hocuspocus/provider ^4.0.0 while the server and frontend run ^3.4.4. A v4 provider (used by the demo clients) against a v3 server risks protocol drift; pin it to the same major. Co-authored-by: Cursor <cursoragent@cursor.com>24e2428
-
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(demo): full showcase polish - mouse cursor, robust selection, HF affiliations
Demo orchestration: - Visible mouse cursor overlay (popover top-layer, MutationObserver to stay above native dialogs) + humanMove/humanClick/humanHover helpers - Yjs Node.js clients for Bob and Carol with awareness cursors and a set of high-level helpers (writeBlockMathAtSlot, setAffiliationUrl, waitForAffiliationCount, etc.) so peer interactions never collide - Pre-bold sync barrier: Alice waits for Bob's block math and Carol's code block to land before doing the bubble-toolbar bold so layout is frozen during the drag selection (no more cross-paragraph selections) - Progressive cursor-driven text selection (visible glide + step-wise setTextSelection) for bold and rephrase actions - Custom rAF-eased scroll-to-top on the actual .editor-scroll container before the hue drag so the banner retint reads on camera Embed Studio: - New architecture.json companion data file (transformer-block layers) seeded alongside model-accuracy.csv, so the agent has something concrete to r…f469961
-
test(backend): add Playwright E2E suite + deps for editor basics, chat persistence and publish
- Covers 9 flows: title persistence through Hocuspocus reload, settings drawer, chat panel open/close, new-conversation clear, stable user identity across reloads, publish round-trip - Bundled as `npm run test:e2e` (opt-in, not part of the fast hermetic suite) with spec-driven fixtures that spin up a real Express + Hocuspocus server on an ephemeral port - Brings playwright + @playwright/test into backend/package.json Made-with: Cursor6a34a48
-
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: enable PDF generation by adding playwright dependency
- Add playwright as a production dependency in backend - Set PLAYWRIGHT_BROWSERS_PATH in Dockerfile for reliable browser discovery - Remove silent fallback on playwright install to surface errors - Remove non-functional PDF button from editor hero (only relevant in published output) - Respect showPdf frontmatter flag in publisher pipeline Made-with: Cursor8d245e0 -
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 -
fix: rename to Research Article Template Editor
Made-with: Cursor1e2f7dc -
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
-
fix: replace express-ws with native ws to fix WebSocket binary handling
express-ws bundles ws@7.5.10 while @hocuspocus/server requires ws@8.x. This version mismatch causes ERR_ENCODING_INVALID_ENCODED_DATA errors as the binary Yjs protocol messages get corrupted passing through express-ws's incompatible ws instance. Replace express-ws with native http.createServer + ws.WebSocketServer handling the upgrade event directly. This ensures a single ws@8.20.0 is used throughout, matching what Hocuspocus expects. Made-with: Cursor82092f2 -
fix: use TiptapTransformer to extract Y.Doc content for publish
The old extractFromYDoc relied on a Y.Map("tiptap-json") that the editor never populated. Now uses @hocuspocus/transformer to properly convert the Y.XmlFragment to ProseMirror JSON using the same extensions as the server-side HTML renderer. Made-with: Cursordb4f7ee -
feat: add publish pipeline with HTML/PDF/thumbnail generation
Publisher pipeline (POST /api/publish): - Server-side TipTap extensions mirroring frontend (no React) - generateHTML() produces article HTML with SEO meta tags - Playwright-based PDF and OG thumbnail generation (optional) - Upload published artifacts to HF dataset (or local fallback) - HTML template with light/dark theme toggle, image lightbox Routing updates: - Authenticated editors get SPA, visitors get published HTML - Image proxy for private HF datasets (/api/images/*) - Serve local published articles from /published/ Also: add type declarations for citation-js and playwright Made-with: Cursor3171ebe -
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