riva 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 (62) hide show
  1. riva-0.1.0/LICENSE +21 -0
  2. riva-0.1.0/PKG-INFO +446 -0
  3. riva-0.1.0/README.md +411 -0
  4. riva-0.1.0/pyproject.toml +65 -0
  5. riva-0.1.0/setup.cfg +4 -0
  6. riva-0.1.0/src/riva/__init__.py +3 -0
  7. riva-0.1.0/src/riva/__main__.py +5 -0
  8. riva-0.1.0/src/riva/agents/__init__.py +52 -0
  9. riva-0.1.0/src/riva/agents/autogen.py +59 -0
  10. riva-0.1.0/src/riva/agents/base.py +284 -0
  11. riva-0.1.0/src/riva/agents/claude_code.py +188 -0
  12. riva-0.1.0/src/riva/agents/cline.py +84 -0
  13. riva-0.1.0/src/riva/agents/codex_cli.py +195 -0
  14. riva-0.1.0/src/riva/agents/continue_dev.py +97 -0
  15. riva-0.1.0/src/riva/agents/crewai.py +60 -0
  16. riva-0.1.0/src/riva/agents/cursor.py +136 -0
  17. riva-0.1.0/src/riva/agents/gemini_cli.py +57 -0
  18. riva-0.1.0/src/riva/agents/github_copilot.py +94 -0
  19. riva-0.1.0/src/riva/agents/langgraph.py +60 -0
  20. riva-0.1.0/src/riva/agents/openclaw.py +56 -0
  21. riva-0.1.0/src/riva/agents/registry.py +185 -0
  22. riva-0.1.0/src/riva/agents/windsurf.py +84 -0
  23. riva-0.1.0/src/riva/cli.py +516 -0
  24. riva-0.1.0/src/riva/core/__init__.py +1 -0
  25. riva-0.1.0/src/riva/core/audit.py +400 -0
  26. riva-0.1.0/src/riva/core/env_scanner.py +53 -0
  27. riva-0.1.0/src/riva/core/monitor.py +187 -0
  28. riva-0.1.0/src/riva/core/network.py +147 -0
  29. riva-0.1.0/src/riva/core/scanner.py +129 -0
  30. riva-0.1.0/src/riva/core/storage.py +246 -0
  31. riva-0.1.0/src/riva/core/usage_stats.py +73 -0
  32. riva-0.1.0/src/riva/tui/__init__.py +1 -0
  33. riva-0.1.0/src/riva/tui/components.py +328 -0
  34. riva-0.1.0/src/riva/tui/dashboard.py +160 -0
  35. riva-0.1.0/src/riva/utils/__init__.py +1 -0
  36. riva-0.1.0/src/riva/utils/formatting.py +65 -0
  37. riva-0.1.0/src/riva/utils/jsonl.py +75 -0
  38. riva-0.1.0/src/riva/web/__init__.py +0 -0
  39. riva-0.1.0/src/riva/web/daemon.py +113 -0
  40. riva-0.1.0/src/riva/web/server.py +337 -0
  41. riva-0.1.0/src/riva.egg-info/PKG-INFO +446 -0
  42. riva-0.1.0/src/riva.egg-info/SOURCES.txt +60 -0
  43. riva-0.1.0/src/riva.egg-info/dependency_links.txt +1 -0
  44. riva-0.1.0/src/riva.egg-info/entry_points.txt +2 -0
  45. riva-0.1.0/src/riva.egg-info/requires.txt +8 -0
  46. riva-0.1.0/src/riva.egg-info/top_level.txt +1 -0
  47. riva-0.1.0/tests/test_audit.py +155 -0
  48. riva-0.1.0/tests/test_base.py +246 -0
  49. riva-0.1.0/tests/test_cli.py +308 -0
  50. riva-0.1.0/tests/test_components.py +209 -0
  51. riva-0.1.0/tests/test_detectors.py +337 -0
  52. riva-0.1.0/tests/test_env_scanner.py +83 -0
  53. riva-0.1.0/tests/test_formatting.py +116 -0
  54. riva-0.1.0/tests/test_ide_detectors.py +283 -0
  55. riva-0.1.0/tests/test_jsonl.py +100 -0
  56. riva-0.1.0/tests/test_monitor.py +129 -0
  57. riva-0.1.0/tests/test_network.py +139 -0
  58. riva-0.1.0/tests/test_registry.py +168 -0
  59. riva-0.1.0/tests/test_scanner.py +128 -0
  60. riva-0.1.0/tests/test_storage.py +183 -0
  61. riva-0.1.0/tests/test_usage_stats.py +323 -0
  62. riva-0.1.0/tests/test_web.py +595 -0
