cntx-ui 3.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +43 -59
- package/package.json +1 -1
- package/VISION.md +0 -110
package/README.md
CHANGED
|
@@ -1,83 +1,67 @@
|
|
|
1
1
|
# cntx-ui
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Semantic code analysis and context management for AI agents. Turns a codebase into searchable, structured context that agents can navigate efficiently.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## What it does
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
- **
|
|
10
|
-
- **
|
|
11
|
-
- **
|
|
7
|
+
- **Semantic analysis** — parses your code at the function level using tree-sitter, extracts purpose, complexity, and relationships
|
|
8
|
+
- **Local vector search** — embeds code chunks locally (all-MiniLM-L6-v2 via Transformers.js) for semantic similarity search with no external API calls
|
|
9
|
+
- **Bundle system** — group files into logical bundles (by feature, layer, or pattern) for structured context delivery
|
|
10
|
+
- **MCP server** — exposes 28+ tools to Claude Code, Claude Desktop, or any MCP-compatible client
|
|
11
|
+
- **Web dashboard** — visual interface at localhost:3333 for managing bundles, browsing semantic analysis, and editing agent rules
|
|
12
|
+
- **Real-time sync** — watches for file changes and keeps analysis, bundles, and embeddings current
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
Integrated RAG (Retrieval-Augmented Generation) without external dependencies:
|
|
15
|
-
- **Local Embeddings:** Powered by `Transformers.js` using the `all-MiniLM-L6-v2` model.
|
|
16
|
-
- **In-Memory Vector Store:** Perform semantic similarity searches across your codebase to find related implementations instantly.
|
|
14
|
+
## Install
|
|
17
15
|
|
|
18
|
-
### 🤖 AI Agent Runtime
|
|
19
|
-
A specialized runtime that exposes advanced behavior modes via MCP:
|
|
20
|
-
- **Discovery Mode:** Generates comprehensive architectural overviews.
|
|
21
|
-
- **Query Mode:** Answers specific questions using semantic search and AST analysis.
|
|
22
|
-
- **Investigation Mode:** Analyzes existing implementations to suggest integration points for new features.
|
|
23
|
-
- **Organizer Mode:** Audits and optimizes project organization and bundle health.
|
|
24
|
-
|
|
25
|
-
### 📦 Smart Bundling & MCP
|
|
26
|
-
- **Dynamic Bundles:** Group files by human intent or machine discovery.
|
|
27
|
-
- **MCP Server:** Expose bundles, files, and agent tools directly to Claude Desktop or any MCP-compatible client.
|
|
28
|
-
- **Real-time Sync:** WebSocket-based updates ensure your AI context is always fresh.
|
|
29
|
-
|
|
30
|
-
---
|
|
31
|
-
|
|
32
|
-
## 🛠 Installation
|
|
33
|
-
|
|
34
|
-
### Global Installation (Recommended)
|
|
35
16
|
```bash
|
|
36
17
|
npm install -g cntx-ui
|
|
37
18
|
```
|
|
38
19
|
|
|
39
|
-
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
40
22
|
```bash
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
23
|
+
cntx-ui init # scaffold .cntx directory, generate .mcp.json
|
|
24
|
+
cntx-ui watch # start web server on port 3333
|
|
25
|
+
cntx-ui mcp # start MCP server on stdio
|
|
26
|
+
cntx-ui bundle <name> # regenerate a specific bundle
|
|
27
|
+
cntx-ui status # show project health and bundle state
|
|
28
|
+
cntx-ui setup-mcp # configure Claude Desktop integration
|
|
45
29
|
```
|
|
46
30
|
|
|
47
|
-
|
|
31
|
+
After `cntx-ui init`, agents discover tools automatically via `.mcp.json`. The `.cntx/AGENT.md` file provides an onboarding handshake with tool reference and project overview.
|
|
48
32
|
|
|
49
|
-
##
|
|
33
|
+
## Agent interface
|
|
50
34
|
|
|
51
|
-
|
|
52
|
-
```bash
|
|
53
|
-
cntx-ui init
|
|
54
|
-
cntx-ui watch
|
|
55
|
-
```
|
|
56
|
-
*Visit `http://localhost:3333` to access the Visual Dashboard.*
|
|
35
|
+
Agents interact through MCP tools or the HTTP API:
|
|
57
36
|
|
|
58
|
-
|
|
59
|
-
| Command | Description |
|
|
37
|
+
| MCP Tool | What it does |
|
|
60
38
|
| :--- | :--- |
|
|
61
|
-
| `
|
|
62
|
-
| `
|
|
63
|
-
| `
|
|
64
|
-
| `
|
|
39
|
+
| `agent/discover` | Architectural overview of the codebase |
|
|
40
|
+
| `agent/query` | Semantic search — "where is auth handled?" |
|
|
41
|
+
| `agent/investigate` | Find integration points for a new feature |
|
|
42
|
+
| `agent/organize` | Audit and optimize bundle structure |
|
|
43
|
+
| `list_bundles` | List all bundles with metadata |
|
|
44
|
+
| `get_bundle` | Get full bundle content as XML |
|
|
45
|
+
| `get_semantic_chunks` | Get all analyzed code chunks |
|
|
46
|
+
| `read_file` / `write_file` | File operations with bundle context |
|
|
47
|
+
|
|
48
|
+
Full tool reference with parameters is generated in `.cntx/AGENT.md` and `.cntx/TOOLS.md`.
|
|
65
49
|
|
|
66
|
-
|
|
50
|
+
## How it works
|
|
67
51
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
- **Protocol:** Model Context Protocol (MCP)
|
|
52
|
+
1. **tree-sitter** parses source files into AST, extracts functions/types/interfaces
|
|
53
|
+
2. **Heuristics engine** classifies each chunk by purpose, business domain, and technical patterns based on file paths, imports, and naming conventions
|
|
54
|
+
3. **Embeddings** are generated locally and stored in SQLite for persistent vector search
|
|
55
|
+
4. **Bundles** group files by glob patterns — auto-suggested on init based on project structure
|
|
56
|
+
5. **MCP server** and **HTTP API** expose everything to agents with consistent response shapes
|
|
74
57
|
|
|
75
|
-
|
|
58
|
+
## Tech stack
|
|
76
59
|
|
|
77
|
-
|
|
78
|
-
|
|
60
|
+
- Node.js, better-sqlite3, ws (WebSocket)
|
|
61
|
+
- tree-sitter (AST parsing), Transformers.js (local embeddings)
|
|
62
|
+
- React 19, TypeScript, Vite, Tailwind CSS (web dashboard)
|
|
63
|
+
- Model Context Protocol (MCP) via JSON-RPC 2.0
|
|
79
64
|
|
|
80
|
-
|
|
65
|
+
## License
|
|
81
66
|
|
|
82
|
-
## 📄 License
|
|
83
67
|
MIT
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cntx-ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.0.
|
|
4
|
+
"version": "3.0.1",
|
|
5
5
|
"description": "Autonomous Repository Intelligence engine with web UI and MCP server. Unified semantic code understanding, local RAG, and agent working memory.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"repository-intelligence",
|
package/VISION.md
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
We're building the interface layer between human mental models and machine understanding of codebases.
|
|
2
|
-
|
|
3
|
-
## The Complete Knowledge Graph
|
|
4
|
-
|
|
5
|
-
What we're really creating is a traversable knowledge graph for AI agents:
|
|
6
|
-
|
|
7
|
-
```
|
|
8
|
-
// The full context system an AI agent can navigate:
|
|
9
|
-
{
|
|
10
|
-
project: {
|
|
11
|
-
fileTree: rawFileStructure, // Raw filesystem
|
|
12
|
-
bundles: humanDefinedCollections, // Explicit human organization
|
|
13
|
-
chunks: aiDiscoveredPatterns, // Machine-learned semantic groups
|
|
14
|
-
aiRules: contextualInstructions, // How to work with this code
|
|
15
|
-
metadata: projectUnderstanding // What this codebase "does"
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## Multi-Layer Understanding System
|
|
21
|
-
|
|
22
|
-
Layer 1: Raw Structure (File Tree)
|
|
23
|
-
|
|
24
|
-
- Physical organization
|
|
25
|
-
- What files exist, where they are
|
|
26
|
-
|
|
27
|
-
Layer 2: Human Intent (Bundles)
|
|
28
|
-
|
|
29
|
-
- "These files should be considered together"
|
|
30
|
-
- Explicit human curation for specific purposes
|
|
31
|
-
|
|
32
|
-
Layer 3: Machine Discovery (Semantic Chunks)
|
|
33
|
-
|
|
34
|
-
- "These files naturally cluster together"
|
|
35
|
-
- AI-discovered relationships and patterns
|
|
36
|
-
|
|
37
|
-
Layer 4: Working Instructions (AI Rules + Context)
|
|
38
|
-
|
|
39
|
-
- "When working on X, consider Y"
|
|
40
|
-
- How to navigate and modify the code effectively
|
|
41
|
-
|
|
42
|
-
## The Human ↔ Machine Interface
|
|
43
|
-
|
|
44
|
-
This becomes a bidirectional translation layer:
|
|
45
|
-
|
|
46
|
-
Human → Machine:
|
|
47
|
-
|
|
48
|
-
- "I'm working on authentication" → AI gets auth chunks + related bundles +
|
|
49
|
-
security rules
|
|
50
|
-
- "This is an e-commerce app" → AI understands domain context for better
|
|
51
|
-
suggestions
|
|
52
|
-
- "These files are related" → Creates explicit bundle relationships
|
|
53
|
-
|
|
54
|
-
Machine → Human:
|
|
55
|
-
|
|
56
|
-
- AI discovers "payment processing is tightly coupled across 12 files"
|
|
57
|
-
- AI suggests "these utility functions could be shared between features"
|
|
58
|
-
- AI provides "here's what your codebase is primarily about" overview
|
|
59
|
-
|
|
60
|
-
Ongoing Repository Intelligence
|
|
61
|
-
|
|
62
|
-
As the tool runs continuously, it builds living documentation:
|
|
63
|
-
|
|
64
|
-
```
|
|
65
|
-
// Repository understanding that evolves:
|
|
66
|
-
{
|
|
67
|
-
codebasePersonality: {
|
|
68
|
-
primaryPurpose: "E-commerce platform with React frontend",
|
|
69
|
-
architecturalPatterns: ["feature-based organization", "custom hooks
|
|
70
|
-
pattern"],
|
|
71
|
-
complexityHotspots: ["payment processing", "user authentication"],
|
|
72
|
-
evolutionTrends: ["moving from REST to GraphQL", "adding TypeScript
|
|
73
|
-
gradually"]
|
|
74
|
-
},
|
|
75
|
-
|
|
76
|
-
workingMemory: {
|
|
77
|
-
recentChanges: "Auth system refactored last week",
|
|
78
|
-
emergingPatterns: "New utilities being created for form handling",
|
|
79
|
-
maintenanceNeeds: "Several components showing high complexity"
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
## The "What Is This Codebase About?" Dashboard
|
|
85
|
-
|
|
86
|
-
Users get a high-level strategic view:
|
|
87
|
-
|
|
88
|
-
- Semantic Map: Visual representation of chunks and relationships
|
|
89
|
-
- Complexity Overview: Where the hard problems live
|
|
90
|
-
- Evolution Tracking: How the code is changing over time
|
|
91
|
-
- AI Recommendations: Suggested improvements and organizational changes
|
|
92
|
-
- Context Preparation: Pre-built knowledge packages for different types of AI
|
|
93
|
-
assistance
|
|
94
|
-
|
|
95
|
-
This creates a self-documenting, AI-optimized codebase where both humans and
|
|
96
|
-
machines can quickly understand:
|
|
97
|
-
|
|
98
|
-
1. What this code does
|
|
99
|
-
2. How it's organized
|
|
100
|
-
3. Where to make changes
|
|
101
|
-
4. How different parts relate
|
|
102
|
-
5. What context an AI agent needs to help effectively
|
|
103
|
-
|
|
104
|
-
The tool becomes the source of truth for codebase understanding, continuously
|
|
105
|
-
learning and improving its model of the project while giving humans control
|
|
106
|
-
over the organizational principles.
|
|
107
|
-
|
|
108
|
-
This is exactly the kind of human-AI collaboration interface that will become
|
|
109
|
-
essential as codebases get more complex and AI assistance becomes more
|
|
110
|
-
sophisticated.
|