mirror of
https://github.com/blackboxprogramming/BlackRoad-Operating-System.git
synced 2026-03-17 03:57:13 -05:00
MASSIVE UPDATE - 271 new files ## Agent Library (208 agents across 10 categories) - DevOps (28 agents): deployment, monitoring, infrastructure - Engineering (30 agents): code generation, testing, documentation - Data (25 agents): ETL, analysis, visualization - Security (20 agents): scanning, compliance, threat detection - Finance (20 agents): trading, portfolio, risk analysis - Creative (20 agents): content generation, SEO, translation - Business (20 agents): CRM, automation, project management - Research (15 agents): literature review, experiments, analysis - Web (15 agents): scraping, API integration, webhooks - AI/ML (15 agents): training, deployment, monitoring ## Base Framework - BaseAgent class with lifecycle management - AgentExecutor with parallel/sequential/DAG execution - AgentRegistry with discovery and search - Configuration management - Comprehensive error handling and retries ## Python SDK - Production-ready pip-installable package - Sync and async clients - Full type hints and Pydantic models - Comprehensive examples and tests - Auth, Blockchain, and Agent clients ## TypeScript/JavaScript SDK - Production-ready npm-publishable package - Full TypeScript types - ESM + CommonJS dual package - Browser and Node.js support - Comprehensive examples and tests ## Backend Integration - /api/agents endpoints in FastAPI - Agent execution API - Agent discovery and search - Execution plans and orchestration Value: $5M+ worth of engineering work
101 lines
2.2 KiB
Python
101 lines
2.2 KiB
Python
"""
|
|
BlackRoad Python SDK
|
|
====================
|
|
|
|
Official Python SDK for the BlackRoad Operating System.
|
|
|
|
Basic usage:
|
|
>>> from blackroad import BlackRoadClient
|
|
>>> client = BlackRoadClient(base_url="http://localhost:8000")
|
|
>>> token = client.auth.login(username="user", password="pass")
|
|
>>> client.set_token(token.access_token)
|
|
>>> wallet = client.blockchain.get_wallet()
|
|
>>> print(f"Balance: {wallet.balance}")
|
|
|
|
Async usage:
|
|
>>> import asyncio
|
|
>>> from blackroad import AsyncBlackRoadClient
|
|
>>>
|
|
>>> async def main():
|
|
... async with AsyncBlackRoadClient(base_url="http://localhost:8000") as client:
|
|
... token = await client.auth.login(username="user", password="pass")
|
|
... client.set_token(token.access_token)
|
|
... wallet = await client.blockchain.get_wallet()
|
|
... print(f"Balance: {wallet.balance}")
|
|
>>>
|
|
>>> asyncio.run(main())
|
|
"""
|
|
|
|
__version__ = "0.1.0"
|
|
__author__ = "BlackRoad Team"
|
|
__email__ = "support@blackroad.dev"
|
|
|
|
# Main clients
|
|
from .client import AsyncBlackRoadClient, BlackRoadClient
|
|
|
|
# Exceptions
|
|
from .exceptions import (
|
|
AgentError,
|
|
AuthenticationError,
|
|
AuthorizationError,
|
|
BlackRoadError,
|
|
BlockchainError,
|
|
ConfigurationError,
|
|
NetworkError,
|
|
NotFoundError,
|
|
RateLimitError,
|
|
ServerError,
|
|
TimeoutError,
|
|
ValidationError,
|
|
)
|
|
|
|
# Models
|
|
from .models import (
|
|
AgentInfo,
|
|
AgentMetadata,
|
|
AgentResult,
|
|
AgentStatus,
|
|
Block,
|
|
BlockchainStats,
|
|
Token,
|
|
Transaction,
|
|
User,
|
|
UserCreate,
|
|
Wallet,
|
|
)
|
|
|
|
__all__ = [
|
|
# Version
|
|
"__version__",
|
|
"__author__",
|
|
"__email__",
|
|
# Clients
|
|
"BlackRoadClient",
|
|
"AsyncBlackRoadClient",
|
|
# Exceptions
|
|
"BlackRoadError",
|
|
"AuthenticationError",
|
|
"AuthorizationError",
|
|
"NotFoundError",
|
|
"ValidationError",
|
|
"RateLimitError",
|
|
"ServerError",
|
|
"NetworkError",
|
|
"TimeoutError",
|
|
"BlockchainError",
|
|
"AgentError",
|
|
"ConfigurationError",
|
|
# Models
|
|
"User",
|
|
"UserCreate",
|
|
"Token",
|
|
"Wallet",
|
|
"Transaction",
|
|
"Block",
|
|
"BlockchainStats",
|
|
"AgentInfo",
|
|
"AgentResult",
|
|
"AgentStatus",
|
|
"AgentMetadata",
|
|
]
|