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
//! # omgbase-surface
//!
//! The omgbase surface, Rust implementation of `spec/surface`: the OQX
//! **query binding** over [`omgbase_store::Store`] ([`context`], [`mod@query`],
//! the tier-3 pushdown [`planner`] and its [`translate`] seam),
//! the document and block **reads** ([`read`]), the **history** reads
//! ([`history`]), link health ([`links`]), the `graph` macro ([`graph`]), and
//! the **MCP tool catalog** as a library ([`catalog`]): a table of tools with
//! JSON-schema inputs and handlers dispatching into the store, with the
//! error envelope of ยง4. Transport-agnostic โ the `omgbase` binary serves
//! [`catalog::Surface`] over MCP stdio.
//!
//! ```
//! use omgbase_store::Store;
//! use omgbase_surface::catalog::Surface;
//! use serde_json::json;
//!
//! let mut store = Store::open_in_memory()?;
//! let repo = store.create_repo("notes")?;
//! let mut surface = Surface::new(store, &repo, None);
//! let out = surface.call("observe", json!({ "path": "a.md", "content": "# Title\n\nFirst.\n" }));
//! assert!(!out.is_error);
//! let res = surface.call("query", json!({ "query": "select $title from docs" }));
//! assert_eq!(res.body["hits"][0]["$title"], "Title");
//! # Ok::<(), omgbase_store::Error>(())
//! ```
// The error envelope carries a code, a message and an optional JSON `data`
// (~128 bytes); every failure is a cold path at the tool boundary, so the
// `Result` size is not worth boxing.
pub use ;
pub use ;
pub use ;
pub use ;
pub use SqlitePlanner;
pub use ;
/// The `spec/surface/VERSION` this crate implements (`major.minor`).
pub const SPEC_VERSION: &str = "1.3";