@skaile/connector-yjs
v0.1.1
Published
Yjs CRDT connector for @skaile/workspaces
Readme
@skaile/connector-yjs
A Yjs CRDT connector for
@skaile/workspaces. It
exposes a CRDT-backed shared document to the agent through the connector tool
face: real-time collaborative state that merges concurrent edits from multiple
agents and UI clients.
This connector ships separately so the core runtime no longer bundles yjs.
Install it as a plugin when you need shared CRDT state.
Install
skaile plugin install @skaile/connector-yjsAdd it to skaile.yaml:
plugins:
- "@skaile/connector-yjs@^0.1.0"
connectors:
- id: shared-doc
driver: yjs
access: read-write
options:
initial:
theme: dark
version: "1.0.0"Config / auth
No authentication. The document lives in-process.
| Field | Where | Notes |
|---|---|---|
| initial | options.initial | Optional object of initial key/value pairs seeded into the root map. |
Use getDoc(handle) to obtain the underlying Y.Doc for external provider
wiring (Hocuspocus, y-websocket).
Operations
| Operation | Access | Description |
|---|---|---|
| snapshot | read | Get full document snapshot |
| get | read | Get a single value by key |
| keys | read | List all keys |
| history | read | Get operation history |
| set | write | Set a key (CRDT merge) |
| merge | write | Merge an object into the document |
| del | write | Delete a key |
How it works
- Lazily imports
yjsat connect time, so the dependency is only loaded when a Yjs connector is actually used. - Registers a
yjsconnector target into the unifiedpluginRegistryvia the exportedregister(registry).
