AGENTS.md

This is a Go library that provides CGo FFI bindings to the Rust y-crdt library, which implements methods for working with a Yjs CRDT. The y-crdt FFI bindings are located in the git submodule at y-crdt/yffi.

This is also a client library for interacting with a jamsocket/y-sweet server to sync changes between Yjs-based CRDTs on different clients. It implements the y-protocols for broadcasting changes and applying updates via websocket.

Development

When working on any feature in this repository, directly consult the source. For bindings to the y-crdt via FFI, inspect the Rust source in the y-crdt/yffi folder to ensure that the Go bindings work well with the Rust library.

Reference code for Yjs and the y-sweet server can be found under ref/. If the source does not already exist under ref/y-sweet, git clone the source for the y-sweet server from https://github.com/jamsocket/y-sweet under the ref folder. Always inspect the Rust source to ensure compatibility between the Go client and the Rust y-sweet server.

You should also git clone the source for the Yjs library and inspect its Javascript source when working on compatibility issues with the JS version of the library. It is located at https://github.com/yjs/yjs and should be cloned to ref/yjs if it does not already exist.

Breaking Changes

This is a pre-release library in active development. There are no tagged releases so no changes are considered breaking. Modify the API as necessary without considering deprecation of existing APIs.

Source Control

Do not use any git or jj commands. Source control is handled separately by a human.