Spaces:
Sleeping
Sleeping
Commit History
-
Merge pull request #26 from huggingface/fix/reactivate-default-agent
Leandro von WerraUnverified signatureLet a stopped built-in agent be started again, from the panele05affd -
Merge pull request #42 from huggingface/fix/mention-author-trust
Leandro von WerraUnverified signatureTake comment authorship from the socket; read-only agent-key sockets4c1d89f -
Identify a message by its place in the document, not by the id a client chose
From the review of this PR: a message id comes from the client and need not be unique, while both the writer record and the relabel were keyed by it. Writing a second message with an existing id therefore consumed the first message's record and relabelled the first message. Two consequences, both display-only (no mention was delivered either way), and both the opposite of what the tag is for: - a genuine message could be branded "unverified: posted as alice" while the copy beside it went untagged, and - a message claiming to be an agent reply could ride in behind a legitimate one and be stored, shown and served as a real reply from @alice-bot. Writers are now recorded against the Yjs item that carries each message, which the client cannot choose, and the relabel is written at that message's position. Everything else is unchanged. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>172ea4c -
Revalidate uploaded SVGs, so a cache cannot outlive their protection
From the review of this PR: the headers only protect a response as it is served, while uploads are cached `immutable` for a year. A browser that had already loaded an SVG — through an ordinary <img> in a document, which never runs script — keeps that unprotected copy and serves it from disk on a later navigation. The exploit then still works after this fix is deployed. SVGs are now served `private, no-cache, must-revalidate`, so a browser asks again and gets the sandboxed, attachment response. Raster images are inert whatever headers they arrive with, so they keep the long immutable cache. This does not reach a copy cached before the fix is deployed: nothing can invalidate an immutable response already on disk. On this instance that is moot — production has exactly one uploaded SVG, the 402-byte seeded playground chart, with no script, no event handlers and no foreignObject — but a general fix for already-cached files would have to change the upload URLs or the origin they are served…c653e7f
-
Take comment authorship from the socket; read-only agent-key sockets
Agent Manager +1: Claude Opus 5.5Thread messages are client-written Yjs data, and the mention scan trusted their `author`/`authorType`. A collaborator could write as the owner and trigger the owner's private agent, a leaked agent key's socket could do the same for anyone, and anyone could pass a message off as an agent reply. - The document watcher records which authenticated connection inserted each thread message (Yjs transaction origin). A client-inserted message whose author is not its writer, or which claims authorType "agent", delivers no mentions and is relabelled with its real writer, keeping the claim in `claimed`; the thread shows it as "unverified: posted as …". Server-written messages and messages stored before this change have no recorded writer and are trusted as before. - The watcher is re-attached before every client message, so a project reset (which dropped it from a still-loaded instance) can no longer let client writes go unobserved. - Agent-key sockets are read-only. Agents write …7b1084d -
Serve uploads with a sandboxing CSP; SVGs as downloads
Agent Manager +1: Claude Opus 5.5/files is same-origin and open to every signed-in user, so an uploaded SVG with a <script>, opened by its URL, ran that script with the viewer's session: it could read and write all their projects and mint an agent key in their name. Every upload is now served with Content-Security-Policy: default-src 'none'; img-src 'self' data:; style-src 'unsafe-inline'; sandbox X-Content-Type-Options: nosniff and SVGs additionally with Content-Disposition: attachment. <img> embedding (prose image nodes, share links, export) is unaffected. Tests: smoke checks the headers; browser.js uploads a scripted SVG as another user, checks it renders in the document and as an <img>, and that opening its URL directly downloads it and runs nothing; share-link.js checks a link visitor still sees a png and an svg figure. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>5966a28
-
Let a stopped built-in agent be started again, from the panel
The built-in agent is registered on disk but armed only in memory: the OAuth callback is the one place that calls startDefaultAgent, because the access token it needs is never written down. So any restart leaves the agent listed and dead, and nothing brings it back — the session cookie lasts 30 days, so the user stays signed in and is never sent through OAuth again. The panel showed a grey dot, identical to "an agent on someone's laptop isn't running right now", and the only cure was to guess at signing out and back in. Prod has been in exactly this state for nine days: one startup on 18 Aug (a deploy), after which @lvwerra-cowrite never polled once, while @qgallouedec-cowrite — signed in after that restart — ran tasks normally. GET /api/agents now marks the caller's OWN built-in agent needs_activation when no live worker holds a credential for them, and the row offers an Activate button: a plain link to /auth/login?next=<this page>, like the sign-in button, because a scripted top-le…5334551
-
A name on Object.prototype is not a document
Found on the running Space: GET /api/docs/constructor returns 200 for any signed-in user, as do toString, valueOf, hasOwnProperty and the rest. getRegistry() parses into a plain {}, so registry['toString'] is a truthy function and every "does this exist?" check passes. requireDocAccess is satisfied, and canAccessDoc then finds no createdBy on it and takes if (!meta.createdBy) return true // legacy docs created before ACLs which grants. The result is a phantom project at each of those names that EVERY signed-in user can read and write — a shared channel between accounts that nobody created and nobody owns. The Space is public, so an account is the only thing standing in front of it. DOC_ID_RE admits all twelve names; the stricter page-slug rule admits 'constructor', and pages are a slug-keyed map one level down with the same problem, as are agent handles (where these names were refused as "already registered by another user" — Object's constructor was the other user). Fixed wh…337ad70
-
Merge pull request #19 from huggingface/public-share-links
Leandro von WerraUnverified signatureAnyone with the link: read a project without an account7ef4ebf -
Never show the collaborator list to a link visitor who happens to be signed in
Found while rebasing onto #18/#21/#22 and re-checking what a link reaches. The snapshot gated the collaborator list on `req.user` — "is anyone signed in?". That was right when the share cookie only ever carried anonymous visitors. It stopped being right when this branch let the grant carry a SIGNED-IN stranger too: they have a req.user, so they were handed sharedWith for a project they are not on. The test is whether they could open the project anyway, not whether they have an account. public_link was already gated on being the creator and was never affected. Smoke now asserts it from the stranger's side: they read the text, get an empty shared_with and a null public_link, and cannot enumerate the project's agents. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>3a00d59 -
Keep origin_thread_id and anchor_kind in the tightened prompt
Agent Manager +1: Claude Opus 5The rebase onto agent-comments put the tightening on top of the origin-ID work, and the tightened text documented neither field. Both are live on this base: the server accepts origin_thread_id on /threads and /suggestions and delivers it plus anchor_kind on every mention. A prompt that never names them makes the capability unreachable — an agent cannot link what it writes back to the thread that asked for it, and reads a position anchor as the comment's subject rather than its location. The prompt contract test now asserts both, since presence of a field name in the server is not what makes it usable by an agent. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>c756f9b
-
Fix two prompt defects the presence test could not see
Both from review on #20, both real: 1. Every JSON example passed "as_agent": "@handle". agentIdentity compares that value against the BARE handle — with an agent key it reads as "this key belongs to someone else", and with an owner token it looks for a registered handle literally called "@handle". Every example in the prompt was a request that would be rejected. Introduced by the rewrite; the originals were bare. 2. The text said to pass mention_id exactly once, and then two examples carried it. An agent following the normal reply-plus-suggestion flow sent it twice. It now lives on the reply — the write an agent always makes — and the text says where to put it when there is no reply. The contract test checked that field names were present, which both defects survived. It now asserts the examples would actually run: the bare handle, and exactly one example closing the request. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>97ca254 -
Tighten the agent prompt: 10.6k chars down to 7.1k
The prompt is the entire interface an agent gets, and it had grown by accretion. The length rule was stated three times, keeping the long-poll alive took fifteen lines of prose, and the page-structure section carried three curl examples for one endpoint. Every fact survives; the repetition does not. Structure now follows what an agent actually does: wait, read, work, respond — then reference sections for markdown, images, embeds and pages, which are looked up rather than read top to bottom. Two things said better than before: - One suggestion per edit, scoped to the blocks it touches — not a whole section rewritten to fix two sentences. - Its own comments, one per point, each anchored to the block it is about, so a human can close them one at a time. What you want changed still belongs in a suggestion, not only in a comment. Also pins the contract: a smoke test asserts the rendered prompt still explains every endpoint an agent needs (stream, dismiss, reply, threads, suggestio…2c2546f -
Close four holes in the share link, from review
1. A signed-in visitor could not use a link. authenticate() only consulted the share cookie when nobody was signed in, so a session made `user` truthy and the ACL check then refused them — while REST let the same request through. The page loaded and never synced. The grant now applies whenever the visitor lacks access of their own, signed in or not, and boot says which case it is so the client shows the read-only view to a signed-in stranger too. 2. The token stopped living in the URL. /p/<token> now sets the cookie and redirects to /d/<id>: a rendered page left the credential in the address bar, in history, and — since documents carry external images and links — in the Referer header sent to whatever host those point at. Referrer-Policy: no-referrer is set for the whole app as well. 3. Revoking reaches sockets that are already open. A viewer authenticated before the token changed stayed attached and kept receiving edits, so "revoked" meant "no new vi…830cb4d -
Anyone with the link: read a project without an account
A second way to share, next to inviting people by username: one long unguessable URL that opens the project read-only, for someone who has no Hugging Face account and should not need one. The token (24 random bytes) is exchanged for a cookie the moment the visitor lands on /p/<token>, so nothing downstream has to carry it: the REST snapshot, the websocket handshake and the <img> requests are all covered by the same grant. Lookup is constant-time, and an unknown or revoked token is a 404 that does not confirm the project exists. Read-only is enforced where it counts. The connection is marked readOnly in onAuthenticate, so hocuspocus drops any update or awareness message the client sends: a visitor who types sees their own keystrokes and nothing else does. REST keeps requireUser everywhere except GET of the project and its page tree, so a link cannot suggest, comment, add a page, re-share or delete. The non-editable editor and the hidden buttons are a courtesy on top of that, not the m…3a73292 -
Make agent feedback standalone and traceable
Agent Manager26dfc7b
-
Merge pull request #18 from huggingface/agent-privacy
Leandro von WerraUnverified signatureAn agent you register is not shared with your collaboratorsb622b57
-
Close stdin for managed OpenCode runs
Agent Manager1126bdd -
Skip network discovery in managed OpenCode runs
Agent Manager2612d9d -
Skip OpenCode title generation in managed runs
Agent Manager4a68cda -
Make managed OpenCode startup deterministic
Agent Manager0d13486 -
Add safe diagnostics for managed agent runs
Agent Managerca40e67 -
Harden default agent isolation and capacity
Agent Manager889dff6 -
Add a private default agent for each user
Agent Manager314a59f -
An agent you register is not shared with your collaborators
Registering an agent stored no visibility flag, and every read treated a missing flag as shared: agentPresence() shared: info.shared !== false -> undefined means shared mention routing agents[h]?.shared !== false || ... -> undefined means shared So a handle was exposed the moment it was created: every collaborator on every doc you shared could see it in the agent list and @mention it into work. The toggle in the UI worked, but it defended a door that was already open — and the existing test set shared:false explicitly, so it never saw the default. Absent now means unshared, in both reads, and registration writes the flag down instead of leaving it to be inferred. Re-registering your own handle keeps the choice you made before. This matters because an agent is not a document permission: it runs on your machine, with your credentials, and does work in your name. Sharing it is a deliberate act — one click on the toggle that already exists. Behaviour change: existing hand…abaa17c -
Comment beside a paragraph, from a hover in the right margin
Claude +1: Claude Opus 5 (1M context)Hover the right third of the page and a small comment button appears out in the page's own right margin, level with the paragraph you are next to. Click it and you get a comment anchored to that place, with no selected span. The anchor is one Yjs relative position taken inside that paragraph — the same machinery the existing span comments use, written into both anchor fields so every path that already resolves a thread's anchors keeps working and simply sees an empty range. The card shows the paragraph's opening words as a locator instead of a quote, because there is nothing quoted; agents get anchor_kind + anchor_context so a null excerpt is not mistaken for deleted text. Deleting the paragraph never closes the thread. The zone is hover-only and invisible: no gutter, nothing while a selection or a composer owns the flow, and nothing at all on touch. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>f9ca812
-
A page-scoped websocket name could silence a project's @mentions
Pages became fields of one project document, but a page-scoped document name (`<id>::<slug>`) was still accepted on the websocket. Syncing one loaded a SECOND instance of the same project, and because watchers were keyed by project id, attaching its watcher took the observer off the instance every browser was editing. From then on @mentions in that project were never detected: the comment was stored and looked posted, but no chip, no queue entry, no agent — until the process restarted. - watchers are keyed by the document instance, so no instance can unhook another's observer (releaseWatcher still scopes to one project) - the websocket refuses a page-scoped name outright: it can only ever sync an isolated replica whose edits reach nobody - state loads under the project id, so a replica can't start from the pre-migration per-page row (frozen before every page added since) - only the canonical instance may persist, so a partial replica cannot write over what the real instance ho…ab8524b
-
Four fixes: agent subpages, the pending selection, overlapping marks, the star
AN AGENT'S SUBPAGE LANDED AT THE TOP LEVEL. Placement worked only for an exact ref — a page's slug, or a group's quoted path array. But an agent works from what it can see, and what it sees is a TITLE: sending "Research Notes" for the page research-notes, or 'Getting started' for the group '"Getting started"', was a 400, so a proposal made without placement went to the top level. Parents now resolve from a slug, a page title (any case), a group label with or without its quotes, or a one-element array holding any of those; parent_slug/parent_page/under work as field names. Exact refs still win before any guessing. The response and GET .../page-suggestions/:id both echo the resolved parent and index, so a caller can see its intent was understood, and an unknown parent is refused with the real page list attached. THE TEXT YOU WERE COMMENTING ON WENT UNMARKED. Focusing the composer moves focus out of the editor, which drops the browser's own selection highlight — so the words you had pick…63bc919 -
Download: this page or the project, as markdown or PDF
A Download button in the header opens two choices — how much (this page / whole project) and in what shape (markdown / PDF). MARKDOWN is a zip built server-side: one .md per page in sidebar order, plus an assets/ folder holding the images those pages use, with every /files/<hash> reference rewritten to its bundled copy. That rewrite is the point — a /files URL only resolves for someone signed in to this Space, so without it an exported document renders as broken images anywhere else. Project scope also carries structure.yaml, since the yaml IS the project's shape (order, nesting, group headers) and without it an unzipped project is a flat pile of files. An image whose bytes have gone missing is listed in assets/MISSING.txt rather than failing the whole export. The zip is written by server/zip.js, ~100 lines over node's zlib, rather than by adding a dependency: the Space builds with `npm ci`, which hard-fails on any package.json/package-lock disagreement, and this is not worth that ri…3b2fb14 -
Proposed pages live in the tree, where they would land
Three things, all about the page tree. AGENTS COULD NOT PROPOSE A PLACE. page-suggestions took a title and a body and nothing else, so an accepted page was appended at the top level wherever the agent meant it to go — and there was no way to say otherwise. Proposals now take the same {parent, index} refs /structure/move already uses: a page parent is its slug, a group parent is its path array, no parent means top level. The placement rides on the proposal, so accepting files the page there via moveNodesInYaml. An unknown parent is a 400 (it used to be accepted and quietly flattened), and the agent instructions in api.js document the field with examples. PROPOSALS SAT IN A LIST UNDERNEATH EVERYTHING. They were rendered after the tree and the unfiled section, under a "proposed" heading, which hid the one thing a reviewer wants to know: where is this page going? They are now grafted into the tree at their proposed position and rendered as ordinary rows — dashed, badged, still opening th…aeb6b2b
-
Left carets, home star, project subtitles, empty-group rename fix
Fold carets move to the left of the label (aligned spacer for leaf rows); the hover trash overlays the row end so long titles run to the edge. A muted star marks the home page. Renaming a group with no children no longer loses its input — every group-label single-click consequence now defers behind the same 280ms timer the double-click cancels. The home page's first paragraph becomes the project's subtitle (derived on store, persisted on the registry) and previews under each title in the project dropdown. Co-Authored-By: Codex <noreply@openai.com> Co-Authored-By: Claude Opus <noreply@anthropic.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>3f3e761 -
Dialog-free UI, project-name header, rl-wiki sidebar polish
The Space runs in an iframe where Chrome suppresses native dialogs, so confirm()/alert()/prompt() silently did nothing — deletes looked broken. All 33 call sites are gone: sidebar deletes/dissolves are now arm-to-confirm buttons with toasts for errors; everything else goes through new in-app uiConfirm/uiAlert/uiPrompt/uiToast helpers (common.js, keyboard-complete, dark-mode aware). The browser tests now fail on any native dialog. The top-left selector always shows the project name (tab becomes 'page · project'), server-rendered too, live while renaming home. Sidebar: exact rl-wiki type scale and row treatments, search replaces the 'Pages' heading, trash sits at the far right of rows, and the bar is a seamless full-height surface — page background, no right border, reaching the writing sheet. treedrag no longer arms drags from buttons/inputs, so control clicks can't be swallowed. Co-Authored-By: Codex <noreply@openai.com> Co-Authored-By: Claude Opus <noreply@anthropic.com> Co-Authore…d3283b8 -
Multi-node structure moves, H1 page rename, untitled pages
structure/move accepts nodes: [refs] — a multi-selected block lands as consecutive siblings in document order, nested selections collapse into their selected ancestor. New pages/:slug/rename rewrites the page's first heading (the H1 is the title everywhere); renaming home renames the project. POST /pages with an empty title creates an untitled page with an empty H1 for the sidebar's no-modal create flow. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>86725f7 -
Add sidebar group headers and structure move endpoints
Structure YAML gains quoted group lines (- "Label":) — purely visual sidebar separators. New human-only endpoints implement drag-and-drop as minimal line edits to the same YAML: structure/move, structure/groups (create/rename/dissolve). Unit tests for the pure mutators, smoke test for the endpoints. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>e5167b8 -
Unify project pages in one Yjs document
9b49194 -
Prevent duplicate and stale suggestions
a5757a3 -
A link you can click, and a page body that is never dropped
Two reports, both about a thing that looked like it worked. CLICKING A CROSS-REFERENCE DID NOTHING. In an editor a plain click has to place the caret — you must be able to edit the words a link is made of — so following a link needed ctrl/cmd+click, and nothing on screen said so. There was no bubble on click either (#link-pop is the toolbar's URL input and needs a selection), so a plain click produced no navigation and no feedback at all. A plain click now raises a small bubble anchored to the link: the target named as a page title for internal links, an Open button, and Remove link. ctrl/cmd+click and tap-to-follow are unchanged. handleClick and the bubble now share one followLink(). A PAGE BODY SENT UNDER THE WRONG FIELD NAME VANISHED. page-suggestions read content_markdown and nothing else, so an agent that sent "markdown" got a 200, an empty proposal, and no way to know why (reported: "both pages arrived title-only"). Bodies are now read through pickMarkdown() — the canonical nam…fbcd415 -
Recover agent polling after interruptions (#10)
- Recover agent polling after interruptions (761a8ef83308ff0cd6cc5c65455b3d7293af8f99) Co-authored-by: Thomas Wolf <thomwolf@users.noreply.huggingface.co>b923e1a
-
Make agent prompt work with private Spaces (#5)
- Make agent prompt work with private Spaces (2e7c12d9f71d6fbfbb16243dfc3254f58597d954) Co-authored-by: Thomas Wolf <thomwolf@users.noreply.huggingface.co>14b5d7c
-
One page: the document is the app, and a switcher replaces the index (#4)
- One page: the document is the app, and a switcher replaces the index (ac3feac1b80222a90bc8cc12bc15c89ae775c5aa) Co-authored-by: Thomas Wolf <thomwolf@users.noreply.huggingface.co>f35d3f6 -
Inline markdown nests: parse code/links/math/emphasis inside bold, italic, strike and links; serialize marks in a round-trippable order
Verified signature40eb19e
-
LaTeX math via lazily-loaded KaTeX ($x$ inline, $$...$$ display), agent-proposable; Enter sends a comment, Shift+Enter adds a line
Verified signature735a30f
-
Faster loads: brotli bundles, immutable asset caching, self-hosted font, session+title inlined in the shell, loading skeletons
Verified signatureec6b346
-
Upload folder using huggingface_hub
Verified signatureed7ee81 -
Upload folder using huggingface_hub
Verified signature93ef16f
-
Upload folder using huggingface_hub
Verified signature5d70e55
-
Upload server/playground.js with huggingface_hub
Verified signature363fbdc -
Upload folder using huggingface_hub
Verified signature80e566e
-
Upload server/collab.js with huggingface_hub
Verified signature939d27c -
Upload folder using huggingface_hub
Verified signature7efcba7