menger_notes/lib.rs
1//! V2-29: **the notes service** — notes on their own API and in a file
2//! of their own, as a service of v2's own beside `tickets`, `ui` and
3//! `media` (V2-1: services that coexist, each reaching the others as a
4//! client through the seam). The owner, 2026-11-02: *"I would like us to
5//! move the docs onto a new docs api. same fe though."*
6//!
7//! A **note** is writing, not work: an id (8 characters of Crockford's
8//! base32, TICKETS-35's form), the organization it is in, a title, a
9//! markdown body, who made it and who wrote it last. The body is a Yjs CRDT
10//! (V2-29's `pairing`, the owner: *"live co editting"*): every hand's change
11//! is an update merged by the service and streamed to everyone on the
12//! note, who is on it is said as they come and go, every change is kept
13//! with who and when (replayed, squashed by permission), and the markdown is
14//! derived from it. The editor's surface (`#/note/<id>`) writes to it.
15//!
16//! **Who may** is the gate's: a viewer reads, an editor writes, an admin
17//! deletes, on the note's organization (`acme:`) or on `*` — the
18//! method's grant asked of the running service's gate on that scope
19//! ([`Seam::holds`]); the organizations a caller is in are the tickets
20//! service's word (`orgs.list`, over the seam). This service never opens
21//! another's file.
22//!
23//! | module | what |
24//! |---|---|
25//! | [`vocab`] | the typed parameters: [`NoteId`], [`NoteTitle`], [`NoteBody`], [`NoteQuery`]; the id's minting |
26//! | [`events`] | [`Note`], [`HistoryRow`], [`Present`], [`NotesEvent`] |
27//! | [`store`] | the file: `docs` and `doc_log`; get, list, rename, delete; the channel |
28//! | [`crdt`] | the body, a Yjs CRDT: create, update, save (a diff merged), state, replay, history, squash, restore |
29//! | [`presence`] | who is on a note: entries held by a watch, idling out |
30//! | [`threads`] | V2-30: questions on a range, anchored in the CRDT, and their answers |
31//! | [`slot`] | NOTES-4: a note's slot — the component drawn beside it, its props, its fills, the build under way |
32//! | [`marks`] | NOTES-5: marks on a range — an underline, a link, a line of state — anchored as a question is, never writing the text |
33//! | [`quota`] | the meter every write is reserved against (always allows until V2-31) |
34//! | [`seam`] | the gate and `orgs.list` through the running service; [`seam::may`] for a client |
35//! | [`activation`] | the methods, the one declaration |
36
37pub mod vocab;
38pub use vocab::{AgentName, BuildStep, ComponentName, SlotProps, SlotSay, VersionRef, NoteAwareness, NoteBody, NoteId, NoteQuery, NoteSession, NoteTitle, NoteUpdate, NoteVector, ThreadId, ThreadText, MarkId, MarkLabel, MarkLink};
39pub mod events;
40pub use events::{Anchor, Author, Building, Fill, Note, NotesEvent, HistoryRow, Present, Reply, Resolution, Slot, Thread, WatchEnd, Mark};
41pub mod store;
42pub use store::{Change, NotesStore, StoreError};
43pub mod crdt;
44pub mod presence;
45pub mod quota;
46pub mod threads;
47pub mod slot;
48mod slot_calls;
49pub mod marks;
50mod caller;
51pub use caller::{Caller, NotesRequest};
52pub mod seam;
53pub use seam::{Components, Held, Seam};
54pub mod activation;
55pub use activation::{NotesActivation, NotesClient};
56mod streams;
57mod watch;
58
59/// The service's file when `--notes-db-path` names none: `notes.db` beside
60/// the tickets file, never the same file.
61pub const NOTES_DB_FILE: &str = "notes.db";