feat: smart integration detection with package classifier
- Add PackageClassifier with built-in dictionary (~200 popular packages) - Hardcode Python 3.10+ stdlib list to filter out standard library imports - Add PyPI API lookup for unknown packages (online mode, 3s timeout) - Cache PyPI results in .wtismycode/cache/pypi.json - Add --offline flag to skip PyPI lookups - Classify packages into: HTTP, Database, Queue, Storage, AI/ML, Auth, Testing, Logging, Internal, Third-party - User config integration_patterns override auto-detection - Update renderer to show integrations grouped by category - Update ARCHITECTURE.md template with new integration format
This commit is contained in:
@@ -19,17 +19,14 @@ pub fn print_generate_summary(model: &ProjectModel) {
|
||||
println!(" {} {}", "Edges:".bold(),
|
||||
model.edges.module_import_edges.len() + model.edges.symbol_call_edges.len());
|
||||
|
||||
let integrations: Vec<&str> = {
|
||||
let mut v = Vec::new();
|
||||
if model.symbols.values().any(|s| s.integrations_flags.http) { v.push("HTTP"); }
|
||||
if model.symbols.values().any(|s| s.integrations_flags.db) { v.push("DB"); }
|
||||
if model.symbols.values().any(|s| s.integrations_flags.queue) { v.push("Queue"); }
|
||||
if model.symbols.values().any(|s| s.integrations_flags.storage) { v.push("Storage"); }
|
||||
if model.symbols.values().any(|s| s.integrations_flags.ai) { v.push("AI/ML"); }
|
||||
v
|
||||
};
|
||||
if !integrations.is_empty() {
|
||||
println!(" {} {}", "Integrations:".bold(), integrations.join(", ").yellow());
|
||||
if !model.classified_integrations.is_empty() {
|
||||
let cats: Vec<String> = model.classified_integrations.iter()
|
||||
.filter(|(_, pkgs)| !pkgs.is_empty())
|
||||
.map(|(cat, pkgs)| format!("{} ({})", cat, pkgs.join(", ")))
|
||||
.collect();
|
||||
if !cats.is_empty() {
|
||||
println!(" {} {}", "Integrations:".bold(), cats.join(" | ").yellow());
|
||||
}
|
||||
}
|
||||
println!("{}", "─────────────────────────────────────".dimmed());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user