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
62
63
//! # Tokenectomy 🕵️♂️
//!
//! **Autonomous Machine-to-Machine (M2M) Model Context Protocol (MCP) server and context surgery engine for AI coding agents.**
//!
//! Designed specifically for autonomous coding assistants (**Claude Desktop**, **Cursor**, **Cline**, **Roo Code**, **Windsurf**, and **Google Antigravity**),
//! Tokenectomy operates silently as a background sidecar. It intercepts noisy framework errors, strips 90%+ of internal runtime frames
//! (`node_modules`, `site-packages`, `.cargo/registry`), and auto-redacts sensitive credentials (JWTs, database URLs, API keys) before prompt transmission.
//!
//! ## Key Capabilities for AI Coding Agents
//! - **Log Surgery**: Reduces massive 38K token error dumps down to <2K tokens, preserving only user-written code.
//! - **Secret Redaction**: Employs compiled, ReDoS-safe linear-time regexes (`LazyLock`) to strip credentials locally before cloud transmission.
//! - **Local Response Cache**: SHA-256 error fingerprinting with a 24-hour local TTL so identical CI/CD errors cost $0.00 in LLM API calls.
//! - **M2M MCP Stdio Protocol**: Full JSON-RPC 2.0 stdio interface exposing `get_error_context`, `search_stack_overflow`, and `apply_code_patch`.
//!
//! ## Quick Library Example
//! ```rust
//! use tokenectomy::redact::redact_secrets;
//!
//! let raw_log = "Error connecting with DATABASE_URL=postgres://user:secret@localhost:5432/db";
//! let sanitized = redact_secrets(raw_log);
//! assert!(sanitized.contains("[CONNECTION_STRING_REDACTED]"));
//! ```
pub use craterun_cli;
pub use crateControlPlaneEnvelope;
/// Immutable Author identity baked into .rodata segment
pub const AUTHOR_NAME: &str = "Daffa (@daffa2555)";
/// Immutable Organization / Vendor identity
pub const VENDOR_NAME: &str = "Tokenectomy Labs";
/// Immutable Official Project Repository
pub const REPOSITORY_URL: &str = "https://github.com/Tokenectomy-Labs/Tokenectomy";
/// Immutable Cryptographic / Architectural Engine Signature
pub const ENGINE_SIGNATURE: &str = "Tokenectomy Razor Engine © Daffa • Tokenectomy Labs";