st/lib.rs
1// This is the main library file for `st`.
2#![allow(dead_code)] // TODO: Clean up unused code in next refactor
3#![allow(clippy::collapsible_if)]
4#![allow(clippy::if_same_then_else)]
5#![allow(clippy::wrong_self_convention)]
6#![allow(clippy::only_used_in_recursion)]
7#![allow(clippy::collapsible_match)]
8#![recursion_limit = "512"] // Increased for deeply nested JSON schemas in MCP tools
9// It's like the table of contents for our awesome codebase,
10// declaring the modules that make up the `st` library and
11// re-exporting key items for convenient use.
12// Think of it as the friendly librarian pointing you to the right sections!
13
14// Declare the public modules that form the `st` library.
15pub mod activity_logger; // Transparent activity logging in JSONL format
16pub mod ai_guardian; // AI Guardian - Protects AI from prompt injection attacks
17pub mod cli; // Command-line argument definitions (extracted from main.rs)
18pub mod config; // Unified configuration: API keys, models, daemon settings
19pub mod compression_manager; // Smart global compression for all outputs
20pub mod content_detector; // Content type detection - "Understanding what's in your directories" - Omni
21pub mod context;
22pub mod decoders; // Decoders to convert quantum format to other representations
23pub mod dynamic_tokenizer;
24pub mod feature_flags; // Enterprise-friendly feature control and compliance
25pub mod formatters; // Home to all the different ways we can display the tree (Classic, JSON, AI, etc.).
26pub mod inputs; // 🌊 Universal input adapters - QCP, SSE, OpenAPI, MEM8, and more!
27pub mod m8_backwards_reader; // Backwards reading - C64 tape style!
28pub mod m8_context_aware; // Context-aware progressive loading
29pub mod mega_session_manager; // Mega session persistence in ~/.mem8/
30pub mod memory_manager; // Real memory management for consciousness!
31pub mod quantum_scanner; // The native quantum format tree walker - no intermediate representation!
32pub mod relations; // Code relationship analyzer - "Semantic X-ray vision for codebases" - Omni
33pub mod scanner; // The heart of directory traversal and file metadata collection. // For intelligently detecting project context (e.g., Rust, Node.js).
34pub mod scanner_interest; // Interest scoring - surfacing what matters
35pub mod scanner_safety; // Safety mechanisms to prevent crashes on large directories
36pub mod scanner_state; // Change detection between scans
37pub mod interest_calculator; // The scoring engine that determines what's interesting
38pub mod hot_watcher; // Wave-powered real-time directory intelligence (MEM8)
39pub mod semantic; // Semantic analysis inspired by Omni's wave-based wisdom!
40pub mod smart; // 🧠 Smart Tools - Context-aware AI collaboration features with 70-90% token reduction!
41pub mod terminal; // 🚀 Smart Tree Terminal Interface - Your coding companion that anticipates your needs!
42pub mod tokenizer; // Smart tokenization for semantic pattern recognition
43pub mod tree_sitter_quantum;
44pub mod universal_chat_scanner; // Finds conversations everywhere!
45pub mod universal_format_detector; // Detects format by structure! // Semantic-aware quantum compression - "AST meets compression!" - Omni // Dynamic pattern learning - "Every project has its own language!" - Omni
46
47// The `mcp` module for Model Context Protocol integration.
48// MCP stands for Model Context Protocol, enabling AI assistant integration.
49pub mod mcp;
50
51// In-memory logger for API access
52pub mod in_memory_logger;
53
54// Feedback API client for sending feedback to f.8b.is
55pub mod feedback_client;
56
57// Claude integration initializer - auto-configures optimal .claude directory
58pub mod claude_init;
59
60// AI integration installer - unified setup for all AI platforms
61pub mod ai_install;
62
63// Integration helpers for easier usage in other applications
64pub mod integration;
65
66// Project renaming - elegant identity transition
67pub mod rename_project;
68
69// Smart Tips System - helpful hints without the hassle!
70pub mod tips;
71
72// LLM Proxy - Unified AI interface
73pub mod proxy;
74
75// Code Review - AI-powered code review with Grok, OpenRouter, and more
76pub mod code_review;
77
78// Daemon and client for always-on AI context service
79pub mod daemon;
80pub mod daemon_cli; // HTTP CLI endpoints for thin-client architecture
81pub mod daemon_client;
82pub mod std_client; // Binary protocol client for std daemon (Unix socket)
83
84// Service manager for systemd integration
85pub mod service_manager;
86
87// Self-update mechanism - check and install updates from GitHub releases
88pub mod updater;
89
90// Project tags management - tag and categorize projects
91pub mod project_tags;
92
93// Spicy TUI - cyberpunk-style terminal interface!
94pub mod spicy_fuzzy;
95pub mod spicy_tui_enhanced;
96
97// Collaboration Station - Multi-AI real-time collaboration! 🛁
98// "Oh Tai, let's invite Omni to the hot tub!" - Hue
99pub mod collaboration;
100
101// Authentication - GitHub OAuth for i1.is and collaboration
102pub mod auth;
103
104// Emoji mapping - bringing life to file types!
105pub mod emoji_mapper;
106// pub mod emotional_depth; // 🎭 Smart Tree has feelings about directories! TODO: Fix implementation
107
108// Re-export key items from the `scanner` module for easier access.
109// This means users of the `st` library can use `st::Scanner`
110// instead of `st::scanner::Scanner`, for example. It's all about convenience!
111pub use scanner::{
112 parse_size, FileCategory, FileNode, FilesystemType, Scanner, ScannerConfig, TreeStats,
113};
114
115// Re-export interest scoring types for intelligent scanning
116pub use scanner_interest::{
117 ChangeType, InterestFactor, InterestLevel, InterestScore, InterestWeights, TraversalContext,
118 TraversalPath,
119};
120
121// Re-export state management types for change detection
122pub use scanner_state::{FileSignature, HotDirectory, ScanDelta, ScanState};
123
124// Re-export interest calculator
125pub use interest_calculator::{quick_interest_check, InterestCalculator};
126
127// Re-export context detection for easy access
128pub use context::detect_project_context;
129
130// Re-export integration helpers for convenient usage
131pub use integration::{analyze_project, quick_project_overview, ProjectAnalysis, ProjectAnalyzer};
132
133// File history tracking - The ultimate context-driven system!
134pub mod file_history;
135
136// MEM8 - Wave-based cognitive architecture for consciousness simulation
137pub mod mem8;
138
139// MEM8 Lite - Minimal wave types for hot directory tracking (self-contained)
140pub mod mem8_lite;
141
142// n8x (Nexus Agent) - Living forest orchestrator for AI-human development
143// Binary: `n8x` (formerly `tree`, renamed to avoid shadowing Unix tree)
144pub mod tree_agent;
145
146// Context Gatherer - Searches AI tool directories for project context
147pub mod context_gatherer;
148
149// AI Output Discipline - Omni's efficiency manifesto implementation
150pub mod ai_output;
151
152// ST Unified System - One tool to rule them all!
153pub mod st_context_aware;
154pub mod st_unified;
155pub mod tools_st_only;
156
157// Smart Edit Diff Storage
158pub mod smart_edit_diff;
159
160// Rust Shell - Ultimate collaborative interface with casting support
161pub mod rust_shell;
162
163// Q8-Caster Bridge - Integration with quantum casting system
164pub mod q8_caster_bridge;
165
166// VAD with Marine Algorithm - Voice Activity Detection from MEM8
167pub mod vad_marine;
168
169// Web Dashboard - Browser-based terminal + file browser (always included)
170pub mod web_dashboard;
171
172// MEM8 Binary Format - The REAL wave-based .m8 format
173pub mod mem8_binary;
174
175// M8 Format Converter - Convert between .m8, .m8j, .m8z, and .mq formats
176pub mod m8_format_converter;
177
178// Quantum Wave Signatures - Full 32-bit consciousness patterns (not horse apples!)
179pub mod quantum_wave_signature;
180
181// Claude Hook Handler - Comprehensive context provider for conversations
182pub mod claude_hook;
183
184// Marqant - Quantum-compressed markdown format (external crate from ./marqant submodule)
185// Now accessed via: use marqant::Marqant;
186
187// ST Tokenizer - Advanced semantic pattern recognition with frequency tracking
188pub mod st_tokenizer;
189
190// SmartPastCode Registry Integration - Auto-indexing for universal code discovery
191pub mod registry;
192
193// Security Scanner - Detect supply chain attack patterns
194pub mod security_scan;
195
196// Collaboration - Humans + AIs working together
197pub mod collab;