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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
// SPDX-FileCopyrightText: 2026 Knitli Inc. <knitli@knit.li>
// SPDX-FileContributor: Adam Poulemanos <adam@knit.li>
// SPDX-License-Identifier: AGPL-3.0-or-later
//! # Thread - Safe, Fast, Flexible Code Analysis and Parsing
//!
//! **Thread** is a high-performance ecosystem for code analysis and transformation built in Rust.
//! It combines the power of tree-sitter for robust parsing with a high-level rule engine
//! and content-addressed caching for efficient codebase-wide analysis.
//!
//! This crate serves as the primary entry point for the Thread ecosystem, re-exporting
//! core components from specialized sub-crates.
//!
//! ## Core Architecture
//!
//! Thread is built on a modular "service-library dual architecture":
//!
//! 1. **Library Ecosystem** - Reusable components for AST pattern matching and transformation.
//! 2. **Service Platform** - Persistent analysis with incremental intelligence and caching.
//!
//! ## Key Modules
//!
//! - [`ast`] - Core AST parsing, matching, and transformation engine.
//! - [`language`] - Support for various programming languages via tree-sitter.
//! - [`rule`] - Rule-based scanning and transformation system.
//! - [`services`] - High-level service interfaces and abstractions.
//! - [`flow`] - Dataflow orchestration and incremental analysis (optional).
//! - [`utils`] - Common utilities and performance optimizations.
//!
//! ## Quick Start
//!
//! ```rust,no_run
//! use thread::language::{Tsx, LanguageExt};
//!
//! // Parse code and find patterns
//! let ast = Tsx.ast_grep("function hello() { console.log('world'); }");
//! let root = ast.root();
//! let matches = root.find_all("console.log($$$ARGS)");
//!
//! for m in matches {
//! println!("Found console.log with {} arguments", m.get_env().get_multiple_matches("ARGS").len());
//! }
//! ```
static GLOBAL: MiMalloc = MiMalloc;
/// Core AST engine for parsing, matching, and transformation.
/// Language definitions and tree-sitter parser integrations.
/// Rule-based scanning and transformation system.
/// Dataflow orchestration layer for incremental computation and caching.
/// High-level service interfaces and application abstractions.
/// Shared utilities and performance-critical primitives.
// Re-export common types at the top level for better ergonomics
pub use ;
pub use SupportLang;
pub use ;