nexus-dev 3.3.1__py3-none-any.whl
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.
- nexus_dev/__init__.py +4 -0
- nexus_dev/agent_templates/__init__.py +26 -0
- nexus_dev/agent_templates/api_designer.yaml +26 -0
- nexus_dev/agent_templates/code_reviewer.yaml +26 -0
- nexus_dev/agent_templates/debug_detective.yaml +26 -0
- nexus_dev/agent_templates/doc_writer.yaml +26 -0
- nexus_dev/agent_templates/performance_optimizer.yaml +26 -0
- nexus_dev/agent_templates/refactor_architect.yaml +26 -0
- nexus_dev/agent_templates/security_auditor.yaml +26 -0
- nexus_dev/agent_templates/test_engineer.yaml +26 -0
- nexus_dev/agents/__init__.py +20 -0
- nexus_dev/agents/agent_config.py +97 -0
- nexus_dev/agents/agent_executor.py +197 -0
- nexus_dev/agents/agent_manager.py +104 -0
- nexus_dev/agents/prompt_factory.py +91 -0
- nexus_dev/chunkers/__init__.py +168 -0
- nexus_dev/chunkers/base.py +202 -0
- nexus_dev/chunkers/docs_chunker.py +291 -0
- nexus_dev/chunkers/java_chunker.py +343 -0
- nexus_dev/chunkers/javascript_chunker.py +312 -0
- nexus_dev/chunkers/python_chunker.py +308 -0
- nexus_dev/cli.py +2017 -0
- nexus_dev/config.py +261 -0
- nexus_dev/database.py +569 -0
- nexus_dev/embeddings.py +703 -0
- nexus_dev/gateway/__init__.py +10 -0
- nexus_dev/gateway/connection_manager.py +348 -0
- nexus_dev/github_importer.py +247 -0
- nexus_dev/mcp_client.py +281 -0
- nexus_dev/mcp_config.py +184 -0
- nexus_dev/schemas/mcp_config_schema.json +166 -0
- nexus_dev/server.py +1866 -0
- nexus_dev/templates/pre-commit-hook +56 -0
- nexus_dev-3.3.1.data/data/nexus_dev/agent_templates/__init__.py +26 -0
- nexus_dev-3.3.1.data/data/nexus_dev/agent_templates/api_designer.yaml +26 -0
- nexus_dev-3.3.1.data/data/nexus_dev/agent_templates/code_reviewer.yaml +26 -0
- nexus_dev-3.3.1.data/data/nexus_dev/agent_templates/debug_detective.yaml +26 -0
- nexus_dev-3.3.1.data/data/nexus_dev/agent_templates/doc_writer.yaml +26 -0
- nexus_dev-3.3.1.data/data/nexus_dev/agent_templates/performance_optimizer.yaml +26 -0
- nexus_dev-3.3.1.data/data/nexus_dev/agent_templates/refactor_architect.yaml +26 -0
- nexus_dev-3.3.1.data/data/nexus_dev/agent_templates/security_auditor.yaml +26 -0
- nexus_dev-3.3.1.data/data/nexus_dev/agent_templates/test_engineer.yaml +26 -0
- nexus_dev-3.3.1.data/data/nexus_dev/templates/pre-commit-hook +56 -0
- nexus_dev-3.3.1.dist-info/METADATA +668 -0
- nexus_dev-3.3.1.dist-info/RECORD +48 -0
- nexus_dev-3.3.1.dist-info/WHEEL +4 -0
- nexus_dev-3.3.1.dist-info/entry_points.txt +14 -0
- nexus_dev-3.3.1.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Nexus-Dev Pre-commit Hook
|
|
3
|
+
# This hook is OPTIONAL - install via: nexus-init --install-hook or --link-hook
|
|
4
|
+
|
|
5
|
+
set -e
|
|
6
|
+
|
|
7
|
+
# Find project root by walking up to find nexus_config.json
|
|
8
|
+
REPO_ROOT=$(git rev-parse --show-toplevel)
|
|
9
|
+
PROJECT_ROOT="$REPO_ROOT"
|
|
10
|
+
|
|
11
|
+
# Walk up from repo root to find nexus_config.json
|
|
12
|
+
CURRENT="$REPO_ROOT"
|
|
13
|
+
while [ "$CURRENT" != "/" ]; do
|
|
14
|
+
if [ -f "$CURRENT/nexus_config.json" ]; then
|
|
15
|
+
PROJECT_ROOT="$CURRENT"
|
|
16
|
+
break
|
|
17
|
+
fi
|
|
18
|
+
CURRENT=$(dirname "$CURRENT")
|
|
19
|
+
done
|
|
20
|
+
|
|
21
|
+
# Verify we found a config
|
|
22
|
+
if [ ! -f "$PROJECT_ROOT/nexus_config.json" ]; then
|
|
23
|
+
echo "⚠️ Nexus-Dev: No nexus_config.json found. Skipping indexing."
|
|
24
|
+
exit 0
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
# Change to project root for indexing
|
|
28
|
+
cd "$PROJECT_ROOT" || exit 0
|
|
29
|
+
|
|
30
|
+
echo "🧠 Nexus-Dev: Indexing from project root: $PROJECT_ROOT"
|
|
31
|
+
|
|
32
|
+
# Get list of modified/added code files
|
|
33
|
+
MODIFIED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -E '\.(py|js|jsx|ts|tsx|java)$' || true)
|
|
34
|
+
|
|
35
|
+
if [ -n "$MODIFIED_FILES" ]; then
|
|
36
|
+
echo "📁 Indexing modified code files..."
|
|
37
|
+
for file in $MODIFIED_FILES; do
|
|
38
|
+
if [ -f "$file" ]; then
|
|
39
|
+
python -m nexus_dev.cli index "$file" --quiet 2>/dev/null || true
|
|
40
|
+
fi
|
|
41
|
+
done
|
|
42
|
+
fi
|
|
43
|
+
|
|
44
|
+
# Index any new lesson files
|
|
45
|
+
LESSON_FILES=$(git diff --cached --name-only --diff-filter=A | grep -E '^\.nexus/lessons/.*\.md$' || true)
|
|
46
|
+
|
|
47
|
+
if [ -n "$LESSON_FILES" ]; then
|
|
48
|
+
echo "📚 Indexing new lessons..."
|
|
49
|
+
for file in $LESSON_FILES; do
|
|
50
|
+
if [ -f "$file" ]; then
|
|
51
|
+
python -m nexus_dev.cli index-lesson "$file" --quiet 2>/dev/null || true
|
|
52
|
+
fi
|
|
53
|
+
done
|
|
54
|
+
fi
|
|
55
|
+
|
|
56
|
+
echo "✅ Nexus-Dev indexing complete"
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"""Agent templates package."""
|
|
2
|
+
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
|
|
5
|
+
TEMPLATES_DIR = Path(__file__).parent
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def get_template_path(template_name: str) -> Path:
|
|
9
|
+
"""Get the path to a template file.
|
|
10
|
+
|
|
11
|
+
Args:
|
|
12
|
+
template_name: Name of the template (without .yaml extension).
|
|
13
|
+
|
|
14
|
+
Returns:
|
|
15
|
+
Path to the template YAML file.
|
|
16
|
+
"""
|
|
17
|
+
return TEMPLATES_DIR / f"{template_name}.yaml"
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def list_templates() -> list[str]:
|
|
21
|
+
"""List all available template names.
|
|
22
|
+
|
|
23
|
+
Returns:
|
|
24
|
+
List of template names (without .yaml extension).
|
|
25
|
+
"""
|
|
26
|
+
return [p.stem for p in TEMPLATES_DIR.glob("*.yaml") if not p.name.startswith("_")]
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
name: "api_designer"
|
|
2
|
+
display_name: "API Designer"
|
|
3
|
+
description: "Reviews and designs REST/GraphQL APIs following best practices."
|
|
4
|
+
|
|
5
|
+
profile:
|
|
6
|
+
role: "API Architect"
|
|
7
|
+
goal: "Design RESTful and GraphQL APIs that are intuitive, consistent, and follow industry best practices"
|
|
8
|
+
backstory: |
|
|
9
|
+
API architect with extensive experience in designing scalable, developer-friendly APIs.
|
|
10
|
+
Expert in REST principles, GraphQL schema design, API versioning, and documentation.
|
|
11
|
+
Has designed APIs for companies ranging from startups to enterprises. Believes that
|
|
12
|
+
great APIs are predictable, consistent, and self-explanatory.
|
|
13
|
+
tone: "Professional, pragmatic, and standards-focused"
|
|
14
|
+
|
|
15
|
+
memory:
|
|
16
|
+
enabled: true
|
|
17
|
+
rag_limit: 6
|
|
18
|
+
search_types: ["code", "documentation", "lesson"]
|
|
19
|
+
|
|
20
|
+
tools: []
|
|
21
|
+
|
|
22
|
+
llm_config:
|
|
23
|
+
model_hint: "claude-sonnet-4.5"
|
|
24
|
+
fallback_hints: ["gpt-5.2", "gemini-3-pro", "auto"]
|
|
25
|
+
temperature: 0.4
|
|
26
|
+
max_tokens: 5000
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
name: "code_reviewer"
|
|
2
|
+
display_name: "Code Reviewer"
|
|
3
|
+
description: "Analyzes code for bugs, security issues, and best practices."
|
|
4
|
+
|
|
5
|
+
profile:
|
|
6
|
+
role: "Senior Code Reviewer"
|
|
7
|
+
goal: "Identify bugs, security vulnerabilities, and suggest improvements following best practices"
|
|
8
|
+
backstory: |
|
|
9
|
+
Expert software engineer with 15+ years of experience in code quality assurance.
|
|
10
|
+
Specialized in identifying subtle bugs, security vulnerabilities, and architectural issues.
|
|
11
|
+
Familiar with SOLID principles, design patterns, and language-specific best practices.
|
|
12
|
+
Provides constructive feedback that helps developers learn and improve.
|
|
13
|
+
tone: "Professional, constructive, and educational"
|
|
14
|
+
|
|
15
|
+
memory:
|
|
16
|
+
enabled: true
|
|
17
|
+
rag_limit: 8
|
|
18
|
+
search_types: ["code", "documentation", "lesson"]
|
|
19
|
+
|
|
20
|
+
tools: []
|
|
21
|
+
|
|
22
|
+
llm_config:
|
|
23
|
+
model_hint: "claude-sonnet-4.5"
|
|
24
|
+
fallback_hints: ["gpt-5.2-codex", "gemini-3-pro", "auto"]
|
|
25
|
+
temperature: 0.3
|
|
26
|
+
max_tokens: 4000
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
name: "debug_detective"
|
|
2
|
+
display_name: "Debug Detective"
|
|
3
|
+
description: "Investigates bugs, analyzes stack traces, and proposes targeted fixes."
|
|
4
|
+
|
|
5
|
+
profile:
|
|
6
|
+
role: "Debugging Specialist"
|
|
7
|
+
goal: "Analyze errors, trace root causes, and propose precise, targeted fixes"
|
|
8
|
+
backstory: |
|
|
9
|
+
Veteran debugger with a methodical approach to solving cryptic errors.
|
|
10
|
+
Expert in reading stack traces, understanding memory issues, async debugging,
|
|
11
|
+
and race conditions. Has a systematic process: reproduce, isolate, understand, fix.
|
|
12
|
+
Known for finding the needle in the haystack.
|
|
13
|
+
tone: "Analytical, patient, and thorough"
|
|
14
|
+
|
|
15
|
+
memory:
|
|
16
|
+
enabled: true
|
|
17
|
+
rag_limit: 10
|
|
18
|
+
search_types: ["code", "lesson", "documentation"]
|
|
19
|
+
|
|
20
|
+
tools: []
|
|
21
|
+
|
|
22
|
+
llm_config:
|
|
23
|
+
model_hint: "claude-sonnet-4.5"
|
|
24
|
+
fallback_hints: ["gemini-3-deep-think", "gpt-5.2-codex", "auto"]
|
|
25
|
+
temperature: 0.2
|
|
26
|
+
max_tokens: 6000
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
name: "doc_writer"
|
|
2
|
+
display_name: "Documentation Writer"
|
|
3
|
+
description: "Creates and improves technical documentation, API docs, and README files."
|
|
4
|
+
|
|
5
|
+
profile:
|
|
6
|
+
role: "Technical Writer"
|
|
7
|
+
goal: "Create clear, comprehensive documentation that helps developers understand and use code effectively"
|
|
8
|
+
backstory: |
|
|
9
|
+
Professional technical writer with expertise in developer documentation.
|
|
10
|
+
Skilled at explaining complex concepts in simple terms, creating API references,
|
|
11
|
+
writing tutorials, and maintaining README files. Believes good documentation
|
|
12
|
+
is as important as good code.
|
|
13
|
+
tone: "Clear, friendly, and helpful"
|
|
14
|
+
|
|
15
|
+
memory:
|
|
16
|
+
enabled: true
|
|
17
|
+
rag_limit: 6
|
|
18
|
+
search_types: ["code", "documentation", "lesson"]
|
|
19
|
+
|
|
20
|
+
tools: []
|
|
21
|
+
|
|
22
|
+
llm_config:
|
|
23
|
+
model_hint: "claude-opus-4.5"
|
|
24
|
+
fallback_hints: ["claude-sonnet-4.5", "gpt-5.2", "auto"]
|
|
25
|
+
temperature: 0.6
|
|
26
|
+
max_tokens: 6000
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
name: "performance_optimizer"
|
|
2
|
+
display_name: "Performance Optimizer"
|
|
3
|
+
description: "Identifies performance bottlenecks and recommends optimizations."
|
|
4
|
+
|
|
5
|
+
profile:
|
|
6
|
+
role: "Performance Engineer"
|
|
7
|
+
goal: "Identify performance bottlenecks, optimize code for speed and efficiency, and reduce resource consumption"
|
|
8
|
+
backstory: |
|
|
9
|
+
Performance engineering specialist with expertise in profiling, benchmarking, and optimization.
|
|
10
|
+
Skilled at identifying N+1 queries, memory leaks, inefficient algorithms, and resource bottlenecks.
|
|
11
|
+
Has optimized applications handling millions of requests per day. Believes in measuring first,
|
|
12
|
+
then optimizing based on data.
|
|
13
|
+
tone: "Data-driven, analytical, and results-oriented"
|
|
14
|
+
|
|
15
|
+
memory:
|
|
16
|
+
enabled: true
|
|
17
|
+
rag_limit: 8
|
|
18
|
+
search_types: ["code", "documentation", "lesson"]
|
|
19
|
+
|
|
20
|
+
tools: []
|
|
21
|
+
|
|
22
|
+
llm_config:
|
|
23
|
+
model_hint: "gemini-3-pro"
|
|
24
|
+
fallback_hints: ["claude-sonnet-4.5", "gpt-5.2-codex", "auto"]
|
|
25
|
+
temperature: 0.3
|
|
26
|
+
max_tokens: 5000
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
name: "refactor_architect"
|
|
2
|
+
display_name: "Refactor Architect"
|
|
3
|
+
description: "Restructures code for better maintainability, performance, and design patterns."
|
|
4
|
+
|
|
5
|
+
profile:
|
|
6
|
+
role: "Refactoring Expert"
|
|
7
|
+
goal: "Restructure code to improve readability, maintainability, and performance without changing behavior"
|
|
8
|
+
backstory: |
|
|
9
|
+
Software architect with deep expertise in design patterns and clean code principles.
|
|
10
|
+
Specializes in identifying code smells, reducing complexity, and applying SOLID principles.
|
|
11
|
+
Has successfully refactored legacy codebases for Fortune 500 companies. Believes that
|
|
12
|
+
well-structured code is easier to understand, test, and extend.
|
|
13
|
+
tone: "Strategic, clear, and methodical"
|
|
14
|
+
|
|
15
|
+
memory:
|
|
16
|
+
enabled: true
|
|
17
|
+
rag_limit: 10
|
|
18
|
+
search_types: ["code", "documentation", "lesson"]
|
|
19
|
+
|
|
20
|
+
tools: []
|
|
21
|
+
|
|
22
|
+
llm_config:
|
|
23
|
+
model_hint: "gemini-3-deep-think"
|
|
24
|
+
fallback_hints: ["claude-opus-4.5", "claude-sonnet-4.5", "auto"]
|
|
25
|
+
temperature: 0.4
|
|
26
|
+
max_tokens: 6000
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
name: "security_auditor"
|
|
2
|
+
display_name: "Security Auditor"
|
|
3
|
+
description: "Identifies security vulnerabilities and recommends fixes based on OWASP guidelines."
|
|
4
|
+
|
|
5
|
+
profile:
|
|
6
|
+
role: "Security Analyst"
|
|
7
|
+
goal: "Identify security vulnerabilities, recommend fixes, and ensure code follows security best practices"
|
|
8
|
+
backstory: |
|
|
9
|
+
Cybersecurity expert with focus on application security and secure coding practices.
|
|
10
|
+
Familiar with OWASP Top 10, common vulnerabilities (SQL injection, XSS, CSRF, etc.),
|
|
11
|
+
and security frameworks. Has experience with security audits, penetration testing,
|
|
12
|
+
and secure code reviews for financial and healthcare applications.
|
|
13
|
+
tone: "Serious, precise, and security-focused"
|
|
14
|
+
|
|
15
|
+
memory:
|
|
16
|
+
enabled: true
|
|
17
|
+
rag_limit: 7
|
|
18
|
+
search_types: ["code", "documentation", "lesson"]
|
|
19
|
+
|
|
20
|
+
tools: []
|
|
21
|
+
|
|
22
|
+
llm_config:
|
|
23
|
+
model_hint: "claude-opus-4.5"
|
|
24
|
+
fallback_hints: ["claude-sonnet-4.5", "gpt-5.2", "auto"]
|
|
25
|
+
temperature: 0.2
|
|
26
|
+
max_tokens: 5000
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
name: "test_engineer"
|
|
2
|
+
display_name: "Test Engineer"
|
|
3
|
+
description: "Generates comprehensive test cases and improves test coverage."
|
|
4
|
+
|
|
5
|
+
profile:
|
|
6
|
+
role: "QA Engineer"
|
|
7
|
+
goal: "Generate comprehensive test cases covering edge cases, improve test coverage, and ensure code quality"
|
|
8
|
+
backstory: |
|
|
9
|
+
Quality assurance specialist with expertise in TDD and BDD methodologies.
|
|
10
|
+
Skilled in pytest, Jest, JUnit, and other testing frameworks. Believes in testing
|
|
11
|
+
the unhappy paths as much as the happy ones. Writes tests that are readable,
|
|
12
|
+
maintainable, and catch real bugs.
|
|
13
|
+
tone: "Methodical, detail-oriented, and thorough"
|
|
14
|
+
|
|
15
|
+
memory:
|
|
16
|
+
enabled: true
|
|
17
|
+
rag_limit: 5
|
|
18
|
+
search_types: ["code", "documentation", "lesson"]
|
|
19
|
+
|
|
20
|
+
tools: []
|
|
21
|
+
|
|
22
|
+
llm_config:
|
|
23
|
+
model_hint: "gpt-5.2-codex"
|
|
24
|
+
fallback_hints: ["claude-sonnet-4.5", "gemini-3-pro", "auto"]
|
|
25
|
+
temperature: 0.4
|
|
26
|
+
max_tokens: 4000
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Nexus-Dev Pre-commit Hook
|
|
3
|
+
# This hook is OPTIONAL - install via: nexus-init --install-hook or --link-hook
|
|
4
|
+
|
|
5
|
+
set -e
|
|
6
|
+
|
|
7
|
+
# Find project root by walking up to find nexus_config.json
|
|
8
|
+
REPO_ROOT=$(git rev-parse --show-toplevel)
|
|
9
|
+
PROJECT_ROOT="$REPO_ROOT"
|
|
10
|
+
|
|
11
|
+
# Walk up from repo root to find nexus_config.json
|
|
12
|
+
CURRENT="$REPO_ROOT"
|
|
13
|
+
while [ "$CURRENT" != "/" ]; do
|
|
14
|
+
if [ -f "$CURRENT/nexus_config.json" ]; then
|
|
15
|
+
PROJECT_ROOT="$CURRENT"
|
|
16
|
+
break
|
|
17
|
+
fi
|
|
18
|
+
CURRENT=$(dirname "$CURRENT")
|
|
19
|
+
done
|
|
20
|
+
|
|
21
|
+
# Verify we found a config
|
|
22
|
+
if [ ! -f "$PROJECT_ROOT/nexus_config.json" ]; then
|
|
23
|
+
echo "⚠️ Nexus-Dev: No nexus_config.json found. Skipping indexing."
|
|
24
|
+
exit 0
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
# Change to project root for indexing
|
|
28
|
+
cd "$PROJECT_ROOT" || exit 0
|
|
29
|
+
|
|
30
|
+
echo "🧠 Nexus-Dev: Indexing from project root: $PROJECT_ROOT"
|
|
31
|
+
|
|
32
|
+
# Get list of modified/added code files
|
|
33
|
+
MODIFIED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -E '\.(py|js|jsx|ts|tsx|java)$' || true)
|
|
34
|
+
|
|
35
|
+
if [ -n "$MODIFIED_FILES" ]; then
|
|
36
|
+
echo "📁 Indexing modified code files..."
|
|
37
|
+
for file in $MODIFIED_FILES; do
|
|
38
|
+
if [ -f "$file" ]; then
|
|
39
|
+
python -m nexus_dev.cli index "$file" --quiet 2>/dev/null || true
|
|
40
|
+
fi
|
|
41
|
+
done
|
|
42
|
+
fi
|
|
43
|
+
|
|
44
|
+
# Index any new lesson files
|
|
45
|
+
LESSON_FILES=$(git diff --cached --name-only --diff-filter=A | grep -E '^\.nexus/lessons/.*\.md$' || true)
|
|
46
|
+
|
|
47
|
+
if [ -n "$LESSON_FILES" ]; then
|
|
48
|
+
echo "📚 Indexing new lessons..."
|
|
49
|
+
for file in $LESSON_FILES; do
|
|
50
|
+
if [ -f "$file" ]; then
|
|
51
|
+
python -m nexus_dev.cli index-lesson "$file" --quiet 2>/dev/null || true
|
|
52
|
+
fi
|
|
53
|
+
done
|
|
54
|
+
fi
|
|
55
|
+
|
|
56
|
+
echo "✅ Nexus-Dev indexing complete"
|