nexus-agent-framework 0.1.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.
Files changed (92) hide show
  1. nexus_agent_framework-0.1.0/.github/workflows/ci.yml +78 -0
  2. nexus_agent_framework-0.1.0/.github/workflows/release.yml +98 -0
  3. nexus_agent_framework-0.1.0/.gitignore +56 -0
  4. nexus_agent_framework-0.1.0/PKG-INFO +201 -0
  5. nexus_agent_framework-0.1.0/README.md +178 -0
  6. nexus_agent_framework-0.1.0/apps/showcase/backend/.gcloudignore +7 -0
  7. nexus_agent_framework-0.1.0/apps/showcase/backend/Dockerfile +23 -0
  8. nexus_agent_framework-0.1.0/apps/showcase/backend/pyproject.toml +24 -0
  9. nexus_agent_framework-0.1.0/apps/showcase/backend/src/__init__.py +1 -0
  10. nexus_agent_framework-0.1.0/apps/showcase/backend/src/backend_models.py +2 -0
  11. nexus_agent_framework-0.1.0/apps/showcase/backend/src/main.py +72 -0
  12. nexus_agent_framework-0.1.0/apps/showcase/backend/src/models.py +37 -0
  13. nexus_agent_framework-0.1.0/apps/showcase/backend/src/static/index.html +286 -0
  14. nexus_agent_framework-0.1.0/apps/showcase/backend/tests/test_api.py +39 -0
  15. nexus_agent_framework-0.1.0/apps/showcase/deploy.ps1 +30 -0
  16. nexus_agent_framework-0.1.0/apps/showcase/deploy.sh +29 -0
  17. nexus_agent_framework-0.1.0/apps/showcase/docker-compose.yml +25 -0
  18. nexus_agent_framework-0.1.0/apps/showcase/docs/ARCHITECTURE.md +23 -0
  19. nexus_agent_framework-0.1.0/apps/showcase/frontend/package.json +24 -0
  20. nexus_agent_framework-0.1.0/apps/showcase/frontend/src/App.tsx +193 -0
  21. nexus_agent_framework-0.1.0/apps/showcase/infra/terraform/main.tf +43 -0
  22. nexus_agent_framework-0.1.0/apps/showcase/infra/terraform/variables.tf +17 -0
  23. nexus_agent_framework-0.1.0/examples/custom_it_squad.py +35 -0
  24. nexus_agent_framework-0.1.0/examples/mcp_config/claude_desktop_config.json +11 -0
  25. nexus_agent_framework-0.1.0/examples/mcp_config/cursor_mcp.json +11 -0
  26. nexus_agent_framework-0.1.0/examples/quickstart_agent.py +39 -0
  27. nexus_agent_framework-0.1.0/infra/terraform/modules/nexus_app/main.tf +75 -0
  28. nexus_agent_framework-0.1.0/infra/terraform/modules/nexus_cloud_run/main.tf +117 -0
  29. nexus_agent_framework-0.1.0/infra/terraform/modules/nexus_vm/main.tf +142 -0
  30. nexus_agent_framework-0.1.0/package-lock.json +2774 -0
  31. nexus_agent_framework-0.1.0/package.json +35 -0
  32. nexus_agent_framework-0.1.0/pnpm-workspace.yaml +4 -0
  33. nexus_agent_framework-0.1.0/pyproject.toml +57 -0
  34. nexus_agent_framework-0.1.0/src/nexus/__init__.py +3 -0
  35. nexus_agent_framework-0.1.0/src/nexus/__main__.py +4 -0
  36. nexus_agent_framework-0.1.0/src/nexus/agents/__init__.py +6 -0
  37. nexus_agent_framework-0.1.0/src/nexus/agents/base.py +93 -0
  38. nexus_agent_framework-0.1.0/src/nexus/agents/context.py +45 -0
  39. nexus_agent_framework-0.1.0/src/nexus/ai/__init__.py +18 -0
  40. nexus_agent_framework-0.1.0/src/nexus/ai/client.py +390 -0
  41. nexus_agent_framework-0.1.0/src/nexus/ai/pricing.py +28 -0
  42. nexus_agent_framework-0.1.0/src/nexus/api/__init__.py +14 -0
  43. nexus_agent_framework-0.1.0/src/nexus/api/app.py +119 -0
  44. nexus_agent_framework-0.1.0/src/nexus/api/middleware.py +33 -0
  45. nexus_agent_framework-0.1.0/src/nexus/cli/__init__.py +5 -0
  46. nexus_agent_framework-0.1.0/src/nexus/cli/__main__.py +4 -0
  47. nexus_agent_framework-0.1.0/src/nexus/cli/main.py +324 -0
  48. nexus_agent_framework-0.1.0/src/nexus/dashboard/__init__.py +17 -0
  49. nexus_agent_framework-0.1.0/src/nexus/dashboard/server.py +377 -0
  50. nexus_agent_framework-0.1.0/src/nexus/dashboard/telemetry.py +92 -0
  51. nexus_agent_framework-0.1.0/src/nexus/database/__init__.py +5 -0
  52. nexus_agent_framework-0.1.0/src/nexus/db/__init__.py +14 -0
  53. nexus_agent_framework-0.1.0/src/nexus/db/base.py +37 -0
  54. nexus_agent_framework-0.1.0/src/nexus/db/session.py +51 -0
  55. nexus_agent_framework-0.1.0/src/nexus/maintenance/__init__.py +5 -0
  56. nexus_agent_framework-0.1.0/src/nexus/maintenance/healer.py +38 -0
  57. nexus_agent_framework-0.1.0/src/nexus/orchestrator/__init__.py +6 -0
  58. nexus_agent_framework-0.1.0/src/nexus/orchestrator/mcp.py +112 -0
  59. nexus_agent_framework-0.1.0/src/nexus/orchestrator/protocol.py +54 -0
  60. nexus_agent_framework-0.1.0/src/nexus/providers/__init__.py +7 -0
  61. nexus_agent_framework-0.1.0/src/nexus/providers/base.py +77 -0
  62. nexus_agent_framework-0.1.0/src/nexus/providers/mock.py +85 -0
  63. nexus_agent_framework-0.1.0/src/nexus/providers/vertex.py +91 -0
  64. nexus_agent_framework-0.1.0/src/nexus/qa/__init__.py +5 -0
  65. nexus_agent_framework-0.1.0/src/nexus/qa/judge.py +38 -0
  66. nexus_agent_framework-0.1.0/src/nexus/scraping/__init__.py +5 -0
  67. nexus_agent_framework-0.1.0/src/nexus/scraping/client.py +86 -0
  68. nexus_agent_framework-0.1.0/src/nexus/security/__init__.py +12 -0
  69. nexus_agent_framework-0.1.0/src/nexus/security/guardrail.py +45 -0
  70. nexus_agent_framework-0.1.0/src/nexus/security/injection.py +32 -0
  71. nexus_agent_framework-0.1.0/src/nexus/security/sanitizer.py +25 -0
  72. nexus_agent_framework-0.1.0/src/nexus/teams/__init__.py +5 -0
  73. nexus_agent_framework-0.1.0/src/nexus/teams/it_pack/__init__.py +32 -0
  74. nexus_agent_framework-0.1.0/src/nexus/teams/it_pack/ba.py +48 -0
  75. nexus_agent_framework-0.1.0/src/nexus/teams/it_pack/data_architect.py +45 -0
  76. nexus_agent_framework-0.1.0/src/nexus/teams/it_pack/designer.py +43 -0
  77. nexus_agent_framework-0.1.0/src/nexus/teams/it_pack/devops.py +53 -0
  78. nexus_agent_framework-0.1.0/src/nexus/teams/it_pack/engineer.py +41 -0
  79. nexus_agent_framework-0.1.0/src/nexus/teams/it_pack/fullstack.py +65 -0
  80. nexus_agent_framework-0.1.0/src/nexus/teams/it_pack/manager.py +55 -0
  81. nexus_agent_framework-0.1.0/src/nexus/teams/it_pack/qa.py +56 -0
  82. nexus_agent_framework-0.1.0/src/nexus/teams/it_pack/solution_architect.py +60 -0
  83. nexus_agent_framework-0.1.0/src/nexus/teams/it_pack/team.py +422 -0
  84. nexus_agent_framework-0.1.0/src/nexus/tools/__init__.py +5 -0
  85. nexus_agent_framework-0.1.0/src/nexus/tools/base.py +82 -0
  86. nexus_agent_framework-0.1.0/tests/test_agentic.py +130 -0
  87. nexus_agent_framework-0.1.0/tests/test_dashboard.py +48 -0
  88. nexus_agent_framework-0.1.0/tests/test_it_pack.py +125 -0
  89. nexus_agent_framework-0.1.0/tests/test_nexus.py +113 -0
  90. nexus_agent_framework-0.1.0/tests/test_orchestrator.py +66 -0
  91. nexus_agent_framework-0.1.0/tsconfig.base.json +15 -0
  92. nexus_agent_framework-0.1.0/turbo.json +14 -0