riva-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025-present Riva Contributors
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.
riva-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,446 @@
1
+ Metadata-Version: 2.4
2
+ Name: riva
3
+ Version: 0.1.0
4
+ Summary: AI Agent Task Manager - discover and monitor AI coding agents running on your machine
5
+ Author: Riva Contributors
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/sarkar-ai/riva
8
+ Project-URL: Repository, https://github.com/sarkar-ai/riva
9
+ Project-URL: Issues, https://github.com/sarkar-ai/riva/issues
10
+ Project-URL: Changelog, https://github.com/sarkar-ai/riva/blob/main/HISTORY.md
11
+ Keywords: ai,agent,monitoring,observability,cli,dashboard
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Operating System :: MacOS
17
+ Classifier: Operating System :: POSIX :: Linux
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Topic :: Software Development :: Libraries
23
+ Classifier: Topic :: System :: Monitoring
24
+ Requires-Python: >=3.11
25
+ Description-Content-Type: text/markdown
26
+ License-File: LICENSE
27
+ Requires-Dist: psutil>=5.9
28
+ Requires-Dist: rich>=13.0
29
+ Requires-Dist: click>=8.0
30
+ Requires-Dist: flask>=3.0
31
+ Provides-Extra: test
32
+ Requires-Dist: pytest>=7.0; extra == "test"
33
+ Requires-Dist: pytest-cov>=4.0; extra == "test"
34
+ Dynamic: license-file
35
+
36
+ # 🧐 rivA
37
+
38
+ Observe, monitor, and control local AI agents running on your machine.
39
+
40
+ <p align="center">
41
+ <a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg?style=for-the-badge" alt="License"></a>
42
+ <a href="https://pypi.org/project/riva-agent/"><img src="https://img.shields.io/pypi/v/riva-agent.svg?style=for-the-badge" alt="PyPI"></a>
43
+ <a href="#requirements"><img src="https://img.shields.io/badge/python-%3E%3D3.11-green.svg?style=for-the-badge" alt="Python"></a>
44
+ <a href="#requirements"><img src="https://img.shields.io/badge/platform-macOS%20%7C%20Linux%20%7C%20WSL2-lightgrey.svg?style=for-the-badge" alt="Platform"></a>
45
+ </p>
46
+
47
+ Riva is a **local-first observability and control plane for AI agents**.
48
+ It helps you understand what agents are running on your machine, what they are doing, and how they are behaving in real time.
49
+
50
+ As agent frameworks push toward autonomy, visibility often disappears.
51
+ Riva exists to restore **clarity, safety, and trust**.
52
+
53
+ [Getting Started](#quick-start) · [How it works](#how-it-works) · [CLI Reference](#cli-reference) · [Web Dashboard](#web-dashboard) · [Security](#security) · [Contributing](#contributing)
54
+
55
+ ---
56
+
57
+ ## Demo
58
+
59
+ | Agent Overview | Resource Monitoring |
60
+ |:---:|:---:|
61
+ | _coming soon_ | _coming soon_ |
62
+
63
+ ---
64
+
65
+ ## How it works
66
+
67
+ ```
68
+ Local Agents (Claude Code / Codex CLI / Gemini CLI / LangGraph / CrewAI / AutoGen / ...)
69
+ |
70
+ v
71
+ +------------------+
72
+ | Riva | discovery, metrics, logs, lifecycle
73
+ | (observability) |
74
+ +--------+---------+
75
+ |
76
+ +--------+---------+
77
+ | | |
78
+ CLI TUI Web Dashboard
79
+ ```
80
+
81
+ Riva runs entirely on your machine.
82
+ It **observes agent behavior** but does not execute agent actions.
83
+
84
+ ---
85
+
86
+ ## Highlights
87
+
88
+ - **Agent discovery** — detect locally running agents across 7 frameworks and growing
89
+ - **Lifecycle visibility** — see when agents start, stop, crash, or hang
90
+ - **Resource tracking** — CPU, memory, and uptime per agent in real time
91
+ - **Token usage stats** — track token consumption, model usage, and tool call frequency
92
+ - **Environment scanning** — detect exposed API keys in environment variables
93
+ - **Security audit** — `riva audit` checks for config permission issues, exposed secrets, and dashboard misconfiguration
94
+ - **Web dashboard** — Flask-based dashboard with REST API, security headers, and optional auth token
95
+ - **Framework-agnostic** — works across multiple agent frameworks and custom agents
96
+ - **Local-first** — no cloud, no telemetry, no hidden data flows
97
+
98
+ ---
99
+
100
+ ## Supported Frameworks
101
+
102
+ Riva ships with built-in detectors for these agent frameworks:
103
+
104
+ | Framework | Binary / Process | Config Dir | API Domain |
105
+ |-----------|-----------------|------------|------------|
106
+ | [Claude Code](https://docs.anthropic.com/en/docs/claude-code) | `claude` | `~/.claude` | api.anthropic.com |
107
+ | [Codex CLI](https://github.com/openai/codex) | `codex` | `~/.codex` | api.openai.com |
108
+ | [Gemini CLI](https://github.com/google-gemini/gemini-cli) | `gemini` | `~/.gemini` | generativelanguage.googleapis.com |
109
+ | [OpenClaw](https://github.com/openclaw) | `openclaw`, `clawdbot` | `~/.openclaw` | varies |
110
+ | [LangGraph](https://langchain-ai.github.io/langgraph/) | `langgraph` / Python | `~/.langgraph` | api.smith.langchain.com |
111
+ | [CrewAI](https://www.crewai.com/) | `crewai` / Python | `~/.crewai` | app.crewai.com |
112
+ | [AutoGen](https://microsoft.github.io/autogen/) | `autogen` / Python | `~/.autogen` | varies |
113
+
114
+ Python-based frameworks (LangGraph, CrewAI, AutoGen) are detected by matching `python` processes whose command line references the framework.
115
+
116
+ **Adding more frameworks** — Riva is extensible via:
117
+ 1. Built-in detectors in `src/riva/agents/`
118
+ 2. Third-party pip packages using `[project.entry-points."riva.agents"]`
119
+ 3. Plugin scripts dropped into `~/.config/riva/plugins/`
120
+
121
+ ---
122
+
123
+ ## What Riva Is Not
124
+
125
+ Riva is intentionally not:
126
+ - An AI agent
127
+ - An orchestration framework
128
+ - A cloud monitoring service
129
+ - A replacement for agent runtimes
130
+
131
+ Riva does not make decisions.
132
+ It makes **agent behavior visible**.
133
+
134
+ ---
135
+
136
+ ## Requirements
137
+
138
+ - **macOS** (Ventura, Sonoma, Sequoia) or **Linux**
139
+ - Windows via **WSL2**
140
+ - Python 3.11+
141
+
142
+ ---
143
+
144
+ ## Quick Start
145
+
146
+ ### Install from PyPI
147
+
148
+ ```bash
149
+ pip install riva-agent
150
+ ```
151
+
152
+ ### Install via bash script
153
+
154
+ ```bash
155
+ curl -fsSL https://raw.githubusercontent.com/sarkar-ai/riva/main/install.sh | bash
156
+ ```
157
+
158
+ ### Install from source
159
+
160
+ ```bash
161
+ git clone https://github.com/sarkar-ai/riva.git
162
+ cd riva
163
+ pip install -e ".[test]"
164
+ ```
165
+
166
+ ### Verify
167
+
168
+ ```bash
169
+ riva --help
170
+ ```
171
+
172
+ ---
173
+
174
+ ## CLI Reference
175
+
176
+ ### `riva scan`
177
+
178
+ One-shot scan for running AI agents.
179
+
180
+ ```bash
181
+ riva scan # Rich table output
182
+ riva scan --json # JSON output
183
+ ```
184
+
185
+ ### `riva watch`
186
+
187
+ Launch the live TUI dashboard with real-time resource monitoring.
188
+
189
+ ```bash
190
+ riva watch
191
+ ```
192
+
193
+ ### `riva stats`
194
+
195
+ Show token usage and tool execution statistics.
196
+
197
+ ```bash
198
+ riva stats # All agents
199
+ riva stats --agent "Claude" # Filter by name
200
+ riva stats --json # JSON output
201
+ ```
202
+
203
+ ### `riva list`
204
+
205
+ Show all known agent types and their install status.
206
+
207
+ ```bash
208
+ riva list
209
+ ```
210
+
211
+ ### `riva config`
212
+
213
+ Show parsed configurations for detected agents.
214
+
215
+ ```bash
216
+ riva config
217
+ ```
218
+
219
+ ### `riva audit`
220
+
221
+ Run a security audit and print a report.
222
+
223
+ ```bash
224
+ riva audit # Rich table with PASS/WARN/FAIL
225
+ riva audit --json # JSON output
226
+ ```
227
+
228
+ Checks performed:
229
+ - API key exposure in environment variables
230
+ - Config directory permissions (group/other-readable)
231
+ - Web dashboard status and bind address
232
+ - Plugin directory existence and permissions
233
+
234
+ ---
235
+
236
+ ## Web Dashboard
237
+
238
+ ### Start / Stop
239
+
240
+ ```bash
241
+ riva web start # Background daemon
242
+ riva web start -f # Foreground
243
+ riva web start --auth-token MY_SECRET # With API auth
244
+ riva web stop # Stop daemon
245
+ riva web status # Check status
246
+ riva web logs # View logs
247
+ riva web logs -f # Follow logs
248
+ ```
249
+
250
+ ### Custom host and port
251
+
252
+ ```bash
253
+ riva web --host 0.0.0.0 --port 9090 start
254
+ ```
255
+
256
+ A warning is printed when binding to a non-localhost address.
257
+
258
+ ### API endpoints
259
+
260
+ | Endpoint | Description |
261
+ |----------|-------------|
262
+ | `GET /` | HTML dashboard |
263
+ | `GET /api/agents` | Running agents (fast poll) |
264
+ | `GET /api/agents/history` | CPU/memory history |
265
+ | `GET /api/stats` | Token usage stats (cached 30s) |
266
+ | `GET /api/env` | Environment variables |
267
+ | `GET /api/registry` | Known agent types |
268
+ | `GET /api/config` | Agent configurations |
269
+
270
+ ### Authentication
271
+
272
+ When started with `--auth-token`, all `/api/*` routes require a `Authorization: Bearer <token>` header. The index page (`/`) remains accessible without authentication.
273
+
274
+ ```bash
275
+ # Start with auth
276
+ riva web start --auth-token secret123
277
+
278
+ # Access API
279
+ curl -H "Authorization: Bearer secret123" http://127.0.0.1:8585/api/agents
280
+ ```
281
+
282
+ ### Security headers
283
+
284
+ All responses include:
285
+ - `X-Content-Type-Options: nosniff`
286
+ - `X-Frame-Options: DENY`
287
+ - `Content-Security-Policy: default-src 'self' 'unsafe-inline'`
288
+ - `X-XSS-Protection: 1; mode=block`
289
+ - `Referrer-Policy: strict-origin-when-cross-origin`
290
+
291
+ ---
292
+
293
+ ## Security
294
+
295
+ - Runs locally — no network exposure by default
296
+ - Web dashboard binds to `127.0.0.1` by default
297
+ - Non-localhost binding triggers a visible warning
298
+ - Optional bearer token auth for the web API
299
+ - Security headers on all HTTP responses
300
+ - `riva audit` checks for common misconfigurations
301
+ - No agent execution privileges — read-only observation
302
+
303
+ See [SECURITY.md](SECURITY.md) for the full security policy.
304
+
305
+ ---
306
+
307
+ ## Architecture
308
+
309
+ ```
310
+ src/riva/
311
+ ├── agents/ # Agent detection and parsing
312
+ │ ├── base.py # AgentInstance, AgentStatus, BaseDetector
313
+ │ ├── registry.py # Agent registry
314
+ │ ├── claude_code.py # Claude Code detector
315
+ │ ├── codex_cli.py # Codex CLI detector
316
+ │ ├── gemini_cli.py # Gemini CLI detector
317
+ │ ├── openclaw.py # OpenClaw detector
318
+ │ ├── langgraph.py # LangGraph / LangChain detector
319
+ │ ├── crewai.py # CrewAI detector
320
+ │ └── autogen.py # AutoGen detector
321
+ ├── core/ # Core logic
322
+ │ ├── audit.py # Security audit checks
323
+ │ ├── env_scanner.py # Environment variable scanning
324
+ │ ├── monitor.py # Resource monitoring (CPU, memory)
325
+ │ ├── scanner.py # Process scanning
326
+ │ └── usage_stats.py # Token/tool usage parsing
327
+ ├── tui/ # Terminal UI (Rich)
328
+ │ ├── components.py # Rich table builders
329
+ │ └── dashboard.py # Live dashboard
330
+ ├── web/ # Flask web dashboard
331
+ │ ├── server.py # Flask app, REST API, security middleware
332
+ │ └── daemon.py # Background daemon management
333
+ ├── utils/ # Shared utilities
334
+ │ ├── formatting.py # Display formatting helpers
335
+ │ └── jsonl.py # JSONL file parsing
336
+ └── cli.py # Click CLI entry points
337
+ ```
338
+
339
+ Riva is modular by design.
340
+ New agent detectors can be added without changing the core.
341
+
342
+ ---
343
+
344
+ ## Development
345
+
346
+ ### Setup
347
+
348
+ ```bash
349
+ git clone https://github.com/sarkar-ai/riva.git
350
+ cd riva
351
+ python -m venv .venv
352
+ source .venv/bin/activate
353
+ pip install -e ".[test]"
354
+ ```
355
+
356
+ ### Running tests
357
+
358
+ ```bash
359
+ pytest # All tests
360
+ pytest --cov=riva --cov-report=term-missing # With coverage
361
+ pytest tests/test_cli.py # Specific file
362
+ ```
363
+
364
+ ### Linting
365
+
366
+ ```bash
367
+ pip install ruff
368
+ ruff check src/ tests/
369
+ ruff format --check src/ tests/
370
+ ```
371
+
372
+ ### Type checking
373
+
374
+ ```bash
375
+ pip install mypy types-psutil
376
+ mypy src/riva/ --ignore-missing-imports --no-strict
377
+ ```
378
+
379
+ ---
380
+
381
+ ## Release Process
382
+
383
+ 1. Update version in `pyproject.toml`
384
+ 2. Update `HISTORY.md` with changes
385
+ 3. Run full test suite: `pytest --cov=riva`
386
+ 4. Build the package: `python -m build`
387
+ 5. Verify: `twine check dist/*`
388
+ 6. Create a git tag: `git tag v0.x.x`
389
+ 7. Push with tags: `git push --tags`
390
+ 8. Create a GitHub Release — this triggers automatic PyPI publishing
391
+
392
+ ### Manual publish (if needed)
393
+
394
+ ```bash
395
+ python -m build
396
+ twine upload dist/*
397
+ ```
398
+
399
+ ---
400
+
401
+ ## Uninstall
402
+
403
+ ```bash
404
+ pip uninstall riva-agent
405
+ ```
406
+
407
+ Or use the uninstall script:
408
+
409
+ ```bash
410
+ curl -fsSL https://raw.githubusercontent.com/sarkar-ai/riva/main/uninstall.sh | bash
411
+ ```
412
+
413
+ ---
414
+
415
+ ## Early Stage Project
416
+
417
+ Riva is early-stage and evolving rapidly.
418
+
419
+ Expect:
420
+ - Rapid iteration
421
+ - API changes
422
+ - Active design discussions
423
+
424
+ Feedback is highly encouraged.
425
+
426
+ ---
427
+
428
+ ## Philosophy
429
+
430
+ If you cannot see what an agent is doing, you cannot trust it.
431
+
432
+ Riva exists to make local AI agents **inspectable, understandable, and safe**.
433
+
434
+ ---
435
+
436
+ ## Contributing
437
+
438
+ We welcome contributions and design discussions.
439
+
440
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
441
+
442
+ ---
443
+
444
+ ## License
445
+
446
+ MIT — see [LICENSE](LICENSE) for details.