Cotton code
71 lines · 3.1 KB · RustRaw
//! `records`, part 1 — todos, events, notes and the journal, goals, people//! and places.//!//! `packages/server/src/mcp/records.ts` is 7,647 lines and holds far more than//! one primitive; it is split across two Rust modules so two agents could port//! it in parallel. This half is the RECORD kinds a person edits by hand. Part 2//! is the reading surface — search, the agenda, memory, sessions, meetings,//! messages and the money reads.//!//! `mod.rs` is the group's one export: the tool table `dispatch` registers.pub mod engine_shim;pub mod events;pub mod note_tags;pub mod notes;pub mod people;pub mod person_handles;pub mod todos;pub mod validate;use crate::mcp::dispatch::HandlerGroup;/// The tools this group implements, in the order the TypeScript's dispatch/// names them.pub fn handlers() -> HandlerGroup {    &[        ("create_todo", todos::create_todo),        ("complete_todo", todos::complete_todo),        ("list_todos", todos::list_todos),        ("update_todo", todos::update_todo),        ("update_todos", todos::update_todos),        ("list_events", events::list_events),        ("create_event", events::create_event),        ("update_event", events::update_event),        ("update_events", events::update_events),        ("delete_event", events::delete_event),        ("delete_events", events::delete_events),        ("create_note", notes::create_note),        ("update_note", notes::update_note),        ("archive_note", notes::archive_note),        ("unarchive_note", notes::unarchive_note),        ("append_journal", notes::append_journal),        ("upsert_managed_note", notes::upsert_managed_note),        ("list_managed_notes", notes::list_managed_notes),        ("create_person", people::create_person),        ("update_person", people::update_person),        ("list_people", people::list_people),        ("merge_people", people::merge_people),        ("archive_person", people::archive_person),        ("unarchive_person", people::unarchive_person),        // 4e — the OWNER-SCOPE verbs of these same kinds. Filed with the kind        // they belong to rather than in a group of their own, because        // "answering an invitation", "taking a place off the map", "dragging a        // goal" and "erasing a goal" are that kind's verbs; the only thing they        // have in common is WHO may call them, and that is declared once, in        // the catalogue's `scope`.        ("respond_to_invite", events::respond_to_invite),        // 4e's review round: two more of the same kind. Restoring the event        // editor's guest list and the contacts import's identity spine each        // needed a verb the catalogue did not have, and both are the owner's        // own act by the same reading — inviting somebody is a commitment made        // in a person's own name, and an address book is on the owner's phone        // where no assistant can read it.        ("update_attendees", events::update_attendees),        ("sync_device_contacts", people::sync_device_contacts),    ]}#[cfg(test)]#[path = "mod_tests.rs"]mod tests;