npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@agent-factory-platform/docs-react

v0.18.1

Published

Product-neutral rich document editor and repository bindings.

Readme

@agent-factory-platform/docs-react

Product-neutral rich document editor and repository bindings.

Install

npm install @agent-factory-platform/docs-react

Use the exact Agent Factory version across packages in one application.

Scope

Owns the rich-document editor, durable JSON serialization, transient image projection, and the shared CAS autosave coordinator. Storage, authentication and provider credentials belong to the consuming product; the editor does not upload directly to a cloud account.

Import the public styles before generating the application's Tailwind utilities, so component utility defaults cannot override application responsive variants:

@layer theme, base, components, utilities;
@import "@agent-factory-platform/docs-react/styles.css";
@import "tailwindcss";
@import "@agent-factory-platform/ui-kit/styles.css";

Render RichDocument with value, editable, placeholder, ariaLabel, and onChange. Save the emitted RichDocumentContent through the Docs client with the expected revision, retaining the local draft on conflict.

For images, onImageUpload(file) is a product callback: complete the Docs asset lifecycle and return { assetId, url } with a short-lived view URL. Supply resolveImage(assetId) to resolve existing revision-bound assets and refresh their URLs; return { url, expiresAt }. The callback closes over the authorized revision context. URL refreshes do not invoke autosave; only Asset IDs persist. Products without a signed object provider should omit image upload rather than return permanent or credential-bearing URLs.

Document Assistant uses the existing Agent session and v2 durable payloads. When supplying assistant, also supply onAssistantCommit so apply/rollback is committed with revision CAS before it is presented as saved.

DocsWorkbenchController and DocsWorkbench compose Space/tree/trash, revision, ACL/invite, indexing, translation and publication management around the generated Docs client. PublishedDocs renders only immutable anonymous release projections. Navigation generations fence late autosave responses so an old document cannot overwrite or reopen the current selection. Product routes, CDN and domains remain in the host.

DocsCollaborationController and DocsCollaboration open, follow, push and catch up durable opaque CRDT updates through browser-compatible unary/server-streaming RPCs. Presence stays transient while its latest shared snapshot supports cross-replica delivery. Capped exponential reconnect continues until explicit disconnect, authorization revocation or a permanent RPC rejection and uses the durable server sequence. The adapter coalesces offline Yjs transactions into update-sized chunks and replays each unacknowledged chunk with the same clock and bytes. Catch-up and live updates advance only as one contiguous sequence. Each editor instance keeps a distinct, reconnect-stable clock namespace scoped by the authenticated subject. The service replaces caller-supplied awareness client IDs and clocks, while the adapter renders names from authenticated presence metadata. YjsDocsCollaborationAdapter binds that transport to a Y.Doc and Yjs awareness; pass adapter.editorCollaboration to RichDocument to render remote selections and carets. checkpoint(expectedRevision, persist) first drains durable updates and gives persist both the document revision and collaboration sequence. Forward both to SaveRevision; the service atomically rejects either stale token. Pending edits remain queued across transient failures; explicit disconnect makes flush and checkpoint fail until that adapter reconnects. Use disconnect for a temporary React unmount and destroy only when the editor session is finished.

DocsAutosaveController debounces a host-supplied CAS persist callback, serializes checkpoints, and immediately follows an in-flight save when newer edits exist. It retains dirty state across offline and failed saves, exposes retry and observable dirty/saving/saved/offline/error/denied states, and only carries a server-returned updatedAt value into the saved snapshot.

One collaboration update is limited to 65,536 bytes. An oversized local Yjs update fails flush/checkpoint without sending partial state, keeps the local document, and can recover after the document is reduced below the limit. Invalid input and clock conflicts are terminal for the current connection instead of reconnecting forever.

Documentation

API and package documentation: https://www.npmjs.com/package/@agent-factory-platform/docs-react

Reconnect preserves rejected oversized state: checkpoint remains blocked until the local document can be reconstructed from acknowledged updates. Retried updates keep their original clock and bytes; later edits cannot merge into an assigned clock. Native Yjs Awareness renews idle presence approximately every 15 seconds. The shared repository expires it after 30 seconds without a client update; reconnect preserves edit authorization and the editor's durable clock namespace.

Resource permissions and bounded lists

getResourcePermissions({ spaceId }) or { resource: { target: { case: "nodeId", value: nodeId } } } returns current caller presentation hints. write edits the resource (Space metadata requires ownership); writeTree permits structural commands; manage manages that resource's grants; manageSpace manages Space metadata/archive; leave permits leaving the containing Space. Node grants do not imply Space management. All writes still authorize on the server.

The controller keeps spacePermissions and nodePermissions; refresh/open rechecks them. Authorization or request failures clear hints. Content does not depend on owner-only management endpoints; managementError reports their failure independently. Hosts should refresh after ACL changes and on focus.

Lists load 50 items per request. Inspect nextPageTokens[list] and call loadMore(list) for spaces, nodes (root children), documents, trash, revisions, acl, or invites. The reference view exposes continuation buttons. An absent token is exhausted; account/navigation changes discard late responses.

Supply resolvePublishedAsset to PublishedDocsController for public images. The controller pins the loaded release version, node, and revision; Factory signs only an asset in that immutable projection. Unsaved uploads can use local Blob previews; authenticated resolveAsset requires a saved revision reference.