With this, your mind can let its members write the same document together and keep the result as a file in git. There is no separate knowledge base to reconcile later: the sidebar is a repository’s file tree, and editing changes that repository. In the config repository that can publish the mind itself, which is why the member boundary matters.
Wire existing editor parts to the repo
apps/docs/public/app.js uses the UI kit’s DocEditor, DocTree, DocListPanel and DocSession. It chooses the repo and file from ?repo=<name>&doc=<path> in the URL, reads the initial text, and opens a live editing session. With no file selected it lists documents and offers a new one. ?mode=comment offers a comment-oriented view, not an authorization mechanism: every viewer is still a member with the mind’s normal rights.
case "docs":
return docs.open?.(request) ||
this.auth.require(request) || docs.fetch(request, this);
// In the guarded host:
if (url.pathname === "/itx") return host.auth.itx(request);
The page reaches the mind through a same-host WebSocket authenticated by the platform. apps/docs/app.ts serves the files and a /processors.json answer containing the processors module path and a hash of its source. The processors live in apps/docs/processors/: root and document folding, collaborative frames, anchoring, merging and comments, exported through classes.ts. Hashing the processor source gives an editing session a versioned implementation. An unrelated content commit should not restart all processors.
Commits are the storage contract
Live collaboration produces durable document events and saves the resulting text as repo commits. That gives ordinary git history instead of an opaque editor database as the only record. Preserve the editor’s merge and anchor logic; replacing it with last-write-wins autosave would lose simultaneous edits or detach comments. The UI should explain when a file cannot be edited, including missing dependencies or non-text content, rather than silently switching storage systems.
Rebuilding without opening the repo to visitors
The host, HTML, public assets and processor folder are the implementation unit; the UI kit and the collaborative-editor packages listed in the local package manifest are its dependencies. The processor packages are yjs, diff and node-diff3; their pinned versions join the source hash in the processor cache key. Use the pinned versions together and test two concurrent member tabs, comments, reloads, merges and a save after the repo tip moved. The editor’s shared stylesheet comes from the same tested UI-kit pin, including narrow-screen layout behavior. Verify long comment links, presence labels and mode controls on phones as well as desktop; removed local CSS workarounds are not a reason to stop testing wrapping. No external service account is required merely to edit the mind’s repos. Keep the socket and every processor action behind member authentication; publicly serving a manifest or icon must not accidentally include repository files. The Dash offers the wider repo view, while the blog deliberately publishes only reviewed descriptions rather than these private documents.