Commit History
Yesterday
-
Update README.md Running
Verified signatured118a67
2 days ago
-
Rename Space to scaling-swarms
Verified signature9b76184
17 days ago
-
fix: fall back to the description in the hero when there is no subtitle
Matches the template's index.astro (subtitle || description). The editor shows the description as a full-strength placeholder that typing replaces. Co-authored-by: Cursor <cursoragent@cursor.com>170c4a2 -
chore(demo): import the showcase article from template 5313a10
Re-run import:showcase on the committed 5313a10 content: the 'Built with this' chapter is gone (gallery sentence in the intro), the template variants section describes the new layout, the screenshot cards and their images are dropped, and the install commands use --layout. Co-authored-by: Cursor <cursoragent@cursor.com>1e67405
18 days ago
-
feat: port the template's new page layout to the editor and published articles
The editor view and the published page now use the research-article-template layout mirrored in frontend/src/styles/template-layout/: one CSS grid with named lines (screen, page, toc, outset, body, margin) and the 1280+ / 1101-1279 / <=1100 tiers, for both the "article" and "paper" templates. Published page (backend/src/publisher): - layout-chrome.ts renders the template markup: centered hero (title, subtitle, then banner), meta columns (authors, affiliations, published + reading time + DOI, Resources with PDF/Cite buttons and the links row), line TOC rail with slim top bar and drawer, paper hero with link pills, footer without citation/DOI blocks for "paper" - <main class="tiptap"> is the page grid; wide, full-width and sidenote wrappers get the template classes, wide embeds get html-embed--wide - the generated layout runtime replaces the old inline TOC/hash scripts: heading anchors, scroll-spy, margin sidenote placement, Cite popover, debug grid on ?grid - <html data-t…eab9566 -
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 -
chore(demo): refresh showcase with the GPU cluster banner
Re-imported from research-article-template release/new-layout (683b6a1): the article now uses banner-gpu-cluster.html and drops the content experiment. Co-authored-by: Cursor <cursoragent@cursor.com>427ca3e -
fix(backend): require edit access for uploads
POST /api/upload had no auth check: anyone could push files to the HF dataset with the Space owner's token, and any cookie value was cached as the storage token. It now goes through requireEditor (after the per-IP rate limit, before the body is buffered), accepts PNG, JPEG, GIF, WebP and AVIF only (detected from the bytes, SVG refused) and answers 413 past 10 MB. requireEditor now tells apart 401 (no or invalid session) from 403 (signed in without write access). The citation routes, which fetch DOIs and URLs on the server, use it too. Co-authored-by: Cursor <cursoragent@cursor.com>7d7ba1b -
feat(demo): open the live demo on the template showcase article
The demo now loads demo-assets/showcase/article.json (made by npm run import:showcase) and falls back to the built-in sample article. build:demo copies demo-assets next to the bundle; regular builds do not. The simulated session takes its anchors from a script: on the showcase, Alice extends the welcome paragraph, Bob swaps a word in the audience list and the agent rewrites a sentence, then adds a chart of the article's own word count per section. Co-authored-by: Cursor <cursoragent@cursor.com>b37d969 -
perf(frontend): mount embed iframes and load images only near the viewport
Charts boot when they come within 800px of the viewport and then stay mounted, so long articles no longer start every iframe at once. Co-authored-by: Cursor <cursoragent@cursor.com>6d7d323 -
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 -
perf(frontend): load Mermaid, Shiki grammars and language detection on demand
- Mermaid is imported when a diagram renders - the editor uses shiki/core with the JavaScript regex engine and fetches each grammar the first time a block needs it; only SHIKI_LANGS ship - highlight.js language detection loads with the first language-less block - the chat panel and Embed Studio are lazy components - shiki-langs.ts holds the shared language/theme constants without a runtime Shiki import; the publisher keeps the eager highlighter Entry chunk: 2.79 MB -> 1.60 MB (813 KB -> 492 KB gzip). Co-authored-by: Cursor <cursoragent@cursor.com>d840d7c -
feat(frontend): browser-only live demo mode
VITE_DEMO=1 builds (or ?demo in dev) run the editor with no backend: - a local Y.Doc behind a LocalProvider, no IndexedDB, fresh on every load - scripted co-authors (Alice, Bob and Alice's agent) editing the sample article through Yjs awareness, pausing while the visitor types, replaying in a loop, and toned down for prefers-reduced-motion - AI chat, embed chat, publish, history, preview, DOI lookups and the embed check switched off with clear UI states; uploads stay inline - a network guard that fails any request to backend routes locally - Download .mdx built in the browser with the shared Markdown renderer - build:demo script and y-protocols as a direct dependency Co-authored-by: Cursor <cursoragent@cursor.com>6e392fe -
refactor(shared): move the Markdown renderer and publish types to shared
The renderer is a pure TipTap-JSON walk; living in backend/src/shared lets the frontend reuse it (the shared folder is the only backend code the frontend image build copies). Co-authored-by: Cursor <cursoragent@cursor.com>a241775
19 days ago
-
feat(frontend): static refined flat mark and favicons
Co-authored-by: Cursor <cursoragent@cursor.com>dd04bb6 -
feat(frontend): animated Weave logo and orbit loader
Co-authored-by: Cursor <cursoragent@cursor.com>eb6b368
20 days ago
-
feat(frontend): three-collaborators favicon and apple-touch icon
Same night-tile comets favicon as the Research Article Template site, generated by its scripts/brand/generate-comets.mjs. Co-authored-by: Cursor <cursoragent@cursor.com>e77fc7d -
fix(embed-kit): center the GPU cluster banner's city horizontally
The city was placed at 56.5% of the width on desktop to leave room for the HUD, which read as off-center (457 px left vs 250 px right at 1440 px). Its projected extent (blocks, switch, ring, cast shadows, GPU halos, status lights, roof ripples) is now computed once from the geometry and centered at every size; the shadow footprint is shared with the shadow pass. Vertical placement is unchanged within a pixel. Co-authored-by: Cursor <cursoragent@cursor.com>b57fc89 -
fix(embed-kit): switch hides the status lights behind it in the GPU cluster banner
Every animated mark was painted after all blocks, so node 07's status lights, which face the switch and are partly hidden by it, showed through the switch's left face as they lit up. The blocks are now cached in a back and a front layer split at the switch, and each node's lights are drawn right after its own layer. Also slow the animation to 0.65x through a single SPEED constant on the shared clock, so every phase stays in sync. Co-authored-by: Cursor <cursoragent@cursor.com>a246b1c -
feat(mcp): chart and publish tools, structured errors, JSON 404s
- Chart tools for external agents: create_embed (contract validation, data files, version 1, rendering check), insert_embed (after a block with expected_rev, caption, also in apply_edits), update_embed (html, patch or config values, expected_version, Studio draft guard), restore_embed_version, get_embed, list_embeds, check_embed. Every write is a version attributed to the agent; session undo and "Undo its changes" also revert charts. - publish and get_publish_status run the Publish button's flow (now a shared publish service): idempotent while a publish runs, absolute URLs, agent-attributed version. get_article_info states that a Space hosts a single article. - Errors carry a stable code and details in structuredContent (rev_conflict, version_conflict, draft_in_progress, invalid_embed...). - Unknown /.well-known, /mcp and /api paths answer a JSON 404 instead of the editor page, so MCP OAuth discovery falls back to the bearer token. - One headless Chromium job at a…2525af6 -
feat(embed-studio): tweak panel, inspect, automatic check, launcher, inline edit
- Tweak panel: embeds declare 2 to 6 settings in a data-embed-config JSON block (contract + agent prompt updated, runtime 1.2.0 exposes them as ctx.config and applies embedConfig messages live). Sliders, colors, selects, toggles and text update the preview instantly with no model call and are saved back as "manual tweak" versions. - Inspect: a point-and-click inspector in the studio preview; the picked element becomes an @this pointer for the next message, and a label held by a text setting can be edited without the AI. - Automatic check after each iteration: POST /api/embed-check renders the chart in headless Chromium (light/dark, 360/680 px, CDN-only network, one at a time) with the embed checker, now in src/embed-check, and the studio shows "N checks passed, 1 warning [Fix]". - Launcher for new figures (description, CSV drop, 4 gallery starters from GET /api/embed-starters, existing charts) from the top bar and the slash menu, instead of opening a random chart.…4953bfd -
feat(embed-studio): drafts with Apply to article, compare, data drawer
- The studio edits a shared draft (Y.Map("embed-drafts")); the article keeps the applied chart until "Apply to article". New charts from the slash menu or the top bar get their node only on Apply, at the cursor position kept as a Yjs relative position: no more empty nodes. - Closing with unapplied changes offers apply, keep draft or discard; the node shows "X is editing this chart" (awareness) or "Unapplied draft by X". Charts already in the article are not renamed. - Before/after compare reuses the two preview iframes side by side, with a line diff in the Code tab. - Docked data drawer with typed columns and a "used by this chart" flag; files dropped on the chat and tables pasted into it become data files attached to the next message. - "Writing chart... N lines" while the tool input streams. - The conversation of each chart is shared in Y.Map("embed-chats") (readable text only) instead of localStorage. Co-authored-by: Cursor <cursoragent@cursor.com>f7733a1 -
feat(embed-studio): error loop, versions, chips and preview controls
- Preview errors reach the agent: a studio-only reporter in the srcdoc relays uncaught errors, rejections, failed loads and embed:error to the parent; the studio shows "The chart threw ... [Fix it]" and sends one automatic fix per user message. - Versions per agent turn in Y.Map("embed-versions") (shared, capped at 20): vN / Restore / Compare under each reply, Undo last change; restore appends a copy so history stays linear. - Starter and follow-up prompt chips, preview width presets (Article, Wide, 360) and a local light/dark toggle pushed with setTheme. - The agent's title and source land on the node; Shiki code view with Copy and Download. - Provider errors keep their HTTP status; 401/402/429 become actionable messages with Retry; model name in the header; Done replaces Save & Close; no more fake "Generating chart..." banner. - Minimal mobile layout: files drawer and Chat / Preview tabs under 900px. Co-authored-by: Cursor <cursoragent@cursor.com>461e15a -
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 -
fix(persistence): save during non-stop editing and before a document unloads
- The Database store hook now flushes the pending debounced save. Hocuspocus runs it at most every 10 s while editing goes on and right before unloading a document, so saves no longer wait for a 2 s pause and a reconnect right after the last writer left no longer reloads a stale disk copy. - debouncedSave writes the previous Y.Doc's pending state at once when a reloaded document (new instance) comes in. - HF pushes wait at most 3x their debounce, so continuous saves cannot postpone the upload forever. - Drop the per-change "[persist] onChange" log line. - Regression scenarios 2.5.20 / 2.5.21; unit tests for flushSave and the reload case, and 2.1.3 now edits one document as in production. Co-authored-by: Cursor <cursoragent@cursor.com>fb274d8 -
test(scenarios): wait for the colleague to receive v1 before typing into it
Co-authored-by: Cursor <cursoragent@cursor.com>0adea15 -
fix(storage): merge with the stored copy on push, retry failed loads; add HF storage scenarios
- Pushes merge the CRDT state with the bucket/dataset copy first, so two servers on the same storage no longer erase each other's edits. - A failed document load closes the socket (1013) so every client, including stale tabs on old bundles, reconnects and retries instead of staying stuck on permission-denied. - Create the dataset before writing live-store.json on a new Space. - HF_PUSH_DEBOUNCE_MS / HF_PUSH_RETRY_MS overrides for scenarios. - Scenario harness gains a fault-injecting fake Hub (Node loader hook over @huggingface/hub) and wiped-disk rebuilds; 8 cloud scenarios. Co-authored-by: Cursor <cursoragent@cursor.com>9261492 -
test(scenarios): allow a slow cold server start on the image builder
Co-authored-by: Cursor <cursoragent@cursor.com>da6be31 -
feat(safety): rescue text removed by someone else's change, with real-life scenario tests
Deleting a paragraph in Yjs deletes everything inside it, so an agent revert, a version restore, a stale tab's delete or offline edits into a paragraph removed meanwhile silently dropped other people's words. - The server copies text deleted by someone other than its author into the doc's "rescued" map (authorship learned per Yjs client from the authenticated connection and kept in the doc). - Each tab copies its own text when a remote change removes it, the only place text typed into an already-deleted paragraph still exists. - History panel lists removed text with Put back / Copy / Dismiss; the author gets a banner pointing there. - tests/scenarios: real server process, browser-equivalent tabs and a chaos proxy (freeze, offline, server death) covering stale tabs, deploys, crashes, offline work and bulk removals. Co-authored-by: Cursor <cursoragent@cursor.com>9175180 -
feat(versions): version history, agent revert and safer MCP edits
- Checkpoints (local + dataset versions/<doc>/) every ~15 min of editing, before and after each agent session, on publish, on demand and before any restore, attributed to the humans and agents who edited. - History panel: versions grouped by day, block-level diff against the current text, restore applied as a minimal new change. - Agent avatars offer "Undo its changes", reverting everything the live session wrote while keeping other people's edits. - MCP: block rev in read_article with expected_rev checks, atomic apply_edits batches, save_version, and structuredContent results. Co-authored-by: Cursor <cursoragent@cursor.com>62809b0 -
feat(storage): keep the live document in an HF Storage Bucket, alert on failing saves
The live Yjs state is saved every few seconds; as git commits on the dataset that bloats history and hits commit rate limits. It now goes to an overwrite-in-place Storage Bucket (HF_BUCKET_ID, default <SPACE_ID>-live). A live-store.json marker in the dataset records the move so a stale dataset copy is never loaded or written again; before the marker exists both copies are merged as CRDT updates. Tokens that can't use buckets fall back to the dataset. Cloud save failures lasting over 2 minutes show a banner to everyone editing with a backup download, and ALERT_WEBHOOK_URL is posted to after 5 minutes and on recovery. Co-authored-by: Cursor <cursoragent@cursor.com>529800c -
chore(demo): refresh showcase personas and add an Embed Studio scene
Co-authored-by: Cursor <cursoragent@cursor.com>de58617 -
feat(editor): open the author form directly on an empty byline
Co-authored-by: Cursor <cursoragent@cursor.com>33cd7bc -
feat(mcp): remote MCP server so external agents edit as collaborators
Claude Code, Cursor, Codex and other MCP clients connect to /mcp (Streamable HTTP) with an HF token. Each session is a headless Hocuspocus peer with its own awareness entry and "<Name> agent" focus label, checked by the same write-permission gate as a browser login. - Tools: read_article (outline / section), replace_text (minimal diff that keeps formatting and comment anchors), insert_blocks, replace_block, delete_block, update_metadata, comments, focus, undo (own steps only). - Stable block ids from Yjs item ids; Markdown in, source-syntax Markdown out ([@key] citations, ^[footnotes]). - Origin validation, token-bound sessions, idle cleanup. - End-to-end test with a live server, a human peer and the SDK client, including schema validation of everything the agent writes. Co-authored-by: Cursor <cursoragent@cursor.com>08e03e9 -
feat(editor): preserve shared content the schema can't display
Use y-tiptap onInvalidContent so unknown nodes written by a newer client or an agent stay in the Y.Doc instead of being deleted. Editing pauses with a banner until the content fits again. enableContentCheck is avoided on purpose: it would make setContent and insertContent throw on unknown HTML. Co-authored-by: Cursor <cursoragent@cursor.com>f05b589 -
fix(editor): sanitize peer colors and avatars from awareness
Any client, including an external agent, can broadcast arbitrary identity fields. Colors are restricted to hex before reaching style attributes and avatars to https URLs (HF-relative paths resolved). Also adapts the cursor user type to y-tiptap 3.2. Co-authored-by: Cursor <cursoragent@cursor.com>7ee8dc5 -
fix(publisher): derive KaTeX CSS version from the installed package
A stale pinned URL plus integrity hash made browsers drop the stylesheet, so published equations fell back to raw MathML. Co-authored-by: Cursor <cursoragent@cursor.com>06fceec -
feat(embeds): shared Embed.mount runtime, checker, gallery and evals
- Own the embed runtime and authoring guides in embed-kit/ and generate the runtime and agent skill into backend/src from them. - Embed Studio prompts and tools target the Embed.mount contract; seed embeds are migrated to it. - Add a headless checker (check:embeds), an eval harness with comparison report, and a gallery of showcase embeds and banners. Co-authored-by: Cursor <cursoragent@cursor.com>4e112fd -
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(highlight): auto-detect language for code blocks without explicit lang
Code blocks authored without a language rendered as plain text in both the editor and the published output (Shiki falls back to "text"). Add a shared lowlight-based detector and use it as a fallback in the editor decorations and the publish transformer, so language-less blocks get highlighted identically everywhere - including in already-written articles. Co-authored-by: Cursor <cursoragent@cursor.com>700adac -
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
-
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(editor): use explicit class for multi-count avatar z-index
Replace the :has() selector with an explicit --multi modifier class for reliable cross-browser support of the overlapping collaborator avatars. Co-authored-by: Cursor <cursoragent@cursor.com>6b2bf82
-
feat(editor): dedupe connected collaborators by identity
The presence avatars were keyed by Yjs awareness clientId, so the same person showed up once per connection: every extra tab/device, and every lingering pre-timeout socket left behind by a reconnect (amplified by the refocus re-sync), rendered the same circle again. Collapse awareness clients sharing an identity (HF username, falling back to avatar URL then clientId) into a single avatar, with a "xN" badge + tooltip when a person has multiple live sessions. Co-authored-by: Cursor <cursoragent@cursor.com>a0b96b1 -
feat(editor): authors & affiliations manager modal
Replace the undiscoverable inline drag with a single, discoverable modal for the whole byline. From the hero (pencil button, clicking an author, or clicking an affiliation) users open AuthorsManager to add/edit/remove authors and affiliations and reorder both lists via explicit up/down controls. - store: add updateAffiliation/removeAffiliation; removeAffiliation reconciles every author's 1-based references (drop + shift) like moveAffiliation does - extract AuthorInlineForm into its own file, reused as the add/edit form (stacked dialog) inside the manager - affiliations get inline name/URL editing with debounced commits - drop the inline drag-and-drop handlers/styles from the displayed header Co-authored-by: Cursor <cursoragent@cursor.com>005eeff -
fix(editor): preview the banner correctly in the Embed Studio
The studio built every preview srcdoc without fullBleed and let the iframe fill the whole preview pane, so the banner (an edge-to-edge 5:2 embed) was rendered like a height-reporting chart and looked nothing like the hero. When editing banner.html, build the srcdoc with `fullBleed: true` and render it inside a centered 5:2 stage (matching .hero-banner dimensions), so the studio preview is a true WYSIWYG of the published header. Regular charts are unchanged. Co-authored-by: Cursor <cursoragent@cursor.com>3d7f9ad -
feat(editor): Embed Studio button in the top bar
Adds a chart button to the TopBar that opens the Embed Studio. Smart entry point: when charts already exist it opens the studio on one of them (prefers a real chart over the always-present banner) without mutating the document; only when there is no chart does it fall back to inserting a fresh one, mirroring the slash menu's "New Chart" flow. Both paths route through the existing `open-embed-studio` event so session/key handling stays in one place. Co-authored-by: Cursor <cursoragent@cursor.com>2dfb335 -
feat(editor): drag-and-drop reordering for authors and affiliations
Authors and affiliations in the hero meta header can now be reordered by dragging. Reordering affiliations remaps every author's 1-based affiliation indices in the same Yjs transaction, so superscripts keep pointing at the right institution. Drop affordances (grab cursor + primary-color edge marker) live in the editor-only _hero-editable.css and never leak into the published HTML. Co-authored-by: Cursor <cursoragent@cursor.com>a2d6d01 -
fix(publisher): render banner in fullBleed mode to match the editor
The editor preview builds the banner srcdoc with `{ fullBleed: true }` (FrontmatterHero), but the publisher built it with no options. Without fullBleed the published banner kept the default 16px body padding, lacked the 100%-height chain, and ran the height reporter (resizing the iframe to the content scrollHeight instead of the parent's 5:2 aspect-ratio box) - so the published banner looked different from the editor. Pass `{ fullBleed: true }` for parity. Co-authored-by: Cursor <cursoragent@cursor.com>2c3dcf7
-
test(editor): extract refocus re-sync into a unit-tested module
Pull the tab-refocus liveness/lock logic out of the Editor effect into a pure createRefocusSync() so it can be exercised without a browser. Add vitest coverage for the four cases it must distinguish: healthy (no lock), disconnected (lock + unlock on synced), dead readyState, half-open socket (lock after the post-forceSync probe), and the offline grace release. The effect now only wires the visibilitychange trigger. Co-authored-by: Cursor <cursoragent@cursor.com>45d6656