profit 8c6e7831e9 Add Phase 10-12 implementation: multi-tenant, marketplace, observability
Major additions:
- marketplace/: Agent template registry with FTS5 search, ratings, versioning
- observability/: Prometheus metrics, distributed tracing, structured logging
- ledger/migrations/: Database migration scripts for multi-tenant support
- tests/governance/: 15 new test files for phases 6-12 (295 total tests)
- bin/validate-phases: Full 12-phase validation script

New features:
- Multi-tenant support with tenant isolation and quota enforcement
- Agent marketplace with semantic versioning and search
- Observability with metrics, tracing, and log correlation
- Tier-1 agent bootstrap scripts

Updated components:
- ledger/api.py: Extended API for tenants, marketplace, observability
- ledger/schema.sql: Added tenant, project, marketplace tables
- testing/framework.ts: Enhanced test framework
- checkpoint/checkpoint.py: Improved checkpoint management

Archived:
- External integrations (Slack/GitHub/PagerDuty) moved to .archive/
- Old checkpoint files cleaned up

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 18:39:47 -05:00

124 lines
3.3 KiB
Markdown

# Marketplace
> Agent template marketplace for sharing and discovering reusable agent configurations
## Overview
The marketplace provides a registry for publishing, discovering, and installing agent templates. Templates can be public (visible to all) or private (within a tenant), with versioning, ratings, and search capabilities.
## Key Files
| File | Description |
|------|-------------|
| `api.py` | FastAPI REST API for marketplace operations |
| `__init__.py` | Module initialization |
| `templates/` | Local storage for template content |
## Features
- **Template Registry**: Publish and manage agent templates
- **Semantic Versioning**: Track template versions with semver
- **Full-Text Search**: FTS5-powered search across names, descriptions, tags
- **Ratings & Reviews**: Community feedback with 1-5 star ratings
- **Categories**: general, automation, monitoring, security, devops, data
- **Installation Tracking**: Track which templates are installed where
## API Endpoints
| Endpoint | Method | Description |
|----------|--------|-------------|
| `/marketplace/templates` | GET | Browse/search templates |
| `/marketplace/templates/{id}` | GET | Get template details |
| `/marketplace/publish` | POST | Publish new template |
| `/marketplace/templates/{id}/versions` | POST | Add new version |
| `/marketplace/install` | POST | Install template to project |
| `/marketplace/uninstall` | POST | Remove installation |
| `/marketplace/ratings` | POST | Submit rating/review |
| `/marketplace/ratings/{id}` | GET | Get template ratings |
## Data Models
### Template
```json
{
"template_id": "tpl-xxx",
"name": "My Agent Template",
"slug": "my-agent-template",
"description": "Description of what this agent does",
"author_id": "tenant-123",
"category": "automation",
"tier_required": 0,
"is_public": true,
"is_verified": false,
"license": "MIT",
"tags": ["automation", "ci-cd"],
"capabilities": ["read_files", "execute_commands"]
}
```
### Version
```json
{
"version_id": "ver-xxx",
"template_id": "tpl-xxx",
"version": "1.2.0",
"release_notes": "Added new feature",
"config_schema": { "type": "object", "properties": {} },
"template_content": { "agent_config": {} }
}
```
## Usage
```python
from marketplace.api import router as marketplace_router
# Mount in FastAPI app
app.include_router(marketplace_router, prefix="/marketplace")
# Search templates
GET /marketplace/templates?q=automation&category=devops
# Publish template
POST /marketplace/publish
{
"name": "CI Pipeline Agent",
"slug": "ci-pipeline-agent",
"description": "Automates CI/CD pipelines",
"category": "devops"
}
# Install to project
POST /marketplace/install
{
"template_id": "tpl-xxx",
"project_id": "proj-123",
"version": "1.0.0"
}
```
## Database Schema
See `/opt/agent-governance/ledger/migrations/002_marketplace.sql` for:
- `agent_templates` - Core template registry
- `template_versions` - Version history
- `template_installations` - Installation tracking
- `template_ratings` - User ratings
- `template_downloads` - Download metrics
- `templates_fts` - Full-text search index
## Status
**Complete**
See [STATUS.md](./STATUS.md) for detailed progress tracking.
## Architecture Reference
Part of the [Agent Governance System](/opt/agent-governance/docs/ARCHITECTURE.md).
Parent: [Project Root](/opt/agent-governance)
---
*Last updated: 2026-01-24 UTC*