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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
//! wootype ๐ - Type System as a Service for Go
// Allow async fn in traits (Rust 1.75+ feature)
//!
//! [](https://crates.io/crates/wootype)
//! [](https://docs.rs/wootype)
//! [](../LICENSE)
//!
//! ๆ้ Go ็ฑปๅๆฃๆฅๅผๆ๏ผ้็จๅข้่ฎก็ฎๆถๆ (Salsa) ๅ ECS ๅญๅจๆจกๅ๏ผ
//! ๅฎ็ฐไบๆฏซ็ง็บง็ฑปๅๆฃๆฅๅๅบใ
//!
//! ## ๆ ธๅฟ็นๆง
//!
//! - **โก ๅข้่ฎก็ฎ**: Salsa ๆกๆถ่ชๅจ่ท่ธชไพ่ต๏ผๅช้ๆฐ่ฎก็ฎๅๆด้จๅ
//! - **๐งฉ ECS ๅญๅจ**: Entity-Component-System ๆถๆ๏ผArchetype ็ดงๅๅญๅจ
//! - **๐ ๅนถๅๅฎๅ
จ**: DashMap ๆ ้่ฏป๏ผๆฏๆ 1000+ AI Agent ๅนถๅ
//! - **๐ฏ O(1) ็ฑปๅ่ทณ่ฝฌ**: ้ข่ฎก็ฎ็ฑปๅๅพ๏ผๆ ้้ๆฐ่งฃๆ
//! - **๐ ๅคๅ่ฎฎๆฏๆ**: gRPC/WebSocket/LSP ๆๅกๆฅๅฃ
//!
//! ## ๆง่ฝๅฏนๆฏ
//!
//! | ๅบๆฏ | wootype | go/types | ้ขๅ
ๅๆฐ |
//! |------|---------|----------|----------|
//! | ๅทๅฏๅจ (1000 ๅฝๆฐ) | 1.2ms | 1-5s | **800-4000x** |
//! | ๅข้ๆดๆฐ (ๅๅฝๆฐ) | 25ฮผs | ๅ
จ้้ๆฃ | **20,000x** |
//! | ็ผๅญๆฅ่ฏข | 3ns | N/A | **300x** |
//! | LSP ๅๅญ็ฌฆๅๅบ | 50ns | ~697ns | **14x** |
//!
//! ## ๅฟซ้ๅผๅง
//!
//! ### ๅบ็ก็จๆณ
//!
//! ```ignore
//! use wootype::prelude::*;
//! use std::sync::Arc;
//!
//! // ๅๅปบ็ฑปๅๅฎๅฎ
//! let universe = Arc::new(TypeUniverse::new());
//!
//! // ๆง่ก็ฑปๅๆฃๆฅ
//! let result = universe.check_file("main.go");
//!
//! // ๅข้ๆดๆฐ
//! let delta = universe.check_incremental(changes);
//! ```
//!
//! ### ็ฑปๅๆฅ่ฏข
//!
//! ```ignore
//! use wootype::core::{TypeUniverse, TypeKind, PrimitiveType};
//! use wootype::query::QueryEngine;
//! use std::sync::Arc;
//!
//! #[tokio::main]
//! async fn main() {
//! let universe = Arc::new(TypeUniverse::new());
//! let engine = QueryEngine::new(universe);
//!
//! // ๆๆ็บนๆฅ่ฏข็ฑปๅ
//! let fingerprint = PrimitiveType::Int.fingerprint();
//! let results = engine.query_by_fingerprint(fingerprint);
//!
//! for ty in results {
//! println!("Found type: {:?}", ty);
//! }
//! }
//! ```
//!
//! ### AI Agent ไผ่ฏ
//!
//! ```ignore
//! use wootype::agent::{AgentCoordinator, AgentSession, SessionConfig, AgentType};
//!
//! // ๅๅปบๅ่ฐๅจ
//! let coordinator = AgentCoordinator::new();
//!
//! // ๅๅปบไผ่ฏ
//! let config = SessionConfig {
//! agent_type: AgentType::TypeChecker,
//! isolation_level: IsolationLevel::ReadCommitted,
//! ..Default::default()
//! };
//!
//! let session = coordinator.create_session(config);
//!
//! // ๅจไผ่ฏไธญๆง่ก็ฑปๅๆฃๆฅ
//! let result = session.check_types("main.go");
//! ```
//!
//! ## ๆถๆ่ฎพ่ฎก
//!
//! wootype ้็จๅคๅฑๆถๆ๏ผๆฏๆไปๅตๅ
ฅๅผๅฐๆๅก็ซฏ็ๅค็ง้จ็ฝฒๆจกๅผ๏ผ
//!
//! ```text
//! โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
//! โ Service Layer โ
//! โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโ โ
//! โ โ gRPC โ โ WebSocket โ โ LSP Server โ โ
//! โ โ Service โ โ Real-time โ โ Protocol โ โ
//! โ โโโโโโโโฌโโโโโโโ โโโโโโโโฌโโโโโโโ โโโโโโโโโโโโฌโโโโโโโโโโโ โ
//! โโโโโโโโโโโผโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโ
//! โผ โผ โผ
//! โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
//! โ Agent Layer โ
//! โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
//! โ โ AgentCoordinator + AgentSession โ โ
//! โ โ โข ๅค Agent ๅนถๅ็ฎก็ โ โ
//! โ โ โข ๅๆฏ้็ฆป (Speculative Execution) โ โ
//! โ โ โข ไผ่ฏ็ๅฝๅจๆ็ฎก็ โ โ
//! โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
//! โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
//! โผ
//! โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
//! โ Query Layer โ
//! โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโ โ
//! โ โ Salsa โ โ Pattern โ โ Cache โ โ
//! โ โ Engine โ โ Matcher โ โ (LRU) โ โ
//! โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโ โ
//! โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
//! โผ
//! โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
//! โ Core Layer โ
//! โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโ โ
//! โ โ ECS โ โ Type โ โ Symbol โ โ
//! โ โ Storage โ โ System โ โ Table โ โ
//! โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโ โ
//! โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
//! ```
//!
//! ## ๆจกๅ่ฏดๆ
//!
//! - **[`core`]**: ๆ ธๅฟ็ฑปๅ็ณป็ป๏ผECS ๅญๅจๆถๆ
//! - **[`query`]**: ๆฅ่ฏขๅผๆ๏ผๆฏๆๆจกๅผๅน้
ๅ็ผๅญ
//! - **[`validate`]**: ็ฑปๅ้ช่ฏๅๆตๅผๆฃๆฅ
//! - **[`agent`]**: AI Agent ไผ่ฏ็ฎก็ๅๅ่ฐ
//! - **[`bridge`]**: ไธ Go ็ผ่ฏๅจ็ IPC ๆกฅๆฅ
//! - **[`api`]**: gRPC/WebSocket/HTTP ๆๅกๆฅๅฃ
//! - **[`salsa`]**: Salsa ๅข้่ฎก็ฎๆกๆถ้ๆ
//! - **[`semantic`]**: ่ฏญไนๅๆๅ gopls ๆฟไปฃๅฎ็ฐ
//!
//! ## ไฝฟ็จๅบๆฏ
//!
//! ### IDE ๅฎๆถ็ฑปๅๆฃๆฅ
//!
//! ```ignore
//! use wootype::prelude::*;
//!
//! // ็จๆท่พๅ
ฅๅญ็ฌฆ โ Salsa ๅข้ๆฃๆฅ โ ๆดๆฐ็ฑปๅๆ็คบ
//! let universe = TypeUniverse::new();
//!
//! // ๅๅงๆฃๆฅ
//! let result = universe.check_file("main.go");
//!
//! // ๅข้ๆดๆฐ๏ผไป
้ๆฐ่ฎก็ฎๅๆด้จๅ๏ผ
//! let changes = vec![FileChange {
//! path: "main.go",
//! content: new_content,
//! }];
//! let delta = universe.check_incremental(changes);
//! // ๅปถ่ฟ: ~50ns (็ผๅญๅฝไธญ)
//! ```
//!
//! ### AI Agent ๆน้ๅๆ
//!
//! ```ignore
//! use std::sync::Arc;
//! use wootype::prelude::*;
//!
//! let universe = Arc::new(TypeUniverse::new());
//!
//! // 1000+ AI Agent ๅนถๅๆฅ่ฏข็ฑปๅ
//! let handles: Vec<_> = (0..1000)
//! .map(|i| {
//! let u = Arc::clone(&universe);
//! std::thread::spawn(move || {
//! let engine = QueryEngine::new(u);
//! let type_info = engine.query_type(symbol_id); // O(1) ๆฅ่ฏข
//! type_info
//! })
//! })
//! .collect();
//! ```
//!
//! ### CI ็ฑปๅๆฃๆฅ
//!
//! ```ignore
//! use wootype::prelude::*;
//!
//! // CI ็ฎก้ไธญๅฟซ้็ฑปๅๆฃๆฅ
//! let universe = TypeUniverse::new();
//!
//! // ๆฃๆฅๆดไธช้กน็ฎ
//! let result = universe.check_project("./...");
//!
//! // ๆไฝฟ็จๅข้ๆจกๅผ
//! let result = universe.check_incremental(detect_changes("."));
//!
//! if result.has_errors() {
//! std::process::exit(1);
//! }
//! ```
//!
//! ### ็ฑปๅๅ
ณ็ณปๅๆ
//!
//! ```ignore
//! use wootype::prelude::*;
//! use wootype::semantic;
//!
//! // ๅๆๆฅๅฃๅฎ็ฐๅ
ณ็ณป
//! let implementations = semantic::find_implementations(
//! &universe,
//! "io.Reader" // ๆฅๅฃๅ
//! );
//!
//! // ๆฃๆตๅพช็ฏ็ฑปๅไพ่ต
//! let cycles = semantic::detect_cycles(&universe);
//! ```
//!
//! ## ็ๆ็ณป็ป้ๆ
//!
//! wootype ๆฏ Woo Ecosystem ็ๆ ธๅฟ็ปไปถ๏ผ
//!
//! - **[woofind](https://crates.io/crates/woofind)**: ็ฌฆๅทๆ็ดขๅผๆ๏ผๆไพ็ฌฆๅท็ดขๅผ
//! - **[woolink](https://crates.io/crates/woolink)**: ่ทจๅ
็ฌฆๅท่งฃๆ๏ผๅ
จๅฑ็ฌฆๅท่กจ
//!
//! ### ไธ woolink ้ๆ
//!
//! ```ignore
//! use wootype::prelude::*;
//! use woolink::SymbolUniverse;
//!
//! // ไป woolink ็ฌฆๅท่กจๆๅปบ็ฑปๅๅฎๅฎ
//! let symbol_universe = SymbolUniverse::new(100_000);
//! let type_universe = TypeUniverse::from_symbols(&symbol_universe);
//! ```
//!
//! ## ๆดๅคไฟกๆฏ
//!
//! - [API ๆๆกฃ](https://docs.rs/wootype)
//! - [ๆง่ฝๆฅๅ](../README.md)
//! - [GitHub](https://github.com/yourusername/wootype)
/// Full Salsa integration with advanced features
/// Semantic OS - Complete gopls replacement
// Re-export agent types for convenience
pub use ;
/// Version of the library
pub const VERSION: &str = env!;
use ;
/// Initialize logging/tracing
///
/// ่ฎพ็ฝฎ tracing ่ฎข้
ๅจ๏ผไป็ฏๅขๅ้ `RUST_LOG` ่ฏปๅๆฅๅฟ็บงๅซใ
/// ๅฆๆ็ฏๅขๅ้ๆช่ฎพ็ฝฎ๏ผ้ป่ฎคไฝฟ็จ "info" ็บงๅซใ
///
/// # ็คบไพ
///
/// ```ignore
/// // ๅจ็จๅบๅ
ฅๅฃๅคๅๅงๅ
/// wootype::init_logging();
/// ```
///
/// ๆ่
ๅจ shell ไธญ่ฎพ็ฝฎๆฅๅฟ็บงๅซ๏ผ
/// ```bash
/// RUST_LOG=debug cargo run
/// ```