agentops-cockpit 0.2.2__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.
File without changes
File without changes
@@ -0,0 +1,184 @@
1
+ import os
2
+ import sys
3
+ import shutil
4
+ import subprocess
5
+ from rich.console import Console
6
+ from rich.panel import Panel
7
+ import typer
8
+
9
+ app = typer.Typer(help="AgentOps Cockpit: The AI Agent Operations Platform", no_args_is_help=True)
10
+ console = Console()
11
+
12
+ REPO_URL = "https://github.com/enriquekalven/agent-ui-starter-pack"
13
+
14
+ @app.command()
15
+ def version():
16
+ """Show the version of the Optimized Agent Stack CLI."""
17
+ console.print("[bold cyan]agent-ops CLI v0.1.0[/bold cyan]")
18
+
19
+ @app.command()
20
+ def reliability():
21
+ """
22
+ Run reliability audit (Unit Tests + Regression Suite coverage).
23
+ """
24
+ console.print("πŸ›‘οΈ [bold green]Launching Reliability Audit...[/bold green]")
25
+ subprocess.run([sys.executable, "-m", "backend.ops.reliability", "audit"], env={**os.environ, "PYTHONPATH": "src"})
26
+
27
+ @app.command()
28
+ def report():
29
+ """
30
+ Launch full AgentOps audit (Arch, Quality, Security, Cost) and generate a final report.
31
+ """
32
+ console.print("πŸ•ΉοΈ [bold blue]Launching Full System Audit...[/bold blue]")
33
+ subprocess.run([sys.executable, "-m", "backend.ops.orchestrator"], env={**os.environ, "PYTHONPATH": "src"})
34
+
35
+ @app.command()
36
+ def quality_baseline():
37
+ """
38
+ Run iterative 'Hill Climbing' quality audit against a golden dataset.
39
+ """
40
+ console.print("πŸ§— [bold cyan]Launching Quality Hill Climber...[/bold cyan]")
41
+ subprocess.run([sys.executable, "-m", "backend.eval.quality_climber", "audit"], env={**os.environ, "PYTHONPATH": "src"})
42
+
43
+ @app.command()
44
+ def arch_review():
45
+ """
46
+ Audit agent design against Google Well-Architected Framework.
47
+ """
48
+ console.print("πŸ›οΈ [bold blue]Launching Architecture Design Review...[/bold blue]")
49
+ subprocess.run([sys.executable, "-m", "backend.ops.arch_review", "audit"], env={**os.environ, "PYTHONPATH": "src"})
50
+
51
+ @app.command()
52
+ def audit(
53
+ file_path: str = typer.Argument("src/backend/agent.py", help="Path to the agent code to audit"),
54
+ ):
55
+ """
56
+ Run the Interactive Agent Optimizer audit.
57
+ """
58
+ console.print("πŸ” [bold blue]Running Agent Operations Audit...[/bold blue]")
59
+ # Run the optimizer module
60
+ subprocess.run([sys.executable, "-m", "backend.optimizer", "audit", file_path], env={**os.environ, "PYTHONPATH": "src"})
61
+
62
+ @app.command()
63
+ def red_team(
64
+ agent_path: str = typer.Argument("src/backend/agent.py", help="Path to the agent code to audit"),
65
+ ):
66
+ """
67
+ Run the Red Team adversarial security evaluation.
68
+ """
69
+ console.print("🚩 [bold red]Launching Red Team Evaluation...[/bold red]")
70
+ subprocess.run([sys.executable, "-m", "backend.eval.red_team", "audit", agent_path], env={**os.environ, "PYTHONPATH": "src"})
71
+
72
+ @app.command()
73
+ def load_test(
74
+ url: str = typer.Option("http://localhost:8000/agent/query?q=healthcheck", help="URL to stress test"),
75
+ requests: int = typer.Option(50, help="Total number of requests"),
76
+ concurrency: int = typer.Option(5, help="Number of Concurrent Users"),
77
+ ) -> None:
78
+ """
79
+ Stress test agent endpoints for performance and reliability.
80
+ """
81
+ console.print("⚑ [bold yellow]Launching Base Load Test...[/bold yellow]")
82
+ subprocess.run([
83
+ sys.executable, "-m", "backend.eval.load_test", "run",
84
+ "--url", url,
85
+ "--requests", str(requests),
86
+ "--concurrency", str(concurrency)
87
+ ], env={**os.environ, "PYTHONPATH": "src"})
88
+
89
+ @app.command()
90
+ def deploy(
91
+ service_name: str = typer.Option("agent-ops-backend", "--name", help="Cloud Run service name"),
92
+ region: str = typer.Option("us-central1", "--region", help="GCP region"),
93
+ ):
94
+ """
95
+ One-click production deployment (Audit + Build + Deploy).
96
+ """
97
+ console.print(Panel.fit("πŸš€ [bold green]AGENT COCKPIT: 1-CLICK DEPLOY[/bold green]", border_style="green"))
98
+
99
+ # 1. Audit
100
+ console.print("\n[bold]Step 1: Code Optimization Audit[/bold]")
101
+ subprocess.run([sys.executable, "-m", "backend.optimizer", "audit", "--no-interactive"], env={**os.environ, "PYTHONPATH": "src"})
102
+
103
+ # 2. Build Frontend
104
+ console.print("\n[bold]Step 2: Building Frontend Assets[/bold]")
105
+ subprocess.run(["npm", "run", "build"], check=True)
106
+
107
+ # 3. Deploy to Cloud Run
108
+ console.print(f"\n[bold]Step 3: Deploying Engine to Cloud Run ({region})[/bold]")
109
+ deploy_cmd = [
110
+ "gcloud", "run", "deploy", service_name,
111
+ "--source", ".",
112
+ "--region", region,
113
+ "--allow-unauthenticated"
114
+ ]
115
+ subprocess.run(deploy_cmd, check=True)
116
+
117
+ # 4. Deploy to Firebase
118
+ console.print("\n[bold]Step 4: Deploying Face to Firebase Hosting[/bold]")
119
+ subprocess.run(["firebase", "deploy", "--only", "hosting"], check=True)
120
+
121
+ console.print("\nβœ… [bold green]Deployment Complete![/bold green]")
122
+
123
+ @app.command()
124
+ def create(
125
+ project_name: str = typer.Argument(..., help="The name of the new project"),
126
+ ui: str = typer.Option("a2ui", "-ui", "--ui", help="UI Template (a2ui, agui, flutter, lit)"),
127
+ copilotkit: bool = typer.Option(False, "--copilotkit", help="Enable extra CopilotKit features for AGUI"),
128
+ ):
129
+ """
130
+ Scaffold a new Agent UI project. Defaults to A2UI (React/Vite).
131
+ """
132
+ console.print(Panel(f"πŸš€ Creating project: [bold cyan]{project_name}[/bold cyan]", expand=False))
133
+
134
+ if os.path.exists(project_name):
135
+ console.print(f"[bold red]Error:[/bold red] Directory '{project_name}' already exists.")
136
+ raise typer.Exit(code=1)
137
+
138
+ try:
139
+ if ui == "agui" or copilotkit:
140
+ console.print("✨ [bold yellow]Note:[/bold yellow] AG UI / CopilotKit selected. Using high-fidelity template.")
141
+ elif ui == "flutter":
142
+ console.print("πŸ’™ [bold blue]Note:[/bold blue] Flutter selected. Scaffolding GenUI SDK bridge logic.")
143
+ elif ui == "lit":
144
+ console.print("πŸ”₯ [bold orange1]Note:[/bold orange1] Lit selected. Scaffolding Web Components base.")
145
+
146
+ console.print(f"πŸ“‘ Cloning template from [cyan]{REPO_URL}[/cyan]...")
147
+ subprocess.run(["git", "clone", "--depth", "1", REPO_URL, project_name], check=True, capture_output=True)
148
+
149
+ # Remove git tracking
150
+ shutil.rmtree(os.path.join(project_name, ".git"))
151
+
152
+ # Initialize new git repo
153
+ console.print("πŸ”§ Initializing new git repository...")
154
+ subprocess.run(["git", "init"], cwd=project_name, check=True, capture_output=True)
155
+
156
+ # UI specific success message
157
+ start_cmd = "npm run dev"
158
+ if ui == "flutter":
159
+ start_cmd = "flutter run"
160
+
161
+ console.print(Panel(
162
+ f"βœ… [bold green]Success![/bold green] Project [bold cyan]{project_name}[/bold cyan] created.\n\n"
163
+ f"[bold]Quick Start:[/bold]\n"
164
+ f" 1. [dim]cd[/dim] {project_name}\n"
165
+ f" 2. [dim]{'npm install' if ui != 'flutter' else 'flutter pub get'}[/dim]\n"
166
+ f" 3. [dim]uvx agent-ops-cockpit audit[/dim]\n"
167
+ f" 4. [dim]{start_cmd}[/dim]\n\n"
168
+ f"Configuration: UI=[bold cyan]{ui}[/bold cyan], CopilotKit=[bold cyan]{'Enabled' if copilotkit else 'Disabled'}[/bold cyan]",
169
+ title="[bold green]Project Scaffolding Complete[/bold green]",
170
+ expand=False,
171
+ border_style="green"
172
+ ))
173
+ except subprocess.CalledProcessError as e:
174
+ console.print(f"[bold red]Error during git operation:[/bold red] {e.stderr.decode() if e.stderr else str(e)}")
175
+ raise typer.Exit(code=1)
176
+ except Exception as e:
177
+ console.print(f"[bold red]Unexpected Error:[/bold red] {str(e)}")
178
+ raise typer.Exit(code=1)
179
+
180
+ def main():
181
+ app()
182
+
183
+ if __name__ == "__main__":
184
+ main()
@@ -0,0 +1,142 @@
1
+ Metadata-Version: 2.4
2
+ Name: agentops-cockpit
3
+ Version: 0.2.2
4
+ Summary: Production-grade Agent Operations (AgentOps) Platform
5
+ Project-URL: Homepage, https://github.com/enriquekalven/agent-ops-cockpit
6
+ Project-URL: Bug Tracker, https://github.com/enriquekalven/agent-ops-cockpit/issues
7
+ Author-email: Enrique <enrique@example.com>
8
+ License-File: LICENSE
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Programming Language :: Python :: 3
12
+ Requires-Python: >=3.10
13
+ Requires-Dist: gitpython>=3.1.0
14
+ Requires-Dist: rich>=13.0.0
15
+ Requires-Dist: typer>=0.9.0
16
+ Description-Content-Type: text/markdown
17
+
18
+ # πŸ•ΉοΈ AgentOps Cockpit
19
+
20
+ <div align="center">
21
+ <img src="https://img.shields.io/github/stars/enriquekalven/agent-cockpit?style=for-the-badge&color=ffd700" alt="GitHub Stars" />
22
+ <img src="https://img.shields.io/github/license/enriquekalven/agent-cockpit?style=for-the-badge&color=007bff" alt="License" />
23
+ <img src="https://img.shields.io/badge/Google-Well--Architected-4285F4?style=for-the-badge&logo=google-cloud" alt="Google Well-Architected" />
24
+ <img src="https://img.shields.io/badge/Status-Day%202%20Operations-10b981?style=for-the-badge" alt="Status" />
25
+ </div>
26
+
27
+ <br />
28
+
29
+ <div align="center">
30
+ <h3>"Infrastructure gives you the pipes. We give you the Intelligence."</h3>
31
+ <p>The developer distribution for building, optimizing, and securing AI agents on Google Cloud.</p>
32
+ </div>
33
+
34
+ ---
35
+
36
+ ## πŸ“½οΈ The Mission
37
+ Most AI agent templates stop at a single Python file and an API key. **The AgentOps Cockpit** is for developers moving into production. While optimized for **ADK**, it provides framework-agnostic governance, safety, and cost guardrails for the entire agentic ecosystemβ€”from CrewAI to LangGraph. Based on the **[Google Well-Architected Framework for Agents](/docs/google-architecture)**.
38
+
39
+ ---
40
+
41
+ ## πŸ—οΈ The Agentic Trinity
42
+ We divide the complexity of production agents into three focused pillars:
43
+
44
+ - **βš™οΈ The Engine**: The reasoning core. Built with **ADK**, FastAPI, and Vertex AI.
45
+ - **🎭 The Face**: The user experience. Adaptive UI surfaces and **GenUI** standards via the A2UI spec.
46
+ - **πŸ•ΉοΈ The Cockpit**: The operational brain. Cost control, semantic caching, shadow routing, and adversarial audits.
47
+
48
+ ---
49
+
50
+ ## 🌐 Framework Agnostic Governance
51
+ The Cockpit isn't just for ADK. It provides **Best Practices as Code** across all major agentic frameworks:
52
+
53
+ <div align="center">
54
+ <img src="https://img.shields.io/badge/OpenAI_Agentkit-412991?style=for-the-badge&logo=openai" alt="OpenAI Agentkit" />
55
+ <img src="https://img.shields.io/badge/Anthropic_Claude-D97757?style=for-the-badge&logo=anthropic" alt="Anthropic" />
56
+ <img src="https://img.shields.io/badge/Microsoft_AutoGen-0078d4?style=for-the-badge&logo=microsoft" alt="Microsoft" />
57
+ <img src="https://img.shields.io/badge/AWS_Bedrock-FF9900?style=for-the-badge&logo=amazon-aws" alt="AWS" />
58
+ <img src="https://img.shields.io/badge/CopilotKit.ai-6366f1?style=for-the-badge" alt="CopilotKit" />
59
+ <img src="https://img.shields.io/badge/LangChain-1C3C3C?style=for-the-badge" alt="LangChain" />
60
+ <img src="https://img.shields.io/badge/ADK-4285F4?style=for-the-badge&logo=google-cloud" alt="ADK" />
61
+ </div>
62
+
63
+ <div align="center">
64
+ <img src="https://img.shields.io/badge/Python-3776AB?style=flat-square&logo=python&logoColor=white" alt="Python" />
65
+ <img src="https://img.shields.io/badge/Go-00ADD8?style=flat-square&logo=go&logoColor=white" alt="Go" />
66
+ <img src="https://img.shields.io/badge/NodeJS-339933?style=flat-square&logo=node.js&logoColor=white" alt="NodeJS" />
67
+ <img src="https://img.shields.io/badge/TypeScript-3178C6?style=flat-square&logo=typescript&logoColor=white" alt="TypeScript" />
68
+ <img src="https://img.shields.io/badge/Streamlit-FF4B4B?style=flat-square&logo=streamlit&logoColor=white" alt="Streamlit" />
69
+ <img src="https://img.shields.io/badge/Angular-DD0031?style=flat-square&logo=angular&logoColor=white" alt="Angular" />
70
+ <img src="https://img.shields.io/badge/Lit-324FFF?style=flat-square&logo=lit&logoColor=white" alt="Lit" />
71
+ </div>
72
+
73
+ Whether you are building a swarm in **CrewAI**, a Go-based high-perf engine, or a **Streamlit** dashboard, the Cockpit ensures your agent maps to the **Google Well-Architected Framework**.
74
+
75
+
76
+ ---
77
+
78
+ ## πŸš€ Key Innovation: The "Intelligence" Layer
79
+
80
+ ### πŸ›‘οΈ Red Team Auditor (Self-Hacking)
81
+ Don't wait for your users to find prompt injections. Use the built-in Adversarial Evaluator to launch self-attacks against your agent, testing for PII leaks, instruction overrides, and safety filter bypasses.
82
+
83
+ ### 🧠 Hive Mind (Semantic Caching)
84
+ **Reduce LLM costs by up to 40%.** The Hive Mind checks for semantically similar queries in 10ms, serving cached answers for common questions without calling the LLM.
85
+
86
+ ### πŸ›οΈ Arch Review & Framework Detection
87
+ Every agent in the cockpit is graded against a framework-aware checklist. The Cockpit intelligently detects your stackβ€”**Google ADK**, **OpenAI Agentkit**, **Anthropic Claude**, **Microsoft AutoGen/Semantic Kernel**, **AWS Bedrock Agents**, or **CopilotKit**β€”and runs a tailored audit against corresponding production standards. Use `make arch-review` to verify your **Governance-as-Code**.
88
+
89
+ ### πŸ§— Quality Hill Climbing (ADK Evaluation)
90
+ Following **Google ADK Evaluation** best practices, the Cockpit provides an iterative optimization loop. `make quality-baseline` runs your agent against a "Golden Dataset" using **LLM-as-a-Judge** scoring (Response Match & Tool Trajectory), climbing the quality curve until production-grade fidelity is reached.
91
+
92
+ ---
93
+
94
+ ## ⌨️ Quick Start
95
+
96
+ You don't even need to clone the repo to start auditing.
97
+
98
+ ```bash
99
+ # 1. Audit your existing agent design
100
+ uvx agent-ops-cockpit arch-review
101
+
102
+ # 2. Stress test your endpoint
103
+ uvx agent-ops-cockpit load-test --requests 100 --concurrency 10
104
+
105
+ # 3. Scaffold a new Well-Architected app
106
+ uvx agent-ops-cockpit create my-agent --ui a2ui
107
+ ```
108
+
109
+ ---
110
+
111
+ ## πŸ“Š Local Development
112
+ The Cockpit provides a unified "Mission Control" to evaluate your agents instantly.
113
+
114
+ ```bash
115
+ make audit-all # πŸ•ΉοΈ Run ALL audits and generate a Final Report
116
+ make reliability # πŸ›‘οΈ Run unit tests and regression suite
117
+ make dev # Start the local Engine + Face stack
118
+ make arch-review # πŸ›οΈ Run the Google Well-Architected design review
119
+ make quality-baseline # πŸ§— Run iterative 'Hill Climbing' quality audit
120
+ make audit # πŸ” Run the Interactive Agent Optimizer
121
+ make red-team # Execute a white-hat security audit
122
+ make deploy-prod # πŸš€ 1-click deploy to Google Cloud
123
+ ```
124
+
125
+ ---
126
+
127
+ ## 🧭 Roadmap
128
+ - [ ] **One-Click GitHub Action**: Automated audits on every PR.
129
+ - [ ] **Multi-Agent Orchestrator**: Support for Swarm/Coordinator patterns.
130
+ - [ ] **Visual Mission Control**: Real-time observability dashboard.
131
+
132
+ [View full roadmap β†’](/ROADMAP.md)
133
+
134
+ ---
135
+
136
+ ## 🀝 Community
137
+ - **Star this repo** to help us build the future of AgentOps.
138
+ - **Join the Discussion** for patterns on Google Cloud.
139
+ - **Contribute**: Read our [Contributing Guide](/CONTRIBUTING.md).
140
+
141
+ ---
142
+ *Reference: [Google Cloud Architecture Center - Agentic AI Overview](https://docs.cloud.google.com/architecture/agentic-ai-overview)*
@@ -0,0 +1,8 @@
1
+ agent_ops_cockpit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ agent_ops_cockpit/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ agent_ops_cockpit/cli/main.py,sha256=G_1oEp9xck8knpy5c5q80I1n_9JP7rTheJpd55dJ74M,7624
4
+ agentops_cockpit-0.2.2.dist-info/METADATA,sha256=pnjmdARu64WPpwmmEU-ZAvzZDMFfeXKQbwH3As3NyKA,7246
5
+ agentops_cockpit-0.2.2.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
6
+ agentops_cockpit-0.2.2.dist-info/entry_points.txt,sha256=SOGYPNtUGhMVgxLQ9dEYo7L3M_dvhWEU2eQz2zhaTkY,112
7
+ agentops_cockpit-0.2.2.dist-info/licenses/LICENSE,sha256=XNJEk4bvf88tBnKqHdGBGi10l9yJWv2yLWPJvvVie1c,1071
8
+ agentops_cockpit-0.2.2.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.28.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ agent-ops = agent_ops_cockpit.cli.main:app
3
+ agent-ops-cockpit = agent_ops_cockpit.cli.main:app
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Enrique Kalven
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.