mirror of
https://github.com/blackboxprogramming/BlackRoad-Operating-System.git
synced 2026-03-17 00:57:12 -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
106 lines
2.8 KiB
Python
106 lines
2.8 KiB
Python
"""User models for the BlackRoad SDK."""
|
|
|
|
from datetime import datetime
|
|
from typing import Optional
|
|
|
|
from pydantic import BaseModel, EmailStr, Field
|
|
|
|
|
|
class UserCreate(BaseModel):
|
|
"""Model for creating a new user."""
|
|
|
|
username: str = Field(..., min_length=3, max_length=50, description="Username")
|
|
email: EmailStr = Field(..., description="Email address")
|
|
password: str = Field(..., min_length=8, description="Password")
|
|
full_name: Optional[str] = Field(None, max_length=255, description="Full name")
|
|
|
|
class Config:
|
|
"""Pydantic configuration."""
|
|
|
|
json_schema_extra = {
|
|
"example": {
|
|
"username": "john_doe",
|
|
"email": "john@example.com",
|
|
"password": "securepassword123",
|
|
"full_name": "John Doe",
|
|
}
|
|
}
|
|
|
|
|
|
class User(BaseModel):
|
|
"""User model."""
|
|
|
|
id: int
|
|
username: str
|
|
email: str
|
|
full_name: Optional[str] = None
|
|
avatar_url: Optional[str] = None
|
|
bio: Optional[str] = None
|
|
is_active: bool = True
|
|
is_verified: bool = False
|
|
is_admin: bool = False
|
|
wallet_address: Optional[str] = None
|
|
balance: float = 0.0
|
|
created_at: datetime
|
|
updated_at: Optional[datetime] = None
|
|
last_login: Optional[datetime] = None
|
|
|
|
class Config:
|
|
"""Pydantic configuration."""
|
|
|
|
from_attributes = True
|
|
json_schema_extra = {
|
|
"example": {
|
|
"id": 1,
|
|
"username": "john_doe",
|
|
"email": "john@example.com",
|
|
"full_name": "John Doe",
|
|
"avatar_url": None,
|
|
"bio": "Software developer",
|
|
"is_active": True,
|
|
"is_verified": False,
|
|
"is_admin": False,
|
|
"wallet_address": "0x1234567890abcdef",
|
|
"balance": 100.0,
|
|
"created_at": "2024-01-01T00:00:00Z",
|
|
"updated_at": None,
|
|
"last_login": None,
|
|
}
|
|
}
|
|
|
|
|
|
class Token(BaseModel):
|
|
"""Authentication token model."""
|
|
|
|
access_token: str
|
|
refresh_token: Optional[str] = None
|
|
token_type: str = "bearer"
|
|
|
|
class Config:
|
|
"""Pydantic configuration."""
|
|
|
|
json_schema_extra = {
|
|
"example": {
|
|
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
|
|
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
|
|
"token_type": "bearer",
|
|
}
|
|
}
|
|
|
|
|
|
class UserLogin(BaseModel):
|
|
"""Model for user login."""
|
|
|
|
username: str
|
|
password: str
|
|
|
|
class Config:
|
|
"""Pydantic configuration."""
|
|
|
|
json_schema_extra = {
|
|
"example": {
|
|
"username": "john_doe",
|
|
"password": "securepassword123",
|
|
}
|
|
}
|