Add swarm router and update arbitrage command parameters
Some checks failed
Cross-Node Transaction Testing / transaction-test (push) Successful in 3s
Deploy to Testnet / deploy-testnet (push) Successful in 1m12s
Documentation Validation / validate-docs (push) Failing after 16s
Integration Tests / test-service-integration (push) Has been cancelled
Multi-Node Stress Testing / stress-test (push) Has been cancelled
Node Failover Simulation / failover-test (push) Has been cancelled
Python Tests / test-python (push) Has been cancelled
Security Scanning / security-scan (push) Has been cancelled
Documentation Validation / validate-policies-strict (push) Successful in 4s

- Import swarm router in main.py
- Add swarm router with /v1 prefix and root prefix for CLI compatibility
- Add duplicate agent router at /api/v1/agents for CLI compatibility
- Update scenario 25 arbitrage analyze command parameters from wallet/resource-type/timeframe to market-a/market-b/token
This commit is contained in:
aitbc
2026-05-08 11:47:14 +02:00
parent f7c3a2ef80
commit 0333da0f77
3 changed files with 36 additions and 3 deletions

View File

@@ -65,6 +65,7 @@ from .routers import (
multi_modal_rl,
payments,
services,
swarm,
users,
web_vitals,
)
@@ -342,6 +343,7 @@ def create_app() -> FastAPI:
app.include_router(hermes_enhanced, prefix="/v1")
app.include_router(monitoring_dashboard, prefix="/v1")
app.include_router(agent_router.router, prefix="/v1/agents")
app.include_router(agent_router.router, prefix="/api/v1/agents") # CLI compatibility
app.include_router(agent_identity, prefix="/v1")
app.include_router(global_marketplace, prefix="/v1")
app.include_router(cross_chain_integration, prefix="/v1")
@@ -361,6 +363,10 @@ def create_app() -> FastAPI:
# Add multi-modal RL router
app.include_router(multi_modal_rl, prefix="/v1")
# Add swarm router for CLI compatibility
app.include_router(swarm.router, prefix="/v1")
app.include_router(swarm.router) # CLI compatibility (calls /swarm/list directly)
# Add Prometheus metrics endpoint
metrics_app = make_asgi_app()
app.mount("/metrics", metrics_app)

View File

@@ -0,0 +1,27 @@
"""Swarm coordination router for AITBC CLI integration."""
from typing import List, Optional
from fastapi import APIRouter, Query
from pydantic import BaseModel
router = APIRouter(prefix="/swarm", tags=["Swarm"])
class SwarmInfo(BaseModel):
"""Swarm information model."""
swarm_id: str
name: str
status: str
agent_count: int
task_count: int
@router.get("/list", response_model=List[SwarmInfo])
async def list_swarms(
swarm_id: Optional[str] = Query(None, description="Filter by swarm ID"),
status: Optional[str] = Query(None, description="Filter by status"),
limit: int = Query(20, description="Number of swarms to list")
):
"""List active swarms."""
# Return empty list for now - backend not fully implemented
return []

View File

@@ -74,9 +74,9 @@ Compare GPU prices across different listings.
```bash
aitbc arbitrage analyze \
--wallet my-agent-wallet \
--resource-type gpu \
--timeframe 1h
--market-a exchange-a \
--market-b exchange-b \
--token gpu
```
Output: