Cotton code
36 lines · 1.7 KB · RustRaw
//! The OWNER-SCOPE tools — the verbs the owner's own app may call and an//! assistant may not.//!//! [`crate::mcp::protocol::McpScope::Owner`] is the third scope and it is not//! grantable: no token carries the word, so these tools are absent from every//! `tools/list` and refused at every dispatch except//! [`crate::mcp::dispatch::Ctx::phone`]'s. The reason is the same for both of//! them and it is written into each description, because the description IS the//! model-facing API: each one settles a question the person has just been//! ASKED, and an assistant answering its own question is the failure mode.//!//! They are ordinary handlers otherwise — same `Ctx`, same writer, same ops,//! same outbox on a device. Nothing here needs a rail, which is the point: a//! tool the phone cannot run when it is offline would be a tool the owner//! cannot reach on a train.use crate::mcp::dispatch::HandlerGroup;pub mod restore;pub mod work;pub fn handlers() -> HandlerGroup {    &[        // Going back over a record's history is the person's act (`restore`).        ("restore_version", restore::restore_version),        // ── 4f, the owner's own verbs over sessions and links, in [`work`].        ("move_session", work::move_session),        ("rename_session", work::rename_session),        // The GENERIC edge, which `link_to_project` / `unlink_from_project` are        // the project-shaped siblings of. It is here because the callers are the        // owner's own screens: "Save as note" and "Save as todo" write an        // ordinary record and then say where it came from, and nothing else in        // the file remembers.        ("create_link", work::create_link),    ]}