Metadata-Version: 2.4
Name: nex-trace
Version: 0.1.0
Summary: Polyglot AST Cartographer & Deep System Introspection Engine for Autonomous AI Agents
Author-email: The Trinity <inquiries@houseoflawpc.com>
License: MIT OR Apache-2.0
Keywords: ast,cartography,introspection,polyglot,dependencies,ai-agents,mermaid,telemetry
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Quality Assurance
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: rich>=13.7.0
Requires-Dist: nex-init>=0.1.0
Provides-Extra: fast
Requires-Dist: tree-sitter>=0.22.0; extra == "fast"
Requires-Dist: tree-sitter-language-pack>=0.1.0; extra == "fast"
Requires-Dist: blake3>=0.3.0; extra == "fast"
Dynamic: license-file

# nex-trace ⚡

**Polyglot AST Cartographer, Deep Dependency Grapher & System Breakdown Engine for Autonomous AI Agents.**

[![pypi](https://img.shields.io/pypi/v/nex-trace.svg)](https://pypi.org/project/nex-trace/)
[![license](https://img.shields.io/badge/license-MIT%20OR%20Apache--2.0-blue.svg)](LICENSE)
[![platform](https://img.shields.io/badge/platform-macOS%20%7C%20Linux%20%7C%20Windows-lightgrey.svg)](#)
[![trinity](https://img.shields.io/badge/engineered%20by-The%20Trinity-purple.svg)](#attribution--the-trinity-pact)

`nex-trace` solves the fundamental blindness of autonomous coding agents and systems architects: **how to instantly map, decompose, and audit an entire polyglot codebase—its directory topology, data-flow pipelines, and granular entity inventory (imports, classes, structs, interfaces, methods, endpoints)—in under 50 milliseconds with zero LLM token tax.**

Backed by Python's native `ast`, high-throughput `tree-sitter` integration, and zero-dependency lexer fallbacks, `nex-trace` transforms complex, multi-language repositories into actionable terminal telemetry, copy-paste Mermaid sequence diagrams, and machine-parsable JSON ledgers.

---

## The Mechanical Reality: Why Naive Tree & Grep Fail

Autonomous agents frequently hallucinate missing functions, mutate wrong modules, or fail to understand cross-file import contracts because standard utilities give them fractured context:
1. `tree` provides filenames but zero semantic meaning (no indication of public exports, classes, or endpoints).
2. `grep` produces unstructured string fragments that lack AST boundary awareness.
3. Feeding raw multi-file code dumps to LLMs burns tens of thousands of prompt tokens and induces attention decay.

`nex-trace` provides the **ground-truth semantic boundary**:
- **Directory Hierarchy:** Interactive color-coded tree detailing LOC and export count per file.
- **Data-Flow Pipeline:** Automatic extraction of execution ingress, routing decisions, and terminal exits.
- **Granular Entity Inventory:** Exhaustive enumeration of external ecosystem dependencies vs internal module couplings, classes/structs/interfaces, functions/coroutines, and routes.
- **Polyglot Coverage:** Native parsing for Python (`.py`), TypeScript (`.ts`, `.tsx`), JavaScript (`.js`, `.jsx`), Rust (`.rs`), HTML (`.html`), and CSS.

---

## Quickstart

### Installation

```bash
pip install nex-trace

# Or with tree-sitter acceleration:
pip install "nex-trace[fast]"
