1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// SPDX-FileCopyrightText: 2026 Andrei G <bug-ops>
// SPDX-License-Identifier: MIT OR Apache-2.0
//! Construction helpers for the deprecated rmcp Roots types (SEP-2577).
//!
//! `rmcp::model::Root` and `rmcp::model::ListRootsResult` are `#[deprecated]` as of rmcp
//! 2.0.0 — the MCP Roots capability is slated for removal per
//! [SEP-2577](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2577),
//! not expected to finalize before 2026-07-28. Until then the types remain fully
//! functional and zeph continues to advertise static filesystem roots to MCP servers.
//!
//! This module is the single `#[allow(deprecated)]` boundary for *constructing* these
//! values — callers elsewhere never need to name `Root`/`ListRootsResult` to build one,
//! which keeps the deprecated surface auditable from one place instead of scattered
//! `#[allow(deprecated)]` attributes. Positions that must still name the deprecated types
//! directly (struct fields, function signatures, the `ClientHandler::list_roots` trait
//! return type) carry their own narrowly-scoped `#[allow(deprecated)]`, since the
//! deprecated path appears in rmcp's own trait signature and cannot be hidden by a wrapper.
use ;
/// Build a filesystem root advertised to an MCP server via `roots/list`.
///
/// # Examples
///
/// ```
/// # #![allow(deprecated)]
/// use zeph_mcp::roots::make_root;
///
/// let root = make_root("file:///workspace", Some("workspace"));
/// assert_eq!(root.uri, "file:///workspace");
/// assert_eq!(root.name.as_deref(), Some("workspace"));
///
/// let unnamed = make_root("file:///tmp", None::<&str>);
/// assert_eq!(unnamed.name, None);
/// ```
/// Build a `roots/list` response from a list of roots.
///
/// # Examples
///
/// ```
/// # #![allow(deprecated)]
/// use zeph_mcp::roots::{make_list_roots, make_root};
///
/// let result = make_list_roots(vec![make_root("file:///workspace", None::<&str>)]);
/// assert_eq!(result.roots.len(), 1);
/// ```