@@ -0,0 +1,78 @@
1
+ name: Nexus CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ test-python:
11
+ name: Python Test Suite & Wheel Build
12
+ runs-on: ubuntu-latest
13
+ strategy:
14
+ matrix:
15
+ python-version: ["3.11", "3.12"]
16
+
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+
20
+ - name: Set up Python ${{ matrix.python-version }}
21
+ uses: actions/setup-python@v5
22
+ with:
23
+ python-version: ${{ matrix.python-version }}
24
+ cache: "pip"
25
+
26
+ - name: Install dependencies
27
+ run: |
28
+ python -m pip install --upgrade pip
29
+ pip install -e .[dev] build pytest-cov
30
+
31
+ - name: Run Ruff Lint & Format Check
32
+ run: |
33
+ ruff check src/ tests/
34
+ ruff format --check src/ tests/
35
+
36
+ - name: Run Mypy Type Check
37
+ run: |
38
+ mypy src/ tests/
39
+
40
+ - name: Run Pytest Suite with Coverage
41
+ run: |
42
+ pytest --cov=src -o pythonpath=src tests/
43
+
44
+ - name: Run Showcase App Tests
45
+ run: |
46
+ cd apps/showcase/backend && pytest tests/
47
+
48
+ - name: Validate Package Build (sdist & wheel)
49
+ run: |
50
+ python -m build
51
+
52
+ build-packages:
53
+ name: Monorepo TypeScript Packages Build
54
+ runs-on: ubuntu-latest
55
+
56
+ steps:
57
+ - uses: actions/checkout@v4
58
+
59
+ - name: Set up Node.js
60
+ uses: actions/setup-node@v4
61
+ with:
62
+ node-version: 20
63
+
64
+ - name: Install TypeScript & React Types
65
+ run: |
66
+ npm install --no-save typescript @types/react @types/react-dom
67
+
68
+ - name: Compile @nexus/contracts
69
+ run: npx tsc -p packages/contracts
70
+
71
+ - name: Compile @nexus/middleware
72
+ run: npx tsc -p packages/middleware
73
+
74
+ - name: Compile @nexus/scraper
75
+ run: npx tsc -p packages/scraper
76
+
77
+ - name: Compile @nexus/ui
78
+ run: npx tsc -p packages/ui
@@ -0,0 +1,98 @@
1
+ name: Release & Package Distribution
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+ push:
7
+ tags:
8
+ - "v*.*.*"
9
+
10
+ permissions:
11
+ contents: write
12
+ packages: write
13
+ id-token: write
14
+
15
+ jobs:
16
+ build-and-publish-python:
17
+ name: Build & Publish Python Wheel (nexus-framework)
18
+ runs-on: ubuntu-latest
19
+
20
+ steps:
21
+ - name: Checkout source code
22
+ uses: actions/checkout@v4
23
+
24
+ - name: Set up Python
25
+ uses: actions/setup-python@v5
26
+ with:
27
+ python-version: "3.12"
28
+ cache: "pip"
29
+
30
+ - name: Install build tools & twine
31
+ run: |
32
+ python -m pip install --upgrade pip
33
+ pip install build twine
34
+
35
+ - name: Build sdist and wheel
36
+ run: |
37
+ python -m build
38
+
39
+ - name: Verify package distributions
40
+ run: |
41
+ twine check dist/*
42
+
43
+ - name: Upload artifacts to GitHub Release
44
+ uses: softprops/action-gh-release@v2
45
+ if: startsWith(github.ref, 'refs/tags/v')
46
+ with:
47
+ files: |
48
+ dist/*.whl
49
+ dist/*.tar.gz
50
+ env:
51
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52
+
53
+ - name: Publish to PyPI
54
+ if: startsWith(github.ref, 'refs/tags/v') && env.HAVE_PYPI_TOKEN == 'true'
55
+ uses: pypa/gh-action-pypi-publish@release/v1
56
+ with:
57
+ packages-dir: dist/
58
+ skip-existing: true
59
+ env:
60
+ HAVE_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN != '' }}
61
+
62
+ build-and-publish-npm:
63
+ name: Build & Publish TypeScript Packages (@nexus/*)
64
+ runs-on: ubuntu-latest
65
+
66
+ steps:
67
+ - name: Checkout source code
68
+ uses: actions/checkout@v4
69
+
70
+ - name: Set up Node.js
71
+ uses: actions/setup-node@v4
72
+ with:
73
+ node-version: 20
74
+ registry-url: "https://registry.npmjs.org"
75
+
76
+ - name: Install TypeScript and type definitions
77
+ run: |
78
+ npm install --no-save typescript @types/react @types/react-dom
79
+
80
+ - name: Compile all monorepo packages
81
+ run: |
82
+ npx tsc -p packages/contracts
83
+ npx tsc -p packages/middleware
84
+ npx tsc -p packages/scraper
85
+ npx tsc -p packages/ui
86
+
87
+ - name: Publish @nexus/* to NPM Registry
88
+ if: startsWith(github.ref, 'refs/tags/v') && env.HAVE_NPM_TOKEN == 'true'
89
+ run: |
90
+ for pkg in contracts middleware scraper ui; do
91
+ echo "Publishing packages/$pkg..."
92
+ cd packages/$pkg
93
+ npm publish --access public || echo "Skipping $pkg or already published"
94
+ cd ../..
95
+ done
96
+ env:
97
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
98
+ HAVE_NPM_TOKEN: ${{ secrets.NPM_TOKEN != '' }}
@@ -0,0 +1,56 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ env/
8
+ build/
9
+ develop-eggs/
10
+ dist/
11
+ downloads/
12
+ eggs/
13
+ .eggs/
14
+ lib/
15
+ lib64/
16
+ parts/
17
+ sdist/
18
+ var/
19
+ wheels/
20
+ *.egg-info/
21
+ .installed.cfg
22
+ *.egg
23
+ .venv/
24
+ venv/
25
+ ENV/
26
+
27
+ # Testing & Coverage
28
+ .coverage
29
+ htmlcov/
30
+ .pytest_cache/
31
+ .mypy_cache/
32
+ .ruff_cache/
33
+
34
+ # Node / Frontend
35
+ node_modules/
36
+ dist/
37
+ .turbo/
38
+
39
+ # Environment & Secrets
40
+ .env
41
+ *.env.local
42
+ secrets/
43
+ *.pem
44
+ *.key
45
+
46
+ # IDE
47
+ .vscode/
48
+ .idea/
49
+ *.swp
50
+ *.swo
51
+
52
+ # Terraform
53
+ .terraform/
54
+ *.tfstate
55
+ *.tfstate.backup
56
+ .terraform.lock.hcl
@@ -0,0 +1,201 @@
1
+ Metadata-Version: 2.5
2
+ Name: nexus-agent-framework
3
+ Version: 0.1.0
4
+ Summary: Autonomous Application & Platform Framework for Google Cloud and Gemini 3.8
5
+ Author-email: Sai Nikhil Abburi <sai.nikhil@abburi.info>
6
+ Requires-Python: >=3.11
7
+ Requires-Dist: asyncpg>=0.29.0
8
+ Requires-Dist: fastapi>=0.111.0
9
+ Requires-Dist: httpx>=0.27.0
10
+ Requires-Dist: pydantic-settings>=2.2.0
11
+ Requires-Dist: pydantic>=2.7.0
12
+ Requires-Dist: rich>=13.7.0
13
+ Requires-Dist: sqlalchemy[asyncio]>=2.0.30
14
+ Requires-Dist: typer>=0.12.0
15
+ Requires-Dist: uvicorn>=0.30.0
16
+ Provides-Extra: dev
17
+ Requires-Dist: mypy>=1.10.0; extra == 'dev'
18
+ Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
19
+ Requires-Dist: pytest-mock>=3.14.0; extra == 'dev'
20
+ Requires-Dist: pytest>=8.0.0; extra == 'dev'
21
+ Requires-Dist: ruff>=0.4.0; extra == 'dev'
22
+ Description-Content-Type: text/markdown
23
+
24
+ # Nexus: Orchestrator-Native AI Agentic Framework
25
+
26
+ > The **AI Agentic Framework** that equips non-technical creators with a full virtual IT department while interfacing natively with **Claude Code, Cursor, Codex, and Gemini** via the Model Context Protocol (MCP).
27
+
28
+ Nexus bridges the gap between raw ideas and production code. It serves two distinct developer cohorts:
29
+ 1. **Beginners with Ideas**: Run `nexus dream "<vague idea>"` and the **Core IT Pack** (BA, Solution Architect, Data Architect, UI/UX Designer, Full-Stack Engineer, DevOps Engineer, and QA) takes the idea, designs the UI mockup, normalizes the relational schema, writes the full-stack code, generates Terraform IaC, and runs automated tests.
30
+ 2. **AI Orchestrator Users (Claude Code, Cursor, Codex, Gemini)**: Run `nexus mcp` to expose your agents, tools, databases, and guardrails to any modern AI IDE as first-class, equal participants.
31
+
32
+ ---
33
+
34
+ ## 🚀 Quickstart & Installation
35
+
36
+ ```bash
37
+ pip install nexus-agent-framework
38
+ ```
39
+
40
+ ---
41
+
42
+ ## 🏛️ The Nexus Core IT Pack
43
+
44
+ Nexus comes pre-packaged with an autonomous IT squad that simulates a real-world software engineering organization:
45
+
46
+ ```mermaid
47
+ flowchart TD
48
+ User["Creator with an Idea<br/>(Vague Requirements)"] --> BA["1. Business Analyst<br/>(User Stories & Interactive HTML Mockup)"]
49
+ BA --> SA["2. Solution Architect<br/>(System Topology & Cloud Choice)"]
50
+ SA --> DA["3. Data Architect<br/>(ERD & SQL DDL Schema)"]
51
+ DA --> Design["4. UI/UX Designer<br/>(Design Tokens & Component Specs)"]
52
+ Design & DA --> FS["5. Full-Stack Engineer<br/>(React UI + FastAPI Backend)"]
53
+ SA & DA --> DevOps["6. DevOps Engineer<br/>(Terraform IaC for target cloud)"]
54
+ FS & DevOps --> QA["7. QA & Security Engineer<br/>(Preflight Guardrails & Test Suite)"]
55
+ QA --> Repo["Delivered Application Workspace<br/>(Runnable Full-Stack Project on Disk)"]
56
+ ```
57
+
58
+ ### 1. Business Analyst (`BusinessAnalystAgent`)
59
+ Takes conversational, incomplete user thoughts and formats them into a crisp **Product Proposal**:
60
+ - Canonical app slug & value proposition tagline.
61
+ - User stories (`As a [user], I want to [action] so that [benefit]`).
62
+ - Core features specification & interactive HTML wireframe preview (`docs/preview_mockup.html`).
63
+
64
+ ### 2. Solution Architect (`SolutionArchitectAgent`)
65
+ Evaluates holistic system design, integration boundaries, and non-functional requirements:
66
+ - Selects the cloud runtime strategy (GCP, AWS, or Local).
67
+ - Defines compute model (Cloud Run serverless container vs Always-Free VM).
68
+ - Details service communication topology and latency budgets.
69
+
70
+ ### 3. Data Architect (`DataArchitectAgent`)
71
+ Designs the relational and persistence architecture:
72
+ - Normalizes tables, foreign keys, and indexes.
73
+ - Emits clean, production-ready PostgreSQL SQL DDL schemas (`docs/DATA_ARCHITECTURE.md`).
74
+
75
+ ### 4. UI/UX Designer (`UiDesignerAgent`)
76
+ Focuses on user journey, design tokens, and interactive mockups styled with Tailwind CSS and `@nexus/ui`.
77
+
78
+ ### 5. Full-Stack Engineer (`FullStackEngineerAgent`)
79
+ Implements the unified end-to-end codebase:
80
+ - Production-grade FastAPI microservice with Gemini 3.8 client (`backend/src/main.py`).
81
+ - Pydantic models & SQLAlchemy entity definitions (`backend/src/models.py`).
82
+ - React frontend consuming the API endpoints (`frontend/src/App.tsx`).
83
+
84
+ ### 6. DevOps Engineer (`DevopsEngineerAgent`)
85
+ Generates real Infrastructure as Code (IaC) tailored to the architectural need and selected cloud:
86
+ - Complete Terraform `main.tf` and `variables.tf` (e.g. Cloud Run, IAM `roles/aiplatform.user`, Secret Manager).
87
+ - Multi-container `docker-compose.yml` for local development.
88
+ - GitHub Actions CI/CD deployment pipeline (`.github/workflows/deploy.yml`).
89
+
90
+ ### 7. QA & Security Engineer (`QaEngineerAgent`)
91
+ Inspects implemented backend routes, runs pre-flight security checks (injection shields, permission levels), and produces an executable `pytest` test suite (`backend/tests/test_api.py`) with 100% pre-flight clearance.
92
+
93
+ ---
94
+
95
+ ## 📦 Shared Monorepo Packages (`packages/`)
96
+
97
+ Nexus is structured as a monorepo with universal, reusable packages:
98
+
99
+ | Package | Purpose | Exports / Capabilities |
100
+ | :--- | :--- | :--- |
101
+ | **`@nexus/ui`** | Shared React UI & Design System | `StatCard`, `AiBadge`, `MetricTrend`, `NexusHeader`, `TraceViewer`, `SecurityShieldBadge` |
102
+ | **`@nexus/contracts`** | Universal Spec & Telemetry Contracts | `AgentTelemetryEvent`, `ProductProposalContract`, `SolutionBlueprintContract`, `DataArchitectureContract`, `DevopsSpecificationContract`, `QaSpecificationContract`, `AuditChainEntryContract` |
103
+ | **`@nexus/middleware`** | Security & Scrubbing Middleware | `NEXUS_SECURITY_HEADERS`, `scrubSensitiveData` (zero credential leaks), `generateCorrelationId` |
104
+ | **`@nexus/scraper`** | Ethical & Resilient Scraping | `ScrapedItem`, `DEFAULT_NEXUS_SCRAPING_POLICY`, rate-limit & backoff policy contracts |
105
+
106
+ ### Centralized Terraform Modules (`infra/terraform/modules/`)
107
+ - **`nexus_app`**: Baseline GCP APIs (`aiplatform.googleapis.com`, `secretmanager.googleapis.com`), service accounts, and IAM roles (`roles/aiplatform.user`).
108
+ - **`nexus_cloud_run`**: Auto-scaling serverless Cloud Run container module with HTTPS termination and VPC access.
109
+ - **`nexus_vm`**: Cost-optimized Always-Free Compute Engine VM module with custom VPC, firewall, IAP SSH, and Docker setup.
110
+
111
+ ---
112
+
113
+ ## 🔌 Orchestrator-Native: Claude Code & Cursor Integration
114
+
115
+ Nexus is designed to work as an equal peer alongside **Claude Code, Cursor, Codex, and Gemini CLI**:
116
+
117
+ ```bash
118
+ # Start the Nexus Model Context Protocol (MCP) server
119
+ nexus mcp
120
+ ```
121
+
122
+ ### Connecting from Cursor / Claude Code
123
+ Add Nexus to your `.cursor/mcp.json` or `claude_desktop_config.json`:
124
+ ```json
125
+ {
126
+ "mcpServers": {
127
+ "nexus": {
128
+ "command": "python",
129
+ "args": ["-m", "nexus.cli.main", "mcp"],
130
+ "env": {
131
+ "GCP_PROJECT_ID": "finhub-510316"
132
+ }
133
+ }
134
+ }
135
+ }
136
+ ```
137
+ Instantly, Claude Code or Cursor gains access to all Nexus tools, allowing you to trigger IT squad workflows, check AI connections, or diagnose errors right inside your editor prompt.
138
+
139
+ ---
140
+
141
+ ## 🖥️ Localhost Visualizer & Agent Observability (`nexus ui`)
142
+
143
+ Nexus provides a built-in interactive web visualizer to track your agent squad and execution telemetry in real time:
144
+
145
+ ```bash
146
+ # Launch localhost progress visualizer on http://localhost:8000
147
+ nexus ui
148
+ ```
149
+
150
+ ### Features:
151
+ - **Visual Squad Pipeline**: Live status indicators for each agent (`Idle`, `Active`, `Done ✓`) as tasks move through the 7 specialists.
152
+ - **Real-Time Telemetry Stream**: Server-Sent Events (SSE) feed displaying thoughts, tool calls, and model reasoning.
153
+ - **Cost & Budget Meter**: Live dollar spend tracking (`total_cost_usd`) updated after every inference turn against official Gemini 3.8 pricing.
154
+ - **Live Artifact Inspector**: Read generated Product Proposals, preview interactive HTML wireframes, and inspect React/FastAPI code directly in your browser.
155
+ - **Interactive Launcher**: Trigger new squad builds directly from the web interface.
156
+
157
+ ---
158
+
159
+ ## ⚡ Instant Application Creation: `nexus dream`
160
+
161
+ ```bash
162
+ nexus dream "I want an app that tracks second-hand luxury watches in Europe with price alerts"
163
+ ```
164
+
165
+ Output:
166
+ ```text
167
+ --- Nexus Core IT Squad Activated ---
168
+ Goal: "I want an app that tracks second-hand luxury watches in Europe with price alerts"
169
+ Assignees: Business Analyst, Engineering Manager, UI/UX Designer, Backend Engineer, QA Engineer
170
+
171
+ === Project Delivered! ===
172
+ App: WatchHub (watchhub)
173
+ Tagline: Verified European luxury watch index and real-time deal alerts
174
+ Output Directory: ./watchhub
175
+ Stories: 4 user stories defined
176
+ Cloud Target: GCP (Cloud Run Serverless)
177
+ Data Schema: PostgreSQL 16 (4 tables)
178
+ UI Component: WatchDashboard.tsx
179
+ QA Preflight: PASS (Test suite generated with 100% pre-flight clearance)
180
+ ```
181
+
182
+ ---
183
+
184
+ ## 🛡️ Built-in Cost & Security Guardrails
185
+
186
+ - **Zero Runaway Bills**: `max_budget_usd` spend ceilings on every agent execution context.
187
+ - **Gemini 3.8 Flash Cost Profile**: \$0.075 / \$0.30 per million tokens (cents per month for active squads).
188
+ - **Prompt Injection Defense**: Intercepts jailbreaks (`"ignore all prior instructions"`) before hitting the LLM.
189
+ - **PII & Secret Scrubber**: Redacts API keys (`sk-...`, `ghp-...`) and credentials automatically.
190
+ - **Zero-Cost Mock Engine**: Run the entire IT pack and test suite locally for \$0.00 using `MockProvider`.
191
+
192
+ ---
193
+
194
+ ## 🧪 Verification
195
+
196
+ ```bash
197
+ git clone https://github.com/sabburi1994/nexus.git
198
+ cd nexus
199
+ pytest -o pythonpath=src tests/
200
+ ```
201
+ All 20 unit tests pass cleanly out of the box.
@@ -0,0 +1,178 @@
1
+ # Nexus: Orchestrator-Native AI Agentic Framework
2
+
3
+ > The **AI Agentic Framework** that equips non-technical creators with a full virtual IT department while interfacing natively with **Claude Code, Cursor, Codex, and Gemini** via the Model Context Protocol (MCP).
4
+
5
+ Nexus bridges the gap between raw ideas and production code. It serves two distinct developer cohorts:
6
+ 1. **Beginners with Ideas**: Run `nexus dream "<vague idea>"` and the **Core IT Pack** (BA, Solution Architect, Data Architect, UI/UX Designer, Full-Stack Engineer, DevOps Engineer, and QA) takes the idea, designs the UI mockup, normalizes the relational schema, writes the full-stack code, generates Terraform IaC, and runs automated tests.
7
+ 2. **AI Orchestrator Users (Claude Code, Cursor, Codex, Gemini)**: Run `nexus mcp` to expose your agents, tools, databases, and guardrails to any modern AI IDE as first-class, equal participants.
8
+
9
+ ---
10
+
11
+ ## 🚀 Quickstart & Installation
12
+
13
+ ```bash
14
+ pip install nexus-agent-framework
15
+ ```
16
+
17
+ ---
18
+
19
+ ## 🏛️ The Nexus Core IT Pack
20
+
21
+ Nexus comes pre-packaged with an autonomous IT squad that simulates a real-world software engineering organization:
22
+
23
+ ```mermaid
24
+ flowchart TD
25
+ User["Creator with an Idea<br/>(Vague Requirements)"] --> BA["1. Business Analyst<br/>(User Stories & Interactive HTML Mockup)"]
26
+ BA --> SA["2. Solution Architect<br/>(System Topology & Cloud Choice)"]
27
+ SA --> DA["3. Data Architect<br/>(ERD & SQL DDL Schema)"]
28
+ DA --> Design["4. UI/UX Designer<br/>(Design Tokens & Component Specs)"]
29
+ Design & DA --> FS["5. Full-Stack Engineer<br/>(React UI + FastAPI Backend)"]
30
+ SA & DA --> DevOps["6. DevOps Engineer<br/>(Terraform IaC for target cloud)"]
31
+ FS & DevOps --> QA["7. QA & Security Engineer<br/>(Preflight Guardrails & Test Suite)"]
32
+ QA --> Repo["Delivered Application Workspace<br/>(Runnable Full-Stack Project on Disk)"]
33
+ ```
34
+
35
+ ### 1. Business Analyst (`BusinessAnalystAgent`)
36
+ Takes conversational, incomplete user thoughts and formats them into a crisp **Product Proposal**:
37
+ - Canonical app slug & value proposition tagline.
38
+ - User stories (`As a [user], I want to [action] so that [benefit]`).
39
+ - Core features specification & interactive HTML wireframe preview (`docs/preview_mockup.html`).
40
+
41
+ ### 2. Solution Architect (`SolutionArchitectAgent`)
42
+ Evaluates holistic system design, integration boundaries, and non-functional requirements:
43
+ - Selects the cloud runtime strategy (GCP, AWS, or Local).
44
+ - Defines compute model (Cloud Run serverless container vs Always-Free VM).
45
+ - Details service communication topology and latency budgets.
46
+
47
+ ### 3. Data Architect (`DataArchitectAgent`)
48
+ Designs the relational and persistence architecture:
49
+ - Normalizes tables, foreign keys, and indexes.
50
+ - Emits clean, production-ready PostgreSQL SQL DDL schemas (`docs/DATA_ARCHITECTURE.md`).
51
+
52
+ ### 4. UI/UX Designer (`UiDesignerAgent`)
53
+ Focuses on user journey, design tokens, and interactive mockups styled with Tailwind CSS and `@nexus/ui`.
54
+
55
+ ### 5. Full-Stack Engineer (`FullStackEngineerAgent`)
56
+ Implements the unified end-to-end codebase:
57
+ - Production-grade FastAPI microservice with Gemini 3.8 client (`backend/src/main.py`).
58
+ - Pydantic models & SQLAlchemy entity definitions (`backend/src/models.py`).
59
+ - React frontend consuming the API endpoints (`frontend/src/App.tsx`).
60
+
61
+ ### 6. DevOps Engineer (`DevopsEngineerAgent`)
62
+ Generates real Infrastructure as Code (IaC) tailored to the architectural need and selected cloud:
63
+ - Complete Terraform `main.tf` and `variables.tf` (e.g. Cloud Run, IAM `roles/aiplatform.user`, Secret Manager).
64
+ - Multi-container `docker-compose.yml` for local development.
65
+ - GitHub Actions CI/CD deployment pipeline (`.github/workflows/deploy.yml`).
66
+
67
+ ### 7. QA & Security Engineer (`QaEngineerAgent`)
68
+ Inspects implemented backend routes, runs pre-flight security checks (injection shields, permission levels), and produces an executable `pytest` test suite (`backend/tests/test_api.py`) with 100% pre-flight clearance.
69
+
70
+ ---
71
+
72
+ ## 📦 Shared Monorepo Packages (`packages/`)
73
+
74
+ Nexus is structured as a monorepo with universal, reusable packages:
75
+
76
+ | Package | Purpose | Exports / Capabilities |
77
+ | :--- | :--- | :--- |
78
+ | **`@nexus/ui`** | Shared React UI & Design System | `StatCard`, `AiBadge`, `MetricTrend`, `NexusHeader`, `TraceViewer`, `SecurityShieldBadge` |
79
+ | **`@nexus/contracts`** | Universal Spec & Telemetry Contracts | `AgentTelemetryEvent`, `ProductProposalContract`, `SolutionBlueprintContract`, `DataArchitectureContract`, `DevopsSpecificationContract`, `QaSpecificationContract`, `AuditChainEntryContract` |
80
+ | **`@nexus/middleware`** | Security & Scrubbing Middleware | `NEXUS_SECURITY_HEADERS`, `scrubSensitiveData` (zero credential leaks), `generateCorrelationId` |
81
+ | **`@nexus/scraper`** | Ethical & Resilient Scraping | `ScrapedItem`, `DEFAULT_NEXUS_SCRAPING_POLICY`, rate-limit & backoff policy contracts |
82
+
83
+ ### Centralized Terraform Modules (`infra/terraform/modules/`)
84
+ - **`nexus_app`**: Baseline GCP APIs (`aiplatform.googleapis.com`, `secretmanager.googleapis.com`), service accounts, and IAM roles (`roles/aiplatform.user`).
85
+ - **`nexus_cloud_run`**: Auto-scaling serverless Cloud Run container module with HTTPS termination and VPC access.
86
+ - **`nexus_vm`**: Cost-optimized Always-Free Compute Engine VM module with custom VPC, firewall, IAP SSH, and Docker setup.
87
+
88
+ ---
89
+
90
+ ## 🔌 Orchestrator-Native: Claude Code & Cursor Integration
91
+
92
+ Nexus is designed to work as an equal peer alongside **Claude Code, Cursor, Codex, and Gemini CLI**:
93
+
94
+ ```bash
95
+ # Start the Nexus Model Context Protocol (MCP) server
96
+ nexus mcp
97
+ ```
98
+
99
+ ### Connecting from Cursor / Claude Code
100
+ Add Nexus to your `.cursor/mcp.json` or `claude_desktop_config.json`:
101
+ ```json
102
+ {
103
+ "mcpServers": {
104
+ "nexus": {
105
+ "command": "python",
106
+ "args": ["-m", "nexus.cli.main", "mcp"],
107
+ "env": {
108
+ "GCP_PROJECT_ID": "finhub-510316"
109
+ }
110
+ }
111
+ }
112
+ }
113
+ ```
114
+ Instantly, Claude Code or Cursor gains access to all Nexus tools, allowing you to trigger IT squad workflows, check AI connections, or diagnose errors right inside your editor prompt.
115
+
116
+ ---
117
+
118
+ ## 🖥️ Localhost Visualizer & Agent Observability (`nexus ui`)
119
+
120
+ Nexus provides a built-in interactive web visualizer to track your agent squad and execution telemetry in real time:
121
+
122
+ ```bash
123
+ # Launch localhost progress visualizer on http://localhost:8000
124
+ nexus ui
125
+ ```
126
+
127
+ ### Features:
128
+ - **Visual Squad Pipeline**: Live status indicators for each agent (`Idle`, `Active`, `Done ✓`) as tasks move through the 7 specialists.
129
+ - **Real-Time Telemetry Stream**: Server-Sent Events (SSE) feed displaying thoughts, tool calls, and model reasoning.
130
+ - **Cost & Budget Meter**: Live dollar spend tracking (`total_cost_usd`) updated after every inference turn against official Gemini 3.8 pricing.
131
+ - **Live Artifact Inspector**: Read generated Product Proposals, preview interactive HTML wireframes, and inspect React/FastAPI code directly in your browser.
132
+ - **Interactive Launcher**: Trigger new squad builds directly from the web interface.
133
+
134
+ ---
135
+
136
+ ## ⚡ Instant Application Creation: `nexus dream`
137
+
138
+ ```bash
139
+ nexus dream "I want an app that tracks second-hand luxury watches in Europe with price alerts"
140
+ ```
141
+
142
+ Output:
143
+ ```text
144
+ --- Nexus Core IT Squad Activated ---
145
+ Goal: "I want an app that tracks second-hand luxury watches in Europe with price alerts"
146
+ Assignees: Business Analyst, Engineering Manager, UI/UX Designer, Backend Engineer, QA Engineer
147
+
148
+ === Project Delivered! ===
149
+ App: WatchHub (watchhub)
150
+ Tagline: Verified European luxury watch index and real-time deal alerts
151
+ Output Directory: ./watchhub
152
+ Stories: 4 user stories defined
153
+ Cloud Target: GCP (Cloud Run Serverless)
154
+ Data Schema: PostgreSQL 16 (4 tables)
155
+ UI Component: WatchDashboard.tsx
156
+ QA Preflight: PASS (Test suite generated with 100% pre-flight clearance)
157
+ ```
158
+
159
+ ---
160
+
161
+ ## 🛡️ Built-in Cost & Security Guardrails
162
+
163
+ - **Zero Runaway Bills**: `max_budget_usd` spend ceilings on every agent execution context.
164
+ - **Gemini 3.8 Flash Cost Profile**: \$0.075 / \$0.30 per million tokens (cents per month for active squads).
165
+ - **Prompt Injection Defense**: Intercepts jailbreaks (`"ignore all prior instructions"`) before hitting the LLM.
166
+ - **PII & Secret Scrubber**: Redacts API keys (`sk-...`, `ghp-...`) and credentials automatically.
167
+ - **Zero-Cost Mock Engine**: Run the entire IT pack and test suite locally for \$0.00 using `MockProvider`.
168
+
169
+ ---
170
+
171
+ ## 🧪 Verification
172
+
173
+ ```bash
174
+ git clone https://github.com/sabburi1994/nexus.git
175
+ cd nexus
176
+ pytest -o pythonpath=src tests/
177
+ ```
178
+ All 20 unit tests pass cleanly out of the box.
@@ -0,0 +1,7 @@
1
+ .git
2
+ .gitignore
3
+ __pycache__/
4
+ *.py[cod]
5
+ .pytest_cache/
6
+ .coverage
7
+ tests/
@@ -0,0 +1,23 @@
1
+ FROM python:3.12-slim
2
+
3
+ WORKDIR /app
4
+
5
+ ENV PYTHONUNBUFFERED=1 \
6
+ PYTHONDONTWRITEBYTECODE=1 \
7
+ PORT=8080
8
+
9
+ # Install system dependencies
10
+ RUN apt-get update && apt-get install -y --no-install-recommends \
11
+ curl ca-certificates \
12
+ && rm -rf /var/lib/apt/lists/*
13
+
14
+ # Copy local wheel and install dependencies
15
+ COPY wheels/ /app/wheels/
16
+ RUN pip install --no-cache-dir /app/wheels/*.whl uvicorn fastapi httpx pydantic sqlalchemy asyncpg
17
+
18
+ # Copy application source code
19
+ COPY src/ /app/src/
20
+
21
+ EXPOSE 8080
22
+
23
+ CMD ["sh", "-c", "uvicorn main:app --app-dir src --host 0.0.0.0 --port ${PORT:-8080}"]
@@ -0,0 +1,24 @@
1
+ [project]
2
+ name = "nexus-showcase"
3
+ version = "0.1.0"
4
+ description = "Reference Showcase Application demonstrating Nexus Monorepo Packages and Framework"
5
+ requires-python = ">=3.11"
6
+ dependencies = [
7
+ "nexus-framework>=0.1.0",
8
+ "uvicorn>=0.30.0",
9
+ ]
10
+
11
+ [project.optional-dependencies]
12
+ dev = [
13
+ "pytest>=8.0.0",
14
+ "pytest-asyncio>=0.23.0",
15
+ "httpx>=0.27.0",
16
+ ]
17
+
18
+ [build-system]
19
+ requires = ["hatchling"]
20
+ build-backend = "hatchling.build"
21
+
22
+ [tool.pytest.ini_options]
23
+ pythonpath = ["src"]
24
+ asyncio_mode = "auto"
@@ -0,0 +1 @@
1
+ """Nexus Showcase Backend Package."""
@@ -0,0 +1,2 @@
1
+ """Alias for models.py."""
2
+ from .models import * # noqa: F403