wia-agent 0.3.0__tar.gz
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.
- wia_agent-0.3.0/MANIFEST.in +10 -0
- wia_agent-0.3.0/PKG-INFO +515 -0
- wia_agent-0.3.0/README.md +464 -0
- wia_agent-0.3.0/backend/app/__init__.py +6 -0
- wia_agent-0.3.0/backend/app/agent/__init__.py +3 -0
- wia_agent-0.3.0/backend/app/agent/nooa_agent.py +230 -0
- wia_agent-0.3.0/backend/app/api/__init__.py +3 -0
- wia_agent-0.3.0/backend/app/api/router.py +431 -0
- wia_agent-0.3.0/backend/app/cli.py +642 -0
- wia_agent-0.3.0/backend/app/core/__init__.py +1 -0
- wia_agent-0.3.0/backend/app/core/config.py +42 -0
- wia_agent-0.3.0/backend/app/core/database.py +36 -0
- wia_agent-0.3.0/backend/app/core/llm.py +78 -0
- wia_agent-0.3.0/backend/app/main.py +58 -0
- wia_agent-0.3.0/backend/app/models/__init__.py +3 -0
- wia_agent-0.3.0/backend/app/models/knowledge.py +84 -0
- wia_agent-0.3.0/backend/app/models/workspace.py +73 -0
- wia_agent-0.3.0/backend/app/providers/__init__.py +4 -0
- wia_agent-0.3.0/backend/app/providers/base.py +15 -0
- wia_agent-0.3.0/backend/app/providers/nvidia_nim.py +70 -0
- wia_agent-0.3.0/backend/app/services/export/okf_exporter.py +150 -0
- wia_agent-0.3.0/backend/app/services/graph/code_graph.py +327 -0
- wia_agent-0.3.0/backend/app/services/ingestion/__init__.py +3 -0
- wia_agent-0.3.0/backend/app/services/ingestion/crawler.py +194 -0
- wia_agent-0.3.0/backend/app/services/intelligence/endpoint_detector.py +95 -0
- wia_agent-0.3.0/backend/app/services/intelligence/git_intel.py +76 -0
- wia_agent-0.3.0/backend/app/services/intelligence/incremental_indexer.py +49 -0
- wia_agent-0.3.0/backend/app/services/intelligence/secret_safety.py +44 -0
- wia_agent-0.3.0/backend/app/services/parser/__init__.py +3 -0
- wia_agent-0.3.0/backend/app/services/parser/ast_parser.py +52 -0
- wia_agent-0.3.0/backend/app/services/parser/base.py +17 -0
- wia_agent-0.3.0/backend/app/services/parser/plugins/__init__.py +12 -0
- wia_agent-0.3.0/backend/app/services/parser/plugins/c_family_parser.py +92 -0
- wia_agent-0.3.0/backend/app/services/parser/plugins/go_parser.py +64 -0
- wia_agent-0.3.0/backend/app/services/parser/plugins/python_parser.py +98 -0
- wia_agent-0.3.0/backend/app/services/parser/plugins/typescript_parser.py +78 -0
- wia_agent-0.3.0/backend/app/services/pipeline.py +126 -0
- wia_agent-0.3.0/backend/app/services/rag/__init__.py +3 -0
- wia_agent-0.3.0/backend/app/services/rag/vector_store.py +128 -0
- wia_agent-0.3.0/backend/app/services/retrieval/context_builder.py +51 -0
- wia_agent-0.3.0/backend/app/services/retrieval/hybrid_retriever.py +98 -0
- wia_agent-0.3.0/backend/app/services/retrieval/query_planner.py +73 -0
- wia_agent-0.3.0/backend/app/services/summarizer/__init__.py +3 -0
- wia_agent-0.3.0/backend/app/services/summarizer/hierarchical.py +122 -0
- wia_agent-0.3.0/backend/wia_agent.egg-info/PKG-INFO +515 -0
- wia_agent-0.3.0/backend/wia_agent.egg-info/SOURCES.txt +50 -0
- wia_agent-0.3.0/backend/wia_agent.egg-info/dependency_links.txt +1 -0
- wia_agent-0.3.0/backend/wia_agent.egg-info/entry_points.txt +2 -0
- wia_agent-0.3.0/backend/wia_agent.egg-info/requires.txt +30 -0
- wia_agent-0.3.0/backend/wia_agent.egg-info/top_level.txt +1 -0
- wia_agent-0.3.0/pyproject.toml +94 -0
- wia_agent-0.3.0/setup.cfg +4 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
include README.md
|
|
2
|
+
recursive-include backend/app *.py
|
|
3
|
+
recursive-exclude backend/data *
|
|
4
|
+
recursive-exclude backend/tests *
|
|
5
|
+
recursive-exclude tests *
|
|
6
|
+
recursive-exclude data *
|
|
7
|
+
recursive-exclude frontend *
|
|
8
|
+
recursive-exclude vscode-extension *
|
|
9
|
+
recursive-exclude .pytest_cache *
|
|
10
|
+
global-exclude *.py[cod] __pycache__ *.so .DS_Store .env .env.* *.db *.sqlite3
|
wia_agent-0.3.0/PKG-INFO
ADDED
|
@@ -0,0 +1,515 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: wia-agent
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Workspace Intelligence Agent (WIA) โ Graph-grounded workspace intelligence platform for code understanding, AST parsing, flow tracing, and RAG Q&A
|
|
5
|
+
Author-email: WIA Architecture Team <architect@wia-agent.dev>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/WIA-Agent/workspace-intelligence-agent
|
|
8
|
+
Project-URL: Documentation, https://github.com/WIA-Agent/workspace-intelligence-agent#readme
|
|
9
|
+
Project-URL: Repository, https://github.com/WIA-Agent/workspace-intelligence-agent
|
|
10
|
+
Project-URL: Issues, https://github.com/WIA-Agent/workspace-intelligence-agent/issues
|
|
11
|
+
Keywords: codebase-intelligence,workspace-intelligence,ast-parser,knowledge-graph,nvidia-nim,hybrid-retrieval,code-rag,flow-tracing,impact-analysis,developer-onboarding
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
22
|
+
Requires-Python: >=3.10
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
Requires-Dist: fastapi>=0.100.0
|
|
25
|
+
Requires-Dist: uvicorn>=0.23.0
|
|
26
|
+
Requires-Dist: pydantic>=2.0.0
|
|
27
|
+
Requires-Dist: pydantic-settings>=2.0.0
|
|
28
|
+
Requires-Dist: sqlmodel>=0.0.16
|
|
29
|
+
Requires-Dist: sqlalchemy>=2.0.0
|
|
30
|
+
Requires-Dist: GitPython>=3.1.0
|
|
31
|
+
Requires-Dist: tree-sitter>=0.21.0
|
|
32
|
+
Requires-Dist: sentence-transformers>=2.2.0
|
|
33
|
+
Requires-Dist: numpy>=1.24.0
|
|
34
|
+
Requires-Dist: httpx>=0.24.0
|
|
35
|
+
Requires-Dist: python-multipart>=0.0.6
|
|
36
|
+
Requires-Dist: openai>=1.0.0
|
|
37
|
+
Requires-Dist: rich>=13.0.0
|
|
38
|
+
Requires-Dist: networkx>=3.0
|
|
39
|
+
Requires-Dist: typer>=0.9.0
|
|
40
|
+
Provides-Extra: dev
|
|
41
|
+
Requires-Dist: pytest>=8.0.0; extra == "dev"
|
|
42
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
|
|
43
|
+
Requires-Dist: build>=1.0.0; extra == "dev"
|
|
44
|
+
Requires-Dist: twine>=4.0.0; extra == "dev"
|
|
45
|
+
Provides-Extra: ai
|
|
46
|
+
Requires-Dist: openai>=1.0.0; extra == "ai"
|
|
47
|
+
Requires-Dist: anthropic>=0.18.0; extra == "ai"
|
|
48
|
+
Requires-Dist: google-genai>=0.1.0; extra == "ai"
|
|
49
|
+
Provides-Extra: postgres
|
|
50
|
+
Requires-Dist: psycopg2-binary>=2.9.0; extra == "postgres"
|
|
51
|
+
|
|
52
|
+
# ๐ง Workspace Intelligence Agent (WIA)
|
|
53
|
+
|
|
54
|
+
[](https://www.python.org/)
|
|
55
|
+
[](https://pypi.org/project/wia-agent/)
|
|
56
|
+
[](https://fastapi.tiangolo.com/)
|
|
57
|
+
[](https://code.visualstudio.com/)
|
|
58
|
+
[](https://pytest.org/)
|
|
59
|
+
[](LICENSE)
|
|
60
|
+
|
|
61
|
+
**Workspace Intelligence Agent (WIA)** is an enterprise-grade, graph-grounded workspace intelligence platform that builds a structured understanding of an entire software repository. It uses that knowledge to answer questions, explain architecture, trace execution flow, analyze dependency impact, onboard developers, and provide grounded AI reasoning with exact file and line citations.
|
|
62
|
+
|
|
63
|
+
WIA is distributed on PyPI as **`wia-agent`** providing the **`wia`** CLI tool, paired with a **Native VS Code Extension**.
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## ๐ Table of Contents
|
|
68
|
+
|
|
69
|
+
1. [๐ System Architecture & End-to-End Pipeline](#1-๐-system-architecture--end-to-end-pipeline)
|
|
70
|
+
2. [โก Complete Technology Stack](#2-โก-complete-technology-stack)
|
|
71
|
+
3. [๐ Repository Directory Structure](#3-๐-repository-directory-structure)
|
|
72
|
+
4. [๐ป Exhaustive Command-Line Interface (CLI) Manual](#4-๐ป-exhaustive-command-line-interface-cli-manual)
|
|
73
|
+
5. [๐งฉ Native VS Code Extension Guide](#5-๐งฉ-native-vs-code-extension-guide)
|
|
74
|
+
6. [๐ Quickstart & Installation Guide](#6-๐-quickstart--installation-guide)
|
|
75
|
+
- [PyPI Installation](#pypi-installation)
|
|
76
|
+
- [Local Development Setup](#local-development-setup)
|
|
77
|
+
- [Running via WIA Engine Daemon](#running-via-wia-engine-daemon)
|
|
78
|
+
- [Docker Compose Deployment](#docker-compose-deployment)
|
|
79
|
+
7. [๐ก Complete REST API Reference](#7-๐ก-complete-rest-api-reference)
|
|
80
|
+
8. [๐ง Workspace Knowledge Model & Code Knowledge Graph](#8-๐ง -workspace-knowledge-model--code-knowledge-graph)
|
|
81
|
+
9. [๐ Multi-Language AST Parser Plugin Architecture](#9-๐-multi-language-ast-parser-plugin-architecture)
|
|
82
|
+
10. [๐ 5-Level Hierarchical Workspace Summarization Engine](#10-๐-5-level-hierarchical-workspace-summarization-engine)
|
|
83
|
+
11. [๐ Hybrid Retrieval Engine & Query Planner](#11-๐-hybrid-retrieval-engine--query-planner)
|
|
84
|
+
12. [๐ค NVIDIA NIM AI Reasoning Provider](#12-๐ค-nvidia-nim-ai-reasoning-provider)
|
|
85
|
+
13. [๐ก๏ธ Provenance & Secret Safety Redaction](#13-๐ก๏ธ-provenance--secret-safety-redaction)
|
|
86
|
+
14. [๐ฆ Open Knowledge Format (OKF) Export](#14-๐ฆ-open-knowledge-format-okf-export)
|
|
87
|
+
15. [โ๏ธ Complete Configuration & Environment Variables (`.env`)](#15-โ๏ธ-complete-configuration--environment-variables-env)
|
|
88
|
+
16. [๐งช Automated Testing Suite](#16-๐งช-automated-testing-suite)
|
|
89
|
+
17. [โ Troubleshooting & FAQ](#17-โ-troubleshooting--faq)
|
|
90
|
+
18. [๐ Documentation Index](#18-๐-documentation-index)
|
|
91
|
+
19. [๐ License](#19-๐-license)
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## 1. ๐ System Architecture & End-to-End Pipeline
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
GitHub Repository URL or Local Workspace Directory
|
|
99
|
+
โ
|
|
100
|
+
โผ
|
|
101
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
102
|
+
โ 1. Repository Ingestion, Safety & Incremental Change Detector โ
|
|
103
|
+
โ โข Recursively scans filesystem or clones Git repository โ
|
|
104
|
+
โ โข Filters noise (.git, node_modules, .venv, build, binaries) โ
|
|
105
|
+
โ โข SHA256 file hashing for incremental change detection โ
|
|
106
|
+
โ โข Automatically ignores .env/keys and redacts credentials โ
|
|
107
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
108
|
+
โ
|
|
109
|
+
โผ
|
|
110
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
111
|
+
โ 2. Extensible Multi-Language Parser Plugin System โ
|
|
112
|
+
โ โข Python AST (classes, async functions, docstrings, calls) โ
|
|
113
|
+
โ โข TypeScript / JavaScript (classes, interfaces, arrow fns) โ
|
|
114
|
+
โ โข Go (structs, interfaces, method receivers, package imports) โ
|
|
115
|
+
โ โข Rust (structs, enums, traits, pub fn extractors) โ
|
|
116
|
+
โ โข C / C++ / Java / C# (classes, interfaces, method signatures)โ
|
|
117
|
+
โ โข Automated API route & unit test case discovery โ
|
|
118
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
119
|
+
โ
|
|
120
|
+
โผ
|
|
121
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
122
|
+
โ 3. Workspace Knowledge Model & Code Knowledge Graph โ
|
|
123
|
+
โ โข Entities: Repository, Subsystem, File, Symbol, Function โ
|
|
124
|
+
โ โข Relational Edges: CONTAINS, DEFINES, IMPORTS, CALLS, INHERITโ
|
|
125
|
+
โ โข Strict Provenance: DETERMINISTIC_FACT vs LLM_SUMMARY โ
|
|
126
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
127
|
+
โ
|
|
128
|
+
โโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโ
|
|
129
|
+
โผ โผ โผ
|
|
130
|
+
โโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโ
|
|
131
|
+
โ 4A. Hierarchical โ โ 4B. Hybrid Vector โ โ 4C. Portable OKF โ
|
|
132
|
+
โ Summaries โ โ & Lexical RAG โ โ Knowledge โ
|
|
133
|
+
โ (5 Levels) โ โ Embeddings โ โ Export โ
|
|
134
|
+
โโโโโโโโโโโโโโโฌโโโโโโ โโโโโโโโโโโโโฌโโโโโโโโ โโโโโโโโโโโโโฌโโโโโโโโ
|
|
135
|
+
โ โ โ
|
|
136
|
+
โโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโ
|
|
137
|
+
โ
|
|
138
|
+
โผ
|
|
139
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
140
|
+
โ 5. Hybrid Retrieval Engine & Query Planner โ
|
|
141
|
+
โ โข Combines Symbol Lookup + Lexical BM25 + Vector + Graph Walks โ
|
|
142
|
+
โ โข Intent Planner: Architecture, Flow, Impact, Onboard, Health โ
|
|
143
|
+
โ โข Structured Context Builder with Line-Number Citations โ
|
|
144
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
145
|
+
โ
|
|
146
|
+
โผ
|
|
147
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
148
|
+
โ 6. NVIDIA NIM Reasoning Layer & Grounded Output โ
|
|
149
|
+
โ โข Grounded generation powered by NVIDIA NIM โ
|
|
150
|
+
โ โข Exact source file and line-number citations โ
|
|
151
|
+
โ โข Deterministic offline mode when NIM is not configured โ
|
|
152
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
153
|
+
โ
|
|
154
|
+
โผ
|
|
155
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
156
|
+
โ CLI (`wia`) โ VS Code Extension โ REST API โ
|
|
157
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## 2. โก Complete Technology Stack
|
|
163
|
+
|
|
164
|
+
| Layer | Component | Implementation |
|
|
165
|
+
|---|---|---|
|
|
166
|
+
| **Language & Engine** | Python 3.10+ | FastAPI, Pydantic v2, SQLModel, Uvicorn |
|
|
167
|
+
| **CLI Framework** | Python CLI | `argparse` with UTF-8 console output |
|
|
168
|
+
| **Code Parsing** | Multi-Language Parser Plugins | `ast` (Python), Regex/Structural Extractors (TS/JS, Go, Rust, Java, C++, C#) |
|
|
169
|
+
| **Knowledge Graph** | NetworkX Graph Engine | Directed graph with SQLite / PostgreSQL persistence |
|
|
170
|
+
| **Hybrid Retrieval** | Hybrid Engine | Exact Symbol Index + BM25 Lexical + SentenceTransformers Vector + Graph BFS |
|
|
171
|
+
| **AI Reasoning** | NVIDIA NIM Provider | OpenAI-compatible NIM API (`meta/llama-3.1-70b-instruct`) |
|
|
172
|
+
| **IDE Extension** | VS Code Extension | TypeScript, VS Code Extension API, Webview Chat, TreeView Provider |
|
|
173
|
+
| **Knowledge Export** | Open Knowledge Format (OKF) | Deterministic `.wia/knowledge/` Markdown / YAML documentation |
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## 3. ๐ Repository Directory Structure
|
|
178
|
+
|
|
179
|
+
```
|
|
180
|
+
Workspace-Intelligence-Agent/
|
|
181
|
+
โโโ backend/
|
|
182
|
+
โ โโโ app/
|
|
183
|
+
โ โ โโโ __init__.py # Package version definition (v0.3.0)
|
|
184
|
+
โ โ โโโ cli.py # WIA CLI command implementations
|
|
185
|
+
โ โ โโโ main.py # FastAPI application & lifespan management
|
|
186
|
+
โ โ โโโ agent/ # WIA Code Understanding Agent
|
|
187
|
+
โ โ โโโ api/ # REST API routers & Pydantic models
|
|
188
|
+
โ โ โโโ core/ # Config, database engine, & LLM client
|
|
189
|
+
โ โ โโโ models/ # SQLModel workspace & knowledge entities
|
|
190
|
+
โ โ โโโ providers/ # NVIDIA NIM & base LLM providers
|
|
191
|
+
โ โ โโโ services/
|
|
192
|
+
โ โ โโโ export/ # OKF exporter
|
|
193
|
+
โ โ โโโ graph/ # Code knowledge graph & graph traversal
|
|
194
|
+
โ โ โโโ ingestion/ # Crawler & file discovery
|
|
195
|
+
โ โ โโโ intelligence/ # Git diff, watcher, secret safety
|
|
196
|
+
โ โ โโโ parser/ # Multi-language parser plugins
|
|
197
|
+
โ โ โโโ rag/ # VectorStore & embeddings
|
|
198
|
+
โ โ โโโ retrieval/ # HybridRetriever, QueryPlanner, ContextBuilder
|
|
199
|
+
โ โ โโโ summarizer/ # 5-level hierarchical summarizer
|
|
200
|
+
โ โโโ tests/ # Pytest automated test suite (26 tests)
|
|
201
|
+
โโโ docs/ # Detailed design & user documentation
|
|
202
|
+
โ โโโ AI_ARCHITECTURE.md # NVIDIA NIM & Agent architecture
|
|
203
|
+
โ โโโ API.md # Complete REST API reference
|
|
204
|
+
โ โโโ ARCHITECTURE.md # System design & component breakdown
|
|
205
|
+
โ โโโ CLI.md # CLI reference manual
|
|
206
|
+
โ โโโ HIERARCHICAL_SUMMARIZATION.md # 5-level summarization engine
|
|
207
|
+
โ โโโ KNOWLEDGE_MODEL.md # Graph entities & relation schema
|
|
208
|
+
โ โโโ OKF_EXPORT.md # Open Knowledge Format guide
|
|
209
|
+
โ โโโ PACKAGING.md # PyPI packaging & distribution guide
|
|
210
|
+
โ โโโ PROVENANCE.md # Deterministic fact vs summary model
|
|
211
|
+
โ โโโ RETRIEVAL.md # Hybrid retrieval pipeline
|
|
212
|
+
โ โโโ VSCODE_EXTENSION.md # VS Code extension architecture
|
|
213
|
+
โโโ vscode-extension/ # Native VS Code Extension (TypeScript)
|
|
214
|
+
โ โโโ package.json
|
|
215
|
+
โ โโโ src/
|
|
216
|
+
โ โ โโโ extension.ts # Extension activation & commands
|
|
217
|
+
โ โ โโโ api.ts # WIA Backend API client
|
|
218
|
+
โ โ โโโ chatViewProvider.ts # Interactive AI chat webview
|
|
219
|
+
โ โ โโโ treeViews.ts # Architecture, Symbols, & Dependency trees
|
|
220
|
+
โโโ docker-compose.yml # Docker Compose with PostgreSQL support
|
|
221
|
+
โโโ Dockerfile.backend # Backend container definition
|
|
222
|
+
โโโ pyproject.toml # PEP 517/621 packaging metadata
|
|
223
|
+
โโโ .env.example # Documented environment variables template
|
|
224
|
+
โโโ README.md
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
## 4. ๐ป Exhaustive Command-Line Interface (CLI) Manual
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
# Display CLI help and command index
|
|
233
|
+
wia --help
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
### Complete CLI Command Reference
|
|
237
|
+
|
|
238
|
+
| Command | Syntax | Description | Example |
|
|
239
|
+
|---|---|---|---|
|
|
240
|
+
| **`scan`** | `wia scan <path_or_url> [--name <name>]` | Ingest and analyze a codebase | `wia scan ./ --name "My App"` |
|
|
241
|
+
| **`query`** | `wia query <repo> "<question>"` | Ask AI technical questions with exact line citations | `wia query "My App" "Explain auth flow"` |
|
|
242
|
+
| **`architecture`** | `wia architecture <repo>` | View graph nodes/edges and subsystem breakdown | `wia architecture "My App"` |
|
|
243
|
+
| **`flow`** | `wia flow <repo> <symbol>` | Trace call execution flow starting from an entry symbol | `wia flow "My App" handle_login` |
|
|
244
|
+
| **`impact`** | `wia impact <repo> <symbol>` | Analyze ripple change impact on callers and files | `wia impact "My App" AuthService` |
|
|
245
|
+
| **`diff`** | `wia diff [<repo>]` | Analyze Git diff changes and affected symbols | `wia diff "My App"` |
|
|
246
|
+
| **`watch`** | `wia watch <path_or_repo> [--interval 3]` | Watch workspace and incrementally reindex on change | `wia watch ./` |
|
|
247
|
+
| **`health`** | `wia health <repo>` | Run codebase complexity and health audit | `wia health "My App"` |
|
|
248
|
+
| **`onboard`** | `wia onboard <repo>` | Generate developer onboarding walkthrough | `wia onboard "My App"` |
|
|
249
|
+
| **`symbols`** | `wia symbols <repo> [--search <term>]` | Search and list AST symbols across the codebase | `wia symbols "My App" --search login` |
|
|
250
|
+
| **`dependencies`**| `wia dependencies <repo>` | Inspect package manifests and cross-file import statements | `wia dependencies "My App"` |
|
|
251
|
+
| **`parse`** | `wia parse <file>` | Extract AST classes, functions, and imports from a single file | `wia parse backend/app/main.py` |
|
|
252
|
+
| **`summarize`** | `wia summarize <repo>` | View the 5-level hierarchical summaries | `wia summarize "My App"` |
|
|
253
|
+
| **`export`** | `wia export <repo> --format [markdown\|json\|okf]` | Export architecture report or Open Knowledge Format | `wia export "My App" --format okf` |
|
|
254
|
+
| **`list`** | `wia list` | List all ingested repositories | `wia list` |
|
|
255
|
+
| **`delete`** | `wia delete <repo>` | Delete repository and purge all cached knowledge | `wia delete "My App"` |
|
|
256
|
+
| **`serve`** | `wia serve [--port 8000]` | Start local FastAPI daemon server for VS Code | `wia serve --port 8000` |
|
|
257
|
+
| **`test`** | `wia test` | Run the automated test suite | `wia test` |
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
## 5. ๐งฉ Native VS Code Extension Guide
|
|
262
|
+
|
|
263
|
+
The **WIA VS Code Extension** embeds graph-grounded code intelligence directly into your editor:
|
|
264
|
+
|
|
265
|
+
### Key Features
|
|
266
|
+
1. **๐๏ธ Architecture TreeView**: Browse subsystems, root folders, and architectural components.
|
|
267
|
+
2. **๐ AST Symbol Explorer**: Navigate all functions, classes, interfaces, and methods in the workspace.
|
|
268
|
+
3. **๐ฆ Dependencies & Imports**: Inspect package manifests and import statements.
|
|
269
|
+
4. **๐ง Interactive AI Chat**: Natural-language codebase Q&A with **clickable source citations** that jump directly to exact file line ranges in the VS Code editor.
|
|
270
|
+
5. **โก Editor Context Menu Actions**:
|
|
271
|
+
- `WIA: Explain Code Architecture`
|
|
272
|
+
- `WIA: Trace Code Execution Flow`
|
|
273
|
+
- `WIA: Analyze Change Impact`
|
|
274
|
+
- `WIA: Export Open Knowledge Format (.wia/knowledge/)`
|
|
275
|
+
|
|
276
|
+
---
|
|
277
|
+
|
|
278
|
+
## 6. ๐ Quickstart & Installation Guide
|
|
279
|
+
|
|
280
|
+
### PyPI Installation
|
|
281
|
+
```bash
|
|
282
|
+
# Install WIA distribution from PyPI
|
|
283
|
+
pip install wia-agent
|
|
284
|
+
|
|
285
|
+
# Verify CLI
|
|
286
|
+
wia --help
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
### Local Development Setup
|
|
290
|
+
```bash
|
|
291
|
+
# 1. Clone repository
|
|
292
|
+
git clone https://github.com/Yashwanth112004/Workspace-Intelligence-Agent.git
|
|
293
|
+
cd Workspace-Intelligence-Agent
|
|
294
|
+
|
|
295
|
+
# 2. Install package in editable development mode with dev tools
|
|
296
|
+
pip install -e ".[dev]"
|
|
297
|
+
|
|
298
|
+
# 3. Configure environment variables
|
|
299
|
+
cp .env.example .env
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
### Running via WIA Engine Daemon
|
|
303
|
+
```bash
|
|
304
|
+
# Start the local daemon for CLI and VS Code extension
|
|
305
|
+
wia serve
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
### Docker Compose Deployment
|
|
309
|
+
```bash
|
|
310
|
+
# Run backend engine with PostgreSQL
|
|
311
|
+
docker-compose up --build
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
---
|
|
315
|
+
|
|
316
|
+
## 7. ๐ก Complete REST API Reference
|
|
317
|
+
|
|
318
|
+
Base URL: `http://127.0.0.1:8000/api/v1`
|
|
319
|
+
|
|
320
|
+
| Method | Endpoint | Description |
|
|
321
|
+
|---|---|---|
|
|
322
|
+
| `POST` | `/api/v1/ingest` | Ingest repository (GitHub URL or local path) |
|
|
323
|
+
| `GET` | `/api/v1/repos` | List all ingested repositories |
|
|
324
|
+
| `GET` | `/api/v1/repos/{repo_id}/status` | Get analysis progress status and metadata |
|
|
325
|
+
| `GET` | `/api/v1/repos/{repo_id}/tree` | Get repository file and folder hierarchy |
|
|
326
|
+
| `GET` | `/api/v1/repos/{repo_id}/file?path={rel_path}` | Get file content, AST symbols, and file summary |
|
|
327
|
+
| `GET` | `/api/v1/repos/{repo_id}/symbols` | Search and filter AST symbols |
|
|
328
|
+
| `GET` | `/api/v1/repos/{repo_id}/dependencies` | Get package manifests and module imports |
|
|
329
|
+
| `GET` | `/api/v1/repos/{repo_id}/graph` | Get interactive Code Knowledge Graph JSON |
|
|
330
|
+
| `GET` | `/api/v1/repos/{repo_id}/flow?entry={symbol}` | Trace execution call paths |
|
|
331
|
+
| `GET` | `/api/v1/repos/{repo_id}/impact?symbol={symbol}` | Compute dependency change blast radius |
|
|
332
|
+
| `GET` | `/api/v1/repos/{repo_id}/onboard` | Generate developer onboarding walkthrough |
|
|
333
|
+
| `GET` | `/api/v1/repos/{repo_id}/health` | Run codebase complexity and health audit |
|
|
334
|
+
| `GET` | `/api/v1/repos/{repo_id}/summaries` | Retrieve 5-level hierarchical summaries |
|
|
335
|
+
| `GET` | `/api/v1/repos/{repo_id}/export?format={okf\|markdown}` | Export knowledge or Open Knowledge Format |
|
|
336
|
+
| `POST` | `/api/v1/repos/{repo_id}/query` | Ask AI technical questions with exact source citations |
|
|
337
|
+
| `DELETE` | `/api/v1/repos/{repo_id}` | Purge repository from database and storage |
|
|
338
|
+
|
|
339
|
+
---
|
|
340
|
+
|
|
341
|
+
## 8. ๐ง Workspace Knowledge Model & Code Knowledge Graph
|
|
342
|
+
|
|
343
|
+
WIA structures repository understanding into first-class typed entities:
|
|
344
|
+
- **`Repository`**: Top-level workspace metadata, entry points, dependencies.
|
|
345
|
+
- **`FileNode`**: File/directory structure with language classification and SHA256 hashes.
|
|
346
|
+
- **`ASTSymbol`**: Extracted classes, functions, methods, variables, interfaces, and imports with line numbers.
|
|
347
|
+
- **`WorkspaceSummary`**: 5-level structured responsibilities with confidence scores.
|
|
348
|
+
|
|
349
|
+
The **Code Knowledge Graph** represents relationships:
|
|
350
|
+
- `CONTAINS` (Directory โ File, File โ Class)
|
|
351
|
+
- `DEFINES` (File โ Function / Class)
|
|
352
|
+
- `IMPORTS` (File โ Module)
|
|
353
|
+
- `CALLS` (Function โ Function / Method)
|
|
354
|
+
- `INHERITS` (Class โ Base Class)
|
|
355
|
+
|
|
356
|
+
---
|
|
357
|
+
|
|
358
|
+
## 9. ๐ Multi-Language AST Parser Plugin Architecture
|
|
359
|
+
|
|
360
|
+
WIA features dedicated parser plugins:
|
|
361
|
+
- **Python**: Full `ast` parsing for classes, async functions, decorators, method binding, docstrings, and call invocations.
|
|
362
|
+
- **TypeScript & JavaScript**: Extracts exported interfaces, types, ES6 classes, arrow functions, and imported modules.
|
|
363
|
+
- **Go**: Extracts package declarations, structs, interfaces, and method receivers.
|
|
364
|
+
- **Rust**: Extracts structs, enums, traits, implementations, and `pub fn` functions.
|
|
365
|
+
- **C / C++ / Java / C#**: Extracts class definitions, interfaces, methods, and header includes.
|
|
366
|
+
|
|
367
|
+
---
|
|
368
|
+
|
|
369
|
+
## 10. ๐ 5-Level Hierarchical Workspace Summarization Engine
|
|
370
|
+
|
|
371
|
+
1. **Level 1 (Function/Method)**: Deterministic purpose and signature.
|
|
372
|
+
2. **Level 2 (File/Module)**: Primary responsibility and defined symbols.
|
|
373
|
+
3. **Level 3 (Child Folder)**: Component domain grouping.
|
|
374
|
+
4. **Level 4 (Parent Folder / Subsystem)**: Subsystem boundaries and architectural responsibility.
|
|
375
|
+
5. **Level 5 (Repository Architecture)**: Executive repository purpose, tech stack, entry points.
|
|
376
|
+
|
|
377
|
+
---
|
|
378
|
+
|
|
379
|
+
## 11. ๐ Hybrid Retrieval Engine & Query Planner
|
|
380
|
+
|
|
381
|
+
WIA combines multiple retrieval strategies:
|
|
382
|
+
- **Exact Symbol Lookup**: Instant index lookup for symbols matching query terms.
|
|
383
|
+
- **Lexical BM25 Search**: Matches identifiers, docstrings, and signatures.
|
|
384
|
+
- **Semantic Vector Search**: `SentenceTransformers` embeddings for conceptual queries.
|
|
385
|
+
- **Graph Traversal**: Inbound/outbound graph walks for callers, callees, and dependencies.
|
|
386
|
+
|
|
387
|
+
The **Query Planner** classifies query intent:
|
|
388
|
+
- `CODE_FLOW`: Traces call paths.
|
|
389
|
+
- `DEPENDENCY_IMPACT`: Calculates blast radius.
|
|
390
|
+
- `ONBOARDING`: Synthesizes walkthrough.
|
|
391
|
+
- `HEALTH_AUDIT`: Computes complexity metrics.
|
|
392
|
+
- `GENERAL_QA`: Synthesizes grounded answer.
|
|
393
|
+
|
|
394
|
+
---
|
|
395
|
+
|
|
396
|
+
## 12. ๐ค NVIDIA NIM AI Reasoning Provider
|
|
397
|
+
|
|
398
|
+
WIA uses **NVIDIA NIM (NeMo Inference Microservices)** as its primary LLM reasoning layer:
|
|
399
|
+
|
|
400
|
+
```env
|
|
401
|
+
DEFAULT_LLM_PROVIDER=nvidia
|
|
402
|
+
NVIDIA_NIM_API_KEY=nvapi-your-key-here
|
|
403
|
+
NVIDIA_NIM_BASE_URL=https://integrate.api.nvidia.com/v1
|
|
404
|
+
NVIDIA_NIM_MODEL=meta/llama-3.1-70b-instruct
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
- **Grounded Reasoning**: The LLM receives only retrieved repository facts, symbols, and graph context.
|
|
408
|
+
- **Offline Deterministic Fallback**: If NVIDIA NIM is not configured, deterministic analysis commands (`scan`, `architecture`, `symbols`, `flow`, `impact`, `export`) continue working seamlessly.
|
|
409
|
+
|
|
410
|
+
---
|
|
411
|
+
|
|
412
|
+
## 13. ๐ก๏ธ Provenance & Secret Safety Redaction
|
|
413
|
+
|
|
414
|
+
- **Strict Provenance**: WIA distinguishes `DETERMINISTIC_FACT` (parsed symbols, imports, lines) from `LLM_SUMMARY` (AI-generated text).
|
|
415
|
+
- **Secret Safety**: Sensitive files (`.env`, `.pem`, `.key`, `id_rsa`) and patterns (API keys, tokens) are redacted before constructing LLM context.
|
|
416
|
+
|
|
417
|
+
---
|
|
418
|
+
|
|
419
|
+
## 14. ๐ฆ Open Knowledge Format (OKF) Export
|
|
420
|
+
|
|
421
|
+
Export codebase intelligence into portable Markdown:
|
|
422
|
+
```bash
|
|
423
|
+
wia export "My Project" --format okf --output ./
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
Generates `.wia/knowledge/`:
|
|
427
|
+
```
|
|
428
|
+
.wia/knowledge/
|
|
429
|
+
โโโ index.md # Knowledge index & tech stack
|
|
430
|
+
โโโ repository.md # Executive summary & entry points
|
|
431
|
+
โโโ architecture.md # Subsystems breakdown
|
|
432
|
+
โโโ subsystems/ # Subsystem deep dives
|
|
433
|
+
โโโ modules/ # Per-file module guides
|
|
434
|
+
โโโ symbols/ # Defined symbols index
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
---
|
|
438
|
+
|
|
439
|
+
## 15. โ๏ธ Complete Configuration & Environment Variables (`.env`)
|
|
440
|
+
|
|
441
|
+
```env
|
|
442
|
+
# ==============================================================================
|
|
443
|
+
# Workspace Intelligence Agent (WIA) - Environment Configuration
|
|
444
|
+
# ==============================================================================
|
|
445
|
+
|
|
446
|
+
DEFAULT_LLM_PROVIDER=nvidia
|
|
447
|
+
NVIDIA_NIM_API_KEY=your_nvidia_nim_api_key_here
|
|
448
|
+
NVIDIA_NIM_BASE_URL=https://integrate.api.nvidia.com/v1
|
|
449
|
+
NVIDIA_NIM_MODEL=meta/llama-3.1-70b-instruct
|
|
450
|
+
|
|
451
|
+
# Local Vector Embeddings (SentenceTransformers)
|
|
452
|
+
EMBEDDING_MODEL=all-MiniLM-L6-v2
|
|
453
|
+
|
|
454
|
+
# Server Configuration
|
|
455
|
+
WIA_HOST=127.0.0.1
|
|
456
|
+
WIA_PORT=8000
|
|
457
|
+
WIA_LOG_LEVEL=INFO
|
|
458
|
+
```
|
|
459
|
+
|
|
460
|
+
---
|
|
461
|
+
|
|
462
|
+
## 16. ๐งช Automated Testing Suite
|
|
463
|
+
|
|
464
|
+
Run the full automated pytest suite (26 unit & integration tests, 55% measured test coverage):
|
|
465
|
+
|
|
466
|
+
```bash
|
|
467
|
+
# Run pytest with coverage
|
|
468
|
+
pytest --cov=app
|
|
469
|
+
|
|
470
|
+
# Or via WIA CLI
|
|
471
|
+
wia test
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
### Verified Test Suites
|
|
475
|
+
- `test_api_endpoints.py`: Tests all REST API endpoints with SQLite memory pool.
|
|
476
|
+
- `test_ast_multilang.py`: Validates Python, TypeScript, Go, Rust, and C++ AST symbol extraction.
|
|
477
|
+
- `test_knowledge_graph.py`: Validates BFS call tracing, impact analysis, and graph edges.
|
|
478
|
+
- `test_hybrid_retrieval.py`: Validates Query Planner intents, secret redaction, and OKF export.
|
|
479
|
+
- `test_nvidia_nim_provider.py`: Validates NVIDIA NIM provider request building, authentication, and fallback.
|
|
480
|
+
- `test_wia_pipeline.py`: Validates crawler, AST parser, hierarchical summarizer, and agent.
|
|
481
|
+
|
|
482
|
+
---
|
|
483
|
+
|
|
484
|
+
## 17. โ Troubleshooting & FAQ
|
|
485
|
+
|
|
486
|
+
**Q: Do I need an OpenAI / Gemini API key to use WIA?**
|
|
487
|
+
A: No. WIA uses NVIDIA NIM as its primary AI provider. If no LLM keys are provided, deterministic commands (`scan`, `architecture`, `symbols`, `flow`, `impact`, `export`) continue working completely.
|
|
488
|
+
|
|
489
|
+
**Q: How does the VS Code extension connect to WIA?**
|
|
490
|
+
A: Start the daemon with `wia serve` (or `python run_dev.py`). The VS Code extension connects to `http://127.0.0.1:8000`.
|
|
491
|
+
|
|
492
|
+
**Q: Are my API keys or source code secrets uploaded anywhere?**
|
|
493
|
+
A: No. Secrets in `.env` files and recognized API keys are automatically redacted locally before constructing any LLM prompts.
|
|
494
|
+
|
|
495
|
+
---
|
|
496
|
+
|
|
497
|
+
## 18. ๐ Documentation Index
|
|
498
|
+
|
|
499
|
+
- [System Architecture Details](docs/ARCHITECTURE.md)
|
|
500
|
+
- [Workspace Knowledge Model](docs/KNOWLEDGE_MODEL.md)
|
|
501
|
+
- [Hybrid Retrieval Engine](docs/RETRIEVAL.md)
|
|
502
|
+
- [Provenance & Citations](docs/PROVENANCE.md)
|
|
503
|
+
- [AI Architecture & NVIDIA NIM](docs/AI_ARCHITECTURE.md)
|
|
504
|
+
- [Python Packaging Guide](docs/PACKAGING.md)
|
|
505
|
+
- [VS Code Extension Developer Guide](docs/VSCODE_EXTENSION.md)
|
|
506
|
+
- [Open Knowledge Format Export](docs/OKF_EXPORT.md)
|
|
507
|
+
- [REST API Specification](docs/API.md)
|
|
508
|
+
- [CLI User Manual](docs/CLI.md)
|
|
509
|
+
- [Hierarchical Summarization Guide](docs/HIERARCHICAL_SUMMARIZATION.md)
|
|
510
|
+
|
|
511
|
+
---
|
|
512
|
+
|
|
513
|
+
## 19. ๐ License
|
|
514
|
+
|
|
515
|
+
This project is licensed under the MIT License.
|