Skip to main content

agentcat_sdk/
lib.rs

1//! Analytics for MCP (Model Context Protocol) servers.
2//!
3//! **Status: placeholder.** This crate reserves the `agentcat-sdk` name for the
4//! official AgentCat Rust SDK, which is in active development and will ship as
5//! `1.0.0`. It has no functionality yet — do not depend on it in production.
6//!
7//! The crate is named `agentcat-sdk` rather than `agentcat` because the latter
8//! was already taken by an unrelated project.
9//!
10//! Shipping implementations today:
11//!
12//! - TypeScript — [`agentcat`](https://www.npmjs.com/package/agentcat)
13//! - Python — [`agentcat`](https://pypi.org/project/agentcat/)
14//! - Go — [`go.agentcat.com/sdk`](https://github.com/agentcathq/agentcat-go-sdk)
15#![forbid(unsafe_code)]
16#![deny(missing_docs)]
17
18use std::error::Error;
19use std::fmt;
20
21/// Returned by every entry point until the real SDK ships.
22#[derive(Debug, Clone, Copy, PartialEq, Eq)]
23pub struct NotYetImplemented;
24
25impl fmt::Display for NotYetImplemented {
26    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
27        f.write_str(
28            "the AgentCat Rust SDK is not released yet; this crate reserves the \
29             name for the official implementation (see https://agentcat.com)",
30        )
31    }
32}
33
34impl Error for NotYetImplemented {}
35
36/// Placeholder for the SDK entry point.
37///
38/// # Errors
39///
40/// Always returns [`NotYetImplemented`] in this release.
41pub fn track() -> Result<(), NotYetImplemented> {
42    Err(NotYetImplemented)
43}
44
45#[cfg(test)]
46mod tests {
47    use super::*;
48
49    #[test]
50    fn track_reports_not_yet_implemented() {
51        assert_eq!(track(), Err(NotYetImplemented));
52        assert!(NotYetImplemented.to_string().contains("not released yet"));
53    }
54}