Commit History
20 days ago
-
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(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(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